@nativestudio/sdk 0.3.0-rc.20 → 0.3.0-rc.21

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 (34) hide show
  1. package/COMPATIBILITY.json +4 -4
  2. package/dist/_chunks/{chunk-VI7HPZJC.js → chunk-2QDPFLIO.js} +1 -1
  3. package/dist/_chunks/chunk-7DXSLHXW.js +1 -0
  4. package/dist/_chunks/{chunk-D3KLEDOI.js → chunk-ASUZJSEP.js} +1 -1
  5. package/dist/_chunks/{chunk-3Q24IPBK.js → chunk-K3TIFCD3.js} +1 -1
  6. package/dist/_chunks/{chunk-O6YL4JVI.js → chunk-NNDKZ5H5.js} +1 -1
  7. package/dist/_chunks/chunk-Q53Q74OP.js +1 -0
  8. package/dist/_chunks/chunk-UKPD77FB.js +1 -0
  9. package/dist/_chunks/chunk-VXBIT7XN.js +1 -0
  10. package/dist/_chunks/{chunk-SXZY76XB.js → chunk-WNXKJRZ6.js} +1 -1
  11. package/dist/_types/contracts/interface/operation.d.ts +59 -0
  12. package/dist/_types/contracts/interface/production-snapshot.d.ts +25 -0
  13. package/dist/_types/contracts/interface/query.d.ts +25 -0
  14. package/dist/_types/contracts/lifecycle-event-projections.d.ts +2 -2
  15. package/dist/_types/contracts/navigation-context.d.ts +49 -1
  16. package/dist/_types/contracts/navigation.d.ts +1 -1
  17. package/dist/_types/sdk/catalog/core.d.ts +108 -0
  18. package/dist/_types/sdk/catalog/federation.d.ts +223 -40
  19. package/dist/_types/sdk/catalog/lifecycle-events.d.ts +2 -2
  20. package/dist/_types/sdk/catalog/mcp.d.ts +3 -0
  21. package/dist/_types/sdk/catalog/navigation.d.ts +86 -4
  22. package/dist/_types/sdk/catalog/reference-preview.d.ts +36 -0
  23. package/dist/_types/sdk/navigation-facade.d.ts +103 -3
  24. package/dist/_types/sdk/observe.d.ts +18 -0
  25. package/dist/host-protocol.js +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/local-runtime.js +1 -1
  28. package/dist/mcp-discovery.js +1 -1
  29. package/dist/runtime-authority.js +1 -1
  30. package/package.json +1 -1
  31. package/dist/_chunks/chunk-GJULDJSV.js +0 -1
  32. package/dist/_chunks/chunk-OHONXDFL.js +0 -1
  33. package/dist/_chunks/chunk-S64F3WZK.js +0 -1
  34. package/dist/_chunks/chunk-XNROPEWC.js +0 -1
