@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/README.md +40 -1
- package/dist/index.d.mts +1760 -11
- package/dist/index.mjs +276 -45
- 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/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Jush's agents in your program. The SDK starts `jush-core`, the process your
|
|
4
4
|
program's cores run in, and gives your program the cores, their
|
|
5
5
|
conversations, providers and devices, and plugins of your own whose commands
|
|
6
|
-
the agents run
|
|
6
|
+
the agents run, under `jush` or by names of their own.
|
|
7
7
|
|
|
8
8
|
A core is one Jush: its conversations, provider entries, devices and
|
|
9
9
|
settings, kept in a directory you choose. A team bot, for example, opens one
|
|
@@ -216,6 +216,25 @@ for (const listed of core.state.devices) {
|
|
|
216
216
|
}
|
|
217
217
|
```
|
|
218
218
|
|
|
219
|
+
### The language and time zone of the agents' work
|
|
220
|
+
|
|
221
|
+
Commands run in the time zone and languages of the browser that last
|
|
222
|
+
showed the core's pages, and in `en-US` and UTC before one did. A
|
|
223
|
+
conversation's browser starts in them: a site shows its text in that
|
|
224
|
+
language, and a page its times in that zone. A new schedule counts in that
|
|
225
|
+
zone too. Set them for the core's work with `commandLocale`, which no page
|
|
226
|
+
changes:
|
|
227
|
+
|
|
228
|
+
```ts
|
|
229
|
+
await core.updatePreferences({ commandLocale: { timeZone: 'Asia/Shanghai', languages: ['zh-CN'] } })
|
|
230
|
+
// Back to what the pages' browser reports:
|
|
231
|
+
await core.updatePreferences({ commandLocale: null })
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
A conversation's browser takes them as it starts, as it takes the color
|
|
235
|
+
scheme: one already open keeps its own until it starts again, after its
|
|
236
|
+
last tab closed.
|
|
237
|
+
|
|
219
238
|
### Scripts outside a conversation
|
|
220
239
|
|
|
221
240
|
`device.exec(script, options)` runs a script on a paired device as the agent's
|
|
@@ -525,6 +544,26 @@ each command's `summary`, input and `output` are its `--help`.
|
|
|
525
544
|
names the one it needs: the conversation then asks before the command
|
|
526
545
|
runs.
|
|
527
546
|
|
|
547
|
+
A group is under `jush` unless it says `placement: 'root'`, which makes it a
|
|
548
|
+
command of the shell, run by its own name: with the plugin above at the
|
|
549
|
+
root, the agent and every process its commands start run `chat send`, and
|
|
550
|
+
`chat --help` shows it, as `jush` shows its own. Name it after your program:
|
|
551
|
+
the core refuses `jush`, a name another plugin takes, and the names of shell
|
|
552
|
+
words and common tools, such as `ls`, `git` or `node`; a device leaves out a
|
|
553
|
+
command whose name its own shell answers, such as `history`, and keeps the
|
|
554
|
+
rest.
|
|
555
|
+
|
|
556
|
+
```ts
|
|
557
|
+
commands: {
|
|
558
|
+
acme: {
|
|
559
|
+
placement: 'root',
|
|
560
|
+
summary: "Acme's tickets",
|
|
561
|
+
index: 'Files and reads Acme tickets.',
|
|
562
|
+
commands: { ticket: { summary: 'Tickets', commands: { create: leaf({ /* … */ }) } } },
|
|
563
|
+
},
|
|
564
|
+
},
|
|
565
|
+
```
|
|
566
|
+
|
|
528
567
|
A plugin can also add a context block before each request (`context`),
|
|
529
568
|
search a conversation's project (`projectSearch`), and follow conversations
|
|
530
569
|
being deleted or forked.
|