@loucompanion/forge-bridge 0.1.1-dev.e52b249f07a8 → 0.1.1-dev.e646c8fd6b9b
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/dist/bridge/bridge.service.d.ts +1 -0
- package/dist/bridge/bridge.service.js +184 -24
- package/dist/bridge/bridge.types.d.ts +4 -2
- package/dist/cli/cli.service.js +225 -10
- package/dist/cli/local-config.d.ts +1 -0
- package/dist/cli/local-config.js +18 -3
- package/dist/config.js +1 -1
- package/dist/session/internals.d.ts +1 -1
- package/dist/session/phase-completion.d.ts +30 -5
- package/dist/session/phase-completion.js +1337 -28
- package/dist/session/provider-cli/provider-cli.base.d.ts +3 -1
- package/dist/session/provider-cli/provider-cli.service.d.ts +9 -1
- package/dist/session/provider-cli/provider-cli.service.js +1198 -236
- package/dist/session/provider-cli/provider-cli.types.d.ts +5 -0
- package/dist/session/session.service.js +47 -5
- package/dist/session/session.types.d.ts +92 -0
- package/dist/session/session.types.js +166 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worktree/artifact-injector.d.ts +1 -0
- package/dist/worktree/artifact-injector.js +78 -1
- package/dist/worktree/worktree.service.d.ts +1 -0
- package/dist/worktree/worktree.service.js +132 -6
- package/dist/worktree/worktree.types.d.ts +8 -1
- package/package.json +8 -3
package/dist/cli/local-config.js
CHANGED
|
@@ -49,11 +49,12 @@ export function applyLocalConfigDefaults(config, local) {
|
|
|
49
49
|
providerStatuses: normalizeProviderStatuses(local.providerStatuses) ?? providerStatusesFor(cliProviders),
|
|
50
50
|
projectLabels: local.projectLabels ?? config.projectLabels,
|
|
51
51
|
repoMappings: local.repoMappings ?? config.repoMappings,
|
|
52
|
-
sandboxProfiles: local.sandboxProfiles ?? config.sandboxProfiles,
|
|
52
|
+
sandboxProfiles: normalizeSandboxProfiles(local.sandboxProfiles ?? config.sandboxProfiles, cliProviders) ?? config.sandboxProfiles,
|
|
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() {
|
|
@@ -149,6 +151,19 @@ function splitCsv(value) {
|
|
|
149
151
|
.map((entry) => entry.trim())
|
|
150
152
|
.filter((entry) => entry.length > 0);
|
|
151
153
|
}
|
|
154
|
+
function normalizeSandboxProfiles(profiles, cliProviders) {
|
|
155
|
+
const normalized = cleanList(profiles);
|
|
156
|
+
if (process.platform === "win32"
|
|
157
|
+
&& cliProviders.some((provider) => provider.toLowerCase() === "codex")
|
|
158
|
+
&& normalized?.some((profile) => profile.toLowerCase() === "provider-workspace-write")
|
|
159
|
+
&& !normalized.some((profile) => profile.toLowerCase() === "danger-full-access")) {
|
|
160
|
+
return [
|
|
161
|
+
...normalized.filter((profile) => profile.toLowerCase() !== "provider-workspace-write"),
|
|
162
|
+
"danger-full-access"
|
|
163
|
+
];
|
|
164
|
+
}
|
|
165
|
+
return normalized;
|
|
166
|
+
}
|
|
152
167
|
function normalizeRepoMappings(values) {
|
|
153
168
|
return (values ?? [])
|
|
154
169
|
.filter((mapping) => !!mapping.label?.trim() && !!mapping.localPath?.trim())
|
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-
|
|
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
|
|
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;
|
|
@@ -23,6 +27,9 @@ export interface CompletionToolServerConfig {
|
|
|
23
27
|
readonly producedBy?: string;
|
|
24
28
|
readonly redactionSecrets?: readonly string[];
|
|
25
29
|
readonly developCycle?: boolean;
|
|
30
|
+
readonly qaCycle?: boolean;
|
|
31
|
+
readonly debugCycle?: boolean;
|
|
32
|
+
readonly architectCycle?: boolean;
|
|
26
33
|
}
|
|
27
34
|
export interface CompletionToolCallResult {
|
|
28
35
|
readonly content: readonly {
|
|
@@ -32,11 +39,12 @@ export interface CompletionToolCallResult {
|
|
|
32
39
|
readonly structuredContent: CompletionArtifactReference & {
|
|
33
40
|
readonly gate: {
|
|
34
41
|
readonly phase: CompletionPhase;
|
|
42
|
+
readonly qaGate?: QaCompletionGate;
|
|
35
43
|
readonly status: string;
|
|
36
44
|
readonly allowed: boolean;
|
|
37
45
|
readonly reason: string;
|
|
38
46
|
};
|
|
39
|
-
readonly nextPhase: CompletionPhase | "dev_test_ready" | "sign_off_ready";
|
|
47
|
+
readonly nextPhase: CompletionPhase | "dev_test_ready" | "qa_ready" | "sign_off_ready";
|
|
40
48
|
readonly nextInstruction: string;
|
|
41
49
|
};
|
|
42
50
|
}
|
|
@@ -52,33 +60,50 @@ export interface CompletionArtifactReference {
|
|
|
52
60
|
readonly status: string;
|
|
53
61
|
readonly producedBy: string;
|
|
54
62
|
}
|
|
63
|
+
export declare const debugCompletionPhaseOrder: readonly DebugCompletionPhase[];
|
|
64
|
+
export declare const qaCompletionGateOrder: readonly QaCompletionGate[];
|
|
55
65
|
export declare function completionPhaseFromDispatch(dispatch: RunOnceDispatchPacket): CompletionPhase;
|
|
56
66
|
export declare function normalizeCompletionPhase(value: string | null | undefined): CompletionPhase;
|
|
57
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;
|
|
58
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[];
|
|
59
74
|
export declare function expectedCompletionToolName(phase: CompletionPhase): string;
|
|
75
|
+
export declare function expectedQaCompletionToolName(gate: QaCompletionGate): string;
|
|
76
|
+
export declare function expectedDebugCompletionToolName(gate: DebugCompletionPhase): string;
|
|
60
77
|
export declare function artifactRootFor(worktreePath: string, workItemId: string): string;
|
|
61
|
-
export declare function
|
|
62
|
-
export declare function
|
|
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;
|
|
63
81
|
export declare function prepareCompletionToolRuntime(options: CompletionToolRuntimeOptions): Promise<CompletionToolRuntime>;
|
|
64
82
|
export declare function buildCompletionToolServerArgs(config: CompletionToolServerConfig): readonly string[];
|
|
65
83
|
export declare function codexMcpConfigArgs(runtime: CompletionToolRuntime): readonly string[];
|
|
66
84
|
export declare function cursorMcpServerConfig(runtime: CompletionToolRuntime): unknown;
|
|
67
85
|
export declare function completionPromptForPhase(phase: CompletionPhase): string;
|
|
68
86
|
export declare function completionPromptForDevelopCycle(phase: CompletionPhase): string;
|
|
87
|
+
export declare function completionPromptForQaCycle(currentGate?: QaCompletionGate): string;
|
|
88
|
+
export declare function completionPromptForDebugCycle(currentGate?: DebugCompletionPhase): string;
|
|
69
89
|
export declare function completionToolNamesForServer(config: CompletionToolServerConfig): readonly string[];
|
|
70
90
|
export declare class CompletionToolServerSession {
|
|
71
91
|
private readonly config;
|
|
72
92
|
private currentPhase;
|
|
93
|
+
private currentQaGate;
|
|
73
94
|
private completed;
|
|
74
95
|
constructor(config: CompletionToolServerConfig);
|
|
75
96
|
get instructions(): string;
|
|
76
97
|
toolDefinitions(): readonly unknown[];
|
|
77
98
|
callTool(toolName: string, input: unknown): Promise<CompletionToolCallResult>;
|
|
99
|
+
private callDebugGateTool;
|
|
100
|
+
private callQaGateTool;
|
|
78
101
|
private advanceAfterPass;
|
|
102
|
+
private advanceAfterQaGate;
|
|
103
|
+
private advanceAfterDebugGate;
|
|
79
104
|
}
|
|
80
105
|
export declare function writeCompletionArtifact(config: CompletionToolServerConfig, toolName: string, input: unknown): Promise<CompletionArtifactReference>;
|
|
81
|
-
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>;
|
|
82
107
|
export declare function runCompletionMcpServer(config: CompletionToolServerConfig): Promise<void>;
|
|
83
108
|
export declare function parseCompletionMcpArgs(argv: readonly string[]): {
|
|
84
109
|
readonly ok: true;
|