@nimiplatform/app-tools 0.16.0-rc.14 → 0.16.0-rc.18

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.
Files changed (84) hide show
  1. package/README.md +5 -42
  2. package/bin/nimi-app.mjs +25 -6
  3. package/lib/app-dependency-combinations.mjs +1 -0
  4. package/lib/app-doctor-update.mjs +8 -6
  5. package/lib/app-info.mjs +39 -19
  6. package/lib/app-lifecycle-guidance.mjs +1 -1
  7. package/lib/app-pack.mjs +31 -13
  8. package/lib/app-project-lifecycle.mjs +32 -12
  9. package/lib/app-resources.mjs +36 -0
  10. package/lib/app-scaffold-profiles.mjs +72 -2
  11. package/lib/app-scaffold.mjs +11 -13
  12. package/lib/index.mjs +7 -0
  13. package/lib/public-storefront.mjs +327 -0
  14. package/lib/storefront-media.mjs +8 -4
  15. package/lib/storefront-pack.mjs +152 -0
  16. package/lib/storefront-release-verification.mjs +31 -0
  17. package/lib/storefront-source.mjs +161 -0
  18. package/lib/web-coordination.mjs +4 -1
  19. package/lib/web-scaffold.mjs +3 -3
  20. package/package.json +9 -6
  21. package/scripts/sync-app-source.mjs +5 -12
  22. package/skills/nimi-app-lifecycle/SKILL.md +1 -0
  23. package/skills/nimi-app-lifecycle/references/storefront.md +28 -0
  24. package/templates/app-source/src/ai-studio-core/ai-config.ts +12 -0
  25. package/templates/app-source/src/ai-studio-core/ai-studio-core.css +138 -117
  26. package/templates/app-source/src/ai-studio-core/history.ts +10 -8
  27. package/templates/app-source/src/ai-studio-core/host-context.tsx +1 -0
  28. package/templates/app-source/src/ai-studio-core/job-recovery-panel.tsx +15 -10
  29. package/templates/app-source/src/ai-studio-core/job-recovery.ts +505 -115
  30. package/templates/app-source/src/ai-studio-core/messages/en.json +55 -9
  31. package/templates/app-source/src/ai-studio-core/messages/zh.json +55 -9
  32. package/templates/app-source/src/ai-studio-core/non-success-presentation.ts +8 -2
  33. package/templates/app-source/src/ai-studio-core/parameter-fields.tsx +2 -0
  34. package/templates/app-source/src/ai-studio-core/parameters.ts +5 -4
  35. package/templates/app-source/src/ai-studio-core/run-target.ts +12 -1
  36. package/templates/app-source/src/ai-studio-core/runtime-types.ts +3 -0
  37. package/templates/app-source/src/ai-studio-core/runtime.ts +50 -12
  38. package/templates/app-source/src/ai-studio-core/section-ai-testing-composer.tsx +6 -7
  39. package/templates/app-source/src/ai-studio-core/section-ai-testing-history.tsx +88 -27
  40. package/templates/app-source/src/ai-studio-core/section-ai-testing-input.ts +33 -0
  41. package/templates/app-source/src/ai-studio-core/section-ai-testing-music-result.tsx +2 -2
  42. package/templates/app-source/src/ai-studio-core/section-ai-testing-output.tsx +10 -3
  43. package/templates/app-source/src/ai-studio-core/section-ai-testing-result.tsx +6 -4
  44. package/templates/app-source/src/ai-studio-core/section-ai-testing-run.ts +121 -40
  45. package/templates/app-source/src/ai-studio-core/section-ai-testing-studio-result.tsx +34 -8
  46. package/templates/app-source/src/ai-studio-core/section-ai-testing-transcript-result.tsx +16 -2
  47. package/templates/app-source/src/ai-studio-core/section-ai-testing-transcription-result.tsx +18 -7
  48. package/templates/app-source/src/ai-studio-core/section-ai-testing-vision-result.tsx +1 -1
  49. package/templates/app-source/src/ai-studio-core/section-ai-testing.tsx +78 -9
  50. package/templates/app-source/src/ai-studio-core/text-media-replay.ts +2 -1
  51. package/templates/app-source/src/ai-studio-core/workspace.tsx +138 -3
  52. package/templates/app-source/src/product-modules/agent-center/index.tsx +19 -3
  53. package/templates/app-source/src/product-modules/agent-conversation/index.tsx +19 -3
  54. package/templates/app-source/src/product-modules/agent-realtime/index.tsx +19 -3
  55. package/templates/app-source/src/product-modules/kit-recipes/gallery.tsx +12 -7
  56. package/templates/app-source/src/product-modules/kit-recipes/kit-component-gallery-surface.tsx +48 -20
  57. package/templates/app-source/src/studio-modules/studio-create/messages/en.json +2 -2
  58. package/templates/app-source/src/studio-modules/studio-create/messages/zh.json +2 -2
  59. package/templates/app-source/src/studio-modules/studio-create/registration.ts +1 -1
  60. package/templates/app-source/src/studio-modules/studio-create/runtime.ts +11 -19
  61. package/templates/app-source/src/studio-modules/studio-media/audio-separate-parameters.tsx +7 -4
  62. package/templates/app-source/src/studio-modules/studio-media/audio-separate-runtime.ts +14 -10
  63. package/templates/app-source/src/studio-modules/studio-media/messages/en.json +3 -1
  64. package/templates/app-source/src/studio-modules/studio-media/messages/zh.json +3 -1
  65. package/templates/app-source/src/studio-modules/studio-media/music-parameters.tsx +6 -5
  66. package/templates/app-source/src/studio-modules/studio-media/music-transcription-parameters.tsx +19 -11
  67. package/templates/app-source/src/studio-modules/studio-media/music-transcription-runtime.ts +14 -10
  68. package/templates/app-source/src/studio-modules/studio-media/parameter-panel.tsx +54 -16
  69. package/templates/app-source/src/studio-modules/studio-media/runtime.ts +22 -9
  70. package/templates/app-source/src/studio-modules/studio-media/vision-runtime.ts +19 -10
  71. package/templates/app-source/src/studio-modules/studio-media/voice-convert-parameters.tsx +12 -6
  72. package/templates/app-source/src/studio-modules/studio-media/voice-convert-runtime.ts +11 -9
  73. package/templates/app-source/src/studio-modules/studio-voice/messages/en.json +5 -0
  74. package/templates/app-source/src/studio-modules/studio-voice/messages/zh.json +5 -0
  75. package/templates/app-source/src/studio-modules/studio-voice/parameter-panel.tsx +18 -7
  76. package/templates/app-source/src/studio-modules/studio-voice/parameters.ts +28 -4
  77. package/templates/app-source/src/studio-modules/studio-voice/runtime.ts +12 -8
  78. package/templates/app-source/src/workbench-core/runtime-gate.tsx +171 -44
  79. package/templates/app-source/src/workbench-core/workbench-core.css +226 -23
  80. package/templates/app-source/src/workbench-core/workbench-core.tsx +5 -5
  81. package/templates/app-source.manifest.json +2 -2
  82. package/templates/default-starter/NIMI_APP.md +11 -3
  83. package/templates/default-starter.manifest.json +2 -2
  84. package/templates/storefront-release.yml +97 -0
