@orbit-build/cli 1.6.7 → 1.7.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/dist/index.js +278 -93
- package/package.json +1 -1
- package/skills/cumcm-draft/SKILL.md +9 -10
- package/skills/cumcm-draft/agents/openai.yaml +1 -1
- package/skills/cumcm-draft/assets/project-template/.cumcm/profile.json +2 -1
- package/skills/cumcm-draft/references/code-and-output-style.md +4 -4
- package/skills/cumcm-draft/references/latex-figures-tables.md +3 -2
- package/skills/cumcm-draft/references/project-architecture.md +9 -8
- package/skills/cumcm-draft/scripts/audit_paper.py +1 -1
- package/skills/cumcm-draft/scripts/bootstrap_project.py +2 -1
- package/skills/cumcm-draft/scripts/project_utils.py +2 -1
- package/skills/cumcm-draft/scripts/validate_project.py +53 -16
package/dist/index.js
CHANGED
|
@@ -275524,6 +275524,13 @@ var DoctorSnapshotSchema = z48.object({
|
|
|
275524
275524
|
apiKeyLoaded: z48.boolean(),
|
|
275525
275525
|
apiKeySource: z48.string(),
|
|
275526
275526
|
deepSeekProfile: z48.boolean(),
|
|
275527
|
+
deepSeekApiFormat: z48.enum([
|
|
275528
|
+
"auto",
|
|
275529
|
+
"chat-completions",
|
|
275530
|
+
"responses",
|
|
275531
|
+
"anthropic"
|
|
275532
|
+
]),
|
|
275533
|
+
deepSeekFlashVersion: z48.string(),
|
|
275527
275534
|
models: z48.record(z48.string()),
|
|
275528
275535
|
probe: z48.string().nullable()
|
|
275529
275536
|
}),
|
|
@@ -283651,7 +283658,7 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
|
|
|
283651
283658
|
}
|
|
283652
283659
|
}, { passive: true });
|
|
283653
283660
|
|
|
283654
|
-
[elements.projectList, elements.projectChatBody].forEach((element) => {
|
|
283661
|
+
[elements.projectList, elements.projectChatBody, elements.inspectorContent].forEach((element) => {
|
|
283655
283662
|
element.addEventListener('scroll', () => syncScrollAffordance(element), { passive: true });
|
|
283656
283663
|
});
|
|
283657
283664
|
window.addEventListener('resize', syncAllScrollAffordances, { passive: true });
|
|
@@ -285876,6 +285883,7 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
285876
285883
|
inspectorBackdrop: byId('inspectorBackdrop'),
|
|
285877
285884
|
inspectorButton: byId('inspectorButton'),
|
|
285878
285885
|
inspectorClose: byId('inspectorClose'),
|
|
285886
|
+
inspectorContent: byId('inspectorContent'),
|
|
285879
285887
|
tasksButton: byId('tasksButton'),
|
|
285880
285888
|
changesButton: byId('changesButton'),
|
|
285881
285889
|
tasksTab: byId('tasksTab'),
|
|
@@ -286113,6 +286121,13 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
286113
286121
|
activityFilter: 'all',
|
|
286114
286122
|
changeQuery: '',
|
|
286115
286123
|
changeReview: null,
|
|
286124
|
+
activeInspectorTab: 'tasks',
|
|
286125
|
+
inspectorScrollPositions: {
|
|
286126
|
+
tasks: 0,
|
|
286127
|
+
activity: 0,
|
|
286128
|
+
changes: 0,
|
|
286129
|
+
settings: 0,
|
|
286130
|
+
},
|
|
286116
286131
|
};
|
|
286117
286132
|
|
|
286118
286133
|
const mobileSidebarQuery = window.matchMedia('(max-width: 900px)');
|
|
@@ -286346,53 +286361,6 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
286346
286361
|
else focusFirstControl();
|
|
286347
286362
|
}
|
|
286348
286363
|
|
|
286349
|
-
function setInspector(open, tab) {
|
|
286350
|
-
const wasOpen = elements.inspector.classList.contains('is-open');
|
|
286351
|
-
if (open && !wasOpen) inspectorReturnFocus = document.activeElement;
|
|
286352
|
-
if (open) {
|
|
286353
|
-
elements.appShell.classList.remove('sidebar-open');
|
|
286354
|
-
elements.menuButton.setAttribute('aria-expanded', 'false');
|
|
286355
|
-
}
|
|
286356
|
-
elements.inspector.classList.toggle('is-open', open);
|
|
286357
|
-
elements.inspectorBackdrop.classList.toggle('is-open', open);
|
|
286358
|
-
elements.inspectorBackdrop.hidden = !open;
|
|
286359
|
-
elements.inspector.setAttribute('aria-hidden', open ? 'false' : 'true');
|
|
286360
|
-
elements.inspector.inert = !open;
|
|
286361
|
-
elements.inspectorButton.setAttribute('aria-expanded', open ? 'true' : 'false');
|
|
286362
|
-
syncSidebarInteractivity();
|
|
286363
|
-
if (open && tab) selectInspectorTab(tab);
|
|
286364
|
-
if (open && !wasOpen) {
|
|
286365
|
-
elements.inspectorClose.focus();
|
|
286366
|
-
} else if (!open && wasOpen) {
|
|
286367
|
-
const returnTarget = inspectorReturnFocus && inspectorReturnFocus.isConnected
|
|
286368
|
-
? inspectorReturnFocus
|
|
286369
|
-
: elements.inspectorButton;
|
|
286370
|
-
inspectorReturnFocus = null;
|
|
286371
|
-
returnTarget.focus();
|
|
286372
|
-
}
|
|
286373
|
-
}
|
|
286374
|
-
|
|
286375
|
-
function trapInspectorFocus(event) {
|
|
286376
|
-
if (event.key !== 'Tab' || !elements.inspector.classList.contains('is-open')) return;
|
|
286377
|
-
const focusable = Array.from(elements.inspector.querySelectorAll(
|
|
286378
|
-
'button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [href], [tabindex]:not([tabindex="-1"])',
|
|
286379
|
-
)).filter((node) => !node.hidden && node.getClientRects().length > 0 && getComputedStyle(node).visibility !== 'hidden');
|
|
286380
|
-
if (!focusable.length) {
|
|
286381
|
-
event.preventDefault();
|
|
286382
|
-
elements.inspector.focus();
|
|
286383
|
-
return;
|
|
286384
|
-
}
|
|
286385
|
-
const first = focusable[0];
|
|
286386
|
-
const last = focusable[focusable.length - 1];
|
|
286387
|
-
if (event.shiftKey && document.activeElement === first) {
|
|
286388
|
-
event.preventDefault();
|
|
286389
|
-
last.focus();
|
|
286390
|
-
} else if (!event.shiftKey && document.activeElement === last) {
|
|
286391
|
-
event.preventDefault();
|
|
286392
|
-
first.focus();
|
|
286393
|
-
}
|
|
286394
|
-
}
|
|
286395
|
-
|
|
286396
286364
|
function trapSidebarFocus(event) {
|
|
286397
286365
|
if (event.key !== 'Tab' || !mobileSidebarQuery.matches || !elements.appShell.classList.contains('sidebar-open')) return;
|
|
286398
286366
|
const focusable = Array.from(elements.sidebar.querySelectorAll(
|
|
@@ -286410,43 +286378,6 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
286410
286378
|
}
|
|
286411
286379
|
}
|
|
286412
286380
|
|
|
286413
|
-
function selectInspectorTab(tab) {
|
|
286414
|
-
const tasks = tab === 'tasks';
|
|
286415
|
-
const activity = tab === 'activity';
|
|
286416
|
-
const changes = tab === 'changes';
|
|
286417
|
-
const settings = tab === 'settings';
|
|
286418
|
-
elements.tasksTab.classList.toggle('is-active', tasks);
|
|
286419
|
-
elements.tasksTab.setAttribute('aria-selected', tasks ? 'true' : 'false');
|
|
286420
|
-
elements.tasksTab.tabIndex = tasks ? 0 : -1;
|
|
286421
|
-
elements.activityTab.classList.toggle('is-active', activity);
|
|
286422
|
-
elements.activityTab.setAttribute('aria-selected', activity ? 'true' : 'false');
|
|
286423
|
-
elements.activityTab.tabIndex = activity ? 0 : -1;
|
|
286424
|
-
elements.changesTab.classList.toggle('is-active', changes);
|
|
286425
|
-
elements.changesTab.setAttribute('aria-selected', changes ? 'true' : 'false');
|
|
286426
|
-
elements.changesTab.tabIndex = changes ? 0 : -1;
|
|
286427
|
-
elements.settingsTab.classList.toggle('is-active', settings);
|
|
286428
|
-
elements.settingsTab.setAttribute('aria-selected', settings ? 'true' : 'false');
|
|
286429
|
-
elements.settingsTab.tabIndex = settings ? 0 : -1;
|
|
286430
|
-
elements.tasksPanel.hidden = !tasks;
|
|
286431
|
-
elements.activityPanel.hidden = !activity;
|
|
286432
|
-
elements.changesPanel.hidden = !changes;
|
|
286433
|
-
elements.settingsPanel.hidden = !settings;
|
|
286434
|
-
}
|
|
286435
|
-
|
|
286436
|
-
function handleInspectorTabKeydown(event) {
|
|
286437
|
-
const keys = ['ArrowLeft', 'ArrowRight', 'Home', 'End'];
|
|
286438
|
-
if (!keys.includes(event.key)) return;
|
|
286439
|
-
event.preventDefault();
|
|
286440
|
-
const tabs = [elements.tasksTab, elements.activityTab, elements.changesTab, elements.settingsTab];
|
|
286441
|
-
const current = Math.max(0, tabs.indexOf(event.currentTarget));
|
|
286442
|
-
let next = current;
|
|
286443
|
-
if (event.key === 'Home') next = 0;
|
|
286444
|
-
else if (event.key === 'End') next = tabs.length - 1;
|
|
286445
|
-
else next = (current + (event.key === 'ArrowRight' ? 1 : -1) + tabs.length) % tabs.length;
|
|
286446
|
-
selectInspectorTab(['tasks', 'activity', 'changes', 'settings'][next]);
|
|
286447
|
-
tabs[next].focus();
|
|
286448
|
-
}
|
|
286449
|
-
|
|
286450
286381
|
function nearBottom() {
|
|
286451
286382
|
const distance = elements.messageScroll.scrollHeight - elements.messageScroll.scrollTop - elements.messageScroll.clientHeight;
|
|
286452
286383
|
return distance < 110;
|
|
@@ -286461,7 +286392,7 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
286461
286392
|
}
|
|
286462
286393
|
|
|
286463
286394
|
function syncAllScrollAffordances() {
|
|
286464
|
-
[elements.messageScroll, elements.projectList, elements.projectChatBody]
|
|
286395
|
+
[elements.messageScroll, elements.projectList, elements.projectChatBody, elements.inspectorContent]
|
|
286465
286396
|
.forEach(syncScrollAffordance);
|
|
286466
286397
|
}
|
|
286467
286398
|
|
|
@@ -286697,6 +286628,100 @@ var WEB_UI_CLIENT_HISTORY_SCRIPT = String.raw`
|
|
|
286697
286628
|
|
|
286698
286629
|
`;
|
|
286699
286630
|
|
|
286631
|
+
// src/runtime/webui/WebUiClientInspector.ts
|
|
286632
|
+
var WEB_UI_CLIENT_INSPECTOR_SCRIPT = String.raw`
|
|
286633
|
+
function setInspector(open, tab) {
|
|
286634
|
+
const wasOpen = elements.inspector.classList.contains('is-open');
|
|
286635
|
+
if (open && !wasOpen) inspectorReturnFocus = document.activeElement;
|
|
286636
|
+
if (open) {
|
|
286637
|
+
elements.appShell.classList.remove('sidebar-open');
|
|
286638
|
+
elements.menuButton.setAttribute('aria-expanded', 'false');
|
|
286639
|
+
}
|
|
286640
|
+
elements.inspector.classList.toggle('is-open', open);
|
|
286641
|
+
elements.inspectorBackdrop.classList.toggle('is-open', open);
|
|
286642
|
+
elements.inspectorBackdrop.hidden = !open;
|
|
286643
|
+
elements.inspector.setAttribute('aria-hidden', open ? 'false' : 'true');
|
|
286644
|
+
elements.inspector.inert = !open;
|
|
286645
|
+
elements.inspectorButton.setAttribute('aria-expanded', open ? 'true' : 'false');
|
|
286646
|
+
syncSidebarInteractivity();
|
|
286647
|
+
if (open && tab) selectInspectorTab(tab);
|
|
286648
|
+
if (open && !wasOpen) {
|
|
286649
|
+
elements.inspectorClose.focus();
|
|
286650
|
+
} else if (!open && wasOpen) {
|
|
286651
|
+
const returnTarget = inspectorReturnFocus && inspectorReturnFocus.isConnected
|
|
286652
|
+
? inspectorReturnFocus
|
|
286653
|
+
: elements.inspectorButton;
|
|
286654
|
+
inspectorReturnFocus = null;
|
|
286655
|
+
returnTarget.focus();
|
|
286656
|
+
}
|
|
286657
|
+
}
|
|
286658
|
+
|
|
286659
|
+
function trapInspectorFocus(event) {
|
|
286660
|
+
if (event.key !== 'Tab' || !elements.inspector.classList.contains('is-open')) return;
|
|
286661
|
+
const focusable = Array.from(elements.inspector.querySelectorAll(
|
|
286662
|
+
'button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [href], [tabindex]:not([tabindex="-1"])',
|
|
286663
|
+
)).filter((node) => !node.hidden && node.getClientRects().length > 0 && getComputedStyle(node).visibility !== 'hidden');
|
|
286664
|
+
if (!focusable.length) {
|
|
286665
|
+
event.preventDefault();
|
|
286666
|
+
elements.inspector.focus();
|
|
286667
|
+
return;
|
|
286668
|
+
}
|
|
286669
|
+
const first = focusable[0];
|
|
286670
|
+
const last = focusable[focusable.length - 1];
|
|
286671
|
+
if (event.shiftKey && document.activeElement === first) {
|
|
286672
|
+
event.preventDefault();
|
|
286673
|
+
last.focus();
|
|
286674
|
+
} else if (!event.shiftKey && document.activeElement === last) {
|
|
286675
|
+
event.preventDefault();
|
|
286676
|
+
first.focus();
|
|
286677
|
+
}
|
|
286678
|
+
}
|
|
286679
|
+
|
|
286680
|
+
function selectInspectorTab(tab) {
|
|
286681
|
+
if (tab !== state.activeInspectorTab) {
|
|
286682
|
+
state.inspectorScrollPositions[state.activeInspectorTab] = elements.inspectorContent.scrollTop;
|
|
286683
|
+
state.activeInspectorTab = tab;
|
|
286684
|
+
}
|
|
286685
|
+
const tasks = tab === 'tasks';
|
|
286686
|
+
const activity = tab === 'activity';
|
|
286687
|
+
const changes = tab === 'changes';
|
|
286688
|
+
const settings = tab === 'settings';
|
|
286689
|
+
elements.tasksTab.classList.toggle('is-active', tasks);
|
|
286690
|
+
elements.tasksTab.setAttribute('aria-selected', tasks ? 'true' : 'false');
|
|
286691
|
+
elements.tasksTab.tabIndex = tasks ? 0 : -1;
|
|
286692
|
+
elements.activityTab.classList.toggle('is-active', activity);
|
|
286693
|
+
elements.activityTab.setAttribute('aria-selected', activity ? 'true' : 'false');
|
|
286694
|
+
elements.activityTab.tabIndex = activity ? 0 : -1;
|
|
286695
|
+
elements.changesTab.classList.toggle('is-active', changes);
|
|
286696
|
+
elements.changesTab.setAttribute('aria-selected', changes ? 'true' : 'false');
|
|
286697
|
+
elements.changesTab.tabIndex = changes ? 0 : -1;
|
|
286698
|
+
elements.settingsTab.classList.toggle('is-active', settings);
|
|
286699
|
+
elements.settingsTab.setAttribute('aria-selected', settings ? 'true' : 'false');
|
|
286700
|
+
elements.settingsTab.tabIndex = settings ? 0 : -1;
|
|
286701
|
+
elements.tasksPanel.hidden = !tasks;
|
|
286702
|
+
elements.activityPanel.hidden = !activity;
|
|
286703
|
+
elements.changesPanel.hidden = !changes;
|
|
286704
|
+
elements.settingsPanel.hidden = !settings;
|
|
286705
|
+
elements.inspectorContent.scrollTop = state.inspectorScrollPositions[tab] || 0;
|
|
286706
|
+
syncScrollAffordance(elements.inspectorContent);
|
|
286707
|
+
}
|
|
286708
|
+
|
|
286709
|
+
function handleInspectorTabKeydown(event) {
|
|
286710
|
+
const keys = ['ArrowLeft', 'ArrowRight', 'Home', 'End'];
|
|
286711
|
+
if (!keys.includes(event.key)) return;
|
|
286712
|
+
event.preventDefault();
|
|
286713
|
+
const tabs = [elements.tasksTab, elements.activityTab, elements.changesTab, elements.settingsTab];
|
|
286714
|
+
const current = Math.max(0, tabs.indexOf(event.currentTarget));
|
|
286715
|
+
let next = current;
|
|
286716
|
+
if (event.key === 'Home') next = 0;
|
|
286717
|
+
else if (event.key === 'End') next = tabs.length - 1;
|
|
286718
|
+
else next = (current + (event.key === 'ArrowRight' ? 1 : -1) + tabs.length) % tabs.length;
|
|
286719
|
+
selectInspectorTab(['tasks', 'activity', 'changes', 'settings'][next]);
|
|
286720
|
+
tabs[next].focus();
|
|
286721
|
+
}
|
|
286722
|
+
|
|
286723
|
+
`;
|
|
286724
|
+
|
|
286700
286725
|
// src/runtime/webui/WebUiClientMessages.ts
|
|
286701
286726
|
var WEB_UI_CLIENT_MESSAGES_SCRIPT = String.raw` function appendInline(parent, text) {
|
|
286702
286727
|
const pattern = /(\u0060[^\u0060\n]+\u0060|\*\*[^*\n]+\*\*|~~[^~\n]+~~|\*[^*\s][^*\n]*\*|(?<![A-Za-z0-9_])_[^_\n]+_(?![A-Za-z0-9_])|\[[^\]\n]+\]\(https?:\/\/[^)\s]+\))/g;
|
|
@@ -289896,6 +289921,7 @@ var WEB_UI_CLIENT_EPILOGUE = String.raw`})();
|
|
|
289896
289921
|
var WEB_UI_CLIENT_SCRIPT = [
|
|
289897
289922
|
WEB_UI_CLIENT_PREAMBLE,
|
|
289898
289923
|
WEB_UI_CLIENT_FOUNDATION_SCRIPT,
|
|
289924
|
+
WEB_UI_CLIENT_INSPECTOR_SCRIPT,
|
|
289899
289925
|
WEB_UI_CLIENT_SELECT_SCRIPT,
|
|
289900
289926
|
WEB_UI_CLIENT_APPROVAL_SCRIPT,
|
|
289901
289927
|
WEB_UI_CLIENT_ATTACHMENTS_SCRIPT,
|
|
@@ -292251,7 +292277,7 @@ function renderWebUiPage(language) {
|
|
|
292251
292277
|
<button class="inspector-tab" id="settingsTab" type="button" role="tab" aria-selected="false" aria-controls="settingsPanel" tabindex="-1">${copy.settings}</button>
|
|
292252
292278
|
</div>
|
|
292253
292279
|
|
|
292254
|
-
<div class="inspector-content">
|
|
292280
|
+
<div class="inspector-content" id="inspectorContent">
|
|
292255
292281
|
<section class="tab-panel" id="tasksPanel" role="tabpanel" aria-labelledby="tasksTab">
|
|
292256
292282
|
<header class="task-center-heading">
|
|
292257
292283
|
<span class="inspector-kicker">MISSION CONTROL</span>
|
|
@@ -292636,6 +292662,10 @@ var WEB_UI_COMPOSER_STYLES = String.raw`
|
|
|
292636
292662
|
font-size: 11px;
|
|
292637
292663
|
}
|
|
292638
292664
|
|
|
292665
|
+
.turn-status:empty {
|
|
292666
|
+
display: none;
|
|
292667
|
+
}
|
|
292668
|
+
|
|
292639
292669
|
.turn-status.is-working::before {
|
|
292640
292670
|
content: "";
|
|
292641
292671
|
width: 7px;
|
|
@@ -293365,10 +293395,38 @@ var WEB_UI_APPROVAL_STYLES = String.raw`
|
|
|
293365
293395
|
}
|
|
293366
293396
|
|
|
293367
293397
|
@media (max-width: 560px) {
|
|
293368
|
-
.approval-panel {
|
|
293369
|
-
|
|
293370
|
-
|
|
293371
|
-
|
|
293398
|
+
.approval-panel {
|
|
293399
|
+
margin-bottom: 8px;
|
|
293400
|
+
padding: 12px;
|
|
293401
|
+
border-radius: 14px;
|
|
293402
|
+
}
|
|
293403
|
+
|
|
293404
|
+
.approval-panel-head {
|
|
293405
|
+
gap: 9px;
|
|
293406
|
+
}
|
|
293407
|
+
|
|
293408
|
+
.approval-reason {
|
|
293409
|
+
margin: 8px 0 0;
|
|
293410
|
+
font-size: 11.5px;
|
|
293411
|
+
}
|
|
293412
|
+
|
|
293413
|
+
.approval-preview {
|
|
293414
|
+
max-height: min(128px, 20dvh);
|
|
293415
|
+
margin-top: 9px;
|
|
293416
|
+
padding-block: 7px;
|
|
293417
|
+
font-size: 10.75px;
|
|
293418
|
+
}
|
|
293419
|
+
|
|
293420
|
+
.approval-actions {
|
|
293421
|
+
display: grid;
|
|
293422
|
+
grid-template-columns: 1fr 1fr;
|
|
293423
|
+
margin-top: 10px;
|
|
293424
|
+
}
|
|
293425
|
+
|
|
293426
|
+
.approval-button {
|
|
293427
|
+
width: 100%;
|
|
293428
|
+
height: 40px;
|
|
293429
|
+
}
|
|
293372
293430
|
}
|
|
293373
293431
|
`;
|
|
293374
293432
|
|
|
@@ -295595,7 +295653,9 @@ button:focus-visible,
|
|
|
295595
295653
|
input:focus-visible,
|
|
295596
295654
|
select:focus-visible,
|
|
295597
295655
|
textarea:focus-visible,
|
|
295598
|
-
summary:focus-visible
|
|
295656
|
+
summary:focus-visible,
|
|
295657
|
+
a:focus-visible,
|
|
295658
|
+
[tabindex]:focus-visible {
|
|
295599
295659
|
outline: 2px solid color-mix(in srgb, var(--accent) 72%, transparent);
|
|
295600
295660
|
outline-offset: 2px;
|
|
295601
295661
|
}
|
|
@@ -295744,6 +295804,20 @@ var WEB_UI_INSPECTOR_STYLES = String.raw`
|
|
|
295744
295804
|
padding: 4px 17px 18px;
|
|
295745
295805
|
}
|
|
295746
295806
|
|
|
295807
|
+
.inspector-content.has-scroll-before {
|
|
295808
|
+
box-shadow: inset 0 12px 18px -18px color-mix(in srgb, var(--accent) 58%, var(--ink));
|
|
295809
|
+
}
|
|
295810
|
+
|
|
295811
|
+
.inspector-content.has-scroll-after {
|
|
295812
|
+
box-shadow: inset 0 -12px 18px -18px color-mix(in srgb, var(--accent) 58%, var(--ink));
|
|
295813
|
+
}
|
|
295814
|
+
|
|
295815
|
+
.inspector-content.has-scroll-before.has-scroll-after {
|
|
295816
|
+
box-shadow:
|
|
295817
|
+
inset 0 12px 18px -18px color-mix(in srgb, var(--accent) 58%, var(--ink)),
|
|
295818
|
+
inset 0 -12px 18px -18px color-mix(in srgb, var(--accent) 58%, var(--ink));
|
|
295819
|
+
}
|
|
295820
|
+
|
|
295747
295821
|
.tab-panel[hidden] {
|
|
295748
295822
|
display: none;
|
|
295749
295823
|
}
|
|
@@ -297295,6 +297369,15 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
297295
297369
|
.registered-project-remove {
|
|
297296
297370
|
opacity: 1;
|
|
297297
297371
|
}
|
|
297372
|
+
|
|
297373
|
+
.icon-button,
|
|
297374
|
+
.details-button,
|
|
297375
|
+
.connection-state,
|
|
297376
|
+
.new-project-button,
|
|
297377
|
+
.approval-button {
|
|
297378
|
+
min-width: 40px;
|
|
297379
|
+
min-height: 40px;
|
|
297380
|
+
}
|
|
297298
297381
|
}
|
|
297299
297382
|
|
|
297300
297383
|
@media (min-width: 901px) {
|
|
@@ -297487,7 +297570,7 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
297487
297570
|
}
|
|
297488
297571
|
}
|
|
297489
297572
|
|
|
297490
|
-
@media (max-height: 760px) and (min-width:
|
|
297573
|
+
@media (max-height: 760px) and (min-width: 561px) {
|
|
297491
297574
|
.sidebar {
|
|
297492
297575
|
gap: 5px;
|
|
297493
297576
|
}
|
|
@@ -297513,9 +297596,62 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
297513
297596
|
.suggestion-grid {
|
|
297514
297597
|
margin-top: 10px;
|
|
297515
297598
|
}
|
|
297599
|
+
|
|
297600
|
+
.approval-panel {
|
|
297601
|
+
margin-bottom: 8px;
|
|
297602
|
+
padding: 14px;
|
|
297603
|
+
}
|
|
297604
|
+
|
|
297605
|
+
.approval-reason {
|
|
297606
|
+
margin-top: 8px;
|
|
297607
|
+
}
|
|
297608
|
+
|
|
297609
|
+
.approval-preview {
|
|
297610
|
+
max-height: min(128px, 18dvh);
|
|
297611
|
+
margin-top: 9px;
|
|
297612
|
+
padding-block: 7px;
|
|
297613
|
+
}
|
|
297614
|
+
|
|
297615
|
+
.approval-actions {
|
|
297616
|
+
margin-top: 10px;
|
|
297617
|
+
}
|
|
297618
|
+
|
|
297619
|
+
.prompt-queue-list {
|
|
297620
|
+
max-height: 76px;
|
|
297621
|
+
}
|
|
297622
|
+
|
|
297623
|
+
.composer-hint {
|
|
297624
|
+
display: none;
|
|
297625
|
+
}
|
|
297626
|
+
}
|
|
297627
|
+
|
|
297628
|
+
@media (max-height: 640px) {
|
|
297629
|
+
.approval-preview {
|
|
297630
|
+
max-height: min(80px, 14dvh);
|
|
297631
|
+
}
|
|
297632
|
+
|
|
297633
|
+
.prompt-queue-list {
|
|
297634
|
+
max-height: 60px;
|
|
297635
|
+
}
|
|
297516
297636
|
}
|
|
297517
297637
|
|
|
297518
297638
|
@media (max-width: 560px) {
|
|
297639
|
+
.message-scroll,
|
|
297640
|
+
.project-chat-body,
|
|
297641
|
+
.project-list,
|
|
297642
|
+
.inspector-content,
|
|
297643
|
+
.workspace-view {
|
|
297644
|
+
scrollbar-gutter: auto;
|
|
297645
|
+
}
|
|
297646
|
+
|
|
297647
|
+
.message-scroll {
|
|
297648
|
+
scrollbar-width: none;
|
|
297649
|
+
}
|
|
297650
|
+
|
|
297651
|
+
.message-scroll::-webkit-scrollbar {
|
|
297652
|
+
display: none;
|
|
297653
|
+
}
|
|
297654
|
+
|
|
297519
297655
|
.project-dialog-card {
|
|
297520
297656
|
padding: 17px;
|
|
297521
297657
|
}
|
|
@@ -297663,6 +297799,26 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
297663
297799
|
border-radius: 16px;
|
|
297664
297800
|
}
|
|
297665
297801
|
|
|
297802
|
+
.prompt-queue {
|
|
297803
|
+
gap: 4px;
|
|
297804
|
+
margin-inline: 4px;
|
|
297805
|
+
padding: 6px;
|
|
297806
|
+
}
|
|
297807
|
+
|
|
297808
|
+
.prompt-queue-list {
|
|
297809
|
+
max-height: 76px;
|
|
297810
|
+
}
|
|
297811
|
+
|
|
297812
|
+
.prompt-queue-row {
|
|
297813
|
+
min-height: 27px;
|
|
297814
|
+
font-size: 10.5px;
|
|
297815
|
+
}
|
|
297816
|
+
|
|
297817
|
+
.prompt-queue-actions button {
|
|
297818
|
+
width: 24px;
|
|
297819
|
+
height: 24px;
|
|
297820
|
+
}
|
|
297821
|
+
|
|
297666
297822
|
.composer-hint {
|
|
297667
297823
|
display: none;
|
|
297668
297824
|
}
|
|
@@ -297800,6 +297956,28 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
297800
297956
|
}
|
|
297801
297957
|
}
|
|
297802
297958
|
|
|
297959
|
+
@media (prefers-contrast: more) {
|
|
297960
|
+
:root {
|
|
297961
|
+
--border: color-mix(in srgb, var(--ink-strong) 24%, transparent);
|
|
297962
|
+
--border-strong: color-mix(in srgb, var(--ink-strong) 38%, transparent);
|
|
297963
|
+
}
|
|
297964
|
+
|
|
297965
|
+
button:focus-visible,
|
|
297966
|
+
input:focus-visible,
|
|
297967
|
+
select:focus-visible,
|
|
297968
|
+
textarea:focus-visible,
|
|
297969
|
+
summary:focus-visible,
|
|
297970
|
+
a:focus-visible,
|
|
297971
|
+
[tabindex]:focus-visible {
|
|
297972
|
+
outline-width: 3px;
|
|
297973
|
+
}
|
|
297974
|
+
|
|
297975
|
+
.topbar,
|
|
297976
|
+
.composer {
|
|
297977
|
+
backdrop-filter: none;
|
|
297978
|
+
}
|
|
297979
|
+
}
|
|
297980
|
+
|
|
297803
297981
|
@media (forced-colors: active) {
|
|
297804
297982
|
button,
|
|
297805
297983
|
input,
|
|
@@ -298353,6 +298531,12 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
298353
298531
|
border-radius: 12px;
|
|
298354
298532
|
}
|
|
298355
298533
|
|
|
298534
|
+
.project-section:has(.project-toggle[aria-expanded="false"]) {
|
|
298535
|
+
min-height: 0;
|
|
298536
|
+
flex: 0 0 auto;
|
|
298537
|
+
grid-template-rows: auto;
|
|
298538
|
+
}
|
|
298539
|
+
|
|
298356
298540
|
.recent-projects-shell {
|
|
298357
298541
|
min-width: 0;
|
|
298358
298542
|
min-height: 0;
|
|
@@ -298973,6 +299157,7 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
298973
299157
|
padding: 0 clamp(18px, 2vw, 30px);
|
|
298974
299158
|
border-bottom: 1px solid var(--border);
|
|
298975
299159
|
background: color-mix(in srgb, var(--surface-glass) 97%, white);
|
|
299160
|
+
box-shadow: 0 1px 0 color-mix(in srgb, var(--surface-raised) 68%, transparent);
|
|
298976
299161
|
backdrop-filter: blur(24px) saturate(125%);
|
|
298977
299162
|
z-index: 15;
|
|
298978
299163
|
}
|
package/package.json
CHANGED
|
@@ -188,9 +188,9 @@ the outcome. Record explicit upstream artifact contracts between subproblems.
|
|
|
188
188
|
|
|
189
189
|
### 3. Implement and run
|
|
190
190
|
|
|
191
|
-
-
|
|
192
|
-
|
|
193
|
-
|
|
191
|
+
- Put genuinely cross-question configuration/loading/plotting/validation logic
|
|
192
|
+
under `code/always/`. Keep question-owned logic under its `code/qN/` directory;
|
|
193
|
+
do not copy a module into `always` merely to make the tree look modular. Give every generated artifact one producing subproblem and
|
|
194
194
|
store it in `results/qN`. Downstream questions may read an upstream qN result;
|
|
195
195
|
do not create `results/always`, `results/shared`, or another ownerless result
|
|
196
196
|
directory. Keep each `main.py` orchestral. After reading the problem, name
|
|
@@ -239,13 +239,12 @@ the outcome. Record explicit upstream artifact contracts between subproblems.
|
|
|
239
239
|
and reproducibility metadata belong under `.cumcm/`, not `results/`.
|
|
240
240
|
- Give every final figure a descriptive Chinese filename and Chinese title,
|
|
241
241
|
axes, legend, annotations, and category labels. Configure a CJK font fallback
|
|
242
|
-
such as Microsoft YaHei, SimHei, or Noto Sans CJK SC.
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
itself is correct.
|
|
242
|
+
such as Microsoft YaHei, SimHei, or Noto Sans CJK SC. Generate PNG only,
|
|
243
|
+
at 300 dpi or higher, and update every paper/support reference. Do not leave
|
|
244
|
+
PDF, SVG, JPG, or EPS siblings in `figures/`; those formats belong to source
|
|
245
|
+
inputs or transient build output, not final figure delivery. Names such as
|
|
246
|
+
`summary.png`, `plot.png`, `figure.png`, `output.png`, or `final.png` are
|
|
247
|
+
invalid even when the graphic itself is correct.
|
|
249
248
|
- Preserve a non-Chinese filename, header, or worksheet name only when the
|
|
250
249
|
problem statement or supplied fill-in template fixes it. Do not translate or
|
|
251
250
|
silently reshape that prescribed schema. Register the exact output path,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "cumcm-draft"
|
|
3
3
|
short_description: "Complete CUMCM paper, code, PDF, AI record, and support ZIP"
|
|
4
|
-
default_prompt: "Use $cumcm-draft to ask which Python or Conda interpreter to use, audit the current official CUMCM rules, build responsibility-based q1/q2 code without project-local finalizers or Python caches, generate Chinese-named tables and Chinese
|
|
4
|
+
default_prompt: "Use $cumcm-draft to ask which Python or Conda interpreter to use, audit the current official CUMCM rules, build responsibility-based q1/q2 code with genuinely shared modules under code/always without project-local finalizers or Python caches, generate Chinese-named tables and 300-dpi Chinese PNG figures, keep final PDFs/TeX and required qN submission copies under happy/, inspect the full Chinese paper, and package the matching PDF/ZIP pair."
|
|
5
5
|
policy:
|
|
6
6
|
allow_implicit_invocation: false
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"require_chinese_headers": true,
|
|
19
19
|
"require_chinese_sheet_names": true,
|
|
20
20
|
"require_chinese_figure_filenames": true,
|
|
21
|
-
"
|
|
21
|
+
"require_png_figures": true,
|
|
22
|
+
"min_png_dpi": 300,
|
|
22
23
|
"require_utf8_sig_csv": true,
|
|
23
24
|
"fixed_schema_exceptions": []
|
|
24
25
|
},
|
|
@@ -14,7 +14,7 @@ code/
|
|
|
14
14
|
├── forecasting.py
|
|
15
15
|
├── evaluation.py
|
|
16
16
|
└── reporting.py
|
|
17
|
-
└──
|
|
17
|
+
└── always/ # genuinely shared cross-question logic only
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
The names above are examples, not a fixed template. Another question may need
|
|
@@ -119,9 +119,9 @@ For each `figures/qN`:
|
|
|
119
119
|
- save only figures used or directly useful in the paper;
|
|
120
120
|
- use descriptive Chinese filenames; reject generic names such as
|
|
121
121
|
`summary.png`, `plot.png`, `figure.png`, `output.png`, and `final.png`;
|
|
122
|
-
- generate
|
|
123
|
-
-
|
|
124
|
-
|
|
122
|
+
- generate final figures as PNG at 300 dpi or higher;
|
|
123
|
+
- remove stale PDF, SVG, JPG, and EPS siblings from `figures/` so the final
|
|
124
|
+
figure contract is unambiguous;
|
|
125
125
|
- write figure titles, axes, legends, annotations, and categories in Chinese;
|
|
126
126
|
- use Chinese-capable fonts and minus-sign handling;
|
|
127
127
|
- label axes and colorbars with units;
|
|
@@ -35,8 +35,9 @@
|
|
|
35
35
|
|
|
36
36
|
## Figures
|
|
37
37
|
|
|
38
|
-
- Generate
|
|
39
|
-
-
|
|
38
|
+
- Generate every final figure as PNG at 300 dpi or higher.
|
|
39
|
+
- Do not leave PDF, SVG, JPG, or EPS siblings in `figures/`; keep transient
|
|
40
|
+
vector exports under `.cumcm/build/` when an analysis tool needs them.
|
|
40
41
|
- Use Chinese filenames and Chinese titles, axes, legends, annotations, and
|
|
41
42
|
category labels, with a CJK-capable font fallback.
|
|
42
43
|
- Make labels readable at final printed size.
|
|
@@ -22,7 +22,7 @@ project-root/
|
|
|
22
22
|
│ │ ├── forecasting.py # examples; names follow real responsibilities
|
|
23
23
|
│ │ └── evaluation.py
|
|
24
24
|
│ ├── q2/
|
|
25
|
-
│ └──
|
|
25
|
+
│ └── always/ # genuinely shared cross-question logic only
|
|
26
26
|
├── results/
|
|
27
27
|
│ ├── q1/ # Chinese-named tables, metrics, models, workbooks
|
|
28
28
|
│ ├── q2/
|
|
@@ -53,8 +53,9 @@ or `happy/build/`.
|
|
|
53
53
|
role. Record that they were blank.
|
|
54
54
|
- A required filled table belongs in `results/qN`, even when its blank template
|
|
55
55
|
came from `question/`.
|
|
56
|
-
-
|
|
57
|
-
|
|
56
|
+
- Put genuinely shared behavior in `code/always`; keep question-specific logic
|
|
57
|
+
in `code/qN`. Do not duplicate a module into `always` merely to make the
|
|
58
|
+
tree look modular, and do not put result artifacts there.
|
|
58
59
|
- Each `code/qN/main.py` must run independently after prerequisites exist,
|
|
59
60
|
both through `code/run_all.py` and as a direct script from its qN directory.
|
|
60
61
|
- `main.py` orchestrates loading, domain computation, validation, and reporting.
|
|
@@ -86,11 +87,11 @@ or `happy/build/`.
|
|
|
86
87
|
- Use descriptive Chinese filenames for generated tabular artifacts under
|
|
87
88
|
`results/qN`; use Chinese CSV/TSV headers and Chinese Excel worksheet/table
|
|
88
89
|
headers, with units where applicable.
|
|
89
|
-
- Use descriptive Chinese figure filenames such as `需求预测误差对比.
|
|
90
|
-
`价格弹性敏感性分析.
|
|
91
|
-
categories in Chinese. Generate
|
|
92
|
-
|
|
93
|
-
`figure.png`, `output.png`, and `final.png` are invalid.
|
|
90
|
+
- Use descriptive Chinese PNG figure filenames such as `需求预测误差对比.png`
|
|
91
|
+
or `价格弹性敏感性分析.png`. Write titles, axes, legends, annotations, and
|
|
92
|
+
categories in Chinese. Generate at least 300 dpi PNG output and remove stale
|
|
93
|
+
PDF, SVG, JPG, and EPS siblings. Generic names such as `summary.png`,
|
|
94
|
+
`plot.png`, `figure.png`, `output.png`, and `final.png` are invalid.
|
|
94
95
|
- Preserve a prescribed non-Chinese result schema only when the problem fixes
|
|
95
96
|
it, and document the narrow exception in
|
|
96
97
|
`.cumcm/profile.json.result_artifacts.fixed_schema_exceptions`.
|
|
@@ -11,7 +11,7 @@ from typing import Any
|
|
|
11
11
|
from project_utils import build_directory, delivery_directory, generated_directory
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
FIGURE_SUFFIXES = {".
|
|
14
|
+
FIGURE_SUFFIXES = {".png"}
|
|
15
15
|
PROBLEM_SUFFIXES = {".pdf", ".doc", ".docx", ".csv", ".tsv", ".xls", ".xlsx"}
|
|
16
16
|
INVENTORY_EXCLUDED_PARTS = {"__pycache__", ".pytest_cache", ".mypy_cache", ".ruff_cache", ".orbit", "_work"}
|
|
17
17
|
FIGURE_STALE_TOLERANCE_SECONDS = 30.0
|
|
@@ -47,6 +47,7 @@ def main() -> None:
|
|
|
47
47
|
for directory in (
|
|
48
48
|
root / "question",
|
|
49
49
|
root / "code",
|
|
50
|
+
root / "code" / "always",
|
|
50
51
|
delivery_directory(root),
|
|
51
52
|
control_directory(root),
|
|
52
53
|
control_directory(root) / "build",
|
|
@@ -415,7 +416,7 @@ def solve(inputs):
|
|
|
415
416
|
|
|
416
417
|
|
|
417
418
|
def evaluate_and_report(inputs, solution) -> None:
|
|
418
|
-
# TODO[{name}] 完成验证,并输出中文命名的CSV/XLSX及
|
|
419
|
+
# TODO[{name}] 完成验证,并输出中文命名的CSV/XLSX及300 dpi PNG图。
|
|
419
420
|
raise NotImplementedError("请实现问题{name}的评价与报告")
|
|
420
421
|
''',
|
|
421
422
|
}
|
|
@@ -27,7 +27,8 @@ DEFAULT_PROFILE: dict[str, Any] = {
|
|
|
27
27
|
"require_chinese_headers": True,
|
|
28
28
|
"require_chinese_sheet_names": True,
|
|
29
29
|
"require_chinese_figure_filenames": True,
|
|
30
|
-
"
|
|
30
|
+
"require_png_figures": True,
|
|
31
|
+
"min_png_dpi": 300,
|
|
31
32
|
"require_utf8_sig_csv": True,
|
|
32
33
|
"fixed_schema_exceptions": [],
|
|
33
34
|
},
|
|
@@ -8,6 +8,7 @@ import io
|
|
|
8
8
|
import json
|
|
9
9
|
import posixpath
|
|
10
10
|
import re
|
|
11
|
+
import struct
|
|
11
12
|
import subprocess
|
|
12
13
|
import sys
|
|
13
14
|
import zipfile
|
|
@@ -40,7 +41,7 @@ SUPPORT_EXCLUDED_PARTS = {
|
|
|
40
41
|
}
|
|
41
42
|
NESTED_ARCHIVE_SUFFIXES = {".zip", ".rar", ".7z"}
|
|
42
43
|
TABULAR_RESULT_SUFFIXES = {".csv", ".tsv", ".xls", ".xlsx"}
|
|
43
|
-
FIGURE_SUFFIXES = {".
|
|
44
|
+
FIGURE_SUFFIXES = {".png"}
|
|
44
45
|
GENERIC_FIGURE_STEMS = {
|
|
45
46
|
"chart",
|
|
46
47
|
"figure",
|
|
@@ -539,45 +540,81 @@ def result_artifact_contract_errors(
|
|
|
539
540
|
def figure_artifact_contract_errors(
|
|
540
541
|
root: Path, profile: dict[str, object]
|
|
541
542
|
) -> list[str]:
|
|
542
|
-
"""Require final figures to
|
|
543
|
+
"""Require final figures to be descriptive, valid, high-resolution PNGs."""
|
|
543
544
|
errors: list[str] = []
|
|
544
545
|
if profile.get("require_chinese_figure_filenames", True) is not True:
|
|
545
546
|
errors.append(
|
|
546
547
|
"result_artifacts.require_chinese_figure_filenames must be true"
|
|
547
548
|
)
|
|
549
|
+
if profile.get("require_png_figures", True) is not True:
|
|
550
|
+
errors.append("result_artifacts.require_png_figures must be true")
|
|
551
|
+
minimum_dpi = profile.get("min_png_dpi", 300)
|
|
552
|
+
if (
|
|
553
|
+
isinstance(minimum_dpi, bool)
|
|
554
|
+
or not isinstance(minimum_dpi, (int, float))
|
|
555
|
+
or minimum_dpi < 300
|
|
556
|
+
):
|
|
557
|
+
errors.append("result_artifacts.min_png_dpi must be a number >= 300")
|
|
558
|
+
minimum_dpi = 300
|
|
548
559
|
figures = root / "figures"
|
|
549
560
|
if not figures.is_dir() or figures.is_symlink():
|
|
550
561
|
return errors
|
|
551
|
-
formats_by_stem: dict[str, set[str]] = {}
|
|
552
562
|
for path in figures.rglob("*"):
|
|
553
563
|
if not path.is_file() or path.is_symlink():
|
|
554
564
|
continue
|
|
555
565
|
relative = path.relative_to(root).as_posix()
|
|
556
566
|
if path.suffix.lower() not in FIGURE_SUFFIXES:
|
|
557
567
|
errors.append(
|
|
558
|
-
f"figures
|
|
568
|
+
f"final figures must be PNG only; remove or move this artifact: {relative}"
|
|
559
569
|
)
|
|
560
570
|
continue
|
|
561
571
|
stem = path.stem.strip()
|
|
562
|
-
key = path.relative_to(figures).with_suffix("").as_posix().casefold()
|
|
563
|
-
formats_by_stem.setdefault(key, set()).add(path.suffix.lower())
|
|
564
572
|
if stem.lower() in GENERIC_FIGURE_STEMS or not has_chinese(stem):
|
|
565
573
|
errors.append(
|
|
566
574
|
f"figure filename must be descriptive Chinese, not a generic name: {relative}"
|
|
567
575
|
)
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
576
|
+
dpi = png_dpi(path)
|
|
577
|
+
if dpi is None:
|
|
578
|
+
errors.append(
|
|
579
|
+
f"PNG figure must contain valid resolution metadata at or above {minimum_dpi:g} dpi: {relative}"
|
|
580
|
+
)
|
|
581
|
+
# PNG stores pixels-per-metre as an integer; allow the sub-dpi
|
|
582
|
+
# quantization error produced by an exact 300 dpi export.
|
|
583
|
+
elif dpi + 0.5 < float(minimum_dpi):
|
|
584
|
+
errors.append(
|
|
585
|
+
f"PNG figure resolution is {dpi:.1f} dpi, below the required {minimum_dpi:g} dpi: {relative}"
|
|
586
|
+
)
|
|
578
587
|
return errors
|
|
579
588
|
|
|
580
589
|
|
|
590
|
+
def png_dpi(path: Path) -> float | None:
|
|
591
|
+
"""Read PNG pHYs metadata without requiring Pillow at validation time."""
|
|
592
|
+
try:
|
|
593
|
+
with path.open("rb") as stream:
|
|
594
|
+
if stream.read(8) != b"\x89PNG\r\n\x1a\n":
|
|
595
|
+
return None
|
|
596
|
+
while True:
|
|
597
|
+
length_bytes = stream.read(4)
|
|
598
|
+
if len(length_bytes) != 4:
|
|
599
|
+
return None
|
|
600
|
+
length = struct.unpack(">I", length_bytes)[0]
|
|
601
|
+
chunk_type = stream.read(4)
|
|
602
|
+
if len(chunk_type) != 4:
|
|
603
|
+
return None
|
|
604
|
+
data = stream.read(length)
|
|
605
|
+
if len(data) != length or len(stream.read(4)) != 4:
|
|
606
|
+
return None
|
|
607
|
+
if chunk_type == b"pHYs" and len(data) >= 9:
|
|
608
|
+
pixels_x, pixels_y, unit = struct.unpack(">IIB", data[:9])
|
|
609
|
+
if unit != 1 or not pixels_x or not pixels_y:
|
|
610
|
+
return None
|
|
611
|
+
return min(pixels_x, pixels_y) * 0.0254
|
|
612
|
+
if chunk_type == b"IEND":
|
|
613
|
+
return None
|
|
614
|
+
except (OSError, struct.error):
|
|
615
|
+
return None
|
|
616
|
+
|
|
617
|
+
|
|
581
618
|
def fixed_schema_congruence_errors(
|
|
582
619
|
target: Path, source: Path, allowances: set[str], relative: str
|
|
583
620
|
) -> list[str]:
|