@venizia/vulcan 0.4.9-0 → 0.4.9-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 (141) hide show
  1. package/base/extensions/vulcan-guards.ts +48 -41
  2. package/base/hooks/antigravity-guards.ts +2 -2
  3. package/base/hooks/codex-guards.ts +15 -5
  4. package/base/hooks/guard-git.ts +8 -8
  5. package/base/hooks/guard-manifest.ts +4 -5
  6. package/base/hooks/guard-outside.ts +8 -8
  7. package/base/hooks/guard-package.ts +5 -6
  8. package/base/hooks/guard-remote-hosts.ts +6 -7
  9. package/base/hooks/guard-scripting.ts +5 -6
  10. package/base/hooks/guard-writes.ts +8 -9
  11. package/base/hooks/post-tool.ts +2 -2
  12. package/base/hooks/prompt-submit.ts +2 -2
  13. package/base/hooks/session-start.ts +3 -3
  14. package/base/hooks/stop.ts +2 -2
  15. package/base/hooks/subagent-start.ts +2 -2
  16. package/base/skills/docs-update/SKILL.md +4 -2
  17. package/base/skills/visualize-work/SKILL.md +9 -0
  18. package/package.json +3 -3
  19. package/src/agents/atlas-block.ts +43 -43
  20. package/src/agents/codex-hooks.ts +45 -43
  21. package/src/agents/detect.ts +19 -16
  22. package/src/agents/exclude.ts +96 -97
  23. package/src/agents/hooks-json.ts +38 -36
  24. package/src/agents/local.ts +46 -43
  25. package/src/agents/prompt.ts +45 -42
  26. package/src/agents/render.ts +201 -195
  27. package/src/agents/resolve.ts +133 -134
  28. package/src/agents/table.ts +12 -8
  29. package/src/commands/add.command.ts +2 -2
  30. package/src/commands/agents.command.ts +11 -17
  31. package/src/commands/clean.command.ts +6 -6
  32. package/src/commands/doctor.command.ts +4 -4
  33. package/src/commands/init.command.ts +12 -8
  34. package/src/commands/preset.command.ts +2 -2
  35. package/src/commands/profile.command.ts +42 -49
  36. package/src/commands/sync.command.ts +109 -111
  37. package/src/commands/upgrade.command.ts +80 -75
  38. package/src/commands/visualize.command.ts +7 -13
  39. package/src/commands/x.command.ts +55 -50
  40. package/src/common/format.ts +23 -21
  41. package/src/common/json.ts +8 -5
  42. package/src/common/layout-folder.ts +94 -91
  43. package/src/common/paths.ts +14 -12
  44. package/src/config/loader.ts +52 -49
  45. package/src/config/packages.ts +14 -11
  46. package/src/config/schema.ts +3 -3
  47. package/src/create/add-app.ts +519 -509
  48. package/src/create/add-lib.ts +237 -240
  49. package/src/create/bunfig.ts +26 -23
  50. package/src/create/checks.ts +36 -34
  51. package/src/create/diff.ts +21 -23
  52. package/src/create/dockerignore.ts +26 -24
  53. package/src/create/files.ts +7 -5
  54. package/src/create/init-monorepo.ts +75 -80
  55. package/src/create/lib-preset.ts +59 -63
  56. package/src/create/manifest-json.ts +10 -4
  57. package/src/create/names.ts +217 -210
  58. package/src/create/next.ts +26 -23
  59. package/src/create/plan.ts +15 -12
  60. package/src/create/preset-diff.ts +301 -303
  61. package/src/create/preset-menu.ts +38 -32
  62. package/src/create/preset.ts +202 -197
  63. package/src/create/process.ts +79 -72
  64. package/src/create/scratch.ts +48 -49
  65. package/src/create/workspace.ts +404 -396
  66. package/src/doctor/checks.ts +1027 -1014
  67. package/src/doctor/makefile.ts +17 -13
  68. package/src/doctor/runner.ts +88 -118
  69. package/src/doctor/skills.ts +97 -95
  70. package/src/doctor/tags.ts +42 -37
  71. package/src/hooks/codex-patch.ts +25 -22
  72. package/src/hooks/command-view.ts +44 -39
  73. package/src/hooks/decision.ts +37 -37
  74. package/src/hooks/guard-git.ts +51 -49
  75. package/src/hooks/guard-manifest.ts +58 -55
  76. package/src/hooks/guard-outside.ts +93 -91
  77. package/src/hooks/guard-package.ts +82 -79
  78. package/src/hooks/guard-scripting.ts +19 -14
  79. package/src/hooks/guard-writes.ts +154 -149
  80. package/src/hooks/owner-reply.ts +127 -127
  81. package/src/hooks/post-tool.ts +94 -93
  82. package/src/hooks/project-guards.ts +65 -62
  83. package/src/hooks/project-tmp.ts +27 -24
  84. package/src/hooks/remote-hosts.ts +153 -130
  85. package/src/hooks/session-digest.ts +98 -101
  86. package/src/hooks/shell.ts +509 -499
  87. package/src/hooks/subagent-card.ts +11 -7
  88. package/src/hooks/trusted-scripts.ts +106 -104
  89. package/src/init/scaffold.ts +135 -132
  90. package/src/local/clean.ts +38 -36
  91. package/src/local/format.ts +21 -17
  92. package/src/local/scan.ts +144 -138
  93. package/src/manifest/render.ts +110 -104
  94. package/src/owner/card.ts +51 -46
  95. package/src/owner/profile.ts +99 -93
  96. package/src/owner/reply-switch.ts +9 -6
  97. package/src/owner/shape.ts +71 -69
  98. package/src/owner/survey.ts +173 -171
  99. package/src/owner/view.ts +62 -59
  100. package/src/owner/violations.ts +119 -123
  101. package/src/rules/base.ts +15 -11
  102. package/src/rules/parser.ts +39 -32
  103. package/src/rules/slots.ts +8 -6
  104. package/src/signals/claims.ts +30 -28
  105. package/src/signals/classify.ts +38 -33
  106. package/src/signals/loop.ts +39 -37
  107. package/src/signals/state.ts +79 -81
  108. package/src/skills/frontmatter.ts +28 -28
  109. package/src/sync/agent-files.ts +217 -199
  110. package/src/sync/agent-removal.ts +56 -59
  111. package/src/sync/atlas-block.ts +45 -43
  112. package/src/sync/base-rules.ts +32 -30
  113. package/src/sync/claude-launch.ts +36 -34
  114. package/src/sync/exclude.ts +77 -69
  115. package/src/sync/local-choice.ts +50 -47
  116. package/src/sync/planner.ts +59 -61
  117. package/src/sync/prune.ts +52 -48
  118. package/src/sync/settings.ts +166 -167
  119. package/src/ui/capability.ts +12 -7
  120. package/src/ui/keyboard.ts +38 -38
  121. package/src/ui/prompt.ts +79 -77
  122. package/src/visualize/assets.ts +33 -24
  123. package/src/visualize/charts.ts +179 -176
  124. package/src/visualize/compare-css.ts +3 -2
  125. package/src/visualize/compare-render.ts +9 -7
  126. package/src/visualize/diagrams.ts +189 -174
  127. package/src/visualize/grid-span.ts +34 -0
  128. package/src/visualize/icons.ts +7 -5
  129. package/src/visualize/kinds-render.ts +50 -45
  130. package/src/visualize/kinds-validate.ts +12 -10
  131. package/src/visualize/labels.ts +21 -17
  132. package/src/visualize/layout.ts +112 -97
  133. package/src/visualize/page.ts +92 -104
  134. package/src/visualize/render.ts +143 -140
  135. package/src/visualize/sections.ts +395 -384
  136. package/src/visualize/sources.ts +2 -2
  137. package/src/visualize/theme.ts +12 -10
  138. package/src/visualize/validate.ts +13 -9
  139. package/src/wiki/anchors.ts +38 -36
  140. package/src/wiki/command.ts +4 -4
  141. package/src/wiki/source-links.ts +46 -44
