@amalgm/live 0.2.23 → 0.2.24
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/PURPOSE.md +25 -9
- package/dist/detection/batch.d.ts +49 -0
- package/dist/detection/batch.d.ts.map +1 -0
- package/dist/detection/batch.js +66 -0
- package/dist/detection/batch.js.map +1 -0
- package/dist/detection/content.d.ts +30 -0
- package/dist/detection/content.d.ts.map +1 -0
- package/dist/detection/content.js +115 -0
- package/dist/detection/content.js.map +1 -0
- package/dist/detection/echo.d.ts +20 -0
- package/dist/detection/echo.d.ts.map +1 -0
- package/dist/detection/echo.js +22 -0
- package/dist/detection/echo.js.map +1 -0
- package/dist/detection/enrollment.d.ts +21 -10
- package/dist/detection/enrollment.d.ts.map +1 -1
- package/dist/detection/enrollment.js +22 -12
- package/dist/detection/enrollment.js.map +1 -1
- package/dist/detection/index.d.ts +15 -1
- package/dist/detection/index.d.ts.map +1 -1
- package/dist/detection/index.js +15 -1
- package/dist/detection/index.js.map +1 -1
- package/dist/detection/record-proposal.d.ts +77 -0
- package/dist/detection/record-proposal.d.ts.map +1 -0
- package/dist/detection/record-proposal.js +158 -0
- package/dist/detection/record-proposal.js.map +1 -0
- package/dist/detection/repository.d.ts +28 -0
- package/dist/detection/repository.d.ts.map +1 -0
- package/dist/detection/repository.js +64 -0
- package/dist/detection/repository.js.map +1 -0
- package/dist/detection/territory.d.ts +29 -0
- package/dist/detection/territory.d.ts.map +1 -0
- package/dist/detection/territory.js +78 -0
- package/dist/detection/territory.js.map +1 -0
- package/dist/detection/watch-boundary.d.ts +29 -0
- package/dist/detection/watch-boundary.d.ts.map +1 -0
- package/dist/detection/watch-boundary.js +47 -0
- package/dist/detection/watch-boundary.js.map +1 -0
- package/dist/files/commands.d.ts +6 -0
- package/dist/files/commands.d.ts.map +1 -1
- package/dist/files/commands.js.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detect's exact output to Record.
|
|
3
|
+
*
|
|
4
|
+
* A proposal is not yet a durable mutation: Record assigns one mutation id,
|
|
5
|
+
* appends it atomically, and then Send publishes that same row. Detect owns the
|
|
6
|
+
* complete result and replay instruction so no later rail has to rediscover
|
|
7
|
+
* filesystem truth.
|
|
8
|
+
*/
|
|
9
|
+
import { type CloudEntityRecord } from '../entities/cloud.js';
|
|
10
|
+
import { type ContentManifest } from '../contracts/content.js';
|
|
11
|
+
import { type TransferArtifact } from '../transfer/artifacts.js';
|
|
12
|
+
export declare const DETECTED_CHANGE_CONTRACT = "amalgm.detected-change-proposal@1";
|
|
13
|
+
export type ChangeFacet = 'create' | 'rename' | 'move' | 'retype' | 'content' | 'trash' | 'restore';
|
|
14
|
+
export interface StructureReplay {
|
|
15
|
+
readonly kind: 'structure';
|
|
16
|
+
}
|
|
17
|
+
/** One byte-exact replacement span. Offsets are bytes, not UTF-16 indexes. */
|
|
18
|
+
export interface TextSplice {
|
|
19
|
+
readonly offset: number;
|
|
20
|
+
readonly deleteBytes: number;
|
|
21
|
+
readonly insert: Uint8Array;
|
|
22
|
+
}
|
|
23
|
+
export interface TextReplay {
|
|
24
|
+
readonly kind: 'file.text';
|
|
25
|
+
readonly mode: 'delta' | 'snapshot';
|
|
26
|
+
readonly basePayloadVersion: string | null;
|
|
27
|
+
readonly resultPayloadVersion: string;
|
|
28
|
+
readonly delta: TextSplice | null;
|
|
29
|
+
}
|
|
30
|
+
export interface BinaryReplay {
|
|
31
|
+
readonly kind: 'file.binary';
|
|
32
|
+
readonly resultPayloadVersion: string;
|
|
33
|
+
readonly manifest: ContentManifest;
|
|
34
|
+
}
|
|
35
|
+
export interface LinkReplay {
|
|
36
|
+
readonly kind: 'link';
|
|
37
|
+
readonly resultPayloadVersion: string;
|
|
38
|
+
readonly target: string;
|
|
39
|
+
}
|
|
40
|
+
export interface RepositoryReplay {
|
|
41
|
+
readonly kind: 'repo.git';
|
|
42
|
+
readonly stateId: string;
|
|
43
|
+
readonly cardId: string;
|
|
44
|
+
readonly checkpointId: string;
|
|
45
|
+
readonly cardChanged: boolean;
|
|
46
|
+
readonly checkpointChanged: boolean;
|
|
47
|
+
readonly parentTransportVersion: string | null;
|
|
48
|
+
readonly transportVersion: string;
|
|
49
|
+
}
|
|
50
|
+
export type ReplayInstruction = StructureReplay | TextReplay | BinaryReplay | LinkReplay | RepositoryReplay;
|
|
51
|
+
export interface DetectedChangeProposal {
|
|
52
|
+
readonly contract: typeof DETECTED_CHANGE_CONTRACT;
|
|
53
|
+
/** The permanent UUID whose ordered rail carries this proposal. */
|
|
54
|
+
readonly resourceId: string;
|
|
55
|
+
readonly baseVersion: string | null;
|
|
56
|
+
/** Complete exact result, not a partial update. */
|
|
57
|
+
readonly result: CloudEntityRecord;
|
|
58
|
+
readonly facets: readonly ChangeFacet[];
|
|
59
|
+
readonly replay: ReplayInstruction;
|
|
60
|
+
/** Immutable warehouse objects the replay may need. Heavy bytes are not here. */
|
|
61
|
+
readonly cargo: readonly TransferArtifact[];
|
|
62
|
+
}
|
|
63
|
+
export interface DetectedChangeInput {
|
|
64
|
+
readonly base: CloudEntityRecord | null;
|
|
65
|
+
readonly result: CloudEntityRecord;
|
|
66
|
+
readonly replay: ReplayInstruction;
|
|
67
|
+
/** Required when Detection is explicitly authorized to propose lifecycle. */
|
|
68
|
+
readonly lifecycleAuthorization?: 'trash' | 'restore';
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Build one immutable proposal, or null when settled truth has the same logical
|
|
72
|
+
* version. A repository transport-only change is still meaningful because its
|
|
73
|
+
* worktree identity map is part of exact reproduction even when Card and
|
|
74
|
+
* Checkpoint IDs did not move.
|
|
75
|
+
*/
|
|
76
|
+
export declare function detectedChangeProposal(input: DetectedChangeInput): DetectedChangeProposal | null;
|
|
77
|
+
//# sourceMappingURL=record-proposal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-proposal.d.ts","sourceRoot":"","sources":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wBAAgB,sBAAsB,CACpC,KAAK,EAAE,mBAAmB,GACzB,sBAAsB,GAAG,IAAI,CAkD/B"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detect's exact output to Record.
|
|
3
|
+
*
|
|
4
|
+
* A proposal is not yet a durable mutation: Record assigns one mutation id,
|
|
5
|
+
* appends it atomically, and then Send publishes that same row. Detect owns the
|
|
6
|
+
* complete result and replay instruction so no later rail has to rediscover
|
|
7
|
+
* filesystem truth.
|
|
8
|
+
*/
|
|
9
|
+
import { assertRecord, } from '../entities/cloud.js';
|
|
10
|
+
import { DERIVED_PAYLOAD } from '../entities/types.js';
|
|
11
|
+
import { checkContentManifest } from '../contracts/content.js';
|
|
12
|
+
import { artifactForRecord } from '../transfer/artifacts.js';
|
|
13
|
+
export const DETECTED_CHANGE_CONTRACT = 'amalgm.detected-change-proposal@1';
|
|
14
|
+
const HASH = /^[0-9a-f]{64}$/;
|
|
15
|
+
const facetsOf = (base, result) => {
|
|
16
|
+
if (base === null)
|
|
17
|
+
return ['create'];
|
|
18
|
+
const facets = [];
|
|
19
|
+
if (base.parentUUID !== result.parentUUID)
|
|
20
|
+
facets.push('move');
|
|
21
|
+
if (base.name !== result.name)
|
|
22
|
+
facets.push('rename');
|
|
23
|
+
if (base.type !== result.type)
|
|
24
|
+
facets.push('retype');
|
|
25
|
+
const resultCarriesPayload = !DERIVED_PAYLOAD.has(result.type) && result.type !== 'reference';
|
|
26
|
+
if ((base.payloadVersion !== result.payloadVersion
|
|
27
|
+
&& (base.type === result.type || resultCarriesPayload))
|
|
28
|
+
|| (result.type === 'repo.git' && base.transportVersion !== result.transportVersion)) {
|
|
29
|
+
facets.push('content');
|
|
30
|
+
}
|
|
31
|
+
if (base.status !== result.status) {
|
|
32
|
+
if (result.status === 'trashed')
|
|
33
|
+
facets.push('trash');
|
|
34
|
+
else if (base.status === 'trashed' && result.status === 'active')
|
|
35
|
+
facets.push('restore');
|
|
36
|
+
}
|
|
37
|
+
return facets;
|
|
38
|
+
};
|
|
39
|
+
const contentRequired = (base, result, facets) => result.status === 'active'
|
|
40
|
+
&& (base === null || facets.includes('content') || facets.includes('retype'))
|
|
41
|
+
&& ['file.text', 'file.binary', 'link', 'repo.git'].includes(result.type);
|
|
42
|
+
const validateReplay = (base, result, facets, replay) => {
|
|
43
|
+
const needsContent = contentRequired(base, result, facets);
|
|
44
|
+
if (!needsContent) {
|
|
45
|
+
if (replay.kind !== 'structure') {
|
|
46
|
+
throw new Error('a structural-only detected change must use structure replay');
|
|
47
|
+
}
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (replay.kind !== result.type) {
|
|
51
|
+
throw new Error(`detected ${result.type} content cannot use ${replay.kind} replay`);
|
|
52
|
+
}
|
|
53
|
+
if (result.payloadVersion === null) {
|
|
54
|
+
throw new Error(`detected ${result.type} content has no result payload version`);
|
|
55
|
+
}
|
|
56
|
+
switch (replay.kind) {
|
|
57
|
+
case 'file.text':
|
|
58
|
+
if (replay.basePayloadVersion !== (base?.payloadVersion ?? null)
|
|
59
|
+
|| replay.resultPayloadVersion !== result.payloadVersion
|
|
60
|
+
|| (replay.mode === 'delta') !== (replay.delta !== null)) {
|
|
61
|
+
throw new Error('text replay does not name the detected base and result');
|
|
62
|
+
}
|
|
63
|
+
if (!HASH.test(replay.resultPayloadVersion)
|
|
64
|
+
|| (replay.basePayloadVersion !== null && !HASH.test(replay.basePayloadVersion))) {
|
|
65
|
+
throw new Error('text replay has an invalid content head');
|
|
66
|
+
}
|
|
67
|
+
if (replay.delta !== null
|
|
68
|
+
&& (!Number.isSafeInteger(replay.delta.offset) || replay.delta.offset < 0
|
|
69
|
+
|| !Number.isSafeInteger(replay.delta.deleteBytes) || replay.delta.deleteBytes < 0
|
|
70
|
+
|| !(replay.delta.insert instanceof Uint8Array))) {
|
|
71
|
+
throw new Error('text replay has an invalid byte splice');
|
|
72
|
+
}
|
|
73
|
+
break;
|
|
74
|
+
case 'file.binary': {
|
|
75
|
+
const manifest = checkContentManifest(replay.manifest, result.payloadVersion);
|
|
76
|
+
if (!manifest.ok || replay.resultPayloadVersion !== result.payloadVersion) {
|
|
77
|
+
throw new Error('binary replay does not name the detected result');
|
|
78
|
+
}
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
case 'link':
|
|
82
|
+
if (typeof replay.target !== 'string'
|
|
83
|
+
|| replay.resultPayloadVersion !== result.payloadVersion
|
|
84
|
+
|| !HASH.test(replay.resultPayloadVersion)) {
|
|
85
|
+
throw new Error('link replay does not name the detected result');
|
|
86
|
+
}
|
|
87
|
+
break;
|
|
88
|
+
case 'repo.git':
|
|
89
|
+
if (replay.stateId !== result.payloadVersion
|
|
90
|
+
|| result.transportVersion === null
|
|
91
|
+
|| replay.transportVersion !== result.transportVersion
|
|
92
|
+
|| ![replay.stateId, replay.cardId, replay.checkpointId, replay.transportVersion]
|
|
93
|
+
.every((head) => HASH.test(head))
|
|
94
|
+
|| (replay.parentTransportVersion !== null && !HASH.test(replay.parentTransportVersion))
|
|
95
|
+
|| typeof replay.cardChanged !== 'boolean'
|
|
96
|
+
|| typeof replay.checkpointChanged !== 'boolean') {
|
|
97
|
+
throw new Error('repository replay does not name the detected state and transport');
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Build one immutable proposal, or null when settled truth has the same logical
|
|
104
|
+
* version. A repository transport-only change is still meaningful because its
|
|
105
|
+
* worktree identity map is part of exact reproduction even when Card and
|
|
106
|
+
* Checkpoint IDs did not move.
|
|
107
|
+
*/
|
|
108
|
+
export function detectedChangeProposal(input) {
|
|
109
|
+
const result = assertRecord(input.result);
|
|
110
|
+
const base = input.base === null ? null : assertRecord(input.base);
|
|
111
|
+
if (base !== null && base.uuid !== result.uuid) {
|
|
112
|
+
throw new Error('a detected transition cannot change entity UUID');
|
|
113
|
+
}
|
|
114
|
+
if (base === null && result.status !== 'active') {
|
|
115
|
+
throw new Error('newly detected ground must begin active');
|
|
116
|
+
}
|
|
117
|
+
if (base?.status === 'deleted') {
|
|
118
|
+
throw new Error('Detection cannot resurrect a deleted tombstone');
|
|
119
|
+
}
|
|
120
|
+
if (result.status === 'deleted') {
|
|
121
|
+
throw new Error('Detection cannot propose permanent deletion; deletion is an explicit lifecycle operation');
|
|
122
|
+
}
|
|
123
|
+
if (base?.version === result.version && base.transportVersion === result.transportVersion) {
|
|
124
|
+
const sameState = base.type === result.type
|
|
125
|
+
&& base.parentUUID === result.parentUUID
|
|
126
|
+
&& base.name === result.name
|
|
127
|
+
&& base.status === result.status
|
|
128
|
+
&& base.payloadVersion === result.payloadVersion;
|
|
129
|
+
if (!sameState)
|
|
130
|
+
throw new Error('one logical version cannot name two different entity states');
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
const facets = facetsOf(base, result);
|
|
134
|
+
if (facets.length === 0) {
|
|
135
|
+
throw new Error('detected records disagree without a named logical facet');
|
|
136
|
+
}
|
|
137
|
+
if (facets.includes('trash') && input.lifecycleAuthorization !== 'trash') {
|
|
138
|
+
throw new Error('filesystem absence is not authority to Trash an entity');
|
|
139
|
+
}
|
|
140
|
+
if (facets.includes('restore') && input.lifecycleAuthorization !== 'restore') {
|
|
141
|
+
throw new Error('restoring an entity requires explicit lifecycle authority');
|
|
142
|
+
}
|
|
143
|
+
validateReplay(base, result, facets, input.replay);
|
|
144
|
+
const artifact = input.replay.kind === 'structure' ? null : artifactForRecord(result);
|
|
145
|
+
if (input.replay.kind !== 'structure' && artifact === null) {
|
|
146
|
+
throw new Error(`detected ${result.type} replay has no transferable artifact`);
|
|
147
|
+
}
|
|
148
|
+
return Object.freeze({
|
|
149
|
+
contract: DETECTED_CHANGE_CONTRACT,
|
|
150
|
+
resourceId: result.uuid,
|
|
151
|
+
baseVersion: base?.version ?? null,
|
|
152
|
+
result,
|
|
153
|
+
facets: Object.freeze(facets),
|
|
154
|
+
replay: input.replay,
|
|
155
|
+
cargo: Object.freeze(artifact === null ? [] : [artifact]),
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=record-proposal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-proposal.js","sourceRoot":"","sources":["../../src/detection/record-proposal.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,YAAY,GAEb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAwB,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAyB,MAAM,0BAA0B,CAAC;AAEpF,MAAM,CAAC,MAAM,wBAAwB,GAAG,mCAAmC,CAAC;AAiF5E,MAAM,IAAI,GAAG,gBAAgB,CAAC;AAE9B,MAAM,QAAQ,GAAG,CACf,IAA8B,EAC9B,MAAyB,EACV,EAAE;IACjB,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,IAAI,IAAI,CAAC,UAAU,KAAK,MAAM,CAAC,UAAU;QAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/D,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI;QAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrD,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI;QAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrD,MAAM,oBAAoB,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,KAAK,WAAW,CAAC;IAC9F,IAAI,CAAC,IAAI,CAAC,cAAc,KAAK,MAAM,CAAC,cAAc;WAC3C,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAA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,EAAE,wBAAwB;QAClC,UAAU,EAAE,MAAM,CAAC,IAAI;QACvB,WAAW,EAAE,IAAI,EAAE,OAAO,IAAI,IAAI;QAClC,MAAM;QACN,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;QAC7B,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;KAC1D,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Repository detection through the existing Card + Checkpoint transport. */
|
|
2
|
+
import { type RepoIdentityEntry, type RepoState } from '../entities/repo-states.js';
|
|
3
|
+
import type { Sha256Hex } from '../entities/types.js';
|
|
4
|
+
import type { CapturedContent } from './content.js';
|
|
5
|
+
import type { RepositoryReplay } from './record-proposal.js';
|
|
6
|
+
export interface PreviousRepositoryCapture {
|
|
7
|
+
readonly stateId: string;
|
|
8
|
+
readonly cardId: string;
|
|
9
|
+
readonly checkpointId: string;
|
|
10
|
+
readonly transportVersion: string;
|
|
11
|
+
readonly identity: readonly RepoIdentityEntry[];
|
|
12
|
+
}
|
|
13
|
+
export interface RepositoryCaptureInput {
|
|
14
|
+
readonly entityId: string;
|
|
15
|
+
/** Git-native capture. `pack` may be a thin incremental pack from the host. */
|
|
16
|
+
readonly state: RepoState;
|
|
17
|
+
readonly identity: readonly RepoIdentityEntry[];
|
|
18
|
+
readonly previous: PreviousRepositoryCapture | null;
|
|
19
|
+
}
|
|
20
|
+
export type CapturedRepository = CapturedContent<RepositoryReplay>;
|
|
21
|
+
/**
|
|
22
|
+
* Verify a fresh full Card + Checkpoint observation and seal one incremental
|
|
23
|
+
* repository transport. Git discovery and pack construction are host effects;
|
|
24
|
+
* this function owns the portable IDs, identity-map delta, binary transport,
|
|
25
|
+
* and exact cargo head.
|
|
26
|
+
*/
|
|
27
|
+
export declare function captureRepositoryChange(input: RepositoryCaptureInput, sha256Hex: Sha256Hex): CapturedRepository | null;
|
|
28
|
+
//# sourceMappingURL=repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../src/detection/repository.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAE7E,OAAO,EAOL,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACjD;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAChD,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,GAAG,IAAI,CAAC;CACrD;AAED,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC;AAcnE;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,sBAAsB,EAC7B,SAAS,EAAE,SAAS,GACnB,kBAAkB,GAAG,IAAI,CA+C3B"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** Repository detection through the existing Card + Checkpoint transport. */
|
|
2
|
+
import { deriveCardId, deriveCheckpointId, deriveStateId, encodeRepositoryTransport, planRepositoryIdentity, repositoryIdentityHash, } from '../entities/repo-states.js';
|
|
3
|
+
import { deriveUploadManifest } from '../transfer/upload.js';
|
|
4
|
+
const verifyState = (state, sha256Hex) => {
|
|
5
|
+
const cardId = deriveCardId(state.card, sha256Hex);
|
|
6
|
+
const checkpointId = deriveCheckpointId(state.checkpoint, sha256Hex);
|
|
7
|
+
const stateId = deriveStateId(cardId, checkpointId, sha256Hex);
|
|
8
|
+
if (state.cardId !== cardId || state.checkpointId !== checkpointId || state.stateId !== stateId) {
|
|
9
|
+
throw new Error('repository capture IDs do not describe its Card and Checkpoint');
|
|
10
|
+
}
|
|
11
|
+
if (state.pack !== null && sha256Hex(state.pack.bytes) !== state.pack.sha256) {
|
|
12
|
+
throw new Error('repository Git pack does not match its declared hash');
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Verify a fresh full Card + Checkpoint observation and seal one incremental
|
|
17
|
+
* repository transport. Git discovery and pack construction are host effects;
|
|
18
|
+
* this function owns the portable IDs, identity-map delta, binary transport,
|
|
19
|
+
* and exact cargo head.
|
|
20
|
+
*/
|
|
21
|
+
export function captureRepositoryChange(input, sha256Hex) {
|
|
22
|
+
verifyState(input.state, sha256Hex);
|
|
23
|
+
if (input.previous
|
|
24
|
+
&& new Set(input.previous.identity.map((entry) => entry.path)).size !== input.previous.identity.length) {
|
|
25
|
+
throw new Error('previous repository identity map has duplicate paths');
|
|
26
|
+
}
|
|
27
|
+
const identity = planRepositoryIdentity(input.identity, input.previous?.identity ?? null, sha256Hex);
|
|
28
|
+
const currentIdentityHash = repositoryIdentityHash(input.identity, sha256Hex);
|
|
29
|
+
if (input.previous?.stateId === input.state.stateId
|
|
30
|
+
&& repositoryIdentityHash(input.previous.identity, sha256Hex) === currentIdentityHash) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const bytes = encodeRepositoryTransport(input.state, {
|
|
34
|
+
parentTransportVersion: input.previous?.transportVersion ?? null,
|
|
35
|
+
identityHash: identity.identityHash,
|
|
36
|
+
identityDelta: identity.identityDelta,
|
|
37
|
+
});
|
|
38
|
+
const transportVersion = sha256Hex(bytes);
|
|
39
|
+
const artifact = Object.freeze({
|
|
40
|
+
entityId: input.entityId,
|
|
41
|
+
entityType: 'repo.git',
|
|
42
|
+
kind: 'git',
|
|
43
|
+
contentHash: transportVersion,
|
|
44
|
+
});
|
|
45
|
+
const cargo = Object.freeze({
|
|
46
|
+
artifact,
|
|
47
|
+
bytes,
|
|
48
|
+
manifest: deriveUploadManifest(artifact, bytes, sha256Hex),
|
|
49
|
+
});
|
|
50
|
+
return Object.freeze({
|
|
51
|
+
replay: Object.freeze({
|
|
52
|
+
kind: 'repo.git',
|
|
53
|
+
stateId: input.state.stateId,
|
|
54
|
+
cardId: input.state.cardId,
|
|
55
|
+
checkpointId: input.state.checkpointId,
|
|
56
|
+
cardChanged: input.previous?.cardId !== input.state.cardId,
|
|
57
|
+
checkpointChanged: input.previous?.checkpointId !== input.state.checkpointId,
|
|
58
|
+
parentTransportVersion: input.previous?.transportVersion ?? null,
|
|
59
|
+
transportVersion,
|
|
60
|
+
}),
|
|
61
|
+
cargo,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.js","sourceRoot":"","sources":["../../src/detection/repository.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAE7E,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,GAGvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAsB7D,MAAM,WAAW,GAAG,CAAC,KAAgB,EAAE,SAAoB,EAAQ,EAAE;I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,MAAM;YAC1D,iBAAiB,EAAE,KAAK,CAAC,QAAQ,EAAE,YAAY,KAAK,KAAK,CAAC,KAAK,CAAC,YAAY;YAC5E,sBAAsB,EAAE,KAAK,CAAC,QAAQ,EAAE,gBAAgB,IAAI,IAAI;YAChE,gBAAgB;SACjB,CAAC;QACF,KAAK;KACN,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Nearest-repository ownership for one detected entity transition. */
|
|
2
|
+
import type { CloudEntityRecord } from '../entities/cloud.js';
|
|
3
|
+
import type { EntityReadPort, EntityRow } from '../entities/types.js';
|
|
4
|
+
export interface EntityRecorderTarget {
|
|
5
|
+
readonly kind: 'entity';
|
|
6
|
+
readonly resourceId: string;
|
|
7
|
+
}
|
|
8
|
+
export interface RepositoryRecorderTarget {
|
|
9
|
+
readonly kind: 'repository';
|
|
10
|
+
readonly resourceId: string;
|
|
11
|
+
}
|
|
12
|
+
export type RecorderTarget = EntityRecorderTarget | RepositoryRecorderTarget;
|
|
13
|
+
export interface RecorderTransition {
|
|
14
|
+
readonly base: Pick<CloudEntityRecord, 'uuid' | 'type' | 'parentUUID' | 'name' | 'status'> | null;
|
|
15
|
+
readonly result: Pick<CloudEntityRecord, 'uuid' | 'type' | 'parentUUID' | 'name' | 'status'>;
|
|
16
|
+
}
|
|
17
|
+
/** The nearest repo at or above `uuid`; nested repositories win. */
|
|
18
|
+
export declare function nearestRepository(uuid: string | null, byUuid: EntityReadPort['byUuid']): EntityRow | null;
|
|
19
|
+
/**
|
|
20
|
+
* Name every recorder whose state a transition can change.
|
|
21
|
+
*
|
|
22
|
+
* Ordinary changes outside repository territory publish on the entity UUID.
|
|
23
|
+
* A change wholly inside one repository publishes only the repository parcel.
|
|
24
|
+
* Crossing a repository boundary also publishes the entity graph transition,
|
|
25
|
+
* plus the source and/or destination repositories whose identity maps and
|
|
26
|
+
* Checkpoints changed.
|
|
27
|
+
*/
|
|
28
|
+
export declare function recorderTargets(transition: RecorderTransition, byUuid: EntityReadPort['byUuid']): readonly RecorderTarget[];
|
|
29
|
+
//# sourceMappingURL=territory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"territory.d.ts","sourceRoot":"","sources":["../../src/detection/territory.ts"],"names":[],"mappings":"AAAA,uEAAuE;AAEvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,MAAM,cAAc,GAAG,oBAAoB,GAAG,wBAAwB,CAAC;AAE7E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAC;IAClG,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC;CAC9F;AAED,oEAAoE;AACpE,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAC/B,SAAS,GAAG,IAAI,CAYlB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,kBAAkB,EAC9B,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAC/B,SAAS,cAAc,EAAE,CA+C3B"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** Nearest-repository ownership for one detected entity transition. */
|
|
2
|
+
/** The nearest repo at or above `uuid`; nested repositories win. */
|
|
3
|
+
export function nearestRepository(uuid, byUuid) {
|
|
4
|
+
const seen = new Set();
|
|
5
|
+
let cursor = uuid;
|
|
6
|
+
while (cursor !== null) {
|
|
7
|
+
if (seen.has(cursor))
|
|
8
|
+
throw new Error(`registry corrupt: parent cycle at ${cursor}`);
|
|
9
|
+
seen.add(cursor);
|
|
10
|
+
const row = byUuid(cursor);
|
|
11
|
+
if (!row)
|
|
12
|
+
throw new Error(`no entity ${cursor}`);
|
|
13
|
+
if (row.type === 'repo.git')
|
|
14
|
+
return row;
|
|
15
|
+
cursor = row.parentUuid;
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Name every recorder whose state a transition can change.
|
|
21
|
+
*
|
|
22
|
+
* Ordinary changes outside repository territory publish on the entity UUID.
|
|
23
|
+
* A change wholly inside one repository publishes only the repository parcel.
|
|
24
|
+
* Crossing a repository boundary also publishes the entity graph transition,
|
|
25
|
+
* plus the source and/or destination repositories whose identity maps and
|
|
26
|
+
* Checkpoints changed.
|
|
27
|
+
*/
|
|
28
|
+
export function recorderTargets(transition, byUuid) {
|
|
29
|
+
const { base, result } = transition;
|
|
30
|
+
if (base !== null && base.uuid !== result.uuid) {
|
|
31
|
+
throw new Error('a recorder transition cannot change entity UUID');
|
|
32
|
+
}
|
|
33
|
+
const before = nearestRepository(base?.parentUUID ?? null, byUuid);
|
|
34
|
+
const after = nearestRepository(result.parentUUID, byUuid);
|
|
35
|
+
const add = (targets, target) => {
|
|
36
|
+
if (!targets.some((candidate) => candidate.resourceId === target.resourceId))
|
|
37
|
+
targets.push(target);
|
|
38
|
+
};
|
|
39
|
+
// Every `.git` boundary starts its own repository rail, even when nested.
|
|
40
|
+
// Its enclosing repository changes only when the boundary's graph entry
|
|
41
|
+
// changes; ordinary Card/Checkpoint advancement remains on the inner rail.
|
|
42
|
+
if (base?.type === 'repo.git' || result.type === 'repo.git') {
|
|
43
|
+
const targets = [];
|
|
44
|
+
add(targets, {
|
|
45
|
+
kind: result.type === 'repo.git' ? 'repository' : 'entity',
|
|
46
|
+
resourceId: result.uuid,
|
|
47
|
+
});
|
|
48
|
+
const boundaryChanged = base === null
|
|
49
|
+
|| base.type !== result.type
|
|
50
|
+
|| base.parentUUID !== result.parentUUID
|
|
51
|
+
|| base.name !== result.name
|
|
52
|
+
|| base.status !== result.status;
|
|
53
|
+
if (boundaryChanged) {
|
|
54
|
+
if (before)
|
|
55
|
+
add(targets, { kind: 'repository', resourceId: before.uuid });
|
|
56
|
+
if (after)
|
|
57
|
+
add(targets, { kind: 'repository', resourceId: after.uuid });
|
|
58
|
+
}
|
|
59
|
+
return Object.freeze(targets);
|
|
60
|
+
}
|
|
61
|
+
if (base === null) {
|
|
62
|
+
return Object.freeze(after
|
|
63
|
+
? [{ kind: 'repository', resourceId: after.uuid }]
|
|
64
|
+
: [{ kind: 'entity', resourceId: result.uuid }]);
|
|
65
|
+
}
|
|
66
|
+
if (before?.uuid === after?.uuid) {
|
|
67
|
+
return Object.freeze(before
|
|
68
|
+
? [{ kind: 'repository', resourceId: before.uuid }]
|
|
69
|
+
: [{ kind: 'entity', resourceId: result.uuid }]);
|
|
70
|
+
}
|
|
71
|
+
const targets = [{ kind: 'entity', resourceId: result.uuid }];
|
|
72
|
+
for (const repository of [before, after]) {
|
|
73
|
+
if (repository)
|
|
74
|
+
add(targets, { kind: 'repository', resourceId: repository.uuid });
|
|
75
|
+
}
|
|
76
|
+
return Object.freeze(targets);
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=territory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"territory.js","sourceRoot":"","sources":["../../src/detection/territory.ts"],"names":[],"mappings":"AAAA,uEAAuE;AAsBvE,oEAAoE;AACpE,MAAM,UAAU,iBAAiB,CA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,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAiB,EAAE,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9D,CAAC;IACD,IAAI,MAAM,EAAE,IAAI,KAAK,KAAK,EAAE,IAAI,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM;YACzB,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,YAAqB,EAAE,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;YAC5D,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAiB,EAAE,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9D,CAAC;IACD,MAAM,OAAO,GAAqB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IAChF,KAAK,MAAM,UAAU,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;QACzC,IAAI,UAAU;YAAE,GAAG,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;IACpF,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The complete portable boundary from Watch into Detect and back.
|
|
3
|
+
*
|
|
4
|
+
* Watch contributes generation-stamped suspicion only. Detect retains that
|
|
5
|
+
* generation until Record has durably accepted every resulting proposal. A
|
|
6
|
+
* discovered directory creates a logical coverage request; the Watch host
|
|
7
|
+
* decides whether its backend needs another native handle.
|
|
8
|
+
*/
|
|
9
|
+
import type { SuspicionSnapshot } from '../watching/suspicion.js';
|
|
10
|
+
export interface DetectionBatch {
|
|
11
|
+
readonly rootId: string;
|
|
12
|
+
readonly generation: number;
|
|
13
|
+
/** null means the complete covered root. */
|
|
14
|
+
readonly suspects: readonly string[] | null;
|
|
15
|
+
}
|
|
16
|
+
export interface DirectoryCoverageRequest {
|
|
17
|
+
readonly kind: 'directory-discovered';
|
|
18
|
+
readonly rootId: string;
|
|
19
|
+
readonly relPath: string;
|
|
20
|
+
}
|
|
21
|
+
/** Freeze Watch's snapshot into Detection's input vocabulary. */
|
|
22
|
+
export declare function detectionBatch(rootId: string, snapshot: SuspicionSnapshot): DetectionBatch;
|
|
23
|
+
/**
|
|
24
|
+
* Tell Watch that newly enrolled directory ground now exists. This is emitted
|
|
25
|
+
* on every platform; only the Watch backend knows whether coverage expansion
|
|
26
|
+
* means another Linux inotify handle or merely a routing-table update.
|
|
27
|
+
*/
|
|
28
|
+
export declare function directoryCoverageRequests(batch: Pick<DetectionBatch, 'rootId'>, createdDirectories: readonly string[]): readonly DirectoryCoverageRequest[];
|
|
29
|
+
//# sourceMappingURL=watch-boundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch-boundary.d.ts","sourceRoot":"","sources":["../../src/detection/watch-boundary.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAelE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,4CAA4C;IAC5C,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;CAC7C;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,iEAAiE;AACjE,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,iBAAiB,GAC1B,cAAc,CAShB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,EACrC,kBAAkB,EAAE,SAAS,MAAM,EAAE,GACpC,SAAS,wBAAwB,EAAE,CAQrC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The complete portable boundary from Watch into Detect and back.
|
|
3
|
+
*
|
|
4
|
+
* Watch contributes generation-stamped suspicion only. Detect retains that
|
|
5
|
+
* generation until Record has durably accepted every resulting proposal. A
|
|
6
|
+
* discovered directory creates a logical coverage request; the Watch host
|
|
7
|
+
* decides whether its backend needs another native handle.
|
|
8
|
+
*/
|
|
9
|
+
import { normalizedRelativePath } from './enrollment.js';
|
|
10
|
+
const detectionRelativePath = (path) => {
|
|
11
|
+
const raw = String(path);
|
|
12
|
+
if (raw.startsWith('/') || /^[A-Za-z]:[\\/]/.test(raw) || raw.includes('\0')) {
|
|
13
|
+
throw new Error('detection path must be root-relative');
|
|
14
|
+
}
|
|
15
|
+
const normalized = normalizedRelativePath(raw);
|
|
16
|
+
if (!normalized || normalized.split('/').some((segment) => segment === '.' || segment === '..')) {
|
|
17
|
+
throw new Error('detection path must be root-relative');
|
|
18
|
+
}
|
|
19
|
+
return normalized;
|
|
20
|
+
};
|
|
21
|
+
/** Freeze Watch's snapshot into Detection's input vocabulary. */
|
|
22
|
+
export function detectionBatch(rootId, snapshot) {
|
|
23
|
+
if (!rootId)
|
|
24
|
+
throw new Error('detection batch root id is required');
|
|
25
|
+
if (!Number.isSafeInteger(snapshot.generation) || snapshot.generation < 0) {
|
|
26
|
+
throw new Error('detection batch generation is invalid');
|
|
27
|
+
}
|
|
28
|
+
const suspects = snapshot.paths === null
|
|
29
|
+
? null
|
|
30
|
+
: Object.freeze([...new Set(snapshot.paths.map(detectionRelativePath))]);
|
|
31
|
+
return Object.freeze({ rootId, generation: snapshot.generation, suspects });
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Tell Watch that newly enrolled directory ground now exists. This is emitted
|
|
35
|
+
* on every platform; only the Watch backend knows whether coverage expansion
|
|
36
|
+
* means another Linux inotify handle or merely a routing-table update.
|
|
37
|
+
*/
|
|
38
|
+
export function directoryCoverageRequests(batch, createdDirectories) {
|
|
39
|
+
const paths = [...new Set(createdDirectories.map(detectionRelativePath))]
|
|
40
|
+
.sort();
|
|
41
|
+
return Object.freeze(paths.map((relPath) => Object.freeze({
|
|
42
|
+
kind: 'directory-discovered',
|
|
43
|
+
rootId: batch.rootId,
|
|
44
|
+
relPath,
|
|
45
|
+
})));
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=watch-boundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch-boundary.js","sourceRoot":"","sources":["../../src/detection/watch-boundary.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,MAAM,qBAAqB,GAAG,CAAC,IAAY,EAAU,EAAE;IACrD,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IACzB,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7E,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC;IACD,MAAM,UAAU,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC;IAC/C,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,IAAI,CAAC,EAAE,CAAC;QAChG,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1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FilesRegiste
|
|
|
39
39
|
export interface FilesAddPorts {
|
|
40
40
|
/** Lookup is authenticated by the host and returns this user's one registry. */
|
|
41
41
|
lookupRegistry(): Promise<CloudUserGround>;
|
|
42
|
+
/** Execute the crash-safe local install: durable intent, verified private
|
|
43
|
+
* staging, exact rows, atomic reveal, then binding and references. Return
|
|
44
|
+
* with the intent still durable; healthy Watch coverage is the completion
|
|
45
|
+
* gate that clears it. */
|
|
42
46
|
materializeWorkspace(input: {
|
|
43
47
|
readonly workspace: CloudEntityRecord;
|
|
44
48
|
readonly reference: CloudEntityRecord;
|
|
@@ -54,6 +58,8 @@ export interface FilesAddPorts {
|
|
|
54
58
|
readonly references: readonly CloudEntityRecord[];
|
|
55
59
|
readonly alreadyMaterialized: boolean;
|
|
56
60
|
}>;
|
|
61
|
+
/** Establish or prove the one Watch owner. A recovered visible install must
|
|
62
|
+
* settle its blind interval before this effect clears the pending intent. */
|
|
57
63
|
coverWorkspace(input: {
|
|
58
64
|
readonly workspaceId: string;
|
|
59
65
|
/** The host may adopt this exact graph as Watch's initial baseline only
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/files/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,kBAAkB;IACjC,8EAA8E;IAC9E,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC7E,QAAQ,CAAC,UAAU,EAAE,MAAM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