chore: generate
This commit is contained in:
parent
cf80b5c470
commit
cfddb2407c
5 changed files with 250 additions and 28 deletions
|
|
@ -67,8 +67,7 @@ export function fromPromise(plugin: Plugin) {
|
||||||
reload: () => run(host.integration.reload()),
|
reload: () => run(host.integration.reload()),
|
||||||
connection: {
|
connection: {
|
||||||
active: (id) => Effect.runPromiseWith(context)(host.integration.connection.active(id)),
|
active: (id) => Effect.runPromiseWith(context)(host.integration.connection.active(id)),
|
||||||
resolve: (connection) =>
|
resolve: (connection) => Effect.runPromiseWith(context)(host.integration.connection.resolve(connection)),
|
||||||
Effect.runPromiseWith(context)(host.integration.connection.resolve(connection)),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugin: {
|
plugin: {
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,7 @@ export type IntegrationOAuthAuthorization = {
|
||||||
export type IntegrationOAuthMethodRegistration = {
|
export type IntegrationOAuthMethodRegistration = {
|
||||||
readonly integrationID: string
|
readonly integrationID: string
|
||||||
readonly method: IntegrationOAuthMethod
|
readonly method: IntegrationOAuthMethod
|
||||||
readonly authorize: (
|
readonly authorize: (inputs: IntegrationInputs) => Effect.Effect<IntegrationOAuthAuthorization, unknown, Scope.Scope>
|
||||||
inputs: IntegrationInputs,
|
|
||||||
) => Effect.Effect<IntegrationOAuthAuthorization, unknown, Scope.Scope>
|
|
||||||
readonly refresh?: (credential: CredentialOAuth) => Effect.Effect<CredentialOAuth, unknown>
|
readonly refresh?: (credential: CredentialOAuth) => Effect.Effect<CredentialOAuth, unknown>
|
||||||
readonly label?: (credential: CredentialOAuth) => string | undefined
|
readonly label?: (credential: CredentialOAuth) => string | undefined
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,6 @@ export type { AgentDraft, AgentHooks } from "./agent.js"
|
||||||
export type { AISDKHooks } from "./aisdk.js"
|
export type { AISDKHooks } from "./aisdk.js"
|
||||||
export type { CatalogDraft, CatalogHooks, CatalogProviderRecord } from "./catalog.js"
|
export type { CatalogDraft, CatalogHooks, CatalogProviderRecord } from "./catalog.js"
|
||||||
export type { CommandDraft, CommandHooks } from "./command.js"
|
export type { CommandDraft, CommandHooks } from "./command.js"
|
||||||
export type {
|
export type { IntegrationDraft, IntegrationHooks, IntegrationMethodRegistration } from "./integration.js"
|
||||||
IntegrationDraft,
|
|
||||||
IntegrationHooks,
|
|
||||||
IntegrationMethodRegistration,
|
|
||||||
} from "./integration.js"
|
|
||||||
export type { ReferenceDraft, ReferenceHooks } from "./reference.js"
|
export type { ReferenceDraft, ReferenceHooks } from "./reference.js"
|
||||||
export type { SkillDraft, SkillHooks } from "./skill.js"
|
export type { SkillDraft, SkillHooks } from "./skill.js"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
import type {
|
import type { IntegrationDraft, IntegrationMethodRegistration } from "../effect/integration.js"
|
||||||
IntegrationDraft,
|
|
||||||
IntegrationMethodRegistration,
|
|
||||||
} from "../effect/integration.js"
|
|
||||||
import type { CredentialValue } from "@opencode-ai/sdk/v2/types"
|
import type { CredentialValue } from "@opencode-ai/sdk/v2/types"
|
||||||
import type { Hooks } from "./registration.js"
|
import type { Hooks } from "./registration.js"
|
||||||
|
|
||||||
|
|
@ -9,9 +6,7 @@ export type { IntegrationDraft, IntegrationMethodRegistration }
|
||||||
|
|
||||||
export interface IntegrationHooks extends Hooks<{ transform: IntegrationDraft }> {
|
export interface IntegrationHooks extends Hooks<{ transform: IntegrationDraft }> {
|
||||||
readonly connection: {
|
readonly connection: {
|
||||||
readonly active: (
|
readonly active: (integrationID: string) => Promise<import("@opencode-ai/sdk/v2/types").ConnectionInfo | undefined>
|
||||||
integrationID: string,
|
|
||||||
) => Promise<import("@opencode-ai/sdk/v2/types").ConnectionInfo | undefined>
|
|
||||||
readonly resolve: (
|
readonly resolve: (
|
||||||
connection: import("@opencode-ai/sdk/v2/types").ConnectionInfo,
|
connection: import("@opencode-ai/sdk/v2/types").ConnectionInfo,
|
||||||
) => Promise<CredentialValue | undefined>
|
) => Promise<CredentialValue | undefined>
|
||||||
|
|
|
||||||
|
|
@ -14647,6 +14647,9 @@
|
||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/EventIntegrationUpdated"
|
"$ref": "#/components/schemas/EventIntegrationUpdated"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/EventIntegrationConnectionUpdated"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/EventCatalogUpdated"
|
"$ref": "#/components/schemas/EventCatalogUpdated"
|
||||||
},
|
},
|
||||||
|
|
@ -16821,6 +16824,31 @@
|
||||||
"required": ["id", "type", "properties"],
|
"required": ["id", "type", "properties"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^evt_"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["integration.connection.updated"]
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"integrationID": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["integrationID"],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["id", "type", "properties"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
@ -22989,6 +23017,9 @@
|
||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/V2EventIntegrationUpdated"
|
"$ref": "#/components/schemas/V2EventIntegrationUpdated"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/V2EventIntegrationConnectionUpdated"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/V2EventCatalogUpdated"
|
"$ref": "#/components/schemas/V2EventCatalogUpdated"
|
||||||
},
|
},
|
||||||
|
|
@ -23427,6 +23458,61 @@
|
||||||
"required": ["id", "type", "properties"],
|
"required": ["id", "type", "properties"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
|
"CredentialValue": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/CredentialOAuth"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/CredentialKey"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"IntegrationInputs": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"IntegrationMethod": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/IntegrationOAuthMethod"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/IntegrationKeyMethod"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/IntegrationEnvMethod"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"IntegrationRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["id", "name"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"SkillV2Source": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/SkillV2DirectorySource"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/SkillV2UrlSource"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/SkillV2EmbeddedSource"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"MoveSessionDestination": {
|
"MoveSessionDestination": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
@ -27487,17 +27573,7 @@
|
||||||
"methods": {
|
"methods": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"anyOf": [
|
"$ref": "#/components/schemas/IntegrationMethod"
|
||||||
{
|
|
||||||
"$ref": "#/components/schemas/IntegrationOAuthMethod"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$ref": "#/components/schemas/IntegrationKeyMethod"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$ref": "#/components/schemas/IntegrationEnvMethod"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"connections": {
|
"connections": {
|
||||||
|
|
@ -27797,6 +27873,53 @@
|
||||||
"required": ["id", "type", "data"],
|
"required": ["id", "type", "data"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
|
"V2EventIntegrationConnectionUpdated": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^evt_"
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"durable": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"aggregateID": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"seq": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"version": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["aggregateID", "seq", "version"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"location": {
|
||||||
|
"$ref": "#/components/schemas/LocationRef"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["integration.connection.updated"]
|
||||||
|
},
|
||||||
|
"data": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"integrationID": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["integrationID"],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["id", "type", "data"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
"V2EventCatalogUpdated": {
|
"V2EventCatalogUpdated": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
@ -32682,6 +32805,31 @@
|
||||||
"required": ["id", "type", "properties"],
|
"required": ["id", "type", "properties"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
|
"EventIntegrationConnectionUpdated": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^evt_"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["integration.connection.updated"]
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"integrationID": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["integrationID"],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["id", "type", "properties"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
"EventCatalogUpdated": {
|
"EventCatalogUpdated": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
@ -35466,6 +35614,92 @@
|
||||||
"required": ["id", "type", "properties"],
|
"required": ["id", "type", "properties"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
|
"CredentialOAuth": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["oauth"]
|
||||||
|
},
|
||||||
|
"methodID": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"refresh": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"access": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"expires": {
|
||||||
|
"type": "integer",
|
||||||
|
"minimum": 0
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"type": "object"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["type", "methodID", "refresh", "access", "expires"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"CredentialKey": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["key"]
|
||||||
|
},
|
||||||
|
"key": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"type": "object"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["type", "key"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"SkillV2DirectorySource": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["directory"]
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["type", "path"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"SkillV2UrlSource": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["url"]
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["type", "url"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"SkillV2EmbeddedSource": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["embedded"]
|
||||||
|
},
|
||||||
|
"skill": {
|
||||||
|
"$ref": "#/components/schemas/SkillV2Info"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["type", "skill"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
"BadRequestError": {
|
"BadRequestError": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": ["name", "data"],
|
"required": ["name", "data"],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue