@r_masseater/oxlint-plugin-decision 0.8.0 → 0.8.2

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 (43) hide show
  1. package/README.md +5 -0
  2. package/dist/{app-UakaWKAT.mjs → app-D2bguKZ_.mjs} +137 -27
  3. package/dist/app-D2bguKZ_.mjs.map +1 -0
  4. package/dist/claim-rule-B0LCcxxc.mjs +36 -0
  5. package/dist/claim-rule-B0LCcxxc.mjs.map +1 -0
  6. package/dist/cloudflare-worker.mjs +111 -2
  7. package/dist/cloudflare-worker.mjs.map +1 -1
  8. package/dist/{index-HOwrGbIA.d.mts → index-B4wX62VC.d.mts} +2 -2
  9. package/dist/{index-C0Twu0w7.d.mts → index-CK88FBE5.d.mts} +666 -319
  10. package/dist/index.d.mts +1 -1
  11. package/dist/index.mjs +1 -1
  12. package/dist/{define-presets-yflVt8vT.mjs → preset-plugin-MKdvpXxa.mjs} +11 -214
  13. package/dist/preset-plugin-MKdvpXxa.mjs.map +1 -0
  14. package/dist/presets/ai-slop.d.mts +2 -2
  15. package/dist/presets/ai-slop.mjs +179 -2
  16. package/dist/presets/ai-slop.mjs.map +1 -1
  17. package/dist/presets/index.d.mts +1 -1
  18. package/dist/presets/index.mjs +1 -1
  19. package/dist/presets/recommended.d.mts +1 -1
  20. package/dist/presets/recommended.mjs +1 -2
  21. package/dist/presets/recommended.mjs.map +1 -1
  22. package/dist/presets/review-only.d.mts +1 -1
  23. package/dist/presets/review-only.mjs +1 -2
  24. package/dist/presets/review-only.mjs.map +1 -1
  25. package/dist/presets/strict.d.mts +1 -1
  26. package/dist/presets/strict.mjs +1 -2
  27. package/dist/presets/strict.mjs.map +1 -1
  28. package/dist/serve-decisions-D6M-l2uy.mjs +232 -0
  29. package/dist/serve-decisions-D6M-l2uy.mjs.map +1 -0
  30. package/dist/typesafe-worker.mjs +20 -2
  31. package/dist/typesafe-worker.mjs.map +1 -1
  32. package/dist/{decision-B7hahWHz.mjs → wire-CKpt_MBX.mjs} +11 -134
  33. package/dist/wire-CKpt_MBX.mjs.map +1 -0
  34. package/package.json +23 -21
  35. package/skills/write-decision-rules/SKILL.md +0 -1
  36. package/skills/write-decision-rules/references/tuning.md +2 -2
  37. package/dist/app-UakaWKAT.mjs.map +0 -1
  38. package/dist/decision-B7hahWHz.mjs.map +0 -1
  39. package/dist/define-presets-yflVt8vT.mjs.map +0 -1
  40. package/dist/preset-plugin-ClpEFUN5.mjs +0 -10
  41. package/dist/preset-plugin-ClpEFUN5.mjs.map +0 -1
  42. package/dist/serve-decisions-DYGwLMft.mjs +0 -287
  43. package/dist/serve-decisions-DYGwLMft.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"serve-decisions-DYGwLMft.mjs","names":["Str","Arr","Arr","TRAILING_SLASHES","Str","Str","Fn","fileSystem","path","Arr"],"sources":["../src/features/serve-decisions/model/app-context.ts","../src/features/serve-decisions/model/system-one.ts","../src/features/serve-decisions/model/workers-ai.ts","../src/features/serve-decisions/model/typesafe.ts","../src/features/serve-decisions/model/cache.ts","../src/features/serve-decisions/model/services.ts","../src/features/serve-decisions/model/serve-decisions.ts"],"sourcesContent":["import {\n Array as Arr,\n Config,\n Effect,\n FileSystem,\n Option,\n Path,\n String as Str,\n pipe,\n} from \"effect\";\nimport type { PlatformError } from \"effect/PlatformError\";\n\nimport { captured } from \"#/entities/decision/index.ts\";\n\nconst SELF = \"masseater/masseater.dev\";\nconst GIT_SUFFIX = /\\.git\\/?$/u;\nconst SEPARATORS = /[/:]/u;\nconst SLUG_PARTS = 2;\nconst GITDIR = /^gitdir:\\s*(?<dir>.+)$/mu;\nconst ORIGIN_URL = /\\[remote \"origin\"\\][^[]*?\\burl\\s*=\\s*(?<url>\\S+)/u;\n\nconst isSet = (name: string): Effect.Effect<boolean> =>\n Config.option(Config.NonEmptyString(name)).pipe(\n Effect.map(Option.isSome),\n Effect.orElseSucceed(() => false),\n );\n\nconst contextOf = Effect.gen(function* contextOf() {\n if (yield* isSet(\"GITHUB_ACTIONS\")) {\n return \"github-actions\";\n }\n if (yield* isSet(\"CLAUDE_CODE_REMOTE\")) {\n return \"claude-code-cloud\";\n }\n if (yield* isSet(\"CLAUDECODE\")) {\n return \"claude-code\";\n }\n return \"local\";\n});\n\nconst slugOf = (url: string): Option.Option<string> => {\n const parts = pipe(\n url,\n Str.trim,\n Str.replace(GIT_SUFFIX, \"\"),\n Str.split(SEPARATORS),\n Arr.filter((part) => Str.isNonEmpty(part)),\n );\n if (parts.length < SLUG_PARTS) {\n return Option.none();\n }\n return Option.some(pipe(Arr.takeRight(parts, SLUG_PARTS), Arr.join(\"/\")));\n};\n\nconst linkedGitDir = Effect.fn(\"linkedGitDir\")(function* linkedGitDir(dir: string, dotGit: string) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const text = yield* fs.readFileString(dotGit);\n return captured(Str.match(GITDIR)(text), \"dir\").pipe(\n Option.map((found) => path.resolve(dir, Str.trim(found))),\n );\n});\n\n/** @internal */\nexport type AppServices = FileSystem.FileSystem | Path.Path;\n\nconst gitDirAt = Effect.fn(\"gitDirAt\")(function* gitDirAt(dir: string) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const dotGit = path.join(dir, \".git\");\n const info = yield* fs.stat(dotGit).pipe(Effect.option);\n if (Option.isNone(info)) {\n return Option.none<string>();\n }\n if (info.value.type === \"Directory\") {\n return Option.some(dotGit);\n }\n return yield* linkedGitDir(dir, dotGit);\n});\n\nconst gitDirFrom = (\n dir: string,\n): Effect.Effect<Option.Option<string>, PlatformError, AppServices> =>\n Effect.gen(function* walk() {\n const path = yield* Path.Path;\n const here = yield* gitDirAt(dir);\n const parent = path.dirname(dir);\n if (Option.isSome(here) || parent === dir) {\n return here;\n }\n return yield* gitDirFrom(parent);\n });\n\nconst commonDirOf = Effect.fn(\"commonDirOf\")(function* commonDirOf(gitDir: string) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const common = yield* fs.readFileString(path.join(gitDir, \"commondir\")).pipe(Effect.option);\n return Option.match(common, {\n onNone: () => gitDir,\n onSome: (relative) => path.resolve(gitDir, Str.trim(relative)),\n });\n});\n\nconst remoteSlug = Effect.gen(function* remoteSlug() {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const gitDir = yield* gitDirFrom(path.resolve(\".\"));\n if (Option.isNone(gitDir)) {\n return Option.none<string>();\n }\n const commonDir = yield* commonDirOf(gitDir.value);\n const config = yield* fs.readFileString(path.join(commonDir, \"config\"));\n return captured(Str.match(ORIGIN_URL)(config), \"url\").pipe(Option.flatMap(slugOf));\n}).pipe(Effect.orElseSucceed(() => Option.none<string>()));\n\nconst repoOf = Effect.gen(function* repoOf() {\n const fromActions = yield* Config.option(Config.NonEmptyString(\"GITHUB_REPOSITORY\")).pipe(\n Effect.orElseSucceed(() => Option.none<string>()),\n );\n if (Option.isSome(fromActions)) {\n return fromActions;\n }\n return yield* remoteSlug;\n});\n\n/** @internal */\nexport interface AppContext {\n readonly repo: string;\n readonly context: string;\n}\n\n/** @internal */\nexport const appContext: Effect.Effect<AppContext, never, AppServices> = Effect.gen(\n function* app() {\n const context = yield* contextOf;\n const repo = yield* repoOf;\n return { repo: Option.getOrElse(repo, () => SELF), context };\n },\n);\n","import { Array as Arr, Effect, Option, Schedule, Schema, pipe } from \"effect\";\nimport type { Redacted } from \"effect\";\nimport { HttpClient, HttpClientRequest, HttpClientResponse } from \"effect/http\";\n\nimport { AnswerSchema } from \"#/entities/decision/index.ts\";\nimport type { DecisionResponse, WireRequest } from \"#/entities/decision/index.ts\";\n\nconst FIRST_REDIRECT = 300;\nconst RETRY_INITIAL_MS = 10;\nconst RETRY_EXPONENT = 2;\n\nconst Decisions = Schema.Struct({\n model: Schema.String,\n answers: Schema.Record(Schema.String, AnswerSchema),\n});\n\nconst Envelope = Schema.Struct({ result: Decisions });\n\nconst ErrorMessage = Schema.Struct({ message: Schema.String });\n\nconst ErrorBody = Schema.Union([\n Schema.Struct({ errors: Schema.NonEmptyArray(ErrorMessage) }),\n Schema.Struct({ detail: ErrorMessage }),\n]);\n\nconst decodeErrorBody = Schema.decodeUnknownOption(ErrorBody);\n\nconst messageOfBody = (body: unknown): string =>\n Option.match(decodeErrorBody(body), {\n onNone: () => \"request failed\",\n onSome: (decoded) => {\n if (\"detail\" in decoded) {\n return decoded.detail.message;\n }\n return pipe(\n decoded.errors,\n Arr.map(({ message }) => message),\n Arr.join(\"; \"),\n );\n },\n });\n\nconst failureOf = (response: HttpClientResponse.HttpClientResponse): Effect.Effect<never, string> =>\n response.json.pipe(\n Effect.option,\n Effect.flatMap((body) =>\n Effect.fail(`http ${String(response.status)}: ${messageOfBody(Option.getOrUndefined(body))}`),\n ),\n );\n\n/** @internal */\nexport interface SystemOneCall {\n readonly url: string;\n readonly model: string;\n readonly token: Redacted.Redacted;\n readonly headers: Readonly<Record<string, string>>;\n readonly envelope: boolean;\n}\n\nconst decodeEnvelope = HttpClientResponse.schemaBodyJson(Envelope);\n\nconst decodeDecisions = HttpClientResponse.schemaBodyJson(Decisions);\n\nconst invalid = ({ message }: Readonly<{ message: string }>): string =>\n `invalid response: ${message}`;\n\nconst decisionsOf = (\n response: HttpClientResponse.HttpClientResponse,\n envelope: boolean,\n): Effect.Effect<typeof Decisions.Type, string> => {\n if (envelope) {\n return decodeEnvelope(response).pipe(\n Effect.mapBoth({ onSuccess: ({ result }) => result, onFailure: invalid }),\n );\n }\n return decodeDecisions(response).pipe(Effect.mapError(invalid));\n};\n\n/** @internal */\nexport const sendSystemOne = Effect.fn(\"sendSystemOne\")(function* sendSystemOne(\n call: SystemOneCall,\n wire: WireRequest,\n) {\n const client = (yield* HttpClient.HttpClient).pipe(\n HttpClient.retryTransient({\n retryOn: \"response-only\",\n schedule: Schedule.exponential(RETRY_INITIAL_MS, RETRY_EXPONENT),\n }),\n );\n const response = yield* HttpClientRequest.post(call.url).pipe(\n HttpClientRequest.bearerToken(call.token),\n HttpClientRequest.setHeaders(call.headers),\n HttpClientRequest.bodyJsonUnsafe({\n model: call.model,\n state: wire.state,\n questions: wire.questions,\n }),\n client.execute,\n Effect.mapError(({ message }) => `network: ${message}`),\n );\n if (response.status >= FIRST_REDIRECT) {\n return yield* failureOf(response);\n }\n const decisions = yield* decisionsOf(response, call.envelope);\n return { model: decisions.model, answers: decisions.answers } satisfies DecisionResponse;\n});\n","import { Config, Effect, Option, String as Str } from \"effect\";\n\nimport { PREFIX, captured, envNameOf, toJson } from \"#/entities/decision/index.ts\";\nimport type { DecideInput, WireRequest } from \"#/entities/decision/index.ts\";\n\nimport { appContext } from \"./app-context.ts\";\nimport { sendSystemOne } from \"./system-one.ts\";\n\nconst DEFAULT_GATEWAY = \"default\";\nconst DEFAULT_API_URL = \"https://api.cloudflare.com/client/v4\";\nconst RUN_PATH = \"/ai/run\";\nconst TRAILING_SLASHES = /\\/+$/u;\nconst MODEL_NAME = /(?<name>[^/]+)$/u;\n\nconst accountUrl = ({ api, account }: Readonly<{ api: string; account: string }>): string =>\n `${Str.replace(TRAILING_SLASHES, \"\")(Str.trim(api))}/accounts/${Str.trim(account)}`;\n\n/** @internal */\nexport const endpointOf = (env: DecideInput[\"env\"]): Config.Config<string> =>\n Config.all({\n api: Config.String(envNameOf(env, \"CLOUDFLARE_API_BASE_URL\")).pipe(\n Config.withDefault(DEFAULT_API_URL),\n ),\n account: Config.NonEmptyString(envNameOf(env, \"CLOUDFLARE_ACCOUNT_ID\")),\n }).pipe(Config.map(accountUrl));\n\nconst modelNameOf = (model: string): string =>\n Option.getOrElse(captured(Str.match(MODEL_NAME)(model), \"name\"), () => model);\n\n/** @internal */\nexport const sendWorkersAi = Effect.fn(\"sendWorkersAi\")(function* sendWorkersAi(\n endpoint: string,\n wire: WireRequest,\n { env }: Pick<DecideInput, \"env\">,\n) {\n const token = yield* Config.Redacted(envNameOf(env, \"CLOUDFLARE_API_TOKEN\"));\n const gateway = yield* Config.NonEmptyString(envNameOf(env, \"CLOUDFLARE_AI_GATEWAY_ID\")).pipe(\n Config.withDefault(DEFAULT_GATEWAY),\n );\n const app = yield* appContext;\n const decided = yield* sendSystemOne(\n {\n url: `${endpoint}${RUN_PATH}/${wire.model}`,\n model: modelNameOf(wire.model),\n token,\n headers: {\n \"cf-aig-gateway-id\": gateway,\n \"cf-aig-metadata\": toJson({ tool: PREFIX, ...app }),\n },\n envelope: true,\n },\n wire,\n );\n return { model: wire.model, answers: decided.answers };\n});\n","import { Config, Effect, String as Str } from \"effect\";\n\nimport { envNameOf } from \"#/entities/decision/index.ts\";\nimport type { DecideInput, WireRequest } from \"#/entities/decision/index.ts\";\n\nimport { sendSystemOne } from \"./system-one.ts\";\n\nconst DEFAULT_BASE_URL = \"https://api.typesafe.ai\";\nconst SYSTEM_ONE_PATH = \"/v1/systemone\";\nconst TRAILING_SLASHES = /\\/+$/u;\n\n/** @internal */\nexport const typesafeEndpointOf = (env: DecideInput[\"env\"]): Config.Config<string> =>\n Config.String(envNameOf(env, \"TYPESAFE_BASE_URL\")).pipe(\n Config.withDefault(DEFAULT_BASE_URL),\n Config.map((url) => Str.replace(TRAILING_SLASHES, \"\")(Str.trim(url))),\n );\n\n/** @internal */\nexport const sendTypesafe = Effect.fn(\"sendTypesafe\")(function* sendTypesafe(\n endpoint: string,\n wire: WireRequest,\n { env }: Pick<DecideInput, \"env\">,\n) {\n const token = yield* Config.Redacted(envNameOf(env, \"TYPESAFE_API_KEY\"));\n return yield* sendSystemOne(\n {\n url: `${endpoint}${SYSTEM_ONE_PATH}`,\n model: wire.model,\n token,\n headers: {},\n envelope: false,\n },\n wire,\n );\n});\n","import { Clock, Effect, FileSystem, Option, Path, Schema, Function as Fn } from \"effect\";\nimport { Digest } from \"effect/crypto\";\n\nimport { AnswerSchema, PREFIX, parseVerdicts } from \"#/entities/decision/index.ts\";\nimport type { DecisionRequest, DecisionResponse } from \"#/entities/decision/index.ts\";\n\nconst DATA_FIRST_ARITY = 2;\n\nconst CACHE_VERSION = 7;\n/** @internal */\nexport const CACHE_DIR = `node_modules/.cache/${PREFIX}`;\n\nconst encodeJson = (value: unknown): Effect.Effect<string> =>\n Schema.encodeUnknownEffect(Schema.fromJsonString(Schema.Unknown))(value).pipe(Effect.orDie);\n\n/** @internal */\nexport const cacheFile = Effect.fn(\"cacheFile\")(function* cacheFile(\n endpoint: string,\n request: DecisionRequest,\n) {\n const digest = yield* Digest.Digest;\n const path = yield* Path.Path;\n const json = yield* encodeJson({ version: CACHE_VERSION, endpoint, request });\n const payload = new TextEncoder().encode(json);\n const hash = yield* digest.digestHex(Digest.sha256, payload);\n return path.resolve(CACHE_DIR, `${hash}.json`);\n});\n\nconst CachedResponse = Schema.Struct({\n model: Schema.NonEmptyString,\n answers: Schema.Record(Schema.String, AnswerSchema),\n});\n\nconst decodeCached = Schema.decodeOption(Schema.fromJsonString(CachedResponse));\n\n/** @internal */\nexport const isComplete: {\n (request: DecisionRequest): (response: DecisionResponse) => boolean;\n (response: DecisionResponse, request: DecisionRequest): boolean;\n} = Fn.dual(DATA_FIRST_ARITY, (response: DecisionResponse, request: DecisionRequest): boolean =>\n Option.liftThrowable(() => parseVerdicts(response, request).complete)().pipe(\n Option.getOrElse(() => false),\n ),\n);\n\n/** @internal */\nexport const readCache = Effect.fn(\"readCache\")(function* readCache(\n file: string,\n request: DecisionRequest,\n) {\n const fs = yield* FileSystem.FileSystem;\n const text = yield* fs.readFileString(file).pipe(Effect.option);\n return text.pipe(\n Option.flatMap((raw): Option.Option<DecisionResponse> => decodeCached(raw)),\n Option.filter((response) => isComplete(response, request)),\n );\n});\n\n/** @internal */\nexport const writeCache = Effect.fn(\"writeCache\")(function* writeCache(\n file: string,\n response: DecisionResponse,\n) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const now = yield* Clock.currentTimeMillis;\n const temp = `${file}.tmp-${String(now)}`;\n const json = yield* encodeJson(response);\n yield* fs.makeDirectory(path.dirname(file), { recursive: true });\n yield* fs.writeFileString(temp, json);\n yield* fs.rename(temp, file);\n});\n\n/** @internal */\nexport type CacheServices = Digest.Digest | FileSystem.FileSystem | Path.Path;\n","import { layerDigest } from \"@effect/platform-node-shared/NodeCrypto\";\nimport { layer as fileSystem } from \"@effect/platform-node-shared/NodeFileSystem\";\nimport { layer as path } from \"@effect/platform-node-shared/NodePath\";\nimport { Layer } from \"effect\";\nimport { FetchHttpClient } from \"effect/http\";\nimport { OtlpSerialization, OtlpTracer } from \"effect/observability\";\n\nconst tracing = OtlpTracer.layerFromConfig({\n resource: { serviceName: \"oxlint-plugin-decision\" },\n}).pipe(Layer.provide(OtlpSerialization.layerJson), Layer.provide(FetchHttpClient.layer));\n\n/** @internal */\nexport const workerServices: [\n typeof fileSystem,\n typeof path,\n typeof layerDigest,\n typeof FetchHttpClient.layer,\n typeof tracing,\n] = [fileSystem, path, layerDigest, FetchHttpClient.layer, tracing];\n","import { Array as Arr, Effect, Option, pipe } from \"effect\";\nimport type { Config } from \"effect\";\nimport type { HttpClient } from \"effect/http\";\nimport { runAsWorker } from \"synckit\";\n\nimport { mergeResponses, messageOf } from \"#/entities/decision/index.ts\";\nimport type {\n DecideInput,\n DecideResult,\n DecisionRequest,\n DecisionResponse,\n WireRequest,\n} from \"#/entities/decision/index.ts\";\n\nimport type { AppServices } from \"./app-context.ts\";\nimport { cacheFile, isComplete, readCache, writeCache } from \"./cache.ts\";\nimport type { CacheServices } from \"./cache.ts\";\nimport { workerServices } from \"./services.ts\";\n\n/** @internal */\nexport type Services = AppServices | CacheServices | HttpClient.HttpClient;\n\ntype Inputs = Arr.NonEmptyReadonlyArray<DecideInput>;\n\n/** @internal */\nexport interface Transport {\n readonly endpoint: (env: DecideInput[\"env\"]) => Config.Config<string>;\n readonly wires: (request: DecisionRequest) => Arr.NonEmptyReadonlyArray<WireRequest>;\n readonly send: (\n endpoint: string,\n wire: WireRequest,\n input: Pick<DecideInput, \"env\">,\n ) => Effect.Effect<DecisionResponse, Config.ConfigError | string, Services>;\n}\n\nconst ask = Effect.fn(\"ask\")(function* ask(\n transport: Transport,\n endpoint: string,\n { request, timeoutMs, env }: DecideInput,\n) {\n const responses = yield* Effect.forEach(\n transport.wires(request),\n (wire) => transport.send(endpoint, wire, { env }),\n { concurrency: \"unbounded\" },\n ).pipe(\n Effect.timeoutOrElse({\n duration: timeoutMs,\n orElse: () => Effect.fail(\"timeout\"),\n }),\n );\n return mergeResponses(responses);\n});\n\nconst askAndStore = Effect.fn(\"askAndStore\")(function* askAndStore(\n transport: Transport,\n { endpoint, file }: Readonly<{ endpoint: string; file: string }>,\n input: DecideInput,\n) {\n const response = yield* ask(transport, endpoint, input);\n if (isComplete(response, input.request)) {\n yield* writeCache(file, response).pipe(Effect.ignore);\n }\n return response;\n});\n\nconst decide = Effect.fn(\"decide\")(function* decide(transport: Transport, input: DecideInput) {\n yield* Effect.annotateCurrentSpan({ model: input.request.model });\n const endpoint = yield* transport.endpoint(input.env);\n const file = yield* cacheFile(endpoint, input.request);\n const cached = yield* readCache(file, input.request);\n yield* Effect.annotateCurrentSpan({ cached: Option.isSome(cached) });\n if (Option.isSome(cached)) {\n return { response: cached.value, cached: true };\n }\n return { response: yield* askAndStore(transport, { endpoint, file }, input), cached: false };\n});\n\nconst reasonOf = (error: unknown): string => {\n if (typeof error === \"string\") {\n return error;\n }\n return messageOf(error);\n};\n\nconst decideOne = (\n transport: Transport,\n input: DecideInput,\n): Effect.Effect<DecideResult, never, Services> =>\n decide(transport, input).pipe(\n Effect.match({\n onSuccess: ({ response, cached }): DecideResult => ({ ok: true, response, cached }),\n onFailure: (error): DecideResult => ({ ok: false, reason: reasonOf(error) }),\n }),\n );\n\nconst decideEach = (\n transport: Transport,\n inputs: Inputs,\n): Effect.Effect<Arr.NonEmptyReadonlyArray<DecideResult>> =>\n Effect.all(\n pipe(\n inputs,\n Arr.map((input) => decideOne(transport, input)),\n ),\n { concurrency: \"unbounded\" },\n ).pipe(Effect.provide(workerServices));\n\n/** @internal */\nexport const serveDecisions = (transport: Transport): void => {\n run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