@loucompanion/forge-bridge 0.1.1-dev.32d4dd5874ee → 0.1.1-dev.54464ef723de

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.
@@ -53,7 +53,8 @@ export function applyLocalConfigDefaults(config, local) {
53
53
  supportsApiSecretGrant: local.supportsApiSecretGrant ?? config.supportsApiSecretGrant,
54
54
  supportsManagedWorktrees: local.supportsManagedWorktrees ?? config.supportsManagedWorktrees,
55
55
  supportsManagedForgeArtifacts: local.supportsManagedForgeArtifacts ?? config.supportsManagedForgeArtifacts,
56
- supportsRunnerAuthoredPhaseArtifacts: local.supportsRunnerAuthoredPhaseArtifacts ?? config.supportsRunnerAuthoredPhaseArtifacts
56
+ supportsRunnerAuthoredPhaseArtifacts: local.supportsRunnerAuthoredPhaseArtifacts ?? config.supportsRunnerAuthoredPhaseArtifacts,
57
+ supportsDraftRunOnce: local.supportsDraftRunOnce ?? config.supportsDraftRunOnce
57
58
  };
58
59
  }
59
60
  export async function addRepoMapping(label, repoPath) {
@@ -111,7 +112,8 @@ function normalizeLocalConfig(config) {
111
112
  supportsApiSecretGrant: config.supportsApiSecretGrant,
112
113
  supportsManagedWorktrees: config.supportsManagedWorktrees,
113
114
  supportsManagedForgeArtifacts: config.supportsManagedForgeArtifacts,
114
- supportsRunnerAuthoredPhaseArtifacts: config.supportsRunnerAuthoredPhaseArtifacts
115
+ supportsRunnerAuthoredPhaseArtifacts: config.supportsRunnerAuthoredPhaseArtifacts,
116
+ supportsDraftRunOnce: config.supportsDraftRunOnce
115
117
  };
116
118
  }
117
119
  function emptyConfig() {
@@ -159,7 +161,8 @@ function normalizeRepoMappings(values) {
159
161
  repoId: cleanString(mapping.repoId),
160
162
  name: cleanString(mapping.name) ?? label,
161
163
  remoteUrl: cleanString(mapping.remoteUrl),
162
- localPath: path.resolve(mapping.localPath)
164
+ localPath: path.resolve(mapping.localPath),
165
+ qaAppLaunchTarget: normalizeQaAppLaunchTarget(mapping.qaAppLaunchTarget)
163
166
  };
164
167
  })
165
168
  .sort((left, right) => left.label.localeCompare(right.label));
@@ -171,6 +174,22 @@ function normalizeLabel(value) {
171
174
  }
172
175
  return label;
173
176
  }
