@opencode-ai/plugin 0.0.0-next-15718 → 0.0.0-next-15766
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.
|
@@ -19,6 +19,6 @@ export interface SessionContext {
|
|
|
19
19
|
export interface SessionHooks {
|
|
20
20
|
readonly context: SessionContext;
|
|
21
21
|
}
|
|
22
|
-
export type SessionDomain = Pick<SessionApi<unknown>, "create" | "get" | "prompt" | "command" | "synthetic" | "interrupt"> & {
|
|
22
|
+
export type SessionDomain = Pick<SessionApi<unknown>, "create" | "get" | "prompt" | "generate" | "command" | "synthetic" | "interrupt"> & {
|
|
23
23
|
readonly hook: Hooks<SessionHooks>;
|
|
24
24
|
};
|
package/dist/v2/effect/tool.d.ts
CHANGED
|
@@ -109,12 +109,13 @@ export declare function make<Input extends SchemaType<any>, Output extends Schem
|
|
|
109
109
|
export declare function make(config: DynamicDefinition): DynamicDefinition;
|
|
110
110
|
export declare function make(config: AnyTool): AnyTool;
|
|
111
111
|
export declare const validateName: (name: string) => Effect.Effect<void, never, never> | Effect.Effect<never, RegistrationError, never>;
|
|
112
|
-
export declare const registrationEntries: (tools: Readonly<Record<string, AnyTool>>,
|
|
112
|
+
export declare const registrationEntries: (tools: Readonly<Record<string, AnyTool>>, namespace?: string) => {
|
|
113
113
|
key: string;
|
|
114
114
|
name: string;
|
|
115
|
-
|
|
115
|
+
namespace: string | undefined;
|
|
116
116
|
tool: AnyTool;
|
|
117
117
|
}[];
|
|
118
|
+
export declare const validateNamespace: (namespace: string) => Effect.Effect<void, never, never> | Effect.Effect<never, RegistrationError, never>;
|
|
118
119
|
export declare const withPermission: <T extends AnyTool>(tool: T, permission: string) => Omit<T, "permission"> & {
|
|
119
120
|
readonly permission: string;
|
|
120
121
|
};
|
|
@@ -141,7 +142,7 @@ export interface ToolExecuteAfterEvent {
|
|
|
141
142
|
outputPaths?: ReadonlyArray<string>;
|
|
142
143
|
}
|
|
143
144
|
export interface RegisterOptions {
|
|
144
|
-
readonly
|
|
145
|
+
readonly namespace?: string;
|
|
145
146
|
/** Defaults to true. False exposes the tool directly to the provider. */
|
|
146
147
|
readonly codemode?: boolean;
|
|
147
148
|
}
|
package/dist/v2/effect/tool.js
CHANGED
|
@@ -25,16 +25,18 @@ function toModelContent(part) {
|
|
|
25
25
|
export const validateName = (name) => /^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(name)
|
|
26
26
|
? Effect.void
|
|
27
27
|
: Effect.fail(new RegistrationError({ name, message: `Invalid tool name: ${name}` }));
|
|
28
|
-
export const registrationEntries = (tools,
|
|
28
|
+
export const registrationEntries = (tools, namespace) => Object.entries(tools).map(([name, tool]) => {
|
|
29
29
|
const normalized = name.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
30
|
-
const parent = group?.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
31
30
|
return {
|
|
32
|
-
key:
|
|
31
|
+
key: namespace === undefined ? normalized : `${namespace.replaceAll(".", "_")}_${normalized}`,
|
|
33
32
|
name: normalized,
|
|
34
|
-
|
|
33
|
+
namespace,
|
|
35
34
|
tool,
|
|
36
35
|
};
|
|
37
36
|
});
|
|
37
|
+
export const validateNamespace = (namespace) => namespace.split(".").every((segment) => /^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(segment))
|
|
38
|
+
? Effect.void
|
|
39
|
+
: Effect.fail(new RegistrationError({ name: namespace, message: `Invalid tool namespace: ${JSON.stringify(namespace)}` }));
|
|
38
40
|
export const withPermission = (tool, permission) => ({ ...tool, permission });
|
|
39
41
|
export const permission = (tool, name) => tool.permission ?? name;
|
|
40
42
|
export const definition = (name, tool) => "jsonSchema" in tool
|
|
@@ -19,6 +19,6 @@ export interface SessionContext {
|
|
|
19
19
|
export interface SessionHooks {
|
|
20
20
|
readonly context: SessionContext;
|
|
21
21
|
}
|
|
22
|
-
export type SessionDomain = Pick<SessionApi, "create" | "get" | "prompt" | "command" | "synthetic" | "interrupt"> & {
|
|
22
|
+
export type SessionDomain = Pick<SessionApi, "create" | "get" | "prompt" | "generate" | "command" | "synthetic" | "interrupt"> & {
|
|
23
23
|
readonly hook: Hooks<SessionHooks>;
|
|
24
24
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode-ai/plugin",
|
|
4
|
-
"version": "0.0.0-next-
|
|
4
|
+
"version": "0.0.0-next-15766",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {
|
|
@@ -52,18 +52,18 @@
|
|
|
52
52
|
],
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@ai-sdk/provider": "3.0.8",
|
|
55
|
-
"@opencode-ai/ai": "0.0.0-next-
|
|
56
|
-
"@opencode-ai/client": "0.0.0-next-
|
|
57
|
-
"@opencode-ai/schema": "0.0.0-next-
|
|
58
|
-
"@opencode-ai/sdk": "0.0.0-next-
|
|
55
|
+
"@opencode-ai/ai": "0.0.0-next-15766",
|
|
56
|
+
"@opencode-ai/client": "0.0.0-next-15766",
|
|
57
|
+
"@opencode-ai/schema": "0.0.0-next-15766",
|
|
58
|
+
"@opencode-ai/sdk": "0.0.0-next-15766",
|
|
59
59
|
"@standard-schema/spec": "^1.1.0",
|
|
60
|
-
"effect": "4.0.0-beta.
|
|
60
|
+
"effect": "4.0.0-beta.98",
|
|
61
61
|
"zod": "4.1.8"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@opentui/core": ">=0.4.
|
|
65
|
-
"@opentui/keymap": ">=0.4.
|
|
66
|
-
"@opentui/solid": ">=0.4.
|
|
64
|
+
"@opentui/core": ">=0.4.5",
|
|
65
|
+
"@opentui/keymap": ">=0.4.5",
|
|
66
|
+
"@opentui/solid": ">=0.4.5"
|
|
67
67
|
},
|
|
68
68
|
"peerDependenciesMeta": {
|
|
69
69
|
"@opentui/core": {
|
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@opentui/core": "0.4.
|
|
81
|
-
"@opentui/keymap": "0.4.
|
|
82
|
-
"@opentui/solid": "0.4.
|
|
80
|
+
"@opentui/core": "0.4.5",
|
|
81
|
+
"@opentui/keymap": "0.4.5",
|
|
82
|
+
"@opentui/solid": "0.4.5",
|
|
83
83
|
"@tsconfig/bun": "1.0.9",
|
|
84
84
|
"@tsconfig/node22": "22.0.2",
|
|
85
85
|
"@types/node": "24.12.2",
|