@nimiplatform/app-tools 0.2.9 → 0.3.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/README.md +24 -4
- package/lib/app-pack.mjs +33 -11
- package/lib/app-project-lifecycle.mjs +1 -0
- package/lib/app-scaffold-profiles.mjs +28 -13
- package/lib/app-scaffold.mjs +8 -1
- package/lib/macos-native.mjs +96 -0
- package/lib/payload-links.mjs +41 -0
- package/package.json +7 -7
- package/templates/app-source/src/ai-studio-core/ai-studio-core.css +31 -0
- package/templates/app-source/src/ai-studio-core/history-policy.ts +23 -1
- package/templates/app-source/src/ai-studio-core/history.ts +7 -1
- package/templates/app-source/src/ai-studio-core/messages/en.json +1 -0
- package/templates/app-source/src/ai-studio-core/messages/zh.json +1 -0
- package/templates/app-source/src/ai-studio-core/module-registration.ts +2 -2
- package/templates/app-source/src/ai-studio-core/non-success-presentation.ts +6 -2
- package/templates/app-source/src/ai-studio-core/run-target.ts +1 -1
- package/templates/app-source/src/ai-studio-core/runtime-types.ts +4 -0
- package/templates/app-source/src/ai-studio-core/runtime.ts +13 -4
- package/templates/app-source/src/ai-studio-core/section-ai-testing-admission.ts +3 -3
- package/templates/app-source/src/ai-studio-core/section-ai-testing-composer.tsx +41 -13
- package/templates/app-source/src/ai-studio-core/section-ai-testing-history.tsx +1 -1
- 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 +26 -1
- package/templates/app-source/src/ai-studio-core/section-ai-testing-result.tsx +14 -4
- package/templates/app-source/src/ai-studio-core/section-ai-testing-run.ts +3 -1
- package/templates/app-source/src/ai-studio-core/section-ai-testing-studio-result.tsx +12 -3
- package/templates/app-source/src/ai-studio-core/section-ai-testing-vision-input.tsx +56 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing-vision-result.tsx +22 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing.tsx +54 -29
- package/templates/app-source/src/product-modules/agent-realtime/index.tsx +2 -2
- package/templates/app-source/src/studio-modules/studio-create/runtime.ts +1 -0
- package/templates/app-source/src/studio-modules/studio-media/descriptors.ts +6 -1
- package/templates/app-source/src/studio-modules/studio-media/messages/en.json +19 -0
- package/templates/app-source/src/studio-modules/studio-media/messages/zh.json +19 -0
- package/templates/app-source/src/studio-modules/studio-media/registration.ts +10 -1
- package/templates/app-source/src/studio-modules/studio-media/runtime.ts +2 -0
- package/templates/app-source/src/studio-modules/studio-media/vision-parameters.tsx +18 -0
- package/templates/app-source/src/studio-modules/studio-media/vision-runtime.ts +58 -0
- package/templates/app-source/src/workbench-core/workbench-core.css +5 -0
- package/templates/app-source.manifest.json +16 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isJsonObject } from '@nimiplatform/sdk/types';
|
|
2
|
+
import type { NimiLocalAppVisionLocateResult } from '@nimiplatform/sdk/app';
|
|
2
3
|
import type {
|
|
3
4
|
StudioCapabilityRunResult,
|
|
4
5
|
StudioManagedArtifact,
|
|
@@ -29,7 +30,7 @@ export type StudioRunTargetStatus =
|
|
|
29
30
|
| 'checking'
|
|
30
31
|
| 'configured'
|
|
31
32
|
| 'blocked'
|
|
32
|
-
| '
|
|
33
|
+
| 'viewer-only'
|
|
33
34
|
| 'sdk-gap'
|
|
34
35
|
| 'not-admitted';
|
|
35
36
|
|
|
@@ -50,6 +51,7 @@ export type StudioRunConfigSnapshot = {
|
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
export type StudioRunHistoryResultSnapshot =
|
|
54
|
+
| { ok: true; kind: 'vision-locate'; summary: string; jobId: string; result?: NimiLocalAppVisionLocateResult; traceId?: string }
|
|
53
55
|
| {
|
|
54
56
|
ok: true;
|
|
55
57
|
kind: 'text';
|
|
@@ -456,6 +458,7 @@ export function createStudioRunHistoryResultSnapshot(result: StudioCapabilityRun
|
|
|
456
458
|
|
|
457
459
|
const trace = traceFields(result);
|
|
458
460
|
const output = result.output;
|
|
461
|
+
if (output.kind === 'vision-locate') return { ok: true, kind: 'vision-locate', summary: result.message, jobId: output.jobId, result: output.result, ...trace };
|
|
459
462
|
if (output.kind === 'text') {
|
|
460
463
|
return {
|
|
461
464
|
ok: true,
|
|
@@ -569,6 +572,7 @@ export function restoreStudioCapabilityRunResult(
|
|
|
569
572
|
message: record.message,
|
|
570
573
|
...(trace ? { trace } : {}),
|
|
571
574
|
};
|
|
575
|
+
if (snapshot.kind === 'vision-locate') return snapshot.result ? { ...common, output: { kind: 'vision-locate', jobId: snapshot.jobId, result: snapshot.result } } : null;
|
|
572
576
|
if (snapshot.kind === 'text') {
|
|
573
577
|
return {
|
|
574
578
|
...common,
|
|
@@ -802,6 +806,7 @@ export function getStudioRunMetricSummary(record: StudioRunHistoryRecord): strin
|
|
|
802
806
|
if (result.kind === 'artifacts') return `${result.jobState || 'unknown'} / ${result.artifactCount} artifact${result.artifactCount === 1 ? '' : 's'}`;
|
|
803
807
|
if (result.kind === 'transcript') return `${result.jobState || 'unknown'} / ${result.charCount} chars / ${result.artifactCount} artifact${result.artifactCount === 1 ? '' : 's'}`;
|
|
804
808
|
if (result.kind === 'voice-asset') return `${result.jobState || 'unknown'} / ${result.creationSource} / ${result.assetStatus}`;
|
|
809
|
+
if (result.kind === 'vision-locate') return result.summary;
|
|
805
810
|
return `${result.voiceCount} voice${result.voiceCount === 1 ? '' : 's'}`;
|
|
806
811
|
}
|
|
807
812
|
|
|
@@ -820,5 +825,6 @@ export function getStudioRunResultTags(record: StudioRunHistoryRecord): string[]
|
|
|
820
825
|
if (result.kind === 'artifacts') return ['Ready'];
|
|
821
826
|
if (result.kind === 'transcript') return ['Ready'];
|
|
822
827
|
if (result.kind === 'voice-asset') return ['VoiceAsset ready', result.creationSource];
|
|
828
|
+
if (result.kind === 'vision-locate') return result.result ? ['Locate', String(result.result.locations.length)] : ['Locate'];
|
|
823
829
|
return [`${result.voiceCount} voices`];
|
|
824
830
|
}
|
|
@@ -165,6 +165,7 @@
|
|
|
165
165
|
"expandImage": "Expand image",
|
|
166
166
|
"expandGeneratedImage": "Expand generated image",
|
|
167
167
|
"imagePreview": "Image preview",
|
|
168
|
+
"imagePreviewFailed": "The image preview could not be opened. Please try again.",
|
|
168
169
|
"closeImagePreview": "Close image preview",
|
|
169
170
|
"emptyBody": "(empty body)",
|
|
170
171
|
"emptyTranscript": "(empty transcript)",
|
|
@@ -7,7 +7,7 @@ import type { StudioParameterPanelProps } from './parameter-fields.js';
|
|
|
7
7
|
|
|
8
8
|
export type StudioControlId = 'tone' | 'length';
|
|
9
9
|
export type StudioInputKind = 'prompt' | 'url' | 'none';
|
|
10
|
-
export type StudioResultKind = 'text' | 'transcript' | 'embedding' | 'artifacts' | 'voice-asset' | 'voice-catalog';
|
|
10
|
+
export type StudioResultKind = 'text' | 'transcript' | 'embedding' | 'artifacts' | 'voice-asset' | 'voice-catalog' | 'vision-locate';
|
|
11
11
|
|
|
12
12
|
export type CapabilityStudioProfile = {
|
|
13
13
|
readonly studioTag: string;
|
|
@@ -43,7 +43,7 @@ export type StudioCapabilityDescriptor<TCapabilityId extends string = string> =
|
|
|
43
43
|
readonly summary: string;
|
|
44
44
|
readonly summaryKey: string;
|
|
45
45
|
readonly surface: string;
|
|
46
|
-
readonly execution: 'runtime-sdk' | 'standalone-
|
|
46
|
+
readonly execution: 'runtime-sdk' | 'standalone-electron' | 'typed-unavailable';
|
|
47
47
|
readonly capabilityContract?: string;
|
|
48
48
|
readonly missingSurface?: string;
|
|
49
49
|
};
|
|
@@ -29,12 +29,16 @@ export function studioNonSuccessReasonTitle(reason: StudioNonSuccessReason, tran
|
|
|
29
29
|
return translate(`NonSuccess.title.${reasonKeySegment(reason)}`);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export function studioNonSuccessReasonUserMessage(reason: string, translate: StudioTranslate): string {
|
|
32
|
+
export function studioNonSuccessReasonUserMessage(reason: string, translate: StudioTranslate, capabilityId?: string, diagnostics?: StudioNonSuccessDiagnostics): string {
|
|
33
|
+
if (capabilityId === 'vision.locate' && diagnostics?.reasonCode === 'AI_LOCAL_SELECTION_NOT_FOUND') return translate('VisionLocate.modelSelectionRequired');
|
|
34
|
+
if (reason === 'input-invalid' && capabilityId === 'vision.locate') return translate('VisionLocate.invalidInput');
|
|
33
35
|
const segment = reasonKeySegment(reason);
|
|
34
36
|
return translate(segment ? `NonSuccess.message.${segment}` : 'NonSuccess.message.fallback');
|
|
35
37
|
}
|
|
36
38
|
|
|
37
|
-
export function studioNonSuccessReasonUserAction(reason: string, translate: StudioTranslate): string {
|
|
39
|
+
export function studioNonSuccessReasonUserAction(reason: string, translate: StudioTranslate, capabilityId?: string, diagnostics?: StudioNonSuccessDiagnostics): string {
|
|
40
|
+
if (capabilityId === 'vision.locate' && diagnostics?.reasonCode === 'AI_LOCAL_SELECTION_NOT_FOUND') return translate('VisionLocate.selectModelAction');
|
|
41
|
+
if (reason === 'input-invalid' && capabilityId === 'vision.locate') return translate('VisionLocate.correctInput');
|
|
38
42
|
const segment = reasonKeySegment(reason);
|
|
39
43
|
return translate(segment ? `NonSuccess.action.${segment}` : 'NonSuccess.action.fallback');
|
|
40
44
|
}
|
|
@@ -26,7 +26,7 @@ export function createStudioRunTargetSummary(input: {
|
|
|
26
26
|
profileOrigin: null,
|
|
27
27
|
} as const;
|
|
28
28
|
|
|
29
|
-
if (capability.execution === 'standalone-
|
|
29
|
+
if (capability.execution === 'standalone-electron') {
|
|
30
30
|
throw new Error('Standalone capability run targets must be projected by an app-specific host adapter.');
|
|
31
31
|
}
|
|
32
32
|
if (capability.execution === 'typed-unavailable' || !capabilityContract) {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { BrowserDataUrlAttachment } from '@nimiplatform/kit/features/chat/headless';
|
|
2
2
|
import type { StudioParameterValue } from './parameters.js';
|
|
3
|
+
import type { NimiLocalAppVisionLocateResult } from '@nimiplatform/sdk/app';
|
|
4
|
+
import type { NimiRuntimeScenarioJob } from '@nimiplatform/sdk/runtime';
|
|
3
5
|
|
|
4
6
|
export type StudioRuntimeCapabilityDescriptor = {
|
|
5
7
|
readonly id: string;
|
|
@@ -21,6 +23,7 @@ export type StudioManagedArtifact = {
|
|
|
21
23
|
};
|
|
22
24
|
|
|
23
25
|
export type StudioTypedOutput =
|
|
26
|
+
| { readonly kind: 'vision-locate'; readonly jobId: string; readonly result: NimiLocalAppVisionLocateResult; readonly imagePreviewUrl?: string }
|
|
24
27
|
| { readonly kind: 'text'; readonly text: string; readonly finishReason: string; readonly inputTokens?: number; readonly outputTokens?: number; readonly totalTokens?: number; readonly streamed: boolean }
|
|
25
28
|
| { readonly kind: 'embedding'; readonly vectorCount: number; readonly dimensions: number; readonly sample: number[]; readonly totalTokens?: number }
|
|
26
29
|
| { readonly kind: 'artifacts'; readonly jobId: string; readonly jobState: string; readonly artifactCount: number; readonly artifacts: StudioManagedArtifact[]; readonly firstArtifact?: StudioManagedArtifact }
|
|
@@ -80,6 +83,7 @@ export type StudioCapabilityRunInput = {
|
|
|
80
83
|
readonly scenarioId?: string;
|
|
81
84
|
readonly signal?: AbortSignal;
|
|
82
85
|
readonly onPartial?: (accumulatedText: string) => void;
|
|
86
|
+
readonly onJobUpdate?: (job: NimiRuntimeScenarioJob) => void;
|
|
83
87
|
readonly attachments?: BrowserDataUrlAttachment[];
|
|
84
88
|
readonly directive?: string;
|
|
85
89
|
readonly parameters?: StudioParameterValue;
|
|
@@ -50,6 +50,7 @@ export type StudioRuntimeHost = {
|
|
|
50
50
|
readonly appId: string;
|
|
51
51
|
readonly surfaceId: string;
|
|
52
52
|
readonly abortReason: string;
|
|
53
|
+
readonly translate: (key: string, values?: Readonly<Record<string, unknown>>) => string;
|
|
53
54
|
readonly client: NimiLocalAppClient;
|
|
54
55
|
readonly createScenarioJobClient: typeof createNimiLocalAppRuntimeScenarioJobClient;
|
|
55
56
|
readonly runners: StudioRuntimeRunnerSet;
|
|
@@ -68,6 +69,7 @@ export type StudioCapabilityRuntimeOrchestrator = {
|
|
|
68
69
|
readonly appId: string;
|
|
69
70
|
readonly surfaceId: string;
|
|
70
71
|
readonly abortReason: string;
|
|
72
|
+
readonly translate: StudioRuntimeHost['translate'];
|
|
71
73
|
readonly handlers: StudioCapabilityRuntimeHandlers;
|
|
72
74
|
readonly resolveCapability: (capabilityId: string) => StudioRuntimeCapabilityDescriptor;
|
|
73
75
|
readonly inspectRuntime: () => Promise<StudioRuntimeInspection>;
|
|
@@ -116,6 +118,7 @@ export async function runStudioCapability(
|
|
|
116
118
|
appId: orchestrator.appId,
|
|
117
119
|
surfaceId: orchestrator.surfaceId,
|
|
118
120
|
abortReason: orchestrator.abortReason,
|
|
121
|
+
translate: orchestrator.translate,
|
|
119
122
|
client: orchestrator.getClient(),
|
|
120
123
|
createScenarioJobClient: orchestrator.createScenarioJobClient
|
|
121
124
|
?? createNimiLocalAppRuntimeScenarioJobClient,
|
|
@@ -240,11 +243,16 @@ export function projectStudioRuntimeError(
|
|
|
240
243
|
context: StudioCapabilityRuntimeContext,
|
|
241
244
|
error: unknown,
|
|
242
245
|
): StudioNonSuccess {
|
|
246
|
+
const diagnostics = studioNonSuccessDiagnostics(error);
|
|
247
|
+
// @nimi-authority: rule.nimi.runtime.ai-provider.r126
|
|
248
|
+
const reason = diagnostics?.reasonCode.replaceAll('-', '_').toUpperCase() === 'AI_INPUT_INVALID'
|
|
249
|
+
? 'input-invalid'
|
|
250
|
+
: studioNonSuccessReason(runtimeScenarioJobNonSuccessReasonFromError(error));
|
|
243
251
|
return context.host.nonSuccess(
|
|
244
252
|
context.capability,
|
|
245
|
-
|
|
253
|
+
reason,
|
|
246
254
|
studioRuntimeErrorMessage(error),
|
|
247
|
-
|
|
255
|
+
diagnostics,
|
|
248
256
|
);
|
|
249
257
|
}
|
|
250
258
|
|
|
@@ -261,8 +269,9 @@ export function studioNonSuccessReason(reason: string): StudioNonSuccessReason {
|
|
|
261
269
|
export function studioNonSuccessDiagnostics(error: unknown): StudioNonSuccessDiagnostics | undefined {
|
|
262
270
|
if (!error || typeof error !== 'object' || Array.isArray(error)) return undefined;
|
|
263
271
|
const record = error as Record<string, unknown>;
|
|
264
|
-
const
|
|
265
|
-
if (!/^[A-Z][A-Z0-9_]{0,127}$/u.test(
|
|
272
|
+
const rawReasonCode = typeof record.reasonCode === 'string' ? record.reasonCode.trim() : '';
|
|
273
|
+
if (!/^(?:[A-Z][A-Z0-9_]{0,127}|[a-z][a-z0-9-]{0,127})$/u.test(rawReasonCode)) return undefined;
|
|
274
|
+
const reasonCode = rawReasonCode.replaceAll('-', '_').toUpperCase();
|
|
266
275
|
const rawActionHint = typeof record.actionHint === 'string' ? record.actionHint.trim() : '';
|
|
267
276
|
const actionHint = /^[A-Za-z0-9_.-]{1,256}$/u.test(rawActionHint) ? rawActionHint : '';
|
|
268
277
|
const rawTraceId = typeof record.traceId === 'string' ? record.traceId.trim() : '';
|
|
@@ -4,7 +4,7 @@ import type { StudioRunTargetSummary } from './history.js';
|
|
|
4
4
|
import type { StudioTranslate } from './non-success-presentation.js';
|
|
5
5
|
|
|
6
6
|
export type CapabilityStatus = {
|
|
7
|
-
label: 'configured' | 'blocked' | 'not admitted' | 'SDK gap' | '
|
|
7
|
+
label: 'configured' | 'blocked' | 'not admitted' | 'SDK gap' | 'viewer-only' | 'checking';
|
|
8
8
|
tone: 'success' | 'warning' | 'info' | 'neutral';
|
|
9
9
|
detail: string;
|
|
10
10
|
};
|
|
@@ -16,8 +16,8 @@ export function statusForCapability(
|
|
|
16
16
|
translate: StudioTranslate,
|
|
17
17
|
): CapabilityStatus {
|
|
18
18
|
const capability = registration.descriptor;
|
|
19
|
-
if (capability.execution === 'standalone-
|
|
20
|
-
return { label: '
|
|
19
|
+
if (capability.execution === 'standalone-electron') {
|
|
20
|
+
return { label: 'viewer-only', tone: 'info', detail: target.detail };
|
|
21
21
|
}
|
|
22
22
|
if (capability.execution === 'typed-unavailable') {
|
|
23
23
|
return { label: 'SDK gap', tone: 'warning', detail: capability.missingSurface || translate('Studio.admission.sdkGapDetail') };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { useState, type ChangeEvent, type ReactNode } from 'react';
|
|
1
|
+
import { useId, useState, type ChangeEvent, type ReactNode } from 'react';
|
|
2
2
|
import { Button, IconButton, NimiText, TextareaField, Tooltip } from '@nimiplatform/kit/ui';
|
|
3
|
-
import { ArrowUp, Paperclip, Play, Plus, RefreshCw, SlidersHorizontal, X } from 'lucide-react';
|
|
3
|
+
import { ArrowUp, Paperclip, Play, Plus, RefreshCw, ScanSearch, SlidersHorizontal, X } from 'lucide-react';
|
|
4
4
|
import type { BrowserDataUrlAttachment } from '@nimiplatform/kit/features/chat/headless';
|
|
5
5
|
import { useAIStudioHost } from './host-context.js';
|
|
6
6
|
import type { StudioCapabilityRegistration } from './module-registration.js';
|
|
7
7
|
import { hasStudioCapabilityRunInput } from './section-ai-testing-input.js';
|
|
8
|
+
import { VisionLocateImageInput } from './section-ai-testing-vision-input.js';
|
|
8
9
|
|
|
9
10
|
function IntentSummaryChip({
|
|
10
11
|
label,
|
|
@@ -86,15 +87,20 @@ export function TextStudioComposer({
|
|
|
86
87
|
const { translate: t } = useAIStudioHost();
|
|
87
88
|
const capability = registration.descriptor;
|
|
88
89
|
const profile = registration.profile;
|
|
90
|
+
const isVisionLocate = capability.id === 'vision.locate';
|
|
91
|
+
const queryInputId = useId();
|
|
89
92
|
const isReadOnlyComposer = profile.inputKind === 'none';
|
|
90
93
|
const requiresPrompt = !isReadOnlyComposer;
|
|
91
94
|
const contextAttached = Boolean(context.trim());
|
|
92
|
-
const supportsContext = requiresPrompt && capability.id !== 'audio.transcribe';
|
|
95
|
+
const supportsContext = requiresPrompt && capability.id !== 'audio.transcribe' && !isVisionLocate;
|
|
93
96
|
const [contextOpen, setContextOpen] = useState(false);
|
|
94
97
|
const [parametersOpen, setParametersOpen] = useState(false);
|
|
95
|
-
const promptReady = hasStudioCapabilityRunInput({ requiresPrompt, prompt, hasAlternativeInput })
|
|
98
|
+
const promptReady = hasStudioCapabilityRunInput({ requiresPrompt, prompt, hasAlternativeInput })
|
|
99
|
+
&& (!isVisionLocate || (attachments.length === 1 && attachments[0]?.kind === 'image'));
|
|
96
100
|
const intentConfigAction = Boolean(onOpenIntentConfig) && !canDispatch && canConfigureIntent;
|
|
97
|
-
const generateDisabled =
|
|
101
|
+
const generateDisabled = isVisionLocate
|
|
102
|
+
? running || (!intentConfigAction && (!promptReady || !canDispatch))
|
|
103
|
+
: running || !promptReady || (!canDispatch && !intentConfigAction);
|
|
98
104
|
const generateLabel = running
|
|
99
105
|
? t(profile.primaryRunningLabelKey)
|
|
100
106
|
: intentConfigAction
|
|
@@ -116,7 +122,7 @@ export function TextStudioComposer({
|
|
|
116
122
|
{contextAttached ? t('Studio.composer.contextAttached') : t('Studio.composer.context')}
|
|
117
123
|
</Button>
|
|
118
124
|
) : null}
|
|
119
|
-
{parameterPanel ? (
|
|
125
|
+
{parameterPanel && !isVisionLocate ? (
|
|
120
126
|
<Button
|
|
121
127
|
type="button"
|
|
122
128
|
tone="ghost"
|
|
@@ -136,7 +142,7 @@ export function TextStudioComposer({
|
|
|
136
142
|
onOpen={onOpenIntentConfig}
|
|
137
143
|
configurable={intentConfigurable && Boolean(onOpenIntentConfig)}
|
|
138
144
|
/>
|
|
139
|
-
{profile.supportsAttachments ? (
|
|
145
|
+
{profile.supportsAttachments && !isVisionLocate ? (
|
|
140
146
|
<div className="studio-attachment-strip studio-attachment-strip--icon">
|
|
141
147
|
<Tooltip content={t('Studio.composer.attachContext')} placement="top">
|
|
142
148
|
<Button
|
|
@@ -173,7 +179,19 @@ export function TextStudioComposer({
|
|
|
173
179
|
))}
|
|
174
180
|
</div>
|
|
175
181
|
) : null}
|
|
176
|
-
|
|
182
|
+
{isVisionLocate ? (
|
|
183
|
+
<Button
|
|
184
|
+
type="button"
|
|
185
|
+
tone="primary"
|
|
186
|
+
disabled={generateDisabled}
|
|
187
|
+
onClick={intentConfigAction ? onOpenIntentConfig : onSubmit}
|
|
188
|
+
leadingIcon={running
|
|
189
|
+
? <RefreshCw size={16} aria-hidden="true" className="studio-spin" />
|
|
190
|
+
: <ScanSearch size={16} aria-hidden="true" />}
|
|
191
|
+
>
|
|
192
|
+
{generateLabel}
|
|
193
|
+
</Button>
|
|
194
|
+
) : <Tooltip content={generateLabel} placement="top">
|
|
177
195
|
<IconButton
|
|
178
196
|
type="button"
|
|
179
197
|
className={intentConfigAction ? 'studio-generate-action studio-generate-action--configure' : 'studio-generate-action'}
|
|
@@ -184,26 +202,34 @@ export function TextStudioComposer({
|
|
|
184
202
|
onClick={intentConfigAction ? onOpenIntentConfig : onSubmit}
|
|
185
203
|
icon={running ? <RefreshCw size={15} aria-hidden="true" className="studio-spin" /> : <ArrowUp size={16} aria-hidden="true" />}
|
|
186
204
|
/>
|
|
187
|
-
</Tooltip>
|
|
205
|
+
</Tooltip>}
|
|
188
206
|
</div>
|
|
189
207
|
</div>
|
|
190
208
|
);
|
|
191
209
|
return (
|
|
192
|
-
<div className={compact ? '
|
|
210
|
+
<div className={`studio-composer${compact ? ' studio-composer--compact' : ''}${isVisionLocate ? ' studio-composer--vision' : ''}`}>
|
|
211
|
+
{isVisionLocate ? <VisionLocateImageInput
|
|
212
|
+
image={attachments[0]?.kind === 'image' ? attachments[0] : undefined}
|
|
213
|
+
disabled={running}
|
|
214
|
+
onChoose={onOpenAttachmentPicker}
|
|
215
|
+
onRemove={() => onRemoveAttachment(0)}
|
|
216
|
+
/> : null}
|
|
193
217
|
<div className={isReadOnlyComposer ? 'studio-input studio-input--readonly' : 'studio-input'}>
|
|
218
|
+
{isVisionLocate ? <label className="studio-locate-input__label" htmlFor={queryInputId}>{t('VisionLocate.queryLabel')}</label> : null}
|
|
194
219
|
{isReadOnlyComposer ? (
|
|
195
220
|
<NimiText role="body" className="studio-input__note">
|
|
196
221
|
{profile.inputNoteKey ? t(profile.inputNoteKey) : ''}
|
|
197
222
|
</NimiText>
|
|
198
223
|
) : (
|
|
199
224
|
<TextareaField
|
|
225
|
+
id={queryInputId}
|
|
200
226
|
tone="quiet"
|
|
201
227
|
className="rounded-none focus-within:border-transparent focus-within:ring-0"
|
|
202
228
|
textareaClassName="min-h-[calc(2*1.55em)] resize-none px-0 py-0 text-[15px] leading-[1.55]"
|
|
203
229
|
rows={2}
|
|
204
230
|
wrap="soft"
|
|
205
231
|
maxLength={2000}
|
|
206
|
-
aria-label={t('Studio.composer.requestAriaLabel', { capability: t(capability.labelKey) })}
|
|
232
|
+
aria-label={isVisionLocate ? t('VisionLocate.queryLabel') : t('Studio.composer.requestAriaLabel', { capability: t(capability.labelKey) })}
|
|
207
233
|
placeholder={capability.id === 'text.generate' ? t('Studio.composer.textGeneratePlaceholder') : t(profile.inputPlaceholderKey)}
|
|
208
234
|
value={prompt}
|
|
209
235
|
onChange={(event: ChangeEvent<HTMLTextAreaElement>) => onPromptChange(event.currentTarget.value)}
|
|
@@ -225,7 +251,9 @@ export function TextStudioComposer({
|
|
|
225
251
|
/>
|
|
226
252
|
</div>
|
|
227
253
|
) : null}
|
|
228
|
-
{parameterPanel ? (
|
|
254
|
+
{parameterPanel && isVisionLocate ? (
|
|
255
|
+
<div className="studio-locate-parameters">{parameterPanel}</div>
|
|
256
|
+
) : parameterPanel ? (
|
|
229
257
|
<div className={parametersOpen ? 'studio-parameters-drawer studio-parameters-drawer--open' : 'studio-parameters-drawer'}>
|
|
230
258
|
{parameterPanel}
|
|
231
259
|
</div>
|
|
@@ -247,7 +275,7 @@ export function TextStudioStartState({
|
|
|
247
275
|
const capability = registration.descriptor;
|
|
248
276
|
const profile = registration.profile;
|
|
249
277
|
return (
|
|
250
|
-
<section className=
|
|
278
|
+
<section className={capability.id === 'vision.locate' ? 'studio-start studio-start--vision' : 'studio-start'} aria-label={t('Studio.composer.startAriaLabel', { capability: t(capability.labelKey) })}>
|
|
251
279
|
<div className="studio-start__center">
|
|
252
280
|
<h2>{t(profile.inputTitleKey)}</h2>
|
|
253
281
|
<div className="studio-start__composer">{composer}</div>
|
|
@@ -194,7 +194,7 @@ export function CapabilityRunHistory({
|
|
|
194
194
|
const historyPanel = useContext(StudioHistoryPanelContext);
|
|
195
195
|
const locale = rendererHost.locale.startsWith('zh') ? 'zh-CN' : 'en-US';
|
|
196
196
|
const runtimeHistoryCapabilities = useMemo(() => registrations.filter((item) => (
|
|
197
|
-
item.descriptor.execution === 'runtime-sdk' || item.descriptor.execution === 'standalone-
|
|
197
|
+
item.descriptor.execution === 'runtime-sdk' || item.descriptor.execution === 'standalone-electron'
|
|
198
198
|
)), [registrations]);
|
|
199
199
|
const resolveCapabilityLabel = (id: string) => (
|
|
200
200
|
registrations.find((item) => item.descriptor.id === id)?.descriptor.label ?? null
|
|
@@ -15,5 +15,6 @@ export function canCancelStudioCapabilityRun(input: {
|
|
|
15
15
|
return input.capabilityId === 'chat.stream'
|
|
16
16
|
|| input.resultKind === 'artifacts'
|
|
17
17
|
|| input.resultKind === 'transcript'
|
|
18
|
+
|| input.resultKind === 'vision-locate'
|
|
18
19
|
|| input.resultKind === 'voice-asset';
|
|
19
20
|
}
|
|
@@ -17,6 +17,7 @@ export function formatTypedOutput(
|
|
|
17
17
|
translate: StudioTranslate,
|
|
18
18
|
): string {
|
|
19
19
|
const output = result.output;
|
|
20
|
+
if (output.kind === 'vision-locate') return JSON.stringify({ jobId: output.jobId, ...output.result }, null, 2);
|
|
20
21
|
if (output.kind === 'text') {
|
|
21
22
|
return output.text || translate('StudioShell.emptyBody');
|
|
22
23
|
}
|
|
@@ -153,6 +154,7 @@ export function ArtifactMediaPreview({
|
|
|
153
154
|
const branch = studioArtifactRenderBranch(artifact);
|
|
154
155
|
const { translate: t } = useAIStudioHost();
|
|
155
156
|
const [imagePreviewOpen, setImagePreviewOpen] = useState(false);
|
|
157
|
+
const [imagePreviewUrl, setImagePreviewUrl] = useState<string | null>(null);
|
|
156
158
|
const [url, setUrl] = useState<string | null>(null);
|
|
157
159
|
useEffect(() => {
|
|
158
160
|
setImagePreviewOpen(false);
|
|
@@ -175,6 +177,27 @@ export function ArtifactMediaPreview({
|
|
|
175
177
|
if (revoke) void revoke();
|
|
176
178
|
};
|
|
177
179
|
}, [artifact, mimeType, relativePath]);
|
|
180
|
+
useEffect(() => {
|
|
181
|
+
setImagePreviewUrl(null);
|
|
182
|
+
if (!imagePreviewOpen || !relativePath) return undefined;
|
|
183
|
+
let active = true;
|
|
184
|
+
let revoke: (() => Promise<void>) | undefined;
|
|
185
|
+
void openNimiLocalAppAssetMediaUrl(relativePath)
|
|
186
|
+
.then((handle) => {
|
|
187
|
+
revoke = handle.revoke;
|
|
188
|
+
if (active) setImagePreviewUrl(handle.url);
|
|
189
|
+
else void handle.revoke();
|
|
190
|
+
})
|
|
191
|
+
.catch(() => {
|
|
192
|
+
if (!active) return;
|
|
193
|
+
setImagePreviewOpen(false);
|
|
194
|
+
nimiToast.danger(t('StudioShell.imagePreviewFailed'));
|
|
195
|
+
});
|
|
196
|
+
return () => {
|
|
197
|
+
active = false;
|
|
198
|
+
if (revoke) void revoke();
|
|
199
|
+
};
|
|
200
|
+
}, [imagePreviewOpen, relativePath, t]);
|
|
178
201
|
if (!hasPreviewableArtifact(artifact) || !url) return null;
|
|
179
202
|
const label = artifact?.displayName || relativePath || fallbackLabel;
|
|
180
203
|
const isImage = branch === 'image';
|
|
@@ -222,7 +245,9 @@ export function ArtifactMediaPreview({
|
|
|
222
245
|
onClick={() => setImagePreviewOpen(false)}
|
|
223
246
|
icon={<X size={20} aria-hidden="true" />}
|
|
224
247
|
/>
|
|
225
|
-
|
|
248
|
+
{imagePreviewUrl
|
|
249
|
+
? <img src={imagePreviewUrl} alt={label} className="ai-result-preview-modal__image" />
|
|
250
|
+
: <p role="status">{t('Common.loading')}</p>}
|
|
226
251
|
</DialogContent>
|
|
227
252
|
</Dialog>
|
|
228
253
|
) : null}
|
|
@@ -2,6 +2,7 @@ import { useState, type ReactNode } from 'react';
|
|
|
2
2
|
import { IconButton, nimiToast, StatusBadge, Tooltip } from '@nimiplatform/kit/ui';
|
|
3
3
|
import { AlertTriangle, ChevronRight, Copy as CopyIcon, Download as DownloadIcon, FileText, FolderOpen, MessageSquare, RefreshCw, SlidersHorizontal, SquarePen } from 'lucide-react';
|
|
4
4
|
import { useAIStudioHost } from './host-context.js';
|
|
5
|
+
import { VisionLocateResultView } from './section-ai-testing-vision-result.js';
|
|
5
6
|
import type { StudioCapabilityRegistration } from './module-registration.js';
|
|
6
7
|
import { formatStudioRunTimestamp, getStudioRunConfigParamRows, getStudioRunIntentLabel, getStudioRunPromptControlFacts, getStudioRunResultTags, getStudioRunStatusTone, type StudioRunConfigParamRow, type StudioRunHistoryRecord, type StudioRunHistoryResultSnapshot, type StudioRunPromptControlFact } from './history.js';
|
|
7
8
|
import { studioNonSuccessReasonTitle, studioNonSuccessReasonUserAction, studioNonSuccessReasonUserMessage } from './non-success-presentation.js';
|
|
@@ -131,10 +132,12 @@ function historyResultToneClass(record: StudioRunHistoryRecord): string {
|
|
|
131
132
|
|
|
132
133
|
function TextStudioHistoryRecordResult({
|
|
133
134
|
record,
|
|
135
|
+
canRegenerate,
|
|
134
136
|
onRegenerate,
|
|
135
137
|
onUseAsDraft,
|
|
136
138
|
}: {
|
|
137
139
|
record: StudioRunHistoryRecord;
|
|
140
|
+
canRegenerate: boolean;
|
|
138
141
|
onRegenerate: () => void;
|
|
139
142
|
onUseAsDraft: (record: StudioRunHistoryRecord) => void;
|
|
140
143
|
}) {
|
|
@@ -194,8 +197,8 @@ function TextStudioHistoryRecordResult({
|
|
|
194
197
|
<AlertTriangle size={15} aria-hidden="true" />
|
|
195
198
|
<span>{studioNonSuccessReasonTitle(snapshot.reason, t)}</span>
|
|
196
199
|
</div>
|
|
197
|
-
<p>{studioNonSuccessReasonUserMessage(snapshot.reason, t)}</p>
|
|
198
|
-
<p className="studio-result__hint">{studioNonSuccessReasonUserAction(snapshot.reason, t)}</p>
|
|
200
|
+
<p>{studioNonSuccessReasonUserMessage(snapshot.reason, t, record.capabilityId, snapshot.diagnostics)}</p>
|
|
201
|
+
<p className="studio-result__hint">{studioNonSuccessReasonUserAction(snapshot.reason, t, record.capabilityId, snapshot.diagnostics)}</p>
|
|
199
202
|
<details className="studio-diag">
|
|
200
203
|
<summary>{t('StudioShell.runtimeDetails')}</summary>
|
|
201
204
|
<RuntimeDiagnosticsActions text={diagnosticsText} filenameBase={record.capabilityId} />
|
|
@@ -232,7 +235,7 @@ function TextStudioHistoryRecordResult({
|
|
|
232
235
|
<IconButton type="button" className="studio-result__action" onClick={() => onUseAsDraft(record)} aria-label={t('StudioShell.useAsDraft')} icon={<SquarePen size={16} aria-hidden="true" />} />
|
|
233
236
|
</Tooltip>
|
|
234
237
|
<Tooltip content={t('StudioShell.regenerate')} placement="top">
|
|
235
|
-
<IconButton type="button" className="studio-result__action" onClick={onRegenerate} aria-label={t('StudioShell.regenerate')} icon={<RefreshCw size={16} aria-hidden="true" />} />
|
|
238
|
+
<IconButton type="button" className="studio-result__action" onClick={onRegenerate} disabled={!canRegenerate} aria-label={t('StudioShell.regenerate')} icon={<RefreshCw size={16} aria-hidden="true" />} />
|
|
236
239
|
</Tooltip>
|
|
237
240
|
</div>
|
|
238
241
|
</div>
|
|
@@ -269,6 +272,9 @@ function TextStudioHistoryRecordResult({
|
|
|
269
272
|
|
|
270
273
|
function TextStudioHistorySnapshotBody({ snapshot }: { snapshot: Extract<StudioRunHistoryResultSnapshot, { ok: true }> }) {
|
|
271
274
|
const { translate: t } = useAIStudioHost();
|
|
275
|
+
if (snapshot.kind === 'vision-locate') return snapshot.result
|
|
276
|
+
? <VisionLocateResultView output={{kind:'vision-locate', jobId:snapshot.jobId, result:snapshot.result}} />
|
|
277
|
+
: <><p>{snapshot.summary}</p><p className="studio-result__hint">{t('VisionLocate.historySummaryOnly')}</p><pre>{JSON.stringify({ jobId: snapshot.jobId }, null, 2)}</pre></>;
|
|
272
278
|
if (snapshot.kind === 'text' || snapshot.kind === 'transcript') {
|
|
273
279
|
return <TextStudioOutputBody text={snapshot.body} />;
|
|
274
280
|
}
|
|
@@ -338,6 +344,7 @@ export function TextStudioResultState({
|
|
|
338
344
|
admission,
|
|
339
345
|
intentLabel,
|
|
340
346
|
running,
|
|
347
|
+
canRegenerate,
|
|
341
348
|
cancelRequested,
|
|
342
349
|
streamingText,
|
|
343
350
|
verboseConsole,
|
|
@@ -353,6 +360,7 @@ export function TextStudioResultState({
|
|
|
353
360
|
admission: ReturnType<typeof statusForCapability>;
|
|
354
361
|
intentLabel: string;
|
|
355
362
|
running: boolean;
|
|
363
|
+
canRegenerate: boolean;
|
|
356
364
|
cancelRequested: boolean;
|
|
357
365
|
streamingText: string | null;
|
|
358
366
|
verboseConsole: boolean;
|
|
@@ -388,6 +396,7 @@ export function TextStudioResultState({
|
|
|
388
396
|
<StudioResult
|
|
389
397
|
result={activeRun.result}
|
|
390
398
|
running={running}
|
|
399
|
+
canRegenerate={canRegenerate}
|
|
391
400
|
cancelRequested={cancelRequested}
|
|
392
401
|
registration={registration}
|
|
393
402
|
admission={admission}
|
|
@@ -395,6 +404,7 @@ export function TextStudioResultState({
|
|
|
395
404
|
intentLabel={intentLabel}
|
|
396
405
|
requestSettings={activeRun.record && hasTextStudioRequestSettings(activeRun.record) ? <TextStudioRequestSettings record={activeRun.record} /> : null}
|
|
397
406
|
streamingText={streamingText}
|
|
407
|
+
jobStatus={activeRun.jobStatus}
|
|
398
408
|
verboseConsole={verboseConsole}
|
|
399
409
|
onCopy={onCopy}
|
|
400
410
|
onDownload={onDownload}
|
|
@@ -403,7 +413,7 @@ export function TextStudioResultState({
|
|
|
403
413
|
/>
|
|
404
414
|
</>
|
|
405
415
|
) : activeRun.record ? (
|
|
406
|
-
<TextStudioHistoryRecordResult record={activeRun.record} onRegenerate={onRegenerate} onUseAsDraft={onUseAsDraft} />
|
|
416
|
+
<TextStudioHistoryRecordResult record={activeRun.record} canRegenerate={canRegenerate} onRegenerate={onRegenerate} onUseAsDraft={onUseAsDraft} />
|
|
407
417
|
) : null}
|
|
408
418
|
</article>
|
|
409
419
|
</div>
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
import type { StudioTranslate } from './non-success-presentation.js';
|
|
21
21
|
|
|
22
22
|
export type TextStudioActiveRun = {
|
|
23
|
+
jobStatus?: 'queued' | 'running';
|
|
23
24
|
id: string;
|
|
24
25
|
prompt: string;
|
|
25
26
|
context: string;
|
|
@@ -62,6 +63,7 @@ export function canConfigureRunTarget(runTarget: StudioRunTargetSummary): boolea
|
|
|
62
63
|
export function useStudioRunTargetSummary(
|
|
63
64
|
registration: StudioCapabilityRegistration,
|
|
64
65
|
runtime: StudioRuntimeInspection | null,
|
|
66
|
+
configOpen = false,
|
|
65
67
|
): StudioRunTargetSummary {
|
|
66
68
|
const host = useAIStudioHost();
|
|
67
69
|
const [configProjection, setConfigProjection] = useState<{
|
|
@@ -99,7 +101,7 @@ export function useStudioRunTargetSummary(
|
|
|
99
101
|
requestGeneration += 1;
|
|
100
102
|
unsubscribe();
|
|
101
103
|
};
|
|
102
|
-
}, [host]);
|
|
104
|
+
}, [host, configOpen]);
|
|
103
105
|
|
|
104
106
|
return useMemo(() => host.app.projection.projectRunTarget({
|
|
105
107
|
capability: registration.descriptor,
|
|
@@ -2,6 +2,7 @@ import { useEffect, useState, type ReactNode } from 'react';
|
|
|
2
2
|
import { EmptyState, IconButton, StatusBadge, Surface, Tooltip } from '@nimiplatform/kit/ui';
|
|
3
3
|
import { AlertTriangle, ChevronRight, Clock, Copy as CopyIcon, Download as DownloadIcon, FileText, FolderOpen, Loader2, RefreshCw, Sparkles, Square } from 'lucide-react';
|
|
4
4
|
import { useAIStudioHost } from './host-context.js';
|
|
5
|
+
import { VisionLocateResultView } from './section-ai-testing-vision-result.js';
|
|
5
6
|
import type { StudioCapabilityRunResult } from './runtime-types.js';
|
|
6
7
|
import type { StudioCapabilityDescriptor, StudioCapabilityRegistration } from './module-registration.js';
|
|
7
8
|
import { formatStudioRunTimestamp } from './history.js';
|
|
@@ -16,6 +17,7 @@ import { ArtifactMediaResult, RuntimeDiagnosticsActions, formatTypedOutput, form
|
|
|
16
17
|
function ReadyBody({ result }: { result: StudioCapabilityRunResult & { ok: true } }) {
|
|
17
18
|
const { translate: t } = useAIStudioHost();
|
|
18
19
|
const output = result.output;
|
|
20
|
+
if (output.kind === 'vision-locate') return <VisionLocateResultView output={output} />;
|
|
19
21
|
if (output.kind === 'text' || output.kind === 'transcript') {
|
|
20
22
|
return <TextStudioOutputBody text={output.text} />;
|
|
21
23
|
}
|
|
@@ -172,6 +174,7 @@ function studioResultIntentLabel(result: StudioCapabilityRunResult | null, capab
|
|
|
172
174
|
export function StudioResult({
|
|
173
175
|
result,
|
|
174
176
|
running,
|
|
177
|
+
canRegenerate,
|
|
175
178
|
cancelRequested,
|
|
176
179
|
registration,
|
|
177
180
|
admission,
|
|
@@ -179,6 +182,7 @@ export function StudioResult({
|
|
|
179
182
|
intentLabel,
|
|
180
183
|
requestSettings,
|
|
181
184
|
streamingText,
|
|
185
|
+
jobStatus,
|
|
182
186
|
verboseConsole,
|
|
183
187
|
onCopy,
|
|
184
188
|
onDownload,
|
|
@@ -187,6 +191,7 @@ export function StudioResult({
|
|
|
187
191
|
}: {
|
|
188
192
|
result: StudioCapabilityRunResult | null;
|
|
189
193
|
running: boolean;
|
|
194
|
+
canRegenerate: boolean;
|
|
190
195
|
cancelRequested: boolean;
|
|
191
196
|
registration: StudioCapabilityRegistration;
|
|
192
197
|
admission: CapabilityStatus;
|
|
@@ -194,6 +199,7 @@ export function StudioResult({
|
|
|
194
199
|
intentLabel?: string;
|
|
195
200
|
requestSettings?: ReactNode;
|
|
196
201
|
streamingText?: string | null;
|
|
202
|
+
jobStatus?: 'queued' | 'running';
|
|
197
203
|
verboseConsole: boolean;
|
|
198
204
|
onCopy: () => void;
|
|
199
205
|
onDownload: () => void;
|
|
@@ -276,6 +282,7 @@ export function StudioResult({
|
|
|
276
282
|
{ label: t('Studio.result.statResult'), value: t(output.creationSource === 'text-description' ? 'Studio.result.createdFromDescription' : 'Studio.result.createdFromAudio') },
|
|
277
283
|
];
|
|
278
284
|
}
|
|
285
|
+
if (output.kind === 'vision-locate') return [{ label: t('VisionLocate.matches'), value: String(output.result.locations.length) }];
|
|
279
286
|
return [
|
|
280
287
|
{ label: t('Studio.result.statVoices'), value: String(output.voiceCount) },
|
|
281
288
|
{ label: t('Studio.result.statResult'), value: fallbackMetric },
|
|
@@ -289,6 +296,7 @@ export function StudioResult({
|
|
|
289
296
|
else if (output.kind === 'artifacts') metric = t('Studio.result.metricArtifacts', { count: output.artifactCount });
|
|
290
297
|
else if (output.kind === 'embedding') metric = t('Studio.result.metricCreated');
|
|
291
298
|
else if (output.kind === 'voice-asset') metric = output.creationSource;
|
|
299
|
+
else if (output.kind === 'vision-locate') metric = String(output.result.locations.length);
|
|
292
300
|
else metric = t('Studio.result.metricVoices', { count: output.voiceCount });
|
|
293
301
|
}
|
|
294
302
|
const stats = studioResultStats(metric);
|
|
@@ -302,6 +310,7 @@ export function StudioResult({
|
|
|
302
310
|
<Loader2 size={15} aria-hidden="true" className="studio-spin" />
|
|
303
311
|
<span>{cancelRequested
|
|
304
312
|
? t('Studio.result.pendingCancel')
|
|
313
|
+
: capability.id === 'vision.locate' && jobStatus ? t(`VisionLocate.${jobStatus}`)
|
|
305
314
|
: profile.pendingLabelKey
|
|
306
315
|
? t(profile.pendingLabelKey)
|
|
307
316
|
: hasStream ? t('Studio.result.pendingStreaming') : t('Studio.result.pendingRuntime')}</span>
|
|
@@ -349,8 +358,8 @@ export function StudioResult({
|
|
|
349
358
|
<AlertTriangle size={15} aria-hidden="true" />
|
|
350
359
|
<span>{t('StudioShell.generationFailed')}</span>
|
|
351
360
|
</div>
|
|
352
|
-
<p>{studioNonSuccessReasonUserMessage(blocked.reason, t)}</p>
|
|
353
|
-
<p className="studio-result__hint">{studioNonSuccessReasonUserAction(blocked.reason, t)}</p>
|
|
361
|
+
<p>{studioNonSuccessReasonUserMessage(blocked.reason, t, blocked.capabilityId, blocked.diagnostics)}</p>
|
|
362
|
+
<p className="studio-result__hint">{studioNonSuccessReasonUserAction(blocked.reason, t, blocked.capabilityId, blocked.diagnostics)}</p>
|
|
354
363
|
</div>
|
|
355
364
|
);
|
|
356
365
|
} else if (ready) {
|
|
@@ -403,7 +412,7 @@ export function StudioResult({
|
|
|
403
412
|
</>
|
|
404
413
|
) : null}
|
|
405
414
|
<Tooltip content={t('StudioShell.regenerate')} placement="top">
|
|
406
|
-
<IconButton type="button" className="studio-result__action" onClick={onRegenerate} disabled={running} aria-label={t('StudioShell.regenerate')} icon={<RefreshCw size={15} aria-hidden="true" />} />
|
|
415
|
+
<IconButton type="button" className="studio-result__action" onClick={onRegenerate} disabled={running || !canRegenerate} aria-label={t('StudioShell.regenerate')} icon={<RefreshCw size={15} aria-hidden="true" />} />
|
|
407
416
|
</Tooltip>
|
|
408
417
|
</div>
|
|
409
418
|
</div>
|