opencode-ext-connector 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +1 -1
  3. package/dist/catalog/parse-ids.d.ts +1 -1
  4. package/dist/catalog/parse-ids.js +1 -1
  5. package/dist/core/adapter.d.ts +3 -3
  6. package/dist/core/adapter.js +1 -1
  7. package/dist/core/deadline.d.ts +2 -2
  8. package/dist/core/deadline.js +2 -2
  9. package/dist/core/errors.d.ts +1 -1
  10. package/dist/core/logger.d.ts +1 -1
  11. package/dist/core/models.d.ts +1 -1
  12. package/dist/core/models.js +1 -1
  13. package/dist/core/options.d.ts +1 -1
  14. package/dist/core/process.d.ts +1 -1
  15. package/dist/http/fetch-transport.d.ts +1 -1
  16. package/dist/http/package-version.d.ts +1 -1
  17. package/dist/http/read-body.d.ts +1 -1
  18. package/dist/logging/logger.d.ts +2 -2
  19. package/dist/logging/logger.js +1 -1
  20. package/dist/opencode/catalog-bridge.d.ts +2 -2
  21. package/dist/opencode/catalog-bridge.js +1 -1
  22. package/dist/opencode/health-refresh.d.ts +5 -5
  23. package/dist/opencode/health-refresh.js +4 -4
  24. package/dist/opencode/host-options.d.ts +1 -1
  25. package/dist/opencode/language-factory.d.ts +3 -3
  26. package/dist/opencode/language-factory.js +5 -5
  27. package/dist/opencode/ollama-probe.d.ts +1 -1
  28. package/dist/opencode/ollama-probe.js +3 -3
  29. package/dist/opencode/ollama-production.d.ts +2 -2
  30. package/dist/opencode/ollama-production.js +3 -3
  31. package/dist/opencode/plugin.d.ts +6 -6
  32. package/dist/opencode/plugin.js +1 -1
  33. package/dist/opencode/provider-entry.d.ts +6 -6
  34. package/dist/opencode/providers.d.ts +4 -4
  35. package/dist/opencode/providers.js +16 -16
  36. package/dist/opencode/register-integrations.d.ts +2 -2
  37. package/dist/opencode/reload.d.ts +1 -1
  38. package/dist/opencode/reload.js +1 -1
  39. package/dist/opencode/v1-anthropic-auth.d.ts +1 -1
  40. package/dist/opencode/v1-anthropic-auth.js +1 -1
  41. package/dist/opencode/v1-catalog.d.ts +2 -2
  42. package/dist/opencode/v1-catalog.js +1 -1
  43. package/dist/opencode/v1-language.js +7 -7
  44. package/dist/opencode/v1-module.d.ts +6 -6
  45. package/dist/opencode/v1-module.js +6 -6
  46. package/dist/opencode/v1-session-auth.d.ts +1 -1
  47. package/dist/opencode/v1-session-auth.js +4 -4
  48. package/dist/providers/claude/adapter.d.ts +2 -2
  49. package/dist/providers/claude/adapter.js +3 -3
  50. package/dist/providers/claude/auth-json.d.ts +1 -1
  51. package/dist/providers/claude/auth.d.ts +4 -4
  52. package/dist/providers/claude/auth.js +3 -3
  53. package/dist/providers/claude/cli-version.d.ts +1 -1
  54. package/dist/providers/claude/cli-version.js +1 -1
  55. package/dist/providers/claude/compat-betas.js +1 -1
  56. package/dist/providers/claude/compat-request.js +3 -3
  57. package/dist/providers/claude/compat-response.js +1 -1
  58. package/dist/providers/claude/compat-transform.js +2 -2
  59. package/dist/providers/claude/emit-stream.js +1 -1
  60. package/dist/providers/claude/language-model.d.ts +1 -1
  61. package/dist/providers/claude/language-model.js +5 -5
  62. package/dist/providers/claude/models.d.ts +2 -2
  63. package/dist/providers/claude/models.js +2 -2
  64. package/dist/providers/claude/prompt.d.ts +1 -1
  65. package/dist/providers/claude/prompt.js +1 -1
  66. package/dist/providers/claude/refresh.d.ts +3 -3
  67. package/dist/providers/claude/sse-convert.d.ts +1 -1
  68. package/dist/providers/claude/sse.d.ts +1 -1
  69. package/dist/providers/claude/sse.js +2 -2
  70. package/dist/providers/claude/writeback.d.ts +1 -1
  71. package/dist/providers/claude/writeback.js +4 -4
  72. package/dist/providers/command-code/adapter.d.ts +2 -2
  73. package/dist/providers/command-code/adapter.js +3 -3
  74. package/dist/providers/command-code/auth.js +1 -1
  75. package/dist/providers/command-code/cli-version.d.ts +1 -1
  76. package/dist/providers/command-code/cli-version.js +1 -1
  77. package/dist/providers/command-code/emit-stream.js +2 -2
  78. package/dist/providers/command-code/language-model.d.ts +2 -2
  79. package/dist/providers/command-code/language-model.js +10 -13
  80. package/dist/providers/command-code/models.d.ts +2 -2
  81. package/dist/providers/command-code/models.js +1 -1
  82. package/dist/providers/command-code/record-stream.js +1 -1
  83. package/dist/providers/command-code/request-lifecycle.d.ts +1 -1
  84. package/dist/providers/command-code/request-lifecycle.js +3 -3
  85. package/dist/providers/command-code/request.d.ts +1 -1
  86. package/dist/providers/cursor/adapter.d.ts +2 -2
  87. package/dist/providers/cursor/adapter.js +3 -3
  88. package/dist/providers/cursor/auth.d.ts +1 -1
  89. package/dist/providers/cursor/auth.js +2 -2
  90. package/dist/providers/cursor/blob-store.d.ts +1 -1
  91. package/dist/providers/cursor/blob-store.js +1 -1
  92. package/dist/providers/cursor/bridge-client.d.ts +2 -2
  93. package/dist/providers/cursor/bridge-client.js +4 -4
  94. package/dist/providers/cursor/bridge-event-sanitize.d.ts +1 -1
  95. package/dist/providers/cursor/bridge-limits.js +1 -1
  96. package/dist/providers/cursor/bridge-process.d.ts +1 -1
  97. package/dist/providers/cursor/bridge-process.js +2 -2
  98. package/dist/providers/cursor/bridge-protocol.d.ts +4 -4
  99. package/dist/providers/cursor/bridge-protocol.js +6 -6
  100. package/dist/providers/cursor/bridge-serialize.d.ts +1 -1
  101. package/dist/providers/cursor/bridge-serialize.js +3 -3
  102. package/dist/providers/cursor/bridge-wire.d.ts +1 -1
  103. package/dist/providers/cursor/bridge-wire.js +3 -3
  104. package/dist/providers/cursor/checkpoint-store.d.ts +3 -3
  105. package/dist/providers/cursor/checkpoint-store.js +1 -1
  106. package/dist/providers/cursor/connect-frame-stream.js +2 -2
  107. package/dist/providers/cursor/connect-frame.js +1 -1
  108. package/dist/providers/cursor/direct-run-types.d.ts +7 -7
  109. package/dist/providers/cursor/direct-run.d.ts +2 -2
  110. package/dist/providers/cursor/direct-run.js +14 -14
  111. package/dist/providers/cursor/direct-runtime.d.ts +5 -5
  112. package/dist/providers/cursor/direct-runtime.js +9 -9
  113. package/dist/providers/cursor/direct-stream.d.ts +4 -4
  114. package/dist/providers/cursor/direct-stream.js +4 -4
  115. package/dist/providers/cursor/exec-reply.d.ts +4 -4
  116. package/dist/providers/cursor/exec-reply.js +4 -4
  117. package/dist/providers/cursor/h2-bridge-response.js +1 -1
  118. package/dist/providers/cursor/h2-bridge-session.d.ts +1 -1
  119. package/dist/providers/cursor/h2-bridge-session.js +2 -2
  120. package/dist/providers/cursor/http2.js +1 -1
  121. package/dist/providers/cursor/interaction-reply.d.ts +1 -1
  122. package/dist/providers/cursor/interaction-reply.js +2 -2
  123. package/dist/providers/cursor/language-generate.js +1 -1
  124. package/dist/providers/cursor/language-model.d.ts +1 -1
  125. package/dist/providers/cursor/language-model.js +6 -6
  126. package/dist/providers/cursor/legacy-stream.js +5 -5
  127. package/dist/providers/cursor/mcp-tools.js +2 -2
  128. package/dist/providers/cursor/models.d.ts +2 -2
  129. package/dist/providers/cursor/models.js +4 -4
  130. package/dist/providers/cursor/proto/checkpoint.js +3 -3
  131. package/dist/providers/cursor/proto/context.js +3 -3
  132. package/dist/providers/cursor/proto/exec-control.js +3 -3
  133. package/dist/providers/cursor/proto/exec.d.ts +3 -3
  134. package/dist/providers/cursor/proto/exec.js +5 -5
  135. package/dist/providers/cursor/proto/fields.d.ts +1 -1
  136. package/dist/providers/cursor/proto/fields.js +3 -3
  137. package/dist/providers/cursor/proto/interaction-query.js +3 -3
  138. package/dist/providers/cursor/proto/interaction-tool-update.d.ts +1 -1
  139. package/dist/providers/cursor/proto/interaction-tool-update.js +3 -3
  140. package/dist/providers/cursor/proto/interaction-turn-ended.js +2 -2
  141. package/dist/providers/cursor/proto/interaction.d.ts +4 -4
  142. package/dist/providers/cursor/proto/interaction.js +7 -7
  143. package/dist/providers/cursor/proto/kv.js +3 -3
  144. package/dist/providers/cursor/proto/mcp-result.d.ts +2 -2
  145. package/dist/providers/cursor/proto/mcp-result.js +5 -5
  146. package/dist/providers/cursor/proto/mcp.d.ts +1 -1
  147. package/dist/providers/cursor/proto/mcp.js +5 -5
  148. package/dist/providers/cursor/proto/model.js +2 -2
  149. package/dist/providers/cursor/proto/output-location.js +4 -4
  150. package/dist/providers/cursor/proto/prewarm.d.ts +3 -3
  151. package/dist/providers/cursor/proto/prewarm.js +5 -5
  152. package/dist/providers/cursor/proto/request-context.d.ts +1 -1
  153. package/dist/providers/cursor/proto/request-context.js +4 -4
  154. package/dist/providers/cursor/proto/request.d.ts +11 -11
  155. package/dist/providers/cursor/proto/request.js +11 -11
  156. package/dist/providers/cursor/proto/run-request.d.ts +4 -4
  157. package/dist/providers/cursor/proto/run-request.js +6 -6
  158. package/dist/providers/cursor/proto/server.d.ts +7 -7
  159. package/dist/providers/cursor/proto/server.js +8 -8
  160. package/dist/providers/cursor/proto/unknown-field.js +2 -2
  161. package/dist/providers/cursor/proto-value.js +3 -3
  162. package/dist/providers/cursor/proto-wire.js +1 -1
  163. package/dist/providers/cursor/protocol-failure.d.ts +1 -1
  164. package/dist/providers/cursor/protocol-failure.js +1 -1
  165. package/dist/providers/cursor/recovery.d.ts +2 -2
  166. package/dist/providers/cursor/recovery.js +2 -2
  167. package/dist/providers/cursor/request-blob-ownership.d.ts +1 -1
  168. package/dist/providers/cursor/request-build.d.ts +3 -3
  169. package/dist/providers/cursor/request-build.js +6 -6
  170. package/dist/providers/cursor/request-history.d.ts +4 -4
  171. package/dist/providers/cursor/request-history.js +2 -2
  172. package/dist/providers/cursor/request-input.d.ts +4 -4
  173. package/dist/providers/cursor/request-input.js +2 -2
  174. package/dist/providers/cursor/run-events.js +1 -1
  175. package/dist/providers/cursor/run-session-expiry.d.ts +1 -1
  176. package/dist/providers/cursor/run-session.d.ts +6 -6
  177. package/dist/providers/cursor/run-session.js +4 -4
  178. package/dist/providers/cursor/run.d.ts +2 -2
  179. package/dist/providers/cursor/run.js +8 -8
  180. package/dist/providers/cursor/runner.js +3 -3
  181. package/dist/providers/cursor/server-dispatch-types.d.ts +6 -6
  182. package/dist/providers/cursor/server-dispatch.d.ts +2 -2
  183. package/dist/providers/cursor/server-dispatch.js +5 -5
  184. package/dist/providers/cursor/session-state.d.ts +2 -2
  185. package/dist/providers/cursor/session-state.js +1 -1
  186. package/dist/providers/cursor/stream-adapter.d.ts +2 -2
  187. package/dist/providers/cursor/stream-adapter.js +1 -1
  188. package/dist/providers/cursor/tool-continuation.d.ts +1 -1
  189. package/dist/providers/cursor/tool-continuation.js +1 -1
  190. package/dist/providers/ollama/adapter.d.ts +3 -3
  191. package/dist/providers/ollama/adapter.js +5 -5
  192. package/dist/providers/ollama/catalog-state.d.ts +3 -3
  193. package/dist/providers/ollama/catalog-state.js +4 -4
  194. package/dist/providers/ollama/cloud-catalog.d.ts +2 -2
  195. package/dist/providers/ollama/cloud-catalog.js +4 -4
  196. package/dist/providers/ollama/http.js +2 -2
  197. package/dist/providers/ollama/index.d.ts +8 -8
  198. package/dist/providers/ollama/index.js +8 -8
  199. package/dist/providers/ollama/language-model.d.ts +3 -3
  200. package/dist/providers/ollama/language-model.js +5 -5
  201. package/dist/providers/ollama/local-catalog.d.ts +2 -2
  202. package/dist/providers/ollama/local-catalog.js +3 -3
  203. package/dist/providers/ollama/ndjson.d.ts +1 -1
  204. package/dist/providers/ollama/ndjson.js +1 -1
  205. package/dist/providers/ollama/prompt.d.ts +1 -1
  206. package/dist/providers/ollama/prompt.js +1 -1
  207. package/dist/providers/ollama/runtime.d.ts +3 -3
  208. package/dist/providers/ollama/runtime.js +6 -6
  209. package/dist/providers/ollama/stream.js +3 -3
  210. package/dist/sdk/command-code.js +1 -1
  211. package/dist/sdk/cursor.js +1 -1
  212. package/dist/sdk/ollama.js +1 -1
  213. package/dist/server.js +10 -10
  214. package/docs/README.ko.md +1 -1
  215. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.1 - 2026-09-05
