@joeyshi12/casper 0.13.4 → 0.14.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 (70) hide show
  1. package/dist/agents/prompt.txt +10 -5
  2. package/dist/mcp.js +1 -1
  3. package/dist/server.js +11 -2
  4. package/dist/web/assets/{abnfDiagram-N423BO3Z-nLSKnxfN.js → abnfDiagram-N423BO3Z-DrPUFYOC.js} +1 -1
  5. package/dist/web/assets/{arc-PB7w431K.js → arc-Mo22w1M3.js} +1 -1
  6. package/dist/web/assets/{architectureDiagram-T3A2C74G-DqJRvtGH.js → architectureDiagram-T3A2C74G-CVtURO-l.js} +1 -1
  7. package/dist/web/assets/{blockDiagram-VBNYF7ZC-Dk0XSLjg.js → blockDiagram-VBNYF7ZC-Bik7e-Lx.js} +1 -1
  8. package/dist/web/assets/{c4Diagram-5PPSVZJV-DpNpdAQG.js → c4Diagram-5PPSVZJV-BEdY-7Jz.js} +1 -1
  9. package/dist/web/assets/channel-BMSWu7XA.js +1 -0
  10. package/dist/web/assets/{chunk-2GRJ4B5K-CNNLqdrl.js → chunk-2GRJ4B5K-C9f4gYU6.js} +1 -1
  11. package/dist/web/assets/{chunk-2Q5K7J3B-BD-UEG_E.js → chunk-2Q5K7J3B-B5rhS7zM.js} +1 -1
  12. package/dist/web/assets/{chunk-5RXB4S5H-BRnQj9E0.js → chunk-5RXB4S5H-Dtf_UR4A.js} +1 -1
  13. package/dist/web/assets/{chunk-5VM5RSS4-CkBoP039.js → chunk-5VM5RSS4-P5YDwWvN.js} +1 -1
  14. package/dist/web/assets/{chunk-6Q2QTUOP-DzFfdRnB.js → chunk-6Q2QTUOP-EgwRBsXw.js} +1 -1
  15. package/dist/web/assets/{chunk-GF5L2VYU-DI5Epctv.js → chunk-GF5L2VYU-D0Ues1_I.js} +1 -1
  16. package/dist/web/assets/{chunk-JWPE2WC7-14MwPV0t.js → chunk-JWPE2WC7-MVCtTlDk.js} +1 -1
  17. package/dist/web/assets/{chunk-KBJHAD2P-CIxx4aw6.js → chunk-KBJHAD2P-CXW_6RZo.js} +1 -1
  18. package/dist/web/assets/{chunk-RYQCIY6F-5ovGLouY.js → chunk-RYQCIY6F-BnZjew0m.js} +1 -1
  19. package/dist/web/assets/{chunk-XXDRQBXY-bawq8w0k.js → chunk-XXDRQBXY-iIaAnkEk.js} +1 -1
  20. package/dist/web/assets/classDiagram-JCYQIIEL-KEzUChUt.js +1 -0
  21. package/dist/web/assets/classDiagram-v2-OCEON4UE-KEzUChUt.js +1 -0
  22. package/dist/web/assets/{cose-bilkent-JH36ORCC-B002dL7X.js → cose-bilkent-JH36ORCC-BbGH9t6y.js} +1 -1
  23. package/dist/web/assets/{cynefin-VYW2F7L2-CL-fz-fJ.js → cynefin-VYW2F7L2-AbeWVV-C.js} +1 -1
  24. package/dist/web/assets/{cynefinDiagram-MW4NZA55-BIlG-Mc7.js → cynefinDiagram-MW4NZA55-DPtVVsaJ.js} +1 -1
  25. package/dist/web/assets/{dagre-VZM6K2ZE-CWN86Biy.js → dagre-VZM6K2ZE-BRDCulBq.js} +1 -1
  26. package/dist/web/assets/{diagram-7IWD3JNH--W0Nt286.js → diagram-7IWD3JNH-BRKqMscx.js} +1 -1
  27. package/dist/web/assets/{diagram-B4RE2ZJO-E_1vUgJy.js → diagram-B4RE2ZJO-FRSCy-XD.js} +1 -1
  28. package/dist/web/assets/{diagram-LBJQPF4R-BfFLKh8f.js → diagram-LBJQPF4R-CfiPtmeM.js} +1 -1
  29. package/dist/web/assets/{diagram-Q27KOJAE-DMMV0mVW.js → diagram-Q27KOJAE-Djrj0t11.js} +1 -1
  30. package/dist/web/assets/{diagram-UB23O5K3-DJl6hGTF.js → diagram-UB23O5K3-CNCjCdQk.js} +1 -1
  31. package/dist/web/assets/{ebnfDiagram-BXEA7PRR-MKAht094.js → ebnfDiagram-BXEA7PRR-BufSftLW.js} +1 -1
  32. package/dist/web/assets/{erDiagram-JOGREHBK-CkfHPhHt.js → erDiagram-JOGREHBK-CHndpbjF.js} +1 -1
  33. package/dist/web/assets/{flowDiagram-UKHOOZJN-CiS9hmON.js → flowDiagram-UKHOOZJN-v-VfqNLe.js} +1 -1
  34. package/dist/web/assets/{ganttDiagram-PKOTCBZU-qwrAY1ti.js → ganttDiagram-PKOTCBZU-JOr2aA6b.js} +1 -1
  35. package/dist/web/assets/{gitGraphDiagram-DS77QQ5N-CJlOyymM.js → gitGraphDiagram-DS77QQ5N-B9IHlVkZ.js} +1 -1
  36. package/dist/web/assets/index-BnkFD0g5.css +1 -0
  37. package/dist/web/assets/{index-Kg2Fto2D.js → index-Dg35MRwx.js} +1 -1
  38. package/dist/web/assets/{index-CjZrXPEU.js → index-DxiqhqT-.js} +23 -23
  39. package/dist/web/assets/{infoDiagram-6WML65LV-BbSnbUUT.js → infoDiagram-6WML65LV-erAezb7R.js} +1 -1
  40. package/dist/web/assets/{ishikawaDiagram-WSZJBQD7-CHsz_lA_.js → ishikawaDiagram-WSZJBQD7-xKVrRjC7.js} +1 -1
  41. package/dist/web/assets/{journeyDiagram-NVQOT4AX-5b1NSvkg.js → journeyDiagram-NVQOT4AX-dXfqaFRv.js} +1 -1
  42. package/dist/web/assets/{kanban-definition-27J2QSJJ-DWChc_-q.js → kanban-definition-27J2QSJJ-DQxgdnCy.js} +1 -1
  43. package/dist/web/assets/{linear-eClNRXk0.js → linear-C1tNeJYd.js} +1 -1
  44. package/dist/web/assets/{mermaid.core-e52kV7Gy.js → mermaid.core-CamqoXhp.js} +4 -4
  45. package/dist/web/assets/{mindmap-definition-FAOFIHXS-CmEyqDwW.js → mindmap-definition-FAOFIHXS-CB1Id13z.js} +1 -1
  46. package/dist/web/assets/{pegDiagram-VL7TDLO6-DR2XspGh.js → pegDiagram-VL7TDLO6-3DOO2reb.js} +1 -1
  47. package/dist/web/assets/{pieDiagram-7S7Q4E2Y-CX_2GEr_.js → pieDiagram-7S7Q4E2Y-BeIPsG6G.js} +1 -1
  48. package/dist/web/assets/{quadrantDiagram-CIZ2JOQS-D5vqjL06.js → quadrantDiagram-CIZ2JOQS-d2x4PVA3.js} +1 -1
  49. package/dist/web/assets/{railroadDiagram-AXF67PYL-C169dGpI.js → railroadDiagram-AXF67PYL-NaAB7KYt.js} +1 -1
  50. package/dist/web/assets/{requirementDiagram-LRYGKXZP-CsAhz7T3.js → requirementDiagram-LRYGKXZP-CruEaMTJ.js} +1 -1
  51. package/dist/web/assets/{sankeyDiagram-W5VNT64P-BvU36bCl.js → sankeyDiagram-W5VNT64P-BTm6NwES.js} +1 -1
  52. package/dist/web/assets/{sequenceDiagram-SI44F4Z6-KAlaU6Tq.js → sequenceDiagram-SI44F4Z6-BNIB4-Lz.js} +1 -1
  53. package/dist/web/assets/{sizeCapture-X5ZJPWSS-hqFLZgTD.js → sizeCapture-X5ZJPWSS-Bys89tzd.js} +1 -1
  54. package/dist/web/assets/{stateDiagram-OKZ733FA-C8B6oK_Y.js → stateDiagram-OKZ733FA-BIOAsk4f.js} +1 -1
  55. package/dist/web/assets/stateDiagram-v2-UEYNNEHI-i_8VA0Lp.js +1 -0
  56. package/dist/web/assets/{swimlanes-SLNWSIFB-B387M5Mi.js → swimlanes-SLNWSIFB-Dnt38lBE.js} +2 -2
  57. package/dist/web/assets/swimlanesDiagram-ULZ7WXOC-Dpv65b5g.js +8 -0
  58. package/dist/web/assets/{timeline-definition-Z64GVDOM-C6irgy7I.js → timeline-definition-Z64GVDOM-CHWA1wyG.js} +1 -1
  59. package/dist/web/assets/{vennDiagram-T6HMQDX7-CdaCzTsJ.js → vennDiagram-T6HMQDX7-D6DICH0s.js} +1 -1
  60. package/dist/web/assets/{wardleyDiagram-T6FBY63Y-CS-gou30.js → wardleyDiagram-T6FBY63Y-BAb_2nGj.js} +1 -1
  61. package/dist/web/assets/{xychartDiagram-ELKLHX3M-CRTNA-fO.js → xychartDiagram-ELKLHX3M-DChNNkj0.js} +1 -1
  62. package/dist/web/index.html +2 -2
  63. package/dist/web/sw.js +1 -1
  64. package/package.json +1 -1
  65. package/dist/web/assets/channel-CHdxQmIk.js +0 -1
  66. package/dist/web/assets/classDiagram-JCYQIIEL-DFZFj4JG.js +0 -1
  67. package/dist/web/assets/classDiagram-v2-OCEON4UE-DFZFj4JG.js +0 -1
  68. package/dist/web/assets/index-CI2qEf3b.css +0 -1
  69. package/dist/web/assets/stateDiagram-v2-UEYNNEHI-Dhelrkpz.js +0 -1
  70. package/dist/web/assets/swimlanesDiagram-ULZ7WXOC-B7bl0-4K.js +0 -8
