@waq666/pneuma 0.7.1 → 0.8.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/README.md +242 -206
- package/bin/dsc.js +9 -3
- package/bin/headless.cjs +1 -1
- package/lib/adapter/transcript.d.ts +19 -2
- package/lib/adapter/transcript.js +71 -14
- package/lib/app/AgentsOverlay.js +7 -6
- package/lib/app/App.js +1 -1
- package/lib/app/ApprovalCard.js +15 -9
- package/lib/app/ChatView.d.ts +3 -1
- package/lib/app/ChatView.js +21 -17
- package/lib/app/Composer.js +22 -4
- package/lib/app/MarkdownView.js +2 -1
- package/lib/app/ModelPicker.js +7 -6
- package/lib/app/PickerFrame.d.ts +4 -0
- package/lib/app/PickerFrame.js +18 -0
- package/lib/app/PlanReviewCard.js +2 -1
- package/lib/app/PresetPicker.js +8 -7
- package/lib/app/SessionPicker.js +21 -20
- package/lib/app/SettingsOverlay.js +1 -1
- package/lib/app/SkillsPicker.js +7 -6
- package/lib/app/StatusBar.js +3 -15
- package/lib/app/TaskStrips.js +1 -4
- package/lib/app/TimelineRail.js +2 -1
- package/lib/app/ToolCard.js +2 -6
- package/lib/app/Welcome.d.ts +1 -0
- package/lib/app/Welcome.js +1 -4
- package/lib/app/click.d.ts +0 -2
- package/lib/app/click.js +2 -21
- package/lib/app/display-width.d.ts +16 -0
- package/lib/app/display-width.js +33 -0
- package/lib/app/markdown.d.ts +1 -3
- package/lib/app/markdown.js +2 -19
- package/lib/app/scroll-model.js +1 -1
- package/lib/contract/approval.d.ts +91 -0
- package/lib/contract/approval.js +1 -0
- package/lib/contract/mode.d.ts +69 -0
- package/lib/contract/mode.js +1 -0
- package/lib/contract/plugin.d.ts +240 -0
- package/lib/contract/plugin.js +1 -0
- package/lib/contract/runtime.d.ts +282 -0
- package/lib/contract/runtime.js +1 -0
- package/lib/contract/session.d.ts +208 -0
- package/lib/contract/session.js +36 -0
- package/lib/contract/settings.d.ts +242 -0
- package/lib/contract/settings.js +1 -0
- package/lib/contract/snapshot.d.ts +453 -0
- package/lib/contract/snapshot.js +1 -0
- package/lib/contract/task.d.ts +189 -0
- package/lib/contract/task.js +10 -0
- package/lib/contract/transcript.d.ts +358 -0
- package/lib/contract/transcript.js +1 -0
- package/lib/contract/usage.d.ts +132 -0
- package/lib/contract/usage.js +10 -0
- package/lib/contract.d.ts +20 -1968
- package/lib/contract.js +19 -30
- package/lib/core/agent-roles.d.ts +1 -1
- package/lib/core/agent-roles.js +6 -5
- package/lib/core/approval-floor.d.ts +9 -0
- package/lib/core/approval-floor.js +152 -25
- package/lib/core/attachments.d.ts +185 -0
- package/lib/core/attachments.js +425 -0
- package/lib/core/bytes.d.ts +14 -0
- package/lib/core/bytes.js +28 -0
- package/lib/core/call-meaning.d.ts +20 -0
- package/lib/core/call-meaning.js +347 -0
- package/lib/core/cdp/actions.js +6 -0
- package/lib/core/cdp/launch.js +2 -2
- package/lib/core/cdp/report.d.ts +27 -0
- package/lib/core/cdp/report.js +50 -0
- package/lib/core/cdp/ring-buffer.d.ts +25 -0
- package/lib/core/cdp/ring-buffer.js +44 -0
- package/lib/core/cdp/snapshot.js +5 -9
- package/lib/core/cdp/transport.js +1 -1
- package/lib/core/clamp.d.ts +20 -0
- package/lib/core/clamp.js +24 -0
- package/lib/core/clock.d.ts +16 -0
- package/lib/core/clock.js +20 -0
- package/lib/core/command-policy.js +33 -1
- package/lib/core/commands-completion.d.ts +28 -0
- package/lib/core/commands-completion.js +108 -30
- package/lib/core/compact.d.ts +36 -6
- package/lib/core/compact.js +89 -17
- package/lib/core/desktop-control.js +1 -3
- package/lib/core/dsh-compat/llm-usage-event.d.ts +78 -0
- package/lib/core/dsh-compat/llm-usage-event.js +91 -0
- package/lib/core/dsh-compat/presentation.d.ts +84 -0
- package/lib/core/dsh-compat/presentation.js +105 -0
- package/lib/core/dsh-compat/resolve-hook.d.ts +3 -3
- package/lib/core/dsh-compat/resolve-hook.js +41 -13
- package/lib/core/dsh-compat/service-map.d.ts +52 -0
- package/lib/core/dsh-compat/service-map.js +87 -0
- package/lib/core/dsh-compat/session-bridge.d.ts +107 -0
- package/lib/core/dsh-compat/session-bridge.js +376 -0
- package/lib/core/dsh-compat/session-events.d.ts +54 -0
- package/lib/core/dsh-compat/session-events.js +297 -0
- package/lib/core/dsh-compat/shims/credentials.d.ts +62 -0
- package/lib/core/dsh-compat/shims/credentials.js +86 -0
- package/lib/core/dsh-compat/shims/home-paths.d.ts +77 -0
- package/lib/core/dsh-compat/shims/home-paths.js +143 -0
- package/lib/core/dsh-compat/tools-facade.d.ts +31 -1
- package/lib/core/dsh-compat/tools-facade.js +207 -3
- package/lib/core/err-text.d.ts +5 -0
- package/lib/core/err-text.js +5 -0
- package/lib/core/events.d.ts +31 -2
- package/lib/core/git-info.d.ts +127 -15
- package/lib/core/git-info.js +315 -34
- package/lib/core/git-surface.d.ts +17 -0
- package/lib/core/git-surface.js +7 -0
- package/lib/core/hooks.d.ts +19 -2
- package/lib/core/hooks.js +57 -13
- package/lib/core/host-methods.d.ts +1 -1
- package/lib/core/host-methods.js +4 -0
- package/lib/core/image-diet.js +1 -4
- package/lib/core/json-text.d.ts +11 -0
- package/lib/core/json-text.js +18 -0
- package/lib/core/learnings/skill-write.d.ts +1 -7
- package/lib/core/learnings/skill-write.js +3 -37
- package/lib/core/lifecycle-hooks.d.ts +11 -3
- package/lib/core/lifecycle-hooks.js +33 -42
- package/lib/core/llm.d.ts +42 -0
- package/lib/core/llm.js +40 -25
- package/lib/core/loop.d.ts +11 -1
- package/lib/core/loop.js +95 -28
- package/lib/core/lsp/client.js +30 -17
- package/lib/core/lsp/normalize.d.ts +0 -2
- package/lib/core/lsp/normalize.js +1 -6
- package/lib/core/lsp/servers.js +1 -4
- package/lib/core/mcp.d.ts +18 -0
- package/lib/core/mcp.js +60 -16
- package/lib/core/microcompact.d.ts +45 -0
- package/lib/core/microcompact.js +128 -0
- package/lib/core/native-bridge.js +2 -10
- package/lib/core/path-policy.d.ts +13 -1
- package/lib/core/path-policy.js +87 -18
- package/lib/core/permission-presets.d.ts +9 -5
- package/lib/core/permission-presets.js +14 -7
- package/lib/core/permission-scope.d.ts +65 -0
- package/lib/core/permission-scope.js +109 -0
- package/lib/core/plugin-bundle.d.ts +95 -0
- package/lib/core/plugin-bundle.js +137 -0
- package/lib/core/plugin-loader.d.ts +36 -1
- package/lib/core/plugin-loader.js +336 -12
- package/lib/core/plugin-patch.d.ts +64 -0
- package/lib/core/plugin-patch.js +146 -0
- package/lib/core/plugin-registry.d.ts +14 -0
- package/lib/core/plugin-registry.js +2 -0
- package/lib/core/prefs.js +40 -2
- package/lib/core/presets.d.ts +11 -0
- package/lib/core/presets.js +61 -22
- package/lib/core/profile-dir.d.ts +5 -0
- package/lib/core/profile-dir.js +40 -0
- package/lib/core/prompt.js +55 -19
- package/lib/core/ptc.d.ts +8 -2
- package/lib/core/ptc.js +18 -4
- package/lib/core/records.d.ts +16 -0
- package/lib/core/records.js +22 -0
- package/lib/core/remote/notify.js +1 -3
- package/lib/core/remote/push.js +2 -6
- package/lib/core/sandbox/execpolicy.js +27 -3
- package/lib/core/sandbox/net-proxy.js +2 -2
- package/lib/core/sandbox/policy.d.ts +1 -1
- package/lib/core/sandbox/policy.js +21 -15
- package/lib/core/sandbox/win/account.js +1 -4
- package/lib/core/sandbox/win/acl.js +1 -6
- package/lib/core/sandbox/win/backend.d.ts +24 -3
- package/lib/core/sandbox/win/backend.js +73 -23
- package/lib/core/sandbox/win/doctor.js +1 -4
- package/lib/core/sandbox/win/runner-entry.js +1 -6
- package/lib/core/sandbox/win/setup.js +1 -4
- package/lib/core/sandbox/win/utf16.d.ts +11 -0
- package/lib/core/sandbox/win/utf16.js +15 -0
- package/lib/core/sandbox/win/wfp.js +1 -4
- package/lib/core/schedule/rule.d.ts +0 -17
- package/lib/core/schedule/rule.js +1 -3
- package/lib/core/schedule/runner.d.ts +5 -2
- package/lib/core/schedule/runner.js +32 -9
- package/lib/core/schedule/store.d.ts +0 -2
- package/lib/core/schedule/store.js +2 -9
- package/lib/core/session-index.d.ts +50 -0
- package/lib/core/session-index.js +169 -3
- package/lib/core/session.d.ts +89 -13
- package/lib/core/session.js +385 -32
- package/lib/core/shell-quote.d.ts +21 -0
- package/lib/core/shell-quote.js +24 -0
- package/lib/core/side-ask.d.ts +52 -0
- package/lib/core/side-ask.js +89 -0
- package/lib/core/skills.d.ts +16 -0
- package/lib/core/skills.js +45 -8
- package/lib/core/snapshot-throttle.d.ts +8 -0
- package/lib/core/snapshot-throttle.js +24 -0
- package/lib/core/spill.d.ts +11 -5
- package/lib/core/spill.js +35 -36
- package/lib/core/strings.d.ts +21 -0
- package/lib/core/strings.js +33 -0
- package/lib/core/terminal-env.d.ts +61 -0
- package/lib/core/terminal-env.js +327 -0
- package/lib/core/text-format.d.ts +17 -0
- package/lib/core/text-format.js +26 -0
- package/lib/core/todo-reminder.d.ts +19 -14
- package/lib/core/todo-reminder.js +14 -23
- package/lib/core/token-estimate.d.ts +18 -2
- package/lib/core/token-estimate.js +10 -2
- package/lib/core/tool-result-prune.d.ts +42 -0
- package/lib/core/tool-result-prune.js +47 -0
- package/lib/core/tool-search.d.ts +3 -2
- package/lib/core/tool-search.js +3 -2
- package/lib/core/tools/bash.d.ts +35 -3
- package/lib/core/tools/bash.js +168 -41
- package/lib/core/tools/fs-tools.js +18 -17
- package/lib/core/tools/image-tool.d.ts +2 -0
- package/lib/core/tools/image-tool.js +59 -0
- package/lib/core/tools/path-args.d.ts +4 -0
- package/lib/core/tools/path-args.js +22 -0
- package/lib/core/tools/search-tools.d.ts +30 -0
- package/lib/core/tools/search-tools.js +321 -34
- package/lib/core/tools.d.ts +82 -0
- package/lib/core/tools.js +21 -0
- package/lib/core/transcript-text.d.ts +19 -0
- package/lib/core/transcript-text.js +44 -0
- package/lib/core/ui-boot-source.d.ts +5 -0
- package/lib/core/ui-boot-source.js +10 -3
- package/lib/core/ui-bundles.d.ts +80 -6
- package/lib/core/ui-bundles.js +700 -76
- package/lib/core/ui-events.d.ts +10 -0
- package/lib/core/ui-events.js +25 -0
- package/lib/core/ui-methods.d.ts +1 -1
- package/lib/core/ui-methods.js +42 -13
- package/lib/core/ui-route.js +11 -7
- package/lib/core/ui-server.d.ts +6 -0
- package/lib/core/ui-server.js +106 -1
- package/lib/core/unified-diff.d.ts +35 -0
- package/lib/core/unified-diff.js +86 -0
- package/lib/core/usage-log.js +39 -0
- package/lib/core/web-http.d.ts +1 -1
- package/lib/core/web-http.js +1 -3
- package/lib/host/kernel.js +57 -41
- package/lib/plugins/agent.js +101 -20
- package/lib/plugins/approval-floor.js +12 -8
- package/lib/plugins/approval.js +252 -80
- package/lib/plugins/ask.js +60 -8
- package/lib/plugins/browser.js +32 -84
- package/lib/plugins/commands.js +167 -57
- package/lib/plugins/compact.d.ts +2 -2
- package/lib/plugins/compact.js +200 -30
- package/lib/plugins/computer-use.js +34 -18
- package/lib/plugins/dock-browser.js +24 -65
- package/lib/plugins/dsh-compat.js +7 -0
- package/lib/plugins/file-review.js +59 -15
- package/lib/plugins/git.js +16 -8
- package/lib/plugins/goal.js +9 -8
- package/lib/plugins/hooks.js +4 -2
- package/lib/plugins/host-stdio.js +14 -16
- package/lib/plugins/lifecycle-hooks.d.ts +5 -4
- package/lib/plugins/lifecycle-hooks.js +12 -10
- package/lib/plugins/llm.js +74 -33
- package/lib/plugins/lsp.js +22 -27
- package/lib/plugins/mcp.js +16 -17
- package/lib/plugins/memory.js +3 -24
- package/lib/plugins/microcompact.d.ts +4 -1
- package/lib/plugins/microcompact.js +117 -19
- package/lib/plugins/mode.js +30 -11
- package/lib/plugins/permission-presets.d.ts +2 -1
- package/lib/plugins/permission-presets.js +55 -35
- package/lib/plugins/plugin-manager.js +4 -6
- package/lib/plugins/presets.js +56 -27
- package/lib/plugins/prompt.js +54 -11
- package/lib/plugins/ptc.d.ts +13 -0
- package/lib/plugins/ptc.js +121 -24
- package/lib/plugins/remote/types.d.ts +1 -1
- package/lib/plugins/remote/types.js +11 -0
- package/lib/plugins/remote.js +14 -15
- package/lib/plugins/runtime.js +91 -14
- package/lib/plugins/sandbox.js +181 -60
- package/lib/plugins/schedule.js +12 -11
- package/lib/plugins/self-improve.js +28 -18
- package/lib/plugins/session-search.js +18 -13
- package/lib/plugins/session-title.js +1 -1
- package/lib/plugins/session.js +103 -25
- package/lib/plugins/settings.js +16 -40
- package/lib/plugins/skills.js +18 -1
- package/lib/plugins/spill.js +18 -11
- package/lib/plugins/subagent.js +208 -42
- package/lib/plugins/team.js +11 -5
- package/lib/plugins/todo.d.ts +1 -1
- package/lib/plugins/todo.js +25 -19
- package/lib/plugins/tool-search.js +47 -28
- package/lib/plugins/tools-default.js +89 -5
- package/lib/plugins/tools.js +3 -3
- package/lib/plugins/transcript.js +116 -9
- package/lib/plugins/web-search.d.ts +1 -1
- package/lib/plugins/web-search.js +25 -16
- package/lib/plugins/webserver.js +40 -7
- package/lib/remote/assets/app-B3Id1EBq.js +14 -0
- package/lib/remote/assets/index.html +2 -2
- package/lib/remote/assets/{style-DIB6729x.css → style-NtlpbKOI.css} +1 -1
- package/lib/services/types.d.ts +247 -29
- package/lib/tools/plugin-cli.d.ts +1 -0
- package/lib/tools/plugin-cli.js +209 -0
- package/lib/ui/assets/app-B-Jx5dnh.js +90 -0
- package/lib/ui/assets/{chunk-BajyYBss.js → chunk-Bfdlo8Me.js} +1 -1
- package/lib/ui/assets/chunk-DGX-i4eb.js +12 -0
- package/lib/ui/assets/index.html +62 -14
- package/lib/ui/assets/style-WzxwEPaE.css +1 -0
- package/lib/ui/frames.js +1 -3
- package/lib/ui/index.d.ts +30 -1
- package/lib/ui/index.js +29 -0
- package/lib/ui/manifest.d.ts +24 -6
- package/lib/ui/manifest.js +3 -2
- package/lib/ui/plugins/actions/bundle.json +8 -0
- package/lib/ui/plugins/actions/client.js +43 -0
- package/lib/ui/plugins/ask/bundle.json +8 -0
- package/lib/ui/plugins/ask/client.js +415 -0
- package/lib/ui/plugins/browser/bundle.json +8 -0
- package/lib/ui/plugins/composer/bundle.json +9 -0
- package/lib/ui/plugins/composer/client.js +1806 -1087
- package/lib/ui/plugins/files/bundle.json +8 -0
- package/lib/ui/plugins/files/client.js +13 -98
- package/lib/ui/plugins/manifest.json +1 -104
- package/lib/ui/plugins/palette/bundle.json +8 -0
- package/lib/ui/plugins/palette/client.js +360 -0
- package/lib/ui/plugins/plugins/bundle.json +8 -0
- package/lib/ui/plugins/plugins/client.js +116 -38
- package/lib/ui/plugins/preview/bundle.json +8 -0
- package/lib/ui/plugins/preview/client.js +6 -16
- package/lib/ui/plugins/prompt/bundle.json +8 -0
- package/lib/ui/plugins/prompt/client.js +81 -47
- package/lib/ui/plugins/sessions/bundle.json +8 -0
- package/lib/ui/plugins/sessions/client.js +157 -111
- package/lib/ui/plugins/settings/bundle.json +8 -0
- package/lib/ui/plugins/settings/client.js +184 -170
- package/lib/ui/plugins/skills/bundle.json +8 -0
- package/lib/ui/plugins/skills/client.js +161 -79
- package/lib/ui/plugins/status/bundle.json +8 -0
- package/lib/ui/plugins/status/client.js +165 -26
- package/lib/ui/plugins/statusbar/bundle.json +9 -0
- package/lib/ui/plugins/statusbar/client.js +100 -144
- package/lib/ui/plugins/tasks/bundle.json +8 -0
- package/lib/ui/plugins/team/bundle.json +8 -0
- package/lib/ui/plugins/team/client.js +60 -58
- package/lib/ui/plugins/terminal/bundle.json +8 -0
- package/lib/ui/plugins/terminal/client.js +1 -7
- package/lib/ui/plugins/trace/bundle.json +11 -0
- package/lib/ui/plugins/trace/client.js +86 -179
- package/lib/ui/plugins/transcript/bundle.json +8 -0
- package/lib/ui/plugins/transcript/client.js +1608 -1243
- package/lib/ui/sdk/@dsc/ui/index.d.ts +54 -16
- package/lib/ui/sdk/@dsc/ui/package.json +1 -1
- package/lib/ui/sdk/@dsc/ui-core/contract.d.ts +20 -1968
- package/lib/ui/sdk/@dsc/ui-core/core/attachments.d.ts +185 -0
- package/lib/ui/sdk/@dsc/ui-core/core/bytes.d.ts +14 -0
- package/lib/ui/sdk/@dsc/ui-core/core/err-text.d.ts +18 -0
- package/lib/ui/sdk/@dsc/ui-core/core/git-surface.d.ts +17 -0
- package/lib/ui/sdk/@dsc/ui-core/core/json-text.d.ts +11 -0
- package/lib/ui/sdk/@dsc/ui-core/core/path-policy.d.ts +44 -0
- package/lib/ui/sdk/@dsc/ui-core/core/records.d.ts +16 -0
- package/lib/ui/sdk/@dsc/ui-core/core/throughput.d.ts +46 -0
- package/lib/ui/sdk/@dsc/ui-core/core/token-estimate.d.ts +18 -2
- package/lib/ui/sdk/@dsc/ui-core/core/unified-diff.d.ts +35 -0
- package/lib/ui/sdk/@dsc/ui-core/package.json +1 -1
- package/lib/ui/sdk/@dsc/ui-core/ui/index.d.ts +30 -1
- package/lib/ui/sdk/@dsc/ui-core/ui/manifest.d.ts +24 -6
- package/lib/ui/sdk/@dsc/ui-core/ui/services.d.ts +19 -8
- package/lib/ui/sdk/@dsc/ui-core/ui/signal.d.ts +49 -0
- package/lib/ui/sdk/@dsc/ui-dockkit/dock-model.d.ts +17 -3
- package/lib/ui/sdk/@dsc/ui-dockkit/dock-state.d.ts +1 -1
- package/lib/ui/sdk/@dsc/ui-dockkit/package.json +1 -1
- package/lib/ui/sdk/@dsc/ui-layout/app.d.ts +4 -0
- package/lib/ui/sdk/@dsc/ui-layout/appearance.d.ts +6 -1
- package/lib/ui/sdk/@dsc/ui-layout/host-channel.d.ts +21 -0
- package/lib/ui/sdk/@dsc/ui-layout/index.d.ts +1 -0
- package/lib/ui/sdk/@dsc/ui-layout/package.json +1 -1
- package/lib/ui/sdk/@dsc/ui-layout/page-state.d.ts +1 -1
- package/lib/ui/sdk/@dsc/ui-layout/runtime-context.d.ts +10 -1
- package/lib/ui/sdk/@dsc/ui-layout/thread-view.d.ts +1 -1
- package/lib/ui/sdk/@dsc/ui-layout/usage-today.d.ts +11 -0
- package/lib/ui/sdk/@dsc/ui-primitives/dialog-focus.d.ts +30 -0
- package/lib/ui/sdk/@dsc/ui-primitives/error-text.d.ts +12 -0
- package/lib/ui/sdk/@dsc/ui-primitives/git-surface.d.ts +9 -0
- package/lib/ui/sdk/@dsc/ui-primitives/highlight.d.ts +23 -0
- package/lib/ui/sdk/@dsc/ui-primitives/humanize-error.d.ts +35 -0
- package/lib/ui/sdk/@dsc/ui-primitives/icons-workspace.d.ts +33 -0
- package/lib/ui/sdk/@dsc/ui-primitives/icons.d.ts +21 -3
- package/lib/ui/sdk/@dsc/ui-primitives/image-lightbox.d.ts +21 -0
- package/lib/ui/sdk/@dsc/ui-primitives/index.d.ts +16 -0
- package/lib/ui/sdk/@dsc/ui-primitives/markdown.d.ts +10 -14
- package/lib/ui/sdk/@dsc/ui-primitives/package.json +1 -1
- package/lib/ui/sdk/@dsc/ui-primitives/panels.d.ts +31 -8
- package/lib/ui/sdk/@dsc/ui-primitives/paths.d.ts +2 -0
- package/lib/ui/sdk/@dsc/ui-primitives/review-findings-card.d.ts +25 -0
- package/lib/ui/sdk/@dsc/ui-primitives/review-findings.d.ts +64 -0
- package/lib/ui/sdk/@dsc/ui-primitives/review-notice-card.d.ts +27 -0
- package/lib/ui/sdk/@dsc/ui-primitives/review-notice.d.ts +80 -0
- package/lib/ui/sdk/@dsc/ui-primitives/signal.d.ts +9 -0
- package/lib/ui/sdk/@dsc/ui-primitives/sizes.d.ts +15 -0
- package/lib/ui/sdk/@dsc/ui-primitives/skeleton.d.ts +39 -0
- package/lib/ui/sdk/@dsc/ui-primitives/snapshot.d.ts +46 -0
- package/lib/ui/sdk/@dsc/ui-primitives/thread-resizer.d.ts +3 -3
- package/lib/ui/sdk/@dsc/ui-primitives/throughput.d.ts +13 -0
- package/lib/ui/sdk/@dsc/ui-primitives/tokens.d.ts +9 -0
- package/lib/ui/sdk/@dsc/ui-primitives/tool-args.d.ts +1 -1
- package/lib/ui/sdk/@dsc/ui-primitives/tool-summary.d.ts +30 -6
- package/lib/ui/sdk/@dsc/ui-primitives/unified-diff.d.ts +10 -0
- package/lib/ui/sdk/@dsc/ui-renderer/boot.d.ts +10 -1
- package/lib/ui/sdk/@dsc/ui-renderer/cordis-host.d.ts +113 -0
- package/lib/ui/sdk/@dsc/ui-renderer/package.json +1 -1
- package/lib/ui/sdk/@dsc/ui-slots/package.json +1 -1
- package/lib/ui/services.d.ts +19 -8
- package/lib/ui/services.js +20 -12
- package/lib/ui/signal.d.ts +49 -0
- package/lib/ui/signal.js +57 -0
- package/lib/ui/tui-plugins.js +36 -16
- package/package.json +71 -58
- package/lib/remote/assets/app-DAcUCOEn.js +0 -14
- package/lib/ui/assets/app-B70nVIKd.js +0 -69
- package/lib/ui/assets/chunk-BGcgwlCI.js +0 -12
- package/lib/ui/assets/style-Bq01xH_b.css +0 -1
package/lib/plugins/ask.js
CHANGED
|
@@ -16,31 +16,59 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { randomUUID } from 'node:crypto';
|
|
18
18
|
import { resolvePluginConfig } from '../core/plugin-registry.js';
|
|
19
|
+
import { clampInt as clamp } from '../core/clamp.js';
|
|
19
20
|
/** 配置键(`~/.dsc/plugins.json` 条目树里 `file` 等于这个名字那一项的 `config`)。 */
|
|
20
21
|
const CONFIG_KEY = 'ask';
|
|
21
22
|
const DEFAULTS = { maxQuestions: 3, maxOptions: 4 };
|
|
23
|
+
/** 等用户答一张卡最多多久(毫秒):默认 15 分钟。 */
|
|
24
|
+
const DEFAULT_WAIT_MS = 900_000;
|
|
22
25
|
/** 中断这一轮时替没答的题写的实话(模型据此知道这句不是用户的话)。 */
|
|
23
26
|
const INTERRUPTED = '(用户没回答就中断了这一轮)';
|
|
24
27
|
/** 程序退出时替没答的题写的实话。 */
|
|
25
28
|
const EXITED = '(用户退出了程序,这个问题没回答)';
|
|
26
29
|
/** 上一批还没答完就被新的一批顶掉时,替没答的题写的实话。 */
|
|
27
30
|
const SUPERSEDED = '(又挂了一批新问题,这一题作废)';
|
|
31
|
+
/**
|
|
32
|
+
* 等满时限还没人答时,替没答的题写的实话。
|
|
33
|
+
*
|
|
34
|
+
* 卡片同一时刻撤掉(不再挂在输入框上方),模型拿到这句之后自己决定接着做还是换个方式问。
|
|
35
|
+
* 为什么给公式而不是写死「15 分钟」:时限是配置项,卡片撤了、正文却写着别的秒数,
|
|
36
|
+
* 用户与模型都没法核对。
|
|
37
|
+
*/
|
|
38
|
+
function noAnswer(ms) {
|
|
39
|
+
return `(等了 ${waitLabel(ms)},用户没有回答这一题)`;
|
|
40
|
+
}
|
|
28
41
|
/**
|
|
29
42
|
* 从插件配置里取上限并夹到合理区间。
|
|
30
43
|
* @param passed - 装配时直接传进来的配置(内核挂载时的第二参数)。
|
|
31
44
|
*/
|
|
32
45
|
function readLimits(passed) {
|
|
33
46
|
const raw = resolvePluginConfig(CONFIG_KEY, passed);
|
|
34
|
-
const clamp = (value, min, max, fallback) => {
|
|
35
|
-
const num = Number(value);
|
|
36
|
-
return Number.isFinite(num) ? Math.min(Math.max(Math.round(num), min), max) : fallback;
|
|
37
|
-
};
|
|
38
47
|
return {
|
|
39
48
|
// 上限 8:再多界面就排不下,模型也记不住这么多岔路。
|
|
40
49
|
maxQuestions: clamp(raw.maxQuestions, 1, 8, DEFAULTS.maxQuestions),
|
|
41
50
|
maxOptions: clamp(raw.maxOptions, 1, 8, DEFAULTS.maxOptions),
|
|
42
51
|
};
|
|
43
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* 取一张提问卡最多等多久(毫秒):夹在 10 秒到 1 小时之间。
|
|
55
|
+
*
|
|
56
|
+
* 下界 10 秒与审批卡同档:再短人来不及看清题目;上界 1 小时,再长等于永不超时,
|
|
57
|
+
* 模型会一直挂在一次工具调用上。0.7.1 之前这里没有上限,实际由 PTC 脚本的 120 秒兜住,
|
|
58
|
+
* 于是「等用户」和「脚本跑飞」共用同一个数——2026-10-29 的报障就是它。
|
|
59
|
+
* @param passed - 装配时直接传进来的配置(内核挂载时的第二参数)。
|
|
60
|
+
*/
|
|
61
|
+
function readWaitMs(passed) {
|
|
62
|
+
const raw = resolvePluginConfig(CONFIG_KEY, passed);
|
|
63
|
+
const num = Number(raw.waitMs);
|
|
64
|
+
if (!Number.isFinite(num))
|
|
65
|
+
return DEFAULT_WAIT_MS;
|
|
66
|
+
return Math.min(Math.max(Math.round(num), 10_000), 3_600_000);
|
|
67
|
+
}
|
|
68
|
+
/** 等待时限的中文读数(给模型与界面看):整分钟就写分钟,不足一分钟写秒。 */
|
|
69
|
+
function waitLabel(ms) {
|
|
70
|
+
return ms >= 60_000 ? `${Math.round(ms / 60_000)} 分钟` : `${Math.round(ms / 1000)} 秒`;
|
|
71
|
+
}
|
|
44
72
|
/**
|
|
45
73
|
* 把「已经收到的答案 + 剩下这几题」拼成一整份答案:答过的保留原话,
|
|
46
74
|
* 没答的填同一句实话。收尾路径(中断、换会话、退出、被顶掉)共用它。
|
|
@@ -99,9 +127,21 @@ export const askPlugin = {
|
|
|
99
127
|
// 单题字段就是第 1 题的投影,和 questions[0] 同源,不会出现两处不一致。
|
|
100
128
|
const view = { id: randomUUID(), ...questions[0], questions };
|
|
101
129
|
const answers = [];
|
|
130
|
+
/**
|
|
131
|
+
* 这张卡最多等多久(毫秒):每次挂卡现读配置,改时限不用重启宿主。
|
|
132
|
+
* 它是**提问卡自己的**时限,不再借 PTC 脚本的 120 秒——那一个是防脚本跑飞的,
|
|
133
|
+
* 两个数混用就会出现「用户还在想,脚本先死了」。
|
|
134
|
+
*/
|
|
135
|
+
const waitMs = readWaitMs(passed);
|
|
136
|
+
/** 等满时限的计时器:任何一条出口(答完/中断/退出/被顶掉)都要把它撤掉。 */
|
|
137
|
+
let timer;
|
|
102
138
|
const settle = (final, wake = true) => {
|
|
103
139
|
if (!pendings.has(view.id))
|
|
104
140
|
return;
|
|
141
|
+
if (timer !== undefined) {
|
|
142
|
+
clearTimeout(timer);
|
|
143
|
+
timer = undefined;
|
|
144
|
+
}
|
|
105
145
|
pendings.delete(view.id);
|
|
106
146
|
signal.removeEventListener('abort', onAbort);
|
|
107
147
|
// 答完之后回合还要继续:状态点从「等审批」翻回 working;中断/退出交给 turn-end 收口。
|
|
@@ -116,10 +156,18 @@ export const askPlugin = {
|
|
|
116
156
|
signal.addEventListener('abort', onAbort, { once: true });
|
|
117
157
|
ctx.emit('dsc/agent-status', { sessionId: session.meta.id, path, state: 'awaiting-approval' });
|
|
118
158
|
// 信号进来就已经中断了(abort 事件不会再补发一次):立刻按「没回答」收尾,别挂死。
|
|
119
|
-
if (signal.aborted)
|
|
159
|
+
if (signal.aborted) {
|
|
120
160
|
onAbort();
|
|
121
|
-
|
|
122
|
-
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
// 等满时限就自己收尾:卡片撤掉(界面上不留一张没人管的卡),
|
|
164
|
+
// 模型拿到「没回答」的实话,接着做它能做的——不再出现「答了却没人接」。
|
|
165
|
+
timer = setTimeout(() => {
|
|
166
|
+
timer = undefined;
|
|
167
|
+
settle(withRest(questions, answers, noAnswer(waitMs)));
|
|
168
|
+
}, waitMs);
|
|
169
|
+
// 故意不 unref:这张卡在等答案,事件循环该被它钉住(进程退出时 `dsc/exit` 会收尾)。
|
|
170
|
+
touch();
|
|
123
171
|
});
|
|
124
172
|
};
|
|
125
173
|
const service = {
|
|
@@ -161,7 +209,9 @@ export const askPlugin = {
|
|
|
161
209
|
'一次可以问多个问题:它们会挂在同一张卡上让用户逐题作答、统一提交,' +
|
|
162
210
|
'你在同一个工具结果里拿到全部答案(按你给的题序)。' +
|
|
163
211
|
'什么时候用:需求真的有多种合理解释、或者下一步不可逆(要删数据、要改别人的配置)而用户没指定。' +
|
|
164
|
-
'什么时候不用:能自己查代码查出来的别问;纯确认式的「我可以继续吗」别问——计划该不该做由评审卡决定。'
|
|
212
|
+
'什么时候不用:能自己查代码查出来的别问;纯确认式的「我可以继续吗」别问——计划该不该做由评审卡决定。' +
|
|
213
|
+
`这张卡最多等 ${waitLabel(readWaitMs(passed))}:等到时限还没人答,你会拿到一句「用户没有回答」的实话,` +
|
|
214
|
+
'那不是用户说的话,别把它当答案;可以换个方式问,或者把要确认的点写进正文里。');
|
|
165
215
|
},
|
|
166
216
|
parameters: {
|
|
167
217
|
type: 'object',
|
|
@@ -195,6 +245,8 @@ export const askPlugin = {
|
|
|
195
245
|
required: ['questions'],
|
|
196
246
|
},
|
|
197
247
|
risk: 'read',
|
|
248
|
+
// 等用户作答的时间不算 PTC 脚本的时限(见 core/tools.ts 的这一位与 plugins/ptc.ts)
|
|
249
|
+
waitsForHuman: true,
|
|
198
250
|
async run(args, runCtx) {
|
|
199
251
|
limits = readLimits(passed);
|
|
200
252
|
const list = Array.isArray(args.questions) ? args.questions.slice(0, limits.maxQuestions) : [];
|
package/lib/plugins/browser.js
CHANGED
|
@@ -4,6 +4,12 @@ import { redact } from '../core/secrets.js';
|
|
|
4
4
|
import * as actions from '../core/cdp/actions.js';
|
|
5
5
|
import { BrowserProcess, probeExecutable } from '../core/cdp/launch.js';
|
|
6
6
|
import { serializeAxTree, truncateByLines, lookupSnapshotRef } from '../core/cdp/snapshot.js';
|
|
7
|
+
import { clampInt as clamp } from '../core/clamp.js';
|
|
8
|
+
import { splitList } from '../core/strings.js';
|
|
9
|
+
import { RingBuffer } from '../core/cdp/ring-buffer.js';
|
|
10
|
+
import { consoleLine, describeRef, networkLine, report, safeStringify, } from '../core/cdp/report.js';
|
|
11
|
+
/** 设置页「看当前标签页」的等待上限:浏览器没起来或页面卡住时,15 秒给结论。 */
|
|
12
|
+
const LOOK_TAB_TIMEOUT_MS = 15_000;
|
|
7
13
|
const CONFIG_KEY = 'browser';
|
|
8
14
|
const TOOL_ACT = 'browser';
|
|
9
15
|
const TOOL_LOOK = 'browser_look';
|
|
@@ -26,13 +32,6 @@ const DIALOG_TIMEOUT_MS = 300_000;
|
|
|
26
32
|
const NAVIGATE_TIMEOUT_MS = 20_000;
|
|
27
33
|
/** 短快照/控制台输出一条最多多少字符(控制台一整段堆栈会很长)。 */
|
|
28
34
|
const CONSOLE_LINE_MAX = 400;
|
|
29
|
-
/** 逗号或空白分隔的清单。 */
|
|
30
|
-
function splitList(text) {
|
|
31
|
-
return text
|
|
32
|
-
.split(/[,,\s]+/)
|
|
33
|
-
.map((entry) => entry.trim())
|
|
34
|
-
.filter((entry) => entry !== '');
|
|
35
|
-
}
|
|
36
35
|
// ── 地址策略(守卫与本插件共用;纯函数,便于自检)─────────────────────────────
|
|
37
36
|
/** 云元数据地址:这些地址无条件拒,给的理由也直说它们是干什么的。 */
|
|
38
37
|
export const CLOUD_METADATA_HOSTS = [
|
|
@@ -221,72 +220,12 @@ function absolutize(raw, base) {
|
|
|
221
220
|
throw new Error(`相对地址「${raw}」拼不到当前页面 ${base} 上`);
|
|
222
221
|
}
|
|
223
222
|
}
|
|
224
|
-
/** 定长环形缓冲:满了丢最旧的,条数改了把内容搬过去(不能让用户改个设置就丢光现状)。 */
|
|
225
|
-
class RingBuffer {
|
|
226
|
-
capacity;
|
|
227
|
-
items = [];
|
|
228
|
-
constructor(capacity) {
|
|
229
|
-
this.capacity = capacity;
|
|
230
|
-
}
|
|
231
|
-
get size() {
|
|
232
|
-
return this.items.length;
|
|
233
|
-
}
|
|
234
|
-
push(item) {
|
|
235
|
-
this.items.push(item);
|
|
236
|
-
if (this.capacity > 0 && this.items.length > this.capacity) {
|
|
237
|
-
this.items.splice(0, this.items.length - this.capacity);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
/** 按 requestId 找一条(网络条目要按响应回填状态)。 */
|
|
241
|
-
find(predicate) {
|
|
242
|
-
return this.items.find(predicate);
|
|
243
|
-
}
|
|
244
|
-
toArray() {
|
|
245
|
-
return [...this.items];
|
|
246
|
-
}
|
|
247
|
-
clear() {
|
|
248
|
-
this.items = [];
|
|
249
|
-
}
|
|
250
|
-
resize(capacity) {
|
|
251
|
-
this.capacity = capacity;
|
|
252
|
-
if (capacity > 0 && this.items.length > capacity)
|
|
253
|
-
this.items.splice(0, this.items.length - capacity);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
/** 变量值的兜底字符串化(控制台参数可能是对象或循环引用)。 */
|
|
257
|
-
function safeStringify(value) {
|
|
258
|
-
if (typeof value === 'string')
|
|
259
|
-
return value;
|
|
260
|
-
try {
|
|
261
|
-
const text = JSON.stringify(value);
|
|
262
|
-
return text === undefined ? String(value) : text;
|
|
263
|
-
}
|
|
264
|
-
catch {
|
|
265
|
-
return String(value);
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
/** 一行人类可读摘要 + 一行结构化 JSON。 */
|
|
269
|
-
function report(summary, data) {
|
|
270
|
-
return `${summary}\n${JSON.stringify(data)}`;
|
|
271
|
-
}
|
|
272
|
-
/** ref 的人类可读描述(错误信息里用)。 */
|
|
273
|
-
function describeRef(ref) {
|
|
274
|
-
return `${ref.role}${ref.name === '' ? '' : ` "${ref.name}"`}`;
|
|
275
|
-
}
|
|
276
|
-
/** 时间戳 → HH:MM:SS。 */
|
|
277
|
-
function clock(ts) {
|
|
278
|
-
return new Date(ts).toISOString().slice(11, 19);
|
|
279
|
-
}
|
|
280
223
|
// ── 插件 ─────────────────────────────────────────────────────────────────────
|
|
281
224
|
export const browserPlugin = {
|
|
282
225
|
name: 'browser',
|
|
283
226
|
// session 只用在 dsc/session-open 上:换会话时把上一次会话留下的 ref 作废
|
|
284
227
|
inject: ['tools', 'commands', 'settings', 'transcript', 'guards', 'prompt', 'session'],
|
|
285
228
|
apply(ctx, passed) {
|
|
286
|
-
const clamp = (value, min, max, fallback) => {
|
|
287
|
-
const num = Number(value);
|
|
288
|
-
return Number.isFinite(num) ? Math.min(Math.max(Math.round(num), min), max) : fallback;
|
|
289
|
-
};
|
|
290
229
|
const readConfig = () => {
|
|
291
230
|
const raw = resolvePluginConfig(CONFIG_KEY, passed);
|
|
292
231
|
const policy = raw.dialogPolicy;
|
|
@@ -642,7 +581,7 @@ export const browserPlugin = {
|
|
|
642
581
|
if (entries.length === 0) {
|
|
643
582
|
return '控制台还没有输出。(事件订阅是附加到页面之后才建立的,附加之前的输出拿不到)';
|
|
644
583
|
}
|
|
645
|
-
const lines = entries.map(
|
|
584
|
+
const lines = entries.map(consoleLine);
|
|
646
585
|
return report(`控制台最近 ${entries.length} 条${clearing ? '(已清空缓冲)' : ''}:`, {
|
|
647
586
|
action: 'console',
|
|
648
587
|
count: entries.length,
|
|
@@ -657,11 +596,7 @@ export const browserPlugin = {
|
|
|
657
596
|
if (entries.length === 0) {
|
|
658
597
|
return '还没有记录到网络请求。(事件订阅是附加到页面之后才建立的,之前的请求拿不到)';
|
|
659
598
|
}
|
|
660
|
-
const lines = entries.map(
|
|
661
|
-
const status = entry.failed === '' ? String(entry.status === 0 ? '进行中' : entry.status) : `失败:${entry.failed}`;
|
|
662
|
-
const mime = entry.mimeType === '' ? '' : ` ${entry.mimeType}`;
|
|
663
|
-
return `[${clock(entry.ts)}] ${entry.method} ${status}${mime} ${neutralizeInline(entry.url, 240)}`;
|
|
664
|
-
});
|
|
599
|
+
const lines = entries.map(networkLine);
|
|
665
600
|
return report(`网络最近 ${entries.length} 条${clearing ? '(已清空缓冲)' : ''}:`, {
|
|
666
601
|
action: 'network',
|
|
667
602
|
count: entries.length,
|
|
@@ -860,7 +795,7 @@ export const browserPlugin = {
|
|
|
860
795
|
}
|
|
861
796
|
case 'evaluate': {
|
|
862
797
|
if (!config.enableEvaluate) {
|
|
863
|
-
throw new Error('求值(evaluate
|
|
798
|
+
throw new Error('求值(evaluate)在「受控浏览器」里被关掉了;要临时用就把「允许在页面里跑 JS」打开');
|
|
864
799
|
}
|
|
865
800
|
const expression = String(args.expression ?? '');
|
|
866
801
|
if (expression.trim() === '')
|
|
@@ -1064,7 +999,7 @@ export const browserPlugin = {
|
|
|
1064
999
|
if (!config.enableEvaluate) {
|
|
1065
1000
|
return {
|
|
1066
1001
|
action: 'deny',
|
|
1067
|
-
reason: '求值(evaluate
|
|
1002
|
+
reason: '求值(evaluate)被「受控浏览器 → 允许在页面里跑 JS」关掉了。要用就先去打开',
|
|
1068
1003
|
};
|
|
1069
1004
|
}
|
|
1070
1005
|
const expression = String(input.args.expression ?? '');
|
|
@@ -1087,7 +1022,7 @@ export const browserPlugin = {
|
|
|
1087
1022
|
},
|
|
1088
1023
|
});
|
|
1089
1024
|
// ── 提示词与命令 ────────────────────────────────────────────────────────
|
|
1090
|
-
const offPrompt = ctx.prompt.register('browser', () => `#
|
|
1025
|
+
const offPrompt = ctx.prompt.register('browser', () => `# 受控浏览器(DOM 级)
|
|
1091
1026
|
你有两个浏览器工具:
|
|
1092
1027
|
- browser_look(只读、免审批):snapshot 取无障碍树快照(可交互元素带 [ref=eN])、screenshot 截图、console、network、tabs、wait_for;
|
|
1093
1028
|
- browser(每次都要审批):navigate / click / hover / type / press / select / scroll / fill_form / evaluate / upload / dialog / frame / close。
|
|
@@ -1165,7 +1100,7 @@ export const browserPlugin = {
|
|
|
1165
1100
|
{
|
|
1166
1101
|
type: 'text',
|
|
1167
1102
|
key: 'allowedDomains',
|
|
1168
|
-
label: '
|
|
1103
|
+
label: '域名名单(允许项 / !拒绝项)',
|
|
1169
1104
|
placeholder: '留空 = 不限制;例如 example.com,*.internal.example.com',
|
|
1170
1105
|
group: 'safety',
|
|
1171
1106
|
help: '逗号分隔。普通项是允许名单(填了就只有它们能打开),`!` 开头是拒绝名单(例如 !bad.com)。云元数据与私网地址无条件拒。',
|
|
@@ -1183,7 +1118,7 @@ export const browserPlugin = {
|
|
|
1183
1118
|
group: 'safety',
|
|
1184
1119
|
help: '页面弹 alert/confirm/prompt 时怎么办。must_respond 下挂着不管会阻塞这个页面的命令,300 秒后自动关掉。',
|
|
1185
1120
|
},
|
|
1186
|
-
{ type: 'switch', key: 'enableEvaluate', label: '
|
|
1121
|
+
{ type: 'switch', key: 'enableEvaluate', label: '允许在页面里跑 JS', group: 'safety', help: '打开后模型能在页面里执行任意 JS 表达式(敏感原语与内嵌地址仍会被拦)。关掉后 browser action=evaluate 与守卫都会拒绝;快照、点击、输入不受影响。' },
|
|
1187
1122
|
{ type: 'text', key: 'downloadDir', label: '下载目录', placeholder: '留空 = 浏览器默认下载目录', mono: true, group: 'startup', help: '下载的文件落在这里;留空的话文件会跑到临时 profile 里,关掉浏览器就没了。' },
|
|
1188
1123
|
{ type: 'number', key: 'waitTimeoutMs', label: '可交互等待上限', min: 500, max: 60000, step: 500, group: 'runtime', help: '以毫秒为单位。这是简化版等待(只看框算不算得出来),不是 Playwright 级的 actionability。' },
|
|
1189
1124
|
{ type: 'number', key: 'consoleBuffer', label: '控制台缓冲条数', min: 0, max: 2000, step: 20, group: 'runtime' },
|
|
@@ -1195,8 +1130,8 @@ export const browserPlugin = {
|
|
|
1195
1130
|
};
|
|
1196
1131
|
const section = {
|
|
1197
1132
|
id: 'browser',
|
|
1198
|
-
title: '
|
|
1199
|
-
subtitle: '
|
|
1133
|
+
title: '受控浏览器',
|
|
1134
|
+
subtitle: '打开与控制一台隔离的浏览器:按页面元素操作,不靠截图比坐标',
|
|
1200
1135
|
order: 34,
|
|
1201
1136
|
// 15 个字段全平铺会把设置页撑爆(0.6.62 起):TUI 根页只画 4 行组导航,
|
|
1202
1137
|
// Enter 进子页;桌面端在插件中心详情页里按组头收拢。
|
|
@@ -1296,10 +1231,23 @@ export const browserPlugin = {
|
|
|
1296
1231
|
return `已关闭受控浏览器(整棵进程树杀掉${profile === '' ? '' : `,自建 profile ${profile} 已删除`})。`;
|
|
1297
1232
|
}
|
|
1298
1233
|
if (name === 'look-tab') {
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1234
|
+
// 设置页点一下不该无限等(2026-10-30):浏览器没起来、页面卡在加载时给 15 秒结论。
|
|
1235
|
+
// 以前用的是 new AbortController().signal —— 一个永远不会中止的信号,卡住就一直挂着。
|
|
1236
|
+
const controller = new AbortController();
|
|
1237
|
+
const timer = setTimeout(() => controller.abort(), LOOK_TAB_TIMEOUT_MS);
|
|
1238
|
+
try {
|
|
1239
|
+
const session = await ensurePage(controller.signal);
|
|
1240
|
+
const state = await actions.readDocumentState(session);
|
|
1241
|
+
return (`当前标签页:${neutralizeInline(state.url, 300) || '(拿不到地址)'}` +
|
|
1242
|
+
`${state.title === '' ? '' : `(标题「${neutralizeInline(state.title, 120)}」)`},加载状态 ${state.readyState}。`);
|
|
1243
|
+
}
|
|
1244
|
+
catch (error) {
|
|
1245
|
+
// 设置页的按钮只回一句话:抛出去界面只会显示「操作失败」,看不出卡在哪一步
|
|
1246
|
+
return '看当前标签页没成功:' + (error instanceof Error ? error.message : String(error));
|
|
1247
|
+
}
|
|
1248
|
+
finally {
|
|
1249
|
+
clearTimeout(timer);
|
|
1250
|
+
}
|
|
1303
1251
|
}
|
|
1304
1252
|
throw new Error(`这个分区没有这个按钮:${name}`);
|
|
1305
1253
|
},
|