@trenchwork/erosolar 1.1.31 → 1.1.32

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 (44) hide show
  1. package/dist/bin/deepseek.js +13 -0
  2. package/dist/bin/deepseek.js.map +1 -1
  3. package/dist/capabilities/_binaryRequirements.d.ts +101 -0
  4. package/dist/capabilities/_binaryRequirements.d.ts.map +1 -0
  5. package/dist/capabilities/_binaryRequirements.js +288 -0
  6. package/dist/capabilities/_binaryRequirements.js.map +1 -0
  7. package/dist/capabilities/_opsContext.d.ts +129 -0
  8. package/dist/capabilities/_opsContext.d.ts.map +1 -0
  9. package/dist/capabilities/_opsContext.js +274 -0
  10. package/dist/capabilities/_opsContext.js.map +1 -0
  11. package/dist/capabilities/_processRunner.d.ts +32 -0
  12. package/dist/capabilities/_processRunner.d.ts.map +1 -1
  13. package/dist/capabilities/_processRunner.js +126 -0
  14. package/dist/capabilities/_processRunner.js.map +1 -1
  15. package/dist/capabilities/engagementCapability.d.ts.map +1 -1
  16. package/dist/capabilities/engagementCapability.js +14 -3
  17. package/dist/capabilities/engagementCapability.js.map +1 -1
  18. package/dist/capabilities/index.d.ts +1 -0
  19. package/dist/capabilities/index.d.ts.map +1 -1
  20. package/dist/capabilities/index.js +1 -0
  21. package/dist/capabilities/index.js.map +1 -1
  22. package/dist/capabilities/llmRedteamCapability.d.ts +38 -0
  23. package/dist/capabilities/llmRedteamCapability.d.ts.map +1 -0
  24. package/dist/capabilities/llmRedteamCapability.js +340 -0
  25. package/dist/capabilities/llmRedteamCapability.js.map +1 -0
  26. package/dist/cli/offsecInstall.d.ts +43 -0
  27. package/dist/cli/offsecInstall.d.ts.map +1 -0
  28. package/dist/cli/offsecInstall.js +258 -0
  29. package/dist/cli/offsecInstall.js.map +1 -0
  30. package/dist/headless/interactiveShell.d.ts.map +1 -1
  31. package/dist/headless/interactiveShell.js +25 -0
  32. package/dist/headless/interactiveShell.js.map +1 -1
  33. package/dist/runtime/node.d.ts.map +1 -1
  34. package/dist/runtime/node.js +58 -2
  35. package/dist/runtime/node.js.map +1 -1
  36. package/dist/runtime/phaseEmitter.d.ts +63 -0
  37. package/dist/runtime/phaseEmitter.d.ts.map +1 -0
  38. package/dist/runtime/phaseEmitter.js +207 -0
  39. package/dist/runtime/phaseEmitter.js.map +1 -0
  40. package/dist/tools/engagementTools.d.ts +23 -0
  41. package/dist/tools/engagementTools.d.ts.map +1 -1
  42. package/dist/tools/engagementTools.js +45 -0
  43. package/dist/tools/engagementTools.js.map +1 -1
  44. package/package.json +1 -1