@@ -403,92 +403,94 @@ const styleProblems = (opts: { lines: string[]; view: IOwnerView }): string[] =>
403
403
  return classes;
404
404
  };
405
405
 
406
- /**
407
- * Checks one reply to the owner against the resolved shape: a headline that is a sentence within the
408
- * cap, the minimap table with the configured header and only the configured statuses, the Blocked line,
409
- * the decisions list with the recommendation in each item or exactly the none string, and the order. Each
410
- * section is looked for after the one before it, so a headline that begins with a label is still a
411
- * headline. Pure and deterministic; what it cannot see (whether a point has a plain meaning, whether the
412
- * answer is right) is for an eval or the owner. A reply under `shortReplyWords` is exempt, and a person
413
- * who asked for headline-only reports is held to the headline and the style only. In the `free` label mode
414
- * (a language that is not English with no label set) no word is expected: the table, a labelled blocker
415
- * line and a decisions heading with a numbered list or one line are looked for, and the status words and
416
- * the recommendation are not checked.
417
- */
418
- export const checkOwnerShape = (opts: { text: string; view: IOwnerView }): IShapeResult => {
419
- const { text, view } = opts;
420
-
421
- if (text.trim() === '' || text.trim().split(/\s+/).length < view.shortReplyWords) {
422
- return { isChecked: false, classes: [] };
423
- }
424
-
425
- const lines = proseLinesOf({ text });
426
- const classes: string[] = [];
427
- const isHeadlineOnly = view.reportDetail === OwnerDetails.HEADLINE;
428
- let cursor = 0;
429
- let isOutOfOrder = false;
406
+ export class OwnerShape {
407
+ /**
408
+ * Checks one reply to the owner against the resolved shape: a headline that is a sentence within the
409
+ * cap, the minimap table with the configured header and only the configured statuses, the Blocked line,
410
+ * the decisions list with the recommendation in each item or exactly the none string, and the order. Each
411
+ * section is looked for after the one before it, so a headline that begins with a label is still a
412
+ * headline. Pure and deterministic; what it cannot see (whether a point has a plain meaning, whether the
413
+ * answer is right) is for an eval or the owner. A reply under `shortReplyWords` is exempt, and a person
414
+ * who asked for headline-only reports is held to the headline and the style only. In the `free` label mode
415
+ * (a language that is not English with no label set) no word is expected: the table, a labelled blocker
416
+ * line and a decisions heading with a numbered list or one line are looked for, and the status words and
417
+ * the recommendation are not checked.
418
+ */
419
+ static check(opts: { text: string; view: IOwnerView }): IShapeResult {
420
+ const { text, view } = opts;
421
+
422
+ if (text.trim() === '' || text.trim().split(/\s+/).length < view.shortReplyWords) {
423
+ return { isChecked: false, classes: [] };
424
+ }
430
425
 
431
- for (const section of view.shape) {
432
- if (section === OwnerSections.HEADLINE) {
433
- const found = headlineOf({ lines, view });
426
+ const lines = proseLinesOf({ text });
427
+ const classes: string[] = [];
428
+ const isHeadlineOnly = view.reportDetail === OwnerDetails.HEADLINE;
429
+ let cursor = 0;
430
+ let isOutOfOrder = false;
434
431
 
435
- classes.push(...found.problems);
436
- cursor = found.end;
432
+ for (const section of view.shape) {
433
+ if (section === OwnerSections.HEADLINE) {
434
+ const found = headlineOf({ lines, view });
437
435
 
438
- continue;
439
- }
436
+ classes.push(...found.problems);
437
+ cursor = found.end;
440
438
 
441
- if (isHeadlineOnly) {
442
- continue;
443
- }
439
+ continue;
440
+ }
444
441
 
445
- const isFree = view.labelMode === OwnerLabelModes.FREE;
446
- const run = (from: number): IFound => {
447
- if (section === OwnerSections.MINIMAP) {
448
- return isFree ? freeMinimapFrom({ lines, from }) : minimapFrom({ lines, view, from });
442
+ if (isHeadlineOnly) {
443
+ continue;
449
444
  }
450
445
 
451
- if (section === OwnerSections.BLOCKED) {
452
- if (isFree) {
453
- return freeBlockedFrom({ lines, from });
446
+ const isFree = view.labelMode === OwnerLabelModes.FREE;
447
+ const run = (from: number): IFound => {
448
+ if (section === OwnerSections.MINIMAP) {
449
+ return isFree ? freeMinimapFrom({ lines, from }) : minimapFrom({ lines, view, from });
454
450
  }
455
451
 
456
- const at = findLabelFrom({ lines, label: view.labels.labels.blocked, from });
452
+ if (section === OwnerSections.BLOCKED) {
453
+ if (isFree) {
454
+ return freeBlockedFrom({ lines, from });
455
+ }
457
456
 
458
- return { at, problems: at === -1 ? [ShapeClasses.BLOCKED_MISSING] : [] };
459
- }
457
+ const at = findLabelFrom({ lines, label: view.labels.labels.blocked, from });
460
458
 
461
- if (section === OwnerSections.DECISIONS) {
462
- return isFree ? freeDecisionsFrom({ lines, from }) : decisionsFrom({ lines, view, from });
463
- }
459
+ return { at, problems: at === -1 ? [ShapeClasses.BLOCKED_MISSING] : [] };
460
+ }
464
461
 
465
- return { at: -1, problems: [] };
466
- };
467
- const after = run(cursor);
462
+ if (section === OwnerSections.DECISIONS) {
463
+ return isFree ? freeDecisionsFrom({ lines, from }) : decisionsFrom({ lines, view, from });
464
+ }
468
465
 
469
- if (after.at !== -1 || section === OwnerSections.DETAIL) {
470
- classes.push(...after.problems);
471
- cursor = after.at === -1 ? cursor : after.at + 1;
466
+ return { at: -1, problems: [] };
467
+ };
468
+ const after = run(cursor);
472
469
 
473
- continue;
474
- }
470
+ if (after.at !== -1 || section === OwnerSections.DETAIL) {
471
+ classes.push(...after.problems);
472
+ cursor = after.at === -1 ? cursor : after.at + 1;
475
473
 
476
- // Not after the section before it: present earlier means out of order, nowhere means missing.
477
- const anywhere = run(0);
474
+ continue;
475
+ }
476
+
477
+ // Not after the section before it: present earlier means out of order, nowhere means missing.
478
+ const anywhere = run(0);
478
479
 
479
- if (anywhere.at === -1) {
480
- classes.push(...anywhere.problems);
481
- } else {
482
- isOutOfOrder = true;
483
- classes.push(...anywhere.problems);
480
+ if (anywhere.at === -1) {
481
+ classes.push(...anywhere.problems);
482
+ } else {
483
+ isOutOfOrder = true;
484
+ classes.push(...anywhere.problems);
485
+ }
484
486
  }
485
- }
486
487
 
487
- if (isOutOfOrder) {
488
- classes.push(ShapeClasses.SECTION_ORDER);
489
- }
488
+ if (isOutOfOrder) {
489
+ classes.push(ShapeClasses.SECTION_ORDER);
490
+ }
490
491
 
491
- classes.push(...styleProblems({ lines, view }));
492
+ classes.push(...styleProblems({ lines, view }));
492
493
 
493
- return { isChecked: true, classes: [...new Set(classes)] };
494
- };
494
+ return { isChecked: true, classes: [...new Set(classes)] };
495
+ }
496
+ }
@@ -1,6 +1,6 @@
1
1
  import { OwnerConstants, OwnerDetails, OwnerFormalities, OwnerTones } from './constants.ts';
2
2
  import { OWNER_LABEL_SET, PROFILE_SCHEMA } from './schema.ts';
3
- import { isEnglishLanguage } from './view.ts';
3
+ import { OwnerView } from './view.ts';
4
4
  import type { TOwnerLabelSet, TProfile } from './schema.ts';
5
5
 
6
6
  interface ISurveyChoice {
@@ -26,14 +26,6 @@ export interface ISurveyIo {
26
26
  confirm: (opts: { message: string; initial: boolean }) => Promise<boolean | null>;
27
27
  }
28
28
 
29
- /** The language of the machine as a code (`vi` from `vi_VN.UTF-8`), or English. */
30
- export const systemLanguageOf = (opts: { env: Record<string, string | undefined> }): string => {
31
- const raw = opts.env.LC_ALL ?? opts.env.LC_MESSAGES ?? opts.env.LANG ?? '';
32
- const code = /^([a-z]{2,3})(?:[_.@-]|$)/.exec(raw)?.[1];
33
-
34
- return code ?? OwnerConstants.DEFAULT_LANGUAGE;
35
- };
36
-
37
29
  const labelProblem = (value: string): string | undefined =>
38
30
  OwnerConstants.LABEL_PATTERN.test(value)
39
31
  ? undefined
@@ -122,178 +114,188 @@ const askLabels = async (opts: { io: ISurveyIo }): Promise<TOwnerLabelSet | null
122
114
  });
123
115
  };
124
116
 
125
- /**
126
- * The questions, in order, each with a default taken on an empty answer and each skippable: the
127
- * reply language, how to address the person, tone, report detail, working habits, a free line in their
128
- * words and code taste, and - for a language that is not English - whether to type the words for the report or let the agent write them. Nothing is
129
- * inferred from the answers. `existing` supplies the defaults when the form is run again. Returns the
130
- * profile, or `null` when the user cancelled.
131
- */
132
- export const runSurvey = async (opts: {
133
- io: ISurveyIo;
134
- existing?: TProfile;
135
- systemLanguage: string;
136
- }): Promise<TProfile | null> => {
137
- const { io, existing } = opts;
138
- const text = async (
139
- message: string,
140
- defaultValue: string,
141
- validate?: (value: string) => string | undefined,
142
- ) => io.text({ message, defaultValue, validate });
143
- /** An optional free value: a single dash clears what an earlier run set. */
144
- const optional = async (
145
- message: string,
146
- defaultValue: string,
147
- validate?: (value: string) => string | undefined,
148
- ) => {
149
- const answer = await io.text({
150
- message: defaultValue === '' ? message : `${message} (${CLEAR_ANSWER} clears it)`,
151
- defaultValue,
152
- validate: (value) => (value === CLEAR_ANSWER ? undefined : validate?.(value)),
153
- });
154
-
155
- return answer === CLEAR_ANSWER ? '' : answer;
156
- };
157
- const language = await text(
158
- 'Reply language (a code such as en, fr, pt-BR)',
159
- existing?.language ?? opts.systemLanguage,
160
- languageProblem,
161
- );
117
+ export class OwnerSurvey {
118
+ /** The language of the machine as a code (`vi` from `vi_VN.UTF-8`), or English. */
119
+ static systemLanguageOf(opts: { env: Record<string, string | undefined> }): string {
120
+ const raw = opts.env.LC_ALL ?? opts.env.LC_MESSAGES ?? opts.env.LANG ?? '';
121
+ const code = /^([a-z]{2,3})(?:[_.@-]|$)/.exec(raw)?.[1];
162
122
 
163
- if (language === null) {
164
- return null;
123
+ return code ?? OwnerConstants.DEFAULT_LANGUAGE;
165
124
  }
166
125
 
167
- const you = await optional(
168
- 'How should I address you? (a name, a pronoun, an honorific, or leave empty for none)',
169
- existing?.address.you ?? '',
170
- optionalLabelProblem,
171
- );
172
- // Each question is asked only when the one before it was answered.
173
- const askingSelf =
174
- you === null
175
- ? null
176
- : optional(
177
- 'How should I refer to myself? (leave empty for neutral)',
178
- existing?.address.self ?? '',
179
- optionalLabelProblem,
180
- );
181
- const self = await askingSelf;
182
- const askingFormality =
183
- self === null
184
- ? null
185
- : io.select({
186
- message: 'How formal should I be?',
187
- choices: choicesOf({ set: OwnerFormalities.SCHEME_SET }),
188
- initial: existing?.address.formality ?? OwnerFormalities.NEUTRAL,
189
- });
190
- const formality = await askingFormality;
191
- const askingTone =
192
- formality === null
193
- ? null
194
- : io.select({
195
- message: 'Tone',
196
- choices: choicesOf({ set: OwnerTones.SCHEME_SET }),
197
- initial: existing?.tone ?? OwnerTones.NEUTRAL,
198
- });
199
- const tone = await askingTone;
200
- const askingReportDetail =
201
- tone === null
202
- ? null
203
- : io.select({
204
- message: 'Reports: headline only, or headline plus tables?',
205
- choices: choicesOf({ set: OwnerDetails.SCHEME_SET }),
206
- initial: existing?.reportDetail ?? OwnerDetails.TABLES,
207
- });
208
- const reportDetail = await askingReportDetail;
209
- const askingAsk =
210
- reportDetail === null
211
- ? null
212
- : io.confirm({
213
- message:
214
- 'For a choice that can be undone, ask you first? (no: state a default and continue)',
215
- initial: existing?.habits.askBeforeReversible ?? false,
216
- });
217
- const ask = await askingAsk;
218
- const askingCommits =
219
- ask === null
220
- ? null
221
- : io.confirm({
222
- message: 'Propose commits when a piece of work is done?',
223
- initial: existing?.habits.proposeCommits ?? false,
224
- });
225
- const commits = await askingCommits;
226
- const askingAbout =
227
- commits === null
228
- ? null
229
- : optional(
230
- 'Anything about how you like to work, or to be worked with? (your own words, optional)',
231
- existing?.about ?? '',
232
- aboutProblem,
233
- );
234
- const about = await askingAbout;
235
- const askingCodeTaste =
236
- about === null
237
- ? null
238
- : optional(
239
- 'Taste in code that no formatter or lint rule already enforces? (optional)',
240
- existing?.codeTaste ?? '',
241
- codeTasteProblem,
242
- );
243
- const codeTaste = await askingCodeTaste;
244
-
245
- if (
246
- [you, self, formality, tone, reportDetail, ask, commits, about, codeTaste].some(
247
- (answer) => answer === null,
248
- )
249
- ) {
250
- return null;
251
- }
252
-
253
- const labels: Record<string, TOwnerLabelSet> = { ...existing?.labels };
254
-
255
- if (!isEnglishLanguage({ language }) && !(language in labels)) {
256
- const typed = await io.select({
257
- message: `Words for reports in ${language}: no set ships. Let the agent write them in ${language} (only the structure is checked), or type them now?`,
258
- choices: [
259
- { value: 'keep', label: `let the agent write them in ${language}` },
260
- { value: 'type', label: 'type them now' },
261
- ],
262
- initial: 'keep',
263
- });
126
+ /**
127
+ * The questions, in order, each with a default taken on an empty answer and each skippable: the
128
+ * reply language, how to address the person, tone, report detail, working habits, a free line in their
129
+ * words and code taste, and - for a language that is not English - whether to type the words for the report or let the agent write them. Nothing is
130
+ * inferred from the answers. `existing` supplies the defaults when the form is run again. Returns the
131
+ * profile, or `null` when the user cancelled.
132
+ */
133
+ static async run(opts: {
134
+ io: ISurveyIo;
135
+ existing?: TProfile;
136
+ systemLanguage: string;
137
+ }): Promise<TProfile | null> {
138
+ const { io, existing } = opts;
139
+ const text = async (
140
+ message: string,
141
+ defaultValue: string,
142
+ validate?: (value: string) => string | undefined,
143
+ ) => io.text({ message, defaultValue, validate });
144
+ /** An optional free value: a single dash clears what an earlier run set. */
145
+ const optional = async (
146
+ message: string,
147
+ defaultValue: string,
148
+ validate?: (value: string) => string | undefined,
149
+ ) => {
150
+ const answer = await io.text({
151
+ message: defaultValue === '' ? message : `${message} (${CLEAR_ANSWER} clears it)`,
152
+ defaultValue,
153
+ validate: (value) => (value === CLEAR_ANSWER ? undefined : validate?.(value)),
154
+ });
155
+
156
+ return answer === CLEAR_ANSWER ? '' : answer;
157
+ };
158
+ const language = await text(
159
+ 'Reply language (a code such as en, fr, pt-BR)',
160
+ existing?.language ?? opts.systemLanguage,
161
+ languageProblem,
162
+ );
163
+
164
+ if (language === null) {
165
+ return null;
166
+ }
264
167
 
265
- if (typed === null) {
168
+ const you = await optional(
169
+ 'How should I address you? (a name, a pronoun, an honorific, or leave empty for none)',
170
+ existing?.address.you ?? '',
171
+ optionalLabelProblem,
172
+ );
173
+ // Each question is asked only when the one before it was answered.
174
+ const askingSelf =
175
+ you === null
176
+ ? null
177
+ : optional(
178
+ 'How should I refer to myself? (leave empty for neutral)',
179
+ existing?.address.self ?? '',
180
+ optionalLabelProblem,
181
+ );
182
+ const self = await askingSelf;
183
+ const askingFormality =
184
+ self === null
185
+ ? null
186
+ : io.select({
187
+ message: 'How formal should I be?',
188
+ choices: choicesOf({ set: OwnerFormalities.SCHEME_SET }),
189
+ initial: existing?.address.formality ?? OwnerFormalities.NEUTRAL,
190
+ });
191
+ const formality = await askingFormality;
192
+ const askingTone =
193
+ formality === null
194
+ ? null
195
+ : io.select({
196
+ message: 'Tone',
197
+ choices: choicesOf({ set: OwnerTones.SCHEME_SET }),
198
+ initial: existing?.tone ?? OwnerTones.NEUTRAL,
199
+ });
200
+ const tone = await askingTone;
201
+ const askingReportDetail =
202
+ tone === null
203
+ ? null
204
+ : io.select({
205
+ message: 'Reports: headline only, or headline plus tables?',
206
+ choices: choicesOf({ set: OwnerDetails.SCHEME_SET }),
207
+ initial: existing?.reportDetail ?? OwnerDetails.TABLES,
208
+ });
209
+ const reportDetail = await askingReportDetail;
210
+ const askingAsk =
211
+ reportDetail === null
212
+ ? null
213
+ : io.confirm({
214
+ message:
215
+ 'For a choice that can be undone, ask you first? (no: state a default and continue)',
216
+ initial: existing?.habits.askBeforeReversible ?? false,
217
+ });
218
+ const ask = await askingAsk;
219
+ const askingCommits =
220
+ ask === null
221
+ ? null
222
+ : io.confirm({
223
+ message: 'Propose commits when a piece of work is done?',
224
+ initial: existing?.habits.proposeCommits ?? false,
225
+ });
226
+ const commits = await askingCommits;
227
+ const askingAbout =
228
+ commits === null
229
+ ? null
230
+ : optional(
231
+ 'Anything about how you like to work, or to be worked with? (your own words, optional)',
232
+ existing?.about ?? '',
233
+ aboutProblem,
234
+ );
235
+ const about = await askingAbout;
236
+ const askingCodeTaste =
237
+ about === null
238
+ ? null
239
+ : optional(
240
+ 'Taste in code that no formatter or lint rule already enforces? (optional)',
241
+ existing?.codeTaste ?? '',
242
+ codeTasteProblem,
243
+ );
244
+ const codeTaste = await askingCodeTaste;
245
+
246
+ if (
247
+ [you, self, formality, tone, reportDetail, ask, commits, about, codeTaste].some(
248
+ (answer) => answer === null,
249
+ )
250
+ ) {
266
251
  return null;
267
252
  }
268
253
 
269
- if (typed === 'type') {
270
- const set = await askLabels({ io });
254
+ const labels: Record<string, TOwnerLabelSet> = { ...existing?.labels };
255
+
256
+ if (!OwnerView.isEnglishLanguage({ language }) && !(language in labels)) {
257
+ const typed = await io.select({
258
+ message: `Words for reports in ${language}: no set ships. Let the agent write them in ${language} (only the structure is checked), or type them now?`,
259
+ choices: [
260
+ { value: 'keep', label: `let the agent write them in ${language}` },
261
+ { value: 'type', label: 'type them now' },
262
+ ],
263
+ initial: 'keep',
264
+ });
271
265
 
272
- if (set === null) {
266
+ if (typed === null) {
273
267
  return null;
274
268
  }
275
269
 
276
- labels[language] = set;
270
+ if (typed === 'type') {
271
+ const set = await askLabels({ io });
272
+
273
+ if (set === null) {
274
+ return null;
275
+ }
276
+
277
+ labels[language] = set;
278
+ }
277
279
  }
278
- }
279
280
 
280
- return PROFILE_SCHEMA.parse({
281
- schemaVersion: OwnerConstants.PROFILE_SCHEMA_VERSION,
282
- language,
283
- address: {
284
- ...(you === '' || you === null ? {} : { you }),
285
- ...(self === '' || self === null ? {} : { self }),
286
- formality,
287
- },
288
- tone,
289
- reportDetail,
290
- habits: { askBeforeReversible: ask, proposeCommits: commits },
291
- ...(about === '' || about === null ? {} : { about }),
292
- ...(codeTaste === '' || codeTaste === null ? {} : { codeTaste }),
293
- ...(existing?.enforce === undefined ? {} : { enforce: existing.enforce }),
294
- ...(existing?.shortReplyWords === undefined
295
- ? {}
296
- : { shortReplyWords: existing.shortReplyWords }),
297
- labels,
298
- });
299
- };
281
+ return PROFILE_SCHEMA.parse({
282
+ schemaVersion: OwnerConstants.PROFILE_SCHEMA_VERSION,
283
+ language,
284
+ address: {
285
+ ...(you === '' || you === null ? {} : { you }),
286
+ ...(self === '' || self === null ? {} : { self }),
287
+ formality,
288
+ },
289
+ tone,
290
+ reportDetail,
291
+ habits: { askBeforeReversible: ask, proposeCommits: commits },
292
+ ...(about === '' || about === null ? {} : { about }),
293
+ ...(codeTaste === '' || codeTaste === null ? {} : { codeTaste }),
294
+ ...(existing?.enforce === undefined ? {} : { enforce: existing.enforce }),
295
+ ...(existing?.shortReplyWords === undefined
296
+ ? {}
297
+ : { shortReplyWords: existing.shortReplyWords }),
298
+ labels,
299
+ });
300
+ }
301
+ }