@xiangyixie/dsh-superagent 0.12.1 → 0.14.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/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- # Changelog
1
+ # Changelog
2
2
 
3
3
  Doc-only releases: npm serves the README from the tarball, so a README edit is
4
4
  invisible on the package page until something is published. When the edit
@@ -8,18 +8,201 @@ along with the next code release. A doc-only version leaves `lib/` and `bin/`
8
8
  byte-identical to the version before it, and the pinned install line in the
9
9
  README is updated to the version being released.
10
10
 
11
- ## 0.12.1 — 2026-11-15
11
+ ## 0.14.1 — 2026-11-15
12
+
13
+ ### Added
14
+
15
+ - **Plugin card metadata.** `icon.svg` is declared by the package manifest and
16
+ exported as `./icon`; `locale/en.json` and `locale/zh.json` carry the title,
17
+ description, and a `meta.detail` document. In a Chinese UI the card reads
18
+ “超级智能体” with a Chinese one-line description, and the detail page renders
19
+ `docs/DETAIL.zh.md` instead of the English README.
20
+ - **A format-1 plugin index** at `plugin-index.json`, with the package name, a
21
+ Chinese title, and a `git` source pinned to a full 40-hex commit, so the
22
+ Discover page can add the index and install or update the plugin in one step.
23
+ The public URL and the two-step instructions are in the README.
24
+
25
+ ### Changed
26
+
27
+ - `README.md` is now Simplified Chinese-first; `README.en.md` keeps the English
28
+ text and both open with a language switch. `README.zh.md` mirrors the Chinese
29
+ page, and `package.json`'s `description` is Chinese.
30
+
31
+ ## 0.14.0 — 2026-11-15
32
+
33
+ ### Added
34
+
35
+ - **Attach mode is complete.** With `runtime.browser.attachPort` set, every
36
+ browser tool — listing, clicking, typing, screenshots, scripts — runs on the
37
+ browser the user started with `--remote-debugging-port`, on the tab that is
38
+ already open. The tab keeps its own window size (no viewport override), and
39
+ `browser_close` detaches instead of terminating the user's browser (a blank tab
40
+ created only because no page existed is closed). A port that is not listening
41
+ now fails with the port, a Chrome/Edge start command, and an explicit
42
+ statement that no profile was launched in its place; attach never falls back
43
+ to a fresh profile.
44
+ - **Persistent profile option.** `runtime.browser.userDataDir` points a launched
45
+ browser at one dedicated profile, so a sign-in done once is reused on later
46
+ runs. The default is still a fresh temporary profile, which cannot see the
47
+ user's daily cookies; the README spells out the trade-off and ignores
48
+ `userDataDir` while `attachPort` is set.
49
+ - **Human checks hand back instead of failing.** `lib/browser.js` classifies
50
+ page text for a sign-in wall, CAPTCHA / "confirm you are human", SMS or
51
+ one-time code, two-factor, and QR login. `browser_open`, `browser_click`, and a
52
+ submitting `browser_type` stop at such a page and return `[attention]` with
53
+ the page, the check, where the person finishes it, and the next call — never a
54
+ failure. New `browser_await_human` polls until the check is gone and reports
55
+ ok, or hands back again at its timeout. It never solves, types, or scans the
56
+ check. A headless launch explains that it has no window and points at
57
+ `headless: false` or attach.
58
+ - **Audit distinguishes the connection.** Every browser audit line carries
59
+ `meta.session: "attach" | "launch"`, plus `meta.port` and the reused tab for
60
+ attach, or `meta.profile` / `meta.persistentProfile` / `meta.headless` for a
61
+ launch. Human hand-offs are recorded as `kind: "attention"`,
62
+ `decision: "attention"`, `result: "needs-human"`; attach failures record
63
+ `rule: "runtime/attach-failed"` with the actionable message rather than being
64
+ mistaken for a provider error.
65
+
66
+ ### Changed
67
+
68
+ - The domain allow-list, irreversible-action confirmation, file-upload refusal,
69
+ stop switch, and worker-tool guard all sit in the same call path as before, so
70
+ they apply unchanged on an attach connection; tests cover each one there.
71
+ - `browser_type` masks the read-back value for a password field.
12
72
 
13
73
  ### Fixed
14
74
 
