@opencode/plugin 0.0.0-beta-19425 → 0.0.0-beta-19507

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"> & {
19
+ export type PermissionDomain = Pick<PermissionApi<unknown>, "list" | "get" | "reply" | "rules"> & {
20
20
  readonly hook: Hooks<PermissionHooks>;
21
21
  };
@@ -7,6 +7,7 @@ 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";
10
11
  import type { JsonSchema, Types } from "effect";
11
12
  import type { ModelHooks } from "./registration.js";
12
13
  export interface SessionPrompt {
@@ -32,6 +33,18 @@ export interface SessionContext extends SessionRequest {
32
33
  input: JsonSchema.JsonSchema;
33
34
  }>;
34
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
+ }
35
48
  export interface SessionTitle extends SessionRequest {
36
49
  /** Set to use this title and skip the model request. */
37
50
  result?: string;
@@ -81,6 +94,8 @@ export interface SessionRetry {
81
94
  export interface SessionHooks {
82
95
  readonly prompt: SessionPrompt;
83
96
  readonly context: SessionContext;
97
+ readonly compaction: SessionCompaction;
98
+ readonly generate: SessionGenerate;
84
99
  readonly title: SessionTitle;
85
100
  readonly "model.request": SessionModelRequest;
86
101
  readonly "http.request": SessionHttpRequest;
@@ -305,6 +305,7 @@ export function fromPromise(plugin) {
305
305
  list: adaptApiMethod(PermissionEndpoints["session.permission.list"], host.permission.list),
306
306
  get: adaptApiMethod(PermissionEndpoints["session.permission.get"], host.permission.get),
307
307
  reply: adaptApiMethod(PermissionEndpoints["session.permission.reply"], host.permission.reply),
308
+ rules: adaptApiMethod(PermissionEndpoints["session.permission.rules"], host.permission.rules),
308
309
  },
309
310
  plugin: {
310
311
  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"> & {
19
+ export type PermissionDomain = Pick<PermissionApi, "list" | "get" | "reply" | "rules"> & {
20
20
  readonly hook: Hooks<PermissionHooks>;
21
21
  };
@@ -7,6 +7,7 @@ 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";
10
11
  import type { JsonSchema, Types } from "effect";
11
12
  import type { ModelHooks } from "./registration.js";
12
13
  export interface SessionPrompt {
@@ -32,6 +33,18 @@ export interface SessionContext extends SessionRequest {
32
33
  input: JsonSchema.JsonSchema;
33
34
  }>;
34
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
+ }
35
48
  export interface SessionTitle extends SessionRequest {
36
49
  /** Set to use this title and skip the model request. */
37
50
  result?: string;
@@ -81,6 +94,8 @@ export interface SessionRetry {
81
94
  export interface SessionHooks {
82
95
  readonly prompt: SessionPrompt;
83
96
  readonly context: SessionContext;
97
+ readonly compaction: SessionCompaction;
98
+ readonly generate: SessionGenerate;
84
99
  readonly title: SessionTitle;
85
100
  readonly "model.request": SessionModelRequest;
86
101
  readonly "http.request": SessionHttpRequest;
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-19425",
4
+ "version": "0.0.0-beta-19507",
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-19425",
47
- "@opencode/client": "0.0.0-beta-19425",
48
- "@opencode/protocol": "0.0.0-beta-19425",
49
- "@opencode/schema": "0.0.0-beta-19425",
50
- "@opencode/util": "0.0.0-beta-19425",
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",
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-19425",
56
+ "@opencode/theme": "0.0.0-beta-19507",
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-19425",
76
+ "@opencode/theme": "0.0.0-beta-19507",
77
77
  "@opentui/core": "0.5.10",
78
78
  "@opentui/solid": "0.5.10",
79
79
  "@tsconfig/bun": "1.0.9",