@dsh-workbench/shared 0.3.1 → 0.3.3

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.
Files changed (49) hide show
  1. package/dist/components/MockStrip.css +1 -11
  2. package/dist/host/browser-find.js +2 -2
  3. package/dist/host/browser-read.d.ts +2 -1
  4. package/dist/host/browser-read.js +3 -2
  5. package/dist/i18n/en.js +2 -0
  6. package/dist/i18n/index.d.ts +3 -1
  7. package/dist/i18n/zh.d.ts +2 -0
  8. package/dist/i18n/zh.js +2 -0
  9. package/dist/lib/diy-debug.d.ts +1 -0
  10. package/dist/lib/lint-probe.d.ts +1 -0
  11. package/dist/lib/lint-probe.js +6 -0
  12. package/package.json +2 -2
  13. package/src/host/__tests__/browser-find.test.ts +11 -0
  14. package/src/host/__tests__/browser-read.test.ts +33 -2
  15. package/src/host/browser-find.ts +2 -2
  16. package/src/host/browser-read.ts +3 -2
  17. package/src/i18n/en.ts +2 -0
  18. package/src/i18n/zh.ts +2 -0
  19. package/src/lib/diy-debug.ts +1 -0
  20. package/dist/components/StateDot.d.ts +0 -5
  21. package/dist/components/StateDot.js +0 -10
  22. package/dist/host/__tests__/fakes.d.ts +0 -41
  23. package/dist/host/__tests__/fakes.js +0 -76
  24. package/dist/host/__tests__/preflight-fixtures.d.ts +0 -19
  25. package/dist/host/__tests__/preflight-fixtures.js +0 -47
  26. package/dist/host/context-inject.d.ts +0 -24
  27. package/dist/host/context-inject.js +0 -74
  28. package/dist/host/events.d.ts +0 -9
  29. package/dist/host/events.js +0 -70
  30. package/dist/host/mount-units.d.ts +0 -52
  31. package/dist/host/mount-units.js +0 -186
  32. package/dist/host/preflight.d.ts +0 -58
  33. package/dist/host/preflight.js +0 -233
  34. package/dist/host/probe-cache.d.ts +0 -6
  35. package/dist/host/probe-cache.js +0 -19
  36. package/dist/host/probe-libs.d.ts +0 -45
  37. package/dist/host/probe-libs.js +0 -61
  38. package/dist/host/probe-units.d.ts +0 -17
  39. package/dist/host/probe-units.js +0 -102
  40. package/dist/host/probe-verdict.d.ts +0 -7
  41. package/dist/host/probe-verdict.js +0 -143
  42. package/dist/host/tool-scope.d.ts +0 -32
  43. package/dist/host/tool-scope.js +0 -84
  44. package/dist/host/unit-readiness.d.ts +0 -7
  45. package/dist/host/unit-readiness.js +0 -5
  46. package/dist/host/unit-registry.d.ts +0 -9
  47. package/dist/host/unit-registry.js +0 -33
  48. package/dist/host/version-range.d.ts +0 -2
  49. package/dist/host/version-range.js +0 -73
@@ -36,14 +36,4 @@
36
36
  border-color: transparent;
37
37
  background: var(--dsw-alias-brand-primary);
38
38
  color: var(--dsw-alias-label-primary-foreground);
39
- }
40
-
41
- .wb-mockChipOn:hover {
42
- border-color: transparent;
43
- background: var(--dsw-alias-brand-primary);
44
- color: var(--dsw-alias-label-primary-foreground);
45
- }
46
-
47
- .wb-panelBody.wb-panelMany .wb-mockStrip {
48
- display: none;
49
- }
39
+ }
@@ -1,5 +1,5 @@
1
1
  import { parseJsonLoose } from '../lib/text.js';
2
- import { BROWSER_BRIDGE_SESSION } from './browser-read.js';
2
+ import { BROWSER_READ_SESSION } from './browser-read.js';
3
3
  import { backgroundLine } from './opencli-window.js';
4
4
  import { runShell } from './shell.js';
5
5
  const DEFAULT_TIMEOUT_MS = 25000;