@@ -0,0 +1 @@
1
+ import{ExternalLifecycleEventSchema,FederationScopeSchema,orderedFederationWindow}from"./chunk-NNDKZ5H5.js";import{z as z3}from"zod";import{z as z2}from"zod";import{z}from"zod";var clean=v=>Array.from(v).every(c=>{const n=c.codePointAt(0);return n>=32&&n!==127&&(n<55296||n>57343)});var FederationPeerRefSchema=z.string().min(1).max(256).refine(clean);var FederationOpaqueUriSchema=z.string().min(1).max(512).regex(/^[A-Za-z][A-Za-z0-9+.-]*:\S+$/u).refine(v=>clean(v)&&URL.canParse(v));var RESOURCE_CHANGE_TYPE="com.nativestudio.federation.resource.changed.v1";var RESOURCE_CHANGE_SCHEMA="urn:nativestudio:federation:resource-change:v1";var FederationSourceScopeSchema=z.strictObject({namespace:FederationPeerRefSchema,ref:FederationPeerRefSchema});var ResourceChangeSchema=z.strictObject({schemaVersion:z.literal(1),sourceScope:FederationSourceScopeSchema,resource:z.strictObject({namespace:FederationPeerRefSchema,ref:FederationOpaqueUriSchema,version:FederationPeerRefSchema}),changeKind:FederationPeerRefSchema,parentRef:FederationOpaqueUriSchema.nullable().optional()});var distinct=a=>new Set(a).size===a.length;var FederationSourceSelectionSchema=z.strictObject({scope:FederationSourceScopeSchema,resourceNamespace:FederationPeerRefSchema,changeKinds:z.array(FederationPeerRefSchema).min(1).max(32).refine(distinct),resourcePrefixes:z.array(FederationOpaqueUriSchema).min(1).max(16).refine(distinct)});var HistoricalSourceScopeSchema=z.record(FederationPeerRefSchema,FederationPeerRefSchema).refine(v=>Object.keys(v).length<=32);var HistoricalSourceSelectionSchema=z.record(FederationPeerRefSchema,z.union([FederationPeerRefSchema,z.array(z.string().min(1).max(512).refine(clean)).max(32),HistoricalSourceScopeSchema])).refine(v=>Object.keys(v).length<=32&&JSON.stringify(v).length<=32768);var uuid=z2.uuid().toLowerCase();var clean2=v=>Array.from(v).every(c=>{const code=c.codePointAt(0);return code>=32&&code!==127&&(code<55296||code>57343)});var ref=z2.string().min(1).max(256).refine(clean2);var uri=z2.string().min(1).max(2048).refine(v=>URL.canParse(v)&&!/\s/.test(v)&&clean2(v));var bindingInput=FederationScopeSchema.extend({connectionRef:ref.optional(),bindingId:uuid,requestId:ref,expectedRevision:z2.int().nonnegative(),source:uri,contractVersion:z2.literal(2),remoteService:ref,sourceSelection:FederationSourceSelectionSchema,remoteTenant:ref,consumerRef:ref,grantRef:ref,grantVersion:z2.int().min(1).max(2147483647),notBefore:z2.iso.datetime(),expiresAt:z2.iso.datetime(),state:z2.enum(["ACTIVE","PAUSED","REVOKED"])}).strict();var InboundBindingConfigureSchema=bindingInput.refine(orderedFederationWindow);var bindingView=bindingInput.omit({requestId:true,expectedRevision:true}).extend({revision:z2.int().positive(),installationSource:uri,connectionRef:ref,direction:z2.literal("INBOUND"),effective:z2.enum(["ACTIVE","PAUSED","REVOKED","EXPIRED","BLOCKED"])}).strict();var CurrentInboundBindingSchema=bindingView.extend({eventType:z2.literal(RESOURCE_CHANGE_TYPE),dataSchema:z2.literal(RESOURCE_CHANGE_SCHEMA)}).refine(orderedFederationWindow);var InboundBindingSchema=z2.union([CurrentInboundBindingSchema,bindingView.extend({contractVersion:z2.literal(1).default(1),sourceSelection:HistoricalSourceSelectionSchema.optional(),eventType:ref.optional(),dataSchema:uri.optional()})]);var InboundNoticeSchema=z2.strictObject({resourceRef:z2.string().min(1).max(512),resourceVersion:ref,changeKind:ref,contractVersion:z2.literal(2).optional(),resourceNamespace:ref.optional(),sourceService:ref.optional(),sourceScope:HistoricalSourceScopeSchema.optional(),parentRef:uri.nullable().optional()}).refine(v=>v.contractVersion!==2||v.sourceService!==void 0&&ResourceChangeSchema.safeParse({schemaVersion:1,sourceScope:v.sourceScope,resource:{namespace:v.resourceNamespace,ref:v.resourceRef,version:v.resourceVersion},changeKind:v.changeKind,...v.parentRef!==void 0?{parentRef:v.parentRef}:{}}).success);var InboundInboxViewSchema=FederationScopeSchema.extend({id:uuid,bindingId:uuid,source:uri,eventId:ref,consumerRef:ref,disposition:z2.enum(["RECEIVED","HOLD","APPLIED","REJECTED","UNKNOWN"]),revision:z2.int().positive(),generation:z2.int().nonnegative(),attempts:z2.int().nonnegative(),recoveryCount:z2.int().min(0).max(3),workState:z2.enum(["READY","QUARANTINED","SETTLED"]),reason:ref.nullable(),receivedAt:z2.iso.datetime(),resourceRef:z2.string().min(1).max(512).refine(clean2),resourceVersion:ref}).strict();var signalBase=FederationScopeSchema.extend({inboxId:uuid,consumerRef:ref,source:uri,sourceTenant:ref,effect:z2.literal("REFRESH_HINT"),appliedAt:z2.iso.datetime()}).strict();var InboundSignalSchema=InboundNoticeSchema.safeExtend(signalBase.shape);var InboundReplaySchema=FederationScopeSchema.extend({inboxId:uuid,requestId:ref,expectedGeneration:z2.int().nonnegative(),expectedReceiptRevision:z2.int().positive(),reason:ref,acknowledgeDuplicateRisk:z2.literal(true)}).strict();var InboundReplayResultSchema=FederationScopeSchema.extend({inboxId:uuid,requestId:ref,replayId:uuid,status:z2.literal("QUEUED_FOR_VERIFICATION"),effect:z2.literal("TRANSPORT_ONLY")}).strict();var InboundReplayViewSchema=InboundReplayResultSchema.omit({status:true}).extend({status:z2.enum(["PENDING","REQUEUED","DENIED"]),reasonCode:ref.nullable()}).strict();var InboundQuarantineViewSchema=FederationScopeSchema.extend({id:uuid,bindingId:uuid,deliveryRef:z2.string().min(1).max(2048).refine(clean2),reasonCode:ref,recordedAt:z2.iso.datetime()}).strict();var InboundQuerySchema=FederationScopeSchema.extend({kind:z2.enum(["bindings","inbox","signals","replays","quarantine"]),after:uuid.optional(),limit:z2.int().min(1).max(50).default(20)}).strict();var InboundSignalsQuerySchema=InboundQuerySchema.omit({kind:true});var page=(kind,schema)=>FederationScopeSchema.extend({kind:z2.literal(kind),items:z2.array(schema).max(50),next:uuid.nullable()}).strict();var signalsPage=page("signals",InboundSignalSchema);var InboundSignalsPageSchema=signalsPage.refine(p=>p.items.every((item,index)=>item.tenantId===p.tenantId&&item.productionId===p.productionId&&(index===0||p.items[index-1].inboxId<item.inboxId))&&(p.next===null||p.items.at(-1)?.inboxId===p.next));var signalPosition=z2.string().regex(/^(0|[1-9][0-9]{0,18})$/).refine(value=>value.length<19||value<="9223372036854775807");var InboundSignalCheckpointSchema=z2.strictObject({epoch:uuid,position:signalPosition,inboxId:uuid.nullable()}).refine(checkpoint=>checkpoint.position==="0"===(checkpoint.inboxId===null));var InboundSignalChangesQuerySchema=FederationScopeSchema.extend({after:z2.union([z2.enum(["CURRENT","BEGINNING"]),InboundSignalCheckpointSchema]),limit:InboundQuerySchema.shape.limit}).strict();var InboundSignalChangesPageSchema=FederationScopeSchema.extend({items:z2.array(InboundSignalSchema).max(50),checkpoint:InboundSignalCheckpointSchema,hasMore:z2.boolean()}).strict().refine(page2=>page2.items.every(item=>item.tenantId===page2.tenantId&&item.productionId===page2.productionId)&&new Set(page2.items.map(item=>item.inboxId)).size===page2.items.length&&(page2.items.length===0?!page2.hasMore:page2.items.at(-1).inboxId===page2.checkpoint.inboxId));function inboundSignalChangesMatch(input,page2){const{after,limit,tenantId,productionId}=input;const{checkpoint,items,hasMore}=page2;if(page2.tenantId!==tenantId||page2.productionId!==productionId||items.length>limit||hasMore&&items.length!==limit)return false;if(after==="CURRENT")return items.length===0;const from=after==="BEGINNING"?0n:BigInt(after.position);if(BigInt(checkpoint.position)!==from+BigInt(items.length))return false;return after==="BEGINNING"||checkpoint.epoch===after.epoch&&(items.length===0?checkpoint.inboxId===after.inboxId:items.every(item=>item.inboxId!==after.inboxId))}var InboundQueryResultSchema=z2.discriminatedUnion("kind",[page("bindings",InboundBindingSchema),page("inbox",InboundInboxViewSchema),signalsPage,page("replays",InboundReplayViewSchema),page("quarantine",InboundQuarantineViewSchema)]);var InboundReceiptInputSchema=FederationScopeSchema.extend({kind:z2.enum(["EVENT","COMMAND"]),source:uri.optional(),eventId:ref.optional(),consumerRef:ref.optional(),requestId:ref.optional()}).strict().refine(v=>v.kind==="EVENT"?v.source!==void 0&&v.eventId!==void 0&&v.consumerRef!==void 0&&v.requestId===void 0:v.requestId!==void 0&&v.source===void 0&&v.eventId===void 0&&v.consumerRef===void 0);var InboundReceiptSchema=z2.discriminatedUnion("kind",[FederationScopeSchema.extend({kind:z2.literal("EVENT"),source:uri,eventId:ref,consumerRef:ref,result:InboundInboxViewSchema.nullable()}).strict(),FederationScopeSchema.extend({kind:z2.literal("COMMAND"),requestId:ref,result:z2.union([InboundBindingSchema,InboundReplayResultSchema]).nullable()}).strict()]);var InboundCatalogSchema=FederationScopeSchema.extend({defaultReceive:z2.literal(false),configuration:z2.enum(["CONFIGURED","UNCONFIGURED"]),effect:z2.literal("REFRESH_HINT"),bindings:z2.array(CurrentInboundBindingSchema).max(32),events:z2.array(z2.strictObject({sourceService:ref,type:ref,dataSchema:uri})).max(32)}).strict().refine(v=>v.bindings.every(b=>b.tenantId===v.tenantId&&b.productionId===v.productionId&&b.effective==="ACTIVE"));var ref2=z3.string().min(1).max(256);var source=z3.string().min(1).max(2048).refine(v=>URL.canParse(v));var FederationResourceTypeSchema=z3.enum(["nvs.lifecycle-event","nvs.federation.refresh-hint"]);var FederationResultRefSchema=z3.strictObject({sourceSystem:z3.literal("native-video-studio"),resourceType:FederationResourceTypeSchema,resourceId:ref2,revision:z3.string().regex(/^[1-9][0-9]{0,18}$/),digest:z3.string().regex(/^sha256:[a-f0-9]{64}$/),evidenceRef:ref2.optional()});var FederationResultLocatorSchema=FederationScopeSchema.extend({resourceType:FederationResourceTypeSchema,resourceId:z3.uuid().toLowerCase()}).strict();var base=FederationScopeSchema.extend({schemaVersion:z3.literal(1),source,resourceId:z3.uuid(),revision:ref2});var FederationResultValueSchema=z3.discriminatedUnion("resourceType",[base.extend({resourceType:z3.literal("nvs.lifecycle-event"),event:ExternalLifecycleEventSchema}).strict(),base.extend({resourceType:z3.literal("nvs.federation.refresh-hint"),revision:z3.literal("1"),consumerRef:ref2,peerSource:source,peerTenant:ref2,resourceRef:z3.string().min(1).max(512),resourceVersion:ref2,changeKind:ref2,contractVersion:z3.literal(2).optional(),resourceNamespace:ref2.optional(),sourceService:ref2.optional(),sourceScope:HistoricalSourceScopeSchema.optional(),parentRef:z3.string().min(1).max(512).nullable().optional(),appliedAt:z3.iso.datetime()}).strict().refine(v=>{if(v.sourceService===void 0&&(v.sourceScope!==void 0||v.parentRef!==void 0))return false;return InboundNoticeSchema.safeParse({resourceRef:v.resourceRef,resourceVersion:v.resourceVersion,changeKind:v.changeKind,contractVersion:v.contractVersion,resourceNamespace:v.resourceNamespace,...v.sourceService?{sourceService:v.sourceService,sourceScope:v.sourceScope,parentRef:v.parentRef}:{}}).success})]).refine(v=>v.resourceType!=="nvs.lifecycle-event"||v.event.tenantId===v.tenantId&&v.event.productionId===v.productionId&&v.event.eventId===v.resourceId&&String(v.event.basis.productionRevision)===v.revision);var FederationResultReadSchema=FederationScopeSchema.extend({source,reference:FederationResultRefSchema}).strict();var FederationResultReferenceSchema=FederationScopeSchema.extend({source,reference:FederationResultRefSchema,meaning:z3.literal("IMMUTABLE_FACT")}).strict();var FederationResultSnapshotSchema=FederationResultReferenceSchema.extend({value:FederationResultValueSchema}).strict().refine(v=>v.value.source===v.source&&v.value.tenantId===v.tenantId&&v.value.productionId===v.productionId&&v.reference.resourceType===v.value.resourceType&&v.reference.resourceId===v.value.resourceId&&v.reference.revision===v.value.revision);function canonicalFederationJson(value){return boundedJson(value,2048,16,32768)}function canonicalFederationReadJson(value){return boundedJson(value,4096,24,65536)}function canonicalFederationCatalogJson(value){return boundedJson(value,2e4,32,131072)}function boundedJson(value,maxNodes,maxDepth,maxBytes){let nodes=0;let bytes=0;const encoder=new TextEncoder;const reserve=size=>{bytes+=size;if(bytes>maxBytes)throw Error("FEDERATION_JSON_SIZE")};const scalar=text=>{reserve(encoder.encode(text).byteLength);return text};const seen=new Set;const encode=(v,depth)=>{if(++nodes>maxNodes||depth>maxDepth)throw Error("FEDERATION_JSON_BUDGET");if(v===null||typeof v==="boolean")return scalar(String(v));if(typeof v==="number"&&Number.isFinite(v))return scalar(JSON.stringify(v));if(typeof v==="string"){if(v.length>maxBytes)throw Error("FEDERATION_JSON_SIZE");if(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/u.test(v))throw Error("FEDERATION_JSON_UNICODE");return scalar(JSON.stringify(v))}if(!v||typeof v!=="object"||seen.has(v))throw Error("FEDERATION_JSON_VALUE");seen.add(v);try{if(Array.isArray(v)){if(v.length>maxNodes-nodes)throw Error("FEDERATION_JSON_BUDGET");if(Reflect.ownKeys(v).length!==v.length+1)throw Error("FEDERATION_JSON_ARRAY");reserve(v.length===0?2:v.length+1);const items=[];for(let index=0;index<v.length;index++){const property=Object.getOwnPropertyDescriptor(v,String(index));if(!property||!("value"in property))throw Error("FEDERATION_JSON_ARRAY");items.push(encode(property.value,depth+1))}return"["+items.join(",")+"]"}if(Object.getPrototypeOf(v)!==Object.prototype&&Object.getPrototypeOf(v)!==null)throw Error("FEDERATION_JSON_OBJECT");if(Object.getOwnPropertySymbols(v).length)throw Error("FEDERATION_JSON_OBJECT");const keys=Object.keys(v);if(keys.length>maxNodes-nodes)throw Error("FEDERATION_JSON_BUDGET");reserve(keys.length===0?2:keys.length*2+1);return"{"+keys.sort().map(key=>{const property=Object.getOwnPropertyDescriptor(v,key);if(!property||!("value"in property))throw Error("FEDERATION_JSON_PROPERTY");return encode(key,depth+1)+":"+encode(property.value,depth+1)}).join(",")+"}"}finally{seen.delete(v)}};return encode(value,0)}export{FederationPeerRefSchema,RESOURCE_CHANGE_TYPE,RESOURCE_CHANGE_SCHEMA,FederationSourceSelectionSchema,InboundBindingConfigureSchema,CurrentInboundBindingSchema,InboundReplaySchema,InboundReplayResultSchema,InboundQuerySchema,InboundSignalsQuerySchema,InboundSignalsPageSchema,InboundSignalChangesQuerySchema,InboundSignalChangesPageSchema,inboundSignalChangesMatch,InboundQueryResultSchema,InboundReceiptInputSchema,InboundReceiptSchema,InboundCatalogSchema,FederationResultLocatorSchema,FederationResultValueSchema,FederationResultReadSchema,FederationResultReferenceSchema,FederationResultSnapshotSchema,canonicalFederationJson,canonicalFederationReadJson,canonicalFederationCatalogJson};
@@ -1 +1 @@
1
- import{NativeStudioHttpTransport,assertResponseBindings,path}from"./chunk-GJULDJSV.js";import{AgentHostExecutionInputSchema,AgentHostExecutionScopeSchema,AgentHostInstallationTransportSchema,AgentHostNativeToolAuthoritySchema}from"./chunk-VI7HPZJC.js";import{AgentHostReadSelectionSchema,NativeRuntimeProofRequestSchema,NativeToolGrantViewSchema}from"./chunk-O6YL4JVI.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
+ import{NativeStudioHttpTransport,assertResponseBindings,path}from"./chunk-Q53Q74OP.js";import{AgentHostExecutionInputSchema,AgentHostExecutionScopeSchema,AgentHostInstallationTransportSchema,AgentHostNativeToolAuthoritySchema}from"./chunk-2QDPFLIO.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};
@@ -4,6 +4,39 @@ export declare const OperationTargetSchema: z.ZodObject<{
4
4
  id: z.ZodString;
5
5
  version: z.ZodNullable<z.ZodInt>;
6
6
  }, z.core.$strip>;