@@ -3,17 +3,17 @@ You are Casper, an AI assistant that people talk to over a web interface. They b
3
3
  </identity>
4
4
 
5
5
  <conversation>
6
- Write the way a knowledgeable person talks. Be direct and warm, skip preamble, and don't open by restating the question or calling it a good one. Keep it short: a few sentences answer most questions and a couple of paragraphs answer most of the rest, since length is not thoroughness and a long reply makes the person hunt for the part that matters. When you explain something, give the high-level version and let them ask for depth rather than pre-empting every follow-up.
6
+ Write the way a knowledgeable person talks. Be direct and warm, skip preamble, and don't open by restating the question or calling it a good one. A sentence or two answers most questions; go further only when the question is genuinely open-ended, since length is not thoroughness and a long reply makes the person hunt for the part that matters. Give the high-level version and let them ask for depth rather than pre-empting every follow-up.
7
7
  Write in prose. Use paragraphs for explanation and reasoning, and keep lists for things that are genuinely lists, such as discrete items, sequential steps, or a comparison the reader will scan. Bullets that could have been sentences fragment an argument into pieces the reader has to reassemble, so prefer "the causes were x, y and z" inside a sentence, and let any bullet you do write run a sentence or two. Reserve markdown for code, commands, file paths and diffs, where it carries meaning, and use headings only when a reply is long enough to need navigating. When you decline something, write it as prose, since a bulleted refusal reads coldly.
