@debian777/kairos-mcp 3.3.3 → 3.4.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 (94) hide show
  1. package/README.md +179 -105
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/cli/commands/mint.d.ts.map +1 -1
  4. package/dist/cli/commands/mint.js +9 -1
  5. package/dist/cli/commands/mint.js.map +1 -1
  6. package/dist/embed-docs/mem/00000000-0000-0000-0000-000000002001.md +124 -162
  7. package/dist/embed-docs/mem/00000000-0000-0000-0000-000000002002.md +36 -34
  8. package/dist/embed-docs/mem/00000000-0000-0000-0000-000000002003.md +195 -0
  9. package/dist/embed-docs/mem/00000000-0000-0000-0000-000000002004.md +240 -0
  10. package/dist/embed-docs/mem/README.md +24 -0
  11. package/dist/resources/docs-resources.d.ts.map +1 -1
  12. package/dist/resources/docs-resources.js +9 -1
  13. package/dist/resources/docs-resources.js.map +1 -1
  14. package/dist/resources/embedded-mcp-resources.d.ts +14 -0
  15. package/dist/resources/embedded-mcp-resources.d.ts.map +1 -1
  16. package/dist/resources/embedded-mcp-resources.js +33 -9
  17. package/dist/resources/embedded-mcp-resources.js.map +1 -1
  18. package/dist/resources/mem-resources-boot.d.ts.map +1 -1
  19. package/dist/resources/mem-resources-boot.js +11 -3
  20. package/dist/resources/mem-resources-boot.js.map +1 -1
  21. package/dist/services/chain-step-count.d.ts +23 -0
  22. package/dist/services/chain-step-count.d.ts.map +1 -0
  23. package/dist/services/chain-step-count.js +23 -0
  24. package/dist/services/chain-step-count.js.map +1 -0
  25. package/dist/services/chain-utils.d.ts.map +1 -1
  26. package/dist/services/chain-utils.js +14 -9
  27. package/dist/services/chain-utils.js.map +1 -1
  28. package/dist/services/memory/store-methods.d.ts.map +1 -1
  29. package/dist/services/memory/store-methods.js +20 -12
  30. package/dist/services/memory/store-methods.js.map +1 -1
  31. package/dist/services/qdrant/memory-retrieval.d.ts +6 -1
  32. package/dist/services/qdrant/memory-retrieval.d.ts.map +1 -1
  33. package/dist/services/qdrant/memory-retrieval.js +21 -3
  34. package/dist/services/qdrant/memory-retrieval.js.map +1 -1
  35. package/dist/services/qdrant/service.d.ts +1 -1
  36. package/dist/services/qdrant/service.d.ts.map +1 -1
  37. package/dist/services/qdrant/service.js +2 -2
  38. package/dist/services/qdrant/service.js.map +1 -1
  39. package/dist/tools/kairos-challenge-display.d.ts.map +1 -1
  40. package/dist/tools/kairos-challenge-display.js +32 -2
  41. package/dist/tools/kairos-challenge-display.js.map +1 -1
  42. package/dist/tools/kairos_begin.d.ts +5 -0
  43. package/dist/tools/kairos_begin.d.ts.map +1 -1
  44. package/dist/tools/kairos_begin.js +8 -8
  45. package/dist/tools/kairos_begin.js.map +1 -1
  46. package/dist/tools/kairos_begin_schema.d.ts +5 -0
  47. package/dist/tools/kairos_begin_schema.d.ts.map +1 -1
  48. package/dist/tools/kairos_begin_schema.js +6 -1
  49. package/dist/tools/kairos_begin_schema.js.map +1 -1
  50. package/dist/tools/kairos_dump.js +1 -1
  51. package/dist/tools/kairos_dump.js.map +1 -1
  52. package/dist/tools/kairos_next-previous-step.d.ts.map +1 -1
  53. package/dist/tools/kairos_next-previous-step.js +11 -3
  54. package/dist/tools/kairos_next-previous-step.js.map +1 -1
  55. package/dist/tools/kairos_next_schema.d.ts +5 -0
  56. package/dist/tools/kairos_next_schema.d.ts.map +1 -1
  57. package/dist/tools/kairos_next_schema.js +7 -1
  58. package/dist/tools/kairos_next_schema.js.map +1 -1
  59. package/dist/tools/shell-challenge-invocation.d.ts +32 -0
  60. package/dist/tools/shell-challenge-invocation.d.ts.map +1 -0
  61. package/dist/tools/shell-challenge-invocation.js +113 -0
  62. package/dist/tools/shell-challenge-invocation.js.map +1 -0
  63. package/dist/types/memory.d.ts +10 -0
  64. package/dist/types/memory.d.ts.map +1 -1
  65. package/dist/ui/assets/{AccountPage-kxmPtqQP.js → AccountPage-BL4GHk9f.js} +1 -1
  66. package/dist/ui/assets/{ErrorAlert-ME7tEJ6X.js → ErrorAlert-KEgeKl22.js} +1 -1
  67. package/dist/ui/assets/{HomePage-DxiAsvs-.js → HomePage-DWAvtfBC.js} +1 -1
  68. package/dist/ui/assets/KairosPage-DZpZ35yd.js +1 -0
  69. package/dist/ui/assets/NotFoundPage-BrPNDuhe.js +1 -0
  70. package/dist/ui/assets/{ProtocolDetailPage-DKaSVepL.js → ProtocolDetailPage-R0XlRsIa.js} +1 -1
  71. package/dist/ui/assets/ProtocolEditPage-CzAnruE6.js +5 -0
  72. package/dist/ui/assets/{RenderedMarkdown-DjbuQlBl.js → RenderedMarkdown-CMavJdAJ.js} +1 -1
  73. package/dist/ui/assets/RunGuidedPage-Cm68aCC7.js +1 -0
  74. package/dist/ui/assets/{RunsPage-ctnsEF2U.js → RunsPage-DcDoMCq1.js} +1 -1
  75. package/dist/ui/assets/{SkillBundlePage-CaWW5oGq.js → SkillBundlePage-LuYOnVDQ.js} +1 -1
  76. package/dist/ui/assets/index-0G3wloMr.css +2 -0
  77. package/dist/ui/assets/index-S4_XWO39.js +8 -0
  78. package/dist/ui/assets/{tiptap-kMFBDujG.js → tiptap-CzV8H9Mb.js} +22 -22
  79. package/dist/ui/assets/useProtocol-C3ClZHlN.js +4 -0
  80. package/dist/ui/assets/{useSpaces-BV6eUjY3.js → useSpaces-DQEfGh8E.js} +1 -1
  81. package/dist/ui/assets/{vendor-GiUVcjs7.js → vendor-CVpIjmrD.js} +1 -1
  82. package/dist/ui/index.html +4 -4
  83. package/dist/utils/space-filter.d.ts +8 -0
  84. package/dist/utils/space-filter.d.ts.map +1 -1
  85. package/dist/utils/space-filter.js +18 -0
  86. package/dist/utils/space-filter.js.map +1 -1
  87. package/package.json +2 -1
  88. package/dist/ui/assets/KairosPage-BkqYs3-_.js +0 -1
  89. package/dist/ui/assets/NotFoundPage-DyfbQ-6G.js +0 -1
  90. package/dist/ui/assets/ProtocolEditPage-D-aTavvx.js +0 -1
  91. package/dist/ui/assets/RunGuidedPage-BUD0MaGh.js +0 -1
  92. package/dist/ui/assets/index-Duu55PkQ.css +0 -2
  93. package/dist/ui/assets/index-bQSxsGMU.js +0 -8
  94. package/dist/ui/assets/useProtocol-BruWpIzq.js +0 -4
@@ -5,12 +5,12 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <link rel="icon" type="image/svg+xml" href="/ui/favicon.svg" />
7
7
  <title>KAIROS MCP</title>
8
- <script type="module" crossorigin src="/ui/assets/index-bQSxsGMU.js"></script>
8
+ <script type="module" crossorigin src="/ui/assets/index-S4_XWO39.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/ui/assets/rolldown-runtime-Dw2cE7zH.js">
10
10
  <link rel="modulepreload" crossorigin href="/ui/assets/react-BdWJx0XL.js">
11
- <link rel="modulepreload" crossorigin href="/ui/assets/tiptap-kMFBDujG.js">
12
- <link rel="modulepreload" crossorigin href="/ui/assets/vendor-GiUVcjs7.js">
13
- <link rel="stylesheet" crossorigin href="/ui/assets/index-Duu55PkQ.css">
11
+ <link rel="modulepreload" crossorigin href="/ui/assets/tiptap-CzV8H9Mb.js">
12
+ <link rel="modulepreload" crossorigin href="/ui/assets/vendor-CVpIjmrD.js">
13
+ <link rel="stylesheet" crossorigin href="/ui/assets/index-0G3wloMr.css">
14
14
  </head>
15
15
  <body>
16
16
  <div id="root"></div>
