@manifest-network/manifest-mcp-browser 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/.claude/settings.local.json +4 -1
  2. package/CLAUDE.md +2 -0
  3. package/README.md +5 -0
  4. package/dist/client.d.ts +8 -1
  5. package/dist/client.d.ts.map +1 -1
  6. package/dist/client.js +41 -1
  7. package/dist/client.js.map +1 -1
  8. package/dist/config.d.ts +4 -0
  9. package/dist/config.d.ts.map +1 -1
  10. package/dist/config.js +52 -7
  11. package/dist/config.js.map +1 -1
  12. package/dist/config.test.js +128 -0
  13. package/dist/config.test.js.map +1 -1
  14. package/dist/cosmos.d.ts.map +1 -1
  15. package/dist/cosmos.js +4 -0
  16. package/dist/cosmos.js.map +1 -1
  17. package/dist/modules.js +2 -2
  18. package/dist/modules.js.map +1 -1
  19. package/dist/transactions/billing.d.ts.map +1 -1
  20. package/dist/transactions/billing.js +80 -5
  21. package/dist/transactions/billing.js.map +1 -1
  22. package/dist/transactions/gov.d.ts.map +1 -1
  23. package/dist/transactions/gov.js +6 -0
  24. package/dist/transactions/gov.js.map +1 -1
  25. package/dist/types.d.ts +9 -0
  26. package/dist/types.d.ts.map +1 -1
  27. package/dist/types.js.map +1 -1
  28. package/package.json +7 -6
  29. package/src/client.ts +48 -1
  30. package/src/config.test.ts +156 -0
  31. package/src/config.ts +59 -7
  32. package/src/cosmos.ts +6 -0
  33. package/src/modules.ts +2 -2
  34. package/src/transactions/billing.ts +117 -5
  35. package/src/transactions/gov.ts +10 -0
  36. package/src/types.ts +10 -0
  37. package/dist/browser.d.ts.map +0 -1
  38. package/dist/browser.js.map +0 -1
  39. package/dist/queries/manifest.d.ts +0 -10
  40. package/dist/queries/manifest.d.ts.map +0 -1
  41. package/dist/queries/manifest.js +0 -14
  42. package/dist/queries/manifest.js.map +0 -1
  43. package/dist/wallet/keplr.d.ts.map +0 -1
  44. package/dist/wallet/keplr.js.map +0 -1
package/src/modules.ts CHANGED
@@ -153,9 +153,9 @@ const TX_MODULES: ModuleRegistry = {
153
153
  description: 'Manifest billing transaction subcommands',
154
154
  subcommands: [
155
155
  { name: 'fund-credit', description: 'Fund credit for a tenant', args: '<tenant-address> <amount> (e.g., manifest1abc... 1000000umfx)' },
156
- { name: 'create-lease', description: 'Create a new lease', args: '<sku-uuid:quantity>... (e.g., sku-123:1 sku-456:2)' },
156
+ { name: 'create-lease', description: 'Create a new lease', args: '[--meta-hash <hex>] <sku-uuid:quantity>... (e.g., sku-123:1 sku-456:2)' },
157
157
  { name: 'close-lease', description: 'Close one or more leases', args: '<lease-uuid>... (e.g., lease-123 lease-456)' },
158
- { name: 'withdraw', description: 'Withdraw earnings from leases', args: '<lease-uuid>... OR --provider <provider-uuid>' },
158
+ { name: 'withdraw', description: 'Withdraw earnings from leases', args: '<lease-uuid>... OR --provider <provider-uuid> [--limit <1-100>]' },
159
159
  ],
160
160
  },
