@aventurevc/aventure-cli 0.8.289 → 0.8.291
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/aventure-cli/index.js +1 -1
- package/dist/aventure-cli/unified-operations.json +49 -49
- package/dist/chunks/{api-key-bearer-credential-BMluEr_f.js → api-key-bearer-credential-B3se_F1i.js} +1 -1
- package/dist/chunks/{api-key-bearer-credential-DZF0_Kfc.js → api-key-bearer-credential-BaoRcNkq.js} +1 -1
- package/dist/chunks/{api-key-credential-ChxzjOuF.js → api-key-credential-CinaNDln.js} +1 -1
- package/dist/chunks/{api-key-credential-BegTzVQm.js → api-key-credential-D4bb8GPN.js} +1 -1
- package/dist/chunks/{api-key-credential-verification-UYqfiy0G.js → api-key-credential-verification-Dym59aOM.js} +1 -1
- package/dist/chunks/{api-key-credential-verification-BX5JmE_O.js → api-key-credential-verification-JBxAP14v.js} +1 -1
- package/dist/chunks/{api-key-login-C1IYHo4P.js → api-key-login-CRlD8Hdw.js} +1 -1
- package/dist/chunks/auth-resolver-BXhNcSxB.js +1 -0
- package/dist/chunks/{auth-resolver-Dr6cdiZa.js → auth-resolver-BtalY5VS.js} +1 -1
- package/dist/chunks/{auth-status-check-lzi72v8T.js → auth-status-check-BlIxbsBg.js} +1 -1
- package/dist/chunks/{auth-status-check-DqehdM3n.js → auth-status-check-Qbwb8xdt.js} +1 -1
- package/dist/chunks/{auth-status-render-C_3x5fkF.js → auth-status-render-T4-yV9fp.js} +1 -1
- package/dist/chunks/{aventure-cli-CGFrzUKD.js → aventure-cli-CBQ-O2ZQ.js} +5 -5
- package/dist/chunks/{batch-io-BkB1uCIG.js → batch-io-DvVHFAm1.js} +1 -1
- package/dist/chunks/{builtin-auth-Ohs6d8p7.js → builtin-auth-CFdobREz.js} +4 -4
- package/dist/chunks/builtin-run-wait-BV60oBzT.js +1 -0
- package/dist/chunks/{builtin-update-DFzPf7Cf.js → builtin-update-CV7SpXd8.js} +1 -1
- package/dist/chunks/{cli-help-policy-BB_tvwV5.js → cli-help-policy-EqwYSBOi.js} +1 -1
- package/dist/chunks/{completion-D_iows80.js → completion-B2lY_2yd.js} +1 -1
- package/dist/chunks/{contract-BIbN8zfH.js → contract-B6QqVAgo.js} +1 -1
- package/dist/chunks/{contract-parameter-vSu_ZE57.js → contract-parameter-DZFV8Cs1.js} +1 -1
- package/dist/chunks/{credential-redaction-1KvG1I2A.js → credential-redaction-C08ZVt7t.js} +1 -1
- package/dist/chunks/{credential-store-iLl096PD.js → credential-store-DhTI6Vkx.js} +1 -1
- package/dist/chunks/detail-BqAHgqyx.js +1 -0
- package/dist/chunks/detail-CB3r4S8B.js +1 -0
- package/dist/chunks/{env-D4lMZw-8.js → env-B0nFdXns.js} +1 -1
- package/dist/chunks/{generated-option-order-BkjcNcaN.js → generated-option-order-CG9WMlq9.js} +1 -1
- package/dist/chunks/{help-catalog-CvfEYwPL.js → help-catalog-B8JUR6zB.js} +1 -1
- package/dist/chunks/{help-intent-i4bvvWxC.js → help-intent-CGB8sWuW.js} +1 -1
- package/dist/chunks/{logging-BFASdeBx.js → logging-BLz3ITZ8.js} +1 -1
- package/dist/chunks/{logging-CD850a3X.js → logging-D5jL7iVk.js} +1 -1
- package/dist/chunks/{logout-DQGjvSlu.js → logout-7Kj-lSJ8.js} +1 -1
- package/dist/chunks/logout-CwWDCvm9.js +1 -0
- package/dist/chunks/{mcp-generation-contract-9Dhw9awF.js → mcp-generation-contract-CE8KIwBp.js} +1 -1
- package/dist/chunks/mcp-generation-contract-NKGczTz7.js +1 -0
- package/dist/chunks/oauth-bearer-credential-B90_0m1y.js +1 -0
- package/dist/chunks/{oauth-bearer-credential-CTk3JD-X.js → oauth-bearer-credential-Bo4Batar.js} +1 -1
- package/dist/chunks/{oauth-credential-DNPeHTcs.js → oauth-credential-B-ClOD2R.js} +1 -1
- package/dist/chunks/{oauth-credential-GVGWH-DR.js → oauth-credential-sVZgsb1B.js} +1 -1
- package/dist/chunks/{oauth-login-5xpFwoR0.js → oauth-login-DATtqIu1.js} +1 -1
- package/dist/chunks/{oauth-login-DKYtuGmh.js → oauth-login-DpYCqeAI.js} +1 -1
- package/dist/chunks/{openapi-call-wnUkIXxc.js → openapi-call-Cexzbbt7.js} +1 -1
- package/dist/chunks/{openapi-call-CpON5wqD.js → openapi-call-Ch3_9dpf.js} +1 -1
- package/dist/chunks/{openapi-commands-BwyXH0rE.js → openapi-commands-CODC9hA3.js} +1 -1
- package/dist/chunks/openapi-commands-uJK9O6E-.js +1 -0
- package/dist/chunks/openapi-snapshot.json +1 -1
- package/dist/chunks/{operations-DpgJbPZA.js → operations-BWHT-KRA.js} +2 -2
- package/dist/chunks/operations-catalog-CZu715J9.js +1 -0
- package/dist/chunks/{operations-catalog-Cq7zHcft.js → operations-catalog-DGtGsAoc.js} +1 -1
- package/dist/chunks/{operations-metadata-DsfG8AY3.js → operations-metadata-CQE-KJJ2.js} +1 -1
- package/dist/chunks/{output-D4wU9Awb.js → output-C3kL3I1e.js} +1 -1
- package/dist/chunks/{output-CUhlu8iC.js → output-iH1qzlbh.js} +1 -1
- package/dist/chunks/{output-mode-BxLHyuo2.js → output-mode-DA6P7QJC.js} +1 -1
- package/dist/chunks/output-mode-DzK-KTAx.js +1 -0
- package/dist/chunks/{output-spill-D9G-tWU9.js → output-spill-CuQ24_Xn.js} +1 -1
- package/dist/chunks/{parse-error-hint-Tus9Fdd-.js → parse-error-hint-CmUaCmjH.js} +1 -1
- package/dist/chunks/{payload-operand-guard-B9PZN96c.js → payload-operand-guard-BPI5mc9F.js} +1 -1
- package/dist/chunks/private-run-read-DM_02z6l.js +1 -0
- package/dist/chunks/{request-replay-B6JNLRrJ.js → request-replay-zMBhTFrR.js} +1 -1
- package/dist/chunks/{request-replay-CxaD7_FL.js → request-replay-zWu_6Sak.js} +1 -1
- package/dist/chunks/response-problem-B3Q-8otA.js +1 -0
- package/dist/chunks/{response-problem-TCwoXCAT.js → response-problem-B6bUo9co.js} +1 -1
- package/dist/chunks/result-envelope-5DwGbGQt.js +1 -0
- package/dist/chunks/{startup-auth-y9T33mGF.js → startup-auth-8hH2Q16F.js} +1 -1
- package/dist/chunks/{startup-auth-ynvjKOGF.js → startup-auth-BeHVkU9g.js} +1 -1
- package/dist/chunks/{text-response-DrlxPHE_.js → text-response-P41LwuTT.js} +1 -1
- package/dist/chunks/{tool-policy-WURn1WGx.js → tool-policy-BnoDi0Yk.js} +1 -1
- package/package.json +3 -3
- package/dist/chunks/auth-resolver-D3JQo0Sd.js +0 -1
- package/dist/chunks/builtin-research-run-wait-1UGjn_bs.js +0 -1
- package/dist/chunks/detail-B6bqZMpp.js +0 -1
- package/dist/chunks/detail-D0xmL_op.js +0 -1
- package/dist/chunks/logout-CrtcVV2r.js +0 -1
- package/dist/chunks/mcp-generation-contract-C87Be-u9.js +0 -1
- package/dist/chunks/oauth-bearer-credential-q-6Fh37V.js +0 -1
- package/dist/chunks/openapi-commands-BRtd0G0l.js +0 -1
- package/dist/chunks/operations-catalog-CC6sF-lK.js +0 -1
- package/dist/chunks/output-mode-D0olAapl.js +0 -1
- package/dist/chunks/research-run-spend-D9aXcq6b.js +0 -1
- package/dist/chunks/response-problem-C_lGuxhw.js +0 -1
- package/dist/chunks/result-envelope-Dy-nSLrT.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{enableCompileCache as e}from"node:module";import{fileURLToPath as t}from"node:url";e();var{Command:n,CommanderError:r}=await import(`../chunks/commander-D8IVfzyC.js`),{readRuntimePackage:i}=await import(`../chunks/package-DcUsOdSE.js`),{locateRuntimeManifest:a}=await import(`../chunks/runtime-identity-BXcpCMqz.js`),o=process.argv.slice(2);try{if(a(),o.length===1&&(o[0]===`--version`||o[0]===`-V`))await new n().exitOverride().version(i(t(import.meta.url)).version).parseAsync();else{let{logWarn:e,setStderrLogging:t}=await import(`../chunks/logging-
|
|
2
|
+
import{enableCompileCache as e}from"node:module";import{fileURLToPath as t}from"node:url";e();var{Command:n,CommanderError:r}=await import(`../chunks/commander-D8IVfzyC.js`),{readRuntimePackage:i}=await import(`../chunks/package-DcUsOdSE.js`),{locateRuntimeManifest:a}=await import(`../chunks/runtime-identity-BXcpCMqz.js`),o=process.argv.slice(2);try{if(a(),o.length===1&&(o[0]===`--version`||o[0]===`-V`))await new n().exitOverride().version(i(t(import.meta.url)).version).parseAsync();else{let{logWarn:e,setStderrLogging:t}=await import(`../chunks/logging-D5jL7iVk.js`),{cliMachineOutputSelected:n}=await import(`../chunks/output-mode-DzK-KTAx.js`),{commandAuthMaterializationMode:r,materializeCommandCredential:a}=await import(`../chunks/startup-auth-8hH2Q16F.js`),{GENERATED_OPENAPI_COMMAND_SPECS:s}=await import(`../chunks/openapi-commands-CODC9hA3.js`);if(n(o)&&t(!1),o.includes(`--all-fields`)){let{setTextAllFields:e}=await import(`../chunks/text-field-BDYE-wQt.js`);e(!0)}let c=r(o,s);if(c===`stored`||c===`optional`)try{await a(c)}catch(t){e({component:i().bin[0],event:`optional_auth_materialization_failed`,message:`saved credential unavailable; continuing with credential-optional command`,error:t})}await import(`../chunks/aventure-cli-CBQ-O2ZQ.js`)}}catch(e){if(!(e instanceof r))throw e;e.code!==`commander.version`&&process.stderr.write(`${e.message}\n`),process.exitCode=e.exitCode}export{};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"generatedFrom": "MCP_GENERATION_CONTRACT",
|
|
4
|
-
"generatedAt": "2026-10-
|
|
4
|
+
"generatedAt": "2026-10-31T01:46:24.014Z",
|
|
5
5
|
"totalOperations": 135,
|
|
6
6
|
"note": "1:1 projection of MCP_GENERATION_CONTRACT written by the CLI build ([MCP1b.1-EXC1]).",
|
|
7
7
|
"operations": [
|
|
@@ -268,7 +268,7 @@
|
|
|
268
268
|
"mcpTool": "aventure_read",
|
|
269
269
|
"bodySchemaName": null,
|
|
270
270
|
"bodySchemaImport": null,
|
|
271
|
-
"auth": "
|
|
271
|
+
"auth": "bearer",
|
|
272
272
|
"scope": "read",
|
|
273
273
|
"destructive": false
|
|
274
274
|
},
|
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
"mcpTool": "aventure_read",
|
|
289
289
|
"bodySchemaName": null,
|
|
290
290
|
"bodySchemaImport": null,
|
|
291
|
-
"auth": "
|
|
291
|
+
"auth": "bearer",
|
|
292
292
|
"scope": "read",
|
|
293
293
|
"destructive": false
|
|
294
294
|
},
|
|
@@ -343,7 +343,7 @@
|
|
|
343
343
|
"mcpTool": "aventure_read",
|
|
344
344
|
"bodySchemaName": null,
|
|
345
345
|
"bodySchemaImport": null,
|
|
346
|
-
"auth": "
|
|
346
|
+
"auth": "bearer",
|
|
347
347
|
"scope": "read",
|
|
348
348
|
"destructive": false
|
|
349
349
|
},
|
|
@@ -362,7 +362,7 @@
|
|
|
362
362
|
"mcpTool": "aventure_read",
|
|
363
363
|
"bodySchemaName": null,
|
|
364
364
|
"bodySchemaImport": null,
|
|
365
|
-
"auth": "
|
|
365
|
+
"auth": "bearer",
|
|
366
366
|
"scope": "read",
|
|
367
367
|
"destructive": false
|
|
368
368
|
},
|
|
@@ -381,7 +381,7 @@
|
|
|
381
381
|
"mcpTool": "aventure_read",
|
|
382
382
|
"bodySchemaName": null,
|
|
383
383
|
"bodySchemaImport": null,
|
|
384
|
-
"auth": "
|
|
384
|
+
"auth": "bearer",
|
|
385
385
|
"scope": "read",
|
|
386
386
|
"destructive": false
|
|
387
387
|
},
|
|
@@ -419,7 +419,7 @@
|
|
|
419
419
|
"mcpTool": "aventure_read",
|
|
420
420
|
"bodySchemaName": null,
|
|
421
421
|
"bodySchemaImport": null,
|
|
422
|
-
"auth": "
|
|
422
|
+
"auth": "bearer",
|
|
423
423
|
"scope": "read",
|
|
424
424
|
"destructive": false
|
|
425
425
|
},
|
|
@@ -438,7 +438,7 @@
|
|
|
438
438
|
"mcpTool": "aventure_read",
|
|
439
439
|
"bodySchemaName": null,
|
|
440
440
|
"bodySchemaImport": null,
|
|
441
|
-
"auth": "
|
|
441
|
+
"auth": "bearer",
|
|
442
442
|
"scope": "read",
|
|
443
443
|
"destructive": false
|
|
444
444
|
},
|
|
@@ -534,7 +534,7 @@
|
|
|
534
534
|
"mcpTool": "aventure_read",
|
|
535
535
|
"bodySchemaName": null,
|
|
536
536
|
"bodySchemaImport": null,
|
|
537
|
-
"auth": "
|
|
537
|
+
"auth": "bearer",
|
|
538
538
|
"scope": "read",
|
|
539
539
|
"destructive": false
|
|
540
540
|
},
|
|
@@ -572,7 +572,7 @@
|
|
|
572
572
|
"mcpTool": "aventure_read",
|
|
573
573
|
"bodySchemaName": null,
|
|
574
574
|
"bodySchemaImport": null,
|
|
575
|
-
"auth": "
|
|
575
|
+
"auth": "bearer",
|
|
576
576
|
"scope": "read",
|
|
577
577
|
"destructive": false
|
|
578
578
|
},
|
|
@@ -591,7 +591,7 @@
|
|
|
591
591
|
"mcpTool": "aventure_read",
|
|
592
592
|
"bodySchemaName": null,
|
|
593
593
|
"bodySchemaImport": null,
|
|
594
|
-
"auth": "
|
|
594
|
+
"auth": "bearer",
|
|
595
595
|
"scope": "read",
|
|
596
596
|
"destructive": false
|
|
597
597
|
},
|
|
@@ -610,7 +610,7 @@
|
|
|
610
610
|
"mcpTool": "aventure_read",
|
|
611
611
|
"bodySchemaName": null,
|
|
612
612
|
"bodySchemaImport": null,
|
|
613
|
-
"auth": "
|
|
613
|
+
"auth": "bearer",
|
|
614
614
|
"scope": "read",
|
|
615
615
|
"destructive": false
|
|
616
616
|
},
|
|
@@ -629,7 +629,7 @@
|
|
|
629
629
|
"mcpTool": "aventure_read",
|
|
630
630
|
"bodySchemaName": null,
|
|
631
631
|
"bodySchemaImport": null,
|
|
632
|
-
"auth": "
|
|
632
|
+
"auth": "bearer",
|
|
633
633
|
"scope": "read",
|
|
634
634
|
"destructive": false
|
|
635
635
|
},
|
|
@@ -648,7 +648,7 @@
|
|
|
648
648
|
"mcpTool": "aventure_read",
|
|
649
649
|
"bodySchemaName": null,
|
|
650
650
|
"bodySchemaImport": null,
|
|
651
|
-
"auth": "
|
|
651
|
+
"auth": "bearer",
|
|
652
652
|
"scope": "read",
|
|
653
653
|
"destructive": false
|
|
654
654
|
},
|
|
@@ -667,7 +667,7 @@
|
|
|
667
667
|
"mcpTool": "aventure_read",
|
|
668
668
|
"bodySchemaName": null,
|
|
669
669
|
"bodySchemaImport": null,
|
|
670
|
-
"auth": "
|
|
670
|
+
"auth": "bearer",
|
|
671
671
|
"scope": "read",
|
|
672
672
|
"destructive": false
|
|
673
673
|
},
|
|
@@ -686,7 +686,7 @@
|
|
|
686
686
|
"mcpTool": "aventure_read",
|
|
687
687
|
"bodySchemaName": null,
|
|
688
688
|
"bodySchemaImport": null,
|
|
689
|
-
"auth": "
|
|
689
|
+
"auth": "bearer",
|
|
690
690
|
"scope": "read",
|
|
691
691
|
"destructive": false
|
|
692
692
|
},
|
|
@@ -706,7 +706,7 @@
|
|
|
706
706
|
"mcpTool": "aventure_read",
|
|
707
707
|
"bodySchemaName": null,
|
|
708
708
|
"bodySchemaImport": null,
|
|
709
|
-
"auth": "
|
|
709
|
+
"auth": "bearer",
|
|
710
710
|
"scope": "read",
|
|
711
711
|
"destructive": false
|
|
712
712
|
},
|
|
@@ -744,7 +744,7 @@
|
|
|
744
744
|
"mcpTool": "aventure_read",
|
|
745
745
|
"bodySchemaName": null,
|
|
746
746
|
"bodySchemaImport": null,
|
|
747
|
-
"auth": "
|
|
747
|
+
"auth": "bearer",
|
|
748
748
|
"scope": "read",
|
|
749
749
|
"destructive": false
|
|
750
750
|
},
|
|
@@ -763,7 +763,7 @@
|
|
|
763
763
|
"mcpTool": "aventure_read",
|
|
764
764
|
"bodySchemaName": null,
|
|
765
765
|
"bodySchemaImport": null,
|
|
766
|
-
"auth": "
|
|
766
|
+
"auth": "bearer",
|
|
767
767
|
"scope": "read",
|
|
768
768
|
"destructive": false
|
|
769
769
|
},
|
|
@@ -782,7 +782,7 @@
|
|
|
782
782
|
"mcpTool": "aventure_read",
|
|
783
783
|
"bodySchemaName": null,
|
|
784
784
|
"bodySchemaImport": null,
|
|
785
|
-
"auth": "
|
|
785
|
+
"auth": "bearer",
|
|
786
786
|
"scope": "read",
|
|
787
787
|
"destructive": false
|
|
788
788
|
},
|
|
@@ -973,7 +973,7 @@
|
|
|
973
973
|
"mcpTool": "aventure_read",
|
|
974
974
|
"bodySchemaName": null,
|
|
975
975
|
"bodySchemaImport": null,
|
|
976
|
-
"auth": "
|
|
976
|
+
"auth": "bearer",
|
|
977
977
|
"scope": "read",
|
|
978
978
|
"destructive": false
|
|
979
979
|
},
|
|
@@ -1011,7 +1011,7 @@
|
|
|
1011
1011
|
"mcpTool": "aventure_read",
|
|
1012
1012
|
"bodySchemaName": null,
|
|
1013
1013
|
"bodySchemaImport": null,
|
|
1014
|
-
"auth": "
|
|
1014
|
+
"auth": "bearer",
|
|
1015
1015
|
"scope": "read",
|
|
1016
1016
|
"destructive": false
|
|
1017
1017
|
},
|
|
@@ -1068,7 +1068,7 @@
|
|
|
1068
1068
|
"mcpTool": "aventure_read",
|
|
1069
1069
|
"bodySchemaName": null,
|
|
1070
1070
|
"bodySchemaImport": null,
|
|
1071
|
-
"auth": "
|
|
1071
|
+
"auth": "bearer",
|
|
1072
1072
|
"scope": "read",
|
|
1073
1073
|
"destructive": false
|
|
1074
1074
|
},
|
|
@@ -1106,7 +1106,7 @@
|
|
|
1106
1106
|
"mcpTool": "aventure_read",
|
|
1107
1107
|
"bodySchemaName": null,
|
|
1108
1108
|
"bodySchemaImport": null,
|
|
1109
|
-
"auth": "
|
|
1109
|
+
"auth": "bearer",
|
|
1110
1110
|
"scope": "read",
|
|
1111
1111
|
"destructive": false
|
|
1112
1112
|
},
|
|
@@ -1184,7 +1184,7 @@
|
|
|
1184
1184
|
"mcpTool": "aventure_read",
|
|
1185
1185
|
"bodySchemaName": null,
|
|
1186
1186
|
"bodySchemaImport": null,
|
|
1187
|
-
"auth": "
|
|
1187
|
+
"auth": "bearer",
|
|
1188
1188
|
"scope": "read",
|
|
1189
1189
|
"destructive": false
|
|
1190
1190
|
},
|
|
@@ -1296,7 +1296,7 @@
|
|
|
1296
1296
|
"mcpTool": "aventure_read",
|
|
1297
1297
|
"bodySchemaName": null,
|
|
1298
1298
|
"bodySchemaImport": null,
|
|
1299
|
-
"auth": "
|
|
1299
|
+
"auth": "bearer",
|
|
1300
1300
|
"scope": "read",
|
|
1301
1301
|
"destructive": false
|
|
1302
1302
|
},
|
|
@@ -1316,7 +1316,7 @@
|
|
|
1316
1316
|
"mcpTool": "aventure_read",
|
|
1317
1317
|
"bodySchemaName": null,
|
|
1318
1318
|
"bodySchemaImport": null,
|
|
1319
|
-
"auth": "
|
|
1319
|
+
"auth": "bearer",
|
|
1320
1320
|
"scope": "read",
|
|
1321
1321
|
"destructive": false
|
|
1322
1322
|
},
|
|
@@ -1433,7 +1433,7 @@
|
|
|
1433
1433
|
"mcpTool": "aventure_read",
|
|
1434
1434
|
"bodySchemaName": null,
|
|
1435
1435
|
"bodySchemaImport": null,
|
|
1436
|
-
"auth": "
|
|
1436
|
+
"auth": "bearer",
|
|
1437
1437
|
"scope": "read",
|
|
1438
1438
|
"destructive": false
|
|
1439
1439
|
},
|
|
@@ -1452,7 +1452,7 @@
|
|
|
1452
1452
|
"mcpTool": "aventure_read",
|
|
1453
1453
|
"bodySchemaName": null,
|
|
1454
1454
|
"bodySchemaImport": null,
|
|
1455
|
-
"auth": "
|
|
1455
|
+
"auth": "bearer",
|
|
1456
1456
|
"scope": "read",
|
|
1457
1457
|
"destructive": false
|
|
1458
1458
|
},
|
|
@@ -1559,7 +1559,7 @@
|
|
|
1559
1559
|
"mcpTool": "aventure_read",
|
|
1560
1560
|
"bodySchemaName": null,
|
|
1561
1561
|
"bodySchemaImport": null,
|
|
1562
|
-
"auth": "
|
|
1562
|
+
"auth": "bearer",
|
|
1563
1563
|
"scope": "read",
|
|
1564
1564
|
"destructive": false
|
|
1565
1565
|
},
|
|
@@ -1596,7 +1596,7 @@
|
|
|
1596
1596
|
"mcpTool": "aventure_read",
|
|
1597
1597
|
"bodySchemaName": null,
|
|
1598
1598
|
"bodySchemaImport": null,
|
|
1599
|
-
"auth": "
|
|
1599
|
+
"auth": "bearer",
|
|
1600
1600
|
"scope": "read",
|
|
1601
1601
|
"destructive": false
|
|
1602
1602
|
},
|
|
@@ -1689,7 +1689,7 @@
|
|
|
1689
1689
|
"mcpTool": "aventure_read",
|
|
1690
1690
|
"bodySchemaName": null,
|
|
1691
1691
|
"bodySchemaImport": null,
|
|
1692
|
-
"auth": "
|
|
1692
|
+
"auth": "bearer",
|
|
1693
1693
|
"scope": "read",
|
|
1694
1694
|
"destructive": false
|
|
1695
1695
|
},
|
|
@@ -1708,7 +1708,7 @@
|
|
|
1708
1708
|
"mcpTool": "aventure_read",
|
|
1709
1709
|
"bodySchemaName": null,
|
|
1710
1710
|
"bodySchemaImport": null,
|
|
1711
|
-
"auth": "
|
|
1711
|
+
"auth": "bearer",
|
|
1712
1712
|
"scope": "read",
|
|
1713
1713
|
"destructive": false
|
|
1714
1714
|
},
|
|
@@ -1727,7 +1727,7 @@
|
|
|
1727
1727
|
"mcpTool": "aventure_read",
|
|
1728
1728
|
"bodySchemaName": null,
|
|
1729
1729
|
"bodySchemaImport": null,
|
|
1730
|
-
"auth": "
|
|
1730
|
+
"auth": "bearer",
|
|
1731
1731
|
"scope": "read",
|
|
1732
1732
|
"destructive": false
|
|
1733
1733
|
},
|
|
@@ -1803,7 +1803,7 @@
|
|
|
1803
1803
|
"mcpTool": "aventure_read",
|
|
1804
1804
|
"bodySchemaName": null,
|
|
1805
1805
|
"bodySchemaImport": null,
|
|
1806
|
-
"auth": "
|
|
1806
|
+
"auth": "bearer",
|
|
1807
1807
|
"scope": "read",
|
|
1808
1808
|
"destructive": false
|
|
1809
1809
|
},
|
|
@@ -1822,7 +1822,7 @@
|
|
|
1822
1822
|
"mcpTool": "aventure_read",
|
|
1823
1823
|
"bodySchemaName": null,
|
|
1824
1824
|
"bodySchemaImport": null,
|
|
1825
|
-
"auth": "
|
|
1825
|
+
"auth": "bearer",
|
|
1826
1826
|
"scope": "read",
|
|
1827
1827
|
"destructive": false
|
|
1828
1828
|
},
|
|
@@ -1841,7 +1841,7 @@
|
|
|
1841
1841
|
"mcpTool": "aventure_read",
|
|
1842
1842
|
"bodySchemaName": null,
|
|
1843
1843
|
"bodySchemaImport": null,
|
|
1844
|
-
"auth": "
|
|
1844
|
+
"auth": "bearer",
|
|
1845
1845
|
"scope": "read",
|
|
1846
1846
|
"destructive": false
|
|
1847
1847
|
},
|
|
@@ -1860,7 +1860,7 @@
|
|
|
1860
1860
|
"mcpTool": "aventure_read",
|
|
1861
1861
|
"bodySchemaName": null,
|
|
1862
1862
|
"bodySchemaImport": null,
|
|
1863
|
-
"auth": "
|
|
1863
|
+
"auth": "bearer",
|
|
1864
1864
|
"scope": "read",
|
|
1865
1865
|
"destructive": false
|
|
1866
1866
|
},
|
|
@@ -1879,7 +1879,7 @@
|
|
|
1879
1879
|
"mcpTool": "aventure_read",
|
|
1880
1880
|
"bodySchemaName": null,
|
|
1881
1881
|
"bodySchemaImport": null,
|
|
1882
|
-
"auth": "
|
|
1882
|
+
"auth": "bearer",
|
|
1883
1883
|
"scope": "read",
|
|
1884
1884
|
"destructive": false
|
|
1885
1885
|
},
|
|
@@ -1955,7 +1955,7 @@
|
|
|
1955
1955
|
"mcpTool": "aventure_read",
|
|
1956
1956
|
"bodySchemaName": null,
|
|
1957
1957
|
"bodySchemaImport": null,
|
|
1958
|
-
"auth": "
|
|
1958
|
+
"auth": "bearer",
|
|
1959
1959
|
"scope": "read",
|
|
1960
1960
|
"destructive": false
|
|
1961
1961
|
},
|
|
@@ -2031,7 +2031,7 @@
|
|
|
2031
2031
|
"mcpTool": "aventure_read",
|
|
2032
2032
|
"bodySchemaName": null,
|
|
2033
2033
|
"bodySchemaImport": null,
|
|
2034
|
-
"auth": "
|
|
2034
|
+
"auth": "bearer",
|
|
2035
2035
|
"scope": "read",
|
|
2036
2036
|
"destructive": false
|
|
2037
2037
|
},
|
|
@@ -2069,7 +2069,7 @@
|
|
|
2069
2069
|
"mcpTool": "aventure_read",
|
|
2070
2070
|
"bodySchemaName": null,
|
|
2071
2071
|
"bodySchemaImport": null,
|
|
2072
|
-
"auth": "
|
|
2072
|
+
"auth": "bearer",
|
|
2073
2073
|
"scope": "read",
|
|
2074
2074
|
"destructive": false
|
|
2075
2075
|
},
|
|
@@ -2088,7 +2088,7 @@
|
|
|
2088
2088
|
"mcpTool": "aventure_read",
|
|
2089
2089
|
"bodySchemaName": null,
|
|
2090
2090
|
"bodySchemaImport": null,
|
|
2091
|
-
"auth": "
|
|
2091
|
+
"auth": "bearer",
|
|
2092
2092
|
"scope": "read",
|
|
2093
2093
|
"destructive": false
|
|
2094
2094
|
},
|
|
@@ -2163,7 +2163,7 @@
|
|
|
2163
2163
|
"mcpTool": "aventure_read",
|
|
2164
2164
|
"bodySchemaName": null,
|
|
2165
2165
|
"bodySchemaImport": null,
|
|
2166
|
-
"auth": "
|
|
2166
|
+
"auth": "bearer",
|
|
2167
2167
|
"scope": "read",
|
|
2168
2168
|
"destructive": false
|
|
2169
2169
|
},
|
|
@@ -2433,7 +2433,7 @@
|
|
|
2433
2433
|
"mcpTool": "aventure_read",
|
|
2434
2434
|
"bodySchemaName": null,
|
|
2435
2435
|
"bodySchemaImport": null,
|
|
2436
|
-
"auth": "
|
|
2436
|
+
"auth": "bearer",
|
|
2437
2437
|
"scope": "read",
|
|
2438
2438
|
"destructive": false
|
|
2439
2439
|
},
|
|
@@ -2452,7 +2452,7 @@
|
|
|
2452
2452
|
"mcpTool": "aventure_read",
|
|
2453
2453
|
"bodySchemaName": null,
|
|
2454
2454
|
"bodySchemaImport": null,
|
|
2455
|
-
"auth": "
|
|
2455
|
+
"auth": "bearer",
|
|
2456
2456
|
"scope": "read",
|
|
2457
2457
|
"destructive": false
|
|
2458
2458
|
},
|
|
@@ -2472,7 +2472,7 @@
|
|
|
2472
2472
|
"mcpTool": "aventure_read",
|
|
2473
2473
|
"bodySchemaName": null,
|
|
2474
2474
|
"bodySchemaImport": null,
|
|
2475
|
-
"auth": "
|
|
2475
|
+
"auth": "bearer",
|
|
2476
2476
|
"scope": "read",
|
|
2477
2477
|
"destructive": false
|
|
2478
2478
|
},
|
|
@@ -2509,7 +2509,7 @@
|
|
|
2509
2509
|
"mcpTool": "aventure_read",
|
|
2510
2510
|
"bodySchemaName": null,
|
|
2511
2511
|
"bodySchemaImport": null,
|
|
2512
|
-
"auth": "
|
|
2512
|
+
"auth": "bearer",
|
|
2513
2513
|
"scope": "read",
|
|
2514
2514
|
"destructive": false
|
|
2515
2515
|
},
|
|
@@ -2527,7 +2527,7 @@
|
|
|
2527
2527
|
"mcpTool": "aventure_read",
|
|
2528
2528
|
"bodySchemaName": null,
|
|
2529
2529
|
"bodySchemaImport": null,
|
|
2530
|
-
"auth": "
|
|
2530
|
+
"auth": "bearer",
|
|
2531
2531
|
"scope": "read",
|
|
2532
2532
|
"destructive": false
|
|
2533
2533
|
},
|
package/dist/chunks/{api-key-bearer-credential-BMluEr_f.js → api-key-bearer-credential-B3se_F1i.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./package-DEeHDoOT.js";import{f as t,t as n}from"./env-
|
|
1
|
+
import{a as e}from"./package-DEeHDoOT.js";import{f as t,t as n}from"./env-B0nFdXns.js";import{o as r,r as i}from"./logging-BLz3ITZ8.js";import{r as a}from"./api-target-vxev2RKl.js";import{r as o}from"./api-key-credential-CinaNDln.js";async function s(e){if(c())return;let s=a(t().host);try{let t=await o(s);if(t.state===`unavailable`){i(l(`keyring`,Error(t.summary)));return}t.state===`found`&&t.stored.activation===`active`&&!c()&&(process.env[n.authToken]=t.stored.credential.secret,e?.(`api-key`))}catch(e){r(l(`parse`,e))}}function c(){return(process.env[n.authToken]?.trim().length??0)>0}function l(t,n){return{component:e().bin[0],event:`api_key_materialization_unavailable`,message:`saved API key could not be loaded; continuing with environment auth`,fields:{source:t},error:n}}export{s as t};
|
package/dist/chunks/{api-key-bearer-credential-DZF0_Kfc.js → api-key-bearer-credential-BaoRcNkq.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as materializeCliApiKeyBearerCredential}from"./api-key-bearer-credential-
|
|
1
|
+
export{t as materializeCliApiKeyBearerCredential}from"./api-key-bearer-credential-B3se_F1i.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{S as e,_ as t,i as n,n as r,s as i}from"./iso-l1vOidnb.js";import{r as a}from"./api-target-vxev2RKl.js";import{t as o}from"./credential-redaction-
|
|
1
|
+
import{S as e,_ as t,i as n,n as r,s as i}from"./iso-l1vOidnb.js";import{r as a}from"./api-target-vxev2RKl.js";import{t as o}from"./credential-redaction-C08ZVt7t.js";import{i as s,o as c,r as l,t as u}from"./credential-store-DhTI6Vkx.js";var d=t({createdAt:r({offset:!0}),description:e().nullish(),expiresAt:r({offset:!0}).nullish(),id:e().regex(/^ak_[0-9A-Fa-f]{32}$/),lastUsedAt:r({offset:!0}).nullish(),name:e(),revocationReason:e().nullish(),scopes:i(e()),status:n([`ACTIVE`,`REVOKED`,`EXPIRED`]),subject:e(),updatedAt:r({offset:!0})}),f=`vc.aventure.aventure-cli`,p=`aventure-cli-personal-v1`;async function m(e,t,n){let r=a(e),i=y(t,n),s;try{s=await c(f,r,i)}catch(e){throw Error(`${o(e,[i,t.secret])}; broker acknowledgment was withheld. Re-run auth status before retrying.`,{cause:e})}return{host:r,provider:s,activation:n,credential:t}}async function h(e){let t=a(e),n;try{n=await s(f,t)}catch(e){return v(o(e))}let{record:r,keyringFailure:i}=n;return r===void 0?i===void 0?{state:`missing`}:{state:`missing`,keyringFailure:i}:{state:`found`,stored:{host:t,provider:r.provider,...b(r.value)}}}async function g(e){let t=await h(e);if(t.state!==`missing`)return t;try{let{keyringFailure:t}=await l(f,a(e));return t===void 0?{state:`missing`}:{state:`missing`,keyringFailure:t}}catch(e){return v(o(e))}}async function _(e){await u(f,a(e))}function v(e){return{state:`unavailable`,summary:e,cause:`storage`}}function y(e,t){return`${p}:${t}\n${JSON.stringify(e.apiKey)}\n${e.secret}`}function b(e){let t=e.indexOf(`
|
|
2
2
|
`),n=t<0?-1:e.indexOf(`
|
|
3
3
|
`,t+1),r=t<0?e:e.slice(0,t),i=r===`${p}:active`?`active`:`pending`;if(t<0||n<0||r!==`${p}:pending`&&r!==`${p}:active`)throw Error(`OS credential entry has an unsupported format`);let a=e.slice(n+1);if(a.length===0)throw Error(`OS credential entry has an empty secret`);let o;try{o=JSON.parse(e.slice(t+1,n))}catch(e){throw Error(`OS credential entry failed canonical schema validation`,{cause:e})}let s=d.safeParse(o);if(!s.success)throw Error(`OS credential entry failed canonical schema validation`,{cause:s.error});return{activation:i,credential:{apiKey:s.data,secret:a}}}export{d as a,m as i,g as n,h as r,_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{n as inspectApiKeyCredentialStorage}from"./api-key-credential-
|
|
1
|
+
export{n as inspectApiKeyCredentialStorage}from"./api-key-credential-CinaNDln.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as refreshStoredApiKeyCredential}from"./api-key-credential-verification-
|
|
1
|
+
export{t as refreshStoredApiKeyCredential}from"./api-key-credential-verification-JBxAP14v.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e}from"./env-
|
|
1
|
+
import{f as e}from"./env-B0nFdXns.js";import{n as t,s as n}from"./openapi-call-Ch3_9dpf.js";import{a as r}from"./api-target-vxev2RKl.js";import{a as i,i as a}from"./api-key-credential-CinaNDln.js";import{n as o,t as s}from"./credential-redaction-C08ZVt7t.js";async function c(e){let t=await l(e.credential.secret);if(t.state!==`verified`||e.activation!==`active`)return{stored:e,verification:t};try{return{stored:await a(e.host,{apiKey:t.apiKey,secret:e.credential.secret},`active`),verification:t}}catch(n){return{stored:e,verification:{state:`unavailable`,summary:`${t.summary}, but the cached metadata could not be updated — ${s(n,[e.credential.secret])}`}}}}async function l(a){let c=r(e()),l;try{l=await n(c,{method:`GET`,path:t(`getCurrentApiKey`,{}),headers:{Authorization:`Bearer ${a}`}},i)}catch(e){return{state:`unavailable`,summary:`identity verification failed before an HTTP response — ${s(e,[a])}`}}return l.ok&&l.redirect?{state:`unavailable`,summary:`identity verification returned unexpected redirect ${l.status}`}:l.ok?l.data.status===`ACTIVE`?{state:`verified`,summary:`API key verified by aVenture sign-in`,apiKey:l.data}:{state:`invalid`,summary:`API key is not active`}:{state:l.problem.status===401||l.problem.status===403?`invalid`:`unavailable`,summary:`identity verification: ${o(l.problem,[a])}`}}export{l as n,c as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e}from"./package-DEeHDoOT.js";import{A as t,E as n,S as r,_ as i,g as a,i as o,n as s}from"./iso-l1vOidnb.js";import{f as c}from"./env-D4lMZw-8.js";import{c as l,r as u}from"./result-envelope-Dy-nSLrT.js";import{z as d}from"./tool-policy-WURn1WGx.js";import{l as f,s as p}from"./openapi-call-CpON5wqD.js";import{i as m}from"./response-problem-TCwoXCAT.js";import{a as h,r as ee,t as g}from"./api-target-vxev2RKl.js";import{i as _,n as v,t as y}from"./api-key-credential-ChxzjOuF.js";import{n as b,t as x}from"./credential-redaction-1KvG1I2A.js";import{c as te,l as ne,n as S}from"./credential-store-iLl096PD.js";import{n as C}from"./api-key-credential-verification-BX5JmE_O.js";import{n as w}from"./contract-BIbN8zfH.js";import{t as T}from"./openapi-composites-CO9Q6ihp.js";import{n as re}from"./logout-DQGjvSlu.js";import{stderr as E,stdin as ie}from"node:process";import{TextDecoder as ae,inspect as oe}from"node:util";import{hostname as se,platform as ce}from"node:os";import{setTimeout as le}from"node:timers/promises";import{webcrypto as D}from"node:crypto";var O=o([`MACOS`,`LINUX`,`WINDOWS`,`OTHER`]),k=o([`RSA_OAEP_256_A256_GCM_V1`]),A=i({clientLabel:r().regex(/.*\S.*/).min(1).max(120).nullish(),clientPlatform:O.nullish(),encryptionAlgorithm:k.nullish(),encryptionPublicKey:r().min(344).max(12e3).nullish()}),j=32;async function ue(){let e=await D.subtle.generateKey({name:`RSA-OAEP`,modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:`SHA-256`},!0,[`encrypt`,`decrypt`]),t=await D.subtle.exportKey(`spki`,e.publicKey);return{publicKey:Buffer.from(t).toString(`base64`),privateKey:e.privateKey}}async function de(e,t){let{wrappedKey:n,nonce:r,ciphertext:i,authenticationTag:a}=t,o=M(n,`wrapped key`,128,1024),s=M(r,`nonce`,12,12),c=M(i,`ciphertext`,1,65536),l=M(a,`authentication tag`,16,16),u;try{u=await D.subtle.decrypt({name:`RSA-OAEP`},e,o)}catch{throw Error(`broker credential key could not be decrypted`)}let d=new Uint8Array(u);try{if(d.byteLength!==j)throw Error(`broker credential used an invalid AES-256 key`);let e=await D.subtle.importKey(`raw`,d,{name:`AES-GCM`},!1,[`decrypt`]),t=new Uint8Array(c.byteLength+l.byteLength);t.set(c),t.set(l,c.byteLength);let n;try{n=await D.subtle.decrypt({name:`AES-GCM`,iv:s,tagLength:128},e,t)}catch{throw Error(`broker credential payload failed authentication`)}let r=new ae(`utf-8`,{fatal:!0}).decode(n);if(r.trim().length===0)throw Error(`broker returned a blank credential`);return r}finally{d.fill(0)}}function M(e,t,n,r){let i=e.replace(/=+$/u,``),a=Uint8Array.from(Buffer.from(e,`base64`)),o=Buffer.from(a).toString(`base64`).replace(/=+$/u,``);if(i.length===0||o!==i||a.byteLength<n||a.byteLength>r)throw Error(`broker returned an invalid ${t}`);return a}var N=o([`PENDING`,`ISSUING`,`KEY_READY`,`REVOKING`,`CONSUMED`,`REVOKED`,`DENIED`,`EXPIRED`,`FAILED`]),P=o([`Denied by user`,`Authorization request expired`,`CLI authorization expired before acknowledgement`,`Credential issuance recovery revoked an unrecoverable key`,`Revoked by user`,`Clerk create response validation failed`,`Credential issuance failed`,`Credential issuance could not be recovered`,`API-key quota reached`,`Credential issuance lost its database claim`,`Credential delivery encryption failed`,`Credential issuance finalization was lost`]),F=i({approvedAt:s({offset:!0}).nullish(),clientLabel:r(),clientPlatform:O,comparisonCode:r(),consumedAt:s({offset:!0}).nullish(),createdAt:s({offset:!0}),expiresAt:s({offset:!0}),id:n(),intervalSeconds:a().int().min(1),keyReadyAt:s({offset:!0}).nullish(),status:N,terminalAt:s({offset:!0}).nullish(),terminalReason:P.nullish(),updatedAt:s({offset:!0})}),I=i({algorithm:k,authenticationTag:r(),ciphertext:r(),nonce:r(),wrappedKey:r()}),L=i({delivery:I.nullish(),expiresAt:s({offset:!0}),status:N,terminalReason:P.nullish()}),R=i({comparisonCode:r(),expiresAt:s({offset:!0}),id:n(),intervalSeconds:a().int().min(1),pollSecret:r(),verificationUrl:r()}),z=w(T,`start`),B=w(T,`poll`),V=w(T,`acknowledge`),H=class extends Error{httpStatus;retryAfterSeconds;retryable;constructor(e,t,n=[]){super(`CLI authorization ${e} failed: ${b(t,n)}`),this.name=`CliAuthorizationRequestError`,this.httpStatus=t.status,this.retryAfterSeconds=he(t.retryAfterSeconds),this.retryable=t.status>=500||t.status===429}},U=class extends Error{constructor(e,t,n=[]){super(`CLI authorization ${e} transport failed: ${x(t,n)}`,{cause:t}),this.name=`CliAuthorizationTransportError`}};async function fe(e){let t=await p(h(c()),{method:z.method,path:d(z.path,{},z.operationId),headers:{},contentType:`application/json`,body:e},R);if(t.ok&&t.redirect)throw new H(`start`,G(t.status));if(!t.ok)throw new H(`start`,t.problem);return ge(t.data)}async function W(e,t){let n=f(B.operationId),r=await p(h(c()),{method:B.method,path:d(B.path,{cliAuthorizationId:e},B.operationId),headers:{[n]:t}},L);if(r.ok&&r.redirect)throw new H(`poll`,G(r.status),[t]);if(!r.ok)throw new H(`poll`,r.problem,[t]);return{authorization:r.data,retryAfterSeconds:me(r.headers[`retry-after`])}}async function pe(e,t){let n=f(V.operationId),r;try{r=await p(h(c()),{method:V.method,path:d(V.path,{cliAuthorizationId:e},V.operationId),headers:{[n]:t}},F)}catch(e){throw new U(`acknowledge`,e,[t])}if(r.ok&&r.redirect)throw new H(`acknowledge`,G(r.status),[t]);if(!r.ok)throw new H(`acknowledge`,r.problem,[t]);return r.data}function me(e){if(e===void 0)return null;let t=Number(e);return Number.isInteger(t)&&t>0?t:null}function he(e){return typeof e==`number`&&Number.isInteger(e)&&e>0?e:null}function G(e){return{status:e,title:`Unexpected redirect`,type:`about:blank`,code:void 0,detail:`CLI authorization endpoint returned an unexpected redirect`}}function ge(e){let{verificationUrl:t,pollSecret:n,...r}=e,i={...e},a=()=>({...r,verificationUrl:`<redacted>`,pollSecret:`<redacted>`});return Object.defineProperties(i,{verificationUrl:{enumerable:!1,get:()=>t},pollSecret:{enumerable:!1,get:()=>n},toJSON:{enumerable:!1,value:a},toString:{enumerable:!1,value:()=>`CliAuthorizationStart(${JSON.stringify(a())})`},[oe.custom]:{enumerable:!1,value:a}})}var K=`RSA_OAEP_256_A256_GCM_V1`,_e=1,ve=30,q=e().bin[0],J=`The local record remains pending and unavailable to ordinary commands. Re-run \`${q} auth login --key\`; it recovers the credential when the broker acknowledged it, and otherwise clears the stale record.`;async function ye(e){if(!ie.isTTY)return u(`${q} auth login --key requires an interactive TTY on stdin`,[`For non-interactive automation, inject AUTH_TOKEN through the environment.`]);let n,r;try{let e=c().host;n=ee(e),r=g(e)}catch(e){return u(`auth login --key: invalid environment configuration — ${x(e)}`)}for(;;){let e;try{e=await v(n)}catch(e){return u(`auth login --key: credential storage could not be inspected — ${x(e)}`)}if(e.state===`unavailable`)return u(`auth login --key: ${e.summary}`,[`Make the OS keyring or the CLI config directory writable, or use AUTH_TOKEN from the environment.`]);if(e.state===`missing`){let t=S(e.keyringFailure);t!==null&&E.write(t);break}let t=await be(e.stored);if(t!==null)return t}let i;try{i=await ue()}catch(e){return u(`auth login --key: ephemeral encryption key could not be created — ${x(e)}`)}let a=A.safeParse({clientLabel:e.clientLabel?.trim()||(se().trim()||q).slice(0,120),clientPlatform:we(),encryptionAlgorithm:K,encryptionPublicKey:i.publicKey});if(!a.success)return u(`auth login --key: ${t(a.error)}`);let o;try{o=await fe(a.data)}catch(e){return u(`auth login --key: could not start browser authorization — ${x(e)}`)}let s;try{s=ne(o,r)}catch(e){return u(`auth login --key: unsafe browser authorization URL rejected — ${x(e)}`)}if(!Ce(await te(o,r,{noBrowser:e.noBrowser}),o,s))return u(`auth login --key: browser authorization requires an interactive terminal for manual handoff`,[`Automatic browser opening did not complete, and the approval URL was withheld because stderr is not an interactive terminal. Retry from an interactive terminal.`],{references:[s]});let d;try{d=await Se(o)}catch(e){return u(`auth login --key: authorization did not complete — ${x(e)}`,[],{references:[s]})}if(d.algorithm!==K)return u(`auth login --key: broker selected an unsupported encryption algorithm`);let f;try{f=await de(i.privateKey,d)}catch(e){return u(`auth login --key: encrypted credential could not be opened — ${x(e)}`)}let p=await C(f);if(p.state!==`verified`)return u(`auth login --key: decrypted credential was neither stored nor acknowledged — ${p.summary}`);let m;try{m=await _(n,{apiKey:p.apiKey,secret:f},`pending`)}catch(e){return u(`auth login --key: credential could not be durably stored — ${x(e)}`)}let h;try{h=await xe(o)}catch(e){return Q(m,!0,`auth login --key: credential was stored and verified, but broker acknowledgment was not confirmed — ${x(e,[o.pollSecret])}`,J)}if(h.status!==`CONSUMED`)return Q(m,!0,`auth login --key: broker returned ${h.status} after acknowledgment`,J);let y=await C(f);if(y.state!==`verified`||!$(y.apiKey,m.credential.apiKey))return Q(m,!0,`auth login --key: broker acknowledgment succeeded, but refreshed credential metadata could not prove the granted lifetime — ${y.summary}`,J);try{let e=await _(n,{apiKey:y.apiKey,secret:f},`active`);return l(`API key stored; authenticated identity and broker acknowledgment verified.`,Z(e,!0),{ids:[e.credential.apiKey.id]})}catch(e){return Q(m,!0,`auth login --key: remote acknowledgment succeeded, but local activation could not be confirmed — ${x(e)}`,J)}}async function be(e){let t=await C(e.credential.secret);if(e.activation!==`pending`)return t.state===`verified`?l(`API key is already stored and its authenticated identity was verified.`,Z(e,!0),{ids:[e.credential.apiKey.id]}):Q(e,!1,`auth login --key: stored credential ${t.state} — ${t.summary}`,`Run \`${q} auth logout\` to revoke/remove it before authorizing a replacement.`);if(t.state===`verified`&&$(t.apiKey,e.credential.apiKey))try{let n=await _(e.host,{apiKey:t.apiKey,secret:e.credential.secret},`active`);return l(`Recovered pending CLI credential: broker acknowledgment had succeeded.`,Z(n,!0),{ids:[n.credential.apiKey.id]})}catch(t){return Q(e,!0,`auth login --key: credential is valid but could not be promoted locally — ${x(t,[e.credential.secret])}`,`The remote key remains valid. Re-run \`${q} auth login --key\` to retry local activation; it will recover the pending credential automatically.`)}if(t.state===`unavailable`||t.state===`verified`&&!e.credential.apiKey.expiresAt)return Q(e,t.state===`verified`,`auth login --key: the stored pending credential acknowledgment could not be verified — ${t.summary}`,t.state===`verified`?`The stored expiry is missing. Both records were preserved; inspect the existing key in your account before deciding how to recover it.`:`The stored record and the remote key were both preserved. Re-run \`${q} auth login --key\` when the API is reachable; it recovers an acknowledged credential and clears an unacknowledged one.`);let n=await re(e);if(n.outcome===`unconfirmed`)return Q(e,!1,`auth login --key: a prior credential is durably stored but broker acknowledgment was not confirmed`,`Remote revocation of the stale pending key was not confirmed — ${n.summary}. Retry when the API is reachable.`);try{await y(e.host)}catch(t){return Q(e,!1,`auth login --key: stale pending credential could not be removed — ${x(t,[e.credential.secret])}`)}return E.write(n.outcome===`revoked`?`Revoked and cleared a stale pending CLI credential; starting a fresh browser authorization.
|
|
1
|
+
import{a as e}from"./package-DEeHDoOT.js";import{A as t,E as n,S as r,_ as i,g as a,i as o,n as s}from"./iso-l1vOidnb.js";import{f as c}from"./env-B0nFdXns.js";import{c as l,r as u}from"./result-envelope-5DwGbGQt.js";import{z as d}from"./tool-policy-BnoDi0Yk.js";import{l as f,s as p}from"./openapi-call-Ch3_9dpf.js";import{i as m}from"./response-problem-B6bUo9co.js";import{a as h,r as ee,t as g}from"./api-target-vxev2RKl.js";import{i as _,n as v,t as y}from"./api-key-credential-CinaNDln.js";import{n as b,t as x}from"./credential-redaction-C08ZVt7t.js";import{c as te,l as ne,n as S}from"./credential-store-DhTI6Vkx.js";import{n as C}from"./api-key-credential-verification-JBxAP14v.js";import{n as w}from"./contract-B6QqVAgo.js";import{t as T}from"./openapi-composites-CO9Q6ihp.js";import{n as re}from"./logout-7Kj-lSJ8.js";import{stderr as E,stdin as ie}from"node:process";import{TextDecoder as ae,inspect as oe}from"node:util";import{hostname as se,platform as ce}from"node:os";import{setTimeout as le}from"node:timers/promises";import{webcrypto as D}from"node:crypto";var O=o([`MACOS`,`LINUX`,`WINDOWS`,`OTHER`]),k=o([`RSA_OAEP_256_A256_GCM_V1`]),A=i({clientLabel:r().regex(/.*\S.*/).min(1).max(120).nullish(),clientPlatform:O.nullish(),encryptionAlgorithm:k.nullish(),encryptionPublicKey:r().min(344).max(12e3).nullish()}),j=32;async function ue(){let e=await D.subtle.generateKey({name:`RSA-OAEP`,modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:`SHA-256`},!0,[`encrypt`,`decrypt`]),t=await D.subtle.exportKey(`spki`,e.publicKey);return{publicKey:Buffer.from(t).toString(`base64`),privateKey:e.privateKey}}async function de(e,t){let{wrappedKey:n,nonce:r,ciphertext:i,authenticationTag:a}=t,o=M(n,`wrapped key`,128,1024),s=M(r,`nonce`,12,12),c=M(i,`ciphertext`,1,65536),l=M(a,`authentication tag`,16,16),u;try{u=await D.subtle.decrypt({name:`RSA-OAEP`},e,o)}catch{throw Error(`broker credential key could not be decrypted`)}let d=new Uint8Array(u);try{if(d.byteLength!==j)throw Error(`broker credential used an invalid AES-256 key`);let e=await D.subtle.importKey(`raw`,d,{name:`AES-GCM`},!1,[`decrypt`]),t=new Uint8Array(c.byteLength+l.byteLength);t.set(c),t.set(l,c.byteLength);let n;try{n=await D.subtle.decrypt({name:`AES-GCM`,iv:s,tagLength:128},e,t)}catch{throw Error(`broker credential payload failed authentication`)}let r=new ae(`utf-8`,{fatal:!0}).decode(n);if(r.trim().length===0)throw Error(`broker returned a blank credential`);return r}finally{d.fill(0)}}function M(e,t,n,r){let i=e.replace(/=+$/u,``),a=Uint8Array.from(Buffer.from(e,`base64`)),o=Buffer.from(a).toString(`base64`).replace(/=+$/u,``);if(i.length===0||o!==i||a.byteLength<n||a.byteLength>r)throw Error(`broker returned an invalid ${t}`);return a}var N=o([`PENDING`,`ISSUING`,`KEY_READY`,`REVOKING`,`CONSUMED`,`REVOKED`,`DENIED`,`EXPIRED`,`FAILED`]),P=o([`Denied by user`,`Authorization request expired`,`CLI authorization expired before acknowledgement`,`Credential issuance recovery revoked an unrecoverable key`,`Revoked by user`,`Clerk create response validation failed`,`Credential issuance failed`,`Credential issuance could not be recovered`,`API-key quota reached`,`Credential issuance lost its database claim`,`Credential delivery encryption failed`,`Credential issuance finalization was lost`]),F=i({approvedAt:s({offset:!0}).nullish(),clientLabel:r(),clientPlatform:O,comparisonCode:r(),consumedAt:s({offset:!0}).nullish(),createdAt:s({offset:!0}),expiresAt:s({offset:!0}),id:n(),intervalSeconds:a().int().min(1),keyReadyAt:s({offset:!0}).nullish(),status:N,terminalAt:s({offset:!0}).nullish(),terminalReason:P.nullish(),updatedAt:s({offset:!0})}),I=i({algorithm:k,authenticationTag:r(),ciphertext:r(),nonce:r(),wrappedKey:r()}),L=i({delivery:I.nullish(),expiresAt:s({offset:!0}),status:N,terminalReason:P.nullish()}),R=i({comparisonCode:r(),expiresAt:s({offset:!0}),id:n(),intervalSeconds:a().int().min(1),pollSecret:r(),verificationUrl:r()}),z=w(T,`start`),B=w(T,`poll`),V=w(T,`acknowledge`),H=class extends Error{httpStatus;retryAfterSeconds;retryable;constructor(e,t,n=[]){super(`CLI authorization ${e} failed: ${b(t,n)}`),this.name=`CliAuthorizationRequestError`,this.httpStatus=t.status,this.retryAfterSeconds=he(t.retryAfterSeconds),this.retryable=t.status>=500||t.status===429}},U=class extends Error{constructor(e,t,n=[]){super(`CLI authorization ${e} transport failed: ${x(t,n)}`,{cause:t}),this.name=`CliAuthorizationTransportError`}};async function fe(e){let t=await p(h(c()),{method:z.method,path:d(z.path,{},z.operationId),headers:{},contentType:`application/json`,body:e},R);if(t.ok&&t.redirect)throw new H(`start`,G(t.status));if(!t.ok)throw new H(`start`,t.problem);return ge(t.data)}async function W(e,t){let n=f(B.operationId),r=await p(h(c()),{method:B.method,path:d(B.path,{cliAuthorizationId:e},B.operationId),headers:{[n]:t}},L);if(r.ok&&r.redirect)throw new H(`poll`,G(r.status),[t]);if(!r.ok)throw new H(`poll`,r.problem,[t]);return{authorization:r.data,retryAfterSeconds:me(r.headers[`retry-after`])}}async function pe(e,t){let n=f(V.operationId),r;try{r=await p(h(c()),{method:V.method,path:d(V.path,{cliAuthorizationId:e},V.operationId),headers:{[n]:t}},F)}catch(e){throw new U(`acknowledge`,e,[t])}if(r.ok&&r.redirect)throw new H(`acknowledge`,G(r.status),[t]);if(!r.ok)throw new H(`acknowledge`,r.problem,[t]);return r.data}function me(e){if(e===void 0)return null;let t=Number(e);return Number.isInteger(t)&&t>0?t:null}function he(e){return typeof e==`number`&&Number.isInteger(e)&&e>0?e:null}function G(e){return{status:e,title:`Unexpected redirect`,type:`about:blank`,code:void 0,detail:`CLI authorization endpoint returned an unexpected redirect`}}function ge(e){let{verificationUrl:t,pollSecret:n,...r}=e,i={...e},a=()=>({...r,verificationUrl:`<redacted>`,pollSecret:`<redacted>`});return Object.defineProperties(i,{verificationUrl:{enumerable:!1,get:()=>t},pollSecret:{enumerable:!1,get:()=>n},toJSON:{enumerable:!1,value:a},toString:{enumerable:!1,value:()=>`CliAuthorizationStart(${JSON.stringify(a())})`},[oe.custom]:{enumerable:!1,value:a}})}var K=`RSA_OAEP_256_A256_GCM_V1`,_e=1,ve=30,q=e().bin[0],J=`The local record remains pending and unavailable to ordinary commands. Re-run \`${q} auth login --key\`; it recovers the credential when the broker acknowledged it, and otherwise clears the stale record.`;async function ye(e){if(!ie.isTTY)return u(`${q} auth login --key requires an interactive TTY on stdin`,[`For non-interactive automation, inject AUTH_TOKEN through the environment.`]);let n,r;try{let e=c().host;n=ee(e),r=g(e)}catch(e){return u(`auth login --key: invalid environment configuration — ${x(e)}`)}for(;;){let e;try{e=await v(n)}catch(e){return u(`auth login --key: credential storage could not be inspected — ${x(e)}`)}if(e.state===`unavailable`)return u(`auth login --key: ${e.summary}`,[`Make the OS keyring or the CLI config directory writable, or use AUTH_TOKEN from the environment.`]);if(e.state===`missing`){let t=S(e.keyringFailure);t!==null&&E.write(t);break}let t=await be(e.stored);if(t!==null)return t}let i;try{i=await ue()}catch(e){return u(`auth login --key: ephemeral encryption key could not be created — ${x(e)}`)}let a=A.safeParse({clientLabel:e.clientLabel?.trim()||(se().trim()||q).slice(0,120),clientPlatform:we(),encryptionAlgorithm:K,encryptionPublicKey:i.publicKey});if(!a.success)return u(`auth login --key: ${t(a.error)}`);let o;try{o=await fe(a.data)}catch(e){return u(`auth login --key: could not start browser authorization — ${x(e)}`)}let s;try{s=ne(o,r)}catch(e){return u(`auth login --key: unsafe browser authorization URL rejected — ${x(e)}`)}if(!Ce(await te(o,r,{noBrowser:e.noBrowser}),o,s))return u(`auth login --key: browser authorization requires an interactive terminal for manual handoff`,[`Automatic browser opening did not complete, and the approval URL was withheld because stderr is not an interactive terminal. Retry from an interactive terminal.`],{references:[s]});let d;try{d=await Se(o)}catch(e){return u(`auth login --key: authorization did not complete — ${x(e)}`,[],{references:[s]})}if(d.algorithm!==K)return u(`auth login --key: broker selected an unsupported encryption algorithm`);let f;try{f=await de(i.privateKey,d)}catch(e){return u(`auth login --key: encrypted credential could not be opened — ${x(e)}`)}let p=await C(f);if(p.state!==`verified`)return u(`auth login --key: decrypted credential was neither stored nor acknowledged — ${p.summary}`);let m;try{m=await _(n,{apiKey:p.apiKey,secret:f},`pending`)}catch(e){return u(`auth login --key: credential could not be durably stored — ${x(e)}`)}let h;try{h=await xe(o)}catch(e){return Q(m,!0,`auth login --key: credential was stored and verified, but broker acknowledgment was not confirmed — ${x(e,[o.pollSecret])}`,J)}if(h.status!==`CONSUMED`)return Q(m,!0,`auth login --key: broker returned ${h.status} after acknowledgment`,J);let y=await C(f);if(y.state!==`verified`||!$(y.apiKey,m.credential.apiKey))return Q(m,!0,`auth login --key: broker acknowledgment succeeded, but refreshed credential metadata could not prove the granted lifetime — ${y.summary}`,J);try{let e=await _(n,{apiKey:y.apiKey,secret:f},`active`);return l(`API key stored; authenticated identity and broker acknowledgment verified.`,Z(e,!0),{ids:[e.credential.apiKey.id]})}catch(e){return Q(m,!0,`auth login --key: remote acknowledgment succeeded, but local activation could not be confirmed — ${x(e)}`,J)}}async function be(e){let t=await C(e.credential.secret);if(e.activation!==`pending`)return t.state===`verified`?l(`API key is already stored and its authenticated identity was verified.`,Z(e,!0),{ids:[e.credential.apiKey.id]}):Q(e,!1,`auth login --key: stored credential ${t.state} — ${t.summary}`,`Run \`${q} auth logout\` to revoke/remove it before authorizing a replacement.`);if(t.state===`verified`&&$(t.apiKey,e.credential.apiKey))try{let n=await _(e.host,{apiKey:t.apiKey,secret:e.credential.secret},`active`);return l(`Recovered pending CLI credential: broker acknowledgment had succeeded.`,Z(n,!0),{ids:[n.credential.apiKey.id]})}catch(t){return Q(e,!0,`auth login --key: credential is valid but could not be promoted locally — ${x(t,[e.credential.secret])}`,`The remote key remains valid. Re-run \`${q} auth login --key\` to retry local activation; it will recover the pending credential automatically.`)}if(t.state===`unavailable`||t.state===`verified`&&!e.credential.apiKey.expiresAt)return Q(e,t.state===`verified`,`auth login --key: the stored pending credential acknowledgment could not be verified — ${t.summary}`,t.state===`verified`?`The stored expiry is missing. Both records were preserved; inspect the existing key in your account before deciding how to recover it.`:`The stored record and the remote key were both preserved. Re-run \`${q} auth login --key\` when the API is reachable; it recovers an acknowledged credential and clears an unacknowledged one.`);let n=await re(e);if(n.outcome===`unconfirmed`)return Q(e,!1,`auth login --key: a prior credential is durably stored but broker acknowledgment was not confirmed`,`Remote revocation of the stale pending key was not confirmed — ${n.summary}. Retry when the API is reachable.`);try{await y(e.host)}catch(t){return Q(e,!1,`auth login --key: stale pending credential could not be removed — ${x(t,[e.credential.secret])}`)}return E.write(n.outcome===`revoked`?`Revoked and cleared a stale pending CLI credential; starting a fresh browser authorization.
|
|
2
2
|
`:`Cleared a stale pending CLI credential whose remote key can no longer authenticate; starting a fresh browser authorization.
|
|
3
3
|
`),null}async function xe(e){let t=new Date(e.expiresAt).getTime(),n=Y(e.intervalSeconds);for(;;)try{return await pe(e.id,e.pollSecret)}catch(e){if(e instanceof H){if(!e.retryable)throw e;n=Y(e.retryAfterSeconds??n)}else if(!(e instanceof U))throw e;if(Date.now()>=t)throw e;E.write(`Broker acknowledgment was interrupted; retrying.
|
|
4
4
|
`),await X(n,t)}}async function Se(e){let t=new Date(e.expiresAt).getTime(),n=Y(e.intervalSeconds),r;for(E.write(`Waiting for browser approval...
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{r as resolveAuthStatus}from"./auth-resolver-BtalY5VS.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./env-
|
|
1
|
+
import{t as e}from"./env-B0nFdXns.js";import{join as t}from"node:path";import{homedir as n,platform as r}from"node:os";function i(){if(r()===`win32`){let e=process.env.APPDATA??t(n(),`AppData`,`Roaming`);return t(e,`aventure`,`config.json`)}let e=process.env.XDG_CONFIG_HOME??t(n(),`.config`);return t(e,`aventure`,`config.json`)}function a(){let t=process.env[e.authToken];return typeof t==`string`&&t.length>0?{present:!0,source:`env`}:{present:!1,source:null}}function o(e,t){return typeof e==`object`&&!!e&&`code`in e&&e.code===t}export{o as n,a as r,i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{n as apiHostCheck,r as authStatusReport,i as checkResult,a as environmentChecks}from"./auth-status-check-
|
|
1
|
+
export{n as apiHostCheck,r as authStatusReport,i as checkResult,a as environmentChecks}from"./auth-status-check-Qbwb8xdt.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./package-DEeHDoOT.js";import{t}from"./credential-redaction-
|
|
1
|
+
import{a as e}from"./package-DEeHDoOT.js";import{t}from"./credential-redaction-C08ZVt7t.js";import{n,t as r}from"./openapi-commands-uJK9O6E-.js";var i=[{name:`cli-version`,purpose:`running CLI against the latest published release`},{name:`api-schemas`,purpose:`the installed @aventurevc/api-schemas contracts resolve`},{name:`api-host`,purpose:`the selected API host answers GET /info`},{name:`auth`,purpose:`a credential materialized for the next command, never its secret`},{name:`catalog`,purpose:`this CLI knows every operation the API serves`}];function a(e,t,n){return{name:e,status:t,message:n}}async function o(e){let t=l(),n=await u(e),[r,i]=await Promise.all([d(e),t===void 0?null:f(t)]);return{cliVersion:n.check,apiSchemas:r,catalog:m(i,n.upgradeAvailable,e)}}function s(e,t,n){return e.ok?a(`api-host`,`pass`,`GET /info answered at ${t}.`):a(`api-host`,`fail`,e.httpStatus===401?`Replace or unset the credential ${t} rejected, or run \`${n} auth login\`, then rerun \`${n} auth status\` — GET /info returned ${e.summary}.`:`Point the CLI at a reachable API host with \`--environment <name>\` or API_URL, then rerun \`${n} auth status\` — GET /info at ${t} returned ${e.summary}.`)}function c(e,t,n){let r=[e.cliVersion,e.apiSchemas,t,n,e.catalog];return{ok:r.every(e=>e.status!==`fail`),check:r}}function l(){return r.find(e=>e.intent===`status`&&e.resource===`status`)}async function u(t){let{runUpdate:n}=await import(`./builtin-update-CV7SpXd8.js`),r=e(),i=n(r,`check`);if(!i.ok||i.data===null)return{check:a(`cli-version`,`skip`,`Could not compare ${r.version} against the registry (${i.summary}); rerun \`${t} update\` with registry access.`),upgradeAvailable:null};let{targetPackage:o,currentVersion:s,latestVersion:c,upgradeAvailable:l}=i.data;return{check:l?a(`cli-version`,`fail`,`Upgrade ${o} from ${s} to ${c}: run \`${t} update\`.`):a(`cli-version`,`pass`,`${o} ${s} matches the latest published release.`),upgradeAvailable:l}}async function d(e){try{let{EntityDetailSchema:e}=await import(`./detail-BqAHgqyx.js`);if(typeof e.safeParse!=`function`)throw Error(`EntityDetailSchema does not expose a Zod parser`);return a(`api-schemas`,`pass`,`Installed @aventurevc/api-schemas contracts resolve beyond the CLI startup path.`)}catch(n){return a(`api-schemas`,`fail`,`Reinstall the CLI: run \`${e} update\` — ${t(n)}.`)}}async function f(e){let{runOpenApiCall:n}=await import(`./openapi-call-Cexzbbt7.js`),r=`${e.method} ${e.path}`;try{let t=await n({method:e.method,path:e.path,auth:e.auth,responseFormat:`json`});if(!t.ok)return{unread:`${r} returned ${t.summary}`};let i=p(t.data);return i===null?{unread:`${r} carried no operationFingerprint`}:{fingerprint:i}}catch(e){return{unread:`${r} failed: ${t(e)}`}}}function p(e){if(typeof e!=`object`||!e||e instanceof Uint8Array)return null;let{response:t}=e;if(typeof t!=`object`||!t||Array.isArray(t))return null;let n=t.operationFingerprint;return typeof n==`string`&&n.length>0?n:null}function m(e,t,i){let o=r.length;if(e===null)return a(`catalog`,`skip`,`The public catalog omits deployment-status metadata and holds ${o} operations.`);if(`unread`in e)return a(`catalog`,`skip`,`Could not read the served operation fingerprint (${e.unread}), so drift is unproven; this catalog holds ${o} operations at ${n}.`);let s=e.fingerprint;if(s===`51e0cd588ec6b461`)return a(`catalog`,`pass`,`${o} generated operations match the set the API serves (${n}).`);let c=`This catalog describes a different operation set than the API serves (${n} vs ${s})`;return t===!0?a(`catalog`,`fail`,`${c}: run \`${i} update\`.`):a(`catalog`,`skip`,t===!1?`${c}, and this CLI is already the latest published release: either the deployed API is older than this CLI, or a newer CLI has not been published yet.`:`${c}, and the registry did not answer, so it is unknown whether a newer release describes it: rerun \`${i} update\` with registry access.`)}export{o as a,a as i,s as n,c as r,i as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as e,t}from"./env-
|
|
1
|
+
import{f as e,t}from"./env-B0nFdXns.js";import{r as n}from"./auth-resolver-BtalY5VS.js";import{c as r,i}from"./openapi-call-Ch3_9dpf.js";import{a,i as o}from"./response-problem-B6bUo9co.js";import{t as s}from"./credential-redaction-C08ZVt7t.js";import{t as c}from"./api-key-bearer-credential-B3se_F1i.js";import{a as l,f as u,l as d,s as f}from"./oauth-credential-sVZgsb1B.js";import{t as p}from"./oauth-bearer-credential-Bo4Batar.js";async function m(){return null}async function h(e){let t=null,n=e=>{t=e};try{await p(e,n),await c(n)}catch(e){return{materialized:t,failure:s(e)}}return{materialized:t,failure:null}}async function g(e,t,n,r){if(r.failure!==null)return{scope:e,selected:null,identity:null,authorization:null,error:r.failure};let a=null,o=null,c,l=e=>{c=e,o=_(e.credential,r.materialized)};try{let t=await i({method:`POST`,path:`/v1/auth/me/permissions`,body:{operation:[]},auth:e,requesterScope:e,responseFormat:`json`,onAuthPrepared:l});if(!t.ok)throw Error(v(t));if(o===null)throw Error(`Live permission probe did not prepare a credential`);if(a=S(t.data),e===`read`)return{scope:e,selected:o,identity:null,authorization:a,error:null};if(c===void 0)throw Error(`Live permission probe did not retain its prepared credential`);let n=await m(e,c);return{scope:e,selected:o,identity:n,authorization:a,error:null}}catch(r){return{scope:e,selected:o,identity:null,authorization:a,error:s(r,y(t,n,c))}}}function _(e,t){if(e===null)return null;let r=t??n().source;if(r===null)throw Error(`Prepared credential has no local provenance`);return{credential:e,source:r}}function v(e){return[e.summary,...e.warnings].join(` — `)}function y(t,n,r){return[e().userBearerToken,...a(r?.headers??{}),...t.state===`found`?u(t.stored.credential.tokens):[],n.state===`found`?n.stored.credential.secret:void 0]}function b(e,t,n=null){let r=t.state===`found`?t.stored:void 0,i=r?.credential.apiKey.expiresAt??null;return{host:e,present:r!==void 0,provider:r?.provider??null,activation:r?.activation??null,apiKeyId:r?.credential.apiKey.id??null,subject:r?.credential.apiKey.subject??null,scope:r?.credential.apiKey.scopes??[],name:r===void 0?null:o(r.credential.apiKey.name,[r.credential.secret]),status:r?.credential.apiKey.status??null,expiresAt:i,metadataSource:r===void 0?null:n?.state===`verified`?`clerk`:`store-cache`,live:n===null?null:{state:n.state,summary:n.summary},expiresInDay:w(i),storageFailure:t.state===`unavailable`?t.summary:null,keyringFailure:t.state===`missing`?t.keyringFailure??null:null,error:t.state===`invalid`?t.summary:null}}function x(e,t){let n=t.state===`found`?t.stored:void 0;return{host:e,present:n!==void 0,provider:n?.provider??null,expiresAt:n?.credential.expiresAt??null,expired:n===void 0?null:l(n.credential),renewable:n===void 0?null:n.credential.tokens.refresh_token!==void 0,identity:n===void 0?null:d(n.credential),client:n?.credential.client??null,storageFailure:t.state===`unavailable`?t.summary:null,keyringFailure:t.state===`missing`?t.keyringFailure??null:null,error:t.state===`invalid`?t.summary:null}}function S(e){if(typeof e!=`object`||!e||e instanceof Uint8Array)throw Error(`permission probe returned no JSON response`);let t=r.safeParse(e.response);if(!t.success)throw t.error;return t.data}var C=864e5;function w(e){if(e===null)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:Math.round((t-Date.now())/C)}var T=7;function E(e){return e===null?`none`:e.length<=11?e:`${e.slice(0,T)}\u2026${e.slice(-4)}`}var D=13,O=14;function k(e){return[``,`${e.cliName} ${e.cliVersion} \u2192 ${e.apiKey.host}`+(e.apiVersion===null?` (api build unavailable)`:` (api ${e.apiVersion})`),``,...N(e.oauth,e.cliName,e.refresh),...F(e.apiKey,e.oauth,e.cliName),``,j(`Providers`,R(e.providers)),j(`Environment`,z(e.resolved)),j(`Selected`,B(e.resolved,e.refresh,e.cliName)),...A(e.live)].join(`
|
|
2
2
|
`)}function A(e){if(e===null)return[];let t=M(`local credential provenance was captured before verification`);if(e.error!==null)return[``,j(`Live probe`,`${e.scope} permission probe failed`),t,M(e.error)];if(e.authorization===null)return[];let n=e.authorization.permissionGrant,r=e.identity;return[``,j(`Live probe`,`${e.scope} permission probe succeeded`),t,M(`operation access ${e.authorization.operationAccess}; ${n.role.length} role; ${n.permission.length} permission`),...r===null?[M(e.scope===`read`?`identity not requested for a read-scope credential`:`identity unavailable in this build`)]:[j(`Live account`,r.nameFull??r.email??r.clerkUserId??r.id)],M(`no API operation was executed or individually authorized`)]}function j(e,t){return` ${e.padEnd(D)}${t}`}function M(e){return` ${``.padEnd(D)}${e}`}function N(e,t,n){switch(e.state){case`found`:{let{credential:r,provider:i}=e.stored,a=d(r);return[j(`OAuth`,`${a.email??a.subject??`unknown identity`} via ${i}`),M(P(r,t,n))]}case`missing`:return[j(`OAuth`,`none stored`),...e.keyringFailure===void 0?[]:[M(`OS keyring unusable — login stores to file: ${e.keyringFailure}`)]];case`unavailable`:return[j(`OAuth`,`storage unavailable: ${e.summary}`)];case`invalid`:return[j(`OAuth`,`stored credential invalid: ${e.summary}`)];default:throw Error(`Unsupported OAuth credential state`)}}function P(e,t,n){return l(e)?e.tokens.refresh_token===void 0?`access token expired — run \`${t} auth login\``:n.failure===null?n.materialized===`api-key`?`access token expired and renewal failed; the API key is in use — \`${t} auth login\` renews OAuth`:`access token expired — not renewed while AUTH_TOKEN is set in the environment`:`access token expired — ${n.failure}`:`access token valid until ${e.expiresAt}`}function F(e,t,n){if(!e.present){if(t.state===`found`)return[];let r=e.storageFailure??(t.state===`unavailable`?t.summary:null);return r===null?[j(`Signed in`,`no \u2014 run \`${n} auth login\``),...e.error===null?[]:[M(`stored credential invalid: ${e.error}`)]]:[j(`Signed in`,`credential storage unavailable`),M(r)]}return[j(t.state===`found`?`API key`:`Signed in`,e.subject??`unknown subject`),M(`via ${e.provider??`unknown store`}`),j(`Key`,`${e.name??`unnamed`} ${E(e.apiKeyId)}`),...I(e,n),j(`Scopes`,e.scope.length===0?`none`:e.scope.join(`, `))]}function I(e,t){let n=e.live,r=e.expiresInDay,i=e.expiresAt;if(n?.state===`invalid`)return[j(`Key state`,`rejected by aVenture sign-in \u2014 ${n.summary}`),M(`run \`${t} auth logout\`, then \`${t} auth login --key\``)];let a=n?.state===`verified`;return[j(`Key state`,a?`${e.status??`unknown`}, verified by aVenture sign-in now`:`${e.status??`unknown`} when stored`),...i===null||r===null?[M(`no expiry recorded`)]:[M(L(i,r,a?`expires`:`cached expiry`))],...a?[]:[M(n===null?"aVenture sign-in owns the live verdict — `auth status` re-checks it":`aVenture sign-in could not be reached \u2014 ${n.summary}`)]]}function L(e,t,n){let r=e.slice(0,10);return new Date(e).getTime()<=Date.now()?`${n} ${r} passed ${Math.abs(t)}d ago`:t<=O?`${n} ${r}, ${t}d away`:`${n} ${r}`}function R(e){if(e.state===`unavailable`)return`unavailable: ${e.summary}`;let t=e.catalog.oauthClient;return[e.catalog.clerkPublishableKey?`browser sign-in`:`no browser sign-in`,t?`oauth ${f(t).host} client ${t.clientId}`:`no OAuth CLI client`].join(`; `)}function z(e){return`${t.authToken}=${e.present?e.source??`resolved`:`unset`}`}function B(e,n,r){return e.present||n.materialized===`env`?`${t.authToken} from the environment`:n.materialized===`oauth`?`saved OAuth access token`:n.materialized===`api-key`?`saved API key`:`none \u2014 sign in with \`${r} auth login\``}export{b as apiKeyCredentialDiagnostics,g as inspectLiveAuth,x as oauthCredentialDiagnostics,h as refreshCliCredentials,k as renderAuthStatus};
|