@buffcore/admin-shell 0.8.46 → 0.8.48

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 (46) hide show
  1. package/dist/prototype/SceneBoundary.js +1 -1
  2. package/dist/screens/assistant/use-ask.d.ts +16 -0
  3. package/dist/workbench/app/ServedComp.js +1 -1
  4. package/dist/workbench/app/ServedPrototype.js +1 -0
  5. package/dist/workbench/app/ServedWork.js +4 -19
  6. package/dist/workbench/app/WorkFooter.d.ts +14 -0
  7. package/dist/workbench/app/WorkFooter.js +19 -0
  8. package/dist/workbench/app/WorkMerge.d.ts +2 -1
  9. package/dist/workbench/app/WorkMerge.js +11 -2
  10. package/dist/workbench/app/__snapshots__/places-dom.test.tsx.snap +1 -1
  11. package/dist/workbench/app/actions.d.ts +4 -0
  12. package/dist/workbench/app/actions.js +2 -0
  13. package/dist/workbench/app/places.d.ts +4 -0
  14. package/dist/workbench/app/prototype-comp.d.ts +5 -0
  15. package/dist/workbench/app/prototype.js +1 -0
  16. package/dist/workbench/app/studio-post.js +7 -3
  17. package/dist/workbench/app/test/loop-fixture.d.ts +68 -0
  18. package/dist/workbench/app/useStudio.d.ts +2 -0
  19. package/dist/workbench/app/work.d.ts +2 -0
  20. package/dist/workbench/app/work.js +3 -0
  21. package/dist/workbench/studio/i18n/later.en.d.ts +7 -0
  22. package/dist/workbench/studio/i18n/later.en.js +8 -1
  23. package/dist/workbench/studio/i18n/later.es.json +8 -1
  24. package/dist/workbench/studio/i18n/prototype.en.d.ts +4 -0
  25. package/dist/workbench/studio/i18n/prototype.en.js +4 -0
  26. package/dist/workbench/studio/i18n/prototype.es.json +5 -1
  27. package/dist/workbench/studio/i18n/work.en.d.ts +1 -0
  28. package/dist/workbench/studio/i18n/work.en.js +1 -0
  29. package/dist/workbench/studio/i18n/work.es.json +1 -0
  30. package/dist/workbench/studio/loop/ProtoApprovalRecord.d.ts +10 -0
  31. package/dist/workbench/studio/loop/ProtoApprovalRecord.js +51 -0
  32. package/dist/workbench/studio/loop/ProtoCompare.d.ts +1 -7
  33. package/dist/workbench/studio/loop/ProtoCompare.js +3 -39
  34. package/dist/workbench/studio/loop/PrototypeComp.d.ts +2 -0
  35. package/dist/workbench/studio/loop/PrototypeComp.js +2 -2
  36. package/dist/workbench/studio/loop/PrototypePage.d.ts +2 -0
  37. package/dist/workbench/studio/loop/PrototypeReview.js +2 -2
  38. package/dist/workbench/studio/loop/types.d.ts +5 -0
  39. package/dist/workbench/studio/work/DrawnWorkPage.js +2 -2
  40. package/dist/workbench/studio/work/FirstBuild.d.ts +5 -1
  41. package/dist/workbench/studio/work/FirstBuild.js +19 -1
  42. package/dist/workbench/studio/work/MergePreview.d.ts +3 -1
  43. package/dist/workbench/studio/work/MergePreview.js +2 -2
  44. package/dist/workbench/studio/work/types.d.ts +8 -0
  45. package/dist/workbench/studio/work/work-test-data.d.ts +34 -0
  46. package/package.json +6 -6
