@nativestudio/cli 0.3.0-rc.11 → 0.3.0-rc.15

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 (177) hide show
  1. package/COMPATIBILITY.json +14 -10
  2. package/components/runtime.json +10 -6
  3. package/components/runtime.tgz +0 -0
  4. package/dist/_chunks/chunk-5UJEP7FY.js +1 -0
  5. package/dist/_chunks/chunk-6UYY5KHI.js +1 -0
  6. package/dist/_chunks/chunk-AAGFHT2D.js +1 -0
  7. package/dist/_chunks/{chunk-M2KVQQ4X.js → chunk-BBTZJB2G.js} +1 -1
  8. package/dist/_chunks/chunk-BX2SNMA4.js +1 -0
  9. package/dist/_chunks/chunk-CFZNDURD.js +1 -0
  10. package/dist/_chunks/{chunk-3AVC742O.js → chunk-FX5UVDTH.js} +1 -1
  11. package/dist/_chunks/{chunk-HR34UMPP.js → chunk-H6EZKOYR.js} +1 -1
  12. package/dist/_chunks/chunk-I5KYSPUJ.js +1 -0
  13. package/dist/_chunks/chunk-KOCUZ3AE.js +1 -0
  14. package/dist/_chunks/{chunk-L543FEDK.js → chunk-NPDLPC5B.js} +1 -1
  15. package/dist/_chunks/{chunk-LISB5W7B.js → chunk-NQVUVPW5.js} +1 -1
  16. package/dist/_chunks/{chunk-EGUJ2YRX.js → chunk-O47YYPL7.js} +1 -1
  17. package/dist/_chunks/{chunk-65FQPXKC.js → chunk-OVIR77ET.js} +1 -1
  18. package/dist/_chunks/{chunk-VDNNFVTZ.js → chunk-OW6R4MAQ.js} +1 -1
  19. package/dist/_chunks/{chunk-ODGPV7MM.js → chunk-PB2HLRXG.js} +1 -1
  20. package/dist/_chunks/chunk-PDQYFIQQ.js +1 -0
  21. package/dist/_chunks/chunk-RUPH3HZ2.js +1 -0
  22. package/dist/_chunks/chunk-SAPEOZ2V.js +1 -0
  23. package/dist/_chunks/chunk-SKAVQ4UW.js +1 -0
  24. package/dist/_chunks/{chunk-4U4Y2K73.js → chunk-TTB7CYC5.js} +1 -1
  25. package/dist/_chunks/chunk-U5FT4VBR.js +1 -0
  26. package/dist/_chunks/chunk-VOGKKZQH.js +1 -0
  27. package/dist/_chunks/chunk-YV447AB5.js +1 -0
  28. package/dist/_chunks/{chunk-LUAH3KAS.js → chunk-ZADAXKKY.js} +1 -1
  29. package/dist/_chunks/{chunk-QAJH4RJQ.js → chunk-ZOODOQBH.js} +1 -1
  30. package/dist/_chunks/{connect-5YMO6MAR.js → connect-RIODOO3C.js} +1 -1
  31. package/dist/_chunks/{device-management-2OTGEBJQ.js → device-management-VECG3RA4.js} +1 -1
  32. package/dist/_chunks/{device-preflight-XPHFZGLO.js → device-preflight-73KVSHZG.js} +1 -1
  33. package/dist/_chunks/{devices-inventory-VWNTU5TE.js → devices-inventory-E6TE4H7T.js} +1 -1
  34. package/dist/_chunks/{devices-main-VQ4APRVS.js → devices-main-7JHMJNGV.js} +1 -1
  35. package/dist/_chunks/{files-TTIQ7LYJ.js → files-72BEXD7E.js} +1 -1
  36. package/dist/_chunks/{host-main-H7DPLV7B.js → host-main-KDORT44Q.js} +1 -1
  37. package/dist/_chunks/http-profile-QINBH2FP.js +1 -0
  38. package/dist/_chunks/{library-main-SAC3V2ML.js → library-main-AWUEMZFQ.js} +1 -1
  39. package/dist/_chunks/local-main-BNFNAPRG.js +1 -0
  40. package/dist/_chunks/{local-mcp-ONCANLPH.js → local-mcp-HU6MII3G.js} +1 -1
  41. package/dist/_chunks/main-BSMCHALI.js +2 -0
  42. package/dist/_chunks/mcp-3VZZFXNG.js +1 -0
  43. package/dist/_chunks/oauth-QBJ62PIA.js +1 -0
  44. package/dist/_chunks/observe-entry-D7F6OQ7Y.js +1 -0
  45. package/dist/_chunks/remote-client-XIJ6RQLU.js +1 -0
  46. package/dist/_chunks/{render-main-GYWKP72O.js → render-main-O3IN6EFV.js} +1 -1
  47. package/dist/_chunks/{source-import-BC5GNCUZ.js → source-import-Y2Z3BVWY.js} +1 -1
  48. package/dist/_chunks/src-3S6CAUSJ.js +1 -0
  49. package/dist/_chunks/{stdio-main-RIJS5REB.js → stdio-main-T4WMBNKB.js} +1 -1
  50. package/dist/_chunks/workspace-main-KWFTVTZG.js +1 -0
  51. package/dist/_types/cli/local/desktop-contract.d.ts +64 -6
  52. package/dist/_types/cli/local/desktop-device-contract.d.ts +25 -12
  53. package/dist/_types/cli/local/desktop-device-owner.d.ts +34 -8
  54. package/dist/_types/cli/local/desktop-device-state.d.ts +64 -12
  55. package/dist/_types/cli/local/desktop-owner.d.ts +58 -9
  56. package/dist/_types/cli/local/ledger.d.ts +10 -10
  57. package/dist/_types/cli/local/manager.d.ts +121 -18
  58. package/dist/_types/cli/local/mcp-tools.d.ts +14 -13
  59. package/dist/_types/cli/local/releases.d.ts +2 -2
  60. package/dist/_types/cli/local-management.d.ts +3 -0
  61. package/dist/_types/contracts/artifact-discovery.d.ts +60 -0
  62. package/dist/_types/contracts/audio.d.ts +162 -0
  63. package/dist/_types/contracts/consistency-profile.d.ts +102 -6
  64. package/dist/_types/contracts/continuity-evaluation.d.ts +1 -1
  65. package/dist/_types/contracts/delivery-operations.d.ts +150 -0
  66. package/dist/_types/contracts/device-render.d.ts +2 -0
  67. package/dist/_types/contracts/editor-intelligence.d.ts +280 -42
  68. package/dist/_types/contracts/final-render.d.ts +188 -24
  69. package/dist/_types/contracts/human-links.d.ts +58 -0
  70. package/dist/_types/contracts/index.d.ts +8 -0
  71. package/dist/_types/contracts/interface/media-output.d.ts +90 -0
  72. package/dist/_types/contracts/interface/operation.d.ts +30 -0
  73. package/dist/_types/contracts/interface/production-snapshot.d.ts +60 -0
  74. package/dist/_types/contracts/interface/query.d.ts +60 -0
  75. package/dist/_types/contracts/keyframe-generation.d.ts +1 -1
  76. package/dist/_types/contracts/lifecycle-event-projections.d.ts +15 -0
  77. package/dist/_types/contracts/lifecycle-events.d.ts +53 -1
  78. package/dist/_types/contracts/local-execution/agent-context.d.ts +23 -3
  79. package/dist/_types/contracts/local-execution/agent-review.d.ts +29 -3
  80. package/dist/_types/contracts/local-execution/audio-profile.d.ts +6 -0
  81. package/dist/_types/contracts/local-execution/cpu-preparation.d.ts +46 -0
  82. package/dist/_types/contracts/local-execution/cpu-resources.d.ts +55 -0
  83. package/dist/_types/contracts/local-execution/cpu-speech-job.d.ts +70 -0
  84. package/dist/_types/contracts/local-execution/cpu-speech.d.ts +161 -0
  85. package/dist/_types/contracts/local-execution/descriptor.d.ts +1 -1
  86. package/dist/_types/contracts/local-execution/device-inventory.d.ts +2 -2
  87. package/dist/_types/contracts/local-execution/device.d.ts +3 -3
  88. package/dist/_types/contracts/local-execution/index.d.ts +6 -0
  89. package/dist/_types/contracts/local-execution/ipc.d.ts +18 -2
  90. package/dist/_types/contracts/local-execution/library-result.d.ts +16 -0
  91. package/dist/_types/contracts/local-execution/lifecycle.d.ts +49 -7
  92. package/dist/_types/contracts/local-execution/local-navigation.d.ts +15 -14
  93. package/dist/_types/contracts/local-execution/management.d.ts +15 -11
  94. package/dist/_types/contracts/local-execution/preview.d.ts +38 -3
  95. package/dist/_types/contracts/local-execution/processor-capability.d.ts +2 -0
  96. package/dist/_types/contracts/local-execution/processor-recipes.d.ts +43 -0
  97. package/dist/_types/contracts/local-execution/processor-toolchain.d.ts +47 -0
  98. package/dist/_types/contracts/local-execution/processor.d.ts +184 -3
  99. package/dist/_types/contracts/local-execution/speech.d.ts +1 -1
  100. package/dist/_types/contracts/local-execution/tool-selection.d.ts +26 -0
  101. package/dist/_types/contracts/local-execution/work.d.ts +16 -2
  102. package/dist/_types/contracts/native-speech-model.d.ts +53 -0
  103. package/dist/_types/contracts/native-speech-options.d.ts +25 -0
  104. package/dist/_types/contracts/navigation-context.d.ts +2 -2
  105. package/dist/_types/contracts/navigation-groups.d.ts +1 -1
  106. package/dist/_types/contracts/navigation.d.ts +35 -5
  107. package/dist/_types/contracts/production-creation.d.ts +30 -0
  108. package/dist/_types/contracts/production-feedback.d.ts +452 -0
  109. package/dist/_types/contracts/production.d.ts +30 -0
  110. package/dist/_types/contracts/project-library.d.ts +30 -0
  111. package/dist/_types/contracts/project.d.ts +30 -0
  112. package/dist/_types/contracts/provider-models.d.ts +193 -0
  113. package/dist/_types/contracts/repair-lifecycle.d.ts +4 -4
  114. package/dist/_types/contracts/repair-plan.d.ts +1 -1
  115. package/dist/_types/contracts/repair-strategy.d.ts +9 -5
  116. package/dist/_types/contracts/review-intelligence-final-output.d.ts +90 -0
  117. package/dist/_types/contracts/review-intelligence.d.ts +3 -1
  118. package/dist/_types/contracts/rough-cut-manifest.d.ts +19 -4
  119. package/dist/_types/contracts/rough-cut-review.d.ts +10 -1
  120. package/dist/_types/contracts/rough-cut.d.ts +111 -12
  121. package/dist/_types/contracts/shares.d.ts +135 -0
  122. package/dist/_types/contracts/shot-preparation-basis.d.ts +2 -2
  123. package/dist/_types/contracts/shot-preparation.d.ts +4 -4
  124. package/dist/_types/contracts/sound-making-plan.d.ts +207 -0
  125. package/dist/_types/contracts/speech-cost.d.ts +15 -0
  126. package/dist/_types/contracts/speech-parameters.d.ts +39 -0
  127. package/dist/_types/contracts/speech.d.ts +470 -39
  128. package/dist/_types/contracts/timeline-audio.d.ts +19 -4
  129. package/dist/_types/contracts/timeline-manifest.d.ts +38 -8
  130. package/dist/_types/contracts/timeline-source-sound.d.ts +41 -4
  131. package/dist/_types/contracts/timeline-v2.d.ts +120 -16
  132. package/dist/_types/contracts/timeline-version-reader.d.ts +278 -40
  133. package/dist/_types/contracts/timeline-visual-layers.d.ts +120 -16
  134. package/dist/_types/contracts/video-generation.d.ts +1 -1
  135. package/dist/_types/contracts/visual-exploration.d.ts +1 -1
  136. package/dist/_types/contracts/visual-layer-render.d.ts +240 -32
  137. package/dist/_types/contracts/visual-sequence.d.ts +1 -1
  138. package/dist/_types/contracts/voice-consistency.d.ts +183 -0
  139. package/dist/_types/contracts/voice-profile/contracts.d.ts +821 -0
  140. package/dist/_types/contracts/voice-profile/identity.d.ts +27 -0
  141. package/dist/_types/contracts/voice-profile/interface.d.ts +89 -0
  142. package/dist/_types/contracts/voice-profile/reference.d.ts +106 -0
  143. package/dist/_types/contracts/voice-review.d.ts +1194 -0
  144. package/dist/_types/contracts/workspace.d.ts +51 -0
  145. package/dist/_types/sdk/local-runtime/device-client.d.ts +54 -2
  146. package/dist/_types/sdk/local-runtime-client.d.ts +169 -28
  147. package/dist/entry.js +1 -1
  148. package/dist/local-management.js +1 -1
  149. package/dist/local-navigation.js +1 -1
  150. package/dist/native/helper.exe +0 -0
  151. package/dist/native/helper.json +1 -0
  152. package/package.json +1 -1
  153. package/dist/_chunks/chunk-37PAJCKA.js +0 -1
  154. package/dist/_chunks/chunk-6DVZBKNV.js +0 -1
  155. package/dist/_chunks/chunk-6LU6GJKW.js +0 -1
  156. package/dist/_chunks/chunk-6N433ZWR.js +0 -1
  157. package/dist/_chunks/chunk-FU3524Z6.js +0 -1
  158. package/dist/_chunks/chunk-GZBWA4YN.js +0 -1
  159. package/dist/_chunks/chunk-KB2GVAN7.js +0 -1
  160. package/dist/_chunks/chunk-PUBMDP4E.js +0 -1
  161. package/dist/_chunks/chunk-PUNG4ND7.js +0 -1
  162. package/dist/_chunks/chunk-Q57YFNK5.js +0 -1
  163. package/dist/_chunks/chunk-VPYAXWXY.js +0 -1
  164. package/dist/_chunks/chunk-WFRRNWO5.js +0 -1
  165. package/dist/_chunks/http-profile-MNJX6OXO.js +0 -1
  166. package/dist/_chunks/local-main-D6B3APK6.js +0 -1
  167. package/dist/_chunks/main-PW6HB3NC.js +0 -2
  168. package/dist/_chunks/mcp-ZIGBYFUW.js +0 -1
  169. package/dist/_chunks/oauth-HC6TI7HB.js +0 -1
  170. package/dist/_chunks/src-R6DNU336.js +0 -1
  171. package/dist/_chunks/workspace-main-GNSKHKBG.js +0 -1
  172. package/dist/native/Bootstrap.ps1 +0 -90
  173. package/dist/native/JobNative.cs +0 -137
  174. package/dist/native/JobRunner.cs +0 -381
  175. package/dist/native/NativeMain.cs +0 -161
  176. package/dist/native/PipeBridge.cs +0 -260
  177. package/dist/native/PrivateAccess.cs +0 -152