7
+ export declare const OperationFailureReasonSchema: z.ZodEnum<{
8
+ AMBIGUOUS: "AMBIGUOUS";
9
+ PERMANENT_OPERATIONAL: "PERMANENT_OPERATIONAL";
10
+ SEMANTIC: "SEMANTIC";
11
+ RATE_LIMIT: "RATE_LIMIT";
12
+ TRANSIENT: "TRANSIENT";
13
+ NOT_RECORDED: "NOT_RECORDED";
14
+ }>;
15
+ export declare const OperationFailureSchema: z.ZodObject<{
16
+ reasonCodes: z.ZodArray<z.ZodEnum<{
17
+ AMBIGUOUS: "AMBIGUOUS";
18
+ PERMANENT_OPERATIONAL: "PERMANENT_OPERATIONAL";
19
+ SEMANTIC: "SEMANTIC";
20
+ RATE_LIMIT: "RATE_LIMIT";
21
+ TRANSIENT: "TRANSIENT";
22
+ NOT_RECORDED: "NOT_RECORDED";
23
+ }>>;
24
+ summary: z.ZodString;
25
+ next: z.ZodDiscriminatedUnion<[z.ZodObject<{
26
+ capability: z.ZodLiteral<"operation.get">;
27
+ input: z.ZodObject<{
28
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
29
+ productionId: z.core.$ZodBranded<z.ZodUUID, "ProductionId", "out">;
30
+ operationId: z.core.$ZodBranded<z.ZodString, "OperationId", "out">;
31
+ }, z.core.$strict>;
32
+ }, z.core.$strict>, z.ZodObject<{
33
+ capability: z.ZodLiteral<"production.snapshot">;
34
+ input: z.ZodObject<{
35
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
36
+ productionId: z.core.$ZodBranded<z.ZodUUID, "ProductionId", "out">;
37
+ }, z.core.$strict>;
38
+ }, z.core.$strict>], "capability">;
39
+ }, z.core.$strict>;
7
40
  export declare const OperationSummarySchema: z.ZodObject<{
8
41
  humanLinks: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
9
42
  status: z.ZodLiteral<"AVAILABLE">;
@@ -74,6 +107,31 @@ export declare const OperationSummarySchema: z.ZodObject<{
74
107
  attempts: z.ZodInt;
75
108
  }, z.core.$strip>;
76
109
  blockers: z.ZodArray<z.ZodString>;
110
+ failure: z.ZodOptional<z.ZodObject<{
111
+ reasonCodes: z.ZodArray<z.ZodEnum<{
112
+ AMBIGUOUS: "AMBIGUOUS";
113
+ PERMANENT_OPERATIONAL: "PERMANENT_OPERATIONAL";
114
+ SEMANTIC: "SEMANTIC";
115
+ RATE_LIMIT: "RATE_LIMIT";
116
+ TRANSIENT: "TRANSIENT";
117
+ NOT_RECORDED: "NOT_RECORDED";
118
+ }>>;
119
+ summary: z.ZodString;
120
+ next: z.ZodDiscriminatedUnion<[z.ZodObject<{
121
+ capability: z.ZodLiteral<"operation.get">;
122
+ input: z.ZodObject<{
123
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
124
+ productionId: z.core.$ZodBranded<z.ZodUUID, "ProductionId", "out">;
125
+ operationId: z.core.$ZodBranded<z.ZodString, "OperationId", "out">;
126
+ }, z.core.$strict>;
127
+ }, z.core.$strict>, z.ZodObject<{
128
+ capability: z.ZodLiteral<"production.snapshot">;
129
+ input: z.ZodObject<{
130
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
131
+ productionId: z.core.$ZodBranded<z.ZodUUID, "ProductionId", "out">;
132
+ }, z.core.$strict>;
133
+ }, z.core.$strict>], "capability">;
134
+ }, z.core.$strict>>;
77
135
  nextActions: z.ZodArray<z.ZodObject<{
78
136
  capability: z.ZodString;
79
137
  targetType: z.ZodString;
@@ -87,5 +145,6 @@ export declare const OperationSummarySchema: z.ZodObject<{
87
145
  startedAt: z.ZodISODateTime;
88
146
  updatedAt: z.ZodISODateTime;
89
147
  }, z.core.$strip>;
148
+ export type OperationFailure = z.infer<typeof OperationFailureSchema>;
90
149
  export type OperationTarget = z.infer<typeof OperationTargetSchema>;
91
150
  export type OperationSummary = z.infer<typeof OperationSummarySchema>;
@@ -678,6 +678,31 @@ export declare const ProductionSnapshotSchema: z.ZodObject<{
678
678
  attempts: z.ZodInt;
679
679
  }, z.core.$strip>;
680
680
  blockers: z.ZodArray<z.ZodString>;
681
+ failure: z.ZodOptional<z.ZodObject<{
682
+ reasonCodes: z.ZodArray<z.ZodEnum<{
683
+ AMBIGUOUS: "AMBIGUOUS";
684
+ PERMANENT_OPERATIONAL: "PERMANENT_OPERATIONAL";
685
+ SEMANTIC: "SEMANTIC";
686
+ RATE_LIMIT: "RATE_LIMIT";
687
+ TRANSIENT: "TRANSIENT";
688
+ NOT_RECORDED: "NOT_RECORDED";
689
+ }>>;
690
+ summary: z.ZodString;
691
+ next: z.ZodDiscriminatedUnion<[z.ZodObject<{
692
+ capability: z.ZodLiteral<"operation.get">;
693
+ input: z.ZodObject<{
694
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
695
+ productionId: z.core.$ZodBranded<z.ZodUUID, "ProductionId", "out">;
696
+ operationId: z.core.$ZodBranded<z.ZodString, "OperationId", "out">;
697
+ }, z.core.$strict>;
698
+ }, z.core.$strict>, z.ZodObject<{
699
+ capability: z.ZodLiteral<"production.snapshot">;
700
+ input: z.ZodObject<{
701
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
702
+ productionId: z.core.$ZodBranded<z.ZodUUID, "ProductionId", "out">;
703
+ }, z.core.$strict>;
704
+ }, z.core.$strict>], "capability">;
705
+ }, z.core.$strict>>;
681
706
  nextActions: z.ZodArray<z.ZodObject<{
682
707
  capability: z.ZodString;
683
708
  targetType: z.ZodString;
@@ -166,6 +166,31 @@ export declare const OperationQueryPageSchema: z.ZodObject<{
166
166
  attempts: z.ZodInt;
167
167
  }, z.core.$strip>;
168
168
  blockers: z.ZodArray<z.ZodString>;
169
+ failure: z.ZodOptional<z.ZodObject<{
170
+ reasonCodes: z.ZodArray<z.ZodEnum<{
171
+ AMBIGUOUS: "AMBIGUOUS";
172
+ PERMANENT_OPERATIONAL: "PERMANENT_OPERATIONAL";
173
+ SEMANTIC: "SEMANTIC";
174
+ RATE_LIMIT: "RATE_LIMIT";
175
+ TRANSIENT: "TRANSIENT";
176
+ NOT_RECORDED: "NOT_RECORDED";
177
+ }>>;
178
+ summary: z.ZodString;
179
+ next: z.ZodDiscriminatedUnion<[z.ZodObject<{
180
+ capability: z.ZodLiteral<"operation.get">;
181
+ input: z.ZodObject<{
182
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
183
+ productionId: z.core.$ZodBranded<z.ZodUUID, "ProductionId", "out">;
184
+ operationId: z.core.$ZodBranded<z.ZodString, "OperationId", "out">;
185
+ }, z.core.$strict>;
186
+ }, z.core.$strict>, z.ZodObject<{
187
+ capability: z.ZodLiteral<"production.snapshot">;
188
+ input: z.ZodObject<{
189
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
190
+ productionId: z.core.$ZodBranded<z.ZodUUID, "ProductionId", "out">;
191
+ }, z.core.$strict>;
192
+ }, z.core.$strict>], "capability">;
193
+ }, z.core.$strict>>;
169
194
  nextActions: z.ZodArray<z.ZodObject<{
170
195
  capability: z.ZodString;
171
196
  targetType: z.ZodString;
@@ -28,9 +28,9 @@ export declare const WebhookAttemptViewSchema: z.ZodObject<{
28
28
  attemptId: z.ZodUUID;
29
29
  runtimeAttemptId: z.ZodUUID;
30
30
  outcome: z.ZodEnum<{
31
+ TRANSIENT: "TRANSIENT";
31
32
  STARTED: "STARTED";
32
33
  ACKNOWLEDGED: "ACKNOWLEDGED";
33
- TRANSIENT: "TRANSIENT";
34
34
  PERMANENT: "PERMANENT";
35
35
  SKIPPED: "SKIPPED";
36
36
  }>;
@@ -149,9 +149,9 @@ export declare const WebhookAttemptPageSchema: z.ZodObject<{
149
149
  attemptId: z.ZodUUID;
150
150
  runtimeAttemptId: z.ZodUUID;
151
151
  outcome: z.ZodEnum<{
152
+ TRANSIENT: "TRANSIENT";
152
153
  STARTED: "STARTED";
153
154
  ACKNOWLEDGED: "ACKNOWLEDGED";
154
- TRANSIENT: "TRANSIENT";
155
155
  PERMANENT: "PERMANENT";
156
156
  SKIPPED: "SKIPPED";
157
157
  }>;
@@ -223,6 +223,54 @@ export declare const StudioNavigationSchema: z.ZodObject<{
223
223
  }, z.core.$strict>;
224
224
  }, z.core.$strict>;
225
225
  }, z.core.$strict>], "tool">>;
226
+ failure: z.ZodOptional<z.ZodObject<{
227
+ reasonCodes: z.ZodArray<z.ZodEnum<{
228
+ AMBIGUOUS: "AMBIGUOUS";
229
+ PERMANENT_OPERATIONAL: "PERMANENT_OPERATIONAL";
230
+ SEMANTIC: "SEMANTIC";
231
+ RATE_LIMIT: "RATE_LIMIT";
232
+ TRANSIENT: "TRANSIENT";
233
+ NOT_RECORDED: "NOT_RECORDED";
234
+ }>>;
235
+ summary: z.ZodString;
236
+ next: z.ZodNullable<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
237
+ tool: z.ZodLiteral<"operation_get">;
238
+ arguments: z.ZodObject<{
239
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
240
+ productionId: z.core.$ZodBranded<z.ZodUUID, "ProductionId", "out">;
241
+ operationId: z.core.$ZodBranded<z.ZodString, "OperationId", "out">;
242
+ }, z.core.$strict>;
243
+ }, z.core.$strict>, z.ZodObject<{
244
+ tool: z.ZodLiteral<"studio_capability_query">;
245
+ arguments: z.ZodObject<{
246
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
247
+ capabilityVersion: z.ZodOptional<z.ZodString>;
248
+ tool: z.ZodLiteral<"operation_get">;
249
+ arguments: z.ZodObject<{
250
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
251
+ productionId: z.core.$ZodBranded<z.ZodUUID, "ProductionId", "out">;
252
+ operationId: z.core.$ZodBranded<z.ZodString, "OperationId", "out">;
253
+ }, z.core.$strict>;
254
+ }, z.core.$strict>;
255
+ }, z.core.$strict>], "tool">, z.ZodObject<{
256
+ tool: z.ZodLiteral<"production_snapshot">;
257
+ arguments: z.ZodObject<{
258
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
259
+ productionId: z.core.$ZodBranded<z.ZodUUID, "ProductionId", "out">;
260
+ }, z.core.$strict>;
261
+ }, z.core.$strict>, z.ZodObject<{
262
+ tool: z.ZodLiteral<"studio_capability_query">;
263
+ arguments: z.ZodObject<{
264
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
265
+ capabilityVersion: z.ZodOptional<z.ZodString>;
266
+ tool: z.ZodLiteral<"production_snapshot">;
267
+ arguments: z.ZodObject<{
268
+ tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
269
+ productionId: z.core.$ZodBranded<z.ZodUUID, "ProductionId", "out">;
270
+ }, z.core.$strict>;
271
+ }, z.core.$strict>;
272
+ }, z.core.$strict>]>>;
273
+ }, z.core.$strict>>;
226
274
  targetCount: z.ZodInt;
