archidocs 1.2.0 → 1.3.1

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 (119) hide show
  1. package/README.md +62 -13
  2. package/dist/cli/commands.d.ts +231 -10
  3. package/dist/cli/commands.js +134 -9
  4. package/dist/cli/dev.d.ts +5 -6
  5. package/dist/cli/dev.js +12 -14
  6. package/dist/cli/diff-format.d.ts +1 -5
  7. package/dist/cli/init.d.ts +1 -1
  8. package/dist/cli/init.js +2 -2
  9. package/dist/cli/main.js +2 -329
  10. package/dist/cli/run.d.ts +18 -0
  11. package/dist/cli/run.js +283 -0
  12. package/dist/commands/build.d.ts +51 -0
  13. package/dist/commands/build.js +39 -0
  14. package/dist/commands/check.d.ts +8 -0
  15. package/dist/commands/check.js +5 -0
  16. package/dist/commands/diff.d.ts +29 -0
  17. package/dist/commands/diff.js +25 -0
  18. package/dist/commands/export.d.ts +41 -0
  19. package/dist/commands/export.js +47 -0
  20. package/dist/commands/history.d.ts +18 -0
  21. package/dist/commands/history.js +9 -0
  22. package/dist/commands/index.d.ts +11 -0
  23. package/dist/commands/index.js +11 -0
  24. package/dist/core/compare.d.ts +2 -13
  25. package/dist/core/compare.js +2 -35
  26. package/dist/core/index.d.ts +3 -6
  27. package/dist/core/index.js +3 -6
  28. package/dist/core/load.d.ts +0 -2
  29. package/dist/core/load.js +5 -6
  30. package/dist/core/rules.d.ts +10 -0
  31. package/dist/core/rules.js +186 -7
  32. package/dist/core/views/compare.d.ts +12 -0
  33. package/dist/core/views/compare.js +37 -0
  34. package/dist/core/{deployment-views.d.ts → views/deployment.d.ts} +4 -5
  35. package/dist/core/{deployment-views.js → views/deployment.js} +5 -7
  36. package/dist/core/{dynamic-views.d.ts → views/dynamic.d.ts} +1 -3
  37. package/dist/core/{dynamic-views.js → views/dynamic.js} +4 -8
  38. package/dist/core/views/generated.d.ts +18 -0
  39. package/dist/core/views/generated.js +92 -0
  40. package/dist/core/views/ids.d.ts +36 -0
  41. package/dist/core/views/ids.js +51 -0
  42. package/dist/core/views/index.d.ts +13 -0
  43. package/dist/core/views/index.js +12 -0
  44. package/dist/core/views/lens.d.ts +27 -0
  45. package/dist/core/views/lens.js +112 -0
  46. package/dist/core/views/model.d.ts +21 -0
  47. package/dist/core/views/model.js +69 -0
  48. package/dist/core/views/resolve.d.ts +42 -0
  49. package/dist/core/views/resolve.js +81 -0
  50. package/dist/core/{save-as-view.d.ts → views/save-as-view.d.ts} +2 -2
  51. package/dist/core/{save-as-view.js → views/save-as-view.js} +13 -10
  52. package/dist/core/{saved-views.d.ts → views/saved.d.ts} +4 -18
  53. package/dist/core/{saved-views.js → views/saved.js} +8 -103
  54. package/dist/core/views/types.d.ts +91 -0
  55. package/dist/core/views/types.js +2 -0
  56. package/dist/core/workspace-files.d.ts +13 -0
  57. package/dist/core/workspace-files.js +20 -0
  58. package/dist/git.d.ts +2 -0
  59. package/dist/git.js +14 -4
  60. package/dist/history/git.d.ts +0 -10
  61. package/dist/history/git.js +1 -30
  62. package/dist/history/index.d.ts +15 -31
  63. package/dist/history/index.js +47 -43
  64. package/dist/history/points.d.ts +23 -0
  65. package/dist/history/points.js +28 -0
  66. package/dist/history/site.d.ts +30 -0
  67. package/dist/history/site.js +37 -0
  68. package/dist/mcp/errors.d.ts +37 -0
  69. package/dist/mcp/errors.js +35 -0
  70. package/dist/mcp/history.d.ts +4 -4
  71. package/dist/mcp/history.js +56 -116
  72. package/dist/mcp/index.d.ts +2 -1
  73. package/dist/mcp/index.js +1 -0
  74. package/dist/mcp/server.d.ts +1 -2
  75. package/dist/mcp/server.js +30 -29
  76. package/dist/mcp/site.d.ts +12 -0
  77. package/dist/mcp/site.js +46 -0
  78. package/dist/mcp/source.d.ts +14 -7
  79. package/dist/mcp/source.js +25 -99
  80. package/dist/render/layout.d.ts +20 -3
  81. package/dist/render/layout.js +49 -12
  82. package/dist/render/sequence-svg.d.ts +1 -1
  83. package/dist/render/sequence.d.ts +1 -1
  84. package/dist/render/svg.d.ts +1 -1
  85. package/dist/render/svg.js +4 -4
  86. package/dist/revisions/find.d.ts +64 -0
  87. package/dist/revisions/find.js +85 -0
  88. package/dist/revisions/index.d.ts +57 -0
  89. package/dist/revisions/index.js +24 -0
  90. package/dist/revisions/site.d.ts +82 -0
  91. package/dist/revisions/site.js +157 -0
  92. package/dist/revisions/text.d.ts +8 -0
  93. package/dist/revisions/text.js +17 -0
  94. package/dist/revisions/touching.d.ts +7 -0
  95. package/dist/revisions/touching.js +7 -0
  96. package/dist/schema/adr.js +18 -13
  97. package/dist/schema/workspace.js +226 -130
  98. package/dist/viewer/assets/index-C0lIIm8V.js +138 -0
  99. package/dist/viewer/assets/index-YFA-pYjQ.css +1 -0
  100. package/dist/viewer/assets/{layout.worker-Bg-OaLVN.js → layout.worker-BRHAGJrD.js} +1 -1
  101. package/dist/viewer/assets/{png-BDKIXtm5.js → png-DMwnpRCt.js} +1 -1
  102. package/dist/viewer/assets/{svg-Bulv5YWn.js → svg-DN6lMeZo.js} +2 -2
  103. package/dist/viewer/index.html +2 -2
  104. package/dist/workspace/index.d.ts +37 -0
  105. package/dist/workspace/index.js +52 -0
  106. package/guide/SKILL.md +1 -1
  107. package/guide/topics/bootstrap.md +1 -1
  108. package/guide/topics/relationships.md +1 -1
  109. package/package.json +4 -3
  110. package/schemas/adr.schema.json +18 -15
  111. package/schemas/model.schema.json +637 -1144
  112. package/schemas/project.schema.json +8 -4
  113. package/schemas/workspace.schema.json +39 -20
  114. package/dist/core/views.d.ts +0 -126
  115. package/dist/core/views.js +0 -217
  116. package/dist/viewer/assets/index-DvKgCpBr.css +0 -1
  117. package/dist/viewer/assets/index-gucix3xm.js +0 -113
  118. /package/dist/{history → revisions}/migrate.d.ts +0 -0
  119. /package/dist/{history → revisions}/migrate.js +0 -0
