@rankcli/cli 0.0.33 → 0.0.34
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
CHANGED
|
@@ -3085,8 +3085,7 @@ async function trackAdd(options) {
|
|
|
3085
3085
|
spinner.fail("Could not find or create project");
|
|
3086
3086
|
return { success: false, error: "Project not found" };
|
|
3087
3087
|
}
|
|
3088
|
-
const
|
|
3089
|
-
const tier = planName?.toLowerCase() || "free";
|
|
3088
|
+
const tier = tierFromPlanId(getUserInfo().planId) ?? "free";
|
|
3090
3089
|
const { maxKeywords } = getTierLimits(tier);
|
|
3091
3090
|
const supabase = await getAuthenticatedClient();
|
|
3092
3091
|
if (!supabase) {
|
|
@@ -3367,8 +3366,7 @@ async function trackCheck(options) {
|
|
|
3367
3366
|
if (!project) {
|
|
3368
3367
|
return { success: false, error: "Project not found" };
|
|
3369
3368
|
}
|
|
3370
|
-
const
|
|
3371
|
-
const tier = planName?.toLowerCase() || "free";
|
|
3369
|
+
const tier = tierFromPlanId(getUserInfo().planId) ?? "free";
|
|
3372
3370
|
const { checksPerDay } = getTierLimits(tier);
|
|
3373
3371
|
if (!options.force && project.lastRankCheckAt) {
|
|
3374
3372
|
const hoursSinceCheck = (Date.now() - project.lastRankCheckAt.getTime()) / (1e3 * 60 * 60);
|
|
@@ -4239,7 +4237,7 @@ async function testWebhook(channel, webhookUrl) {
|
|
|
4239
4237
|
}
|
|
4240
4238
|
|
|
4241
4239
|
// src/version.ts
|
|
4242
|
-
var VERSION = "0.0.
|
|
4240
|
+
var VERSION = "0.0.34";
|
|
4243
4241
|
|
|
4244
4242
|
// src/index.ts
|
|
4245
4243
|
var program = new import_commander.Command();
|
package/dist/index.mjs
CHANGED
|
@@ -2916,8 +2916,7 @@ async function trackAdd(options) {
|
|
|
2916
2916
|
spinner.fail("Could not find or create project");
|
|
2917
2917
|
return { success: false, error: "Project not found" };
|
|
2918
2918
|
}
|
|
2919
|
-
const
|
|
2920
|
-
const tier = planName?.toLowerCase() || "free";
|
|
2919
|
+
const tier = tierFromPlanId(getUserInfo().planId) ?? "free";
|
|
2921
2920
|
const { maxKeywords } = getTierLimits(tier);
|
|
2922
2921
|
const supabase = await getAuthenticatedClient();
|
|
2923
2922
|
if (!supabase) {
|
|
@@ -3198,8 +3197,7 @@ async function trackCheck(options) {
|
|
|
3198
3197
|
if (!project) {
|
|
3199
3198
|
return { success: false, error: "Project not found" };
|
|
3200
3199
|
}
|
|
3201
|
-
const
|
|
3202
|
-
const tier = planName?.toLowerCase() || "free";
|
|
3200
|
+
const tier = tierFromPlanId(getUserInfo().planId) ?? "free";
|
|
3203
3201
|
const { checksPerDay } = getTierLimits(tier);
|
|
3204
3202
|
if (!options.force && project.lastRankCheckAt) {
|
|
3205
3203
|
const hoursSinceCheck = (Date.now() - project.lastRankCheckAt.getTime()) / (1e3 * 60 * 60);
|
|
@@ -4095,7 +4093,7 @@ async function testWebhook(channel, webhookUrl) {
|
|
|
4095
4093
|
}
|
|
4096
4094
|
|
|
4097
4095
|
// src/version.ts
|
|
4098
|
-
var VERSION = "0.0.
|
|
4096
|
+
var VERSION = "0.0.34";
|
|
4099
4097
|
|
|
4100
4098
|
// src/index.ts
|
|
4101
4099
|
var program = new Command();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rankcli/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.34",
|
|
4
4
|
"description": "RankCLI - Ship code, get ranked. SEO meets CI/CD.",
|
|
5
5
|
"homepage": "https://rankcli.dev",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"build": "npm run build:checks && npm run build:wasm && npm run build:js",
|
|
34
34
|
"build:js": "npm run update-version && tsup src/index.ts src/wasm-engine.ts --format cjs,esm --dts",
|
|
35
35
|
"build:checks": "test -d ../agent-runtime && (cd ../agent-runtime && pnpm build:wasm) || echo 'agent-runtime not present as a monorepo sibling - build.rs will fall back to the node_modules-installed bundle'",
|
|
36
|
-
"build:wasm": "cd native && wasm-pack build --target nodejs --release && cp -r pkg ../wasm",
|
|
36
|
+
"build:wasm": "cd native && wasm-pack build --target nodejs --release && mkdir -p ../wasm && cp -r pkg/* ../wasm/ && node ../scripts/verify-wasm.js",
|
|
37
37
|
"build:wasm:dev": "cd native && wasm-pack build --target nodejs --dev && mkdir -p ../wasm && cp -r pkg/* ../wasm/",
|
|
38
38
|
"prebuild:wasm": "mkdir -p wasm",
|
|
39
39
|
"inject-config": "node scripts/inject-config.js",
|
|
@@ -24,8 +24,21 @@ export function get_encrypted_size(): number;
|
|
|
24
24
|
export function get_tier(): string;
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* Initialize the engine with
|
|
27
|
+
* Initialize the engine with the build-time decrypt passphrase.
|
|
28
28
|
* Decrypts the embedded checks and stores them for execution.
|
|
29
|
+
*
|
|
30
|
+
* The `license_key` parameter is misleadingly named for what it does
|
|
31
|
+
* now: entitlement (is this user actually paid?) is decided in
|
|
32
|
+
* TypeScript, from the real Supabase-backed apiKey/plan the CLI already
|
|
33
|
+
* validates on login - not by anything checkable here. The caller only
|
|
34
|
+
* invokes this at all once it has confirmed a paid apiKey, always
|
|
35
|
+
* passing the single build-embedded passphrase (see
|
|
36
|
+
* scripts/inject-config.js), never a user-supplied string. This
|
|
37
|
+
* decryption step exists purely to keep the premium check source out of
|
|
38
|
+
* static analysis of the shipped binary; get_tier()/get_checks_limit()/
|
|
39
|
+
* validate_license() below are legacy from an earlier signed-license
|
|
40
|
+
* design that was never finished and should not be trusted as an
|
|
41
|
+
* entitlement source.
|
|
29
42
|
*/
|
|
30
43
|
export function init_engine(license_key: string): boolean;
|
|
31
44
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/* @ts-self-types="./rankcli_audit_engine.d.ts" */
|
|
2
2
|
|
|
3
|
-
//#region exports
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* Get checks limit for current tier
|
|
7
5
|
* @returns {number}
|
|
@@ -22,18 +20,24 @@ function get_decrypted_code() {
|
|
|
22
20
|
let deferred2_0;
|
|
23
21
|
let deferred2_1;
|
|
24
22
|
try {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
|
|
23
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
24
|
+
wasm.get_decrypted_code(retptr);
|
|
25
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
26
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
27
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
28
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
29
|
+
var ptr1 = r0;
|
|
30
|
+
var len1 = r1;
|
|
31
|
+
if (r3) {
|
|
29
32
|
ptr1 = 0; len1 = 0;
|
|
30
|
-
throw
|
|
33
|
+
throw takeObject(r2);
|
|
31
34
|
}
|
|
32
35
|
deferred2_0 = ptr1;
|
|
33
36
|
deferred2_1 = len1;
|
|
34
37
|
return getStringFromWasm0(ptr1, len1);
|
|
35
38
|
} finally {
|
|
36
|
-
wasm.
|
|
39
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
40
|
+
wasm.__wbindgen_export(deferred2_0, deferred2_1, 1);
|
|
37
41
|
}
|
|
38
42
|
}
|
|
39
43
|
exports.get_decrypted_code = get_decrypted_code;
|
|
@@ -56,30 +60,55 @@ function get_tier() {
|
|
|
56
60
|
let deferred1_0;
|
|
57
61
|
let deferred1_1;
|
|
58
62
|
try {
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
64
|
+
wasm.get_tier(retptr);
|
|
65
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
66
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
67
|
+
deferred1_0 = r0;
|
|
68
|
+
deferred1_1 = r1;
|
|
69
|
+
return getStringFromWasm0(r0, r1);
|
|
63
70
|
} finally {
|
|
64
|
-
wasm.
|
|
71
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
72
|
+
wasm.__wbindgen_export(deferred1_0, deferred1_1, 1);
|
|
65
73
|
}
|
|
66
74
|
}
|
|
67
75
|
exports.get_tier = get_tier;
|
|
68
76
|
|
|
69
77
|
/**
|
|
70
|
-
* Initialize the engine with
|
|
78
|
+
* Initialize the engine with the build-time decrypt passphrase.
|
|
71
79
|
* Decrypts the embedded checks and stores them for execution.
|
|
80
|
+
*
|
|
81
|
+
* The `license_key` parameter is misleadingly named for what it does
|
|
82
|
+
* now: entitlement (is this user actually paid?) is decided in
|
|
83
|
+
* TypeScript, from the real Supabase-backed apiKey/plan the CLI already
|
|
84
|
+
* validates on login - not by anything checkable here. The caller only
|
|
85
|
+
* invokes this at all once it has confirmed a paid apiKey, always
|
|
86
|
+
* passing the single build-embedded passphrase (see
|
|
87
|
+
* scripts/inject-config.js), never a user-supplied string. This
|
|
88
|
+
* decryption step exists purely to keep the premium check source out of
|
|
89
|
+
* static analysis of the shipped binary; get_tier()/get_checks_limit()/
|
|
90
|
+
* validate_license() below are legacy from an earlier signed-license
|
|
91
|
+
* design that was never finished and should not be trusted as an
|
|
92
|
+
* entitlement source.
|
|
72
93
|
* @param {string} license_key
|
|
73
94
|
* @returns {boolean}
|
|
74
95
|
*/
|
|
75
96
|
function init_engine(license_key) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
97
|
+
try {
|
|
98
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
99
|
+
const ptr0 = passStringToWasm0(license_key, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
100
|
+
const len0 = WASM_VECTOR_LEN;
|
|
101
|
+
wasm.init_engine(retptr, ptr0, len0);
|
|
102
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
103
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
104
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
105
|
+
if (r2) {
|
|
106
|
+
throw takeObject(r1);
|
|
107
|
+
}
|
|
108
|
+
return r0 !== 0;
|
|
109
|
+
} finally {
|
|
110
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
81
111
|
}
|
|
82
|
-
return ret[0] !== 0;
|
|
83
112
|
}
|
|
84
113
|
exports.init_engine = init_engine;
|
|
85
114
|
|
|
@@ -102,14 +131,18 @@ function validate_license(license_key) {
|
|
|
102
131
|
let deferred2_0;
|
|
103
132
|
let deferred2_1;
|
|
104
133
|
try {
|
|
105
|
-
const
|
|
134
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
135
|
+
const ptr0 = passStringToWasm0(license_key, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
106
136
|
const len0 = WASM_VECTOR_LEN;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
137
|
+
wasm.validate_license(retptr, ptr0, len0);
|
|
138
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
139
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
140
|
+
deferred2_0 = r0;
|
|
141
|
+
deferred2_1 = r1;
|
|
142
|
+
return getStringFromWasm0(r0, r1);
|
|
111
143
|
} finally {
|
|
112
|
-
wasm.
|
|
144
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
145
|
+
wasm.__wbindgen_export(deferred2_0, deferred2_1, 1);
|
|
113
146
|
}
|
|
114
147
|
}
|
|
115
148
|
exports.validate_license = validate_license;
|
|
@@ -122,39 +155,30 @@ function version() {
|
|
|
122
155
|
let deferred1_0;
|
|
123
156
|
let deferred1_1;
|
|
124
157
|
try {
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
158
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
159
|
+
wasm.version(retptr);
|
|
160
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
161
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
162
|
+
deferred1_0 = r0;
|
|
163
|
+
deferred1_1 = r1;
|
|
164
|
+
return getStringFromWasm0(r0, r1);
|
|
129
165
|
} finally {
|
|
130
|
-
wasm.
|
|
166
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
167
|
+
wasm.__wbindgen_export(deferred1_0, deferred1_1, 1);
|
|
131
168
|
}
|
|
132
169
|
}
|
|
133
170
|
exports.version = version;
|
|
134
171
|
|
|
135
|
-
//#endregion
|
|
136
|
-
|
|
137
|
-
//#region wasm imports
|
|
138
|
-
|
|
139
172
|
function __wbg_get_imports() {
|
|
140
173
|
const import0 = {
|
|
141
174
|
__proto__: null,
|
|
142
|
-
__wbg_Error_8c4e43fe74559d73: function(
|
|
175
|
+
__wbg_Error_8c4e43fe74559d73: function(arg0, arg1) {
|
|
143
176
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
144
|
-
return ret;
|
|
145
|
-
},
|
|
177
|
+
return addHeapObject(ret);
|
|
178
|
+
},
|
|
146
179
|
__wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
|
|
147
180
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
148
181
|
},
|
|
149
|
-
__wbindgen_init_externref_table: function() {
|
|
150
|
-
const table = wasm.__wbindgen_externrefs;
|
|
151
|
-
const offset = table.grow(4);
|
|
152
|
-
table.set(0, undefined);
|
|
153
|
-
table.set(offset + 0, undefined);
|
|
154
|
-
table.set(offset + 1, null);
|
|
155
|
-
table.set(offset + 2, true);
|
|
156
|
-
table.set(offset + 3, false);
|
|
157
|
-
},
|
|
158
182
|
};
|
|
159
183
|
return {
|
|
160
184
|
__proto__: null,
|
|
@@ -162,10 +186,29 @@ function __wbg_get_imports() {
|
|
|
162
186
|
};
|
|
163
187
|
}
|
|
164
188
|
|
|
189
|
+
function addHeapObject(obj) {
|
|
190
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
191
|
+
const idx = heap_next;
|
|
192
|
+
heap_next = heap[idx];
|
|
193
|
+
|
|
194
|
+
heap[idx] = obj;
|
|
195
|
+
return idx;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function dropObject(idx) {
|
|
199
|
+
if (idx < 132) return;
|
|
200
|
+
heap[idx] = heap_next;
|
|
201
|
+
heap_next = idx;
|
|
202
|
+
}
|
|
165
203
|
|
|
166
|
-
|
|
204
|
+
let cachedDataViewMemory0 = null;
|
|
205
|
+
function getDataViewMemory0() {
|
|
206
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
207
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
208
|
+
}
|
|
209
|
+
return cachedDataViewMemory0;
|
|
210
|
+
}
|
|
167
211
|
|
|
168
|
-
//#region intrinsics
|
|
169
212
|
function getStringFromWasm0(ptr, len) {
|
|
170
213
|
ptr = ptr >>> 0;
|
|
171
214
|
return decodeText(ptr, len);
|
|
@@ -179,24 +222,14 @@ function getUint8ArrayMemory0() {
|
|
|
179
222
|
return cachedUint8ArrayMemory0;
|
|
180
223
|
}
|
|
181
224
|
|
|
182
|
-
function
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
return e instanceof Error ? `${e.message}\n\nStack:\n${e.stack}` : e.toString();
|
|
189
|
-
} catch(_) {
|
|
190
|
-
return "<failed to stringify thrown value>";
|
|
191
|
-
}
|
|
192
|
-
}());
|
|
193
|
-
console.error("wasm-bindgen: imported JS function that was not marked as `catch` threw an error:", error);
|
|
194
|
-
throw e;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
225
|
+
function getObject(idx) { return heap[idx]; }
|
|
226
|
+
|
|
227
|
+
let heap = new Array(128).fill(undefined);
|
|
228
|
+
heap.push(undefined, null, true, false);
|
|
229
|
+
|
|
230
|
+
let heap_next = heap.length;
|
|
197
231
|
|
|
198
232
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
199
|
-
if (typeof(arg) !== 'string') throw new Error(`expected a string argument, found ${typeof(arg)}`);
|
|
200
233
|
if (realloc === undefined) {
|
|
201
234
|
const buf = cachedTextEncoder.encode(arg);
|
|
202
235
|
const ptr = malloc(buf.length, 1) >>> 0;
|
|
@@ -224,7 +257,7 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
224
257
|
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
225
258
|
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
226
259
|
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
227
|
-
|
|
260
|
+
|
|
228
261
|
offset += ret.written;
|
|
229
262
|
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
230
263
|
}
|
|
@@ -233,10 +266,10 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
233
266
|
return ptr;
|
|
234
267
|
}
|
|
235
268
|
|
|
236
|
-
function
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
return
|
|
269
|
+
function takeObject(idx) {
|
|
270
|
+
const ret = getObject(idx);
|
|
271
|
+
dropObject(idx);
|
|
272
|
+
return ret;
|
|
240
273
|
}
|
|
241
274
|
|
|
242
275
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
@@ -260,15 +293,7 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
260
293
|
|
|
261
294
|
let WASM_VECTOR_LEN = 0;
|
|
262
295
|
|
|
263
|
-
|
|
264
|
-
//#endregion
|
|
265
|
-
|
|
266
|
-
//#region wasm loading
|
|
267
296
|
const wasmPath = `${__dirname}/rankcli_audit_engine_bg.wasm`;
|
|
268
297
|
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
269
298
|
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
270
299
|
const wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;
|
|
271
|
-
wasm.__wbindgen_start();
|
|
272
|
-
|
|
273
|
-
//#endregion
|
|
274
|
-
exports.__wasm = wasm;
|
|
Binary file
|
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const get_checks_limit: () => number;
|
|
5
|
-
export const get_decrypted_code: () =>
|
|
5
|
+
export const get_decrypted_code: (a: number) => void;
|
|
6
6
|
export const get_encrypted_size: () => number;
|
|
7
|
-
export const get_tier: () =>
|
|
8
|
-
export const init_engine: (a: number, b: number
|
|
7
|
+
export const get_tier: (a: number) => void;
|
|
8
|
+
export const init_engine: (a: number, b: number, c: number) => void;
|
|
9
9
|
export const is_initialized: () => number;
|
|
10
|
-
export const validate_license: (a: number, b: number) =>
|
|
11
|
-
export const version: () =>
|
|
12
|
-
export const
|
|
13
|
-
export const
|
|
14
|
-
export const
|
|
15
|
-
export const
|
|
16
|
-
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
17
|
-
export const __wbindgen_start: () => void;
|
|
10
|
+
export const validate_license: (a: number, b: number, c: number) => void;
|
|
11
|
+
export const version: (a: number) => void;
|
|
12
|
+
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
13
|
+
export const __wbindgen_export: (a: number, b: number, c: number) => void;
|
|
14
|
+
export const __wbindgen_export2: (a: number, b: number) => number;
|
|
15
|
+
export const __wbindgen_export3: (a: number, b: number, c: number, d: number) => number;
|