paseo-plugin-zcode-provider 0.3.0 → 0.4.1
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/NOTICE.md +2 -2
- package/README.md +9 -9
- package/package.json +4 -4
- package/server/account.ts +10 -0
- package/server/build-info.ts +1 -1
- package/server/discovery/manifest.ts +2 -2
- package/server/mapping.ts +31 -0
- package/server/provider.ts +5 -18
- package/server/runtime/pins.ts +3 -3
- package/server/session.ts +7 -10
- package/server/unsupported-capabilities.ts +4 -1
- package/server/vendor/zcode/NOTICE.md +4 -1
- package/server/vendor/zcode/packages/rpc/src/channelClient.ts +1 -0
- package/server/vendor/zcode/packages/rpc/src/channelServer.ts +2 -0
- package/server/vendor/zcode/packages/rpc/src/channels.shared.ts +1 -0
- package/server/vendor/zcode/packages/rpc/src/protocol.ts +3 -2
- package/server/vendor/zcode/packages/shared/src/app-runtime-preferences.ts +18 -0
- package/server/vendor/zcode/packages/shared/src/attachment-source.ts +5 -0
- package/server/vendor/zcode/packages/shared/src/bots.ts +385 -2
- package/server/vendor/zcode/packages/shared/src/browser-use/commands.ts +3 -1
- package/server/vendor/zcode/packages/shared/src/channel-mention.ts +131 -0
- package/server/vendor/zcode/packages/shared/src/conversationSelection.ts +37 -0
- package/server/vendor/zcode/packages/shared/src/dynamic-workflow-feature.ts +137 -0
- package/server/vendor/zcode/packages/shared/src/env.ts +15 -11
- package/server/vendor/zcode/packages/shared/src/highspeed.ts +232 -0
- package/server/vendor/zcode/packages/shared/src/mcp-apps/appTools.ts +148 -0
- package/server/vendor/zcode/packages/shared/src/mcp-apps/contract.ts +262 -0
- package/server/vendor/zcode/packages/shared/src/mcp-apps/instance.ts +12 -0
- package/server/vendor/zcode/packages/shared/src/mcp-apps/resourceMime.ts +73 -0
- package/server/vendor/zcode/packages/shared/src/mcp-apps/sampling.ts +117 -0
- package/server/vendor/zcode/packages/shared/src/mcp-apps/schemas.ts +90 -0
- package/server/vendor/zcode/packages/shared/src/model-execution.ts +58 -1
- package/server/vendor/zcode/packages/shared/src/oauth.ts +3 -0
- package/server/vendor/zcode/packages/shared/src/off-peak-execution.ts +73 -0
- package/server/vendor/zcode/packages/shared/src/protocol.ts +78 -4
- package/server/vendor/zcode/packages/shared/src/remoteTarget.ts +65 -0
- package/server/vendor/zcode/packages/shared/src/request-security-edition/verification-policy.ts +46 -0
- package/server/vendor/zcode/packages/shared/src/server-remote.ts +93 -0
- package/server/vendor/zcode/packages/shared/src/source-server/compatibility.ts +115 -0
- package/server/vendor/zcode/packages/shared/src/source-server/contracts.ts +426 -0
- package/server/vendor/zcode/packages/shared/src/source-server/errorCodes.ts +74 -0
- package/server/vendor/zcode/packages/shared/src/sqlite-migrations/contract.ts +83 -0
- package/server/vendor/zcode/packages/shared/src/subagent-profile.ts +62 -0
- package/server/vendor/zcode/packages/shared/src/subagent-runtime-config.ts +51 -0
- package/server/vendor/zcode/packages/shared/src/subagents-types.ts +164 -0
- package/server/vendor/zcode/packages/shared/src/usage-stats.ts +14 -0
- package/server/vendor/zcode/packages/shared/src/validationAppSettings.ts +136 -3
- package/server/vendor/zcode/packages/shared/src/version.ts +13 -0
- package/server/vendor/zcode/packages/shared/src/zcode-agent-policy.ts +24 -1
- package/server/vendor/zcode/packages/shared/src/zcode-protocol/index.ts +697 -36
- package/server/vendor/zcode/packages/shared/src/zcode-protocol/trace.ts +11 -0
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-legacy-types.ts +14 -2
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/apply.ts +28 -9
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/attachment-ref.ts +3 -0
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/command.ts +73 -53
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/create-session-config.ts +15 -0
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/create-workflow-display.ts +47 -1
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/delta.ts +58 -2
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/input-intent.ts +31 -0
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/rows.ts +28 -13
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/sessions-index-workflow-activity.ts +37 -3
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/sessions-index.ts +36 -0
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/snapshot.ts +21 -0
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/submission.ts +1 -1
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/toolDisplay.ts +32 -4
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/transport.ts +31 -6
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/wire-assembler.ts +4 -1
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/wire-fault.ts +4 -1
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/workflow-artifacts.ts +62 -4
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/workflow-command-rejections.ts +30 -0
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/workflow-row-meta.ts +40 -3
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/workflow-run-settings-command.ts +2 -2
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/workflow-runs-delta.ts +6 -5
- package/server/vendor/zcode/packages/shared/src/zcode-protocol-v4/workflow-runs.ts +103 -26
- package/server/vendor/zcode/packages/shared/src/zcode-task-mode-schema.ts +13 -1
- package/server/vendor/zcode/packages/shared/src/zcode-task-types-core.ts +31 -2
- package/server/vendor/zcode/packages/shared/src/zcodeEndpoint.ts +188 -73
- package/server/vendor/zcode/provenance.json +189 -80
package/NOTICE.md
CHANGED
|
@@ -16,11 +16,11 @@ ZCode は統合 CLI を配布していないため、このリポジトリは `z
|
|
|
16
16
|
|
|
17
17
|
Node.js は利用者のマシンが nodejs.org の公式成果物を直接取得します。このリポジトリは Node.js を再配布しません。
|
|
18
18
|
|
|
19
|
-
`server/vendor/zcode` は [zai-org/ZCode](https://github.com/zai-org/ZCode/tree/
|
|
19
|
+
`server/vendor/zcode` は [zai-org/ZCode](https://github.com/zai-org/ZCode/tree/3c5b227649371507ddc4eb46ac5133afe6db1cab) の RPC、V4 契約、wire 組み立てと純粋な差分適用、および必要なスキーマ依存を含みます。第一者コードは [上流 LICENSE](server/vendor/zcode/LICENSE) の Apache-2.0、RPC と wire codec の VS Code 由来部分は [MIT の通知](server/vendor/zcode/THIRD-PARTY-NOTICES.md) の条件を保持します。[上流 NOTICE](server/vendor/zcode/NOTICE.md) は全文を保持しており、上流製品全体の説明です。そこに記載された全機能・依存がプラグインへ同梱されることを意味しません。
|
|
20
20
|
|
|
21
21
|
ファイルごとの出典・SHA-256、private workspace import の変更、第三者通知の抽出範囲を [provenance.json](server/vendor/zcode/provenance.json) に記録しています。取得・照合は `scripts/sync-zcode-source.mjs` で行います。`npm run build` はこれらのライセンス・通知を `dist/licenses/zcode` にも配置します。
|
|
22
22
|
|
|
23
|
-
開発 SDK は `@getpaseo/plugin@0.
|
|
23
|
+
開発 SDK は `@getpaseo/plugin@0.12.0` です。ビルドは `@getpaseo/plugin/server/provider` と `zod` を外部モジュールとして維持し、Paseo に解決させます。
|
|
24
24
|
|
|
25
25
|
`icon.svg` は [Paseo main c424f829 の glm-acp-agent.svg](https://github.com/getpaseo/paseo/blob/c424f82922fcd36aa9cc9e473644bca04417b420/packages/app/src/assets/acp-provider-icons/glm-acp-agent.svg) のコピーです。この SVG は [ACP Registry の glm-acp-agent/icon.svg](https://github.com/agentclientprotocol/registry/blob/f3826ddd6e35951ea9b7fd0cf43c35a30c3c64cd/glm-acp-agent/icon.svg) とバイト単位で一致します。ACP Registry は Apache-2.0 で配布されており、その [LICENSE](vendor/acp-registry/LICENSE) を保持しています。アイコンは変更していません。商標への権利や公式の承認を示すものではありません。
|
|
26
26
|
|
package/README.md
CHANGED
|
@@ -10,10 +10,10 @@ This is an unofficial plugin. It is not endorsed or maintained by ZCode or Z.ai.
|
|
|
10
10
|
|
|
11
11
|
| Setting | Requirement |
|
|
12
12
|
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
-
| Paseo | 0.8.0 or later; development SDK 0.
|
|
13
|
+
| Paseo | 0.8.0 or later; development SDK 0.12.0 |
|
|
14
14
|
| Plugin Node.js | 22.12.0 or later (the Paseo daemon's runtime) |
|
|
15
15
|
| Managed setup | darwin-arm64, linux-x64, linux-arm64, win-x64, win-arm64 |
|
|
16
|
-
| ZCode | Managed: 3.
|
|
16
|
+
| ZCode | Managed: 3.16.2 (release `3.16.2-paseo.1`) with Node.js 24.21.0. Overrides: stable Server 3.14.0+ / Agent 0.16.9+ with Node.js 24.14.0+ |
|
|
17
17
|
|
|
18
18
|
## Installation
|
|
19
19
|
|
|
@@ -26,7 +26,7 @@ paseo plugin ls
|
|
|
26
26
|
|
|
27
27
|
You can also paste `npm:paseo-plugin-zcode-provider` into **Settings → Plugins → Plugin source**. npm packages require Paseo 0.9.0 or later and npm on the daemon host. Paseo installs the released version and compiles the plugin. Update with `paseo plugin update zcode-provider`. Plugins execute with the daemon user's permissions.
|
|
28
28
|
|
|
29
|
-
To follow the `main` branch instead, install the Git repository with `paseo plugin add supermomonga/paseo-plugin-zcode-provider
|
|
29
|
+
To follow the `main` branch instead, install the Git repository with `paseo plugin add github:supermomonga/paseo-plugin-zcode-provider` (Paseo 0.9.0 or later). Since Paseo 0.11.0, the form without `github:` looks the plugin up in Paseo's plugin registry, which does not list it. Paseo prepares the checkout with `npm ci`.
|
|
30
30
|
|
|
31
31
|
## Setup
|
|
32
32
|
|
|
@@ -35,7 +35,7 @@ Open **Settings → Plugins → zcode-provider → Settings**. The screen has tw
|
|
|
35
35
|
On the **Runtime** tab, choose **Download and install**. The screen lists every download, its SHA-256, size and license before you start. Setup runs on the machine hosting the daemon:
|
|
36
36
|
|
|
37
37
|
- Node.js 24.21.0 from nodejs.org.
|
|
38
|
-
- The ZCode runtime 3.
|
|
38
|
+
- The ZCode runtime 3.16.2 from this repository's [releases](https://github.com/supermomonga/paseo-plugin-zcode-provider/releases/tag/zcode-runtime-v3.16.2-paseo.1) (`3.16.2-paseo.1`). ZCode does not publish its integrated CLI, so this is an **unofficial build** of the public source with the patches in [patches/zcode](patches/zcode) applied (ADR 19), made and verified by CI. The patches hide Computer Use, Browser Use and Visualize, which cannot run or render here. It is not endorsed or maintained by ZCode or Z.ai.
|
|
39
39
|
|
|
40
40
|
Both archives are verified against SHA-256 values pinned in the plugin and extracted to the daemon user's data directory:
|
|
41
41
|
|
|
@@ -59,7 +59,7 @@ API keys are sent to ZCode, which stores them as Desktop does, and are never sho
|
|
|
59
59
|
|
|
60
60
|
### Coding Plan usage
|
|
61
61
|
|
|
62
|
-
On Paseo 0.11 and later, Paseo's **Usage** screen and sidebar usage summary show a **ZCode** card for the signed-in account's Individual Coding Plan (Z.ai or BigModel). It lists the 5-hour, weekly, monthly tool-call and ZCode MCP quotas with their reset times, as ZCode Desktop does. The plugin asks ZCode's official usage service for this plan only, on the same ZCode Server as the Account tab. The service never uses an API key from the environment. Team Plan and Start Plan are not shown. Paseo 0.
|
|
62
|
+
On Paseo 0.11 and later, Paseo's **Usage** screen and sidebar usage summary show a **ZCode** card for the signed-in account's Individual Coding Plan (Z.ai or BigModel). It lists the 5-hour, weekly, monthly tool-call and ZCode MCP quotas with their reset times, as ZCode Desktop does. The plugin asks ZCode's official usage service for this plan only, on the same ZCode Server as the Account tab. The service never uses an API key from the environment. Team Plan and Start Plan are not shown. Paseo 0.12.0 does not yet show usage in a ZCode agent's popover.
|
|
63
63
|
|
|
64
64
|
### Using your own runtime
|
|
65
65
|
|
|
@@ -74,11 +74,11 @@ export PASEO_ZCODE_NODE=/absolute/path/to/node # ordinary Node.js 24.14.0
|
|
|
74
74
|
|
|
75
75
|
Session environment variables are forwarded, subject to ZCode's own proxy, certificate and runtime environment handling.
|
|
76
76
|
|
|
77
|
-
The source baseline is `
|
|
77
|
+
The source baseline is `3c5b227649371507ddc4eb46ac5133afe6db1cab` (ZCode 3.16.2, an untagged upstream `main` commit; see ADR 20). The managed runtime passed the stdio runtime contract on all five managed platforms in CI. See the [verification record](docs/verification.md) for exact coverage.
|
|
78
78
|
|
|
79
79
|
## Behavior
|
|
80
80
|
|
|
81
|
-
- Models and reasoning options come from ZCode. Editing modes are `build`, `edit`, and `yolo`; `settings.plan_mode` is independent.
|
|
81
|
+
- Models and reasoning options come from ZCode. Editing modes are `build`, `edit`, `guarded` and `yolo`; `settings.plan_mode` is independent. `guarded` (ZCode's Autonomous mode, Server 3.15.1 or later) runs tools without approval but asks once, each time, before a command that ZCode's safety rules consider risky; it is not offered on older runtimes.
|
|
82
82
|
- Text, thoughts, tools, subagent progress, usage and history use V4 snapshots and deltas. Tool output is marked when ZCode truncates it. Usage is cumulative; repeated snapshots do not add it again.
|
|
83
83
|
- Text submitted during generation uses native guidance. Attachments use the native queue. Paseo reports one run across these native turns and completes it only after all accepted input has been consumed and foreground work has ended.
|
|
84
84
|
- Acceptance is reported once, after the native acknowledgement. Unknown delivery results are never automatically resent. Stop identifies the current native execution, disables automatic queue execution and removes pending input. A new explicit run enables the queue again.
|
|
@@ -86,7 +86,7 @@ The source baseline is `29628c9acdb81b703bbd4080c207a0e7ce5e276e` (ZCode `v3.14.
|
|
|
86
86
|
- Native permission IDs, option values, questions and Plan approval retain their meanings. Question auto-resolution is disabled for each owned Server. Workspace hook trust is reviewed through the official CLI; it is not represented as “allow once.”
|
|
87
87
|
- Each session owns its Server process and environment. Metadata requests use temporary Servers. Closing stdin gives ZCode time to clean up before process termination.
|
|
88
88
|
|
|
89
|
-
The plugin uses ZCode's own skills, MCP configuration and tools. Browser Use and Computer Use cannot run in the plugin's ZCode, even when ZCode Desktop has them enabled: the Computer Use helper accepts only the signed Desktop app, and only Desktop provides browsers. The plugin therefore hides
|
|
89
|
+
The plugin uses ZCode's own skills, MCP configuration and tools. Browser Use and Computer Use cannot run in the plugin's ZCode, even when ZCode Desktop has them enabled: the Computer Use helper accepts only the signed Desktop app, and only Desktop provides browsers. ZCode's Visualize (interactive views in the conversation) renders only in Desktop. The plugin therefore hides all three from the model (ADR 19, ADR 21); Desktop is not affected. Generic rewind, independent Paseo child agents, hook-review UI and Goal/Workflow controls are outside this migration. `prompt.output_schema`, custom system prompts and `persist:false` are unsupported. MCP `alwaysLoad` is unsupported; stdio MCP commands must be absolute paths. Provider options are unsupported: in Paseo 0.11 and later, `agents.providers.zcode.options` in Paseo's `config.json` makes sessions fail with `INVALID_CONFIGURATION`, and the `command` and `env` overrides there are not applied. Paseo does not show context usage reported before the first turn, and the plugin adds no substitute display; Coding Plan quota appears in Paseo 0.11's Usage screen (see [Coding Plan usage](#coding-plan-usage)).
|
|
90
90
|
|
|
91
91
|
## Persistence
|
|
92
92
|
|
|
@@ -94,7 +94,7 @@ New handles use **version 3**. Versions 1 and 2 are rejected without migration o
|
|
|
94
94
|
|
|
95
95
|
Unsent conversations are deferred drafts. Before the first prompt, the plugin atomically saves the logical-to-native ID mapping under `$XDG_STATE_HOME/paseo-plugin-zcode-provider/sessions-v3`, or `~/.local/state/paseo-plugin-zcode-provider/sessions-v3`. It stores identifiers and workspace paths, not message bodies. Preserve this directory for backup. A mapping write failure prevents sending. Corrupt mappings and missing native conversations fail explicitly; no replacement conversation is created.
|
|
96
96
|
|
|
97
|
-
New conversations support listing, resume and paged V4 history. Mode/Plan restoration requires both `mode` and `settings.plan_mode` saved by Paseo. The plugin applies them after native restore and confirms the resulting state before reporting the session ready. Omitted settings retain whatever ZCode returns, which can be stale on the pinned source; restoration of those values is not guaranteed. There is no private Plan restoration store. [ADR 14](docs/adr/0014-paseoの保存設定を再適用する復元を保証範囲とする.md) limits the guarantee to this supported path; settings-free restoration is checked separately with `npm run test:native-restore`. Existing ZCode databases may be migrated by ZCode itself on startup; the native tests isolate the home, configuration and database.
|
|
97
|
+
New conversations support listing, resume and paged V4 history. From ZCode 3.16, archiving belongs to Desktop's task list, so the listing also contains conversations archived in Desktop. Mode/Plan restoration requires both `mode` and `settings.plan_mode` saved by Paseo. The plugin applies them after native restore and confirms the resulting state before reporting the session ready. Omitted settings retain whatever ZCode returns, which can be stale on the pinned source; restoration of those values is not guaranteed. There is no private Plan restoration store. [ADR 14](docs/adr/0014-paseoの保存設定を再適用する復元を保証範囲とする.md) limits the guarantee to this supported path; settings-free restoration is checked separately with `npm run test:native-restore`. Existing ZCode databases may be migrated by ZCode itself on startup; the native tests isolate the home, configuration and database.
|
|
98
98
|
|
|
99
99
|
## Diagnostics
|
|
100
100
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "paseo-plugin-zcode-provider",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Unofficial Paseo provider plugin for ZCode, using the official stdio Services Server of the integrated ZCode CLI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"paseo",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"semver": "7.8.5"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@getpaseo/client": "0.
|
|
64
|
-
"@getpaseo/plugin": "0.
|
|
65
|
-
"@getpaseo/protocol": "0.
|
|
63
|
+
"@getpaseo/client": "0.12.0",
|
|
64
|
+
"@getpaseo/plugin": "0.12.0",
|
|
65
|
+
"@getpaseo/protocol": "0.12.0",
|
|
66
66
|
"@types/node": "22.18.3",
|
|
67
67
|
"@types/react": "~19.2.0",
|
|
68
68
|
"@types/semver": "7.8.0",
|
package/server/account.ts
CHANGED
|
@@ -127,6 +127,7 @@ export const sessionStateSchema = z.discriminatedUnion("status", [
|
|
|
127
127
|
export const familySchema = z.enum(["zai", "bigmodel"]).nullable();
|
|
128
128
|
export const accountSettingsSchema = z.object({
|
|
129
129
|
providerFamilyDomain: z.string().optional(),
|
|
130
|
+
providerFamilyDomainUpdatedAt: z.number().optional(),
|
|
130
131
|
providerFamilyConnectionSelections: record.optional(),
|
|
131
132
|
});
|
|
132
133
|
const startedSchema = z.object({
|
|
@@ -749,6 +750,8 @@ export class AccountService {
|
|
|
749
750
|
// Desktop's completion: select the signed-in family and its individual
|
|
750
751
|
// Coding Plan unless a plan is already chosen, then refresh entitlements.
|
|
751
752
|
// Without the family the Server does not offer the account's models.
|
|
753
|
+
// Writing the selections requires the settings read here as the expected
|
|
754
|
+
// state (compare-and-set), as Desktop's setProviderFamilyDomain passes them.
|
|
752
755
|
private async completeSignIn(
|
|
753
756
|
host: SettingsHost,
|
|
754
757
|
family: AccountFamily,
|
|
@@ -773,6 +776,13 @@ export class AccountService {
|
|
|
773
776
|
[family]: selections[family] ?? { kind: "individual-coding-plan" },
|
|
774
777
|
},
|
|
775
778
|
},
|
|
779
|
+
{
|
|
780
|
+
providerFamilyDomain: settings.providerFamilyDomain,
|
|
781
|
+
providerFamilyConnectionSelections:
|
|
782
|
+
settings.providerFamilyConnectionSelections,
|
|
783
|
+
providerFamilyDomainUpdatedAt:
|
|
784
|
+
settings.providerFamilyDomainUpdatedAt ?? 0,
|
|
785
|
+
},
|
|
776
786
|
],
|
|
777
787
|
z.unknown(),
|
|
778
788
|
);
|
package/server/build-info.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated from package.json by npm prepare / prebuild.
|
|
2
|
-
export const PROVIDER_VERSION = "0.
|
|
2
|
+
export const PROVIDER_VERSION = "0.4.1";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { gte, parse } from "semver";
|
|
2
2
|
import type { RuntimeIdentity } from "./types.js";
|
|
3
3
|
|
|
4
|
-
export const ZCODE_SOURCE_COMMIT = "
|
|
4
|
+
export const ZCODE_SOURCE_COMMIT = "3c5b227649371507ddc4eb46ac5133afe6db1cab";
|
|
5
5
|
export const MINIMUM_ZCODE_VERSION = { app: "3.14.0", cli: "0.16.9" } as const;
|
|
6
6
|
export const MINIMUM_NODE_VERSION = "24.14.0";
|
|
7
7
|
|
|
@@ -33,4 +33,4 @@ export function assessCompatibility(identity: RuntimeIdentity): {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
// Last reviewed public changelog release; source versions are not releases.
|
|
36
|
-
export const LAST_REVIEWED_ZCODE_RELEASE = "3.
|
|
36
|
+
export const LAST_REVIEWED_ZCODE_RELEASE = "3.16.2";
|
package/server/mapping.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { NativePromptInput } from "./session-types.js";
|
|
2
2
|
import { realpath, stat } from "node:fs/promises";
|
|
3
3
|
import { basename, isAbsolute, relative } from "node:path";
|
|
4
|
+
import { gte, valid } from "semver";
|
|
4
5
|
import { z } from "zod";
|
|
5
6
|
|
|
6
7
|
import type {
|
|
@@ -23,12 +24,42 @@ export const ZCODE_MODES: ProviderMode[] = [
|
|
|
23
24
|
label: "Edit Automatically",
|
|
24
25
|
description: "Edit files automatically while keeping other approvals",
|
|
25
26
|
},
|
|
27
|
+
{
|
|
28
|
+
id: "guarded",
|
|
29
|
+
label: "Autonomous",
|
|
30
|
+
description: "Run tools without approval, but ask before risky commands",
|
|
31
|
+
},
|
|
26
32
|
{
|
|
27
33
|
id: "yolo",
|
|
28
34
|
label: "Full Access",
|
|
29
35
|
description: "Run tools without approval",
|
|
30
36
|
},
|
|
31
37
|
];
|
|
38
|
+
// ZCode 3.15.1 added guarded ("Autonomous mode"); older Servers reject it.
|
|
39
|
+
const GUARDED_MINIMUM_APP_VERSION = "3.15.1";
|
|
40
|
+
|
|
41
|
+
// The modes the runtime with this Server version supports.
|
|
42
|
+
export function zcodeModes(appVersion: string | undefined): ProviderMode[] {
|
|
43
|
+
const guarded =
|
|
44
|
+
appVersion !== undefined &&
|
|
45
|
+
valid(appVersion) !== null &&
|
|
46
|
+
gte(appVersion, GUARDED_MINIMUM_APP_VERSION);
|
|
47
|
+
return guarded ? ZCODE_MODES : ZCODE_MODES.filter((m) => m.id !== "guarded");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function requireConfigurableMode(
|
|
51
|
+
mode: string | null | undefined,
|
|
52
|
+
modes: readonly ProviderMode[] = ZCODE_MODES,
|
|
53
|
+
): void {
|
|
54
|
+
if (
|
|
55
|
+
mode === null ||
|
|
56
|
+
(mode !== undefined && !modes.some((m) => m.id === mode))
|
|
57
|
+
)
|
|
58
|
+
throw new AdapterError(
|
|
59
|
+
"INVALID_CONFIGURATION",
|
|
60
|
+
`ZCode editing mode must be ${modes.map((m) => m.id).join(", ")}`,
|
|
61
|
+
);
|
|
62
|
+
}
|
|
32
63
|
|
|
33
64
|
export function requireMode(mode: string): string {
|
|
34
65
|
if (
|
package/server/provider.ts
CHANGED
|
@@ -41,7 +41,8 @@ import {
|
|
|
41
41
|
decodeModel,
|
|
42
42
|
encodeModel,
|
|
43
43
|
mapMcpServers,
|
|
44
|
-
|
|
44
|
+
requireConfigurableMode,
|
|
45
|
+
zcodeModes,
|
|
45
46
|
} from "./mapping.js";
|
|
46
47
|
import {
|
|
47
48
|
ZCodeSession,
|
|
@@ -316,7 +317,7 @@ export class ZCodeConnection implements ProviderConnection {
|
|
|
316
317
|
requestId: input.requestId,
|
|
317
318
|
catalog: {
|
|
318
319
|
models,
|
|
319
|
-
modes:
|
|
320
|
+
modes: zcodeModes(host.diagnostic.appVersion),
|
|
320
321
|
defaultModel: models.find((model) => model.isDefault)?.id,
|
|
321
322
|
defaultMode: presentation.mode,
|
|
322
323
|
},
|
|
@@ -453,14 +454,7 @@ export class ZCodeConnection implements ProviderConnection {
|
|
|
453
454
|
}
|
|
454
455
|
case "session.configure": {
|
|
455
456
|
const settings = settingsSchema.parse(input.changes.settings ?? {});
|
|
456
|
-
|
|
457
|
-
input.changes.mode !== undefined &&
|
|
458
|
-
!ZCODE_MODES.some((mode) => mode.id === input.changes.mode)
|
|
459
|
-
)
|
|
460
|
-
throw new AdapterError(
|
|
461
|
-
"INVALID_CONFIGURATION",
|
|
462
|
-
"ZCode editing mode must be build, edit, or yolo",
|
|
463
|
-
);
|
|
457
|
+
requireConfigurableMode(input.changes.mode);
|
|
464
458
|
if (input.changes.model !== undefined)
|
|
465
459
|
await entry.native.setModel(input.changes.model);
|
|
466
460
|
if (input.changes.thinkingOption !== undefined)
|
|
@@ -499,14 +493,7 @@ export class ZCodeConnection implements ProviderConnection {
|
|
|
499
493
|
const config = input.config;
|
|
500
494
|
optionsSchema.parse(config.providerOptions ?? {});
|
|
501
495
|
const settings = settingsSchema.parse(config.settings);
|
|
502
|
-
|
|
503
|
-
config.mode !== undefined &&
|
|
504
|
-
!ZCODE_MODES.some((mode) => mode.id === config.mode)
|
|
505
|
-
)
|
|
506
|
-
throw new AdapterError(
|
|
507
|
-
"INVALID_CONFIGURATION",
|
|
508
|
-
"ZCode editing mode must be build, edit, or yolo",
|
|
509
|
-
);
|
|
496
|
+
requireConfigurableMode(config.mode);
|
|
510
497
|
if (config.systemPrompt?.trim())
|
|
511
498
|
throw new AdapterError(
|
|
512
499
|
"INVALID_CONFIGURATION",
|
package/server/runtime/pins.ts
CHANGED
|
@@ -55,12 +55,12 @@ export const MANAGED_NODE_ARCHIVES: Readonly<
|
|
|
55
55
|
// Published by .github/workflows/zcode-runtime-release.yml from the pinned
|
|
56
56
|
// source with patches/zcode applied (ADR 19). The same archive serves every
|
|
57
57
|
// managed platform.
|
|
58
|
-
export const MANAGED_ZCODE_VERSION = "3.
|
|
58
|
+
export const MANAGED_ZCODE_VERSION = "3.16.2";
|
|
59
59
|
const MANAGED_ZCODE_RELEASE = `${MANAGED_ZCODE_VERSION}-paseo.1`;
|
|
60
60
|
export const MANAGED_ZCODE_ARCHIVE: PinnedArchive = {
|
|
61
61
|
url: `https://github.com/supermomonga/paseo-plugin-zcode-provider/releases/download/zcode-runtime-v${MANAGED_ZCODE_RELEASE}/zcode-runtime-${MANAGED_ZCODE_RELEASE}.tar.gz`,
|
|
62
|
-
sha256: "
|
|
63
|
-
size:
|
|
62
|
+
sha256: "01f3ee802f4c0b24c4023e366485120416a6acc92ec899a9edf7f2fc76eaa17d",
|
|
63
|
+
size: 82_516_181,
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
export function managedPlatform(
|
package/server/session.ts
CHANGED
|
@@ -29,8 +29,9 @@ import {
|
|
|
29
29
|
decodeModel,
|
|
30
30
|
encodeModel,
|
|
31
31
|
mapPrompt,
|
|
32
|
+
requireConfigurableMode,
|
|
32
33
|
requireMode,
|
|
33
|
-
|
|
34
|
+
zcodeModes,
|
|
34
35
|
} from "./mapping.js";
|
|
35
36
|
import {
|
|
36
37
|
InitializeResultSchema,
|
|
@@ -436,7 +437,7 @@ export class ZCodeSession {
|
|
|
436
437
|
mode: c.mode,
|
|
437
438
|
thinkingOption: c.thought,
|
|
438
439
|
models: catalogModels(this.modelCatalog, c.modelSelection),
|
|
439
|
-
modes:
|
|
440
|
+
modes: zcodeModes(this.bridge.diagnostic.appVersion),
|
|
440
441
|
thinkingOptions: c.thoughtLevels.map((id) => ({ id, label: id })),
|
|
441
442
|
settings: [
|
|
442
443
|
{
|
|
@@ -461,14 +462,10 @@ export class ZCodeSession {
|
|
|
461
462
|
}
|
|
462
463
|
async configureMode(mode?: string | null, plan?: boolean): Promise<void> {
|
|
463
464
|
this.assertIdle();
|
|
464
|
-
|
|
465
|
-
mode
|
|
466
|
-
(
|
|
467
|
-
)
|
|
468
|
-
throw new AdapterError(
|
|
469
|
-
"INVALID_CONFIGURATION",
|
|
470
|
-
"Mode must be build, edit, or yolo",
|
|
471
|
-
);
|
|
465
|
+
requireConfigurableMode(
|
|
466
|
+
mode,
|
|
467
|
+
zcodeModes(this.bridge.diagnostic.appVersion),
|
|
468
|
+
);
|
|
472
469
|
const nextMode = mode ?? this.state.config.mode,
|
|
473
470
|
nextPlan = plan ?? this.state.config.planEnabled === true;
|
|
474
471
|
if (
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
// Official ZCode capabilities that cannot run in the provider's standalone Server
|
|
2
2
|
// (ADR 19). Computer Use needs the code-signed Desktop to start its Helper, and
|
|
3
|
-
// only the Desktop host supplies browsers to Browser Use.
|
|
3
|
+
// only the Desktop host supplies browsers to Browser Use. Visualize (3.15.1+)
|
|
4
|
+
// needs Desktop's inline view host: ZCode gives its output directory only to
|
|
5
|
+
// Desktop-surface Agents and hides it from terminal sessions for that reason.
|
|
4
6
|
export const SUPPRESSED_OFFICIAL_PLUGINS = [
|
|
5
7
|
"computer-use@zcode-plugins-official",
|
|
6
8
|
"browser-use@zcode-plugins-official",
|
|
9
|
+
"visualize@zcode-plugins-official",
|
|
7
10
|
] as const;
|
|
8
11
|
|
|
9
12
|
// Both capabilities run through this shared tool. Hiding it per turn covers
|
|
@@ -46,7 +46,10 @@ AI 生成的代码、命令、解释、文件和建议可能存在错误、遗
|
|
|
46
46
|
| 会话分享、浏览与导入 | 分享操作可向分享服务提交选中会话行的公开投影及可物化附件,包含用户文本、模型回复与推理文本、工具输入输出和相关元数据。选择阶段可先查询分享服务能力,该能力请求不发送会话投影正文。正常 UI 发布流程要求先确认披露,服务也先校验调用方提交的确认时间,再创建准备记录、上传附件,最后提交发布确认;因此附件可在最终发布成功前已发送,但准备/上传步骤位于服务的披露校验之后。当前 UI 默认公开可导入,浏览与导入不以发布勾选为前提。确认时间字段不能证明任意调用方都经过 UI 勾选。浏览与导入会发送分享码和可用认证信息,并访问附件下载地址;导入还会发送请求标识。投影过滤和文本处理不是全面秘密检测;本地删除或取消不保证外部已上传副本或接收者副本被删除。 |
|
|
47
47
|
| 闲时任务票据与状态同步 | 可用性查询、取号排队、票据状态同步及核销会发送任务标识、票据标识、来源/请求标识、Coding Plan 身份及认证信息。存在待处理票据等条件时,后台同步可持续请求;这类请求不等于发送完整任务提示词,实际模型内容另走模型链路。 |
|
|
48
48
|
| 主动反馈、补充消息与诊断附件 | 用户通过反馈表单提交时,可发送正文、联系方式、账号和客户端信息、截图及文件名;服务仍提供补充消息和附件上传接口,后台任务也会用消息接口报告上传结果,接口存在不代表当前界面提供后续补充编辑入口。工单创建成功后可收起表单,已提交的截图和勾选的日志由后台任务继续上传;工单创建成功前退出表单会请求取消创建。附件先向反馈服务申请上传凭证,再向返回的对象存储地址直传文件。桌面日志选项默认不勾选;勾选后按本地当天修改时间和归档规则选取诊断日志文件,并处理文件全文,不保证仅含当天产生的条目。未勾选日志不影响正文或其他附件,文本处理规则也不保证截图和任意文件已脱敏。 |
|
|
49
|
-
|
|
|
49
|
+
| 手机远程控制 | 启用远程控制并完成配对后,桌面与手机网页经外部 relay 交换会话内容、输入、任务状态、权限请求与附件预览等协议消息;relay 负责鉴权、配对、心跳与消息透传,不运行任务。配对与连接会发送设备、窗口与会话标识。relay 地址随发行配置确定,可由 `ZCODE_WEB_REMOTE_CONTROL_RELAY_WS_URL` 覆盖。 |
|
|
50
|
+
| Bots 第三方聊天接入 | 配置 Bot 后,所选第三方聊天平台(如 Telegram、飞书/Lark)的消息可驱动任务;Bot 按回复模式把助手回复、工具调用、文件变更摘要及权限请求发送到该平台,平台方可获得这些内容。Bot 凭据保存在本地凭据服务,配置文件只保存引用。 |
|
|
51
|
+
| 营销触达与奖励中心 | 登录后可从业务服务获取营销 Banner/弹窗配置及资源包并展示;点击、关闭等操作会上报确认/取消事件,领取类操作会调用套餐领取接口。奖励中心以内嵌网页打开,桥接接口向该页面提供主题、语言和登录状态。 |
|
|
52
|
+
| 安装、插件获取、远端部署与更新 | 安装、发现、认证、部署和更新会访问仓库、包服务、插件市场、CDN 或更新服务器;统一 CLI 安装脚本会从配置的分发源读取版本清单并下载发行包。桌面自动更新受发行形态和运行条件控制,启用后可在启动及周期检查时请求更新清单,携带平台、渠道、设备等信息;平台取值可区分架构,版本信息还会影响更新选择。开源构建默认不启用自动更新(构建期可选能力);启用时,开发构建与打包版都接受 `ZCODE_UPDATE_FEED_URL` 环境变量及 `--zcode-update-feed-url` 启动参数覆盖更新源,用于诊断与应急。下载的代码可能随后被安装或执行,远端部署还可能将本地已有或下载的组件上传/复制到目标环境。下载检查、实际安装及运行组件的控制条件不同,不能统一描述成每步都先弹出确认。 |
|
|
50
53
|
| 工具、Hook、工作流与自动任务的交付或发布 | Shell、终端、Git、Node REPL、浏览器、插件、MCP 或工作流可以读取任务涉及的数据、向相应目标服务上传文件或生成物,并改变外部服务状态;生命周期 Hook 和已配置的定时/后台任务也可触发程序。权限规则、模式、插件配置及系统账号决定执行范围,不能保证每份外发内容都由用户逐项选择或每次外发都有独立确认。发布、发送、购买或部署完成后,本地取消或撤销不一定能恢复外部状态;权限边界见第二节。 |
|
|
51
54
|
| 开发测试、调试与请求录制 | 显式运行相关开发工具时,可向配置的真实模型或工具服务发送测试提示、样例资料及认证头;配置为真实上游的录制代理可转发请求,不能因名称含测试/录制就认为完全离线。请求轨迹和调试文件还可能在本地保存模型内容;这些工具的触发入口与普通产品运行不同。 |
|
|
52
55
|
| 构建、签名与维护者发布 | 显式运行安装、构建或发布脚本时,可下载依赖、原生二进制和运行时,将构建材料复制到发布共享目录、推送 Git,或交给签名工具、Apple 公证服务处理。外部签名工具及另行配置的 CI、存储和分发服务具有自己的网络行为;本仓未展开的流程不能仅凭脚本名称推定已核验。相关调用具有不同的启动入口、环境和凭据要求。CLI SEA 共享目录发布与上传会先校验第三方声明材料,校验失败会阻断该发布流程。当前 native-search 准备步骤按目标平台校验并解包仓库内置归档,本步骤不下载这些归档;Node 等其他组件有各自的下载链路。 |
|
|
@@ -146,6 +146,7 @@ export class ChannelServer<TContext = string> implements IChannelServer<TContext
|
|
|
146
146
|
details?: unknown;
|
|
147
147
|
taskId?: unknown;
|
|
148
148
|
traceId?: unknown;
|
|
149
|
+
retryable?: unknown;
|
|
149
150
|
} = {
|
|
150
151
|
message: error.message,
|
|
151
152
|
name: error.name,
|
|
@@ -162,6 +163,7 @@ export class ChannelServer<TContext = string> implements IChannelServer<TContext
|
|
|
162
163
|
"details",
|
|
163
164
|
"taskId",
|
|
164
165
|
"traceId",
|
|
166
|
+
"retryable",
|
|
165
167
|
] as const;
|
|
166
168
|
for (const key of passthroughKeys) {
|
|
167
169
|
const value = errorRecord[key];
|
|
@@ -51,9 +51,10 @@ function isMessagePortFlowControl(value: unknown): value is MessagePortFlowContr
|
|
|
51
51
|
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
52
52
|
const record = value as Record<string, unknown>;
|
|
53
53
|
return (
|
|
54
|
-
|
|
54
|
+
// 二进制载荷可能有数百万字节;先看控制标记,避免为排除普通消息逐字节枚举。
|
|
55
55
|
record.__zcodeRpcControl === "connection-flow-v1" &&
|
|
56
|
-
(record.state === "saturated" || record.state === "drained")
|
|
56
|
+
(record.state === "saturated" || record.state === "drained") &&
|
|
57
|
+
Object.keys(record).length === 2
|
|
57
58
|
);
|
|
58
59
|
}
|
|
59
60
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const appToolSearchModeSchema = z.enum(["auto", "local", "off"]);
|
|
4
|
+
export type AppToolSearchMode = z.infer<typeof appToolSearchModeSchema>;
|
|
5
|
+
|
|
6
|
+
export const APP_RUNTIME_PREFERENCES_CHANGED_BROADCAST_CHANNEL = "settings:app-runtime-preferences";
|
|
7
|
+
export const ASK_USER_QUESTION_E2E_CLOCK_SCALE_ENV = "ZCODE_E2E_ASK_USER_QUESTION_CLOCK_SCALE";
|
|
8
|
+
|
|
9
|
+
export const appRuntimePreferencesChangedBroadcastPayloadSchema = z
|
|
10
|
+
.object({
|
|
11
|
+
askUserQuestionAutoResolutionEnabled: z.boolean(),
|
|
12
|
+
modelIoFullRetentionEnabled: z.boolean().default(false),
|
|
13
|
+
})
|
|
14
|
+
.strict();
|
|
15
|
+
|
|
16
|
+
export type AppRuntimePreferencesChangedBroadcastPayload = z.infer<
|
|
17
|
+
typeof appRuntimePreferencesChangedBroadcastPayloadSchema
|
|
18
|
+
>;
|