@theway-ai/sdk 2.1.0 → 2.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theway-ai/sdk",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "TypeScript SDK for the theway gRPC daemon (five theway.grpc.v1 domain services + grpc.health.v1). Typed client for all RPCs, generated from the domain proto files via ts-proto.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -180,6 +180,43 @@ message GraphListResponse {
180
180
  repeated DagRunSnapshot runs = 1;
181
181
  }
182
182
 
183
+ // Node type in a session graph.
184
+ enum SessionGraphNodeType {
185
+ SESSION_GRAPH_NODE_TYPE_UNSPECIFIED = 0;
186
+ SESSION_GRAPH_NODE_TYPE_SESSION = 1;
187
+ SESSION_GRAPH_NODE_TYPE_COLLAPSED = 2;
188
+ }
189
+
190
+ // A node in the session graph. Session nodes represent live sessions;
191
+ // collapsed nodes represent archived sessions folded into another session.
192
+ message SessionGraphNode {
193
+ string id = 1;
194
+ string session_id = 2;
195
+ SessionGraphNodeType type = 3;
196
+ string title = 4;
197
+ string summary = 5;
198
+ optional string parent_node_id = 6;
199
+ repeated string child_node_ids = 7;
200
+ optional string collapsed_session_id = 8;
201
+ optional string collapsed_at = 9; // RFC3339 / ISO-8601 with offset (UTC).
202
+ optional string created_at = 10;
203
+ optional string updated_at = 11;
204
+ uint32 message_count = 12;
205
+ }
206
+
207
+ // Detailed record for a session that has been collapsed into another session.
208
+ message CollapsedSessionNode {
209
+ string node_id = 1;
210
+ string session_id = 2;
211
+ string title = 3;
212
+ string summary = 4;
213
+ uint32 message_count = 5;
214
+ optional string collapsed_at = 6; // RFC3339 / ISO-8601 with offset (UTC).
215
+ optional string collapsed_into_session_id = 7;
216
+ optional string collapsed_into_node_id = 8;
217
+ repeated string original_session_ids = 9;
218
+ }
219
+
183
220
  service GraphEngineService {
184
221
  // Fetch a DAG node's full output from an offset (P3).
185
222
  rpc GetNodeOutput(GetNodeOutputRequest) returns (GetNodeOutputResponse);
@@ -227,6 +227,10 @@ message PlainBlock {
227
227
  }
228
228
 
229
229
  message SessionSummary {
230
+ // Canonical session id. New clients should use this field; `session_id`
231
+ // remains as a deprecated alias for compatibility with older consumers.
232
+ string id = 13;
233
+ // Compatibility alias; new clients should read `id`.
230
234
  string session_id = 1;
231
235
  string name = 2;
232
236
  string cwd = 3;
@@ -241,6 +245,140 @@ message SessionSummary {
241
245
  optional string last_activity_at_rfc3339 = 12; // RFC3339 / ISO-8601 with offset (UTC), null when absent.
242
246
  }
243
247
 
248
+ // Thinking levels supported by the runtime.
249
+ enum ThinkingLevel {
250
+ THINKING_LEVEL_UNSPECIFIED = 0;
251
+ THINKING_LEVEL_OFF = 1;
252
+ THINKING_LEVEL_MINIMAL = 2;
253
+ THINKING_LEVEL_LOW = 3;
254
+ THINKING_LEVEL_MEDIUM = 4;
255
+ THINKING_LEVEL_HIGH = 5;
256
+ THINKING_LEVEL_XHIGH = 6;
257
+ }
258
+
259
+ // A resolved model reference in a session runtime.
260
+ message ModelRef {
261
+ string provider = 1;
262
+ string model = 2;
263
+ optional string base_url = 3;
264
+ }
265
+
266
+ // Static/dynamic session identity and display metadata.
267
+ message SessionInfo {
268
+ string id = 1;
269
+ string name = 2;
270
+ string cwd = 3;
271
+ string created_at = 4; // RFC3339 / ISO-8601 with offset (UTC).
272
+ int64 last_activity_at = 5; // Deprecated epoch milliseconds.
273
+ optional string last_activity_at_rfc3339 = 6; // RFC3339 / ISO-8601 with offset (UTC), null when absent.
274
+ bool busy = 7;
275
+ optional string preview = 8;
276
+ map<string, string> metadata = 9;
277
+ uint32 graph_count = 10;
278
+ uint32 active_graph_count = 11;
279
+ uint32 queued_count = 12;
280
+ SidebarSnapshot sidebar = 13;
281
+ }
282
+
283
+ // Live runtime configuration and model/context metadata.
284
+ message SessionRuntime {
285
+ ModelRef model = 1;
286
+ ThinkingLevel thinking_level = 2;
287
+ repeated ThinkingLevel supported_thinking_levels = 3;
288
+ optional ContextUsage context_usage = 4;
289
+ optional ContextUsage session_context_usage = 5;
290
+ optional uint32 tui_max_feed_lines = 6;
291
+ repeated ProviderGroup model_catalog = 7;
292
+ optional TriggerPollStatus latest_trigger_poll = 8;
293
+ optional GoalSnapshot goal = 9;
294
+ optional ControlPlanePromptSnapshot control_plane_prompt = 10;
295
+ ExtensionSnapshot extensions = 11;
296
+ }
297
+
298
+ // Transcript plane of a session snapshot.
299
+ message SessionFeed {
300
+ repeated FeedBlock blocks = 1;
301
+ repeated string lines = 2;
302
+ uint64 blocks_base = 3;
303
+ uint64 lines_base = 4;
304
+ repeated FeedBlockPatch block_patches = 5;
305
+ }
306
+
307
+ // Graph-mode state mounted under a session snapshot.
308
+ message SessionGraphState {
309
+ repeated DagRunSnapshot dags = 1;
310
+ repeated SubagentJobSnapshot subagents = 2;
311
+ repeated SessionGraphNode nodes = 3;
312
+ optional string active_node_id = 4;
313
+ }
314
+
315
+ // Session lineage for fork/collapse ancestry.
316
+ message SessionLineage {
317
+ optional string parent_session_id = 1;
318
+ optional string root_session_id = 2;
319
+ repeated string ancestor_session_ids = 3;
320
+ repeated string child_session_ids = 4;
321
+ optional string collapsed_from_session_id = 5;
322
+ optional string collapsed_into_session_id = 6;
323
+ }
324
+
325
+ // Full structured session snapshot: the nested successor of SessionState.
326
+ message SessionSnapshot {
327
+ string session_id = 1;
328
+ SessionInfo info = 2;
329
+ SessionRuntime runtime = 3;
330
+ SessionFeed feed = 4;
331
+ SessionGraphState graph_state = 5;
332
+ SessionLineage lineage = 6;
333
+ }
334
+
335
+ // Collapse a session into a graph node, optionally under another session.
336
+ message CollapseSessionRequest {
337
+ string session_id = 1;
338
+ optional string into_session_id = 2;
339
+ optional string title = 3;
340
+ optional string summary = 4;
341
+ }
342
+
343
+ message CollapseSessionResponse {
344
+ string session_id = 1;
345
+ SessionGraphNode node = 2;
346
+ CollapsedSessionNode collapsed = 3;
347
+ }
348
+
349
+ message GetSessionGraphNodeRequest {
350
+ string session_id = 1;
351
+ string node_id = 2;
352
+ }
353
+
354
+ message GetSessionGraphNodeResponse {
355
+ SessionGraphNode node = 1;
356
+ }
357
+
358
+ message ListSessionGraphNodeMessagesRequest {
359
+ string session_id = 1;
360
+ string node_id = 2;
361
+ uint32 offset = 3;
362
+ uint32 limit = 4;
363
+ }
364
+
365
+ message ListSessionGraphNodeMessagesResponse {
366
+ repeated FeedBlock blocks = 1;
367
+ }
368
+
369
+ message StreamSessionGraphNodeRequest {
370
+ string session_id = 1;
371
+ string node_id = 2;
372
+ }
373
+
374
+ // Streaming frame for node changes and message appends.
375
+ message SessionGraphNodeStreamFrame {
376
+ oneof payload {
377
+ SessionGraphNode node = 1;
378
+ FeedBlock block = 2;
379
+ }
380
+ }
381
+
244
382
  message SessionStateRequest {
245
383
  string session_id = 1;
246
384
  }
@@ -327,8 +465,18 @@ message ClearCredentialRequest {
327
465
  }
328
466
 
329
467
  service SessionService {
330
- // Full structured state (binary protobuf).
468
+ // Full structured state (binary protobuf). Kept for compatibility; new
469
+ // clients should use GetSnapshot / GetHistory.
331
470
  rpc GetState(SessionStateRequest) returns (SessionState);
471
+ // Full nested session snapshot (session-snapshot-collapse contract).
472
+ rpc GetSnapshot(SessionStateRequest) returns (SessionSnapshot);
473
+ // Session history as a snapshot-shaped transcript (session-snapshot-collapse).
474
+ rpc GetHistory(SessionStateRequest) returns (SessionSnapshot);
475
+ // Collapse a session into a graph node (session-snapshot-collapse).
476
+ rpc CollapseSession(CollapseSessionRequest) returns (CollapseSessionResponse);
477
+ rpc GetSessionGraphNode(GetSessionGraphNodeRequest) returns (GetSessionGraphNodeResponse);
478
+ rpc ListSessionGraphNodeMessages(ListSessionGraphNodeMessagesRequest) returns (ListSessionGraphNodeMessagesResponse);
479
+ rpc StreamSessionGraphNode(StreamSessionGraphNodeRequest) returns (stream SessionGraphNodeStreamFrame);
332
480
  // Session resources: list (with current marker) / create / rename /
333
481
  // delete. DeleteSession reports the offending run ids when refused because
334
482
  // the session still has running graphs.