@@ -15,5 +15,5 @@ class ContentBoundary extends Component {
15
15
  /** Both boundaries own the view and its sibling signal; fallbacks never report ready. */
16
16
  export function SceneBoundary({ children, sceneKey }) {
17
17
  const t = useT();
18
- return (_jsx(ContentBoundary, { fallback: _jsxs(_Fragment, { children: [_jsx(SceneSignal, { sceneKey: sceneKey, status: "failed" }), _jsx(EmptyState, { title: t('admin.crash.title') })] }), children: _jsx(Suspense, { fallback: _jsxs(_Fragment, { children: [_jsx(SceneSignal, { sceneKey: sceneKey, status: "loading" }), _jsx(Loading, {})] }), children: children }) }));
18
+ return (_jsx(ContentBoundary, { fallback: _jsxs(_Fragment, { children: [_jsx(SceneSignal, { sceneKey: sceneKey, status: "failed" }), _jsx(EmptyState, { title: t('admin.crash.title') })] }), children: _jsx(Suspense, { fallback: _jsxs(_Fragment, { children: [_jsx(SceneSignal, { sceneKey: sceneKey, status: "loading" }), _jsx("span", { hidden: true, "data-prototype-pending": true }), _jsx(Loading, {})] }), children: children }) }));
19
19
  }
@@ -100,6 +100,10 @@ export declare function useAsk(api: Client): {
100
100
  fingerprint: string;
101
101
  role?: string | undefined;
102
102
  agent?: string | undefined;
103
+ ai?: {
104
+ model?: string | undefined;
105
+ reason: string;
106
+ } | undefined;
103
107
  }[];
104
108
  rule?: {
105
109
  kind: "one";
@@ -218,6 +222,10 @@ export declare function useAsk(api: Client): {
218
222
  fingerprint: string;
219
223
  role?: string | undefined;
220
224
  agent?: string | undefined;
225
+ ai?: {
226
+ model?: string | undefined;
227
+ reason: string;
228
+ } | undefined;
221
229
  }[];
222
230
  rule?: {
223
231
  kind: "one";
@@ -393,6 +401,10 @@ export declare function useAsk(api: Client): {
393
401
  fingerprint: import("zod").ZodString;
394
402
  role: import("zod").ZodOptional<import("zod").ZodString>;
395
403
  agent: import("zod").ZodOptional<import("zod").ZodString>;
404
+ ai: import("zod").ZodOptional<import("zod").ZodObject<{
405
+ model: import("zod").ZodOptional<import("zod").ZodString>;
406
+ reason: import("zod").ZodString;
407
+ }, import("zod/v4/core").$strict>>;
396
408
  }, import("zod/v4/core").$strip>>;
397
409
  rule: import("zod").ZodOptional<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
398
410
  kind: import("zod").ZodLiteral<"one">;
@@ -514,6 +526,10 @@ export declare function useAsk(api: Client): {
514
526
  fingerprint: string;
515
527
  role?: string | undefined;
516
528
  agent?: string | undefined;
529
+ ai?: {
530
+ model?: string | undefined;
531
+ reason: string;
532
+ } | undefined;
517
533
  }[];
518
534
  rule?: {
519
535
  kind: "one";
@@ -21,7 +21,7 @@ export function useServedComp(reads, needsRight) {
21
21
  title: screen.title,
22
22
  light: screen.light && pictures[screen.light],
23
23
  dark: screen.dark && pictures[screen.dark],
24
- })), references: reply.references.map((name) => (name ? pictures[name] : undefined)), approved: reply.approved, approvedBy: reply.approval?.signatures[0]?.by, needsRight: needsRight, result: signing.result, onApprove: reply.fingerprint
24
+ })), references: reply.references.map((name) => (name ? pictures[name] : undefined)), approved: reply.approved, approvedBy: reply.approval?.signatures[0]?.by, why: reply.approvalRefusal, needsRight: needsRight, result: signing.result, onApprove: reply.fingerprint
25
25
  ? () => void signing.approve(async () => {
26
26
  const answer = await reads.approve(reply.fingerprint);
27
27
  reload();
@@ -190,6 +190,7 @@ function versionHandlers(model) {
190
190
  !prototypeChecks(model))
191
191
  void signing.approve(() => actions.approvePrototype?.(change, number(view.version)));
192
192
  }),
193
+ onReopen: actions.reopenPrototype && (() => void actions.reopenPrototype?.(change)),
193
194
  onRecord: change && !model.snapshot.reply?.linked ? () => void recording.record() : undefined,
194
195
  onCompare: compare,
