@cortexkit/opencode-openai-auth 1.21.0 → 1.22.0

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 (42) hide show
  1. package/dist/bin.js +2 -2
  2. package/dist/{index-qx3zz6dw.js → index-0wh22s62.js} +1 -1
  3. package/dist/{index-zd0hham5.js → index-1k8a281v.js} +2 -2
  4. package/dist/{index-vhn0n16s.js → index-677jqrrt.js} +1 -1
  5. package/dist/{index-ewbggf3b.js → index-67twdyyz.js} +11 -11
  6. package/dist/{index-14m8qtpx.js → index-6afhs2jq.js} +2 -2
  7. package/dist/{index-1arphj0y.js → index-8bt81cys.js} +2 -2
  8. package/dist/index-9tg5xx9a.js +2 -0
  9. package/dist/{index-h41zc747.js → index-b3bgqy7r.js} +2 -2
  10. package/dist/index-dw1nh7dk.js +60 -0
  11. package/dist/{index-4vgtvqfc.js → index-mepr345k.js} +1 -1
  12. package/dist/index-ney54jhs.js +79 -0
  13. package/dist/{index-8kg9h2zj.js → index-vaf4mqd1.js} +2 -2
  14. package/dist/index-w6kars9d.js +1 -0
  15. package/dist/{index-4xa80px1.js → index-xbhtpa9s.js} +2 -2
  16. package/dist/index.d.ts +4 -25
  17. package/dist/index.js +1 -1
  18. package/dist/map-D5PHhv4z.d.ts +72 -0
  19. package/dist/rpc/port-file.js +1 -1
  20. package/dist/rpc/protocol.js +1 -1
  21. package/dist/rpc/rpc-client.js +1 -1
  22. package/dist/rpc/rpc-dir.js +1 -1
  23. package/dist/{codex-request-NjUd_A0U.d.ts → runtime-layout-DdxprfY1.d.ts} +664 -643
  24. package/dist/{sidebar-state-CrRiE9hw.d.ts → sidebar-state--OTpRzFd.d.ts} +2 -72
  25. package/dist/sidebar-state.d.ts +1 -1
  26. package/dist/sidebar-state.js +1 -1
  27. package/dist/{token-01hgthyy.js → token-92yc9q7w.js} +1 -1
  28. package/dist/token-util-g8e70a6j.js +1 -0
  29. package/dist/tui-preferences.js +1 -1
  30. package/dist/tui.d.ts +1 -1
  31. package/dist/v2/server.d.ts +10 -3
  32. package/dist/v2/server.js +4 -4
  33. package/package.json +1 -1
  34. package/src/tui-compiled/raw/logger.js +5 -22
  35. package/src/tui-compiled/raw/shared/d669d72c40e9e116-logger.js +30 -1
  36. package/src/tui-compiled/runtime/logger.js +5 -22
  37. package/src/tui-compiled/runtime/shared/d669d72c40e9e116-logger.js +30 -1
  38. package/dist/index-60v2qzqm.js +0 -75
  39. package/dist/index-cqmzvf2k.js +0 -1
  40. package/dist/index-ksfxd8p5.js +0 -64
  41. package/dist/index-rvphtptz.js +0 -2
  42. package/dist/token-util-29yt43da.js +0 -1
@@ -1,11 +1,11 @@
1
1
  import { tmpdir } from "node:os";
2
2
  import { join } from "node:path";
3
3
  import {
4
- flushLogs,
5
- initLogger,
6
- setLogLevel
4
+ parseLogLevel,
5
+ setupLogger
7
6
  } from "./shared/3c2d4169d00f907e-tui-support.js";
