goto-assistant 0.1.4 → 0.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "goto-assistant",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Lightweight, self-hosted personal AI assistant",
5
5
  "license": "MIT",
6
6
  "packageManager": "pnpm@10.29.3",
package/public/setup.html CHANGED
@@ -81,7 +81,7 @@
81
81
  // Thin wrapper that passes mutable state to the extracted syncCronConfig
82
82
  function doSyncCronConfig() {
83
83
  servers = readServers();
84
- servers = syncCronConfig(servers, isEditing, buildCronConfig);
84
+ servers = syncCronConfig(servers, isEditing, buildCronConfig, window._savedConfig);
85
85
  renderServers(servers);
86
86
  }
87
87
 
package/public/setup.js CHANGED
@@ -72,7 +72,7 @@ function readServers() {
72
72
  // Sync cron server config. Takes servers array, isEditing flag, and buildCronConfigFn.
73
73
  // Returns updated servers array (mutates in place for convenience, also returns).
74
74
  // eslint-disable-next-line no-unused-vars
75
- function syncCronConfig(servers, isEditing, buildCronConfigFn) {
75
+ function syncCronConfig(servers, isEditing, buildCronConfigFn, savedConfig) {
76
76
  var cron = servers.find(function (s) { return s.name === 'cron'; });
77
77
  if (!cron) return servers;
78
78
 
@@ -98,9 +98,14 @@ function syncCronConfig(servers, isEditing, buildCronConfigFn) {
98
98
  oldKeys.forEach(function (k) { delete cron.env[k]; });
99
99
  cron.env[result.envKey] = result.envValue;
100
100
  } else if (oldKeys.length > 0 && oldKeys[0] !== result.envKey) {
101
- var existingValue = cron.env[oldKeys[0]];
101
+ // Use the target provider's masked key from savedConfig when available
102
+ var targetValue = cron.env[oldKeys[0]];
103
+ if (savedConfig) {
104
+ var pc = savedConfig[provider] || {};
105
+ if (pc.apiKey) targetValue = pc.apiKey;
106
+ }
102
107
  oldKeys.forEach(function (k) { delete cron.env[k]; });
103
- cron.env[result.envKey] = existingValue;
108
+ cron.env[result.envKey] = targetValue;
104
109
  }
105
110
 
106
111
  return servers;