4
+
5
+ - Fix Node ESM compatibility for root and SDK subpath imports by using explicit
6
+ `.js` extensions in emitted relative specifiers
7
+ - Enforce NodeNext module resolution in the build and cover Node consumers of
8
+ the packed artifact
9
+
3
10
  ## 0.3.0 - 2026-09-05
4
11
 
5
12
  - Publish releases to npm from GitHub Actions when a `v*` tag is pushed; the
package/README.md CHANGED
@@ -19,7 +19,7 @@
19
19
 
20
20
  ## Status
21
21
 
22
- > Independent unofficial community plugin, version **0.3.0**. Package E2E tests exercise the legacy multi-function loader with the OpenCode CLI installed in CI. `@opencode-ai/plugin@1.18.18` is the compile-time plugin API target, not a runtime pin. Source is BSD-3-Clause. This project is not affiliated with, endorsed by, sponsored by, or authorized by OpenCode or any provider. Full terms are in [License and Disclaimer](#license-and-disclaimer).
22
+ > Independent unofficial community plugin, version **0.3.1**. Package E2E tests exercise the legacy multi-function loader with the OpenCode CLI installed in CI. `@opencode-ai/plugin@1.18.18` is the compile-time plugin API target, not a runtime pin. Source is BSD-3-Clause. This project is not affiliated with, endorsed by, sponsored by, or authorized by OpenCode or any provider. Full terms are in [License and Disclaimer](#license-and-disclaimer).
23
23
 
24
24
  Reuse the Claude, Cursor, Command Code, and Ollama sessions you already have. One `opencode.json` plugin entry publishes live catalogs into OpenCode. Claude and Cursor stay disconnected until OpenCode has a marker or OAuth record and the vendor session is present. Command Code may use an OpenCode-stored direct API key or an existing CLI session/key. Ollama requires the exact session marker plus a responsive localhost daemon.
25
25
 
@@ -1,2 +1,2 @@
1
- import type { AdapterModel } from "../core/models";
1
+ import type { AdapterModel } from "../core/models.js";
2
2
  export declare function parseModelIdList(value: unknown): readonly AdapterModel[];
@@ -1,4 +1,4 @@
1
- import { parseModelId } from "../core/ids";
1
+ import { parseModelId } from "../core/ids.js";
2
2
  function idFromUnknown(value) {
3
3
  if (typeof value === "string" && value.length > 0) {
4
4
  return value;
@@ -1,6 +1,6 @@
1
- import type { ProviderId } from "./ids";
2
- import type { AsyncDisposableHandle } from "./lifecycle";
3
- import type { ProviderSnapshot } from "./models";
1
+ import type { ProviderId } from "./ids.js";
2
+ import type { AsyncDisposableHandle } from "./lifecycle.js";
3
+ import type { ProviderSnapshot } from "./models.js";
4
4
  export interface ProviderAdapter extends AsyncDisposableHandle {
5
5
  readonly providerId: ProviderId;
6
6
  snapshot(signal: AbortSignal): Promise<ProviderSnapshot>;
@@ -1,4 +1,4 @@
1
- import { AdapterError, OperationCancelledError } from "./errors";
1
+ import { AdapterError, OperationCancelledError } from "./errors.js";
2
2
  export async function refreshProviderCatalog(options) {
3
3
  if (options.signal.aborted) {
4
4
  throw new OperationCancelledError("refresh-provider-catalog");
@@ -1,5 +1,5 @@
1
- import type { Clock } from "./clock";
2
- import type { AsyncDisposableHandle } from "./lifecycle";
1
+ import type { Clock } from "./clock.js";
2
+ import type { AsyncDisposableHandle } from "./lifecycle.js";
3
3
  export type DeadlineOptions = {
4
4
  readonly clock: Clock;
5
5
  readonly timeoutMs: number;
@@ -1,5 +1,5 @@
1
- import { DeadlineExceededError, InvalidArgumentError, OperationCancelledError, ResourceDisposedError, } from "./errors";
2
- import { createAsyncDisposable } from "./lifecycle";
1
+ import { DeadlineExceededError, InvalidArgumentError, OperationCancelledError, ResourceDisposedError, } from "./errors.js";
2
+ import { createAsyncDisposable } from "./lifecycle.js";
3
3
  export function createDeadline(options) {
4
4
  if (!Number.isSafeInteger(options.timeoutMs) || options.timeoutMs < 0) {
5
5
  throw new InvalidArgumentError("timeoutMs");
@@ -1,4 +1,4 @@
1
- import type { ProviderId } from "./ids";
1
+ import type { ProviderId } from "./ids.js";
2
2
  export type ConnectorErrorCode = "invalid-argument" | "operation-cancelled" | "deadline-exceeded" | "resource-disposed" | "adapter-error" | "http-transport-error" | "process-supervisor-error";
3
3
  type ConnectorErrorOptions = {
4
4
  readonly code: ConnectorErrorCode;
@@ -1,4 +1,4 @@
1
- import type { Clock } from "./clock";
1
+ import type { Clock } from "./clock.js";
2
2
  export type LogLevel = "debug" | "info" | "warn" | "error";
3
3
  export type LogValue = null | boolean | number | string | readonly LogValue[] | {
4
4
  readonly [key: string]: LogValue;
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import type { ModelId, ProviderId } from "./ids";
2
+ import type { ModelId, ProviderId } from "./ids.js";
3
3
  export type AdapterModelInput = {
4
4
  readonly id: string;
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { ModelIdSchema, ProviderIdSchema } from "./ids";
2
+ import { ModelIdSchema, ProviderIdSchema } from "./ids.js";
3
3
  export const AdapterModelSchema = z
4
4
  .object({ id: ModelIdSchema })
5
5
  .strict()
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import type { HealthPolicy } from "./health";
2
+ import type { HealthPolicy } from "./health.js";
3
3
  export type CredentialRefreshMode = "auto" | "never";
4
4
  export type CredentialRefreshPolicy = {
5
5
  readonly mode: CredentialRefreshMode;
@@ -1,4 +1,4 @@
1
- import type { AsyncDisposableHandle } from "./lifecycle";
1
+ import type { AsyncDisposableHandle } from "./lifecycle.js";
2
2
  export type ProcessCommand = {
3
3
  readonly executable: string;
4
4
  readonly arguments: readonly string[];
@@ -1,2 +1,2 @@
1
- import type { HttpTransport } from "../core/http";
1
+ import type { HttpTransport } from "../core/http.js";
2
2
  export declare function createFetchHttpTransport(): HttpTransport;
@@ -1,4 +1,4 @@
1
- import type { HttpTransport } from "../core/http";
1
+ import type { HttpTransport } from "../core/http.js";
2
2
  export type PackageVersionResolver = (signal: AbortSignal) => Promise<string | null>;
3
3
  export type PackageVersionResolverOptions = {
4
4
  readonly transport: HttpTransport;
@@ -1,4 +1,4 @@
1
- import type { HttpHeaders, HttpRequest, HttpTransport } from "../core/http";
1
+ import type { HttpHeaders, HttpRequest, HttpTransport } from "../core/http.js";
2
2
  export type HttpBodyStream = {
3
3
  readonly status: number;
4
4
  readonly statusText?: string;
@@ -1,4 +1,4 @@
1
- import type { Clock } from "../core/clock";
2
- import { type ConnectorLogger, type LogSink } from "../core/logger";
1
+ import type { Clock } from "../core/clock.js";
2
+ import { type ConnectorLogger, type LogSink } from "../core/logger.js";
3
3
  export declare function createConsoleLogSink(): LogSink;
4
4
  export declare function createConsoleLogger(clock: Clock): ConnectorLogger;
@@ -1,4 +1,4 @@
1
- import { createConnectorLogger, } from "../core/logger";
1
+ import { createConnectorLogger, } from "../core/logger.js";
2
2
  export function createConsoleLogSink() {
3
3
  return {
4
4
  write(record) {
@@ -1,3 +1,3 @@
1
- import type { CatalogPublisher } from "../core/adapter";
2
- import type { CatalogDraft } from "./beta-api";
1
+ import type { CatalogPublisher } from "../core/adapter.js";
2
+ import type { CatalogDraft } from "./beta-api.js";
3
3
  export declare function createCatalogPublisher(draft: CatalogDraft): CatalogPublisher;
@@ -1,4 +1,4 @@
1
- import { InvalidArgumentError, OperationCancelledError } from "../core/errors";
1
+ import { InvalidArgumentError, OperationCancelledError } from "../core/errors.js";
2
2
  function assertNever(_value) {
3
3
  throw new InvalidArgumentError("snapshot.status");
4
4
  }
@@ -1,8 +1,8 @@
1
- import type { CatalogPublisher, ProviderAdapter } from "../core/adapter";
2
- import type { Clock } from "../core/clock";
3
- import { type HealthPolicy, type HealthState } from "../core/health";
4
- import type { ProviderId } from "../core/ids";
5
- import type { ConnectorLogger } from "../core/logger";
1
+ import type { CatalogPublisher, ProviderAdapter } from "../core/adapter.js";
2
+ import type { Clock } from "../core/clock.js";
3
+ import { type HealthPolicy, type HealthState } from "../core/health.js";
4
+ import type { ProviderId } from "../core/ids.js";
5
+ import type { ConnectorLogger } from "../core/logger.js";
6
6
  export type HealthStore = Map<ProviderId, HealthState>;
7
7
  export declare function refreshAdaptersWithHealth(options: {
8
8
  readonly adapters: readonly ProviderAdapter[];
@@ -1,7 +1,7 @@
1
- import { refreshProviderCatalog } from "../core/adapter";
2
- import { createDeadline } from "../core/deadline";
3
- import { ConnectorError } from "../core/errors";
4
- import { createInitialHealthState, reduceHealth, } from "../core/health";
1
+ import { refreshProviderCatalog } from "../core/adapter.js";
2
+ import { createDeadline } from "../core/deadline.js";
3
+ import { ConnectorError } from "../core/errors.js";
4
+ import { createInitialHealthState, reduceHealth, } from "../core/health.js";
5
5
  function errorMessage(error) {
6
6
  if (error instanceof Error) {
7
7
  return error.message;
@@ -1,2 +1,2 @@
1
- import type { ConnectorOptionsInput } from "../core/options";
1
+ import type { ConnectorOptionsInput } from "../core/options.js";
2
2
  export declare function pickConnectorOptionsInput(input: unknown): ConnectorOptionsInput;
@@ -1,7 +1,7 @@
1
1
  import type { LanguageModelV3 } from "@ai-sdk/provider";
2
- import type { HttpTransport } from "../core/http";
3
- import type { CursorDirectRuntime } from "../providers/cursor/direct-runtime";
4
- import type { OllamaRuntime } from "../providers/ollama/runtime";
2
+ import type { HttpTransport } from "../core/http.js";
3
+ import type { CursorDirectRuntime } from "../providers/cursor/direct-runtime.js";
4
+ import type { OllamaRuntime } from "../providers/ollama/runtime.js";
5
5
  export type ConnectorLanguageDeps = {
6
6
  readonly env: Readonly<Record<string, string | undefined>>;
7
7
  readonly transport: HttpTransport;
@@ -1,8 +1,8 @@
1
- import { createClaudeLanguageModel } from "../providers/claude/language-model";
2
- import { readCommandCodeAccessToken } from "../providers/command-code/auth";
3
- import { createCommandCodeLanguageModel } from "../providers/command-code/language-model";
4
- import { createCursorLanguageModel } from "../providers/cursor/language-model";
5
- import { createOllamaLanguageModel } from "../providers/ollama/language-model";
1
+ import { createClaudeLanguageModel } from "../providers/claude/language-model.js";
2
+ import { readCommandCodeAccessToken } from "../providers/command-code/auth.js";
3
+ import { createCommandCodeLanguageModel } from "../providers/command-code/language-model.js";
4
+ import { createCursorLanguageModel } from "../providers/cursor/language-model.js";
5
+ import { createOllamaLanguageModel } from "../providers/ollama/language-model.js";
6
6
  export function createConnectorLanguage(deps) {
7
7
  return (providerID, modelId) => {
8
8
  if (providerID === "claude") {
@@ -1,2 +1,2 @@
1
- import type { OllamaFetch } from "../providers/ollama/http";
1
+ import type { OllamaFetch } from "../providers/ollama/http.js";
2
2
  export declare function probeLocalOllama(fetch: OllamaFetch): Promise<boolean>;
@@ -1,6 +1,6 @@
1
- import { OperationCancelledError } from "../core/errors";
2
- import { OllamaCatalogError } from "../providers/ollama/errors";
3
- import { listLocalOllamaModels } from "../providers/ollama/local-catalog";
1
+ import { OperationCancelledError } from "../core/errors.js";
2
+ import { OllamaCatalogError } from "../providers/ollama/errors.js";
3
+ import { listLocalOllamaModels } from "../providers/ollama/local-catalog.js";
4
4
  const OLLAMA_PROBE_TIMEOUT_MS = 5_000;
5
5
  export async function probeLocalOllama(fetch) {
6
6
  try {
@@ -1,4 +1,4 @@
1
- import { type OllamaCatalogState } from "../providers/ollama/catalog-state";
2
- import { type OllamaRuntime } from "../providers/ollama/runtime";
1
+ import { type OllamaCatalogState } from "../providers/ollama/catalog-state.js";
2
+ import { type OllamaRuntime } from "../providers/ollama/runtime.js";
3
3
  export declare const productionOllamaCatalog: OllamaCatalogState;
4
4
  export declare const productionOllamaRuntime: OllamaRuntime;
@@ -1,6 +1,6 @@
1
- import { createOllamaCatalogState, } from "../providers/ollama/catalog-state";
2
- import { productionOllamaFetch } from "../providers/ollama/http";
3
- import { createOllamaRuntime } from "../providers/ollama/runtime";
1
+ import { createOllamaCatalogState, } from "../providers/ollama/catalog-state.js";
2
+ import { productionOllamaFetch } from "../providers/ollama/http.js";
3
+ import { createOllamaRuntime } from "../providers/ollama/runtime.js";
4
4
  export const productionOllamaCatalog = createOllamaCatalogState({
5
5
  fetch: productionOllamaFetch,
6
6
  });
@@ -1,10 +1,10 @@
1
1
  import type { LanguageModelV3 } from "@ai-sdk/provider";
2
- import type { CatalogPublisher, ProviderAdapter } from "../core/adapter";
3
- import type { Clock } from "../core/clock";
4
- import type { HealthPolicy } from "../core/health";
5
- import type { ConnectorLogger } from "../core/logger";
6
- import type { CatalogDraft, Registration } from "./beta-api";
7
- import { type HealthStore } from "./health-refresh";
2
+ import type { CatalogPublisher, ProviderAdapter } from "../core/adapter.js";
3
+ import type { Clock } from "../core/clock.js";
4
+ import type { HealthPolicy } from "../core/health.js";
5
+ import type { ConnectorLogger } from "../core/logger.js";
6
+ import type { CatalogDraft, Registration } from "./beta-api.js";
7
+ import { type HealthStore } from "./health-refresh.js";
8
8
  export declare const PLUGIN_ID: string;
9
9
  export type CatalogHost = {
10
10
  readonly transform: (callback: (draft: CatalogDraft) => Promise<void> | void) => Promise<Registration>;
@@ -1,4 +1,4 @@
1
- import { refreshAdaptersWithHealth } from "./health-refresh";
1
+ import { refreshAdaptersWithHealth } from "./health-refresh.js";
2
2
  export const PLUGIN_ID = "opencode-ext-connector";
3
3
  export async function setupConnector(options) {
4
4
  const catalogRegistration = await options.catalog.transform(async (draft) => {
@@ -1,10 +1,10 @@
1
1
  import type { AuthHook } from "@opencode-ai/plugin";
2
- import type { ProviderAdapter } from "../core/adapter";
3
- import type { Clock } from "../core/clock";
4
- import type { HttpTransport } from "../core/http";
5
- import type { CredentialRefreshPolicy } from "../core/options";
6
- import type { OpenCodeAuthStore } from "./auth-store";
7
- import type { IntegrationEnvMethod } from "./beta-api";
2
+ import type { ProviderAdapter } from "../core/adapter.js";
3
+ import type { Clock } from "../core/clock.js";
4
+ import type { HttpTransport } from "../core/http.js";
5
+ import type { CredentialRefreshPolicy } from "../core/options.js";
6
+ import type { OpenCodeAuthStore } from "./auth-store.js";
7
+ import type { IntegrationEnvMethod } from "./beta-api.js";
8
8
  export type ProviderEntryDeps = {
9
9
  readonly env: Readonly<Record<string, string | undefined>>;
10
10
  readonly transport: HttpTransport;
@@ -1,7 +1,7 @@
1
- import type { ClaudeCredentials } from "../providers/claude/credentials";
2
- import type { OllamaCatalogState } from "../providers/ollama/catalog-state";
3
- import { type OllamaFetch } from "../providers/ollama/http";
4
- import type { ProviderEntry } from "./provider-entry";
1
+ import type { ClaudeCredentials } from "../providers/claude/credentials.js";
2
+ import type { OllamaCatalogState } from "../providers/ollama/catalog-state.js";
3
+ import { type OllamaFetch } from "../providers/ollama/http.js";
4
+ import type { ProviderEntry } from "./provider-entry.js";
5
5
  export type ProviderConnectionActive = (integrationId: string) => Promise<boolean>;
6
6
  export type ClaudeCredentialWriter = (env: Readonly<Record<string, string | undefined>>, credentials: ClaudeCredentials) => Promise<void>;
7
7
  export type ProviderRegistryOptions = {
@@ -1,19 +1,19 @@
1
- import { createClaudeAdapter } from "../providers/claude/adapter";
2
- import { createClaudeTokenManager, readClaudeCredentials } from "../providers/claude/auth";
3
- import { createClaudeVersionResolver } from "../providers/claude/cli-version";
4
- import { listClaudeModels } from "../providers/claude/models";
5
- import { createCommandCodeAdapter } from "../providers/command-code/adapter";
6
- import { readCommandCodeAccessToken } from "../providers/command-code/auth";
7
- import { listCommandCodeModels } from "../providers/command-code/models";
8
- import { createCursorAdapter } from "../providers/cursor/adapter";
9
- import { readCursorAccessToken } from "../providers/cursor/auth";
10
- import { listCursorUsableModels } from "../providers/cursor/models";
11
- import { createOllamaAdapter } from "../providers/ollama/adapter";
12
- import { productionOllamaFetch } from "../providers/ollama/http";
13
- import { probeLocalOllama } from "./ollama-probe";
14
- import { productionOllamaCatalog } from "./ollama-production";
15
- import { createAnthropicCliAuth } from "./v1-anthropic-auth";
16
- import { createCommandCodeSessionAuth, createCursorSessionAuth, createOllamaSessionAuth, } from "./v1-session-auth";
1
+ import { createClaudeAdapter } from "../providers/claude/adapter.js";
2
+ import { createClaudeTokenManager, readClaudeCredentials } from "../providers/claude/auth.js";
3
+ import { createClaudeVersionResolver } from "../providers/claude/cli-version.js";
4
+ import { listClaudeModels } from "../providers/claude/models.js";
5
+ import { createCommandCodeAdapter } from "../providers/command-code/adapter.js";
6
+ import { readCommandCodeAccessToken } from "../providers/command-code/auth.js";
7
+ import { listCommandCodeModels } from "../providers/command-code/models.js";
8
+ import { createCursorAdapter } from "../providers/cursor/adapter.js";
9
+ import { readCursorAccessToken } from "../providers/cursor/auth.js";
10
+ import { listCursorUsableModels } from "../providers/cursor/models.js";
11
+ import { createOllamaAdapter } from "../providers/ollama/adapter.js";
12
+ import { productionOllamaFetch } from "../providers/ollama/http.js";
13
+ import { probeLocalOllama } from "./ollama-probe.js";
14
+ import { productionOllamaCatalog } from "./ollama-production.js";
15
+ import { createAnthropicCliAuth } from "./v1-anthropic-auth.js";
16
+ import { createCommandCodeSessionAuth, createCursorSessionAuth, createOllamaSessionAuth, } from "./v1-session-auth.js";
17
17
  async function readCommandCodeToken(deps, signal) {
18
18
  const match = await deps.authStore.matchAuth("command-code");
19
19
  if (match === null) {
@@ -1,3 +1,3 @@
1
- import type { IntegrationDraft } from "./beta-api";
2
- import type { ProviderEntry } from "./provider-entry";
1
+ import type { IntegrationDraft } from "./beta-api.js";
2
+ import type { ProviderEntry } from "./provider-entry.js";
3
3
  export declare function registerProviderIntegrations(entries: readonly ProviderEntry[], draft: IntegrationDraft): void;
@@ -1,4 +1,4 @@
1
- import type { Clock } from "../core/clock";
1
+ import type { Clock } from "../core/clock.js";
2
2
  export type CatalogReloadOptions = {
3
3
  readonly clock: Clock;
4
4
  readonly intervalMs: number;
@@ -1,4 +1,4 @@
1
- import { createAsyncDisposable } from "../core/lifecycle";
1
+ import { createAsyncDisposable } from "../core/lifecycle.js";
2
2
  export function scheduleCatalogReload(options) {
3
3
  if (options.intervalMs <= 0) {
4
4
  return createAsyncDisposable(() => undefined);
@@ -1,5 +1,5 @@
1
1
  import type { AuthHook } from "@opencode-ai/plugin";
2
- import type { ClaudeCredentials } from "../providers/claude/credentials";
2
+ import type { ClaudeCredentials } from "../providers/claude/credentials.js";
3
3
  export declare function createAnthropicCliAuth(options: {
4
4
  readonly readCredentials: (signal: AbortSignal) => Promise<ClaudeCredentials | null>;
5
5
  readonly readAccessToken: (signal: AbortSignal) => Promise<string | null>;
@@ -1,4 +1,4 @@
1
- import { createClaudeCompatibilityFetch } from "../providers/claude/compat-request";
1
+ import { createClaudeCompatibilityFetch } from "../providers/claude/compat-request.js";
2
2
  export function createAnthropicCliAuth(options) {
3
3
  const provider = options.provider ?? "anthropic";
4
4
  return {
@@ -1,6 +1,6 @@
1
1
  import type { Hooks } from "@opencode-ai/plugin";
2
- import type { CatalogPublisher } from "../core/adapter";
3
- import type { ProviderEntry } from "./provider-entry";
2
+ import type { CatalogPublisher } from "../core/adapter.js";
3
+ import type { ProviderEntry } from "./provider-entry.js";
4
4
  type HostConfig = Parameters<NonNullable<Hooks["config"]>>[0];
5
5
  export type V1CatalogProjector = {
6
6
  readonly publisher: CatalogPublisher;
@@ -1,4 +1,4 @@
1
- import { InvalidArgumentError, OperationCancelledError } from "../core/errors";
1
+ import { InvalidArgumentError, OperationCancelledError } from "../core/errors.js";
2
2
  function assertNever(_value) {
3
3
  throw new InvalidArgumentError("snapshot.status");
4
4
  }
@@ -1,10 +1,10 @@
1
- import { createFetchHttpTransport } from "../http/fetch-transport";
2
- import { createConsoleLogger } from "../logging/logger";
3
- import { createClaudeTokenReader } from "../providers/claude/auth";
4
- import { readCursorAccessToken } from "../providers/cursor/auth";
5
- import { createCursorDirectRuntime } from "../providers/cursor/direct-runtime";
6
- import { createConnectorLanguage } from "./language-factory";
7
- import { productionOllamaRuntime } from "./ollama-production";
1
+ import { createFetchHttpTransport } from "../http/fetch-transport.js";
2
+ import { createConsoleLogger } from "../logging/logger.js";
3
+ import { createClaudeTokenReader } from "../providers/claude/auth.js";
4
+ import { readCursorAccessToken } from "../providers/cursor/auth.js";
5
+ import { createCursorDirectRuntime } from "../providers/cursor/direct-runtime.js";
6
+ import { createConnectorLanguage } from "./language-factory.js";
7
+ import { productionOllamaRuntime } from "./ollama-production.js";
8
8
  const clock = {
9
9
  nowMs: () => Date.now(),
10
10
  schedule: (delayMs, callback) => {
@@ -1,10 +1,10 @@
1
1
  import type { Hooks, Plugin as V1Plugin } from "@opencode-ai/plugin";
2
- import type { Clock } from "../core/clock";
3
- import type { HealthPolicy } from "../core/health";
4
- import type { HttpTransport } from "../core/http";
5
- import type { ConnectorLogger } from "../core/logger";
6
- import type { OpenCodeAuthStore } from "./auth-store";
7
- import type { ProviderEntry, ProviderEntryDeps } from "./provider-entry";
2
+ import type { Clock } from "../core/clock.js";
3
+ import type { HealthPolicy } from "../core/health.js";
4
+ import type { HttpTransport } from "../core/http.js";
5
+ import type { ConnectorLogger } from "../core/logger.js";
6
+ import type { OpenCodeAuthStore } from "./auth-store.js";
7
+ import type { ProviderEntry, ProviderEntryDeps } from "./provider-entry.js";
8
8
  export type V1ServerOptions = {
9
9
  readonly clock: Clock;
10
10
  readonly transport: HttpTransport;
@@ -1,9 +1,9 @@
1
- import { createAsyncDisposable } from "../core/lifecycle";
2
- import { parseConnectorOptions } from "../core/options";
3
- import { refreshAdaptersWithHealth } from "./health-refresh";
4
- import { pickConnectorOptionsInput } from "./host-options";
5
- import { scheduleCatalogReload } from "./reload";
6
- import { createV1CatalogProjector } from "./v1-catalog";
1
+ import { createAsyncDisposable } from "../core/lifecycle.js";
2
+ import { parseConnectorOptions } from "../core/options.js";
3
+ import { refreshAdaptersWithHealth } from "./health-refresh.js";
4
+ import { pickConnectorOptionsInput } from "./host-options.js";
5
+ import { scheduleCatalogReload } from "./reload.js";
6
+ import { createV1CatalogProjector } from "./v1-catalog.js";
7
7
  function entryDeps(options) {
8
8
  return {
9
9
  env: options.env ?? process.env,
@@ -1,5 +1,5 @@
1
1
  import type { AuthHook } from "@opencode-ai/plugin";
2
- import { type OllamaFetch } from "../providers/ollama/http";
2
+ import { type OllamaFetch } from "../providers/ollama/http.js";
3
3
  export declare function createCursorSessionAuth(env: Readonly<Record<string, string | undefined>>): AuthHook;
4
4
  export declare function createCommandCodeSessionAuth(env: Readonly<Record<string, string | undefined>>): AuthHook;
5
5
  export declare function createOllamaSessionAuth(fetch?: OllamaFetch): AuthHook;
@@ -1,7 +1,7 @@
1
- import { readCommandCodeAccessToken } from "../providers/command-code/auth";
2
- import { readCursorAccessToken } from "../providers/cursor/auth";
3
- import { productionOllamaFetch } from "../providers/ollama/http";
4
- import { probeLocalOllama } from "./ollama-probe";
1
+ import { readCommandCodeAccessToken } from "../providers/command-code/auth.js";
2
+ import { readCursorAccessToken } from "../providers/cursor/auth.js";
3
+ import { productionOllamaFetch } from "../providers/ollama/http.js";
4
+ import { probeLocalOllama } from "./ollama-probe.js";
5
5
  const CURSOR_SESSION_MARKER = "cli-session:cursor";
6
6
  const COMMAND_CODE_SESSION_MARKER = "cli-session:command-code";
7
7
  const OLLAMA_SESSION_MARKER = "cli-session:ollama";
@@ -1,5 +1,5 @@
1
- import type { ProviderAdapter } from "../../core/adapter";
2
- import type { AdapterModel } from "../../core/models";
1
+ import type { ProviderAdapter } from "../../core/adapter.js";
2
+ import type { AdapterModel } from "../../core/models.js";
3
3
  export type ClaudeAdapterOptions = {
4
4
  readonly readAccessToken: (signal: AbortSignal) => Promise<string | null>;
5
5
  readonly listModels: (token: string, signal: AbortSignal) => Promise<readonly AdapterModel[]>;
@@ -1,6 +1,6 @@
1
- import { OperationCancelledError } from "../../core/errors";
2
- import { parseProviderId } from "../../core/ids";
3
- import { createAsyncDisposable } from "../../core/lifecycle";
1
+ import { OperationCancelledError } from "../../core/errors.js";
2
+ import { parseProviderId } from "../../core/ids.js";
3
+ import { createAsyncDisposable } from "../../core/lifecycle.js";
4
4
  export function createClaudeAdapter(options) {
5
5
  const providerId = parseProviderId("claude");
6
6
  const disposal = createAsyncDisposable(() => undefined);
@@ -1,2 +1,2 @@
1
- import type { ClaudeCredentials } from "./credentials";
1
+ import type { ClaudeCredentials } from "./credentials.js";
2
2
  export declare function mergeOpencodeAuthJson(existing: unknown, credentials: ClaudeCredentials): string;
@@ -1,7 +1,7 @@
1
- import type { Clock } from "../../core/clock";
2
- import type { HttpTransport } from "../../core/http";
3
- import type { CredentialRefreshPolicy } from "../../core/options";
4
- import { type ClaudeCredentials } from "./credentials";
1
+ import type { Clock } from "../../core/clock.js";
2
+ import type { HttpTransport } from "../../core/http.js";
3
+ import type { CredentialRefreshPolicy } from "../../core/options.js";
4
+ import { type ClaudeCredentials } from "./credentials.js";
5
5
  export type ClaudeAuthLookup = {
6
6
  readonly readKeychain?: (service: string, signal: AbortSignal) => Promise<string | null>;
7
7
  };
@@ -3,9 +3,9 @@ import { readFile } from "node:fs/promises";
3
3
  import { homedir } from "node:os";
4
4
  import { join } from "node:path";
5
5
  import { promisify } from "node:util";
6
- import { OperationCancelledError } from "../../core/errors";
7
- import { claudeAccessNeedsRefresh, parseClaudeCredentials, } from "./credentials";
8
- import { refreshClaudeAccessTokenResult } from "./refresh";
6
+ import { OperationCancelledError } from "../../core/errors.js";
7
+ import { claudeAccessNeedsRefresh, parseClaudeCredentials, } from "./credentials.js";
8
+ import { refreshClaudeAccessTokenResult } from "./refresh.js";
9
9
  const execFileAsync = promisify(execFile);
10
10
  const CLAUDE_KEYCHAIN_SERVICE = "Claude Code-credentials";
11
11
  function credentialsFromRaw(raw) {
@@ -1,4 +1,4 @@
1
- import type { HttpTransport } from "../../core/http";
1
+ import type { HttpTransport } from "../../core/http.js";
2
2
  export type ClaudeVersionResolver = (signal: AbortSignal) => Promise<string | null>;
3
3
  export type ClaudeVersionResolverOptions = {
4
4
  readonly env: Readonly<Record<string, string | undefined>>;
@@ -1,5 +1,5 @@
1
1
  import { spawnSync } from "node:child_process";
2
- import { createPackageVersionResolver } from "../../http/package-version";
2
+ import { createPackageVersionResolver } from "../../http/package-version.js";
3
3
  const CLAUDE_CODE_PACKAGE = "@anthropic-ai/claude-code";
4
4
  export function parseClaudeCliVersion(stdout) {
5
5
  const match = /(\d+\.\d+\.\d+)/.exec(stdout);
@@ -1,6 +1,6 @@
1
1
  // Derived from griffinmartin/opencode-claude-auth@0f0ff6f12c367339130cbfd250393863ed2c8d9e.
2
2
  // Licensed under MIT. See THIRD_PARTY_NOTICES.md.
3
- import { CLAUDE_BASE_BETAS, CLAUDE_LONG_CONTEXT_BETAS, claudeModelOverride } from "./compat-config";
3
+ import { CLAUDE_BASE_BETAS, CLAUDE_LONG_CONTEXT_BETAS, claudeModelOverride, } from "./compat-config.js";
4
4
  const excludedBetas = new Map();
5
5
  let lastFlags = process.env["ANTHROPIC_BETA_FLAGS"];
6
6
  let lastModelId;
@@ -1,9 +1,9 @@
1
1
  // Derived from griffinmartin/opencode-claude-auth@0f0ff6f12c367339130cbfd250393863ed2c8d9e.
2
2
  // Licensed under MIT. See THIRD_PARTY_NOTICES.md.
3
3
  import { randomUUID } from "node:crypto";
4
- import { claudeModelBetas, excludeClaudeBeta, isClaudeLongContextError, nextClaudeBetaToExclude, } from "./compat-betas";
5
- import { transformClaudeResponse } from "./compat-response";
6
- import { transformClaudeBody } from "./compat-transform";
4
+ import { claudeModelBetas, excludeClaudeBeta, isClaudeLongContextError, nextClaudeBetaToExclude, } from "./compat-betas.js";
5
+ import { transformClaudeResponse } from "./compat-response.js";
6
+ import { transformClaudeBody } from "./compat-transform.js";
7
7
  const sessionId = randomUUID();
8
8
  function requestUrl(input) {
9
9
  const raw = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
@@ -1,6 +1,6 @@
1
1
  // Derived from griffinmartin/opencode-claude-auth@0f0ff6f12c367339130cbfd250393863ed2c8d9e.
2
2
  // Licensed under MIT. See THIRD_PARTY_NOTICES.md.
3
- import { stripClaudeToolPrefix } from "./compat-transform";
3
+ import { stripClaudeToolPrefix } from "./compat-transform.js";
4
4
  export function transformClaudeResponse(response) {
5
5
  if (response.body === null) {
6
6
  return response;