@@ -2,6 +2,7 @@
2
2
  "Common": {
3
3
  "retry": "Retry",
4
4
  "close": "Close",
5
+ "undo": "Undo",
5
6
  "copy": "Copy",
6
7
  "copied": "Copied",
7
8
  "copyFailed": "Copy failed",
@@ -13,6 +14,26 @@
13
14
  "assetRevealFailed": "The folder could not be shown for {{path}}. The file has not been changed; try again when the host is available."
14
15
  },
15
16
  "History": {
17
+ "paramLabels": {
18
+ "tone": "Tone",
19
+ "length": "Length",
20
+ "attachments": "Attachments",
21
+ "temperature": "Temperature",
22
+ "maxTokens": "Max tokens",
23
+ "topP": "Top P",
24
+ "topK": "Top K",
25
+ "stop": "Stop sequences",
26
+ "seed": "Seed",
27
+ "presencePenalty": "Presence penalty",
28
+ "frequencyPenalty": "Frequency penalty"
29
+ },
30
+ "paramGroups": {
31
+ "prompt": "Prompt controls",
32
+ "generation": "Generation defaults",
33
+ "response": "Response controls",
34
+ "advanced": "Advanced settings",
35
+ "request": "Request parameters"
36
+ },
16
37
  "positionLoading": "Reading this saved result…",
17
38
  "positionUnavailable": "This saved result is unavailable. Retry reading it or go back to another page.",
18
39
  "title": "History",
@@ -93,6 +114,7 @@
93
114
  "deletedRecordAndAsset": "Record and managed asset deleted",
94
115
  "deleteAssetFailed": "Managed asset deletion failed; history was retained",
95
116
  "deleteFailed": "Delete failed, please retry",
117
+ "restoreFailed": "Could not restore the record. Please check history.",
96
118
  "clearScope": "Clear current scope",
97
119
  "clearScopeConfirm": "Click again to confirm",
98
120
  "cleared": "History cleared",
@@ -107,6 +129,7 @@
107
129
  "source": {
108
130
  "local": "Local",
109
131
  "cloud": "Cloud",
132
+ "external": "External",
110
133
  "unknown": "Unknown"
111
134
  },
112
135
  "canceled": "Canceled",
@@ -126,6 +149,12 @@
126
149
  "loadFailedTitle": "History failed to load",
127
150
  "saveFailedTitle": "History failed to save",
128
151
  "deleteRecordAndDocument": "Delete record and its saved result",
152
+ "confirmDeleteAssetTitle": "Delete record and managed asset?",
153
+ "confirmDeleteAssetMessage": "This permanently deletes both the history record and its managed media asset from App storage.",
154
+ "confirmDeleteDocumentTitle": "Delete record and saved result?",
155
+ "confirmDeleteDocumentMessage": "This permanently deletes both the history record and its saved result document from App storage.",
156
+ "confirmDeleteAction": "Delete permanently",
157
+ "cancelDeleteAction": "Cancel",
129
158
  "stopped": "Stopped"
130
159
  },
131
160
  "NonSuccess": {
@@ -168,11 +197,12 @@
168
197
  "voiceUnavailable": "The selected voice is no longer available.",
169
198
  "catalogStale": "The cloud model catalog changed after this model was chosen, so the saved choice has to be confirmed again. Nothing was sent to the cloud service.",
170
199
  "catalogMismatch": "This cloud embedding model has no verified fixed output size, so it cannot run. Nothing was sent to the cloud service.",
171
- "connectorDisabled": "The cloud connection this capability uses is turned off. Nothing was sent to the cloud service.",
172
- "connectorCredentialMissing": "The cloud connection this capability uses has no usable API key or sign-in. Nothing was sent to the cloud service.",
173
- "connectorNotFound": "The cloud connection this capability uses no longer exists. Nothing was sent to the cloud service.",
200
+ "connectorDisabled": "The selected connection is disabled. Further requests to this service are blocked.",
201
+ "connectorCredentialMissing": "The selected connection needs valid credentials for further requests.",
202
+ "connectorNotFound": "The selected connection no longer exists. Further requests to this service are blocked.",
174
203
  "configInvalid": "This capability's saved AI configuration can't run on the current Runtime, for example because its cloud service is no longer supported.",
175
204
  "modelNotFound": "The selected model is not available: its cloud account does not offer it, or no admitted implementation exists for it. Nothing was generated.",
205
+ "localAssetSlotMissing": "This request requires an optional companion model slot (such as ControlNet or multimodal vision projection) that is not bound in the current local Loadout. Nothing was generated.",
176
206
  "fallback": "The generation did not complete.",
177
207
  "stoppedDirectCall": "You stopped waiting for this call. A result that arrives later will not be shown.",
178
208
  "providerAuthFailed": "The cloud service rejected this connection's credentials. Its API key may be expired, revoked, or invalid.",
@@ -183,6 +213,8 @@
183
213
  "mediaStorageCleanup": "The task could not confirm ownership or deletion of an uploaded reference object."
184
214
  },
