@cotrrackpro-dev/sdk 0.1.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.
Files changed (233) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/LICENSE +21 -0
  3. package/README.md +111 -0
  4. package/dist/assistant/compliance.d.ts +24 -0
  5. package/dist/assistant/compliance.js +60 -0
  6. package/dist/assistant/compliance.js.map +1 -0
  7. package/dist/assistant/crisis.d.ts +31 -0
  8. package/dist/assistant/crisis.js +62 -0
  9. package/dist/assistant/crisis.js.map +1 -0
  10. package/dist/assistant/index.d.ts +15 -0
  11. package/dist/assistant/index.js +16 -0
  12. package/dist/assistant/index.js.map +1 -0
  13. package/dist/assistant/levels.d.ts +43 -0
  14. package/dist/assistant/levels.js +102 -0
  15. package/dist/assistant/levels.js.map +1 -0
  16. package/dist/assistant/prompt.d.ts +20 -0
  17. package/dist/assistant/prompt.js +96 -0
  18. package/dist/assistant/prompt.js.map +1 -0
  19. package/dist/assistant/rbac.d.ts +45 -0
  20. package/dist/assistant/rbac.js +75 -0
  21. package/dist/assistant/rbac.js.map +1 -0
  22. package/dist/assistant/readability.d.ts +28 -0
  23. package/dist/assistant/readability.js +70 -0
  24. package/dist/assistant/readability.js.map +1 -0
  25. package/dist/auth/broker.d.ts +32 -0
  26. package/dist/auth/broker.js +48 -0
  27. package/dist/auth/broker.js.map +1 -0
  28. package/dist/auth/deviceFlow.d.ts +26 -0
  29. package/dist/auth/deviceFlow.js +65 -0
  30. package/dist/auth/deviceFlow.js.map +1 -0
  31. package/dist/auth/provider.d.ts +32 -0
  32. package/dist/auth/provider.js +29 -0
  33. package/dist/auth/provider.js.map +1 -0
  34. package/dist/community/badges.d.ts +19 -0
  35. package/dist/community/badges.js +19 -0
  36. package/dist/community/badges.js.map +1 -0
  37. package/dist/community/events.d.ts +30 -0
  38. package/dist/community/events.js +31 -0
  39. package/dist/community/events.js.map +1 -0
  40. package/dist/community/identity.d.ts +28 -0
  41. package/dist/community/identity.js +2 -0
  42. package/dist/community/identity.js.map +1 -0
  43. package/dist/community/index.d.ts +7 -0
  44. package/dist/community/index.js +8 -0
  45. package/dist/community/index.js.map +1 -0
  46. package/dist/community/org.d.ts +46 -0
  47. package/dist/community/org.js +32 -0
  48. package/dist/community/org.js.map +1 -0
  49. package/dist/community/tiers.d.ts +8 -0
  50. package/dist/community/tiers.js +40 -0
  51. package/dist/community/tiers.js.map +1 -0
  52. package/dist/community/types.d.ts +26 -0
  53. package/dist/community/types.js +2 -0
  54. package/dist/community/types.js.map +1 -0
  55. package/dist/core/config.d.ts +22 -0
  56. package/dist/core/config.js +27 -0
  57. package/dist/core/config.js.map +1 -0
  58. package/dist/core/errors.d.ts +29 -0
  59. package/dist/core/errors.js +20 -0
  60. package/dist/core/errors.js.map +1 -0
  61. package/dist/core/transport.d.ts +45 -0
  62. package/dist/core/transport.js +109 -0
  63. package/dist/core/transport.js.map +1 -0
  64. package/dist/diagram/core.d.ts +11 -0
  65. package/dist/diagram/core.js +12 -0
  66. package/dist/diagram/core.js.map +1 -0
  67. package/dist/diagram/extract.d.ts +17 -0
  68. package/dist/diagram/extract.js +213 -0
  69. package/dist/diagram/extract.js.map +1 -0
  70. package/dist/diagram/index.d.ts +2 -0
  71. package/dist/diagram/index.js +3 -0
  72. package/dist/diagram/index.js.map +1 -0
  73. package/dist/diagram/mermaid.d.ts +10 -0
  74. package/dist/diagram/mermaid.js +50 -0
  75. package/dist/diagram/mermaid.js.map +1 -0
  76. package/dist/diagram/prompt.d.ts +4 -0
  77. package/dist/diagram/prompt.js +16 -0
  78. package/dist/diagram/prompt.js.map +1 -0
  79. package/dist/diagram/types.d.ts +33 -0
  80. package/dist/diagram/types.js +2 -0
  81. package/dist/diagram/types.js.map +1 -0
  82. package/dist/diagram/validate.d.ts +13 -0
  83. package/dist/diagram/validate.js +48 -0
  84. package/dist/diagram/validate.js.map +1 -0
  85. package/dist/guide/compose.d.ts +10 -0
  86. package/dist/guide/compose.js +31 -0
  87. package/dist/guide/compose.js.map +1 -0
  88. package/dist/guide/core.d.ts +10 -0
  89. package/dist/guide/core.js +11 -0
  90. package/dist/guide/core.js.map +1 -0
  91. package/dist/guide/index.d.ts +2 -0
  92. package/dist/guide/index.js +3 -0
  93. package/dist/guide/index.js.map +1 -0
  94. package/dist/guide/prompt.d.ts +8 -0
  95. package/dist/guide/prompt.js +20 -0
  96. package/dist/guide/prompt.js.map +1 -0
  97. package/dist/guide/render.d.ts +9 -0
  98. package/dist/guide/render.js +180 -0
  99. package/dist/guide/render.js.map +1 -0
  100. package/dist/guide/types.d.ts +67 -0
  101. package/dist/guide/types.js +2 -0
  102. package/dist/guide/types.js.map +1 -0
  103. package/dist/index.d.ts +18 -0
  104. package/dist/index.js +19 -0
  105. package/dist/index.js.map +1 -0
  106. package/dist/mcp/artifacts.generated.d.ts +19 -0
  107. package/dist/mcp/artifacts.generated.js +140 -0
  108. package/dist/mcp/artifacts.generated.js.map +1 -0
  109. package/dist/mcp/format.d.ts +10 -0
  110. package/dist/mcp/format.js +17 -0
  111. package/dist/mcp/format.js.map +1 -0
  112. package/dist/mcp/index.d.ts +12 -0
  113. package/dist/mcp/index.js +18 -0
  114. package/dist/mcp/index.js.map +1 -0
  115. package/dist/mcp/knowledge.generated.d.ts +11 -0
  116. package/dist/mcp/knowledge.generated.js +12 -0
  117. package/dist/mcp/knowledge.generated.js.map +1 -0
  118. package/dist/mcp/prompt-modules.generated.d.ts +12 -0
  119. package/dist/mcp/prompt-modules.generated.js +19 -0
  120. package/dist/mcp/prompt-modules.generated.js.map +1 -0
  121. package/dist/mcp/roles.generated.d.ts +15 -0
  122. package/dist/mcp/roles.generated.js +25 -0
  123. package/dist/mcp/roles.generated.js.map +1 -0
  124. package/dist/mcp/safety.d.ts +35 -0
  125. package/dist/mcp/safety.js +76 -0
  126. package/dist/mcp/safety.js.map +1 -0
  127. package/dist/mcp/scenarios.generated.d.ts +13 -0
  128. package/dist/mcp/scenarios.generated.js +16 -0
  129. package/dist/mcp/scenarios.generated.js.map +1 -0
  130. package/dist/mcp/search.d.ts +13 -0
  131. package/dist/mcp/search.js +33 -0
  132. package/dist/mcp/search.js.map +1 -0
  133. package/dist/mcp/skills.generated.d.ts +17 -0
  134. package/dist/mcp/skills.generated.js +40 -0
  135. package/dist/mcp/skills.generated.js.map +1 -0
  136. package/dist/mcp/toolset.d.ts +31 -0
  137. package/dist/mcp/toolset.js +54 -0
  138. package/dist/mcp/toolset.js.map +1 -0
  139. package/dist/mcp/types.d.ts +96 -0
  140. package/dist/mcp/types.js +9 -0
  141. package/dist/mcp/types.js.map +1 -0
  142. package/dist/mcp/workflows.generated.d.ts +17 -0
  143. package/dist/mcp/workflows.generated.js +12 -0
  144. package/dist/mcp/workflows.generated.js.map +1 -0
  145. package/dist/nocode/core.d.ts +12 -0
  146. package/dist/nocode/core.js +13 -0
  147. package/dist/nocode/core.js.map +1 -0
  148. package/dist/nocode/examples.d.ts +28 -0
  149. package/dist/nocode/examples.js +218 -0
  150. package/dist/nocode/examples.js.map +1 -0
  151. package/dist/nocode/index.d.ts +2 -0
  152. package/dist/nocode/index.js +3 -0
  153. package/dist/nocode/index.js.map +1 -0
  154. package/dist/nocode/mermaid.d.ts +9 -0
  155. package/dist/nocode/mermaid.js +33 -0
  156. package/dist/nocode/mermaid.js.map +1 -0
  157. package/dist/nocode/prompt.d.ts +8 -0
  158. package/dist/nocode/prompt.js +46 -0
  159. package/dist/nocode/prompt.js.map +1 -0
  160. package/dist/nocode/runtime.d.ts +28 -0
  161. package/dist/nocode/runtime.js +113 -0
  162. package/dist/nocode/runtime.js.map +1 -0
  163. package/dist/nocode/simpleOps.d.ts +16 -0
  164. package/dist/nocode/simpleOps.js +137 -0
  165. package/dist/nocode/simpleOps.js.map +1 -0
  166. package/dist/nocode/types.d.ts +72 -0
  167. package/dist/nocode/types.js +12 -0
  168. package/dist/nocode/types.js.map +1 -0
  169. package/dist/nocode/validate.d.ts +17 -0
  170. package/dist/nocode/validate.js +136 -0
  171. package/dist/nocode/validate.js.map +1 -0
  172. package/dist/params/codegen.d.ts +8 -0
  173. package/dist/params/codegen.js +12 -0
  174. package/dist/params/codegen.js.map +1 -0
  175. package/dist/params/convert.d.ts +7 -0
  176. package/dist/params/convert.js +123 -0
  177. package/dist/params/convert.js.map +1 -0
  178. package/dist/params/core.d.ts +11 -0
  179. package/dist/params/core.js +12 -0
  180. package/dist/params/core.js.map +1 -0
  181. package/dist/params/fieldTypes.d.ts +26 -0
  182. package/dist/params/fieldTypes.js +29 -0
  183. package/dist/params/fieldTypes.js.map +1 -0
  184. package/dist/params/index.d.ts +3 -0
  185. package/dist/params/index.js +4 -0
  186. package/dist/params/index.js.map +1 -0
  187. package/dist/params/prompt.d.ts +4 -0
  188. package/dist/params/prompt.js +16 -0
  189. package/dist/params/prompt.js.map +1 -0
  190. package/dist/params/render.d.ts +5 -0
  191. package/dist/params/render.js +25 -0
  192. package/dist/params/render.js.map +1 -0
  193. package/dist/params/types.d.ts +76 -0
  194. package/dist/params/types.js +16 -0
  195. package/dist/params/types.js.map +1 -0
  196. package/dist/params/validate.d.ts +5 -0
  197. package/dist/params/validate.js +104 -0
  198. package/dist/params/validate.js.map +1 -0
  199. package/dist/resources/client.d.ts +58 -0
  200. package/dist/resources/client.js +79 -0
  201. package/dist/resources/client.js.map +1 -0
  202. package/dist/resources/types.d.ts +72 -0
  203. package/dist/resources/types.js +9 -0
  204. package/dist/resources/types.js.map +1 -0
  205. package/dist/workflow/assets.d.ts +8 -0
  206. package/dist/workflow/assets.js +16 -0
  207. package/dist/workflow/assets.js.map +1 -0
  208. package/dist/workflow/commands.d.ts +10 -0
  209. package/dist/workflow/commands.js +21 -0
  210. package/dist/workflow/commands.js.map +1 -0
  211. package/dist/workflow/core.d.ts +15 -0
  212. package/dist/workflow/core.js +16 -0
  213. package/dist/workflow/core.js.map +1 -0
  214. package/dist/workflow/index.d.ts +2 -0
  215. package/dist/workflow/index.js +3 -0
  216. package/dist/workflow/index.js.map +1 -0
  217. package/dist/workflow/stack.d.ts +11 -0
  218. package/dist/workflow/stack.js +40 -0
  219. package/dist/workflow/stack.js.map +1 -0
  220. package/dist/workflow/templates.d.ts +17 -0
  221. package/dist/workflow/templates.js +223 -0
  222. package/dist/workflow/templates.js.map +1 -0
  223. package/dist/workflow/types.d.ts +27 -0
  224. package/dist/workflow/types.js +2 -0
  225. package/dist/workflow/types.js.map +1 -0
  226. package/package.json +77 -0
  227. package/schemas/artifacts.index.json +1211 -0
  228. package/schemas/knowledge.index.json +49 -0
  229. package/schemas/prompt-modules.index.json +105 -0
  230. package/schemas/roles.index.json +431 -0
  231. package/schemas/scenarios.index.json +15 -0
  232. package/schemas/skills.index.json +670 -0
  233. package/schemas/workflows.index.json +462 -0
