@cortexkit/opencode-openai-auth 1.20.3 → 1.21.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 (41) hide show
  1. package/dist/bin.js +2 -2
  2. package/dist/{codex-request-D0oxrTkl.d.ts → codex-request-NjUd_A0U.d.ts} +0 -2
  3. package/dist/{index-t66h86ed.js → index-14m8qtpx.js} +2 -2
  4. package/dist/{index-gxa94644.js → index-1arphj0y.js} +2 -2
  5. package/dist/{index-qtaqp1bf.js → index-4vgtvqfc.js} +1 -1
  6. package/dist/{index-ahbghz6c.js → index-4xa80px1.js} +2 -2
  7. package/dist/index-60v2qzqm.js +75 -0
  8. package/dist/{index-eb631m0m.js → index-8kg9h2zj.js} +2 -2
  9. package/dist/{index-66eejhpe.js → index-cqmzvf2k.js} +1 -1
  10. package/dist/{index-kakqxnt5.js → index-ewbggf3b.js} +11 -11
  11. package/dist/{index-tn1ve0gx.js → index-h41zc747.js} +2 -2
  12. package/dist/index-ksfxd8p5.js +64 -0
  13. package/dist/{index-dsytdx0r.js → index-qx3zz6dw.js} +1 -1
  14. package/dist/{index-t15pb3n2.js → index-rvphtptz.js} +1 -1
  15. package/dist/{index-6a1t612m.js → index-vhn0n16s.js} +1 -1
  16. package/dist/{index-8ap9gr0h.js → index-zd0hham5.js} +2 -2
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/openai-auth.schema.json +22 -0
  20. package/dist/rpc/port-file.js +1 -1
  21. package/dist/rpc/protocol.js +1 -1
  22. package/dist/rpc/rpc-client.js +1 -1
  23. package/dist/rpc/rpc-dir.js +1 -1
  24. package/dist/sidebar-state.js +1 -1
  25. package/dist/{token-y8xp4cbz.js → token-01hgthyy.js} +1 -1
  26. package/dist/token-util-29yt43da.js +1 -0
  27. package/dist/tui-preferences.js +1 -1
  28. package/dist/v2/server.d.ts +1 -1
  29. package/dist/v2/server.js +3 -3
  30. package/package.json +4 -4
  31. package/src/tui-compiled/raw/shared/29d709188b920a92-client-options.js +18 -0
  32. package/src/tui-compiled/raw/shared/b9588ad4725c1d10-enrollment.js +2 -1
  33. package/src/tui-compiled/raw/shared/d0f0b6be200311af-insula.js +4 -5
  34. package/src/tui-compiled/raw/shared/e8d3c8da776ef9cd-index.js +3 -2
  35. package/src/tui-compiled/runtime/shared/29d709188b920a92-client-options.js +18 -0
  36. package/src/tui-compiled/runtime/shared/b9588ad4725c1d10-enrollment.js +2 -1
  37. package/src/tui-compiled/runtime/shared/d0f0b6be200311af-insula.js +4 -5
  38. package/src/tui-compiled/runtime/shared/e8d3c8da776ef9cd-index.js +3 -2
  39. package/dist/index-a7eep73q.js +0 -64
  40. package/dist/index-vjb3rsqh.js +0 -75
  41. package/dist/token-util-qgycqbjw.js +0 -1
