@thesashadev/girl-agent 0.1.13 → 0.1.14

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.14
4
+
5
+ Дата: 2026-05-08
6
+
7
+ - Merge pull request #59 from TheSashaDev/devin/1778231542-oauth-fixed-port
8
+ - fix: update OAuth client credentials and add client_secret to token requests
9
+ - fix: use fixed port 3000 for OAuth callback
10
+
3
11
  ## 0.1.13
4
12
 
5
13
  Дата: 2026-05-08
package/dist/cli.js CHANGED
@@ -1070,14 +1070,16 @@ var GIRLAI_BASE = "https://api.girl-agent.com";
1070
1070
  var AUTHORIZE_URL = `${GIRLAI_BASE}/oauth/authorize`;
1071
1071
  var TOKEN_URL = `${GIRLAI_BASE}/oauth/token`;
1072
1072
  var REVOKE_URL = `${GIRLAI_BASE}/oauth/revoke`;
1073
- var CLIENT_ID = "girl-agent-cli";
1073
+ var CLIENT_ID = "oac_dcce490e74a452a9ed20";
1074
+ var CLIENT_SECRET = "abnfSGmeisM7SFdMn_c1MwFYAHaqzgs7";
1075
+ var CALLBACK_PORT = 3e3;
1076
+ var REDIRECT_URI = `http://localhost:${CALLBACK_PORT}/callback`;
1074
1077
  async function runOAuthFlow(log) {
1075
1078
  const state = crypto.randomBytes(16).toString("hex");
1076
- const { port, waitForCode, close } = await startCallbackServer(state);
1077
- const redirectUri = `http://localhost:${port}/callback`;
1079
+ const { waitForCode, close } = await startCallbackServer(state);
1078
1080
  const authorizeParams = new URLSearchParams({
1079
1081
  client_id: CLIENT_ID,
1080
- redirect_uri: redirectUri,
1082
+ redirect_uri: REDIRECT_URI,
1081
1083
  response_type: "code",
1082
1084
  state
1083
1085
  });
@@ -1091,13 +1093,14 @@ async function runOAuthFlow(log) {
1091
1093
  close();
1092
1094
  }
1093
1095
  log("\u043A\u043E\u0434 \u043F\u043E\u043B\u0443\u0447\u0435\u043D, \u043E\u0431\u043C\u0435\u043D\u0438\u0432\u0430\u044E \u043D\u0430 \u0442\u043E\u043A\u0435\u043D...");
1094
- return exchangeCode(code, redirectUri);
1096
+ return exchangeCode(code, REDIRECT_URI);
1095
1097
  }
1096
- async function exchangeCode(code, redirectUri) {
1098
+ async function exchangeCode(code, redirectUri = REDIRECT_URI) {
1097
1099
  const body = new URLSearchParams({
1098
1100
  grant_type: "authorization_code",
1099
1101
  code,
1100
1102
  client_id: CLIENT_ID,
1103
+ client_secret: CLIENT_SECRET,
1101
1104
  redirect_uri: redirectUri
1102
1105
  });
1103
1106
  const res = await fetch(TOKEN_URL, {
@@ -1120,7 +1123,8 @@ async function refreshAccessToken(refreshToken) {
1120
1123
  const body = new URLSearchParams({
1121
1124
  grant_type: "refresh_token",
1122
1125
  refresh_token: refreshToken,
1123
- client_id: CLIENT_ID
1126
+ client_id: CLIENT_ID,
1127
+ client_secret: CLIENT_SECRET
1124
1128
  });
1125
1129
  const res = await fetch(TOKEN_URL, {
1126
1130
  method: "POST",
@@ -1180,11 +1184,8 @@ function startCallbackServer(expectedState) {
1180
1184
  clearTimeout(timeout);
1181
1185
  resolveCode(code);
1182
1186
  });
1183
- server.listen(0, "127.0.0.1", () => {
1184
- const addr = server.address();
1185
- const port = typeof addr === "object" && addr ? addr.port : 0;
1187
+ server.listen(CALLBACK_PORT, "127.0.0.1", () => {
1186
1188
  resolveSetup({
1187
- port,
1188
1189
  waitForCode,
1189
1190
  close: () => server.close()
1190
1191
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thesashadev/girl-agent",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "Telegram AI persona engine with memory, schedule, relationship state and MTProto userbot mode.",
5
5
  "type": "module",
6
6
  "bin": {