@paneui/core 0.0.12 → 0.0.13

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/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { TemplateRecord, TemplateSummary, TemplateType, TemplateVersion, CreateArtifactResponse, CreatePaneRequest, CreatePaneResponse, EventsPage, FeedbackPage, FeedbackSubmission, FeedbackType, KeyInfo, MintParticipantResponse, PaneEvent, ParticipantsList, SerializedRecord, PaneState, PanesPage, TasteInfo, TrashListResponse } from "./types.js";
1
+ import type { TemplateRecord, TemplateSummary, TemplateType, TemplateVersion, CreateArtifactResponse, CreatePaneRequest, CreatePaneResponse, EventsPage, FeedbackPage, FeedbackSubmission, FeedbackType, KeyInfo, MintParticipantResponse, PaneEvent, ParticipantsList, SerializedRecord, PaneState, PanesPage, TasteInfo, TrashListResponse, UpgradePaneResponse } from "./types.js";
2
2
  import type { ListPanesQuery } from "./schemas.js";
3
3
  export interface ClientOptions {
4
4
  /** Relay base URL, e.g. https://pane.example.com. Trailing slash is trimmed. */
@@ -413,6 +413,28 @@ export declare class PaneClient {
413
413
  mintParticipant(paneId: string, opts?: {
414
414
  kind?: "human";
415
415
  }): Promise<MintParticipantResponse>;
416
+ /**
417
+ * POST /v1/panes/:id/upgrade — re-pin a live pane to another version of the
418
+ * SAME template (#267), swapping its HTML and schemas in place without
419
+ * minting a new pane (the human keeps the same URL). Events already on disk
420
+ * are never rewritten — each carries the template version it was authored
421
+ * under (#268).
422
+ *
423
+ * `opts.template_version` defaults to the template head's latest version.
424
+ * `opts.compat` defaults to `"strict"`: the relay refuses with a 422
425
+ * `schema_incompatible_upgrade` (its `details.breaks` lists the offending
426
+ * paths) when the target schema narrows the current one — i.e. when events
427
+ * written under the old schema would no longer validate. Pass `"force"` to
428
+ * apply the upgrade anyway, accepting that old events may no longer match
429
+ * the new schema.
430
+ *
431
+ * Returns `{ upgraded: false }` (idempotent no-op) when the pane is already
432
+ * on the target version.
433
+ */
434
+ upgradePane(paneId: string, opts?: {
435
+ template_version?: number;
436
+ compat?: "strict" | "force";
437
+ }): Promise<UpgradePaneResponse>;
416
438
  /**
417
439
  * DELETE /v1/panes/:id/participants/:participant_id — revoke a single
418
440
  * participant URL. The pane's other participants (and the agent's own
package/dist/client.js CHANGED
@@ -578,6 +578,35 @@ export class PaneClient {
578
578
  this.fail(r);
579
579
  return this.asObject(r);
580
580
  }
581
+ /**
582
+ * POST /v1/panes/:id/upgrade — re-pin a live pane to another version of the
583
+ * SAME template (#267), swapping its HTML and schemas in place without
584
+ * minting a new pane (the human keeps the same URL). Events already on disk
585
+ * are never rewritten — each carries the template version it was authored
586
+ * under (#268).
587
+ *
588
+ * `opts.template_version` defaults to the template head's latest version.
589
+ * `opts.compat` defaults to `"strict"`: the relay refuses with a 422
590
+ * `schema_incompatible_upgrade` (its `details.breaks` lists the offending
591
+ * paths) when the target schema narrows the current one — i.e. when events
592
+ * written under the old schema would no longer validate. Pass `"force"` to
593
+ * apply the upgrade anyway, accepting that old events may no longer match
594
+ * the new schema.
595
+ *
596
+ * Returns `{ upgraded: false }` (idempotent no-op) when the pane is already
597
+ * on the target version.
598
+ */
599
+ async upgradePane(paneId, opts = {}) {
600
+ const body = {};
601
+ if (opts.template_version !== undefined)
602
+ body["template_version"] = opts.template_version;
603
+ if (opts.compat !== undefined)
604
+ body["compat"] = opts.compat;
605
+ const r = await this.call("POST", `/v1/panes/${encodeURIComponent(paneId)}/upgrade`, body);
606
+ if (!r.ok)
607
+ this.fail(r);
608
+ return this.asObject(r);
609
+ }
581
610
  /**
582
611
  * DELETE /v1/panes/:id/participants/:participant_id — revoke a single
583
612
  * participant URL. The pane's other participants (and the agent's own
package/dist/index.d.ts CHANGED
@@ -9,4 +9,4 @@ export type { CreatePaneInput, ListPanesStatus, ListPanesQuery, MintParticipantI
9
9
  export { validateIconEmoji, isValidIconEmoji, isRasterImageMime, RASTER_ICON_MIME_ALLOWLIST, MAX_ICON_EMOJI_BYTES, } from "./icons.js";
10
10
  export type { RasterIconMime } from "./icons.js";
11
11
  export { MAX_EVENT_TYPE_LENGTH, MAX_IDEMPOTENCY_KEY_LENGTH, MAX_RESPONSE_SNIPPET_LENGTH, MAX_FRAME_SNIPPET_LENGTH, } from "./limits.js";
12
- export type { AuthorKind, PaneEvent, SerializedRecord, DeletedRecordRef, RecordDeltaMessage, Template, TemplateType, TemplateVersion, TemplateRecord, TemplateSummary, CreateArtifactResponse, KeyInfo, TasteInfo, FeedbackType, FeedbackSubmission, FeedbackRecord, FeedbackPage, Callback, CreatePaneRequest, CreatePaneResponse, PaneState, EventsPage, ParticipantSummary, ParticipantsList, PaneSummary, PanesPage, MintParticipantResponse, TrashedPaneEntry, TrashedTemplateEntry, TrashListResponse, RelayError, } from "./types.js";
12
+ export type { AuthorKind, PaneEvent, SerializedRecord, DeletedRecordRef, RecordDeltaMessage, Template, TemplateType, TemplateVersion, TemplateRecord, TemplateSummary, CreateArtifactResponse, KeyInfo, TasteInfo, FeedbackType, FeedbackSubmission, FeedbackRecord, FeedbackPage, Callback, CreatePaneRequest, CreatePaneResponse, PaneState, EventsPage, ParticipantSummary, ParticipantsList, PaneSummary, PanesPage, MintParticipantResponse, UpgradeBreak, UpgradePaneResponse, TrashedPaneEntry, TrashedTemplateEntry, TrashListResponse, RelayError, } from "./types.js";
package/dist/types.d.ts CHANGED
@@ -209,6 +209,31 @@ export interface MintParticipantResponse {
209
209
  url: string;
210
210
  created_at: string;
211
211
  }
212
+ /** One break flagged by the schema-compat gate when upgrading a pane to a
213
+ * template version whose schema narrows the current one. */
214
+ export interface UpgradeBreak {
215
+ /** JSON-pointer-ish path to the offending schema location. */
216
+ path: string;
217
+ /** Human-readable description of why the change is incompatible. */
218
+ message: string;
219
+ }
220
+ /** Response from POST /v1/panes/:id/upgrade — the result of re-pinning a live
221
+ * pane to another version of the same template (#267). */
222
+ export interface UpgradePaneResponse {
223
+ pane_id: string;
224
+ /** The version id the pane now points at. */
225
+ template_version_id: string;
226
+ /** Denormalised integer version number the pane now points at. */
227
+ template_version: number;
228
+ /** `false` when the pane was already on the target version (idempotent
229
+ * no-op); `true` when the re-pin was applied. */
230
+ upgraded: boolean;
231
+ /** Schema-compat breaks detected against the target version. Empty on a
232
+ * clean upgrade; populated (and applied anyway) on `compat: "force"`. */
233
+ breaks: UpgradeBreak[];
234
+ /** The compat mode the upgrade ran under. */
235
+ compat: "strict" | "force";
236
+ }
212
237
  /** One immutable version of an template's content. */
213
238
  export interface TemplateVersion {
214
239
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paneui/core",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "Pane relay client: typed HTTP + WebSocket operations against a Pane relay. Framework-free.",
5
5
  "license": "MIT",
6
6
  "type": "module",