@hasna/switcher 0.2.6 → 0.2.8
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/README.md +148 -8
- package/dist/antigravity-config.d.ts +7 -0
- package/dist/bedrock.d.ts +2 -0
- package/dist/chatgpt-launch.d.ts +2 -1
- package/dist/cli/index.js +1665 -267
- package/dist/codex-session-discovery.d.ts +24 -0
- package/dist/codex-state-bridge.d.ts +14 -0
- package/dist/codex-state-bridge.js +568 -0
- package/dist/domain.d.ts +18 -8
- package/dist/generated/api.d.ts +17 -5
- package/dist/harness-arguments.d.ts +8 -0
- package/dist/harness-types.d.ts +2 -0
- package/dist/harnesses.d.ts +2 -2
- package/dist/index.js +23 -4
- package/dist/junie-config.d.ts +8 -0
- package/dist/launcher.d.ts +4 -1
- package/dist/mcp/index.js +88 -11
- package/dist/model-policy-schema.d.ts +3 -0
- package/dist/model-policy.d.ts +1 -0
- package/dist/native-cli-settings.d.ts +6 -0
- package/dist/native-model-policy.d.ts +1 -1
- package/dist/native-state-import.d.ts +44 -0
- package/dist/native-state.d.ts +32 -0
- package/dist/sdk.d.ts +18 -9
- package/dist/sdk.js +23 -4
- package/dist/serve/index.js +78 -7
- package/docs/MODEL-POLICY.md +6 -2
- package/openapi.json +53 -1
- package/package.json +1 -1
package/dist/domain.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { type RoutingEvent } from "./model-policy-schema";
|
|
|
3
3
|
export { modelPolicySchema, routingEventSchema, routingEventsSchema } from "./model-policy-schema";
|
|
4
4
|
export type { ModelPolicy, RoutingEvent } from "./model-policy-schema";
|
|
5
5
|
export type { AuthStyle } from "./auth";
|
|
6
|
-
export declare const VERSION = "0.2.
|
|
7
|
-
export declare const harnessSchema: z.ZodEnum<["claude", "codex", "grok", "opencode", "opencode2", "pi", "omp", "dsh", "cline", "hermes", "prime-agent", "gemini", "aider", "kilo"]>;
|
|
6
|
+
export declare const VERSION = "0.2.7";
|
|
7
|
+
export declare const harnessSchema: z.ZodEnum<["claude", "codex", "grok", "opencode", "opencode2", "pi", "omp", "dsh", "cline", "hermes", "prime-agent", "gemini", "antigravity", "junie", "aider", "kilo"]>;
|
|
8
8
|
export declare const protocolSchema: z.ZodEnum<["anthropic-messages", "openai-responses", "openai-chat", "gemini-generate-content"]>;
|
|
9
9
|
export declare const idSchema: z.ZodString;
|
|
10
10
|
export declare function endpoint(value: string): string;
|
|
@@ -444,10 +444,11 @@ export declare const profileInputSchema: z.ZodObject<{
|
|
|
444
444
|
id: z.ZodString;
|
|
445
445
|
name: z.ZodString;
|
|
446
446
|
providerId: z.ZodString;
|
|
447
|
-
harness: z.ZodEnum<["claude", "codex", "grok", "opencode", "opencode2", "pi", "omp", "dsh", "cline", "hermes", "prime-agent", "gemini", "aider", "kilo"]>;
|
|
447
|
+
harness: z.ZodEnum<["claude", "codex", "grok", "opencode", "opencode2", "pi", "omp", "dsh", "cline", "hermes", "prime-agent", "gemini", "antigravity", "junie", "aider", "kilo"]>;
|
|
448
448
|
model: z.ZodString;
|
|
449
449
|
modelPolicy: z.ZodOptional<z.ZodObject<{
|
|
450
450
|
version: z.ZodDefault<z.ZodLiteral<1>>;
|
|
451
|
+
selection: z.ZodOptional<z.ZodEnum<["restricted", "catalog"]>>;
|
|
451
452
|
roles: z.ZodOptional<z.ZodObject<{
|
|
452
453
|
subagent: z.ZodOptional<z.ZodString>;
|
|
453
454
|
fast: z.ZodOptional<z.ZodString>;
|
|
@@ -481,6 +482,7 @@ export declare const profileInputSchema: z.ZodObject<{
|
|
|
481
482
|
fallbacks: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>, Record<string, string[]>, Record<string, string[]>>>;
|
|
482
483
|
}, "strict", z.ZodTypeAny, {
|
|
483
484
|
version: 1;
|
|
485
|
+
selection?: "restricted" | "catalog" | undefined;
|
|
484
486
|
roles?: {
|
|
485
487
|
subagent?: string | undefined;
|
|
486
488
|
fast?: string | undefined;
|
|
@@ -496,6 +498,7 @@ export declare const profileInputSchema: z.ZodObject<{
|
|
|
496
498
|
fallbacks?: Record<string, string[]> | undefined;
|
|
497
499
|
}, {
|
|
498
500
|
version?: 1 | undefined;
|
|
501
|
+
selection?: "restricted" | "catalog" | undefined;
|
|
499
502
|
roles?: {
|
|
500
503
|
subagent?: string | undefined;
|
|
501
504
|
fast?: string | undefined;
|
|
@@ -514,10 +517,11 @@ export declare const profileInputSchema: z.ZodObject<{
|
|
|
514
517
|
id: string;
|
|
515
518
|
name: string;
|
|
516
519
|
providerId: string;
|
|
517
|
-
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "aider" | "kilo";
|
|
520
|
+
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "antigravity" | "junie" | "aider" | "kilo";
|
|
518
521
|
model: string;
|
|
519
522
|
modelPolicy?: {
|
|
520
523
|
version: 1;
|
|
524
|
+
selection?: "restricted" | "catalog" | undefined;
|
|
521
525
|
roles?: {
|
|
522
526
|
subagent?: string | undefined;
|
|
523
527
|
fast?: string | undefined;
|
|
@@ -536,10 +540,11 @@ export declare const profileInputSchema: z.ZodObject<{
|
|
|
536
540
|
id: string;
|
|
537
541
|
name: string;
|
|
538
542
|
providerId: string;
|
|
539
|
-
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "aider" | "kilo";
|
|
543
|
+
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "antigravity" | "junie" | "aider" | "kilo";
|
|
540
544
|
model: string;
|
|
541
545
|
modelPolicy?: {
|
|
542
546
|
version?: 1 | undefined;
|
|
547
|
+
selection?: "restricted" | "catalog" | undefined;
|
|
543
548
|
roles?: {
|
|
544
549
|
subagent?: string | undefined;
|
|
545
550
|
fast?: string | undefined;
|
|
@@ -558,10 +563,11 @@ export declare const profileInputSchema: z.ZodObject<{
|
|
|
558
563
|
export declare const runInputSchema: z.ZodObject<{
|
|
559
564
|
modelPolicyVersion: z.ZodLiteral<1>;
|
|
560
565
|
profileId: z.ZodString;
|
|
561
|
-
harness: z.ZodEnum<["claude", "codex", "grok", "opencode", "opencode2", "pi", "omp", "dsh", "cline", "hermes", "prime-agent", "gemini", "aider", "kilo"]>;
|
|
566
|
+
harness: z.ZodEnum<["claude", "codex", "grok", "opencode", "opencode2", "pi", "omp", "dsh", "cline", "hermes", "prime-agent", "gemini", "antigravity", "junie", "aider", "kilo"]>;
|
|
562
567
|
model: z.ZodString;
|
|
563
568
|
modelPolicy: z.ZodOptional<z.ZodObject<{
|
|
564
569
|
version: z.ZodDefault<z.ZodLiteral<1>>;
|
|
570
|
+
selection: z.ZodOptional<z.ZodEnum<["restricted", "catalog"]>>;
|
|
565
571
|
roles: z.ZodOptional<z.ZodObject<{
|
|
566
572
|
subagent: z.ZodOptional<z.ZodString>;
|
|
567
573
|
fast: z.ZodOptional<z.ZodString>;
|
|
@@ -595,6 +601,7 @@ export declare const runInputSchema: z.ZodObject<{
|
|
|
595
601
|
fallbacks: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>, Record<string, string[]>, Record<string, string[]>>>;
|
|
596
602
|
}, "strict", z.ZodTypeAny, {
|
|
597
603
|
version: 1;
|
|
604
|
+
selection?: "restricted" | "catalog" | undefined;
|
|
598
605
|
roles?: {
|
|
599
606
|
subagent?: string | undefined;
|
|
600
607
|
fast?: string | undefined;
|
|
@@ -610,6 +617,7 @@ export declare const runInputSchema: z.ZodObject<{
|
|
|
610
617
|
fallbacks?: Record<string, string[]> | undefined;
|
|
611
618
|
}, {
|
|
612
619
|
version?: 1 | undefined;
|
|
620
|
+
selection?: "restricted" | "catalog" | undefined;
|
|
613
621
|
roles?: {
|
|
614
622
|
subagent?: string | undefined;
|
|
615
623
|
fast?: string | undefined;
|
|
@@ -626,13 +634,14 @@ export declare const runInputSchema: z.ZodObject<{
|
|
|
626
634
|
}>>;
|
|
627
635
|
planToken: z.ZodString;
|
|
628
636
|
}, "strict", z.ZodTypeAny, {
|
|
629
|
-
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "aider" | "kilo";
|
|
637
|
+
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "antigravity" | "junie" | "aider" | "kilo";
|
|
630
638
|
model: string;
|
|
631
639
|
modelPolicyVersion: 1;
|
|
632
640
|
profileId: string;
|
|
633
641
|
planToken: string;
|
|
634
642
|
modelPolicy?: {
|
|
635
643
|
version: 1;
|
|
644
|
+
selection?: "restricted" | "catalog" | undefined;
|
|
636
645
|
roles?: {
|
|
637
646
|
subagent?: string | undefined;
|
|
638
647
|
fast?: string | undefined;
|
|
@@ -648,13 +657,14 @@ export declare const runInputSchema: z.ZodObject<{
|
|
|
648
657
|
fallbacks?: Record<string, string[]> | undefined;
|
|
649
658
|
} | undefined;
|
|
650
659
|
}, {
|
|
651
|
-
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "aider" | "kilo";
|
|
660
|
+
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "antigravity" | "junie" | "aider" | "kilo";
|
|
652
661
|
model: string;
|
|
653
662
|
modelPolicyVersion: 1;
|
|
654
663
|
profileId: string;
|
|
655
664
|
planToken: string;
|
|
656
665
|
modelPolicy?: {
|
|
657
666
|
version?: 1 | undefined;
|
|
667
|
+
selection?: "restricted" | "catalog" | undefined;
|
|
658
668
|
roles?: {
|
|
659
669
|
subagent?: string | undefined;
|
|
660
670
|
fast?: string | undefined;
|
package/dist/generated/api.d.ts
CHANGED
|
@@ -432,7 +432,7 @@ export interface components {
|
|
|
432
432
|
name: string;
|
|
433
433
|
providerId: string;
|
|
434
434
|
/** @enum {string} */
|
|
435
|
-
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "aider" | "kilo";
|
|
435
|
+
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "antigravity" | "junie" | "aider" | "kilo";
|
|
436
436
|
model: string;
|
|
437
437
|
modelPolicy?: {
|
|
438
438
|
/**
|
|
@@ -440,6 +440,8 @@ export interface components {
|
|
|
440
440
|
* @enum {number}
|
|
441
441
|
*/
|
|
442
442
|
version: 1;
|
|
443
|
+
/** @enum {string} */
|
|
444
|
+
selection?: "restricted" | "catalog";
|
|
443
445
|
roles?: {
|
|
444
446
|
subagent?: string;
|
|
445
447
|
fast?: string;
|
|
@@ -464,7 +466,7 @@ export interface components {
|
|
|
464
466
|
name: string;
|
|
465
467
|
providerId: string;
|
|
466
468
|
/** @enum {string} */
|
|
467
|
-
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "aider" | "kilo";
|
|
469
|
+
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "antigravity" | "junie" | "aider" | "kilo";
|
|
468
470
|
model: string;
|
|
469
471
|
modelPolicy?: {
|
|
470
472
|
/**
|
|
@@ -472,6 +474,8 @@ export interface components {
|
|
|
472
474
|
* @enum {number}
|
|
473
475
|
*/
|
|
474
476
|
version: 1;
|
|
477
|
+
/** @enum {string} */
|
|
478
|
+
selection?: "restricted" | "catalog";
|
|
475
479
|
roles?: {
|
|
476
480
|
subagent?: string;
|
|
477
481
|
fast?: string;
|
|
@@ -513,6 +517,8 @@ export interface components {
|
|
|
513
517
|
* @enum {number}
|
|
514
518
|
*/
|
|
515
519
|
version: 1;
|
|
520
|
+
/** @enum {string} */
|
|
521
|
+
selection?: "restricted" | "catalog";
|
|
516
522
|
roles?: {
|
|
517
523
|
subagent?: string;
|
|
518
524
|
fast?: string;
|
|
@@ -658,7 +664,7 @@ export interface components {
|
|
|
658
664
|
name: string;
|
|
659
665
|
providerId: string;
|
|
660
666
|
/** @enum {string} */
|
|
661
|
-
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "aider" | "kilo";
|
|
667
|
+
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "antigravity" | "junie" | "aider" | "kilo";
|
|
662
668
|
model: string;
|
|
663
669
|
modelPolicy?: {
|
|
664
670
|
/**
|
|
@@ -666,6 +672,8 @@ export interface components {
|
|
|
666
672
|
* @enum {number}
|
|
667
673
|
*/
|
|
668
674
|
version: 1;
|
|
675
|
+
/** @enum {string} */
|
|
676
|
+
selection?: "restricted" | "catalog";
|
|
669
677
|
roles?: {
|
|
670
678
|
subagent?: string;
|
|
671
679
|
fast?: string;
|
|
@@ -715,7 +723,7 @@ export interface components {
|
|
|
715
723
|
modelPolicyVersion: 1;
|
|
716
724
|
profileId: string;
|
|
717
725
|
/** @enum {string} */
|
|
718
|
-
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "aider" | "kilo";
|
|
726
|
+
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "antigravity" | "junie" | "aider" | "kilo";
|
|
719
727
|
model: string;
|
|
720
728
|
modelPolicy?: {
|
|
721
729
|
/**
|
|
@@ -723,6 +731,8 @@ export interface components {
|
|
|
723
731
|
* @enum {number}
|
|
724
732
|
*/
|
|
725
733
|
version: 1;
|
|
734
|
+
/** @enum {string} */
|
|
735
|
+
selection?: "restricted" | "catalog";
|
|
726
736
|
roles?: {
|
|
727
737
|
subagent?: string;
|
|
728
738
|
fast?: string;
|
|
@@ -770,7 +780,7 @@ export interface components {
|
|
|
770
780
|
modelPolicyVersion?: 1;
|
|
771
781
|
profileId: string;
|
|
772
782
|
/** @enum {string} */
|
|
773
|
-
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "aider" | "kilo";
|
|
783
|
+
harness: "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "gemini" | "antigravity" | "junie" | "aider" | "kilo";
|
|
774
784
|
model: string;
|
|
775
785
|
modelPolicy?: {
|
|
776
786
|
/**
|
|
@@ -778,6 +788,8 @@ export interface components {
|
|
|
778
788
|
* @enum {number}
|
|
779
789
|
*/
|
|
780
790
|
version: 1;
|
|
791
|
+
/** @enum {string} */
|
|
792
|
+
selection?: "restricted" | "catalog";
|
|
781
793
|
roles?: {
|
|
782
794
|
subagent?: string;
|
|
783
795
|
fast?: string;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import type { HarnessId } from "./harness-types";
|
|
2
|
+
export declare function codexOptionTakesValue(option: string): boolean;
|
|
3
|
+
export declare function codexOptionRequestsHelp(option: string): boolean;
|
|
4
|
+
export declare function codexConfigPath(key: string): string[];
|
|
5
|
+
export declare function codexConfigRoots(key: string): string[];
|
|
6
|
+
/** Locate a native subcommand without confusing option values or a literal
|
|
7
|
+
* prompt after -- with that command. Reuse the validated Codex option grammar. */
|
|
8
|
+
export declare function codexCommandIndex(args: readonly string[]): number;
|
|
2
9
|
export declare function geminiPolicyArguments(input: readonly string[], originalHome: string): string[];
|
|
3
10
|
export declare function assertHarnessArguments(harness: HarnessId, args: readonly string[], options?: {
|
|
4
11
|
additionalReserved?: readonly string[];
|
|
5
12
|
reserveCodexConfig?: boolean;
|
|
13
|
+
reservedCodexRoots?: readonly string[];
|
|
6
14
|
}): void;
|
package/dist/harness-types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { CompiledModelPolicy, ModelPolicy } from "./model-policy";
|
|
|
3
3
|
import type { NativeModelPolicy } from "./native-model-policy";
|
|
4
4
|
import type { RoutingEvent } from "./inference-gateway";
|
|
5
5
|
import type { ReasoningEffort } from "./reasoning";
|
|
6
|
+
import type { NativeState } from "./native-state";
|
|
6
7
|
export type HarnessId = Profile["harness"];
|
|
7
8
|
export type HarnessLaunchInput = {
|
|
8
9
|
harness: HarnessId;
|
|
@@ -26,6 +27,7 @@ export type HarnessLaunchInput = {
|
|
|
26
27
|
onRoutingEvent?: (event: RoutingEvent) => void;
|
|
27
28
|
reasoning?: ReasoningEffort;
|
|
28
29
|
dangerouslyBypassApprovalsAndSandbox?: boolean;
|
|
30
|
+
sharedState?: NativeState;
|
|
29
31
|
};
|
|
30
32
|
export type PreparedLaunch = {
|
|
31
33
|
executable: string;
|
package/dist/harnesses.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ import { type ProviderRequestTiming } from "./provider-request";
|
|
|
2
2
|
import { type ReasoningEffort } from "./reasoning";
|
|
3
3
|
import type { HarnessId, HarnessLaunchInput, PreparedLaunch } from "./harness-types";
|
|
4
4
|
export declare function detectHarness(harness: HarnessId, override?: string): Promise<{
|
|
5
|
-
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "aider" | "kilo";
|
|
5
|
+
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "antigravity" | "junie" | "aider" | "kilo";
|
|
6
6
|
executable: string;
|
|
7
7
|
available: boolean;
|
|
8
8
|
version: string;
|
|
9
9
|
installation: import("./harness-installation").HarnessInstallation;
|
|
10
10
|
} | {
|
|
11
|
-
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "aider" | "kilo";
|
|
11
|
+
harness: "gemini" | "claude" | "codex" | "grok" | "opencode" | "opencode2" | "pi" | "omp" | "dsh" | "cline" | "hermes" | "prime-agent" | "antigravity" | "junie" | "aider" | "kilo";
|
|
12
12
|
executable: string;
|
|
13
13
|
available: boolean;
|
|
14
14
|
version: undefined;
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ var fallbacksSchema = z2.record(policyModelIdSchema, z2.array(policyModelIdSchem
|
|
|
21
21
|
});
|
|
22
22
|
var modelPolicySchema = z2.object({
|
|
23
23
|
version: z2.literal(1).default(1),
|
|
24
|
+
selection: z2.enum(["restricted", "catalog"]).optional(),
|
|
24
25
|
roles: z2.object({
|
|
25
26
|
subagent: policyModelIdSchema.optional(),
|
|
26
27
|
fast: policyModelIdSchema.optional(),
|
|
@@ -51,7 +52,7 @@ var routingEventSchema = z2.object({
|
|
|
51
52
|
}).strict();
|
|
52
53
|
var routingEventsSchema = z2.array(routingEventSchema).max(1000);
|
|
53
54
|
// src/domain.ts
|
|
54
|
-
var harnessSchema = z3.enum(["claude", "codex", "grok", "opencode", "opencode2", "pi", "omp", "dsh", "cline", "hermes", "prime-agent", "gemini", "aider", "kilo"]);
|
|
55
|
+
var harnessSchema = z3.enum(["claude", "codex", "grok", "opencode", "opencode2", "pi", "omp", "dsh", "cline", "hermes", "prime-agent", "gemini", "antigravity", "junie", "aider", "kilo"]);
|
|
55
56
|
var protocolSchema = z3.enum(["anthropic-messages", "openai-responses", "openai-chat", "gemini-generate-content"]);
|
|
56
57
|
var idSchema = z3.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,79}$/);
|
|
57
58
|
var label = z3.string().min(1).max(200);
|
|
@@ -175,7 +176,7 @@ function compatible(harness, protocol) {
|
|
|
175
176
|
return protocol === "anthropic-messages";
|
|
176
177
|
if (harness === "codex")
|
|
177
178
|
return protocol === "openai-responses";
|
|
178
|
-
if (harness === "gemini")
|
|
179
|
+
if (harness === "gemini" || harness === "antigravity")
|
|
179
180
|
return protocol === "gemini-generate-content";
|
|
180
181
|
if (protocol === "gemini-generate-content")
|
|
181
182
|
return false;
|
|
@@ -219,6 +220,19 @@ async function boundedJson(response, maxBytes = MAX_BYTES) {
|
|
|
219
220
|
// src/sdk.ts
|
|
220
221
|
import { createClientTransport } from "@hasna/contracts/client";
|
|
221
222
|
|
|
223
|
+
// src/bedrock.ts
|
|
224
|
+
function bedrockMantleOrigin(value) {
|
|
225
|
+
let url;
|
|
226
|
+
try {
|
|
227
|
+
url = new URL(value);
|
|
228
|
+
} catch {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
if (url.protocol !== "https:" || url.port || url.username || url.password || url.search || url.hash || url.pathname.replace(/\/+$/, "") !== "/anthropic/v1")
|
|
232
|
+
return;
|
|
233
|
+
return /^bedrock-mantle\.[a-z]{2}(?:-[a-z]+)+-\d+\.api\.aws$/.test(url.hostname) ? url.origin : undefined;
|
|
234
|
+
}
|
|
235
|
+
|
|
222
236
|
// src/presets.ts
|
|
223
237
|
var route = (protocol, baseUrl, options = {}) => ({
|
|
224
238
|
protocol,
|
|
@@ -251,8 +265,10 @@ var providerPresets = [
|
|
|
251
265
|
], ["https://api-docs.deepseek.com/guides/anthropic_api", "https://api-docs.deepseek.com/api/list-models", "https://api-docs.deepseek.com/updates/", "https://api-docs.deepseek.com/guides/responses_api/"], "DEEPSEEK_API_KEY"),
|
|
252
266
|
preset("openrouter", "OpenRouter", ["openai-chat", "openai-responses", "anthropic-messages"].map((protocol) => route(protocol, "https://openrouter.ai/api/v1", { catalogAuthStyle: "none", credentialCheck: { method: "GET", path: "key" } })), ["https://openrouter.ai/docs/api/api-reference/models/list-all-models-and-their-properties", "https://openrouter.ai/docs/guides/overview"], "OPENROUTER_API_KEY"),
|
|
253
267
|
preset("anthropic", "Anthropic", [route("anthropic-messages", "https://api.anthropic.com/v1", { authStyle: "x-api-key" })], ["https://platform.claude.com/docs/en/api/overview", "https://platform.claude.com/docs/en/api/models/list"], "ANTHROPIC_API_KEY"),
|
|
268
|
+
preset("bedrock", "Amazon Bedrock (Mantle)", [route("anthropic-messages", undefined, { authStyle: "x-api-key", catalogAuthStyle: "bearer", notes: ["Pass the regional https://bedrock-mantle.<region>.api.aws/anthropic/v1 endpoint and a Bedrock API key. The authenticated catalog is /v1/models on that same origin. Model access and regional availability remain controlled by the AWS account; this route does not distribute or inherit AWS administrative credentials."] })], ["https://docs.aws.amazon.com/bedrock/latest/userguide/inference-messages-api.html", "https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys.html"], "AWS_BEARER_TOKEN_BEDROCK"),
|
|
254
269
|
preset("gemini", "Google Gemini", [route("gemini-generate-content", "https://generativelanguage.googleapis.com/v1beta", {
|
|
255
270
|
authStyle: "x-api-key",
|
|
271
|
+
credentialCheck: { method: "GET", path: "models" },
|
|
256
272
|
catalogBaseUrl: "https://generativelanguage.googleapis.com/v1beta",
|
|
257
273
|
catalogFormat: "gemini",
|
|
258
274
|
catalogAuthStyle: "x-api-key",
|
|
@@ -323,16 +339,19 @@ function providerFromPreset(presetId, options = {}) {
|
|
|
323
339
|
const baseUrl = options.baseUrl ?? selected.baseUrl;
|
|
324
340
|
if (!baseUrl)
|
|
325
341
|
throw new Fault(400, "endpoint_required", "This preset requires an explicit --url for its inference endpoint.");
|
|
342
|
+
const bedrockOrigin = presetId === "bedrock" ? bedrockMantleOrigin(endpoint(baseUrl)) : undefined;
|
|
343
|
+
if (presetId === "bedrock" && !bedrockOrigin)
|
|
344
|
+
throw new Fault(400, "invalid_url", "Bedrock requires a regional HTTPS Mantle endpoint ending in /anthropic/v1.");
|
|
326
345
|
if (presetId === "azure-openai" && !/\/openai\/v1$/.test(endpoint(baseUrl)))
|
|
327
346
|
throw new Fault(400, "invalid_url", "Azure OpenAI v1 requires an explicit endpoint ending in /openai/v1; deployment and api-version URLs are unsupported.");
|
|
328
347
|
if (options.baseUrl && selected.baseUrl && new URL(endpoint(options.baseUrl)).origin !== new URL(selected.baseUrl).origin && preset2.credentialEnv && !options.credentialEnv)
|
|
329
348
|
throw new Fault(422, "credential_authority", "An endpoint on another origin requires an explicit --credential-env reference.");
|
|
330
|
-
const suffix = selected.protocol === "anthropic-messages" ? "messages" : selected.protocol === "openai-responses" ? "responses" : "chat";
|
|
349
|
+
const suffix = selected.protocol === "anthropic-messages" ? "messages" : selected.protocol === "openai-responses" ? "responses" : selected.protocol === "gemini-generate-content" ? "generate-content" : "chat";
|
|
331
350
|
if (presetId === "fireworks" && !options.catalogBaseUrl && !options.catalogAccountId)
|
|
332
351
|
throw new Fault(400, "catalog_account_required", "Fireworks model discovery requires --catalog-account-id or an explicit --catalog-url.");
|
|
333
352
|
if (selected.catalogFormat === "none" && options.catalogFormat && options.catalogFormat !== "none" && !options.catalogBaseUrl)
|
|
334
353
|
throw new Fault(400, "catalog_url_required", "This preset requires an explicit --catalog-url when enabling a catalog parser.");
|
|
335
|
-
const catalogBaseUrl = options.catalogBaseUrl ?? (presetId === "fireworks" && options.catalogAccountId ? `https://api.fireworks.ai/v1/accounts/${encodeURIComponent(options.catalogAccountId)}` : options.baseUrl ? undefined : selected.catalogBaseUrl);
|
|
354
|
+
const catalogBaseUrl = options.catalogBaseUrl ?? (bedrockOrigin ? `${bedrockOrigin}/v1` : presetId === "fireworks" && options.catalogAccountId ? `https://api.fireworks.ai/v1/accounts/${encodeURIComponent(options.catalogAccountId)}` : options.baseUrl ? undefined : selected.catalogBaseUrl);
|
|
336
355
|
return parse(providerInputSchema, {
|
|
337
356
|
id: options.id ?? `${preset2.id}-${suffix}`,
|
|
338
357
|
name: preset2.name,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HarnessLaunchInput, PreparedLaunch } from "./harness-types";
|
|
2
|
+
export declare function validateJunieConfiguration(cwd: string, env?: NodeJS.ProcessEnv): Promise<{
|
|
3
|
+
configs: Record<string, any>[];
|
|
4
|
+
settings: Record<string, any>[];
|
|
5
|
+
allowlist: string | undefined;
|
|
6
|
+
globalInstructions: string | undefined;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function prepareJunie(input: HarnessLaunchInput): Promise<PreparedLaunch>;
|
package/dist/launcher.d.ts
CHANGED
|
@@ -4,12 +4,14 @@ import { type LaunchPlan, type ProviderInput } from "./domain";
|
|
|
4
4
|
import { type OriContract } from "./ori-backend";
|
|
5
5
|
import type { ChatGPTInstallation, ClaudeDesktopInstallation } from "./desktop-apps";
|
|
6
6
|
import type { ReasoningEffort } from "./reasoning";
|
|
7
|
+
import { type NativeState } from "./native-state";
|
|
7
8
|
import type { RoutingEvent } from "./inference-gateway";
|
|
8
9
|
export { childEnvironment } from "./harness-environment";
|
|
9
10
|
export type LaunchBackend = "direct" | "ori";
|
|
10
11
|
export type LaunchOptions = {
|
|
11
12
|
desktop?: ChatGPTInstallation;
|
|
12
13
|
claudeDesktop?: ClaudeDesktopInstallation;
|
|
14
|
+
shareNativeState?: boolean;
|
|
13
15
|
reasoning?: ReasoningEffort;
|
|
14
16
|
dangerouslyBypassApprovalsAndSandbox?: boolean;
|
|
15
17
|
backend?: LaunchBackend;
|
|
@@ -28,8 +30,9 @@ type OriPreparationOptions = Pick<LaunchOptions, "oriExecutable" | "args" | "res
|
|
|
28
30
|
stateDir?: string;
|
|
29
31
|
cwd?: string;
|
|
30
32
|
onRoutingEvent?: (event: RoutingEvent) => void;
|
|
33
|
+
sharedState?: NativeState;
|
|
31
34
|
};
|
|
32
|
-
type OriSupportedHarness = Exclude<LaunchPlan["profile"]["harness"], "omp" | "cline" | "hermes" | "prime-agent" | "gemini" | "aider" | "opencode" | "kilo">;
|
|
35
|
+
type OriSupportedHarness = Exclude<LaunchPlan["profile"]["harness"], "omp" | "cline" | "hermes" | "prime-agent" | "gemini" | "aider" | "opencode" | "kilo" | "antigravity" | "junie">;
|
|
33
36
|
export declare function validateOriForPlan(plan: LaunchPlan, options?: Pick<OriPreparationOptions, "oriExecutable" | "args" | "credentialEnv" | "cwd">): Promise<{
|
|
34
37
|
contract: OriContract;
|
|
35
38
|
request: ReturnType<typeof buildOriRequest>;
|