@agimon-ai/po-config 0.0.0-alpha.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.
Files changed (170) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +170 -0
  3. package/dist/agentPluginMcp.cjs +322 -0
  4. package/dist/agentPluginMcp.cjs.map +1 -0
  5. package/dist/agentPluginMcp.d.mts +38 -0
  6. package/dist/agentPluginMcp.d.mts.map +1 -0
  7. package/dist/agentPluginMcp.mjs +318 -0
  8. package/dist/agentPluginMcp.mjs.map +1 -0
  9. package/dist/apiContracts.cjs +203 -0
  10. package/dist/apiContracts.cjs.map +1 -0
  11. package/dist/apiContracts.d.mts +53 -0
  12. package/dist/apiContracts.d.mts.map +1 -0
  13. package/dist/apiContracts.mjs +198 -0
  14. package/dist/apiContracts.mjs.map +1 -0
  15. package/dist/atomicJson-1W0WhuFF.mjs +44 -0
  16. package/dist/atomicJson-1W0WhuFF.mjs.map +1 -0
  17. package/dist/atomicJson-Dt2z_DXl.cjs +52 -0
  18. package/dist/atomicJson-Dt2z_DXl.cjs.map +1 -0
  19. package/dist/atomicJson.cjs +3 -0
  20. package/dist/atomicJson.d.mts +2 -0
  21. package/dist/atomicJson.mjs +2 -0
  22. package/dist/config-BUw5kHsx.cjs +219 -0
  23. package/dist/config-BUw5kHsx.cjs.map +1 -0
  24. package/dist/config-CKA07FxG.mjs +162 -0
  25. package/dist/config-CKA07FxG.mjs.map +1 -0
  26. package/dist/config-Cm3EV1jp.d.mts +320 -0
  27. package/dist/config-Cm3EV1jp.d.mts.map +1 -0
  28. package/dist/config-NSHRd6na.mjs +2 -0
  29. package/dist/config-zZz80Mh5.cjs +1 -0
  30. package/dist/config.cjs +24 -0
  31. package/dist/config.d.mts +3 -0
  32. package/dist/config.mjs +3 -0
  33. package/dist/configPolicy--TNX7feH.mjs +718 -0
  34. package/dist/configPolicy--TNX7feH.mjs.map +1 -0
  35. package/dist/configPolicy-DmsZEp0t.cjs +795 -0
  36. package/dist/configPolicy-DmsZEp0t.cjs.map +1 -0
  37. package/dist/configSchema.cjs +0 -0
  38. package/dist/configSchema.d.mts +2 -0
  39. package/dist/configSchema.mjs +1 -0
  40. package/dist/configWriter-BTuinLjs.cjs +150 -0
  41. package/dist/configWriter-BTuinLjs.cjs.map +1 -0
  42. package/dist/configWriter-BgkGaLrf.mjs +130 -0
  43. package/dist/configWriter-BgkGaLrf.mjs.map +1 -0
  44. package/dist/configWriter.cjs +5 -0
  45. package/dist/configWriter.d.mts +2 -0
  46. package/dist/configWriter.mjs +2 -0
  47. package/dist/domains-CBYkuxs5.cjs +727 -0
  48. package/dist/domains-CBYkuxs5.cjs.map +1 -0
  49. package/dist/domains-DZOu9vYM.mjs +633 -0
  50. package/dist/domains-DZOu9vYM.mjs.map +1 -0
  51. package/dist/domains.cjs +19 -0
  52. package/dist/domains.d.mts +3 -0
  53. package/dist/domains.mjs +3 -0
  54. package/dist/extensions/mcp-ui.mjs +101 -0
  55. package/dist/extensions/mcp-ui.mjs.map +1 -0
  56. package/dist/extensions/mcp.cjs +171 -0
  57. package/dist/extensions/mcp.cjs.map +1 -0
  58. package/dist/extensions/mcp.d.mts +5 -0
  59. package/dist/extensions/mcp.d.mts.map +1 -0
  60. package/dist/extensions/mcp.mjs +166 -0
  61. package/dist/extensions/mcp.mjs.map +1 -0
  62. package/dist/extensions/server.cjs +504 -0
  63. package/dist/extensions/server.cjs.map +1 -0
  64. package/dist/extensions/server.d.mts +5 -0
  65. package/dist/extensions/server.d.mts.map +1 -0
  66. package/dist/extensions/server.mjs +499 -0
  67. package/dist/extensions/server.mjs.map +1 -0
  68. package/dist/harnessState-CCyBeutB.cjs +188 -0
  69. package/dist/harnessState-CCyBeutB.cjs.map +1 -0
  70. package/dist/harnessState-Dn_S7fB9.mjs +163 -0
  71. package/dist/harnessState-Dn_S7fB9.mjs.map +1 -0
  72. package/dist/harnessState.cjs +6 -0
  73. package/dist/harnessState.d.mts +2 -0
  74. package/dist/harnessState.mjs +2 -0
  75. package/dist/harnessStore-CJSxdSkV.cjs +343 -0
  76. package/dist/harnessStore-CJSxdSkV.cjs.map +1 -0
  77. package/dist/harnessStore-CltwLB7M.mjs +262 -0
  78. package/dist/harnessStore-CltwLB7M.mjs.map +1 -0
  79. package/dist/harnessStore.cjs +15 -0
  80. package/dist/harnessStore.d.mts +2 -0
  81. package/dist/harnessStore.mjs +2 -0
  82. package/dist/index-BAaTySaM.d.mts +35 -0
  83. package/dist/index-BAaTySaM.d.mts.map +1 -0
  84. package/dist/index-BT29GZx5.d.mts +142 -0
  85. package/dist/index-BT29GZx5.d.mts.map +1 -0
  86. package/dist/index-B_lp0W3U.d.mts +114 -0
  87. package/dist/index-B_lp0W3U.d.mts.map +1 -0
  88. package/dist/index-C6GaYjq-.d.mts +6 -0
  89. package/dist/index-C6GaYjq-.d.mts.map +1 -0
  90. package/dist/index-CIQrKS1A.d.mts +50 -0
  91. package/dist/index-CIQrKS1A.d.mts.map +1 -0
  92. package/dist/index-CRcoVYXz.d.mts +39 -0
  93. package/dist/index-CRcoVYXz.d.mts.map +1 -0
  94. package/dist/index-CVlciCJF.d.mts +40 -0
  95. package/dist/index-CVlciCJF.d.mts.map +1 -0
  96. package/dist/index-CeOk2kqs.d.mts +118 -0
  97. package/dist/index-CeOk2kqs.d.mts.map +1 -0
  98. package/dist/index-Ch7ptOkW.d.mts +54 -0
  99. package/dist/index-Ch7ptOkW.d.mts.map +1 -0
  100. package/dist/index-Cvdt-Y-i.d.mts +66 -0
  101. package/dist/index-Cvdt-Y-i.d.mts.map +1 -0
  102. package/dist/index-DJpG-I9K.d.mts +122 -0
  103. package/dist/index-DJpG-I9K.d.mts.map +1 -0
  104. package/dist/index-DNk4q0Qm.d.mts +81 -0
  105. package/dist/index-DNk4q0Qm.d.mts.map +1 -0
  106. package/dist/index.cjs +121 -0
  107. package/dist/index.d.mts +15 -0
  108. package/dist/index.mjs +15 -0
  109. package/dist/init-C_9nyp3-.cjs +448 -0
  110. package/dist/init-C_9nyp3-.cjs.map +1 -0
  111. package/dist/init-DJ6wm-dr.mjs +415 -0
  112. package/dist/init-DJ6wm-dr.mjs.map +1 -0
  113. package/dist/init.cjs +7 -0
  114. package/dist/init.d.mts +2 -0
  115. package/dist/init.mjs +2 -0
  116. package/dist/layeredConfig-B922ibgn.mjs +67 -0
  117. package/dist/layeredConfig-B922ibgn.mjs.map +1 -0
  118. package/dist/layeredConfig-DdI5ysUf.cjs +94 -0
  119. package/dist/layeredConfig-DdI5ysUf.cjs.map +1 -0
  120. package/dist/layeredConfig.cjs +6 -0
  121. package/dist/layeredConfig.d.mts +2 -0
  122. package/dist/layeredConfig.mjs +2 -0
  123. package/dist/majorModes-CmPLEpMT.mjs +333 -0
  124. package/dist/majorModes-CmPLEpMT.mjs.map +1 -0
  125. package/dist/majorModes-DPhVMuhT.cjs +383 -0
  126. package/dist/majorModes-DPhVMuhT.cjs.map +1 -0
  127. package/dist/majorModes.cjs +10 -0
  128. package/dist/majorModes.d.mts +2 -0
  129. package/dist/majorModes.mjs +2 -0
  130. package/dist/piConfig-Bx26HMb_.d.mts +33 -0
  131. package/dist/piConfig-Bx26HMb_.d.mts.map +1 -0
  132. package/dist/piConfig-CCBdZXQr.cjs +260 -0
  133. package/dist/piConfig-CCBdZXQr.cjs.map +1 -0
  134. package/dist/piConfig-qGyCbcVj.mjs +197 -0
  135. package/dist/piConfig-qGyCbcVj.mjs.map +1 -0
  136. package/dist/piConfig.cjs +12 -0
  137. package/dist/piConfig.d.mts +2 -0
  138. package/dist/piConfig.mjs +2 -0
  139. package/dist/piContext.cjs +18 -0
  140. package/dist/piContext.d.mts +3 -0
  141. package/dist/piContext.mjs +2 -0
  142. package/dist/profiles-CTrUCmIh.d.mts +27 -0
  143. package/dist/profiles-CTrUCmIh.d.mts.map +1 -0
  144. package/dist/profiles-DnF9DBpd.cjs +552 -0
  145. package/dist/profiles-DnF9DBpd.cjs.map +1 -0
  146. package/dist/profiles-fujQKrS0.mjs +483 -0
  147. package/dist/profiles-fujQKrS0.mjs.map +1 -0
  148. package/dist/profiles.cjs +13 -0
  149. package/dist/profiles.d.mts +25 -0
  150. package/dist/profiles.d.mts.map +1 -0
  151. package/dist/profiles.mjs +2 -0
  152. package/dist/rolldown-runtime-VH7oDXx4.cjs +28 -0
  153. package/dist/selectionSwitch.cjs +70 -0
  154. package/dist/selectionSwitch.cjs.map +1 -0
  155. package/dist/selectionSwitch.d.mts +30 -0
  156. package/dist/selectionSwitch.d.mts.map +1 -0
  157. package/dist/selectionSwitch.mjs +64 -0
  158. package/dist/selectionSwitch.mjs.map +1 -0
  159. package/dist/sessionConfig-Boh4Fdje.cjs +342 -0
  160. package/dist/sessionConfig-Boh4Fdje.cjs.map +1 -0
  161. package/dist/sessionConfig-CtLoc-lO.mjs +240 -0
  162. package/dist/sessionConfig-CtLoc-lO.mjs.map +1 -0
  163. package/dist/types.cjs +9 -0
  164. package/dist/types.d.mts +2 -0
  165. package/dist/types.mjs +2 -0
  166. package/llms.txt +12 -0
  167. package/package.json +206 -0
  168. package/src/prompts/po-author-config/SKILL.md +26 -0
  169. package/src/prompts/po-author-config/agents/openai.yaml +4 -0
  170. package/src/prompts/po-author-config/references/config-contract.md +201 -0
