@agentshouse/mdruntime 0.1.0-alpha.9 → 0.1.0-c009335e08279

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 (124) hide show
  1. package/AGENTS.md +208 -0
  2. package/README.md +44 -0
  3. package/dist/adapter.d.ts +147 -12
  4. package/dist/adapter.d.ts.map +1 -1
  5. package/dist/adapter.js +2 -3
  6. package/dist/attachment.d.ts +3 -0
  7. package/dist/attachment.d.ts.map +1 -0
  8. package/dist/attachment.js +8 -0
  9. package/dist/bootstrap.d.ts +3 -7
  10. package/dist/bootstrap.d.ts.map +1 -1
  11. package/dist/bootstrap.js +28 -27
  12. package/dist/change-set.d.ts +33 -0
  13. package/dist/change-set.d.ts.map +1 -0
  14. package/dist/change-set.js +83 -0
  15. package/dist/change.d.ts +9 -0
  16. package/dist/change.d.ts.map +1 -1
  17. package/dist/change.js +6 -5
  18. package/dist/client.d.ts +38 -32
  19. package/dist/client.d.ts.map +1 -1
  20. package/dist/client.js +115 -177
  21. package/dist/collection.d.ts +13 -16
  22. package/dist/collection.d.ts.map +1 -1
  23. package/dist/collection.js +45 -88
  24. package/dist/connection.d.ts +46 -39
  25. package/dist/connection.d.ts.map +1 -1
  26. package/dist/connection.js +1376 -975
  27. package/dist/conversation.d.ts +41 -19
  28. package/dist/conversation.d.ts.map +1 -1
  29. package/dist/conversation.js +483 -327
  30. package/dist/durability.js +6 -6
  31. package/dist/file.d.ts +2 -2
  32. package/dist/file.d.ts.map +1 -1
  33. package/dist/file.js +48 -71
  34. package/dist/host.d.ts +6 -2
  35. package/dist/host.d.ts.map +1 -1
  36. package/dist/host.js +83 -108
  37. package/dist/identity.d.ts +1 -0
  38. package/dist/identity.d.ts.map +1 -1
  39. package/dist/identity.js +10 -9
  40. package/dist/index.d.ts +12 -11
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +1 -3
  43. package/dist/log.js +5 -6
  44. package/dist/memory.d.ts +6 -3
  45. package/dist/memory.d.ts.map +1 -1
  46. package/dist/memory.js +205 -210
  47. package/dist/model.d.ts +10 -25
  48. package/dist/model.d.ts.map +1 -1
  49. package/dist/model.js +18 -21
  50. package/dist/observation.d.ts +25 -0
  51. package/dist/observation.d.ts.map +1 -0
  52. package/dist/observation.js +85 -0
  53. package/dist/outcome.d.ts +10 -29
  54. package/dist/outcome.d.ts.map +1 -1
  55. package/dist/outcome.js +1 -23
  56. package/dist/overlay.d.ts +9 -2
  57. package/dist/overlay.d.ts.map +1 -1
  58. package/dist/overlay.js +187 -43
  59. package/dist/paths.d.ts +0 -1
  60. package/dist/paths.d.ts.map +1 -1
  61. package/dist/paths.js +12 -19
  62. package/dist/query.d.ts +210 -10
  63. package/dist/query.d.ts.map +1 -1
  64. package/dist/query.js +420 -15
  65. package/dist/read-side.d.ts +14 -0
  66. package/dist/read-side.d.ts.map +1 -0
  67. package/dist/read-side.js +371 -0
  68. package/dist/refresh.d.ts +4 -5
  69. package/dist/refresh.d.ts.map +1 -1
  70. package/dist/refresh.js +45 -30
  71. package/dist/replica.d.ts +25 -5
  72. package/dist/replica.d.ts.map +1 -1
  73. package/dist/replica.js +228 -38
  74. package/dist/room-draft.d.ts +124 -0
  75. package/dist/room-draft.d.ts.map +1 -0
  76. package/dist/room-draft.js +327 -0
  77. package/dist/rows.d.ts +41 -0
  78. package/dist/rows.d.ts.map +1 -0
  79. package/dist/rows.js +100 -0
  80. package/dist/save.d.ts +8 -4
  81. package/dist/save.d.ts.map +1 -1
  82. package/dist/save.js +264 -350
  83. package/dist/search.d.ts +61 -0
  84. package/dist/search.d.ts.map +1 -0
  85. package/dist/search.js +125 -0
  86. package/dist/status.d.ts +4 -6
  87. package/dist/status.d.ts.map +1 -1
  88. package/dist/status.js +9 -13
  89. package/dist/store.d.ts +59 -31
  90. package/dist/store.d.ts.map +1 -1
  91. package/dist/store.js +338 -134
  92. package/dist/transfer.d.ts +5 -0
  93. package/dist/transfer.d.ts.map +1 -1
  94. package/dist/transfer.js +1 -5
  95. package/dist/wire.d.ts +4 -3
  96. package/dist/wire.d.ts.map +1 -1
  97. package/dist/wire.js +47 -68
  98. package/package.json +6 -12
  99. package/dist/adapter.js.map +0 -1
  100. package/dist/bootstrap.js.map +0 -1
  101. package/dist/change.js.map +0 -1
  102. package/dist/client.js.map +0 -1
  103. package/dist/collection.js.map +0 -1
  104. package/dist/connection.js.map +0 -1
  105. package/dist/conversation.js.map +0 -1
  106. package/dist/durability.js.map +0 -1
  107. package/dist/file.js.map +0 -1
  108. package/dist/host.js.map +0 -1
  109. package/dist/identity.js.map +0 -1
  110. package/dist/index.js.map +0 -1
  111. package/dist/log.js.map +0 -1
  112. package/dist/memory.js.map +0 -1
  113. package/dist/model.js.map +0 -1
  114. package/dist/outcome.js.map +0 -1
  115. package/dist/overlay.js.map +0 -1
  116. package/dist/paths.js.map +0 -1
  117. package/dist/query.js.map +0 -1
  118. package/dist/refresh.js.map +0 -1
  119. package/dist/replica.js.map +0 -1
  120. package/dist/save.js.map +0 -1
  121. package/dist/status.js.map +0 -1
  122. package/dist/store.js.map +0 -1
  123. package/dist/transfer.js.map +0 -1
  124. package/dist/wire.js.map +0 -1
