@amalgm/live 0.2.22 → 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.
Files changed (45) hide show
  1. package/PURPOSE.md +31 -13
  2. package/dist/detection/batch.d.ts +49 -0
  3. package/dist/detection/batch.d.ts.map +1 -0
  4. package/dist/detection/batch.js +66 -0
  5. package/dist/detection/batch.js.map +1 -0
  6. package/dist/detection/content.d.ts +30 -0
  7. package/dist/detection/content.d.ts.map +1 -0
  8. package/dist/detection/content.js +115 -0
  9. package/dist/detection/content.js.map +1 -0
  10. package/dist/detection/echo.d.ts +20 -0
  11. package/dist/detection/echo.d.ts.map +1 -0
  12. package/dist/detection/echo.js +22 -0
  13. package/dist/detection/echo.js.map +1 -0
  14. package/dist/detection/enrollment.d.ts +21 -10
  15. package/dist/detection/enrollment.d.ts.map +1 -1
  16. package/dist/detection/enrollment.js +22 -12
  17. package/dist/detection/enrollment.js.map +1 -1
  18. package/dist/detection/index.d.ts +15 -1
  19. package/dist/detection/index.d.ts.map +1 -1
  20. package/dist/detection/index.js +15 -1
  21. package/dist/detection/index.js.map +1 -1
  22. package/dist/detection/record-proposal.d.ts +77 -0
  23. package/dist/detection/record-proposal.d.ts.map +1 -0
  24. package/dist/detection/record-proposal.js +158 -0
  25. package/dist/detection/record-proposal.js.map +1 -0
  26. package/dist/detection/repository.d.ts +28 -0
  27. package/dist/detection/repository.d.ts.map +1 -0
  28. package/dist/detection/repository.js +64 -0
  29. package/dist/detection/repository.js.map +1 -0
  30. package/dist/detection/territory.d.ts +29 -0
  31. package/dist/detection/territory.d.ts.map +1 -0
  32. package/dist/detection/territory.js +78 -0
  33. package/dist/detection/territory.js.map +1 -0
  34. package/dist/detection/watch-boundary.d.ts +29 -0
  35. package/dist/detection/watch-boundary.d.ts.map +1 -0
  36. package/dist/detection/watch-boundary.js +47 -0
  37. package/dist/detection/watch-boundary.js.map +1 -0
  38. package/dist/entities/cloud.d.ts +8 -6
  39. package/dist/entities/cloud.d.ts.map +1 -1
  40. package/dist/entities/cloud.js +21 -7
  41. package/dist/entities/cloud.js.map +1 -1
  42. package/dist/files/commands.d.ts +6 -0
  43. package/dist/files/commands.d.ts.map +1 -1
  44. package/dist/files/commands.js.map +1 -1
  45. package/package.json +5 -1
package/PURPOSE.md CHANGED
@@ -98,23 +98,33 @@ its cutover.
98
98
  containment; it never creates an overlapping UUID family. A reference in
99
99
  the core graph points to the selected workspace UUID, including when that
100
100
  workspace later becomes nested beneath a newly registered parent.
101
- 20. **Materialization is local and selective.** Login installs the core graph;
101
+ 20. **Add installs atomically and selectively.** Login installs the core graph;
102
102
  `files add <workspace>` installs one owned, UUID-selected materialization
103
103
  boundary and refreshes the exact portable reference inventory in
104
- always-materialized core ground. The local SQLite table contains workspace
105
- rows only for boundaries materialized on that machine, while cloud
106
- reconciliation preserves every unmaterialized boundary. A newly installed
107
- and verified graph is the initial Watch baseline for that boundary; opening
108
- coverage must not reinterpret the downloader's own writes as user edits.
104
+ always-materialized core ground. Add first journals one machine-local
105
+ installation intent, reconstructs and verifies the complete selection in a
106
+ private same-filesystem staging directory, commits its exact entity rows in
107
+ one transaction, atomically reveals the ground, and only then exposes its
108
+ binding to Watch. The intent clears only after coverage is healthy. Entity
109
+ rows therefore never mean pending download, and visible Add ground is never
110
+ left without its durable identity. Hidden staging that crosses a restart is
111
+ rebuilt from verified immutable content; revealed ground that crosses that
112
+ blind interval remains completely suspect until Detect settles it. The
113
+ local SQLite table contains workspace rows only for boundaries materialized
114
+ on that machine, while cloud reconciliation preserves every unmaterialized
115
+ boundary. A fresh verified install may be Watch's initial baseline so the
116
+ downloader's own writes are not reinterpreted as user edits.
109
117
  21. **A Git marker classifies its containing directory.** The presence of a
110
118
  `.git` directory or file makes its containing directory `repo.git`; its
111
119
  removal returns that same UUID to `workspace` or `folder`. Git command
112
120
  availability governs Card + Checkpoint capture, never classification, and
