@buffcore/cli 0.8.47 → 0.8.49

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 (175) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/commands/build/server-text.en.d.ts +5 -0
  3. package/dist/commands/build/server-text.en.js +5 -0
  4. package/dist/commands/build/server-text.js +5 -0
  5. package/dist/commands/build/server.d.ts +4 -0
  6. package/dist/commands/build/server.js +10 -1
  7. package/dist/commands/change-merge-serial.d.ts +6 -2
  8. package/dist/commands/change-merge-serial.js +5 -1
  9. package/dist/commands/change-merge.d.ts +2 -2
  10. package/dist/commands/change.js +3 -0
  11. package/dist/commands/check-skills.d.ts +16 -0
  12. package/dist/commands/check-skills.en.d.ts +14 -0
  13. package/dist/commands/check-skills.en.js +14 -0
  14. package/dist/commands/check-skills.es.d.ts +2 -0
  15. package/dist/commands/check-skills.es.js +14 -0
  16. package/dist/commands/check-skills.js +146 -0
  17. package/dist/commands/check.js +5 -0
  18. package/dist/commands/dev.d.ts +9 -2
  19. package/dist/commands/dev.js +24 -5
  20. package/dist/commands/extension/config-text.d.ts +2 -0
  21. package/dist/commands/extension/config-text.js +2 -0
  22. package/dist/commands/extension/index.js +14 -2
  23. package/dist/commands/extension/new.d.ts +16 -0
  24. package/dist/commands/extension/new.js +52 -0
  25. package/dist/commands/extension/pack-files.d.ts +23 -0
  26. package/dist/commands/extension/pack-files.js +78 -0
  27. package/dist/commands/extension/pack-scan.d.ts +24 -0
  28. package/dist/commands/extension/pack-scan.js +131 -0
  29. package/dist/commands/extension/pack.d.ts +48 -0
  30. package/dist/commands/extension/pack.js +142 -0
  31. package/dist/commands/extension/share-text.d.ts +3 -0
  32. package/dist/commands/extension/share-text.js +6 -0
  33. package/dist/commands/extension/share.en.d.ts +32 -0
  34. package/dist/commands/extension/share.en.js +32 -0
  35. package/dist/commands/extension/share.es.d.ts +2 -0
  36. package/dist/commands/extension/share.es.js +32 -0
  37. package/dist/commands/hardening.d.ts +3 -0
  38. package/dist/commands/hardening.en.d.ts +3 -0
  39. package/dist/commands/hardening.en.js +3 -0
  40. package/dist/commands/hardening.es.d.ts +2 -0
  41. package/dist/commands/hardening.es.js +3 -0
  42. package/dist/commands/hardening.js +19 -0
  43. package/dist/commands/prototype/comp-record.d.ts +5 -0
  44. package/dist/commands/prototype/comp-record.js +22 -0
  45. package/dist/commands/server/build.d.ts +2 -1
  46. package/dist/commands/server/build.js +10 -2
  47. package/dist/commands/server/deploy-local.d.ts +3 -0
  48. package/dist/commands/server/deploy-local.js +9 -0
  49. package/dist/commands/server/deploy-plan.d.ts +5 -0
  50. package/dist/commands/server/deploy-plan.js +56 -0
  51. package/dist/commands/server/deploy-result.d.ts +7 -0
  52. package/dist/commands/server/deploy-result.js +1 -0
  53. package/dist/commands/server/deploy-script.d.ts +2 -0
  54. package/dist/commands/server/deploy-script.js +3 -2
  55. package/dist/commands/server/deploy.d.ts +9 -6
  56. package/dist/commands/server/deploy.js +39 -61
  57. package/dist/commands/server/files.d.ts +9 -1
  58. package/dist/commands/server/files.js +25 -5
  59. package/dist/commands/server/image.d.ts +4 -2
  60. package/dist/commands/server/image.js +6 -5
  61. package/dist/commands/server/setup.d.ts +1 -0
  62. package/dist/commands/server/setup.js +4 -0
  63. package/dist/commands/server/system-packages.d.ts +29 -0
  64. package/dist/commands/server/system-packages.js +103 -0
  65. package/dist/commands/services/compose.d.ts +1 -1
  66. package/dist/commands/services/compose.js +5 -3
  67. package/dist/commands/ui/agents-route.js +2 -0
  68. package/dist/commands/ui/approval-authority.en.d.ts +1 -0
  69. package/dist/commands/ui/approval-authority.en.js +1 -0
  70. package/dist/commands/ui/approval-authority.es.d.ts +1 -0
  71. package/dist/commands/ui/approval-authority.es.js +1 -0
  72. package/dist/commands/ui/approval-authority.js +7 -2
  73. package/dist/commands/ui/approve.js +2 -4
  74. package/dist/commands/ui/autopilot-records.d.ts +2 -0
  75. package/dist/commands/ui/autopilot-records.js +5 -0
  76. package/dist/commands/ui/brand-approval.js +5 -1
  77. package/dist/commands/ui/chat/permissions.js +1 -1
  78. package/dist/commands/ui/chat/routes.js +4 -0
  79. package/dist/commands/ui/comp-approval.d.ts +14 -2
  80. package/dist/commands/ui/comp-approval.js +45 -8
  81. package/dist/commands/ui/index.d.ts +1 -0
  82. package/dist/commands/ui/level-route.js +3 -0
  83. package/dist/commands/ui/merge-authority.d.ts +4 -1
  84. package/dist/commands/ui/merge-authority.en.d.ts +4 -0
  85. package/dist/commands/ui/merge-authority.en.js +5 -1
  86. package/dist/commands/ui/merge-authority.es.d.ts +4 -0
  87. package/dist/commands/ui/merge-authority.es.js +5 -1
  88. package/dist/commands/ui/merge-authority.js +6 -3
  89. package/dist/commands/ui/merge-claims.d.ts +7 -0
  90. package/dist/commands/ui/merge-claims.js +21 -0
  91. package/dist/commands/ui/merge-delegation.js +8 -3
  92. package/dist/commands/ui/merge-hold-name.d.ts +5 -0
  93. package/dist/commands/ui/merge-hold-name.js +5 -0
  94. package/dist/commands/ui/merge-hold.d.ts +6 -1
  95. package/dist/commands/ui/merge-hold.js +23 -5
  96. package/dist/commands/ui/merge-publish-host.d.ts +1 -0
  97. package/dist/commands/ui/merge-publish-host.js +2 -2
  98. package/dist/commands/ui/merge-record.d.ts +2 -0
  99. package/dist/commands/ui/merge-record.js +1 -1
  100. package/dist/commands/ui/merge-route.js +17 -1
  101. package/dist/commands/ui/merge-settle.d.ts +32 -0
  102. package/dist/commands/ui/merge-settle.js +133 -0
  103. package/dist/commands/ui/merge-state.d.ts +5 -0
  104. package/dist/commands/ui/merge-state.js +7 -1
  105. package/dist/commands/ui/merge-withdraw.d.ts +9 -0
  106. package/dist/commands/ui/merge-withdraw.js +29 -0
  107. package/dist/commands/ui/outside-merge.d.ts +13 -0
  108. package/dist/commands/ui/outside-merge.js +84 -0
  109. package/dist/commands/ui/outside.d.ts +7 -4
  110. package/dist/commands/ui/outside.js +3 -0
  111. package/dist/commands/ui/plan-extensions.d.ts +34 -0
  112. package/dist/commands/ui/plan-extensions.en.d.ts +4 -0
  113. package/dist/commands/ui/plan-extensions.en.js +4 -0
  114. package/dist/commands/ui/plan-extensions.es.d.ts +2 -0
  115. package/dist/commands/ui/plan-extensions.es.js +4 -0
  116. package/dist/commands/ui/plan-extensions.js +86 -0
  117. package/dist/commands/ui/plan-files.js +9 -3
  118. package/dist/commands/ui/plan-structure.js +5 -7
  119. package/dist/commands/ui/prototype-comp-route.d.ts +12 -3
  120. package/dist/commands/ui/prototype-comp-route.js +35 -17
  121. package/dist/commands/ui/prototype-main.d.ts +6 -0
  122. package/dist/commands/ui/real-file.d.ts +11 -0
  123. package/dist/commands/ui/real-file.js +84 -0
  124. package/dist/commands/ui/save-route.js +4 -1
  125. package/dist/commands/ui/server.d.ts +1 -0
  126. package/dist/commands/ui/server.js +1 -0
  127. package/dist/commands/ui/studio-routes.js +2 -0
  128. package/dist/commands/ui/studio-state.d.ts +8 -0
  129. package/dist/commands/ui/studio-versions.js +19 -3
  130. package/dist/commands/ui/studio.en.d.ts +2 -0
  131. package/dist/commands/ui/studio.en.js +2 -0
  132. package/dist/commands/ui/studio.es.d.ts +2 -0
  133. package/dist/commands/ui/studio.es.js +2 -0
  134. package/dist/commands/upgrade.js +1 -1
  135. package/dist/ui/page.js +91 -91
  136. package/docs/EXTENSIONS.md +6 -0
  137. package/docs/PROTOTYPE.md +13 -0
  138. package/docs/WORKBENCH.md +55 -2
  139. package/package.json +11 -11
  140. package/skills/ape-add-ai-purpose/SKILL.md +1 -1
  141. package/skills/ape-add-event/SKILL.md +1 -1
  142. package/skills/ape-add-extension/SKILL.md +5 -1
  143. package/skills/ape-add-feature/SKILL.md +1 -1
  144. package/skills/ape-add-generator/SKILL.md +1 -1
  145. package/skills/ape-add-module/SKILL.md +1 -1
  146. package/skills/ape-add-route/SKILL.md +3 -1
  147. package/skills/ape-add-service/SKILL.md +1 -1
  148. package/skills/ape-add-translations/SKILL.md +2 -2
  149. package/skills/ape-admin-screen/SKILL.md +1 -1
  150. package/skills/ape-app-screen/SKILL.md +1 -1
  151. package/skills/ape-critique/SKILL.md +11 -32
  152. package/skills/ape-critique/references/after.md +15 -0
  153. package/skills/ape-critique/references/spacing-pass.md +20 -0
  154. package/skills/ape-deploy/SKILL.md +8 -3
  155. package/skills/ape-design-system/SKILL.md +15 -15
  156. package/skills/ape-design-system/references/by-hand.md +7 -0
  157. package/skills/ape-design-system/references/reference-study.md +11 -0
  158. package/skills/ape-diagnose/SKILL.md +24 -0
  159. package/skills/ape-migration/SKILL.md +1 -1
  160. package/skills/ape-plan-change/SKILL.md +37 -31
  161. package/skills/ape-plan-change/references/change-file-fields.md +5 -0
  162. package/skills/ape-plan-change/references/extensions.md +25 -0
  163. package/skills/ape-plan-change/references/finishing.md +3 -0
  164. package/skills/ape-plan-change/references/fix-from-error.md +3 -0
  165. package/skills/ape-plan-change/references/refactor.md +9 -0
  166. package/skills/ape-plan-change/references/structure.md +19 -0
  167. package/skills/ape-prototype/SKILL.md +13 -23
  168. package/skills/ape-prototype/references/comp.md +3 -0
  169. package/skills/ape-prototype/references/scope-and-export.md +5 -0
  170. package/skills/ape-prototype/references/snapshot.md +3 -0
  171. package/skills/ape-prototype/references/structure.md +11 -0
  172. package/skills/ape-prototype/references/working-app.md +7 -0
  173. package/skills/ape-request/SKILL.md +1 -1
  174. package/skills/ape-upgrade/SKILL.md +4 -1
  175. package/templates/product/package.json +1 -1
