fix(sdk): use local v2 type owners
This commit is contained in:
parent
80865407e0
commit
5bb0fb580f
31 changed files with 77 additions and 82 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import type { AgentApi } from "@opencode-ai/client/effect/api"
|
||||
import type { AgentInfo } from "@opencode-ai/sdk/v2/types"
|
||||
import type { AgentInfo } from "@opencode-ai/client/effect"
|
||||
import type { Effect } from "effect"
|
||||
import type { Transform } from "./registration.js"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { ModelInfo, ProviderV2Info } from "@opencode-ai/sdk/v2/types"
|
||||
import type { ModelInfo, ProviderV2Info } from "@opencode-ai/client/effect"
|
||||
import type { CatalogApi } from "@opencode-ai/client/effect/api"
|
||||
import type { Model } from "@opencode-ai/schema/model"
|
||||
import type { Effect } from "effect"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { CommandInfo } from "@opencode-ai/sdk/v2/types"
|
||||
import type { CommandInfo } from "@opencode-ai/client/effect"
|
||||
import type { CommandApi } from "@opencode-ai/client/effect/api"
|
||||
import type { Effect } from "effect"
|
||||
import type { Transform } from "./registration.js"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { FileSystemEntry } from "@opencode-ai/sdk/v2/types"
|
||||
import type { FileSystemEntry } from "@opencode-ai/client/effect"
|
||||
import type { Effect } from "effect"
|
||||
|
||||
export interface FileSystem {
|
||||
|
|
|
|||
|
|
@ -1,15 +1,6 @@
|
|||
import type {
|
||||
ConnectionInfo,
|
||||
CredentialOAuth,
|
||||
CredentialValue,
|
||||
IntegrationCommandMethod,
|
||||
IntegrationEnvMethod,
|
||||
IntegrationInputs,
|
||||
IntegrationKeyMethod,
|
||||
IntegrationMethod,
|
||||
IntegrationOAuthMethod,
|
||||
IntegrationRef,
|
||||
} from "@opencode-ai/sdk/v2/types"
|
||||
import type { Connection } from "@opencode-ai/schema/connection"
|
||||
import type { Credential } from "@opencode-ai/schema/credential"
|
||||
import type { Integration } from "@opencode-ai/schema/integration"
|
||||
import type { IntegrationApi } from "@opencode-ai/client/effect/api"
|
||||
import type { Effect, Scope } from "effect"
|
||||
import type { Transform } from "./registration.js"
|
||||
|
|
@ -21,44 +12,44 @@ export type IntegrationOAuthAuthorization = {
|
|||
} & (
|
||||
| {
|
||||
readonly mode: "auto"
|
||||
readonly callback: Effect.Effect<CredentialOAuth, unknown>
|
||||
readonly callback: Effect.Effect<Credential.OAuth, unknown>
|
||||
}
|
||||
| {
|
||||
readonly mode: "code"
|
||||
readonly callback: (code: string) => Effect.Effect<CredentialOAuth, unknown>
|
||||
readonly callback: (code: string) => Effect.Effect<Credential.OAuth, unknown>
|
||||
}
|
||||
)
|
||||
export type IntegrationOAuthMethodRegistration = {
|
||||
readonly integrationID: string
|
||||
readonly method: IntegrationOAuthMethod
|
||||
readonly authorize: (inputs: IntegrationInputs) => Effect.Effect<IntegrationOAuthAuthorization, unknown, Scope.Scope>
|
||||
readonly refresh?: (credential: CredentialOAuth) => Effect.Effect<CredentialOAuth, unknown>
|
||||
readonly label?: (credential: CredentialOAuth) => string | undefined
|
||||
readonly method: Integration.OAuthMethod
|
||||
readonly authorize: (inputs: Integration.Inputs) => Effect.Effect<IntegrationOAuthAuthorization, unknown, Scope.Scope>
|
||||
readonly refresh?: (credential: Credential.OAuth) => Effect.Effect<Credential.OAuth, unknown>
|
||||
readonly label?: (credential: Credential.OAuth) => string | undefined
|
||||
}
|
||||
export type IntegrationMethodRegistration =
|
||||
| IntegrationOAuthMethodRegistration
|
||||
| {
|
||||
readonly integrationID: string
|
||||
readonly method: IntegrationCommandMethod
|
||||
readonly method: Integration.CommandMethod
|
||||
}
|
||||
| {
|
||||
readonly integrationID: string
|
||||
readonly method: IntegrationKeyMethod
|
||||
readonly method: Integration.KeyMethod
|
||||
}
|
||||
| {
|
||||
readonly integrationID: string
|
||||
readonly method: IntegrationEnvMethod
|
||||
readonly method: Integration.EnvMethod
|
||||
}
|
||||
|
||||
export interface IntegrationDraft {
|
||||
list(): readonly IntegrationRef[]
|
||||
get(id: string): IntegrationRef | undefined
|
||||
update(id: string, update: (integration: IntegrationRef) => void): void
|
||||
list(): readonly Integration.Ref[]
|
||||
get(id: string): Integration.Ref | undefined
|
||||
update(id: string, update: (integration: Integration.Ref) => void): void
|
||||
remove(id: string): void
|
||||
readonly method: {
|
||||
list(integrationID: string): readonly IntegrationMethod[]
|
||||
list(integrationID: string): readonly Integration.Method[]
|
||||
update(input: IntegrationMethodRegistration): void
|
||||
remove(integrationID: string, method: IntegrationMethod): void
|
||||
remove(integrationID: string, method: Integration.Method): void
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -66,7 +57,7 @@ export interface IntegrationDomain extends Omit<IntegrationApi<unknown>, "wellkn
|
|||
readonly transform: Transform<IntegrationDraft>
|
||||
readonly reload: () => Effect.Effect<void>
|
||||
readonly connection: {
|
||||
readonly active: (integrationID: string) => Effect.Effect<ConnectionInfo | undefined>
|
||||
readonly resolve: (connection: ConnectionInfo) => Effect.Effect<CredentialValue | undefined, unknown>
|
||||
readonly active: (integrationID: string) => Effect.Effect<Connection.Info | undefined>
|
||||
readonly resolve: (connection: Connection.Info) => Effect.Effect<Credential.Value | undefined, unknown>
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import type { ReferenceGitSource, ReferenceLocalSource } from "@opencode-ai/sdk/v2/types"
|
||||
import type { Reference } from "@opencode-ai/schema/reference"
|
||||
import type { ReferenceApi } from "@opencode-ai/client/effect/api"
|
||||
import type { Effect } from "effect"
|
||||
import type { Transform } from "./registration.js"
|
||||
|
||||
export interface ReferenceDraft {
|
||||
add(name: string, source: ReferenceLocalSource | ReferenceGitSource): void
|
||||
add(name: string, source: Reference.LocalSource | Reference.GitSource): void
|
||||
remove(name: string): void
|
||||
list(): readonly (readonly [string, ReferenceLocalSource | ReferenceGitSource])[]
|
||||
list(): readonly (readonly [string, Reference.LocalSource | Reference.GitSource])[]
|
||||
}
|
||||
|
||||
export interface ReferenceDomain extends ReferenceApi<unknown> {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import type { SkillSource } from "@opencode-ai/sdk/v2/types"
|
||||
import type { Skill } from "@opencode-ai/schema/skill"
|
||||
import type { SkillApi } from "@opencode-ai/client/effect/api"
|
||||
import type { Effect } from "effect"
|
||||
import type { Transform } from "./registration.js"
|
||||
|
||||
export interface SkillDraft {
|
||||
source(source: SkillSource): void
|
||||
list(): readonly SkillSource[]
|
||||
source(source: Skill.Source): void
|
||||
list(): readonly Skill.Source[]
|
||||
}
|
||||
|
||||
export interface SkillDomain extends SkillApi<unknown> {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,7 @@
|
|||
import type { IntegrationApi } from "@opencode-ai/client/promise/api"
|
||||
import type { IntegrationDraft, IntegrationMethodRegistration } from "../effect/integration.js"
|
||||
import type {
|
||||
CredentialOAuth,
|
||||
CredentialValue,
|
||||
IntegrationEnvMethod,
|
||||
IntegrationInputs,
|
||||
IntegrationKeyMethod,
|
||||
IntegrationOAuthMethod,
|
||||
} from "@opencode-ai/sdk/v2/types"
|
||||
import type { Connection } from "@opencode-ai/schema/connection"
|
||||
import type { Credential } from "@opencode-ai/schema/credential"
|
||||
import type { Transform } from "./registration.js"
|
||||
|
||||
export type { IntegrationDraft, IntegrationMethodRegistration }
|
||||
|
|
@ -19,11 +13,11 @@ export type IntegrationOAuthAuthorization = {
|
|||
} & (
|
||||
| {
|
||||
readonly mode: "auto"
|
||||
readonly callback: Promise<CredentialOAuth>
|
||||
readonly callback: Promise<Credential.OAuth>
|
||||
}
|
||||
| {
|
||||
readonly mode: "code"
|
||||
readonly callback: (code: string) => Promise<CredentialOAuth>
|
||||
readonly callback: (code: string) => Promise<Credential.OAuth>
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -31,9 +25,7 @@ export interface IntegrationDomain extends Omit<IntegrationApi, "wellknown"> {
|
|||
readonly transform: Transform<IntegrationDraft>
|
||||
readonly reload: () => Promise<void>
|
||||
readonly connection: {
|
||||
readonly active: (integrationID: string) => Promise<import("@opencode-ai/sdk/v2/types").ConnectionInfo | undefined>
|
||||
readonly resolve: (
|
||||
connection: import("@opencode-ai/sdk/v2/types").ConnectionInfo,
|
||||
) => Promise<CredentialValue | undefined>
|
||||
readonly active: (integrationID: string) => Promise<Connection.Info | undefined>
|
||||
readonly resolve: (connection: Connection.Info) => Promise<Credential.Value | undefined>
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue