@theway-ai/sdk 1.3.0 → 2.1.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.
@@ -77,6 +77,7 @@ message GetNodeOutputRequest {
77
77
  string run_id = 1;
78
78
  string node_id = 2;
79
79
  uint64 offset = 3;
80
+ string session_id = 4;
80
81
  }
81
82
 
82
83
  message GetNodeOutputResponse {
@@ -99,11 +100,13 @@ enum GraphKind {
99
100
 
100
101
  message GraphCancelRequest {
101
102
  string run_id = 1;
103
+ string session_id = 2;
102
104
  }
103
105
 
104
106
  message GraphRetryRequest {
105
107
  string run_id = 1;
106
108
  optional string node_id = 2; // omitted = all failed/cancelled nodes
109
+ string session_id = 3;
107
110
  }
108
111
 
109
112
  message GraphRetryResponse {
@@ -113,18 +116,21 @@ message GraphRetryResponse {
113
116
  message GraphSkipRequest {
114
117
  string run_id = 1;
115
118
  string node_id = 2;
119
+ string session_id = 3;
116
120
  }
117
121
 
118
122
  // Turn-level control for a running DAG node's subagent.
119
123
  message GraphNodeInterruptRequest {
120
124
  string run_id = 1;
121
125
  string node_id = 2;
126
+ string session_id = 3;
122
127
  }
123
128
 
124
129
  message GraphNodeSteerRequest {
125
130
  string run_id = 1;
126
131
  string node_id = 2;
127
132
  string text = 3;
133
+ string session_id = 4;
128
134
  }
129
135
 
130
136
  message GraphSkipResponse {
@@ -1,6 +1,6 @@
1
1
  // Session domain: the full session state plane (snapshot, sidebar, feed,
2
2
  // model catalog, status), session resource messages
3
- // (list/create/switch/rename/delete), and the SessionService RPC surface.
3
+ // (list/create/rename/delete), and the SessionService RPC surface.
4
4
 
5
5
  syntax = "proto3";
6
6
  package theway.grpc.v1;
@@ -45,6 +45,9 @@ message SessionState {
45
45
  // Session-cumulative token usage: total input, cached input, non-cached
46
46
  // input, output, and cache write totals for the current session.
47
47
  ContextUsage session_context_usage = 21;
48
+ // Active thinking level ("off" | "minimal" | "low" | "medium" | "high" |
49
+ // "xhigh"); empty for older daemons.
50
+ string thinking_level = 22;
48
51
  }
49
52
 
50
53
  message FeedBlockPatch {
@@ -192,35 +195,35 @@ message FeedBlock {
192
195
 
193
196
  message UserBlock {
194
197
  string text = 1;
195
- optional string timestamp = 2;
198
+ optional string timestamp = 2; // RFC3339 / ISO-8601 with offset (UTC), null when absent.
196
199
  }
197
200
 
198
201
  message AssistantBlock {
199
202
  string text = 1;
200
- optional string timestamp = 2;
203
+ optional string timestamp = 2; // RFC3339 / ISO-8601 with offset (UTC), null when absent.
201
204
  }
202
205
 
203
206
  message ThinkingBlock {
204
207
  string text = 1;
205
- optional string timestamp = 2;
208
+ optional string timestamp = 2; // RFC3339 / ISO-8601 with offset (UTC), null when absent.
206
209
  }
207
210
 
208
211
  message ToolBlock {
209
212
  string name = 1;
210
213
  string args = 2;
211
- optional string timestamp = 3;
214
+ optional string timestamp = 3; // RFC3339 / ISO-8601 with offset (UTC), null when absent.
212
215
  }
213
216
 
214
217
  message ToolResultBlock {
215
218
  repeated string lines = 1;
216
219
  bool is_error = 2;
217
- optional string timestamp = 3;
220
+ optional string timestamp = 3; // RFC3339 / ISO-8601 with offset (UTC), null when absent.
218
221
  }
219
222
 
220
223
  message PlainBlock {
221
224
  string text = 1;
222
225
  string level = 2; // "output" | "system" | "error" | "note" (serde snake_case variant names)
223
- optional string timestamp = 3;
226
+ optional string timestamp = 3; // RFC3339 / ISO-8601 with offset (UTC), null when absent.
224
227
  }
225
228
 
226
229
  message SessionSummary {
@@ -228,12 +231,23 @@ message SessionSummary {
228
231
  string name = 2;
229
232
  string cwd = 3;
230
233
  string model = 4;
231
- string created_at = 5;
232
- int64 last_activity_at = 6;
234
+ string created_at = 5; // RFC3339 / ISO-8601 with offset (UTC).
235
+ int64 last_activity_at = 6; // Deprecated epoch milliseconds; use last_activity_at_rfc3339.
233
236
  uint32 graph_count = 7;
234
237
  uint32 active_graph_count = 8;
235
238
  bool busy = 9;
236
239
  optional string preview = 10;
240
+ map<string, string> metadata = 11;
241
+ optional string last_activity_at_rfc3339 = 12; // RFC3339 / ISO-8601 with offset (UTC), null when absent.
242
+ }
243
+
244
+ message SessionStateRequest {
245
+ string session_id = 1;
246
+ }
247
+
248
+ message UpdateSessionMetadataRequest {
249
+ string session_id = 1;
250
+ map<string, string> metadata = 2;
237
251
  }
238
252
 
239
253
  message ListSessionsResponse {
@@ -243,16 +257,14 @@ message ListSessionsResponse {
243
257
 
244
258
  message CreateSessionRequest {
245
259
  optional string name = 1;
260
+ optional string session_id = 2;
261
+ map<string, string> metadata = 3;
246
262
  }
247
263
 
248
264
  message CreateSessionResponse {
249
265
  SessionSummary session = 1;
250
266
  }
251
267
 
252
- message SwitchSessionRequest {
253
- string session_id = 1;
254
- }
255
-
256
268
  message RenameSessionRequest {
257
269
  string session_id = 1;
258
270
  string name = 2;
@@ -316,15 +328,16 @@ message ClearCredentialRequest {
316
328
 
317
329
  service SessionService {
318
330
  // Full structured state (binary protobuf).
319
- rpc GetState(Empty) returns (SessionState);
320
- // Session resources: list (with current marker) / create / switch / rename /
331
+ rpc GetState(SessionStateRequest) returns (SessionState);
332
+ // Session resources: list (with current marker) / create / rename /
321
333
  // delete. DeleteSession reports the offending run ids when refused because
322
334
  // the session still has running graphs.
323
335
  rpc ListSessions(Empty) returns (ListSessionsResponse);
324
336
  rpc CreateSession(CreateSessionRequest) returns (CreateSessionResponse);
325
- rpc SwitchSession(SwitchSessionRequest) returns (CommandResult);
326
337
  rpc RenameSession(RenameSessionRequest) returns (CommandResult);
327
338
  rpc DeleteSession(DeleteSessionRequest) returns (DeleteSessionResponse);
339
+ // Update arbitrary session metadata KV (opaque to thewayd).
340
+ rpc UpdateSessionMetadata(UpdateSessionMetadataRequest) returns (CommandResult);
328
341
  // Daemon path context (issue #68): home/base/work_dir plus the current
329
342
  // skill search directories.
330
343
  rpc GetPathContext(Empty) returns (PathContext);
@@ -54,6 +54,12 @@ message DaemonConfig {
54
54
  // trigger rules, cron jobs) over RPC instead of local storage directly.
55
55
  optional string storage_service_addr = 10;
56
56
 
57
+ // ── thinking level (persisted last-choice default) ──
58
+ // Full thinking level string ("off" | "minimal" | "low" | "medium" |
59
+ // "high" | "xhigh"). Finer-grained than the `thinking` toggle; the toggle
60
+ // stays for legacy compatibility.
61
+ optional string thinking_level = 12;
62
+
57
63
  // Field names to clear before applying values present in this message.
58
64
  // Unknown names make the daemon reject the patch without partial changes.
59
65
  repeated string clear_fields = 11;
package/proto/state.proto CHANGED
@@ -114,6 +114,7 @@ service StorageService {
114
114
  rpc CreateSession(CreateSessionRequest) returns (CreateSessionResponse);
115
115
  rpc RenameSession(RenameSessionRequest) returns (CommandResult);
116
116
  rpc DeleteSession(DeleteSessionRequest) returns (DeleteSessionResponse);
117
+ rpc UpdateSessionMetadata(UpdateSessionMetadataRequest) returns (CommandResult);
117
118
 
118
119
  // DAG run persistence.
119
120
  rpc SaveDagRun(SaveDagRunRequest) returns (SaveDagRunResponse);