@opencode/schema 0.0.0-dev-1311 → 0.0.0-dev-1313
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/config/flag.d.ts +1 -1
- package/dist/config/flag.js +2 -2
- package/dist/tool.d.ts +15 -12
- package/package.json +1 -1
package/dist/config/flag.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const wildcard = "all";
|
|
|
6
6
|
* named explicitly in `experimental.<key>` or `OPENCODE_FLAGS`. Read a flag with Core's `Flag.enabled("<key>")`.
|
|
7
7
|
*/
|
|
8
8
|
export declare const registry: {
|
|
9
|
-
readonly todo: "Enable the experimental todowrite tool.";
|
|
9
|
+
readonly todo: "Enable the experimental todowrite tool. Off by default in every build, including local and dev; opt in with OPENCODE_FLAGS=todo or experimental.todo: true.";
|
|
10
10
|
readonly media_blob: "Store new session media once in a deduplicated blob table instead of inline in every message row.";
|
|
11
11
|
readonly automations: "Run a prompt or Code Mode action on a timer, or on a connected MCP server's push event when mcp_events is enabled.";
|
|
12
12
|
readonly artifacts: "Enable experimental artifacts backed by pluggable providers.";
|
package/dist/config/flag.js
CHANGED
|
@@ -6,7 +6,7 @@ export const wildcard = "all";
|
|
|
6
6
|
* named explicitly in `experimental.<key>` or `OPENCODE_FLAGS`. Read a flag with Core's `Flag.enabled("<key>")`.
|
|
7
7
|
*/
|
|
8
8
|
export const registry = {
|
|
9
|
-
todo: "Enable the experimental todowrite tool.",
|
|
9
|
+
todo: "Enable the experimental todowrite tool. Off by default in every build, including local and dev; opt in with OPENCODE_FLAGS=todo or experimental.todo: true.",
|
|
10
10
|
media_blob: "Store new session media once in a deduplicated blob table instead of inline in every message row.",
|
|
11
11
|
automations: "Run a prompt or Code Mode action on a timer, or on a connected MCP server's push event when mcp_events is enabled.",
|
|
12
12
|
artifacts: "Enable experimental artifacts backed by pluggable providers.",
|
|
@@ -15,7 +15,7 @@ export const registry = {
|
|
|
15
15
|
mcp_events: "Enable experimental MCP Events, a draft MCP extension: declare support to MCP servers and read the events of servers that offer them.",
|
|
16
16
|
full_codemode: "Enable the full Code Mode work in progress. Off by default in every build, including local and dev; opt in with OPENCODE_FLAGS=full_codemode or experimental.full_codemode: true.",
|
|
17
17
|
};
|
|
18
|
-
export const optInOnly = new Set(["full_codemode"]);
|
|
18
|
+
export const optInOnly = new Set(["todo", "full_codemode"]);
|
|
19
19
|
/** Earlier names of a flag, still read from `experimental.<name>` and `OPENCODE_FLAGS` when the new key is unset. */
|
|
20
20
|
export const aliases = {
|
|
21
21
|
schedules: "automations",
|
package/dist/tool.d.ts
CHANGED
|
@@ -30,25 +30,28 @@ export interface Context {
|
|
|
30
30
|
* has; a tool that does not is interrupted.
|
|
31
31
|
*/
|
|
32
32
|
readonly cancel?: Effect.Effect<void>;
|
|
33
|
+
/** True when the tool is invoked from inside Code Mode (`execute`). */
|
|
34
|
+
readonly codemode?: boolean;
|
|
33
35
|
}
|
|
34
36
|
export interface Namespace {
|
|
35
37
|
readonly name: string;
|
|
36
38
|
readonly description: string;
|
|
37
39
|
}
|
|
38
|
-
interface
|
|
40
|
+
export interface Options<CMInput extends ValueSchema<any> = ValueSchema<any>, CMOutput extends ValueSchema<any> | undefined = ValueSchema<any> | undefined> {
|
|
39
41
|
readonly namespace?: string;
|
|
40
42
|
readonly permission?: string;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
readonly codemode?: boolean | {
|
|
44
|
+
readonly pinned?: boolean;
|
|
45
|
+
readonly description?: string;
|
|
46
|
+
readonly input?: CMInput;
|
|
47
|
+
readonly output?: CMOutput;
|
|
48
|
+
};
|
|
49
|
+
/** @deprecated Use `codemode.pinned` instead. Removed in the next minor. */
|
|
44
50
|
readonly pinned?: boolean;
|
|
45
|
-
}
|
|
46
|
-
readonly codemode: boolean;
|
|
47
|
-
readonly pinned?: never;
|
|
48
|
-
});
|
|
51
|
+
}
|
|
49
52
|
export type ValueSchema<A = unknown> = Schema.Codec<A, any> | StandardSchemaV1<any, A> | JsonSchema.JsonSchema;
|
|
50
53
|
type InputValue<S> = 0 extends 1 & S ? any : S extends Schema.Codec<infer A, any> ? A : S extends StandardSchemaV1<any, infer A> ? A : unknown;
|
|
51
|
-
type OutputValue<S> = S extends undefined ? never : S extends Schema.Codec<infer A, any> ? A : S extends StandardSchemaV1<infer A, any> ? A : any;
|
|
54
|
+
type OutputValue<S> = 0 extends 1 & S ? any : S extends undefined ? never : S extends Schema.Codec<infer A, any> ? A : S extends StandardSchemaV1<infer A, any> ? A : any;
|
|
52
55
|
declare const Error_base: Schema.Class<Error, Schema.TaggedStruct<"Tool.Error", {
|
|
53
56
|
readonly message: Schema.String;
|
|
54
57
|
readonly error: Schema.optional<Schema.Defect>;
|
|
@@ -85,12 +88,12 @@ export interface Result<Output extends ValueSchema<any> | undefined = ValueSchem
|
|
|
85
88
|
readonly content?: string | ReadonlyArray<Content>;
|
|
86
89
|
readonly metadata?: Metadata;
|
|
87
90
|
}
|
|
88
|
-
export type Info<Input extends ValueSchema<any> = ValueSchema<any>, Output extends ValueSchema<any> | undefined = ValueSchema<any> | undefined> = {
|
|
91
|
+
export type Info<Input extends ValueSchema<any> = ValueSchema<any>, Output extends ValueSchema<any> | undefined = ValueSchema<any> | undefined, CMInput extends ValueSchema<any> = Input, CMOutput extends ValueSchema<any> | undefined = Output> = {
|
|
89
92
|
readonly name: string;
|
|
90
93
|
readonly input: Input;
|
|
91
94
|
readonly freeform?: Freeform;
|
|
92
95
|
readonly description: string;
|
|
93
|
-
readonly execute: (input: InputValue<Input>, context: Context) => Effect.Effect<Result<Output>, Error>;
|
|
96
|
+
readonly execute: (input: InputValue<Input> | InputValue<CMInput>, context: Context) => Effect.Effect<Result<Output | CMOutput>, Error>;
|
|
94
97
|
readonly output?: Output;
|
|
95
|
-
readonly options?: Options
|
|
98
|
+
readonly options?: Options<CMInput, CMOutput>;
|
|
96
99
|
};
|