@opencode/plugin 2.2.1 → 2.2.3
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/effect/session.d.ts +4 -0
- package/dist/gui/host-apis.d.ts +36 -4
- package/dist/gui/registries.d.ts +6 -0
- package/dist/promise/session.d.ts +4 -0
- package/package.json +13 -13
package/dist/effect/session.d.ts
CHANGED
|
@@ -22,6 +22,10 @@ export type SessionRequestOptions = Types.DeepMutable<GenerationOptionsFields> &
|
|
|
22
22
|
export interface SessionRequest {
|
|
23
23
|
readonly sessionID: Session.ID;
|
|
24
24
|
readonly model: Model.Ref;
|
|
25
|
+
/**
|
|
26
|
+
* The instructions part keeps each source's text in `metadata.experimental.instructions` as `{ key, text }`. It is
|
|
27
|
+
* not updated when a hook edits `text`. Experimental.
|
|
28
|
+
*/
|
|
25
29
|
system: Array<SystemPart>;
|
|
26
30
|
messages: Array<Message>;
|
|
27
31
|
options: SessionRequestOptions;
|
package/dist/gui/host-apis.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export interface ServerRef {
|
|
|
22
22
|
readonly client: OpenCodeClient;
|
|
23
23
|
/** The server's synced data (sessions, projects, …). Reactive. */
|
|
24
24
|
readonly data: Data;
|
|
25
|
-
/** The
|
|
25
|
+
/** The app's own local server, or a loopback http connection to its port. */
|
|
26
26
|
readonly local: boolean;
|
|
27
27
|
/** The app's own server, the desktop sidecar. */
|
|
28
28
|
readonly builtin: boolean;
|
|
@@ -436,7 +436,8 @@ export interface ComposerFile {
|
|
|
436
436
|
commentOrigin?: "review" | "file";
|
|
437
437
|
}
|
|
438
438
|
/**
|
|
439
|
-
* A
|
|
439
|
+
* A reference to something other than workspace lines, such as an element picked in a page, with an optional comment.
|
|
440
|
+
* The model reads "The user referenced <subject>." when `comment` is empty, otherwise
|
|
440
441
|
* "The user made the following comment regarding <subject>: <comment>".
|
|
441
442
|
*/
|
|
442
443
|
export interface ComposerNote {
|
|
@@ -448,11 +449,15 @@ export interface ComposerNote {
|
|
|
448
449
|
commentID: string;
|
|
449
450
|
/** Chip text naming the subject, e.g. `button#save`. */
|
|
450
451
|
label: string;
|
|
452
|
+
/** Primary heading while `comment` is empty, e.g. `button#save`. Defaults to `label`; ignored with a comment. */
|
|
453
|
+
title?: string;
|
|
454
|
+
/** Plain-text footer with or without a comment, e.g. `Browser annotation`. Defaults to `label` when omitted. */
|
|
455
|
+
subtitle?: string;
|
|
451
456
|
/** Chip icon. */
|
|
452
457
|
icon: IconName;
|
|
453
458
|
/** What the comment is about, for the model. Quote untrusted text such as page content. */
|
|
454
459
|
subject: string;
|
|
455
|
-
/** The user's comment. */
|
|
460
|
+
/** The user's comment. An empty string attaches the subject without a comment. */
|
|
456
461
|
comment: string;
|
|
457
462
|
/** The link opening the chip routes, with `origin`. */
|
|
458
463
|
href?: string;
|
|
@@ -491,6 +496,32 @@ export interface ComposerQuote {
|
|
|
491
496
|
readonly subject: string;
|
|
492
497
|
};
|
|
493
498
|
}
|
|
499
|
+
/**
|
|
500
|
+
* Positions a quote's optional comment editor beside its source, in viewport pixels. Called after the first editor
|
|
501
|
+
* measurement, on scroll and resize, and when reactive values it reads change. The editor holds its opening bottom
|
|
502
|
+
* edge as its input grows upward. Return undefined when the source is unavailable to use the composer tile instead.
|
|
503
|
+
* Never persisted.
|
|
504
|
+
*
|
|
505
|
+
* @param size - The current editor width and its frozen opening height; never called with an unmeasured zero height.
|
|
506
|
+
* @example
|
|
507
|
+
* const anchor: ComposerQuoteAnchor = (size) => ({ top: 200, left: 400 - size.width / 2 })
|
|
508
|
+
*/
|
|
509
|
+
export type ComposerQuoteAnchor = (size: {
|
|
510
|
+
/** Current editor width in pixels. */
|
|
511
|
+
width: number;
|
|
512
|
+
/** Measured opening height in pixels, unchanged as the input grows. */
|
|
513
|
+
height: number;
|
|
514
|
+
}) => {
|
|
515
|
+
/** Physical distance from the viewport's top edge, in pixels. Clamped to the viewport. */
|
|
516
|
+
top: number;
|
|
517
|
+
/** Physical distance from the viewport's left edge, in pixels. Clamped to the viewport. */
|
|
518
|
+
left: number;
|
|
519
|
+
} | undefined;
|
|
520
|
+
/** Optional placement for a newly attached quote's comment editor. */
|
|
521
|
+
export interface ComposerFocusOptions {
|
|
522
|
+
/** Positions the editor beside its source instead of its tile. Omit for tile placement. */
|
|
523
|
+
anchor?: ComposerQuoteAnchor;
|
|
524
|
+
}
|
|
494
525
|
/** A model the composer sends a prompt with, as the model picker names it. */
|
|
495
526
|
export interface ComposerModel {
|
|
496
527
|
/** The provider's id, e.g. `anthropic`. */
|
|
@@ -580,8 +611,9 @@ export interface Composer {
|
|
|
580
611
|
* its focus and the comment editor opens once the composer shows.
|
|
581
612
|
*
|
|
582
613
|
* @param commentID - The attached quote whose comment editor to open. Omit it to focus the prompt.
|
|
614
|
+
* @param options - Optional placement beside the quote's source. Omit to anchor to its composer tile.
|
|
583
615
|
*/
|
|
584
|
-
focus(commentID?: string): void;
|
|
616
|
+
focus(commentID?: string, options?: ComposerFocusOptions): void;
|
|
585
617
|
/**
|
|
586
618
|
* Changes an attached part. Files, notes and quotes alike; a note or a quote takes only `comment`. Before the
|
|
587
619
|
* session's draft loads, it waits and applies in call order.
|
package/dist/gui/registries.d.ts
CHANGED
|
@@ -654,6 +654,12 @@ export interface SlotMap {
|
|
|
654
654
|
readonly session: MountedSession;
|
|
655
655
|
/** The timeline is the one on screen. */
|
|
656
656
|
readonly active: boolean;
|
|
657
|
+
/**
|
|
658
|
+
* The title does not fit beside the actions, even with the location collapsed. Show the compact form of what you
|
|
659
|
+
* render, without its details (for example an icon that opens them in a menu), so the title keeps the room. The
|
|
660
|
+
* header returns to false once the title fits beside your expanded content again.
|
|
661
|
+
*/
|
|
662
|
+
readonly compact: boolean;
|
|
657
663
|
};
|
|
658
664
|
/** Items in the project/location menu, after its location details. Omitted on loading headers without a screen. */
|
|
659
665
|
readonly "session.location.menu": {
|
|
@@ -22,6 +22,10 @@ export type SessionRequestOptions = Types.DeepMutable<GenerationOptionsFields> &
|
|
|
22
22
|
export interface SessionRequest {
|
|
23
23
|
readonly sessionID: Session.ID;
|
|
24
24
|
readonly model: Model.Ref;
|
|
25
|
+
/**
|
|
26
|
+
* The instructions part keeps each source's text in `metadata.experimental.instructions` as `{ key, text }`. It is
|
|
27
|
+
* not updated when a hook edits `text`. Experimental.
|
|
28
|
+
*/
|
|
25
29
|
system: Array<SystemPart>;
|
|
26
30
|
messages: Array<Message>;
|
|
27
31
|
options: SessionRequestOptions;
|
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": "2.2.
|
|
4
|
+
"version": "2.2.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {
|
|
@@ -78,17 +78,17 @@
|
|
|
78
78
|
],
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"@ai-sdk/provider": "3.0.8",
|
|
81
|
-
"@opencode/ai": "2.2.
|
|
82
|
-
"@opencode/client": "2.2.
|
|
83
|
-
"@opencode/protocol": "2.2.
|
|
84
|
-
"@opencode/schema": "2.2.
|
|
85
|
-
"@opencode/util": "2.2.
|
|
86
|
-
"effect": "4.0.
|
|
81
|
+
"@opencode/ai": "2.2.3",
|
|
82
|
+
"@opencode/client": "2.2.3",
|
|
83
|
+
"@opencode/protocol": "2.2.3",
|
|
84
|
+
"@opencode/schema": "2.2.3",
|
|
85
|
+
"@opencode/util": "2.2.3",
|
|
86
|
+
"effect": "4.0.6"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"@opencode/theme": "2.2.
|
|
90
|
-
"@opentui/core": "0.
|
|
91
|
-
"@opentui/solid": "0.
|
|
89
|
+
"@opencode/theme": "2.2.3",
|
|
90
|
+
"@opentui/core": ">=0.8.0",
|
|
91
|
+
"@opentui/solid": ">=0.8.0",
|
|
92
92
|
"electron": "*",
|
|
93
93
|
"solid-js": ">=1.9.0",
|
|
94
94
|
"vite": ">=6",
|
|
@@ -118,9 +118,9 @@
|
|
|
118
118
|
}
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
121
|
-
"@opencode/theme": "2.2.
|
|
122
|
-
"@opentui/core": "0.
|
|
123
|
-
"@opentui/solid": "0.
|
|
121
|
+
"@opencode/theme": "2.2.3",
|
|
122
|
+
"@opentui/core": "0.8.0",
|
|
123
|
+
"@opentui/solid": "0.8.0",
|
|
124
124
|
"@tsconfig/bun": "1.0.9",
|
|
125
125
|
"@types/bun": "1.4.3",
|
|
126
126
|
"@types/node": "24.12.2",
|