@agentshouse/mdruntime 0.1.0-alpha.8 → 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 (121) hide show
  1. package/AGENTS.md +208 -0
  2. package/README.md +44 -0
  3. package/dist/adapter.d.ts +215 -25
  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 +6 -7
  10. package/dist/bootstrap.d.ts.map +1 -1
  11. package/dist/bootstrap.js +31 -28
  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 +69 -0
  19. package/dist/client.d.ts.map +1 -0
  20. package/dist/client.js +165 -0
  21. package/dist/collection.d.ts +22 -15
  22. package/dist/collection.d.ts.map +1 -1
  23. package/dist/collection.js +60 -78
  24. package/dist/connection.d.ts +68 -40
  25. package/dist/connection.d.ts.map +1 -1
  26. package/dist/connection.js +1597 -961
  27. package/dist/conversation.d.ts +79 -0
  28. package/dist/conversation.d.ts.map +1 -0
  29. package/dist/conversation.js +557 -0
  30. package/dist/durability.d.ts +8 -3
  31. package/dist/durability.d.ts.map +1 -1
  32. package/dist/durability.js +7 -61
  33. package/dist/file.d.ts +20 -0
  34. package/dist/file.d.ts.map +1 -0
  35. package/dist/file.js +126 -0
  36. package/dist/host.d.ts +13 -0
  37. package/dist/host.d.ts.map +1 -0
  38. package/dist/host.js +175 -0
  39. package/dist/identity.d.ts +1 -0
  40. package/dist/identity.d.ts.map +1 -1
  41. package/dist/identity.js +10 -9
  42. package/dist/index.d.ts +14 -10
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +1 -3
  45. package/dist/log.js +5 -6
  46. package/dist/memory.d.ts +17 -2
  47. package/dist/memory.d.ts.map +1 -1
  48. package/dist/memory.js +268 -113
  49. package/dist/model.d.ts +10 -25
  50. package/dist/model.d.ts.map +1 -1
  51. package/dist/model.js +18 -21
  52. package/dist/observation.d.ts +25 -0
  53. package/dist/observation.d.ts.map +1 -0
  54. package/dist/observation.js +85 -0
  55. package/dist/outcome.d.ts +12 -24
  56. package/dist/outcome.d.ts.map +1 -1
  57. package/dist/outcome.js +1 -13
  58. package/dist/overlay.d.ts +9 -2
  59. package/dist/overlay.d.ts.map +1 -1
  60. package/dist/overlay.js +187 -43
  61. package/dist/paths.d.ts +0 -1
  62. package/dist/paths.d.ts.map +1 -1
  63. package/dist/paths.js +12 -19
  64. package/dist/query.d.ts +210 -9
  65. package/dist/query.d.ts.map +1 -1
  66. package/dist/query.js +420 -15
  67. package/dist/read-side.d.ts +14 -0
  68. package/dist/read-side.d.ts.map +1 -0
  69. package/dist/read-side.js +371 -0
  70. package/dist/refresh.d.ts +4 -5
  71. package/dist/refresh.d.ts.map +1 -1
  72. package/dist/refresh.js +45 -30
  73. package/dist/replica.d.ts +27 -6
  74. package/dist/replica.d.ts.map +1 -1
  75. package/dist/replica.js +233 -30
  76. package/dist/room-draft.d.ts +124 -0
  77. package/dist/room-draft.d.ts.map +1 -0
  78. package/dist/room-draft.js +327 -0
  79. package/dist/rows.d.ts +41 -0
  80. package/dist/rows.d.ts.map +1 -0
  81. package/dist/rows.js +100 -0
  82. package/dist/save.d.ts +10 -6
  83. package/dist/save.d.ts.map +1 -1
  84. package/dist/save.js +266 -333
  85. package/dist/search.d.ts +61 -0
  86. package/dist/search.d.ts.map +1 -0
  87. package/dist/search.js +125 -0
  88. package/dist/status.d.ts +9 -2
  89. package/dist/status.d.ts.map +1 -1
  90. package/dist/status.js +11 -14
  91. package/dist/store.d.ts +75 -18
  92. package/dist/store.d.ts.map +1 -1
  93. package/dist/store.js +358 -97
  94. package/dist/transfer.d.ts +5 -0
  95. package/dist/transfer.d.ts.map +1 -1
  96. package/dist/transfer.js +1 -5
  97. package/dist/wire.d.ts +64 -0
  98. package/dist/wire.d.ts.map +1 -0
  99. package/dist/wire.js +118 -0
  100. package/package.json +15 -13
  101. package/dist/adapter.js.map +0 -1
  102. package/dist/bootstrap.js.map +0 -1
  103. package/dist/change.js.map +0 -1
  104. package/dist/collection.js.map +0 -1
  105. package/dist/connection.js.map +0 -1
  106. package/dist/durability.js.map +0 -1
  107. package/dist/identity.js.map +0 -1
  108. package/dist/index.js.map +0 -1
  109. package/dist/log.js.map +0 -1
  110. package/dist/memory.js.map +0 -1
  111. package/dist/model.js.map +0 -1
  112. package/dist/outcome.js.map +0 -1
  113. package/dist/overlay.js.map +0 -1
  114. package/dist/paths.js.map +0 -1
  115. package/dist/query.js.map +0 -1
  116. package/dist/refresh.js.map +0 -1
  117. package/dist/replica.js.map +0 -1
  118. package/dist/save.js.map +0 -1
  119. package/dist/status.js.map +0 -1
  120. package/dist/store.js.map +0 -1
  121. package/dist/transfer.js.map +0 -1