113
121
  `.git` itself is repository transport metadata that receives no entity
114
- row. Worktree children retain local UUID rows, while their identities ride
115
- in the repository state manifest rather than becoming individual cloud
116
- records. A shallow repository carries its declared Git history boundary,
117
- so a new machine never invents history beyond it.
122
+ row. Each such directory starts a repository rail: ordinary worktree
123
+ children retain local UUID rows and ride in their nearest repository state
124
+ manifest, while a nested repository and the ancestry spine that reaches it
125
+ remain cloud graph records with their own Card + Checkpoint transport. A
126
+ shallow repository carries its declared Git history boundary, so a new
127
+ machine never invents history beyond it.
118
128
  22. **Transfer moves content; it never discovers state.** `upload` moves one
119
129
  already-registered immutable artifact toward cloud storage and `download`
120
130
  moves that same artifact toward a machine cache. Neither operation scans,
@@ -175,6 +185,14 @@ its cutover.
175
185
  different block identities for the same complete bytes advances the
176
186
  content contract and storage namespace together. Readers remain additive;
177
187
  an immutable manifest is never reinterpreted or overwritten in place.
188
+ 33. **Detection proposes settled net truth; Record makes it durable.** Watch
189
+ contributes generation-stamped suspicion only. Detect reconciles identity,
190
+ current enrollment, type, repository territory, and exact replay from the
191
+ last verified notebook state to settled disk truth, then emits a complete
192
+ result record plus immutable cargo references. Record assigns mutation
193
+ identity and durable order before that Watch generation settles. Applied
194
+ incoming work is silenced only by verified notebook equality, never by
195
+ hiding watcher rings; filesystem absence alone has no lifecycle authority.
178
196
 
179
197
  ## Five surfaces, one behavior
180
198
 
@@ -204,9 +222,9 @@ src/entities/ the entity model's rule surface: the six-field record,
204
222
  cloud and repo-state codecs — behind injected ports.
205
223
  src/watching/ the Watch pure cores: minimal coverage ownership and
206
224
  generation-safe suspicion.
207
- src/detection/ the Detect pure cores: the adapter contract, three-channel
208
- compare (diff), continuity verdicts, classification,
209
- refusals, and enrollment policy.
225
+ src/detection/ the Detect pure submodule: Watch boundary, identity compare,
226
+ classification, enrollment, repository territory, exact
227
+ replay proposals, net batches, and echo equality.
210
228
  src/registration/ the login-time user-ground convergence operation and its
211
229
  injected local/cloud effect ports.
212
230
  src/transfer/ type-aware immutable artifact upload/download operations;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Net-difference planning for one settled Watch batch.
