@supersdk/supercli 0.3.0 → 0.3.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 (60) hide show
  1. package/dist/api/analyticsClient.js +48 -0
  2. package/dist/api/analyticsClient.js.map +1 -0
  3. package/dist/api/consoleClient.js +58 -42
  4. package/dist/api/consoleClient.js.map +1 -1
  5. package/dist/api/dbClient.js +90 -0
  6. package/dist/api/dbClient.js.map +1 -0
  7. package/dist/api/settingsClient.js +43 -0
  8. package/dist/api/settingsClient.js.map +1 -0
  9. package/dist/cli.js +24 -2
  10. package/dist/cli.js.map +1 -1
  11. package/dist/commands/add.js +67 -226
  12. package/dist/commands/add.js.map +1 -1
  13. package/dist/commands/analytics.js +265 -0
  14. package/dist/commands/analytics.js.map +1 -0
  15. package/dist/commands/db.js +590 -0
  16. package/dist/commands/db.js.map +1 -0
  17. package/dist/commands/deploy.js +883 -0
  18. package/dist/commands/deploy.js.map +1 -0
  19. package/dist/commands/env.js +53 -0
  20. package/dist/commands/env.js.map +1 -0
  21. package/dist/commands/image.js +471 -0
  22. package/dist/commands/image.js.map +1 -0
  23. package/dist/commands/logs.js +131 -0
  24. package/dist/commands/logs.js.map +1 -0
  25. package/dist/commands/publishSite.js +28 -10
  26. package/dist/commands/publishSite.js.map +1 -1
  27. package/dist/commands/register.js +363 -0
  28. package/dist/commands/register.js.map +1 -0
  29. package/dist/commands/settings.js +307 -0
  30. package/dist/commands/settings.js.map +1 -0
  31. package/dist/commands/sqlInput.js +48 -0
  32. package/dist/commands/sqlInput.js.map +1 -0
  33. package/dist/docker/dockerCli.js +301 -0
  34. package/dist/docker/dockerCli.js.map +1 -0
  35. package/dist/docker/registry.js +128 -0
  36. package/dist/docker/registry.js.map +1 -0
  37. package/dist/generated/log_contract.js +33 -0
  38. package/dist/generated/log_contract.js.map +1 -0
  39. package/dist/output/envelope.js +20 -5
  40. package/dist/output/envelope.js.map +1 -1
  41. package/dist/output/resultPrinter.js +35 -6
  42. package/dist/output/resultPrinter.js.map +1 -1
  43. package/dist/publish/registryClient.js +128 -0
  44. package/dist/publish/registryClient.js.map +1 -0
  45. package/dist/publish/runClient.js +495 -0
  46. package/dist/publish/runClient.js.map +1 -0
  47. package/dist/template/scripts/build_android.sh +107 -8
  48. package/dist/template/scripts/web_package.py +15 -3
  49. package/dist/template/web/src/js/app.js +3 -2
  50. package/dist/template/web/src/js/supersdk.js +1 -2024
  51. package/dist/template/web/src/js/supersdk.provenance.json +5 -4
  52. package/dist/util/prompt.js +7 -2
  53. package/dist/util/prompt.js.map +1 -1
  54. package/dist/workspace/config.js +1 -0
  55. package/dist/workspace/config.js.map +1 -1
  56. package/dist/workspace/inspect.js +274 -0
  57. package/dist/workspace/inspect.js.map +1 -0
  58. package/dist/workspace/projectIdentity.js +255 -0
  59. package/dist/workspace/projectIdentity.js.map +1 -0
  60. package/package.json +4 -4
