@paneui/core 0.0.5 → 0.0.7

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/types.d.ts CHANGED
@@ -4,7 +4,7 @@ export type AuthorKind = "human" | "agent" | "system";
4
4
  /** A single event envelope as emitted by the relay. */
5
5
  export interface PaneEvent {
6
6
  id: string;
7
- session_id: string;
7
+ surface_id: string;
8
8
  author: {
9
9
  kind: AuthorKind;
10
10
  id: string;
@@ -15,14 +15,14 @@ export interface PaneEvent {
15
15
  causation_id: string | null;
16
16
  idempotency_key: string | null;
17
17
  }
18
- /** The artifact content type. `html-ref` is rejected by the relay for now. */
19
- export type ArtifactType = "html-inline" | "html-ref";
18
+ /** The template content type. `html-ref` is rejected by the relay for now. */
19
+ export type TemplateType = "html-inline" | "html-ref";
20
20
  /**
21
- * An artifact: discriminated on `type`. `html-inline` carries raw HTML in
21
+ * An template: discriminated on `type`. `html-inline` carries raw HTML in
22
22
  * `source`; `html-ref` carries a URL the relay/shell fetches on the human's
23
23
  * behalf. The discriminant keeps the type↔source coupling explicit.
24
24
  */
25
- export type Artifact = {
25
+ export type Template = {
26
26
  type: "html-inline";
27
27
  source: string;
28
28
  } | {
@@ -36,13 +36,13 @@ export interface Callback {
36
36
  secret: string;
37
37
  }
38
38
  /**
39
- * Request body for POST /v1/sessions. Derived from `createSessionSchema` so the
39
+ * Request body for POST /v1/surfaces. Derived from `createSessionSchema` so the
40
40
  * runtime validator and the static type cannot drift.
41
41
  */
42
42
  export type CreateSessionRequest = z.infer<typeof createSessionSchema>;
43
- /** Response from POST /v1/sessions. */
43
+ /** Response from POST /v1/surfaces. */
44
44
  export interface CreateSessionResponse {
45
- session_id: string;
45
+ surface_id: string;
46
46
  tokens: {
47
47
  humans: string[];
48
48
  agent: string;
@@ -52,36 +52,101 @@ export interface CreateSessionResponse {
52
52
  agent_stream: string;
53
53
  };
54
54
  expires_at: string;
55
+ /** The resolved tab title persisted on the surface (the agent's value, or
56
+ * the Template.name fallback). */
57
+ title: string;
55
58
  }
56
- /** Response from GET /v1/sessions/:id. */
57
- export interface SessionState {
58
- session_id: string;
59
+ /** Response from GET /v1/surfaces/:id. */
60
+ export interface SurfaceState {
61
+ surface_id: string;
59
62
  status: string;
60
- /** The artifact version this session is pinned to. */
61
- artifact_id: string;
62
- artifact_version_id: string;
63
- artifact_version: number;
63
+ /** The template version this surface is pinned to. */
64
+ template_id: string;
65
+ template_version_id: string;
66
+ template_version: number;
67
+ /** The tab title this surface was created with (frozen for its lifetime). */
68
+ title: string;
64
69
  metadata: Record<string, unknown> | null;
65
70
  input_data: Record<string, unknown> | null;
66
71
  created_at: string;
67
72
  expires_at: string;
68
73
  }
69
- /** Response from GET /v1/sessions/:id/events. */
74
+ /** Response from GET /v1/surfaces/:id/events. */
70
75
  export interface EventsPage {
71
76
  events: PaneEvent[];
72
77
  next_cursor: string | null;
73
78
  }
74
- /** One immutable version of an artifact's content. */
75
- export interface ArtifactVersion {
79
+ /** A non-secret summary of one participant on a surface — safe to list. */
80
+ export interface ParticipantSummary {
81
+ /** The revoke handle (Participant.id). */
82
+ participant_id: string;
83
+ /** "agent" or "human". The agent's own participant is always present. */
84
+ kind: "agent" | "human";
85
+ /** Short, non-secret correlator for a saved URL ("tok_h_..." / "tok_a_..."). */
86
+ token_prefix: string;
87
+ /** ISO timestamp of first WebSocket connect, or null if never joined. */
88
+ joined_at: string | null;
89
+ /** ISO timestamp the participant was revoked; null while still active. */
90
+ revoked_at: string | null;
91
+ }
92
+ /** A row in the GET /v1/surfaces list response (no secrets, lean). */
93
+ export interface SurfaceSummary {
94
+ surface_id: string;
95
+ /** Tab title (required column; agent input or Template.name fallback). */
96
+ title: string;
97
+ /** Effective status — respects expiresAt projection (the column may say
98
+ * "open" while `expires_at` is in the past; the projection reports "closed"). */
99
+ status: "open" | "closed";
100
+ /** Owning template's head id. Null for inline (anonymous) templates. */
101
+ template_id: string | null;
102
+ template_version_id: string;
103
+ template_version: number;
104
+ /** Count of active (non-revoked) human participants. The full participant
105
+ * array is intentionally NOT inlined here — agents with many surfaces
106
+ * would pay the bandwidth on every list call. Fetch
107
+ * `GET /v1/surfaces/:id/participants` when you need the rows. */
108
+ active_human_participants: number;
109
+ created_at: string;
110
+ expires_at: string;
111
+ /** Whether the surface has a webhook callback configured (URL is NOT
112
+ * returned — it may carry a secret in the path). */
113
+ has_callback: boolean;
114
+ }
115
+ /** Response from GET /v1/surfaces/:id/participants — every participant on
116
+ * one surface (active and revoked). Bounded by MAX_PARTICIPANTS_PER_SESSION
117
+ * on the relay so no pagination is needed. */
118
+ export interface ParticipantsList {
119
+ surface_id: string;
120
+ items: ParticipantSummary[];
121
+ }
122
+ /** Response from GET /v1/surfaces. */
123
+ export interface SurfacesPage {
124
+ items: SurfaceSummary[];
125
+ /** Opaque cursor for the next page; null when no more rows. */
126
+ next_cursor: string | null;
127
+ }
128
+ /** Response from POST /v1/surfaces/:id/participants — one-shot, includes the
129
+ * plaintext token exactly once. The relay stores only the hash. */
130
+ export interface MintParticipantResponse {
131
+ participant_id: string;
132
+ kind: "human";
133
+ /** The plaintext participant token. Returned ONCE — not recoverable. */
134
+ token: string;
135
+ /** The shareable human URL containing the token. */
136
+ url: string;
137
+ created_at: string;
138
+ }
139
+ /** One immutable version of an template's content. */
140
+ export interface TemplateVersion {
76
141
  id: string;
77
142
  version: number;
78
- type: ArtifactType;
143
+ type: TemplateType;
79
144
  source: string;
80
145
  event_schema: unknown;
81
146
  input_schema: Record<string, unknown> | null;
82
147
  created_at: string;
83
148
  }
84
- /** A full artifact — head metadata plus its version list. */
149
+ /** A full template — head metadata plus its version list. */
85
150
  export interface Artifact_ {
86
151
  id: string;
87
152
  slug: string | null;
@@ -92,18 +157,18 @@ export interface Artifact_ {
92
157
  last_used_at: string | null;
93
158
  created_at: string;
94
159
  updated_at: string;
95
- versions: ArtifactVersion[];
160
+ versions: TemplateVersion[];
96
161
  }
97
162
  /**
98
- * A full artifact — head metadata plus its version list. (`ArtifactRecord` is
99
- * the public name; `Artifact` is kept as the older inline-artifact union.)
163
+ * A full template — head metadata plus its version list. (`TemplateRecord` is
164
+ * the public name; `Template` is kept as the older inline-template union.)
100
165
  */
101
- export type ArtifactRecord = Artifact_;
166
+ export type TemplateRecord = Artifact_;
102
167
  /**
103
- * A lean artifact summary for list/search responses — head metadata only, no
104
- * `source` blob. See GET /v1/artifacts.
168
+ * A lean template summary for list/search responses — head metadata only, no
169
+ * `source` attachment. See GET /v1/templates.
105
170
  */
106
- export interface ArtifactSummary {
171
+ export interface TemplateSummary {
107
172
  id: string;
108
173
  slug: string | null;
109
174
  name: string | null;
@@ -112,9 +177,9 @@ export interface ArtifactSummary {
112
177
  latest_version: number;
113
178
  last_used_at: string | null;
114
179
  }
115
- /** Response from POST /v1/artifacts and POST /v1/artifacts/:id/versions. */
180
+ /** Response from POST /v1/templates and POST /v1/templates/:id/versions. */
116
181
  export interface CreateArtifactResponse {
117
- artifact_id: string;
182
+ template_id: string;
118
183
  version: number;
119
184
  }
120
185
  /**
@@ -132,7 +197,7 @@ export interface KeyInfo {
132
197
  }
133
198
  /**
134
199
  * Response from GET /v1/taste, PUT /v1/taste — the calling agent's freeform
135
- * "taste notes" markdown blob (presentation preferences the agent has picked
200
+ * "taste notes" markdown attachment (presentation preferences the agent has picked
136
201
  * up from human feedback over time). `taste` and `updated_at` are null when
137
202
  * the agent has never written notes; `bytes` is the utf8 byte length and 0
138
203
  * when `taste` is null.
@@ -155,7 +220,7 @@ export interface FeedbackRecord {
155
220
  id: string;
156
221
  type: FeedbackType;
157
222
  message: string;
158
- session_id: string | null;
223
+ surface_id: string | null;
159
224
  created_at: string;
160
225
  }
161
226
  /** Response from GET /v1/feedback — page of the calling agent's own submissions. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paneui/core",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "Pane relay client: typed HTTP + WebSocket operations against a Pane relay. Framework-free.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -47,12 +47,12 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "ws": "^8.20.1",
50
- "zod": "^3.23.0"
50
+ "zod": "^4.4.3"
51
51
  },
52
52
  "devDependencies": {
53
- "@types/node": "^22.7.0",
53
+ "@types/node": "^25.9.1",
54
54
  "@types/ws": "^8.18.1",
55
- "typescript": "^5.6.0",
55
+ "typescript": "^6.0.3",
56
56
  "vitest": "^4.1.6"
57
57
  }
58
58
  }