@xynogen/pix-runtime 0.4.0 → 0.4.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/DESIGN.md CHANGED
@@ -132,7 +132,6 @@ interface PixConfigV1 {
132
132
  optimizer: {
133
133
  caveman: "off" | "lite" | "full" | "ultra" | "micro"; // default off
134
134
  rtk: "off" | "on"; // default on
135
- toon: "off" | "on"; // default on
136
135
  ponytail: "off" | "lite" | "full" | "ultra"; // default off
137
136
  };
138
137
  gate: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xynogen/pix-runtime",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Pix shared runtime — versioned pix.json config, atomic persistence, typed change events",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/src/migrations.ts CHANGED
@@ -25,7 +25,7 @@ const LEGACY_DIFF_COLOR_KEYS = [
25
25
  "fgDel",
26
26
  ] as const;
27
27
 
28
- const OPTIMIZER_KEYS = ["caveman", "rtk", "toon", "ponytail"] as const;
28
+ const OPTIMIZER_KEYS = ["caveman", "rtk", "ponytail"] as const;
29
29
 
30
30
  export interface MigrationResult {
31
31
  document: RawDocument;
@@ -80,6 +80,14 @@ export function migrate(input: RawDocument, ctx: ParseContext): MigrationResult
80
80
  doc.pretty = pretty;
81
81
  }
82
82
 
83
+ // TOON is now an on-demand pix-skills capability, not optimizer state.
84
+ if (isObj(doc.optimizer) && "toon" in doc.optimizer) {
85
+ doc.optimizer = Object.fromEntries(
86
+ Object.entries(doc.optimizer).filter(([key]) => key !== "toon"),
87
+ );
88
+ changed = true;
89
+ }
90
+
83
91
  if (doc.$version !== CONFIG_FORMAT_VERSION) {
84
92
  doc.$version = CONFIG_FORMAT_VERSION;
85
93
  changed = true;
@@ -128,6 +136,7 @@ export function importOptimizerSidecar(
128
136
  }
129
137
  if (changed) doc.optimizer = existing;
130
138
 
139
+ const hasLegacyToon = typeof raw.toon === "string";
131
140
  const archive = () => {
132
141
  let target = `${sidecarPath}.migrated-v1`;
133
142
  if (existsSync(target)) target = `${target}.${Date.now()}`;
@@ -138,5 +147,5 @@ export function importOptimizerSidecar(
138
147
  }
139
148
  };
140
149
 
141
- return { changed, archive };
150
+ return { changed: changed || hasLegacyToon, archive };
142
151
  }
@@ -129,6 +129,9 @@ export function registerPixCommand(pi: ExtensionAPI, runtime: PixRuntime): void
129
129
  kb: KeybindingsManager,
130
130
  done: (v: null) => void,
131
131
  ) => {
132
+ const guide = (key: string, action: string) =>
133
+ theme.fg("text", key) + theme.fg("dim", ` ${action}`);
134
+ const guideSep = theme.fg("dim", " · ");
132
135
  let selected = 0;
133
136
  let bodyOffset = 0;
134
137
  let visibleBodyLines = 1;
@@ -177,7 +180,13 @@ export function registerPixCommand(pi: ExtensionAPI, runtime: PixRuntime): void
177
180
  body,
178
181
  footer: [
179
182
  "",
180
- theme.fg("dim", "←→ change · ↑↓ move · PgUp/PgDn inspect · esc close"),
183
+ guide("←→", "change") +
184
+ guideSep +
185
+ guide("↑↓", "move") +
186
+ guideSep +
187
+ guide("PgUp/PgDn", "inspect") +
188
+ guideSep +
189
+ guide("esc", "close"),
181
190
  ],
182
191
  bodyOffset,
183
192
  selectedBodyLine: inspectingPage ? undefined : settingBodyLines[selected],
@@ -7,7 +7,6 @@ export type Toggle = "off" | "on";
7
7
  export interface OptimizerConfig {
8
8
  caveman: CavemanLevel;
9
9
  rtk: Toggle;
10
- toon: Toggle;
11
10
  ponytail: PonytailLevel;
12
11
  }
13
12
 
@@ -18,7 +17,6 @@ const TOGGLE: readonly Toggle[] = ["off", "on"];
18
17
  const DEFAULTS: Readonly<OptimizerConfig> = {
19
18
  caveman: "off",
20
19
  rtk: "on",
21
- toon: "on",
22
20
  ponytail: "off",
23
21
  };
24
22
 
@@ -30,7 +28,6 @@ export const optimizerSection = defineSection<"optimizer", OptimizerConfig>({
30
28
  return {
31
29
  caveman: enumOr(raw.caveman, CAVEMAN, DEFAULTS.caveman),
32
30
  rtk: enumOr(raw.rtk, TOGGLE, DEFAULTS.rtk),
33
- toon: enumOr(raw.toon, TOGGLE, DEFAULTS.toon),
34
31
  ponytail: enumOr(raw.ponytail, PONYTAIL, DEFAULTS.ponytail),
35
32
  };
36
33
  },