package/dist/replica.js CHANGED
@@ -1,43 +1,68 @@
1
+ import { parse } from '@agentshouse/mdmodel';
1
2
  import { immutable } from './change.js';
2
- import { parseCollection, readCollection, validateCollection } from './collection.js';
3
- import { overlay } from './overlay.js';
3
+ import { parseCollection, readCollection, validateCollection, } from './collection.js';
4
+ import { overlay, overlayChanged, sameLayerText } from './overlay.js';
5
+ import { providerRewritten } from './save.js';
6
+ import { equalValue } from './room-draft.js';
4
7
  export function compositionOf(record) {
5
8
  return {
6
- collectionRoot: record.collectionRoot,
7
9
  model: record.model,
8
- selection: record.typedSelection === null ? null : {
9
- roots: record.typedSelection.roots,
10
- model: record.selectionModel
11
- }
10
+ selection: record.typedSelection === null
11
+ ? null
12
+ : { roots: record.typedSelection.roots, model: record.selectionModel },
12
13
  };
13
14
  }
14
- export function readConfirmed(record) {
15
- const collection = readCollection(record.documents, compositionOf(record));
16
- return collection === null ? null : {
17
- record,
18
- collection
19
- };
15
+ export function readConfirmed(record, previous) {
16
+ const read = readCollection(record.documents, compositionOf(record), previous === undefined
17
+ ? undefined
18
+ : { text: previous.record.documents, collection: previous.collection });
19
+ return read.kind === 'read'
20
+ ? { kind: 'staged', confirmed: { record, collection: read.collection } }
21
+ : read;
20
22
  }
21
- export function readStaged(record, binding) {
22
- if (binding !== null && (record.model.status === 'current' || record.selectionModel.status === 'current')) {
23
- const verdict = validateCollection(record.documents, record.binaryTargets, compositionOf(record), binding);
24
- if (verdict.verdict === 'refuse' && verdict.rule !== 'model-unavailable') return null;
23
+ export function sameMembership(record, other) {
24
+ return (JSON.stringify(record.typedSelection?.roots ?? null) ===
25
+ JSON.stringify(other.typedSelection?.roots ?? null));
26
+ }
27
+ export function readStaged(record, previous) {
28
+ if ((record.model.status === 'current' || record.selectionModel.status === 'current') &&
29
+ (previous === undefined ||
30
+ !sameLayerText(record, previous.record) ||
31
+ record.model !== previous.record.model ||
32
+ record.selectionModel !== previous.record.selectionModel)) {
33
+ const verdict = validateCollection(record.documents, record.binaryTargets, compositionOf(record));
34
+ if (verdict.verdict === 'refuse' && verdict.rule !== 'model-unavailable') {
35
+ return { kind: 'refused', refusal: verdict };
36
+ }
25
37
  }
26
- return readConfirmed(record);
38
+ return readConfirmed(record, previous);
27
39
  }
28
- export function applyReturned(confirmed, documents, revisions, removals, roomVersion, binding) {
29
- const nextDocuments = {
30
- ...confirmed.record.documents,
31
- ...documents
32
- };
33
- const nextRevisions = {
34
- ...confirmed.record.revisions,
35
- ...revisions
40
+ export function readReclassified(record, previous) {
41
+ const verdict = validateCollection(record.documents, record.binaryTargets, compositionOf(record));
42
+ if (verdict.verdict !== 'refuse')
43
+ return readConfirmed(record, previous);
44
+ return verdict.rule === 'model-unavailable'
45
+ ? { kind: 'deferred' }
46
+ : { kind: 'refused', refusal: verdict };
47
+ }
48
+ export function applyReturned(confirmed, documents, revisions, removals, roomVersion) {
49
+ const nextDocuments = { ...confirmed.record.documents, ...documents };
50
+ const nextRevisions = { ...confirmed.record.revisions, ...revisions };
51
+ const nextChanges = { ...confirmed.record.changes };
52
+ const nextWritten = {
53
+ ...confirmed.record.written,
54
+ ...Object.fromEntries(Object.keys(documents).map((path) => [path, roomVersion])),
36
55
  };
37
56
  const binaryTargets = new Set(confirmed.record.binaryTargets);
38
- for (const path of removals){
57
+ for (const [path, revision] of Object.entries(revisions)) {
58
+ if (confirmed.record.revisions[path] !== revision)
59
+ delete nextChanges[path];
60
+ }
61
+ for (const path of removals) {
39
62
  delete nextDocuments[path];
40
63
  delete nextRevisions[path];
64
+ delete nextChanges[path];
65
+ delete nextWritten[path];
41
66
  binaryTargets.delete(path);
42
67
  }
43
68
  return readStaged({
@@ -45,12 +70,53 @@ export function applyReturned(confirmed, documents, revisions, removals, roomVer
45
70
  roomVersion,
46
71
  documents: nextDocuments,
47
72
  revisions: nextRevisions,
48
- binaryTargets: [
49
- ...binaryTargets
50
- ].sort()
51
- }, binding);
73
+ changes: nextChanges,
74
+ written: nextWritten,
75
+ binaryTargets: [...binaryTargets].sort(),
76
+ }, confirmed);
52
77
  }
53
- export function replicaOf(confirmed, queue) {
78
+ function predicted(confirmed, batches, previous) {
79
+ const composition = compositionOf(confirmed.record);
80
+ let layer = confirmed.record;
81
+ const replay = [];
82
+ const prior = new Map(previous?.replay.map((step) => [step.id, step]) ?? []);
83
+ for (const batch of batches) {
84
+ const before = layer;
85
+ const old = prior.get(batch.id);
86
+ const hasMove = batch.changes.some((change) => change.kind === 'move');
87
+ const reuseRewrite = old?.collection !== undefined &&
88
+ sameLayerText(before, old.before) &&
89
+ old.collection.composition.model === composition.model &&
90
+ old.collection.composition.selection?.model === composition.selection?.model &&
91
+ JSON.stringify(old.collection.composition.selection?.roots) ===
92
+ JSON.stringify(composition.selection?.roots);
93
+ const collection = hasMove
94
+ ? reuseRewrite
95
+ ? old.collection
96
+ : parseCollection(before.documents, composition, old?.collection === undefined
97
+ ? { text: confirmed.record.documents, collection: confirmed.collection }
98
+ : { text: old.before.documents, collection: old.collection })
99
+ : undefined;
100
+ const effective = collection === undefined
101
+ ? batch
102
+ : reuseRewrite
103
+ ? old.effective
104
+ : providerRewritten(batch, { ...before, collection });
105
+ layer =
106
+ old === undefined
107
+ ? overlay(before, [effective])
108
+ : overlayChanged(before, [effective], old.before, [old.effective], old.after);
109
+ replay.push({
110
+ id: batch.id,
111
+ before,
112
+ after: layer,
113
+ effective,
114
+ ...(collection === undefined ? {} : { collection }),
115
+ });
116
+ }
117
+ return { layer, replay };
118
+ }
119
+ export function replicaOf(confirmed, queue, rewriting, previous) {
54
120
  const batches = Object.freeze(queue.map(immutable));
55
121
  if (batches.length === 0) {
56
122
  return {
@@ -60,19 +126,143 @@ export function replicaOf(confirmed, queue) {
60
126
  documents: confirmed.record.documents,
61
127
  binaryTargets: confirmed.record.binaryTargets,
62
128
  revisions: confirmed.record.revisions,
63
- collection: confirmed.collection
64
- }
129
+ changes: confirmed.record.changes,
130
+ collection: confirmed.collection,
131
+ },
132
+ replay: [],
65
133
  };
66
134
  }
67
- const layer = overlay(confirmed.record, batches);
135
+ const predictedState = rewriting === 'provider' ? predicted(confirmed, batches, previous) : null;
136
+ const layer = rewriting === 'provider'
137
+ ? predictedState.layer
138
+ : previous === undefined
139
+ ? overlay(confirmed.record, batches)
140
+ : overlayChanged(confirmed.record, batches, previous.confirmed.record, previous.queue, previous.visible);
68
141
  return {
69
142
  confirmed,
70
143
  queue: batches,
144
+ replay: predictedState?.replay ?? [],
71
145
  visible: {
72
146
  ...layer,
73
- collection: parseCollection(layer.documents, compositionOf(confirmed.record))
147
+ collection: parseCollection(layer.documents, compositionOf(confirmed.record), previous === undefined
148
+ ? undefined
149
+ : { text: previous.visible.documents, collection: previous.visible.collection }),
150
+ },
151
+ };
152
+ }
153
+ function present(layer, path) {
154
+ return layer.documents[path] !== undefined || layer.binaryTargets.includes(path);
155
+ }
156
+ function holds(layer, preconditions) {
157
+ const parsed = new Map();
158
+ const documentAt = (path) => {
159
+ if (!parsed.has(path)) {
160
+ const text = layer.documents[path];
161
+ const opened = text === undefined ? null : parse(text, path);
162
+ parsed.set(path, opened?.ok === true ? opened.document : null);
74
163
  }
164
+ return parsed.get(path) ?? null;
75
165
  };
166
+ return preconditions.every((precondition) => {
167
+ const path = precondition.path;
168
+ if (precondition.kind === 'absent')
169
+ return !present(layer, path);
170
+ if (precondition.kind === 'present')
171
+ return present(layer, path);
172
+ if (precondition.kind === 'revision') {
173
+ return present(layer, path) && layer.revisions[path] === precondition.revision;
174
+ }
175
+ const document = documentAt(path);
176
+ if (document === null)
177
+ return false;
178
+ if (precondition.kind === 'field') {
179
+ const value = Object.hasOwn(document.fields, precondition.name)
180
+ ? document.fields[precondition.name]
181
+ : undefined;
182
+ return equalValue(value, precondition.value);
183
+ }
184
+ if (precondition.kind === 'section') {
185
+ return (Object.hasOwn(document.sections, precondition.name) &&
186
+ document.sections[precondition.name] === precondition.value);
187
+ }
188
+ return document.preamble === precondition.value;
189
+ });
190
+ }
191
+ function effects(change) {
192
+ const path = change.path;
193
+ if (change.kind === 'field' || change.kind === 'section' || change.kind === 'preamble') {
194
+ return [change];
195
+ }
196
+ if (change.kind === 'create' && !('content' in change)) {
197
+ return [
198
+ { kind: 'present', path },
199
+ ...Object.entries(change.fields).map(([name, value]) => ({
200
+ kind: 'field',
201
+ path,
202
+ name,
203
+ value,
204
+ })),
205
+ ...Object.entries(change.sections).map(([name, value]) => ({
206
+ kind: 'section',
207
+ path,
208
+ name,
209
+ value,
210
+ })),
211
+ ];
212
+ }
213
+ if (change.kind === 'move') {
214
+ return [
215
+ { kind: 'absent', path },
216
+ { kind: 'present', path: change.to },
217
+ ];
218
+ }
219
+ return [{ kind: 'absent', path }];
220
+ }
221
+ function after(changes, index, path) {
222
+ let at = path;
223
+ for (const change of changes.slice(index + 1)) {
224
+ if (change.path !== at)
225
+ continue;
226
+ if (change.kind === 'remove')
227
+ return null;
228
+ if (change.kind === 'move')
229
+ at = change.to;
230
+ }
231
+ return at;
232
+ }
233
+ export function landed(batch, confirmed) {
234
+ const layer = confirmed.record;
235
+ return batch.changes.every((change, index) => {
236
+ if (change.kind === 'replace' || (change.kind === 'create' && 'content' in change)) {
237
+ const at = after(batch.changes, index, change.path);
238
+ return at === null || layer.documents[at] === change.content;
239
+ }
240
+ return effects(change).every((effect) => {
241
+ if (effect.kind === 'absent')
242
+ return holds(layer, [effect]);
243
+ const at = after(batch.changes, index, effect.path);
244
+ return at === null || holds(layer, [{ ...effect, path: at }]);
245
+ });
246
+ });
247
+ }
248
+ export function withdrawals(confirmed, queue, withdrawable, rewriting) {
249
+ if (!queue.some(withdrawable))
250
+ return [];
251
+ const composition = compositionOf(confirmed.record);
252
+ let layer = confirmed.record;
253
+ const withdrawn = [];
254
+ for (const batch of queue) {
255
+ if (withdrawable(batch) && !holds(layer, batch.preconditions)) {
256
+ withdrawn.push(batch);
257
+ continue;
258
+ }
259
+ const effective = rewriting === 'provider' && batch.changes.some((change) => change.kind === 'move')
260
+ ? providerRewritten(batch, {
261
+ ...layer,
262
+ collection: parseCollection(layer.documents, composition),
263
+ })
264
+ : batch;
265
+ layer = overlay(layer, [effective]);
266
+ }
267
+ return withdrawn;
76
268
  }
77
-
78
- //# sourceMappingURL=replica.js.map
@@ -0,0 +1,124 @@
1
+ import type { ProviderRefusal } from './adapter.js';
2
+ import type { Change, Precondition } from './change.js';
3
+ import type { VisibleLayer } from './replica.js';
4
+ export type FieldValue = {
5
+ readonly value: unknown;
6
+ } | null;
7
+ export type RoomDraftCreation = {
8
+ readonly type: string;
9
+ readonly fields: Readonly<Record<string, unknown>>;
10
+ readonly sections: Readonly<Record<string, string>>;
11
+ } | {
12
+ readonly markdown: string;
13
+ };
14
+ export type RoomDraftParts = {
15
+ readonly fields?: Readonly<Record<string, {
16
+ readonly value: unknown;
17
+ readonly base?: FieldValue;
18
+ }>>;
19
+ readonly sections?: Readonly<Record<string, {
20
+ readonly value: string;
21
+ readonly base?: string;
22
+ }>>;
23
+ readonly preamble?: {
24
+ readonly value: string;
25
+ readonly base?: string;
26
+ };
27
+ readonly markdown?: {
28
+ readonly value: string;
29
+ readonly base?: string;
30
+ };
31
+ readonly creation?: RoomDraftCreation;
32
+ readonly move?: {
33
+ readonly to: string;
34
+ readonly base?: string | null;
35
+ };
36
+ readonly removal?: {
37
+ readonly base?: string | null;
38
+ };
39
+ };
40
+ type HeldParts = {
41
+ readonly fields?: Readonly<Record<string, {
42
+ readonly value: unknown;
43
+ readonly base: FieldValue;
44
+ }>>;
45
+ readonly sections?: Readonly<Record<string, {
46
+ readonly value: string;
47
+ readonly base: string;
48
+ }>>;
49
+ readonly preamble?: {
50
+ readonly value: string;
51
+ readonly base: string;
52
+ };
53
+ readonly markdown?: {
54
+ readonly value: string;
55
+ readonly base: string;
56
+ };
57
+ readonly creation?: RoomDraftCreation;
58
+ readonly move?: {
59
+ readonly to: string;
60
+ readonly base: string | null;
61
+ };
62
+ readonly removal?: {
63
+ readonly base: string | null;
64
+ };
65
+ };
66
+ type ChangedUnderneath = {
67
+ readonly fields?: Readonly<Record<string, FieldValue>>;
68
+ readonly sections?: Readonly<Record<string, string | null>>;
69
+ readonly preamble?: string | null;
70
+ readonly markdown?: string | null;
71
+ readonly creation?: string;
72
+ readonly move?: string | null;
73
+ readonly removal?: string | null;
74
+ };
75
+ export type ReturnReason = (ProviderRefusal & {
76
+ readonly kind: 'conflicted' | 'rejected';
77
+ }) | {
78
+ readonly kind: 'expired';
79
+ } | {
80
+ readonly kind: 'withdrawn';
81
+ };
82
+ export type RoomDraft = {
83
+ readonly room: string;
84
+ readonly path: string;
85
+ readonly revision: string;
86
+ readonly parts: HeldParts;
87
+ readonly changedUnderneath: ChangedUnderneath;
88
+ readonly returned: ReturnReason | null;
89
+ };
90
+ export type RoomDraftWrite = {
91
+ readonly outcome: 'written';
92
+ readonly roomDraft: RoomDraft | null;
93
+ } | {
94
+ readonly outcome: 'stale';
95
+ readonly current: RoomDraft | null;
96
+ };
97
+ export type ChangedPart = {
98
+ readonly path: string;
99
+ readonly part: 'field' | 'section' | 'preamble' | 'markdown' | 'creation' | 'move' | 'removal';
100
+ readonly name?: string;
101
+ };
102
+ export type RoomDraftRecord = {
103
+ readonly locator: string;
104
+ readonly path: string;
105
+ readonly revision: string;
106
+ readonly parts: HeldParts;
107
+ readonly returned: ReturnReason | null;
108
+ };
109
+ export type SavedDraft = {
110
+ readonly path: string;
111
+ readonly parts: HeldParts;
112
+ };
113
+ export declare function readParts(value: unknown): RoomDraftParts;
114
+ export declare function held(current: HeldParts | undefined, parts: RoomDraftParts): HeldParts;
115
+ export declare function equalValue(left: unknown, right: unknown): boolean;
116
+ export declare function underneath(parts: HeldParts, path: string, visible: VisibleLayer | undefined): ChangedUnderneath;
117
+ export declare function changedParts(path: string, report: ChangedUnderneath): readonly ChangedPart[];
118
+ export declare function returnedInto(existing: HeldParts | undefined, returned: HeldParts): HeldParts;
119
+ export declare function changesOf(path: string, parts: HeldParts): {
120
+ changes: readonly Change[];
121
+ bases: readonly Precondition[];
122
+ };
123
+ export {};
124
+ //# sourceMappingURL=room-draft.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"room-draft.d.ts","sourceRoot":"","sources":["../src/room-draft.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC;AAE5D,MAAM,MAAM,iBAAiB,GACzB;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM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