@@ -1 +1 @@
1
- import{o as e,s as t}from"./index-gucix3xm.js";var n,r=Array(128).fill(void 0);r.push(void 0,null,!0,!1);var i=r.length;function a(e){i===r.length&&r.push(r.length+1);let t=i;return i=r[t],r[t]=e,t}function o(e){return r[e]}function s(e){e<132||(r[e]=i,i=e)}function c(e){let t=o(e);return s(e),t}var l=0,u=null;function d(){return(u===null||u.byteLength===0)&&(u=new Uint8Array(n.memory.buffer)),u}var f=typeof TextEncoder<`u`?new TextEncoder(`utf-8`):{encode:()=>{throw Error(`TextEncoder not available`)}},p=typeof f.encodeInto==`function`?function(e,t){return f.encodeInto(e,t)}:function(e,t){let n=f.encode(e);return t.set(n),{read:e.length,written:n.length}};function m(e,t,n){if(n===void 0){let n=f.encode(e),r=t(n.length,1)>>>0;return d().subarray(r,r+n.length).set(n),l=n.length,r}let r=e.length,i=t(r,1)>>>0,a=d(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=d().subarray(i+o,i+r),a=p(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return l=o,i}function h(e){return e==null}var g=null;function _(){return(g===null||g.byteLength===0)&&(g=new Int32Array(n.memory.buffer)),g}var v=typeof TextDecoder<`u`?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(`TextDecoder not available`)}};typeof TextDecoder<`u`&&v.decode();function y(e,t){return e>>>=0,v.decode(d().subarray(e,e+t))}function b(e,t){if(!(e instanceof t))throw Error(`expected instance of ${t.name}`);return e.ptr}function x(e,t){try{return e.apply(this,t)}catch(e){n.__wbindgen_exn_store(a(e))}}var S=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>n.__wbg_bbox_free(e>>>0)),C=class e{static __wrap(t){t>>>=0;let n=Object.create(e.prototype);return n.__wbg_ptr=t,S.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,S.unregister(this),e}free(){let e=this.__destroy_into_raw();n.__wbg_bbox_free(e)}get x(){return n.__wbg_get_bbox_x(this.__wbg_ptr)}set x(e){n.__wbg_set_bbox_x(this.__wbg_ptr,e)}get y(){return n.__wbg_get_bbox_y(this.__wbg_ptr)}set y(e){n.__wbg_set_bbox_y(this.__wbg_ptr,e)}get width(){return n.__wbg_get_bbox_width(this.__wbg_ptr)}set width(e){n.__wbg_set_bbox_width(this.__wbg_ptr,e)}get height(){return n.__wbg_get_bbox_height(this.__wbg_ptr)}set height(e){n.__wbg_set_bbox_height(this.__wbg_ptr,e)}},w=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>n.__wbg_renderedimage_free(e>>>0)),T=class e{static __wrap(t){t>>>=0;let n=Object.create(e.prototype);return n.__wbg_ptr=t,w.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,w.unregister(this),e}free(){let e=this.__destroy_into_raw();n.__wbg_renderedimage_free(e)}get width(){return n.renderedimage_width(this.__wbg_ptr)>>>0}get height(){return n.renderedimage_height(this.__wbg_ptr)>>>0}asPng(){try{let r=n.__wbindgen_add_to_stack_pointer(-16);n.renderedimage_asPng(r,this.__wbg_ptr);var e=_()[r/4+0],t=_()[r/4+1];if(_()[r/4+2])throw c(t);return c(e)}finally{n.__wbindgen_add_to_stack_pointer(16)}}get pixels(){return c(n.renderedimage_pixels(this.__wbg_ptr))}},E=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>n.__wbg_resvg_free(e>>>0)),D=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,E.unregister(this),e}free(){let e=this.__destroy_into_raw();n.__wbg_resvg_free(e)}constructor(e,t,r){try{let d=n.__wbindgen_add_to_stack_pointer(-16);var i=h(t)?0:m(t,n.__wbindgen_malloc,n.__wbindgen_realloc),o=l;n.resvg_new(d,a(e),i,o,h(r)?0:a(r));var s=_()[d/4+0],u=_()[d/4+1];if(_()[d/4+2])throw c(u);return this.__wbg_ptr=s>>>0,this}finally{n.__wbindgen_add_to_stack_pointer(16)}}get width(){return n.resvg_width(this.__wbg_ptr)}get height(){return n.resvg_height(this.__wbg_ptr)}render(){try{let r=n.__wbindgen_add_to_stack_pointer(-16);n.resvg_render(r,this.__wbg_ptr);var e=_()[r/4+0],t=_()[r/4+1];if(_()[r/4+2])throw c(t);return T.__wrap(e)}finally{n.__wbindgen_add_to_stack_pointer(16)}}toString(){let e,t;try{let a=n.__wbindgen_add_to_stack_pointer(-16);n.resvg_toString(a,this.__wbg_ptr);var r=_()[a/4+0],i=_()[a/4+1];return e=r,t=i,y(r,i)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}innerBBox(){let e=n.resvg_innerBBox(this.__wbg_ptr);return e===0?void 0:C.__wrap(e)}getBBox(){let e=n.resvg_getBBox(this.__wbg_ptr);return e===0?void 0:C.__wrap(e)}cropByBBox(e){b(e,C),n.resvg_cropByBBox(this.__wbg_ptr,e.__wbg_ptr)}imagesToResolve(){try{let r=n.__wbindgen_add_to_stack_pointer(-16);n.resvg_imagesToResolve(r,this.__wbg_ptr);var e=_()[r/4+0],t=_()[r/4+1];if(_()[r/4+2])throw c(t);return c(e)}finally{n.__wbindgen_add_to_stack_pointer(16)}}resolveImage(e,t){try{let i=n.__wbindgen_add_to_stack_pointer(-16),o=m(e,n.__wbindgen_malloc,n.__wbindgen_realloc),s=l;n.resvg_resolveImage(i,this.__wbg_ptr,o,s,a(t));var r=_()[i/4+0];if(_()[i/4+1])throw c(r)}finally{n.__wbindgen_add_to_stack_pointer(16)}}};async function O(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.headers.get(`Content-Type`)!=`application/wasm`)console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function k(){let e={};return e.wbg={},e.wbg.__wbg_new_28c511d9baebfa89=function(e,t){return a(Error(y(e,t)))},e.wbg.__wbindgen_memory=function(){let e=n.memory;return a(e)},e.wbg.__wbg_buffer_12d079cc21e14bdb=function(e){let t=o(e).buffer;return a(t)},e.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb=function(e,t,n){return a(new Uint8Array(o(e),t>>>0,n>>>0))},e.wbg.__wbindgen_object_drop_ref=function(e){c(e)},e.wbg.__wbg_new_63b92bc8671ed464=function(e){return a(new Uint8Array(o(e)))},e.wbg.__wbg_values_839f3396d5aac002=function(e){return a(o(e).values())},e.wbg.__wbg_next_196c84450b364254=function(){return x(function(e){return a(o(e).next())},arguments)},e.wbg.__wbg_done_298b57d23c0fc80c=function(e){return o(e).done},e.wbg.__wbg_value_d93c65011f51a456=function(e){let t=o(e).value;return a(t)},e.wbg.__wbg_instanceof_Uint8Array_2b3bbecd033d19f6=function(e){let t;try{t=o(e)instanceof Uint8Array}catch{t=!1}return t},e.wbg.__wbindgen_string_get=function(e,t){let r=o(t),i=typeof r==`string`?r:void 0;var a=h(i)?0:m(i,n.__wbindgen_malloc,n.__wbindgen_realloc),s=l;_()[e/4+1]=s,_()[e/4+0]=a},e.wbg.__wbg_new_16b304a2cfa7ff4a=function(){return a([])},e.wbg.__wbindgen_string_new=function(e,t){return a(y(e,t))},e.wbg.__wbg_push_a5b05aedc7234f9f=function(e,t){return o(e).push(o(t))},e.wbg.__wbg_length_c20a40f15020d68a=function(e){return o(e).length},e.wbg.__wbg_set_a47bac70306a19a7=function(e,t,n){o(e).set(o(t),n>>>0)},e.wbg.__wbindgen_throw=function(e,t){throw Error(y(e,t))},e}function A(e,t){return n=e.exports,j.__wbindgen_wasm_module=t,g=null,u=null,n}async function j(e){if(n!==void 0)return n;e===void 0&&(e=new URL(`index_bg.wasm`,void 0));let t=k();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:r,module:i}=await O(await e,t);return A(r,i)}var M=j,N=!1,P=async e=>{if(N)throw Error("Already initialized. The `initWasm()` function can be used only once.");await M(await e),N=!0},F=class extends D{constructor(e,t){if(!N)throw Error("Wasm has not been initialized. Call `initWasm()` function.");let n=t?.font;if(n&&I(n)){let r={...t,font:{...n,fontBuffers:void 0}};super(e,JSON.stringify(r),n.fontBuffers)}else super(e,JSON.stringify(t))}};function I(e){return Object.prototype.hasOwnProperty.call(e,`fontBuffers`)}var L,R;async function z(n,r,i={}){await(L??=P(r)),R??=e.map(e=>Uint8Array.from(atob(e.base64),e=>e.charCodeAt(0)));let a=new F(n,{fitTo:{mode:`zoom`,value:i.scale??2},font:{fontBuffers:R,defaultFontFamily:t,sansSerifFamily:t}});try{let e=a.render();try{return e.asPng()}finally{e.free()}}finally{a.free()}}export{z as renderPng};
1
+ import{o as e,s as t}from"./index-C0lIIm8V.js";var n,r=Array(128).fill(void 0);r.push(void 0,null,!0,!1);var i=r.length;function a(e){i===r.length&&r.push(r.length+1);let t=i;return i=r[t],r[t]=e,t}function o(e){return r[e]}function s(e){e<132||(r[e]=i,i=e)}function c(e){let t=o(e);return s(e),t}var l=0,u=null;function d(){return(u===null||u.byteLength===0)&&(u=new Uint8Array(n.memory.buffer)),u}var f=typeof TextEncoder<`u`?new TextEncoder(`utf-8`):{encode:()=>{throw Error(`TextEncoder not available`)}},p=typeof f.encodeInto==`function`?function(e,t){return f.encodeInto(e,t)}:function(e,t){let n=f.encode(e);return t.set(n),{read:e.length,written:n.length}};function m(e,t,n){if(n===void 0){let n=f.encode(e),r=t(n.length,1)>>>0;return d().subarray(r,r+n.length).set(n),l=n.length,r}let r=e.length,i=t(r,1)>>>0,a=d(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=d().subarray(i+o,i+r),a=p(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return l=o,i}function h(e){return e==null}var g=null;function _(){return(g===null||g.byteLength===0)&&(g=new Int32Array(n.memory.buffer)),g}var v=typeof TextDecoder<`u`?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(`TextDecoder not available`)}};typeof TextDecoder<`u`&&v.decode();function y(e,t){return e>>>=0,v.decode(d().subarray(e,e+t))}function b(e,t){if(!(e instanceof t))throw Error(`expected instance of ${t.name}`);return e.ptr}function x(e,t){try{return e.apply(this,t)}catch(e){n.__wbindgen_exn_store(a(e))}}var S=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>n.__wbg_bbox_free(e>>>0)),C=class e{static __wrap(t){t>>>=0;let n=Object.create(e.prototype);return n.__wbg_ptr=t,S.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,S.unregister(this),e}free(){let e=this.__destroy_into_raw();n.__wbg_bbox_free(e)}get x(){return n.__wbg_get_bbox_x(this.__wbg_ptr)}set x(e){n.__wbg_set_bbox_x(this.__wbg_ptr,e)}get y(){return n.__wbg_get_bbox_y(this.__wbg_ptr)}set y(e){n.__wbg_set_bbox_y(this.__wbg_ptr,e)}get width(){return n.__wbg_get_bbox_width(this.__wbg_ptr)}set width(e){n.__wbg_set_bbox_width(this.__wbg_ptr,e)}get height(){return n.__wbg_get_bbox_height(this.__wbg_ptr)}set height(e){n.__wbg_set_bbox_height(this.__wbg_ptr,e)}},w=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>n.__wbg_renderedimage_free(e>>>0)),T=class e{static __wrap(t){t>>>=0;let n=Object.create(e.prototype);return n.__wbg_ptr=t,w.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,w.unregister(this),e}free(){let e=this.__destroy_into_raw();n.__wbg_renderedimage_free(e)}get width(){return n.renderedimage_width(this.__wbg_ptr)>>>0}get height(){return n.renderedimage_height(this.__wbg_ptr)>>>0}asPng(){try{let r=n.__wbindgen_add_to_stack_pointer(-16);n.renderedimage_asPng(r,this.__wbg_ptr);var e=_()[r/4+0],t=_()[r/4+1];if(_()[r/4+2])throw c(t);return c(e)}finally{n.__wbindgen_add_to_stack_pointer(16)}}get pixels(){return c(n.renderedimage_pixels(this.__wbg_ptr))}},E=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>n.__wbg_resvg_free(e>>>0)),D=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,E.unregister(this),e}free(){let e=this.__destroy_into_raw();n.__wbg_resvg_free(e)}constructor(e,t,r){try{let d=n.__wbindgen_add_to_stack_pointer(-16);var i=h(t)?0:m(t,n.__wbindgen_malloc,n.__wbindgen_realloc),o=l;n.resvg_new(d,a(e),i,o,h(r)?0:a(r));var s=_()[d/4+0],u=_()[d/4+1];if(_()[d/4+2])throw c(u);return this.__wbg_ptr=s>>>0,this}finally{n.__wbindgen_add_to_stack_pointer(16)}}get width(){return n.resvg_width(this.__wbg_ptr)}get height(){return n.resvg_height(this.__wbg_ptr)}render(){try{let r=n.__wbindgen_add_to_stack_pointer(-16);n.resvg_render(r,this.__wbg_ptr);var e=_()[r/4+0],t=_()[r/4+1];if(_()[r/4+2])throw c(t);return T.__wrap(e)}finally{n.__wbindgen_add_to_stack_pointer(16)}}toString(){let e,t;try{let a=n.__wbindgen_add_to_stack_pointer(-16);n.resvg_toString(a,this.__wbg_ptr);var r=_()[a/4+0],i=_()[a/4+1];return e=r,t=i,y(r,i)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}innerBBox(){let e=n.resvg_innerBBox(this.__wbg_ptr);return e===0?void 0:C.__wrap(e)}getBBox(){let e=n.resvg_getBBox(this.__wbg_ptr);return e===0?void 0:C.__wrap(e)}cropByBBox(e){b(e,C),n.resvg_cropByBBox(this.__wbg_ptr,e.__wbg_ptr)}imagesToResolve(){try{let r=n.__wbindgen_add_to_stack_pointer(-16);n.resvg_imagesToResolve(r,this.__wbg_ptr);var e=_()[r/4+0],t=_()[r/4+1];if(_()[r/4+2])throw c(t);return c(e)}finally{n.__wbindgen_add_to_stack_pointer(16)}}resolveImage(e,t){try{let i=n.__wbindgen_add_to_stack_pointer(-16),o=m(e,n.__wbindgen_malloc,n.__wbindgen_realloc),s=l;n.resvg_resolveImage(i,this.__wbg_ptr,o,s,a(t));var r=_()[i/4+0];if(_()[i/4+1])throw c(r)}finally{n.__wbindgen_add_to_stack_pointer(16)}}};async function O(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.headers.get(`Content-Type`)!=`application/wasm`)console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function k(){let e={};return e.wbg={},e.wbg.__wbg_new_28c511d9baebfa89=function(e,t){return a(Error(y(e,t)))},e.wbg.__wbindgen_memory=function(){let e=n.memory;return a(e)},e.wbg.__wbg_buffer_12d079cc21e14bdb=function(e){let t=o(e).buffer;return a(t)},e.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb=function(e,t,n){return a(new Uint8Array(o(e),t>>>0,n>>>0))},e.wbg.__wbindgen_object_drop_ref=function(e){c(e)},e.wbg.__wbg_new_63b92bc8671ed464=function(e){return a(new Uint8Array(o(e)))},e.wbg.__wbg_values_839f3396d5aac002=function(e){return a(o(e).values())},e.wbg.__wbg_next_196c84450b364254=function(){return x(function(e){return a(o(e).next())},arguments)},e.wbg.__wbg_done_298b57d23c0fc80c=function(e){return o(e).done},e.wbg.__wbg_value_d93c65011f51a456=function(e){let t=o(e).value;return a(t)},e.wbg.__wbg_instanceof_Uint8Array_2b3bbecd033d19f6=function(e){let t;try{t=o(e)instanceof Uint8Array}catch{t=!1}return t},e.wbg.__wbindgen_string_get=function(e,t){let r=o(t),i=typeof r==`string`?r:void 0;var a=h(i)?0:m(i,n.__wbindgen_malloc,n.__wbindgen_realloc),s=l;_()[e/4+1]=s,_()[e/4+0]=a},e.wbg.__wbg_new_16b304a2cfa7ff4a=function(){return a([])},e.wbg.__wbindgen_string_new=function(e,t){return a(y(e,t))},e.wbg.__wbg_push_a5b05aedc7234f9f=function(e,t){return o(e).push(o(t))},e.wbg.__wbg_length_c20a40f15020d68a=function(e){return o(e).length},e.wbg.__wbg_set_a47bac70306a19a7=function(e,t,n){o(e).set(o(t),n>>>0)},e.wbg.__wbindgen_throw=function(e,t){throw Error(y(e,t))},e}function A(e,t){return n=e.exports,j.__wbindgen_wasm_module=t,g=null,u=null,n}async function j(e){if(n!==void 0)return n;e===void 0&&(e=new URL(`index_bg.wasm`,void 0));let t=k();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:r,module:i}=await O(await e,t);return A(r,i)}var M=j,N=!1,P=async e=>{if(N)throw Error("Already initialized. The `initWasm()` function can be used only once.");await M(await e),N=!0},F=class extends D{constructor(e,t){if(!N)throw Error("Wasm has not been initialized. Call `initWasm()` function.");let n=t?.font;if(n&&I(n)){let r={...t,font:{...n,fontBuffers:void 0}};super(e,JSON.stringify(r),n.fontBuffers)}else super(e,JSON.stringify(t))}};function I(e){return Object.prototype.hasOwnProperty.call(e,`fontBuffers`)}var L,R;async function z(n,r,i={}){await(L??=P(r)),R??=e.map(e=>Uint8Array.from(atob(e.base64),e=>e.charCodeAt(0)));let a=new F(n,{fitTo:{mode:`zoom`,value:i.scale??2},font:{fontBuffers:R,defaultFontFamily:t,sansSerifFamily:t}});try{let e=a.render();try{return e.asPng()}finally{e.free()}}finally{a.free()}}export{z as renderPng};
@@ -1,2 +1,2 @@
1
- import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./index-gucix3xm.js";var c={light:{ground:`#f3f4f1`,paper:`#ffffff`,ink:`#1c2633`,muted:`#4f5966`,faint:`#616a76`,line:`#c4c9c1`,rule:`#e2e4df`,tint:`#e8eae5`,here:`#ffc629`,"on-here":`#1c2633`,herebg:`#fff4cc`,"code-bg":`#1c2633`,"code-fg":`#ffffff`,up:`#a4461a`,upbg:`#fbeee6`,down:`#1d5fa8`,downbg:`#e8f0fa`,path:`#5b3aa8`,pathbg:`#efeaf9`,edge:`#5b6573`,"edge-faint":`#80878f`,container:`rgba(232, 234, 229, 0.6)`},dark:{ground:`#10151c`,paper:`#18202a`,ink:`#e6eaef`,muted:`#a9b2bd`,faint:`#8f99a5`,line:`#36414f`,rule:`#252e3a`,tint:`#232c38`,here:`#ffc629`,"on-here":`#10151c`,herebg:`#3a3216`,"code-bg":`#e6eaef`,"code-fg":`#10151c`,up:`#f0925f`,upbg:`#3a2419`,down:`#78aef5`,downbg:`#172a45`,path:`#b79cff`,pathbg:`#2a2142`,edge:`#8f99a5`,"edge-faint":`#646d78`,container:`rgba(35, 44, 56, 0.55)`}};function l(e,t){let n=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/.exec(e);if(!n)return e;let r=Number(n[4]),i=[1,3,5].map(e=>parseInt(t.slice(e,e+2),16));return`#${[n[1],n[2],n[3]].map((e,t)=>Math.round(Number(e)*r+i[t]*(1-r)).toString(16).padStart(2,`0`)).join(``)}`}var u=24,d=72,f=44,p=1.5,m=6,h=(e,t)=>t??[e.workspace,e.commit?.slice(0,7)??`uncommitted`,...e.date?[e.date.slice(0,10)]:[]].join(` · `),g=(e,t,n,r)=>[`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${t}" viewBox="0 0 ${e} ${t}" font-family="${o}, sans-serif">`,`<style>${i.map(e=>`@font-face{font-family:"${o}";font-weight:${e.weight};src:url(data:font/ttf;base64,${e.base64}) format("truetype")}`).join(``)}</style>`,`<defs>${r}</defs>`,`<rect width="${e}" height="${t}" fill="${n}"/>`];function _({bundle:t,view:r,layout:i,source:o,theme:l=`light`,label:p}){let m=c[l],_=new Map(t.elements.map(e=>[e.id,e])),b=new Map(t.targets.map(e=>[e.id,e])),x=s(t),S=new Map(i.nodes.map(e=>[e.id,e])),C=new Set(r.nodes.map(e=>e.parent).filter(e=>e!==null)),O=r.title,k=h(o,p),A=D(m,r.lens),j=Math.ceil(Math.max(i.width,A.width,e(O,20,700),e(k,12))+48),M=Math.ceil(d+i.height+u+f),N=e=>e.parent===null?0:1+N(r.nodes.find(t=>t.id===e.parent)),P=r.nodes.map(e=>({n:e,d:N(e)})).sort((e,t)=>e.d-t.d).map(({n:e})=>e),F=r.lens!==void 0&&`team`in r.lens,I=0,L=e=>{let t=S.get(e.id),n=_.get(e.element??e.id),r=e.kind===`target`?b.get(e.id):void 0,i=x.get(n?.owner??r?.owner??``);return C.has(e.id)?T(m,e,t,i,r?.kind):w(m,e,t,n,i,F,`clip-${I++}`)};return[...g(j,M,m.ground,`${v(`arrow`,m.edge)}${r.lens?v(`arrow-faint`,m[`edge-faint`])+v(`arrow-lit`,m.ink):``}${y(m)}`),n(u,34,O,{size:20,fill:m.ink,weight:700}),n(u,56,k,{size:12,fill:m.muted}),`<g transform="translate(${u},${d})">`,...P.filter(e=>C.has(e.id)).map(L),...i.edges.map(e=>E(m,e.points,r.edges.find(t=>t.from===e.from&&t.to===e.to))),...P.filter(e=>!C.has(e.id)).map(L),`</g>`,`<g transform="translate(${u},${a(d+i.height+u)})">`,...A.parts,`</g>`,`</svg>`,``].join(`
2
- `)}var v=(e,t)=>`<marker id="${e}" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="${t}"/></marker>`,y=e=>`<pattern id="broker" width="12" height="12" patternUnits="userSpaceOnUse"><rect x="8" width="4" height="12" fill="${e.rule}"/></pattern>`;function b(e,t,n,r,[i,o,s,c]){let l=(e,t,n)=>e?`A${a(e)},${a(e)} 0 0 1 ${a(t)},${a(n)} `:``;return`M${a(e+i)},${a(t)} L${a(e+n-o)},${a(t)} ${l(o,e+n,t+o)}L${a(e+n)},${a(t+r-s)} ${l(s,e+n-s,t+r)}L${a(e+c)},${a(t+r)} ${l(c,e,t+r-c)}L${a(e)},${a(t+i)} ${l(i,e+i,t)}Z`}function x(t,r,i,o){let s=e(r.code,10,700)+16,c=i-s;return[`<rect x="${a(c)}" y="${a(o)}" width="${a(s)}" height="16" fill="${t[`code-bg`]}"/>`,`<rect x="${a(c)}" y="${a(o)}" width="5" height="16" fill="${r.color}"/>`,n(c+10,o+12,r.code,{size:10,fill:t[`code-fg`],weight:700})].join(``)}function S(e,t,n,r,i){let a={frame:e.ink,fill:n,name:e.ink,sub:e.muted,edge:r?.color??e.ink},o=t.mark;return o?o.hit?i?{...a,fill:e.paper,ring:r?.color??e.ink}:o.side===`origin`?{...a,fill:e.herebg,edge:e.ink,ring:e.here}:o.side===`upstream`?{...a,frame:e.up,fill:e.upbg,edge:e.up}:o.side===`downstream`?{...a,frame:e.down,fill:e.downbg,edge:e.down,double:!0}:{...a,frame:e.path,fill:e.pathbg,edge:e.path}:{frame:e.line,fill:e.ground,name:e.faint,sub:e.faint,edge:e.line}:a}function C(t,r,i){let o=r.mark;if(o?.distance===void 0)return[];let s=o.side===`origin`?`ORIGIN`:o.side?`${o.side.toUpperCase()} ${o.distance}`:String(o.distance),c=e(s,10,700)+12,l=i.x+i.width-36-c,u=i.y-10,[d,f,m]=o.side===`origin`?[t.here,t[`on-here`],t.ink]:o.side===`upstream`?[t.up,t.paper,void 0]:o.side===`downstream`?[t.down,t.paper,void 0]:[t.paper,t.ink,t.ink];return[`<rect x="${a(l)}" y="${a(u)}" width="${a(c)}" height="16" fill="${d}"${m?` stroke="${m}" stroke-width="${p}"`:``}/>`,n(l+6,u+12,s,{size:10,fill:f,weight:700})]}function w(t,i,o,s,c,l,u){let{x:d,y:f,width:h,height:g}=o,_=s?.kind===`service`?s.type:void 0,v=i.kind===`system`,y=S(t,i,v?t.tint:t.paper,c,l),w=i.kind===`person`?Math.min(36,g/2):0,T=b(d,f,h,g,i.kind===`person`?[w,w,w,w]:_===`datastore`?[0,0,12,12]:[0,0,0,0]),E=i.external?` stroke-dasharray="6 4"`:``,D=v?2:p,O=c?e(c.code,10,700)+16+8:0,A=d+m+(i.kind===`person`?12:8),j=i.kind===`person`?d+h-16:d+h-10;return[`<g>`,...y.ring?[`<path d="${b(d-4,f-4,h+8,g+8,w?[w+4,w+4,w+4,w+4]:_===`datastore`?[0,0,16,16]:[0,0,0,0])}" fill="${y.ring}"/>`]:[],`<clipPath id="${u}"><path d="${T}"/></clipPath>`,`<path d="${T}" fill="${y.fill}"/>`,..._===`broker`?[`<path d="${T}" fill="url(#broker)"/>`]:[],`<path d="${T}" fill="none" stroke="${y.frame}" stroke-width="${D}"${E}/>`,...y.double?[`<path d="${b(d+3,f+3,h-6,g-6,[0,0,_===`datastore`?9:0,_===`datastore`?9:0])}" fill="none" stroke="${y.frame}" stroke-width="${p}"/>`]:[],`<rect x="${a(d-1)}" y="${a(f-1)}" width="7" height="${a(g+2)}" fill="${y.edge}" clip-path="url(#${u})"/>`,n(A,f+g/2-4,r(i.name,13,j-A-O,700),{size:13,fill:y.name,weight:700}),n(A,f+g/2+13,r(k(i,s),11,j-A),{size:11,fill:y.sub}),...c?[x(t,c,j,f+8)]:[],...C(t,i,o),...i.mark?.hit&&i.collapsed?[`<rect x="${a(d+h-42)}" y="${a(f+g-18)}" width="10" height="10" fill="${t.ink}" stroke="${t.paper}" stroke-width="2"/>`]:[],`</g>`].join(``)}function T(t,i,o,s,c){let{x:u,y:d,width:f,height:h}=o,g=i.kind===`target`,_=i.mark&&!i.mark.hit,v=i.external?t.ink:t.line,y=g||_?`none`:l(t.container,t.ground),b=i.external?` stroke-dasharray="6 4"`:``,S=s?e(s.code,10,700)+16+8:0,w=u+(g?12:16);return[`<g>`,`<rect x="${a(u)}" y="${a(d)}" width="${a(f)}" height="${a(h)}" fill="${y}" stroke="${v}" stroke-width="${p}"${b}/>`,...g?[]:[`<rect x="${a(u-p/2)}" y="${a(d-p/2)}" width="${m}" height="${a(h+p)}" fill="${v}"/>`],n(w,d+22,r(`${i.name} · ${c??O(i)}`,13,u+f-10-w-S,700),{size:13,fill:_?t.faint:t.ink,weight:700}),...s?[x(t,s,u+f-10,d+9)]:[],...C(t,i,o),`</g>`].join(``)}function E(e,t,n){let r=t.map((e,t)=>`${t===0?`M`:`L`}${a(e.x)},${a(e.y)}`).join(` `);return n.lit?`<path d="${r}" fill="none" stroke="${e.ink}" stroke-width="2.5" marker-end="url(#arrow-lit)"/>`:n.lit===!1?`<path d="${r}" fill="none" stroke="${e[`edge-faint`]}" stroke-width="${p}" marker-end="url(#arrow-faint)"/>`:`<path d="${r}" fill="none" stroke="${e.edge}" stroke-width="${p}" marker-end="url(#arrow)"/>`}function D(r,i){let o=[],s=0,c=t=>{o.push(n(s,16,t,{size:11,fill:r.muted})),s+=e(t,11)+24},l=e=>{o.push(`<rect x="${a(s)}" y="4" width="28" height="16" ${e}/>`),s+=36};return o.push(x(r,{code:`ABC`,color:r.muted},s+e(`ABC`,10,700)+16,4)),s+=e(`ABC`,10,700)+24,c(`Team (stripe and code)`),l(`fill="${r.paper}" stroke="${r.ink}" stroke-width="${p}" stroke-dasharray="6 4"`),c(`External`),o.push(`<rect x="${a(s)}" y="4" width="28" height="16" fill="${r.paper}"/><rect x="${a(s)}" y="4" width="28" height="16" fill="url(#broker)" stroke="${r.ink}" stroke-width="${p}"/>`),s+=36,c(`Broker`),i&&(`impact`in i?(l(`fill="${r.herebg}" stroke="${r.here}" stroke-width="2.5"`),c(`Origin`),l(`fill="${r.up}"`),c(`Upstream`),l(`fill="${r.down}"`),c(`Downstream`)):`team`in i?l(`fill="${r.paper}" stroke="${r.muted}" stroke-width="3"`):l(`fill="${r.pathbg}" stroke="${r.path}" stroke-width="${p}"`),c(`Lens: ${t(i)}`)),{parts:o,width:s-24}}var O=e=>({person:`Person`,system:`System`,service:`Service`,component:`Component`,target:`Deployment Target`,deployment:`Deployment`})[e.kind];function k(e,t){let n=e.kind!==`deployment`&&t?.kind===`service`&&t.type!==`app`?{datastore:`Datastore`,broker:`Broker`}[t.type]:O(e),r=t&&`technology`in t?t.technology:null;return[`${e.external?`External `:``}${n}`,...r?[r]:[]].join(` · `)}export{x as codeTile,g as opening,_ as renderSvg,h as sourceLine};
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./index-C0lIIm8V.js";var c={light:{ground:`#f3f4f1`,paper:`#ffffff`,ink:`#1c2633`,muted:`#4f5966`,faint:`#616a76`,line:`#c4c9c1`,rule:`#e2e4df`,tint:`#e8eae5`,here:`#ffc629`,"on-here":`#1c2633`,herebg:`#fff4cc`,"code-bg":`#1c2633`,"code-fg":`#ffffff`,up:`#a4461a`,upbg:`#fbeee6`,down:`#1d5fa8`,downbg:`#e8f0fa`,path:`#5b3aa8`,pathbg:`#efeaf9`,edge:`#5b6573`,"edge-faint":`#80878f`,container:`rgba(232, 234, 229, 0.6)`},dark:{ground:`#10151c`,paper:`#18202a`,ink:`#e6eaef`,muted:`#a9b2bd`,faint:`#8f99a5`,line:`#36414f`,rule:`#252e3a`,tint:`#232c38`,here:`#ffc629`,"on-here":`#10151c`,herebg:`#3a3216`,"code-bg":`#e6eaef`,"code-fg":`#10151c`,up:`#f0925f`,upbg:`#3a2419`,down:`#78aef5`,downbg:`#172a45`,path:`#b79cff`,pathbg:`#2a2142`,edge:`#8f99a5`,"edge-faint":`#646d78`,container:`rgba(35, 44, 56, 0.55)`}};function l(e,t){let n=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/.exec(e);if(!n)return e;let r=Number(n[4]),i=[1,3,5].map(e=>parseInt(t.slice(e,e+2),16));return`#${[n[1],n[2],n[3]].map((e,t)=>Math.round(Number(e)*r+i[t]*(1-r)).toString(16).padStart(2,`0`)).join(``)}`}var u=24,d=72,f=44,p=1.5,m=6,h=(e,t)=>t??[e.workspace,e.commit?.slice(0,7)??`uncommitted`,...e.date?[e.date.slice(0,10)]:[]].join(` · `),g=(e,t,n,r)=>[`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${t}" viewBox="0 0 ${e} ${t}" font-family="${o}, sans-serif">`,`<style>${i.map(e=>`@font-face{font-family:"${o}";font-weight:${e.weight};src:url(data:font/ttf;base64,${e.base64}) format("truetype")}`).join(``)}</style>`,`<defs>${r}</defs>`,`<rect width="${e}" height="${t}" fill="${n}"/>`];function _({bundle:t,view:r,layout:i,source:o,theme:l=`light`,label:p}){let m=c[l],_=new Map(t.elements.map(e=>[e.id,e])),b=new Map(t.targets.map(e=>[e.id,e])),x=s(t),S=new Map(i.nodes.map(e=>[e.id,e])),C=new Set(r.nodes.map(e=>e.parent).filter(e=>e!==null)),O=r.title,k=h(o,p),A=D(m,t,r.lens),j=Math.ceil(Math.max(i.width,A.width,e(O,20,700),e(k,12))+48),M=Math.ceil(d+i.height+u+f),N=e=>e.parent===null?0:1+N(r.nodes.find(t=>t.id===e.parent)),P=r.nodes.map(e=>({n:e,d:N(e)})).sort((e,t)=>e.d-t.d).map(({n:e})=>e),F=r.lens!==void 0&&`team`in r.lens,I=0,L=e=>{let t=S.get(e.id),n=_.get(e.element??e.id),r=e.kind===`target`?b.get(e.id):void 0,i=x.get(n?.owner??r?.owner??``);return C.has(e.id)?T(m,e,t,i,r?.kind):w(m,e,t,n,i,F,`clip-${I++}`)};return[...g(j,M,m.ground,`${v(`arrow`,m.edge)}${r.lens?v(`arrow-faint`,m[`edge-faint`])+v(`arrow-lit`,m.ink):``}${y(m)}`),n(u,34,O,{size:20,fill:m.ink,weight:700}),n(u,56,k,{size:12,fill:m.muted}),`<g transform="translate(${u},${d})">`,...P.filter(e=>C.has(e.id)).map(L),...i.edges.map(e=>E(m,e.points,r.edges.find(t=>t.from===e.from&&t.to===e.to))),...P.filter(e=>!C.has(e.id)).map(L),`</g>`,`<g transform="translate(${u},${a(d+i.height+u)})">`,...A.parts,`</g>`,`</svg>`,``].join(`
2
+ `)}var v=(e,t)=>`<marker id="${e}" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="${t}"/></marker>`,y=e=>`<pattern id="broker" width="12" height="12" patternUnits="userSpaceOnUse"><rect x="8" width="4" height="12" fill="${e.rule}"/></pattern>`;function b(e,t,n,r,[i,o,s,c]){let l=(e,t,n)=>e?`A${a(e)},${a(e)} 0 0 1 ${a(t)},${a(n)} `:``;return`M${a(e+i)},${a(t)} L${a(e+n-o)},${a(t)} ${l(o,e+n,t+o)}L${a(e+n)},${a(t+r-s)} ${l(s,e+n-s,t+r)}L${a(e+c)},${a(t+r)} ${l(c,e,t+r-c)}L${a(e)},${a(t+i)} ${l(i,e+i,t)}Z`}function x(t,r,i,o){let s=e(r.code,10,700)+16,c=i-s;return[`<rect x="${a(c)}" y="${a(o)}" width="${a(s)}" height="16" fill="${t[`code-bg`]}"/>`,`<rect x="${a(c)}" y="${a(o)}" width="5" height="16" fill="${r.color}"/>`,n(c+10,o+12,r.code,{size:10,fill:t[`code-fg`],weight:700})].join(``)}function S(e,t,n,r,i){let a={frame:e.ink,fill:n,name:e.ink,sub:e.muted,edge:r?.color??e.ink},o=t.mark;return o?o.hit?i?{...a,fill:e.paper,ring:r?.color??e.ink}:o.side===`origin`?{...a,fill:e.herebg,edge:e.ink,ring:e.here}:o.side===`upstream`?{...a,frame:e.up,fill:e.upbg,edge:e.up}:o.side===`downstream`?{...a,frame:e.down,fill:e.downbg,edge:e.down,double:!0}:{...a,frame:e.path,fill:e.pathbg,edge:e.path}:{frame:e.line,fill:e.ground,name:e.faint,sub:e.faint,edge:e.line}:a}function C(t,r,i){let o=r.mark;if(o?.distance===void 0)return[];let s=o.side===`origin`?`ORIGIN`:o.side?`${o.side.toUpperCase()} ${o.distance}`:String(o.distance),c=e(s,10,700)+12,l=i.x+i.width-36-c,u=i.y-10,[d,f,m]=o.side===`origin`?[t.here,t[`on-here`],t.ink]:o.side===`upstream`?[t.up,t.paper,void 0]:o.side===`downstream`?[t.down,t.paper,void 0]:[t.paper,t.ink,t.ink];return[`<rect x="${a(l)}" y="${a(u)}" width="${a(c)}" height="16" fill="${d}"${m?` stroke="${m}" stroke-width="${p}"`:``}/>`,n(l+6,u+12,s,{size:10,fill:f,weight:700})]}function w(t,i,o,s,c,l,u){let{x:d,y:f,width:h,height:g}=o,_=s?.kind===`service`?s.type:void 0,v=i.kind===`system`,y=S(t,i,v?t.tint:t.paper,c,l),w=i.kind===`person`?Math.min(36,g/2):0,T=b(d,f,h,g,i.kind===`person`?[w,w,w,w]:_===`datastore`?[0,0,12,12]:[0,0,0,0]),E=i.external?` stroke-dasharray="6 4"`:``,D=v?2:p,O=c?e(c.code,10,700)+16+8:0,A=d+m+(i.kind===`person`?12:8),j=i.kind===`person`?d+h-16:d+h-10;return[`<g>`,...y.ring?[`<path d="${b(d-4,f-4,h+8,g+8,w?[w+4,w+4,w+4,w+4]:_===`datastore`?[0,0,16,16]:[0,0,0,0])}" fill="${y.ring}"/>`]:[],`<clipPath id="${u}"><path d="${T}"/></clipPath>`,`<path d="${T}" fill="${y.fill}"/>`,..._===`broker`?[`<path d="${T}" fill="url(#broker)"/>`]:[],`<path d="${T}" fill="none" stroke="${y.frame}" stroke-width="${D}"${E}/>`,...y.double?[`<path d="${b(d+3,f+3,h-6,g-6,[0,0,_===`datastore`?9:0,_===`datastore`?9:0])}" fill="none" stroke="${y.frame}" stroke-width="${p}"/>`]:[],`<rect x="${a(d-1)}" y="${a(f-1)}" width="7" height="${a(g+2)}" fill="${y.edge}" clip-path="url(#${u})"/>`,n(A,f+g/2-4,r(i.name,13,j-A-O,700),{size:13,fill:y.name,weight:700}),n(A,f+g/2+13,r(k(i,s),11,j-A),{size:11,fill:y.sub}),...c?[x(t,c,j,f+8)]:[],...C(t,i,o),...i.mark?.hit&&i.collapsed?[`<rect x="${a(d+h-42)}" y="${a(f+g-18)}" width="10" height="10" fill="${t.ink}" stroke="${t.paper}" stroke-width="2"/>`]:[],`</g>`].join(``)}function T(t,i,o,s,c){let{x:u,y:d,width:f,height:h}=o,g=i.kind===`target`,_=i.mark&&!i.mark.hit,v=i.external?t.ink:t.line,y=g||_?`none`:l(t.container,t.ground),b=i.external?` stroke-dasharray="6 4"`:``,S=s?e(s.code,10,700)+16+8:0,w=u+(g?12:16);return[`<g>`,`<rect x="${a(u)}" y="${a(d)}" width="${a(f)}" height="${a(h)}" fill="${y}" stroke="${v}" stroke-width="${p}"${b}/>`,...g?[]:[`<rect x="${a(u-p/2)}" y="${a(d-p/2)}" width="${m}" height="${a(h+p)}" fill="${v}"/>`],n(w,d+22,r(`${i.name} · ${c??O(i)}`,13,u+f-10-w-S,700),{size:13,fill:_?t.faint:t.ink,weight:700}),...s?[x(t,s,u+f-10,d+9)]:[],...C(t,i,o),`</g>`].join(``)}function E(e,t,n){let r=t.map((e,t)=>`${t===0?`M`:`L`}${a(e.x)},${a(e.y)}`).join(` `);return n.lit?`<path d="${r}" fill="none" stroke="${e.ink}" stroke-width="2.5" marker-end="url(#arrow-lit)"/>`:n.lit===!1?`<path d="${r}" fill="none" stroke="${e[`edge-faint`]}" stroke-width="${p}" marker-end="url(#arrow-faint)"/>`:`<path d="${r}" fill="none" stroke="${e.edge}" stroke-width="${p}" marker-end="url(#arrow)"/>`}function D(r,i,o){let s=[],c=0,l=t=>{s.push(n(c,16,t,{size:11,fill:r.muted})),c+=e(t,11)+24},u=e=>{s.push(`<rect x="${a(c)}" y="4" width="28" height="16" ${e}/>`),c+=36};return s.push(x(r,{code:`ABC`,color:r.muted},c+e(`ABC`,10,700)+16,4)),c+=e(`ABC`,10,700)+24,l(`Team (stripe and code)`),u(`fill="${r.paper}" stroke="${r.ink}" stroke-width="${p}" stroke-dasharray="6 4"`),l(`External`),s.push(`<rect x="${a(c)}" y="4" width="28" height="16" fill="${r.paper}"/><rect x="${a(c)}" y="4" width="28" height="16" fill="url(#broker)" stroke="${r.ink}" stroke-width="${p}"/>`),c+=36,l(`Broker`),o&&(`impact`in o?(u(`fill="${r.herebg}" stroke="${r.here}" stroke-width="2.5"`),l(`Origin`),u(`fill="${r.up}"`),l(`Upstream`),u(`fill="${r.down}"`),l(`Downstream`)):`team`in o?u(`fill="${r.paper}" stroke="${r.muted}" stroke-width="3"`):u(`fill="${r.pathbg}" stroke="${r.path}" stroke-width="${p}"`),l(`Lens: ${t(i,o)}`)),{parts:s,width:c-24}}var O=e=>({person:`Person`,system:`System`,service:`Service`,component:`Component`,target:`Deployment Target`,deployment:`Deployment`})[e.kind];function k(e,t){let n=e.kind!==`deployment`&&t?.kind===`service`&&t.type!==`app`?{datastore:`Datastore`,broker:`Broker`}[t.type]:O(e),r=t&&`technology`in t?t.technology:null;return[`${e.external?`External `:``}${n}`,...r?[r]:[]].join(` · `)}export{x as codeTile,g as opening,_ as renderSvg,h as sourceLine};
@@ -44,8 +44,8 @@
44
44
  });
45
45
  })();
46
46
  </script>
47
- <script type="module" crossorigin src="./assets/index-gucix3xm.js"></script>
48
- <link rel="stylesheet" crossorigin href="./assets/index-DvKgCpBr.css">
47
+ <script type="module" crossorigin src="./assets/index-C0lIIm8V.js"></script>
48
+ <link rel="stylesheet" crossorigin href="./assets/index-YFA-pYjQ.css">
49
49
  </head>
50
50
  <body>
51
51
  <div id="root"></div>
@@ -0,0 +1,37 @@
1
+ import { type LoadResult } from "../core/index.ts";
2
+ import { type History } from "../history/index.ts";
3
+ export { isWorkspaceFile } from "../core/workspace-files.ts";
4
+ /** The git repo a Checkout is in: the Workspace root with symlinks resolved, git's top level, and the History handle over both. */
5
+ export interface Repo {
6
+ /** The Workspace root, realpath'd. */
7
+ realRoot: string;
8
+ /** `git rev-parse --show-toplevel` from `realRoot`. */
9
+ repoRoot: string;
10
+ history: History;
11
+ }
12
+ /**
13
+ * A Workspace root on disk, possibly inside a git repo: what the CLI, dev and
14
+ * the MCP server read a Workspace from. Git facts are looked up lazily; HEAD
15
+ * and the files are read on every call, so a commit or an edit is seen.
16
+ */
17
+ export interface Checkout {
18
+ /** The Workspace root as given or found, not realpath'd: what users see. */
19
+ readonly root: string;
20
+ /** The git repo, or undefined outside git. Looked up once. */
21
+ repo(): Promise<Repo | undefined>;
22
+ /** How the Workspace is named (a picture's source line, a site's `site.json`): its repo's folder, else the root's. */
23
+ name(): Promise<string>;
24
+ /** HEAD's sha and commit time, read on every call; both null outside git or before the first commit. */
25
+ head(): Promise<{
26
+ commit: string | null;
27
+ builtAt: string | null;
28
+ }>;
29
+ /** The working tree's Bundle and issues, recorded at HEAD. */
30
+ load(): Promise<LoadResult>;
31
+ /** Path, mtime and size of every Workspace file, in a stable order: changes when a Workspace file does. */
32
+ fingerprint(): Promise<string>;
33
+ }
34
+ /** A Checkout at a known Workspace root (the folder holding `workspace.yaml`). */
35
+ export declare function checkoutAt(root: string): Checkout;
36
+ /** The Checkout whose Workspace holds `start`: walking up from it, a folder holding `workspace.yaml` or its `archidocs/` one. Undefined when there is none. */
37
+ export declare function findCheckout(start: string): Promise<Checkout | undefined>;
@@ -0,0 +1,52 @@
1
+ import { readdir, realpath, stat } from "node:fs/promises";
2
+ import { basename, join, relative } from "node:path";
3
+ import { findWorkspaceRoot, load, nodeFileSystem } from "../core/index.js";
4
+ import { isSkippedName, isWorkspaceFile } from "../core/workspace-files.js";
5
+ import { gitHead, gitTopLevel } from "../git.js";
6
+ import { history } from "../history/index.js";
7
+ export { isWorkspaceFile } from "../core/workspace-files.js";
8
+ /** A Checkout at a known Workspace root (the folder holding `workspace.yaml`). */
9
+ export function checkoutAt(root) {
10
+ let repo;
11
+ const checkout = {
12
+ root,
13
+ repo: () => (repo ??= (async () => {
14
+ // Resolve first: `history()` and `load` make paths relative to git's top level, which git resolves.
15
+ const realRoot = await realpath(root);
16
+ const repoRoot = await gitTopLevel(realRoot);
17
+ return repoRoot ? { realRoot, repoRoot, history: history(repoRoot, realRoot) } : undefined;
18
+ })()),
19
+ name: async () => basename((await checkout.repo())?.repoRoot ?? root),
20
+ head: () => gitHead(root),
21
+ load: async () => {
22
+ const [found, { commit, builtAt }] = await Promise.all([checkout.repo(), checkout.head()]);
23
+ const fs = nodeFileSystem();
24
+ return found ? load({ fs, root: found.realRoot, repoRoot: found.repoRoot, commit, builtAt }) : load({ fs, root, commit, builtAt });
25
+ },
26
+ fingerprint: () => fingerprint(root),
27
+ };
28
+ return checkout;
29
+ }
30
+ /** The Checkout whose Workspace holds `start`: walking up from it, a folder holding `workspace.yaml` or its `archidocs/` one. Undefined when there is none. */
31
+ export async function findCheckout(start) {
32
+ const root = await findWorkspaceRoot(nodeFileSystem(), start);
33
+ return root === undefined ? undefined : checkoutAt(root);
34
+ }
35
+ async function fingerprint(root) {
36
+ const lines = [];
37
+ const dirs = [root];
38
+ for (let i = 0; i < dirs.length; i++) {
39
+ for (const entry of await readdir(dirs[i], { withFileTypes: true })) {
40
+ if (isSkippedName(entry.name))
41
+ continue;
42
+ const path = join(dirs[i], entry.name);
43
+ if (entry.isDirectory())
44
+ dirs.push(path);
45
+ else if (isWorkspaceFile(relative(root, path))) {
46
+ const s = await stat(path);
47
+ lines.push(`${path}\0${s.mtimeMs}\0${s.size}`);
48
+ }
49
+ }
50
+ }
51
+ return lines.sort().join("\n");
52
+ }
package/guide/SKILL.md CHANGED
@@ -13,7 +13,7 @@ Load the topic for the task before you write: `get_authoring_guide(topic)`, or `
13
13
 
