@chrysb/alphaclaw 0.6.0-beta.3 → 0.6.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.
@@ -47,14 +47,14 @@ const copyText = async (value) => {
47
47
  }
48
48
  };
49
49
 
50
- const kStepTitles = [
50
+ const kSetupStepTitles = [
51
51
  "Install + Authenticate gcloud",
52
52
  "Enable APIs",
53
53
  "Create Topic + IAM",
54
54
  "Create Push Subscription",
55
55
  "Build with your Agent",
56
56
  ];
57
- const kTotalSteps = kStepTitles.length;
57
+ const kTutorialStepTitles = kSetupStepTitles.slice(0, 3);
58
58
  const kNoSessionSelectedValue = kNoDestinationSessionValue;
59
59
 
60
60
  const renderCommandBlock = (command = "", onCopy = () => {}) => html`
@@ -136,6 +136,8 @@ export const GmailSetupWizard = ({
136
136
  String(clientConfig?.projectId || "").trim() ||
137
137
  "<project-id>";
138
138
  const hasExistingWebhookSetup = Boolean(clientConfig?.webhookExists);
139
+ const stepTitles = hasExistingWebhookSetup ? kTutorialStepTitles : kSetupStepTitles;
140
+ const totalSteps = stepTitles.length;
139
141
  const client =
140
142
  String(account?.client || clientConfig?.client || "default").trim() ||
141
143
  "default";
@@ -172,7 +174,7 @@ export const GmailSetupWizard = ({
172
174
  destination: selectedDestination,
173
175
  });
174
176
  setWatchEnabled(true);
175
- setStep((prev) => Math.min(prev + 1, kTotalSteps - 1));
177
+ setStep((prev) => Math.min(prev + 1, totalSteps - 1));
176
178
  } catch (err) {
177
179
  setLocalError(err.message || "Could not finish setup");
178
180
  }
@@ -196,7 +198,7 @@ export const GmailSetupWizard = ({
196
198
  }
197
199
  return;
198
200
  }
199
- setStep((prev) => Math.min(prev + 1, kTotalSteps - 1));
201
+ setStep((prev) => Math.min(prev + 1, totalSteps - 1));
200
202
  };
201
203
 
202
204
  const handleSendToAgent = async () => {
@@ -240,7 +242,7 @@ export const GmailSetupWizard = ({
240
242
  </button>
241
243
  <div class="text-xs text-gray-500">Gmail Pub / Sub Setup</div>
242
244
  <div class="flex items-center gap-1">
243
- ${kStepTitles.map(
245
+ ${stepTitles.map(
244
246
  (title, idx) => html`
245
247
  <div
246
248
  class=${`h-1 flex-1 rounded-full transition-colors ${idx <= step ? "bg-accent" : "bg-border"}`}
@@ -251,7 +253,7 @@ export const GmailSetupWizard = ({
251
253
  )}
252
254
  </div>
253
255
  <${PageHeader}
254
- title=${`Step ${step + 1} of ${kTotalSteps}: ${kStepTitles[step]}`}
256
+ title=${`Step ${step + 1} of ${totalSteps}: ${stepTitles[step]}`}
255
257
  actions=${null}
256
258
  />
257
259
  ${localError ? html`<div class="text-xs text-red-400">${localError}</div>` : null}
@@ -341,7 +343,7 @@ export const GmailSetupWizard = ({
341
343
  : null
342
344
  }
343
345
  ${
344
- !needsProjectId && step === 3
346
+ !hasExistingWebhookSetup && !needsProjectId && step === 3
345
347
  ? html`
346
348
  ${renderCommandBlock(commands?.createSubscription || "", () =>
347
349
  handleCopy(commands?.createSubscription || ""),
@@ -376,7 +378,7 @@ export const GmailSetupWizard = ({
376
378
  : null
377
379
  }
378
380
  ${
379
- step === 4
381
+ !hasExistingWebhookSetup && step === 4
380
382
  ? html`
381
383
  <div
382
384
  class="rounded-lg border border-border bg-black/20 p-3 space-y-3"
@@ -469,7 +471,18 @@ export const GmailSetupWizard = ({
469
471
  />`
470
472
  }
471
473
  ${
472
- step < kTotalSteps - 2
474
+ !hasExistingWebhookSetup && step === totalSteps - 2
475
+ ? html`<${ActionButton}
476
+ onClick=${handleFinish}
477
+ disabled=${false}
478
+ loading=${saving}
479
+ idleLabel="Enable watch"
480
+ loadingLabel="Enabling..."
481
+ tone="primary"
482
+ size="md"
483
+ className="w-full justify-center"
484
+ />`
485
+ : step < totalSteps - 1
473
486
  ? html`<${ActionButton}
474
487
  onClick=${handleNext}
475
488
  disabled=${saving || (needsProjectId && !canAdvance)}
@@ -478,27 +491,14 @@ export const GmailSetupWizard = ({
478
491
  size="md"
479
492
  className="w-full justify-center"
480
493
  />`
481
- : step === kTotalSteps - 2
482
- ? html`<${ActionButton}
483
- onClick=${hasExistingWebhookSetup ? handleNext : handleFinish}
484
- disabled=${false}
485
- loading=${saving}
486
- idleLabel=${hasExistingWebhookSetup ? "Next" : "Enable watch"}
487
- loadingLabel=${hasExistingWebhookSetup
488
- ? "Loading..."
489
- : "Enabling..."}
490
- tone="primary"
491
- size="md"
492
- className="w-full justify-center"
493
- />`
494
- : html`<${ActionButton}
495
- onClick=${onClose}
496
- disabled=${saving || sendingToAgent}
497
- idleLabel="Done"
498
- tone="secondary"
499
- size="md"
500
- className="w-full justify-center"
501
- />`
494
+ : html`<${ActionButton}
495
+ onClick=${onClose}
496
+ disabled=${saving || sendingToAgent}
497
+ idleLabel="Done"
498
+ tone="secondary"
499
+ size="md"
500
+ className="w-full justify-center"
501
+ />`
502
502
  }
503
503
  </div>
504
504
  </${ModalShell}>
@@ -373,7 +373,7 @@ export const Google = ({
373
373
  if (!account) return;
374
374
  const client = String(account.client || "default").trim() || "default";
375
375
  const clientConfig = clientConfigByClient.get(client);
376
- if (!clientConfig?.configured) {
376
+ if (!clientConfig?.configured || !clientConfig?.webhookExists) {
377
377
  openGmailSetupWizard(accountId);
378
378
  return;
379
379
  }
@@ -316,7 +316,6 @@ const createGmailWatchService = ({
316
316
  transform: { module: gmailTransformModulePath },
317
317
  },
318
318
  transformSource: buildGmailTransformSource(destination),
319
- overwriteTransform: true,
320
319
  });
321
320
  const webhookAfter = fs.readFileSync(configPath, "utf8");
322
321
  if (webhookBefore !== webhookAfter) {
@@ -66,20 +66,7 @@ const verifyGithubRepoForOnboarding = async ({
66
66
  };
67
67
  }
68
68
  }
69
- const authedUser = await userRes.json().catch(() => ({}));
70
- const authedLogin = String(authedUser?.login || "").trim();
71
- if (
72
- !isExisting &&
73
- repoOwner &&
74
- authedLogin &&
75
- repoOwner.toLowerCase() !== authedLogin.toLowerCase()
76
- ) {
77
- return {
78
- ok: false,
79
- status: 400,
80
- error: `New workspace repo owner must match your token user "${authedLogin}"`,
81
- };
82
- }
69
+ await userRes.json().catch(() => ({}));
83
70
 
84
71
  const checkRes = await fetch(`https://api.github.com/repos/${repoUrl}`, {
85
72
  headers: ghHeaders,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrysb/alphaclaw",
3
- "version": "0.6.0-beta.3",
3
+ "version": "0.6.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },