opencode-ext-connector 0.3.0 → 0.3.2
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.
- package/CHANGELOG.md +13 -0
- package/README.md +1 -1
- package/dist/catalog/parse-ids.d.ts +1 -1
- package/dist/catalog/parse-ids.js +1 -1
- package/dist/core/adapter.d.ts +3 -3
- package/dist/core/adapter.js +1 -1
- package/dist/core/deadline.d.ts +2 -2
- package/dist/core/deadline.js +2 -2
- package/dist/core/errors.d.ts +1 -1
- package/dist/core/logger.d.ts +1 -1
- package/dist/core/models.d.ts +1 -1
- package/dist/core/models.js +1 -1
- package/dist/core/options.d.ts +1 -1
- package/dist/core/process.d.ts +1 -1
- package/dist/http/fetch-transport.d.ts +1 -1
- package/dist/http/package-version.d.ts +1 -1
- package/dist/http/read-body.d.ts +1 -1
- package/dist/logging/logger.d.ts +2 -2
- package/dist/logging/logger.js +1 -1
- package/dist/opencode/catalog-bridge.d.ts +2 -2
- package/dist/opencode/catalog-bridge.js +1 -1
- package/dist/opencode/health-refresh.d.ts +5 -5
- package/dist/opencode/health-refresh.js +4 -4
- package/dist/opencode/host-options.d.ts +1 -1
- package/dist/opencode/language-factory.d.ts +3 -3
- package/dist/opencode/language-factory.js +5 -5
- package/dist/opencode/ollama-probe.d.ts +1 -1
- package/dist/opencode/ollama-probe.js +3 -3
- package/dist/opencode/ollama-production.d.ts +2 -2
- package/dist/opencode/ollama-production.js +3 -3
- package/dist/opencode/plugin.d.ts +6 -6
- package/dist/opencode/plugin.js +1 -1
- package/dist/opencode/provider-entry.d.ts +6 -6
- package/dist/opencode/providers.d.ts +4 -4
- package/dist/opencode/providers.js +16 -16
- package/dist/opencode/register-integrations.d.ts +2 -2
- package/dist/opencode/reload.d.ts +1 -1
- package/dist/opencode/reload.js +1 -1
- package/dist/opencode/v1-anthropic-auth.d.ts +1 -1
- package/dist/opencode/v1-anthropic-auth.js +1 -1
- package/dist/opencode/v1-catalog.d.ts +2 -2
- package/dist/opencode/v1-catalog.js +1 -1
- package/dist/opencode/v1-language.js +7 -7
- package/dist/opencode/v1-module.d.ts +6 -6
- package/dist/opencode/v1-module.js +6 -6
- package/dist/opencode/v1-session-auth.d.ts +1 -1
- package/dist/opencode/v1-session-auth.js +4 -4
- package/dist/providers/claude/adapter.d.ts +2 -2
- package/dist/providers/claude/adapter.js +3 -3
- package/dist/providers/claude/auth-json.d.ts +1 -1
- package/dist/providers/claude/auth.d.ts +4 -4
- package/dist/providers/claude/auth.js +3 -3
- package/dist/providers/claude/cli-version.d.ts +1 -1
- package/dist/providers/claude/cli-version.js +1 -1
- package/dist/providers/claude/compat-betas.js +1 -1
- package/dist/providers/claude/compat-request.js +3 -3
- package/dist/providers/claude/compat-response.js +1 -1
- package/dist/providers/claude/compat-transform.js +2 -2
- package/dist/providers/claude/emit-stream.js +1 -1
- package/dist/providers/claude/language-model.d.ts +1 -1
- package/dist/providers/claude/language-model.js +5 -5
- package/dist/providers/claude/models.d.ts +2 -2
- package/dist/providers/claude/models.js +2 -2
- package/dist/providers/claude/prompt.d.ts +1 -1
- package/dist/providers/claude/prompt.js +1 -1
- package/dist/providers/claude/refresh.d.ts +3 -3
- package/dist/providers/claude/sse-convert.d.ts +1 -1
- package/dist/providers/claude/sse.d.ts +1 -1
- package/dist/providers/claude/sse.js +2 -2
- package/dist/providers/claude/writeback.d.ts +1 -1
- package/dist/providers/claude/writeback.js +4 -4
- package/dist/providers/command-code/adapter.d.ts +2 -2
- package/dist/providers/command-code/adapter.js +3 -3
- package/dist/providers/command-code/auth.js +1 -1
- package/dist/providers/command-code/cli-version.d.ts +1 -1
- package/dist/providers/command-code/cli-version.js +1 -1
- package/dist/providers/command-code/emit-stream.js +2 -2
- package/dist/providers/command-code/language-model.d.ts +2 -2
- package/dist/providers/command-code/language-model.js +10 -13
- package/dist/providers/command-code/models.d.ts +2 -2
- package/dist/providers/command-code/models.js +1 -1
- package/dist/providers/command-code/record-stream.js +1 -1
- package/dist/providers/command-code/request-lifecycle.d.ts +1 -1
- package/dist/providers/command-code/request-lifecycle.js +3 -3
- package/dist/providers/command-code/request.d.ts +1 -1
- package/dist/providers/cursor/adapter.d.ts +2 -2
- package/dist/providers/cursor/adapter.js +3 -3
- package/dist/providers/cursor/auth.d.ts +1 -1
- package/dist/providers/cursor/auth.js +2 -2
- package/dist/providers/cursor/blob-store.d.ts +1 -1
- package/dist/providers/cursor/blob-store.js +1 -1
- package/dist/providers/cursor/bridge-client.d.ts +2 -2
- package/dist/providers/cursor/bridge-client.js +4 -4
- package/dist/providers/cursor/bridge-event-sanitize.d.ts +1 -1
- package/dist/providers/cursor/bridge-limits.js +1 -1
- package/dist/providers/cursor/bridge-process.d.ts +1 -1
- package/dist/providers/cursor/bridge-process.js +2 -2
- package/dist/providers/cursor/bridge-protocol.d.ts +4 -4
- package/dist/providers/cursor/bridge-protocol.js +6 -6
- package/dist/providers/cursor/bridge-serialize.d.ts +1 -1
- package/dist/providers/cursor/bridge-serialize.js +3 -3
- package/dist/providers/cursor/bridge-wire.d.ts +1 -1
- package/dist/providers/cursor/bridge-wire.js +3 -3
- package/dist/providers/cursor/checkpoint-store.d.ts +3 -3
- package/dist/providers/cursor/checkpoint-store.js +1 -1
- package/dist/providers/cursor/connect-frame-stream.js +2 -2
- package/dist/providers/cursor/connect-frame.js +1 -1
- package/dist/providers/cursor/direct-run-types.d.ts +7 -7
- package/dist/providers/cursor/direct-run.d.ts +2 -2
- package/dist/providers/cursor/direct-run.js +14 -14
- package/dist/providers/cursor/direct-runtime.d.ts +5 -5
- package/dist/providers/cursor/direct-runtime.js +9 -9
- package/dist/providers/cursor/direct-stream.d.ts +4 -4
- package/dist/providers/cursor/direct-stream.js +4 -4
- package/dist/providers/cursor/exec-reply.d.ts +4 -4
- package/dist/providers/cursor/exec-reply.js +4 -4
- package/dist/providers/cursor/h2-bridge-response.js +1 -1
- package/dist/providers/cursor/h2-bridge-session.d.ts +1 -1
- package/dist/providers/cursor/h2-bridge-session.js +2 -2
- package/dist/providers/cursor/http2.js +1 -1
- package/dist/providers/cursor/interaction-reply.d.ts +1 -1
- package/dist/providers/cursor/interaction-reply.js +2 -2
- package/dist/providers/cursor/language-generate.js +1 -1
- package/dist/providers/cursor/language-model.d.ts +1 -1
- package/dist/providers/cursor/language-model.js +6 -6
- package/dist/providers/cursor/legacy-stream.js +5 -5
- package/dist/providers/cursor/mcp-tools.js +2 -2
- package/dist/providers/cursor/models.d.ts +2 -2
- package/dist/providers/cursor/models.js +4 -4
- package/dist/providers/cursor/proto/checkpoint.js +3 -3
- package/dist/providers/cursor/proto/context.js +3 -3
- package/dist/providers/cursor/proto/exec-control.js +3 -3
- package/dist/providers/cursor/proto/exec.d.ts +3 -3
- package/dist/providers/cursor/proto/exec.js +5 -5
- package/dist/providers/cursor/proto/fields.d.ts +1 -1
- package/dist/providers/cursor/proto/fields.js +3 -3
- package/dist/providers/cursor/proto/interaction-query.js +3 -3
- package/dist/providers/cursor/proto/interaction-tool-update.d.ts +1 -1
- package/dist/providers/cursor/proto/interaction-tool-update.js +3 -3
- package/dist/providers/cursor/proto/interaction-turn-ended.js +2 -2
- package/dist/providers/cursor/proto/interaction.d.ts +4 -4
- package/dist/providers/cursor/proto/interaction.js +7 -7
- package/dist/providers/cursor/proto/kv.js +3 -3
- package/dist/providers/cursor/proto/mcp-result.d.ts +2 -2
- package/dist/providers/cursor/proto/mcp-result.js +5 -5
- package/dist/providers/cursor/proto/mcp.d.ts +1 -1
- package/dist/providers/cursor/proto/mcp.js +5 -5
- package/dist/providers/cursor/proto/model.js +2 -2
- package/dist/providers/cursor/proto/output-location.js +4 -4
- package/dist/providers/cursor/proto/prewarm.d.ts +3 -3
- package/dist/providers/cursor/proto/prewarm.js +5 -5
- package/dist/providers/cursor/proto/request-context.d.ts +1 -1
- package/dist/providers/cursor/proto/request-context.js +4 -4
- package/dist/providers/cursor/proto/request.d.ts +11 -11
- package/dist/providers/cursor/proto/request.js +11 -11
- package/dist/providers/cursor/proto/run-request.d.ts +4 -4
- package/dist/providers/cursor/proto/run-request.js +6 -6
- package/dist/providers/cursor/proto/server.d.ts +7 -7
- package/dist/providers/cursor/proto/server.js +8 -8
- package/dist/providers/cursor/proto/unknown-field.js +2 -2
- package/dist/providers/cursor/proto-value.js +3 -3
- package/dist/providers/cursor/proto-wire.js +1 -1
- package/dist/providers/cursor/protocol-failure.d.ts +1 -1
- package/dist/providers/cursor/protocol-failure.js +1 -1
- package/dist/providers/cursor/recovery.d.ts +2 -2
- package/dist/providers/cursor/recovery.js +2 -2
- package/dist/providers/cursor/request-blob-ownership.d.ts +1 -1
- package/dist/providers/cursor/request-build.d.ts +3 -3
- package/dist/providers/cursor/request-build.js +6 -6
- package/dist/providers/cursor/request-history.d.ts +4 -4
- package/dist/providers/cursor/request-history.js +2 -2
- package/dist/providers/cursor/request-input.d.ts +4 -4
- package/dist/providers/cursor/request-input.js +2 -2
- package/dist/providers/cursor/run-events.js +1 -1
- package/dist/providers/cursor/run-session-expiry.d.ts +1 -1
- package/dist/providers/cursor/run-session.d.ts +6 -6
- package/dist/providers/cursor/run-session.js +4 -4
- package/dist/providers/cursor/run.d.ts +2 -2
- package/dist/providers/cursor/run.js +8 -8
- package/dist/providers/cursor/runner.js +3 -3
- package/dist/providers/cursor/server-dispatch-types.d.ts +6 -6
- package/dist/providers/cursor/server-dispatch.d.ts +2 -2
- package/dist/providers/cursor/server-dispatch.js +5 -5
- package/dist/providers/cursor/session-state.d.ts +2 -2
- package/dist/providers/cursor/session-state.js +1 -1
- package/dist/providers/cursor/stream-adapter.d.ts +2 -2
- package/dist/providers/cursor/stream-adapter.js +1 -1
- package/dist/providers/cursor/tool-continuation.d.ts +1 -1
- package/dist/providers/cursor/tool-continuation.js +1 -1
- package/dist/providers/ollama/adapter.d.ts +3 -3
- package/dist/providers/ollama/adapter.js +5 -5
- package/dist/providers/ollama/catalog-state.d.ts +3 -3
- package/dist/providers/ollama/catalog-state.js +4 -4
- package/dist/providers/ollama/cloud-catalog.d.ts +2 -2
- package/dist/providers/ollama/cloud-catalog.js +4 -4
- package/dist/providers/ollama/http.js +2 -2
- package/dist/providers/ollama/index.d.ts +8 -8
- package/dist/providers/ollama/index.js +8 -8
- package/dist/providers/ollama/language-model.d.ts +3 -3
- package/dist/providers/ollama/language-model.js +5 -5
- package/dist/providers/ollama/local-catalog.d.ts +2 -2
- package/dist/providers/ollama/local-catalog.js +3 -3
- package/dist/providers/ollama/ndjson.d.ts +1 -1
- package/dist/providers/ollama/ndjson.js +1 -1
- package/dist/providers/ollama/prompt.d.ts +1 -1
- package/dist/providers/ollama/prompt.js +1 -1
- package/dist/providers/ollama/runtime.d.ts +3 -3
- package/dist/providers/ollama/runtime.js +6 -6
- package/dist/providers/ollama/stream.js +3 -3
- package/dist/sdk/command-code.js +1 -1
- package/dist/sdk/cursor.js +1 -1
- package/dist/sdk/ollama.js +1 -1
- package/dist/server.js +10 -10
- package/docs/README.ko.md +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { LanguageModelV3CallOptions, LanguageModelV3StreamPart } from "@ai-sdk/provider";
|
|
2
|
-
import type { Clock } from "../../core/clock";
|
|
3
|
-
import { type CursorBridgeClient } from "./bridge-client";
|
|
4
|
-
import type { CursorDirectSetupCleanup, CursorDirectSetupCleanupResources } from "./direct-run-types";
|
|
5
|
-
import type { CursorRunSessionBackgroundCleanupErrorHandler } from "./run-session-expiry";
|
|
6
|
-
export type { CursorDirectSetupCleanup, CursorDirectSetupCleanupResources, } from "./direct-run-types";
|
|
2
|
+
import type { Clock } from "../../core/clock.js";
|
|
3
|
+
import { type CursorBridgeClient } from "./bridge-client.js";
|
|
4
|
+
import type { CursorDirectSetupCleanup, CursorDirectSetupCleanupResources } from "./direct-run-types.js";
|
|
5
|
+
import type { CursorRunSessionBackgroundCleanupErrorHandler } from "./run-session-expiry.js";
|
|
6
|
+
export type { CursorDirectSetupCleanup, CursorDirectSetupCleanupResources, } from "./direct-run-types.js";
|
|
7
7
|
export type CursorDirectRuntimeOptions = {
|
|
8
8
|
readonly clock: Clock;
|
|
9
9
|
readonly readAccessToken: (signal: AbortSignal) => Promise<string | null>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
-
import { AdapterError, OperationCancelledError } from "../../core/errors";
|
|
3
|
-
import { parseProviderId } from "../../core/ids";
|
|
4
|
-
import { createAsyncDisposable } from "../../core/lifecycle";
|
|
5
|
-
import { createCursorBridgeClient } from "./bridge-client";
|
|
6
|
-
import { startCursorDirectRun } from "./direct-run";
|
|
7
|
-
import { consumeCursorDirectSession } from "./direct-stream";
|
|
8
|
-
import { createCursorRunSessionRegistry } from "./run-session";
|
|
9
|
-
import { settleCursorCleanup } from "./settle-cleanup";
|
|
10
|
-
import { buildCursorToolContinuations } from "./tool-continuation";
|
|
2
|
+
import { AdapterError, OperationCancelledError } from "../../core/errors.js";
|
|
3
|
+
import { parseProviderId } from "../../core/ids.js";
|
|
4
|
+
import { createAsyncDisposable } from "../../core/lifecycle.js";
|
|
5
|
+
import { createCursorBridgeClient } from "./bridge-client.js";
|
|
6
|
+
import { startCursorDirectRun } from "./direct-run.js";
|
|
7
|
+
import { consumeCursorDirectSession } from "./direct-stream.js";
|
|
8
|
+
import { createCursorRunSessionRegistry } from "./run-session.js";
|
|
9
|
+
import { settleCursorCleanup } from "./settle-cleanup.js";
|
|
10
|
+
import { buildCursorToolContinuations } from "./tool-continuation.js";
|
|
11
11
|
function toolsFromCall(call) {
|
|
12
12
|
return (call.tools ?? [])
|
|
13
13
|
.filter((tool) => tool.type === "function")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { CursorIdleWatchdog } from "./recovery";
|
|
2
|
-
import type { CursorRunSession, CursorRunSessionRegistry } from "./run-session";
|
|
3
|
-
import { type CursorStreamAdapter } from "./stream-adapter";
|
|
4
|
-
export { createConnectFrameStreamDecoder } from "./connect-frame-stream";
|
|
1
|
+
import type { CursorIdleWatchdog } from "./recovery.js";
|
|
2
|
+
import type { CursorRunSession, CursorRunSessionRegistry } from "./run-session.js";
|
|
3
|
+
import { type CursorStreamAdapter } from "./stream-adapter.js";
|
|
4
|
+
export { createConnectFrameStreamDecoder } from "./connect-frame-stream.js";
|
|
5
5
|
export type CursorDirectAttemptExit = {
|
|
6
6
|
readonly kind: "terminal";
|
|
7
7
|
} | {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createConnectFrameStreamDecoder, } from "./connect-frame-stream";
|
|
2
|
-
import { annotateCursorProtocolFailure } from "./protocol-failure";
|
|
3
|
-
import { createCursorStreamAdapter } from "./stream-adapter";
|
|
4
|
-
export { createConnectFrameStreamDecoder } from "./connect-frame-stream";
|
|
1
|
+
import { createConnectFrameStreamDecoder, } from "./connect-frame-stream.js";
|
|
2
|
+
import { annotateCursorProtocolFailure } from "./protocol-failure.js";
|
|
3
|
+
import { createCursorStreamAdapter } from "./stream-adapter.js";
|
|
4
|
+
export { createConnectFrameStreamDecoder } from "./connect-frame-stream.js";
|
|
5
5
|
function finishConnectDecoder(decoder) {
|
|
6
6
|
try {
|
|
7
7
|
decoder.finish();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { CursorMcpTool } from "./mcp-tools";
|
|
2
|
-
import type { ExecServerMessage } from "./proto/exec";
|
|
3
|
-
import type { McpToolDefinition } from "./proto/mcp";
|
|
4
|
-
import { type AgentClientMessage } from "./proto/request";
|
|
1
|
+
import type { CursorMcpTool } from "./mcp-tools.js";
|
|
2
|
+
import type { ExecServerMessage } from "./proto/exec.js";
|
|
3
|
+
import type { McpToolDefinition } from "./proto/mcp.js";
|
|
4
|
+
import { type AgentClientMessage } from "./proto/request.js";
|
|
5
5
|
export declare function cursorMcpDefinitions(tools: readonly CursorMcpTool[]): readonly McpToolDefinition[];
|
|
6
6
|
export declare function encodeCursorClientFrame(message: AgentClientMessage): Uint8Array;
|
|
7
7
|
export declare function encodeRequestContextFrame(message: Extract<ExecServerMessage, {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Derived from Rahularya01/pi-cursor src/stream/server-messages.ts exec replies.
|
|
2
2
|
// Licensed under MIT. See THIRD_PARTY_NOTICES.md.
|
|
3
|
-
import { encodeConnectFrame } from "./connect-frame";
|
|
4
|
-
import { encodeAgentClientMessage } from "./proto/request";
|
|
5
|
-
import { decodeAgentServerMessage } from "./proto/server";
|
|
6
|
-
import { concatBytes, encodeBoolField, encodeBytesField, encodeInt32Field, encodeStringField, } from "./proto-wire";
|
|
3
|
+
import { encodeConnectFrame } from "./connect-frame.js";
|
|
4
|
+
import { encodeAgentClientMessage } from "./proto/request.js";
|
|
5
|
+
import { decodeAgentServerMessage } from "./proto/server.js";
|
|
6
|
+
import { concatBytes, encodeBoolField, encodeBytesField, encodeInt32Field, encodeStringField, } from "./proto-wire.js";
|
|
7
7
|
const NATIVE_REJECT = "This native Cursor tool is not available. Use the MCP tools provided instead.";
|
|
8
8
|
export function cursorMcpDefinitions(tools) {
|
|
9
9
|
return tools.map((tool) => ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createBrotliDecompress, createGunzip } from "node:zlib";
|
|
2
|
-
import { MAX_BRIDGE_BINARY_BYTES } from "./bridge-limits";
|
|
2
|
+
import { MAX_BRIDGE_BINARY_BYTES } from "./bridge-limits.js";
|
|
3
3
|
export function bridgeResponseHeaders(headers) {
|
|
4
4
|
const result = {};
|
|
5
5
|
for (const [name, value] of Object.entries(headers)) {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { once } from "node:events";
|
|
5
5
|
import http2, {} from "node:http2";
|
|
6
|
-
import { attachCursorH2ResponseBody, bridgeResponseHeaders, responseStatus, } from "./h2-bridge-response";
|
|
7
|
-
import { CURSOR_CLIENT_VERSION } from "./http2";
|
|
6
|
+
import { attachCursorH2ResponseBody, bridgeResponseHeaders, responseStatus, } from "./h2-bridge-response.js";
|
|
7
|
+
import { CURSOR_CLIENT_VERSION } from "./http2.js";
|
|
8
8
|
const PING_INTERVAL_MS = 20_000;
|
|
9
9
|
const FORCE_CLOSE_MS = 1_000;
|
|
10
10
|
function assertNever(command) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import http2 from "node:http2";
|
|
2
|
-
import { OperationCancelledError } from "../../core/errors";
|
|
2
|
+
import { OperationCancelledError } from "../../core/errors.js";
|
|
3
3
|
export const CURSOR_API_URL = "https://api2.cursor.sh";
|
|
4
4
|
export const CURSOR_CLIENT_VERSION = "cli-2026.08.11-e8db854";
|
|
5
5
|
export async function cursorHttp2Post(request) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InteractionQuery, InteractionResponse } from "./proto/interaction-query";
|
|
1
|
+
import type { InteractionQuery, InteractionResponse } from "./proto/interaction-query.js";
|
|
2
2
|
export type CursorInteractionReply = {
|
|
3
3
|
readonly action: "acked" | "rejected";
|
|
4
4
|
readonly response: InteractionResponse;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Derived from Rahularya01/pi-cursor src/stream/interaction-query.ts. Licensed under MIT.
|
|
2
2
|
// See THIRD_PARTY_NOTICES.md.
|
|
3
|
-
import { unreachableVariant } from "./proto/errors";
|
|
4
|
-
import { encodeBytesField, encodeStringField } from "./proto-wire";
|
|
3
|
+
import { unreachableVariant } from "./proto/errors.js";
|
|
4
|
+
import { encodeBytesField, encodeStringField } from "./proto-wire.js";
|
|
5
5
|
const REJECT_REASON = "Not available through the Pi Cursor provider. Use Pi tools (web_search, fetch, bash, etc.) instead.";
|
|
6
6
|
const ASK_QUESTION_ERROR = "Interactive questions are not available in Pi. Continue with a reasonable default or ask the user in chat.";
|
|
7
7
|
const CREATE_PLAN_ERROR = "Create-plan UI is not available in Pi. Write the plan with Pi file tools.";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LanguageModelV3, LanguageModelV3CallOptions, LanguageModelV3StreamPart } from "@ai-sdk/provider";
|
|
2
|
-
import { type CursorNdjsonStream } from "./legacy-stream";
|
|
2
|
+
import { type CursorNdjsonStream } from "./legacy-stream.js";
|
|
3
3
|
export type CursorLanguageModelOptions = {
|
|
4
4
|
readonly modelId: string;
|
|
5
5
|
readonly runPrompt: (prompt: string, signal: AbortSignal) => Promise<string | null>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Derived from Nomadcxx/opencode-cursor@8e14a26c1e080382f471a729436092ef72edf34e.
|
|
2
2
|
// Licensed under BSD-3-Clause. See THIRD_PARTY_NOTICES.md.
|
|
3
|
-
import { AdapterError, OperationCancelledError } from "../../core/errors";
|
|
4
|
-
import { parseProviderId } from "../../core/ids";
|
|
5
|
-
import { generateFromCursorStream } from "./language-generate";
|
|
6
|
-
import { createCursorLegacyStream } from "./legacy-stream";
|
|
7
|
-
import { cursorPromptText } from "./prompt";
|
|
8
|
-
import { emptyCursorUsage } from "./usage";
|
|
3
|
+
import { AdapterError, OperationCancelledError } from "../../core/errors.js";
|
|
4
|
+
import { parseProviderId } from "../../core/ids.js";
|
|
5
|
+
import { generateFromCursorStream } from "./language-generate.js";
|
|
6
|
+
import { createCursorLegacyStream } from "./legacy-stream.js";
|
|
7
|
+
import { cursorPromptText } from "./prompt.js";
|
|
8
|
+
import { emptyCursorUsage } from "./usage.js";
|
|
9
9
|
export function createCursorLanguageModel(options) {
|
|
10
10
|
const provider = parseProviderId("cursor");
|
|
11
11
|
const model = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { OperationCancelledError } from "../../core/errors";
|
|
2
|
-
import { cursorResultError, cursorTextFromUnknown } from "./ndjson";
|
|
3
|
-
import { cursorIncrementalPrompt, cursorPromptText, cursorSessionKey } from "./prompt";
|
|
4
|
-
import { cursorToolParts } from "./tool-stream";
|
|
5
|
-
import { cursorUsage, emptyCursorUsage } from "./usage";
|
|
1
|
+
import { OperationCancelledError } from "../../core/errors.js";
|
|
2
|
+
import { cursorResultError, cursorTextFromUnknown } from "./ndjson.js";
|
|
3
|
+
import { cursorIncrementalPrompt, cursorPromptText, cursorSessionKey } from "./prompt.js";
|
|
4
|
+
import { cursorToolParts } from "./tool-stream.js";
|
|
5
|
+
import { cursorUsage, emptyCursorUsage } from "./usage.js";
|
|
6
6
|
export function createCursorLegacyStream(options) {
|
|
7
7
|
const allowedTools = new Map((options.call.tools ?? [])
|
|
8
8
|
.filter((tool) => tool.type === "function")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { encodeProtobufValue } from "./proto-value";
|
|
2
|
-
import { concatBytes, encodeBytesField, encodeStringField } from "./proto-wire";
|
|
1
|
+
import { encodeProtobufValue } from "./proto-value.js";
|
|
2
|
+
import { concatBytes, encodeBytesField, encodeStringField } from "./proto-wire.js";
|
|
3
3
|
export function encodeMcpToolDefinition(tool) {
|
|
4
4
|
const schema = encodeProtobufValue(tool.inputSchema ?? { type: "object" });
|
|
5
5
|
return concatBytes([
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AdapterModel } from "../../core/models";
|
|
2
|
-
import { type CursorHttp2Post } from "./http2";
|
|
1
|
+
import type { AdapterModel } from "../../core/models.js";
|
|
2
|
+
import { type CursorHttp2Post } from "./http2.js";
|
|
3
3
|
export declare function parseCursorModelOutput(stdout: string): readonly AdapterModel[];
|
|
4
4
|
export type CursorModelsRun = (agent: string, args: readonly string[], signal: AbortSignal) => Promise<{
|
|
5
5
|
readonly code: number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
|
-
import { parseModelIdList } from "../../catalog/parse-ids";
|
|
3
|
-
import { OperationCancelledError } from "../../core/errors";
|
|
4
|
-
import { cursorHttp2Post } from "./http2";
|
|
5
|
-
import { decodeFields, decodeUtf8 } from "./proto-wire";
|
|
2
|
+
import { parseModelIdList } from "../../catalog/parse-ids.js";
|
|
3
|
+
import { OperationCancelledError } from "../../core/errors.js";
|
|
4
|
+
import { cursorHttp2Post } from "./http2.js";
|
|
5
|
+
import { decodeFields, decodeUtf8 } from "./proto-wire.js";
|
|
6
6
|
function stripAnsi(text) {
|
|
7
7
|
let output = "";
|
|
8
8
|
let index = 0;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Derived from Rahularya01/pi-cursor proto/agent.proto ConversationStateStructure. Licensed under MIT.
|
|
2
2
|
// See THIRD_PARTY_NOTICES.md.
|
|
3
|
-
import { concatBytes, decodeFieldsStrict, decodeUtf8Strict, encodeBytesField, encodeInt32Field, encodeStringField, } from "../proto-wire";
|
|
4
|
-
import { assertKnownFields, optionalField, optionalString, optionalUint32, repeatedFields, requiredField, requiredString, } from "./fields";
|
|
5
|
-
import { encodeUnknownField } from "./unknown-field";
|
|
3
|
+
import { concatBytes, decodeFieldsStrict, decodeUtf8Strict, encodeBytesField, encodeInt32Field, encodeStringField, } from "../proto-wire.js";
|
|
4
|
+
import { assertKnownFields, optionalField, optionalString, optionalUint32, repeatedFields, requiredField, requiredString, } from "./fields.js";
|
|
5
|
+
import { encodeUnknownField } from "./unknown-field.js";
|
|
6
6
|
function decodeTokenDetails(bytes) {
|
|
7
7
|
const context = "ConversationTokenDetails";
|
|
8
8
|
const fields = decodeFieldsStrict(bytes, { context });
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Derived from Rahularya01/pi-cursor proto/agent.proto conversation context fields. Licensed under MIT.
|
|
2
2
|
// See THIRD_PARTY_NOTICES.md.
|
|
3
|
-
import { concatBytes, decodeFieldsStrict, decodeUtf8Strict, encodeBoolField, encodeBytesField, encodeInt32Field, encodeStringField, } from "../proto-wire";
|
|
4
|
-
import { CursorProtocolError, unreachableVariant } from "./errors";
|
|
5
|
-
import { assertKnownFields, oneofField, optionalBool, optionalField, optionalString, repeatedFields, requiredField, requiredString, requiredUint32, } from "./fields";
|
|
3
|
+
import { concatBytes, decodeFieldsStrict, decodeUtf8Strict, encodeBoolField, encodeBytesField, encodeInt32Field, encodeStringField, } from "../proto-wire.js";
|
|
4
|
+
import { CursorProtocolError, unreachableVariant } from "./errors.js";
|
|
5
|
+
import { assertKnownFields, oneofField, optionalBool, optionalField, optionalString, repeatedFields, requiredField, requiredString, requiredUint32, } from "./fields.js";
|
|
6
6
|
function decodeImageData(bytes, field) {
|
|
7
7
|
switch (field) {
|
|
8
8
|
case 1:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Derived from Rahularya01/pi-cursor proto/agent.proto exec control fields. Licensed under MIT.
|
|
2
2
|
// See THIRD_PARTY_NOTICES.md.
|
|
3
|
-
import { concatBytes, decodeFieldsStrict, encodeBytesField, encodeInt32Field, encodeStringField, } from "../proto-wire";
|
|
4
|
-
import { CursorProtocolDriftError, unreachableVariant } from "./errors";
|
|
5
|
-
import { oneofField, optionalString, optionalUint32 } from "./fields";
|
|
3
|
+
import { concatBytes, decodeFieldsStrict, encodeBytesField, encodeInt32Field, encodeStringField, } from "../proto-wire.js";
|
|
4
|
+
import { CursorProtocolDriftError, unreachableVariant } from "./errors.js";
|
|
5
|
+
import { oneofField, optionalString, optionalUint32 } from "./fields.js";
|
|
6
6
|
function controlId(bytes, context) {
|
|
7
7
|
const fields = decodeFieldsStrict(bytes, { context });
|
|
8
8
|
return optionalUint32(fields, { context, field: 1, wire: 0 }) ?? 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type McpArgs, type McpResult } from "./mcp";
|
|
2
|
-
import { type RequestContextResult } from "./request-context";
|
|
3
|
-
export type { RequestContext, RequestContextResult } from "./request-context";
|
|
1
|
+
import { type McpArgs, type McpResult } from "./mcp.js";
|
|
2
|
+
import { type RequestContextResult } from "./request-context.js";
|
|
3
|
+
export type { RequestContext, RequestContextResult } from "./request-context.js";
|
|
4
4
|
type ExecIdentity = {
|
|
5
5
|
readonly id: number;
|
|
6
6
|
readonly execId: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Derived from Rahularya01/pi-cursor proto/agent.proto exec/request-context fields. Licensed under MIT.
|
|
2
2
|
// See THIRD_PARTY_NOTICES.md.
|
|
3
|
-
import { concatBytes, decodeFieldsStrict, encodeBoolField, encodeBytesField, encodeInt32Field, encodeStringField, } from "../proto-wire";
|
|
4
|
-
import { CursorProtocolDriftError, unreachableVariant } from "./errors";
|
|
5
|
-
import { assertKnownFields, oneofField, optionalBool, optionalField, optionalString, optionalUint32, } from "./fields";
|
|
6
|
-
import { decodeMcpArgs, decodeMcpResult, encodeMcpArgs, encodeMcpResult, } from "./mcp";
|
|
7
|
-
import { decodeRequestContextResult, encodeRequestContextResult, } from "./request-context";
|
|
3
|
+
import { concatBytes, decodeFieldsStrict, encodeBoolField, encodeBytesField, encodeInt32Field, encodeStringField, } from "../proto-wire.js";
|
|
4
|
+
import { CursorProtocolDriftError, unreachableVariant } from "./errors.js";
|
|
5
|
+
import { assertKnownFields, oneofField, optionalBool, optionalField, optionalString, optionalUint32, } from "./fields.js";
|
|
6
|
+
import { decodeMcpArgs, decodeMcpResult, encodeMcpArgs, encodeMcpResult, } from "./mcp.js";
|
|
7
|
+
import { decodeRequestContextResult, encodeRequestContextResult, } from "./request-context.js";
|
|
8
8
|
const NATIVE_EXEC_FIELDS = {
|
|
9
9
|
2: "shell",
|
|
10
10
|
3: "write",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { decodeUtf8Strict, decodeVarintNumberStrict } from "../proto-wire";
|
|
2
|
-
import { CursorProtocolDriftError, CursorProtocolError } from "./errors";
|
|
3
|
-
import { encodeUnknownField } from "./unknown-field";
|
|
1
|
+
import { decodeUtf8Strict, decodeVarintNumberStrict } from "../proto-wire.js";
|
|
2
|
+
import { CursorProtocolDriftError, CursorProtocolError } from "./errors.js";
|
|
3
|
+
import { encodeUnknownField } from "./unknown-field.js";
|
|
4
4
|
function verifyWire(entry, spec) {
|
|
5
5
|
if (entry.wire !== spec.wire) {
|
|
6
6
|
throw new CursorProtocolError("wrong-wire", spec.context, `field ${spec.field} expected wire ${spec.wire}, received ${entry.wire}`);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Derived from Rahularya01/pi-cursor proto/agent.proto InteractionQuery/Response. Licensed under MIT.
|
|
2
2
|
// See THIRD_PARTY_NOTICES.md.
|
|
3
|
-
import { concatBytes, decodeFieldsStrict, encodeBytesField, encodeInt32Field } from "../proto-wire";
|
|
4
|
-
import { CursorProtocolDriftError, unreachableVariant } from "./errors";
|
|
5
|
-
import { assertKnownFields, oneofField, requiredUint32 } from "./fields";
|
|
3
|
+
import { concatBytes, decodeFieldsStrict, encodeBytesField, encodeInt32Field, } from "../proto-wire.js";
|
|
4
|
+
import { CursorProtocolDriftError, unreachableVariant } from "./errors.js";
|
|
5
|
+
import { assertKnownFields, oneofField, requiredUint32 } from "./fields.js";
|
|
6
6
|
function kindForField(field, context) {
|
|
7
7
|
switch (field) {
|
|
8
8
|
case 2:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Derived from Rahularya01/pi-cursor proto/agent.proto InteractionUpdate fields. Licensed under MIT.
|
|
2
2
|
// See THIRD_PARTY_NOTICES.md.
|
|
3
|
-
import { concatBytes, decodeFieldsStrict, encodeBytesField, encodeStringField } from "../proto-wire";
|
|
4
|
-
import { assertKnownFields, oneofField, optionalField, requiredField, requiredString, } from "./fields";
|
|
5
|
-
import { decodeMcpArgs, decodeMcpToolResult, encodeMcpArgs, encodeMcpToolResult, } from "./mcp";
|
|
3
|
+
import { concatBytes, decodeFieldsStrict, encodeBytesField, encodeStringField, } from "../proto-wire.js";
|
|
4
|
+
import { assertKnownFields, oneofField, optionalField, requiredField, requiredString, } from "./fields.js";
|
|
5
|
+
import { decodeMcpArgs, decodeMcpToolResult, encodeMcpArgs, encodeMcpToolResult, } from "./mcp.js";
|
|
6
6
|
function opaqueToolUpdate(bytes) {
|
|
7
7
|
return {
|
|
8
8
|
callId: "",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Derived from Rahularya01/pi-cursor proto/agent.proto TurnEndedUpdate. Licensed under MIT.
|
|
2
2
|
// See THIRD_PARTY_NOTICES.md.
|
|
3
|
-
import { decodeFieldsStrict } from "../proto-wire";
|
|
4
|
-
import { assertKnownFields, optionalField } from "./fields";
|
|
3
|
+
import { decodeFieldsStrict } from "../proto-wire.js";
|
|
4
|
+
import { assertKnownFields, optionalField } from "./fields.js";
|
|
5
5
|
export function decodeTurnEndedUpdate(bytes) {
|
|
6
6
|
const context = "TurnEndedUpdate";
|
|
7
7
|
const fields = decodeFieldsStrict(bytes, { context });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type ProtoDriftMetadata } from "./fields";
|
|
2
|
-
import { type ToolUpdate } from "./interaction-tool-update";
|
|
3
|
-
import { decodeTurnEndedUpdate } from "./interaction-turn-ended";
|
|
4
|
-
export { decodeInteractionQuery, decodeInteractionResponse, encodeInteractionQuery, encodeInteractionResponse, type InteractionKind, type InteractionQuery, type InteractionResponse, } from "./interaction-query";
|
|
1
|
+
import { type ProtoDriftMetadata } from "./fields.js";
|
|
2
|
+
import { type ToolUpdate } from "./interaction-tool-update.js";
|
|
3
|
+
import { decodeTurnEndedUpdate } from "./interaction-turn-ended.js";
|
|
4
|
+
export { decodeInteractionQuery, decodeInteractionResponse, encodeInteractionQuery, encodeInteractionResponse, type InteractionKind, type InteractionQuery, type InteractionResponse, } from "./interaction-query.js";
|
|
5
5
|
type SemanticInteractionUpdateBody = {
|
|
6
6
|
readonly kind: "text-delta";
|
|
7
7
|
readonly text: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Derived from Rahularya01/pi-cursor proto/agent.proto InteractionUpdate fields. Licensed under MIT.
|
|
2
2
|
// See THIRD_PARTY_NOTICES.md.
|
|
3
|
-
import { concatBytes, decodeFieldsStrict, encodeBytesField, encodeInt32Field, encodeStringField, } from "../proto-wire";
|
|
4
|
-
import { CursorProtocolDriftError, unreachableVariant } from "./errors";
|
|
5
|
-
import { assertKnownFields, collectDriftMetadata, encodeDriftFields, oneofField, optionalField, optionalString, optionalUint32, } from "./fields";
|
|
6
|
-
import { decodeToolUpdate, encodeToolUpdate } from "./interaction-tool-update";
|
|
7
|
-
import { decodeTurnEndedUpdate, encodeTurnEndedUpdate } from "./interaction-turn-ended";
|
|
8
|
-
import { encodeUnknownField } from "./unknown-field";
|
|
9
|
-
export { decodeInteractionQuery, decodeInteractionResponse, encodeInteractionQuery, encodeInteractionResponse, } from "./interaction-query";
|
|
3
|
+
import { concatBytes, decodeFieldsStrict, encodeBytesField, encodeInt32Field, encodeStringField, } from "../proto-wire.js";
|
|
4
|
+
import { CursorProtocolDriftError, unreachableVariant } from "./errors.js";
|
|
5
|
+
import { assertKnownFields, collectDriftMetadata, encodeDriftFields, oneofField, optionalField, optionalString, optionalUint32, } from "./fields.js";
|
|
6
|
+
import { decodeToolUpdate, encodeToolUpdate } from "./interaction-tool-update.js";
|
|
7
|
+
import { decodeTurnEndedUpdate, encodeTurnEndedUpdate } from "./interaction-turn-ended.js";
|
|
8
|
+
import { encodeUnknownField } from "./unknown-field.js";
|
|
9
|
+
export { decodeInteractionQuery, decodeInteractionResponse, encodeInteractionQuery, encodeInteractionResponse, } from "./interaction-query.js";
|
|
10
10
|
const SEMANTIC_FIELDS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];
|
|
11
11
|
const KNOWN_FIELDS = [...SEMANTIC_FIELDS, 25];
|
|
12
12
|
function decodeTextUpdate(bytes, context) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Derived from Rahularya01/pi-cursor proto/agent.proto KV blob messages. Licensed under MIT.
|
|
2
2
|
// See THIRD_PARTY_NOTICES.md.
|
|
3
|
-
import { concatBytes, decodeFieldsStrict, encodeBytesField, encodeInt32Field, encodeStringField, } from "../proto-wire";
|
|
4
|
-
import { CursorProtocolDriftError, unreachableVariant } from "./errors";
|
|
5
|
-
import { assertKnownFields, oneofField, optionalField, optionalUint32, requiredField, requiredString, requiredUint32, } from "./fields";
|
|
3
|
+
import { concatBytes, decodeFieldsStrict, encodeBytesField, encodeInt32Field, encodeStringField, } from "../proto-wire.js";
|
|
4
|
+
import { CursorProtocolDriftError, unreachableVariant } from "./errors.js";
|
|
5
|
+
import { assertKnownFields, oneofField, optionalField, optionalUint32, requiredField, requiredString, requiredUint32, } from "./fields.js";
|
|
6
6
|
export function decodeKvServerMessage(bytes) {
|
|
7
7
|
const context = "KvServerMessage";
|
|
8
8
|
const fields = decodeFieldsStrict(bytes, { context });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type OutputLocation } from "./output-location";
|
|
2
|
-
export type { OutputLocation } from "./output-location";
|
|
1
|
+
import { type OutputLocation } from "./output-location.js";
|
|
2
|
+
export type { OutputLocation } from "./output-location.js";
|
|
3
3
|
export type McpResultContent = {
|
|
4
4
|
readonly kind: "text";
|
|
5
5
|
readonly text: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Derived from Rahularya01/pi-cursor proto/agent.proto McpResult fields. Licensed under MIT.
|
|
2
2
|
// See THIRD_PARTY_NOTICES.md.
|
|
3
|
-
import { concatBytes, decodeFieldsStrict, decodeUtf8Strict, encodeBoolField, encodeBytesField, encodeStringField, } from "../proto-wire";
|
|
4
|
-
import { CursorProtocolDriftError, unreachableVariant } from "./errors";
|
|
5
|
-
import { assertKnownFields, oneofField, optionalBool, optionalField, repeatedFields, requiredField, requiredString, } from "./fields";
|
|
6
|
-
import { decodeOutputLocation, encodeOutputLocation } from "./output-location";
|
|
7
|
-
import { encodeUnknownField } from "./unknown-field";
|
|
3
|
+
import { concatBytes, decodeFieldsStrict, decodeUtf8Strict, encodeBoolField, encodeBytesField, encodeStringField, } from "../proto-wire.js";
|
|
4
|
+
import { CursorProtocolDriftError, unreachableVariant } from "./errors.js";
|
|
5
|
+
import { assertKnownFields, oneofField, optionalBool, optionalField, repeatedFields, requiredField, requiredString, } from "./fields.js";
|
|
6
|
+
import { decodeOutputLocation, encodeOutputLocation, } from "./output-location.js";
|
|
7
|
+
import { encodeUnknownField } from "./unknown-field.js";
|
|
8
8
|
function decodeContent(bytes) {
|
|
9
9
|
const context = "McpToolResultContentItem";
|
|
10
10
|
const fields = decodeFieldsStrict(bytes, { context });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { decodeMcpResult, decodeMcpToolResult, encodeMcpResult, encodeMcpToolResult, type McpResult, type McpResultContent, type McpToolResult, type OutputLocation, } from "./mcp-result";
|
|
1
|
+
export { decodeMcpResult, decodeMcpToolResult, encodeMcpResult, encodeMcpToolResult, type McpResult, type McpResultContent, type McpToolResult, type OutputLocation, } from "./mcp-result.js";
|
|
2
2
|
export type McpToolDefinition = {
|
|
3
3
|
readonly name: string;
|
|
4
4
|
readonly description: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Derived from Rahularya01/pi-cursor proto/agent.proto MCP fields. Licensed under MIT.
|
|
2
2
|
// See THIRD_PARTY_NOTICES.md.
|
|
3
|
-
import { decodeProtobufValueStrict, encodeProtobufValue } from "../proto-value";
|
|
4
|
-
import { concatBytes, decodeFieldsStrict, decodeUtf8Strict, encodeBytesField, encodeStringField, } from "../proto-wire";
|
|
5
|
-
import { CursorProtocolError } from "./errors";
|
|
6
|
-
import { assertKnownFields, optionalField, optionalString, repeatedFields, requiredField, requiredString, } from "./fields";
|
|
7
|
-
export { decodeMcpResult, decodeMcpToolResult, encodeMcpResult, encodeMcpToolResult, } from "./mcp-result";
|
|
3
|
+
import { decodeProtobufValueStrict, encodeProtobufValue } from "../proto-value.js";
|
|
4
|
+
import { concatBytes, decodeFieldsStrict, decodeUtf8Strict, encodeBytesField, encodeStringField, } from "../proto-wire.js";
|
|
5
|
+
import { CursorProtocolError } from "./errors.js";
|
|
6
|
+
import { assertKnownFields, optionalField, optionalString, repeatedFields, requiredField, requiredString, } from "./fields.js";
|
|
7
|
+
export { decodeMcpResult, decodeMcpToolResult, encodeMcpResult, encodeMcpToolResult, } from "./mcp-result.js";
|
|
8
8
|
export function decodeMcpToolDefinition(bytes) {
|
|
9
9
|
const context = "McpToolDefinition";
|
|
10
10
|
const fields = decodeFieldsStrict(bytes, { context });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Derived from Rahularya01/pi-cursor proto/agent.proto RequestedModel. Licensed under MIT.
|
|
2
2
|
// See THIRD_PARTY_NOTICES.md.
|
|
3
|
-
import { concatBytes, decodeFieldsStrict, encodeBoolField, encodeBytesField, encodeStringField, } from "../proto-wire";
|
|
4
|
-
import { assertKnownFields, optionalBool, optionalString, repeatedFields } from "./fields";
|
|
3
|
+
import { concatBytes, decodeFieldsStrict, encodeBoolField, encodeBytesField, encodeStringField, } from "../proto-wire.js";
|
|
4
|
+
import { assertKnownFields, optionalBool, optionalString, repeatedFields } from "./fields.js";
|
|
5
5
|
function decodeParameter(bytes) {
|
|
6
6
|
const context = "RequestedModel.Parameter";
|
|
7
7
|
const fields = decodeFieldsStrict(bytes, { context });
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Derived from Rahularya01/pi-cursor proto/agent.proto OutputLocation fields. Licensed under MIT.
|
|
2
2
|
// See THIRD_PARTY_NOTICES.md.
|
|
3
|
-
import { concatBytes, decodeFieldsStrict, encodeStringField } from "../proto-wire";
|
|
4
|
-
import { CursorProtocolError } from "./errors";
|
|
5
|
-
import { assertKnownFields, optionalField, optionalString } from "./fields";
|
|
6
|
-
import { encodeUnknownField } from "./unknown-field";
|
|
3
|
+
import { concatBytes, decodeFieldsStrict, encodeStringField } from "../proto-wire.js";
|
|
4
|
+
import { CursorProtocolError } from "./errors.js";
|
|
5
|
+
import { assertKnownFields, optionalField, optionalString } from "./fields.js";
|
|
6
|
+
import { encodeUnknownField } from "./unknown-field.js";
|
|
7
7
|
const UINT64_MODULUS = 1n << 64n;
|
|
8
8
|
const INT64_SIGN = 1n << 63n;
|
|
9
9
|
function decodeInt64(bytes) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ConversationCheckpoint } from "./checkpoint";
|
|
2
|
-
import type { McpToolDefinition } from "./mcp";
|
|
3
|
-
import { type RequestedModel } from "./model";
|
|
1
|
+
import { type ConversationCheckpoint } from "./checkpoint.js";
|
|
2
|
+
import type { McpToolDefinition } from "./mcp.js";
|
|
3
|
+
import { type RequestedModel } from "./model.js";
|
|
4
4
|
export type PrewarmRequest = {
|
|
5
5
|
readonly modelDetails?: Uint8Array;
|
|
6
6
|
readonly requestedModel?: RequestedModel;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Derived from Rahularya01/pi-cursor proto/agent.proto PrewarmRequest fields. Licensed under MIT.
|
|
2
2
|
// See THIRD_PARTY_NOTICES.md.
|
|
3
|
-
import { concatBytes, decodeFieldsStrict, encodeBoolField, encodeBytesField, encodeStringField, } from "../proto-wire";
|
|
4
|
-
import { decodeConversationCheckpoint, encodeConversationCheckpoint, } from "./checkpoint";
|
|
5
|
-
import { assertKnownFields, optionalBool, optionalField, optionalString } from "./fields";
|
|
6
|
-
import { decodeRequestedModel, encodeRequestedModel } from "./model";
|
|
7
|
-
import { decodeMcpTools, encodeMcpTools } from "./run-request";
|
|
3
|
+
import { concatBytes, decodeFieldsStrict, encodeBoolField, encodeBytesField, encodeStringField, } from "../proto-wire.js";
|
|
4
|
+
import { decodeConversationCheckpoint, encodeConversationCheckpoint, } from "./checkpoint.js";
|
|
5
|
+
import { assertKnownFields, optionalBool, optionalField, optionalString } from "./fields.js";
|
|
6
|
+
import { decodeRequestedModel, encodeRequestedModel } from "./model.js";
|
|
7
|
+
import { decodeMcpTools, encodeMcpTools } from "./run-request.js";
|
|
8
8
|
function optionalOpaque(fields, field, context) {
|
|
9
9
|
const value = optionalField(fields, { context, field, wire: 2 });
|
|
10
10
|
if (value !== undefined) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Derived from Rahularya01/pi-cursor proto/agent.proto request-context fields. Licensed under MIT.
|
|
2
2
|
// See THIRD_PARTY_NOTICES.md.
|
|
3
|
-
import { concatBytes, decodeFieldsStrict, encodeBytesField, encodeStringField } from "../proto-wire";
|
|
4
|
-
import { CursorProtocolDriftError, unreachableVariant } from "./errors";
|
|
5
|
-
import { assertKnownFields, oneofField, repeatedFields, requiredString } from "./fields";
|
|
6
|
-
import { decodeMcpToolDefinition, encodeMcpToolDefinition } from "./mcp";
|
|
3
|
+
import { concatBytes, decodeFieldsStrict, encodeBytesField, encodeStringField, } from "../proto-wire.js";
|
|
4
|
+
import { CursorProtocolDriftError, unreachableVariant } from "./errors.js";
|
|
5
|
+
import { assertKnownFields, oneofField, repeatedFields, requiredString } from "./fields.js";
|
|
6
|
+
import { decodeMcpToolDefinition, encodeMcpToolDefinition } from "./mcp.js";
|
|
7
7
|
function decodeRequestContext(bytes) {
|
|
8
8
|
const context = "RequestContext";
|
|
9
9
|
const fields = decodeFieldsStrict(bytes, { context });
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { type ProtoDecodeOptions } from "../proto-wire";
|
|
2
|
-
import { type ConversationAction } from "./context";
|
|
3
|
-
import { type ExecClientMessage } from "./exec";
|
|
4
|
-
import { type ExecClientControl } from "./exec-control";
|
|
5
|
-
import { type ProtoDriftMetadata } from "./fields";
|
|
6
|
-
import { type InteractionResponse } from "./interaction-query";
|
|
7
|
-
import { type KvClientMessage } from "./kv";
|
|
8
|
-
import { type PrewarmRequest } from "./prewarm";
|
|
9
|
-
import { type AgentRunRequest } from "./run-request";
|
|
10
|
-
export type { PrewarmRequest } from "./prewarm";
|
|
11
|
-
export { type AgentRunRequest, decodeAgentRunRequest, encodeAgentRunRequest } from "./run-request";
|
|
1
|
+
import { type ProtoDecodeOptions } from "../proto-wire.js";
|
|
2
|
+
import { type ConversationAction } from "./context.js";
|
|
3
|
+
import { type ExecClientMessage } from "./exec.js";
|
|
4
|
+
import { type ExecClientControl } from "./exec-control.js";
|
|
5
|
+
import { type ProtoDriftMetadata } from "./fields.js";
|
|
6
|
+
import { type InteractionResponse } from "./interaction-query.js";
|
|
7
|
+
import { type KvClientMessage } from "./kv.js";
|
|
8
|
+
import { type PrewarmRequest } from "./prewarm.js";
|
|
9
|
+
import { type AgentRunRequest } from "./run-request.js";
|
|
10
|
+
export type { PrewarmRequest } from "./prewarm.js";
|
|
11
|
+
export { type AgentRunRequest, decodeAgentRunRequest, encodeAgentRunRequest, } from "./run-request.js";
|
|
12
12
|
export type AgentClientMessage = ({
|
|
13
13
|
readonly kind: "run-request";
|
|
14
14
|
readonly request: AgentRunRequest;
|