dreamcontext 0.10.2 → 0.10.5
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/README.md +39 -5
- package/agents/curator-auditor.md +5 -0
- package/agents/dreamcontext-explore.md +5 -1
- package/agents/initializer-ingestor.md +1 -0
- package/agents/initializer-scout.md +5 -0
- package/agents/sleep-product.md +2 -0
- package/agents/sleep-tasks.md +7 -2
- package/dist/agents/curator-auditor.md +5 -0
- package/dist/agents/dreamcontext-explore.md +5 -1
- package/dist/agents/initializer-ingestor.md +1 -0
- package/dist/agents/initializer-scout.md +5 -0
- package/dist/agents/sleep-product.md +2 -0
- package/dist/agents/sleep-tasks.md +7 -2
- package/dist/dashboard/assets/{BrainCanvas3D-BuhjqMJE.js → BrainCanvas3D-8hG96aAi.js} +1 -1
- package/dist/dashboard/assets/{_baseUniq-BFywhIrF.js → _baseUniq-b4AibH2-.js} +1 -1
- package/dist/dashboard/assets/{ar-SA-G6X2FPQ2-0wtAtjf3.js → ar-SA-G6X2FPQ2-DpGPIe5Z.js} +1 -1
- package/dist/dashboard/assets/{arc-CbIZg0XW.js → arc-BHNPUsz3.js} +1 -1
- package/dist/dashboard/assets/{architectureDiagram-Q4EWVU46-DcA2m4dL.js → architectureDiagram-Q4EWVU46-IzEd_B2U.js} +1 -1
- package/dist/dashboard/assets/{az-AZ-76LH7QW2-DypXzn_9.js → az-AZ-76LH7QW2-Ccf6e1ON.js} +1 -1
- package/dist/dashboard/assets/{bg-BG-XCXSNQG7-DqjNOvWi.js → bg-BG-XCXSNQG7-XnDUjubv.js} +1 -1
- package/dist/dashboard/assets/{blockDiagram-DXYQGD6D-DGUYSkmu.js → blockDiagram-DXYQGD6D-CEINLAFi.js} +1 -1
- package/dist/dashboard/assets/{bn-BD-2XOGV67Q-DMT15vLO.js → bn-BD-2XOGV67Q-E9FzPBnu.js} +1 -1
- package/dist/dashboard/assets/{c4Diagram-AHTNJAMY-D0ureHL0.js → c4Diagram-AHTNJAMY-VrHpmy8U.js} +1 -1
- package/dist/dashboard/assets/{ca-ES-6MX7JW3Y-BIf8pakY.js → ca-ES-6MX7JW3Y-Cnp7YBQb.js} +1 -1
- package/dist/dashboard/assets/channel-DwaG7WPN.js +1 -0
- package/dist/dashboard/assets/{chunk-4BX2VUAB-BpMo9p3D.js → chunk-4BX2VUAB-CuueCQHq.js} +1 -1
- package/dist/dashboard/assets/{chunk-4TB4RGXK-BjWqEumI.js → chunk-4TB4RGXK-BhlZWQoi.js} +1 -1
- package/dist/dashboard/assets/{chunk-55IACEB6-CoREiws2.js → chunk-55IACEB6-ClixcVTq.js} +1 -1
- package/dist/dashboard/assets/{chunk-EDXVE4YY-DWGx8NFS.js → chunk-EDXVE4YY-DUj1uWsJ.js} +1 -1
- package/dist/dashboard/assets/{chunk-FMBD7UC4-BPHXOHEi.js → chunk-FMBD7UC4-BZClSbG6.js} +1 -1
- package/dist/dashboard/assets/{chunk-OYMX7WX6-Cg-AvRQR.js → chunk-OYMX7WX6-CMMXG2K9.js} +1 -1
- package/dist/dashboard/assets/{chunk-QZHKN3VN-oNBf0ZAT.js → chunk-QZHKN3VN-CI5x9wkp.js} +1 -1
- package/dist/dashboard/assets/{chunk-YZCP3GAM-BWTEULwI.js → chunk-YZCP3GAM-DnpOMFO-.js} +1 -1
- package/dist/dashboard/assets/classDiagram-6PBFFD2Q-COGCH4LQ.js +1 -0
- package/dist/dashboard/assets/classDiagram-v2-HSJHXN6E-COGCH4LQ.js +1 -0
- package/dist/dashboard/assets/clone-DwBiydth.js +1 -0
- package/dist/dashboard/assets/{cose-bilkent-S5V4N54A-CQAtltI5.js → cose-bilkent-S5V4N54A-C9xnvFgj.js} +1 -1
- package/dist/dashboard/assets/{cs-CZ-2BRQDIVT-sgLhn2uw.js → cs-CZ-2BRQDIVT-BHebgNbB.js} +1 -1
- package/dist/dashboard/assets/{da-DK-5WZEPLOC-56JnY0Ou.js → da-DK-5WZEPLOC-DYuNSWM8.js} +1 -1
- package/dist/dashboard/assets/{dagre-KV5264BT-Czzd8AFD.js → dagre-KV5264BT-Ck8mmM53.js} +1 -1
- package/dist/dashboard/assets/{de-DE-XR44H4JA-CLiIEbrn.js → de-DE-XR44H4JA-CMw5lMuT.js} +1 -1
- package/dist/dashboard/assets/{diagram-5BDNPKRD-BYQz4Ej0.js → diagram-5BDNPKRD-L4erno22.js} +1 -1
- package/dist/dashboard/assets/{diagram-G4DWMVQ6-Bi69CX9y.js → diagram-G4DWMVQ6-Dkmwa2-B.js} +1 -1
- package/dist/dashboard/assets/{diagram-MMDJMWI5-C9rH4USL.js → diagram-MMDJMWI5-v2PnfbZO.js} +1 -1
- package/dist/dashboard/assets/{diagram-TYMM5635-CtGy_47Q.js → diagram-TYMM5635-1ZO4tNjc.js} +1 -1
- package/dist/dashboard/assets/{el-GR-BZB4AONW-DLKTMVgu.js → el-GR-BZB4AONW-PXD8ArOs.js} +1 -1
- package/dist/dashboard/assets/{erDiagram-SMLLAGMA-DYwZiwiF.js → erDiagram-SMLLAGMA-B8gV0kGN.js} +1 -1
- package/dist/dashboard/assets/{es-ES-U4NZUMDT-B8vUZNzj.js → es-ES-U4NZUMDT-CbfskKe2.js} +1 -1
- package/dist/dashboard/assets/{eu-ES-A7QVB2H4-DOBpB_xM.js → eu-ES-A7QVB2H4-iqrfeyOI.js} +1 -1
- package/dist/dashboard/assets/{fa-IR-HGAKTJCU-BSo8AkJw.js → fa-IR-HGAKTJCU-PzU2OiC1.js} +1 -1
- package/dist/dashboard/assets/{fi-FI-Z5N7JZ37-IXouAsQf.js → fi-FI-Z5N7JZ37-CbFLdQ9f.js} +1 -1
- package/dist/dashboard/assets/{flowDiagram-DWJPFMVM-BfsdXM27.js → flowDiagram-DWJPFMVM-CKx3j3bI.js} +1 -1
- package/dist/dashboard/assets/{fr-FR-RHASNOE6-Bq41-iWY.js → fr-FR-RHASNOE6-BuF2MviY.js} +1 -1
- package/dist/dashboard/assets/{ganttDiagram-T4ZO3ILL-YFxSZdBo.js → ganttDiagram-T4ZO3ILL-CAbTd_KO.js} +1 -1
- package/dist/dashboard/assets/{gitGraphDiagram-UUTBAWPF-CzLILfBF.js → gitGraphDiagram-UUTBAWPF-Di7htCsA.js} +1 -1
- package/dist/dashboard/assets/{gl-ES-HMX3MZ6V-kuzaTFsC.js → gl-ES-HMX3MZ6V-BqePaODm.js} +1 -1
- package/dist/dashboard/assets/{graph-BOf2JBnY.js → graph-CC7SYwBm.js} +1 -1
- package/dist/dashboard/assets/{he-IL-6SHJWFNN-RQ2NxAvm.js → he-IL-6SHJWFNN-w9d4AvyL.js} +1 -1
- package/dist/dashboard/assets/{hi-IN-IWLTKZ5I-D9xTaaPK.js → hi-IN-IWLTKZ5I-BwHo17vR.js} +1 -1
- package/dist/dashboard/assets/{hu-HU-A5ZG7DT2-L1HNbSdl.js → hu-HU-A5ZG7DT2-Dm80xRge.js} +1 -1
- package/dist/dashboard/assets/{id-ID-SAP4L64H-B33X72Ml.js → id-ID-SAP4L64H-RpPM18i0.js} +1 -1
- package/dist/dashboard/assets/index-CkxvR2LH.css +32 -0
- package/dist/dashboard/assets/index-DalMBSek.js +511 -0
- package/dist/dashboard/assets/{index-B-6R-7Ot.js → index-sA_NxF_Y.js} +1 -1
- package/dist/dashboard/assets/{infoDiagram-42DDH7IO-DTWl9Wxm.js → infoDiagram-42DDH7IO-z-1I4Qyj.js} +1 -1
- package/dist/dashboard/assets/{ishikawaDiagram-UXIWVN3A-C0CAoNgB.js → ishikawaDiagram-UXIWVN3A-DWGoVsQO.js} +1 -1
- package/dist/dashboard/assets/{it-IT-JPQ66NNP-BK_HSf6M.js → it-IT-JPQ66NNP-DhOvhKWm.js} +1 -1
- package/dist/dashboard/assets/{ja-JP-DBVTYXUO-BRVQwLJ-.js → ja-JP-DBVTYXUO-CEZ1K0xn.js} +1 -1
- package/dist/dashboard/assets/{journeyDiagram-VCZTEJTY-CADHnY3u.js → journeyDiagram-VCZTEJTY-Dqh8uQwc.js} +1 -1
- package/dist/dashboard/assets/{kaa-6HZHGXH3-CYGgpUSe.js → kaa-6HZHGXH3-DuFoQ8nX.js} +1 -1
- package/dist/dashboard/assets/{kab-KAB-ZGHBKWFO-LMEkvoCj.js → kab-KAB-ZGHBKWFO-BkQCP_3o.js} +1 -1
- package/dist/dashboard/assets/{kanban-definition-6JOO6SKY-D1ijOIDj.js → kanban-definition-6JOO6SKY-DCs65HUc.js} +1 -1
- package/dist/dashboard/assets/{kk-KZ-P5N5QNE5-JIbh9_iv.js → kk-KZ-P5N5QNE5-Dh9BXA8_.js} +1 -1
- package/dist/dashboard/assets/{km-KH-HSX4SM5Z-CrWx5kgt.js → km-KH-HSX4SM5Z-D1S2EcQ_.js} +1 -1
- package/dist/dashboard/assets/{ko-KR-MTYHY66A-BQFjXlBC.js → ko-KR-MTYHY66A-DsI3vrEx.js} +1 -1
- package/dist/dashboard/assets/{ku-TR-6OUDTVRD-B6u43c-f.js → ku-TR-6OUDTVRD-CyjK_3XH.js} +1 -1
- package/dist/dashboard/assets/{layout-CVIUlzFz.js → layout-B_y9BOh6.js} +1 -1
- package/dist/dashboard/assets/{linear-TmytBUBH.js → linear-BdGSdQOc.js} +1 -1
- package/dist/dashboard/assets/{lt-LT-XHIRWOB4-b8AKF48V.js → lt-LT-XHIRWOB4-C6tJka1D.js} +1 -1
- package/dist/dashboard/assets/{lv-LV-5QDEKY6T-CRt75m7a.js → lv-LV-5QDEKY6T-C_xyL_ee.js} +1 -1
- package/dist/dashboard/assets/{min-CMOJsVTV.js → min-U_KGhNEt.js} +1 -1
- package/dist/dashboard/assets/{mindmap-definition-QFDTVHPH-DkzlAkBW.js → mindmap-definition-QFDTVHPH-sXmpEpKw.js} +1 -1
- package/dist/dashboard/assets/{mr-IN-CRQNXWMA-Bw3MaxMe.js → mr-IN-CRQNXWMA-C0TwGtAU.js} +1 -1
- package/dist/dashboard/assets/{my-MM-5M5IBNSE-Dw_tWZWl.js → my-MM-5M5IBNSE-RlAQCiXW.js} +1 -1
- package/dist/dashboard/assets/{nb-NO-T6EIAALU-Ci_2058Y.js → nb-NO-T6EIAALU-C1JHqr1t.js} +1 -1
- package/dist/dashboard/assets/{nl-NL-IS3SIHDZ-DYyqePg6.js → nl-NL-IS3SIHDZ-B0BVD_2p.js} +1 -1
- package/dist/dashboard/assets/{nn-NO-6E72VCQL-NdjykAxN.js → nn-NO-6E72VCQL-zQTko94P.js} +1 -1
- package/dist/dashboard/assets/{oc-FR-POXYY2M6-DPEyc6hx.js → oc-FR-POXYY2M6-CBZRg6ku.js} +1 -1
- package/dist/dashboard/assets/{pa-IN-N4M65BXN-D_4V8i72.js → pa-IN-N4M65BXN-7s6qpn6h.js} +1 -1
- package/dist/dashboard/assets/{percentages-BXMCSKIN-4Hgy5SgQ.js → percentages-BXMCSKIN-DckRvLSG.js} +7 -7
- package/dist/dashboard/assets/{pica-D6rAZEqu.js → pica-ByOjSUxE.js} +1 -1
- package/dist/dashboard/assets/{pieDiagram-DEJITSTG-BqsalDEv.js → pieDiagram-DEJITSTG-BJJsFOH9.js} +1 -1
- package/dist/dashboard/assets/{pl-PL-T2D74RX3-CArl0OSe.js → pl-PL-T2D74RX3-QTzNyi10.js} +1 -1
- package/dist/dashboard/assets/{pt-BR-5N22H2LF-BlA9u7zY.js → pt-BR-5N22H2LF-tntUlote.js} +1 -1
- package/dist/dashboard/assets/{pt-PT-UZXXM6DQ-ByCcYKU2.js → pt-PT-UZXXM6DQ-B9M5aHl1.js} +1 -1
- package/dist/dashboard/assets/{quadrantDiagram-34T5L4WZ-BtnExwNB.js → quadrantDiagram-34T5L4WZ-BearsU1w.js} +1 -1
- package/dist/dashboard/assets/{requirementDiagram-MS252O5E-jDWYOtpC.js → requirementDiagram-MS252O5E-BixosHER.js} +1 -1
- package/dist/dashboard/assets/{ro-RO-JPDTUUEW-CafHxA38.js → ro-RO-JPDTUUEW-qbgXrb57.js} +1 -1
- package/dist/dashboard/assets/{ru-RU-B4JR7IUQ-BbJGwp-Z.js → ru-RU-B4JR7IUQ-CgX4A1Ib.js} +1 -1
- package/dist/dashboard/assets/{sankeyDiagram-XADWPNL6-BSU4w3_8.js → sankeyDiagram-XADWPNL6-DMSd55sU.js} +1 -1
- package/dist/dashboard/assets/{sequenceDiagram-FGHM5R23-DBHLScxa.js → sequenceDiagram-FGHM5R23-D2-Uwrtb.js} +1 -1
- package/dist/dashboard/assets/{si-LK-N5RQ5JYF-eDB0s9B0.js → si-LK-N5RQ5JYF-CWEkBvJB.js} +1 -1
- package/dist/dashboard/assets/{sk-SK-C5VTKIMK-qaYN0zkE.js → sk-SK-C5VTKIMK-CG8moyh9.js} +1 -1
- package/dist/dashboard/assets/{sl-SI-NN7IZMDC-BQ4pcyGF.js → sl-SI-NN7IZMDC-CsBFEfKt.js} +1 -1
- package/dist/dashboard/assets/{stateDiagram-FHFEXIEX-DqLkK6dC.js → stateDiagram-FHFEXIEX-vG3jGBpo.js} +1 -1
- package/dist/dashboard/assets/stateDiagram-v2-QKLJ7IA2-V8xCsZlI.js +1 -0
- package/dist/dashboard/assets/{subset-shared.chunk-Hm_CkSQB.js → subset-shared.chunk-Bin8VoC6.js} +1 -1
- package/dist/dashboard/assets/{subset-worker.chunk-YczznLkp.js → subset-worker.chunk-mRsEjVpS.js} +1 -1
- package/dist/dashboard/assets/{sv-SE-XGPEYMSR-DD7_8pqE.js → sv-SE-XGPEYMSR-BMD7GbQV.js} +1 -1
- package/dist/dashboard/assets/{ta-IN-2NMHFXQM-Dd-RFvWz.js → ta-IN-2NMHFXQM-CjZ7GPuA.js} +1 -1
- package/dist/dashboard/assets/{th-TH-HPSO5L25-C7x2tZrZ.js → th-TH-HPSO5L25-BTE57yWh.js} +1 -1
- package/dist/dashboard/assets/{timeline-definition-GMOUNBTQ-DILCBtIX.js → timeline-definition-GMOUNBTQ-Bz7MuXCz.js} +1 -1
- package/dist/dashboard/assets/{tr-TR-DEFEU3FU-BXDs1FJQ.js → tr-TR-DEFEU3FU-CKY-uY5_.js} +1 -1
- package/dist/dashboard/assets/{uk-UA-QMV73CPH-Bp-yEHOn.js → uk-UA-QMV73CPH-BuopbANh.js} +1 -1
- package/dist/dashboard/assets/{vennDiagram-DHZGUBPP-CnQH3XJu.js → vennDiagram-DHZGUBPP-TsesBmH7.js} +1 -1
- package/dist/dashboard/assets/{vi-VN-M7AON7JQ-DQOsitU7.js → vi-VN-M7AON7JQ-CLrvMDM6.js} +1 -1
- package/dist/dashboard/assets/{wardley-RL74JXVD-FdX4RiE_.js → wardley-RL74JXVD-DlttwW9K.js} +1 -1
- package/dist/dashboard/assets/{wardleyDiagram-NUSXRM2D-CK4rbC5W.js → wardleyDiagram-NUSXRM2D-BfZXChhy.js} +1 -1
- package/dist/dashboard/assets/{xychartDiagram-5P7HB3ND-B6UGr9Rl.js → xychartDiagram-5P7HB3ND-jjeDn8EJ.js} +1 -1
- package/dist/dashboard/assets/{zh-CN-LNUGB5OW-BMYbdc2b.js → zh-CN-LNUGB5OW-C1MYPzyx.js} +1 -1
- package/dist/dashboard/assets/{zh-HK-E62DVLB3-CCcVgqN7.js → zh-HK-E62DVLB3-BriaHjNV.js} +1 -1
- package/dist/dashboard/assets/{zh-TW-RAJ6MFWO-C52SJlwU.js → zh-TW-RAJ6MFWO-BUDimtjA.js} +1 -1
- package/dist/dashboard/index.html +3 -3
- package/dist/index.js +2586 -1065
- package/dist/skill-packs/excalidraw/SKILL.md +19 -1
- package/dist/skill-packs/excalidraw/scripts/build_excalidraw.js +47 -8
- package/dist/skill-packs/excalidraw/scripts/lib/style.js +111 -21
- package/dist/skill-packs/goal-skill/SKILL.md +6 -0
- package/package.json +1 -1
- package/skill/SKILL.md +8 -3
- package/skill/references/cli-reference.md +20 -2
- package/skill/references/knowledge-and-recall.md +1 -0
- package/skill/references/sleep.md +6 -5
- package/skill/references/tasks-and-features.md +37 -0
- package/skill-packs/excalidraw/SKILL.md +19 -1
- package/skill-packs/excalidraw/scripts/build_excalidraw.js +47 -8
- package/skill-packs/excalidraw/scripts/lib/style.js +111 -21
- package/skill-packs/goal-skill/SKILL.md +6 -0
- package/dist/dashboard/assets/channel-C5uBjxRg.js +0 -1
- package/dist/dashboard/assets/classDiagram-6PBFFD2Q-MwUwKREr.js +0 -1
- package/dist/dashboard/assets/classDiagram-v2-HSJHXN6E-MwUwKREr.js +0 -1
- package/dist/dashboard/assets/clone-CcQlDA5C.js +0 -1
- package/dist/dashboard/assets/index--chDvBkZ.css +0 -32
- package/dist/dashboard/assets/index-CwZ3YweD.js +0 -582
- package/dist/dashboard/assets/stateDiagram-v2-QKLJ7IA2-TpuacwBg.js +0 -1
|
@@ -23,30 +23,112 @@ function pal(c) { return PALETTE[c] || { fill: c, stroke: INK }; }
|
|
|
23
23
|
let _gc = 0;
|
|
24
24
|
const newGroup = (hint) => `g${++_gc}-${hint || ''}`;
|
|
25
25
|
const lines = (t) => String(t).split('\n').length;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
|
|
27
|
+
// --- text fitting --------------------------------------------------------
|
|
28
|
+
// Excalifont glyph advance, in multiples of fontSize. Latin is ~0.58; emoji, arrows, CJK and
|
|
29
|
+
// combining marks render roughly square (~1.05) — the old flat 0.52 under-counted them, so wide
|
|
30
|
+
// labels measured narrow and spilled out of their card. Mirrored in build_excalidraw.js sizeText().
|
|
31
|
+
function isWideGlyph(code) {
|
|
32
|
+
return (
|
|
33
|
+
(code >= 0x1100 && code <= 0x115f) || // Hangul Jamo
|
|
34
|
+
(code >= 0x2190 && code <= 0x21ff) || // arrows
|
|
35
|
+
(code >= 0x2300 && code <= 0x23ff) || // misc technical (⏰ ⏳ …)
|
|
36
|
+
(code >= 0x25a0 && code <= 0x27bf) || // geometric shapes, misc symbols, dingbats (✅ ★ …)
|
|
37
|
+
(code >= 0x2b00 && code <= 0x2bff) || // extra arrows / symbols
|
|
38
|
+
(code >= 0x2e80 && code <= 0x9fff) || // CJK radicals … unified ideographs
|
|
39
|
+
(code >= 0xac00 && code <= 0xd7a3) || // Hangul syllables
|
|
40
|
+
(code >= 0xf900 && code <= 0xfaff) || // CJK compatibility ideographs
|
|
41
|
+
(code >= 0xfe30 && code <= 0xfe4f) || // CJK compatibility forms
|
|
42
|
+
(code >= 0xff00 && code <= 0xff60) || // fullwidth forms
|
|
43
|
+
(code >= 0x1f000 && code <= 0x1faff) || // emoji & pictographs
|
|
44
|
+
(code >= 0x1f1e6 && code <= 0x1f1ff) // regional indicators (flags)
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
function glyphW(ch, fontSize) { return fontSize * (isWideGlyph(ch.codePointAt(0)) ? 1.05 : 0.58); }
|
|
48
|
+
function measureText(s, fontSize) { let w = 0; for (const ch of String(s)) w += glyphW(ch, fontSize); return w; }
|
|
49
|
+
|
|
50
|
+
// Greedy word-wrap to a pixel width, honoring existing \n and HARD-breaking any single word that is
|
|
51
|
+
// itself wider than the box (e.g. a long URL). Returns the text WITH the newlines baked in — the
|
|
52
|
+
// Obsidian plugin keeps them instead of re-flowing the label into one over-wide centered line.
|
|
53
|
+
function wrapToWidth(text, fontSize, width) {
|
|
54
|
+
const out = [];
|
|
55
|
+
for (const logical of String(text).split('\n')) {
|
|
56
|
+
const words = logical.split(/\s+/).filter(Boolean);
|
|
57
|
+
if (!words.length) { out.push(''); continue; }
|
|
58
|
+
let cur = '';
|
|
59
|
+
for (let word of words) {
|
|
60
|
+
while (measureText(word, fontSize) > width) {
|
|
61
|
+
let acc = '';
|
|
62
|
+
for (const ch of word) {
|
|
63
|
+
if (acc && measureText(acc + ch, fontSize) > width) break;
|
|
64
|
+
acc += ch;
|
|
65
|
+
}
|
|
66
|
+
if (cur) { out.push(cur); cur = ''; }
|
|
67
|
+
out.push(acc);
|
|
68
|
+
word = word.slice(acc.length);
|
|
69
|
+
if (!word) break;
|
|
70
|
+
}
|
|
71
|
+
if (!word) continue;
|
|
72
|
+
const candidate = cur ? cur + ' ' + word : word;
|
|
73
|
+
if (cur && measureText(candidate, fontSize) > width) { out.push(cur); cur = word; }
|
|
74
|
+
else cur = candidate;
|
|
75
|
+
}
|
|
76
|
+
if (cur) out.push(cur);
|
|
77
|
+
}
|
|
78
|
+
return out.join('\n');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const _warned = new Set();
|
|
82
|
+
function warnFit(msg) { if (!_warned.has(msg)) { _warned.add(msg); try { console.warn('[excalidraw] ' + msg); } catch (e) {} } }
|
|
83
|
+
|
|
84
|
+
// Wrap `text` to the card's inner width, then shrink the font (down to minFont) until the wrapped
|
|
85
|
+
// label also fits the card height. Returns { text (with baked-in newlines), fontSize, lineCount, fits }.
|
|
86
|
+
function fitText(o) {
|
|
87
|
+
const { text = '', w = 260, h = 92, fontSize = 20, minFont = 9, lineHeight = 1.25, padX = 10, padY = 8 } = o;
|
|
88
|
+
const innerW = Math.max(1, w - 2 * padX);
|
|
89
|
+
const innerH = Math.max(1, h - 2 * padY);
|
|
90
|
+
let fs = Math.max(minFont, Math.round(fontSize));
|
|
91
|
+
let wrapped = wrapToWidth(text, fs, innerW);
|
|
92
|
+
let lineCount = wrapped.split('\n').length;
|
|
93
|
+
while (fs > minFont && lineCount * fs * lineHeight > innerH) {
|
|
94
|
+
fs -= 1;
|
|
95
|
+
wrapped = wrapToWidth(text, fs, innerW);
|
|
96
|
+
lineCount = wrapped.split('\n').length;
|
|
97
|
+
}
|
|
98
|
+
return { text: wrapped, fontSize: fs, lineCount, fits: lineCount * fs * lineHeight <= innerH };
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// arc-length midpoint of a polyline — keeps a connector label on the line even when it elbows
|
|
102
|
+
function polyMid(pts) {
|
|
103
|
+
if (!pts || pts.length < 2) return (pts && pts[0]) || [0, 0];
|
|
104
|
+
const seg = [];
|
|
29
105
|
let total = 0;
|
|
30
|
-
for (const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
106
|
+
for (let i = 1; i < pts.length; i++) { const l = Math.hypot(pts[i][0] - pts[i - 1][0], pts[i][1] - pts[i - 1][1]); seg.push(l); total += l; }
|
|
107
|
+
let half = total / 2;
|
|
108
|
+
for (let i = 1; i < pts.length; i++) {
|
|
109
|
+
if (half <= seg[i - 1] || i === pts.length - 1) {
|
|
110
|
+
const t = seg[i - 1] ? half / seg[i - 1] : 0;
|
|
111
|
+
return [pts[i - 1][0] + (pts[i][0] - pts[i - 1][0]) * t, pts[i - 1][1] + (pts[i][1] - pts[i - 1][1]) * t];
|
|
112
|
+
}
|
|
113
|
+
half -= seg[i - 1];
|
|
36
114
|
}
|
|
37
|
-
return
|
|
115
|
+
return pts[0];
|
|
38
116
|
}
|
|
39
117
|
|
|
40
|
-
// rounded card: filled rect + centered label, grouped so they move together
|
|
118
|
+
// rounded card: filled rect + centered label, grouped so they move together. The label is
|
|
119
|
+
// hard-wrapped to the card width and the font auto-shrinks (to `minFont`) until it also fits the
|
|
120
|
+
// height, so text can never spill outside the box. Warns if even the floor font won't fit.
|
|
41
121
|
function card(o) {
|
|
42
|
-
const { x, y, w = 260, h = 92, text = '', color = 'blue', fontSize = 20, stroke = INK, strokeWidth = 2, textColor = INK, roundness = true } = o;
|
|
122
|
+
const { x, y, w = 260, h = 92, text = '', color = 'blue', fontSize = 20, stroke = INK, strokeWidth = 2, textColor = INK, roundness = true, minFont = 9, padX = 10, padY = 8 } = o;
|
|
43
123
|
const group = o.group || newGroup('card');
|
|
44
124
|
const p = pal(color);
|
|
45
|
-
const
|
|
46
|
-
|
|
125
|
+
const fit = fitText({ text, w, h, fontSize, minFont, padX, padY });
|
|
126
|
+
if (!fit.fits) warnFit(`label ${JSON.stringify(String(text).slice(0, 32))} won't fit a ${w}×${h} card even at ${minFont}px — enlarge the card or shorten the text.`);
|
|
127
|
+
const textH = fit.lineCount * fit.fontSize * 1.25;
|
|
128
|
+
const ty = y + Math.max(padY, (h - textH) / 2);
|
|
47
129
|
return [
|
|
48
130
|
{ type: 'rectangle', x, y, width: w, height: h, strokeColor: stroke, backgroundColor: p.fill, fillStyle: 'solid', strokeWidth, roundness, group },
|
|
49
|
-
{ type: 'text', x, y: ty, text, fontSize, color: textColor, width: w, align: 'center', fontFamily: 5, group },
|
|
131
|
+
{ type: 'text', x, y: ty, text: fit.text, fontSize: fit.fontSize, color: textColor, width: w, align: 'center', fontFamily: 5, group },
|
|
50
132
|
];
|
|
51
133
|
}
|
|
52
134
|
// small node (flow step) — card with tighter defaults
|
|
@@ -58,13 +140,21 @@ function sectionTitle(o) {
|
|
|
58
140
|
return [{ type: 'text', x, y, text, fontSize, color, fontFamily: 5, width: Math.max(200, String(text).length * fontSize * 0.6) }];
|
|
59
141
|
}
|
|
60
142
|
|
|
61
|
-
// labeled connector arrow between two points (centers of cards, etc.)
|
|
143
|
+
// labeled connector arrow between two points (centers of cards, etc.).
|
|
144
|
+
// Routing: pass `via:[[x,y],…]` for explicit waypoints, or `elbow:'hv'|'vh'` for an auto right-angle
|
|
145
|
+
// bend ('hv' = horizontal then vertical, 'vh' = vertical then horizontal). Use these to route a link
|
|
146
|
+
// AROUND intervening boxes instead of cutting a diagonal straight through them.
|
|
62
147
|
function connector(o) {
|
|
63
|
-
const { from, to, label, double = false, strokeColor = INK, strokeWidth = 2, dashed = false, labelColor = '#495057', fontSize = 16 } = o;
|
|
64
|
-
|
|
148
|
+
const { from, to, label, double = false, strokeColor = INK, strokeWidth = 2, dashed = false, labelColor = '#495057', fontSize = 16, via = null, elbow = null } = o;
|
|
149
|
+
let pts;
|
|
150
|
+
if (via && via.length) pts = [from, ...via, to];
|
|
151
|
+
else if (elbow === 'hv') pts = [from, [to[0], from[1]], to];
|
|
152
|
+
else if (elbow === 'vh') pts = [from, [from[0], to[1]], to];
|
|
153
|
+
else pts = [from, to];
|
|
154
|
+
const out = [{ type: 'arrow', points: pts, strokeColor, strokeWidth, strokeStyle: dashed ? 'dashed' : 'solid', endArrow: 'arrow', startArrow: double ? 'arrow' : null }];
|
|
65
155
|
if (label) {
|
|
66
|
-
const mx
|
|
67
|
-
const w = Math.max(40, String(label)
|
|
156
|
+
const [mx, my] = polyMid(pts);
|
|
157
|
+
const w = Math.max(40, measureText(String(label), fontSize) + fontSize);
|
|
68
158
|
out.push({ type: 'text', x: mx - w / 2, y: my - fontSize - 4, text: label, fontSize, color: labelColor, width: w, align: 'center', fontFamily: 5 });
|
|
69
159
|
}
|
|
70
160
|
return out;
|
|
@@ -127,4 +217,4 @@ const leftOf = (x, y, w, h) => [x, y + h / 2];
|
|
|
127
217
|
const bottomOf = (x, y, w, h) => [x + w / 2, y + h];
|
|
128
218
|
const topOf = (x, y, w, h) => [x + w / 2, y];
|
|
129
219
|
|
|
130
|
-
module.exports = { INK, PALETTE, pal, card, node, sectionTitle, connector, annotate, column, hub, bullets, center, rightOf, leftOf, bottomOf, topOf };
|
|
220
|
+
module.exports = { INK, PALETTE, pal, card, node, sectionTitle, connector, annotate, column, hub, bullets, fitText, measureText, center, rightOf, leftOf, bottomOf, topOf };
|
|
@@ -122,6 +122,12 @@ dreamcontext tasks status <slug> in_progress "plan validated; implementing"
|
|
|
122
122
|
|
|
123
123
|
If `<slug>` already exists, de-collide (append a short suffix) rather than clobbering.
|
|
124
124
|
|
|
125
|
+
If the project has **roadmap objectives** (`_dream_context/core/objectives/` non-empty — they appear
|
|
126
|
+
in your snapshot), link the task to the objective(s) this goal serves: `tasks create --objectives a,b`
|
|
127
|
+
(or `dreamcontext tasks objectives <slug> a,b` after). One goal often serves several objectives —
|
|
128
|
+
that's expected. If unsure which, ask the user in Phase 0; never leave an obviously-serving task
|
|
129
|
+
unlinked, and never overwrite an existing non-empty `objectives:` list.
|
|
130
|
+
|
|
125
131
|
If the project declares **custom task fields** (`_dream_context/overrides/task.md`), `tasks create`
|
|
126
132
|
hard-fails (exit 1) on an unset `required` field — set each with `--field key=value` on create. For
|
|
127
133
|
any field marked `ask: true`, ask the user for the value back in Phase 0 (it's a human judgment) rather
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aq as o,ar as n}from"./index-CwZ3YweD.js";const t=(r,a)=>o.lang.round(n.parse(r)[a]);export{t as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-4TB4RGXK-BjWqEumI.js";import{_ as i}from"./index-CwZ3YweD.js";import"./chunk-FMBD7UC4-BPHXOHEi.js";import"./chunk-YZCP3GAM-BWTEULwI.js";import"./chunk-55IACEB6-CoREiws2.js";import"./chunk-EDXVE4YY-DWGx8NFS.js";var u={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{u as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-4TB4RGXK-BjWqEumI.js";import{_ as i}from"./index-CwZ3YweD.js";import"./chunk-FMBD7UC4-BPHXOHEi.js";import"./chunk-YZCP3GAM-BWTEULwI.js";import"./chunk-55IACEB6-CoREiws2.js";import"./chunk-EDXVE4YY-DWGx8NFS.js";var u={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{u as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as r}from"./graph-BOf2JBnY.js";var e=4;function a(o){return r(o,e)}export{a as c};
|