15
- - **Line endings in `bin/` and `lib/`.** Added `.gitattributes` with
16
- `*.js text eol=lf` for both directories and normalized the tracked files to
17
- LF. npm rewrites the shebang line of bin scripts during install (CRLF → LF,
18
- one byte per file), which made `doctor`'s registry checksum comparison report
19
- a false `Registry match` failure for `bin/*.js` on npm-installed copies. With
20
- the tarball now shipping LF, installed files match the published package
21
- byte-for-byte.
75
+ - **Costs are grouped by currency.** A run that used a USD-priced route and a
76
+ CNY-priced route used to add their micro-units and label the sum with the
77
+ first model's currency. It now keeps one subtotal per currency and prints
78
+ them separately (`¥0.0952 + $0.0248`) in the run line, `superagent_list`'s
79
+ ledger line, the `watch` footer, the exported `README.md`, and the HTML
80
+ report; a mixed window gets one cost curve per currency. Single-currency runs
81
+ keep the existing `¥0.3600` format, and an unpriced model stays `unpriced`
82
+ rather than becoming zero.
22
83
 
84
+ ## 0.13.0 — 2026-11-15
85
+
86
+ ### Added
87
+
88
+ - **Goal mode.** `superagent_start` accepts `goal_mode: true` with an
89
+ `acceptance` list, and the run no longer ends when its subtasks do. Each
90
+ condition is `{id?, text, check?}`; a `command` or `file` check is executed by
91
+ the plugin, so that verdict rests on a real exit code or a real file, and only
92
+ an unchecked condition goes to an independent acceptance model. A failed round
93
+ starts another with what is still missing, bounded by `max_rounds` (5),
94
+ `max_wall_clock_minutes` (60), and `no_progress_rounds` (2), and stops with a
95
+ written reason on the round cap, the wall clock, the deadline, a budget stop,
96
+ an open attention item, or two identical failing rounds. One notification when
97
+ the loop ends, none between rounds. `lib/goal.js`; off unless asked for, and it
98
+ adds no tool.
99
+ - **Scheduled runs.** New `superagent_schedule` tool (`create`, `list`, `pause`,
100
+ `resume`, `delete`, `run-now`) stores a plan — goal or expanded template, cron
101
+ or fixed interval, time zone, its own budget and concurrency policy — and
102
+ starts runs with nobody calling `superagent_start`. `lib/cron.js` is a
103
+ zero-dependency 5-field parser (`*`, `*/n`, ranges, lists, month and weekday
104
+ names, 0 or 7 for Sunday; seconds, `@`-macros, `L`, `W`, `#`, and `?` are
105
+ refused by field). Missed windows are not replayed: `latest` runs the newest
106
+ one and records the rest as missed, `none` skips them. A plan never overlaps
107
+ itself, one slot stays reserved for manual runs by default, and three
108
+ consecutive failures pause the plan and say so once. Plans survive a host
109
+ restart, and an install with no plans behaves exactly as before.
110
+ - **Plan honesty and capability preflight.** The planner now returns
111
+ `ambiguities` (phrases it cannot map to a concrete object), `needsInput`
112
+ (questions only the user can answer), per-subtask `assumptions`, and
113
+ `requires` capability tags. A plan that only raises questions stops the run as
114
+ one decision point instead of guessing; assumptions are stored on the subtask
115
+ and printed in status and the report. `preflightCapabilities` compares
116
+ `requires` with the tools the session actually has before a worker starts: a
117
+ missing capability blocks that subtask with the capability and the fix named,
118
+ cascades `skipped` to everything downstream, and is never counted as success.
119
+ When the host cannot list its tools the preflight records `unavailable` and
120
+ blocks nothing.
121
+ - **User profile.** Optional cross-task memory (`memoryUserProfile: true`) in
122
+ `lib/user-memory.js`: three categories (`fact`, `preference`, `decision`) in
123
+ three files, a decision stored only with its reason, `superagent_memory` with
124
+ `layer: "user"` reading and writing it, and forgetting as a real deletion
125
+ under a lock with no tombstone. Everything is redacted before it is written,
126
+ and nothing is constructed unless the operator turns it on.
127
+ - **Conversation console.** `lib/console.js` and `public/console.html` serve a
128
+ loopback page (`consolePort`) that talks to a real Host Session through
129
+ `sessionController` — create, prompt, follow, observe state — so a conversation
130
+ can be started, followed up, watched while its derived run works, and have its
131
+ attention questions answered from the page. Server-sent events stream updates;
132
+ the one-time token is written to `<stateDir>/console.json`. Without
133
+ `sessionController` the page says it is unavailable instead of drawing a
134
+ fake conversation.
135
+ - **Runtime control: a real browser and, on Windows, the real desktop.** New
136
+ opt-in layer (`lib/browser.js`, `lib/desktop.js`, `lib/runtime-control.js`)
137
+ that registers `browser_*` and `desktop_*` tools only when
138
+ `runtime.enabled` is true. The browser is driven over the DevTools protocol
139
+ through Node's built-in `WebSocket` and gets its own `--user-data-dir`, so
140
+ there is no npm dependency and no access to the user's cookies or logins. The
141
+ desktop half compiles a `user32.dll` helper with `Add-Type` inside
142
+ `powershell.exe`, posts input without activating the target window by default,
143
+ and only goes foreground on `activate: true` when the config allows it.
144
+ Element lookup accepts visible text, ARIA name, role, CSS selector, or the
145
+ index a previous `browser_elements` returned, and every click and typing call
146
+ screenshots afterwards.
147
+ - **Gates and audit.** An emergency stop file refuses every action while it
148
+ exists; `file://`, other non-HTTP schemes, and hosts outside the allowlist are
149
+ refused; file inputs are refused; labels that read submit/delete/pay (or 提交/
150
+ 删除/支付) need `confirm: true`. Every attempt writes one audit event with
151
+ action, target, decision, result, rule, and duration — including refusals,
152
+ which used to be indistinguishable from failures.
153
+ - **Guard coverage for worker agents.** `lib/guard.js` refuses `browser_*` and
154
+ `desktop_*` calls from bound child agents with rule `guard/runtime-tool`,
155
+ unless `guard.allowRuntimeTools` is set. Runtime control belongs to the
156
+ session that mounted the plugin; a worker driving the user's screen is not
157
+ something to allow by default.
158
+ - **Two runnable proofs.** `scripts/runtime-demo.mjs` and
159
+ `scripts/runtime-desktop-demo.mjs` assert against the target's own state (a
160
+ DOM counter, a window's click counter and received characters) rather than
161
+ against the tool's own report.
162
+
163
+ ### Changed
164
+
165
+ - The default tool set is twelve: `superagent_schedule` joins the existing
166
+ eleven. `bin/doctor.js` and its test expect twelve, and a profile that never
167
+ enables runtime control still sees exactly these twelve.
168
+ - `README.md` gained "Goal mode", "Scheduled runs", "Conversation console",
169
+ "User profile", and the plan-honesty and preflight entries under
170
+ "Progress, decisions, and artifacts", and its tool table matches the twelve
171
+ registered tools.
172
+
173
+ ### Fixed
174
+
175
+ - **Worker checkouts and deliverable verdicts.** A worker starts in its own
176
+ worktree and its prompt names the root that relative paths resolve against.
177
+ A deliverable found only in the base checkout is reported as `misplaced`, not
178
+ `missing` — one means the file was produced in the wrong root, the other means
179
+ it was not produced at all. The worktree pool is anchored to the session's
180
+ sandbox boundary, so a host started from another directory no longer creates
181
+ checkouts outside the workspace it guards.
182
+
183
+ ### Notes
184
+
185
+ - `README.md` gained a "Runtime control" section that lists the tools, the
186
+ gates, and the boundaries that are real: no borrowing of existing browser
187
+ logins, no CAPTCHA solving, no anti-detection, and no background typing into
188
+ Chromium or Electron content.
189
+ - `Add-Type` needs a writable `%TEMP%`. The desktop helper points `TEMP`/`TMP`
190
+ at `%LOCALAPPDATA%/Temp/dsh-runtime-control`, because a restricted token that
191
+ can read `C:\Windows\TEMP` but not write there makes the C# compiler report a
192
+ misleading "source file not found".
193
+
194
+ ## 0.12.1 — 2026-11-15
195
+
196
+ ### Fixed
197
+
198
+ - **Line endings in `bin/` and `lib/`.** Added `.gitattributes` with
199
+ `*.js text eol=lf` for both directories and normalized the tracked files to
200
+ LF. npm rewrites the shebang line of bin scripts during install (CRLF → LF,
201
+ one byte per file), which made `doctor`'s registry checksum comparison report
202
+ a false `Registry match` failure for `bin/*.js` on npm-installed copies. With
203
+ the tarball now shipping LF, installed files match the published package
204
+ byte-for-byte.
205
+
23
206
  ## 0.12.0 — 2026-11-15
24
207
 
25
208
  ### Added
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Admire (LittleChenLiya)
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Admire (LittleChenLiya)
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.