Dashboard › opencode › Distillation
03cf70c7-7c88-4603-b8f8-88afc53d5d1d["lore_tm_v1_lMN6xHVOn4SCpZ7mJ2yDgi1E-eL62QaLENgvsbD1tIM","lore_tm_v1_-UDJJpjEQEhZi1sENUJuZQSD64vDw0iR2voWd_cM9D0","lore_tm_v1_6gIu_BkU_zmtSRfcHt101__D7yLzbS3RsiuX_fnrcjI","lore_tm_v1_HvyLJvAcQ9fnr0o-z8FaTdJqU9CGQnouDxrWCskcGLU","lore_tm_v1_ONt7YWPCe5JUqqyNnPuTCM3zgYWlNuNBQXnhJu4Pn9g","lore_tm_v1_azTyhlPg6rNKa_fVyqZ9AmXlFoXIN1jSvzpy0qxoA3Q","lore_tm_v1_4W1m7xJ1Rr9eSwfALmkAJE5HPXwmmm_ta57q97mcFEw","lore_tm_v1_MKgjK4Pu-dfp1o4smTBIQnB6Z2qlLf-t8-Sj5nlyBH8","lore_tm_v1_nCqhB4JC-tb3hYkuZSmmicU46gy8rrL5Ha8RmxGF6d0"]
/home/byk/Code/opencode-lore/packages/gateway/package.json defines @loreai/gateway version 0.40.0, ESM package type, Node engine >=22.15, main ./dist/index.cjs, types ./dist/index.d.cts, Bun export ./dist/index.bun.js, and binaries lore / lore-gateway both mapped to ./dist/bin.cjs.@loreai/gateway scripts are typecheck: tsc --noEmit, build: tsx script/build.ts, bundle: tsx script/bundle.ts, build:binary: tsx script/build.ts --binary, build:binary:sea: tsx script/build-binary-sea.ts, and start: tsx src/index.ts.@loreai/gateway runtime dependencies include @streamparser/json@0.0.26, @stricli/auto-complete@1.2.8, @stricli/core@1.2.8, @supabase/supabase-js@^2.58.0, google-auth-library@^10.9.0, jsonc-parser@3.3.1, p-limit@7, qrcode-terminal@^0.12.0, semver@^7.7.3, and sqlite-vec@0.1.9; development dependencies include @loreai/core@workspace:*, @sentry/bun@^10.52.0, @types/bun@^1.2.0, @types/qrcode-terminal@^0.12.2, @types/semver@^7.7.1, ai-tokenizer@^1.0.6, binpatch@^0.3.1, fossilize@^0.10.1, onnxruntime-node@1.27.0, tar@^7.5.21, and undici@^8.9.0./home/byk/Code/opencode-lore/packages/opencode/package.json defines @loreai/opencode version 0.40.0, ships raw TypeScript from ./src/index.ts for main/types/Bun/default exports, has peer dependency @opencode-ai/plugin >=1.1.0, workspace dependencies @loreai/core and @loreai/gateway, and development dependencies @opencode-ai/plugin@^1.1.39, @opencode-ai/sdk@^1.1.39, and @types/bun@^1.2.0./home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/module.tsβs PluginModule.load as directories; only legacy auto-discovery still admits standalone server-source files./home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/module.ts, PluginModule.load classifies absolute targets as local; nonlocal targets use npm.resolve() when options.install === false or npm.add() otherwise. Local standalone files are retained solely for legacy auto-discovery via { server: pathToFileURL(operation.target).href }; directory/package targets use Host.resolve(installed ?? { directory: operation.target }).PluginModule.load returns { pending: true } only for a nonlocal unresolved target when installation is disabled; otherwise a missing server entrypoint raises LoadError("Plugin entrypoint not found: ..."). It logs loading plugin, reads local sources through sources.read(entrypoint), loads packages through Host.load(entrypoint), and requires a default definition with id plus effect or setup.PluginPromise.fromPromise(value) unless "effect" in value; the generated plugin records optional tui/rpc features, revision JSON.stringify([operation, loaded.version]), a local source using fileURLToPath(entrypoint) or package source with target/version, and invokes plugin.effect({ ...host, options: operation.options })./home/byk/Code/opencode-lore/packages/gateway/src/lifecycle-lock.ts defines lock protocol constants LOCK_VERSION=1, DIRECTORY_MODE=0o700, FILE_MODE=0o600, OWNER_FILE="owner.json", UNINSTALL_TOMBSTONE_FILE="uninstalled.json", INITIALIZATION_CLAIM_MARKER=".init.", INITIALIZATION_QUARANTINE_MARKER=".claim.init.", RELEASE_CLAIM_MARKER=".release.", MAX_OWNER_BYTES=16 * 1024, DEFAULT_TIMEOUT_MS=5000, and DEFAULT_RETRY_DELAY_MS=50; NO_FOLLOW is 0 on Windows and constants.O_NOFOLLOW elsewhere.LifecycleOperation permits "gateway-start", "gateway-shutdown", "upgrade", "setup", "uninstall", and "hosted-install". LifecycleLockOwner records version 1, token, PID, operation, createdAt, processStartedAt, and processIdentity; LifecycleLock exposes path, owner, assertOwned(), and release().AsyncLocalStorage<LifecycleLock> as lockContext; withoutLifecycleLock(action) runs through lockContext.exit(action). withLifecycleLock(operation, action, options) is async-context reentrant: an inherited lock is ownership-checked and reused, otherwise it calls acquireLifecycleLock, runs the action in lockContext.run, and always releases in finally.withLifecycleLock adds a "hosted-install" postcondition: if readUninstallTombstone(lock.path) remains non-null after the action, it throws Fresh install did not clear the uninstall marker after verifying its binary/receipt generation.LifecycleLockBusyError; Unix directory-entry transitions are persisted with fsyncDirectory() using O_RDONLY | O_DIRECTORY | O_NOFOLLOW, while Windows skips directory flushing because Node lacks a portable primitive./home/byk/Code/opencode-lore/packages/gateway/test/start-gateway-reuse.test.ts contains authenticated-reuse coverage for: 1. reusing an existing authenticated gateway instead of EADDRINUSE; 2. authenticating/reusing an owned gateway on forbidden port 6669; 3. preserving global Fetch transport for non-loopback probes; 4. preserving "timeout" deadline classification for hanging loopback probes; 5. reusing an authenticated recordβs random port 49152 when no port is explicit; 6. reusing a gateway through a non-overlapping requested interface while adopting its actual host; 7. rejecting a public /health spoof as foreign despite probeGateway() returning true; 8. reporting a friendly authenticated-gateway error for a non-HTTP foreign process; 9. removing port and PID state when process-record publication fails; 10. retaining discovery evidence when publication cleanup cannot close the listener; 11. serializing concurrent starts through process-record publication; and 12. making a successor wait until shutdown removes predecessor records.http://127.0.0.1:6669, verifies public health is "healthy", verifies a wrong control token yields { kind: "rejected" }, verifies the correct token yields { kind: "authenticated", identity: { pid: process.pid } }, confirms fetchMemoryHealth() succeeds, and confirms startGateway() returns an unowned handle on port 6669.readPortFile() and readGatewayProcessFile() must become null; when listener shutdown throws injected listener close failure, the error must report that discovery evidence was retained, preserving published port 49321 and the process record rather than invoking removal./home/byk/Code/opencode-lore/packages/gateway/test/shutdown-active-stream.test.ts verifies that an asynchronously requested remote shutdown whose server stop() throws injected listener close failure sets process.exitCode to 1 and logs the warning Remote shutdown failed: injected listener close failure; the test restores the prior exit code afterward.