@nimiplatform/sdk 0.22.2 → 0.24.0-rc.11

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 (319) hide show
  1. package/CHANGELOG.md +215 -0
  2. package/README.md +32 -1
  3. package/dist/core/ai/capability-configuration.d.ts +36 -1
  4. package/dist/core/ai/capability-configuration.d.ts.map +1 -1
  5. package/dist/core/ai/capability-configuration.js +59 -3
  6. package/dist/core/ai/capability-configuration.js.map +1 -1
  7. package/dist/core/ai/index.d.ts +1 -0
  8. package/dist/core/ai/index.d.ts.map +1 -1
  9. package/dist/core/ai/index.js +1 -0
  10. package/dist/core/ai/index.js.map +1 -1
  11. package/dist/core/ai/local-app-model.d.ts +3 -0
  12. package/dist/core/ai/local-app-model.d.ts.map +1 -1
  13. package/dist/core/ai/local-app-model.js +7 -7
  14. package/dist/core/ai/local-app-model.js.map +1 -1
  15. package/dist/core/ai/reasoning.d.ts +3 -1
  16. package/dist/core/ai/reasoning.d.ts.map +1 -1
  17. package/dist/core/ai/reasoning.js +2 -1
  18. package/dist/core/ai/reasoning.js.map +1 -1
  19. package/dist/core/app/desktop-open.d.ts +17 -4
  20. package/dist/core/app/desktop-open.d.ts.map +1 -1
  21. package/dist/core/app/desktop-open.js +46 -6
  22. package/dist/core/app/desktop-open.js.map +1 -1
  23. package/dist/core/app/index.d.ts +8 -2
  24. package/dist/core/app/index.d.ts.map +1 -1
  25. package/dist/core/app/index.js +3 -0
  26. package/dist/core/app/index.js.map +1 -1
  27. package/dist/core/app/local-app-agent-work-input.d.ts +1 -1
  28. package/dist/core/app/local-app-agent-work-input.d.ts.map +1 -1
  29. package/dist/core/app/local-app-agent-work-input.js +5 -2
  30. package/dist/core/app/local-app-agent-work-input.js.map +1 -1
  31. package/dist/core/app/local-app-character-discovery.d.ts +44 -0
  32. package/dist/core/app/local-app-character-discovery.d.ts.map +1 -0
  33. package/dist/core/app/local-app-character-discovery.js +82 -0
  34. package/dist/core/app/local-app-character-discovery.js.map +1 -0
  35. package/dist/core/app/local-app-runtime-platform-activity-view.d.ts +2 -0
  36. package/dist/core/app/local-app-runtime-platform-activity-view.d.ts.map +1 -1
  37. package/dist/core/app/local-app-runtime-platform-activity-view.js +4 -1
  38. package/dist/core/app/local-app-runtime-platform-activity-view.js.map +1 -1
  39. package/dist/core/app/local-app-runtime-platform-activity.d.ts +2 -2
  40. package/dist/core/app/local-app-runtime-platform-activity.d.ts.map +1 -1
  41. package/dist/core/app/local-app-runtime-platform-activity.js +2 -0
  42. package/dist/core/app/local-app-runtime-platform-activity.js.map +1 -1
  43. package/dist/core/app/local-app-runtime-platform-agent-work.js +1 -1
  44. package/dist/core/app/local-app-runtime-platform-agent-work.js.map +1 -1
  45. package/dist/core/app/local-app-runtime-platform-ai-config.d.ts +3 -3
  46. package/dist/core/app/local-app-runtime-platform-ai-config.d.ts.map +1 -1
  47. package/dist/core/app/local-app-runtime-platform-ai-config.js +25 -7
  48. package/dist/core/app/local-app-runtime-platform-ai-config.js.map +1 -1
  49. package/dist/core/app/local-app-runtime-platform-ai.d.ts +32 -3
  50. package/dist/core/app/local-app-runtime-platform-ai.d.ts.map +1 -1
  51. package/dist/core/app/local-app-runtime-platform-ai.js +128 -28
  52. package/dist/core/app/local-app-runtime-platform-ai.js.map +1 -1
  53. package/dist/core/app/local-app-runtime-platform-assets.d.ts +2 -0
  54. package/dist/core/app/local-app-runtime-platform-assets.d.ts.map +1 -1
  55. package/dist/core/app/local-app-runtime-platform-assets.js +5 -2
  56. package/dist/core/app/local-app-runtime-platform-assets.js.map +1 -1
  57. package/dist/core/app/local-app-runtime-platform-direct-agent-work.d.ts.map +1 -1
  58. package/dist/core/app/local-app-runtime-platform-direct-agent-work.js +15 -4
  59. package/dist/core/app/local-app-runtime-platform-direct-agent-work.js.map +1 -1
  60. package/dist/core/app/local-app-runtime-platform-direct-ai-realtime.d.ts.map +1 -1
  61. package/dist/core/app/local-app-runtime-platform-direct-ai-realtime.js +33 -4
  62. package/dist/core/app/local-app-runtime-platform-direct-ai-realtime.js.map +1 -1
  63. package/dist/core/app/local-app-runtime-platform-direct-realtime-shared.d.ts.map +1 -1
  64. package/dist/core/app/local-app-runtime-platform-direct-realtime-shared.js +1 -0
  65. package/dist/core/app/local-app-runtime-platform-direct-realtime-shared.js.map +1 -1
  66. package/dist/core/app/local-app-runtime-platform-integration.d.ts +13 -0
  67. package/dist/core/app/local-app-runtime-platform-integration.d.ts.map +1 -1
  68. package/dist/core/app/local-app-runtime-platform-integration.js +89 -15
  69. package/dist/core/app/local-app-runtime-platform-integration.js.map +1 -1
  70. package/dist/core/app/local-app-runtime-platform-realm-realtime.js +1 -1
  71. package/dist/core/app/local-app-runtime-platform-realm-realtime.js.map +1 -1
  72. package/dist/core/app/local-app-runtime-platform-realtime.d.ts +55 -10
  73. package/dist/core/app/local-app-runtime-platform-realtime.d.ts.map +1 -1
  74. package/dist/core/app/local-app-runtime-platform-realtime.js +66 -23
  75. package/dist/core/app/local-app-runtime-platform-realtime.js.map +1 -1
  76. package/dist/core/app/local-app-runtime-platform-utopia.d.ts +208 -0
  77. package/dist/core/app/local-app-runtime-platform-utopia.d.ts.map +1 -0
  78. package/dist/core/app/local-app-runtime-platform-utopia.js +629 -0
  79. package/dist/core/app/local-app-runtime-platform-utopia.js.map +1 -0
  80. package/dist/core/app/local-app-runtime-platform-world-creator.d.ts +2 -0
  81. package/dist/core/app/local-app-runtime-platform-world-creator.d.ts.map +1 -1
  82. package/dist/core/app/local-app-runtime-platform-world-creator.js +8 -6
  83. package/dist/core/app/local-app-runtime-platform-world-creator.js.map +1 -1
  84. package/dist/core/app/local-app-runtime-platform.d.ts +7 -3
  85. package/dist/core/app/local-app-runtime-platform.d.ts.map +1 -1
  86. package/dist/core/app/local-app-runtime-platform.js +22 -112
  87. package/dist/core/app/local-app-runtime-platform.js.map +1 -1
  88. package/dist/core/app/local-app-text-candidate.d.ts +3 -0
  89. package/dist/core/app/local-app-text-candidate.d.ts.map +1 -0
  90. package/dist/core/app/local-app-text-candidate.js +100 -0
  91. package/dist/core/app/local-app-text-candidate.js.map +1 -0
  92. package/dist/core/app/local-app-text.d.ts +6 -0
  93. package/dist/core/app/local-app-text.d.ts.map +1 -1
  94. package/dist/core/app/local-app-text.js +19 -4
  95. package/dist/core/app/local-app-text.js.map +1 -1
  96. package/dist/core/app/portable-client.d.ts +17 -0
  97. package/dist/core/app/portable-client.d.ts.map +1 -0
  98. package/dist/core/app/portable-client.js +2 -0
  99. package/dist/core/app/portable-client.js.map +1 -0
  100. package/dist/core/app/runtime-account-realm-source-readiness.generated.d.ts +2 -2
  101. package/dist/core/app/runtime-account-realm-source-readiness.generated.d.ts.map +1 -1
  102. package/dist/core/app/runtime-account-realm-source-readiness.generated.js +11 -1
  103. package/dist/core/app/runtime-account-realm-source-readiness.generated.js.map +1 -1
  104. package/dist/core/contracts/primitives.d.ts +8 -0
  105. package/dist/core/contracts/primitives.d.ts.map +1 -1
  106. package/dist/core/contracts/primitives.js.map +1 -1
  107. package/dist/core-client/index.d.ts +3 -1
  108. package/dist/core-client/index.d.ts.map +1 -1
  109. package/dist/core-client/index.js +13 -2
  110. package/dist/core-client/index.js.map +1 -1
  111. package/dist/core-generated/realm-client.d.ts.map +1 -1
  112. package/dist/core-generated/realm-client.js +166 -4
  113. package/dist/core-generated/realm-client.js.map +1 -1
  114. package/dist/core-generated/realm-typed-client.d.ts +715 -28
  115. package/dist/core-generated/realm-typed-client.d.ts.map +1 -1
  116. package/dist/core-generated/realm-typed-client.js +333 -6
  117. package/dist/core-generated/realm-typed-client.js.map +1 -1
  118. package/dist/core-generated/runtime-client.d.ts.map +1 -1
  119. package/dist/core-generated/runtime-client.js +112 -0
  120. package/dist/core-generated/runtime-client.js.map +1 -1
  121. package/dist/core-generated/runtime-protobuf/runtime/v1/account.d.ts +137 -0
  122. package/dist/core-generated/runtime-protobuf/runtime/v1/account.d.ts.map +1 -1
  123. package/dist/core-generated/runtime-protobuf/runtime/v1/account.js +314 -1
  124. package/dist/core-generated/runtime-protobuf/runtime/v1/account.js.map +1 -1
  125. package/dist/core-generated/runtime-protobuf/runtime/v1/agent_service.d.ts +154 -0
  126. package/dist/core-generated/runtime-protobuf/runtime/v1/agent_service.d.ts.map +1 -1
  127. package/dist/core-generated/runtime-protobuf/runtime/v1/agent_service.js +343 -0
  128. package/dist/core-generated/runtime-protobuf/runtime/v1/agent_service.js.map +1 -1
  129. package/dist/core-generated/runtime-protobuf/runtime/v1/agent_utopia.d.ts +985 -0
  130. package/dist/core-generated/runtime-protobuf/runtime/v1/agent_utopia.d.ts.map +1 -0
  131. package/dist/core-generated/runtime-protobuf/runtime/v1/agent_utopia.js +2132 -0
  132. package/dist/core-generated/runtime-protobuf/runtime/v1/agent_utopia.js.map +1 -0
  133. package/dist/core-generated/runtime-protobuf/runtime/v1/ai.d.ts +322 -3
  134. package/dist/core-generated/runtime-protobuf/runtime/v1/ai.d.ts.map +1 -1
  135. package/dist/core-generated/runtime-protobuf/runtime/v1/ai.js +578 -8
  136. package/dist/core-generated/runtime-protobuf/runtime/v1/ai.js.map +1 -1
  137. package/dist/core-generated/runtime-protobuf/runtime/v1/ai_realtime.d.ts +229 -1
  138. package/dist/core-generated/runtime-protobuf/runtime/v1/ai_realtime.d.ts.map +1 -1
  139. package/dist/core-generated/runtime-protobuf/runtime/v1/ai_realtime.js +432 -7
  140. package/dist/core-generated/runtime-protobuf/runtime/v1/ai_realtime.js.map +1 -1
  141. package/dist/core-generated/runtime-protobuf/runtime/v1/app.d.ts +313 -0
  142. package/dist/core-generated/runtime-protobuf/runtime/v1/app.d.ts.map +1 -1
  143. package/dist/core-generated/runtime-protobuf/runtime/v1/app.js +708 -3
  144. package/dist/core-generated/runtime-protobuf/runtime/v1/app.js.map +1 -1
  145. package/dist/core-generated/runtime-protobuf/runtime/v1/audit.d.ts +31 -0
  146. package/dist/core-generated/runtime-protobuf/runtime/v1/audit.d.ts.map +1 -1
  147. package/dist/core-generated/runtime-protobuf/runtime/v1/audit.js +62 -1
  148. package/dist/core-generated/runtime-protobuf/runtime/v1/audit.js.map +1 -1
  149. package/dist/core-generated/runtime-protobuf/runtime/v1/auth.d.ts +33 -0
  150. package/dist/core-generated/runtime-protobuf/runtime/v1/auth.d.ts.map +1 -1
  151. package/dist/core-generated/runtime-protobuf/runtime/v1/auth.js +76 -0
  152. package/dist/core-generated/runtime-protobuf/runtime/v1/auth.js.map +1 -1
  153. package/dist/core-generated/runtime-protobuf/runtime/v1/capability_configuration.d.ts +155 -0
  154. package/dist/core-generated/runtime-protobuf/runtime/v1/capability_configuration.d.ts.map +1 -1
  155. package/dist/core-generated/runtime-protobuf/runtime/v1/capability_configuration.js +290 -6
  156. package/dist/core-generated/runtime-protobuf/runtime/v1/capability_configuration.js.map +1 -1
  157. package/dist/core-generated/runtime-protobuf/runtime/v1/common.d.ts +31 -1
  158. package/dist/core-generated/runtime-protobuf/runtime/v1/common.d.ts.map +1 -1
  159. package/dist/core-generated/runtime-protobuf/runtime/v1/common.js +30 -0
  160. package/dist/core-generated/runtime-protobuf/runtime/v1/common.js.map +1 -1
  161. package/dist/core-generated/runtime-protobuf/runtime/v1/connector.d.ts +298 -0
  162. package/dist/core-generated/runtime-protobuf/runtime/v1/connector.d.ts.map +1 -1
  163. package/dist/core-generated/runtime-protobuf/runtime/v1/connector.js +611 -4
  164. package/dist/core-generated/runtime-protobuf/runtime/v1/connector.js.map +1 -1
  165. package/dist/core-generated/runtime-protobuf/runtime/v1/integration.d.ts +146 -1
  166. package/dist/core-generated/runtime-protobuf/runtime/v1/integration.d.ts.map +1 -1
  167. package/dist/core-generated/runtime-protobuf/runtime/v1/integration.js +296 -4
  168. package/dist/core-generated/runtime-protobuf/runtime/v1/integration.js.map +1 -1
  169. package/dist/core-generated/runtime-protobuf/runtime/v1/local_runtime.d.ts +12 -0
  170. package/dist/core-generated/runtime-protobuf/runtime/v1/local_runtime.d.ts.map +1 -1
  171. package/dist/core-generated/runtime-protobuf/runtime/v1/local_runtime.js +25 -1
  172. package/dist/core-generated/runtime-protobuf/runtime/v1/local_runtime.js.map +1 -1
  173. package/dist/core-generated/runtime-protobuf/runtime/v1/realtime_control.d.ts +5 -1
  174. package/dist/core-generated/runtime-protobuf/runtime/v1/realtime_control.d.ts.map +1 -1
  175. package/dist/core-generated/runtime-protobuf/runtime/v1/realtime_control.js +4 -0
  176. package/dist/core-generated/runtime-protobuf/runtime/v1/realtime_control.js.map +1 -1
  177. package/dist/core-generated/runtime-protobuf/runtime/v1/remote_access.d.ts +552 -0
  178. package/dist/core-generated/runtime-protobuf/runtime/v1/remote_access.d.ts.map +1 -0
  179. package/dist/core-generated/runtime-protobuf/runtime/v1/remote_access.js +1097 -0
  180. package/dist/core-generated/runtime-protobuf/runtime/v1/remote_access.js.map +1 -0
  181. package/dist/core-generated/runtime-protobuf/runtime/v1/runtime_service_control.d.ts +4 -3
  182. package/dist/core-generated/runtime-protobuf/runtime/v1/runtime_service_control.d.ts.map +1 -1
  183. package/dist/core-generated/runtime-protobuf/runtime/v1/runtime_service_control.js.map +1 -1
  184. package/dist/core-generated/runtime-public-client.d.ts.map +1 -1
  185. package/dist/core-generated/runtime-public-client.js +104 -0
  186. package/dist/core-generated/runtime-public-client.js.map +1 -1
  187. package/dist/core-generated/runtime-public-rpc-auth-posture.d.ts.map +1 -1
  188. package/dist/core-generated/runtime-public-rpc-auth-posture.js +13 -0
  189. package/dist/core-generated/runtime-public-rpc-auth-posture.js.map +1 -1
  190. package/dist/core-generated/runtime-public-wire-codecs.d.ts +18 -3
  191. package/dist/core-generated/runtime-public-wire-codecs.d.ts.map +1 -1
  192. package/dist/core-generated/runtime-public-wire-codecs.js +18 -3
  193. package/dist/core-generated/runtime-public-wire-codecs.js.map +1 -1
  194. package/dist/core-generated/runtime-rpc-auth-posture.d.ts.map +1 -1
  195. package/dist/core-generated/runtime-rpc-auth-posture.js +14 -0
  196. package/dist/core-generated/runtime-rpc-auth-posture.js.map +1 -1
  197. package/dist/core-generated/runtime-typed-client.d.ts +37 -18
  198. package/dist/core-generated/runtime-typed-client.d.ts.map +1 -1
  199. package/dist/core-generated/runtime-typed-client.js +159 -8
  200. package/dist/core-generated/runtime-typed-client.js.map +1 -1
  201. package/dist/core-generated/runtime-wire-codecs.d.ts +20 -4
  202. package/dist/core-generated/runtime-wire-codecs.d.ts.map +1 -1
  203. package/dist/core-generated/runtime-wire-codecs.js +20 -4
  204. package/dist/core-generated/runtime-wire-codecs.js.map +1 -1
  205. package/dist/features/generation/runtime-image-generation.d.ts +8 -1
  206. package/dist/features/generation/runtime-image-generation.d.ts.map +1 -1
  207. package/dist/features/generation/runtime-image-generation.js +7 -0
  208. package/dist/features/generation/runtime-image-generation.js.map +1 -1
  209. package/dist/features/generation/runtime-scenarios.d.ts +8 -1
  210. package/dist/features/generation/runtime-scenarios.d.ts.map +1 -1
  211. package/dist/features/generation/runtime-scenarios.js +17 -1
  212. package/dist/features/generation/runtime-scenarios.js.map +1 -1
  213. package/dist/realm/account-settings.d.ts +2 -2
  214. package/dist/realm/account-settings.d.ts.map +1 -1
  215. package/dist/realm/auth.d.ts.map +1 -1
  216. package/dist/realm/auth.js +1 -0
  217. package/dist/realm/auth.js.map +1 -1
  218. package/dist/realm/index.d.ts +5 -4
  219. package/dist/realm/index.d.ts.map +1 -1
  220. package/dist/realm/index.js +7 -1
  221. package/dist/realm/index.js.map +1 -1
  222. package/dist/realm/media-delivery.d.ts.map +1 -1
  223. package/dist/realm/media-delivery.js +15 -7
  224. package/dist/realm/media-delivery.js.map +1 -1
  225. package/dist/realm/notifications.d.ts +2 -0
  226. package/dist/realm/notifications.d.ts.map +1 -1
  227. package/dist/realm/notifications.js +8 -3
  228. package/dist/realm/notifications.js.map +1 -1
  229. package/dist/realm/resource-upload.d.ts +13 -0
  230. package/dist/realm/resource-upload.d.ts.map +1 -1
  231. package/dist/realm/resource-upload.js +35 -21
  232. package/dist/realm/resource-upload.js.map +1 -1
  233. package/dist/realm/runtime-client.d.ts +57 -0
  234. package/dist/realm/runtime-client.d.ts.map +1 -0
  235. package/dist/realm/runtime-client.js +241 -0
  236. package/dist/realm/runtime-client.js.map +1 -0
  237. package/dist/realm/social-types.d.ts +1 -1
  238. package/dist/realm/social-types.d.ts.map +1 -1
  239. package/dist/realm/social.d.ts +17 -3
  240. package/dist/realm/social.d.ts.map +1 -1
  241. package/dist/realm/social.js +66 -114
  242. package/dist/realm/social.js.map +1 -1
  243. package/dist/runtime/config-projections.d.ts +25 -0
  244. package/dist/runtime/config-projections.d.ts.map +1 -1
  245. package/dist/runtime/config-projections.js +4 -0
  246. package/dist/runtime/config-projections.js.map +1 -1
  247. package/dist/runtime/connector-inventory.d.ts +14 -3
  248. package/dist/runtime/connector-inventory.d.ts.map +1 -1
  249. package/dist/runtime/connector-inventory.js +13 -0
  250. package/dist/runtime/connector-inventory.js.map +1 -1
  251. package/dist/runtime/desktop-first-party-runtime.d.ts +2 -0
  252. package/dist/runtime/desktop-first-party-runtime.d.ts.map +1 -1
  253. package/dist/runtime/desktop-first-party-runtime.js +12 -0
  254. package/dist/runtime/desktop-first-party-runtime.js.map +1 -1
  255. package/dist/runtime/electron-ipc.d.ts.map +1 -1
  256. package/dist/runtime/electron-ipc.js +61 -26
  257. package/dist/runtime/electron-ipc.js.map +1 -1
  258. package/dist/runtime/first-party-protected-runtime-profiles.generated.d.ts +275 -1
  259. package/dist/runtime/first-party-protected-runtime-profiles.generated.d.ts.map +1 -1
  260. package/dist/runtime/first-party-protected-runtime-profiles.generated.js +74 -1
  261. package/dist/runtime/first-party-protected-runtime-profiles.generated.js.map +1 -1
  262. package/dist/runtime/index.d.ts +2 -0
  263. package/dist/runtime/index.d.ts.map +1 -1
  264. package/dist/runtime/index.js +1 -0
  265. package/dist/runtime/index.js.map +1 -1
  266. package/dist/runtime/reason-messages.d.ts +5 -0
  267. package/dist/runtime/reason-messages.d.ts.map +1 -1
  268. package/dist/runtime/reason-messages.js +10 -0
  269. package/dist/runtime/reason-messages.js.map +1 -1
  270. package/dist/runtime/remote-app.d.ts +64 -0
  271. package/dist/runtime/remote-app.d.ts.map +1 -0
  272. package/dist/runtime/remote-app.js +186 -0
  273. package/dist/runtime/remote-app.js.map +1 -0
  274. package/dist/runtime/remote-data-channel.d.ts +25 -0
  275. package/dist/runtime/remote-data-channel.d.ts.map +1 -0
  276. package/dist/runtime/remote-data-channel.js +406 -0
  277. package/dist/runtime/remote-data-channel.js.map +1 -0
  278. package/dist/runtime/remote-realm.d.ts +9 -0
  279. package/dist/runtime/remote-realm.d.ts.map +1 -0
  280. package/dist/runtime/remote-realm.js +82 -0
  281. package/dist/runtime/remote-realm.js.map +1 -0
  282. package/dist/runtime/remote.d.ts +115 -0
  283. package/dist/runtime/remote.d.ts.map +1 -0
  284. package/dist/runtime/remote.js +177 -0
  285. package/dist/runtime/remote.js.map +1 -0
  286. package/dist/runtime/runtime-agent-consume-streams.d.ts.map +1 -1
  287. package/dist/runtime/runtime-agent-consume-streams.js +37 -15
  288. package/dist/runtime/runtime-agent-consume-streams.js.map +1 -1
  289. package/dist/runtime/runtime-agent-context-projections.d.ts +1 -1
  290. package/dist/runtime/runtime-agent-context-projections.d.ts.map +1 -1
  291. package/dist/runtime/runtime-agent-context-projections.js +5 -1
  292. package/dist/runtime/runtime-agent-context-projections.js.map +1 -1
  293. package/dist/runtime/shared-local-agent-ai-config.js +1 -0
  294. package/dist/runtime/shared-local-agent-ai-config.js.map +1 -1
  295. package/dist/runtime/wire-types/agent-participation-types.d.ts +4 -2
  296. package/dist/runtime/wire-types/agent-participation-types.d.ts.map +1 -1
  297. package/dist/runtime/wire-types/ai-scenario-enums.d.ts +58 -4
  298. package/dist/runtime/wire-types/ai-scenario-enums.d.ts.map +1 -1
  299. package/dist/runtime/wire-types/ai-scenario-enums.js +60 -0
  300. package/dist/runtime/wire-types/ai-scenario-enums.js.map +1 -1
  301. package/dist/runtime/wire-types/ai-scenario-types.d.ts +10 -8
  302. package/dist/runtime/wire-types/ai-scenario-types.d.ts.map +1 -1
  303. package/dist/runtime/wire-types/identity-app-types.d.ts +8 -8
  304. package/dist/runtime/wire-types/identity-app-types.d.ts.map +1 -1
  305. package/dist/runtime/wire-types/reason-code-enums.d.ts +8 -1
  306. package/dist/runtime/wire-types/reason-code-enums.d.ts.map +1 -1
  307. package/dist/runtime/wire-types/reason-code-enums.js +7 -0
  308. package/dist/runtime/wire-types/reason-code-enums.js.map +1 -1
  309. package/dist/types/errors.d.ts.map +1 -1
  310. package/dist/types/errors.js +1 -0
  311. package/dist/types/errors.js.map +1 -1
  312. package/dist/types/index.d.ts +3 -0
  313. package/dist/types/index.d.ts.map +1 -1
  314. package/dist/types/index.js.map +1 -1
  315. package/dist/types/reason-code.d.ts +5 -0
  316. package/dist/types/reason-code.d.ts.map +1 -1
  317. package/dist/types/reason-code.js +5 -0
  318. package/dist/types/reason-code.js.map +1 -1
  319. package/package.json +12 -2
