@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.
- package/LICENSE +21 -0
- package/README.md +46 -2
- package/assets/icon.svg +12 -0
- package/cordis.patch.yml +28 -0
- package/docs/DETAIL.zh.md +47 -0
- package/lib/agents/presets.d.ts +98 -0
- package/lib/agents/presets.js +292 -0
- package/lib/agents/profiles.d.ts +58 -0
- package/lib/agents/profiles.js +279 -0
- package/lib/agents/row.d.ts +17 -0
- package/lib/agents/row.js +148 -0
- package/lib/client/paths.d.ts +12 -0
- package/lib/client/paths.js +68 -0
- package/lib/client/styles.d.ts +8 -0
- package/lib/client/styles.js +89 -0
- package/lib/client/typert.d.ts +25 -0
- package/lib/client/typert.js +158 -0
- package/lib/client.js +23823 -0
- package/lib/commands/definition.d.ts +40 -0
- package/lib/commands/definition.js +113 -0
- package/lib/commands/output-styles.d.ts +42 -0
- package/lib/commands/output-styles.js +152 -0
- package/lib/commands/row.d.ts +9 -0
- package/lib/commands/row.js +157 -0
- package/lib/context/instructions.d.ts +32 -0
- package/lib/context/instructions.js +88 -0
- package/lib/context/row.d.ts +16 -0
- package/lib/context/row.js +17 -0
- package/lib/dsh/commands.d.ts +30 -0
- package/lib/dsh/commands.js +61 -0
- package/lib/dsh/host.d.ts +110 -0
- package/lib/dsh/host.js +217 -0
- package/lib/dsh/model-route.d.ts +21 -0
- package/lib/dsh/model-route.js +37 -0
- package/lib/dsh/session-records.d.ts +78 -0
- package/lib/dsh/session-records.js +36 -0
- package/lib/dsh/subagents.d.ts +46 -0
- package/lib/dsh/subagents.js +14 -0
- package/lib/forge/contract.d.ts +271 -0
- package/lib/forge/contract.js +45 -0
- package/lib/forge/follow.d.ts +30 -0
- package/lib/forge/follow.js +73 -0
- package/lib/forge/ledger.d.ts +206 -0
- package/lib/forge/ledger.js +1005 -0
- package/lib/forge/live-mounts.d.ts +45 -0
- package/lib/forge/live-mounts.js +78 -0
- package/lib/forge/npm.d.ts +31 -0
- package/lib/forge/npm.js +60 -0
- package/lib/forge/projects.d.ts +97 -0
- package/lib/forge/projects.js +343 -0
- package/lib/forge/receipts.d.ts +5 -0
- package/lib/forge/receipts.js +31 -0
- package/lib/forge/remote/archive.d.ts +65 -0
- package/lib/forge/remote/archive.js +565 -0
- package/lib/forge/remote/code-parts.d.ts +18 -0
- package/lib/forge/remote/code-parts.js +76 -0
- package/lib/forge/remote/fetch.d.ts +265 -0
- package/lib/forge/remote/fetch.js +1133 -0
- package/lib/forge/remote/service.d.ts +256 -0
- package/lib/forge/remote/service.js +868 -0
- package/lib/forge/row.d.ts +32 -0
- package/lib/forge/row.js +59 -0
- package/lib/forge/service.d.ts +115 -0
- package/lib/forge/service.js +290 -0
- package/lib/forge/settings.d.ts +43 -0
- package/lib/forge/settings.js +122 -0
- package/lib/forge/state.d.ts +129 -0
- package/lib/forge/state.js +266 -0
- package/lib/forge/trust.d.ts +48 -0
- package/lib/forge/trust.js +107 -0
- package/lib/forge/turns.d.ts +13 -0
- package/lib/forge/turns.js +56 -0
- package/lib/hooks/broker/engine.d.ts +112 -0
- package/lib/hooks/broker/engine.js +722 -0
- package/lib/hooks/broker/helpers.d.ts +10 -0
- package/lib/hooks/broker/helpers.js +22 -0
- package/lib/hooks/broker/lifecycle.d.ts +65 -0
- package/lib/hooks/broker/lifecycle.js +342 -0
- package/lib/hooks/broker/session-events.d.ts +27 -0
- package/lib/hooks/broker/session-events.js +205 -0
- package/lib/hooks/broker/tools.d.ts +52 -0
- package/lib/hooks/broker/tools.js +424 -0
- package/lib/hooks/broker/types.d.ts +264 -0
- package/lib/hooks/broker/types.js +1 -0
- package/lib/hooks/broker.d.ts +80 -0
- package/lib/hooks/broker.js +95 -0
- package/lib/hooks/codex-user.d.ts +5 -0
- package/lib/hooks/codex-user.js +109 -0
- package/lib/hooks/condition.d.ts +87 -0
- package/lib/hooks/condition.js +602 -0
- package/lib/hooks/config.d.ts +85 -0
- package/lib/hooks/config.js +154 -0
- package/lib/hooks/glob.d.ts +41 -0
- package/lib/hooks/glob.js +114 -0
- package/lib/hooks/matcher.d.ts +20 -0
- package/lib/hooks/matcher.js +39 -0
- package/lib/hooks/notice.d.ts +17 -0
- package/lib/hooks/notice.js +39 -0
- package/lib/hooks/output.d.ts +56 -0
- package/lib/hooks/output.js +214 -0
- package/lib/hooks/permissions.d.ts +19 -0
- package/lib/hooks/permissions.js +202 -0
- package/lib/hooks/powershell-aliases.d.ts +19 -0
- package/lib/hooks/powershell-aliases.js +58 -0
- package/lib/hooks/process.d.ts +64 -0
- package/lib/hooks/process.js +289 -0
- package/lib/hooks/row.d.ts +17 -0
- package/lib/hooks/row.js +96 -0
- package/lib/hooks/runner.d.ts +98 -0
- package/lib/hooks/runner.js +322 -0
- package/lib/hooks/shell-commands.d.ts +28 -0
- package/lib/hooks/shell-commands.js +241 -0
- package/lib/hooks/shell.d.ts +44 -0
- package/lib/hooks/shell.js +129 -0
- package/lib/hooks/transcript.d.ts +28 -0
- package/lib/hooks/transcript.js +141 -0
- package/lib/hooks/vocabulary.d.ts +57 -0
- package/lib/hooks/vocabulary.js +366 -0
- package/lib/index.d.ts +31 -0
- package/lib/index.js +287 -0
- package/lib/mcp/auth.d.ts +35 -0
- package/lib/mcp/auth.js +178 -0
- package/lib/mcp/catalog.d.ts +39 -0
- package/lib/mcp/catalog.js +69 -0
- package/lib/mcp/mount.d.ts +113 -0
- package/lib/mcp/mount.js +317 -0
- package/lib/mcp/policy.d.ts +42 -0
- package/lib/mcp/policy.js +43 -0
- package/lib/mcp/remote.d.ts +45 -0
- package/lib/mcp/remote.js +133 -0
- package/lib/mcp/row.d.ts +9 -0
- package/lib/mcp/row.js +225 -0
- package/lib/mods/bundler.d.ts +38 -0
- package/lib/mods/bundler.js +157 -0
- package/lib/mods/chain.d.ts +103 -0
- package/lib/mods/chain.js +436 -0
- package/lib/mods/claude.d.ts +27 -0
- package/lib/mods/claude.js +56 -0
- package/lib/mods/engine.d.ts +160 -0
- package/lib/mods/engine.js +701 -0
- package/lib/mods/expect.d.ts +8 -0
- package/lib/mods/expect.js +248 -0
- package/lib/mods/host.d.ts +105 -0
- package/lib/mods/host.js +462 -0
- package/lib/mods/loader.d.ts +53 -0
- package/lib/mods/loader.js +231 -0
- package/lib/mods/ops.d.ts +13 -0
- package/lib/mods/ops.js +117 -0
- package/lib/mods/row.d.ts +9 -0
- package/lib/mods/row.js +77 -0
- package/lib/mods/runtime.d.ts +60 -0
- package/lib/mods/runtime.js +133 -0
- package/lib/mods/service/commands.d.ts +17 -0
- package/lib/mods/service/commands.js +121 -0
- package/lib/mods/service/drawings.d.ts +36 -0
- package/lib/mods/service/drawings.js +64 -0
- package/lib/mods/service/sessions.d.ts +63 -0
- package/lib/mods/service/sessions.js +345 -0
- package/lib/mods/service/tools.d.ts +32 -0
- package/lib/mods/service/tools.js +253 -0
- package/lib/mods/service/turns.d.ts +33 -0
- package/lib/mods/service/turns.js +136 -0
- package/lib/mods/service/types.d.ts +151 -0
- package/lib/mods/service/types.js +1 -0
- package/lib/mods/service.d.ts +72 -0
- package/lib/mods/service.js +104 -0
- package/lib/mods/surfaces.d.ts +93 -0
- package/lib/mods/surfaces.js +309 -0
- package/lib/mods/values.d.ts +30 -0
- package/lib/mods/values.js +95 -0
- package/lib/opencode/bun.d.ts +40 -0
- package/lib/opencode/bun.js +168 -0
- package/lib/opencode/convert.d.ts +53 -0
- package/lib/opencode/convert.js +255 -0
- package/lib/opencode/row.d.ts +22 -0
- package/lib/opencode/row.js +104 -0
- package/lib/opencode/runtime/core.d.ts +74 -0
- package/lib/opencode/runtime/core.js +249 -0
- package/lib/opencode/runtime/events.d.ts +80 -0
- package/lib/opencode/runtime/events.js +281 -0
- package/lib/opencode/runtime/mount.d.ts +27 -0
- package/lib/opencode/runtime/mount.js +283 -0
- package/lib/opencode/runtime/server.d.ts +27 -0
- package/lib/opencode/runtime/server.js +354 -0
- package/lib/opencode/runtime/types.d.ts +109 -0
- package/lib/opencode/runtime/types.js +1 -0
- package/lib/opencode/runtime.d.ts +55 -0
- package/lib/opencode/runtime.js +79 -0
- package/lib/porting/adapter-paths.d.ts +13 -0
- package/lib/porting/adapter-paths.js +120 -0
- package/lib/porting/port-gap.d.ts +36 -0
- package/lib/porting/port-gap.js +158 -0
- package/lib/porting/port-sessions.d.ts +41 -0
- package/lib/porting/port-sessions.js +98 -0
- package/lib/porting/prompt.d.ts +23 -0
- package/lib/porting/prompt.js +51 -0
- package/lib/porting/row.d.ts +16 -0
- package/lib/porting/row.js +27 -0
- package/lib/porting/verify-port.d.ts +46 -0
- package/lib/porting/verify-port.js +82 -0
- package/lib/presets/fs-search.d.ts +25 -0
- package/lib/presets/fs-search.js +17 -0
- package/lib/presets/tool-filter.d.ts +35 -0
- package/lib/presets/tool-filter.js +91 -0
- package/lib/sessions/chat-import.d.ts +48 -0
- package/lib/sessions/chat-import.js +44 -0
- package/lib/sessions/claude.d.ts +35 -0
- package/lib/sessions/claude.js +104 -0
- package/lib/sessions/codex-discover.d.ts +34 -0
- package/lib/sessions/codex-discover.js +205 -0
- package/lib/sessions/codex-meta.d.ts +63 -0
- package/lib/sessions/codex-meta.js +148 -0
- package/lib/sessions/codex-text.d.ts +9 -0
- package/lib/sessions/codex-text.js +44 -0
- package/lib/sessions/codex.d.ts +42 -0
- package/lib/sessions/codex.js +270 -0
- package/lib/sessions/opencode.d.ts +38 -0
- package/lib/sessions/opencode.js +339 -0
- package/lib/sessions/persist.d.ts +162 -0
- package/lib/sessions/persist.js +377 -0
- package/lib/sessions/row.d.ts +15 -0
- package/lib/sessions/row.js +101 -0
- package/lib/sessions/turns.d.ts +31 -0
- package/lib/sessions/turns.js +63 -0
- package/lib/sessions/zstd.d.ts +15 -0
- package/lib/sessions/zstd.js +152 -0
- package/lib/shared/invocation.d.ts +169 -0
- package/lib/shared/invocation.js +325 -0
- package/lib/shared/render.d.ts +101 -0
- package/lib/shared/render.js +1353 -0
- package/lib/shared/util.d.ts +21 -0
- package/lib/shared/util.js +32 -0
- package/lib/skills/bundled.d.ts +3 -0
- package/lib/skills/bundled.js +42 -0
- package/lib/skills/provider.d.ts +74 -0
- package/lib/skills/provider.js +346 -0
- package/lib/skills/row.d.ts +22 -0
- package/lib/skills/row.js +204 -0
- package/lib/workbench/adapter-coverage.d.ts +65 -0
- package/lib/workbench/adapter-coverage.js +141 -0
- package/lib/workbench/model-tools.d.ts +10 -0
- package/lib/workbench/model-tools.js +122 -0
- package/lib/workbench/overview.d.ts +153 -0
- package/lib/workbench/overview.js +246 -0
- package/lib/workbench/remote.d.ts +161 -0
- package/lib/workbench/remote.js +561 -0
- package/lib/workbench/row.d.ts +15 -0
- package/lib/workbench/row.js +16 -0
- package/lib/workbench/settings.d.ts +19 -0
- package/lib/workbench/settings.js +60 -0
- package/lib/workbench/workbench.d.ts +130 -0
- package/lib/workbench/workbench.js +361 -0
- package/locale/agents/en.json +6 -0
- package/locale/agents/zh.json +6 -0
- package/locale/commands/en.json +6 -0
- package/locale/commands/zh.json +6 -0
- package/locale/context/en.json +6 -0
- package/locale/context/zh.json +6 -0
- package/locale/en.json +6 -0
- package/locale/hooks/en.json +6 -0
- package/locale/hooks/zh.json +6 -0
- package/locale/mcp/en.json +6 -0
- package/locale/mcp/zh.json +6 -0
- package/locale/mods/en.json +6 -0
- package/locale/mods/zh.json +6 -0
- package/locale/opencode/en.json +6 -0
- package/locale/opencode/zh.json +6 -0
- package/locale/porter/en.json +6 -0
- package/locale/porter/zh.json +6 -0
- package/locale/sessions/en.json +6 -0
- package/locale/sessions/zh.json +6 -0
- package/locale/skills/en.json +6 -0
- package/locale/skills/zh.json +6 -0
- package/locale/workbench/en.json +6 -0
- package/locale/workbench/zh.json +6 -0
- package/locale/zh.json +7 -0
- package/package.json +247 -3
- package/runtime/opencode-host.mjs +270 -0
- package/skills/harness-forge/SKILL.md +47 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { DEFAULT_MARKETPLACES, type ForeignPlugin } from '@kirkchinese/harness-forge-core';
|
|
2
|
+
import { type CodePart } from './code-parts.js';
|
|
3
|
+
import { RemoteFetcher, type FetchDeps, type FetchLimits } from './fetch.js';
|
|
4
|
+
/** How an install was reached, to fetch it again for an update. */
|
|
5
|
+
export type RemoteOrigin =
|
|
6
|
+
/** An entry of a marketplace; `marketplace` is what was pasted for it, `marketIdentity` the source it names. */
|
|
7
|
+
{
|
|
8
|
+
readonly kind: 'marketplace';
|
|
9
|
+
readonly marketplace: string;
|
|
10
|
+
readonly marketIdentity: string;
|
|
11
|
+
readonly marketplaceName: string;
|
|
12
|
+
readonly entry: string;
|
|
13
|
+
}
|
|
14
|
+
/** A plugin repository or package pasted directly. */
|
|
15
|
+
| {
|
|
16
|
+
readonly kind: 'direct';
|
|
17
|
+
readonly input: string;
|
|
18
|
+
};
|
|
19
|
+
/** One plugin installed from the network. */
|
|
20
|
+
export interface RemoteInstall {
|
|
21
|
+
readonly pluginId: string;
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly dialect: string;
|
|
24
|
+
readonly origin: RemoteOrigin;
|
|
25
|
+
/** The full source it was fetched from (marketplace source, entry and its source), not names a marketplace chose. */
|
|
26
|
+
readonly identity: string;
|
|
27
|
+
/** Where it was fetched from, for the person. */
|
|
28
|
+
readonly source: string;
|
|
29
|
+
readonly page?: string;
|
|
30
|
+
/** The full commit SHA, npm version or archive digest installed. */
|
|
31
|
+
readonly revision: string;
|
|
32
|
+
/** The marketplace's commit it was listed at. */
|
|
33
|
+
readonly marketRevision?: string;
|
|
34
|
+
/** An npm tarball's integrity. */
|
|
35
|
+
readonly integrity?: string;
|
|
36
|
+
readonly registry?: string;
|
|
37
|
+
readonly root: string;
|
|
38
|
+
/** The directory this install uses; deleted once no install uses it. Absent only for a local folder installed in place before 0.4.1. */
|
|
39
|
+
readonly dir?: string;
|
|
40
|
+
/** A digest of everything in `dir` as installed (an npm plugin's dependencies included). */
|
|
41
|
+
readonly digest?: string;
|
|
42
|
+
readonly installedAt: string;
|
|
43
|
+
readonly updatedAt?: string;
|
|
44
|
+
}
|
|
45
|
+
/** A marketplace the person added. */
|
|
46
|
+
export interface AddedSource {
|
|
47
|
+
readonly input: string;
|
|
48
|
+
readonly name: string;
|
|
49
|
+
readonly harness: string;
|
|
50
|
+
readonly addedAt: string;
|
|
51
|
+
}
|
|
52
|
+
/** One marketplace entry, as the workbench lists it. */
|
|
53
|
+
export interface EntryView {
|
|
54
|
+
readonly name: string;
|
|
55
|
+
readonly description?: string;
|
|
56
|
+
readonly version?: string;
|
|
57
|
+
readonly category?: string;
|
|
58
|
+
/** Where it is fetched from (`marketplace` for a plugin inside the marketplace). */
|
|
59
|
+
readonly from: string;
|
|
60
|
+
/** Why it cannot be installed, when it cannot. */
|
|
61
|
+
readonly unsupported?: string;
|
|
62
|
+
/** The installed plugin's id, when this entry of this marketplace source is installed. */
|
|
63
|
+
readonly installed?: string;
|
|
64
|
+
}
|
|
65
|
+
/** What opening a pasted source shows. */
|
|
66
|
+
export interface SourceView {
|
|
67
|
+
readonly kind: 'marketplace' | 'plugin';
|
|
68
|
+
readonly input: string;
|
|
69
|
+
readonly name: string;
|
|
70
|
+
readonly description?: string;
|
|
71
|
+
readonly owner?: string;
|
|
72
|
+
readonly harness: string;
|
|
73
|
+
readonly source: string;
|
|
74
|
+
readonly page?: string;
|
|
75
|
+
readonly revision?: string;
|
|
76
|
+
readonly registry?: string;
|
|
77
|
+
readonly entries: readonly EntryView[];
|
|
78
|
+
readonly warnings: readonly string[];
|
|
79
|
+
}
|
|
80
|
+
/** One part a confirmation lists. */
|
|
81
|
+
export interface ConfirmedPart {
|
|
82
|
+
readonly kind: string;
|
|
83
|
+
readonly name: string;
|
|
84
|
+
/** Why it does not work in DSH, when it does not. */
|
|
85
|
+
readonly gap?: string;
|
|
86
|
+
/** The same reasons the overview gives, as codes the browser words in the person's language. */
|
|
87
|
+
readonly reasons?: ReadonlyArray<{
|
|
88
|
+
readonly code: string;
|
|
89
|
+
readonly detail: string;
|
|
90
|
+
}>;
|
|
91
|
+
/** For an update: whether the part is new or its files changed. */
|
|
92
|
+
readonly change?: 'new' | 'changed';
|
|
93
|
+
}
|
|
94
|
+
/** What the person confirms before an install or an update. */
|
|
95
|
+
export interface Confirmation {
|
|
96
|
+
readonly token: string;
|
|
97
|
+
readonly name: string;
|
|
98
|
+
readonly version?: string;
|
|
99
|
+
readonly harness: string;
|
|
100
|
+
readonly source: string;
|
|
101
|
+
readonly page?: string;
|
|
102
|
+
readonly revision: string;
|
|
103
|
+
/** The npm registry it is downloaded from. */
|
|
104
|
+
readonly registry?: string;
|
|
105
|
+
/** An npm plugin's dependencies: how many it declares, installed from `registry` once confirmed. */
|
|
106
|
+
readonly dependencies?: number;
|
|
107
|
+
readonly parts: readonly ConfirmedPart[];
|
|
108
|
+
/** The parts that would run code with the person's permissions, and whether each runs in DSH once installed. */
|
|
109
|
+
readonly codeParts: readonly CodePart[];
|
|
110
|
+
readonly works: number;
|
|
111
|
+
readonly total: number;
|
|
112
|
+
readonly warnings: readonly string[];
|
|
113
|
+
/** The id it will have: already installed when an install of it exists. */
|
|
114
|
+
readonly pluginId: string;
|
|
115
|
+
readonly alreadyInstalled: boolean;
|
|
116
|
+
/** Set for an update: the revisions, and the parts the new revision no longer has. */
|
|
117
|
+
readonly update?: {
|
|
118
|
+
readonly from: string;
|
|
119
|
+
readonly to: string;
|
|
120
|
+
readonly removed: readonly string[];
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/** One install's update status; `token` (when there is an update) is what preparing that exact update takes. */
|
|
124
|
+
export interface UpdateStatus {
|
|
125
|
+
readonly pluginId: string;
|
|
126
|
+
readonly name: string;
|
|
127
|
+
readonly current: string;
|
|
128
|
+
readonly latest?: string;
|
|
129
|
+
readonly update: boolean;
|
|
130
|
+
readonly token?: string;
|
|
131
|
+
readonly error?: string;
|
|
132
|
+
}
|
|
133
|
+
/** What the ledger offers this service. */
|
|
134
|
+
export interface RemoteHost {
|
|
135
|
+
/** Scan a plugin root; with `replacing`, as the new copy of that installed plugin (its name is not taken by it). */
|
|
136
|
+
scan(root: string, source: string, replacing?: string): ForeignPlugin;
|
|
137
|
+
/** Install a plugin root; resolves to its id. */
|
|
138
|
+
install(root: string, source: string): Promise<{
|
|
139
|
+
pluginId: string;
|
|
140
|
+
report: unknown;
|
|
141
|
+
}>;
|
|
142
|
+
/** Move an installed plugin to a new root. */
|
|
143
|
+
reroot(pluginId: string, root: string, source: string): Promise<unknown>;
|
|
144
|
+
installed(pluginId: string): boolean;
|
|
145
|
+
}
|
|
146
|
+
/** The installed-plugins service. */
|
|
147
|
+
export declare class RemotePlugins {
|
|
148
|
+
readonly root: string;
|
|
149
|
+
private readonly host;
|
|
150
|
+
readonly fetcher: RemoteFetcher;
|
|
151
|
+
private state;
|
|
152
|
+
/** `base`: the installed copy the candidate replaces; `explicit` when the person asked to update it. */
|
|
153
|
+
private readonly pending;
|
|
154
|
+
/** `base`: the installed copy the check compared, which the update it found replaces. */
|
|
155
|
+
private readonly checks;
|
|
156
|
+
private readonly statePath;
|
|
157
|
+
/** Fetching, installing and collecting run one at a time, so a collection never takes files being made or read. */
|
|
158
|
+
private queue;
|
|
159
|
+
constructor(root: string, host: RemoteHost, deps?: FetchDeps, limits?: FetchLimits);
|
|
160
|
+
private read;
|
|
161
|
+
private persist;
|
|
162
|
+
private exclusive;
|
|
163
|
+
/**
|
|
164
|
+
* The default and added marketplaces, and what was installed through Get plugins; an install taken from a
|
|
165
|
+
* local marketplace's own folder names that marketplace (`localMarketplace`).
|
|
166
|
+
*/
|
|
167
|
+
sources(): Promise<{
|
|
168
|
+
defaults: typeof DEFAULT_MARKETPLACES;
|
|
169
|
+
added: readonly AddedSource[];
|
|
170
|
+
installs: ReadonlyArray<RemoteInstall & {
|
|
171
|
+
readonly localMarketplace?: string;
|
|
172
|
+
}>;
|
|
173
|
+
git: boolean;
|
|
174
|
+
}>;
|
|
175
|
+
/** Installs whose plugin is still in the ledger. */
|
|
176
|
+
installs(): readonly RemoteInstall[];
|
|
177
|
+
/** Open what was pasted: a marketplace's entries, or one plugin. A marketplace opened from the network is remembered. */
|
|
178
|
+
open(input: string): Promise<SourceView>;
|
|
179
|
+
private openNow;
|
|
180
|
+
/** Stop listing an added marketplace. */
|
|
181
|
+
forget(input: string): boolean;
|
|
182
|
+
/** Why Harness Forge does not fetch an entry's source, or undefined when it does. */
|
|
183
|
+
private problemOf;
|
|
184
|
+
/** An entry's full identity: the marketplace's source, the entry, and the source the entry names (its path inside the marketplace, or its own). */
|
|
185
|
+
private entryIdentity;
|
|
186
|
+
private entryView;
|
|
187
|
+
/** Read a source (at `sha`, for a git source being updated): a marketplace index with the commit it was read at, or what a single plugin is. */
|
|
188
|
+
private load;
|
|
189
|
+
/**
|
|
190
|
+
* Fetch a plugin (a marketplace's `entry`, or the pasted source itself) and
|
|
191
|
+
* say what it contains; nothing of it runs or is installed until
|
|
192
|
+
* {@link install} gets the returned token.
|
|
193
|
+
*/
|
|
194
|
+
prepare(input: string, entry?: string): Promise<Confirmation>;
|
|
195
|
+
/**
|
|
196
|
+
* Bind a staged candidate to a token and say what it contains (for an
|
|
197
|
+
* update, what changed). A candidate from the source of an installed plugin
|
|
198
|
+
* (the same identity) replaces that install when confirmed, as an update does.
|
|
199
|
+
*/
|
|
200
|
+
private confirmation;
|
|
201
|
+
/** Install (or, for an update, apply) exactly what {@link prepare} or {@link prepareUpdate} showed. */
|
|
202
|
+
install(token: string): Promise<{
|
|
203
|
+
pluginId: string;
|
|
204
|
+
report?: unknown;
|
|
205
|
+
revision: string;
|
|
206
|
+
updated: boolean;
|
|
207
|
+
}>;
|
|
208
|
+
private installNow;
|
|
209
|
+
/** Drop a confirmation that was not taken, with its files. */
|
|
210
|
+
cancel(token: string): boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Compare each install's revision with what its source points at now. An
|
|
213
|
+
* update found comes with a token: preparing it fetches exactly that
|
|
214
|
+
* revision. One failing source does not stop the others.
|
|
215
|
+
*/
|
|
216
|
+
checkUpdates(pluginId?: string): Promise<UpdateStatus[]>;
|
|
217
|
+
/**
|
|
218
|
+
* Fetch the revision an update check found (the `token` it returned) and say
|
|
219
|
+
* what it contains and what changed; {@link install} applies it. Refused
|
|
220
|
+
* when the source no longer gives that revision.
|
|
221
|
+
*/
|
|
222
|
+
prepareUpdate(pluginId: string, token: string): Promise<Confirmation>;
|
|
223
|
+
/** The plugin was removed from the ledger: forget its install and delete the files it used. */
|
|
224
|
+
released(pluginId: string): void;
|
|
225
|
+
/** What an install's source gives now, or undefined for a source that does not change (a local folder, an unpinned archive). */
|
|
226
|
+
private latestPins;
|
|
227
|
+
/** A staging directory of its own, which only one candidate uses. */
|
|
228
|
+
private newStage;
|
|
229
|
+
/** Run `fill` in a new staging directory; the candidate it returns gets the digest of its root. On failure the directory goes. */
|
|
230
|
+
private staged;
|
|
231
|
+
private fetchCandidate;
|
|
232
|
+
/** Fetch a git, npm or archive source into a staging directory of its own. */
|
|
233
|
+
private fetchSpec;
|
|
234
|
+
/**
|
|
235
|
+
* A Claude Code marketplace entry is also manifest (code.claude.com, "How an
|
|
236
|
+
* entry combines with plugin.json"): with no `plugin.json`, the entry is the
|
|
237
|
+
* manifest; with one, the entry's component fields are added to it unless the
|
|
238
|
+
* entry says `"strict": false`, where they conflict. The copy is Harness
|
|
239
|
+
* Forge's own, so the combined manifest is written into it and read by the
|
|
240
|
+
* scanner like any other.
|
|
241
|
+
*/
|
|
242
|
+
private applyEntry;
|
|
243
|
+
/** Whether an install uses a directory under `plugins/`. */
|
|
244
|
+
private inUse;
|
|
245
|
+
/** Delete a candidate's staging directory; it is the candidate's alone. */
|
|
246
|
+
private discard;
|
|
247
|
+
/** Delete an installed copy under `plugins/` once no install uses it. Never anything outside it. */
|
|
248
|
+
private deleteDir;
|
|
249
|
+
/**
|
|
250
|
+
* Drop expired confirmations and update checks, staging directories no
|
|
251
|
+
* confirmation holds, copies no install uses (an interrupted install), and
|
|
252
|
+
* all but the newest checkout of each source. Runs inside the queue, so no
|
|
253
|
+
* fetch is writing or reading them.
|
|
254
|
+
*/
|
|
255
|
+
private collect;
|
|
256
|
+
}
|