@nimiplatform/app-tools 0.14.0 → 0.16.0-rc.9
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/README.md +48 -5
- package/bin/nimi-app.mjs +26 -10
- package/lib/app-access-declaration.mjs +3 -0
- package/lib/app-dependency-combinations.mjs +70 -24
- package/lib/app-doctor-update.mjs +92 -36
- package/lib/app-host-support.mjs +6 -0
- package/lib/app-identifiers.mjs +27 -0
- package/lib/app-lifecycle-guidance.mjs +1 -1
- package/lib/app-pack.mjs +14 -36
- package/lib/app-project-lifecycle.mjs +141 -243
- package/lib/app-scaffold-capabilities.mjs +13 -109
- package/lib/app-scaffold-profiles.mjs +81 -115
- package/lib/app-scaffold.mjs +68 -164
- package/lib/app-toolchain-updates.mjs +45 -0
- package/lib/canonical-capability-ids.generated.mjs +2 -0
- package/lib/development-environment.d.mts +10 -0
- package/lib/development-environment.mjs +39 -0
- package/lib/hosted-web-release.mjs +98 -0
- package/lib/index.mjs +40 -1
- package/lib/mobile-development.mjs +19 -0
- package/lib/realm-environments.generated.mjs +5 -0
- package/lib/web-coordination.mjs +59 -0
- package/lib/web-development.d.mts +23 -0
- package/lib/web-development.mjs +118 -0
- package/lib/web-scaffold.mjs +125 -0
- package/package.json +32 -21
- package/scripts/dev-shell.mjs +4 -1
- package/scripts/sync-scaffold-versions.mjs +0 -2
- package/skills/nimi-app-lifecycle/SKILL.md +3 -1
- package/skills/nimi-app-lifecycle/references/acceptance.md +6 -2
- package/skills/nimi-app-lifecycle/references/adapt.md +5 -3
- package/skills/nimi-app-lifecycle/references/audit.md +3 -2
- package/skills/nimi-app-lifecycle/references/create.md +6 -2
- package/skills/nimi-app-lifecycle/references/upgrade-platform.md +12 -7
- package/templates/app-source/src/ai-studio-core/ai-studio-core.css +87 -52
- package/templates/app-source/src/ai-studio-core/history-policy.ts +45 -11
- package/templates/app-source/src/ai-studio-core/history.ts +22 -11
- package/templates/app-source/src/ai-studio-core/host-context.tsx +9 -4
- package/templates/app-source/src/ai-studio-core/index.ts +2 -0
- package/templates/app-source/src/ai-studio-core/job-recovery-panel.tsx +15 -5
- package/templates/app-source/src/ai-studio-core/job-recovery.ts +2 -2
- package/templates/app-source/src/ai-studio-core/messages/en.json +73 -19
- package/templates/app-source/src/ai-studio-core/messages/zh.json +73 -19
- package/templates/app-source/src/ai-studio-core/module-registration.ts +1 -0
- package/templates/app-source/src/ai-studio-core/non-success-presentation.ts +30 -5
- package/templates/app-source/src/ai-studio-core/parameter-fields.tsx +12 -6
- package/templates/app-source/src/ai-studio-core/parameters.ts +4 -0
- package/templates/app-source/src/ai-studio-core/prompt-drafts.ts +42 -0
- package/templates/app-source/src/ai-studio-core/runtime-types.ts +9 -2
- package/templates/app-source/src/ai-studio-core/runtime.ts +8 -4
- package/templates/app-source/src/ai-studio-core/section-ai-testing-composer.tsx +98 -90
- package/templates/app-source/src/ai-studio-core/section-ai-testing-exchange-result.tsx +1 -1
- package/templates/app-source/src/ai-studio-core/section-ai-testing-history.tsx +205 -48
- package/templates/app-source/src/ai-studio-core/section-ai-testing-input.ts +1 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing-output.tsx +36 -14
- package/templates/app-source/src/ai-studio-core/section-ai-testing-result.tsx +96 -75
- package/templates/app-source/src/ai-studio-core/section-ai-testing-run.ts +59 -16
- package/templates/app-source/src/ai-studio-core/section-ai-testing-session-result.tsx +2 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing-studio-result.tsx +12 -21
- package/templates/app-source/src/ai-studio-core/section-ai-testing-transcription-result.tsx +2 -2
- package/templates/app-source/src/ai-studio-core/section-ai-testing-vision-result.tsx +3 -3
- package/templates/app-source/src/ai-studio-core/section-ai-testing.tsx +158 -76
- package/templates/app-source/src/ai-studio-core/workspace.tsx +49 -22
- package/templates/app-source/src/product-modules/agent-center/index.tsx +2 -3
- package/templates/app-source/src/product-modules/agent-conversation/index.tsx +2 -3
- package/templates/app-source/src/studio-modules/studio-create/messages/en.json +12 -3
- package/templates/app-source/src/studio-modules/studio-create/messages/zh.json +12 -3
- package/templates/app-source/src/studio-modules/studio-create/parameter-panel.tsx +11 -2
- package/templates/app-source/src/studio-modules/studio-create/parameters.ts +2 -1
- package/templates/app-source/src/studio-modules/studio-create/runtime.ts +47 -5
- package/templates/app-source/src/studio-modules/studio-media/messages/en.json +59 -8
- package/templates/app-source/src/studio-modules/studio-media/messages/zh.json +59 -8
- package/templates/app-source/src/studio-modules/studio-media/music-parameters.tsx +2 -1
- package/templates/app-source/src/studio-modules/studio-media/parameter-panel.tsx +271 -83
- package/templates/app-source/src/studio-modules/studio-media/parameters.ts +120 -2
- package/templates/app-source/src/studio-modules/studio-media/registration.ts +1 -0
- package/templates/app-source/src/studio-modules/studio-media/runtime.ts +24 -14
- package/templates/app-source/src/studio-modules/studio-voice/descriptors.ts +1 -1
- package/templates/app-source/src/studio-modules/studio-voice/messages/en.json +3 -2
- package/templates/app-source/src/studio-modules/studio-voice/messages/zh.json +3 -2
- package/templates/app-source/src/studio-modules/studio-voice/parameter-panel.tsx +46 -23
- package/templates/app-source/src/studio-modules/studio-voice/registration.ts +2 -1
- package/templates/app-source/src/studio-modules/studio-voice/runtime.ts +2 -2
- package/templates/app-source/src/workbench-core/workbench-core.tsx +27 -3
- package/templates/default-starter/AGENTS.md +3 -3
- package/templates/default-starter/README.md +1 -1
- package/templates/default-starter/src/shell/App.tsx +6 -18
- package/templates/default-starter/src/shell/auth/local-app-client.ts +6 -15
- package/templates/default-starter/src/shell/auth/runtime-platform.ts +7 -107
- package/templates/default-starter/src/shell/workbench-target-adapter.ts +9 -126
- package/templates/default-starter.manifest.json +0 -16
- package/templates/hosted-web-release.yml +88 -0
- package/templates/default-starter/src-tauri/Cargo.toml +0 -17
- package/templates/default-starter/src-tauri/build.rs +0 -32
- package/templates/default-starter/src-tauri/capabilities/default.json +0 -7
- package/templates/default-starter/src-tauri/tauri.conf.json +0 -26
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import type { NimiLocalAppClient } from '@nimiplatform/sdk/app';
|
|
1
|
+
import { useMemo, type ComponentProps } from 'react';
|
|
3
2
|
import {
|
|
4
3
|
AppAgentCenterEntry,
|
|
5
4
|
createAgentCenterShellHostMechanics,
|
|
@@ -11,7 +10,7 @@ import {
|
|
|
11
10
|
|
|
12
11
|
// @nimi-authority: rule.nimi.platform.app-ecosystem.p-scaf-019c
|
|
13
12
|
// @nimi-authority: rule.nimi.platform.app-ecosystem.p-agid-014a
|
|
14
|
-
export function AgentCenterCapability(props: { readonly client:
|
|
13
|
+
export function AgentCenterCapability(props: { readonly client: ComponentProps<typeof AppAgentCenterEntry>['client'] }) {
|
|
15
14
|
const hostMechanics = useMemo(() => (
|
|
16
15
|
hasElectronInvoke()
|
|
17
16
|
? createAgentCenterShellHostMechanics(createAgentCenterShellBridge())
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import type { NimiLocalAppClient } from '@nimiplatform/sdk/app';
|
|
1
|
+
import { useMemo, type ComponentProps } from 'react';
|
|
3
2
|
import {
|
|
4
3
|
AppConversationEntry,
|
|
5
4
|
createBrowserAppConversationHostPort,
|
|
@@ -7,7 +6,7 @@ import {
|
|
|
7
6
|
|
|
8
7
|
// @nimi-authority: rule.nimi.platform.app-ecosystem.p-scaf-019c
|
|
9
8
|
// @nimi-authority: rule.nimi.runtime.agent-participation.r093
|
|
10
|
-
export function AgentConversationCapability(props: { readonly client:
|
|
9
|
+
export function AgentConversationCapability(props: { readonly client: ComponentProps<typeof AppConversationEntry>['client'] }) {
|
|
11
10
|
const hostPort = useMemo(() => createBrowserAppConversationHostPort(), []);
|
|
12
11
|
return (
|
|
13
12
|
<AppConversationEntry
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"stopPlaceholder": "One stop sequence per line",
|
|
61
61
|
"embeddingInput": "Embedding input {{index}}",
|
|
62
62
|
"embeddingInputPlaceholder": "Text to embed",
|
|
63
|
-
"embeddingDimensionsHint": "Leave blank for the model's default width. Runtime rejects
|
|
63
|
+
"embeddingDimensionsHint": "Leave blank for the model's default width. Runtime rejects a width the selected model does not support.",
|
|
64
64
|
"embeddingPurposeDefault": "Unspecified",
|
|
65
65
|
"embeddingPurposeDocument": "Content to search",
|
|
66
66
|
"embeddingPurposeQuery": "Search query",
|
|
@@ -77,8 +77,17 @@
|
|
|
77
77
|
"topK": "Top K",
|
|
78
78
|
"presencePenalty": "Presence penalty",
|
|
79
79
|
"frequencyPenalty": "Frequency penalty",
|
|
80
|
-
"stop": "Stop sequences"
|
|
81
|
-
|
|
80
|
+
"stop": "Stop sequences",
|
|
81
|
+
"retrievalQuery": "Retrieval comparison query (optional)"
|
|
82
|
+
},
|
|
83
|
+
"embeddingRetrievalHint": "When filled, embed the inputs as documents, then embed this query and rank by cosine similarity. Both document and query embeddings may incur cloud usage. Leave empty to embed inputs only."
|
|
84
|
+
},
|
|
85
|
+
"embeddingRetrieval": {
|
|
86
|
+
"title": "Retrieval ranking",
|
|
87
|
+
"match": "Rank {{rank}} · Input {{input}} · Similarity {{score}}",
|
|
88
|
+
"hint": "Similarity compares this set of documents. It is not a probability or a general quality score.",
|
|
89
|
+
"spaceChanged": "Documents and query returned different embedding spaces. No comparison was made; use the same model configuration for both calls.",
|
|
90
|
+
"invalidVectors": "Document or query vectors cannot form a complete, valid similarity comparison."
|
|
82
91
|
}
|
|
83
92
|
}
|
|
84
93
|
}
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"stopPlaceholder": "每行一个停止序列",
|
|
61
61
|
"embeddingInput": "嵌入输入 {{index}}",
|
|
62
62
|
"embeddingInputPlaceholder": "要生成嵌入的文本",
|
|
63
|
-
"embeddingDimensionsHint": "
|
|
63
|
+
"embeddingDimensionsHint": "留空使用模型默认维度。当前模型不支持所选维度时,Runtime 会拒绝请求。",
|
|
64
64
|
"embeddingPurposeDefault": "未指定",
|
|
65
65
|
"embeddingPurposeDocument": "待检索内容",
|
|
66
66
|
"embeddingPurposeQuery": "检索问题",
|
|
@@ -77,8 +77,17 @@
|
|
|
77
77
|
"topK": "Top K",
|
|
78
78
|
"presencePenalty": "存在惩罚",
|
|
79
79
|
"frequencyPenalty": "频率惩罚",
|
|
80
|
-
"stop": "停止序列"
|
|
81
|
-
|
|
80
|
+
"stop": "停止序列",
|
|
81
|
+
"retrievalQuery": "检索比较问题(可选)"
|
|
82
|
+
},
|
|
83
|
+
"embeddingRetrievalHint": "填写后,先将输入作为文档生成向量,再为查询生成向量,并按余弦相似度排序。文档与查询都可能产生云端用量;留空则只生成输入向量。"
|
|
84
|
+
},
|
|
85
|
+
"embeddingRetrieval": {
|
|
86
|
+
"title": "检索排序",
|
|
87
|
+
"match": "第 {{rank}} 名 · 输入 {{input}} · 相似度 {{score}}",
|
|
88
|
+
"hint": "相似度仅用于比较这组文档,并非概率或通用质量评分。",
|
|
89
|
+
"spaceChanged": "文档和查询返回了不同向量空间,未进行比较。请确认两次调用使用相同模型配置。",
|
|
90
|
+
"invalidVectors": "文档或查询向量无法进行完整、有效的相似度比较。"
|
|
82
91
|
}
|
|
83
92
|
}
|
|
84
93
|
}
|
|
@@ -91,6 +91,7 @@ function EmbeddingFields(props: StudioParameterPanelProps) {
|
|
|
91
91
|
const translate: StudioParameterTranslate = (key, values) => t(key, values);
|
|
92
92
|
const parameters = props.parameters as StudioEmbeddingParameters;
|
|
93
93
|
const values = parameters.inputs?.length ? parameters.inputs : [''];
|
|
94
|
+
const retrieval = Boolean(parameters.retrievalQuery?.trim());
|
|
94
95
|
const updateValues = (nextValues: string[]) => {
|
|
95
96
|
const next = { ...parameters };
|
|
96
97
|
if (nextValues.length > 1 || nextValues.some((value) => value.trim())) next.inputs = nextValues;
|
|
@@ -131,8 +132,8 @@ function EmbeddingFields(props: StudioParameterPanelProps) {
|
|
|
131
132
|
render: (routeDisabled) => (
|
|
132
133
|
<StudioParameterField label={t('Studio.parameters.fields.embeddingPurpose')}>
|
|
133
134
|
<SelectField
|
|
134
|
-
value={parameters.purpose ?? 'unspecified'}
|
|
135
|
-
disabled={props.disabled || routeDisabled}
|
|
135
|
+
value={retrieval ? 'retrieval-document' : parameters.purpose ?? 'unspecified'}
|
|
136
|
+
disabled={props.disabled || routeDisabled || retrieval}
|
|
136
137
|
onValueChange={(value) => {
|
|
137
138
|
const next = { ...parameters };
|
|
138
139
|
if (value === 'retrieval-document' || value === 'retrieval-query') next.purpose = value;
|
|
@@ -148,6 +149,14 @@ function EmbeddingFields(props: StudioParameterPanelProps) {
|
|
|
148
149
|
<small>{t('Studio.parameters.embeddingPurposeHint')}</small>
|
|
149
150
|
</StudioParameterField>
|
|
150
151
|
),
|
|
152
|
+
}, {
|
|
153
|
+
field: 'retrievalQuery',
|
|
154
|
+
label: t('Studio.parameters.fields.retrievalQuery'),
|
|
155
|
+
render: (routeDisabled) => <StudioParameterField label={t('Studio.parameters.fields.retrievalQuery')}>
|
|
156
|
+
<TextareaField rows={2} value={parameters.retrievalQuery ?? ''} disabled={props.disabled || routeDisabled}
|
|
157
|
+
onChange={(event) => props.onChange({ ...parameters, retrievalQuery: event.currentTarget.value })} />
|
|
158
|
+
<small>{t('Studio.parameters.embeddingRetrievalHint')}</small>
|
|
159
|
+
</StudioParameterField>,
|
|
151
160
|
}, {
|
|
152
161
|
field: 'dimensions',
|
|
153
162
|
label: t('Studio.parameters.fields.dimensions'),
|
|
@@ -21,6 +21,7 @@ export type StudioEmbeddingParameters = {
|
|
|
21
21
|
inputs?: string[];
|
|
22
22
|
dimensions?: number;
|
|
23
23
|
purpose?: 'retrieval-document' | 'retrieval-query';
|
|
24
|
+
retrievalQuery?: string;
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
const TEXT_CANDIDATE_ROUTE_MATRIX = {
|
|
@@ -62,7 +63,7 @@ export const studioChatStreamParameters = defineStudioParameters<StudioTextTurnP
|
|
|
62
63
|
|
|
63
64
|
export const studioTextEmbedParameters = defineStudioParameters<StudioEmbeddingParameters>({
|
|
64
65
|
initial: () => ({}),
|
|
65
|
-
routeMatrix: { inputs: LOCAL_AND_CLOUD_STUDIO_PARAMETER, dimensions: LOCAL_AND_CLOUD_STUDIO_PARAMETER, purpose: LOCAL_AND_CLOUD_STUDIO_PARAMETER },
|
|
66
|
+
routeMatrix: { inputs: LOCAL_AND_CLOUD_STUDIO_PARAMETER, dimensions: LOCAL_AND_CLOUD_STUDIO_PARAMETER, purpose: LOCAL_AND_CLOUD_STUDIO_PARAMETER, retrievalQuery: LOCAL_AND_CLOUD_STUDIO_PARAMETER },
|
|
66
67
|
hasAlternativeInput: (parameters) => nonEmptyEmbeddingInputs(parameters).length > 0,
|
|
67
68
|
});
|
|
68
69
|
|
|
@@ -3,6 +3,7 @@ import type { NimiRuntimeAIScenarioClient } from '@nimiplatform/sdk/ai';
|
|
|
3
3
|
import type { NimiLocalAppTextTurnEvent } from '@nimiplatform/sdk/app';
|
|
4
4
|
import { ExecutionMode, FinishReason, ScenarioType } from '@nimiplatform/sdk/runtime/generated';
|
|
5
5
|
import type { StudioCapabilityRuntimeHandlers } from '../../ai-studio-core/runtime-dispatcher.js';
|
|
6
|
+
import type { StudioEmbeddingRetrieval } from '../../ai-studio-core/runtime-types.js';
|
|
6
7
|
import {
|
|
7
8
|
projectStudioRunnerNonSuccess,
|
|
8
9
|
studioAbortError,
|
|
@@ -191,12 +192,17 @@ async function runTextEmbed(context: StudioCapabilityRuntimeContext) {
|
|
|
191
192
|
parameters,
|
|
192
193
|
);
|
|
193
194
|
if (!context.prompt && embeddingInputs.length === 0) return inputRequired(context);
|
|
195
|
+
const documents = embeddingInputs.length > 0 ? embeddingInputs : [context.prompt];
|
|
196
|
+
const query = parameters?.retrievalQuery?.trim();
|
|
197
|
+
const signal = studioRequestSignal(context);
|
|
198
|
+
if (signal?.aborted) throw studioAbortError();
|
|
194
199
|
const result = await context.host.client.ai.scenario.execute({
|
|
195
200
|
type: 'text-embed',
|
|
196
|
-
inputs:
|
|
201
|
+
inputs: documents,
|
|
197
202
|
...(parameters?.dimensions !== undefined ? { dimensions: parameters.dimensions } : {}),
|
|
198
|
-
...(parameters?.purpose !== undefined ? { purpose: parameters.purpose } : {}),
|
|
199
|
-
});
|
|
203
|
+
...(query ? { purpose: 'retrieval-document' } : parameters?.purpose !== undefined ? { purpose: parameters.purpose } : {}),
|
|
204
|
+
}, { signal });
|
|
205
|
+
if (signal?.aborted) throw studioAbortError();
|
|
200
206
|
if (result.output.type !== 'text-embed') {
|
|
201
207
|
return context.host.nonSuccess(
|
|
202
208
|
context.capability,
|
|
@@ -215,6 +221,41 @@ async function runTextEmbed(context: StudioCapabilityRuntimeContext) {
|
|
|
215
221
|
);
|
|
216
222
|
}
|
|
217
223
|
const first = result.output.vectors[0] ?? [];
|
|
224
|
+
let retrieval: StudioEmbeddingRetrieval | undefined;
|
|
225
|
+
let totalTokens = result.output.usage?.totalTokens;
|
|
226
|
+
let traceId = result.traceId;
|
|
227
|
+
if (query) {
|
|
228
|
+
const queried = await context.host.client.ai.scenario.execute({
|
|
229
|
+
type: 'text-embed', inputs: [query], purpose: 'retrieval-query',
|
|
230
|
+
...(parameters?.dimensions !== undefined ? { dimensions: parameters.dimensions } : {}),
|
|
231
|
+
}, { signal });
|
|
232
|
+
if (signal?.aborted) throw studioAbortError();
|
|
233
|
+
if (queried.output.type !== 'text-embed' || queried.output.spaceId !== spaceId) {
|
|
234
|
+
return context.host.nonSuccess(context.capability, 'runtime-call-failed', context.host.translate('Studio.embeddingRetrieval.spaceChanged'));
|
|
235
|
+
}
|
|
236
|
+
const q = queried.output.vectors[0];
|
|
237
|
+
const qNorm = q ? Math.hypot(...q) : 0;
|
|
238
|
+
if (queried.output.vectors.length !== 1 || !qNorm || result.output.vectors.length !== documents.length) {
|
|
239
|
+
return context.host.nonSuccess(context.capability, 'runtime-call-failed', context.host.translate('Studio.embeddingRetrieval.invalidVectors'));
|
|
240
|
+
}
|
|
241
|
+
const matches: { inputIndex: number; excerpt: string; score: number }[] = [];
|
|
242
|
+
for (const [inputIndex, vector] of result.output.vectors.entries()) {
|
|
243
|
+
const norm = Math.hypot(...vector);
|
|
244
|
+
if (vector.length !== q.length || !norm) {
|
|
245
|
+
return context.host.nonSuccess(context.capability, 'runtime-call-failed', context.host.translate('Studio.embeddingRetrieval.invalidVectors'));
|
|
246
|
+
}
|
|
247
|
+
const score = vector.reduce((sum, value, index) => sum + (value / norm) * (q[index]! / qNorm), 0);
|
|
248
|
+
if (!Number.isFinite(score)) {
|
|
249
|
+
return context.host.nonSuccess(context.capability, 'runtime-call-failed', context.host.translate('Studio.embeddingRetrieval.invalidVectors'));
|
|
250
|
+
}
|
|
251
|
+
matches.push({ inputIndex, excerpt: Array.from(documents[inputIndex]!).slice(0, 300).join(''), score: Math.max(-1, Math.min(1, score)) });
|
|
252
|
+
}
|
|
253
|
+
matches.sort((a, b) => b.score - a.score || a.inputIndex - b.inputIndex);
|
|
254
|
+
retrieval = { query, matches };
|
|
255
|
+
totalTokens = totalTokens !== undefined && queried.output.usage?.totalTokens !== undefined
|
|
256
|
+
? totalTokens + queried.output.usage.totalTokens : undefined;
|
|
257
|
+
traceId = queried.traceId;
|
|
258
|
+
}
|
|
218
259
|
return {
|
|
219
260
|
ok: true as const,
|
|
220
261
|
capabilityId: context.capability.id,
|
|
@@ -226,9 +267,10 @@ async function runTextEmbed(context: StudioCapabilityRuntimeContext) {
|
|
|
226
267
|
dimensions: first.length,
|
|
227
268
|
spaceId,
|
|
228
269
|
sample: [...first.slice(0, 8)],
|
|
229
|
-
...(
|
|
270
|
+
...(totalTokens !== undefined ? { totalTokens } : {}),
|
|
271
|
+
...(retrieval ? { retrieval } : {}),
|
|
230
272
|
},
|
|
231
|
-
...(
|
|
273
|
+
...(traceId ? { trace: { traceId } } : {}),
|
|
232
274
|
};
|
|
233
275
|
}
|
|
234
276
|
|
|
@@ -232,19 +232,30 @@
|
|
|
232
232
|
},
|
|
233
233
|
"parameters": {
|
|
234
234
|
"videoModeFirstFrame": "Video from one first-frame image",
|
|
235
|
-
"
|
|
235
|
+
"videoModeFirstLast": "Video from first and last frames",
|
|
236
|
+
"videoFirstFrameRequired": "Choose exactly one first-frame image source: an uploaded artifact or an HTTPS URL.",
|
|
237
|
+
"videoLastFrameRequired": "Choose exactly one last-frame image source: an uploaded artifact or an HTTPS URL.",
|
|
238
|
+
"videoReferencesRequired": "Add at least one reference image, video, or audio input that the selected model supports.",
|
|
236
239
|
"videoModeT2v": "Text to video",
|
|
237
|
-
"videoModeReference": "
|
|
240
|
+
"videoModeReference": "Reference media",
|
|
238
241
|
"chooseImageFile": "Choose and upload image",
|
|
242
|
+
"chooseControlType": "Choose the prepared map type",
|
|
243
|
+
"controlImageRequired": "Upload one control map and choose its type before generating.",
|
|
244
|
+
"controlImageFileRequired": "Use a non-empty PNG or JPEG control map up to 32 MiB.",
|
|
245
|
+
"controlImageHint": "Upload a preprocessed control map with the same dimensions as the output canvas. For repaint, use the model's prepared-map format.",
|
|
246
|
+
"controlTypes": { "openpose": "Pose", "depth": "Depth", "scribble": "Scribble / soft edges", "canny": "Canny / line art", "normal": "Surface normals", "segment": "Segmentation", "tile": "Tile", "repaint": "Repaint" },
|
|
239
247
|
"clearReferenceImage": "Clear reference image",
|
|
240
248
|
"uploadingImage": "Uploading image…",
|
|
241
249
|
"imageFileTooLarge": "Image files must be non-empty and not exceed 32 MiB.",
|
|
242
250
|
"imageFileMimeUnsupported": "Choose a PNG, JPEG, WebP, or GIF image.",
|
|
243
|
-
"cloudImageFileMimeUnsupported": "
|
|
244
|
-
"cloudImageReferenceHint": "Choose a file or
|
|
251
|
+
"cloudImageFileMimeUnsupported": "Use a PNG, JPEG or WebP source image.",
|
|
252
|
+
"cloudImageReferenceHint": "Choose a file or URL reference. PNG, JPEG and WebP files are checked by the selected Runtime implementation.",
|
|
245
253
|
"imageReferenceHint": "A file and a URL are alternatives. Runtime validates the selected implementation and the uploaded image.",
|
|
246
254
|
"imageReferenceExclusive": "Use either a reference image file or a URL, then run again.",
|
|
247
255
|
"fields": {
|
|
256
|
+
"controlImage": "Control image file",
|
|
257
|
+
"controlType": "Control image type",
|
|
258
|
+
"controlStrength": "Control strength (default 1)",
|
|
248
259
|
"negativePrompt": "Negative prompt",
|
|
249
260
|
"count": "Count",
|
|
250
261
|
"size": "Size",
|
|
@@ -255,6 +266,10 @@
|
|
|
255
266
|
"mask": "Mask URL",
|
|
256
267
|
"mode": "Mode",
|
|
257
268
|
"firstFrameImageUrl": "First-frame image HTTPS URL",
|
|
269
|
+
"firstFrameArtifactId": "First-frame image artifact ID",
|
|
270
|
+
"lastFrameImageUrl": "Last-frame image HTTPS URL",
|
|
271
|
+
"lastFrameArtifactId": "Last-frame image artifact ID",
|
|
272
|
+
"additionalReferenceArtifactIds": "Additional reference artifact IDs, one per line",
|
|
258
273
|
"referenceArtifactId": "Reference artifact ID",
|
|
259
274
|
"referenceImageFile": "Reference image file",
|
|
260
275
|
"resolution": "Resolution",
|
|
@@ -269,8 +284,42 @@
|
|
|
269
284
|
"returnLastFrame": "Return last frame",
|
|
270
285
|
"serviceTier": "Service tier",
|
|
271
286
|
"executionExpiresAfterSec": "Execution expiry (seconds)",
|
|
272
|
-
"lyrics": "Lyrics"
|
|
273
|
-
|
|
287
|
+
"lyrics": "Lyrics",
|
|
288
|
+
"referenceVideoUrls": "Reference video HTTPS URLs, one per line",
|
|
289
|
+
"referenceAudioUrls": "Reference audio HTTPS URLs, one per line",
|
|
290
|
+
"referenceAudioArtifactIds": "Reference audio artifact IDs, one per line",
|
|
291
|
+
"referenceVideoArtifactIds": "Reference video artifact IDs, one per line",
|
|
292
|
+
"maskFile": "Mask file",
|
|
293
|
+
"complexity": "Planning complexity",
|
|
294
|
+
"outputFormat": "Output file format",
|
|
295
|
+
"markup": "Annotation URL",
|
|
296
|
+
"markupFile": "Annotation PNG",
|
|
297
|
+
"animationFrames": "Animation frames",
|
|
298
|
+
"frameDurationMs": "Frame duration (ms)"
|
|
299
|
+
},
|
|
300
|
+
"videoBoolDefault": "Use model default",
|
|
301
|
+
"videoBoolOn": "On",
|
|
302
|
+
"videoBoolOff": "Off",
|
|
303
|
+
"videoDurationHint": "Leave blank for the model default. Use -1 for automatic duration only where the selected model supports it.",
|
|
304
|
+
"videoReferenceAudioFileTooLarge": "Choose a nonempty audio file no larger than 32 MiB.",
|
|
305
|
+
"audioFileMimeUnsupported": "Choose WAV or MP3 audio.",
|
|
306
|
+
"audioReferenceFiles": "Reference audio files",
|
|
307
|
+
"uploadingReference": "Uploading references…",
|
|
308
|
+
"chooseAudioReference": "Choose and upload audio (WAV/MP3)",
|
|
309
|
+
"clearAudioReference": "Clear reference audio",
|
|
310
|
+
"audioReferenceOrderHint": "Uploaded audio follows this list order, before audio URL references.",
|
|
311
|
+
"videoReferenceFileTooLarge": "Choose a nonempty video file no larger than 32 MiB.",
|
|
312
|
+
"videoReferenceMimeUnsupported": "Choose an MP4 video.",
|
|
313
|
+
"videoReferenceFiles": "Reference video files",
|
|
314
|
+
"chooseVideoReference": "Choose and upload video (MP4)",
|
|
315
|
+
"clearVideoReference": "Clear reference video",
|
|
316
|
+
"videoReferenceOrderHint": "Uploaded video follows this list order, before video URL references.",
|
|
317
|
+
"useDefault": "Model default",
|
|
318
|
+
"maskFileHint": "Opaque binary PNG: white edits, black preserves. Match the source image size.",
|
|
319
|
+
"markupFileHint": "A separate transparent PNG annotation layer matching the source image. Do not combine with a mask.",
|
|
320
|
+
"layerPngRequired": "Choose a PNG file up to 32 MiB.",
|
|
321
|
+
"clearLayer": "Clear layer",
|
|
322
|
+
"imageFormatHint": "Use a format supported by the selected model. SVG and GIF are generation-only; SVG can incur separate provider authoring charges. GIF timing rounds to 10 ms."
|
|
274
323
|
}
|
|
275
324
|
},
|
|
276
325
|
"Music": {
|
|
@@ -312,8 +361,10 @@
|
|
|
312
361
|
"hideScore": "Hide ABC",
|
|
313
362
|
"exportScore": "Export ABC score",
|
|
314
363
|
"generatedPlan": "Generated plan in ABC notation",
|
|
315
|
-
"recovered": "
|
|
364
|
+
"recovered": "Result saved to History.",
|
|
316
365
|
"observationIssue": "Progress is temporarily unavailable. Checking the original task again…",
|
|
317
|
-
"recoveryNeedsAttention": "Recovery needs attention"
|
|
366
|
+
"recoveryNeedsAttention": "Recovery needs attention",
|
|
367
|
+
"requiredLyricsLabel": "Lyrics (required)",
|
|
368
|
+
"lyricsRequired": "The selected model requires lyrics. Add lyrics, or choose a model that supports instrumental input."
|
|
318
369
|
}
|
|
319
370
|
}
|
|
@@ -232,19 +232,30 @@
|
|
|
232
232
|
},
|
|
233
233
|
"parameters": {
|
|
234
234
|
"videoModeFirstFrame": "单张首帧生成视频",
|
|
235
|
-
"
|
|
235
|
+
"videoModeFirstLast": "首尾帧生成视频",
|
|
236
|
+
"videoFirstFrameRequired": "请为首帧选择一个来源:已上传的图像资源或 HTTPS URL。",
|
|
237
|
+
"videoLastFrameRequired": "请为末帧选择一个来源:已上传的图像资源或 HTTPS URL。",
|
|
238
|
+
"videoReferencesRequired": "请添加至少一项所选模型支持的参考图片、视频或音频。",
|
|
236
239
|
"videoModeT2v": "文生视频",
|
|
237
|
-
"videoModeReference": "
|
|
240
|
+
"videoModeReference": "参考素材",
|
|
238
241
|
"chooseImageFile": "选择并上传图片",
|
|
242
|
+
"chooseControlType": "选择已准备控制图的类型",
|
|
243
|
+
"controlImageRequired": "请上传一张控制图并选择其类型,然后生成。",
|
|
244
|
+
"controlImageFileRequired": "请选择非空且不超过 32 MiB 的 PNG 或 JPEG 控制图。",
|
|
245
|
+
"controlImageHint": "上传已预处理且与输出画布同尺寸的控制图。重绘输入须遵循模型的控制图格式约定。",
|
|
246
|
+
"controlTypes": { "openpose": "姿态", "depth": "深度", "scribble": "涂鸦 / 软边缘", "canny": "Canny / 线稿", "normal": "表面法线", "segment": "分割", "tile": "Tile", "repaint": "重绘" },
|
|
239
247
|
"clearReferenceImage": "清除参考图片",
|
|
240
248
|
"uploadingImage": "正在上传图片…",
|
|
241
249
|
"imageFileTooLarge": "图片文件必须非空且不超过 32 MiB。",
|
|
242
250
|
"imageFileMimeUnsupported": "请选择 PNG、JPEG、WebP 或 GIF 图片。",
|
|
243
|
-
"cloudImageFileMimeUnsupported": "
|
|
244
|
-
"cloudImageReferenceHint": "
|
|
251
|
+
"cloudImageFileMimeUnsupported": "请选择 PNG、JPEG 或 WebP 参考图。",
|
|
252
|
+
"cloudImageReferenceHint": "文件参考与链接参考二选一。PNG、JPEG 和 WebP 文件由所选 Runtime 校验。",
|
|
245
253
|
"imageReferenceHint": "文件参考与网址参考二选一。Runtime 会校验所选实现及上传的图片。",
|
|
246
254
|
"imageReferenceExclusive": "请在参考图文件和网址中选择一种,再重新运行。",
|
|
247
255
|
"fields": {
|
|
256
|
+
"controlImage": "控制图文件",
|
|
257
|
+
"controlType": "控制图类型",
|
|
258
|
+
"controlStrength": "控制强度(默认 1)",
|
|
248
259
|
"negativePrompt": "负向提示词",
|
|
249
260
|
"count": "数量",
|
|
250
261
|
"size": "尺寸",
|
|
@@ -255,6 +266,10 @@
|
|
|
255
266
|
"mask": "蒙版 URL",
|
|
256
267
|
"mode": "模式",
|
|
257
268
|
"firstFrameImageUrl": "首帧图像 HTTPS URL",
|
|
269
|
+
"firstFrameArtifactId": "首帧图像资源 ID",
|
|
270
|
+
"lastFrameImageUrl": "末帧图像 HTTPS URL",
|
|
271
|
+
"lastFrameArtifactId": "末帧图像资源 ID",
|
|
272
|
+
"additionalReferenceArtifactIds": "更多参考图资源 ID,每行一个",
|
|
258
273
|
"referenceArtifactId": "参考产物 ID",
|
|
259
274
|
"referenceImageFile": "参考图文件",
|
|
260
275
|
"resolution": "分辨率",
|
|
@@ -269,8 +284,42 @@
|
|
|
269
284
|
"returnLastFrame": "返回末帧",
|
|
270
285
|
"serviceTier": "服务等级",
|
|
271
286
|
"executionExpiresAfterSec": "执行过期时间(秒)",
|
|
272
|
-
"lyrics": "歌词"
|
|
273
|
-
|
|
287
|
+
"lyrics": "歌词",
|
|
288
|
+
"referenceVideoUrls": "参考视频 HTTPS 链接,每行一个",
|
|
289
|
+
"referenceAudioUrls": "参考音频 HTTPS 链接,每行一个",
|
|
290
|
+
"referenceAudioArtifactIds": "参考音频资源 ID,每行一个",
|
|
291
|
+
"referenceVideoArtifactIds": "参考视频资源 ID,每行一个",
|
|
292
|
+
"maskFile": "蒙版文件",
|
|
293
|
+
"complexity": "规划复杂度",
|
|
294
|
+
"outputFormat": "输出文件格式",
|
|
295
|
+
"markup": "标注图层 URL",
|
|
296
|
+
"markupFile": "标注 PNG 图层",
|
|
297
|
+
"animationFrames": "动画帧数",
|
|
298
|
+
"frameDurationMs": "每帧时长(毫秒)"
|
|
299
|
+
},
|
|
300
|
+
"videoBoolDefault": "沿用模型默认",
|
|
301
|
+
"videoBoolOn": "开启",
|
|
302
|
+
"videoBoolOff": "关闭",
|
|
303
|
+
"videoDurationHint": "留空沿用模型默认;仅在模型支持自动时长时填写 -1。",
|
|
304
|
+
"videoReferenceAudioFileTooLarge": "音频不能为空,且单个文件不能超过 32 MiB。",
|
|
305
|
+
"audioFileMimeUnsupported": "请选择 WAV 或 MP3 音频。",
|
|
306
|
+
"audioReferenceFiles": "参考音频文件",
|
|
307
|
+
"uploadingReference": "正在上传参考素材…",
|
|
308
|
+
"chooseAudioReference": "选择并上传音频(WAV/MP3)",
|
|
309
|
+
"clearAudioReference": "清除参考音频",
|
|
310
|
+
"audioReferenceOrderHint": "上传的音频会按此列表顺序排在音频链接之前。",
|
|
311
|
+
"videoReferenceFileTooLarge": "视频不能为空,且单个文件不能超过 32 MiB。",
|
|
312
|
+
"videoReferenceMimeUnsupported": "请选择 MP4 视频。",
|
|
313
|
+
"videoReferenceFiles": "参考视频文件",
|
|
314
|
+
"chooseVideoReference": "选择并上传视频(MP4)",
|
|
315
|
+
"clearVideoReference": "清除参考视频",
|
|
316
|
+
"videoReferenceOrderHint": "已上传的视频按列表顺序排在视频链接之前。",
|
|
317
|
+
"useDefault": "沿用模型默认",
|
|
318
|
+
"maskFileHint": "不透明黑白 PNG:白色编辑、黑色保留,尺寸须与参考图一致。",
|
|
319
|
+
"markupFileHint": "与参考图尺寸一致的独立透明 PNG 标注图层,不能与蒙版同时使用。",
|
|
320
|
+
"layerPngRequired": "请选择不超过 32 MiB 的 PNG 文件。",
|
|
321
|
+
"clearLayer": "清除图层",
|
|
322
|
+
"imageFormatHint": "请选择模型支持的格式。SVG 和 GIF 仅用于生成;SVG 可能产生供方额外绘制费用,GIF 每帧时间按 10 毫秒取整。"
|
|
274
323
|
}
|
|
275
324
|
},
|
|
276
325
|
"Music": {
|
|
@@ -312,8 +361,10 @@
|
|
|
312
361
|
"hideScore": "收起 ABC",
|
|
313
362
|
"exportScore": "导出 ABC 乐谱",
|
|
314
363
|
"generatedPlan": "ABC 格式的生成计划",
|
|
315
|
-
"recovered": "
|
|
364
|
+
"recovered": "结果已保存到历史。",
|
|
316
365
|
"observationIssue": "暂时无法更新进度,正在继续查询原任务…",
|
|
317
|
-
"recoveryNeedsAttention": "恢复遇到问题"
|
|
366
|
+
"recoveryNeedsAttention": "恢复遇到问题",
|
|
367
|
+
"requiredLyricsLabel": "歌词(必填)",
|
|
368
|
+
"lyricsRequired": "所选模型需要歌词。请填写歌词;如需纯配乐,请改选支持无歌词生成的模型。"
|
|
318
369
|
}
|
|
319
370
|
}
|
|
@@ -54,10 +54,11 @@ export function MusicFields(props: StudioParameterPanelProps) {
|
|
|
54
54
|
}
|
|
55
55
|
return <div className="space-y-4">
|
|
56
56
|
{loading ? <p>{t('Music.loadingInputs')}</p> : !capabilities ? <p>{t('Music.configureInputs')}</p> : null}
|
|
57
|
-
<StudioParameterField label={t('Studio.parameters.fields.lyrics')}>
|
|
57
|
+
<StudioParameterField label={t(profile?.lyricsMode === 'required' ? 'Music.requiredLyricsLabel' : 'Studio.parameters.fields.lyrics')}>
|
|
58
58
|
<TextareaField value={parameters.lyrics ?? ''} disabled={disabled || parameters.instrumental === true}
|
|
59
59
|
textareaClassName="min-h-36 font-mono" onChange={(event) => update({ ...parameters, lyrics: event.currentTarget.value })} />
|
|
60
60
|
</StudioParameterField>
|
|
61
|
+
{profile?.lyricsMode === 'required' ? <p className="text-sm opacity-70">{t('Music.lyricsRequired')}</p> : null}
|
|
61
62
|
{profile?.lyricsMode === 'unsupported' ? <p className="text-sm opacity-70">{t('Music.lyricsUnsupported')}</p> : null}
|
|
62
63
|
<StudioNumberParameter current={parameters} field="durationSeconds" label={t('Music.duration', { max: profile?.maxDurationSeconds ?? '—' })} onChange={update} disabled={disabled} />
|
|
63
64
|
<p className="text-sm opacity-70">{profile && profile.maxDurationSeconds > 0 && profile.maxDurationSeconds === profile.defaultDurationSeconds
|