dev-cockpit 0.1.0 → 0.2.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.
Files changed (153) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +86 -29
  3. package/bin/dev-cockpit.mjs +26 -4
  4. package/dist/actions/builtin.d.ts +25 -0
  5. package/dist/actions/builtin.d.ts.map +1 -0
  6. package/dist/actions/dispatch.d.ts +21 -0
  7. package/dist/actions/dispatch.d.ts.map +1 -0
  8. package/dist/actions/registry.d.ts +11 -0
  9. package/dist/actions/registry.d.ts.map +1 -0
  10. package/dist/actions/types.d.ts +76 -0
  11. package/dist/actions/types.d.ts.map +1 -0
  12. package/dist/buildCli.d.ts.map +1 -1
  13. package/dist/chunk-6XGHLLYT.js +46 -0
  14. package/dist/chunk-6XGHLLYT.js.map +7 -0
  15. package/dist/chunk-C4GFJDMG.js +79 -0
  16. package/dist/chunk-C4GFJDMG.js.map +7 -0
  17. package/dist/chunk-Q6677JQF.js +32609 -0
  18. package/dist/chunk-Q6677JQF.js.map +7 -0
  19. package/dist/chunk-VN6UILQW.js +1460 -0
  20. package/dist/chunk-VN6UILQW.js.map +7 -0
  21. package/dist/cockpit/Cockpit.d.ts +6 -0
  22. package/dist/cockpit/Cockpit.d.ts.map +1 -1
  23. package/dist/cockpit/Footer.d.ts +6 -4
  24. package/dist/cockpit/Footer.d.ts.map +1 -1
  25. package/dist/cockpit/TabBar.d.ts.map +1 -1
  26. package/dist/cockpit/hooks/useGlobalKeys.d.ts +15 -15
  27. package/dist/cockpit/hooks/useGlobalKeys.d.ts.map +1 -1
  28. package/dist/cockpit/hooks/useTerminalWidth.d.ts +12 -0
  29. package/dist/cockpit/hooks/useTerminalWidth.d.ts.map +1 -0
  30. package/dist/cockpit/panes/CommandModal.d.ts +18 -0
  31. package/dist/cockpit/panes/CommandModal.d.ts.map +1 -0
  32. package/dist/cockpit/panes/Help.d.ts.map +1 -1
  33. package/dist/cockpit/panes/Output.d.ts +7 -0
  34. package/dist/cockpit/panes/Output.d.ts.map +1 -1
  35. package/dist/cockpit/panes/Repos.d.ts.map +1 -1
  36. package/dist/cockpit/state/store.d.ts +14 -11
  37. package/dist/cockpit/state/store.d.ts.map +1 -1
  38. package/dist/cockpit/tab-state.d.ts +12 -0
  39. package/dist/cockpit/tab-state.d.ts.map +1 -1
  40. package/dist/commands/dev.d.ts.map +1 -1
  41. package/dist/commands/doctor.d.ts.map +1 -1
  42. package/dist/commands/init-config-wizard.d.ts +103 -2
  43. package/dist/commands/init-config-wizard.d.ts.map +1 -1
  44. package/dist/commands/init-config.d.ts +2 -0
  45. package/dist/commands/init-config.d.ts.map +1 -1
  46. package/dist/commands/link.d.ts +20 -0
  47. package/dist/commands/link.d.ts.map +1 -0
  48. package/dist/commands/migrate-config.d.ts +18 -0
  49. package/dist/commands/migrate-config.d.ts.map +1 -0
  50. package/dist/commands/mount.d.ts +17 -32
  51. package/dist/commands/mount.d.ts.map +1 -1
  52. package/dist/core/config-discovery.d.ts +39 -0
  53. package/dist/core/config-discovery.d.ts.map +1 -0
  54. package/dist/core/config.d.ts +73 -5
  55. package/dist/core/config.d.ts.map +1 -1
  56. package/dist/core/manifest.d.ts +47 -0
  57. package/dist/core/manifest.d.ts.map +1 -0
  58. package/dist/core/migrations.d.ts +33 -0
  59. package/dist/core/migrations.d.ts.map +1 -0
  60. package/dist/core/subprocess.d.ts +20 -0
  61. package/dist/core/subprocess.d.ts.map +1 -1
  62. package/dist/core/types.d.ts +36 -12
  63. package/dist/core/types.d.ts.map +1 -1
  64. package/dist/devtools-YXMW6JJ6.js +3720 -0
  65. package/dist/devtools-YXMW6JJ6.js.map +7 -0
  66. package/dist/docker/highlights.d.ts +14 -4
  67. package/dist/docker/highlights.d.ts.map +1 -1
  68. package/dist/docker/logs.d.ts +3 -2
  69. package/dist/docker/logs.d.ts.map +1 -1
  70. package/dist/health/builtin.d.ts.map +1 -1
  71. package/dist/index.d.ts +14 -3
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +92944 -53
  74. package/dist/index.js.map +7 -0
  75. package/dist/ink.js +38 -1
  76. package/dist/ink.js.map +7 -0
  77. package/dist/link-HXNII7EU.js +65 -0
  78. package/dist/link-HXNII7EU.js.map +7 -0
  79. package/dist/mount/compose.d.ts +21 -0
  80. package/dist/mount/compose.d.ts.map +1 -0
  81. package/dist/mount/discovery.d.ts +35 -0
  82. package/dist/mount/discovery.d.ts.map +1 -0
  83. package/dist/mount/git-status.d.ts +12 -0
  84. package/dist/mount/git-status.d.ts.map +1 -0
  85. package/dist/mount/manifest.d.ts +16 -0
  86. package/dist/mount/manifest.d.ts.map +1 -0
  87. package/dist/mount/symlinks.d.ts +30 -0
  88. package/dist/mount/symlinks.d.ts.map +1 -0
  89. package/dist/mount/types.d.ts +60 -0
  90. package/dist/mount/types.d.ts.map +1 -0
  91. package/dist/react.js +35 -1
  92. package/dist/react.js.map +7 -0
  93. package/dist/runCockpit.d.ts +3 -0
  94. package/dist/runCockpit.d.ts.map +1 -1
  95. package/docs/commands.md +29 -16
  96. package/docs/config-reference.md +115 -11
  97. package/docs/getting-started.md +9 -6
  98. package/docs/index.md +5 -1
  99. package/docs/init-config.md +34 -8
  100. package/docs/mount.md +198 -25
  101. package/docs/notifications.md +14 -13
  102. package/docs/panes.md +36 -15
  103. package/docs/processes.md +42 -0
  104. package/package.json +93 -90
  105. package/dist/buildCli.js +0 -107
  106. package/dist/cli.js +0 -2
  107. package/dist/cockpit/Cockpit.js +0 -73
  108. package/dist/cockpit/Footer.js +0 -33
  109. package/dist/cockpit/TabBar.js +0 -12
  110. package/dist/cockpit/help/content.js +0 -22
  111. package/dist/cockpit/help/loader.js +0 -118
  112. package/dist/cockpit/help/renderer.js +0 -35
  113. package/dist/cockpit/help/types.js +0 -1
  114. package/dist/cockpit/hooks/useCockpitStore.js +0 -5
  115. package/dist/cockpit/hooks/useGlobalKeys.js +0 -173
  116. package/dist/cockpit/panes/FilterModal.js +0 -22
  117. package/dist/cockpit/panes/Health.js +0 -30
  118. package/dist/cockpit/panes/Help.js +0 -81
  119. package/dist/cockpit/panes/Output.js +0 -108
  120. package/dist/cockpit/panes/Repos.js +0 -48
  121. package/dist/cockpit/panes/SearchModal.js +0 -31
  122. package/dist/cockpit/state/store.js +0 -111
  123. package/dist/cockpit/tab-state.js +0 -7
  124. package/dist/commands/dev.js +0 -158
  125. package/dist/commands/doctor.js +0 -66
  126. package/dist/commands/init-config-wizard.js +0 -818
  127. package/dist/commands/init-config.js +0 -131
  128. package/dist/commands/mount.js +0 -150
  129. package/dist/core/config.js +0 -152
  130. package/dist/core/logger.js +0 -38
  131. package/dist/core/notifier.js +0 -100
  132. package/dist/core/paths.js +0 -18
  133. package/dist/core/subprocess.js +0 -82
  134. package/dist/core/types.js +0 -1
  135. package/dist/docker/highlights.js +0 -79
  136. package/dist/docker/logs.js +0 -172
  137. package/dist/docker/restart.js +0 -45
  138. package/dist/docker/stack-trace.js +0 -44
  139. package/dist/health/builtin.js +0 -144
  140. package/dist/health/context.js +0 -31
  141. package/dist/health/notify-resolver.js +0 -28
  142. package/dist/health/registry.js +0 -64
  143. package/dist/health/remediations.js +0 -41
  144. package/dist/health/runner.js +0 -22
  145. package/dist/health/scheduler.js +0 -107
  146. package/dist/health/types.js +0 -1
  147. package/dist/health/useHealth.js +0 -122
  148. package/dist/lint/reactive.js +0 -131
  149. package/dist/runCockpit.js +0 -75
  150. package/dist/watchers/manager.js +0 -239
  151. package/dist/watchers/path-mapper.js +0 -29
  152. package/dist/watchers/types.js +0 -9
  153. package/docs/watchers.md +0 -27