14
14
  - **Elements**: Person, System, Service, Component. Nesting is strict: System › Service › Component; a Service may sit outside any System; Persons are top-level. Every Element has `name`, and optionally `description`, `owner`, `tags`, `links`.
15
15
  - Service adds `type` (`app` by default, `datastore`, `broker`), `technology`, `external`. System adds `external`. Component adds `technology`.
16
- - An External System or Service runs outside the organisation and has no declared Components.
16
+ - An External System or Service runs outside the organization and has no declared Components.
17
17
  - **Relationships** sit under their consumer and point `to` the provider it depends on. Edges between higher-level Elements are derived, never declared.
18
18
  - **Ownership**: one Owner Team per Element, defaulting to the Project's `owner`. Set `owner` only when it differs.
19
19
  - **Deployment Targets** nest to any depth, have a `kind`, and are not Elements. A **Deployment** is one Service in one Environment on one Target, and carries the `url` and `endpoints`. URLs live only on Deployments.
@@ -21,7 +21,7 @@ Declare an existing codebase's Services, Components, Relationships, Deployment T
21
21
  - Declare only this Project's **outbound** Relationships; each provider declares its own.
22
22
  - Resolve each provider with `search_elements` by name, URL or host to its `project:id`.
23
23
  - No match: leave the Relationship out and list it in the report as a gap. Create Elements only in this Project.
