astro-claw 1.0.2 → 1.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-claw",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Claude Code over Slack — your AI crew member. One command: npx astro-claw",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "display_information": {
3
- "name": "Astronaut",
3
+ "name": "Astro Claw",
4
4
  "description": "AI crew member powered by Claude Code",
5
5
  "background_color": "#1a1a2e"
6
6
  },
@@ -11,7 +11,7 @@
11
11
  "messages_tab_read_only_enabled": false
12
12
  },
13
13
  "bot_user": {
14
- "display_name": "Astronaut",
14
+ "display_name": "Astro Claw",
15
15
  "always_online": true
16
16
  }
17
17
  },
@@ -1,5 +1,5 @@
1
1
  display_information:
2
- name: Astronaut
2
+ name: Astro Claw
3
3
  description: AI crew member powered by Claude Code
4
4
  background_color: "#1a1a2e"
5
5
  features:
package/slack-setup.js CHANGED
@@ -246,50 +246,41 @@ export default async function selfDrivingSlackSetup() {
246
246
  }
247
247
  }
248
248
 
249
- // Click "Next" (Step 1 Step 2 of the wizard)
250
- await new Promise((r) => setTimeout(r, 1000));
251
- try {
252
- // Try multiple selectors for the primary/next button
253
- const nextBtn = await page.$('button.c-button--primary')
249
+ // Helper: check if we've landed on the app page (creation complete)
250
+ const isOnAppPage = () => /api\.slack\.com\/apps\/[A-Z0-9]+(?:\/|$)/.test(page.url());
251
+
252
+ // Click through the wizard steps Slack may have 2 or 3 steps
253
+ // After each click, check if the app was already created
254
+ console.log(` → Walking through wizard...`);
255
+ for (let step = 0; step < 3; step++) {
256
+ if (isOnAppPage()) break;
257
+
258
+ // Look for the primary action button (Next or Create)
259
+ const btn = await page.$('button.c-button--primary')
254
260
  || await page.$('button[data-qa="next"]')
255
261
  || await page.$('button[type="submit"]');
256
- if (nextBtn) {
257
- await nextBtn.click();
258
- await new Promise((r) => setTimeout(r, 2000));
259
- }
260
- } catch {}
261
-
262
- // Step 2→3: manifest review — click "Next" again
263
- console.log(` → Reviewing manifest...`);
264
- try {
265
- const nextBtn2 = await page.$('button.c-button--primary');
266
- if (nextBtn2) {
267
- await nextBtn2.click();
268
- await new Promise((r) => setTimeout(r, 2000));
269
- }
270
- } catch {}
271
262
 
272
- // Step 3: Click "Create"
273
- console.log(` → Creating app...`);
274
- try {
275
- // Look for the Create button (usually the primary button on step 3)
276
- const buttons = await page.$$('button');
277
- for (const btn of buttons) {
278
- const text = await page.evaluate((el) => el.textContent?.trim(), btn);
279
- if (text === "Create" || text === "Create App") {
280
- await btn.click();
281
- await new Promise((r) => setTimeout(r, 3000));
282
- break;
263
+ if (btn) {
264
+ const btnText = await page.evaluate((el) => el.textContent?.trim(), btn);
265
+ if (btnText === "Create" || btnText === "Create App") {
266
+ console.log(` → Creating app...`);
267
+ } else {
268
+ console.log(` → ${btnText || "Next"}...`);
283
269
  }
270
+ await btn.click();
271
+ await new Promise((r) => setTimeout(r, 3000));
272
+ } else {
273
+ break;
284
274
  }
285
- } catch {}
275
+ }
286
276
 
287
- // After creation, we should be on the app's Basic Information page
288
- // URL pattern: https://api.slack.com/apps/APPID
289
- await page.waitForFunction(
290
- () => /api\.slack\.com\/apps\/[A-Z0-9]+/.test(window.location.href),
291
- { timeout: 15000 }
292
- ).catch(() => {});
277
+ // Wait for redirect to app page
278
+ if (!isOnAppPage()) {
279
+ await page.waitForFunction(
280
+ () => /api\.slack\.com\/apps\/[A-Z0-9]+/.test(window.location.href),
281
+ { timeout: 30000 }
282
+ ).catch(() => {});
283
+ }
293
284
 
294
285
  const appUrl = page.url();
295
286
  const appIdMatch = appUrl.match(/apps\/([A-Z0-9]+)/);