@cortexkit/opencode-antigravity-auth 3.0.36 → 3.0.38

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 (83) hide show
  1. package/dist/cli.js +12 -2
  2. package/dist/cli.js.map +2 -2
  3. package/dist/cli.meta.json +17 -17
  4. package/dist/index.js +20 -9
  5. package/dist/index.js.map +2 -2
  6. package/dist/index.meta.json +36 -20
  7. package/dist/server.js +243 -104
  8. package/dist/server.js.map +4 -4
  9. package/dist/server.meta.json +1 -1
  10. package/dist/src/auth-method-labels.d.ts +2 -0
  11. package/dist/src/auth-method-labels.d.ts.map +1 -1
  12. package/dist/src/auth-method-labels.js +2 -0
  13. package/dist/src/auth-method-labels.js.map +1 -1
  14. package/dist/src/common-auth-embedded/claustrum/availability.d.ts +1 -0
  15. package/dist/src/common-auth-embedded/claustrum/availability.js +2 -0
  16. package/dist/src/common-auth-embedded/claustrum/index.d.ts +1 -1
  17. package/dist/src/common-auth-embedded/claustrum/index.js +1 -1
  18. package/dist/src/common-auth-embedded/routing-accessor/cache-policy.d.ts +51 -0
  19. package/dist/src/common-auth-embedded/routing-accessor/cache-policy.js +186 -0
  20. package/dist/src/common-auth-embedded/routing-accessor/index.d.ts +2 -1
  21. package/dist/src/common-auth-embedded/routing-accessor/index.js +1 -0
  22. package/dist/src/common-auth-embedded/source-output.json +41 -25
  23. package/dist/src/ga/server/auth.js +2 -2
  24. package/dist/src/ga/server/auth.js.map +1 -1
  25. package/dist/src/ga/server/index.js +1 -1
  26. package/dist/src/ga/server/index.js.map +1 -1
  27. package/dist/src/ga/server/pool-login.d.ts +9 -0
  28. package/dist/src/ga/server/pool-login.d.ts.map +1 -1
  29. package/dist/src/ga/server/pool-login.js +155 -73
  30. package/dist/src/ga/server/pool-login.js.map +1 -1
  31. package/dist/src/ga/tui/host-ga.d.ts +7 -0
  32. package/dist/src/ga/tui/host-ga.d.ts.map +1 -1
  33. package/dist/src/ga/tui/host-ga.js +70 -1
  34. package/dist/src/ga/tui/host-ga.js.map +1 -1
  35. package/dist/src/logging/provider-key-policy.d.ts +2 -0
  36. package/dist/src/logging/provider-key-policy.d.ts.map +1 -1
  37. package/dist/src/logging/provider-key-policy.js +5 -1
  38. package/dist/src/logging/provider-key-policy.js.map +1 -1
  39. package/dist/src/plugin/__fixtures__/verified-store.js +2 -2
  40. package/dist/src/plugin/ga-location-services.d.ts.map +1 -1
  41. package/dist/src/plugin/ga-location-services.js +77 -12
  42. package/dist/src/plugin/ga-location-services.js.map +1 -1
  43. package/dist/src/plugin/logger.d.ts.map +1 -1
  44. package/dist/src/plugin/logger.js +2 -1
  45. package/dist/src/plugin/logger.js.map +1 -1
  46. package/dist/src/plugin/vault-custody.js +6 -6
  47. package/dist/src/plugin/vault-custody.js.map +1 -1
  48. package/dist/src/setup.js +1 -1
  49. package/dist/src/setup.js.map +1 -1
  50. package/dist/src/tui/file-logger.d.ts.map +1 -1
  51. package/dist/src/tui/file-logger.js +2 -1
  52. package/dist/src/tui/file-logger.js.map +1 -1
  53. package/dist/tui-build-map.json +9 -9
  54. package/dist/tui-ga-build-map.json +5 -5
  55. package/dist/types/src/auth-method-labels.d.ts +2 -0
  56. package/dist/types/src/auth-method-labels.d.ts.map +1 -1
  57. package/dist/types/src/common-auth-embedded/claustrum/availability.d.ts +1 -0
  58. package/dist/types/src/common-auth-embedded/claustrum/index.d.ts +1 -1
  59. package/dist/types/src/common-auth-embedded/routing-accessor/cache-policy.d.ts +51 -0
  60. package/dist/types/src/common-auth-embedded/routing-accessor/index.d.ts +2 -1
  61. package/dist/types/src/ga/server/pool-login.d.ts +9 -0
  62. package/dist/types/src/ga/server/pool-login.d.ts.map +1 -1
  63. package/dist/types/src/logging/provider-key-policy.d.ts +2 -0
  64. package/dist/types/src/logging/provider-key-policy.d.ts.map +1 -1
  65. package/dist/types/src/plugin/ga-location-services.d.ts.map +1 -1
  66. package/dist/types/src/plugin/logger.d.ts.map +1 -1
  67. package/package.json +4 -4
  68. package/src/common-auth-embedded/claustrum/availability.d.ts +1 -0
  69. package/src/common-auth-embedded/claustrum/availability.js +2 -0
  70. package/src/common-auth-embedded/claustrum/index.d.ts +1 -1
  71. package/src/common-auth-embedded/claustrum/index.js +1 -1
  72. package/src/common-auth-embedded/routing-accessor/cache-policy.d.ts +51 -0
  73. package/src/common-auth-embedded/routing-accessor/cache-policy.js +186 -0
  74. package/src/common-auth-embedded/routing-accessor/index.d.ts +2 -1
  75. package/src/common-auth-embedded/routing-accessor/index.js +1 -0
  76. package/src/common-auth-embedded/source-output.json +41 -25
  77. package/src/tui/file-logger.ts +5 -1
  78. package/src/tui-compiled/logging/provider-key-policy.js +4 -1
  79. package/src/tui-compiled/tui/file-logger.js +5 -1
  80. package/src/tui-ga-compiled/host-ga.js +66 -1
  81. package/src/tui-ga-raw/host-ga.tsx +79 -1
  82. package/src/tui-raw/logging/provider-key-policy.js +4 -1
  83. package/src/tui-raw/tui/file-logger.js +5 -1