@@ -0,0 +1,363 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.IOS_UNSUPPORTED_MESSAGE = exports.REGISTERABLE_TYPES = void 0;
37
+ exports.isRegisterableType = isRegisterableType;
38
+ exports.runRegister = runRegister;
39
+ exports.registerRegisterCommand = registerRegisterCommand;
40
+ const fs = __importStar(require("node:fs"));
41
+ const path = __importStar(require("node:path"));
42
+ const resultPrinter_1 = require("../output/resultPrinter");
43
+ const siteConfig_1 = require("../publish/siteConfig");
44
+ const prompt_1 = require("../util/prompt");
45
+ const shell_1 = require("../util/shell");
46
+ const config_1 = require("../workspace/config");
47
+ const projectIdentity_1 = require("../workspace/projectIdentity");
48
+ const inspect_1 = require("../workspace/inspect");
49
+ const template_1 = require("../workspace/template");
50
+ /** register 接管的类型集合。ios 刻意不在其中 —— 见 IOS_UNSUPPORTED_MESSAGE。 */
51
+ exports.REGISTERABLE_TYPES = ['android', 'site'];
52
+ function isRegisterableType(value) {
53
+ return exports.REGISTERABLE_TYPES.includes(value);
54
+ }
55
+ function commandLabel(type) {
56
+ return `supercli register ${type}`;
57
+ }
58
+ /**
59
+ * `register ios` 的拒绝文案。
60
+ *
61
+ * 🔴 「不许假装支持」:登记一个永远构建不了的 iOS 工程,是本轮反复在修的那类「静默成功」——
62
+ * 命令 exit 0、配置里多了一条,问题要等到某次 CI 跑 build_ios.sh 时才以一个毫不相干的报错
63
+ * 出现。所以这里 fail-closed,并把「为什么」和「那我能做什么」一次说完。
64
+ */
65
+ exports.IOS_UNSUPPORTED_MESSAGE = [
66
+ '`supercli register ios` is not supported — deliberately, not as an oversight.',
67
+ '',
68
+ 'The SuperSDK iOS project is generated, not hand-maintained: `scripts/build_ios.sh` renders ' +
69
+ '<dir>/.supersdk/generated/project.generated.yml and SimpleConfig.swift from the project\'s project.yml plus ' +
70
+ 'the managed config, then runs XcodeGen (`xcodegen generate`) to produce the .xcodeproj. An existing app whose .xcodeproj ' +
71
+ 'is maintained by hand has nothing for that pipeline to attach to.',
72
+ '',
73
+ 'Registering it anyway would record a project that can never be built — the command would exit 0 and the ' +
74
+ 'failure would surface much later, somewhere else, looking like a build bug. A refusal here is the cheaper ' +
75
+ 'outcome.',
76
+ '',
77
+ 'What does work:',
78
+ " supercli add ios <empty-dir> --bundle-id com.acme.myapp --name 'My App' # a NEW iOS project from the template",
79
+ ' supercli register android <dir> --package com.acme.myapp --name <label> # adopt an existing Android project',
80
+ ' supercli register site <dir> --slug <slug> # adopt an existing site project',
81
+ '',
82
+ 'To bring SuperSDK into an existing iOS app without this command, add the SDK to that app directly (SPM) and ' +
83
+ 'keep it out of supersdk.json — the workspace build pipeline only drives generated iOS projects.',
84
+ ].join('\n');
85
+ function statTarget(target) {
86
+ let stat;
87
+ try {
88
+ stat = fs.statSync(target);
89
+ }
90
+ catch (err) {
91
+ if (err.code === 'ENOENT')
92
+ return 'missing';
93
+ return 'unreadable';
94
+ }
95
+ return stat.isDirectory() ? 'ok' : 'not-a-directory';
96
+ }
97
+ /** 第二层:看着像不像这个类型的工程。**只警告**,永不拦。 */
98
+ function plausibilityWarnings(type, projectDir, inspection) {
99
+ // site:目录存在即可。产物目录(dist/)可能还没构建出来,源码布局更是千差万别 —— 没有
100
+ // 任何可信的判据,所以一个字都不说。
101
+ if (type !== 'android' || inspection === undefined)
102
+ return [];
103
+ if (inspection.markers.length > 0)
104
+ return [];
105
+ return [
106
+ `no ${inspect_1.GRADLE_MARKER_FILENAMES.join(' / ')} found under "${projectDir}" — this does not look like the root of a ` +
107
+ 'Gradle project. Registered anyway: layouts differ legitimately (monorepos, nested Gradle projects), and the ' +
108
+ 'build will tell you the truth. If `./super_build.sh --platform android` cannot find your build, register the ' +
109
+ 'directory that holds settings.gradle[.kts] instead.',
110
+ ];
111
+ }
112
+ function summary(args) {
113
+ const { type, target, entry, workspace, warnings, guidance } = args;
114
+ const lines = [
115
+ `registered existing ${type} project at ${target}`,
116
+ `dir: ${entry.dir}`,
117
+ `registered in: ${workspace.configPath}`,
118
+ ];
119
+ if (type === 'android')
120
+ lines.push(`name: ${String(entry.name)}`, `package: ${String(entry.package)}`);
121
+ if (type === 'site') {
122
+ const deploy = entry.deploy[0];
123
+ lines.push(entry.name === undefined
124
+ ? `name: (unset) — resolves to the slug "${deploy.slug}"; pass --name here, or --name to \`supercli publish-site\`, to set a different one`
125
+ : `name: ${String(entry.name)}`, `deploy[0]: slug=${deploy.slug} env=${deploy.env} dir=${deploy.dir}`,
126
+ // 🔴 显式打印,不静默:没有 offline.host 就没有离线包。域名是服务端签发的,CLI 绝不自己拼。
127
+ 'offline.host: (unset) — offline packaging is skipped until the first successful ' +
128
+ '`supercli publish-site`, which records the domain the server issued. supercli never composes a domain itself.');
129
+ }
130
+ // 「什么都没动」必须说出来:它是 register 与 add 的分界线,也是用户敢在自己工程上跑它的理由。
131
+ lines.push(`files written inside ${entry.dir}: none — \`register\` only records the directory`);
132
+ if (warnings.length > 0) {
133
+ lines.push('', 'warnings:');
134
+ for (const warning of warnings)
135
+ lines.push(` - ${warning}`);
136
+ }
137
+ if (guidance.length > 0)
138
+ lines.push('', ...guidance);
139
+ lines.push('', `next: cd ${(0, shell_1.shellQuote)(workspace.root)} && ./super_build.sh --platform ${type} --project ${entry.dir} --plan`);
140
+ return lines.join('\n');
141
+ }
142
+ /**
143
+ * Core register logic, decoupled from commander so it can be exercised directly in
144
+ * unit/integration tests.
145
+ */
146
+ async function runRegister(typeArg, dirArg, opts, deps = {}) {
147
+ if (typeArg === 'ios')
148
+ return { ok: false, kind: 'business_error', message: exports.IOS_UNSUPPORTED_MESSAGE };
149
+ // 防御性兜底,**CLI 上走不到**:`register` 的每个类型都是注册过的子命令,`register web foo`
150
+ // 由 commander 拦成 `unknown command 'web'`(exit 1,与 `add web foo` 一致)。这里只保护
151
+ // 直接调 runRegister 的程序化调用方。改成用户可见的文案没有意义 —— 用户看不到它。
152
+ if (!isRegisterableType(typeArg)) {
153
+ return {
154
+ ok: false,
155
+ kind: 'business_error',
156
+ message: `unknown project type "${typeArg}"; \`supercli register\` takes ${exports.REGISTERABLE_TYPES.join(' | ')} ` +
157
+ '(ios is not supported — run `supercli register ios <dir>` for the reason).',
158
+ };
159
+ }
160
+ const type = typeArg;
161
+ const cwd = path.resolve(deps.cwd ?? process.cwd());
162
+ const loaded = (0, config_1.loadWorkspace)(cwd);
163
+ if (loaded.kind !== 'ok')
164
+ return { ok: false, kind: 'business_error', message: loaded.message };
165
+ const workspace = loaded.workspace;
166
+ // ---- 第一层 · 目录:相对工作空间根、全局唯一、不得与已有条目互为祖先 ----
167
+ const target = path.resolve(cwd, dirArg);
168
+ const relative = (0, config_1.relativeToRoot)(workspace.root, target);
169
+ const normalized = (0, config_1.checkProjectDir)(relative);
170
+ if ('error' in normalized) {
171
+ return {
172
+ ok: false,
173
+ kind: 'business_error',
174
+ message: `<dir> "${dirArg}" resolves to ${target}, which is outside the workspace root ${workspace.root}: ` +
175
+ `${normalized.error}. A project directory must live inside the workspace that owns it.`,
176
+ };
177
+ }
178
+ const projectDir = normalized.dir;
179
+ // 🔴 与**全部**项目比对,不只是站点项目:dir 是项目的定位键,重复或嵌套时「这个目录属于
180
+ // 哪个项目」就没有唯一答案。锁内 appendProject 会再判一次(那次才是权威),这里只为早失败。
181
+ const conflict = (0, config_1.findDirConflict)(workspace.projects, projectDir);
182
+ if (conflict) {
183
+ const already = conflict.dir === projectDir;
184
+ return {
185
+ ok: false,
186
+ kind: 'business_error',
187
+ message: already
188
+ ? `"${projectDir}" is already registered in ${config_1.CONFIG_FILENAME} with type "${conflict.type}" — ` +
189
+ 'nothing to do. `register` never rewrites an existing entry: edit it by hand if its identity is wrong, ' +
190
+ 'so a re-run can never silently change the applicationId or slug an artifact was built with.'
191
+ : `refusing to register "${projectDir}": ${config_1.CONFIG_FILENAME} already registers the ${conflict.type} project ` +
192
+ `at "${conflict.dir}", and project directories must be unique and must not contain one another. ` +
193
+ 'Pick a directory that neither contains nor sits inside an existing project.',
194
+ };
195
+ }
196
+ // 🔴 目录必须已经存在 —— register 独有的一条(add 反而要求目录**不**存在或为空)。
197
+ // 接管的是「已有工程」,路径打错时最坏的结局是配置里多一条指向空气的项目:`--plan` 报的
198
+ // 是一句跟拼写错误毫无字面关系的话,而这里当场就能说清。
199
+ const state = statTarget(target);
200
+ if (state !== 'ok') {
201
+ const reason = state === 'missing'
202
+ ? 'does not exist'
203
+ : state === 'not-a-directory'
204
+ ? 'exists but is not a directory'
205
+ : 'cannot be inspected';
206
+ return {
207
+ ok: false,
208
+ kind: 'business_error',
209
+ message: `"${target}" ${reason}. \`supercli register\` adopts a directory that is already there — it never creates ` +
210
+ 'one, and it never writes into one.\n' +
211
+ `Create the project first (\`supercli add ${type} ${(0, shell_1.shellQuote)(dirArg)} ...\` scaffolds a new one from the ` +
212
+ 'built-in template), or fix the path.',
213
+ };
214
+ }
215
+ // Asked last, so the user is never interrogated for a run that was going to fail on the
216
+ // workspace, the directory or a conflict anyway.
217
+ const interactive = (deps.isInteractive ?? prompt_1.isInteractiveStdin)();
218
+ const prompt = deps.prompt ?? prompt_1.promptLineWithDefaultSync;
219
+ const identity = (0, projectIdentity_1.resolveIdentity)(type, projectDir, opts, interactive, prompt);
220
+ if (!identity.ok) {
221
+ return {
222
+ ok: false,
223
+ kind: 'business_error',
224
+ message: (0, projectIdentity_1.identityFailureMessage)({
225
+ commandLabel: commandLabel(type),
226
+ type: type,
227
+ dirArg,
228
+ projectDir,
229
+ opts,
230
+ interactive,
231
+ resolution: identity.resolution,
232
+ resolved: identity.resolved,
233
+ workspaceName: workspace.name,
234
+ notes: [
235
+ '`supercli register` never derives an identity from the directory it adopts: not from the folder name, ' +
236
+ 'not from an existing AndroidManifest / build.gradle, not from the workspace name. Reading it out of ' +
237
+ 'your project would make the registered identity a guess that later silently disagrees with the build.',
238
+ ],
239
+ }),
240
+ };
241
+ }
242
+ // 🔴 站点的 (slug, env) 在**整个工作空间**内唯一 —— 判定复用发布侧的 findDeployTarget,
243
+ // 不在这里另写一次遍历。不查的话,冲突要等到 appendProject 写出后再解析时才被拒(错误
244
+ // 措辞完全指不到是哪两条撞了),而两条同 (slug, env) 指向的其实是同一个线上站点。
245
+ if (type === 'site') {
246
+ const slug = identity.resolved.slug;
247
+ const env = identity.resolved.env;
248
+ const taken = (0, siteConfig_1.findDeployTarget)(workspace.config, slug, env);
249
+ if (taken) {
250
+ return {
251
+ ok: false,
252
+ kind: 'business_error',
253
+ message: `refusing to register "${projectDir}": the site project at "${taken.project.dir}" already deploys ` +
254
+ `slug=${slug} env=${env} (${config_1.CONFIG_FILENAME} keeps every (slug, env) pair unique across the whole ` +
255
+ 'workspace — the pair identifies one live site). Pick a different --slug, or a different --env, or ' +
256
+ `publish the existing project instead: supercli publish-site ${(0, shell_1.shellQuote)(taken.entry.dir || taken.project.dir)} ` +
257
+ `--spid ${workspace.spid} --slug ${slug} --env ${env}`,
258
+ };
259
+ }
260
+ }
261
+ const entry = (0, projectIdentity_1.buildEntry)(type, projectDir, identity.resolved);
262
+ try {
263
+ (0, config_1.appendProject)(workspace.configPath, entry);
264
+ }
265
+ catch (err) {
266
+ return {
267
+ ok: false,
268
+ kind: 'infra_error',
269
+ message: `failed to register the project in ${workspace.configPath}: ${err.message}. Nothing else was changed.`,
270
+ };
271
+ }
272
+ // ---- 第二层 + 第三层:**登记之后**才跑,纯诊断,绝不回滚已经写好的登记 ----
273
+ // 顺序是刻意的:这两层给的是「接下来还要做什么」,不是「这次能不能登记」。让一条警告
274
+ // 撤销一次成功的登记,等于把第二层偷偷变成 fail-closed。
275
+ let inspection;
276
+ if (type === 'android') {
277
+ try {
278
+ inspection = (0, inspect_1.inspectAndroidProject)(target);
279
+ }
280
+ catch {
281
+ inspection = undefined; // 探测是尽力而为:读不动用户的目录不该让一次成功的登记看起来失败
282
+ }
283
+ }
284
+ const warnings = plausibilityWarnings(type, projectDir, inspection);
285
+ const guidance = inspection !== undefined && inspection.readerAppliedIn.length === 0
286
+ ? (0, inspect_1.androidReaderGuidance)({
287
+ projectDir,
288
+ projectAbsDir: target,
289
+ inspection,
290
+ templateReader: locateTemplateReader(deps),
291
+ })
292
+ : [];
293
+ return {
294
+ ok: true,
295
+ message: summary({ type, target, entry, workspace, warnings, guidance }),
296
+ result: {
297
+ type,
298
+ dir: projectDir,
299
+ projectDir: target,
300
+ configPath: workspace.configPath,
301
+ entry,
302
+ warnings,
303
+ guidance,
304
+ },
305
+ };
306
+ }
307
+ /** 模板里那份 gradle reader 的绝对路径;找不到模板就返回 undefined(指引会自动省掉 cp 那步)。 */
308
+ function locateTemplateReader(deps) {
309
+ try {
310
+ const templateRoot = deps.templateRoot ?? (0, template_1.locateDefaultTemplateRoot)();
311
+ const manifest = (0, template_1.loadTemplateManifest)(templateRoot).manifest;
312
+ return (0, inspect_1.templateConfigReaderPath)(templateRoot, (0, template_1.templateDirFor)('android', manifest));
313
+ }
314
+ catch {
315
+ return undefined;
316
+ }
317
+ }
318
+ function outputModeOf(cmd) {
319
+ return cmd.optsWithGlobals?.()?.output === 'json' ? 'json' : 'human';
320
+ }
321
+ function action(type) {
322
+ return async (dirArg, opts, cmd) => {
323
+ const printer = new resultPrinter_1.ResultPrinter(outputModeOf(cmd));
324
+ const result = await runRegister(type, dirArg, opts);
325
+ if (result.ok)
326
+ printer.success(result.result ?? {}, { humanMessage: result.message });
327
+ else
328
+ printer.failure(result.kind ?? 'business_error', result.message);
329
+ };
330
+ }
331
+ /** 每个子命令都要自带 Agent Contract 的两个全局选项:program 级的那份只在子命令名**之前**生效。 */
332
+ function withGlobalOptions(command) {
333
+ return command
334
+ .option('--output <mode>', 'output mode: "json" emits a single machine-readable envelope on stdout')
335
+ .option('--no-input', 'never prompt for interactive input; fail fast (implied by --output json)');
336
+ }
337
+ function registerRegisterCommand(program) {
338
+ const register = program
339
+ .command('register')
340
+ .description(`Record an EXISTING project directory in the current workspace (${exports.REGISTERABLE_TYPES.join(' | ')}); ` +
341
+ 'copies nothing and edits nothing.');
342
+ withGlobalOptions(register
343
+ .command('android <dir>')
344
+ .description('Register an existing Android project directory in supersdk.json (no files are written).')
345
+ .option('--name <name>', 'Android app label (required; never derived from the project or the workspace name)')
346
+ .option('--package <package>', 'Java package / applicationId, e.g. com.acme.myapp (required)')).action(action('android'));
347
+ withGlobalOptions(register
348
+ .command('site <dir>')
349
+ .description('Register an existing site (web) project directory in supersdk.json (no files are written).')
350
+ .option('--slug <slug>', 'site slug, 1-32 lowercase letters/digits (required)')
351
+ .option('--name <name>', 'site name; omitted, nothing is recorded and it resolves to the slug')
352
+ .option('--env <env>', `project environment this site deploys to (default: ${projectIdentity_1.DEFAULT_SITE_ENV})`)
353
+ .option('--deploy-dir <dir>', `directory published by publish-site, relative to the workspace root (not to <dir>) and inside <dir> ` +
354
+ `(default: <dir>/${projectIdentity_1.SITE_DIST_DIRNAME})`)).action(action('site'));
355
+ // 🔴 ios 必须是一个**真实存在**的子命令,而不是靠 commander 的 "unknown command" 兜底:
356
+ // 「不支持」和「你打错了」是两件完全不同的事,后者的报错不会告诉任何人为什么。
357
+ withGlobalOptions(register
358
+ .command('ios [dir]')
359
+ .description('Not supported — the template iOS project is generated by XcodeGen; prints why.')).action(async (_dir, _opts, cmd) => {
360
+ new resultPrinter_1.ResultPrinter(outputModeOf(cmd)).failure('business_error', exports.IOS_UNSUPPORTED_MESSAGE);
361
+ });
362
+ }
363
+ //# sourceMappingURL=register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/commands/register.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,gDAEC;AAsID,kCAiLC;AAiCD,0DAuCC;AA7aD,4CAA8B;AAC9B,gDAAkC;AAClC,2DAAyE;AAEzE,sDAAyD;AACz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