24
- - A provider clearly outside the organisation (a payment provider, an email API) may be declared in this Project as an External Service owned by this Project's Team.
24
+ - A provider clearly outside the organization (a payment provider, an email API) may be declared in this Project as an External Service owned by this Project's Team.
25
25
 
26
26
  ## Evidence
27
27
 
@@ -36,4 +36,4 @@ Impact and path queries count the broker as a hop and as a dependency of both si
36
36
 
37
37
  ## Cross-Project
38
38
 
39
- Declare only this Project's outbound Relationships. When the provider isn't in the Model, leave the Relationship out and tell the user it is a gap for the provider's Team; create Elements only in this Project. A provider outside the organisation may be added here as an External Service.
39
+ Declare only this Project's outbound Relationships. When the provider isn't in the Model, leave the Relationship out and tell the user it is a gap for the provider's Team; create Elements only in this Project. A provider outside the organization may be added here as an External Service.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archidocs",
3
- "version": "1.2.0",
3
+ "version": "1.3.1",
4
4
  "description": "Git-native architecture as code: check and bundle a Workspace of Projects.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -36,10 +36,11 @@
36
36
  "dev": "pnpm build:viewer && node src/cli/main.ts dev --workspace \"${INIT_CWD:-.}\"",
37
37
  "dev:viewer": "vite --config viewer/vite.config.ts",