@@ -567,7 +567,7 @@
567
567
  "format": "esm"
568
568
  },
569
569
  "../core/dist/antigravity-command-menu.js": {
570
- "bytes": 20684,
570
+ "bytes": 20788,
571
571
  "imports": [
572
572
  {
573
573
  "path": "node:crypto",
@@ -1596,7 +1596,7 @@
1596
1596
  "format": "esm"
1597
1597
  },
1598
1598
  "../core/dist/common-auth-embedded/claustrum/availability.js": {
1599
- "bytes": 4107,
1599
+ "bytes": 4219,
1600
1600
  "imports": [
1601
1601
  {
1602
1602
  "path": "@cortexkit/claustrum-client",
@@ -2243,7 +2243,7 @@
2243
2243
  "format": "esm"
2244
2244
  },
2245
2245
  "../core/dist/common-auth-embedded/claustrum/index.js": {
2246
- "bytes": 4048,
2246
+ "bytes": 4062,
2247
2247
  "imports": [
2248
2248
  {
2249
2249
  "path": "@cortexkit/claustrum-client",
@@ -3040,7 +3040,7 @@
3040
3040
  "format": "esm"
3041
3041
  },
3042
3042
  "src/logging/provider-key-policy.ts": {
3043
- "bytes": 604,
3043
+ "bytes": 849,
3044
3044
  "imports": [],
3045
3045
  "format": "esm"
3046
3046
  },
@@ -3061,7 +3061,7 @@
3061
3061
  "format": "esm"
3062
3062
  },
3063
3063
  "src/plugin/vault-custody.ts": {
3064
- "bytes": 44009,
3064
+ "bytes": 43899,
3065
3065
  "imports": [
3066
3066
  {
3067
3067
  "path": "node:fs/promises",
@@ -3400,7 +3400,7 @@
3400
3400
  "format": "esm"
3401
3401
  },
3402
3402
  "src/plugin/logger.ts": {
3403
- "bytes": 8622,
3403
+ "bytes": 8713,
3404
3404
  "imports": [
3405
3405
  {
3406
3406
  "path": "../core/dist/index.js",
@@ -3727,7 +3727,7 @@
3727
3727
  "format": "esm"
3728
3728
  },
3729
3729
  "src/auth-method-labels.ts": {
3730
- "bytes": 404,
3730
+ "bytes": 601,
3731
3731
  "imports": [],
3732
3732
  "format": "esm"
3733
3733
  },
@@ -3893,7 +3893,7 @@
3893
3893
  "format": "esm"
3894
3894
  },
3895
3895
  "src/common-auth-embedded/claustrum/availability.js": {
3896
- "bytes": 4107,
3896
+ "bytes": 4219,
3897
3897
  "imports": [
3898
3898
  {
3899
3899
  "path": "@cortexkit/claustrum-client",
@@ -4348,7 +4348,7 @@
4348
4348
  "format": "esm"
4349
4349
  },
4350
4350
  "src/setup.ts": {
4351
- "bytes": 19893,
4351
+ "bytes": 19870,
4352
4352
  "imports": [
4353
4353
  {
4354
4354
  "path": "node:fs/promises",
@@ -4510,7 +4510,7 @@
4510
4510
  "imports": [],
4511
4511
  "exports": [],
4512
4512
  "inputs": {},
4513
- "bytes": 3256110
4513
+ "bytes": 3257101
4514
4514
  },
4515
4515
  "dist/cli.js": {
4516
4516
  "imports": [
@@ -5539,7 +5539,7 @@
5539
5539
  "bytesInOutput": 352
5540
5540
  },
5541
5541
  "../core/dist/common-auth-embedded/claustrum/availability.js": {
5542
- "bytesInOutput": 3685
5542
+ "bytesInOutput": 3801
5543
5543
  },
5544
5544
  "../core/dist/common-auth-embedded/claustrum/host.js": {
5545
5545
  "bytesInOutput": 3651
@@ -5617,7 +5617,7 @@
5617
5617
  "bytesInOutput": 39004
5618
5618
  },
5619
5619
  "../core/dist/common-auth-embedded/claustrum/index.js": {
5620
- "bytesInOutput": 4880
5620
+ "bytesInOutput": 4916
5621
5621
  },
5622
5622
  "../core/dist/common-auth-embedded/pi-slot/lock.js": {
5623
5623
  "bytesInOutput": 5133
@@ -5707,7 +5707,7 @@
5707
5707
  "bytesInOutput": 168
5708
5708
  },
5709
5709
  "src/logging/provider-key-policy.ts": {
5710
- "bytesInOutput": 305
5710
+ "bytesInOutput": 485
5711
5711
  },
5712
5712
  "src/plugin/shared/vault-request-credentials.ts": {
5713
5713
  "bytesInOutput": 143
@@ -5743,7 +5743,7 @@
5743
5743
  "bytesInOutput": 14132
5744
5744
  },
5745
5745
  "src/plugin/logger.ts": {
5746
- "bytesInOutput": 3416
5746
+ "bytesInOutput": 3471
5747
5747
  },
5748
5748
  "src/cli.ts": {
5749
5749
  "bytesInOutput": 24028
@@ -5788,7 +5788,7 @@
5788
5788
  "bytesInOutput": 8446
5789
5789
  },
5790
5790
  "src/setup.ts": {
5791
- "bytesInOutput": 15276
5791
+ "bytesInOutput": 15253
5792
5792
  },
5793
5793
  "src/auth-method-labels.ts": {
5794
5794
  "bytesInOutput": 218
@@ -5830,7 +5830,7 @@
5830
5830
  "bytesInOutput": 315
5831
5831
  },
5832
5832
  "src/common-auth-embedded/claustrum/availability.js": {
5833
- "bytesInOutput": 2560
5833
+ "bytesInOutput": 2668
5834
5834
  },
5835
5835
  "src/common-auth-embedded/setup/command-error.js": {
5836
5836
  "bytesInOutput": 1744
@@ -5872,7 +5872,7 @@
5872
5872
  "bytesInOutput": 292
5873
5873
  }
5874
5874
  },
5875
- "bytes": 1224851
5875
+ "bytes": 1225323
5876
5876
  }
5877
5877
  }
5878
5878
  }
package/dist/index.js CHANGED
@@ -12137,7 +12137,8 @@ function accountsSection(options, ids, now) {
12137
12137
  {
12138
12138
  id: "add",
12139
12139
  label: options.login.label ?? "Add account",
12140
- run: ({ invocation }) => options.login ? options.login.run(invocation) : Promise.resolve(failure("Login is unavailable.", "refused"))
12140
+ ...options.login.knobs ? { knobs: options.login.knobs } : {},
12141
+ run: ({ invocation, values }) => options.login ? options.login.run(invocation, values) : Promise.resolve(failure("Login is unavailable.", "refused"))
12141
12142
  }
12142
12143
  ] : [];
12143
12144
  if (read.status !== "ready")
@@ -19494,6 +19495,8 @@ var init_availability = __esm({
19494
19495
  unavailable: "unreachable",
19495
19496
  timeout: "unreachable",
19496
19497
  route_closed: "unreachable",
19498
+ // The daemon refused before forwarding, so the vault never saw the request.
19499
+ route_busy: "unreachable",
19497
19500
  daemon_draining: "unreachable",
19498
19501
  connection_closed: "unreachable",
19499
19502
  connection_dropped: "unreachable",
@@ -25659,6 +25662,7 @@ __export(claustrum_exports, {
25659
25662
  enrollmentAuthority: () => enrollmentAuthority,
25660
25663
  enrollmentName: () => enrollmentName,
25661
25664
  getClaustrumEnrollmentPaths: () => getClaustrumEnrollmentPaths,
25665
+ hasVaultHost: () => hasVaultHost,
25662
25666
  hostEnrollmentPaths: () => hostEnrollmentPaths,
25663
25667
  isCustodyPlaceholder: () => isCustodyPlaceholder,
25664
25668
  isCustodyPlaceholderValue: () => isCustodyPlaceholderValue,
@@ -30226,13 +30230,17 @@ var init_logger3 = __esm({
30226
30230
 
30227
30231
  // src/logging/provider-key-policy.ts
30228
30232
  function isProviderSecretKey(normalizedKey2) {
30229
- return /token|refresh|access|project|fingerprint|deviceid|sessionid|sessiontoken|secret|password|apikey|clientsecret/.test(
30233
+ return /token|refresh|access|project|fingerprint|deviceid|sessionid|sessiontoken|secret|password|apikey|clientsecret|callback|redirecturl|authorizationcode/.test(
30230
30234
  normalizedKey2
30231
30235
  );
30232
30236
  }
30237
+ var OAUTH_REDIRECT_VALUE_PATTERNS;
30233
30238
  var init_provider_key_policy = __esm({
30234
30239
  "src/logging/provider-key-policy.ts"() {
30235
30240
  "use strict";
30241
+ OAUTH_REDIRECT_VALUE_PATTERNS = [
30242
+ /https?:\/\/[^\s<>"']*[?&](?:code|state)=[^\s<>"']*/gi
30243
+ ];
30236
30244
  }
30237
30245
  });
30238
30246
 
@@ -30873,7 +30881,7 @@ function createOpenCodeVaultCustody(options) {
30873
30881
  const readEnrollment = async () => {
30874
30882
  if (layoutRefusal !== void 0) return unsettled;
30875
30883
  const claustrum = await loadClaustrum();
30876
- if (process.env.CORTEXKIT_VAULT_HOST === "thalamus")
30884
+ if (claustrum.hasVaultHost())
30877
30885
  return {
30878
30886
  state: "unavailable",
30879
30887
  code: "host",
@@ -30901,7 +30909,7 @@ function createOpenCodeVaultCustody(options) {
30901
30909
  const readEnrollmentSnapshot = async () => {
30902
30910
  if (layoutRefusal !== void 0)
30903
30911
  return { authority: "unreadable", status: unsettled };
30904
- if (process.env.CORTEXKIT_VAULT_HOST === "thalamus")
30912
+ if ((await loadClaustrum()).hasVaultHost())
30905
30913
  return { authority: "host", status: await readEnrollment() };
30906
30914
  const enrollment = await enrollmentPaths();
30907
30915
  const identity3 = await enrollmentFilesIdentity(enrollment);
@@ -31148,7 +31156,7 @@ function createOpenCodeVaultCustody(options) {
31148
31156
  },
31149
31157
  async requestAccess() {
31150
31158
  const claustrum = await loadClaustrum();
31151
- if (process.env.CORTEXKIT_VAULT_HOST === "thalamus")
31159
+ if (claustrum.hasVaultHost())
31152
31160
  throw new OpenCodeVaultCustodyError(
31153
31161
  claustrum.VAULT_HOST_CONNECT_REFUSAL
31154
31162
  );
@@ -31156,7 +31164,7 @@ function createOpenCodeVaultCustody(options) {
31156
31164
  },
31157
31165
  async useVault() {
31158
31166
  refuseUnsettled();
31159
- if (process.env.CORTEXKIT_VAULT_HOST === "thalamus") return;
31167
+ if ((await loadClaustrum()).hasVaultHost()) return;
31160
31168
  const enrollment = await readEnrollment();
31161
31169
  if (enrollment.state !== "approved")
31162
31170
  throw new OpenCodeVaultCustodyError(
@@ -31168,7 +31176,7 @@ function createOpenCodeVaultCustody(options) {
31168
31176
  async useLocal() {
31169
31177
  refuseUnsettled();
31170
31178
  const claustrum = await loadClaustrum();
31171
- if (process.env.CORTEXKIT_VAULT_HOST === "thalamus")
31179
+ if (claustrum.hasVaultHost())
31172
31180
  throw new OpenCodeVaultCustodyError(
31173
31181
  claustrum.VAULT_HOST_CONNECT_REFUSAL
31174
31182
  );
@@ -31203,7 +31211,7 @@ function createOpenCodeVaultCustody(options) {
31203
31211
  if (layoutRefusal !== void 0)
31204
31212
  return { lines: [`Vault: ${layoutRefusal}`], actions: [] };
31205
31213
  const claustrum = await loadClaustrum();
31206
- if (process.env.CORTEXKIT_VAULT_HOST === "thalamus")
31214
+ if (claustrum.hasVaultHost())
31207
31215
  return { lines: [claustrum.VAULT_HOST_STATUS], actions: [] };
31208
31216
  const status = await custody.status();
31209
31217
  const lines = statusLines(status);
@@ -34566,6 +34574,7 @@ function createLocationLogger(options) {
34566
34574
  const engine = createLoggerInstance2({
34567
34575
  level: () => configuredLevel,
34568
34576
  extraSecretKeys: isProviderSecretKey,
34577
+ extraValuePatterns: OAUTH_REDIRECT_VALUE_PATTERNS,
34569
34578
  captureSink: ({ channel: channel3, level, message, data }) => {
34570
34579
  const extra = data !== null && typeof data === "object" && !Array.isArray(data) ? Object.fromEntries(Object.entries(data)) : void 0;
34571
34580
  emit({
@@ -38204,6 +38213,8 @@ var VAULT_FAILURE_CLASSES2 = Object.freeze({
38204
38213
  unavailable: "unreachable",
38205
38214
  timeout: "unreachable",
38206
38215
  route_closed: "unreachable",
38216
+ // The daemon refused before forwarding, so the vault never saw the request.
38217
+ route_busy: "unreachable",
38207
38218
  daemon_draining: "unreachable",
38208
38219
  connection_closed: "unreachable",
38209
38220
  connection_dropped: "unreachable",
@@ -40740,7 +40751,7 @@ Setup has not completed the OpenCode 2 native Google connection.
40740
40751
  }
40741
40752
  async function runPluginSetup(argv, deps, migrateOpenCode, io = {}) {
40742
40753
  const claustrum = await loadCommonAuthClaustrum();
40743
- if (process.env.CORTEXKIT_VAULT_HOST === "thalamus")
40754
+ if (claustrum.hasVaultHost())
40744
40755
  throw new Error(claustrum.VAULT_HOST_CONNECT_REFUSAL);
40745
40756
  const plugin = await createSetupPlugin(
40746
40757
  deps,