spectrawl 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/act/index.js +15 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spectrawl",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "The unified web layer for AI agents. Search, browse, authenticate, act — one tool, self-hosted, free.",
5
5
  "main": "src/index.js",
6
6
  "types": "index.d.ts",
package/src/act/index.js CHANGED
@@ -53,22 +53,9 @@ class ActEngine {
53
53
  }
54
54
  }
55
55
 
56
- // Get auth for this platform/account
57
56
  const account = params.account
58
- if (account) {
59
- const cookies = await this.auth.getCookies(platform, account)
60
- if (!cookies) {
61
- return {
62
- success: false,
63
- error: 'auth_missing',
64
- detail: `No auth found for ${platform}/${account}.`,
65
- suggestion: `Run: spectrawl login ${platform} --account ${account}`
66
- }
67
- }
68
- params._cookies = cookies
69
- }
70
57
 
71
- // Check rate limits
58
+ // Check rate limits FIRST (no point checking auth if rate limited)
72
59
  const rateCheck = this.rateLimiter.check(platform, action, params)
73
60
  if (!rateCheck.allowed) {
74
61
  return {
@@ -94,6 +81,20 @@ class ActEngine {
94
81
  }
95
82
  }
96
83
 
84
+ // Get auth for this platform/account
85
+ if (account) {
86
+ const cookies = await this.auth.getCookies(platform, account)
87
+ if (!cookies) {
88
+ return {
89
+ success: false,
90
+ error: 'auth_missing',
91
+ detail: `No auth found for ${platform}/${account}.`,
92
+ suggestion: `Run: spectrawl login ${platform} --account ${account}`
93
+ }
94
+ }
95
+ params._cookies = cookies
96
+ }
97
+
97
98
  try {
98
99
  const result = await adapter.execute(action, params, {
99
100
  auth: this.auth,