forge-ai-assist 1.0.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/README.md +59 -0
- package/dist/assets/copilot/agent.md +24 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +20 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/analyze.d.ts +10 -0
- package/dist/commands/analyze.js +33 -0
- package/dist/commands/analyze.js.map +1 -0
- package/dist/commands/bootstrap.d.ts +13 -0
- package/dist/commands/bootstrap.js +39 -0
- package/dist/commands/bootstrap.js.map +1 -0
- package/dist/commands/install-assistants.d.ts +6 -0
- package/dist/commands/install-assistants.js +46 -0
- package/dist/commands/install-assistants.js.map +1 -0
- package/dist/commands/install-copilot.d.ts +7 -0
- package/dist/commands/install-copilot.js +30 -0
- package/dist/commands/install-copilot.js.map +1 -0
- package/dist/commands/plan.d.ts +13 -0
- package/dist/commands/plan.js +34 -0
- package/dist/commands/plan.js.map +1 -0
- package/dist/config/analysis.d.ts +29 -0
- package/dist/config/analysis.js +30 -0
- package/dist/config/analysis.js.map +1 -0
- package/dist/config/planning.d.ts +16 -0
- package/dist/config/planning.js +17 -0
- package/dist/config/planning.js.map +1 -0
- package/dist/config/sidecar.d.ts +9 -0
- package/dist/config/sidecar.js +10 -0
- package/dist/config/sidecar.js.map +1 -0
- package/dist/contracts/analysis.d.ts +75 -0
- package/dist/contracts/analysis.js +9 -0
- package/dist/contracts/analysis.js.map +1 -0
- package/dist/contracts/assistants.d.ts +38 -0
- package/dist/contracts/assistants.js +5 -0
- package/dist/contracts/assistants.js.map +1 -0
- package/dist/contracts/discussions.d.ts +83 -0
- package/dist/contracts/discussions.js +2 -0
- package/dist/contracts/discussions.js.map +1 -0
- package/dist/contracts/planning.d.ts +65 -0
- package/dist/contracts/planning.js +8 -0
- package/dist/contracts/planning.js.map +1 -0
- package/dist/contracts/summonable-entry.d.ts +47 -0
- package/dist/contracts/summonable-entry.js +10 -0
- package/dist/contracts/summonable-entry.js.map +1 -0
- package/dist/lib/errors.d.ts +35 -0
- package/dist/lib/errors.js +62 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/program.d.ts +2 -0
- package/dist/program.js +67 -0
- package/dist/program.js.map +1 -0
- package/dist/services/analysis/artifacts.d.ts +48 -0
- package/dist/services/analysis/artifacts.js +85 -0
- package/dist/services/analysis/artifacts.js.map +1 -0
- package/dist/services/analysis/assistant-context.d.ts +8 -0
- package/dist/services/analysis/assistant-context.js +60 -0
- package/dist/services/analysis/assistant-context.js.map +1 -0
- package/dist/services/analysis/repository.d.ts +17 -0
- package/dist/services/analysis/repository.js +60 -0
- package/dist/services/analysis/repository.js.map +1 -0
- package/dist/services/analysis/run.d.ts +6 -0
- package/dist/services/analysis/run.js +105 -0
- package/dist/services/analysis/run.js.map +1 -0
- package/dist/services/analysis/stack.d.ts +8 -0
- package/dist/services/analysis/stack.js +71 -0
- package/dist/services/analysis/stack.js.map +1 -0
- package/dist/services/analysis/structure.d.ts +9 -0
- package/dist/services/analysis/structure.js +73 -0
- package/dist/services/analysis/structure.js.map +1 -0
- package/dist/services/assistants/claude.d.ts +29 -0
- package/dist/services/assistants/claude.js +39 -0
- package/dist/services/assistants/claude.js.map +1 -0
- package/dist/services/assistants/codex.d.ts +28 -0
- package/dist/services/assistants/codex.js +37 -0
- package/dist/services/assistants/codex.js.map +1 -0
- package/dist/services/assistants/copilot.d.ts +36 -0
- package/dist/services/assistants/copilot.js +53 -0
- package/dist/services/assistants/copilot.js.map +1 -0
- package/dist/services/assistants/forge-agent.d.ts +1 -0
- package/dist/services/assistants/forge-agent.js +2 -0
- package/dist/services/assistants/forge-agent.js.map +1 -0
- package/dist/services/assistants/gemini.d.ts +28 -0
- package/dist/services/assistants/gemini.js +37 -0
- package/dist/services/assistants/gemini.js.map +1 -0
- package/dist/services/assistants/install.d.ts +28 -0
- package/dist/services/assistants/install.js +157 -0
- package/dist/services/assistants/install.js.map +1 -0
- package/dist/services/assistants/registry.d.ts +43 -0
- package/dist/services/assistants/registry.js +53 -0
- package/dist/services/assistants/registry.js.map +1 -0
- package/dist/services/assistants/render-entry.d.ts +18 -0
- package/dist/services/assistants/render-entry.js +65 -0
- package/dist/services/assistants/render-entry.js.map +1 -0
- package/dist/services/assistants/summonables.d.ts +4 -0
- package/dist/services/assistants/summonables.js +91 -0
- package/dist/services/assistants/summonables.js.map +1 -0
- package/dist/services/discussions/analyze.d.ts +6 -0
- package/dist/services/discussions/analyze.js +92 -0
- package/dist/services/discussions/analyze.js.map +1 -0
- package/dist/services/discussions/artifacts.d.ts +13 -0
- package/dist/services/discussions/artifacts.js +96 -0
- package/dist/services/discussions/artifacts.js.map +1 -0
- package/dist/services/discussions/auth.d.ts +4 -0
- package/dist/services/discussions/auth.js +12 -0
- package/dist/services/discussions/auth.js.map +1 -0
- package/dist/services/discussions/fetch.d.ts +17 -0
- package/dist/services/discussions/fetch.js +154 -0
- package/dist/services/discussions/fetch.js.map +1 -0
- package/dist/services/discussions/filters.d.ts +12 -0
- package/dist/services/discussions/filters.js +106 -0
- package/dist/services/discussions/filters.js.map +1 -0
- package/dist/services/discussions/prepare.d.ts +6 -0
- package/dist/services/discussions/prepare.js +185 -0
- package/dist/services/discussions/prepare.js.map +1 -0
- package/dist/services/discussions/run.d.ts +11 -0
- package/dist/services/discussions/run.js +41 -0
- package/dist/services/discussions/run.js.map +1 -0
- package/dist/services/git.d.ts +39 -0
- package/dist/services/git.js +121 -0
- package/dist/services/git.js.map +1 -0
- package/dist/services/metadata.d.ts +70 -0
- package/dist/services/metadata.js +128 -0
- package/dist/services/metadata.js.map +1 -0
- package/dist/services/planning/artifacts.d.ts +37 -0
- package/dist/services/planning/artifacts.js +131 -0
- package/dist/services/planning/artifacts.js.map +1 -0
- package/dist/services/planning/generator.d.ts +22 -0
- package/dist/services/planning/generator.js +91 -0
- package/dist/services/planning/generator.js.map +1 -0
- package/dist/services/planning/run.d.ts +12 -0
- package/dist/services/planning/run.js +23 -0
- package/dist/services/planning/run.js.map +1 -0
- package/dist/services/sidecar.d.ts +30 -0
- package/dist/services/sidecar.js +42 -0
- package/dist/services/sidecar.js.map +1 -0
- package/package.json +55 -0
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Forge AI Assist
|
|
2
|
+
|
|
3
|
+
Forge installs GitHub Copilot summonables and runs Forge-managed GitHub Discussions workflows from a local repository.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Run Forge directly without a global install:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx forge-ai-assist@latest
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
After installation, Copilot should discover:
|
|
14
|
+
|
|
15
|
+
- `forge-agent`
|
|
16
|
+
- `forge-discussion-analyzer`
|
|
17
|
+
|
|
18
|
+
The published binary name is:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
forge
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Local Development
|
|
25
|
+
|
|
26
|
+
From this repository:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install
|
|
30
|
+
npm run build
|
|
31
|
+
npm link
|
|
32
|
+
forge
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## GitHub Discussions
|
|
36
|
+
|
|
37
|
+
Forge's discussions workflows require either `GH_TOKEN` or `GITHUB_TOKEN`:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
export GH_TOKEN="$(gh auth token)"
|
|
41
|
+
forge --fetch-discussions --when today
|
|
42
|
+
forge --run-summonable forge-discussion-analyzer --question "What recurring issues show up this week?"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Updating
|
|
46
|
+
|
|
47
|
+
To use the latest published version:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npx forge-ai-assist@latest
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
To confirm the installed CLI version:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
forge --version
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Maintainer release steps live in [docs/releasing.md](/Users/ajitg/workspace/forge/docs/releasing.md).
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# GitHub Copilot Forge Agent
|
|
2
|
+
|
|
3
|
+
You are a repository planning agent that uses the Forge CLI to analyze and plan changes.
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
### /plan
|
|
8
|
+
Invoke this command to generate a structured action plan for the current repository.
|
|
9
|
+
|
|
10
|
+
## Capabilities
|
|
11
|
+
- **Repository Analysis**: Uses Forge to understand the tech stack and structure.
|
|
12
|
+
- **Actionable Plans**: Provides a step-by-step list of changes to implement.
|
|
13
|
+
- **Context-Aware**: Grounds recommendations in observed facts from the codebase.
|
|
14
|
+
|
|
15
|
+
## Interaction Model
|
|
16
|
+
When a user summons `/plan`, you will:
|
|
17
|
+
1. Run `forge analyze` to gather repository facts.
|
|
18
|
+
2. Run `forge plan` (via the planning engine) to generate recommendations.
|
|
19
|
+
3. Present the plan as a clear list of implementation steps.
|
|
20
|
+
|
|
21
|
+
## Principles
|
|
22
|
+
- **Accuracy First**: Only suggest actions backed by analysis.
|
|
23
|
+
- **Atomic Changes**: Break complex tasks into small, verifiable steps.
|
|
24
|
+
- **Tool-Driven**: Leverage Forge's structured output for consistency.
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createProgram } from "./program.js";
|
|
3
|
+
import { UserFacingError } from "./lib/errors.js";
|
|
4
|
+
async function main() {
|
|
5
|
+
const program = await createProgram();
|
|
6
|
+
await program.parseAsync(process.argv);
|
|
7
|
+
}
|
|
8
|
+
try {
|
|
9
|
+
await main();
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
if (error instanceof UserFacingError) {
|
|
13
|
+
console.error(error.message);
|
|
14
|
+
process.exitCode = 1;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
throw error;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,GAAG,MAAM,aAAa,EAAE,CAAC;IACtC,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,IAAI,CAAC;IACH,MAAM,IAAI,EAAE,CAAC;AACf,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACf,IAAI,KAAK,YAAY,eAAe,EAAE,CAAC;QACrC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC7B,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;SAAM,CAAC;QACN,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handles the repository analysis command.
|
|
3
|
+
*
|
|
4
|
+
* Performs an end-to-end analysis of the repository:
|
|
5
|
+
* 1. Confirms the current directory is within a Git repository.
|
|
6
|
+
* 2. Initializes or reuses the Forge sidecar.
|
|
7
|
+
* 3. Runs the analysis service (facts + recommendations).
|
|
8
|
+
* 4. Persists results and prints a summary.
|
|
9
|
+
*/
|
|
10
|
+
export declare function analyzeCommand(): Promise<void>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { git } from "../services/git.js";
|
|
2
|
+
import { runAnalysis } from "../services/analysis/run.js";
|
|
3
|
+
import { initializeSidecar } from "../services/sidecar.js";
|
|
4
|
+
import { deriveAnalysisPaths } from "../services/analysis/artifacts.js";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
/**
|
|
7
|
+
* Handles the repository analysis command.
|
|
8
|
+
*
|
|
9
|
+
* Performs an end-to-end analysis of the repository:
|
|
10
|
+
* 1. Confirms the current directory is within a Git repository.
|
|
11
|
+
* 2. Initializes or reuses the Forge sidecar.
|
|
12
|
+
* 3. Runs the analysis service (facts + recommendations).
|
|
13
|
+
* 4. Persists results and prints a summary.
|
|
14
|
+
*/
|
|
15
|
+
export async function analyzeCommand() {
|
|
16
|
+
// 1. Resolve the Git root (throws RepositoryRequiredError if not in a repo)
|
|
17
|
+
const repoRoot = await git.getRepoRoot();
|
|
18
|
+
// 2. Initialize the Forge sidecar (ensures directory exists)
|
|
19
|
+
const sidecar = await initializeSidecar(repoRoot);
|
|
20
|
+
// 3. Run analysis
|
|
21
|
+
console.log("Analyzing repository...");
|
|
22
|
+
const run = await runAnalysis(repoRoot);
|
|
23
|
+
// 4. Derive paths for reporting
|
|
24
|
+
const paths = deriveAnalysisPaths(sidecar);
|
|
25
|
+
const summaryPath = path.join(paths.base, "SUMMARY.md");
|
|
26
|
+
// 5. Print status summary
|
|
27
|
+
console.log("Analysis complete.");
|
|
28
|
+
console.log(`- ID: ${run.id}`);
|
|
29
|
+
console.log(`- Findings: ${run.recommendations.length} recommendations`);
|
|
30
|
+
console.log(`- Review summary: ${summaryPath}`);
|
|
31
|
+
console.log(`- Machine payload: ${paths.latest}`);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=analyze.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze.js","sourceRoot":"","sources":["../../src/commands/analyze.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,4EAA4E;IAC5E,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,WAAW,EAAE,CAAC;IAEzC,6DAA6D;IAC7D,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAElD,kBAAkB;IAClB,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,MAAM,GAAG,GAAG,MAAM,WAAW,CAAC,QAAQ,CAAC,CAAC;IAExC,gCAAgC;IAChC,MAAM,KAAK,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAExD,0BAA0B;IAC1B,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAClC,OAAO,CAAC,GAAG,CAAC,SAAS,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;IAC/B,OAAO,CAAC,GAAG,CAAC,eAAe,GAAG,CAAC,eAAe,CAAC,MAAM,kBAAkB,CAAC,CAAC;IACzE,OAAO,CAAC,GAAG,CAAC,qBAAqB,WAAW,EAAE,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,sBAAsB,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handles the repository bootstrap command.
|
|
3
|
+
*
|
|
4
|
+
* Performs the initial repository setup for Forge:
|
|
5
|
+
* 1. Confirms the current directory is within a Git repository.
|
|
6
|
+
* 2. Initializes or reuses the Forge sidecar directory (.forge).
|
|
7
|
+
* 3. Records the bootstrap run in metadata history.
|
|
8
|
+
* 4. Prints a concise success summary.
|
|
9
|
+
*
|
|
10
|
+
* This command respects the sidecar-only boundary and does not modify
|
|
11
|
+
* the host repository outside the .forge directory.
|
|
12
|
+
*/
|
|
13
|
+
export declare function bootstrapCommand(): Promise<void>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { git } from "../services/git.js";
|
|
2
|
+
import { initializeSidecar } from "../services/sidecar.js";
|
|
3
|
+
import { writeMetadata } from "../services/metadata.js";
|
|
4
|
+
/**
|
|
5
|
+
* Handles the repository bootstrap command.
|
|
6
|
+
*
|
|
7
|
+
* Performs the initial repository setup for Forge:
|
|
8
|
+
* 1. Confirms the current directory is within a Git repository.
|
|
9
|
+
* 2. Initializes or reuses the Forge sidecar directory (.forge).
|
|
10
|
+
* 3. Records the bootstrap run in metadata history.
|
|
11
|
+
* 4. Prints a concise success summary.
|
|
12
|
+
*
|
|
13
|
+
* This command respects the sidecar-only boundary and does not modify
|
|
14
|
+
* the host repository outside the .forge directory.
|
|
15
|
+
*/
|
|
16
|
+
export async function bootstrapCommand() {
|
|
17
|
+
// 1. Resolve the Git root (throws RepositoryRequiredError if not in a repo)
|
|
18
|
+
const repoRoot = await git.getRepoRoot();
|
|
19
|
+
// 2. Initialize the Forge sidecar (ensures directory exists)
|
|
20
|
+
const { sidecarPath, metadataPath, metadata } = await initializeSidecar(repoRoot);
|
|
21
|
+
// 3. Populate bootstrap-specific metadata and record history
|
|
22
|
+
const now = new Date().toISOString();
|
|
23
|
+
metadata.bootstrap = {
|
|
24
|
+
completedAt: now,
|
|
25
|
+
repoRootPath: repoRoot,
|
|
26
|
+
};
|
|
27
|
+
metadata.history.push({
|
|
28
|
+
type: "bootstrap",
|
|
29
|
+
timestamp: now,
|
|
30
|
+
});
|
|
31
|
+
// Ensure metadata updates are persisted
|
|
32
|
+
await writeMetadata(metadataPath, metadata);
|
|
33
|
+
// 4. Print status summary
|
|
34
|
+
console.log("Forge repository bootstrap successful.");
|
|
35
|
+
console.log(`- Repository: ${repoRoot}`);
|
|
36
|
+
console.log(`- Sidecar: ${sidecarPath}`);
|
|
37
|
+
console.log(`- Metadata: v${metadata.version}`);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../src/commands/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,4EAA4E;IAC5E,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,WAAW,EAAE,CAAC;IAEzC,6DAA6D;IAC7D,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,MAAM,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAElF,6DAA6D;IAC7D,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAErC,QAAQ,CAAC,SAAS,GAAG;QACnB,WAAW,EAAE,GAAG;QAChB,YAAY,EAAE,QAAQ;KACvB,CAAC;IAEF,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;QACpB,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,GAAG;KACf,CAAC,CAAC;IAEH,wCAAwC;IACxC,MAAM,aAAa,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAE5C,0BAA0B;IAC1B,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,iBAAiB,QAAQ,EAAE,CAAC,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,cAAc,WAAW,EAAE,CAAC,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,gBAAgB,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handles the CLI surface for installing the currently exposed Copilot summonables.
|
|
3
|
+
*
|
|
4
|
+
* Other assistant adapters remain in the codebase but are not exposed in the user-facing CLI yet.
|
|
5
|
+
*/
|
|
6
|
+
export declare function installAssistantsCommand(cwd: string): Promise<void>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { assistantInstallService } from '../services/assistants/install.js';
|
|
2
|
+
/**
|
|
3
|
+
* Handles the CLI surface for installing the currently exposed Copilot summonables.
|
|
4
|
+
*
|
|
5
|
+
* Other assistant adapters remain in the codebase but are not exposed in the user-facing CLI yet.
|
|
6
|
+
*/
|
|
7
|
+
export async function installAssistantsCommand(cwd) {
|
|
8
|
+
try {
|
|
9
|
+
const requestedAssistants = ['copilot'];
|
|
10
|
+
console.log('Installing Forge Copilot summonables...');
|
|
11
|
+
const results = await assistantInstallService.installDefaultSummonables(cwd, requestedAssistants);
|
|
12
|
+
console.log('\nAssistant Status Summary:');
|
|
13
|
+
console.log('-------------------------');
|
|
14
|
+
let hasSuccess = false;
|
|
15
|
+
for (const result of results) {
|
|
16
|
+
const statusIcon = getStatusIcon(result.status);
|
|
17
|
+
console.log(`${statusIcon} ${result.id.padEnd(10)}: ${result.message}`);
|
|
18
|
+
if (result.status === 'success' || result.status === 'skipped') {
|
|
19
|
+
hasSuccess = true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (hasSuccess) {
|
|
23
|
+
console.log('\nSuccess! Forge Copilot summonables are ready.');
|
|
24
|
+
console.log('You can now use Copilot /agent with forge-discussion-analyzer.');
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
console.log('\nCopilot summonables were not installed or updated. Check the status messages above.');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Maps operation status to a user-friendly CLI icon.
|
|
36
|
+
*/
|
|
37
|
+
function getStatusIcon(status) {
|
|
38
|
+
switch (status) {
|
|
39
|
+
case 'success': return '✅';
|
|
40
|
+
case 'skipped': return '⏭️ ';
|
|
41
|
+
case 'no-op': return '➖';
|
|
42
|
+
case 'failed': return '❌';
|
|
43
|
+
default: return '❓';
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=install-assistants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-assistants.js","sourceRoot":"","sources":["../../src/commands/install-assistants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAG5E;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,GAAW;IACxD,IAAI,CAAC;QACH,MAAM,mBAAmB,GAAkB,CAAC,SAAS,CAAC,CAAC;QAEvD,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;QAEvD,MAAM,OAAO,GAAG,MAAM,uBAAuB,CAAC,yBAAyB,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;QAElG,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;QAEzC,IAAI,UAAU,GAAG,KAAK,CAAC;QACvB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAChD,OAAO,CAAC,GAAG,CAAC,GAAG,UAAU,IAAI,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;YACxE,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBAC/D,UAAU,GAAG,IAAI,CAAC;YACpB,CAAC;QACH,CAAC;QAED,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,iDAAiD,CAAC,CAAC;YAC/D,OAAO,CAAC,GAAG,CAAC,gEAAgE,CAAC,CAAC;QAChF,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,uFAAuF,CAAC,CAAC;QACvG,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,aAAa,CAAC,MAA0C;IAC/D,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC;QAC3B,KAAK,SAAS,CAAC,CAAC,OAAO,KAAK,CAAC;QAC7B,KAAK,OAAO,CAAC,CAAG,OAAO,GAAG,CAAC;QAC3B,KAAK,QAAQ,CAAC,CAAE,OAAO,GAAG,CAAC;QAC3B,OAAO,CAAC,CAAQ,OAAO,GAAG,CAAC;IAC7B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handles the CLI surface for installing the GitHub Copilot proof.
|
|
3
|
+
*
|
|
4
|
+
* This command exposes a focused path for the Phase 3 proof of concept,
|
|
5
|
+
* allowing users to summon the native /agent workflow.
|
|
6
|
+
*/
|
|
7
|
+
export declare function installCopilotCommand(cwd: string): Promise<void>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { writeFile, mkdir } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { copilotAdapter } from '../services/assistants/copilot.js';
|
|
4
|
+
import { forgeAgentEntry } from '../services/assistants/forge-agent.js';
|
|
5
|
+
/**
|
|
6
|
+
* Handles the CLI surface for installing the GitHub Copilot proof.
|
|
7
|
+
*
|
|
8
|
+
* This command exposes a focused path for the Phase 3 proof of concept,
|
|
9
|
+
* allowing users to summon the native /agent workflow.
|
|
10
|
+
*/
|
|
11
|
+
export async function installCopilotCommand(cwd) {
|
|
12
|
+
try {
|
|
13
|
+
console.log('Installing GitHub Copilot Forge adapter...');
|
|
14
|
+
// Resolve installation target and content
|
|
15
|
+
const targetPath = copilotAdapter.getInstallTarget(cwd, forgeAgentEntry);
|
|
16
|
+
const content = copilotAdapter.render(forgeAgentEntry);
|
|
17
|
+
// Ensure the target directory exists
|
|
18
|
+
await mkdir(path.dirname(targetPath), { recursive: true });
|
|
19
|
+
// Write the native entry asset
|
|
20
|
+
await writeFile(targetPath, content, 'utf8');
|
|
21
|
+
console.log(`Success! GitHub Copilot entrypoint written to: ${targetPath}`);
|
|
22
|
+
console.log('\nYou can now summon the Forge agent in Copilot via:');
|
|
23
|
+
console.log(' /plan - Generate a repository planning draft');
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
console.error('Failed to install GitHub Copilot adapter:', error instanceof Error ? error.message : String(error));
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=install-copilot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-copilot.js","sourceRoot":"","sources":["../../src/commands/install-copilot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,GAAW;IACrD,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;QAE1D,0CAA0C;QAC1C,MAAM,UAAU,GAAG,cAAc,CAAC,gBAAgB,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;QACzE,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QAEvD,qCAAqC;QACrC,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAE3D,+BAA+B;QAC/B,MAAM,SAAS,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAE7C,OAAO,CAAC,GAAG,CAAC,kDAAkD,UAAU,EAAE,CAAC,CAAC;QAC5E,OAAO,CAAC,GAAG,CAAC,sDAAsD,CAAC,CAAC;QACpE,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;IAChE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,2CAA2C,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACnH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handles the planning command.
|
|
3
|
+
*
|
|
4
|
+
* Performs an end-to-end planning run:
|
|
5
|
+
* 1. Confirms the current directory is within a Git repository.
|
|
6
|
+
* 2. Initializes or reuses the Forge sidecar.
|
|
7
|
+
* 3. Runs the planning flow (grounded in latest analysis).
|
|
8
|
+
* 4. Persists results and prints a summary.
|
|
9
|
+
*/
|
|
10
|
+
export declare function planCommand(options: {
|
|
11
|
+
task?: string;
|
|
12
|
+
context?: string;
|
|
13
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { git } from "../services/git.js";
|
|
2
|
+
import { initializeSidecar } from "../services/sidecar.js";
|
|
3
|
+
import { runPlanningFlow } from "../services/planning/run.js";
|
|
4
|
+
import { derivePlanningPaths } from "../services/planning/artifacts.js";
|
|
5
|
+
/**
|
|
6
|
+
* Handles the planning command.
|
|
7
|
+
*
|
|
8
|
+
* Performs an end-to-end planning run:
|
|
9
|
+
* 1. Confirms the current directory is within a Git repository.
|
|
10
|
+
* 2. Initializes or reuses the Forge sidecar.
|
|
11
|
+
* 3. Runs the planning flow (grounded in latest analysis).
|
|
12
|
+
* 4. Persists results and prints a summary.
|
|
13
|
+
*/
|
|
14
|
+
export async function planCommand(options) {
|
|
15
|
+
// 1. Resolve the Git root
|
|
16
|
+
const repoRoot = await git.getRepoRoot();
|
|
17
|
+
// 2. Initialize the Forge sidecar
|
|
18
|
+
const sidecar = await initializeSidecar(repoRoot);
|
|
19
|
+
// 3. Run planning
|
|
20
|
+
console.log("Generating action plan...");
|
|
21
|
+
const summary = await runPlanningFlow(sidecar, {
|
|
22
|
+
task: options.task,
|
|
23
|
+
discussionId: options.context,
|
|
24
|
+
});
|
|
25
|
+
// 4. Derive paths for reporting
|
|
26
|
+
const paths = derivePlanningPaths(sidecar);
|
|
27
|
+
// 5. Print status summary
|
|
28
|
+
console.log("Planning complete.");
|
|
29
|
+
console.log(`- ID: ${summary.id}`);
|
|
30
|
+
console.log(`- Reviewable plan: ${paths.latestMarkdown}`);
|
|
31
|
+
console.log(`- Machine payload: ${paths.latest}`);
|
|
32
|
+
console.log("\nForge has produced reviewable plans and did not mutate repository code automatically.");
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../src/commands/plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAA4C;IAC5E,0BAA0B;IAC1B,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,WAAW,EAAE,CAAC;IAEzC,kCAAkC;IAClC,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAElD,kBAAkB;IAClB,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,MAAM,eAAe,CAAC,OAAO,EAAE;QAC7C,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,YAAY,EAAE,OAAO,CAAC,OAAO;KAC9B,CAAC,CAAC;IAEH,gCAAgC;IAChC,MAAM,KAAK,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAE3C,0BAA0B;IAC1B,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAClC,OAAO,CAAC,GAAG,CAAC,SAAS,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,sBAAsB,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC;IAC1D,OAAO,CAAC,GAAG,CAAC,sBAAsB,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,yFAAyF,CAAC,CAAC;AACzG,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analysis artifact subdirectory within the sidecar.
|
|
3
|
+
*
|
|
4
|
+
* All analysis-related data (historical runs, latest pointers)
|
|
5
|
+
* resides in this subdirectory of the `.forge` sidecar.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ANALYSIS_SUBDIR = "analysis";
|
|
8
|
+
/**
|
|
9
|
+
* Historical runs subdirectory within the analysis subtree.
|
|
10
|
+
*
|
|
11
|
+
* Stores the full AnalysisRun JSON artifacts named by their ID/timestamp.
|
|
12
|
+
*/
|
|
13
|
+
export declare const RUNS_SUBDIR = "runs";
|
|
14
|
+
/**
|
|
15
|
+
* Stable pointer to the latest analysis run artifact.
|
|
16
|
+
*
|
|
17
|
+
* This file (or symlink, conceptually) allows Forge to find the most
|
|
18
|
+
* recent analysis without iterating through the history.
|
|
19
|
+
*/
|
|
20
|
+
export declare const LATEST_RUN_POINTER = "latest.json";
|
|
21
|
+
/**
|
|
22
|
+
* Returns the relative path to the analysis subtree from the sidecar root.
|
|
23
|
+
*/
|
|
24
|
+
export declare const ANALYSIS_PATH = "analysis";
|
|
25
|
+
export declare const DISCUSSIONS_SUBDIR = "discussions";
|
|
26
|
+
export declare const DISCUSSION_RUNS_SUBDIR = "runs";
|
|
27
|
+
export declare const LATEST_DISCUSSIONS_POINTER = "latest.json";
|
|
28
|
+
export declare const DISCUSSION_ANALYSIS_SUBDIR = "analysis";
|
|
29
|
+
export declare const LATEST_DISCUSSION_ANALYSIS_POINTER = "latest.json";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analysis artifact subdirectory within the sidecar.
|
|
3
|
+
*
|
|
4
|
+
* All analysis-related data (historical runs, latest pointers)
|
|
5
|
+
* resides in this subdirectory of the `.forge` sidecar.
|
|
6
|
+
*/
|
|
7
|
+
export const ANALYSIS_SUBDIR = 'analysis';
|
|
8
|
+
/**
|
|
9
|
+
* Historical runs subdirectory within the analysis subtree.
|
|
10
|
+
*
|
|
11
|
+
* Stores the full AnalysisRun JSON artifacts named by their ID/timestamp.
|
|
12
|
+
*/
|
|
13
|
+
export const RUNS_SUBDIR = 'runs';
|
|
14
|
+
/**
|
|
15
|
+
* Stable pointer to the latest analysis run artifact.
|
|
16
|
+
*
|
|
17
|
+
* This file (or symlink, conceptually) allows Forge to find the most
|
|
18
|
+
* recent analysis without iterating through the history.
|
|
19
|
+
*/
|
|
20
|
+
export const LATEST_RUN_POINTER = 'latest.json';
|
|
21
|
+
/**
|
|
22
|
+
* Returns the relative path to the analysis subtree from the sidecar root.
|
|
23
|
+
*/
|
|
24
|
+
export const ANALYSIS_PATH = ANALYSIS_SUBDIR;
|
|
25
|
+
export const DISCUSSIONS_SUBDIR = 'discussions';
|
|
26
|
+
export const DISCUSSION_RUNS_SUBDIR = 'runs';
|
|
27
|
+
export const LATEST_DISCUSSIONS_POINTER = 'latest.json';
|
|
28
|
+
export const DISCUSSION_ANALYSIS_SUBDIR = 'analysis';
|
|
29
|
+
export const LATEST_DISCUSSION_ANALYSIS_POINTER = 'latest.json';
|
|
30
|
+
//# sourceMappingURL=analysis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analysis.js","sourceRoot":"","sources":["../../src/config/analysis.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;AAE1C;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC;AAElC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;AAE7C,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAChD,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAC7C,MAAM,CAAC,MAAM,0BAA0B,GAAG,aAAa,CAAC;AACxD,MAAM,CAAC,MAAM,0BAA0B,GAAG,UAAU,CAAC;AACrD,MAAM,CAAC,MAAM,kCAAkC,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Planning artifact subdirectory within the sidecar.
|
|
3
|
+
*/
|
|
4
|
+
export declare const PLANNING_SUBDIR = "planning";
|
|
5
|
+
/**
|
|
6
|
+
* Historical plans subdirectory within the planning subtree.
|
|
7
|
+
*/
|
|
8
|
+
export declare const PLANS_SUBDIR = "plans";
|
|
9
|
+
/**
|
|
10
|
+
* Stable pointer to the latest plan run artifact.
|
|
11
|
+
*/
|
|
12
|
+
export declare const LATEST_PLAN_POINTER = "latest.json";
|
|
13
|
+
/**
|
|
14
|
+
* Returns the relative path to the planning subtree from the sidecar root.
|
|
15
|
+
*/
|
|
16
|
+
export declare const PLANNING_PATH = "planning";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Planning artifact subdirectory within the sidecar.
|
|
3
|
+
*/
|
|
4
|
+
export const PLANNING_SUBDIR = 'planning';
|
|
5
|
+
/**
|
|
6
|
+
* Historical plans subdirectory within the planning subtree.
|
|
7
|
+
*/
|
|
8
|
+
export const PLANS_SUBDIR = 'plans';
|
|
9
|
+
/**
|
|
10
|
+
* Stable pointer to the latest plan run artifact.
|
|
11
|
+
*/
|
|
12
|
+
export const LATEST_PLAN_POINTER = 'latest.json';
|
|
13
|
+
/**
|
|
14
|
+
* Returns the relative path to the planning subtree from the sidecar root.
|
|
15
|
+
*/
|
|
16
|
+
export const PLANNING_PATH = PLANNING_SUBDIR;
|
|
17
|
+
//# sourceMappingURL=planning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planning.js","sourceRoot":"","sources":["../../src/config/planning.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC;AAEpC;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical Forge sidecar directory name.
|
|
3
|
+
* Every Forge-managed repository contains exactly one such directory.
|
|
4
|
+
*/
|
|
5
|
+
export declare const SIDECAR_DIR_NAME = ".forge";
|
|
6
|
+
/**
|
|
7
|
+
* Metadata filename within the sidecar.
|
|
8
|
+
*/
|
|
9
|
+
export declare const METADATA_FILENAME = "metadata.json";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical Forge sidecar directory name.
|
|
3
|
+
* Every Forge-managed repository contains exactly one such directory.
|
|
4
|
+
*/
|
|
5
|
+
export const SIDECAR_DIR_NAME = '.forge';
|
|
6
|
+
/**
|
|
7
|
+
* Metadata filename within the sidecar.
|
|
8
|
+
*/
|
|
9
|
+
export const METADATA_FILENAME = 'metadata.json';
|
|
10
|
+
//# sourceMappingURL=sidecar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidecar.js","sourceRoot":"","sources":["../../src/config/sidecar.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repository analysis run metadata and durable artifacts.
|
|
3
|
+
*
|
|
4
|
+
* This contract separates observed repository facts from inferred recommendations
|
|
5
|
+
* to ensure that planning logic can distinguish between what is definitively true
|
|
6
|
+
* about the repository and what is suggested by the analysis assistant.
|
|
7
|
+
*/
|
|
8
|
+
export interface RepositoryIdentity {
|
|
9
|
+
name: string;
|
|
10
|
+
remote?: string;
|
|
11
|
+
branch: string;
|
|
12
|
+
commitHash: string;
|
|
13
|
+
}
|
|
14
|
+
export interface TechnologyStack {
|
|
15
|
+
language: string;
|
|
16
|
+
frameworks: string[];
|
|
17
|
+
tools: string[];
|
|
18
|
+
packageManager?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface FileSystemSummary {
|
|
21
|
+
directories: string[];
|
|
22
|
+
criticalFiles: string[];
|
|
23
|
+
entryPoints: string[];
|
|
24
|
+
}
|
|
25
|
+
export interface AssistantContextFindings {
|
|
26
|
+
hasInstructions: boolean;
|
|
27
|
+
hasCustomSkills: boolean;
|
|
28
|
+
instructionsPath?: string;
|
|
29
|
+
availableSkills: string[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Observed Facts: Concrete evidence gathered from the repository.
|
|
33
|
+
*/
|
|
34
|
+
export interface ObservedFacts {
|
|
35
|
+
repository: RepositoryIdentity;
|
|
36
|
+
stack: TechnologyStack;
|
|
37
|
+
structure: FileSystemSummary;
|
|
38
|
+
assistantContext: AssistantContextFindings;
|
|
39
|
+
rawFindings: Record<string, any>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Recommendations: Inferred guidance based on observed facts.
|
|
43
|
+
*/
|
|
44
|
+
export interface Recommendation {
|
|
45
|
+
id: string;
|
|
46
|
+
category: 'architecture' | 'implementation' | 'security' | 'performance' | 'convention';
|
|
47
|
+
priority: 'low' | 'medium' | 'high' | 'critical';
|
|
48
|
+
description: string;
|
|
49
|
+
rationale: string;
|
|
50
|
+
suggestedAction?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* AnalysisRun: The complete durable artifact of a repository analysis session.
|
|
54
|
+
*/
|
|
55
|
+
export interface AnalysisRun {
|
|
56
|
+
/** Schema version for forward/backward compatibility */
|
|
57
|
+
version: '1.0';
|
|
58
|
+
/** Unique identifier for this analysis run (ISO timestamp) */
|
|
59
|
+
id: string;
|
|
60
|
+
/** When the analysis was performed */
|
|
61
|
+
timestamp: string;
|
|
62
|
+
/** Repository facts observed during the run */
|
|
63
|
+
observedFacts: ObservedFacts;
|
|
64
|
+
/** Inferred recommendations based on the observations */
|
|
65
|
+
recommendations: Recommendation[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Summary pointer for metadata indexing.
|
|
69
|
+
*/
|
|
70
|
+
export interface AnalysisRunSummary {
|
|
71
|
+
id: string;
|
|
72
|
+
timestamp: string;
|
|
73
|
+
commitHash: string;
|
|
74
|
+
artifactPath: string;
|
|
75
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repository analysis run metadata and durable artifacts.
|
|
3
|
+
*
|
|
4
|
+
* This contract separates observed repository facts from inferred recommendations
|
|
5
|
+
* to ensure that planning logic can distinguish between what is definitively true
|
|
6
|
+
* about the repository and what is suggested by the analysis assistant.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=analysis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analysis.js","sourceRoot":"","sources":["../../src/contracts/analysis.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported assistant identifiers and capability contracts.
|
|
3
|
+
*/
|
|
4
|
+
export type AssistantId = 'claude' | 'copilot' | 'codex' | 'gemini';
|
|
5
|
+
export interface AssistantCapability {
|
|
6
|
+
/** Unique identifier for the assistant */
|
|
7
|
+
id: AssistantId;
|
|
8
|
+
/** Human-readable name of the assistant */
|
|
9
|
+
name: string;
|
|
10
|
+
/** Whether this assistant is currently supported in the runtime */
|
|
11
|
+
isSupported: boolean;
|
|
12
|
+
/** Primary installation target (e.g., '.github/copilot-instructions.md') */
|
|
13
|
+
installTarget: string;
|
|
14
|
+
}
|
|
15
|
+
export interface AssistantRegistryEntry {
|
|
16
|
+
id: AssistantId;
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
docsUrl?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Result of an assistant availability check.
|
|
23
|
+
*/
|
|
24
|
+
export interface AssistantAvailability {
|
|
25
|
+
id: AssistantId;
|
|
26
|
+
isAvailable: boolean;
|
|
27
|
+
reason?: string;
|
|
28
|
+
requirement?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Result of an assistant installation or update operation.
|
|
32
|
+
*/
|
|
33
|
+
export interface AssistantOperationResult {
|
|
34
|
+
id: AssistantId;
|
|
35
|
+
status: 'success' | 'skipped' | 'failed' | 'no-op';
|
|
36
|
+
message: string;
|
|
37
|
+
filePath?: string;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistants.js","sourceRoot":"","sources":["../../src/contracts/assistants.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|