@opencode/plugin 0.0.0-beta-19507 → 0.0.0-dev-19276

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.
@@ -16,6 +16,6 @@ export interface PermissionEvaluation {
16
16
  export interface PermissionHooks {
17
17
  readonly evaluate: PermissionEvaluation;
18
18
  }
19
- export type PermissionDomain = Pick<PermissionApi<unknown>, "list" | "get" | "reply" | "rules"> & {
19
+ export type PermissionDomain = Pick<PermissionApi<unknown>, "list" | "get" | "reply"> & {
20
20
  readonly hook: Hooks<PermissionHooks>;
21
21
  };
@@ -7,7 +7,6 @@ import type { Session } from "@opencode/schema/session";
7
7
  import type { SessionInbox } from "@opencode/schema/session-inbox";
8
8
  import type { SessionError } from "@opencode/schema/session-error";
9
9
  import type { SessionMessage } from "@opencode/schema/session-message";
10
- import type { TokenUsage } from "@opencode/schema/token-usage";
11
10
  import type { JsonSchema, Types } from "effect";
12
11
  import type { ModelHooks } from "./registration.js";
13
12
  export interface SessionPrompt {
@@ -17,37 +16,19 @@ export interface SessionPrompt {
17
16
  metadata?: Record<string, unknown>;
18
17
  delivery: SessionInbox.Delivery;
19
18
  }
20
- /** Request overrides. Typed keys are generation settings; any other key is a provider option. */
21
- export type SessionRequestOptions = Types.DeepMutable<GenerationOptionsFields> & Record<string, unknown>;
22
- export interface SessionRequest {
19
+ export interface SessionContext {
23
20
  readonly sessionID: Session.ID;
21
+ readonly agent: Agent.ID;
24
22
  readonly model: Model.Ref;
25
23
  system: Array<SystemPart>;
26
24
  messages: Array<Message>;
27
- options: SessionRequestOptions;
28
- }
29
- export interface SessionContext extends SessionRequest {
30
- readonly agent: Agent.ID;
31
25
  tools: Record<string, {
32
26
  description: string;
33
27
  input: JsonSchema.JsonSchema;
34
28
  }>;
35
- }
36
- export interface SessionCompactionResult {
37
- summary: string;
38
- providerState?: SessionMessage.ProviderState;
39
- metadata?: Record<string, unknown>;
40
- tokens?: TokenUsage.Info;
41
- }
42
- export interface SessionCompaction extends SessionContext {
43
- /** Set to use this compaction and skip the model request. */
44
- result?: SessionCompactionResult;
45
- }
46
- export interface SessionGenerate extends SessionContext {
47
- }
48
- export interface SessionTitle extends SessionRequest {
49
- /** Set to use this title and skip the model request. */
50
- result?: string;
29
+ /** Request overrides; unset fields retain route and model defaults. */
30
+ generation: Types.DeepMutable<GenerationOptionsFields>;
31
+ providerOptions: Record<string, unknown>;
51
32
  }
52
33
  /**
53
34
  * Why a Session request is being made. Auxiliary requests share the Session's
@@ -94,9 +75,6 @@ export interface SessionRetry {
94
75
  export interface SessionHooks {
95
76
  readonly prompt: SessionPrompt;
96
77
  readonly context: SessionContext;
97
- readonly compaction: SessionCompaction;
98
- readonly generate: SessionGenerate;
99
- readonly title: SessionTitle;
100
78
  readonly "model.request": SessionModelRequest;
101
79
  readonly "http.request": SessionHttpRequest;
102
80
  readonly "http.response": SessionHttpResponse;
@@ -3,7 +3,6 @@ import { Effect, Schema, SchemaAST, Stream } from "effect";
3
3
  import { HttpApiEndpoint, HttpApiSchema } from "effect/unstable/httpapi";
4
4
  import { define } from "../effect/plugin.js";
5
5
  const compiledEndpoints = new WeakMap();
6
- const JsonInput = Schema.fromJsonString(Schema.Unknown);
7
6
  class ReturnedRpcError extends Error {
8
7
  type;
9
8
  data;
@@ -184,9 +183,7 @@ export function fromPromise(plugin) {
184
183
  const adaptApiMethod = (endpoint, method) => {
185
184
  const compiled = compileEndpoint(endpoint);
186
185
  return ((input) => Effect.gen(function* () {
187
- // Match the generated Promise client, whose request body crosses JSON before endpoint decoding.
188
- const normalized = yield* Schema.encodeUnknownEffect(JsonInput)(input ?? {}).pipe(Effect.flatMap(Schema.decodeUnknownEffect(JsonInput)));
189
- const decoded = yield* Effect.forEach(compiled.decode, (decode) => decode(normalized));
186
+ const decoded = yield* Effect.forEach(compiled.decode, (decode) => decode(input ?? {}));
190
187
  const result = yield* method(Object.assign({}, ...decoded));
191
188
  if (compiled.noContent)
192
189
  return undefined;
@@ -305,7 +302,6 @@ export function fromPromise(plugin) {
305
302
  list: adaptApiMethod(PermissionEndpoints["session.permission.list"], host.permission.list),
306
303
  get: adaptApiMethod(PermissionEndpoints["session.permission.get"], host.permission.get),
307
304
  reply: adaptApiMethod(PermissionEndpoints["session.permission.reply"], host.permission.reply),
308
- rules: adaptApiMethod(PermissionEndpoints["session.permission.rules"], host.permission.rules),
309
305
  },
310
306
  plugin: {
311
307
  list: adaptApiMethod(PluginEndpoints["plugin.list"], host.plugin.list),
@@ -16,6 +16,6 @@ export interface PermissionEvaluation {
16
16
  export interface PermissionHooks {
17
17
  readonly evaluate: PermissionEvaluation;
18
18
  }
19
- export type PermissionDomain = Pick<PermissionApi, "list" | "get" | "reply" | "rules"> & {
19
+ export type PermissionDomain = Pick<PermissionApi, "list" | "get" | "reply"> & {
20
20
  readonly hook: Hooks<PermissionHooks>;
21
21
  };
@@ -7,7 +7,6 @@ import type { Session } from "@opencode/schema/session";
7
7
  import type { SessionInbox } from "@opencode/schema/session-inbox";
8
8
  import type { SessionError } from "@opencode/schema/session-error";
9
9
  import type { SessionMessage } from "@opencode/schema/session-message";
10
- import type { TokenUsage } from "@opencode/schema/token-usage";
11
10
  import type { JsonSchema, Types } from "effect";
12
11
  import type { ModelHooks } from "./registration.js";
13
12
  export interface SessionPrompt {
@@ -17,37 +16,19 @@ export interface SessionPrompt {
17
16
  metadata?: Record<string, unknown>;
18
17
  delivery: SessionInbox.Delivery;
19
18
  }
20
- /** Request overrides. Typed keys are generation settings; any other key is a provider option. */
21
- export type SessionRequestOptions = Types.DeepMutable<GenerationOptionsFields> & Record<string, unknown>;
22
- export interface SessionRequest {
19
+ export interface SessionContext {
23
20
  readonly sessionID: Session.ID;
21
+ readonly agent: Agent.ID;
24
22
  readonly model: Model.Ref;
25
23
  system: Array<SystemPart>;
26
24
  messages: Array<Message>;
27
- options: SessionRequestOptions;
28
- }
29
- export interface SessionContext extends SessionRequest {
30
- readonly agent: Agent.ID;
31
25
  tools: Record<string, {
32
26
  description: string;
33
27
  input: JsonSchema.JsonSchema;
34
28
  }>;
35
- }
36
- export interface SessionCompactionResult {
37
- summary: string;
38
- providerState?: SessionMessage.ProviderState;
39
- metadata?: Record<string, unknown>;
40
- tokens?: TokenUsage.Info;
41
- }
42
- export interface SessionCompaction extends SessionContext {
43
- /** Set to use this compaction and skip the model request. */
44
- result?: SessionCompactionResult;
45
- }
46
- export interface SessionGenerate extends SessionContext {
47
- }
48
- export interface SessionTitle extends SessionRequest {
49
- /** Set to use this title and skip the model request. */
50
- result?: string;
29
+ /** Request overrides; unset fields retain route and model defaults. */
30
+ generation: Types.DeepMutable<GenerationOptionsFields>;
31
+ providerOptions: Record<string, unknown>;
51
32
  }
52
33
  /**
53
34
  * Why a Session request is being made. Auxiliary requests share the Session's
@@ -94,9 +75,6 @@ export interface SessionRetry {
94
75
  export interface SessionHooks {
95
76
  readonly prompt: SessionPrompt;
96
77
  readonly context: SessionContext;
97
- readonly compaction: SessionCompaction;
98
- readonly generate: SessionGenerate;
99
- readonly title: SessionTitle;
100
78
  readonly "model.request": SessionModelRequest;
101
79
  readonly "http.request": SessionHttpRequest;
102
80
  readonly "http.response": SessionHttpResponse;
@@ -426,12 +426,10 @@ export interface UI {
426
426
  readonly attention: boolean;
427
427
  readonly unread?: "activity" | "error";
428
428
  }[];
429
- /** Opens a tab for a session without focusing it. Returns false when tabs are disabled. */
429
+ /** Opens (or focuses) a tab for a session, adding it when not already open. Returns false when tabs are disabled. */
430
430
  open(sessionID: string): boolean;
431
- /** Opens a tab when needed, then focuses it. Returns false when tabs are disabled. */
431
+ /** Focuses an already-open tab and returns false when it is not open. */
432
432
  focus(sessionID: string): boolean;
433
- /** Moves an open tab to an index and returns false when it is not open. */
434
- move(sessionID: string, index: number): boolean;
435
433
  /** Closes an open tab, or the active tab when omitted, and returns false when no tab matched. */
436
434
  close(sessionID?: string): boolean;
437
435
  };
@@ -1,6 +1,5 @@
1
1
  export interface WorktreeCreateInput {
2
2
  readonly sourceDirectory: string;
3
- /** Suggested destination after naming and collision handling. Strategies may return a different directory. */
4
3
  readonly directory: string;
5
4
  /** Starting ref, not the name of a new branch. Reject unsupported refs rather than ignoring them. */
6
5
  readonly branch?: string;
@@ -10,7 +9,6 @@ export interface WorktreeRemoveInput {
10
9
  readonly force: boolean;
11
10
  }
12
11
  export interface WorktreeResult {
13
- /** Actual directory created by the strategy, used for inventory and startup commands. */
14
12
  readonly directory: string;
15
13
  }
16
14
  export interface WorktreeEntry extends WorktreeResult {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode/plugin",
4
- "version": "0.0.0-beta-19507",
4
+ "version": "0.0.0-dev-19276",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -43,17 +43,17 @@
43
43
  ],
44
44
  "dependencies": {
45
45
  "@ai-sdk/provider": "3.0.8",
46
- "@opencode/ai": "0.0.0-beta-19507",
47
- "@opencode/client": "0.0.0-beta-19507",
48
- "@opencode/protocol": "0.0.0-beta-19507",
49
- "@opencode/schema": "0.0.0-beta-19507",
50
- "@opencode/util": "0.0.0-beta-19507",
46
+ "@opencode/ai": "0.0.0-dev-19276",
47
+ "@opencode/client": "0.0.0-dev-19276",
48
+ "@opencode/protocol": "0.0.0-dev-19276",
49
+ "@opencode/schema": "0.0.0-dev-19276",
50
+ "@opencode/util": "0.0.0-dev-19276",
51
51
  "@standard-schema/spec": "1.1.0",
52
52
  "effect": "4.0.0-rc.112",
53
53
  "zod": "4.1.8"
54
54
  },
55
55
  "peerDependencies": {
56
- "@opencode/theme": "0.0.0-beta-19507",
56
+ "@opencode/theme": "0.0.0-dev-19276",
57
57
  "@opentui/core": ">=0.5.10",
58
58
  "@opentui/solid": ">=0.5.10",
59
59
  "solid-js": ">=1.9.0"
@@ -73,7 +73,7 @@
73
73
  }
74
74
  },
75
75
  "devDependencies": {
76
- "@opencode/theme": "0.0.0-beta-19507",
76
+ "@opencode/theme": "0.0.0-dev-19276",
77
77
  "@opentui/core": "0.5.10",
78
78
  "@opentui/solid": "0.5.10",
79
79
  "@tsconfig/bun": "1.0.9",