@design.estate/dees-catalog 21.41.1 → 21.42.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_bundle/bundle.js +62 -35
- package/dist_bundle/bundle.js.map +1 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-6S3PVK6Y.js → chunk-72W55DOJ.js} +3 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-6S3PVK6Y.js.map → chunk-72W55DOJ.js.map} +1 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-OUB3OAV2.js → chunk-GTAAYRP5.js} +2 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-DGKFXX4X.js → chunk-PAFNUCDL.js} +3 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{de-2ALUFQHJ.js → de-CQ56NZVB.js} +3 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{de-2ALUFQHJ.js.map → de-CQ56NZVB.js.map} +1 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-CDXSOKKD.js → dees-modal-JNRW3HIY.js} +3 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-46JECUZO.js → dees-workspace-terminal-Y532Z546.js} +4 -4
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/00group-harness/dees-harness-chat/dees-harness-chat.d.ts +2 -0
- package/dist_ts_web/elements/00group-harness/dees-harness-chat/dees-harness-chat.js +12 -2
- package/dist_ts_web/elements/00group-harness/dees-harness-composer/dees-harness-composer.d.ts +8 -1
- package/dist_ts_web/elements/00group-harness/dees-harness-composer/dees-harness-composer.js +25 -4
- package/dist_ts_web/elements/00group-harness/harness.helpers.d.ts +6 -0
- package/dist_ts_web/elements/00group-harness/harness.helpers.js +22 -1
- package/dist_ts_web/i18n/de.d.ts +4 -0
- package/dist_ts_web/i18n/de.js +2 -1
- package/dist_ts_web/i18n/messages.d.ts +4 -0
- package/dist_ts_web/i18n/messages.js +2 -1
- package/package.json +1 -1
- package/readme.md +1 -1
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/00group-harness/dees-harness-chat/dees-harness-chat.ts +5 -0
- package/ts_web/elements/00group-harness/dees-harness-composer/dees-harness-composer.ts +18 -1
- package/ts_web/elements/00group-harness/harness.helpers.ts +18 -0
- package/ts_web/i18n/de.ts +1 -0
- package/ts_web/i18n/messages.ts +1 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-OUB3OAV2.js.map → chunk-GTAAYRP5.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-DGKFXX4X.js.map → chunk-PAFNUCDL.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-CDXSOKKD.js.map → dees-modal-JNRW3HIY.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-46JECUZO.js.map → dees-workspace-terminal-Y532Z546.js.map} +0 -0
|
@@ -272,6 +272,10 @@ export class DeesHarnessChat extends DeesElement {
|
|
|
272
272
|
@property({ type: Number, reflect: true })
|
|
273
273
|
accessor maxTotalAttachmentBytes: number = harnessMaxTotalAttachmentBytes;
|
|
274
274
|
|
|
275
|
+
/** The files the host takes, as an `accept` list; forwarded to the composer. */
|
|
276
|
+
@property({ type: String, reflect: true })
|
|
277
|
+
accessor attachmentAccept: string = '';
|
|
278
|
+
|
|
275
279
|
@property({ reflect: true })
|
|
276
280
|
accessor account: string = '';
|
|
277
281
|
|
|
@@ -910,6 +914,7 @@ export class DeesHarnessChat extends DeesElement {
|
|
|
910
914
|
.maxAttachmentCount=${this.maxAttachmentCount}
|
|
911
915
|
.maxAttachmentBytes=${this.maxAttachmentBytes}
|
|
912
916
|
.maxTotalAttachmentBytes=${this.maxTotalAttachmentBytes}
|
|
917
|
+
.attachmentAccept=${this.attachmentAccept}
|
|
913
918
|
.disabled=${this.disabled}
|
|
914
919
|
.inputLocked=${this.inputLocked}
|
|
915
920
|
.busy=${this.busy || this.status.type === 'busy'}
|
|
@@ -29,6 +29,7 @@ import type {
|
|
|
29
29
|
THarnessComposerDelivery,
|
|
30
30
|
} from '../interfaces.js';
|
|
31
31
|
import {
|
|
32
|
+
harnessFileMatchesAccept,
|
|
32
33
|
harnessFileToBase64,
|
|
33
34
|
harnessFormatBytes,
|
|
34
35
|
harnessAttachmentKindFor,
|
|
@@ -145,7 +146,7 @@ const deliveryHintKeys = {
|
|
|
145
146
|
|
|
146
147
|
/**
|
|
147
148
|
* Prompt composer: autogrow textarea, attachments (picker / paste /
|
|
148
|
-
* drag-drop with per-file and total size limits), optional account, model,
|
|
149
|
+
* drag-drop with accepted types and per-file and total size limits), optional account, model,
|
|
149
150
|
* and reasoning-effort dropdowns. Cmd/Ctrl+Enter sends. While busy, Stop is an
|
|
150
151
|
* additional button and the main action delivers the draft the way the host supports
|
|
151
152
|
* (`busyDeliveryModes`): Steer (read at the next step) when it can, else Send (read after this
|
|
@@ -302,6 +303,15 @@ export class DeesHarnessComposer extends DeesElement {
|
|
|
302
303
|
@property({ type: Number, reflect: true })
|
|
303
304
|
accessor maxAttachmentCount: number = Number.POSITIVE_INFINITY;
|
|
304
305
|
|
|
306
|
+
/**
|
|
307
|
+
* The files the host takes, as an `<input type="file">` `accept` list: extensions (`.pdf`),
|
|
308
|
+
* media types (`application/pdf`) and families (`image/*`). The picker offers those, and a
|
|
309
|
+
* picked, pasted or dropped file of another type is refused with `harness-attachment-error`.
|
|
310
|
+
* Empty takes every file.
|
|
311
|
+
*/
|
|
312
|
+
@property({ type: String, reflect: true })
|
|
313
|
+
accessor attachmentAccept: string = '';
|
|
314
|
+
|
|
305
315
|
@property({ reflect: true })
|
|
306
316
|
accessor account: string = '';
|
|
307
317
|
|
|
@@ -777,6 +787,7 @@ export class DeesHarnessComposer extends DeesElement {
|
|
|
777
787
|
class="fileInput"
|
|
778
788
|
type="file"
|
|
779
789
|
multiple
|
|
790
|
+
accept=${this.attachmentAccept}
|
|
780
791
|
?disabled=${this.interactionLocked}
|
|
781
792
|
@change=${this.handleFileInputChange}
|
|
782
793
|
/>` : ''}
|
|
@@ -1412,6 +1423,12 @@ export class DeesHarnessComposer extends DeesElement {
|
|
|
1412
1423
|
break;
|
|
1413
1424
|
}
|
|
1414
1425
|
const mediaType = harnessMediaTypeForFile(file);
|
|
1426
|
+
if (!harnessFileMatchesAccept(this.attachmentAccept, file, mediaType)) {
|
|
1427
|
+
this.emit('harness-attachment-error', {
|
|
1428
|
+
message: this.t('composer.typeRefused', { name: file.name || this.t('harness.file') }),
|
|
1429
|
+
});
|
|
1430
|
+
continue;
|
|
1431
|
+
}
|
|
1415
1432
|
if (file.size > this.maxAttachmentBytes) {
|
|
1416
1433
|
this.emit('harness-attachment-error', {
|
|
1417
1434
|
message: this.t('composer.tooLarge', { name: file.name || this.t('harness.file'), size: harnessFormatBytes(this.maxAttachmentBytes, this.t.format) }),
|
|
@@ -261,6 +261,24 @@ export const harnessMediaTypeForFile = (file: File): string => {
|
|
|
261
261
|
return byExtension || file.type || 'application/octet-stream';
|
|
262
262
|
};
|
|
263
263
|
|
|
264
|
+
/**
|
|
265
|
+
* Whether a file is one an `accept` list in the syntax of `<input type="file">` names: an
|
|
266
|
+
* extension (`.pdf`) by the file's name, a media type (`application/pdf`) or a family (`image/*`)
|
|
267
|
+
* by the type the composer sends or the browser's own. An empty list takes every file.
|
|
268
|
+
*/
|
|
269
|
+
export const harnessFileMatchesAccept = (accept: string, file: File, mediaType: string): boolean => {
|
|
270
|
+
const tokens = accept.split(',').map((token) => token.trim().toLowerCase()).filter(Boolean);
|
|
271
|
+
if (!tokens.length) return true;
|
|
272
|
+
const name = file.name.toLowerCase();
|
|
273
|
+
const types = [mediaType, file.type].map((type) => type.toLowerCase()).filter(Boolean);
|
|
274
|
+
return tokens.some((token) => {
|
|
275
|
+
if (token.startsWith('.')) return name.endsWith(token);
|
|
276
|
+
if (token === '*/*') return true;
|
|
277
|
+
if (token.endsWith('/*')) return types.some((type) => type.startsWith(token.slice(0, -1)));
|
|
278
|
+
return types.includes(token);
|
|
279
|
+
});
|
|
280
|
+
};
|
|
281
|
+
|
|
264
282
|
export const harnessIsSupportedAttachmentType = (mediaType: string): boolean => {
|
|
265
283
|
return (
|
|
266
284
|
harnessSupportedImageTypes.has(mediaType)
|
package/ts_web/i18n/de.ts
CHANGED
|
@@ -1261,6 +1261,7 @@ export default dcMessages.translation('de', {
|
|
|
1261
1261
|
'composer.tooMany': 'Es sind höchstens {count, number} Anhänge erlaubt.',
|
|
1262
1262
|
'composer.tooLarge': '{name} ist zu groß. Pro Anhang sind höchstens {size} erlaubt.',
|
|
1263
1263
|
'composer.totalLimit': 'Die Anhänge überschreiten die Gesamtgrenze von {size}.',
|
|
1264
|
+
'composer.typeRefused': '{name} kann hier nicht angehängt werden: Dieser Dateityp wird nicht angenommen.',
|
|
1264
1265
|
'message.role': '{role, select, user {Benutzer} assistant {Assistent} system {System} tool {Werkzeug} other {Nachricht}}',
|
|
1265
1266
|
'message.truncated': 'gekürzt',
|
|
1266
1267
|
'message.pendingSteering': 'Steuert · wird beim nächsten Schritt gelesen',
|
package/ts_web/i18n/messages.ts
CHANGED
|
@@ -1319,6 +1319,7 @@ export const dcMessages = plugins.smarti18n.defineCatalog({
|
|
|
1319
1319
|
'composer.tooMany': { message: 'A maximum of {count, number} attachments is allowed.', description: 'Said when more files are attached than allowed.' },
|
|
1320
1320
|
'composer.tooLarge': { message: '{name} is too large. Max per attachment is {size}.', description: 'Said when a file is larger than allowed; {size} is the limit.' },
|
|
1321
1321
|
'composer.totalLimit': { message: 'Attachments exceed the {size} total limit.', description: 'Said when the attachments together are larger than allowed.' },
|
|
1322
|
+
'composer.typeRefused': { message: '{name} cannot be attached here: its file type is not accepted.', description: 'Said when a file is of a type the host does not take; {name} is the file name.' },
|
|
1322
1323
|
|
|
1323
1324
|
// dees-harness-message
|
|
1324
1325
|
'message.role': { message: '{role, select, user {user} assistant {assistant} system {system} tool {tool} other {message}}', description: 'A message\'s role label.' },
|
/package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-OUB3OAV2.js.map → chunk-GTAAYRP5.js.map}
RENAMED
|
File without changes
|
/package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-DGKFXX4X.js.map → chunk-PAFNUCDL.js.map}
RENAMED
|
File without changes
|
|
File without changes
|