@ipul-labs/forge 1.14.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +152 -96
  2. package/package.json +14 -22
  3. package/server/forge/core/ForgeAgent.js +42 -15
  4. package/server/forge/core/ForgeAgent.test.js +179 -0
  5. package/server/forge/core/claudeClient.js +27 -5
  6. package/server/forge/core/configStore.js +15 -0
  7. package/server/forge/core/configStore.test.js +89 -0
  8. package/server/forge/core/localRepo.js +4 -2
  9. package/server/forge/core/prompts.js +124 -17
  10. package/server/forge/core/prompts.test.js +219 -0
  11. package/server/forge/core/providers/azuredevops.js +4 -3
  12. package/server/forge/core/providers/github.js +3 -4
  13. package/server/forge/core/providers/gitlab.js +6 -6
  14. package/server/forge/core/validator/clone.js +3 -2
  15. package/server/forge/core/validator.js +3 -2
  16. package/server/forge/routes.js +10 -7
  17. package/dist-lib/favicon.svg +0 -8
  18. package/dist-lib/index.d.ts +0 -1
  19. package/dist-lib/style.css +0 -1
  20. package/dist-lib/ui.d.ts +0 -2
  21. package/dist-lib/ui.js +0 -5946
  22. package/dist-lib/views/Forge/ForgeDashboard.d.ts +0 -6
  23. package/dist-lib/views/Forge/activeJobs.d.ts +0 -29
  24. package/dist-lib/views/Forge/analysisCache.d.ts +0 -64
  25. package/dist-lib/views/Forge/api.d.ts +0 -4
  26. package/dist-lib/views/Forge/components/AnalysisProgress.d.ts +0 -13
  27. package/dist-lib/views/Forge/components/CITerminal.d.ts +0 -44
  28. package/dist-lib/views/Forge/components/DiffViewer.d.ts +0 -37
  29. package/dist-lib/views/Forge/components/ForgeConnect.d.ts +0 -6
  30. package/dist-lib/views/Forge/components/IssueList.d.ts +0 -28
  31. package/dist-lib/views/Forge/components/MRStatus.d.ts +0 -9
  32. package/dist-lib/views/Forge/components/NewTaskModal.d.ts +0 -1
  33. package/dist-lib/views/Forge/components/OpenMRList.d.ts +0 -11
  34. package/dist-lib/views/Forge/components/PipelineStatus.d.ts +0 -12
  35. package/dist-lib/views/Forge/components/PipelinesList.d.ts +0 -9
  36. package/dist-lib/views/Forge/components/RolloutStatus.d.ts +0 -5
  37. package/dist-lib/views/Forge/components/UsageWidget.d.ts +0 -8
  38. package/dist-lib/views/Forge/components/ValidationPanel.d.ts +0 -22
  39. package/dist-lib/views/Forge/context/ForgeProvider.d.ts +0 -23
  40. package/dist-lib/views/Forge/context/ForgeRouterContext.d.ts +0 -22
  41. package/dist-lib/views/Forge/hooks/useConfig.d.ts +0 -54
  42. package/dist-lib/views/Forge/hooks/useForgeDashboard.d.ts +0 -107
  43. package/dist-lib/views/Forge/hooks/useForgeQuota.d.ts +0 -22
  44. package/dist-lib/views/Forge/phases/AnalyzingView.d.ts +0 -1
  45. package/dist-lib/views/Forge/phases/IdleView.d.ts +0 -1
  46. package/dist-lib/views/Forge/phases/MonitoringIssueTab.d.ts +0 -1
  47. package/dist-lib/views/Forge/phases/MonitoringPipelineTab.d.ts +0 -1
  48. package/dist-lib/views/Forge/phases/MonitoringView.d.ts +0 -1
  49. package/dist-lib/views/Forge/phases/ReviewingView.d.ts +0 -1
  50. package/dist-lib/views/Forge/phases/SelectedIssueTab.d.ts +0 -11
  51. package/dist-lib/views/Forge/phases/SelectedMRTab.d.ts +0 -1
  52. package/dist-lib/views/Forge/phases/SelectedView.d.ts +0 -1
  53. package/dist-lib/views/Forge/phases/shared/CloseIssueConfirm.d.ts +0 -1
  54. package/dist-lib/views/Forge/phases/shared/DetailTabs.d.ts +0 -14
  55. package/dist-lib/views/Forge/phases/shared/EnvironmentsPanel.d.ts +0 -9
  56. package/dist-lib/views/Forge/phases/shared/ForgeActivity.d.ts +0 -1
  57. package/dist-lib/views/Forge/phases/shared/IssueHeaderBlock.d.ts +0 -13
  58. package/dist-lib/views/Forge/phases/shared/MergedMRList.d.ts +0 -4
  59. package/dist-lib/views/Forge/phases/shared/PreviousAnalyses.d.ts +0 -1
  60. package/dist-lib/views/Forge/phases/shared/ResolutionCheckPanel.d.ts +0 -6
  61. package/dist-lib/views/Forge/settings/ConnectionRow.d.ts +0 -16
  62. package/dist-lib/views/Forge/settings/ConnectionsSection.d.ts +0 -7
  63. package/dist-lib/views/Forge/settings/DefaultsSection.d.ts +0 -7
  64. package/dist-lib/views/Forge/settings/ReposSection.d.ts +0 -7
  65. package/dist-lib/views/Forge/settings/SettingsView.d.ts +0 -1
  66. package/dist-lib/views/Forge/shell/ConfigBar.d.ts +0 -1
  67. package/dist-lib/views/Forge/shell/ForgeRouter.d.ts +0 -9
  68. package/dist-lib/views/Forge/shell/ForgeShell.d.ts +0 -7
  69. package/dist-lib/views/Forge/shell/Sidebar.d.ts +0 -1
  70. package/dist-lib/views/Forge/shell/SidebarFooterMenu.d.ts +0 -1
  71. package/dist-lib/views/Forge/shell/SidebarNav.d.ts +0 -1
  72. package/dist-lib/views/Forge/shell/SidebarNavItem.d.ts +0 -10
  73. package/dist-lib/views/Forge/shell/TopBar.d.ts +0 -5
  74. package/dist-lib/views/Forge/types.d.ts +0 -235
  75. package/dist-lib/views/Forge/utils.d.ts +0 -11
