Skip to content

Commit c630e4a

Browse files
committed
fix(ci): restore Crabbox routing type contracts
1 parent 89e4ef2 commit c630e4a

4 files changed

Lines changed: 34 additions & 8 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
export type CrabboxWorkload =
2+
| "ci-fast"
3+
| "ci-proof"
4+
| "desktop"
5+
| "interactive"
6+
| "release-proof"
7+
| "untrusted"
8+
| "windows";
9+
10+
export type CrabboxProviderReadiness = {
11+
ready: boolean;
12+
[key: string]: unknown;
13+
};
14+
15+
export function normalizeCrabboxWorkload(value: unknown): CrabboxWorkload | "" | null;
16+
17+
export function crabboxProviderChain(options: {
18+
workload: CrabboxWorkload | "";
19+
configuredProvider: string;
20+
target: string;
21+
advertisedProviders: readonly string[];
22+
}): string[];
23+
24+
export function selectReadyCrabboxProvider<T extends CrabboxProviderReadiness>(
25+
chain: readonly string[],
26+
readiness: ReadonlyMap<string, T>,
27+
): { provider: string; readiness: T } | null;
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
export function canonicalProviderName(provider: unknown): unknown;
2-
export function parseProvidersFromHelp(text: unknown): unknown[];
3-
export function isProviderAdvertised(provider: unknown, advertisedProviders: unknown): unknown;
1+
export function canonicalProviderName(provider: string): string;
2+
export function parseProvidersFromHelp(text: string): string[];
3+
export function isProviderAdvertised(
4+
provider: string,
5+
advertisedProviders: readonly string[],
6+
): boolean;

‎scripts/crabbox-wrapper.mjs‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -573,10 +573,6 @@ function configProvider() {
573573
}
574574
}
575575

576-
function configuredProvider() {
577-
return envProvider() || configProvider();
578-
}
579-
580576
function effectiveTargetContext(commandArgs) {
581577
const config = resolvedCrabboxConfig();
582578
const configuredTarget = typeof config?.target === "string" ? config.target.trim() : "";

‎test/scripts/crabbox-wrapper.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ describe("scripts/crabbox-wrapper", () => {
11831183
const result = runWrapper("provider: aws, azure, blacksmith-testbox, or daytona\n", args, {
11841184
env: {
11851185
OPENCLAW_FAKE_CRABBOX_VERSION: "crabbox 0.40.0",
1186-
...env,
1186+
...(env as Record<string, string>),
11871187
},
11881188
});
11891189

0 commit comments

Comments
 (0)