@jush-agent/sdk 0.2.6254 → 0.2.6320
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.d.mts +1417 -8
- package/dist/index.mjs +254 -43
- package/package.json +7 -7
- package/release/commands/jush-browser/descriptor.json +13 -13
- package/release/commands/jush-fetch/descriptor.json +13 -13
- package/release/commands/jush-file/descriptor.json +13 -13
- package/release/commands/jush-mobile/descriptor.json +13 -13
- package/release/commands/jush-subscription-cli/descriptor.json +35 -0
- package/release/commands/jush-claude-code/descriptor.json +0 -35
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
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
|
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
|
|
4589
|
-
*
|
|
4590
|
-
*
|
|
4591
|
-
*
|
|
4592
|
-
*
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
@@ -7531,10 +7633,10 @@ const providerDetailsSchema = z.object({
|
|
|
7531
7633
|
quota: quotaSnapshotSchema.nullable(),
|
|
7532
7634
|
quotaCapability: quotaCapabilitySchema,
|
|
7533
7635
|
/**
|
|
7534
|
-
* The
|
|
7535
|
-
* process, such as `
|
|
7636
|
+
* The name of the subscription's CLI the provider's requests run as a
|
|
7637
|
+
* process, such as `Claude Code`; null when its requests are HTTP.
|
|
7536
7638
|
*/
|
|
7537
|
-
|
|
7639
|
+
cliName: z.string().nullable()
|
|
7538
7640
|
});
|
|
7539
7641
|
/** What the backend read of an entry's provider when it answered. */
|
|
7540
7642
|
const providerReadingSchema = z.discriminatedUnion("type", [providerDetailsSchema.extend({ type: z.literal("read") }), z.object({
|
|
@@ -7606,6 +7708,11 @@ const providerStateSchema = z.object({
|
|
|
7606
7708
|
*/
|
|
7607
7709
|
connectsThrough: z.boolean(),
|
|
7608
7710
|
/**
|
|
7711
|
+
* Whether its vendor's terms forbid its subscription through
|
|
7712
|
+
* third-party software, which Settings says before an account is added.
|
|
7713
|
+
*/
|
|
7714
|
+
forbidsThirdParty: z.boolean(),
|
|
7715
|
+
/**
|
|
7609
7716
|
* The headers every request of the entry carries: a compatible entry's
|
|
7610
7717
|
* in the user's order, and for a vendor entry each one its vendor
|
|
7611
7718
|
* documents, with an empty value when it sends none. Empty for a
|
|
@@ -7616,7 +7723,7 @@ const providerStateSchema = z.object({
|
|
|
7616
7723
|
details: providerReadingSchema,
|
|
7617
7724
|
/**
|
|
7618
7725
|
* The user's last install of the entry's command-line tool on the
|
|
7619
|
-
*
|
|
7726
|
+
* Subscriptions machine that no conversation asked for, since the backend
|
|
7620
7727
|
* started; null before one. The backend announces each change, so a
|
|
7621
7728
|
* page follows an install without asking.
|
|
7622
7729
|
*/
|
|
@@ -8247,6 +8354,64 @@ z.strictObject({
|
|
|
8247
8354
|
email: z.email().max(254),
|
|
8248
8355
|
password: z.string().min(1)
|
|
8249
8356
|
});
|
|
8357
|
+
/** What a run came to. */
|
|
8358
|
+
const runOutcomeSchema = z.discriminatedUnion("kind", [
|
|
8359
|
+
z.strictObject({
|
|
8360
|
+
kind: z.literal("returned"),
|
|
8361
|
+
value: z.json()
|
|
8362
|
+
}),
|
|
8363
|
+
z.strictObject({
|
|
8364
|
+
kind: z.literal("threw"),
|
|
8365
|
+
name: z.string(),
|
|
8366
|
+
message: z.string(),
|
|
8367
|
+
stack: z.string().nullable().optional()
|
|
8368
|
+
}),
|
|
8369
|
+
z.strictObject({
|
|
8370
|
+
kind: z.literal("too_large"),
|
|
8371
|
+
bytes: z.int().min(0).max(4294967295)
|
|
8372
|
+
})
|
|
8373
|
+
]);
|
|
8374
|
+
/** What a debugged page is, as it says. */
|
|
8375
|
+
const pageFactsSchema = z.strictObject({
|
|
8376
|
+
/** The page load's ID, which a reload makes anew. */
|
|
8377
|
+
id: z.string(),
|
|
8378
|
+
/** Its path, query and fragment. */
|
|
8379
|
+
url: z.string(),
|
|
8380
|
+
title: z.string(),
|
|
8381
|
+
/** The tab is the one its window shows, and the window is not minimized. */
|
|
8382
|
+
visible: z.boolean(),
|
|
8383
|
+
/** The build of the web app the page loaded. */
|
|
8384
|
+
build: z.string()
|
|
8385
|
+
});
|
|
8386
|
+
z.discriminatedUnion("type", [
|
|
8387
|
+
z.strictObject({
|
|
8388
|
+
type: z.literal("ran"),
|
|
8389
|
+
id: z.int().min(0).max(4294967295),
|
|
8390
|
+
outcome: runOutcomeSchema
|
|
8391
|
+
}),
|
|
8392
|
+
z.strictObject({
|
|
8393
|
+
type: z.literal("described"),
|
|
8394
|
+
id: z.int().min(0).max(4294967295),
|
|
8395
|
+
page: pageFactsSchema
|
|
8396
|
+
}),
|
|
8397
|
+
z.strictObject({ type: z.literal("stop") })
|
|
8398
|
+
]);
|
|
8399
|
+
z.discriminatedUnion("type", [
|
|
8400
|
+
z.object({
|
|
8401
|
+
type: z.literal("started"),
|
|
8402
|
+
token: z.string(),
|
|
8403
|
+
expiresAt: z.iso.datetime({ precision: 3 })
|
|
8404
|
+
}),
|
|
8405
|
+
z.object({
|
|
8406
|
+
type: z.literal("run"),
|
|
8407
|
+
id: z.int().min(0).max(4294967295),
|
|
8408
|
+
source: z.string()
|
|
8409
|
+
}),
|
|
8410
|
+
z.object({
|
|
8411
|
+
type: z.literal("describe"),
|
|
8412
|
+
id: z.int().min(0).max(4294967295)
|
|
8413
|
+
})
|
|
8414
|
+
]);
|
|
8250
8415
|
/** The user's answer to a request. */
|
|
8251
8416
|
const permissionDecisionSchema = z.enum(["allow", "deny"]);
|
|
8252
8417
|
/**
|
|
@@ -8892,7 +9057,10 @@ const modelMatchSchema = z.object({
|
|
|
8892
9057
|
thinkingEfforts: z.array(z.string()),
|
|
8893
9058
|
/** The types the model reads natively: `[]` for none, null when unknown. */
|
|
8894
9059
|
acceptedExtensions: z.array(fileExtensionSchema).nullable(),
|
|
8895
|
-
/**
|
|
9060
|
+
/**
|
|
9061
|
+
* How a reasoning level goes on the Messages API and Gemini's, from the
|
|
9062
|
+
* record.
|
|
9063
|
+
*/
|
|
8896
9064
|
thinkingForm: thinkingFormSchema,
|
|
8897
9065
|
/**
|
|
8898
9066
|
* Whether its earlier thinking goes back on Chat Completions, from the
|
|
@@ -9616,6 +9784,11 @@ const providerDtoSchema = z.object({
|
|
|
9616
9784
|
*/
|
|
9617
9785
|
connectsThrough: z.boolean(),
|
|
9618
9786
|
/**
|
|
9787
|
+
* Whether its vendor's terms forbid its subscription through
|
|
9788
|
+
* third-party software, which Settings says before an account is added.
|
|
9789
|
+
*/
|
|
9790
|
+
forbidsThirdParty: z.boolean(),
|
|
9791
|
+
/**
|
|
9619
9792
|
* The headers every request of the entry carries: a compatible entry's
|
|
9620
9793
|
* in the user's order, and for a vendor entry each one its vendor
|
|
9621
9794
|
* documents, with an empty value when it sends none. Empty for a
|
|
@@ -10303,7 +10476,12 @@ const subscriptionFamilySchema = z.object({
|
|
|
10303
10476
|
* Whether its entry may connect through one of its owner's devices,
|
|
10304
10477
|
* which Settings offers as Connect Through.
|
|
10305
10478
|
*/
|
|
10306
|
-
connectsThrough: z.boolean()
|
|
10479
|
+
connectsThrough: z.boolean(),
|
|
10480
|
+
/**
|
|
10481
|
+
* Whether its vendor's terms forbid it through third-party software,
|
|
10482
|
+
* which Settings says before an account is added.
|
|
10483
|
+
*/
|
|
10484
|
+
forbidsThirdParty: z.boolean()
|
|
10307
10485
|
});
|
|
10308
10486
|
z.strictObject({
|
|
10309
10487
|
providerType: z.string().min(1),
|
|
@@ -10640,6 +10818,7 @@ const workChangeSchema = z.discriminatedUnion("op", [
|
|
|
10640
10818
|
op: z.literal("create"),
|
|
10641
10819
|
id: z.string().min(1),
|
|
10642
10820
|
kind: z.string().min(1),
|
|
10821
|
+
device: z.string().min(1).optional(),
|
|
10643
10822
|
data: z.record(z.string(), z.json()),
|
|
10644
10823
|
index: z.int().min(0).max(64).nullable().optional()
|
|
10645
10824
|
}),
|
|
@@ -11171,6 +11350,12 @@ var ConversationClient = class {
|
|
|
11171
11350
|
reopenReads = [];
|
|
11172
11351
|
/** The revision of the draft the page holds, which the open names. */
|
|
11173
11352
|
draft;
|
|
11353
|
+
/**
|
|
11354
|
+
* The values the client follows again with no tag, until the backend sends
|
|
11355
|
+
* one whole: a change of it meanwhile is dropped, as the whole one holds it.
|
|
11356
|
+
*/
|
|
11357
|
+
refollowing = /* @__PURE__ */ new Set();
|
|
11358
|
+
understands;
|
|
11174
11359
|
/** Ends the reads when the client is disposed. */
|
|
11175
11360
|
detached = new AbortController();
|
|
11176
11361
|
reader;
|
|
@@ -11187,6 +11372,7 @@ var ConversationClient = class {
|
|
|
11187
11372
|
constructor(connect, options = {}) {
|
|
11188
11373
|
this.connect = connect;
|
|
11189
11374
|
this.conversationFrame = options.conversationFrame ?? (() => null);
|
|
11375
|
+
this.understands = options.understands ?? [];
|
|
11190
11376
|
this.reader = options.reader ?? null;
|
|
11191
11377
|
this.unapplied = options.unapplied ?? (() => {});
|
|
11192
11378
|
this.logged = options.logged ?? (() => {});
|
|
@@ -11274,7 +11460,8 @@ var ConversationClient = class {
|
|
|
11274
11460
|
const opening = {
|
|
11275
11461
|
type: "open",
|
|
11276
11462
|
...draft === void 0 ? {} : { draft },
|
|
11277
|
-
...this.followsOf()
|
|
11463
|
+
...this.followsOf(),
|
|
11464
|
+
understands: [...this.understands]
|
|
11278
11465
|
};
|
|
11279
11466
|
this.logged("lane.followed", {
|
|
11280
11467
|
values: opening.follows?.length ?? 0,
|
|
@@ -11670,6 +11857,7 @@ var ConversationClient = class {
|
|
|
11670
11857
|
this.transport = null;
|
|
11671
11858
|
this.detachTransport();
|
|
11672
11859
|
transport.close();
|
|
11860
|
+
this.refollowing.clear();
|
|
11673
11861
|
this.rejectWaiters(error);
|
|
11674
11862
|
this.emit({
|
|
11675
11863
|
type: "disconnected",
|
|
@@ -11867,7 +12055,30 @@ var ConversationClient = class {
|
|
|
11867
12055
|
if (!parsed.success) {
|
|
11868
12056
|
const take = this.conversationFrame(frame);
|
|
11869
12057
|
if (take) {
|
|
11870
|
-
if (take.
|
|
12058
|
+
if (take.refollow) {
|
|
12059
|
+
const { value, reason } = take.refollow;
|
|
12060
|
+
if (!this.refollowing.has(value)) {
|
|
12061
|
+
this.logged("read.again", {
|
|
12062
|
+
value,
|
|
12063
|
+
reason
|
|
12064
|
+
});
|
|
12065
|
+
this.tags[value] = "";
|
|
12066
|
+
this.refollowing.add(value);
|
|
12067
|
+
this.sendFrame({
|
|
12068
|
+
type: "follow",
|
|
12069
|
+
value: { kind: value },
|
|
12070
|
+
holds: {
|
|
12071
|
+
kind: "tag",
|
|
12072
|
+
tag: ""
|
|
12073
|
+
}
|
|
12074
|
+
});
|
|
12075
|
+
}
|
|
12076
|
+
return;
|
|
12077
|
+
}
|
|
12078
|
+
if (take.tagged) {
|
|
12079
|
+
this.tags[take.tagged.value] = take.tagged.tag;
|
|
12080
|
+
this.refollowing.delete(take.tagged.value);
|
|
12081
|
+
}
|
|
11871
12082
|
take.apply();
|
|
11872
12083
|
return;
|
|
11873
12084
|
}
|
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.
|
|
4
|
+
"version": "0.2.6320",
|
|
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.
|
|
39
|
-
"@jush-agent/sdk-darwin-x64": "0.2.
|
|
40
|
-
"@jush-agent/sdk-linux-arm64": "0.2.
|
|
41
|
-
"@jush-agent/sdk-linux-x64": "0.2.
|
|
42
|
-
"@jush-agent/sdk-win32-arm64": "0.2.
|
|
43
|
-
"@jush-agent/sdk-win32-x64": "0.2.
|
|
38
|
+
"@jush-agent/sdk-darwin-arm64": "0.2.6320",
|
|
39
|
+
"@jush-agent/sdk-darwin-x64": "0.2.6320",
|
|
40
|
+
"@jush-agent/sdk-linux-arm64": "0.2.6320",
|
|
41
|
+
"@jush-agent/sdk-linux-x64": "0.2.6320",
|
|
42
|
+
"@jush-agent/sdk-win32-arm64": "0.2.6320",
|
|
43
|
+
"@jush-agent/sdk-win32-x64": "0.2.6320"
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "jush.browser",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6320",
|
|
4
4
|
"protocolVersion": 1,
|
|
5
5
|
"operations": [
|
|
6
6
|
"browser.tab.new",
|
|
@@ -60,28 +60,28 @@
|
|
|
60
60
|
],
|
|
61
61
|
"targets": {
|
|
62
62
|
"aarch64-apple-darwin": {
|
|
63
|
-
"sha256": "
|
|
64
|
-
"size":
|
|
63
|
+
"sha256": "496840cadab7bf4aff21dbe2fcd3643e31bcc48c167312d6bb743a358c733923",
|
|
64
|
+
"size": 28309664
|
|
65
65
|
},
|
|
66
66
|
"aarch64-pc-windows-msvc": {
|
|
67
|
-
"sha256": "
|
|
68
|
-
"size":
|
|
67
|
+
"sha256": "4831ac7169797fd7d1a68d38fa5e618a2f7e607c133b511ff363a9a41bd68adb",
|
|
68
|
+
"size": 25744384
|
|
69
69
|
},
|
|
70
70
|
"aarch64-unknown-linux-musl": {
|
|
71
|
-
"sha256": "
|
|
72
|
-
"size":
|
|
71
|
+
"sha256": "fe8430a25a3d1a8938257323bf4b3e1da5ec6b6e15ff9104d2f7dbb35a63b825",
|
|
72
|
+
"size": 24357296
|
|
73
73
|
},
|
|
74
74
|
"x86_64-apple-darwin": {
|
|
75
|
-
"sha256": "
|
|
76
|
-
"size":
|
|
75
|
+
"sha256": "02fb08166ba517f5e45f14da94dcc7be18845a5146e699177475cf85105cb05e",
|
|
76
|
+
"size": 28840960
|
|
77
77
|
},
|
|
78
78
|
"x86_64-pc-windows-msvc": {
|
|
79
|
-
"sha256": "
|
|
80
|
-
"size":
|
|
79
|
+
"sha256": "386c80d081c2b673eb1b0356a9d59f1dfcea10d664a6ea70f076472aba8d750a",
|
|
80
|
+
"size": 28680704
|
|
81
81
|
},
|
|
82
82
|
"x86_64-unknown-linux-musl": {
|
|
83
|
-
"sha256": "
|
|
84
|
-
"size":
|
|
83
|
+
"sha256": "5099d746eaa67283c5642b3e580381944825ae1d7ea2913c9460ca90109200e1",
|
|
84
|
+
"size": 26732280
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
}
|