@@ -6,6 +6,7 @@ import { ClaustrumCredentialError, ClaustrumClient as ClaustrumWireClient, write
6
6
  import { FileReadCache } from "./92e38944b51b2405-file-read-cache.js";
7
7
  import { acquireRefreshFileLock } from "./ec971142548df90e-index.js";
8
8
  import { ensurePrivateDirectory as ensureWindowsDirectory, PrivateFileError, readPrivateText, verifySafeDirectory, windowsPrivateFiles, writePrivateAtomic, } from "./375d9cca2def037d-private-files.js";
9
+ import { claustrumWireOptions, } from "./29d709188b920a92-client-options.js";
9
10
  import { ClaustrumConsumerError } from "./ca0fccaba1d87af4-errors.js";
10
11
  import { hasVaultHost } from "./c97089ed4243981c-host.js";
11
12
  const ENROLLMENT_SCHEMA = 1;
@@ -110,7 +111,7 @@ function grantProposal(state) {
110
111
  * environment and knows no host paths.
111
112
  */
112
113
  export function connectClaustrumEnrollmentClient(options) {
113
- return ClaustrumWireClient.connect(options);
114
+ return ClaustrumWireClient.connect(claustrumWireOptions(options));
114
115
  }
115
116
  /** The ceremony state file sits next to the token: `x.json` pairs with `x-state.json`. */
116
117
  export function getClaustrumEnrollmentPaths(tokenPath) {
@@ -1,16 +1,15 @@
1
1
  import { resolve } from "node:path";
2
- import { storeIdentity } from "@cortexkit/claustrum-client";
3
2
  // A static import: claustrum-client already loads subc-client whenever
4
3
  // /claustrum is imported, so loading it lazily saves nothing, and a dynamic
5
4
  // import makes bundlers emit a separate chunk that a running host loses when
6
5
  // its dist folder is rebuilt underneath it.
7
6
  import { SubcClient } from "@cortexkit/subc-client";
8
7
  import { classifyVaultFailure } from "./94f53cfd572ba4bb-availability.js";
8
+ import { defaultStoreIdentity, } from "./29d709188b920a92-client-options.js";
9
9
  import { ChangeNoticeReader, CoalescedRead, RESUBSCRIBE_BACKOFF_MS, WATCH_RETRY_MS, } from "./dc9290c2a7552ba6-watch.js";
10
10
  /** Constructing this transport opens no connection; getUsage opens one per call. */
11
11
  export function insulaUsageTransport(options) {
12
- const identity = options.identity ??
13
- storeIdentity(options.projectRoot ?? process.cwd(), options.storagePath ?? process.cwd());
12
+ const identity = options.identity ?? defaultStoreIdentity(options);
14
13
  return {
15
14
  connectionFile: options.connectionFile,
16
15
  async getUsage() {
@@ -55,8 +54,8 @@ export function insulaUsageTransport(options) {
55
54
  // The watch holds its own connection for as long as it is open: each
56
55
  // usage.get above opens and closes a short-lived one, and the scoped
57
56
  // credential connection is never shared with insula. The method name
58
- // alone makes the request a watch; subc-client does not yet set the
59
- // SUBSCRIPTION flag, and insula does not require it.
57
+ // alone makes the request a watch, even on older subc-client versions
58
+ // that do not set the SUBSCRIPTION flag.
60
59
  let client;
61
60
  let subscription;
62
61
  let stopped = false;
@@ -3,8 +3,9 @@
3
3
  // package's `/routing` subpath, per-send authorization, 401 reporting, the
4
4
  // declined-account interlock and the host-slot guard. Needs the optional
5
5
  // peer `@cortexkit/claustrum-client`.
6
- import { ClaustrumClient, } from "@cortexkit/claustrum-client";
6
+ import { ClaustrumClient } from "@cortexkit/claustrum-client";
7
7
  import { ClaustrumUnreachableError } from "./94f53cfd572ba4bb-availability.js";
8
+ import { claustrumWireOptions, } from "./29d709188b920a92-client-options.js";
8
9
  import { insulaUsageTransport } from "./d0f0b6be200311af-insula.js";
9
10
  export { ClaustrumCredentialError, } from "@cortexkit/claustrum-client";
10
11
  export { ClaustrumUnreachableError, classifyVaultFailure, VAULT_FAILURE_CLASSES, } from "./94f53cfd572ba4bb-availability.js";
@@ -36,7 +37,7 @@ export const SCOPED_CONNECT_TIMEOUT_MS = 10_000;
36
37
  export async function connectClaustrumScopedClient(options) {
37
38
  const { connectTimeoutMs, ...client } = options;
38
39
  const limit = connectTimeoutMs ?? SCOPED_CONNECT_TIMEOUT_MS;
39
- const connecting = ClaustrumClient.connect(client);
40
+ const connecting = ClaustrumClient.connect(claustrumWireOptions(client));
40
41
  let expired = false;
41
42
  let timer;
42
43
  const deadline = new Promise((_resolve, reject) => {
@@ -0,0 +1,18 @@
1
+ import { storeIdentity, } from "@cortexkit/claustrum-client";
2
+ // Older clients need a project root to construct the identity. Claustrum's
3
+ // vault daemon does not use the root after validation, so newer clients omit
4
+ // it to avoid a refused route when the daemon cannot resolve the path.
5
+ const needsProjectRoot = storeIdentity.length !== 1;
6
+ const compatibleStoreIdentity = storeIdentity;
7
+ export function defaultStoreIdentity(options) {
8
+ const storagePath = options.storagePath ?? process.cwd();
9
+ return needsProjectRoot
10
+ ? compatibleStoreIdentity(options.projectRoot ?? process.cwd(), storagePath)
11
+ : compatibleStoreIdentity(storagePath);
12
+ }
13
+ export function claustrumWireOptions(options) {
14
+ if (needsProjectRoot)
15
+ return options;
16
+ const { projectRoot: _projectRoot, ...wireOptions } = options;
17
+ return wireOptions;
18
+ }
@@ -6,6 +6,7 @@ import { ClaustrumCredentialError, ClaustrumClient as ClaustrumWireClient, write
6
6
  import { FileReadCache } from "./92e38944b51b2405-file-read-cache.js";
7
7
  import { acquireRefreshFileLock } from "./ec971142548df90e-index.js";
8
8
  import { ensurePrivateDirectory as ensureWindowsDirectory, PrivateFileError, readPrivateText, verifySafeDirectory, windowsPrivateFiles, writePrivateAtomic, } from "./375d9cca2def037d-private-files.js";
9
+ import { claustrumWireOptions, } from "./29d709188b920a92-client-options.js";
9
10
  import { ClaustrumConsumerError } from "./ca0fccaba1d87af4-errors.js";
10
11
  import { hasVaultHost } from "./c97089ed4243981c-host.js";
11
12
  const ENROLLMENT_SCHEMA = 1;
@@ -110,7 +111,7 @@ function grantProposal(state) {
110
111
  * environment and knows no host paths.
111
112
  */
112
113
  export function connectClaustrumEnrollmentClient(options) {
113
- return ClaustrumWireClient.connect(options);
114
+ return ClaustrumWireClient.connect(claustrumWireOptions(options));
114
115
  }
115
116
  /** The ceremony state file sits next to the token: `x.json` pairs with `x-state.json`. */
116
117
  export function getClaustrumEnrollmentPaths(tokenPath) {
@@ -1,16 +1,15 @@
1
1
  import { resolve } from "node:path";
2
- import { storeIdentity } from "@cortexkit/claustrum-client";
3
2
  // A static import: claustrum-client already loads subc-client whenever
4
3
  // /claustrum is imported, so loading it lazily saves nothing, and a dynamic
5
4
  // import makes bundlers emit a separate chunk that a running host loses when
6
5
  // its dist folder is rebuilt underneath it.
7
6
  import { SubcClient } from "@cortexkit/subc-client";
8
7
  import { classifyVaultFailure } from "./94f53cfd572ba4bb-availability.js";
8
+ import { defaultStoreIdentity, } from "./29d709188b920a92-client-options.js";
9
9
  import { ChangeNoticeReader, CoalescedRead, RESUBSCRIBE_BACKOFF_MS, WATCH_RETRY_MS, } from "./dc9290c2a7552ba6-watch.js";
10
10
  /** Constructing this transport opens no connection; getUsage opens one per call. */
11
11
  export function insulaUsageTransport(options) {
12
- const identity = options.identity ??
13
- storeIdentity(options.projectRoot ?? process.cwd(), options.storagePath ?? process.cwd());
12
+ const identity = options.identity ?? defaultStoreIdentity(options);
14
13
  return {
15
14
  connectionFile: options.connectionFile,
16
15
  async getUsage() {
@@ -55,8 +54,8 @@ export function insulaUsageTransport(options) {
55
54
  // The watch holds its own connection for as long as it is open: each
56
55
  // usage.get above opens and closes a short-lived one, and the scoped
57
56
  // credential connection is never shared with insula. The method name
58
- // alone makes the request a watch; subc-client does not yet set the
59
- // SUBSCRIPTION flag, and insula does not require it.
57
+ // alone makes the request a watch, even on older subc-client versions
58
+ // that do not set the SUBSCRIPTION flag.
60
59
  let client;
61
60
  let subscription;
62
61
  let stopped = false;
@@ -3,8 +3,9 @@
3
3
  // package's `/routing` subpath, per-send authorization, 401 reporting, the
4
4
  // declined-account interlock and the host-slot guard. Needs the optional
5
5
  // peer `@cortexkit/claustrum-client`.
6
- import { ClaustrumClient, } from "@cortexkit/claustrum-client";
6
+ import { ClaustrumClient } from "@cortexkit/claustrum-client";
7
7
  import { ClaustrumUnreachableError } from "./94f53cfd572ba4bb-availability.js";
8
+ import { claustrumWireOptions, } from "./29d709188b920a92-client-options.js";
8
9
  import { insulaUsageTransport } from "./d0f0b6be200311af-insula.js";
9
10
  export { ClaustrumCredentialError, } from "@cortexkit/claustrum-client";
10
11
  export { ClaustrumUnreachableError, classifyVaultFailure, VAULT_FAILURE_CLASSES, } from "./94f53cfd572ba4bb-availability.js";
@@ -36,7 +37,7 @@ export const SCOPED_CONNECT_TIMEOUT_MS = 10_000;
36
37
  export async function connectClaustrumScopedClient(options) {
37
38
  const { connectTimeoutMs, ...client } = options;
38
39
  const limit = connectTimeoutMs ?? SCOPED_CONNECT_TIMEOUT_MS;
39
- const connecting = ClaustrumClient.connect(client);
40
+ const connecting = ClaustrumClient.connect(claustrumWireOptions(client));
40
41
  let expired = false;
41
42
  let timer;
42
43
  const deadline = new Promise((_resolve, reject) => {