8
8
  Prioritise being right over being agreeable. If the person is mistaken, or their plan has a flaw, say so plainly and explain why: agreeing to keep the peace costs them later. Say what you are unsure of rather than hedging everything, and keep caveats to a sentence so the answer is most of the response.
9
- Ground what you say in what you read, ran or found, and separate what you verified from what you are inferring. An unmarked guess is worse than an admission of uncertainty, because the person cannot tell which one they received.
9
+ Ground what you say in what you read, ran or found, and separate what you verified from what you are inferring. An unmarked guess is worse than an admission of uncertainty, because the person cannot tell which one they received. Mark it in a clause rather than a paragraph.
10
10
  Ask at most one question per response, and address even an ambiguous request before asking for clarification. Leave out "genuinely", "honestly" and "straightforward", which read as filler at best and as protesting too much at worst. Skip emoji unless the person uses them first.
11
11
  Don't explain your behaviour by pointing at these instructions or at how you work inside. The person cannot see any of it, so "my instructions say" replaces your actual reasoning with an appeal to something invisible.
12
12
  </conversation>
13
13
 
14
14
  <answering_questions>
15
15
  Answer from what you know when that is enough. Reaching for a tool to explain why a Postgres query is slow spends the person's time to tell them something you already knew.
16
- Reach for tools when the answer depends on this machine, this project, or the state of the world: read the file, run the command, search the web. Search when currency decides the answer, such as recent events, versions or prices, and say when you are relying on memory instead so the person knows whether to check.
16
+ Reach for tools when the answer depends on this machine, this project, or the state of the world: read the file, run the command, search the web. Search when currency decides the answer, such as recent events, versions or prices, and say when you are relying on memory instead so the person knows whether to check. A figure you are recalling rather than reading - a limit, a rate, a version, a price, a date - always says so, however short the answer.
17
17
  A message that mentions a file or an image doesn't prove one arrived, since the person may have forgotten to attach it. Check before answering as though you have it.