161
161
  manifest: {
@@ -1,4 +1,5 @@
1
1
  import { SigningStargateClient } from '@cosmjs/stargate';
2
+ import { fromHex } from '@cosmjs/encoding';
2
3
  import { liftedinit } from '@manifest-network/manifestjs';
3
4
  import { ManifestMCPError, ManifestMCPErrorCode, CosmosTxResult, ManifestMCPConfig } from '../types.js';
4
5
  import { parseAmount, buildTxResult, parseBigInt, validateAddress, validateArgsLength } from './utils.js';
@@ -6,6 +7,41 @@ import { getSubcommandUsage } from '../modules.js';
6
7
 
7
8
  const { MsgFundCredit, MsgCreateLease, MsgCloseLease, MsgWithdraw } = liftedinit.billing.v1;
8
9
 
10
+ /** Maximum meta hash length in bytes (64 bytes for SHA-512) */
11
+ const MAX_META_HASH_BYTES = 64;
12
+
13
+ /**
14
+ * Validate and parse a hex string into Uint8Array
15
+ * Uses @cosmjs/encoding for hex validation and conversion
16
+ */
17
+ function parseMetaHash(hexString: string): Uint8Array {
18
+ // Check even length first to avoid fractional byte counts in error messages
19
+ if (hexString.length % 2 !== 0) {
20
+ throw new ManifestMCPError(
21
+ ManifestMCPErrorCode.TX_FAILED,
22
+ `Invalid meta-hash: hex string must have even length. Got ${hexString.length} characters.`
23
+ );
24
+ }
25
+
26
+ // Check max length (64 bytes = 128 hex chars)
27
+ const byteLength = hexString.length / 2;
28
+ if (byteLength > MAX_META_HASH_BYTES) {
29
+ throw new ManifestMCPError(
30
+ ManifestMCPErrorCode.TX_FAILED,
31
+ `Invalid meta-hash: exceeds maximum ${MAX_META_HASH_BYTES} bytes. Got ${byteLength} bytes (${hexString.length} hex chars).`
32
+ );
33
+ }
34
+
35
+ try {
36
+ return fromHex(hexString);
37
+ } catch (error) {
38
+ throw new ManifestMCPError(
39
+ ManifestMCPErrorCode.TX_FAILED,
40
+ `Invalid meta-hash: ${error instanceof Error ? error.message : String(error)}`
41
+ );
42
+ }
43
+ }
44
+
9
45
  /**
10
46
  * Route billing transaction to appropriate handler
11
47
  */
@@ -48,17 +84,35 @@ export async function routeBillingTransaction(
48
84
  }
49
85
 
50
86
  case 'create-lease': {
51
- if (args.length < 1) {
87
+ // Parse optional --meta-hash flag
88
+ let metaHash: Uint8Array | undefined;
89
+ let itemArgs = args;
90
+
91
+ if (args[0] === '--meta-hash') {
92
+ if (args.length < 2 || args[1].startsWith('--')) {
93
+ const usage = getSubcommandUsage('tx', 'billing', 'create-lease');
94
+ throw new ManifestMCPError(
95
+ ManifestMCPErrorCode.TX_FAILED,
96
+ `--meta-hash flag requires a hex value. Usage: create-lease ${usage ?? '<args>'}`
97
+ );
98
+ }
99
+ const hexHash = args[1];
100
+ // Validate and convert hex string to Uint8Array (max 64 bytes)
101
+ metaHash = parseMetaHash(hexHash);
102
+ itemArgs = args.slice(2);
103
+ }
104
+
105
+ if (itemArgs.length < 1) {
52
106
  const usage = getSubcommandUsage('tx', 'billing', 'create-lease');
53
107
  throw new ManifestMCPError(
54
108
  ManifestMCPErrorCode.TX_FAILED,
55
- `create-lease requires at least one sku-uuid:quantity pair. Usage: create-lease ${usage || '<sku-uuid:quantity>...'}`,
109
+ `create-lease requires at least one sku-uuid:quantity pair. Usage: create-lease ${usage ?? '<args>'}`,
56
110
  { usage }
57
111
  );
58
112
  }
59
113
 
60
114
  // Parse items (format: sku-uuid:quantity ...)
61
- const items = args.map((arg) => {
115
+ const items = itemArgs.map((arg) => {
62
116
  const [skuUuid, quantityStr] = arg.split(':');
63
117
  if (!skuUuid || !quantityStr) {
64
118
  throw new ManifestMCPError(
@@ -74,6 +128,7 @@ export async function routeBillingTransaction(
74
128
  value: MsgCreateLease.fromPartial({
75
129
  tenant: senderAddress,
76
130
  items,
131
+ metaHash: metaHash ?? new Uint8Array(),
77
132
  }),
78
133
  };
79
134
 
@@ -113,28 +168,84 @@ export async function routeBillingTransaction(
113
168
  const usage = getSubcommandUsage('tx', 'billing', 'withdraw');
114
169
  throw new ManifestMCPError(
115
170
  ManifestMCPErrorCode.TX_FAILED,
116
- `withdraw requires at least one lease-uuid argument or provider-uuid with --provider flag. Usage: withdraw ${usage || '<lease-uuid>... OR --provider <provider-uuid>'}`,
171
+ `withdraw requires at least one lease-uuid argument or provider-uuid with --provider flag. Usage: withdraw ${usage ?? '<args>'}`,
117
172
  { usage }
118
173
  );
119
174
  }
120
175
 
121
176
  // Check if using provider-wide withdrawal
122
177
  const providerFlagIndex = args.indexOf('--provider');
178
+ const limitFlagIndex = args.indexOf('--limit');
123
179
  let leaseUuids: string[] = [];
124
180
  let providerUuid = '';
181
+ let limit = BigInt(0); // 0 means use default (50)
125
182
 
126
183
  if (providerFlagIndex !== -1) {
127
184
  // Provider-wide withdrawal mode
128
185
  providerUuid = args[providerFlagIndex + 1] || '';
129
- if (!providerUuid) {
186
+ if (!providerUuid || providerUuid.startsWith('--')) {
130
187
  throw new ManifestMCPError(
131
188
  ManifestMCPErrorCode.TX_FAILED,
132
189
  'withdraw with --provider flag requires provider-uuid argument'
133
190
  );
134
191
  }
192
+
193
+ // Track consumed arg indices to detect extra arguments
194
+ const consumedIndices = new Set<number>([providerFlagIndex, providerFlagIndex + 1]);
195
+
196
+ // Parse optional --limit flag (only valid with --provider)
197
+ if (limitFlagIndex !== -1) {
198
+ const limitStr = args[limitFlagIndex + 1] || '';
199
+ if (!limitStr || limitStr.startsWith('--')) {
200
+ throw new ManifestMCPError(
201
+ ManifestMCPErrorCode.TX_FAILED,
202
+ 'withdraw with --limit flag requires a number argument (1-100)'
203
+ );
204
+ }
205
+ limit = parseBigInt(limitStr, 'limit');
206
+ if (limit < BigInt(1) || limit > BigInt(100)) {
207
+ throw new ManifestMCPError(
208
+ ManifestMCPErrorCode.TX_FAILED,
209
+ `Invalid limit: ${limit}. Must be between 1 and 100.`
210
+ );
211
+ }
212
+ consumedIndices.add(limitFlagIndex);
213
+ consumedIndices.add(limitFlagIndex + 1);
214
+ }
215
+
216
+ // Check for any extra arguments that weren't consumed
217
+ const extraArgs = args.filter((_, index) => !consumedIndices.has(index));
218
+ if (extraArgs.length > 0) {
219
+ const usage = getSubcommandUsage('tx', 'billing', 'withdraw');
220
+ throw new ManifestMCPError(
221
+ ManifestMCPErrorCode.TX_FAILED,
222
+ `Provider-wide withdrawal does not accept additional arguments. ` +
223
+ `Got unexpected: ${extraArgs.map(a => `"${a}"`).join(', ')}. ` +
224
+ `For lease-specific withdrawal, omit --provider flag. Usage: withdraw ${usage ?? '<args>'}`
225
+ );
226
+ }
135
227
  } else {
136
228
  // Lease-specific withdrawal mode
229
+ // Check for unexpected flags
230
+ const unexpectedFlags = args.filter(arg => arg.startsWith('--'));
231
+ if (unexpectedFlags.length > 0) {
232
+ const usage = getSubcommandUsage('tx', 'billing', 'withdraw');
233
+ throw new ManifestMCPError(
234
+ ManifestMCPErrorCode.TX_FAILED,
235
+ `Unexpected flag(s) in lease-specific withdrawal mode: ${unexpectedFlags.join(', ')}. ` +
236
+ `Use --provider for provider-wide withdrawal. Usage: withdraw ${usage ?? '<args>'}`
237
+ );
238
+ }
239
+
137
240
  leaseUuids = args;
241
+
242
+ if (leaseUuids.length === 0) {
243
+ const usage = getSubcommandUsage('tx', 'billing', 'withdraw');
244
+ throw new ManifestMCPError(
245
+ ManifestMCPErrorCode.TX_FAILED,
246
+ `withdraw requires at least one lease-uuid. Usage: withdraw ${usage ?? '<args>'}`
247
+ );
248
+ }
138
249
  }
139
250
 
140
251
  const msg = {
@@ -143,6 +254,7 @@ export async function routeBillingTransaction(
143
254
  sender: senderAddress,
144
255
  leaseUuids,
145
256
  providerUuid,
257
+ limit,
146
258
  }),
147
259
  };
148
260
 
@@ -136,6 +136,16 @@ export async function routeGovTransaction(
136
136
  return { option, weight };
137
137
  });
138
138
 
139
+ // Validate that weights sum to exactly 1.0 (10^18 in fixed-point)
140
+ const totalWeight = options.reduce((sum, opt) => sum + BigInt(opt.weight), BigInt(0));
141
+ const oneInFixed18 = BigInt('1000000000000000000'); // 10^18
142
+ if (totalWeight !== oneInFixed18) {
143
+ throw new ManifestMCPError(
144
+ ManifestMCPErrorCode.TX_FAILED,
145
+ `Weighted vote options must sum to exactly 1.0. Got ${Number(totalWeight) / 1e18} (${options.map(o => o.weight).join(' + ')} = ${totalWeight})`
146
+ );
147
+ }
148
+
139
149
  const msg = {
140
150
  typeUrl: '/cosmos.gov.v1.MsgVoteWeighted',
141
151
  value: MsgVoteWeighted.fromPartial({
package/src/types.ts CHANGED
@@ -1,5 +1,13 @@
1
1
  import type { OfflineSigner } from '@cosmjs/proto-signing';
2
2
 
3
+ /**
4
+ * Rate limiting configuration
5
+ */
6
+ export interface RateLimitConfig {
7
+ /** Maximum requests per second (default: 10) */
8
+ readonly requestsPerSecond?: number;
9
+ }
10
+
3
11
  /**
4
12
  * Configuration for the Manifest MCP Browser server
5
13
  */
@@ -14,6 +22,8 @@ export interface ManifestMCPConfig {
14
22
  readonly gasAdjustment?: number;
15
23
  /** Address prefix (e.g., "manifest") */
16
24
  readonly addressPrefix?: string;
25
+ /** Rate limiting configuration */
26
+ readonly rateLimit?: RateLimitConfig;
17
27
  }
18
28
 
19
29
  /**
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,WAAW,GACZ,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,aAAa,GACd,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGlD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGpD,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEzE;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,OAAO,YAAY,EAAE,iBAAiB,CAAC,CAYlD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,wBAAwB;AACxB,OAAO,EAOL,gBAAgB,EAChB,oBAAoB,GAErB,MAAM,YAAY,CAAC;AAEpB,gBAAgB;AAChB,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,aAAa,GACd,MAAM,aAAa,CAAC;AAErB,8BAA8B;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,iBAAiB;AACjB,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,kCAAkC;AAClC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEpD,mBAAmB;AACnB,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAEtB,aAAa;AACb,OAAO,EAAE,iBAAiB,EAA4B,MAAM,YAAY,CAAC;AAEzE;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,MAO1C;IACC,MAAM,EAAE,iBAAiB,EAAE,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC;IACzD,MAAM,EAAE,sBAAsB,EAAE,GAAG,MAAM,MAAM,CAAC,sBAAsB,CAAC,CAAC;IAExE,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,MAAM,CAAC;IAC1C,MAAM,cAAc,GAAG,IAAI,sBAAsB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACvE,MAAM,cAAc,CAAC,OAAO,EAAE,CAAC;IAE/B,OAAO,IAAI,iBAAiB,CAAC;QAC3B,MAAM,EAAE,SAAS;QACjB,cAAc;KACf,CAAC,CAAC;AACL,CAAC"}
@@ -1,10 +0,0 @@
1
- import { ManifestQueryClient } from '../client.js';
2
- /**
3
- * Route manifest module query to manifestjs query client
4
- * Note: The manifest module currently has no query endpoints defined
5
- */
6
- export declare function routeManifestQuery(_queryClient: ManifestQueryClient, subcommand: string, _args: string[]): Promise<Record<string, unknown>>;
7
- export declare const manifestQueries: {
8
- subcommands: never[];
9
- };
10
- //# sourceMappingURL=manifest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/queries/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,YAAY,EAAE,mBAAmB,EACjC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EAAE,GACd,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAQlC;AAED,eAAO,MAAM,eAAe;;CAE3B,CAAC"}
@@ -1,14 +0,0 @@
1
- import { ManifestMCPError, ManifestMCPErrorCode } from '../types.js';
2
- /**
3
- * Route manifest module query to manifestjs query client
4
- * Note: The manifest module currently has no query endpoints defined
5
- */
6
- export async function routeManifestQuery(_queryClient, subcommand, _args) {
7
- // The manifest module query interface is currently empty
8
- // This is a placeholder for future manifest-specific queries
9
- throw new ManifestMCPError(ManifestMCPErrorCode.UNSUPPORTED_QUERY, `Unsupported manifest query subcommand: ${subcommand}. The manifest module currently has no query endpoints.`, { availableSubcommands: [] });
10
- }
11
- export const manifestQueries = {
12
- subcommands: [],
13
- };
14
- //# sourceMappingURL=manifest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/queries/manifest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAErE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,YAAiC,EACjC,UAAkB,EAClB,KAAe;IAEf,yDAAyD;IACzD,6DAA6D;IAC7D,MAAM,IAAI,gBAAgB,CACxB,oBAAoB,CAAC,iBAAiB,EACtC,0CAA0C,UAAU,yDAAyD,EAC7G,EAAE,oBAAoB,EAAE,EAAE,EAAE,CAC7B,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,WAAW,EAAE,EAAE;CAChB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"keplr.d.ts","sourceRoot":"","sources":["../../src/wallet/keplr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,IAAI,WAAW,EAAa,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAA0C,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAExG,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAO,SAAQ,WAAW;KAAG;CACxC;AAED;;GAEG;AACH,qBAAa,mBAAoB,YAAW,cAAc;IACxD,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,MAAM,CAA8B;gBAEhC,MAAM,EAAE,iBAAiB;IAIrC;;OAEG;IACH,OAAO,CAAC,QAAQ;IAkBhB;;OAEG;IACH,OAAO,CAAC,YAAY;IA8CpB;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAkC9B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAKjC;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAenC;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,aAAa,CAAC;CAc1C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"keplr.js","sourceRoot":"","sources":["../../src/wallet/keplr.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,gBAAgB,EAAE,oBAAoB,EAAqB,MAAM,aAAa,CAAC;AAMxG;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAK9B,YAAY,MAAyB;QAH7B,YAAO,GAAkB,IAAI,CAAC;QAC9B,WAAM,GAAyB,IAAI,CAAC;QAG1C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;OAEG;IACK,QAAQ;QACd,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,MAAM,IAAI,gBAAgB,CACxB,oB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