@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.
@@ -33,6 +33,7 @@ function createBaseSessionState() {
33
33
  feedBlockPatches: [],
34
34
  extensions: undefined,
35
35
  sessionContextUsage: undefined,
36
+ thinkingLevel: "",
36
37
  };
37
38
  }
38
39
  export const SessionState = {
@@ -100,6 +101,9 @@ export const SessionState = {
100
101
  if (message.sessionContextUsage !== undefined) {
101
102
  ContextUsage.encode(message.sessionContextUsage, writer.uint32(170).fork()).join();
102
103
  }
104
+ if (message.thinkingLevel !== "") {
105
+ writer.uint32(178).string(message.thinkingLevel);
106
+ }
103
107
  return writer;
104
108
  },
105
109
  decode(input, length) {
@@ -256,6 +260,13 @@ export const SessionState = {
256
260
  message.sessionContextUsage = ContextUsage.decode(reader, reader.uint32());
257
261
  continue;
258
262
  }
263
+ case 22: {
264
+ if (tag !== 178) {
265
+ break;
266
+ }
267
+ message.thinkingLevel = reader.string();
268
+ continue;
269
+ }
259
270
  }
260
271
  if ((tag & 7) === 4 || tag === 0) {
261
272
  break;
@@ -343,6 +354,11 @@ export const SessionState = {
343
354
  : isSet(object.session_context_usage)
344
355
  ? ContextUsage.fromJSON(object.session_context_usage)
345
356
  : undefined,
357
+ thinkingLevel: isSet(object.thinkingLevel)
358
+ ? globalThis.String(object.thinkingLevel)
359
+ : isSet(object.thinking_level)
360
+ ? globalThis.String(object.thinking_level)
361
+ : "",
346
362
  };
347
363
  },
348
364
  toJSON(message) {
@@ -410,6 +426,9 @@ export const SessionState = {
410
426
  if (message.sessionContextUsage !== undefined) {
411
427
  obj.sessionContextUsage = ContextUsage.toJSON(message.sessionContextUsage);
412
428
  }
429
+ if (message.thinkingLevel !== "") {
430
+ obj.thinkingLevel = message.thinkingLevel;
431
+ }
413
432
  return obj;
414
433
  },
415
434
  create(base) {
@@ -452,6 +471,7 @@ export const SessionState = {
452
471
  message.sessionContextUsage = (object.sessionContextUsage !== undefined && object.sessionContextUsage !== null)
453
472
  ? ContextUsage.fromPartial(object.sessionContextUsage)
454
473
  : undefined;
474
+ message.thinkingLevel = object.thinkingLevel ?? "";
455
475
  return message;
456
476
  },
457
477
  };
@@ -2950,6 +2970,8 @@ function createBaseSessionSummary() {
2950
2970
  activeGraphCount: 0,
2951
2971
  busy: false,
2952
2972
  preview: undefined,
2973
+ metadata: {},
2974
+ lastActivityAtRfc3339: undefined,
2953
2975
  };
2954
2976
  }
2955
2977
  export const SessionSummary = {
@@ -2984,6 +3006,12 @@ export const SessionSummary = {
2984
3006
  if (message.preview !== undefined) {
2985
3007
  writer.uint32(82).string(message.preview);
2986
3008
  }
3009
+ globalThis.Object.entries(message.metadata).forEach(([key, value]) => {
3010
+ SessionSummary_MetadataEntry.encode({ key: key, value }, writer.uint32(90).fork()).join();
3011
+ });
3012
+ if (message.lastActivityAtRfc3339 !== undefined) {
3013
+ writer.uint32(98).string(message.lastActivityAtRfc3339);
3014
+ }
2987
3015
  return writer;
2988
3016
  },
2989
3017
  decode(input, length) {
@@ -3063,6 +3091,23 @@ export const SessionSummary = {
3063
3091
  message.preview = reader.string();
3064
3092
  continue;
3065
3093
  }
3094
+ case 11: {
3095
+ if (tag !== 90) {
3096
+ break;
3097
+ }
3098
+ const entry11 = SessionSummary_MetadataEntry.decode(reader, reader.uint32());
3099
+ if (entry11.value !== undefined) {
3100
+ message.metadata[entry11.key] = entry11.value;
3101
+ }
3102
+ continue;
3103
+ }
3104
+ case 12: {
3105
+ if (tag !== 98) {
3106
+ break;
3107
+ }
3108
+ message.lastActivityAtRfc3339 = reader.string();
3109
+ continue;
3110
+ }
3066
3111
  }
3067
3112
  if ((tag & 7) === 4 || tag === 0) {
3068
3113
  break;
@@ -3103,6 +3148,17 @@ export const SessionSummary = {
3103
3148
  : 0,
3104
3149
  busy: isSet(object.busy) ? globalThis.Boolean(object.busy) : false,
3105
3150
  preview: isSet(object.preview) ? globalThis.String(object.preview) : undefined,
3151
+ metadata: isObject(object.metadata)
3152
+ ? globalThis.Object.entries(object.metadata).reduce((acc, [key, value]) => {
3153
+ acc[key] = globalThis.String(value);
3154
+ return acc;
3155
+ }, {})
3156
+ : {},
3157
+ lastActivityAtRfc3339: isSet(object.lastActivityAtRfc3339)
3158
+ ? globalThis.String(object.lastActivityAtRfc3339)
3159
+ : isSet(object.last_activity_at_rfc3339)
3160
+ ? globalThis.String(object.last_activity_at_rfc3339)
3161
+ : undefined,
3106
3162
  };
3107
3163
  },
3108
3164
  toJSON(message) {
@@ -3137,6 +3193,18 @@ export const SessionSummary = {
3137
3193
  if (message.preview !== undefined) {
3138
3194
  obj.preview = message.preview;
3139
3195
  }
3196
+ if (message.metadata) {
3197
+ const entries = globalThis.Object.entries(message.metadata);
3198
+ if (entries.length > 0) {
3199
+ obj.metadata = {};
3200
+ entries.forEach(([k, v]) => {
3201
+ obj.metadata[k] = v;
3202
+ });
3203
+ }
3204
+ }
3205
+ if (message.lastActivityAtRfc3339 !== undefined) {
3206
+ obj.lastActivityAtRfc3339 = message.lastActivityAtRfc3339;
3207
+ }
3140
3208
  return obj;
3141
3209
  },
3142
3210
  create(base) {
@@ -3154,6 +3222,297 @@ export const SessionSummary = {
3154
3222
  message.activeGraphCount = object.activeGraphCount ?? 0;
3155
3223
  message.busy = object.busy ?? false;
3156
3224
  message.preview = object.preview ?? undefined;
3225
+ message.metadata = globalThis.Object.entries(object.metadata ?? {}).reduce((acc, [key, value]) => {
3226
+ if (value !== undefined) {
3227
+ acc[key] = globalThis.String(value);
3228
+ }
3229
+ return acc;
3230
+ }, {});
3231
+ message.lastActivityAtRfc3339 = object.lastActivityAtRfc3339 ?? undefined;
3232
+ return message;
3233
+ },
3234
+ };
3235
+ function createBaseSessionSummary_MetadataEntry() {
3236
+ return { key: "", value: "" };
3237
+ }
3238
+ export const SessionSummary_MetadataEntry = {
3239
+ encode(message, writer = new BinaryWriter()) {
3240
+ if (message.key !== "") {
3241
+ writer.uint32(10).string(message.key);
3242
+ }
3243
+ if (message.value !== "") {
3244
+ writer.uint32(18).string(message.value);
3245
+ }
3246
+ return writer;
3247
+ },
3248
+ decode(input, length) {
3249
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3250
+ const end = length === undefined ? reader.len : reader.pos + length;
3251
+ const message = createBaseSessionSummary_MetadataEntry();
3252
+ while (reader.pos < end) {
3253
+ const tag = reader.uint32();
3254
+ switch (tag >>> 3) {
3255
+ case 1: {
3256
+ if (tag !== 10) {
3257
+ break;
3258
+ }
3259
+ message.key = reader.string();
3260
+ continue;
3261
+ }
3262
+ case 2: {
3263
+ if (tag !== 18) {
3264
+ break;
3265
+ }
3266
+ message.value = reader.string();
3267
+ continue;
3268
+ }
3269
+ }
3270
+ if ((tag & 7) === 4 || tag === 0) {
3271
+ break;
3272
+ }
3273
+ reader.skip(tag & 7);
3274
+ }
3275
+ return message;
3276
+ },
3277
+ fromJSON(object) {
3278
+ return {
3279
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
3280
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
3281
+ };
3282
+ },
3283
+ toJSON(message) {
3284
+ const obj = {};
3285
+ if (message.key !== "") {
3286
+ obj.key = message.key;
3287
+ }
3288
+ if (message.value !== "") {
3289
+ obj.value = message.value;
3290
+ }
3291
+ return obj;
3292
+ },
3293
+ create(base) {
3294
+ return SessionSummary_MetadataEntry.fromPartial(base ?? {});
3295
+ },
3296
+ fromPartial(object) {
3297
+ const message = createBaseSessionSummary_MetadataEntry();
3298
+ message.key = object.key ?? "";
3299
+ message.value = object.value ?? "";
3300
+ return message;
3301
+ },
3302
+ };
3303
+ function createBaseSessionStateRequest() {
3304
+ return { sessionId: "" };
3305
+ }
3306
+ export const SessionStateRequest = {
3307
+ encode(message, writer = new BinaryWriter()) {
3308
+ if (message.sessionId !== "") {
3309
+ writer.uint32(10).string(message.sessionId);
3310
+ }
3311
+ return writer;
3312
+ },
3313
+ decode(input, length) {
3314
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3315
+ const end = length === undefined ? reader.len : reader.pos + length;
3316
+ const message = createBaseSessionStateRequest();
3317
+ while (reader.pos < end) {
3318
+ const tag = reader.uint32();
3319
+ switch (tag >>> 3) {
3320
+ case 1: {
3321
+ if (tag !== 10) {
3322
+ break;
3323
+ }
3324
+ message.sessionId = reader.string();
3325
+ continue;
3326
+ }
3327
+ }
3328
+ if ((tag & 7) === 4 || tag === 0) {
3329
+ break;
3330
+ }
3331
+ reader.skip(tag & 7);
3332
+ }
3333
+ return message;
3334
+ },
3335
+ fromJSON(object) {
3336
+ return {
3337
+ sessionId: isSet(object.sessionId)
3338
+ ? globalThis.String(object.sessionId)
3339
+ : isSet(object.session_id)
3340
+ ? globalThis.String(object.session_id)
3341
+ : "",
3342
+ };
3343
+ },
3344
+ toJSON(message) {
3345
+ const obj = {};
3346
+ if (message.sessionId !== "") {
3347
+ obj.sessionId = message.sessionId;
3348
+ }
3349
+ return obj;
3350
+ },
3351
+ create(base) {
3352
+ return SessionStateRequest.fromPartial(base ?? {});
3353
+ },
3354
+ fromPartial(object) {
3355
+ const message = createBaseSessionStateRequest();
3356
+ message.sessionId = object.sessionId ?? "";
3357
+ return message;
3358
+ },
3359
+ };
3360
+ function createBaseUpdateSessionMetadataRequest() {
3361
+ return { sessionId: "", metadata: {} };
3362
+ }
3363
+ export const UpdateSessionMetadataRequest = {
3364
+ encode(message, writer = new BinaryWriter()) {
3365
+ if (message.sessionId !== "") {
3366
+ writer.uint32(10).string(message.sessionId);
3367
+ }
3368
+ globalThis.Object.entries(message.metadata).forEach(([key, value]) => {
3369
+ UpdateSessionMetadataRequest_MetadataEntry.encode({ key: key, value }, writer.uint32(18).fork()).join();
3370
+ });
3371
+ return writer;
3372
+ },
3373
+ decode(input, length) {
3374
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3375
+ const end = length === undefined ? reader.len : reader.pos + length;
3376
+ const message = createBaseUpdateSessionMetadataRequest();
3377
+ while (reader.pos < end) {
3378
+ const tag = reader.uint32();
3379
+ switch (tag >>> 3) {
3380
+ case 1: {
3381
+ if (tag !== 10) {
3382
+ break;
3383
+ }
3384
+ message.sessionId = reader.string();
3385
+ continue;
3386
+ }
3387
+ case 2: {
3388
+ if (tag !== 18) {
3389
+ break;
3390
+ }
3391
+ const entry2 = UpdateSessionMetadataRequest_MetadataEntry.decode(reader, reader.uint32());
3392
+ if (entry2.value !== undefined) {
3393
+ message.metadata[entry2.key] = entry2.value;
3394
+ }
3395
+ continue;
3396
+ }
3397
+ }
3398
+ if ((tag & 7) === 4 || tag === 0) {
3399
+ break;
3400
+ }
3401
+ reader.skip(tag & 7);
3402
+ }
3403
+ return message;
3404
+ },
3405
+ fromJSON(object) {
3406
+ return {
3407
+ sessionId: isSet(object.sessionId)
3408
+ ? globalThis.String(object.sessionId)
3409
+ : isSet(object.session_id)
3410
+ ? globalThis.String(object.session_id)
3411
+ : "",
3412
+ metadata: isObject(object.metadata)
3413
+ ? globalThis.Object.entries(object.metadata).reduce((acc, [key, value]) => {
3414
+ acc[key] = globalThis.String(value);
3415
+ return acc;
3416
+ }, {})
3417
+ : {},
3418
+ };
3419
+ },
3420
+ toJSON(message) {
3421
+ const obj = {};
3422
+ if (message.sessionId !== "") {
3423
+ obj.sessionId = message.sessionId;
3424
+ }
3425
+ if (message.metadata) {
3426
+ const entries = globalThis.Object.entries(message.metadata);
3427
+ if (entries.length > 0) {
3428
+ obj.metadata = {};
3429
+ entries.forEach(([k, v]) => {
3430
+ obj.metadata[k] = v;
3431
+ });
3432
+ }
3433
+ }
3434
+ return obj;
3435
+ },
3436
+ create(base) {
3437
+ return UpdateSessionMetadataRequest.fromPartial(base ?? {});
3438
+ },
3439
+ fromPartial(object) {
3440
+ const message = createBaseUpdateSessionMetadataRequest();
3441
+ message.sessionId = object.sessionId ?? "";
3442
+ message.metadata = globalThis.Object.entries(object.metadata ?? {}).reduce((acc, [key, value]) => {
3443
+ if (value !== undefined) {
3444
+ acc[key] = globalThis.String(value);
3445
+ }
3446
+ return acc;
3447
+ }, {});
3448
+ return message;
3449
+ },
3450
+ };
3451
+ function createBaseUpdateSessionMetadataRequest_MetadataEntry() {
3452
+ return { key: "", value: "" };
3453
+ }
3454
+ export const UpdateSessionMetadataRequest_MetadataEntry = {
3455
+ encode(message, writer = new BinaryWriter()) {
3456
+ if (message.key !== "") {
3457
+ writer.uint32(10).string(message.key);
3458
+ }
3459
+ if (message.value !== "") {
3460
+ writer.uint32(18).string(message.value);
3461
+ }
3462
+ return writer;
3463
+ },
3464
+ decode(input, length) {
3465
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3466
+ const end = length === undefined ? reader.len : reader.pos + length;
3467
+ const message = createBaseUpdateSessionMetadataRequest_MetadataEntry();
3468
+ while (reader.pos < end) {
3469
+ const tag = reader.uint32();
3470
+ switch (tag >>> 3) {
3471
+ case 1: {
3472
+ if (tag !== 10) {
3473
+ break;
3474
+ }
3475
+ message.key = reader.string();
3476
+ continue;
3477
+ }
3478
+ case 2: {
3479
+ if (tag !== 18) {
3480
+ break;
3481
+ }
3482
+ message.value = reader.string();
3483
+ continue;
3484
+ }
3485
+ }
3486
+ if ((tag & 7) === 4 || tag === 0) {
3487
+ break;
3488
+ }
3489
+ reader.skip(tag & 7);
3490
+ }
3491
+ return message;
3492
+ },
3493
+ fromJSON(object) {
3494
+ return {
3495
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
3496
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
3497
+ };
3498
+ },
3499
+ toJSON(message) {
3500
+ const obj = {};
3501
+ if (message.key !== "") {
3502
+ obj.key = message.key;
3503
+ }
3504
+ if (message.value !== "") {
3505
+ obj.value = message.value;
3506
+ }
3507
+ return obj;
3508
+ },
3509
+ create(base) {
3510
+ return UpdateSessionMetadataRequest_MetadataEntry.fromPartial(base ?? {});
3511
+ },
3512
+ fromPartial(object) {
3513
+ const message = createBaseUpdateSessionMetadataRequest_MetadataEntry();
3514
+ message.key = object.key ?? "";
3515
+ message.value = object.value ?? "";
3157
3516
  return message;
3158
3517
  },
3159
3518
  };
@@ -3232,13 +3591,19 @@ export const ListSessionsResponse = {
3232
3591
  },
3233
3592
  };
3234
3593
  function createBaseCreateSessionRequest() {
3235
- return { name: undefined };
3594
+ return { name: undefined, sessionId: undefined, metadata: {} };
3236
3595
  }
3237
3596
  export const CreateSessionRequest = {
3238
3597
  encode(message, writer = new BinaryWriter()) {
3239
3598
  if (message.name !== undefined) {
3240
3599
  writer.uint32(10).string(message.name);
3241
3600
  }
3601
+ if (message.sessionId !== undefined) {
3602
+ writer.uint32(18).string(message.sessionId);
3603
+ }
3604
+ globalThis.Object.entries(message.metadata).forEach(([key, value]) => {
3605
+ CreateSessionRequest_MetadataEntry.encode({ key: key, value }, writer.uint32(26).fork()).join();
3606
+ });
3242
3607
  return writer;
3243
3608
  },
3244
3609
  decode(input, length) {
@@ -3255,6 +3620,23 @@ export const CreateSessionRequest = {
3255
3620
  message.name = reader.string();
3256
3621
  continue;
3257
3622
  }
3623
+ case 2: {
3624
+ if (tag !== 18) {
3625
+ break;
3626
+ }
3627
+ message.sessionId = reader.string();
3628
+ continue;
3629
+ }
3630
+ case 3: {
3631
+ if (tag !== 26) {
3632
+ break;
3633
+ }
3634
+ const entry3 = CreateSessionRequest_MetadataEntry.decode(reader, reader.uint32());
3635
+ if (entry3.value !== undefined) {
3636
+ message.metadata[entry3.key] = entry3.value;
3637
+ }
3638
+ continue;
3639
+ }
3258
3640
  }
3259
3641
  if ((tag & 7) === 4 || tag === 0) {
3260
3642
  break;
@@ -3264,13 +3646,38 @@ export const CreateSessionRequest = {
3264
3646
  return message;
3265
3647
  },
3266
3648
  fromJSON(object) {
3267
- return { name: isSet(object.name) ? globalThis.String(object.name) : undefined };
3649
+ return {
3650
+ name: isSet(object.name) ? globalThis.String(object.name) : undefined,
3651
+ sessionId: isSet(object.sessionId)
3652
+ ? globalThis.String(object.sessionId)
3653
+ : isSet(object.session_id)
3654
+ ? globalThis.String(object.session_id)
3655
+ : undefined,
3656
+ metadata: isObject(object.metadata)
3657
+ ? globalThis.Object.entries(object.metadata).reduce((acc, [key, value]) => {
3658
+ acc[key] = globalThis.String(value);
3659
+ return acc;
3660
+ }, {})
3661
+ : {},
3662
+ };
3268
3663
  },
3269
3664
  toJSON(message) {
3270
3665
  const obj = {};
3271
3666
  if (message.name !== undefined) {
3272
3667
  obj.name = message.name;
3273
3668
  }
3669
+ if (message.sessionId !== undefined) {
3670
+ obj.sessionId = message.sessionId;
3671
+ }
3672
+ if (message.metadata) {
3673
+ const entries = globalThis.Object.entries(message.metadata);
3674
+ if (entries.length > 0) {
3675
+ obj.metadata = {};
3676
+ entries.forEach(([k, v]) => {
3677
+ obj.metadata[k] = v;
3678
+ });
3679
+ }
3680
+ }
3274
3681
  return obj;
3275
3682
  },
3276
3683
  create(base) {
@@ -3279,23 +3686,33 @@ export const CreateSessionRequest = {
3279
3686
  fromPartial(object) {
3280
3687
  const message = createBaseCreateSessionRequest();
3281
3688
  message.name = object.name ?? undefined;
3689
+ message.sessionId = object.sessionId ?? undefined;
3690
+ message.metadata = globalThis.Object.entries(object.metadata ?? {}).reduce((acc, [key, value]) => {
3691
+ if (value !== undefined) {
3692
+ acc[key] = globalThis.String(value);
3693
+ }
3694
+ return acc;
3695
+ }, {});
3282
3696
  return message;
3283
3697
  },
3284
3698
  };
3285
- function createBaseCreateSessionResponse() {
3286
- return { session: undefined };
3699
+ function createBaseCreateSessionRequest_MetadataEntry() {
3700
+ return { key: "", value: "" };
3287
3701
  }
3288
- export const CreateSessionResponse = {
3702
+ export const CreateSessionRequest_MetadataEntry = {
3289
3703
  encode(message, writer = new BinaryWriter()) {
3290
- if (message.session !== undefined) {
3291
- SessionSummary.encode(message.session, writer.uint32(10).fork()).join();
3704
+ if (message.key !== "") {
3705
+ writer.uint32(10).string(message.key);
3706
+ }
3707
+ if (message.value !== "") {
3708
+ writer.uint32(18).string(message.value);
3292
3709
  }
3293
3710
  return writer;
3294
3711
  },
3295
3712
  decode(input, length) {
3296
3713
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3297
3714
  const end = length === undefined ? reader.len : reader.pos + length;
3298
- const message = createBaseCreateSessionResponse();
3715
+ const message = createBaseCreateSessionRequest_MetadataEntry();
3299
3716
  while (reader.pos < end) {
3300
3717
  const tag = reader.uint32();
3301
3718
  switch (tag >>> 3) {
@@ -3303,7 +3720,14 @@ export const CreateSessionResponse = {
3303
3720
  if (tag !== 10) {
3304
3721
  break;
3305
3722
  }
3306
- message.session = SessionSummary.decode(reader, reader.uint32());
3723
+ message.key = reader.string();
3724
+ continue;
3725
+ }
3726
+ case 2: {
3727
+ if (tag !== 18) {
3728
+ break;
3729
+ }
3730
+ message.value = reader.string();
3307
3731
  continue;
3308
3732
  }
3309
3733
  }
@@ -3315,40 +3739,45 @@ export const CreateSessionResponse = {
3315
3739
  return message;
3316
3740
  },
3317
3741
  fromJSON(object) {
3318
- return { session: isSet(object.session) ? SessionSummary.fromJSON(object.session) : undefined };
3742
+ return {
3743
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
3744
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
3745
+ };
3319
3746
  },
3320
3747
  toJSON(message) {
3321
3748
  const obj = {};
3322
- if (message.session !== undefined) {
3323
- obj.session = SessionSummary.toJSON(message.session);
3749
+ if (message.key !== "") {
3750
+ obj.key = message.key;
3751
+ }
3752
+ if (message.value !== "") {
3753
+ obj.value = message.value;
3324
3754
  }
3325
3755
  return obj;
3326
3756
  },
3327
3757
  create(base) {
3328
- return CreateSessionResponse.fromPartial(base ?? {});
3758
+ return CreateSessionRequest_MetadataEntry.fromPartial(base ?? {});
3329
3759
  },
3330
3760
  fromPartial(object) {
3331
- const message = createBaseCreateSessionResponse();
3332
- message.session = (object.session !== undefined && object.session !== null)
3333
- ? SessionSummary.fromPartial(object.session)
3334
- : undefined;
3761
+ const message = createBaseCreateSessionRequest_MetadataEntry();
3762
+ message.key = object.key ?? "";
3763
+ message.value = object.value ?? "";
3335
3764
  return message;
3336
3765
  },
3337
3766
  };
3338
- function createBaseSwitchSessionRequest() {
3339
- return { sessionId: "" };
3767
+ function createBaseCreateSessionResponse() {
3768
+ return { session: undefined };
3340
3769
  }
3341
- export const SwitchSessionRequest = {
3770
+ export const CreateSessionResponse = {
3342
3771
  encode(message, writer = new BinaryWriter()) {
3343
- if (message.sessionId !== "") {
3344
- writer.uint32(10).string(message.sessionId);
3772
+ if (message.session !== undefined) {
3773
+ SessionSummary.encode(message.session, writer.uint32(10).fork()).join();
3345
3774
  }
3346
3775
  return writer;
3347
3776
  },
3348
3777
  decode(input, length) {
3349
3778
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3350
3779
  const end = length === undefined ? reader.len : reader.pos + length;
3351
- const message = createBaseSwitchSessionRequest();
3780
+ const message = createBaseCreateSessionResponse();
3352
3781
  while (reader.pos < end) {
3353
3782
  const tag = reader.uint32();
3354
3783
  switch (tag >>> 3) {
@@ -3356,7 +3785,7 @@ export const SwitchSessionRequest = {
3356
3785
  if (tag !== 10) {
3357
3786
  break;
3358
3787
  }
3359
- message.sessionId = reader.string();
3788
+ message.session = SessionSummary.decode(reader, reader.uint32());
3360
3789
  continue;
3361
3790
  }
3362
3791
  }
@@ -3368,27 +3797,23 @@ export const SwitchSessionRequest = {
3368
3797
  return message;
3369
3798
  },
3370
3799
  fromJSON(object) {
3371
- return {
3372
- sessionId: isSet(object.sessionId)
3373
- ? globalThis.String(object.sessionId)
3374
- : isSet(object.session_id)
3375
- ? globalThis.String(object.session_id)
3376
- : "",
3377
- };
3800
+ return { session: isSet(object.session) ? SessionSummary.fromJSON(object.session) : undefined };
3378
3801
  },
3379
3802
  toJSON(message) {
3380
3803
  const obj = {};
3381
- if (message.sessionId !== "") {
3382
- obj.sessionId = message.sessionId;
3804
+ if (message.session !== undefined) {
3805
+ obj.session = SessionSummary.toJSON(message.session);
3383
3806
  }
3384
3807
  return obj;
3385
3808
  },
3386
3809
  create(base) {
3387
- return SwitchSessionRequest.fromPartial(base ?? {});
3810
+ return CreateSessionResponse.fromPartial(base ?? {});
3388
3811
  },
3389
3812
  fromPartial(object) {
3390
- const message = createBaseSwitchSessionRequest();
3391
- message.sessionId = object.sessionId ?? "";
3813
+ const message = createBaseCreateSessionResponse();
3814
+ message.session = (object.session !== undefined && object.session !== null)
3815
+ ? SessionSummary.fromPartial(object.session)
3816
+ : undefined;
3392
3817
  return message;
3393
3818
  },
3394
3819
  };
@@ -4199,13 +4624,13 @@ export const SessionServiceService = {
4199
4624
  path: "/theway.grpc.v1.SessionService/GetState",
4200
4625
  requestStream: false,
4201
4626
  responseStream: false,
4202
- requestSerialize: (value) => Buffer.from(Empty.encode(value).finish()),
4203
- requestDeserialize: (value) => Empty.decode(value),
4627
+ requestSerialize: (value) => Buffer.from(SessionStateRequest.encode(value).finish()),
4628
+ requestDeserialize: (value) => SessionStateRequest.decode(value),
4204
4629
  responseSerialize: (value) => Buffer.from(SessionState.encode(value).finish()),
4205
4630
  responseDeserialize: (value) => SessionState.decode(value),
4206
4631
  },
4207
4632
  /**
4208
- * Session resources: list (with current marker) / create / switch / rename /
4633
+ * Session resources: list (with current marker) / create / rename /
4209
4634
  * delete. DeleteSession reports the offending run ids when refused because
4210
4635
  * the session still has running graphs.
4211
4636
  */
@@ -4227,15 +4652,6 @@ export const SessionServiceService = {
4227
4652
  responseSerialize: (value) => Buffer.from(CreateSessionResponse.encode(value).finish()),
4228
4653
  responseDeserialize: (value) => CreateSessionResponse.decode(value),
4229
4654
  },
4230
- switchSession: {
4231
- path: "/theway.grpc.v1.SessionService/SwitchSession",
4232
- requestStream: false,
4233
- responseStream: false,
4234
- requestSerialize: (value) => Buffer.from(SwitchSessionRequest.encode(value).finish()),
4235
- requestDeserialize: (value) => SwitchSessionRequest.decode(value),
4236
- responseSerialize: (value) => Buffer.from(CommandResult.encode(value).finish()),
4237
- responseDeserialize: (value) => CommandResult.decode(value),
4238
- },
4239
4655
  renameSession: {
4240
4656
  path: "/theway.grpc.v1.SessionService/RenameSession",
4241
4657
  requestStream: false,
@@ -4254,6 +4670,16 @@ export const SessionServiceService = {
4254
4670
  responseSerialize: (value) => Buffer.from(DeleteSessionResponse.encode(value).finish()),
4255
4671
  responseDeserialize: (value) => DeleteSessionResponse.decode(value),
4256
4672
  },
4673
+ /** Update arbitrary session metadata KV (opaque to thewayd). */
4674
+ updateSessionMetadata: {
4675
+ path: "/theway.grpc.v1.SessionService/UpdateSessionMetadata",
4676
+ requestStream: false,
4677
+ responseStream: false,
4678
+ requestSerialize: (value) => Buffer.from(UpdateSessionMetadataRequest.encode(value).finish()),
4679
+ requestDeserialize: (value) => UpdateSessionMetadataRequest.decode(value),
4680
+ responseSerialize: (value) => Buffer.from(CommandResult.encode(value).finish()),
4681
+ responseDeserialize: (value) => CommandResult.decode(value),
4682
+ },
4257
4683
  /**
4258
4684
  * Daemon path context (issue #68): home/base/work_dir plus the current
4259
4685
  * skill search directories.
@@ -4339,6 +4765,9 @@ function base64FromBytes(arr) {
4339
4765
  return globalThis.btoa(bin.join(""));
4340
4766
  }
4341
4767
  }
4768
+ function isObject(value) {
4769
+ return typeof value === "object" && value !== null;
4770
+ }
4342
4771
  function isSet(value) {
4343
4772
  return value !== null && value !== undefined;
4344
4773
  }