@duckmind/dm-darwin-arm64 0.35.3 → 0.35.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.
Files changed (43) hide show
  1. package/dm +0 -0
  2. package/extensions/.dm-extensions.json +1 -27
  3. package/package.json +1 -1
  4. package/extensions/dm-alps/LICENSE +0 -21
  5. package/extensions/dm-alps/README.md +0 -22
  6. package/extensions/dm-alps/index.ts +0 -172
  7. package/extensions/dm-alps/package.json +0 -49
  8. package/extensions/dm-alps/src/commands.ts +0 -208
  9. package/extensions/dm-alps/src/features/animations/debug.ts +0 -160
  10. package/extensions/dm-alps/src/features/animations/index.ts +0 -33
  11. package/extensions/dm-alps/src/features/animations/patch.ts +0 -112
  12. package/extensions/dm-alps/src/features/animations/preview.ts +0 -117
  13. package/extensions/dm-alps/src/features/animations/registry.ts +0 -593
  14. package/extensions/dm-alps/src/features/animations/runtime.ts +0 -563
  15. package/extensions/dm-alps/src/features/animations/settings.ts +0 -69
  16. package/extensions/dm-alps/src/features/bottom-input/cluster.ts +0 -2
  17. package/extensions/dm-alps/src/features/bottom-input/compositor.ts +0 -2
  18. package/extensions/dm-alps/src/features/bottom-input/editor.ts +0 -148
  19. package/extensions/dm-alps/src/features/bottom-input/frame.ts +0 -224
  20. package/extensions/dm-alps/src/features/bottom-input/icons.ts +0 -36
  21. package/extensions/dm-alps/src/features/bottom-input/index.ts +0 -8
  22. package/extensions/dm-alps/src/features/bottom-input/runtime.ts +0 -1197
  23. package/extensions/dm-alps/src/features/bottom-input/shortcuts.ts +0 -286
  24. package/extensions/dm-alps/src/features/bottom-input/status.ts +0 -663
  25. package/extensions/dm-alps/src/features/bottom-status/index.ts +0 -2
  26. package/extensions/dm-alps/src/features/chrome-frame/chrome.ts +0 -222
  27. package/extensions/dm-alps/src/features/chrome-frame/debug.ts +0 -212
  28. package/extensions/dm-alps/src/features/chrome-frame/image.ts +0 -11
  29. package/extensions/dm-alps/src/features/chrome-frame/index.ts +0 -4
  30. package/extensions/dm-alps/src/features/chrome-frame/osc.ts +0 -111
  31. package/extensions/dm-alps/src/features/chrome-frame/patch.ts +0 -769
  32. package/extensions/dm-alps/src/features/chrome-frame/preview.ts +0 -67
  33. package/extensions/dm-alps/src/features/chrome-frame/styles.ts +0 -105
  34. package/extensions/dm-alps/src/features/fixed-bottom-editor/cluster.ts +0 -161
  35. package/extensions/dm-alps/src/features/fixed-bottom-editor/compositor.ts +0 -1149
  36. package/extensions/dm-alps/src/features/fixed-bottom-editor/index.ts +0 -3
  37. package/extensions/dm-alps/src/features/fixed-bottom-editor/runtime.ts +0 -3
  38. package/extensions/dm-alps/src/settings-store.ts +0 -194
  39. package/extensions/dm-alps/src/settings-ui.ts +0 -653
  40. package/extensions/dm-alps/src/settings.ts +0 -102
  41. package/extensions/dm-alps/src/terminal-sanitizer.ts +0 -91
  42. package/extensions/dm-alps/themes/LICENSE.synthwave-84 +0 -21
  43. package/extensions/dm-alps/themes/alps.json +0 -93
