portable-agent-layer 0.79.0 → 0.79.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/targets/lib.ts +13 -47
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "portable-agent-layer",
3
- "version": "0.79.0",
3
+ "version": "0.79.1",
4
4
  "description": "PAL — Portable Agent Layer: persistent personal context for AI coding assistants",
5
5
  "type": "module",
6
6
  "bin": {
@@ -155,6 +155,15 @@ export function loadSettingsTemplate(templatePath: string, pkgRoot: string): Set
155
155
  * - permissions.allow: deduplicate by value
156
156
  * - other keys: template values are added if not already present
157
157
  */
158
+ /** Set by the template on first install; after that the user's value wins. */
159
+ const USER_OWNED_SETTINGS = [
160
+ "attribution",
161
+ "showClearContextOnPlanAccept",
162
+ "respectGitignore",
163
+ "spinnerTipsEnabled",
164
+ "autoMemoryEnabled",
165
+ ] as const;
166
+
158
167
  export function mergeSettings(existing: Settings, template: Settings): Settings {
159
168
  const result = { ...existing };
160
169
 
@@ -220,32 +229,8 @@ export function mergeSettings(existing: Settings, template: Settings): Settings
220
229
  }
221
230
  }
222
231
 
223
- // Merge attribution (object with commit/pr keys, add if not present)
224
- if (template.attribution && typeof template.attribution === "object") {
225
- if (!("attribution" in result)) {
226
- result.attribution = template.attribution;
227
- }
228
- }
229
-
230
- // Merge showClearContextOnPlanAccept (boolean, add if not present)
231
- if ("showClearContextOnPlanAccept" in template) {
232
- if (!("showClearContextOnPlanAccept" in result)) {
233
- result.showClearContextOnPlanAccept = template.showClearContextOnPlanAccept;
234
- }
235
- }
236
-
237
- // Merge respectGitignore (boolean, add if not present)
238
- if ("respectGitignore" in template) {
239
- if (!("respectGitignore" in result)) {
240
- result.respectGitignore = template.respectGitignore;
241
- }
242
- }
243
-
244
- // Merge spinnerTipsEnabled (boolean, add if not present)
245
- if ("spinnerTipsEnabled" in template) {
246
- if (!("spinnerTipsEnabled" in result)) {
247
- result.spinnerTipsEnabled = template.spinnerTipsEnabled;
248
- }
232
+ for (const key of USER_OWNED_SETTINGS) {
233
+ if (key in template && !(key in result)) result[key] = template[key];
249
234
  }
250
235
 
251
236
  // Merge spinnerTipsOverride (merge tips array, deduplicate by content)
@@ -322,27 +307,8 @@ export function unmergeSettings(existing: Settings, template: Settings): Setting
322
307
  if (Object.keys(result.skillOverrides).length === 0) delete result.skillOverrides;
323
308
  }
324
309
 
325
- // Remove PAL attribution if it matches template structure
326
- if (template.attribution && "attribution" in result) {
327
- delete result.attribution;
328
- }
329
-
330
- // Remove PAL showClearContextOnPlanAccept
331
- if (
332
- "showClearContextOnPlanAccept" in template &&
333
- "showClearContextOnPlanAccept" in result
334
- ) {
335
- delete result.showClearContextOnPlanAccept;
336
- }
337
-
338
- // Remove PAL respectGitignore
339
- if ("respectGitignore" in template && "respectGitignore" in result) {
340
- delete result.respectGitignore;
341
- }
342
-
343
- // Remove PAL spinnerTipsEnabled
344
- if ("spinnerTipsEnabled" in template && "spinnerTipsEnabled" in result) {
345
- delete result.spinnerTipsEnabled;
310
+ for (const key of USER_OWNED_SETTINGS) {
311
+ if (key in template) delete result[key];
346
312
  }
347
313
 
348
314
  // Remove PAL spinnerTipsOverride (remove only template tips, preserve user tips)