185
215
  "action": {
216
+ "verifyStoppedRequest": "Confirm the original outcome before trying again. If the request used a cloud provider, check its usage as well.",
217
+ "verifyStoppedLocalRequest": "Confirm that local execution has stopped before trying again.",
186
218
  "runtimeUnavailable": "Return to Desktop, confirm Local AI is connected, then try again.",
187
219
  "inputInvalid": "Review the prompt, required inputs and parameters, correct them, then run it again.",
188
220
  "transcriptionInputInvalid": "Choose a readable audio file and check its format and transcription settings before running again.",
@@ -196,6 +228,7 @@
196
228
  "contentFilterBlocked": "Try removing or redacting any restricted content, or adjusting the selected context, then submit your request again.",
197
229
  "inputLimitExceeded": "Shorten the input, or configure a model that accepts longer input, then run it again.",
198
230
  "textBehaviorUnsupported": "Open Parameters and reset the settings this model does not accept, or choose a model that supports this behavior in this App's AI configuration, then run again.",
231
+ "voiceInputUnsupported": "Check which input the selected model accepts. Reference audio may require an HTTPS URL. Choose a compatible model to use a file or text description.",
199
232
  "mediaOptionUnsupported": "Open Parameters and reset the unsupported settings, then run again. You can also choose a model that supports those settings in App AI configuration.",
200
233
  "embeddingPurposeUnsupported": "Open Parameters and choose \"Content to search\" when indexing documents or \"Search query\" when searching them, then run again. If that purpose is still unsupported, choose a model that supports it in App AI configuration.",
201
234
  "modalityUnsupported": "Change the request inputs or reset the unsupported options in Parameters before running again. You can also choose a configuration that supports the request.",
@@ -208,11 +241,12 @@
208
241
  "voiceUnavailable": "Open Parameters and choose an active voice compatible with this speech model. Repeating the deleted or expired voice request cannot restore it.",
209
242
  "catalogStale": "Open App AI configuration, choose this capability's model again from the current list, then run it again.",
210
243
  "catalogMismatch": "Open App AI configuration and choose an embedding model with a verified output size, then run it again.",
211
- "connectorDisabled": "Open App AI configuration and choose a model from an available cloud service or this device, then run it again.",
212
- "connectorCredentialMissing": "In Desktop Cloud Services, add an API key to this connection or sign in to it again, or open App AI configuration and choose another model, then run it again.",
213
- "connectorNotFound": "Open App AI configuration, choose a model for this capability again, then run it again.",
244
+ "connectorDisabled": "Open App AI configuration, choose an available execution source, and run again.",
245
+ "connectorCredentialMissing": "Update the connection credentials in Nimi Home or choose another execution source in App AI configuration.",
246
+ "connectorNotFound": "Open App AI configuration and choose an execution source for this capability again.",
214
247
  "configInvalid": "Open App AI configuration, choose a model for this capability again, then run it again.",
215
248
  "modelNotFound": "Open App AI configuration, choose an available model for this capability, then run it again.",
249
+ "localAssetSlotMissing": "Open App AI configuration to switch to a local Loadout with that companion slot bound, or bind the missing companion asset in Nimi Home and run again.",
216
250
  "fallback": "Try again. If it still fails, open Runtime details to find the cause.",
217
251
  "stoppedDirectCall": "Run it again whenever you are ready.",
218
252
  "providerAuthFailed": "Update this connection's API key or sign in again in Nimi Cloud Services, then submit a new request.",
@@ -225,7 +259,7 @@
225
259
  "hint": {
226
260
  "runtimeUnavailable": "Restore the protected Runtime connection, then retry the same request.",
227
261
  "inputInvalid": "Supply a valid request body for this capability, then retry.",
228
- "sdkMethodUnavailable": "Add an admitted SDK Nimi App execution method. Do not bypass Runtime with app-local REST.",
262
+ "sdkMethodUnavailable": "This capability is not exposed on the current SDK App client version. Update the SDK/App integration to use a supported Runtime operation.",
229
263
  "principalUnauthorized": "Runtime rejected the protected owner identity. Restore the admitted App session before retrying.",
230
264
  "operationAborted": "The SDK requested cancellation, but Runtime did not return a terminal state during the bounded follow-up lookup.",
231
265
  "runtimeCanceled": "Runtime durably canceled this ScenarioJob. Submit a new request only when another run is wanted.",
@@ -250,6 +284,7 @@
250
284
  "imagePreviewFailed": "The image preview could not be opened. Please try again.",
251
285
  "mediaPreviewFailed": "The saved media could not be loaded. Retry loading the existing result.",
252
286
  "closeImagePreview": "Close image preview",
287
+ "outputLimitReached": "The model reached its output limit before returning visible text. Increase or clear the maximum token count and run again.",
253
288
  "emptyBody": "(empty body)",
254
289
  "emptyTranscript": "(empty transcript)",
255
290
  "contextLabel": "Context",
@@ -335,6 +370,8 @@
335
370
  "intentSummary": "Next run · {{intent}}",
336
371
  "routeLocal": "Local",
337
372
  "routeCloud": "Cloud",
373
+ "routeExternal": "External",
374
+ "checkingTarget": "Checking configuration",
338
375
  "routeUnknown": "Route unknown"
339
376
  },
340
377
  "parameters": {
@@ -358,7 +395,8 @@
358
395
  "runtimeConnected": "Runtime connected",
359
396
  "runtimeChecking": "Checking Runtime",
360
397
  "runtimeUnavailable": "Runtime unavailable",
361
- "effectiveTargetUnavailable": "The configured target is unavailable. Check the selected model or Loadout.",
398
+ "targetChanged": "The model configuration changed. Review the current model, then run again.",
399
+ "effectiveTargetUnavailable": "The configured target is unavailable. Check its source in App AI configuration.",
362
400
  "retryPreparation": "Check again"
363
401
  },
364
402
  "drawerError": {
@@ -370,6 +408,7 @@
370
408
  "admissionLabel": "Admission",
371
409
  "reasonLabel": "Reason",
372
410
  "traceLabel": "Trace",
411
+ "jobStatus": { "queued": "Queued", "running": "Running" },
373
412
  "jobLabel": "Runtime job",
374
413
  "verboseConsoleNote": "Verbose console: capability {{capability}}; {{state}}.",
375
414
  "verboseTypedSuccess": "typed success",
@@ -418,6 +457,8 @@
418
457
  "pendingStreaming": "Generating a response...",
419
458
  "pendingRuntime": "Preparing and generating...",
420
459
  "pendingCancel": "Requesting cancellation from Runtime…",
460
+ "progressLabel": "Generation progress",
461
+ "progressSteps": "Reported stage: step {{current}} of {{total}}",
421
462
  "runTimeLabel": "Run / {{time}}",
422
463
  "runtimeChip": "AI generation",
423
464
  "createdFromDescription": "Text description",
@@ -432,7 +473,8 @@
432
473
  "spaceNotRecorded": "This older record did not keep its embedding space."
433
474
  },
434
475
  "job": {
435
- "known": "Job {{jobId}} was issued before this outcome. Runtime keeps a Job only for its retention period; saved App assets are the long-term record."
476
+ "known": "Job {{jobId}} was issued before this outcome. Runtime keeps a Job only for its retention period; saved App assets are the long-term record.",
477
+ "recoveryCleanupUnconfirmed": "Removal of the recovery record could not be confirmed. If it is still listed, you can remove it manually."
436
478
  },
437
479
  "stats": {
438
480
  "documents": "Documents",
@@ -442,6 +484,10 @@
442
484
  "questions": "Questions"
443
485
  },
444
486
  "transcript": {
487
+ "speaker": "Speaker",
488
+ "speakerIntervals": "Speaker intervals · {{count}} segments",
489
+ "moreIntervals": "Showing the first {{count}} intervals. Export the JSON for the full list.",
490
+ "noSpeakers": "No speakers were detected in this recording.",
445
491
  "title": "Speech transcription",
446
492
  "detectedLanguage": "Detected language: {{language}}",
447
493
  "words": "Timed words",
@@ -2,6 +2,7 @@
2
2
  "Common": {
3
3
  "retry": "重试",
4
4
  "close": "关闭",
5
+ "undo": "撤销",
5
6
  "copy": "复制",
6
7
  "copied": "已复制",
7
8
  "copyFailed": "复制失败",
@@ -13,6 +14,26 @@
13
14
  "assetRevealFailed": "无法显示 {{path}} 所在的文件夹。文件未被修改,请在宿主可用后重试。"
14
15
  },
15
16
  "History": {
17
+ "paramLabels": {
18
+ "tone": "语气",
19
+ "length": "长度",
20
+ "attachments": "附件数",
21
+ "temperature": "温度",
22
+ "maxTokens": "最大输出 Token 数",
23
+ "topP": "Top P",
24
+ "topK": "Top K",
25
+ "stop": "停止序列",
26
+ "seed": "随机种子",
27
+ "presencePenalty": "存在惩罚",
28
+ "frequencyPenalty": "频率惩罚"
29
+ },
30
+ "paramGroups": {
31
+ "prompt": "提示词设置",
32
+ "generation": "生成默认值",
33
+ "response": "回复设置",
34
+ "advanced": "高级设置",
35
+ "request": "请求参数"
36
+ },
16
37
  "positionLoading": "正在读取这条已保存的结果…",
17
38
  "positionUnavailable": "这条已保存的结果不可用。可以重试读取,或后退到其他页面。",
18
39
  "title": "历史",
@@ -93,6 +114,7 @@
93
114
  "deletedRecordAndAsset": "记录和托管资产已删除",
94
115
  "deleteAssetFailed": "托管资产删除失败,历史记录已保留",
95
116
  "deleteFailed": "删除失败,请重试",
117
+ "restoreFailed": "无法恢复该记录,请检查历史。",
96
118
  "clearScope": "清空当前范围",
97
119
  "clearScopeConfirm": "再次点击确认清空",
98
120
  "cleared": "历史已清空",
@@ -107,6 +129,7 @@
107
129
  "source": {
108
130
  "local": "本地",
109
131
  "cloud": "云端",
132
+ "external": "外部执行器",
110
133
  "unknown": "未知"
111
134
  },
112
135
  "canceled": "已取消",
@@ -126,6 +149,12 @@
126
149
  "loadFailedTitle": "历史加载失败",
127
150
  "saveFailedTitle": "历史保存失败",
128
151
  "deleteRecordAndDocument": "删除记录及其保存的结果",
152
+ "confirmDeleteAssetTitle": "删除记录和托管资产?",
153
+ "confirmDeleteAssetMessage": "此操作将从应用存储中永久删除该历史记录及其托管媒体资产。",
154
+ "confirmDeleteDocumentTitle": "删除记录及其保存的结果?",
155
+ "confirmDeleteDocumentMessage": "此操作将从应用存储中永久删除该历史记录及其保存的结果文档。",
156
+ "confirmDeleteAction": "永久删除",
157
+ "cancelDeleteAction": "取消",
129
158
  "stopped": "已停止"
130
159
  },
131
160
  "NonSuccess": {
@@ -168,11 +197,12 @@
168
197
  "voiceUnavailable": "选择的音色已不可用。",
169
198
  "catalogStale": "选择这个模型之后,云端模型目录已经更新,保存的选择需要重新确认。本次请求没有发送给云服务。",
170
199
  "catalogMismatch": "这个云端嵌入模型没有经过验证的固定输出维度,因此无法运行。本次请求没有发送给云服务。",
171
- "connectorDisabled": "此能力使用的云服务连接已停用。本次请求没有发送给云服务。",
172
- "connectorCredentialMissing": "此能力使用的云服务连接没有可用的 API 密钥或登录。本次请求没有发送给云服务。",
173
- "connectorNotFound": "此能力使用的云服务连接已不存在。本次请求没有发送给云服务。",
200
+ "connectorDisabled": "所选连接已停用,无法继续访问该服务。",
201
+ "connectorCredentialMissing": "所选连接缺少可用的凭证,无法继续访问该服务。",
202
+ "connectorNotFound": "所选连接已不存在,无法继续访问该服务。",
174
203
  "configInvalid": "此能力保存的 AI 配置无法在当前 Runtime 中运行,例如所用的云服务已不再支持。",
175
204
  "modelNotFound": "所选模型不可用:其云端账户未提供该模型,或没有可用的已准入实现。本次没有生成内容。",
205
+ "localAssetSlotMissing": "这次请求需要一个当前本机 Loadout 尚未绑定的可选伴生模型槽位(如 ControlNet 或多模态视觉投影组件)。本次没有生成内容。",
176
206
  "fallback": "本次生成未完成。",
177
207
  "stoppedDirectCall": "已停止等待这次调用,之后返回的结果不会显示。",
178
208
  "providerAuthFailed": "云服务拒绝了当前连接的凭据。API 密钥可能已过期、被撤销或无效。",
@@ -183,6 +213,8 @@
183
213
  "mediaStorageCleanup": "本任务未能确认已上传参考对象的归属或删除结果。"
184
214
  },
185
215
  "action": {
216
+ "verifyStoppedRequest": "请先确认原请求的执行结果,再决定是否重试。如果使用了云服务,请同时核对其用量。",
217
+ "verifyStoppedLocalRequest": "请先确认本机任务已停止,再决定是否重试。",
186
218
  "runtimeUnavailable": "返回 Desktop 确认本地 AI 已连接,然后重试。",
187
219
  "inputInvalid": "请检查提示词、必填输入和参数,修改后重新运行。",
188
220
  "transcriptionInputInvalid": "重新选择可读取的音频,并检查音频格式与转写参数后再运行。",
@@ -196,6 +228,7 @@
196
228
  "contentFilterBlocked": "请尝试移除或脱敏受限内容,或调整所选上下文后重新提交。",
197
229
  "inputLimitExceeded": "请缩短输入,或配置可接受更长输入的模型,然后重新运行。",
198
230
  "textBehaviorUnsupported": "打开「参数」并重置此模型不支持的设置,或在本 App 的 AI 配置中改选支持该行为的模型,再重新运行。",
231
+ "voiceInputUnsupported": "检查所选模型接受的创建方式。参考音频可能需要 HTTPS 地址,也可以选择支持文件或文字描述的模型。",
199
232
  "mediaOptionUnsupported": "打开「参数」重置不受支持的设置后重新运行,也可以在 App AI 配置中选择支持这些设置的模型。",
200
233
  "embeddingPurposeUnsupported": "打开「参数」,按任务选择「待检索内容」(建立索引)或「检索问题」(搜索),再重新运行。如果仍不支持该用途,可在 App AI 配置中选择支持它的模型。",
201
234
  "modalityUnsupported": "请先修改输入,或在「参数」中重置不受支持的设置后再运行,也可以选择支持这次请求的配置。",
@@ -208,11 +241,12 @@
208
241
  "voiceUnavailable": "打开「参数」选择当前模型兼容的有效音色;重复使用已删除或过期的音色无法恢复它。",
209
242
  "catalogStale": "打开 App AI 配置,从当前列表为此能力重新选择模型,然后重新运行。",
210
243
  "catalogMismatch": "打开 App AI 配置,选择已验证输出维度的嵌入模型,然后重新运行。",
211
- "connectorDisabled": "打开 App AI 配置,改选可用云服务或本机的模型,然后重新运行。",
212
- "connectorCredentialMissing": "在 Desktop 的「云服务」中为这个连接添加 API 密钥或重新登录,或打开 App AI 配置改选其他模型,然后重新运行。",
213
- "connectorNotFound": "打开 App AI 配置,为此能力重新选择模型,然后重新运行。",
244
+ "connectorDisabled": "打开 App AI 配置,选择可用的执行来源后重新运行。",
245
+ "connectorCredentialMissing": "在 Nimi Home 更新该连接的凭证,或在 App AI 配置中选择其他执行来源。",
246
+ "connectorNotFound": "打开 App AI 配置,为此能力重新选择执行来源。",
214
247
  "configInvalid": "打开 App AI 配置,为此能力重新选择模型,然后重新运行。",
215
248
  "modelNotFound": "打开 App AI 配置,为此能力选择一个可用的模型,然后重新运行。",
249
+ "localAssetSlotMissing": "打开 App AI 配置切换到已绑定对应伴生槽位的本机 Loadout,或在 Nimi Home 中补齐该伴生模型资产后再重新运行。",
216
250
  "fallback": "请重试;如果仍然失败,再展开 Runtime 详情查看原因。",
217
251
  "stoppedDirectCall": "准备好后可以直接重新运行。",
218
252
  "providerAuthFailed": "先在 Nimi 的「云服务」中更新此连接的密钥或重新登录,再提交新请求。",
@@ -225,7 +259,7 @@
225
259
  "hint": {
226
260
  "runtimeUnavailable": "恢复受保护的 Runtime 连接后重试同一请求。",
227
261
  "inputInvalid": "为此能力提供有效的请求体后重试。",
228
- "sdkMethodUnavailable": "添加一个已准入的 SDK Nimi App 执行方法。不要用 App 本地 REST 绕过 Runtime。",
262
+ "sdkMethodUnavailable": "当前 SDK App 客户端版本尚未提供此能力的调用方法,请升级 SDK 或在应用中使用受支持的 Runtime 接口。",
229
263
  "principalUnauthorized": "Runtime 拒绝了受保护的所有者身份。请先恢复已准入的 App 会话再重试。",
230
264
  "operationAborted": "SDK 已请求取消,但 Runtime 在一次有界后续查询中仍未返回终态。",
231
265
  "runtimeCanceled": "Runtime 已持久化取消此 ScenarioJob。仅在确实需要再次运行时提交新请求。",
@@ -250,6 +284,7 @@
250
284
  "imagePreviewFailed": "无法打开图片预览,请重试。",
251
285
  "mediaPreviewFailed": "未能加载已保存的媒体,请重试读取原结果。",
252
286
  "closeImagePreview": "关闭图片预览",
287
+ "outputLimitReached": "模型达到输出长度上限,未返回可见文本。请调高最大 Token 数或清空此设置,再运行一次。",
253
288
  "emptyBody": "(空内容)",
254
289
  "emptyTranscript": "(空转写)",
255
290
  "contextLabel": "上下文",
@@ -335,6 +370,8 @@
335
370
  "intentSummary": "下次运行 · {{intent}}",
336
371
  "routeLocal": "本地",
337
372
  "routeCloud": "云端",
373
+ "routeExternal": "外部执行器",
374
+ "checkingTarget": "正在检查配置",
338
375
  "routeUnknown": "路由未知"
339
376
  },
340
377
  "parameters": {
@@ -358,7 +395,8 @@
358
395
  "runtimeConnected": "Runtime 已连接",
359
396
  "runtimeChecking": "正在检查 Runtime",
360
397
  "runtimeUnavailable": "Runtime 不可用",
361
- "effectiveTargetUnavailable": "已配置的目标不可用。请检查所选模型或 Loadout。",
398
+ "targetChanged": "模型配置已更新。请确认当前模型,然后重新运行。",
399
+ "effectiveTargetUnavailable": "已配置的执行目标不可用。请在 App AI 配置中检查所选来源。",
362
400
  "retryPreparation": "重新检查"
363
401
  },
364
402
  "drawerError": {
@@ -370,6 +408,7 @@
370
408
  "admissionLabel": "准入",
371
409
  "reasonLabel": "原因",
372
410
  "traceLabel": "追踪",
411
+ "jobStatus": { "queued": "任务排队中", "running": "任务执行中" },
373
412
  "jobLabel": "Runtime 任务",
374
413
  "verboseConsoleNote": "详细控制台:能力 {{capability}};{{state}}。",
375
414
  "verboseTypedSuccess": "类型化成功",
@@ -418,6 +457,8 @@
418
457
  "pendingStreaming": "正在生成回复……",
419
458
  "pendingRuntime": "正在准备并生成……",
420
459
  "pendingCancel": "正在向 Runtime 请求取消……",
460
+ "progressLabel": "生成进度",
461
+ "progressSteps": "当前阶段:第 {{current}} / {{total}} 步",
421
462
  "runTimeLabel": "运行 / {{time}}",
422
463
  "runtimeChip": "AI 生成",
423
464
  "createdFromDescription": "文字描述",
@@ -432,7 +473,8 @@
432
473
  "spaceNotRecorded": "这条较早的记录没有保存向量空间。"
433
474
  },
434
475
  "job": {
435
- "known": "任务 {{jobId}} 在此结果前已发出。Runtime 只在保留期内保存任务,长期回看以已保存的 App 资产为准。"
476
+ "known": "任务 {{jobId}} 在此结果前已发出。Runtime 只在保留期内保存任务,长期回看以已保存的 App 资产为准。",
477
+ "recoveryCleanupUnconfirmed": "未能确认恢复记录已清除。若记录仍在恢复列表中,可以手动移除。"
436
478
  },
437
479
  "stats": {
438
480
  "documents": "文档",
@@ -442,6 +484,10 @@
442
484
  "questions": "问题"
443
485
  },
444
486
  "transcript": {
487
+ "speaker": "说话人",
488
+ "speakerIntervals": "说话人区间 · {{count}} 段",
489
+ "moreIntervals": "显示前 {{count}} 段;完整区间可导出为 JSON。",
490
+ "noSpeakers": "此录音未检出说话人。",
445
491
  "title": "语音转写",
446
492
  "detectedLanguage": "识别语言:{{language}}",
447
493
  "words": "带时间的词",
@@ -79,6 +79,7 @@ const TARGET_RESELECTION_KEY_SEGMENTS: ReadonlyMap<string, string> = new Map([
79
79
  ['AI_CONNECTOR_NOT_FOUND', 'connectorNotFound'],
80
80
  ['AI_CONFIG_INVALID', 'configInvalid'],
81
81
  ['AI_MODEL_NOT_FOUND', 'modelNotFound'],
82
+ ['AI_LOCAL_ASSET_SLOT_MISSING', 'localAssetSlotMissing'],
82
83
  ]);
83
84
 
84
85
  function targetReselectionKeySegment(diagnostics?: StudioNonSuccessDiagnostics): string {
@@ -104,7 +105,7 @@ export function studioNonSuccessReasonUserMessage(reason: string, translate: Stu
104
105
  const storage = capabilityId === 'video.generate' ? mediaStorageKeySegment(diagnostics) : '';
105
106
  if (storage) return translate(`NonSuccess.message.${storage}`);
106
107
  if (capabilityId === 'audio.synthesize' && diagnostics && UNAVAILABLE_VOICE_REASON_CODES.has(diagnostics.reasonCode)) return translate('NonSuccess.message.voiceUnavailable');
107
- if (reason === 'input-invalid' && (capabilityId === 'video.generate' || capabilityId === 'music.generate') && !diagnostics && appInputMessage) return appInputMessage;
108
+ if (reason === 'input-invalid' && (capabilityId === 'video.generate' || capabilityId === 'music.generate' || capabilityId === 'world.generate') && !diagnostics && appInputMessage) return appInputMessage;
108
109
  if (reason === 'input-invalid' && capabilityId === 'audio.transcribe') return translate('NonSuccess.message.transcriptionInputInvalid');
109
110
  if (capabilityId === 'audio.synthesize' && diagnostics?.reasonCode === VOICE_INPUT_INVALID_REASON_CODE) return translate('NonSuccess.message.voiceInputRequired');
110
111
  if (capabilityId === 'audio.synthesize' && diagnostics?.reasonCode === VOICE_TARGET_MISMATCH_REASON_CODE) return translate('NonSuccess.message.voiceTargetMismatch');
@@ -138,7 +139,11 @@ export function studioNonSuccessReasonUserAction(reason: string, translate: Stud
138
139
  if (capabilityId === 'audio.synthesize' && diagnostics?.reasonCode === VOICE_INPUT_INVALID_REASON_CODE) return translate('NonSuccess.action.voiceInputRequired');
139
140
  if (capabilityId === 'audio.synthesize' && diagnostics?.reasonCode === VOICE_TARGET_MISMATCH_REASON_CODE) return translate('NonSuccess.action.voiceTargetMismatch');
140
141
  if (capabilityId === 'vision.locate' && diagnostics?.reasonCode === 'AI_LOCAL_SELECTION_NOT_FOUND') return translate('VisionLocate.selectModelAction');
141
- if (isStoppedDirectCall(reason, capabilityId)) return translate('NonSuccess.action.stoppedDirectCall');
142
+ if (isStoppedDirectCall(reason, capabilityId)) {
143
+ if (diagnostics?.actionHint === 'confirm_outcome_and_charges_before_new_request') return translate('NonSuccess.action.verifyStoppedRequest');
144
+ if (diagnostics?.actionHint === 'confirm_local_execution_before_new_request') return translate('NonSuccess.action.verifyStoppedLocalRequest');
145
+ return translate('NonSuccess.action.stoppedDirectCall');
146
+ }
142
147
  if (diagnostics?.reasonCode === CONTENT_FILTER_BLOCKED_REASON_CODE) return translate('NonSuccess.action.contentFilterBlocked');
143
148
  if (diagnostics?.reasonCode === INPUT_LIMIT_EXCEEDED_REASON_CODE) return translate('NonSuccess.action.inputLimitExceeded');
144
149
  if (diagnostics?.reasonCode === TEXT_BEHAVIOR_UNSUPPORTED_REASON_CODE) return translate('NonSuccess.action.textBehaviorUnsupported');
@@ -147,6 +152,7 @@ export function studioNonSuccessReasonUserAction(reason: string, translate: Stud
147
152
  if (diagnostics?.reasonCode === LOCAL_CONFIGURATION_MISSING_REASON_CODE) return translate('NonSuccess.action.localConfigurationMissing');
148
153
  if (capabilityId === 'vision.locate' && diagnostics?.reasonCode === MEDIA_OPTION_UNSUPPORTED_REASON_CODE) return translate('VisionLocate.chooseSupportedGeometry');
149
154
  if (capabilityId === 'text.embed' && diagnostics?.reasonCode === MEDIA_OPTION_UNSUPPORTED_REASON_CODE) return translate('NonSuccess.action.embeddingPurposeUnsupported');
155
+ if (capabilityId === 'voice.create' && diagnostics?.reasonCode === MEDIA_OPTION_UNSUPPORTED_REASON_CODE) return translate('NonSuccess.action.voiceInputUnsupported');
150
156
  if (diagnostics?.reasonCode === MEDIA_OPTION_UNSUPPORTED_REASON_CODE) return translate('NonSuccess.action.mediaOptionUnsupported');
151
157
  if (diagnostics?.reasonCode === MODALITY_UNSUPPORTED_REASON_CODE) return translate('NonSuccess.action.modalityUnsupported');
152
158
  if (diagnostics?.reasonCode === PROVIDER_RATE_LIMITED_REASON_CODE) return translate('NonSuccess.action.providerRateLimited');
@@ -1,4 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
+ import type { NimiAIConfigEffectiveSelection } from '@nimiplatform/sdk/ai';
2
3
  import { Button, TextField, Toggle } from '@nimiplatform/kit/ui';
3
4
  import { ChevronDown } from 'lucide-react';
4
5
 
@@ -17,6 +18,7 @@ export type StudioParameterPanelProps = {
17
18
  readonly capabilityId: string;
18
19
  readonly contract: StudioParameterContract;
19
20
  readonly source: StudioRunTargetSource;
21
+ readonly effectiveSelection?: NimiAIConfigEffectiveSelection;
20
22
  readonly parameters: StudioParameterValue;
21
23
  readonly disabled: boolean;
22
24
  readonly onChange: (parameters: StudioParameterValue) => void;
@@ -1,6 +1,7 @@
1
+ import type { NimiAIConfigEffectiveSelection } from '@nimiplatform/sdk/ai';
1
2
  import type { StudioRunHistoryResultSnapshot } from './history.js';
2
3
 
3
- export type StudioRunTargetSource = 'local' | 'cloud' | 'unknown';
4
+ export type StudioRunTargetSource = 'local' | 'cloud' | 'external' | 'unknown';
4
5
 
5
6
  export type StudioParameterRouteState =
6
7
  | { readonly kind: 'supported' }
@@ -35,7 +36,7 @@ export type StudioParameterContract = {
35
36
  readonly initial: () => StudioParameterValue;
36
37
  readonly summarize: (parameters: StudioParameterValue) => Readonly<Record<string, unknown>>;
37
38
  readonly hasAlternativeInput: (parameters: StudioParameterValue) => boolean;
38
- readonly requiredInputIssue?: (parameters: StudioParameterValue) => string | undefined;
39
+ readonly requiredInputIssue?: (parameters: StudioParameterValue, selection?: NimiAIConfigEffectiveSelection, prompt?: string) => string | undefined;
39
40
  readonly presentation: (source: StudioRunTargetSource) => readonly StudioParameterPresentation[];
40
41
  readonly project: (source: StudioRunTargetSource, parameters: StudioParameterValue) => StudioParameterValue;
41
42
  readonly recordedInput?: StudioRecordedParameterInput;
@@ -49,7 +50,7 @@ export type TypedStudioParameterContract<TParameters extends object> = {
49
50
  readonly initial: () => TParameters;
50
51
  readonly summarize?: (parameters: TParameters) => Readonly<Record<string, unknown>>;
51
52
  readonly hasAlternativeInput?: (parameters: TParameters) => boolean;
52
- readonly requiredInputIssue?: (parameters: TParameters) => string | undefined;
53
+ readonly requiredInputIssue?: (parameters: TParameters, selection?: NimiAIConfigEffectiveSelection, prompt?: string) => string | undefined;
53
54
  readonly routeMatrix: StudioParameterRouteMatrix;
54
55
  readonly recordedInput?: {
55
56
  readonly encode: (parameters: TParameters) => string;
@@ -99,7 +100,7 @@ export function defineStudioParameters<TParameters extends object>(
99
100
  : undefined;
100
101
  return Object.freeze({
101
102
  initial, summarize, hasAlternativeInput, presentation, project,
102
- ...(requiredInputIssue ? { requiredInputIssue: (parameters: StudioParameterValue) => requiredInputIssue(parameters as TParameters) } : {}),
103
+ ...(requiredInputIssue ? { requiredInputIssue: (parameters: StudioParameterValue, selection?: NimiAIConfigEffectiveSelection, prompt?: string) => requiredInputIssue(parameters as TParameters, selection, prompt) } : {}),
103
104
  ...(recordedInput ? { recordedInput } : {}),
104
105
  ...(typed.restoreRecordedParameters ? { restoreRecordedParameters: (snapshot: Readonly<Record<string, unknown>> | undefined, result?: StudioRunHistoryResultSnapshot, recordedPrompt?: string) => typed.restoreRecordedParameters!(snapshot, result, recordedPrompt) as StudioParameterValue | null } : {}),
105
106
  });
@@ -3,6 +3,7 @@ import type { NimiPortableAppAIConfig } from '@nimiplatform/sdk/ai';
3
3
  import {
4
4
  findStudioCapabilityIntent,
5
5
  studioCloudIntentHasExactTarget,
6
+ studioExternalIntentHasExactTarget,
6
7
  } from './ai-config.js';
7
8
  import type { StudioRunTargetSummary } from './history.js';
8
9
  import type { StudioCapabilityDescriptor } from './module-registration.js';
@@ -111,13 +112,23 @@ export function createStudioRunTargetSummary(input: {
111
112
  canDispatch: true,
112
113
  };
113
114
  }
115
+ if (intent.route.oneofKind === 'external' && studioExternalIntentHasExactTarget(intent)) {
116
+ return {
117
+ ...base,
118
+ status: 'configured',
119
+ source: 'external',
120
+ intentLabel: 'External',
121
+ detail: 'The App owner committed a registered External executor and target. External executors run outside Nimi and do not inherit Nimi on-device local privacy guarantees.',
122
+ canDispatch: true,
123
+ };
124
+ }
114
125
 
115
126
  return {
116
127
  ...base,
117
128
  status: 'blocked',
118
129
  source: 'unknown',
119
130
  intentLabel: 'Invalid configuration',
120
- detail: 'The capability has no supported Local or Cloud intent.',
131
+ detail: 'The capability has no supported Local, Cloud, or External intent.',
121
132
  canDispatch: false,
122
133
  };
123
134
  }
@@ -182,6 +182,9 @@ export type StudioNonSuccess = {
182
182
  readonly actionHint: string;
183
183
  readonly missingSurface?: string;
184
184
  readonly diagnostics?: StudioNonSuccessDiagnostics;
185
+ // Owner-confirmed FAILED, CANCELED or TIMEOUT on this exact Job.
186
+ readonly terminalJobFailure?: true;
187
+ readonly recoveryCleanupUnconfirmed?: true;
185
188
  // Present only when the owner had already issued the Job before it ended.
186
189
  readonly jobId?: string;
187
190
  };
@@ -1,5 +1,18 @@
1
1
  import { verifyStudioManagedAsset } from './managed-result-references.js';
2
- import { beginStudioJobRecovery, captureStudioJobRecoveryJobId, isStudioJobRecoveryCapability, readStudioJobRecovery, recoverStudioJobId, restoreSavedStudioJobResult, saveStudioJobRecoveryResult, studioJobRecoverySignal, type StudioJobRecoveryDetails } from './job-recovery.js';
2
+ import {
3
+ beginStudioJobRecovery,
4
+ StudioRecoveryWriteUnconfirmed,
5
+ captureStudioJobRecoveryJobId,
6
+ reconcileStudioSubmitRejection,
7
+ isStudioJobRecoveryCapability,
8
+ readStudioJobRecovery,
9
+ recoverStudioJobId,
10
+ restoreSavedStudioJobResult,
11
+ saveStudioJobRecoveryResult,
12
+ studioJobRecoverySignal,
13
+ type StudioJobRecoveryDetails,
14
+ } from './job-recovery.js';
15
+ import { getNimiRuntimeScenarioJobTerminalStatusFromError } from '@nimiplatform/sdk/runtime';
3
16
  import { ScenarioType } from '@nimiplatform/sdk/runtime/generated';
4
17
  import {
5
18
  runRuntimeAIConsumeCapability,
@@ -172,7 +185,7 @@ export async function runStudioCapability(
172
185
  const result = await dispatched;
173
186
  if (result.ok) studioJobRecoverySignal(input).throwIfAborted();
174
187
  if (context.jobActionId && isStudioJobRecoveryCapability(capability.id)) {
175
- await saveStudioJobRecoveryResult(context.host.client.storage, context.jobActionId, result, capability.id);
188
+ return await saveStudioJobRecoveryResult(context.host.client.storage.assets, context.jobActionId, result, capability.id);
176
189
  }
177
190
  return result;
178
191
  }
@@ -193,7 +206,11 @@ export async function runStudioCapability(
193
206
  `No Runtime handler is registered for ${capability.id}.`,
194
207
  );
195
208
  } catch (error) {
196
- return projectStudioRuntimeError(context, error);
209
+ const result = projectStudioRuntimeError(context, error);
210
+ if (result.terminalJobFailure && context.jobActionId && isStudioJobRecoveryCapability(capability.id)) {
211
+ return saveStudioJobRecoveryResult(context.host.client.storage.assets, context.jobActionId, result, capability.id);
212
+ }
213
+ return result;
197
214
  }
198
215
  }
199
216
 
@@ -209,7 +226,15 @@ export function createStudioScenarioJobClient(context: StudioCapabilityRuntimeCo
209
226
  const id = await beginStudioJobAction(context, details);
210
227
  context.input.signal?.throwIfAborted();
211
228
  context.input.observationSignal?.throwIfAborted();
212
- const response = await client.submitScenarioJob({ ...request, idempotencyKey: id }, options);
229
+ let response;
230
+ try {
231
+ response = await client.submitScenarioJob({ ...request, idempotencyKey: id }, options);
232
+ } catch (cause) {
233
+ if (isStudioJobRecoveryCapability(context.capability.id)) {
234
+ await reconcileStudioSubmitRejection(context.host.client, context.capability.id, id, cause);
235
+ }
236
+ throw cause;
237
+ }
213
238
  await captureStudioJobAction(context, id, response.job?.jobId ?? '');
214
239
  return response;
215
240
  } };
@@ -219,15 +244,20 @@ export async function beginStudioJobAction(context: StudioCapabilityRuntimeConte
219
244
  context.input.signal?.throwIfAborted();
220
245
  context.input.observationSignal?.throwIfAborted();
221
246
  if (!isStudioJobRecoveryCapability(context.capability.id)) throw new Error('This capability has no saved Job action');
222
- const id = await beginStudioJobRecovery(context.host.client.storage, context.capability.id, undefined, undefined, undefined,
223
- context.input.recordedRunConfig, context.input.recordedPrompt ?? context.input.prompt, details);
224
- context.jobActionId = id;
225
- return id;
247
+ try {
248
+ const id = await beginStudioJobRecovery(context.host.client.storage.assets, context.capability.id, undefined, undefined, undefined,
249
+ context.input.recordedRunConfig, context.input.recordedPrompt ?? context.input.prompt, details);
250
+ context.jobActionId = id;
251
+ return id;
252
+ } catch (cause) {
253
+ if (cause instanceof StudioRecoveryWriteUnconfirmed) context.jobActionId = cause.submissionId;
254
+ throw cause;
255
+ }
226
256
  }
227
257
 
228
258
  export async function captureStudioJobAction(context: StudioCapabilityRuntimeContext, id: string, jobId: string): Promise<void> {
229
259
  if (!isStudioJobRecoveryCapability(context.capability.id)) throw new Error('Unknown Job capability');
230
- await captureStudioJobRecoveryJobId(context.host.client.storage, id, jobId, context.capability.id);
260
+ await captureStudioJobRecoveryJobId(context.host.client.storage.assets, id, jobId, context.capability.id);
231
261
  }
232
262
 
233
263
  /** Reopening a business action only resolves its original identity. */
@@ -235,7 +265,7 @@ export async function recoverStudioJobAction(context: StudioCapabilityRuntimeCon
235
265
  const id = context.input.parameters?.recoverySubmissionId;
236
266
  if (id === undefined) return null;
237
267
  if (typeof id !== 'string' || !isStudioJobRecoveryCapability(context.capability.id)) throw new Error('Invalid saved action');
238
- const entry = (await readStudioJobRecovery(context.host.client.storage, context.capability.id)).find(item => item.clientSubmissionId === id);
268
+ const entry = (await readStudioJobRecovery(context.host.client.storage.assets, context.capability.id)).find(item => item.clientSubmissionId === id);
239
269
  if (!entry || entry.details?.scenarioType !== scenarioType) throw new Error(context.host.translate('Music.recoveryMissing'));
240
270
  context.jobActionId = id;
241
271
  const saved = await restoreSavedStudioJobResult(entry, context.capability.label, context.capability.id, context.host.client.storage.assets, studioJobRecoverySignal(context.input));
@@ -247,7 +277,15 @@ export async function submitStudioLocalJob(context: StudioCapabilityRuntimeConte
247
277
  const id = await beginStudioJobAction(context, details);
248
278
  context.input.signal?.throwIfAborted();
249
279
  context.input.observationSignal?.throwIfAborted();
250
- const response = await context.host.client.ai.scenarioJobs.submit(spec, { clientSubmissionId: id });
280
+ let response;
281
+ try {
282
+ response = await context.host.client.ai.scenarioJobs.submit(spec, { clientSubmissionId: id });
283
+ } catch (cause) {
284
+ if (isStudioJobRecoveryCapability(context.capability.id)) {
285
+ await reconcileStudioSubmitRejection(context.host.client, context.capability.id, id, cause);
286
+ }
287
+ throw cause;
288
+ }
251
289
  await captureStudioJobAction(context, id, response.job.jobId);
252
290
  return response;
253
291
  }
@@ -426,7 +464,7 @@ function withStudioKnownJob(result: StudioNonSuccess, error: unknown): StudioNon
426
464
  ? record.details as { jobId?: unknown } : null;
427
465
  const id = details?.jobId;
428
466
  return typeof id === 'string' && /^[A-Za-z0-9_.:-]{1,128}$/u.test(id)
429
- ? { ...result, jobId: id }
467
+ ? { ...result, jobId: id, ...(getNimiRuntimeScenarioJobTerminalStatusFromError(error) !== null ? { terminalJobFailure: true as const } : {}) }
430
468
  : result;
431
469
  }
432
470