ikarmic-forge 0.0.0-stage → 4.4.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 +58 -2
- package/dist/acp/server.d.ts +53 -0
- package/dist/acp/server.d.ts.map +1 -0
- package/dist/acp/server.js +235 -0
- package/dist/acp/server.js.map +1 -0
- package/dist/app.d.ts +22 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +159 -0
- package/dist/app.js.map +1 -0
- package/dist/bin/forge.d.ts +3 -0
- package/dist/bin/forge.d.ts.map +1 -0
- package/dist/bin/forge.js +747 -0
- package/dist/bin/forge.js.map +1 -0
- package/dist/chat-files.d.ts +37 -0
- package/dist/chat-files.d.ts.map +1 -0
- package/dist/chat-files.js +152 -0
- package/dist/chat-files.js.map +1 -0
- package/dist/commands/acp.d.ts +4 -0
- package/dist/commands/acp.d.ts.map +1 -0
- package/dist/commands/acp.js +36 -0
- package/dist/commands/acp.js.map +1 -0
- package/dist/commands/ai-comments.d.ts +9 -0
- package/dist/commands/ai-comments.d.ts.map +1 -0
- package/dist/commands/ai-comments.js +43 -0
- package/dist/commands/ai-comments.js.map +1 -0
- package/dist/commands/architect.d.ts +9 -0
- package/dist/commands/architect.d.ts.map +1 -0
- package/dist/commands/architect.js +27 -0
- package/dist/commands/architect.js.map +1 -0
- package/dist/commands/checkpoint.d.ts +10 -0
- package/dist/commands/checkpoint.d.ts.map +1 -0
- package/dist/commands/checkpoint.js +168 -0
- package/dist/commands/checkpoint.js.map +1 -0
- package/dist/commands/config.d.ts +15 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +180 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/diff.d.ts +29 -0
- package/dist/commands/diff.d.ts.map +1 -0
- package/dist/commands/diff.js +90 -0
- package/dist/commands/diff.js.map +1 -0
- package/dist/commands/hook.d.ts +10 -0
- package/dist/commands/hook.d.ts.map +1 -0
- package/dist/commands/hook.js +121 -0
- package/dist/commands/hook.js.map +1 -0
- package/dist/commands/mcp.d.ts +10 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +110 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/orchestrator.d.ts +22 -0
- package/dist/commands/orchestrator.d.ts.map +1 -0
- package/dist/commands/orchestrator.js +113 -0
- package/dist/commands/orchestrator.js.map +1 -0
- package/dist/commands/plugin.d.ts +3 -0
- package/dist/commands/plugin.d.ts.map +1 -0
- package/dist/commands/plugin.js +62 -0
- package/dist/commands/plugin.js.map +1 -0
- package/dist/commands/policy.d.ts +2 -0
- package/dist/commands/policy.d.ts.map +1 -0
- package/dist/commands/policy.js +21 -0
- package/dist/commands/policy.js.map +1 -0
- package/dist/commands/skill.d.ts +13 -0
- package/dist/commands/skill.d.ts.map +1 -0
- package/dist/commands/skill.js +194 -0
- package/dist/commands/skill.js.map +1 -0
- package/dist/commands/spec.d.ts +13 -0
- package/dist/commands/spec.d.ts.map +1 -0
- package/dist/commands/spec.js +76 -0
- package/dist/commands/spec.js.map +1 -0
- package/dist/commands/watch.d.ts +15 -0
- package/dist/commands/watch.d.ts.map +1 -0
- package/dist/commands/watch.js +83 -0
- package/dist/commands/watch.js.map +1 -0
- package/dist/commands/worktree.d.ts +22 -0
- package/dist/commands/worktree.d.ts.map +1 -0
- package/dist/commands/worktree.js +187 -0
- package/dist/commands/worktree.js.map +1 -0
- package/dist/components/Approval.d.ts +9 -0
- package/dist/components/Approval.d.ts.map +1 -0
- package/dist/components/Approval.js +37 -0
- package/dist/components/Approval.js.map +1 -0
- package/dist/components/Footer.d.ts +22 -0
- package/dist/components/Footer.d.ts.map +1 -0
- package/dist/components/Footer.js +59 -0
- package/dist/components/Footer.js.map +1 -0
- package/dist/components/Header.d.ts +11 -0
- package/dist/components/Header.d.ts.map +1 -0
- package/dist/components/Header.js +23 -0
- package/dist/components/Header.js.map +1 -0
- package/dist/components/Spinner.d.ts +3 -0
- package/dist/components/Spinner.d.ts.map +1 -0
- package/dist/components/Spinner.js +8 -0
- package/dist/components/Spinner.js.map +1 -0
- package/dist/components/Stream.d.ts +10 -0
- package/dist/components/Stream.d.ts.map +1 -0
- package/dist/components/Stream.js +13 -0
- package/dist/components/Stream.js.map +1 -0
- package/dist/components/ToolEvent.d.ts +13 -0
- package/dist/components/ToolEvent.d.ts.map +1 -0
- package/dist/components/ToolEvent.js +54 -0
- package/dist/components/ToolEvent.js.map +1 -0
- package/dist/credential-store.d.ts +8 -0
- package/dist/credential-store.d.ts.map +1 -0
- package/dist/credential-store.js +37 -0
- package/dist/credential-store.js.map +1 -0
- package/dist/git-workflow.d.ts +16 -0
- package/dist/git-workflow.d.ts.map +1 -0
- package/dist/git-workflow.js +38 -0
- package/dist/git-workflow.js.map +1 -0
- package/dist/mcp-loader.d.ts +25 -0
- package/dist/mcp-loader.d.ts.map +1 -0
- package/dist/mcp-loader.js +99 -0
- package/dist/mcp-loader.js.map +1 -0
- package/dist/notify.d.ts +12 -0
- package/dist/notify.d.ts.map +1 -0
- package/dist/notify.js +47 -0
- package/dist/notify.js.map +1 -0
- package/dist/options.d.ts +407 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +792 -0
- package/dist/options.js.map +1 -0
- package/dist/repl-commands.d.ts +53 -0
- package/dist/repl-commands.d.ts.map +1 -0
- package/dist/repl-commands.js +141 -0
- package/dist/repl-commands.js.map +1 -0
- package/dist/repl.d.ts +52 -0
- package/dist/repl.d.ts.map +1 -0
- package/dist/repl.js +1174 -0
- package/dist/repl.js.map +1 -0
- package/dist/runner.d.ts +64 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +61 -0
- package/dist/runner.js.map +1 -0
- package/dist/session-checkpoints.d.ts +6 -0
- package/dist/session-checkpoints.d.ts.map +1 -0
- package/dist/session-checkpoints.js +25 -0
- package/dist/session-checkpoints.js.map +1 -0
- package/dist/specialists-loader.d.ts +22 -0
- package/dist/specialists-loader.d.ts.map +1 -0
- package/dist/specialists-loader.js +38 -0
- package/dist/specialists-loader.js.map +1 -0
- package/dist/tool-display.d.ts +19 -0
- package/dist/tool-display.d.ts.map +1 -0
- package/dist/tool-display.js +57 -0
- package/dist/tool-display.js.map +1 -0
- package/package.json +70 -3
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import type { AgentConfig, ModelAliases, ModelConfig, ProviderName, ToolSandbox } from '@ikarmic/forge-core';
|
|
3
|
+
type ReasoningEffort = NonNullable<ModelConfig['reasoningEffort']>;
|
|
4
|
+
export interface CliOptions {
|
|
5
|
+
task: string | null;
|
|
6
|
+
provider: ProviderName | null;
|
|
7
|
+
model: string | null;
|
|
8
|
+
auto: boolean;
|
|
9
|
+
allowDestructive: boolean;
|
|
10
|
+
cwd: string | null;
|
|
11
|
+
maxIterations: number | null;
|
|
12
|
+
maxDurationMs: number | null;
|
|
13
|
+
/** `--max-cost <usd>`: stop the run once its USD cost reaches this. */
|
|
14
|
+
maxCostUsd: number | null;
|
|
15
|
+
/** `--cheap-model <id>`: same-provider model for read-only exploration steps. */
|
|
16
|
+
cheapModel: string | null;
|
|
17
|
+
/** `--no-cache-prompts`: skip Anthropic prompt-cache breakpoints. */
|
|
18
|
+
noCachePrompts: boolean;
|
|
19
|
+
/** `--architect`: main model plans read-only, `--editor-model` applies the plan. */
|
|
20
|
+
architect: boolean;
|
|
21
|
+
/** `--editor-model <id|alias>`: model that applies the architect plan. */
|
|
22
|
+
editorModel: string | null;
|
|
23
|
+
/** `--editor-reasoning <level>`: reasoning effort for the editor model only (the main model keeps the configured effort). */
|
|
24
|
+
editorReasoning: ReasoningEffort | null;
|
|
25
|
+
/** `--auto-commit`: commit what the agent changed after each run, with a drafted message. */
|
|
26
|
+
autoCommit: boolean;
|
|
27
|
+
/** `--no-dirty-commits`: do not commit your uncommitted work before a run (it is left out of the agent commit). */
|
|
28
|
+
noDirtyCommits: boolean;
|
|
29
|
+
/** `--no-attribute`: do not append "(forge)" to the commit author name. */
|
|
30
|
+
noAttribute: boolean;
|
|
31
|
+
/** `--git-commit-verify`: run pre-commit hooks on Forge commits. */
|
|
32
|
+
gitCommitVerify: boolean;
|
|
33
|
+
/** `--map-tokens <n>`: put a ranked repo map of about this many tokens in the system prompt (null/0 = off). */
|
|
34
|
+
mapTokens: number | null;
|
|
35
|
+
/** `--auto-lint`: syntax-check each file the agent writes and feed problems back. */
|
|
36
|
+
autoLint: boolean;
|
|
37
|
+
/** `--lint-cmd [ext:] <cmd>` (repeatable), parsed by extension (`*` = any file); implies auto-lint. */
|
|
38
|
+
lintCommands: Record<string, string>;
|
|
39
|
+
/** `--verify <cmd>` (repeatable): checks run after edits; failures are fed back to the model. */
|
|
40
|
+
verify: string[];
|
|
41
|
+
/** `--verify-lsp`: also feed language-server errors for edited files back to the model. */
|
|
42
|
+
verifyLsp: boolean;
|
|
43
|
+
/** `--confirm-reads`: ask before read-only tools too (they are approved without a prompt by default). */
|
|
44
|
+
confirmReads: boolean;
|
|
45
|
+
/** `--dry-run`: the agent may read and search but cannot modify files, run commands or write memory. */
|
|
46
|
+
dryRun: boolean;
|
|
47
|
+
/** `--notifications`: desktop notification when a run finishes. */
|
|
48
|
+
notifications: boolean;
|
|
49
|
+
/** `--notifications-command <cmd>`: run this instead of the OS notifier (message in FORGE_NOTIFY_MESSAGE). */
|
|
50
|
+
notificationsCommand: string | null;
|
|
51
|
+
/** `--ai-comments` (with `forge watch`): act on AI!/AI? comments in saved files. */
|
|
52
|
+
aiComments: boolean;
|
|
53
|
+
/** `--no-project-instructions`: do not inject AGENTS.md / CLAUDE.md / CONVENTIONS.md. */
|
|
54
|
+
noProjectInstructions: boolean;
|
|
55
|
+
/** `--semantic-search`: add the `codebase_search` tool (embedder from FORGE_EMBED_PROVIDER). */
|
|
56
|
+
semanticSearch: boolean;
|
|
57
|
+
/** `--browser`: add the browser / browser_act tools (needs Chrome, Edge or Chromium). */
|
|
58
|
+
browser: boolean;
|
|
59
|
+
/** `--audit`: append every run and tool call to ~/.forge/audit.log. */
|
|
60
|
+
audit: boolean;
|
|
61
|
+
verbose: boolean;
|
|
62
|
+
systemPrompt: string | null;
|
|
63
|
+
json: boolean;
|
|
64
|
+
mcpConfig: string | null;
|
|
65
|
+
/** Disable cost accumulation and display. */
|
|
66
|
+
noCost: boolean;
|
|
67
|
+
/** Disable secret redaction in tool output. */
|
|
68
|
+
noRedact: boolean;
|
|
69
|
+
/** Disable project memory (loading + memory_read / memory_write tools). */
|
|
70
|
+
noMemory: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Plan mode. The agent emits a numbered plan as text and stops, instead
|
|
73
|
+
* of executing tools. One-shot mode prints the plan and exits 0; the
|
|
74
|
+
* REPL prompts the user to approve / edit / cancel.
|
|
75
|
+
*/
|
|
76
|
+
plan: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Spec-driven planning mode, one-shot invocation. Same shape as `plan`
|
|
79
|
+
*: a boolean flag, task comes from the positional argument(s). The
|
|
80
|
+
* agent explores the codebase with read-only tools, then emits
|
|
81
|
+
* requirements.md / design.md / tasks.md as text. Prints the raw text
|
|
82
|
+
* and exits 0: mirrors `--plan`'s one-shot behavior exactly (no
|
|
83
|
+
* interactive approve/edit/cancel outside the REPL, so nothing is
|
|
84
|
+
* written to `.forge/specs/` in one-shot mode; use `/spec` in the REPL
|
|
85
|
+
* for that).
|
|
86
|
+
*/
|
|
87
|
+
spec: boolean;
|
|
88
|
+
/** Enable automatic context compaction. Default off (opt-in). */
|
|
89
|
+
enableCompaction: boolean;
|
|
90
|
+
/** Fraction of model window at which compaction fires. Default 0.7. */
|
|
91
|
+
compactAt: number | null;
|
|
92
|
+
/** Comma-separated tool names to whitelist (e.g. "read_file,list_files,search_files"). */
|
|
93
|
+
allowTools: string | null;
|
|
94
|
+
/** Comma-separated tool names to blacklist (e.g. "run_command,fetch_url"). */
|
|
95
|
+
denyTools: string | null;
|
|
96
|
+
/** Comma-separated glob patterns. File tools may only operate on paths matching one of these. */
|
|
97
|
+
allowPaths: string | null;
|
|
98
|
+
/** Comma-separated glob patterns. File tools refuse paths matching any of these. */
|
|
99
|
+
denyPaths: string | null;
|
|
100
|
+
/** Comma-separated regexes. run_command: command must match at least one. */
|
|
101
|
+
allowCommands: string | null;
|
|
102
|
+
/** Comma-separated regexes. run_command: command must NOT match any. */
|
|
103
|
+
denyCommands: string | null;
|
|
104
|
+
/** Comma-separated regexes. fetch_url: URL must match at least one. */
|
|
105
|
+
allowUrls: string | null;
|
|
106
|
+
/** Comma-separated regexes. fetch_url: URL must NOT match any. */
|
|
107
|
+
denyUrls: string | null;
|
|
108
|
+
/**
|
|
109
|
+
* Structured-output mode. Path to a Zod schema (`.ts` / `.js` /
|
|
110
|
+
* `.mjs`) or a JSON Schema document (`.json`). When set, the agent's
|
|
111
|
+
* final response is validated against the schema and retried on
|
|
112
|
+
* mismatch; in `--json` mode the validated object is the single
|
|
113
|
+
* `data` event.
|
|
114
|
+
*/
|
|
115
|
+
schema: string | null;
|
|
116
|
+
/** Max validation-retry rounds in `--schema` mode. Default 3. */
|
|
117
|
+
schemaRetries: number;
|
|
118
|
+
/** Orchestrator worktree isolation mode. Default 'auto'. */
|
|
119
|
+
orchestratorWorktrees: 'auto' | 'always' | 'never';
|
|
120
|
+
/**
|
|
121
|
+
* v2.14: when the orchestrator removes a specialist's worktree,
|
|
122
|
+
* also delete the auto-created `forge/<label>-<sha>` branch (when
|
|
123
|
+
* no other worktree still uses it). Default true.
|
|
124
|
+
*/
|
|
125
|
+
orchestratorCleanupBranches: boolean;
|
|
126
|
+
/** `--orchestrator-commit`: commit each worktree specialist's edits onto a kept branch for review and merge. */
|
|
127
|
+
orchestratorCommit: boolean;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Build the `forge` commander program. Kept in its own module so tests can
|
|
131
|
+
* poke at parsing without spawning a process.
|
|
132
|
+
*/
|
|
133
|
+
export declare function buildProgram(): Command;
|
|
134
|
+
/**
|
|
135
|
+
* Parse argv into typed options. Model resolution is **lazy**: the caller
|
|
136
|
+
* invokes {@link resolveModelOrThrow} only when an actual model is needed
|
|
137
|
+
* (i.e. when an agent run is about to start). This lets `forge session list`,
|
|
138
|
+
* `forge session show`, etc. work without an AI provider configured.
|
|
139
|
+
*/
|
|
140
|
+
/** `--map-tokens`: a non-negative integer; 0 or absent means off. */
|
|
141
|
+
export declare function parseMapTokens(raw: unknown): number | null;
|
|
142
|
+
/**
|
|
143
|
+
* `--lint-cmd` values into extension -> command. `"ts: eslint"` and `"typescript: eslint"`
|
|
144
|
+
* apply to those files only; a value with no `name:` prefix applies to every file (`*`).
|
|
145
|
+
* A colon not followed by a space (a Windows path) is part of the command.
|
|
146
|
+
*/
|
|
147
|
+
export declare function parseLintCommands(values: string[]): Record<string, string>;
|
|
148
|
+
export declare function parseOptions(argv: string[]): {
|
|
149
|
+
options: CliOptions;
|
|
150
|
+
resolveModel: () => ModelConfig;
|
|
151
|
+
listModels: boolean;
|
|
152
|
+
sessionCommand: ParsedSessionCommand | null;
|
|
153
|
+
skillCommand: ParsedSkillCommand | null;
|
|
154
|
+
pluginCommand: ParsedPluginCommand | null;
|
|
155
|
+
hookCommand: ParsedHookCommand | null;
|
|
156
|
+
mcpCommand: ParsedMcpCommand | null;
|
|
157
|
+
checkpointCommand: ParsedCheckpointCommand | null;
|
|
158
|
+
specCommand: ParsedSpecCommand | null;
|
|
159
|
+
watchCommand: boolean;
|
|
160
|
+
diffCommand: ParsedDiffCommand | null;
|
|
161
|
+
orchestratorCommand: ParsedOrchestratorCommand | null;
|
|
162
|
+
worktreeCommand: ParsedWorktreeCommand | null;
|
|
163
|
+
configCommand: ParsedConfigCommand | null;
|
|
164
|
+
/** `forge acp`: serve the Agent Client Protocol on stdio. */
|
|
165
|
+
acpCommand: boolean;
|
|
166
|
+
/** `forge policy`: print the active organization policy. */
|
|
167
|
+
policyCommand: boolean;
|
|
168
|
+
/** cli package version (for the ACP handshake). */
|
|
169
|
+
version: string;
|
|
170
|
+
};
|
|
171
|
+
/** `forge config`: interactive settings wizard, no subcommands. */
|
|
172
|
+
export interface ParsedConfigCommand {
|
|
173
|
+
run: true;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Rewrite `--model` through the user's aliases (`~/.forge/config.json`).
|
|
177
|
+
* A `provider:` prefix (typed directly or from an alias) also sets the provider. Cheap and
|
|
178
|
+
* editor models are resolved later, against the main model's provider.
|
|
179
|
+
*/
|
|
180
|
+
export declare function applyModelAliases(options: CliOptions, aliases: ModelAliases | undefined): void;
|
|
181
|
+
export type ResumeFlag = {
|
|
182
|
+
kind: 'none';
|
|
183
|
+
} | {
|
|
184
|
+
kind: 'latest';
|
|
185
|
+
} | {
|
|
186
|
+
kind: 'id';
|
|
187
|
+
id: string;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* After commander has parsed, figure out what `--resume` / `session …` the
|
|
191
|
+
* user asked for. Returns `null` if neither flag nor subcommand was used.
|
|
192
|
+
*/
|
|
193
|
+
export interface ParsedSessionCommand {
|
|
194
|
+
resume?: ResumeFlag;
|
|
195
|
+
list?: {
|
|
196
|
+
limit: number;
|
|
197
|
+
};
|
|
198
|
+
show?: {
|
|
199
|
+
id: string;
|
|
200
|
+
full: boolean;
|
|
201
|
+
};
|
|
202
|
+
delete?: string;
|
|
203
|
+
/**
|
|
204
|
+
* `forge session export <id> [--format md|json] [--output path]`.
|
|
205
|
+
* Renders the session as Markdown (default) or JSON for sharing.
|
|
206
|
+
*/
|
|
207
|
+
export?: {
|
|
208
|
+
id: string;
|
|
209
|
+
format: 'md' | 'json';
|
|
210
|
+
output?: string;
|
|
211
|
+
};
|
|
212
|
+
/** `forge session tail <id|latest>`: print the session, then follow it live as another process continues it. */
|
|
213
|
+
tail?: {
|
|
214
|
+
id: string;
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* `forge skill …` subcommand. Soft prefix like `session` so it doesn't
|
|
219
|
+
* collide with positional task arguments.
|
|
220
|
+
*/
|
|
221
|
+
export interface ParsedSkillCommand {
|
|
222
|
+
list?: true;
|
|
223
|
+
show?: {
|
|
224
|
+
name: string;
|
|
225
|
+
};
|
|
226
|
+
install?: {
|
|
227
|
+
url: string;
|
|
228
|
+
overwrite: boolean;
|
|
229
|
+
};
|
|
230
|
+
search?: {
|
|
231
|
+
query: string;
|
|
232
|
+
limit: number | null;
|
|
233
|
+
};
|
|
234
|
+
browse?: true;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* `forge plugin list|show <name>|install <source> [--force] [--project]|remove <name> [--project]`.
|
|
238
|
+
* `<source>` is a local directory, a git URL or `owner/repo`.
|
|
239
|
+
*/
|
|
240
|
+
export interface ParsedPluginCommand {
|
|
241
|
+
list?: true;
|
|
242
|
+
show?: {
|
|
243
|
+
name: string;
|
|
244
|
+
};
|
|
245
|
+
install?: {
|
|
246
|
+
source: string;
|
|
247
|
+
overwrite: boolean;
|
|
248
|
+
project: boolean;
|
|
249
|
+
};
|
|
250
|
+
remove?: {
|
|
251
|
+
name: string;
|
|
252
|
+
project: boolean;
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* `forge hook …` subcommand. Same soft-prefix pattern.
|
|
257
|
+
*/
|
|
258
|
+
export interface ParsedHookCommand {
|
|
259
|
+
list?: true;
|
|
260
|
+
test?: {
|
|
261
|
+
event: string;
|
|
262
|
+
tool?: string;
|
|
263
|
+
};
|
|
264
|
+
log?: {
|
|
265
|
+
limit: number;
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* `forge mcp …` subcommand. Same soft-prefix pattern.
|
|
270
|
+
*/
|
|
271
|
+
export interface ParsedMcpCommand {
|
|
272
|
+
list?: true;
|
|
273
|
+
install?: {
|
|
274
|
+
source: string;
|
|
275
|
+
overwrite: boolean;
|
|
276
|
+
};
|
|
277
|
+
remove?: {
|
|
278
|
+
name: string;
|
|
279
|
+
};
|
|
280
|
+
browse?: true;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* `forge checkpoint …` subcommand.
|
|
284
|
+
*
|
|
285
|
+
* forge checkpoint list [--session <id>] [--limit N]
|
|
286
|
+
* forge checkpoint show <id> [--session <id>]
|
|
287
|
+
* forge checkpoint restore <id> --yes [--session <id>]
|
|
288
|
+
* forge checkpoint prune [--keep N] [--session <id>]
|
|
289
|
+
*/
|
|
290
|
+
export interface ParsedCheckpointCommand {
|
|
291
|
+
list?: {
|
|
292
|
+
limit: number | null;
|
|
293
|
+
};
|
|
294
|
+
show?: {
|
|
295
|
+
id: string;
|
|
296
|
+
};
|
|
297
|
+
restore?: {
|
|
298
|
+
id: string;
|
|
299
|
+
yes: boolean;
|
|
300
|
+
};
|
|
301
|
+
prune?: {
|
|
302
|
+
keep: number | null;
|
|
303
|
+
};
|
|
304
|
+
/** Override the session dir; defaults to the active session. */
|
|
305
|
+
sessionId?: string;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* `forge spec …` subcommand: management of already-approved specs.
|
|
309
|
+
* Generation itself is `--spec "<task>"` (one-shot) or `/spec <task>`
|
|
310
|
+
* (REPL): not a subcommand here, since there's nothing on disk for a
|
|
311
|
+
* standalone "approve" command to act on (approval happens synchronously
|
|
312
|
+
* during interactive review, exactly like `/plan`'s approve/edit/cancel).
|
|
313
|
+
*
|
|
314
|
+
* forge spec list
|
|
315
|
+
* forge spec show <id>
|
|
316
|
+
* forge spec cancel <id> --yes
|
|
317
|
+
*/
|
|
318
|
+
export interface ParsedSpecCommand {
|
|
319
|
+
list?: true;
|
|
320
|
+
show?: {
|
|
321
|
+
id: string;
|
|
322
|
+
};
|
|
323
|
+
cancel?: {
|
|
324
|
+
id: string;
|
|
325
|
+
yes: boolean;
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* `forge orchestrator …` subcommand.
|
|
330
|
+
*
|
|
331
|
+
* forge orchestrator list
|
|
332
|
+
* forge orchestrator run <task...>: full multi-agent dispatch
|
|
333
|
+
* forge orchestrator plan <task...>: preview the routing plan only
|
|
334
|
+
*/
|
|
335
|
+
export interface ParsedOrchestratorCommand {
|
|
336
|
+
list?: true;
|
|
337
|
+
run?: {
|
|
338
|
+
task: string;
|
|
339
|
+
};
|
|
340
|
+
plan?: {
|
|
341
|
+
task: string;
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* `forge diff …` subcommand. Soft prefix like the others so it doesn't
|
|
346
|
+
* collide with positional task arguments.
|
|
347
|
+
*
|
|
348
|
+
* forge diff <fileA> <fileB>
|
|
349
|
+
* forge diff --from-stdin <file>
|
|
350
|
+
* forge diff --context 5 <fileA> <fileB>
|
|
351
|
+
* forge diff --summary <fileA> <fileB>
|
|
352
|
+
*/
|
|
353
|
+
export interface ParsedDiffCommand {
|
|
354
|
+
fileA: string;
|
|
355
|
+
fileB?: string;
|
|
356
|
+
contextLines?: number;
|
|
357
|
+
fromStdin?: boolean;
|
|
358
|
+
summaryOnly?: boolean;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* `forge worktree …` subcommand. v2.11 / v2.14.
|
|
362
|
+
*
|
|
363
|
+
* forge worktree list: show active worktrees
|
|
364
|
+
* forge worktree cleanup [--force] [--with-branches|--no-branches]
|
|
365
|
+
*: remove all of them (prompts)
|
|
366
|
+
* forge worktree prune: remove orphans only (no prompt)
|
|
367
|
+
* forge worktree sweep [--force]: remove + delete orphan branches
|
|
368
|
+
*
|
|
369
|
+
* Doesn't need an AI provider. Mirrors the other soft-prefix subcommands.
|
|
370
|
+
*/
|
|
371
|
+
export interface ParsedWorktreeCommand {
|
|
372
|
+
list?: true;
|
|
373
|
+
cleanup?: {
|
|
374
|
+
force: boolean;
|
|
375
|
+
withBranches: boolean;
|
|
376
|
+
};
|
|
377
|
+
prune?: true;
|
|
378
|
+
sweep?: {
|
|
379
|
+
force: boolean;
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Convert parsed CLI options into an AgentConfig. The approval callback is
|
|
384
|
+
* supplied by the UI layer (it varies between TUI and JSON modes), so it's
|
|
385
|
+
* left as a parameter. `extraTools` (from MCP, sub-agents, etc.) are merged
|
|
386
|
+
* in here.
|
|
387
|
+
*
|
|
388
|
+
* Always loads skills + hooks from disk when not opted out. Skills are
|
|
389
|
+
* scanned from `<cwd>/skills/`, `<cwd>/.forge/skills/`, `~/.forge/skills/`.
|
|
390
|
+
* Hooks are loaded from `~/.forge/settings.json` + `<cwd>/.forge/settings.json`.
|
|
391
|
+
*/
|
|
392
|
+
export declare function toAgentConfig(options: CliOptions, model: ModelConfig, approve: AgentConfig['approve'], extraTools?: AgentConfig['extraTools']): Promise<AgentConfig>;
|
|
393
|
+
/**
|
|
394
|
+
* Build a {@link ToolSandbox} from CLI flags. Returns undefined when no
|
|
395
|
+
* sandbox-related flag was supplied (so the agent runs unrestricted).
|
|
396
|
+
*
|
|
397
|
+
* Per-tool policies are layered on top of the path/command/url lists: any
|
|
398
|
+
* field that matches a file tool gets the path policy; run_command gets
|
|
399
|
+
* both the path policy (so --allow-paths/--deny-paths also cover it) and
|
|
400
|
+
* the command policy; fetch_url gets the URL policy. This keeps the CLI
|
|
401
|
+
* surface small while letting users do most of what they'd want.
|
|
402
|
+
*/
|
|
403
|
+
export declare function buildSandbox(options: CliOptions): ToolSandbox | undefined;
|
|
404
|
+
/** Tools that change anything outside the process; denied under `--dry-run`. */
|
|
405
|
+
export declare const DRY_RUN_DENIED_TOOLS: string[];
|
|
406
|
+
export {};
|
|
407
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAoB5C,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY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