3
+ *
4
+ * Identity reconciliation and type-specific capture happen before this seam.
5
+ * This seam makes cancellation, unsettled truth, lifecycle authority, coverage
6
+ * requests, and Watch settlement one total decision.
7
+ */
8
+ import type { CloudEntityRecord } from '../entities/cloud.js';
9
+ import { type DetectedChangeProposal, type ReplayInstruction } from './record-proposal.js';
10
+ import { type DetectionBatch, type DirectoryCoverageRequest } from './watch-boundary.js';
11
+ export interface PresentTransition {
12
+ readonly truth: 'present';
13
+ /** Current root-relative address, used only for observation and coverage. */
14
+ readonly relPath: string;
15
+ readonly base: CloudEntityRecord | null;
16
+ readonly result: CloudEntityRecord;
17
+ readonly replay: ReplayInstruction;
18
+ readonly lifecycleAuthorization?: 'trash' | 'restore';
19
+ }
20
+ export interface AbsentTransition {
21
+ readonly truth: 'absent';
22
+ /** null is the absent-before/absent-after ephemeral cancellation case. */
23
+ readonly base: CloudEntityRecord | null;
24
+ /** Exact entity-law result, required only for an authorized Trash. */
25
+ readonly trashedResult?: CloudEntityRecord;
26
+ readonly lifecycleAuthorization?: 'trash';
27
+ }
28
+ export interface UnsettledTransition {
29
+ readonly truth: 'unsettled';
30
+ readonly reason?: string | undefined;
31
+ }
32
+ export type SettledTransition = PresentTransition | AbsentTransition | UnsettledTransition;
33
+ export interface RetryDetectionBatch {
34
+ readonly kind: 'retry';
35
+ readonly reasons: readonly string[];
36
+ }
37
+ export interface ReadyDetectionBatch {
38
+ readonly kind: 'ready';
39
+ readonly proposals: readonly DetectedChangeProposal[];
40
+ /** Absences retained as repair evidence because no lifecycle act authorized Trash. */
41
+ readonly missing: readonly CloudEntityRecord[];
42
+ readonly coverage: readonly DirectoryCoverageRequest[];
43
+ /** Record may settle exactly this generation after durable acceptance. */
44
+ readonly settle: DetectionBatch;
45
+ }
46
+ export type DetectionBatchPlan = RetryDetectionBatch | ReadyDetectionBatch;
47
+ /** Plan the complete net difference. No partial proposals escape an unsettled batch. */
48
+ export declare function planDetectionBatch(batch: DetectionBatch, transitions: readonly SettledTrans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AmB;IAClC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACtD,sFAAsF;IACtF,QAAQ,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC/C,QAAQ,CAAC,QAAQ,EAAE,SAAS,wBAAwB,EAAE,CAAC;IACvD,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;CACjC;AAED,MAAM,MAAM,kBAAkB,GAAG,mBAAmB,GAAG,mBAAmB,CAAC;AAM3E,wFAAwF;AACxF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,cAAc,EACrB,WAAW,EAAE,SAAS,iBAAiB,EAAE,GACxC,kBAAkB,CAkDpB"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Net-difference planning for one settled Watch batch.
3
+ *
4
+ * Identity reconciliation and type-specific capture happen before this seam.
5
+ * This seam makes cancellation, unsettled truth, lifecycle authority, coverage
6
+ * requests, and Watch settlement one total decision.
7
+ */
8
+ import { CONTAINERS } from '../entities/types.js';
9
+ import { detectedChangeProposal, } from './record-proposal.js';
10
+ import { directoryCoverageRequests, } from './watch-boundary.js';
11
+ const newlyDirectoryGround = (transition) => CONTAINERS.has(transition.result.type)
12
+ && (transition.base === null || !CONTAINERS.has(transition.base.type));
13
+ /** Plan the complete net difference. No partial proposals escape an unsettled batch. */
14
+ export function planDetectionBatch(batch, transitions) {
15
+ const unsettled = transitions.filter((transition) => transition.truth === 'unsettled');
16
+ if (unsettled.length > 0) {
17
+ return Object.freeze({
18
+ kind: 'retry',
19
+ reasons: Object.freeze(unsettled.map((transition) => transition.reason ?? 'truth is unsettled')),
20
+ });
21
+ }
22
+ const proposals = [];
23
+ const missing = [];
24
+ const createdDirectories = [];
25
+ for (const transition of transitions) {
26
+ if (transition.truth === 'present') {
27
+ const proposal = detectedChangeProposal(transition);
28
+ if (proposal)
29
+ proposals.push(proposal);
30
+ if (newlyDirectoryGround(transition)) {
31
+ createdDirectories.push(transition.relPath);
32
+ }
33
+ continue;
34
+ }
35
+ if (transition.truth !== 'absent') {
36
+ throw new Error('unsettled truth escaped the batch retry gate');
37
+ }
38
+ if (transition.base === null)
39
+ continue; // absent before and after: no entity existed
40
+ if (transition.base.status !== 'active')
41
+ continue;
42
+ if (transition.lifecycleAuthorization !== 'trash') {
43
+ missing.push(transition.base);
44
+ continue;
45
+ }
46
+ if (!transition.trashedResult) {
47
+ throw new Error('authorized Trash requires the entity law\'s exact trashed result');
48
+ }
49
+ const proposal = detectedChangeProposal({
50
+ base: transition.base,
51
+ result: transition.trashedResult,
52
+ replay: { kind: 'structure' },
53
+ lifecycleAuthorization: 'trash',
54
+ });
55
+ if (proposal)
56
+ proposals.push(proposal);
57
+ }
58
+ return Object.freeze({
59
+ kind: 'ready',
60
+ proposals: Object.freeze(proposals),
61
+ missing: Object.freeze(missing),
62
+ coverage: directoryCoverageRequests(batch, createdDirectories),
63
+ settle: batch,
64
+ });
65
+ }
66
+ //# sourceMappingURL=batch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch.js","sourceRoot":"","sources":["../../src/detection/batch.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,sBAAsB,GAGvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,yBAAyB,GAG1B,MAAM,qBAAqB,CAAC;AA6C7B,MAAM,oBAAoB,GAAG,CAAC,UAA6B,EAAW,EAAE,CACtE,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC;OACnC,CAAC,UAAU,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,UAA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AU,CAAC,IAAI,CAAC,MAAM,KAAK,QAAQ;YAAE,SAAS;QAClD,IAAI,UAAU,CAAC,sBAAsB,KAAK,OAAO,EAAE,CAAC;YAClD,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAC9B,SAAS;QACX,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;QACtF,CAAC;QACD,MAAM,QAAQ,GAAG,sBAAsB,CAAC;YACtC,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,MAAM,EAAE,UAAU,CAAC,aAAa;YAChC,MAAM,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;YAC7B,sBAAsB,EAAE,OAAO;SAChC,CAAC,CAAC;QACH,IAAI,QAAQ;YAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,OAAO;QACb,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;QACnC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;QAC/B,QAAQ,EAAE,yBAAyB,CAAC,KAAK,EAAE,kBAAkB,CAAC;QAC9D,MAAM,EAAE,KAAK;KACd,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,30 @@
1
+ /** Type-sensitive content capture from Detection's one settled byte read. */
2
+ import { type ContentManifest } from '../contracts/content.js';
3
+ import type { Sha256Hex } from '../entities/types.js';
4
+ import type { TransferArtifact } from '../transfer/artifacts.js';
5
+ import type { BinaryReplay, LinkReplay, TextReplay, TextSplice } from './record-proposal.js';
6
+ export interface CapturedArtifact {
7
+ readonly artifact: TransferArtifact;
8
+ /** The exact settled bytes Detection already read; the cache seals these. */
9
+ readonly bytes: Uint8Array;
10
+ readonly manifest: ContentManifest;
11
+ }
12
+ export interface CapturedContent<Replay> {
13
+ readonly replay: Replay;
14
+ readonly cargo: CapturedArtifact;
15
+ }
16
+ /** The smallest single replacement span that transforms base bytes to result. */
17
+ export declare function textSplice(base: Uint8Array, result: Uint8Array): TextSplice;
18
+ /**
19
+ * Capture text as one verified byte splice when that instruction is smaller
20
+ * than the result bytes. The immutable snapshot is always sealed as repair and
21
+ * cold-materialization truth.
22
+ */
23
+ export declare function captureTextChange(entityId: string, base: Uint8Array | null, result: Uint8Array, sha256Hex: Sha256Hex): CapturedContent<TextReplay> | null;
24
+ /** Apply a text replay and verify its exact result, falling back to snapshot. */
25
+ export declare function reproduceTextChange(base: Uint8Array | null, replay: TextReplay, snapshot: Uint8Array, sha256Hex: Sha256Hex): Uint8Array;
26
+ /** Binary replay is the existing exact content manifest; Transfer moves gaps. */
27
+ export declare function captureBinaryChange(entityId: string, previous: ContentManifest | null, result: Uint8Array, sha256Hex: Sha256Hex): CapturedContent<BinaryReplay> | null;
28
+ /** A symlink's portable content is the literal target text, never its target. */
29
+ export declare function captureLinkChange(entityId: string, previousTarget: string | null, target: string, sha256Hex: Sha256Hex): CapturedContent<LinkReplay> | null;
30
+ //# sourceMappingURL=content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/detection/content.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAE7E,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAErF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACX,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,6EAA6E;IAC7E,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;CACpC;AAED,MAAM,WAAW,eAAe,CAAC,MAAM;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;CAClC;AAuBD,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,UAAU,CAc3E;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,UAAU,GAAG,IAAI,EACvB,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,SAAS,GACnB,eAAe,CAAC,UAAU,CAAC,GAAG,IAAI,CAkBpC;AAED,iFAAiF;AACjF,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,UAAU,GAAG,IAAI,EACvB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,SAAS,GACnB,UAAU,CAqBZ;AAED,iFAAiF;AACjF,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,eAAe,GAAG,IAAI,EAChC,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,SAAS,GACnB,eAAe,CAAC,YAAY,CAAC,GAAG,IAAI,CActC;AAED,iFAAiF;AACjF,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,GAAG,IAAI,EAC7B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,GACnB,eAAe,CAAC,UAAU,CAAC,GAAG,IAAI,CAWpC"}
@@ -0,0 +1,115 @@
1
+ /** Type-sensitive content capture from Detection's one settled byte read. */
2
+ import { checkContentManifest } from '../contracts/content.js';
3
+ import { utf8Encode } from '../entities/bytes.js';
4
+ import { deriveUploadManifest } from '../transfer/upload.js';
5
+ const capturedArtifact = (entityId, entityType, kind, input, sha256Hex) => {
6
+ const bytes = input.slice();
7
+ const artifact = {
8
+ entityId,
9
+ entityType,
10
+ kind,
11
+ contentHash: sha256Hex(bytes),
12
+ };
13
+ return Object.freeze({
14
+ artifact: Object.freeze(artifact),
15
+ bytes,
16
+ manifest: deriveUploadManifest(artifact, bytes, sha256Hex),
17
+ });
18
+ };
19
+ /** The smallest single replacement span that transforms base bytes to result. */
20
+ export function textSplice(base, result) {
21
+ let prefix = 0;
22
+ const shared = Math.min(base.byteLength, result.byteLength);
23
+ while (prefix < shared && base[prefix] === result[prefix])
24
+ prefix += 1;
25
+ let suffix = 0;
26
+ while (suffix < shared - prefix
27
+ && base[base.byteLength - suffix - 1] === result[result.byteLength - suffix - 1]) {
28
+ suffix += 1;
29
+ }
30
+ return Object.freeze({
31
+ offset: prefix,
32
+ deleteBytes: base.byteLength - prefix - suffix,
33
+ insert: result.slice(prefix, result.byteLength - suffix),
34
+ });
35
+ }
36
+ /**
37
+ * Capture text as one verified byte splice when that instruction is smaller
38
+ * than the result bytes. The immutable snapshot is always sealed as repair and
39
+ * cold-materialization truth.
40
+ */
41
+ export function captureTextChange(entityId, base, result, sha256Hex) {
42
+ const cargo = capturedArtifact(entityId, 'file.text', 'file', result, sha256Hex);
43
+ const basePayloadVersion = base === null ? null : sha256Hex(base);
44
+ if (basePayloadVersion === cargo.artifact.contentHash)
45
+ return null;
46
+ const delta = base === null ? null : textSplice(base, result);
47
+ // Two numeric fields are fixed overhead on the wire. This conservative
48
+ // estimate keeps a replace-all operation on the snapshot path.
49
+ const useDelta = delta !== null && delta.insert.byteLength + 16 < result.byteLength;
50
+ return Object.freeze({
51
+ replay: Object.freeze({
52
+ kind: 'file.text',
53
+ mode: useDelta ? 'delta' : 'snapshot',
54
+ basePayloadVersion,
55
+ resultPayloadVersion: cargo.artifact.contentHash,
56
+ delta: useDelta ? delta : null,
57
+ }),
58
+ cargo,
59
+ });
60
+ }
61
+ /** Apply a text replay and verify its exact result, falling back to snapshot. */
62
+ export function reproduceTextChange(base, replay, snapshot, sha256Hex) {
63
+ const verifiedSnapshot = () => {
64
+ if (sha256Hex(snapshot) !== replay.resultPayloadVersion) {
65
+ throw new Error('text snapshot does not match its declared result');
66
+ }
67
+ return snapshot.slice();
68
+ };
69
+ if (replay.mode !== 'delta' || replay.delta === null || base === null
70
+ || sha256Hex(base) !== replay.basePayloadVersion) {
71
+ return verifiedSnapshot();
72
+ }
73
+ const { offset, deleteBytes, insert } = replay.delta;
74
+ if (!Number.isSafeInteger(offset) || !Number.isSafeInteger(deleteBytes)
75
+ || offset < 0 || deleteBytes < 0 || offset + deleteBytes > base.byteLength) {
76
+ return verifiedSnapshot();
77
+ }
78
+ const result = new Uint8Array(base.byteLength - deleteBytes + insert.byteLength);
79
+ result.set(base.subarray(0, offset), 0);
80
+ result.set(insert, offset);
81
+ result.set(base.subarray(offset + deleteBytes), offset + insert.byteLength);
82
+ return sha256Hex(result) === replay.resultPayloadVersion ? result : verifiedSnapshot();
83
+ }
84
+ /** Binary replay is the existing exact content manifest; Transfer moves gaps. */
85
+ export function captureBinaryChange(entityId, previous, result, sha256Hex) {
86
+ if (previous !== null && !checkContentManifest(previous).ok) {
87
+ throw new Error('previous binary content manifest is invalid');
88
+ }
89
+ const cargo = capturedArtifact(entityId, 'file.binary', 'file', result, sha256Hex);
90
+ if (previous?.contentHash === cargo.artifact.contentHash)
91
+ return null;
92
+ return Object.freeze({
93
+ replay: Object.freeze({
94
+ kind: 'file.binary',
95
+ resultPayloadVersion: cargo.artifact.contentHash,
96
+ manifest: cargo.manifest,
97
+ }),
98
+ cargo,
99
+ });
100
+ }
101
+ /** A symlink's portable content is the literal target text, never its target. */
102
+ export function captureLinkChange(entityId, previousTarget, target, sha256Hex) {
103
+ if (previousTarget === target)
104
+ return null;
105
+ const cargo = capturedArtifact(entityId, 'link', 'link', utf8Encode(target), sha256Hex);
106
+ return Object.freeze({
107
+ replay: Object.freeze({
108
+ kind: 'link',
109
+ resultPayloadVersion: cargo.artifact.contentHash,
110
+ target,
111
+ }),
112
+ cargo,
113
+ });
114
+ }
115
+ //# sourceMappingURL=content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/detection/content.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAE7E,OAAO,EAAE,oBAAoB,EAAwB,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAoB7D,MAAM,gBAAgB,GAAG,CACvB,QAAgB,EAChB,UAAgD,EAChD,IAAqB,EACrB,KAAiB,EACjB,SAAoB,EACF,EAAE;IACpB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;IAC5B,MAAM,QAAQ,GAAG;QACf,QAAQ;QACR,UAAU;QACV,IAAI;QACJ,WAAW,EAAE,SAAS,CAAC,KAAK,CAAC;KACrB,CAAC;IACX,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;QACjC,KAAK;QACL,QAAQ,EAAE,oBAAoB,CAAC,QAAQ,EAAE,KAAK,EAAE,SAAS,CAAC;KAC3D,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,iFAAiF;AACjF,MAAM,UAAU,UAAU,CAAC,IAAgB,EAAE,MAAkB;IAC7D,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IAC5D,OAAO,MAAM,GAAG,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC;QAAE,MAAM,IAAI,CAAC,CAAC;IACvE,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,OAAO,MAAM,GAAG,MAAM,GAAG,MAAM;WAC1B,IAAI,CAAC,IAAI,CAA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,OAAO,IAAI,CAAC;IAC3C,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;IACxF,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;YACpB,IAAI,EAAE,MAAe;YACrB,oBAAoB,EAAE,KAAK,CAAC,QAAQ,CAAC,WAAW;YAChD,MAAM;SACP,CAAC;QACF,KAAK;KACN,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Echo judgment after incoming Apply.
3
+ *
4
+ * Apply never suppresses watcher rings. It verifies the incoming result and
5
+ * advances the notebook. The retained suspicion then uses this ordinary
6
+ * equality judgment: exact expected truth is silence; different truth is a
7
+ * real local change; unreadable truth is retried.
8
+ */
9
+ import type { TruthReading } from './adapter-contract.js';
10
+ import type { CloudEntityRecord } from '../entities/cloud.js';
11
+ export type EchoDecision = {
12
+ readonly kind: 'silence';
13
+ } | {
14
+ readonly kind: 'detect';
15
+ } | {
16
+ readonly kind: 'retry';
17
+ readonly reason?: string | undefined;
18
+ };
19
+ export declare function echoDecision(notebook: Pick<CloudEntityRecord, 'status' | 'version'>, observed: TruthReading): EchoDecision;
20
+ //# sourceMappingURL=echo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"echo.d.ts","sourceRoot":"","sources":["../../src/detection/echo.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAErE,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAAE,QAAQ,GAAG,SAAS,CAAC,EACvD,QAAQ,EAAE,YAAY,GACrB,YAAY,CAYd"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Echo judgment after incoming Apply.
3
+ *
4
+ * Apply never suppresses watcher rings. It verifies the incoming result and
5
+ * advances the notebook. The retained suspicion then uses this ordinary
6
+ * equality judgment: exact expected truth is silence; different truth is a
7
+ * real local change; unreadable truth is retried.
8
+ */
9
+ export function echoDecision(notebook, observed) {
10
+ if (observed.truth === 'unsettled') {
11
+ return observed.reason === undefined
12
+ ? { kind: 'retry' }
13
+ : { kind: 'retry', reason: observed.reason };
14
+ }
15
+ if (notebook.status === 'active') {
16
+ return observed.truth === 'present' && observed.version === notebook.version
17
+ ? { kind: 'silence' }
18
+ : { kind: 'detect' };
19
+ }
20
+ return observed.truth === 'absent' ? { kind: 'silence' } : { kind: 'detect' };
21
+ }
22
+ //# sourceMappingURL=echo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"echo.js","sourceRoot":"","sources":["../../src/detection/echo.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH,MAAM,UAAU,YAAY,CAC1B,QAAuD,EACvD,QAAsB;IAEtB,IAAI,QAAQ,CAAC,KAAK,KAAK,WAAW,EAAE,CAAC;QACnC,OAAO,QAAQ,CAAC,MAAM,KAAK,SAAS;YAClC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE;YACnB,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IACjD,CAAC;IACD,IAAI,QAAQ,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,QAAQ,CAAC,KAAK,KAAK,SAAS,IAAI,QAAQ,CAAC,OAAO,KAAK,QAAQ,CAAC,OAAO;YAC1E,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE;YACrB,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IACzB,CAAC;IACD,OAAO,QAAQ,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAChF,CAAC"}
@@ -1,13 +1,13 @@
1
1
  /**
2
- * Amalgm's default enrollment policy: which relative paths receive
3
- * workspace identities. Ratified by entity-model.md axiom 2 — amalgm's
4
- * manual enrollment policy decides what enrolls; external conventions
5
- * (gitignore) may inform it, never decide it implicitly.
2
+ * Detection enrollment policies.
6
3
  *
7
- * Machine-local metadata, dependencies, generated caches, and secrets
8
- * never receive workspace identities. The rule applies at every depth.
9
- * Pure string policy: a host may inject its own `EnrollmentPolicy`
10
- * everywhere this default is accepted.
4
+ * Current user ground enrolls everything except structural local state and
5
+ * paths excluded by its tracked `.amalgmignore`; `.gitignore` never decides
6
+ * Amalgm enrollment. `defaultShouldEnroll` remains only as the older explicit
7
+ * registration policy for additive API compatibility. Current portable paths
8
+ * already use `/`; a host converts its native separator at the boundary. A
9
+ * literal `\\` is therefore preserved as part of a POSIX filename. Both
10
+ * policies are pure strings-in/verdict-out and never inspect disk themselves.
11
11
  */
12
12
  /** The injected policy shape: relative path in, verdict out. */
13
13
  export type EnrollmentPolicy = (relPath: string) => boolean;
@@ -17,9 +17,20 @@ export type EnrollmentPolicy = (relPath: string) => boolean;
17
17
  export declare const AMALGM_CONTROL_DIRECTORY = ".amalgm";
18
18
  export declare const AMALGM_IGNORE_FILE = ".amalgmignore";
19
19
  export declare const DEFAULT_AMALGM_IGNORE = "/.amalgm/\n";
20
- /** The default policy. Both separators are path separators; '' never enrolls. */
20
+ /**
21
+ * Legacy explicit-registration policy retained for additive API compatibility.
22
+ * Current user-ground Detect must use {@link createUserGroundEnrollmentPolicy};
23
+ * there are no implicit dependency, dotfile, cache, or secret exclusions.
24
+ * Both separators are path separators; '' never enrolls.
25
+ *
26
+ * @deprecated Use `createUserGroundEnrollmentPolicy` for current user ground.
27
+ */
21
28
  export declare const defaultShouldEnroll: EnrollmentPolicy;
22
- /** One normalized spelling for enrollment and ignore matching. */
29
+ /**
30
+ * One normalized spelling for portable enrollment and ignore matching.
31
+ * Portable relative paths use `/`. Do not reinterpret `\\`: it is a valid,
32
+ * literal filename character on POSIX after the host has crossed this seam.
33
+ */
23
34
  export declare function normalizedRelativePath(relPath: string): string;
24
35
  /** `.amalgm/` is local control state wherever a registered tree is rooted. */
25
36
  export declare function isAmalgmControlPath(relPath: string): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"enrollment.d.ts","sourceRoot":"","sources":["../../src/detection/enrollment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,gEAAgE;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;AAE5D;;qEAEqE;AACrE,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAClD,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAClD,eAAO,MAAM,qBAAqB,gBAAoC,CAAC;AAgDvE,iFAAiF;AACjF,eAAO,MAAM,mBAAmB,EAAE,gBAMjC,CAAC;AAEF,kEAAkE;AAClE,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAM9D;AAED,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;8EAC8E;AAC9E,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGjE;AAsDD;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,UAAU,SAAK,GAAG,gBAAgB,CAalF"}
1
+ {"version":3,"file":"enrollment.d.ts","sourceRoot":"","sources":["../../src/detection/enrollment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,gEAAgE;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;AAE5D;;qEAEqE;AACrE,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAClD,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAClD,eAAO,MAAM,qBAAqB,gBAAoC,CAAC;AAgDvE;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAMjC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAK9D;AAED,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;8EAC8E;AAC9E,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGjE;AAsDD;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,UAAU,SAAK,GAAG,gBAAgB,CAalF"}
@@ -1,13 +1,13 @@
1
1
  /**
2
- * Amalgm's default enrollment policy: which relative paths receive
3
- * workspace identities. Ratified by entity-model.md axiom 2 — amalgm's
4
- * manual enrollment policy decides what enrolls; external conventions
5
- * (gitignore) may inform it, never decide it implicitly.
2
+ * Detection enrollment policies.
6
3
  *
7
- * Machine-local metadata, dependencies, generated caches, and secrets
8
- * never receive workspace identities. The rule applies at every depth.
9
- * Pure string policy: a host may inject its own `EnrollmentPolicy`
10
- * everywhere this default is accepted.
4
+ * Current user ground enrolls everything except structural local state and
5
+ * paths excluded by its tracked `.amalgmignore`; `.gitignore` never decides
6
+ * Amalgm enrollment. `defaultShouldEnroll` remains only as the older explicit
7
+ * registration policy for additive API compatibility. Current portable paths
8
+ * already use `/`; a host converts its native separator at the boundary. A
9
+ * literal `\\` is therefore preserved as part of a POSIX filename. Both
10
+ * policies are pure strings-in/verdict-out and never inspect disk themselves.
11
11
  */
12
12
  /** The Git-like names at the user-ground boundary. Structural coordination
13
13
  * state is local and cannot be negated by user policy; the ignore file is
@@ -63,9 +63,16 @@ function isPrivateFile(name) {
63
63
  return true;
64
64
  return /\.(?:key|keystore|kdbx|p12|pfx|pem|ppk|tfstate(?:\.backup)?)$/i.test(name);
65
65
  }
66
- /** The default policy. Both separators are path separators; '' never enrolls. */
66
+ /**
67
+ * Legacy explicit-registration policy retained for additive API compatibility.
68
+ * Current user-ground Detect must use {@link createUserGroundEnrollmentPolicy};
69
+ * there are no implicit dependency, dotfile, cache, or secret exclusions.
70
+ * Both separators are path separators; '' never enrolls.
71
+ *
72
+ * @deprecated Use `createUserGroundEnrollmentPolicy` for current user ground.
73
+ */
67
74
  export const defaultShouldEnroll = (relPath) => {
68
- const parts = normalizedRelativePath(relPath).split('/').filter(Boolean);
75
+ const parts = normalizedRelativePath(String(relPath || '').replace(/\\/g, '/')).split('/').filter(Boolean);
69
76
  const name = parts.at(-1);
70
77
  if (name === undefined || parts.some((part) => EXCLUDED_DIRECTORIES.has(part)))
71
78
  return false;
@@ -73,10 +80,13 @@ export const defaultShouldEnroll = (relPath) => {
73
80
  return false;
74
81
  return !name.startsWith('.#') && !name.endsWith('~') && !/\.(?:swp|swo)$/i.test(name);
75
82
  };
76
- /** One normalized spelling for enrollment and ignore matching. */
83
+ /**
84
+ * One normalized spelling for portable enrollment and ignore matching.
85
+ * Portable relative paths use `/`. Do not reinterpret `\\`: it is a valid,
86
+ * literal filename character on POSIX after the host has crossed this seam.
87
+ */
77
88
  export function normalizedRelativePath(relPath) {
78
89
  return String(relPath || '')
79
- .replace(/\\/g, '/')
80
90
  .replace(/^\.\//, '')
81
91
  .replace(/^\/+|\/+$/g, '')
82
92
  .replace(/\/{2,}/g, '/');
@@ -1 +1 @@
1
- {"version":3,"file":"enrollment.js","sourceRoot":"","sources":["../../src/detection/enrollment.ts"],"names":[],"mappings":"AAAA;;;;;;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CAAC,IAAI,CAAC,OAAO,CAAC;QAC9D,CAAC;QACD,OAAO,CAAC,QAAQ,CAAC;IACnB,CAAC,CAAC;AACJ,CAAC"}
@@ -14,14 +14,28 @@
14
14
  * judgment, the reference adapter
15
15
  * - `classify` text/binary from detect's own read evidence
16
16
  * - `refusal` declined-vs-broken, named where it is raised
17
- * - `enrollment` the default manual enrollment policy
17
+ * - `enrollment` tracked user-ground policy plus legacy compatibility
18
18
  * - `diff` the compare functions: file/dir/link identity
19
19
  * - `continuity` root rescue and the undecided address
20
+ * - `watch-boundary` generation-safe Watch input and coverage output
21
+ * - `territory` nearest-repository recorder selection
22
+ * - `record-proposal` the exact Detect-to-Record contract
23
+ * - `batch` net-difference planning and Watch settlement
24
+ * - `content` text/binary/link replay from one captured read
25
+ * - `repository` verified Card + Checkpoint transport planning
26
+ * - `echo` incoming Apply equality without suppression
20
27
  */
21
28
  export * from './adapter-contract.js';
29
+ export * from './batch.js';
22
30
  export * from './classify.js';
23
31
  export * from './continuity.js';
32
+ export * from './content.js';
24
33
  export * from './diff.js';
34
+ export * from './echo.js';
25
35
  export * from './enrollment.js';
36
+ export * from './record-proposal.js';
37
+ export * from './repository.js';
26
38
  export * from './refusal.js';
39
+ export * from './territory.js';
40
+ export * from './watch-boundary.js';
27
41
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/detection/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/detection/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC"}
@@ -14,14 +14,28 @@
14
14
  * judgment, the reference adapter
15
15
  * - `classify` text/binary from detect's own read evidence
16
16
  * - `refusal` declined-vs-broken, named where it is raised
17
- * - `enrollment` the default manual enrollment policy
17
+ * - `enrollment` tracked user-ground policy plus legacy compatibility
18
18
  * - `diff` the compare functions: file/dir/link identity
19
19
  * - `continuity` root rescue and the undecided address
20
+ * - `watch-boundary` generation-safe Watch input and coverage output
21
+ * - `territory` nearest-repository recorder selection
22
+ * - `record-proposal` the exact Detect-to-Record contract
23
+ * - `batch` net-difference planning and Watch settlement
24
+ * - `content` text/binary/link replay from one captured read
25
+ * - `repository` verified Card + Checkpoint transport planning
26
+ * - `echo` incoming Apply equality without suppression
20
27
  */
21
28
  export * from './adapter-contract.js';
29
+ export * from './batch.js';
22
30
  export * from './classify.js';
23
31
  export * from './continuity.js';
32
+ export * from './content.js';
24
33
  export * from './diff.js';
34
+ export * from './echo.js';
25
35
  export * from './enrollment.js';
36
+ export * from './record-proposal.js';
37
+ export * from './repository.js';
26
38
  export * from './refusal.js';
39
+ export * from './territory.js';
40
+ export * from './watch-boundary.js';
27
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/detection/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/detection/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC"}