38
38
  "demo:big-bank": "pnpm build:viewer && node examples/big-bank/build-demo.mjs examples/big-bank/site",
39
- "docs:dev": "pnpm --dir website dev",
40
- "docs:build": "pnpm --dir website build",
39
+ "docs:dev": "pnpm build:viewer && pnpm --dir website dev",
40
+ "docs:build": "pnpm build:viewer && pnpm --dir website build",
41
41
  "docs:test": "pnpm --dir website test",
42
42
  "docs:tutorial": "pnpm build:viewer && node website/scripts/tutorial.ts",
43
+ "docs:quick-start": "pnpm build:viewer && node website/scripts/quick-start.ts",
43
44
  "demo:kitchen-sink": "pnpm build:viewer && cd examples/kitchen-sink && node ../../src/cli/main.ts build --out site"
44
45
  },
45
46
  "dependencies": {
@@ -11,66 +11,68 @@
11
11
  "rejected",
12
12
  "deprecated",
13
13
  "superseded"
14
- ]
14
+ ],
15
+ "description": "Where the decision stands. `proposed`: awaiting acceptance in a pull request. `accepted`: in force. `rejected`: turned down, and kept for its reasoning. `deprecated`: no longer in force, with no ADR replacing it. `superseded`: never written by hand; it is derived once an accepted ADR lists this one in `supersedes`."
15
16
  },
