@standardagents/code-plugin-sdk 1.0.0-alpha.10-rows.0 → 1.0.0-alpha.11-headers.0

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/README.md CHANGED
@@ -264,3 +264,14 @@ Layouts allow 1–32 fields, 2,048 UTF-8 bytes per text field and 8,192 total te
264
264
  bytes. Controls and bidi formatting characters are rejected. Layouts are
265
265
  supported only in pane header/footer slots. Ordinary rows and full/half slot
266
266
  stacking retain their existing behavior.
267
+
268
+ Set a card declaration’s `title` to `""` to omit its heading and icon. With
269
+ `border: false`, that also removes the heading row. An omitted title uses the
270
+ plugin name.
271
+
272
+ Canvas cards can set `CanvasSpec.titleRight` to a passive, right-aligned header label.
273
+ It accepts a nonempty single-line string of up to 512 UTF-8 bytes; controls and
274
+ bidirectional formatting characters are rejected. The host reserves the main
275
+ title and icon, truncates the right label to fit, and preserves the pane-open
276
+ indicator. Other canvas surface kinds reject this option. Update it through
277
+ `canvas.replace({ kind: "canvas", canvas: { ...spec, titleRight: "sidebar-plugins" } })`.
package/REFERENCE.md CHANGED
@@ -534,3 +534,10 @@ colors fall back to the named ANSI index or default foreground; unavailable
534
534
  background colors leave opacity unapplied. OSC queries remain unsupported
535
535
  in plugin canvas streams. This capability is public and identical for all
536
536
  plugins.
537
+
538
+ Canvas cards can set `CanvasSpec.titleRight` to a passive, right-aligned header label.
539
+ It accepts a nonempty single-line string of up to 512 UTF-8 bytes; controls and
540
+ bidirectional formatting characters are rejected. The host reserves the main
541
+ title and icon, truncates the right label to fit, and preserves the pane-open
542
+ indicator. Other canvas surface kinds reject this option. Update it through
543
+ `canvas.replace({ kind: "canvas", canvas: { ...spec, titleRight: "sidebar-plugins" } })`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@standardagents/code-plugin-sdk",
3
- "version": "1.0.0-alpha.10-rows.0",
3
+ "version": "1.0.0-alpha.11-headers.0",
4
4
  "type": "module",
5
5
  "description": "Standard Code plugin authoring SDK",
6
6
  "license": "MIT",
package/src/index.d.ts CHANGED
@@ -113,6 +113,8 @@ export interface CanvasThemeColor {
113
113
  opacity: number;
114
114
  }
115
115
  export interface CanvasSpec {
116
+ /** Card-only passive header text, right aligned and clipped to leave room for the title. Maximum 512 UTF-8 bytes. */
117
+ titleRight?: string;
116
118
  /** Up to 32 canvas-local indexed color recipes. Keys are ANSI indexes 0..255. */
117
119
  themeColors?: Record<number, CanvasThemeColor>;
118
120
  columns: number;
package/src/runtime.mjs CHANGED
@@ -107,7 +107,7 @@ function validateContent(content, declaration, manifest) {
107
107
  }
108
108
  jsonBytes(content)
109
109
  if (content.kind === 'canvas') {
110
- const { columns, rows, shade = 0, hover, themeColors } = content.canvas ?? {}
110
+ const { columns, rows, shade = 0, hover, themeColors, titleRight } = content.canvas ?? {}
111
111
  ensure(Number.isSafeInteger(columns) && columns > 0 && columns <= LIMITS.canvasColumns &&
112
112
  Number.isSafeInteger(rows) && rows > 0 && rows <= LIMITS.canvasRows &&
113
113
  Number.isFinite(shade) && shade >= 0 && shade <= 1, 'invalid_payload', 'Invalid canvas dimensions or shade')
@@ -121,6 +121,10 @@ function validateContent(content, declaration, manifest) {
121
121
  'invalid_payload', 'Invalid canvas theme color recipe')
122
122
  }
123
123
  }
124
+ if (titleRight !== undefined) {
125
+ ensure(declaration.kind === 'card' && typeof titleRight === 'string', 'invalid_payload', 'Canvas titleRight requires a card and string')
126
+ validatePassiveText(titleRight, 512, 'card header')
127
+ }
124
128
  if (hover !== undefined) validatePassiveText(hover)
125
129
  }
126
130
  }