177
+ function normalizeQaAppLaunchTarget(value) {
178
+ if (!value)
179
+ return undefined;
180
+ const routes = cleanList(value.routes);
181
+ const normalized = {
182
+ url: cleanString(value.url),
183
+ command: cleanString(value.command),
184
+ working_directory: cleanString(value.working_directory),
185
+ ready_url: cleanString(value.ready_url),
186
+ routes,
187
+ notes: cleanString(value.notes)
188
+ };
189
+ return normalized.url || normalized.command || normalized.ready_url || routes?.length
190
+ ? normalized
191
+ : undefined;
192
+ }
174
193
  function cleanString(value) {
175
194
  const clean = value?.trim();
176
195
  return clean ? clean : undefined;
package/dist/config.js CHANGED
@@ -2,7 +2,7 @@ import os from "node:os";
2
2
  import path from "node:path";
3
3
  export function defaultForgeBridgeConfig() {
4
4
  return {
5
- defaultRepoRoot: path.join(os.tmpdir(), "forge-phase5-repos"),
5
+ defaultRepoRoot: path.join(os.tmpdir(), "forge-repos"),
6
6
  cleanupWorktrees: true
7
7
  };
8
8
  }
@@ -2,7 +2,7 @@ export { parseRunOnceDispatchPacket, failureResult } from "./session.types.js";
2
2
  export { buildCompletionToolServerArgs, codexMcpConfigArgs, completionPhaseFromDispatch, expectedCompletionToolName, prepareCompletionToolRuntime, readCompletionArtifact, writeCompletionArtifact } from "./phase-completion.js";
3
3
  export type { CompletionArtifactReference, CompletionPhase, CompletionToolRuntime } from "./phase-completion.js";
4
4
  export type { SessionEventSink, SessionService } from "./session.base.js";
5
- export type { ApiKeySecretGrant, DispatchCycleRun, DispatchExecution, DispatchLease, DispatchSession, DispatchRepo, DispatchServerLocalConfig, DispatchWorkItem, RunOnceDispatchPacket, RunOnceResultPacket, RunnerDispatchArtifact, RunnerDispatchEvent, RunnerDispatchSpec, RunnerEventLine } from "./session.types.js";
5
+ export type { ApiKeySecretGrant, DispatchCycleRun, DispatchExecution, DispatchLease, DispatchPullRequestContext, DispatchSession, DispatchRepo, DispatchServerLocalConfig, DispatchWorkItem, RunOnceDispatchPacket, RunOnceResultPacket, RunnerDispatchArtifact, RunnerDispatchEvent, RunnerDispatchSpec, RunnerEventLine } from "./session.types.js";
6
6
  export { DeterministicProviderCliService, ProcessBackedProviderCliService, RoutingProviderCliService, buildProviderCliCommand } from "./provider-cli/provider-cli.service.js";
7
7
  export type { ProviderCliService } from "./provider-cli/provider-cli.base.js";
8
8
  export type { ProviderCliCommand, ProviderProcessRunner, ProviderProcessRunRequest, ProviderProcessRunResult } from "./provider-cli/provider-cli.service.js";
@@ -1,6 +1,10 @@
1
1
  import type { RunOnceDispatchPacket, RunnerDispatchArtifact } from "./session.types.js";
2
2
  import type { WorktreeHandle } from "../worktree/worktree.types.js";
3
- export type CompletionPhase = "implementation" | "self_review" | "validation";
3
+ export type DevelopCompletionPhase = "implementation" | "self_review" | "validation";
4
+ export type DebugCompletionPhase = "debug_repro" | "debug_root_cause" | "debug_fix" | "debug_regression";
5
+ export type ArchitectCompletionPhase = "architect";
6
+ export type CompletionPhase = DevelopCompletionPhase | "qa" | DebugCompletionPhase | ArchitectCompletionPhase;
7
+ export type QaCompletionGate = "qa_plan" | "qa_regression" | "qa_api" | "qa_manual_web" | "qa_bug_repro" | "qa_findings" | "qa_verdict";
4
8
  export interface CompletionToolRuntime {
5
9
  readonly serverName: string;
6
10
  readonly command: string;
@@ -17,12 +21,38 @@ export interface CompletionToolRuntimeOptions {
17
21
  export interface CompletionToolServerConfig {
18
22
  readonly worktreePath: string;
19
23
  readonly workItemId: string;
24
+ readonly ownerType?: string;
25
+ readonly ownerId?: string;
20
26
  readonly phase: CompletionPhase;
21
27
  readonly producedBy?: string;
28
+ readonly redactionSecrets?: readonly string[];
29
+ readonly developCycle?: boolean;
30
+ readonly qaCycle?: boolean;
31
+ readonly debugCycle?: boolean;
32
+ readonly architectCycle?: boolean;
33
+ }
34
+ export interface CompletionToolCallResult {
35
+ readonly content: readonly {
36
+ readonly type: "text";
37
+ readonly text: string;
38
+ }[];
39
+ readonly structuredContent: CompletionArtifactReference & {
40
+ readonly gate: {
41
+ readonly phase: CompletionPhase;
42
+ readonly qaGate?: QaCompletionGate;
43
+ readonly status: string;
44
+ readonly allowed: boolean;
45
+ readonly reason: string;
46
+ };
47
+ readonly nextPhase: CompletionPhase | "dev_test_ready" | "qa_ready" | "sign_off_ready";
48
+ readonly nextInstruction: string;
49
+ };
22
50
  }
23
51
  export interface CompletionArtifactReference {
24
52
  readonly phase: CompletionPhase;
25
53
  readonly workItemId: string;
54
+ readonly ownerType?: string;
55
+ readonly ownerId?: string;
26
56
  readonly repoPath: string;
27
57
  readonly path: string;
28
58
  readonly reportPath: string;
@@ -30,20 +60,50 @@ export interface CompletionArtifactReference {
30
60
  readonly status: string;
31
61
  readonly producedBy: string;
32
62
  }
63
+ export declare const debugCompletionPhaseOrder: readonly DebugCompletionPhase[];
64
+ export declare const qaCompletionGateOrder: readonly QaCompletionGate[];
33
65
  export declare function completionPhaseFromDispatch(dispatch: RunOnceDispatchPacket): CompletionPhase;
34
66
  export declare function normalizeCompletionPhase(value: string | null | undefined): CompletionPhase;
67
+ export declare function usesDevelopCycleCompletion(dispatch: RunOnceDispatchPacket): boolean;
68
+ export declare function usesQaCycleCompletion(dispatch: RunOnceDispatchPacket): boolean;
69
+ export declare function usesDebugCycleCompletion(dispatch: RunOnceDispatchPacket): boolean;
70
+ export declare function usesArchitectCycleCompletion(dispatch: RunOnceDispatchPacket): boolean;
35
71
  export declare function completionToolNamesForPhase(phase: CompletionPhase): readonly string[];
72
+ export declare function completionToolNamesForQaGate(gate: QaCompletionGate): readonly string[];
73
+ export declare function completionToolNamesForDebugGate(gate: DebugCompletionPhase): readonly string[];
36
74
  export declare function expectedCompletionToolName(phase: CompletionPhase): string;
75
+ export declare function expectedQaCompletionToolName(gate: QaCompletionGate): string;
76
+ export declare function expectedDebugCompletionToolName(gate: DebugCompletionPhase): string;
37
77
  export declare function artifactRootFor(worktreePath: string, workItemId: string): string;
38
- export declare function completionArtifactJsonPath(worktreePath: string, workItemId: string, phase: CompletionPhase): string;
39
- export declare function completionArtifactReportPath(worktreePath: string, workItemId: string, phase: CompletionPhase): string;
78
+ export declare function artifactRootForOwner(worktreePath: string, ownerType: string, ownerId: string): string;
79
+ export declare function completionArtifactJsonPath(worktreePath: string, workItemId: string, phase: CompletionPhase, ownerType?: string | null, ownerId?: string | null): string;
80
+ export declare function completionArtifactReportPath(worktreePath: string, workItemId: string, phase: CompletionPhase, ownerType?: string | null, ownerId?: string | null): string;
40
81
  export declare function prepareCompletionToolRuntime(options: CompletionToolRuntimeOptions): Promise<CompletionToolRuntime>;
41
82
  export declare function buildCompletionToolServerArgs(config: CompletionToolServerConfig): readonly string[];
42
83
  export declare function codexMcpConfigArgs(runtime: CompletionToolRuntime): readonly string[];
43
84
  export declare function cursorMcpServerConfig(runtime: CompletionToolRuntime): unknown;
44
85
  export declare function completionPromptForPhase(phase: CompletionPhase): string;
86
+ export declare function completionPromptForDevelopCycle(phase: CompletionPhase): string;
87
+ export declare function completionPromptForQaCycle(currentGate?: QaCompletionGate): string;
88
+ export declare function completionPromptForDebugCycle(currentGate?: DebugCompletionPhase): string;
89
+ export declare function completionToolNamesForServer(config: CompletionToolServerConfig): readonly string[];
90
+ export declare class CompletionToolServerSession {
91
+ private readonly config;
92
+ private currentPhase;
93
+ private currentQaGate;
94
+ private completed;
95
+ constructor(config: CompletionToolServerConfig);
96
+ get instructions(): string;
97
+ toolDefinitions(): readonly unknown[];
98
+ callTool(toolName: string, input: unknown): Promise<CompletionToolCallResult>;
99
+ private callDebugGateTool;
100
+ private callQaGateTool;
101
+ private advanceAfterPass;
102
+ private advanceAfterQaGate;
103
+ private advanceAfterDebugGate;
104
+ }
45
105
  export declare function writeCompletionArtifact(config: CompletionToolServerConfig, toolName: string, input: unknown): Promise<CompletionArtifactReference>;
46
- export declare function readCompletionArtifact(worktreePath: string, workItemId: string, phase: CompletionPhase): Promise<RunnerDispatchArtifact | null>;
106
+ export declare function readCompletionArtifact(worktreePath: string, workItemId: string, phase: CompletionPhase, ownerType?: string | null, ownerId?: string | null): Promise<RunnerDispatchArtifact | null>;
47
107
  export declare function runCompletionMcpServer(config: CompletionToolServerConfig): Promise<void>;
48
108
  export declare function parseCompletionMcpArgs(argv: readonly string[]): {
49
109
  readonly ok: true;
@@ -52,3 +112,4 @@ export declare function parseCompletionMcpArgs(argv: readonly string[]): {
52
112
  readonly ok: false;
53
113
  readonly error: string;
54
114
  };
115
+ export declare function completionRedactionEnv(secrets: readonly string[]): Readonly<Record<string, string>>;