open-research 0.1.4 → 0.1.5

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/dist/cli.js +13 -6
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -270,7 +270,7 @@ import { createHash, randomBytes } from "crypto";
270
270
  var OPENAI_AUTH_URL = "https://auth.openai.com/oauth/authorize";
271
271
  var OPENAI_TOKEN_URL = "https://auth.openai.com/oauth/token";
272
272
  var OPENAI_CLIENT_ID = "app_EMoamEEZ73f0CkXaXp7hrann";
273
- var OPENAI_SCOPES = "openid profile email offline_access api.connectors.read api.connectors.invoke";
273
+ var OPENAI_SCOPES = "openid profile email offline_access";
274
274
  function getRedirectUri(port) {
275
275
  return `http://localhost:${port}/auth/callback`;
276
276
  }
@@ -294,7 +294,7 @@ function buildAuthorizationUrl(input2) {
294
294
  code_challenge_method: "S256",
295
295
  id_token_add_organizations: "true",
296
296
  codex_cli_simplified_flow: "true",
297
- originator: "codex_cli_rs"
297
+ originator: "open-research"
298
298
  });
299
299
  return `${OPENAI_AUTH_URL}?${params.toString()}`;
300
300
  }
@@ -1482,8 +1482,11 @@ function TextInput({
1482
1482
  } else if (key.rightArrow) {
1483
1483
  if (showCursor) nextCursor++;
1484
1484
  } else if (!key.ctrl && !key.meta) {
1485
- nextValue = originalValue.slice(0, cursorOffset) + input2 + originalValue.slice(cursorOffset);
1486
- nextCursor += input2.length;
1485
+ const clean = input2.replace(/\x1b\[[?>=!]*[0-9;]*[a-zA-Z]/g, "").replace(/[\x00-\x08\x0e-\x1f]/g, "");
1486
+ if (clean) {
1487
+ nextValue = originalValue.slice(0, cursorOffset) + clean + originalValue.slice(cursorOffset);
1488
+ nextCursor += clean.length;
1489
+ }
1487
1490
  }
1488
1491
  nextCursor = Math.max(0, Math.min(nextCursor, nextValue.length));
1489
1492
  setCursorOffset(nextCursor);
@@ -1696,10 +1699,14 @@ function createOpenAIAuthProvider(credentials, onTokenRefresh, onValidationChang
1696
1699
  }
1697
1700
  return creds.accessToken;
1698
1701
  }
1702
+ const sessionId = crypto.randomUUID();
1699
1703
  function buildHeaders3(token) {
1700
1704
  const headers = {
1701
1705
  Authorization: `Bearer ${token}`,
1702
- "Content-Type": "application/json"
1706
+ "Content-Type": "application/json",
1707
+ originator: "open-research",
1708
+ "User-Agent": `open-research/${process.env.npm_package_version ?? "0.1.0"} (${process.platform} ${process.arch})`,
1709
+ session_id: sessionId
1703
1710
  };
1704
1711
  if (creds.accountId) {
1705
1712
  headers["ChatGPT-Account-Id"] = creds.accountId;
@@ -7474,7 +7481,7 @@ program.name("open-research").description("Local-first research CLI powered by C
7474
7481
  }),
7475
7482
  {
7476
7483
  kittyKeyboard: {
7477
- mode: "auto",
7484
+ mode: "enabled",
7478
7485
  flags: ["disambiguateEscapeCodes", "reportAlternateKeys"]
7479
7486
  }
7480
7487
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-research",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Local-first research CLI agent — discover papers, synthesize notes, run analysis, and draft artifacts from your terminal.",
5
5
  "type": "module",
6
6
  "license": "MIT",