@codelia/runtime 0.1.58 → 0.1.60

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.cjs CHANGED
@@ -8681,6 +8681,8 @@ var buildHostedSearchToolDefinitions = (provider, options) => {
8681
8681
  }
8682
8682
  ];
8683
8683
  };
8684
+ var OPENAI_OAUTH_ORIGINATOR = "codelia";
8685
+ var OPENAI_OAUTH_USER_AGENT = "codelia-cli";
8684
8686
  var buildOpenAiClientOptions = (authResolver, auth) => {
8685
8687
  if (auth.method === "api_key") {
8686
8688
  return { apiKey: auth.api_key };
@@ -8695,6 +8697,12 @@ var buildOpenAiClientOptions = (authResolver, auth) => {
8695
8697
  const fetchWithAccount = Object.assign(
8696
8698
  async (input, init) => {
8697
8699
  const headers = new Headers(init?.headers ?? {});
8700
+ if (!headers.has("originator")) {
8701
+ headers.set("originator", OPENAI_OAUTH_ORIGINATOR);
8702
+ }
8703
+ if (!headers.has("User-Agent")) {
8704
+ headers.set("User-Agent", OPENAI_OAUTH_USER_AGENT);
8705
+ }
8698
8706
  if (accountId) {
8699
8707
  headers.set("ChatGPT-Account-Id", accountId);
8700
8708
  }
@@ -8718,7 +8726,10 @@ var buildOpenAiClientOptions = (authResolver, auth) => {
8718
8726
  },
8719
8727
  { preconnect: fetch.preconnect }
8720
8728
  );
8721
- const defaultHeaders = {};
8729
+ const defaultHeaders = {
8730
+ originator: OPENAI_OAUTH_ORIGINATOR,
8731
+ "User-Agent": OPENAI_OAUTH_USER_AGENT
8732
+ };
8722
8733
  if (accountId) {
8723
8734
  defaultHeaders["ChatGPT-Account-ID"] = accountId;
8724
8735
  }
package/dist/index.js CHANGED
@@ -8685,6 +8685,8 @@ var buildHostedSearchToolDefinitions = (provider, options) => {
8685
8685
  }
8686
8686
  ];
8687
8687
  };
8688
+ var OPENAI_OAUTH_ORIGINATOR = "codelia";
8689
+ var OPENAI_OAUTH_USER_AGENT = "codelia-cli";
8688
8690
  var buildOpenAiClientOptions = (authResolver, auth) => {
8689
8691
  if (auth.method === "api_key") {
8690
8692
  return { apiKey: auth.api_key };
@@ -8699,6 +8701,12 @@ var buildOpenAiClientOptions = (authResolver, auth) => {
8699
8701
  const fetchWithAccount = Object.assign(
8700
8702
  async (input, init) => {
8701
8703
  const headers = new Headers(init?.headers ?? {});
8704
+ if (!headers.has("originator")) {
8705
+ headers.set("originator", OPENAI_OAUTH_ORIGINATOR);
8706
+ }
8707
+ if (!headers.has("User-Agent")) {
8708
+ headers.set("User-Agent", OPENAI_OAUTH_USER_AGENT);
8709
+ }
8702
8710
  if (accountId) {
8703
8711
  headers.set("ChatGPT-Account-Id", accountId);
8704
8712
  }
@@ -8722,7 +8730,10 @@ var buildOpenAiClientOptions = (authResolver, auth) => {
8722
8730
  },
8723
8731
  { preconnect: fetch.preconnect }
8724
8732
  );
8725
- const defaultHeaders = {};
8733
+ const defaultHeaders = {
8734
+ originator: OPENAI_OAUTH_ORIGINATOR,
8735
+ "User-Agent": OPENAI_OAUTH_USER_AGENT
8736
+ };
8726
8737
  if (accountId) {
8727
8738
  defaultHeaders["ChatGPT-Account-ID"] = accountId;
8728
8739
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codelia/runtime",
3
- "version": "0.1.58",
3
+ "version": "0.1.60",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20 <25"
@@ -23,14 +23,14 @@
23
23
  "typecheck": "tsc --noEmit"
24
24
  },
25
25
  "dependencies": {
26
- "@codelia/config": "0.1.58",
27
- "@codelia/config-loader": "0.1.58",
28
- "@codelia/core": "0.1.58",
29
- "@codelia/logger": "0.1.58",
30
- "@codelia/model-metadata": "0.1.58",
31
- "@codelia/protocol": "0.1.58",
32
- "@codelia/shared-types": "0.1.58",
33
- "@codelia/storage": "0.1.58",
26
+ "@codelia/config": "0.1.60",
27
+ "@codelia/config-loader": "0.1.60",
28
+ "@codelia/core": "0.1.60",
29
+ "@codelia/logger": "0.1.60",
30
+ "@codelia/model-metadata": "0.1.60",
31
+ "@codelia/protocol": "0.1.60",
32
+ "@codelia/shared-types": "0.1.60",
33
+ "@codelia/storage": "0.1.60",
34
34
  "eventsource-parser": "^3.0.6",
35
35
  "oauth4webapi": "^3.8.4",
36
36
  "zod": "^4.3.5"