@design-ai/cli 4.56.0 → 4.57.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.
- package/.claude-plugin/plugin.json +109 -25
- package/CHANGELOG.md +36 -0
- package/README.ko.md +9 -26
- package/README.md +10 -23
- package/cli/bin/design-ai.mjs +1 -0
- package/cli/commands/help.mjs +7 -4
- package/cli/commands/index.mjs +292 -0
- package/cli/commands/learn-help.mjs +149 -0
- package/cli/commands/learn-print-profile.mjs +373 -0
- package/cli/commands/learn-print-restore.mjs +349 -0
- package/cli/commands/learn-print-signals.mjs +453 -0
- package/cli/commands/learn.mjs +60 -1281
- package/cli/commands/pack.mjs +7 -3
- package/cli/commands/prompt.mjs +7 -3
- package/cli/commands/search.mjs +94 -1
- package/cli/lib/dispatch.mjs +3 -0
- package/cli/lib/embedding-index.mjs +199 -0
- package/cli/lib/embedding-provider.mjs +121 -0
- package/cli/lib/embedding-rerank.mjs +52 -0
- package/cli/lib/learn-args.mjs +490 -0
- package/cli/lib/learn-backup.mjs +748 -0
- package/cli/lib/learn-curation.mjs +612 -0
- package/cli/lib/learn-eval.mjs +459 -0
- package/cli/lib/learn-profile.mjs +763 -0
- package/cli/lib/learn-select.mjs +223 -0
- package/cli/lib/learn-shared.mjs +158 -0
- package/cli/lib/learn-test-support.mjs +218 -0
- package/cli/lib/learn-usage.mjs +360 -0
- package/cli/lib/learn.mjs +83 -3694
- package/cli/lib/lexical.mjs +137 -0
- package/cli/lib/local-config.mjs +110 -0
- package/cli/lib/mcp-server.mjs +13 -3
- package/cli/lib/pack.mjs +31 -4
- package/cli/lib/prompt.mjs +42 -4
- package/cli/lib/recall.mjs +193 -0
- package/cli/lib/retrieval-index.mjs +0 -0
- package/cli/lib/search-ranked.mjs +170 -0
- package/cli/lib/search.mjs +11 -1
- package/cli/lib/signals-backlog-commands.mjs +673 -0
- package/cli/lib/signals-backlog.mjs +361 -0
- package/cli/lib/signals-eval.mjs +176 -0
- package/cli/lib/signals-readiness.mjs +247 -0
- package/cli/lib/signals-registry.mjs +377 -0
- package/cli/lib/signals-render.mjs +478 -0
- package/cli/lib/signals-shared.mjs +75 -0
- package/cli/lib/signals.mjs +16 -2337
- package/cli/lib/site-bundle-handoff-expected.mjs +173 -0
- package/cli/lib/site-bundle-handoff-runbook-action-summary.mjs +332 -0
- package/cli/lib/site-bundle-handoff-runbook-human-lines.mjs +167 -0
- package/cli/lib/site-bundle-handoff-runbook-maps.mjs +238 -0
- package/cli/lib/site-bundle-handoff-runbook-next-step.mjs +278 -0
- package/cli/lib/site-bundle-handoff-runbook.mjs +44 -931
- package/cli/lib/site-test-support.mjs +68 -0
- package/cli/lib/skill-proposals-apply-commands.mjs +135 -0
- package/cli/lib/skill-proposals-apply-contract.mjs +750 -0
- package/cli/lib/skill-proposals-apply-plan.mjs +118 -0
- package/cli/lib/skill-proposals-generate.mjs +298 -0
- package/cli/lib/skill-proposals-render.mjs +532 -0
- package/cli/lib/skill-proposals-review.mjs +262 -0
- package/cli/lib/skill-proposals.mjs +15 -2046
- package/cli/lib/workspace-args.mjs +83 -0
- package/cli/lib/workspace-git.mjs +169 -0
- package/cli/lib/workspace-learning.mjs +483 -0
- package/cli/lib/workspace-repo.mjs +139 -0
- package/cli/lib/workspace-report.mjs +283 -0
- package/cli/lib/workspace-test-support.mjs +99 -0
- package/cli/lib/workspace.mjs +30 -1056
- package/docs/AI-LEARNING-PHASE2.md +215 -0
- package/docs/DISTRIBUTION.ko.md +2 -2
- package/docs/DISTRIBUTION.md +2 -2
- package/docs/NEXT-SURFACE-DECISION.md +125 -0
- package/docs/PRODUCT-READINESS.md +3 -3
- package/docs/RELEASE-GATES.ko.md +35 -0
- package/docs/RELEASE-GATES.md +234 -0
- package/docs/ROADMAP.md +53 -8
- package/docs/external-status.md +6 -8
- package/docs/inspection-20260630.md +169 -0
- package/docs/integrations/design-ai-mcp-server.md +4 -4
- package/docs/reference/ant-design.md +413 -0
- package/docs/reference/awesome-design-md.md +439 -0
- package/docs/reference/mui.md +783 -0
- package/docs/reference/shadcn-ui.md +298 -0
- package/examples/component-accordion-actions.md +5 -5
- package/examples/component-accordion-details.md +5 -5
- package/examples/component-accordion-summary.md +5 -5
- package/examples/component-accordion.md +3 -3
- package/examples/component-affix.md +1 -1
- package/examples/component-alert-dialog.md +1 -1
- package/examples/component-alert-title.md +1 -1
- package/examples/component-alert.md +3 -3
- package/examples/component-anchor.md +1 -1
- package/examples/component-app-bar.md +1 -1
- package/examples/component-aspect-ratio.md +1 -1
- package/examples/component-auto-complete.md +2 -2
- package/examples/component-avatar-group.md +5 -5
- package/examples/component-avatar.md +3 -3
- package/examples/component-back-top.md +1 -1
- package/examples/component-backdrop.md +1 -1
- package/examples/component-badge.md +3 -3
- package/examples/component-border-beam.md +3 -3
- package/examples/component-bottom-navigation.md +1 -1
- package/examples/component-box.md +1 -1
- package/examples/component-breadcrumb.md +3 -3
- package/examples/component-button-base.md +3 -3
- package/examples/component-button-group.md +2 -2
- package/examples/component-button.md +3 -3
- package/examples/component-calendar.md +2 -2
- package/examples/component-card-actions.md +1 -1
- package/examples/component-card-content.md +1 -1
- package/examples/component-card-header.md +1 -1
- package/examples/component-card-media.md +1 -1
- package/examples/component-card.md +3 -3
- package/examples/component-carousel.md +2 -2
- package/examples/component-cascader.md +1 -1
- package/examples/component-chart.md +1 -1
- package/examples/component-checkbox.md +3 -3
- package/examples/component-click-away-listener.md +1 -1
- package/examples/component-code.md +1 -1
- package/examples/component-collapsible.md +1 -1
- package/examples/component-color-picker.md +1 -1
- package/examples/component-combobox.md +1 -1
- package/examples/component-command.md +1 -1
- package/examples/component-config-provider.md +3 -3
- package/examples/component-context-menu.md +1 -1
- package/examples/component-css-baseline.md +3 -3
- package/examples/component-date-picker.md +2 -2
- package/examples/component-descriptions.md +1 -1
- package/examples/component-dialog-actions.md +1 -1
- package/examples/component-dialog-content-text.md +1 -1
- package/examples/component-dialog-content.md +1 -1
- package/examples/component-dialog-title.md +1 -1
- package/examples/component-dialog.md +2 -2
- package/examples/component-divider.md +3 -3
- package/examples/component-drawer.md +3 -3
- package/examples/component-dropdown.md +3 -3
- package/examples/component-empty.md +2 -2
- package/examples/component-fade.md +1 -1
- package/examples/component-field.md +1 -1
- package/examples/component-filled-input.md +1 -1
- package/examples/component-flex.md +1 -1
- package/examples/component-float-button.md +2 -2
- package/examples/component-form-control-label.md +1 -1
- package/examples/component-form-control.md +1 -1
- package/examples/component-form-controls.md +1 -1
- package/examples/component-form-group.md +1 -1
- package/examples/component-form-helper-text.md +1 -1
- package/examples/component-form-label.md +1 -1
- package/examples/component-form.md +2 -2
- package/examples/component-grid.md +2 -2
- package/examples/component-grow.md +1 -1
- package/examples/component-hover-card.md +1 -1
- package/examples/component-icon-button.md +1 -1
- package/examples/component-icon.md +1 -1
- package/examples/component-image-list.md +1 -1
- package/examples/component-image.md +1 -1
- package/examples/component-input-adornment.md +1 -1
- package/examples/component-input-base.md +1 -1
- package/examples/component-input-number.md +1 -1
- package/examples/component-input-otp.md +2 -2
- package/examples/component-input.md +3 -3
- package/examples/component-item.md +1 -1
- package/examples/component-label.md +1 -1
- package/examples/component-layout.md +1 -1
- package/examples/component-link.md +1 -1
- package/examples/component-list-item-avatar.md +1 -1
- package/examples/component-list-item-button.md +1 -1
- package/examples/component-list-item-icon.md +1 -1
- package/examples/component-list-item-text.md +1 -1
- package/examples/component-list-item.md +1 -1
- package/examples/component-list-subheader.md +1 -1
- package/examples/component-list.md +2 -2
- package/examples/component-masonry.md +1 -1
- package/examples/component-mentions.md +1 -1
- package/examples/component-menu-item.md +1 -1
- package/examples/component-menu-list.md +1 -1
- package/examples/component-menu.md +1 -1
- package/examples/component-menubar.md +1 -1
- package/examples/component-message.md +1 -1
- package/examples/component-mobile-stepper.md +1 -1
- package/examples/component-modal.md +5 -5
- package/examples/component-navigation-menu.md +1 -1
- package/examples/component-notification.md +1 -1
- package/examples/component-outlined-input.md +1 -1
- package/examples/component-pagination.md +3 -3
- package/examples/component-paper.md +1 -1
- package/examples/component-popconfirm.md +1 -1
- package/examples/component-popover.md +3 -3
- package/examples/component-popper.md +1 -1
- package/examples/component-progress.md +2 -2
- package/examples/component-qr-code.md +1 -1
- package/examples/component-radio.md +3 -3
- package/examples/component-rate.md +2 -2
- package/examples/component-resizable.md +1 -1
- package/examples/component-result.md +1 -1
- package/examples/component-scroll-area.md +1 -1
- package/examples/component-segmented.md +3 -3
- package/examples/component-select.md +3 -3
- package/examples/component-separator.md +1 -1
- package/examples/component-sheet.md +1 -1
- package/examples/component-sidebar.md +1 -1
- package/examples/component-skeleton.md +3 -3
- package/examples/component-slide.md +1 -1
- package/examples/component-slider.md +3 -3
- package/examples/component-snackbar-content.md +1 -1
- package/examples/component-snackbar.md +1 -1
- package/examples/component-sonner.md +1 -1
- package/examples/component-space.md +1 -1
- package/examples/component-speed-dial-action.md +1 -1
- package/examples/component-speed-dial.md +1 -1
- package/examples/component-spin.md +2 -2
- package/examples/component-spinner.md +1 -1
- package/examples/component-splitter.md +2 -2
- package/examples/component-stack.md +1 -1
- package/examples/component-statistic.md +1 -1
- package/examples/component-step-button.md +4 -4
- package/examples/component-step-connector.md +4 -4
- package/examples/component-step-content.md +1 -1
- package/examples/component-step-icon.md +1 -1
- package/examples/component-step-label.md +1 -1
- package/examples/component-step.md +2 -2
- package/examples/component-steps.md +2 -2
- package/examples/component-swipeable-drawer.md +1 -1
- package/examples/component-switch.md +3 -3
- package/examples/component-tab-scroll-button.md +5 -5
- package/examples/component-tab.md +1 -1
- package/examples/component-table-body.md +1 -1
- package/examples/component-table-cell.md +1 -1
- package/examples/component-table-container.md +1 -1
- package/examples/component-table-footer.md +1 -1
- package/examples/component-table-head.md +1 -1
- package/examples/component-table-pagination.md +1 -1
- package/examples/component-table-row.md +1 -1
- package/examples/component-table-sort-label.md +1 -1
- package/examples/component-table.md +2 -2
- package/examples/component-tabs.md +3 -3
- package/examples/component-tag-badge.md +2 -2
- package/examples/component-tag.md +1 -1
- package/examples/component-textarea-autosize.md +1 -1
- package/examples/component-textarea.md +1 -1
- package/examples/component-time-picker.md +1 -1
- package/examples/component-timeline.md +1 -1
- package/examples/component-toast.md +4 -4
- package/examples/component-toggle-button.md +1 -1
- package/examples/component-toggle.md +1 -1
- package/examples/component-toolbar.md +1 -1
- package/examples/component-tooltip.md +3 -3
- package/examples/component-tour.md +1 -1
- package/examples/component-transfer.md +1 -1
- package/examples/component-tree-select.md +1 -1
- package/examples/component-tree.md +1 -1
- package/examples/component-typography.md +2 -2
- package/examples/component-upload.md +1 -1
- package/examples/component-watermark.md +1 -1
- package/examples/component-zoom.md +1 -1
- package/knowledge/COVERAGE.md +4 -3
- package/knowledge/components/INDEX.md +202 -202
- package/knowledge/patterns/brand-references.md +72 -72
- package/package.json +1 -1
- package/tools/audit/local-ci.py +16 -1
- package/tools/audit/package-smoke.py +611 -9
- package/tools/audit/registry-smoke.py +534 -0
- package/tools/audit/release-metadata.py +47 -1
- package/tools/audit/smoke_assertions.py +915 -13
- package/tools/migrations/refs-links-to-reference-pages.py +179 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// Human-readable stage line rows and summaries for the bundle-handoff operator runbook.
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
formatBundleHandoffOperatorRunbookStageLine,
|
|
5
|
+
} from "./site-bundle-handoff-runbook-format.mjs";
|
|
6
|
+
import {
|
|
7
|
+
byKey,
|
|
8
|
+
hasCommands,
|
|
9
|
+
isManualStage,
|
|
10
|
+
isOptionalStage,
|
|
11
|
+
isRequiredStage,
|
|
12
|
+
} from "./site-bundle-handoff-runbook-maps.mjs";
|
|
13
|
+
|
|
14
|
+
export function buildStageHumanLineMaps(
|
|
15
|
+
stages,
|
|
16
|
+
stageActionRows,
|
|
17
|
+
stageActionEvidenceCaptureInitialValidationChecklistSummaryByKey,
|
|
18
|
+
) {
|
|
19
|
+
const stageHumanLines = stages.map((stage) => formatBundleHandoffOperatorRunbookStageLine(
|
|
20
|
+
stage,
|
|
21
|
+
stageActionEvidenceCaptureInitialValidationChecklistSummaryByKey[stage.key],
|
|
22
|
+
));
|
|
23
|
+
const stageHumanLineByKey = byKey(stages, (_stage, index) => stageHumanLines[index]);
|
|
24
|
+
const stageHumanLineDisplayRows = stages.map((stage, index) => {
|
|
25
|
+
const actionRow = stageActionRows[index];
|
|
26
|
+
const evidenceProgress = actionRow.actionEvidenceCaptureInitialValidationChecklistSummary;
|
|
27
|
+
const displayRowIdentity = {
|
|
28
|
+
step: stage.step,
|
|
29
|
+
key: stage.key,
|
|
30
|
+
label: stage.label,
|
|
31
|
+
line: stageHumanLines[index],
|
|
32
|
+
};
|
|
33
|
+
const displayRowExecutionContext = {
|
|
34
|
+
required: stage.required,
|
|
35
|
+
manual: isManualStage(stage),
|
|
36
|
+
commandCount: stage.commandCount,
|
|
37
|
+
};
|
|
38
|
+
const displayRowActionStatus = {
|
|
39
|
+
actionType: actionRow.actionType,
|
|
40
|
+
actionLabel: actionRow.actionLabel,
|
|
41
|
+
actionStatus: actionRow.actionStatus,
|
|
42
|
+
actionStatusLabel: actionRow.actionStatusLabel,
|
|
43
|
+
actionStatusTone: actionRow.actionStatusTone,
|
|
44
|
+
};
|
|
45
|
+
const displayRowEvidenceProgress = {
|
|
46
|
+
hasEvidenceProgress: evidenceProgress.itemCount > 0,
|
|
47
|
+
evidenceProgressStatus: evidenceProgress.status || "",
|
|
48
|
+
evidenceProgressStatusLabel: evidenceProgress.statusLabel || "",
|
|
49
|
+
evidenceProgressStatusTone: evidenceProgress.statusTone || "",
|
|
50
|
+
evidenceProgressIconName: evidenceProgress.iconName || "",
|
|
51
|
+
evidenceProgressLabel: evidenceProgress.progressLabel || "",
|
|
52
|
+
evidenceCompletionPercent: evidenceProgress.completionPercent ?? 0,
|
|
53
|
+
firstUncheckedEvidenceItemLabel: evidenceProgress.firstUncheckedItemLabel || "",
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
...displayRowIdentity,
|
|
57
|
+
...displayRowExecutionContext,
|
|
58
|
+
...displayRowActionStatus,
|
|
59
|
+
...displayRowEvidenceProgress,
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
const stageHumanLineDisplayRowByKey = byKey(stageHumanLineDisplayRows, (row) => row);
|
|
63
|
+
const countBy = (predicate) => stages.filter(predicate).length;
|
|
64
|
+
const stageKeysBy = (predicate) => stages.filter(predicate).map((stage) => stage.key);
|
|
65
|
+
const countActions = (predicate) => stageActionRows.filter(predicate).length;
|
|
66
|
+
const firstActionKey = (predicate) => stageActionRows.find(predicate)?.key || "";
|
|
67
|
+
const displayRowKeysBy = (predicate) => stageHumanLineDisplayRows.filter(predicate).map((row) => row.key);
|
|
68
|
+
const countDisplayRows = (predicate) => stageHumanLineDisplayRows.filter(predicate).length;
|
|
69
|
+
const firstDisplayRowKey = (predicate) => stageHumanLineDisplayRows.find(predicate)?.key || "";
|
|
70
|
+
const isRequiredDisplayRow = (row) => row.required;
|
|
71
|
+
const isOptionalDisplayRow = (row) => !row.required;
|
|
72
|
+
const hasCommandDisplayRow = (row) => row.commandCount > 0;
|
|
73
|
+
const isManualDisplayRow = (row) => row.manual;
|
|
74
|
+
const hasReadyActionStatus = (row) => row.actionStatus === "ready";
|
|
75
|
+
const hasOptionalActionStatus = (row) => row.actionStatus === "optional";
|
|
76
|
+
const hasManualActionStatus = (row) => row.actionStatus === "manual";
|
|
77
|
+
const hasBlockedActionStatus = (row) => row.actionStatus === "blocked";
|
|
78
|
+
const hasDisplayRowEvidenceProgress = (row) => row.hasEvidenceProgress;
|
|
79
|
+
const hasBlockedDisplayRowEvidenceProgress = (row) => row.evidenceProgressStatus === "blocked";
|
|
80
|
+
const hasReadyDisplayRowEvidenceProgress = (row) => row.evidenceProgressStatus === "ready";
|
|
81
|
+
const hasEvidenceProgress = (stage) => (
|
|
82
|
+
stage.actionEvidenceCaptureInitialValidationChecklistSummary.itemCount > 0
|
|
83
|
+
);
|
|
84
|
+
const hasBlockedEvidenceProgress = (stage) => (
|
|
85
|
+
stage.actionEvidenceCaptureInitialValidationChecklistSummary.status === "blocked"
|
|
86
|
+
);
|
|
87
|
+
const hasReadyEvidenceProgress = (stage) => (
|
|
88
|
+
stage.actionEvidenceCaptureInitialValidationChecklistSummary.status === "ready"
|
|
89
|
+
);
|
|
90
|
+
const stageHumanLineDisplayRowKeysByActionStatus = {
|
|
91
|
+
ready: displayRowKeysBy(hasReadyActionStatus),
|
|
92
|
+
optional: displayRowKeysBy(hasOptionalActionStatus),
|
|
93
|
+
manual: displayRowKeysBy(hasManualActionStatus),
|
|
94
|
+
blocked: displayRowKeysBy(hasBlockedActionStatus),
|
|
95
|
+
};
|
|
96
|
+
const stageHumanLineDisplayRowKeysByEvidenceProgressStatus = {
|
|
97
|
+
blocked: displayRowKeysBy(hasBlockedDisplayRowEvidenceProgress),
|
|
98
|
+
ready: displayRowKeysBy(hasReadyDisplayRowEvidenceProgress),
|
|
99
|
+
};
|
|
100
|
+
const stageHumanLineDisplayRowCountSummary = {
|
|
101
|
+
count: stageHumanLineDisplayRows.length,
|
|
102
|
+
byKeyCount: Object.keys(stageHumanLineDisplayRowByKey).length,
|
|
103
|
+
requiredCount: countDisplayRows(isRequiredDisplayRow),
|
|
104
|
+
optionalCount: countDisplayRows(isOptionalDisplayRow),
|
|
105
|
+
commandCount: countDisplayRows(hasCommandDisplayRow),
|
|
106
|
+
manualCount: countDisplayRows(isManualDisplayRow),
|
|
107
|
+
};
|
|
108
|
+
const stageHumanLineDisplayRowActionStatusSummary = {
|
|
109
|
+
readyActionStatusCount: countDisplayRows(hasReadyActionStatus),
|
|
110
|
+
optionalActionStatusCount: countDisplayRows(hasOptionalActionStatus),
|
|
111
|
+
manualActionStatusCount: countDisplayRows(hasManualActionStatus),
|
|
112
|
+
blockedActionStatusCount: countDisplayRows(hasBlockedActionStatus),
|
|
113
|
+
};
|
|
114
|
+
const stageHumanLineDisplayRowEvidenceProgressSummary = {
|
|
115
|
+
evidenceProgressCount: countDisplayRows(hasDisplayRowEvidenceProgress),
|
|
116
|
+
blockedEvidenceProgressCount: countDisplayRows(hasBlockedDisplayRowEvidenceProgress),
|
|
117
|
+
readyEvidenceProgressCount: countDisplayRows(hasReadyDisplayRowEvidenceProgress),
|
|
118
|
+
};
|
|
119
|
+
const stageHumanLineDisplayRowFirstKeySummary = {
|
|
120
|
+
firstRowKey: stageHumanLineDisplayRows[0]?.key || "",
|
|
121
|
+
firstReadyActionRowKey: firstDisplayRowKey(hasReadyActionStatus),
|
|
122
|
+
firstOptionalActionRowKey: firstDisplayRowKey(hasOptionalActionStatus),
|
|
123
|
+
firstManualActionRowKey: firstDisplayRowKey(hasManualActionStatus),
|
|
124
|
+
firstBlockedEvidenceProgressRowKey: firstDisplayRowKey(hasBlockedDisplayRowEvidenceProgress),
|
|
125
|
+
firstReadyEvidenceProgressRowKey: firstDisplayRowKey(hasReadyDisplayRowEvidenceProgress),
|
|
126
|
+
};
|
|
127
|
+
const stageHumanLineDisplayRowSummary = {
|
|
128
|
+
...stageHumanLineDisplayRowCountSummary,
|
|
129
|
+
...stageHumanLineDisplayRowActionStatusSummary,
|
|
130
|
+
...stageHumanLineDisplayRowEvidenceProgressSummary,
|
|
131
|
+
...stageHumanLineDisplayRowFirstKeySummary,
|
|
132
|
+
};
|
|
133
|
+
const stageHumanLineCountSummary = {
|
|
134
|
+
count: stageHumanLines.length,
|
|
135
|
+
byKeyCount: Object.keys(stageHumanLineByKey).length,
|
|
136
|
+
requiredCount: countBy(isRequiredStage),
|
|
137
|
+
optionalCount: countBy(isOptionalStage),
|
|
138
|
+
commandCount: countBy(hasCommands),
|
|
139
|
+
manualCount: countBy(isManualStage),
|
|
140
|
+
};
|
|
141
|
+
const stageHumanLineEvidenceProgressSummary = {
|
|
142
|
+
evidenceProgressCount: countActions(hasEvidenceProgress),
|
|
143
|
+
blockedEvidenceProgressCount: countActions(hasBlockedEvidenceProgress),
|
|
144
|
+
readyEvidenceProgressCount: countActions(hasReadyEvidenceProgress),
|
|
145
|
+
};
|
|
146
|
+
const stageHumanLineFirstValueSummary = {
|
|
147
|
+
firstStageKey: stages[0]?.key || "",
|
|
148
|
+
firstLine: stageHumanLines[0] || "",
|
|
149
|
+
firstEvidenceProgressStageKey: firstActionKey(hasEvidenceProgress),
|
|
150
|
+
firstBlockedEvidenceProgressStageKey: firstActionKey(hasBlockedEvidenceProgress),
|
|
151
|
+
};
|
|
152
|
+
const stageHumanLineSummary = {
|
|
153
|
+
...stageHumanLineCountSummary,
|
|
154
|
+
...stageHumanLineEvidenceProgressSummary,
|
|
155
|
+
...stageHumanLineFirstValueSummary,
|
|
156
|
+
};
|
|
157
|
+
return {
|
|
158
|
+
stageHumanLines,
|
|
159
|
+
stageHumanLineByKey,
|
|
160
|
+
stageHumanLineDisplayRows,
|
|
161
|
+
stageHumanLineDisplayRowByKey,
|
|
162
|
+
stageHumanLineDisplayRowKeysByActionStatus,
|
|
163
|
+
stageHumanLineDisplayRowKeysByEvidenceProgressStatus,
|
|
164
|
+
stageHumanLineDisplayRowSummary,
|
|
165
|
+
stageHumanLineSummary,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
// Stage/action key-map builders and stage predicates for the bundle-handoff operator runbook.
|
|
2
|
+
|
|
3
|
+
export const byKey = (rows, getValue) => Object.fromEntries(
|
|
4
|
+
rows.map((row, index) => [row.key, getValue(row, index)]),
|
|
5
|
+
);
|
|
6
|
+
export const fieldByKey = (rows, field) => byKey(rows, (row) => row[field]);
|
|
7
|
+
export const hasCommands = (stage) => stage.commandCount > 0;
|
|
8
|
+
export const isManualStage = (stage) => !hasCommands(stage);
|
|
9
|
+
export const isRequiredStage = (stage) => stage.required;
|
|
10
|
+
export const isOptionalStage = (stage) => !stage.required;
|
|
11
|
+
export const usesReadOnlyRunPolicy = (stage) => stage.runPolicy === "read-only";
|
|
12
|
+
export const usesLocalOutputRunPolicy = (stage) => stage.runPolicy === "writes-local-file";
|
|
13
|
+
export const hasOutputFile = (stage) => stage.outputFiles.length > 0;
|
|
14
|
+
export const callsExternalSystem = (stage) => stage.externalCalls;
|
|
15
|
+
export const mutatesTargetRepo = (stage) => stage.targetRepoMutation;
|
|
16
|
+
|
|
17
|
+
export function buildStageIdentityMaps(stages) {
|
|
18
|
+
const stageFieldByKey = (field) => fieldByKey(stages, field);
|
|
19
|
+
const stageKeys = stages.map((stage) => stage.key);
|
|
20
|
+
const stageByKey = byKey(stages, (stage) => stage);
|
|
21
|
+
const stageLabelByKey = stageFieldByKey("label");
|
|
22
|
+
const stageSummaryByKey = stageFieldByKey("reason");
|
|
23
|
+
return {
|
|
24
|
+
stageKeys,
|
|
25
|
+
stageByKey,
|
|
26
|
+
stageLabelByKey,
|
|
27
|
+
stageSummaryByKey,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function buildStageActionStatusMaps(stageActionRows) {
|
|
32
|
+
const actionFieldByKey = (field) => fieldByKey(stageActionRows, field);
|
|
33
|
+
const stageActionTypeByKey = actionFieldByKey("actionType");
|
|
34
|
+
const stageActionLabelByKey = actionFieldByKey("actionLabel");
|
|
35
|
+
const stageActionInstructionsByKey = actionFieldByKey("actionInstruction");
|
|
36
|
+
const stageActionButtonLabelsByKey = actionFieldByKey("actionButtonLabel");
|
|
37
|
+
const stageActionAffordanceByKey = actionFieldByKey("actionAffordance");
|
|
38
|
+
const stageActionEnabledByKey = actionFieldByKey("actionEnabled");
|
|
39
|
+
const stageActionStatusByKey = actionFieldByKey("actionStatus");
|
|
40
|
+
const stageActionStatusLabelsByKey = actionFieldByKey("actionStatusLabel");
|
|
41
|
+
const stageActionStatusToneByKey = actionFieldByKey("actionStatusTone");
|
|
42
|
+
const stageActionDisabledReasonCodeByKey = actionFieldByKey("actionDisabledReasonCode");
|
|
43
|
+
const stageActionDisabledReasonByKey = actionFieldByKey("actionDisabledReason");
|
|
44
|
+
return {
|
|
45
|
+
stageActionRows,
|
|
46
|
+
stageActionTypeByKey,
|
|
47
|
+
stageActionLabelByKey,
|
|
48
|
+
stageActionInstructionsByKey,
|
|
49
|
+
stageActionButtonLabelsByKey,
|
|
50
|
+
stageActionAffordanceByKey,
|
|
51
|
+
stageActionEnabledByKey,
|
|
52
|
+
stageActionStatusByKey,
|
|
53
|
+
stageActionStatusLabelsByKey,
|
|
54
|
+
stageActionStatusToneByKey,
|
|
55
|
+
stageActionDisabledReasonCodeByKey,
|
|
56
|
+
stageActionDisabledReasonByKey,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function buildStageActionDependencyMaps(stageActionRows) {
|
|
61
|
+
const actionFieldByKey = (field) => fieldByKey(stageActionRows, field);
|
|
62
|
+
const stageActionPrerequisiteKeysByKey = actionFieldByKey("actionPrerequisiteKeys");
|
|
63
|
+
const stageActionPrerequisiteLabelsByKey = actionFieldByKey("actionPrerequisiteLabels");
|
|
64
|
+
const stageActionPrerequisiteCountByKey = actionFieldByKey("actionPrerequisiteCount");
|
|
65
|
+
const stageActionHasPrerequisitesByKey = actionFieldByKey("actionHasPrerequisites");
|
|
66
|
+
const stageActionDependencyReasonCodeByKey = actionFieldByKey("actionDependencyReasonCode");
|
|
67
|
+
const stageActionDependencyReasonByKey = actionFieldByKey("actionDependencyReason");
|
|
68
|
+
const stageActionBlockedStageKeysByKey = actionFieldByKey("actionBlockedStageKeys");
|
|
69
|
+
const stageActionBlockedStageLabelsByKey = actionFieldByKey("actionBlockedStageLabels");
|
|
70
|
+
const stageActionBlockedStageCountByKey = actionFieldByKey("actionBlockedStageCount");
|
|
71
|
+
const stageActionBlocksStagesByKey = actionFieldByKey("actionBlocksStages");
|
|
72
|
+
const stageActionCompletionCriteriaByKey = actionFieldByKey("actionCompletionCriteria");
|
|
73
|
+
const stageActionCompletionCriteriaCountByKey = actionFieldByKey("actionCompletionCriteriaCount");
|
|
74
|
+
const stageActionHasCompletionCriteriaByKey = actionFieldByKey("actionHasCompletionCriteria");
|
|
75
|
+
return {
|
|
76
|
+
stageActionPrerequisiteKeysByKey,
|
|
77
|
+
stageActionPrerequisiteLabelsByKey,
|
|
78
|
+
stageActionPrerequisiteCountByKey,
|
|
79
|
+
stageActionHasPrerequisitesByKey,
|
|
80
|
+
stageActionDependencyReasonCodeByKey,
|
|
81
|
+
stageActionDependencyReasonByKey,
|
|
82
|
+
stageActionBlockedStageKeysByKey,
|
|
83
|
+
stageActionBlockedStageLabelsByKey,
|
|
84
|
+
stageActionBlockedStageCountByKey,
|
|
85
|
+
stageActionBlocksStagesByKey,
|
|
86
|
+
stageActionCompletionCriteriaByKey,
|
|
87
|
+
stageActionCompletionCriteriaCountByKey,
|
|
88
|
+
stageActionHasCompletionCriteriaByKey,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function buildStageActionEvidenceMaps(stageActionRows) {
|
|
93
|
+
const actionFieldByKey = (field) => fieldByKey(stageActionRows, field);
|
|
94
|
+
const stageActionEvidenceRequirementsByKey = actionFieldByKey("actionEvidenceRequirements");
|
|
95
|
+
const stageActionEvidenceRequirementCountByKey = actionFieldByKey("actionEvidenceRequirementCount");
|
|
96
|
+
const stageActionRequiresEvidenceByKey = actionFieldByKey("actionRequiresEvidence");
|
|
97
|
+
const stageActionEvidenceTargetByKey = actionFieldByKey("actionEvidenceTarget");
|
|
98
|
+
const stageActionEvidenceTargetLabelByKey = actionFieldByKey("actionEvidenceTargetLabel");
|
|
99
|
+
return {
|
|
100
|
+
stageActionEvidenceRequirementsByKey,
|
|
101
|
+
stageActionEvidenceRequirementCountByKey,
|
|
102
|
+
stageActionRequiresEvidenceByKey,
|
|
103
|
+
stageActionEvidenceTargetByKey,
|
|
104
|
+
stageActionEvidenceTargetLabelByKey,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function buildStageActionEvidenceCaptureMaps(stageActionRows) {
|
|
109
|
+
const actionFieldByKey = (field) => fieldByKey(stageActionRows, field);
|
|
110
|
+
const stageActionEvidenceCaptureFieldsByKey = actionFieldByKey("actionEvidenceCaptureFields");
|
|
111
|
+
const stageActionEvidenceCaptureFieldKeysByKey = actionFieldByKey("actionEvidenceCaptureFieldKeys");
|
|
112
|
+
const stageActionEvidenceCaptureFieldLabelsByKey = actionFieldByKey("actionEvidenceCaptureFieldLabels");
|
|
113
|
+
const stageActionEvidenceCaptureFieldPlaceholdersByKey = actionFieldByKey("actionEvidenceCaptureFieldPlaceholders");
|
|
114
|
+
const stageActionEvidenceCaptureFieldRequirementLabelsByKey = actionFieldByKey("actionEvidenceCaptureFieldRequirementLabels");
|
|
115
|
+
const stageActionEvidenceCaptureFieldAriaLabelsByKey = actionFieldByKey("actionEvidenceCaptureFieldAriaLabels");
|
|
116
|
+
const stageActionEvidenceCaptureFieldHelpTextsByKey = actionFieldByKey("actionEvidenceCaptureFieldHelpTexts");
|
|
117
|
+
const stageActionEvidenceCaptureFieldSectionKeysByKey = actionFieldByKey("actionEvidenceCaptureFieldSectionKeys");
|
|
118
|
+
const stageActionEvidenceCaptureFieldSectionLabelsByKey = actionFieldByKey("actionEvidenceCaptureFieldSectionLabels");
|
|
119
|
+
const stageActionEvidenceCaptureSectionKeysByKey = actionFieldByKey("actionEvidenceCaptureSectionKeys");
|
|
120
|
+
const stageActionEvidenceCaptureSectionLabelsByKey = actionFieldByKey("actionEvidenceCaptureSectionLabels");
|
|
121
|
+
const stageActionEvidenceCaptureSectionCountByKey = actionFieldByKey("actionEvidenceCaptureSectionCount");
|
|
122
|
+
const stageActionEvidenceCaptureFieldPayloadNamespacesByKey = actionFieldByKey("actionEvidenceCaptureFieldPayloadNamespaces");
|
|
123
|
+
const stageActionEvidenceCaptureFieldPayloadPathsByKey = actionFieldByKey("actionEvidenceCaptureFieldPayloadPaths");
|
|
124
|
+
const stageActionEvidenceCapturePayloadNamespacesByKey = actionFieldByKey("actionEvidenceCapturePayloadNamespaces");
|
|
125
|
+
const stageActionEvidenceCapturePayloadNamespaceCountByKey = actionFieldByKey("actionEvidenceCapturePayloadNamespaceCount");
|
|
126
|
+
const stageActionEvidenceCapturePayloadTemplateByKey = actionFieldByKey("actionEvidenceCapturePayloadTemplate");
|
|
127
|
+
const stageActionEvidenceCapturePayloadFlatTemplateByKey = actionFieldByKey("actionEvidenceCapturePayloadFlatTemplate");
|
|
128
|
+
const stageActionEvidenceCapturePayloadBindingsByKey = actionFieldByKey("actionEvidenceCapturePayloadBindings");
|
|
129
|
+
const stageActionEvidenceCaptureValidationSpecsByKey = actionFieldByKey("actionEvidenceCaptureValidationSpecs");
|
|
130
|
+
const stageActionEvidenceCaptureInitialValidationStatesByKey = actionFieldByKey("actionEvidenceCaptureInitialValidationStates");
|
|
131
|
+
const stageActionEvidenceCaptureInitialValidationDisplayMetadataByKey = actionFieldByKey("actionEvidenceCaptureInitialValidationDisplayMetadata");
|
|
132
|
+
const stageActionEvidenceCaptureInitialValidationChecklistByKey = actionFieldByKey("actionEvidenceCaptureInitialValidationChecklist");
|
|
133
|
+
const stageActionEvidenceCaptureInitialValidationChecklistSummaryByKey = actionFieldByKey("actionEvidenceCaptureInitialValidationChecklistSummary");
|
|
134
|
+
const stageActionEvidenceCaptureInitialValidationSummaryByKey = actionFieldByKey("actionEvidenceCaptureInitialValidationSummary");
|
|
135
|
+
const stageActionEvidenceCaptureFieldInputTypesByKey = actionFieldByKey("actionEvidenceCaptureFieldInputTypes");
|
|
136
|
+
const stageActionEvidenceCaptureFieldValueShapesByKey = actionFieldByKey("actionEvidenceCaptureFieldValueShapes");
|
|
137
|
+
const stageActionEvidenceCaptureFieldAcceptsMultipleByKey = actionFieldByKey("actionEvidenceCaptureFieldAcceptsMultiple");
|
|
138
|
+
const stageActionEvidenceCaptureFieldDefaultValuesByKey = actionFieldByKey("actionEvidenceCaptureFieldDefaultValues");
|
|
139
|
+
const stageActionEvidenceCaptureFieldEmptyValuesByKey = actionFieldByKey("actionEvidenceCaptureFieldEmptyValues");
|
|
140
|
+
const stageActionEvidenceCaptureFieldValidationRulesByKey = actionFieldByKey("actionEvidenceCaptureFieldValidationRules");
|
|
141
|
+
const stageActionEvidenceCaptureFieldMinLengthsByKey = actionFieldByKey("actionEvidenceCaptureFieldMinLengths");
|
|
142
|
+
const stageActionEvidenceCaptureFieldExamplesByKey = actionFieldByKey("actionEvidenceCaptureFieldExamples");
|
|
143
|
+
const stageActionEvidenceCaptureFieldValidationHintsByKey = actionFieldByKey("actionEvidenceCaptureFieldValidationHints");
|
|
144
|
+
const stageActionRequiredEvidenceCaptureFieldKeysByKey = actionFieldByKey("actionRequiredEvidenceCaptureFieldKeys");
|
|
145
|
+
const stageActionOptionalEvidenceCaptureFieldKeysByKey = actionFieldByKey("actionOptionalEvidenceCaptureFieldKeys");
|
|
146
|
+
const stageActionEvidenceCaptureFieldCountByKey = actionFieldByKey("actionEvidenceCaptureFieldCount");
|
|
147
|
+
const stageActionRequiredEvidenceCaptureFieldCountByKey = actionFieldByKey("actionRequiredEvidenceCaptureFieldCount");
|
|
148
|
+
const stageActionOptionalEvidenceCaptureFieldCountByKey = actionFieldByKey("actionOptionalEvidenceCaptureFieldCount");
|
|
149
|
+
const stageActionHasEvidenceCaptureFieldsByKey = actionFieldByKey("actionHasEvidenceCaptureFields");
|
|
150
|
+
return {
|
|
151
|
+
stageActionEvidenceCaptureFieldsByKey,
|
|
152
|
+
stageActionEvidenceCaptureFieldKeysByKey,
|
|
153
|
+
stageActionEvidenceCaptureFieldLabelsByKey,
|
|
154
|
+
stageActionEvidenceCaptureFieldPlaceholdersByKey,
|
|
155
|
+
stageActionEvidenceCaptureFieldRequirementLabelsByKey,
|
|
156
|
+
stageActionEvidenceCaptureFieldAriaLabelsByKey,
|
|
157
|
+
stageActionEvidenceCaptureFieldHelpTextsByKey,
|
|
158
|
+
stageActionEvidenceCaptureFieldSectionKeysByKey,
|
|
159
|
+
stageActionEvidenceCaptureFieldSectionLabelsByKey,
|
|
160
|
+
stageActionEvidenceCaptureSectionKeysByKey,
|
|
161
|
+
stageActionEvidenceCaptureSectionLabelsByKey,
|
|
162
|
+
stageActionEvidenceCaptureSectionCountByKey,
|
|
163
|
+
stageActionEvidenceCaptureFieldPayloadNamespacesByKey,
|
|
164
|
+
stageActionEvidenceCaptureFieldPayloadPathsByKey,
|
|
165
|
+
stageActionEvidenceCapturePayloadNamespacesByKey,
|
|
166
|
+
stageActionEvidenceCapturePayloadNamespaceCountByKey,
|
|
167
|
+
stageActionEvidenceCapturePayloadTemplateByKey,
|
|
168
|
+
stageActionEvidenceCapturePayloadFlatTemplateByKey,
|
|
169
|
+
stageActionEvidenceCapturePayloadBindingsByKey,
|
|
170
|
+
stageActionEvidenceCaptureValidationSpecsByKey,
|
|
171
|
+
stageActionEvidenceCaptureInitialValidationStatesByKey,
|
|
172
|
+
stageActionEvidenceCaptureInitialValidationDisplayMetadataByKey,
|
|
173
|
+
stageActionEvidenceCaptureInitialValidationChecklistByKey,
|
|
174
|
+
stageActionEvidenceCaptureInitialValidationChecklistSummaryByKey,
|
|
175
|
+
stageActionEvidenceCaptureInitialValidationSummaryByKey,
|
|
176
|
+
stageActionEvidenceCaptureFieldInputTypesByKey,
|
|
177
|
+
stageActionEvidenceCaptureFieldValueShapesByKey,
|
|
178
|
+
stageActionEvidenceCaptureFieldAcceptsMultipleByKey,
|
|
179
|
+
stageActionEvidenceCaptureFieldDefaultValuesByKey,
|
|
180
|
+
stageActionEvidenceCaptureFieldEmptyValuesByKey,
|
|
181
|
+
stageActionEvidenceCaptureFieldValidationRulesByKey,
|
|
182
|
+
stageActionEvidenceCaptureFieldMinLengthsByKey,
|
|
183
|
+
stageActionEvidenceCaptureFieldExamplesByKey,
|
|
184
|
+
stageActionEvidenceCaptureFieldValidationHintsByKey,
|
|
185
|
+
stageActionRequiredEvidenceCaptureFieldKeysByKey,
|
|
186
|
+
stageActionOptionalEvidenceCaptureFieldKeysByKey,
|
|
187
|
+
stageActionEvidenceCaptureFieldCountByKey,
|
|
188
|
+
stageActionRequiredEvidenceCaptureFieldCountByKey,
|
|
189
|
+
stageActionOptionalEvidenceCaptureFieldCountByKey,
|
|
190
|
+
stageActionHasEvidenceCaptureFieldsByKey,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export function buildStageExecutionMaps(stages) {
|
|
195
|
+
const stageFieldByKey = (field) => fieldByKey(stages, field);
|
|
196
|
+
const commandListByKey = (getValue) => byKey(stages, (stage) => stage.commands.map(getValue));
|
|
197
|
+
const stageKeysBy = (predicate) => stages.filter(predicate).map((stage) => stage.key);
|
|
198
|
+
const stageKindByKey = stageFieldByKey("kind");
|
|
199
|
+
const stageRequiredByKey = stageFieldByKey("required");
|
|
200
|
+
const stageRunPolicyByKey = stageFieldByKey("runPolicy");
|
|
201
|
+
const stageSafetyLevelByKey = stageFieldByKey("safetyLevel");
|
|
202
|
+
const stageCommandCountByKey = stageFieldByKey("commandCount");
|
|
203
|
+
const stageCommandKeysByKey = stageFieldByKey("commandKeys");
|
|
204
|
+
const stageCommandLabelsByKey = commandListByKey((command) => command.label);
|
|
205
|
+
const stageCommandStringsByKey = commandListByKey((command) => command.command);
|
|
206
|
+
const stageCommandArgsByKey = commandListByKey((command) => command.commandArgs);
|
|
207
|
+
const stageCommandRunPoliciesByKey = commandListByKey((command) => command.runPolicy);
|
|
208
|
+
const stageCommandSafetyLevelsByKey = commandListByKey((command) => command.safety?.safetyLevel || "");
|
|
209
|
+
const stageOutputFilesByKey = stageFieldByKey("outputFiles");
|
|
210
|
+
const stageHasCommandsByKey = byKey(stages, hasCommands);
|
|
211
|
+
const stageManualByKey = byKey(stages, isManualStage);
|
|
212
|
+
const stageWritesLocalFileByKey = stageFieldByKey("writesLocalFile");
|
|
213
|
+
const stageExternalCallsByKey = stageFieldByKey("externalCalls");
|
|
214
|
+
const stageTargetRepoMutationByKey = stageFieldByKey("targetRepoMutation");
|
|
215
|
+
const commandStageKeys = stageKeysBy(hasCommands);
|
|
216
|
+
const manualStageKeys = stageKeysBy(isManualStage);
|
|
217
|
+
return {
|
|
218
|
+
stageKindByKey,
|
|
219
|
+
stageRequiredByKey,
|
|
220
|
+
stageRunPolicyByKey,
|
|
221
|
+
stageSafetyLevelByKey,
|
|
222
|
+
stageCommandCountByKey,
|
|
223
|
+
stageCommandKeysByKey,
|
|
224
|
+
stageCommandLabelsByKey,
|
|
225
|
+
stageCommandStringsByKey,
|
|
226
|
+
stageCommandArgsByKey,
|
|
227
|
+
stageCommandRunPoliciesByKey,
|
|
228
|
+
stageCommandSafetyLevelsByKey,
|
|
229
|
+
stageOutputFilesByKey,
|
|
230
|
+
stageHasCommandsByKey,
|
|
231
|
+
stageManualByKey,
|
|
232
|
+
stageWritesLocalFileByKey,
|
|
233
|
+
stageExternalCallsByKey,
|
|
234
|
+
stageTargetRepoMutationByKey,
|
|
235
|
+
commandStageKeys,
|
|
236
|
+
manualStageKeys,
|
|
237
|
+
};
|
|
238
|
+
}
|