Dashboard › opencode › Session 16od9eLodujF
16od9eLodujFsAeYbPerform a read-only compatibility investigation and return a substantive report in your final response. Do not edit files, install dependencies, inspect secrets, or start/stop services.
Compare:
Required findings with current file:line evidence:
followup and local-pty; verify static configuration rather than probing or changing the running service.Do not rely on memory. Use direct reads/searches. Keep scope limited to these repositories and config. If blocked, name the exact path/tool/error. Return a concise but substantive compatibility report even if blocked.
I’ll trace static activation and plugin compatibility from each repository’s current source, then classify blockers and define a no-change validation plan. I will restrict all reads to the two repositories and the isolated pilot config.
[
{
"content": "Inspect repository guidance and relevant manifests, exports, configs, and candidate state",
"status": "in_progress",
"priority": "high"
},
{
"content": "Trace Lore plugin entrypoint, dependencies, hooks, APIs, and startup assumptions",
"status": "pending",
"priority": "high"
},
{
"content": "Trace V2 plugin discovery, loader, and Promise plugin contracts",
"status": "pending",
"priority": "high"
},
{
"content": "Compare both sides and classify every concrete incompatibility",
"status": "pending",
"priority": "high"
},
{
"content": "Define the smallest viable port and complete validation sequence",
"status": "pending",
"priority": "medium"
},
{
"content": "Prepare a concise evidence-based compatibility report",
"status": "pending",
"priority": "high"
}
]
/home/byk/Code/opencode-lore/AGENTS.md
/home/byk/Code/opencode-v2-pilot/packages/schema/AGENTS.md /home/byk/Code/opencode-v2-pilot/AGENTS.md /home/byk/Code/opencode-v2-pilot/packages/plugin/AGENTS.md /home/byk/Code/opencode-v2-pilot/services/www/src/docs/AGENTS.md /home/byk/Code/opencode-v2-pilot/services/www/AGENTS.md /home/byk/Code/opencode-v2-pilot/packages/cli/AGENTS.md /home/byk/Code/opencode-v2-pilot/packages/desktop/AGENTS.md /home/byk/Code/opencode-v2-pilot/packages/app/AGENTS.md /home/byk/Code/opencode-v2-pilot/packages/ui/AGENTS.md /home/byk/Code/opencode-v2-pilot/packages/core/src/tool/AGENTS.md /home/byk/Code/opencode-v2-pilot/packages/app/e2e/performance/AGENTS.md /home/byk/Code/opencode-v2-pilot/packages/app/e2e/AGENTS.md /home/byk/Code/opencode-v2-pilot/packages/ai/AGENTS.md /home/byk/Code/opencode-v2-pilot/packages/tui/AGENTS.md /home/byk/Code/opencode-v2-pilot/packages/stats/AGENTS.md /home/byk/Code/opencode-v2-pilot/packages/session-ui/AGENTS.md /home/byk/Code/opencode-v2-pilot/packages/codemode/AGENTS.md
/home/byk/.local/share/opencode-v2-pilot/config/opencode/bun.lock /home/byk/.local/share/opencode-v2-pilot/config/opencode/tsconfig.json /home/byk/.local/share/opencode-v2-pilot/config/opencode/test/pty.test.ts /home/byk/.local/share/opencode-v2-pilot/config/opencode/test/followup.test.ts /home/byk/.local/share/opencode-v2-pilot/config/opencode/node_modules/detect-libc/package.json /home/byk/.local/share/opencode-v2-pilot/config/opencode/node_modules/detect-libc/index.d.ts /home/byk/.local/share/opencode-v2-pilot/config/opencode/node_modules/detect-libc/README.md /home/byk/.local/share/opencode-v2-pilot/config/opencode/node_modules/detect-libc/LICENSE /home/byk/.local/share/opencode-v2-pilot/config/opencode/node_modules/detect-libc/lib/process.js /home/byk/.local/share/opencode-v2-pilot/config/opencode/node_modules/detect-libc/lib/filesystem.js /home/byk/.local/share/opencode-v2-pilot/config/opencode/node_modules/detect-libc/lib/elf.js /home/byk/.local/share/opencode-v2-pilot/config/op...
<path>/home/byk/Code/opencode-lore/AGENTS.md</path> <type>file</type> <content> 1: <!-- This section is maintained by the coding agent via lore (https://github.com/BYK/loreai) --> 2: ## Long-term Knowledge 3: 4: For long-term knowledge entries managed by [lore](https://github.com/BYK/loreai) (gotchas, patterns, decisions, architecture), see [`.lore.md`](.lore.md) in the project root. 5: <!-- End lore-managed section --> 6: 7: ## Review 8: 9: See [`quality/REVIEW.md`](quality/REVIEW.md) for the review heuristics and workflow — regression-test discipline, adversarial-order state setup, fan-out registry coverage, recurring bug-class batteries, and the two-reviewer rule. Every non-trivial PR requires an adversarial correctness review before merge. 10: 11: # Project Overview 12: 13: Lore is a **three-tier memory architecture** for AI coding agents. ...
<path>/home/byk/Code/opencode-v2-pilot/AGENTS.md</path> <type>file</type> <content> 1: - After changing the public Protocol or Server `HttpApi`, run `bun run generate` from `packages/client`. Do not edit generated client files directly. 2: - Keep runtime dependencies directed from Schema to Core and Protocol, then from Core and Protocol to Server. Client runtime code may depend on Schema and Protocol but never Core or Server; `sdk` composes Client, Core, and Server. 3: - Current implementation changes belong in `packages/core`, `packages/cli`, `packages/server`, `packages/protocol`, `packages/schema`, and related generated client surfaces when required. 4: - This repository does not use Changesets. Do not add `.changeset` files; follow the existing release workflow instead. 5: - The default branch in this repo is `v2`. 6: - Default new branches and worktrees to `v2`, or `origin/v2` when the local `v2` ref is unavailable, and default pull requests to target `v2`. ...
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin/AGENTS.md</path> <type>file</type> <content> 1: # Plugin Package Guide 2: 3: - The plugin package has two versions: Effect and Promise. 4: - In the Effect version, every domain must extend the corresponding Effect API client interface from `@opencode/client/effect/api`. 5: - Do not redefine functions that already exist on the Effect API client interface. 6: - Plugin domains add only the additional functions that make sense in the plugin context. (End of file - total 6 lines) </content> <system-reminder> Instructions from: /home/byk/Code/opencode-v2-pilot/AGENTS.md - After changing the public Protocol or Server `HttpApi`, run `bun run generate` from `packages/client`. Do not edit generated client files directly. - Keep runtime dependencies directed from Schema to Core and Protocol, then from Core and Protocol to Server. ...
<path>/home/byk/Code/opencode-lore</path> <type>directory</type> <entries> .craft.yml .git/ .github/ .gitignore .jj/ .lore.md .opencode/ .oxfmtrc.json .oxlintrc.json .plans/ .sentryclirc .vendor-build/ .worktrees/ AGENTS.md CHANGELOG.md codecov.yml LICENSE local_cache/ node_modules/ package.json packages/ patches/ pnpm-lock.yaml pnpm-workspace.yaml quality/ README.md scripts/ stryker.config.mjs supabase/ tsconfig.base.json tsconfig.json vitest.config.ts vitest.evals.config.ts vitest.mutation.config.ts (34 entries) </entries>
<path>/home/byk/Code/opencode-v2-pilot</path> <type>directory</type> <entries> .changeset/ .dockerignore .editorconfig .git .gitattributes .github/ .gitignore .gitleaksignore .husky/ .opencode/ .oxlintrc.json .prettierignore .vscode/ .zed/ AGENTS.md artifacts/ bun.lock bunfig.toml CONTRIBUTING.md flake.lock flake.nix github/ infra/ install LICENSE nix/ node_modules/ package.json packages/ patches/ perf/ README.ar.md README.bn.md README.br.md README.bs.md README.da.md README.de.md README.es.md README.fr.md README.gr.md README.it.md README.ja.md README.ko.md README.md README.no.md README.pl.md README.ru.md README.th.md README.tr.md README.uk.md README.vi.md README.zh.md README.zht.md screenshot-uk.png script/ sdks/ SECURITY.md services/ specs/ sst-env.d.ts sst.config.ts STATS.md tsconfig.json turbo.json (64 entries) </entries>
<path>/home/byk/.local/share/opencode-v2-pilot/config/opencode</path> <type>directory</type> <entries> bun.lock node_modules/ opencode.json package.json plugins/ service-v2-pilot.json test/ tsconfig.json types/ (9 entries) </entries>
<path>/home/byk/Code/opencode-lore/packages/opencode</path> <type>directory</type> <entries> eval/ LICENSE node_modules/ package.json README.md scripts/ src/ test/ tsconfig.json (9 entries) </entries>
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin</path> <type>directory</type> <entries> .gitignore AGENTS.md node_modules/ package.json script/ src/ sst-env.d.ts test/ tsconfig.build.json tsconfig.json (10 entries) </entries>
<path>/home/byk/.local/share/opencode-v2-pilot/config/opencode/plugins</path> <type>directory</type> <entries> followup.ts pty.ts (2 entries) </entries>
/home/byk/Code/opencode-lore/packages/opencode/src/internal.ts /home/byk/Code/opencode-lore/packages/opencode/src/index.ts
/home/byk/Code/opencode-v2-pilot/packages/plugin/src/worktree.ts /home/byk/Code/opencode-v2-pilot/packages/plugin/src/storage.ts /home/byk/Code/opencode-v2-pilot/packages/plugin/src/source.ts /home/byk/Code/opencode-v2-pilot/packages/plugin/src/source.node.ts /home/byk/Code/opencode-v2-pilot/packages/plugin/src/source.bun.ts /home/byk/Code/opencode-v2-pilot/packages/plugin/src/rpc.ts /home/byk/Code/opencode-v2-pilot/packages/plugin/src/host.ts /home/byk/Code/opencode-v2-pilot/packages/plugin/src/tui/context.ts /home/byk/Code/opencode-v2-pilot/packages/plugin/src/tui/solid.ts /home/byk/Code/opencode-v2-pilot/packages/plugin/src/tui/plugin.ts /home/byk/Code/opencode-v2-pilot/packages/plugin/src/tui/index.ts /home/byk/Code/opencode-v2-pilot/packages/plugin/src/app.ts /home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/worktree.ts /home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/websearch.ts /home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/vcs.ts /home/byk/...
Found 100 matches (more matches available)
/home/byk/Code/opencode-v2-pilot/packages/sdk/src/tool.ts:
Line 3: export type { ToolContext as Context, Info } from "@opencode/plugin/promise/tool"
/home/byk/Code/opencode-v2-pilot/packages/sdk/src/promise.ts:
Line 4: import type { Plugin } from "@opencode/plugin"
Line 44: const { PluginPromise } = yield* Effect.promise(() => import("@opencode/core/plugin/promise"))
Line 56: const { PluginPromise } = await import("@opencode/core/plugin/promise")
/home/byk/Code/opencode-v2-pilot/packages/sdk/src/internal/instances.ts:
Line 6: import type { InstancePlugins } from "@opencode/core/plugin/instance"
/home/byk/Code/opencode-v2-pilot/packages/sdk/src/internal/host.ts:
Line 3: import { SdkPlugins } from "@opencode/core/plugin/sdk"
/home/byk/Code/opencode-v2-pilot/packages/sdk/test/instances-effect.test.ts:
Line 10: import { Plugin } from ...
/home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/warming.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/vcs/hg.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/vcs/git.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/variant.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/update.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/supervisor.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/source-directory.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/skill.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/service.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/sdk.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/provider.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/promise.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/plan.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/optimize.ts /home/byk/Code/opencode-v2-pilo...
/home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/worktree.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/websearch.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/tool-output.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/source.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/snapshot.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/skill.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/skill-file.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/shell.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/reference.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/provider.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/policy.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/mcp.ts /home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/location-watcher.ts...
Found 92 matches
/home/byk/Code/opencode-v2-pilot/packages/core/src/config/watch.ts:
Line 10: ...(sources.global ? [sources.global] : []),
/home/byk/Code/opencode-v2-pilot/packages/core/src/config/discovery.ts:
Line 6: import { Global } from "@opencode/util/global"
Line 11: export const names = ["opencode.json", "opencode.jsonc"]
Line 15: readonly global?: AbsolutePath
Line 25: const global = yield* Global.Service
Line 27: const globalDirectory = AbsolutePath.make(global.config)
Line 28: const globalAgentsDirectory = AbsolutePath.make(path.join(global.home, ".agents"))
Line 29: const globalClaudeDirectory = AbsolutePath.make(path.join(global.home, ".claude"))
Line 30: const globalRoots = yield* Effect.forEach([globalDirectory, globalClaudeDirectory, globalAgentsDirectory], (item) =>
Line 34: (yield* fs.resolve(location.directory)) === globalRoots[0] || options?.project === false
Line 39: // Resolve the parent too: missing ...
<path>/home/byk/Code/opencode-lore/packages/opencode/package.json</path>
<type>file</type>
<content>
1: {
2: "name": "@loreai/opencode",
3: "version": "0.40.0",
4: "type": "module",
5: "license": "FSL-1.1-Apache-2.0",
6: "description": "Three-tier memory architecture for OpenCode — distillation, not summarization",
7: "main": "./src/index.ts",
8: "types": "./src/index.ts",
9: "exports": {
10: ".": {
11: "types": "./src/index.ts",
12: "bun": "./src/index.ts",
13: "default": "./src/index.ts"
14: }
15: },
16: "scripts": {
17: "typecheck": "tsc --noEmit",
18: "build": "echo '@loreai/opencode ships raw TS — no build step needed'"
19: },
20: "peerDependencies": {
21: "@opencode-ai/plugin": ">=1.1.0"
22: },
23: "dependencies": {
24: "@loreai/core": "workspace:*",
25: "@loreai/gateway": "workspace:*"
26: },
27: "devDependencies": {
28: "@opencode-ai/plugin": "^1.1.39",
29: "@opencode-ai/sdk": "^1.1.39",
30: ...
<path>/home/byk/Code/opencode-lore/packages/opencode/src/index.ts</path>
<type>file</type>
<content>
1: import type { Hooks, Plugin, PluginInput } from "@opencode-ai/plugin";
2: import {
3: log,
4: getGitRemote,
5: discoverWorkspaceRoot,
6: installFetchInterceptor,
7: } from "@loreai/core";
8: // Helpers live in a separate module so they are NOT re-exported from this
9: // plugin entry. OpenCode's legacy plugin loader invokes every function
10: // exported from the entry module as a plugin; leaking these helpers pushed
11: // `undefined` into the host hooks array and crashed it on event dispatch
12: // (`undefined is not an object (evaluating 'A.event')`). See ./internal.ts.
13: import {
14: applyLoreProviderConfig,
15: gatewayAccessHeadersForRemote,
16: probeGateway,
17: shouldForwardUpstreamExtraHeader,
18: surfaceGatewayUnavailable,
19: } from "./internal";
20:
21: /**
22: * Lore plugin for OpenCode — transparent LLM proxy routing. ...
<path>/home/byk/Code/opencode-lore/packages/opencode/src/internal.ts</path> <type>file</type> <content> 1: /** 2: * Internal helpers for the Lore OpenCode plugin. 3: * 4: * These functions are intentionally kept OUT of the plugin entry module 5: * (`./index.ts`). OpenCode's legacy plugin loader treats EVERY function 6: * exported from a plugin module as a plugin instance and invokes it (see 7: * `getServerPlugin`/`getLegacyPlugins` in opencode's plugin loader). Exporting 8: * these helpers from the entry module caused them to be invoked as plugins and 9: * their return values pushed into the host's hooks array: 10: * `applyLoreProviderConfig` returns `undefined`, so the host crashed on the 11: * first hook dispatch with `undefined is not an object (evaluating 'A.event')` 12: * (the `?.` guards the `.event` property, not the `undefined` hook element). ...
<path>/home/byk/Code/opencode-lore/package.json</path>
<type>file</type>
<content>
1: {
2: "name": "lore-monorepo",
3: "private": true,
4: "type": "module",
5: "license": "FSL-1.1-Apache-2.0",
6: "description": "Monorepo root for Lore — three-tier memory architecture",
7: "main": "./packages/opencode/src/index.ts",
8: "exports": {
9: ".": "./packages/opencode/src/index.ts"
10: },
11: "packageManager": "pnpm@10.28.0",
12: "volta": {
13: "node": "24.16.0",
14: "pnpm": "10.28.0"
15: },
16: "pnpm": {
17: "onlyBuiltDependencies": [
18: "esbuild",
19: "onnxruntime-node",
20: "sharp"
21: ],
22: "overrides": {
23: "basic-ftp": "5.3.1",
24: "ip-address": "10.2.0",
25: "fast-xml-parser": "5.7.3",
26: "@huggingface/hub": "2.11.0",
27: "onnxruntime-node": "1.27.0",
28: "yaml": ">=2.8.3",
29: "esbuild": ">=0.28.1",
30: "@opentelemetry/core": ">=2.8.0",
31: "protobufjs": ...
<path>/home/byk/Code/opencode-lore/packages/core/package.json</path>
<type>file</type>
<content>
1: {
2: "name": "@loreai/core",
3: "version": "0.40.0",
4: "type": "module",
5: "license": "FSL-1.1-Apache-2.0",
6: "description": "Shared memory engine for Lore — three-tier storage, distillation, gradient context management",
7: "main": "./dist/node/index.js",
8: "types": "./dist/node/index.d.ts",
9: "exports": {
10: ".": {
11: "types": "./dist/types/index.d.ts",
12: "development": "./src/index.ts",
13: "bun": "./dist/bun/index.js",
14: "default": "./dist/node/index.js"
15: }
16: },
17: "imports": {
18: "#db/driver": {
19: "bun": "./src/db/driver.bun.ts",
20: "default": "./src/db/driver.node.ts"
21: }
22: },
23: "scripts": {
24: "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.eval.json",
25: "build": "tsx script/build.ts"
26: },
27: "dependencies": {
28: "@hpke/core": "^1.9.0",
29: ...
<path>/home/byk/Code/opencode-lore/packages/gateway/package.json</path>
<type>file</type>
<content>
1: {
2: "name": "@loreai/gateway",
3: "version": "0.40.0",
4: "type": "module",
5: "license": "FSL-1.1-Apache-2.0",
6: "description": "Lore as a transparent LLM proxy — context management for any AI coding client",
7: "main": "./dist/index.cjs",
8: "types": "./dist/index.d.cts",
9: "exports": {
10: ".": {
11: "types": "./dist/index.d.cts",
12: "bun": "./dist/index.bun.js",
13: "require": "./dist/index.cjs",
14: "default": "./dist/index.cjs"
15: }
16: },
17: "bin": {
18: "lore": "./dist/bin.cjs",
19: "lore-gateway": "./dist/bin.cjs"
20: },
21: "scripts": {
22: "typecheck": "tsc --noEmit",
23: "build": "tsx script/build.ts",
24: "bundle": "tsx script/bundle.ts",
25: "build:binary": "tsx script/build.ts --binary",
26: "build:binary:sea": "tsx script/build-binary-sea.ts",
27: "start": "tsx ...
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin/package.json</path>
<type>file</type>
<content>
1: {
2: "$schema": "https://json.schemastore.org/package.json",
3: "name": "@opencode/plugin",
4: "version": "1.18.15",
5: "type": "module",
6: "license": "MIT",
7: "scripts": {
8: "test": "bun test --only-failures",
9: "typecheck": "tsgo --noEmit",
10: "build": "tsc -p tsconfig.build.json"
11: },
12: "exports": {
13: ".": "./src/promise/index.ts",
14: "./effect": "./src/effect/index.ts",
15: "./host": "./src/host.ts",
16: "./tui": "./src/tui/index.ts",
17: "./*": "./src/*.ts"
18: },
19: "imports": {
20: "#plugin-source": {
21: "bun": "./src/source.bun.ts",
22: "node": "./src/source.node.ts",
23: "default": "./src/source.node.ts"
24: }
25: },
26: "files": [
27: "dist"
28: ],
29: "dependencies": {
30: "@ai-sdk/provider": "3.0.8",
31: "@opencode/ai": "workspace:*",
32: ...
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/index.ts</path>
<type>file</type>
<content>
1: export type { PluginOptions } from "../options.js"
2: export type { StorageEntry, StorageScanOptions, StorageScanResult } from "../storage.js"
3: export * as Plugin from "./plugin.js"
4:
5: export { Agent } from "@opencode/schema/agent"
6: export { Command } from "@opencode/schema/command"
7: export { Connection } from "@opencode/schema/connection"
8: export { Credential } from "@opencode/schema/credential"
9: export { Integration } from "@opencode/schema/integration"
10: export { Location } from "@opencode/schema/location"
11: export { Mcp } from "@opencode/schema/mcp"
12: export { Model } from "@opencode/schema/model"
13: export { PersistentPty } from "@opencode/schema/persistent-pty"
14: export { Provider } from "@opencode/schema/provider"
15: export { Reference } from "@opencode/schema/reference"
16: export { Rpc } from "@opencode/schema/rpc"
17: export { Skill } from ...
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/plugin.ts</path>
<type>file</type>
<content>
1: import type { OpenCodeClient } from "@opencode/client"
2: import type { GenerateApi, PluginApi } from "@opencode/client/promise/api"
3: import type { Location } from "@opencode/schema/location"
4: import type { PluginOptions } from "../options.js"
5: import type { App } from "../app.js"
6: import type { AgentDomain } from "./agent.js"
7: import type { AISDKDomain } from "./aisdk.js"
8: import type { CatalogDomain } from "./catalog.js"
9: import type { CommandDomain } from "./command.js"
10: import type { EventDomain } from "./event.js"
11: import type { IntegrationDomain } from "./integration.js"
12: import type { MCPDomain } from "./mcp.js"
13: import type { PermissionDomain } from "./permission.js"
14: import type { ReferenceDomain } from "./reference.js"
15: import type { RpcDomain } from "./rpc.js"
16: import type { SessionDomain } from "./session.js"
17: import type ...
<path>/home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/promise.ts</path>
<type>file</type>
<content>
1: export * as PluginPromise from "./promise.js"
2:
3: export { fromPromise } from "@opencode/plugin/promise/adapter"
(End of file - total 3 lines)
</content>
<path>/home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/module.ts</path>
<type>file</type>
<content>
1: export * as PluginModule from "./module.js"
2:
3: import type { Plugin } from "@opencode/plugin/effect/plugin"
4: import { Host } from "@opencode/plugin/host"
5: import { createPluginSources } from "@opencode/plugin/source"
6: import { Npm } from "@opencode/util/npm"
7: import { Deferred, Effect, FiberSet, PubSub, Schema, Stream } from "effect"
8: import path from "path"
9: import { stat } from "node:fs/promises"
10: import { fileURLToPath, pathToFileURL } from "url"
11: import type { ConfigPluginSource } from "../config/plugin/source.js"
12: import type { Generation } from "../plugin.js"
13: import { PluginPromise } from "./promise.js"
14: import { Watcher } from "../filesystem/watcher.js"
15:
16: export const make = Effect.fn("PluginModule.make")(function* () {
17: const watcher = yield* Watcher.Service
18: const scope = yield* Effect.scope
19: const runPromise = ...
<path>/home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/source-directory.ts</path>
<type>file</type>
<content>
1: export * as PluginSourceDirectory from "./source-directory.js"
2:
3: import { FSUtil } from "@opencode/util/fs-util"
4: import { Effect, Option } from "effect"
5: import path from "path"
6:
7: export const names = ["plugin", "plugins"] as const
8:
9: export const discover = Effect.fn("PluginSourceDirectory.discover")(function* (
10: fs: FSUtil.Interface,
11: directory: string,
12: ) {
13: const children = (yield* Effect.forEach(names, (source) =>
14: fs.readDirectoryEntries(path.join(directory, source)).pipe(
15: Effect.orElseSucceed(() => []),
16: Effect.map((entries) => entries.map((entry) => ({ ...entry, target: path.join(directory, source, entry.name) }))),
17: ),
18: ))
19: .flat()
20: .sort((a, b) => (a.target < b.target ? -1 : a.target > b.target ? 1 : 0))
21: const targets = yield* Effect.forEach(children, (entry) ...
<path>/home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/source.ts</path>
<type>file</type>
<content>
1: export * as ConfigPluginSource from "./source.js"
2:
3: import { Directory, Document, type Entry } from "@opencode/schema/config"
4: import { ConfigPlugin } from "@opencode/schema/config/plugin"
5: import { FSUtil } from "@opencode/util/fs-util"
6: import { Host } from "@opencode/plugin/host"
7: import { makeLocationNode } from "@opencode/util/effect/app-node"
8: import { Context, Effect, Layer, Option, PubSub, Scope, Stream } from "effect"
9: import path from "path"
10: import { fileURLToPath, pathToFileURL } from "url"
11: import { Config } from "../../config.js"
12: import { Watcher } from "../../filesystem/watcher.js"
13: import { Location } from "../../location.js"
14: import { PluginSourceDirectory } from "../../plugin/source-directory.js"
15:
16: export type Operation =
17: | {
18: readonly type: "add"
19: readonly target: string
20: ...
<path>/home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/supervisor.ts</path>
<type>file</type>
<content>
1: export * as PluginSupervisor from "./supervisor.js"
2:
3: import { Event } from "@opencode/schema/config"
4: import { Cause, Effect, Layer, Queue, Stream } from "effect"
5: import path from "path"
6: import { ConfigPluginSource } from "../config/plugin/source.js"
7: import { makeLocationNode } from "@opencode/util/effect/app-node"
8: import { Bus } from "../bus.js"
9: import { Npm } from "@opencode/util/npm"
10: import { Plugin } from "../plugin.js"
11: import { InstancePlugins } from "./instance.js"
12: import { PluginInternal } from "./internal.js"
13: import { PluginModule } from "./module.js"
14: import { SdkPlugins } from "./sdk.js"
15: import { PluginUpdate } from "./update.js"
16: import { Watcher } from "../filesystem/watcher.js"
17:
18: const resolve = Effect.fn("PluginSupervisor.resolve")(function* (
19: modules: Effect.Success<ReturnType<typeof ...
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/adapter.ts</path>
<type>file</type>
<content>
1: import { Tool } from "@opencode/schema/tool"
2: import type { Rpc } from "@opencode/schema/rpc"
3: import type { RpcCallOptions, RpcEventPayload } from "@opencode/client/promise/api"
4: import { Effect, Schema, SchemaAST, Stream } from "effect"
5: import type { Scope } from "effect"
6: import { HttpApiEndpoint, HttpApiSchema } from "effect/unstable/httpapi"
7: import { define } from "../effect/plugin.js"
8: import type { Plugin } from "./plugin.js"
9: import type { Info } from "./tool.js"
10: import type { RpcDomain, RpcHandlers } from "./rpc.js"
11:
12: type HostRegistration = { readonly dispose: Effect.Effect<void> }
13: type Registration = { readonly dispose: () => Promise<void> }
14: type PromiseContext = Parameters<Plugin["setup"]>[0]
15: type PromiseEvent = ReturnType<PromiseContext["event"]["subscribe"]> extends AsyncIterable<infer Event> ? ...
The static activation check already matches the prior inventory: the isolated config has only plugins/followup.ts and plugins/pty.ts. The V2 loader also rejects Lore’s current entrypoint before setup because V2 requires one default { id, setup } or { id, effect } definition, while Lore exports a legacy plugin function.
[
{
"content": "Inspect repository guidance and relevant manifests, exports, configs, and candidate state",
"status": "in_progress",
"priority": "high"
},
{
"content": "Trace Lore plugin entrypoint, dependencies, hooks, APIs, and startup assumptions",
"status": "in_progress",
"priority": "high"
},
{
"content": "Trace V2 plugin discovery, loader, and Promise plugin contracts",
"status": "pending",
"priority": "high"
},
{
"content": "Compare both sides and classify every concrete incompatibility",
"status": "pending",
"priority": "high"
},
{
"content": "Define the smallest viable port and complete validation sequence",
"status": "pending",
"priority": "medium"
},
{
"content": "Prepare a concise evidence-based compatibility report",
"status": "pending",
"priority": "high"
}
]
<path>/home/byk/.local/share/opencode-v2-pilot/config/opencode/opencode.json</path>
<type>file</type>
<content>
1: {
2: "$schema": "https://opencode.ai/config.json"
3: }
(End of file - total 3 lines)
</content>
<path>/home/byk/.local/share/opencode-v2-pilot/config/opencode/package.json</path>
<type>file</type>
<content>
1: {
2: "private": true,
3: "type": "module",
4: "dependencies": {
5: "effect": "file:/home/byk/Code/opencode-v2-pilot/node_modules/.bun/effect@4.0.0-rc.112/node_modules/effect"
6: },
7: "devDependencies": {
8: "@types/bun": "1.2.21"
9: }
10: }
(End of file - total 10 lines)
</content>
No files found
Found 100 matches (more matches available)
/home/byk/.local/share/opencode-v2-pilot/config/opencode/opencode.json:
Line 2: "$schema": "https://opencode.ai/config.json"
/home/byk/.local/share/opencode-v2-pilot/config/opencode/test/pty.test.ts:
Line 2: import { createPtyPlugin } from "../plugins/pty.ts"
Line 11: describe("pty", () => {
Line 14: expect(harness.toolNames).toEqual(["pty_spawn", "pty_write", "pty_read", "pty_list", "pty_kill"])
Line 26: await expect(harness.execute("pty_spawn", {
Line 36: await expect(harness.execute("pty_spawn", {
Line 43: const spawned = await harness.execute("pty_spawn", {
Line 49: await expect(harness.execute("pty_write", { id, data: "\\uD800" })).rejects.toThrow("well-formed Unicode")
Line 55: const spawned = await harness.execute("pty_spawn", {
Line 61: await harness.execute("pty_write", { id, data: "hello\\n" })
Line 63: const read = JSON.parse((await harness.execute("pty_read", { id })).output)
...
<path>/home/byk/.local/share/opencode-v2-pilot/config/opencode/plugins/followup.ts</path>
<type>file</type>
<content>
1: import { Plugin } from "@opencode/plugin"
2: import { Schema } from "effect"
3:
4: const SUBAGENT_REFUSAL =
5: "Error: scheduled follow-ups are disabled in subagents. A subagent must finish its task and return a result synchronously."
6:
7: const DelayInput = Schema.Struct({
8: delay: Schema.String.annotate({
9: description: "How long to wait, such as 30s, 2m, or 1h. A bare number means seconds.",
10: }),
11: message: Schema.String.annotate({
12: description: "The instruction to deliver when the delay expires.",
13: }),
14: })
15:
16: const EmptyInput = Schema.Struct({})
17:
18: const CancelInput = Schema.Struct({
19: id: Schema.String.annotate({ description: "The follow-up ID to cancel, or all." }),
20: })
21:
22: export default Plugin.define({
23: id: "followup",
24: async setup(ctx) {
25: const pending = new Map<
26: string,
27: ...
<path>/home/byk/.local/share/opencode-v2-pilot/config/opencode/plugins/pty.ts</path>
<type>file</type>
<content>
1: import { Plugin } from "@opencode/plugin"
2: import type { Context } from "@opencode/plugin/plugin"
3: import type { ToolContext } from "@opencode/plugin/tool"
4: import { Schema } from "effect"
5: import { spawn } from "node:child_process"
6: import { open, realpath } from "node:fs/promises"
7: import type { FileHandle } from "node:fs/promises"
8: import { constants } from "node:fs"
9: import { Readable } from "node:stream"
10: import { StringDecoder } from "node:string_decoder"
11:
12: type PtyPluginOptions = {
13: openProcess?: typeof openPtyProcess
14: spawnTimeoutMs?: number
15: }
16:
17: const MAX_SESSIONS = 16
18: const MAX_SESSIONS_PER_OWNER = 5
19: const DEFAULT_READ_LIMIT = 500
20: const MAX_READ_LIMIT = 2_000
21: const MAX_READ_OFFSET = 10_000
22: const MAX_LINE_LENGTH = 2_000
23: const MAX_PATTERN_LENGTH = 500
24: const MAX_WRITE_SIZE = 65_536
25: const ...
<path>/home/byk/.local/share/opencode-v2-pilot/config/opencode/plugins/pty.ts</path>
<type>file</type>
<content>
835: grep.on("error", fail)
836: grep.on("exit", (code, signal) => {
837: settled = true
838: clearTimeout(timer)
839: if (signal === "SIGKILL") return fail(new Error("PTY output pattern timed out."))
840: if (code === 1) return done("")
841: if (code !== 0) return fail(new Error(Buffer.concat(stderr).toString() || `grep exited with code ${code}`))
842: return done(Buffer.concat(stdout).toString())
843: })
844: grep.stdin.end(input)
845: })
846: return output.split("\n").flatMap((value) => {
847: if (!value) return []
848: const separator = value.indexOf(":")
849: if (separator === -1) throw new Error("Unexpected grep output")
850: return [{ line: Number(value.slice(0, separator)), text: value.slice(separator + 1) }]
851: })
852: }
(End of file - total 852 lines)
</content>
Found 1 matches /home/byk/.local/share/opencode-v2-pilot/config/opencode/plugins/pty.ts: Line 493: export default createPtyPlugin()
hostname port password
Found 100 matches (more matches available)
/home/byk/Code/opencode-v2-pilot/packages/sdk/test/promise.test.ts:
Line 9: const config = join(directory.path, "config")
Line 38: const config = join(directory.path, "config")
Line 55: const config = join(directory.path, "config")
/home/byk/Code/opencode-v2-pilot/packages/sdk/test/embedded.test.ts:
Line 404: const configDirectory = path.join(fixture.directory, "config")
Line 505: const configDirectory = path.join(fixture.directory, "config")
/home/byk/Code/opencode-v2-pilot/packages/sdk/src/internal/workerd.ts:
Line 8: export interface Options extends Omit<ServerWorkerd.Options, "password" | "config"> {
/home/byk/Code/opencode-v2-pilot/packages/protocol/src/client.ts:
Line 67: "server.config": "config",
/home/byk/Code/opencode-v2-pilot/packages/protocol/src/groups/config.ts:
Line 22: .annotateMerge(OpenApi.annotations({ title: "config", description: "Location-scoped configuration routes." ...
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/aisdk.ts</path>
<type>file</type>
<content>
1: import type { LanguageModelV3 } from "@ai-sdk/provider"
2: import type { Model } from "@opencode/schema/model"
3: import type { ModelHooks } from "./registration.js"
4:
5: export interface AISDKHooks {
6: sdk: {
7: readonly model: Model.Info
8: readonly package: string
9: readonly options: Record<string, any>
10: sdk?: any
11: }
12: language: {
13: readonly model: Model.Info
14: readonly sdk: any
15: readonly options: Record<string, any>
16: language?: LanguageModelV3
17: }
18: }
19:
20: export interface AISDKDomain {
21: readonly hook: ModelHooks<AISDKHooks>
22: }
(End of file - total 22 lines)
</content>
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/registration.ts</path>
<type>file</type>
<content>
1: export interface Registration {
2: readonly dispose: () => Promise<void>
3: }
4:
5: export interface ModelHookOptions {
6: /** Limits the hook to one provider. Unscoped hooks apply to every provider. */
7: readonly providerID?: string
8: }
9:
10: export type Hooks<Spec> = <Name extends keyof Spec>(
11: name: Name,
12: callback: (input: Spec[Name]) => Promise<void> | void,
13: ) => Promise<Registration>
14:
15: export type ModelHooks<Spec> = <Name extends keyof Spec>(
16: name: Name,
17: callback: (input: Spec[Name]) => Promise<void> | void,
18: options?: Spec[Name] extends { readonly model: unknown } ? ModelHookOptions : never,
19: ) => Promise<Registration>
20:
21: export type Transform<Input> = (callback: (input: Input) => void) => Promise<Registration>
(End of file - total 21 lines)
</content>
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/session.ts</path>
<type>file</type>
<content>
1: import type { SessionApi } from "@opencode/client/promise/api"
2: import type { GenerationOptionsFields, Message, SystemPart } from "@opencode/ai"
3: import type { Agent } from "@opencode/schema/agent"
4: import type { Model } from "@opencode/schema/model"
5: import type { PromptInput } from "@opencode/schema/prompt-input"
6: import type { Session } from "@opencode/schema/session"
7: import type { SessionInbox } from "@opencode/schema/session-inbox"
8: import type { SessionError } from "@opencode/schema/session-error"
9: import type { SessionMessage } from "@opencode/schema/session-message"
10: import type { JsonSchema, Types } from "effect"
11: import type { ModelHooks } from "./registration.js"
12:
13: export interface SessionPrompt {
14: readonly sessionID: Session.ID
15: readonly messageID: SessionMessage.ID
16: prompt: ...
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/agent.ts</path>
<type>file</type>
<content>
1: import type { AgentApi } from "@opencode/client/promise/api"
2: import type { Agent } from "@opencode/schema/agent"
3: import type { Transform } from "./registration.js"
4: import type { DeepMutable } from "./types.js"
5:
6: export interface AgentEditor {
7: list(): readonly DeepMutable<Agent.Info>[]
8: get(id: string): DeepMutable<Agent.Info> | undefined
9: default(id: string | undefined): void
10: update(id: string, update: (agent: DeepMutable<Agent.Info>) => void): void
11: remove(id: string): void
12: }
13:
14: export interface AgentDomain extends AgentApi {
15: readonly transform: Transform<AgentEditor>
16: readonly reload: () => Promise<void>
17: }
(End of file - total 17 lines)
</content>
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/catalog.ts</path>
<type>file</type>
<content>
1: import type { CatalogApi } from "@opencode/client/promise/api"
2: import type { Model } from "@opencode/schema/model"
3: import type { Provider } from "@opencode/schema/provider"
4: import type { Transform } from "./registration.js"
5: import type { DeepMutable } from "./types.js"
6:
7: export interface CatalogProviderRecord {
8: readonly provider: DeepMutable<Provider.Info>
9: readonly models: ReadonlyMap<string, DeepMutable<Model.Info>>
10: }
11:
12: export interface CatalogEditor {
13: readonly provider: {
14: list(): readonly CatalogProviderRecord[]
15: get(providerID: string): CatalogProviderRecord | undefined
16: update(providerID: string, update: (provider: DeepMutable<Provider.Info>) => void): void
17: remove(providerID: string): void
18: }
19: readonly model: {
20: get(providerID: string, modelID: string): DeepMutable<Model.Info> ...
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/event.ts</path>
<type>file</type>
<content>
1: import type { EventApi } from "@opencode/client/promise/api"
2:
3: export interface EventDomain extends Pick<EventApi, "subscribe"> {}
(End of file - total 3 lines)
</content>
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/tool.ts</path>
<type>file</type>
<content>
1: export { CallID, Error } from "@opencode/schema/tool"
2: export type { Metadata, Options, Result } from "@opencode/schema/tool"
3:
4: import { Tool } from "@opencode/schema/tool"
5: import type { Agent } from "@opencode/schema/agent"
6: import type { Session } from "@opencode/schema/session"
7: import type { SessionMessage } from "@opencode/schema/session-message"
8: import type { Types } from "effect"
9: import type { Hooks, Transform } from "./registration.js"
10:
11: export interface ToolContext extends Omit<Tool.Context, "progress"> {
12: readonly progress: (update: Tool.Metadata) => Promise<void>
13: }
14:
15: export type Info<
16: Input extends Tool.ValueSchema<any> = Tool.ValueSchema<any>,
17: Output extends Tool.ValueSchema<any> | undefined = Tool.ValueSchema<any> | undefined,
18: > = Omit<Tool.Info<Input, Output>, "execute"> & {
19: readonly execute: ...
Found 100 matches (more matches available)
/home/byk/Code/opencode-lore/packages/pi/test/internal.test.ts:
Line 57: expect(reg.headers["x-lore-session-id"]).toBe("sess-2");
Line 59: expect(reg.headers["x-lore-provider"]).toBe(reg.provider);
Line 203: expect((init.headers as Record<string, string>)["x-lore-session-id"]).toBe(
/home/byk/Code/opencode-lore/packages/pi/test/extension.e2e.test.ts:
Line 158: expect(r.config.headers["x-lore-provider"]).toBe(r.name);
Line 159: expect(r.config.headers["x-lore-session-id"]).toBeTypeOf("string");
Line 178: const sid = after[0].config.headers["x-lore-session-id"];
/home/byk/Code/opencode-lore/packages/pi/src/internal.ts:
Line 311: "x-lore-session-id": sessionID,
Line 315: "x-lore-provider": provider,
Line 388: "x-lore-session-id": sessionID,
/home/byk/Code/opencode-lore/packages/pi/src/index.ts:
Line 137: "x-lore-session-id": currentSessionID,
Line ...
Found 75 matches
/home/byk/Code/opencode-v2-pilot/packages/sdk/test/instances.test.ts:
Line 38: await ctx.session.hook("prompt", (event) => {
Line 166: await ctx.session.hook("prompt", (event) => {
Line 242: await ctx.session.hook("prompt", (event) => {
Line 325: await ctx.session.hook("prompt", (event) => {
/home/byk/Code/opencode-v2-pilot/packages/sdk/test/instances-effect.test.ts:
Line 70: yield* ctx.session.hook("context", (event) =>
Line 180: yield* ctx.session.hook("prompt", (event) =>
Line 268: ctx.session.hook("prompt", (event) =>
/home/byk/Code/opencode-v2-pilot/packages/sdk/script/verify-package.ts:
Line 125: await ctx.session.hook("prompt", event => {
/home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/session.ts:
Line 79: readonly "model.request": SessionModelRequest
Line 80: ...
<path>/home/byk/Code/opencode-v2-pilot/packages/core/src/session/model-request.ts</path>
<type>file</type>
<content>
180: return Message.text(IMAGE_REMOVED)
181: }
182: if (part.type !== "tool-result" || part.result.type !== "content") return part
183: return {
184: ...part,
185: result: {
186: ...part.result,
187: value: part.result.value.map((item: Content) => {
188: if (item.type !== "file" || !isImage(item.mime) || imageBytes - removed <= IMAGE_BYTES_TARGET) return item
189: removed += Buffer.byteLength(item.uri)
190: return { type: "text" as const, text: IMAGE_REMOVED }
191: }),
192: },
193: }
194: }),
195: }),
196: )
197: }
198:
199: /** The identity a plugin hook sees for one outbound request. */
200: interface HookScope {
201: readonly sessionID: SessionSchema.ID
202: readonly agent: Agent.ID
203: readonly ...
<path>/home/byk/Code/opencode-v2-pilot/packages/schema/src/location.ts</path>
<type>file</type>
<content>
1: export * as Location from "./location.js"
2:
3: import { Schema } from "effect"
4: import { AbsolutePath, optional } from "./schema.js"
5: import { ProjectID } from "./project-id.js"
6: import { WorkspaceID } from "./workspace-id.js"
7:
8: export interface Ref extends Schema.Schema.Type<typeof Ref> {}
9: export const Ref = Schema.Struct({
10: directory: AbsolutePath,
11: workspaceID: optional(WorkspaceID),
12: }).annotate({ identifier: "Location.Ref" })
13:
14: export class Info extends Schema.Class<Info>("Location.Info")({
15: directory: AbsolutePath,
16: workspaceID: optional(WorkspaceID),
17: project: Schema.Struct({
18: id: ProjectID,
19: directory: AbsolutePath,
20: canonical: AbsolutePath,
21: }),
22: }) {}
23:
24: export function response<S extends Schema.Top>(data: S) {
25: return Schema.Struct({ location: Info, data })
26: }
(End of file ...
<path>/home/byk/Code/opencode-v2-pilot/packages/client/src/promise/api.ts</path>
<type>file</type>
<content>
1: import type { OpenCode } from "./client.js"
2:
3: type Client = ReturnType<typeof OpenCode.make>
4:
5: export type { RpcApi, RpcCallOptions, RpcClient, RpcEventPayload } from "./rpc.js"
6:
7: export type AgentApi = Client["agent"]
8: export type CommandApi = Client["command"]
9: export type ConfigApi = Client["config"]
10: export type EventApi = Client["event"]
11: export type GenerateApi = Client["generate"]
12: export type IntegrationApi = Client["integration"]
13: export type McpApi = Client["mcp"]
14: export type ModelApi = Client["model"]
15: export type PluginApi = Client["plugin"]
16: export type PermissionApi = Client["permission"]
17: export type ProviderApi = Client["provider"]
18: export type ReferenceApi = Client["reference"]
19: export type WebSearchApi = Client["websearch"]
20: export type SessionApi = Client["session"]
21: export type SkillApi = ...
<path>/home/byk/Code/opencode-v2-pilot/packages/protocol/src/groups/session.ts</path>
<type>file</type>
<content>
1: import { SessionMessage } from "@opencode/schema/session-message"
2: import { SessionTransfer } from "@opencode/schema/session-transfer"
3: import { SessionInbox } from "@opencode/schema/session-inbox"
4: import { PromptInput } from "@opencode/schema/prompt-input"
5: import { Session } from "@opencode/schema/session"
6: import { SessionStats } from "@opencode/schema/session-stats"
7: import { InstructionEntry } from "@opencode/schema/instruction-entry"
8: import { Project } from "@opencode/schema/project"
9: import { AbsolutePath, NonNegativeInt, PositiveInt, RelativePath, statics } from "@opencode/schema/schema"
10: import { Event } from "@opencode/schema/event"
11: import { Workspace } from "@opencode/schema/workspace"
12: import { Context, Effect, Encoding, Result, Schema, SchemaGetter, Struct } from "effect"
13: import { HttpApiEndpoint, HttpApiGroup, ...
Found 18 matches
/home/byk/Code/opencode-v2-pilot/packages/schema/src/session.ts:
Line 32: export const Info = Schema.Struct({
Line 34: parentID: ID.pipe(optional),
Line 39: projectID: Project.ID,
Line 40: agent: Agent.ID.pipe(optional),
Line 41: model: Model.Ref.pipe(optional),
/home/byk/Code/opencode-v2-pilot/packages/schema/src/v1/session.ts:
Line 209: agent: Schema.String,
Line 210: model: Schema.optional(
Line 346: agent: Schema.String,
Line 347: model: Schema.Struct({
Line 442: agent: Schema.String,
Line 443: model: Schema.optional(
Line 461: parentID: MessageID,
Line 465: agent: Schema.String,
Line 490: export const Info = Schema.Union([User, Assistant]).annotate({ discriminator: "role", identifier: "SessionV1.Message" })
Line 546: projectID: Project.ID,
Line 550: parentID: optional(SessionID),
Line 556: agent: optional(Schema.String),
Line 557: model: optional(SessionModel),
<path>/home/byk/Code/opencode-v2-pilot/packages/schema/src/session.ts</path>
<type>file</type>
<content>
1: export * as Session from "./session.js"
2:
3: import { Schema } from "effect"
4: import { Agent } from "./agent.js"
5: import { Location } from "./location.js"
6: import { Model } from "./model.js"
7: import { Project } from "./project.js"
8: import { DateTimeUtcFromMillis, optional, RelativePath } from "./schema.js"
9: import { SessionEvent } from "./session-event.js"
10: import { SessionID } from "./session-id.js"
11: import { SessionMetadata } from "./session-metadata.js"
12: import { Money } from "./money.js"
13: import { TokenUsage } from "./token-usage.js"
14: import { Revert } from "./session-revert.js"
15: import { SessionFork } from "./session-fork.js"
16:
17: export const ID = SessionID
18: export type ID = SessionID
19:
20: export const Metadata = SessionMetadata
21: export type Metadata = SessionMetadata
22:
23: export const Event = SessionEvent
24:
25: export { ...
Found 13 matches
/home/byk/Code/opencode-v2-pilot/packages/schema/src/model.ts:
Line 14: export const Ref = Schema.Struct({
Line 16: providerID: Provider.ID,
Line 25: const providerID = input.slice(0, providerEnd)
Line 29: if (!id || providerID.includes("#") || (variant !== undefined && (!variant || variant.includes("#"))))
Line 32: providerID: Provider.ID.make(providerID),
Line 39: export interface Ref extends Schema.Schema.Type<typeof Ref> {}
Line 102: modelID: ID,
Line 103: providerID: Provider.ID,
Line 128: default: (providerID: Provider.ID, id: ID) =>
Line 131: modelID: id,
Line 132: providerID,
/home/byk/Code/opencode-v2-pilot/packages/schema/src/config/model.ts:
Line 13: providerID: ProviderID,
Line 33: providerID: ref.providerID,
<path>/home/byk/Code/opencode-v2-pilot/packages/schema/src/model.ts</path>
<type>file</type>
<content>
1: export * as Model from "./model.js"
2:
3: import { Schema } from "effect"
4: import { optional, statics } from "./schema.js"
5: import { Provider } from "./provider.js"
6: import { Money } from "./money.js"
7:
8: export const ID = Schema.String.pipe(Schema.brand("Model.ID"))
9: export type ID = typeof ID.Type
10:
11: export const VariantID = Schema.String.pipe(Schema.brand("Model.VariantID"))
12: export type VariantID = typeof VariantID.Type
13:
14: export const Ref = Schema.Struct({
15: id: ID,
16: providerID: Provider.ID,
17: variant: VariantID.pipe(optional),
18: })
19: .annotate({ identifier: "Model.Ref" })
20: .pipe(
21: statics((schema) => ({
22: parse: (input: string) => {
23: const providerEnd = input.indexOf("/")
24: if (providerEnd <= 0) throw new Error(`Invalid model reference: ${input}`)
25: const providerID = ...
Found 13 matches /home/byk/Code/opencode-v2-pilot/packages/sdk/package.json: Line 33: "@opencode/plugin": "workspace:*", /home/byk/Code/opencode-v2-pilot/packages/plugin-browser/package.json: Line 30: "@opencode/plugin": "workspace:*", /home/byk/Code/opencode-v2-pilot/packages/latex/package.json: Line 16: "@opencode/plugin": "workspace:*", /home/byk/Code/opencode-v2-pilot/packages/enterprise/package.json: Line 19: "@opencode-ai/sdk": "1.18.21", /home/byk/Code/opencode-v2-pilot/github/package.json: Line 18: "@opencode-ai/sdk": "1.18.5" /home/byk/Code/opencode-v2-pilot/packages/core/package.json: Line 122: "@opencode/plugin": "workspace:*", /home/byk/Code/opencode-v2-pilot/package.json: Line 132: "@opencode/plugin": "workspace:*", /home/byk/Code/opencode-v2-pilot/packages/simulation/package.json: Line 34: "@opencode/plugin": "workspace:*", /home/byk/Code/opencode-v2-pilot/packages/server/package.json: Line 40: ...
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin/src/host.ts</path>
<type>file</type>
<content>
1: export * as Host from "./host.js"
2:
3: import path from "node:path"
4: import { importModule, resolveModule } from "@opencode/util/runtime-import"
5:
6: export interface Target {
7: readonly directory: string
8: readonly name?: string
9: }
10:
11: export interface Entrypoints {
12: readonly server?: string
13: readonly tui?: string
14: readonly rpc?: string
15: }
16:
17: export function resolve(target: Target): Entrypoints {
18: const entry = (subpaths: readonly string[]) => {
19: for (const subpath of subpaths) {
20: const specifier = target.name
21: ? [target.name, subpath].filter(Boolean).join("/")
22: : path.resolve(target.directory, subpath || "index")
23: try {
24: return resolveModule(specifier, target.directory)
25: } catch (error) {
26: if (
27: !(error instanceof Error) ||
28: ...
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin/src/source.node.ts</path>
<type>file</type>
<content>
1: import { registerHooks } from "node:module"
2: import path from "node:path"
3: import { fileURLToPath } from "node:url"
4: import { localSource } from "./source.js"
5: import { Host } from "./host.js"
6:
7: let generation = Date.now()
8:
9: export async function prepareSource(entrypoint: string, track: (file: string, directory?: boolean) => void) {
10: const version = String(++generation)
11: const fresh = (specifier: string) => {
12: const url = new URL(specifier)
13: url.searchParams.set("__opencode_reload", version)
14: return url.href
15: }
16: const hook = registerHooks({
17: resolve(specifier, context, nextResolve) {
18: if (!context.parentURL || new URL(context.parentURL).searchParams.get("__opencode_reload") !== version)
19: return nextResolve(specifier, context)
20: const local =
21: specifier.startsWith("./") || ...
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin/src/source.bun.ts</path>
<type>file</type>
<content>
1: import { createRequire } from "node:module"
2: import { readFileSync } from "node:fs"
3: import path from "node:path"
4: import { fileURLToPath, pathToFileURL } from "node:url"
5: import { Host } from "./host.js"
6: import { localSource } from "./source.js"
7:
8: let generation = Date.now()
9:
10: export async function prepareSource(entrypoint: string, track: (file: string, directory?: boolean) => void) {
11: const root = fileURLToPath(entrypoint)
12: const files = new Set<string>()
13: const visit = (file: string, search = "") => {
14: if (file !== root && file.split(path.sep).includes("node_modules")) return
15: if (search) delete require.cache[file + search]
16: if (files.has(file)) return
17: files.add(file)
18: // Bun exposes ESM here too. ...
<path>/home/byk/.local/share/opencode-v2-pilot/config/opencode/node_modules</path> <type>directory</type> <entries> .bin/ @msgpackr-extract/ @protobufjs/ @types/ ajv-draft-04/ ajv/ ast-types/ bun-pty/ bun-types/ csstype/ detect-libc/ effect/ fast-check/ fast-deep-equal/ fast-uri/ immer/ json-schema-traverse/ long/ msgpackr-extract/ msgpackr/ node-gyp-build-optional-packages/ protobufjs/ pure-rand/ require-from-string/ tinybench/ tslib/ undici-types/ valibot/ (28 entries) </entries>
<path>/home/byk/Code/opencode-v2-pilot/packages/schema/src/config/plugin.ts</path>
<type>file</type>
<content>
1: export * as ConfigPlugin from "./plugin.js"
2:
3: import { Schema } from "effect"
4: import { optional } from "../schema.js"
5:
6: export class Entry extends Schema.Class<Entry>("Config.Plugin.Entry")({
7: package: Schema.String,
8: options: Schema.Record(Schema.String, Schema.Unknown).pipe(optional),
9: }) {}
10:
11: export const Plugin = Schema.Union([Schema.String, Entry])
12: export type Plugin = typeof Plugin.Type
13:
14: export const Plugins = Plugin.pipe(Schema.Array)
(End of file - total 14 lines)
</content>
No files found
Found 3 matches
/home/byk/Code/opencode-v2-pilot/packages/schema/src/config.ts:
Line 99: plugins: ConfigPlugin.Plugins.pipe(optional).annotate({
Line 112: export class Document extends Schema.Class<Document>("Config.Document")({
Line 133: export const Entry = Schema.Union([Document, Directory, AgentsDirectory, ClaudeDirectory]).annotate({
<path>/home/byk/Code/opencode-v2-pilot/packages/schema/src/config.ts</path>
<type>file</type>
<content>
80: }),
81: compaction: ConfigCompaction.Info.pipe(optional).annotate({
82: description: "Conversation compaction behavior",
83: }),
84: skills: Schema.String.pipe(Schema.Array, optional).annotate({
85: description: "Additional paths or URLs to discover skills from",
86: }),
87: commands: Schema.Record(Schema.String, ConfigCommand.Info).pipe(optional).annotate({
88: description: "Named slash command definitions",
89: }),
90: instructions: Schema.String.pipe(Schema.Array, optional).annotate({
91: description: "Additional paths or URLs supplying ambient instructions",
92: }),
93: references: ConfigReference.Info.pipe(optional).annotate({
94: description: "Named local directories or Git repositories available as external context",
95: }),
96: websearch: ConfigWebSearch.Selection.pipe(optional).annotate({
97: description: "Web search ...
Found 20 matches
/home/byk/.local/share/opencode-v2-pilot/config/opencode/test/followup.test.ts:
Line 2: import followup from "../plugins/followup.ts"
Line 4: describe("followup", () => {
Line 29: const cleanup = await followup.setup(context as never)
Line 31: const scheduled = await tools.get("schedule_followup")?.execute({ delay: "1s", message: "deliver" }, toolContext)
Line 36: expect((await tools.get("list_followups")?.execute({}, toolContext))?.output).toContain(id)
Line 37: expect((await tools.get("cancel_followup")?.execute({ id }, toolContext))?.output).toContain("Cancelled")
Line 38: expect((await tools.get("list_followups")?.execute({}, toolContext))?.output).toBe(
Line 43: (await tools.get("schedule_followup")?.execute({ delay: "1s", message: "blocked" }, { ...toolContext, sessionID: "subagent" }))
Line 47: await tools.get("schedule_followup")?.execute({ delay: "1s", message: "deliver" }, ...
No files found
<path>/home/byk/.local/share/opencode-v2-pilot/config/opencode/bun.lock</path>
<type>file</type>
<content>
1: {
2: "lockfileVersion": 1,
3: "configVersion": 1,
4: "workspaces": {
5: "": {
6: "dependencies": {
7: "effect": "file:/home/byk/Code/opencode-v2-pilot/node_modules/.bun/effect@4.0.0-rc.112/node_modules/effect",
8: },
9: "devDependencies": {
10: "@types/bun": "1.2.21",
11: },
12: },
13: },
14: "packages": {
15: "@msgpackr-extract/msgpackr-extract-darwin-arm64": ["@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.4", "", { "os": "darwin", "cpu": "arm64" }, "sha512-LCkGo6JDfaBhgST7UpPWgNgLINpcpabaHfyz5OBx75nUYxBsaEPxjnyNjWpeb/xBup/682QnBfRBy2/LvPutZQ=="],
16:
17: "@msgpackr-extract/msgpackr-extract-darwin-x64": ["@msgpackr-extract/msgpackr-extract-darwin-x64@3.0.4", "", { "os": "darwin", "cpu": "x64" }, "sha512-zExlW9zUJKZH/tOtVMttwjKa4Xm/3KcNjnE3dPN92uCktwavMxpgCA3MoJK/DOnTWsQgo224OaST27/mPNAf+w=="],
18:
19: ...
No files found
No files found
<path>/home/byk/Code/opencode-lore/packages/opencode/node_modules/@opencode-ai/plugin</path> <type>directory</type> <entries> dist/ package.json (2 entries) </entries>
No files found
<path>/home/byk/Code/opencode-lore/packages/opencode/node_modules/@opencode-ai/plugin/dist</path> <type>directory</type> <entries> example.d.ts example.js index.d.ts index.js shell.d.ts shell.js tool.d.ts tool.js (8 entries) </entries>
<path>/home/byk/Code/opencode-lore/packages/opencode/node_modules/@opencode-ai/plugin/dist/index.d.ts</path>
<type>file</type>
<content>
1: import type { Event, createOpencodeClient, Project, Model, Provider, Permission, UserMessage, Message, Part, Auth, Config } from "@opencode-ai/sdk";
2: import type { BunShell } from "./shell";
3: import { type ToolDefinition } from "./tool";
4: export * from "./tool";
5: export type ProviderContext = {
6: source: "env" | "config" | "custom" | "api";
7: info: Provider;
8: options: Record<string, any>;
9: };
10: export type PluginInput = {
11: client: ReturnType<typeof createOpencodeClient>;
12: project: Project;
13: directory: string;
14: worktree: string;
15: serverUrl: URL;
16: $: BunShell;
17: };
18: export type Plugin = (input: PluginInput) => Promise<Hooks>;
19: export type AuthHook = {
20: provider: string;
21: loader?: (auth: () => Promise<Auth>, provider: Provider) => Promise<Record<string, ...
<path>/home/byk/Code/opencode-lore/packages/opencode/node_modules/@opencode-ai/plugin/package.json</path>
<type>file</type>
<content>
1: {
2: "$schema": "https://json.schemastore.org/package.json",
3: "name": "@opencode-ai/plugin",
4: "version": "1.2.15",
5: "type": "module",
6: "license": "MIT",
7: "scripts": {
8: "typecheck": "tsgo --noEmit",
9: "build": "tsc"
10: },
11: "exports": {
12: ".": {
13: "import": "./dist/index.js",
14: "types": "./dist/index.d.ts"
15: },
16: "./tool": {
17: "import": "./dist/tool.js",
18: "types": "./dist/tool.d.ts"
19: }
20: },
21: "files": [
22: "dist"
23: ],
24: "dependencies": {
25: "@opencode-ai/sdk": "1.2.15",
26: "zod": "4.1.8"
27: },
28: "devDependencies": {
29: "@tsconfig/node22": "22.0.2",
30: "@types/node": "22.13.9",
31: "typescript": "5.8.2",
32: "@typescript/native-preview": "7.0.0-dev.20251207.1"
33: }
34: }
(End of file - total 34 ...
Found 11 matches
/home/byk/Code/opencode-lore/packages/opencode/package.json:
Line 21: "@opencode-ai/plugin": ">=1.1.0"
Line 28: "@opencode-ai/plugin": "^1.1.39",
Line 29: "@opencode-ai/sdk": "^1.1.39",
/home/byk/Code/opencode-lore/packages/opencode/src/internal.ts:
Line 17: import type { PluginInput } from "@opencode-ai/plugin";
/home/byk/Code/opencode-lore/packages/opencode/src/index.ts:
Line 1: import type { Hooks, Plugin, PluginInput } from "@opencode-ai/plugin";
/home/byk/Code/opencode-lore/packages/opencode/test/index.test.ts:
Line 5: import type { Plugin } from "@opencode-ai/plugin";
/home/byk/Code/opencode-lore/packages/opencode/test/routing.e2e.test.ts:
Line 24: import type { Hooks, PluginInput } from "@opencode-ai/plugin";
/home/byk/Code/opencode-lore/packages/opencode/test/internal.test.ts:
Line 2: import type { PluginInput } from "@opencode-ai/plugin";
/home/byk/Code/opencode-lore/packages/opencode/test/subagent-detection.test.ts:
...
<path>/home/byk/Code/opencode-v2-pilot/packages/schema/src/config/compaction.ts</path>
<type>file</type>
<content>
1: export * as ConfigCompaction from "./compaction.js"
2:
3: import { Schema } from "effect"
4: import { NonNegativeInt, optional } from "../schema.js"
5:
6: export class Keep extends Schema.Class<Keep>("Config.Compaction.Keep")({
7: tokens: NonNegativeInt.pipe(optional),
8: }) {}
9:
10: export class Info extends Schema.Class<Info>("Config.Compaction")({
11: auto: Schema.Boolean.pipe(optional),
12: keep: Keep.pipe(optional),
13: buffer: NonNegativeInt.pipe(optional),
14: }) {}
(End of file - total 14 lines)
</content>
<path>/home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/compaction.ts</path>
<type>file</type>
<content>
1: export * as ConfigCompactionPlugin from "./compaction.js"
2:
3: import { define } from "@opencode/plugin/effect/plugin"
4: import { Effect } from "effect"
5: import { Config } from "../../config.js"
6: import { SessionCompaction } from "../../session/compaction.js"
7: import { ConfigEntryObserver } from "./entry-observer.js"
8:
9: export const Plugin = define({
10: id: "opencode.config.compaction",
11: effect: Effect.fn(function* (ctx) {
12: const config = yield* Config.Service
13: const compaction = yield* SessionCompaction.Service
14: const loaded = yield* ConfigEntryObserver.observe(config, ctx.event, compaction.reload())
15: yield* compaction.transform((editor) => {
16: for (const entry of loaded.entries) {
17: if (entry.type !== "document" || !entry.info.compaction) continue
18: editor.configure({
19: ...
Found 2 matches
/home/byk/Code/opencode-v2-pilot/packages/schema/src/config.ts:
Line 35: default_agent: Schema.String.pipe(optional).annotate({
Line 57: agents: Schema.Record(Schema.String, ConfigAgent.Info).pipe(optional).annotate({
<path>/home/byk/Code/opencode-v2-pilot/packages/schema/src/config.ts</path>
<type>file</type>
<content>
24:
25: export class Info extends Schema.Class<Info>("Config.Info")({
26: $schema: optional(Schema.String).annotate({
27: description: "JSON schema reference for configuration validation",
28: }),
29: shell: Schema.String.pipe(optional).annotate({
30: description: "Default shell to use for terminal and shell tool execution",
31: }),
32: model: ConfigModel.Selection.pipe(optional).annotate({
33: description: "Default model to use when no session or agent model is selected",
34: }),
35: default_agent: Schema.String.pipe(optional).annotate({
36: description: "Default primary agent to use when no session agent is selected",
37: }),
38: update: Schema.Literals(["disable", "notify", "auto"]).pipe(optional).annotate({
39: description: "Disable updates, notify when one is available, or install updates automatically",
40: }),
41: share: ...
<path>/home/byk/Code/opencode-v2-pilot/packages/schema/src/config/agent.ts</path>
<type>file</type>
<content>
1: export * as ConfigAgent from "./agent.js"
2:
3: import { Schema } from "effect"
4: import { Permission } from "../permission.js"
5: import { optional, PositiveInt } from "../schema.js"
6: import { ConfigModel } from "./model.js"
7: import { ConfigProvider } from "./provider.js"
8:
9: export const Color = Schema.String.check(Schema.isPattern(/^#[0-9a-fA-F]{6}$/))
10:
11: export class Info extends Schema.Class<Info>("Config.Agent")({
12: model: ConfigModel.Selection.pipe(optional),
13: request: ConfigProvider.Request.pipe(optional),
14: system: Schema.String.pipe(optional),
15: description: Schema.String.pipe(optional),
16: mode: Schema.Literals(["subagent", "primary", "all"]).pipe(optional),
17: hidden: Schema.Boolean.pipe(optional),
18: color: Color.pipe(optional),
19: steps: PositiveInt.pipe(optional),
20: disabled: Schema.Boolean.pipe(optional),
21: ...
Found 18 matches
/home/byk/Code/opencode-v2-pilot/packages/core/src/config/normalize.ts:
Line 131: const legacyAgents = mapValues(
Line 132: decodeMap(input.agent, ConfigAgentV1.Info, ["agent"], diagnostics, decodeValue),
Line 139: ? ConfigMigrateV1.migrate({ small_model: legacySmallModel }).agents?.title?.model
Line 148: legacyAgents.title = {
Line 150: ...legacyAgents.title,
Line 155: const migratedAgents = mergeMaps(legacyAgents, modeAgents, ["agents"], diagnostics)
Line 156: const nativeAgents = decodeMap(input.agents, ConfigAgent.Info, ["agents"], diagnostics, decodeEncoded)
Line 157: diagnoseAgentUnsupported(input.agent, ["agent"], diagnostics)
Line 161: "agents",
Line 163: nativeAgents,
Line 164: migratedSmallModel !== undefined || isRecord(input.agent) || isRecord(input.mode) || isRecord(input.agents),
Line 168: const legacyProviders = migrateProviders(input.provider, diagnostics)
Line 169: const ...
<path>/home/byk/Code/opencode-v2-pilot/packages/core/src/config/normalize.ts</path>
<type>file</type>
<content>
120: })
121: const nativeCommands = decodeMap(input.commands, ConfigCommand.Info, ["commands"], diagnostics, decodeEncoded)
122: mergeMap(
123: encoded,
124: "commands",
125: migratedCommands,
126: nativeCommands,
127: isRecord(input.command) || isRecord(input.commands),
128: diagnostics,
129: )
130:
131: const legacyAgents = mapValues(
132: decodeMap(input.agent, ConfigAgentV1.Info, ["agent"], diagnostics, decodeValue),
133: (value) => canonical(ConfigAgent.Info, ConfigMigrateV1.migrateAgent(value)),
134: )
135: const legacySmallModel = own(input, "small_model")
136: ? decodeValue(Schema.String, input.small_model, ["small_model"], diagnostics)
137: : undefined
138: const migratedSmallModel = legacySmallModel
139: ? ConfigMigrateV1.migrate({ small_model: legacySmallModel }).agents?.title?.model
140: : ...
Found 7 matches
/home/byk/Code/opencode-lore/packages/core/src/fetch-interceptor.ts:
Line 188: * gateway as `x-lore-upstream-path` so it can POST to the exact endpoint the
Line 322: * in `installFetchInterceptor()`: a non-null slot means some copy of this
Line 338: * The slot is unset until `installFetchInterceptor()` is called, and released
Line 385: headers.set("x-lore-upstream-url", upstreamBase);
Line 393: headers.set("x-lore-upstream-path", upstreamPath);
Line 421: export function installFetchInterceptor(
/home/byk/Code/opencode-lore/packages/core/src/index.ts:
Line 356: installFetchInterceptor,
<path>/home/byk/Code/opencode-lore/packages/core/src/fetch-interceptor.ts</path>
<type>file</type>
<content>
130: try {
131: return new TextDecoder().decode(body);
132: } catch {
133: return undefined;
134: }
135: }
136: return undefined;
137: }
138:
139: /**
140: * Detect LLM protocol from request body shape using unique per-protocol
141: * identifiers. Only called when URL didn't match patterns but path looks
142: * LLM-like — a fast body-parse to decide whether to intercept anyway.
143: *
144: * Markers are chosen to be genuinely distinctive per protocol; ambiguous
145: * fields (e.g. `store`, `instructions`, which some Chat Completions
146: * extensions also use) are intentionally NOT used.
147: */
148: export function detectProtocolFromBody(bodyStr: string): BodyProtocol | null {
149: try {
150: const body = JSON.parse(bodyStr) as Record<string, unknown>;
151: if (typeof body !== "object" || body === null || !body.model) return ...
<path>/home/byk/Code/opencode-lore/packages/core/src/fetch-interceptor.ts</path>
<type>file</type>
<content>
470:
471: // Never intercept requests already going to the gateway, but still observe
472: // their auth so in-process extensions can scope side-channel requests.
473: if (url.startsWith(gatewayBase)) {
474: const directHeaders = new Headers(
475: init?.headers ??
476: (typeof input !== "string" && !(input instanceof URL)
477: ? input.headers
478: : undefined),
479: );
480: observeRequestHeaders(directHeaders, config);
481: return originalFetch(input, init);
482: }
483:
484: // Never intercept local requests (could be local LLM or gateway itself)
485: const host = upstream.hostname;
486: if (
487: host === "localhost" ||
488: host === "127.0.0.1" ||
489: host === "0.0.0.0" ||
490: host === "::1" ||
491: host === "[::1]"
492: ) {
493: return ...
Found 73 matches /home/byk/Code/opencode-v2-pilot/packages/ai/src/provider-error.ts: Line 90: readonly http?: HttpContext | undefined /home/byk/Code/opencode-v2-pilot/packages/ai/src/llm.ts: Line 35: readonly http?: HttpOptions.Input /home/byk/Code/opencode-v2-pilot/packages/ai/src/image.ts: Line 25: readonly http?: HttpOptions Line 49: readonly http?: HttpOptions Line 120: readonly http?: HttpOptions.Input /home/byk/Code/opencode-v2-pilot/packages/ai/src/schema/options.ts: Line 129: readonly http?: HttpOptions.Input /home/byk/Code/opencode-v2-pilot/packages/ai/src/route/executor.ts: Line 3: FetchHttpClient, Line 5: HttpClient, Line 6: HttpClientError, Line 7: HttpClientRequest, Line 8: HttpClientResponse, Line 15: request: HttpClientRequest.HttpClientRequest, Line 17: ) => Effect.Effect<HttpClientResponse.HttpClientResponse, AIError> Line 21: request: HttpClientRequest.HttpClientRequest, Line 22: ) ...
<path>/home/byk/Code/opencode-v2-pilot/packages/ai/src/route/executor.ts</path>
<type>file</type>
<content>
235: middleware?: HttpMiddleware,
236: ): Stream.Stream<Uint8Array, AIError> =>
237: Stream.unwrap(
238: Effect.gen(function* () {
239: const response = yield* executor.execute(request, middleware)
240: return responseStream(response)
241: }),
242: )
243:
244: export const layer: Layer.Layer<Service, never, HttpClient.HttpClient> = Layer.effect(
245: Service,
246: Effect.gen(function* () {
247: const http = yield* HttpClient.HttpClient
248: const executeOnce = (request: HttpClientRequest.HttpClientRequest, middleware?: HttpMiddleware) =>
249: Effect.gen(function* () {
250: if (!middleware)
251: return yield* http.execute(request).pipe(
252: Effect.mapError((error) => httpError({ error, request, operation: "request" })),
253: Effect.flatMap(statusError),
254: )
255:
256: ...
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin/src/app.ts</path>
<type>file</type>
<content>
1: export interface App {
2: readonly name: string
3: readonly version: string
4: readonly channel: string
5: }
(End of file - total 5 lines)
</content>
Found 21 matches
/home/byk/Code/opencode-lore/packages/gateway/src/server.ts:
Line 766: stop: () => Promise<void>;
Line 1300: stop: (): Promise<void> => {
/home/byk/Code/opencode-lore/packages/gateway/src/pipeline.ts:
Line 1268: expectedUnowned: boolean;
Line 5623: expectedUnowned: boolean;
Line 5822: expectedUnowned: !best.credentialBound,
Line 5831: expectedUnowned: !best.credentialBound,
Line 5921: ...(expectedUnowned ? { expectedUnowned: true } : {}),
/home/byk/Code/opencode-lore/packages/gateway/src/cli/start.ts:
Line 108: export interface GatewayHandle {
Line 112: owned: boolean;
Line 865: * handle with `owned: false`
Line 868: export async function startGateway(
Line 982: owned: false,
Line 1010: owned: false,
Line 1239: owned: true,
Line 1268: owned: false,
/home/byk/Code/opencode-lore/packages/gateway/src/cli/main.ts:
Line 436: // - stop: migrated ...
<path>/home/byk/Code/opencode-lore/packages/gateway/src/cli/start.ts</path>
<type>file</type>
<content>
100: * the gateway until healthy, prints the address + PID + log path, and exits 0.
101: * CLI: `--bg` / `--daemon`.
102: */
103: bg?: boolean;
104: /** @internal CLI-owned process boundary; never set by in-process plugins. */
105: processBoundary?: boolean;
106: }
107:
108: export interface GatewayHandle {
109: config: GatewayConfig;
110: port: number;
111: /** Whether this process owns the server (started it). False when reusing an existing instance. */
112: owned: boolean;
113: /** Owner-only token used to authenticate the gateway control endpoint. */
114: managementToken: string;
115: /** Shut down the gateway. No-op when `owned` is false. */
116: shutdown: () => Promise<void>;
117: /** @internal One-shot CLI process shutdown shared by signals and control. */
118: processShutdown?: ProcessShutdownController;
119: }
120:
121: export interface ...
Found 12 matches /home/byk/Code/opencode-v2-pilot/packages/client/src/promise/generated/client.ts: Line 426: get: (input?: LocationGetInput, requestOptions?: RequestOptions) => Line 452: get: (input: AgentGetInput, requestOptions?: RequestOptions) => Line 612: get: (input: SessionGetInput, requestOptions?: RequestOptions) => Line 1093: get: (input: ProviderGetInput, requestOptions?: RequestOptions) => Line 1119: get: (input: IntegrationGetInput, requestOptions?: RequestOptions) => Line 1443: get: (input: FormGetInput, requestOptions?: RequestOptions) => Line 1560: get: (input: PermissionGetInput, requestOptions?: RequestOptions) => Line 1705: get: (input: PtyGetInput, requestOptions?: RequestOptions) => Line 1824: get: (input: ExperimentalPersistentPtyGetInput, requestOptions?: RequestOptions) => Line 1914: get: (input: ShellGetInput, requestOptions?: RequestOptions) => Line 2062: get: ...
<path>/home/byk/Code/opencode-v2-pilot/packages/client/src/promise/generated/client.ts</path>
<type>file</type>
<content>
585: empty: false,
586: },
587: requestOptions,
588: ).then((value) => value.data),
589: export: (input: SessionExportInput, requestOptions?: RequestOptions) =>
590: request<{ readonly data: SessionExportOutput }>(
591: {
592: method: "GET",
593: path: `/api/session/${encodeURIComponent(input.sessionID)}/export`,
594: query: { sanitize: input["sanitize"] },
595: successStatus: 200,
596: declaredStatuses: [400, 401, 404, 500],
597: empty: false,
598: },
599: requestOptions,
600: ).then((value) => value.data),
601: active: (requestOptions?: RequestOptions) =>
602: request<{ readonly data: SessionActiveOutput }>(
603: {
604: method: "GET",
605: path: ...
Found 1 matches /home/byk/Code/opencode-v2-pilot/packages/client/src/promise/generated/client.ts: Line 694: prompt: (input: SessionPromptInput, requestOptions?: RequestOptions) =>
<path>/home/byk/Code/opencode-v2-pilot/packages/client/src/promise/generated/client.ts</path>
<type>file</type>
<content>
688: successStatus: 204,
689: declaredStatuses: [400, 401, 404],
690: empty: true,
691: },
692: requestOptions,
693: ),
694: prompt: (input: SessionPromptInput, requestOptions?: RequestOptions) =>
695: request<{ readonly data: SessionPromptOutput }>(
696: {
697: method: "POST",
698: path: `/api/session/${encodeURIComponent(input.sessionID)}/prompt`,
699: body: {
700: id: input["id"],
701: text: input["text"],
702: files: input["files"],
703: agents: input["agents"],
704: skills: input["skills"],
705: metadata: input["metadata"],
706: delivery: input["delivery"],
707: resume: input["resume"],
708: },
709: ...
<path>/home/byk/Code/opencode-v2-pilot/packages/protocol/src/groups/event.ts</path>
<type>file</type>
<content>
1: import { Event } from "@opencode/schema/event"
2: import { EventManifest } from "@opencode/schema/event-manifest"
3: import { Location } from "@opencode/schema/location"
4: import type { Definition } from "@opencode/schema/event"
5: import { Schema } from "effect"
6: import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi"
7:
8: const fields = {
9: id: Event.ID,
10: metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
11: location: Schema.optional(Location.Ref),
12: }
13:
14: const rpcEvent = Schema.Struct({
15: id: Event.ID,
16: created: Schema.Finite,
17: metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
18: type: Schema.TemplateLiteral(["rpc.", Schema.String]),
19: location: Location.Ref,
20: data: Schema.Record(Schema.String, Schema.Unknown),
21: }).annotate({ ...
<path>/home/byk/Code/opencode-v2-pilot/packages/core/src/config/discovery.ts</path>
<type>file</type>
<content>
1: export * as ConfigDiscovery from "./discovery.js"
2:
3: import path from "path"
4: import { Effect } from "effect"
5: import { FSUtil } from "@opencode/util/fs-util"
6: import { Global } from "@opencode/util/global"
7: import { Location } from "../location.js"
8: import { AbsolutePath } from "../schema.js"
9: import type { Options } from "../config.js"
10:
11: export const names = ["opencode.json", "opencode.jsonc"]
12:
13: /** Eligible sources in priority order, including paths that may appear later. */
14: export interface Sources {
15: readonly global?: AbsolutePath
16: readonly explicit?: AbsolutePath
17: readonly direct: readonly AbsolutePath[]
18: readonly project: readonly { readonly path: AbsolutePath; readonly present: boolean }[]
19: readonly claude: readonly AbsolutePath[]
20: readonly agents: readonly AbsolutePath[]
21: }
22:
23: export const ...
Found 8 matches
/home/byk/Code/opencode-v2-pilot/packages/core/src/config.ts:
Line 134: return new Document({ type: "document", path: AbsolutePath.make(filepath), info })
Line 161: Effect.map((info) => (info ? new Document({ type: "document", info }) : undefined)),
Line 182: new Directory({ type: "directory", path: directory }),
Line 209: Effect.map((info) => (info ? [new Document({ type: "document", info })] : [])),
Line 216: const globalSupplementary = sources.global ? yield* loadDirectory(sources.global).pipe(Effect.orDie) : []
Line 219: (root) => loadDirectory(root.path),
Line 226: ...claude.map((path) => new ClaudeDirectory({ type: "claude", path })),
Line 227: ...agents.map((path) => new AgentsDirectory({ type: "agents", path })),
<path>/home/byk/Code/opencode-v2-pilot/packages/core/src/config.ts</path>
<type>file</type>
<content>
110: Effect.logWarning("configuration normalization diagnostic", {
111: source,
112: path: diagnostic.path[0] === "$" ? "$" : `$.${diagnostic.path.join(".")}`,
113: kind: diagnostic.kind,
114: action: diagnostic.message,
115: }),
116: )
117: if (result.type === "rejected") return
118: const info = Option.getOrUndefined(decodeInfo(result.encoded))
119: if (info) return info
120: yield* Effect.logWarning("configuration normalization diagnostic", {
121: source,
122: path: "$",
123: kind: "invalid",
124: action: "rejected canonical configuration after final validation",
125: })
126: })
127:
128: const loadFile = Effect.fnUntraced(function* (filepath: string) {
129: const text = yield* ...
5 service-v2-pilot.json
2:hostname 3:port 4:password
<path>/home/byk/Code/opencode-v2-pilot/packages/core/src/plugin.ts</path>
<type>file</type>
<content>
1: export * as Plugin from "./plugin.js"
2: export { Event, ID, Info, Source, State } from "@opencode/schema/plugin"
3:
4: import { Plugin } from "@opencode/schema/plugin"
5: import { Node } from "@opencode/util/effect/app-node"
6: import { LayerNode } from "@opencode/util/effect/layer-node"
7: import type { PersistentPty } from "./persistent-pty.js"
8: import { Cause, Context, Effect, Exit, Latch, Layer, Logger, Queue, References, Scope, Semaphore } from "effect"
9: import { Bus } from "./bus.js"
10: import { KV } from "./kv.js"
11: import { PluginHost } from "./plugin/host.js"
12: import { type Failure, type Generation, Service } from "./plugin/service.js"
13: import { State } from "./state.js"
14:
15: export { awaitActivation, type Generation, type Interface, Service } from "./plugin/service.js"
16:
17: const layer = Layer.effect(
18: Service,
19: Effect.gen(function* () ...
<path>/home/byk/Code/opencode-lore/.opencode</path> <type>directory</type> <entries> .gitignore bun.lock node_modules/ package-lock.json package.json plans/ (6 entries) </entries>
<path>/home/byk/Code/opencode-lore/.opencode/package.json</path>
<type>file</type>
<content>
1: {
2: "dependencies": {
3: "@opencode-ai/plugin": "1.4.7"
4: }
5: }
(End of file - total 5 lines)
</content>
<path>/home/byk/Code/opencode-v2-pilot/.opencode</path> <type>directory</type> <entries> .gitignore agent/ command/ env.d.ts glossary/ opencode.jsonc plugins/ skills/ themes/ tool/ tui.json (11 entries) </entries>
<path>/home/byk/Code/opencode-v2-pilot/.opencode/plugins</path> <type>directory</type> <entries> smoke-theme.json (1 entries) </entries>
No files found
<path>/home/byk/Code/opencode-v2-pilot/.opencode/opencode.jsonc</path>
<type>file</type>
<content>
1: {
2: "$schema": "https://opencode.ai/config.json",
3: "provider": {},
4: "permission": {},
5: "references": {
6: "effect": {
7: "repository": "github.com/Effect-TS/effect-smol",
8: "description": "Use for Effect v4 and effect-smol implementation details",
9: },
10: "opencode-local": {
11: "path": "~/.local/share/opencode",
12: "description": "Contains opencode logs and data",
13: },
14: },
15: "mcp": {},
16: "tools": {
17: "github-triage": false,
18: "github-pr-search": false,
19: },
20: }
(End of file - total 20 lines)
</content>
Found 14 matches
/home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/supervisor-reload.test.ts:
Line 89: const greeter = (command: string) => `export default {
Line 129: export default {
Line 175: yield* Effect.promise(() => Bun.write(helper, 'throw new Error("broken helper"); export default {}'))
Line 268: yield* write("export default {", new Date())
/home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/module.test.ts:
Line 34: 'export default { id: "appeared", async setup() {} }',
Line 65: export default { id: "pending", async setup() {} }
/home/byk/Code/opencode-v2-pilot/packages/core/test/npm.test.ts:
Line 34: await Bun.write(path.join(repository, "index.js"), "export default { root: true }\n")
Line 48: await Bun.write(path.join(subdirectory, "index.js"), "export default { subdirectory: true }\n")
Line 281: await Bun.write(path.join(fixture.repository, "index.js"), 'export default { ...
<path>/home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/module.test.ts</path>
<type>file</type>
<content>
1: import { expect } from "bun:test"
2: import path from "node:path"
3: import { Deferred, Effect, Exit, Fiber, Layer, Schedule, Scope, Stream } from "effect"
4: import { AppNodeBuilder } from "@opencode/core/effect/app-node-builder"
5: import { Watcher } from "@opencode/core/filesystem/watcher"
6: import { PluginModule } from "@opencode/core/plugin/module"
7: import { Global } from "@opencode/util/global"
8: import { Npm } from "@opencode/util/npm"
9: import { tempGlobalLayer } from "../fixture/global"
10: import { tmpdirScoped } from "../fixture/tmpdir"
11: import { testEffect } from "../lib/effect"
12:
13: const it = testEffect(
14: Layer.merge(
15: AppNodeBuilder.build(Npm.node, [Global.node.replace(tempGlobalLayer)]),
16: Watcher.layer().pipe(Layer.provide(Watcher.nativeLayer)),
17: ),
18: )
19:
20: it.live("watches creation of an external helper with ...
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin/src/source.ts</path>
<type>file</type>
<content>
1: import { readFileSync, readdirSync } from "node:fs"
2: import { fileURLToPath, pathToFileURL } from "node:url"
3: import path from "node:path"
4: import { Hash } from "@opencode/util/hash"
5:
6: // Keep source fingerprints and import attempts together. Filesystem events
7: // should reload changed local graphs, not repeat unchanged evaluations.
8: export function createPluginSources(watch: (file: string) => Promise<void>) {
9: const sources = new Map<string, Source>()
10: const cleanups: Array<() => void> = []
11: const watching = new Set<Promise<void>>()
12: return {
13: read: async (entrypoint: string) => {
14: await Promise.all(watching)
15: const previous = sources.get(entrypoint)
16: if (previous && [...previous.files].every(([file, item]) => item.digest === digest(file, item.directory)))
17: return previous.loaded
18:
19: const ...
Found 11 matches
/home/byk/Code/opencode-v2-pilot/packages/cli/vite.node.config.ts:
Line 161: "@opencode/plugin": "opencode:plugin-v2",
Line 162: "@opencode/plugin/promise/plugin": "opencode:plugin-promise-plugin",
Line 163: "@opencode/plugin/promise/tool": "opencode:plugin-promise-tool",
Line 164: "@opencode/plugin/effect": "opencode:plugin-v2-effect",
Line 165: "@opencode/plugin/effect/plugin": "opencode:plugin-v2-effect-plugin",
Line 166: "@opencode/plugin/effect/tool": "opencode:plugin-v2-effect-tool",
Line 176: __cjs_mod__.registerHooks({
/home/byk/Code/opencode-v2-pilot/packages/cli/src/node/plugin-runtime.promise.ts:
Line 12: } from "@opencode/plugin"
/home/byk/Code/opencode-v2-pilot/packages/cli/src/node/plugin-runtime.effect.ts:
Line 12: } from "@opencode/plugin/effect"
/home/byk/Code/opencode-v2-pilot/packages/cli/src/commands/handlers/plugin/list.ts:
Line 12: import { Host } from ...
<path>/home/byk/Code/opencode-v2-pilot/packages/cli/vite.node.config.ts</path>
<type>file</type>
<content>
140: if (!sdk) throw new Error("OpenCode Promise plugin SDK is unavailable")
141: export const define = sdk.Plugin.define`
142: const effectPluginModule = promisePluginModule
143: .replace("opencode.plugin.v2.promise", "opencode.plugin.v2.effect")
144: .replace("Promise plugin", "Effect plugin")
145: const promiseToolModule = `export {}`
146: const effectToolModule = `const sdk = globalThis[Symbol.for("opencode.plugin.v2.effect")]
147: if (!sdk) throw new Error("OpenCode Effect plugin SDK is unavailable")
148: export const Error = sdk.Tool.Error
149: `
150: return `#!/usr/bin/env -S node ${nodeExecArgv.join(" ")}
151: import __cjs_mod__ from "node:module"
152: import { chmodSync as __ocChmod, existsSync as __ocExists, lstatSync as __ocLstat, mkdirSync as __ocMkdir, renameSync as __ocRename, rmSync as __ocRm, writeFileSync as __ocWrite } from "node:fs"
153: import ...
<path>/home/byk/Code/opencode-v2-pilot/packages/cli/vite.node.config.ts</path>
<type>file</type>
<content>
105: replacement: path.join(path.dirname(createRequire(import.meta.url).resolve("ws/package.json")), "wrapper.mjs"),
106: },
107: ],
108: conditions: ["node"],
109: }
110:
111: const output = (entryFileNames: string, banner?: string) => ({
112: format: "esm" as const,
113: entryFileNames,
114: inlineDynamicImports: true,
115: banner,
116: })
117:
118: function nodePrelude(input: NodeBuildInput) {
119: const nodePtySpawnHelper =
120: input.target.platform === "darwin"
121: ? `${input.target.nodePtyPackage}/prebuilds/darwin-${input.target.arch}/spawn-helper`
122: : undefined
123: const opencodePtyAsset = input.target.opencodePtyAsset
124: const promiseModule = `const sdk = globalThis[Symbol.for("opencode.plugin.v2.promise")]
125: if (!sdk) throw new Error("OpenCode Promise plugin SDK is unavailable")
126: export const Agent = ...
<path>/home/byk/Code/opencode-v2-pilot/packages/cli/src/node/plugin-runtime.promise.ts</path>
<type>file</type>
<content>
1: import {
2: Agent,
3: Command,
4: Connection,
5: Credential,
6: Integration,
7: Model,
8: Plugin,
9: Provider,
10: Reference,
11: Skill,
12: } from "@opencode/plugin"
13:
14: const key = Symbol.for("opencode.plugin.v2.promise")
15: ;(globalThis as typeof globalThis & { [key]?: unknown })[key] = {
16: Agent,
17: Command,
18: Connection,
19: Credential,
20: Integration,
21: Model,
22: Plugin,
23: Provider,
24: Reference,
25: Skill,
26: }
(End of file - total 26 lines)
</content>
<path>/home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/fixtures/greeting.ts</path>
<type>file</type>
<content>
1: import { Plugin } from "@opencode/plugin"
2:
3: export default Plugin.define({
4: id: "greeting",
5: async setup(ctx) {
6: await ctx.command.transform((editor) =>
7: editor.add({
8: name: "greet",
9: description: ctx.options.description,
10: execute: async () => {},
11: }),
12: )
13: },
14: })
(End of file - total 14 lines)
</content>
<path>/home/byk/Code/opencode-lore/packages/opencode/test</path> <type>directory</type> <entries> gateway-smoke.test.ts index.test.ts internal.test.ts routing.e2e.test.ts session-state.test.ts subagent-detection.test.ts tui-silence.test.ts (7 entries) </entries>
<path>/home/byk/Code/opencode-lore/packages/opencode/test/index.test.ts</path>
<type>file</type>
<content>
1: import { describe, test, expect } from "vitest";
2: import { fileURLToPath } from "node:url";
3: import { LorePlugin } from "../src/index";
4: import { applyLoreProviderConfig } from "../src/internal";
5: import type { Plugin } from "@opencode-ai/plugin";
6:
7: /**
8: * Minimal mock of the OpenCode client. Only stubs the methods the plugin
9: * actually calls during initialization.
10: */
11: function createMockClient() {
12: return {
13: tui: {
14: showToast: () => Promise.resolve(),
15: },
16: session: {
17: get: () => Promise.resolve({ data: {} }),
18: list: () => Promise.resolve({ data: [] }),
19: create: () => Promise.resolve({ data: { id: "worker_1" } }),
20: messages: () => Promise.resolve({ data: [] }),
21: message: () => Promise.resolve({ data: null }),
22: prompt: () => Promise.resolve({ data: {} }),
23: ...
<path>/home/byk/Code/opencode-lore/packages/opencode/test/index.test.ts</path>
<type>file</type>
<content>
250: });
251:
252: describe("LorePlugin hooks", () => {
253: test("returns an empty tool map", async () => {
254: const { hooks, cleanup } = await initPlugin();
255: try {
256: expect(hooks.tool).toEqual({});
257: } finally {
258: cleanup();
259: }
260: });
261:
262: test("returns only config and tool hooks (no event/transform hooks)", async () => {
263: const { hooks, cleanup } = await initPlugin();
264: try {
265: expect(hooks.config).toBeDefined();
266: expect(hooks.tool).toBeDefined();
267: // Only config, tool, and chat.headers hooks should be registered
268: expect(hooks.event).toBeUndefined();
269: expect(hooks["experimental.chat.system.transform"]).toBeUndefined();
270: expect(hooks["experimental.chat.messages.transform"]).toBeUndefined();
271: ...
<path>/home/byk/Code/opencode-lore/packages/opencode/test/routing.e2e.test.ts</path> <type>file</type> <content> 1: /** 2: * End-to-end test: the OpenCode plugin's REAL active path against a REAL 3: * in-process Lore gateway (upstream mocked — no real API call). 4: * 5: * Unlike the config-hook units (index.test.ts) and per-project header units 6: * (session-state.test.ts) — which run with the plugin inert under 7: * `NODE_ENV=test` — this test forces the plugin active via 8: * `LORE_OPENCODE_FORCE_ACTIVE=1` and points it at a controlled gateway via 9: * `LORE_GATEWAY_URL`, then proves the wiring the whole #1036/#1039 series 10: * exists to guard: 11: * 1. the plugin DISCOVERS the gateway (gatewayBase is resolved, not ""), 12: * so its `config` hook actually pins provider baseURLs to it, 13: * 2. the `chat.headers` hook injects the `x-lore-*` attribution headers, and 14: * 3. ...
<path>/home/byk/Code/opencode-lore/packages/opencode/test/session-state.test.ts</path> <type>file</type> <content> 1: /** 2: * Tests for per-project state in the OpenCode plugin (B2). 3: * 4: * The plugin function (`LorePlugin`) can be called multiple times in the 5: * same process — e.g., when the user has multiple OpenCode worktrees open 6: * in parallel, or when a sub-agent spawns a new project context. The 7: * per-project Map ensures that: 8: * - Each project gets its own registered project path + git remote 9: * - The `chat.headers` hook injects the right headers per request 10: * - Concurrent project registrations don't clobber each other 11: * 12: * Regression coverage for the "lore-config" bug variant where the module- 13: * level `currentProjectPath` global was overwritten by sibling project 14: * inits, causing requests to be misattributed. ...
<path>/home/byk/Code/opencode-lore/packages/opencode/test/subagent-detection.test.ts</path>
<type>file</type>
<content>
1: /**
2: * OpenCode sub-agent detection (#1300).
3: *
4: * A Task sub-agent runs in a child session whose `parentID` points at the
5: * spawning session. The plugin's `chat.headers` hook resolves that parent via
6: * the SDK and forwards it as `x-parent-session-id` — the same signal Claude
7: * Code emits natively — so the gateway flags the session as a sub-agent and
8: * sizes its LTM injection (#1302). Primary sessions have no parent and emit no
9: * such header.
10: *
11: * The lookup is cached per session and must never block or break the request.
12: */
13: import { mkdtempSync, rmSync } from "node:fs";
14: import { tmpdir } from "node:os";
15: import { join } from "node:path";
16: import type { Hooks, PluginInput } from "@opencode-ai/plugin";
17: import { afterEach, describe, expect, test } from "vitest";
18: import { LorePlugin } from ...
<path>/home/byk/Code/opencode-lore/packages/opencode/test/tui-silence.test.ts</path>
<type>file</type>
<content>
1: import { afterEach, describe, expect, test } from "vitest";
2: import type { PluginInput } from "@opencode-ai/plugin";
3: import { log } from "@loreai/core";
4: import { LorePlugin } from "../src/index";
5:
6: /**
7: * The OpenCode plugin runs inside OpenCode's full-screen TUI, where any byte on
8: * stdout/stderr corrupts the render. On activation it must flip
9: * `log.silenceStderr()` so neither the plugin nor the in-process gateway it
10: * hosts can ever write `[lore]` to the terminal.
11: *
12: * `LORE_DISABLED=1` keeps activation from probing/starting a real gateway while
13: * still exercising the (pre-gateway) silence switch. The global test setup
14: * resets the flag after each test. ...
<path>/home/byk/Code/opencode-lore/packages/opencode/test/gateway-smoke.test.ts</path>
<type>file</type>
<content>
1: import { describe, test, expect, afterAll } from "vitest";
2: import { probeGateway } from "../src/internal";
3:
4: /**
5: * Smoke tests for the in-process gateway startup.
6: *
7: * These exercise startGateway from @loreai/gateway directly (which is what
8: * the plugin's startInProcess delegates to). Tests use ephemeral ports so
9: * they don't collide with a running gateway.
10: */
11:
12: // Minimal view of the @loreai/gateway module surface used by these tests.
13: type GatewayServer = { stop: () => void; port: number; hosts: string[] };
14: type GatewayModule = {
15: loadConfig: () => { port: number } & Record<string, unknown>;
16: startServer: (config: unknown) => Promise<GatewayServer>;
17: };
18:
19: // Track shutdown handles to clean up after tests. ...
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin/test</path> <type>directory</type> <entries> host.test.ts (1 entries) </entries>
<path>/home/byk/Code/opencode-v2-pilot/packages/cli/src/commands/handlers/plugin/list.ts</path>
<type>file</type>
<content>
1: import { EOL } from "node:os"
2: import path from "node:path"
3: import { Effect } from "effect"
4: import { OpenCode, type PluginInfo } from "@opencode/client"
5: import { Service } from "@opencode/client/effect/service"
6: import { Commands } from "../../commands"
7: import { Runtime } from "../../../framework/runtime"
8: import { ServiceConfig } from "../../../services/service-config"
9: import { Config } from "../../../config"
10: import { Global } from "@opencode/util/global"
11: import { Npm } from "@opencode/util/npm"
12: import { Host } from "@opencode/plugin/host"
13: import { fileURLToPath } from "node:url"
14: import { discoverPluginTargets, localPluginDirectories, localSource } from "@opencode/tui/plugin/discovery"
15:
16: export default Runtime.handler(
17: Commands.commands.plugin.commands.list,
18: Effect.fn("cli.plugin.list")(function* ...
/home/byk/Code/opencode-v2-pilot/packages/cli/src/commands/handlers/plugin/update.ts /home/byk/Code/opencode-v2-pilot/packages/cli/src/commands/handlers/plugin/remove.ts /home/byk/Code/opencode-v2-pilot/packages/cli/src/commands/handlers/plugin/list.ts /home/byk/Code/opencode-v2-pilot/packages/cli/src/commands/handlers/plugin/inventory.ts /home/byk/Code/opencode-v2-pilot/packages/cli/src/commands/handlers/plugin/check.ts /home/byk/Code/opencode-v2-pilot/packages/cli/src/commands/handlers/plugin/add.ts
<path>/home/byk/Code/opencode-v2-pilot/packages/cli/src/commands/handlers/plugin/check.ts</path>
<type>file</type>
<content>
1: import { EOL } from "node:os"
2: import { Effect, Option } from "effect"
3: import { Commands } from "../../commands"
4: import { Runtime } from "../../../framework/runtime"
5: import { format, inspect } from "./inventory"
6:
7: export default Runtime.handler(
8: Commands.commands.plugin.commands.check,
9: Effect.fn("cli.plugin.check")(function* (input) {
10: const result = yield* inspect(Option.getOrUndefined(input.target))
11: process.stdout.write((format(result.items) || "No package plugins found") + EOL)
12: if (result.items.some((item) => item.error)) process.exitCode = 1
13: }),
14: )
(End of file - total 14 lines)
</content>
<path>/home/byk/Code/opencode-v2-pilot/packages/cli/src/commands/handlers/plugin/inventory.ts</path>
<type>file</type>
<content>
1: import { EOL } from "node:os"
2: import { Cause, Effect, Exit } from "effect"
3: import { OpenCode, type PluginInfo } from "@opencode/client"
4: import { Service } from "@opencode/client/effect/service"
5: import { Npm } from "@opencode/util/npm"
6: import { Config } from "../../../config"
7: import { ServiceConfig } from "../../../services/service-config"
8:
9: export interface Item {
10: readonly runtime: "Server" | "TUI"
11: readonly target: string
12: readonly name: string
13: readonly version?: string
14: readonly outdated: boolean
15: readonly error?: string
16: }
17:
18: export const inspect = Effect.fn("cli.plugin.inspect")(function* (selected?: string) {
19: const endpoint = yield* Service.ensure(yield* ServiceConfig.options())
20: const client = OpenCode.make({ baseUrl: endpoint.url, headers: Service.headers(endpoint) })
21: ...
Found 9 matches
/home/byk/Code/opencode-v2-pilot/packages/plugin-browser/src/proxy.ts:
Line 71: server.headersTimeout = 10_000
/home/byk/Code/opencode-v2-pilot/packages/app/src/runtime/server/request-queue.ts:
Line 40: headersTimeoutMs?: number
Line 48: const headersTimeoutMs = input.headersTimeoutMs ?? requestHeadersTimeoutMs
Line 115: isSetupRequest(request.method, pathname) ? setupHeadersTimeoutMs : headersTimeoutMs,
/home/byk/Code/opencode-v2-pilot/packages/app/src/runtime/server/request-queue.test.ts:
Line 8: headersTimeoutMs?: number
Line 18: headersTimeoutMs: input?.headersTimeoutMs,
Line 109: const input = setup({ limit: 1, headersTimeoutMs: 10 })
Line 125: const input = setup({ limit: 4, headersTimeoutMs: 10, setupHeadersTimeoutMs: 200 })
/home/byk/Code/opencode-v2-pilot/packages/core/src/v1/config/provider.ts:
Line 103: headerTimeout: Schema.optional(
<path>/home/byk/Code/opencode-v2-pilot/packages/schema/src/config/provider.ts</path>
<type>file</type>
<content>
1: export * as ConfigProvider from "./provider.js"
2:
3: import { Schema } from "effect"
4: import { Money } from "../money.js"
5: import { Capabilities, Compatibility, Family, ID, VariantID } from "../model.js"
6: import { Provider } from "../provider.js"
7: import { optional } from "../schema.js"
8:
9: const JsonRecord = Schema.Record(Schema.String, Schema.Json)
10:
11: export const Overlays = {
12: settings: JsonRecord.pipe(optional),
13: headers: Schema.Record(Schema.String, Schema.String).pipe(optional),
14: body: JsonRecord.pipe(optional),
15: }
16:
17: export class Request extends Schema.Class<Request>("Config.Provider.Request")({
18: headers: Overlays.headers,
19: body: Overlays.body,
20: }) {}
21:
22: class Cache extends Schema.Class<Cache>("Config.Model.Cost.Cache")({
23: read: Money.USDPerMillionTokens.pipe(optional),
24: write: ...
Found 2 matches
/home/byk/Code/opencode-v2-pilot/packages/cli/vite.node.config.ts:
Line 6: import { nodeExecArgv, nodeTarget, type NodeTarget, photonWasmAsset, shellParserWasmAssets } from "./src/node/target"
Line 150: return `#!/usr/bin/env -S node ${nodeExecArgv.join(" ")}
<path>/home/byk/Code/opencode-v2-pilot/packages/cli/src/node/target.ts</path>
<type>file</type>
<content>
1: const platforms = ["darwin", "linux", "win32"] as const
2:
3: export type NodeTarget = ReturnType<typeof nodeTarget>
4:
5: export function nodeTarget(platform: string, arch: string) {
6: if (!platforms.includes(platform as (typeof platforms)[number]) || (arch !== "arm64" && arch !== "x64")) {
7: throw new Error(`Unsupported Node executable target: ${platform}-${arch}`)
8: }
9:
10: const targetPlatform = platform as (typeof platforms)[number]
11: const targetArch = arch as "arm64" | "x64"
12: const nodePtyPackage = `@lydell/node-pty-${targetPlatform}-${targetArch}`
13: const parcelWatcherPackage = `@parcel/watcher-${targetPlatform}-${targetArch}${targetPlatform === "linux" ? "-glibc" : ""}`
14: const fffPackage = `@ff-labs/fff-bin-${targetPlatform}-${targetArch}${targetPlatform === "linux" ? ...
<path>/home/byk/Code/opencode-v2-pilot/packages/plugin-browser/package.json</path>
<type>file</type>
<content>
1: {
2: "$schema": "https://json.schemastore.org/package.json",
3: "name": "@opencode/plugin-browser",
4: "version": "0.0.0",
5: "description": "OpenCode's desktop browser plugin",
6: "type": "module",
7: "license": "MIT",
8: "repository": {
9: "type": "git",
10: "url": "git+https://github.com/anomalyco/opencode.git",
11: "directory": "packages/plugin-browser"
12: },
13: "publishConfig": {
14: "access": "public"
15: },
16: "files": [
17: "dist"
18: ],
19: "exports": {
20: ".": "./src/index.ts",
21: "./rpc": "./src/rpc.ts",
22: "./proxy": "./src/proxy.ts"
23: },
24: "scripts": {
25: "build": "tsc -p tsconfig.build.json",
26: "typecheck": "tsgo --noEmit -p tsconfig.test.json",
27: "test": "bun test"
28: },
29: "dependencies": {
30: "@opencode/plugin": "workspace:*",
31: "@opencode/schema": ...
Found 3 matches
/home/byk/Code/opencode-v2-pilot/packages/util/src/npm.ts:
Line 21: export interface Package {
Line 320: return { ...staged.result, directory: path.join(generation, "node_modules", staged.result.name) }
Line 356: if (!(yield* afs.existsSafe(dir))) return { directory: dir, name }
<path>/home/byk/Code/opencode-v2-pilot/packages/util/src/npm.ts</path>
<type>file</type>
<content>
1: export * as Npm from "./npm.js"
2:
3: import path from "path"
4: import { createHash, randomUUID } from "node:crypto"
5: import { Clock, Effect, Schema, Context, Layer, Option, FileSystem } from "effect"
6: import { FSUtil } from "./fs-util.js"
7: import { Global } from "./global.js"
8: import { EffectFlock } from "./effect-flock.js"
9: import { makeGlobalNode } from "./effect/app-node.js"
10: import { filesystem } from "./effect/app-node-platform.js"
11: import { LayerNode } from "./effect/layer-node.js"
12: import { makeRuntime } from "./effect/runtime.js"
13: import { NpmConfig } from "./npm-config.js"
14:
15: export class InstallFailedError extends Schema.TaggedError<InstallFailedError>()("NpmInstallFailedError", {
16: add: Schema.Array(Schema.String).pipe(Schema.optional),
17: dir: Schema.String,
18: cause: Schema.optional(Schema.Defect()),
19: }) {}
20:
21: export ...
No files found
Found 32 matches
/home/byk/Code/opencode-v2-pilot/sdks/vscode/package.json:
Line 17: "engines": {
/home/byk/Code/opencode-v2-pilot/services/www/package.json:
Line 28: "engines": {
Line 29: "node": ">=22.12"
/home/byk/Code/opencode-v2-pilot/package.json:
Line 8: "packageManager": "bun@1.4.2",
/home/byk/Code/opencode-v2-pilot/packages/core/package.json:
Line 36: "node": "./src/database/sqlite.node.ts",
Line 42: "node": "./src/pty/pty.node.ts",
Line 48: "node": "./src/persistent-pty/binary.node.ts",
Line 54: "node": "./src/filesystem/fff.node.ts",
Line 60: "node": "./src/image/photon-wasm.node.ts",
Line 66: "node": "./src/shell/parser-wasm.node.ts",
Line 72: "node": "./src/util/process-lock-ffi.node.ts",
Line 78: "node": "./src/database/v1-migration.noop.ts",
/home/byk/Code/opencode-v2-pilot/packages/stats/server/package.json:
Line 30: "engines": {
Line 31: "node": ...
<path>/home/byk/Code/opencode-v2-pilot/package.json</path>
<type>file</type>
<content>
1: {
2: "$schema": "https://json.schemastore.org/package.json",
3: "name": "opencode",
4: "description": "AI-powered development tool",
5: "version": "0.0.0",
6: "private": true,
7: "type": "module",
8: "packageManager": "bun@1.4.2",
9: "scripts": {
10: "dev": "bun run --cwd packages/cli src/index.ts",
11: "dev:live": "sh -c 'OPENCODE_TUI_CHANNEL=dev OPENCODE_PASSWORD=\"$(opencode2 service get password)\" exec bun run dev \"$@\" --server \"$(opencode2 service status)\"' --",
12: "dev:desktop": "bun --cwd packages/desktop dev",
13: "dev:web": "bun --cwd packages/app dev",
14: "dev:console": "ulimit -n 10240 2>/dev/null; bun run --cwd packages/console/app dev",
15: "dev:stats": "bun sst shell --stage=production -- bun run --cwd packages/stats/app dev",
16: "dev:www": "bun run --cwd services/www dev",
17: "dev:storybook": "bun --cwd packages/storybook ...
Found 15 matches
/home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/worktree.test.ts:
Line 25: async setup(ctx) {
/home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/websearch.test.ts:
Line 69: yield* registration.dispose
/home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/supervisor.test.ts:
Line 183: // Generation 0 is mid-setup: the reload feed must already be subscribed for this update to count.
/home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/supervisor-reload.test.ts:
Line 91: async setup(ctx) {
Line 131: async setup(ctx) {
Line 228: // Emit while setup is blocked, without a bus event that could mask a lost source trigger.
/home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/plan.test.ts:
Line 70: return Effect.succeed({ dispose: Effect.void })
Line 82: return Effect.succeed({ dispose: Effect.void })
Line 91: return Effect.succeed({ ...
<path>/home/byk/Code/opencode-lore/packages/core/src/fetch-interceptor.ts</path>
<type>file</type>
<content>
1: /**
2: * Fetch-level interception for transparent LLM API proxy routing.
3: *
4: * Instead of overwriting provider baseURLs early (which loses original auth
5: * and URL context), this interceptor wraps `globalThis.fetch` to redirect
6: * outgoing LLM API calls through the Lore gateway at the HTTP level.
7: *
8: * The SDK builds requests normally (correct auth, correct URL for each
9: * provider), and the interceptor transparently reroutes them through the
10: * gateway while preserving all original headers.
11: */
12: import * as log from "./log";
13:
14: /** Configuration for the fetch interceptor. */
15: export type FetchInterceptorConfig = {
16: /** Base URL of the Lore gateway (e.g., "http://127.0.0.1:3207"). */
17: gatewayBase: string;
18: /**
19: * Dynamic headers to inject on every intercepted request. ...
<path>/home/byk/Code/opencode-lore/packages/core/dist</path> <type>directory</type> <entries> bun/ node/ types/ (3 entries) </entries>
<path>/home/byk/Code/opencode-lore/packages/gateway/dist</path> <type>directory</type> <entries> bin.cjs embedding-worker.cjs embedding-worker.js index.bun.js index.cjs index.cjs.map index.d.cts ort-wasm-simd-threaded.mjs ort-wasm-simd-threaded.wasm vector-worker.cjs vector-worker.js (11 entries) </entries>
Found 45 matches
/home/byk/Code/opencode-v2-pilot/packages/ai/src/tool-history.ts:
Line 1: import { Message, ToolResultPart, type ToolCallPart } from "./schema/messages.js"
/home/byk/Code/opencode-v2-pilot/packages/ai/src/cache-policy.ts:
Line 14: import { LLMRequest, Message, ToolDefinition, type ContentPart, type ToolEntry } from "./schema/messages.js"
/home/byk/Code/opencode-v2-pilot/packages/ai/src/schema/index.ts:
Line 3: export * from "./messages.js"
/home/byk/Code/opencode-v2-pilot/packages/ai/src/schema/events.ts:
Line 13: } from "./messages.js"
Line 18: export { ProviderMetadata } from "./messages.js"
/home/byk/Code/opencode-v2-pilot/packages/ai/src/protocols/xai-responses.ts:
Line 6: import { ResponsesHostedTools } from "./utils/responses-hosted-tools.js"
Line 7: import { ResponsesCompaction } from "./utils/responses-compaction.js"
/home/byk/Code/opencode-v2-pilot/packages/ai/src/protocols/openai-responses.ts:
Line 12: import { ...
Found 5 matches
/home/byk/Code/opencode-v2-pilot/packages/ai/src/providers/anthropic.ts:
Line 19: readonly baseURL?: string
Line 28: readonly baseURL?: string
Line 40: const { apiKey: _, auth: _auth, baseURL, ...rest } = input
Line 44: baseURL: baseURL ?? AnthropicMessages.DEFAULT_BASE_URL,
Line 63: baseURL: settings.baseURL,
<path>/home/byk/Code/opencode-v2-pilot/packages/ai/src/protocols/anthropic-messages.ts</path>
<type>file</type>
<content>
25: type ToolDefinition,
26: type ToolResultPart,
27: } from "../schema/index.js"
28: import { JsonObject, optionalArray, optionalNull, ProviderShared } from "./shared.js"
29: import { classifyProviderFailure } from "../provider-error.js"
30: import * as Cache from "./utils/cache.js"
31: import { Lifecycle } from "./utils/lifecycle.js"
32: import { ToolSchemaProjection } from "./utils/tool-schema.js"
33: import { ToolStream } from "./utils/tool-stream.js"
34:
35: const ADAPTER = "anthropic-messages"
36: export const DEFAULT_BASE_URL = "https://api.anthropic.com/v1"
37: export const PATH = "/messages"
38: export const DEFAULT_MAX_TOKENS = 32_000
39:
40: const SSE_EVENTS = new Set([
41: "message",
42: "message_start",
43: "message_delta",
44: "message_stop",
45: "content_block_start",
46: "content_block_delta",
47: "content_block_stop",
48: ...
Found 3 matches
/home/byk/Code/opencode-v2-pilot/packages/ai/src/protocols/openai-chat.ts:
Line 37: export const DEFAULT_BASE_URL = "https://api.openai.com/v1"
Line 38: export const PATH = "/chat/completions"
Line 1195: endpoint: Endpoint.path(PATH, { baseURL: DEFAULT_BASE_URL }),
Found 1 matches /home/byk/Code/opencode-v2-pilot/packages/ai/src/protocols/open-responses.ts: Line 30: export const PATH = "/responses"
No files found
/home/byk/Code/opencode-v2-pilot/packages/ai/src/providers/openai.ts /home/byk/Code/opencode-v2-pilot/packages/ai/src/providers/openai-options.ts /home/byk/Code/opencode-v2-pilot/packages/ai/src/providers/openai-compatible.ts /home/byk/Code/opencode-v2-pilot/packages/ai/src/providers/openai-compatible-responses.ts
Found 6 matches
/home/byk/Code/opencode-v2-pilot/packages/ai/src/providers/openai.ts:
Line 22: readonly baseURL?: string
Line 62: readonly baseURL?: string
Line 72: const { apiKey: _, auth: _auth, baseURL: _baseURL, queryParams: _queryParams, ...rest } = input
Line 82: endpoint: { baseURL: input.baseURL, query: input.queryParams },
Line 99: baseURL: input.baseURL,
Line 127: baseURL: settings.baseURL,
The transport path is portable, but the adapter is not. V2 exposes mutable session.model.request and session.http.request hooks with session, agent, model/provider, and final Request data, so Lore can preserve exact upstream URL/path metadata without its legacy config hook or process-wide fetch patch; the port must also replace obsolete compaction, agent, parent-session, toast, and TUI assumptions.
[
{
"content": "Inspect repository guidance and relevant manifests, exports, configs, and candidate state",
"status": "completed",
"priority": "high"
},
{
"content": "Trace Lore plugin entrypoint, dependencies, hooks, APIs, and startup assumptions",
"status": "completed",
"priority": "high"
},
{
"content": "Trace V2 plugin discovery, loader, and Promise plugin contracts",
"status": "completed",
"priority": "high"
},
{
"content": "Compare both sides and classify every concrete incompatibility",
"status": "in_progress",
"priority": "high"
},
{
"content": "Define the smallest viable port and complete validation sequence",
"status": "pending",
"priority": "medium"
},
{
"content": "Prepare a concise evidence-based compatibility report",
"status": "pending",
"priority": "high"
}
]
Found 8 matches
/home/byk/Code/opencode-v2-pilot/packages/core/src/session/compaction.ts:
Line 88: buffer: number
Line 89: tokens: number
Line 377: initial: () => ({ auto: true, buffer: DEFAULT_BUFFER, tokens: DEFAULT_KEEP_TOKENS }),
Line 380: if (settings.auto !== undefined) editor.auto = settings.auto
Line 381: if (settings.buffer !== undefined) editor.buffer = settings.buffer
Line 685: if (!config.auto) return false
Line 700: limit.input === undefined ? Number.POSITIVE_INFINITY : limit.input - config.buffer,
Line 701: context - Math.max(output, config.buffer),
<path>/home/byk/Code/opencode-v2-pilot/packages/core/src/session/compaction.ts</path>
<type>file</type>
<content>
365: const hasSummarySection = (summary: string) =>
366: summary.split("\n").some((line) => SUMMARY_HEADINGS.includes(line.trim()))
367:
368: export const layer = Layer.effect(
369: Service,
370: Effect.gen(function* () {
371: const bus = yield* Bus.Service
372: const llm = yield* LLMClient.Service
373: const db = (yield* Database.Service).db
374:
375: const state = State.create<Settings, Editor>({
376: name: "session-compaction",
377: initial: () => ({ auto: true, buffer: DEFAULT_BUFFER, tokens: DEFAULT_KEEP_TOKENS }),
378: editor: (editor) => ({
379: configure: (settings) => {
380: if (settings.auto !== undefined) editor.auto = settings.auto
381: if (settings.buffer !== undefined) editor.buffer = settings.buffer
382: if (settings.tokens !== undefined) editor.tokens = settings.tokens
383: ...
Found 3 matches
/home/byk/Code/opencode-v2-pilot/packages/tui/test/plugin-source.test.ts:
Line 287: 'import { read } from "./helper"; export const value = {}; export default () => read() === value',
Line 296: 'import { read } from "./helper"; export const value = { changed: true }; export default () => read() === value',
Line 706: 'export default { value: "package" }; export let count = 0; export const increment = () => count++',
<path>/home/byk/Code/opencode-v2-pilot/packages/core/test/session-title.test.ts</path>
<type>file</type>
<content>
250: }),
251: )
252:
253: it.effect("falls back to the primary model when the small model fails", () =>
254: Effect.gen(function* () {
255: titleStream = () =>
256: requests.length === 1
257: ? Stream.make(LLMEvent.providerError({ message: "Small model unavailable" }))
258: : successfulTitle()
259: selectedSmall = lowSmall
260: yield* enableTitleAgent
261: const sessionID = Session.ID.make("ses_title_small_fallback")
262: yield* insertSession(
263: sessionID,
264: undefined,
265: undefined,
266: Model.Ref.make({
267: providerID: Provider.ID.make("test"),
268: id: Model.ID.make("title-model"),
269: variant: Model.VariantID.make("high"),
270: }),
271: )
272: yield* prompt(sessionID, "Fall back when title generation fails")
273:
274: const attempted: Model.Ref[] ...
<path>/home/byk/Code/opencode-lore/packages/gateway/src/compaction.ts</path>
<type>file</type>
<content>
360: */
361: export function extractPreviousSummary(
362: req: GatewayRequest,
363: ): string | undefined {
364: const userText = lastUserText(req);
365: const match = PREVIOUS_SUMMARY_RE.exec(userText);
366: return match?.[1] ?? undefined;
367: }
368:
369: // ---------------------------------------------------------------------------
370: // isMetaRequest (replaces isTitleOrSummaryRequest)
371: // ---------------------------------------------------------------------------
372:
373: /** Header injected by the OpenCode plugin identifying the calling agent. */
374: export const LORE_AGENT_HEADER = "x-lore-agent";
375:
376: /**
377: * Agent names known to be primary conversation agents (NOT meta).
378: * When `x-lore-agent` matches, the request is always a normal turn. ...
Found 1 matches
/home/byk/Code/opencode-v2-pilot/packages/util/src/npm.ts:
Line 49: export async function isInstallablePackage(pkg: string) {
<path>/home/byk/Code/opencode-v2-pilot/packages/util/src/npm.ts</path>
<type>file</type>
<content>
40: export function sanitize(pkg: string) {
41: if (!illegal) return pkg
42: return Array.from(pkg, (char) => (illegal.has(char) || char.charCodeAt(0) < 32 ? "_" : char)).join("")
43: }
44:
45: export async function isRegistryPackage(pkg: string) {
46: return (await parse(pkg))?.type === "registry"
47: }
48:
49: export async function isInstallablePackage(pkg: string) {
50: return (await parse(pkg)) !== undefined
51: }
52:
53: export async function cacheKey(pkg: string) {
54: return key(pkg, await parse(pkg))
55: }
56:
57: type Target =
58: | { readonly type: "registry"; readonly name: string; readonly spec: string; readonly mutable: boolean }
59: | { readonly type: "git"; readonly name?: string; readonly slug: string; readonly mutable: boolean }
60:
61: async function parse(pkg: string): Promise<Target | undefined> {
62: const { default: npa } = await ...
[
{
"content": "Inspect repository guidance and relevant manifests, exports, configs, and candidate state",
"status": "completed",
"priority": "high"
},
{
"content": "Trace Lore plugin entrypoint, dependencies, hooks, APIs, and startup assumptions",
"status": "completed",
"priority": "high"
},
{
"content": "Trace V2 plugin discovery, loader, and Promise plugin contracts",
"status": "completed",
"priority": "high"
},
{
"content": "Compare both sides and classify every concrete incompatibility",
"status": "completed",
"priority": "high"
},
{
"content": "Define the smallest viable port and complete validation sequence",
"status": "completed",
"priority": "medium"
},
{
"content": "Prepare a concise evidence-based compatibility report",
"status": "completed",
"priority": "high"
}
]
Verdict
Within the requested static scope, Lore is not activated in the isolated V2 pilot. Lore 0.40.0 also cannot load unchanged under V2: the V2 loader rejects its default export before setup runs.
Paths below use these roots:
Lore: /home/byk/Code/opencode-loreV2: /home/byk/Code/opencode-v2-pilotPilot: /home/byk/.local/share/opencode-v2-pilot/config/opencodeStatic Activation
Pilot/opencode.json:1-3 contains only $schema; it declares no plugins.Pilot/package.json:4-8 and Pilot/bun.lock:4-12 contain only effect and @types/bun. Neither contains Lore or the legacy OpenCode plugin SDK..ts and .js files, symlinks, and directories from plugin or plugins directories: V2/packages/core/src/plugin/source-directory.ts:7-32.followup at Pilot/plugins/followup.ts:22-24 and local-pty at Pilot/plugins/pty.ts:148-151, with the latter exported at Pilot/plugins/pty.ts:493.V2/.opencode/opencode.jsonc:1-20. Its .opencode/plugins/smoke-theme.json is ignored because discovery accepts only .ts, .js, or directories..opencode/package.json:1-5 installs the legacy @opencode-ai/plugin, but does not activate Lore.Pilot/service-v2-pilot.json:2-4 contains only service connection keys: hostname, port, and password. It stores no plugin inventory or activation state. I inspected key names only and did not read any values.Pilot/node_modules/@loreai or Pilot/node_modules/@opencode-ai/plugin tree exists.Therefore the previous runtime inventory of only followup and local-pty matches every supplied static activation source.
Loader Comparison Lore’s published server entry is a legacy plugin function:
src/index.ts as its root: Lore/packages/opencode/package.json:7-15. ...* 🟡 (03:05) Port investigation status changed to fully completed: 1. inspect repository guidance/manifests/exports/configs/candidate state—completed; 2. trace Lore entrypoint/dependencies/hooks/APIs/startup assumptions—completed; 3. trace V2 plugin discovery/loader/Promise contracts—completed; 4. compare and classify every concrete incompatibility—completed; 5. define smallest viable port and va…
* 🟡 (02:50) `/home/byk/Code/opencode-v2-pilot/packages/cli/src/commands/handlers/plugin/inventory.ts` defines `Item` with `runtime: "Server" | "TUI"`, `target`, `name`, optional `version`, `outdated`, and optional `error`. `inspect(selected?)` obtains the service endpoint, calls `client.plugin.list({ location: { directory: process.cwd() } })`, checks server package plugins through `client.plugin…
* 🔴 (02:47) User specified that every internal Lore worker must use `mode: "subagent"` and `hidden: true` so it never surfaces in the host project's agent/skill picker. * 🟡 (02:47) `/home/byk/Code/opencode-lore/packages/opencode/test/index.test.ts` tests `LorePlugin` with a mock client and timestamped temp directory. Its config-hook cases verify: built-in compaction becomes `{ auto: false, prun…
* 🔴 (02:41) User specified that `processBoundary?: boolean` in `/home/byk/Code/opencode-lore/packages/gateway/src/cli/start.ts` is an internal CLI-owned process boundary and is never set by in-process plugins. * 🟡 (02:41) `/home/byk/Code/opencode-lore/packages/gateway/src/cli/start.ts` defines `GatewayHandle` with `config: GatewayConfig`, `port: number`, ownership flag `owned: boolean`, owner-o…
* 🔴 (02:40) User specified that `AIError` wraps a union of tagged reason errors, stores only `reason`, derives `message` from that reason, and exposes the reason as its `cause`. * 🔴 (02:40) User specified that each `AIError` reason owns its readable `message`, category-specific fields, optional `body`, optional `http`, and any underlying exception in `cause`. * 🔴 (02:40) User specified that `r…
* 🟡 (02:38) `/home/byk/Code/opencode-lore/packages/core/src/fetch-interceptor.ts` bypasses interception for local hostnames `localhost`, `127.0.0.1`, `0.0.0.0`, `::1`, and `[::1]`, returning `originalFetch(input, init)`. * 🟡 (02:38) Fetch interception has 2 routing paths: 1. known LLM API paths matched by `matchesLLMApiPath(upstream.pathname)` use `interceptUrl(upstream, gateway)`; 2. unmatched…
* 🟡 (02:34) `/home/byk/.local/share/opencode-v2-pilot/config/opencode/test/followup.test.ts` imports `../plugins/followup.ts` and tests tools `schedule_followup`, `list_followups`, and `cancel_followup`; it checks scheduling with `{ delay: "1s", message: "deliver" }`, listing by returned ID, cancellation output containing `"Cancelled"`, rejection/blocking for `sessionID: "subagent"`, and deliver…
Date: September 9, 2026 * 🟡 (02:31) `/home/byk/Code/opencode-v2-pilot/packages/protocol/src/groups/session.ts` defines `ParentIDFilter` as `Session.ID | null`, where query string `"null"` decodes to `null` to return only root sessions. * 🟡 (02:31) Session-list query fields are `workspace?`, positive integer `limit?` (default newest 50), `order?: "asc" | "desc"`, `search?`, and `parentID?`; `Ses…
Date: September 9, 2026 * 🟡 (02:29) `/home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/aisdk.ts` defines `AISDKHooks` with `sdk` and `language` hooks. `sdk` receives readonly `model: Model.Info`, `package: string`, `options: Record<string, any>`, and mutable optional `sdk?: any`; `language` receives readonly `model: Model.Info`, `sdk: any`, `options: Record<string, any>`, and mutable …
Date: September 9, 2026 * 🟡 (02:27) `/home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/adapter.ts` implements `fromPromise(plugin: Plugin)`, adapting a Promise plugin into an Effect plugin via `define({ id: plugin.id, effect })`; `plugin.setup(context2)` is acquired with `Effect.acquireRelease`, and its optional cleanup runs when the plugin scope is released. Hook registrations run in…
Date: September 9, 2026 * 🟡 (02:24) `/home/byk/Code/opencode-lore/package.json` defines private ESM workspace root `lore-monorepo`, license `FSL-1.1-Apache-2.0`, description `Monorepo root for Lore — three-tier memory architecture`, entry/export `./packages/opencode/src/index.ts`, package manager `pnpm@10.28.0`, Volta Node `24.16.0` and pnpm `10.28.0`, workspace pattern `packages/*`, repository …
Date: September 9, 2026 * 🟡 (02:23) Repository listing identified core plugin modules in `/home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/`: `warming.ts`, `vcs/hg.ts`, `vcs/git.ts`, `variant.ts`, `update.ts`, `supervisor.ts`, `source-directory.ts`, `skill.ts`, `service.ts`, `sdk.ts`, `provider.ts`, `promise.ts`, `plan.ts`, `optimize.ts`, `module.ts`, `models-dev.ts`, `mcp-codemode-excl…
## September 9, 2026 🟡 (02:23) Repository search returned exactly 100 matches with additional matches available, identifying V2 plugin integration points across `packages/sdk`, `packages/plugin-browser`, `packages/server`, `packages/protocol`, `packages/desktop`, `packages/core`, and `packages/tui`. 🟡 (02:23) `/home/byk/Code/opencode-v2-pilot/packages/sdk/src/tool.ts:3` re-exports `ToolContex…
## September 9, 2026 🟡 (02:20) [requested-investigation] User requested a read-only compatibility investigation comparing Lore source `/home/byk/Code/opencode-lore`, OpenCode V2 source `/home/byk/Code/opencode-v2-pilot`, and isolated pilot config `/home/byk/.local/share/opencode-v2-pilot/config/opencode`, with a substantive final report supported by current file:line evidence. 🔴 (02:20) User …