projmux 0.6.2 → 0.6.4

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.
@@ -0,0 +1,244 @@
1
+ # Globalization Contract
2
+
3
+ This document is the inventory and contract for globalization. Phase 0 defined
4
+ the user-facing text boundary and literal preservation rules. Phase 1 adds the
5
+ message catalog foundation, locale resolver, fallback policy, and contribution
6
+ rules for future runtime surface migrations.
7
+
8
+ ## Phase 0 Scope
9
+
10
+ Phase 0 does three things:
11
+
12
+ - Sets the temporary English baseline for remaining hardcoded Korean
13
+ user-facing product text in code and tests.
14
+ - Classifies existing string families as `translate`, `literal`, `data`, or
15
+ `debug-only`.
16
+ - Defines the surface boundaries for later catalog work.
17
+
18
+ Phase 0 explicitly preserves data and literals. It does not mass-translate docs
19
+ or fixtures.
20
+
21
+ ## Surface Inventory
22
+
23
+ ### AI Notifications
24
+
25
+ Files:
26
+
27
+ - `internal/app/ai_notify_body.go`
28
+ - `internal/app/ai.go`
29
+ - `internal/app/ai_test.go`
30
+ - `internal/app/ai_ingest_test.go`
31
+ - `internal/app/notify_producer_test.go`
32
+
33
+ Classification:
34
+
35
+ | Family | Examples | Class | Phase 0 policy |
36
+ | --- | --- | --- | --- |
37
+ | Agent names | `Codex`, `Claude`, `AI` | `literal` | Preserve exactly. |
38
+ | Category labels | `Response complete`, `Approval required`, `Input required`, `Error`, `Subagent stopped`, `Teammate waiting` | `translate` | English baseline now; catalog keys later. |
39
+ | Review body prefix | `Review pending:` | `translate` | English baseline now; catalog key later. |
40
+ | Tool names | `Bash`, `Read`, `WebFetch`, `Shell` | `literal` | Preserve provider/source spelling. |
41
+ | Tool input summaries | commands, paths, URLs, queries | `data` | Preserve payload content; only truncate for UI width. |
42
+ | Hook event names | `Stop`, `Notification`, `permission_prompt`, `idle_prompt` | `literal` | Preserve source values. |
43
+ | Severity values | `info`, `warn`, `critical` | `literal` | Preserve enum/source values. |
44
+
45
+ ### Notify Queue, Sidebar, And Statusbar
46
+
47
+ Files:
48
+
49
+ - `internal/app/notify.go`
50
+ - `internal/app/status.go`
51
+ - `docs/statusbar.md`
52
+ - `docs/cli.md`
53
+
54
+ Classification:
55
+
56
+ | Family | Examples | Class | Phase 0 policy |
57
+ | --- | --- | --- | --- |
58
+ | CLI flag help and usage | `--text`, `--target`, `notify push`, usage errors | `translate` | Inventory only; convert in catalog phases. |
59
+ | Queue row labels and action hints | ack, clear, focus, open, reconcile labels | `translate` | Inventory only; convert in catalog phases. |
60
+ | Statusbar compact text | notify count, age, stale/gone hints | `translate` | Inventory only; needs compact locale formatter later. |
61
+ | Source/severity enum values | `ai`, `k8s`, `git`, `external`, `critical` | `literal` | Preserve exactly. |
62
+ | tmux style fragments | `#[...]`, tmux format strings | `literal` | Preserve syntax and measure display text separately. |
63
+ | Debug/error internals | wrapped Go errors, diagnostics for failed store reads | `debug-only` | Not catalog-blocking unless surfaced as normal UX. |
64
+
65
+ ### Settings
66
+
67
+ Files:
68
+
69
+ - `internal/app/settings.go`
70
+ - `internal/app/settings_*.go`
71
+ - `docs/settings-ia.md`
72
+
73
+ Classification:
74
+
75
+ | Family | Examples | Class | Phase 0 policy |
76
+ | --- | --- | --- | --- |
77
+ | Root and section labels | Settings, Project, Notifications, Appearance, About | `translate` | Inventory only; catalog later. |
78
+ | Row labels and previews | enabled/disabled state, current source, saved values | `translate` | Inventory only; catalog later. |
79
+ | Disabled reasons and warnings | missing project, env override, conflict text | `translate` | Inventory only; catalog later. |
80
+ | Config keys and env vars | `PROJMUX_PROJDIR`, `config.toml`, `ui.locale` | `literal` | Preserve exactly. |
81
+ | Commands shown for copying | `projmux ai integrate codex --dry-run` | `literal` | Preserve exactly. |
82
+ | Persisted values | `none`, `notify`, `raise`, `auto` | `literal` | Preserve enum values. |
83
+
84
+ ### Native Picker And Render Surfaces
85
+
86
+ Files:
87
+
88
+ - `internal/ui/projmuxpicker/*`
89
+ - `internal/ui/render/*`
90
+ - `docs/native-picker-no-fzf-poc.md`
91
+
92
+ Classification:
93
+
94
+ | Family | Examples | Class | Phase 0 policy |
95
+ | --- | --- | --- | --- |
96
+ | Search prompt and footer labels | Search, open rows, close, back, preview hints | `translate` | Inventory only; catalog later. |
97
+ | Picker titles and empty states | Projects, Settings, no matches | `translate` | Inventory only; catalog later. |
98
+ | Key names | `Enter`, `Esc`, `Alt-1`, `Ctrl-C` | `literal` | Preserve exactly. |
99
+ | Row data | project names, branch names, paths, session/window names | `data` | Preserve source content. |
100
+ | Width fixtures | CJK path/project examples and Unicode socket paths | `data` | Preserve as test fixtures. |
101
+
102
+ ### Welcome, Update, About, And Help
103
+
104
+ Files:
105
+
106
+ - `internal/app/welcome*.go`
107
+ - `internal/app/update*.go`
108
+ - `internal/app/settings*.go`
109
+ - `internal/app/*help*`
110
+ - `docs/cli.md`
111
+ - `docs/agent-workflow.md`
112
+
113
+ Classification:
114
+
115
+ | Family | Examples | Class | Phase 0 policy |
116
+ | --- | --- | --- | --- |
117
+ | Welcome guide and shell prompt copy | first-run guidance, skip action text | `translate` | Inventory only; catalog later. |
118
+ | Update messages | update available, installer source, apply status | `translate` | Inventory only; catalog later. |
119
+ | About labels | version, source, welcome, quit action | `translate` | Inventory only; catalog later. |
120
+ | Command syntax | `projmux shell`, `make test`, `gh pr create` | `literal` | Preserve exactly. |
121
+ | Version strings and release tags | `vX.Y.Z`, git SHA, installer source | `data` | Preserve source content. |
122
+
123
+ ## Literal Preservation Rules
124
+
125
+ Do not translate these families:
126
+
127
+ - Product and agent names: `Codex`, `Claude`, `projmux`, `tmux`, `psmux`,
128
+ `GitHub`, `npm`.
129
+ - Terminal and app names: `Windows Terminal`, `Ghostty`, `WezTerm`, `Kitty`,
130
+ `iTerm2`, `Alacritty`, `Foot`.
131
+ - Commands, flags, config, env vars, and paths: `projmux shell`, `make test`,
132
+ `~/.config/projmux/config.toml`, `PROJMUX_NOTIFY_HOOK`, `Alt-1`.
133
+ - Protocol, enum, and source values: `reply-ready`, `approval_required`,
134
+ `state.progress`, `ko-KR`, `en-US`, `critical`.
135
+ - Provider payload data: commands, file paths, URLs, query strings, project
136
+ names, branch names, session/window/pane names, and transcript excerpts.
137
+ - ANSI, terminal, and tmux syntax: escape sequences, `#[...]` style fragments,
138
+ tmux format expressions, and key escape fixtures.
139
+
140
+ These values may appear inside translated sentences, but the value itself stays
141
+ unchanged.
142
+
143
+ ## Remaining Korean Hit Policy
144
+
145
+ Korean text is allowed when it is not English baseline product copy:
146
+
147
+ - `README-ko.md` and README language badges are localized docs and links.
148
+ - Roadmap title references in docs are source-note references, not product UI.
149
+ - CJK and Unicode path/socket fixtures are data for width, truncation, URI, and
150
+ filesystem behavior tests.
151
+ - Historical or roadmap-note titles in docs may remain when they identify an
152
+ external planning note.
153
+
154
+ New Korean product UI strings should not be added directly to code during Phase
155
+ 0. Add English baseline copy now and move it behind message keys in Phase 1+.
156
+
157
+ ## Draft Phase 1 Key Prefixes
158
+
159
+ Use stable, surface-oriented prefixes:
160
+
161
+ - `notify.ai.response_complete`
162
+ - `notify.ai.approval_required`
163
+ - `notify.ai.input_required`
164
+ - `notify.ai.error`
165
+ - `notify.ai.subagent_stopped`
166
+ - `notify.ai.teammate_waiting`
167
+ - `notify.ai.review_pending`
168
+ - `notify.queue.row.age_compact`
169
+ - `notify.queue.action.ack`
170
+ - `status.notify.count`
171
+ - `status.notify.age_compact`
172
+ - `settings.root.notifications`
173
+ - `settings.root.project`
174
+ - `settings.root.appearance`
175
+ - `settings.notifications.desktop`
176
+ - `settings.notifications.delivery_sources`
177
+ - `settings.about.welcome`
178
+ - `picker.prompt.search`
179
+ - `picker.footer.open_rows`
180
+ - `picker.footer.back`
181
+ - `picker.footer.close`
182
+ - `picker.empty.no_matches`
183
+ - `welcome.shell.title`
184
+ - `update.status.available`
185
+ - `help.usage.command`
186
+
187
+ Phase 1 should define the catalog API and fallback behavior before converting
188
+ large surfaces. Phase 2 should add locale-aware formatting for relative age,
189
+ duration, counts, list joins, and terminal cell-width-safe rendering. Later
190
+ phases can then move notify, Settings, picker, welcome, update, and help copy
191
+ behind catalog keys without changing source payload values.
192
+
193
+ ## Phase 1 Catalog Foundation
194
+
195
+ Package:
196
+
197
+ - `internal/i18n`
198
+
199
+ Catalog policy:
200
+
201
+ - Catalog data is embedded Go data. Do not download catalog content at runtime
202
+ and do not add a translation service dependency.
203
+ - `en-US` is the fallback locale. Every Phase 0 foundation key must have a
204
+ non-empty `en-US` entry.
205
+ - `ko-KR` is intentionally partial in Phase 1 so fallback behavior is covered
206
+ before broad runtime migration.
207
+ - Missing preferred-locale keys fall back to `en-US`.
208
+ - Missing fallback-locale keys are errors and must also be caught by the
209
+ catalog completeness unit test.
210
+
211
+ Locale resolution:
212
+
213
+ - Precedence is explicit override/API, then `LC_ALL`, then `LC_MESSAGES`, then
214
+ `LANG`, then `en-US`.
215
+ - Common POSIX forms normalize into catalog tags: `ko`, `ko_KR.UTF-8`, and
216
+ `ko-KR` become `ko-KR`; `en` and `en_US` become `en-US`.
217
+ - `C` and `POSIX` locales are skipped as non-user-language values.
218
+ - Phase 1 does not add Settings language UI, persisted config/env locale
219
+ schema, or runtime surface migration.
220
+
221
+ API convention:
222
+
223
+ - Use `i18n.ResolveLocale` to pick the preferred locale.
224
+ - Use `i18n.NewLocalizer(locale).Text(key)` for plain user-facing text.
225
+ - Use `i18n.NewLocalizer(locale).Styled(key)` only for messages that contain
226
+ ANSI or tmux style syntax.
227
+ - Do not pass styled terminal fragments through the plain text API. The lookup
228
+ API returns a kind mismatch error when a caller requests the wrong shape.
229
+ - Future formatter phases should keep payload data, command strings, paths,
230
+ key names, enum/source values, and tmux/ANSI syntax outside translated text
231
+ unless they are inserted as preserved literal values.
232
+
233
+ Contribution convention:
234
+
235
+ - Add new translatable user-facing strings as stable `i18n.Key` constants.
236
+ - Add the `en-US` entry in the same change as the key.
237
+ - Add `ko-KR` when the translation is known; otherwise rely on fallback while
238
+ keeping the missing key intentional in review notes.
239
+ - Do not translate product names (`projmux`, `tmux`, `Codex`, `Claude`),
240
+ commands, paths, config keys, environment variables, provider payloads, or
241
+ source enum values.
242
+ - Runtime migrations should be narrow by surface. Move a string family behind
243
+ the catalog only when its tests can show literal preservation and fallback
244
+ behavior for that surface.
package/docs/hooks.md CHANGED
@@ -169,9 +169,11 @@ stdin receives one JSON object:
169
169
  "topic": "worker loop",