@@ -0,0 +1,213 @@
1
+ const MAX_ITEMS = 100;
2
+ function clean(label) {
3
+ return label.replace(/["[\]{}|]/g, "'").replace(/\s+/g, " ").trim().slice(0, 90) || "step";
4
+ }
5
+ /** Drop leading connector words so "then notify" reads as "notify". */
6
+ function stripConnector(s) {
7
+ return s.replace(/^(then|next|afterwards?|after that|finally|so)[\s,:;-]+/i, "").trim();
8
+ }
9
+ /** Split a document into ordered items, preserving each numbered step's written ordinal. */
10
+ function splitItems(text) {
11
+ const lines = text.split(/\r?\n/).map((l) => l.trim());
12
+ const markered = [];
13
+ for (const l of lines) {
14
+ const numbered = l.match(/^(\d+)[.)]\s+(.*)$/);
15
+ if (numbered) {
16
+ markered.push({ text: (numbered[2] ?? "").trim(), num: Number(numbered[1]) });
17
+ continue;
18
+ }
19
+ const bullet = l.match(/^[-*•]\s+(.*)$/);
20
+ if (bullet)
21
+ markered.push({ text: (bullet[1] ?? "").trim(), num: null });
22
+ }
23
+ const items = markered.length > 0 ? markered : lines.filter((l) => l.length > 0 && !/^#{1,6}\s/.test(l)).map((t) => ({ text: t, num: null }));
24
+ return items.map((it) => ({ text: stripConnector(it.text), num: it.num })).filter((it) => it.text).slice(0, MAX_ITEMS);
25
+ }
26
+ /** A "go to / return to / repeat (step) N" loop instruction → the target step number, else null. */
27
+ function parseGoto(text) {
28
+ const m = text.match(/^(?:go\s*(?:back\s*)?to|goto|return\s+to|back\s+to|repeat|loop\s+back\s+to)\s+(?:step\s+)?(\d+)\b/i);
29
+ return m ? Number(m[1]) : null;
30
+ }
31
+ function classify(raw) {
32
+ if (/^(end|done|stop|finish|exit|complete)\b/i.test(raw) || /\b(escalate|call 911|dial 988|terminate)\b/i.test(raw)) {
33
+ return "terminal";
34
+ }
35
+ if (/\?\s*$/.test(raw) || /^(is|are|does|do|should|can|could|has|have|will|did|may|was|were)\b/i.test(raw)) {
36
+ return "decision";
37
+ }
38
+ return "process";
39
+ }
40
+ // A list item that is a branch of the preceding decision: "Yes: do X", "No — stop", "Otherwise …".
41
+ const BRANCH_RE = /^(yes|no|if yes|if not|if no|otherwise|else)\b[\s:.)\-—]*(.*)$/i;
42
+ function branchLabel(word) {
43
+ const w = word.toLowerCase();
44
+ if (w.startsWith("y"))
45
+ return "Yes";
46
+ if (w === "no" || w === "if no" || w === "if not")
47
+ return "No";
48
+ return "Otherwise";
49
+ }
50
+ /** Extract a flowchart from free-ish text (steps, if/then/else, and decision branches). */
51
+ export function extractFromText(text, opts = {}) {
52
+ const nodes = [];
53
+ const edges = [];
54
+ let counter = 0;
55
+ const add = (label, shape) => {
56
+ const id = `n${++counter}`;
57
+ nodes.push({ id, label: clean(label), shape });
58
+ return id;
59
+ };
60
+ const connect = (froms, to, label) => {
61
+ for (const f of froms)
62
+ edges.push(label ? { from: f, to, label } : { from: f, to });
63
+ };
64
+ const items = splitItems(text);
65
+ let prevExits = [add("Start", "terminal")];
66
+ // Map each written step number → the entry node it produced, so "go to step N"
67
+ // can loop back. Forward references (N defined later) are deferred and resolved
68
+ // after the full pass, keeping the result deterministic regardless of direction.
69
+ const stepNodes = new Map();
70
+ const recordStep = (num, id) => {
71
+ if (num !== null && !stepNodes.has(num))
72
+ stepNodes.set(num, id);
73
+ };
74
+ const pendingGotos = [];
75
+ const resolveGoto = (froms, target, label) => {
76
+ if (froms.length === 0)
77
+ return;
78
+ const to = stepNodes.get(target);
79
+ if (to)
80
+ connect(froms, to, label);
81
+ else
82
+ pendingGotos.push({ froms, target, label });
83
+ };
84
+ for (let i = 0; i < items.length; i++) {
85
+ const item = items[i];
86
+ const raw = item.text;
87
+ // Loop instruction: "go to / return to / repeat step N" — a back-edge, not a new node.
88
+ const standaloneGoto = parseGoto(raw);
89
+ if (standaloneGoto !== null) {
90
+ resolveGoto(prevExits, standaloneGoto, "repeat");
91
+ prevExits = []; // the path loops; it doesn't fall through
92
+ continue;
93
+ }
94
+ // Single-line "if X then Y [else Z]" — Y/Z may themselves be "go to step N" loops.
95
+ const ifm = raw.match(/^if\s+(.+?)\s+then\s+(.+?)(?:[,;]?\s+(?:else|otherwise)\s+(.+))?$/i);
96
+ if (ifm) {
97
+ const decision = add(`${(ifm[1] ?? "").replace(/\?+$/, "")}?`, "decision");
98
+ connect(prevExits, decision);
99
+ recordStep(item.num, decision);
100
+ const exits = [];
101
+ const branch = (body, label) => {
102
+ if (!body)
103
+ return;
104
+ const goto = parseGoto(body);
105
+ if (goto !== null) {
106
+ resolveGoto([decision], goto, label); // branch loops back; adds no exit
107
+ return;
108
+ }
109
+ const node = add(body, "process");
110
+ edges.push({ from: decision, to: node, label });
111
+ exits.push(node);
112
+ };
113
+ branch(ifm[2], "Yes");
114
+ if (ifm[3])
115
+ branch(ifm[3], "No");
116
+ else
117
+ exits.push(decision); // no else → the decision's "No" path falls through
118
+ prevExits = exits;
119
+ continue;
120
+ }
121
+ const kind = classify(raw);
122
+ if (kind === "decision") {
123
+ const decision = add(raw, "decision");
124
+ connect(prevExits, decision);
125
+ recordStep(item.num, decision);
126
+ // Absorb any immediately-following "Yes/No/Otherwise …" items as labeled branches.
127
+ const branchExits = [];
128
+ let consumed = 0;
129
+ let hadGotoBranch = false;
130
+ let j = i + 1;
131
+ while (j < items.length) {
132
+ const bm = items[j].text.match(BRANCH_RE);
133
+ if (!bm)
134
+ break;
135
+ const label = branchLabel(bm[1] ?? "");
136
+ const txt = (bm[2] ?? "").trim() || label;
137
+ const goto = parseGoto(txt);
138
+ if (goto !== null) {
139
+ resolveGoto([decision], goto, label); // branch loops back; adds no exit
140
+ hadGotoBranch = true;
141
+ }
142
+ else {
143
+ const isTerminal = classify(txt) === "terminal";
144
+ const node = add(txt, isTerminal ? "terminal" : "process");
145
+ edges.push({ from: decision, to: node, label });
146
+ if (!isTerminal)
147
+ branchExits.push(node);
148
+ }
149
+ consumed++;
150
+ j++;
151
+ }
152
+ // When a branch loops back (or all branches terminate), the decision itself stays an
153
+ // exit so the implicit complementary path falls through to the next step.
154
+ if (hadGotoBranch && !branchExits.includes(decision))
155
+ branchExits.push(decision);
156
+ prevExits = consumed > 0 && branchExits.length > 0 ? branchExits : [decision];
157
+ i += consumed;
158
+ continue;
159
+ }
160
+ if (kind === "terminal") {
161
+ const t = add(raw, "terminal");
162
+ connect(prevExits, t);
163
+ recordStep(item.num, t);
164
+ prevExits = []; // this path ends here
165
+ continue;
166
+ }
167
+ const node = add(raw, "process");
168
+ connect(prevExits, node);
169
+ recordStep(item.num, node);
170
+ prevExits = [node];
171
+ }
172
+ // Resolve forward "go to step N" references now that every step node exists.
173
+ for (const g of pendingGotos) {
174
+ const to = stepNodes.get(g.target);
175
+ if (to)
176
+ connect(g.froms, to, g.label);
177
+ }
178
+ if (prevExits.length > 0) {
179
+ const end = add("End", "terminal");
180
+ connect(prevExits, end);
181
+ }
182
+ return { title: opts.title, direction: opts.direction ?? "TD", nodes, edges };
183
+ }
184
+ /** Extract a data-collection flowchart from a parameter set (the builder logic). */
185
+ export function extractFromParamSet(set, opts = {}) {
186
+ const nodes = [];
187
+ const edges = [];
188
+ let counter = 0;
189
+ const add = (label, shape) => {
190
+ const id = `n${++counter}`;
191
+ nodes.push({ id, label: clean(label), shape });
192
+ return id;
193
+ };
194
+ const start = add("Start", "terminal");
195
+ let prev = add(`Open "${set.title}"`, "process");
196
+ edges.push({ from: start, to: prev });
197
+ for (const f of set.fields) {
198
+ const node = add(`Collect ${f.label}${f.required ? " (required)" : ""}`, "io");
199
+ edges.push({ from: prev, to: node });
200
+ prev = node;
201
+ }
202
+ const validate = add("All required fields valid?", "decision");
203
+ edges.push({ from: prev, to: validate });
204
+ const fix = add("Fix inputs", "process");
205
+ edges.push({ from: validate, to: fix, label: "No" });
206
+ edges.push({ from: fix, to: validate });
207
+ const approve = add("Review & approve", "process");
208
+ edges.push({ from: validate, to: approve, label: "Yes" });
209
+ const end = add("End", "terminal");
210
+ edges.push({ from: approve, to: end });
211
+ return { title: set.title, direction: opts.direction ?? "TD", nodes, edges };
212
+ }
213
+ //# sourceMappingURL=extract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract.js","sourceRoot":"","sources":["../../src/diagram/extract.ts"],"names":[],"mappings":"AASA,MAAM,SAAS,GAAG,GAAG,CAAC;AAEtB,SAAS,KAAK,CAAC,KAAa;IAC1B,OAAO,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC;AAC7F,CAAC;AAED,uEAAuE;AACvE,SAAS,cAAc,CAAC,CAAS;IAC/B,OAAO,CAAC,CAAC,OAAO,CAAC,0DAA0D,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AAC1F,CAAC;AASD,4FAA4F;AAC5F,SAAS,UAAU,CAAC,IAAY;IAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACvD,MAAM,QAAQ,GAAW,EAAE,CAAC;IAC5B,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,QA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AAE,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACrD,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IACxC,MAAM,OAAO,GAAG,GAAG,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;IACnD,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IACnC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IAEvC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC/E,CAAC"}
@@ -0,0 +1,2 @@
1
+ /** Diagram engine: extract logic, render Mermaid, validate, and approve. */
2
+ export * from "./core.js";
@@ -0,0 +1,3 @@
1
+ /** Diagram engine: extract logic, render Mermaid, validate, and approve. */
2
+ export * from "./core.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/diagram/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,cAAc,WAAW,CAAC"}
@@ -0,0 +1,10 @@
1
+ /** Render a Diagram to Mermaid, and to an approval-ready markdown document. */
2
+ import type { ApprovalMeta, Diagram } from "./types.js";
3
+ /** A Mermaid `flowchart` for the diagram. */
4
+ export declare function toMermaid(d: Diagram): string;
5
+ /**
6
+ * An approval-ready markdown document: the diagram plus a sign-off block. This
7
+ * is the artifact a human reviews BEFORE any solution is built or deployed.
8
+ * Set the status to `Approved` once signed off (the scaffold gate looks for it).
9
+ */
10
+ export declare function toMarkdown(d: Diagram, meta?: ApprovalMeta): string;
@@ -0,0 +1,50 @@
1
+ function label(text) {
2
+ return text.replace(/"/g, "'").replace(/\s+/g, " ").trim();
3
+ }
4
+ function nodeLine(n) {
5
+ const l = `"${label(n.label)}"`;
6
+ switch (n.shape) {
7
+ case "decision": return ` ${n.id}{${l}}`;
8
+ case "terminal": return ` ${n.id}([${l}])`;
9
+ case "io": return ` ${n.id}[/${l}/]`;
10
+ default: return ` ${n.id}[${l}]`;
11
+ }
12
+ }
13
+ /** A Mermaid `flowchart` for the diagram. */
14
+ export function toMermaid(d) {
15
+ const lines = [`flowchart ${d.direction}`];
16
+ for (const n of d.nodes)
17
+ lines.push(nodeLine(n));
18
+ for (const e of d.edges) {
19
+ lines.push(e.label ? ` ${e.from} -->|${label(e.label)}| ${e.to}` : ` ${e.from} --> ${e.to}`);
20
+ }
21
+ return lines.join("\n");
22
+ }
23
+ /**
24
+ * An approval-ready markdown document: the diagram plus a sign-off block. This
25
+ * is the artifact a human reviews BEFORE any solution is built or deployed.
26
+ * Set the status to `Approved` once signed off (the scaffold gate looks for it).
27
+ */
28
+ export function toMarkdown(d, meta = {}) {
29
+ const title = d.title ? `# ${label(d.title)} — logic` : "# Process logic";
30
+ return [
31
+ title,
32
+ "",
33
+ "> **Visualize & approve.** Review this logic before any solution is built or deployed.",
34
+ "> Educational and informational only — not legal or clinical advice.",
35
+ "",
36
+ "```mermaid",
37
+ toMermaid(d),
38
+ "```",
39
+ "",
40
+ "## Approval",
41
+ "",
42
+ `- **Source:** ${meta.source ?? "—"}`,
43
+ `- **Data sensitivity:** ${meta.dataSensitivity ?? "—"}`,
44
+ `- **Prepared by:** ${meta.preparedBy ?? "____________"}`,
45
+ "- **Approved by:** ____________ **Date:** __________",
46
+ "- **Status:** Draft · _change to `Approved` once signed off_",
47
+ "",
48
+ ].join("\n");
49
+ }
50
+ //# sourceMappingURL=mermaid.js.map
@@ -0,0 +1 @@
1
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KAAK,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACjG,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,CAAU,EAAE,OAAqB,EAAE;IAC5D,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAC1E,OAAO;QACL,KAAK;QACL,EAAE;QACF,wFAAwF;QACxF,sEAAsE;QACtE,EAAE;QACF,YAAY;QACZ,SAAS,CAAC,CAAC,CAAC;QACZ,KAAK;QACL,EAAE;QACF,aAAa;QACb,EAAE;QACF,iBAAiB,IAAI,CAAC,MAAM,IAAI,GAAG,EAAE;QACrC,2BAA2B,IAAI,CAAC,eAAe,IAAI,GAAG,EAAE;QACxD,sBAAsB,IAAI,CAAC,UAAU,IAAI,cAAc,EAAE;QACzD,uDAAuD;QACvD,gEAAgE;QAChE,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,4 @@
1
+ /** Turn a diagram into a plain-English prompt to paste into any AI assistant. */
2
+ import type { Diagram } from "./types.js";
3
+ /** A ready-to-paste prompt asking an assistant to review the process logic. */
4
+ export declare function toPrompt(d: Diagram): string;
@@ -0,0 +1,16 @@
1
+ import { toMermaid } from "./mermaid.js";
2
+ /** A ready-to-paste prompt asking an assistant to review the process logic. */
3
+ export function toPrompt(d) {
4
+ return [
5
+ `Here's a process I'm mapping out${d.title ? ` for "${d.title}"` : ""}, drawn as a flowchart:`,
6
+ "",
7
+ "```mermaid",
8
+ toMermaid(d),
9
+ "```",
10
+ "",
11
+ "Please review the logic in plain language: are the steps in a sensible order, are the decision points (the diamonds) right, and is anything missing, unclear, or unsafe? Suggest specific improvements.",
12
+ "",
13
+ "Keep it educational and informational only — not legal or clinical advice. Use court-neutral, child-centered language. If anything is urgent, lead with crisis resources first (988, or text HOME to 741741).",
14
+ ].join("\n");
15
+ }
16
+ //# sourceMappingURL=prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/diagram/prompt.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,+EAA+E;AAC/E,MAAM,UAAU,QAAQ,CAAC,CAAU;IACjC,OAAO;QACL,mCAAmC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,yBAAyB;QAC9F,EAAE;QACF,YAAY;QACZ,SAAS,CAAC,CAAC,CAAC;QACZ,KAAK;QACL,EAAE;QACF,yMAAyM;QACzM,EAAE;QACF,+MAA+M;KAChN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Diagram model: a small, Mermaid-flavored flowchart used by the
3
+ * "visualize & approve" stage. Import-free (no node:/external deps) so the
4
+ * compiled output runs in the browser builder and the CLI alike.
5
+ */
6
+ export type NodeShape = "process" | "decision" | "terminal" | "io";
7
+ export interface DiagramNode {
8
+ id: string;
9
+ label: string;
10
+ shape: NodeShape;
11
+ }
12
+ export interface DiagramEdge {
13
+ from: string;
14
+ to: string;
15
+ label?: string;
16
+ }
17
+ export type Direction = "TD" | "LR";
18
+ export interface Diagram {
19
+ title?: string;
20
+ direction: Direction;
21
+ nodes: DiagramNode[];
22
+ edges: DiagramEdge[];
23
+ }
24
+ /** Sign-off metadata rendered into the approval document. */
25
+ export interface ApprovalMeta {
26
+ source?: string;
27
+ preparedBy?: string;
28
+ dataSensitivity?: "public" | "sensitive" | "confidential";
29
+ }
30
+ export interface DiagramValidation {
31
+ valid: boolean;
32
+ errors: string[];
33
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/diagram/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ /** Lightweight, dependency-free validation for diagrams and Mermaid source. */
2
+ import type { Diagram, DiagramValidation } from "./types.js";
3
+ /** Structural checks on a Diagram: ids unique, edges reference real nodes. */
4
+ export declare function validateDiagram(d: Diagram): DiagramValidation;
5
+ /**
6
+ * Sanity-check Mermaid flowchart source (not a full parser): it must declare a
7
+ * flowchart/graph and contain at least one node or edge. Good enough to catch
8
+ * an empty or obviously-broken block before approval; the portal preview and
9
+ * the Mermaid renderer do the full parse.
10
+ */
11
+ export declare function validateMermaid(src: string): DiagramValidation;
12
+ /** Extract the first ```mermaid fenced block from a markdown document. */
13
+ export declare function extractMermaidBlock(markdown: string): string | null;
@@ -0,0 +1,48 @@
1
+ /** Structural checks on a Diagram: ids unique, edges reference real nodes. */
2
+ export function validateDiagram(d) {
3
+ const errors = [];
4
+ if (d.nodes.length === 0)
5
+ errors.push("diagram has no nodes");
6
+ const ids = new Set();
7
+ for (const n of d.nodes) {
8
+ if (ids.has(n.id))
9
+ errors.push(`duplicate node id: ${n.id}`);
10
+ ids.add(n.id);
11
+ if (!n.label.trim())
12
+ errors.push(`node ${n.id} has an empty label`);
13
+ }
14
+ for (const e of d.edges) {
15
+ if (!ids.has(e.from))
16
+ errors.push(`edge references unknown node: ${e.from}`);
17
+ if (!ids.has(e.to))
18
+ errors.push(`edge references unknown node: ${e.to}`);
19
+ }
20
+ return { valid: errors.length === 0, errors };
21
+ }
22
+ /**
23
+ * Sanity-check Mermaid flowchart source (not a full parser): it must declare a
24
+ * flowchart/graph and contain at least one node or edge. Good enough to catch
25
+ * an empty or obviously-broken block before approval; the portal preview and
26
+ * the Mermaid renderer do the full parse.
27
+ */
28
+ export function validateMermaid(src) {
29
+ const errors = [];
30
+ const trimmed = src.trim();
31
+ if (!trimmed) {
32
+ return { valid: false, errors: ["empty diagram"] };
33
+ }
34
+ if (!/^(flowchart|graph)\s+(TD|TB|LR|RL|BT)\b/m.test(trimmed)) {
35
+ errors.push("missing `flowchart <DIR>` (or `graph <DIR>`) header");
36
+ }
37
+ const body = trimmed.split(/\r?\n/).slice(1).filter((l) => l.trim());
38
+ if (body.length === 0)
39
+ errors.push("diagram has no nodes or edges");
40
+ return { valid: errors.length === 0, errors };
41
+ }
42
+ /** Extract the first ```mermaid fenced block from a markdown document. */
43
+ export function extractMermaidBlock(markdown) {
44
+ const m = markdown.match(/```mermaid\s*\n([\s\S]*?)```/i);
45
+ const block = m?.[1];
46
+ return block !== undefined ? block.trim() : null;
47
+ }
48
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/diagram/validate.ts"],"names":[],"mappings":"AAGA,8EAA8E;AAC9E,MAAM,UAAU,eAAe,CAAC,CAAU;IACxC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IAC9D,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAC;IAC9B,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;QACxB,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YAAE,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC7D,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACd,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE;YAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC;IACtE,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,CAA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QAAgB;IAClD,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC1D,MAAM,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACrB,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACnD,CAAC"}
@@ -0,0 +1,10 @@
1
+ /** Deterministic building blocks shared by the renderer and the diagram embed. */
2
+ import type { GuideInput } from "./types.js";
3
+ /**
4
+ * The onboarding checklist for a new user — derived deterministically from the
5
+ * source. These double as the nodes of the embedded flow diagram, so the
6
+ * picture and the checklist never disagree.
7
+ */
8
+ export declare function onboardingSteps(input: GuideInput): string[];
9
+ /** The standard feedback prompts every guide asks for — structured, comparable. */
10
+ export declare const FEEDBACK_QUESTIONS: string[];
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The onboarding checklist for a new user — derived deterministically from the
3
+ * source. These double as the nodes of the embedded flow diagram, so the
4
+ * picture and the checklist never disagree.
5
+ */
6
+ export function onboardingSteps(input) {
7
+ const steps = [];
8
+ steps.push("Confirm access — assign each teammate the right role and tier");
9
+ steps.push("Install and sign in: run cotrackpro setup");
10
+ if (input.scaffold)
11
+ steps.push(`Scaffold the module: ${input.scaffold}`);
12
+ for (const s of input.scenarios ?? []) {
13
+ steps.push(`Walk the "${s.title}" scenario end to end${s.steps ? ` (${s.steps} steps)` : ""}`);
14
+ }
15
+ const firstArtifact = (input.artifacts ?? [])[0];
16
+ if (firstArtifact)
17
+ steps.push(`Produce a first artifact: ${firstArtifact.title}`);
18
+ if ((input.guardrails ?? []).length)
19
+ steps.push("Review the guardrails before anything is shared");
20
+ steps.push("Collect feedback from the first cohort");
21
+ return steps;
22
+ }
23
+ /** The standard feedback prompts every guide asks for — structured, comparable. */
24
+ export const FEEDBACK_QUESTIONS = [
25
+ "Overall, how ready did you feel after onboarding? (1–5)",
26
+ "What was clear and worked well?",
27
+ "Where did you get stuck or confused?",
28
+ "What one change would have helped most?",
29
+ "Anything unsafe, unclear, or out of date you noticed?",
30
+ ];
31
+ //# sourceMappingURL=compose.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compose.js","sourceRoot":"","sources":["../../src/guide/compose.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,KAAiB;IAC/C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,+DAA+D,CAAC,CAAC;IAC5E,KAAK,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;IACxD,IAAI,KAAK,CAAC,QAAQ;QAAE,KAAK,CAAC,IAAI,CAAC,wBAAwB,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzE,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,IAAI,EAAE,EAAE,CAAC;QACtC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,KAAK,wBAAwB,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACjG,CAAC;IACD,MAAM,aAAa,GAAG,CAAC,KAAK,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,IAAI,aAAa;QAAE,KAAK,CAAC,IAAI,CAAC,6BAA6B,aAAa,CAAC,KAAK,EAAE,CAAC,CAAC;IAClF,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,MAAM;QAAE,KAAK,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;IACnG,KAAK,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;IACrD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,mFAAmF;AACnF,MAAM,CAAC,MAAM,kBAAkB,GAAa;IAC1C,yDAAyD;IACzD,iCAAiC;IACjC,sCAAsC;IACtC,yCAAyC;IACzC,uDAAuD;CACxD,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Browser-safe barrel for the guide engine. Import-free by construction so the
3
+ * compiled output loads directly in the portal builder — the CLI and the portal
4
+ * share the exact compose/render logic. Keep it that way (an SDK test enforces
5
+ * no external imports).
6
+ */
7
+ export * from "./types.js";
8
+ export * from "./compose.js";
9
+ export * from "./render.js";
10
+ export * from "./prompt.js";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Browser-safe barrel for the guide engine. Import-free by construction so the
3
+ * compiled output loads directly in the portal builder — the CLI and the portal
4
+ * share the exact compose/render logic. Keep it that way (an SDK test enforces
5
+ * no external imports).
6
+ */
7
+ export * from "./types.js";
8
+ export * from "./compose.js";
9
+ export * from "./render.js";
10
+ export * from "./prompt.js";
11
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/guide/core.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ /** Guide engine: compose operational onboarding + feedback playbooks from the catalog. */
2
+ export * from "./core.js";
@@ -0,0 +1,3 @@
1
+ /** Guide engine: compose operational onboarding + feedback playbooks from the catalog. */
2
+ export * from "./core.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/guide/index.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,cAAc,WAAW,CAAC"}
@@ -0,0 +1,8 @@
1
+ /** Turn a guide source into a plain-English prompt to paste into any AI assistant. */
2
+ import type { GuideInput } from "./types.js";
3
+ /**
4
+ * A ready-to-paste prompt for someone who doesn't know how to prompt: it explains
5
+ * what they're building and asks the assistant for help, with the platform's
6
+ * safety framing baked in so the response stays court-neutral and educational.
7
+ */
8
+ export declare function toPrompt(input: GuideInput): string;
@@ -0,0 +1,20 @@
1
+ import { onboardingSteps } from "./compose.js";
2
+ /**
3
+ * A ready-to-paste prompt for someone who doesn't know how to prompt: it explains
4
+ * what they're building and asks the assistant for help, with the platform's
5
+ * safety framing baked in so the response stays court-neutral and educational.
6
+ */
7
+ export function toPrompt(input) {
8
+ const steps = onboardingSteps(input).map((s, i) => `${i + 1}. ${s}`).join("\n");
9
+ return [
10
+ `I'm setting up "${input.title}" and need help onboarding a new person to it.`,
11
+ "",
12
+ "Here's the plan I have so far:",
13
+ steps,
14
+ "",
15
+ "Please turn this into a clear, friendly onboarding guide, point out anything I'm missing, and suggest a simple way to gather feedback from the first people who use it.",
16
+ "",
17
+ "Keep everything educational and informational only — not legal or clinical advice. Use court-neutral, child-centered language: describe behavior, use a child's initials, and never characterize a parent. If anything is urgent, lead with crisis resources first (988, or text HOME to 741741).",
18
+ ].join("\n");
19
+ }
20
+ //# sourceMappingURL=prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/guide/prompt.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAiB;IACxC,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChF,OAAO;QACL,mBAAmB,KAAK,CAAC,KAAK,gDAAgD;QAC9E,EAAE;QACF,gCAAgC;QAChC,KAAK;QACL,EAAE;QACF,yKAAyK;QACzK,EAAE;QACF,mSAAmS;KACpS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,9 @@
1
+ /** Render a GuideInput into an operational, dual-audience markdown playbook. */
2
+ import type { GuideInput, GuideOptions } from "./types.js";
3
+ /**
4
+ * Compose the full guide. Audience controls emphasis:
5
+ * - "dev" → commands, scaffolding, SDK wiring
6
+ * - "leader" → rollout, access, adoption, feedback cadence
7
+ * - "both" → both, as labeled callouts (default)
8
+ */
9
+ export declare function toMarkdown(input: GuideInput, opts?: GuideOptions): string;