dev-cockpit 0.4.1 → 0.5.0

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.
@@ -431,14 +431,14 @@
431
431
  },
432
432
  "Keybindings": {
433
433
  "type": "object",
434
- "description": "Single-keypress → list-of-health-ids dispatch table. Each value may be a string (one id) or an array (fired in declared order on press). Keys SHOULD be single characters; longer strings are accepted but won't ever match a keypress.",
434
+ "description": "Single-keypress → health-id dispatch table for the Health pane.\n\n- Value may be a single id (string) or a list of ids (array).\n- Multi-id binding: every referenced row shows the key chip in the Health pane. On press, all matching rows are collected; the dispatcher then dedupes by `command|cwd` and fires each UNIQUE remediation exactly once. N rows sharing a command run it once; N rows with distinct commands fire N times.\n- `run`-shaped programmatic remediations (used by profiles) are never folded by dedup — they carry no comparable key.\n- Keys SHOULD be single characters; longer strings are accepted but never match a keypress.\n\nAction keys live separately on `actions[].key` because actions carry `scope` (`global` | `repos` | `repos:<id>`) which doesn't translate cleanly to a global table.",
435
435
  "additionalProperties": {
436
436
  "oneOf": [
437
437
  { "type": "string", "description": "Single health check id to fire." },
438
438
  {
439
439
  "type": "array",
440
440
  "items": { "type": "string" },
441
- "description": "Ordered list of health check ids. All fire on a single keypress."
441
+ "description": "Ordered list of health check ids. All show the key chip; dispatcher dedups by command|cwd before firing."
442
442
  }
443
443
  ]
444
444
  }
@@ -1,5 +1,5 @@
1
1
  # yaml-language-server: $schema=./cockpit.schema.json
2
- # cockpit.yaml — example config (schema v2)
2
+ # cockpit.yaml — example config (schema v3)
3
3
  # Run `dev-cockpit dev` from the directory containing this file.
4
4
  # Or, if it lives elsewhere:
5
5
  # dev-cockpit link <path/to/this-file> # registers cwd → this config
@@ -7,7 +7,7 @@
7
7
  # DEV_COCKPIT_CONFIG=<path> dev-cockpit dev # one-shot env override
8
8
  # dev-cockpit dev --config <path> # one-shot CLI override
9
9
 
10
- version: 2 # config schema version; required (v1 auto-migrated in memory)
10
+ version: 3 # config schema version; required (v1 and v2 auto-migrated in memory)
11
11
  appName: my-app # state dir: ~/.local/state/my-app/<workspace-hash>/
12
12
 
13
13
  # Processes — long-running commands streamed into the Output pane.
@@ -63,7 +63,8 @@ highlights:
63
63
  severity: error
64
64
 
65
65
  # Health checks — `type` references a built-in or profile-registered check id.
66
- # Each check has a one-keystroke remediation.
66
+ # Each check has a remediation (label + command). Keys for triggering live in
67
+ # the `keybindings:` block below, NOT on the remediation.
67
68
  health:
68
69
  - id: api-up
69
70
  label: API responds
@@ -72,7 +73,6 @@ health:
72
73
  notify:
73
74
  onTransitionTo: [error] # only notify on going-down, not on recovery
74
75
  remediation:
75
- key: a
76
76
  label: restart api
77
77
  command: docker compose restart web
78
78
 
@@ -81,7 +81,14 @@ health:
81
81
  type: container-running
82
82
  container: db
83
83
  remediation:
84
- key: d
84
+ label: bring db up
85
+ command: docker compose up -d db
86
+
87
+ - id: redis-running
88
+ label: Redis container running
89
+ type: container-running
90
+ container: redis
91
+ remediation:
85
92
  label: bring db up
86
93
  command: docker compose up -d db
87
94
 
@@ -90,7 +97,6 @@ health:
90
97
  type: file-exists
91
98
  path: ./.env
92
99
  remediation:
93
- key: e
94
100
  label: copy .env.example
95
101
  command: cp .env.example .env
96
102
 
@@ -99,10 +105,27 @@ health:
99
105
  type: exec-zero
100
106
  command: npm run db:check
101
107
  remediation:
102
- key: m
103
108
  label: run migrations
104
109
  command: npm run db:migrate
105
110
 
111
+ # Keybindings — single-keypress → health-id dispatch for the Health pane.
112
+ #
113
+ # - Value can be a single id (string) or a list of ids (array).
114
+ # - Multi-id binding: every referenced row shows the chip on press, all
115
+ # match. The dispatcher then dedupes by `command|cwd` and fires each
116
+ # UNIQUE remediation exactly once — N rows sharing a command run it
117
+ # once; N rows with distinct commands fire N times.
118
+ # - Example below: pressing `D` brings the whole docker stack up. The
119
+ # `db-running` and `redis-running` rows share `docker compose up -d db`,
120
+ # so that runs once; `api-up`'s `restart web` runs separately.
121
+ keybindings:
122
+ D:
123
+ - api-up
124
+ - db-running
125
+ - redis-running
126
+ E: env-file
127
+ M: migrations
128
+
106
129
  # Help — extra markdown directories layered on top of the built-in help.
107
130
  help:
108
131
  sources:
@@ -124,8 +147,18 @@ notifications:
124
147
  # manifestFile: mount.manifest.json # basename inside stateDir
125
148
  # service: web # target compose service (default: first in docker.services)
126
149
 
150
+ # Composer scopes for the auto-registered `composer-drift` health check.
151
+ # Wrappers with nested PHP roots list each scope explicitly. Default: ['.'].
152
+ # composer:
153
+ # packageDirs:
154
+ # - .
155
+ # - project
156
+
127
157
  # Actions — named, key-bound shell commands surfaced via the `:` palette and
128
158
  # the Targets pane. `scope` values: `global` | `repos` | `repos:<id>`.
159
+ # Action keys are separate from `keybindings:` (which is health-only) because
160
+ # actions carry scope; `repos:<id>` row-scoped action keys couldn't translate
161
+ # cleanly to the global keybindings dispatch table.
129
162
  actions:
130
163
  - id: docs
131
164
  label: Open docs
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dev-cockpit",
3
- "version": "0.4.1",
4
- "description": "A reusable, domain-neutral terminal UI dev cockpit tabbed pane shell, watcher streaming, optional Docker log tail with highlights, health framework with one-keystroke remediations, transition-only OS notifications, live-markdown Help. Profiles extend it with project-specific commands, repos, and health checks.",
3
+ "version": "0.5.0",
4
+ "description": "A reusable, domain-neutral terminal UI dev cockpit \u2014 tabbed pane shell, watcher streaming, optional Docker log tail with highlights, health framework with one-keystroke remediations, transition-only OS notifications, live-markdown Help. Profiles extend it with project-specific commands, repos, and health checks.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",