170
170
  "pane": "%9",
171
171
  "session": "main",
172
- "message": "claude: reply ready · worker loop",
172
+ "message": "worker loop",
173
173
  "metadata": {
174
- "agent": "claude"
174
+ "agent": "claude",
175
+ "category": "response_complete",
176
+ "state": "need"
175
177
  },
176
178
  "created_at": "2026-05-12T02:03:04Z"
177
179
  }
@@ -346,9 +348,9 @@ events, so `Stop` or `PermissionRequest` can be made state-only or quiet
346
348
  without changing which hook commands are installed. When a known Codex event
347
349
  without a specialized handler, such as `PreToolUse` or `PostToolUse`, is set to
348
350
  runtime `notify`, projmux pushes a generic in-app notify row such as
349
- `Codex · PreToolUse · Bash`. That generic path is queue/sidebar/statusbar only:
350
- it does not dispatch `[hooks.send-noti]`, `PROJMUX_NOTIFY_HOOK`, `notify-send`,
351
- or Windows toast.
351
+ `PreToolUse · Bash` with agent/category metadata. That generic path is
352
+ queue/sidebar/statusbar only: it does not dispatch `[hooks.send-noti]`,
353
+ `PROJMUX_NOTIFY_HOOK`, `notify-send`, or Windows toast.
352
354
  Generic metadata is limited to safe summary fields such as provider, event,