@@ -152,7 +152,7 @@ async function openOnce(shell, command, session, url, timeoutMs) {
152
152
  export async function browserFind(options) {
153
153
  const { shell, css, url, open = true } = options;
154
154
  const command = options.command ?? 'opencli';
155
- const session = options.session ?? BROWSER_BRIDGE_SESSION;
155
+ const session = options.session ?? BROWSER_READ_SESSION;
156
156
  const limit = options.limit ?? DEFAULT_LIMIT;
157
157
  const textMax = options.textMax ?? DEFAULT_TEXT_MAX;
158
158
  const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
@@ -1,5 +1,6 @@
1
1
  import type { DshShell } from '../api/dsh.js';
2
- export declare const BROWSER_BRIDGE_SESSION = "workbench";
2
+ export declare const BROWSER_SCREEN_SESSION = "workbench";
3
+ export declare const BROWSER_READ_SESSION = "workbench-read";
3
4
  export interface BrowserReadResult {
4
5
  readonly ok: boolean;
5
6
  readonly code: string;
@@ -1,7 +1,8 @@
1
1
  import { parseJsonLoose, tailLines } from '../lib/text.js';
2
2
  import { backgroundLine } from './opencli-window.js';
3
3
  import { runShell } from './shell.js';
4
- export const BROWSER_BRIDGE_SESSION = 'workbench';
4
+ export const BROWSER_SCREEN_SESSION = 'workbench';
5
+ export const BROWSER_READ_SESSION = 'workbench-read';
5
6
  const DEFAULT_TIMEOUT_MS = 25000;
6
7
  const DEFAULT_RETRY_MS = 1200;
7
8
  const DEFAULT_SETTLE_MS = 900;
@@ -158,7 +159,7 @@ async function openOnce(shell, command, session, url, timeoutMs) {
158
159
  export async function browserRead(options) {
159
160
  const { shell, script, url, loginUrl, open = true } = options;
160
161
  const command = options.command ?? 'opencli';
161
- const session = options.session ?? BROWSER_BRIDGE_SESSION;
162
+ const session = options.session ?? BROWSER_READ_SESSION;
162
163
  const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
163
164
  const retryMs = options.retryMs ?? DEFAULT_RETRY_MS;
164
165
  const settleMs = options.settleMs ?? DEFAULT_SETTLE_MS;
package/dist/i18n/en.js CHANGED
@@ -85,6 +85,7 @@ export const en = {
85
85
  'panels.dragHint': 'Drag to reorder',
86
86
  'panels.unknownStep': 'No suite provides this view',
87
87
  'panels.labelWithHint': '{label} ({hint})',
88
+ 'panels.hintJoin': '; ',
88
89
  'panels.dep.failed': '⚠ failed to start',
89
90
  'panels.dep.missingPlugin': '⚠ not ready yet',
90
91
  'panels.dep.missingCommands': '⚠ needs an update',
@@ -99,6 +100,7 @@ export const en = {
99
100
  'panels.market.notUsable': 'unusable',
100
101
  'panels.market.broken': 'broken',
101
102
  'panels.market.hasNew': 'New version',
103
+ 'panels.market.hasProblem': 'Module problem',
102
104
  'panels.market.missing': 'not installed',
103
105
  'panels.market.unchecked': 'unknown',
104
106
  'panels.market.checking': 'checking',
@@ -87,6 +87,7 @@ export declare const dictionaries: {
87
87
  readonly 'panels.dragHint': "拖动调整顺序";
88
88
  readonly 'panels.unknownStep': "这一层没有套件提供";
89
89
  readonly 'panels.labelWithHint': "{label}({hint})";
90
+ readonly 'panels.hintJoin': ";";
90
91
  readonly 'panels.dep.failed': "⚠ 起不来";
91
92
  readonly 'panels.dep.missingPlugin': "⚠ 还没装好";
92
93
  readonly 'panels.dep.missingCommands': "⚠ 需要更新";
@@ -101,6 +102,7 @@ export declare const dictionaries: {
101
102
  readonly 'panels.market.notUsable': "不可用";
102
103
  readonly 'panels.market.broken': "装坏了";
103
104
  readonly 'panels.market.hasNew': "有新版本";
105
+ readonly 'panels.market.hasProblem': "模块异常";
104
106
  readonly 'panels.market.missing': "未装";
105
107
  readonly 'panels.market.unchecked': "状态未知";
106
108
  readonly 'panels.market.checking': "检测中";
@@ -423,7 +425,7 @@ export declare const dictionaries: {
423
425
  readonly 'debug.card.hidden.note': "请切换到工作台面板";
424
426
  readonly 'debug.back': "回到工坊那一屏";
425
427
  };
426
- en: Record<"time.now" | "time.ago" | "time.minutes" | "time.hours" | "time.days" | "blocker.retry" | "blocker.copy" | "blocker.unknown.title" | "blocker.login.go" | "blocker.login.titleGeneric" | "blocker.login.title" | "blocker.login.manual" | "blocker.login.hint" | "blocker.forbidden.open" | "blocker.forbidden.titleGeneric" | "blocker.forbidden.title" | "blocker.forbidden.hint" | "blocker.timeout.hint" | "blocker.exec.hint" | "blocker.fix.install" | "blocker.fix.update" | "blocker.market.open" | "env.unit.failed" | "env.unit.failedHint" | "env.unit.missingPlugin" | "env.unit.hint" | "env.unit.missingCommands" | "env.unit.missingCommandsHint" | "env.unit.unchecked" | "env.unit.uncheckedHint" | "brand.name" | "toggle.open" | "toggle.collapse" | "project.label" | "workspace.section" | "project.none" | "project.empty" | "project.add" | "project.add.busy" | "project.add.failed" | "project.search.label" | "project.search.placeholder" | "project.search.empty" | "project.group.workspaces" | "project.group.defaultWorkspace" | "project.group.workshop" | "project.rename.row" | "project.rename.current" | "project.rename.title" | "project.rename.description" | "project.rename.field" | "project.rename.placeholder" | "project.rename.hint" | "project.rename.save" | "project.rename.saving" | "project.rename.cancel" | "project.rename.failed" | "session.new" | "session.new.label" | "session.empty" | "session.noProject" | "session.list.label" | "session.copy" | "session.pinned" | "session.actions" | "status.idle" | "status.running" | "status.waitingApproval" | "status.planReview" | "status.waitingAnswer" | "status.compact.approval" | "status.compact.planReview" | "status.compact.answer" | "status.completed" | "status.subagentsRunning.one" | "status.subagentsRunning.other" | "project.attention.warning.one" | "project.attention.warning.other" | "project.attention.running.one" | "project.attention.running.other" | "project.attention.done.one" | "project.attention.done.other" | "project.attention.state.warning" | "project.attention.state.running" | "project.attention.state.done" | "hover.copied" | "time.short.minutes" | "time.short.hours" | "time.short.days" | "time.short.months" | "time.short.years" | "panels.title" | "panels.groupBoardless" | "panels.groupPlugins" | "panels.market.defaultHint" | "panels.market.defaultLabel" | "panels.market.defaultLocked" | "panels.followAll" | "panels.followAllConfirmTitle" | "panels.followAllConfirmDetail" | "panels.followAllConfirmAck" | "panels.followAllConfirmYes" | "panels.followAllConfirmNo" | "panels.enabled" | "panels.disabled" | "panels.choose" | "panels.buildModule" | "panels.failed" | "panels.dragHint" | "panels.unknownStep" | "panels.labelWithHint" | "panels.dep.failed" | "panels.dep.missingPlugin" | "panels.dep.missingCommands" | "panels.dep.unchecked" | "panels.tab.modules" | "panels.tab.market" | "panels.browseMarket" | "panels.noneInstalled" | "panels.noneInstalledHint" | "panels.market.installed" | "panels.market.notActive" | "panels.market.notUsable" | "panels.market.broken" | "panels.market.hasNew" | "panels.market.missing" | "panels.market.unchecked" | "panels.market.checking" | "panels.market.sectionInstalled" | "panels.market.sectionPending" | "panels.market.sectionShared" | "panels.market.sharedUsedBy" | "panels.market.listSeparator" | "panels.market.sharedMissing" | "panels.market.sharedOutdated" | "panels.market.sharedUnsatisfied" | "panels.market.sharedOk" | "panels.market.versionArrow" | "panels.market.lead" | "panels.market.install" | "panels.market.update" | "panels.market.swapSlow" | "panels.market.uninstall" | "panels.market.uninstallLabel" | "panels.market.installing" | "panels.market.updating" | "panels.market.uninstalling" | "panels.market.confirmUninstallTitle" | "panels.market.confirmUninstallDetail" | "panels.market.confirmUninstallAck" | "panels.market.confirmYes" | "panels.market.confirmNo" | "panels.market.failed" | "panels.market.needEnv" | "panels.market.needCommands" | "panels.market.localMark" | "panels.market.localHint" | "panels.market.noSource" | "panels.market.badSource" | "panels.market.empty" | "panels.market.sectionPlugins" | "panels.market.moduleOutdated" | "panels.market.moduleRefused" | "panels.market.moduleRefusedDetail" | "panels.market.moduleRestartHint" | "panels.market.pendingRestart" | "panels.market.workbenchName" | "panels.market.workbenchLocal" | "panels.market.pluginKeptInUse" | "panels.market.pluginKeptUnsure" | "panels.market.pluginKeptHeld" | "panels.market.pluginKeptUnnamed" | "panels.market.pluginBroken" | "panels.market.restartNeeded" | "panels.market.foot" | "panels.market.recheck" | "panels.market.checkUpdates" | "panels.market.checkedAt" | "panels.market.justNow" | "panels.market.minutesAgo" | "panels.market.hoursAgo" | "panels.market.add.description" | "panels.market.add.specPlaceholder" | "panels.market.add.guideToggle" | "panels.market.add.guideHide" | "panels.market.add.guideIdTitle" | "panels.market.add.guideIdExample" | "panels.market.add.guideIdHint" | "panels.market.add.guideGitTitle" | "panels.market.add.guideGitExample" | "panels.market.add.guideGitHint" | "panels.market.add.guidePathTitle" | "panels.market.add.guidePathExample" | "panels.market.add.guidePathHint" | "panels.market.add.guideExampleLabel" | "panels.market.add.guideFill" | "panels.market.add.guideSafety" | "panels.market.add.registryLegend" | "panels.market.add.registryOfficial" | "panels.market.add.registryMirror" | "panels.market.add.registryWithHost" | "panels.market.add.registryToggle" | "panels.market.add.installVersion" | "panels.market.add.registryDefault" | "panels.market.add.registryCustom" | "panels.market.add.registryCustomPlaceholder" | "panels.market.add.registryCustomHint" | "panels.market.add.registryCustomInvalid" | "panels.market.add.run" | "panels.market.add.edit" | "panels.market.add.changeRegistry" | "panels.market.add.installingTitle" | "panels.market.add.installedTitle" | "panels.market.add.failedTitle" | "panels.market.add.cancelledTitle" | "panels.market.add.failureNetworkHost" | "panels.market.add.problemInvalid" | "panels.market.add.problemInstalled" | "panels.market.add.problemNotFound" | "panels.market.add.problemNotPackage" | "panels.market.add.problemNotBundle" | "panels.market.add.problemNotWorkbenchModule" | "panels.market.add.problemNotModuleOrPlugin" | "panels.market.add.failureNotModuleOrPlugin" | "panels.market.add.installedPlugin" | "panels.market.add.pluginPreview" | "panels.market.add.pluginAlias" | "panels.market.add.problemNetwork" | "panels.market.add.problemUnknown" | "panels.market.add.failureNetwork" | "panels.market.add.failureNotFound" | "panels.market.add.failureNoMatchingVersion" | "panels.market.add.failureDiskFull" | "panels.market.add.failurePermission" | "panels.market.add.failureBuildBlocked" | "panels.market.add.failureIntegrity" | "panels.market.add.failureTimeout" | "panels.market.add.failurePnpmMissing" | "panels.market.add.failureInstalled" | "panels.market.add.failureGeneric" | "panels.market.add.approveTitle" | "panels.market.add.approveCaution" | "panels.market.add.approveRun" | "panels.market.add.restart" | "panels.market.add.tookEffect" | "panels.market.add.details" | "panels.market.add.open" | "panels.market.add.title" | "panels.market.add.intro" | "panels.market.add.specLabel" | "panels.market.add.specHint" | "panels.market.add.exampleTitle" | "panels.market.add.exampleFill" | "panels.market.add.registryLabel" | "panels.market.add.registryProfile" | "panels.market.add.registryPnpm" | "panels.market.add.check" | "panels.market.add.checking" | "panels.market.add.classifying" | "panels.market.add.change" | "panels.market.add.previewTitle" | "panels.market.add.fieldName" | "panels.market.add.fieldVersion" | "panels.market.add.fieldDescription" | "panels.market.add.fieldSource" | "panels.market.add.install" | "panels.market.add.installing" | "panels.market.add.cancel" | "panels.market.add.close" | "panels.market.add.retry" | "panels.market.add.changeSource" | "panels.market.add.approveBuilds" | "panels.market.add.approveHint" | "panels.market.add.doneApplied" | "panels.market.add.doneRestart" | "panels.market.add.restartWhy" | "panels.market.add.restartWhy.no-hmr" | "panels.market.add.restartWhy.package-moved" | "panels.market.add.restartWhy.host-module" | "panels.market.add.restartWhy.unmanaged-plugin" | "panels.market.add.restartWhy.module-comparison" | "panels.market.add.cancelled" | "panels.market.add.failed" | "panels.market.add.removed" | "panels.market.add.supplyPending" | "panels.market.add.supplyFailed" | "panels.market.add.notModule" | "panels.market.add.removedRestart" | "panels.market.add.remove" | "panels.market.add.problem.invalidSpec" | "panels.market.add.problem.alreadyInstalled" | "panels.market.add.problem.notFound" | "panels.market.add.problem.notAPackage" | "panels.market.add.problem.notABundle" | "panels.market.add.problem.network" | "panels.market.add.problem.unknown" | "panels.market.add.reason.invalidSpec" | "panels.market.add.reason.incompatible" | "panels.market.add.reason.notBundle" | "panels.market.add.reason.notRemovable" | "panels.market.add.reason.bundleInUse" | "panels.market.add.reason.stopProfile" | "panels.market.add.reason.staleApproval" | "panels.market.add.reason.operationError" | "panels.market.add.reason.buildBlocked" | "panels.market.add.reason.pnpmMissing" | "panels.market.add.reason.noMatchingVersion" | "panels.market.add.reason.diskFull" | "panels.market.add.reason.permission" | "panels.market.add.reason.integrity" | "panels.market.add.reason.timeout" | "panels.market.add.reason.network" | "panels.market.add.reason.notFound" | "panels.market.add.reason.unknown" | "blocker.fix.running" | "blocker.fix.failed" | "blocker.retry.running" | "panels.reading" | "panels.cardBroken" | "panels.cardRetry" | "panels.empty" | "panels.emptyHint" | "env.title" | "env.checking" | "env.installing" | "env.failed" | "env.elapsed" | "env.stepFailed.install" | "env.stepFailed.path" | "env.stepFailed.shell" | "env.bridge.ok" | "env.bridge.short" | "env.bridge.why" | "env.bridge.daemon" | "env.bridge.extension" | "env.bridge.extensionLink" | "env.bridge.profile" | "env.bridge.stale" | "env.bridge.unknown" | "env.fix.title" | "env.fix.why" | "env.fix.whyPath" | "env.fix.whyShell" | "env.fix.step" | "env.fix.stepPath" | "env.fix.stepShell" | "env.fix.permission" | "env.fix.network" | "env.fix.details" | "env.retry" | "env.copyCommand" | "env.copied" | "env.step.opencli" | "env.step.codingPlugin" | "env.step.bridge" | "env.step.warm" | "env.warm.done" | "env.warm.short" | "rightbar.label" | "rightbar.expand" | "rightbar.collapse" | "rightbar.column.label" | "rightbar.column.workbench" | "rightbar.column.dsh" | "rightbar.refresh" | "rightbar.refreshing" | "rightbar.updatedAt" | "rightbar.noProject" | "rightbar.openPlatform" | "coding.notARepo.title" | "error.unknown" | "board.title" | "panel.conversation" | "panels.label" | "configSync.nav" | "configSync.lead" | "configSync.source" | "configSync.sourceBroken" | "configSync.sourceRows" | "configSync.sourceDead" | "configSync.refresh" | "configSync.loading" | "configSync.readHint" | "configSync.tag.new" | "configSync.tag.differs" | "configSync.conflictNote" | "configSync.code.lang" | "configSync.code.copy" | "configSync.code.copied" | "configSync.code.wrap" | "configSync.code.unwrap" | "configSync.code.collapse" | "configSync.code.collapseAria" | "configSync.code.expandAria" | "configSync.code.expand" | "configSync.missing" | "configSync.apply" | "configSync.applyNone" | "configSync.applying" | "configSync.applied" | "configSync.appliedIds" | "configSync.skippedIds" | "configSync.nothing" | "configSync.unreadable" | "configSync.noSource" | "configSync.emptyProviders" | "configSync.failed" | "debug.status" | "debug.status.trouble" | "debug.stalled" | "debug.act.pause" | "debug.act.resume" | "debug.act.stop" | "debug.act.stop.ask" | "debug.card.here.title" | "debug.card.here.note" | "debug.card.away.title" | "debug.card.away.note" | "debug.card.paused.note" | "debug.card.hidden.note" | "debug.back", string>;
428
+ en: Record<"time.now" | "time.ago" | "time.minutes" | "time.hours" | "time.days" | "blocker.retry" | "blocker.copy" | "blocker.unknown.title" | "blocker.login.go" | "blocker.login.titleGeneric" | "blocker.login.title" | "blocker.login.manual" | "blocker.login.hint" | "blocker.forbidden.open" | "blocker.forbidden.titleGeneric" | "blocker.forbidden.title" | "blocker.forbidden.hint" | "blocker.timeout.hint" | "blocker.exec.hint" | "blocker.fix.install" | "blocker.fix.update" | "blocker.market.open" | "env.unit.failed" | "env.unit.failedHint" | "env.unit.missingPlugin" | "env.unit.hint" | "env.unit.missingCommands" | "env.unit.missingCommandsHint" | "env.unit.unchecked" | "env.unit.uncheckedHint" | "brand.name" | "toggle.open" | "toggle.collapse" | "project.label" | "workspace.section" | "project.none" | "project.empty" | "project.add" | "project.add.busy" | "project.add.failed" | "project.search.label" | "project.search.placeholder" | "project.search.empty" | "project.group.workspaces" | "project.group.defaultWorkspace" | "project.group.workshop" | "project.rename.row" | "project.rename.current" | "project.rename.title" | "project.rename.description" | "project.rename.field" | "project.rename.placeholder" | "project.rename.hint" | "project.rename.save" | "project.rename.saving" | "project.rename.cancel" | "project.rename.failed" | "session.new" | "session.new.label" | "session.empty" | "session.noProject" | "session.list.label" | "session.copy" | "session.pinned" | "session.actions" | "status.idle" | "status.running" | "status.waitingApproval" | "status.planReview" | "status.waitingAnswer" | "status.compact.approval" | "status.compact.planReview" | "status.compact.answer" | "status.completed" | "status.subagentsRunning.one" | "status.subagentsRunning.other" | "project.attention.warning.one" | "project.attention.warning.other" | "project.attention.running.one" | "project.attention.running.other" | "project.attention.done.one" | "project.attention.done.other" | "project.attention.state.warning" | "project.attention.state.running" | "project.attention.state.done" | "hover.copied" | "time.short.minutes" | "time.short.hours" | "time.short.days" | "time.short.months" | "time.short.years" | "panels.title" | "panels.groupBoardless" | "panels.groupPlugins" | "panels.market.defaultHint" | "panels.market.defaultLabel" | "panels.market.defaultLocked" | "panels.followAll" | "panels.followAllConfirmTitle" | "panels.followAllConfirmDetail" | "panels.followAllConfirmAck" | "panels.followAllConfirmYes" | "panels.followAllConfirmNo" | "panels.enabled" | "panels.disabled" | "panels.choose" | "panels.buildModule" | "panels.failed" | "panels.dragHint" | "panels.unknownStep" | "panels.labelWithHint" | "panels.hintJoin" | "panels.dep.failed" | "panels.dep.missingPlugin" | "panels.dep.missingCommands" | "panels.dep.unchecked" | "panels.tab.modules" | "panels.tab.market" | "panels.browseMarket" | "panels.noneInstalled" | "panels.noneInstalledHint" | "panels.market.installed" | "panels.market.notActive" | "panels.market.notUsable" | "panels.market.broken" | "panels.market.hasNew" | "panels.market.hasProblem" | "panels.market.missing" | "panels.market.unchecked" | "panels.market.checking" | "panels.market.sectionInstalled" | "panels.market.sectionPending" | "panels.market.sectionShared" | "panels.market.sharedUsedBy" | "panels.market.listSeparator" | "panels.market.sharedMissing" | "panels.market.sharedOutdated" | "panels.market.sharedUnsatisfied" | "panels.market.sharedOk" | "panels.market.versionArrow" | "panels.market.lead" | "panels.market.install" | "panels.market.update" | "panels.market.swapSlow" | "panels.market.uninstall" | "panels.market.uninstallLabel" | "panels.market.installing" | "panels.market.updating" | "panels.market.uninstalling" | "panels.market.confirmUninstallTitle" | "panels.market.confirmUninstallDetail" | "panels.market.confirmUninstallAck" | "panels.market.confirmYes" | "panels.market.confirmNo" | "panels.market.failed" | "panels.market.needEnv" | "panels.market.needCommands" | "panels.market.localMark" | "panels.market.localHint" | "panels.market.noSource" | "panels.market.badSource" | "panels.market.empty" | "panels.market.sectionPlugins" | "panels.market.moduleOutdated" | "panels.market.moduleRefused" | "panels.market.moduleRefusedDetail" | "panels.market.moduleRestartHint" | "panels.market.pendingRestart" | "panels.market.workbenchName" | "panels.market.workbenchLocal" | "panels.market.pluginKeptInUse" | "panels.market.pluginKeptUnsure" | "panels.market.pluginKeptHeld" | "panels.market.pluginKeptUnnamed" | "panels.market.pluginBroken" | "panels.market.restartNeeded" | "panels.market.foot" | "panels.market.recheck" | "panels.market.checkUpdates" | "panels.market.checkedAt" | "panels.market.justNow" | "panels.market.minutesAgo" | "panels.market.hoursAgo" | "panels.market.add.description" | "panels.market.add.specPlaceholder" | "panels.market.add.guideToggle" | "panels.market.add.guideHide" | "panels.market.add.guideIdTitle" | "panels.market.add.guideIdExample" | "panels.market.add.guideIdHint" | "panels.market.add.guideGitTitle" | "panels.market.add.guideGitExample" | "panels.market.add.guideGitHint" | "panels.market.add.guidePathTitle" | "panels.market.add.guidePathExample" | "panels.market.add.guidePathHint" | "panels.market.add.guideExampleLabel" | "panels.market.add.guideFill" | "panels.market.add.guideSafety" | "panels.market.add.registryLegend" | "panels.market.add.registryOfficial" | "panels.market.add.registryMirror" | "panels.market.add.registryWithHost" | "panels.market.add.registryToggle" | "panels.market.add.installVersion" | "panels.market.add.registryDefault" | "panels.market.add.registryCustom" | "panels.market.add.registryCustomPlaceholder" | "panels.market.add.registryCustomHint" | "panels.market.add.registryCustomInvalid" | "panels.market.add.run" | "panels.market.add.edit" | "panels.market.add.changeRegistry" | "panels.market.add.installingTitle" | "panels.market.add.installedTitle" | "panels.market.add.failedTitle" | "panels.market.add.cancelledTitle" | "panels.market.add.failureNetworkHost" | "panels.market.add.problemInvalid" | "panels.market.add.problemInstalled" | "panels.market.add.problemNotFound" | "panels.market.add.problemNotPackage" | "panels.market.add.problemNotBundle" | "panels.market.add.problemNotWorkbenchModule" | "panels.market.add.problemNotModuleOrPlugin" | "panels.market.add.failureNotModuleOrPlugin" | "panels.market.add.installedPlugin" | "panels.market.add.pluginPreview" | "panels.market.add.pluginAlias" | "panels.market.add.problemNetwork" | "panels.market.add.problemUnknown" | "panels.market.add.failureNetwork" | "panels.market.add.failureNotFound" | "panels.market.add.failureNoMatchingVersion" | "panels.market.add.failureDiskFull" | "panels.market.add.failurePermission" | "panels.market.add.failureBuildBlocked" | "panels.market.add.failureIntegrity" | "panels.market.add.failureTimeout" | "panels.market.add.failurePnpmMissing" | "panels.market.add.failureInstalled" | "panels.market.add.failureGeneric" | "panels.market.add.approveTitle" | "panels.market.add.approveCaution" | "panels.market.add.approveRun" | "panels.market.add.restart" | "panels.market.add.tookEffect" | "panels.market.add.details" | "panels.market.add.open" | "panels.market.add.title" | "panels.market.add.intro" | "panels.market.add.specLabel" | "panels.market.add.specHint" | "panels.market.add.exampleTitle" | "panels.market.add.exampleFill" | "panels.market.add.registryLabel" | "panels.market.add.registryProfile" | "panels.market.add.registryPnpm" | "panels.market.add.check" | "panels.market.add.checking" | "panels.market.add.classifying" | "panels.market.add.change" | "panels.market.add.previewTitle" | "panels.market.add.fieldName" | "panels.market.add.fieldVersion" | "panels.market.add.fieldDescription" | "panels.market.add.fieldSource" | "panels.market.add.install" | "panels.market.add.installing" | "panels.market.add.cancel" | "panels.market.add.close" | "panels.market.add.retry" | "panels.market.add.changeSource" | "panels.market.add.approveBuilds" | "panels.market.add.approveHint" | "panels.market.add.doneApplied" | "panels.market.add.doneRestart" | "panels.market.add.restartWhy" | "panels.market.add.restartWhy.no-hmr" | "panels.market.add.restartWhy.package-moved" | "panels.market.add.restartWhy.host-module" | "panels.market.add.restartWhy.unmanaged-plugin" | "panels.market.add.restartWhy.module-comparison" | "panels.market.add.cancelled" | "panels.market.add.failed" | "panels.market.add.removed" | "panels.market.add.supplyPending" | "panels.market.add.supplyFailed" | "panels.market.add.notModule" | "panels.market.add.removedRestart" | "panels.market.add.remove" | "panels.market.add.problem.invalidSpec" | "panels.market.add.problem.alreadyInstalled" | "panels.market.add.problem.notFound" | "panels.market.add.problem.notAPackage" | "panels.market.add.problem.notABundle" | "panels.market.add.problem.network" | "panels.market.add.problem.unknown" | "panels.market.add.reason.invalidSpec" | "panels.market.add.reason.incompatible" | "panels.market.add.reason.notBundle" | "panels.market.add.reason.notRemovable" | "panels.market.add.reason.bundleInUse" | "panels.market.add.reason.stopProfile" | "panels.market.add.reason.staleApproval" | "panels.market.add.reason.operationError" | "panels.market.add.reason.buildBlocked" | "panels.market.add.reason.pnpmMissing" | "panels.market.add.reason.noMatchingVersion" | "panels.market.add.reason.diskFull" | "panels.market.add.reason.permission" | "panels.market.add.reason.integrity" | "panels.market.add.reason.timeout" | "panels.market.add.reason.network" | "panels.market.add.reason.notFound" | "panels.market.add.reason.unknown" | "blocker.fix.running" | "blocker.fix.failed" | "blocker.retry.running" | "panels.reading" | "panels.cardBroken" | "panels.cardRetry" | "panels.empty" | "panels.emptyHint" | "env.title" | "env.checking" | "env.installing" | "env.failed" | "env.elapsed" | "env.stepFailed.install" | "env.stepFailed.path" | "env.stepFailed.shell" | "env.bridge.ok" | "env.bridge.short" | "env.bridge.why" | "env.bridge.daemon" | "env.bridge.extension" | "env.bridge.extensionLink" | "env.bridge.profile" | "env.bridge.stale" | "env.bridge.unknown" | "env.fix.title" | "env.fix.why" | "env.fix.whyPath" | "env.fix.whyShell" | "env.fix.step" | "env.fix.stepPath" | "env.fix.stepShell" | "env.fix.permission" | "env.fix.network" | "env.fix.details" | "env.retry" | "env.copyCommand" | "env.copied" | "env.step.opencli" | "env.step.codingPlugin" | "env.step.bridge" | "env.step.warm" | "env.warm.done" | "env.warm.short" | "rightbar.label" | "rightbar.expand" | "rightbar.collapse" | "rightbar.column.label" | "rightbar.column.workbench" | "rightbar.column.dsh" | "rightbar.refresh" | "rightbar.refreshing" | "rightbar.updatedAt" | "rightbar.noProject" | "rightbar.openPlatform" | "coding.notARepo.title" | "error.unknown" | "board.title" | "panel.conversation" | "panels.label" | "configSync.nav" | "configSync.lead" | "configSync.source" | "configSync.sourceBroken" | "configSync.sourceRows" | "configSync.sourceDead" | "configSync.refresh" | "configSync.loading" | "configSync.readHint" | "configSync.tag.new" | "configSync.tag.differs" | "configSync.conflictNote" | "configSync.code.lang" | "configSync.code.copy" | "configSync.code.copied" | "configSync.code.wrap" | "configSync.code.unwrap" | "configSync.code.collapse" | "configSync.code.collapseAria" | "configSync.code.expandAria" | "configSync.code.expand" | "configSync.missing" | "configSync.apply" | "configSync.applyNone" | "configSync.applying" | "configSync.applied" | "configSync.appliedIds" | "configSync.skippedIds" | "configSync.nothing" | "configSync.unreadable" | "configSync.noSource" | "configSync.emptyProviders" | "configSync.failed" | "debug.status" | "debug.status.trouble" | "debug.stalled" | "debug.act.pause" | "debug.act.resume" | "debug.act.stop" | "debug.act.stop.ask" | "debug.card.here.title" | "debug.card.here.note" | "debug.card.away.title" | "debug.card.away.note" | "debug.card.paused.note" | "debug.card.hidden.note" | "debug.back", string>;
427
429
  };
428
430
  export type { WorkbenchMessages };
429
431
  export interface Dictionaries {
package/dist/i18n/zh.d.ts CHANGED
@@ -85,6 +85,7 @@ export declare const zh: {
85
85
  readonly 'panels.dragHint': "拖动调整顺序";
86
86
  readonly 'panels.unknownStep': "这一层没有套件提供";
87
87
  readonly 'panels.labelWithHint': "{label}({hint})";
88
+ readonly 'panels.hintJoin': ";";
88
89
  readonly 'panels.dep.failed': "⚠ 起不来";
89
90
  readonly 'panels.dep.missingPlugin': "⚠ 还没装好";
90
91
  readonly 'panels.dep.missingCommands': "⚠ 需要更新";
@@ -99,6 +100,7 @@ export declare const zh: {
99
100
  readonly 'panels.market.notUsable': "不可用";
100
101
  readonly 'panels.market.broken': "装坏了";
101
102
  readonly 'panels.market.hasNew': "有新版本";
103
+ readonly 'panels.market.hasProblem': "模块异常";
102
104
  readonly 'panels.market.missing': "未装";
103
105
  readonly 'panels.market.unchecked': "状态未知";
104
106
  readonly 'panels.market.checking': "检测中";
package/dist/i18n/zh.js CHANGED
@@ -85,6 +85,7 @@ export const zh = {
85
85
  'panels.dragHint': '拖动调整顺序',
86
86
  'panels.unknownStep': '这一层没有套件提供',
87
87
  'panels.labelWithHint': '{label}({hint})',
88
+ 'panels.hintJoin': ';',
88
89
  'panels.dep.failed': '⚠ 起不来',
89
90
  'panels.dep.missingPlugin': '⚠ 还没装好',
90
91
  'panels.dep.missingCommands': '⚠ 需要更新',
@@ -99,6 +100,7 @@ export const zh = {
99
100
  'panels.market.notUsable': '不可用',
100
101
  'panels.market.broken': '装坏了',
101
102
  'panels.market.hasNew': '有新版本',
103
+ 'panels.market.hasProblem': '模块异常',
102
104
  'panels.market.missing': '未装',
103
105
  'panels.market.unchecked': '状态未知',
104
106
  'panels.market.checking': '检测中',
@@ -34,6 +34,7 @@ export interface DebugStore {
34
34
  pause(sessionId: string, now: number): DebugMove;
35
35
  resume(sessionId: string, now: number): DebugMove;
36
36
  stop(sessionId: string, now: number): DebugMove;
37
+ settle?(): Promise<void>;
37
38
  }
38
39
  export declare function createDebugStore(): DebugStore;
39
40
  export declare function debugOwnerText(state: DebugState): string;
@@ -0,0 +1 @@
1
+ export declare function useLintProbe(): number;
@@ -0,0 +1,6 @@
1
+ import { useRef } from './react';
2
+ export function useLintProbe() {
3
+ const probeRef = useRef(0);
4
+ probeRef.current = 1;
5
+ return probeRef.current;
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-workbench/shared",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "工作台与模块共享的纯代码与契约类型:类型、纯逻辑、哑组件、平台解析。宿主侧的东西从 /host 进(不影响浏览器产物)。",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "scripts": {
42
42
  "build": "tsc -p tsconfig.build.json && node scripts/copy-css.mjs",
43
- "typecheck": "tsc --noEmit",
43
+ "typecheck": "tsc --noEmit --incremental --tsBuildInfoFile node_modules/.cache/tsconfig.tsbuildinfo",
44
44
  "test": "vitest run",
45
45
  "coverage": "vitest run --coverage",
46
46
  "barrels": "node scripts/barrels.mjs",
@@ -1,4 +1,5 @@
1
1
  import { describe, expect, it } from 'vitest';
2
+ import { BROWSER_SCREEN_SESSION } from '../browser-read.js';
2
3
  import {
3
4
  browserFind,
4
5
  cellRows,
@@ -317,3 +318,13 @@ describe('browserFind · 后台静默(问页 + 读 + 打开都不许抢焦点
317
318
  expect(backgroundless(commands)).toEqual([]);
318
319
  });
319
320
  });
321
+
322
+ describe('browserFind · 读有它自己那条会话(不许碰屏那条)', () => {
323
+ it('默认那条命令里一条都不带屏那条会话名', async () => {
324
+ const { shell, commands } = fakeShell({ url: ['about:blank', SITE], find: [{ stdout: MATCH }] });
325
+ await browserFind({ shell, css: CSS, url: SITE, ...FAST });
326
+
327
+ expect(commands.length).toBeGreaterThan(0);
328
+ expect(commands.some((one) => one.includes(`'${BROWSER_SCREEN_SESSION}'`))).toBe(false);
329
+ });
330
+ });
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, it } from 'vitest';
2
- import { browserRead } from '../browser-read.js';
2
+ import { BROWSER_READ_SESSION, BROWSER_SCREEN_SESSION, browserRead } from '../browser-read.js';
3
3
 
4
4
  interface Step {
5
5
  readonly stdout?: string;
@@ -45,7 +45,7 @@ describe('browserRead · 读成功', () => {
45
45
  expect(out.ok).toBe(true);
46
46
  expect(out.code).toBe('ok');
47
47
  expect(out.value).toEqual({ ok: true, n: 3 });
48
- expect(commands[0]).toContain("'browser' 'workbench' 'eval'");
48
+ expect(commands[0]).toContain(`'browser' '${BROWSER_READ_SESSION}' 'eval'`);
49
49
  });
50
50
 
51
51
  it('脚本没回 ok 字段(例如直接回一个数)也算读到了', async () => {
@@ -123,6 +123,37 @@ describe('browserRead · 两拍(不在站点上就先打开)', () => {
123
123
  });
124
124
  });
125
125
 
126
+ describe('browserRead · 读有它自己那条会话(不许碰屏那条)', () => {
127
+ it('默认那条不是工坊绑用户当前页用的那条', () => {
128
+ expect(BROWSER_READ_SESSION).not.toBe(BROWSER_SCREEN_SESSION);
129
+ });
130
+
131
+ it('两拍三条命令里一条都不带屏那条会话名', async () => {
132
+ const { shell, commands } = fakeShell([
133
+ { stdout: JSON.stringify({ ok: false, code: 'not-on-site' }) },
134
+ { stdout: 'opened' },
135
+ { stdout: JSON.stringify({ ok: true, n: 1 }) },
136
+ ]);
137
+ const out = await browserRead({ shell, script, url: URL, ...FAST });
138
+
139
+ expect(out.ok).toBe(true);
140
+ expect(commands.some((one) => one.includes(`'${BROWSER_SCREEN_SESSION}'`))).toBe(false);
141
+ });
142
+
143
+ it('调用点自己给的 session 说了算(模块可以自己开一条)', async () => {
144
+ const { shell, commands } = fakeShell([
145
+ { stdout: JSON.stringify({ ok: false, code: 'not-on-site' }) },
146
+ { stdout: 'opened' },
147
+ { stdout: JSON.stringify({ ok: true }) },
148
+ ]);
149
+ const out = await browserRead({ shell, script, url: URL, session: 'llm-wallet', ...FAST });
150
+
151
+ expect(out.ok).toBe(true);
152
+ expect(commands.every((one) => one.includes("'llm-wallet'"))).toBe(true);
153
+ expect(commands.some((one) => one.includes(`'${BROWSER_SCREEN_SESSION}'`))).toBe(false);
154
+ });
155
+ });
156
+
126
157
  describe('browserRead · 命令这一层的问题', () => {
127
158
  it('刚重启时第一次失败:等一下再读一次就成功(实测的那个坑)', async () => {
128
159
  const { shell, commands } = fakeShell([
@@ -1,6 +1,6 @@
1
1
  import type { DshShell } from '../api/dsh.js';
2
2
  import { parseJsonLoose } from '../lib/text.js';
3
- import { BROWSER_BRIDGE_SESSION } from './browser-read.js';
3
+ import { BROWSER_READ_SESSION } from './browser-read.js';
4
4
  import { backgroundLine } from './opencli-window.js';
5
5
  import { runShell } from './shell.js';
6
6
 
@@ -215,7 +215,7 @@ async function openOnce(
215
215
  export async function browserFind(options: BrowserFindOptions): Promise<BrowserFindResult> {
216
216
  const { shell, css, url, open = true } = options;
217
217
  const command = options.command ?? 'opencli';
218
- const session = options.session ?? BROWSER_BRIDGE_SESSION;
218
+ const session = options.session ?? BROWSER_READ_SESSION;
219
219
  const limit = options.limit ?? DEFAULT_LIMIT;
220
220
  const textMax = options.textMax ?? DEFAULT_TEXT_MAX;
221
221
  const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
@@ -3,7 +3,8 @@ import { parseJsonLoose, tailLines } from '../lib/text.js';
3
3
  import { backgroundLine } from './opencli-window.js';
4
4
  import { runShell } from './shell.js';
5
5
 
6
- export const BROWSER_BRIDGE_SESSION = 'workbench';
6
+ export const BROWSER_SCREEN_SESSION = 'workbench';
7
+ export const BROWSER_READ_SESSION = 'workbench-read';
7
8
 
8
9
  const DEFAULT_TIMEOUT_MS = 25000;
9
10
  const DEFAULT_RETRY_MS = 1200;
@@ -226,7 +227,7 @@ async function openOnce(
226
227
  export async function browserRead(options: BrowserReadOptions): Promise<BrowserReadResult> {
227
228
  const { shell, script, url, loginUrl, open = true } = options;
228
229
  const command = options.command ?? 'opencli';
229
- const session = options.session ?? BROWSER_BRIDGE_SESSION;
230
+ const session = options.session ?? BROWSER_READ_SESSION;
230
231
  const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
231
232
  const retryMs = options.retryMs ?? DEFAULT_RETRY_MS;
232
233
  const settleMs = options.settleMs ?? DEFAULT_SETTLE_MS;
package/src/i18n/en.ts CHANGED
@@ -90,6 +90,7 @@ export const en: Record<keyof WorkbenchMessages, string> = {
90
90
  'panels.dragHint': 'Drag to reorder',
91
91
  'panels.unknownStep': 'No suite provides this view',
92
92
  'panels.labelWithHint': '{label} ({hint})',
93
+ 'panels.hintJoin': '; ',
93
94
  'panels.dep.failed': '⚠ failed to start',
94
95
  'panels.dep.missingPlugin': '⚠ not ready yet',
95
96
  'panels.dep.missingCommands': '⚠ needs an update',
@@ -104,6 +105,7 @@ export const en: Record<keyof WorkbenchMessages, string> = {
104
105
  'panels.market.notUsable': 'unusable',
105
106
  'panels.market.broken': 'broken',
106
107
  'panels.market.hasNew': 'New version',
108
+ 'panels.market.hasProblem': 'Module problem',
107
109
  'panels.market.missing': 'not installed',
108
110
  'panels.market.unchecked': 'unknown',
109
111
  'panels.market.checking': 'checking',
package/src/i18n/zh.ts CHANGED
@@ -88,6 +88,7 @@ export const zh = {
88
88
  'panels.dragHint': '拖动调整顺序',
89
89
  'panels.unknownStep': '这一层没有套件提供',
90
90
  'panels.labelWithHint': '{label}({hint})',
91
+ 'panels.hintJoin': ';',
91
92
  'panels.dep.failed': '⚠ 起不来',
92
93
  'panels.dep.missingPlugin': '⚠ 还没装好',
93
94
  'panels.dep.missingCommands': '⚠ 需要更新',
@@ -102,6 +103,7 @@ export const zh = {
102
103
  'panels.market.notUsable': '不可用',
103
104
  'panels.market.broken': '装坏了',
104
105
  'panels.market.hasNew': '有新版本',
106
+ 'panels.market.hasProblem': '模块异常',
105
107
  'panels.market.missing': '未装',
106
108
  'panels.market.unchecked': '状态未知',
107
109
  'panels.market.checking': '检测中',
@@ -46,6 +46,7 @@ export interface DebugStore {
46
46
  pause(sessionId: string, now: number): DebugMove;
47
47
  resume(sessionId: string, now: number): DebugMove;
48
48
  stop(sessionId: string, now: number): DebugMove;
49
+ settle?(): Promise<void>;
49
50
  }
50
51
 
51
52
  function alive(state: DebugState | null, now: number): DebugState | null {
@@ -1,5 +0,0 @@
1
- export type DotState = 'ongoing' | 'warning' | 'done' | 'idle' | string;
2
- export declare function StateDot({ state, size }: {
3
- state: DotState;
4
- size: number;
5
- }): JSX.Element;
@@ -1,10 +0,0 @@
1
- import { h } from '../lib/react.js';
2
- export function StateDot({ state, size }) {
3
- if (state === 'ongoing') {
4
- return (h("svg", { className: "wb-loading", viewBox: "0 0 24 24", width: size, height: size, "aria-hidden": "true", style: { display: 'block' } },
5
- h("g", { className: "wb-loadingMotion" },
6
- h("circle", { className: "wb-loadingTrack", cx: 12, cy: 12, r: 9.5 }),
7
- h("circle", { className: "wb-loadingArc", cx: 12, cy: 12, r: 9.5 }))));
8
- }
9
- return (h("span", { className: "wb-stateDot", "data-state": state, style: { width: size, height: size }, "aria-hidden": "true" }));
10
- }
@@ -1,41 +0,0 @@
1
- import type { DshShell } from '../../api/dsh.js';
2
- import type { Opencli } from '../../host/opencli.js';
3
- export interface ShellCall {
4
- command: string;
5
- workdir?: string;
6
- timeoutMs?: number;
7
- onExpiry?: string;
8
- stdoutMaxBytes?: number;
9
- }
10
- export interface ShellReply {
11
- stdout?: string;
12
- stderr?: string;
13
- exitCode?: number | null;
14
- timedOut?: boolean;
15
- aborted?: boolean;
16
- failWith?: Error;
17
- }
18
- export declare function createFakeShell(replies?: ShellReply[] | ((call: ShellCall, index: number) => ShellReply)): {
19
- shell: DshShell;
20
- calls: ShellCall[];
21
- peak: () => number;
22
- commands: () => string[];
23
- };
24
- export interface OpencliCall {
25
- args: readonly string[];
26
- key?: string;
27
- workdir?: string;
28
- refresh?: boolean;
29
- }
30
- export declare function createFakeOpencli(replies?: Array<unknown | Error> | ((call: OpencliCall, index: number) => unknown | Error)): {
31
- opencli: Opencli;
32
- calls: OpencliCall[];
33
- keys: () => (string | undefined)[];
34
- };
35
- export declare function createFakeLogger(): {
36
- logger: {
37
- info: () => void;
38
- warn: (message: string) => void;
39
- };
40
- warnings: string[];
41
- };
@@ -1,76 +0,0 @@
1
- import { setTimeout as delay } from 'node:timers/promises';
2
- const tick = () => delay(0);
3
- export function createFakeShell(replies = []) {
4
- const calls = [];
5
- let running = 0;
6
- let peak = 0;
7
- const replyAt = (index) => typeof replies === 'function' ? replies(calls[index], index) : (replies[index] ?? {});
8
- const shell = {
9
- resolve(request) {
10
- calls.push(request);
11
- return request;
12
- },
13
- async execute() {
14
- const index = calls.length - 1;
15
- const reply = replyAt(index);
16
- if (reply.failWith !== undefined)
17
- throw reply.failWith;
18
- running += 1;
19
- peak = Math.max(peak, running);
20
- return {
21
- async result() {
22
- await tick();
23
- running -= 1;
24
- return {
25
- exitCode: reply.exitCode ?? 0,
26
- timedOut: reply.timedOut ?? false,
27
- aborted: reply.aborted ?? false,
28
- stdout: { text: reply.stdout ?? '', truncated: false },
29
- stderr: { text: reply.stderr ?? '', truncated: false },
30
- };
31
- },
32
- };
33
- },
34
- };
35
- return {
36
- shell,
37
- calls,
38
- peak: () => peak,
39
- commands: () => calls.map((call) => call.command),
40
- };
41
- }
42
- export function createFakeOpencli(replies = []) {
43
- const calls = [];
44
- const opencli = {
45
- async json(args, options = {}) {
46
- const call = {
47
- args,
48
- ...(options.key === undefined ? {} : { key: options.key }),
49
- ...(options.workdir === undefined ? {} : { workdir: options.workdir }),
50
- };
51
- calls.push(call);
52
- const index = calls.length - 1;
53
- const reply = typeof replies === 'function' ? replies(call, index) : (replies[index] ?? []);
54
- if (reply instanceof Error)
55
- throw reply;
56
- return { value: reply, at: Date.now() };
57
- },
58
- };
59
- return {
60
- opencli,
61
- calls,
62
- keys: () => calls.map((call) => call.key),
63
- };
64
- }
65
- export function createFakeLogger() {
66
- const warnings = [];
67
- return {
68
- logger: {
69
- info: () => { },
70
- warn: (message) => {
71
- warnings.push(message);
72
- },
73
- },
74
- warnings,
75
- };
76
- }
@@ -1,19 +0,0 @@
1
- import { createFakeShell } from './fakes';
2
- export declare const GOOD_BRIDGE_REPORT: string;
3
- export declare const ALL_OK: {
4
- stdout: string;
5
- }[];
6
- export declare const STALE_DAEMON_BRIDGE: string;
7
- export declare const BROKEN_BRIDGE: string;
8
- export declare function build(replies: Parameters<typeof createFakeShell>[0], install?: () => Promise<{
9
- ok: boolean;
10
- detail: string;
11
- }>, warmReads?: () => readonly (readonly string[])[]): {
12
- fake: {
13
- shell: import("../..").DshShell;
14
- calls: import("./fakes").ShellCall[];
15
- peak: () => number;
16
- commands: () => string[];
17
- };
18
- preflight: import("../preflight").Preflight;
19
- };
@@ -1,47 +0,0 @@
1
- import { createPreflight } from '../preflight';
2
- import { createFakeShell } from './fakes';
3
- export const GOOD_BRIDGE_REPORT = [
4
- 'opencli v1.8.7 doctor (node v24.15.0)',
5
- '',
6
- '[OK] Daemon: running on port 19825 (v1.8.7)',
7
- '[OK] Extension: connected (v1.0.24)',
8
- '[OK] Connectivity: connected in 0.0s',
9
- '',
10
- 'Everything looks good!',
11
- ].join('\n');
12
- export const ALL_OK = [{ stdout: '1.8.8\n' }, { stdout: GOOD_BRIDGE_REPORT }];
13
- export const STALE_DAEMON_BRIDGE = [
14
- 'opencli v1.8.7 doctor (node v24.15.0)',
15
- '',
16
- '[STALE] Daemon: running on port 19825 (v1.8.8 != CLI v1.8.7)',
17
- '[OK] Extension: connected (v1.0.24)',
18
- '[OK] Connectivity: connected in 0.0s',
19
- '',
20
- 'Issues:',
21
- ' • Stale daemon detected: daemon v1.8.8 != CLI v1.8.7.',
22
- ' Run: opencli daemon restart',
23
- ].join('\n');
24
- export const BROKEN_BRIDGE = [
25
- 'opencli v1.8.7 doctor (node v24.15.0)',
26
- '',
27
- '[MISSING] Daemon: not running',
28
- '[MISSING] Extension: not connected',
29
- '[FAIL] Connectivity: failed (daemon not reachable)',
30
- '',
31
- 'Issues:',
32
- " • Daemon is not running. It should start automatically when you run an opencli browser command.",
33
- ' • Daemon is running but the Chrome/Chromium extension is not connected.',
34
- 'If the extension is not installed:',
35
- ' 1. Download from https://github.com/jackwener/opencli/releases',
36
- ' 2. Open chrome://extensions/ → Enable Developer Mode',
37
- ' 3. Click "Load unpacked" → select the extension folder',
38
- ].join('\n');
39
- export function build(replies, install, warmReads) {
40
- const fake = createFakeShell(replies);
41
- const preflight = createPreflight({
42
- shell: fake.shell,
43
- ...(install === undefined ? {} : { install }),
44
- ...(warmReads === undefined ? {} : { warmReads }),
45
- });
46
- return { fake, preflight };
47
- }
@@ -1,24 +0,0 @@
1
- import { type ContextRef } from '@dsh-workbench/shared';
2
- import type { ContextRenderer } from './unit-face';
3
- export declare const CONTEXT_SOURCE_KIND = "workbench";
4
- export interface ScannableMessage {
5
- readonly source?: {
6
- readonly kind?: string;
7
- };
8
- readonly content?: readonly {
9
- readonly type?: string;
10
- readonly text?: string;
11
- }[];
12
- }
13
- export type { ContextRenderer };
14
- export declare function collectContextRefs(messages: readonly ScannableMessage[]): ContextRef[];
15
- export declare function buildContextMessage(text: string, summary: string): unknown;
16
- export interface ContextInjector {
17
- inject(messages: readonly ScannableMessage[], agent: unknown): Promise<unknown | undefined>;
18
- }
19
- export declare function createContextInjector(options: {
20
- renderers: ReadonlyMap<string, ContextRenderer>;
21
- logger?: {
22
- warn?(message: string): void;
23
- } | undefined;
24
- }): ContextInjector;