8
7
  export {
8
+ applySettingsLogLevel,
9
9
  createLogger,
10
10
  flushForTest,
11
11
  flushLogs,
@@ -13,27 +13,10 @@ export {
13
13
  redactStrings,
14
14
  setLogLevel
15
15
  } from "./shared/3c2d4169d00f907e-tui-support.js";
16
- const LEVELS = ["error", "warn", "info", "debug", "trace"];
17
16
  export function getLogFile() {
18
17
  return process.env.OPENCODE_OPENAI_AUTH_LOG_FILE ?? (process.platform === "win32" ? join(tmpdir(), "opencode-openai-auth", "opencode-openai-auth.log") : join(tmpdir(), "opencode-openai-auth.log"));
19
18
  }
20
19
  export function getEnvLogLevel() {
21
- const env = process.env.OPENCODE_OPENAI_AUTH_LOG_LEVEL;
22
- return env && LEVELS.includes(env) ? env : void 0;
23
- }
24
- export function applySettingsLogLevel(level, phase) {
25
- if (level !== "default")
26
- setLogLevel(level);
27
- else if (phase === "refresh")
28
- setLogLevel(void 0);
20
+ return parseLogLevel(process.env.OPENCODE_OPENAI_AUTH_LOG_LEVEL);
29
21
  }
30
- initLogger({ file: getLogFile, level: getEnvLogLevel });
31
- process.once("beforeExit", async () => {
32
- try {
33
- await flushLogs();
34
- } catch {
35
- process.emitWarning("OpenAI auth could not flush its log file at shutdown");
36
- }
37
- });
38
- if (process.platform !== "win32")
39
- process.on("exit", () => flushLogs());
22
+ setupLogger({ file: getLogFile, level: getEnvLogLevel });
@@ -1,6 +1,8 @@
1
1
  import {
2
2
  initLogger as commonInitLogger,
3
- createRedactor
3
+ createRedactor,
4
+ flushLogs,
5
+ setLogLevel
4
6
  } from "./cc9e0702a752cea7-index.js";
5
7
  export {
6
8
  createLogger,
@@ -17,3 +19,30 @@ export const { redact, redactStrings } = openaiRedactor;
17
19
  export function initLogger(options) {
18
20
  commonInitLogger({ ...options, extraSecretKeys: isOpenaiIdentityKey });
19
21
  }
22
+ const LEVELS = ["error", "warn", "info", "debug", "trace"];
23
+ export function parseLogLevel(value) {
24
+ const level = value;
25
+ return level && LEVELS.includes(level) ? level : void 0;
26
+ }
27
+ export function applySettingsLogLevel(level, phase) {
28
+ if (level !== "default")
29
+ setLogLevel(level);
30
+ else if (phase === "refresh")
31
+ setLogLevel(void 0);
32
+ }
33
+ let shutdownHookInstalled = !1;
34
+ export function setupLogger(options) {
35
+ initLogger(options);
36
+ if (shutdownHookInstalled)
37
+ return;
38
+ shutdownHookInstalled = !0;
39
+ process.once("beforeExit", async () => {
40
+ try {
41
+ await flushLogs();
42
+ } catch {
43
+ process.emitWarning("OpenAI auth could not flush its log file at shutdown");
44
+ }
45
+ });
46
+ if (process.platform !== "win32")
47
+ process.on("exit", () => flushLogs());
48
+ }
@@ -1,11 +1,11 @@
1
1
  import { tmpdir } from "node:os";
2
2
  import { join } from "node:path";
3
3
  import {
4
- flushLogs,
5
- initLogger,
6
- setLogLevel
4
+ parseLogLevel,
5
+ setupLogger
7
6
  } from "./shared/3c2d4169d00f907e-tui-support.js";
8
7
  export {
8
+ applySettingsLogLevel,
9
9
  createLogger,
10
10
  flushForTest,
11
11
  flushLogs,
@@ -13,27 +13,10 @@ export {
13
13
  redactStrings,
14
14
  setLogLevel
15
15
  } from "./shared/3c2d4169d00f907e-tui-support.js";
16
- const LEVELS = ["error", "warn", "info", "debug", "trace"];
17
16
  export function getLogFile() {
18
17
  return process.env.OPENCODE_OPENAI_AUTH_LOG_FILE ?? (process.platform === "win32" ? join(tmpdir(), "opencode-openai-auth", "opencode-openai-auth.log") : join(tmpdir(), "opencode-openai-auth.log"));
19
18
  }
20
19
  export function getEnvLogLevel() {
21
- const env = process.env.OPENCODE_OPENAI_AUTH_LOG_LEVEL;
22
- return env && LEVELS.includes(env) ? env : void 0;
23
- }
24
- export function applySettingsLogLevel(level, phase) {
25
- if (level !== "default")
26
- setLogLevel(level);
27
- else if (phase === "refresh")
28
- setLogLevel(void 0);
20
+ return parseLogLevel(process.env.OPENCODE_OPENAI_AUTH_LOG_LEVEL);
29
21
  }
30
- initLogger({ file: getLogFile, level: getEnvLogLevel });
31
- process.once("beforeExit", async () => {
32
- try {
33
- await flushLogs();
34
- } catch {
35
- process.emitWarning("OpenAI auth could not flush its log file at shutdown");
36
- }
37
- });
38
- if (process.platform !== "win32")
39
- process.on("exit", () => flushLogs());
22
+ setupLogger({ file: getLogFile, level: getEnvLogLevel });
@@ -1,6 +1,8 @@
1
1
  import {
2
2
  initLogger as commonInitLogger,
3
- createRedactor
3
+ createRedactor,
4
+ flushLogs,
5
+ setLogLevel
4
6
  } from "./cc9e0702a752cea7-index.js";
5
7
  export {
6
8
  createLogger,
@@ -17,3 +19,30 @@ export const { redact, redactStrings } = openaiRedactor;
17
19
  export function initLogger(options) {
18
20
  commonInitLogger({ ...options, extraSecretKeys: isOpenaiIdentityKey });
19
21
  }
22
+ const LEVELS = ["error", "warn", "info", "debug", "trace"];
23
+ export function parseLogLevel(value) {
24
+ const level = value;
25
+ return level && LEVELS.includes(level) ? level : void 0;
26
+ }
27
+ export function applySettingsLogLevel(level, phase) {
28
+ if (level !== "default")
29
+ setLogLevel(level);
30
+ else if (phase === "refresh")
31
+ setLogLevel(void 0);
32
+ }
33
+ let shutdownHookInstalled = !1;
34
+ export function setupLogger(options) {
35
+ initLogger(options);
36
+ if (shutdownHookInstalled)
37
+ return;
38
+ shutdownHookInstalled = !0;
39
+ process.once("beforeExit", async () => {
40
+ try {
41
+ await flushLogs();
42
+ } catch {
43
+ process.emitWarning("OpenAI auth could not flush its log file at shutdown");
44
+ }
45
+ });
46
+ if (process.platform !== "win32")
47
+ process.on("exit", () => flushLogs());
48
+ }