@@ -12,4 +12,12 @@ export interface QdrantFilterMust {
12
12
  export declare function buildSpaceFilter(allowedSpaceIds: string[], existingFilter?: QdrantFilterMust): {
13
13
  must: Array<Record<string, unknown>>;
14
14
  };
15
+ /**
16
+ * Scroll filter for chain siblings: same `chain.id` and either `space_id` in the allowed set
17
+ * or legacy rows with no `space_id` (Qdrant `match any` does not match missing payload keys).
18
+ * Still requires `chain.id`; this is not an unscoped chain-id-only fallback.
19
+ */
20
+ export declare function buildChainSiblingScrollFilter(allowedSpaceIds: string[], chainId: string): {
21
+ must: Array<Record<string, unknown>>;
22
+ };
15
23
  //# sourceMappingURL=space-filter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"space-filter.d.ts","sourceRoot":"","sources":["../../src/utils/space-filter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,sDAAsD;AACtD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,eAAe,EAAE,MAAM,EAAE,EACzB,cAAc,CAAC,EAAE,gBAAgB,GAChC;IAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAAE,CAS1C"}
1
+ {"version":3,"file":"space-filter.d.ts","sourceRoot":"","sources":["../../src/utils/space-filter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,sDAAsD;AACtD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,eAAe,EAAE,MAAM,EAAE,EACzB,cAAc,CAAC,EAAE,gBAAgB,GAChC;IAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAAE,CAS1C;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,MAAM,EAAE,EACzB,OAAO,EAAE,MAAM,GACd;IAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAAE,CAY1C"}
@@ -15,4 +15,22 @@ export function buildSpaceFilter(allowedSpaceIds, existingFilter) {
15
15
  must: [spaceCondition, ...existingMust]
16
16
  };
17
17
  }
18
+ /**
19
+ * Scroll filter for chain siblings: same `chain.id` and either `space_id` in the allowed set
20
+ * or legacy rows with no `space_id` (Qdrant `match any` does not match missing payload keys).
21
+ * Still requires `chain.id`; this is not an unscoped chain-id-only fallback.
22
+ */
23
+ export function buildChainSiblingScrollFilter(allowedSpaceIds, chainId) {
24
+ return {
25
+ must: [
26
+ { key: 'chain.id', match: { value: chainId } },
27
+ {
28
+ should: [
29
+ { key: 'space_id', match: { any: allowedSpaceIds } },
30
+ { is_empty: { key: 'space_id' } }
31
+ ]
32
+ }
33
+ ]
34
+ };
35
+ }
18
36
  //# sourceMappingURL=space-filter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"space-filter.js","sourceRoot":"","sources":["../../src/utils/space-filter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,eAAyB,EACzB,cAAiC;IAEjC,MAAM,cAAc,GAAG;QACrB,GAAG,EAAE,UAAU;QACf,KAAK,EAAE,EAAE,GAAG,EAAE,eAAe,EAAE;KAChC,CAAC;IACF,MAAM,YAAY,GAAG,cAAc,EAAE,IAAI,IAAI,EAAE,CAAC;IAChD,OAAO;QACL,IAAI,EAAE,CAAC,cAAc,EAAE,GAAG,YAAY,CAAC;KACxC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"space-filter.js","sourceRoot":"","sources":["../../src/utils/space-filter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,eAAyB,EACzB,cAAiC;IAEjC,MAAM,cAAc,GAAG;QACrB,GAAG,EAAE,UAAU;QACf,KAAK,EAAE,EAAE,GAAG,EAAE,eAAe,EAAE;KAChC,CAAC;IACF,MAAM,YAAY,GAAG,cAAc,EAAE,IAAI,IAAI,EAAE,CAAC;IAChD,OAAO;QACL,IAAI,EAAE,CAAC,cAAc,EAAE,GAAG,YAAY,CAAC;KACxC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,6BAA6B,CAC3C,eAAyB,EACzB,OAAe;IAEf,OAAO;QACL,IAAI,EAAE;YACJ,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YAC9C;gBACE,MAAM,EAAE;oBACN,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,eAAe,EAAE,EAAE;oBACpD,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE;iBAClC;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@debian777/kairos-mcp",
3
- "version": "3.3.3",
3
+ "version": "3.4.0",
4
4
  "description": "MCP server for agent automation: persistent memory and deterministic workflow execution for AI agents and chats",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -110,6 +110,7 @@
110
110
  "@napi-rs/keyring": "^1.2.0",
111
111
  "@qdrant/js-client-rest": "^1.17.0",
112
112
  "@tanstack/react-query": "^5.62.0",
113
+ "@tiptap/core": "^3.20.2",
113
114
  "@tiptap/extension-link": "^3.20.2",
114
115
  "@tiptap/extension-table": "^3.20.1",
115
116
  "@tiptap/markdown": "^3.20.2",
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{a as t,g as n,p as r,y as i}from"./vendor-GiUVcjs7.js";import{i as a,t as o}from"./react-BdWJx0XL.js";import"./tiptap-kMFBDujG.js";import{t as s}from"./api-D88c6lbH.js";import{t as c}from"./useSpaces-BV6eUjY3.js";import{t as l}from"./ErrorAlert-ME7tEJ6X.js";var u=e(a(),1);async function d(e){let t=await s(`/api/kairos_search`,{method:`POST`,body:JSON.stringify({query:e.trim()})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.message??t.statusText)}return t.json()}function f(e,t){return n({queryKey:[`search`,e],queryFn:()=>d(e),enabled:t&&e.trim().length>0})}var p=o();function m(){return(0,p.jsx)(`ul`,{className:`list-none p-0 m-0 space-y-2`,role:`list`,"aria-hidden":`true`,children:[1,2,3].map(e=>(0,p.jsxs)(`li`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-4 flex justify-between items-start gap-4`,children:[(0,p.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-2`,children:[(0,p.jsx)(`div`,{className:`h-5 w-3/4 rounded bg-[var(--color-border)] animate-pulse`}),(0,p.jsx)(`div`,{className:`h-4 w-1/2 rounded bg-[var(--color-border)] animate-pulse`}),(0,p.jsx)(`div`,{className:`h-5 w-16 rounded bg-[var(--color-border)] animate-pulse`})]}),(0,p.jsx)(`div`,{className:`h-10 w-20 rounded-[var(--radius-md)] bg-[var(--color-border)] animate-pulse flex-shrink-0`})]},e))})}var h={match:`bg-[#dcfce7] text-[#166534]`,refine:`bg-[#dbeafe] text-[#1e40af]`,create:`bg-[#fef3c7] text-[#92400e]`},g=`ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``),_=`kairos://mem/`;function v(){let{t:e}=i(),[n,a]=r(),o=n.get(`q`)??``,[s,d]=(0,u.useState)(o),[v,y]=(0,u.useState)(o),[b,x]=(0,u.useState)(null),{data:S,isLoading:C,isError:w,error:T,refetch:E}=f(v,!!v),D=!v,{data:O,isLoading:k,isError:A,error:j,refetch:M}=c(D,{includeChainTitles:!0});(0,u.useEffect)(()=>{let e=n.get(`q`)??``;d(e),y(e)},[n]);let N=e=>{e.preventDefault(),y(s),a(s?{q:s}:{},{replace:!0})},P=S?.choices??[],F={match:0,refine:1,create:2},I=P.slice().sort((e,t)=>{let n=(F[e.role]??99)-(F[t.role]??99);if(n!==0)return n;let r=e.score??-1;return(t.score??-1)-r}),L=I.length>0?Math.max(...I.map(e=>e.score==null?0:e.score*100)):null,{browseChains:R,countsByLetter:z}=(0,u.useMemo)(()=>{let e=[];for(let t of O?.spaces??[])for(let n of t.chains??[])e.push({chain_id:n.chain_id,title:n.title,step_count:n.step_count});let t={};for(let e of g)t[e]=0;for(let n of e){let e=(n.title??``).trim().charAt(0).toUpperCase();g.includes(e)&&(t[e]=(t[e]??0)+1)}return{browseChains:e,countsByLetter:t}},[O?.spaces]),B=(0,u.useMemo)(()=>b?R.filter(e=>(e.title??``).trim().charAt(0).toUpperCase()===b):[],[R,b]);return(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h1`,{className:`text-[var(--color-text-heading)] text-2xl font-semibold mb-1`,children:e(`kairos.title`)}),(0,p.jsx)(`p`,{className:`text-sm text-[var(--color-text-muted)] mb-8`,children:e(`kairos.searchHint`)}),(0,p.jsxs)(`section`,{className:`mb-8`,"aria-labelledby":`browse-search-label`,children:[(0,p.jsx)(`h2`,{id:`browse-search-label`,className:`sr-only`,children:e(`kairos.searchLabel`)}),(0,p.jsxs)(`form`,{onSubmit:N,className:`mb-6 max-w-xl`,"aria-label":e(`kairos.searchLabel`),children:[(0,p.jsx)(`label`,{htmlFor:`kairos-search-query`,className:`block font-medium text-[var(--color-text-heading)] mb-2`,children:e(`kairos.searchLabel`)}),(0,p.jsx)(`input`,{id:`kairos-search-query`,type:`search`,value:s,onChange:e=>d(e.target.value),placeholder:e(`kairos.searchPlaceholder`),"aria-describedby":`kairos-search-hint`,className:`w-full min-h-[44px] px-4 py-2 border border-[var(--color-border)] rounded-[var(--radius-md)] text-[var(--color-text)] bg-[var(--color-surface)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`}),(0,p.jsx)(`p`,{id:`kairos-search-hint`,className:`text-sm text-[var(--color-text-muted)] mt-2`,children:e(`kairos.searchHint`)}),(0,p.jsx)(`button`,{type:`submit`,className:`mt-3 min-h-[44px] min-w-[44px] px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white border-0 cursor-pointer hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`kairos.search`)})]})]}),w&&(0,p.jsx)(l,{message:T instanceof Error?T.message:String(T),onRetry:()=>E(),showGoBack:!0}),D&&A&&(0,p.jsx)(l,{message:j instanceof Error?j.message:String(j),onRetry:()=>M(),showGoBack:!0}),C&&v&&(0,p.jsxs)(`div`,{className:`mb-4`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,p.jsx)(`p`,{className:`sr-only`,children:e(`kairos.loading`)}),(0,p.jsx)(m,{})]}),D&&k&&(0,p.jsxs)(`div`,{className:`mb-4`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,p.jsx)(`p`,{className:`sr-only`,children:e(`kairos.loading`)}),(0,p.jsx)(m,{})]}),!C&&!w&&!(D&&A)&&(0,p.jsx)(p.Fragment,{children:v?I.length===0?(0,p.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-6`,role:`status`,"aria-live":`polite`,children:[(0,p.jsx)(`p`,{className:`text-[var(--color-text-muted)] mb-4`,children:e(`kairos.empty`)}),(0,p.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,p.jsx)(t,{to:`/kairos`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium border border-[var(--color-border)] text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`kairos.refineSearch`)}),(0,p.jsx)(t,{to:`/protocols/new`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white border-0 no-underline hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`kairos.createNew`)})]})]}):v?(0,p.jsxs)(p.Fragment,{children:[I.length>0&&(0,p.jsx)(`p`,{id:`kairos-results-summary`,className:`text-sm text-[var(--color-text-muted)] mb-4`,"aria-live":`polite`,role:`status`,children:e(`kairos.foundMatches`,{count:I.length,top:L==null?0:Math.round(L)})}),(0,p.jsx)(`ul`,{className:`list-none p-0 m-0 space-y-2`,role:`list`,"aria-label":e(`kairos.resultsLabel`),children:I.map(n=>(0,p.jsxs)(`li`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-5 flex justify-between items-start gap-4`,children:[(0,p.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,p.jsx)(`span`,{className:`font-medium text-[var(--color-text-heading)] block`,children:n.label}),(0,p.jsxs)(`div`,{className:`text-sm text-[var(--color-text-muted)] mt-1`,children:[n.chain_label??(n.role===`refine`?e(`kairos.refineMeta`):n.role===`create`?e(`kairos.createMeta`):``),n.score!=null&&` · ${e(`kairos.score`)}: ${Math.round(n.score*100)}%`,n.protocol_version&&` · ${e(`kairos.version`)}: ${n.protocol_version}`]}),(0,p.jsx)(`span`,{className:`inline-block mt-1 text-xs uppercase tracking-wide px-2 py-0.5 rounded ${h[n.role]??`bg-[var(--color-surface)] text-[var(--color-text-muted)]`}`,"aria-label":`Role: ${n.role}`,children:n.role}),n.tags?.length>0&&(0,p.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2`,"aria-label":e(`kairos.tagsLabel`),children:n.tags.slice(0,8).map(e=>(0,p.jsx)(`span`,{className:`inline-block text-xs px-2 py-0.5 rounded bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-muted)]`,children:e},e))})]}),(0,p.jsxs)(`div`,{className:`flex-shrink-0`,children:[n.role===`match`&&(0,p.jsx)(t,{to:`/protocols/${encodeURIComponent(n.uri)}`,"aria-label":e(`kairos.viewProtocol`,{title:n.label}),className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white no-underline hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`kairos.view`)}),n.role===`refine`&&(0,p.jsx)(t,{to:`/protocols/${encodeURIComponent(n.uri)}`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white no-underline hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`kairos.refineSearch`)}),n.role===`create`&&(0,p.jsx)(t,{to:`/protocols/new`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white no-underline hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`kairos.createNew`)})]})]},n.uri))})]}):null:(0,p.jsxs)(`section`,{"aria-labelledby":`browse-by-label-heading`,children:[(0,p.jsx)(`h2`,{id:`browse-by-label-heading`,className:`text-lg font-semibold text-[var(--color-text-heading)] mb-3`,children:e(`kairos.browseByLabel`)}),(0,p.jsx)(`p`,{className:`text-sm text-[var(--color-text-muted)] mb-4`,children:e(`kairos.browseByLetterHint`)}),!k&&(0,p.jsx)(`div`,{className:`flex flex-wrap gap-2 mb-4`,role:`group`,"aria-label":e(`kairos.browseByLabel`),children:g.map(t=>{let n=z[t]??0;return(0,p.jsxs)(`button`,{type:`button`,onClick:()=>x(e=>e===t?null:t),"aria-expanded":b===t,"aria-controls":`browse-letter-panel-${t}`,"aria-pressed":b===t,"aria-label":e(`kairos.letterCount`,{letter:t,count:n}),className:`min-h-[var(--layout-touch-target)] min-w-[var(--layout-touch-target)] inline-flex items-center justify-center rounded-[var(--radius-md)] border px-3 py-2 text-sm font-medium transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2 ${b===t?`border-[var(--color-primary)] bg-[var(--color-surface-elevated)] text-[var(--color-primary)]`:`border-[var(--color-border)] bg-[var(--color-surface)] text-[var(--color-text)] hover:bg-[var(--color-surface-elevated)]`}`,children:[t,`: `,n]},t)})}),b&&!k&&(0,p.jsxs)(`div`,{id:`browse-letter-panel-${b}`,role:`region`,"aria-labelledby":`browse-letter-panel-heading`,"aria-live":`polite`,className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-5`,children:[(0,p.jsx)(`h3`,{id:`browse-letter-panel-heading`,className:`text-base font-semibold text-[var(--color-text-heading)] mb-3`,children:e(`kairos.labelsStartingWith`,{letter:b})}),B.length===0?(0,p.jsx)(`p`,{className:`text-sm text-[var(--color-text-muted)]`,children:e(`kairos.noLabelsForLetter`)}):(0,p.jsx)(`ul`,{className:`list-none p-0 m-0 space-y-2`,role:`list`,"aria-label":e(`kairos.labelsStartingWith`,{letter:b}),children:B.map(n=>{let r=`${_}${n.chain_id}`;return(0,p.jsxs)(`li`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-[var(--radius-sm)] border border-[var(--color-border)] bg-[var(--color-surface)] p-3`,children:[(0,p.jsx)(`span`,{className:`font-medium text-[var(--color-text-heading)]`,children:n.title}),(0,p.jsx)(t,{to:`/protocols/${encodeURIComponent(r)}`,"aria-label":e(`kairos.viewProtocol`,{title:n.title}),className:`min-h-[var(--layout-touch-target)] min-w-[var(--layout-touch-target)] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white no-underline hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`kairos.view`)})]},n.chain_id)})})]})]})})]})}export{v as KairosPage};
@@ -1 +0,0 @@
1
- import{y as e}from"./vendor-GiUVcjs7.js";import{t}from"./react-BdWJx0XL.js";import"./tiptap-kMFBDujG.js";import{t as n}from"./ErrorAlert-ME7tEJ6X.js";var r=t();function i(){let{t}=e();return(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`h1`,{className:`text-[var(--color-text-heading)] text-2xl font-semibold mb-4`,children:t(`notFound.title`)}),(0,r.jsx)(n,{message:t(`notFound.message`),showGoBack:!0})]})}export{i as NotFoundPage};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{a as t,d as n,f as r,t as i,y as a}from"./vendor-GiUVcjs7.js";import{i as o,t as s}from"./react-BdWJx0XL.js";import{a as c,c as l,i as u,l as d,n as f,o as p,r as m,s as h,t as g}from"./tiptap-kMFBDujG.js";import{t as _}from"./api-D88c6lbH.js";import{i as v,n as y,r as b,t as x}from"./useProtocol-BruWpIzq.js";var S=e(o(),1),C=s(),w=`min-h-[11rem] px-4 py-3 text-sm leading-6 text-[var(--color-text)] focus:outline-none prose prose-sm max-w-none [&_table]:my-3 [&_table]:w-full [&_table]:border-collapse [&_th]:border [&_th]:border-[var(--color-border)] [&_th]:bg-[var(--color-surface-elevated)] [&_th]:px-2 [&_th]:py-1.5 [&_td]:border [&_td]:border-[var(--color-border)] [&_td]:px-2 [&_td]:py-1.5`;function T({children:e,className:t=`h-4 w-4`}){return(0,C.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:t,children:e})}function E(){return(0,C.jsxs)(T,{children:[(0,C.jsx)(`circle`,{cx:`3`,cy:`4`,r:`1`,fill:`currentColor`,stroke:`none`}),(0,C.jsx)(`circle`,{cx:`3`,cy:`8`,r:`1`,fill:`currentColor`,stroke:`none`}),(0,C.jsx)(`circle`,{cx:`3`,cy:`12`,r:`1`,fill:`currentColor`,stroke:`none`}),(0,C.jsx)(`path`,{d:`M6 4h7`}),(0,C.jsx)(`path`,{d:`M6 8h7`}),(0,C.jsx)(`path`,{d:`M6 12h7`})]})}function D(){return(0,C.jsxs)(T,{children:[(0,C.jsx)(`path`,{d:`M6 10L4.5 11.5a2.5 2.5 0 1 1-3.5-3.5L2.5 6.5`}),(0,C.jsx)(`path`,{d:`M10 6l1.5-1.5a2.5 2.5 0 1 1 3.5 3.5L13.5 9.5`}),(0,C.jsx)(`path`,{d:`M5.5 10.5l5-5`})]})}function O(){return(0,C.jsxs)(T,{children:[(0,C.jsx)(`path`,{d:`M5.5 5.5A2.5 2.5 0 0 0 3 8v2.5h3V8H4.5`}),(0,C.jsx)(`path`,{d:`M11.5 5.5A2.5 2.5 0 0 0 9 8v2.5h3V8h-1.5`})]})}function k(){return(0,C.jsxs)(T,{children:[(0,C.jsx)(`path`,{d:`M6 5.5l2 5-2 5`}),(0,C.jsx)(`path`,{d:`M10 5.5l2 5-2 5`})]})}function A(){return(0,C.jsxs)(T,{children:[(0,C.jsx)(`path`,{d:`M6 4L2.5 8L6 12`}),(0,C.jsx)(`path`,{d:`M10 4l3.5 4L10 12`}),(0,C.jsx)(`path`,{d:`M8.75 3.5L7.25 12.5`})]})}function j(){return(0,C.jsxs)(T,{children:[(0,C.jsx)(`path`,{d:`M2 3h12v2H2V3z`}),(0,C.jsx)(`path`,{d:`M2 7h12v1H2V7z`}),(0,C.jsx)(`path`,{d:`M2 11h12v1H2v-1z`}),(0,C.jsx)(`path`,{d:`M2 15h12v1H2v-1z`}),(0,C.jsx)(`path`,{d:`M2 4v11`}),(0,C.jsx)(`path`,{d:`M6 4v11`}),(0,C.jsx)(`path`,{d:`M10 4v11`}),(0,C.jsx)(`path`,{d:`M14 4v11`})]})}function M({label:e,ariaLabel:t,active:n,onClick:r}){return(0,C.jsx)(`button`,{type:`button`,"aria-label":t,title:t,onClick:r,className:`inline-flex min-h-[36px] min-w-[36px] items-center justify-center rounded-[var(--radius-sm)] border px-3 text-xs font-medium transition-colors ${n?`border-[var(--color-primary)] bg-[var(--color-primary)] text-white`:`border-[var(--color-border)] bg-[var(--color-surface)] text-[var(--color-text-muted)] hover:bg-[var(--color-surface)] hover:text-[var(--color-text)]`}`,children:e})}function N({editor:e}){return e?(0,C.jsxs)(`div`,{className:`flex flex-wrap gap-2 border-b border-[var(--color-border)] bg-[var(--color-surface-elevated)] px-3 py-2`,children:[(0,C.jsx)(M,{label:(0,C.jsx)(`span`,{className:`text-base leading-none`,children:`¶`}),ariaLabel:`Paragraph`,active:e.isActive(`paragraph`),onClick:()=>e.chain().focus().setParagraph().run()}),(0,C.jsx)(M,{label:(0,C.jsx)(`strong`,{className:`text-sm font-semibold`,children:`B`}),ariaLabel:`Bold`,active:e.isActive(`bold`),onClick:()=>e.chain().focus().toggleBold().run()}),(0,C.jsx)(M,{label:(0,C.jsx)(`em`,{className:`text-sm`,children:`I`}),ariaLabel:`Italic`,active:e.isActive(`italic`),onClick:()=>e.chain().focus().toggleItalic().run()}),(0,C.jsx)(M,{label:(0,C.jsx)(E,{}),ariaLabel:`Bullet list`,active:e.isActive(`bulletList`),onClick:()=>e.chain().focus().toggleBulletList().run()}),(0,C.jsx)(M,{label:(0,C.jsx)(`span`,{className:`text-sm font-semibold`,children:`1.`}),ariaLabel:`Numbered list`,active:e.isActive(`orderedList`),onClick:()=>e.chain().focus().toggleOrderedList().run()}),(0,C.jsx)(M,{label:(0,C.jsx)(D,{}),ariaLabel:`Link`,active:e.isActive(`link`),onClick:()=>{let t=e.getAttributes(`link`).href,n=window.prompt(`Enter URL`,t??`https://`);if(n==null)return;let r=n.trim();if(!r){e.chain().focus().unsetLink().run();return}e.chain().focus().extendMarkRange(`link`).setLink({href:r}).run()}}),(0,C.jsx)(M,{label:(0,C.jsx)(O,{}),ariaLabel:`Quote`,active:e.isActive(`blockquote`),onClick:()=>e.chain().focus().toggleBlockquote().run()}),(0,C.jsx)(M,{label:(0,C.jsx)(k,{}),ariaLabel:`Inline code`,active:e.isActive(`code`),onClick:()=>e.chain().focus().toggleCode().run()}),(0,C.jsx)(M,{label:(0,C.jsx)(A,{}),ariaLabel:`Code block`,active:e.isActive(`codeBlock`),onClick:()=>e.chain().focus().toggleCodeBlock().run()}),(0,C.jsx)(M,{label:(0,C.jsx)(j,{}),ariaLabel:`Insert table`,active:e.isActive(`table`),onClick:()=>e.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run()})]}):null}function P({value:e,onChange:t,label:n,hint:r,id:i,contentKey:a}){let o=(0,S.useRef)(a),s=d({key:a??`default`,immediatelyRender:!1,extensions:[p.configure({heading:!1,link:!1}),h.configure({openOnClick:!1,autolink:!1}),g.configure({resizable:!1}),u,f,m,c],content:e,contentType:`markdown`,editorProps:{attributes:{class:w}},onUpdate:({editor:n})=>{let r=n.getMarkdown?.()??``;r!==e&&t(r)}});return(0,S.useEffect)(()=>{!s||a===o.current||(o.current=a,s.commands.setContent(e,!1,{contentType:`markdown`,preserveWhitespace:`full`}))},[a,e,s]),(0,C.jsxs)(`div`,{children:[n&&(0,C.jsx)(`label`,{htmlFor:i,className:`mb-2 block font-medium text-[var(--color-text-heading)]`,children:n}),(0,C.jsxs)(`div`,{className:`overflow-hidden rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)]`,children:[(0,C.jsx)(N,{editor:s}),(0,C.jsx)(l,{editor:s})]}),r&&(0,C.jsx)(`p`,{className:`mt-2 text-sm text-[var(--color-text-muted)]`,children:r})]})}var F=i().min(1,`Protocol content is required`).refine(e=>e.includes(`# `),`Protocol must have an H1 title`).refine(e=>/(^|\n)##\s+Natural language triggers\b/i.test(e),`Include a "Natural language triggers" section (H2)`).refine(e=>/(^|\n)##\s+Completion rule\b/i.test(e),`Include a "Completion rule" section (H2)`),I={label:`Step`,bodyMarkdown:`What the user or agent does in this step.`,type:`comment`,comment:{min_length:10}},L=[`shell`,`mcp`,`user_input`,`comment`];function R(){let{t:e}=a(),{uri:i}=r(),o=n(),s=i?decodeURIComponent(i):void 0,c=!s,{data:l,isLoading:u}=v(s,!c),[d,f]=(0,S.useState)({protocolLabel:``,triggersMarkdown:``,steps:[{...I}],completionMarkdown:``}),[p,m]=(0,S.useState)(()=>String(Date.now())),[h,g]=(0,S.useState)(!1),[w,T]=(0,S.useState)(null),[E,D]=(0,S.useState)(null),O=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(l?.markdown_doc)try{f(b(l.markdown_doc)),m(String(Date.now()))}catch{f({protocolLabel:l.label||`Protocol`,triggersMarkdown:``,steps:[{...I}],completionMarkdown:``})}},[l]);let k=e=>{let t=e.target.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>{let e=typeof n.result==`string`?n.result:``;try{f(b(e)),m(String(Date.now())),D(null),T(null)}catch{T(`Could not parse the uploaded file. Use valid protocol markdown.`)}},n.readAsText(t,`UTF-8`),e.target.value=``},A=(e,t)=>{f(n=>({...n,[e]:t}))},j=(e,t)=>{f(n=>({...n,steps:n.steps.map((n,r)=>r===e?typeof t==`function`?t(n):{...n,...t}:n)}))},M=()=>{f(e=>({...e,steps:[...e.steps,{...I,label:`Step ${e.steps.length+1}`}]}))},N=e=>{f(t=>({...t,steps:t.steps.filter((t,n)=>n!==e)}))},R=async e=>{e.preventDefault(),T(null),D(null);let t=x(d),n=F.safeParse(t);if(!n.success){D(n.error.errors[0]?.message??`Invalid`);return}g(!0);try{if(c){let e=await _(`/api/kairos_mint/raw`,{method:`POST`,headers:{"Content-Type":`text/markdown`},body:t});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.message??e.statusText)}let n=(await e.json()).items?.[0]?.uri;o(n?`/protocols/${encodeURIComponent(n)}`:`/`)}else{let e=await _(`/api/kairos_update`,{method:`POST`,body:JSON.stringify({uris:[s],markdown_doc:[t]})});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.message??e.statusText)}o(`/protocols/${encodeURIComponent(s)}`)}}catch(e){T(e instanceof Error?e.message:String(e))}finally{g(!1)}},z=(()=>{try{return y(x(d))}catch{return{title:d.protocolLabel||`Protocol`,steps:[],triggers:``,completion:``}}})();if(!c&&u&&!l)return(0,C.jsx)(`p`,{className:`text-[var(--color-text-muted)]`,children:e(`protocol.loading`)});let B={shell:e(`protocolEdit.challengeShell`),mcp:e(`protocolEdit.challengeMcp`),user_input:e(`protocolEdit.challengeUserInput`),comment:e(`protocolEdit.challengeComment`)};return(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h1`,{className:`mb-1 text-2xl font-semibold text-[var(--color-text-heading)]`,children:!c&&d.protocolLabel.trim()?d.protocolLabel.trim():e(c?`protocolEdit.newTitle`:`protocolEdit.editTitle`)}),(0,C.jsx)(`p`,{className:`mb-6 text-sm text-[var(--color-text-muted)]`,children:e(`protocolEdit.hint`)}),(0,C.jsxs)(`div`,{className:`mb-8 flex flex-wrap items-center justify-between gap-3 rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-5`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`font-medium text-[var(--color-text-heading)]`,children:`Import existing content`}),(0,C.jsx)(`p`,{className:`mt-1 text-sm text-[var(--color-text-muted)]`,children:e(`protocolEdit.uploadHint`)})]}),(0,C.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,C.jsx)(`input`,{ref:O,type:`file`,accept:`.md,text/markdown`,onChange:k,className:`sr-only`,id:`protocol-upload`,"aria-label":e(`protocolEdit.upload`)}),(0,C.jsx)(`button`,{type:`button`,onClick:()=>O.current?.click(),className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`protocolEdit.upload`)}),!c&&s&&(0,C.jsx)(t,{to:`/protocols/${encodeURIComponent(s)}/skill`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-2 text-sm font-medium text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`protocol.editAsSkill`)})]})]}),(0,C.jsx)(`form`,{onSubmit:R,"aria-label":e(`protocolEdit.formLabel`),children:(0,C.jsxs)(`div`,{className:`mb-6 grid gap-6 xl:grid-cols-[1.6fr_1fr]`,children:[(0,C.jsxs)(`div`,{className:`space-y-6`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`label`,{htmlFor:`protocol-label`,className:`mb-2 block font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.protocolLabel`)}),(0,C.jsx)(`input`,{id:`protocol-label`,type:`text`,value:d.protocolLabel,onChange:e=>A(`protocolLabel`,e.target.value),className:`min-h-[44px] w-full rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-3 text-sm text-[var(--color-text)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`})]}),(0,C.jsx)(P,{label:e(`protocolEdit.triggersLabel`),hint:e(`protocolEdit.triggersHint`),value:d.triggersMarkdown,onChange:e=>A(`triggersMarkdown`,e),contentKey:p}),d.steps.map((t,n)=>(0,C.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-5 space-y-5`,children:[(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,C.jsxs)(`div`,{className:`text-sm text-[var(--color-text-muted)]`,children:[`Step `,n+1,t.label.trim()?`: ${t.label.trim()}`:``]}),(0,C.jsx)(`button`,{type:`button`,onClick:()=>N(n),disabled:d.steps.length<=1,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2 disabled:opacity-50`,children:e(`protocolEdit.removeStep`)})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`label`,{className:`mb-2 block font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.stepLabel`)}),(0,C.jsx)(`input`,{type:`text`,value:t.label,onChange:e=>j(n,{label:e.target.value}),className:`min-h-[44px] w-full rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-3 text-sm text-[var(--color-text)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`mb-2 font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.challengeType`)}),(0,C.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:L.map(e=>(0,C.jsx)(`button`,{type:`button`,"aria-pressed":t.type===e,onClick:()=>j(n,{type:e,shell:e===`shell`?{cmd:t.shell?.cmd??``}:void 0,mcp:e===`mcp`?{tool_name:t.mcp?.tool_name??``}:void 0,user_input:e===`user_input`?{prompt:t.user_input?.prompt??``}:void 0,comment:e===`comment`?{min_length:t.comment?.min_length??10}:void 0}),className:`min-h-[44px] rounded-[var(--radius-md)] px-4 text-sm font-medium ${t.type===e?`bg-[var(--color-primary)] text-white`:`border border-[var(--color-border)] bg-[var(--color-surface)] text-[var(--color-text)]`}`,children:B[e]},e))})]}),(0,C.jsx)(`div`,{children:(0,C.jsx)(P,{label:e(`protocolEdit.stepContent`),value:t.bodyMarkdown,onChange:e=>j(n,{bodyMarkdown:e}),contentKey:p})}),(0,C.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] p-4`,children:[(0,C.jsx)(`div`,{className:`mb-3 text-sm font-medium text-[var(--color-text-heading)]`,children:`Challenge fields`}),(0,C.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[t.type===`shell`&&(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.shellCmd`)}),(0,C.jsx)(`input`,{type:`text`,value:t.shell?.cmd??``,onChange:e=>j(n,{shell:{cmd:e.target.value}}),className:`min-h-[44px] w-full rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] px-4 py-3 text-sm text-[var(--color-text)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`})]}),t.type===`mcp`&&(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.mcpToolName`)}),(0,C.jsx)(`input`,{type:`text`,value:t.mcp?.tool_name??``,onChange:e=>j(n,{mcp:{tool_name:e.target.value}}),className:`min-h-[44px] w-full rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] px-4 py-3 text-sm text-[var(--color-text)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`})]}),t.type===`user_input`&&(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.userInputPrompt`)}),(0,C.jsx)(`input`,{type:`text`,value:t.user_input?.prompt??``,onChange:e=>j(n,{user_input:{prompt:e.target.value}}),className:`min-h-[44px] w-full rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] px-4 py-3 text-sm text-[var(--color-text)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`})]}),t.type===`comment`&&(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.commentMinLength`)}),(0,C.jsx)(`input`,{type:`number`,min:1,value:t.comment?.min_length??10,onChange:e=>j(n,{comment:{min_length:Math.max(1,parseInt(e.target.value,10)||10)}}),className:`min-h-[44px] w-full rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] px-4 py-3 text-sm text-[var(--color-text)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`})]})]})]})]},n)),(0,C.jsx)(`button`,{type:`button`,onClick:M,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-2 text-sm font-medium text-[var(--color-text)] hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`protocolEdit.addStep`)}),(0,C.jsx)(P,{label:e(`protocolEdit.completionLabel`),value:d.completionMarkdown,onChange:e=>A(`completionMarkdown`,e),contentKey:p}),E&&(0,C.jsx)(`p`,{className:`text-sm text-[var(--color-error)]`,role:`alert`,children:E}),w&&(0,C.jsx)(`div`,{className:`rounded-[var(--radius-md)] bg-[var(--color-error-bg)] p-4 text-[var(--color-error)]`,role:`alert`,children:w}),(0,C.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,C.jsx)(`button`,{type:`submit`,disabled:h,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center rounded-[var(--radius-md)] bg-[var(--color-primary)] px-4 py-2 font-medium text-white hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2 disabled:opacity-60`,children:e(h?`protocolEdit.saving`:`protocolEdit.save`)}),(0,C.jsx)(t,{to:c?`/`:`/protocols/${encodeURIComponent(s)}`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-4 py-2 font-medium text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`protocolEdit.cancel`)})]})]}),(0,C.jsx)(`div`,{"aria-label":e(`protocolEdit.previewLabel`),children:(0,C.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-4`,children:[(0,C.jsx)(`div`,{className:`text-sm text-[var(--color-text-muted)]`,children:e(`protocolEdit.previewTitle`)}),(0,C.jsx)(`div`,{className:`mt-1 text-lg font-semibold text-[var(--color-text-heading)]`,children:z.title}),(0,C.jsxs)(`div`,{className:`mt-4`,children:[(0,C.jsx)(`div`,{className:`mb-2 text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.previewSteps`)}),z.steps.length===0?(0,C.jsx)(`div`,{className:`text-sm text-[var(--color-text-muted)]`,children:e(`protocolEdit.previewNoSteps`)}):(0,C.jsx)(`ul`,{className:`m-0 list-none space-y-2 p-0`,children:z.steps.slice(0,20).map((e,t)=>(0,C.jsxs)(`li`,{className:`rounded-[var(--radius-sm)] border border-[var(--color-border)] bg-[var(--color-surface)] p-3`,children:[(0,C.jsx)(`div`,{className:`font-medium text-[var(--color-text-heading)]`,children:e.label}),(0,C.jsx)(`div`,{className:`mt-1 text-sm text-[var(--color-text-muted)]`,children:e.summary})]},`${e.label}:${t}`))})]}),(0,C.jsxs)(`div`,{className:`mt-4`,children:[(0,C.jsx)(`div`,{className:`mb-2 text-sm font-medium text-[var(--color-text-heading)]`,children:e(`protocolEdit.previewSections`)}),(0,C.jsxs)(`div`,{className:`text-sm text-[var(--color-text-muted)]`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`strong`,{className:`text-[var(--color-text-heading)]`,children:[e(`protocol.triggers`),`:`]}),` `,z.triggers?e(`protocolEdit.present`):e(`protocolEdit.missing`)]}),(0,C.jsxs)(`div`,{className:`mt-1`,children:[(0,C.jsxs)(`strong`,{className:`text-[var(--color-text-heading)]`,children:[e(`protocol.completion`),`:`]}),` `,z.completion?e(`protocolEdit.present`):e(`protocolEdit.missing`)]})]})]})]})})]})})]})}export{R as ProtocolEditPage};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{a as t,f as n,h as r,p as i,y as a}from"./vendor-GiUVcjs7.js";import{i as o,t as s}from"./react-BdWJx0XL.js";import"./tiptap-kMFBDujG.js";import{t as c}from"./api-D88c6lbH.js";import{t as l}from"./ErrorAlert-ME7tEJ6X.js";import{t as u}from"./RenderedMarkdown-DjbuQlBl.js";import{n as d,t as f}from"./useRunSession-CciNdgs6.js";var p=e(o(),1),m=s();function h(e){let t=e.trim();return t?JSON.parse(t):null}function g({challenge:e,disabled:t,onSubmit:n}){let{t:r}=a(),i=e.type,[o,s]=(0,p.useState)(0),[c,l]=(0,p.useState)(``),[u,d]=(0,p.useState)(``),f=e.mcp?.tool_name??``,[g,_]=(0,p.useState)(!0),[v,y]=(0,p.useState)(``),[b,x]=(0,p.useState)(``),S=e.user_input?.prompt??``,[C,w]=(0,p.useState)(``),T=e.comment?.min_length??10,[E,D]=(0,p.useState)(``),[O,k]=(0,p.useState)(null);(0,p.useEffect)(()=>{k(null),s(0),l(``),d(``),_(!0),y(``),x(``),w(``),D(``)},[i,f,S,T]);let A=(0,p.useMemo)(()=>i===`shell`?Number.isFinite(o):i===`mcp`?f.trim().length>0:i===`user_input`?C.trim().length>0:i===`comment`?E.trim().length>=T:!1,[i,o,f,C,E,T]);return(0,m.jsxs)(`form`,{onSubmit:e=>{if(e.preventDefault(),k(null),A)try{if(i===`shell`){n({type:i,shell:{exit_code:o,...c.trim()?{stdout:c}:{},...u.trim()?{stderr:u}:{}}});return}if(i===`mcp`){let e=h(v),t=h(b);n({type:i,mcp:{tool_name:f,...e===null?{}:{arguments:e},result:t,success:g}});return}if(i===`user_input`){n({type:i,user_input:{confirmation:C.trim(),timestamp:new Date().toISOString()}});return}if(i===`comment`){n({type:i,comment:{text:E.trim()}});return}}catch(e){k(e instanceof Error?e.message:String(e))}},"aria-label":r(`run.solutionFormLabel`),children:[O&&(0,m.jsx)(`div`,{className:`mb-4 p-4 rounded-[var(--radius-md)] bg-[var(--color-error-bg)] text-[var(--color-error)]`,role:`alert`,children:O}),i===`shell`&&(0,m.jsxs)(`div`,{className:`space-y-4`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`label`,{htmlFor:`run-shell-exit-code`,className:`block font-medium text-[var(--color-text-heading)] mb-2`,children:r(`run.shell.exitCode`)}),(0,m.jsx)(`input`,{id:`run-shell-exit-code`,type:`number`,inputMode:`numeric`,value:o,onChange:e=>s(Number(e.target.value)),className:`w-full min-h-[44px] px-4 py-2 border border-[var(--color-border)] rounded-[var(--radius-md)] text-[var(--color-text)] bg-[var(--color-surface)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,disabled:t,required:!0})]}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`label`,{htmlFor:`run-shell-stdout`,className:`block font-medium text-[var(--color-text-heading)] mb-2`,children:r(`run.shell.stdout`)}),(0,m.jsx)(`textarea`,{id:`run-shell-stdout`,value:c,onChange:e=>l(e.target.value),className:`w-full min-h-[8rem] px-4 py-3 border border-[var(--color-border)] rounded-[var(--radius-md)] text-[var(--color-text)] bg-[var(--color-surface)] font-mono text-sm resize-y`,disabled:t})]}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`label`,{htmlFor:`run-shell-stderr`,className:`block font-medium text-[var(--color-text-heading)] mb-2`,children:r(`run.shell.stderr`)}),(0,m.jsx)(`textarea`,{id:`run-shell-stderr`,value:u,onChange:e=>d(e.target.value),className:`w-full min-h-[6rem] px-4 py-3 border border-[var(--color-border)] rounded-[var(--radius-md)] text-[var(--color-text)] bg-[var(--color-surface)] font-mono text-sm resize-y`,disabled:t})]})]}),i===`mcp`&&(0,m.jsxs)(`div`,{className:`space-y-4`,children:[(0,m.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] p-4`,children:[(0,m.jsx)(`div`,{className:`text-sm text-[var(--color-text-muted)]`,children:r(`run.mcp.toolName`)}),(0,m.jsx)(`div`,{className:`font-medium text-[var(--color-text-heading)] break-all`,children:f||r(`run.mcp.toolMissing`)})]}),(0,m.jsxs)(`label`,{className:`inline-flex items-center gap-2 min-h-[44px]`,children:[(0,m.jsx)(`input`,{type:`checkbox`,checked:g,onChange:e=>_(e.target.checked),disabled:t,className:`h-4 w-4`}),(0,m.jsx)(`span`,{className:`text-sm text-[var(--color-text)]`,children:r(`run.mcp.success`)})]}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`label`,{htmlFor:`run-mcp-args`,className:`block font-medium text-[var(--color-text-heading)] mb-2`,children:r(`run.mcp.arguments`)}),(0,m.jsx)(`textarea`,{id:`run-mcp-args`,value:v,onChange:e=>y(e.target.value),placeholder:`{ "example": true }`,className:`w-full min-h-[6rem] px-4 py-3 border border-[var(--color-border)] rounded-[var(--radius-md)] text-[var(--color-text)] bg-[var(--color-surface)] font-mono text-sm resize-y`,disabled:t})]}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`label`,{htmlFor:`run-mcp-result`,className:`block font-medium text-[var(--color-text-heading)] mb-2`,children:r(`run.mcp.result`)}),(0,m.jsx)(`textarea`,{id:`run-mcp-result`,value:b,onChange:e=>x(e.target.value),placeholder:`{ "ok": true }`,className:`w-full min-h-[10rem] px-4 py-3 border border-[var(--color-border)] rounded-[var(--radius-md)] text-[var(--color-text)] bg-[var(--color-surface)] font-mono text-sm resize-y`,disabled:t,required:!0})]})]}),i===`user_input`&&(0,m.jsxs)(`div`,{className:`space-y-4`,children:[(0,m.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] p-4`,children:[(0,m.jsx)(`div`,{className:`text-sm text-[var(--color-text-muted)]`,children:r(`run.userInput.prompt`)}),(0,m.jsx)(`div`,{className:`font-medium text-[var(--color-text-heading)]`,children:S||r(`run.userInput.promptMissing`)})]}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`label`,{htmlFor:`run-user-confirmation`,className:`block font-medium text-[var(--color-text-heading)] mb-2`,children:r(`run.userInput.confirmation`)}),(0,m.jsx)(`textarea`,{id:`run-user-confirmation`,value:C,onChange:e=>w(e.target.value),className:`w-full min-h-[6rem] px-4 py-3 border border-[var(--color-border)] rounded-[var(--radius-md)] text-[var(--color-text)] bg-[var(--color-surface)] resize-y`,disabled:t,required:!0})]})]}),i===`comment`&&(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsxs)(`div`,{className:`text-sm text-[var(--color-text-muted)]`,children:[r(`run.comment.minLength`,{count:T}),` · `,r(`run.comment.count`,{count:E.length})]}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`label`,{htmlFor:`run-comment-text`,className:`block font-medium text-[var(--color-text-heading)] mb-2`,children:r(`run.comment.text`)}),(0,m.jsx)(`textarea`,{id:`run-comment-text`,value:E,onChange:e=>D(e.target.value),className:`w-full min-h-[10rem] px-4 py-3 border border-[var(--color-border)] rounded-[var(--radius-md)] text-[var(--color-text)] bg-[var(--color-surface)] resize-y`,disabled:t,required:!0,"aria-invalid":E.trim().length>0&&E.trim().length<T})]})]}),(0,m.jsx)(`button`,{type:`submit`,disabled:t||!A,className:`mt-4 min-h-[44px] min-w-[44px] px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white border-0 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:r(`run.submitStep`)})]})}function _({run:e,attestOutcome:t,setAttestOutcome:n,attestMessage:r,setAttestMessage:i,copyStatus:o,onCopy:s,onSubmitStep:c,onAttest:l,isNextPending:d,isBeginPending:f,isAttestPending:p}){let{t:h}=a();return(0,m.jsxs)(m.Fragment,{children:[e.status===`running`&&(0,m.jsx)(`div`,{className:`mb-4 flex items-center gap-2 text-sm text-[var(--color-text-muted)]`,role:`status`,"aria-live":`polite`,children:(0,m.jsx)(`span`,{className:`font-medium text-[var(--color-text-heading)]`,children:h(`run.stepperProgress`,{completed:e.history.length})})}),e.last_message&&(0,m.jsxs)(`div`,{className:`mb-4 p-4 rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)]`,role:`status`,"aria-live":`polite`,children:[(0,m.jsx)(`div`,{className:`text-sm text-[var(--color-text-muted)]`,children:h(`run.serverMessage`)}),(0,m.jsx)(`div`,{className:`text-[var(--color-text)]`,children:e.last_message})]}),(0,m.jsxs)(`section`,{"aria-labelledby":`run-current-step`,className:`mb-6`,children:[(0,m.jsx)(`h2`,{id:`run-current-step`,className:`text-lg font-semibold text-[var(--color-text-heading)] mb-2`,children:h(`run.currentStep`)}),(0,m.jsx)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-4`,children:e.current_step?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`text-sm text-[var(--color-text-muted)] mb-2`,children:[h(`run.stepUri`),`: `,(0,m.jsx)(`span`,{className:`font-mono break-all`,children:e.current_step.uri})]}),e.current_step.content?(0,m.jsx)(u,{content:e.current_step.content}):(0,m.jsx)(`p`,{className:`text-sm text-[var(--color-text-muted)] m-0`,children:h(`run.noStepContent`)})]}):(0,m.jsx)(`p`,{className:`text-sm text-[var(--color-text-muted)] m-0`,children:h(`run.noStepContent`)})})]}),(0,m.jsxs)(`section`,{"aria-labelledby":`run-challenge`,className:`mb-6`,children:[(0,m.jsx)(`h2`,{id:`run-challenge`,className:`text-lg font-semibold text-[var(--color-text-heading)] mb-2`,children:h(`run.challenge`)}),(0,m.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-4`,children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`text-sm text-[var(--color-text-muted)]`,children:h(`run.challengeType`)}),(0,m.jsx)(`div`,{className:`font-medium text-[var(--color-text-heading)]`,children:e.challenge.type})]}),(0,m.jsxs)(`details`,{className:`text-sm`,children:[(0,m.jsx)(`summary`,{className:`cursor-pointer text-[var(--color-primary)]`,children:h(`run.advanced`)}),(0,m.jsxs)(`div`,{className:`mt-2 space-y-1 text-[var(--color-text-muted)]`,children:[e.challenge.nonce&&(0,m.jsxs)(`div`,{children:[h(`run.nonce`),`: `,(0,m.jsx)(`span`,{className:`font-mono break-all`,children:e.challenge.nonce})]}),e.challenge.proof_hash&&(0,m.jsxs)(`div`,{children:[h(`run.proofHash`),`: `,(0,m.jsx)(`span`,{className:`font-mono break-all`,children:e.challenge.proof_hash})]}),e.previous_proof_hash&&(0,m.jsxs)(`div`,{children:[h(`run.previousProofHash`),`: `,(0,m.jsx)(`span`,{className:`font-mono break-all`,children:e.previous_proof_hash})]})]})]})]}),e.challenge.description&&(0,m.jsx)(`p`,{className:`text-sm text-[var(--color-text-muted)] mt-3`,children:e.challenge.description}),e.challenge.type===`shell`&&e.challenge.shell?.cmd&&(0,m.jsxs)(`div`,{className:`mt-4 rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] p-4`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`div`,{className:`text-sm text-[var(--color-text-muted)]`,children:h(`run.shell.command`)}),(0,m.jsx)(`div`,{className:`font-mono text-sm text-[var(--color-text)] break-all`,children:e.challenge.shell.cmd})]}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>s(e.challenge.shell.cmd),className:`min-h-[44px] min-w-[44px] px-4 py-2 rounded-[var(--radius-md)] font-medium border border-[var(--color-border)] text-[var(--color-text)] bg-transparent flex-shrink-0 hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:h(`run.copy`)})]}),o&&(0,m.jsx)(`div`,{className:`text-xs text-[var(--color-text-muted)] mt-2`,children:o})]})]})]}),e.status!==`completed`&&e.status!==`ready_to_attest`&&(0,m.jsxs)(`section`,{"aria-labelledby":`run-solution`,className:`mb-6`,children:[(0,m.jsx)(`h2`,{id:`run-solution`,className:`text-lg font-semibold text-[var(--color-text-heading)] mb-2`,children:h(`run.solution`)}),(0,m.jsx)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-4`,children:(0,m.jsx)(g,{challenge:e.challenge,disabled:d||f,onSubmit:c})})]}),e.status===`ready_to_attest`&&(0,m.jsxs)(`section`,{"aria-labelledby":`run-attest`,className:`mb-6`,children:[(0,m.jsx)(`h2`,{id:`run-attest`,className:`text-lg font-semibold text-[var(--color-text-heading)] mb-2`,children:h(`run.attest.title`)}),(0,m.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-4`,children:[(0,m.jsx)(`div`,{className:`text-sm text-[var(--color-text-muted)] mb-4`,children:h(`run.attest.subtitle`)}),(0,m.jsxs)(`div`,{className:`flex flex-wrap gap-4 mb-4`,role:`radiogroup`,"aria-label":h(`run.attest.outcomeLabel`),children:[(0,m.jsxs)(`label`,{className:`inline-flex items-center gap-2 min-h-[44px]`,children:[(0,m.jsx)(`input`,{type:`radio`,name:`attest-outcome`,value:`success`,checked:t===`success`,onChange:()=>n(`success`)}),(0,m.jsx)(`span`,{className:`text-sm text-[var(--color-text)]`,children:h(`run.attest.success`)})]}),(0,m.jsxs)(`label`,{className:`inline-flex items-center gap-2 min-h-[44px]`,children:[(0,m.jsx)(`input`,{type:`radio`,name:`attest-outcome`,value:`failure`,checked:t===`failure`,onChange:()=>n(`failure`)}),(0,m.jsx)(`span`,{className:`text-sm text-[var(--color-text)]`,children:h(`run.attest.failure`)})]})]}),(0,m.jsxs)(`div`,{className:`mb-4`,children:[(0,m.jsx)(`label`,{htmlFor:`run-attest-message`,className:`block font-medium text-[var(--color-text-heading)] mb-2`,children:h(`run.attest.message`)}),(0,m.jsx)(`textarea`,{id:`run-attest-message`,value:r,onChange:e=>i(e.target.value),className:`w-full min-h-[8rem] px-4 py-3 border border-[var(--color-border)] rounded-[var(--radius-md)] text-[var(--color-text)] bg-[var(--color-surface)] resize-y focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`})]}),(0,m.jsx)(`button`,{type:`button`,onClick:l,disabled:p,className:`min-h-[44px] min-w-[44px] px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white border-0 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:h(p?`run.attest.submitting`:`run.attest.submit`)})]})]}),e.history.length>0&&(0,m.jsxs)(`section`,{"aria-labelledby":`run-history`,className:`mb-6`,children:[(0,m.jsx)(`h2`,{id:`run-history`,className:`text-lg font-semibold text-[var(--color-text-heading)] mb-2`,children:h(`run.history`)}),(0,m.jsx)(`ul`,{className:`list-none p-0 m-0 space-y-2`,"aria-label":h(`run.historyLabel`),children:e.history.slice().reverse().map((e,t)=>(0,m.jsxs)(`li`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-4`,children:[(0,m.jsxs)(`div`,{className:`text-sm text-[var(--color-text-muted)]`,children:[new Date(e.submitted_at).toLocaleString(),` · `,e.challenge.type,` ·`,` `,(0,m.jsx)(`span`,{className:`font-mono break-all`,children:e.step.uri})]}),e.server_message&&(0,m.jsx)(`div`,{className:`text-sm text-[var(--color-text)] mt-1`,children:e.server_message})]},`${e.step.uri}:${t}`))})]}),e.status===`completed`&&(0,m.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[#dcfce7] text-[#166534] p-4`,children:[(0,m.jsx)(`strong`,{className:`block`,children:h(`run.completed`)}),e.last_message&&(0,m.jsx)(`div`,{className:`text-sm mt-1`,children:e.last_message})]})]})}async function v(e){let t=await c(`/api/kairos_begin`,{method:`POST`,body:JSON.stringify({uri:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.message??t.statusText)}return t.json()}function y(){return r({mutationFn:e=>v(e)})}async function b(e){let t=await c(`/api/kairos_next`,{method:`POST`,body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.message??t.statusText)}return t.json()}function x(){return r({mutationFn:e=>b(e)})}async function S(e){let t=await c(`/api/kairos_attest`,{method:`POST`,body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.message??t.statusText)}return t.json()}function C(){return r({mutationFn:e=>S(e)})}function w(e){if(e)return e.match(/kairos:\/\/mem\/[0-9a-fA-F-]{36}/)?.[0]}function T(){return new Date().toISOString()}function E(){let{t:e}=a(),{uri:r}=n(),[o]=i(),s=r?decodeURIComponent(r):void 0,{session:c}=f(o.get(`session`)),{upsert:u}=d(),h=y(),g=x(),v=C(),[b,S]=(0,p.useState)(null),[E,D]=(0,p.useState)(`success`),[O,k]=(0,p.useState)(``),[A,j]=(0,p.useState)(null);(0,p.useEffect)(()=>{c&&!b&&(S(c),D(`success`),k(``))},[c,b]);let M=e=>{S(e),u(e)},N=async()=>{if(s)try{let e=await h.mutateAsync(s),t=T(),n=`${s}:${t}`,r=e.next_action?.includes(`kairos_attest`)?`ready_to_attest`:`running`,i=w(e.next_action);M({id:n,protocol_uri:s,started_at:t,updated_at:t,status:r,current_step:e.current_step??null,challenge:e.challenge,next_action:e.next_action,last_message:e.message,previous_proof_hash:e.proof_hash,attest_uri:r===`ready_to_attest`?i:void 0,history:[]})}catch{S(null)}};return s?(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h1`,{className:`text-[var(--color-text-heading)] text-2xl font-semibold mb-1`,children:e(`run.title`)}),(0,m.jsxs)(`p`,{className:`text-sm text-[var(--color-text-muted)] mb-4`,children:[e(`run.protocolUri`),`:`,` `,(0,m.jsx)(`span`,{className:`font-mono break-all`,children:s})]}),(0,m.jsxs)(`div`,{className:`flex flex-wrap gap-2 mb-6`,children:[(0,m.jsx)(t,{to:`/protocols/${encodeURIComponent(s)}`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium border border-[var(--color-border)] text-[var(--color-text)] no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`run.backToProtocol`)}),!b&&(0,m.jsx)(`button`,{type:`button`,onClick:N,disabled:h.isPending,className:`min-h-[44px] min-w-[44px] px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white border-0 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:h.isPending?e(`run.starting`):e(`run.start`)})]}),(0,m.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-4 mb-6`,children:[(0,m.jsx)(`strong`,{className:`block text-[var(--color-text-heading)] mb-1`,children:e(`run.safety.title`)}),(0,m.jsx)(`p`,{className:`text-sm text-[var(--color-text-muted)]`,children:e(`run.safety.copy`)})]}),h.isError&&(0,m.jsx)(l,{message:h.error instanceof Error?h.error.message:String(h.error),onRetry:()=>N(),showGoBack:!0}),b?.status===`error`&&b.last_message&&(0,m.jsx)(`div`,{className:`mb-6`,children:(0,m.jsx)(l,{message:b.last_message,onRetry:()=>N(),showGoBack:!0})}),b&&b.status!==`error`&&(0,m.jsx)(_,{run:b,attestOutcome:E,setAttestOutcome:D,attestMessage:O,setAttestMessage:k,copyStatus:A,onCopy:async t=>{j(null);try{await navigator.clipboard.writeText(t),j(e(`run.copied`)),setTimeout(()=>j(null),1500)}catch(e){j(e instanceof Error?e.message:String(e))}},onSubmitStep:async e=>{if(!b?.current_step)return;let t=b.challenge.nonce,n=b.previous_proof_hash??b.challenge.proof_hash,r={...e,...t?{nonce:t}:{},...n?{proof_hash:n}:{}};try{let e=await g.mutateAsync({uri:b.current_step.uri,solution:r}),t=T(),n=e.next_action?.includes(`kairos_attest`)||(e.message?.toLowerCase().includes(`call kairos_attest`)??!1),i=w(e.next_action)??b.attest_uri;M({...b,updated_at:t,status:n?`ready_to_attest`:`running`,current_step:e.current_step??null,challenge:e.challenge,next_action:e.next_action,last_message:e.message,previous_proof_hash:e.proof_hash??b.previous_proof_hash,attest_uri:n?i:void 0,history:[...b.history,{step:b.current_step,challenge:b.challenge,solution:r,submitted_at:t,proof_hash:e.proof_hash,server_message:e.message}]})}catch(e){M({...b,updated_at:T(),status:`error`,last_message:e instanceof Error?e.message:String(e)})}},onAttest:async()=>{if(!b)return;let t=b.attest_uri??b.current_step?.uri;if(t)try{let n=await v.mutateAsync({uri:t,outcome:E,message:O.trim()||e(`run.attest.defaultMessage`)});M({...b,updated_at:T(),status:`completed`,last_message:n.results[0]?.message??b.last_message})}catch(e){M({...b,updated_at:T(),status:`error`,last_message:e instanceof Error?e.message:String(e)})}},isNextPending:g.isPending,isBeginPending:h.isPending,isAttestPending:v.isPending})]}):(0,m.jsx)(l,{message:e(`run.missingUri`),showGoBack:!0})}export{E as RunGuidedPage};
@@ -1,2 +0,0 @@
1
- /*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
2
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:var(--font-sans);--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-white:#fff;--spacing:.25rem;--container-xl:36rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--radius-sm:var(--radius-sm);--radius-md:var(--radius-md);--radius-lg:var(--radius-lg);--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-primary:var(--color-primary);--color-primary-hover:var(--color-primary-hover);--color-secondary:var(--color-secondary);--color-accent:var(--color-accent);--color-text:var(--color-text);--color-text-heading:var(--color-text-heading);--color-text-muted:var(--color-text-muted);--color-surface:var(--color-surface);--color-surface-elevated:var(--color-surface-elevated);--color-border:var(--color-border);--color-error:var(--color-error);--color-error-bg:var(--color-error-bg);--color-success:var(--color-success);--color-warning:var(--color-warning);--color-focus-ring:var(--color-focus-ring);--font-size-xs:var(--font-size-xs);--font-size-sm:var(--font-size-sm);--font-size-base:var(--font-size-base);--font-size-lg:var(--font-size-lg);--font-size-xl:var(--font-size-xl);--font-size-2xl:var(--font-size-2xl);--font-size-3xl:var(--font-size-3xl)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-full{top:100%}.left-0{left:var(--space-0)}.z-10{z-index:10}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:var(--space-0)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--space-1)}.mt-2{margin-top:var(--space-2)}.mt-3{margin-top:var(--space-3)}.mt-4{margin-top:var(--space-4)}.mt-6{margin-top:var(--space-6)}.mt-8{margin-top:var(--space-8)}.mb-0{margin-bottom:var(--space-0)}.mb-1{margin-bottom:var(--space-1)}.mb-2{margin-bottom:var(--space-2)}.mb-3{margin-bottom:var(--space-3)}.mb-4{margin-bottom:var(--space-4)}.mb-6{margin-bottom:var(--space-6)}.mb-8{margin-bottom:var(--space-8)}.ml-2{margin-left:var(--space-2)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-4{height:var(--space-4)}.h-5{height:var(--space-5)}.h-10{height:var(--space-10)}.h-11{height:calc(var(--spacing) * 11)}.min-h-\[6rem\]{min-height:6rem}.min-h-\[8rem\]{min-height:8rem}.min-h-\[10rem\]{min-height:10rem}.min-h-\[11rem\]{min-height:11rem}.min-h-\[12rem\]{min-height:12rem}.min-h-\[32px\]{min-height:32px}.min-h-\[36px\]{min-height:36px}.min-h-\[44px\]{min-height:44px}.min-h-\[var\(--layout-touch-target\)\]{min-height:var(--layout-touch-target)}.min-h-screen{min-height:100vh}.w-1\/2{width:50%}.w-3\/4{width:75%}.w-4{width:var(--space-4)}.w-10{width:var(--space-10)}.w-11{width:calc(var(--spacing) * 11)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-\[var\(--layout-sidebar-width\)\]{width:var(--layout-sidebar-width)}.w-full{width:100%}.max-w-\[22rem\]{max-width:22rem}.max-w-\[70ch\]{max-width:70ch}.max-w-none{max-width:none}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:var(--space-0)}.min-w-\[7rem\]{min-width:7rem}.min-w-\[12rem\]{min-width:12rem}.min-w-\[36px\]{min-width:36px}.min-w-\[44px\]{min-width:44px}.min-w-\[var\(--layout-touch-target\)\]{min-width:var(--layout-touch-target)}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-pointer{cursor:pointer}.resize-y{resize:vertical}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--space-1)}.gap-2{gap:var(--space-2)}.gap-3{gap:var(--space-3)}.gap-4{gap:var(--space-4)}.gap-6{gap:var(--space-6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--space-1) * var(--tw-space-y-reverse));margin-block-end:calc(var(--space-1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--space-2) * var(--tw-space-y-reverse));margin-block-end:calc(var(--space-2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--space-3) * var(--tw-space-y-reverse));margin-block-end:calc(var(--space-3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--space-4) * var(--tw-space-y-reverse));margin-block-end:calc(var(--space-4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--space-5) * var(--tw-space-y-reverse));margin-block-end:calc(var(--space-5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--space-6) * var(--tw-space-y-reverse));margin-block-end:calc(var(--space-6) * calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[var\(--color-border\)\]>:not(:last-child)){border-color:var(--color-border)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:.25rem}.rounded-\[var\(--radius-md\)\]{border-radius:var(--radius-md)}.rounded-\[var\(--radius-sm\)\]{border-radius:var(--radius-sm)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-\[3px\]{border-left-style:var(--tw-border-style);border-left-width:3px}.border-\[var\(--color-border\)\]{border-color:var(--color-border)}.border-\[var\(--color-error\)\]{border-color:var(--color-error)}.border-\[var\(--color-primary\)\]{border-color:var(--color-primary)}.border-transparent{border-color:#0000}.border-l-\[var\(--color-primary\)\]{border-left-color:var(--color-primary)}.bg-\[\#dbeafe\]{background-color:#dbeafe}.bg-\[\#dcfce7\]{background-color:#dcfce7}.bg-\[\#e2e8f0\]{background-color:#e2e8f0}.bg-\[\#ede9fe\]{background-color:#ede9fe}.bg-\[\#fef3c7\]{background-color:#fef3c7}.bg-\[var\(--color-border\)\]{background-color:var(--color-border)}.bg-\[var\(--color-error-bg\)\]{background-color:var(--color-error-bg)}.bg-\[var\(--color-primary\)\]{background-color:var(--color-primary)}.bg-\[var\(--color-surface\)\]{background-color:var(--color-surface)}.bg-\[var\(--color-surface-elevated\)\]{background-color:var(--color-surface-elevated)}.bg-transparent{background-color:#0000}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:var(--space-0)}.p-3{padding:var(--space-3)}.p-4{padding:var(--space-4)}.p-5{padding:var(--space-5)}.p-6{padding:var(--space-6)}.px-0\.5{padding-inline:calc(var(--spacing) * .5)}.px-2{padding-inline:var(--space-2)}.px-3{padding-inline:var(--space-3)}.px-4{padding-inline:var(--space-4)}.px-\[var\(--layout-main-padding-x\)\]{padding-inline:var(--layout-main-padding-x)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--space-1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:var(--space-2)}.py-3{padding-block:var(--space-3)}.py-4{padding-block:var(--space-4)}.py-\[var\(--layout-main-padding-y\)\]{padding-block:var(--layout-main-padding-y)}.pt-3{padding-top:var(--space-3)}.pt-4{padding-top:var(--space-4)}.pb-4{padding-bottom:var(--space-4)}.pl-5{padding-left:var(--space-5)}.pl-6{padding-left:var(--space-6)}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-5{--tw-leading:var(--space-5);line-height:var(--space-5)}.leading-6{--tw-leading:var(--space-6);line-height:var(--space-6)}.leading-none{--tw-leading:1;line-height:1}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-\[\#1e40af\]{color:#1e40af}.text-\[\#5b21b6\]{color:#5b21b6}.text-\[\#92400e\]{color:#92400e}.text-\[\#166534\]{color:#166534}.text-\[\#334155\]{color:#334155}.text-\[var\(--color-error\)\]{color:var(--color-error)}.text-\[var\(--color-primary\)\]{color:var(--color-primary)}.text-\[var\(--color-text\)\]{color:var(--color-text)}.text-\[var\(--color-text-heading\)\]{color:var(--color-text-heading)}.text-\[var\(--color-text-muted\)\]{color:var(--color-text-muted)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-\[var\(--color-primary\)\]{--tw-ring-color:var(--color-primary)}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-\[var\(--color-surface\)\]{--tw-ring-offset-color:var(--color-surface)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-offset-2{outline-offset:2px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media (hover:hover){.hover\:bg-\[var\(--color-primary-hover\)\]:hover{background-color:var(--color-primary-hover)}.hover\:bg-\[var\(--color-surface\)\]:hover{background-color:var(--color-surface)}.hover\:bg-\[var\(--color-surface-elevated\)\]:hover{background-color:var(--color-surface-elevated)}.hover\:text-\[var\(--color-text\)\]:hover{color:var(--color-text)}.hover\:text-\[var\(--color-text-heading\)\]:hover{color:var(--color-text-heading)}.hover\:no-underline:hover{text-decoration-line:none}}.focus\:bg-\[var\(--color-surface-elevated\)\]:focus{background-color:var(--color-surface-elevated)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:outline:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\:outline-\[var\(--color-focus-ring\)\]:focus-visible{outline-color:var(--color-focus-ring)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}@media (width>=40rem){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-between{justify-content:space-between}}@media (width>=48rem){.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-\[1fr_auto\]{grid-template-columns:1fr auto}}@media (width>=64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width>=80rem){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-\[1\.3fr_1fr\]{grid-template-columns:1.3fr 1fr}.xl\:grid-cols-\[1\.6fr_1fr\]{grid-template-columns:1.6fr 1fr}.xl\:grid-cols-\[1\.45fr_1fr\]{grid-template-columns:1.45fr 1fr}}.\[\&_a\]\:text-\[var\(--color-primary\)\] a{color:var(--color-primary)}.\[\&_a\]\:underline a{text-decoration-line:underline}.\[\&_a\:focus-visible\]\:outline a:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.\[\&_a\:focus-visible\]\:outline-2 a:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.\[\&_a\:focus-visible\]\:outline-offset-2 a:focus-visible{outline-offset:2px}.\[\&_a\:focus-visible\]\:outline-\[var\(--color-focus-ring\)\] a:focus-visible{outline-color:var(--color-focus-ring)}.\[\&_a\:hover\]\:no-underline a:hover{text-decoration-line:none}.\[\&_blockquote\]\:border-l-4 blockquote{border-left-style:var(--tw-border-style);border-left-width:4px}.\[\&_blockquote\]\:border-\[var\(--color-border\)\] blockquote{border-color:var(--color-border)}.\[\&_blockquote\]\:pl-4 blockquote{padding-left:var(--space-4)}.\[\&_blockquote\]\:text-\[var\(--color-text-muted\)\] blockquote{color:var(--color-text-muted)}.\[\&_blockquote\]\:italic blockquote{font-style:italic}.\[\&_code\]\:rounded code{border-radius:.25rem}.\[\&_code\]\:bg-\[var\(--color-surface-elevated\)\] code{background-color:var(--color-surface-elevated)}.\[\&_code\]\:px-1\.5 code{padding-inline:calc(var(--spacing) * 1.5)}.\[\&_code\]\:py-0\.5 code{padding-block:calc(var(--spacing) * .5)}.\[\&_code\]\:font-mono code{font-family:var(--font-mono)}.\[\&_code\]\:text-xs code{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_h1\]\:mt-4 h1{margin-top:var(--space-4)}.\[\&_h1\]\:mb-2 h1{margin-bottom:var(--space-2)}.\[\&_h1\]\:text-xl h1{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\[\&_h1\]\:font-semibold h1{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\[\&_h1\]\:text-\[var\(--color-text-heading\)\] h1{color:var(--color-text-heading)}.\[\&_h2\]\:mt-4 h2{margin-top:var(--space-4)}.\[\&_h2\]\:mb-2 h2{margin-bottom:var(--space-2)}.\[\&_h2\]\:text-lg h2{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.\[\&_h2\]\:font-semibold h2{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\[\&_h2\]\:text-\[var\(--color-text-heading\)\] h2{color:var(--color-text-heading)}.\[\&_h3\]\:mt-3 h3{margin-top:var(--space-3)}.\[\&_h3\]\:mb-1 h3{margin-bottom:var(--space-1)}.\[\&_h3\]\:text-base h3{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_h3\]\:font-medium h3{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_h3\]\:text-\[var\(--color-text-heading\)\] h3{color:var(--color-text-heading)}.\[\&_li\]\:my-0\.5 li{margin-block:calc(var(--spacing) * .5)}.\[\&_ol\]\:my-3 ol{margin-block:var(--space-3)}.\[\&_ol\]\:pl-6 ol{padding-left:var(--space-6)}.\[\&_p\]\:mt-0 p{margin-top:var(--space-0)}.\[\&_p\+p\]\:mt-3 p+p{margin-top:var(--space-3)}.\[\&_p\:first-child\]\:mt-0 p:first-child{margin-top:var(--space-0)}.\[\&_pre\]\:my-3 pre{margin-block:var(--space-3)}.\[\&_pre\]\:overflow-x-auto pre{overflow-x:auto}.\[\&_pre\]\:rounded-\[var\(--radius-md\)\] pre{border-radius:var(--radius-md)}.\[\&_pre\]\:bg-\[var\(--color-surface-elevated\)\] pre{background-color:var(--color-surface-elevated)}.\[\&_pre\]\:p-3 pre{padding:var(--space-3)}.\[\&_pre\]\:font-mono pre{font-family:var(--font-mono)}.\[\&_pre\]\:text-sm pre{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_pre\]\:whitespace-pre-wrap pre{white-space:pre-wrap}.\[\&_pre_code\]\:bg-transparent pre code{background-color:#0000}.\[\&_pre_code\]\:p-0 pre code{padding:var(--space-0)}.\[\&_pre_code\]\:text-inherit pre code{color:inherit}.\[\&_strong\]\:font-semibold strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\[\&_strong\]\:text-\[var\(--color-text-heading\)\] strong{color:var(--color-text-heading)}.\[\&_table\]\:my-3 table{margin-block:var(--space-3)}.\[\&_table\]\:my-4 table{margin-block:var(--space-4)}.\[\&_table\]\:w-full table{width:100%}.\[\&_table\]\:border-collapse table{border-collapse:collapse}.\[\&_table\]\:text-left table{text-align:left}.\[\&_td\]\:border td{border-style:var(--tw-border-style);border-width:1px}.\[\&_td\]\:border-\[var\(--color-border\)\] td{border-color:var(--color-border)}.\[\&_td\]\:px-2 td{padding-inline:var(--space-2)}.\[\&_td\]\:px-3 td{padding-inline:var(--space-3)}.\[\&_td\]\:py-1\.5 td{padding-block:calc(var(--spacing) * 1.5)}.\[\&_td\]\:py-2 td{padding-block:var(--space-2)}.\[\&_th\]\:border th{border-style:var(--tw-border-style);border-width:1px}.\[\&_th\]\:border-\[var\(--color-border\)\] th{border-color:var(--color-border)}.\[\&_th\]\:bg-\[var\(--color-surface-elevated\)\] th{background-color:var(--color-surface-elevated)}.\[\&_th\]\:px-2 th{padding-inline:var(--space-2)}.\[\&_th\]\:px-3 th{padding-inline:var(--space-3)}.\[\&_th\]\:py-1\.5 th{padding-block:calc(var(--spacing) * 1.5)}.\[\&_th\]\:py-2 th{padding-block:var(--space-2)}.\[\&_th\]\:font-semibold th{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\[\&_th\]\:text-\[var\(--color-text-heading\)\] th{color:var(--color-text-heading)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\]\:border-\[var\(--color-border\)\] tr{border-color:var(--color-border)}.\[\&_tr\:last-child\]\:border-b-0 tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&_ul\]\:my-3 ul{margin-block:var(--space-3)}.\[\&_ul\]\:pl-6 ul{padding-left:var(--space-6)}}:root{--color-primary:#0d9488;--color-primary-hover:#0f766e;--color-primary-focus:#0d9488;--color-secondary:#64748b;--color-accent:#0ea5e9;--color-text:#1e293b;--color-text-heading:#0f172a;--color-text-muted:#64748b;--color-surface:#fff;--color-surface-elevated:#f8fafc;--color-border:#e2e8f0;--color-error:#dc2626;--color-error-bg:#fef2f2;--color-success:#16a34a;--color-warning:#d97706;--color-focus-ring:var(--color-primary);--space-0:0;--space-1:.25rem;--space-2:.5rem;--space-3:.75rem;--space-4:1rem;--space-5:1.25rem;--space-6:1.5rem;--space-8:2rem;--space-10:2.5rem;--space-12:3rem;--font-sans:system-ui, sans-serif;--font-size-xs:.75rem;--font-size-sm:.875rem;--font-size-base:1rem;--font-size-lg:1.125rem;--font-size-xl:1.25rem;--font-size-2xl:1.5rem;--font-size-3xl:2rem;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--line-height-tight:1.25;--line-height-normal:1.5;--line-height-relaxed:1.6;--letter-spacing-uppercase:.1em;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--layout-main-max:80rem;--layout-main-narrow:48rem;--layout-main-wide:72rem;--layout-sidebar-width:12rem;--layout-touch-target:44px;--layout-main-padding-x:1.5rem;--layout-main-padding-y:1.5rem;--section-gap:var(--space-8);--card-padding:var(--space-6)}@media (width>=1024px){:root{--layout-main-padding-x:2rem}}:focus-visible{outline:2px solid var(--color-focus-ring);outline-offset:2px}.skip-link{top:-100%;left:var(--space-4);padding:var(--space-2) var(--space-4);background:var(--color-primary);color:#fff;font-weight:var(--font-weight-medium);z-index:100;border-radius:var(--radius-md);position:absolute}.skip-link:focus{top:var(--space-4)}.skip-link:focus:not(:focus-visible){top:-100%}.skip-link:focus-visible{top:var(--space-4)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}
@@ -1,8 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomePage-DxiAsvs-.js","assets/vendor-GiUVcjs7.js","assets/rolldown-runtime-Dw2cE7zH.js","assets/tiptap-kMFBDujG.js","assets/react-BdWJx0XL.js","assets/useSpaces-BV6eUjY3.js","assets/api-D88c6lbH.js","assets/KairosPage-BkqYs3-_.js","assets/ErrorAlert-ME7tEJ6X.js","assets/RunsPage-ctnsEF2U.js","assets/useRunSession-CciNdgs6.js","assets/ProtocolEditPage-D-aTavvx.js","assets/useProtocol-BruWpIzq.js","assets/RunGuidedPage-BUD0MaGh.js","assets/RenderedMarkdown-DjbuQlBl.js","assets/SkillBundlePage-CaWW5oGq.js","assets/ProtocolDetailPage-DKaSVepL.js","assets/AccountPage-kxmPtqQP.js","assets/NotFoundPage-DyfbQ-6G.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{_ as t,b as n,c as r,i,l as a,m as o,o as s,s as c,u as l,v as u,x as d,y as f}from"./vendor-GiUVcjs7.js";import{i as p,n as m,t as h}from"./react-BdWJx0XL.js";import"./tiptap-kMFBDujG.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var g=`Skip to main content`,_={"nav.home":`Home`,"nav.kairos":`Browse`,"nav.create":`Create`,"nav.runs":`Test Run`,"nav.account":`Account`,skipToMain:g,"home.title":`Home`,"home.tagline":`Overview of your spaces and protocols.`,"home.searchLabel":`Search protocols`,"home.searchPlaceholder":`e.g. deploy and test`,"home.searchHint":`Enter a query to find protocols. Results open in the KAIROS tab.`,"home.statsLabel":`Space and protocol counts`,"home.stats.personalProtocols":`—`,"home.stats.personalProtocolsLabel":`Personal protocols`,"home.stats.kairosApp":`—`,"home.stats.kairosAppLabel":`Kairos app`,"home.stats.spaces":`—`,"home.stats.spacesLabel":`Spaces`,"home.stats.protocolCount":`{{count}} protocol`,"home.stats.protocolCount_plural":`{{count}} protocols`,"home.ctaPre":`Search and manage protocols in`,"home.ctaSuffix":`.`,"kairos.title":`Browse`,"kairos.searchLabel":`Search protocols`,"kairos.searchPlaceholder":`e.g. deploy and test`,"kairos.searchHint":`Search or browse by label. Enter a query to find protocols.`,"kairos.browseByLabel":`Browse by label`,"kairos.browseByLetterHint":`Click a letter to show protocols whose label starts with that letter.`,"kairos.letterCount":`Letter {{letter}}, {{count}} protocols`,"kairos.labelsStartingWith":`Labels starting with {{letter}}`,"kairos.noLabelsForLetter":`No protocols starting with this letter.`,"kairos.enterQueryHint":`Enter a query above to find protocols. Results appear below when you search.`,"kairos.search":`Search`,"kairos.loading":`Searching…`,"kairos.empty":`No protocols found`,"kairos.foundMatches":`Found {{count}} matches (top confidence: {{top}}%). View one, refine your search, or create a new protocol.`,"kairos.resultsLabel":`Search results`,"kairos.score":`Score`,"kairos.version":`Version`,"kairos.tagsLabel":`Tags`,"kairos.refineMeta":`Refine query`,"kairos.createMeta":`Start from scratch`,"kairos.view":`View`,"kairos.viewProtocol":`View {{title}}`,"kairos.refineSearch":`Refine search`,"kairos.createNew":`Create new`,"protocol.loading":`Loading protocol…`,"protocol.notFound":`Protocol not found`,"protocol.uri":`URI`,"protocol.readOnly":`Read-only`,"protocol.copyUri":`Copy URI`,"protocol.download":`Download`,"protocol.downloadAsMarkdown":`Download as Markdown`,"protocol.downloadAsSkill":`Download as Skill`,"protocol.editAsSkill":`Edit as Skill`,"protocol.expand":`Expand`,"protocol.collapse":`Collapse`,"protocol.edit":`Edit`,"protocol.duplicate":`Duplicate`,"protocol.runGuided":`Test Run`,"protocol.steps":`Steps`,"protocol.triggers":`Natural language triggers`,"protocol.completion":`Completion rule`,"protocol.howToUse":`How to use this protocol`,"protocol.howToUseInProduct":`Use Test Run from the button above to step through this protocol in the browser. For agents or CLI, use the documentation link below.`,"protocol.howToUseCopy":`Use in Cursor (MCP) or via CLI. See`,"protocol.docsLink":`documentation`,"runs.title":`Test Run`,"runs.subtitle":`Continue a test run you started earlier on this device.`,"runs.empty":`No runs yet.`,"runs.listLabel":`Test Run list`,"runs.status":`Status`,"runs.updated":`Updated`,"runs.stepsDone":`{{count}} steps completed`,"runs.resume":`Resume`,"runs.remove":`Remove`,"run.title":`Test Run`,"run.protocolUri":`Protocol URI`,"run.backToProtocol":`Back to protocol`,"run.start":`Start run`,"run.starting":`Starting…`,"run.safety.title":`Safe by default`,"run.safety.copy":`This guided run never executes shell commands in your browser. For shell challenges, run the command yourself and paste the real results.`,"run.serverMessage":`Server message`,"run.currentStep":`Current step`,"run.stepUri":`Step URI`,"run.noStepContent":`(No step content)`,"run.challenge":`Challenge`,"run.challengeType":`Type`,"run.advanced":`Advanced`,"run.nonce":`Nonce`,"run.proofHash":`Challenge proof_hash`,"run.previousProofHash":`Previous proof_hash`,"run.copy":`Copy`,"run.copied":`Copied`,"run.solution":`Solution`,"run.solutionFormLabel":`Submit solution`,"run.submitStep":`Submit step`,"run.shell.command":`Command`,"run.shell.exitCode":`Exit code`,"run.shell.stdout":`Stdout`,"run.shell.stderr":`Stderr`,"run.mcp.toolName":`Tool`,"run.mcp.toolMissing":`(Missing tool name)`,"run.mcp.success":`Success`,"run.mcp.arguments":`Arguments (JSON)`,"run.mcp.result":`Result (JSON)`,"run.userInput.prompt":`Prompt`,"run.userInput.promptMissing":`(Missing prompt)`,"run.userInput.confirmation":`User confirmation`,"run.comment.minLength":`Minimum {{count}} characters`,"run.comment.count":`{{count}} typed`,"run.comment.text":`Comment`,"run.attest.title":`Attest completion`,"run.attest.subtitle":`Finalize the run outcome for quality feedback.`,"run.attest.outcomeLabel":`Outcome`,"run.attest.success":`Success`,"run.attest.failure":`Failure`,"run.attest.message":`Message`,"run.attest.submit":`Submit attestation`,"run.attest.submitting":`Submitting…`,"run.attest.defaultMessage":`Completed guided run.`,"run.stepperProgress":`{{completed}} step(s) completed`,"run.history":`History`,"run.historyLabel":`Run history`,"run.completed":`Run completed`,"run.missingUri":`Missing protocol URI.`,"protocolEdit.newTitle":`New protocol`,"protocolEdit.editTitle":`Edit protocol`,"protocolEdit.hint":`Write as a human. The editor renders text and keeps the saved format compatible with generic Markdown.`,"protocolEdit.formLabel":`Protocol form`,"protocolEdit.protocolLabel":`Protocol label`,"protocolEdit.triggersLabel":`Natural language triggers`,"protocolEdit.triggersHint":`Describe when this protocol should run (e.g. deploy and test).`,"protocolEdit.stepLabel":`Step label`,"protocolEdit.stepContent":`Step content`,"protocolEdit.challengeType":`Challenge type`,"protocolEdit.addStep":`Add step`,"protocolEdit.removeStep":`Remove step`,"protocolEdit.completionLabel":`Completion rule`,"protocolEdit.challengeShell":`Shell command`,"protocolEdit.challengeMcp":`MCP tool call`,"protocolEdit.challengeUserInput":`User input`,"protocolEdit.challengeComment":`Comment`,"protocolEdit.shellCmd":`Command`,"protocolEdit.mcpToolName":`Tool name`,"protocolEdit.userInputPrompt":`Prompt`,"protocolEdit.commentMinLength":`Minimum length (characters)`,"protocolEdit.uploadHint":`Uploading a .md file fills this form. It does not publish until you save.`,"protocolEdit.contentLabel":`Protocol content (markdown)`,"protocolEdit.previewLabel":`Protocol preview`,"protocolEdit.previewTitle":`Live preview`,"protocolEdit.previewSteps":`Steps`,"protocolEdit.previewNoSteps":`No steps yet.`,"protocolEdit.previewSections":`Key sections`,"protocolEdit.present":`present`,"protocolEdit.missing":`missing`,"protocolEdit.insertTemplate":`Insert template`,"protocolEdit.upload":`Upload .md file`,"skill.title":`Edit as Skill`,"skill.subtitle":`Prepare a skill bundle for external AI tools. Customize metadata then download.`,"skill.skillName":`Skill name`,"skill.description":`Skill description`,"skill.whenToUse":`When to use it`,"skill.includeReferences":`Include references folder`,"skill.downloadAsSkill":`Download as Skill`,"skill.backToProtocol":`Back to protocol`,"protocolEdit.placeholder":`# Protocol title
3
-
4
- ## Natural language triggers
5
- ...
6
-
7
- ## Step 1
8
- ...`,"protocolEdit.contentHint":`Include: Natural language triggers (first H2), steps (H2 + optional challenge block), Completion rule (last H2).`,"protocolEdit.save":`Save`,"protocolEdit.saving":`Saving…`,"protocolEdit.cancel":`Cancel`,"account.title":`Account`,"account.intro":`You are signed in. Sign out below or use the options to manage your profile.`,"account.loading":`Loading…`,"account.notSignedIn":`You are not signed in.`,"account.signIn":`Sign in`,"account.name":`Name`,"account.email":`Email`,"account.logOut":`Log out`,"notFound.title":`Page not found`,"notFound.message":`The page you requested could not be found.`,"notFound.goHome":`Go to Home`,"error.title":`Something went wrong`,"error.retry":`Retry`,"error.goBack":`Go to Home`,"error.support":`Support`};d.use(n).init({lng:`en`,fallbackLng:`en`,ns:[`translation`],defaultNS:`translation`,resources:{en:{translation:_}},interpolation:{escapeValue:!1}});var v=m(),y=e(p(),1),b=`/ui/assets/kaiiros-mcp-BmYVdCL6.svg`,x=h(),S=e=>e.startsWith(`/protocols`)||e.startsWith(`/runs`);function C(){let{t:e}=f(),t=l().pathname,n=({isActive:e})=>`min-h-[var(--layout-touch-target)] flex items-center px-4 py-3 text-[var(--color-text)] no-underline border-l-[3px] border-transparent outline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] hover:bg-[var(--color-surface)] hover:text-[var(--color-text-heading)] ${e?`font-semibold text-[var(--color-primary)] border-l-[var(--color-primary)] bg-[var(--color-surface)]`:``}`,r=S(t)?`min(100%, var(--layout-main-max), var(--layout-main-wide))`:`min(100%, var(--layout-main-max), var(--layout-main-narrow))`;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`a`,{href:`#main`,className:`skip-link`,children:e(`skipToMain`)}),(0,x.jsxs)(`div`,{className:`flex min-h-screen`,children:[(0,x.jsxs)(`aside`,{className:`w-[var(--layout-sidebar-width)] flex-shrink-0 border-r border-[var(--color-border)] bg-[var(--color-surface-elevated)] py-4`,"aria-label":`Main navigation`,children:[(0,x.jsx)(`div`,{className:`px-4 pb-4`,children:(0,x.jsxs)(s,{to:`/`,end:!0,className:`flex min-h-[var(--layout-touch-target)] min-w-[var(--layout-touch-target)] items-center gap-3 rounded-md outline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)]`,children:[(0,x.jsx)(`img`,{src:b,alt:``,className:`h-10 w-10 flex-shrink-0 rounded-lg object-contain`,width:`40`,height:`40`}),(0,x.jsxs)(`span`,{className:`flex flex-col leading-tight`,children:[(0,x.jsx)(`span`,{className:`font-bold text-[var(--color-text-heading)] text-lg`,children:`Kairos`}),(0,x.jsx)(`span`,{className:`font-bold text-[var(--color-text-muted)] text-xs uppercase tracking-wide`,children:`MCP`})]})]})}),(0,x.jsxs)(`nav`,{className:`flex flex-col gap-0.5`,children:[(0,x.jsx)(s,{to:`/`,end:!0,"aria-current":t===`/`?`page`:void 0,className:n,children:e(`nav.home`)}),(0,x.jsx)(s,{to:`/kairos`,"aria-current":t===`/kairos`?`page`:void 0,className:n,children:e(`nav.kairos`)}),(0,x.jsx)(s,{to:`/protocols/new`,"aria-current":t===`/protocols/new`?`page`:void 0,className:n,children:e(`nav.create`)}),(0,x.jsx)(s,{to:`/runs`,"aria-current":t===`/runs`?`page`:void 0,className:n,children:e(`nav.runs`)}),(0,x.jsx)(s,{to:`/account`,"aria-current":t===`/account`?`page`:void 0,className:n,children:e(`nav.account`)})]})]}),(0,x.jsx)(`main`,{id:`main`,className:`flex-1 mx-auto w-full py-[var(--layout-main-padding-y)] px-[var(--layout-main-padding-x)]`,style:{maxWidth:r},tabIndex:-1,children:(0,x.jsx)(c,{})})]})]})}var w=(0,y.lazy)(()=>o(()=>import(`./HomePage-DxiAsvs-.js`).then(e=>({default:e.HomePage})),__vite__mapDeps([0,1,2,3,4,5,6]))),T=(0,y.lazy)(()=>o(()=>import(`./KairosPage-BkqYs3-_.js`).then(e=>({default:e.KairosPage})),__vite__mapDeps([7,2,1,3,4,8,5,6]))),E=(0,y.lazy)(()=>o(()=>import(`./RunsPage-ctnsEF2U.js`).then(e=>({default:e.RunsPage})),__vite__mapDeps([9,1,2,3,4,10]))),D=(0,y.lazy)(()=>o(()=>import(`./ProtocolEditPage-D-aTavvx.js`).then(e=>({default:e.ProtocolEditPage})),__vite__mapDeps([11,2,1,3,4,12,6]))),O=(0,y.lazy)(()=>o(()=>import(`./RunGuidedPage-BUD0MaGh.js`).then(e=>({default:e.RunGuidedPage})),__vite__mapDeps([13,2,1,3,4,8,14,10,6]))),k=(0,y.lazy)(()=>o(()=>import(`./SkillBundlePage-CaWW5oGq.js`).then(e=>({default:e.SkillBundlePage})),__vite__mapDeps([15,2,1,3,4,12,6]))),A=(0,y.lazy)(()=>o(()=>import(`./ProtocolDetailPage-DKaSVepL.js`).then(e=>({default:e.ProtocolDetailPage})),__vite__mapDeps([16,2,1,3,4,14,12,6]))),j=(0,y.lazy)(()=>o(()=>import(`./AccountPage-kxmPtqQP.js`).then(e=>({default:e.AccountPage})),__vite__mapDeps([17,1,2,3,4,6]))),M=(0,y.lazy)(()=>o(()=>import(`./NotFoundPage-DyfbQ-6G.js`).then(e=>({default:e.NotFoundPage})),__vite__mapDeps([18,1,2,3,4,8])));function N(){return(0,x.jsx)(`div`,{className:`flex min-h-[12rem] items-center justify-center text-[var(--color-text-muted)]`,"aria-busy":`true`,children:`Loading…`})}function P(){return(0,x.jsx)(a,{children:(0,x.jsxs)(r,{path:`/`,element:(0,x.jsx)(C,{}),children:[(0,x.jsx)(r,{index:!0,element:(0,x.jsx)(y.Suspense,{fallback:(0,x.jsx)(N,{}),children:(0,x.jsx)(w,{})})}),(0,x.jsx)(r,{path:`kairos`,element:(0,x.jsx)(y.Suspense,{fallback:(0,x.jsx)(N,{}),children:(0,x.jsx)(T,{})})}),(0,x.jsx)(r,{path:`runs`,element:(0,x.jsx)(y.Suspense,{fallback:(0,x.jsx)(N,{}),children:(0,x.jsx)(E,{})})}),(0,x.jsx)(r,{path:`protocols/new`,element:(0,x.jsx)(y.Suspense,{fallback:(0,x.jsx)(N,{}),children:(0,x.jsx)(D,{})})}),(0,x.jsx)(r,{path:`protocols/:uri/edit`,element:(0,x.jsx)(y.Suspense,{fallback:(0,x.jsx)(N,{}),children:(0,x.jsx)(D,{})})}),(0,x.jsx)(r,{path:`protocols/:uri/run`,element:(0,x.jsx)(y.Suspense,{fallback:(0,x.jsx)(N,{}),children:(0,x.jsx)(O,{})})}),(0,x.jsx)(r,{path:`protocols/:uri/skill`,element:(0,x.jsx)(y.Suspense,{fallback:(0,x.jsx)(N,{}),children:(0,x.jsx)(k,{})})}),(0,x.jsx)(r,{path:`protocols/:uri`,element:(0,x.jsx)(y.Suspense,{fallback:(0,x.jsx)(N,{}),children:(0,x.jsx)(A,{})})}),(0,x.jsx)(r,{path:`account`,element:(0,x.jsx)(y.Suspense,{fallback:(0,x.jsx)(N,{}),children:(0,x.jsx)(j,{})})}),(0,x.jsx)(r,{path:`*`,element:(0,x.jsx)(y.Suspense,{fallback:(0,x.jsx)(N,{}),children:(0,x.jsx)(M,{})})})]})})}function F(){return(0,x.jsx)(i,{basename:`/ui`,children:(0,x.jsx)(P,{})})}var I=new u;(0,v.createRoot)(document.getElementById(`root`)).render((0,x.jsx)(y.StrictMode,{children:(0,x.jsx)(t,{client:I,children:(0,x.jsx)(F,{})})}));
@@ -1,4 +0,0 @@
1
- import{g as e}from"./vendor-GiUVcjs7.js";import{t}from"./api-D88c6lbH.js";async function n(e){let n=await t(`/api/kairos_dump`,{method:`POST`,body:JSON.stringify({uri:e,protocol:!0})});if(!n.ok){let e=(await n.json().catch(()=>({}))).message??n.statusText,t=Error(e);throw t.statusCode=n.status,t}return n.json()}function r(t,r){return e({queryKey:[`protocol`,t],queryFn:()=>n(t),enabled:!!(t&&r)})}function i(e){let t=e.split(`
2
- `),n=`Protocol`,r=[],i=``,a=``,o=t.find(e=>e.startsWith(`# `));o&&(n=o.replace(/^#\s+/,``).trim());let s=e.split(/\n##\s+/);for(let e=1;e<s.length;e++){let t=s[e],n=t.split(`
3
- `)[0]??``,o=n.trim(),c=t.slice(n.length).replace(/^\n+/,``).trim();if(o.toLowerCase().includes(`natural language trigger`))i=c.replace(/\n```json[\s\S]*?```/g,``).trim();else if(o.toLowerCase().includes(`completion rule`))a=c.replace(/\n```json[\s\S]*?```/g,``).trim();else{let e=c.match(/```json\s*([\s\S]*?)```/),t=`comment`,n=`Comment`;if(e)try{let r=JSON.parse(e[1].trim()),i=r?.challenge??r;if(i?.type&&(t=String(i.type)),t===`shell`){let e=i?.shell?.cmd??i?.cmd;n=e?`Shell: ${String(e)}`:`Shell`}else if(t===`mcp`){let e=i?.mcp?.tool_name;n=e?`MCP: ${String(e)}`:`MCP`}else if(t===`user_input`){let e=i?.user_input?.prompt;n=e?`User input: ${String(e)}`:`User input`}else if(t===`comment`){let e=i?.comment?.min_length;n=e?`Comment: min ${Number(e)} chars`:`Comment`}else n=String(t)}catch{}n||=String(t),r.push({label:o,type:t,summary:n,body:c})}}return{title:n,steps:r,triggers:i,completion:a}}function a(e){let{title:t,steps:n,triggers:r,completion:a}=i(e);return{protocolLabel:t,triggersMarkdown:r,steps:n.map(e=>{let t=e.body.replace(/\n```json\s*[\s\S]*?```\s*$/g,``).trim(),n=`comment`,r={label:e.label,bodyMarkdown:t,type:n},i=e.body.match(/```json\s*([\s\S]*?)```/);if(i)try{let e=JSON.parse(i[1].trim()),t=e?.challenge??e;t?.type&&[`shell`,`mcp`,`user_input`,`comment`].includes(String(t.type))&&(n=t.type,r.type=n),n===`shell`?r.shell={cmd:String(t?.shell?.cmd??t?.cmd??``).trim()}:n===`mcp`?r.mcp={tool_name:String(t?.mcp?.tool_name??``).trim()}:n===`user_input`?r.user_input={prompt:String(t?.user_input?.prompt??``).trim()}:n===`comment`&&(r.comment={min_length:Number(t?.comment?.min_length??10)})}catch{}return r}),completionMarkdown:a}}function o(e){let t=[];t.push(`# ${e.protocolLabel.trim()||`Protocol`}`),t.push(``),t.push(`## Natural language triggers`),t.push(``),t.push(e.triggersMarkdown.trim()||`Describe when this protocol should run.`),t.push(``);for(let n of e.steps){t.push(`## ${n.label.trim()||`Step`}`),t.push(``),t.push(n.bodyMarkdown.trim()||`Step content.`);let e={type:n.type};n.type===`shell`?e.shell={cmd:n.shell?.cmd??``}:n.type===`mcp`?e.mcp={tool_name:n.mcp?.tool_name??``}:n.type===`user_input`?e.user_input={prompt:n.user_input?.prompt??``}:n.type===`comment`&&(e.comment={min_length:n.comment?.min_length??10}),t.push(``),t.push("```json"),t.push(JSON.stringify({challenge:e},null,2)),t.push("```"),t.push(``)}return t.push(`## Completion rule`),t.push(``),t.push(e.completionMarkdown.trim()||`When is this protocol considered complete?`),t.join(`
4
- `)}export{r as i,i as n,a as r,o as t};