package/dist/replica.js CHANGED
@@ -1,30 +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';
4
- export function readConfirmed(record) {
5
- const collection = readCollection(record.documents, record.collectionRoot, record.model);
6
- return collection === null ? null : {
7
- record,
8
- collection
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';
7
+ export function compositionOf(record) {
8
+ return {
9
+ model: record.model,
10
+ selection: record.typedSelection === null
11
+ ? null
12
+ : { roots: record.typedSelection.roots, model: record.selectionModel },
9
13
  };
10
14
  }
11
- export function readStaged(record, binding) {
12
- if (record.model.status === 'current' && binding !== null && validateCollection(record.documents, record.binaryTargets, record.collectionRoot, record.model, binding).verdict === 'refuse') return null;
13
- return readConfirmed(record);
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;
14
22
  }
15
- export function applyReturned(confirmed, documents, revisions, removals, roomVersion, binding) {
16
- const nextDocuments = {
17
- ...confirmed.record.documents,
18
- ...documents
19
- };
20
- const nextRevisions = {
21
- ...confirmed.record.revisions,
22
- ...revisions
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
+ }
37
+ }
38
+ return readConfirmed(record, previous);
39
+ }
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])),
23
55
  };
24
56
  const binaryTargets = new Set(confirmed.record.binaryTargets);
25
- 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) {
26
62
  delete nextDocuments[path];
27
63
  delete nextRevisions[path];
64
+ delete nextChanges[path];
65
+ delete nextWritten[path];
28
66
  binaryTargets.delete(path);
29
67
  }
30
68
  return readStaged({
@@ -32,12 +70,53 @@ export function applyReturned(confirmed, documents, revisions, removals, roomVer
32
70
  roomVersion,
33
71
  documents: nextDocuments,
34
72
  revisions: nextRevisions,
35
- binaryTargets: [
36
- ...binaryTargets
37
- ].sort()
38
- }, binding);
73
+ changes: nextChanges,
74
+ written: nextWritten,
75
+ binaryTargets: [...binaryTargets].sort(),
76
+ }, confirmed);
77
+ }
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 };
39
118
  }
40
- export function replicaOf(confirmed, queue) {
119
+ export function replicaOf(confirmed, queue, rewriting, previous) {
41
120
  const batches = Object.freeze(queue.map(immutable));
42
121
  if (batches.length === 0) {
43
122
  return {
@@ -47,19 +126,143 @@ export function replicaOf(confirmed, queue) {
47
126
  documents: confirmed.record.documents,
48
127
  binaryTargets: confirmed.record.binaryTargets,
49
128
  revisions: confirmed.record.revisions,
50
- collection: confirmed.collection
51
- }
129
+ changes: confirmed.record.changes,
130
+ collection: confirmed.collection,
131
+ },
132
+ replay: [],
52
133
  };
53
134
  }
54
- 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);
55
141
  return {
56
142
  confirmed,
57
143
  queue: batches,
144
+ replay: predictedState?.replay ?? [],
58
145
  visible: {
59
146
  ...layer,
60
- collection: parseCollection(layer.documents, confirmed.record.model)
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);
61
163
  }
164
+ return parsed.get(path) ?? null;
62
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;
63
268
  }
64
-
65
- //# 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,EAAE,OAAO,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACrD,GACD;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAElC,MAAM,MAAM,cAAc,GAAG;IAC3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