Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 43 additions & 9 deletions apps/desktop/renderer-architecture.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
"src/renderer/locales/shell-copy.ts",
"src/renderer/locales/shell-remaining-copy.ts",
"src/renderer/locales/task-readiness-copy.ts",
"src/renderer/locales/work-board-error-copy.ts",
"src/renderer/locales/workhub-copy.ts",
"src/renderer/main.tsx",
"src/renderer/mcp-brand-contrast.ts",
"src/renderer/mcp-brand-marks.tsx",
Expand Down Expand Up @@ -392,7 +394,7 @@
"react": 1
},
"importSpecifiers": 9,
"nonTriviaTokens": 2307
"nonTriviaTokens": 2283
},
"src/renderer/app-shell-context-compaction.ts": {
"importDeclarations": 0,
Expand All @@ -409,19 +411,19 @@
"nonTriviaTokens": 610
},
"src/renderer/app-shell-copy.ts": {
"importDeclarations": 1,
"importDeclarations": 0,
"bridgePaths": {},
"environmentCapabilities": {},
"hookCalls": {},
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"./locales/shell-copy.js": 1,
"@maka/core/redaction": 1
"./application/contracts/operation-diagnostics.js": 1,
"./locales/shell-copy.js": 1
},
"importSpecifiers": 1,
"nonTriviaTokens": 504
"importSpecifiers": 0,
"nonTriviaTokens": 363
},
"src/renderer/app-shell-detail-panel.tsx": {
"importDeclarations": 0,
Expand Down Expand Up @@ -893,7 +895,7 @@
"react": 1
},
"importSpecifiers": 121,
"nonTriviaTokens": 15007
"nonTriviaTokens": 15003
},
"src/renderer/use-app-shell-composer-quotes.ts": {
"importDeclarations": 2,
Expand Down Expand Up @@ -1609,7 +1611,9 @@
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/session-collaboration-copy.ts": {
"bridgePaths": {},
Expand Down Expand Up @@ -1760,7 +1764,8 @@
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"@maka/core/redaction": 1
"@maka/core/redaction": 1,
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/shell-remaining-copy.ts": {
Expand All @@ -1781,6 +1786,26 @@
"actionFactories": [],
"dependencyPaths": {}
},
"src/renderer/locales/work-board-error-copy.ts": {
"bridgePaths": {},
"environmentCapabilities": {},
"hookCalls": {},
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"@maka/core/ui-locale": 1
}
},
"src/renderer/locales/workhub-copy.ts": {
"bridgePaths": {},
"environmentCapabilities": {},
"hookCalls": {},
"lifecycleMethods": {},
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {}
},
"src/renderer/mcp-brand-contrast.ts": {
"bridgePaths": {},
"environmentCapabilities": {},
Expand Down Expand Up @@ -2050,6 +2075,7 @@
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"./application/contracts/operation-diagnostics.js": 1,
"./locales/plan-mode-copy.js": 1,
"@astryxdesign/core/Banner": 1,
"@astryxdesign/core/Collapsible": 1,
Expand Down Expand Up @@ -2086,6 +2112,7 @@
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"./application/contracts/operation-diagnostics.js": 1,
"./locales/shell-copy.js": 1,
"@astryxdesign/core/Button": 1,
"@astryxdesign/core/Dialog": 1,
Expand Down Expand Up @@ -2151,6 +2178,7 @@
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"./application/contracts/operation-diagnostics.js": 1,
"./features/session-collaboration": 1,
"./locales/session-collaboration-copy.js": 1,
"@astryxdesign/core": 1,
Expand Down Expand Up @@ -4518,6 +4546,7 @@
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"./application/contracts/operation-diagnostics.js": 1,
"@maka/core/work-board": 1,
"react": 1
}
Expand All @@ -4536,7 +4565,9 @@
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"./application/contracts/operation-diagnostics.js": 1,
"./locales/conversation-copy.js": 1,
"./locales/work-board-error-copy.js": 1,
"./use-work-board.js": 1,
"@astryxdesign/core": 1,
"@astryxdesign/core/Button": 1,
Expand All @@ -4554,6 +4585,7 @@
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"./application/contracts/operation-diagnostics.js": 1,
"./workhub-route-policy.js": 1
}
},
Expand Down Expand Up @@ -4645,6 +4677,8 @@
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"./application/contracts/operation-diagnostics.js": 1,
"./locales/workhub-copy.js": 2,
"./workhub-coordination-port.js": 1,
"./workhub-send-lease.js": 1,
"@astryxdesign/core": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { encodeIngestItems } from '../../preload/attachment-ingest-payload.js';
describe('encodeIngestItems', () => {
test('rejects more than 8 items without reading any file bytes', async () => {
const items = Array.from({ length: 9 }, (_, i) => ({ approvalId: `a${i}`, name: `f${i}.txt` }));
await assert.rejects(encodeIngestItems(items as never), /8/);
await assert.rejects(encodeIngestItems(items as never), /attachment_ingest:count_exceeded/);
});

test('rejects a File over 50MB without calling arrayBuffer', async () => {
Expand All @@ -38,7 +38,7 @@ describe('encodeIngestItems', () => {
return new ArrayBuffer(0);
},
} as unknown as File;
await assert.rejects(encodeIngestItems([{ file: bigFile }]), /50/);
await assert.rejects(encodeIngestItems([{ file: bigFile }]), /attachment_ingest:size_exceeded/);
assert.equal(arrayBufferCalls, 0, 'arrayBuffer must not be called for an oversized file');
});

Expand Down Expand Up @@ -67,7 +67,7 @@ describe('encodeIngestItems', () => {
test('rejects a raw base64 item that is neither a File nor an approval token', async () => {
await assert.rejects(
encodeIngestItems([{ name: 'forged', base64: 'AAAA' }] as never),
/无效/,
/attachment_ingest:payload_invalid/,
);
});
});
22 changes: 11 additions & 11 deletions apps/desktop/src/main/__tests__/attachment-ingest-resolve.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('resolveIngestItems (pre-read validation)', () => {
approvals,
stat: async () => (statCalls++, { size: 1 }),
}),
/最多/,
/attachment_ingest:count_limit/,
);
assert.equal(statCalls, 0);
});
Expand All @@ -60,7 +60,7 @@ describe('resolveIngestItems (pre-read validation)', () => {
approvals,
stat: async () => (statCalls++, { size: 1 }),
}),
/过期|无效/,
/attachment_ingest:(source_expired|items_invalid)/,
);
assert.equal(statCalls, 0);
});
Expand All @@ -77,7 +77,7 @@ describe('resolveIngestItems (pre-read validation)', () => {
approvals,
stat: async () => (statCalls++, { size: 1 }),
}),
/过期|无效/,
/attachment_ingest:(source_expired|items_invalid)/,
);
assert.equal(statCalls, 0);
});
Expand All @@ -95,7 +95,7 @@ describe('resolveIngestItems (pre-read validation)', () => {
stat: async () => (statCalls++, { size: 200 }),
maxBytes: 100,
}),
/超出大小限制/,
/attachment_ingest:item_too_large/,
);
assert.equal(statCalls, 1);
});
Expand All @@ -120,7 +120,7 @@ describe('resolveIngestItems (pre-read validation)', () => {
stat: async () => (statCalls++, { size: 1 }),
maxBytes: 100,
}),
/超出大小限制/,
/attachment_ingest:item_too_large/,
);
assert.equal(statCalls, 0);
assert.equal(decodeCalls, 0, 'must reject by base64 string length before Buffer.from');
Expand Down Expand Up @@ -148,7 +148,7 @@ describe('resolveIngestItems (pre-read validation)', () => {
approvals,
stat: async () => ({ size: 10 }),
}),
/过期|无效/,
/attachment_ingest:(source_expired|items_invalid)/,
);
});