227
275
  blockerCount: z.ZodInt;
228
276
  evidence: z.ZodObject<{
@@ -234,8 +282,8 @@ export declare const StudioNavigationSchema: z.ZodObject<{
234
282
  tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
235
283
  catalogVersion: z.ZodString;
236
284
  outcome: z.ZodEnum<{
237
- MATCHES: "MATCHES";
238
285
  AMBIGUOUS: "AMBIGUOUS";
286
+ MATCHES: "MATCHES";
239
287
  NO_MATCH: "NO_MATCH";
240
288
  }>;
241
289
  candidates: z.ZodArray<z.ZodObject<{
@@ -145,8 +145,8 @@ export declare const CapabilitySearchSchema: z.ZodObject<{
145
145
  tenantId: z.core.$ZodBranded<z.ZodUUID, "TenantId", "out">;
146
146
  catalogVersion: z.ZodString;
147
147
  outcome: z.ZodEnum<{
148
- MATCHES: "MATCHES";
149
148
  AMBIGUOUS: "AMBIGUOUS";
149
+ MATCHES: "MATCHES";
150
150
  NO_MATCH: "NO_MATCH";
151
151
  }>;
152
152
  candidates: z.ZodArray<z.ZodObject<{
@@ -1570,6 +1570,24 @@ export declare const coreOperations: {
1570
1570
  href: string;
1571
1571
  }[];
1572
1572
  } | undefined;
1573
+ failure?: {
1574
+ reasonCodes: ("AMBIGUOUS" | "PERMANENT_OPERATIONAL" | "SEMANTIC" | "RATE_LIMIT" | "TRANSIENT" | "NOT_RECORDED")[];
1575
+ summary: string;
1576
+ next: {
1577
+ capability: "operation.get";
1578
+ input: {
1579
+ tenantId: string & z.core.$brand<"TenantId">;
1580
+ productionId: string & z.core.$brand<"ProductionId">;
1581
+ operationId: string & z.core.$brand<"OperationId">;
1582
+ };
1583
+ } | {
1584
+ capability: "production.snapshot";
1585
+ input: {
1586
+ tenantId: string & z.core.$brand<"TenantId">;
1587
+ productionId: string & z.core.$brand<"ProductionId">;
1588
+ };
1589
+ };
1590
+ } | undefined;
1573
1591
  }[];
1574
1592
  blockers: {
1575
1593
  code: string;
@@ -2122,6 +2140,24 @@ export declare const coreOperations: {
2122
2140
  href: string;
2123
2141
  }[];
2124
2142
  } | undefined;
2143
+ failure?: {
2144
+ reasonCodes: ("AMBIGUOUS" | "PERMANENT_OPERATIONAL" | "SEMANTIC" | "RATE_LIMIT" | "TRANSIENT" | "NOT_RECORDED")[];
2145
+ summary: string;
2146
+ next: {
2147
+ capability: "operation.get";
2148
+ input: {
2149
+ tenantId: string;
2150
+ productionId: string;
2151
+ operationId: string;
2152
+ };
2153
+ } | {
2154
+ capability: "production.snapshot";
2155
+ input: {
2156
+ tenantId: string;
2157
+ productionId: string;
2158
+ };
2159
+ };
2160
+ } | undefined;
2125
2161
  }[];
2126
2162
  blockers: {
2127
2163
  code: string;
@@ -3403,6 +3439,24 @@ export declare const coreOperations: {
3403
3439
  href: string;
3404
3440
  }[];
3405
3441
  } | undefined;
3442
+ failure?: {
3443
+ reasonCodes: ("AMBIGUOUS" | "PERMANENT_OPERATIONAL" | "SEMANTIC" | "RATE_LIMIT" | "TRANSIENT" | "NOT_RECORDED")[];
3444
+ summary: string;
3445
+ next: {
3446
+ capability: "operation.get";
3447
+ input: {
3448
+ tenantId: string & z.core.$brand<"TenantId">;
3449
+ productionId: string & z.core.$brand<"ProductionId">;
3450
+ operationId: string & z.core.$brand<"OperationId">;
3451
+ };
3452
+ } | {
3453
+ capability: "production.snapshot";
3454
+ input: {
3455
+ tenantId: string & z.core.$brand<"TenantId">;
3456
+ productionId: string & z.core.$brand<"ProductionId">;
3457
+ };
3458
+ };
3459
+ } | undefined;
3406
3460
  }[];
3407
3461
  page: {
3408
3462
  hasMore: boolean;
@@ -3453,6 +3507,24 @@ export declare const coreOperations: {
3453
3507
  href: string;
3454
3508
  }[];
3455
3509
  } | undefined;
3510
+ failure?: {
3511
+ reasonCodes: ("AMBIGUOUS" | "PERMANENT_OPERATIONAL" | "SEMANTIC" | "RATE_LIMIT" | "TRANSIENT" | "NOT_RECORDED")[];
3512
+ summary: string;
3513
+ next: {
3514
+ capability: "operation.get";
3515
+ input: {
3516
+ tenantId: string;
3517
+ productionId: string;
3518
+ operationId: string;
3519
+ };
3520
+ } | {
3521
+ capability: "production.snapshot";
3522
+ input: {
3523
+ tenantId: string;
3524
+ productionId: string;
3525
+ };
3526
+ };
3527
+ } | undefined;
3456
3528
  }[];