@@ -11,6 +11,7 @@ import { levelRoute } from './level-route.js';
11
11
  import { mergeRoutes } from './merge-route.js';
12
12
  import { mergeStudio } from './merge-state.js';
13
13
  import { outsideState } from './outside.js';
14
+ import { outsideMergeRoute } from './outside-merge.js';
14
15
  import { outsideRoute } from './outside-route.js';
15
16
  import { prototypeCompRoutes } from './prototype-comp-route.js';
16
17
  import { planPrototypeOnMain } from './prototype-main.js';
@@ -91,6 +92,7 @@ cached = false) {
91
92
  ...prototypeCompRoutes(root),
92
93
  structureSurfaceRoute(root),
93
94
  outsideRoute,
95
+ outsideMergeRoute(root),
94
96
  {
95
97
  method: 'GET',
96
98
  path: '/api/studio',
@@ -205,6 +205,12 @@ export declare function studioState(root: string, options: Pick<UiServerOptions,
205
205
  name: string;
206
206
  changes: string[];
207
207
  }[];
208
+ extensions?: {
209
+ kind: "build to share" | "improve" | "product only" | "request" | "use";
210
+ name: string;
211
+ why?: string | undefined;
212
+ extra?: string | undefined;
213
+ }[] | undefined;
208
214
  changes: {
209
215
  id: string;
210
216
  title: string;
@@ -351,6 +357,7 @@ export declare function studioState(root: string, options: Pick<UiServerOptions,
351
357
  head: string;
352
358
  kind: "merged" | "refused" | "waiting";
353
359
  again?: true | undefined;
360
+ automatic?: true | undefined;
354
361
  at: string;
355
362
  detail: string;
356
363
  }[] | undefined;
@@ -375,6 +382,7 @@ export declare function studioState(root: string, options: Pick<UiServerOptions,
375
382
  source: string;
376
383
  } | undefined;
377
384
  answers?: true | undefined;
385
+ merges?: true | undefined;
378
386
  } | undefined;
379
387
  release?: {
380
388
  commit: string;
@@ -1,14 +1,19 @@
1
- import { existsSync, readdirSync, readFileSync } from 'node:fs';
1
+ import { existsSync, readdirSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
3
  import { prototypeVersionsSchema } from '@buffcore/contracts/approvals';
4
4
  import { MilestoneVersionsPending, requireLegacyChange } from '../prototype/milestone-key.js';
5
5
  import { heldOnly, readVersions } from '../prototype/versions.js';
6
+ import { authorityT } from './approval-authority.js';
7
+ import { readInsideSync } from './real-file.js';
6
8
  /** Host approval reads only the requested change; local signatures are not evidence. */
7
9
  export function authorityVersion(root, change) {
8
10
  requireLegacyChange(root, change);
9
11
  if (!/^C-\d{3,}$/.test(change))
10
12
  throw new Error();
11
- const value = JSON.parse(readFileSync(join(root, 'prototype/versions', `${change}.json`), 'utf8'));
13
+ const bytes = readInsideSync(join(root, 'prototype/versions', `${change}.json`), [root]);
14
+ if (!bytes)
15
+ throw new Error();
16
+ const value = JSON.parse(bytes.toString('utf8'));
12
17
  const record = prototypeVersionsSchema.parse({ change: value.change, versions: value.versions });
13
18
  if (record.change !== change)
14
19
  throw new Error();
@@ -28,7 +33,7 @@ export function studioVersions(root, hosted = false, changes = []) {
28
33
  requireLegacyChange(root, change);
29
34
  // Preserve the old projection: unrecorded legacy changes have no version row.
30
35
  if (saved.includes(change))
31
- rows.push(hosted ? authorityVersion(root, change) : heldOnly(readVersions(root, change)));
36
+ rows.push(hosted ? hostedRow(root, change) : heldOnly(readVersions(root, change)));
32
37
  }
33
38
  catch (error) {
34
39
  if (!(error instanceof MilestoneVersionsPending))
@@ -38,3 +43,14 @@ export function studioVersions(root, hosted = false, changes = []) {
38
43
  }
39
44
  return rows;
40
45
  }
46
+ /** A record the host read can't use (linked out, hard-linked, malformed) is a refused row. */
47
+ function hostedRow(root, change) {
48
+ try {
49
+ return authorityVersion(root, change);
50
+ }
51
+ catch (error) {
52
+ if (error instanceof MilestoneVersionsPending)
53
+ throw error;
54
+ return { change, versions: [], approvalRefusal: authorityT('ui.authority.unread') };
55
+ }
56
+ }
@@ -17,6 +17,8 @@ export declare const en: {
17
17
  'ui.outside.signIn': string;
18
18
  'ui.outside.timeout': string;
19
19
  'ui.outside.source': string;
20
+ 'ui.outside.invalid': string;
21
+ 'ui.outside.lockReleased': string;
20
22
  'ui.outside.unavailable': string;
21
23
  'ui.address.local': string;
22
24
  'ui.studio': string;
@@ -17,6 +17,8 @@ export const en = {
17
17
  'ui.outside.signIn': 'Outside sources need host sign-in.',
18
18
  'ui.outside.timeout': 'The outside source time limit must be a whole number from 1 to 30,000 milliseconds.',
19
19
  'ui.outside.source': 'An outside source needs a plain-text name of 1 to 40 characters and a read hook.',
20
+ 'ui.outside.invalid': 'Name one outside change to merge.',
21
+ 'ui.outside.lockReleased': 'ape studio: the host had not ended its outside merge of {change} {ms} ms after its answer was due; the merge queue is free again.',
20
22
  'ui.outside.unavailable': 'No outside sources are available.',
21
23
  'ui.address.local': "Only this computer's own address opens the studio.",
22
24
  'ui.studio': 'Open the studio on real state (preview)',
@@ -2,6 +2,8 @@ export declare const es: {
2
2
  'ui.outside.signIn': string;
3
3
  'ui.outside.timeout': string;
4
4
  'ui.outside.source': string;
5
+ 'ui.outside.invalid': string;
6
+ 'ui.outside.lockReleased': string;
5
7
  'ui.outside.unavailable': string;
6
8
  'ui.title': string;
7
9
  'ui.theme.refused': string;
@@ -2,6 +2,8 @@ export const es = {
2
2
  'ui.outside.signIn': 'Las fuentes externas requieren iniciar sesión a través del anfitrión.',
3
3
  'ui.outside.timeout': 'El límite de tiempo de la fuente externa debe ser un número entero entre 1 y 30.000 milisegundos.',
4
4
  'ui.outside.source': 'Una fuente externa necesita un nombre en texto sin formato de 1 a 40 caracteres y una función de lectura.',
5
+ 'ui.outside.invalid': 'Indica un cambio externo para fusionar.',
6
+ 'ui.outside.lockReleased': 'ape studio: el anfitrión no había terminado su fusión externa de {change} {ms} ms después del plazo de su respuesta; la cola de fusiones vuelve a estar libre.',
5
7
  'ui.outside.unavailable': 'No hay fuentes externas disponibles.',
6
8
  'ui.title': 'Estudio de {name}',
7
9
  'ui.theme.refused': 'El estudio no puede iniciarse con este tema ({count} problemas):',
@@ -192,7 +192,7 @@ export async function runUpgrade(root, target, steps, json = false) {
192
192
  if (json)
193
193
  console.log(JSON.stringify({ ok, from, to, places, message }));
194
194
  else if (ok)
195
- log(`Upgraded from ${from} to ${to}: migrated, and the tests pass.\nNext: work through the notes above, run pnpm verify, and say what changed in the pull request (the ape-upgrade skill).`);
195
+ log(`Upgraded from ${from} to ${to}: migrated, and the tests pass.\nNext: work through the notes above, run pnpm verify, and say what changed in the pull request (read .claude/skills/ape-upgrade/SKILL.md).`);
196
196
  return ok;
197
197
  }
198
198
  /**