195
196
  onPair: sample.proto.versions.length >= 3 ? compare : undefined,
@@ -1,17 +1,14 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useT } from '@buffcore/i18n/react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
3
2
  import { useLayoutEffect, useRef, useState } from 'react';
4
- import { ClashWarning, OneAtATime, Worktrees } from '../studio/work/FirstBuild.js';
5
- import { Stack } from '../studio/work/parts.js';
6
- import { Waiting } from '../studio/work/Waiting.js';
7
3
  import { WorkPage } from '../studio/work/WorkPage.js';
8
4
  import { WorkApproval } from './WorkApproval.js';
9
5
  import { WorkBuildActions } from './WorkBuildActions.js';
6
+ import { WorkFooter } from './WorkFooter.js';
10
7
  import { MergeHold, WorkMerge } from './WorkMerge.js';
11
8
  import { WorkPlacesApproval } from './WorkPlacesApproval.js';
12
9
  import { WorkPreparation } from './WorkPreparation.js';
13
10
  import { WorkRetry } from './WorkRetry.js';
14
- import { canBuildChange, codingPrerequisite, workCallbacks, workView } from './work.js';
11
+ import { canBuildChange, codingPrerequisite, withdrawable, workCallbacks, workView, } from './work.js';
15
12
  import { workPlan } from './work-plan.js';
16
13
  export function ServedWork({ state, actions, ui, onUi, position, change, onChange, onStep, }) {
17
14
  const scroll = useRef(null);
@@ -95,7 +92,7 @@ export function ServedWork({ state, actions, ui, onUi, position, change, onChang
95
92
  held,
96
93
  work.merging,
97
94
  work.merges?.find((entry) => entry.change === change),
98
- ]), read: readPreview, merge: selected?.card.canMerge ? actions.merge : undefined })) : undefined, onSend: onStep &&
95
+ ]), read: readPreview, merge: selected?.card.canMerge ? actions.merge : undefined, withdraw: mayBuild && withdrawable(state, change) ? actions.withdrawMerge : undefined })) : undefined, onSend: onStep &&
99
96
  ((text) => {
100
97
  if (!canBuild)
101
98
  return false;
@@ -110,15 +107,3 @@ export function ServedWork({ state, actions, ui, onUi, position, change, onChang
110
107
  setComposer(codingPrerequisite(state, id).status === 'ready');
111
108
  } }) }));
112
109
  }
