@superdoc-dev/sdk 1.0.0-alpha.3 → 1.0.0-alpha.4

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 (53) hide show
  1. package/dist/generated/client.d.ts +1790 -0
  2. package/dist/generated/client.d.ts.map +1 -0
  3. package/dist/generated/client.js +66 -0
  4. package/dist/generated/contract.d.ts +13676 -0
  5. package/dist/generated/contract.d.ts.map +1 -0
  6. package/dist/generated/contract.js +17809 -0
  7. package/dist/index.d.ts +23 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +29 -0
  10. package/dist/runtime/embedded-cli.d.ts +5 -0
  11. package/dist/runtime/embedded-cli.d.ts.map +1 -0
  12. package/dist/runtime/embedded-cli.js +94 -0
  13. package/dist/runtime/errors.d.ts +17 -0
  14. package/dist/runtime/errors.d.ts.map +1 -0
  15. package/dist/runtime/errors.js +18 -0
  16. package/dist/runtime/host.d.ts +36 -0
  17. package/dist/runtime/host.d.ts.map +1 -0
  18. package/dist/runtime/host.js +345 -0
  19. package/dist/runtime/process.d.ts +16 -0
  20. package/dist/runtime/process.d.ts.map +1 -0
  21. package/dist/runtime/process.js +27 -0
  22. package/dist/runtime/transport-common.d.ts +44 -0
  23. package/dist/runtime/transport-common.d.ts.map +1 -0
  24. package/dist/runtime/transport-common.js +65 -0
  25. package/dist/skills.d.ts +25 -0
  26. package/dist/skills.d.ts.map +1 -0
  27. package/dist/skills.js +140 -0
  28. package/dist/tools.d.ts +113 -0
  29. package/dist/tools.d.ts.map +1 -0
  30. package/dist/tools.js +360 -0
  31. package/package.json +19 -10
  32. package/tools/catalog.json +17128 -0
  33. package/tools/tool-name-map.json +96 -0
  34. package/tools/tools-policy.json +100 -0
  35. package/tools/tools.anthropic.json +3275 -0
  36. package/tools/tools.generic.json +16573 -0
  37. package/tools/tools.openai.json +3557 -0
  38. package/tools/tools.vercel.json +3557 -0
  39. package/skills/editing-docx.md +0 -157
  40. package/src/__tests__/skills.test.ts +0 -166
  41. package/src/__tests__/tools.test.ts +0 -96
  42. package/src/generated/client.ts +0 -3643
  43. package/src/generated/contract.ts +0 -15952
  44. package/src/index.ts +0 -87
  45. package/src/runtime/__tests__/process.test.ts +0 -38
  46. package/src/runtime/__tests__/transport-common.test.ts +0 -174
  47. package/src/runtime/embedded-cli.ts +0 -109
  48. package/src/runtime/errors.ts +0 -30
  49. package/src/runtime/host.ts +0 -481
  50. package/src/runtime/process.ts +0 -45
  51. package/src/runtime/transport-common.ts +0 -169
  52. package/src/skills.ts +0 -195
  53. package/src/tools.ts +0 -701