16
17
  "date": {
17
18
  "type": "string",
18
19
  "format": "date",
19
20
  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
20
- "description": "The date of the last status change"
21
+ "description": "The date of the last status change, as `YYYY-MM-DD`."
21
22
  },
22
23
  "decision-makers": {
24
+ "description": "Who made the decision: people's names or Team ids. Not checked.",
23
25
  "type": "array",
24
26
  "items": {
25
27
  "type": "string"
26
- },
27
- "description": "People or Team ids; not checked"
28
+ }
28
29
  },
29
30
  "consulted": {
31
+ "description": "Who was asked for input: people's names or Team ids. Not checked.",
30
32
  "type": "array",
31
33
  "items": {
32
34
  "type": "string"
33
- },
34
- "description": "People or Team ids; not checked"
35
+ }
35
36
  },
36
37
  "informed": {
38
+ "description": "Who was told of the decision: people's names or Team ids. Not checked.",
37
39
  "type": "array",
38
40
  "items": {
39
41
  "type": "string"
40
- },
41
- "description": "People or Team ids; not checked"
42
+ }
42
43
  },
43
44
  "tags": {
45
+ "description": "Free-form labels for the ADR.",
44
46
  "type": "array",
45
47
  "items": {
46
48
  "type": "string"
47
49
  }
48
50
  },
