@kirkchinese/harness-forge 0.0.0-stage → 0.5.0

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 (279) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +46 -2
  3. package/assets/icon.svg +12 -0
  4. package/cordis.patch.yml +28 -0
  5. package/docs/DETAIL.zh.md +47 -0
  6. package/lib/agents/presets.d.ts +98 -0
  7. package/lib/agents/presets.js +292 -0
  8. package/lib/agents/profiles.d.ts +58 -0
  9. package/lib/agents/profiles.js +279 -0
  10. package/lib/agents/row.d.ts +17 -0
  11. package/lib/agents/row.js +148 -0
  12. package/lib/client/paths.d.ts +12 -0
  13. package/lib/client/paths.js +68 -0
  14. package/lib/client/styles.d.ts +8 -0
  15. package/lib/client/styles.js +89 -0
  16. package/lib/client/typert.d.ts +25 -0
  17. package/lib/client/typert.js +158 -0
  18. package/lib/client.js +23823 -0
  19. package/lib/commands/definition.d.ts +40 -0
  20. package/lib/commands/definition.js +113 -0
  21. package/lib/commands/output-styles.d.ts +42 -0
  22. package/lib/commands/output-styles.js +152 -0
  23. package/lib/commands/row.d.ts +9 -0
  24. package/lib/commands/row.js +157 -0
  25. package/lib/context/instructions.d.ts +32 -0
  26. package/lib/context/instructions.js +88 -0
  27. package/lib/context/row.d.ts +16 -0
  28. package/lib/context/row.js +17 -0
  29. package/lib/dsh/commands.d.ts +30 -0
  30. package/lib/dsh/commands.js +61 -0
  31. package/lib/dsh/host.d.ts +110 -0
  32. package/lib/dsh/host.js +217 -0
  33. package/lib/dsh/model-route.d.ts +21 -0
  34. package/lib/dsh/model-route.js +37 -0
  35. package/lib/dsh/session-records.d.ts +78 -0
  36. package/lib/dsh/session-records.js +36 -0
  37. package/lib/dsh/subagents.d.ts +46 -0
  38. package/lib/dsh/subagents.js +14 -0
  39. package/lib/forge/contract.d.ts +271 -0
  40. package/lib/forge/contract.js +45 -0
  41. package/lib/forge/follow.d.ts +30 -0
  42. package/lib/forge/follow.js +73 -0
  43. package/lib/forge/ledger.d.ts +206 -0
  44. package/lib/forge/ledger.js +1005 -0
  45. package/lib/forge/live-mounts.d.ts +45 -0
  46. package/lib/forge/live-mounts.js +78 -0
  47. package/lib/forge/npm.d.ts +31 -0
  48. package/lib/forge/npm.js +60 -0
  49. package/lib/forge/projects.d.ts +97 -0
  50. package/lib/forge/projects.js +343 -0
  51. package/lib/forge/receipts.d.ts +5 -0
  52. package/lib/forge/receipts.js +31 -0
  53. package/lib/forge/remote/archive.d.ts +65 -0
  54. package/lib/forge/remote/archive.js +565 -0
  55. package/lib/forge/remote/code-parts.d.ts +18 -0
  56. package/lib/forge/remote/code-parts.js +76 -0
  57. package/lib/forge/remote/fetch.d.ts +265 -0
  58. package/lib/forge/remote/fetch.js +1133 -0
  59. package/lib/forge/remote/service.d.ts +256 -0
  60. package/lib/forge/remote/service.js +868 -0
  61. package/lib/forge/row.d.ts +32 -0
  62. package/lib/forge/row.js +59 -0
  63. package/lib/forge/service.d.ts +115 -0
  64. package/lib/forge/service.js +290 -0
  65. package/lib/forge/settings.d.ts +43 -0
  66. package/lib/forge/settings.js +122 -0
  67. package/lib/forge/state.d.ts +129 -0
  68. package/lib/forge/state.js +266 -0
  69. package/lib/forge/trust.d.ts +48 -0
  70. package/lib/forge/trust.js +107 -0
  71. package/lib/forge/turns.d.ts +13 -0
  72. package/lib/forge/turns.js +56 -0
  73. package/lib/hooks/broker/engine.d.ts +112 -0
  74. package/lib/hooks/broker/engine.js +722 -0
  75. package/lib/hooks/broker/helpers.d.ts +10 -0
  76. package/lib/hooks/broker/helpers.js +22 -0
  77. package/lib/hooks/broker/lifecycle.d.ts +65 -0
  78. package/lib/hooks/broker/lifecycle.js +342 -0
  79. package/lib/hooks/broker/session-events.d.ts +27 -0
  80. package/lib/hooks/broker/session-events.js +205 -0
  81. package/lib/hooks/broker/tools.d.ts +52 -0
  82. package/lib/hooks/broker/tools.js +424 -0
  83. package/lib/hooks/broker/types.d.ts +264 -0
  84. package/lib/hooks/broker/types.js +1 -0
  85. package/lib/hooks/broker.d.ts +80 -0
  86. package/lib/hooks/broker.js +95 -0
  87. package/lib/hooks/codex-user.d.ts +5 -0
  88. package/lib/hooks/codex-user.js +109 -0
  89. package/lib/hooks/condition.d.ts +87 -0
  90. package/lib/hooks/condition.js +602 -0
  91. package/lib/hooks/config.d.ts +85 -0
  92. package/lib/hooks/config.js +154 -0
  93. package/lib/hooks/glob.d.ts +41 -0
  94. package/lib/hooks/glob.js +114 -0
  95. package/lib/hooks/matcher.d.ts +20 -0
  96. package/lib/hooks/matcher.js +39 -0
  97. package/lib/hooks/notice.d.ts +17 -0
  98. package/lib/hooks/notice.js +39 -0
  99. package/lib/hooks/output.d.ts +56 -0
  100. package/lib/hooks/output.js +214 -0
  101. package/lib/hooks/permissions.d.ts +19 -0
  102. package/lib/hooks/permissions.js +202 -0
  103. package/lib/hooks/powershell-aliases.d.ts +19 -0
  104. package/lib/hooks/powershell-aliases.js +58 -0
  105. package/lib/hooks/process.d.ts +64 -0
  106. package/lib/hooks/process.js +289 -0
  107. package/lib/hooks/row.d.ts +17 -0
  108. package/lib/hooks/row.js +96 -0
  109. package/lib/hooks/runner.d.ts +98 -0
  110. package/lib/hooks/runner.js +322 -0
  111. package/lib/hooks/shell-commands.d.ts +28 -0
  112. package/lib/hooks/shell-commands.js +241 -0
  113. package/lib/hooks/shell.d.ts +44 -0
  114. package/lib/hooks/shell.js +129 -0
  115. package/lib/hooks/transcript.d.ts +28 -0
  116. package/lib/hooks/transcript.js +141 -0
  117. package/lib/hooks/vocabulary.d.ts +57 -0
  118. package/lib/hooks/vocabulary.js +366 -0
  119. package/lib/index.d.ts +31 -0
  120. package/lib/index.js +287 -0
  121. package/lib/mcp/auth.d.ts +35 -0
  122. package/lib/mcp/auth.js +178 -0
  123. package/lib/mcp/catalog.d.ts +39 -0
  124. package/lib/mcp/catalog.js +69 -0
  125. package/lib/mcp/mount.d.ts +113 -0
  126. package/lib/mcp/mount.js +317 -0
  127. package/lib/mcp/policy.d.ts +42 -0
  128. package/lib/mcp/policy.js +43 -0
  129. package/lib/mcp/remote.d.ts +45 -0
  130. package/lib/mcp/remote.js +133 -0
  131. package/lib/mcp/row.d.ts +9 -0
  132. package/lib/mcp/row.js +225 -0
  133. package/lib/mods/bundler.d.ts +38 -0
  134. package/lib/mods/bundler.js +157 -0
  135. package/lib/mods/chain.d.ts +103 -0
  136. package/lib/mods/chain.js +436 -0
  137. package/lib/mods/claude.d.ts +27 -0
  138. package/lib/mods/claude.js +56 -0
  139. package/lib/mods/engine.d.ts +160 -0
  140. package/lib/mods/engine.js +701 -0
  141. package/lib/mods/expect.d.ts +8 -0
  142. package/lib/mods/expect.js +248 -0
  143. package/lib/mods/host.d.ts +105 -0
  144. package/lib/mods/host.js +462 -0
  145. package/lib/mods/loader.d.ts +53 -0
  146. package/lib/mods/loader.js +231 -0
  147. package/lib/mods/ops.d.ts +13 -0
  148. package/lib/mods/ops.js +117 -0
  149. package/lib/mods/row.d.ts +9 -0
  150. package/lib/mods/row.js +77 -0
  151. package/lib/mods/runtime.d.ts +60 -0
  152. package/lib/mods/runtime.js +133 -0
  153. package/lib/mods/service/commands.d.ts +17 -0
  154. package/lib/mods/service/commands.js +121 -0
  155. package/lib/mods/service/drawings.d.ts +36 -0
  156. package/lib/mods/service/drawings.js +64 -0
  157. package/lib/mods/service/sessions.d.ts +63 -0
  158. package/lib/mods/service/sessions.js +345 -0
  159. package/lib/mods/service/tools.d.ts +32 -0
  160. package/lib/mods/service/tools.js +253 -0
  161. package/lib/mods/service/turns.d.ts +33 -0
  162. package/lib/mods/service/turns.js +136 -0
  163. package/lib/mods/service/types.d.ts +151 -0
  164. package/lib/mods/service/types.js +1 -0
  165. package/lib/mods/service.d.ts +72 -0
  166. package/lib/mods/service.js +104 -0
  167. package/lib/mods/surfaces.d.ts +93 -0
  168. package/lib/mods/surfaces.js +309 -0
  169. package/lib/mods/values.d.ts +30 -0
  170. package/lib/mods/values.js +95 -0
  171. package/lib/opencode/bun.d.ts +40 -0
  172. package/lib/opencode/bun.js +168 -0
  173. package/lib/opencode/convert.d.ts +53 -0
  174. package/lib/opencode/convert.js +255 -0
  175. package/lib/opencode/row.d.ts +22 -0
  176. package/lib/opencode/row.js +104 -0
  177. package/lib/opencode/runtime/core.d.ts +74 -0
  178. package/lib/opencode/runtime/core.js +249 -0
  179. package/lib/opencode/runtime/events.d.ts +80 -0
  180. package/lib/opencode/runtime/events.js +281 -0
  181. package/lib/opencode/runtime/mount.d.ts +27 -0
  182. package/lib/opencode/runtime/mount.js +283 -0
  183. package/lib/opencode/runtime/server.d.ts +27 -0
  184. package/lib/opencode/runtime/server.js +354 -0
  185. package/lib/opencode/runtime/types.d.ts +109 -0
  186. package/lib/opencode/runtime/types.js +1 -0
  187. package/lib/opencode/runtime.d.ts +55 -0
  188. package/lib/opencode/runtime.js +79 -0
  189. package/lib/porting/adapter-paths.d.ts +13 -0
  190. package/lib/porting/adapter-paths.js +120 -0
  191. package/lib/porting/port-gap.d.ts +36 -0
  192. package/lib/porting/port-gap.js +158 -0
  193. package/lib/porting/port-sessions.d.ts +41 -0
  194. package/lib/porting/port-sessions.js +98 -0
  195. package/lib/porting/prompt.d.ts +23 -0
  196. package/lib/porting/prompt.js +51 -0
  197. package/lib/porting/row.d.ts +16 -0
  198. package/lib/porting/row.js +27 -0
  199. package/lib/porting/verify-port.d.ts +46 -0
  200. package/lib/porting/verify-port.js +82 -0
  201. package/lib/presets/fs-search.d.ts +25 -0
  202. package/lib/presets/fs-search.js +17 -0
  203. package/lib/presets/tool-filter.d.ts +35 -0
  204. package/lib/presets/tool-filter.js +91 -0
  205. package/lib/sessions/chat-import.d.ts +48 -0
  206. package/lib/sessions/chat-import.js +44 -0
  207. package/lib/sessions/claude.d.ts +35 -0
  208. package/lib/sessions/claude.js +104 -0
  209. package/lib/sessions/codex-discover.d.ts +34 -0
  210. package/lib/sessions/codex-discover.js +205 -0
  211. package/lib/sessions/codex-meta.d.ts +63 -0
  212. package/lib/sessions/codex-meta.js +148 -0
  213. package/lib/sessions/codex-text.d.ts +9 -0
  214. package/lib/sessions/codex-text.js +44 -0
  215. package/lib/sessions/codex.d.ts +42 -0
  216. package/lib/sessions/codex.js +270 -0
  217. package/lib/sessions/opencode.d.ts +38 -0
  218. package/lib/sessions/opencode.js +339 -0
  219. package/lib/sessions/persist.d.ts +162 -0
  220. package/lib/sessions/persist.js +377 -0
  221. package/lib/sessions/row.d.ts +15 -0
  222. package/lib/sessions/row.js +101 -0
  223. package/lib/sessions/turns.d.ts +31 -0
  224. package/lib/sessions/turns.js +63 -0
  225. package/lib/sessions/zstd.d.ts +15 -0
  226. package/lib/sessions/zstd.js +152 -0
  227. package/lib/shared/invocation.d.ts +169 -0
  228. package/lib/shared/invocation.js +325 -0
  229. package/lib/shared/render.d.ts +101 -0
  230. package/lib/shared/render.js +1353 -0
  231. package/lib/shared/util.d.ts +21 -0
  232. package/lib/shared/util.js +32 -0
  233. package/lib/skills/bundled.d.ts +3 -0
  234. package/lib/skills/bundled.js +42 -0
  235. package/lib/skills/provider.d.ts +74 -0
  236. package/lib/skills/provider.js +346 -0
  237. package/lib/skills/row.d.ts +22 -0
  238. package/lib/skills/row.js +204 -0
  239. package/lib/workbench/adapter-coverage.d.ts +65 -0
  240. package/lib/workbench/adapter-coverage.js +141 -0
  241. package/lib/workbench/model-tools.d.ts +10 -0
  242. package/lib/workbench/model-tools.js +122 -0
  243. package/lib/workbench/overview.d.ts +153 -0
  244. package/lib/workbench/overview.js +246 -0
  245. package/lib/workbench/remote.d.ts +161 -0
  246. package/lib/workbench/remote.js +561 -0
  247. package/lib/workbench/row.d.ts +15 -0
  248. package/lib/workbench/row.js +16 -0
  249. package/lib/workbench/settings.d.ts +19 -0
  250. package/lib/workbench/settings.js +60 -0
  251. package/lib/workbench/workbench.d.ts +130 -0
  252. package/lib/workbench/workbench.js +361 -0
  253. package/locale/agents/en.json +6 -0
  254. package/locale/agents/zh.json +6 -0
  255. package/locale/commands/en.json +6 -0
  256. package/locale/commands/zh.json +6 -0
  257. package/locale/context/en.json +6 -0
  258. package/locale/context/zh.json +6 -0
  259. package/locale/en.json +6 -0
  260. package/locale/hooks/en.json +6 -0
  261. package/locale/hooks/zh.json +6 -0
  262. package/locale/mcp/en.json +6 -0
  263. package/locale/mcp/zh.json +6 -0
  264. package/locale/mods/en.json +6 -0
  265. package/locale/mods/zh.json +6 -0
  266. package/locale/opencode/en.json +6 -0
  267. package/locale/opencode/zh.json +6 -0
  268. package/locale/porter/en.json +6 -0
  269. package/locale/porter/zh.json +6 -0
  270. package/locale/sessions/en.json +6 -0
  271. package/locale/sessions/zh.json +6 -0
  272. package/locale/skills/en.json +6 -0
  273. package/locale/skills/zh.json +6 -0
  274. package/locale/workbench/en.json +6 -0
  275. package/locale/workbench/zh.json +6 -0
  276. package/locale/zh.json +7 -0
  277. package/package.json +247 -3
  278. package/runtime/opencode-host.mjs +270 -0
  279. package/skills/harness-forge/SKILL.md +47 -0
