@makaio/framework 1.0.0-dev-1788936831433 → 1.0.0-dev-1788955549564
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/dist/.makaio-build.json +2 -2
- package/dist/{account-identity-DCBpVurJ.mjs → account-identity-B0NsOILM.mjs} +1 -1
- package/dist/{adapter-D6IpEDIo.mjs → adapter-DYE_oWjj.mjs} +1 -1
- package/dist/artifact-nArLAotB.mjs +1 -0
- package/dist/{automation-trigger-D_xKqEoV.mjs → automation-trigger-CZfH94Fr.mjs} +1 -1
- package/dist/bus/index.mjs +1 -1
- package/dist/{canonical-model-DwuFQ02A.mjs → canonical-model-oFNty7hj.mjs} +1 -1
- package/dist/{client-CTqzLpVx.mjs → client-DJMzCHRm.mjs} +1 -1
- package/dist/{compression-3DauETKU.mjs → compression-nZhMDRTA.mjs} +1 -1
- package/dist/contracts/adapter/index.d.mts +2 -2
- package/dist/contracts/adapter/index.mjs +1 -1
- package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
- package/dist/contracts/artifact/index.d.mts +3 -3
- package/dist/contracts/artifact/index.mjs +1 -1
- package/dist/contracts/automation-trigger/index.mjs +1 -1
- package/dist/contracts/canonical-model/index.mjs +1 -1
- package/dist/contracts/capabilities/index.d.mts +1 -1
- package/dist/contracts/client/index.d.mts +1 -1
- package/dist/contracts/client/index.mjs +1 -1
- package/dist/contracts/config/index.mjs +1 -1
- package/dist/contracts/extension/index.d.mts +2 -2
- package/dist/contracts/index.d.mts +28 -28
- package/dist/contracts/index.mjs +1 -1
- package/dist/contracts/materialization/index.d.mts +1 -1
- package/dist/contracts/materialization/index.mjs +1 -1
- package/dist/contracts/native-session-supervisor/index.d.mts +1 -1
- package/dist/contracts/reaction/index.mjs +1 -1
- package/dist/contracts/session/index.d.mts +2 -2
- package/dist/contracts/session/index.mjs +1 -1
- package/dist/contracts/shared/index.mjs +1 -1
- package/dist/contracts/worker/index.d.mts +1 -1
- package/dist/contracts/worker/index.mjs +1 -1
- package/dist/contracts/workflow/index.d.mts +2 -2
- package/dist/contracts/workflow/index.mjs +1 -1
- package/dist/{framework-packages-B3SQPHD7.mjs → framework-packages-25GUGzJ-.mjs} +1 -1
- package/dist/{index-CqSdF7rK.d.mts → index-99Gz8ezO.d.mts} +7 -7
- package/dist/{index-DlOp5nH0.d.mts → index-BAL1FiaJ.d.mts} +6 -6
- package/dist/{index-ZGtyv_3n2.d.mts → index-Bak5iKWv2.d.mts} +4 -4
- package/dist/{index-BQoiFDct.d.mts → index-C9J8wBLV.d.mts} +104 -68
- package/dist/{index-C83rKcaK2.d.mts → index-CVx7li6B2.d.mts} +24 -24
- package/dist/{index-CzSoEyWu.d.mts → index-ConotXyG.d.mts} +14 -14
- package/dist/{index-DDUi5U4Q.d.mts → index-CwJaE0fT.d.mts} +24 -24
- package/dist/{index-BwktKRHX.d.mts → index-CyB6POkH.d.mts} +1 -1
- package/dist/{index-DWU3yzQ-.d.mts → index-D2sbGoGS.d.mts} +1 -1
- package/dist/{index-BV1Btpfc.d.mts → index-DfJNJYPV.d.mts} +1 -1
- package/dist/{index-J7xYeLwB.d.mts → index-DzeUtJtE.d.mts} +8 -8
- package/dist/{index-B6Lsx8QD2.d.mts → index-OUtnmQ8t2.d.mts} +3 -3
- package/dist/{index-glwUNat3.d.mts → index-OXuby-ee.d.mts} +4 -4
- package/dist/{index-BypDPKtQ.d.mts → index-VbqrC9qf.d.mts} +34 -34
- package/dist/kernel/extension/index.d.mts +1 -1
- package/dist/kernel/index.d.mts +2 -2
- package/dist/kernel/observability/index.d.mts +1 -1
- package/dist/{materialization-CDemi12q.mjs → materialization-BQuh_gaE.mjs} +1 -1
- package/dist/{namespace-BXkDQ9nn.d.mts → namespace-Cb0XKb4v.d.mts} +2 -2
- package/dist/{namespace-DCmkW_25.d.mts → namespace-DiTFR4Zt.d.mts} +2 -2
- package/dist/{namespace-Cjh_Ogen.d.mts → namespace-c5XPzbf3.d.mts} +3 -3
- package/dist/package.json +1 -1
- package/dist/packages-Dhgmy_LJ.mjs +1 -0
- package/dist/{reaction-OQibmmDW.mjs → reaction-6e4v007b.mjs} +1 -1
- package/dist/{schemas-DfSirQM5.d.mts → schemas-BFwNBMIj.d.mts} +6 -6
- package/dist/{schemas-CSDiTBsU.mjs → schemas-BIU9Org_.mjs} +1 -1
- package/dist/{schemas-eA76OYo2.d.mts → schemas-BZabEyEV.d.mts} +1 -1
- package/dist/{schemas-B4gxLiTq.d.mts → schemas-Di_kpQ0C.d.mts} +2 -1
- package/dist/schemas-FiFC_DI6.mjs +1 -0
- package/dist/{schemas-Bg2fBMPN.d.mts → schemas-I9dZtAkj.d.mts} +2 -2
- package/dist/{schemas-BUK9I-Oz.mjs → schemas-abY5VbS4.mjs} +1 -1
- package/dist/services/adapter-runtime/index.d.mts +3 -3
- package/dist/services/adapter-runtime/namespace.d.mts +1 -1
- package/dist/services/adapter-runtime/schemas.d.mts +1 -1
- package/dist/services/context-rules/index.d.mts +3 -3
- package/dist/services/execution-target/index.d.mts +3 -3
- package/dist/services/execution-target/namespace.d.mts +1 -1
- package/dist/services/execution-target/schemas.d.mts +1 -1
- package/dist/services/filesystem/namespace.d.mts +6 -6
- package/dist/services/filesystem/schemas.d.mts +3 -3
- package/dist/services/git/namespace.d.mts +2 -2
- package/dist/services/git/schemas.d.mts +1 -1
- package/dist/services/index.d.mts +22 -22
- package/dist/services/index.mjs +1 -1
- package/dist/services/materialization/index.mjs +1 -1
- package/dist/services/session/handlers/index.d.mts +1 -1
- package/dist/services/session/index.d.mts +3 -3
- package/dist/services/session/messages/namespace.d.mts +1 -1
- package/dist/services/settings/namespace.d.mts +6 -6
- package/dist/services/subagent-template/index.d.mts +1 -1
- package/dist/services/subagent-template/schemas.d.mts +1 -1
- package/dist/services/tools/index.mjs +1 -1
- package/dist/services/workflow-transitions/index.mjs +1 -1
- package/dist/{session-CQAuApxe.mjs → session-A-h_Dwcs.mjs} +1 -1
- package/dist/{session-lineage-Bwb98OUz.d.mts → session-lineage-BzlpfLgC.d.mts} +1 -1
- package/dist/{shared-BYP7z9xy.mjs → shared-BZf2zoxL.mjs} +1 -1
- package/dist/{tools-2INrWlnS.mjs → tools-oQPsY7v2.mjs} +1 -1
- package/dist/{transition-DXfTmVSx.d.mts → transition-BeWq5nKg.d.mts} +1 -1
- package/dist/{types-B4u8kNdt.d.mts → types-CIEJ91wm.d.mts} +3 -3
- package/dist/{view-builder-DU_WTiuk.d.mts → view-builder-BwGugMWz.d.mts} +1 -1
- package/dist/{worker-Bn0x5MSH.mjs → worker-Csadr_du.mjs} +1 -1
- package/dist/{workflow-B6C3Pf66.mjs → workflow-Cb2Pj1h3.mjs} +1 -1
- package/dist/workflow-engine/index.d.mts +40 -40
- package/dist/{workflow-transitions-BbhM_zPm.mjs → workflow-transitions-BI7PbrXv.mjs} +1 -1
- package/package.json +1 -1
- package/dist/artifact-DtmJR46g.mjs +0 -1
- package/dist/packages-7CsXP86g.mjs +0 -1
- package/dist/schemas-BahXrOYa.mjs +0 -1
- package/dist/{index-CBnCXp1R2.d.mts → index-Dmwnhnio2.d.mts} +6 -6
- /package/dist/{zod-json-schema-B9TYYq3e.mjs → zod-json-schema-B1mZz7S4.mjs} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e}from"./framework-packages-
|
|
1
|
+
import{u as e}from"./framework-packages-25GUGzJ-.mjs";function t(){let t=new Map;return{filter:e=>!!(e.transitionRules?.rules?.length||e.transitionActions?.actions),async processActivated(i,a,o){let s=o.getService(e);if(!s)throw Error(`TransitionContributionProcessor: TransitionPipelineService is not available — ensure '${e.name}' is started before extensions with transitionRules or transitionActions.`);let c=a.transitionRules?.rules??[],l=a.transitionActions?.actions,u=c.length>0,d=l!==void 0;u&&n(i,c),d&&r(i,l);let f=!1,p=!1;try{u&&(s.ruleRegistry.register(i,c),f=!0),d&&(s.actionRegistry.register(i,l),p=!0)}catch(e){throw f&&s.ruleRegistry.deregister(i),p&&s.actionRegistry.deregister(i),e}t.set(i,()=>{u&&s.ruleRegistry.deregister(i),d&&s.actionRegistry.deregister(i)})},async processStopped(e){let n=t.get(e);if(n){try{n()}catch(t){console.error(`[TransitionContributionProcessor] Deregister error for "${e}":`,t)}t.delete(e)}}}}function n(e,t){let n=`${e}.`;for(let e of t)if(!e.id.startsWith(n))throw Error(`TransitionContributionProcessor: rule '${e.id}' must be namespaced by extension '${n}'`)}function r(e,t){let n=`${e}.`;for(let e of Object.keys(t))if(!e.startsWith(n))throw Error(`TransitionContributionProcessor: action type '${e}' must be namespaced by extension '${n}'`)}export{t};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,c as t,d as n,i as r,l as i,n as a,r as o,x as s,y as c}from"./schemas-BahXrOYa.mjs";import{a as l,c as u,d,f}from"./kind-registration-DggkrLkv.mjs";import{t as p}from"./zod-json-schema-B9TYYq3e.mjs";import{z as m}from"zod";import{createBusNamespace as h}from"@makaio/framework/core";function g(e){let{dataSchema:t,hooks:n,...r}=e,i={$schema:`https://json-schema.org/draft/2020-12/schema`,...p(t)};d(i);let a=l.parse({...r,dataSchema:i});if(a.kind!==e.kind)throw Error(`Artifact kind identifiers must not contain surrounding whitespace`);let o=m.fromJSONSchema(a.dataSchema),s=m.unknown().superRefine((e,t)=>{let n=o.safeParse(e);if(!n.success)for(let e of n.error.issues)t.addIssue({code:`custom`,path:e.path,message:e.message})}).pipe(t).superRefine((e,t)=>{try{f(e,a.titlePath)}catch(e){t.addIssue({code:`custom`,path:a.titlePath.split(`.`),message:e instanceof Error?e.message:`Artifact title must be a nonblank string`})}});return{...structuredClone(a),kind:e.kind,schemaVersion:e.schemaVersion,dataSchema:s,...n?{hooks:n}:{},toRegistration:()=>structuredClone(a)}}function _(e){return{hooks:[...e.hooks]}}const v=[`inline`,`summary`,`link`,`omit`],y=m.string().min(1),b=m.object({kinds:m.array(m.string().min(1)).optional(),hint:y.optional(),depth:m.number().int().min(1).max(20).optional(),nested:m.lazy(()=>x).optional()}),x=m.record(m.string().min(1),b);function S(e){return JSON.stringify([e.kind,e.id,e.revision])}const C=m.enum([`not-selected`,`not-found`,`depth-exceeded`,`unsupported-ref-class`,`cycle-detected`]),w=m.object({target:i,sourceRef:s,relationType:m.string().min(1),hint:y,status:m.enum([`resolved`,`unresolved`]),reason:C.optional()}).superRefine((e,t)=>{e.status===`unresolved`&&e.reason===void 0&&t.addIssue({code:m.ZodIssueCode.custom,path:[`reason`],message:`reason is required for unresolved artifact context refs`}),e.status===`resolved`&&e.reason!==void 0&&t.addIssue({code:m.ZodIssueCode.custom,path:[`reason`],message:`reason must be omitted for resolved artifact context refs`}),e.status===`resolved`&&e.target.refClass!==`artifact`&&t.addIssue({code:m.ZodIssueCode.custom,path:[`target`],message:`resolved artifact context refs must target an artifact revision`})}),T=m.object({rootRef:s,refs:m.array(w),resolved:m.array(n)}).superRefine((e,t)=>{let n=new Set(e.resolved.map(S));n.has(S(e.rootRef))||t.addIssue({code:m.ZodIssueCode.custom,path:[`resolved`],message:`resolved artifact context wire payloads must include the root artifact revision`}),e.refs.forEach((e,r)=>{n.has(S(e.sourceRef))||t.addIssue({code:m.ZodIssueCode.custom,path:[`refs`,r,`sourceRef`],message:`artifact context ref sources must have a matching revision in resolved`}),!(e.status!==`resolved`||e.target.refClass!==`artifact`)&&(n.has(S(e.target))||t.addIssue({code:m.ZodIssueCode.custom,path:[`refs`,r,`target`],message:`resolved artifact context refs must have a matching revision in resolved`}))})});function E(e){let t=T.parse(e),n=new Map(t.resolved.map(e=>[j(e),e])),r=new Map;for(let e of t.refs){let t=j(e.sourceRef),n=r.get(t);n||(n=[],r.set(t,n)),n.push(e)}let i=n.get(j(t.rootRef));if(!i)throw Error(`Resolved artifact context is missing root artifact '${j(t.rootRef)}'`);let a=D(t.rootRef,i,`inline`,r,n);return{root:a,flatten(){let e=[];return A(a,e),e}}}function D(e,t,n,r,i){return{status:`resolved`,ref:e,artifact:t,hint:n,children:k(e,r,i,new Set([j(e)]))}}function O(e,t,n,r,i,a,o){let s=j(e),c=new Set(o);return c.add(s),{status:`resolved`,ref:e,artifact:t,relation:n,hint:r,children:k(e,i,a,c)}}function k(e,t,n,r){return(t.get(j(e))??[]).map(e=>{if(e.status===`unresolved`)return{status:`unresolved`,target:e.target,relation:e.relationType,hint:e.hint,reason:e.reason};if(e.target.refClass!==`artifact`)throw Error(`Resolved artifact context refs must target an artifact revision`);let i=j(e.target),a=n.get(i);if(!a)throw Error(`Resolved artifact context is missing target artifact '${i}'`);return r.has(i)?{status:`unresolved`,target:e.target,relation:e.relationType,hint:e.hint,reason:`cycle-detected`}:O(e.target,a,e.relationType,e.hint,t,n,r)})}function A(e,t){if(e.status!==`unresolved`){t.push(e.artifact);for(let n of e.children)A(n,t)}}function j(e){return JSON.stringify([e.kind,e.id,e.revision])}const M={"kind.register":{request:l,response:m.object({registered:m.boolean()})},"kind.list":{request:m.object({kind:m.string().min(1).optional()}),response:m.object({kinds:m.array(l)})},"relation-type.register":{request:c,response:m.object({registered:m.boolean()})},"relation-type.list":{request:m.object({type:m.string().min(1).optional()}),response:m.object({relationTypes:m.array(c)})},create:{request:n.omit({id:!0,revision:!0,timestamp:!0}).extend({id:s.shape.id.optional()}),response:m.object({artifact:n})},revise:{request:m.object({previous:s,statusPath:m.string().regex(/^(?:\/(?:[^~/]|~[01])*)+$/,`Expected a data-relative JSON Pointer`).optional(),revision:n.omit({id:!0,revision:!0,timestamp:!0})}),response:m.object({artifact:n})},resolve:{request:m.object({ref:s}),response:m.object({artifact:n.nullable()})},query:{request:e,response:m.object({artifacts:m.array(n)})},compare:{request:a,response:o},resolveContext:{request:m.object({ref:s,selectors:x.optional(),maxDepth:m.number().int().min(1).max(20).default(5)}),response:m.object({context:T})},created:m.object({artifact:n}),revised:m.object({previous:s,artifact:n}),"relation.added":m.object({artifact:s,relation:t}),"observation.added":m.object({artifact:s,observation:r}),"status.changed":m.object({artifact:s,path:m.string().min(1),previous:m.unknown().optional(),current:m.unknown().optional()}),"kind.changed":m.object({kind:m.string().min(1),schemaVersion:u})},N=h(`artifact`,M),P=N.subjects;export{w as a,v as c,x as d,_ as f,E as i,b as l,M as n,C as o,g as p,P as r,T as s,N as t,y as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-DTipWd-i.mjs";import{t}from"./ajv-Dtk5hCZS.mjs";import{t as n}from"./2020-Bl3Yx3In.mjs";import{t as r}from"./dist-CfANkKSb.mjs";import{canonicalStringify as i}from"@makaio/framework/utils";import{ArtifactKindRegistrationSchema as a,ArtifactSubjects as o,ArtifactViewModelSchema as s,ArtifactViewResolveRequestSchema as c,MaterializationSubjects as l,dep as u,extensionToken as d}from"@makaio/framework/contracts";import{BaseService as f}from"@makaio/framework/service-base";import{readArtifactTitle as p}from"@makaio/framework/contracts/artifact";import{MaterializationSubjects as m}from"@makaio/framework/contracts/materialization";var h=e(t(),1),g=e(n(),1),_=e(r(),1);function v(e){try{let t={allErrors:!0,strict:!1,strictSchema:!0},n=e.dataSchema.$schema===`https://json-schema.org/draft/2020-12/schema`?new g.default(t):new h.default(t);(0,_.default)(n),n.compile(e.dataSchema)}catch(t){throw Error(`Invalid data schema for artifact kind '${e.kind}' version '${e.schemaVersion}': ${t instanceof Error?t.message:String(t)}`,{cause:t})}}const y=[{type:`supersedes`,symmetry:`asymmetric`},{type:`contradicts`,symmetry:`symmetric`},{type:`derives_from`,symmetry:`asymmetric`},{type:`responds_to`,symmetry:`asymmetric`},{type:`contains`,symmetry:`asymmetric`},{type:`refines`,symmetry:`asymmetric`},{type:`scopes`,symmetry:`asymmetric`},{type:`references`,symmetry:`asymmetric`},{type:`evidenced_by`,symmetry:`asymmetric`}],b={extension:0,"factory-repo":1,"target-repo":2},x={source:`extension`,ownerKey:`extension:bus`};function S(e){return`${e.source}:${e.ownerKey}`}function C(e,t){return e.source===t.source&&e.ownerKey===t.ownerKey}function w(e){return structuredClone(e)}function T(e,t){return`${e}@${t}`}var E=class extends f{kinds=new Map;kindContributions=new Map;nextKindContributionOrder=0;relationTypes=new Map;constructor(e){super(e)}async onInit(){for(let e of y)this.relationTypes.set(e.type,e);this.registerHandler(o.kind.register,e=>{this.registerKind(e.payload),e.setResult({registered:!0})}),this.registerHandler(o.kind.list,e=>{let{kind:t}=e.payload,n=[...this.kinds.values()].filter(e=>!t||e.kind===t).map(w);e.setResult({kinds:n})}),this.registerHandler(o[`relation-type`].register,e=>{this.storeRelationType(e.payload),e.setResult({registered:!0})}),this.registerHandler(o[`relation-type`].list,e=>{let{type:t}=e.payload,n=[...this.relationTypes.values()].filter(e=>!t||e.type===t).map(w);e.setResult({relationTypes:n})})}compareKindContributions(e,t){let n=b[e.owner.source]-b[t.owner.source];return n===0?e.owner.source===`extension`?t.order-e.order:e.order-t.order:n}findSameTierRepoConflict(e,t,n){return[...e.values()].find(e=>!C(e.owner,t)&&e.owner.source===t.source&&t.source!==`extension`&&e.order<=n)}recomputeKindWinner(e){let t=this.kindContributions.get(e),n=this.kinds.get(e);if(t===void 0||t.size===0){this.kindContributions.delete(e),this.kinds.delete(e),this.emitKindChangedFromKey(e,n);return}let r;for(let e of t.values())(r===void 0||this.compareKindContributions(e,r)<0)&&(r=e);let i=r;this.kinds.set(e,w(i.registration)),JSON.stringify(n)!==JSON.stringify(i.registration)&&this.bus.emit(o.kind.changed,{kind:i.registration.kind,schemaVersion:i.registration.schemaVersion})}emitKindChangedFromKey(e,t){t!==void 0&&this.bus.emit(o.kind.changed,{kind:t.kind,schemaVersion:t.schemaVersion})}registerKind(e,t=x){e=a.parse(e),v(e);let n=T(e.kind,e.schemaVersion),r=this.kindContributions.get(n)??new Map,i=S(t),o=r.get(i),s=t.source===`extension`?this.nextKindContributionOrder:o?.order??this.nextKindContributionOrder,c=this.findSameTierRepoConflict(r,t,s);if(c!==void 0){console.warn(`[ArtifactSchemaRegistry] Artifact kind '${n}' is already registered by '${c.owner.ownerKey}' at the same priority; keeping the existing owner.`);return}r.set(i,{owner:t,registration:w(e),order:t.source===`extension`||o===void 0?this.nextKindContributionOrder++:o.order}),this.kindContributions.set(n,r),this.recomputeKindWinner(n)}deregisterKind(e,t,n=x){let r=T(e,t),i=this.kindContributions.get(r);i!==void 0&&(i.delete(S(n)),this.recomputeKindWinner(r))}replaceKindRegistrationsForOwner(e,t){let n=t.map(e=>a.parse(e));for(let e of n)v(e);let r=new Set,i=S(e),o=new Map;for(let[e,t]of this.kindContributions.entries()){let n=t.get(i);n!==void 0&&(o.set(e,n.order),t.delete(i),r.add(e))}for(let t of n){let n=T(t.kind,t.schemaVersion),a=this.kindContributions.get(n)??new Map,s=e.source===`extension`?void 0:o.get(n),c=s??this.nextKindContributionOrder,l=this.findSameTierRepoConflict(a,e,c);if(l!==void 0){console.warn(`[ArtifactSchemaRegistry] Artifact kind '${n}' is already registered by '${l.owner.ownerKey}' at the same priority; keeping the existing owner.`);continue}a.set(i,{owner:e,registration:w(t),order:s??this.nextKindContributionOrder++}),this.kindContributions.set(n,a),r.add(n)}for(let e of r)this.recomputeKindWinner(e)}storeRelationType(e){let t=this.relationTypes.get(e.type);if(t){if(t.symmetry!==e.symmetry)throw Error(`Relation type '${e.type}' is already registered with different symmetry (existing: '${t.symmetry}', new: '${e.symmetry}')`);return}this.relationTypes.set(e.type,w(e))}getKind(e,t){let n=this.kinds.get(T(e,t));return n?w(n):void 0}getRelationType(e){let t=this.relationTypes.get(e);return t?w(t):void 0}onDestroy(){this.kinds.clear(),this.kindContributions.clear(),this.relationTypes.clear(),this.nextKindContributionOrder=0}};const D=d(`artifact-schema-registry`),O={name:D.name,displayName:`Artifact Schema Registry`,version:`0.1.0`,critical:!0,create:e=>new E(e.bus)};function k(e,t){return JSON.stringify([e,t])}function A(e){return Object.freeze({kind:e.kind,schemaVersion:e.schemaVersion,version:e.version,build:e.build})}var j=class extends Error{key;incomingOwner;existingOwner;constructor(e,t,n){let r=t===n?`Duplicate builder key '${e}' within owner '${t}'`:`Builder key '${e}' from owner '${t}' collides with owner '${n}'`;super(r),this.key=e,this.incomingOwner=t,this.existingOwner=n,this.name=`ArtifactViewBuilderCollisionError`}},M=class{owners=new Map;globalIndex=new Map;getBuilder(e,t){return this.globalIndex.get(k(e,t))?.builder}replaceBuildersForOwner(e,t){for(let n of t)if(!Number.isInteger(n.version)||n.version<1)throw Error(`Builder for '${k(n.kind,n.schemaVersion)}' from owner '${e}' has non-positive version ${String(n.version)}`);let n=new Map;for(let r of t){let t=k(r.kind,r.schemaVersion);if(n.has(t))throw new j(t,e,e);n.set(t,A(r))}for(let t of n.keys()){let n=this.globalIndex.get(t);if(n&&n.owner!==e)throw new j(t,e,n.owner)}n.size===0?this.owners.delete(e):this.owners.set(e,[...n.values()]),this.rebuildGlobalIndex()}removeBuildersForOwner(e){this.owners.has(e)&&(this.owners.delete(e),this.rebuildGlobalIndex())}getBuildersForOwner(e){let t=this.owners.get(e);if(t)return[...t]}clear(){this.owners.clear(),this.globalIndex.clear()}destroy(){this.clear()}rebuildGlobalIndex(){let e=new Map;for(let[t,n]of this.owners)for(let r of n){let n=k(r.kind,r.schemaVersion);e.set(n,{owner:t,builder:r})}this.globalIndex=e}};const N=5;function P(e){if(e.target.refClass===`artifact`)return{artifactId:e.target.id,label:`[${e.target.kind}] ${e.target.id}`}}function F(e){let t=new Map;for(let n of e){let e=P(n);if(!e)continue;let r=t.get(n.type)??[];r.push(e),t.set(n.type,r)}if(t.size!==0)return{type:`relations`,title:`Relations`,groups:[...t.entries()].map(([e,t])=>({type:e,items:t}))}}function I(e){let t=[],n=new Set;for(let r of e){let e=P(r);!e||n.has(e.artifactId)||(n.add(e.artifactId),t.push(e))}return{breadcrumbs:[],related:t}}function L(e){if(!e.confidence?.basis)return;let t=[];for(let n of e.confidence.basis){let e=n.evidenceRef;e?.refClass===`evidence`&&t.push({kind:e.kind,id:e.id,...e.locator?{locator:e.locator}:{}})}if(t.length!==0)return{type:`evidence`,title:`Evidence`,items:t}}function R(e,t,n){let r=[];if(n===`full`){let t=F(e.relations);t&&r.push(t);let n=L(e);n&&r.push(n)}return{title:p(e.data,t.titlePath),artifact:{id:e.id,kind:e.kind,revision:e.revision},navigation:I(e.relations),sections:r,links:{}}}var z=class extends f{schemaRegistry;builderRegistry;constructor(e,t,n){super(e),this.schemaRegistry=t,this.builderRegistry=n}async onInit(){this.registerHandler(l.artifact.view.resolve,async e=>{let{ref:t,level:n,affordance:r,params:i}=c.parse(e.payload),a=await this.resolve(t,n,r,i);e.setResult(a)})}async resolve(e,t,n,r){let i=await this.bus.requestOptional(o.resolve,{ref:e});if(!i.handled||i.data.artifact===null)return{status:`artifact-not-found`,view:null};let a=i.data.artifact,c=this.schemaRegistry.getKind(a.kind,a.schemaVersion);if(c===void 0)return{status:`not-rendered`,view:null};let l=this.builderRegistry.getBuilder(a.kind,a.schemaVersion);if(l===void 0)return{status:`not-rendered`,view:null};let u=R(a,c,t),d=u.sections,f=u.navigation,p=l.version,m=await l.build({artifact:a,level:t,affordance:n,params:r,genericSections:u.sections,genericNavigation:u.navigation,relations:a.relations});if(m!==void 0){if(`render`in m&&m.render===!1)return{status:`not-rendered`,view:null};`sections`in m&&(d=m.sections??d),`navigation`in m&&(f=m.navigation??f)}let h={title:u.title,artifact:u.artifact,navigation:f,sections:[...d],links:u.links};return{status:`ok`,view:s.parse(h),builderVersion:p,sourceRevision:e.revision}}};function B(e){return structuredClone(e)}var V=class extends f{bindings=new Map;constructor(e){super(e)}async onInit(){this.registerHandler(m.surfaceBinding.register,e=>{this.registerBinding(e.payload),e.setResult({registered:!0})}),this.registerHandler(m.surfaceBinding.list,e=>{let{id:t,provider:n,namespace:r}=e.payload,i=[...this.bindings.values()].filter(e=>(!t||e.id===t)&&(!n||e.provider===n)&&(!r||e.namespace===r)).map(B);e.setResult({bindings:i})})}registerBinding(e){let t=this.bindings.get(e.id);if(t){if(i(t)!==i(e))throw Error(`Surface binding '${e.id}' is already registered with a different definition`);return}this.bindings.set(e.id,B(e)),this.bus.emit(m.surfaceBinding.changed,{id:e.id,provider:e.provider})}deregisterBinding(e){let t=this.bindings.get(e);t&&(this.bindings.delete(e),this.bus.emit(m.surfaceBinding.changed,{id:e,provider:t.provider}))}getBinding(e){let t=this.bindings.get(e);return t?B(t):void 0}onDestroy(){this.bindings.clear()}},H=class{queues=new Map;activeLeases=new Map;pendingAcquisitions=new Set;authorizedRequests=new Map;consumedAuthorizedRequestIds=new Set;acceptingAcquisitions=!0;destroyPromise;destroy(){return this.acceptingAcquisitions=!1,this.destroyPromise??=this.drain(),this.destroyPromise}acquire(e){if(!this.acceptingAcquisitions)return Promise.reject(Error(`Materialization operation coordinator is destroyed`));let t=this.acquireAdmitted(e);return this.pendingAcquisitions.add(t),t.then(()=>this.pendingAcquisitions.delete(t),()=>this.pendingAcquisitions.delete(t)),t}async acquireAdmitted(e){let t=U(e),n=new Set,r=[];for(let e of W(t))r.push(await this.acquireKey(e)),n.add(e);let i={id:crypto.randomUUID(),scope:t},a,o=new Promise(e=>{a=e});return this.activeLeases.set(i.id,{lease:i,heldKeys:n,releases:r,settled:o,settle:a,released:!1}),i}release(e){let t=this.requireActiveLease(e);t.released=!0,this.activeLeases.delete(e.id);for(let e of t.releases.reverse())e();t.settle()}async extend(e,t){let n=this.requireActiveLease(e),r=U(t);if(r.artifactId!==e.scope.artifactId)throw Error(`A materialization operation lease cannot be extended to another artifact`);let i=W(r).filter(e=>!n.heldKeys.has(e)),a=[...n.heldKeys].filter(e=>e.startsWith(`provider:`)).at(-1);if(a&&i.some(e=>K(e,a)<0))throw Error(`Materialization operation lease extension violates lock ordering`);for(let e of i)n.releases.push(await this.acquireKey(e)),n.heldKeys.add(e)}async runExclusive(e,t,n,r){let i=U(e);if(n){if(this.consumedAuthorizedRequestIds.has(n))throw Error(`Materialization operation authorization has already been consumed`);let e=this.authorizedRequests.get(n);if(e){this.authorizedRequests.delete(n),this.consumedAuthorizedRequestIds.add(n);let a=this.activeLeases.get(e.leaseId);if(!r?.local||!a||e.scopeKey!==q(i))throw Error(`Materialization operation authorization does not match this scope`);return t(a.lease)}}let a=await this.acquire(i);try{return await t(a)}finally{this.release(a)}}async runAuthorizedRequest(e,t,n){let r=this.requireActiveLease(e),i=U(t);if(!W(i).every(e=>r.heldKeys.has(e)))throw Error(`Materialization operation authorization requires a lease for the full scope`);let a=crypto.randomUUID();this.authorizedRequests.set(a,{leaseId:e.id,scopeKey:q(i)});try{return await n(a)}finally{this.authorizedRequests.delete(a),this.consumedAuthorizedRequestIds.delete(a)}}requireActiveLease(e){let t=this.activeLeases.get(e.id);if(!t||t.released||t.lease!==e)throw Error(`Materialization operation lease is no longer active`);return t}async acquireKey(e){let t=this.queues.get(e)??Promise.resolve(),n,r=new Promise(e=>{n=e}),i=t.then(()=>r);return this.queues.set(e,i),await t,()=>{n(),this.queues.get(e)===i&&this.queues.delete(e)}}async drain(){for(;this.pendingAcquisitions.size>0||this.activeLeases.size>0;)await Promise.allSettled([...this.pendingAcquisitions,...[...this.activeLeases.values()].map(e=>e.settled)])}};function U(e){if(!e.artifactId)throw Error(`Materialization operation scope requires an artifactId`);let t=[...new Map((e.providerObjects??[]).map(e=>[G(e),e])).values()].sort((e,t)=>K(G(e),G(t)));return t.length>0?{artifactId:e.artifactId,providerObjects:t}:{artifactId:e.artifactId}}function W(e){return[`artifact:${e.artifactId}`,...(e.providerObjects??[]).map(G)]}function G(e){if(!e.provider||!e.externalId)throw Error(`Materialization provider objects require provider and externalId`);return`provider:${JSON.stringify([e.provider,e.externalId])}`}function K(e,t){return e===t?0:e<t?-1:1}function q(e){return JSON.stringify(W(e))}const J=d(`surface-binding-registry`),Y=d(`artifact-view-builder-registry`),X=d(`artifact-view-service`),Z=d(`materialization-operation-coordinator`),Q={name:Z.name,displayName:`Materialization Operation Coordinator`,version:`0.1.0`,critical:!0,create:()=>new H},$={name:J.name,displayName:`Surface Binding Registry`,version:`0.1.0`,critical:!0,create:e=>new V(e.bus)},ee={name:Y.name,displayName:`Artifact View Builder Registry`,version:`0.1.0`,critical:!0,create:()=>new M},te={name:X.name,displayName:`Artifact View Service`,version:`0.1.0`,critical:!0,dependencies:[u(D.name),u(Y.name)],create:e=>{let t=e.getService(D),n=e.getService(Y);if(t===void 0)throw Error(`ArtifactSchemaRegistry is not available for ArtifactViewService`);if(n===void 0)throw Error(`ArtifactViewBuilderRegistry is not available for ArtifactViewService`);return new z(e.bus,t,n)}};export{O as _,ee as a,$ as c,z as d,N as f,D as g,M as h,J as i,H as l,j as m,X as n,te as o,R as p,Z as r,Q as s,Y as t,V as u,E as v};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./json-value-DM-EjTC1.mjs";import{c as n,r}from"./kind-registration-DggkrLkv.mjs";import{z as i}from"zod";const a=i.string().min(1).regex(/\S/),o=i.strictObject({refClass:i.literal(`artifact`),kind:a,id:a,revision:a}),s=i.string().min(1).regex(/\S/),c=i.strictObject({kind:i.literal(`whole-source`)}),l=i.strictObject({kind:i.literal(`lines`),startLine:i.number().int().positive(),lineCount:i.number().int().positive()}),u=i.strictObject({kind:i.literal(`data-path`),path:r}),d=i.strictObject({kind:i.literal(`git-file`),repository:s,path:s,commit:i.string().regex(/^(?:[0-9a-fA-F]{40}|[0-9a-fA-F]{64})$/)}),f=i.strictObject({kind:i.literal(`confluence-page`),site:s,pageId:s,version:i.number().int().positive()}),p=i.strictObject({kind:i.literal(`artifact`),reference:o}),m=i.union([i.strictObject({source:d,location:i.union([c,l]),excerpt:i.string().optional()}),i.strictObject({source:f,location:c,excerpt:i.string().optional()}),i.strictObject({source:p,location:i.union([c,u]),excerpt:i.string().optional()})]).meta({title:`EvidenceValue`,description:`An immutable, directly cited source and its source-specific location.`}),h=i.object({kind:i.string().min(1),id:i.string().min(1),displayName:i.string().optional()}),g=i.object({level:i.string().min(1),ids:i.record(i.string().min(1),i.string().min(1)).optional()}).superRefine((e,t)=>{e.level!==`global`&&(!e.ids||Object.keys(e.ids).length===0)&&t.addIssue({code:i.ZodIssueCode.custom,path:[`ids`],message:`ids is required when scope level is not 'global'`})}),_=i.object({level:i.string().min(1),ids:i.record(i.string().min(1),i.string().min(1)).optional()}),v=i.object({refClass:i.literal(`local`).default(`local`),artifact:o,localId:i.string().min(1)}),y=i.object({refClass:i.literal(`evidence`).default(`evidence`),kind:i.string().min(1),id:i.string().min(1),revision:i.string().min(1).optional(),locator:i.string().min(1).optional()}),b=i.strictObject({refClass:i.literal(`entity`),entityType:i.string().min(1),id:i.string().min(1)}),x=i.discriminatedUnion(`refClass`,[o,v,y,b]);function S(e){return!e||typeof e!=`object`||Array.isArray(e)||`refClass`in e?e:`artifact`in e&&`localId`in e?{...e,refClass:`local`}:`locator`in e||!(`revision`in e)?{...e,refClass:`evidence`}:{...e,refClass:`artifact`}}const C=i.preprocess(S,x),w=i.discriminatedUnion(`refClass`,[o.extend({revision:o.shape.revision.optional()}),v,y,b]);function T(e){return!e||typeof e!=`object`||Array.isArray(e)||`refClass`in e?e:`artifact`in e&&`localId`in e?{...e,refClass:`local`}:`locator`in e?{...e,refClass:`evidence`}:{...e,refClass:`artifact`}}const E=i.preprocess(T,w),D=i.object({type:i.string().min(1),target:C}),O=i.enum([`assumed`,`inferred`,`stated`,`confirmed`,`verified`]),k=i.object({kind:i.string().min(1),actor:h,timestamp:i.number().int().nonnegative(),detail:i.string().optional(),evidenceRef:C.optional()}),A=i.object({level:O,basis:i.array(k)}),j=i.object({id:i.string().min(1),kind:i.string().min(1),summary:i.string().min(1),detail:i.string().optional(),severity:i.enum([`info`,`warning`,`blocker`]).optional(),tags:i.array(i.string().min(1)).optional(),regarding:i.union([o,v]).optional(),evidence:i.union([o,y]).optional(),actor:h,timestamp:i.number().int().nonnegative()}),M=i.object({markdown:i.string().optional(),summary:i.string().optional(),plaintext:i.string().optional()}),N=i.object({kind:o.shape.kind,id:o.shape.id,revision:o.shape.revision,scope:g,schemaVersion:n,data:e,relations:i.array(D),evidence:i.array(m).optional(),confidence:A.optional(),representations:M.optional(),actor:h,timestamp:i.number().int().nonnegative(),createdAt:i.number().int().nonnegative().optional()}),P=i.object({type:i.string().min(1),symmetry:i.enum([`asymmetric`,`symmetric`]),implication:i.string().min(1).optional(),sourceKinds:i.array(i.string().min(1)).optional(),targetKinds:i.array(i.string().min(1)).optional(),targetRefClasses:i.array(i.enum([`artifact`,`local`,`evidence`])).optional()}),F=i.object({kind:i.string().min(1).optional(),scope:_.optional(),ids:i.array(i.string().min(1)).optional(),currentOnly:i.boolean().optional(),search:i.string().optional(),relation:i.object({type:i.string().min(1).optional(),target:E.optional()}).optional(),confidence:i.object({maxLevel:O.optional(),minLevel:O.optional()}).optional(),indexed:i.record(i.string(),t).optional(),limit:i.number().int().min(1).optional()}),I=i.object({base:o,target:o}),L=i.object({base:N,target:N,changedPaths:i.array(i.string())});export{y as _,F as a,m as b,D as c,N as d,g as f,b as g,A as h,j as i,C as l,O as m,I as n,_ as o,k as p,L as r,E as s,h as t,M as u,v,o as x,P as y};
|
|
@@ -73,8 +73,8 @@ declare const NativeSessionSupervisorNamespace: _$_makaio_core0.BusNamespaceDefi
|
|
|
73
73
|
pid: _$zod.ZodNullable<_$zod.ZodNumber>;
|
|
74
74
|
status: _$zod.ZodEnum<{
|
|
75
75
|
unknown: "unknown";
|
|
76
|
-
running: "running";
|
|
77
76
|
exited: "exited";
|
|
77
|
+
running: "running";
|
|
78
78
|
stopped: "stopped";
|
|
79
79
|
}>;
|
|
80
80
|
cwd: _$zod.ZodString;
|
|
@@ -161,8 +161,8 @@ declare const NativeSessionSupervisorSubjects: _$_makaio_core0.BusSubjects<_$_ma
|
|
|
161
161
|
pid: _$zod.ZodNullable<_$zod.ZodNumber>;
|
|
162
162
|
status: _$zod.ZodEnum<{
|
|
163
163
|
unknown: "unknown";
|
|
164
|
-
running: "running";
|
|
165
164
|
exited: "exited";
|
|
165
|
+
running: "running";
|
|
166
166
|
stopped: "stopped";
|
|
167
167
|
}>;
|
|
168
168
|
cwd: _$zod.ZodString;
|
|
@@ -186,8 +186,8 @@ declare const NativeSessionSupervisorSubjects: _$_makaio_core0.BusSubjects<_$_ma
|
|
|
186
186
|
*/
|
|
187
187
|
declare const SupervisorSessionStatusSchema: z.ZodEnum<{
|
|
188
188
|
unknown: "unknown";
|
|
189
|
-
running: "running";
|
|
190
189
|
exited: "exited";
|
|
190
|
+
running: "running";
|
|
191
191
|
stopped: "stopped";
|
|
192
192
|
}>;
|
|
193
193
|
type SupervisorSessionStatus = z.infer<typeof SupervisorSessionStatusSchema>;
|
|
@@ -275,8 +275,8 @@ declare const SupervisorRuntimeSnapshotSchema: z.ZodObject<{
|
|
|
275
275
|
pid: z.ZodNullable<z.ZodNumber>;
|
|
276
276
|
status: z.ZodEnum<{
|
|
277
277
|
unknown: "unknown";
|
|
278
|
-
running: "running";
|
|
279
278
|
exited: "exited";
|
|
279
|
+
running: "running";
|
|
280
280
|
stopped: "stopped";
|
|
281
281
|
}>;
|
|
282
282
|
cwd: z.ZodString;
|
|
@@ -316,8 +316,8 @@ declare const NativeSupervisorStatusSchema: {
|
|
|
316
316
|
pid: z.ZodNullable<z.ZodNumber>;
|
|
317
317
|
status: z.ZodEnum<{
|
|
318
318
|
unknown: "unknown";
|
|
319
|
-
running: "running";
|
|
320
319
|
exited: "exited";
|
|
320
|
+
running: "running";
|
|
321
321
|
stopped: "stopped";
|
|
322
322
|
}>;
|
|
323
323
|
cwd: z.ZodString;
|
|
@@ -395,8 +395,8 @@ declare const NativeSessionSupervisorSchemas: {
|
|
|
395
395
|
pid: z.ZodNullable<z.ZodNumber>;
|
|
396
396
|
status: z.ZodEnum<{
|
|
397
397
|
unknown: "unknown";
|
|
398
|
-
running: "running";
|
|
399
398
|
exited: "exited";
|
|
399
|
+
running: "running";
|
|
400
400
|
stopped: "stopped";
|
|
401
401
|
}>;
|
|
402
402
|
cwd: z.ZodString;
|
|
File without changes
|