antigravity-usage 0.2.8 → 0.2.9

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 CHANGED
@@ -174,10 +174,27 @@ Quickly check if your auth tokens are valid or expired.
174
174
  antigravity-usage wakeup config # Interactive setup (takes 30 seconds)
175
175
  antigravity-usage wakeup install # Install to native system cron
176
176
  antigravity-usage wakeup status # Check configuration & next run
177
- antigravity-usage wakeup test # Test trigger manually
177
+ antigravity-usage wakeup test # Test trigger manually (interactive)
178
178
  antigravity-usage wakeup history # View trigger history
179
179
  ```
180
180
 
181
+ **Quick Test with Flags:**
182
+ ```bash
183
+ # Test with specific email and model
184
+ antigravity-usage wakeup test -e your@gmail.com -m claude-sonnet-4-5
185
+
186
+ # Full command with custom prompt
187
+ antigravity-usage wakeup test --email your@gmail.com --model gemini-3-flash --prompt "hello"
188
+
189
+ # Mix flags (missing ones will be prompted)
190
+ antigravity-usage wakeup test -e your@gmail.com
191
+ ```
192
+
193
+ **Available Options:**
194
+ - `-e, --email <email>` - Account email to use for testing
195
+ - `-m, --model <model>` - Model ID to test (e.g., claude-sonnet-4-5, gemini-3-flash)
196
+ - `-p, --prompt <prompt>` - Test prompt to send (default: "hi")
197
+
181
198
  **Why This Matters:**
182
199
  Your Antigravity quota resets every ~5 hours, but if you don't use it, you lose it. The wakeup feature ensures you **automatically trigger** both Claude and Gemini models to keep your quota flowing.
183
200
 
package/dist/index.js CHANGED
@@ -1679,15 +1679,16 @@ var CloudCodeClient = class {
1679
1679
  if (jsonStr.trim() === "[DONE]") continue;
1680
1680
  try {
1681
1681
  const data = JSON.parse(jsonStr);
1682
- const candidateText = data.candidates?.[0]?.content?.parts?.[0]?.text;
1682
+ const responseData = data.response || data;
1683
+ const candidateText = responseData.candidates?.[0]?.content?.parts?.[0]?.text;
1683
1684
  if (candidateText) {
1684
1685
  fullText += candidateText;
1685
1686
  }
1686
- if (data.usageMetadata) {
1687
+ if (responseData.usageMetadata) {
1687
1688
  tokensUsed = {
1688
- prompt: data.usageMetadata.promptTokenCount || 0,
1689
- completion: data.usageMetadata.candidatesTokenCount || 0,
1690
- total: data.usageMetadata.totalTokenCount || 0
1689
+ prompt: responseData.usageMetadata.promptTokenCount || 0,
1690
+ completion: responseData.usageMetadata.candidatesTokenCount || 0,
1691
+ total: responseData.usageMetadata.totalTokenCount || 0
1691
1692
  };
1692
1693
  }
1693
1694
  } catch {
@@ -3952,7 +3953,7 @@ async function wakeupCommand(subcommand, args, options) {
3952
3953
  await uninstallSchedule();
3953
3954
  break;
3954
3955
  case "test":
3955
- await runTestTrigger();
3956
+ await runTestTrigger(options);
3956
3957
  break;
3957
3958
  case "history":
3958
3959
  await showHistory(options);
@@ -4187,7 +4188,7 @@ async function uninstallSchedule() {
4187
4188
  }
4188
4189
  console.log("");
4189
4190
  }
4190
- async function runTestTrigger() {
4191
+ async function runTestTrigger(options = {}) {
4191
4192
  console.log("\n\u{1F9EA} Test Trigger\n");
4192
4193
  const accountManager = getAccountManager();
4193
4194
  const accounts = accountManager.getAccountEmails();
@@ -4195,8 +4196,17 @@ async function runTestTrigger() {
4195
4196
  console.log("\u274C No accounts available. Please login first.");
4196
4197
  return;
4197
4198
  }
4198
- let accountEmail = accounts[0];
4199
- if (accounts.length > 1) {
4199
+ let accountEmail;
4200
+ if (options.email) {
4201
+ if (!accounts.includes(options.email)) {
4202
+ console.log(`\u274C Account "${options.email}" not found.`);
4203
+ console.log(` Available accounts: ${accounts.join(", ")}`);
4204
+ return;
4205
+ }
4206
+ accountEmail = options.email;
4207
+ } else if (accounts.length === 1) {
4208
+ accountEmail = accounts[0];
4209
+ } else {
4200
4210
  const { selectedAccount } = await inquirer2.prompt([{
4201
4211
  type: "list",
4202
4212
  name: "selectedAccount",
@@ -4205,19 +4215,20 @@ async function runTestTrigger() {
4205
4215
  }]);
4206
4216
  accountEmail = selectedAccount;
4207
4217
  }
4208
- const config = loadWakeupConfig();
4209
- const { modelId } = await inquirer2.prompt([{
4210
- type: "input",
4211
- name: "modelId",
4212
- message: "Model ID to test:",
4213
- default: config?.selectedModels[0] || "claude-sonnet-4-5"
4214
- }]);
4215
- const { prompt } = await inquirer2.prompt([{
4216
- type: "input",
4217
- name: "prompt",
4218
- message: "Test prompt:",
4219
- default: "hi"
4220
- }]);
4218
+ let modelId;
4219
+ if (options.model) {
4220
+ modelId = options.model;
4221
+ } else {
4222
+ const config = loadWakeupConfig();
4223
+ const { selectedModel } = await inquirer2.prompt([{
4224
+ type: "input",
4225
+ name: "selectedModel",
4226
+ message: "Model ID to test:",
4227
+ default: config?.selectedModels[0] || "claude-sonnet-4-5"
4228
+ }]);
4229
+ modelId = selectedModel;
4230
+ }
4231
+ const prompt = options.prompt || "hi";
4221
4232
  console.log("\n\u23F3 Triggering...");
4222
4233
  try {
4223
4234
  const result = await testTrigger(modelId, accountEmail, prompt);
@@ -4351,7 +4362,7 @@ wakeupCmd.command("config").description("Configure auto wake-up schedule").actio
4351
4362
  wakeupCmd.command("trigger").description("Execute one trigger cycle (called by cron)").option("--scheduled", "Mark as scheduled trigger").action((options) => wakeupCommand("trigger", [], options));
4352
4363
  wakeupCmd.command("install").description("Install wake-up schedule to system cron").action(() => wakeupCommand("install", [], {}));
4353
4364
  wakeupCmd.command("uninstall").description("Remove wake-up schedule from system cron").action(() => wakeupCommand("uninstall", [], {}));
4354
- wakeupCmd.command("test").description("Test trigger manually").action(() => wakeupCommand("test", [], {}));
4365
+ wakeupCmd.command("test").description("Test trigger manually").option("-e, --email <email>", "Account email to use for testing").option("-m, --model <model>", "Model ID to test").option("-p, --prompt <prompt>", "Test prompt to send", "hi").action((options) => wakeupCommand("test", [], options));
4355
4366
  wakeupCmd.command("history").description("View trigger history").option("--limit <n>", "Number of records to show", "10").option("--json", "Output as JSON").action((options) => wakeupCommand("history", [], options));
4356
4367
  wakeupCmd.command("status").description("Show wake-up status and configuration").action(() => wakeupCommand("status", [], {}));
4357
4368
  wakeupCmd.action(() => wakeupCommand("status", [], {}));