353
355
  tool, cwd, thread, session, turn, and model; raw payloads and tool input are
354
356
  not stored.
package/docs/install.md CHANGED
@@ -27,17 +27,20 @@ Start the tmux app with:
27
27
  projmux shell
28
28
  ```
29
29
 
30
- The first launch for each projmux version prints a short welcome with the
31
- current version, detach/exit keys, core app shortcuts, and cached update status
32
- when available. If an installer-supported update is available, pressing Enter
33
- at the inline prompt runs `projmux update apply`; answering `n` prints that
34
- manual command and continues into the shell.
35
-
36
- After the shell tmux client attaches, projmux consumes the pending welcome
37
- marker once and shows the same guide in a dismissable popup. If you want to
38
- revisit that guide later, run `projmux welcome`. Set `PROJMUX_WELCOME=off`
39
- before launching `projmux shell` to suppress the automatic attach popup without
40
- disabling the manual command.
30
+ Each `projmux shell` launch prints a short welcome with the current version,
31
+ detach/exit keys, core app shortcuts, and cached update status when available.
32
+ Press Enter to continue for this run, or press `s` to skip the welcome for the
33
+ current projmux version. The next projmux version shows the welcome again.
34
+
35
+ If an installer-supported update is available, the same prompt keeps update
36
+ actions separate from welcome skip: press `u` to run `projmux update apply`,
37
+ `n` to print the manual update command, or `d` to skip daily update prompts for
38
+ that release.
39
+
40
+ To revisit the guide later, run `projmux welcome`, or use Settings > About >
41
+ Welcome inside the app to open it in a visible viewer. Set `PROJMUX_WELCOME=off` before
42
+ launching `projmux shell` to suppress legacy automatic attach popups without
43
+ disabling the shell prompt or manual command.
41
44
 
42
45
  ## Runtime Tools
43
46