@@ -17,7 +17,7 @@
17
17
  export type HealthBuiltinType = 'container-running' | 'port-open' | 'http-ok' | 'file-exists' | 'exec-zero';
18
18
  export type HighlightSeverity = 'info' | 'warn' | 'error';
19
19
  export type HealthSeverity = 'ok' | 'warn' | 'error';
20
- export interface WizardWatcher {
20
+ export interface WizardProcess {
21
21
  id: string;
22
22
  command: string;
23
23
  }
@@ -65,20 +65,121 @@ export interface WizardRepo {
65
65
  path: string;
66
66
  label?: string;
67
67
  }
68
+ export interface WizardAction {
69
+ id: string;
70
+ label: string;
71
+ command: string;
72
+ key?: string;
73
+ scope?: string;
74
+ }
68
75
  export interface WizardResult {
69
76
  appName: string;
70
- watchers: WizardWatcher[];
77
+ processes: WizardProcess[];
71
78
  docker?: WizardDocker;
72
79
  repos: WizardRepo[];
73
80
  highlights: WizardHighlight[];
74
81
  health: WizardHealthCheck[];
82
+ actions: WizardAction[];
75
83
  notifications: {
76
84
  enabled: boolean;
77
85
  };
86
+ /** Output lines from profile-contributed steps, rendered under `profile.<appName>:`. */
87
+ profileLines?: string[];
88
+ }
89
+ /**
90
+ * Context handed to a profile-contributed wizard step. Steps prompt the
91
+ * user via `prompts`, optionally read `hints` for smart defaults, see the
92
+ * core wizard answers via `result`, and return YAML lines (already indented
93
+ * relative to the profile namespace) that will be placed under
94
+ * `profile.<appName>:` in the generated cockpit.yaml.
95
+ */
96
+ export interface WizardStepContext {
97
+ prompts: WizardPrompts;
98
+ hints: ProjectHints;
99
+ workspaceRoot: string;
100
+ /** Snapshot of core-step answers collected so far (read-only). */
101
+ result: Readonly<Omit<WizardResult, 'profileLines'>>;
102
+ }
103
+ export interface WizardStep {
104
+ /** Stable identifier for ordering + tests. */
105
+ id: string;
106
+ /** Heading shown above the step (replaces "Step N of M" framing). */
107
+ title: string;
108
+ /** Optional explanation lines printed before prompts. */
109
+ description?: string;
110
+ /**
111
+ * Run the step. Return YAML lines for the profile namespace — relative,
112
+ * unindented; the renderer indents them under `profile.<appName>:` for you.
113
+ * Return [] to render nothing (e.g. the user skipped the step).
114
+ */
115
+ run: (ctx: WizardStepContext) => Promise<string[]>;
78
116
  }
79
117
  export declare function renderWizardYaml(result: WizardResult): string;
118
+ /**
119
+ * Subset of @inquirer/prompts exposed to profile-contributed wizard steps.
120
+ * The full module imports are lazy (deferred until the wizard actually runs)
121
+ * so non-interactive paths don't pay the parse cost.
122
+ */
123
+ export interface WizardPrompts {
124
+ input: (opts: {
125
+ message: string;
126
+ default?: string;
127
+ validate?: (s: string) => true | string;
128
+ }) => Promise<string>;
129
+ confirm: (opts: {
130
+ message: string;
131
+ default?: boolean;
132
+ }) => Promise<boolean>;
133
+ select: <T extends string>(opts: {
134
+ message: string;
135
+ choices: {
136
+ name: string;
137
+ value: T;
138
+ description?: string;
139
+ }[];
140
+ default?: T;
141
+ }) => Promise<T>;
142
+ checkbox: <T extends string>(opts: {
143
+ message: string;
144
+ choices: {
145
+ name: string;
146
+ value: T;
147
+ description?: string;
148
+ checked?: boolean;
149
+ }[];
150
+ instructions?: string;
151
+ }) => Promise<T[]>;
152
+ number: (opts: {
153
+ message: string;
154
+ default?: number;
155
+ }) => Promise<number | undefined>;
156
+ }
157
+ /**
158
+ * Project-level hints sniffed before the wizard runs, exposed to profile
159
+ * steps so they can offer smart defaults (e.g. detect a gitlab remote,
160
+ * pick the right composer.json, etc.).
161
+ */
162
+ export interface ProjectHints {
163
+ cwd: string;
164
+ appNameDefault: string;
165
+ packageJsonScripts: Record<string, string>;
166
+ composeFile?: string;
167
+ composeServices: string[];
168
+ hasArtisan: boolean;
169
+ hasComposerJson: boolean;
170
+ /**
171
+ * Suggested repo entries auto-derived from the project — npm/pnpm
172
+ * workspaces, the cwd itself, etc. Wizard offers these as pre-checked
173
+ * choices in the Repos step.
174
+ */
175
+ repoSuggestions: WizardRepo[];
176
+ }
80
177
  export declare function runInitWizard(opts: {
81
178
  defaultAppName: string;
82
179
  cwd?: string;
180
+ /** Profile-contributed steps appended after the core 8 (run between
181
+ * notifications and the final summary). Their YAML output lands under
182
+ * `profile.<appName>:` in the generated cockpit.yaml. */
183
+ profileSteps?: readonly WizardStep[];
83
184
  }): Promise<WizardResult>;
84
185
  //# sourceMappingURL=init-config-wizard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"init-config-wizard.d.ts","sourceRoot":"","sources":["../../src/commands/init-config-wizard.ts"],"names":[],"mappings":"AAAA;;;;;;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AAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB;;;;OAIG;IACH,eAAe,EAAE,UAAU,EAAE,CAAC;CAC/B;AAmzBD,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;6DAEyD;IACzD,YAAY,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;CACtC,GAAG,OAAO,CAAC,YAAY,CAAC,CAiFxB"}
@@ -20,6 +20,8 @@ export interface InitConfigOptions {
20
20
  interactive?: boolean;
21
21
  /** Active profile (passed by buildCli) — forwarded to the post-wizard doctor pass. */
22
22
  profile?: Profile;
23
+ /** Override default output path (`<cwd>/cockpit.yaml`). */
24
+ output?: string;
23
25
  }
24
26
  export declare function buildTemplate(opts: {
25
27
  withDocker: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"init-config.d.ts","sourceRoot":"","sources":["../../src/commands/init-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAIhD,MAAM,WAAW,iBAAiB;IAChC,iEAAiE;IACjE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mDAAmD;IACnD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sFAAsF;IACtF,OAAO,CAAC,EAAE,OAAO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AI,CAAC,CA+DlC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * `dev-cockpit link` — manage the project→config mapping in
3
+ * $XDG_DATA_HOME/dev-cockpit/manifest.json.
4
+ *
5
+ * Sub-commands:
6
+ * link <config-path> register a mapping for the current cwd
7
+ * link list show all registered mappings
8
+ * link remove unregister the current cwd
9
+ *
10
+ * Path canonicalisation (symlink-resolved) happens inside the manifest
11
+ * module — the same cwd reached via a symlinked alias hashes to the
12
+ * same key as its real path.
13
+ */
14
+ export interface LinkAddOptions {
15
+ configPath: string;
16
+ }
17
+ export declare function linkAddCommand(opts: LinkAddOptions): void;
18
+ export declare function linkListCommand(): void;
19
+ export declare function linkRemoveCommand(): void;
20
+ //# sourceMappingURL=link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/commands/link.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAYH,MAAM,WAAW,cAAc;IAC9B,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAazD;AAED,wBAAgB,eAAe,IAAI,IAAI,CAYtC;AAED,wBAAgB,iBAAiB,IAAI,IAAI,CAUxC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * `dev-cockpit migrate-config` — rewrite cockpit.yaml at the current
3
+ * CONFIG_VERSION.
4
+ *
5
+ * Reads the file, runs migrations from whatever version it declares up to
6
+ * CONFIG_VERSION, and writes the migrated form back to disk (with a
7
+ * comment banner noting the upgrade and original version). Idempotent: if
8
+ * the file is already at CONFIG_VERSION, the command prints a confirmation
9
+ * and exits without writing.
10
+ */
11
+ export interface MigrateConfigOptions {
12
+ /** Path to cockpit.yaml. Default: ./cockpit.yaml */
13
+ config?: string;
14
+ /** Print the migrated YAML instead of writing it. Default: false. */
15
+ dryRun?: boolean;
16
+ }
17
+ export declare function migrateConfigCommand(opts?: MigrateConfigOptions): Promise<void>;
18
+ //# sourceMappingURL=migrate-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate-config.d.ts","sourceRoot":"","sources":["../../src/commands/migrate-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,oBAAoB,CAAC,IAAI,GAAE,oBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmDzF"}
@@ -1,20 +1,19 @@
1
1
  /**
2
- * `dev-cockpit mount` — generic bind-mount overlay manager.
2
+ * `dev-cockpit mount` — bind-mount overlay manager.
3
3
  *
4
- * Collects mount candidates from two sources and writes a Docker compose
5
- * override file plus a manifest:
6
- * 1. `config.mounts[]` explicit, declared in cockpit.yaml
7
- * 2. `profile.mountCandidatesProvider?.()` — discovered programmatically
8
- *
9
- * The merged set is keyed by `containerPath`; if both sources name the same
10
- * container path, the config entry wins (explicit > discovered). The
11
- * compose override targets a single configurable service (default: first
12
- * service in `config.docker.services`).
4
+ * Three subcommands:
5
+ * mount — interactive picker (or --quiet); writes overlay + manifest;
6
+ * applies profile.mountSymlinks if defined; calls
7
+ * profile.onMountApply hook.
8
+ * mount status — table of active mounts. Each row is auto-enriched with
9
+ * git branch + dirty flag for git host paths, plus any
10
+ * profile.mountStatusEnricher columns.
11
+ * mount clear — calls profile.onMountClear with previous mounts, removes
12
+ * symlinks/overlay/manifest.
13
13
  *
14
- * Subcommands:
15
- * mount write/refresh the overlay and manifest
16
- * mount status list active mounts from the manifest
17
- * mount clear — remove overlay and manifest
14
+ * Mount candidates merge from two sources keyed by `containerPath`:
15
+ * 1. `config.mounts[]` explicit (wins on conflict)
16
+ * 2. `profile.mountCandidatesProvider?.()` discovered programmatically
18
17
  */
19
18
  import type { Mount, Profile } from '../core/types.js';
20
19
  export interface MountCommandOptions {
@@ -22,26 +21,12 @@ export interface MountCommandOptions {
22
21
  profile?: Profile;
23
22
  /** Container service name to attach the bind mounts to. */
24
23
  service?: string;
24
+ /** Skip the interactive picker; mount everything (minus --exclude). */
25
+ quiet?: boolean;
26
+ /** Names to exclude from the mount set (matched against meta.name). */
27
+ exclude?: string[];
25
28
  }
26
- export interface MountManifest {
27
- appName: string;
28
- workspaceRoot: string;
29
- service: string;
30
- overlayPath: string;
31
- mounts: Mount[];
32
- /** ISO timestamp of last apply. */
33
- appliedAt: string;
34
- }
35
- /**
36
- * Merge mount sources, keyed on containerPath. Config entries win over
37
- * provider-discovered ones for the same container path.
38
- */
39
29
  export declare function mergeMounts(configMounts: readonly Mount[], providerMounts: readonly Mount[]): Mount[];
40
- /**
41
- * Render a Docker compose override YAML for the given service + mounts.
42
- * Hand-rolled (no `yaml` writer) so the output stays stable + diff-friendly.
43
- */
44
- export declare function renderOverlay(service: string, mounts: readonly Mount[]): string;
45
30
  export declare function mountCommand(opts?: MountCommandOptions): Promise<void>;
46
31
  export declare function mountStatusCommand(opts?: MountCommandOptions): Promise<void>;
47
32
  export declare function mountClearCommand(opts?: MountCommandOptions): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/commands/mount.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAIvD,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,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AAkB,CAAC,IAAI,GAAE,mBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkEtF;AAED,wBAAsB,iBAAiB,CAAC,IAAI,GAAE,mBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsCrF"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Resolve the cockpit.yaml path + workspace root for a command invocation.
3
+ *
4
+ * Precedence (high → low):
5
+ * 1. --config CLI flag (explicit)
6
+ * 2. DEV_COCKPIT_CONFIG env var
7
+ * 3. <workspace>/cockpit.yaml
8
+ * 4. $XDG_DATA_HOME/dev-cockpit/manifest.json[workspace]
9
+ * 5. throw DiscoveryError
10
+ *
11
+ * `workspace` is canonical(cwd) unless a profile supplies its own
12
+ * discoverer (awc-cockpit's walks up looking for bedrock/ +
13
+ * docker/compose/). Paths inside the YAML are always workspace-relative,
14
+ * regardless of where the YAML file itself lives.
15
+ */
16
+ export type DiscoverySource = 'cli' | 'env' | 'workspace' | 'manifest';
17
+ export interface DiscoveryResult {
18
+ configPath: string;
19
+ workspaceRoot: string;
20
+ source: DiscoverySource;
21
+ }
22
+ export interface DiscoverConfigOptions {
23
+ /** Working directory; defaults to process.cwd(). */
24
+ cwd?: string;
25
+ /** Value of the --config CLI flag, if passed. */
26
+ cliConfig?: string | undefined;
27
+ /** Optional profile.discoverer hook that yields { root } when it matches. */
28
+ workspaceDiscoverer?: (() => {
29
+ root: string;
30
+ } | null | undefined) | undefined;
31
+ /** Override of DEV_COCKPIT_CONFIG; injectable for tests. */
32
+ envConfig?: string | undefined;
33
+ }
34
+ export declare class DiscoveryError extends Error {
35
+ readonly workspaceRoot: string;
36
+ constructor(workspaceRoot: string);
37
+ }
38
+ export declare function discoverConfig(opts?: DiscoverConfigOptions): DiscoveryResult;
39
+ //# sourceMappingURL=config-discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-discovery.d.ts","sourceRoot":"","sources":["../../src/core/config-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,KAAK,GAAG,WAAW,GAAG,UAAU,CAAC;AAEvE,MAAM,WAAW,eAAe;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,eAAe,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACrC,oDAAoD;IACpD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,6EAA6E;IAC7E,mBAAmB,CAAC,EAAE,CAAC,MAAM;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IAC9E,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,qBAAa,cAAe,SAAQ,KAAK;aACZ,aAAa,EAAE,MAAM;gBAArB,aAAa,EAAE,MAAM;CASjD;AAED,wBAAgB,cAAc,CAAC,IAAI,GAAE,qBAA0B,GAAG,eAAe,CAuChF"}
@@ -1,10 +1,10 @@
1
1
  import { z } from 'zod';
2
2
  /** Schema version constant. Bumps reserved for breaking changes (see ADR 0004). */
3
- export declare const CONFIG_VERSION = 1;
3
+ export declare const CONFIG_VERSION = 2;
4
4
  export declare const BaseCockpitConfigSchema: z.ZodObject<{
5
5
  version: z.ZodNumber;
6
6
  appName: z.ZodString;
7
- watchers: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
7
+ processes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
8
8
  id: z.ZodString;
9
9
  label: z.ZodOptional<z.ZodString>;
10
10
  command: z.ZodString;
@@ -203,12 +203,52 @@ export declare const BaseCockpitConfigSchema: z.ZodObject<{
203
203
  mounts: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
204
204
  hostPath: z.ZodString;
205
205
  containerPath: z.ZodString;
206
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
206
207
  }, "strip", z.ZodTypeAny, {
207
208
  hostPath: string;
208
209
  containerPath: string;
210
+ meta?: Record<string, unknown> | undefined;
209
211
  }, {
210
212
  hostPath: string;
211
213
  containerPath: string;
214
+ meta?: Record<string, unknown> | undefined;
215
+ }>, "many">>>;
216
+ mount: z.ZodDefault<z.ZodOptional<z.ZodObject<{
217
+ /** Workspace-relative path for the generated docker-compose overlay. */
218
+ overlayPath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
219
+ /** Basename inside stateDir for the manifest. */
220
+ manifestFile: z.ZodDefault<z.ZodOptional<z.ZodString>>;
221
+ }, "strip", z.ZodTypeAny, {
222
+ overlayPath: string;
223
+ manifestFile: string;
224
+ }, {
225
+ overlayPath?: string | undefined;
226
+ manifestFile?: string | undefined;
227
+ }>>>;
228
+ /** Which pane the cockpit lands on when it boots. Profile may override. */
229
+ defaultPane: z.ZodDefault<z.ZodOptional<z.ZodEnum<["repos", "output", "health", "help"]>>>;
230
+ /** Named keystroke-bound shell commands surfaced via the `:` palette. */
231
+ actions: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
232
+ id: z.ZodString;
233
+ label: z.ZodString;
234
+ command: z.ZodString;
235
+ cwd: z.ZodOptional<z.ZodString>;
236
+ scope: z.ZodOptional<z.ZodString>;
237
+ key: z.ZodOptional<z.ZodString>;
238
+ }, "strip", z.ZodTypeAny, {
239
+ id: string;
240
+ label: string;
241
+ command: string;
242
+ cwd?: string | undefined;
243
+ key?: string | undefined;
244
+ scope?: string | undefined;
245
+ }, {
246
+ id: string;
247
+ label: string;
248
+ command: string;
249
+ cwd?: string | undefined;
250
+ key?: string | undefined;
251
+ scope?: string | undefined;
212
252
  }>, "many">>>;
213
253
  /**
214
254
  * Profile-specific config namespace. Each profile owns one key under here
@@ -218,8 +258,7 @@ export declare const BaseCockpitConfigSchema: z.ZodObject<{
218
258
  profile: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
219
259
  }, "strip", z.ZodTypeAny, {
220
260
  version: number;
221
- appName: string;
222
- watchers: {
261
+ processes: {
223
262
  id: string;
224
263
  command: string;
225
264
  label?: string | undefined;
@@ -231,6 +270,7 @@ export declare const BaseCockpitConfigSchema: z.ZodObject<{
231
270
  onTransitionTo?: string[] | undefined;
232
271
  } | undefined;
233
272
  }[];
273
+ appName: string;
234
274
  repos: {
235
275
  path: string;
236
276
  id: string;
@@ -277,6 +317,20 @@ export declare const BaseCockpitConfigSchema: z.ZodObject<{
277
317
  mounts: {
278
318
  hostPath: string;
279
319
  containerPath: string;
320
+ meta?: Record<string, unknown> | undefined;
321
+ }[];
322
+ mount: {
323
+ overlayPath: string;
324
+ manifestFile: string;
325
+ };
326
+ defaultPane: "repos" | "health" | "help" | "output";
327
+ actions: {
328
+ id: string;
329
+ label: string;
330
+ command: string;
331
+ cwd?: string | undefined;
332
+ key?: string | undefined;
333
+ scope?: string | undefined;
280
334
  }[];
281
335
  profile: Record<string, unknown>;
282
336
  docker?: {
@@ -296,7 +350,7 @@ export declare const BaseCockpitConfigSchema: z.ZodObject<{
296
350
  tail?: boolean | undefined;
297
351
  }[] | undefined;
298
352
  } | undefined;
299
- watchers?: {
353
+ processes?: {
300
354
  id: string;
301
355
  command: string;
302
356
  label?: string | undefined;
@@ -354,6 +408,20 @@ export declare const BaseCockpitConfigSchema: z.ZodObject<{
354
408
  mounts?: {
355
409
  hostPath: string;
356
410
  containerPath: string;
411
+ meta?: Record<string, unknown> | undefined;
412
+ }[] | undefined;
413
+ mount?: {
414
+ overlayPath?: string | undefined;
415
+ manifestFile?: string | undefined;
416
+ } | undefined;
417
+ defaultPane?: "repos" | "health" | "help" | "output" | undefined;
418
+ actions?: {
419
+ id: string;
420
+ label: string;
421
+ command: string;
422
+ cwd?: string | undefined;
423
+ key?: string | undefined;
424
+ scope?: string | undefined;
357
425
  }[] | undefined;
358
426
  profile?: Record<string, unknown> | undefined;
359
427
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,mFAAmF;AACnF,eAAO,MAAM,cAAc,IAAI,CAAC;AAyFhC,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAelC;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAIxE,qBAAa,kBAAmB,SAAQ,KAAK;aAEzB,QAAQ,EAAE,MAAM;aAChB,KAAK,EAAE,OAAO;aACd,SAAS,EAAE,MAAM;gBAFjB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,MAAM;CAOpC;AAED,qBAAa,qBAAsB,SAAQ,KAAK;aAE5B,QAAQ,EAAE,MAAM;aAChB,KAAK,EAAE,OAAO;gBADd,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO;CAKjC;AAID,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,C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AAED,qBAAa,qBAAsB,SAAQ,KAAK;aAE5B,QAAQ,EAAE,MAAM;aAChB,KAAK,EAAE,OAAO;gBADd,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO;CAKjC;AAID,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IAC7C;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,iBAAsB,GAC3B,iBAAiB,CA0CnB"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Read/write the global project→config manifest at
3
+ * `$XDG_DATA_HOME/dev-cockpit/manifest.json`. Keys are canonical
4
+ * absolute paths to a workspace root; values are absolute paths to
5
+ * the cockpit.yaml that workspace should use.
6
+ *
7
+ * Used by core/config-discovery.ts as the last-resort lookup when
8
+ * the workspace doesn't carry its own cockpit.yaml at the root.
9
+ */
10
+ declare const MANIFEST_VERSION: 1;
11
+ export interface Manifest {
12
+ version: typeof MANIFEST_VERSION;
13
+ projects: Record<string, string>;
14
+ }
15
+ /** Absolute path of `$XDG_DATA_HOME/dev-cockpit/manifest.json`. */
16
+ export declare function manifestPath(): string;
17
+ /**
18
+ * Canonicalise an absolute path — resolves symlinks if the path exists,
19
+ * falls back to `path.resolve()` otherwise. Ensures a symlinked workspace
20
+ * dir (`~/work`) and its real target (`/Users/me/code/work`) hash to the
21
+ * same manifest key.
22
+ */
23
+ export declare function canonical(p: string): string;
24
+ /**
25
+ * Read the manifest. Returns `null` when the file is missing, unreadable,
26
+ * malformed JSON, or doesn't match the expected shape. Callers treat null
27
+ * as "no mapping registered" rather than an error — the user simply
28
+ * hasn't run `dev-cockpit link` yet.
29
+ */
30
+ export declare function readManifest(): Manifest | null;
31
+ /** Look up a workspace's config path. Returns `null` when unmapped. */
32
+ export declare function lookupConfig(workspaceRoot: string): string | null;
33
+ /**
34
+ * Register a mapping. Both inputs are canonicalised first — the
35
+ * workspace key is resolved through symlinks so a `~/work` symlink and
36
+ * `/Users/me/code/work` real path resolve to the same entry.
37
+ */
38
+ export declare function setMapping(workspaceRoot: string, configPath: string): void;
39
+ /** Remove a mapping. Returns `true` when an entry was deleted. */
40
+ export declare function removeMapping(workspaceRoot: string): boolean;
41
+ /** Sorted mapping list, for `dev-cockpit link list`. */
42
+ export declare function listMappings(): Array<{
43
+ workspace: string;
44
+ config: string;
45
+ }>;
46
+ export {};
47
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/core/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,QAAA,MAAM,gBAAgB,EAAG,CAAU,CAAC;AAEpC,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,OAAO,gBAAgB,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,mEAAmE;AACnE,wBAAgB,YAAY,IAAI,MAAM,CAKrC;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAO3C;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,QAAQ,GAAG,IAAI,CAe9C;AAED,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIjE;AAeD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAI1E;AAED,kEAAkE;AAClE,wBAAgB,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAQ5D;AAED,wDAAwD;AACxD,wBAAgB,YAAY,IAAI,KAAK,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAM3E"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Schema-migration pipeline for `cockpit.yaml`.
3
+ *
4
+ * Each migrator transforms a config object from one CONFIG_VERSION to the
5
+ * next. They're pure: input → output, no I/O. The pipeline is:
6
+ *
7
+ * runMigrations(input, fromVersion, toVersion)
8
+ * fromVersion = 1, toVersion = 3 →
9
+ * MIGRATORS[1](input) → MIGRATORS[2](result) → final
10
+ *
11
+ * The keyed map ensures gaps and unknown versions throw rather than silently
12
+ * skip. New migrators are inserted under `MIGRATORS[<sourceVersion>]` and
13
+ * `CONFIG_VERSION` is bumped to `<targetVersion>` in core/config.ts.
14
+ *
15
+ * In-memory migration is automatic when loadConfig encounters an old version
16
+ * (with a console warning). Persisting the migrated form to disk is the job
17
+ * of the `migrate-config` CLI command.
18
+ */
19
+ export type ConfigMigrator = (raw: Record<string, unknown>) => Record<string, unknown>;
20
+ /** Keyed by source version. `MIGRATORS[1]` migrates from v1 to v2, etc. */
21
+ export declare const MIGRATORS: Record<number, ConfigMigrator>;
22
+ export declare class MigrationError extends Error {
23
+ readonly fromVersion: number;
24
+ readonly toVersion: number;
25
+ constructor(fromVersion: number, toVersion: number, reason: string);
26
+ }
27
+ /**
28
+ * Apply migrators in sequence from `fromVersion` to `toVersion`.
29
+ * Each migrator is responsible for setting `version` on its output to the
30
+ * next version number — we assert it after each step.
31
+ */
32
+ export declare function runMigrations(raw: Record<string, unknown>, fromVersion: number, toVersion: number): Record<string, unknown>;
33
+ //# sourceMappingURL=migrations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../src/core/migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AASvF,2EAA2E;AAC3E,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAEpD,CAAC;AAEF,qBAAa,cAAe,SAAQ,KAAK;aACX,WAAW,EAAE,MAAM;aAAkB,SAAS,EAAE,MAAM;gBAAtD,WAAW,EAAE,MAAM,EAAkB,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAInG;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiBzB"}
@@ -4,6 +4,18 @@ export interface SpawnOptions {
4
4
  env?: Record<string, string>;
5
5
  onStdout?: (line: string) => void;
6
6
  onStderr?: (line: string) => void;
7
+ /**
8
+ * Optional tag for handle lookup. The most-recent spawn with a given tag
9
+ * wins; previous tagged spawns lose their tag association (the handle stays
10
+ * in ACTIVE for SIGTERM-at-shutdown but is no longer found via {@link findByTag}).
11
+ */
12
+ tag?: string;
13
+ /**
14
+ * Stdin disposition for the child. Defaults to execa's default (`'pipe'`).
15
+ * Use `'ignore'` for non-interactive subprocesses so any `read`/prompt in
16
+ * the child gets EOF instead of blocking forever on an unwritten pipe.
17
+ */
18
+ stdin?: 'pipe' | 'ignore' | 'inherit';
7
19
  }
8
20
  export interface ProcessHandle {
9
21
  exitCode: Promise<number>;
@@ -11,6 +23,14 @@ export interface ProcessHandle {
11
23
  child: Subprocess;
12
24
  }
13
25
  export declare function spawnStream(cmd: string, args: string[], opts?: SpawnOptions): ProcessHandle;
26
+ /** Look up the latest live handle for a tag, if any. */
27
+ export declare function findSpawnedByTag(tag: string): ProcessHandle | undefined;
28
+ /**
29
+ * Send SIGTERM to the tagged handle and wait for it to exit. Returns true if
30
+ * a handle was found and signaled, false if no handle for that tag is live.
31
+ * Used by per-process restart actions (Repos pane `r` on a process row).
32
+ */
33
+ export declare function killSpawnedByTag(tag: string, sigkillAfterMs?: number): Promise<boolean>;
14
34
  /**
15
35
  * Send SIGTERM to every still-running spawnStream child and await each one's
16
36
  * reap. After {@link sigkillAfterMs} the holdouts are SIGKILLed so the sweep
@@ -1 +1 @@
1
- {"version":3,"file":"subprocess.d.ts","sourceRoot":"","sources":["../../src/core/subprocess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAE/C,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1B,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,KAAK,IAAI,CAAC;IACxC,KAAK,EAAE,UAAU,CAAC;CACnB;AAWD,wBAAgB,WAAW,CACzB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,GAAE,YAAiB,GACtB,aAAa,CA0Cf;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,cAAc,SAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBzE"}
1
+ {"version":3,"file":"subprocess.d.ts","sourceRoot":"","sources":["../../src/core/subprocess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAE/C,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,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