Skip to content

TypeScript SDK: Use generated types for model info and remove duplicates#1564

Draft
sergiou87 wants to merge 1 commit into
github:mainfrom
sergiou87:ts-use-generated-model-info
Draft

TypeScript SDK: Use generated types for model info and remove duplicates#1564
sergiou87 wants to merge 1 commit into
github:mainfrom
sergiou87:ts-use-generated-model-info

Conversation

@sergiou87
Copy link
Copy Markdown
Member

Replace local duplicate model info types (which need to be manually updated) with types from generated files.

I tried this approach since I see the same pattern used for SessionEvent and RemoteSessionMode:

import type {
ReasoningSummary,
SessionEvent as GeneratedSessionEvent,
} from "./generated/session-events.js";
import type { CopilotSession } from "./session.js";
import type { RemoteSessionMode } from "./generated/rpc.js";
import type { OpenCanvasInstance } from "./generated/rpc.js";
import type { ToolSet } from "./toolSet.js";
export type { RemoteSessionMode } from "./generated/rpc.js";
export type SessionEvent = GeneratedSessionEvent;

Replace local duplicate model/session types with imports/exported types from generated files. Reorder imports, re-export model, remote session and session-fs related types, and export SessionEvent. Remove redundant local interfaces (ModelCapabilities, ModelInfo, ModelPolicy, ModelBilling) to centralize type definitions in generated/rpc and generated/session-events.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant