@nativestudio/sdk 0.3.0-rc.21 → 0.3.0-rc.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COMPATIBILITY.json +4 -4
- package/dist/_chunks/chunk-65Q3RST6.js +1 -0
- package/dist/_chunks/{chunk-K3TIFCD3.js → chunk-7VBZYNHE.js} +1 -1
- package/dist/_chunks/chunk-B5QT3BVS.js +1 -0
- package/dist/_chunks/chunk-KONHIJPZ.js +1 -0
- package/dist/_chunks/{chunk-WNXKJRZ6.js → chunk-RUWGYN4N.js} +1 -1
- package/dist/_chunks/{chunk-QVP4AMRJ.js → chunk-SCY6PJRK.js} +1 -1
- package/dist/_chunks/chunk-XPDAOUQ7.js +1 -0
- package/dist/_types/contracts/artifact.d.ts +2 -0
- package/dist/_types/contracts/component-status.d.ts +9 -0
- package/dist/_types/contracts/device-openai-asr.d.ts +479 -0
- package/dist/_types/contracts/device-render.d.ts +6 -0
- package/dist/_types/contracts/external-agent-access.d.ts +7 -0
- package/dist/_types/contracts/index.d.ts +3 -0
- package/dist/_types/contracts/interface/media-output.d.ts +4 -1
- package/dist/_types/contracts/interface/operation.d.ts +44 -0
- package/dist/_types/contracts/interface/production-snapshot.d.ts +39 -0
- package/dist/_types/contracts/interface/query.d.ts +38 -0
- package/dist/_types/contracts/local-execution/backup-retirement.d.ts +162 -0
- package/dist/_types/contracts/local-execution/claim-resolution.d.ts +1470 -0
- package/dist/_types/contracts/local-execution/components.d.ts +1 -1
- package/dist/_types/contracts/local-execution/cpu-preparation.d.ts +23 -0
- package/dist/_types/contracts/local-execution/credential-request.d.ts +20 -0
- package/dist/_types/contracts/local-execution/external-generation.d.ts +59 -2
- package/dist/_types/contracts/local-execution/index.d.ts +12 -0
- package/dist/_types/contracts/local-execution/ipc.d.ts +27 -0
- package/dist/_types/contracts/local-execution/library-command.d.ts +303 -5
- package/dist/_types/contracts/local-execution/library-result.d.ts +217 -3
- package/dist/_types/contracts/local-execution/lifecycle.d.ts +35 -0
- package/dist/_types/contracts/local-execution/local-navigation.d.ts +3 -0
- package/dist/_types/contracts/local-execution/management.d.ts +12 -12
- package/dist/_types/contracts/local-execution/model-cleanup.d.ts +60 -0
- package/dist/_types/contracts/local-execution/model-inspection.d.ts +365 -0
- package/dist/_types/contracts/local-execution/openai-asr.d.ts +105 -0
- package/dist/_types/contracts/local-execution/openai-realtime-speech.d.ts +151 -0
- package/dist/_types/contracts/local-execution/preview.d.ts +15 -4
- package/dist/_types/contracts/local-execution/processor-capability.d.ts +6 -0
- package/dist/_types/contracts/local-execution/processor-direct.d.ts +140 -4
- package/dist/_types/contracts/local-execution/processor-outcomes.d.ts +145 -0
- package/dist/_types/contracts/local-execution/processor-recipes.d.ts +163 -3
- package/dist/_types/contracts/local-execution/processor.d.ts +2422 -322
- package/dist/_types/contracts/local-execution/project-source-direct.d.ts +1 -0
- package/dist/_types/contracts/local-execution/provider-inspection.d.ts +58 -0
- package/dist/_types/contracts/local-execution/provider-release.d.ts +53 -0
- package/dist/_types/contracts/local-execution/provider-selection.d.ts +58 -0
- package/dist/_types/contracts/local-execution/recognition.d.ts +30 -0
- package/dist/_types/contracts/local-execution/speech.d.ts +1 -1
- package/dist/_types/contracts/local-execution/versions.d.ts +2 -0
- package/dist/_types/contracts/media-observation.d.ts +56 -0
- package/dist/_types/contracts/native-speech-http.d.ts +15 -0
- package/dist/_types/contracts/navigation-context.d.ts +144 -0
- package/dist/_types/contracts/navigation-groups.d.ts +1 -1
- package/dist/_types/contracts/navigation.d.ts +2 -0
- package/dist/_types/contracts/observation-profile.d.ts +12 -0
- package/dist/_types/contracts/openai-asr.d.ts +55 -0
- package/dist/_types/contracts/provider-catalog.d.ts +44 -0
- package/dist/_types/contracts/provider-models.d.ts +115 -3
- package/dist/_types/contracts/provider.d.ts +93 -7
- package/dist/_types/contracts/render-readiness.d.ts +74 -1
- package/dist/_types/contracts/repair-strategy.d.ts +1 -1
- package/dist/_types/contracts/resourcesdk.d.ts +231 -0
- package/dist/_types/contracts/sound-making-plan.d.ts +41 -0
- package/dist/_types/contracts/source-workspace.d.ts +2 -0
- package/dist/_types/contracts/speech-cost.d.ts +129 -0
- package/dist/_types/contracts/speech.d.ts +50 -0
- package/dist/_types/contracts/transcription.d.ts +11 -0
- package/dist/_types/sdk/catalog/carriers.d.ts +40 -0
- package/dist/_types/sdk/catalog/core.d.ts +164 -4
- package/dist/_types/sdk/catalog/device-library.d.ts +360 -4
- package/dist/_types/sdk/catalog/device-management.d.ts +16 -6
- package/dist/_types/sdk/catalog/imported-visual.d.ts +990 -22
- package/dist/_types/sdk/catalog/mcp.d.ts +12 -0
- package/dist/_types/sdk/catalog/media-observation.d.ts +630 -18
- package/dist/_types/sdk/catalog/navigation.d.ts +241 -4
- package/dist/_types/sdk/catalog/provider.d.ts +272 -98
- package/dist/_types/sdk/catalog/reference-preview.d.ts +52 -0
- package/dist/_types/sdk/catalog/resourcesdk.d.ts +573 -0
- package/dist/_types/sdk/catalog/speech.d.ts +98 -8
- package/dist/_types/sdk/client.d.ts +28 -1
- package/dist/_types/sdk/device-renders.d.ts +4 -1
- package/dist/_types/sdk/direct-source.d.ts +47 -1
- package/dist/_types/sdk/index.d.ts +2 -0
- package/dist/_types/sdk/local-runtime/components.d.ts +6 -0
- package/dist/_types/sdk/local-runtime-client.d.ts +35 -23
- package/dist/_types/sdk/navigation-client.d.ts +2 -0
- package/dist/_types/sdk/navigation-facade.d.ts +113 -0
- package/dist/_types/sdk/observe.d.ts +26 -0
- package/dist/_types/sdk/resource-data-plane.d.ts +108 -0
- package/dist/_types/sdk/resource-ingress.d.ts +18 -0
- package/dist/_types/sdk/transport/http.d.ts +1 -0
- package/dist/account.js +1 -1
- package/dist/host-protocol.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/local-runtime.js +1 -1
- package/dist/mcp-discovery.js +1 -1
- package/dist/runtime-authority.js +1 -1
- package/package.json +3 -2
- package/dist/_chunks/chunk-2QDPFLIO.js +0 -1
- package/dist/_chunks/chunk-7DXSLHXW.js +0 -1
- package/dist/_chunks/chunk-ASUZJSEP.js +0 -1
- package/dist/_chunks/chunk-Q53Q74OP.js +0 -1
- package/dist/_chunks/chunk-UKPD77FB.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{FederationFailureCodeSchema}from"./chunk-NNDKZ5H5.js";import{CapabilityVersionMismatchSchema,InterfaceSemanticStatusSchema,TenantIdSchema}from"./chunk-AFUVP2DC.js";import{NativeStudioSdkError,sdkInputError}from"./chunk-TT7IA5HB.js";function descriptorOperation(input,output,request,expectedPath){return Object.freeze({...operation(input,output,request,[],{readOnly:true}),expectedPath})}function operation(input,output,request,identity=[],options={}){return Object.freeze({input,output,request,identity,readOnly:options.readOnly,expectedPath:void 0,identityWhenPresent:options.identityWhenPresent??[]})}function path(...parts){return"/v1/"+parts.map(value=>encodeURIComponent(value)).join("/")}function pageQuery(input){return{limit:input.limit,next:input.next}}function mcpOperation(input,output,readOnly,identity=[],expectedPath){return Object.freeze({input,output,request:null,readOnly,identity,expectedPath,identityWhenPresent:[]})}var scopeKeys=["tenantId","projectId","productionId"];function navigationResponseMatches(value){if(!value||typeof value!=="object")return true;const result=value;const lean=result.view==="ACTIONS";if(result.evidence?.source!=="production_snapshot")return true;if(!result.actions?.items||!lean&&!result.operations?.items)return false;const same2=(a,b)=>typeof a==="string"&&typeof b==="string"&&a.toLowerCase()===b.toLowerCase();const hintsMatch=input=>!input||scopeKeys.every(key=>input[key]===void 0||same2(input[key],result[key]));if(lean){const link=result.overview;if(!link||link.tool!=="studio_capability_query"||link.arguments.tool!=="studio_navigate"||!hintsMatch(link.arguments)||!hintsMatch(link.arguments.arguments)||result.state?.revision!==result.evidence.revision)return false}return result.actions.items.every(action=>(lean?action.context===void 0:!!action.context&&scopeKeys.every(key=>same2(action.context[key],result[key]))&&action.context.revision===result.evidence.revision)&&hintsMatch(action.inputHints?.knownInputs)&&hintsMatch(action.inspect?.arguments))&&(lean||result.operations.items.every(operation2=>{return[operation2.inspect,operation2.failure?.next].every(read=>{if(!read)return true;const selected=read.tool==="studio_capability_query"?read.arguments:read;return hintsMatch(read.arguments)&&hintsMatch(selected.arguments)&&("operationId"in selected.arguments?selected.arguments.operationId===operation2.id:selected.tool!=="operation_get")})}))}var envelopes=new Set(["choices","related","operations","activeOperations","items","project","production","productions","artifact","primaryRepresentation","relations","storyVersion","planVersion","version","manifest","timeline","basis","review","selection","decision","target","admission","policy","finalDelivery","receipt","render","evidence","source","sourceIdentity","preparation","link","body","latestReview","finalReady","approval","binding","standard","snapshot","sequence","frames","frameOutput","acceptance","reference","candidate","connection","scope","profile","current","feedback","share","ownerContext","comparison","candidates","reviewContext","input","recordDraft","owner","output","result","briefVersion","deliveryTarget","deliverySnapshot","validation","preparations","view","generationDrafts","request","generation","handoff","mediaRead","reviewTarget","reviews"]);var uuid=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function same(left,right){if(Array.isArray(left)||Array.isArray(right))return Array.isArray(left)&&Array.isArray(right)&&left.length===right.length&&left.every((item,i)=>same(item,right[i]));if(left&&right&&typeof left==="object"&&typeof right==="object"){const a=left,b=right;const keys=Object.keys(a);return keys.length===Object.keys(b).length&&keys.every(key=>Object.hasOwn(b,key)&&same(a[key],b[key]))}return typeof left==="string"&&typeof right==="string"&&uuid.test(left)&&uuid.test(right)?left.toLowerCase()===right.toLowerCase():left===right}function scopeMatches(value,scope,depth=0){if(!value||typeof value!=="object")return true;if(depth>12)return false;if(Array.isArray(value))return value.every(item=>scopeMatches(item,scope,depth+1));const record=value;for(const key of["tenantId","projectId","productionId"])if(scope[key]!==void 0&&record[key]!==void 0&&record[key]!==null&&!same(record[key],scope[key]))return false;const next=record.failure?.next;if((next?.capability==="operation.get"||next?.capability==="production.snapshot")&&typeof record.id==="string"&&typeof record.productionId==="string"&&(!next.input||!same(next.input.productionId,record.productionId)||scope.tenantId!==void 0&&!same(next.input.tenantId,scope.tenantId)||next.capability==="operation.get"&&next.input.operationId!==record.id))return false;return Object.entries(record).every(([key,item])=>{if(key==="feedback"&&item&&typeof item==="object"&&scope.operationId!==void 0&&!same(item.operationId,scope.operationId))return false;return!envelopes.has(key)||scopeMatches(item,scope,depth+1)})}function targetsMatch(value,parts,expected){if(!parts.length)return same(value,expected);const[part,...rest]=parts;if(part==="*")return Array.isArray(value)&&value.every(item=>targetsMatch(item,rest,expected));return!!value&&typeof value==="object"&&targetsMatch(value[part],rest,expected)}function deviceBound(request,result){const target=request;const receipt=result?.deviceExecution;if(target.mode===void 0)return receipt?.target==="TENANT_DEVICE"&&typeof result?.runtimeJobId==="string"&&(!target.deviceId||same(target.deviceId,receipt.deviceId));return!!receipt&&receipt.mode===target.mode&&!!receipt.runtimeJobId&&(!target.validationMode||target.validationMode===receipt.validationMode)&&(!target.deviceId||same(target.deviceId,receipt.deviceId))}function deviceJobMatches(result){const value=result;return value?.runtimeJobId===void 0||value.deviceExecution?.runtimeJobId===void 0||same(value.runtimeJobId,value.deviceExecution.runtimeJobId)}function assertResponseBindings(result,input,identity,method,pathOrBindings,additionalBindings=[]){if(result===null)return;const expectedPath=typeof pathOrBindings==="string"?pathOrBindings:void 0;const identityWhenPresent=typeof pathOrBindings==="string"||pathOrBindings===void 0?additionalBindings:pathOrBindings;const record=result;const basis=input.basis;const basisInput=basis?.input;const nested=input.scope??basis?.scope??basisInput?.scope??basis;if(input.deviceExecution!==void 0&&!deviceBound(input.deviceExecution,result)||!deviceJobMatches(result)||!scopeMatches(result,input)||!navigationResponseMatches(result)||nested!==void 0&&!scopeMatches(result,nested)||expectedPath!==void 0&&(typeof record?.path!=="string"||record.path.replace(/[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}/gi,id=>id.toLowerCase())!==expectedPath.replace(/[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}/gi,id=>id.toLowerCase()))||[...identity,...identityWhenPresent.filter(([,target])=>!!record&&Object.hasOwn(record,target))].some(([key,target,whenStatus])=>{if(whenStatus!==void 0&&record?.semanticStatus!==whenStatus)return false;const expected=key.split(".").reduce((value,field)=>value&&typeof value==="object"?value[field]:void 0,input);return expected!==void 0&&!targetsMatch(result,target.split("."),expected)})||Array.isArray(record?.items)&&typeof input.limit==="number"&&record.items.length>input.limit)throw new NativeStudioSdkError("RESPONSE_SCOPE_MISMATCH","INTERNAL_OPERATIONAL_FAILURE",method==="POST"?"UNKNOWN":"NO_WRITE")}import{z}from"zod";var NativeToolAuthorityFailureSchema=z.strictObject({semanticStatus:z.enum(["INVALID_INPUT","NOT_FOUND","BLOCKED","REVISION_CONFLICT","CAPABILITY_UNAVAILABLE","INTERNAL_OPERATIONAL_FAILURE"]),error:z.strictObject({code:z.enum(["INVALID_INPUT","UNAUTHENTICATED","FORBIDDEN","NOT_FOUND","BINDING_UNAVAILABLE","REQUEST_CONFLICT","REVISION_CONFLICT","GRANT_CONFLICT","GRANT_EXPIRED","GRANT_REVOKED","PROOF_INVALID","PROOF_REPLAY","CHALLENGE_EXPIRED","PERMIT_UNAVAILABLE","QUALIFICATION_UNAVAILABLE","CREDENTIAL_INVALID","CREDENTIAL_EXPIRED","CREDENTIAL_UNAVAILABLE","CREDENTIAL_LIMIT","HOST_RUN_UNAVAILABLE","INTERNAL_OPERATIONAL_FAILURE"]),message:z.literal("Native tool authority operation did not complete")})});function abortable(promise,signal){if(signal.aborted){void promise.catch(()=>{});return Promise.reject(signal.reason)}return new Promise((resolve,reject)=>{const abort=()=>reject(signal.reason);signal.addEventListener("abort",abort,{once:true});promise.then(resolve,reject).finally(()=>signal.removeEventListener("abort",abort))})}async function boundedResponseBytes(response,limit,signal){const length=response.headers.get("content-length");if(length!==null&&(!/^\d+$/.test(length)||Number(length)>limit)){void response.body?.cancel().catch(()=>{});throw new NativeStudioSdkError("RESPONSE_TOO_LARGE","INTERNAL_OPERATIONAL_FAILURE","UNKNOWN")}if(!response.body)return new Uint8Array;const reader=response.body.getReader();const chunks=[];let size=0;try{while(true){const next=await abortable(reader.read(),signal);if(next.done)break;size+=next.value.byteLength;if(size>limit)throw new NativeStudioSdkError("RESPONSE_TOO_LARGE","INTERNAL_OPERATIONAL_FAILURE","UNKNOWN");chunks.push(next.value)}const result=new Uint8Array(size);let offset=0;for(const chunk of chunks){result.set(chunk,offset);offset+=chunk.byteLength}return result}finally{void reader.cancel().catch(()=>{});reader.releaseLock()}}var nativeFailureCodes=new Set([...NativeToolAuthorityFailureSchema.shape.error.shape.code.options,...FederationFailureCodeSchema.options,"REQUEST_CONFLICT","HOST_UNAVAILABLE","CREDENTIAL_UNAVAILABLE","CREDENTIAL_SCOPE_MISMATCH","BINDING_REVOKED","UNAUTHENTICATED","FORBIDDEN","NOT_FOUND","INVALID_INPUT","REVISION_CONFLICT","STALE_BASIS","BLOCKED","CAPABILITY_UNAVAILABLE","DEVICE_UNAVAILABLE","CAPABILITY_VERSION_MISMATCH","PROVIDER_UNAVAILABLE","BUDGET_BLOCKED","CANCELLED","SUPERSEDED","INTERNAL_OPERATIONAL_FAILURE","IDEMPOTENCY_CONFLICT","CONTINUITY_CONFLICT","INPUT_UNAVAILABLE","AUDIO_UNAVAILABLE","CAPTION_UNAVAILABLE","TEST_EVIDENCE_DENIED","CONFLICT","INVALID_MEDIA","LEASE_LOST","SOURCE_UNAVAILABLE","TOOL_AUTHORITY_UNAVAILABLE","ACTIVE_EXECUTION_EXISTS","BINDING_UNAVAILABLE","PROVIDER_CAPABILITY_UNAVAILABLE","REPLAY_EXHAUSTED","RESYNC_REQUIRED"]);var statuses={400:["INVALID_INPUT"],413:["INVALID_INPUT"],415:["INVALID_INPUT"],401:["BLOCKED"],403:["BLOCKED"],404:["NOT_FOUND"],409:["REVISION_CONFLICT","STALE_BASIS","BLOCKED","CAPABILITY_UNAVAILABLE","BUDGET_BLOCKED","CANCELLED","SUPERSEDED"],422:["INVALID_INPUT"],429:["BUDGET_BLOCKED","PROVIDER_UNAVAILABLE"]};function failureOutcome(write,status,declared){if(!write)return"NO_WRITE";if(declared==="NO_WRITE"||declared==="UNKNOWN"||declared==="REJECTED")return declared;return["INVALID_INPUT","NOT_FOUND","BLOCKED","REVISION_CONFLICT","STALE_BASIS","BUDGET_BLOCKED"].includes(status)?"REJECTED":"UNKNOWN"}async function nativeFailure(response,signal){try{if(response.headers.get("content-type")?.split(";")[0]?.trim()!=="application/json")return null;const bytes=await boundedResponseBytes(response,64*1024,signal);const raw=JSON.parse(new TextDecoder("utf-8",{fatal:true}).decode(bytes));if(!raw||typeof raw!=="object"||Array.isArray(raw))return null;const record=raw;const status=InterfaceSemanticStatusSchema.safeParse(record.semanticStatus);if(!status.success||!(statuses[response.status]??(response.status>=500?["INTERNAL_OPERATIONAL_FAILURE","PROVIDER_UNAVAILABLE","CAPABILITY_UNAVAILABLE"]:[])).includes(status.data))return null;const error=record.error;const code=error?.code;const mismatch=capabilityMismatch(code,status.data,error?.details);const known=typeof code==="string"&&nativeFailureCodes.has(code)&&(code!=="CAPABILITY_VERSION_MISMATCH"||!!mismatch);return{semanticStatus:status.data,code:known?code:status.data,mismatch,outcome:error&&typeof error==="object"&&!Array.isArray(error)&&(known||error.outcome==="UNKNOWN")?error.outcome:void 0}}catch{return null}finally{void response.body?.cancel().catch(()=>{})}}function capabilityMismatch(code,status,detail){if(code==="CAPABILITY_VERSION_MISMATCH"&&status==="CAPABILITY_UNAVAILABLE")return CapabilityVersionMismatchSchema.safeParse(detail).data}var NativeStudioHttpTransport=class{constructor(config){this.config=config;try{this.origin=new URL(config.baseUrl);if(this.origin.username||this.origin.password||this.origin.search||this.origin.hash||this.origin.pathname!=="/"||this.origin.protocol!=="https:"&&!(this.origin.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(this.origin.hostname)))sdkInputError()}catch{sdkInputError()}this.timeout=config.timeoutMs??3e4;this.jsonLimit=config.maxJsonBytes??18*1024*1024;if(!Number.isSafeInteger(this.timeout)||this.timeout<1||this.timeout>3e5||!Number.isSafeInteger(this.jsonLimit)||this.jsonLimit<1024||this.jsonLimit>32*1024*1024)sdkInputError()}config;origin;timeout;jsonLimit;async response(request,options){const write=request.method==="POST"&&!request.readOnly;if(!request.path.startsWith("/v1/")||request.path.includes("?")||request.path.includes("#")||request.path.includes(".."))sdkInputError();const url=new URL(request.path,this.origin);if(url.origin!==this.origin.origin||!url.pathname.startsWith("/v1/")||!["GET","POST"].includes(request.method)||!TenantIdSchema.safeParse(request.tenantId).success)sdkInputError();for(const[key,value]of Object.entries(request.query??{}))if(value!==void 0)url.searchParams.set(key,String(value));let body;try{if(request.importedVideo){const v=request.importedVideo;if(request.method!=="POST"||request.body!==void 0||!/^\/v1\/productions\/[a-f0-9-]{36}\/imported-visuals\/originals\/bytes$/i.test(request.path)||!(v.bytes instanceof Uint8Array)||v.bytes.length<32||v.bytes.length>128*1024*1024||!/^[A-Za-z0-9_-]+$/.test(v.metadata)||v.metadata.length>8192)sdkInputError();body=new Uint8Array(v.bytes)}else body=request.body===void 0?void 0:JSON.stringify(request.body);if(typeof body==="string"&&new TextEncoder().encode(body).byteLength>18*1024*1024)sdkInputError()}catch{sdkInputError()}const timeout=AbortSignal.timeout(this.timeout);const signal=options.signal?AbortSignal.any([options.signal,timeout]):timeout;if(signal.aborted)throw new NativeStudioSdkError("REQUEST_ABORTED","BLOCKED","NO_WRITE");let authorization;if(request.authentication==="runtime-proof"){if(request.method!=="POST"||!/^\/v1\/projects\/[0-9a-f-]{36}\/(?:native-tool-grants\/[0-9a-f-]{36}\/(?:proof|status)|productions\/[0-9a-f-]{36}\/native-tool-credentials\/exchange)$/.test(request.path))sdkInputError()}else{try{authorization=await abortable(Promise.resolve().then(()=>this.config.authorization(signal)),signal)}catch{throw new NativeStudioSdkError(signal.aborted?"REQUEST_ABORTED":"UNAUTHENTICATED","BLOCKED","NO_WRITE")}if(typeof authorization!=="string"||!/^Bearer [A-Za-z0-9._~+/-]+={0,2}$/.test(authorization)||authorization.length>16384)throw new NativeStudioSdkError("UNAUTHENTICATED","BLOCKED","NO_WRITE")}if(signal.aborted)throw new NativeStudioSdkError("REQUEST_ABORTED","BLOCKED","NO_WRITE");try{const pending=Promise.resolve().then(()=>(this.config.fetch??fetch)(url,{method:request.method,redirect:"error",cache:"no-store",signal,headers:{...authorization===void 0?{}:{authorization},"x-native-tenant-id":request.tenantId,accept:"application/json",...request.providerConfigurationReceipt?{"x-native-provider-receipt":"v1"}:{},...request.body===void 0?{}:{"content-type":"application/json"},...request.importedVideo?{"content-type":"video/mp4","x-native-import-metadata":request.importedVideo.metadata}:{}},...body===void 0?{}:{body}}));void pending.then(late=>{if(signal.aborted)void late.body?.cancel().catch(()=>{})},()=>{});const response=await abortable(pending,signal);if(!response.ok){const status=response.status;const native=await nativeFailure(response,signal);const code=status===401?"UNAUTHENTICATED":status===403?"FORBIDDEN":status===404?"NOT_FOUND":status===400||status===413||status===415||status===422?"INVALID_INPUT":status===409?"REVISION_CONFLICT":"HTTP_FAILURE";const semanticStatus=status===401||status===403?"BLOCKED":status===404?"NOT_FOUND":status===400||status===413||status===415||status===422?"INVALID_INPUT":status===409?"REVISION_CONFLICT":"INTERNAL_OPERATIONAL_FAILURE";throw new NativeStudioSdkError(native?.code??code,native?.semanticStatus??semanticStatus,failureOutcome(write,native?.semanticStatus??semanticStatus,native?.outcome),status,[],native?.mismatch)}return{response,signal}}catch(error){if(error instanceof NativeStudioSdkError)throw error;throw new NativeStudioSdkError(write?"OUTCOME_UNKNOWN":signal.aborted?"REQUEST_ABORTED":"TRANSPORT_UNAVAILABLE","INTERNAL_OPERATIONAL_FAILURE",write?"UNKNOWN":"NO_WRITE")}}async json(request,schema,options={}){const limit=options.maxJsonBytes??this.jsonLimit;if(!Number.isSafeInteger(limit)||limit<1024||limit>this.jsonLimit)sdkInputError();const{response,signal}=await this.response(request,options);try{const contentType=response.headers.get("content-type")?.split(";")[0]?.trim();if(contentType!=="application/json"){void response.body?.cancel().catch(()=>{});throw new Error}const bytes=await boundedResponseBytes(response,limit,signal);return schema.parse(JSON.parse(new TextDecoder("utf-8",{fatal:true}).decode(bytes)))}catch(error){if(error instanceof NativeStudioSdkError)throw new NativeStudioSdkError(error.code,error.semanticStatus,request.method==="POST"&&!request.readOnly?"UNKNOWN":"NO_WRITE",error.status);throw new NativeStudioSdkError("RESPONSE_INVALID","INTERNAL_OPERATIONAL_FAILURE",request.method==="POST"&&!request.readOnly?"UNKNOWN":"NO_WRITE")}}async binary(request,contentTypes,limit,options={}){if(request.method!=="GET"||!Number.isSafeInteger(limit)||limit<1||limit>128*1024*1024)sdkInputError();const{response,signal}=await this.response(request,options);const contentType=response.headers.get("content-type")?.split(";")[0]?.trim()??"";if(!contentTypes.includes(contentType)){await response.body?.cancel().catch(()=>{});throw new NativeStudioSdkError("RESPONSE_INVALID","INTERNAL_OPERATIONAL_FAILURE","NO_WRITE")}try{return{bytes:await boundedResponseBytes(response,limit,signal),contentType,etag:response.headers.get("etag")}}catch(error){throw new NativeStudioSdkError(error instanceof NativeStudioSdkError?error.code:signal.aborted?"REQUEST_ABORTED":"RESPONSE_INVALID","INTERNAL_OPERATIONAL_FAILURE","NO_WRITE")}}};export{abortable,boundedResponseBytes,descriptorOperation,operation,path,pageQuery,mcpOperation,assertResponseBindings,nativeFailureCodes,failureOutcome,capabilityMismatch,NativeStudioHttpTransport};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{NativeStudioHttpTransport,assertResponseBindings,path}from"./chunk-
|
|
1
|
+
import{NativeStudioHttpTransport,assertResponseBindings,path}from"./chunk-KONHIJPZ.js";import{AgentHostExecutionInputSchema,AgentHostExecutionScopeSchema,AgentHostInstallationTransportSchema,AgentHostNativeToolAuthoritySchema}from"./chunk-XPDAOUQ7.js";import{AgentHostReadSelectionSchema,NativeRuntimeProofRequestSchema,NativeToolGrantViewSchema}from"./chunk-NNDKZ5H5.js";import{TenantIdSchema}from"./chunk-AFUVP2DC.js";import{NativeStudioSdkError,sdkInputError}from"./chunk-TT7IA5HB.js";import{z}from"zod";var id=z.uuid().regex(/^[0-9a-f-]{36}$/);var sha=z.string().regex(/^[a-f0-9]{64}$/);var key=z.string().regex(/^[A-Za-z0-9_-]{1,160}$/);var NativeRuntimeQualificationSchema=z.strictObject({protocol:z.literal("NATIVESTUDIO_RUNTIME_TOOLS_V1"),runtimeKey:key,installationId:key,installationRevisionId:key,resource:z.url().max(2048),publicKeyFingerprint:sha,bindingId:id,configurationVersion:z.int().positive(),selection:AgentHostReadSelectionSchema,capabilityDigest:sha,executionClass:z.enum(["LIVE","TEST_ONLY"]),transport:AgentHostInstallationTransportSchema.optional()});var NativeToolPermitSchema=z.strictObject({proof:AgentHostNativeToolAuthoritySchema,input:AgentHostExecutionInputSchema,grant:NativeToolGrantViewSchema,qualification:NativeRuntimeQualificationSchema,requestedByPrincipalId:id,createdAt:z.iso.datetime({offset:true})}).refine(v=>v.proof.tenantId===v.input.tenantId&&v.proof.projectId===v.input.projectId&&v.proof.productionId===v.input.productionId&&v.proof.executionId===v.input.executionId&&v.proof.hostRequestId===v.input.hostRequestId&&v.grant.tenantId===v.input.tenantId&&v.grant.projectId===v.input.projectId&&v.grant.enabled&&v.grant.verifiedAt!==null&&v.proof.bindingId===v.grant.bindingId&&v.proof.configurationVersion===v.grant.configurationVersion&&v.qualification.runtimeKey===v.grant.runtimeKey&&v.qualification.installationId===v.grant.installationId&&v.qualification.installationRevisionId===v.grant.installationRevisionId&&v.qualification.resource===v.grant.resource&&v.qualification.bindingId===v.grant.bindingId&&v.qualification.configurationVersion===v.grant.configurationVersion&&v.qualification.capabilityDigest===v.proof.capabilityDigest&&v.qualification.executionClass===v.proof.executionClass&&(v.proof.transport===void 0?v.qualification.transport===void 0:v.qualification.transport?.protocol===v.proof.transport.protocol&&v.qualification.transport.installationId===v.proof.transport.installationId&&v.qualification.transport.installationRevisionId===v.proof.transport.installationRevisionId&&v.qualification.transport.slotKey===v.proof.transport.slotKey&&(v.proof.transport.protocol!=="NVS_AGENT_HOST_V1"||v.qualification.transport.protocol==="NVS_AGENT_HOST_V1"&&v.qualification.transport.contractDigest===v.proof.transport.contractDigest&&v.qualification.transport.capabilityDigest===v.proof.transport.capabilityDigest)&&v.proof.transport.installationId===v.grant.installationId&&v.proof.transport.installationRevisionId===v.grant.installationRevisionId)&&Date.parse(v.proof.expiresAt)<=Date.parse(v.grant.expiresAt));var NativeToolPermitGetSchema=AgentHostExecutionScopeSchema.extend({authorityRef:id});var NativeExecutionProofClaimsSchema=AgentHostExecutionScopeSchema.extend({iss:key,sub:key,aud:z.url().max(2048),grantId:id,grantRevision:z.int().positive(),installationRevisionId:key,authorityRef:id,executionId:id,hostRequestId:id,inputFingerprint:sha,runKey:key,jti:id,iat:z.int().nonnegative(),exp:z.int().positive()}).refine(v=>v.exp>v.iat&&v.exp-v.iat<=60);var NativeToolCredentialExchangeSchema=NativeToolPermitGetSchema.extend({assertion:z.string().regex(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/).max(8192).meta({writeOnly:true})});var NativeToolCredentialMetadataSchema=NativeToolPermitGetSchema.extend({protocol:z.literal("NATIVESTUDIO_NATIVE_CREDENTIAL_V1"),tokenId:id,grantId:id,grantRevision:z.int().positive(),executionId:id,hostRequestId:id,runKey:key,jti:id,assertionFingerprint:sha,tokenFingerprint:sha,issuedAt:z.iso.datetime({offset:true}),expiresAt:z.iso.datetime({offset:true})});var NativeToolCredentialReplySchema=z.strictObject({tokenType:z.literal("Bearer"),accessToken:z.string().regex(/^nvst_[0-9a-f-]{36}\.[A-Za-z0-9_-]{43}$/).meta({readOnly:true}),tokenId:id,resource:z.url().max(2048),expiresAt:z.iso.datetime({offset:true})}).refine(v=>v.accessToken.startsWith(`nvst_${v.tokenId}.`));var NativeToolSessionSchema=NativeToolPermitGetSchema.extend({authorityProtocol:z.literal("NVS_GENERIC_EXECUTION_V1").optional(),tokenId:id,executionId:id,hostRequestId:id,grantId:id,grantRevision:z.int().positive(),runKey:key,runtimePrincipalId:id,approvedByPrincipalId:id,requestedByPrincipalId:id,capabilityDigest:sha,resource:z.url().max(2048),issuer:z.url().max(2048),subject:z.string().max(200),executionClass:z.enum(["LIVE","TEST_ONLY"]),expiresAt:z.iso.datetime({offset:true})});var NativeStudioRuntimeAuthorityClient=class{tenantId;origin;transport;constructor(config){const tenant=TenantIdSchema.safeParse(config.tenantId);if(!tenant.success)sdkInputError();this.tenantId=tenant.data.toLowerCase();if(config.maxJsonBytes!==void 0&&config.maxJsonBytes>65536)sdkInputError();try{this.origin=new URL(config.baseUrl);if(this.origin.protocol!=="https:")sdkInputError()}catch{sdkInputError()}this.transport=new NativeStudioHttpTransport({...config,maxJsonBytes:config.maxJsonBytes??65536,authorization:()=>{throw new Error("Runtime proof has no bearer credential")}})}input(schema,raw){if(!raw||typeof raw!=="object"||Array.isArray(raw))sdkInputError();const record=raw;if(record.tenantId!==void 0&&(typeof record.tenantId!=="string"||record.tenantId.toLowerCase()!==this.tenantId))sdkInputError();const parsed=schema.safeParse({...record,tenantId:this.tenantId});if(!parsed.success)sdkInputError();return parsed.data}resource(projectId,resource){if(resource!==new URL(`/mcp/native/v1/projects/${projectId}`,this.origin).href)throw new NativeStudioSdkError("RESPONSE_SCOPE_MISMATCH","INTERNAL_OPERATIONAL_FAILURE","UNKNOWN")}async prove(raw,options={}){const value=this.input(NativeRuntimeProofRequestSchema,raw),result=await this.transport.json({method:"POST",tenantId:this.tenantId,path:path("projects",value.projectId,"native-tool-grants",value.grantId,"proof"),body:{assertion:value.assertion},authentication:"runtime-proof"},NativeToolGrantViewSchema,options);assertResponseBindings(result,value,[["grantId","grantId"]],"POST");this.resource(value.projectId,result.resource);return result}async status(raw,options={}){const value=this.input(NativeRuntimeProofRequestSchema,raw);try{const result=await this.transport.json({method:"POST",tenantId:this.tenantId,path:path("projects",value.projectId,"native-tool-grants",value.grantId,"status"),body:{assertion:value.assertion},authentication:"runtime-proof"},NativeToolGrantViewSchema,options);assertResponseBindings(result,value,[["grantId","grantId"]],"POST");this.resource(value.projectId,result.resource);return result}catch(error){if(error instanceof NativeStudioSdkError)throw new NativeStudioSdkError(error.code,error.semanticStatus,"NO_WRITE",error.status);throw error}}async exchange(raw,options={}){const value=this.input(NativeToolCredentialExchangeSchema,raw),result=await this.transport.json({method:"POST",tenantId:this.tenantId,path:path("projects",value.projectId,"productions",value.productionId,"native-tool-credentials","exchange"),body:{authorityRef:value.authorityRef,assertion:value.assertion},authentication:"runtime-proof"},NativeToolCredentialReplySchema,options);this.resource(value.projectId,result.resource);if(!result.accessToken.startsWith(`nvst_${result.tokenId}.`))throw new NativeStudioSdkError("RESPONSE_SCOPE_MISMATCH","INTERNAL_OPERATIONAL_FAILURE","UNKNOWN");return result}};export{NativeStudioRuntimeAuthorityClient};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ContinuationSchema,DeliveryOutputProfileSchema,PrincipalIdSchema,ProductionIdSchema,ProductionSchema,ProjectIdSchema,QueryLimitSchema,QueryPageInfoSchema,TenantIdSchema}from"./chunk-AFUVP2DC.js";import{z as z2}from"zod";import{z}from"zod";var ProjectLifecycleSchema=z.enum(["ACTIVE","ARCHIVED"]);var CreateProjectInputSchema=z.object({tenantId:TenantIdSchema,principalId:PrincipalIdSchema,idempotencyKey:z.string().trim().min(1).max(200),name:z.string().trim().min(1).max(200)});var CreateProjectRequestSchema=CreateProjectInputSchema.omit({principalId:true}).strict();var ProjectSchema=z.object({id:ProjectIdSchema,tenantId:TenantIdSchema,name:z.string().min(1),lifecycle:ProjectLifecycleSchema,defaultActiveProductionId:ProductionIdSchema.nullable(),revision:z.int().positive(),createdByPrincipalId:PrincipalIdSchema,createdAt:z.iso.datetime({offset:true}),updatedAt:z.iso.datetime({offset:true})});var CreatedProjectResultSchema=z.object({project:ProjectSchema,production:ProductionSchema});var ProjectLibraryQuerySchema=z2.strictObject({tenantId:TenantIdSchema,limit:QueryLimitSchema,next:ContinuationSchema.optional()});var ProjectLibraryScopeSchema=z2.strictObject({tenantId:TenantIdSchema,projectId:ProjectIdSchema});var ProjectLibraryPageSchema=z2.strictObject({items:z2.array(ProjectSchema).max(100),page:QueryPageInfoSchema});var ProjectWorkspaceSchema=z2.strictObject({project:ProjectSchema,productions:z2.array(ProductionSchema).max(100),possiblyTruncated:z2.boolean()});var SourceLibraryQuerySchema=ProjectLibraryQuerySchema.extend({projectId:ProjectIdSchema.optional()});var SourceLibraryItemSchema=z2.strictObject({artifactId:z2.uuid(),representationId:z2.uuid(),projectId:ProjectIdSchema,kind:z2.enum(["REFERENCE_IMAGE","REFERENCE_VIDEO","PRODUCT_INFORMATION"]),originalName:z2.string().max(255),checksumSha256:z2.string().regex(/^[0-9a-f]{64}$/),contentType:z2.enum(["image/png","image/jpeg","image/webp","text/plain","application/json","video/mp4"]),byteSize:z2.int().positive().max(
|
|
1
|
+
import{ContinuationSchema,DeliveryOutputProfileSchema,PrincipalIdSchema,ProductionIdSchema,ProductionSchema,ProjectIdSchema,QueryLimitSchema,QueryPageInfoSchema,TenantIdSchema}from"./chunk-AFUVP2DC.js";import{z as z2}from"zod";import{z}from"zod";var ProjectLifecycleSchema=z.enum(["ACTIVE","ARCHIVED"]);var CreateProjectInputSchema=z.object({tenantId:TenantIdSchema,principalId:PrincipalIdSchema,idempotencyKey:z.string().trim().min(1).max(200),name:z.string().trim().min(1).max(200)});var CreateProjectRequestSchema=CreateProjectInputSchema.omit({principalId:true}).strict();var ProjectSchema=z.object({id:ProjectIdSchema,tenantId:TenantIdSchema,name:z.string().min(1),lifecycle:ProjectLifecycleSchema,defaultActiveProductionId:ProductionIdSchema.nullable(),revision:z.int().positive(),createdByPrincipalId:PrincipalIdSchema,createdAt:z.iso.datetime({offset:true}),updatedAt:z.iso.datetime({offset:true})});var CreatedProjectResultSchema=z.object({project:ProjectSchema,production:ProductionSchema});var ProjectLibraryQuerySchema=z2.strictObject({tenantId:TenantIdSchema,limit:QueryLimitSchema,next:ContinuationSchema.optional()});var ProjectLibraryScopeSchema=z2.strictObject({tenantId:TenantIdSchema,projectId:ProjectIdSchema});var ProjectLibraryPageSchema=z2.strictObject({items:z2.array(ProjectSchema).max(100),page:QueryPageInfoSchema});var ProjectWorkspaceSchema=z2.strictObject({project:ProjectSchema,productions:z2.array(ProductionSchema).max(100),possiblyTruncated:z2.boolean()});var SourceLibraryQuerySchema=ProjectLibraryQuerySchema.extend({projectId:ProjectIdSchema.optional()});var SourceLibraryItemSchema=z2.strictObject({artifactId:z2.uuid(),representationId:z2.uuid(),projectId:ProjectIdSchema,kind:z2.enum(["REFERENCE_IMAGE","REFERENCE_VIDEO","PRODUCT_INFORMATION"]),originalName:z2.string().max(255),checksumSha256:z2.string().regex(/^[0-9a-f]{64}$/),contentType:z2.enum(["image/png","image/jpeg","image/webp","text/plain","application/json","video/mp4"]),byteSize:z2.int().positive().max(128*1024*1024),width:z2.int().positive().nullable(),height:z2.int().positive().nullable(),createdAt:z2.iso.datetime({offset:true})}).refine(value=>value.kind==="REFERENCE_VIDEO"&&value.contentType==="video/mp4"?true:value.byteSize<=8*1024*1024,{message:"Video SOURCE is limited to 128 MiB; other SOURCE kinds remain limited to 8 MiB"});var SourceLibraryPageSchema=z2.strictObject({items:z2.array(SourceLibraryItemSchema).max(100),page:QueryPageInfoSchema});var SourceLibraryMediaSchema=ProjectLibraryScopeSchema.extend({artifactId:z2.uuid()});var StudioInputContentSchema=z2.strictObject({schemaVersion:z2.literal(1),productionId:z2.uuid(),projectTitle:z2.string().trim().min(1).max(200),name:z2.string().trim().max(300),intent:z2.string().trim().min(1).max(2e3),aspectRatio:z2.enum(["16:9","9:16"]),targetDurationSeconds:z2.int().min(30).max(60),outputProfile:DeliveryOutputProfileSchema,sourceArtifactIds:z2.array(z2.uuid()).max(12)});export{CreateProjectRequestSchema,ProjectSchema,CreatedProjectResultSchema,ProjectLibraryQuerySchema,ProjectLibraryScopeSchema,ProjectLibraryPageSchema,ProjectWorkspaceSchema,SourceLibraryQuerySchema,SourceLibraryItemSchema,SourceLibraryPageSchema,SourceLibraryMediaSchema,StudioInputContentSchema};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{StudioInputContentSchema}from"./chunk-SCY6PJRK.js";import{AgentHostBindingSchema,CurrentHostInstallationTransportSchema,HistoricalHostTransportSchema,HostReferenceSchema}from"./chunk-NNDKZ5H5.js";import{z}from"zod";var id=z.uuid();var sha=z.string().regex(/^[0-9a-f]{64}$/);var AgentHostExecutionScopeSchema=z.strictObject({tenantId:id,projectId:id,productionId:id});var StartAgentHostExecutionSchema=AgentHostExecutionScopeSchema.extend({requestId:id,studioInputArtifactId:id,bindingId:id,expectedProductionRevision:z.int().positive(),expectedBindingRevision:z.int().positive(),expectedConfigurationVersion:z.int().positive()});var AgentHostExecutionGetSchema=AgentHostExecutionScopeSchema.extend({executionId:id});var AgentHostExecutionQuerySchema=AgentHostExecutionScopeSchema.extend({limit:z.int().min(1).max(100).default(20),beforeId:id.optional()});var AgentHostExecutionSourceSchema=z.strictObject({artifactId:id,representationId:id,checksumSha256:sha,byteSize:z.int().positive().max(128*1024*1024),contentType:z.string().min(1).max(100),kind:z.enum(["PRODUCT_INFORMATION","REFERENCE_IMAGE","REFERENCE_VIDEO"])}).refine(source=>source.kind==="REFERENCE_VIDEO"&&source.contentType==="video/mp4"||source.byteSize<=8*1024*1024,{message:"Non-video Host source references remain limited to 8 MiB"});var AgentHostExecutionInputSchema=AgentHostExecutionScopeSchema.extend({protocol:z.literal("NATIVESTUDIO_PRODUCTION_V1"),executionId:id,hostRequestId:id,productionRevision:z.int().positive(),studioInput:StudioInputContentSchema,intake:AgentHostExecutionSourceSchema,sources:z.array(AgentHostExecutionSourceSchema).max(12)}).refine(v=>v.studioInput.productionId===v.productionId&&v.studioInput.sourceArtifactIds.length===v.sources.length&&new Set(v.sources.map(s=>s.artifactId)).size===v.sources.length&&v.sources.every((s,index)=>s.artifactId===v.studioInput.sourceArtifactIds[index])&&!v.sources.some(s=>s.artifactId===v.intake.artifactId));var AgentHostInstallationTransportSchema=z.union([CurrentHostInstallationTransportSchema,HistoricalHostTransportSchema]);var AgentHostNativeToolAuthoritySchema=AgentHostExecutionScopeSchema.extend({protocol:z.literal("NATIVESTUDIO_AGENT_TOOLS_V1"),authorityRef:id,executionId:id,hostRequestId:id,bindingId:id,configurationVersion:z.int().positive(),inputFingerprint:sha,capabilityDigest:sha,expiresAt:z.iso.datetime({offset:true}),executionClass:z.enum(["LIVE","TEST_ONLY"]),transport:AgentHostInstallationTransportSchema.optional()});var AgentHostExecutionSnapshotSchema=z.strictObject({binding:AgentHostBindingSchema,input:AgentHostExecutionInputSchema,authority:AgentHostNativeToolAuthoritySchema}).refine(v=>v.binding.tenantId===v.input.tenantId&&v.binding.projectId===v.input.projectId&&v.binding.enabled&&v.authority.tenantId===v.input.tenantId&&v.authority.projectId===v.input.projectId&&v.authority.productionId===v.input.productionId&&v.authority.executionId===v.input.executionId&&v.authority.hostRequestId===v.input.hostRequestId&&v.authority.bindingId===v.binding.bindingId&&v.authority.configurationVersion===v.binding.configurationVersion);var AgentHostTaskObservationSchema=z.strictObject({requestId:id,runKey:z.string().regex(/^[A-Za-z0-9_-]{1,160}$/),status:z.enum(["accepted","running","succeeded","failed","cancelled","unknown"]),agentKey:HostReferenceSchema,agentVersion:z.union([HostReferenceSchema,z.int().positive()]),modelOptionKey:HostReferenceSchema,cancelRequested:z.boolean(),createdAt:z.iso.datetime({offset:true}),updatedAt:z.iso.datetime({offset:true}),timing:z.strictObject({acceptedAt:z.iso.datetime({offset:true}),deadlineAt:z.iso.datetime({offset:true}),limitSource:z.literal("TASK_POLICY")}).nullable()});var AgentHostDispatchPhaseSchema=z.enum(["ADMITTED","SENDING","OUTCOME_UNKNOWN","OBSERVING","REJECTED","CANCELLED_BEFORE_SUBMISSION"]);var AgentHostExecutionViewSchema=AgentHostExecutionScopeSchema.extend({executionId:id,requestId:id,requestedByPrincipalId:id,hostRequestId:id,revision:z.int().positive(),contractVersion:z.union([z.literal(1),z.literal(2)]).optional(),legacyDispatchFenceReleased:z.boolean().optional(),snapshotFingerprint:sha,snapshot:AgentHostExecutionSnapshotSchema,dispatchPhase:AgentHostDispatchPhaseSchema,active:z.boolean(),observation:AgentHostTaskObservationSchema.nullable(),cancelRequestId:id.nullable(),errorCode:z.string().regex(/^[A-Z_]{1,80}$/).nullable(),createdAt:z.iso.datetime({offset:true}),updatedAt:z.iso.datetime({offset:true})}).refine(v=>(!v.legacyDispatchFenceReleased||v.contractVersion===1)&&v.snapshot.input.executionId===v.executionId&&v.snapshot.input.hostRequestId===v.hostRequestId&&v.snapshot.input.tenantId===v.tenantId&&v.snapshot.input.projectId===v.projectId&&v.snapshot.input.productionId===v.productionId&&(!v.observation||v.observation.requestId===v.hostRequestId&&v.observation.agentKey===v.snapshot.binding.selection.agentKey&&v.observation.agentVersion===v.snapshot.binding.selection.agentVersion&&v.observation.modelOptionKey===v.snapshot.binding.selection.modelOptionKey));var AgentHostExecutionPageSchema=z.strictObject({items:z.array(AgentHostExecutionViewSchema).max(100),hasMore:z.boolean(),nextBeforeId:id.nullable()}).refine(v=>v.hasMore===(v.nextBeforeId!==null)&&(!v.hasMore||v.nextBeforeId===v.items.at(-1)?.executionId)&&new Set(v.items.map(item=>item.executionId)).size===v.items.length);var AgentHostExecutionEventSchema=z.strictObject({id,executionId:id,revision:z.int().positive(),action:z.enum(["ADMIT","CLAIM","RECOVER_UNKNOWN","OBSERVE","REJECT","CANCEL_REQUEST","CANCEL_UNSENT"]),createdByPrincipalId:id,observation:AgentHostTaskObservationSchema.nullable(),errorCode:z.string().regex(/^[A-Z_]{1,80}$/).nullable(),createdAt:z.iso.datetime({offset:true})});var AgentHostExecutionEventQuerySchema=AgentHostExecutionGetSchema.extend({limit:z.int().min(1).max(100).default(20),beforeRevision:z.int().positive().optional()});var AgentHostExecutionEventPageSchema=z.strictObject({items:z.array(AgentHostExecutionEventSchema).max(100),hasMore:z.boolean(),nextBeforeRevision:z.int().positive().nullable()}).refine(v=>v.hasMore===(v.nextBeforeRevision!==null)&&(!v.hasMore||v.nextBeforeRevision===v.items.at(-1)?.revision)&&v.items.every((item,index)=>!index||item.revision<v.items[index-1].revision));var AgentHostExecutionFailureSchema=z.strictObject({semanticStatus:z.enum(["INVALID_INPUT","NOT_FOUND","BLOCKED","REVISION_CONFLICT","CAPABILITY_UNAVAILABLE","INTERNAL_OPERATIONAL_FAILURE"]),error:z.strictObject({code:z.enum(["INVALID_INPUT","UNAUTHENTICATED","FORBIDDEN","NOT_FOUND","REVISION_CONFLICT","REQUEST_CONFLICT","SOURCE_UNAVAILABLE","TOOL_AUTHORITY_UNAVAILABLE","ACTIVE_EXECUTION_EXISTS","LEASE_LOST","BINDING_UNAVAILABLE","INTERNAL_OPERATIONAL_FAILURE"]),message:z.literal("Agent Host execution did not complete")})});export{AgentHostExecutionScopeSchema,StartAgentHostExecutionSchema,AgentHostExecutionGetSchema,AgentHostExecutionQuerySchema,AgentHostExecutionInputSchema,AgentHostInstallationTransportSchema,AgentHostNativeToolAuthoritySchema,AgentHostExecutionViewSchema,AgentHostExecutionPageSchema,AgentHostExecutionEventQuerySchema,AgentHostExecutionEventPageSchema};
|
|
@@ -156,6 +156,7 @@ export declare const SourceInputMetadataSchema: z.ZodObject<{
|
|
|
156
156
|
REFERENCE_VIDEO: "REFERENCE_VIDEO";
|
|
157
157
|
PRODUCT_INFORMATION: "PRODUCT_INFORMATION";
|
|
158
158
|
}>;
|
|
159
|
+
videoGeometryProfile: z.ZodOptional<z.ZodLiteral<"IMPORTED_H264_SDR_CFR30_PRESERVE_V2">>;
|
|
159
160
|
contentType: z.ZodEnum<{
|
|
160
161
|
"application/json": "application/json";
|
|
161
162
|
"text/plain": "text/plain";
|
|
@@ -174,6 +175,7 @@ export declare const UploadSourceInputRequestSchema: z.ZodObject<{
|
|
|
174
175
|
REFERENCE_VIDEO: "REFERENCE_VIDEO";
|
|
175
176
|
PRODUCT_INFORMATION: "PRODUCT_INFORMATION";
|
|
176
177
|
}>;
|
|
178
|
+
videoGeometryProfile: z.ZodOptional<z.ZodLiteral<"IMPORTED_H264_SDR_CFR30_PRESERVE_V2">>;
|
|
177
179
|
contentType: z.ZodEnum<{
|
|
178
180
|
"application/json": "application/json";
|
|
179
181
|
"text/plain": "text/plain";
|
|
@@ -145,6 +145,7 @@ export declare const WorkspaceStatusSchema: z.ZodObject<{
|
|
|
145
145
|
export declare const DeviceStatusInputSchema: z.ZodObject<{
|
|
146
146
|
tenantId: z.ZodUUID;
|
|
147
147
|
deviceId: z.ZodUUID;
|
|
148
|
+
reportsVersion: z.ZodOptional<z.ZodLiteral<1>>;
|
|
148
149
|
}, z.core.$strict>;
|
|
149
150
|
export declare const DeviceStatusSchema: z.ZodObject<{
|
|
150
151
|
protocol: z.ZodLiteral<"NVS_COMPONENT_STATUS_V1">;
|
|
@@ -236,6 +237,14 @@ export declare const DeviceStatusSchema: z.ZodObject<{
|
|
|
236
237
|
CHECK_DEVICE_RELEASE: "CHECK_DEVICE_RELEASE";
|
|
237
238
|
}>;
|
|
238
239
|
}, z.core.$strict>>;
|
|
240
|
+
reportReconciliation: z.ZodOptional<z.ZodObject<{
|
|
241
|
+
center: z.ZodEnum<{
|
|
242
|
+
NOT_APPLICABLE: "NOT_APPLICABLE";
|
|
243
|
+
PREPARED_REPORT_OBSERVED: "PREPARED_REPORT_OBSERVED";
|
|
244
|
+
NONE_OBSERVED: "NONE_OBSERVED";
|
|
245
|
+
}>;
|
|
246
|
+
hostJournal: z.ZodLiteral<"UNKNOWN">;
|
|
247
|
+
}, z.core.$strict>>;
|
|
239
248
|
}, z.core.$strict>;
|
|
240
249
|
export type DeviceStatusInput = z.infer<typeof DeviceStatusInputSchema>;
|
|
241
250
|
export type DeviceStatus = z.infer<typeof DeviceStatusSchema>;
|
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** 文件转写只接收原生已接纳音轨与明确的实际用量授权。 */
|
|
3
|
+
export declare const OpenAiAsrDeviceStartSchema: z.ZodObject<{
|
|
4
|
+
tenantId: z.ZodUUID;
|
|
5
|
+
productionId: z.ZodUUID;
|
|
6
|
+
expectedProductionRevision: z.ZodInt;
|
|
7
|
+
idempotencyKey: z.ZodString;
|
|
8
|
+
source: z.ZodObject<{
|
|
9
|
+
kind: z.ZodLiteral<"AUDIO">;
|
|
10
|
+
media: z.ZodObject<{
|
|
11
|
+
artifactId: z.ZodUUID;
|
|
12
|
+
representationId: z.ZodUUID;
|
|
13
|
+
checksumSha256: z.ZodString;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
versionId: z.ZodUUID;
|
|
16
|
+
purpose: z.ZodEnum<{
|
|
17
|
+
VOICEOVER: "VOICEOVER";
|
|
18
|
+
MUSIC: "MUSIC";
|
|
19
|
+
}>;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
mode: z.ZodLiteral<"TRANSCRIPTION">;
|
|
22
|
+
deviceId: z.ZodUUID;
|
|
23
|
+
selection: z.ZodObject<{
|
|
24
|
+
connectionId: z.core.$ZodBranded<z.ZodUUID, "ProviderConnectionId", "out">;
|
|
25
|
+
modelProfileId: z.ZodEnum<{
|
|
26
|
+
"openai-gpt-transcribe": "openai-gpt-transcribe";
|
|
27
|
+
"openai-whisper-timed": "openai-whisper-timed";
|
|
28
|
+
}>;
|
|
29
|
+
}, z.core.$strict>;
|
|
30
|
+
expectedModelProfileVersion: z.ZodInt;
|
|
31
|
+
parameters: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
32
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
33
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
34
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
35
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
36
|
+
timestamp_granularities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
37
|
+
word: "word";
|
|
38
|
+
segment: "segment";
|
|
39
|
+
}>>>;
|
|
40
|
+
language: z.ZodOptional<z.ZodString>;
|
|
41
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
42
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
}, z.core.$strict>]>>;
|
|
44
|
+
acceptActualUsage: z.ZodLiteral<true>;
|
|
45
|
+
}, z.core.$strict>;
|
|
46
|
+
export type OpenAiAsrDeviceStart = z.infer<typeof OpenAiAsrDeviceStartSchema>;
|
|
47
|
+
export declare const OpenAiAsrDeviceResultSchema: z.ZodObject<{
|
|
48
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
49
|
+
advisory: z.ZodLiteral<true>;
|
|
50
|
+
producer: z.ZodLiteral<"ASR">;
|
|
51
|
+
source: z.ZodObject<{
|
|
52
|
+
artifactId: z.ZodUUID;
|
|
53
|
+
representationId: z.ZodUUID;
|
|
54
|
+
checksumSha256: z.ZodString;
|
|
55
|
+
tenantId: z.ZodUUID;
|
|
56
|
+
projectId: z.ZodUUID;
|
|
57
|
+
productionId: z.ZodUUID;
|
|
58
|
+
byteSize: z.ZodInt;
|
|
59
|
+
durationMs: z.ZodNumber;
|
|
60
|
+
audioChannels: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
|
|
61
|
+
frameRate: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
executionClass: z.ZodEnum<{
|
|
63
|
+
LIVE: "LIVE";
|
|
64
|
+
TEST_ONLY: "TEST_ONLY";
|
|
65
|
+
}>;
|
|
66
|
+
}, z.core.$strict>;
|
|
67
|
+
provider: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
68
|
+
requestId: z.ZodString;
|
|
69
|
+
requestSha256: z.ZodString;
|
|
70
|
+
usage: z.ZodUnion<readonly [z.ZodObject<{
|
|
71
|
+
seconds: z.ZodNumber;
|
|
72
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
73
|
+
input_tokens: z.ZodInt;
|
|
74
|
+
output_tokens: z.ZodInt;
|
|
75
|
+
total_tokens: z.ZodInt;
|
|
76
|
+
}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>]>;
|
|
77
|
+
protocol: z.ZodLiteral<"OPENAI_TRANSCRIPTION_V1">;
|
|
78
|
+
model: z.ZodLiteral<"gpt-transcribe">;
|
|
79
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
80
|
+
requestId: z.ZodString;
|
|
81
|
+
requestSha256: z.ZodString;
|
|
82
|
+
usage: z.ZodUnion<readonly [z.ZodObject<{
|
|
83
|
+
seconds: z.ZodNumber;
|
|
84
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
85
|
+
input_tokens: z.ZodInt;
|
|
86
|
+
output_tokens: z.ZodInt;
|
|
87
|
+
total_tokens: z.ZodInt;
|
|
88
|
+
}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>]>;
|
|
89
|
+
protocol: z.ZodLiteral<"OPENAI_WHISPER_TRANSCRIPTION_V1">;
|
|
90
|
+
model: z.ZodLiteral<"whisper-1">;
|
|
91
|
+
}, z.core.$strict>], "protocol">;
|
|
92
|
+
observedAt: z.ZodISODateTime;
|
|
93
|
+
report: z.ZodObject<{
|
|
94
|
+
task: z.ZodLiteral<"SPEECH_RECOGNITION">;
|
|
95
|
+
timing: z.ZodEnum<{
|
|
96
|
+
UNAVAILABLE: "UNAVAILABLE";
|
|
97
|
+
PROVIDER_REPORTED: "PROVIDER_REPORTED";
|
|
98
|
+
}>;
|
|
99
|
+
}, z.core.$strict>;
|
|
100
|
+
limitations: z.ZodArray<z.ZodString>;
|
|
101
|
+
transcriptObject: z.ZodObject<{
|
|
102
|
+
tenantId: z.ZodUUID;
|
|
103
|
+
projectId: z.ZodUUID;
|
|
104
|
+
versionId: z.ZodUUID;
|
|
105
|
+
checksumSha256: z.ZodString;
|
|
106
|
+
role: z.ZodLiteral<"MANIFEST">;
|
|
107
|
+
byteSize: z.ZodInt;
|
|
108
|
+
}, z.core.$strict>;
|
|
109
|
+
}, z.core.$strict>;
|
|
110
|
+
export declare const OpenAiAsrDeviceViewSchema: z.ZodObject<{
|
|
111
|
+
tenantId: z.ZodUUID;
|
|
112
|
+
productionId: z.ZodUUID;
|
|
113
|
+
observationId: z.ZodUUID;
|
|
114
|
+
runtimeJobId: z.ZodUUID;
|
|
115
|
+
profile: z.ZodUnion<readonly [z.ZodObject<{
|
|
116
|
+
id: z.ZodString;
|
|
117
|
+
version: z.ZodInt;
|
|
118
|
+
providerId: z.ZodEnum<{
|
|
119
|
+
QWEN_CN: "QWEN_CN";
|
|
120
|
+
VOLCENGINE_CN: "VOLCENGINE_CN";
|
|
121
|
+
GEMINI: "GEMINI";
|
|
122
|
+
OPENAI: "OPENAI";
|
|
123
|
+
XAI: "XAI";
|
|
124
|
+
NATIVE_SPEECH: "NATIVE_SPEECH";
|
|
125
|
+
}>;
|
|
126
|
+
sourceUrl: z.ZodURL;
|
|
127
|
+
modelId: z.ZodString;
|
|
128
|
+
label: z.ZodString;
|
|
129
|
+
protocol: z.ZodEnum<{
|
|
130
|
+
GEMINI_INTERACTIONS_V1: "GEMINI_INTERACTIONS_V1";
|
|
131
|
+
QIANWEN_VIDEO_V1: "QIANWEN_VIDEO_V1";
|
|
132
|
+
}>;
|
|
133
|
+
modes: z.ZodArray<z.ZodEnum<{
|
|
134
|
+
VIDEO: "VIDEO";
|
|
135
|
+
AUDIO: "AUDIO";
|
|
136
|
+
AUDIOVISUAL: "AUDIOVISUAL";
|
|
137
|
+
VIDEO_ALL_FRAMES: "VIDEO_ALL_FRAMES";
|
|
138
|
+
}>>;
|
|
139
|
+
requestTimeoutMs: z.ZodInt;
|
|
140
|
+
maxBytes: z.ZodInt;
|
|
141
|
+
maxDurationMs: z.ZodInt;
|
|
142
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
143
|
+
type: z.ZodEnum<{
|
|
144
|
+
STRING: "STRING";
|
|
145
|
+
NUMBER: "NUMBER";
|
|
146
|
+
BOOLEAN: "BOOLEAN";
|
|
147
|
+
INTEGER: "INTEGER";
|
|
148
|
+
}>;
|
|
149
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
150
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
152
|
+
default: z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean, z.ZodString]>;
|
|
153
|
+
}, z.core.$strict>>;
|
|
154
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
155
|
+
id: z.ZodString;
|
|
156
|
+
version: z.ZodInt;
|
|
157
|
+
providerId: z.ZodEnum<{
|
|
158
|
+
QWEN_CN: "QWEN_CN";
|
|
159
|
+
VOLCENGINE_CN: "VOLCENGINE_CN";
|
|
160
|
+
GEMINI: "GEMINI";
|
|
161
|
+
OPENAI: "OPENAI";
|
|
162
|
+
XAI: "XAI";
|
|
163
|
+
NATIVE_SPEECH: "NATIVE_SPEECH";
|
|
164
|
+
}>;
|
|
165
|
+
sourceUrl: z.ZodURL;
|
|
166
|
+
verifiedAt: z.ZodISODate;
|
|
167
|
+
modelId: z.ZodString;
|
|
168
|
+
label: z.ZodString;
|
|
169
|
+
protocol: z.ZodEnum<{
|
|
170
|
+
OPENAI_TRANSCRIPTION_V1: "OPENAI_TRANSCRIPTION_V1";
|
|
171
|
+
OPENAI_WHISPER_TRANSCRIPTION_V1: "OPENAI_WHISPER_TRANSCRIPTION_V1";
|
|
172
|
+
QWEN_ASR_V1: "QWEN_ASR_V1";
|
|
173
|
+
NATIVE_SPEECH_ASR_V1: "NATIVE_SPEECH_ASR_V1";
|
|
174
|
+
}>;
|
|
175
|
+
nativeSpeech: z.ZodOptional<z.ZodObject<{
|
|
176
|
+
digest: z.ZodString;
|
|
177
|
+
revision: z.ZodString;
|
|
178
|
+
runtimeVersion: z.ZodString;
|
|
179
|
+
qualification: z.ZodEnum<{
|
|
180
|
+
TEST_ONLY: "TEST_ONLY";
|
|
181
|
+
AVAILABLE: "AVAILABLE";
|
|
182
|
+
}>;
|
|
183
|
+
}, z.core.$strict>>;
|
|
184
|
+
modes: z.ZodTuple<[z.ZodLiteral<"TRANSCRIPTION">], null>;
|
|
185
|
+
inputKinds: z.ZodArray<z.ZodEnum<{
|
|
186
|
+
VIDEO: "VIDEO";
|
|
187
|
+
AUDIO: "AUDIO";
|
|
188
|
+
}>>;
|
|
189
|
+
requestTimeoutMs: z.ZodInt;
|
|
190
|
+
maxBytes: z.ZodInt;
|
|
191
|
+
maxDurationMs: z.ZodInt;
|
|
192
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
193
|
+
label: z.ZodString;
|
|
194
|
+
type: z.ZodEnum<{
|
|
195
|
+
STRING: "STRING";
|
|
196
|
+
NUMBER: "NUMBER";
|
|
197
|
+
BOOLEAN: "BOOLEAN";
|
|
198
|
+
INTEGER: "INTEGER";
|
|
199
|
+
STRING_ARRAY: "STRING_ARRAY";
|
|
200
|
+
STRING_MAP: "STRING_MAP";
|
|
201
|
+
}>;
|
|
202
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
203
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
204
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
205
|
+
maxLength: z.ZodOptional<z.ZodInt>;
|
|
206
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
207
|
+
default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
208
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
209
|
+
description: z.ZodOptional<z.ZodString>;
|
|
210
|
+
maxItems: z.ZodOptional<z.ZodInt>;
|
|
211
|
+
maxKeyLength: z.ZodOptional<z.ZodInt>;
|
|
212
|
+
numberOptions: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
213
|
+
}, z.core.$strict>>;
|
|
214
|
+
}, z.core.$strict>]>;
|
|
215
|
+
matrix: z.ZodOptional<z.ZodObject<{
|
|
216
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
217
|
+
service: z.ZodString;
|
|
218
|
+
lifecycle: z.ZodEnum<{
|
|
219
|
+
ACTIVE: "ACTIVE";
|
|
220
|
+
DEPRECATED: "DEPRECATED";
|
|
221
|
+
RETIRED: "RETIRED";
|
|
222
|
+
}>;
|
|
223
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
224
|
+
url: z.ZodURL;
|
|
225
|
+
checkedAt: z.ZodISODate;
|
|
226
|
+
}, z.core.$strict>>;
|
|
227
|
+
modes: z.ZodArray<z.ZodString>;
|
|
228
|
+
claims: z.ZodArray<z.ZodObject<{
|
|
229
|
+
capability: z.ZodEnum<{
|
|
230
|
+
SYNCHRONIZED_AUDIO: "SYNCHRONIZED_AUDIO";
|
|
231
|
+
SPEECH_GENERATION: "SPEECH_GENERATION";
|
|
232
|
+
SPEECH_RECOGNITION: "SPEECH_RECOGNITION";
|
|
233
|
+
TRANSCRIPT_TIMESTAMPS: "TRANSCRIPT_TIMESTAMPS";
|
|
234
|
+
VOICE_REFERENCE: "VOICE_REFERENCE";
|
|
235
|
+
AUDIO_REFERENCE: "AUDIO_REFERENCE";
|
|
236
|
+
AUDIO_DRIVEN_VIDEO: "AUDIO_DRIVEN_VIDEO";
|
|
237
|
+
LIP_SYNCHRONIZATION: "LIP_SYNCHRONIZATION";
|
|
238
|
+
AUDIO_EDITING: "AUDIO_EDITING";
|
|
239
|
+
SEPARATE_STEMS: "SEPARATE_STEMS";
|
|
240
|
+
}>;
|
|
241
|
+
modes: z.ZodArray<z.ZodString>;
|
|
242
|
+
support: z.ZodEnum<{
|
|
243
|
+
UNKNOWN: "UNKNOWN";
|
|
244
|
+
SUPPORTED: "SUPPORTED";
|
|
245
|
+
UNSUPPORTED: "UNSUPPORTED";
|
|
246
|
+
}>;
|
|
247
|
+
control: z.ZodEnum<{
|
|
248
|
+
NONE: "NONE";
|
|
249
|
+
PARAMETER: "PARAMETER";
|
|
250
|
+
PROMPT: "PROMPT";
|
|
251
|
+
ALWAYS_ON: "ALWAYS_ON";
|
|
252
|
+
MEDIA_INPUT: "MEDIA_INPUT";
|
|
253
|
+
}>;
|
|
254
|
+
parameterPath: z.ZodOptional<z.ZodString>;
|
|
255
|
+
access: z.ZodDefault<z.ZodEnum<{
|
|
256
|
+
PUBLIC: "PUBLIC";
|
|
257
|
+
QUALIFIED_ACCOUNT: "QUALIFIED_ACCOUNT";
|
|
258
|
+
}>>;
|
|
259
|
+
description: z.ZodOptional<z.ZodString>;
|
|
260
|
+
}, z.core.$strict>>;
|
|
261
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
262
|
+
label: z.ZodString;
|
|
263
|
+
type: z.ZodEnum<{
|
|
264
|
+
STRING: "STRING";
|
|
265
|
+
NUMBER: "NUMBER";
|
|
266
|
+
BOOLEAN: "BOOLEAN";
|
|
267
|
+
INTEGER: "INTEGER";
|
|
268
|
+
STRING_ARRAY: "STRING_ARRAY";
|
|
269
|
+
STRING_MAP: "STRING_MAP";
|
|
270
|
+
}>;
|
|
271
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
272
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
273
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
274
|
+
maxLength: z.ZodOptional<z.ZodInt>;
|
|
275
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
276
|
+
default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
277
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
278
|
+
description: z.ZodOptional<z.ZodString>;
|
|
279
|
+
maxItems: z.ZodOptional<z.ZodInt>;
|
|
280
|
+
maxKeyLength: z.ZodOptional<z.ZodInt>;
|
|
281
|
+
numberOptions: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
282
|
+
}, z.core.$strict>>;
|
|
283
|
+
constraints: z.ZodArray<z.ZodObject<{
|
|
284
|
+
modes: z.ZodArray<z.ZodString>;
|
|
285
|
+
when: z.ZodOptional<z.ZodObject<{
|
|
286
|
+
parameter: z.ZodString;
|
|
287
|
+
equals: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
288
|
+
}, z.core.$strict>>;
|
|
289
|
+
require: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
290
|
+
forbid: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
291
|
+
requireValues: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
292
|
+
reason: z.ZodString;
|
|
293
|
+
}, z.core.$strict>>;
|
|
294
|
+
references: z.ZodArray<z.ZodObject<{
|
|
295
|
+
kind: z.ZodEnum<{
|
|
296
|
+
AUDIO_REFERENCE: "AUDIO_REFERENCE";
|
|
297
|
+
VOICE_ID: "VOICE_ID";
|
|
298
|
+
DRIVING_AUDIO: "DRIVING_AUDIO";
|
|
299
|
+
}>;
|
|
300
|
+
modes: z.ZodArray<z.ZodString>;
|
|
301
|
+
parameterPath: z.ZodString;
|
|
302
|
+
maxItems: z.ZodInt;
|
|
303
|
+
minDurationMs: z.ZodOptional<z.ZodInt>;
|
|
304
|
+
maxDurationMs: z.ZodOptional<z.ZodInt>;
|
|
305
|
+
maxTotalDurationMs: z.ZodOptional<z.ZodInt>;
|
|
306
|
+
maxBytes: z.ZodOptional<z.ZodInt>;
|
|
307
|
+
formats: z.ZodArray<z.ZodEnum<{
|
|
308
|
+
WAV: "WAV";
|
|
309
|
+
MP3: "MP3";
|
|
310
|
+
}>>;
|
|
311
|
+
requiresVisual: z.ZodBoolean;
|
|
312
|
+
access: z.ZodEnum<{
|
|
313
|
+
PUBLIC: "PUBLIC";
|
|
314
|
+
QUALIFIED_ACCOUNT: "QUALIFIED_ACCOUNT";
|
|
315
|
+
}>;
|
|
316
|
+
}, z.core.$strict>>;
|
|
317
|
+
outputAudioChannels: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
|
|
318
|
+
}, z.core.$strict>>;
|
|
319
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
320
|
+
runtimeStatus: z.ZodEnum<{
|
|
321
|
+
FAILED: "FAILED";
|
|
322
|
+
CANCELLED: "CANCELLED";
|
|
323
|
+
RUNNING: "RUNNING";
|
|
324
|
+
SUPERSEDED: "SUPERSEDED";
|
|
325
|
+
PENDING: "PENDING";
|
|
326
|
+
READY: "READY";
|
|
327
|
+
WAITING: "WAITING";
|
|
328
|
+
SUCCEEDED: "SUCCEEDED";
|
|
329
|
+
}>;
|
|
330
|
+
providerStatus: z.ZodEnum<{
|
|
331
|
+
REJECTED: "REJECTED";
|
|
332
|
+
UNKNOWN: "UNKNOWN";
|
|
333
|
+
SUCCEEDED: "SUCCEEDED";
|
|
334
|
+
NOT_SUBMITTED: "NOT_SUBMITTED";
|
|
335
|
+
SUBMITTING: "SUBMITTING";
|
|
336
|
+
}>;
|
|
337
|
+
cancellationRequested: z.ZodBoolean;
|
|
338
|
+
failure: z.ZodNullable<z.ZodObject<{
|
|
339
|
+
classification: z.ZodString;
|
|
340
|
+
summary: z.ZodString;
|
|
341
|
+
}, z.core.$strict>>;
|
|
342
|
+
createdAt: z.ZodISODateTime;
|
|
343
|
+
executionClass: z.ZodLiteral<"LIVE">;
|
|
344
|
+
deviceExecution: z.ZodObject<{
|
|
345
|
+
target: z.ZodLiteral<"TENANT_EXTERNAL_PROVIDER">;
|
|
346
|
+
deviceId: z.ZodUUID;
|
|
347
|
+
}, z.core.$strict>;
|
|
348
|
+
request: z.ZodObject<{
|
|
349
|
+
tenantId: z.ZodUUID;
|
|
350
|
+
productionId: z.ZodUUID;
|
|
351
|
+
expectedProductionRevision: z.ZodInt;
|
|
352
|
+
idempotencyKey: z.ZodString;
|
|
353
|
+
source: z.ZodObject<{
|
|
354
|
+
kind: z.ZodLiteral<"AUDIO">;
|
|
355
|
+
media: z.ZodObject<{
|
|
356
|
+
artifactId: z.ZodUUID;
|
|
357
|
+
representationId: z.ZodUUID;
|
|
358
|
+
checksumSha256: z.ZodString;
|
|
359
|
+
}, z.core.$strict>;
|
|
360
|
+
versionId: z.ZodUUID;
|
|
361
|
+
purpose: z.ZodEnum<{
|
|
362
|
+
VOICEOVER: "VOICEOVER";
|
|
363
|
+
MUSIC: "MUSIC";
|
|
364
|
+
}>;
|
|
365
|
+
}, z.core.$strict>;
|
|
366
|
+
mode: z.ZodLiteral<"TRANSCRIPTION">;
|
|
367
|
+
deviceId: z.ZodUUID;
|
|
368
|
+
selection: z.ZodObject<{
|
|
369
|
+
connectionId: z.core.$ZodBranded<z.ZodUUID, "ProviderConnectionId", "out">;
|
|
370
|
+
modelProfileId: z.ZodEnum<{
|
|
371
|
+
"openai-gpt-transcribe": "openai-gpt-transcribe";
|
|
372
|
+
"openai-whisper-timed": "openai-whisper-timed";
|
|
373
|
+
}>;
|
|
374
|
+
}, z.core.$strict>;
|
|
375
|
+
expectedModelProfileVersion: z.ZodInt;
|
|
376
|
+
parameters: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
377
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
378
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
379
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
380
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
381
|
+
timestamp_granularities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
382
|
+
word: "word";
|
|
383
|
+
segment: "segment";
|
|
384
|
+
}>>>;
|
|
385
|
+
language: z.ZodOptional<z.ZodString>;
|
|
386
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
387
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
388
|
+
}, z.core.$strict>]>>;
|
|
389
|
+
acceptActualUsage: z.ZodLiteral<true>;
|
|
390
|
+
}, z.core.$strict>;
|
|
391
|
+
result: z.ZodNullable<z.ZodObject<{
|
|
392
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
393
|
+
advisory: z.ZodLiteral<true>;
|
|
394
|
+
producer: z.ZodLiteral<"ASR">;
|
|
395
|
+
source: z.ZodObject<{
|
|
396
|
+
artifactId: z.ZodUUID;
|
|
397
|
+
representationId: z.ZodUUID;
|
|
398
|
+
checksumSha256: z.ZodString;
|
|
399
|
+
tenantId: z.ZodUUID;
|
|
400
|
+
projectId: z.ZodUUID;
|
|
401
|
+
productionId: z.ZodUUID;
|
|
402
|
+
byteSize: z.ZodInt;
|
|
403
|
+
durationMs: z.ZodNumber;
|
|
404
|
+
audioChannels: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
|
|
405
|
+
frameRate: z.ZodOptional<z.ZodNumber>;
|
|
406
|
+
executionClass: z.ZodEnum<{
|
|
407
|
+
LIVE: "LIVE";
|
|
408
|
+
TEST_ONLY: "TEST_ONLY";
|
|
409
|
+
}>;
|
|
410
|
+
}, z.core.$strict>;
|
|
411
|
+
provider: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
412
|
+
requestId: z.ZodString;
|
|
413
|
+
requestSha256: z.ZodString;
|
|
414
|
+
usage: z.ZodUnion<readonly [z.ZodObject<{
|
|
415
|
+
seconds: z.ZodNumber;
|
|
416
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
417
|
+
input_tokens: z.ZodInt;
|
|
418
|
+
output_tokens: z.ZodInt;
|
|
419
|
+
total_tokens: z.ZodInt;
|
|
420
|
+
}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>]>;
|
|
421
|
+
protocol: z.ZodLiteral<"OPENAI_TRANSCRIPTION_V1">;
|
|
422
|
+
model: z.ZodLiteral<"gpt-transcribe">;
|
|
423
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
424
|
+
requestId: z.ZodString;
|
|
425
|
+
requestSha256: z.ZodString;
|
|
426
|
+
usage: z.ZodUnion<readonly [z.ZodObject<{
|
|
427
|
+
seconds: z.ZodNumber;
|
|
428
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
429
|
+
input_tokens: z.ZodInt;
|
|
430
|
+
output_tokens: z.ZodInt;
|
|
431
|
+
total_tokens: z.ZodInt;
|
|
432
|
+
}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>]>;
|
|
433
|
+
protocol: z.ZodLiteral<"OPENAI_WHISPER_TRANSCRIPTION_V1">;
|
|
434
|
+
model: z.ZodLiteral<"whisper-1">;
|
|
435
|
+
}, z.core.$strict>], "protocol">;
|
|
436
|
+
observedAt: z.ZodISODateTime;
|
|
437
|
+
report: z.ZodObject<{
|
|
438
|
+
task: z.ZodLiteral<"SPEECH_RECOGNITION">;
|
|
439
|
+
timing: z.ZodEnum<{
|
|
440
|
+
UNAVAILABLE: "UNAVAILABLE";
|
|
441
|
+
PROVIDER_REPORTED: "PROVIDER_REPORTED";
|
|
442
|
+
}>;
|
|
443
|
+
}, z.core.$strict>;
|
|
444
|
+
limitations: z.ZodArray<z.ZodString>;
|
|
445
|
+
transcriptObject: z.ZodObject<{
|
|
446
|
+
tenantId: z.ZodUUID;
|
|
447
|
+
projectId: z.ZodUUID;
|
|
448
|
+
versionId: z.ZodUUID;
|
|
449
|
+
checksumSha256: z.ZodString;
|
|
450
|
+
role: z.ZodLiteral<"MANIFEST">;
|
|
451
|
+
byteSize: z.ZodInt;
|
|
452
|
+
}, z.core.$strict>;
|
|
453
|
+
}, z.core.$strict>>;
|
|
454
|
+
transcriptRead: z.ZodOptional<z.ZodObject<{
|
|
455
|
+
endpoint: z.ZodURL;
|
|
456
|
+
credential: z.ZodString;
|
|
457
|
+
method: z.ZodEnum<{
|
|
458
|
+
GET: "GET";
|
|
459
|
+
PUT: "PUT";
|
|
460
|
+
}>;
|
|
461
|
+
object: z.ZodObject<{
|
|
462
|
+
tenantId: z.ZodUUID;
|
|
463
|
+
projectId: z.ZodUUID;
|
|
464
|
+
versionId: z.ZodUUID;
|
|
465
|
+
role: z.ZodEnum<{
|
|
466
|
+
VIDEO: "VIDEO";
|
|
467
|
+
AUDIO: "AUDIO";
|
|
468
|
+
SOURCE: "SOURCE";
|
|
469
|
+
POSTER: "POSTER";
|
|
470
|
+
FRAME: "FRAME";
|
|
471
|
+
SHEET: "SHEET";
|
|
472
|
+
MANIFEST: "MANIFEST";
|
|
473
|
+
}>;
|
|
474
|
+
byteSize: z.ZodInt;
|
|
475
|
+
checksumSha256: z.ZodString;
|
|
476
|
+
}, z.core.$strict>;
|
|
477
|
+
}, z.core.$strict>>;
|
|
478
|
+
}, z.core.$strict>;
|
|
479
|
+
export type OpenAiAsrDeviceView = z.infer<typeof OpenAiAsrDeviceViewSchema>;
|