@@ -1,3 +0,0 @@
1
-
2
- export * from "./cluster.ts";
3
- export * from "./compositor.ts";
@@ -1,3 +0,0 @@
1
-
2
- export { createBottomInputRuntime } from "../bottom-input/runtime.ts";
3
- export type { BottomInputRuntime, FixedBottomEditorStatus } from "../bottom-input/runtime.ts";
@@ -1,194 +0,0 @@
1
-
2
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
- import { dirname, join } from "node:path";
4
- import { getAgentDir } from "@mariozechner/pi-coding-agent";
5
- import { cloneDefaultSettings, type AlpsDmSettings } from "./settings.ts";
6
- import { normalizeAnimationsSettings } from "./features/animations/settings.ts";
7
- import { normalizeShortcut, shortcutConflictKey, shortcutUsesSuper, isSupportedSuperShortcut, RESERVED_BOTTOM_INPUT_SHORTCUTS, SHORTCUT_KEYS } from "./features/bottom-input/shortcuts.ts";
8
-
9
- const SETTINGS_ENV = "ALPS_DM_SETTINGS_PATH";
10
- export const DM_SETTINGS_NAMESPACE = "dm-alps";
11
-
12
- export function cloneStartupSettings(): AlpsDmSettings {
13
- const settings = cloneDefaultSettings();
14
- settings.chromeFrame.enabled = true;
15
- settings.fixedBottomEditor.enabled = true;
16
- settings.beautifiedInput.enabled = true;
17
- settings.animations.enabled = true;
18
- return settings;
19
- }
20
-
21
- export function getSettingsPath(): string {
22
- return getIsolatedSettingsPath() ?? getPiSettingsPath();
23
- }
24
-
25
- export function getPiSettingsPath(): string {
26
- return join(getAgentDir(), "settings.json");
27
- }
28
-
29
- export function getLegacySettingsPath(): string {
30
- return join(getAgentDir(), "dm-alps", "settings.json");
31
- }
32
-
33
- export function readPersistedSettings(path?: string): AlpsDmSettings {
34
- const isolatedPath = path ?? getIsolatedSettingsPath();
35
- if (isolatedPath) {
36
- return readStandaloneSettings(isolatedPath, cloneStartupSettings());
37
- }
38
- return readNamespacedPiSettings(getPiSettingsPath(), getLegacySettingsPath());
39
- }
40
-
41
- export function writePersistedSettings(settings: AlpsDmSettings, path?: string): void {
42
- const isolatedPath = path ?? getIsolatedSettingsPath();
43
- if (isolatedPath) {
44
- writeStandaloneSettings(settings, isolatedPath);
45
- return;
46
- }
47
- writeNamespacedPiSettings(settings, getPiSettingsPath());
48
- }
49
-
50
- export function readNamespacedPiSettings(piSettingsPath: string, legacySettingsPath = getLegacySettingsPath()): AlpsDmSettings {
51
- const defaults = cloneStartupSettings();
52
- const namespaceSettings = readNamespaceFromPiFile(piSettingsPath, defaults);
53
- if (namespaceSettings) return namespaceSettings;
54
-
55
- const legacySettings = readStandaloneSettingsIfExists(legacySettingsPath, defaults);
56
- if (legacySettings) {
57
- writeNamespacedPiSettings(legacySettings, piSettingsPath);
58
- return legacySettings;
59
- }
60
- return defaults;
61
- }
62
-
63
- export function writeNamespacedPiSettings(settings: AlpsDmSettings, piSettingsPath: string): void {
64
- try {
65
- const root = readPiSettingsRoot(piSettingsPath);
66
- if (!root) return;
67
- root[DM_SETTINGS_NAMESPACE] = cloneSettings(settings);
68
- mkdirSync(dirname(piSettingsPath), { recursive: true });
69
- writeFileSync(piSettingsPath, JSON.stringify(root, null, 2) + "\n", "utf-8");
70
- } catch (error) {
71
- console.debug?.(`[dm-alps] Failed to write settings namespace to ${piSettingsPath}:`, error);
72
- }
73
- }
74
-
75
- export function cloneSettings(settings: AlpsDmSettings): AlpsDmSettings {
76
- return {
77
- chromeFrame: { ...settings.chromeFrame },
78
- fixedBottomEditor: { ...settings.fixedBottomEditor },
79
- beautifiedInput: { ...settings.beautifiedInput },
80
- animations: { ...settings.animations },
81
- shortcuts: { ...settings.shortcuts },
82
- };
83
- }
84
-
85
- function getIsolatedSettingsPath(): string | undefined {
86
- return process.env[SETTINGS_ENV]?.trim() || undefined;
87
- }
88
-
89
- function readStandaloneSettings(path: string, defaults: AlpsDmSettings): AlpsDmSettings {
90
- const settings = readStandaloneSettingsIfExists(path, defaults);
91
- return settings ?? defaults;
92
- }
93
-
94
- function readStandaloneSettingsIfExists(path: string, defaults: AlpsDmSettings): AlpsDmSettings | undefined {
95
- if (!existsSync(path)) return undefined;
96
- try {
97
- return normalizeSettings(JSON.parse(readFileSync(path, "utf-8")), defaults);
98
- } catch (error) {
99
- console.debug?.(`[dm-alps] Failed to read settings from ${path}:`, error);
100
- return undefined;
101
- }
102
- }
103
-
104
- function readNamespaceFromPiFile(path: string, defaults: AlpsDmSettings): AlpsDmSettings | undefined {
105
- if (!existsSync(path)) return undefined;
106
- try {
107
- const root = JSON.parse(readFileSync(path, "utf-8"));
108
- if (!isRecord(root) || root[DM_SETTINGS_NAMESPACE] === undefined) return undefined;
109
- return normalizeSettings(root[DM_SETTINGS_NAMESPACE], defaults);
110
- } catch (error) {
111
- console.debug?.(`[dm-alps] Failed to read settings namespace from ${path}:`, error);
112
- return undefined;
113
- }
114
- }
115
-
116
- function readPiSettingsRoot(path: string): Record<string, any> | undefined {
117
- if (!existsSync(path)) return {};
118
- try {
119
- const root = JSON.parse(readFileSync(path, "utf-8"));
120
- if (!isRecord(root)) {
121
- console.debug?.(`[dm-alps] Refuse to write settings namespace because ${path} is not a JSON object.`);
122
- return undefined;
123
- }
124
- return root;
125
- } catch (error) {
126
- console.debug?.(`[dm-alps] Refuse to write settings namespace because ${path} is invalid JSON:`, error);
127
- return undefined;
128
- }
129
- }
130
-
131
- function normalizeSettings(value: unknown, defaults: AlpsDmSettings): AlpsDmSettings {
132
- const raw = isRecord(value) ? value : {};
133
- return {
134
- chromeFrame: {
135
- enabled: readBoolean(raw.chromeFrame, "enabled", defaults.chromeFrame.enabled),
136
- assistantFrame: readBoolean(raw.chromeFrame, "assistantFrame", defaults.chromeFrame.assistantFrame),
137
- toolCompactMode: readBoolean(raw.chromeFrame, "toolCompactMode", defaults.chromeFrame.toolCompactMode),
138
- compactEditTool: readBoolean(raw.chromeFrame, "compactEditTool", defaults.chromeFrame.compactEditTool),
139
- },
140
- fixedBottomEditor: {
141
- enabled: readBoolean(raw.fixedBottomEditor, "enabled", defaults.fixedBottomEditor.enabled),
142
- },
143
- beautifiedInput: {
144
- enabled: readBoolean(raw.beautifiedInput, "enabled", defaults.beautifiedInput.enabled),
145
- },
146
- animations: normalizeAnimationsSettings(raw.animations, defaults.animations),
147
- shortcuts: normalizeShortcutSettings(raw.shortcuts, defaults.shortcuts),
148
- };
149
- }
150
-
151
- function writeStandaloneSettings(settings: AlpsDmSettings, path: string): void {
152
- try {
153
- mkdirSync(dirname(path), { recursive: true });
154
- writeFileSync(path, JSON.stringify(cloneSettings(settings), null, 2) + "\n", "utf-8");
155
- } catch (error) {
156
- console.debug?.(`[dm-alps] Failed to write settings to ${path}:`, error);
157
- }
158
- }
159
-
160
- function normalizeShortcutSettings(parent: unknown, defaults: AlpsDmSettings["shortcuts"]): AlpsDmSettings["shortcuts"] {
161
- const result = { ...defaults };
162
- if (!isRecord(parent)) return result;
163
- const occupied = new Set(SHORTCUT_KEYS.map((key) => shortcutConflictKey(defaults[key])));
164
- for (const key of SHORTCUT_KEYS) {
165
- const value = parent[key];
166
- if (typeof value !== "string") continue;
167
- const normalized = normalizeShortcut(value);
168
- if (!normalized || isReservedShortcut(normalized)) continue;
169
- if (shortcutUsesSuper(normalized) && !isSupportedSuperShortcut(normalized)) continue;
170
- const defaultConflictKey = shortcutConflictKey(defaults[key]);
171
- const nextConflictKey = shortcutConflictKey(normalized);
172
- occupied.delete(defaultConflictKey);
173
- if (occupied.has(nextConflictKey)) {
174
- occupied.add(defaultConflictKey);
175
- continue;
176
- }
177
- result[key] = normalized;
178
- occupied.add(nextConflictKey);
179
- }
180
- return result;
181
- }
182
-
183
- function isReservedShortcut(shortcut: string): boolean {
184
- return RESERVED_BOTTOM_INPUT_SHORTCUTS.has(shortcutConflictKey(shortcut));
185
- }
186
-
187
- function readBoolean(parent: unknown, key: string, fallback: boolean): boolean {
188
- if (!isRecord(parent)) return fallback;
189
- return typeof parent[key] === "boolean" ? parent[key] : fallback;
190
- }
191
-
192
- function isRecord(value: unknown): value is Record<string, any> {
193
- return typeof value === "object" && value !== null && !Array.isArray(value);
194
- }