@anthonyhaussman/opencode-agy-auth 1.2.3-alpha.0 → 1.2.3-alpha.1
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/index.js +58 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20677,8 +20677,38 @@ Immediately call \`${AGY_QUOTA_SUMMARY_TOOL_NAME}\` with no arguments and return
|
|
|
20677
20677
|
Do not call other tools.
|
|
20678
20678
|
`;
|
|
20679
20679
|
async function setupOpenCodeV2(ctx) {
|
|
20680
|
-
ctx.catalog.transform(async (
|
|
20681
|
-
if (!
|
|
20680
|
+
ctx.catalog.transform(async (editor) => {
|
|
20681
|
+
if (!editor) return;
|
|
20682
|
+
if (typeof editor?.provider?.update === "function") {
|
|
20683
|
+
editor.provider.update(AGY_PROVIDER_ID, (p) => {
|
|
20684
|
+
p.name = "Antigravity CLI";
|
|
20685
|
+
p.activation = "enabled";
|
|
20686
|
+
p.package = "@ai-sdk/google";
|
|
20687
|
+
p.description = "Google Gemini Antigravity Code Assist OAuth provider";
|
|
20688
|
+
});
|
|
20689
|
+
if (typeof editor?.model?.update === "function") {
|
|
20690
|
+
for (const [modelId, simple] of Object.entries(STATIC_MODELS_SIMPLE)) {
|
|
20691
|
+
editor.model.update(AGY_PROVIDER_ID, modelId, (m) => {
|
|
20692
|
+
m.name = simple.name;
|
|
20693
|
+
m.capabilities = {
|
|
20694
|
+
tools: true,
|
|
20695
|
+
input: ["text", "image"],
|
|
20696
|
+
output: ["text"]
|
|
20697
|
+
};
|
|
20698
|
+
m.limit = {
|
|
20699
|
+
context: simple.maxTokens,
|
|
20700
|
+
output: simple.maxOutputTokens
|
|
20701
|
+
};
|
|
20702
|
+
m.family = "gemini";
|
|
20703
|
+
if (simple.cost) {
|
|
20704
|
+
m.cost = simple.cost;
|
|
20705
|
+
}
|
|
20706
|
+
});
|
|
20707
|
+
}
|
|
20708
|
+
}
|
|
20709
|
+
return;
|
|
20710
|
+
}
|
|
20711
|
+
const catalog = editor;
|
|
20682
20712
|
catalog.providers = catalog.providers || {};
|
|
20683
20713
|
catalog.providers[AGY_PROVIDER_ID] = {
|
|
20684
20714
|
id: AGY_PROVIDER_ID,
|
|
@@ -20723,7 +20753,20 @@ async function setupOpenCodeV2(ctx) {
|
|
|
20723
20753
|
getConfiguredProjectId: () => void 0,
|
|
20724
20754
|
getUserAgentModel: () => void 0
|
|
20725
20755
|
});
|
|
20726
|
-
if (typeof editor.
|
|
20756
|
+
if (typeof editor.add === "function") {
|
|
20757
|
+
editor.add({
|
|
20758
|
+
name: AGY_QUOTA_TOOL_NAME,
|
|
20759
|
+
description: quotaTool.description,
|
|
20760
|
+
input: {},
|
|
20761
|
+
execute: async (args, context) => quotaTool.execute(args, context)
|
|
20762
|
+
});
|
|
20763
|
+
editor.add({
|
|
20764
|
+
name: AGY_QUOTA_SUMMARY_TOOL_NAME,
|
|
20765
|
+
description: quotaSummaryTool.description,
|
|
20766
|
+
input: {},
|
|
20767
|
+
execute: async (args, context) => quotaSummaryTool.execute(args, context)
|
|
20768
|
+
});
|
|
20769
|
+
} else if (typeof editor.set === "function") {
|
|
20727
20770
|
editor.set(AGY_QUOTA_TOOL_NAME, quotaTool);
|
|
20728
20771
|
editor.set(AGY_QUOTA_SUMMARY_TOOL_NAME, quotaSummaryTool);
|
|
20729
20772
|
} else if (editor.tools && typeof editor.tools === "object") {
|
|
@@ -20746,7 +20789,18 @@ async function setupOpenCodeV2(ctx) {
|
|
|
20746
20789
|
template: AGY_V2_QUOTA_SUMMARY_COMMAND_TEMPLATE
|
|
20747
20790
|
}
|
|
20748
20791
|
};
|
|
20749
|
-
if (typeof editor.
|
|
20792
|
+
if (typeof editor.add === "function") {
|
|
20793
|
+
editor.add({
|
|
20794
|
+
name: AGY_V2_QUOTA_COMMAND,
|
|
20795
|
+
description: "Display current Antigravity quota usage",
|
|
20796
|
+
template: AGY_V2_QUOTA_COMMAND_TEMPLATE
|
|
20797
|
+
});
|
|
20798
|
+
editor.add({
|
|
20799
|
+
name: AGY_V2_QUOTA_SUMMARY_COMMAND,
|
|
20800
|
+
description: "Display Antigravity quota summary grouped by model family",
|
|
20801
|
+
template: AGY_V2_QUOTA_SUMMARY_COMMAND_TEMPLATE
|
|
20802
|
+
});
|
|
20803
|
+
} else if (typeof editor.set === "function") {
|
|
20750
20804
|
editor.set(AGY_V2_QUOTA_COMMAND, commands[AGY_V2_QUOTA_COMMAND]);
|
|
20751
20805
|
editor.set(AGY_V2_QUOTA_SUMMARY_COMMAND, commands[AGY_V2_QUOTA_SUMMARY_COMMAND]);
|
|
20752
20806
|
} else if (editor.commands && typeof editor.commands === "object") {
|