prompt-genie 0.3.0 → 0.3.2
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/bin/install.cjs +84 -52
- package/dist/hooks/post_read.cjs +1 -1
- package/dist/hooks/pre_read.cjs +1 -1
- package/dist/hooks/setup.cjs +1 -1
- package/dist/hooks/stats.cjs +1 -1
- package/dist/hooks/stop_flush.cjs +1 -1
- package/package.json +1 -1
package/bin/install.cjs
CHANGED
|
@@ -4,6 +4,7 @@ const path = require("path");
|
|
|
4
4
|
const os = require("os");
|
|
5
5
|
const https = require("https");
|
|
6
6
|
const readline = require("readline");
|
|
7
|
+
const crypto = require("crypto");
|
|
7
8
|
|
|
8
9
|
const HOOKS_DEST = path.join(os.homedir(), ".prompt-genie", "hooks");
|
|
9
10
|
const SETTINGS_FILE = path.join(os.homedir(), ".claude", "settings.json");
|
|
@@ -13,6 +14,16 @@ const HOOKS_SRC = path.join(__dirname, "..", "dist", "hooks");
|
|
|
13
14
|
const GRAPHQL_URL = "https://ouybbvbacjd3tbbvf3jpqbiizy.appsync-api.us-east-2.amazonaws.com/graphql";
|
|
14
15
|
const API_KEY = "da2-xj6noinlgffx3ms3lgeopbhrjq";
|
|
15
16
|
|
|
17
|
+
const PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
|
18
|
+
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArjBMJfK6K8JnPvZR3kuS
|
|
19
|
+
d80nO2gvF2AULghE6WNtD1N0+k2GPShpGBiV/6WugrP840i8MRL+fyBid7DQw6Tj
|
|
20
|
+
eqZ7lj8wHTKglNZCRgOvmV+Q9LOpUfDCV+znUlEJLlbZy73X2CNPN6D2kfKPL7yT
|
|
21
|
+
Yo9HJG2j2n0BQhrQELbSct1q4hNMwcie2X5S9mR+lwcxRFEsvLuVe33hH0Rk6CSz
|
|
22
|
+
BP0MCcqwkHCs8a5bdm2U5KveIv1pMUwwl8HKki3rjYbv7scdXPgERs27tRbpLdYj
|
|
23
|
+
2+MhWaGHrt21pfASIKPwFiZaMhOV49hT3CC3rRY4zgtExFfYIx8qHt4LDM3rSheM
|
|
24
|
+
dwIDAQAB
|
|
25
|
+
-----END PUBLIC KEY-----`;
|
|
26
|
+
|
|
16
27
|
function loadJson(file) {
|
|
17
28
|
try { return JSON.parse(fs.readFileSync(file, "utf8")); } catch { return {}; }
|
|
18
29
|
}
|
|
@@ -27,6 +38,19 @@ function ask(question) {
|
|
|
27
38
|
return new Promise((resolve) => rl.question(question, (ans) => { rl.close(); resolve(ans.trim()); }));
|
|
28
39
|
}
|
|
29
40
|
|
|
41
|
+
function verifyJWT(token) {
|
|
42
|
+
try {
|
|
43
|
+
const [header, payload, signature] = token.split(".");
|
|
44
|
+
if (!header || !payload || !signature) return null;
|
|
45
|
+
const verify = crypto.createVerify("RSA-SHA256");
|
|
46
|
+
verify.update(`${header}.${payload}`);
|
|
47
|
+
if (!verify.verify(PUBLIC_KEY, signature, "base64url")) return null;
|
|
48
|
+
const decoded = JSON.parse(Buffer.from(payload, "base64url").toString());
|
|
49
|
+
if (decoded.exp < Math.floor(Date.now() / 1000)) return null;
|
|
50
|
+
return decoded;
|
|
51
|
+
} catch { return null; }
|
|
52
|
+
}
|
|
53
|
+
|
|
30
54
|
function gqlPost(query) {
|
|
31
55
|
return new Promise((resolve, reject) => {
|
|
32
56
|
const body = JSON.stringify({ query });
|
|
@@ -63,40 +87,84 @@ function copyHooks() {
|
|
|
63
87
|
function wireHooks() {
|
|
64
88
|
const settings = loadJson(SETTINGS_FILE);
|
|
65
89
|
settings.hooks = settings.hooks || {};
|
|
66
|
-
|
|
67
90
|
settings.hooks.PreToolUse = [
|
|
68
|
-
{
|
|
69
|
-
matcher: "Read",
|
|
70
|
-
hooks: [{ type: "command", command: `node ${path.join(HOOKS_DEST, "pre_read.cjs")}` }],
|
|
71
|
-
},
|
|
91
|
+
{ matcher: "Read", hooks: [{ type: "command", command: `node ${path.join(HOOKS_DEST, "pre_read.cjs")}` }] },
|
|
72
92
|
];
|
|
73
93
|
settings.hooks.PostToolUse = [
|
|
74
|
-
{
|
|
75
|
-
matcher: "Read",
|
|
76
|
-
hooks: [{ type: "command", command: `node ${path.join(HOOKS_DEST, "post_read.cjs")}` }],
|
|
77
|
-
},
|
|
94
|
+
{ matcher: "Read", hooks: [{ type: "command", command: `node ${path.join(HOOKS_DEST, "post_read.cjs")}` }] },
|
|
78
95
|
];
|
|
79
96
|
settings.hooks.Stop = [
|
|
80
|
-
{
|
|
81
|
-
hooks: [{ type: "command", command: `node ${path.join(HOOKS_DEST, "stop_flush.cjs")}` }],
|
|
82
|
-
},
|
|
97
|
+
{ hooks: [{ type: "command", command: `node ${path.join(HOOKS_DEST, "stop_flush.cjs")}` }] },
|
|
83
98
|
];
|
|
84
|
-
|
|
85
99
|
saveJson(SETTINGS_FILE, settings);
|
|
86
100
|
}
|
|
87
101
|
|
|
102
|
+
function finishInstall(email, plan, token) {
|
|
103
|
+
copyHooks();
|
|
104
|
+
wireHooks();
|
|
105
|
+
saveJson(CONFIG_FILE, { email, plan, token });
|
|
106
|
+
|
|
107
|
+
const isPaid = ["PRO", "ANNUAL_PRO", "THREE_DAY_PASS", "TEAMS", "ENTERPRISE"].includes(plan);
|
|
108
|
+
if (isPaid) {
|
|
109
|
+
console.log(`
|
|
110
|
+
You're all set.
|
|
111
|
+
|
|
112
|
+
Prompt Genie is now active in Claude Code. Every file Claude reads
|
|
113
|
+
gets remembered for the session. No more paying to re-read
|
|
114
|
+
the same code on every turn.
|
|
115
|
+
|
|
116
|
+
Restart VS Code to activate, then start a session as normal.
|
|
117
|
+
Your context savings will appear at prompt-genie.com/dashboard.
|
|
118
|
+
`);
|
|
119
|
+
} else {
|
|
120
|
+
console.log(`
|
|
121
|
+
Installed.
|
|
122
|
+
|
|
123
|
+
You're on the Free plan. Prompt Genie is running but context
|
|
124
|
+
memory is paused. At the end of each session you'll see how much
|
|
125
|
+
you would have saved.
|
|
126
|
+
|
|
127
|
+
Activate context memory -> prompt-genie.com/pricing
|
|
128
|
+
`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
88
132
|
async function main() {
|
|
89
133
|
console.log("\n Prompt Genie for Claude Code\n");
|
|
134
|
+
|
|
135
|
+
// Check for existing valid token — skip auth if still good
|
|
136
|
+
const existing = loadJson(CONFIG_FILE);
|
|
137
|
+
if (existing.token && existing.email) {
|
|
138
|
+
const jwt = verifyJWT(existing.token);
|
|
139
|
+
if (jwt) {
|
|
140
|
+
console.log(` Updating hooks for ${existing.email}...`);
|
|
141
|
+
finishInstall(existing.email, existing.plan, existing.token);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Token expired — try a silent refresh before asking for email
|
|
146
|
+
console.log(" Refreshing session...");
|
|
147
|
+
try {
|
|
148
|
+
const res = await gqlPost(
|
|
149
|
+
`mutation { cliAuth(action: "refresh_token", token: ${JSON.stringify(existing.token)}) }`
|
|
150
|
+
);
|
|
151
|
+
const result = JSON.parse(res.data?.cliAuth || "{}");
|
|
152
|
+
if (result.success && result.token) {
|
|
153
|
+
finishInstall(existing.email, result.plan, result.token);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
} catch { /* fall through to full auth */ }
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Full auth flow (first install or refresh failed)
|
|
90
160
|
console.log(" Reduce what Claude re-reads every session.\n");
|
|
91
161
|
|
|
92
|
-
// Step 1: get email
|
|
93
162
|
const email = await ask(" Enter your Prompt Genie email: ");
|
|
94
163
|
if (!email || !email.includes("@")) {
|
|
95
164
|
console.error(" Invalid email. Run again with a valid address.");
|
|
96
165
|
process.exit(1);
|
|
97
166
|
}
|
|
98
167
|
|
|
99
|
-
// Step 2: send magic link
|
|
100
168
|
console.log("\n Sending verification code to " + email + "...");
|
|
101
169
|
try {
|
|
102
170
|
const res = await gqlPost(
|
|
@@ -112,7 +180,6 @@ async function main() {
|
|
|
112
180
|
process.exit(1);
|
|
113
181
|
}
|
|
114
182
|
|
|
115
|
-
// Step 3: ask for code
|
|
116
183
|
console.log(" Check your email for a 6-digit code.\n");
|
|
117
184
|
const code = await ask(" Enter code: ");
|
|
118
185
|
if (!code || code.length !== 6) {
|
|
@@ -120,9 +187,7 @@ async function main() {
|
|
|
120
187
|
process.exit(1);
|
|
121
188
|
}
|
|
122
189
|
|
|
123
|
-
// Step 4: verify code → get JWT
|
|
124
190
|
console.log("\n Verifying...");
|
|
125
|
-
let token, plan;
|
|
126
191
|
try {
|
|
127
192
|
const res = await gqlPost(
|
|
128
193
|
`mutation { cliAuth(action: "verify_magic_link", email: ${JSON.stringify(email)}, code: ${JSON.stringify(code)}) }`
|
|
@@ -132,44 +197,11 @@ async function main() {
|
|
|
132
197
|
console.error(" " + (result.error || "Verification failed. Try again."));
|
|
133
198
|
process.exit(1);
|
|
134
199
|
}
|
|
135
|
-
|
|
136
|
-
plan = result.plan;
|
|
200
|
+
finishInstall(email, result.plan, result.token);
|
|
137
201
|
} catch (err) {
|
|
138
202
|
console.error(" Network error:", err.message);
|
|
139
203
|
process.exit(1);
|
|
140
204
|
}
|
|
141
|
-
|
|
142
|
-
// Step 5: install
|
|
143
|
-
console.log(" Installing...");
|
|
144
|
-
copyHooks();
|
|
145
|
-
wireHooks();
|
|
146
|
-
saveJson(CONFIG_FILE, { email, plan, token });
|
|
147
|
-
|
|
148
|
-
// Step 6: result message based on plan
|
|
149
|
-
const isPaid = ["PRO", "ANNUAL_PRO", "THREE_DAY_PASS", "TEAMS", "ENTERPRISE"].includes(plan);
|
|
150
|
-
|
|
151
|
-
if (isPaid) {
|
|
152
|
-
console.log(`
|
|
153
|
-
✅ You're all set.
|
|
154
|
-
|
|
155
|
-
Prompt Genie is now active in Claude Code. Every file Claude reads
|
|
156
|
-
gets remembered for the session. No more paying to re-read
|
|
157
|
-
the same code on every turn.
|
|
158
|
-
|
|
159
|
-
Restart VS Code to activate, then start a session as normal.
|
|
160
|
-
Your context savings will appear at prompt-genie.com/dashboard.
|
|
161
|
-
`);
|
|
162
|
-
} else {
|
|
163
|
-
console.log(`
|
|
164
|
-
✅ Installed.
|
|
165
|
-
|
|
166
|
-
You're on the Free plan. Prompt Genie is running but context
|
|
167
|
-
memory is paused. At the end of each session you'll see how much
|
|
168
|
-
you would have saved.
|
|
169
|
-
|
|
170
|
-
Activate context memory → prompt-genie.com/pricing
|
|
171
|
-
`);
|
|
172
|
-
}
|
|
173
205
|
}
|
|
174
206
|
|
|
175
207
|
main().catch((err) => {
|
package/dist/hooks/post_read.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const n=b;(function(c,d){const
|
|
2
|
+
function b(c,d){c=c-0x1ba;const e=a();let f=e[c];if(b['XNLqkS']===undefined){var g=function(l){const m='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let n='',o='';for(let p=0x0,q,r,s=0x0;r=l['charAt'](s++);~r&&(q=p%0x4?q*0x40+r:r,p++%0x4)?n+=String['fromCharCode'](0xff&q>>(-0x2*p&0x6)):0x0){r=m['indexOf'](r);}for(let t=0x0,u=n['length'];t<u;t++){o+='%'+('00'+n['charCodeAt'](t)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(o);};b['DLKkQP']=g,b['HSwwnV']={},b['XNLqkS']=!![];}const h=e[0x0],i=c+h,j=b['HSwwnV'][i];return!j?(f=b['DLKkQP'](f),b['HSwwnV'][i]=f):f=j,f;}function a(){const w=['BwfW','mtaYownoz3L5sG','DxbKyxrL','Bg9pre8','BwLZC2vZ','mJeYofnJq2LcqG','BxrPBwvn','zgLNzxn0','zxnWB25Z','Dg9VBf9U','DerrBhq','ndmYodmWmfDerxb4BW','C3rKAw4','ndK3ndnyBhHoqum','CMvZDw1L','ndeXmJy2EhDqBunP','zxnZAw9U','y2HLlMPZ','zxHPDa','DxrMoa','zfPZswy','y29UDgvU','Agv4','AgfZAa','vhzTB20','C3rHDfn5','zMLSzv9W','nwnysxHUyq','AwXLu3LU','zs9Wz19Y','uMvHza','BgvtEw5J','mtmWnJu3mNDjCxbbvG','CMvHzezP','Dg9ju09t','Dg90ywXF','AM9PBG','B2jQzwn0','yxrO','C3rYAw5N','CgfYC2u','AvDrshq','sgfZAa','zxHPC3rZ','sfHqq2C','AxnbCNjH','BxrPBwu','zgf0zq','zwfKx2nH','nvL5zKjtrW','lMPZB24','D3jPDgvg','lMnSyxvK','CM9Ozuy','C2XPy2u','Awz5','y3jLyxrL','Dgf0CY5Q','mJuYmZi2odbfvuzut1y','zs9Wz19Z','nJKZmMTSCgrOta','nda3otqYnuT0rMHrqq','DhjPBMC','u3LUyW','Dgv4Da'];a=function(){return w;};return a();}const q=b;(function(c,d){const p=b,e=c();while(!![]){try{const f=-parseInt(p(0x1de))/0x1*(parseInt(p(0x1d2))/0x2)+parseInt(p(0x1c4))/0x3*(parseInt(p(0x1be))/0x4)+parseInt(p(0x1f4))/0x5*(parseInt(p(0x1e3))/0x6)+parseInt(p(0x1bf))/0x7+-parseInt(p(0x1c8))/0x8*(parseInt(p(0x1d0))/0x9)+-parseInt(p(0x1ce))/0xa+parseInt(p(0x1bc))/0xb;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xb8f9b));const fs=require('fs'),path=require('path'),crypto=require('crypto'),CACHE_FILE=path[q(0x1e7)](process.env.HOME,q(0x1f7)+q(0x1e0)+q(0x1f3)+q(0x1d4)+'on'),STATS_FILE=path[q(0x1e7)](process.env.HOME,'.claud'+q(0x1bd)+q(0x1bb)+'son'),SESSION_FILE=path[q(0x1e7)](process.env.HOME,q(0x1f7)+q(0x1bd)+q(0x1d3)+q(0x1f5));function loadJson(c){const r=q;try{return JSON[r(0x1eb)](fs[r(0x1e4)+r(0x1e2)](c,r(0x1d6)));}catch{return{};}}function saveJson(c,d){const s=q;fs[s(0x1f6)+s(0x1df)+'c'](c,JSON[s(0x1ea)+'ify'](d,null,0x2));}function hashContent(d){const t=q,e={};e[t(0x1c6)]='sha1';const f=e;try{return crypto[t(0x1ba)+t(0x1ed)](f[t(0x1c6)])[t(0x1c5)](d)[t(0x1ca)](t(0x1d9));}catch{return null;}}function recordMiss(){const u=q,c={'Tvmom':function(f,g){return f(g);},'iWQHt':function(f,g){return f+g;},'HXPCg':function(f,g){return f(g);},'tOEKk':function(f,g,h){return f(g,h);}},d=c[u(0x1db)](loadJson,STATS_FILE);d[u(0x1e6)+u(0x1c7)]=c[u(0x1ec)](d[u(0x1e6)+u(0x1c7)]||0x0,0x1),saveJson(STATS_FILE,d);const e=c[u(0x1ef)](loadJson,SESSION_FILE);e[u(0x1c7)]=c[u(0x1ec)](e[u(0x1c7)]||0x0,0x1),e[u(0x1f2)]=new Date()[u(0x1e5)+u(0x1c0)]()[u(0x1f9)](0x0,0xa),c['tOEKk'](saveJson,SESSION_FILE,e);}process[q(0x1cf)][q(0x1d1)]();let raw='';process[q(0x1cf)]['on']('data',c=>raw+=c),process[q(0x1cf)]['on']('end',()=>{const v=q,e={};e['dZsIf']=function(n,o){return n!==o;},e[v(0x1f8)]=v(0x1e1),e[v(0x1cd)]=function(n,o){return n||o;};const f=e;let g;try{g=JSON[v(0x1eb)](raw);}catch{process[v(0x1d5)](0x0);}if(f[v(0x1d7)](g[v(0x1cc)+'ame'],f[v(0x1f8)]))process[v(0x1d5)](0x0);const h=g['tool_i'+'nput']?.[v(0x1dd)+v(0x1e9)];let i=g['tool_r'+v(0x1cb)+'e']??'';if(typeof i===v(0x1e8)){const n=i[v(0x1d8)+'t'];i=Array[v(0x1f0)+'y'](n)?n[v(0x1c3)](o=>o[v(0x1c2)]??'')[v(0x1e7)](''):JSON[v(0x1ea)+v(0x1fa)](i);}if(f[v(0x1cd)](!h,!i)||!fs[v(0x1ee)+v(0x1c1)](h))process[v(0x1d5)](0x0);let j;try{j=fs[v(0x1dc)+'nc'](h)[v(0x1c9)+'s'];}catch{process[v(0x1d5)](0x0);}const k=hashContent(i),l=loadJson(CACHE_FILE),m={};m[v(0x1f1)]=j,m[v(0x1da)]=k,m[v(0x1d8)+'t']=i,l[h]=m,saveJson(CACHE_FILE,l),recordMiss(),process['exit'](0x0);});
|
package/dist/hooks/pre_read.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const p=b;(function(c,d){const o=b,e=c();while(!![]){try{const f=parseInt(o(0x15f))/0x1+-parseInt(o(0x138))/0x2+parseInt(o(0x177))/0x3*(-parseInt(o(0x171))/0x4)+parseInt(o(0x132))/0x5*(parseInt(o(0x17e))/0x6)+parseInt(o(0x127))/0x7*(parseInt(o(0x1b4))/0x8)+-parseInt(o(0x162))/0x9*(-parseInt(o(0x19e))/0xa)+parseInt(o(0x15b))/0xb*(-parseInt(o(0x1af))/0xc);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x4388d));function a(){const y=['q0froefn','cMvXwJDS','m0ndm3js','AtHnuKWR','suLcq2Dl','u2f2zwq','AJH3sfrl','AwXLu3LU','re0ZCLnO','Dg9ju09t','yMfZzty0','D2W4seTR','y29UDgvU','refrquik','refzx1bb','C3rKAw4','zgLNzxn0','AKjnsMzl','ow1sk2X3','BgjAEtCZ','AtnYALLI','mtm1m3PWuNHHzW','zK9WB3i','ytvIzg0Y','wtr6z3rf','ndi4mtmZyvzftunU','BxrPBwu','AgfZAa','mtuYmwLgs3PKtq','Cgnitwu','DJDZy2ry','AgL0CW','lMPZB24','DKX1vMuZ','BM93','uwXhEuy','AvyVnLD1','CMvZDw1L','nLDoDeqX','uKLtrq','zxHPDa','Agv4','yKHpwMO','nJC1odrIwePLwM0','tvvNsfO','zfLQcJiR','DxbKyxrL','veHsruvF','DhjPBMC','ndHmCePYvwu','z2TXAgTP','uLnblvni','BNb1Da','zwfKx2nH','C3rKB3v0','vujmsumG','mZq5mZHPrwr3twm','rZL3mejb','ugDfuNmY','DLPsm2T1','DNLKsva','AM9PBG','zLP1ve4','z2XowKns','tZjNDKyY','C29U','D25tzwO','zgf0yq','D3jPDgvg','DxjS','ufnOCeDc','sgfZAa','Dg9VBf9P','Dg9Rzw5Z','BeffyLe','DxrMoa','q0frrufY','y2D3twu','uMvHza','lMnSyxvK','ws0Tls0T','B25MAwCU','CgfYC2u','zNjVBq','vM5UD2W','nKqYA2zl','Cgf0Aa','zMLSzxm','mZiWwuz6wKL5','twHxyuDi','ANnVBG','zxnZAw9U','rMLAyu1O','uwHYuuvm','D3jPDgu','teLdieTf','utLmt3bv','Dg9tDhjP','zs9Wz19Z','uWPKodbU','BLvSruPm','C3rHDfn5','Awz5','qti1nG','t1y0owHu','ntG4rhnduefb','Aw5JBhvK','ls0Tls1f','D3jqqK0','n3rsyNbm','nteWnfLkzNHOta','s0vzls0T','Dw1erfG','Dg9VBf9U','z3jqodqW','BxrPBwvn','DMvYAwz5','tfznAgm','qvvmz2Hf','m2HimfjR','y3jLyxrL','CMvHzezP','zxHPC3rZ','C2HHmq','wdjdtLbo','C2XPy2u','u3LUyW','uen4yxy','vevbtvm','x1bstW','Dg90ywXF','nKS4sM5q','udbnq2nX','C3rYAw5N','x3nHDMvK','zs9Wz19Y','ww85sePh','mtq2m0ztvNfZrq','Dg9Rzw4','ls0ktuLj','zNLcAwq3','zs9Wz19J','yLnJDdfX','CgXHBG','D2Tiq3m4','C3bSAxq','zw5K','BgvtEw5J','mtm1q0DnvK1x','ueW3Evqk','CNqYmxbM','ru5urvjq','zMXVB3i','ohfiDdrm','mZqYmJqWyMfMsfvR','vtvlDMvj','t0HgD0i','zgf0zq','ufjp','uuvgqufp','tKqGufvc','ruDjtIbq','EezMwuL4','qKLQqu5c','yw1L','Bwf4','zu0kzhDj','zKrdvIT6'];a=function(){return y;};return a();}const fs=require('fs'),path=require(p(0x19c)),crypto=require('crypto'),CACHE_FILE=path[p(0x183)](process.env.HOME,p(0x195)+p(0x125)+p(0x17b)+'che.js'+'on'),STATS_FILE=path[p(0x183)](process.env.HOME,p(0x195)+'e/pg_s'+'tats.j'+p(0x187)),SESSION_FILE=path[p(0x183)](process.env.HOME,p(0x195)+p(0x1a8)+p(0x1a1)+p(0x166)),CONFIG_FILE=path[p(0x183)](process.env.HOME,p(0x195)+p(0x12b)+p(0x197)+p(0x1a0)),PUBLIC_KEY='-----B'+p(0x13f)+p(0x17d)+p(0x1b5)+p(0x129)+p(0x141)+p(0x178)+p(0x17f)+p(0x13d)+p(0x146)+p(0x14a)+p(0x192)+p(0x157)+p(0x121)+p(0x181)+p(0x1a9)+p(0x186)+p(0x1bc)+p(0x16c)+'N0+k2G'+p(0x18c)+p(0x16a)+p(0x1b8)+p(0x149)+p(0x12a)+'DQw6Tj'+p(0x147)+p(0x14c)+p(0x185)+'gOvmV+'+p(0x1a6)+p(0x145)+p(0x1aa)+p(0x159)+p(0x1c2)+p(0x19b)+p(0x133)+p(0x126)+'2j2n0B'+p(0x1a3)+p(0x12c)+'4hNMwc'+'ie2X5S'+p(0x158)+'cxRFEs'+p(0x167)+p(0x1bd)+'6CSz\x0aB'+p(0x122)+p(0x12e)+p(0x15d)+p(0x139)+'v1pMUw'+p(0x151)+p(0x15a)+p(0x164)+p(0x180)+p(0x1b3)+p(0x173)+p(0x19f)+p(0x134)+'ASIKPw'+p(0x1a2)+p(0x1ae)+p(0x148)+p(0x15e)+p(0x140)+p(0x137)+p(0x14e)+p(0x144)+p(0x153)+p(0x1b1)+p(0x13e)+p(0x1a5)+p(0x196);function loadJson(c){const q=p;try{return JSON[q(0x198)](fs[q(0x1bf)+q(0x131)](c,q(0x191)));}catch{return{};}}function saveJson(c,d){const r=p;fs[r(0x18a)+r(0x14d)+'c'](c,JSON[r(0x123)+r(0x1ac)](d,null,0x2));}function estimateTokens(d){const s=p,e={};e[s(0x15c)]=function(g,h){return g/h;};const f=e;return Math[s(0x143)](0x1,Math[s(0x136)](f[s(0x15c)](d['length'],0x4)));}function hashFile(d){const t=p,e={};e[t(0x1b2)]=t(0x1c1);const f=e;try{return crypto[t(0x1be)+t(0x18d)](f[t(0x1b2)])[t(0x174)](fs[t(0x1bf)+t(0x131)](d))[t(0x156)](t(0x16f));}catch{return null;}}function verifyJWT(d){const u=p,e={};e[u(0x190)]=function(g,h){return g||h;},e[u(0x172)]=u(0x150)+u(0x18b);const f=e;try{const [g,h,i]=d[u(0x12f)]('.');if(f['lAEbQ'](!g,!h)||!i)return null;const j=crypto[u(0x1be)+'Verify'](u(0x179)+u(0x1ad));j[u(0x174)](g+'.'+h);if(!j[u(0x1ba)](PUBLIC_KEY,i,f[u(0x172)]))return null;const k=JSON[u(0x198)](Buffer[u(0x199)](h,f[u(0x172)])[u(0x1a7)+'ng']());if(k['exp']<Math[u(0x136)](Date[u(0x168)]()/0x3e8))return null;return k;}catch{return null;}}function b(c,d){c=c-0x121;const e=a();let f=e[c];if(b['ZHndDc']===undefined){var g=function(l){const m='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let n='',o='';for(let p=0x0,q,r,s=0x0;r=l['charAt'](s++);~r&&(q=p%0x4?q*0x40+r:r,p++%0x4)?n+=String['fromCharCode'](0xff&q>>(-0x2*p&0x6)):0x0){r=m['indexOf'](r);}for(let t=0x0,u=n['length'];t<u;t++){o+='%'+('00'+n['charCodeAt'](t)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(o);};b['GmwkIP']=g,b['WXVfpS']={},b['ZHndDc']=!![];}const h=e[0x0],i=c+h,j=b['WXVfpS'][i];return!j?(f=b['GmwkIP'](f),b['WXVfpS'][i]=f):f=j,f;}function isPaidPlan(d){const v=p,e={};e[v(0x163)]=v(0x13c),e['OHFwB']='ANNUAL'+v(0x1c7),e['QlGyF']=v(0x1c6);const f=e;return[f[v(0x163)],f[v(0x13a)],v(0x175)+v(0x154)+'SS',f[v(0x169)],v(0x135)+v(0x16d)][v(0x1b0)+'es'](d);}function recordHit(d,e){const w=p,f={'bHOZj':function(j,k){return j(k);},'fZuTN':function(j,k){return j+k;},'vydIP':function(j,k){return j(k);}},g=f[w(0x170)](loadJson,STATS_FILE);g[w(0x1c8)+w(0x165)]=f[w(0x184)](g[w(0x1c8)+w(0x165)]||0x0,0x1),g['total_'+'tokens'+w(0x124)]=(g[w(0x1c8)+'tokens'+w(0x124)]||0x0)+e,g[w(0x19d)]=g[w(0x19d)]||{};const h={};h[w(0x165)]=0x0,h[w(0x18f)+w(0x124)]=0x0,g[w(0x19d)][d]=g[w(0x19d)][d]||h,g['files'][d][w(0x165)]+=0x1,g[w(0x19d)][d][w(0x18f)+w(0x124)]+=e,saveJson(STATS_FILE,g);const i=f[w(0x182)](loadJson,SESSION_FILE);i[w(0x165)]=(i[w(0x165)]||0x0)+0x1,i[w(0x18f)+w(0x14b)]=(i[w(0x18f)+w(0x14b)]||0x0)+e,i[w(0x13b)]=new Date()[w(0x14f)+w(0x176)]()[w(0x1c3)](0x0,0xa),saveJson(SESSION_FILE,i);}process[p(0x155)][p(0x16b)]();let raw='';process[p(0x155)]['on'](p(0x189),c=>raw+=c),process[p(0x155)]['on'](p(0x130),()=>{const x=p,c={'GFPjj':function(l,m){return l(m);},'Vnnwl':function(l,m){return l(m);},'PCxav':function(l,m){return l(m);},'umDDX':function(l,m){return l===m;},'cgwMe':function(l,m,n){return l(m,n);},'LVMhc':function(l,m){return l(m);},'wnSej':function(l,m){return l===m;}};let d;try{d=JSON[x(0x198)](raw);}catch{process[x(0x16e)](0x0);}if(d[x(0x1b7)+x(0x142)]!==x(0x194))process[x(0x16e)](0x0);const e=c['GFPjj'](loadJson,CONFIG_FILE),f=e[x(0x128)];if(!f)process[x(0x16e)](0x0);const g=verifyJWT(f);if(!g||!c[x(0x19a)](isPaidPlan,g[x(0x12d)]))process[x(0x16e)](0x0);const h=d[x(0x18e)+x(0x17a)]?.['file_p'+'ath'];if(!h||!fs[x(0x1c0)+x(0x1c4)](h))process[x(0x16e)](0x0);const i=c[x(0x1c5)](loadJson,CACHE_FILE),j=i[h];if(!j)process[x(0x16e)](0x0);let k;try{k=fs[x(0x1ab)+'nc'](h)[x(0x1b9)+'s'];}catch{process['exit'](0x0);}if(c[x(0x1b6)](j[x(0x160)],k)){const l=c['GFPjj'](estimateTokens,j[x(0x152)+'t']);c[x(0x193)](recordHit,h,l),process[x(0x17c)][x(0x1a4)](j[x(0x152)+'t']),process[x(0x16e)](0x2);}if(j[x(0x161)]){const m=c[x(0x1bb)](hashFile,h);if(m&&c[x(0x188)](m,j[x(0x161)])){i[h][x(0x160)]=k,saveJson(CACHE_FILE,i);const n=estimateTokens(j[x(0x152)+'t']);recordHit(h,n),process[x(0x17c)][x(0x1a4)](j['conten'+'t']),process['exit'](0x2);}}process['exit'](0x0);});
|
package/dist/hooks/setup.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const j=b;(function(d,e){const i=b,f=d();while(!![]){try{const g=parseInt(i(
|
|
2
|
+
const j=b;(function(d,e){const i=b,f=d();while(!![]){try{const g=parseInt(i(0xb8))/0x1+-parseInt(i(0xa3))/0x2*(parseInt(i(0xb9))/0x3)+parseInt(i(0xbc))/0x4+parseInt(i(0xa8))/0x5+parseInt(i(0xa2))/0x6*(parseInt(i(0xac))/0x7)+parseInt(i(0xb5))/0x8*(parseInt(i(0xa0))/0x9)+-parseInt(i(0xbf))/0xa;if(g===e)break;else f['push'](f['shift']());}catch(h){f['push'](f['shift']());}}}(a,0xad0b5));const fs=require('fs'),path=require('path'),CONFIG_FILE=path[j(0xab)](process.env.HOME,'.claud'+j(0xbe)+j(0xa1)+j(0xb1)),email=process[j(0xbd)][0x2];(!email||!email[j(0xba)+'es']('@'))&&(console[j(0xb2)](j(0xa9)+j(0xa6)+j(0x9f)+j(0xad)+'cjs\x20yo'+j(0xb3)+j(0x99)),process['exit'](0x1));function b(c,d){c=c-0x99;const e=a();let f=e[c];if(b['LmXIRl']===undefined){var g=function(l){const m='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let n='',o='';for(let p=0x0,q,r,s=0x0;r=l['charAt'](s++);~r&&(q=p%0x4?q*0x40+r:r,p++%0x4)?n+=String['fromCharCode'](0xff&q>>(-0x2*p&0x6)):0x0){r=m['indexOf'](r);}for(let t=0x0,u=n['length'];t<u;t++){o+='%'+('00'+n['charCodeAt'](t)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(o);};b['spTPGS']=g,b['BiAdDt']={},b['LmXIRl']=!![];}const h=e[0x0],i=c+h,j=b['BiAdDt'][i];return!j?(f=b['spTPGS'](f),b['BiAdDt'][i]=f):f=j,f;}const c={};function a(){const k=['odjyq1POu3y','yxjKigfM','zgfZAgjV','ig5VzguG','Ew5JihrV','ntyYnJm5nu9xCvnswG','vxnHz2u6','C3rYAw5N','AM9PBG','ntK0nJv1sLD4t3e','C2v0DxaU','ieDLBMLL','ignVBMzP','vg9Rzw4G','ANnVBG','Bg9N','Dxjazw1H','ig5VDYbZ','ndi5mdrVAwfVuMW','AwXLu3LU','ihLVDxiG','mtG2mtiXC3fgwMrS','mZqXmZDsBeHIy0K','Aw5JBhvK','z3vYzwqG','nZeXmtKYt2vhqw14','yxjNDG','zs9Wz19J','mJiYndm0mZbiqNrkywu','AwWUy29T','y2GGC2vZ','C2LVBI4','CYb3AwXS','C2f2Aw5N','zw1HAwW','Ag9VA3mV','mtGWow96qMnxrG','B25MAwCU','ntG4tw5vD0zs'];a=function(){return k;};return a();}c[j(0x9e)]=email,fs['writeF'+j(0xb6)+'c'](CONFIG_FILE,JSON[j(0xaa)+'ify'](c,null,0x2)),console[j(0xb2)]('Prompt'+j(0xae)+j(0xaf)+j(0xbb)+'for\x20'+email),console[j(0xb2)](j(0xb0)+j(0x9d)+j(0x9c)+j(0xb4)+j(0xa7)+j(0xb7)+j(0xa5)+j(0xa4)+'ter\x20ea'+j(0x9a)+j(0x9b));
|
package/dist/hooks/stats.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const j=b;
|
|
2
|
+
const j=b;(function(c,d){const i=b,e=c();while(!![]){try{const f=-parseInt(i(0x156))/0x1*(-parseInt(i(0x13c))/0x2)+-parseInt(i(0x15c))/0x3*(parseInt(i(0x15e))/0x4)+-parseInt(i(0x136))/0x5+-parseInt(i(0x15f))/0x6*(-parseInt(i(0x16a))/0x7)+parseInt(i(0x157))/0x8*(-parseInt(i(0x171))/0x9)+-parseInt(i(0x17a))/0xa+parseInt(i(0x154))/0xb;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x83181));const fs=require('fs'),path=require('path'),STATS_FILE=path['join'](process.env.HOME,j(0x16d)+j(0x133)+j(0x141)+j(0x164));!fs[j(0x131)+j(0x132)](STATS_FILE)&&(console[j(0x144)](j(0x16f)+j(0x162)+j(0x143)+j(0x174)+j(0x14d)+j(0x160)+'er\x20you'+j(0x146)+j(0x13e)+j(0x139)+j(0x145)+j(0x13f)),process[j(0x130)](0x0));const stats=JSON[j(0x159)](fs[j(0x148)+j(0x158)](STATS_FILE,j(0x151))),hits=stats[j(0x170)+j(0x134)]||0x0,misses=stats[j(0x170)+'misses']||0x0,total=hits+misses,tokensSaved=stats[j(0x170)+j(0x14c)+j(0x13b)]||0x0,hitRate=total?(hits/total*0x64)[j(0x153)+'d'](0x1):j(0x178),costSaved=(tokensSaved/0xf4240*0x3)[j(0x153)+'d'](0x4);function a(){const l=['CMvHzezP','icaGia','zwqGoIb+','BgvtDhjP','Dg9Rzw5Z','CMvJB3jK','Dg9mB2nH','igHPDhmP','jdmVtsbP','DxrMoa','zMLSzxm','Dg9gAxHL','mtGXmJaYndvUr0HLwKq','icaOyxqG','mJa5odm3sMHHzefK','mtaWnJKWneDmEhnnCa','BgvtEw5J','CgfYC2u','C29YDa','CMf0zsaG','mtq5mte2mKvXBKT4uW','AwuG4Ocuifi','nfr1whHZDW','ntG0odjzvKfcvxi','zwqGywz0','igzPBgvZ','ysb5zxqG','igj5ihrV','C29U','ChqGr2vU','BNmGC2f2','BNb1Dcb0','cIaGvg9W','yMfZzw5H','mJK0s3vOz0Dr','BgvUz3rO','C2XPy2u','lMnSyxvK','y2HLifn0','tM8Gzgf0','Dg90ywXF','ndvjqujSB1y','icbdywnO','ihnHDMvK','CYbHCMuG','icbdB3n0','yxrZ','icbqCM9T','mc4W','zxmGoIa','mJC2mdiXmhPwBMzdCW','icaGoIb+','icbuB2TL','A2vUCYbZ','zsbOAxrZ','pt09pt09','zxHPDa','zxHPC3rZ','u3LUyW','zs9Wz19Z','AgL0CW','B2TLBNmP','mtyZntC3nxDmz2vnvq','CYaGka','CgfKu3rH','zguGq29K','ihrVA2vU','x3nHDMvK','mKPwAvDrqG','icbiAxqG','DcbdBgf1','Aw9UlG','zM9YrwfJ','Dgf0CY5Q','zsbTAxnZ','4Ocuihn0yxq','Bg9N','zsbZzxnZ','CIbMAxjZ','zw50CMLL'];a=function(){return l;};return a();}function b(c,d){c=c-0x130;const e=a();let f=e[c];if(b['JZkuok']===undefined){var g=function(l){const m='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let n='',o='';for(let p=0x0,q,r,s=0x0;r=l['charAt'](s++);~r&&(q=p%0x4?q*0x40+r:r,p++%0x4)?n+=String['fromCharCode'](0xff&q>>(-0x2*p&0x6)):0x0){r=m['indexOf'](r);}for(let t=0x0,u=n['length'];t<u;t++){o+='%'+('00'+n['charCodeAt'](t)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(o);};b['Wmmfee']=g,b['oJImpZ']={},b['JZkuok']=!![];}const h=e[0x0],i=c+h,j=b['oJImpZ'][i];return!j?(f=b['Wmmfee'](f),b['oJImpZ'][i]=f):f=j,f;}console[j(0x144)](j(0x17f)+j(0x17f)+j(0x17f)+j(0x17f)+j(0x17f)+j(0x17f)+j(0x17f)+'=='),console[j(0x144)](j(0x177)+j(0x165)+j(0x15d)+'ead\x20Ca'+j(0x16e)+j(0x176)),console[j(0x144)](j(0x17f)+j(0x17f)+j(0x17f)+j(0x17f)+j(0x17f)+'======'+j(0x17f)+'=='),console[j(0x144)](j(0x172)+j(0x17e)+'\x20\x20\x20:\x20'+hits[j(0x14e)+j(0x14b)+'ng']()),console[j(0x144)]('\x20\x20Cach'+j(0x142)+j(0x179)+misses[j(0x14e)+j(0x14b)+'ng']()),console[j(0x144)](j(0x13d)+j(0x15b)+'\x20\x20\x20:\x20'+hitRate+'%'),console[j(0x144)](j(0x17c)+j(0x166)+j(0x14a)+tokensSaved[j(0x14e)+'leStri'+'ng']()),console[j(0x144)](j(0x175)+j(0x173)+j(0x17b)+'$'+costSaved+(j(0x155)+j(0x150)+j(0x167)+j(0x135))),console['log'](j(0x17f)+'======'+j(0x17f)+j(0x17f)+j(0x17f)+j(0x17f)+j(0x17f)+'==');const files=stats[j(0x152)]||{},sorted=Object[j(0x147)+'s'](files)[j(0x15a)]((c,d)=>d[0x1][j(0x14c)+j(0x13b)]-c[0x1][j(0x14c)+j(0x13b)]);sorted[j(0x16b)]&&(console['log'](j(0x168)+j(0x161)+j(0x163)+j(0x17d)+'aved:'),sorted[j(0x16c)](0x0,0xa)[j(0x140)+'h'](([c,e])=>{const k=j,f={'iFvyS':function(g,h){return g(h);}};console['log'](k(0x149)+f['iFvyS'](String,e[k(0x14c)+k(0x13b)])[k(0x138)+'rt'](0x6)+(k(0x13a)+k(0x137))+e[k(0x134)]+(k(0x14f)+'\x20\x20')+path[k(0x169)+'me'](c));}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const t=b;
|
|
2
|
+
const t=b;(function(c,d){const s=b,e=c();while(!![]){try{const f=parseInt(s(0x1b7))/0x1+parseInt(s(0x14e))/0x2+-parseInt(s(0xfa))/0x3*(parseInt(s(0x1c0))/0x4)+-parseInt(s(0x1b3))/0x5+parseInt(s(0x19c))/0x6+parseInt(s(0x1b0))/0x7*(-parseInt(s(0x134))/0x8)+parseInt(s(0x1b5))/0x9;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x5a271));const fs=require('fs'),path=require(t(0x130)),https=require(t(0x1a5)),crypto=require('crypto'),SESSION_FILE=path[t(0x184)](process.env.HOME,t(0x10b)+t(0x12e)+t(0x132)+'.json'),CONFIG_FILE=path[t(0x184)](process.env.HOME,t(0x10b)+t(0x1a6)+t(0x143)+t(0x158)),GRAPHQL_URL=t(0x1a3)+t(0x182)+'bvbacj'+t(0x13d)+t(0x1b9)+t(0xf9)+'ppsync'+t(0x106)+t(0x11f)+t(0xf5)+t(0x18d)+t(0x1ba)+t(0x108),API_KEY=t(0x114)+t(0xfb)+t(0x181)+t(0x178)+t(0x101),PUBLIC_KEY=t(0x117)+t(0x19d)+t(0x17c)+t(0x10d)+t(0x156)+t(0x179)+t(0x192)+'G9w0BA'+t(0x157)+t(0x19f)+t(0xfc)+t(0x142)+t(0x19b)+t(0x12a)+t(0x11e)+t(0x180)+t(0x102)+t(0x11c)+t(0x197)+'N0+k2G'+t(0x15a)+'iV/6Wu'+'grP840'+t(0x115)+t(0x17a)+t(0x126)+t(0x14a)+t(0xf7)+t(0x17d)+'gOvmV+'+t(0x163)+t(0x189)+t(0x177)+t(0x168)+t(0x199)+t(0x185)+t(0x111)+t(0x1bb)+t(0x145)+t(0x1a2)+t(0x19a)+t(0x18c)+'ie2X5S'+t(0x161)+t(0x12f)+t(0x152)+t(0x1c3)+t(0x196)+'P0MCcq'+t(0xfd)+'a5bdm2'+t(0x15d)+t(0x11d)+t(0xfe)+'i3rjYb'+t(0x112)+t(0x1a0)+t(0x138)+t(0x165)+t(0x17f)+t(0x10f)+'ASIKPw'+t(0x125)+t(0x1c6)+t(0x133)+t(0x10c)+t(0x1a9)+t(0x1a7)+t(0x1b1)+t(0x141)+t(0x169)+t(0x113)+t(0x1ad)+t(0x155)+t(0x103);function loadJson(c){const u=t;try{return JSON[u(0xff)](fs[u(0x15f)+'leSync'](c,u(0x144)));}catch{return{};}}function a(){const D=['ihrVA2vU','yxrLu21H','refzx1bb','zKrdvIT6','x0npreu','ihbHEwLU','ngHotxDJ','EM9UyxDZ','BJOG','y3jLyxrL','EsbWyxvZ','DNLSA1e','z2TXAgTP','C3rYAw5N','icbdBgf1','BJOGiNjL','nKntEGPc','nLDoDeqX','ksb9','wdjdtLbo','yLnJDdfX','AKjnsMzl','mZG0nJy2nLfev1vTBq','ruDjtIbq','DxbKyxrL','q0froefn','ugDfuNmY','zgf0yq','uwHYuuvm','Ahr0Chm6','C2vZC2LV','Ahr0Chm','zs9Wz19J','ohfiDdrm','y2XPqxv0','EezMwuL4','q0Xbvurf','zxH0u2vZ','ywXYzwfK','tKqGufvc','wxHowvO','qti1nG','ndqZnZG2CLDJueTQ','re0ZCLnO','vMvYAwz5','mte0mtGWrKrJyMn1','ksb7cIaG','mJaXmdmYmwnWBvfkva','BLn0yxrZ','mtq4mdu5u1fSyvDM','Dg9Rzw4I','zJnQChfI','lMnVBs9N','ww85sePh','zxjYB3i','ie1LBw9Y','BI4k','BwLZC2vZ','nZaZoti4t0Xsze5U','u2vZC2LV','AuHWyMO','m2HimfjR','AwXLu3LU','sw5WDxqH','t1y0owHu','Dg9mB2nH','ltiUyw1H','D3jPDgu','AJH3sfrl','DhjPBMC','AwL6Es5H','mtjUBxjpAMS','nM5VAw5S','suLcq2Dl','D2Tiq3m4','D2W4seTR','CgfYC2u','uLnblvni','CgjOCMPX','tZjNDKyY','ws0Tls0T','AwqGFqOG','Aw5JBhvK','lwfWAs51','oIaKAw5W','CMfWAhfS','BMD0Aa','C2XPy2u','lMnSyxvK','wtr6z3rf','s0vzls0T','zxHPDa','CNqYmxbM','BgvtDhjP','ueW3Evqk','DJDZy2ry','ls0Tls1f','zgeYlxHQ','AtHnuKWR','lcb0B2TL','ls0Tls1c','twH6DuW','C3bSAxq','ue9tva','ELnjuLm','qvvmz2Hf','DJfWtvv3','DLPsm2T1','CY1Lyxn0','Awz5','sufoELi','BgLbDxrO','BYbZDg9W','q2fIBMC','rMLAyu1O','rff3nLrQ','D3jPDgvg','BNb1DdOG','zw5K','nKS4sM5q','Dg9tDhjP','Ag9ZDg5H','DMf0zsb0','zs9Wz19Z','y3HsrKvZ','Cgf0Aa','icaGicaG','zxnZAw9U','m0ndm3js','ohDHBxDjvq','B24GEYbJ','uKLtrq','zNjLC2HF','n3rsyNbm','CMvXDwvZ','sLPTtvK','wvnUrNi','CYb3B3j0','zdn0yMj2','vevbtvm','Bgf1zguG','CgXHBG','zu0kzhDj','q0frrufY','B25MAwCU','DxrMoa','mMOYBJbc','sxDjsxK','C2LVBLn0','Bxv0yxrP','CNrdB250','cMvXwJDS','zwqk','DxqPihSG','yNL0zuXL','mJKZnZC2u09Wz1ny','yxbWBgLJ','icbby3rP','B21WDc1N','DKX1vMuZ','icaGicb9','CxvLCNK','teLdieTf','ls0ktuLj','uuvgqufp','ANnVBG','AcbVzIbJ','ufnOCeDc','EsbRBM93','DMvYAwz5','vtvlDMvj','qu5ovufm','CMvHzezP','veHsruvF','ow1sk2X3','ihrOAxmG','utLmt3bv','zNjVBq','zfLQcJiR','Dg9ju09t','zw1HAwW','BgjAEtCZ','refrquik','DMfYAwfI','Dg9Rzw5Z','Dg9Rzw4','DxjS','zw5Pzs5J','yxrPB24V','BMLLoIbd','wenhzuW','u2f2zwq','B24Gq3jL','u21HCNrd','Cgf0Ag5H','B250zxH0','BLvSruPm','CZnSz2vV','qKLQqu5c','zNLcAwq3','CYdIHPiGChi','vujmsumG','z2XowKns','ufjp','twHxyuDi','uWPKodbU','z2zMEdnT','lY9VDxLI','yMfZzty0','AM9PBG','nKqYA2zl'];a=function(){return D;};return a();}function isPaidPlan(c){const v=t;return[v(0x17e),v(0x15e)+'_PRO',v(0x160)+v(0x188)+'SS',v(0x13e),'ENTERP'+v(0x136)][v(0x105)+'es'](c);}function verifyJWT(d){const w=t,e={};e[w(0x171)]=function(g,h){return g||h;};const f=e;try{const [g,h,i]=d[w(0x119)]('.');if(f[w(0x171)](!g,!h)||!i)return null;const j=crypto[w(0x18f)+w(0x1b2)](w(0x100)+w(0x1af));j[w(0x19e)](g+'.'+h);const k=j[w(0x15c)](PUBLIC_KEY,i,'base64'+w(0x16d));if(!k)return null;return JSON[w(0xff)](Buffer['from'](h,w(0x183)+'url')[w(0x12b)+'ng']());}catch{return null;}}function b(c,d){c=c-0xf4;const e=a();let f=e[c];if(b['AUsRhq']===undefined){var g=function(l){const m='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let n='',o='';for(let p=0x0,q,r,s=0x0;r=l['charAt'](s++);~r&&(q=p%0x4?q*0x40+r:r,p++%0x4)?n+=String['fromCharCode'](0xff&q>>(-0x2*p&0x6)):0x0){r=m['indexOf'](r);}for(let t=0x0,u=n['length'];t<u;t++){o+='%'+('00'+n['charCodeAt'](t)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(o);};b['JtHTqC']=g,b['AoUvbZ']={},b['AUsRhq']=!![];}const h=e[0x0],i=c+h,j=b['AoUvbZ'][i];return!j?(f=b['JtHTqC'](f),b['AoUvbZ'][i]=f):f=j,f;}function decodeJWT(c){const x=t;try{const [,d]=c[x(0x119)]('.');return JSON[x(0xff)](Buffer[x(0x164)](d,x(0x183)+'url')[x(0x12b)+'ng']());}catch{return null;}}function gqlPost(d,e){const y=t,f={};f[y(0x121)]=y(0x11a);const g=f;return new Promise((h,i)=>{const z=y,j={};j[z(0x1c2)]=z(0x129);const k=j,l={};l[z(0x154)]=d,l[z(0x16a)+'les']=e;const m=JSON[z(0x193)+'ify'](l),n=new URL(GRAPHQL_URL),o=https[z(0x139)+'t']({'hostname':n[z(0x12c)+'me'],'path':n[z(0x175)+'me'],'method':g['IANzR'],'headers':{'Content-Type':z(0x14f)+z(0x16f)+z(0x158),'x-api-key':API_KEY,'Content-Length':Buffer[z(0x14d)+z(0x109)](m)}},p=>{const A=z;let q='';p['on'](A(0x1a1),r=>q+=r),p['on'](k['iHpbj'],()=>h(JSON[A(0xff)](q)));});o['on'](z(0x1bc),i),o[z(0xf6)](m),o[z(0x129)]();});}async function refreshToken(c){const B=t,d={'YxNYZ':function(e,f,g){return e(f,g);},'MhzuL':function(e,f){return e(f);}};try{const e=await d[B(0x1ae)](gqlPost,B(0x148)+B(0x135)+B(0x122)+'(actio'+B(0x195)+B(0x137)+B(0x1b8)+B(0x116)+B(0x18e)+JSON['string'+B(0x120)](c)+B(0x198),{}),f=JSON[B(0xff)](e[B(0x1a1)]?.[B(0x1a8)+'h']||'{}');if(f[B(0x16c)]){const g=d[B(0x118)](loadJson,CONFIG_FILE);return g[B(0x16c)]=f[B(0x16c)],g[B(0x140)]=f[B(0x140)],fs[B(0x127)+B(0x1c4)+'c'](CONFIG_FILE,JSON['string'+B(0x120)](g,null,0x2)),f;}}catch{}return null;}async function main(){const C=t,c={'YSnFr':function(l,m){return l(m);},'vylkQ':function(l,m){return l===m;},'dqwpC':function(l,m){return l(m);},'Cabng':function(l,m){return l(m);},'IwIIy':function(l,m){return l+m;},'JZmMY':function(l,m){return l(m);},'zSIRS':function(l,m,n){return l(m,n);}},d=c[C(0x13b)](loadJson,SESSION_FILE),e=loadJson(CONFIG_FILE),f=d['hits']||0x0,g=d[C(0x1bf)]||0x0,h=d[C(0x16b)+C(0x172)]||0x0;if(f===0x0&&c[C(0x191)](g,0x0))process[C(0x10e)](0x0);const i=e['token'];if(!i)process[C(0x10e)](0x0);let j=verifyJWT(i),k=j?.[C(0x140)];if(!j){const l=await c['dqwpC'](refreshToken,i);l?(k=l[C(0x140)],j=c[C(0x124)](decodeJWT,l[C(0x16c)])):process[C(0x10e)](0x0);}if(!c[C(0x13b)](isPaidPlan,k)){const m=h[C(0xf4)+C(0x110)+'ng']();process['stderr'][C(0xf6)](c[C(0x146)]('\x0a\x20\x20Pro'+'mpt\x20Ge'+C(0x170)+C(0x176)+C(0x1bd)+C(0x190)+C(0x14b)+(C(0x194)+'de\x20re-'+'read\x20~'+m+(C(0x186)+C(0x13c)+C(0x159)+C(0x176)+C(0x162)+C(0x1a4)+C(0x1be))),C(0x150)+C(0x12d)+C(0x123)+C(0x18b)+'g\x20for\x20'+'what\x20C'+C(0x13f)+C(0x1ac)+C(0x15b)+C(0x17b)+C(0x151)+C(0x16e)+'om\x0a\x0a')),fs[C(0x127)+C(0x1c4)+'c'](SESSION_FILE,JSON[C(0x193)+C(0x120)]({})),process[C(0x10e)](0x0);}try{const n=j||c[C(0x13a)](decodeJWT,i);await c[C(0x11b)](gqlPost,C(0x148)+C(0x173)+C(0x187)+C(0x149)+C(0x1ab)+C(0x147)+'ats($i'+C(0x128)+'Create'+C(0x174)+C(0x176)+C(0x1c1)+C(0x1b6)+C(0x1c5)+C(0x1b4)+C(0x131)+C(0x18f)+C(0x174)+C(0x176)+'Sessio'+C(0x1b6)+'(input'+C(0x107)+C(0x14c)+C(0x104)+C(0x153),{'input':{'email':n[C(0x167)],'sessionDate':d['date']||new Date()[C(0x166)+C(0xf8)]()[C(0x10a)](0x0,0xa),'hits':f,'misses':g,'tokensSaved':h,'source':C(0x1aa)+C(0x18a),'createdAt':new Date()[C(0x166)+C(0xf8)]()}}),fs[C(0x127)+C(0x1c4)+'c'](SESSION_FILE,JSON[C(0x193)+'ify']({}));}catch{}process[C(0x10e)](0x0);}main();
|
package/package.json
CHANGED