@@ -192,6 +192,7 @@ export function createNimiLocalAppAIConsumptionRuntimeClient(runtime) {
192
192
  spec: runtimeLocalJobSpec(spec),
193
193
  timeoutMs: 0,
194
194
  clientSubmissionId: options.clientSubmissionId ?? '',
195
+ configRef: options.configRef ?? '',
195
196
  });
196
197
  return { job: projectRuntimeLocalJob(requiredRuntimeValue(response.job, 'scenario Job')) };
197
198
  },
@@ -308,7 +309,8 @@ function validateVoiceAssetsListInput(input) {
308
309
  }
309
310
  return Object.freeze({ pageSize, pageToken });
310
311
  }
311
- export function createNimiLocalAppRuntimeScenarioJobClient(ai) {
312
+ export function createNimiLocalAppRuntimeScenarioJobClient(ai, options) {
313
+ const boundConfigRef = options?.configRef !== undefined ? validateScenarioJobConfigRef(options.configRef) : undefined;
312
314
  const client = {
313
315
  terminalVoiceAssetProjection: 'protected-local',
314
316
  async submitScenarioJob(request) {
@@ -316,7 +318,11 @@ export function createNimiLocalAppRuntimeScenarioJobClient(ai) {
316
318
  invalidAIInput('Scenario Job business timeout is no longer supported');
317
319
  }
318
320
  const spec = localJobSpecFromRuntimeRequest(request);
319
- const result = await ai.scenarioJobs.submit(spec, request.idempotencyKey ? { clientSubmissionId: validateClientSubmissionId(request.idempotencyKey) } : {});
321
+ const submitOptions = {
322
+ ...(request.idempotencyKey ? { clientSubmissionId: validateClientSubmissionId(request.idempotencyKey) } : {}),
323
+ ...(boundConfigRef !== undefined ? { configRef: boundConfigRef } : {}),
324
+ };
325
+ const result = await ai.scenarioJobs.submit(spec, submitOptions);
320
326
  return {
321
327
  job: runtimeJobFromLocal(result.job),
322
328
  };
@@ -410,6 +416,17 @@ function validateScenarioSpec(spec, execute) {
410
416
  }
411
417
  assertNoAuthorityMaterial(record);
412
418
  switch (record.type) {
419
+ // @nimi-authority: rule.nimi.runtime.ai-provider.media-upscale-contract
420
+ case 'image-upscale':
421
+ case 'video-upscale':
422
+ if (execute)
423
+ invalidAIInput('super-resolution requires an async Job');
424
+ assertExactKeys(record, ['type', 'sourceArtifactId', 'scale', 'seed'], 'super-resolution spec');
425
+ boundedIdentifier(record.sourceArtifactId, 'sourceArtifactId');
426
+ if (record.scale !== 2 && record.scale !== 4)
427
+ invalidAIInput('super-resolution scale must be 2 or 4');
428
+ optionalBoundedInteger(record.seed, 'super-resolution seed', 0, 2147483647);
429
+ break;
413
430
  // @nimi-authority: rule.nimi.runtime.ai-provider.face-swap-video-job
414
431
  case 'video-face-swap':
415
432
  if (execute)
@@ -457,7 +474,16 @@ function validateScenarioSpec(spec, execute) {
457
474
  case 'image-generate':
458
475
  if (execute)
459
476
  invalidAIInput('image-generate requires an async Job');
460
- assertExactKeys(record, ['type', 'prompt', 'negativePrompt', 'n', 'size', 'aspectRatio', 'quality', 'style', 'seed', 'referenceImages', 'referenceImageArtifactId', 'mask', 'maskArtifactId', 'strength', 'responseFormat'], 'image spec');
477
+ assertExactKeys(record, ['type', 'prompt', 'negativePrompt', 'n', 'size', 'aspectRatio', 'quality', 'style', 'seed', 'referenceImages', 'referenceImageArtifactId', 'mask', 'maskArtifactId', 'strength', 'responseFormat', 'complexity', 'outputFormat', 'markup', 'markupArtifactId', 'frameCount', 'frameDurationMs', 'controlImage'], 'image spec');
478
+ if (record.controlImage !== undefined) {
479
+ const control = asRecord(record.controlImage);
480
+ assertExactKeys(control, ['imageArtifactId', 'type', 'strength'], 'image control');
481
+ boundedIdentifier(control.imageArtifactId, 'control image artifact');
482
+ if (typeof control.type !== 'number' || !Number.isInteger(control.type) || control.type < 1 || control.type > 8)
483
+ invalidAIInput('image control type is invalid');
484
+ if (control.strength !== undefined && (typeof control.strength !== 'number' || !Number.isFinite(control.strength) || control.strength < 0 || control.strength > 2))
485
+ invalidAIInput('image control strength is invalid');
486
+ }
461
487
  boundedContent(record.prompt, 'image prompt', 32 * 1024);
462
488
  optionalBoundedText(record.negativePrompt, 'image negativePrompt', 32 * 1024);
463
489
  optionalBoundedInteger(record.n, 'image n', 0, 4);
@@ -492,6 +518,22 @@ function validateScenarioSpec(spec, execute) {
492
518
  invalidAIInput('image strength requires referenceImageArtifactId');
493
519
  if (!['', 'b64_json', 'url'].includes(String(record.responseFormat)))
494
520
  invalidAIInput('image responseFormat is invalid');
521
+ if (record.complexity !== undefined && (typeof record.complexity !== 'string' || !['', 'low', 'medium', 'high'].includes(record.complexity)))
522
+ invalidAIInput('image complexity is invalid');
523
+ if (record.outputFormat !== undefined && (typeof record.outputFormat !== 'string' || !['', 'png', 'jpeg', 'webp', 'gif', 'svg'].includes(record.outputFormat)))
524
+ invalidAIInput('image outputFormat is invalid');
525
+ if (record.markup !== undefined && record.markup !== '')
526
+ boundedHttpsUrl(record.markup, 'image markup');
527
+ if (record.markupArtifactId !== undefined && record.markupArtifactId !== '')
528
+ boundedIdentifier(record.markupArtifactId, 'image markupArtifactId');
529
+ if (record.markup && record.markupArtifactId)
530
+ invalidAIInput('image markup carriers are mutually exclusive');
531
+ if ((record.markup || record.markupArtifactId) && (record.mask || record.maskArtifactId || (record.referenceImages.length === 0 && record.referenceImageArtifactId === '')))
532
+ invalidAIInput('image markup requires a source and excludes masks');
533
+ optionalBoundedInteger(record.frameCount, 'image frameCount', 2, 64);
534
+ optionalBoundedInteger(record.frameDurationMs, 'image frameDurationMs', 20, 2000);
535
+ if ((record.frameCount !== undefined || record.frameDurationMs !== undefined) && record.outputFormat !== 'gif')
536
+ invalidAIInput('image animation controls require GIF output');
495
537
  break;
496
538
  case 'video-generate':
497
539
  if (execute)
@@ -588,10 +630,17 @@ function validateScenarioSpec(spec, execute) {
588
630
  }
589
631
  return spec;
590
632
  }
633
+ function validateScenarioJobConfigRef(value) {
634
+ if (typeof value !== 'string' || !/^(main|[0-9a-f]{32})$/.test(value)) {
635
+ invalidAIInput('configRef is invalid');
636
+ }
637
+ return value;
638
+ }
591
639
  function validateScenarioJobSubmitOptions(options) {
592
- assertExactKeys(options, ['clientSubmissionId'], 'Scenario Job submit options');
640
+ assertExactKeys(options, ['clientSubmissionId', 'configRef'], 'Scenario Job submit options');
593
641
  return Object.freeze({
594
642
  ...(options.clientSubmissionId !== undefined ? { clientSubmissionId: validateClientSubmissionId(options.clientSubmissionId) } : {}),
643
+ ...(options.configRef !== undefined ? { configRef: validateScenarioJobConfigRef(options.configRef) } : {}),
595
644
  });
596
645
  }
597
646
  const MAX_SCENARIO_EXECUTE_TIMEOUT_MS = 120_000;
@@ -728,7 +777,7 @@ function validateVideoSpec(record) {
728
777
  optionalBoundedText(record.prompt, 'video prompt', 32 * 1024);
729
778
  optionalBoundedText(record.negativePrompt, 'video negativePrompt', 32 * 1024);
730
779
  if (!['t2v', 'i2v-first-frame', 'i2v-first-last', 'i2v-reference'].includes(String(record.mode))
731
- || !Array.isArray(record.content) || record.content.length > 8)
780
+ || !Array.isArray(record.content) || record.content.length > 51)
732
781
  invalidAIInput('video spec is invalid');
733
782
  record.content.forEach((entry, index) => {
734
783
  const content = asRecord(entry);
@@ -756,7 +805,7 @@ function validateVideoSpec(record) {
756
805
  assertExactKeys(options, ['resolution', 'ratio', 'durationSec', 'frames', 'fps', 'seed', 'cameraFixed', 'watermark', 'generateAudio', 'draft', 'returnLastFrame'], 'video options');
757
806
  boundedToken(options.resolution, 'video resolution', 64);
758
807
  boundedToken(options.ratio, 'video ratio', 64);
759
- optionalBoundedInteger(options.durationSec, 'video durationSec', 0, 600);
808
+ optionalBoundedInteger(options.durationSec, 'video durationSec', -1, 600);
760
809
  optionalBoundedInteger(options.frames, 'video frames', 0, 100_000);
761
810
  optionalBoundedInteger(options.fps, 'video fps', 0, 120);
762
811
  optionalBoundedInteger(options.seed, 'video seed', -1, 4_294_967_295);
@@ -888,6 +937,15 @@ function projectSubscription(subscription, projector) {
888
937
  };
889
938
  return Object.freeze(projected);
890
939
  }
940
+ export function projectCapture(value) {
941
+ const r = asRecord(value);
942
+ if (!r || typeof r.configRef !== 'string' || !/^(main|[a-f0-9]{32})$/.test(r.configRef) ||
943
+ typeof r.revision !== 'string' || !/^[1-9][0-9]*$/.test(r.revision) || (r.localLoadoutRef === undefined) !== (r.localLoadoutRevision === undefined) ||
944
+ (r.localLoadoutRef !== undefined && (typeof r.localLoadoutRef !== 'string' || typeof r.localLoadoutRevision !== 'string')))
945
+ return localAppProjectionError('invalid configuration capture');
946
+ assertExactProjectionKeys(r, ['configRef', 'revision', ...(r.localLoadoutRef === undefined ? [] : ['localLoadoutRef', 'localLoadoutRevision'])], 'configuration capture');
947
+ return { configRef: r.configRef, revision: r.revision, ...(typeof r.localLoadoutRef === 'string' ? { localLoadoutRef: r.localLoadoutRef, localLoadoutRevision: r.localLoadoutRevision } : {}) };
948
+ }
891
949
  function projectTextTurnEvent(value) {
892
950
  const record = asRecord(value);
893
951
  if (!record || !/^[1-9][0-9]*$/u.test(String(record.sequence)))
@@ -914,10 +972,10 @@ function projectTextTurnEvent(value) {
914
972
  return Object.freeze({ ...base, type: 'reasoning-continuity', itemIndex: projectionInteger(record.itemIndex, 'continuity item index', 0, 4_294_967_295), carrier: projectLocalAppContinuity(record.carrier) });
915
973
  }
916
974
  if (record.type === 'completed') {
917
- assertExactProjectionKeys(record, ['type', 'sequence', 'traceId', 'finishReason'], 'text-turn completed');
975
+ assertExactProjectionKeys(record, ['type', 'sequence', 'traceId', 'finishReason', ...(record.configuration ? ['configuration'] : []), ...(record.usage !== undefined ? ['usage'] : [])], 'text-turn completed');
918
976
  if (!['stop', 'length', 'tool-calls', 'content-filter'].includes(String(record.finishReason)))
919
977
  localAppProjectionError('text-turn finishReason');
920
- return Object.freeze({ ...base, type: 'completed', finishReason: record.finishReason });
978
+ return Object.freeze({ ...base, type: 'completed', finishReason: record.finishReason, ...(record.configuration ? { configuration: projectCapture(record.configuration) } : {}), ...(record.usage === undefined ? {} : { usage: projectTokenUsage(record.usage) }) });
921
979
  }
922
980
  if (record.type === 'failed') {
923
981
  assertExactProjectionKeys(record, ['type', 'sequence', 'traceId', 'reasonCode', 'actionHint', ...(Object.hasOwn(record, 'interruption') ? ['interruption'] : [])], 'text-turn failed');
@@ -939,12 +997,12 @@ function projectScenarioExecute(value, decide) {
939
997
  return Object.freeze({ output: validateNimiLocalAppTextDecideOutput(output, decide), traceId });
940
998
  }
941
999
  if (output.type === 'text-generate') {
942
- assertExactProjectionKeys(output, ['type', 'items', 'finishReason'], 'text generate output');
1000
+ assertExactProjectionKeys(output, ['type', 'items', 'finishReason', ...(output.usage !== undefined ? ['usage'] : [])], 'text generate output');
943
1001
  const items = projectLocalAppTextItems(output.items);
944
1002
  if (!['stop', 'length', 'tool-calls', 'content-filter'].includes(String(output.finishReason))
945
1003
  || (output.finishReason === 'tool-calls' && !items.some((item) => item.type === 'tool-call')))
946
1004
  localAppProjectionError('text finish reason');
947
- return Object.freeze({ output: Object.freeze({ type: 'text-generate', items, finishReason: output.finishReason }), traceId });
1005
+ return Object.freeze({ output: Object.freeze({ type: 'text-generate', items, finishReason: output.finishReason, ...(output.usage === undefined ? {} : { usage: projectTokenUsage(output.usage) }) }), traceId });
948
1006
  }
949
1007
  assertSafeProjection(record);
950
1008
  if (output.type === 'text-embed') {
@@ -958,7 +1016,7 @@ function projectScenarioExecute(value, decide) {
958
1016
  localAppProjectionError('text embed vector');
959
1017
  return Object.freeze([...vector]);
960
1018
  });
961
- const usage = output.usage === undefined ? undefined : projectEmbeddingUsage(output.usage);
1019
+ const usage = output.usage === undefined ? undefined : projectTokenUsage(output.usage);
962
1020
  return Object.freeze({ output: Object.freeze({ type: 'text-embed', vectors: Object.freeze(vectors), spaceId, ...(usage ? { usage } : {}) }), traceId });
963
1021
  }
964
1022
  return localAppProjectionError('scenario execute output type');
@@ -1366,6 +1424,8 @@ function runtimeTextTurnRequest(input) {
1366
1424
  const format = input.responseFormat;
1367
1425
  return {
1368
1426
  messages,
1427
+ ...(input.configuration ? { configuration: { configRef: input.configuration.configRef, expectedRevision: input.configuration.expectedRevision ?? '',
1428
+ expectedLocalLoadoutRef: input.configuration.expectedLocalLoadoutRef ?? '', expectedLocalLoadoutRevision: input.configuration.expectedLocalLoadoutRevision ?? '' } } : {}),
1369
1429
  tools: toRuntimeTools(input.tools),
1370
1430
  ...(input.reasoning === undefined ? {} : { reasoning: toRuntimeReasoningConfig(input.reasoning, (detail) => localAppError(detail, 'SDK_LOCAL_APP_INPUT_INVALID', 'provide_admitted_local_app_text_input')) }),
1371
1431
  toolChoice: choice === 'none' ? ToolChoiceMode.NONE : choice === 'auto' ? ToolChoiceMode.AUTO
@@ -1386,14 +1446,20 @@ function runtimeTextTurnRequest(input) {
1386
1446
  ...(input.seed === undefined ? {} : { seed: String(input.seed) }),
1387
1447
  };
1388
1448
  }
1389
- function projectEmbeddingUsage(value) {
1449
+ function runtimeTokenUsage(usage) {
1450
+ return {
1451
+ promptTokens: Number(usage.inputTokens), completionTokens: Number(usage.outputTokens),
1452
+ totalTokens: Number(usage.inputTokens) + Number(usage.outputTokens),
1453
+ };
1454
+ }
1455
+ function projectTokenUsage(value) {
1390
1456
  const usage = asRecord(value);
1391
- assertExactProjectionKeys(usage, ['promptTokens', 'completionTokens', 'totalTokens'], 'embedding usage');
1392
- const promptTokens = projectionInteger(usage.promptTokens, 'embedding prompt tokens', 0, Number.MAX_SAFE_INTEGER);
1393
- const completionTokens = projectionInteger(usage.completionTokens, 'embedding completion tokens', 0, Number.MAX_SAFE_INTEGER);
1394
- const totalTokens = projectionInteger(usage.totalTokens, 'embedding total tokens', 0, Number.MAX_SAFE_INTEGER);
1457
+ assertExactProjectionKeys(usage, ['promptTokens', 'completionTokens', 'totalTokens'], 'token usage');
1458
+ const promptTokens = projectionInteger(usage.promptTokens, 'prompt tokens', 0, Number.MAX_SAFE_INTEGER);
1459
+ const completionTokens = projectionInteger(usage.completionTokens, 'completion tokens', 0, Number.MAX_SAFE_INTEGER);
1460
+ const totalTokens = projectionInteger(usage.totalTokens, 'total tokens', 0, Number.MAX_SAFE_INTEGER);
1395
1461
  if (totalTokens !== promptTokens + completionTokens)
1396
- localAppProjectionError('embedding total tokens');
1462
+ localAppProjectionError('total tokens');
1397
1463
  return Object.freeze({ promptTokens, completionTokens, totalTokens });
1398
1464
  }
1399
1465
  function runtimeExecuteRequest(spec, timeoutMs) {
@@ -1413,6 +1479,10 @@ function runtimeLocalJobSpec(spec) {
1413
1479
  return { oneofKind: 'videoFaceSwap', videoFaceSwap: { referenceImageArtifactId: spec.referenceImageArtifactId, targetVideoArtifactId: spec.targetVideoArtifactId, noFacePolicy: spec.noFacePolicy === 'fail' ? FaceSwapNoFacePolicy.FAIL : FaceSwapNoFacePolicy.PRESERVE_FRAME } };
1414
1480
  case 'image-face-swap':
1415
1481
  return { oneofKind: 'imageFaceSwap', imageFaceSwap: { referenceImageArtifactId: spec.referenceImageArtifactId, targetImageArtifactId: spec.targetImageArtifactId } };
1482
+ case 'image-upscale':
1483
+ return { oneofKind: 'imageUpscale', imageUpscale: { sourceArtifactId: spec.sourceArtifactId, scale: spec.scale, seed: spec.seed === undefined ? undefined : String(spec.seed) } };
1484
+ case 'video-upscale':
1485
+ return { oneofKind: 'videoUpscale', videoUpscale: { sourceArtifactId: spec.sourceArtifactId, scale: spec.scale, seed: spec.seed === undefined ? undefined : String(spec.seed) } };
1416
1486
  case 'vision-locate':
1417
1487
  return { oneofKind: 'visionLocate', visionLocate: { imageArtifactId: spec.imageArtifactId, query: spec.query, geometry: spec.geometry === 'box' ? VisionLocateGeometry.BOX : VisionLocateGeometry.POINT } };
1418
1488
  case 'image-generate':
@@ -1549,6 +1619,7 @@ function runtimeLocalJobSpec(spec) {
1549
1619
  }
1550
1620
  function runtimeImageSpec(spec) {
1551
1621
  return {
1622
+ ...(spec.controlImage === undefined ? {} : { controlImage: { ...spec.controlImage } }),
1552
1623
  prompt: spec.prompt,
1553
1624
  negativePrompt: spec.negativePrompt,
1554
1625
  ...(spec.n === undefined ? {} : { n: spec.n }),
@@ -1563,6 +1634,12 @@ function runtimeImageSpec(spec) {
1563
1634
  ...(spec.strength === undefined ? {} : { strength: spec.strength }),
1564
1635
  responseFormat: spec.responseFormat,
1565
1636
  referenceImageArtifactId: spec.referenceImageArtifactId,
1637
+ complexity: spec.complexity ?? '',
1638
+ outputFormat: spec.outputFormat ?? '',
1639
+ markup: spec.markup ?? '',
1640
+ markupArtifactId: spec.markupArtifactId ?? '',
1641
+ ...(spec.frameCount === undefined ? {} : { frameCount: spec.frameCount }),
1642
+ ...(spec.frameDurationMs === undefined ? {} : { frameDurationMs: spec.frameDurationMs }),
1566
1643
  };
1567
1644
  }
1568
1645
  function runtimeVideoMode(value) {
@@ -1629,6 +1706,8 @@ function projectRuntimeTextTurnEvent(event) {
1629
1706
  ...base,
1630
1707
  type: 'completed',
1631
1708
  finishReason: runtimeFinishReason(event.payload.completed.finishReason),
1709
+ ...(event.payload.completed.configuration ? { configuration: event.payload.completed.configuration } : {}),
1710
+ ...(event.payload.completed.usage ? { usage: runtimeTokenUsage(event.payload.completed.usage) } : {}),
1632
1711
  };
1633
1712
  case 'failed':
1634
1713
  return {
@@ -1645,18 +1724,14 @@ function projectRuntimeTextTurnEvent(event) {
1645
1724
  function projectRuntimeScenarioExecuteResponse(response) {
1646
1725
  switch (response.output.oneofKind) {
1647
1726
  case 'textGenerate':
1648
- return { output: { type: 'text-generate', items: toNimiTextOutputItems(response.output.textGenerate.items).map(modelTextOutputToLocalApp), finishReason: runtimeFinishReason(response.output.textGenerate.finishReason) }, traceId: response.traceId };
1727
+ return { output: { type: 'text-generate', items: toNimiTextOutputItems(response.output.textGenerate.items).map(modelTextOutputToLocalApp), finishReason: runtimeFinishReason(response.output.textGenerate.finishReason), ...(response.output.textGenerate.usage ? { usage: runtimeTokenUsage(response.output.textGenerate.usage) } : {}) }, traceId: response.traceId };
1649
1728
  case 'textEmbed':
1650
1729
  return {
1651
1730
  output: {
1652
1731
  type: 'text-embed',
1653
1732
  vectors: response.output.textEmbed.vectors.map((vector) => [...vector.values]),
1654
1733
  spaceId: response.output.textEmbed.spaceId,
1655
- ...(response.output.textEmbed.usage ? { usage: {
1656
- promptTokens: Number(response.output.textEmbed.usage.inputTokens),
1657
- completionTokens: Number(response.output.textEmbed.usage.outputTokens),
1658
- totalTokens: Number(response.output.textEmbed.usage.inputTokens) + Number(response.output.textEmbed.usage.outputTokens),
1659
- } } : {}),
1734
+ ...(response.output.textEmbed.usage ? { usage: runtimeTokenUsage(response.output.textEmbed.usage) } : {}),
1660
1735
  },
1661
1736
  traceId: response.traceId,
1662
1737
  };
@@ -1686,7 +1761,7 @@ function projectRuntimeLocalJob(job) {
1686
1761
  updatedAt: plainRuntimeTimestamp(job.updatedAt),
1687
1762
  ...(job.recoveryExpiresAt ? { recoveryExpiresAt: plainRuntimeTimestamp(job.recoveryExpiresAt) } : {}),
1688
1763
  transcriptionText: job.transcriptionText,
1689
- ...(job.textAnnotation ? { textAnnotation: job.textAnnotation } : {}),
1764
+ ...(job.textAnnotation ? { textAnnotation: copyTextAnnotationResult(job.textAnnotation) } : {}),
1690
1765
  ...(job.speakerEmbedding ? { speakerEmbedding: validateNimiLocalAppSpeakerEmbedding({ vector: job.speakerEmbedding.vector?.values, spaceId: job.speakerEmbedding.spaceId }) } : {}),
1691
1766
  ...(job.audioSeparation ? { audioSeparation: localAudioSeparation(job.audioSeparation) } : {}),
1692
1767
  ...(job.musicGeneration ? { musicGeneration: localMusicGeneration(job.musicGeneration) } : {}),
@@ -1735,6 +1810,8 @@ function runtimeScenarioTypeName(value) {
1735
1810
  const types = {
1736
1811
  [ScenarioType.VIDEO_FACE_SWAP]: 'video-face-swap',
1737
1812
  [ScenarioType.IMAGE_FACE_SWAP]: 'image-face-swap',
1813
+ [ScenarioType.IMAGE_UPSCALE]: 'image-upscale',
1814
+ [ScenarioType.VIDEO_UPSCALE]: 'video-upscale',
1738
1815
  [ScenarioType.VISION_LOCATE]: 'vision-locate',
1739
1816
  [ScenarioType.IMAGE_GENERATE]: 'image-generate',
1740
1817
  [ScenarioType.VIDEO_GENERATE]: 'video-generate',
@@ -1826,7 +1903,7 @@ function localVoiceCreationSource(source) {
1826
1903
  return 'text-description';
1827
1904
  return localAppProjectionError('voice asset creationSource');
1828
1905
  }
1829
- const LOCAL_SCENARIO_TYPES = ['image-generate', 'image-face-swap', 'video-face-swap', 'vision-locate', 'video-generate', 'speech-synthesize', 'speech-transcribe', 'text-annotate', 'audio-speaker-embed', 'audio-separate', 'voice-create', 'music-generate', 'music-transcribe', 'audio-voice-convert', 'world-generate'];
1906
+ const LOCAL_SCENARIO_TYPES = ['image-generate', 'image-upscale', 'video-upscale', 'image-face-swap', 'video-face-swap', 'vision-locate', 'video-generate', 'speech-synthesize', 'speech-transcribe', 'text-annotate', 'audio-speaker-embed', 'audio-separate', 'voice-create', 'music-generate', 'music-transcribe', 'audio-voice-convert', 'world-generate'];
1830
1907
  const LOCAL_JOB_STATUSES = ['submitted', 'queued', 'running', 'completed', 'failed', 'canceled', 'timeout'];
1831
1908
  export function validateNimiLocalAppSpeakerEmbedSpec(value) {
1832
1909
  if (asRecord(value)?.type !== 'audio-speaker-embed')
@@ -1871,6 +1948,16 @@ function localJobSpecFromRuntimeRequest(request) {
1871
1948
  case 'imageFaceSwap':
1872
1949
  requireScenarioType(request, ScenarioType.IMAGE_FACE_SWAP);
1873
1950
  return validateScenarioSpec({ type: 'image-face-swap', referenceImageArtifactId: spec.imageFaceSwap.referenceImageArtifactId, targetImageArtifactId: spec.imageFaceSwap.targetImageArtifactId }, false);
1951
+ case 'imageUpscale':
1952
+ requireScenarioType(request, ScenarioType.IMAGE_UPSCALE);
1953
+ if (spec.imageUpscale.scale !== 2 && spec.imageUpscale.scale !== 4)
1954
+ invalidAIInput('super-resolution scale must be 2 or 4');
1955
+ return validateScenarioSpec({ type: 'image-upscale', sourceArtifactId: spec.imageUpscale.sourceArtifactId, scale: spec.imageUpscale.scale, ...(spec.imageUpscale.seed === undefined ? {} : { seed: Number(spec.imageUpscale.seed) }) }, false);
1956
+ case 'videoUpscale':
1957
+ requireScenarioType(request, ScenarioType.VIDEO_UPSCALE);
1958
+ if (spec.videoUpscale.scale !== 2 && spec.videoUpscale.scale !== 4)
1959
+ invalidAIInput('super-resolution scale must be 2 or 4');
1960
+ return validateScenarioSpec({ type: 'video-upscale', sourceArtifactId: spec.videoUpscale.sourceArtifactId, scale: spec.videoUpscale.scale, ...(spec.videoUpscale.seed === undefined ? {} : { seed: Number(spec.videoUpscale.seed) }) }, false);
1874
1961
  case 'visionLocate':
1875
1962
  requireScenarioType(request, ScenarioType.VISION_LOCATE);
1876
1963
  return validateScenarioSpec({ type: 'vision-locate', imageArtifactId: spec.visionLocate.imageArtifactId, query: spec.visionLocate.query, geometry: localLocateGeometry(spec.visionLocate.geometry) }, false);
@@ -1891,6 +1978,13 @@ function localJobSpecFromRuntimeRequest(request) {
1891
1978
  ...(spec.imageGenerate.maskArtifactId === '' ? {} : { maskArtifactId: spec.imageGenerate.maskArtifactId }),
1892
1979
  ...(spec.imageGenerate.strength === undefined ? {} : { strength: spec.imageGenerate.strength }),
1893
1980
  responseFormat: spec.imageGenerate.responseFormat,
1981
+ ...(spec.imageGenerate.complexity === '' || spec.imageGenerate.complexity === undefined ? {} : { complexity: spec.imageGenerate.complexity }),
1982
+ ...(spec.imageGenerate.outputFormat === '' || spec.imageGenerate.outputFormat === undefined ? {} : { outputFormat: spec.imageGenerate.outputFormat }),
1983
+ ...(spec.imageGenerate.markup === '' || spec.imageGenerate.markup === undefined ? {} : { markup: spec.imageGenerate.markup }),
1984
+ ...(spec.imageGenerate.markupArtifactId === '' || spec.imageGenerate.markupArtifactId === undefined ? {} : { markupArtifactId: spec.imageGenerate.markupArtifactId }),
1985
+ ...(spec.imageGenerate.frameCount === undefined ? {} : { frameCount: spec.imageGenerate.frameCount }),
1986
+ ...(spec.imageGenerate.frameDurationMs === undefined ? {} : { frameDurationMs: spec.imageGenerate.frameDurationMs }),
1987
+ ...(spec.imageGenerate.controlImage === undefined ? {} : { controlImage: { ...spec.imageGenerate.controlImage } }),
1894
1988
  }, false);
1895
1989
  case 'videoGenerate':
1896
1990
  requireScenarioType(request, ScenarioType.VIDEO_GENERATE);
@@ -2075,7 +2169,7 @@ function runtimeJobFromLocal(job) {
2075
2169
  musicGeneration: runtimeMusicGeneration(job.musicGeneration),
2076
2170
  musicTranscription: runtimeMusicTranscription(job.musicTranscription),
2077
2171
  voiceConversion: runtimeVoiceConversion(job.voiceConversion),
2078
- textAnnotation: runtimeAnnotationFromLocal(job.textAnnotation),
2172
+ textAnnotation: copyTextAnnotationResult(job.textAnnotation),
2079
2173
  };
2080
2174
  }
2081
2175
  function runtimeVoiceAssetFromLocal(asset) {
@@ -2105,6 +2199,8 @@ function runtimeOutput(type, artifacts, transcriptionText, videoFaceSwapSummary,
2105
2199
  switch (type) {
2106
2200
  case 'video-face-swap': return videoFaceSwapSummary ? { output: { oneofKind: 'videoFaceSwap', videoFaceSwap: { artifacts, summary: { ...videoFaceSwapSummary, durationUs: String(videoFaceSwapSummary.durationUs) } } } } : undefined;
2107
2201
  case 'image-face-swap': return { output: { oneofKind: 'imageFaceSwap', imageFaceSwap: { artifacts } } };
2202
+ case 'image-upscale': return { output: { oneofKind: 'imageUpscale', imageUpscale: { artifacts } } };
2203
+ case 'video-upscale': return { output: { oneofKind: 'videoUpscale', videoUpscale: { artifacts } } };
2108
2204
  case 'image-generate': return { output: { oneofKind: 'imageGenerate', imageGenerate: { artifacts } } };
2109
2205
  case 'video-generate': return { output: { oneofKind: 'videoGenerate', videoGenerate: { artifacts } } };
2110
2206
  case 'speech-synthesize': return { output: { oneofKind: 'speechSynthesize', speechSynthesize: { artifacts } } };
@@ -2113,7 +2209,7 @@ function runtimeOutput(type, artifacts, transcriptionText, videoFaceSwapSummary,
2113
2209
  localAppProjectionError('speech transcription text');
2114
2210
  return { output: { oneofKind: 'speechTranscribe', speechTranscribe: { text: transcriptionText, artifacts, transcription: runtimeTranscriptionFromLocal(transcription) } } };
2115
2211
  }
2116
- case 'text-annotate': return { output: { oneofKind: 'textAnnotation', textAnnotation: runtimeAnnotationFromLocal(textAnnotation) } };
2212
+ case 'text-annotate': return { output: { oneofKind: 'textAnnotation', textAnnotation: copyTextAnnotationResult(textAnnotation) } };
2117
2213
  case 'audio-speaker-embed': return speakerEmbedding ? { output: { oneofKind: 'audioSpeakerEmbed', audioSpeakerEmbed: { vector: { values: [...speakerEmbedding.vector] }, spaceId: speakerEmbedding.spaceId } } } : undefined;
2118
2214
  case 'audio-separate': return { output: { oneofKind: 'audioSeparate', audioSeparate: { artifacts, separation: runtimeAudioSeparation(audioSeparation) } } };
2119
2215
  case 'music-transcribe': return { output: { oneofKind: 'musicTranscribe', musicTranscribe: { artifacts, transcription: runtimeMusicTranscription(musicTranscription) } } };
@@ -2123,6 +2219,10 @@ function runtimeOutput(type, artifacts, transcriptionText, videoFaceSwapSummary,
2123
2219
  }
2124
2220
  }
2125
2221
  function runtimeScenarioType(type) {
2222
+ if (type === 'image-upscale')
2223
+ return ScenarioType.IMAGE_UPSCALE;
2224
+ if (type === 'video-upscale')
2225
+ return ScenarioType.VIDEO_UPSCALE;
2126
2226
  return ({ 'image-generate': ScenarioType.IMAGE_GENERATE, 'image-face-swap': ScenarioType.IMAGE_FACE_SWAP, 'video-face-swap': ScenarioType.VIDEO_FACE_SWAP, 'vision-locate': ScenarioType.VISION_LOCATE, 'video-generate': ScenarioType.VIDEO_GENERATE, 'speech-synthesize': ScenarioType.SPEECH_SYNTHESIZE, 'speech-transcribe': ScenarioType.SPEECH_TRANSCRIBE, 'text-annotate': ScenarioType.TEXT_ANNOTATE, 'audio-speaker-embed': ScenarioType.AUDIO_SPEAKER_EMBED, 'audio-separate': ScenarioType.AUDIO_SEPARATE, 'voice-create': ScenarioType.VOICE_CREATE, 'music-generate': ScenarioType.MUSIC_GENERATE, 'music-transcribe': ScenarioType.MUSIC_TRANSCRIBE, 'audio-voice-convert': ScenarioType.AUDIO_VOICE_CONVERT, 'world-generate': ScenarioType.WORLD_GENERATE })[type];
2127
2227
  }
2128
2228
  function runtimeJobStatus(status) {
@@ -2329,7 +2429,7 @@ function runtimeTranscriptionFromLocal(value) {
2329
2429
  return value ? { status: value.status === 'transcribed' ? SpeechTranscriptStatus.TRANSCRIBED : SpeechTranscriptStatus.NO_SPEECH, text: value.text, language: value.language, words: value.words.map((word) => ({ ...word })),
2330
2430
  ...(value.diarization ? { diarization: { status: value.diarization.status === 'diarized' ? SpeechDiarizationStatus.DIARIZED : SpeechDiarizationStatus.NO_SPEAKERS, durationSeconds: value.diarization.durationSeconds, intervals: value.diarization.intervals.map((interval) => ({ ...interval })) } } : {}) } : undefined;
2331
2431
  }
2332
- function runtimeAnnotationFromLocal(value) {
2432
+ function copyTextAnnotationResult(value) {
2333
2433
  return value ? { documents: value.documents.map((doc) => ({ text: doc.text, language: doc.language,
2334
2434
  tokens: doc.tokens.map((token) => ({ ...token })), sentences: doc.sentences.map((sentence) => ({ ...sentence })) })) } : undefined;
2335
2435
  }