@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,14 @@
1
+ /**
2
+ * Starting a delegated agent through DSH's `subagents` service: the
3
+ * activation spec takes the task fields at the top level
4
+ * (`SubagentActivationSpec extends SubagentStartRequest`).
5
+ * Checked against DSH 0.2.2-rc.3 and 0.2.2-rc.5.
6
+ * @module @kirkchinese/harness-forge
7
+ */
8
+ /**
9
+ * Start a delegated agent.
10
+ * @param subagents - DSH's `subagents` service.
11
+ */
12
+ export function startActivation(subagents, task, options) {
13
+ return subagents.startActivation({ ...options, ...task });
14
+ }
@@ -0,0 +1,271 @@
1
+ /**
2
+ * The contract between Harness Forge's rows. The `harness-forge` row owns the
3
+ * ledger and provides the shared service (`harnessForge`); every capability
4
+ * row (skills, commands, agents, hooks, MCP, mods, OpenCode) mounts its kind
5
+ * of component through a mounter it registers, and offers what other rows
6
+ * may ask of it as an optional API. A row that is off simply is not there:
7
+ * its components show as inactive and every lookup of it returns nothing.
8
+ *
9
+ * This module imports no row, so no row depends on another through it.
10
+ * @module @kirkchinese/harness-forge
11
+ */
12
+ import type { Context } from '@deepseek-ai/cordis';
13
+ import type { ComponentOutcome, ForeignComponent, ForeignPlugin, Gap, PlanAction } from '@kirkchinese/harness-forge-core';
14
+ import type { HookConfigSource } from '../hooks/config.js';
15
+ import type { RemoteMcpHost } from '../mcp/mount.js';
16
+ import type { OpenedSession } from '../sessions/persist.js';
17
+ /** What a row's start returns: its teardown. */
18
+ export type Disposer = () => unknown;
19
+ /**
20
+ * The kinds of mount, one per mounter. A planned action maps to one kind by
21
+ * its action and component (see `mountKindOf`).
22
+ */
23
+ export type MountKind = 'skill' | 'command' | 'output-style' | 'mcp' | 'hooks' | 'codex-notify' | 'codex-instructions' | 'agent' | 'claude-mod' | 'opencode-plugin' | 'settings';
24
+ /** The row that mounts each kind, as the workbench names it when that row is off. */
25
+ export declare const ROW_OF_KIND: Readonly<Record<MountKind, string>>;
26
+ /**
27
+ * Where a mount lives: process-wide (an installed plugin), or one session's
28
+ * project assets, in that session's agent context.
29
+ */
30
+ export interface MountScope {
31
+ /** The session's agent context; absent for a process-wide mount. */
32
+ readonly ctx?: Context;
33
+ /** Limits hooks and settings to this session and its delegated agents. */
34
+ readonly sessionId?: string;
35
+ }
36
+ /** One planned action to mount. */
37
+ export interface MountRequest {
38
+ readonly action: PlanAction;
39
+ readonly component: ForeignComponent;
40
+ readonly plugin: ForeignPlugin;
41
+ /** The plugin's writable data directory (`${CLAUDE_PLUGIN_DATA}`). */
42
+ readonly dataDir: string;
43
+ readonly scope: MountScope;
44
+ /**
45
+ * Command names of this apply, by component id: a command keeps its name
46
+ * across restarts, and names given here are taken.
47
+ */
48
+ readonly commandNames: Map<string, string>;
49
+ /** Every command name in use outside this plugin. */
50
+ takenNames(): Set<string>;
51
+ }
52
+ /** A mount's outcome: `mounted` at most (only a runtime observation upgrades it), and its withdrawal. */
53
+ export interface Mounted {
54
+ readonly outcome: ComponentOutcome;
55
+ readonly disposer?: () => Promise<void>;
56
+ }
57
+ /** Mounts one kind of component; registered by the row that owns the kind. */
58
+ export interface Mounter {
59
+ mount(request: MountRequest): Promise<Mounted>;
60
+ /** Every action of one apply in `scope` ran (the delegation tool restarts once, after all agents). */
61
+ settle?(scope: MountScope): Promise<void>;
62
+ /** A session's project scope ended: release what `mount` kept for it. */
63
+ release?(scope: MountScope): Promise<void>;
64
+ }
65
+ /** A hook configuration a skill's or agent's frontmatter declares, as the hooks row runs it. */
66
+ export type FrontmatterHooks = HookConfigSource;
67
+ /** A permission verdict as Claude Code's `tool.check` carries it. */
68
+ export interface ToolVerdict {
69
+ readonly decision: 'allow' | 'ask' | 'deny';
70
+ readonly reason?: string;
71
+ readonly rule?: string;
72
+ readonly hook?: string;
73
+ }
74
+ /** What the hooks row offers. */
75
+ export interface HooksApi {
76
+ /** A rewrite of a call's arguments (DSH vocabulary) the hooks and the tool see. */
77
+ rewrite(callId: string, args: Record<string, unknown>): void;
78
+ /** `UserPromptExpansion` for a skill the user typed. */
79
+ expandSkill(agent: unknown, skill: {
80
+ readonly name: string;
81
+ readonly foreignName: string;
82
+ readonly args: string;
83
+ readonly source: string;
84
+ }, signal: AbortSignal): Promise<{
85
+ blocked?: string;
86
+ context: string[];
87
+ }>;
88
+ /** `UserPromptSubmit` and `UserPromptExpansion` for an imported command the user typed. */
89
+ expandCommand(agent: unknown, command: {
90
+ readonly name: string;
91
+ readonly foreignName: string;
92
+ readonly args: string;
93
+ readonly expanded: string;
94
+ }, signal: AbortSignal): Promise<{
95
+ blocked?: string;
96
+ context: string[];
97
+ }>;
98
+ /** Add a hook source (a command's frontmatter hooks); returns its removal. */
99
+ add(source: FrontmatterHooks & {
100
+ readonly sessionId?: string;
101
+ readonly agentSessionId?: string;
102
+ }): () => void;
103
+ /** Mods' `tool.check` over the verdict the hooks reached; one checker at most. */
104
+ setChecker(checker: {
105
+ checks(exec: unknown): boolean;
106
+ check(exec: unknown, verdict: ToolVerdict): Promise<ToolVerdict>;
107
+ }): Disposer;
108
+ /** Variables another runtime adds to a shell call's environment (OpenCode's `shell.env`). */
109
+ addShellEnv(provider: (exec: unknown) => Promise<Record<string, string>>): Disposer;
110
+ }
111
+ /** What the skills row offers. */
112
+ export interface SkillsApi {
113
+ /** Hooks declared in an imported skill's frontmatter, by DSH skill name. */
114
+ skillHooks(name: string): FrontmatterHooks | undefined;
115
+ /** Re-scan the imported skills. */
116
+ reload(): void;
117
+ /** The configured skill roots and the directories of the mounted skills (only the mounted ones are served from those). */
118
+ roots(): readonly string[];
119
+ }
120
+ /** What the agents row offers. */
121
+ export interface AgentsApi {
122
+ /** The foreign name (`plugin:agent`) of an imported agent preset. */
123
+ foreignName(presetId: string): string | undefined;
124
+ /** The DSH preset of a foreign agent name. */
125
+ presetOf(foreignName: string): string | undefined;
126
+ /** Hooks declared in an imported agent's frontmatter, by preset id. */
127
+ agentHooks(presetId: string): FrontmatterHooks | undefined;
128
+ }
129
+ /** A command an imported plugin's code added (OpenCode's `config` hook). */
130
+ export interface ForeignCommand {
131
+ readonly component: ForeignComponent;
132
+ readonly name: string;
133
+ readonly foreignName: string;
134
+ readonly pluginId: string;
135
+ readonly pluginRoot: string;
136
+ readonly dataDir: string;
137
+ }
138
+ /** What the commands row offers. */
139
+ export interface CommandsApi {
140
+ /** Register an added command under a free name; returns the name and the removal. */
141
+ registerAdded(command: ForeignCommand, scope: MountScope, takenNames: Set<string>): {
142
+ readonly name: string;
143
+ readonly dispose: () => void;
144
+ } | undefined;
145
+ /** OpenCode's `command.execute.before` for imported OpenCode commands; one provider at most. */
146
+ setBeforeSubmit(hook: (agent: unknown, command: {
147
+ name: string;
148
+ args: string;
149
+ }, prompt: string) => Promise<string[] | {
150
+ stopped: string;
151
+ }>): Disposer;
152
+ }
153
+ /** What the MCP row offers. */
154
+ export interface McpApi {
155
+ /** Remote MCP servers that wait for the user to sign in: those a session sees (its project's and process-wide ones), or all. */
156
+ pendingSignIns(sessionId?: string): string[];
157
+ /**
158
+ * Start one server's sign-in in the background; returns the page to sign in on. With a session, its own
159
+ * project server of that name is preferred to the process-wide one.
160
+ */
161
+ startSignIn(serverName: string, sessionId?: string): string;
162
+ /** The remote-MCP host a component's servers use: its sign-in state becomes the component's evidence. */
163
+ remoteHost(componentId: string, scope?: MountScope): RemoteMcpHost;
164
+ /**
165
+ * A server's own filters and approval modes for one call (`mcp__<server>__<tool>`, or `capability_call` with
166
+ * `mcp:<server>/<tool>`): `deny` for a tool filtered out, `ask` for one that needs approval, undefined otherwise.
167
+ * The one decision the row's pre-execute check and hook-initiated calls both use.
168
+ */
169
+ toolPolicy(call: McpToolCall): McpToolVerdict | undefined;
170
+ /**
171
+ * The registered name of the server an `mcp_tool` hook of plugin `pluginId` names: among that plugin's own
172
+ * servers by the name it declared them under (`plugin:<plugin>:<server>`: among that plugin's), else among the
173
+ * user's own servers (config.toml, the user `.mcp.json`); the session's own first. Undefined when none is mounted.
174
+ */
175
+ hookServer(pluginId: string, server: string, sessionId?: string): string | undefined;
176
+ }
177
+ /** A tool call as the MCP tool policy reads it. */
178
+ export interface McpToolCall {
179
+ readonly name: string;
180
+ readonly arguments?: unknown;
181
+ readonly agent?: unknown;
182
+ }
183
+ /** What a server's tool policy says about one call. */
184
+ export interface McpToolVerdict {
185
+ readonly kind: 'deny' | 'ask';
186
+ readonly reason: string;
187
+ }
188
+ /** What the mods row offers. */
189
+ export interface ModsApi {
190
+ watch(sessionId: string, listener: (snapshot: unknown) => void): (() => void) | undefined;
191
+ act(sessionId: string, generation: number, actionId: string, value?: unknown): Promise<unknown>;
192
+ closePane(sessionId: string, id: string): Promise<unknown>;
193
+ move(sessionId: string, kind: 'focus' | 'scroll', target: Readonly<Record<string, unknown>>): Promise<unknown>;
194
+ }
195
+ /** A harness whose sessions can be imported. */
196
+ export type SessionSource = 'claude-code' | 'codex' | 'opencode';
197
+ /** Sessions per page when the caller names no limit. */
198
+ export declare const SESSION_PAGE_SIZE = 50;
199
+ /** Which page of a harness's sessions to read: `cursor` is the `next` of the previous page. */
200
+ export interface SessionPageRequest {
201
+ readonly cursor?: number;
202
+ readonly limit?: number;
203
+ }
204
+ /** One page of sessions, newest first; `next` is the cursor of the following page, absent on the last. */
205
+ export interface SessionPage<T = unknown> {
206
+ readonly sessions: readonly T[];
207
+ readonly next?: number;
208
+ }
209
+ /** What the sessions row offers. */
210
+ export interface SessionsApi {
211
+ /** One page of the sessions of one harness available for import, newest first; each says which DSH session already holds it (`importedId`). */
212
+ sessions(root: string | undefined, source: SessionSource, page?: SessionPageRequest): Promise<SessionPage>;
213
+ /** Import one session into DSH. */
214
+ importSession(path: string, targetId: string | undefined, source: SessionSource, sourceId: string | undefined): Promise<unknown>;
215
+ /** Open a session an import stored: known to DSH again (workspace, live) and out of its archive. */
216
+ open(id: string): Promise<OpenedSession>;
217
+ }
218
+ /** What the instruction files of a workspace are, for the workbench. */
219
+ export interface ContextStatus {
220
+ /** Whether Harness Forge adds instruction files: false while the row is off or yielding. */
221
+ readonly active: boolean;
222
+ /** The plugin that owns instruction injection instead, when it runs. */
223
+ readonly yieldingTo?: string;
224
+ /** The files Harness Forge adds. */
225
+ readonly files: readonly {
226
+ readonly path: string;
227
+ readonly bytes: number;
228
+ }[];
229
+ /** The files DSH injects itself (`CLAUDE.md`, `CLAUDE.local.md`); only their imports come from here. */
230
+ readonly hostFiles?: readonly {
231
+ readonly path: string;
232
+ readonly bytes: number;
233
+ }[];
234
+ /** Set when reading stopped at a limit: why, and where. */
235
+ readonly stopped?: string;
236
+ }
237
+ /** What the context row offers. */
238
+ export interface ContextApi {
239
+ /** The instruction files of a workspace; the default workspace without `cwd`. */
240
+ status(cwd?: string): ContextStatus;
241
+ }
242
+ /** What the porter row offers: a gap described as a brief, handed to DSH's creation mode. */
243
+ export interface PorterApi {
244
+ /** The brief for one part of a plugin, as Markdown. */
245
+ brief(plugin: ForeignPlugin, gaps: readonly Gap[], componentId: string): string;
246
+ /** The first message of its port session: the working protocol, then the brief; `language` is the user's interface language. */
247
+ task(plugin: ForeignPlugin, gaps: readonly Gap[], componentId: string, language?: string): string;
248
+ /** Start a creation-mode session working on the part's task, and record it as the part's port session. */
249
+ port(plugin: ForeignPlugin, gaps: readonly Gap[], componentId: string, location: {
250
+ readonly workspaceId?: string;
251
+ readonly cwd?: string;
252
+ }, language?: string): Promise<{
253
+ readonly sessionId: string;
254
+ }>;
255
+ }
256
+ /** The optional APIs, by row. */
257
+ export interface RowApis {
258
+ context: ContextApi;
259
+ hooks: HooksApi;
260
+ skills: SkillsApi;
261
+ agents: AgentsApi;
262
+ commands: CommandsApi;
263
+ mcp: McpApi;
264
+ mods: ModsApi;
265
+ sessions: SessionsApi;
266
+ porter: PorterApi;
267
+ }
268
+ /** A plugin component's planned action, as the kind of mount it needs; `undefined` when DSH has nothing for it. */
269
+ export declare function mountKindOf(action: PlanAction, component: ForeignComponent): MountKind | {
270
+ readonly skipped: string;
271
+ };
@@ -0,0 +1,45 @@
1
+ /** The row that mounts each kind, as the workbench names it when that row is off. */
2
+ export const ROW_OF_KIND = {
3
+ 'skill': 'skills',
4
+ 'command': 'commands',
5
+ 'output-style': 'commands',
6
+ 'mcp': 'mcp',
7
+ 'hooks': 'hooks',
8
+ 'codex-notify': 'hooks',
9
+ 'codex-instructions': 'hooks',
10
+ 'agent': 'agents',
11
+ 'claude-mod': 'mods',
12
+ 'opencode-plugin': 'opencode',
13
+ 'settings': 'harness-forge',
14
+ };
15
+ /** Sessions per page when the caller names no limit. */
16
+ export const SESSION_PAGE_SIZE = 50;
17
+ /** A plugin component's planned action, as the kind of mount it needs; `undefined` when DSH has nothing for it. */
18
+ export function mountKindOf(action, component) {
19
+ switch (action.kind) {
20
+ case 'link-skill-root': return 'skill';
21
+ case 'register-command': return 'command';
22
+ case 'mount-mcp': return component.kind === 'mcp' && component.notStarted !== undefined ? { skipped: component.notStarted.detail } : 'mcp';
23
+ case 'mount-hooks': return 'hooks';
24
+ case 'register-agent': return 'agent';
25
+ case 'apply-settings': return 'settings';
26
+ case 'report-ui':
27
+ return component.kind === 'ui' && component.surface === 'output-style' && component.specPath !== undefined
28
+ ? 'output-style'
29
+ : { skipped: 'UI surface has no DSH adapter yet' };
30
+ case 'report-code':
31
+ if (component.kind === 'other' && component.originalKind === 'codex-notify')
32
+ return 'codex-notify';
33
+ if (component.kind === 'other' && component.originalKind === 'codex-instructions' && component.path !== undefined)
34
+ return 'codex-instructions';
35
+ if (component.kind === 'other')
36
+ return { skipped: `${component.originalKind} is not mapped to DSH` };
37
+ if (component.kind === 'code' && component.runtime === 'claude-mod')
38
+ return 'claude-mod';
39
+ if (component.kind === 'code' && component.runtime === 'opencode-plugin')
40
+ return 'opencode-plugin';
41
+ return { skipped: component.kind === 'code' ? `no runtime for ${component.runtime}` : `unsupported action ${action.kind} for ${component.kind}` };
42
+ default:
43
+ return { skipped: `unsupported action ${String(action.kind)}` };
44
+ }
45
+ }
@@ -0,0 +1,30 @@
1
+ import { type HarnessInstalls } from '@kirkchinese/harness-forge-core';
2
+ import type { DetachedReason, HarnessInstallRecord, InstalledPluginRecord } from './state.js';
3
+ /** What following a plugin's harness asks of it now. */
4
+ export type Following =
5
+ /** No harness install to follow, or its harness cannot tell. */
6
+ {
7
+ readonly kind: 'none';
8
+ }
9
+ /** The harness runs it from the recorded folder; `identity` is the install as seen now. */
10
+ | {
11
+ readonly kind: 'current';
12
+ readonly identity: HarnessInstallRecord;
13
+ }
14
+ /** The harness updated it into another folder. */
15
+ | {
16
+ readonly kind: 'moved';
17
+ readonly identity: HarnessInstallRecord;
18
+ readonly root: string;
19
+ } | {
20
+ readonly kind: 'detached';
21
+ readonly reason: DetachedReason;
22
+ };
23
+ /** What the person's record says it follows, learnt from its folder when the record predates install keys. */
24
+ export declare function withHarnessInstall(record: InstalledPluginRecord, current: HarnessInstalls, home?: string): InstalledPluginRecord;
25
+ /** The harness install a plugin newly migrated from `root` follows: only one its harness lists there. */
26
+ export declare function newHarnessInstall(root: string, name: string, source: string, current: HarnessInstalls, home?: string): HarnessInstallRecord | undefined;
27
+ /** What following the record's harness install asks of it (see the module table). */
28
+ export declare function followingOf(record: InstalledPluginRecord, current: HarnessInstalls): Following;
29
+ /** Whether following asks anything of the record: a move, a new detachment, or a detachment or identity to clear. */
30
+ export declare function followingChanges(record: InstalledPluginRecord, following: Following): boolean;
@@ -0,0 +1,73 @@
1
+ /**
2
+ * How a migrated plugin follows the harness that installed it. Claude Code
3
+ * and Codex put each version of a plugin in a folder of its own and may delete
4
+ * the old one; the ledger records the folder it migrated. Its harness install
5
+ * (`HarnessInstallRecord`) is matched against what the harness lists now:
6
+ *
7
+ * | The harness lists it | Then |
8
+ * | --- | --- |
9
+ * | at the same folder | nothing to do (a plugin that was detached is applied again) |
10
+ * | at another folder | the plugin moves there, keeping the parts the person switched off |
11
+ * | not at all, or switched off | detached: nothing of it runs until the person removes or keeps it |
12
+ *
13
+ * A harness whose record cannot be read in full (malformed, or cut off while
14
+ * the harness writes it) proves nothing by leaving a plugin out, nor does one
15
+ * that records the plugin at a folder that is not there: nothing changes, and
16
+ * the next read decides.
17
+ * @module @kirkchinese/harness-forge
18
+ */
19
+ import { resolve } from 'node:path';
20
+ import { identifyHarnessInstall } from '@kirkchinese/harness-forge-core';
21
+ /** What the person's record says it follows, learnt from its folder when the record predates install keys. */
22
+ export function withHarnessInstall(record, current, home) {
23
+ if (record.harnessInstall !== undefined || record.keptAt !== undefined)
24
+ return record;
25
+ const identity = identifyHarnessInstall(record.root, record.displayName ?? record.name, current, home);
26
+ return identity === undefined ? record : { ...record, harnessInstall: identity };
27
+ }
28
+ /** The harness install a plugin newly migrated from `root` follows: only one its harness lists there. */
29
+ export function newHarnessInstall(root, name, source, current, home) {
30
+ const identity = identifyHarnessInstall(root, name, current, home);
31
+ if (identity === undefined || identity.inferred === true || identity.harness !== source)
32
+ return undefined;
33
+ const install = current.installs.find(item => item.harness === identity.harness && item.key === identity.key);
34
+ // Migrated while off in its harness: the person chose it, so the harness switching it off does not stop it.
35
+ return { harness: identity.harness, key: identity.key, ...(install?.enabled === false ? { enabled: false } : {}) };
36
+ }
37
+ /** What following the record's harness install asks of it (see the module table). */
38
+ export function followingOf(record, current) {
39
+ const identity = record.harnessInstall;
40
+ if (identity === undefined || record.keptAt !== undefined)
41
+ return { kind: 'none' };
42
+ const install = current.installs.find(item => item.harness === identity.harness && item.key === identity.key);
43
+ if (install === undefined) {
44
+ // Absent only proves it is gone from a complete read, and from it entirely: not one whose files are missing now.
45
+ if (current.uncertain.has(identity.harness))
46
+ return { kind: 'none' };
47
+ if (current.unresolved.some(item => item.harness === identity.harness && item.key === identity.key))
48
+ return { kind: 'none' };
49
+ return { kind: 'detached', reason: identity.inferred === true ? 'never-installed' : 'uninstalled' };
50
+ }
51
+ // An earlier Harness Forge read this harness's install through another dialect: it is not the plugin the harness runs.
52
+ if (record.source !== identity.harness)
53
+ return { kind: 'detached', reason: 'misread' };
54
+ if (install.enabled === false && identity.enabled !== false)
55
+ return { kind: 'detached', reason: 'switched-off' };
56
+ const seen = { harness: identity.harness, key: identity.key, ...(install.enabled === false ? { enabled: false } : {}) };
57
+ return samePath(install.root, record.root) ? { kind: 'current', identity: seen } : { kind: 'moved', identity: seen, root: install.root };
58
+ }
59
+ /** Whether following asks anything of the record: a move, a new detachment, or a detachment or identity to clear. */
60
+ export function followingChanges(record, following) {
61
+ switch (following.kind) {
62
+ case 'none': return false;
63
+ case 'moved': return true;
64
+ case 'detached': return record.detached?.reason !== following.reason;
65
+ case 'current': return record.detached !== undefined || !sameIdentity(record.harnessInstall, following.identity);
66
+ }
67
+ }
68
+ function sameIdentity(a, b) {
69
+ return a !== undefined && a.harness === b.harness && a.key === b.key && a.inferred === b.inferred && a.enabled === b.enabled;
70
+ }
71
+ function samePath(a, b) {
72
+ return process.platform === 'win32' ? resolve(a).toLowerCase() === resolve(b).toLowerCase() : resolve(a) === resolve(b);
73
+ }
@@ -0,0 +1,206 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import { type CompatibilityVector, type ComponentOutcome, type ForeignPlugin, type Observation, type Plan, type Receipt } from '@kirkchinese/harness-forge-core';
3
+ import { type MountKind, type Mounter } from './contract.js';
4
+ import { LiveMounts } from './live-mounts.js';
5
+ import { type InstalledPluginRecord, type MountRecord } from './state.js';
6
+ /** One MCP mount outcome. */
7
+ export interface McpReport {
8
+ readonly name: string;
9
+ readonly status: 'mounted' | 'failed';
10
+ readonly error?: string;
11
+ }
12
+ /** One hooks mount outcome. */
13
+ export interface HookReport {
14
+ readonly name: string;
15
+ readonly dialect: 'claude-code' | 'codex';
16
+ readonly status: 'mounted' | 'failed';
17
+ readonly error?: string;
18
+ }
19
+ /** One agent preset outcome. */
20
+ export interface AgentReport {
21
+ readonly name: string;
22
+ readonly presetId: string;
23
+ readonly status: 'mounted' | 'failed';
24
+ readonly error?: string;
25
+ }
26
+ /** Result of one apply. */
27
+ export interface ApplyResult {
28
+ readonly plugin: ForeignPlugin;
29
+ readonly compat: CompatibilityVector;
30
+ readonly receipt: Receipt;
31
+ readonly outcomes: readonly ComponentOutcome[];
32
+ readonly alreadyInstalled: boolean;
33
+ }
34
+ /** Result of installing one plugin (plan + apply). */
35
+ export interface InstallReport extends ApplyResult {
36
+ readonly skillRoots: readonly string[];
37
+ readonly commands: readonly string[];
38
+ readonly mcp: readonly McpReport[];
39
+ readonly hooks: readonly HookReport[];
40
+ readonly agents: readonly AgentReport[];
41
+ }
42
+ /** One live installation and its live registrations, by plan action. */
43
+ export interface LiveInstall {
44
+ record: InstalledPluginRecord;
45
+ readonly mounts: LiveMounts;
46
+ readonly outcomes: Map<string, ComponentOutcome>;
47
+ plan?: Plan;
48
+ /** A first install that failed but left registrations live: listed, never written, withdrawn on removal or the next install. */
49
+ readonly unrecorded?: true;
50
+ }
51
+ /** The outcome of a component whose row is off. */
52
+ export declare function inactive(componentId: string, kind: MountKind): ComponentOutcome;
53
+ /** What an outcome's message says when the person switched the component off. */
54
+ export declare const SWITCHED_OFF = "switched off";
55
+ /** The outcome of a component the person switched off. */
56
+ export declare function switchedOff(componentId: string): ComponentOutcome;
57
+ /** The outcome of a component whose withdrawal failed: it stays live, and switching it off again retries. */
58
+ export declare function failedToSwitchOff(componentId: string, reason: string): ComponentOutcome;
59
+ /** The outcome of a component a failed install could not withdraw: it stays live until removing the plugin (or installing it again) withdraws it. */
60
+ export declare function failedToCleanUp(componentId: string, reason: string): ComponentOutcome;
61
+ /** What an outcome's message says when the plugin's harness no longer runs it (see `follow.ts`). */
62
+ export declare const NOT_FOLLOWED = "not run: its harness no longer runs this plugin";
63
+ /** The outcome of a component of a detached plugin: off until the person removes or keeps the plugin. */
64
+ export declare function notFollowed(componentId: string): ComponentOutcome;
65
+ /** How far applying the ledger's records has got: every record at startup, those a harness changed later. */
66
+ export interface ApplyProgress {
67
+ readonly done: number;
68
+ readonly total: number;
69
+ }
70
+ /**
71
+ * The installations: the in-memory registry, plan application, undo and
72
+ * teardown, runtime evidence and the durable ledger, every mutation through
73
+ * one queue.
74
+ */
75
+ export declare class Ledger {
76
+ readonly ctx: Context;
77
+ readonly statePath: string;
78
+ readonly dataRoot: string;
79
+ /** Where a withdrawal that failed, or a ledger read only in part, is recorded (the shared service's faults). */
80
+ private readonly fault?;
81
+ readonly live: Map<string, LiveInstall>;
82
+ readonly plans: Map<string, Plan>;
83
+ readonly mounters: Map<MountKind, Mounter>;
84
+ disposed: boolean;
85
+ queue: Promise<unknown>;
86
+ persistTimer: NodeJS.Timeout | undefined;
87
+ /** Records being applied (restored at startup, or followed to their harness's change) and how many are done. */
88
+ private progress;
89
+ /** The last unreadable-record problem reported per harness, so each is said once, not at every page load. */
90
+ private readonly unreadReported;
91
+ /** The follow pass queued and not yet run: another request joins it instead of queueing its own. */
92
+ private following;
93
+ /** Why the ledger may not be written (unreadable at startup, or a newer Harness Forge's); while set, it never is. */
94
+ private writeRefusal;
95
+ constructor(ctx: Context, statePath: string, dataRoot: string,
96
+ /** Where a withdrawal that failed, or a ledger read only in part, is recorded (the shared service's faults). */
97
+ fault?: ((error: unknown) => void) | undefined);
98
+ private readonly faultOf;
99
+ /**
100
+ * Register the mounter of one kind: components of that kind waiting as
101
+ * inactive mount now. The disposer withdraws them back to inactive.
102
+ */
103
+ registerMounter(kind: MountKind, mounter: Mounter): () => void;
104
+ /**
105
+ * Re-apply installed plans; only actions without a live registration run.
106
+ * Called when a mounter appears: with its kind, only that kind's actions
107
+ * mount, so a part that failed (a server that cannot start) is tried again
108
+ * when its own row comes back, not once for every row that starts at boot.
109
+ */
110
+ reapply(kind?: MountKind): void;
111
+ /**
112
+ * Withdraw every mount of one kind (its row went away): those components
113
+ * wait as inactive. The live registrations say what to withdraw, so a source
114
+ * that no longer scans is withdrawn as well.
115
+ */
116
+ private withdraw;
117
+ /** The plugin as its source scans now, or undefined when it no longer does. */
118
+ private tryScan;
119
+ /**
120
+ * The record's derived fields after its outcomes changed. Without the
121
+ * scanned plugin (its source is gone) only the outcomes are updated.
122
+ */
123
+ private refreshRecord;
124
+ /** Scan one plugin without writing anything. */
125
+ scan(root: string, source?: string): ForeignPlugin;
126
+ /** List current installations in stable name order. */
127
+ list(): readonly InstalledPluginRecord[];
128
+ exclusive<T>(operation: () => Promise<T>): Promise<T>;
129
+ restoreNow(): Promise<void>;
130
+ /** Restore one record, following its harness: to the folder of a new version, or detached when no longer run. */
131
+ private restoreRecord;
132
+ /** Keep a record that could not be restored visible, with the reason. */
133
+ private keepUnrestored;
134
+ /** Keep a record its harness no longer runs listed, nothing of it mounted. */
135
+ private keepDetached;
136
+ /** Detach a live plugin its harness no longer runs: its registrations are withdrawn, the record kept. */
137
+ private detachNow;
138
+ /**
139
+ * Move a followed plugin to the folder its harness now runs (an update), as Get plugins' Update moves a fetched
140
+ * one (see {@link rerootNow}): the parts the person switched off stay off, and the move is noted on the record.
141
+ */
142
+ private moveNow;
143
+ /**
144
+ * Follow every harness's changes since the last pass (see `follow.ts`). Queued behind the ledger's other work;
145
+ * nothing is queued when no record needs anything, and a pass already waiting is joined. Settles when it has run.
146
+ */
147
+ follow(): Promise<void>;
148
+ /**
149
+ * What every harness has installed now. A harness whose record could not be read in full, while plugins migrated
150
+ * from it follow it, is reported once per distinct problem: nothing of those plugins changes until it reads whole.
151
+ */
152
+ private readHarnesses;
153
+ /** Follow one live plugin's harness install. */
154
+ private followOne;
155
+ /**
156
+ * Keep a plugin its harness no longer runs as the person's own copy, in the folder it is in: it follows no harness
157
+ * any more and its parts mount again.
158
+ */
159
+ keepNow(id: string): Promise<ApplyResult>;
160
+ /** How far applying records has got, while any are still being applied. */
161
+ applying(): ApplyProgress | undefined;
162
+ private begin;
163
+ private step;
164
+ planNow(root: string, source?: string): Plan;
165
+ /**
166
+ * Apply a plan: every action without a live registration mounts.
167
+ * @param only - mount only this kind's actions; the others keep their outcome.
168
+ */
169
+ applyNow(plan: Plan, only?: MountKind): Promise<ApplyResult>;
170
+ undoNow(receiptId: string): Promise<boolean>;
171
+ /**
172
+ * Switch one component of an installed plugin off (its registrations are
173
+ * released and it stays off across restarts) or on again (it mounts as at
174
+ * install). Returns whether anything changed.
175
+ */
176
+ setEnabledNow(pluginId: string, componentId: string, enabled: boolean): Promise<boolean>;
177
+ /**
178
+ * Move an installed plugin to a new copy of its source (an update fetched
179
+ * into a directory of its own): its registrations are withdrawn and the new
180
+ * copy applied under the same id, keeping the parts the person switched off,
181
+ * its install time and its receipts. When the new copy does not apply, the
182
+ * old one is applied again and the failure is thrown.
183
+ */
184
+ rerootNow(id: string, root: string, source?: string): Promise<ApplyResult>;
185
+ /** Release one installation without deciding whether the ledger survives. */
186
+ teardown(id: string): Promise<boolean>;
187
+ /** Record one runtime observation; the component's status follows its evidence. */
188
+ observe(componentId: string, observation: Observation | {
189
+ readonly clear: string;
190
+ }): void;
191
+ scanRoot(root: string, source?: string): ForeignPlugin;
192
+ private buildRecord;
193
+ /** What a record follows: kept from its earlier record, else the harness install it was migrated from, if any. */
194
+ private followed;
195
+ report(result: ApplyResult): InstallReport;
196
+ allCommandNames(excludePluginId?: string): Set<string>;
197
+ private assertAlive;
198
+ private persistSoon;
199
+ /** Write the ledger, or try again shortly when the write fails transiently. */
200
+ persist(): void;
201
+ private writeLedger;
202
+ }
203
+ /** The directory a skill provider root must contain for this skill body. */
204
+ export declare function skillRootOf(bodyPath: string): string;
205
+ /** Project the current component outcomes into the workbench mount list. */
206
+ export declare function mountsFor(plugin: ForeignPlugin, outcomes: ReadonlyMap<string, ComponentOutcome>): MountRecord[];