@@ -0,0 +1,153 @@
1
+ import type { DetachedReason, InstalledPluginRecord } from '../forge/state.js';
2
+ import { type ComponentOutcome, type ForeignComponent, type ForeignPlugin, type Gap, type PluginIdProblem } from '@kirkchinese/harness-forge-core';
3
+ export type PartState = 'works' | 'partial' | 'needs-port' | 'unsupported' | 'failed' | 'inactive' | 'off' | 'provided';
4
+ export type ReasonCode = 'events-never-raised' | 'cannot-block' | 'handlers-inert' | 'output-style' | 'experimental-runtime' | 'no-equivalent-ui' | 'not-mapped' | 'hosted-connector' | 'unknown-transport' | 'disabled-in-plugin' | 'disabled-in-config' | 'disabled-in-claude-code' | 'needs-chatgpt-sign-in' | 'run-failed' | 'setup-failed' | 'unreadable' | 'folder-gone' | 'not-followed' | 'row-off' | 'other';
5
+ export interface OverviewPart {
6
+ readonly id: string;
7
+ readonly kind: ForeignComponent['kind'];
8
+ readonly name: string;
9
+ readonly state: PartState;
10
+ /** Whether a run in DSH was observed (a `works` part that is only set up says so). */
11
+ readonly checked: boolean;
12
+ readonly reasons: ReadonlyArray<{
13
+ readonly code: ReasonCode;
14
+ readonly detail: string;
15
+ }>;
16
+ /** The gap an adapter can close (needs-port, and partial parts an adapter could complete). */
17
+ readonly portGap?: string;
18
+ /** The installed adapter that covers this part. */
19
+ readonly adapter?: string;
20
+ /** Another part supplies this settings entry; only that part counts toward the overview. */
21
+ readonly providedBy?: {
22
+ readonly name: string;
23
+ readonly adapter?: string;
24
+ };
25
+ /** It acts when a session starts (see {@link actsAtSessionStart}): a session already open keeps what it started with. */
26
+ readonly atStart?: true;
27
+ }
28
+ export interface OverviewItem {
29
+ readonly id: string;
30
+ readonly name: string;
31
+ readonly source: string;
32
+ readonly root: string;
33
+ /** The person's own assets (`~/.claude`, `~/.codex`) rather than a plugin. */
34
+ readonly own: boolean;
35
+ readonly installed: boolean;
36
+ readonly version?: string;
37
+ readonly parts: readonly OverviewPart[];
38
+ readonly counts: Readonly<Record<PartState, number>>;
39
+ /** Of the parts that work, how many have run here and been checked. */
40
+ readonly checked: number;
41
+ /** Installed from the network ("Get plugins"), not found in a harness's own folders. */
42
+ readonly fetched?: true;
43
+ /**
44
+ * Not migrated, and switched off in its own harness (Claude Code `enabledPlugins`, Codex `enabled = false`):
45
+ * listed, but "Migrate all" leaves it out (see {@link migratable}).
46
+ */
47
+ readonly enabled?: false;
48
+ /**
49
+ * Not migrated, and whether its harness runs it cannot be told, saying why: an OpenCode plugin whose id its source
50
+ * does not settle, under an entry that switches plugins by id. "Migrate all" leaves it out too.
51
+ */
52
+ readonly enabledUnknown?: PluginIdProblem;
53
+ /** Migrated, but its harness no longer runs it (see `forge/follow.ts`): nothing of it runs until kept or removed. */
54
+ readonly detached?: {
55
+ readonly reason: DetachedReason;
56
+ readonly harness: string;
57
+ readonly folderGone: boolean;
58
+ };
59
+ /** The last update its harness made, which the migrated plugin followed. */
60
+ readonly updated?: {
61
+ readonly harness: string;
62
+ readonly from?: string;
63
+ readonly to?: string;
64
+ readonly at: string;
65
+ };
66
+ }
67
+ /**
68
+ * Whether "Migrate all" takes a plugin: not migrated yet, and surely not switched off in the harness it came from.
69
+ * The one rule for the overview's count, the button's label and the batch itself; a plugin it leaves out can still
70
+ * be migrated on its own.
71
+ */
72
+ export declare function migratable(item: {
73
+ readonly installed: boolean;
74
+ readonly enabled?: boolean;
75
+ readonly enabledUnknown?: PluginIdProblem;
76
+ }): boolean;
77
+ export interface OverviewHarness {
78
+ readonly source: string;
79
+ /** Product name; not translated. */
80
+ readonly label: string;
81
+ readonly items: readonly OverviewItem[];
82
+ readonly counts: Readonly<Record<PartState, number>>;
83
+ /** Of the parts that work, how many have run here and been checked. */
84
+ readonly checked: number;
85
+ /** How many items "Migrate all" takes ({@link migratable}). */
86
+ readonly toMigrate: number;
87
+ }
88
+ export interface Overview {
89
+ /** What was found on this computer in each harness's own folders. */
90
+ readonly harnesses: readonly OverviewHarness[];
91
+ /** Plugins installed from the network: migrated, but in no harness's folders. */
92
+ readonly fetched: readonly OverviewItem[];
93
+ }
94
+ /** An installed adapter and the parts it brings: plugin name and component name of the original. */
95
+ export interface AdapterCoverage {
96
+ readonly name: string;
97
+ readonly ports: ReadonlyArray<{
98
+ readonly plugin: string;
99
+ readonly component: string;
100
+ }>;
101
+ /** Its package directory (a local install's source directory). */
102
+ readonly dir?: string;
103
+ }
104
+ /** The installed adapter that covers a part: one declaring it in `harnessForge.ports`, or named for it (`adapterPackageName`). */
105
+ export declare function coveringAdapter(plugin: Pick<ForeignPlugin, 'name'>, component: Pick<ForeignComponent, 'name'>, adapters: readonly AdapterCoverage[]): string | undefined;
106
+ /**
107
+ * Whether a part acts only when a session starts: a SessionStart hook runs once as the session begins, so a session
108
+ * already open does not get it. Everything else takes effect at once: skills, commands, agents and MCP tools are
109
+ * looked up when they are used, the other hooks run at their events, and system-prompt sections (output styles,
110
+ * Codex's global instructions, instruction files) are read again at every step, because DSH assembles the system
111
+ * prompt once per step (dsh-system-prompt: "The agent loop calls `assemble(context)` once per proposed step").
112
+ */
113
+ export declare function actsAtSessionStart(component: ForeignComponent): boolean;
114
+ /** The state of one part, from what happened when it was set up and run (or, before migration, from its gaps). */
115
+ export declare function partOf(component: ForeignComponent, gaps: readonly Gap[], outcome: ComponentOutcome | undefined, adapter: string | undefined, off?: boolean): OverviewPart;
116
+ /** One plugin or own-assets root, installed (with outcomes) or only discovered. */
117
+ export declare function itemOf(plugin: ForeignPlugin, record: {
118
+ readonly outcomes?: readonly ComponentOutcome[];
119
+ readonly compat?: {
120
+ readonly gaps: readonly Gap[];
121
+ };
122
+ readonly disabled?: readonly string[];
123
+ } | undefined, adapters?: readonly AdapterCoverage[]): OverviewItem;
124
+ /** An installed plugin whose files can no longer be read: every recorded part is an error, with the reason. */
125
+ export declare function unreadableItemOf(record: {
126
+ readonly id: string;
127
+ readonly name: string;
128
+ readonly displayName?: string;
129
+ readonly source: string;
130
+ readonly root: string;
131
+ readonly version?: string;
132
+ readonly components: ReadonlyArray<{
133
+ readonly kind: string;
134
+ readonly name: string;
135
+ }>;
136
+ }, error: string, code?: 'unreadable' | 'folder-gone'): OverviewItem;
137
+ /**
138
+ * A migrated item as its harness install has it: a detached one's parts (but those the person switched off, or that
139
+ * could not be withdrawn) do not run, saying so; an updated one says from which version.
140
+ */
141
+ export declare function followedItemOf(item: OverviewItem, record: Pick<InstalledPluginRecord, 'harnessInstall' | 'detached' | 'harnessUpdate' | 'root'> | undefined, folderGone: boolean): OverviewItem;
142
+ /**
143
+ * Installed plugins that genuinely share a name are told apart in plain words, the same way wherever they are listed:
144
+ * `name (where it came from)`, and the folder it is in when that is the same too. A plugin with a name of its own is
145
+ * shown as it is: the suffix the ledger gives its id is never part of what people read.
146
+ */
147
+ export declare function qualifyDuplicateNames<T extends OverviewItem>(items: readonly T[]): T[];
148
+ /** Group items by harness, in dialect order: own assets first, then installed plugins, then the rest by name; those fetched from the network apart. */
149
+ export declare function overviewOf(items: readonly OverviewItem[], link?: {
150
+ readonly settingsId: string;
151
+ readonly providerId: string;
152
+ readonly name: string;
153
+ }): Overview;
@@ -0,0 +1,246 @@
1
+ /**
2
+ * The workbench's plain-language view: for each harness (Claude Code, Codex,
3
+ * OpenCode) the person's plugins and own assets, and for each part one of
4
+ * five states with the reason. Levels, plans and receipts stay in the
5
+ * details; this is what a person who never heard of them reads.
6
+ *
7
+ * | State | When |
8
+ * | --- | --- |
9
+ * | `works` | set up in DSH (or covered by an installed adapter) with nothing known missing; `checked` says whether a run here was observed |
10
+ * | `partial` | set up, but something it uses does not carry over, or a run of it failed in part |
11
+ * | `needs-port` | DSH has no equivalent; DSH's creation mode can write an adapter from its brief |
12
+ * | `unsupported` | DSH has no equivalent and none can be written from what the plugin declares |
13
+ * | `failed` | setting it up or running it failed |
14
+ * | `inactive` | the part of Harness Forge that runs it is switched off |
15
+ * | `off` | the person switched this part off |
16
+ *
17
+ * A reason is a code the browser words in the person's language, plus the
18
+ * specifics (event names, the error) as they are. A plugin not migrated yet
19
+ * shows the states its parts would have, predicted from its scan.
20
+ * @module @kirkchinese/harness-forge
21
+ */
22
+ import { basename, dirname } from 'node:path';
23
+ import { adapterPackageName, assess, dialects } from '@kirkchinese/harness-forge-core';
24
+ /**
25
+ * Whether "Migrate all" takes a plugin: not migrated yet, and surely not switched off in the harness it came from.
26
+ * The one rule for the overview's count, the button's label and the batch itself; a plugin it leaves out can still
27
+ * be migrated on its own.
28
+ */
29
+ export function migratable(item) {
30
+ return !item.installed && item.enabled !== false && item.enabledUnknown === undefined;
31
+ }
32
+ /** The installed adapter that covers a part: one declaring it in `harnessForge.ports`, or named for it (`adapterPackageName`). */
33
+ export function coveringAdapter(plugin, component, adapters) {
34
+ return adapters.find(adapter => adapter.name === adapterPackageName(plugin, component) || adapter.ports.some(port => port.plugin === plugin.name && port.component === component.name))?.name;
35
+ }
36
+ /** Harnesses always shown, found or not; other dialects only when they found something. */
37
+ const ALWAYS_SHOWN = new Set(['claude-code', 'codex', 'opencode']);
38
+ function emptyCounts() {
39
+ return { works: 0, partial: 0, 'needs-port': 0, unsupported: 0, failed: 0, inactive: 0, off: 0, provided: 0 };
40
+ }
41
+ /** The specifics after "…: " in a gap summary (event or handler names), else the summary. */
42
+ function specifics(summary) {
43
+ const at = summary.indexOf(': ');
44
+ return at >= 0 ? summary.slice(at + 2) : summary;
45
+ }
46
+ /** Why a part DSH does not run was left out: the code its own configuration or approval gave, else what the outcome said. */
47
+ function skippedReason(component, outcome) {
48
+ const code = outcome?.skippedBy ?? (component.kind === 'mcp' ? component.notStarted?.code : undefined);
49
+ return code !== undefined ? { code, detail: '' } : { code: 'other', detail: outcome?.message ?? '' };
50
+ }
51
+ function reasonOf(gap, component) {
52
+ switch (gap.kind) {
53
+ case 'unsupported-event': return { code: 'events-never-raised', detail: specifics(gap.summary) };
54
+ case 'semantic-difference': return gap.id.endsWith(':output-style') ? { code: 'output-style', detail: '' } : { code: 'cannot-block', detail: specifics(gap.summary) };
55
+ case 'unsupported-handler': return { code: 'handlers-inert', detail: specifics(gap.summary) };
56
+ case 'missing-host-api': return { code: 'experimental-runtime', detail: gap.detail };
57
+ case 'ui-surface': return { code: 'no-equivalent-ui', detail: '' };
58
+ case 'unsupported-component': return { code: 'not-mapped', detail: gap.summary.replace(/ is not mapped to DSH$/u, '') };
59
+ case 'unsupported-transport': return { code: 'unknown-transport', detail: '' };
60
+ case 'external-requirement': return component?.kind === 'mcp' && component.notStarted !== undefined ? skippedReason(component, undefined) : { code: 'other', detail: gap.summary };
61
+ case 'runtime-failure': return { code: 'setup-failed', detail: gap.summary };
62
+ default: return { code: 'other', detail: gap.summary };
63
+ }
64
+ }
65
+ /** Gaps an adapter written in DSH's creation mode can close. */
66
+ function portable(gap) {
67
+ return gap.kind === 'ui-surface' || gap.kind === 'unsupported-component' || gap.kind === 'unsupported-event' || gap.kind === 'unsupported-handler';
68
+ }
69
+ /** The hook event DSH raises once as a session starts. */
70
+ const SESSION_START_EVENT = 'SessionStart';
71
+ /**
72
+ * Whether a part acts only when a session starts: a SessionStart hook runs once as the session begins, so a session
73
+ * already open does not get it. Everything else takes effect at once: skills, commands, agents and MCP tools are
74
+ * looked up when they are used, the other hooks run at their events, and system-prompt sections (output styles,
75
+ * Codex's global instructions, instruction files) are read again at every step, because DSH assembles the system
76
+ * prompt once per step (dsh-system-prompt: "The agent loop calls `assemble(context)` once per proposed step").
77
+ */
78
+ export function actsAtSessionStart(component) {
79
+ return component.kind === 'hooks' && component.events.includes(SESSION_START_EVENT);
80
+ }
81
+ /** The state of one part, from what happened when it was set up and run (or, before migration, from its gaps). */
82
+ export function partOf(component, gaps, outcome, adapter, off = false) {
83
+ const part = stateOfPart(component, gaps, outcome, adapter, off);
84
+ return actsAtSessionStart(component) ? { ...part, atStart: true } : part;
85
+ }
86
+ function stateOfPart(component, gaps, outcome, adapter, off) {
87
+ const own = gaps.filter(gap => gap.componentId === component.id && gap.kind !== 'license' && gap.kind !== 'runtime-failure');
88
+ const base = { id: component.id, kind: component.kind, name: component.name };
89
+ if (off)
90
+ return { ...base, state: 'off', checked: false, reasons: [] };
91
+ const portGap = own.find(portable)?.id;
92
+ const port = portGap !== undefined ? { portGap } : {};
93
+ // An installed adapter brings the part; nothing here has seen it run, so it is not `checked`.
94
+ if (adapter !== undefined)
95
+ return { ...base, state: 'works', checked: false, reasons: [], adapter };
96
+ // A Codex app is a connector OpenAI hosts and signs in to; nothing local can stand in for it.
97
+ if (component.kind === 'other' && component.originalKind === 'app-connector') {
98
+ return { ...base, state: 'unsupported', checked: false, reasons: [{ code: 'hosted-connector', detail: '' }] };
99
+ }
100
+ // The detail is the row that is off (`skills`, `mcp`, …), for the browser to name.
101
+ if (outcome?.status === 'inactive')
102
+ return { ...base, state: 'inactive', checked: false, reasons: [{ code: 'row-off', detail: /the (\S+) row is off/u.exec(outcome.message ?? '')?.[1] ?? '' }] };
103
+ const observations = outcome?.observations ?? [];
104
+ const failedRuns = observations.filter(item => !item.ok);
105
+ if (outcome?.status === 'failed') {
106
+ // Failed when set up (no runs recorded), or failed in its runs: some of them (partly works) or all (error).
107
+ if (failedRuns.length === 0)
108
+ return { ...base, state: 'failed', checked: true, reasons: [{ code: 'setup-failed', detail: outcome.message ?? '' }], ...port };
109
+ const runReasons = failedRuns.map(item => ({ code: 'run-failed', detail: item.detail ?? item.signal }));
110
+ return { ...base, state: failedRuns.length < observations.length ? 'partial' : 'failed', checked: true, reasons: runReasons, ...port };
111
+ }
112
+ const blocking = own.find(gap => gap.kind === 'ui-surface' || gap.kind === 'unsupported-component' || gap.kind === 'unsupported-transport' || gap.kind === 'external-requirement');
113
+ if (blocking !== undefined || outcome?.status === 'skipped') {
114
+ const reasons = blocking !== undefined ? [reasonOf(blocking, component)] : [skippedReason(component, outcome)];
115
+ return { ...base, state: portGap !== undefined ? 'needs-port' : 'unsupported', checked: false, reasons, ...port };
116
+ }
117
+ const verified = outcome?.status === 'verified';
118
+ // A verified code runtime has shown the API it needs is there.
119
+ const reasons = own.filter(gap => !(verified && gap.kind === 'missing-host-api')).map(gap => reasonOf(gap, component));
120
+ if (reasons.length > 0)
121
+ return { ...base, state: 'partial', checked: verified, reasons, ...port };
122
+ return { ...base, state: 'works', checked: verified, reasons: [] };
123
+ }
124
+ /** One plugin or own-assets root, installed (with outcomes) or only discovered. */
125
+ export function itemOf(plugin, record, adapters = []) {
126
+ const gaps = record?.compat?.gaps ?? assess(plugin).gaps;
127
+ const outcomes = new Map((record?.outcomes ?? []).map(outcome => [outcome.componentId, outcome]));
128
+ const coveredBy = (component) => coveringAdapter(plugin, component, adapters);
129
+ const disabled = new Set(record?.disabled ?? []);
130
+ const parts = plugin.components.map(component => partOf(component, gaps, outcomes.get(component.id), coveredBy(component), disabled.has(component.id)));
131
+ const counts = emptyCounts();
132
+ for (const part of parts)
133
+ counts[part.state]++;
134
+ return {
135
+ id: plugin.id,
136
+ name: plugin.displayName ?? plugin.name,
137
+ source: plugin.source,
138
+ root: plugin.root,
139
+ own: plugin.manifest['scope'] === 'user',
140
+ installed: record !== undefined,
141
+ ...(plugin.version !== undefined ? { version: plugin.version } : {}),
142
+ parts,
143
+ counts,
144
+ checked: parts.filter(part => part.state === 'works' && part.checked).length,
145
+ };
146
+ }
147
+ /** An installed plugin whose files can no longer be read: every recorded part is an error, with the reason. */
148
+ export function unreadableItemOf(record, error, code = 'unreadable') {
149
+ const parts = record.components.map((component, index) => ({
150
+ id: `${record.id}:${String(index)}`,
151
+ kind: component.kind,
152
+ name: component.name,
153
+ state: 'failed',
154
+ checked: true,
155
+ reasons: [{ code, detail: error }],
156
+ }));
157
+ const counts = emptyCounts();
158
+ counts.failed = parts.length;
159
+ return {
160
+ id: record.id,
161
+ name: record.displayName ?? record.name,
162
+ source: record.source,
163
+ root: record.root,
164
+ own: record.id.endsWith(':user'),
165
+ installed: true,
166
+ ...(record.version !== undefined ? { version: record.version } : {}),
167
+ parts,
168
+ counts,
169
+ checked: 0,
170
+ };
171
+ }
172
+ /**
173
+ * A migrated item as its harness install has it: a detached one's parts (but those the person switched off, or that
174
+ * could not be withdrawn) do not run, saying so; an updated one says from which version.
175
+ */
176
+ export function followedItemOf(item, record, folderGone) {
177
+ const harness = record?.harnessInstall?.harness ?? item.source;
178
+ const updated = record?.harnessUpdate === undefined ? {} : { updated: { harness, ...record.harnessUpdate } };
179
+ if (record?.detached === undefined)
180
+ return { ...item, ...updated };
181
+ const parts = item.parts.map((part) => part.state === 'off' || part.state === 'failed' ? part : { ...part, state: 'inactive', checked: false, reasons: [{ code: 'not-followed', detail: harness }] });
182
+ const counts = emptyCounts();
183
+ for (const part of parts)
184
+ counts[part.state]++;
185
+ return { ...item, ...updated, parts, counts, checked: 0, detached: { reason: record.detached.reason, harness, folderGone } };
186
+ }
187
+ /**
188
+ * Installed plugins that genuinely share a name are told apart in plain words, the same way wherever they are listed:
189
+ * `name (where it came from)`, and the folder it is in when that is the same too. A plugin with a name of its own is
190
+ * shown as it is: the suffix the ledger gives its id is never part of what people read.
191
+ */
192
+ export function qualifyDuplicateNames(items) {
193
+ const groups = new Map();
194
+ for (const item of items) {
195
+ if (!item.installed)
196
+ continue;
197
+ groups.set(item.name.toLowerCase(), [...groups.get(item.name.toLowerCase()) ?? [], item]);
198
+ }
199
+ const qualified = new Map();
200
+ for (const group of groups.values()) {
201
+ if (group.length < 2)
202
+ continue;
203
+ const origin = (item) => (item.fetched === true ? 'network' : item.source);
204
+ const unique = new Set(group.map(origin)).size === group.length;
205
+ for (const item of group)
206
+ qualified.set(item, `${item.name} (${unique ? origin(item) : `${origin(item)}, ${basename(dirname(item.root))}`})`);
207
+ }
208
+ return items.map(item => (qualified.has(item) ? { ...item, name: qualified.get(item) } : item));
209
+ }
210
+ /** Group items by harness, in dialect order: own assets first, then installed plugins, then the rest by name; those fetched from the network apart. */
211
+ export function overviewOf(items, link) {
212
+ const provider = link === undefined ? undefined : items.flatMap(item => item.parts).find(part => part.id === link.providerId);
213
+ if (link !== undefined && provider !== undefined) {
214
+ items = items.map(item => {
215
+ const settings = item.parts.find(part => part.id === link.settingsId);
216
+ if (settings === undefined)
217
+ return item;
218
+ const counts = { ...item.counts, [settings.state]: item.counts[settings.state] - 1 };
219
+ const alias = {
220
+ id: settings.id, kind: settings.kind, name: settings.name,
221
+ state: 'provided', checked: provider.checked, reasons: [],
222
+ providedBy: { name: link.name, ...(provider.adapter !== undefined ? { adapter: provider.adapter } : {}) },
223
+ };
224
+ return { ...item, parts: item.parts.map(part => part === settings ? alias : part), counts, checked: item.checked - Number(settings.state === 'works' && settings.checked) };
225
+ });
226
+ }
227
+ const fetched = items.filter(item => item.fetched === true).sort((a, b) => a.name.localeCompare(b.name, 'en'));
228
+ items = items.filter(item => item.fetched !== true);
229
+ const known = dialects().map(dialect => ({ source: dialect.id, label: dialect.label }));
230
+ const unknown = [...new Set(items.map(item => item.source))].filter(source => !known.some(dialect => dialect.source === source)).map(source => ({ source, label: source }));
231
+ return {
232
+ harnesses: [...known, ...unknown].flatMap(({ source, label }) => {
233
+ const own = items.filter(item => item.source === source)
234
+ .sort((a, b) => Number(b.own) - Number(a.own) || Number(b.installed) - Number(a.installed) || a.name.localeCompare(b.name, 'en'));
235
+ if (own.length === 0 && !ALWAYS_SHOWN.has(source))
236
+ return [];
237
+ const counts = emptyCounts();
238
+ for (const item of own)
239
+ for (const state of Object.keys(counts))
240
+ counts[state] += item.counts[state];
241
+ const checked = own.reduce((sum, item) => sum + item.checked, 0);
242
+ return [{ source, label, items: own, counts, checked, toMigrate: own.filter(migratable).length }];
243
+ }),
244
+ fetched,
245
+ };
246
+ }
@@ -0,0 +1,161 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
3
+ import type { HarnessForge } from '../forge/service.js';
4
+ declare module '@deepseek-ai/dsh-typert-protocol' {
5
+ interface RemoteErrorDetailsMap {
6
+ /** A workbench operation failed; the message says why, for the person. */
7
+ 'harness-forge/failed': {
8
+ readonly operation: string;
9
+ };
10
+ /** A session above the import ceiling (`size` when known: a compressed one is cut off while decoding); the browser words it in the person's language. */
11
+ 'harness-forge/session-too-large': {
12
+ readonly operation: string;
13
+ readonly limit: number;
14
+ readonly size?: number;
15
+ };
16
+ /** A stored session may already hold the one being imported; the browser offers to open it or import as new. */
17
+ 'harness-forge/session-maybe-imported': {
18
+ readonly operation: string;
19
+ readonly existingId: string;
20
+ };
21
+ }
22
+ }
23
+ /**
24
+ * An answer as plain JSON, the only kind DSH's Remote carrier passes: fields
25
+ * that are `undefined` (or functions) are dropped, an `undefined` list item
26
+ * becomes `null`, `-0` becomes `0`, and anything with `toJSON` is converted as
27
+ * JSON would. A number JSON cannot carry, a bigint or a cycle is refused with
28
+ * where it sits, instead of reaching the browser as something else.
29
+ */
30
+ export declare function plainJson(value: unknown, at?: string, ancestors?: Set<object>): unknown;
31
+ /** What an adapter's surface shows for one session (the ui-slot template's `{ lines, at }`). */
32
+ export interface AdapterSurfaceSource {
33
+ /** `request`: what the browser half sent with it (a width, say). */
34
+ read(sessionId: string, request: Readonly<Record<string, unknown>>): unknown;
35
+ }
36
+ /** The installation service as Remote methods. */
37
+ export declare class HarnessRemoteService extends TypertRemoteService {
38
+ private readonly forge;
39
+ private readonly workbench;
40
+ private readonly adapterSurfaces;
41
+ private readonly adapterListeners;
42
+ constructor(ctx: Context, forge: HarnessForge);
43
+ /** A row's API, or a failure naming the row that is off. */
44
+ private row;
45
+ /** Run one operation and answer it as plain JSON; anything it throws reaches the browser with its message. */
46
+ private guard;
47
+ /** The instruction files added to the default workspace's prompt (`{ active, yieldingTo?, files }`); inactive while the context row is off. */
48
+ contextStatus(): Promise<unknown>;
49
+ /**
50
+ * The overview, plus the home folder (the page shows paths under it as `~/…`), the workspaces of open sessions with
51
+ * their trust and the project parts that wait for it, and how many records are still being applied. It starts following the harnesses' changes without waiting for it:
52
+ * `applying` says it is under way, and the next overview shows the result.
53
+ */
54
+ overview(): Promise<unknown>;
55
+ /** A workspace's trust (`{ workspace, trusted, sources, waiting }`): its project parts that run code wait until it is trusted. */
56
+ workspaceTrust(request: Record<string, unknown>): Promise<unknown>;
57
+ /**
58
+ * Trust (or stop trusting) a workspace in Harness Forge; returns once open sessions in it have mounted or withdrawn what changed
59
+ * (`{ decision, stillLive: [{ componentId, reason }] }`: the parts whose withdrawal failed are still live, and calling it again retries).
60
+ */
61
+ trustWorkspace(request: Record<string, unknown>): Promise<unknown>;
62
+ /** The workspaces Harness Forge holds a trust decision on (`{ workspaces: [{ workspace, trusted, sources, dismissed, trustedAt?, dismissedAt? }] }`): trusted here, or dismissed with "Not now". */
63
+ trustDecisions(): Promise<unknown>;
64
+ /** Hide (or show again) a workspace's trust banner; trusts nothing. */
65
+ dismissTrust(request: Record<string, unknown>): Promise<unknown>;
66
+ private trustOf;
67
+ discover(): Promise<unknown>;
68
+ diagnostics(): Promise<unknown>;
69
+ settings(): Promise<unknown>;
70
+ saveSettings(request: Record<string, unknown>): Promise<unknown>;
71
+ installPlugin(request: Record<string, unknown>): Promise<unknown>;
72
+ migrate(request: Record<string, unknown>): Promise<unknown>;
73
+ setPartEnabled(request: Record<string, unknown>): Promise<unknown>;
74
+ removePlugin(request: Record<string, unknown>): Promise<unknown>;
75
+ /** Keep a plugin its harness no longer runs as the person's own copy. */
76
+ keepPlugin(request: Record<string, unknown>): Promise<unknown>;
77
+ /**
78
+ * The default marketplaces, the ones the person added, the local
79
+ * marketplaces the harnesses on this computer added, what was installed
80
+ * from the network, and whether git is installed.
81
+ */
82
+ remoteSources(): Promise<unknown>;
83
+ /** Open a pasted marketplace or plugin (`owner/repo`, a git URL, a marketplace.json URL, an npm package, a local folder): its entries, fetched now. */
84
+ remoteOpen(request: Record<string, unknown>): Promise<unknown>;
85
+ /** Stop listing a marketplace the person added. */
86
+ remoteForget(request: Record<string, unknown>): Promise<unknown>;
87
+ /**
88
+ * Fetch one plugin (a marketplace's `entry`, or the pasted `input` itself) and say what it contains, to confirm:
89
+ * `{ token, name, source, page?, revision, parts, codeParts, … }`. Nothing is installed yet.
90
+ */
91
+ remotePrepare(request: Record<string, unknown>): Promise<unknown>;
92
+ /** Install (or, for an update, apply) exactly what `remotePrepare` or `remotePrepareUpdate` showed. */
93
+ remoteInstall(request: Record<string, unknown>): Promise<unknown>;
94
+ /** Drop a confirmation the person declined, with the files it fetched. */
95
+ remoteCancel(request: Record<string, unknown>): Promise<unknown>;
96
+ /**
97
+ * Compare what was installed from the network with its source now
98
+ * (`{ updates: [{ pluginId, current, latest?, update, token?, error? }] }`); `token` names the revision found.
99
+ */
100
+ remoteCheckUpdates(request: Record<string, unknown> | undefined): Promise<unknown>;
101
+ /**
102
+ * Fetch the revision a check found (`{ pluginId, token }`) and say what it contains and what changed, to confirm
103
+ * like an install; `remoteInstall` with the returned token applies it.
104
+ */
105
+ remotePrepareUpdate(request: Record<string, unknown>): Promise<unknown>;
106
+ signIns(): Promise<unknown>;
107
+ signIn(request: Record<string, unknown>): Promise<unknown>;
108
+ sessions(request: Record<string, unknown> | undefined): Promise<unknown>;
109
+ importSession(request: Record<string, unknown>): Promise<unknown>;
110
+ /** Open a session an import stored: registered with DSH and out of its archive (`{ id, live, unarchived, archived }`). */
111
+ openImported(request: Record<string, unknown>): Promise<unknown>;
112
+ /** Who imports sessions (`{ provider: 'harness-forge' | 'dsh-chat-import', canInstall, command }`). */
113
+ sessionImport(): Promise<unknown>;
114
+ /** Install and enable dsh-chat-import through DSH's plugin manager; the browser asks the person first. */
115
+ installChatImport(): Promise<unknown>;
116
+ /**
117
+ * A session's mod drawings: the current one, then every new one, until the
118
+ * browser stops reading. Ends at once when the session's mods draw nothing.
119
+ */
120
+ modSurfaces(request: Record<string, unknown>, signal?: AbortSignal): AsyncIterable<unknown>;
121
+ modAct(request: Record<string, unknown>): Promise<unknown>;
122
+ modClose(request: Record<string, unknown>): Promise<unknown>;
123
+ modMove(request: Record<string, unknown>): Promise<unknown>;
124
+ /**
125
+ * For an adapter's Node half (not a Remote method): publish a surface its
126
+ * browser half reads through `adapterSurface`, so an adapter needs no HTTP
127
+ * route of its own. `read` gives what the surface shows for one session;
128
+ * `changed(session)` tells the browser to read again.
129
+ */
130
+ registerAdapterSurface(id: string, source: AdapterSurfaceSource): {
131
+ changed(sessionId: string): void;
132
+ dispose(): void;
133
+ };
134
+ /** What an adapter's surface shows for a session now, read once (a browser half that sets its own pace). */
135
+ adapterRead(request: Record<string, unknown>): Promise<unknown>;
136
+ /**
137
+ * What an adapter's surface shows for a session: now, then again each time
138
+ * the adapter says it changed, until the browser stops reading.
139
+ */
140
+ adapterSurface(request: Record<string, unknown>, signal?: AbortSignal): AsyncIterable<unknown>;
141
+ /**
142
+ * The task a port session starts with (the working protocol, then the part's brief), as Markdown, to preview or
143
+ * copy; `language` is the user's interface language, which the agent is told to talk in.
144
+ */
145
+ portBrief(request: Record<string, unknown>): Promise<unknown>;
146
+ /**
147
+ * The parts being ported or ported (`{ ports: [{ pluginId, componentId, state, sessionId?, verifiedAt?, adapter? }] }`,
148
+ * `state` `in-progress` or `verified`). A port whose session was deleted is dropped, so the part can be ported again.
149
+ */
150
+ portSessions(): Promise<unknown>;
151
+ /** What `harness_verify_port` answers for a part (`{ covered, checks, adapter? }`), recorded the same way. */
152
+ verifyPort(request: Record<string, unknown>): Promise<unknown>;
153
+ /**
154
+ * Port one part of a plugin: start a session in DSH's creation mode working
155
+ * on its task in the adapters directory by default (or the given `workspaceId`
156
+ * or `cwd`), and record it as the part's port session.
157
+ */
158
+ portGap(request: Record<string, unknown>): Promise<unknown>;
159
+ }
160
+ /** The Remote methods and whether each streams; the client contribution mirrors this list. */
161
+ export declare const REMOTE_METHODS: ReadonlyArray<readonly [string, 'unary' | 'stream', boolean]>;