@benjamolina/pi-antigravity-guard 0.4.9 → 0.5.0
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 +11 -1
- package/dist/catalog.d.ts +298 -3
- package/dist/catalog.js +81 -1
- package/dist/context.d.ts +4 -1
- package/dist/context.js +34 -10
- package/dist/envelope.js +22 -0
- package/dist/project.js +2 -1
- package/dist/stream.js +2 -2
- package/dist/tool-context.js +2 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Choose browser login, or choose manual login and paste the complete callback URL
|
|
|
14
14
|
|
|
15
15
|
## Text registration is not tool enablement
|
|
16
16
|
|
|
17
|
-
All
|
|
17
|
+
All twelve rows below are registered for text. The exact `antigravity-gemini-3.8-flash` `off` route is enabled for tools from recorded direct evidence; every other production route is **not enabled for tools**, so its context with a declaration, assistant tool call, or tool result fails locally before any network request. Text-only requests retain their released behavior.
|
|
18
18
|
|
|
19
19
|
| Public ID | Exposed Pi levels | Tool state | Admission |
|
|
20
20
|
|---|---|---|---|
|
|
@@ -25,6 +25,11 @@ All seven rows below are registered for text. The exact `antigravity-gemini-3.8-
|
|
|
25
25
|
| `antigravity-claude-sonnet-4.6` | off, high | Enabled (off, high) | pi-json-tool-loop/claude-sonnet-4.6-off-v1 |
|
|
26
26
|
| `antigravity-claude-opus-4.6-thinking` | off, high | Enabled (off, high) | pi-json-tool-loop/claude-opus-4.6-thinking-off-v1 |
|
|
27
27
|
| `antigravity-gpt-oss-120b` | off, medium | Enabled (off, medium) | pi-json-tool-loop/gpt-oss-120b-off-v1 |
|
|
28
|
+
| `antigravity-gemini-4-argon` | off, low, medium, high | Enabled (off, low, medium, high) | pi-json-tool-loop/gemini-4-argon-off-v1 |
|
|
29
|
+
| `antigravity-gemini-4-carbon` | off, low, medium, high | Enabled (off, low, medium, high) | pi-json-tool-loop/gemini-4-carbon-off-v1 |
|
|
30
|
+
| `antigravity-gemini-4-neon` | off, low, medium, high, xhigh | Enabled (off, low, medium, high, xhigh) | pi-json-tool-loop/gemini-4-neon-off-v1 |
|
|
31
|
+
| `antigravity-gemini-4-hydrogen` | off, low, medium, high, xhigh | Enabled (off, low, medium, high, xhigh) | pi-json-tool-loop/gemini-4-hydrogen-off-v1 |
|
|
32
|
+
| `antigravity-gemini-3.5-flash-lite` | off, low | Enabled (off, low) | pi-json-tool-loop/gemini-3.5-flash-lite-off-v1 |
|
|
28
33
|
|
|
29
34
|
`off` is available for every row even though it is omitted from Pi's level map; omitted reasoning also selects that row's `off` route. Unsupported levels are not advertised and are rejected before transport. `antigravity-gemini-3.5-flash` is not registered or advertised as supported because its recorded HTTP-200 response lacks the strict terminal metadata required for admission. A future `fixture-qualified` route remains disabled for ordinary tool use; only separately authorized direct validation for the exact route may make it enabled.
|
|
30
35
|
|
|
@@ -51,6 +56,11 @@ Only the evidence-enabled Gemini 3.8 Flash `off` route uses the `parametersJsonS
|
|
|
51
56
|
| `antigravity-claude-sonnet-4.6` | off, high | 250,000 / 64,000 |
|
|
52
57
|
| `antigravity-claude-opus-4.6-thinking` | off, high | 250,000 / 64,000 |
|
|
53
58
|
| `antigravity-gpt-oss-120b` | off, medium | 131,072 / 32,768 |
|
|
59
|
+
| `antigravity-gemini-4-argon` | off, low, medium, high | 1,048,576 / 65,536 |
|
|
60
|
+
| `antigravity-gemini-4-carbon` | off, low, medium, high | 1,048,576 / 262,144 |
|
|
61
|
+
| `antigravity-gemini-4-neon` | off, low, medium, high, xhigh | 1,048,576 / 262,144 |
|
|
62
|
+
| `antigravity-gemini-4-hydrogen` | off, low, medium, high, xhigh | 1,048,576 / 262,144 |
|
|
63
|
+
| `antigravity-gemini-3.5-flash-lite` | off, low | 1,048,576 / 65,535 |
|
|
54
64
|
|
|
55
65
|
An explicit `maxTokens` must be a positive integer no greater than the row's output limit. For a route with a positive finite thinking budget, it must also be greater than that budget. When `maxTokens` is omitted, the provider uses 4,096 unless a larger finite thinking budget needs a 1,024-token answer reserve, always bounded by the row's output limit. Custom `thinkingBudgets` are unsupported and rejected.
|
|
56
66
|
|
package/dist/catalog.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type StandardReasoningLevel = "off" | "minimal" | "low" | "medium" | "high";
|
|
2
|
-
type NativeThinkingLevel = "low" | "medium" | "high";
|
|
1
|
+
export type StandardReasoningLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
2
|
+
type NativeThinkingLevel = "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
3
3
|
export interface ToolEvidenceRef {
|
|
4
4
|
readonly record: string;
|
|
5
5
|
readonly revision: string;
|
|
@@ -51,7 +51,9 @@ export interface CatalogEntry {
|
|
|
51
51
|
readonly publicId: string;
|
|
52
52
|
readonly descriptor: {
|
|
53
53
|
readonly name: string;
|
|
54
|
-
readonly thinkingLevelMap: Readonly<Record<"minimal" | "low" | "medium" | "high", string | null
|
|
54
|
+
readonly thinkingLevelMap: Readonly<Record<"minimal" | "low" | "medium" | "high", string | null> & {
|
|
55
|
+
readonly xhigh?: string | null;
|
|
56
|
+
}>;
|
|
55
57
|
readonly contextWindow: number;
|
|
56
58
|
readonly maxTokens: number;
|
|
57
59
|
};
|
|
@@ -401,6 +403,298 @@ declare const CATALOG: readonly [{
|
|
|
401
403
|
readonly kind: "gemini-envelope";
|
|
402
404
|
readonly family: "gpt-oss";
|
|
403
405
|
};
|
|
406
|
+
}, {
|
|
407
|
+
readonly publicId: "antigravity-gemini-4-argon";
|
|
408
|
+
readonly descriptor: {
|
|
409
|
+
readonly name: "Gemini 4 Argon (Antigravity, text only)";
|
|
410
|
+
readonly thinkingLevelMap: {
|
|
411
|
+
readonly minimal: null;
|
|
412
|
+
readonly low: "low";
|
|
413
|
+
readonly medium: "medium";
|
|
414
|
+
readonly high: "high";
|
|
415
|
+
};
|
|
416
|
+
readonly contextWindow: 1048576;
|
|
417
|
+
readonly maxTokens: 65536;
|
|
418
|
+
};
|
|
419
|
+
readonly routes: {
|
|
420
|
+
readonly off: {
|
|
421
|
+
readonly wireModel: "gemini-4-argon-low";
|
|
422
|
+
readonly thinking: {
|
|
423
|
+
readonly kind: "budget";
|
|
424
|
+
readonly budget: 0;
|
|
425
|
+
readonly includeThoughts: false;
|
|
426
|
+
};
|
|
427
|
+
readonly tools: ToolCapability;
|
|
428
|
+
};
|
|
429
|
+
readonly low: {
|
|
430
|
+
readonly wireModel: "gemini-4-argon-low";
|
|
431
|
+
readonly thinking: {
|
|
432
|
+
readonly kind: "budget";
|
|
433
|
+
readonly budget: 1000;
|
|
434
|
+
readonly includeThoughts: true;
|
|
435
|
+
};
|
|
436
|
+
readonly tools: ToolCapability;
|
|
437
|
+
};
|
|
438
|
+
readonly medium: {
|
|
439
|
+
readonly wireModel: "gemini-4-argon-medium";
|
|
440
|
+
readonly thinking: {
|
|
441
|
+
readonly kind: "budget";
|
|
442
|
+
readonly budget: 4000;
|
|
443
|
+
readonly includeThoughts: true;
|
|
444
|
+
};
|
|
445
|
+
readonly tools: ToolCapability;
|
|
446
|
+
};
|
|
447
|
+
readonly high: {
|
|
448
|
+
readonly wireModel: "gemini-4-argon-high";
|
|
449
|
+
readonly thinking: {
|
|
450
|
+
readonly kind: "budget";
|
|
451
|
+
readonly budget: -1;
|
|
452
|
+
readonly includeThoughts: true;
|
|
453
|
+
};
|
|
454
|
+
readonly tools: ToolCapability;
|
|
455
|
+
};
|
|
456
|
+
};
|
|
457
|
+
readonly replay: {
|
|
458
|
+
readonly kind: "same-public-model";
|
|
459
|
+
};
|
|
460
|
+
readonly response: {
|
|
461
|
+
readonly kind: "gemini-envelope";
|
|
462
|
+
readonly family: "gemini";
|
|
463
|
+
};
|
|
464
|
+
}, {
|
|
465
|
+
readonly publicId: "antigravity-gemini-4-carbon";
|
|
466
|
+
readonly descriptor: {
|
|
467
|
+
readonly name: "Gemini 4 Carbon (Antigravity, text only)";
|
|
468
|
+
readonly thinkingLevelMap: {
|
|
469
|
+
readonly minimal: null;
|
|
470
|
+
readonly low: "low";
|
|
471
|
+
readonly medium: "medium";
|
|
472
|
+
readonly high: "high";
|
|
473
|
+
};
|
|
474
|
+
readonly contextWindow: 1048576;
|
|
475
|
+
readonly maxTokens: 262144;
|
|
476
|
+
};
|
|
477
|
+
readonly routes: {
|
|
478
|
+
readonly off: {
|
|
479
|
+
readonly wireModel: "gemini-4-carbon-low";
|
|
480
|
+
readonly thinking: {
|
|
481
|
+
readonly kind: "budget";
|
|
482
|
+
readonly budget: 0;
|
|
483
|
+
readonly includeThoughts: false;
|
|
484
|
+
};
|
|
485
|
+
readonly tools: ToolCapability;
|
|
486
|
+
};
|
|
487
|
+
readonly low: {
|
|
488
|
+
readonly wireModel: "gemini-4-carbon-low";
|
|
489
|
+
readonly thinking: {
|
|
490
|
+
readonly kind: "budget";
|
|
491
|
+
readonly budget: 1000;
|
|
492
|
+
readonly includeThoughts: true;
|
|
493
|
+
};
|
|
494
|
+
readonly tools: ToolCapability;
|
|
495
|
+
};
|
|
496
|
+
readonly medium: {
|
|
497
|
+
readonly wireModel: "gemini-4-carbon-medium";
|
|
498
|
+
readonly thinking: {
|
|
499
|
+
readonly kind: "budget";
|
|
500
|
+
readonly budget: 4000;
|
|
501
|
+
readonly includeThoughts: true;
|
|
502
|
+
};
|
|
503
|
+
readonly tools: ToolCapability;
|
|
504
|
+
};
|
|
505
|
+
readonly high: {
|
|
506
|
+
readonly wireModel: "gemini-4-carbon-high";
|
|
507
|
+
readonly thinking: {
|
|
508
|
+
readonly kind: "budget";
|
|
509
|
+
readonly budget: -1;
|
|
510
|
+
readonly includeThoughts: true;
|
|
511
|
+
};
|
|
512
|
+
readonly tools: ToolCapability;
|
|
513
|
+
};
|
|
514
|
+
};
|
|
515
|
+
readonly replay: {
|
|
516
|
+
readonly kind: "same-public-model";
|
|
517
|
+
};
|
|
518
|
+
readonly response: {
|
|
519
|
+
readonly kind: "gemini-envelope";
|
|
520
|
+
readonly family: "gemini";
|
|
521
|
+
};
|
|
522
|
+
}, {
|
|
523
|
+
readonly publicId: "antigravity-gemini-4-neon";
|
|
524
|
+
readonly descriptor: {
|
|
525
|
+
readonly name: "Gemini 4 Neon (Antigravity, text only)";
|
|
526
|
+
readonly thinkingLevelMap: {
|
|
527
|
+
readonly minimal: null;
|
|
528
|
+
readonly low: "low";
|
|
529
|
+
readonly medium: "medium";
|
|
530
|
+
readonly high: "high";
|
|
531
|
+
readonly xhigh: "xhigh";
|
|
532
|
+
};
|
|
533
|
+
readonly contextWindow: 1048576;
|
|
534
|
+
readonly maxTokens: 262144;
|
|
535
|
+
};
|
|
536
|
+
readonly routes: {
|
|
537
|
+
readonly off: {
|
|
538
|
+
readonly wireModel: "gemini-4-neon-low";
|
|
539
|
+
readonly thinking: {
|
|
540
|
+
readonly kind: "budget";
|
|
541
|
+
readonly budget: 0;
|
|
542
|
+
readonly includeThoughts: false;
|
|
543
|
+
};
|
|
544
|
+
readonly tools: ToolCapability;
|
|
545
|
+
};
|
|
546
|
+
readonly low: {
|
|
547
|
+
readonly wireModel: "gemini-4-neon-low";
|
|
548
|
+
readonly thinking: {
|
|
549
|
+
readonly kind: "budget";
|
|
550
|
+
readonly budget: 1000;
|
|
551
|
+
readonly includeThoughts: true;
|
|
552
|
+
};
|
|
553
|
+
readonly tools: ToolCapability;
|
|
554
|
+
};
|
|
555
|
+
readonly medium: {
|
|
556
|
+
readonly wireModel: "gemini-4-neon-medium";
|
|
557
|
+
readonly thinking: {
|
|
558
|
+
readonly kind: "budget";
|
|
559
|
+
readonly budget: 4000;
|
|
560
|
+
readonly includeThoughts: true;
|
|
561
|
+
};
|
|
562
|
+
readonly tools: ToolCapability;
|
|
563
|
+
};
|
|
564
|
+
readonly high: {
|
|
565
|
+
readonly wireModel: "gemini-4-neon-high";
|
|
566
|
+
readonly thinking: {
|
|
567
|
+
readonly kind: "budget";
|
|
568
|
+
readonly budget: -1;
|
|
569
|
+
readonly includeThoughts: true;
|
|
570
|
+
};
|
|
571
|
+
readonly tools: ToolCapability;
|
|
572
|
+
};
|
|
573
|
+
readonly xhigh: {
|
|
574
|
+
readonly wireModel: "gemini-4-neon-xhigh";
|
|
575
|
+
readonly thinking: {
|
|
576
|
+
readonly kind: "budget";
|
|
577
|
+
readonly budget: -1;
|
|
578
|
+
readonly includeThoughts: true;
|
|
579
|
+
};
|
|
580
|
+
readonly tools: ToolCapability;
|
|
581
|
+
};
|
|
582
|
+
};
|
|
583
|
+
readonly replay: {
|
|
584
|
+
readonly kind: "same-public-model";
|
|
585
|
+
};
|
|
586
|
+
readonly response: {
|
|
587
|
+
readonly kind: "gemini-envelope";
|
|
588
|
+
readonly family: "gemini";
|
|
589
|
+
};
|
|
590
|
+
}, {
|
|
591
|
+
readonly publicId: "antigravity-gemini-4-hydrogen";
|
|
592
|
+
readonly descriptor: {
|
|
593
|
+
readonly name: "Gemini 4 Hydrogen (Antigravity, text only)";
|
|
594
|
+
readonly thinkingLevelMap: {
|
|
595
|
+
readonly minimal: null;
|
|
596
|
+
readonly low: "low";
|
|
597
|
+
readonly medium: "medium";
|
|
598
|
+
readonly high: "high";
|
|
599
|
+
readonly xhigh: "xhigh";
|
|
600
|
+
};
|
|
601
|
+
readonly contextWindow: 1048576;
|
|
602
|
+
readonly maxTokens: 262144;
|
|
603
|
+
};
|
|
604
|
+
readonly routes: {
|
|
605
|
+
readonly off: {
|
|
606
|
+
readonly wireModel: "gemini-4-hydrogen-low";
|
|
607
|
+
readonly thinking: {
|
|
608
|
+
readonly kind: "budget";
|
|
609
|
+
readonly budget: 0;
|
|
610
|
+
readonly includeThoughts: false;
|
|
611
|
+
};
|
|
612
|
+
readonly tools: ToolCapability;
|
|
613
|
+
};
|
|
614
|
+
readonly low: {
|
|
615
|
+
readonly wireModel: "gemini-4-hydrogen-low";
|
|
616
|
+
readonly thinking: {
|
|
617
|
+
readonly kind: "budget";
|
|
618
|
+
readonly budget: 1000;
|
|
619
|
+
readonly includeThoughts: true;
|
|
620
|
+
};
|
|
621
|
+
readonly tools: ToolCapability;
|
|
622
|
+
};
|
|
623
|
+
readonly medium: {
|
|
624
|
+
readonly wireModel: "gemini-4-hydrogen-medium";
|
|
625
|
+
readonly thinking: {
|
|
626
|
+
readonly kind: "budget";
|
|
627
|
+
readonly budget: 4000;
|
|
628
|
+
readonly includeThoughts: true;
|
|
629
|
+
};
|
|
630
|
+
readonly tools: ToolCapability;
|
|
631
|
+
};
|
|
632
|
+
readonly high: {
|
|
633
|
+
readonly wireModel: "gemini-4-hydrogen-high";
|
|
634
|
+
readonly thinking: {
|
|
635
|
+
readonly kind: "budget";
|
|
636
|
+
readonly budget: -1;
|
|
637
|
+
readonly includeThoughts: true;
|
|
638
|
+
};
|
|
639
|
+
readonly tools: ToolCapability;
|
|
640
|
+
};
|
|
641
|
+
readonly xhigh: {
|
|
642
|
+
readonly wireModel: "gemini-4-hydrogen-xhigh";
|
|
643
|
+
readonly thinking: {
|
|
644
|
+
readonly kind: "budget";
|
|
645
|
+
readonly budget: -1;
|
|
646
|
+
readonly includeThoughts: true;
|
|
647
|
+
};
|
|
648
|
+
readonly tools: ToolCapability;
|
|
649
|
+
};
|
|
650
|
+
};
|
|
651
|
+
readonly replay: {
|
|
652
|
+
readonly kind: "same-public-model";
|
|
653
|
+
};
|
|
654
|
+
readonly response: {
|
|
655
|
+
readonly kind: "gemini-envelope";
|
|
656
|
+
readonly family: "gemini";
|
|
657
|
+
};
|
|
658
|
+
}, {
|
|
659
|
+
readonly publicId: "antigravity-gemini-3.5-flash-lite";
|
|
660
|
+
readonly descriptor: {
|
|
661
|
+
readonly name: "Gemini 3.5 Flash Lite (Antigravity, text only)";
|
|
662
|
+
readonly thinkingLevelMap: {
|
|
663
|
+
readonly minimal: null;
|
|
664
|
+
readonly low: "low";
|
|
665
|
+
readonly medium: null;
|
|
666
|
+
readonly high: null;
|
|
667
|
+
};
|
|
668
|
+
readonly contextWindow: 1048576;
|
|
669
|
+
readonly maxTokens: 65535;
|
|
670
|
+
};
|
|
671
|
+
readonly routes: {
|
|
672
|
+
readonly off: {
|
|
673
|
+
readonly wireModel: "gemini-3.5-flash-lite";
|
|
674
|
+
readonly thinking: {
|
|
675
|
+
readonly kind: "budget";
|
|
676
|
+
readonly budget: 0;
|
|
677
|
+
readonly includeThoughts: false;
|
|
678
|
+
};
|
|
679
|
+
readonly tools: ToolCapability;
|
|
680
|
+
};
|
|
681
|
+
readonly low: {
|
|
682
|
+
readonly wireModel: "gemini-3.5-flash-lite";
|
|
683
|
+
readonly thinking: {
|
|
684
|
+
readonly kind: "budget";
|
|
685
|
+
readonly budget: 1000;
|
|
686
|
+
readonly includeThoughts: true;
|
|
687
|
+
};
|
|
688
|
+
readonly tools: ToolCapability;
|
|
689
|
+
};
|
|
690
|
+
};
|
|
691
|
+
readonly replay: {
|
|
692
|
+
readonly kind: "same-public-model";
|
|
693
|
+
};
|
|
694
|
+
readonly response: {
|
|
695
|
+
readonly kind: "gemini-envelope";
|
|
696
|
+
readonly family: "gemini";
|
|
697
|
+
};
|
|
404
698
|
}];
|
|
405
699
|
type Catalog = typeof CATALOG;
|
|
406
700
|
export type AntigravityPublicModelId = Catalog[number]["publicId"];
|
|
@@ -436,6 +730,7 @@ export declare function toPiModelDescriptor(entry: CatalogEntry): {
|
|
|
436
730
|
low: string | null;
|
|
437
731
|
medium: string | null;
|
|
438
732
|
minimal: string | null;
|
|
733
|
+
xhigh?: string | null;
|
|
439
734
|
};
|
|
440
735
|
input: ("text" | "image")[];
|
|
441
736
|
cost: {
|
package/dist/catalog.js
CHANGED
|
@@ -106,6 +106,86 @@ const CATALOG = freeze(defineCatalog([{
|
|
|
106
106
|
},
|
|
107
107
|
replay: { kind: "same-public-model" },
|
|
108
108
|
response: { kind: "gemini-envelope", family: "gpt-oss" },
|
|
109
|
+
}, {
|
|
110
|
+
publicId: "antigravity-gemini-4-argon",
|
|
111
|
+
descriptor: {
|
|
112
|
+
name: "Gemini 4 Argon (Antigravity, text only)",
|
|
113
|
+
thinkingLevelMap: { minimal: null, low: "low", medium: "medium", high: "high" },
|
|
114
|
+
contextWindow: 1_048_576,
|
|
115
|
+
maxTokens: 65_536,
|
|
116
|
+
},
|
|
117
|
+
routes: {
|
|
118
|
+
off: { wireModel: "gemini-4-argon-low", thinking: { kind: "budget", budget: 0, includeThoughts: false }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-4-argon-off-v1", publicModelId: "antigravity-gemini-4-argon", reasoning: "off", wireModel: "gemini-4-argon-low" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
119
|
+
low: { wireModel: "gemini-4-argon-low", thinking: { kind: "budget", budget: 1000, includeThoughts: true }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-4-argon-low-v1", publicModelId: "antigravity-gemini-4-argon", reasoning: "low", wireModel: "gemini-4-argon-low" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
120
|
+
medium: { wireModel: "gemini-4-argon-medium", thinking: { kind: "budget", budget: 4000, includeThoughts: true }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-4-argon-medium-v1", publicModelId: "antigravity-gemini-4-argon", reasoning: "medium", wireModel: "gemini-4-argon-medium" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
121
|
+
high: { wireModel: "gemini-4-argon-high", thinking: { kind: "budget", budget: -1, includeThoughts: true }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-4-argon-high-v1", publicModelId: "antigravity-gemini-4-argon", reasoning: "high", wireModel: "gemini-4-argon-high" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
122
|
+
},
|
|
123
|
+
replay: { kind: "same-public-model" },
|
|
124
|
+
response: { kind: "gemini-envelope", family: "gemini" },
|
|
125
|
+
}, {
|
|
126
|
+
publicId: "antigravity-gemini-4-carbon",
|
|
127
|
+
descriptor: {
|
|
128
|
+
name: "Gemini 4 Carbon (Antigravity, text only)",
|
|
129
|
+
thinkingLevelMap: { minimal: null, low: "low", medium: "medium", high: "high" },
|
|
130
|
+
contextWindow: 1_048_576,
|
|
131
|
+
maxTokens: 262_144,
|
|
132
|
+
},
|
|
133
|
+
routes: {
|
|
134
|
+
off: { wireModel: "gemini-4-carbon-low", thinking: { kind: "budget", budget: 0, includeThoughts: false }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-4-carbon-off-v1", publicModelId: "antigravity-gemini-4-carbon", reasoning: "off", wireModel: "gemini-4-carbon-low" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
135
|
+
low: { wireModel: "gemini-4-carbon-low", thinking: { kind: "budget", budget: 1000, includeThoughts: true }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-4-carbon-low-v1", publicModelId: "antigravity-gemini-4-carbon", reasoning: "low", wireModel: "gemini-4-carbon-low" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
136
|
+
medium: { wireModel: "gemini-4-carbon-medium", thinking: { kind: "budget", budget: 4000, includeThoughts: true }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-4-carbon-medium-v1", publicModelId: "antigravity-gemini-4-carbon", reasoning: "medium", wireModel: "gemini-4-carbon-medium" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
137
|
+
high: { wireModel: "gemini-4-carbon-high", thinking: { kind: "budget", budget: -1, includeThoughts: true }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-4-carbon-high-v1", publicModelId: "antigravity-gemini-4-carbon", reasoning: "high", wireModel: "gemini-4-carbon-high" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
138
|
+
},
|
|
139
|
+
replay: { kind: "same-public-model" },
|
|
140
|
+
response: { kind: "gemini-envelope", family: "gemini" },
|
|
141
|
+
}, {
|
|
142
|
+
publicId: "antigravity-gemini-4-neon",
|
|
143
|
+
descriptor: {
|
|
144
|
+
name: "Gemini 4 Neon (Antigravity, text only)",
|
|
145
|
+
thinkingLevelMap: { minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh" },
|
|
146
|
+
contextWindow: 1_048_576,
|
|
147
|
+
maxTokens: 262_144,
|
|
148
|
+
},
|
|
149
|
+
routes: {
|
|
150
|
+
off: { wireModel: "gemini-4-neon-low", thinking: { kind: "budget", budget: 0, includeThoughts: false }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-4-neon-off-v1", publicModelId: "antigravity-gemini-4-neon", reasoning: "off", wireModel: "gemini-4-neon-low" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
151
|
+
low: { wireModel: "gemini-4-neon-low", thinking: { kind: "budget", budget: 1000, includeThoughts: true }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-4-neon-low-v1", publicModelId: "antigravity-gemini-4-neon", reasoning: "low", wireModel: "gemini-4-neon-low" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
152
|
+
medium: { wireModel: "gemini-4-neon-medium", thinking: { kind: "budget", budget: 4000, includeThoughts: true }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-4-neon-medium-v1", publicModelId: "antigravity-gemini-4-neon", reasoning: "medium", wireModel: "gemini-4-neon-medium" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
153
|
+
high: { wireModel: "gemini-4-neon-high", thinking: { kind: "budget", budget: -1, includeThoughts: true }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-4-neon-high-v1", publicModelId: "antigravity-gemini-4-neon", reasoning: "high", wireModel: "gemini-4-neon-high" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
154
|
+
xhigh: { wireModel: "gemini-4-neon-xhigh", thinking: { kind: "budget", budget: -1, includeThoughts: true }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-4-neon-xhigh-v1", publicModelId: "antigravity-gemini-4-neon", reasoning: "xhigh", wireModel: "gemini-4-neon-xhigh" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
155
|
+
},
|
|
156
|
+
replay: { kind: "same-public-model" },
|
|
157
|
+
response: { kind: "gemini-envelope", family: "gemini" },
|
|
158
|
+
}, {
|
|
159
|
+
publicId: "antigravity-gemini-4-hydrogen",
|
|
160
|
+
descriptor: {
|
|
161
|
+
name: "Gemini 4 Hydrogen (Antigravity, text only)",
|
|
162
|
+
thinkingLevelMap: { minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh" },
|
|
163
|
+
contextWindow: 1_048_576,
|
|
164
|
+
maxTokens: 262_144,
|
|
165
|
+
},
|
|
166
|
+
routes: {
|
|
167
|
+
off: { wireModel: "gemini-4-hydrogen-low", thinking: { kind: "budget", budget: 0, includeThoughts: false }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-4-hydrogen-off-v1", publicModelId: "antigravity-gemini-4-hydrogen", reasoning: "off", wireModel: "gemini-4-hydrogen-low" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
168
|
+
low: { wireModel: "gemini-4-hydrogen-low", thinking: { kind: "budget", budget: 1000, includeThoughts: true }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-4-hydrogen-low-v1", publicModelId: "antigravity-gemini-4-hydrogen", reasoning: "low", wireModel: "gemini-4-hydrogen-low" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
169
|
+
medium: { wireModel: "gemini-4-hydrogen-medium", thinking: { kind: "budget", budget: 4000, includeThoughts: true }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-4-hydrogen-medium-v1", publicModelId: "antigravity-gemini-4-hydrogen", reasoning: "medium", wireModel: "gemini-4-hydrogen-medium" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
170
|
+
high: { wireModel: "gemini-4-hydrogen-high", thinking: { kind: "budget", budget: -1, includeThoughts: true }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-4-hydrogen-high-v1", publicModelId: "antigravity-gemini-4-hydrogen", reasoning: "high", wireModel: "gemini-4-hydrogen-high" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
171
|
+
xhigh: { wireModel: "gemini-4-hydrogen-xhigh", thinking: { kind: "budget", budget: -1, includeThoughts: true }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-4-hydrogen-xhigh-v1", publicModelId: "antigravity-gemini-4-hydrogen", reasoning: "xhigh", wireModel: "gemini-4-hydrogen-xhigh" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
172
|
+
},
|
|
173
|
+
replay: { kind: "same-public-model" },
|
|
174
|
+
response: { kind: "gemini-envelope", family: "gemini" },
|
|
175
|
+
}, {
|
|
176
|
+
publicId: "antigravity-gemini-3.5-flash-lite",
|
|
177
|
+
descriptor: {
|
|
178
|
+
name: "Gemini 3.5 Flash Lite (Antigravity, text only)",
|
|
179
|
+
thinkingLevelMap: { minimal: null, low: "low", medium: null, high: null },
|
|
180
|
+
contextWindow: 1_048_576,
|
|
181
|
+
maxTokens: 65_535,
|
|
182
|
+
},
|
|
183
|
+
routes: {
|
|
184
|
+
off: { wireModel: "gemini-3.5-flash-lite", thinking: { kind: "budget", budget: 0, includeThoughts: false }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-3.5-flash-lite-off-v1", publicModelId: "antigravity-gemini-3.5-flash-lite", reasoning: "off", wireModel: "gemini-3.5-flash-lite" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
185
|
+
low: { wireModel: "gemini-3.5-flash-lite", thinking: { kind: "budget", budget: 1000, includeThoughts: true }, tools: enabled({ record: "pi-json-tool-loop", revision: "gemini-3.5-flash-lite-low-v1", publicModelId: "antigravity-gemini-3.5-flash-lite", reasoning: "low", wireModel: "gemini-3.5-flash-lite" }, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE) },
|
|
186
|
+
},
|
|
187
|
+
replay: { kind: "same-public-model" },
|
|
188
|
+
response: { kind: "gemini-envelope", family: "gemini" },
|
|
109
189
|
}]));
|
|
110
190
|
const lookup = new Map(CATALOG.map((entry) => [entry.publicId, entry]));
|
|
111
191
|
function disabled(reason) {
|
|
@@ -142,7 +222,7 @@ export function defineCatalog(entries) {
|
|
|
142
222
|
if (level !== "off" && !Object.hasOwn(entry.descriptor.thinkingLevelMap, level)) {
|
|
143
223
|
throw new Error(`Route is outside descriptor map: ${entry.publicId}/${level}`);
|
|
144
224
|
}
|
|
145
|
-
if (level !== "off" && entry.descriptor.thinkingLevelMap[level]
|
|
225
|
+
if (level !== "off" && entry.descriptor.thinkingLevelMap[level] == null) {
|
|
146
226
|
throw new Error(`Route is hidden by descriptor: ${entry.publicId}/${level}`);
|
|
147
227
|
}
|
|
148
228
|
if (route.thinking.kind === "budget" && route.thinking.budget > 0 && Number.isFinite(route.thinking.budget) && route.thinking.budget + ANSWER_RESERVE > entry.descriptor.maxTokens) {
|
package/dist/context.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Context, Model, SimpleStreamOptions } from "@earendil-works/pi-ai";
|
|
2
2
|
import { type GenerationSelection } from "./catalog.ts";
|
|
3
3
|
import { type ToolReplayDiagnostics } from "./tool-context.ts";
|
|
4
|
+
declare const THINKING_LEVELS: readonly ["minimal", "low", "medium", "high", "xhigh"];
|
|
5
|
+
type ThinkingLevel = typeof THINKING_LEVELS[number];
|
|
4
6
|
interface Part {
|
|
5
7
|
text?: string;
|
|
6
8
|
thought?: true;
|
|
@@ -41,7 +43,7 @@ export interface GenerationRequest {
|
|
|
41
43
|
temperature: number;
|
|
42
44
|
maxOutputTokens: number;
|
|
43
45
|
thinkingConfig?: {
|
|
44
|
-
thinkingLevel:
|
|
46
|
+
thinkingLevel: ThinkingLevel;
|
|
45
47
|
includeThoughts: boolean;
|
|
46
48
|
} | {
|
|
47
49
|
thinkingBudget: number;
|
|
@@ -64,6 +66,7 @@ export interface SerializeTextContextInput {
|
|
|
64
66
|
}
|
|
65
67
|
export declare class ContextSerializationError extends Error {
|
|
66
68
|
}
|
|
69
|
+
export declare function sanitizeAntigravitySystemPrompt(systemPrompt: string): string;
|
|
67
70
|
export declare function serializeContext(input: SerializeTextContextInput, injectedSelection?: GenerationSelection, onDiagnostics?: (diagnostics: ToolReplayDiagnostics) => void): GenerationRequest;
|
|
68
71
|
export declare function serializeTextContext(input: SerializeTextContextInput): GenerationRequest;
|
|
69
72
|
export {};
|
package/dist/context.js
CHANGED
|
@@ -5,9 +5,27 @@ import { hasToolContext, prepareToolContext, replayToolHistory } from "./tool-co
|
|
|
5
5
|
const MAX_TEXT_BYTES = 8 * 1024 * 1024;
|
|
6
6
|
const PROVIDER = "antigravity-guard";
|
|
7
7
|
const RESERVED_HEADERS = new Set(["authorization", "host", "content-type", "content-length"]);
|
|
8
|
-
const THINKING_LEVELS = ["low", "medium", "high"];
|
|
8
|
+
const THINKING_LEVELS = ["minimal", "low", "medium", "high", "xhigh"];
|
|
9
|
+
const PI_HARNESS_MARKER = "operating inside pi, a coding agent harness";
|
|
9
10
|
export class ContextSerializationError extends Error {
|
|
10
11
|
}
|
|
12
|
+
const PI_DOCS_BLOCK_REGEX = /Pi documentation \(read only when the user asks about pi[^)]*\):\r?\n- Main documentation: ([^\r\n]+)\r?\n- Additional docs: ([^\r\n]+)\r?\n- Examples: ([^\r\n]+)[^\r\n]*\r?\n- When asked about:[^\r\n]+\r?\n(?:- When working on pi topics[^\r\n]+\r?\n)?- Always read pi \.md files completely[^\r\n]+/g;
|
|
13
|
+
export function sanitizeAntigravitySystemPrompt(systemPrompt) {
|
|
14
|
+
if (!systemPrompt.includes(PI_HARNESS_MARKER))
|
|
15
|
+
return systemPrompt;
|
|
16
|
+
return systemPrompt
|
|
17
|
+
.replaceAll(PI_HARNESS_MARKER, "working on software projects")
|
|
18
|
+
.replace(PI_DOCS_BLOCK_REGEX, [
|
|
19
|
+
"Local harness documentation (read only when the user explicitly asks about local agent customization):",
|
|
20
|
+
"<reference_paths>",
|
|
21
|
+
"- Main reference: $1",
|
|
22
|
+
"- Additional docs: $2",
|
|
23
|
+
"- Examples: $3",
|
|
24
|
+
"</reference_paths>",
|
|
25
|
+
].join("\n"))
|
|
26
|
+
.replace(/Pi documentation \(read only when the user asks about pi[^)]*\):/g, "Local harness documentation (read only when the user explicitly asks about local agent customization):")
|
|
27
|
+
.replace(/<docs>([\s\S]*?)<\/docs>/g, "<reference_paths>$1</reference_paths>");
|
|
28
|
+
}
|
|
11
29
|
export function serializeContext(input, injectedSelection, onDiagnostics) {
|
|
12
30
|
const context = input.context;
|
|
13
31
|
if (!hasToolContext(context))
|
|
@@ -55,7 +73,11 @@ export function serializeContext(input, injectedSelection, onDiagnostics) {
|
|
|
55
73
|
? { parameters: normalizeCustomToolSchema(parameters) }
|
|
56
74
|
: { parametersJsonSchema: parameters }),
|
|
57
75
|
})) }],
|
|
58
|
-
...(prepared.mode === "NONE"
|
|
76
|
+
...(prepared.mode === "NONE"
|
|
77
|
+
? { toolConfig: { functionCallingConfig: { mode: "NONE" } } }
|
|
78
|
+
: (entry.response.family === "claude" || entry.response.family === "gpt-oss"
|
|
79
|
+
? { toolConfig: { functionCallingConfig: { mode: "AUTO" } } }
|
|
80
|
+
: {})),
|
|
59
81
|
} : {}),
|
|
60
82
|
generationConfig,
|
|
61
83
|
sessionId: envelope.sessionId,
|
|
@@ -78,13 +100,14 @@ export function serializeTextContext(input) {
|
|
|
78
100
|
const route = selection.route;
|
|
79
101
|
if (isToolBearingContext(context) && selection.tools.state !== "enabled")
|
|
80
102
|
fail(capabilityError(entry.publicId, selection.level, selection.tools));
|
|
81
|
-
const
|
|
103
|
+
const rawSystemPrompt = field(context, "systemPrompt");
|
|
82
104
|
const tools = field(context, "tools");
|
|
83
|
-
if (
|
|
105
|
+
if (rawSystemPrompt !== undefined && typeof rawSystemPrompt !== "string")
|
|
84
106
|
fail("Text-only context is required.");
|
|
85
107
|
if (tools !== undefined && isDenseArray(tools).length)
|
|
86
108
|
fail("Tools are not supported by this text-only provider.");
|
|
87
|
-
validateOptions(options);
|
|
109
|
+
validateOptions(options, entry.descriptor.maxTokens);
|
|
110
|
+
const systemPrompt = rawSystemPrompt === undefined ? undefined : sanitizeAntigravitySystemPrompt(rawSystemPrompt);
|
|
88
111
|
let textBytes = byteLength(systemPrompt ?? "");
|
|
89
112
|
const contents = [];
|
|
90
113
|
for (const message of isDenseArray(field(context, "messages", true))) {
|
|
@@ -192,7 +215,8 @@ function messagePart(part, assistant, sameProviderAndModel) {
|
|
|
192
215
|
fail("Invalid image data.");
|
|
193
216
|
const rawMime = field(part, "mimeType") ?? (isRecord(field(part, "source")) ? field(field(part, "source"), "media_type") : undefined);
|
|
194
217
|
const mimeType = typeof rawMime === "string" && rawMime ? rawMime : "image/jpeg";
|
|
195
|
-
|
|
218
|
+
const cleanedData = rawData.replace(/^data:[^;]+;base64,/s, "").trim();
|
|
219
|
+
return { inlineData: { mimeType, data: cleanedData } };
|
|
196
220
|
}
|
|
197
221
|
fail("Only text context is supported by this provider.");
|
|
198
222
|
}
|
|
@@ -229,13 +253,13 @@ function validThoughtSignature(value) {
|
|
|
229
253
|
return undefined;
|
|
230
254
|
return /^[A-Za-z0-9+/]+={0,2}$/.test(value) ? value : undefined;
|
|
231
255
|
}
|
|
232
|
-
function validateOptions(options) {
|
|
256
|
+
function validateOptions(options, maxAllowedTokens) {
|
|
233
257
|
if (options === undefined)
|
|
234
258
|
return;
|
|
235
259
|
if (!isRecord(options))
|
|
236
260
|
fail("Invalid generation options.");
|
|
237
261
|
const reasoning = option(options, "reasoning"), budgets = option(options, "thinkingBudgets"), deferred = option(options, "deferred"), toolChoice = option(options, "toolChoice"), sampling = option(options, "samplingParams"), temperature = option(options, "temperature"), maxTokens = option(options, "maxTokens"), headers = option(options, "headers");
|
|
238
|
-
if (reasoning !== undefined && reasoning !== "off" && !isThinkingLevel(reasoning)
|
|
262
|
+
if (reasoning !== undefined && reasoning !== "off" && !isThinkingLevel(reasoning))
|
|
239
263
|
fail("Unsupported reasoning level.");
|
|
240
264
|
if (budgets !== undefined)
|
|
241
265
|
fail("Thinking budgets are not supported.");
|
|
@@ -247,8 +271,8 @@ function validateOptions(options) {
|
|
|
247
271
|
fail("Custom generation options are not supported.");
|
|
248
272
|
if (temperature !== undefined && (typeof temperature !== "number" || !Number.isFinite(temperature) || temperature < 0 || temperature > 2))
|
|
249
273
|
fail("Temperature must be finite and between 0 and 2.");
|
|
250
|
-
if (maxTokens !== undefined && (typeof maxTokens !== "number" || !Number.isInteger(maxTokens) || maxTokens <= 0 || maxTokens >
|
|
251
|
-
fail(
|
|
274
|
+
if (maxTokens !== undefined && (typeof maxTokens !== "number" || !Number.isInteger(maxTokens) || maxTokens <= 0 || maxTokens > maxAllowedTokens))
|
|
275
|
+
fail(`maxTokens must be a positive integer no greater than ${maxAllowedTokens}.`);
|
|
252
276
|
if (headers !== undefined && !isRecord(headers))
|
|
253
277
|
fail("Invalid generation options.");
|
|
254
278
|
for (const name of headers ? Object.keys(headers) : [])
|
package/dist/envelope.js
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
export const ANTIGRAVITY_MODEL_ENUM = Object.freeze({
|
|
3
|
+
// Gemini 4 Argon
|
|
4
|
+
"gemini-4-argon-low": "MODEL_PLACEHOLDER_M419",
|
|
5
|
+
"gemini-4-argon-medium": "MODEL_PLACEHOLDER_M418",
|
|
6
|
+
"gemini-4-argon-high": "MODEL_PLACEHOLDER_M417",
|
|
7
|
+
// Gemini 4 Carbon
|
|
8
|
+
"gemini-4-carbon-low": "MODEL_PLACEHOLDER_M438",
|
|
9
|
+
"gemini-4-carbon-medium": "MODEL_PLACEHOLDER_M437",
|
|
10
|
+
"gemini-4-carbon-high": "MODEL_PLACEHOLDER_M427",
|
|
11
|
+
// Gemini 4 Neon
|
|
12
|
+
"gemini-4-neon-low": "MODEL_PLACEHOLDER_M534",
|
|
13
|
+
"gemini-4-neon-medium": "MODEL_PLACEHOLDER_M533",
|
|
14
|
+
"gemini-4-neon-high": "MODEL_PLACEHOLDER_M532",
|
|
15
|
+
"gemini-4-neon-xhigh": "MODEL_PLACEHOLDER_M535",
|
|
16
|
+
// Gemini 4 Hydrogen
|
|
17
|
+
"gemini-4-hydrogen-low": "MODEL_PLACEHOLDER_M527",
|
|
18
|
+
"gemini-4-hydrogen-medium": "MODEL_PLACEHOLDER_M526",
|
|
19
|
+
"gemini-4-hydrogen-high": "MODEL_PLACEHOLDER_M525",
|
|
20
|
+
"gemini-4-hydrogen-xhigh": "MODEL_PLACEHOLDER_M528",
|
|
21
|
+
"gemini-4-hydrogen-tiered-high": "MODEL_PLACEHOLDER_M530",
|
|
22
|
+
"gemini-4-hydrogen-tiered-xhigh": "MODEL_PLACEHOLDER_M531",
|
|
23
|
+
"gemini-4-hydrogen-sonar": "MODEL_PLACEHOLDER_M578",
|
|
3
24
|
// Gemini 3.8 Flash
|
|
4
25
|
"gemini-3.8-flash": "MODEL_PLACEHOLDER_M318",
|
|
5
26
|
"gemini-3.8-flash-high": "MODEL_PLACEHOLDER_M318",
|
|
@@ -22,6 +43,7 @@ export const ANTIGRAVITY_MODEL_ENUM = Object.freeze({
|
|
|
22
43
|
"gemini-3.5-flash": "MODEL_PLACEHOLDER_M20",
|
|
23
44
|
"gemini-3.5-flash-extra-low": "MODEL_PLACEHOLDER_M187",
|
|
24
45
|
"gemini-3.5-flash-low": "MODEL_PLACEHOLDER_M20",
|
|
46
|
+
"gemini-3.5-flash-lite": "MODEL_PLACEHOLDER_M198",
|
|
25
47
|
"gemini-3-flash-agent": "MODEL_PLACEHOLDER_M84",
|
|
26
48
|
// Gemini 3.1 Pro
|
|
27
49
|
"gemini-3.1-pro": "MODEL_PLACEHOLDER_M36",
|
package/dist/project.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
+
import { formatAntigravityHubUserAgent } from "@benjamolina/antigravity-guard-core";
|
|
2
3
|
const USER_INFO_ENDPOINT = "https://www.googleapis.com/oauth2/v1/userinfo?alt=json";
|
|
3
4
|
const PROJECT_ENDPOINTS = [
|
|
4
5
|
"https://daily-cloudcode-pa.googleapis.com",
|
|
@@ -7,7 +8,7 @@ const PROJECT_ENDPOINTS = [
|
|
|
7
8
|
];
|
|
8
9
|
const MAX_BODY_BYTES = 64 * 1024;
|
|
9
10
|
const REQUEST_TIMEOUT_MS = 10_000;
|
|
10
|
-
const ANTIGRAVITY_USER_AGENT =
|
|
11
|
+
const ANTIGRAVITY_USER_AGENT = formatAntigravityHubUserAgent();
|
|
11
12
|
export async function resolveLoginProject(options) {
|
|
12
13
|
const email = await userEmail(options);
|
|
13
14
|
const projectId = await discoveredProject(options);
|
package/dist/stream.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { calculateCost, createAssistantMessageEventStream } from "@earendil-works/pi-ai";
|
|
2
|
-
import { ANTIGRAVITY_ENDPOINTS } from "@benjamolina/antigravity-guard-core";
|
|
2
|
+
import { ANTIGRAVITY_ENDPOINTS, formatAntigravityHubUserAgent } from "@benjamolina/antigravity-guard-core";
|
|
3
3
|
import { getCatalogEntry, resolveGenerationSelection } from "./catalog.js";
|
|
4
4
|
import { ContextSerializationError, serializeContext } from "./context.js";
|
|
5
5
|
import { ToolPreflightError } from "./tool-contract.js";
|
|
@@ -9,7 +9,7 @@ import { SseFrameError, SseFramer } from "./sse.js";
|
|
|
9
9
|
const TOTAL_TIMEOUT_MS = 120_000;
|
|
10
10
|
const INACTIVITY_TIMEOUT_MS = 30_000;
|
|
11
11
|
const MAX_ERROR_BYTES = 64 * 1024;
|
|
12
|
-
const ANTIGRAVITY_USER_AGENT =
|
|
12
|
+
const ANTIGRAVITY_USER_AGENT = formatAntigravityHubUserAgent();
|
|
13
13
|
const ENDPOINT = `${ANTIGRAVITY_ENDPOINTS.daily}/v1internal:streamGenerateContent?alt=sse`;
|
|
14
14
|
const API = "antigravity-guard-sse";
|
|
15
15
|
const PROTECTED_HEADERS = new Set(["authorization", "host", "content-type", "content-length"]);
|
package/dist/tool-context.js
CHANGED
|
@@ -105,7 +105,8 @@ export function replayToolHistory(messages, serializePart, onDiagnostics, policy
|
|
|
105
105
|
if (typeof rawData === "string" && rawData) {
|
|
106
106
|
const rawMime = value(part, "mimeType") ?? (isRecord(value(part, "source")) ? value(record(value(part, "source")), "media_type") : undefined);
|
|
107
107
|
const mimeType = typeof rawMime === "string" && rawMime ? rawMime : "image/jpeg";
|
|
108
|
-
|
|
108
|
+
const cleanedData = rawData.replace(/^data:[^;]+;base64,/s, "").trim();
|
|
109
|
+
imageParts.push({ inlineData: { mimeType, data: cleanedData } });
|
|
109
110
|
}
|
|
110
111
|
}
|
|
111
112
|
else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@benjamolina/pi-antigravity-guard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Pi adapter for Antigravity Guard",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
]
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@benjamolina/antigravity-guard-core": "0.
|
|
32
|
+
"@benjamolina/antigravity-guard-core": "0.2.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@earendil-works/pi-ai": "*",
|