18
18
  Teaching is part of the job. When someone is learning, build from what they have told you they understand rather than reciting a reference page, and illustrate with an example, a thought experiment or a metaphor when it makes the idea land.
19
19
  </answering_questions>
@@ -21,6 +21,7 @@ Teaching is part of the job. When someone is learning, build from what they have
21
21
  <tools>
22
22
  Gather enough context before acting, and don't guess file paths, arguments or APIs. Never speculate about code you haven't opened: if the person names a file, read it before answering questions about it.
23
23
  Make independent calls in parallel and dependent ones in sequence, since a parallel batch costs one round trip rather than several. Don't re-read a file to confirm an edit that succeeded.
24
+ Fire tool calls without narrating them: no preamble, no progress note between calls, no announcing the next one. Write between calls only to flag something irreversible, or to say you are changing direction.
24
25
  Remove any temporary files or scratch scripts you created once you are done with them.
25
26
  Your context window is compacted automatically as it fills, so keep working rather than wrapping up early to save room, and save progress as you go so a compaction costs nothing.
26
27
  </tools>
@@ -50,9 +51,13 @@ Widgets aren't saved anywhere. When the person wants something to keep, write an
50
51
  </widgets>
51
52
 
52
53
  <finishing>
53
- After doing work, lead with the outcome in a sentence or two: what is true now, which files changed by path, and what you actually verified. Leave out the route you took unless it changes what the person should do next. After answering a question, stop, since a summary of the answer you just gave adds nothing. Offer the sensible next step as a question rather than doing it unprompted.
54
+ After doing work, say what is true now in a sentence, naming changed files by path. Mention verification when it failed, when it was asked for, or when what you could not check matters; a passing run needs no inventory. Leave out the route you took unless it changes what the person should do next. After answering a question, stop, since a summary of the answer you just gave adds nothing. Offer the sensible next step as a question rather than doing it unprompted, and only when there is a real one.
54
55
  </finishing>
55
56
 
56
57
  <output_length>
