@opencode/plugin 0.0.0-dev-1180 → 0.0.0-dev-1216

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.
@@ -44,6 +44,11 @@ export type IntegrationOAuthAuthorization = {
44
44
  } & ({
45
45
  readonly mode: "auto";
46
46
  readonly callback: Effect.Effect<Credential.OAuth, unknown>;
47
+ /**
48
+ * Accepts the redirect URL a user pasted when the browser could not reach this machine, and settles `callback`
49
+ * with it. Check the URL's `state` as the browser path does; a failure rejects only this paste.
50
+ */
51
+ readonly submit?: (redirect: string) => Effect.Effect<void, unknown>;
47
52
  } | {
48
53
  readonly mode: "code";
49
54
  readonly callback: (code: string) => Effect.Effect<Credential.OAuth, unknown>;
@@ -641,7 +641,7 @@ export interface Composer {
641
641
  */
642
642
  focused(): boolean;
643
643
  }
644
- /** Work the session moved to the background. */
644
+ /** A running subagent or background shell command of the session. */
645
645
  export interface BackgroundTask {
646
646
  /** The task's id. */
647
647
  id: string;
@@ -690,7 +690,7 @@ export interface MountedSession extends SessionRef {
690
690
  readonly directory: string;
691
691
  /** The session runs in the project root rather than a worktree. Reactive. */
692
692
  readonly local: boolean;
693
- /** Shell commands and subagents the session moved to the background; empty once another session is routed. */
693
+ /** Running subagents and background shell commands of the session; empty once another session is routed. */
694
694
  readonly background: readonly BackgroundTask[];
695
695
  }
696
696
  /**
@@ -304,15 +304,22 @@ export function fromPromise(plugin) {
304
304
  const refresh = input.refresh;
305
305
  editor.method.update({
306
306
  ...input,
307
- authorize: (answer) => Effect.promise(() => input.authorize(answer)).pipe(Effect.map((authorization) => authorization.mode === "auto"
308
- ? {
307
+ authorize: (answer) => Effect.promise(() => input.authorize(answer)).pipe(Effect.map((authorization) => {
308
+ if (authorization.mode === "code")
309
+ return {
310
+ ...authorization,
311
+ callback: (code) => Effect.promise(() => authorization.callback(code)),
312
+ };
313
+ const submit = authorization.submit;
314
+ return {
309
315
  ...authorization,
310
316
  callback: Effect.promise(() => authorization.callback),
311
- }
312
- : {
313
- ...authorization,
314
- callback: (code) => Effect.promise(() => authorization.callback(code)),
315
- })),
317
+ // A rejected paste keeps its own error, which the dialog shows as is.
318
+ submit: submit
319
+ ? (redirect) => Effect.tryPromise({ try: () => submit(redirect), catch: (error) => error })
320
+ : undefined,
321
+ };
322
+ })),
316
323
  refresh: refresh === undefined
317
324
  ? undefined
318
325
  : (credential) => Effect.promise(() => refresh(credential)),
@@ -43,6 +43,11 @@ export type IntegrationOAuthAuthorization = {
43
43
  } & ({
44
44
  readonly mode: "auto";
45
45
  readonly callback: Promise<Credential.OAuth>;
46
+ /**
47
+ * Accepts the redirect URL a user pasted when the browser could not reach this machine, and settles `callback`
48
+ * with it. Check the URL's `state` as the browser path does; a rejection rejects only this paste.
49
+ */
50
+ readonly submit?: (redirect: string) => Promise<void>;
46
51
  } | {
47
52
  readonly mode: "code";
48
53
  readonly callback: (code: string) => Promise<Credential.OAuth>;
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-dev-1180",
4
+ "version": "0.0.0-dev-1216",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -78,15 +78,15 @@
78
78
  ],
79
79
  "dependencies": {
80
80
  "@ai-sdk/provider": "3.0.8",
81
- "@opencode/ai": "0.0.0-dev-1180",
82
- "@opencode/client": "0.0.0-dev-1180",
83
- "@opencode/protocol": "0.0.0-dev-1180",
84
- "@opencode/schema": "0.0.0-dev-1180",
85
- "@opencode/util": "0.0.0-dev-1180",
81
+ "@opencode/ai": "0.0.0-dev-1216",
82
+ "@opencode/client": "0.0.0-dev-1216",
83
+ "@opencode/protocol": "0.0.0-dev-1216",
84
+ "@opencode/schema": "0.0.0-dev-1216",
85
+ "@opencode/util": "0.0.0-dev-1216",
86
86
  "effect": "4.1.0"
87
87
  },
88
88
  "peerDependencies": {
89
- "@opencode/theme": "0.0.0-dev-1180",
89
+ "@opencode/theme": "0.0.0-dev-1216",
90
90
  "@opentui/core": ">=0.8.4",
91
91
  "@opentui/solid": ">=0.8.4",
92
92
  "electron": "*",
@@ -118,7 +118,7 @@
118
118
  }
119
119
  },
120
120
  "devDependencies": {
121
- "@opencode/theme": "0.0.0-dev-1180",
121
+ "@opencode/theme": "0.0.0-dev-1216",
122
122
  "@opentui/core": "0.8.4",
123
123
  "@opentui/solid": "0.8.4",
124
124
  "@tsconfig/bun": "1.0.9",