@@ -1,6 +0,0 @@
1
- interface Props {
2
- popoutUrl?: string;
3
- basePath?: string;
4
- }
5
- export declare function ForgeDashboard({ popoutUrl, basePath }?: Props): import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,29 +0,0 @@
1
- export type ActiveJobType = "analyze" | "refine" | "ci-fix" | "validate";
2
- export interface ActiveJobRecord {
3
- jobId: string;
4
- /** Auxiliary context needed to reconstruct local UI state when the stream
5
- * reconnects. For analyze: submittedPrompt + model + existingMrIid so
6
- * saveAnalysis on `done` can persist the same metadata the original kick
7
- * would have. For refine: ordinal so the hook can auto-restore the right
8
- * analysis entry before subscribing. Empty for types that don't need it. */
9
- meta?: Record<string, unknown>;
10
- }
11
- export declare function setActiveJob(repo: string, iid: number, type: ActiveJobType, record: ActiveJobRecord): void;
12
- export declare function getActiveJob(repo: string, iid: number, type: ActiveJobType): ActiveJobRecord | null;
13
- export declare function clearActiveJob(repo: string, iid: number, type: ActiveJobType): void;
14
- /**
15
- * React hook: returns a reactive map of all active-job records, keyed by their
16
- * sessionStorage key. Derive per-issue views with `getActiveJobsForIssue`.
17
- */
18
- export declare function useActiveJobsMap(): Record<string, ActiveJobRecord>;
19
- /** Pure derivation: types of active jobs for a given (repo, iid). */
20
- export declare function getActiveJobsForIssue(map: Record<string, ActiveJobRecord>, repo: string, iid: number): ActiveJobType[];
21
- export interface JobSnapshot {
22
- id: string;
23
- type: string;
24
- status: "running" | "done" | "error";
25
- createdAt: number;
26
- finishedAt: number | null;
27
- error: string | null;
28
- eventCount: number;
29
- }
@@ -1,64 +0,0 @@
1
- import { AnalysisResult, ValidationState } from './types';
2
- export interface RefineTurn {
3
- feedback: string;
4
- explanation?: string;
5
- /** "refine" = produced new code changes. "answer" = conversational reply,
6
- * no changes. "canceled" = refine was started but never finished (e.g. the
7
- * user reloaded the page mid-stream) — recovered on restore. */
8
- kind?: "answer" | "refine" | "canceled";
9
- /** Snapshot of analysisResult as it was *before* this turn's changes were
10
- * applied. Present only for kind === "refine". Used by the per-turn Undo
11
- * button to restore the previous state. */
12
- prevResult?: AnalysisResult;
13
- }
14
- export interface StoredAnalysis {
15
- id: string;
16
- /** Per-issue 1-indexed ordinal that never shifts — drives the URL route
17
- * `/issues/:iid/analysis/:ordinal`. First analysis is 1, second 2, etc. */
18
- ordinal: number;
19
- result: AnalysisResult;
20
- analyzedAt: string;
21
- repo: string;
22
- model: string;
23
- mrIid?: number;
24
- /** The user-supplied instruction prompt that guided this analysis, if any. */
25
- prompt?: string;
26
- /** Conversation log for this analysis: each refine adds one turn. Restored
27
- * with the analysis so prior Q&A reappears when the user comes back. */
28
- refineThread?: RefineTurn[];
29
- /** Claude CLI session UUID that carries refine turns. Set by the backend on
30
- * the first refine; replayed via `--resume <id>` on subsequent turns so
31
- * Claude keeps its prior reasoning, tool-call history, and prompt cache.
32
- * Cleared by Undo (session would diverge from the rolled-back state) and
33
- * when the whole analysis is discarded. Claude-backend only. */
34
- claudeSessionId?: string;
35
- /** Pre-flight validation state persisted alongside the analysis so the
36
- * lint/typecheck/test rows and stale banner survive reloads and restores. */
37
- validation?: ValidationState;
38
- }
39
- export declare function saveAnalysis(repo: string, issueIid: number, result: AnalysisResult, model: string, mrIid?: number, prompt?: string, refineThread?: RefineTurn[]): StoredAnalysis;
40
- /**
41
- * Updates the most recently saved analysis in-place — used after a refine so
42
- * the same cache entry picks up the new result + conversation turn instead of
43
- * producing a duplicate.
44
- */
45
- export declare function updateLatestAnalysis(repo: string, issueIid: number, patch: Partial<Omit<StoredAnalysis, "id">>): StoredAnalysis | null;
46
- /**
47
- * Updates a specific analysis by its stable per-issue ordinal. Unlike
48
- * updateLatestAnalysis, this writes to the entry the user is actually looking
49
- * at (via currentOrdinal), which matters when restoring an older analysis and
50
- * then running validate — the validation state should attach to that older
51
- * entry, not the most recent one.
52
- */
53
- export declare function updateAnalysisByOrdinal(repo: string, issueIid: number, ordinal: number, patch: Partial<Omit<StoredAnalysis, "id" | "ordinal">>): StoredAnalysis | null;
54
- export declare function loadAnalyses(repo: string, issueIid: number): StoredAnalysis[];
55
- export declare function removeAnalysis(repo: string, issueIid: number, id: string): void;
56
- export declare function clearAnalyses(repo: string, issueIid: number): void;
57
- /**
58
- * Removes every cached analysis — modern `forge:analyses:*` lists plus any
59
- * lingering `forge:analysis:*` legacy single-entry keys. Returns the number
60
- * of issue-caches that were removed so callers can tell the user what was
61
- * cleared (e.g. "Cleared 12 cached analyses.").
62
- */
63
- export declare function clearAllAnalyses(): number;
64
- export declare function formatAnalysisDate(isoString: string): string;
@@ -1,4 +0,0 @@
1
- export declare function getToken(): string;
2
- export declare function setToken(t: string): void;
3
- export declare function clearToken(): void;
4
- export declare function forgeApi<T>(path: string, init?: RequestInit): Promise<T>;
@@ -1,13 +0,0 @@
1
- import { CILogEntry } from '../types';
2
- interface ProgressStep {
3
- step: string;
4
- message: string;
5
- }
6
- interface Props {
7
- steps: ProgressStep[];
8
- logs: CILogEntry[];
9
- issueTitle: string;
10
- mode?: "analyze" | "ci-fix";
11
- }
12
- export declare function AnalysisProgress({ steps, logs, issueTitle, mode }: Props): import("react/jsx-runtime").JSX.Element;
13
- export {};
@@ -1,44 +0,0 @@
1
- /**
2
- * CI-style terminal output renderer.
3
- *
4
- * Renders each line with:
5
- * - a timestamp gutter [HH:MM:SS.mmm]
6
- * - a level icon ℹ / ⚠ / ✖ / ›
7
- * - coloured text based on detected level
8
- *
9
- * Levels are detected heuristically from the line content when not supplied
10
- * explicitly — that keeps callers simple while still reading like a CI log.
11
- */
12
- export interface CILogEntry {
13
- /** ISO timestamp the line was received at. */
14
- ts: string;
15
- /** The raw message text. */
16
- message: string;
17
- /** Optional explicit level; otherwise inferred. */
18
- level?: "info" | "warn" | "error" | "debug" | "success";
19
- }
20
- interface Props {
21
- entries: Array<CILogEntry | string>;
22
- /** Whether to auto-scroll to the newest entry. Default: true. */
23
- autoScroll?: boolean;
24
- /** "embedded" → no outer shell; "panel" → bordered dark panel. Default: panel. */
25
- variant?: "panel" | "embedded";
26
- /** Panel height classes. Default: `min-h-[12rem] max-h-[60vh]`. */
27
- heightClass?: string;
28
- /** Optional header label shown in a top bar (e.g. "analysis" or "pipeline trace"). */
29
- label?: string;
30
- /** Line count badge text (e.g. "3 jobs"). */
31
- badge?: string;
32
- /** Optional element rendered right-aligned in the header. */
33
- headerAccessory?: React.ReactNode;
34
- /** Empty-state message when entries is empty. */
35
- empty?: string;
36
- }
37
- export declare function CITerminal({ entries, autoScroll, variant, heightClass, label, badge, headerAccessory, empty, }: Props): import("react/jsx-runtime").JSX.Element;
38
- /**
39
- * Parses a GitLab/GitHub job trace into structured entries.
40
- * Per-line level is inferred; timestamps use the trace fetch time plus an
41
- * incremental microsecond offset so the order is preserved.
42
- */
43
- export declare function parseTraceToEntries(trace: string, baseTime?: number): CILogEntry[];
44
- export {};
@@ -1,37 +0,0 @@
1
- import { ApplicationResult, ForgeChange } from '../types';
2
- import { RefineTurn } from '../analysisCache';
3
- export type { ForgeChange };
4
- interface Props {
5
- explanation: string;
6
- changes: ForgeChange[];
7
- /** Existing applications (branch + MR) already open for this issue, if any. */
8
- existingApplications?: ApplicationResult[];
9
- /** All repos available in the current session — used to build repo labels. */
10
- availableRepos?: Array<{
11
- id: string;
12
- label: string;
13
- }>;
14
- onApprove: () => void;
15
- onDeployBranch: () => void;
16
- onCommitToBranch?: () => void;
17
- onReject: () => void;
18
- onRefine: (feedback: string) => void;
19
- /** Revert the analysis to the snapshot captured before the given turn. */
20
- onUndoRefine?: (index: number) => void;
21
- /** Conversation log of past refine turns, owned by the hook so it survives
22
- * unmount and can be restored from persisted analyses. */
23
- refineThread?: RefineTurn[];
24
- /** Follow-up prompts submitted while a refine was already running. Shown
25
- * as "Queued" placeholders after the live turn; drained by the hook as
26
- * each turn settles. */
27
- refineQueue?: string[];
28
- /** Live log lines from the in-flight refine subprocess (tool calls, etc.).
29
- * Shown under the "Thinking…" spinner. Empty once the turn settles. */
30
- thinkingLogs?: string[];
31
- applying: boolean;
32
- refining: boolean;
33
- /** Gates the primary action. "idle"=no pre-flight run yet, "running"=in progress,
34
- * "passed"=all checks green, "failed"=some check failed (override exposed). */
35
- validationStatus?: "idle" | "running" | "passed" | "failed";
36
- }
37
- export declare function DiffViewer({ explanation, changes, existingApplications, availableRepos, onApprove, onDeployBranch, onCommitToBranch, onReject, onRefine, onUndoRefine, refineThread, refineQueue, thinkingLogs, applying, refining, validationStatus, }: Props): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +0,0 @@
1
- interface Props {
2
- onConnect: (token: string) => void;
3
- error?: string | null;
4
- }
5
- export declare function ForgeConnect({ onConnect, error }: Props): import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,28 +0,0 @@
1
- import { ActiveJobType } from '../activeJobs';
2
- import { GitLabIssue } from '../types';
3
- export interface IssuePipelineStatus {
4
- status: string;
5
- web_url: string;
6
- }
7
- export interface IssueOpenMr {
8
- iid: number;
9
- web_url: string;
10
- }
11
- interface Props {
12
- issues: GitLabIssue[];
13
- loading: boolean;
14
- onSelect: (issue: GitLabIssue) => void;
15
- onCreate: (title: string, description: string) => Promise<unknown>;
16
- /** Types of background jobs still running per issue iid. Empty or missing
17
- * means no badge; otherwise renders a spinner + human label. */
18
- activeJobsByIid?: Record<number, ActiveJobType[]>;
19
- /** Latest CI pipeline for each issue's Forge MR, if one exists. Drives the
20
- * "pipeline running / failed" badge next to the issue row. */
21
- pipelinesByIid?: Record<number, IssuePipelineStatus>;
22
- /** Open (unmerged) MR for each issue, if one exists. Drives the "MR open"
23
- * badge. Hidden when the issue already shows a merged badge — an MR can't
24
- * be simultaneously open and merged. */
25
- openMrByIid?: Record<number, IssueOpenMr>;
26
- }
27
- export declare function IssueList({ issues, loading, onSelect, onCreate, activeJobsByIid, pipelinesByIid, openMrByIid }: Props): import("react/jsx-runtime").JSX.Element;
28
- export {};
@@ -1,9 +0,0 @@
1
- interface Props {
2
- mrIid: number;
3
- token: string;
4
- repo?: string;
5
- pipelineStatus?: string | null;
6
- onMerged?: () => void;
7
- }
8
- export declare function MRStatus({ mrIid, token, repo, pipelineStatus, onMerged }: Props): import("react/jsx-runtime").JSX.Element;
9
- export {};
@@ -1 +0,0 @@
1
- export declare function NewTaskModal(): import("react/jsx-runtime").JSX.Element | null;
@@ -1,11 +0,0 @@
1
- import { ForgeMRState, ForgeMRSummary } from '../types';
2
- interface Props {
3
- mrs: ForgeMRSummary[];
4
- loading: boolean;
5
- error: string | null;
6
- state?: ForgeMRState;
7
- onSelect: (mr: ForgeMRSummary) => void;
8
- onRefresh: () => void;
9
- }
10
- export declare function OpenMRList({ mrs, loading, error, state, onSelect, onRefresh }: Props): import("react/jsx-runtime").JSX.Element;
11
- export {};
@@ -1,12 +0,0 @@
1
- interface Props {
2
- endpoint: string;
3
- token: string;
4
- repo?: string;
5
- label?: string;
6
- /** Called when the user clicks "Fix with AI". The repo param lets the caller scope the CI fix to the right repository (important in multi-repo mode). */
7
- onRefinePipelineFailure?: (failedJobIds: number[], prompt: string, repo?: string) => void;
8
- /** Fires on every poll with the current pipeline status (or null when not loaded). Lets the parent conditionally render actions like "Approve & Create MR" once the pipeline is green. */
9
- onStatusChange?: (status: string | null) => void;
10
- }
11
- export declare function PipelineStatus({ endpoint, token, repo, onRefinePipelineFailure, onStatusChange, }: Props): import("react/jsx-runtime").JSX.Element;
12
- export {};
@@ -1,9 +0,0 @@
1
- import { ForgeMRSummary } from '../types';
2
- interface Props {
3
- mrs: ForgeMRSummary[];
4
- loading: boolean;
5
- error: string | null;
6
- onRefresh: () => void;
7
- }
8
- export declare function PipelinesList({ mrs, loading, error, onRefresh }: Props): import("react/jsx-runtime").JSX.Element;
9
- export {};
@@ -1,5 +0,0 @@
1
- interface Props {
2
- token: string;
3
- }
4
- export declare function RolloutStatus({ token }: Props): import("react/jsx-runtime").JSX.Element;
5
- export {};
@@ -1,8 +0,0 @@
1
- import { ForgeAgentBackend, ForgeModel, ForgeUsage } from '../types';
2
- interface Props {
3
- usage: ForgeUsage;
4
- selectedModel: ForgeModel | undefined;
5
- agent?: ForgeAgentBackend;
6
- }
7
- export declare function UsageWidget({ usage, selectedModel, agent }: Props): import("react/jsx-runtime").JSX.Element;
8
- export {};
@@ -1,22 +0,0 @@
1
- import { ValidationState, ValidationStepKey } from '../types';
2
- interface Props {
3
- state: ValidationState;
4
- validating: boolean;
5
- error: string | null;
6
- onValidate: () => void;
7
- /** Optional: called when the user clicks "Fix with AI" on a failing row.
8
- * The panel passes the step key + that step's captured tail so the caller
9
- * can feed it into the refine loop. */
10
- onFixStep?: (step: ValidationStepKey, tail: string | undefined) => void;
11
- /** When true, the panel renders a spinner on the failing row whose step
12
- * was just sent back through refine (caller manages the one-at-a-time UX). */
13
- fixingStep?: ValidationStepKey | null;
14
- /** Toggle: if true, any green validation auto-commits (push to branch or
15
- * open a new MR, depending on whether the branch already exists). */
16
- autoPushOnPass?: boolean;
17
- onToggleAutoPush?: (on: boolean) => void;
18
- /** Rendered at the bottom so the user can explicitly override a failed check. */
19
- children?: React.ReactNode;
20
- }
21
- export declare function ValidationPanel({ state, validating, error, onValidate, onFixStep, fixingStep, autoPushOnPass, onToggleAutoPush, children, }: Props): import("react/jsx-runtime").JSX.Element;
22
- export {};
@@ -1,23 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { useForgeDashboard } from '../hooks/useForgeDashboard';
3
- type Hook = ReturnType<typeof useForgeDashboard>;
4
- declare const ACTION_KEYS: readonly ["setPhase", "setAnalysisPrompt", "setAutoPushOnValidatePass", "setSelectedModel", "setSelectedAgent", "setSelectedRepo", "setSelectedSecondaryRepos", "handleConnect", "reloadStatus", "handleSelectMR", "handleCreateIssue", "handleUpdateIssue", "handleSelectIssue", "handleBeginAnalysis", "handleCancelAnalysis", "handleApprove", "handleDeployBranch", "handlePromoteBranch", "handleCommitToBranch", "handleReject", "handleRefine", "handleUndoRefine", "handleRefinePipelineFailure", "handleCheckResolution", "handleRestoreAnalysis", "restoreAnalysisByOrdinal", "handleDiscardStoredAnalysis", "handleClearIssueCache", "handleDestroyAllAnalyses", "handleViewExistingMr", "handleCloseIssue", "clearCloseError", "handleBackToIssue", "handleReset", "handleDisconnect", "refreshQuota", "handleValidate", "handleFixValidation", "loadIssues", "loadOpenMRs", "formatAnalysisDate", "getToken", "retryBackend"];
5
- type ActionKey = (typeof ACTION_KEYS)[number];
6
- export type ForgeActions = Pick<Hook, ActionKey>;
7
- export type ForgeState = Omit<Hook, ActionKey>;
8
- export type DetailTab = "issue" | "mr";
9
- export interface ForgeUI {
10
- activeDetailTab: DetailTab;
11
- setActiveDetailTab: (t: DetailTab) => void;
12
- mrMerged: boolean;
13
- setMrMerged: (b: boolean) => void;
14
- taskModalOpen: boolean;
15
- setTaskModalOpen: (b: boolean) => void;
16
- }
17
- export declare function ForgeProvider({ children }: {
18
- children: ReactNode;
19
- }): import("react/jsx-runtime").JSX.Element;
20
- export declare const useForgeState: () => ForgeState;
21
- export declare const useForgeActions: () => ForgeActions;
22
- export declare const useForgeUI: () => ForgeUI;
23
- export {};
@@ -1,22 +0,0 @@
1
- import { ReactNode } from 'react';
2
- interface ForgeRouterValue {
3
- /** Navigate to a forge-internal path (e.g. "/issues/42"). */
4
- navigate: (to: string, opts?: {
5
- replace?: boolean;
6
- }) => void;
7
- /** The current pathname with the basePath stripped. */
8
- pathname: string;
9
- /** The basePath prefix (e.g. "/settings/admin/forge"). */
10
- basePath: string;
11
- }
12
- /**
13
- * Provides a scoped navigate/pathname that automatically prepends/strips
14
- * `basePath`. This lets ForgeDashboard work at any mount point without
15
- * changing its internal paths (e.g. "/issues", "/settings").
16
- */
17
- export declare function ForgeRouterProvider({ basePath, children, }: {
18
- basePath?: string;
19
- children: ReactNode;
20
- }): import("react/jsx-runtime").JSX.Element;
21
- export declare function useForgeRouter(): ForgeRouterValue;
22
- export {};
@@ -1,54 +0,0 @@
1
- import { ForgeRepo } from '../types';
2
- export type TokenSource = "config" | "env" | "none";
3
- export interface PublicConnection {
4
- hasToken: boolean;
5
- tokenHint: string;
6
- tokenSource: TokenSource;
7
- }
8
- export interface ForgeConfig {
9
- repos: ForgeRepo[];
10
- defaults: {
11
- model: string | null;
12
- agent: string | null;
13
- autoPushOnValidatePass: boolean;
14
- /** When true, Refine gets Read/Glob/Grep over a local clone of the primary repo. */
15
- refineRepoAccess: boolean;
16
- /** Blank = no link. Supports "{branch}" / "{slug}" placeholders. */
17
- testDeployUrlTemplate: string;
18
- };
19
- connections: {
20
- gitlab: PublicConnection & {
21
- baseUrl: string;
22
- };
23
- github: PublicConnection;
24
- azuredevops: PublicConnection;
25
- };
26
- }
27
- export interface ConnectionPatch {
28
- baseUrl?: string;
29
- /**
30
- * Plain-text token. Omit to leave the stored value untouched; send an empty
31
- * string to clear. Never read back in the GET response.
32
- */
33
- token?: string;
34
- }
35
- export type ConfigPatch = Partial<{
36
- repos: ForgeRepo[];
37
- defaults: Partial<ForgeConfig["defaults"]>;
38
- connections: Partial<{
39
- gitlab: ConnectionPatch;
40
- github: ConnectionPatch;
41
- azuredevops: ConnectionPatch;
42
- }>;
43
- }>;
44
- /**
45
- * Loads `/api/forge/config` once on mount and exposes a `patch()` that PUTs a
46
- * delta and updates local state with the server's echoed result.
47
- */
48
- export declare function useConfig(): {
49
- config: ForgeConfig | null;
50
- loading: boolean;
51
- error: string | null;
52
- reload: () => Promise<void>;
53
- patch: (delta: ConfigPatch) => Promise<ForgeConfig>;
54
- };
@@ -1,107 +0,0 @@
1
- import { getToken } from '../api';
2
- import { formatAnalysisDate, RefineTurn, StoredAnalysis } from '../analysisCache';
3
- import { AnalysisResult, ApplicationResult, ApplyResult, CILogEntry, ForgeAgentBackend, ForgeEnvironment, ForgeMRSummary, ForgeModel, ForgeRateLimit, ForgeRepo, GitLabIssue, MergedMR, Phase, ProgressStep, ResolutionCheck, ValidationState } from '../types';
4
- export type AnalysisMode = "analyze" | "ci-fix";
5
- export declare function useForgeDashboard(): {
6
- phase: Phase;
7
- setPhase: import('react').Dispatch<import('react').SetStateAction<Phase>>;
8
- connectError: string | null;
9
- issues: GitLabIssue[];
10
- issuesLoading: boolean;
11
- issuesError: string | null;
12
- selectedIssue: GitLabIssue | null;
13
- progressSteps: ProgressStep[];
14
- analysisLogs: CILogEntry[];
15
- analysisResult: AnalysisResult | null;
16
- analysisError: string | null;
17
- applying: boolean;
18
- applyResult: ApplyResult | null;
19
- applyError: string | null;
20
- refining: boolean;
21
- analysisMode: AnalysisMode;
22
- analysisPrompt: string;
23
- setAnalysisPrompt: import('react').Dispatch<import('react').SetStateAction<string>>;
24
- usage: import('../types').ForgeUsage;
25
- existingMr: ({
26
- iid: number;
27
- web_url: string;
28
- title: string;
29
- } & {
30
- branchName: string;
31
- }) | null;
32
- existingMrLoading: boolean;
33
- mergedMrs: MergedMR[];
34
- issueEnvironments: ForgeEnvironment[];
35
- issueEnvironmentsLoading: boolean;
36
- openMRs: ForgeMRSummary[];
37
- openMRsLoading: boolean;
38
- openMRsError: string | null;
39
- storedAnalyses: StoredAnalysis[];
40
- currentOrdinal: number | null;
41
- handleRestoreAnalysis: (id: string) => void;
42
- restoreAnalysisByOrdinal: (ordinal: number, issueIid?: number) => boolean;
43
- handleDiscardStoredAnalysis: (id: string) => void;
44
- handleClearIssueCache: () => void;
45
- handleDestroyAllAnalyses: () => number;
46
- handleUndoRefine: (index: number) => void;
47
- formatAnalysisDate: typeof formatAnalysisDate;
48
- handleConnect: (token: string) => Promise<void>;
49
- reloadStatus: () => Promise<void>;
50
- loadIssues: () => Promise<void>;
51
- loadOpenMRs: (state?: "open" | "merged" | "closed") => Promise<void>;
52
- handleSelectMR: (mr: ForgeMRSummary) => void;
53
- handleCreateIssue: (title: string, description: string) => Promise<GitLabIssue>;
54
- handleUpdateIssue: (title: string, description: string) => Promise<void>;
55
- handleSelectIssue: (issue: GitLabIssue) => void;
56
- handleBeginAnalysis: () => Promise<void>;
57
- handleCancelAnalysis: () => Promise<void>;
58
- handleApprove: () => Promise<void>;
59
- handleDeployBranch: () => Promise<void>;
60
- handlePromoteBranch: (app: ApplicationResult) => Promise<void>;
61
- handleCommitToBranch: () => Promise<void>;
62
- handleReject: () => void;
63
- handleRefine: (feedback: string) => Promise<void>;
64
- handleRefinePipelineFailure: (failedJobIds: number[], prompt: string, sourceRepo?: string) => Promise<void>;
65
- handleCheckResolution: () => Promise<void>;
66
- resolutionCheck: ResolutionCheck | null;
67
- resolutionChecking: boolean;
68
- resolutionError: string | null;
69
- handleViewExistingMr: () => void;
70
- handleCloseIssue: () => Promise<void>;
71
- closeError: string | null;
72
- clearCloseError: () => void;
73
- handleBackToIssue: () => void;
74
- handleReset: () => void;
75
- handleDisconnect: () => void;
76
- availableRepos: ForgeRepo[];
77
- selectedRepo: string;
78
- setSelectedRepo: (repo: string) => void;
79
- selectedSecondaryRepos: string[];
80
- setSelectedSecondaryRepos: (repos: string[]) => void;
81
- testDeployUrlTemplate: string | null;
82
- availableModels: ForgeModel[];
83
- selectedModel: string;
84
- setSelectedModel: (m: string) => void;
85
- availableAgents: ForgeAgentBackend[];
86
- selectedAgent: string;
87
- setSelectedAgent: (a: string) => void;
88
- rateLimit: ForgeRateLimit | null;
89
- quotaLoading: boolean;
90
- quotaError: string | null;
91
- quotaCheckedAt: string | null;
92
- refreshQuota: () => Promise<void>;
93
- validating: boolean;
94
- validationError: string | null;
95
- validation: ValidationState;
96
- handleValidate: () => Promise<void>;
97
- handleFixValidation: (stepKey: string, tail: string | undefined) => void;
98
- autoPushOnValidatePass: boolean;
99
- setAutoPushOnValidatePass: (on: boolean) => void;
100
- refineThread: RefineTurn[];
101
- refineQueue: string[];
102
- thinkingLogs: string[];
103
- getToken: typeof getToken;
104
- backendError: string | null;
105
- backendRetrying: boolean;
106
- retryBackend: () => void;
107
- };
@@ -1,22 +0,0 @@
1
- import { ForgeRateLimit, ForgeUsage } from '../types';
2
- /**
3
- * Quota / usage domain. Owns:
4
- * - cumulative session usage (cost, tokens, cache hits)
5
- * - last-known rate-limit headers + when they were checked
6
- *
7
- * `updateUsageFromEvent` accepts any payload that carries the standard
8
- * `cost / serviceTier / inputTokens / outputTokens / cache* / rateLimit`
9
- * keys — the SSE event handlers and `handleCheckResolution` all share that
10
- * shape. `setRateLimit` is exposed so the bootstrap `applyStatus` flow can
11
- * seed the limit on first load.
12
- */
13
- export declare function useForgeQuota(): {
14
- usage: ForgeUsage;
15
- rateLimit: ForgeRateLimit | null;
16
- quotaLoading: boolean;
17
- quotaError: string | null;
18
- quotaCheckedAt: string | null;
19
- refreshQuota: () => Promise<void>;
20
- updateUsageFromEvent: (event: Record<string, unknown>) => void;
21
- setRateLimit: import('react').Dispatch<import('react').SetStateAction<ForgeRateLimit | null>>;
22
- };
@@ -1 +0,0 @@
1
- export declare function AnalyzingView(): import("react/jsx-runtime").JSX.Element | null;
@@ -1 +0,0 @@
1
- export declare function IdleView(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function MonitoringIssueTab(): import("react/jsx-runtime").JSX.Element | null;
@@ -1 +0,0 @@
1
- export declare function MonitoringPipelineTab(): import("react/jsx-runtime").JSX.Element | null;
@@ -1 +0,0 @@
1
- export declare function MonitoringView(): import("react/jsx-runtime").JSX.Element | null;
@@ -1 +0,0 @@
1
- export declare function ReviewingView(): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +0,0 @@
1
- interface Props {
2
- editing: boolean;
3
- editDescription: string;
4
- setEditDescription: (d: string) => void;
5
- saving: boolean;
6
- onSave: () => void;
7
- onCancelEdit: () => void;
8
- editTitle: string;
9
- }
10
- export declare function SelectedIssueTab({ editing, editDescription, setEditDescription, saving, onSave, onCancelEdit, editTitle, }: Props): import("react/jsx-runtime").JSX.Element | null;
11
- export {};
@@ -1 +0,0 @@
1
- export declare function SelectedMRTab(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function SelectedView(): import("react/jsx-runtime").JSX.Element | null;
@@ -1 +0,0 @@
1
- export declare function CloseIssueConfirm(): import("react/jsx-runtime").JSX.Element;
@@ -1,14 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export interface DetailTabSpec {
3
- id: string;
4
- label: string;
5
- badge?: ReactNode;
6
- loading?: boolean;
7
- }
8
- interface Props {
9
- tabs: readonly DetailTabSpec[];
10
- active: string;
11
- onSelect: (id: string) => void;
12
- }
13
- export declare function DetailTabs({ tabs, active, onSelect }: Props): import("react/jsx-runtime").JSX.Element;
14
- export {};
@@ -1,9 +0,0 @@
1
- /**
2
- * Ephemeral review-app environments (Deploy-to-Test preview URLs) attached
3
- * to any forge branch for the selected issue. Sits next to <ForgeActivity />
4
- * on the Issue tab so the user sees the live preview URL + state inline.
5
- *
6
- * Data is fetched once in `handleSelectIssue` via `/issues/:iid/environments`.
7
- * Rendering is purely passive — teardown happens in the close-issue flow.
8
- */
9
- export declare function EnvironmentsPanel(): import("react/jsx-runtime").JSX.Element | null;
@@ -1 +0,0 @@
1
- export declare function ForgeActivity(): import("react/jsx-runtime").JSX.Element | null;