113
- function WorkFooter({ view, waiting, hold, onRelease, onPrototype, onChange, onClash, cards, }) {
114
- const t = useT();
115
- const first = view.first;
116
- if (!hold &&
117
- !waiting.length &&
118
- !cards?.length &&
119
- !first?.queue &&
120
- !first?.clashes?.length &&
121
- !first?.worktrees.length)
122
- return null;
123
- return (_jsxs(Stack, { children: [hold, _jsx(Waiting, { list: waiting, onAction: onRelease, onPrototype: onPrototype, onChange: onChange, cards: cards }), first?.queue && _jsx(OneAtATime, { q: first.queue }), first?.clashes?.map((clash) => (_jsx(ClashWarning, { onBoth: onClash, clash: clash }, `${clash.a}/${clash.b}`))), !!first?.worktrees.length && (_jsxs("details", { children: [_jsx("summary", { style: { minBlockSize: 'var(--target)', cursor: 'pointer' }, children: t('studio.later.wt.title') }), _jsx(Worktrees, { list: first.worktrees, where: t('studio.frame.rail.computerShort') })] }))] }));
124
- }
@@ -0,0 +1,14 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { Wait } from '../studio/work/types.ts';
3
+ import type { workView } from './work.ts';
4
+ /** Under the work page: the hold, waits, the one-at-a-time queue, clashes and worktrees. */
5
+ export declare function WorkFooter({ view, waiting, hold, onRelease, onPrototype, onChange, onClash, cards, }: {
6
+ view: ReturnType<typeof workView>;
7
+ waiting: readonly Wait[];
8
+ hold?: ReactNode;
9
+ onRelease?: () => void;
10
+ onPrototype?: (change: string, version?: number) => void;
11
+ onChange?: (change: string) => void;
12
+ onClash: (id: string) => void;
13
+ cards?: ReactNode[];
14
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useT } from '@buffcore/i18n/react';
3
+ import { ClashWarning, OneAtATime, OtherWorktrees, Worktrees } from '../studio/work/FirstBuild.js';
4
+ import { Stack } from '../studio/work/parts.js';
5
+ import { Waiting } from '../studio/work/Waiting.js';
6
+ /** Under the work page: the hold, waits, the one-at-a-time queue, clashes and worktrees. */
7
+ export function WorkFooter({ view, waiting, hold, onRelease, onPrototype, onChange, onClash, cards, }) {
8
+ const t = useT();
9
+ const first = view.first;
10
+ if (!hold &&
11
+ !waiting.length &&
12
+ !cards?.length &&
13
+ !first?.queue &&
14
+ !first?.clashes?.length &&
15
+ !first?.worktrees.length &&
16
+ !first?.others?.length)
17
+ return null;
18
+ return (_jsxs(Stack, { children: [hold, _jsx(Waiting, { list: waiting, onAction: onRelease, onPrototype: onPrototype, onChange: onChange, cards: cards }), first?.queue && _jsx(OneAtATime, { q: first.queue }), first?.clashes?.map((clash) => (_jsx(ClashWarning, { onBoth: onClash, clash: clash }, `${clash.a}/${clash.b}`))), !!first?.worktrees.length && (_jsxs("details", { children: [_jsx("summary", { style: { minBlockSize: 'var(--target)', cursor: 'pointer' }, children: t('studio.later.wt.title') }), _jsx(Worktrees, { list: first.worktrees, where: t('studio.frame.rail.computerShort') })] })), !!first?.others?.length && (_jsxs("details", { children: [_jsx("summary", { style: { minBlockSize: 'var(--target)', cursor: 'pointer' }, children: t('studio.later.wt.others') }), _jsx(OtherWorktrees, { list: first.others })] }))] }));
19
+ }
@@ -1,9 +1,10 @@
1
1
  import type { StudioActions } from './actions.ts';
2
- export declare function WorkMerge({ change, revision, read, merge, }: {
2
+ export declare function WorkMerge({ change, revision, read, merge, withdraw, }: {
3
3
  change: string;
4
4
  revision: string;
5
5
  read: NonNullable<StudioActions['previewMerge']>;
6
6
  merge?: StudioActions['merge'];
7
+ withdraw?: StudioActions['withdrawMerge'];
7
8
  }): import("react").JSX.Element;
8
9
  /**
9
10
  * The switch takes the server's answer at once. The answer holds until a poll shows a different
@@ -3,7 +3,7 @@ import { useT } from '@buffcore/i18n/react';
3
3
  import { useEffect, useRef, useState } from 'react';
4
4
  import { Switch } from '../../components/Switch.js';
5
5
  import { MergePreviewPanel } from '../studio/work/MergePreview.js';
6
- export function WorkMerge({ change, revision, read, merge, }) {
6
+ export function WorkMerge({ change, revision, read, merge, withdraw, }) {
7
7
  const [shown, show] = useState();
8
8
  const [merging, setMerging] = useState(false);
9
9
  useEffect(() => {
@@ -23,7 +23,16 @@ export function WorkMerge({ change, revision, read, merge, }) {
23
23
  setMerging(false);
24
24
  }
25
25
  };
26
- return (_jsx(MergePreviewPanel, { preview: shown?.preview, stale: shown !== undefined && shown.revision !== revision, merging: merging, onMerge: merge && confirm }));
26
+ const end = async () => {
27
+ setMerging(true);
28
+ try {
29
+ await withdraw?.(change);
30
+ }
31
+ finally {
32
+ setMerging(false);
33
+ }
34
+ };
35
+ return (_jsx(MergePreviewPanel, { preview: shown?.preview, stale: shown !== undefined && shown.revision !== revision, merging: merging, onMerge: merge && confirm, onWithdraw: withdraw && end }));
27
36
  }
28
37
  /**
29
38
  * The switch takes the server's answer at once. The answer holds until a poll shows a different