@@ -0,0 +1,201 @@
1
+ # Po runtime configuration authoring contract
2
+
3
+ ## Sources
4
+
5
+ Po loads runtime settings from two files:
6
+
7
+ 1. `~/.po/config.yaml`
8
+ 2. `<repoRoot>/.po/config.yaml`
9
+
10
+ An absent file parses as `projectTrust: ask`. Both files reject unknown keys and invalid value
11
+ types. Parsing and merge policy live in `@agimon-ai/po-config`; packages should not duplicate
12
+ that logic.
13
+
14
+ The runtime file is separate from the three selection-axis catalogs. `modes.yaml` defines major
15
+ modes and layers, `domains.yaml` defines content domains, and `profiles.yaml` defines personas.
16
+ Consult the Help skill owned by the corresponding package when editing those files.
17
+
18
+ ## Runtime schema
19
+
20
+ The supported root keys are:
21
+
22
+ ```yaml
23
+ projectTrust: ask
24
+
25
+ modes:
26
+ planning:
27
+ main:
28
+ model: openai/gpt-5.4
29
+ thinking: high
30
+ subagents:
31
+ model: openai/gpt-5.4-mini
32
+ thinking: medium
33
+ plansDirectory: .po/plans
34
+
35
+ editor:
36
+ command: code
37
+
38
+ voice:
39
+ engine: auto
40
+ language: en
41
+ recorder:
42
+ binary: ffmpeg
43
+ device: none:default
44
+ adapters:
45
+ openai-whisper:
46
+ binary: whisper
47
+ model:
48
+ id: turbo
49
+
50
+ selection:
51
+ majorMode: copilot
52
+ domains: [default]
53
+ profile: reviewer
54
+ ```
55
+
56
+ ### Project trust
57
+
58
+ `projectTrust` accepts `ask`, `always`, or `never`. It is repository policy. The repository value
59
+ is authoritative, and an absent repository value defaults to `ask` rather than inheriting a
60
+ personal value.
61
+
62
+ ### Planning
63
+
64
+ `modes` may contain only `planning`. `planning.main` and `planning.subagents` accept an optional
65
+ non-empty `model` and a `thinking` value from `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, or
66
+ `max`.
67
+
68
+ `plansDirectory` accepts an absolute path, `~`, `~/...`, or a path relative to the active repository
69
+ root. If omitted, it resolves to `~/.po/plans`. Other home aliases such as `~other/...` are rejected.
70
+
71
+ This `modes.planning` namespace configures the planning runtime. It does not define major modes from
72
+ `modes.yaml`.
73
+
74
+ ### Editor
75
+
76
+ `editor` may contain only a non-empty `command`. Editor choice is personal, so the effective value
77
+ comes from the personal config.
78
+
79
+ ### Voice
80
+
81
+ `voice.engine` accepts `auto`, `whisper-cpp`, `openai-whisper`, or `mlx-whisper`. `language`, recorder
82
+ binary, and recorder device are optional non-empty strings.
83
+
84
+ Adapters may be declared only for those three concrete engines. An adapter may set a binary and must
85
+ set a model containing exactly one of `path` or `id`. `whisper-cpp` accepts only a path. The OpenAI
86
+ and MLX adapters accept either form.
87
+
88
+ Autonomous capture is personal-only and belongs in `~/.po/config.yaml`:
89
+
90
+ ```yaml
91
+ voice:
92
+ autoCapture:
93
+ model: openai/gpt-4.1-mini
94
+ startPhrases: [hey doom]
95
+ stopPhrases: [stop speaking]
96
+ utteranceIdleMs: 3000
97
+ transcriptionTimeoutMs: 120000
98
+ tts:
99
+ engine: macos-say
100
+ voice: Samantha
101
+ rate: 190
102
+ ```
103
+
104
+ The model must use `provider/model-id` form. Control phrases must be non-empty, bounded strings and
105
+ must remain unique after normalization. Idle time accepts 1500 through 10000 milliseconds. The
106
+ transcription timeout accepts 1000 through 120000 milliseconds and defaults to 120000 milliseconds
107
+ so cold local ASR model startup is covered. TTS currently accepts only `macos-say`, with an optional
108
+ rate from 80 through 500. Repository `voice.autoCapture` is rejected.
109
+
110
+ ### Default selection
111
+
112
+ `selection` may contain a non-empty `majorMode`, an array of string `domains`, and a non-empty
113
+ `profile`. An empty domains array intentionally selects no content domains.
114
+
115
+ These values choose defaults only. They do not define any mode, domain, or profile.
116
+
117
+ When a repository declares `selection`, repeat every personal axis that should remain selected.
118
+ Parsed omitted keys become unset, so the effective file-loaded selection contains the repository's
119
+ declared values rather than inheriting omitted personal axes.
120
+
121
+ ## Source merge rules
122
+
123
+ Merge behavior is field-specific:
124
+
125
+ - `projectTrust` comes from the repository parse result. Missing repository configuration produces
126
+ the `ask` default.
127
+ - `editor` comes from personal configuration. A repository editor value is not selected.
128
+ - `modes.planning.main` and `modes.planning.subagents` merge their fields, with repository fields
129
+ replacing personal fields. Repository `plansDirectory` replaces the personal value when present.
130
+ - `voice` merges with repository fields replacing personal fields. Recorder fields merge. Adapter
131
+ binary fields merge, while a repository adapter model replaces the personal model as one value.
132
+ - `voice.autoCapture` remains the personal value. Declaring it in repository configuration is an
133
+ error.
134
+ - If neither file declares `selection`, it remains absent. When only one file declares it, that
135
+ mapping supplies the defaults. When the repository declares `selection`, its parsed mapping
136
+ replaces personal values for omitted axes as well as axes it sets.
137
+
138
+ Do not assume one generic deep-merge rule or copy this policy into consumers. Call `loadDoomConfig`
139
+ or use the live service snapshot.
140
+
141
+ ## Immutable Cordis context
142
+
143
+ `@agimon-ai/po-config/extensions/pi` provides `DOOM_CONFIG_SERVICE` on the runner's shared Cordis
144
+ session branch. Consume it inside an owning injection:
145
+
146
+ ```ts
147
+ cordis.inject([DOOM_CONFIG_SERVICE], (configContext) => {
148
+ const snapshot = requireDoomConfigContext(configContext);
149
+ const settings = snapshot.settings;
150
+ const active = snapshot.harness;
151
+ const pending = snapshot.pendingSelection;
152
+ const requiresRelaunch = snapshot.requiresRelaunch;
153
+
154
+ return () => disposeConsumer();
155
+ });
156
+ ```
157
+
158
+ The full snapshot is deeply frozen:
159
+
160
+ - `settings` is the merged `config.yaml` result.
161
+ - `harness` is the active launcher and synchronized composition state.
162
+ - `pendingSelection` is the latest unacknowledged transition target, when one exists.
163
+ - `requiresRelaunch` reports whether active state still differs from pending intent.
164
+
165
+ The provider publishes a new snapshot for a replacement session. Never mutate a snapshot, keep it
166
+ at module scope, or retain it after the injection is disposed. Consumers that register Pi callbacks
167
+ may close over an active Cordis context only when their injection cleanup clears that binding.
168
+
169
+ ## Cross-axis transition state
170
+
171
+ Major-mode, domain, and profile packages own resolution and user interaction for their respective
172
+ axes. The transition coordinator serializes their requests against the current session,
173
+ configuration generation, and synchronized artifacts.
174
+
175
+ Config supplies two append-only Pi custom entry types:
176
+
177
+ - `po:config:v1` records a complete selected major mode, domains list, optional profile, and
178
+ optional composition fingerprint.
179
+ - `po:transition:v1` records an operation ID, active selection, target selection, strategy, and
180
+ `pending`, `applied`, `aborted`, or `superseded` phase.
181
+
182
+ Active selection and pending intent are different state. A reload-capable transition stages the
183
+ target harness and appends journal entries before calling Pi reload. A launcher-owned composition
184
+ change keeps pending intent for process relaunch. A fresh session acknowledges a pending record only
185
+ when both the exact target selection and composition fingerprint are active.
186
+
187
+ Pre-application failure must not claim the target as active. Do not bypass the coordinator, mutate
188
+ `snapshot.harness`, or treat environment transport as the durable journal.
189
+
190
+ ## Verification
191
+
192
+ ```sh
193
+ pnpm nx test @agimon-ai/po-config
194
+ pnpm nx typecheck @agimon-ai/po-config
195
+ pnpm nx build @agimon-ai/po-config
196
+ pnpm nx test @agimon-ai/po
197
+ pnpm --filter @agimon-ai/po exec po --explain
198
+ ```
199
+
200
+ Run a parent-session smoke test when changing Cordis publication, provider replacement, reload, or
201
+ process-relaunch behavior.