From f40d78d13a1043ce839d480e772ea4d20bf0b005 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:30:30 +0000 Subject: [PATCH 1/2] chore(deps)(deps): bump @effect/platform-node from 0.59.1 to 0.104.0 Bumps [@effect/platform-node](https://github.com/Effect-TS/effect/tree/HEAD/packages/platform-node) from 0.59.1 to 0.104.0. - [Release notes](https://github.com/Effect-TS/effect/releases) - [Changelog](https://github.com/Effect-TS/effect/blob/main/packages/platform-node/CHANGELOG.md) - [Commits](https://github.com/Effect-TS/effect/commits/@effect/platform-node@0.104.0/packages/platform-node) --- updated-dependencies: - dependency-name: "@effect/platform-node" dependency-version: 0.104.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- app/sm-cli/package.json | 2 +- package.json | 2 +- packages/cli/package.json | 2 +- packages/toolkit/package.json | 4 ++-- services/mcp-server-stdio/package.json | 2 +- services/mcp-server/package.json | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/sm-cli/package.json b/app/sm-cli/package.json index fca9cec1..aca1b616 100644 --- a/app/sm-cli/package.json +++ b/app/sm-cli/package.json @@ -23,7 +23,7 @@ "dependencies": { "@effect/cli": "^0.40.8", "@effect/platform": "^0.93.0", - "@effect/platform-node": "^0.59.1", + "@effect/platform-node": "^0.104.0", "@effect/printer": "^0.47.0", "@effect/printer-ansi": "^0.47.0", "@effect/schema": "^0.70.4", diff --git a/package.json b/package.json index a7224f5d..3537c560 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "dependencies": { "@effect/cli": "^0.69.2", "@effect/platform": "^0.93.8", - "@effect/platform-node": "^0.100.0", + "@effect/platform-node": "^0.104.0", "@langchain/openai": "^1.2.0", "@opentelemetry/api": "^1.9.0", "@opentelemetry/exporter-metrics-otlp-http": "^0.206.0", diff --git a/packages/cli/package.json b/packages/cli/package.json index daf29c2d..82ec9b41 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -24,7 +24,7 @@ "dependencies": { "@effect/cli": "^0.69.2", "@effect/platform": "^0.93.8", - "@effect/platform-node": "^0.98.4", + "@effect/platform-node": "^0.104.0", "@effect-patterns/pipeline-state": "workspace:*", "@effect-patterns/toolkit": "workspace:*", "conventional-commits-parser": "^6.2.1", diff --git a/packages/toolkit/package.json b/packages/toolkit/package.json index 34a93187..7b7ba8b7 100644 --- a/packages/toolkit/package.json +++ b/packages/toolkit/package.json @@ -33,13 +33,13 @@ }, "dependencies": { "@effect/platform": "^0.93.0", - "@effect/platform-node": "^0.103.0", + "@effect/platform-node": "^0.104.0", "@effect/schema": "^0.75.5", "effect": "^3.18.2" }, "peerDependencies": { "@effect/platform": "^0.93.0", - "@effect/platform-node": "^0.103.0", + "@effect/platform-node": "^0.104.0", "@effect/schema": "^0.75.5", "effect": "^3.18.2" }, diff --git a/services/mcp-server-stdio/package.json b/services/mcp-server-stdio/package.json index c1736e48..0875cd93 100644 --- a/services/mcp-server-stdio/package.json +++ b/services/mcp-server-stdio/package.json @@ -20,7 +20,7 @@ "@modelcontextprotocol/sdk": "^1.20.0", "effect": "^3.18.4", "@effect/platform": "^0.93.0", - "@effect/platform-node": "^0.94.2", + "@effect/platform-node": "^0.104.0", "@effect/schema": "^0.75.5" }, "devDependencies": { diff --git a/services/mcp-server/package.json b/services/mcp-server/package.json index bb03ca01..04a3747c 100644 --- a/services/mcp-server/package.json +++ b/services/mcp-server/package.json @@ -24,7 +24,7 @@ "@effect-patterns/toolkit": "workspace:*", "@effect/opentelemetry": "^0.59.2", "@effect/platform": "^0.93.0", - "@effect/platform-node": "^0.103.0", + "@effect/platform-node": "^0.104.0", "@effect/schema": "^0.75.5", "@opentelemetry/api": "^1.9.0", "@opentelemetry/exporter-trace-otlp-http": "^0.208.0", From 85af2caceed588dad90a4257d3075dce6be6ab7f Mon Sep 17 00:00:00 2001 From: PaulJPhilp <138239846+PaulJPhilp@users.noreply.github.com> Date: Mon, 22 Dec 2025 15:00:23 -0500 Subject: [PATCH 2/2] fix: resolve lint and TypeScript errors for @effect/platform-node 0.104.0 --- bun.lock | 48 ++------- scripts/add-lesson-order.ts | 94 +++++++++--------- scripts/autofix/prepublish-autofix.ts | 2 +- scripts/generate-skills.ts | 26 ++--- scripts/ingest-discord.ts | 32 +++--- scripts/ingest/ingest-pipeline-improved.ts | 5 +- scripts/ingest/populate-expectations.ts | 20 ++-- scripts/ingest/process.ts | 5 +- scripts/integration.test.ts | 4 +- scripts/migrate-state.ts | 26 +++-- scripts/mock-db.ts | 3 +- scripts/publish/generate-claude-rules.ts | 5 +- scripts/publish/generate.ts | 97 +++++++++++-------- scripts/publish/move-to-published.ts | 8 +- scripts/publish/pipeline.ts | 34 ++++--- scripts/publish/publish.ts | 7 +- scripts/publish/test-improved.ts | 4 +- scripts/publish/validate-improved.ts | 4 +- .../publish/validate-pipeline-integrity.ts | 52 +++++----- scripts/test-chat-app-core.ts | 10 +- scripts/test-harness-cli.ts | 16 +-- scripts/test-harness.ts | 6 +- scripts/test-llm-service.ts | 8 -- scripts/test-models.ts | 4 +- scripts/test-patterns.ts | 2 +- 25 files changed, 256 insertions(+), 266 deletions(-) diff --git a/bun.lock b/bun.lock index c354f71f..8af29638 100644 --- a/bun.lock +++ b/bun.lock @@ -7,7 +7,7 @@ "dependencies": { "@effect/cli": "^0.69.2", "@effect/platform": "^0.93.8", - "@effect/platform-node": "^0.100.0", + "@effect/platform-node": "^0.104.0", "@langchain/openai": "^1.2.0", "@opentelemetry/api": "^1.9.0", "@opentelemetry/exporter-metrics-otlp-http": "^0.206.0", @@ -178,7 +178,7 @@ "dependencies": { "@effect/cli": "^0.40.8", "@effect/platform": "^0.93.0", - "@effect/platform-node": "^0.59.1", + "@effect/platform-node": "^0.104.0", "@effect/printer": "^0.47.0", "@effect/printer-ansi": "^0.47.0", "@effect/schema": "^0.70.4", @@ -206,7 +206,7 @@ "@effect-patterns/toolkit": "workspace:*", "@effect/cli": "^0.69.2", "@effect/platform": "^0.93.8", - "@effect/platform-node": "^0.98.4", + "@effect/platform-node": "^0.104.0", "conventional-commits-parser": "^6.2.1", "conventional-recommended-bump": "^11.2.0", "dotenv": "^17.2.3", @@ -311,7 +311,7 @@ "version": "0.1.0", "dependencies": { "@effect/platform": "^0.93.0", - "@effect/platform-node": "^0.103.0", + "@effect/platform-node": "^0.104.0", "@effect/schema": "^0.75.5", "effect": "^3.18.2", }, @@ -323,7 +323,7 @@ }, "peerDependencies": { "@effect/platform": "^0.93.0", - "@effect/platform-node": "^0.103.0", + "@effect/platform-node": "^0.104.0", "@effect/schema": "^0.75.5", "effect": "^3.18.2", }, @@ -335,7 +335,7 @@ "@effect-patterns/toolkit": "workspace:*", "@effect/opentelemetry": "^0.59.2", "@effect/platform": "^0.93.0", - "@effect/platform-node": "^0.103.0", + "@effect/platform-node": "^0.104.0", "@effect/schema": "^0.75.5", "@opentelemetry/api": "^1.9.0", "@opentelemetry/exporter-trace-otlp-http": "^0.208.0", @@ -371,7 +371,7 @@ "dependencies": { "@effect-patterns/toolkit": "workspace:*", "@effect/platform": "^0.93.0", - "@effect/platform-node": "^0.94.2", + "@effect/platform-node": "^0.104.0", "@effect/schema": "^0.75.5", "@modelcontextprotocol/sdk": "^1.20.0", "effect": "^3.18.4", @@ -580,9 +580,9 @@ "@effect/platform": ["@effect/platform@0.93.8", "", { "dependencies": { "find-my-way-ts": "^0.1.6", "msgpackr": "^1.11.4", "multipasta": "^0.2.7" }, "peerDependencies": { "effect": "^3.19.12" } }, "sha512-xTEy6fyTy4ijmFC3afKgtvYtn/JyPoIov4ZSUWJZUv3VeOcUPNGrrqG6IJlWkXs3NhvSywKv7wc1kw3epCQVZw=="], - "@effect/platform-node": ["@effect/platform-node@0.100.0", "", { "dependencies": { "@effect/platform-node-shared": "^0.53.0", "mime": "^3.0.0", "undici": "^7.10.0", "ws": "^8.18.2" }, "peerDependencies": { "@effect/cluster": "^0.52.0", "@effect/platform": "^0.93.0", "@effect/rpc": "^0.72.1", "@effect/sql": "^0.48.0", "effect": "^3.19.0" } }, "sha512-awfeW8zy5hgyRy+ml4bHK27DukTrTV5xvDhZioRF7USjJRwlZ+irdWhR6ExY+UOnAsmq0h8m/1s0l9pUcBi0bw=="], + "@effect/platform-node": ["@effect/platform-node@0.104.0", "", { "dependencies": { "@effect/platform-node-shared": "^0.57.0", "mime": "^3.0.0", "undici": "^7.10.0", "ws": "^8.18.2" }, "peerDependencies": { "@effect/cluster": "^0.56.0", "@effect/platform": "^0.94.0", "@effect/rpc": "^0.73.0", "@effect/sql": "^0.49.0", "effect": "^3.19.13" } }, "sha512-2ZkUDDTxLD95ARdYIKBx4tdIIgqA3cwb3jlnVVBxmHUf0Pg5N2HdMuD0Q+CXQ7Q94FDwnLW3ZvaSfxDh6FvrNw=="], - "@effect/platform-node-shared": ["@effect/platform-node-shared@0.53.0", "", { "dependencies": { "@parcel/watcher": "^2.5.1", "multipasta": "^0.2.7", "ws": "^8.18.2" }, "peerDependencies": { "@effect/cluster": "^0.52.0", "@effect/platform": "^0.93.0", "@effect/rpc": "^0.72.1", "@effect/sql": "^0.48.0", "effect": "^3.19.0" } }, "sha512-xqhYyUYotVUJi7Tqd/iM+tqEoNm6fVowcPm9naxKZCa6WPD6TnRfaogxjkB3yNBnPY63Ya/sIkfkeZXA3MwF3w=="], + "@effect/platform-node-shared": ["@effect/platform-node-shared@0.57.0", "", { "dependencies": { "@parcel/watcher": "^2.5.1", "multipasta": "^0.2.7", "ws": "^8.18.2" }, "peerDependencies": { "@effect/cluster": "^0.56.0", "@effect/platform": "^0.94.0", "@effect/rpc": "^0.73.0", "@effect/sql": "^0.49.0", "effect": "^3.19.13" } }, "sha512-QXuvmLNlABCQLcTl+lN1YPhKosR6KqArPYjC2reU0fb5lroCo3YRb/aGpXIgLthHzQL8cLU5XMGA3Cu5hKY2Tw=="], "@effect/printer": ["@effect/printer@0.47.0", "", { "peerDependencies": { "@effect/typeclass": "^0.38.0", "effect": "^3.19.0" } }, "sha512-VgR8e+YWWhMEAh9qFOjwiZ3OXluAbcVLIOtvp2S5di1nSrPOZxj78g8LE77JSvyfp5y5bS2gmFW+G7xD5uU+2Q=="], @@ -3772,16 +3772,10 @@ "@cspotcode/source-map-support/@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.9", "", { "dependencies": { "@jridgewell/resolve-uri": "3.1.2", "@jridgewell/sourcemap-codec": "1.5.5" } }, "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ=="], - "@effect-patterns/cli-core/@effect/platform-node": ["@effect/platform-node@0.98.4", "", { "dependencies": { "@effect/platform-node-shared": "0.51.6", "mime": "3.0.0", "undici": "7.16.0", "ws": "8.18.3" }, "peerDependencies": { "@effect/cluster": "0.50.6", "@effect/platform": "0.90.10", "@effect/rpc": "0.71.1", "@effect/sql": "0.46.0", "effect": "3.18.4" } }, "sha512-16tFBJtTP4hCjRd5p3SEQ7n+X3Sf/I0ovAhV1EWCJaro2gXV14orQ2cPtYFSaD1VdZmgEzbjnTN1CQBVgjRD/Q=="], - - "@effect-patterns/mcp-server/@effect/platform-node": ["@effect/platform-node@0.103.0", "", { "dependencies": { "@effect/platform-node-shared": "^0.56.0", "mime": "^3.0.0", "undici": "^7.10.0", "ws": "^8.18.2" }, "peerDependencies": { "@effect/cluster": "^0.55.0", "@effect/platform": "^0.93.6", "@effect/rpc": "^0.72.2", "@effect/sql": "^0.48.6", "effect": "^3.19.8" } }, "sha512-N2JmOvHInHAC+JFdt+ME8/Pn9vdgBwYTTcqlSXkT+mBzq6fAKdwHkXHoFUMbk8bWtJGx70oezLLEetatjsveaA=="], - "@effect-patterns/mcp-server/@opentelemetry/sdk-node": ["@opentelemetry/sdk-node@0.208.0", "", { "dependencies": { "@opentelemetry/api-logs": "0.208.0", "@opentelemetry/core": "2.2.0", "@opentelemetry/exporter-logs-otlp-grpc": "0.208.0", "@opentelemetry/exporter-logs-otlp-http": "0.208.0", "@opentelemetry/exporter-logs-otlp-proto": "0.208.0", "@opentelemetry/exporter-metrics-otlp-grpc": "0.208.0", "@opentelemetry/exporter-metrics-otlp-http": "0.208.0", "@opentelemetry/exporter-metrics-otlp-proto": "0.208.0", "@opentelemetry/exporter-prometheus": "0.208.0", "@opentelemetry/exporter-trace-otlp-grpc": "0.208.0", "@opentelemetry/exporter-trace-otlp-http": "0.208.0", "@opentelemetry/exporter-trace-otlp-proto": "0.208.0", "@opentelemetry/exporter-zipkin": "2.2.0", "@opentelemetry/instrumentation": "0.208.0", "@opentelemetry/propagator-b3": "2.2.0", "@opentelemetry/propagator-jaeger": "2.2.0", "@opentelemetry/resources": "2.2.0", "@opentelemetry/sdk-logs": "0.208.0", "@opentelemetry/sdk-metrics": "2.2.0", "@opentelemetry/sdk-trace-base": "2.2.0", "@opentelemetry/sdk-trace-node": "2.2.0", "@opentelemetry/semantic-conventions": "^1.29.0" }, "peerDependencies": { "@opentelemetry/api": ">=1.3.0 <1.10.0" } }, "sha512-pbAqpZ7zTMFuTf3YecYsecsto/mheuvnK2a/jgstsE5ynWotBjgF5bnz5500W9Xl2LeUfg04WMt63TWtAgzRMw=="], "@effect-patterns/mcp-server/@vitest/coverage-v8": ["@vitest/coverage-v8@4.0.15", "", { "dependencies": { "@bcoe/v8-coverage": "^1.0.2", "@vitest/utils": "4.0.15", "ast-v8-to-istanbul": "^0.3.8", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", "istanbul-lib-source-maps": "^5.0.6", "istanbul-reports": "^3.2.0", "magicast": "^0.5.1", "obug": "^2.1.1", "std-env": "^3.10.0", "tinyrainbow": "^3.0.3" }, "peerDependencies": { "@vitest/browser": "4.0.15", "vitest": "4.0.15" }, "optionalPeers": ["@vitest/browser"] }, "sha512-FUJ+1RkpTFW7rQITdgTi93qOCWJobWhBirEPCeXh2SW2wsTlFxy51apDz5gzG+ZEYt/THvWeNmhdAoS9DTwpCw=="], - "@effect-patterns/mcp-server-stdio/@effect/platform-node": ["@effect/platform-node@0.94.2", "", { "dependencies": { "@effect/platform-node-shared": "^0.47.2", "mime": "^3.0.0", "undici": "^7.10.0", "ws": "^8.18.2" }, "peerDependencies": { "@effect/cluster": "^0.46.4", "@effect/platform": "^0.90.0", "@effect/rpc": "^0.68.3", "@effect/sql": "^0.44.1", "effect": "^3.17.6" } }, "sha512-iI7vUjNqd1DOFCa/9Tyf6Cu00Y4oLKMrpa2lx8+bUIHxtYbk696Yd9VFIDLMXVWrKFUru4Fw7WgWaA/YDor/sw=="], - "@effect-patterns/mcp-server-stdio/vitest": ["vitest@3.2.4", "", { "dependencies": { "@types/chai": "5.2.2", "@vitest/expect": "3.2.4", "@vitest/mocker": "3.2.4", "@vitest/pretty-format": "3.2.4", "@vitest/runner": "3.2.4", "@vitest/snapshot": "3.2.4", "@vitest/spy": "3.2.4", "@vitest/utils": "3.2.4", "chai": "5.3.3", "debug": "4.4.3", "expect-type": "1.2.2", "magic-string": "0.30.19", "pathe": "2.0.3", "picomatch": "4.0.3", "std-env": "3.10.0", "tinybench": "2.9.0", "tinyexec": "0.3.2", "tinyglobby": "0.2.15", "tinypool": "1.1.1", "tinyrainbow": "2.0.0", "vite": "7.1.10", "vite-node": "3.2.4", "why-is-node-running": "2.3.0" }, "optionalDependencies": { "@edge-runtime/vm": "3.2.0", "@types/debug": "4.1.12", "@types/node": "22.18.11" }, "bin": { "vitest": "vitest.mjs" } }, "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A=="], "@effect-patterns/pipeline-state/@effect/schema": ["@effect/schema@0.68.27", "", { "dependencies": { "fast-check": "^3.20.0" }, "peerDependencies": { "effect": "^3.5.7" } }, "sha512-/rmIb+4QaQTecdTfeYSZtNikIV+BeIbYDl/hpgBTaS96en7pKNW5hcygFQhdocjKguIL7Y/be+oUrVafWV60ew=="], @@ -3790,16 +3784,12 @@ "@effect-patterns/sm-cli/@effect/cli": ["@effect/cli@0.40.8", "", { "dependencies": { "ini": "^4.1.3", "toml": "^3.0.0", "yaml": "^2.4.5" }, "peerDependencies": { "@effect/platform": "^0.61.8", "@effect/printer": "^0.34.3", "@effect/printer-ansi": "^0.34.3", "@effect/schema": "^0.70.4", "effect": "^3.6.3" } }, "sha512-C47tBzqsYnoeh9z9TgL/v7NbYg+wr/pt8zo0pc3SNOUCERdetj9zk/UYcAByyoQDpLqQU+EXNbFsxw9Ij+J+eA=="], - "@effect-patterns/sm-cli/@effect/platform-node": ["@effect/platform-node@0.59.1", "", { "dependencies": { "@effect/platform-node-shared": "^0.14.1", "mime": "^3.0.0", "undici": "^6.19.7", "ws": "^8.18.0" }, "peerDependencies": { "@effect/platform": "^0.64.1", "effect": "^3.7.3" } }, "sha512-GEKajwItz2m2a6mXaYCS6KOooPzZAWmnYQjXq9JGnXeBHJImktALD8cGtgJnkUimZUFkf7j++5ejlZW1XmLc6A=="], - "@effect-patterns/sm-cli/@effect/schema": ["@effect/schema@0.70.4", "", { "dependencies": { "fast-check": "^3.20.0" }, "peerDependencies": { "effect": "^3.6.3" } }, "sha512-iviV5abu6x3pMjg2uI2Mv5/1FpXLgkUhxJmt2lyzjKoAIED3lcntcrzJBMRbjYDOB0SJL1tYCY/Y0r2rPkC/JQ=="], "@effect-patterns/sm-cli/@vitest/coverage-v8": ["@vitest/coverage-v8@2.1.9", "", { "dependencies": { "@ampproject/remapping": "^2.3.0", "@bcoe/v8-coverage": "^0.2.3", "debug": "^4.3.7", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", "istanbul-lib-source-maps": "^5.0.6", "istanbul-reports": "^3.1.7", "magic-string": "^0.30.12", "magicast": "^0.3.5", "std-env": "^3.8.0", "test-exclude": "^7.0.1", "tinyrainbow": "^1.2.0" }, "peerDependencies": { "@vitest/browser": "2.1.9", "vitest": "2.1.9" }, "optionalPeers": ["@vitest/browser"] }, "sha512-Z2cOr0ksM00MpEfyVE8KXIYPEcBFxdbLSs56L8PO0QQMxt/6bDj45uQfxoc96v05KW3clk7vvgP0qfDit9DmfQ=="], "@effect-patterns/sm-cli/vitest": ["vitest@2.1.9", "", { "dependencies": { "@vitest/expect": "2.1.9", "@vitest/mocker": "2.1.9", "@vitest/pretty-format": "^2.1.9", "@vitest/runner": "2.1.9", "@vitest/snapshot": "2.1.9", "@vitest/spy": "2.1.9", "@vitest/utils": "2.1.9", "chai": "^5.1.2", "debug": "^4.3.7", "expect-type": "^1.1.0", "magic-string": "^0.30.12", "pathe": "^1.1.2", "std-env": "^3.8.0", "tinybench": "^2.9.0", "tinyexec": "^0.3.1", "tinypool": "^1.0.1", "tinyrainbow": "^1.2.0", "vite": "^5.0.0", "vite-node": "2.1.9", "why-is-node-running": "^2.3.0" }, "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", "@vitest/browser": "2.1.9", "@vitest/ui": "2.1.9", "happy-dom": "*", "jsdom": "*" }, "optionalPeers": ["@edge-runtime/vm", "@types/node", "@vitest/browser", "@vitest/ui", "happy-dom", "jsdom"], "bin": { "vitest": "vitest.mjs" } }, "sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q=="], - "@effect-patterns/toolkit/@effect/platform-node": ["@effect/platform-node@0.103.0", "", { "dependencies": { "@effect/platform-node-shared": "^0.56.0", "mime": "^3.0.0", "undici": "^7.10.0", "ws": "^8.18.2" }, "peerDependencies": { "@effect/cluster": "^0.55.0", "@effect/platform": "^0.93.6", "@effect/rpc": "^0.72.2", "@effect/sql": "^0.48.6", "effect": "^3.19.8" } }, "sha512-N2JmOvHInHAC+JFdt+ME8/Pn9vdgBwYTTcqlSXkT+mBzq6fAKdwHkXHoFUMbk8bWtJGx70oezLLEetatjsveaA=="], - "@effect-patterns/toolkit/@vitest/coverage-v8": ["@vitest/coverage-v8@4.0.15", "", { "dependencies": { "@bcoe/v8-coverage": "^1.0.2", "@vitest/utils": "4.0.15", "ast-v8-to-istanbul": "^0.3.8", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", "istanbul-lib-source-maps": "^5.0.6", "istanbul-reports": "^3.2.0", "magicast": "^0.5.1", "obug": "^2.1.1", "std-env": "^3.10.0", "tinyrainbow": "^3.0.3" }, "peerDependencies": { "@vitest/browser": "4.0.15", "vitest": "4.0.15" }, "optionalPeers": ["@vitest/browser"] }, "sha512-FUJ+1RkpTFW7rQITdgTi93qOCWJobWhBirEPCeXh2SW2wsTlFxy51apDz5gzG+ZEYt/THvWeNmhdAoS9DTwpCw=="], "@effect/cli/@effect/printer": ["@effect/printer@0.45.0", "", { "peerDependencies": { "@effect/typeclass": "0.36.0", "effect": "3.18.4" } }, "sha512-UpFBH2JKAgakSWpue6yKkIAXMq+3md/CPb9s/NGl28vDu1P33cvDeeDL/1EOzFk8WqhIs3oKwPMDnd3jUhjzdg=="], @@ -4502,14 +4492,6 @@ "@babel/helper-compilation-targets/lru-cache/yallist": ["yallist@3.1.1", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="], - "@effect-patterns/cli-core/@effect/platform-node/@effect/platform-node-shared": ["@effect/platform-node-shared@0.51.6", "", { "dependencies": { "@parcel/watcher": "2.5.1", "multipasta": "0.2.7", "ws": "8.18.3" }, "peerDependencies": { "@effect/cluster": "0.50.6", "@effect/platform": "0.90.10", "@effect/rpc": "0.71.1", "@effect/sql": "0.46.0", "effect": "3.18.4" } }, "sha512-0Px0qpKR6vwoSuTbHPap9FOcUvt9MPLyYR6ZrskXJny4wZYHt9MfF0xR8a4MPbBaJ3UtGH9z74ijQw2cmzYxEg=="], - - "@effect-patterns/cli-core/@effect/platform-node/undici": ["undici@7.16.0", "", {}, "sha512-QEg3HPMll0o3t2ourKwOeUAZ159Kn9mx5pnzHRQO8+Wixmh88YdZRiIwat0iNzNNXn0yoEtXJqFpyW7eM8BV7g=="], - - "@effect-patterns/mcp-server-stdio/@effect/platform-node/@effect/platform-node-shared": ["@effect/platform-node-shared@0.47.2", "", { "dependencies": { "@parcel/watcher": "^2.5.1", "multipasta": "^0.2.7", "ws": "^8.18.2" }, "peerDependencies": { "@effect/cluster": "^0.46.4", "@effect/platform": "^0.90.0", "@effect/rpc": "^0.68.3", "@effect/sql": "^0.44.1", "effect": "^3.17.6" } }, "sha512-mtXNAx7Rzbfmp8hsMnyYebIkdCoKKOMa61uRLfOgbOV0p/ksO99YHYZSE/UTE2fFeoF9f2oi0mwOj/G7EMqzng=="], - - "@effect-patterns/mcp-server-stdio/@effect/platform-node/undici": ["undici@7.16.0", "", {}, "sha512-QEg3HPMll0o3t2ourKwOeUAZ159Kn9mx5pnzHRQO8+Wixmh88YdZRiIwat0iNzNNXn0yoEtXJqFpyW7eM8BV7g=="], - "@effect-patterns/mcp-server-stdio/vitest/@types/node": ["@types/node@22.18.11", "", { "dependencies": { "undici-types": "6.21.0" } }, "sha512-Gd33J2XIrXurb+eT2ktze3rJAfAp9ZNjlBdh4SVgyrKEOADwCbdUDaK7QgJno8Ue4kcajscsKqu6n8OBG3hhCQ=="], "@effect-patterns/mcp-server-stdio/vitest/@vitest/expect": ["@vitest/expect@3.2.4", "", { "dependencies": { "@types/chai": "5.2.2", "@vitest/spy": "3.2.4", "@vitest/utils": "3.2.4", "chai": "5.3.3", "tinyrainbow": "2.0.0" } }, "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig=="], @@ -4528,10 +4510,6 @@ "@effect-patterns/mcp-server-stdio/vitest/tinyexec": ["tinyexec@0.3.2", "", {}, "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA=="], - "@effect-patterns/mcp-server/@effect/platform-node/@effect/platform-node-shared": ["@effect/platform-node-shared@0.56.0", "", { "dependencies": { "@parcel/watcher": "^2.5.1", "multipasta": "^0.2.7", "ws": "^8.18.2" }, "peerDependencies": { "@effect/cluster": "^0.55.0", "@effect/platform": "^0.93.6", "@effect/rpc": "^0.72.2", "@effect/sql": "^0.48.6", "effect": "^3.19.8" } }, "sha512-0RawLcUCLHVGs4ch1nY26P4xM+U6R03ZR02MgNHMsL0slh8YYlal5PnwD/852rJ59O9prQX3Kq8zs+cGVoLAJw=="], - - "@effect-patterns/mcp-server/@effect/platform-node/undici": ["undici@7.16.0", "", {}, "sha512-QEg3HPMll0o3t2ourKwOeUAZ159Kn9mx5pnzHRQO8+Wixmh88YdZRiIwat0iNzNNXn0yoEtXJqFpyW7eM8BV7g=="], - "@effect-patterns/mcp-server/@opentelemetry/sdk-node/@opentelemetry/api-logs": ["@opentelemetry/api-logs@0.206.0", "", { "dependencies": { "@opentelemetry/api": "^1.3.0" } }, "sha512-yIVDu9jX//nV5wSMLZLdHdb1SKHIMj9k+wQVFtln5Flcgdldz9BkHtavvExQiJqBZg2OpEEJEZmzQazYztdz2A=="], "@effect-patterns/mcp-server/@opentelemetry/sdk-node/@opentelemetry/exporter-trace-otlp-http": ["@opentelemetry/exporter-trace-otlp-http@0.206.0", "", { "dependencies": { "@opentelemetry/core": "2.1.0", "@opentelemetry/otlp-exporter-base": "0.206.0", "@opentelemetry/otlp-transformer": "0.206.0", "@opentelemetry/resources": "2.1.0", "@opentelemetry/sdk-trace-base": "2.1.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "sha512-xiEhJZxE9yDb13FVW4XaF7J56boLv1NALOGEVu3F8jMC24iZmX5TSVRJCNGLWyy1Xb3N27Yu31kdSsmEBCnxyw=="], @@ -4584,10 +4562,6 @@ "@effect-patterns/sm-cli/@effect/cli/yaml": ["yaml@2.8.1", "", { "bin": { "yaml": "bin.mjs" } }, "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw=="], - "@effect-patterns/sm-cli/@effect/platform-node/@effect/platform-node-shared": ["@effect/platform-node-shared@0.14.1", "", { "dependencies": { "@parcel/watcher": "^2.4.1", "multipasta": "^0.2.5" }, "peerDependencies": { "@effect/platform": "^0.64.1", "effect": "^3.7.3" } }, "sha512-p8elsccYuxyVWX9GKMIZm3tINS08E6CQV19rzIzu1fygD0wPSyIAzgMUEA1E/tpUStSsE8LO43DY8gKOQFBzzw=="], - - "@effect-patterns/sm-cli/@effect/platform-node/undici": ["undici@6.22.0", "", {}, "sha512-hU/10obOIu62MGYjdskASR3CUAiYaFTtC9Pa6vHyf//mAipSvSQg6od2CnJswq7fvzNS3zJhxoRkgNVaHurWKw=="], - "@effect-patterns/sm-cli/@vitest/coverage-v8/@bcoe/v8-coverage": ["@bcoe/v8-coverage@0.2.3", "", {}, "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw=="], "@effect-patterns/sm-cli/@vitest/coverage-v8/tinyrainbow": ["tinyrainbow@1.2.0", "", {}, "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ=="], @@ -4618,10 +4592,6 @@ "@effect-patterns/sm-cli/vitest/vite-node": ["vite-node@2.1.9", "", { "dependencies": { "cac": "^6.7.14", "debug": "^4.3.7", "es-module-lexer": "^1.5.4", "pathe": "^1.1.2", "vite": "^5.0.0" }, "bin": { "vite-node": "vite-node.mjs" } }, "sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA=="], - "@effect-patterns/toolkit/@effect/platform-node/@effect/platform-node-shared": ["@effect/platform-node-shared@0.56.0", "", { "dependencies": { "@parcel/watcher": "^2.5.1", "multipasta": "^0.2.7", "ws": "^8.18.2" }, "peerDependencies": { "@effect/cluster": "^0.55.0", "@effect/platform": "^0.93.6", "@effect/rpc": "^0.72.2", "@effect/sql": "^0.48.6", "effect": "^3.19.8" } }, "sha512-0RawLcUCLHVGs4ch1nY26P4xM+U6R03ZR02MgNHMsL0slh8YYlal5PnwD/852rJ59O9prQX3Kq8zs+cGVoLAJw=="], - - "@effect-patterns/toolkit/@effect/platform-node/undici": ["undici@7.16.0", "", {}, "sha512-QEg3HPMll0o3t2ourKwOeUAZ159Kn9mx5pnzHRQO8+Wixmh88YdZRiIwat0iNzNNXn0yoEtXJqFpyW7eM8BV7g=="], - "@effect-patterns/toolkit/@vitest/coverage-v8/@vitest/utils": ["@vitest/utils@4.0.15", "", { "dependencies": { "@vitest/pretty-format": "4.0.15", "tinyrainbow": "^3.0.3" } }, "sha512-HXjPW2w5dxhTD0dLwtYHDnelK3j8sR8cWIaLxr22evTyY6q8pRCjZSmhRWVjBaOVXChQd6AwMzi9pucorXCPZA=="], "@effect-patterns/toolkit/@vitest/coverage-v8/ast-v8-to-istanbul": ["ast-v8-to-istanbul@0.3.8", "", { "dependencies": { "@jridgewell/trace-mapping": "^0.3.31", "estree-walker": "^3.0.3", "js-tokens": "^9.0.1" } }, "sha512-szgSZqUxI5T8mLKvS7WTjF9is+MVbOeLADU73IseOcrqhxr/VAvy6wfoVE39KnKzA7JRhjF5eUagNlHwvZPlKQ=="], diff --git a/scripts/add-lesson-order.ts b/scripts/add-lesson-order.ts index ac462500..4418ad09 100644 --- a/scripts/add-lesson-order.ts +++ b/scripts/add-lesson-order.ts @@ -1,93 +1,95 @@ -import * as fs from "node:fs/promises" -import * as path from "node:path" -import matter from "gray-matter" +import * as fs from 'node:fs/promises'; +import * as path from 'node:path'; +import matter from 'gray-matter'; -const PUBLISHED_DIR = path.join(process.cwd(), "content/published/patterns") +const PUBLISHED_DIR = path.join(process.cwd(), 'content/published/patterns'); interface Pattern { - path: string - data: Record - content: string + path: string; + data: Record; + content: string; } async function findMdxFiles(dir: string): Promise { - const entries = await fs.readdir(dir, { withFileTypes: true }) - const files: Pattern[] = [] + const entries = await fs.readdir(dir, { withFileTypes: true }); + const files: Pattern[] = []; for (const entry of entries) { - const fullPath = path.join(dir, entry.name) + const fullPath = path.join(dir, entry.name); if (entry.isDirectory()) { - files.push(...(await findMdxFiles(fullPath))) - } else if (entry.isFile() && entry.name.endsWith(".mdx")) { - const content = await fs.readFile(fullPath, "utf-8") - const parsed = matter(content) + files.push(...(await findMdxFiles(fullPath))); + } else if (entry.isFile() && entry.name.endsWith('.mdx')) { + const content = await fs.readFile(fullPath, 'utf-8'); + const parsed = matter(content); files.push({ path: fullPath, data: parsed.data as Record, content: parsed.content, - }) + }); } } - return files + return files; } function getSkillLevel(data: Record): string { - return ((data.skillLevel || data.skill || "intermediate") as string).toLowerCase() + return ( + (data.skillLevel || data.skill || 'intermediate') as string + ).toLowerCase(); } async function main() { - const allPatterns = await findMdxFiles(PUBLISHED_DIR) - + const allPatterns = await findMdxFiles(PUBLISHED_DIR); + // Group by directory (Application Pattern) - const byDir = new Map() + const byDir = new Map(); for (const p of allPatterns) { - const relPath = path.relative(PUBLISHED_DIR, p.path) - const dir = relPath.split(path.sep)[0] - if (!byDir.has(dir)) byDir.set(dir, []) - byDir.get(dir)?.push(p) + const relPath = path.relative(PUBLISHED_DIR, p.path); + const dir = relPath.split(path.sep)[0]; + if (!byDir.has(dir)) byDir.set(dir, []); + byDir.get(dir)?.push(p); } - let updated = 0 - - for (const [dir, patterns] of byDir) { + let updated = 0; + + for (const [_dir, patterns] of byDir) { // Group by skill level within each directory - const bySkill = new Map() + const bySkill = new Map(); for (const p of patterns) { - const skill = getSkillLevel(p.data) - if (!bySkill.has(skill)) bySkill.set(skill, []) - bySkill.get(skill)?.push(p) + const skill = getSkillLevel(p.data); + if (!bySkill.has(skill)) bySkill.set(skill, []); + bySkill.get(skill)?.push(p); } // Assign lessonOrder within each skill level - for (const [skill, skillPatterns] of bySkill) { + for (const [_skill, skillPatterns] of bySkill) { // Sort alphabetically by title for consistent ordering skillPatterns.sort((a, b) => { - const titleA = (a.data.title as string) || "" - const titleB = (b.data.title as string) || "" - return titleA.localeCompare(titleB) - }) + const titleA = (a.data.title as string) || ''; + const titleB = (b.data.title as string) || ''; + return titleA.localeCompare(titleB); + }); - let order = 1 + let order = 1; for (const p of skillPatterns) { // Skip if already has lessonOrder if (p.data.lessonOrder !== undefined) { - order++ - continue + order++; + continue; } // Add lessonOrder - p.data.lessonOrder = order - order++ + p.data.lessonOrder = order; + order++; // Write back - const newContent = matter.stringify(p.content, p.data) - await fs.writeFile(p.path, newContent) - updated++ + const newContent = matter.stringify(p.content, p.data); + await fs.writeFile(p.path, newContent); + updated++; } } } - console.log(`Updated ${updated} patterns with lessonOrder`) + console.log(`Updated ${updated} patterns with lessonOrder`); } -main().catch(console.error) +main().catch(console.error); diff --git a/scripts/autofix/prepublish-autofix.ts b/scripts/autofix/prepublish-autofix.ts index 9fb3c291..eb364667 100644 --- a/scripts/autofix/prepublish-autofix.ts +++ b/scripts/autofix/prepublish-autofix.ts @@ -26,11 +26,11 @@ * Note: This is a scaffold. No file mutations are performed yet. */ -import dotenv from 'dotenv'; import { exec as _exec } from 'node:child_process'; import fs from 'node:fs/promises'; import path from 'node:path'; import { promisify } from 'node:util'; +import dotenv from 'dotenv'; // Style gate uses Biome via bunx diff --git a/scripts/generate-skills.ts b/scripts/generate-skills.ts index 7cdd97c2..2a906d12 100644 --- a/scripts/generate-skills.ts +++ b/scripts/generate-skills.ts @@ -2,21 +2,21 @@ * Generate Skills (Claude, Gemini, OpenAI) from published Effect patterns */ -import * as fs from "node:fs/promises"; -import * as path from "node:path"; +import * as fs from 'node:fs/promises'; +import * as path from 'node:path'; import { - readPattern, - groupPatternsByCategory, generateCategorySkill, - writeSkill, generateGeminiSkill, - writeGeminiSkill, generateOpenAISkill, + groupPatternsByCategory, + readPattern, + writeGeminiSkill, writeOpenAISkill, -} from "../packages/cli/src/skills/skill-generator"; + writeSkill, +} from '../packages/cli/src/skills/skill-generator.js'; const PROJECT_ROOT = process.cwd(); -const PATTERNS_DIR = path.join(PROJECT_ROOT, "content/published/patterns"); +const PATTERNS_DIR = path.join(PROJECT_ROOT, 'content/published/patterns'); async function findMdxFiles(dir: string): Promise { const mdxFiles: string[] = []; @@ -27,7 +27,7 @@ async function findMdxFiles(dir: string): Promise { if (entry.isDirectory()) { const subFiles = await findMdxFiles(fullPath); mdxFiles.push(...subFiles); - } else if (entry.name.endsWith(".mdx")) { + } else if (entry.name.endsWith('.mdx')) { mdxFiles.push(fullPath); } } @@ -36,10 +36,10 @@ async function findMdxFiles(dir: string): Promise { } async function main() { - console.log("\nšŸŽ“ Generating Skills from Effect Patterns\n"); + console.log('\nšŸŽ“ Generating Skills from Effect Patterns\n'); // Read all pattern files - console.log("šŸ“– Reading published patterns..."); + console.log('šŸ“– Reading published patterns...'); const mdxFiles = await findMdxFiles(PATTERNS_DIR); console.log(`āœ“ Found ${mdxFiles.length} patterns\n`); @@ -58,12 +58,12 @@ async function main() { console.log(`āœ“ Parsed ${patterns.length} patterns\n`); // Group by category - console.log("šŸ—‚ļø Grouping patterns by category..."); + console.log('šŸ—‚ļø Grouping patterns by category...'); const categoryMap = groupPatternsByCategory(patterns); console.log(`āœ“ Found ${categoryMap.size} categories\n`); // Generate all skills - console.log("šŸ“ Generating skills...\n"); + console.log('šŸ“ Generating skills...\n'); let claudeCount = 0; let geminiCount = 0; diff --git a/scripts/ingest-discord.ts b/scripts/ingest-discord.ts index 470745fb..31d052a5 100644 --- a/scripts/ingest-discord.ts +++ b/scripts/ingest-discord.ts @@ -1,5 +1,5 @@ -import { NodeContext, NodeRuntime } from '@effect/platform-node'; import { FileSystem } from '@effect/platform/FileSystem'; +import { NodeContext, NodeRuntime } from '@effect/platform-node'; import { Config, Effect, Layer, Logger, LogLevel } from 'effect'; import { Discord, @@ -44,20 +44,22 @@ const program = Effect.gen(function* () { const userIdMap = new Map(); let userCounter = 1; - const anonymizedMessages = channelExport.messages.map((message: Record) => { - const authorId = (message.author as Record).id as string; - if (!userIdMap.has(authorId)) { - userIdMap.set(authorId, `user_${userCounter++}`); - } - return { - ...message, - author: { - ...(message.author as Record), - id: userIdMap.get(authorId), - name: userIdMap.get(authorId), - }, - }; - }); + const anonymizedMessages = channelExport.messages.map( + (message: Record) => { + const authorId = (message.author as Record).id as string; + if (!userIdMap.has(authorId)) { + userIdMap.set(authorId, `user_${userCounter++}`); + } + return { + ...message, + author: { + ...(message.author as Record), + id: userIdMap.get(authorId), + name: userIdMap.get(authorId), + }, + }; + }, + ); // Define the output path for the curated dataset. const outputPath = 'content/discord/beginner-questions.json'; diff --git a/scripts/ingest/ingest-pipeline-improved.ts b/scripts/ingest/ingest-pipeline-improved.ts index 3c67231b..2e968b78 100644 --- a/scripts/ingest/ingest-pipeline-improved.ts +++ b/scripts/ingest/ingest-pipeline-improved.ts @@ -14,11 +14,11 @@ * 8. Reporting - Generate detailed report */ -import matter from 'gray-matter'; import { exec } from 'node:child_process'; import * as fs from 'node:fs/promises'; import * as path from 'node:path'; import { promisify } from 'node:util'; +import matter from 'gray-matter'; const execAsync = promisify(exec); @@ -217,7 +217,8 @@ async function validatePatterns( const warnCount = result.issues.filter((i) => i.type === 'warning').length; console.log( - `${status} ${pattern.id} ${errorCount > 0 ? colorize(`(${errorCount} errors)`, 'red') : '' + `${status} ${pattern.id} ${ + errorCount > 0 ? colorize(`(${errorCount} errors)`, 'red') : '' } ${warnCount > 0 ? colorize(`(${warnCount} warnings)`, 'yellow') : ''}`, ); diff --git a/scripts/ingest/populate-expectations.ts b/scripts/ingest/populate-expectations.ts index 135a8dae..58e196dc 100644 --- a/scripts/ingest/populate-expectations.ts +++ b/scripts/ingest/populate-expectations.ts @@ -4,12 +4,6 @@ import { Console, Context, Data, Effect, Layer } from 'effect'; import { MdxService } from 'effect-mdx'; // --- Configuration Service (Idiomatic Effect.Service pattern) --- -// Define the AppConfig interface -interface AppConfigService { - readonly srcDir: string; - readonly processedDir: string; -} - // Create the AppConfig service using Effect.Service pattern // eslint-disable-next-line @typescript-eslint/no-unused-vars class AppConfig extends Effect.Service()('AppConfig', { @@ -19,7 +13,7 @@ class AppConfig extends Effect.Service()('AppConfig', { processedDir: process.env.PROCESSED_DIR || `${process.cwd()}/content/new/processed`, }), -}) { } +}) {} // The AppConfigLive layer is now available as AppConfig.Default @@ -33,7 +27,7 @@ class ExpectationPrompt extends Data.TaggedClass('ExpectationPrompt')<{ readonly actualStderr: string; readonly actualErrorDetail: string; // Error message from execAsync if it threw readonly executionStatus: 'success' | 'failure'; -}> { } +}> {} // Structured output expected from the LLM using Data.TaggedClass class GeneratedExpectations extends Data.TaggedClass('GeneratedExpectations')<{ @@ -42,7 +36,7 @@ class GeneratedExpectations extends Data.TaggedClass('GeneratedExpectations')<{ readonly reasoning: string; // LLM's explanation for its decision readonly discrepancyFlag: boolean; // True if actuals didn't align with pattern intent readonly discrepancyReason?: string; // Why it didn't align -}> { } +}> {} // LLMService Tag (represents the dependency context for accessing the service) class LLMService extends Context.Tag('LLMService')< @@ -52,7 +46,7 @@ class LLMService extends Context.Tag('LLMService')< prompt: ExpectationPrompt, ) => Effect.Effect; // LLM-related errors } ->() { } +>() {} // Live implementation for LLMService (SIMULATED for demonstration) // This adheres to the service interface and returns an Effect. @@ -65,7 +59,8 @@ const LLMLive = Layer.succeed( // Log the processing return Effect.succeed( Console.info( - `[LLM Sim] Processing prompt for status: ${prompt.executionStatus + `[LLM Sim] Processing prompt for status: ${ + prompt.executionStatus } for pattern ${prompt.patternMdxContent .split('\n')[0] .substring(0, 50)}...`, @@ -205,7 +200,8 @@ const processPatternFile = (mdxFilePath: string) => actualStdout = executionResult.stdout.trim(); // Still capture stdout/stderr from child process if available on failure actualStderr = executionResult.stderr.trim(); yield* Console.error( - ` Execution of ${baseName}.ts failed: ${actualErrorDetail.split('\n')[0] + ` Execution of ${baseName}.ts failed: ${ + actualErrorDetail.split('\n')[0] }`, ); } diff --git a/scripts/ingest/process.ts b/scripts/ingest/process.ts index 76ac7a08..701016a5 100644 --- a/scripts/ingest/process.ts +++ b/scripts/ingest/process.ts @@ -52,7 +52,10 @@ function parseMdx( return { frontmatter, content }; } -function validateFrontMatter(filePath: string, fm: Record): FrontMatter { +function validateFrontMatter( + filePath: string, + fm: Record, +): FrontMatter { const required = ['id', 'title', 'skillLevel', 'useCase', 'summary']; for (const key of required) { if (!fm[key]) diff --git a/scripts/integration.test.ts b/scripts/integration.test.ts index c72d712e..dc33f24c 100644 --- a/scripts/integration.test.ts +++ b/scripts/integration.test.ts @@ -4,10 +4,10 @@ * End-to-end integration tests for Pattern Server + CLI */ -import { FetchHttpClient, HttpClient } from '@effect/platform'; -import { Effect, Schema } from 'effect'; import { type ChildProcess, spawn } from 'node:child_process'; import * as fs from 'node:fs/promises'; +import { FetchHttpClient, HttpClient } from '@effect/platform'; +import { Effect, Schema } from 'effect'; import { afterAll, beforeAll, describe, expect, it } from 'vitest'; // --- SCHEMAS --- diff --git a/scripts/migrate-state.ts b/scripts/migrate-state.ts index dbce0833..d8c7ebcc 100644 --- a/scripts/migrate-state.ts +++ b/scripts/migrate-state.ts @@ -49,7 +49,13 @@ interface PatternMetadata { interface PatternState { id: string; - status: 'draft' | 'in-progress' | 'ready' | 'blocked' | 'completed' | 'failed'; + status: + | 'draft' + | 'in-progress' + | 'ready' + | 'blocked' + | 'completed' + | 'failed'; currentStep: string; steps: Record; metadata: PatternMetadata; @@ -87,8 +93,8 @@ const WORKFLOW_STEPS = [ /** * Create initial step state */ -function createInitialStepState( - status: StepState['status'] = 'pending' +function _createInitialStepState( + status: StepState['status'] = 'pending', ): StepState { return { status, @@ -103,7 +109,7 @@ function createInitialStepState( */ function createCompletedPatternState( patternId: string, - metadata: PatternMetadata + metadata: PatternMetadata, ): PatternState { const now = new Date().toISOString(); @@ -171,7 +177,7 @@ async function migrateExistingPatterns(): Promise { console.log('āš ļø State file already exists!'); console.log('This migration script should only run once.'); console.log( - '\nIf you want to reset the state, delete .pipeline-state.json and run again.' + '\nIf you want to reset the state, delete .pipeline-state.json and run again.', ); console.log('Or backup your current state first:'); console.log(` cp ${STATE_FILE_PATH} ${STATE_FILE_PATH}.backup`); @@ -219,9 +225,7 @@ async function migrateExistingPatterns(): Promise { } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); - console.error( - `āŒ Failed to migrate ${patternId}: ${errorMessage}` - ); + console.error(`āŒ Failed to migrate ${patternId}: ${errorMessage}`); errorCount++; } } @@ -241,7 +245,7 @@ async function migrateExistingPatterns(): Promise { await fs.writeFile( STATE_FILE_PATH, JSON.stringify(pipelineState, null, 2), - 'utf-8' + 'utf-8', ); // Summary @@ -255,7 +259,9 @@ async function migrateExistingPatterns(): Promise { console.log(`\nState file: ${STATE_FILE_PATH}`); console.log('\nNext steps:'); console.log(' 1. Verify .pipeline-state.json looks correct'); - console.log(' 2. Review using: bun packages/cli/dist/index.js ep-admin pipeline-state status'); + console.log( + ' 2. Review using: bun packages/cli/dist/index.js ep-admin pipeline-state status', + ); console.log(' 3. Commit the state file: git add .pipeline-state.json'); console.log(' 4. Continue adding new patterns normally\n'); } catch (error) { diff --git a/scripts/mock-db.ts b/scripts/mock-db.ts index fe78a525..7cfc6015 100644 --- a/scripts/mock-db.ts +++ b/scripts/mock-db.ts @@ -1,5 +1,4 @@ -import { Context, Effect, Layer } from 'effect'; -import * as Queries from './queries'; // This will be the real queries, but we will mock them +import { Layer } from 'effect'; import { DbService } from '../app/code-assistant/lib/db/service'; // Import the DbService interface export const getChatById = async ({ id }: { id: string }) => { diff --git a/scripts/publish/generate-claude-rules.ts b/scripts/publish/generate-claude-rules.ts index 15e2939e..6bb94ea1 100644 --- a/scripts/publish/generate-claude-rules.ts +++ b/scripts/publish/generate-claude-rules.ts @@ -15,7 +15,10 @@ import matter from 'gray-matter'; // --- CONFIGURATION --- const PATTERNS_DIR = path.join(process.cwd(), 'content/published/patterns'); const CLAUDE_MD_PATH = path.join(process.cwd(), 'CLAUDE.md'); -const OUTPUT_DIR = path.join(process.cwd(), 'content/published/rules/generated'); +const OUTPUT_DIR = path.join( + process.cwd(), + 'content/published/rules/generated', +); const OUTPUT_FILE = path.join(OUTPUT_DIR, 'rules-for-claude.md'); // --- COLORS --- diff --git a/scripts/publish/generate.ts b/scripts/publish/generate.ts index 7315f1de..ada97267 100644 --- a/scripts/publish/generate.ts +++ b/scripts/publish/generate.ts @@ -5,14 +5,17 @@ */ // biome-ignore assist/source/organizeImports: <> -import matter from "gray-matter"; -import * as fs from "node:fs/promises"; -import * as path from "node:path"; +import matter from 'gray-matter'; +import * as fs from 'node:fs/promises'; +import * as path from 'node:path'; // --- CONFIGURATION --- -const PUBLISHED_DIR = path.join(process.cwd(), "content/published/patterns"); -const README_PATH = path.join(process.cwd(), "README.md"); -const AP_INDEX_PATH = path.join(process.cwd(), "data/application-patterns.json"); +const PUBLISHED_DIR = path.join(process.cwd(), 'content/published/patterns'); +const README_PATH = path.join(process.cwd(), 'README.md'); +const AP_INDEX_PATH = path.join( + process.cwd(), + 'data/application-patterns.json', +); interface ApplicationPattern { id: string; @@ -40,16 +43,20 @@ interface PatternWithPath extends PatternFrontmatter { } function getSkillLevel(pattern: PatternFrontmatter): string { - return (pattern.skillLevel || pattern.skill || "intermediate").toLowerCase(); + return (pattern.skillLevel || pattern.skill || 'intermediate').toLowerCase(); } async function generateReadme() { - console.log("Starting README generation..."); + console.log('Starting README generation...'); // Load Application Patterns index - const apIndexContent = await fs.readFile(AP_INDEX_PATH, "utf-8"); - const apIndex = JSON.parse(apIndexContent) as { applicationPatterns: ApplicationPattern[] }; - const applicationPatterns = apIndex.applicationPatterns.sort((a, b) => a.learningOrder - b.learningOrder); + const apIndexContent = await fs.readFile(AP_INDEX_PATH, 'utf-8'); + const apIndex = JSON.parse(apIndexContent) as { + applicationPatterns: ApplicationPattern[]; + }; + const applicationPatterns = apIndex.applicationPatterns.sort( + (a, b) => a.learningOrder - b.learningOrder, + ); // Recursively find all MDX files async function findMdxFiles(dir: string): Promise { @@ -60,17 +67,18 @@ async function generateReadme() { const fullPath = path.join(dir, entry.name); if (entry.isDirectory()) { files.push(...(await findMdxFiles(fullPath))); - } else if (entry.isFile() && entry.name.endsWith(".mdx")) { - const content = await fs.readFile(fullPath, "utf-8"); + } else if (entry.isFile() && entry.name.endsWith('.mdx')) { + const content = await fs.readFile(fullPath, 'utf-8'); const { data } = matter(content); const pattern = data as PatternFrontmatter; - + // Extract directory structure const relPath = path.relative(PUBLISHED_DIR, fullPath); const parts = relPath.split(path.sep); const directory = parts[0]; // e.g., "concurrency", "schema" - const subDirectory = parts.length > 2 ? parts.slice(1, -1).join("/") : undefined; - + const subDirectory = + parts.length > 2 ? parts.slice(1, -1).join('/') : undefined; + files.push({ ...pattern, path: path.relative(process.cwd(), fullPath), @@ -87,7 +95,7 @@ async function generateReadme() { // Group patterns by Application Pattern const patternsByAP = new Map(); - + for (const pattern of allPatterns) { const apId = pattern.directory; if (!patternsByAP.has(apId)) { @@ -101,17 +109,17 @@ async function generateReadme() { const toc: string[] = []; // Build TOC and sections in learning order - toc.push("### Effect Patterns\n"); + toc.push('### Effect Patterns\n'); for (const ap of applicationPatterns) { const patterns = patternsByAP.get(ap.id); if (!patterns || patterns.length === 0) continue; - const anchor = ap.id.toLowerCase().replace(/\s+/g, "-"); + const anchor = ap.id.toLowerCase().replace(/\s+/g, '-'); toc.push(`- [${ap.name}](#${anchor})`); } - toc.push("\n"); + toc.push('\n'); // Generate sections for each Application Pattern for (const ap of applicationPatterns) { @@ -139,7 +147,7 @@ async function generateReadme() { // Render patterns without sub-directory first if (noSubDir.length > 0) { sections.push( - "| Pattern | Skill Level | Summary |\n| :--- | :--- | :--- |\n" + '| Pattern | Skill Level | Summary |\n| :--- | :--- | :--- |\n', ); const sortedPatterns = noSubDir.sort((a, b) => { @@ -158,36 +166,41 @@ async function generateReadme() { const skillLevel = getSkillLevel(pattern); const skillEmoji = { - beginner: "🟢", - intermediate: "🟔", - advanced: "🟠", - }[skillLevel] || "āšŖļø"; + beginner: '🟢', + intermediate: '🟔', + advanced: '🟠', + }[skillLevel] || 'āšŖļø'; sections.push( `| [${pattern.title}](./${pattern.path}) | ${skillEmoji} **${ skillLevel.charAt(0).toUpperCase() + skillLevel.slice(1) - }** | ${pattern.summary || ""} |\n` + }** | ${pattern.summary || ''} |\n`, ); } - sections.push("\n"); + sections.push('\n'); } // Render sub-directories - const subDirOrder = ["getting-started", ...Array.from(bySubDir.keys()).filter(k => k !== "getting-started").sort()]; - + const subDirOrder = [ + 'getting-started', + ...Array.from(bySubDir.keys()) + .filter((k) => k !== 'getting-started') + .sort(), + ]; + for (const subDir of subDirOrder) { const subPatterns = bySubDir.get(subDir); if (!subPatterns) continue; const subDisplayName = subDir - .split("-") + .split('-') .map((w) => w.charAt(0).toUpperCase() + w.slice(1)) - .join(" "); + .join(' '); sections.push(`### ${subDisplayName}\n`); sections.push( - "| Pattern | Skill Level | Summary |\n| :--- | :--- | :--- |\n" + '| Pattern | Skill Level | Summary |\n| :--- | :--- | :--- |\n', ); const sortedSubPatterns = subPatterns.sort((a, b) => { @@ -206,19 +219,19 @@ async function generateReadme() { const skillLevel = getSkillLevel(pattern); const skillEmoji = { - beginner: "🟢", - intermediate: "🟔", - advanced: "🟠", - }[skillLevel] || "āšŖļø"; + beginner: '🟢', + intermediate: '🟔', + advanced: '🟠', + }[skillLevel] || 'āšŖļø'; sections.push( `| [${pattern.title}](./${pattern.path}) | ${skillEmoji} **${ skillLevel.charAt(0).toUpperCase() + skillLevel.slice(1) - }** | ${pattern.summary || ""} |\n` + }** | ${pattern.summary || ''} |\n`, ); } - sections.push("\n"); + sections.push('\n'); } } @@ -250,18 +263,18 @@ This repository is designed to be a living document that helps developers move f ## Table of Contents -${toc.join("\n")} +${toc.join('\n')} --- -${sections.join("")}`; +${sections.join('')}`; // Write README - await fs.writeFile(README_PATH, readme, "utf-8"); + await fs.writeFile(README_PATH, readme, 'utf-8'); console.log(`āœ… Generated README.md at ${README_PATH}`); } generateReadme().catch((error) => { - console.error("Failed to generate README:", error); + console.error('Failed to generate README:', error); process.exit(1); }); diff --git a/scripts/publish/move-to-published.ts b/scripts/publish/move-to-published.ts index ed27895a..0414ad0b 100644 --- a/scripts/publish/move-to-published.ts +++ b/scripts/publish/move-to-published.ts @@ -32,9 +32,7 @@ function logCheckpoint(operation: string, data?: unknown) { timestamp, data, }; - console.error( - `[CHECKPOINT] ${JSON.stringify(checkpoint)}` - ); + console.error(`[CHECKPOINT] ${JSON.stringify(checkpoint)}`); } const PROJECT_ROOT = process.cwd(); @@ -298,9 +296,7 @@ async function main(): Promise { total: report.moved.length, successful: report.moved.filter((r) => r.success).length, failed: report.moved.filter((r) => !r.success).length, - movedFiles: report.moved - .filter((r) => r.success) - .map((r) => r.file), + movedFiles: report.moved.filter((r) => r.success).map((r) => r.file), }); // Step 2: Clean up working directories diff --git a/scripts/publish/pipeline.ts b/scripts/publish/pipeline.ts index 82830d02..fa5407d5 100644 --- a/scripts/publish/pipeline.ts +++ b/scripts/publish/pipeline.ts @@ -25,8 +25,8 @@ import { exec } from 'node:child_process'; import * as path from 'node:path'; -import { promisify } from 'node:util'; import * as readline from 'node:readline'; +import { promisify } from 'node:util'; const execAsync = promisify(exec); @@ -42,10 +42,10 @@ const WORKFLOW_STEPS = [ 'tested', 'validated', 'published', - 'finalized' + 'finalized', ] as const; -type WorkflowStep = typeof WORKFLOW_STEPS[number]; +type WorkflowStep = (typeof WORKFLOW_STEPS)[number]; // --- PIPELINE STEPS --- const STEPS = [ @@ -115,9 +115,13 @@ async function validatePipelineIntegrity(): Promise { if (violations.length > 0) { console.error('\nāŒ PIPELINE INTEGRITY CHECK FAILED'); - console.error('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); + console.error( + '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━', + ); console.error('\nGenerated files exist outside content/published/:'); - violations.forEach((dir) => console.error(` āœ— ${dir}`)); + for (const dir of violations) { + console.error(` āœ— ${dir}`); + } console.error('\nThis means generation bypassed the pipeline.'); console.error('\nCORRECT WORKFLOW:'); console.error(' 1. Generate patterns → content/new/'); @@ -131,7 +135,9 @@ async function validatePipelineIntegrity(): Promise { console.error(' āŒ .gemini/skills/'); console.error(' āŒ .openai/skills/'); console.error('\nFor more info: docs/PUBLISHING_PIPELINE.md'); - console.error('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'); + console.error( + '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n', + ); process.exit(1); } } @@ -139,7 +145,7 @@ async function validatePipelineIntegrity(): Promise { /** * Prompt user for confirmation */ -async function confirm(message: string): Promise { +async function _confirm(message: string): Promise { const rl = readline.createInterface({ input: process.stdin, output: process.stdout, @@ -158,7 +164,7 @@ async function confirm(message: string): Promise { */ async function runStep( step: (typeof STEPS)[0], - skipConfirmation: boolean = false + _skipConfirmation: boolean = false, ) { console.log(`\nšŸš€ ${step.name}`); console.log(step.description); @@ -202,7 +208,9 @@ async function main() { await validatePipelineIntegrity(); console.log('āœ… Pipeline integrity check passed\n'); - console.log('Workflow Steps: ingested → tested → validated → published → finalized\n'); + console.log( + 'Workflow Steps: ingested → tested → validated → published → finalized\n', + ); const startTime = Date.now(); try { @@ -216,13 +224,17 @@ async function main() { console.log('\nNext steps:'); console.log(' 1. Review changes in git'); console.log(' 2. Commit and push if satisfied'); - console.log(' 3. Use "ep-admin pipeline-state status" to view pattern states'); + console.log( + ' 3. Use "ep-admin pipeline-state status" to view pattern states', + ); } catch (_error) { const duration = ((Date.now() - startTime) / 1000).toFixed(1); console.error(`\nāŒ Pipeline failed after ${duration}s`); console.error('\nTo retry:'); console.error(' 1. Fix the error'); - console.error(' 2. Run "ep-admin pipeline-state retry " or'); + console.error( + ' 2. Run "ep-admin pipeline-state retry " or', + ); console.error(' 3. Run "ep-admin pipeline-state resume" to continue'); process.exit(1); } diff --git a/scripts/publish/publish.ts b/scripts/publish/publish.ts index a25ee082..d512e140 100644 --- a/scripts/publish/publish.ts +++ b/scripts/publish/publish.ts @@ -25,9 +25,7 @@ function logCheckpoint(operation: string, data?: unknown) { timestamp, data, }; - console.error( - `[CHECKPOINT] ${JSON.stringify(checkpoint)}` - ); + console.error(`[CHECKPOINT] ${JSON.stringify(checkpoint)}`); } // --- CONFIGURATION --- @@ -91,7 +89,8 @@ export async function publishPatterns() { path: outPath, }); } catch (error) { - const errorMessage = error instanceof Error ? error.message : String(error); + const errorMessage = + error instanceof Error ? error.message : String(error); console.error(`āŒ Error processing ${mdxFile}:`, error); failedFiles.push({ file: mdxFile, error: errorMessage }); errorCount++; diff --git a/scripts/publish/test-improved.ts b/scripts/publish/test-improved.ts index 5ab903aa..d38cb5bb 100644 --- a/scripts/publish/test-improved.ts +++ b/scripts/publish/test-improved.ts @@ -30,9 +30,7 @@ function logCheckpoint(operation: string, data?: unknown) { timestamp, data, }; - console.error( - `[CHECKPOINT] ${JSON.stringify(checkpoint)}` - ); + console.error(`[CHECKPOINT] ${JSON.stringify(checkpoint)}`); } // --- CONFIGURATION --- diff --git a/scripts/publish/validate-improved.ts b/scripts/publish/validate-improved.ts index 7ec3e6a8..ab59baeb 100644 --- a/scripts/publish/validate-improved.ts +++ b/scripts/publish/validate-improved.ts @@ -33,9 +33,7 @@ function logCheckpoint(operation: string, data?: unknown) { timestamp, data, }; - console.error( - `[CHECKPOINT] ${JSON.stringify(checkpoint)}` - ); + console.error(`[CHECKPOINT] ${JSON.stringify(checkpoint)}`); } // --- CONFIGURATION --- diff --git a/scripts/publish/validate-pipeline-integrity.ts b/scripts/publish/validate-pipeline-integrity.ts index b4518f78..9d995528 100644 --- a/scripts/publish/validate-pipeline-integrity.ts +++ b/scripts/publish/validate-pipeline-integrity.ts @@ -9,13 +9,13 @@ * Usage: Called automatically by pipeline.ts */ -import { existsSync, readdirSync } from "node:fs" -import * as path from "node:path" +import { existsSync, readdirSync } from 'node:fs'; +import * as path from 'node:path'; interface ValidationResult { - success: boolean - violations: string[] - message: string + success: boolean; + violations: string[]; + message: string; } /** @@ -23,26 +23,26 @@ interface ValidationResult { */ function validatePipelineIntegrity(): ValidationResult { const forbiddenDirs = [ - "patterns/", - "rules/", - ".claude/skills/", - ".gemini/skills/", - ".openai/skills/", - ] + 'patterns/', + 'rules/', + '.claude/skills/', + '.gemini/skills/', + '.openai/skills/', + ]; - const violations: string[] = [] + const violations: string[] = []; for (const dir of forbiddenDirs) { - const fullPath = path.join(process.cwd(), dir) + const fullPath = path.join(process.cwd(), dir); if (existsSync(fullPath)) { try { - const files = readdirSync(fullPath) + const files = readdirSync(fullPath); if (files.length > 0) { - violations.push(`${dir} (${files.length} files)`) + violations.push(`${dir} (${files.length} files)`); } } catch { // Directory exists but may not be readable, flag it anyway - violations.push(dir) + violations.push(dir); } } } @@ -54,9 +54,9 @@ function validatePipelineIntegrity(): ValidationResult { Generation output detected OUTSIDE content/published/: -` +`; for (const v of violations) { - message += ` āœ— ${v}\n` + message += ` āœ— ${v}\n`; } message += ` @@ -85,27 +85,27 @@ The pre-commit hook will block any attempt to commit these files. For more info: docs/ARCHITECTURE.md and CONTRIBUTING.md ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -` +`; return { success: false, violations, message, - } + }; } return { success: true, violations: [], - message: "āœ… Pipeline integrity check passed", - } + message: 'āœ… Pipeline integrity check passed', + }; } // Main execution -const result = validatePipelineIntegrity() -console.log(result.message) +const result = validatePipelineIntegrity(); +console.log(result.message); if (!result.success) { - console.error("") - process.exit(1) + console.error(''); + process.exit(1); } diff --git a/scripts/test-chat-app-core.ts b/scripts/test-chat-app-core.ts index f04a81c5..c297fde7 100644 --- a/scripts/test-chat-app-core.ts +++ b/scripts/test-chat-app-core.ts @@ -9,9 +9,9 @@ * - Supermemory integration */ +import { dirname, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { config } from 'dotenv'; -import { fileURLToPath } from 'url'; -import { dirname, resolve } from 'path'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); @@ -19,8 +19,8 @@ const __dirname = dirname(__filename); // Load environment from code-assistant config({ path: resolve(__dirname, '../app/code-assistant/.env.local') }); -import { myProvider } from '../app/code-assistant/lib/ai/providers'; import { generateText } from 'ai'; +import { myProvider } from '../app/code-assistant/lib/ai/providers'; interface TestResult { name: string; @@ -163,10 +163,10 @@ async function testModelAvailability() { for (const modelId of modelIds) { try { - const model = myProvider.languageModel(modelId); + const _model = myProvider.languageModel(modelId); availableModels.push(modelId); console.log(` āœ“ ${modelId}`); - } catch (error) { + } catch (_error) { console.log(` āœ— ${modelId} (unavailable)`); } } diff --git a/scripts/test-harness-cli.ts b/scripts/test-harness-cli.ts index 751ea4f3..03a5be8c 100644 --- a/scripts/test-harness-cli.ts +++ b/scripts/test-harness-cli.ts @@ -9,17 +9,17 @@ * Makes real API calls to LLM services (no mocking). */ -import { chatModels } from '../app/code-assistant/lib/ai/models'; -import ora from 'ora'; -import { TUIHandler } from 'effect-cli-tui'; -import * as Effect from 'effect/Effect'; +import { FetchHttpClient } from '@effect/platform'; +import { NodeContext } from '@effect/platform-node'; +import { convertToModelMessages } from 'ai'; import { Layer } from 'effect'; -import { myProvider } from '../app/code-assistant/lib/ai/providers'; +import * as Effect from 'effect/Effect'; +import { TUIHandler } from 'effect-cli-tui'; +import ora from 'ora'; +import { chatModels } from '../app/code-assistant/lib/ai/models'; import { systemPrompt } from '../app/code-assistant/lib/ai/prompts'; -import { convertToModelMessages } from 'ai'; +import { myProvider } from '../app/code-assistant/lib/ai/providers'; import { LLMService, LLMServiceLive } from '../services/llm-service'; -import { FetchHttpClient } from '@effect/platform'; -import { NodeContext, NodeRuntime } from '@effect/platform-node'; // --- TYPES --- diff --git a/scripts/test-harness.ts b/scripts/test-harness.ts index b833c495..b49c148b 100644 --- a/scripts/test-harness.ts +++ b/scripts/test-harness.ts @@ -1,5 +1,4 @@ import * as Effect from 'effect/Effect'; -import { TUIHandler } from 'effect-cli-tui'; import { processChat } from '../app/code-assistant/lib/chat/engine'; import { MockDbServiceLive } from './mock-db'; @@ -59,10 +58,11 @@ const program = Effect.gen(function* (_) { const fullResponse = yield* _( Effect.promise(async () => { const reader = stream.getReader(); - let result; let responseText = ''; - while (!(result = await reader.read()).done) { + let result: ReadableStreamReadResult = await reader.read(); + while (!result.done) { responseText += new TextDecoder().decode(result.value); + result = await reader.read(); } return responseText; }), diff --git a/scripts/test-llm-service.ts b/scripts/test-llm-service.ts index b182a212..1c0e722b 100644 --- a/scripts/test-llm-service.ts +++ b/scripts/test-llm-service.ts @@ -6,14 +6,6 @@ * Direct test of the LLM service functionality */ -import * as Effect from 'effect/Effect'; -import { Layer } from 'effect'; -import { NodeContext, NodeRuntime } from '@effect/platform-node'; -import { LLMService, LLMServiceLive } from '../services/llm-service'; -import { myProvider } from '../app/code-assistant/lib/ai/providers'; -import { systemPrompt } from '../app/code-assistant/lib/ai/prompts'; -import { convertToModelMessages } from 'ai'; - // Simple test without Effect complexity async function testLLMService() { console.log('šŸ¤– Testing LLM Service...\n'); diff --git a/scripts/test-models.ts b/scripts/test-models.ts index b7730fac..3a30895e 100644 --- a/scripts/test-models.ts +++ b/scripts/test-models.ts @@ -1,9 +1,9 @@ #!/usr/bin/env tsx +import { generateText } from 'ai'; import { config } from 'dotenv'; -import { myProvider } from '../app/code-assistant/lib/ai/providers'; import { chatModels } from '../app/code-assistant/lib/ai/models'; -import { generateText } from 'ai'; +import { myProvider } from '../app/code-assistant/lib/ai/providers'; // Load environment variables config({ path: '../app/code-assistant/.env.local' }); diff --git a/scripts/test-patterns.ts b/scripts/test-patterns.ts index 9893a31e..2eba96da 100644 --- a/scripts/test-patterns.ts +++ b/scripts/test-patterns.ts @@ -1,8 +1,8 @@ #!/usr/bin/env tsx +import path from 'node:path'; import { loadPatternsFromJson, searchPatterns } from '@effect-patterns/toolkit'; import { config } from 'dotenv'; -import path from 'node:path'; // Load environment variables config({ path: '../app/code-assistant/.env.local' });