@dsh-workbench/core 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/host/index.js
CHANGED
|
@@ -765,7 +765,7 @@ async function openOnce$1(shell, command, session, url, timeoutMs) {
|
|
|
765
765
|
async function browserRead(options) {
|
|
766
766
|
const { shell, script, url, loginUrl, open = true } = options;
|
|
767
767
|
const command = options.command ?? "opencli";
|
|
768
|
-
const session = options.session ?? "workbench";
|
|
768
|
+
const session = options.session ?? "workbench-read";
|
|
769
769
|
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS$1;
|
|
770
770
|
const retryMs = options.retryMs ?? DEFAULT_RETRY_MS;
|
|
771
771
|
const settleMs = options.settleMs ?? DEFAULT_SETTLE_MS$1;
|
|
@@ -981,7 +981,7 @@ async function openOnce(shell, command, session, url, timeoutMs) {
|
|
|
981
981
|
async function browserFind(options) {
|
|
982
982
|
const { shell, css, url, open = true } = options;
|
|
983
983
|
const command = options.command ?? "opencli";
|
|
984
|
-
const session = options.session ?? "workbench";
|
|
984
|
+
const session = options.session ?? "workbench-read";
|
|
985
985
|
const limit = options.limit ?? DEFAULT_LIMIT;
|
|
986
986
|
const textMax = options.textMax ?? DEFAULT_TEXT_MAX;
|
|
987
987
|
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
@@ -6385,7 +6385,7 @@ function registerDiyTools(ctx, market, panels, debug) {
|
|
|
6385
6385
|
},
|
|
6386
6386
|
session: {
|
|
6387
6387
|
type: "string",
|
|
6388
|
-
description: "
|
|
6388
|
+
description: "会话名(默认读那条,一般不用填)。"
|
|
6389
6389
|
},
|
|
6390
6390
|
open: {
|
|
6391
6391
|
type: "boolean",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-workbench/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "个人工作台:Agent 工作台外壳(左栏 + 常驻对话 + 自研右侧数据面板)。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"icon": "./icon.svg",
|
|
@@ -87,15 +87,15 @@
|
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@dsh-workbench/shared": "0.3.
|
|
90
|
+
"@dsh-workbench/shared": "0.3.2"
|
|
91
91
|
},
|
|
92
92
|
"scripts": {
|
|
93
93
|
"build": "node scripts/build.mjs && node scripts/build-types.mjs",
|
|
94
94
|
"build:host": "node scripts/build.mjs host",
|
|
95
95
|
"build:client": "node scripts/build.mjs client",
|
|
96
|
-
"typecheck": "tsc --noEmit",
|
|
96
|
+
"typecheck": "tsc --noEmit --incremental --tsBuildInfoFile node_modules/.cache/tsconfig.tsbuildinfo",
|
|
97
97
|
"arch": "arch-guard",
|
|
98
|
-
"selfcheck": "node scripts/selfcheck.mjs",
|
|
98
|
+
"selfcheck": "node scripts/selfcheck/index.mjs",
|
|
99
99
|
"check:runtimes": "node scripts/check-runtimes.mjs",
|
|
100
100
|
"check:release-artifacts": "node scripts/check-release-artifacts.mjs",
|
|
101
101
|
"check": "pnpm -w run check",
|
package/scripts/seed-workshop.sh
CHANGED
|
@@ -77,7 +77,9 @@ SYNC_STATE="$DIY_DIR/.sync.json"
|
|
|
77
77
|
SYNC_LOCK="$DIY_DIR/.sync.lock"
|
|
78
78
|
SYNC_BACKOFF_SECONDS=3600
|
|
79
79
|
SYNC_LOCK_STALE_MINUTES=15
|
|
80
|
-
|
|
80
|
+
# 撞锁(目标是另一代)时等一轮的秒数。可覆盖:只有探针会调小它——串行那版靠这个 sleep 排队,
|
|
81
|
+
# 18 格跑 54 秒。生产默认为 5,行为不变。
|
|
82
|
+
SYNC_LOCK_WAIT_SECONDS="${SYNC_LOCK_WAIT_SECONDS:-5}"
|
|
81
83
|
|
|
82
84
|
# 基准版本:只有**显式给了基准**、且它有可读的 package.json 时才有值。空 = 这一轮不做比对。
|
|
83
85
|
shell_version() {
|
|
@@ -64,6 +64,11 @@
|
|
|
64
64
|
固化读的完整形状是**两拍**:不在站点上 → `open` 那个页 → 等一会儿(约 1 秒)再 eval 一遍。
|
|
65
65
|
每一拍都由 shared 的 `backgroundLine` 拼(前缀 `env OPENCLI_WINDOW=background`)—— 别绕开它直接拼
|
|
66
66
|
`opencli browser …`:漏一拍就是把用户的 Chrome 顶到面前一次。
|
|
67
|
+
- **读自己一条会话,屏是另一条 —— 这两条不许同名**。`browserRead` / `browserFind` 的默认会话是
|
|
68
|
+
`BROWSER_READ_SESSION`(`workbench-read`);`BROWSER_SCREEN_SESSION`(`workbench`)是
|
|
69
|
+
**工坊看/动族给"用户当前那一页"上租约**用的那条。两条同名的后果是"一读就把用户那一页导航走"
|
|
70
|
+
(`open` 那一拍落在租约那个标签上)—— 2026-10-19「套餐余额」卡片一挂载就跳 `/wallet` 就是这个。
|
|
71
|
+
想给自己一条专线(不跟别的模块抢同一个 tab)就传自己的名字:`session: "<unit>"`。
|
|
67
72
|
- **页面里没有接口时(DOM 读)不要用 `eval` 去 `document.querySelectorAll`**:产物边界判据会拦
|
|
68
73
|
(宿主产物里不许出现 `document.` / `window.` 字样),而且那样解析只能窝在字符串里、测不了。
|
|
69
74
|
探的时候 `workbench_diy_probe`(`url=…, css=<选择器>`)就是这个口子;
|
|
@@ -80,7 +85,8 @@
|
|
|
80
85
|
4. **固化进模块** —— 先把它照抄进 `design.json`(只有一条读写 `datasource{}`;一条卡有好几条读写 `reads[]`,一条一行;字段一样:哪条读 / 参数 / 凭据 /
|
|
81
86
|
没登录长什么样 / 超时长什么样 / 当初那次调用的原文),再写进模块的**宿主半侧**:用 `@dsh-workbench/shared/host` 导出的
|
|
82
87
|
`browserRead({ shell, script, url, loginUrl })`(**接口读**:探明的那一段脚本原样搬进去就行 ——
|
|
83
|
-
两拍、重试、平台码映射、`message` / `hint` / `detail` / `helpUrl`
|
|
88
|
+
两拍、重试、平台码映射、`message` / `hint` / `detail` / `helpUrl` 四个字段都在它里面;
|
|
89
|
+
会话不传就落在读那条上,想给自己一条专线再传 `session: "<unit>"`)或
|
|
84
90
|
`browserFind({ shell, css, url, session })`(**DOM 读**:它替你问"现在停在哪一页"(`browser get url`),
|
|
85
91
|
不在就 `open` 再读一遍,失败时把 opencli 自己说的原因带出来),或者只读路由里的一个 HTTP GET。之后卡片只依赖**这一条**;渲染怎么改都不动它。
|
|
86
92
|
|