3457
3529
  page: {
3458
3530
  hasMore: boolean;
@@ -3511,6 +3583,24 @@ export declare const coreOperations: {
3511
3583
  href: string;
3512
3584
  }[];
3513
3585
  } | undefined;
3586
+ failure?: {
3587
+ reasonCodes: ("AMBIGUOUS" | "PERMANENT_OPERATIONAL" | "SEMANTIC" | "RATE_LIMIT" | "TRANSIENT" | "NOT_RECORDED")[];
3588
+ summary: string;
3589
+ next: {
3590
+ capability: "operation.get";
3591
+ input: {
3592
+ tenantId: string & z.core.$brand<"TenantId">;
3593
+ productionId: string & z.core.$brand<"ProductionId">;
3594
+ operationId: string & z.core.$brand<"OperationId">;
3595
+ };
3596
+ } | {
3597
+ capability: "production.snapshot";
3598
+ input: {
3599
+ tenantId: string & z.core.$brand<"TenantId">;
3600
+ productionId: string & z.core.$brand<"ProductionId">;
3601
+ };
3602
+ };
3603
+ } | undefined;
3514
3604
  }, {
3515
3605
  id: string;
3516
3606
  productionId: string;
@@ -3555,5 +3645,23 @@ export declare const coreOperations: {
3555
3645
  href: string;
3556
3646
  }[];
3557
3647
  } | undefined;
3648
+ failure?: {
3649
+ reasonCodes: ("AMBIGUOUS" | "PERMANENT_OPERATIONAL" | "SEMANTIC" | "RATE_LIMIT" | "TRANSIENT" | "NOT_RECORDED")[];
3650
+ summary: string;
3651
+ next: {
3652
+ capability: "operation.get";
3653
+ input: {
3654
+ tenantId: string;
3655
+ productionId: string;
3656
+ operationId: string;
3657
+ };
3658
+ } | {
3659
+ capability: "production.snapshot";
3660
+ input: {
3661
+ tenantId: string;
3662
+ productionId: string;
3663
+ };
3664
+ };
3665
+ } | undefined;
3558
3666
  }>;
3559
3667
  };