@jush-agent/sdk 0.2.6254 → 0.2.6325

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/index.mjs CHANGED
@@ -60,6 +60,10 @@ const userContentBlockSchema = z.discriminatedUnion("type", [
60
60
  type: z.literal("video"),
61
61
  source: mediaSourceSchema
62
62
  }),
63
+ z.object({
64
+ type: z.literal("audio"),
65
+ source: mediaSourceSchema
66
+ }),
63
67
  z.object({
64
68
  type: z.literal("document"),
65
69
  source: documentSourceSchema
@@ -446,7 +450,13 @@ const fileExtensionSchema = z.enum([
446
450
  "mp4",
447
451
  "mov",
448
452
  "webm",
449
- "m4v"
453
+ "m4v",
454
+ "mp3",
455
+ "wav",
456
+ "ogg",
457
+ "flac",
458
+ "aiff",
459
+ "m4a"
450
460
  ]);
451
461
  /** A model with its catalog facts, as a selection records it. */
452
462
  const modelSchema = z.object({
@@ -938,7 +948,7 @@ const reportEventSchema = z.discriminatedUnion("kind", [
938
948
  })
939
949
  ]);
940
950
  /**
941
- * Where the bytes of a tool result's image or video are: in the
951
+ * Where the bytes of a tool result's image, video or recording are: in the
942
952
  * conversation owner's blob namespace. A tagged enum of one variant, so a
943
953
  * stored result keeps `{ "type": "ref", ... }`.
944
954
  */
@@ -953,10 +963,14 @@ const toolMediaSourceSchema = z.discriminatedUnion("type", [z.object({
953
963
  width: z.int().min(0).max(4294967295).optional(),
954
964
  height: z.int().min(0).max(4294967295).optional()
955
965
  })]);
956
- /** Whether a model reads a medium as an image, a video or a document. */
966
+ /**
967
+ * Whether a model reads a medium as an image, a video, a recording or a
968
+ * document.
969
+ */
957
970
  const modelMediaKindSchema = z.enum([
958
971
  "image",
959
972
  "video",
973
+ "audio",
960
974
  "document"
961
975
  ]);
962
976
  /** Why a tool result's medium is gone. */
@@ -978,6 +992,10 @@ const toolResultContentBlockSchema = z.discriminatedUnion("type", [
978
992
  type: z.literal("video"),
979
993
  source: toolMediaSourceSchema
980
994
  }),
995
+ z.object({
996
+ type: z.literal("audio"),
997
+ source: toolMediaSourceSchema
998
+ }),
981
999
  z.object({
982
1000
  type: z.literal("document"),
983
1001
  source: documentSourceSchema
@@ -1360,10 +1378,20 @@ const quotaKindSchema = z.enum([
1360
1378
  "tokens",
1361
1379
  "cap"
1362
1380
  ]);
1363
- /** The part of an account a window meters, such as one model. */
1381
+ /**
1382
+ * The part of an account a window meters, such as one model or a group of
1383
+ * models.
1384
+ */
1364
1385
  const quotaScopeSchema = z.object({
1365
1386
  kind: z.string(),
1366
- label: z.string().nullable()
1387
+ label: z.string().nullable(),
1388
+ /**
1389
+ * The models a model scope counts for, by their catalog ids, when the
1390
+ * vendor names them, as for a group of models with a name of its own
1391
+ * (`Claude and GPT`); empty when the label names the model, as `Sonnet`
1392
+ * does.
1393
+ */
1394
+ modelIds: z.array(z.string()).optional()
1367
1395
  });
1368
1396
  /**
1369
1397
  * What names a window: the parts of a
@@ -2016,6 +2044,11 @@ const mediaRefSchema = z.discriminatedUnion("type", [
2016
2044
  ref: z.string().regex(/* @__PURE__ */ new RegExp("^[0-9a-f]{64}$", "u")),
2017
2045
  mediaType: z.string()
2018
2046
  }),
2047
+ z.strictObject({
2048
+ type: z.literal("audio"),
2049
+ ref: z.string().regex(/* @__PURE__ */ new RegExp("^[0-9a-f]{64}$", "u")),
2050
+ mediaType: z.string()
2051
+ }),
2019
2052
  z.strictObject({
2020
2053
  type: z.literal("document"),
2021
2054
  ref: z.string().regex(/* @__PURE__ */ new RegExp("^[0-9a-f]{64}$", "u")),
@@ -2160,6 +2193,12 @@ const followSchema = z.strictObject({
2160
2193
  value: followedSchema,
2161
2194
  holds: heldSchema
2162
2195
  });
2196
+ /**
2197
+ * A server frame that a page understands only when its `open` says so: a
2198
+ * page checks every frame against its schemas and ends the connection at one
2199
+ * it does not know, as a page loaded before the server's upgrade does.
2200
+ */
2201
+ const understoodSchema = z.enum(["metadata_changed"]);
2163
2202
  /** A replacement of a user message and everything after it. */
2164
2203
  const editRequestSchema = z.strictObject({
2165
2204
  /** Chosen by the web app, so a repeated request is recognized. */
@@ -2202,7 +2241,12 @@ z.discriminatedUnion("type", [
2202
2241
  z.strictObject({
2203
2242
  type: z.literal("open"),
2204
2243
  draft: z.int().min(0).nullable().optional(),
2205
- follows: z.array(followSchema).optional()
2244
+ follows: z.array(followSchema).optional(),
2245
+ /**
2246
+ * The frames the page understands beyond those every page does,
2247
+ * which the server sends it only when they are named here.
2248
+ */
2249
+ understands: z.array(understoodSchema).optional()
2206
2250
  }),
2207
2251
  z.strictObject({
2208
2252
  type: z.literal("follow"),
@@ -2560,6 +2604,7 @@ const costSchema = z.object({
2560
2604
  const createWorkTabSchema = z.strictObject({
2561
2605
  id: z.string().min(1),
2562
2606
  kind: z.string().min(1),
2607
+ device: z.string().min(1).optional(),
2563
2608
  data: z.record(z.string(), z.json()),
2564
2609
  index: z.int().min(0).max(64).nullable().optional()
2565
2610
  });
@@ -2648,6 +2693,17 @@ const deviceReadSchema = z.strictObject({
2648
2693
  */
2649
2694
  content: z.boolean().optional()
2650
2695
  });
2696
+ /** What a plugin's package on a device last reported of a conversation. */
2697
+ const storedReportSchema = z.object({
2698
+ /** The package's own count of its changes. */
2699
+ revision: z.int().min(0),
2700
+ value: z.json()
2701
+ });
2702
+ /** What a plugin's package on `device` last reported of a conversation. */
2703
+ const deviceReportSchema = z.object({
2704
+ device: z.string().min(1),
2705
+ report: storedReportSchema
2706
+ });
2651
2707
  /** Where a directory of the set is on every device. */
2652
2708
  const directoryPathSchema = z.object({
2653
2709
  name: z.string(),
@@ -2749,6 +2805,9 @@ const errorCodeSchema = z.enum([
2749
2805
  "share_target_invalid",
2750
2806
  "share_not_updatable",
2751
2807
  "share_not_found",
2808
+ "debug_link_not_found",
2809
+ "page_not_connected",
2810
+ "run_timed_out",
2752
2811
  "permission_request_not_found",
2753
2812
  "invalid_answer",
2754
2813
  "credential_not_found",
@@ -3101,6 +3160,12 @@ const rpcInvocationSchema = z.object({
3101
3160
  const workTabSchema = z.object({
3102
3161
  id: z.string().min(1),
3103
3162
  kind: z.string().min(1),
3163
+ /**
3164
+ * The device whose thing it shows, such as a browser's tab, a simulator
3165
+ * or a file of an attached device; none for a tab of no one device,
3166
+ * which follows the conversation's primary device.
3167
+ */
3168
+ device: z.string().min(1).optional(),
3104
3169
  data: z.record(z.string(), z.json())
3105
3170
  });
3106
3171
  const requestSchema = z.discriminatedUnion("type", [
@@ -3138,7 +3203,8 @@ const requestSchema = z.discriminatedUnion("type", [
3138
3203
  user: z.string().min(1),
3139
3204
  method: z.string(),
3140
3205
  params: z.record(z.string(), z.json()),
3141
- conversation: z.string().regex(/* @__PURE__ */ new RegExp("^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "u")).nullable().optional()
3206
+ conversation: z.string().regex(/* @__PURE__ */ new RegExp("^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "u")).nullable().optional(),
3207
+ device: z.string().min(1).nullable().optional()
3142
3208
  }),
3143
3209
  z.object({
3144
3210
  type: z.literal("tab_closed"),
@@ -3199,12 +3265,6 @@ const storedValueSchema = z.object({
3199
3265
  value: z.json(),
3200
3266
  revision: z.int().min(0)
3201
3267
  });
3202
- /** What a plugin's package on a device last reported of a conversation. */
3203
- const storedReportSchema = z.object({
3204
- /** The package's own count of its changes. */
3205
- revision: z.int().min(0),
3206
- value: z.json()
3207
- });
3208
3268
  /**
3209
3269
  * A conversation's work as the database keeps it: the tabs in order, and
3210
3270
  * how many changes made them. The conversation's entry in the list carries
@@ -3708,14 +3768,18 @@ const portAnswerSchema = z.discriminatedUnion("type", [
3708
3768
  type: z.literal("called"),
3709
3769
  result: z.json()
3710
3770
  }),
3711
- z.object({
3712
- type: z.literal("kept"),
3713
- primary: z.boolean()
3714
- }),
3715
3771
  z.object({
3716
3772
  type: z.literal("report"),
3717
3773
  report: storedReportSchema.nullable().optional()
3718
3774
  }),
3775
+ z.object({
3776
+ type: z.literal("reports"),
3777
+ reports: z.array(deviceReportSchema)
3778
+ }),
3779
+ z.object({
3780
+ type: z.literal("device"),
3781
+ device: z.string().min(1).nullable().optional()
3782
+ }),
3719
3783
  z.object({
3720
3784
  type: z.literal("work"),
3721
3785
  work: workSchema
@@ -3880,7 +3944,12 @@ z.discriminatedUnion("kind", [
3880
3944
  z.strictObject({
3881
3945
  kind: z.literal("user_stream"),
3882
3946
  conversation: z.string(),
3883
- stream: z.string()
3947
+ stream: z.string(),
3948
+ device: z.string().nullable().optional()
3949
+ }),
3950
+ z.strictObject({
3951
+ kind: z.literal("debug"),
3952
+ resume: z.string().nullable().optional()
3884
3953
  }),
3885
3954
  z.strictObject({ kind: z.literal("starter") }),
3886
3955
  z.strictObject({
@@ -3944,7 +4013,7 @@ z.object({
3944
4013
  /**
3945
4014
  * What a login waits for (`crates/provider-claude-code/src/account.rs`): it is
3946
4015
  * `preparing` from its start, and `waiting_for_user` once it has a link or
3947
- * a code to show. A Claude sign-in waits for the Claude Code machine, for
4016
+ * a code to show. A Claude sign-in waits for the Subscriptions machine, for
3948
4017
  * the CLI's install and for the CLI's start in between.
3949
4018
  */
3950
4019
  const loginStageSchema = z.enum([
@@ -4409,9 +4478,18 @@ const portMessageSchema = z.discriminatedUnion("type", [
4409
4478
  operation: nativeOperationSchema,
4410
4479
  args: z.record(z.string(), z.json()),
4411
4480
  input: z.string().optional(),
4412
- kind: callKindSchema
4481
+ kind: callKindSchema,
4482
+ device: z.string().min(1).nullable().optional()
4483
+ }),
4484
+ z.strictObject({
4485
+ type: z.literal("read_report"),
4486
+ device: z.string().min(1).nullable().optional()
4487
+ }),
4488
+ z.strictObject({ type: z.literal("read_reports") }),
4489
+ z.strictObject({
4490
+ type: z.literal("read_device"),
4491
+ device: z.string().min(1).nullable().optional()
4413
4492
  }),
4414
- z.strictObject({ type: z.literal("read_report") }),
4415
4493
  z.strictObject({
4416
4494
  type: z.literal("write_report"),
4417
4495
  device: z.string(),
@@ -4448,7 +4526,8 @@ const portMessageSchema = z.discriminatedUnion("type", [
4448
4526
  z.strictObject({
4449
4527
  type: z.literal("mirror_work_tabs"),
4450
4528
  kind: z.string(),
4451
- tabs: z.array(createWorkTabSchema)
4529
+ tabs: z.array(createWorkTabSchema),
4530
+ device: z.string().min(1).nullable().optional()
4452
4531
  }),
4453
4532
  z.strictObject({
4454
4533
  type: z.literal("read_secret"),
@@ -4585,11 +4664,12 @@ const serviceTierSchema = z.object({
4585
4664
  fast: z.boolean()
4586
4665
  });
4587
4666
  /**
4588
- * How a model takes a reasoning level on the Messages API: `effort`, as
4589
- * Anthropic's adaptive thinking at the level, or `budget`, as the level's
4590
- * number of tokens. The variants carry no doc comments of their own, which
4591
- * would make the schema a union that `jush providers models` cannot take as
4592
- * an option.
4667
+ * How a model takes a reasoning level on the Messages API and on Gemini's
4668
+ * `generateContent`: `effort`, as the level itself (Anthropic's adaptive
4669
+ * thinking at the level, Gemini's thinking level of its name), or
4670
+ * `budget`, as the level's number of tokens. The variants carry no doc
4671
+ * comments of their own, which would make the schema a union that
4672
+ * `jush providers models` cannot take as an option.
4593
4673
  */
4594
4674
  const thinkingFormSchema = z.enum(["effort", "budget"]);
4595
4675
  /** One model of a catalog, as its source describes it. */
@@ -4616,7 +4696,7 @@ const providerModelSchema = z.object({
4616
4696
  supportedThinkingEfforts: z.array(z.string()).nullable(),
4617
4697
  /**
4618
4698
  * Whether thinking can be turned off entirely; a transport that only
4619
- * levels thinking says no.
4699
+ * levels thinking, or a model that always thinks, says no.
4620
4700
  */
4621
4701
  canDisableThinking: z.boolean().nullable(),
4622
4702
  /**
@@ -4628,7 +4708,10 @@ const providerModelSchema = z.object({
4628
4708
  defaultServiceTierId: z.string().nullable(),
4629
4709
  /** Prices as the source reports them. */
4630
4710
  cost: modelCostSchema.nullable(),
4631
- /** On the Messages API, how a reasoning level goes ([`ModelWire`]). */
4711
+ /**
4712
+ * On the Messages API and Gemini's, how a reasoning level goes
4713
+ * ([`ModelWire`]).
4714
+ */
4632
4715
  thinkingForm: thinkingFormSchema.optional(),
4633
4716
  /**
4634
4717
  * On Chat Completions, whether the model's earlier thinking goes back
@@ -5953,7 +6036,7 @@ const catalogModelSchema = z.object({
5953
6036
  supportedThinkingEfforts: z.array(z.string()).nullable(),
5954
6037
  /**
5955
6038
  * Whether thinking can be turned off entirely; a transport that only
5956
- * levels thinking says no.
6039
+ * levels thinking, or a model that always thinks, says no.
5957
6040
  */
5958
6041
  canDisableThinking: z.boolean().nullable(),
5959
6042
  /**
@@ -5965,7 +6048,10 @@ const catalogModelSchema = z.object({
5965
6048
  defaultServiceTierId: z.string().nullable(),
5966
6049
  /** Prices as the source reports them. */
5967
6050
  cost: modelCostSchema.nullable(),
5968
- /** On the Messages API, how a reasoning level goes ([`ModelWire`]). */
6051
+ /**
6052
+ * On the Messages API and Gemini's, how a reasoning level goes
6053
+ * ([`ModelWire`]).
6054
+ */
5969
6055
  thinkingForm: thinkingFormSchema.optional(),
5970
6056
  /**
5971
6057
  * On Chat Completions, whether the model's earlier thinking goes back
@@ -5998,10 +6084,10 @@ const catalogProviderSchema = z.object({
5998
6084
  providerId: z.string().min(1),
5999
6085
  displayName: z.string(),
6000
6086
  /**
6001
- * The command package whose CLI the provider's requests run as a
6087
+ * The name of the subscription's CLI the provider's requests run as a
6002
6088
  * process; null when its requests are HTTP.
6003
6089
  */
6004
- cliPackage: z.string().nullable(),
6090
+ cliName: z.string().nullable(),
6005
6091
  models: z.array(catalogModelSchema),
6006
6092
  /**
6007
6093
  * The image models the entry offers, newest first: a vendor entry's
@@ -6488,8 +6574,8 @@ const configuredModelSchema = z.object({
6488
6574
  /** The service tier the model's Fast is; null for none. */
6489
6575
  fastTier: z.string().min(1).nullable(),
6490
6576
  /**
6491
- * On the Messages API, how a reasoning level goes; Effort when absent,
6492
- * what every model stored before it was sent.
6577
+ * On the Messages API and Gemini's, how a reasoning level goes; Effort
6578
+ * when absent, what every model stored before it was sent.
6493
6579
  */
6494
6580
  thinkingForm: thinkingFormSchema.optional(),
6495
6581
  /**
@@ -6941,6 +7027,16 @@ const conversationFilesSchema = z.object({
6941
7027
  cacheBytes: z.int().min(0),
6942
7028
  lastUsedAt: z.iso.datetime({ precision: 3 }).nullable()
6943
7029
  });
7030
+ /** How one top-level field of a value changed. */
7031
+ const fieldChangeSchema = z.discriminatedUnion("kind", [z.object({
7032
+ kind: z.literal("set"),
7033
+ value: z.json()
7034
+ }), z.object({
7035
+ kind: z.literal("splice"),
7036
+ at: z.int().min(0).max(4294967295),
7037
+ remove: z.int().min(0).max(4294967295),
7038
+ insert: z.array(z.json())
7039
+ })]);
6944
7040
  /**
6945
7041
  * A message saved for later as the composer lists it. Its whole text is
6946
7042
  * `GET /conversations/:id/saved/:messageId`, read when the message is used.
@@ -7086,6 +7182,12 @@ const conversationFrameSchema = z.discriminatedUnion("type", [
7086
7182
  metadata: conversationMetadataSchema,
7087
7183
  etag: z.string()
7088
7184
  }),
7185
+ z.object({
7186
+ type: z.literal("metadata_changed"),
7187
+ base: z.string(),
7188
+ etag: z.string(),
7189
+ fields: z.record(z.string(), fieldChangeSchema)
7190
+ }),
7089
7191
  z.object({
7090
7192
  type: z.literal("draft"),
7091
7193
  draft: conversationDraftSchema
@@ -7319,6 +7421,12 @@ const preferencesSchema = z.object({
7319
7421
  */
7320
7422
  locale: browserLocaleSchema.optional(),
7321
7423
  /**
7424
+ * The time zone and languages commands run in, which a program sets, in
7425
+ * place of what the user's browser reported; none follows the
7426
+ * browser's. A page never writes it.
7427
+ */
7428
+ commandLocale: commandLocaleSchema.optional(),
7429
+ /**
7322
7430
  * The color scheme the user's page last reported showing, which the
7323
7431
  * conversation browser starts with.
7324
7432
  */
@@ -7531,10 +7639,10 @@ const providerDetailsSchema = z.object({
7531
7639
  quota: quotaSnapshotSchema.nullable(),
7532
7640
  quotaCapability: quotaCapabilitySchema,
7533
7641
  /**
7534
- * The command package whose CLI the provider's requests run as a
7535
- * process, such as `jush.claude-code`; null when its requests are HTTP.
7642
+ * The name of the subscription's CLI the provider's requests run as a
7643
+ * process, such as `Claude Code`; null when its requests are HTTP.
7536
7644
  */
7537
- cliPackage: z.string().nullable()
7645
+ cliName: z.string().nullable()
7538
7646
  });
7539
7647
  /** What the backend read of an entry's provider when it answered. */
7540
7648
  const providerReadingSchema = z.discriminatedUnion("type", [providerDetailsSchema.extend({ type: z.literal("read") }), z.object({
@@ -7606,6 +7714,11 @@ const providerStateSchema = z.object({
7606
7714
  */
7607
7715
  connectsThrough: z.boolean(),
7608
7716
  /**
7717
+ * Whether its vendor's terms forbid its subscription through
7718
+ * third-party software, which Settings says before an account is added.
7719
+ */
7720
+ forbidsThirdParty: z.boolean(),
7721
+ /**
7609
7722
  * The headers every request of the entry carries: a compatible entry's
7610
7723
  * in the user's order, and for a vendor entry each one its vendor
7611
7724
  * documents, with an empty value when it sends none. Empty for a
@@ -7616,7 +7729,7 @@ const providerStateSchema = z.object({
7616
7729
  details: providerReadingSchema,
7617
7730
  /**
7618
7731
  * The user's last install of the entry's command-line tool on the
7619
- * Claude Code machine that no conversation asked for, since the backend
7732
+ * Subscriptions machine that no conversation asked for, since the backend
7620
7733
  * started; null before one. The backend announces each change, so a
7621
7734
  * page follows an install without asking.
7622
7735
  */
@@ -8247,6 +8360,64 @@ z.strictObject({
8247
8360
  email: z.email().max(254),
8248
8361
  password: z.string().min(1)
8249
8362
  });
8363
+ /** What a run came to. */
8364
+ const runOutcomeSchema = z.discriminatedUnion("kind", [
8365
+ z.strictObject({
8366
+ kind: z.literal("returned"),
8367
+ value: z.json()
8368
+ }),
8369
+ z.strictObject({
8370
+ kind: z.literal("threw"),
8371
+ name: z.string(),
8372
+ message: z.string(),
8373
+ stack: z.string().nullable().optional()
8374
+ }),
8375
+ z.strictObject({
8376
+ kind: z.literal("too_large"),
8377
+ bytes: z.int().min(0).max(4294967295)
8378
+ })
8379
+ ]);
8380
+ /** What a debugged page is, as it says. */
8381
+ const pageFactsSchema = z.strictObject({
8382
+ /** The page load's ID, which a reload makes anew. */
8383
+ id: z.string(),
8384
+ /** Its path, query and fragment. */
8385
+ url: z.string(),
8386
+ title: z.string(),
8387
+ /** The tab is the one its window shows, and the window is not minimized. */
8388
+ visible: z.boolean(),
8389
+ /** The build of the web app the page loaded. */
8390
+ build: z.string()
8391
+ });
8392
+ z.discriminatedUnion("type", [
8393
+ z.strictObject({
8394
+ type: z.literal("ran"),
8395
+ id: z.int().min(0).max(4294967295),
8396
+ outcome: runOutcomeSchema
8397
+ }),
8398
+ z.strictObject({
8399
+ type: z.literal("described"),
8400
+ id: z.int().min(0).max(4294967295),
8401
+ page: pageFactsSchema
8402
+ }),
8403
+ z.strictObject({ type: z.literal("stop") })
8404
+ ]);
8405
+ z.discriminatedUnion("type", [
8406
+ z.object({
8407
+ type: z.literal("started"),
8408
+ token: z.string(),
8409
+ expiresAt: z.iso.datetime({ precision: 3 })
8410
+ }),
8411
+ z.object({
8412
+ type: z.literal("run"),
8413
+ id: z.int().min(0).max(4294967295),
8414
+ source: z.string()
8415
+ }),
8416
+ z.object({
8417
+ type: z.literal("describe"),
8418
+ id: z.int().min(0).max(4294967295)
8419
+ })
8420
+ ]);
8250
8421
  /** The user's answer to a request. */
8251
8422
  const permissionDecisionSchema = z.enum(["allow", "deny"]);
8252
8423
  /**
@@ -8892,7 +9063,10 @@ const modelMatchSchema = z.object({
8892
9063
  thinkingEfforts: z.array(z.string()),
8893
9064
  /** The types the model reads natively: `[]` for none, null when unknown. */
8894
9065
  acceptedExtensions: z.array(fileExtensionSchema).nullable(),
8895
- /** How a reasoning level goes on the Messages API, from the record. */
9066
+ /**
9067
+ * How a reasoning level goes on the Messages API and Gemini's, from the
9068
+ * record.
9069
+ */
8896
9070
  thinkingForm: thinkingFormSchema,
8897
9071
  /**
8898
9072
  * Whether its earlier thinking goes back on Chat Completions, from the
@@ -9200,6 +9374,11 @@ z.strictObject({
9200
9374
  * refused.
9201
9375
  */
9202
9376
  locale: browserLocaleSchema.optional(),
9377
+ /**
9378
+ * The time zone and languages commands run in; null follows the
9379
+ * browser's report again. Checked as `locale` is.
9380
+ */
9381
+ commandLocale: commandLocaleSchema.nullable().optional(),
9203
9382
  /** The color scheme the user's page shows. */
9204
9383
  colorScheme: colorSchemeSchema.optional(),
9205
9384
  /** What Enter does with a message while the agent works. */
@@ -9616,6 +9795,11 @@ const providerDtoSchema = z.object({
9616
9795
  */
9617
9796
  connectsThrough: z.boolean(),
9618
9797
  /**
9798
+ * Whether its vendor's terms forbid its subscription through
9799
+ * third-party software, which Settings says before an account is added.
9800
+ */
9801
+ forbidsThirdParty: z.boolean(),
9802
+ /**
9619
9803
  * The headers every request of the entry carries: a compatible entry's
9620
9804
  * in the user's order, and for a vendor entry each one its vendor
9621
9805
  * documents, with an empty value when it sends none. Empty for a
@@ -10303,7 +10487,12 @@ const subscriptionFamilySchema = z.object({
10303
10487
  * Whether its entry may connect through one of its owner's devices,
10304
10488
  * which Settings offers as Connect Through.
10305
10489
  */
10306
- connectsThrough: z.boolean()
10490
+ connectsThrough: z.boolean(),
10491
+ /**
10492
+ * Whether its vendor's terms forbid it through third-party software,
10493
+ * which Settings says before an account is added.
10494
+ */
10495
+ forbidsThirdParty: z.boolean()
10307
10496
  });
10308
10497
  z.strictObject({
10309
10498
  providerType: z.string().min(1),
@@ -10589,7 +10778,8 @@ z.strictObject({
10589
10778
  disabled: z.boolean().nullable().optional(),
10590
10779
  cloudStorage: cloudStorageSchema.nullable().optional()
10591
10780
  });
10592
- z.object({ preferences: preferencesSchema });
10781
+ /** `{ preferences }`: the answer of `GET` and `PATCH /settings/preferences`. */
10782
+ const userPreferencesSchema = z.object({ preferences: preferencesSchema });
10593
10783
  /**
10594
10784
  * `GET /users`: every account, in the order they were created, and whether
10595
10785
  * their Cloud Storage bounds their Clouds, which the isolation the master
@@ -10640,6 +10830,7 @@ const workChangeSchema = z.discriminatedUnion("op", [
10640
10830
  op: z.literal("create"),
10641
10831
  id: z.string().min(1),
10642
10832
  kind: z.string().min(1),
10833
+ device: z.string().min(1).optional(),
10643
10834
  data: z.record(z.string(), z.json()),
10644
10835
  index: z.int().min(0).max(64).nullable().optional()
10645
10836
  }),
@@ -11171,6 +11362,12 @@ var ConversationClient = class {
11171
11362
  reopenReads = [];
11172
11363
  /** The revision of the draft the page holds, which the open names. */
11173
11364
  draft;
11365
+ /**
11366
+ * The values the client follows again with no tag, until the backend sends
11367
+ * one whole: a change of it meanwhile is dropped, as the whole one holds it.
11368
+ */
11369
+ refollowing = /* @__PURE__ */ new Set();
11370
+ understands;
11174
11371
  /** Ends the reads when the client is disposed. */
11175
11372
  detached = new AbortController();
11176
11373
  reader;
@@ -11187,6 +11384,7 @@ var ConversationClient = class {
11187
11384
  constructor(connect, options = {}) {
11188
11385
  this.connect = connect;
11189
11386
  this.conversationFrame = options.conversationFrame ?? (() => null);
11387
+ this.understands = options.understands ?? [];
11190
11388
  this.reader = options.reader ?? null;
11191
11389
  this.unapplied = options.unapplied ?? (() => {});
11192
11390
  this.logged = options.logged ?? (() => {});
@@ -11274,7 +11472,8 @@ var ConversationClient = class {
11274
11472
  const opening = {
11275
11473
  type: "open",
11276
11474
  ...draft === void 0 ? {} : { draft },
11277
- ...this.followsOf()
11475
+ ...this.followsOf(),
11476
+ understands: [...this.understands]
11278
11477
  };
11279
11478
  this.logged("lane.followed", {
11280
11479
  values: opening.follows?.length ?? 0,
@@ -11670,6 +11869,7 @@ var ConversationClient = class {
11670
11869
  this.transport = null;
11671
11870
  this.detachTransport();
11672
11871
  transport.close();
11872
+ this.refollowing.clear();
11673
11873
  this.rejectWaiters(error);
11674
11874
  this.emit({
11675
11875
  type: "disconnected",
@@ -11867,7 +12067,30 @@ var ConversationClient = class {
11867
12067
  if (!parsed.success) {
11868
12068
  const take = this.conversationFrame(frame);
11869
12069
  if (take) {
11870
- if (take.tagged) this.tags[take.tagged.value] = take.tagged.tag;
12070
+ if (take.refollow) {
12071
+ const { value, reason } = take.refollow;
12072
+ if (!this.refollowing.has(value)) {
12073
+ this.logged("read.again", {
12074
+ value,
12075
+ reason
12076
+ });
12077
+ this.tags[value] = "";
12078
+ this.refollowing.add(value);
12079
+ this.sendFrame({
12080
+ type: "follow",
12081
+ value: { kind: value },
12082
+ holds: {
12083
+ kind: "tag",
12084
+ tag: ""
12085
+ }
12086
+ });
12087
+ }
12088
+ return;
12089
+ }
12090
+ if (take.tagged) {
12091
+ this.tags[take.tagged.value] = take.tagged.tag;
12092
+ this.refollowing.delete(take.tagged.value);
12093
+ }
11871
12094
  take.apply();
11872
12095
  return;
11873
12096
  }
@@ -13968,7 +14191,7 @@ function leaf(definition) {
13968
14191
  /** The plugin `definition` defines. */
13969
14192
  function definePlugin(definition) {
13970
14193
  const commands = Object.entries(definition.commands ?? {}).map(([name, group]) => ({
13971
- placement: "jush",
14194
+ placement: group.placement ?? "jush",
13972
14195
  tree: groupNode(name, group),
13973
14196
  calls: []
13974
14197
  }));
@@ -14517,6 +14740,14 @@ var Core = class {
14517
14740
  };
14518
14741
  }
14519
14742
  /**
14743
+ * Changes what `patch` names of the core's preferences, the web app's
14744
+ * Settings, and answers them, such as `commandLocale`, the time zone and
14745
+ * languages its commands and browsers run in.
14746
+ */
14747
+ async updatePreferences(patch) {
14748
+ return (await this.routes.json("PATCH", "/settings/preferences", userPreferencesSchema, patch)).preferences;
14749
+ }
14750
+ /**
14520
14751
  * Answers `request` with the core's route it names below `base`, such as
14521
14752
  * `/jush/api/conversations` below `/jush/api`, as the program's server
14522
14753
  * forwards a page's request.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jush-agent/sdk",
3
3
  "description": "Jush's agents in a program: its cores, conversations, providers, devices and plugins, in a process of the program's own.",
4
- "version": "0.2.6254",
4
+ "version": "0.2.6325",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "exports": {
@@ -35,11 +35,11 @@
35
35
  "homepage": "https://github.com/jush-ai/jush/tree/main/packages/sdk#readme",
36
36
  "bugs": "https://github.com/jush-ai/jush/issues",
37
37
  "optionalDependencies": {
38
- "@jush-agent/sdk-darwin-arm64": "0.2.6254",
39
- "@jush-agent/sdk-darwin-x64": "0.2.6254",
40
- "@jush-agent/sdk-linux-arm64": "0.2.6254",
41
- "@jush-agent/sdk-linux-x64": "0.2.6254",
42
- "@jush-agent/sdk-win32-arm64": "0.2.6254",
43
- "@jush-agent/sdk-win32-x64": "0.2.6254"
38
+ "@jush-agent/sdk-darwin-arm64": "0.2.6325",
39
+ "@jush-agent/sdk-darwin-x64": "0.2.6325",
40
+ "@jush-agent/sdk-linux-arm64": "0.2.6325",
41
+ "@jush-agent/sdk-linux-x64": "0.2.6325",
42
+ "@jush-agent/sdk-win32-arm64": "0.2.6325",
43
+ "@jush-agent/sdk-win32-x64": "0.2.6325"
44
44
  }
45
45
  }