@ibgib/space-gib 0.0.2 → 0.0.4

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 (67) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/IMPLEMENTATION.md +9 -13
  3. package/dist/client/bootstrap.mjs +1 -1
  4. package/dist/client/bootstrap.mjs.map +1 -1
  5. package/dist/client/chunk-NCXKCVYS.mjs +42 -0
  6. package/dist/client/chunk-NCXKCVYS.mjs.map +7 -0
  7. package/dist/client/chunk-ZUEU37Z5.mjs +1920 -0
  8. package/dist/client/chunk-ZUEU37Z5.mjs.map +7 -0
  9. package/dist/client/index.html +108 -8
  10. package/dist/client/index.mjs +1 -1
  11. package/dist/client/script.mjs +1 -1
  12. package/dist/client/style.css +466 -61
  13. package/dist/respec-gib.node.mjs +5 -0
  14. package/dist/server/server.mjs +815 -316
  15. package/dist/server/server.mjs.map +4 -4
  16. package/package.json +6 -6
  17. package/src/client/AUTO-GENERATED-version.mts +1 -1
  18. package/src/client/api/space-gib-api-bridge.mts +35 -0
  19. package/src/client/components/identity-header/IMPLEMENTATION.md +45 -0
  20. package/src/client/components/identity-header/identity-header.css +74 -0
  21. package/src/client/components/identity-header/identity-header.html +10 -0
  22. package/src/client/components/identity-header/identity-header.mts +361 -0
  23. package/src/client/components/identity-manager/IMPLEMENTATION.md +100 -0
  24. package/src/client/components/identity-manager/identity-manager.css +467 -0
  25. package/src/client/components/identity-manager/identity-manager.html +113 -0
  26. package/src/client/components/identity-manager/identity-manager.mts +767 -0
  27. package/src/client/components/keystone-creator/keystone-creator.css +2 -76
  28. package/src/client/components/keystone-creator/keystone-creator.html +41 -26
  29. package/src/client/components/keystone-creator/keystone-creator.mts +178 -41
  30. package/src/client/dev-tools/base-tools.mts +252 -0
  31. package/src/client/dev-tools/common.mts +217 -0
  32. package/src/client/dev-tools/phase-1.mts +156 -0
  33. package/src/client/dev-tools/phase-2.mts +143 -0
  34. package/src/client/dev-tools/phase-3.mts +189 -0
  35. package/src/client/dev-tools/phase-4-1.mts +197 -0
  36. package/src/client/dev-tools/phase-4-10.mts +884 -0
  37. package/src/client/dev-tools/phase-4-2.mts +388 -0
  38. package/src/client/dev-tools/phase-4-3.mts +391 -0
  39. package/src/client/dev-tools/phase-4-4.mts +374 -0
  40. package/src/client/dev-tools/phase-4-5.mts +376 -0
  41. package/src/client/dev-tools/phase-4-6.mts +273 -0
  42. package/src/client/dev-tools/phase-4-7.mts +399 -0
  43. package/src/client/dev-tools/phase-4-8.mts +430 -0
  44. package/src/client/dev-tools/phase-4-9.mts +398 -0
  45. package/src/client/dev-tools/phase-4.mts +1302 -0
  46. package/src/client/dev-tools.mts +55 -1096
  47. package/src/client/index.html +108 -8
  48. package/src/client/style.css +466 -61
  49. package/src/client/ui/shell/space-gib-shell-constants.mts +0 -2
  50. package/src/client/ui/shell/space-gib-shell-service.mts +82 -10
  51. package/src/common/common-constants.mts +0 -0
  52. package/src/common/keystone-policies.json +40 -43
  53. package/src/common/keystone-policies.mts +4 -6
  54. package/src/server/path-helper.respec.mts +99 -94
  55. package/src/server/serve-gib/README.md +9 -0
  56. package/src/server/serve-gib/handlers/api/keystone/keystone-evolve.handler.mts +1 -1
  57. package/src/server/serve-gib/handlers/api/keystone/keystone-genesis.handler.mts +1 -1
  58. package/src/server/serve-gib/handlers/api/keystone/keystone-get.respec.mts +4 -4
  59. package/src/server/serve-gib/handlers/api/keystone/keystone-post.handler.mts +1 -1
  60. package/src/server/serve-gib/handlers/ws/sync-upgrade-handler-base.mts +37 -5
  61. package/src/server/serve-gib/handlers/ws/ws-helper.mts +73 -45
  62. package/dist/client/chunk-BL2SGXS4.mjs +0 -18994
  63. package/dist/client/chunk-RDTAT5G4.mjs +0 -235
  64. package/dist/client/chunk-RDTAT5G4.mjs.map +0 -7
  65. package/dist/client/chunk-RE7XSMHH.mjs +0 -31
  66. package/dist/client/chunk-RE7XSMHH.mjs.map +0 -7
  67. package/dist/client/chunk-YUSGN3J4.mjs +0 -23119
