@loucompanion/forge-bridge 0.1.1-dev.615630fb4618 → 0.1.1-dev.718bdb0018b9
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.js +29 -1
- package/dist/bridge/bridge.types.d.ts +9 -0
- package/dist/cli/local-config.js +18 -1
- package/dist/session/phase-completion.d.ts +31 -1
- package/dist/session/phase-completion.js +860 -78
- package/dist/session/provider-cli/provider-cli.base.d.ts +1 -2
- package/dist/session/provider-cli/provider-cli.service.d.ts +4 -4
- package/dist/session/provider-cli/provider-cli.service.js +761 -65
- package/dist/session/provider-cli/provider-usage.d.ts +25 -0
- package/dist/session/provider-cli/provider-usage.js +64 -0
- package/dist/session/qa-sidecar-validation.d.ts +3 -0
- package/dist/session/qa-sidecar-validation.js +44 -0
- package/dist/session/session.service.js +9 -13
- package/dist/session/session.types.d.ts +30 -0
- package/dist/session/session.types.js +90 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -123,6 +123,7 @@ export class ForgeBridgeService {
|
|
|
123
123
|
const mapping = findRepoMapping(dispatch, this.config.repoMappings);
|
|
124
124
|
const localPath = mapping?.localPath?.trim();
|
|
125
125
|
const repoRoot = localPath ? path.dirname(path.resolve(localPath)) : this.config.defaultRepoRoot;
|
|
126
|
+
const qaLaunchTarget = normalizeQaAppLaunchTarget(mapping?.qaAppLaunchTarget) ?? dispatch.qaBrowser?.launchTarget ?? null;
|
|
126
127
|
return {
|
|
127
128
|
...dispatch,
|
|
128
129
|
repo: {
|
|
@@ -133,7 +134,13 @@ export class ForgeBridgeService {
|
|
|
133
134
|
serverLocal: {
|
|
134
135
|
repoRoot,
|
|
135
136
|
cleanupWorktrees: this.config.cleanupWorktrees
|
|
136
|
-
}
|
|
137
|
+
},
|
|
138
|
+
qaBrowser: dispatch.qaBrowser
|
|
139
|
+
? {
|
|
140
|
+
...dispatch.qaBrowser,
|
|
141
|
+
launchTarget: qaLaunchTarget
|
|
142
|
+
}
|
|
143
|
+
: dispatch.qaBrowser
|
|
137
144
|
};
|
|
138
145
|
}
|
|
139
146
|
async sendResult(leaseId, fencingToken, result) {
|
|
@@ -323,6 +330,27 @@ function findRepoMapping(dispatch, mappings) {
|
|
|
323
330
|
(!!mapping.remoteUrl?.trim() && equalsIgnoreCase(mapping.remoteUrl, dispatch.repo.remoteUrl)));
|
|
324
331
|
});
|
|
325
332
|
}
|
|
333
|
+
function normalizeQaAppLaunchTarget(target) {
|
|
334
|
+
if (!target) {
|
|
335
|
+
return null;
|
|
336
|
+
}
|
|
337
|
+
const routes = [...new Set((target.routes ?? []).map((route) => route.trim()).filter(Boolean))];
|
|
338
|
+
const normalized = {
|
|
339
|
+
url: cleanString(target.url),
|
|
340
|
+
command: cleanString(target.command),
|
|
341
|
+
working_directory: cleanString(target.working_directory),
|
|
342
|
+
ready_url: cleanString(target.ready_url),
|
|
343
|
+
routes,
|
|
344
|
+
notes: cleanString(target.notes)
|
|
345
|
+
};
|
|
346
|
+
return normalized.url || normalized.command || normalized.ready_url || routes.length > 0
|
|
347
|
+
? normalized
|
|
348
|
+
: null;
|
|
349
|
+
}
|
|
350
|
+
function cleanString(value) {
|
|
351
|
+
const clean = value?.trim();
|
|
352
|
+
return clean ? clean : null;
|
|
353
|
+
}
|
|
326
354
|
function equalsIgnoreCase(left, right) {
|
|
327
355
|
return !!left?.trim() && !!right?.trim() && left.trim().toLowerCase() === right.trim().toLowerCase();
|
|
328
356
|
}
|
|
@@ -27,6 +27,15 @@ export interface BridgeRepoMapping {
|
|
|
27
27
|
readonly name?: string | null;
|
|
28
28
|
readonly remoteUrl?: string | null;
|
|
29
29
|
readonly localPath?: string | null;
|
|
30
|
+
readonly qaAppLaunchTarget?: QaAppLaunchTarget | null;
|
|
31
|
+
}
|
|
32
|
+
export interface QaAppLaunchTarget {
|
|
33
|
+
readonly url?: string | null;
|
|
34
|
+
readonly command?: string | null;
|
|
35
|
+
readonly working_directory?: string | null;
|
|
36
|
+
readonly ready_url?: string | null;
|
|
37
|
+
readonly routes?: readonly string[] | null;
|
|
38
|
+
readonly notes?: string | null;
|
|
30
39
|
}
|
|
31
40
|
export interface BridgeProviderStatus {
|
|
32
41
|
readonly signedIn?: boolean | null;
|
package/dist/cli/local-config.js
CHANGED
|
@@ -159,7 +159,8 @@ function normalizeRepoMappings(values) {
|
|
|
159
159
|
repoId: cleanString(mapping.repoId),
|
|
160
160
|
name: cleanString(mapping.name) ?? label,
|
|
161
161
|
remoteUrl: cleanString(mapping.remoteUrl),
|
|
162
|
-
localPath: path.resolve(mapping.localPath)
|
|
162
|
+
localPath: path.resolve(mapping.localPath),
|
|
163
|
+
qaAppLaunchTarget: normalizeQaAppLaunchTarget(mapping.qaAppLaunchTarget)
|
|
163
164
|
};
|
|
164
165
|
})
|
|
165
166
|
.sort((left, right) => left.label.localeCompare(right.label));
|
|
@@ -171,6 +172,22 @@ function normalizeLabel(value) {
|
|
|
171
172
|
}
|
|
172
173
|
return label;
|
|
173
174
|
}
|
|
175
|
+
function normalizeQaAppLaunchTarget(value) {
|
|
176
|
+
if (!value)
|
|
177
|
+
return undefined;
|
|
178
|
+
const routes = cleanList(value.routes);
|
|
179
|
+
const normalized = {
|
|
180
|
+
url: cleanString(value.url),
|
|
181
|
+
command: cleanString(value.command),
|
|
182
|
+
working_directory: cleanString(value.working_directory),
|
|
183
|
+
ready_url: cleanString(value.ready_url),
|
|
184
|
+
routes,
|
|
185
|
+
notes: cleanString(value.notes)
|
|
186
|
+
};
|
|
187
|
+
return normalized.url || normalized.command || normalized.ready_url || routes?.length
|
|
188
|
+
? normalized
|
|
189
|
+
: undefined;
|
|
190
|
+
}
|
|
174
191
|
function cleanString(value) {
|
|
175
192
|
const clean = value?.trim();
|
|
176
193
|
return clean ? clean : undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
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 CompletionPhase = "implementation" | "self_review" | "validation" | "qa";
|
|
4
4
|
export interface CompletionToolRuntime {
|
|
5
5
|
readonly serverName: string;
|
|
6
6
|
readonly command: string;
|
|
@@ -20,6 +20,23 @@ export interface CompletionToolServerConfig {
|
|
|
20
20
|
readonly phase: CompletionPhase;
|
|
21
21
|
readonly producedBy?: string;
|
|
22
22
|
readonly redactionSecrets?: readonly string[];
|
|
23
|
+
readonly developCycle?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface CompletionToolCallResult {
|
|
26
|
+
readonly content: readonly {
|
|
27
|
+
readonly type: "text";
|
|
28
|
+
readonly text: string;
|
|
29
|
+
}[];
|
|
30
|
+
readonly structuredContent: CompletionArtifactReference & {
|
|
31
|
+
readonly gate: {
|
|
32
|
+
readonly phase: CompletionPhase;
|
|
33
|
+
readonly status: string;
|
|
34
|
+
readonly allowed: boolean;
|
|
35
|
+
readonly reason: string;
|
|
36
|
+
};
|
|
37
|
+
readonly nextPhase: CompletionPhase | "dev_test_ready" | "sign_off_ready";
|
|
38
|
+
readonly nextInstruction: string;
|
|
39
|
+
};
|
|
23
40
|
}
|
|
24
41
|
export interface CompletionArtifactReference {
|
|
25
42
|
readonly phase: CompletionPhase;
|
|
@@ -33,6 +50,7 @@ export interface CompletionArtifactReference {
|
|
|
33
50
|
}
|
|
34
51
|
export declare function completionPhaseFromDispatch(dispatch: RunOnceDispatchPacket): CompletionPhase;
|
|
35
52
|
export declare function normalizeCompletionPhase(value: string | null | undefined): CompletionPhase;
|
|
53
|
+
export declare function usesDevelopCycleCompletion(dispatch: RunOnceDispatchPacket): boolean;
|
|
36
54
|
export declare function completionToolNamesForPhase(phase: CompletionPhase): readonly string[];
|
|
37
55
|
export declare function expectedCompletionToolName(phase: CompletionPhase): string;
|
|
38
56
|
export declare function artifactRootFor(worktreePath: string, workItemId: string): string;
|
|
@@ -43,6 +61,18 @@ export declare function buildCompletionToolServerArgs(config: CompletionToolServ
|
|
|
43
61
|
export declare function codexMcpConfigArgs(runtime: CompletionToolRuntime): readonly string[];
|
|
44
62
|
export declare function cursorMcpServerConfig(runtime: CompletionToolRuntime): unknown;
|
|
45
63
|
export declare function completionPromptForPhase(phase: CompletionPhase): string;
|
|
64
|
+
export declare function completionPromptForDevelopCycle(phase: CompletionPhase): string;
|
|
65
|
+
export declare function completionToolNamesForServer(config: CompletionToolServerConfig): readonly string[];
|
|
66
|
+
export declare class CompletionToolServerSession {
|
|
67
|
+
private readonly config;
|
|
68
|
+
private currentPhase;
|
|
69
|
+
private completed;
|
|
70
|
+
constructor(config: CompletionToolServerConfig);
|
|
71
|
+
get instructions(): string;
|
|
72
|
+
toolDefinitions(): readonly unknown[];
|
|
73
|
+
callTool(toolName: string, input: unknown): Promise<CompletionToolCallResult>;
|
|
74
|
+
private advanceAfterPass;
|
|
75
|
+
}
|
|
46
76
|
export declare function writeCompletionArtifact(config: CompletionToolServerConfig, toolName: string, input: unknown): Promise<CompletionArtifactReference>;
|
|
47
77
|
export declare function readCompletionArtifact(worktreePath: string, workItemId: string, phase: CompletionPhase): Promise<RunnerDispatchArtifact | null>;
|
|
48
78
|
export declare function runCompletionMcpServer(config: CompletionToolServerConfig): Promise<void>;
|