@opencode/plugin 0.0.0-dev-228 → 0.0.0-dev-233

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.
@@ -436,7 +436,8 @@ export interface ComposerFile {
436
436
  commentOrigin?: "review" | "file";
437
437
  }
438
438
  /**
439
- * A comment on something other than workspace lines, such as an element picked in a page. The model reads
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/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-228",
4
+ "version": "0.0.0-dev-233",
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-228",
82
- "@opencode/client": "0.0.0-dev-228",
83
- "@opencode/protocol": "0.0.0-dev-228",
84
- "@opencode/schema": "0.0.0-dev-228",
85
- "@opencode/util": "0.0.0-dev-228",
81
+ "@opencode/ai": "0.0.0-dev-233",
82
+ "@opencode/client": "0.0.0-dev-233",
83
+ "@opencode/protocol": "0.0.0-dev-233",
84
+ "@opencode/schema": "0.0.0-dev-233",
85
+ "@opencode/util": "0.0.0-dev-233",
86
86
  "effect": "4.0.1"
87
87
  },
88
88
  "peerDependencies": {
89
- "@opencode/theme": "0.0.0-dev-228",
89
+ "@opencode/theme": "0.0.0-dev-233",
90
90
  "@opentui/core": "0.7.0",
91
91
  "@opentui/solid": "0.7.0",
92
92
  "electron": "*",
@@ -118,7 +118,7 @@
118
118
  }
119
119
  },
120
120
  "devDependencies": {
121
- "@opencode/theme": "0.0.0-dev-228",
121
+ "@opencode/theme": "0.0.0-dev-233",
122
122
  "@opentui/core": "0.7.0",
123
123
  "@opentui/solid": "0.7.0",
124
124
  "@tsconfig/bun": "1.0.9",