package/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ _note: as you implement features/fixes/etc., please document them here under the
4
4
 
5
5
  ## Working Version
6
6
 
7
+ ## 0.0.4
8
+ * identity manager, identity header, keystone creator components implemented with basic functionality
9
+
10
+ ## 0.0.3
7
11
  * feat: serve-gib microframework and core architecture
8
12
  * established dual-target architecture for browser SPA client and Node.js server.
9
13
  * implemented the `serve-gib` microframework with pipeline-based orchestration and async handlers.
package/IMPLEMENTATION.md CHANGED
@@ -23,15 +23,11 @@ written under that scope.
23
23
  create a child. Child has `parentTjpGib` in its `data` (soft-link, not rel8n).
24
24
  Operating within child scope does NOT require parent secrets.
25
25
 
26
- ### Manifest Ibgib Pattern
27
- Content is NOT added to a scope directly. The flow is:
28
- 1. Create content ibgib(s) + their DNA/dependency graph (existing ibgib machinery)
29
- 2. **Server creates a manifest ibgib** listing the dependency graph addresses
30
- 3. Context keystone is evolved with `claim.target = manifestIbGibAddr`
31
- 4. Only then are the content ibgibs stored in the space
32
-
33
- The keystone chain is therefore an audit log of manifest addresses — each frame
34
- authorizes exactly one set of content additions.
26
+ ### Sync Saga & Identity Delegation (Dynamic Manifest)
27
+ Content ibgibs are synchronized via the Sync Saga protocol. The workflow is:
28
+ 1. **Sync Saga as Dynamic Manifest**: The Sync Saga timeline itself acts as the dynamic manifest of ibgibs transferred (requested/sent). The entire saga graph is traversed to resolve the full set of synced content.
29
+ 2. **Domain Identity Delegation**: The long-lived Domain Identity (Domain Keystone) is evolved exactly once per sync saga to delegate signing authority to an ephemeral Session Identity (Session Keystone).
30
+ 3. **Session Identity Binding**: The Session Identity genesis frame is cryptographically bound to specific target domain addresses. It is then used to sign all outgoing context frames and payload transfers during the sync process.
35
31
 
36
32
  ### Address Conventions
37
33
  - Full ibgib address `ib^gib` is used everywhere (NOT just `tjpGib`)
@@ -78,10 +74,10 @@ To manage identity metadata without bloating every frame or requiring external i
78
74
 
79
75
  ### Sync Sagas: Temp & Durable Spaces
80
76
  The synchronization engine (Sync Saga) handles multi-device consistency using a "Commit Phase":
81
- - **Temp Space**: Content is initially uploaded/created in an ephemeral `TempSpace`. This allows for long-running transfers without locking the primary domain.
82
- - **Durable Space**: The "real" persistent storage.
83
- - **Atomic Commit**: Once the content manifest is validated and stored in `TempSpace`, the system should lock the keystone context, evolves the keystone, and performs a straight-forward copy from `Temp` to `Durable`. Current implementation does not support identity correctly, only fully passes tests with some concrete implementations without identity.
84
- * todo: incorporate sync engine with space-gib.
77
+ - **Temp Space**: Content is initially accumulated in an ephemeral `TempSpace`. This allows for long-running transfers without locking the primary domain or risking data corruption on failure.
78
+ - **Durable Space**: The persistent storage space where data is ultimately committed.
79
+ - **Atomic Commit**: Once the content is validated and stored in `TempSpace`, the coordinator executes the commit. Upon successful commit, the verified ibgibs are copied/moved from `TempSpace` to `Durable` space. This transactional boundary is fully integrated with Keystone identity checks, ensuring only authenticated and authorized sync sessions can commit data.
80
+ - _NOTE: Once authenticated per communication leg, the sync saga control (non-domain, meta) ibgibs are immediately stored in durable space for the audit trail as it happens. Only the domain ibgibs are moved in the commit phase._
85
81
 
