@r_masseater/oxlint-plugin-decision 0.0.3 → 0.0.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.
|
@@ -1,11 +1,95 @@
|
|
|
1
1
|
import { M as AnswerSchema, _ as messageOf, l as parseVerdicts, m as envNameOf, n as wireRequestsFor, t as mergeResponses } from "./wire-BGb5iQa9.mjs";
|
|
2
|
-
import { Array, Config, Crypto, Effect, FileSystem, Layer, Option, Path, Redacted, Schema, pipe } from "effect";
|
|
2
|
+
import { Array, Config, Crypto, Effect, FileSystem, Layer, Option, Path, Redacted, Schema, String as String$1, pipe } from "effect";
|
|
3
3
|
import { runAsWorker } from "synckit";
|
|
4
|
-
import { OpenRouter } from "@openrouter/sdk";
|
|
5
4
|
import { OpenRouterError } from "@openrouter/sdk/models/errors";
|
|
5
|
+
import { OpenRouter } from "@openrouter/sdk";
|
|
6
|
+
import { HTTPClient } from "@openrouter/sdk/lib/http.js";
|
|
6
7
|
import { NodeServices } from "@effect/platform-node";
|
|
7
8
|
import { FetchHttpClient } from "effect/http";
|
|
8
9
|
import { OtlpSerialization, OtlpTracer } from "effect/observability";
|
|
10
|
+
//#region src/client.ts
|
|
11
|
+
const TOOL = "oxlint-plugin-decision";
|
|
12
|
+
const GITHUB = "https://github.com";
|
|
13
|
+
const SELF = "masseater/oxlint-plugin-decision";
|
|
14
|
+
const GIT_SUFFIX = /\.git\/?$/u;
|
|
15
|
+
const SEPARATORS = /[/:]/u;
|
|
16
|
+
const SLUG_PARTS = 2;
|
|
17
|
+
const GITDIR = /^gitdir:\s*(?<dir>.+)$/mu;
|
|
18
|
+
const ORIGIN_URL = /\[remote "origin"\][^[]*?\burl\s*=\s*(?<url>\S+)/u;
|
|
19
|
+
const hiddenApp = () => new HTTPClient().addHook("beforeRequest", (request) => {
|
|
20
|
+
request.headers.set("X-OpenRouter-App-Visibility", "hidden");
|
|
21
|
+
});
|
|
22
|
+
const isSet = (name) => Config.option(Config.NonEmptyString(name)).pipe(Effect.map(Option.isSome), Effect.orElseSucceed(() => false));
|
|
23
|
+
const contextOf = Effect.gen(function* contextOf() {
|
|
24
|
+
if (yield* isSet("GITHUB_ACTIONS")) return "github-actions";
|
|
25
|
+
if (yield* isSet("CLAUDE_CODE_REMOTE")) return "claude-code-cloud";
|
|
26
|
+
if (yield* isSet("CLAUDECODE")) return "claude-code";
|
|
27
|
+
return "local";
|
|
28
|
+
});
|
|
29
|
+
const slugOf = (url) => {
|
|
30
|
+
const parts = url.trim().replace(GIT_SUFFIX, "").split(SEPARATORS).filter((part) => String$1.isNonEmpty(part));
|
|
31
|
+
if (parts.length < SLUG_PARTS) return Option.none();
|
|
32
|
+
return Option.some(Array.takeRight(parts, SLUG_PARTS).join("/"));
|
|
33
|
+
};
|
|
34
|
+
const captured = (match, name) => match.pipe(Option.flatMap((found) => Option.fromNullishOr(found.groups)), Option.flatMap((groups) => Option.fromNullishOr(groups[name])));
|
|
35
|
+
const linkedGitDir = Effect.fn("linkedGitDir")(function* linkedGitDir(dir, dotGit) {
|
|
36
|
+
const fs = yield* FileSystem.FileSystem;
|
|
37
|
+
const path = yield* Path.Path;
|
|
38
|
+
const text = yield* fs.readFileString(dotGit);
|
|
39
|
+
return captured(String$1.match(GITDIR)(text), "dir").pipe(Option.map((found) => path.resolve(dir, found.trim())));
|
|
40
|
+
});
|
|
41
|
+
const gitDirAt = Effect.fn("gitDirAt")(function* gitDirAt(dir) {
|
|
42
|
+
const fs = yield* FileSystem.FileSystem;
|
|
43
|
+
const dotGit = (yield* Path.Path).join(dir, ".git");
|
|
44
|
+
const info = yield* fs.stat(dotGit).pipe(Effect.option);
|
|
45
|
+
if (Option.isNone(info)) return Option.none();
|
|
46
|
+
if (info.value.type === "Directory") return Option.some(dotGit);
|
|
47
|
+
return yield* linkedGitDir(dir, dotGit);
|
|
48
|
+
});
|
|
49
|
+
const gitDirFrom = (dir) => Effect.gen(function* walk() {
|
|
50
|
+
const path = yield* Path.Path;
|
|
51
|
+
const here = yield* gitDirAt(dir);
|
|
52
|
+
const parent = path.dirname(dir);
|
|
53
|
+
if (Option.isSome(here) || parent === dir) return here;
|
|
54
|
+
return yield* gitDirFrom(parent);
|
|
55
|
+
});
|
|
56
|
+
const commonDirOf = Effect.fn("commonDirOf")(function* commonDirOf(gitDir) {
|
|
57
|
+
const fs = yield* FileSystem.FileSystem;
|
|
58
|
+
const path = yield* Path.Path;
|
|
59
|
+
const common = yield* fs.readFileString(path.join(gitDir, "commondir")).pipe(Effect.option);
|
|
60
|
+
return Option.match(common, {
|
|
61
|
+
onNone: () => gitDir,
|
|
62
|
+
onSome: (relative) => path.resolve(gitDir, relative.trim())
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
const remoteSlug = Effect.gen(function* remoteSlug() {
|
|
66
|
+
const fs = yield* FileSystem.FileSystem;
|
|
67
|
+
const path = yield* Path.Path;
|
|
68
|
+
const gitDir = yield* gitDirFrom(path.resolve("."));
|
|
69
|
+
if (Option.isNone(gitDir)) return Option.none();
|
|
70
|
+
const config = yield* fs.readFileString(path.join(yield* commonDirOf(gitDir.value), "config"));
|
|
71
|
+
return captured(String$1.match(ORIGIN_URL)(config), "url").pipe(Option.flatMap(slugOf));
|
|
72
|
+
}).pipe(Effect.orElseSucceed(() => Option.none()));
|
|
73
|
+
const repoOf = Effect.gen(function* repoOf() {
|
|
74
|
+
const fromActions = yield* Config.option(Config.NonEmptyString("GITHUB_REPOSITORY")).pipe(Effect.orElseSucceed(() => Option.none()));
|
|
75
|
+
if (Option.isSome(fromActions)) return fromActions;
|
|
76
|
+
return yield* remoteSlug;
|
|
77
|
+
});
|
|
78
|
+
const attribution = Effect.gen(function* attribution() {
|
|
79
|
+
const context = yield* contextOf;
|
|
80
|
+
const repo = yield* repoOf;
|
|
81
|
+
const slug = Option.getOrElse(repo, () => SELF);
|
|
82
|
+
return {
|
|
83
|
+
httpReferer: `${GITHUB}/${slug}/${TOOL}/${context}`,
|
|
84
|
+
appTitle: `${Option.getOrElse(repo, () => "unknown")} ${context} ${TOOL}`,
|
|
85
|
+
httpClient: hiddenApp()
|
|
86
|
+
};
|
|
87
|
+
}).pipe(Effect.cached, Effect.runSync);
|
|
88
|
+
const clientFor = (apiKey) => attribution.pipe(Effect.map((app) => new OpenRouter({
|
|
89
|
+
apiKey,
|
|
90
|
+
...app
|
|
91
|
+
})));
|
|
92
|
+
//#endregion
|
|
9
93
|
//#region src/services.ts
|
|
10
94
|
const tracing = OtlpTracer.layerFromConfig({ resource: { serviceName: "oxlint-plugin-decision" } }).pipe(Layer.provide(OtlpSerialization.layerJson), Layer.provide(FetchHttpClient.layer));
|
|
11
95
|
const workerServices = [NodeServices.layer, tracing];
|
|
@@ -59,7 +143,7 @@ const writeCache = Effect.fn("writeCache")(function* writeCache(file, response)
|
|
|
59
143
|
});
|
|
60
144
|
const send = Effect.fn("send")(function* send(endpoint, decisionsRequest, { timeoutMs, env }) {
|
|
61
145
|
const apiKey = yield* Config.Redacted(envNameOf(env, "OPENROUTER_API_KEY"));
|
|
62
|
-
const client =
|
|
146
|
+
const client = yield* clientFor(Redacted.value(apiKey));
|
|
63
147
|
return yield* Effect.tryPromise({
|
|
64
148
|
try: (signal) => client.alpha.decisions.create({ decisionsRequest }, {
|
|
65
149
|
serverURL: endpoint,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openrouter-worker.mjs","names":["Arr"],"sources":["../src/services.ts","../src/openrouter-worker.ts"],"sourcesContent":["import { NodeServices } from \"@effect/platform-node\";\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\nconst workerServices: [typeof NodeServices.layer, typeof tracing] = [NodeServices.layer, tracing];\n\nexport { workerServices };\n","import { OpenRouter } from \"@openrouter/sdk\";\nimport { OpenRouterError } from \"@openrouter/sdk/models/errors\";\nimport {\n Array as Arr,\n Config,\n Crypto,\n Effect,\n FileSystem,\n Option,\n Path,\n Redacted,\n Schema,\n pipe,\n} from \"effect\";\nimport { runAsWorker } from \"synckit\";\n\nimport { AnswerSchema } from \"./answer.ts\";\nimport { parseVerdicts } from \"./request.ts\";\nimport { envNameOf, messageOf } from \"./runtime.ts\";\nimport { workerServices } from \"./services.ts\";\nimport type { DecideInput, DecideResult, DecisionRequest, DecisionResponse } from \"./types.ts\";\nimport { mergeResponses, wireRequestsFor } from \"./wire.ts\";\nimport type { WireRequest } from \"./wire.ts\";\n\nconst CACHE_VERSION = 7;\nconst HEX_RADIX = 16;\nconst HEX_BYTE_WIDTH = 2;\nconst RETRY_INITIAL_MS = 10;\nconst RETRY_EXPONENT = 2;\nconst DEFAULT_BASE_URL = \"https://openrouter.ai/api/v1\";\nconst API_SUFFIX = /\\/api\\/v1\\/*$|\\/+$/u;\nconst CACHE_DIR = [\"node_modules\", \".cache\", \"oxlint-plugin-decision\"] as const;\n\nconst reasonFor = (error: unknown): string => {\n if (error instanceof OpenRouterError) {\n return `http ${String(error.statusCode)}: ${error.message}`;\n }\n return `network: ${messageOf(error)}`;\n};\n\nconst serverUrlOf = (env: Readonly<Record<string, string>>): Config.Config<string> =>\n Config.String(envNameOf(env, \"OPENROUTER_BASE_URL\")).pipe(\n Config.withDefault(DEFAULT_BASE_URL),\n Config.map((url) => url.trim().replace(API_SUFFIX, \"\")),\n );\n\nconst toHex = (bytes: readonly number[]): string =>\n bytes.map((byte) => byte.toString(HEX_RADIX).padStart(HEX_BYTE_WIDTH, \"0\")).join(\"\");\n\nconst cacheFile = Effect.fn(\"cacheFile\")(function* cacheFile(\n endpoint: string,\n request: DecisionRequest,\n) {\n const crypto = yield* Crypto.Crypto;\n const path = yield* Path.Path;\n const payload = new TextEncoder().encode(\n JSON.stringify({ version: CACHE_VERSION, endpoint, request }),\n );\n const digest = yield* crypto.digest(\"SHA-256\", payload);\n return path.resolve(...CACHE_DIR, `${toHex([...digest])}.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\nconst isComplete = (response: DecisionResponse, request: DecisionRequest): boolean =>\n Option.liftThrowable(() => parseVerdicts(response, request).complete)().pipe(\n Option.getOrElse(() => false),\n );\n\nconst 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\nconst 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 temp = `${file}.tmp-${String(Date.now())}`;\n yield* fs.makeDirectory(path.dirname(file), { recursive: true });\n yield* fs.writeFileString(temp, JSON.stringify(response));\n yield* fs.rename(temp, file);\n});\n\nconst send = Effect.fn(\"send\")(function* send(\n endpoint: string,\n decisionsRequest: WireRequest,\n { timeoutMs, env }: Pick<DecideInput, \"timeoutMs\" | \"env\">,\n) {\n const apiKey = yield* Config.Redacted(envNameOf(env, \"OPENROUTER_API_KEY\"));\n const client = new OpenRouter({ apiKey: Redacted.value(apiKey) });\n return yield* Effect.tryPromise({\n try: (signal) =>\n client.alpha.decisions.create(\n { decisionsRequest },\n {\n serverURL: endpoint,\n retries: {\n strategy: \"backoff\",\n backoff: {\n initialInterval: RETRY_INITIAL_MS,\n maxInterval: timeoutMs,\n exponent: RETRY_EXPONENT,\n maxElapsedTime: timeoutMs,\n },\n retryConnectionErrors: false,\n },\n retryCodes: [\"429\", \"5XX\"],\n signal,\n },\n ),\n catch: reasonFor,\n });\n});\n\nconst ask = Effect.fn(\"ask\")(function* ask(\n endpoint: string,\n { request, timeoutMs, env }: DecideInput,\n) {\n const responses = yield* Effect.forEach(\n wireRequestsFor(request),\n (wire) => send(endpoint, wire, { timeoutMs, env }),\n { concurrency: \"unbounded\" },\n ).pipe(\n Effect.timeoutOrElse({\n duration: timeoutMs,\n orElse: () => Effect.fail(\"timeout\"),\n }),\n );\n return mergeResponses(request, responses);\n});\n\nconst askAndStore = Effect.fn(\"askAndStore\")(function* askAndStore(\n endpoint: string,\n file: string,\n input: DecideInput,\n) {\n const response = yield* ask(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(input: DecideInput) {\n yield* Effect.annotateCurrentSpan({ model: input.request.model });\n const endpoint = yield* serverUrlOf(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(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 input: DecideInput,\n): Effect.Effect<DecideResult, never, Crypto.Crypto | FileSystem.FileSystem | Path.Path> =>\n decide(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 inputs: Arr.NonEmptyReadonlyArray<DecideInput>,\n): Effect.Effect<Arr.NonEmptyReadonlyArray<DecideResult>> =>\n Effect.all(\n pipe(\n inputs,\n Arr.map((input) => decideOne(input)),\n ),\n { concurrency: \"unbounded\" },\n ).pipe(Effect.provide(workerServices));\n\nconst run = (\n inputs: Arr.NonEmptyReadonlyArray<DecideIn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E,CAAC;CACnE,IAAI,OAAO,OAAO,MAAM,GACtB,OAAO;EAAE,UAAU,OAAO;EAAO,QAAQ;CAAK;CAEhD,OAAO;EAAE,UAAU,OAAO,YAAY,UAAU,MAAM,KAAK;EAAG,QAAQ;CAAM;AAC9E,CAAC;AAED,MAAM,YAAY,UAA2B;CAC3C,IAAI,OAAO,UAAU,UACnB,OAAO;CAET,OAAO,UAAU,KAAK;AACxB;AAEA,MAAM,aACJ,UAEA,OAAO,KAAK,CAAC,CAAC,KACZ,OAAO,MAAM;CACX,YAAY,EAAE,UAAU,cAA4B;EAAE,IAAI;EAAM;EAAU;CAAO;CACjF,YAAY,WAAyB;EAAE,IAAI;EAAO,QAAQ,SAAS,KAAK;CAAE;AAC5E,CAAC,CACH;AAEF,MAAM,cACJ,WAEA,OAAO,IACL,KACE,QACAA,MAAI,KAAK,UAAU,UAAU,KAAK,CAAC,CACrC,GACA,EAAE,aAAa,YAAY,CAC7B,CAAC,CAAC,KAAK,OAAO,QAAQ,cAAc,CAAC;AAEvC,MAAM,OACJ,WACqD,OAAO,WAAW,WAAW,MAAM,CAAC;AAE3F,YAAY,GAAG"}
|
|
1
|
+
{"version":3,"file":"openrouter-worker.mjs","names":["Str","Arr","Arr"],"sources":["../src/client.ts","../src/services.ts","../src/openrouter-worker.ts"],"sourcesContent":["import { OpenRouter } from \"@openrouter/sdk\";\nimport { HTTPClient } from \"@openrouter/sdk/lib/http.js\";\nimport { Array as Arr, Config, Effect, FileSystem, Option, Path, String as Str } from \"effect\";\n\nconst TOOL = \"oxlint-plugin-decision\";\nconst GITHUB = \"https://github.com\";\nconst SELF = \"masseater/oxlint-plugin-decision\";\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 hiddenApp = (): HTTPClient =>\n new HTTPClient().addHook(\"beforeRequest\", (request) => {\n request.headers.set(\"X-OpenRouter-App-Visibility\", \"hidden\");\n });\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 = url\n .trim()\n .replace(GIT_SUFFIX, \"\")\n .split(SEPARATORS)\n .filter((part) => Str.isNonEmpty(part));\n if (parts.length < SLUG_PARTS) {\n return Option.none();\n }\n return Option.some(Arr.takeRight(parts, SLUG_PARTS).join(\"/\"));\n};\n\nconst captured = (match: Option.Option<RegExpMatchArray>, name: string): Option.Option<string> =>\n match.pipe(\n Option.flatMap((found) => Option.fromNullishOr(found.groups)),\n Option.flatMap((groups) => Option.fromNullishOr(groups[name])),\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, found.trim())),\n );\n});\n\ntype ClientServices = 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 = (dir: string): Effect.Effect<Option.Option<string>, unknown, ClientServices> =>\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, relative.trim()),\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 config = yield* fs.readFileString(path.join(yield* commonDirOf(gitDir.value), \"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\nconst attribution = Effect.gen(function* attribution() {\n const context = yield* contextOf;\n const repo = yield* repoOf;\n const slug = Option.getOrElse(repo, () => SELF);\n return {\n httpReferer: `${GITHUB}/${slug}/${TOOL}/${context}`,\n appTitle: `${Option.getOrElse(repo, () => \"unknown\")} ${context} ${TOOL}`,\n httpClient: hiddenApp(),\n };\n}).pipe(Effect.cached, Effect.runSync);\n\nconst clientFor = (apiKey: string): Effect.Effect<OpenRouter, never, ClientServices> =>\n attribution.pipe(Effect.map((app) => new OpenRouter({ apiKey, ...app })));\n\nexport { clientFor };\nexport type { ClientServices };\n","import { NodeServices } from \"@effect/platform-node\";\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\nconst workerServices: [typeof NodeServices.layer, typeof tracing] = [NodeServices.layer, tracing];\n\nexport { workerServices };\n","import { OpenRouterError } from \"@openrouter/sdk/models/errors\";\nimport {\n Array as Arr,\n Config,\n Crypto,\n Effect,\n FileSystem,\n Option,\n Path,\n Redacted,\n Schema,\n pipe,\n} from \"effect\";\nimport { runAsWorker } from \"synckit\";\n\nimport { AnswerSchema } from \"./answer.ts\";\nimport { clientFor } from \"./client.ts\";\nimport type { ClientServices } from \"./client.ts\";\nimport { parseVerdicts } from \"./request.ts\";\nimport { envNameOf, messageOf } from \"./runtime.ts\";\nimport { workerServices } from \"./services.ts\";\nimport type { DecideInput, DecideResult, DecisionRequest, DecisionResponse } from \"./types.ts\";\nimport { mergeResponses, wireRequestsFor } from \"./wire.ts\";\nimport type { WireRequest } from \"./wire.ts\";\n\nconst CACHE_VERSION = 7;\nconst HEX_RADIX = 16;\nconst HEX_BYTE_WIDTH = 2;\nconst RETRY_INITIAL_MS = 10;\nconst RETRY_EXPONENT = 2;\nconst DEFAULT_BASE_URL = \"https://openrouter.ai/api/v1\";\nconst API_SUFFIX = /\\/api\\/v1\\/*$|\\/+$/u;\nconst CACHE_DIR = [\"node_modules\", \".cache\", \"oxlint-plugin-decision\"] as const;\n\nconst reasonFor = (error: unknown): string => {\n if (error instanceof OpenRouterError) {\n return `http ${String(error.statusCode)}: ${error.message}`;\n }\n return `network: ${messageOf(error)}`;\n};\n\nconst serverUrlOf = (env: Readonly<Record<string, string>>): Config.Config<string> =>\n Config.String(envNameOf(env, \"OPENROUTER_BASE_URL\")).pipe(\n Config.withDefault(DEFAULT_BASE_URL),\n Config.map((url) => url.trim().replace(API_SUFFIX, \"\")),\n );\n\nconst toHex = (bytes: readonly number[]): string =>\n bytes.map((byte) => byte.toString(HEX_RADIX).padStart(HEX_BYTE_WIDTH, \"0\")).join(\"\");\n\nconst cacheFile = Effect.fn(\"cacheFile\")(function* cacheFile(\n endpoint: string,\n request: DecisionRequest,\n) {\n const crypto = yield* Crypto.Crypto;\n const path = yield* Path.Path;\n const payload = new TextEncoder().encode(\n JSON.stringify({ version: CACHE_VERSION, endpoint, request }),\n );\n const digest = yield* crypto.digest(\"SHA-256\", payload);\n return path.resolve(...CACHE_DIR, `${toHex([...digest])}.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\nconst isComplete = (response: DecisionResponse, request: DecisionRequest): boolean =>\n Option.liftThrowable(() => parseVerdicts(response, request).complete)().pipe(\n Option.getOrElse(() => false),\n );\n\nconst 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\nconst 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 temp = `${file}.tmp-${String(Date.now())}`;\n yield* fs.makeDirectory(path.dirname(file), { recursive: true });\n yield* fs.writeFileString(temp, JSON.stringify(response));\n yield* fs.rename(temp, file);\n});\n\nconst send = Effect.fn(\"send\")(function* send(\n endpoint: string,\n decisionsRequest: WireRequest,\n { timeoutMs, env }: Pick<DecideInput, \"timeoutMs\" | \"env\">,\n) {\n const apiKey = yield* Config.Redacted(envNameOf(env, \"OPENROUTER_API_KEY\"));\n const client = yield* clientFor(Redacted.value(apiKey));\n return yield* Effect.tryPromise({\n try: (signal) =>\n client.alpha.decisions.create(\n { decisionsRequest },\n {\n serverURL: endpoint,\n retries: {\n strategy: \"backoff\",\n backoff: {\n initialInterval: RETRY_INITIAL_MS,\n maxInterval: timeoutMs,\n exponent: RETRY_EXPONENT,\n maxElapsedTime: timeoutMs,\n },\n retryConnectionErrors: false,\n },\n retryCodes: [\"429\", \"5XX\"],\n signal,\n },\n ),\n catch: reasonFor,\n });\n});\n\nconst ask = Effect.fn(\"ask\")(function* ask(\n endpoint: string,\n { request, timeoutMs, env }: DecideInput,\n) {\n const responses = yield* Effect.forEach(\n wireRequestsFor(request),\n (wire) => send(endpoint, wire, { timeoutMs, env }),\n { concurrency: \"unbounded\" },\n ).pipe(\n Effect.timeoutOrElse({\n duration: timeoutMs,\n orElse: () => Effect.fail(\"timeout\"),\n }),\n );\n return mergeResponses(request, responses);\n});\n\nconst askAndStore = Effect.fn(\"askAndStore\")(function* askAndStore(\n endpoint: string,\n file: string,\n input: DecideInput,\n) {\n const response = yield* ask(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(input: DecideInput) {\n yield* Effect.annotateCurrentSpan({ model: input.request.model });\n const endpoint = yield* serverUrlOf(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(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 input: DecideInput,\n): Effect.Effect<\n DecideResult,\n never,\n ClientServices | Crypto.Crypto | FileSystem.FileSystem | Path.Path\n> =>\n decide(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 inputs: Arr.NonEmptyReadonlyArray<DecideInput>,\n): Effect.Effect<Arr.NonEmptyReadonlyArray<DecideResult>> =>\n Effect.all(\n pipe(\n inputs,\n Arr.map((input) => decideOne(input)),\n ),\n { concurrency: \"unbounded\" },\n ).pipe(Effect.provide(workerServices));\n\nconst run = (\n inputs: Arr.NonEmptyReadonlyArray<DecideInput>,\n): Promise<Arr.NonEmptyReadonlyArray<DecideResult>> => Effect.runPromise(decideEach(inputs));\n\nrunAsWorker(run);\n"],"mappings":";;;;;;;;;;AAIA,MAAM,OAAO;AACb,MAAM,SAAS;AACf,MAAM,OAAO;AACb,MAAM,aAAa;AACnB,MAAM,aAAa;AACnB,MAAM,aAAa;AACnB,MAAM,SAAS;AACf,MAAM,aAAa;AAEnB,MAAM,kBACJ,IAAI,WAAW,CAAC,CAAC,QAAQ,kBAAkB,YAAY;CACrD,QAAQ,QAAQ,IAAI,+BAA+B,QAAQ;AAC7D,CAAC;AAEH,MAAM,SAAS,SACb,OAAO,OAAO,OAAO,eAAe,IAAI,CAAC,CAAC,CAAC,KACzC,OAAO,IAAI,OAAO,MAAM,GACxB,OAAO,oBAAoB,KAAK,CAClC;AAEF,MAAM,YAAY,OAAO,IAAI,UAAU,YAAY;CACjD,IAAI,OAAO,MAAM,gBAAgB,GAC/B,OAAO;CAET,IAAI,OAAO,MAAM,oBAAoB,GACnC,OAAO;CAET,IAAI,OAAO,MAAM,YAAY,GAC3B,OAAO;CAET,OAAO;AACT,CAAC;AAED,MAAM,UAAU,QAAuC;CACrD,MAAM,QAAQ,IACX,KAAK,CAAC,CACN,QAAQ,YAAY,EAAE,CAAC,CACvB,MAAM,UAAU,CAAC,CACjB,QAAQ,SAASA,SAAI,WAAW,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