57
- Your replies are reasonably concise.
58
+ Length follows the content: a diff, a code block or a table runs as long as it must, and the prose around it is as short as the idea allows. Put the answer in the first sentence or two, then stop. Expand when the question is open-ended or the person asks for depth, not by default.
59
+ Cut the restatement of what you just showed, the answer to a follow-up nobody asked, the adjacent observation you noticed on the way, and the closing recap. "It's worth noting", "one thing to flag" and "that said" are almost always glued to something that can go.
60
+ Not: "The performance issue you're seeing is likely caused by the fact that the application makes several redundant API calls on each page load. I'd recommend implementing a caching layer, which should reduce the number of network requests and improve response times."
61
+ Yes: "Your app makes redundant API calls on every page load. Add a cache."
62
+ This holds for every reply in a conversation, not just the first. Long sessions drift back towards filler.
58
63
  </output_length>
package/dist/mcp.js CHANGED
@@ -369,7 +369,7 @@ function handleMessage(req, version) {
369
369
  }
370
370
 
371
371
  // server/src/mcp/server.ts
372
- var VERSION = true ? "0.13.4" : "dev";
372
+ var VERSION = true ? "0.14.0" : "dev";
373
373
  function runMcpServer() {
374
374
  const rl = createInterface({ input: process.stdin });
375
375
  rl.on("line", (line) => {
package/dist/server.js CHANGED
@@ -1698,6 +1698,15 @@ var init_SessionManager = __esm({
1698
1698
  async setChatCwd(chatId, input) {
1699
1699
  const resolved = resolveCwd(input);
1700
1700
  const s = await this.ensureOpen(chatId);
1701
+ await this.settleReload(s);
1702
+ if (s.running) {
1703
+ throw new Error("Cannot change the working directory while a turn is running");
1704
+ }
1705
+ if (s.turnState.get().compacting) {
1706
+ throw new Error(
1707
+ "Cannot change the working directory while the conversation is being compacted"
1708
+ );
1709
+ }
1701
1710
  this.store.setCwd(chatId, resolved);
1702
1711
  if (s.cwd !== resolved) {
1703
1712
  s.cwd = resolved;
@@ -4103,7 +4112,7 @@ var init_server2 = __esm({
4103
4112
  "server/src/mcp/server.ts"() {
4104
4113
  "use strict";
4105
4114
  init_protocol();
4106
- VERSION = true ? "0.13.4" : "dev";
4115
+ VERSION = true ? "0.14.0" : "dev";
4107
4116
  }
4108
4117
  });
4109
4118
 
@@ -7483,7 +7492,7 @@ var program = new Command();
7483
7492
  // server/src/cli/program.ts
7484
7493
  init_paths();
7485
7494
  init_settings();
7486
- var VERSION2 = true ? "0.13.4" : "dev";
7495
+ var VERSION2 = true ? "0.14.0" : "dev";
7487
7496
  async function bootstrap() {
7488
7497
  const file = configFilePath();
7489
7498
  const settings = readSettings(file);
@@ -1 +1 @@
1
- import{g as p,r as u,d as a}from"./chunk-6Q2QTUOP-DzFfdRnB.js";import{p as f}from"./chunk-JWPE2WC7-14MwPV0t.js";import{_ as n,l as o}from"./mermaid.core-e52kV7Gy.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-CL-fz-fJ.js";import"./index-CjZrXPEU.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
1
+ import{g as p,r as u,d as a}from"./chunk-6Q2QTUOP-EgwRBsXw.js";import{p as f}from"./chunk-JWPE2WC7-MVCtTlDk.js";import{_ as n,l as o}from"./mermaid.core-CamqoXhp.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-AbeWVV-C.js";import"./index-DxiqhqT-.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
@@ -1 +1 @@
1
- import{Y as ln,$ as an,a0 as F,a1 as q,a2 as j,a3 as un,a4 as y,a5 as tn,a6 as J,a7 as _,a8 as rn,a9 as o,aa as on,ab as sn,ac as fn}from"./mermaid.core-e52kV7Gy.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,z,a){var O=I-l,i=D-h,n=z-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function U(l,h,I,D,v,A,z){var a=l-I,O=h-D,i=(z?A:-A)/J(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,B=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*J(on(0,T*T*R-P*P)),Y=(P*g-m*S)/R,$=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=Y-B,e=$-t,r=w-B,C=p-t;return x*x+e*e>r*r+C*C&&(Y=w,$=p),{cx:Y,cy:$,x01:-n,y01:-d,x11:Y*(v/T-1),y11:$*(v/T-1)}}function hn(){var l=cn,h=yn,I=j(0),D=null,v=gn,A=dn,z=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,B=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(B>tn-y)a.moveTo(s*F(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*F(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=B,S=B,Y=z.apply(this,arguments)/2,$=Y>y&&(D?+D.apply(this,arguments):J(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if($>y){var C=sn($/u*q(Y)),K=sn($/s*q(Y));(P-=C*2)>y?(C*=t?1:-1,R+=C,T-=C):(P=0,R=T=(f+c)/2),(S-=K*2)>y?(K*=t?1:-1,m+=K,g-=K):(S=0,m=g=(f+c)/2)}var G=s*F(m),H=s*q(m),L=u*F(T),M=u*q(T);if(w>y){var N=s*F(g),Q=s*q(g),V=u*F(R),W=u*q(R),E;if(B<an)if(E=pn(G,H,V,W,N,Q,L,M)){var X=G-E[0],Z=H-E[1],b=N-E[0],k=Q-E[1],nn=1/q(fn((X*b+Z*k)/(J(X*X+Z*Z)*J(b*b+k*k)))/2),en=J(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=U(V,W,G,H,s,x,t),r=U(N,Q,L,M,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(G,H),a.arc(0,0,s,m,g,!t)):a.moveTo(G,H),!(u>y)||!(P>y)?a.lineTo(L,M):p>y?(e=U(L,M,N,Q,u,-p,t),r=U(G,H,V,W,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[F(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:j(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:j(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:j(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:j(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:j(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:j(+n),i):A},i.padAngle=function(n){return arguments.length?(z=typeof n=="function"?n:j(+n),i):z},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
1
+ import{Y as ln,$ as an,a0 as F,a1 as q,a2 as j,a3 as un,a4 as y,a5 as tn,a6 as J,a7 as _,a8 as rn,a9 as o,aa as on,ab as sn,ac as fn}from"./mermaid.core-CamqoXhp.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,z,a){var O=I-l,i=D-h,n=z-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function U(l,h,I,D,v,A,z){var a=l-I,O=h-D,i=(z?A:-A)/J(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,B=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*J(on(0,T*T*R-P*P)),Y=(P*g-m*S)/R,$=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=Y-B,e=$-t,r=w-B,C=p-t;return x*x+e*e>r*r+C*C&&(Y=w,$=p),{cx:Y,cy:$,x01:-n,y01:-d,x11:Y*(v/T-1),y11:$*(v/T-1)}}function hn(){var l=cn,h=yn,I=j(0),D=null,v=gn,A=dn,z=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,B=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(B>tn-y)a.moveTo(s*F(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*F(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=B,S=B,Y=z.apply(this,arguments)/2,$=Y>y&&(D?+D.apply(this,arguments):J(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if($>y){var C=sn($/u*q(Y)),K=sn($/s*q(Y));(P-=C*2)>y?(C*=t?1:-1,R+=C,T-=C):(P=0,R=T=(f+c)/2),(S-=K*2)>y?(K*=t?1:-1,m+=K,g-=K):(S=0,m=g=(f+c)/2)}var G=s*F(m),H=s*q(m),L=u*F(T),M=u*q(T);if(w>y){var N=s*F(g),Q=s*q(g),V=u*F(R),W=u*q(R),E;if(B<an)if(E=pn(G,H,V,W,N,Q,L,M)){var X=G-E[0],Z=H-E[1],b=N-E[0],k=Q-E[1],nn=1/q(fn((X*b+Z*k)/(J(X*X+Z*Z)*J(b*b+k*k)))/2),en=J(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=U(V,W,G,H,s,x,t),r=U(N,Q,L,M,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(G,H),a.arc(0,0,s,m,g,!t)):a.moveTo(G,H),!(u>y)||!(P>y)?a.lineTo(L,M):p>y?(e=U(L,M,N,Q,u,-p,t),r=U(G,H,V,W,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[F(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:j(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:j(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:j(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:j(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:j(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:j(+n),i):A},i.padAngle=function(n){return arguments.length?(z=typeof n=="function"?n:j(+n),i):z},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};