@amalgm/live 0.2.81-main.46330316246 → 0.2.81-main.46383070700
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/drive/listing.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var v=Object.defineProperty;var c=(
|
|
1
|
+
var v=Object.defineProperty;var c=(i,a)=>v(i,"name",{value:a,configurable:!0});import{CONTAINERS as E}from"../entities/types.js";import{active as p,derivedNames as m,entryOf as w,gitEntry as S,rootOf as y,shows as k,unshown as b,where as x}from"./where.js";async function R(i,a){const r=c(n=>!b([...a,n]),"shown"),e=await x(i,a);switch(e.kind){case"shelf":{const n=await y(i,e.root);if(n===null)return{kind:"nowhere"};const s=n.shelf.names(e.address);if(s===null)return n.shelf.has(e.address)?{kind:"notdir"}:{kind:"nowhere"};const o=s.filter(r),l=new Set(s),f=(e.homes??[]).filter(t=>!l.has(t.name)&&r(t.name)),u={kind:"entries",root:e.root,address:e.address,shelf:o,entries:f,standing:[]};if(e.entity===null||!E.has(e.entity.type))return u;if(!await n.map.enter(e.entity.uuid))return{kind:"nowhere"};const h=m(p(n.map.children(e.entity.uuid))).filter(([t,d])=>k(t)!==null&&r(d)),N=h.filter(([t,d])=>!n.map.placed(t.uuid)&&!l.has(d)),O=h.filter(([t,d])=>n.map.placed(t.uuid)&&l.has(d)).map(([t,d])=>({name:d,uuid:t.uuid}));return{...u,entries:await g(i,N),standing:O}}case"listed":{if(e.entry.kind!=="directory")return{kind:"notdir"};const n=await y(i,e.root);if(n===null)return{kind:"nowhere"};if(!await n.map.enter(e.entry.uuid))return{kind:"nowhere"};const s=m(p(n.map.children(e.entry.uuid))).filter(([f,u])=>k(f)!==null&&r(u)),o=e.entry.type==="repo.git"?await S(n.map,e.entity):void 0;if(o===null)return{kind:"place-first",placing:e.placing};const l=[...await g(i,s),...o===void 0?[]:[o]];return{kind:"entries",root:e.root,address:e.address,shelf:[],entries:l,standing:[]}}case"door":return e.entry?.kind==="file"?{kind:"notdir"}:e.homes===void 0?{kind:"place-first",placing:e.placing}:{kind:"entries",root:e.root,address:e.address,shelf:[],entries:e.homes.filter(n=>r(n.name)),standing:[]};case"absent":return{kind:"nowhere"};default:return e}}c(R,"listing");async function g(i,a){const r=[];for(const[e,n]of a){const s=e.type==="reference"&&e.target!==null&&await i.top(e.target)!==null;r.push(s?w(e,n,"directory"):w(e,n))}return r}c(g,"entries");export{R as listing};
|
package/dist/drive/where.d.ts
CHANGED
|
@@ -60,7 +60,7 @@ export type Look = Extract<Where, {
|
|
|
60
60
|
});
|
|
61
61
|
export declare function glance(at: Where): Look | null;
|
|
62
62
|
export declare function rootOf(roots: RootsPort, uuid: string): Promise<Root | null>;
|
|
63
|
-
export declare function unshown(
|
|
63
|
+
export declare function unshown(path: readonly string[]): boolean;
|
|
64
64
|
export declare function addressOnly(roots: RootsPort, path: readonly string[], at: Where | Place): boolean;
|
|
65
65
|
export declare function childAt(map: MapPort, parentUUID: string, name: string): Promise<MapEntity | null>;
|
|
66
66
|
export declare function shows(entity: MapEntity): MapEntity | null;
|
package/dist/drive/where.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
`}
|
|
1
|
+
var D=Object.defineProperty;var o=(e,n)=>D(e,"name",{value:n,configurable:!0});import{LOCAL_DIR_NAME as F}from"@amalgm/core/identity";import{isRepositoryMetadataEntry as N,REPOSITORY_METADATA as y}from"../detection/classify.js";import{inGitDirectory as V}from"./homes.js";import{utf8Length as I}from"../entities/bytes.js";import{collisionBases as L,fileAbsent as P,materializedSlotNames as $}from"../entities/rules.js";import{CONTAINERS as R}from"../entities/types.js";import{FILES_FOLDER as j}from"../registration/home-layout.js";function B(e){return e.kind==="directory"||e.size!==null}o(B,"described");async function re(e,n){if(b(n))return{kind:"nowhere"};const t=[];let r=!1,i=e.home.uuid,s=e.home.shelf,l=e.home.map,u=l.root(),d=[],v=u.name,w=!1;const O=o(()=>w?!1:s.has(d)?!0:(w=!0,!1),"standing");for(let a=0;;a+=1){const E=a===n.length,h=o(f=>[...d,...n.slice(f)],"whole");let m=l.placed(u.uuid),g=O();if(u.type==="reference"&&u.target!==null&&m===g){const f=await e.top(u.target);f!==null&&(!m&&!r&&t.push(S(i,u,d)),i=f.uuid,s=f.shelf,l=null,u=f.entity,d=[],w=!1,m=f.placed,g=O())}if(m){if(E)return{kind:"shelf",root:i,address:d,entity:u};if(!g)return{kind:"shelf",root:i,address:h(a),entity:null}}else{if(g)return{kind:"shelf",root:i,address:h(a),entity:null};{const f=u.type==="repo.git";if((f||!r)&&t.push(S(i,u,d)),f&&(r=!0),E)return{kind:"listed",root:i,address:d,entity:u,entry:k(u,v),placing:t};if(!R.has(u.type))return{kind:"notdir"}}}if(l??=(await e.enter(i))?.map??null,l===null||!await l.enter(u.uuid))return{kind:"nowhere"};const p=n[a],A=await z(l,u.uuid,p);if(d=[...d,p],v=p,A===null){if(r&&u.type==="repo.git"&&N(p)){const f=await G(l,u);return a+1===n.length?{kind:"door",root:i,address:h(a+1),entry:f,placing:t}:f?.kind==="file"?{kind:"notdir"}:{kind:"door",root:i,address:h(a+1),entry:null,placing:t}}return t.length===0?(u.type==="repo.git"&&u.gitHome===null&&N(p)&&s.has(d)?await V(l,s,i,u,d,n.slice(a+1)):null)??{kind:"shelf",root:i,address:h(a+1),entity:null}:a+1===n.length?{kind:"absent",root:i,address:d,placing:t}:{kind:"nowhere"}}u=A}}o(re,"where");function ie(e){return e.kind!=="listed"&&e.kind!=="door"?e:e.entry!==null&&B(e.entry)?{...e,entry:e.entry}:null}o(ie,"glance");async function ue(e,n){return n===e.home.uuid?e.home:await e.enter(n)}o(ue,"rootOf");function S(e,n,t){return{root:e,uuid:n.uuid,type:n.type,address:t}}o(S,"unitOf");function b(e){return e.some(n=>n.toLowerCase()===F)}o(b,"unshown");function oe(e,n,t){return b(n)?!0:"root"in t?t.root===e.home.uuid?t.address[0]===j:t.address.length===0:!1}o(oe,"addressOnly");async function z(e,n,t){if(!await e.enter(n))return null;const r=c(e.holders(n,t));if(r.length===1)return C(r[0]);if(r.length===0&&!M(e,n,t))return null;for(const[i,s]of T(c(e.children(n))))if(s===t)return C(i);return null}o(z,"childAt");function C(e){return P(e)?null:e}o(C,"shows");async function le(e,n){const t=n.parentUUID;return t!==null&&await e.enter(t)&&H(e,t,n)}o(le,"aloneInSlot");function H(e,n,t){const r=c(e.holders(n,t.name));return r.length===1&&r[0]?.uuid===t.uuid&&!M(e,n,t.name)}o(H,"soleHolder");async function se(e,n,t,r){if(!await e.enter(n))return!1;const i=x(t),s=new Map(L(t).map(l=>[x(l),0]));for(const l of c(e.children(n))){if(l.uuid===r)continue;const u=x(l.name);if(u===i)return!1;const d=s.get(u);d!==void 0&&s.set(u,d+1)}return[...s.values()].every(l=>l<2)}o(se,"freeName");function x(e){return e.normalize("NFC").toLowerCase()}o(x,"folded");function M(e,n,t){return L(t).some(r=>c(e.holders(n,r)).length>1)}o(M,"derivable");async function de(e,n){let t=e.root();for(const r of n){if(t.type==="repo.git")return!1;const i=await z(e,t.uuid,r);if(i===null)return!1;t=i}return t.type!=="repo.git"}o(de,"outsideRepositories");function T(e){const n=$(e);return e.map(t=>[t,n.get(t.uuid)??t.name])}o(T,"derivedNames");function k(e,n,t=K(e.type)){const r=e.type==="link"?e.target:null;return{name:n,uuid:e.uuid,type:e.type,kind:t,mode:e.fileMode,mtime:e.mtime,size:r!==null?I(r):e.size,target:r,version:e.version,payloadVersion:e.payloadVersion}}o(k,"entryOf");async function G(e,n){if(n.gitHome===null)return k(n,y,"directory");const t=await q(e,n),r=_(e,n);if(r===null||t===null)return null;const i=I(Y(r,t));return{...k(n,y,"file"),size:i,payloadVersion:null}}o(G,"gitEntry");function Y(e,n){let t=0;for(;t<e.length&&t<n.length&&e[t]===n[t];)t+=1;return`gitdir: ${[...e.slice(t).map(()=>".."),...n.slice(t)].join("/")}
|
|
2
|
+
`}o(Y,"gitPointer");async function q(e,n){const t=[],r=new Set([n.uuid]);let i=n;for(;i.gitHome!==null;){const{entity:l,path:u}=i.gitHome;if(l===null||r.has(l))return null;r.add(l),t.push(u===""?[]:u.split("/"));const d=e.get(l)??(await e.enter(l)?e.get(l):void 0);if(d===void 0||d.type!=="repo.git"||d.status!=="active")return null;i=d}const s=_(e,i);return s===null?null:[...s,y,...t.reverse().flat()]}o(q,"gitDirectoryIn");function _(e,n){const t=e.root().uuid,r=[],i=new Set;for(let s=n;s.uuid!==t;){const l=s.parentUUID===null?void 0:e.get(s.parentUUID);if(l===void 0||i.has(s.uuid)||s.status!=="active")return null;i.add(s.uuid);const u=J(e,s);if(u===null)return null;r.push(u),s=l}return r.reverse()}o(_,"addressIn");function J(e,n){const t=n.parentUUID;if(H(e,t,n))return n.name;for(const[r,i]of T(c(e.children(t))))if(r.uuid===n.uuid)return i;return null}o(J,"shownName");function K(e){if(R.has(e))return"directory";if(e==="file.text"||e==="file.binary")return"file";if(e==="link"||e==="reference")return"link";throw new Error(`a ${e} cannot stand in a folder`)}o(K,"kindOf");function c(e){return e.filter(n=>n.status==="active")}o(c,"active");export{c as active,_ as addressIn,oe as addressOnly,le as aloneInSlot,z as childAt,T as derivedNames,B as described,k as entryOf,se as freeName,G as gitEntry,Y as gitPointer,ie as glance,K as kindOf,de as outsideRepositories,ue as rootOf,C as shows,b as unshown,re as where};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var k=Object.defineProperty;var f=(
|
|
1
|
+
"use strict";var k=Object.defineProperty;var f=(r,o)=>k(r,"name",{value:o,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.listing=O;const g=require("../entities/types.js"),t=require("./where.js");async function O(r,o){const s=f(n=>!(0,t.unshown)([...o,n]),"shown"),e=await(0,t.where)(r,o);switch(e.kind){case"shelf":{const n=await(0,t.rootOf)(r,e.root);if(n===null)return{kind:"nowhere"};const d=n.shelf.names(e.address);if(d===null)return n.shelf.has(e.address)?{kind:"notdir"}:{kind:"nowhere"};const l=d.filter(s),u=new Set(d),h=(e.homes??[]).filter(i=>!u.has(i.name)&&s(i.name)),c={kind:"entries",root:e.root,address:e.address,shelf:l,entries:h,standing:[]};if(e.entity===null||!g.CONTAINERS.has(e.entity.type))return c;if(!await n.map.enter(e.entity.uuid))return{kind:"nowhere"};const p=(0,t.derivedNames)((0,t.active)(n.map.children(e.entity.uuid))).filter(([i,a])=>(0,t.shows)(i)!==null&&s(a)),y=p.filter(([i,a])=>!n.map.placed(i.uuid)&&!u.has(a)),m=p.filter(([i,a])=>n.map.placed(i.uuid)&&u.has(a)).map(([i,a])=>({name:a,uuid:i.uuid}));return{...c,entries:await w(r,y),standing:m}}case"listed":{if(e.entry.kind!=="directory")return{kind:"notdir"};const n=await(0,t.rootOf)(r,e.root);if(n===null)return{kind:"nowhere"};if(!await n.map.enter(e.entry.uuid))return{kind:"nowhere"};const d=(0,t.derivedNames)((0,t.active)(n.map.children(e.entry.uuid))).filter(([h,c])=>(0,t.shows)(h)!==null&&s(c)),l=e.entry.type==="repo.git"?await(0,t.gitEntry)(n.map,e.entity):void 0;if(l===null)return{kind:"place-first",placing:e.placing};const u=[...await w(r,d),...l===void 0?[]:[l]];return{kind:"entries",root:e.root,address:e.address,shelf:[],entries:u,standing:[]}}case"door":return e.entry?.kind==="file"?{kind:"notdir"}:e.homes===void 0?{kind:"place-first",placing:e.placing}:{kind:"entries",root:e.root,address:e.address,shelf:[],entries:e.homes.filter(n=>s(n.name)),standing:[]};case"absent":return{kind:"nowhere"};default:return e}}f(O,"listing");async function w(r,o){const s=[];for(const[e,n]of o){const d=e.type==="reference"&&e.target!==null&&await r.top(e.target)!==null;s.push(d?(0,t.entryOf)(e,n,"directory"):(0,t.entryOf)(e,n))}return s}f(w,"entries");
|
package/dist-cjs/drive/where.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var x=Object.defineProperty;var l=(e,n)=>x(e,"name",{value:n,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.described=
|
|
2
|
-
`}l(
|
|
1
|
+
"use strict";var x=Object.defineProperty;var l=(e,n)=>x(e,"name",{value:n,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.described=L,exports.where=B,exports.glance=$,exports.rootOf=G,exports.unshown=O,exports.addressOnly=J,exports.childAt=v,exports.shows=A,exports.aloneInSlot=K,exports.freeName=Q,exports.outsideRepositories=U,exports.derivedNames=R,exports.entryOf=_,exports.gitEntry=P,exports.gitPointer=D,exports.addressIn=I,exports.kindOf=H,exports.active=c;const F=require("@amalgm/core/identity"),w=require("../detection/classify.js"),V=require("./homes.js"),M=require("../entities/bytes.js"),p=require("../entities/rules.js"),j=require("../entities/types.js"),Y=require("../registration/home-layout.js");function L(e){return e.kind==="directory"||e.size!==null}l(L,"described");async function B(e,n){if(O(n))return{kind:"nowhere"};const t=[];let r=!1,i=e.home.uuid,o=e.home.shelf,s=e.home.map,u=s.root(),d=[],N=u.name,k=!1;const S=l(()=>k?!1:o.has(d)?!0:(k=!0,!1),"standing");for(let a=0;;a+=1){const T=a===n.length,h=l(f=>[...d,...n.slice(f)],"whole");let y=s.placed(u.uuid),m=S();if(u.type==="reference"&&u.target!==null&&y===m){const f=await e.top(u.target);f!==null&&(!y&&!r&&t.push(q(i,u,d)),i=f.uuid,o=f.shelf,s=null,u=f.entity,d=[],k=!1,y=f.placed,m=S())}if(y){if(T)return{kind:"shelf",root:i,address:d,entity:u};if(!m)return{kind:"shelf",root:i,address:h(a),entity:null}}else{if(m)return{kind:"shelf",root:i,address:h(a),entity:null};{const f=u.type==="repo.git";if((f||!r)&&t.push(q(i,u,d)),f&&(r=!0),T)return{kind:"listed",root:i,address:d,entity:u,entry:_(u,N),placing:t};if(!j.CONTAINERS.has(u.type))return{kind:"notdir"}}}if(s??=(await e.enter(i))?.map??null,s===null||!await s.enter(u.uuid))return{kind:"nowhere"};const g=n[a],b=await v(s,u.uuid,g);if(d=[...d,g],N=g,b===null){if(r&&u.type==="repo.git"&&(0,w.isRepositoryMetadataEntry)(g)){const f=await P(s,u);return a+1===n.length?{kind:"door",root:i,address:h(a+1),entry:f,placing:t}:f?.kind==="file"?{kind:"notdir"}:{kind:"door",root:i,address:h(a+1),entry:null,placing:t}}return t.length===0?(u.type==="repo.git"&&u.gitHome===null&&(0,w.isRepositoryMetadataEntry)(g)&&o.has(d)?await(0,V.inGitDirectory)(s,o,i,u,d,n.slice(a+1)):null)??{kind:"shelf",root:i,address:h(a+1),entity:null}:a+1===n.length?{kind:"absent",root:i,address:d,placing:t}:{kind:"nowhere"}}u=b}}l(B,"where");function $(e){return e.kind!=="listed"&&e.kind!=="door"?e:e.entry!==null&&L(e.entry)?{...e,entry:e.entry}:null}l($,"glance");async function G(e,n){return n===e.home.uuid?e.home:await e.enter(n)}l(G,"rootOf");function q(e,n,t){return{root:e,uuid:n.uuid,type:n.type,address:t}}l(q,"unitOf");function O(e){return e.some(n=>n.toLowerCase()===F.LOCAL_DIR_NAME)}l(O,"unshown");function J(e,n,t){return O(n)?!0:"root"in t?t.root===e.home.uuid?t.address[0]===Y.FILES_FOLDER:t.address.length===0:!1}l(J,"addressOnly");async function v(e,n,t){if(!await e.enter(n))return null;const r=c(e.holders(n,t));if(r.length===1)return A(r[0]);if(r.length===0&&!C(e,n,t))return null;for(const[i,o]of R(c(e.children(n))))if(o===t)return A(i);return null}l(v,"childAt");function A(e){return(0,p.fileAbsent)(e)?null:e}l(A,"shows");async function K(e,n){const t=n.parentUUID;return t!==null&&await e.enter(t)&&z(e,t,n)}l(K,"aloneInSlot");function z(e,n,t){const r=c(e.holders(n,t.name));return r.length===1&&r[0]?.uuid===t.uuid&&!C(e,n,t.name)}l(z,"soleHolder");async function Q(e,n,t,r){if(!await e.enter(n))return!1;const i=E(t),o=new Map((0,p.collisionBases)(t).map(s=>[E(s),0]));for(const s of c(e.children(n))){if(s.uuid===r)continue;const u=E(s.name);if(u===i)return!1;const d=o.get(u);d!==void 0&&o.set(u,d+1)}return[...o.values()].every(s=>s<2)}l(Q,"freeName");function E(e){return e.normalize("NFC").toLowerCase()}l(E,"folded");function C(e,n,t){return(0,p.collisionBases)(t).some(r=>c(e.holders(n,r)).length>1)}l(C,"derivable");async function U(e,n){let t=e.root();for(const r of n){if(t.type==="repo.git")return!1;const i=await v(e,t.uuid,r);if(i===null)return!1;t=i}return t.type!=="repo.git"}l(U,"outsideRepositories");function R(e){const n=(0,p.materializedSlotNames)(e);return e.map(t=>[t,n.get(t.uuid)??t.name])}l(R,"derivedNames");function _(e,n,t=H(e.type)){const r=e.type==="link"?e.target:null;return{name:n,uuid:e.uuid,type:e.type,kind:t,mode:e.fileMode,mtime:e.mtime,size:r!==null?(0,M.utf8Length)(r):e.size,target:r,version:e.version,payloadVersion:e.payloadVersion}}l(_,"entryOf");async function P(e,n){if(n.gitHome===null)return _(n,w.REPOSITORY_METADATA,"directory");const t=await W(e,n),r=I(e,n);if(r===null||t===null)return null;const i=(0,M.utf8Length)(D(r,t));return{..._(n,w.REPOSITORY_METADATA,"file"),size:i,payloadVersion:null}}l(P,"gitEntry");function D(e,n){let t=0;for(;t<e.length&&t<n.length&&e[t]===n[t];)t+=1;return`gitdir: ${[...e.slice(t).map(()=>".."),...n.slice(t)].join("/")}
|
|
2
|
+
`}l(D,"gitPointer");async function W(e,n){const t=[],r=new Set([n.uuid]);let i=n;for(;i.gitHome!==null;){const{entity:s,path:u}=i.gitHome;if(s===null||r.has(s))return null;r.add(s),t.push(u===""?[]:u.split("/"));const d=e.get(s)??(await e.enter(s)?e.get(s):void 0);if(d===void 0||d.type!=="repo.git"||d.status!=="active")return null;i=d}const o=I(e,i);return o===null?null:[...o,w.REPOSITORY_METADATA,...t.reverse().flat()]}l(W,"gitDirectoryIn");function I(e,n){const t=e.root().uuid,r=[],i=new Set;for(let o=n;o.uuid!==t;){const s=o.parentUUID===null?void 0:e.get(o.parentUUID);if(s===void 0||i.has(o.uuid)||o.status!=="active")return null;i.add(o.uuid);const u=X(e,o);if(u===null)return null;r.push(u),o=s}return r.reverse()}l(I,"addressIn");function X(e,n){const t=n.parentUUID;if(z(e,t,n))return n.name;for(const[r,i]of R(c(e.children(t))))if(r.uuid===n.uuid)return i;return null}l(X,"shownName");function H(e){if(j.CONTAINERS.has(e))return"directory";if(e==="file.text"||e==="file.binary")return"file";if(e==="link"||e==="reference")return"link";throw new Error(`a ${e} cannot stand in a folder`)}l(H,"kindOf");function c(e){return e.filter(n=>n.status==="active")}l(c,"active");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amalgm/live",
|
|
3
|
-
"version": "0.2.81-main.
|
|
3
|
+
"version": "0.2.81-main.46383070700",
|
|
4
4
|
"description": "Portable realtime SDK for Amalgm — wire contracts, mutation discipline, and delivery state machines behind host-injected adapters.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist-cjs/index.js",
|
|
@@ -133,11 +133,11 @@
|
|
|
133
133
|
"dependencies": {
|
|
134
134
|
"@amalgm/core": "0.5.1-main.46329742514"
|
|
135
135
|
},
|
|
136
|
-
"gitHead": "
|
|
136
|
+
"gitHead": "e3d19f6f8d6e8b7fdaa5785ab76b53b8c55ca8cc",
|
|
137
137
|
"amalgmSource": {
|
|
138
138
|
"repository": "amalgm-inc/amalgm-live",
|
|
139
139
|
"branch": "main",
|
|
140
|
-
"commit": "
|
|
141
|
-
"occurrence": "
|
|
140
|
+
"commit": "e3d19f6f8d6e8b7fdaa5785ab76b53b8c55ca8cc",
|
|
141
|
+
"occurrence": "46383070700"
|
|
142
142
|
}
|
|
143
143
|
}
|