Expand Down Expand Up @@ -184,7 +184,7 @@ describe('resolveIngestItems (pre-read validation)', () => {
approvals,
stat: async () => (statCalls++, { size: 10 }),
}),
/无效/,
/attachment_ingest:items_invalid/,
);
assert.notEqual(
approvals.consumeApproval(1, issued.approvalId),
Expand All @@ -207,7 +207,7 @@ describe('resolveIngestItems (pre-read validation)', () => {
approvals,
stat: async () => (statCalls++, { size: 10 }),
}),
/重复/,
/attachment_ingest:duplicate_source/,
);
assert.notEqual(
approvals.consumeApproval(1, issued.approvalId),
Expand All @@ -226,7 +226,7 @@ describe('resolveIngestItems (pre-read validation)', () => {
approvals,
stat: async () => ({ size: 1 }),
}),
/无效/,
/attachment_ingest:items_invalid/,
);
await assert.rejects(
() =>
Expand All @@ -236,7 +236,7 @@ describe('resolveIngestItems (pre-read validation)', () => {
approvals,
stat: async () => ({ size: 1 }),
}),
/无效/,
/attachment_ingest:items_invalid/,
);
});
});
Expand Down Expand Up @@ -420,7 +420,7 @@ describe('resolveAttachmentRefs', () => {
throw new Error('snapshot must not run');
},
}),
/超出大小限制/,
/attachment_ingest:item_too_large/,
);
assert.equal(snapshots, 0);
} finally {
Expand Down
Loading