@project-ava-supernova/core 0.2.82 → 0.2.84
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/agent/system-prompt.d.ts +11 -1
- package/dist/agent/system-prompt.d.ts.map +1 -1
- package/dist/agent/system-prompt.js +27 -1
- package/dist/agent/system-prompt.js.map +1 -1
- package/dist/audit/cost.d.ts.map +1 -1
- package/dist/audit/cost.js +1 -0
- package/dist/audit/cost.js.map +1 -1
- package/dist/auto/coordinator-model.d.ts.map +1 -1
- package/dist/auto/coordinator-model.js +15 -3
- package/dist/auto/coordinator-model.js.map +1 -1
- package/dist/auto/intent-gate.d.ts.map +1 -1
- package/dist/auto/intent-gate.js +6 -1
- package/dist/auto/intent-gate.js.map +1 -1
- package/dist/auto/longxiang-router.d.ts +25 -8
- package/dist/auto/longxiang-router.d.ts.map +1 -1
- package/dist/auto/longxiang-router.js +33 -16
- package/dist/auto/longxiang-router.js.map +1 -1
- package/dist/auto/supernova-router.d.ts +31 -11
- package/dist/auto/supernova-router.d.ts.map +1 -1
- package/dist/auto/supernova-router.js +45 -22
- package/dist/auto/supernova-router.js.map +1 -1
- package/dist/billing/credits.d.ts.map +1 -1
- package/dist/billing/credits.js +19 -0
- package/dist/billing/credits.js.map +1 -1
- package/dist/docs/content/concepts.d.ts.map +1 -1
- package/dist/docs/content/concepts.js +17 -16
- package/dist/docs/content/concepts.js.map +1 -1
- package/dist/docs/data/providers.d.ts.map +1 -1
- package/dist/docs/data/providers.js +16 -10
- package/dist/docs/data/providers.js.map +1 -1
- package/dist/health/equipment.d.ts +71 -0
- package/dist/health/equipment.d.ts.map +1 -0
- package/dist/health/equipment.js +207 -0
- package/dist/health/equipment.js.map +1 -0
- package/dist/health/profile-fields.d.ts +16 -0
- package/dist/health/profile-fields.d.ts.map +1 -1
- package/dist/health/profile-fields.js +44 -16
- package/dist/health/profile-fields.js.map +1 -1
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +15 -2
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +15 -2
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +8 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +15 -2
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +15 -2
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +15 -2
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +15 -2
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/id.d.ts.map +1 -1
- package/dist/i18n/locales/id.js +15 -2
- package/dist/i18n/locales/id.js.map +1 -1
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +15 -2
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +15 -2
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/ko.d.ts.map +1 -1
- package/dist/i18n/locales/ko.js +14 -1
- package/dist/i18n/locales/ko.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +15 -2
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +15 -2
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +15 -2
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +15 -2
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/th.d.ts.map +1 -1
- package/dist/i18n/locales/th.js +15 -2
- package/dist/i18n/locales/th.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +15 -2
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/uk.d.ts.map +1 -1
- package/dist/i18n/locales/uk.js +15 -2
- package/dist/i18n/locales/uk.js.map +1 -1
- package/dist/i18n/locales/vi.d.ts.map +1 -1
- package/dist/i18n/locales/vi.js +15 -2
- package/dist/i18n/locales/vi.js.map +1 -1
- package/dist/i18n/locales/zh-CN.d.ts.map +1 -1
- package/dist/i18n/locales/zh-CN.js +15 -2
- package/dist/i18n/locales/zh-CN.js.map +1 -1
- package/dist/i18n/locales/zh-TW.d.ts.map +1 -1
- package/dist/i18n/locales/zh-TW.js +15 -2
- package/dist/i18n/locales/zh-TW.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/memory/ambient-capture.d.ts +11 -0
- package/dist/memory/ambient-capture.d.ts.map +1 -1
- package/dist/memory/ambient-capture.js +61 -0
- package/dist/memory/ambient-capture.js.map +1 -1
- package/dist/memory/memory-agent.d.ts.map +1 -1
- package/dist/memory/memory-agent.js +21 -3
- package/dist/memory/memory-agent.js.map +1 -1
- package/dist/memory/types.d.ts +12 -0
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/memory/types.js.map +1 -1
- package/dist/providers/deepseek/models.js +1 -1
- package/dist/providers/deepseek/models.js.map +1 -1
- package/dist/providers/platform/models.d.ts.map +1 -1
- package/dist/providers/platform/models.js +28 -1
- package/dist/providers/platform/models.js.map +1 -1
- package/dist/providers/qwen/models.d.ts.map +1 -1
- package/dist/providers/qwen/models.js +27 -0
- package/dist/providers/qwen/models.js.map +1 -1
- package/dist/tools/authoring/image-formats.d.ts +46 -0
- package/dist/tools/authoring/image-formats.d.ts.map +1 -0
- package/dist/tools/authoring/image-formats.js +89 -0
- package/dist/tools/authoring/image-formats.js.map +1 -0
- package/package.json +7 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which formats a Library image can be downloaded as — and nothing else.
|
|
3
|
+
*
|
|
4
|
+
* Dependency-free on purpose, for the same reason export-formats.ts is: this
|
|
5
|
+
* answer is needed by two webview bundles (no Node, no DOM at import time) and
|
|
6
|
+
* pinned by a test in core. The transcode that actually MAKES a PNG or JPG
|
|
7
|
+
* needs a canvas, so it lives in each surface; the decision of what to offer
|
|
8
|
+
* lives here, once.
|
|
9
|
+
*
|
|
10
|
+
* The Studio saves what the image model returns, which is WebP, and the store
|
|
11
|
+
* is deliberately honest about it (a .webp is a .webp, never a mislabelled
|
|
12
|
+
* .jpg). So "download" gave you WebP and nothing else. People want PNG for
|
|
13
|
+
* anything with transparency and JPG for a photo going somewhere size matters,
|
|
14
|
+
* and neither exists on disk — they are made from the pixels.
|
|
15
|
+
*
|
|
16
|
+
* SVG is the one format that is NOT made, and on purpose. SVG is vector.
|
|
17
|
+
* Logos and flat Library icons already ARE SVG — the engine composes exact
|
|
18
|
+
* geometry — so for those the SVG download is the real file. A generated
|
|
19
|
+
* finish (glass, clay, metal) or a key-art frame is raster, and there is no
|
|
20
|
+
* honest SVG of a photograph: wrapping the bitmap in an <svg> tag is a PNG in
|
|
21
|
+
* a costume, and auto-tracing turns it into a posterised blob. So SVG is
|
|
22
|
+
* offered when the source is vector, and not otherwise. That is what the
|
|
23
|
+
* formats are, not a limit of ours.
|
|
24
|
+
*/
|
|
25
|
+
const VECTOR_EXT = /\.svg$/i;
|
|
26
|
+
/** The path part of a URL, a data: URL's type, or the string itself. */
|
|
27
|
+
function pathOf(src) {
|
|
28
|
+
if (src.startsWith('data:'))
|
|
29
|
+
return '';
|
|
30
|
+
try {
|
|
31
|
+
return new URL(src, 'http://x').pathname;
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return src;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** True when the asset's bytes are SVG — by extension, or by a declared type. */
|
|
38
|
+
export function isVectorSource(src, mime) {
|
|
39
|
+
if (mime && /svg/i.test(mime))
|
|
40
|
+
return true;
|
|
41
|
+
if (!src)
|
|
42
|
+
return false;
|
|
43
|
+
if (src.startsWith('data:image/svg'))
|
|
44
|
+
return true;
|
|
45
|
+
return VECTOR_EXT.test(pathOf(src));
|
|
46
|
+
}
|
|
47
|
+
/** The extension the ORIGINAL bytes carry, so "Original" keeps it. */
|
|
48
|
+
export function originalExt(src, fallback = 'webp') {
|
|
49
|
+
if (!src)
|
|
50
|
+
return fallback;
|
|
51
|
+
if (src.startsWith('data:')) {
|
|
52
|
+
const m = src.match(/^data:image\/([a-z0-9+.-]+)/i);
|
|
53
|
+
if (!m)
|
|
54
|
+
return fallback;
|
|
55
|
+
const t = m[1].toLowerCase();
|
|
56
|
+
return t === 'jpeg' ? 'jpg' : t === 'svg+xml' ? 'svg' : t;
|
|
57
|
+
}
|
|
58
|
+
const m = pathOf(src).match(/\.([a-z0-9]+)$/i);
|
|
59
|
+
return m ? m[1].toLowerCase() : fallback;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Which downloads to offer for an image.
|
|
63
|
+
* vector → SVG (the original) · PNG · JPG
|
|
64
|
+
* raster → Original (as saved) · PNG · JPG (the original's own format is
|
|
65
|
+
* not offered twice: a PNG source gets Original (PNG) and JPG)
|
|
66
|
+
* Non-image kinds get Original alone, from the caller.
|
|
67
|
+
*/
|
|
68
|
+
export function imageExportOptions(src, mime) {
|
|
69
|
+
if (isVectorSource(src, mime)) {
|
|
70
|
+
return [
|
|
71
|
+
{ format: 'svg', label: 'SVG', ext: 'svg' },
|
|
72
|
+
{ format: 'png', label: 'PNG', ext: 'png' },
|
|
73
|
+
{ format: 'jpg', label: 'JPG', ext: 'jpg' },
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
const ext = originalExt(src);
|
|
77
|
+
const opts = [{ format: 'original', label: `Original (${ext.toUpperCase()})`, ext }];
|
|
78
|
+
if (ext !== 'png')
|
|
79
|
+
opts.push({ format: 'png', label: 'PNG', ext: 'png' });
|
|
80
|
+
if (ext !== 'jpg' && ext !== 'jpeg')
|
|
81
|
+
opts.push({ format: 'jpg', label: 'JPG', ext: 'jpg' });
|
|
82
|
+
return opts;
|
|
83
|
+
}
|
|
84
|
+
/** Swap the extension on a filename, keeping the stem. */
|
|
85
|
+
export function withExt(filename, ext) {
|
|
86
|
+
const stem = filename.replace(/\.[a-z0-9]+$/i, '');
|
|
87
|
+
return `${stem || 'download'}.${ext}`;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=image-formats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-formats.js","sourceRoot":"","sources":["../../../src/tools/authoring/image-formats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAWH,MAAM,UAAU,GAAG,SAAS,CAAC;AAE7B,wEAAwE;AACxE,SAAS,MAAM,CAAC,GAAW;IACzB,IAAI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC;IACvC,IAAI,CAAC;QAAC,OAAO,IAAI,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,GAAG,CAAC;IAAC,CAAC;AACzE,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,cAAc,CAAC,GAAuB,EAAE,IAAoB;IAC1E,IAAI,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3C,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,IAAI,GAAG,CAAC,UAAU,CAAC,gBAAgB,CAAC;QAAE,OAAO,IAAI,CAAC;IACl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AAC;IACJ,CAAC;IACD,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC7B,MAAM,IAAI,GAAwB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,GAAG,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IAC1G,IAAI,GAAG,KAAK,KAAK;QAAE,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1E,IAAI,GAAG,KAAK,KAAK,IAAI,GAAG,KAAK,MAAM;QAAE,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5F,OAAO,IAAI,CAAC;AACd,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,OAAO,CAAC,QAAgB,EAAE,GAAW;IACnD,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;IACnD,OAAO,GAAG,IAAI,IAAI,UAAU,IAAI,GAAG,EAAE,CAAC;AACxC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@project-ava-supernova/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.84",
|
|
4
4
|
"description": "Core engine for Ava Supernova — agent, providers, tools, config",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -173,6 +173,11 @@
|
|
|
173
173
|
"require": "./dist/tools/authoring/export-formats.js",
|
|
174
174
|
"types": "./dist/tools/authoring/export-formats.d.ts"
|
|
175
175
|
},
|
|
176
|
+
"./authoring/image-formats": {
|
|
177
|
+
"import": "./dist/tools/authoring/image-formats.js",
|
|
178
|
+
"require": "./dist/tools/authoring/image-formats.js",
|
|
179
|
+
"types": "./dist/tools/authoring/image-formats.d.ts"
|
|
180
|
+
},
|
|
176
181
|
"./authoring": {
|
|
177
182
|
"import": "./dist/tools/authoring/index.js",
|
|
178
183
|
"require": "./dist/tools/authoring/index.js",
|
|
@@ -187,6 +192,7 @@
|
|
|
187
192
|
"scripts": {
|
|
188
193
|
"build": "tsc -p tsconfig.build.json",
|
|
189
194
|
"dev": "tsc -p tsconfig.build.json --watch",
|
|
195
|
+
"equipment:check": "node scripts/equipment-check.mjs",
|
|
190
196
|
"publish:public": "node scripts/publish-public.mjs",
|
|
191
197
|
"publish:public:dry": "node scripts/publish-public.mjs --dry-run",
|
|
192
198
|
"typecheck": "tsc --noEmit",
|