chore: reformat
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
* the server reads as "the tool ran and produced nothing".
|
||||
*/
|
||||
|
||||
import { create } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import {
|
||||
AfterAgentResponseRequestResponseSchema,
|
||||
AfterAgentThoughtRequestResponseSchema,
|
||||
@@ -65,6 +64,7 @@ import {
|
||||
SubagentStartRequestResponseSchema,
|
||||
SubagentStopRequestResponseSchema,
|
||||
} from "@oh-my-pi/pi-catalog/discovery/cursor-proto";
|
||||
import { create } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import type { ToolResultMessage } from "../../types";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type http2 from "node:http2";
|
||||
import { create, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import {
|
||||
AgentClientMessageSchema,
|
||||
AskQuestionInteractionResponseSchema,
|
||||
@@ -22,6 +21,7 @@ import {
|
||||
WebSearchRequestResponse_ApprovedSchema,
|
||||
WebSearchRequestResponseSchema,
|
||||
} from "@oh-my-pi/pi-catalog/discovery/cursor-proto";
|
||||
import { create, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import { $env } from "@oh-my-pi/pi-utils";
|
||||
|
||||
const NOT_IMPLEMENTED_SUFFIX = "not implemented by this client";
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { gunzipSync, gzipSync } from "node:zlib";
|
||||
import { create, fromBinary, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import {
|
||||
CacheControlType,
|
||||
type ChatMessagePrompt,
|
||||
@@ -21,6 +20,7 @@ import {
|
||||
PromptCacheOptionsSchema,
|
||||
StopReason,
|
||||
} from "@oh-my-pi/pi-catalog/discovery/devin-proto";
|
||||
import { create, fromBinary, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import { calculateCost } from "@oh-my-pi/pi-catalog/models";
|
||||
import { logger, parseStreamingJson, parseStreamingJsonThrottled } from "@oh-my-pi/pi-utils";
|
||||
import * as AIError from "../error";
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { afterEach, describe, expect, it } from "bun:test";
|
||||
import * as http2 from "node:http2";
|
||||
import { create, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import { streamCursor } from "@oh-my-pi/pi-ai/providers/cursor";
|
||||
import type { Context, Model } from "@oh-my-pi/pi-ai/types";
|
||||
import { buildModel } from "@oh-my-pi/pi-catalog/build";
|
||||
@@ -10,6 +9,7 @@ import {
|
||||
TextDeltaUpdateSchema,
|
||||
TurnEndedUpdateSchema,
|
||||
} from "@oh-my-pi/pi-catalog/discovery/cursor-proto";
|
||||
import { create, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
|
||||
// Cursor forwards caller headers (including `before_provider_headers` extension
|
||||
// edits), and it speaks HTTP/2. These assert the TRANSPORT contract against a
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { afterEach, describe, expect, it } from "bun:test";
|
||||
import * as http2 from "node:http2";
|
||||
import { create, fromBinary, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import { streamCursor } from "@oh-my-pi/pi-ai/providers/cursor";
|
||||
import type { Context, Model } from "@oh-my-pi/pi-ai/types";
|
||||
import { buildModel } from "@oh-my-pi/pi-catalog/build";
|
||||
@@ -11,6 +10,7 @@ import {
|
||||
TextDeltaUpdateSchema,
|
||||
TurnEndedUpdateSchema,
|
||||
} from "@oh-my-pi/pi-catalog/discovery/cursor-proto";
|
||||
import { create, fromBinary, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
|
||||
// #8345: a server-side per-conversation rejection (bare resource_exhausted,
|
||||
// zero tokens) poisons the wire conversationId; the next attempt must rotate
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { afterEach, describe, expect, it, vi } from "bun:test";
|
||||
import { create } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import {
|
||||
type BlockState,
|
||||
buildCursorHistoryForTest,
|
||||
@@ -32,6 +31,7 @@ import {
|
||||
ReadResultSchema,
|
||||
ReadSuccessSchema,
|
||||
} from "@oh-my-pi/pi-catalog/discovery/cursor-proto";
|
||||
import { create } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import { logger } from "@oh-my-pi/pi-utils";
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { create, fromBinary, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import {
|
||||
type BlockState,
|
||||
CURSOR_CLIENT_VERSION,
|
||||
@@ -65,6 +64,7 @@ import {
|
||||
ToolCallSchema,
|
||||
WebFetchAllowlistPrecheckArgsSchema,
|
||||
} from "@oh-my-pi/pi-catalog/discovery/cursor-proto";
|
||||
import { create, fromBinary, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
|
||||
/**
|
||||
* Drive one `ExecServerMessage` through the real dispatcher and decode every
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { create, fromBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import { type BlockState, handleServerMessage, type ToolCallState } from "@oh-my-pi/pi-ai/providers/cursor";
|
||||
import type { AssistantMessage } from "@oh-my-pi/pi-ai/types";
|
||||
import { AssistantMessageEventStream } from "@oh-my-pi/pi-ai/utils/event-stream";
|
||||
@@ -17,6 +16,7 @@ import {
|
||||
SwitchModeRequestQuerySchema,
|
||||
WebSearchRequestQuerySchema,
|
||||
} from "@oh-my-pi/pi-catalog/discovery/cursor-proto";
|
||||
import { create, fromBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
|
||||
type ProtoUnknownField = { no: number; wireType: number; data: Uint8Array };
|
||||
type ProtoUnknownBag = { $unknown?: ProtoUnknownField[] };
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
// buildGrpcRequest is exercised directly (the transport is HTTP/2), and the
|
||||
// serialized run request is decoded back from the wire bytes.
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { fromBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import { buildGrpcRequest } from "@oh-my-pi/pi-ai/providers/cursor";
|
||||
import type { Context, Model } from "@oh-my-pi/pi-ai/types";
|
||||
import { buildModel } from "@oh-my-pi/pi-catalog/build";
|
||||
import { AgentClientMessageSchema } from "@oh-my-pi/pi-catalog/discovery/cursor-proto";
|
||||
import { fromBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
|
||||
const model: Model<"cursor-agent"> = buildModel({
|
||||
id: "cursor-composer-2.5",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { afterEach, describe, expect, it } from "bun:test";
|
||||
import * as http2 from "node:http2";
|
||||
import { create, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import { streamCursor } from "@oh-my-pi/pi-ai/providers/cursor";
|
||||
import type { Context, CursorToolResultHandler, Model, ToolResultMessage } from "@oh-my-pi/pi-ai/types";
|
||||
import { buildModel } from "@oh-my-pi/pi-catalog/build";
|
||||
@@ -16,6 +15,7 @@ import {
|
||||
UpdateTodosArgsSchema,
|
||||
UpdateTodosToolCallSchema,
|
||||
} from "@oh-my-pi/pi-catalog/discovery/cursor-proto";
|
||||
import { create, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
|
||||
const CONNECT_END_STREAM_FLAG = 0b00000010;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { create, fromBinary, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import {
|
||||
type BlockState,
|
||||
processInteractionUpdate,
|
||||
@@ -30,6 +29,7 @@ import {
|
||||
UpdateTodosSuccessSchema,
|
||||
UpdateTodosToolCallSchema,
|
||||
} from "@oh-my-pi/pi-catalog/discovery/cursor-proto";
|
||||
import { create, fromBinary, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
|
||||
/** One `todoSync` invocation, recorded verbatim. */
|
||||
interface SyncCall {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { create, fromBinary, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import { type BlockState, handleServerMessage, type ToolCallState } from "@oh-my-pi/pi-ai/providers/cursor";
|
||||
import type { AssistantMessage } from "@oh-my-pi/pi-ai/types";
|
||||
import { AssistantMessageEventStream } from "@oh-my-pi/pi-ai/utils/event-stream";
|
||||
@@ -21,6 +20,7 @@ import {
|
||||
WebSearchArgsSchema,
|
||||
WebSearchRequestQuerySchema,
|
||||
} from "@oh-my-pi/pi-catalog/discovery/cursor-proto";
|
||||
import { create, fromBinary, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
|
||||
function cursorAssistantMessage(): AssistantMessage {
|
||||
return {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { create, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import { streamDevin } from "@oh-my-pi/pi-ai/providers/devin";
|
||||
import type { Context, Model } from "@oh-my-pi/pi-ai/types";
|
||||
import { buildModel } from "@oh-my-pi/pi-catalog/build";
|
||||
import { GetUserJwtResponseSchema } from "@oh-my-pi/pi-catalog/discovery/devin-proto";
|
||||
import { create, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
|
||||
/**
|
||||
* Regression for #4228: a Devin Connect frame header advertising an outsized
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { gunzipSync } from "node:zlib";
|
||||
import { create, fromBinary, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import { streamDevin } from "@oh-my-pi/pi-ai/providers/devin";
|
||||
import type { AssistantMessage, Context, Model } from "@oh-my-pi/pi-ai/types";
|
||||
import { buildModel } from "@oh-my-pi/pi-catalog/build";
|
||||
import { GetChatMessageRequestSchema, GetUserJwtResponseSchema } from "@oh-my-pi/pi-catalog/discovery/devin-proto";
|
||||
import { create, fromBinary, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
|
||||
const devinModel: Model<"devin-agent"> = buildModel({
|
||||
id: "devin-test",
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { create, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import * as AIError from "@oh-my-pi/pi-ai/error";
|
||||
import { streamDevin } from "@oh-my-pi/pi-ai/providers/devin";
|
||||
import type { Context, Model } from "@oh-my-pi/pi-ai/types";
|
||||
import { buildModel } from "@oh-my-pi/pi-catalog/build";
|
||||
import { GetChatMessageResponseSchema, GetUserJwtResponseSchema } from "@oh-my-pi/pi-catalog/discovery/devin-proto";
|
||||
import { create, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
|
||||
const CONNECT_END_STREAM_FLAG = 0x02;
|
||||
const LARGE_TOOL_RESULT_BYTES = 160 * 1024;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { create, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import { streamDevin } from "@oh-my-pi/pi-ai/providers/devin";
|
||||
import type { Context, Model, ToolCall } from "@oh-my-pi/pi-ai/types";
|
||||
import { buildModel } from "@oh-my-pi/pi-catalog/build";
|
||||
@@ -9,6 +8,7 @@ import {
|
||||
GetUserJwtResponseSchema,
|
||||
StopReason,
|
||||
} from "@oh-my-pi/pi-catalog/discovery/devin-proto";
|
||||
import { create, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
|
||||
function frameConnectMessage(payload: Uint8Array): Uint8Array {
|
||||
const out = new Uint8Array(5 + payload.length);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { create, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import { streamDevin } from "@oh-my-pi/pi-ai/providers/devin";
|
||||
import type { Context, Model } from "@oh-my-pi/pi-ai/types";
|
||||
import { buildModel } from "@oh-my-pi/pi-catalog/build";
|
||||
@@ -9,6 +8,7 @@ import {
|
||||
ModelUsageStatsSchema,
|
||||
StopReason,
|
||||
} from "@oh-my-pi/pi-catalog/discovery/devin-proto";
|
||||
import { create, toBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
|
||||
function frameConnectMessage(payload: Uint8Array): Uint8Array {
|
||||
const out = new Uint8Array(5 + payload.length);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import * as http2 from "node:http2";
|
||||
import { create, fromBinary, toBinary } from "./protobuf";
|
||||
import { type } from "@oh-my-pi/omptype";
|
||||
import { isKimiK3ModelId } from "../identity";
|
||||
import { bareModelId, parseGlmModel, semverGte } from "../identity/classify";
|
||||
@@ -7,6 +6,7 @@ import { getBundledModels } from "../models";
|
||||
import { toModelSpec } from "../provider-models/bundled-references";
|
||||
import type { Model, ModelSpec } from "../types";
|
||||
import { GetUsableModelsRequestSchema, GetUsableModelsResponseSchema } from "./cursor-proto";
|
||||
import { create, fromBinary, toBinary } from "./protobuf";
|
||||
|
||||
const CURSOR_DEFAULT_BASE_URL = "https://api2.cursor.sh";
|
||||
const CURSOR_DEFAULT_CLIENT_VERSION = "cli-2026.02.13-41ac335";
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { gunzipSync } from "node:zlib";
|
||||
import { create, fromBinary, toBinary } from "./protobuf";
|
||||
import type { FetchImpl, ModelSpec } from "../types";
|
||||
import { discoveryFetch } from "../utils";
|
||||
import {
|
||||
@@ -8,6 +7,7 @@ import {
|
||||
GetCliModelConfigsResponseSchema,
|
||||
MetadataSchema,
|
||||
} from "./devin-proto";
|
||||
import { create, fromBinary, toBinary } from "./protobuf";
|
||||
|
||||
const DEVIN_DEFAULT_BASE_URL = "https://server.codeium.com";
|
||||
const DEVIN_GET_CLI_MODEL_CONFIGS_PATH = "/exa.api_server_pb.ApiServerService/GetCliModelConfigs";
|
||||
|
||||
@@ -4,11 +4,11 @@ import * as http2 from "node:http2";
|
||||
import type * as net from "node:net";
|
||||
import * as os from "node:os";
|
||||
import * as path from "node:path";
|
||||
import { create, toBinary } from "../src/discovery/protobuf";
|
||||
// Import from source, not the package specifier: the workspace `node_modules`
|
||||
// copy resolves to the primary checkout, not this worktree.
|
||||
import { fetchCursorUsableModels } from "../src/discovery/cursor";
|
||||
import { GetUsableModelsResponseSchema, ModelDetailsSchema } from "../src/discovery/cursor-proto";
|
||||
import { create, toBinary } from "../src/discovery/protobuf";
|
||||
import { resolveProviderModels } from "../src/model-manager";
|
||||
import { cursorModelManagerOptions } from "../src/provider-models/special";
|
||||
import type { ModelSpec } from "../src/types";
|
||||
|
||||
@@ -2,7 +2,6 @@ import { afterEach, beforeEach, describe, expect, it } from "bun:test";
|
||||
import * as fs from "node:fs/promises";
|
||||
import * as os from "node:os";
|
||||
import * as path from "node:path";
|
||||
import { create, fromBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import { type } from "@oh-my-pi/omptype";
|
||||
import type { AgentEvent, AgentTool, AgentToolContext } from "@oh-my-pi/pi-agent-core";
|
||||
import { type BlockState, handleServerMessage, type ToolCallState } from "@oh-my-pi/pi-ai/providers/cursor";
|
||||
@@ -18,6 +17,7 @@ import {
|
||||
ReadArgsSchema,
|
||||
ShellArgsSchema,
|
||||
} from "@oh-my-pi/pi-catalog/discovery/cursor-proto";
|
||||
import { create, fromBinary } from "@oh-my-pi/pi-catalog/discovery/protobuf";
|
||||
import { Settings } from "@oh-my-pi/pi-coding-agent/config/settings";
|
||||
import { CursorExecHandlers } from "@oh-my-pi/pi-coding-agent/cursor";
|
||||
import {
|
||||
|
||||
Reference in New Issue
Block a user