axauth 1.7.1 → 1.7.2
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/auth/adapter.d.ts
CHANGED
|
@@ -72,8 +72,8 @@ interface RemoveOptions {
|
|
|
72
72
|
* - Either option specifies where to look for credentials
|
|
73
73
|
*
|
|
74
74
|
* **Agents with separation** (OpenCode):
|
|
75
|
-
* - `dataDir`
|
|
76
|
-
* - If only `configDir` provided,
|
|
75
|
+
* - `dataDir` must be provided to specify where credentials are stored
|
|
76
|
+
* - If only `configDir` is provided, returns undefined (use extractRawCredentials() for default location)
|
|
77
77
|
*/
|
|
78
78
|
interface ExtractOptions {
|
|
79
79
|
/** Custom config directory for settings/preferences */
|
|
@@ -80,12 +80,12 @@ const opencodeAdapter = {
|
|
|
80
80
|
return { agent: AGENT_ID, type: "oauth", data: auth };
|
|
81
81
|
},
|
|
82
82
|
extractRawCredentialsFromDirectory(options) {
|
|
83
|
-
// OpenCode stores credentials in dataDir
|
|
84
|
-
|
|
85
|
-
if (!
|
|
83
|
+
// OpenCode stores credentials in dataDir only - configDir is for settings
|
|
84
|
+
// If dataDir not provided, return undefined (use extractRawCredentials() for default)
|
|
85
|
+
if (!options.dataDir)
|
|
86
86
|
return undefined;
|
|
87
87
|
// Only return if there's at least one provider
|
|
88
|
-
return extractCredsFromDirectory(AGENT_ID,
|
|
88
|
+
return extractCredsFromDirectory(AGENT_ID, options.dataDir, CREDS_FILE_NAME, (data) => (Object.keys(data).length > 0 ? data : undefined));
|
|
89
89
|
},
|
|
90
90
|
installCredentials(creds, options) {
|
|
91
91
|
// Resolve custom directory with validation (OpenCode supports separation)
|