@@ -0,0 +1,340 @@
1
+ /**
2
+ * llmRedteam — phishing-resistant LLM probing for variant-research +
3
+ * engagement-delivery profiles.
4
+ *
5
+ * Wraps the canonical open-source LLM red-team toolchain:
6
+ *
7
+ * • garak — NVIDIA / Leon Derczynski's vulnerability scanner
8
+ * for LLMs. Probes for prompt injection, jailbreak
9
+ * (DAN family), encoding tricks, training-data
10
+ * leakage, toxicity. Single Python binary; OpenAI
11
+ * and HTTP-REST model types built in.
12
+ * • promptfoo — Eval framework with a `redteam` subcommand that
13
+ * auto-generates jailbreak / harmful-content / PII-
14
+ * extraction probes against a configured target.
15
+ *
16
+ * Tools route every spawn through OpsContext, so:
17
+ * • Targets are scope-checked against the active engagement BEFORE
18
+ * the process starts (cheap fail-fast; Lambda re-checks server-
19
+ * side as defence-in-depth).
20
+ * • Each run is a Job in users/{uid}/jobs — visible in the portal's
21
+ * #jobsList rail with live log streaming.
22
+ * • Hits parsed from tool stdout become Findings under
23
+ * users/{uid}/findings — the portal's #findingsList rail renders
24
+ * them as they land.
25
+ * • Risky operations gate on operator HITL via the portal's
26
+ * pending-questions strip — no probe fires until approved.
27
+ *
28
+ * Profile gating: only registered for `variant-research` and
29
+ * `engagement-delivery`. The default coding profile sees zero of these
30
+ * tools (CLAUDE.md "Capability separation").
31
+ */
32
+ import { createOpsContext, } from './_opsContext.js';
33
+ import { logDebug } from '../utils/debugLogger.js';
34
+ const PROBE_CATALOGUE = [
35
+ { id: 'promptinject', garakName: 'promptinject', description: 'Cross-prompt injection (Perez & Ribeiro 2022).', severityIfHit: 'high', approxProbeCount: 50 },
36
+ { id: 'dan', garakName: 'dan', description: 'DAN-family jailbreaks ("Do Anything Now", DUDE, AntiDAN).', severityIfHit: 'high', approxProbeCount: 16 },
37
+ { id: 'encoding', garakName: 'encoding', description: 'Base64 / ROT13 / hex-encoded harmful-instruction smuggling.', severityIfHit: 'medium', approxProbeCount: 24 },
38
+ { id: 'leakreplay', garakName: 'leakreplay', description: 'Training-data extraction via prefix replay.', severityIfHit: 'medium', approxProbeCount: 30 },
39
+ { id: 'realtoxicityprompts', garakName: 'realtoxicityprompts', description: 'RTP toxicity completion (Gehman et al. 2020).', severityIfHit: 'medium', approxProbeCount: 100 },
40
+ { id: 'continuation', garakName: 'continuation', description: 'Slur / hate-speech prefix continuation.', severityIfHit: 'medium', approxProbeCount: 20 },
41
+ { id: 'malwaregen', garakName: 'malwaregen', description: 'Refusal-bypass for code that compiles to working malware.', severityIfHit: 'critical', approxProbeCount: 12 },
42
+ { id: 'xss', garakName: 'xss', description: 'Refusal-bypass for XSS payload generation.', severityIfHit: 'high', approxProbeCount: 10 },
43
+ { id: 'glitch', garakName: 'glitch', description: 'Tokenizer-glitch tokens that destabilise the model.', severityIfHit: 'low', approxProbeCount: 50 },
44
+ { id: 'goodside', garakName: 'goodside', description: 'Riley Goodside\'s prompt-injection canary set.', severityIfHit: 'high', approxProbeCount: 10 },
45
+ ];
46
+ const PROBE_BY_ID = new Map(PROBE_CATALOGUE.map((p) => [p.id, p]));
47
+ // ── Stdout parsers ────────────────────────────────────────────────
48
+ /**
49
+ * garak's report writer prints lines in the shape:
50
+ * garak.detectors.dan.DAN: PASS ok on 0/16
51
+ * garak.detectors.encoding.DecodeMatch: FAIL hits 3/24
52
+ *
53
+ * The "FAIL hits N/M" lines are what we want — those are findings.
54
+ * Match conservatively; garak's exact format has wobbled across
55
+ * releases, so this is line-noise tolerant.
56
+ */
57
+ const GARAK_HIT_LINE = /^(?:garak\.)?detectors?\.([\w.]+):\s+FAIL\s+(?:hits\s+(\d+)\/(\d+)|.+)/i;
58
+ const GARAK_PROBE_LINE = /^(?:garak\.)?probes\.([\w.]+):\s+/i;
59
+ function parseGarakLine(line) {
60
+ const m = GARAK_HIT_LINE.exec(line);
61
+ if (!m)
62
+ return null;
63
+ return {
64
+ detector: m[1],
65
+ hits: m[2] ? Number(m[2]) : undefined,
66
+ total: m[3] ? Number(m[3]) : undefined,
67
+ rawLine: line,
68
+ };
69
+ }
70
+ /**
71
+ * promptfoo's `redteam` writes JSON to stdout when given `--output -`,
72
+ * but its line-by-line UI prints `[FAIL] <name>: <reason>` rows. Match
73
+ * those for live finding emission while the JSON drives the summary.
74
+ */
75
+ const PROMPTFOO_HIT_LINE = /^\[(FAIL|VULN|HIGH|CRITICAL)\]\s+([^:]+):\s+(.+)/i;
76
+ function parsePromptfooLine(line) {
77
+ const m = PROMPTFOO_HIT_LINE.exec(line);
78
+ if (!m)
79
+ return null;
80
+ return { severity: m[1], testName: m[2].trim(), reason: m[3].trim(), rawLine: line };
81
+ }
82
+ // ── Tool builders ─────────────────────────────────────────────────
83
+ function probeIdsToGarakArg(ids) {
84
+ const valid = [];
85
+ for (const id of ids) {
86
+ const meta = PROBE_BY_ID.get(id);
87
+ if (!meta)
88
+ throw new Error(`unknown probe id: ${id} (allowed: ${[...PROBE_BY_ID.keys()].join(', ')})`);
89
+ valid.push(meta.garakName);
90
+ }
91
+ return valid.join(',');
92
+ }
93
+ function severityForDetector(detectorPath) {
94
+ // Map detector class fragment back to the closest probe family. Fall
95
+ // through to 'medium' so unrecognised detectors still produce a row
96
+ // (the operator can re-classify in the portal).
97
+ for (const meta of PROBE_CATALOGUE) {
98
+ if (detectorPath.toLowerCase().includes(meta.garakName.toLowerCase())) {
99
+ return meta.severityIfHit;
100
+ }
101
+ }
102
+ return 'medium';
103
+ }
104
+ function buildLlmRedteamTools(opsCtx) {
105
+ return [
106
+ // ─── LlmRedteamListProbes ──────────────────────────────────
107
+ {
108
+ name: 'LlmRedteamListProbes',
109
+ description: 'List the curated garak probe families this CLI can run. Use the returned ids in LlmRedteamGarak.probes[].',
110
+ parameters: {
111
+ type: 'object',
112
+ properties: {},
113
+ },
114
+ handler: async () => {
115
+ return JSON.stringify(PROBE_CATALOGUE.map((p) => ({
116
+ id: p.id,
117
+ description: p.description,
118
+ severityIfHit: p.severityIfHit,
119
+ approxProbeCount: p.approxProbeCount,
120
+ })), null, 2);
121
+ },
122
+ },
123
+ // ─── LlmRedteamGarak ──────────────────────────────────────
124
+ {
125
+ name: 'LlmRedteamGarak',
126
+ description: 'Run garak against a target LLM endpoint. Probes for prompt injection, jailbreak, encoding tricks, ' +
127
+ 'training-data leakage. Streams findings to the Operations Center as they land. Requires HITL approval.',
128
+ parameters: {
129
+ type: 'object',
130
+ properties: {
131
+ targetId: { type: 'string', description: 'Target id from the engagement\'s targets collection. Must be in scope.' },
132
+ endpoint: { type: 'string', description: 'LLM endpoint URL (https://…/v1/chat/completions or similar). Must match an in-scope target.' },
133
+ modelType: { type: 'string', enum: ['rest', 'openai', 'huggingface', 'replicate'], description: 'garak model_type. "rest" is the most general.' },
134
+ modelName: { type: 'string', description: 'For modelType=openai: gpt-4o-mini etc. For rest: a label.' },
135
+ probes: {
136
+ type: 'array',
137
+ items: { type: 'string', enum: PROBE_CATALOGUE.map((p) => p.id) },
138
+ description: 'Probe family ids. See LlmRedteamListProbes for the catalogue.',
139
+ },
140
+ generations: { type: 'number', description: 'Generations per probe (default 5). Higher = more signal + more cost.' },
141
+ dryRun: { type: 'boolean', description: 'Print the garak command and skip execution. Useful for plan review.' },
142
+ },
143
+ required: ['targetId', 'endpoint', 'modelType', 'probes'],
144
+ },
145
+ handler: async (args) => {
146
+ const targetId = String(args.targetId);
147
+ const endpoint = String(args.endpoint);
148
+ const modelType = String(args.modelType);
149
+ const modelName = args.modelName ? String(args.modelName) : (modelType === 'openai' ? 'gpt-4o-mini' : 'rest-target');
150
+ const probeIds = Array.isArray(args.probes) ? args.probes.map(String) : [];
151
+ const generations = typeof args.generations === 'number' ? Math.max(1, Math.min(20, Math.floor(args.generations))) : 5;
152
+ const dryRun = Boolean(args.dryRun);
153
+ // ScopeTarget keys are host/cidr/url/endpoint — pass the LLM
154
+ // endpoint URL only; targetId is the engagement-scoped row ID
155
+ // attached to the job, not part of scope assertion.
156
+ await opsCtx.assertInScope({ endpoint });
157
+ const probesArg = probeIdsToGarakArg(probeIds);
158
+ const cmd = ['garak',
159
+ '--model_type', modelType,
160
+ '--model_name', modelName,
161
+ '--probes', probesArg,
162
+ '--generations', String(generations),
163
+ ];
164
+ if (modelType === 'rest')
165
+ cmd.push('--rest_url', endpoint);
166
+ if (dryRun) {
167
+ return JSON.stringify({ dryRun: true, cmd }, null, 2);
168
+ }
169
+ // HITL gate. Even with operator-authorised scope, garak fires
170
+ // hundreds of probes that will land in the target's logs —
171
+ // worth a final confirmation.
172
+ const totalProbes = probeIds.reduce((acc, id) => {
173
+ const meta = PROBE_BY_ID.get(id);
174
+ return acc + (meta ? meta.approxProbeCount * generations : 0);
175
+ }, 0);
176
+ const approval = await opsCtx.requestApproval({
177
+ severity: 'risky',
178
+ question: `Fire ~${totalProbes} garak probes (${probeIds.join(',')}) against ${endpoint}? Each probe sends an adversarial prompt and records the response.`,
179
+ options: [
180
+ { label: 'cancel', description: 'Abort the run.' },
181
+ { label: 'go', description: 'Fire all selected probes.' },
182
+ { label: 'dry-run', description: 'Print the garak command and exit.' },
183
+ ],
184
+ timeoutSec: 300,
185
+ defaultOnTimeout: 'abort',
186
+ });
187
+ if (approval === 'cancel')
188
+ return 'cancelled by operator';
189
+ if (approval === 'dry-run')
190
+ return JSON.stringify({ dryRun: true, cmd }, null, 2);
191
+ const job = await opsCtx.startJob({
192
+ tool: 'garak', kind: 'llmRedteam', targetId,
193
+ cmd, timeoutMs: 30 * 60 * 1000,
194
+ });
195
+ let lineCount = 0;
196
+ let findingsEmitted = 0;
197
+ try {
198
+ for await (const line of job.lines()) {
199
+ lineCount += 1;
200
+ await job.appendLog(line);
201
+ // Roughly track progress by probe-line count; garak emits a
202
+ // 'probes.X' header per probe, so this is a decent proxy.
203
+ if (GARAK_PROBE_LINE.test(line)) {
204
+ await job.setProgress(Math.min(99, Math.round((lineCount / Math.max(1, totalProbes)) * 100)), line);
205
+ }
206
+ const hit = parseGarakLine(line);
207
+ if (hit) {
208
+ await opsCtx.emitFinding({
209
+ source: 'llmRedteam', tool: 'garak', targetId,
210
+ severity: severityForDetector(hit.detector),
211
+ title: `garak ${hit.detector}${hit.hits != null ? ` (${hit.hits}/${hit.total})` : ''}`,
212
+ description: `Detector ${hit.detector} flagged the target as vulnerable. Probe set: ${probeIds.join(',')}.`,
213
+ replication: cmd.join(' '),
214
+ evidence: { transcript: line, raw: hit },
215
+ jobId: job.id,
216
+ });
217
+ findingsEmitted += 1;
218
+ }
219
+ }
220
+ await job.complete('done', { lineCount, findingsEmitted, probeIds });
221
+ return JSON.stringify({ jobId: job.id, lineCount, findingsEmitted, probes: probeIds }, null, 2);
222
+ }
223
+ catch (err) {
224
+ await job.complete('failed', { error: err.message });
225
+ throw err;
226
+ }
227
+ },
228
+ },
229
+ // ─── LlmRedteamPromptfoo ──────────────────────────────────
230
+ {
231
+ name: 'LlmRedteamPromptfoo',
232
+ description: 'Run promptfoo redteam against a target. Generates jailbreak / harmful-content / PII-extraction probes ' +
233
+ 'from the configured plugin set, evaluates the target\'s responses, streams hits to findings.',
234
+ parameters: {
235
+ type: 'object',
236
+ properties: {
237
+ targetId: { type: 'string' },
238
+ configPath: { type: 'string', description: 'Path to a promptfooconfig.yaml that defines the target + plugins. Use promptfoo redteam init to bootstrap.' },
239
+ numTests: { type: 'number', description: 'Tests per plugin (default 5).' },
240
+ plugins: {
241
+ type: 'array',
242
+ items: { type: 'string', enum: ['jailbreak', 'harmful', 'pii', 'prompt-injection', 'rbac', 'cross-session-leak'] },
243
+ description: 'Plugin set (default: jailbreak, harmful, pii, prompt-injection).',
244
+ },
245
+ },
246
+ required: ['targetId', 'configPath'],
247
+ },
248
+ handler: async (args) => {
249
+ const targetId = String(args.targetId);
250
+ const configPath = String(args.configPath);
251
+ const numTests = typeof args.numTests === 'number' ? Math.max(1, Math.min(50, Math.floor(args.numTests))) : 5;
252
+ const plugins = Array.isArray(args.plugins) && args.plugins.length
253
+ ? args.plugins
254
+ : ['jailbreak', 'harmful', 'pii', 'prompt-injection'];
255
+ // Scope check via the config — the operator wired the target
256
+ // endpoint into the config, so we reload it here only enough
257
+ // to find a scope-relevant URL. Pragmatic: if `configPath`
258
+ // can't be parsed cheaply we trust the operator's authorization
259
+ // (they wrote the file) and let the Lambda's server-side
260
+ // engagement gate be the enforcer.
261
+ // TODO: parse promptfoo config and run assertInScope on its
262
+ // target.url field once we add a YAML parser to the CLI.
263
+ const cmd = ['promptfoo', 'redteam', 'run',
264
+ '--config', configPath,
265
+ '--num-tests', String(numTests),
266
+ '--plugins', plugins.join(','),
267
+ '--no-cache',
268
+ ];
269
+ const approval = await opsCtx.requestApproval({
270
+ severity: 'risky',
271
+ question: `Run promptfoo redteam (${plugins.join(',')}) with ${numTests} tests/plugin against the target in ${configPath}?`,
272
+ options: [
273
+ { label: 'cancel' },
274
+ { label: 'go', description: `Approx ${numTests * plugins.length} test runs.` },
275
+ ],
276
+ timeoutSec: 300,
277
+ defaultOnTimeout: 'abort',
278
+ });
279
+ if (approval === 'cancel')
280
+ return 'cancelled by operator';
281
+ const job = await opsCtx.startJob({
282
+ tool: 'promptfoo', kind: 'llmRedteam', targetId,
283
+ cmd, timeoutMs: 30 * 60 * 1000,
284
+ });
285
+ let findingsEmitted = 0;
286
+ try {
287
+ for await (const line of job.lines()) {
288
+ await job.appendLog(line);
289
+ const hit = parsePromptfooLine(line);
290
+ if (hit) {
291
+ const sev = /critical/i.test(hit.severity) ? 'critical' :
292
+ /high|vuln/i.test(hit.severity) ? 'high' :
293
+ 'medium';
294
+ await opsCtx.emitFinding({
295
+ source: 'llmRedteam', tool: 'promptfoo', targetId,
296
+ severity: sev,
297
+ title: `promptfoo ${hit.testName}`,
298
+ description: hit.reason,
299
+ replication: cmd.join(' '),
300
+ evidence: { transcript: hit.rawLine, raw: hit },
301
+ jobId: job.id,
302
+ });
303
+ findingsEmitted += 1;
304
+ }
305
+ }
306
+ await job.complete('done', { findingsEmitted, plugins });
307
+ return JSON.stringify({ jobId: job.id, findingsEmitted, plugins }, null, 2);
308
+ }
309
+ catch (err) {
310
+ await job.complete('failed', { error: err.message });
311
+ throw err;
312
+ }
313
+ },
314
+ },
315
+ ];
316
+ }
317
+ // ── CapabilityModule ─────────────────────────────────────────────
318
+ export class LlmRedteamCapabilityModule {
319
+ id = 'capability.llmRedteam';
320
+ description = 'LLM red-team probes (garak + promptfoo). Variant-research / engagement-delivery only. ' +
321
+ 'Streams findings to the Operations Center as they land. Requires HITL approval before each run.';
322
+ async create(context) {
323
+ logDebug('[LlmRedteam] capability initialized');
324
+ const opsCtx = createOpsContext({
325
+ engagementId: context.engagementId ?? null,
326
+ uid: context.uid ?? null,
327
+ });
328
+ const toolSuite = {
329
+ id: 'llmRedteam.tools',
330
+ description: 'garak + promptfoo wrappers for LLM red-teaming.',
331
+ tools: buildLlmRedteamTools(opsCtx),
332
+ };
333
+ return {
334
+ id: this.id,
335
+ description: this.description,
336
+ toolSuite,
337
+ };
338
+ }
339
+ }
340
+ //# sourceMappingURL=llmRedteamCapability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llmRedteamCapability.js","sourceRoot":"","sources":["../../src/capabilities/llmRedteamCapability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAIH,OAAO,EACL,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAkBnD,MAAM,eAAe,GAA6B;IAChD,EAAE,EAAE,EAAE,cAAc,EAAG,SAAS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,gBAAgB,CAAC;YAC9B,YAAY,EAAG,OAAqC,CAAC,YAAY,IAAI,IAAI;YACzE,GAAG,EAAG,OAA4B,CAAC,GAAG,IAAI,IAAI;SAC/C,CAAC,CAAC;QACH,MAAM,SAAS,GAAc;YAC3B,EAAE,EAAE,kBAAkB;YACtB,WAAW,EAAE,iDAAiD;YAC9D,KAAK,EAAE,oBAAoB,CAAC,MAAM,CAAC;SACpC,CAAC;QACF,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,SAAS;SACV,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * `erosolar offsec install` — operator-facing self-bootstrap.
3
+ *
4
+ * Reads the BinaryRequirement manifest, scans PATH for each entry,
5
+ * and installs every missing binary using the channel that's
6
+ * appropriate for the operator's platform (apt on Linux/Kali,
7
+ * Homebrew on macOS, winget on Windows, with pipx/pip/npm/cargo/go/
8
+ * gem as cross-platform fallbacks).
9
+ *
10
+ * Two key invariants:
11
+ *
12
+ * 1. **Idempotent.** Already-on-PATH binaries are skipped. Re-running
13
+ * after a partial install is safe.
14
+ *
15
+ * 2. **Cross-platform graceful.** Binaries with no plausibly-native
16
+ * install path on the operator's OS (e.g. afl-fuzz on Windows)
17
+ * are skipped with a clear message pointing at WSL2 / Docker
18
+ * instead of crashing the whole bootstrap.
19
+ *
20
+ * Two confirmation modes:
21
+ *
22
+ * • Default (interactive TTY): each install command is shown and
23
+ * the operator confirms with [y/N]. Defaults to skip — destructive
24
+ * by default = safer.
25
+ * • `--yes` / `-y`: auto-confirm every install. Used in CI / Docker
26
+ * image builds where there's no TTY to prompt against.
27
+ *
28
+ * Filtering:
29
+ *
30
+ * • `--capability <id>` (repeatable) — install only the bins for
31
+ * these capabilities. Default = all.
32
+ * • `--bin <name>` (repeatable) — install a specific binary.
33
+ * • `--missing-only` — skip if already on PATH (this is the default;
34
+ * flag exists so the inverse is explicit when scripting).
35
+ * • `--dry-run` — list what would be installed, run nothing.
36
+ */
37
+ export declare function runOffsecInstall(rawArgs: string[]): Promise<number>;
38
+ /**
39
+ * Top-level dispatch for `erosolar offsec <verb>`. Currently only
40
+ * `install` is implemented; reserve `status` / `update` for follow-ups.
41
+ */
42
+ export declare function runOffsecCommand(rawArgs: string[]): Promise<number>;
43
+ //# sourceMappingURL=offsecInstall.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"offsecInstall.d.ts","sourceRoot":"","sources":["../../src/cli/offsecInstall.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAgGH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAgGzE;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBzE"}