@primitive.ai/prim 0.1.0-alpha.25 → 0.1.0-alpha.26

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/dist/index.js +8 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -472,13 +472,16 @@ function applyStatusLine(settings) {
472
472
  function applyPermissions(settings) {
473
473
  const permissions = settings.permissions ?? {};
474
474
  const allow = permissions.allow ?? [];
475
- const withoutPrim = allow.filter((rule) => !ALL_PRIM_PERMISSION_RULES.has(rule));
476
- const nextAllow = [...withoutPrim, PRIM_PERMISSION_RULE];
477
- const unchanged = allow.length === nextAllow.length && allow.every((rule, i) => rule === nextAllow[i]);
478
- if (unchanged) {
475
+ const hasCanonical = allow.includes(PRIM_PERMISSION_RULE);
476
+ const hasLegacy = allow.some((rule) => LEGACY_PRIM_PERMISSION_RULES.includes(rule));
477
+ if (hasCanonical && !hasLegacy) {
479
478
  return settings;
480
479
  }
481
- return { ...settings, permissions: { ...permissions, allow: nextAllow } };
480
+ const withoutPrim = allow.filter((rule) => !ALL_PRIM_PERMISSION_RULES.has(rule));
481
+ return {
482
+ ...settings,
483
+ permissions: { ...permissions, allow: [...withoutPrim, PRIM_PERMISSION_RULE] }
484
+ };
482
485
  }
483
486
  function removePrimPermission(settings) {
484
487
  const permissions = settings.permissions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primitive.ai/prim",
3
- "version": "0.1.0-alpha.25",
3
+ "version": "0.1.0-alpha.26",
4
4
  "description": "CLI for Primitive's decision graph — passive decision capture, conflict gate, and team presence",
5
5
  "type": "module",
6
6
  "license": "MIT",