archidocs 1.0.0 → 1.3.0
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/LICENSE +21 -0
- package/README.md +231 -0
- package/dist/cli/commands.d.ts +543 -0
- package/dist/cli/commands.js +299 -0
- package/dist/cli/format.d.ts +2 -2
- package/dist/cli/format.js +9 -5
- package/dist/cli/init.d.ts +1 -1
- package/dist/cli/init.js +2 -2
- package/dist/cli/main.js +27 -73
- package/dist/core/compare.d.ts +2 -13
- package/dist/core/compare.js +2 -35
- package/dist/core/index.d.ts +3 -6
- package/dist/core/index.js +3 -6
- package/dist/core/query.d.ts +1 -1
- package/dist/core/rules.d.ts +30 -0
- package/dist/core/rules.js +194 -7
- package/dist/core/views/compare.d.ts +12 -0
- package/dist/core/views/compare.js +37 -0
- package/dist/core/{deployment-views.d.ts → views/deployment.d.ts} +4 -5
- package/dist/core/{deployment-views.js → views/deployment.js} +5 -7
- package/dist/core/{dynamic-views.d.ts → views/dynamic.d.ts} +1 -3
- package/dist/core/{dynamic-views.js → views/dynamic.js} +4 -8
- package/dist/core/views/generated.d.ts +18 -0
- package/dist/core/views/generated.js +92 -0
- package/dist/core/views/ids.d.ts +36 -0
- package/dist/core/views/ids.js +51 -0
- package/dist/core/views/index.d.ts +13 -0
- package/dist/core/views/index.js +12 -0
- package/dist/core/views/lens.d.ts +27 -0
- package/dist/core/views/lens.js +112 -0
- package/dist/core/views/model.d.ts +21 -0
- package/dist/core/views/model.js +69 -0
- package/dist/core/views/resolve.d.ts +42 -0
- package/dist/core/views/resolve.js +81 -0
- package/dist/core/{save-as-view.d.ts → views/save-as-view.d.ts} +2 -2
- package/dist/core/{save-as-view.js → views/save-as-view.js} +13 -10
- package/dist/core/{saved-views.d.ts → views/saved.d.ts} +4 -18
- package/dist/core/{saved-views.js → views/saved.js} +8 -103
- package/dist/core/views/types.d.ts +91 -0
- package/dist/core/views/types.js +2 -0
- package/dist/mcp/errors.d.ts +37 -0
- package/dist/mcp/errors.js +35 -0
- package/dist/mcp/index.d.ts +2 -1
- package/dist/mcp/index.js +1 -0
- package/dist/mcp/server.d.ts +1 -2
- package/dist/mcp/server.js +15 -13
- package/dist/mcp/writes.js +2 -1
- package/dist/render/font.d.ts +14 -8
- package/dist/render/font.js +11 -10
- package/dist/render/index.d.ts +1 -0
- package/dist/render/index.js +1 -0
- package/dist/render/layout.d.ts +20 -3
- package/dist/render/layout.js +49 -12
- package/dist/render/png.d.ts +1 -1
- package/dist/render/png.js +5 -5
- package/dist/render/sequence-svg.d.ts +8 -3
- package/dist/render/sequence-svg.js +32 -32
- package/dist/render/sequence.d.ts +1 -1
- package/dist/render/sequence.js +1 -1
- package/dist/render/svg.d.ts +19 -6
- package/dist/render/svg.js +148 -85
- package/dist/render/text.d.ts +6 -4
- package/dist/render/text.js +11 -9
- package/dist/render/tokens.d.ts +53 -0
- package/dist/render/tokens.js +71 -0
- package/dist/schema/adr.js +18 -13
- package/dist/schema/workspace.js +226 -130
- package/dist/viewer/assets/index-BXa5R96a.js +138 -0
- package/dist/viewer/assets/index-YFA-pYjQ.css +1 -0
- package/dist/viewer/assets/{layout.worker-Bg-OaLVN.js → layout.worker-BRHAGJrD.js} +1 -1
- package/dist/viewer/assets/{png-D1zzLB1s.js → png-CAaXWR-k.js} +1 -1
- package/dist/viewer/assets/svg-BPVHfD36.js +2 -0
- package/dist/viewer/index.html +2 -2
- package/guide/SKILL.md +1 -1
- package/guide/topics/bootstrap.md +1 -1
- package/guide/topics/relationships.md +1 -1
- package/package.json +20 -4
- package/schemas/adr.schema.json +18 -15
- package/schemas/model.schema.json +637 -1144
- package/schemas/project.schema.json +8 -4
- package/schemas/workspace.schema.json +39 -20
- package/dist/core/views.d.ts +0 -126
- package/dist/core/views.js +0 -217
- package/dist/viewer/assets/index-BwUCSYuf.js +0 -113
- package/dist/viewer/assets/index-DvKgCpBr.css +0 -1
- package/dist/viewer/assets/svg-Cw4FMsm3.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e,s as t}from"./index-
|
|
1
|
+
import{o as e,s as t}from"./index-BXa5R96a.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};
|
|
@@ -0,0 +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-BXa5R96a.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};
|
package/dist/viewer/index.html
CHANGED
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
});
|
|
45
45
|
})();
|
|
46
46
|
</script>
|
|
47
|
-
<script type="module" crossorigin src="./assets/index-
|
|
48
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
47
|
+
<script type="module" crossorigin src="./assets/index-BXa5R96a.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>
|
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
|
|
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
|
|
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
|
|
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,9 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "archidocs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Git-native architecture as code: check and bundle a Workspace of Projects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"homepage": "https://archidocs.dev",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/chalharb/archidocs.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/chalharb/archidocs/issues"
|
|
14
|
+
},
|
|
7
15
|
"bin": {
|
|
8
16
|
"archidocs": "dist/cli/main.js"
|
|
9
17
|
},
|
|
@@ -17,7 +25,7 @@
|
|
|
17
25
|
},
|
|
18
26
|
"scripts": {
|
|
19
27
|
"build": "tsc -p tsconfig.build.json && pnpm build:viewer",
|
|
20
|
-
"typecheck": "tsc --noEmit && tsc --noEmit -p viewer",
|
|
28
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p viewer && pnpm --dir website check",
|
|
21
29
|
"lint": "eslint .",
|
|
22
30
|
"test": "vitest run",
|
|
23
31
|
"test:watch": "vitest",
|
|
@@ -26,7 +34,14 @@
|
|
|
26
34
|
"build:viewer": "vite build --config viewer/vite.config.ts",
|
|
27
35
|
"test:e2e": "playwright test",
|
|
28
36
|
"dev": "pnpm build:viewer && node src/cli/main.ts dev --workspace \"${INIT_CWD:-.}\"",
|
|
29
|
-
"dev:viewer": "vite --config viewer/vite.config.ts"
|
|
37
|
+
"dev:viewer": "vite --config viewer/vite.config.ts",
|
|
38
|
+
"demo:big-bank": "pnpm build:viewer && node examples/big-bank/build-demo.mjs examples/big-bank/site",
|
|
39
|
+
"docs:dev": "pnpm build:viewer && pnpm --dir website dev",
|
|
40
|
+
"docs:build": "pnpm build:viewer && pnpm --dir website build",
|
|
41
|
+
"docs:test": "pnpm --dir website test",
|
|
42
|
+
"docs:tutorial": "pnpm build:viewer && node website/scripts/tutorial.ts",
|
|
43
|
+
"docs:quick-start": "pnpm build:viewer && node website/scripts/quick-start.ts",
|
|
44
|
+
"demo:kitchen-sink": "pnpm build:viewer && cd examples/kitchen-sink && node ../../src/cli/main.ts build --out site"
|
|
30
45
|
},
|
|
31
46
|
"dependencies": {
|
|
32
47
|
"@modelcontextprotocol/server": "^2.4.0",
|
|
@@ -56,7 +71,8 @@
|
|
|
56
71
|
"typescript": "^6.0.3",
|
|
57
72
|
"typescript-eslint": "^8.73.0",
|
|
58
73
|
"vite": "8.3.8",
|
|
59
|
-
"vitest": "^5.1.1"
|
|
74
|
+
"vitest": "^5.1.1",
|
|
75
|
+
"wrangler": "^4.167.0"
|
|
60
76
|
},
|
|
61
77
|
"packageManager": "pnpm@10.32.1"
|
|
62
78
|
}
|
package/schemas/adr.schema.json
CHANGED
|
@@ -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
|
}
|