86
82
  ### Near-Term Goal: Self-Contained Multitenancy
87
83
  Our immediate priority is establishing the V1 multitenant foundation:
@@ -1,4 +1,4 @@
1
- import{a as vr,b as Rr,c as na,d as Ve,e as Ur,f as kr,g as $t,h as Fr,i as jr,j as Pe,k as Ye,l as zr,m as qr,n as Hr,o as Xr,p as Wr}from"./chunk-RDTAT5G4.mjs";import{$ as Ya,$a as Ar,$b as Te,A as J,Aa as fr,B as q,Ba as Se,C as H,Ca as Qt,Da as br,Db as fe,Ea as hr,F as X,Fa as pr,Fb as oa,G as ot,Ga as ur,Gb as Cr,Ha as mr,Hb as gt,Ia as ft,Ib as xr,J as ce,Ja as bt,Jb as Lr,K as Ht,Ka as gr,Kb as Dr,L as Me,La as wr,M as ve,Ma as je,N as Re,Na as ze,Nb as Or,O as Ue,Oa as Kt,P as it,Pa as ht,Q as $e,Qa as Er,R as Xa,Ra as yr,S as Wa,Sa as pt,Sb as wt,T as Xt,U as Be,Ua as qe,Ub as Mr,V as Ie,Va as He,W as Va,Wa as $r,Wb as Et,X as Ja,Xa as Ir,Xb as ia,Ya as Zt,Z as _e,Za as _r,Zb as We,_ as ke,_a as ea,_b as sa,a as b,aa as Ae,ab as de,ac as yt,b as Ut,ba as Qa,bc as Br,ca as Ka,cb as Sr,d as O,da as Wt,db as Gr,dc as Je,e as re,ea as Vt,f as Bt,fa as Za,fb as ut,g as M,ga as er,gb as T,h as $,ha as tr,hb as ta,i as ne,ia as ar,j as m,ja as nt,k as Ha,ka as st,l as rt,la as le,m as kt,ma as rr,n as Ft,na as or,nb as Ge,o as jt,oa as ir,ob as Tr,pa as nr,q as se,qa as ct,r as Ee,ra as Jt,s as zt,sa as sr,sb as Pr,t as ye,ta as cr,tb as W,ua as lr,v as y,va as lt,vb as aa,w as C,wa as Fe,wb as mt,xa as dr,xb as Xe,y as qt,ya as dt,yb as Nr,za as Yt,zb as ra}from"./chunk-RE7XSMHH.mjs";var Vr={src:["source","from","in","input"],dest:["destination","to","out","output"]};function Ho({paramName:c,noBare:e,argTypeName:a,description:t}){let r={name:`src-${c}`,argTypeName:a??"string",synonyms:[...Vr.src.map(o=>`${o}-${c}`)],description:t};return e||r.synonyms.push(c),r}b(Ho,"getParam_src");function Xo({paramName:c,argTypeName:e="string",description:a}){return{name:`dest-${c}`,argTypeName:e??"string",synonyms:[...Vr.dest.map(r=>`${r}-${c}`)],description:a}}b(Xo,"getParam_dest");var Jr={name:"bare",description:`special param that is used as the only param allowed that doesn't have a "double-dash-specifier=" form. one "bare" arg is allowed atow. if a bare arg is found, it will be mapped to this param info.`,synonyms:["bare-arg","bare-param","no-name","manco","arg-with-no-name","param-with-no-name"],argTypeName:"string"};var Hi=Ho({paramName:"path",description:"for referencing/ingesting file(s)/folder(s) in a fs"}),Xi=Xo({paramName:"path",description:"for indicating where to put generated file(s)/folder(s)"});var Y=!1;function It({paramInfo:c,valueString:e}){let a=`[${It.name}]`;try{switch(c.argTypeName){case"string":let t=e;return(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))&&(t=t.slice(1),t=t.slice(0,t.length-1)),t;case"integer":if(e===void 0)throw new Error("integer arg value is undefined. integers must be a valid integer string (E: ce17acde3b863ec5e2fdcc594f0f1423)");let r=Number.parseInt(e);if(typeof r!="number")throw new Error(`arg value string (${e})did not parse to an integer. parse result: ${r} (E: 43cde93160458610ffb49fd16a02d123)`);return r;case"boolean":if(e===void 0||e===""){if(!c.isFlag)throw new Error("valueString is undefined or empty string but paramInfo.argTypeName === 'boolean' and paramInfo.isFlag is falsy. (E: 482e595c0ec7344b04def76c1441d623)");return!0}else{if(e===null)throw new Error("(UNEXPECTED) valueString === null? (E: 78f548b93026407968356d9c4f106223)");if(!["true","false"].includes(e))throw new Error(`invalid boolean valueString ("${e}"). must be either "true" or "false" (E: ba7a0d0804131acc2bd9ab37c0382523)`);return e==="true"}default:throw new Error("(UNEXPECTED) invalid paramInfo.argTypeName (E: c8b03ccb71394d22a29858b98753a123)")}}catch(t){throw console.error(`${a} ${m(t)}`),t}}b(It,"getValueFromRawString");function _t({argIdentifier:c,paramInfos:e,throwIfNotFound:a}){let t=`[${_t.name}]`;try{let r=e.filter(o=>o.name===c||(o.synonyms??[]).includes(c));if(r.length===1)return O(r[0]);if(r.length>1)throw new Error(`(UNEXPECTED) multiple param infos found with argIdentifier. do you have overlapping arg names/synonyms? (${c} found in (${r.length} param infos)) (E: d599a6647c5ead6d9fbac4e4c96e6d23)`);if(a)throw new Error(`(UNEXPECTED) param info not found for argIdentifier (${c}) (E: 47e704068f2eb5a0551cf45d0e72c823)`);return}catch(r){throw console.error(`${t} ${m(r)}`),r}}b(_t,"getParamInfo");function Yr({rawArg:c}){let e=`[${Yr.name}]`;try{Y&&console.log(`${e} starting... (I: 5d51b75b7a025e2e3fa498da7c08ac24)`);let a=b(o=>o.startsWith('"')&&o.endsWith('"')?"double":o.startsWith("'")&&o.endsWith("'")?"single":void 0,"fnGetQuoteType"),t=b(o=>a(o)?o.slice(0,o.length-1).slice(1):o,"fnStripQuotes"),r=a(c);if(r)return{prefix:void 0,identifier:void 0,isNameValuePair:!1,valueInfo:{rawValueString:c.concat(),resolvedValueString:t(c),singleQuoted:r==="single",doubleQuoted:r==="double"}};if(c.match(/^(--\w|-\w|:\w)/))if(c.includes("=")){let o=/^(--|-|:)([\w\-]+)=(['"]?.+['"]?)$/,i=c.match(o);if(!i)throw new Error(`invalid rawArg (${c}). expected an arg matching regexp ${o}. (E: 05ca56163e184faeb66456a0e9190b28)`);let[n,s,l,d]=i,f=a(d);return{prefix:s,identifier:l,isNameValuePair:!0,valueInfo:{rawValueString:d,resolvedValueString:f?t(d):d,singleQuoted:f==="single",doubleQuoted:f==="double"}}}else{let o=/^(--|-|:)([\w\-]+)$/,i=c.match(o);if(!i)throw new Error(`invalid rawArg (${c}). expected an arg matching regexp ${o}. at this point, it should have a prefix (e.g. "--"), and a single identifier (should be a flag since there is no equal sign). (E: 93305923465d9449bdce3f81373fae24)`);let[n,s,l]=i;return{prefix:s,identifier:l,isNameValuePair:!1,valueInfo:{rawValueString:void 0,resolvedValueString:"true",singleQuoted:!1,doubleQuoted:!1}}}else{if(c.includes("="))throw new Error(`invalid rawArg (${c}). isn't quoted, doesn't start with prefix, but it does have an equal sign? that's bad. (E: e8ad15211ce6fd56a4a214c2778c4724)`);return{prefix:void 0,identifier:void 0,isNameValuePair:!1,valueInfo:{rawValueString:c,resolvedValueString:c,doubleQuoted:!1,singleQuoted:!1}}}}catch(a){throw console.error(`${e} ${a.message}`),a}finally{Y&&console.log(`${e} complete.`)}}b(Yr,"parseRawArg");function At({args:c,paramInfos:e,bareArgParamInfo:a=O(Jr),logalot:t}){let r=`[${At.name}]`;try{(Y||t)&&console.log(`${r} starting... (I: f389aaa490796dfd823bc7b9d4e58b23)`);let o=!1;return c.map((n,s)=>{let l,d,f,{prefix:h,identifier:u,isNameValuePair:g,valueInfo:E}=Yr({rawArg:n});if(h){if((Y||t)&&console.log(`identifier: ${u} (I: 519ce129a1e34753a9070d3a205c9a8b)`),!u)throw new Error("(UNEXPECTED) prefix truthy but identifier falsy? (E: f33ab3a2b623acc0d1bc36685edfaf24)");if(l=u,!E)throw new Error("(UNEXPECTED) !valueInfo? (E: 05249a361a59008cd313d2dfa8f08b24)");if(g){Y&&console.log(`${r} identifier with equals: ${u}. (I: 5f8ae91d1ddd4a7f94c0f4fb7e688502)`);let w=_t({argIdentifier:l,paramInfos:e,throwIfNotFound:!0});f={...w,value:It({paramInfo:w,valueString:E.rawValueString}),identifier:l}}else{Y&&console.log(`${r} identifier without equals: ${u}`),l=u;let w=_t({argIdentifier:l,paramInfos:e,throwIfNotFound:!0});f={...w,value:It({paramInfo:w,valueString:void 0}),identifier:l,isFlag:!0}}}else if(s===0){if(!E)throw new Error("(UNEXPECTED) argIndex === 0 but valueInfo falsy? (E: 4642b42c855593b7ffdacb85f27dab24)");if(!E.rawValueString)throw new Error("(UNEXPECTED) !valueInfo.rawValueString? (E: 0b35f71eb8227cdd67ccfc32f2e45824)");if(E.singleQuoted)throw new Error("first arg is quoted? (single). a bare arg in first position must be a command/flag. (E: 28cce820417fd3b4f95ba6c7e94b4624)");if(E.doubleQuoted)throw new Error("first arg is quoted? (double). a bare arg in first position must be a command/flag. (E: 0b948c87081043fdb168f08ba05ebbce)");l=E.rawValueString,f={..._t({argIdentifier:l,paramInfos:e,throwIfNotFound:!0}),value:!0,identifier:l,isFlag:!0}}else{if((Y||t)&&console.log("bare arg found. (I: d6f67074c7e44a63864948d4bf04bee8)"),!a)throw new Error(`bare arg found (one without prefix like "--" or ":") but there is no param info expected for bare args. You must provide which param info a bare arg maps to in this ${At.name} call. (E: 650dd3695d62f0f87dd0cbafbf068c23)`);if(o)throw new Error('You can have the first arg - a special arg like a command - be bare (without prefix like "--" or ":") and one additional non-positional arg be bare. But more than one non-positional bare arg found. Also remember if the arg has spaces then you have to enclose it with single or double quotes. (E: 74dea8f13f0c14e3b7a2f125c7faca23)');o=!0;let w=O(a);f={...w,isBare:!0,identifier:w.name,value:It({paramInfo:w,valueString:n})}}return Y&&console.log(`${r} argInfo: ${$(f)}`),f})}catch(o){throw console.error(`${r} ${m(o)}`),o}finally{(Y||t)&&console.log(`${r} complete.`)}}b(At,"buildArgInfos");var z={undefined:"undefined",preparing:"preparing",started:"started",inserted:"inserted",updated:"updated",merged_dna:"merged_dna",merged_state:"merged_state",already_synced:"already_synced",completed:"completed"},Wo={...rr},rn={...Wo,sync:"sync"};var ca={encrypt_gib:"encrypt-gib"},nn=Object.values(ca);var Vo={characters:"characters",spell_out:"spell-out",cardinal:"cardinal",number:"number",ordinal:"ordinal",digits:"digits",fraction:"fraction",unit:"unit",date:"date",time:"time",telephone:"telephone",address:"address",interjection:"interjection",expletive:"expletive"};var be=class c{static{b(this,"Ssml")}static lc=`[${c.name}]`;static wrapSsmlSpeak(e,a=!0){return"<speak>"+e.reduce((r,o)=>a?r+"<p>"+o+"</p>":r+o,"")+"</speak>"}static unwrapSsmlSpeak(e){return e.replace(/\<speak\>/g,"").replace(/\<\/speak\>/g,"")}static p(e){return"<p>"+e+"</p>"}static s(e){return"<s>"+e+"</s>"}static stripSsml(e){return e.replace(/\<\/p\>[ ]*\<p\>/g,"<p>").replace(/\<p\>(?=[ ])/g,"<p>").replace(/\<\/p\>(?=[ ])/g,"</p>").replace(/\<[\/]*p\>/g,`
1
+ import{a as vr,b as Rr,c as na,d as Ve,e as Ur,f as kr,g as $t,h as Fr,i as jr,j as Pe,k as Ye,l as zr,m as qr,n as Hr,o as Xr,p as Wr}from"./chunk-ZUEU37Z5.mjs";import{$ as Ae,$a as de,A as q,Aa as Se,Ab as aa,B as H,Ba as Qt,Bb as mt,Ca as br,Cb as Xe,Da as hr,Db as Nr,E as X,Ea as pr,Eb as ra,F as ot,Fa as ur,Ga as mr,Ha as ft,I as ce,Ia as bt,Ib as fe,J as Ht,Ja as gr,K as Me,Ka as wr,Kb as oa,L as ve,La as je,Lb as Cr,M as Re,Ma as ze,Mb as gt,N as Ue,Na as Kt,Nb as xr,O as it,Oa as ht,Ob as Lr,P as $e,Pa as Er,Pb as Dr,Q as Xa,Qa as yr,R as Wa,Ra as pt,S as Xt,Sb as Or,T as Be,Ta as qe,U as Ie,Ua as He,V as Va,Va as $r,W as Ja,Wa as Ir,Xa as Zt,Xb as wt,Y as _e,Ya as _r,Z as ke,Za as ea,_ as Ya,_a as Ar,_b as Mr,a as b,aa as Qa,ac as Et,b as Ut,ba as Ka,bb as Sr,bc as ia,c as O,ca as Wt,cb as Gr,d as re,da as Vt,dc as We,e as Bt,ea as Za,eb as ut,ec as sa,f as M,fa as er,fb as T,fc as Te,g as $,ga as tr,gb as ta,gc as yt,h as ne,ha as ar,hc as Br,i as m,ia as nt,j as Ha,ja as st,jc as Je,k as rt,ka as le,l as kt,la as rr,m as Ft,ma as or,mb as Ge,n as jt,na as ir,nb as Tr,oa as nr,p as se,pa as ct,q as Ee,qa as Jt,r as zt,ra as sr,s as ye,sa as cr,ta as lr,u as y,ua as lt,v as C,va as Fe,wa as dr,x as qt,xa as dt,xb as Pr,ya as Yt,yb as W,z as J,za as fr}from"./chunk-NCXKCVYS.mjs";var Vr={src:["source","from","in","input"],dest:["destination","to","out","output"]};function Ho({paramName:c,noBare:e,argTypeName:a,description:t}){let r={name:`src-${c}`,argTypeName:a??"string",synonyms:[...Vr.src.map(o=>`${o}-${c}`)],description:t};return e||r.synonyms.push(c),r}b(Ho,"getParam_src");function Xo({paramName:c,argTypeName:e="string",description:a}){return{name:`dest-${c}`,argTypeName:e??"string",synonyms:[...Vr.dest.map(r=>`${r}-${c}`)],description:a}}b(Xo,"getParam_dest");var Jr={name:"bare",description:`special param that is used as the only param allowed that doesn't have a "double-dash-specifier=" form. one "bare" arg is allowed atow. if a bare arg is found, it will be mapped to this param info.`,synonyms:["bare-arg","bare-param","no-name","manco","arg-with-no-name","param-with-no-name"],argTypeName:"string"};var Hi=Ho({paramName:"path",description:"for referencing/ingesting file(s)/folder(s) in a fs"}),Xi=Xo({paramName:"path",description:"for indicating where to put generated file(s)/folder(s)"});var Y=!1;function It({paramInfo:c,valueString:e}){let a=`[${It.name}]`;try{switch(c.argTypeName){case"string":let t=e;return(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))&&(t=t.slice(1),t=t.slice(0,t.length-1)),t;case"integer":if(e===void 0)throw new Error("integer arg value is undefined. integers must be a valid integer string (E: ce17acde3b863ec5e2fdcc594f0f1423)");let r=Number.parseInt(e);if(typeof r!="number")throw new Error(`arg value string (${e})did not parse to an integer. parse result: ${r} (E: 43cde93160458610ffb49fd16a02d123)`);return r;case"boolean":if(e===void 0||e===""){if(!c.isFlag)throw new Error("valueString is undefined or empty string but paramInfo.argTypeName === 'boolean' and paramInfo.isFlag is falsy. (E: 482e595c0ec7344b04def76c1441d623)");return!0}else{if(e===null)throw new Error("(UNEXPECTED) valueString === null? (E: 78f548b93026407968356d9c4f106223)");if(!["true","false"].includes(e))throw new Error(`invalid boolean valueString ("${e}"). must be either "true" or "false" (E: ba7a0d0804131acc2bd9ab37c0382523)`);return e==="true"}default:throw new Error("(UNEXPECTED) invalid paramInfo.argTypeName (E: c8b03ccb71394d22a29858b98753a123)")}}catch(t){throw console.error(`${a} ${m(t)}`),t}}b(It,"getValueFromRawString");function _t({argIdentifier:c,paramInfos:e,throwIfNotFound:a}){let t=`[${_t.name}]`;try{let r=e.filter(o=>o.name===c||(o.synonyms??[]).includes(c));if(r.length===1)return O(r[0]);if(r.length>1)throw new Error(`(UNEXPECTED) multiple param infos found with argIdentifier. do you have overlapping arg names/synonyms? (${c} found in (${r.length} param infos)) (E: d599a6647c5ead6d9fbac4e4c96e6d23)`);if(a)throw new Error(`(UNEXPECTED) param info not found for argIdentifier (${c}) (E: 47e704068f2eb5a0551cf45d0e72c823)`);return}catch(r){throw console.error(`${t} ${m(r)}`),r}}b(_t,"getParamInfo");function Yr({rawArg:c}){let e=`[${Yr.name}]`;try{Y&&console.log(`${e} starting... (I: 5d51b75b7a025e2e3fa498da7c08ac24)`);let a=b(o=>o.startsWith('"')&&o.endsWith('"')?"double":o.startsWith("'")&&o.endsWith("'")?"single":void 0,"fnGetQuoteType"),t=b(o=>a(o)?o.slice(0,o.length-1).slice(1):o,"fnStripQuotes"),r=a(c);if(r)return{prefix:void 0,identifier:void 0,isNameValuePair:!1,valueInfo:{rawValueString:c.concat(),resolvedValueString:t(c),singleQuoted:r==="single",doubleQuoted:r==="double"}};if(c.match(/^(--\w|-\w|:\w)/))if(c.includes("=")){let o=/^(--|-|:)([\w\-]+)=(['"]?.+['"]?)$/,i=c.match(o);if(!i)throw new Error(`invalid rawArg (${c}). expected an arg matching regexp ${o}. (E: 05ca56163e184faeb66456a0e9190b28)`);let[n,s,l,d]=i,f=a(d);return{prefix:s,identifier:l,isNameValuePair:!0,valueInfo:{rawValueString:d,resolvedValueString:f?t(d):d,singleQuoted:f==="single",doubleQuoted:f==="double"}}}else{let o=/^(--|-|:)([\w\-]+)$/,i=c.match(o);if(!i)throw new Error(`invalid rawArg (${c}). expected an arg matching regexp ${o}. at this point, it should have a prefix (e.g. "--"), and a single identifier (should be a flag since there is no equal sign). (E: 93305923465d9449bdce3f81373fae24)`);let[n,s,l]=i;return{prefix:s,identifier:l,isNameValuePair:!1,valueInfo:{rawValueString:void 0,resolvedValueString:"true",singleQuoted:!1,doubleQuoted:!1}}}else{if(c.includes("="))throw new Error(`invalid rawArg (${c}). isn't quoted, doesn't start with prefix, but it does have an equal sign? that's bad. (E: e8ad15211ce6fd56a4a214c2778c4724)`);return{prefix:void 0,identifier:void 0,isNameValuePair:!1,valueInfo:{rawValueString:c,resolvedValueString:c,doubleQuoted:!1,singleQuoted:!1}}}}catch(a){throw console.error(`${e} ${a.message}`),a}finally{Y&&console.log(`${e} complete.`)}}b(Yr,"parseRawArg");function At({args:c,paramInfos:e,bareArgParamInfo:a=O(Jr),logalot:t}){let r=`[${At.name}]`;try{(Y||t)&&console.log(`${r} starting... (I: f389aaa490796dfd823bc7b9d4e58b23)`);let o=!1;return c.map((n,s)=>{let l,d,f,{prefix:h,identifier:u,isNameValuePair:g,valueInfo:E}=Yr({rawArg:n});if(h){if((Y||t)&&console.log(`identifier: ${u} (I: 519ce129a1e34753a9070d3a205c9a8b)`),!u)throw new Error("(UNEXPECTED) prefix truthy but identifier falsy? (E: f33ab3a2b623acc0d1bc36685edfaf24)");if(l=u,!E)throw new Error("(UNEXPECTED) !valueInfo? (E: 05249a361a59008cd313d2dfa8f08b24)");if(g){Y&&console.log(`${r} identifier with equals: ${u}. (I: 5f8ae91d1ddd4a7f94c0f4fb7e688502)`);let w=_t({argIdentifier:l,paramInfos:e,throwIfNotFound:!0});f={...w,value:It({paramInfo:w,valueString:E.rawValueString}),identifier:l}}else{Y&&console.log(`${r} identifier without equals: ${u}`),l=u;let w=_t({argIdentifier:l,paramInfos:e,throwIfNotFound:!0});f={...w,value:It({paramInfo:w,valueString:void 0}),identifier:l,isFlag:!0}}}else if(s===0){if(!E)throw new Error("(UNEXPECTED) argIndex === 0 but valueInfo falsy? (E: 4642b42c855593b7ffdacb85f27dab24)");if(!E.rawValueString)throw new Error("(UNEXPECTED) !valueInfo.rawValueString? (E: 0b35f71eb8227cdd67ccfc32f2e45824)");if(E.singleQuoted)throw new Error("first arg is quoted? (single). a bare arg in first position must be a command/flag. (E: 28cce820417fd3b4f95ba6c7e94b4624)");if(E.doubleQuoted)throw new Error("first arg is quoted? (double). a bare arg in first position must be a command/flag. (E: 0b948c87081043fdb168f08ba05ebbce)");l=E.rawValueString,f={..._t({argIdentifier:l,paramInfos:e,throwIfNotFound:!0}),value:!0,identifier:l,isFlag:!0}}else{if((Y||t)&&console.log("bare arg found. (I: d6f67074c7e44a63864948d4bf04bee8)"),!a)throw new Error(`bare arg found (one without prefix like "--" or ":") but there is no param info expected for bare args. You must provide which param info a bare arg maps to in this ${At.name} call. (E: 650dd3695d62f0f87dd0cbafbf068c23)`);if(o)throw new Error('You can have the first arg - a special arg like a command - be bare (without prefix like "--" or ":") and one additional non-positional arg be bare. But more than one non-positional bare arg found. Also remember if the arg has spaces then you have to enclose it with single or double quotes. (E: 74dea8f13f0c14e3b7a2f125c7faca23)');o=!0;let w=O(a);f={...w,isBare:!0,identifier:w.name,value:It({paramInfo:w,valueString:n})}}return Y&&console.log(`${r} argInfo: ${$(f)}`),f})}catch(o){throw console.error(`${r} ${m(o)}`),o}finally{(Y||t)&&console.log(`${r} complete.`)}}b(At,"buildArgInfos");var z={undefined:"undefined",preparing:"preparing",started:"started",inserted:"inserted",updated:"updated",merged_dna:"merged_dna",merged_state:"merged_state",already_synced:"already_synced",completed:"completed"},Wo={...rr},rn={...Wo,sync:"sync"};var ca={encrypt_gib:"encrypt-gib"},nn=Object.values(ca);var Vo={characters:"characters",spell_out:"spell-out",cardinal:"cardinal",number:"number",ordinal:"ordinal",digits:"digits",fraction:"fraction",unit:"unit",date:"date",time:"time",telephone:"telephone",address:"address",interjection:"interjection",expletive:"expletive"};var be=class c{static{b(this,"Ssml")}static lc=`[${c.name}]`;static wrapSsmlSpeak(e,a=!0){return"<speak>"+e.reduce((r,o)=>a?r+"<p>"+o+"</p>":r+o,"")+"</speak>"}static unwrapSsmlSpeak(e){return e.replace(/\<speak\>/g,"").replace(/\<\/speak\>/g,"")}static p(e){return"<p>"+e+"</p>"}static s(e){return"<s>"+e+"</s>"}static stripSsml(e){return e.replace(/\<\/p\>[ ]*\<p\>/g,"<p>").replace(/\<p\>(?=[ ])/g,"<p>").replace(/\<\/p\>(?=[ ])/g,"</p>").replace(/\<[\/]*p\>/g,`
2
2
 
3
3
  `).replace(/(<([^>]*)>)/ig,"").replace(/ +/g," ").replace(/\\n\\n\\n/g,`
4
4