@loucompanion/forge-bridge 0.1.1-dev.eee62899e922 → 0.1.3-dev.04a84914da09

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.
@@ -370,10 +370,13 @@ function positiveFiniteNumber(value, fallback) {
370
370
  function providerStatusesFor(providers) {
371
371
  return Object.fromEntries(providers.map((provider) => [provider, { signedIn: true, version: "", models: configuredModelsFor(provider) }]));
372
372
  }
373
- function defaultSandboxProfiles(providers) {
374
- return providers.some((provider) => provider.toLowerCase() === "codex")
375
- ? ["provider-workspace-write"]
376
- : ["none"];
373
+ function defaultSandboxProfiles(providers, platform = process.platform) {
374
+ if (!providers.some((provider) => provider.toLowerCase() === "codex")) {
375
+ return ["none"];
376
+ }
377
+ return platform === "win32"
378
+ ? ["danger-full-access"]
379
+ : ["provider-workspace-write"];
377
380
  }
378
381
  function configuredModelsFor(provider) {
379
382
  const envName = `FORGE_${provider.replace(/[^a-zA-Z0-9]/g, "_").toUpperCase()}_MODELS`;
@@ -49,7 +49,7 @@ 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,
@@ -151,6 +151,19 @@ function splitCsv(value) {
151
151
  .map((entry) => entry.trim())
152
152
  .filter((entry) => entry.length > 0);
153
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
+ }
154
167
  function normalizeRepoMappings(values) {
155
168
  return (values ?? [])
156
169
  .filter((mapping) => !!mapping.label?.trim() && !!mapping.localPath?.trim())
@@ -3,8 +3,12 @@ import type { WorktreeHandle } from "../worktree/worktree.types.js";
3
3
  export type DevelopCompletionPhase = "implementation" | "self_review" | "validation";
4
4
  export type DebugCompletionPhase = "debug_repro" | "debug_root_cause" | "debug_fix" | "debug_regression";
5
5
  export type ArchitectCompletionPhase = "architect";
6
- export type CompletionPhase = DevelopCompletionPhase | "qa" | DebugCompletionPhase | ArchitectCompletionPhase;
6
+ export type DraftCompletionPhase = "draft";
7
+ export type DecomposeCompletionPhase = "decompose";
8
+ export type CompletionPhase = DevelopCompletionPhase | "qa" | DebugCompletionPhase | ArchitectCompletionPhase | DraftCompletionPhase | DecomposeCompletionPhase;
7
9
  export type QaCompletionGate = "qa_plan" | "qa_regression" | "qa_api" | "qa_manual_web" | "qa_bug_repro" | "qa_findings" | "qa_verdict";
10
+ export type DraftCompletionGate = "draft_intent" | "draft_repo_context" | "draft_graph_context" | "draft_product_scope" | "draft_work_order_plan" | "draft_critic" | "draft_proposal";
11
+ export type DecomposeCompletionGate = "decompose_subject_intake" | "decompose_context_review" | "decompose_breakdown_strategy" | "decompose_child_items" | "decompose_dependency_graph" | "decompose_critic" | "decompose_proposal";
8
12
  export interface CompletionToolRuntime {
9
13
  readonly serverName: string;
10
14
  readonly command: string;
@@ -30,6 +34,8 @@ export interface CompletionToolServerConfig {
30
34
  readonly qaCycle?: boolean;
31
35
  readonly debugCycle?: boolean;
32
36
  readonly architectCycle?: boolean;
37
+ readonly draftCycle?: boolean;
38
+ readonly decomposeCycle?: boolean;
33
39
  }
34
40
  export interface CompletionToolCallResult {
35
41
  readonly content: readonly {
@@ -40,6 +46,8 @@ export interface CompletionToolCallResult {
40
46
  readonly gate: {
41
47
  readonly phase: CompletionPhase;
42
48
  readonly qaGate?: QaCompletionGate;
49
+ readonly draftGate?: DraftCompletionGate;
50
+ readonly decomposeGate?: DecomposeCompletionGate;
43
51
  readonly status: string;
44
52
  readonly allowed: boolean;
45
53
  readonly reason: string;
@@ -62,6 +70,8 @@ export interface CompletionArtifactReference {
62
70
  }
63
71
  export declare const debugCompletionPhaseOrder: readonly DebugCompletionPhase[];
64
72
  export declare const qaCompletionGateOrder: readonly QaCompletionGate[];
73
+ export declare const draftCompletionGateOrder: readonly DraftCompletionGate[];
74
+ export declare const decomposeCompletionGateOrder: readonly DecomposeCompletionGate[];
65
75
  export declare function completionPhaseFromDispatch(dispatch: RunOnceDispatchPacket): CompletionPhase;
66
76
  export declare function normalizeCompletionPhase(value: string | null | undefined): CompletionPhase;
67
77
  export declare function usesDevelopCycleCompletion(dispatch: RunOnceDispatchPacket): boolean;
@@ -71,9 +81,13 @@ export declare function usesArchitectCycleCompletion(dispatch: RunOnceDispatchPa
71
81
  export declare function completionToolNamesForPhase(phase: CompletionPhase): readonly string[];
72
82
  export declare function completionToolNamesForQaGate(gate: QaCompletionGate): readonly string[];
73
83
  export declare function completionToolNamesForDebugGate(gate: DebugCompletionPhase): readonly string[];
84
+ export declare function completionToolNamesForDraftGate(gate: DraftCompletionGate): readonly string[];
85
+ export declare function completionToolNamesForDecomposeGate(gate: DecomposeCompletionGate): readonly string[];
74
86
  export declare function expectedCompletionToolName(phase: CompletionPhase): string;
75
87
  export declare function expectedQaCompletionToolName(gate: QaCompletionGate): string;
76
88
  export declare function expectedDebugCompletionToolName(gate: DebugCompletionPhase): string;
89
+ export declare function expectedDraftCompletionToolName(gate: DraftCompletionGate): string;
90
+ export declare function expectedDecomposeCompletionToolName(gate: DecomposeCompletionGate): string;
77
91
  export declare function artifactRootFor(worktreePath: string, workItemId: string): string;
78
92
  export declare function artifactRootForOwner(worktreePath: string, ownerType: string, ownerId: string): string;
79
93
  export declare function completionArtifactJsonPath(worktreePath: string, workItemId: string, phase: CompletionPhase, ownerType?: string | null, ownerId?: string | null): string;
@@ -85,20 +99,28 @@ export declare function cursorMcpServerConfig(runtime: CompletionToolRuntime): u
85
99
  export declare function completionPromptForPhase(phase: CompletionPhase): string;
86
100
  export declare function completionPromptForDevelopCycle(phase: CompletionPhase): string;
87
101
  export declare function completionPromptForQaCycle(currentGate?: QaCompletionGate): string;
102
+ export declare function completionPromptForDraftCycle(currentGate?: DraftCompletionGate): string;
103
+ export declare function completionPromptForDecomposeCycle(currentGate?: DecomposeCompletionGate): string;
88
104
  export declare function completionPromptForDebugCycle(currentGate?: DebugCompletionPhase): string;
89
105
  export declare function completionToolNamesForServer(config: CompletionToolServerConfig): readonly string[];
90
106
  export declare class CompletionToolServerSession {
91
107
  private readonly config;
92
108
  private currentPhase;
93
109
  private currentQaGate;
110
+ private currentDraftGate;
111
+ private currentDecomposeGate;
94
112
  private completed;
95
113
  constructor(config: CompletionToolServerConfig);
96
114
  get instructions(): string;
97
115
  toolDefinitions(): readonly unknown[];
98
116
  callTool(toolName: string, input: unknown): Promise<CompletionToolCallResult>;
117
+ private callDecomposeGateTool;
118
+ private callDraftGateTool;
99
119
  private callDebugGateTool;
100
120
  private callQaGateTool;
101
121
  private advanceAfterPass;
122
+ private advanceAfterDecomposeGate;
123
+ private advanceAfterDraftGate;
102
124
  private advanceAfterQaGate;
103
125
  private advanceAfterDebugGate;
104
126
  }