49
51
  "elements": {
50
- "description": "Elements and Deployment Targets the decision affects",
52
+ "description": "The Elements and Deployment Targets the decision affects, each as an id in this Project or `project:id`.",
51
53
  "type": "array",
52
54
  "items": {
53
55
  "type": "string",
54
56
  "pattern": "^([a-z0-9][a-z0-9-]*:)?[a-z0-9][a-z0-9-]*$",
55
- "description": "An id in this Project, or `project:id` for one in another Project"
57
+ "description": "An id in this Project, or `project:id` for one in another Project."
56
58
  }
57
59
  },
58
60
  "views": {
59
- "description": "Saved Views the decision affects",
61
+ "description": "The Saved Views the decision affects, each as an id in this Project or `project:id`.",
60
62
  "type": "array",
61
63
  "items": {
62
64
  "type": "string",
63
65
  "pattern": "^([a-z0-9][a-z0-9-]*:)?[a-z0-9][a-z0-9-]*$",
64
- "description": "An id in this Project, or `project:id` for one in another Project"
66
+ "description": "An id in this Project, or `project:id` for one in another Project."
65
67
  }
66
68
  },
67
69
  "supersedes": {
68
- "description": "ADRs this one replaces once accepted",
70
+ "description": "The ADRs this one replaces once it is accepted, each as a four-digit number in this Project or `project:NNNN`. Only an accepted or deprecated ADR can be superseded.",
69
71
  "type": "array",
70
72
  "items": {
71
73
  "type": "string",
72
74
  "pattern": "^([a-z0-9][a-z0-9-]*:)?\\d{4}$",
73
- "description": "An ADR number in this Project, or `project:NNNN` for one in another Project"
75
+ "description": "An ADR number in this Project, or `project:NNNN` for one in another Project."
74
76
  }
75
77
  }
76
78
  },
@@ -78,5 +80,6 @@
78
80
  "status",
79
81
  "date"
80
82
  ],
81
- "additionalProperties": false
83
+ "additionalProperties": false,
84
+ "description": "An ADR's frontmatter. The ADR's title is the first `# ` heading of its body, not a field."
82
85
  }