@opencode-ai/plugin 0.0.0-fix-build-202511160139 → 0.0.0-next-202606261956
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/dist/example-workspace.d.ts +3 -0
- package/dist/example-workspace.js +30 -0
- package/dist/example.d.ts +1 -1
- package/dist/example.js +2 -2
- package/dist/index.d.ts +259 -92
- package/dist/index.js +1 -1
- package/dist/shell.js +1 -0
- package/dist/tool.d.ts +42 -2
- package/dist/tui.d.ts +510 -0
- package/dist/tui.js +7 -0
- package/dist/v2/effect/agent.d.ts +12 -0
- package/dist/v2/effect/agent.js +1 -0
- package/dist/v2/effect/aisdk.d.ts +17 -0
- package/dist/v2/effect/aisdk.js +1 -0
- package/dist/v2/effect/catalog.d.ts +29 -0
- package/dist/v2/effect/catalog.js +1 -0
- package/dist/v2/effect/command.d.ts +11 -0
- package/dist/v2/effect/command.js +1 -0
- package/dist/v2/effect/context.d.ts +21 -0
- package/dist/v2/effect/context.js +1 -0
- package/dist/v2/effect/event.d.ts +8 -0
- package/dist/v2/effect/event.js +1 -0
- package/dist/v2/effect/filesystem.d.ts +23 -0
- package/dist/v2/effect/filesystem.js +1 -0
- package/dist/v2/effect/index.d.ts +3 -0
- package/dist/v2/effect/index.js +1 -0
- package/dist/v2/effect/integration.d.ts +46 -0
- package/dist/v2/effect/integration.js +1 -0
- package/dist/v2/effect/location.d.ts +6 -0
- package/dist/v2/effect/location.js +1 -0
- package/dist/v2/effect/npm.d.ts +7 -0
- package/dist/v2/effect/npm.js +1 -0
- package/dist/v2/effect/path.d.ts +8 -0
- package/dist/v2/effect/path.js +1 -0
- package/dist/v2/effect/plugin.d.ts +11 -0
- package/dist/v2/effect/plugin.js +3 -0
- package/dist/v2/effect/reference.d.ts +10 -0
- package/dist/v2/effect/reference.js +1 -0
- package/dist/v2/effect/registration.d.ts +10 -0
- package/dist/v2/effect/registration.js +1 -0
- package/dist/v2/effect/skill.d.ts +9 -0
- package/dist/v2/effect/skill.js +1 -0
- package/dist/v2/options.d.ts +1 -0
- package/dist/v2/options.js +1 -0
- package/dist/v2/promise/agent.d.ts +6 -0
- package/dist/v2/promise/agent.js +1 -0
- package/dist/v2/promise/aisdk.d.ts +17 -0
- package/dist/v2/promise/aisdk.js +1 -0
- package/dist/v2/promise/catalog.d.ts +6 -0
- package/dist/v2/promise/catalog.js +1 -0
- package/dist/v2/promise/command.d.ts +6 -0
- package/dist/v2/promise/command.js +1 -0
- package/dist/v2/promise/context.d.ts +21 -0
- package/dist/v2/promise/context.js +1 -0
- package/dist/v2/promise/index.d.ts +12 -0
- package/dist/v2/promise/index.js +1 -0
- package/dist/v2/promise/integration.d.ts +12 -0
- package/dist/v2/promise/integration.js +1 -0
- package/dist/v2/promise/plugin.d.ts +10 -0
- package/dist/v2/promise/plugin.js +3 -0
- package/dist/v2/promise/reference.d.ts +6 -0
- package/dist/v2/promise/reference.js +1 -0
- package/dist/v2/promise/registration.d.ts +9 -0
- package/dist/v2/promise/registration.js +1 -0
- package/dist/v2/promise/skill.d.ts +6 -0
- package/dist/v2/promise/skill.js +1 -0
- package/package.json +46 -4
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ConnectionInfo, CredentialOAuth, CredentialValue, IntegrationEnvMethod, IntegrationInputs, IntegrationKeyMethod, IntegrationMethod, IntegrationOAuthMethod, IntegrationRef } from "@opencode-ai/sdk/v2/types";
|
|
2
|
+
import type { Effect, Scope } from "effect";
|
|
3
|
+
import type { Hooks } from "./registration.js";
|
|
4
|
+
export type IntegrationOAuthAuthorization = {
|
|
5
|
+
readonly url: string;
|
|
6
|
+
readonly instructions: string;
|
|
7
|
+
} & ({
|
|
8
|
+
readonly mode: "auto";
|
|
9
|
+
readonly callback: Effect.Effect<CredentialOAuth, unknown>;
|
|
10
|
+
} | {
|
|
11
|
+
readonly mode: "code";
|
|
12
|
+
readonly callback: (code: string) => Effect.Effect<CredentialOAuth, unknown>;
|
|
13
|
+
});
|
|
14
|
+
export type IntegrationOAuthMethodRegistration = {
|
|
15
|
+
readonly integrationID: string;
|
|
16
|
+
readonly method: IntegrationOAuthMethod;
|
|
17
|
+
readonly authorize: (inputs: IntegrationInputs) => Effect.Effect<IntegrationOAuthAuthorization, unknown, Scope.Scope>;
|
|
18
|
+
readonly refresh?: (credential: CredentialOAuth) => Effect.Effect<CredentialOAuth, unknown>;
|
|
19
|
+
readonly label?: (credential: CredentialOAuth) => string | undefined;
|
|
20
|
+
};
|
|
21
|
+
export type IntegrationMethodRegistration = IntegrationOAuthMethodRegistration | {
|
|
22
|
+
readonly integrationID: string;
|
|
23
|
+
readonly method: IntegrationKeyMethod;
|
|
24
|
+
} | {
|
|
25
|
+
readonly integrationID: string;
|
|
26
|
+
readonly method: IntegrationEnvMethod;
|
|
27
|
+
};
|
|
28
|
+
export interface IntegrationDraft {
|
|
29
|
+
list(): readonly IntegrationRef[];
|
|
30
|
+
get(id: string): IntegrationRef | undefined;
|
|
31
|
+
update(id: string, update: (integration: IntegrationRef) => void): void;
|
|
32
|
+
remove(id: string): void;
|
|
33
|
+
readonly method: {
|
|
34
|
+
list(integrationID: string): readonly IntegrationMethod[];
|
|
35
|
+
update(input: IntegrationMethodRegistration): void;
|
|
36
|
+
remove(integrationID: string, method: IntegrationMethod): void;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export interface IntegrationHooks extends Hooks<{
|
|
40
|
+
transform: IntegrationDraft;
|
|
41
|
+
}> {
|
|
42
|
+
readonly connection: {
|
|
43
|
+
readonly active: (integrationID: string) => Effect.Effect<ConnectionInfo | undefined>;
|
|
44
|
+
readonly resolve: (connection: ConnectionInfo) => Effect.Effect<CredentialValue | undefined, unknown>;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Effect, Scope } from "effect";
|
|
2
|
+
import type { PluginContext } from "./context.js";
|
|
3
|
+
export interface Plugin<R = Scope.Scope> {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly effect: (context: PluginContext) => Effect.Effect<void, never, R>;
|
|
6
|
+
}
|
|
7
|
+
export declare function define<R = Scope.Scope>(plugin: Plugin<R>): Plugin<R>;
|
|
8
|
+
export interface PluginDomain {
|
|
9
|
+
readonly add: (plugin: Plugin) => Effect.Effect<void>;
|
|
10
|
+
readonly remove: (id: string) => Effect.Effect<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReferenceGitSource, ReferenceLocalSource } from "@opencode-ai/sdk/v2/types";
|
|
2
|
+
import type { Hooks } from "./registration.js";
|
|
3
|
+
export interface ReferenceDraft {
|
|
4
|
+
add(name: string, source: ReferenceLocalSource | ReferenceGitSource): void;
|
|
5
|
+
remove(name: string): void;
|
|
6
|
+
list(): readonly (readonly [string, ReferenceLocalSource | ReferenceGitSource])[];
|
|
7
|
+
}
|
|
8
|
+
export type ReferenceHooks = Hooks<{
|
|
9
|
+
transform: ReferenceDraft;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Effect, Scope } from "effect";
|
|
2
|
+
export interface Registration {
|
|
3
|
+
readonly dispose: Effect.Effect<void>;
|
|
4
|
+
}
|
|
5
|
+
export interface Reload {
|
|
6
|
+
readonly reload: () => Effect.Effect<void>;
|
|
7
|
+
}
|
|
8
|
+
export type Hooks<Spec> = {
|
|
9
|
+
readonly [Name in keyof Spec]: (callback: (input: Spec[Name]) => Effect.Effect<void> | void) => Effect.Effect<Registration, never, Scope.Scope>;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SkillV2Source } from "@opencode-ai/sdk/v2/types";
|
|
2
|
+
import type { Hooks } from "./registration.js";
|
|
3
|
+
export interface SkillDraft {
|
|
4
|
+
source(source: SkillV2Source): void;
|
|
5
|
+
list(): readonly SkillV2Source[];
|
|
6
|
+
}
|
|
7
|
+
export type SkillHooks = Hooks<{
|
|
8
|
+
transform: SkillDraft;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type PluginOptions = Readonly<Record<string, any>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { LanguageModelV3 } from "@ai-sdk/provider";
|
|
2
|
+
import type { ModelV2Info } from "@opencode-ai/sdk/v2/types";
|
|
3
|
+
import type { Hooks } from "./registration.js";
|
|
4
|
+
export type AISDKHooks = Hooks<{
|
|
5
|
+
sdk: {
|
|
6
|
+
readonly model: ModelV2Info;
|
|
7
|
+
readonly package: string;
|
|
8
|
+
readonly options: Record<string, any>;
|
|
9
|
+
sdk?: any;
|
|
10
|
+
};
|
|
11
|
+
language: {
|
|
12
|
+
readonly model: ModelV2Info;
|
|
13
|
+
readonly sdk: any;
|
|
14
|
+
readonly options: Record<string, any>;
|
|
15
|
+
language?: LanguageModelV3;
|
|
16
|
+
};
|
|
17
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PluginOptions } from "../options.js";
|
|
2
|
+
import type { AgentHooks } from "./agent.js";
|
|
3
|
+
import type { AISDKHooks } from "./aisdk.js";
|
|
4
|
+
import type { CatalogHooks } from "./catalog.js";
|
|
5
|
+
import type { CommandHooks } from "./command.js";
|
|
6
|
+
import type { IntegrationHooks } from "./integration.js";
|
|
7
|
+
import type { PluginDomain } from "./plugin.js";
|
|
8
|
+
import type { ReferenceHooks } from "./reference.js";
|
|
9
|
+
import type { SkillHooks } from "./skill.js";
|
|
10
|
+
import type { Reload } from "./registration.js";
|
|
11
|
+
export interface PluginContext {
|
|
12
|
+
readonly options: PluginOptions;
|
|
13
|
+
readonly agent: AgentHooks & Reload;
|
|
14
|
+
readonly aisdk: AISDKHooks;
|
|
15
|
+
readonly catalog: CatalogHooks & Reload;
|
|
16
|
+
readonly command: CommandHooks & Reload;
|
|
17
|
+
readonly integration: IntegrationHooks & Reload;
|
|
18
|
+
readonly plugin: PluginDomain;
|
|
19
|
+
readonly reference: ReferenceHooks & Reload;
|
|
20
|
+
readonly skill: SkillHooks & Reload;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type { PluginContext } from "./context.js";
|
|
2
|
+
export type { PluginOptions } from "../options.js";
|
|
3
|
+
export { define } from "./plugin.js";
|
|
4
|
+
export type { Plugin, PluginDomain } from "./plugin.js";
|
|
5
|
+
export type { Registration, Reload } from "./registration.js";
|
|
6
|
+
export type { AgentDraft, AgentHooks } from "./agent.js";
|
|
7
|
+
export type { AISDKHooks } from "./aisdk.js";
|
|
8
|
+
export type { CatalogDraft, CatalogHooks, CatalogProviderRecord } from "./catalog.js";
|
|
9
|
+
export type { CommandDraft, CommandHooks } from "./command.js";
|
|
10
|
+
export type { IntegrationDraft, IntegrationHooks, IntegrationMethodRegistration } from "./integration.js";
|
|
11
|
+
export type { ReferenceDraft, ReferenceHooks } from "./reference.js";
|
|
12
|
+
export type { SkillDraft, SkillHooks } from "./skill.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { define } from "./plugin.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IntegrationDraft, IntegrationMethodRegistration } from "../effect/integration.js";
|
|
2
|
+
import type { CredentialValue } from "@opencode-ai/sdk/v2/types";
|
|
3
|
+
import type { Hooks } from "./registration.js";
|
|
4
|
+
export type { IntegrationDraft, IntegrationMethodRegistration };
|
|
5
|
+
export interface IntegrationHooks extends Hooks<{
|
|
6
|
+
transform: IntegrationDraft;
|
|
7
|
+
}> {
|
|
8
|
+
readonly connection: {
|
|
9
|
+
readonly active: (integrationID: string) => Promise<import("@opencode-ai/sdk/v2/types").ConnectionInfo | undefined>;
|
|
10
|
+
readonly resolve: (connection: import("@opencode-ai/sdk/v2/types").ConnectionInfo) => Promise<CredentialValue | undefined>;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PluginContext } from "./context.js";
|
|
2
|
+
export interface Plugin {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly setup: (context: PluginContext) => Promise<void> | void;
|
|
5
|
+
}
|
|
6
|
+
export declare function define(plugin: Plugin): Plugin;
|
|
7
|
+
export interface PluginDomain {
|
|
8
|
+
readonly add: (plugin: Plugin) => Promise<void>;
|
|
9
|
+
readonly remove: (id: string) => Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface Registration {
|
|
2
|
+
readonly dispose: () => Promise<void>;
|
|
3
|
+
}
|
|
4
|
+
export interface Reload {
|
|
5
|
+
readonly reload: () => Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export type Hooks<Spec> = {
|
|
8
|
+
readonly [Name in keyof Spec]: (callback: (input: Spec[Name]) => Promise<void> | void) => Promise<Registration>;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode-ai/plugin",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-next-202606261956",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"typecheck": "tsgo --noEmit",
|
|
8
9
|
"build": "tsc"
|
|
@@ -15,19 +16,60 @@
|
|
|
15
16
|
"./tool": {
|
|
16
17
|
"import": "./dist/tool.js",
|
|
17
18
|
"types": "./dist/tool.d.ts"
|
|
19
|
+
},
|
|
20
|
+
"./tui": {
|
|
21
|
+
"import": "./dist/tui.js",
|
|
22
|
+
"types": "./dist/tui.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"./v2/effect": {
|
|
25
|
+
"import": "./dist/v2/effect/index.js",
|
|
26
|
+
"types": "./dist/v2/effect/index.d.ts"
|
|
27
|
+
},
|
|
28
|
+
"./v2/effect/integration": {
|
|
29
|
+
"import": "./dist/v2/effect/integration.js",
|
|
30
|
+
"types": "./dist/v2/effect/integration.d.ts"
|
|
31
|
+
},
|
|
32
|
+
"./v2/effect/plugin": {
|
|
33
|
+
"import": "./dist/v2/effect/plugin.js",
|
|
34
|
+
"types": "./dist/v2/effect/plugin.d.ts"
|
|
35
|
+
},
|
|
36
|
+
"./v2/promise": {
|
|
37
|
+
"import": "./dist/v2/promise/index.js",
|
|
38
|
+
"types": "./dist/v2/promise/index.d.ts"
|
|
18
39
|
}
|
|
19
40
|
},
|
|
20
41
|
"files": [
|
|
21
42
|
"dist"
|
|
22
43
|
],
|
|
23
44
|
"dependencies": {
|
|
24
|
-
"@
|
|
45
|
+
"@ai-sdk/provider": "3.0.8",
|
|
46
|
+
"@opencode-ai/sdk": "0.0.0-next-202606261956",
|
|
47
|
+
"effect": "4.0.0-beta.83",
|
|
25
48
|
"zod": "4.1.8"
|
|
26
49
|
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@opentui/core": ">=0.3.4",
|
|
52
|
+
"@opentui/keymap": ">=0.3.4",
|
|
53
|
+
"@opentui/solid": ">=0.3.4"
|
|
54
|
+
},
|
|
55
|
+
"peerDependenciesMeta": {
|
|
56
|
+
"@opentui/core": {
|
|
57
|
+
"optional": true
|
|
58
|
+
},
|
|
59
|
+
"@opentui/keymap": {
|
|
60
|
+
"optional": true
|
|
61
|
+
},
|
|
62
|
+
"@opentui/solid": {
|
|
63
|
+
"optional": true
|
|
64
|
+
}
|
|
65
|
+
},
|
|
27
66
|
"devDependencies": {
|
|
67
|
+
"@opentui/core": "0.3.4",
|
|
68
|
+
"@opentui/keymap": "0.3.4",
|
|
69
|
+
"@opentui/solid": "0.3.4",
|
|
28
70
|
"@tsconfig/node22": "22.0.2",
|
|
29
|
-
"@types/node": "
|
|
71
|
+
"@types/node": "24.12.2",
|
|
30
72
|
"typescript": "5.8.2",
|
|
31
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
73
|
+
"@typescript/native-preview": "7.0.0-dev.20251207.1"
|
|
32
74
|
}
|
|
33
75
|
}
|