@dsh-teamwork/dsh-teamwork 0.8.3 → 0.9.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.
@@ -0,0 +1,180 @@
1
+ # Developer reference
2
+
3
+ [User documentation](README.md) covers installation and workflows. This file
4
+ owns build commands, runtime contracts, phone protocols and release operations.
5
+
6
+ ## Build and verify
7
+
8
+ Use Node.js compatible with the host and pnpm 9.15.9 from `packageManager`.
9
+
10
+ ```sh
11
+ pnpm install --frozen-lockfile
12
+ pnpm build
13
+ pnpm typecheck
14
+ pnpm test
15
+ ```
16
+
17
+ `build` compiles `src/` into committed `lib/`, declarations into `lib/types/`,
18
+ and the browser bundle into `lib/web/client.js`. The browser bundle embeds the
19
+ workspace `@dsh-teamwork/ui` components and takes React from DSH. Its ownership
20
+ rules are in [ui/README.md](../ui/README.md).
21
+
22
+ DSH core services are peer dependencies supplied by the host. Development
23
+ versions are pinned to rc.3 and Zod to 4.6.6 to avoid recursive type expansion
24
+ across mismatched versions. Never add `@deepseek-ai/dsh-*` to runtime dependencies:
25
+ hoisted installations can shadow the upgraded host even when the plugin is disabled.
26
+
27
+ The real-host suites install the packed plugin in temporary profiles and use
28
+ an isolated local fixture registry and package store:
29
+
30
+ ```sh
31
+ npm install --prefix /tmp/dsh-test-runtime --no-package-lock @deepseek-ai/dsh@0.2.2-rc.3
32
+ export DSH_CLI=/tmp/dsh-test-runtime/node_modules/@deepseek-ai/dsh/lib/bin.js
33
+ pnpm test:host
34
+ pnpm test:presets
35
+ pnpm test:assistant
36
+ ```
37
+
38
+ CI repeats this on DSH rc.1, rc.2 and rc.3 on Linux. Windows-safe argument
39
+ packing is covered by the archive tests; that is not a Windows Desktop GUI test.
40
+ The fixture profile sets `npm_config_ignore_workspace_root_check=true` for its
41
+ own workspace root. Successful runs clean up; failures retain diagnostics that
42
+ can contain a local browser token. Do not publish raw host logs.
43
+
44
+ ## Host and browser boundary
45
+
46
+ The package declares `dsh.bundle.patch` and `dsh.client`, exporting its browser
47
+ entry as `./client`. `cordis.patch.yml` inserts one root entry. A manual development
48
+ patch uses `insert` with an absolute path to `lib/index.js`; normal installations
49
+ load the package's patch automatically and must not duplicate that entry.
50
+
51
+ `src/panel.ts` defines `/api/teamwork/*`. The browser calls these host routes;
52
+ DSH admits only its owner. The platform token remains in the host. Commands and
53
+ panel actions reuse operations. Session continuation/retry/cancellation are commands.
54
+ State polls wait for the previous request, failures preserve the displayed data,
55
+ and dependency inventory is shared only within one state request.
56
+
57
+ The server selection persists beside the cache as `<cache>.server.json`.
58
+ Changing it clears old identity/resources. Tokens are memory-only. Configuration
59
+ caches use private file permissions and atomic replacement. Periodic/manual sync
60
+ requests coalesce; unload stops timers and waits before releasing registrations.
61
+ 401/403 clear team resources and suspend automatic sync. Network/schema failures
62
+ retain the previous snapshot. Sync never installs plugins or uploads conversations.
63
+
64
+ ## Models and preset generations
65
+
66
+ Team models use `teamwork-platform` with the configuration ID as wire model.
67
+ `src/platform-models.ts` adapts text, tool calls and streamed output to the chosen
68
+ service's `/api/llm/chat/completions`. There is no provider-direct fallback or
69
+ local provider-key lookup. Model capability values come from team configuration;
70
+ missing context/output limits use 32K/4096, with output bounded by context.
71
+ Multimodal input and other provider protocols are not implemented by this adapter.
72
+
73
+ Presets use native `agentPresets` registration, mounting, selection and revisions.
74
+ A preset has one of inherited selection, same-team model reference, or legacy
75
+ explicit provider/model. Human-readable instructions/output notes are not system
76
+ instructions; behavior belongs in `systemPrompt`. Team prompts are additive.
77
+ Required tools and pinned plugin dependencies are checked when selecting and
78
+ before team inference; optional tools warn. Tool registration is not permission.
79
+ Package-to-tool ownership is declared by the team, not inferred from DSH.
80
+
81
+ Started sessions keep their native generation. `<cache>.sessions.json` privately
82
+ records team/preset/version stamps instead of adding unknown events to DSH logs.
83
+ A restored session with an incompatible stamp is blocked; historical deleted
84
+ preset definitions are not reconstructed. Unstamped/forked sessions are stamped
85
+ on first inference. A pinned revision does not freeze current server permissions,
86
+ routing or budgets.
87
+
88
+ Task summaries use native session projections; `teamworkStep` gives the phone's
89
+ session list a running turn's tool-call count and the latest call's target (its
90
+ first line, at most 120 characters, never file contents). Follow-up/recovery checks model,
91
+ team access, generations and dependencies before admission. Retry confirms a new
92
+ recovery instruction for failed/blocked/cancelled/truncated/interrupted work; it
93
+ never replays tools. Queued/guidance input is not bypassed. Cancellation keeps
94
+ inbox/file changes; concurrent or cancelled preparation cannot dispatch a new turn.
95
+ Errors report bounded categories without upstream response bodies.
96
+
97
+ ## Assistant and private resources
98
+
99
+ Tools bind to the active preset's team and current account epoch. DSH's actual
100
+ approval pipeline gates mutations, even in permissive sessions. Review reads
101
+ frozen server contents and checks revisions. Provider secrets and initial account
102
+ passwords use the console's forms. Server membership/role checks remain authoritative.
103
+
104
+ Local packages are prepared without lifecycle scripts and inspected before upload.
105
+ After review, private downloads authenticate to the service, verify SHA-256 and
106
+ persist a private content-addressed archive before installing disabled and checking
107
+ conflicts. Exact historical pins remain installable. Existing local plugins use
108
+ the host's separate update flow. See the community server's
109
+ [resource contract](https://github.com/dsh-teamwork/dsh-teamwork-platform/blob/main/docs/tech/team-assistant.md).
110
+
111
+ ## Host-provided token
112
+
113
+ `tokenFile` (`src/token-file.ts`) is for hosts that sign DSH in themselves, such
114
+ as a DSH Teamwork cloud computer, where a supervisor writes a short-lived token
115
+ after DSH has booted. The file is polled once a second with `watchFile`, which
116
+ sees an atomic replacement that a directory watch can miss, and only a changed
117
+ value reaches `TeamworkClient.useToken`. Renewing one token with another keeps
118
+ the session revision, so pending approvals and preset stamps survive renewal;
119
+ gaining or losing a token moves it, and losing one drops the cache. A 401/403
120
+ still clears the token until the file changes. In this mode the relay is never
121
+ opened, and sign-in, sign-out and server changes are refused: the server reaches
122
+ a cloud computer itself, and the token belongs to the host, not a member.
123
+
124
+ ## Phone transport
125
+
126
+ The hosted relay is optional and discovered through `GET /api/relay`. The host
127
+ connects out over WebSocket using its in-memory token and `<cache>.host.json`
128
+ identity. Logout disconnects it. Only confirmed pairings can reach allowlisted
129
+ DSH calls. Headless-only hosts return 503. Pairing is account/host-wide, not
130
+ limited by the panel's team filter. Model selection changes a session, not the
131
+ computer's default. Notifications omit conversation/question contents and session IDs.
132
+
133
+ Phone and desktop pin Ed25519 identities and authenticate through libp2p Noise XX.
134
+ A single-use six-letter locator and matching eight-digit safety codes establish
135
+ trust, with phone confirmation and desktop approval. QR links pin the desktop
136
+ public key. Missing/changed keys require new pairing; plaintext has no fallback.
137
+ After Noise authentication, endpoints exchange independent AES-256 sending keys.
138
+ Payloads use native AES-256-GCM (Node/OpenSSL and Expo Crypto), authenticating the
139
+ channel, direction and monotonic counter. Replay, reordering, cipher failure and
140
+ exhausted key budgets close the channel. The relay sees metadata, timing and
141
+ sizes but cannot read encrypted request content. Team gateway model traffic is
142
+ outside this channel. Upgrade relay and both clients together.
143
+
144
+ `src/secure-channel.ts` matches the mobile implementation, checked by integration
145
+ tests. `src/phone-security.ts` gates every request on the local roster.
146
+ `<cache>.phone-keys.json` atomically stores the identity seed and account/server
147
+ peers with restrictive permissions. Desktop revocation saves trust removal and
148
+ closes the channel before notifying the relay; phone revocation needs an encrypted
149
+ acknowledgement and can wait for an offline host.
150
+
151
+ File intake uses `teamwork/uploadStart`, `uploadChunk`, `uploadFinish` and
152
+ `uploadCancel` after native admission. Receipt/transfer identity binds pairing and
153
+ session. Staging works during a busy/unavailable model; prompt readiness is checked
154
+ on send. Budgets: five files, 20 MiB each, 50 MiB total, 256 KiB chunks, one active
155
+ transfer per pairing and two per host. Idle/total expiry is 60 seconds/five minutes;
156
+ completed receipts expire after ten minutes. Cancellation/revocation release
157
+ transfer state, not stored DSH objects or workspace files. Native file receipts and
158
+ stable request IDs support deduplication. Ordinary files are supported; image input
159
+ and document extraction are not implemented in this slice.
160
+
161
+ ## Publishing
162
+
163
+ Update `package.json`, build and commit the matching `lib/`, and merge reviewed
164
+ changes to main. A matching `v<version>` tag runs `.github/workflows/publish.yaml`:
165
+ its package job builds, verifies committed output, tests and packs; the protected
166
+ stage job verifies the exact SHA-256 and uses trusted OIDC publishing with lifecycle
167
+ scripts disabled. No npm token is stored in the repository.
168
+
169
+ A maintainer completes npm 2FA approval with `npm stage approve <stage-id>` after
170
+ checking `npm stage list`. A staged package is not public. `PUBLISHING=off` pauses
171
+ staging. The npm Trusted Publisher points at this repository, workflow and
172
+ `npm-release` environment. Run `npm pack --ignore-scripts --dry-run --json` to inspect the file list for
173
+ both READMEs, guides and images.
174
+
175
+ Keep `screenshots.json` to 1–8 relative GitHub-hosted images. Public catalog entries
176
+ belong in Awesome DSH's `data/plugins/<owner>__<repo>.yml`; never edit its generated
177
+ README or add an `npm:` key. dsh.so's existing entry is
178
+ [dsh-teamwork-2](https://www.dsh.so/artifact/dsh-teamwork-2/); update that record
179
+ rather than the unrelated same-name repository. Community verification remains
180
+ the community's own result, not this project's CI status.
@@ -0,0 +1,175 @@
1
+ # Using DSH Teamwork
2
+
3
+ [README](../../README.md) · [简体中文](../zh-CN/guide.md)
4
+
5
+ Connect a DSH host to your team's service, sync resources, then choose a preset
6
+ for a new conversation. Teamwork resources are additive: local configuration
7
+ and local default models remain independent.
8
+
9
+ ## Installation and updates
10
+
11
+ Use the desktop application's **Plugins → Add plugin** for a Desktop profile.
12
+ For a CLI web profile use `dsh plugin --profile web add @dsh-teamwork/dsh-teamwork`.
13
+ Use the same profile's plugin manager for updates, enabling and diagnostics.
14
+ Follow its reload/restart prompts.
15
+
16
+ - **Version rejected:** check the installed plugin and DSH versions. The declared
17
+ range is `>=0.2.2-rc.1 <0.3.0-0`; CI covers rc.1, rc.2 and rc.3. Install a
18
+ compatible published version. A range is a declaration, not a test of every
19
+ future release.
20
+ - **A new release is not selected:** some hosts apply a minimum release age.
21
+ Select an exact version that is already visible on the
22
+ [npm versions page](https://www.npmjs.com/package/@dsh-teamwork/dsh-teamwork?activeTab=versions).
23
+ A version in GitHub's main branch may still await npm publication.
24
+ - **Build scripts await a decision:** pnpm 11 can stop for dependency scripts.
25
+ Use your host's build review. In an isolated Linux CLI check, explicitly
26
+ denying the `@google/genai` and `protobufjs` scripts allowed installation and
27
+ the basic integration checks to pass. This is separate from DSH compatibility.
28
+ - **Installed, but missing in Desktop:** a `web` CLI install does not change
29
+ Desktop's profile. Install through the application.
30
+ - **DSH fails after an older plugin install:** earlier packages could install
31
+ their own DSH core dependencies into a hoisted profile. Back up the profile,
32
+ upgrade the plugin and reinstall the profile dependencies using the host's
33
+ recovery flow. Disabling the old plugin alone does not remove those packages.
34
+
35
+ ## Sign in and select a team
36
+
37
+ Open Teamwork and choose the browser sign-in action. The plugin starts a
38
+ loopback callback for up to ten minutes. If the callback is inaccessible,
39
+ copy the authorization line shown by the service into the panel or DSH command
40
+ input. The one-use authorization code expires after two minutes.
41
+
42
+ Authorization immediately syncs resources; by default the plugin refreshes
43
+ every 60 seconds. Use the team selector to browse one team or all teams.
44
+ Browsing another team does not retarget an existing conversation or restrict
45
+ phone pairing to that team. A person may belong to several teams.
46
+
47
+ Create or join teams in the web console. New teams receive a built-in assistant;
48
+ existing teams are unchanged. Team renaming does not automatically rename the
49
+ assistant. Use its preset with a working model and ask it to inspect real state.
50
+
51
+ ## Choose a model or preset
52
+
53
+ Use **New session** for a team preset. **Use in current session** works only
54
+ before the conversation begins. Started sessions keep their preset generation;
55
+ use a new session to adopt an update. A restart cannot promise to reconstruct a
56
+ deleted old preset: a version mismatch blocks team inference and gives recovery
57
+ guidance.
58
+
59
+ Required tools and pinned plugin dependencies must be available. Optional
60
+ missing tools are warnings. A registered tool still follows DSH's authorization
61
+ and runtime conditions. Team model routes go through your service; a preset
62
+ that inherits a local model keeps that model instead.
63
+
64
+ ## Share, review and restore
65
+
66
+ 1. Ask the team assistant to prepare a plugin inside the session workspace,
67
+ or submit a preset/plugin through **Sharing and review** in the web console.
68
+ 2. Review the prepared package identity, version, file list and SHA-256 before
69
+ upload. Preparation does not run package lifecycle scripts.
70
+ 3. Submit the new resource or update for administrator review. An update names
71
+ the existing configuration and its base version.
72
+ 4. An administrator inspects the frozen contents and approves or rejects them.
73
+ A conflicting newer publication requires a fresh submission.
74
+ 5. Members sync the published resource. A plugin still needs a separate local
75
+ installation confirmation; existing local packages are not silently upgraded.
76
+
77
+ Members see their own submissions. Administrators see the team's submissions.
78
+ Assistant writes also need host approval, including for administrators.
79
+ Provider secrets and new account passwords belong in the console's forms.
80
+
81
+ **Versions and backups** shows publication time, author/approver, changes and
82
+ retained versions. Exported resources can include retained private plugin bytes.
83
+ A restoration prepares a new publication for review; it does not erase history
84
+ or replace a running conversation's preset. A resource export is distinct from
85
+ a full database-and-artifact backup managed by the server operator.
86
+
87
+ ![Publication history of a demonstration team](../../assets/readme/versions-and-backups.png)
88
+
89
+ ## Commands
90
+
91
+ Run these in DSH's command input, not your shell. IDs come from `/teamwork list`.
92
+
93
+ | Command | Purpose |
94
+ | --- | --- |
95
+ | `/teamwork login` | Open browser authorization. |
96
+ | `/teamwork authorize <code>` | Redeem a fallback authorization code. |
97
+ | `/teamwork status` | Show authentication, sync status and recent errors. |
98
+ | `/teamwork sync` | Refresh the team's resources. |
99
+ | `/teamwork list` | List configuration IDs. |
100
+ | `/teamwork info [id]` | Inspect active or available preset details and readiness. |
101
+ | `/teamwork new <id>` | Create a session from the latest preset without starting a task. |
102
+ | `/teamwork use <id>` | Select a team resource in a blank session. |
103
+ | `/teamwork tools` | Inspect visible tool names and conditions. |
104
+ | `/teamwork plugins [presetId]` | Check published plugin dependencies. |
105
+ | `/teamwork install <id>[@<version>]` | Preview an exact plugin installation; repeat with `confirm` after inspection. |
106
+ | `/teamwork session [check]` | Inspect session state; `check` refreshes team access/readiness. |
107
+ | `/teamwork continue <instruction>` | Send follow-up input after readiness checks. |
108
+ | `/teamwork cancel` | Request native cancellation; keep the inbox and existing file changes. |
109
+ | `/teamwork retry` | Preview recovery; `retry confirm` sends a recovery instruction, not tool replay. |
110
+ | `/teamwork logout` | Drop the in-memory token, team cache and team registrations. |
111
+
112
+ Continue and retry do not jump ahead of queued input. A confirmation expires
113
+ when its session, model, configuration or login binding changes. Logout leaves
114
+ explicitly installed plugins in place. Removed members are refused by the
115
+ server on their next request.
116
+
117
+ ## Configuration
118
+
119
+ The default server is `https://www.dshteamwork.com`. Change it on the sign-in
120
+ screen to a self-hosted server. HTTPS is required except on loopback. Changing
121
+ servers signs you out and clears the previous server's team resources.
122
+
123
+ Advanced profile configuration can override the inserted plugin entry:
124
+
125
+ ```yaml
126
+ - id: dsh-teamwork
127
+ config:
128
+ apiEndpoint: https://teamwork.example.com
129
+ cachePath: /absolute/path/to/private/teamwork-cache.json
130
+ autoSync: true
131
+ syncIntervalMs: 60000
132
+ ```
133
+
134
+ `syncIntervalMs` accepts integer milliseconds from 10000 to 86400000.
135
+ `autoSync: false` disables login-triggered and periodic sync; manual sync remains.
136
+
137
+ A host that signs DSH in itself, such as a DSH Teamwork cloud computer, sets
138
+ `tokenFile` to the absolute path of a file holding a plugin token. The plugin
139
+ reads it at start and follows every change, including an atomic replacement;
140
+ an empty or missing file signs it out. In this mode sign-in, sign-out and
141
+ changing servers are refused, `apiEndpoint` names the server, and the phone
142
+ relay is never opened.
143
+ Do not duplicate the package's `insert` entry in a profile.
144
+
145
+ ## Data and phone access
146
+
147
+ Tokens stay in host memory; restart requires sign-in. Team configuration is
148
+ cached with private file permissions. A stale cache is not authorization.
149
+ Network failures preserve it; 401/403 clear team registrations and suspend sync
150
+ until sign-in. Provider keys remain on the service; team-model prompts and
151
+ context travel through that service's gateway.
152
+
153
+ The hosted service may advertise a relay. A matching Teamwork App and an online
154
+ DSH web/desktop host are required. Headless-only hosts return 503 for phone
155
+ requests. The community edition does not supply the hosted relay.
156
+
157
+ Pairing requires matching account identity, checking the safety code on both
158
+ devices and approval on the computer. It authorizes the owner's permitted
159
+ personal and team sessions on this DSH, across teams. It grants no additional
160
+ team permissions. A private, authenticated encrypted channel protects phone
161
+ requests and ordinary file attachments; the relay can still see account/device
162
+ metadata, public keys, timing and sizes. The team-model gateway is a separate
163
+ boundary. Both endpoints must be on matching protocol versions.
164
+
165
+ Pairing keys persist locally. Changed or missing trusted keys require pairing
166
+ again. Desktop revocation closes the channel immediately; phone-side revocation
167
+ needs the computer's encrypted acknowledgement and may wait for reconnection.
168
+
169
+ ## Getting help
170
+
171
+ Use `/teamwork status`, the local plugin manager and your server's console.
172
+ Include DSH/plugin versions, OS, profile type, package-manager version and
173
+ redacted diagnostics in an [issue](https://github.com/dsh-teamwork/dsh-teamwork/issues).
174
+ Remove tokens, authorization lines, pairing codes, provider keys and private
175
+ team data before posting. [Developer details](../development.md) cover tests and protocols.
@@ -0,0 +1,102 @@
1
+ # 使用 DSH Teamwork
2
+
3
+ [中文 README](../../README.zh-CN.md) · [English](../en/guide.md)
4
+
5
+ 连接团队服务、同步资源,再为新会话选择预设。团队资源以增量方式加入 DSH,本地配置和默认模型继续独立使用。
6
+
7
+ ## 安装与更新
8
+
9
+ 桌面版从应用内 **Plugins → Add plugin** 安装;CLI web profile 使用
10
+ `dsh plugin --profile web add @dsh-teamwork/dsh-teamwork`。更新、启用及诊断也应通过同一个 profile 的插件管理器,遵循宿主的重载/重启提示。
11
+
12
+ - **版本被拒绝:**核对 DSH 与插件版本。声明范围为 `>=0.2.2-rc.1 <0.3.0-0`,CI 覆盖 rc.1、rc.2、rc.3。选择兼容且已发布的插件版本;范围声明不代表实测过所有未来版本。
13
+ - **没有选到刚发布的版本:**部分宿主应用最短发布时间策略。可在 [npm 版本页](https://www.npmjs.com/package/@dsh-teamwork/dsh-teamwork?activeTab=versions)核实后指定精确版本。GitHub main 中的版本可能仍在等待 npm 发布。
14
+ - **构建脚本等待处理:**pnpm 11 可能因依赖脚本暂停安装,使用宿主的构建审核流程。本地隔离 Linux CLI 检查中,明确拒绝 `@google/genai`、`protobufjs` 的脚本后,安装和基础集成检查通过;这与 DSH 版本兼容检查是两件事。
15
+ - **安装成功但桌面版没有出现:**CLI 的 `web` profile 不属于桌面应用,应在应用内安装。
16
+ - **旧版安装后 DSH 启动失败:**早期插件可能把自己的 DSH 核心包安装到 hoisted profile,覆盖升级后的宿主。先备份 profile,通过宿主恢复流程升级插件并重新安装依赖;仅停用旧插件不会清除这些包。
17
+
18
+ ## 登录与选择团队
19
+
20
+ 在 Teamwork 中选择浏览器登录。插件会启动最多十分钟的本机回传监听;无法回传时,把网页显示的授权行粘贴到面板或 DSH 命令输入框。一次性授权码有效期为两分钟。
21
+
22
+ 授权完成后立即同步,默认每 60 秒刷新。用团队下拉框浏览一个或所有团队;改变浏览范围不改变已有会话的目标团队,也不能把手机授权限制到这个团队。一个账号可以加入多个团队。
23
+
24
+ 在网页控制台创建或加入团队。新团队会获得内置助理,已有团队不自动补建;重命名团队不会自动重命名助理。为助理预设选择可用模型后,要求它读取真实状态再操作。
25
+
26
+ ## 选择模型或预设
27
+
28
+ 使用“新建会话”应用团队预设。“用于当前会话”仅适用于尚未开始对话的会话。已开始的会话保留原预设代次,使用新会话采用更新。跨重启不保证重建已删除的旧预设;发现版本不一致时会阻止团队推理并给出恢复指引。
29
+
30
+ 必需工具和固定版本的插件依赖必须就绪,可选工具缺失只提示。工具已注册仍须满足 DSH 授权与运行条件。团队模型经过团队服务;继承本地模型的预设继续使用所继承的模型。
31
+
32
+ ## 分享、审批与恢复
33
+
34
+ 1. 让团队助理准备会话工作区内的插件,或在网页“分享与审批”中提交插件/预设。
35
+ 2. 上传前检查包名、版本、文件清单和 SHA-256。准备包时不运行生命周期脚本。
36
+ 3. 提交新增或更新;更新须关联现有配置及其基础版本。
37
+ 4. 管理员检查冻结内容并批准或拒绝;如已有更新版本发布,需要重新提交。
38
+ 5. 成员同步已发布资源。插件仍需本机安装确认,不会静默升级已有本地包。
39
+
40
+ 成员查看自己的提交,管理员查看团队提交。管理员通过助理写入时也需要宿主审批。供应商密钥和新账号密码通过网页安全表单输入。
41
+
42
+ “版本与备份”显示发布时间、作者/审批人、变更和保留版本。导出资源可包含保留的私有插件文件;恢复会准备一个新的待审核发布,不会抹去历史或替换运行中会话的预设。资源导出不同于运维人员管理的完整数据库与插件文件备份。
43
+
44
+ ![演示团队的发布历史;网页可切换中文](../../assets/readme/versions-and-backups.png)
45
+
46
+ ## 命令
47
+
48
+ 在 DSH 命令输入框中运行,不是在系统 shell 中。ID 可通过 `/teamwork list` 查看。
49
+
50
+ | 命令 | 用途 |
51
+ | --- | --- |
52
+ | `/teamwork login` | 打开浏览器授权。 |
53
+ | `/teamwork authorize <code>` | 兑换备用授权码。 |
54
+ | `/teamwork status` | 查看登录、同步和最近错误。 |
55
+ | `/teamwork sync` | 刷新团队资源。 |
56
+ | `/teamwork list` | 列出配置 ID。 |
57
+ | `/teamwork info [id]` | 检查当前或可选预设的说明与就绪状态。 |
58
+ | `/teamwork new <id>` | 从最新预设创建会话,不直接启动任务。 |
59
+ | `/teamwork use <id>` | 在空白会话中选择团队资源。 |
60
+ | `/teamwork tools` | 查看可见工具名和条件。 |
61
+ | `/teamwork plugins [presetId]` | 检查已发布插件依赖。 |
62
+ | `/teamwork install <id>[@<version>]` | 预览精确版本安装,检查后追加 `confirm` 确认。 |
63
+ | `/teamwork session [check]` | 查看会话状态;`check` 额外刷新团队权限和就绪状态。 |
64
+ | `/teamwork continue <instruction>` | 检查后发送后续指令。 |
65
+ | `/teamwork cancel` | 请求原生取消,保留待处理输入与已产生的文件修改。 |
66
+ | `/teamwork retry` | 预览恢复;`retry confirm` 发送恢复指令,不重放工具调用。 |
67
+ | `/teamwork logout` | 丢弃内存令牌、团队缓存与注册。 |
68
+
69
+ 继续和重试不会插队;会话、模型、配置或登录身份变化会使确认失效。退出不卸载明确安装过的插件;被移除成员的下一次服务端请求将被拒绝。
70
+
71
+ ## 配置
72
+
73
+ 默认服务器为 `https://www.dshteamwork.com`,可在登录页改为自建服务。除本机回环地址外须使用 HTTPS。切换服务器会退出登录并清除旧服务器的团队资源。
74
+
75
+ 高级 profile 配置可覆盖已插入的插件条目:
76
+
77
+ ```yaml
78
+ - id: dsh-teamwork
79
+ config:
80
+ apiEndpoint: https://teamwork.example.com
81
+ cachePath: /absolute/path/to/private/teamwork-cache.json
82
+ autoSync: true
83
+ syncIntervalMs: 60000
84
+ ```
85
+
86
+ `syncIntervalMs` 接受 10000–86400000 之间的整数毫秒。`autoSync: false` 关闭登录触发与定时同步,手动同步仍可用。不要重复复制包内的 `insert` 条目。
87
+
88
+ 由宿主自行为 DSH 登录的环境(例如 DSH Teamwork 云电脑)可以把 `tokenFile` 设为一个文件的绝对路径,文件内容是插件令牌。插件启动时读取它,并跟随之后的每次变化(包括原子替换);文件为空或不存在即视为退出登录。此模式下不能在插件里登录、退出或切换服务器,服务器由 `apiEndpoint` 指定,也不会连接手机中转。
89
+
90
+ ## 数据与手机连接
91
+
92
+ 令牌只在宿主内存中保存,重启需要登录;团队配置以私有文件权限缓存。旧缓存不是登录授权。网络失败时保留缓存;401/403 会清除团队注册并暂停同步,等待重新登录。供应商密钥保留在服务端,团队模型的提示词与上下文经过其网关。
93
+
94
+ 托管服务可提供中转,需要匹配的 Teamwork App 与在线的 DSH web/桌面宿主。仅启动 headless 的主机对手机请求返回 503;社区版不提供托管中转。
95
+
96
+ 配对需要相同账号、两端核对安全码并在电脑批准。配对可访问本机账号有权限的个人和各团队会话,不增加团队权限。私有认证加密通道保护手机请求与普通附件;中转仍可见账号/设备元数据、公钥、时间和大小。团队模型网关是另一条数据边界;两端须使用匹配协议版本。
97
+
98
+ 配对密钥保存在本机。信任密钥变化或丢失时需要重新配对。电脑解除配对会立即关闭通道;手机端解除需要电脑的加密确认,离线电脑需要重新连线。
99
+
100
+ ## 获取帮助
101
+
102
+ 查看 `/teamwork status`、本地插件管理器和团队服务控制台。向 [Issues](https://github.com/dsh-teamwork/dsh-teamwork/issues) 提供 DSH/插件版本、系统、profile 类型、包管理器版本和脱敏诊断。公开前移除令牌、授权行、配对码、供应商密钥及私有团队数据。构建、测试及协议见[开发参考](../development.md)。
package/icon.svg CHANGED
@@ -1,4 +1,7 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 400 400">
2
- <rect width="400" height="400" fill="#1E2F6D"/>
3
- <path fill="#F8F5EF" d="M206.84 178.37L203.20 176.51L197.50 174.07L191.54 172.04L185.35 170.41L178.93 169.17L172.31 168.32L165.50 167.86L158.53 167.77L151.41 168.06L144.16 168.72L136.80 169.75L129.35 171.13L121.82 172.87L114.23 174.96L109.15 176.54L98.77 180.09L95.30 181.17L90.18 182.60L86.83 183.42L81.88 184.48L77.03 185.31L72.29 185.93L67.65 186.34L61.63 186.57L57.23 186.50L51.52 186.10L47.35 185.57L41.96 184.58L36.75 183.26L31.71 181.62L34.49 185.76L37.47 189.81L40.64 193.76L44.00 197.60L47.54 201.33L51.26 204.95L55.15 208.44L59.21 211.81L63.44 215.04L67.84 218.14L72.39 221.10L77.09 223.91L81.95 226.57L86.95 229.08L94.72 232.53L102.79 235.59L111.15 238.26L119.80 240.51L125.70 241.78L134.78 243.30L140.96 244.06L144.09 244.36L173.55 246.46L180.99 247.20L187.94 248.12L194.39 249.29L200.32 250.79L203.07 251.68L205.68 252.68L209.32 254.39L212.63 256.39L215.59 258.72L218.18 261.38L219.71 263.37L223.20 305.34L228.75 306.83L233.12 307.74L237.50 308.33L241.25 308.55L245.00 308.50L249.38 308.10L253.75 307.35L258.75 306.16L268.56 303.21L246.40 256.22L246.73 253.74L247.28 251.31L248.06 248.95L249.61 245.50L250.90 243.25L252.39 241.04L254.06 238.85L255.91 236.70L257.94 234.56L260.13 232.43L264.98 228.19L270.41 223.93L277.92 218.50L302.38 201.94L304.94 200.12L309.92 196.37L317.01 190.52L321.49 186.47L327.85 180.20L333.75 173.71L339.20 167.02L344.20 160.15L347.28 155.48L350.15 150.75L352.81 145.96L355.27 141.12L357.52 136.24L359.57 131.33L361.40 126.38L363.02 121.41L364.43 116.42L365.63 111.42L366.61 106.41L367.38 101.41L367.94 96.41L368.27 91.43L364.74 95.37L360.88 99.12L356.71 102.68L353.38 105.22L348.64 108.41L344.87 110.67L339.54 113.49L335.33 115.45L330.91 117.29L326.31 118.98L321.50 120.54L318.18 121.50L313.04 122.82L309.49 123.63L298.73 125.74L293.54 126.91L285.93 128.90L278.54 131.16L271.39 133.69L264.50 136.48L257.89 139.53L253.65 141.71L249.55 144.00L245.59 146.40L239.93 150.20L236.35 152.87L232.93 155.65L228.12 160.01L225.13 163.04L222.32 166.18L218.46 171.06L215.04 176.17L212.07 181.49ZM0.00 299.31L6.29 300.81L19.95 304.97L27.09 306.81L30.85 307.55L34.71 308.11L38.64 308.45L42.44 308.56L45.78 308.48L49.55 308.17L52.80 307.74L56.57 307.06L60.13 306.25L63.75 305.29L76.43 301.42L80.87 300.19L85.96 299.11L90.20 298.63L92.48 298.57L95.22 298.67L97.56 298.92L100.48 299.40L106.29 300.81L119.95 304.97L126.98 306.78L130.85 307.55L134.55 308.09L137.85 308.40L141.64 308.56L145.61 308.49L149.55 308.17L153.42 307.64L157.20 306.93L160.85 306.07L164.44 305.10L179.80 300.47L183.48 299.58L186.92 298.96L190.65 298.61L194.30 298.61L198.04 298.98L202.57 299.84L194.87 271.11L192.61 271.07L189.26 271.14L185.49 271.44L182.24 271.86L178.58 272.51L174.89 273.34L171.27 274.29L157.98 278.34L153.04 279.67L149.99 280.33L147.56 280.72L144.76 280.99L142.48 281.06L140.20 281.00L137.40 280.73L134.98 280.35L131.93 279.70L127.00 278.38L113.68 274.32L109.51 273.23L105.83 272.42L102.03 271.77L98.93 271.39L95.61 271.14L92.44 271.07L88.64 271.18L84.71 271.52L80.85 272.08L77.09 272.82L69.95 274.66L55.73 278.98L49.99 280.33L47.09 280.78L44.76 280.99L42.48 281.06L39.73 280.97L35.96 280.52L31.93 279.70L27.57 278.54L16.42 275.11L10.94 273.58L5.08 272.28L0.00 271.51ZM284.83 299.31L289.73 298.66L292.48 298.57L295.69 298.71L299.01 299.13L302.00 299.72L305.73 300.65L319.95 304.97L327.09 306.81L330.85 307.55L334.71 308.11L338.64 308.45L342.44 308.56L345.78 308.48L349.71 308.16L353.42 307.64L357.31 306.90L364.44 305.10L379.25 300.61L382.97 299.69L385.96 299.11L389.73 298.66L392.93 298.57L396.15 298.75L400.00 299.31L400.00 271.51L395.61 271.14L390.85 271.08L386.27 271.36L381.47 271.98L377.09 272.82L372.66 273.91L367.92 275.26L357.41 278.50L352.52 279.80L347.56 280.72L345.22 280.96L342.93 281.06L340.65 281.02L338.34 280.84L335.96 280.52L332.97 279.94L327.57 278.54L316.46 275.13L311.57 273.75L306.45 272.55L301.11 271.64L297.98 271.30L294.99 271.12L289.43 271.13L283.78 271.64L277.70 272.69Z"/>
4
- </svg>
1
+ <svg width="64" height="64" viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg">
2
+ <rect id="plate" width="400" height="400" fill="#1E2F6D"></rect>
3
+ <path id="mark" fill="#F8F5EF" d="M185.89 163.76C162.65 148.53 128.19 148.57 93.22 161.01C68.77 169.86 48.13 170.02 31.16 163.85C49.59 192.62 84.41 213.93 127.56 217.69C158.83 220.04 182.52 219.82 192.45 234.01L198.98 312.7L249.02 299.3L215.33 227.88C216.83 210.63 237.46 198.97 263.37 181.3C298.85 156.47 318.35 120.6 319.93 86.47C308.32 100.31 290.36 110.48 264.77 115.04C228.26 121.76 198.39 138.96 185.89 163.76Z"/>
4
+ <path id="sea" fill="#111A42" d="M-4 291.5L-2 290.5L0 289.5L2 288.5L4 287.53L6 286.59L8 285.71L10 284.9L12 284.17L14 283.53L16 282.99L18 282.56L20 282.25L22 282.06L24 282L26 282.06L28 282.25L30 282.56L32 282.99L34 283.53L36 284.17L38 284.9L40 285.71L42 286.59L44 287.53L46 288.5L48 289.5L50 290.5L52 291.5L54 292.47L56 293.41L58 294.29L60 295.1L62 295.83L64 296.47L66 297.01L68 297.44L70 297.75L72 297.94L74 298L76 297.94L78 297.75L80 297.44L82 297.01L84 296.47L86 295.83L88 295.1L90 294.29L92 293.41L94 292.47L96 291.5L98 290.5L100 289.5L102 288.5L104 287.53L106 286.59L108 285.71L110 284.9L112 284.17L114 283.53L116 282.99L118 282.56L120 282.25L122 282.06L124 282L126 282.06L128 282.25L130 282.56L132 282.99L134 283.53L136 284.17L138 284.9L140 285.71L142 286.59L144 287.53L146 288.5L148 289.5L150 290.5L152 291.5L154 292.47L156 293.41L158 294.29L160 295.1L162 295.83L164 296.47L166 297.01L168 297.44L170 297.75L172 297.94L174 298L176 297.94L178 297.75L180 297.44L182 297.01L184 296.47L186 295.83L188 295.1L190 294.29L192 293.41L194 292.47L196 291.5L198 290.5L200 289.5L202 288.5L204 287.53L206 286.59L208 285.71L210 284.9L212 284.17L214 283.53L216 282.99L218 282.56L220 282.25L222 282.06L224 282L226 282.06L228 282.25L230 282.56L232 282.99L234 283.53L236 284.17L238 284.9L240 285.71L242 286.59L244 287.53L246 288.5L248 289.5L250 290.5L252 291.5L254 292.47L256 293.41L258 294.29L260 295.1L262 295.83L264 296.47L266 297.01L268 297.44L270 297.75L272 297.94L274 298L276 297.94L278 297.75L280 297.44L282 297.01L284 296.47L286 295.83L288 295.1L290 294.29L292 293.41L294 292.47L296 291.5L298 290.5L300 289.5L302 288.5L304 287.53L306 286.59L308 285.71L310 284.9L312 284.17L314 283.53L316 282.99L318 282.56L320 282.25L322 282.06L324 282L326 282.06L328 282.25L330 282.56L332 282.99L334 283.53L336 284.17L338 284.9L340 285.71L342 286.59L344 287.53L346 288.5L348 289.5L350 290.5L352 291.5L354 292.47L356 293.41L358 294.29L360 295.1L362 295.83L364 296.47L366 297.01L368 297.44L370 297.75L372 297.94L374 298L376 297.94L378 297.75L380 297.44L382 297.01L384 296.47L386 295.83L388 295.1L390 294.29L392 293.41L394 292.47L396 291.5L398 290.5L400 289.5L402 288.5L404 287.53L404 404L-4 404Z"/>
5
+ <path id="surface" fill="#7B91D4" d="M-6.66 286.12L-4.69 285.14L-2.69 284.13L-0.66 283.12L1.41 282.11L3.52 281.13L5.66 280.19L7.83 279.31L10.05 278.49L12.3 277.77L14.59 277.16L16.91 276.66L19.26 276.3L21.62 276.07L24 276L26.38 276.07L28.74 276.3L31.09 276.66L33.41 277.16L35.7 277.77L37.95 278.49L40.17 279.31L42.34 280.19L44.48 281.13L46.59 282.11L48.66 283.12L50.69 284.13L52.69 285.14L54.66 286.12L56.59 287.06L58.48 287.94L60.34 288.76L62.17 289.5L63.95 290.16L65.7 290.72L67.41 291.18L69.09 291.54L70.74 291.8L72.38 291.95L74 292L75.62 291.95L77.26 291.8L78.91 291.54L80.59 291.18L82.3 290.72L84.05 290.16L85.83 289.5L87.66 288.76L89.52 287.94L91.41 287.06L93.34 286.12L95.31 285.14L97.31 284.13L99.34 283.12L101.41 282.11L103.52 281.13L105.66 280.19L107.83 279.31L110.05 278.49L112.3 277.77L114.59 277.16L116.91 276.66L119.26 276.3L121.62 276.07L124 276L126.38 276.07L128.74 276.3L131.09 276.66L133.41 277.16L135.7 277.77L137.95 278.49L140.17 279.31L142.34 280.19L144.48 281.13L146.59 282.11L148.66 283.12L150.69 284.13L152.69 285.14L154.66 286.12L156.59 287.06L158.48 287.94L160.34 288.76L162.17 289.5L163.95 290.16L165.7 290.72L167.41 291.18L169.09 291.54L170.74 291.8L172.38 291.95L174 292L175.62 291.95L177.26 291.8L178.91 291.54L180.59 291.18L182.3 290.72L184.05 290.16L185.83 289.5L187.66 288.76L189.52 287.94L191.41 287.06L193.34 286.12L195.31 285.14L197.31 284.13L199.34 283.12L201.41 282.11L203.52 281.13L205.66 280.19L207.83 279.31L210.05 278.49L212.3 277.77L214.59 277.16L216.91 276.66L219.26 276.3L221.62 276.07L224 276L226.38 276.07L228.74 276.3L231.09 276.66L233.41 277.16L235.7 277.77L237.95 278.49L240.17 279.31L242.34 280.19L244.48 281.13L246.59 282.11L248.66 283.12L250.69 284.13L252.69 285.14L254.66 286.12L256.59 287.06L258.48 287.94L260.34 288.76L262.17 289.5L263.95 290.16L265.7 290.72L267.41 291.18L269.09 291.54L270.74 291.8L272.38 291.95L274 292L275.62 291.95L277.26 291.8L278.91 291.54L280.59 291.18L282.3 290.72L284.05 290.16L285.83 289.5L287.66 288.76L289.52 287.94L291.41 287.06L293.34 286.12L295.31 285.14L297.31 284.13L299.34 283.12L301.41 282.11L303.52 281.13L305.66 280.19L307.83 279.31L310.05 278.49L312.3 277.77L314.59 277.16L316.91 276.66L319.26 276.3L321.62 276.07L324 276L326.38 276.07L328.74 276.3L331.09 276.66L333.41 277.16L335.7 277.77L337.95 278.49L340.17 279.31L342.34 280.19L344.48 281.13L346.59 282.11L348.66 283.12L350.69 284.13L352.69 285.14L354.66 286.12L356.59 287.06L358.48 287.94L360.34 288.76L362.17 289.5L363.95 290.16L365.7 290.72L367.41 291.18L369.09 291.54L370.74 291.8L372.38 291.95L374 292L375.62 291.95L377.26 291.8L378.91 291.54L380.59 291.18L382.3 290.72L384.05 290.16L385.83 289.5L387.66 288.76L389.52 287.94L391.41 287.06L393.34 286.12L395.31 285.14L397.31 284.13L399.34 283.12L401.41 282.11L406.59 292.94L404.66 293.88L402.69 294.86L400.69 295.87L398.66 296.88L396.59 297.89L394.48 298.87L392.34 299.81L390.17 300.69L387.95 301.51L385.7 302.23L383.41 302.84L381.09 303.34L378.74 303.7L376.38 303.93L374 304L371.62 303.93L369.26 303.7L366.91 303.34L364.59 302.84L362.3 302.23L360.05 301.51L357.83 300.69L355.66 299.81L353.52 298.87L351.41 297.89L349.34 296.88L347.31 295.87L345.31 294.86L343.34 293.88L341.41 292.94L339.52 292.06L337.66 291.24L335.83 290.5L334.05 289.84L332.3 289.28L330.59 288.82L328.91 288.46L327.26 288.2L325.62 288.05L324 288L322.38 288.05L320.74 288.2L319.09 288.46L317.41 288.82L315.7 289.28L313.95 289.84L312.17 290.5L310.34 291.24L308.48 292.06L306.59 292.94L304.66 293.88L302.69 294.86L300.69 295.87L298.66 296.88L296.59 297.89L294.48 298.87L292.34 299.81L290.17 300.69L287.95 301.51L285.7 302.23L283.41 302.84L281.09 303.34L278.74 303.7L276.38 303.93L274 304L271.62 303.93L269.26 303.7L266.91 303.34L264.59 302.84L262.3 302.23L260.05 301.51L257.83 300.69L255.66 299.81L253.52 298.87L251.41 297.89L249.34 296.88L247.31 295.87L245.31 294.86L243.34 293.88L241.41 292.94L239.52 292.06L237.66 291.24L235.83 290.5L234.05 289.84L232.3 289.28L230.59 288.82L228.91 288.46L227.26 288.2L225.62 288.05L224 288L222.38 288.05L220.74 288.2L219.09 288.46L217.41 288.82L215.7 289.28L213.95 289.84L212.17 290.5L210.34 291.24L208.48 292.06L206.59 292.94L204.66 293.88L202.69 294.86L200.69 295.87L198.66 296.88L196.59 297.89L194.48 298.87L192.34 299.81L190.17 300.69L187.95 301.51L185.7 302.23L183.41 302.84L181.09 303.34L178.74 303.7L176.38 303.93L174 304L171.62 303.93L169.26 303.7L166.91 303.34L164.59 302.84L162.3 302.23L160.05 301.51L157.83 300.69L155.66 299.81L153.52 298.87L151.41 297.89L149.34 296.88L147.31 295.87L145.31 294.86L143.34 293.88L141.41 292.94L139.52 292.06L137.66 291.24L135.83 290.5L134.05 289.84L132.3 289.28L130.59 288.82L128.91 288.46L127.26 288.2L125.62 288.05L124 288L122.38 288.05L120.74 288.2L119.09 288.46L117.41 288.82L115.7 289.28L113.95 289.84L112.17 290.5L110.34 291.24L108.48 292.06L106.59 292.94L104.66 293.88L102.69 294.86L100.69 295.87L98.66 296.88L96.59 297.89L94.48 298.87L92.34 299.81L90.17 300.69L87.95 301.51L85.7 302.23L83.41 302.84L81.09 303.34L78.74 303.7L76.38 303.93L74 304L71.62 303.93L69.26 303.7L66.91 303.34L64.59 302.84L62.3 302.23L60.05 301.51L57.83 300.69L55.66 299.81L53.52 298.87L51.41 297.89L49.34 296.88L47.31 295.87L45.31 294.86L43.34 293.88L41.41 292.94L39.52 292.06L37.66 291.24L35.83 290.5L34.05 289.84L32.3 289.28L30.59 288.82L28.91 288.46L27.26 288.2L25.62 288.05L24 288L22.38 288.05L20.74 288.2L19.09 288.46L17.41 288.82L15.7 289.28L13.95 289.84L12.17 290.5L10.34 291.24L8.48 292.06L6.59 292.94L4.66 293.88L2.69 294.86L0.69 295.87L-1.34 296.88Z"/>
6
+ <path id="swell" fill="#2B3F86" d="M-5.18 331.11L-3.2 330.5L-1.2 329.87L0.82 329.24L2.85 328.62L4.91 328.02L6.97 327.45L9.06 326.93L11.16 326.44L13.27 326.02L15.4 325.66L17.54 325.38L19.69 325.17L21.84 325.04L24 325L26.16 325.04L28.31 325.17L30.46 325.38L32.6 325.66L34.73 326.02L36.84 326.44L38.94 326.93L41.03 327.45L43.09 328.02L45.15 328.62L47.18 329.24L49.2 329.87L51.2 330.5L53.18 331.11L55.15 331.71L57.09 332.28L59.03 332.81L60.94 333.3L62.84 333.73L64.73 334.11L66.6 334.43L68.46 334.68L70.31 334.86L72.16 334.96L74 335L75.84 334.96L77.69 334.86L79.54 334.68L81.4 334.43L83.27 334.11L85.16 333.73L87.06 333.3L88.97 332.81L90.91 332.28L92.85 331.71L94.82 331.11L96.8 330.5L98.8 329.87L100.82 329.24L102.85 328.62L104.91 328.02L106.97 327.45L109.06 326.93L111.16 326.44L113.27 326.02L115.4 325.66L117.54 325.38L119.69 325.17L121.84 325.04L124 325L126.16 325.04L128.31 325.17L130.46 325.38L132.6 325.66L134.73 326.02L136.84 326.44L138.94 326.93L141.03 327.45L143.09 328.02L145.15 328.62L147.18 329.24L149.2 329.87L151.2 330.5L153.18 331.11L155.15 331.71L157.09 332.28L159.03 332.81L160.94 333.3L162.84 333.73L164.73 334.11L166.6 334.43L168.46 334.68L170.31 334.86L172.16 334.96L174 335L175.84 334.96L177.69 334.86L179.54 334.68L181.4 334.43L183.27 334.11L185.16 333.73L187.06 333.3L188.97 332.81L190.91 332.28L192.85 331.71L194.82 331.11L196.8 330.5L198.8 329.87L200.82 329.24L202.85 328.62L204.91 328.02L206.97 327.45L209.06 326.93L211.16 326.44L213.27 326.02L215.4 325.66L217.54 325.38L219.69 325.17L221.84 325.04L224 325L226.16 325.04L228.31 325.17L230.46 325.38L232.6 325.66L234.73 326.02L236.84 326.44L238.94 326.93L241.03 327.45L243.09 328.02L245.15 328.62L247.18 329.24L249.2 329.87L251.2 330.5L253.18 331.11L255.15 331.71L257.09 332.28L259.03 332.81L260.94 333.3L262.84 333.73L264.73 334.11L266.6 334.43L268.46 334.68L270.31 334.86L272.16 334.96L274 335L275.84 334.96L277.69 334.86L279.54 334.68L281.4 334.43L283.27 334.11L285.16 333.73L287.06 333.3L288.97 332.81L290.91 332.28L292.85 331.71L294.82 331.11L296.8 330.5L298.8 329.87L300.82 329.24L302.85 328.62L304.91 328.02L306.97 327.45L309.06 326.93L311.16 326.44L313.27 326.02L315.4 325.66L317.54 325.38L319.69 325.17L321.84 325.04L324 325L326.16 325.04L328.31 325.17L330.46 325.38L332.6 325.66L334.73 326.02L336.84 326.44L338.94 326.93L341.03 327.45L343.09 328.02L345.15 328.62L347.18 329.24L349.2 329.87L351.2 330.5L353.18 331.11L355.15 331.71L357.09 332.28L359.03 332.81L360.94 333.3L362.84 333.73L364.73 334.11L366.6 334.43L368.46 334.68L370.31 334.86L372.16 334.96L374 335L375.84 334.96L377.69 334.86L379.54 334.68L381.4 334.43L383.27 334.11L385.16 333.73L387.06 333.3L388.97 332.81L390.91 332.28L392.85 331.71L394.82 331.11L396.8 330.5L398.8 329.87L400.82 329.24L402.85 328.62L405.15 336.29L403.18 336.89L401.2 337.5L399.2 338.13L397.18 338.76L395.15 339.38L393.09 339.98L391.03 340.55L388.94 341.07L386.84 341.56L384.73 341.98L382.6 342.34L380.46 342.62L378.31 342.83L376.16 342.96L374 343L371.84 342.96L369.69 342.83L367.54 342.62L365.4 342.34L363.27 341.98L361.16 341.56L359.06 341.07L356.97 340.55L354.91 339.98L352.85 339.38L350.82 338.76L348.8 338.13L346.8 337.5L344.82 336.89L342.85 336.29L340.91 335.72L338.97 335.19L337.06 334.7L335.16 334.27L333.27 333.89L331.4 333.57L329.54 333.32L327.69 333.14L325.84 333.04L324 333L322.16 333.04L320.31 333.14L318.46 333.32L316.6 333.57L314.73 333.89L312.84 334.27L310.94 334.7L309.03 335.19L307.09 335.72L305.15 336.29L303.18 336.89L301.2 337.5L299.2 338.13L297.18 338.76L295.15 339.38L293.09 339.98L291.03 340.55L288.94 341.07L286.84 341.56L284.73 341.98L282.6 342.34L280.46 342.62L278.31 342.83L276.16 342.96L274 343L271.84 342.96L269.69 342.83L267.54 342.62L265.4 342.34L263.27 341.98L261.16 341.56L259.06 341.07L256.97 340.55L254.91 339.98L252.85 339.38L250.82 338.76L248.8 338.13L246.8 337.5L244.82 336.89L242.85 336.29L240.91 335.72L238.97 335.19L237.06 334.7L235.16 334.27L233.27 333.89L231.4 333.57L229.54 333.32L227.69 333.14L225.84 333.04L224 333L222.16 333.04L220.31 333.14L218.46 333.32L216.6 333.57L214.73 333.89L212.84 334.27L210.94 334.7L209.03 335.19L207.09 335.72L205.15 336.29L203.18 336.89L201.2 337.5L199.2 338.13L197.18 338.76L195.15 339.38L193.09 339.98L191.03 340.55L188.94 341.07L186.84 341.56L184.73 341.98L182.6 342.34L180.46 342.62L178.31 342.83L176.16 342.96L174 343L171.84 342.96L169.69 342.83L167.54 342.62L165.4 342.34L163.27 341.98L161.16 341.56L159.06 341.07L156.97 340.55L154.91 339.98L152.85 339.38L150.82 338.76L148.8 338.13L146.8 337.5L144.82 336.89L142.85 336.29L140.91 335.72L138.97 335.19L137.06 334.7L135.16 334.27L133.27 333.89L131.4 333.57L129.54 333.32L127.69 333.14L125.84 333.04L124 333L122.16 333.04L120.31 333.14L118.46 333.32L116.6 333.57L114.73 333.89L112.84 334.27L110.94 334.7L109.03 335.19L107.09 335.72L105.15 336.29L103.18 336.89L101.2 337.5L99.2 338.13L97.18 338.76L95.15 339.38L93.09 339.98L91.03 340.55L88.94 341.07L86.84 341.56L84.73 341.98L82.6 342.34L80.46 342.62L78.31 342.83L76.16 342.96L74 343L71.84 342.96L69.69 342.83L67.54 342.62L65.4 342.34L63.27 341.98L61.16 341.56L59.06 341.07L56.97 340.55L54.91 339.98L52.85 339.38L50.82 338.76L48.8 338.13L46.8 337.5L44.82 336.89L42.85 336.29L40.91 335.72L38.97 335.19L37.06 334.7L35.16 334.27L33.27 333.89L31.4 333.57L29.54 333.32L27.69 333.14L25.84 333.04L24 333L22.16 333.04L20.31 333.14L18.46 333.32L16.6 333.57L14.73 333.89L12.84 334.27L10.94 334.7L9.03 335.19L7.09 335.72L5.15 336.29L3.18 336.89L1.2 337.5L-0.8 338.13L-2.82 338.76ZM-4.63 367.72L-2.64 367.29L-0.64 366.85L1.37 366.41L3.39 365.98L5.41 365.57L7.45 365.18L9.5 364.81L11.55 364.48L13.62 364.19L15.68 363.95L17.76 363.76L19.84 363.61L21.92 363.53L24 363.5L26.08 363.53L28.16 363.61L30.24 363.76L32.32 363.95L34.38 364.19L36.45 364.48L38.5 364.81L40.55 365.18L42.59 365.57L44.61 365.98L46.63 366.41L48.64 366.85L50.64 367.29L52.63 367.72L54.61 368.15L56.59 368.55L58.55 368.93L60.5 369.27L62.45 369.58L64.38 369.86L66.32 370.08L68.24 370.26L70.16 370.39L72.08 370.47L74 370.5L75.92 370.47L77.84 370.39L79.76 370.26L81.68 370.08L83.62 369.86L85.55 369.58L87.5 369.27L89.45 368.93L91.41 368.55L93.39 368.15L95.37 367.72L97.36 367.29L99.36 366.85L101.37 366.41L103.39 365.98L105.41 365.57L107.45 365.18L109.5 364.81L111.55 364.48L113.62 364.19L115.68 363.95L117.76 363.76L119.84 363.61L121.92 363.53L124 363.5L126.08 363.53L128.16 363.61L130.24 363.76L132.32 363.95L134.38 364.19L136.45 364.48L138.5 364.81L140.55 365.18L142.59 365.57L144.61 365.98L146.63 366.41L148.64 366.85L150.64 367.29L152.63 367.72L154.61 368.15L156.59 368.55L158.55 368.93L160.5 369.27L162.45 369.58L164.38 369.86L166.32 370.08L168.24 370.26L170.16 370.39L172.08 370.47L174 370.5L175.92 370.47L177.84 370.39L179.76 370.26L181.68 370.08L183.62 369.86L185.55 369.58L187.5 369.27L189.45 368.93L191.41 368.55L193.39 368.15L195.37 367.72L197.36 367.29L199.36 366.85L201.37 366.41L203.39 365.98L205.41 365.57L207.45 365.18L209.5 364.81L211.55 364.48L213.62 364.19L215.68 363.95L217.76 363.76L219.84 363.61L221.92 363.53L224 363.5L226.08 363.53L228.16 363.61L230.24 363.76L232.32 363.95L234.38 364.19L236.45 364.48L238.5 364.81L240.55 365.18L242.59 365.57L244.61 365.98L246.63 366.41L248.64 366.85L250.64 367.29L252.63 367.72L254.61 368.15L256.59 368.55L258.55 368.93L260.5 369.27L262.45 369.58L264.38 369.86L266.32 370.08L268.24 370.26L270.16 370.39L272.08 370.47L274 370.5L275.92 370.47L277.84 370.39L279.76 370.26L281.68 370.08L283.62 369.86L285.55 369.58L287.5 369.27L289.45 368.93L291.41 368.55L293.39 368.15L295.37 367.72L297.36 367.29L299.36 366.85L301.37 366.41L303.39 365.98L305.41 365.57L307.45 365.18L309.5 364.81L311.55 364.48L313.62 364.19L315.68 363.95L317.76 363.76L319.84 363.61L321.92 363.53L324 363.5L326.08 363.53L328.16 363.61L330.24 363.76L332.32 363.95L334.38 364.19L336.45 364.48L338.5 364.81L340.55 365.18L342.59 365.57L344.61 365.98L346.63 366.41L348.64 366.85L350.64 367.29L352.63 367.72L354.61 368.15L356.59 368.55L358.55 368.93L360.5 369.27L362.45 369.58L364.38 369.86L366.32 370.08L368.24 370.26L370.16 370.39L372.08 370.47L374 370.5L375.92 370.47L377.84 370.39L379.76 370.26L381.68 370.08L383.62 369.86L385.55 369.58L387.5 369.27L389.45 368.93L391.41 368.55L393.39 368.15L395.37 367.72L397.36 367.29L399.36 366.85L401.37 366.41L403.39 365.98L404.61 371.85L402.63 372.28L400.64 372.71L398.64 373.15L396.63 373.59L394.61 374.02L392.59 374.43L390.55 374.82L388.5 375.19L386.45 375.52L384.38 375.81L382.32 376.05L380.24 376.24L378.16 376.39L376.08 376.47L374 376.5L371.92 376.47L369.84 376.39L367.76 376.24L365.68 376.05L363.62 375.81L361.55 375.52L359.5 375.19L357.45 374.82L355.41 374.43L353.39 374.02L351.37 373.59L349.36 373.15L347.36 372.71L345.37 372.28L343.39 371.85L341.41 371.45L339.45 371.07L337.5 370.73L335.55 370.42L333.62 370.14L331.68 369.92L329.76 369.74L327.84 369.61L325.92 369.53L324 369.5L322.08 369.53L320.16 369.61L318.24 369.74L316.32 369.92L314.38 370.14L312.45 370.42L310.5 370.73L308.55 371.07L306.59 371.45L304.61 371.85L302.63 372.28L300.64 372.71L298.64 373.15L296.63 373.59L294.61 374.02L292.59 374.43L290.55 374.82L288.5 375.19L286.45 375.52L284.38 375.81L282.32 376.05L280.24 376.24L278.16 376.39L276.08 376.47L274 376.5L271.92 376.47L269.84 376.39L267.76 376.24L265.68 376.05L263.62 375.81L261.55 375.52L259.5 375.19L257.45 374.82L255.41 374.43L253.39 374.02L251.37 373.59L249.36 373.15L247.36 372.71L245.37 372.28L243.39 371.85L241.41 371.45L239.45 371.07L237.5 370.73L235.55 370.42L233.62 370.14L231.68 369.92L229.76 369.74L227.84 369.61L225.92 369.53L224 369.5L222.08 369.53L220.16 369.61L218.24 369.74L216.32 369.92L214.38 370.14L212.45 370.42L210.5 370.73L208.55 371.07L206.59 371.45L204.61 371.85L202.63 372.28L200.64 372.71L198.64 373.15L196.63 373.59L194.61 374.02L192.59 374.43L190.55 374.82L188.5 375.19L186.45 375.52L184.38 375.81L182.32 376.05L180.24 376.24L178.16 376.39L176.08 376.47L174 376.5L171.92 376.47L169.84 376.39L167.76 376.24L165.68 376.05L163.62 375.81L161.55 375.52L159.5 375.19L157.45 374.82L155.41 374.43L153.39 374.02L151.37 373.59L149.36 373.15L147.36 372.71L145.37 372.28L143.39 371.85L141.41 371.45L139.45 371.07L137.5 370.73L135.55 370.42L133.62 370.14L131.68 369.92L129.76 369.74L127.84 369.61L125.92 369.53L124 369.5L122.08 369.53L120.16 369.61L118.24 369.74L116.32 369.92L114.38 370.14L112.45 370.42L110.5 370.73L108.55 371.07L106.59 371.45L104.61 371.85L102.63 372.28L100.64 372.71L98.64 373.15L96.63 373.59L94.61 374.02L92.59 374.43L90.55 374.82L88.5 375.19L86.45 375.52L84.38 375.81L82.32 376.05L80.24 376.24L78.16 376.39L76.08 376.47L74 376.5L71.92 376.47L69.84 376.39L67.76 376.24L65.68 376.05L63.62 375.81L61.55 375.52L59.5 375.19L57.45 374.82L55.41 374.43L53.39 374.02L51.37 373.59L49.36 373.15L47.36 372.71L45.37 372.28L43.39 371.85L41.41 371.45L39.45 371.07L37.5 370.73L35.55 370.42L33.62 370.14L31.68 369.92L29.76 369.74L27.84 369.61L25.92 369.53L24 369.5L22.08 369.53L20.16 369.61L18.24 369.74L16.32 369.92L14.38 370.14L12.45 370.42L10.5 370.73L8.55 371.07L6.59 371.45L4.61 371.85L2.63 372.28L0.64 372.71L-1.36 373.15L-3.37 373.59Z"/>
7
+ </svg>
package/lib/client.js CHANGED
@@ -317,6 +317,27 @@ export class TeamworkClient {
317
317
  return this.api('profile', 'PATCH', input);
318
318
  }
319
319
  current() { return this.snapshot; }
320
+ /**
321
+ * Takes a token the host's supervisor provides instead of a browser sign-in (`tokenFile`, docs/development.md).
322
+ * Replacing one token with another keeps the session revision, since short-lived tokens are renewed for the
323
+ * same computer; signing in from none, or out to none, moves it and drops the cached configuration on the way out.
324
+ */
325
+ useToken(token) {
326
+ return this.enqueue(async () => {
327
+ if (token === this.token)
328
+ return;
329
+ this.verifier = undefined;
330
+ if (!token) {
331
+ this.epoch++;
332
+ this.token = undefined;
333
+ await this.clear();
334
+ return;
335
+ }
336
+ if (!this.token)
337
+ this.epoch++;
338
+ this.token = token;
339
+ });
340
+ }
320
341
  async clear() { this.snapshot = undefined; await rm(this.cachePath, { force: true }); }
321
342
  logout() { this.epoch++; return this.enqueue(() => this.logoutOnce()); }
322
343
  /** Forgets the token locally; the platform cannot revoke it, but a removed member is refused on every request. */