@zhin.js/adapter-juejin 0.1.5 → 0.1.7
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/CHANGELOG.md +157 -0
- package/LICENSE +21 -0
- package/README.md +6 -0
- package/commands/juejin-draft/drop/[id]/index.js +1 -1
- package/commands/juejin-draft/drop/[id]/index.ts +1 -1
- package/commands/juejin-draft/edit/[id]/index.js +1 -1
- package/commands/juejin-draft/edit/[id]/index.ts +1 -1
- package/commands/juejin-draft/list/index.js +1 -1
- package/commands/juejin-draft/list/index.ts +1 -1
- package/commands/juejin-draft/send/[id]/index.js +1 -1
- package/commands/juejin-draft/send/[id]/index.ts +1 -1
- package/commands/juejin-draft/show/[id]/index.js +1 -1
- package/commands/juejin-draft/show/[id]/index.ts +1 -1
- package/commands/juejin-login/status/index.js +1 -1
- package/commands/juejin-login/status/index.ts +1 -1
- package/package.json +18 -17
- package/plugin.js +1 -1
- package/schema.json +0 -66
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# @zhin.js/adapter-juejin
|
|
2
|
+
|
|
3
|
+
## 0.1.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d80964d: 修复 1.2 发版撞号:`@zhin.js/core` 与 `@zhin.js/agent` 按 minor 升到 1.2.0 时,npm 上早已有同号的旧架构版本(core 1.2.0–1.5.16、agent 1.2.0–1.2.1),`changeset publish` 只提示 already published 就跳过,导致 `zhin.js@1.1.26` 等已发布的包依赖了旧 core / agent,启动时缺少 `CHAT_ROLES`。
|
|
8
|
+
|
|
9
|
+
本次把 core 发为 1.6.0、agent 发为 1.3.0(npm 上第一个空闲的 minor),并重新发布所有直接依赖它们的包,让依赖版本与 peer 范围指向新版本(`^1.6.0` / `^1.3.0`,不再落进旧架构版本)。
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [d80964d]
|
|
12
|
+
- @zhin.js/core@1.6.0
|
|
13
|
+
- @zhin.js/adapter@1.1.33
|
|
14
|
+
|
|
15
|
+
## 0.1.6
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- e1fda87: fix: 按审计待审清单处理(安全、功能、清理)
|
|
20
|
+
|
|
21
|
+
**行为变更(升级前请阅读)**
|
|
22
|
+
|
|
23
|
+
- kernel / core / zhin.js:出站文本中的 `${…}` 不再用 `vm` 求值,只替换 `TemplateContext` 上能解析到值的属性路径(如 `${sender.name}`);表达式、函数调用、未知名字原样保留。整套 vm 沙箱(`evaluate` / `execute` / `compiler` / `getValueWithRuntime`)已移除。
|
|
24
|
+
- kernel / core / zhin.js:移除零引用的遗留导出——`Scheduler`、错误管理器与 `ZhinError` 子类、`compose`、`segment.from/toString`、AI 触发/准入函数、`@zhin.js/core/queue-im-field-contract`、`zhin.js/contexts`。
|
|
25
|
+
- agent:readonly 执行预设不再放行重定向、后台 `&`、进程替换、`find -delete/-exec`、`sed -i`、`sort -o`、`tee`、`xargs`、awk;curl/wget 校验每个 URL 与裸主机并识别更多上传参数;自定义 `execAllowlist` 中的只读命令带写入风险时改走审批。沙箱超时/取消会杀掉进程组或具名容器,默认镜像改为 `node:22-bookworm-slim` + `bash`。移除无生产调用的 `AuditLogger`、`AnomalyDetector`、旧 vision 回合等导出。
|
|
26
|
+
- ai:移除 `storage`、`FileStateCache`、`CostTracker`、`model-name-utils`、`./agent-step-checkpoint` 子路径、`ContextManager` 及旧压缩管线;延迟工具快照改为有界 LRU。
|
|
27
|
+
- cli:`zhin send` / `watch` / `schedule` 改为与运行中的 Host 通信(新增 `POST /message/send` 与 `/assistant/jobs` 写接口),`schedule` 不再支持离线改文件;移除 `zhin uninstall service`(用 `zhin service uninstall`)、`build --analyze`、`install -S`;`zhin stop` 杀不掉进程时保留 pid 文件并以非零退出;`runtime migrate` 新增 `verify`;未设置 `TZ` 时调度默认时区改为系统时区;不带 `ZHIN_SUPERVISOR_PID` 的进程被 init 接管后不再自行退出。
|
|
28
|
+
- schedule:后台 reconcile 出错不再产生未处理 rejection(新增 `onStoreError`);启动途中 `stop()` 不再遗留定时器。
|
|
29
|
+
- schema:元组校验与 `safeParse`、JSON Schema 一致(空数组不通过,缺省的可选元组为 `undefined`)。
|
|
30
|
+
- client / contract:删除无后端路由的 agent-stream API、未使用的 `definePage` 与旧 PageManager 类型;`@zhin.js/contract` 不再依赖 `@zhin.js/ai`;客户端收到 401 会清除已保存的凭据;安装/更新/卸载 RPC 默认超时 120 秒。
|
|
31
|
+
- a2a:流式响应中途出错写入 SSE error 并结束;未配置 token 的非生产环境只接受本机请求;任务存储有上限与过期;Mailbox 凭据回退与生产环境缺密钥检查修复。
|
|
32
|
+
- speech:`provider: openai` 不再套用 Ollama 的默认 host/model;识别语言改为可配置,不再写死 `zh`。
|
|
33
|
+
- adapter-lark:支持 `encryptKey` 加密事件解密。adapter-github:Device Flow 可取消、带超时并回复失败原因。adapter-wecom / dingtalk:请求加超时并校验 HTTP 状态。adapter-weixin-ilink:输入关闭期间暂停轮询。adapter-milky:SSE 支持 CRLF、缓冲上限与空闲重连。adapter-onebot-events:好友删除通知改为 `notice.friend.decrease`。
|
|
34
|
+
- plugin-group-suite:`teachAllowRegex` 默认关闭,正则安全检查更严格。plugin-qrcode:改为本地生成,回复 data URL 图片。plugin-rss / short-url / link-poster:拒绝解析到内网的地址;rss 修复条目每周重复推送;short-url 的 Console 创建改为真实调用 is.gd。plugin-lottery:按 `historyLimit` 同步。
|
|
35
|
+
|
|
36
|
+
**其余**
|
|
37
|
+
|
|
38
|
+
- host-http:插件市场详情加缓存与包名校验,SSE 回放容忍背压。host-http-contract:新增 `readTextBody()`,九个适配器改用它。
|
|
39
|
+
- pagemanager:页面外壳 importmap 升级到 React 19.2.8 / react-router 7.12.0。console-contract:`definePage` 接受 `description` / `group` / `parent` / `fullWidth`。
|
|
40
|
+
- command:进度提示本地化,匹配不再重复拷贝消息段。runtime:源码监听降级后退避重试原生监听。
|
|
41
|
+
- html-renderer:删除未接线的 `aiTextAsImage`。create-zhin-app / scaffold-wizard:移除不起作用的"全局安装 CLI"与运行时选择提示。
|
|
42
|
+
- 依赖声明清理、发布清单不再携带解析不到的 `src` 目录、移除未使用的 Skill 挂载、README 与示例配置按当前实现更正。
|
|
43
|
+
|
|
44
|
+
- 120e225: 聊天角色(ADR 0056,2026-11-12 修订):zhin 角色 owner / admin / trusted 分四级、只来自授予;发言者的平台身份与机器人自身的平台身份是独立维度,命令、Agent 工具 / 技能、中间件与按钮按三条维度共用一个评估器过滤。升级说明见 docs/migrations/chat-roles.md。
|
|
45
|
+
|
|
46
|
+
- zhin.js:实例首次启动把适配器 `master` / `trusted`、`endpoints[i].master|trusted` 与 `ai.trigger.masters|trusted` 迁入项目数据库 `chat_roles`(先记入 `.zhin/chat-roles-migration.json`,再从配置移除并记日志);之后配置再出现这些字段时启动报错并指向升级指南。平台身份不再映射为 zhin 角色:删除 `roles.mappings`(适配器块与 `endpoints[i].roles` 出现即启动报错)、`chat_role_mappings` 表与 Console `chat-roles.mappings` / `chat-roles.set-mappings`;`features.selfService.platformAdmins|roles|allowUsers` 删除;群内「功能」「角色」命令只认 zhin 角色,平台群主不再自动具备;聊天改配置、聊天重启、Agent 主人审批按 zhin `owner` 判断。
|
|
47
|
+
- @zhin.js/core(minor,破坏性):角色模型与解析移入 core(`ChatRoleService`、`createChatRoleSenderEnricher`),入站消息带 `sender.chatRole` 与归一的 `sender.platform`;删除 `SenderRole`、`senderRolesFromMessage`、`roleSatisfies` 等,`master` 改名 `owner`;删除映射规则 API(`createMappingChatRoleSource`、`DEFAULT_CHAT_ROLE_MAPPINGS` 等)与 `ChatRoleSource`;`createSenderEnricher` / `createConfigurationChatAuthorizer` 改为基于聊天角色。IM Runtime 为 PermissionHost 提供机器人自身身份(经 Adapter 索引缓存),机器人的角色变化事件使缓存失效;命令拒绝回复说明缺少的平台 / 机器人条件;`<Button permit>` 按点击者鉴权;场景治理工具工厂同时要求 `platform:*` 与 `bot:*`;`ai.trigger.masters|trusted` 删除。
|
|
48
|
+
- @zhin.js/permission(minor,破坏性):permit 语法 `owner` / `admin` / `trusted` / `role(...)`(zhin 角色)、`platform:owner|admin`、`platform-role:<id>`、`platform-permission:<name>`(发言者平台身份),新增 `bot:owner|admin`、`bot-role:<id>`、`bot-permission:<name>`(机器人自身平台身份,`PermissionSubject.bot`);`PermissionHost` 新增 `setBotStandingResolver`、`withBotStanding`、`firstDenied`,`checkAll` 可带 `source` 解析机器人身份;新增 `describeDeniedPermit`、`permitsNeedBotStanding`。删除 `role(master)`、`scene_admin`、`scene_owner`、`platform(adapter,perm)` 及 `registerPlatform`、`createSceneRolePlatformChecker`、`platformPermission`、`definePlatformPermission`,定义时报错并给出替代写法。
|
|
49
|
+
- @zhin.js/command(minor,破坏性):命令会话的发送者改为 `chatRole` / `platform`,不再从 metadata 读角色;`CONVERSATION_MANAGER_PERMIT` 改为 `admin`(平台群主不再自动满足);分发结果 `denied` 带 `denial`(第一条不满足的规则与原因);指令菜单只列出当前发送者在本会话可用的命令。
|
|
50
|
+
- @zhin.js/agent(minor,破坏性):危险工具、文件 / exec 策略、主人审批、Agent 回合主体只读 zhin 角色(`principal.roles` 只含展开的聊天角色,平台地位在 `principal.platform`);`SenderRole` → `PrincipalRole`,`SELF_CHANGE_MASTER_ROLE` → `SELF_CHANGE_OWNER_ROLE`;回合开始时读取机器人自身身份(`contextState.bot.platform`),按三条维度过滤 tool / skill / Agent 包后才披露,执行工具时再校验一次;群规「群主和管理员豁免」改为平台群主 / 管理员与 zhin `owner`。
|
|
51
|
+
- @zhin.js/feature-kit:`OperationSession.sender` 改为 `chatRole` / `platform`。
|
|
52
|
+
- @zhin.js/im-contract:新增 `PlatformStanding`、`SelfStandingRequest`、`standingFromMemberRole`。
|
|
53
|
+
- @zhin.js/adapter:入站 sender 可带 `platform`;账号管理命令需要聊天角色 `owner`;`EndpointManagement` 新增可选 `inspectSelfStanding`,能力画像新增 `scene.selfStanding`(声明即须实现),`AdapterIndex.selfStanding` / `invalidateSelfStanding` 按会话缓存机器人自身身份。
|
|
54
|
+
- @zhin.js/middleware:入站中间件可声明 `permit`,不满足时跳过该中间件(机器人身份只读缓存)。
|
|
55
|
+
- @zhin.js/tool:定义工具时拒绝已移除的 permit 写法。
|
|
56
|
+
- @zhin.js/ai:注释更新。
|
|
57
|
+
- @zhin.js/console-protocol:`chat-roles.list|grant|revoke`(`iam.manage`);`ConsoleChatRoleSource` 只有 `grant`。
|
|
58
|
+
- @zhin.js/runtime:Host 配置 Schema 删除 `features.selfService.platformAdmins|roles|allowUsers`。
|
|
59
|
+
- @zhin.js/testing:伪造消息与 `PluginTestKit` 用 `sender.chatRole` 声明测试身份。
|
|
60
|
+
- @zhin.js/scaffold-wizard:ICQQ 向导不再写 `master`,完成后提示在 Console 账号「角色」页签或聊天 `角色 授予` 设置 owner。
|
|
61
|
+
- 适配器:配置 Schema 删除 `master` / `trusted`(以及预览版的 `roles`);群管理类工具同时声明发言者条件与机器人条件(如 `platform:admin` + `bot:admin`、`bot-permission:manage_roles`),NapCat / OneBot11 工具不再使用已移除的 `platform(adapter,…)` 写法。
|
|
62
|
+
- 插件:内容审核以 `inbound.bypass`(permit 列表,默认 `owner` 或 `platform:admin`)取代 `masters` / `inbound.bypassMasters`;群管、音乐、日历、地震、B 站、轮盘赌的权限改用 zhin 角色,订阅类命令只认 zhin `admin` / `owner`。
|
|
63
|
+
|
|
64
|
+
- Updated dependencies [53932e5]
|
|
65
|
+
- Updated dependencies [57c6cdc]
|
|
66
|
+
- Updated dependencies [e1fda87]
|
|
67
|
+
- Updated dependencies [a9c7a13]
|
|
68
|
+
- Updated dependencies [120e225]
|
|
69
|
+
- Updated dependencies [c2bbdcf]
|
|
70
|
+
- Updated dependencies [63595fc]
|
|
71
|
+
- Updated dependencies [fd055d2]
|
|
72
|
+
- Updated dependencies [c2bbdcf]
|
|
73
|
+
- Updated dependencies [663473b]
|
|
74
|
+
- Updated dependencies [c606d51]
|
|
75
|
+
- Updated dependencies [5cd9d3d]
|
|
76
|
+
- Updated dependencies [d655ef0]
|
|
77
|
+
- Updated dependencies [1e54b1e]
|
|
78
|
+
- @zhin.js/adapter@1.1.33
|
|
79
|
+
- @zhin.js/core@1.2.0
|
|
80
|
+
- @zhin.js/logger@1.1.3
|
|
81
|
+
- @zhin.js/feature-kit@1.1.16
|
|
82
|
+
- @zhin.js/console-contract@1.1.6
|
|
83
|
+
- @zhin.js/im-contract@1.1.14
|
|
84
|
+
- @zhin.js/page@1.1.18
|
|
85
|
+
|
|
86
|
+
## 0.1.5
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- Updated dependencies [0d76a7c]
|
|
91
|
+
- @zhin.js/adapter@1.1.32
|
|
92
|
+
- @zhin.js/core@1.1.60
|
|
93
|
+
|
|
94
|
+
## 0.1.4
|
|
95
|
+
|
|
96
|
+
### Patch Changes
|
|
97
|
+
|
|
98
|
+
- Updated dependencies [8adce16]
|
|
99
|
+
- @zhin.js/console-contract@1.1.5
|
|
100
|
+
- @zhin.js/core@1.1.59
|
|
101
|
+
- @zhin.js/page@1.1.17
|
|
102
|
+
- @zhin.js/adapter@1.1.31
|
|
103
|
+
- @zhin.js/feature-kit@1.1.15
|
|
104
|
+
|
|
105
|
+
## 0.1.3
|
|
106
|
+
|
|
107
|
+
### Patch Changes
|
|
108
|
+
|
|
109
|
+
- cbf1fb1: Unify Console page blueprints (`definePageBlueprint`, `defineAdapterPage`, `defineCommentReviewPage`, `projectBlueprintToImCard`, `projectBlueprintToCliPanel`) into `@zhin.js/console-contract` and `@zhin.js/page`, add zero-esbuild pure Blueprint synthesis + static client bundle mounting to `@zhin.js/pagemanager`, remove `@zhin.js/client` (React 19) and `.tsx` from all 30 server-side plugins and adapters (including `bilibili` and `juejin`), and remove legacy Era-1 Koa `PageManager` code.
|
|
110
|
+
- Updated dependencies [cbf1fb1]
|
|
111
|
+
- Updated dependencies [008ccad]
|
|
112
|
+
- Updated dependencies [a1f1028]
|
|
113
|
+
- @zhin.js/console-contract@1.1.4
|
|
114
|
+
- @zhin.js/page@1.1.16
|
|
115
|
+
- @zhin.js/core@1.1.58
|
|
116
|
+
- @zhin.js/im-contract@1.1.13
|
|
117
|
+
- @zhin.js/adapter@1.1.30
|
|
118
|
+
- @zhin.js/feature-kit@1.1.14
|
|
119
|
+
|
|
120
|
+
## 0.1.2
|
|
121
|
+
|
|
122
|
+
### Patch Changes
|
|
123
|
+
|
|
124
|
+
- 22bd14a: The Console comment-review page is now a thin spec over `createCommentReviewPage`; the local RPC client and duplicated page components are removed. Discard uses an inline confirmation, error notices stay until dismissed, and a failed refresh is shown as stale data.
|
|
125
|
+
- Updated dependencies [6163abc]
|
|
126
|
+
- Updated dependencies [fed2c27]
|
|
127
|
+
- Updated dependencies [bc6ccb1]
|
|
128
|
+
- Updated dependencies [72b5a12]
|
|
129
|
+
- Updated dependencies [4427e72]
|
|
130
|
+
- Updated dependencies [22bd14a]
|
|
131
|
+
- @zhin.js/core@1.1.57
|
|
132
|
+
- @zhin.js/client@1.1.25
|
|
133
|
+
- @zhin.js/page@1.1.15
|
|
134
|
+
- @zhin.js/im-contract@1.1.12
|
|
135
|
+
- @zhin.js/adapter@1.1.29
|
|
136
|
+
- @zhin.js/feature-kit@1.1.13
|
|
137
|
+
|
|
138
|
+
## 0.1.1
|
|
139
|
+
|
|
140
|
+
### Patch Changes
|
|
141
|
+
|
|
142
|
+
- 7256bd8: #971 B3: new Experimental Juejin (掘金) comment-reply adapter implementing the ADR 0035 contract. Polls the public `interact_api/v1/comment/list` for an explicit whitelist of your own articles (blank = no polling; first poll is a baseline, comments deduped by id, own comments filtered by login uid or the author flag). Each comment thread is a `channel` conversation `article:<articleId>:<rootCommentId>` with parent `article:<articleId>`. `sendMode` is `review` (default) or `off` — no `auto`; `send` only queues drafts (`approval_pending`, `not_sent`) and only replies to existing comments, never top-level. Approval (Console page, `juejin-draft send`, or `approveDraft`) posts `interact_api/v1/reply/publish` with a minimum send interval; HTTP 403/429, non-JSON responses and rate-limit/captcha/risk messages trip a circuit breaker, and an unparseable write result keeps the draft flagged as possibly posted instead of retrying. The cookie is env-injected only and never persisted; drafts live in `data/juejin/<id>/drafts.json` at mode 600. The plain-HTTP write path is not yet verified live — see the README checklist.
|
|
143
|
+
- Updated dependencies [b249e5e]
|
|
144
|
+
- Updated dependencies [57661f6]
|
|
145
|
+
- Updated dependencies [cbd3f14]
|
|
146
|
+
- Updated dependencies [299863a]
|
|
147
|
+
- Updated dependencies [aaa93d7]
|
|
148
|
+
- Updated dependencies [4fe49b5]
|
|
149
|
+
- Updated dependencies [cce07db]
|
|
150
|
+
- Updated dependencies [b652db3]
|
|
151
|
+
- Updated dependencies [0315ba0]
|
|
152
|
+
- @zhin.js/core@1.1.56
|
|
153
|
+
- @zhin.js/adapter@1.1.28
|
|
154
|
+
- @zhin.js/im-contract@1.1.11
|
|
155
|
+
- @zhin.js/feature-kit@1.1.12
|
|
156
|
+
- @zhin.js/client@1.1.24
|
|
157
|
+
- @zhin.js/page@1.1.14
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 凉菜
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ import { defineCommand } from 'zhin.js/command';
|
|
|
3
3
|
import { juejinEndpoints, discardDraftText } from '@zhin.js/adapter-juejin';
|
|
4
4
|
export default defineCommand({
|
|
5
5
|
description: '丢弃一条掘金评论草稿(不发送)', descriptionI18n: { en: 'Discard a Juejin comment draft without sending' },
|
|
6
|
-
permit: ['
|
|
6
|
+
permit: ['owner'],
|
|
7
7
|
params: { id: { type: 'string', description: '列表中方括号内的草稿 ID', descriptionI18n: { en: 'Draft ID shown in square brackets in the list' } } },
|
|
8
8
|
execute(context) {
|
|
9
9
|
const { params, locale, formatCommand } = context;
|
|
@@ -3,7 +3,7 @@ import { juejinEndpoints, discardDraftText } from '@zhin.js/adapter-juejin';
|
|
|
3
3
|
|
|
4
4
|
export default defineCommand({
|
|
5
5
|
description: '丢弃一条掘金评论草稿(不发送)', descriptionI18n: { en: 'Discard a Juejin comment draft without sending' },
|
|
6
|
-
permit: ['
|
|
6
|
+
permit: ['owner'],
|
|
7
7
|
params: { id: { type: 'string', description: '列表中方括号内的草稿 ID', descriptionI18n: { en: 'Draft ID shown in square brackets in the list' } } },
|
|
8
8
|
execute(context) {
|
|
9
9
|
const { params, locale, formatCommand } = context;
|
|
@@ -3,7 +3,7 @@ import { defineCommand } from 'zhin.js/command';
|
|
|
3
3
|
import { juejinEndpoints, editDraftText, draftEditUsage } from '@zhin.js/adapter-juejin';
|
|
4
4
|
export default defineCommand({
|
|
5
5
|
description: '改写一条掘金评论草稿,改完仍需审批发送', descriptionI18n: { en: 'Edit a Juejin comment draft; approval is still required to send' },
|
|
6
|
-
permit: ['
|
|
6
|
+
permit: ['owner'],
|
|
7
7
|
params: { id: { type: 'string', description: '草稿 ID', descriptionI18n: { en: 'Draft ID' } } },
|
|
8
8
|
execute(context) {
|
|
9
9
|
const { params, args, locale, formatCommand } = context;
|
|
@@ -3,7 +3,7 @@ import { juejinEndpoints, editDraftText, draftEditUsage } from '@zhin.js/adapter
|
|
|
3
3
|
|
|
4
4
|
export default defineCommand({
|
|
5
5
|
description: '改写一条掘金评论草稿,改完仍需审批发送', descriptionI18n: { en: 'Edit a Juejin comment draft; approval is still required to send' },
|
|
6
|
-
permit: ['
|
|
6
|
+
permit: ['owner'],
|
|
7
7
|
params: { id: { type: 'string', description: '草稿 ID', descriptionI18n: { en: 'Draft ID' } } },
|
|
8
8
|
execute(context) {
|
|
9
9
|
const { params, args, locale, formatCommand } = context;
|
|
@@ -3,7 +3,7 @@ import { defineCommand } from 'zhin.js/command';
|
|
|
3
3
|
import { juejinEndpoints, listDraftsText } from '@zhin.js/adapter-juejin';
|
|
4
4
|
export default defineCommand({
|
|
5
5
|
description: '查看待审的掘金评论回复草稿', descriptionI18n: { en: 'List Juejin comment drafts awaiting review' },
|
|
6
|
-
permit: ['
|
|
6
|
+
permit: ['owner'],
|
|
7
7
|
execute(context) {
|
|
8
8
|
const { locale, formatCommand } = context;
|
|
9
9
|
const directory = juejinEndpoints(context);
|
|
@@ -3,7 +3,7 @@ import { juejinEndpoints, listDraftsText } from '@zhin.js/adapter-juejin';
|
|
|
3
3
|
|
|
4
4
|
export default defineCommand({
|
|
5
5
|
description: '查看待审的掘金评论回复草稿', descriptionI18n: { en: 'List Juejin comment drafts awaiting review' },
|
|
6
|
-
permit: ['
|
|
6
|
+
permit: ['owner'],
|
|
7
7
|
execute(context) {
|
|
8
8
|
const { locale, formatCommand } = context;
|
|
9
9
|
const directory = juejinEndpoints(context);
|
|
@@ -3,7 +3,7 @@ import { defineCommand } from 'zhin.js/command';
|
|
|
3
3
|
import { juejinEndpoints, approveDraftText } from '@zhin.js/adapter-juejin';
|
|
4
4
|
export default defineCommand({
|
|
5
5
|
description: '审批并发出一条掘金评论草稿', descriptionI18n: { en: 'Approve and send a Juejin comment draft' },
|
|
6
|
-
permit: ['
|
|
6
|
+
permit: ['owner'],
|
|
7
7
|
params: { id: { type: 'string', description: '列表中方括号内的草稿 ID', descriptionI18n: { en: 'Draft ID shown in square brackets in the list' } } },
|
|
8
8
|
async execute(context) {
|
|
9
9
|
const { params, locale, formatCommand } = context;
|
|
@@ -3,7 +3,7 @@ import { juejinEndpoints, approveDraftText } from '@zhin.js/adapter-juejin';
|
|
|
3
3
|
|
|
4
4
|
export default defineCommand({
|
|
5
5
|
description: '审批并发出一条掘金评论草稿', descriptionI18n: { en: 'Approve and send a Juejin comment draft' },
|
|
6
|
-
permit: ['
|
|
6
|
+
permit: ['owner'],
|
|
7
7
|
params: { id: { type: 'string', description: '列表中方括号内的草稿 ID', descriptionI18n: { en: 'Draft ID shown in square brackets in the list' } } },
|
|
8
8
|
async execute(context) {
|
|
9
9
|
const { params, locale, formatCommand } = context;
|
|
@@ -3,7 +3,7 @@ import { defineCommand } from 'zhin.js/command';
|
|
|
3
3
|
import { juejinEndpoints, showDraftText } from '@zhin.js/adapter-juejin';
|
|
4
4
|
export default defineCommand({
|
|
5
5
|
description: '查看一条掘金评论草稿全文', descriptionI18n: { en: 'Read a complete Juejin comment draft' },
|
|
6
|
-
permit: ['
|
|
6
|
+
permit: ['owner'],
|
|
7
7
|
params: { id: { type: 'string', description: '列表中方括号内的草稿 ID', descriptionI18n: { en: 'Draft ID shown in square brackets in the list' } } },
|
|
8
8
|
execute(context) {
|
|
9
9
|
const { params, locale, formatCommand } = context;
|
|
@@ -3,7 +3,7 @@ import { juejinEndpoints, showDraftText } from '@zhin.js/adapter-juejin';
|
|
|
3
3
|
|
|
4
4
|
export default defineCommand({
|
|
5
5
|
description: '查看一条掘金评论草稿全文', descriptionI18n: { en: 'Read a complete Juejin comment draft' },
|
|
6
|
-
permit: ['
|
|
6
|
+
permit: ['owner'],
|
|
7
7
|
params: { id: { type: 'string', description: '列表中方括号内的草稿 ID', descriptionI18n: { en: 'Draft ID shown in square brackets in the list' } } },
|
|
8
8
|
execute(context) {
|
|
9
9
|
const { params, locale, formatCommand } = context;
|
|
@@ -3,7 +3,7 @@ import { defineCommand } from 'zhin.js/command';
|
|
|
3
3
|
import { juejinEndpoints, loginStatusText } from '@zhin.js/adapter-juejin';
|
|
4
4
|
export default defineCommand({
|
|
5
5
|
description: '查看掘金登录状态', descriptionI18n: { en: 'Show the Juejin login status' },
|
|
6
|
-
permit: ['
|
|
6
|
+
permit: ['owner'],
|
|
7
7
|
execute(context) {
|
|
8
8
|
const { locale } = context;
|
|
9
9
|
const directory = juejinEndpoints(context);
|
|
@@ -3,7 +3,7 @@ import { juejinEndpoints, loginStatusText } from '@zhin.js/adapter-juejin';
|
|
|
3
3
|
|
|
4
4
|
export default defineCommand({
|
|
5
5
|
description: '查看掘金登录状态', descriptionI18n: { en: 'Show the Juejin login status' },
|
|
6
|
-
permit: ['
|
|
6
|
+
permit: ['owner'],
|
|
7
7
|
execute(context) {
|
|
8
8
|
const { locale } = context;
|
|
9
9
|
const directory = juejinEndpoints(context);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-juejin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Zhin.js Juejin (掘金) comment adapter for Plugin Runtime (Experimental; whitelisted article comments, review-then-send with a Console approval page)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -32,20 +32,20 @@
|
|
|
32
32
|
"directory": "plugins/adapters/juejin"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@zhin.js/adapter": "1.1.
|
|
36
|
-
"@zhin.js/console-contract": "1.1.
|
|
37
|
-
"@zhin.js/core": "1.
|
|
38
|
-
"@zhin.js/feature-kit": "1.1.
|
|
39
|
-
"@zhin.js/im-contract": "1.1.
|
|
40
|
-
"@zhin.js/logger": "1.1.
|
|
41
|
-
"@zhin.js/page": "1.1.
|
|
35
|
+
"@zhin.js/adapter": "1.1.33",
|
|
36
|
+
"@zhin.js/console-contract": "1.1.6",
|
|
37
|
+
"@zhin.js/core": "1.6.0",
|
|
38
|
+
"@zhin.js/feature-kit": "1.1.16",
|
|
39
|
+
"@zhin.js/im-contract": "1.1.14",
|
|
40
|
+
"@zhin.js/logger": "1.1.3",
|
|
41
|
+
"@zhin.js/page": "1.1.18"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@zhin.js/adapter": "^1.1.
|
|
45
|
-
"@zhin.js/core": "^1.
|
|
46
|
-
"zhin.js": "^1.1.
|
|
47
|
-
"@zhin.js/command": "^1.1
|
|
48
|
-
"@zhin.js/page": "^1.1.
|
|
44
|
+
"@zhin.js/adapter": "^1.1.33",
|
|
45
|
+
"@zhin.js/core": "^1.6.0",
|
|
46
|
+
"zhin.js": "^1.1.27",
|
|
47
|
+
"@zhin.js/command": "^1.2.1",
|
|
48
|
+
"@zhin.js/page": "^1.1.18"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
51
51
|
"zhin.js": {
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"@types/node": "^26.1.2",
|
|
60
60
|
"typescript": "^6.0.3",
|
|
61
61
|
"vitest": "^4.1.10",
|
|
62
|
-
"@zhin.js/pagemanager": "1.1.
|
|
63
|
-
"zhin.js": "1.1.
|
|
62
|
+
"@zhin.js/pagemanager": "1.1.26",
|
|
63
|
+
"zhin.js": "1.1.27"
|
|
64
64
|
},
|
|
65
65
|
"files": [
|
|
66
66
|
"adapters",
|
|
@@ -70,7 +70,8 @@
|
|
|
70
70
|
"schema.json",
|
|
71
71
|
"src",
|
|
72
72
|
"lib",
|
|
73
|
-
"README.md"
|
|
73
|
+
"README.md",
|
|
74
|
+
"CHANGELOG.md"
|
|
74
75
|
],
|
|
75
76
|
"publishConfig": {
|
|
76
77
|
"access": "public",
|
|
@@ -104,6 +105,6 @@
|
|
|
104
105
|
"scripts": {
|
|
105
106
|
"build": "tsc",
|
|
106
107
|
"clean": "rimraf lib",
|
|
107
|
-
"test": "
|
|
108
|
+
"test": "vitest run --root ../../.. plugins/adapters/juejin/tests"
|
|
108
109
|
}
|
|
109
110
|
}
|
package/plugin.js
CHANGED
|
@@ -5,7 +5,7 @@ import { createJuejinConsoleRpc } from "./lib/console.js";
|
|
|
5
5
|
/**
|
|
6
6
|
* Plugin Runtime:
|
|
7
7
|
* - Adapter: `adapters/juejin` 轮询白名单文章评论,出站只进草稿队列(落盘,重启不丢)。
|
|
8
|
-
* - Commands: `juejin-draft list|show|edit|send|drop`、`juejin-login status
|
|
8
|
+
* - Commands: `juejin-draft list|show|edit|send|drop`、`juejin-login status`(仅聊天角色 owner)。
|
|
9
9
|
* - Page: `pages/index` →「掘金评论审批」:登录态、白名单文章、待审草稿的发送 / 改写 / 丢弃。
|
|
10
10
|
*/
|
|
11
11
|
export default definePlugin({
|
package/schema.json
CHANGED
|
@@ -130,39 +130,6 @@
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
},
|
|
133
|
-
"master": {
|
|
134
|
-
"type": [
|
|
135
|
-
"string",
|
|
136
|
-
"number"
|
|
137
|
-
],
|
|
138
|
-
"description": "框架 master(掘金 uid)。endpoints[i].master 可逐项覆盖",
|
|
139
|
-
"x-i18n": {
|
|
140
|
-
"en": {
|
|
141
|
-
"description": "Framework masters (Juejin uid). endpoints[i].master can override this value."
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
"trusted": {
|
|
146
|
-
"type": "array",
|
|
147
|
-
"items": {
|
|
148
|
-
"type": [
|
|
149
|
-
"string",
|
|
150
|
-
"number"
|
|
151
|
-
],
|
|
152
|
-
"description": "信任的掘金用户 ID",
|
|
153
|
-
"x-i18n": {
|
|
154
|
-
"en": {
|
|
155
|
-
"description": "Trusted Juejin user ID"
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
"description": "框架 trusted 用户列表(掘金 uid)",
|
|
160
|
-
"x-i18n": {
|
|
161
|
-
"en": {
|
|
162
|
-
"description": "Framework trusted users (Juejin uid)."
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
133
|
"commandPrefix": {
|
|
167
134
|
"type": "string",
|
|
168
135
|
"default": "",
|
|
@@ -326,39 +293,6 @@
|
|
|
326
293
|
"type": "string",
|
|
327
294
|
"default": "https://api.juejin.cn"
|
|
328
295
|
},
|
|
329
|
-
"master": {
|
|
330
|
-
"type": [
|
|
331
|
-
"string",
|
|
332
|
-
"number"
|
|
333
|
-
],
|
|
334
|
-
"description": "本 endpoint 的框架 master(掘金 uid)",
|
|
335
|
-
"x-i18n": {
|
|
336
|
-
"en": {
|
|
337
|
-
"description": "Framework masters for this endpoint (Juejin uid)."
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
},
|
|
341
|
-
"trusted": {
|
|
342
|
-
"type": "array",
|
|
343
|
-
"items": {
|
|
344
|
-
"type": [
|
|
345
|
-
"string",
|
|
346
|
-
"number"
|
|
347
|
-
],
|
|
348
|
-
"description": "信任的掘金用户 ID",
|
|
349
|
-
"x-i18n": {
|
|
350
|
-
"en": {
|
|
351
|
-
"description": "Trusted Juejin user ID"
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
},
|
|
355
|
-
"description": "本 endpoint 的 trusted 列表",
|
|
356
|
-
"x-i18n": {
|
|
357
|
-
"en": {
|
|
358
|
-
"description": "Trusted users for this endpoint."
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
},
|
|
362
296
|
"commandPrefix": {
|
|
363
297
|
"type": "string"
|
|
364
298
|
},
|