@@ -1,3 +1,3 @@
1
- import{secureEndpoint}from"./chunk-PUNG4ND7.js";import{spawn}from"node:child_process";import{join,isAbsolute}from"node:path";function loginLink(url){secureEndpoint(url.split("?")[0]);process.stderr.write(`Authorize NativeStudio in your browser:
1
+ import{secureEndpoint}from"./chunk-KOCUZ3AE.js";import{spawn}from"node:child_process";import{join,isAbsolute}from"node:path";function loginLink(url){secureEndpoint(url.split("?")[0]);process.stderr.write(`Authorize NativeStudio in your browser:
2
2
  ${url}
3
3
  `)}async function openLoginBrowser(url,signal){loginLink(url);let executable,args;if(process.platform==="darwin"){executable="/usr/bin/open";args=[url]}else if(process.platform==="linux"){executable="/usr/bin/xdg-open";args=[url]}else if(process.platform==="win32"&&process.env.SystemRoot&&isAbsolute(process.env.SystemRoot)){executable=join(process.env.SystemRoot,"System32","rundll32.exe");args=["url.dll,FileProtocolHandler",url]}else return;await new Promise(resolve=>{const child=spawn(executable,args,{shell:false,stdio:"ignore",windowsHide:true});const done=()=>{clearTimeout(timer);signal.removeEventListener("abort",stop);resolve()};const stop=()=>{child.kill();done()};const timer=setTimeout(stop,3e3);child.once("error",done);child.once("exit",done);signal.addEventListener("abort",stop,{once:true});if(signal.aborted)stop()})}export{loginLink,openLoginBrowser};
@@ -1 +1 @@
1
- import{NativeStudioLocalRuntimeClient,catalogue}from"./chunk-HR34UMPP.js";import{fail,optional}from"./chunk-KB2GVAN7.js";import{LocalExecutionInspectInputSchema,LocalExecutionListInputSchema,LocalLibraryGetSchema,LocalLibraryProjectionPageSchema,LocalLibraryProjectionQuerySchema,LocalMcpOutputSchemas}from"./chunk-GZBWA4YN.js";import{z}from"zod";import{join}from"node:path";var localTools={local_library_list:{description:"Read bounded metadata projections of this device library in an explicitly authorized Project. No paths, bytes, import or native admission.",input:LocalLibraryProjectionQuerySchema},local_library_get:{description:"Read metadata for one exact authorized local-file version. This does not inspect/decode bytes or create a Job.",input:LocalLibraryGetSchema.omit({ownerKey:true})},local_navigate:{description:"Local execution entry. Discover Project-scoped Runtime progress, recovery and updates. Native writes remain with the cloud owner.",input:z.strictObject({intent:z.string().max(500).optional()})},local_capability_describe:{description:"Inspect the exact public schema for a local capability. Standard discovery stays stable; each call validates current Runtime authority.",input:z.strictObject({tool:z.enum(["local_runtime_status","local_execution_list","local_execution_inspect","local_update_check","local_library_list","local_library_get"])})},local_runtime_status:{description:"Read current authorized local Runtime status. Does not start, stop or mutate native work.",input:z.strictObject({})},local_execution_list:{description:"List a bounded page of pending local execution identities in one authorized Project, then inspect an exact native Job.",input:LocalExecutionListInputSchema},local_execution_inspect:{description:"Inspect one exact native Job in the authorized Project. Native Job/Attempt identity remains authoritative.",input:LocalExecutionInspectInputSchema},local_update_check:{description:"Read signed compatible release metadata only. No executable download, approval, installation or restart.",input:z.strictObject({})}};var LocalMcpTools=class _LocalMcpTools{constructor(client,home,library=false){this.client=client;this.home=home;this.library=library}client;home;library;static async open(connector,home,library=false){const client=await NativeStudioLocalRuntimeClient.fromConnector(connector);let enabled=false;if(library){try{enabled=(await client.library.capability()).available}catch{}}return new _LocalMcpTools(client,home,enabled)}get names(){return Object.keys(localTools).filter(name=>this.library||!name.startsWith("local_library_"))}schema(name){if(!this.names.includes(name))fail("CAPABILITY_UNAVAILABLE");return{name,description:localTools[name].description,inputSchema:z.toJSONSchema(localTools[name].input,{io:"input"}),outputSchema:z.toJSONSchema(LocalMcpOutputSchemas[name],{io:"output",reused:"ref"}),annotations:{readOnlyHint:true,destructiveHint:false,openWorldHint:name==="local_update_check"}}}async call(name,raw,signal){return LocalMcpOutputSchemas[name].parse(await this.invoke(name,raw,signal))}async invoke(name,raw,signal){const input=localTools[name].input.parse(raw);if(name==="local_library_list"){if(!this.library)fail("CAPABILITY_UNAVAILABLE");return{location:"LOCAL",...LocalLibraryProjectionPageSchema.parse(await this.client.library.call({...input,action:"scoped-list"},signal))}}if(name==="local_library_get"){if(!this.library)fail("CAPABILITY_UNAVAILABLE");return{location:"LOCAL",item:await this.client.library.call({...input,action:"scoped-get"},signal)}}if(name==="local_capability_describe")return{location:"LOCAL",tool:input.tool,schema:this.schema(input.tool)};if(name==="local_navigate"){let status;try{status=await this.client.status(signal,true)}catch{return{location:"LOCAL",state:"UNAVAILABLE",groups:[],nextActions:[{surface:"CLI",operation:"local.grant",availability:"BLOCKED",reason:"AUTHORIZATION_REQUIRED"}]}}return{location:"LOCAL",state:status.state,...status.deviceAuthority?{deviceAuthority:status.deviceAuthority}:{},groups:[...this.library?[{id:"library",label:"Scoped local media metadata",tools:["local_library_list","local_library_get"]}]:[],{id:"execution",label:"Local execution and recovery",tools:["local_runtime_status","local_execution_list","local_execution_inspect"]},{id:"versions",label:"Versions and updates",tools:["local_update_check"]}],nextActions:[{tool:"local_capability_describe",arguments:{tool:"local_execution_list"},availability:"AVAILABLE",reason:"READY"},...status.state==="RECOVERY_REQUIRED"?[{surface:"CLI",operation:"local.status",availability:"AVAILABLE",reason:"RECOVERY_REQUIRED"}]:[]]}}if(name==="local_runtime_status")return{...await this.client.status(signal),nextActions:[{tool:"local_capability_describe",arguments:{tool:"local_execution_list"}}]};if(name==="local_execution_list"){const page=await this.client.executions(LocalExecutionListInputSchema.parse(input),signal);return{...page,nextActions:page.items.map(item=>({tool:"local_execution_inspect",arguments:{tenantId:item.binding.tenantId,projectId:item.binding.projectId,productionId:item.binding.productionId,runtimeJobId:item.binding.runtimeJobId}}))}}if(name==="local_execution_inspect")return{location:"LOCAL",execution:await this.client.inspect(LocalExecutionInspectInputSchema.parse(input),signal),nextActions:[]};if(name==="local_update_check"){const current=await this.client.status(signal);const raw2=await optional(join(this.home,"configuration.json"));const config=z.object({catalogueUrl:z.string().url(),publicKeyFile:z.string()}).parse(raw2);const v=await catalogue(config,signal);return{location:"LOCAL",running:current.versions,available:v.signed.catalogue.releases.filter(r=>r.descriptor.platform.os===process.platform&&r.descriptor.platform.architecture===process.arch).map(r=>r.descriptor),nextActions:[{surface:"CLI",operation:"local.update.prepare",availability:"BLOCKED",reason:"USER_APPROVAL_REQUIRED"}]}}fail("CAPABILITY_UNAVAILABLE")}};export{localTools,LocalMcpTools};
1
+ import{NativeStudioLocalRuntimeClient,catalogue}from"./chunk-H6EZKOYR.js";import{LocalExecutionInspectInputSchema,LocalExecutionListInputSchema,LocalLibraryGetSchema,LocalLibraryProjectionPageSchema,LocalLibraryProjectionQuerySchema,LocalMcpOutputSchemas}from"./chunk-PDQYFIQQ.js";import{fail,optional}from"./chunk-RUPH3HZ2.js";import{z}from"zod";import{join}from"node:path";var localTools={local_library_list:{description:"Read bounded metadata projections of this device library in an explicitly authorized Project. No paths, bytes, import or native admission.",input:LocalLibraryProjectionQuerySchema},local_library_get:{description:"Read metadata for one exact authorized local-file version. This does not inspect/decode bytes or create a Job.",input:LocalLibraryGetSchema.omit({ownerKey:true})},local_navigate:{description:"Local execution entry. Discover Project-scoped Runtime progress, recovery and updates. Native writes remain with the cloud owner.",input:z.strictObject({intent:z.string().max(500).optional()})},local_capability_describe:{description:"Inspect the exact public schema for a local capability. Standard discovery stays stable; each call validates current Runtime authority.",input:z.strictObject({tool:z.enum(["local_runtime_status","local_execution_list","local_execution_inspect","local_update_check","local_library_list","local_library_get"])})},local_runtime_status:{description:"Read current authorized local Runtime status. Does not start, stop or mutate native work.",input:z.strictObject({})},local_execution_list:{description:"List a bounded page of pending local execution identities in one authorized Project, then inspect an exact native Job.",input:LocalExecutionListInputSchema},local_execution_inspect:{description:"Inspect one exact native Job in the authorized Project. Native Job/Attempt identity remains authoritative.",input:LocalExecutionInspectInputSchema},local_update_check:{description:"Read signed compatible release metadata only. No executable download, approval, installation or restart.",input:z.strictObject({})}};var LocalMcpTools=class _LocalMcpTools{constructor(client,home,library=false){this.client=client;this.home=home;this.library=library}client;home;library;static async open(connector,home,library=false){const client=await NativeStudioLocalRuntimeClient.fromConnector(connector);let enabled=false;if(library){try{enabled=(await client.library.capability()).available}catch{}}return new _LocalMcpTools(client,home,enabled)}get names(){return Object.keys(localTools).filter(name=>this.library||!name.startsWith("local_library_"))}schema(name){if(!this.names.includes(name))fail("CAPABILITY_UNAVAILABLE");return{name,description:localTools[name].description,inputSchema:z.toJSONSchema(localTools[name].input,{io:"input"}),outputSchema:z.toJSONSchema(LocalMcpOutputSchemas[name],{io:"output",reused:"ref"}),annotations:{readOnlyHint:true,destructiveHint:false,openWorldHint:name==="local_update_check"}}}async call(name,raw,signal){return LocalMcpOutputSchemas[name].parse(await this.invoke(name,raw,signal))}async invoke(name,raw,signal){const input=localTools[name].input.parse(raw);if(name==="local_library_list"){if(!this.library)fail("CAPABILITY_UNAVAILABLE");return{location:"LOCAL",...LocalLibraryProjectionPageSchema.parse(await this.client.library.call({...input,action:"scoped-list"},signal))}}if(name==="local_library_get"){if(!this.library)fail("CAPABILITY_UNAVAILABLE");return{location:"LOCAL",item:await this.client.library.call({...input,action:"scoped-get"},signal)}}if(name==="local_capability_describe")return{location:"LOCAL",tool:input.tool,schema:this.schema(input.tool)};if(name==="local_navigate"){let status;try{status=await this.client.status(signal,true)}catch{return{location:"LOCAL",state:"UNAVAILABLE",groups:[],nextActions:[{surface:"CLI",operation:"local.grant",availability:"BLOCKED",reason:"AUTHORIZATION_REQUIRED"}]}}return{location:"LOCAL",state:status.state,...status.deviceAuthority?{deviceAuthority:status.deviceAuthority}:{},groups:[...this.library?[{id:"library",label:"Scoped local media metadata",tools:["local_library_list","local_library_get"]}]:[],{id:"execution",label:"Local execution and recovery",tools:["local_runtime_status","local_execution_list","local_execution_inspect"]},{id:"versions",label:"Versions and updates",tools:["local_update_check"]}],nextActions:[{tool:"local_capability_describe",arguments:{tool:"local_execution_list"},availability:"AVAILABLE",reason:"READY"},...status.state==="RECOVERY_REQUIRED"?[{surface:"CLI",operation:"local.status",availability:"AVAILABLE",reason:"RECOVERY_REQUIRED"}]:[]]}}if(name==="local_runtime_status")return{...await this.client.status(signal),nextActions:[{tool:"local_capability_describe",arguments:{tool:"local_execution_list"}}]};if(name==="local_execution_list"){const page=await this.client.executions(LocalExecutionListInputSchema.parse(input),signal);return{...page,nextActions:page.items.map(item=>({tool:"local_execution_inspect",arguments:{tenantId:item.binding.tenantId,projectId:item.binding.projectId,productionId:item.binding.productionId,runtimeJobId:item.binding.runtimeJobId}}))}}if(name==="local_execution_inspect")return{location:"LOCAL",execution:await this.client.inspect(LocalExecutionInspectInputSchema.parse(input),signal),nextActions:[]};if(name==="local_update_check"){const current=await this.client.status(signal);const raw2=await optional(join(this.home,"configuration.json"));const config=z.object({catalogueUrl:z.string().url(),publicKeyFile:z.string()}).parse(raw2);const v=await catalogue(config,signal);return{location:"LOCAL",running:current.versions,available:v.signed.catalogue.releases.filter(r=>r.descriptor.platform.os===process.platform&&r.descriptor.platform.architecture===process.arch).map(r=>r.descriptor),nextActions:[{surface:"CLI",operation:"local.update.prepare",availability:"BLOCKED",reason:"USER_APPROVAL_REQUIRED"}]}}fail("CAPABILITY_UNAVAILABLE")}};export{localTools,LocalMcpTools};