@@ -0,0 +1,44 @@
1
+ export type ParamType = 'string' | 'number' | 'boolean' | 'json' | 'string[]';
2
+ export type ParamKind = 'doc' | 'flag' | 'jsonFlag';
3
+ export interface OperationParamSpec {
4
+ readonly name: string;
5
+ readonly kind: ParamKind;
6
+ readonly flag?: string;
7
+ readonly type: ParamType;
8
+ readonly required?: boolean;
9
+ }
10
+ export interface OperationSpec {
11
+ readonly operationId: string;
12
+ readonly commandTokens: readonly string[];
13
+ readonly params: readonly OperationParamSpec[];
14
+ }
15
+ export interface InvokeOptions {
16
+ timeoutMs?: number;
17
+ stdinBytes?: Uint8Array;
18
+ }
19
+ export type ChangeMode = 'direct' | 'tracked';
20
+ export interface SuperDocClientOptions {
21
+ env?: Record<string, string | undefined>;
22
+ startupTimeoutMs?: number;
23
+ shutdownTimeoutMs?: number;
24
+ requestTimeoutMs?: number;
25
+ watchdogTimeoutMs?: number;
26
+ maxQueueDepth?: number;
27
+ defaultChangeMode?: ChangeMode;
28
+ }
29
+ export interface CliInvocation {
30
+ command: string;
31
+ prefixArgs: string[];
32
+ }
33
+ export declare function resolveInvocation(cliBin: string): CliInvocation;
34
+ /**
35
+ * Build the CLI argument vector for an operation invocation.
36
+ *
37
+ * Key design choices vs old SDK:
38
+ * - changeMode injection BEFORE argv loop, not after. changeMode is already a
39
+ * param in operationSpec.params (envelope param for mutations). Appending after
40
+ * the loop would duplicate it.
41
+ * - Booleans encoded as `--flag true`/`--flag false` explicitly, matching current CLI.
42
+ */
43
+ export declare function buildOperationArgv(operation: OperationSpec, params: Record<string, unknown>, options: InvokeOptions, runtimeTimeoutMs: number | undefined, defaultChangeMode?: ChangeMode): string[];
44
+ //# sourceMappingURL=transport-common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport-common.d.ts","sourceRoot":"","sources":["../../src/runtime/transport-common.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,CAAC;AAC9E,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,CAAC;AAEpD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAC;CAChD;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE9C,MAAM,WAAW,qBAAqB;IACpC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,UAAU,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAMD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAU/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,aAAa,EACtB,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,iBAAiB,CAAC,EAAE,UAAU,GAC7B,MAAM,EAAE,CA8CV"}
@@ -0,0 +1,65 @@
1
+ function hasExtension(filePath, extension) {
2
+ return filePath.toLowerCase().endsWith(extension);
3
+ }
4
+ export function resolveInvocation(cliBin) {
5
+ if (hasExtension(cliBin, '.js')) {
6
+ return { command: 'node', prefixArgs: [cliBin] };
7
+ }
8
+ if (hasExtension(cliBin, '.ts')) {
9
+ return { command: 'bun', prefixArgs: [cliBin] };
10
+ }
11
+ return { command: cliBin, prefixArgs: [] };
12
+ }
13
+ /**
14
+ * Build the CLI argument vector for an operation invocation.
15
+ *
16
+ * Key design choices vs old SDK:
17
+ * - changeMode injection BEFORE argv loop, not after. changeMode is already a
18
+ * param in operationSpec.params (envelope param for mutations). Appending after
19
+ * the loop would duplicate it.
20
+ * - Booleans encoded as `--flag true`/`--flag false` explicitly, matching current CLI.
21
+ */
22
+ export function buildOperationArgv(operation, params, options, runtimeTimeoutMs, defaultChangeMode) {
23
+ // Inject defaultChangeMode into params BEFORE encoding — single source of truth.
24
+ const normalizedParams = defaultChangeMode != null &&
25
+ params.changeMode == null &&
26
+ operation.params.some((p) => p.name === 'changeMode')
27
+ ? { ...params, changeMode: defaultChangeMode }
28
+ : params;
29
+ const argv = [...operation.commandTokens];
30
+ for (const spec of operation.params) {
31
+ const value = normalizedParams[spec.name];
32
+ if (value == null)
33
+ continue;
34
+ const flag = `--${spec.flag ?? spec.name}`;
35
+ switch (spec.kind) {
36
+ case 'doc':
37
+ argv.push(String(value));
38
+ break;
39
+ case 'flag':
40
+ if (spec.type === 'boolean') {
41
+ // Explicit true/false — matches current CLI operation-executor.ts.
42
+ argv.push(flag, value === true ? 'true' : 'false');
43
+ }
44
+ else if (spec.type === 'string[]') {
45
+ if (Array.isArray(value)) {
46
+ for (const entry of value)
47
+ argv.push(flag, String(entry));
48
+ }
49
+ }
50
+ else {
51
+ argv.push(flag, String(value));
52
+ }
53
+ break;
54
+ case 'jsonFlag':
55
+ argv.push(flag, JSON.stringify(value));
56
+ break;
57
+ }
58
+ }
59
+ const timeoutMs = options.timeoutMs ?? runtimeTimeoutMs;
60
+ if (timeoutMs != null) {
61
+ argv.push('--timeout-ms', String(timeoutMs));
62
+ }
63
+ argv.push('--output', 'json');
64
+ return argv;
65
+ }
@@ -0,0 +1,25 @@
1
+ declare const SUPPORTED_SKILL_RUNTIMES: readonly ["claude"];
2
+ declare const SUPPORTED_INSTALL_SCOPES: readonly ["project", "user"];
3
+ type SkillRuntime = (typeof SUPPORTED_SKILL_RUNTIMES)[number];
4
+ type SkillInstallScope = (typeof SUPPORTED_INSTALL_SCOPES)[number];
5
+ export interface InstallSkillOptions {
6
+ runtime?: SkillRuntime;
7
+ scope?: SkillInstallScope;
8
+ targetDir?: string;
9
+ cwd?: string;
10
+ homeDir?: string;
11
+ overwrite?: boolean;
12
+ }
13
+ export interface InstalledSkillResult {
14
+ name: string;
15
+ runtime: SkillRuntime;
16
+ scope: SkillInstallScope | 'custom';
17
+ path: string;
18
+ written: boolean;
19
+ overwritten: boolean;
20
+ }
21
+ export declare function listSkills(): string[];
22
+ export declare function getSkill(name: string): string;
23
+ export declare function installSkill(name: string, options?: InstallSkillOptions): InstalledSkillResult;
24
+ export {};
25
+ //# sourceMappingURL=skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"AASA,QAAA,MAAM,wBAAwB,qBAAsB,CAAC;AACrD,QAAA,MAAM,wBAAwB,8BAA+B,CAAC;AAE9D,KAAK,YAAY,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC9D,KAAK,iBAAiB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnE,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,EAAE,iBAAiB,GAAG,QAAQ,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;CACtB;AAyBD,wBAAgB,UAAU,IAAI,MAAM,EAAE,CAerC;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA4B7C;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,oBAAoB,CAmElG"}
package/dist/skills.js ADDED
@@ -0,0 +1,140 @@
1
+ import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
2
+ import os from 'node:os';
3
+ import path from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ import { SuperDocCliError } from './runtime/errors.js';
6
+ // Resolve skills directory relative to package root (works from both src/ and dist/)
7
+ const skillsDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', 'skills');
8
+ const SKILL_NAME_RE = /^[A-Za-z0-9][A-Za-z0-9_-]*$/;
9
+ const SUPPORTED_SKILL_RUNTIMES = ['claude'];
10
+ const SUPPORTED_INSTALL_SCOPES = ['project', 'user'];
11
+ function resolveSkillFilePath(skillName) {
12
+ const filePath = path.resolve(skillsDir, `${skillName}.md`);
13
+ const root = `${skillsDir}${path.sep}`;
14
+ if (!filePath.startsWith(root)) {
15
+ throw new SuperDocCliError('Skill name resolved outside SDK skill directory.', {
16
+ code: 'INVALID_ARGUMENT',
17
+ details: { skillName },
18
+ });
19
+ }
20
+ return filePath;
21
+ }
22
+ function normalizeSkillName(name) {
23
+ const normalized = name.trim();
24
+ if (!normalized || !SKILL_NAME_RE.test(normalized)) {
25
+ throw new SuperDocCliError('Skill name is required.', {
26
+ code: 'INVALID_ARGUMENT',
27
+ details: { name },
28
+ });
29
+ }
30
+ return normalized;
31
+ }
32
+ export function listSkills() {
33
+ try {
34
+ return readdirSync(skillsDir)
35
+ .filter((entry) => path.extname(entry) === '.md')
36
+ .map((entry) => path.basename(entry, '.md'))
37
+ .sort();
38
+ }
39
+ catch (error) {
40
+ throw new SuperDocCliError('Unable to enumerate SDK skills.', {
41
+ code: 'SKILL_IO_ERROR',
42
+ details: {
43
+ skillsDir,
44
+ message: error instanceof Error ? error.message : String(error),
45
+ },
46
+ });
47
+ }
48
+ }
49
+ export function getSkill(name) {
50
+ const normalized = normalizeSkillName(name);
51
+ const filePath = resolveSkillFilePath(normalized);
52
+ try {
53
+ return readFileSync(filePath, 'utf8');
54
+ }
55
+ catch (error) {
56
+ const nodeError = error;
57
+ if (nodeError?.code === 'ENOENT') {
58
+ let available = [];
59
+ try {
60
+ available = listSkills();
61
+ }
62
+ catch {
63
+ // Keep available empty
64
+ }
65
+ throw new SuperDocCliError('Requested SDK skill was not found.', {
66
+ code: 'SKILL_NOT_FOUND',
67
+ details: { name: normalized, available },
68
+ });
69
+ }
70
+ throw new SuperDocCliError('Unable to read SDK skill file.', {
71
+ code: 'SKILL_IO_ERROR',
72
+ details: {
73
+ name: normalized,
74
+ message: error instanceof Error ? error.message : String(error),
75
+ },
76
+ });
77
+ }
78
+ }
79
+ export function installSkill(name, options = {}) {
80
+ const normalizedName = normalizeSkillName(name);
81
+ const runtime = options.runtime ?? 'claude';
82
+ if (!SUPPORTED_SKILL_RUNTIMES.includes(runtime)) {
83
+ throw new SuperDocCliError('Unsupported skill runtime.', {
84
+ code: 'INVALID_ARGUMENT',
85
+ details: { runtime, supportedRuntimes: [...SUPPORTED_SKILL_RUNTIMES] },
86
+ });
87
+ }
88
+ const scope = options.scope ?? 'project';
89
+ if (!SUPPORTED_INSTALL_SCOPES.includes(scope)) {
90
+ throw new SuperDocCliError('Unsupported skill install scope.', {
91
+ code: 'INVALID_ARGUMENT',
92
+ details: { scope, supportedScopes: [...SUPPORTED_INSTALL_SCOPES] },
93
+ });
94
+ }
95
+ const skillsRoot = options.targetDir !== undefined
96
+ ? path.resolve(options.targetDir)
97
+ : scope === 'user'
98
+ ? path.resolve(options.homeDir ?? os.homedir(), '.claude', 'skills')
99
+ : path.resolve(options.cwd ?? process.cwd(), '.claude', 'skills');
100
+ const skillFile = path.join(skillsRoot, normalizedName, 'SKILL.md');
101
+ const overwrite = options.overwrite ?? true;
102
+ const alreadyExists = existsSync(skillFile);
103
+ if (!overwrite && alreadyExists) {
104
+ return {
105
+ name: normalizedName,
106
+ runtime,
107
+ scope: options.targetDir !== undefined ? 'custom' : scope,
108
+ path: skillFile,
109
+ written: false,
110
+ overwritten: false,
111
+ };
112
+ }
113
+ try {
114
+ const content = getSkill(name);
115
+ mkdirSync(path.dirname(skillFile), { recursive: true });
116
+ writeFileSync(skillFile, content, 'utf8');
117
+ }
118
+ catch (error) {
119
+ if (error instanceof SuperDocCliError)
120
+ throw error;
121
+ throw new SuperDocCliError('Unable to install SDK skill.', {
122
+ code: 'SKILL_IO_ERROR',
123
+ details: {
124
+ name: normalizedName,
125
+ runtime,
126
+ scope: options.targetDir !== undefined ? 'custom' : scope,
127
+ path: skillFile,
128
+ message: error instanceof Error ? error.message : String(error),
129
+ },
130
+ });
131
+ }
132
+ return {
133
+ name: normalizedName,
134
+ runtime,
135
+ scope: options.targetDir !== undefined ? 'custom' : scope,
136
+ path: skillFile,
137
+ written: true,
138
+ overwritten: alreadyExists,
139
+ };
140
+ }
@@ -0,0 +1,113 @@
1
+ import type { InvokeOptions } from './runtime/process.js';
2
+ export type ToolProvider = 'openai' | 'anthropic' | 'vercel' | 'generic';
3
+ export type ToolProfile = 'intent' | 'operation';
4
+ export type ToolPhase = 'read' | 'locate' | 'mutate' | 'review';
5
+ export type DocumentFeatures = {
6
+ hasTables: boolean;
7
+ hasLists: boolean;
8
+ hasComments: boolean;
9
+ hasTrackedChanges: boolean;
10
+ isEmptyDocument: boolean;
11
+ };
12
+ export type ToolChooserInput = {
13
+ provider: ToolProvider;
14
+ profile?: ToolProfile;
15
+ documentFeatures?: Partial<DocumentFeatures>;
16
+ taskContext?: {
17
+ phase?: ToolPhase;
18
+ previousToolCalls?: Array<{
19
+ toolName: string;
20
+ ok: boolean;
21
+ }>;
22
+ };
23
+ budget?: {
24
+ maxTools?: number;
25
+ minReadTools?: number;
26
+ };
27
+ policy?: {
28
+ includeCategories?: string[];
29
+ excludeCategories?: string[];
30
+ allowMutatingTools?: boolean;
31
+ forceInclude?: string[];
32
+ forceExclude?: string[];
33
+ };
34
+ };
35
+ export type ToolCatalog = {
36
+ contractVersion: string;
37
+ generatedAt: string | null;
38
+ namePolicyVersion: string;
39
+ exposureVersion: string;
40
+ toolCount: number;
41
+ profiles: {
42
+ intent: {
43
+ name: 'intent';
44
+ tools: ToolCatalogEntry[];
45
+ };
46
+ operation: {
47
+ name: 'operation';
48
+ tools: ToolCatalogEntry[];
49
+ };
50
+ };
51
+ };
52
+ type ToolCatalogEntry = {
53
+ operationId: string;
54
+ toolName: string;
55
+ profile: ToolProfile;
56
+ source: 'operation' | 'intent';
57
+ description: string;
58
+ inputSchema: Record<string, unknown>;
59
+ outputSchema: Record<string, unknown>;
60
+ mutates: boolean;
61
+ category: string;
62
+ capabilities: string[];
63
+ constraints?: Record<string, unknown>;
64
+ errors: string[];
65
+ examples: Array<{
66
+ description: string;
67
+ args: Record<string, unknown>;
68
+ }>;
69
+ commandTokens: string[];
70
+ profileTags: string[];
71
+ requiredCapabilities: Array<keyof DocumentFeatures>;
72
+ sessionRequirements: {
73
+ requiresOpenContext: boolean;
74
+ supportsSessionTargeting: boolean;
75
+ };
76
+ intentId?: string;
77
+ };
78
+ export declare function getToolCatalog(options?: {
79
+ profile?: ToolProfile;
80
+ }): Promise<ToolCatalog>;
81
+ export declare function listTools(provider: ToolProvider, options?: {
82
+ profile?: ToolProfile;
83
+ }): Promise<unknown[]>;
84
+ export declare function resolveToolOperation(toolName: string): Promise<string | null>;
85
+ export declare function inferDocumentFeatures(infoResult: Record<string, unknown> | null | undefined): DocumentFeatures;
86
+ export declare function chooseTools(input: ToolChooserInput): Promise<{
87
+ tools: unknown[];
88
+ selected: Array<{
89
+ operationId: string;
90
+ toolName: string;
91
+ category: string;
92
+ mutates: boolean;
93
+ profile: ToolProfile;
94
+ }>;
95
+ excluded: Array<{
96
+ toolName: string;
97
+ reason: string;
98
+ }>;
99
+ selectionMeta: {
100
+ profile: ToolProfile;
101
+ phase: ToolPhase;
102
+ maxTools: number;
103
+ minReadTools: number;
104
+ selectedCount: number;
105
+ decisionVersion: string;
106
+ provider: ToolProvider;
107
+ };
108
+ }>;
109
+ export declare function dispatchSuperDocTool(client: {
110
+ doc: Record<string, unknown>;
111
+ }, toolName: string, args?: Record<string, unknown>, invokeOptions?: InvokeOptions): Promise<unknown>;
112
+ export {};
113
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools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