@runeya/runeya 2.0.155 → 2.0.157

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 (87) hide show
  1. package/{chat-7V3FN2PU.js → chat-X6GWKPKG.js} +4 -4
  2. package/{chunk-LUFAT2NW.js → chunk-6L273MQO.js} +5 -4
  3. package/chunk-6L273MQO.js.map +1 -0
  4. package/{chunk-S5M6KX5K.js → chunk-I4FSX522.js} +3 -3
  5. package/{chunk-NJDF4CDG.js → chunk-IYL545N3.js} +3 -3
  6. package/{companion-AF7G2FNC.js → companion-V6ITOFSU.js} +2 -2
  7. package/{external-DHD7PLKK.js → external-WZQUS7LY.js} +2 -2
  8. package/index.js +8 -8
  9. package/{install-gate-L27RKPNM.js → install-gate-3ZDX3AUO.js} +2 -2
  10. package/mcp-server/external.js +4 -3
  11. package/mcp-server/external.js.map +1 -1
  12. package/mcp-server/index.js +4 -3
  13. package/mcp-server/index.js.map +1 -1
  14. package/package.json +1 -1
  15. package/{src-YFOQ4ZCE.js → src-YR5RF76Z.js} +5 -5
  16. package/web/assets/{AgentScalarChatInterface.vue-Ck92wZRY.js → AgentScalarChatInterface.vue-CtkvKRSd.js} +1 -1
  17. package/web/assets/{AgentTerminalPage-CWxJgIyT.js → AgentTerminalPage-Dt9S2kZX.js} +1 -1
  18. package/web/assets/{AiChatModals-CZfc7DCS.js → AiChatModals-BEpSEXmp.js} +1 -1
  19. package/web/assets/{AppLayout-C-zC5Nq5.js → AppLayout-DIAQvecQ.js} +1 -1
  20. package/web/assets/{AuditPage-CG-iKGRS.js → AuditPage-BEt0m-rM.js} +1 -1
  21. package/web/assets/{CloudAccountPage-C0SaUlEP.js → CloudAccountPage-BGijgepw.js} +1 -1
  22. package/web/assets/{CloudMessagingPage-BbG6aW1i.js → CloudMessagingPage-C9uWAT8S.js} +1 -1
  23. package/web/assets/{DashboardPage-C1_Lr5-g.js → DashboardPage-DFiL6A-k.js} +1 -1
  24. package/web/assets/{DirectoryPickerDialog-BBOr9Jkh.js → DirectoryPickerDialog-C8dwWIUa.js} +1 -1
  25. package/web/assets/{EnvironmentForm-Dq0FHywb.js → EnvironmentForm-DZgZitCy.js} +1 -1
  26. package/web/assets/{EnvironmentFormPage-CyNvvWUf.js → EnvironmentFormPage-ubP8cX3l.js} +1 -1
  27. package/web/assets/{EnvironmentListPage-LAtCQh6k.js → EnvironmentListPage-CPs1uuvs.js} +1 -1
  28. package/web/assets/{KanbanBoardPage-BLnT_9si.js → KanbanBoardPage-C9NqOqdD.js} +3 -3
  29. package/web/assets/{KanbanListPage-DZmHgO6H.js → KanbanListPage-D_ZpIbT2.js} +1 -1
  30. package/web/assets/{KnowledgeListPage-BAxHAgMa.js → KnowledgeListPage-BoaV9hBg.js} +1 -1
  31. package/web/assets/{KnowledgePagePage-C-hLZet3.js → KnowledgePagePage-UGJGJY4d.js} +1 -1
  32. package/web/assets/{LaunchProjectPage-B2DsNWz6.js → LaunchProjectPage-B0Lg5Kr5.js} +1 -1
  33. package/web/assets/{LaunchServicesPage-DIZOLOO_.js → LaunchServicesPage-D_pqkdXt.js} +1 -1
  34. package/web/assets/{LaunchShell-B_uaNliB.js → LaunchShell-CJtXkSUp.js} +1 -1
  35. package/web/assets/{LogViewer-B58dkD3M.js → LogViewer-DLxO4-gP.js} +1 -1
  36. package/web/assets/{OrgKeyPrompt-CXlxmdhU.js → OrgKeyPrompt-Cbx4cLL0.js} +1 -1
  37. package/web/assets/{ProcessControls-DJZgFpWJ.js → ProcessControls-Cx-QzqxQ.js} +1 -1
  38. package/web/assets/{ProcessDetailPage-GBZ6Ks3X.js → ProcessDetailPage-Bxwv0984.js} +1 -1
  39. package/web/assets/{ProjectCreateDialog-U4EMua6x.js → ProjectCreateDialog-HcYVX36i.js} +1 -1
  40. package/web/assets/{ProjectLocationGate-CMAv9dl7.js → ProjectLocationGate-PR92Tdos.js} +1 -1
  41. package/web/assets/{ProjectPublishDialog-CV0dp1Hm.js → ProjectPublishDialog-YvOeVDCP.js} +1 -1
  42. package/web/assets/{RandomJobTestPage-y3jSAISj.js → RandomJobTestPage-Bp9qone4.js} +1 -1
  43. package/web/assets/{ScenarioEditorPage-CeeD0EYJ.js → ScenarioEditorPage-Cjkkz3JB.js} +1 -1
  44. package/web/assets/{SendToChatDialog-C-iQSBC2.js → SendToChatDialog-CQbi2P_L.js} +1 -1
  45. package/web/assets/{ServiceControlsBar-DpWmXwXA.js → ServiceControlsBar-9jsN3h0c.js} +1 -1
  46. package/web/assets/{ServiceDetailPage-CDSHAgOi.js → ServiceDetailPage-COHMUw51.js} +1 -1
  47. package/web/assets/{ServiceFormPage-BDyi1Lvc.js → ServiceFormPage-B4n8scwP.js} +1 -1
  48. package/web/assets/{SettingsPage-BHYV-7ne.js → SettingsPage-C3PnwdxZ.js} +4 -4
  49. package/web/assets/{UnlockPage-BBkZa-OK.js → UnlockPage-BIB0NtWF.js} +1 -1
  50. package/web/assets/{VaultMigrationPage-CaLuNVJP.js → VaultMigrationPage-D27SeEVr.js} +1 -1
  51. package/web/assets/{VersionBadge-DsexD25N.js → VersionBadge-FeuuTMz7.js} +1 -1
  52. package/web/assets/{WikiPage-DM5LpnlK.js → WikiPage-A8C0dEDX.js} +1 -1
  53. package/web/assets/{WikiView-CXeS9asq.js → WikiView-D3c0r5q8.js} +1 -1
  54. package/web/assets/{add-scalar-classes-CkQNvwHs.js → add-scalar-classes-Ohd6-7G3.js} +1 -1
  55. package/web/assets/{agent.store-Cwfle88d.js → agent.store-BwUoohNu.js} +1 -1
  56. package/web/assets/{auth-B64yo032.js → auth-DdEdmJV5.js} +2 -2
  57. package/web/assets/{cloud-chat.store-C9FNT6Qr.js → cloud-chat.store-za5cBdZx.js} +1 -1
  58. package/web/assets/{cloud-client-SZTY3IQP.js → cloud-client-zXY8HZtj.js} +2 -2
  59. package/web/assets/{cloud-session-BmIlHjQN.js → cloud-session-DqfQKW5D.js} +2 -2
  60. package/web/assets/{index-aI2QzxNG.js → index-CYcPxjSC.js} +4 -4
  61. package/web/assets/{index-BKbnsVKD.css → index-DozDRY7J.css} +1 -1
  62. package/web/assets/{knowledge-host-DOhNIg0F.js → knowledge-host-ButMqDET.js} +3 -3
  63. package/web/assets/{modal-Ba8aIfHn.js → modal-B9eahS9q.js} +1 -1
  64. package/web/assets/{notification.store-PIPjftPf.js → notification.store-CWs6iQmx.js} +1 -1
  65. package/web/assets/{project-launch.store-CEJebMgi.js → project-launch.store-DkD7Q9jW.js} +1 -1
  66. package/web/assets/{project.store-C88HetpW.js → project.store-CnflI3la.js} +1 -1
  67. package/web/assets/{scenario.store-CkrvgMMi.js → scenario.store-DGt8nNt5.js} +1 -1
  68. package/web/assets/{service.store-Dq07zl0D.js → service.store-yECOKc1C.js} +1 -1
  69. package/web/assets/{settings-scope-B8S18shP.js → settings-scope-Ca1LjLG1.js} +1 -1
  70. package/web/assets/{settings.store-DRNoHPt8.js → settings.store-Cyop63CA.js} +1 -1
  71. package/web/assets/{src-C35Mv-XP.js → src-8YjxNhhv.js} +1 -1
  72. package/web/assets/{src-nJXWA92m.js → src-BD3q9_go.js} +1 -1
  73. package/web/assets/{trpc-CDNqXCOY.js → trpc-DlM4IpMe.js} +3 -3
  74. package/web/assets/{useCloudOrg-DhN5nrBd.js → useCloudOrg-Ck6Ef1iD.js} +1 -1
  75. package/web/assets/{useEnvVarAutocomplete-DqQSK0lV.js → useEnvVarAutocomplete-B0fhZK-_.js} +1 -1
  76. package/web/assets/{useProjectCatalog-DXYezh7t.js → useProjectCatalog-D1RgJoOm.js} +1 -1
  77. package/web/assets/{useProjectCloudOrg-C2pj6wfv.js → useProjectCloudOrg-tnlpo5R1.js} +1 -1
  78. package/web/assets/{useServiceUrlHost-BOwIYVml.js → useServiceUrlHost-Xzj6EOft.js} +1 -1
  79. package/web/index.html +15 -15
  80. package/chunk-LUFAT2NW.js.map +0 -1
  81. /package/{chat-7V3FN2PU.js.map → chat-X6GWKPKG.js.map} +0 -0
  82. /package/{chunk-S5M6KX5K.js.map → chunk-I4FSX522.js.map} +0 -0
  83. /package/{chunk-NJDF4CDG.js.map → chunk-IYL545N3.js.map} +0 -0
  84. /package/{companion-AF7G2FNC.js.map → companion-V6ITOFSU.js.map} +0 -0
  85. /package/{external-DHD7PLKK.js.map → external-WZQUS7LY.js.map} +0 -0
  86. /package/{install-gate-L27RKPNM.js.map → install-gate-3ZDX3AUO.js.map} +0 -0
  87. /package/{src-YFOQ4ZCE.js.map → src-YR5RF76Z.js.map} +0 -0
@@ -1 +1 @@
1
- import{C as e}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{g as t}from"./runtime-core.esm-bundler-DujKY9QV.js";import{n}from"./vue-i18n-o7yraQpR.js";import{r}from"./trpc-CDNqXCOY.js";import{n as i}from"./project.store-C88HetpW.js";import{n as a}from"./cloud-auth-D_am4FlK.js";import{n as o,r as s}from"./cloud-session-BmIlHjQN.js";import{n as c}from"./cloud-client-SZTY3IQP.js";var l=e({}),u=null;function d(){return u??=r.cloudSync.orgClouds.query().then(e=>{l.value=e}).catch(()=>{}),l}var f=e({}),p=null;function m(){return p??=r.cloudSync.orgLogos.query().then(e=>{f.value=e}).catch(()=>{}),f}async function h(e){if(e.length)try{await r.cloudSync.cacheOrgLogos.mutate({orgIds:e}),f.value=await r.cloudSync.orgLogos.query()}catch{}}function g(e,t){return`${(t??a()).replace(/\/+$/,``)}/api/org-logo/${encodeURIComponent(e)}`}function _(){let{t:l}=n(),u=i(),{accounts:d,orgAccounts:f,isLinked:p,refresh:m}=s(),g=e([]),_=e(!1),v=e(``),y=e({});async function b(){try{y.value=await r.cloudSync.orgNames.query()}catch{}}b();let x=t(()=>{let e=new Map;for(let t of u.projects){if(!t.orgId)continue;let n=f.value[t.orgId],r=e.get(t.orgId)??{orgId:t.orgId,name:``,projects:[],...n?{accountId:n}:{}};r.projects.push({projectId:t.id,name:t.name,local:!0}),e.set(t.orgId,r)}for(let t of g.value){let n=e.get(t.orgId)??{orgId:t.orgId,name:t.name,projects:[]};n.name=t.name,t.accountId&&(n.accountId=t.accountId),n.canDelete=t.canDelete;for(let e of t.projects)n.projects.some(t=>t.projectId===e.projectId)||n.projects.push(e);e.set(t.orgId,n)}for(let t of e.values())t.name||=y.value[t.orgId]??``,t.name||=l(`projectSwitcher.unknownOrg`,{id:t.orgId.slice(0,8)}),t.projects.sort((e,t)=>e.name.localeCompare(t.name));return[...e.values()]});async function S(){if(v.value=``,!p.value){g.value=[];return}_.value=!0;try{let e=new Set(u.projects.map(e=>e.id)),t;try{t=await o()}catch{throw Error(l(`projectSwitcher.orgsFailed`))}h(t.map(e=>e.id)),g.value=await Promise.all(t.map(async t=>{let n=await c.$fetch(`/project/list`,{method:`GET`,query:{organizationId:t.id},accountId:t.accountId});return{orgId:t.id,name:t.name,accountId:t.accountId,canDelete:n.data?.canDelete??!0,projects:(n.data?.projects??[]).map(t=>({projectId:t.projectId,name:t.name,local:e.has(t.projectId)}))}}))}catch(e){v.value=e instanceof Error?e.message:String(e)}finally{_.value=!1}}async function C(e,t,n){if(u.getByRef({id:t,orgId:e}))return;let i=d.value.find(e=>e.id===n),o=await r.cloudSync.trackProject.mutate({orgId:e,cloudUrl:i?.cloudUrl??a(),projectId:t,...n?{accountId:n}:{}});await w(e,t,o.state,o.pulled),await m()}async function w(e,t,n,r){if(!r&&n!==`live`)throw Object.assign(Error(T(n)),{syncState:n});for(let n=0;n<20;n++){if(await u.fetchAll(),u.getByRef({id:t,orgId:e}))return;await new Promise(e=>setTimeout(e,250))}throw Object.assign(Error(T(n)),{syncState:n})}function T(e){return l(e===`unauthenticated`?`projectSwitcher.syncPaused`:e===`outdated`?`projectSwitcher.syncOutdated`:e===`key-mismatch`?`projectSwitcher.syncKeyMismatch`:`projectSwitcher.pullTimeout`)}function E(e,t){let n=g.value.find(t=>t.orgId===e)?.projects.find(e=>e.projectId===t);n&&(n.local=!1)}return{orgGroups:x,loading:_,error:v,refreshCloud:S,pullProject:C,markUntracked:E}}export{m as i,g as n,d as r,_ as t};
1
+ import{C as e}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{g as t}from"./runtime-core.esm-bundler-DujKY9QV.js";import{n}from"./vue-i18n-o7yraQpR.js";import{r}from"./trpc-DlM4IpMe.js";import{n as i}from"./project.store-CnflI3la.js";import{n as a}from"./cloud-auth-D_am4FlK.js";import{n as o,r as s}from"./cloud-session-DqfQKW5D.js";import{n as c}from"./cloud-client-zXY8HZtj.js";var l=e({}),u=null;function d(){return u??=r.cloudSync.orgClouds.query().then(e=>{l.value=e}).catch(()=>{}),l}var f=e({}),p=null;function m(){return p??=r.cloudSync.orgLogos.query().then(e=>{f.value=e}).catch(()=>{}),f}async function h(e){if(e.length)try{await r.cloudSync.cacheOrgLogos.mutate({orgIds:e}),f.value=await r.cloudSync.orgLogos.query()}catch{}}function g(e,t){return`${(t??a()).replace(/\/+$/,``)}/api/org-logo/${encodeURIComponent(e)}`}function _(){let{t:l}=n(),u=i(),{accounts:d,orgAccounts:f,isLinked:p,refresh:m}=s(),g=e([]),_=e(!1),v=e(``),y=e({});async function b(){try{y.value=await r.cloudSync.orgNames.query()}catch{}}b();let x=t(()=>{let e=new Map;for(let t of u.projects){if(!t.orgId)continue;let n=f.value[t.orgId],r=e.get(t.orgId)??{orgId:t.orgId,name:``,projects:[],...n?{accountId:n}:{}};r.projects.push({projectId:t.id,name:t.name,local:!0}),e.set(t.orgId,r)}for(let t of g.value){let n=e.get(t.orgId)??{orgId:t.orgId,name:t.name,projects:[]};n.name=t.name,t.accountId&&(n.accountId=t.accountId),n.canDelete=t.canDelete;for(let e of t.projects)n.projects.some(t=>t.projectId===e.projectId)||n.projects.push(e);e.set(t.orgId,n)}for(let t of e.values())t.name||=y.value[t.orgId]??``,t.name||=l(`projectSwitcher.unknownOrg`,{id:t.orgId.slice(0,8)}),t.projects.sort((e,t)=>e.name.localeCompare(t.name));return[...e.values()]});async function S(){if(v.value=``,!p.value){g.value=[];return}_.value=!0;try{let e=new Set(u.projects.map(e=>e.id)),t;try{t=await o()}catch{throw Error(l(`projectSwitcher.orgsFailed`))}h(t.map(e=>e.id)),g.value=await Promise.all(t.map(async t=>{let n=await c.$fetch(`/project/list`,{method:`GET`,query:{organizationId:t.id},accountId:t.accountId});return{orgId:t.id,name:t.name,accountId:t.accountId,canDelete:n.data?.canDelete??!0,projects:(n.data?.projects??[]).map(t=>({projectId:t.projectId,name:t.name,local:e.has(t.projectId)}))}}))}catch(e){v.value=e instanceof Error?e.message:String(e)}finally{_.value=!1}}async function C(e,t,n){if(u.getByRef({id:t,orgId:e}))return;let i=d.value.find(e=>e.id===n),o=await r.cloudSync.trackProject.mutate({orgId:e,cloudUrl:i?.cloudUrl??a(),projectId:t,...n?{accountId:n}:{}});await w(e,t,o.state,o.pulled),await m()}async function w(e,t,n,r){if(!r&&n!==`live`)throw Object.assign(Error(T(n)),{syncState:n});for(let n=0;n<20;n++){if(await u.fetchAll(),u.getByRef({id:t,orgId:e}))return;await new Promise(e=>setTimeout(e,250))}throw Object.assign(Error(T(n)),{syncState:n})}function T(e){return l(e===`unauthenticated`?`projectSwitcher.syncPaused`:e===`outdated`?`projectSwitcher.syncOutdated`:e===`key-mismatch`?`projectSwitcher.syncKeyMismatch`:`projectSwitcher.pullTimeout`)}function E(e,t){let n=g.value.find(t=>t.orgId===e)?.projects.find(e=>e.projectId===t);n&&(n.local=!1)}return{orgGroups:x,loading:_,error:v,refreshCloud:S,pullProject:C,markUntracked:E}}export{m as i,g as n,d as r,_ as t};
@@ -1 +1 @@
1
- import{g as e}from"./runtime-core.esm-bundler-DujKY9QV.js";import{n as t}from"./project-launch.store-CEJebMgi.js";import{n}from"./project.store-C88HetpW.js";import{r}from"./cloud-session-BmIlHjQN.js";function i(){let{user:i,currentAccount:a,loading:o}=r(),s=n(),c=t(),l=e(()=>c.activeOrgId??s.currentProjectOrgId),u=e(()=>!!l.value&&a.value!==null),d=e(()=>u.value?l.value:``),f=e(()=>!!l.value&&!u.value&&o.value),p=e(()=>!!d.value||f.value);return{orgId:d,available:p,unavailability:e(()=>p.value?null:l.value?`not-member`:`local-project`),cloudUser:i}}export{i as t};
1
+ import{g as e}from"./runtime-core.esm-bundler-DujKY9QV.js";import{n as t}from"./project-launch.store-DkD7Q9jW.js";import{n}from"./project.store-CnflI3la.js";import{r}from"./cloud-session-DqfQKW5D.js";function i(){let{user:i,currentAccount:a,loading:o}=r(),s=n(),c=t(),l=e(()=>c.activeOrgId??s.currentProjectOrgId),u=e(()=>!!l.value&&a.value!==null),d=e(()=>u.value?l.value:``),f=e(()=>!!l.value&&!u.value&&o.value),p=e(()=>!!d.value||f.value);return{orgId:d,available:p,unavailability:e(()=>p.value?null:l.value?`not-member`:`local-project`),cloudUser:i}}export{i as t};
@@ -1 +1 @@
1
- import{C as e}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{ct as t,g as n}from"./runtime-core.esm-bundler-DujKY9QV.js";import{r}from"./trpc-CDNqXCOY.js";import{_ as i}from"./dist-Cx_klvkk.js";import{t as a}from"./agent.store-Cwfle88d.js";function o(o){let s=a(),c=n(()=>{let e=o?.();return e?s.getById(e):s.agents.find(e=>e.isLocal)??null}),l=e(`localhost`);return t(async()=>{try{l.value=(await r.settings.getNetwork.query()).host}catch{}}),{serverHost:l,urlHost:n(()=>i(l.value)||(c.value?.status.lanIp??`localhost`)),agent:c}}export{o as t};
1
+ import{C as e}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{ct as t,g as n}from"./runtime-core.esm-bundler-DujKY9QV.js";import{r}from"./trpc-DlM4IpMe.js";import{_ as i}from"./dist-Cx_klvkk.js";import{t as a}from"./agent.store-BwUoohNu.js";function o(o){let s=a(),c=n(()=>{let e=o?.();return e?s.getById(e):s.agents.find(e=>e.isLocal)??null}),l=e(`localhost`);return t(async()=>{try{l.value=(await r.settings.getNetwork.query()).host}catch{}}),{serverHost:l,urlHost:n(()=>i(l.value)||(c.value?.status.lanIp??`localhost`)),agent:c}}export{o as t};
package/web/index.html CHANGED
@@ -15,16 +15,16 @@
15
15
  content="width=device-width, initial-scale=1.0, interactive-widget=resizes-content"
16
16
  />
17
17
  <title>Runeya</title>
18
- <script type="module" crossorigin src="/assets/index-aI2QzxNG.js"></script>
18
+ <script type="module" crossorigin src="/assets/index-CYcPxjSC.js"></script>
19
19
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dd_uD5pT.js">
20
20
  <link rel="modulepreload" crossorigin href="/assets/reactivity.esm-bundler-BQ9SB2vv.js">
21
21
  <link rel="modulepreload" crossorigin href="/assets/runtime-core.esm-bundler-DujKY9QV.js">
22
22
  <link rel="modulepreload" crossorigin href="/assets/runtime-dom.esm-bundler-CyEVRK6B.js">
23
23
  <link rel="modulepreload" crossorigin href="/assets/vue-i18n-o7yraQpR.js">
24
24
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-BZ1Pz5am.js">
25
- <link rel="modulepreload" crossorigin href="/assets/auth-B64yo032.js">
26
- <link rel="modulepreload" crossorigin href="/assets/trpc-CDNqXCOY.js">
27
- <link rel="modulepreload" crossorigin href="/assets/project-launch.store-CEJebMgi.js">
25
+ <link rel="modulepreload" crossorigin href="/assets/auth-DdEdmJV5.js">
26
+ <link rel="modulepreload" crossorigin href="/assets/trpc-DlM4IpMe.js">
27
+ <link rel="modulepreload" crossorigin href="/assets/project-launch.store-DkD7Q9jW.js">
28
28
  <link rel="modulepreload" crossorigin href="/assets/i18n-B8hHo8g2.js">
29
29
  <link rel="modulepreload" crossorigin href="/assets/useApi-s_02lHjl-DZYO2tHU.js">
30
30
  <link rel="modulepreload" crossorigin href="/assets/devtools-DCoWQoU_-D2vs4YXr.js">
@@ -32,25 +32,25 @@
32
32
  <link rel="modulepreload" crossorigin href="/assets/floating-ui.dom-DF3oyfHd.js">
33
33
  <link rel="modulepreload" crossorigin href="/assets/src-CcVk2-Gw.js">
34
34
  <link rel="modulepreload" crossorigin href="/assets/error-DpF7X5iu.js">
35
- <link rel="modulepreload" crossorigin href="/assets/project.store-C88HetpW.js">
35
+ <link rel="modulepreload" crossorigin href="/assets/project.store-CnflI3la.js">
36
36
  <link rel="modulepreload" crossorigin href="/assets/use-polling-CEkhIY_9.js">
37
37
  <link rel="modulepreload" crossorigin href="/assets/useAiChatDrawer-D_ofn8Eo.js">
38
- <link rel="modulepreload" crossorigin href="/assets/settings-scope-B8S18shP.js">
38
+ <link rel="modulepreload" crossorigin href="/assets/settings-scope-Ca1LjLG1.js">
39
39
  <link rel="modulepreload" crossorigin href="/assets/schemas-68I2iCLF.js">
40
40
  <link rel="modulepreload" crossorigin href="/assets/dist-Cx_klvkk.js">
41
- <link rel="modulepreload" crossorigin href="/assets/service.store-Dq07zl0D.js">
42
- <link rel="modulepreload" crossorigin href="/assets/notification.store-PIPjftPf.js">
43
- <link rel="modulepreload" crossorigin href="/assets/scenario.store-CkrvgMMi.js">
41
+ <link rel="modulepreload" crossorigin href="/assets/service.store-yECOKc1C.js">
42
+ <link rel="modulepreload" crossorigin href="/assets/notification.store-CWs6iQmx.js">
43
+ <link rel="modulepreload" crossorigin href="/assets/scenario.store-DGt8nNt5.js">
44
44
  <link rel="modulepreload" crossorigin href="/assets/app-mode-BVpTuh0i.js">
45
45
  <link rel="modulepreload" crossorigin href="/assets/cloud-auth-D_am4FlK.js">
46
- <link rel="modulepreload" crossorigin href="/assets/cloud-session-BmIlHjQN.js">
47
- <link rel="modulepreload" crossorigin href="/assets/cloud-client-SZTY3IQP.js">
48
- <link rel="modulepreload" crossorigin href="/assets/useProjectCatalog-DXYezh7t.js">
46
+ <link rel="modulepreload" crossorigin href="/assets/cloud-session-DqfQKW5D.js">
47
+ <link rel="modulepreload" crossorigin href="/assets/cloud-client-zXY8HZtj.js">
48
+ <link rel="modulepreload" crossorigin href="/assets/useProjectCatalog-D1RgJoOm.js">
49
49
  <link rel="modulepreload" crossorigin href="/assets/editor.api-Bef3xeth.js">
50
50
  <link rel="modulepreload" crossorigin href="/assets/toggleHighContrast-Dqz1Qao1.js">
51
51
  <link rel="modulepreload" crossorigin href="/assets/register-BLGIM2pN.js">
52
- <link rel="modulepreload" crossorigin href="/assets/agent.store-Cwfle88d.js">
53
- <link rel="modulepreload" crossorigin href="/assets/AiChatModals-CZfc7DCS.js">
52
+ <link rel="modulepreload" crossorigin href="/assets/agent.store-BwUoohNu.js">
53
+ <link rel="modulepreload" crossorigin href="/assets/AiChatModals-BEpSEXmp.js">
54
54
  <link rel="modulepreload" crossorigin href="/assets/process-BWkHpZOM.js">
55
55
  <link rel="modulepreload" crossorigin href="/assets/theme-BZCAxfJD.js">
56
56
  <link rel="stylesheet" crossorigin href="/assets/src-DOziuDw8.css">
@@ -58,7 +58,7 @@
58
58
  <link rel="stylesheet" crossorigin href="/assets/editor-8AbsNvUX.css">
59
59
  <link rel="stylesheet" crossorigin href="/assets/toggleHighContrast--ixms01u.css">
60
60
  <link rel="stylesheet" crossorigin href="/assets/AiChatModals-DS5R3Oz1.css">
61
- <link rel="stylesheet" crossorigin href="/assets/index-BKbnsVKD.css">
61
+ <link rel="stylesheet" crossorigin href="/assets/index-DozDRY7J.css">
62
62
  </head>
63
63
  <body>
64
64
  <div id="app"></div>
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../packages/ai-capabilities/src/trpc-caller.ts","../../../packages/ai-capabilities/src/capabilities.ts","../../../packages/ai-capabilities/src/adapters/json-schema.ts","../../../packages/ai-capabilities/src/adapters/anthropic.ts","../../../packages/ai-capabilities/src/adapters/openai.ts","../../../packages/ai-capabilities/src/adapters/prompt.ts","../../../packages/ai-capabilities/src/adapters/mcp.ts","../../../packages/ai-capabilities/src/project-anchor.ts"],"sourcesContent":["import type { RuneyaCapability } from './capabilities.js';\n\n/**\n * Shared tRPC HTTP caller used by:\n * - Server-side cloud tool executor (proxies cloud LLM tool calls to local tRPC)\n * - MCP server (calls tRPC on behalf of CLI runners)\n */\n/**\n * L'erreur telle que l'agent la reçoit : message et codes, sans la pile\n * d'appels que tRPC ajoute hors production (chemins de la machine, structure\n * interne du serveur), inutile à l'agent et à ne pas exposer.\n */\nexport function withoutStack(error: unknown): unknown {\n if (!error || typeof error !== 'object') return error;\n const { data, ...rest } = error as { data?: unknown } & Record<string, unknown>;\n if (!data || typeof data !== 'object') return error;\n const { stack: _stack, ...cleanData } = data as Record<string, unknown>;\n return { ...rest, data: cleanData };\n}\n\nexport async function callTrpc(\n baseUrl: string,\n route: string,\n method: 'GET' | 'POST',\n input: Record<string, unknown> | undefined,\n authToken: string,\n fetchImpl: typeof fetch = fetch,\n): Promise<unknown> {\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${authToken}`,\n };\n\n const url = method === 'GET' && input\n ? `${baseUrl}/api/trpc/${route}?input=${encodeURIComponent(JSON.stringify(input))}`\n : `${baseUrl}/api/trpc/${route}`;\n\n const res = await fetchImpl(url, {\n method,\n headers,\n ...(method === 'POST' ? { body: JSON.stringify(input ?? {}) } : {}),\n signal: AbortSignal.timeout(15_000),\n });\n\n const json = await res.json() as Record<string, unknown>;\n if (json['error']) throw new Error(JSON.stringify(withoutStack(json['error'])));\n const result = json['result'] as Record<string, unknown> | undefined;\n return result?.['data'] ?? result ?? json;\n}\n\n/**\n * Exécuter une capacité : l'appel tRPC, puis le filtre de sa réponse. Le seul\n * chemin du MCP comme du chat intégré — un filtre posé sur la capacité vaut\n * donc pour les deux.\n */\nexport async function runCapability(\n cap: RuneyaCapability,\n baseUrl: string,\n params: Record<string, string | undefined>,\n authToken: string,\n fetchImpl: typeof fetch = fetch,\n): Promise<unknown> {\n const input = cap.buildInput(params);\n const result = await callTrpc(baseUrl, cap.route, cap.method, input, authToken, fetchImpl);\n return cap.transformOutput ? cap.transformOutput(result, input) : result;\n}\n","// ─── Runeya AI Capabilities — Single Source of Truth ─────────────────────────\n//\n// Adding a new capability:\n// 1. Add an entry to RUNEYA_CAPABILITIES below.\n// 2. Done. Anthropic tools, OpenAI tools, runner prompt docs, and MCP routes\n// are all generated automatically from this list.\n\nimport { z } from 'zod';\nimport {\n BootstrapCommandSchema, DockerConfigSchema, HealthCheckSchema, RestartStrategySchema,\n BUILTIN_VARIABLES, ServiceCommandSchema, ServiceConfigSchema, ServiceShortcutSchema, maskLogSourceSecrets,\n} from '@runeya/packages-shared';\nimport type { LogSourceConfig } from '@runeya/packages-shared';\nimport {\n KNOWLEDGE_LIMITS,\n foldText,\n KNOWLEDGE_PAGE_TYPES,\n KNOWLEDGE_RELATIONS,\n KNOWLEDGE_TYPE_SPECS,\n KnowledgeAliasesSchema,\n KnowledgeEdgeKindSchema,\n KnowledgeFieldsSchema,\n KnowledgeIdSchema,\n KnowledgeLinkSchema,\n KnowledgeLocaleSchema,\n KnowledgeRelationSchema,\n KnowledgePageTypeSchema,\n KnowledgeProjectIdsSchema,\n KnowledgeSectionModeSchema,\n KnowledgeSectionSchema,\n KnowledgeSourcesSchema,\n KnowledgeStatusSchema,\n KnowledgeThemeIdsSchema,\n} from '@runeya/packages-shared';\n\nexport interface CapabilityParam {\n name: string;\n description: string;\n required: boolean;\n /**\n * Le type réel du paramètre. Absent : un texte. Présent, il est donné tel\n * quel au modèle (JSON Schema pour le chat, Zod pour le MCP) et relu contre\n * lui dans `buildInput`, qui reçoit toujours des chaînes.\n */\n schema?: z.ZodType;\n}\n\nexport interface RuneyaCapability {\n /** Tool name (snake_case, used as function name by LLMs). */\n name: string;\n /** Human-readable description shown to the LLM. */\n description: string;\n /** tRPC route segment, e.g. \"service.list\" or \"process.start\". */\n route: string;\n /** HTTP method for the tRPC call. */\n method: 'GET' | 'POST';\n /** Input parameters exposed to the LLM. */\n params: CapabilityParam[];\n /** Build the tRPC input object from raw LLM params. */\n buildInput: (params: Record<string, string | undefined>) => Record<string, unknown> | undefined;\n /** If true, safety instructions will warn the LLM to require explicit user intent. */\n destructive?: boolean;\n /**\n * Filtre la réponse avant qu'elle n'atteigne le modèle — pour ce qu'une route\n * rend à l'interface et qu'une IA ne doit pas lire.\n */\n /** Réduire la réponse avant de la rendre à l'agent ; reçoit aussi l'entrée envoyée. */\n transformOutput?: (result: unknown, input?: unknown) => unknown;\n /**\n * Optional usage hint injected into the system prompt so the LLM knows when to use this tool.\n * Example: '\"wait 5s\" or \"pause for 10 seconds\" → call wait'\n */\n usageHint?: string;\n}\n\n/**\n * Une liste, telle qu'un modèle l'écrit.\n *\n * Il envoie du JSON quand il y pense, une énumération séparée par des virgules\n * quand il n'y pense pas. Refuser la seconde ferait échouer l'appel sans que\n * rien n'explique pourquoi.\n */\nfunction toList(raw: string | undefined): string[] {\n if (!raw) return [];\n const text = raw.trim();\n if (text.startsWith('[')) {\n try {\n const parsed: unknown = JSON.parse(text);\n if (Array.isArray(parsed)) return parsed.map((v) => String(v).trim()).filter(Boolean);\n } catch {\n // Un JSON malformé se lit comme une énumération : mieux vaut retenir les\n // noms qu'il contient que de tout perdre sur une virgule en trop.\n }\n }\n return text.split(',').map((v) => v.trim().replace(/^[\"'[]+|[\"'\\]]+$/g, '')).filter(Boolean);\n}\n\n/**\n * Un champ qu'on peut soit changer, soit effacer, soit laisser tranquille.\n *\n * Absent : on n'y touche pas. `null` ou vide : on l'efface — c'est ce que le\n * cloud attend, et la seule façon pour un agent de retirer une échéance.\n */\nfunction clearable(\n raw: string | undefined,\n parse: (value: string) => unknown,\n key: string,\n): Record<string, unknown> {\n if (raw === undefined) return {};\n const text = String(raw).trim();\n if (!text || text === 'null') return { [key]: null };\n return { [key]: parse(text) };\n}\n\n/**\n * La cible d'une commande git : un service, ou à défaut un projet.\n *\n * Les quatre champs sont facultatifs côté route (`gitTargetShape`), qui résout\n * elle-même l'agent et le répertoire. On ne transmet que ce que le modèle a\n * réellement donné : un `serviceId` vide ferait échouer la résolution.\n */\nfunction gitTarget(p: Record<string, string | undefined>): Record<string, unknown> {\n return {\n ...(p.serviceId ? { serviceId: p.serviceId } : {}),\n ...(p.projectId ? { projectId: p.projectId } : {}),\n ...(p.agentId ? { agentId: p.agentId } : {}),\n ...(p.orgId ? { orgId: p.orgId } : {}),\n };\n}\n\nconst toBool = (raw: string) => raw.trim().toLowerCase() === 'true';\n\nconst newId = () => globalThis.crypto.randomUUID();\n\n/** Un élément de liste tel qu'un modèle l'énumère : `3000` est un nombre, `api` un texte. */\nfunction listItem(raw: string): unknown {\n try {\n return JSON.parse(raw) as unknown;\n } catch {\n return raw;\n }\n}\n\n/**\n * Lire un paramètre typé, arrivé en chaîne, contre son schéma.\n *\n * Dans l'ordre : la chaîne telle quelle (un texte), son JSON (un objet, un\n * nombre, `null`), puis une énumération à virgules (une liste). Le résultat est\n * la sortie du schéma, défauts compris. Une valeur refusée échoue avec le nom\n * du champ : l'agent sait quoi corriger au lieu de conclure le geste impossible.\n */\nfunction parseTyped(name: string, schema: z.ZodType, raw: string | undefined): unknown {\n if (raw === undefined) return undefined;\n // « null » efface quand le champ l'accepte, avant d'être lu comme le texte « null ».\n let result = raw.trim() === 'null' ? schema.safeParse(null) : schema.safeParse(raw);\n if (!result.success && raw.trim() === 'null') result = schema.safeParse(raw);\n if (!result.success) {\n const text = raw.trim();\n const json = listItem(text);\n if (json !== text) result = schema.safeParse(json);\n if (!result.success && !/^[[{]/.test(text)) {\n const list = schema.safeParse(toList(text).map(listItem));\n if (list.success) result = list;\n }\n }\n if (!result.success) throw new Error(`${name}: ${z.prettifyError(result.error)}`);\n return result.data;\n}\n\n/** Un id pour chaque élément qui n'en donne pas, comme l'interface le fait à l'ajout. */\nfunction withIds<T extends { id?: string }>(items: T[]): (T & { id: string })[] {\n return items.map((item) => ({ ...item, id: item.id || newId() }));\n}\n\nconst optionalId = <T extends z.ZodObject<{ id: z.ZodString }>>(schema: T) =>\n schema.extend({ id: z.string().min(1).max(64).optional() });\n\n/**\n * La configuration Docker, telle qu'un agent doit la donner pour que le\n * conteneur démarre : exactement une source d'image — `image` à tirer, ou un\n * `dockerfile` à construire. Le schéma partagé ne l'impose pas (l'interface\n * garde l'autre champ en mémoire pendant qu'on bascule), l'outil si.\n */\nconst DockerConfigInput = DockerConfigSchema.extend({\n bootstrapCommands: z.array(optionalId(BootstrapCommandSchema)).max(20).default([]),\n}).refine((c) => !!c.image !== !!c.dockerfile, {\n message: 'dockerConfig needs exactly one of \"image\" (an image to pull) or \"dockerfile\" (a Dockerfile to build)',\n});\n\ninterface ServiceField {\n name: string;\n description: string;\n /** Absent : un texte simple. */\n schema?: z.ZodType;\n /** `service.update` accepte `null` pour effacer ce champ. */\n clearable?: boolean;\n}\n\n/**\n * Chaque champ écrivable d'un service, typé par le schéma partagé\n * (`ServiceConfigSchema`). `capabilities-routes.test.ts` vérifie qu'il n'en\n * manque aucun de ceux que les routes acceptent.\n */\nconst SERVICE_FIELDS: ServiceField[] = [\n { name: 'description', description: 'What the service is, in a sentence' },\n { name: 'agentId', description: 'The agent that runs it, from list_agents. Omit to inherit from the environment.', clearable: true },\n { name: 'cwd', description: \"Working directory, RELATIVE to the project root (e.g. \\\"apps/web\\\", or omit for the root). The project is synced between machines and lives in a different folder on each: Runeya resolves a relative cwd against each machine's own project folder, while an absolute path (/home/you/…) breaks on every other machine. Use an absolute path only for something outside the project, written with ~ or an environment variable ($NAME) rather than a literal home directory.\", clearable: true },\n { name: 'command', description: 'Shortcut for a single command line (e.g. \"npm run dev\"). Replaces every existing command. Use commands for several.' },\n { name: 'commands', description: 'The processes of the service. They all start AT THE SAME TIME, in parallel, and the service runs while they run — not one after another. Use several for processes that live side by side (a web server and a worker). Steps that must follow each other (build, then install, then launch) go in ONE command chained with &&. A one-off action the user triggers by hand (build, deploy, read logs) is a shortcut, not a command. Each command runs in the service cwd, or its own \"cwd\", relative to the project root. No absolute paths of this machine: the service is synced to other machines. Replaces every existing command. \"id\" is generated when omitted; \"shell\" runs the line through a shell (default true).', schema: z.array(optionalId(ServiceCommandSchema)).max(50) },\n { name: 'ports', description: 'Ports the service listens on. Declare them: they become {{service.PORT}}, {{service.URL}} and {{services.<slug>.URL}} for the other services, which environment variables should reference instead of repeating the numbers.', schema: ServiceConfigSchema.shape.ports.unwrap().unwrap() },\n { name: 'groups', description: 'Groups the service belongs to. Replaces the current ones.', schema: ServiceConfigSchema.shape.groups.unwrap().unwrap() },\n { name: 'url', description: 'URL where the service is reached' },\n { name: 'localUrls', description: 'Local domain names routed to a port of the service (e.g. {\"url\":\"api.localhost.dev\",\"port\":3000})', schema: ServiceConfigSchema.shape.localUrls.unwrap().unwrap() },\n { name: 'openapiUrl', description: 'URL of its OpenAPI document' },\n { name: 'docsPath', description: \"Where its markdown docs live, relative to cwd or absolute. Defaults to cwd.\" },\n { name: 'git', description: 'Its git repository: \"remote\" URL and \"home\" page', schema: ServiceConfigSchema.shape.git.unwrap(), clearable: true },\n { name: 'meta', description: 'Free key/value metadata (strings)', schema: ServiceConfigSchema.shape.meta.unwrap(), clearable: true },\n { name: 'runner', description: '\"native\" runs the commands on the machine; \"docker\" runs the service in a container and then needs dockerConfig', schema: ServiceConfigSchema.shape.runner.unwrap().unwrap() },\n { name: 'dockerConfig', description: 'With runner \"docker\": the container. Exactly one of \"image\" (pull) or \"dockerfile\" (inline Dockerfile, built with \"buildContext\", \"buildArgs\", \"targetStage\"). Ports and volumes use Docker syntax (\"8080:80\", \"./data:/data\"); host paths in volumes relative to the service directory, never an absolute path of this machine. \"useNativeCommand\" runs the service commands inside the container instead of its CMD (\"nativeCommandMode\": one shared container or one per command). \"bootstrapCommands\" run once when the container starts. Replaces the whole Docker configuration: read it first with get_service to keep what you do not change.', schema: DockerConfigInput },\n { name: 'healthCheck', description: 'How to tell the service is ready: an HTTP \"path\" to call, or a \"command\" that must succeed', schema: HealthCheckSchema, clearable: true },\n { name: 'autoRestart', description: 'Restart the service when it crashes', schema: z.boolean() },\n { name: 'restartStrategy', description: 'When to restart it', schema: RestartStrategySchema.unwrap() },\n { name: 'maxRestarts', description: 'Give up after this many restarts', schema: ServiceConfigSchema.shape.maxRestarts.unwrap() },\n { name: 'restartBackoffMs', description: 'Delay before a restart, in milliseconds', schema: ServiceConfigSchema.shape.restartBackoffMs.unwrap().unwrap() },\n { name: 'clearLogsOnStart', description: 'Clear the logs each time the service starts', schema: z.boolean() },\n { name: 'shortcuts', description: 'One-click actions shown on the service, run on demand and independently of the running commands (build, deploy, migrate, read logs). Same path rules as commands: relative to the project root, never an absolute path of this machine. Replaces the current ones. \"id\" is generated when omitted.', schema: z.array(optionalId(ServiceShortcutSchema)).max(50) },\n { name: 'parserIds', description: 'Log parsers applied to its output, by id', schema: ServiceConfigSchema.shape.parserIds.unwrap() },\n { name: 'logSources', description: 'Extra log sources beyond the console output (files, databases…). Replaces the current ones. Credentials (mongo connectionString, mysql password) read as \"***\": send \"***\" back to keep the stored value, or the real value to change it.', schema: ServiceConfigSchema.shape.logSources.unwrap().unwrap() },\n];\n\nfunction serviceParams(clearable: boolean): CapabilityParam[] {\n return SERVICE_FIELDS.map((f) => {\n const nullable = clearable && f.clearable;\n const base = f.schema ?? (nullable ? z.string() : undefined);\n return {\n name: f.name,\n description: nullable ? `${f.description} null clears it.` : f.description,\n required: false,\n ...(base ? { schema: nullable ? base.nullable() : base } : {}),\n };\n });\n}\n\nfunction serviceFields(p: Record<string, string | undefined>, params: CapabilityParam[]): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const param of params) {\n if (p[param.name] === undefined || param.name === 'command') continue;\n out[param.name] = param.schema ? parseTyped(param.name, param.schema, p[param.name]) : p[param.name];\n }\n if (p.command !== undefined && p.commands === undefined) out['commands'] = [{ label: '', command: p.command, shell: true }];\n if (Array.isArray(out['commands'])) out['commands'] = withIds(out['commands'] as { id?: string }[]);\n if (Array.isArray(out['shortcuts'])) out['shortcuts'] = withIds(out['shortcuts'] as { id?: string }[]);\n const docker = out['dockerConfig'] as { bootstrapCommands?: { id?: string }[] } | undefined;\n if (docker?.bootstrapCommands) out['dockerConfig'] = { ...docker, bootstrapCommands: withIds(docker.bootstrapCommands) };\n return out;\n}\n\n/**\n * Un service, ou une liste de services, tels qu'une IA peut les lire : les\n * identifiants de leurs sources de logs masqués. `service.get` les rend en clair\n * parce que l'interface les édite ; `update_service` accepte le masque en retour\n * et garde la valeur en place (`restoreLogSourceSecrets`).\n */\nfunction maskServices(result: unknown): unknown {\n if (Array.isArray(result)) return result.map(maskServices);\n if (result && typeof result === 'object' && Array.isArray((result as { logSources?: unknown }).logSources)) {\n const service = result as { logSources: LogSourceConfig[] };\n return { ...service, logSources: maskLogSourceSecrets(service.logSources) };\n }\n return result;\n}\n\n/**\n * Les variables intégrées, telles qu'un modèle doit les connaître pour composer\n * une valeur : tirées de `BUILTIN_VARIABLES`, la seule déclaration, pour qu'un\n * ajout y parvienne sans que personne pense à la description.\n */\nconst refs = (scope: 'server' | 'agent') => BUILTIN_VARIABLES\n .filter((b) => b.scope === scope)\n .map((b) => `{{${b.name}}}`)\n .join(', ');\nconst BUILTINS_HELP = `Built-in references Runeya fills itself — filled when the service is deployed, from the service that receives the variable: ${refs('server')}, the numbered {{service.PORT_2}} / {{service.URL_2}}… for its other ports, and {{services.<slug>.PORT}}, .URL, .BASE_URL, .NAME, .ID for a sibling service of the project (slug = its name in lowercase-dashes). Filled on the machine when the service starts: ${refs('agent')}.`;\n\nconst CREATE_SERVICE_PARAMS = serviceParams(false);\nconst UPDATE_SERVICE_PARAMS = serviceParams(true);\n\n// ─── Base de connaissance ───────────────────────────────────────────────────\n\nconst KNOWLEDGE_TYPES_DOC = KNOWLEDGE_PAGE_TYPES.map((t) => {\n const spec = KNOWLEDGE_TYPE_SPECS[t];\n const fields = spec.fields.map((f) => `${f.key} (${f.description})`).join('; ');\n return `${t}: ${spec.description}${fields ? ` Fields: ${fields}.` : ''}`;\n}).join(' | ');\n\nconst KNOWLEDGE_RELATIONS_DOC = `${KNOWLEDGE_RELATIONS.join(', ')} (related and contradicts read both ways)`;\n\nconst kIds = z.array(KnowledgeIdSchema).max(50);\nconst kSearchLimit = z.number().int().min(1).max(KNOWLEDGE_LIMITS.searchResults);\nconst kSections = z.array(KnowledgeSectionSchema).max(KNOWLEDGE_LIMITS.sections);\nconst kThemeDepth = z.number().int().min(0).max(KNOWLEDGE_LIMITS.themeDepth);\nconst kDepth = z.number().int().min(1).max(KNOWLEDGE_LIMITS.neighborsDepth);\nconst kRelatedLimit = z.number().int().min(1).max(KNOWLEDGE_LIMITS.relatedPages);\n/** Les pages de départ de knowledge_get_related : la route en accepte dix. */\nconst kNeighborLimit = z.number().int().min(1).max(KNOWLEDGE_LIMITS.neighborsNodes);\nconst kHistoryLimit = z.number().int().min(1).max(500);\nconst kSeedIds = z.array(KnowledgeIdSchema).min(1).max(10);\n\n/** Les paramètres typés d'une page, lus seulement quand l'agent les donne. */\nfunction knowledgePageFields(p: Record<string, string | undefined>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n if (p.title !== undefined) out.title = p.title;\n if (p.summary !== undefined) out.summary = p.summary;\n if (p.type !== undefined) out.type = parseTyped('type', KnowledgePageTypeSchema, p.type);\n if (p.aliases !== undefined) out.aliases = parseTyped('aliases', KnowledgeAliasesSchema, p.aliases);\n if (p.fields !== undefined) out.fields = parseTyped('fields', KnowledgeFieldsSchema, p.fields);\n if (p.themeIds !== undefined) out.themeIds = parseTyped('themeIds', KnowledgeThemeIdsSchema, p.themeIds);\n if (p.projectIds !== undefined) out.projectIds = parseTyped('projectIds', KnowledgeProjectIdsSchema, p.projectIds);\n if (p.sources !== undefined) out.sources = parseTyped('sources', KnowledgeSourcesSchema, p.sources);\n return out;\n}\n\n/**\n * La section demandée par son titre (sans casse ni accents). Absente : une\n * erreur qui liste les sections, plutôt qu'une liste vide qu'on prendrait pour\n * une section vide.\n */\nfunction sectionNamed(sections: Rec[], heading: string): Rec[] {\n const found = sections.filter((x) => foldText(String(x.heading)) === foldText(heading));\n if (found.length) return found;\n const names = sections.map((x) => `\"${String(x.heading)}\"`).join(', ') || 'none';\n throw new Error(`No section \"${heading}\" in this page. Sections: ${names}.`);\n}\n\n/** Une page lue par un agent : les sections suffisent, le corps entier les répète. */\nfunction withoutFullBody(result: unknown): unknown {\n if (!result || typeof result !== 'object' || !('page' in result)) return result;\n const page0 = (result as { page: unknown }).page;\n // `page: null` : écriture faite, relecture impossible pour l'instant (`pending`).\n if (page0 && typeof page0 === 'object') {\n const { markdown: _markdown, ...page } = page0 as Record<string, unknown>;\n return { ...(result as Record<string, unknown>), page };\n }\n return result;\n}\n\n/**\n * La réponse d'un remplacement de passage : la fiche de la page et, pour\n * chaque section touchée, les seuls paragraphes qui ont changé. Le cloud les\n * calcule en comparant l'avant et l'après (`changed`) : un retour en arrière\n * ou une suppression ne se devinent pas d'après le nouveau texte. Les autres\n * sections ne sont listées que par leur titre ; de la fiche, seul ce qui sert\n * à vérifier l'écriture est rendu (`knowledge_get_page` donne le reste).\n */\nfunction editedSectionOnly(result: unknown): unknown {\n const reduced = withoutFullBody(result);\n if (!reduced || typeof reduced !== 'object') return reduced;\n const { changed, ...response } = reduced as { changed?: { heading: string }[] } & Record<string, unknown>;\n const page = response.page;\n if (!page || typeof page !== 'object') return reduced;\n const { sections, id, title, status, lock, updatedAt, updatedBy } = page as { sections?: { heading: string }[] } & Record<string, unknown>;\n const edited = changed ?? [];\n const touched = new Set(edited.map((c) => c.heading));\n return {\n ...response,\n page: {\n // Ce qui sert à vérifier l'écriture ; la fiche complète est dans knowledge_get_page.\n id, title, status, locked: Boolean(lock), updatedAt, updatedBy,\n editedSections: edited,\n otherSections: (sections ?? []).map((s) => s.heading).filter((h) => !touched.has(h)),\n },\n };\n}\n\ntype Rec = Record<string, unknown>;\nconst isRec = (v: unknown): v is Rec => !!v && typeof v === 'object' && !Array.isArray(v);\n\n/** Un thème cité dans une réponse : son id et son titre, pas sa fiche. */\nfunction slimThemes<T>(item: T): T {\n if (!isRec(item) || !Array.isArray(item.themes)) return item;\n return { ...item, themes: (item.themes as Rec[]).map((t) => ({ id: t.id, title: t.title })) } as T;\n}\n\n/** Ce qui sert à vérifier une écriture ; la fiche complète est dans knowledge_get_page. */\nfunction pageSheet(page: Rec): Rec {\n return { id: page.id, title: page.title, status: page.status, locked: Boolean(page.lock ?? page.locked), updatedAt: page.updatedAt, updatedBy: page.updatedBy };\n}\n\n/** Une page liée de plusieurs façons (relation déclarée et mention) n'apparaît qu'une fois, avec toutes ses sortes de lien. */\nfunction mergedLinks(links: unknown): Rec[] {\n const byId = new Map<string, Rec>();\n for (const l of Array.isArray(links) ? (links as Rec[]) : []) {\n const id = String(l.id);\n const seen = byId.get(id);\n if (seen) (seen.kinds as unknown[]).push(l.kind);\n else byId.set(id, { id: l.id, title: l.title, type: l.type, status: l.status, kinds: [l.kind] });\n }\n return [...byId.values()];\n}\n\n/**\n * La réponse d'une écriture : la fiche de vérification et ce que l'écriture\n * concerne (`pick`), pas la page entière.\n */\nfunction writeAnswer(pick: (page: Rec, input: Rec) => Rec) {\n return (result: unknown, input?: unknown): unknown => {\n const reduced = withoutFullBody(result);\n if (!isRec(reduced) || !isRec(reduced.page)) return reduced;\n return { ...reduced, page: { ...pageSheet(reduced.page), ...pick(reduced.page, isRec(input) ? input : {}) } };\n };\n}\n\nconst headingsOf = (page: Rec) => (Array.isArray(page.sections) ? (page.sections as Rec[]).map((x) => String(x.heading)) : []);\n\n/** Une page lue par un agent : thèmes réduits, liens fusionnés, et une seule section si `heading` est donné. */\nfunction readPageAnswer(result: unknown, input?: unknown): unknown {\n const reduced = withoutFullBody(result);\n if (!isRec(reduced) || !isRec(reduced.page)) return reduced;\n const page = slimThemes(reduced.page);\n const links = isRec(page.links) ? page.links : {};\n const heading = isRec(input) && typeof input.heading === 'string' ? input.heading : undefined;\n const sections = Array.isArray(page.sections) ? (page.sections as Rec[]) : [];\n const picked = heading === undefined ? sections : sectionNamed(sections, heading);\n return {\n ...reduced,\n page: {\n ...page,\n links: { outgoing: mergedLinks(links.outgoing), incoming: mergedLinks(links.incoming) },\n sections: picked,\n ...(heading === undefined ? {} : { otherSections: headingsOf(page).filter((h) => foldText(h) !== foldText(heading)) }),\n // Les sections encore vides : une page à compléter se voit sans relire le détail.\n ...(sections.some((x) => !String(x.markdown).trim()) ? { emptySections: sections.filter((x) => !String(x.markdown).trim()).map((x) => String(x.heading)) } : {}),\n },\n };\n}\n\nconst KNOWLEDGE_LOCK_NOTE = 'A page locked by a person cannot be changed by you: the call is refused, tell the user what you would change instead.';\n\nconst KNOWLEDGE_CAPABILITIES: RuneyaCapability[] = [\n {\n name: 'knowledge_list_spaces',\n description: \"List the knowledge spaces of the organization (the team's long-term memory, kept in the cloud). Returns the organizationId actually queried and each space id, name, description and page count.\",\n route: 'knowledge.listSpaces',\n method: 'GET',\n params: [{ name: 'organizationId', description: 'The organization. Optional when the machine has one.', required: false }],\n buildInput: (p) => (p.organizationId ? { organizationId: p.organizationId } : {}),\n usageHint: '\"qu\\'est-ce qu\\'on sait sur…\" / \"cherche dans la mémoire\" → knowledge_search before answering from your own assumptions.',\n },\n {\n name: 'knowledge_search',\n description: `Search the knowledge base: free text (accent and case insensitive, French stemming; each word may be partial and is looked for in titles, aliases, summaries, fields and bodies; every remaining word must match, stop words are ignored), filtered by type, space, project and themes. Each hit gives its summary, theme ids (their titles are listed once in themes) and the number of linked pages, so you can choose without opening pages. Cross themes with themeIds: only pages carrying ALL the given themes are returned, each theme counting its sub-themes down to themeDepth levels (0 = the theme alone, default 1). Obsolete pages are left out unless includeObsolete. Without a query, pages come by last update and the answer gives nextCursor: pass it as cursor to get the next ones, until it is absent. With a query, nextCursor gives the next results of the same ranking, frozen for 15 minutes (pass the same query with it): nothing is skipped or repeated even if pages change meanwhile. incomplete: true means more pages match than were examined: refine the query (more words, a type, a theme, a space) rather than trusting the list as complete. Page types: ${KNOWLEDGE_TYPES_DOC}`,\n route: 'knowledge.search',\n method: 'GET',\n params: [\n { name: 'query', description: 'Free text. Omit to list pages by last update.', required: false },\n { name: 'types', description: `Page types to keep: ${KNOWLEDGE_PAGE_TYPES.join(', ')}`, required: false, schema: z.array(KnowledgePageTypeSchema) },\n { name: 'themeIds', description: 'Theme page ids the pages must ALL carry (from knowledge_list_themes)', required: false, schema: KnowledgeThemeIdsSchema },\n { name: 'themeDepth', description: `Levels of sub-themes counted with each theme, 0 to ${KNOWLEDGE_LIMITS.themeDepth}`, required: false, schema: kThemeDepth },\n { name: 'spaceIds', description: 'Restrict to these spaces', required: false, schema: kIds },\n // Pas `projectId` : ce nom est rempli d'office avec le projet de la\n // conversation (project-anchor), ce qui filtrait toute recherche sur lui.\n { name: 'onlyProjectId', description: 'Only pages attached to this Runeya project. Omit to search the whole organization.', required: false },\n { name: 'includeObsolete', description: 'Also return obsolete pages', required: false, schema: z.boolean() },\n { name: 'limit', description: `At most this many hits (1-${KNOWLEDGE_LIMITS.searchResults}, default 20)`, required: false, schema: kSearchLimit },\n { name: 'organizationId', description: 'The organization. Optional when the machine has one.', required: false },\n { name: 'cursor', description: 'The nextCursor of the previous answer, to get the next pages (with a query, pass the same query)', required: false },\n ],\n buildInput: (p) => ({\n ...(p.organizationId ? { organizationId: p.organizationId } : {}),\n ...(p.query ? { query: p.query } : {}),\n ...(p.onlyProjectId ? { projectId: p.onlyProjectId } : {}),\n ...(p.types !== undefined ? { types: parseTyped('types', z.array(KnowledgePageTypeSchema), p.types) } : {}),\n ...(p.themeIds !== undefined ? { themeIds: parseTyped('themeIds', KnowledgeThemeIdsSchema, p.themeIds) } : {}),\n ...(p.themeDepth !== undefined ? { themeDepth: parseTyped('themeDepth', kThemeDepth, p.themeDepth) } : {}),\n ...(p.spaceIds !== undefined ? { spaceIds: parseTyped('spaceIds', kIds, p.spaceIds) } : {}),\n ...(p.includeObsolete !== undefined ? { includeObsolete: parseTyped('includeObsolete', z.boolean(), p.includeObsolete) } : {}),\n ...(p.limit !== undefined ? { limit: parseTyped('limit', kSearchLimit, p.limit) } : {}),\n ...(p.cursor !== undefined ? { cursor: p.cursor } : {}),\n }),\n // Les thèmes une seule fois, en tête : chaque résultat ne porte que leurs ids.\n transformOutput: (result) => {\n if (!isRec(result) || !Array.isArray(result.hits)) return result;\n const themes: Record<string, unknown> = {};\n const hits = (result.hits as Rec[]).map((h) => {\n const ids = Array.isArray(h.themes) ? (h.themes as Rec[]).map((t) => { themes[String(t.id)] = t.title; return t.id; }) : [];\n return { ...h, themes: ids };\n });\n return { ...result, themes, hits };\n },\n },\n {\n name: 'knowledge_list_themes',\n description: 'List the theme pages: each theme id, title, its broader themes (parentIds) and how many pages carry it. Themes form a hierarchy from broad to precise; use their ids in knowledge_search themeIds to cross pages by subject. A theme with similarTo has an almost identical title to those themes: probably a duplicate, prefer the one with the most pages.',\n route: 'knowledge.listThemes',\n method: 'GET',\n params: [\n { name: 'spaceId', description: 'Only the themes of this space', required: false },\n { name: 'organizationId', description: 'The organization. Optional when the machine has one.', required: false },\n ],\n buildInput: (p) => ({ ...(p.organizationId ? { organizationId: p.organizationId } : {}), ...(p.spaceId ? { spaceId: p.spaceId } : {}) }),\n },\n {\n name: 'knowledge_get_page',\n description: 'Read one knowledge page: type, fields, summary, aliases, themes, sources, its sections in Markdown, links in both directions (each linked page once, with all its link kinds), what replaces it, and whether it is locked. Links to other pages in the body are written [title](kb:<pageId>).',\n route: 'knowledge.getPage',\n method: 'GET',\n params: [\n { name: 'pageId', description: 'The page id', required: true },\n { name: 'heading', description: 'Read only this section (heading, case and accents ignored); the others are listed by heading', required: false },\n ],\n buildInput: (p) => ({ pageId: p.pageId, ...(p.heading !== undefined ? { heading: p.heading } : {}) }),\n transformOutput: readPageAnswer,\n },\n {\n name: 'knowledge_get_neighbors',\n description: 'Walk the graph around a page, both directions, 1 to 3 hops: the pages reached (nearest first, with their distance and summary) and the edges between them. Obsolete pages are left out unless includeObsolete. Edge kinds: explicit relations, theme (a page and its theme), mentions (a [title](kb:id) link in a body), superseded_by.',\n route: 'knowledge.getNeighbors',\n method: 'GET',\n params: [\n { name: 'pageId', description: 'The starting page', required: true },\n { name: 'depth', description: `Number of hops, 1 to ${KNOWLEDGE_LIMITS.neighborsDepth} (default 1)`, required: false, schema: kDepth },\n { name: 'kinds', description: 'Only follow these edge kinds', required: false, schema: z.array(KnowledgeEdgeKindSchema) },\n { name: 'limit', description: 'At most this many pages, nearest first (default all)', required: false, schema: kNeighborLimit },\n { name: 'includeObsolete', description: 'Also return obsolete pages (left out by default)', required: false, schema: z.boolean() },\n ],\n buildInput: (p) => ({\n pageId: p.pageId,\n ...(p.depth !== undefined ? { depth: parseTyped('depth', kDepth, p.depth) } : {}),\n ...(p.kinds !== undefined ? { kinds: parseTyped('kinds', z.array(KnowledgeEdgeKindSchema), p.kinds) } : {}),\n ...(p.limit !== undefined ? { limit: parseTyped('limit', kNeighborLimit, p.limit) } : {}),\n ...(p.includeObsolete !== undefined ? { includeObsolete: parseTyped('includeObsolete', z.boolean(), p.includeObsolete) } : {}),\n }),\n transformOutput: (result, input) => {\n if (!isRec(result) || !Array.isArray(result.nodes)) return result;\n const limit = isRec(input) && typeof input.limit === 'number' ? input.limit : undefined;\n const all = (result.nodes as Rec[]).map(slimThemes);\n const nodes = limit === undefined ? all : all.slice(0, limit + 1); // + la page de départ, à distance 0\n const kept = new Set(nodes.map((n) => n.id));\n // Deux pages reliées de plusieurs façons : une arête, avec toutes ses sortes.\n const merged = new Map<string, Rec>();\n for (const e of Array.isArray(result.edges) ? (result.edges as Rec[]) : []) {\n if (!kept.has(e.from) || !kept.has(e.to)) continue;\n const key = `${String(e.from)}>${String(e.to)}`;\n const seen = merged.get(key);\n if (seen) (seen.kinds as unknown[]).push(e.kind);\n else merged.set(key, { from: e.from, to: e.to, kinds: [e.kind] });\n }\n const edges = [...merged.values()];\n // `omitted` : ce que la limite a laissé de côté ; `truncated` dit en plus si\n // le parcours lui-même s'est arrêté à sa borne.\n return { ...result, nodes, edges, truncated: Boolean(result.truncated) || nodes.length < all.length, omitted: all.length - nodes.length };\n },\n },\n {\n name: 'knowledge_get_related',\n description: 'Find the pages closest to one or several pages, even without a direct link: score = 3 × direct links + 2 × shared themes + 1 × shared neighbors. Obsolete pages are left out unless includeObsolete. Use it to gather everything on a subject before answering or writing.',\n route: 'knowledge.getRelated',\n method: 'GET',\n params: [\n { name: 'pageIds', description: 'One to ten page ids', required: true, schema: kSeedIds },\n { name: 'limit', description: 'At most this many pages (default 10)', required: false, schema: kRelatedLimit },\n { name: 'includeObsolete', description: 'Also return obsolete pages (left out by default)', required: false, schema: z.boolean() },\n ],\n buildInput: (p) => ({\n pageIds: parseTyped('pageIds', kSeedIds, p.pageIds),\n ...(p.limit !== undefined ? { limit: parseTyped('limit', kRelatedLimit, p.limit) } : {}),\n ...(p.includeObsolete !== undefined ? { includeObsolete: parseTyped('includeObsolete', z.boolean(), p.includeObsolete) } : {}),\n }),\n transformOutput: (result) => (isRec(result) && Array.isArray(result.pages) ? { ...result, pages: result.pages.map(slimThemes) } : result),\n },\n {\n name: 'knowledge_get_history',\n description: 'Read the history of a page: its versions, newest first, each with its date (at), its author (a person or an AI) and the number of changes. Each AI write is its own version; close edits by one person are grouped. Read the content of a version with knowledge_get_version.',\n route: 'knowledge.getHistory',\n method: 'GET',\n params: [\n { name: 'pageId', description: 'The page id', required: true },\n { name: 'limit', description: 'At most this many versions, newest first (default all)', required: false, schema: kHistoryLimit },\n ],\n buildInput: (p) => ({ pageId: p.pageId, ...(p.limit !== undefined ? { limit: parseTyped('limit', kHistoryLimit, p.limit) } : {}) }),\n transformOutput: (result, input) => {\n if (!isRec(result) || !Array.isArray(result.versions)) return result;\n const limit = isRec(input) && typeof input.limit === 'number' ? input.limit : undefined;\n const all = (result.versions as Rec[]).map((v) => {\n // `from` ne dit quelque chose que pour une version qui regroupe plusieurs modifications.\n const { from, ...rest } = v;\n return from === v.at ? rest : v;\n });\n const versions = limit === undefined ? all : all.slice(0, limit);\n return { ...result, versions, omitted: all.length - versions.length };\n },\n },\n {\n name: 'knowledge_get_version',\n description: 'Read a page as it was at a past date: title, summary, status, fields and sections in Markdown. Take the date (at) from knowledge_get_history. With compare, the answer also gives what changed since that version (sinceThen): changed paragraphs per section (previous = the version, paragraphs = now) and the sheet fields that differ. Restoring a version is left to people, in the app.',\n route: 'knowledge.getVersion',\n method: 'GET',\n params: [\n { name: 'pageId', description: 'The page id', required: true },\n { name: 'at', description: 'The date of the version, as given by knowledge_get_history (ISO 8601)', required: true, schema: z.iso.datetime() },\n { name: 'heading', description: 'Read only this section of the version', required: false },\n { name: 'compare', description: 'Also give what changed since this version (sinceThen)', required: false, schema: z.boolean() },\n ],\n buildInput: (p) => ({ pageId: p.pageId, at: parseTyped('at', z.iso.datetime(), p.at), ...(p.heading !== undefined ? { heading: p.heading } : {}), ...(p.compare !== undefined ? { compare: parseTyped('compare', z.boolean(), p.compare) } : {}) }),\n transformOutput: (result, input) => {\n if (!isRec(result) || !isRec(result.snapshot)) return result;\n const { markdown: _markdown, ...snapshot } = result.snapshot;\n const extra = result.sinceThen === undefined ? {} : { sinceThen: result.sinceThen };\n const heading = isRec(input) && typeof input.heading === 'string' ? input.heading : undefined;\n if (heading === undefined) return { snapshot, ...extra };\n const sections = Array.isArray(snapshot.sections) ? (snapshot.sections as Rec[]) : [];\n return { snapshot: { ...snapshot, sections: sectionNamed(sections, heading) }, ...extra };\n },\n },\n {\n name: 'knowledge_create_page',\n description: `Create a knowledge page. Search first: update an existing page rather than creating a duplicate. The answer lists pages with an almost identical title (similar): if one is the same subject, mark the new page obsolete and complete the existing one. Give a precise title, a one or two sentence summary (it is what searches show), aliases (other names people use), themes and links. Sections default to those of the type; give your own as [{\"heading\",\"markdown\"}]. Cite other pages in Markdown as [title](kb:<pageId>). Types: ${KNOWLEDGE_TYPES_DOC}`,\n route: 'knowledge.createPage',\n method: 'POST',\n params: [\n { name: 'spaceId', description: 'The space, from knowledge_list_spaces', required: true },\n { name: 'type', description: `One of ${KNOWLEDGE_PAGE_TYPES.join(', ')}`, required: true, schema: KnowledgePageTypeSchema },\n { name: 'title', description: 'Page title', required: true },\n { name: 'summary', description: 'One or two sentences', required: true },\n { name: 'aliases', description: 'Other names for the subject', required: false, schema: KnowledgeAliasesSchema },\n { name: 'fields', description: 'The fields of the type, as an object', required: false, schema: KnowledgeFieldsSchema },\n { name: 'themeIds', description: 'Theme page ids', required: false, schema: KnowledgeThemeIdsSchema },\n { name: 'projectIds', description: 'Runeya project ids the page is about', required: false, schema: KnowledgeProjectIdsSchema },\n { name: 'sources', description: 'Where the knowledge comes from: [{\"label\",\"url\"?}]', required: false, schema: KnowledgeSourcesSchema },\n { name: 'sections', description: 'Body sections: [{\"heading\",\"markdown\"}]', required: false, schema: kSections },\n { name: 'links', description: `Links to other pages: [{\"to\",\"relation\"}], relation among ${KNOWLEDGE_RELATIONS_DOC}`, required: false, schema: z.array(KnowledgeLinkSchema).max(200) },\n { name: 'locale', description: 'Language of default section titles: fr or en', required: false, schema: KnowledgeLocaleSchema },\n ],\n buildInput: (p) => ({\n spaceId: p.spaceId,\n ...knowledgePageFields(p),\n ...(p.sections !== undefined ? { sections: parseTyped('sections', kSections, p.sections) } : {}),\n ...(p.links !== undefined ? { links: parseTyped('links', z.array(KnowledgeLinkSchema).max(200), p.links) } : {}),\n ...(p.locale !== undefined ? { locale: parseTyped('locale', KnowledgeLocaleSchema, p.locale) } : {}),\n }),\n transformOutput: writeAnswer((page) => ({ themes: slimThemes(page).themes, sections: headingsOf(page) })),\n },\n {\n name: 'knowledge_update_page',\n description: `Change the card of a page: title, summary, type, aliases, fields (merged; an empty value clears a field), themes, projects, sources (lists replace the current ones), status. To retire a page, set supersededBy to the page replacing it (it becomes obsolete) or status to obsolete: you cannot delete pages. ${KNOWLEDGE_LOCK_NOTE}`,\n route: 'knowledge.updatePage',\n method: 'POST',\n params: [\n { name: 'pageId', description: 'The page id', required: true },\n { name: 'title', description: 'New title', required: false },\n { name: 'summary', description: 'New summary', required: false },\n { name: 'type', description: 'New type', required: false, schema: KnowledgePageTypeSchema },\n { name: 'aliases', description: 'Replaces the aliases', required: false, schema: KnowledgeAliasesSchema },\n { name: 'fields', description: 'Fields to set or clear', required: false, schema: KnowledgeFieldsSchema },\n { name: 'themeIds', description: 'Replaces the themes', required: false, schema: KnowledgeThemeIdsSchema },\n { name: 'projectIds', description: 'Replaces the projects', required: false, schema: KnowledgeProjectIdsSchema },\n { name: 'sources', description: 'Replaces the sources', required: false, schema: KnowledgeSourcesSchema },\n { name: 'status', description: 'active or obsolete', required: false, schema: KnowledgeStatusSchema },\n { name: 'supersededBy', description: 'The page replacing this one; null removes it', required: false, schema: KnowledgeIdSchema.nullable() },\n ],\n buildInput: (p) => ({\n pageId: p.pageId,\n ...knowledgePageFields(p),\n ...(p.status !== undefined ? { status: parseTyped('status', KnowledgeStatusSchema, p.status) } : {}),\n ...(p.supersededBy !== undefined ? { supersededBy: parseTyped('supersededBy', KnowledgeIdSchema.nullable(), p.supersededBy) } : {}),\n }),\n // Les seuls champs de la fiche que l'appel a donnés, tels qu'enregistrés.\n transformOutput: writeAnswer((page, input) => Object.fromEntries(Object.keys(input).flatMap((key) => {\n if (key === 'pageId') return [];\n if (key === 'themeIds') return [['themes', slimThemes(page).themes]];\n return [[key, page[key]]];\n }))),\n },\n {\n name: 'knowledge_update_section',\n description: `Write one section of a page body, named by its heading (case and accents ignored): replace its content, append to it, or remove it. A heading that does not exist is an error listing the sections (often a typo); set create to true to add it at the end. An empty heading is the text before the first section. Inside the markdown, use ### or deeper for subheadings: a # or ## line is refused. Other sections are left untouched, including what a person is typing in them. ${KNOWLEDGE_LOCK_NOTE}`,\n route: 'knowledge.editSection',\n method: 'POST',\n params: [\n { name: 'pageId', description: 'The page id', required: true },\n { name: 'heading', description: 'The section heading', required: true },\n { name: 'markdown', description: 'The content, in Markdown (required unless mode is remove)', required: false },\n { name: 'mode', description: 'replace (default), append or remove', required: false, schema: KnowledgeSectionModeSchema },\n { name: 'create', description: 'Create the section at the end if no section has this heading', required: false, schema: z.boolean() },\n ],\n buildInput: (p) => {\n // Un titre # ou ## commencerait une autre section : refusé avant d'écrire,\n // plutôt que signalé après coup.\n const started = typeof p.markdown === 'string' ? [...p.markdown.matchAll(/^#{1,2}\\s+(.+)$/gm)].map((m) => m[1]!.trim()) : [];\n if (started.length) {\n throw new Error(`The markdown would start new sections (${started.map((h) => `\"${h}\"`).join(', ')}). Use ### or deeper for subheadings inside a section, or write each section with its own call.`);\n }\n return {\n pageId: p.pageId,\n heading: p.heading ?? '',\n ...(p.markdown !== undefined ? { markdown: p.markdown } : {}),\n ...(p.mode !== undefined ? { mode: parseTyped('mode', KnowledgeSectionModeSchema, p.mode) } : {}),\n ...(p.create !== undefined ? { create: parseTyped('create', z.boolean(), p.create) } : {}),\n };\n },\n transformOutput: writeAnswer((page, input) => {\n const heading = typeof input.heading === 'string' ? input.heading : '';\n const sections = Array.isArray(page.sections) ? (page.sections as Rec[]) : [];\n return {\n section: sections.find((x) => foldText(String(x.heading)) === foldText(heading)) ?? null,\n otherSections: headingsOf(page).filter((h) => foldText(h) !== foldText(heading)),\n };\n }),\n },\n {\n name: 'knowledge_edit_text',\n description: `Replace an exact passage of a page body, like a text editor: send only the old text and the new one, not the whole section. The passage is matched against the Markdown returned by knowledge_get_page (so bold is **…**, a page link is [title](kb:id)) and must appear exactly once, in the given section or in the whole body; otherwise nothing is written and the error says whether it is missing or ambiguous. The answer gives the page id, title, status, lock and last update and, for each edited section, only the paragraphs that are new or changed, their previous version and how many were deleted without replacement (editedSections); the other sections are listed by heading, and the rest of the sheet (themes, fields, links) is left out: read it with knowledge_get_page. Prefer it to knowledge_update_section for a change inside a long section. To insert text, anchor on the words around the insertion point: to complete \"We chose Mongo.\" send find \"We chose Mongo.\" and replace \"We chose Mongo for its flexibility.\". ${KNOWLEDGE_LOCK_NOTE}`,\n route: 'knowledge.editText',\n method: 'POST',\n params: [\n { name: 'pageId', description: 'The page id', required: true },\n { name: 'find', description: 'The exact text to replace, as it appears in the page Markdown. Include enough surrounding words for it to be unique.', required: true },\n { name: 'replace', description: 'The new text (empty to delete the passage)', required: true },\n { name: 'heading', description: 'Look only in this section (heading, case and accents ignored; empty = text before the first section)', required: false },\n { name: 'all', description: 'Replace every occurrence instead of requiring a unique one', required: false, schema: z.boolean() },\n ],\n buildInput: (p) => ({\n pageId: p.pageId,\n find: p.find,\n replace: p.replace ?? '',\n ...(p.heading !== undefined ? { heading: p.heading } : {}),\n ...(p.all !== undefined ? { all: parseTyped('all', z.boolean(), p.all) } : {}),\n }),\n transformOutput: editedSectionOnly,\n },\n {\n name: 'knowledge_link_pages',\n description: `Declare a link from a page to another: ${KNOWLEDGE_RELATIONS_DOC}. The link belongs to the starting page, so you may link to a locked page. The answer says whether the link already existed (alreadyLinked). ${KNOWLEDGE_LOCK_NOTE}`,\n route: 'knowledge.link',\n method: 'POST',\n params: [\n { name: 'pageId', description: 'The starting page', required: true },\n { name: 'to', description: 'The target page', required: true },\n { name: 'relation', description: KNOWLEDGE_RELATIONS.join(', '), required: true, schema: KnowledgeRelationSchema },\n ],\n buildInput: (p) => ({ pageId: p.pageId, to: p.to, relation: parseTyped('relation', KnowledgeRelationSchema, p.relation) }),\n transformOutput: writeAnswer((page) => ({ outgoingLinks: mergedLinks(isRec(page.links) ? page.links.outgoing : []) })),\n },\n {\n name: 'knowledge_unlink_pages',\n description: `Remove a link declared by a page; without relation, every declared link to the target. The answer says how many were removed (removed). A mentions link comes from a [title](kb:id) in the body: remove it by editing the text (knowledge_edit_text), not with this tool. ${KNOWLEDGE_LOCK_NOTE}`,\n route: 'knowledge.unlink',\n method: 'POST',\n params: [\n { name: 'pageId', description: 'The starting page', required: true },\n { name: 'to', description: 'The target page', required: true },\n { name: 'relation', description: `${KNOWLEDGE_RELATIONS.join(', ')}. Omit it to remove every declared link to the target page.`, required: false, schema: KnowledgeRelationSchema },\n ],\n buildInput: (p) => ({ pageId: p.pageId, to: p.to, ...(p.relation !== undefined ? { relation: parseTyped('relation', KnowledgeRelationSchema, p.relation) } : {}) }),\n transformOutput: writeAnswer((page) => ({ outgoingLinks: mergedLinks(isRec(page.links) ? page.links.outgoing : []) })),\n },\n];\n\nexport const RUNEYA_CAPABILITIES: RuneyaCapability[] = [\n {\n name: 'list_services',\n transformOutput: maskServices,\n description: \"List services, with the serviceId and agentId to use in other calls. Pass the projectId your context names to stay on the project the user is looking at, or another one from list_projects to look elsewhere. Called with no project, this can answer for every project of every organization on the machine — far more than the interface shows.\",\n route: 'service.list',\n method: 'GET',\n params: [\n { name: 'projectId', description: 'Restrict to this project, from list_projects. Omit to list every service on the machine.', required: false },\n { name: 'orgId', description: 'With projectId: its organization, needed only when the same project id exists in several. Alone: list the services of this whole organization.', required: false },\n ],\n // `orgId` seul est une portée à part entière, que `service.list` sait filtrer :\n // l'omettre rendait toute la machine.\n buildInput: (p) => {\n if (p.projectId) return { projectId: p.projectId, ...(p.orgId ? { orgId: p.orgId } : {}) };\n return p.orgId ? { orgId: p.orgId } : undefined;\n },\n },\n {\n name: 'get_service_status',\n description: \"Get the current status (running, stopped, etc.) of a service. A service that has never been started on this agent has no process yet, and this answers 404 Process not found — that means STOPPED, not forbidden and not missing. Start it, or read its configuration with get_service.\",\n route: 'process.get',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'The service ID', required: true },\n { name: 'agentId', description: 'The agent ID hosting this service', required: true },\n ],\n buildInput: (p) => ({ agentId: p.agentId, id: p.serviceId }),\n },\n {\n name: 'get_logs',\n description: 'Get the recent buffered logs for a service.',\n route: 'process.logs',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'The service ID', required: true },\n { name: 'agentId', description: 'The agent ID hosting this service', required: true },\n ],\n buildInput: (p) => ({ agentId: p.agentId, processId: p.serviceId }),\n },\n {\n name: 'start_service',\n description: 'Start a service on an agent.',\n route: 'process.start',\n method: 'POST',\n params: [\n { name: 'serviceId', description: 'The service ID to start', required: true },\n { name: 'agentId', description: 'The agent ID hosting this service', required: true },\n ],\n buildInput: (p) => ({ agentId: p.agentId, processId: p.serviceId }),\n destructive: true,\n },\n {\n name: 'stop_service',\n description: 'Stop a running service on an agent.',\n route: 'process.stop',\n method: 'POST',\n params: [\n { name: 'serviceId', description: 'The service ID to stop', required: true },\n { name: 'agentId', description: 'The agent ID hosting this service', required: true },\n ],\n buildInput: (p) => ({ agentId: p.agentId, processId: p.serviceId }),\n destructive: true,\n },\n {\n name: 'restart_service',\n description: 'Restart a service on an agent (stop → redeploy → start).',\n route: 'process.restart',\n method: 'POST',\n params: [\n { name: 'serviceId', description: 'The service ID to restart', required: true },\n { name: 'agentId', description: 'The agent ID hosting this service', required: true },\n ],\n buildInput: (p) => ({ agentId: p.agentId, processId: p.serviceId }),\n destructive: true,\n },\n\n // ─── Utility ─────────────────────────────────────────────────────────────\n\n {\n name: 'wait',\n description: 'Wait for a given number of milliseconds before continuing.',\n route: 'utility.wait',\n method: 'POST',\n params: [\n { name: 'ms', description: 'Number of MILLISECONDS to wait. Convert from seconds: 1s=1000, 10s=10000, 1min=60000. Max 300000.', required: true },\n ],\n buildInput: (p) => ({ ms: Number(p.ms) }),\n usageHint: '\"wait 5s\" → wait(ms=5000), \"pause 10 seconds\" → wait(ms=10000), \"attends 3 secondes\" → wait(ms=3000). Always convert to milliseconds.',\n },\n\n // ─── Kanban ───────────────────────────────────────────────────────────────\n\n {\n name: 'kanban_list_boards',\n description: 'List the kanban boards of the organization. Returns the organizationId actually queried, the boardId to use in the other kanban tools, plus column and card counts. Cards themselves are not included — use kanban_get_board for those. An empty list means that organization really has no board: a failure to reach the cloud is reported as an error instead, never as an empty list.',\n route: 'kanban.listBoards',\n method: 'GET',\n params: [\n { name: 'includeArchived', description: 'Set to \"true\" to include archived boards. Default: false.', required: false },\n { name: 'organizationId', description: 'Which organization to read. Optional: needed only when the account belongs to several and the error message asks for it.', required: false },\n ],\n buildInput: (p) => ({\n includeArchived: p.includeArchived === 'true',\n ...(p.organizationId ? { organizationId: p.organizationId } : {}),\n }),\n },\n {\n name: 'kanban_get_board',\n description: 'Read one kanban board: its columns, and the cards in each (id, title, markdown body, assignees, comment count, and attachment metadata — use kanban_download_attachment to fetch the bytes of a file). Use the exact column names it returns when moving or adding a card.',\n route: 'kanban.getBoard',\n method: 'GET',\n params: [\n { name: 'boardId', description: 'The kanban board ID, from kanban_list_boards', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId }),\n },\n {\n name: 'kanban_get_card_comments',\n description: \"Read the comment thread of one kanban card, newest last: who wrote each comment (ai or user, with the person's name), when, its text, and its attachments. The comments in your task context are a snapshot taken when the task started — call this to see anything written since, whenever someone tells you a comment was added or kanban_get_board reports a higher commentCount than you have.\",\n route: 'kanban.getCardComments',\n method: 'GET',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'cardId', description: 'The card ID whose comments to read', required: true },\n { name: 'limit', description: 'How many of the most recent comments to return (1-200). Default: 50.', required: false },\n ],\n buildInput: (p) => ({\n boardId: p.boardId,\n cardId: p.cardId,\n ...(p.limit ? { limit: Number(p.limit) } : {}),\n }),\n usageHint: '\"le support a ajouté un commentaire\" / \"regarde les nouveaux commentaires\" → kanban_get_card_comments(boardId, cardId). Never answer from the snapshot in your context when fresh comments are mentioned.',\n },\n {\n name: 'kanban_search_cards',\n description: 'Search kanban cards by free text, matched against their title, body, comments and the support conversations they follow (title, messages, internal notes, and the names of message authors) — accent- and case-insensitive. Archived cards are included. Searches every board of the organization unless boardId narrows it down. createdBy narrows to the cards someone created (\"les cartes créées par Isabelle\"), alone or with a query.',\n route: 'kanban.searchCards',\n method: 'GET',\n params: [\n { name: 'query', description: 'Text to look for in card titles, bodies, comments and followed conversations. Optional when createdBy is given.', required: false },\n { name: 'createdBy', description: 'Only cards created by this author: a user id, or a name (accent- and case-insensitive, partial match).', required: false },\n { name: 'boardId', description: 'Restrict the search to this board. Omit to search all boards.', required: false },\n { name: 'limit', description: 'Maximum number of cards to return (1-100). Default: 25.', required: false },\n { name: 'organizationId', description: 'Which organization to search. Optional: needed only when the account belongs to several and the error message asks for it.', required: false },\n ],\n buildInput: (p) => ({\n ...(p.query ? { query: p.query } : {}),\n ...(p.createdBy ? { createdBy: p.createdBy } : {}),\n ...(p.boardId ? { boardId: p.boardId } : {}),\n ...(p.limit ? { limit: Number(p.limit) } : {}),\n ...(p.organizationId ? { organizationId: p.organizationId } : {}),\n }),\n },\n {\n name: 'kanban_download_attachment',\n description: 'Download a kanban card attachment (image, PDF, any file) onto this machine and return its local path, so it can be opened with file-reading tools. Attachment ids come from the card context, from kanban_get_board, or from kanban_get_card_comments — a file attached to a comment downloads exactly like one attached to the card.',\n route: 'kanban.downloadAttachment',\n method: 'POST',\n params: [\n { name: 'attachmentId', description: 'The attachment ID, as listed on the card', required: true },\n { name: 'boardId', description: 'The board the attachment comes from. Pass it whenever you know it: on a machine linked to several cloud accounts, it is what says which one holds the file.', required: false },\n { name: 'organizationId', description: 'Which organization the attachment belongs to. Optional: needed only when neither the board id is known nor the machine has a single account.', required: false },\n ],\n buildInput: (p) => ({\n attachmentId: p.attachmentId,\n ...(p.boardId ? { boardId: p.boardId } : {}),\n ...(p.organizationId ? { orgId: p.organizationId } : {}),\n }),\n },\n {\n name: 'kanban_move_card',\n description: 'Move a kanban card to another column. Use the exact column name.',\n route: 'kanban.moveCard',\n method: 'POST',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'cardId', description: 'The card ID to move', required: true },\n { name: 'targetColumn', description: 'Exact name of the target column', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId, cardId: p.cardId, targetColumn: p.targetColumn }),\n },\n {\n name: 'kanban_add_comment',\n description: 'Add a comment to a kanban card.',\n route: 'kanban.addComment',\n method: 'POST',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'cardId', description: 'The card ID', required: true },\n { name: 'comment', description: 'The comment text (markdown supported)', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId, cardId: p.cardId, comment: p.comment }),\n },\n {\n name: 'kanban_get_card_conversations',\n description: 'Read the customer support conversations (Intercom…) linked to one kanban card: for each, its title, provider, state (open/resolved), link, the opening message and the thread of messages (author name, customer or team, internal note or not, date, text, attached files — fetch their bytes with kanban_download_attachment), plus the other cards following the same conversation. These messages are NOT comments of the card — read them here.',\n route: 'kanban.getCardConversations',\n method: 'GET',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'cardId', description: 'The card ID whose conversations to read', required: true },\n { name: 'limit', description: 'How many of the most recent messages to return per conversation (1-500). Default: 100.', required: false },\n ],\n buildInput: (p) => ({\n boardId: p.boardId,\n cardId: p.cardId,\n ...(p.limit ? { limit: Number(p.limit) } : {}),\n }),\n usageHint: '\"regarde la conversation Intercom de la carte\" / \"qu\\'a dit le client\" → kanban_get_card_conversations(boardId, cardId).',\n },\n {\n name: 'kanban_search_conversations',\n description: \"Search customer support conversations (Intercom…) at the providers connected to the board's organization, by words of the conversation title, or by conversation number or URL. Read-only at the provider. Each result gives connectionId and externalId (needed to link it), title, state, a preview and the cards already following it.\",\n route: 'kanban.searchConversations',\n method: 'GET',\n params: [\n { name: 'boardId', description: 'Any kanban board ID of the organization to search in', required: true },\n { name: 'query', description: 'Words of the conversation title, a conversation number, or a conversation URL', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId, query: p.query }),\n },\n {\n name: 'kanban_link_conversation',\n description: 'Link a customer support conversation found with kanban_search_conversations to a kanban card. Its whole thread is imported and new messages keep arriving on the card. A conversation can be linked to several cards. Nothing is written at the provider.',\n route: 'kanban.linkConversation',\n method: 'POST',\n params: [\n { name: 'boardId', description: 'The kanban board ID of the card', required: true },\n { name: 'cardId', description: 'The card to link the conversation to', required: true },\n { name: 'connectionId', description: 'The connectionId of the search result', required: true },\n { name: 'externalId', description: 'The externalId of the search result', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId, cardId: p.cardId, connectionId: p.connectionId, externalId: p.externalId }),\n },\n {\n name: 'kanban_get_card_links',\n description: 'Read the filiation of a board: which card depends on which. Returns one entry per link (child card ↔ parent card), plus the title, board, column, assignees and comment count of any linked card living on another board. Use it when a card context says it has a parent or sub-cards and you need their ids to read them.',\n route: 'kanban.getCardLinks',\n method: 'GET',\n params: [\n { name: 'boardId', description: 'The kanban board ID whose links to read', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId }),\n },\n {\n name: 'kanban_set_card_parent',\n description: 'Link a kanban card to a parent card, or detach it. The parent is the card the other one depends on — an epic and its tasks, a bug and its follow-ups. A card has at most one parent, and setting a new one replaces it. Omit parentCardId to detach. kanban_get_board reports the current filiation as parentCardId / childCardIds on each card.',\n route: 'kanban.setCardParent',\n method: 'POST',\n params: [\n { name: 'boardId', description: 'The kanban board ID of the card being linked', required: true },\n { name: 'cardId', description: 'The card that depends on the parent (the child)', required: true },\n { name: 'parentCardId', description: 'The parent card ID. Omit to detach the card from its parent.', required: false },\n { name: 'parentBoardId', description: \"The parent's board, when it lives on another board of the same organization. Defaults to boardId.\", required: false },\n ],\n buildInput: (p) => ({\n boardId: p.boardId,\n cardId: p.cardId,\n ...(p.parentCardId ? { parentCardId: p.parentCardId } : {}),\n ...(p.parentBoardId ? { parentBoardId: p.parentBoardId } : {}),\n }),\n },\n {\n name: 'kanban_place_card',\n description: 'Place an existing kanban card on another board of the same organization, without copying it — a reference. The card stays on its origin board; the target board gives it a column of its own. Editing, commenting, archiving or deleting the card from either board acts on the same card; moving it on the target board only moves the reference. Use it to show an issue from an issue list on a team kanban, for instance.',\n route: 'kanban.placeCard',\n method: 'POST',\n params: [\n { name: 'boardId', description: 'The board to place the card on (not its own board)', required: true },\n { name: 'cardId', description: 'The card to place', required: true },\n { name: 'column', description: 'The column on that board: its ID or its title', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId, cardId: p.cardId, column: p.column }),\n },\n {\n name: 'kanban_remove_card_placement',\n description: 'Remove a card from a board where it was placed as a reference. The card itself is untouched and stays on its origin board.',\n route: 'kanban.unplaceCard',\n method: 'POST',\n params: [\n { name: 'boardId', description: 'The board the reference is on', required: true },\n { name: 'cardId', description: 'The card to remove from that board', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId, cardId: p.cardId }),\n },\n {\n name: 'kanban_get_card_placements',\n description: \"List where a kanban card is: its origin board (home: true), then every board it is placed on as a reference, with the column on each. kanban_get_board flags a referenced card with an `origin` field naming its origin board.\",\n route: 'kanban.getCardPlacements',\n method: 'GET',\n params: [\n { name: 'boardId', description: 'Any board the card is on', required: true },\n { name: 'cardId', description: 'The card', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId, cardId: p.cardId }),\n },\n {\n name: 'kanban_add_card',\n description: 'Add a new card to a kanban column.',\n route: 'kanban.addCard',\n method: 'POST',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'column', description: 'Exact name of the target column', required: true },\n { name: 'title', description: 'Card title', required: true },\n { name: 'content', description: 'Card content in markdown', required: false },\n ],\n buildInput: (p) => ({ boardId: p.boardId, column: p.column, title: p.title, content: p.content }),\n },\n {\n name: 'kanban_get_card',\n description: 'Read one kanban card by id, including archived ones. Cheaper than fetching the whole board, and the only way to read a card that has been archived.',\n route: 'kanban.getCard',\n method: 'GET',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'cardId', description: 'The card ID', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId, cardId: p.cardId }),\n },\n {\n name: 'kanban_get_card_context',\n description: \"Load the working context of a kanban card: the card, the board's columns, the team's guidelines for the board and the expected ending (move the card if needed, then comment). Call it first when the user asks you to work on a card, then follow it. It is the context a session started from the card in Runeya receives.\",\n route: 'kanban.cardContext',\n method: 'GET',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'cardId', description: 'The card ID', required: true },\n { name: 'projectId', description: 'The project the work happens in, named in the context. Optional.', required: false },\n { name: 'orgId', description: 'Its organization. Optional.', required: false },\n ],\n buildInput: (p) => ({\n boardId: p.boardId,\n cardId: p.cardId,\n ...(p.projectId ? { projectId: p.projectId } : {}),\n ...(p.orgId ? { orgId: p.orgId } : {}),\n }),\n },\n {\n name: 'kanban_update_card',\n description: 'Update an existing kanban card. Only the fields you pass are changed; passing null to priority, color or deadline clears it. Prefer this over creating a second card when something needs correcting.',\n route: 'kanban.updateCard',\n method: 'POST',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'cardId', description: 'The card ID', required: true },\n { name: 'title', description: 'New title', required: false },\n { name: 'content', description: 'New card content, in markdown', required: false },\n { name: 'priority', description: 'Priority from 1 to 10, or null to clear it', required: false },\n { name: 'color', description: 'Card colour, or null to clear it', required: false },\n { name: 'groups', description: 'Labels, as a list of strings. Replaces the current ones.', required: false },\n { name: 'deadline', description: 'Due date as YYYY-MM-DD, or null to clear it', required: false },\n { name: 'assignees', description: 'User ids to assign, as a list. Replaces the current ones; use kanban_list_members to find the ids.', required: false },\n ],\n buildInput: (p) => ({\n boardId: p.boardId,\n cardId: p.cardId,\n ...(p.title !== undefined ? { title: p.title } : {}),\n ...(p.content !== undefined ? { content: p.content } : {}),\n // Tout arrive en chaîne : un modèle n'écrit pas des nombres, des listes\n // ni des `null` typés. `clearable` distingue « efface » de « ne touche\n // pas » — sans quoi vider une couleur serait impossible à exprimer, et\n // changer un titre risquerait de vider le reste.\n ...(clearable(p.priority, (v) => Number(v), 'priority')),\n ...(clearable(p.color, (v) => v, 'color')),\n ...(clearable(p.deadline, (v) => v, 'deadline')),\n ...(p.groups !== undefined ? { groups: toList(p.groups) } : {}),\n ...(p.assignees !== undefined ? { assignees: toList(p.assignees) } : {}),\n }),\n },\n {\n name: 'kanban_set_card_archived',\n description: 'Archive a kanban card (it leaves the board but is not deleted) or bring it back. An unarchived card returns to the column it left.',\n route: 'kanban.setCardArchived',\n method: 'POST',\n params: [\n { name: 'boardId', description: 'The kanban board ID', required: true },\n { name: 'cardId', description: 'The card ID', required: true },\n { name: 'archived', description: 'true to archive, false to bring the card back', required: true },\n ],\n buildInput: (p) => ({ boardId: p.boardId, cardId: p.cardId, archived: p.archived === 'true' }),\n },\n {\n name: 'kanban_list_members',\n description: 'List the people of the organization who can be assigned to a card, with their ids. Needed before assigning anyone with kanban_update_card.',\n route: 'kanban.listMembers',\n method: 'GET',\n params: [\n { name: 'organizationId', description: 'Which organization. Optional: needed only when the account belongs to several and the error message asks for it.', required: false },\n ],\n buildInput: (p) => (p.organizationId ? { organizationId: p.organizationId } : {}),\n },\n\n // ─── Lecture seule ───────────────────────────────────────────────────────\n //\n // Tout ce qui se consulte sans rien changer. Les écritures s'ajoutent au cas\n // par cas : aujourd'hui les services et leurs variables, plus bas.\n //\n // Volontairement absentes, et à ne pas ajouter sans y regarder à deux fois,\n // parce qu'elles rendent un secret : `environment.list` / `get` / `resolve` /\n // `resolveFlat` (un `Environment` porte ses variables, valeurs comprises),\n // `apiKeys.list` / `reveal`, `setup.getEncryptionKeyHex` et `getOrgKeys`\n // (clés de chiffrement), `settings.get` et `settings.listAIProviders` (clés\n // de fournisseurs d'IA — `settings.getPaths` et `getNetwork`, eux, ne\n // rendent que des chemins et une adresse, d'où leur présence ci-dessous),\n // `cloudAuth.session`, `agent.getPassthroughEnv`. Un agent n'a pas besoin de\n // ces valeurs pour travailler, et ce qu'il lit finit dans une transcription.\n //\n // La seule exception est `service.getEnv` (`get_service_env` ci-dessous),\n // et elle n'en est une que parce qu'elle filtre : les variables publiques, et\n // les seuls secrets que leur auteur a partagés avec les IA (`isSharedWithAi`\n // — « Lisible par l'IA », ou l'injection, qui vaut la lecture). Un secret non\n // partagé n'y apparaît pas, pas même par son nom.\n {\n name: 'list_processes',\n description: \"List every process across all agents with its current state (running, stopped, exit code, uptime). Use this to see the whole machine at once, rather than calling get_service_status service by service. An agent only learns about a service when it is first started, so this lists what is deployed, not what is configured: an empty list means nothing has been started, not that you cannot see them — list_services shows what exists.\",\n route: 'process.list',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'get_service',\n transformOutput: maskServices,\n description: 'Read the full configuration of one service: its commands, ports, groups, runner, log sources and restart policy. list_services gives the ids.',\n route: 'service.get',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'The service ID', required: true },\n ],\n buildInput: (p) => ({ id: p.serviceId }),\n },\n {\n name: 'get_service_env',\n description: \"Read the environment variables a service runs with, and the project's variable inventory. `env` lists every key the service receives; a value reads \\\"***\\\" when it is a secret whose author did not share it with AI (sharing = ticking \\\"AI read\\\", or injecting it into the agents\\u0027 environment, which grants reading too). `envSecrets` says which keys are secret, `hiddenKeys` which ones are masked. A masked key is set on the service: never treat it as missing, never suggest adding it, and never pass \\\"***\\\" as a value — ask the user for it. `variables` describes every variable of the project — which environment defines it and its scope, its description, its flags, whether this machine overrides it, and `inService: false` for the ones this service does not receive. Use it to say where a variable must be changed instead of guessing. On an overridden variable, `sharedValue` is what the machine-local override replaces (the team's value, masked as \\\"***\\\" when unreadable); no other value appears there. This is the resolver: the values are what the service would receive — inheritance, {{environment.KEY}} references, this machine's overrides and server built-ins applied; agent built-ins stay as written until the service starts. Use it to check a variable you just composed. `unresolvedReferences` lists references nothing will fill (a typo, a variable that does not exist): fix them.\",\n route: 'service.getEnv',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'The service ID', required: true },\n { name: 'environmentId', description: 'A global environment of the project to resolve in instead of the active one, without activating it (from list_environments). Omit for the active one.', required: false },\n ],\n buildInput: (p) => ({ id: p.serviceId, ...(p.environmentId ? { environmentId: p.environmentId } : {}) }),\n },\n // ─── Écrire un service et ses variables ────────────────────────────────────\n //\n // Les variables s'écrivent à l'aveugle (`environment.setVariableBlind`) : une\n // IA remplace la valeur d'un secret sans la lire, et ne peut ni le rendre\n // public, ni le partager avec les IA. La règle tient côté serveur, dans la\n // route ; ces outils ne passent jamais par une route qui renvoie des valeurs\n // (`upsertVariable`, `removeVariable`, `update` rendent l'environnement entier).\n {\n name: 'create_service',\n transformOutput: maskServices,\n description: \"Create a service, native or Docker, in a project: it joins the project and gets its environments in the same call. Pass the projectId your context names. Projects are synced between machines, so write paths relative to the project root and put machine-specific values (a device serial, a local token) in environment variables, referenced as $NAME in commands — see the cwd, commands and shortcuts parameters. Then set its variables with set_environment_variable.\",\n route: 'service.create',\n method: 'POST',\n params: [\n { name: 'name', description: 'The service name', required: true },\n { name: 'projectId', description: 'The project it joins: the one your context names, or another from list_projects. Without it, the service belongs to no project.', required: false },\n { name: 'orgId', description: 'Its organization. Needed only when the same project id exists in several.', required: false },\n ...CREATE_SERVICE_PARAMS,\n ],\n buildInput: (p) => {\n const fields = serviceFields(p, CREATE_SERVICE_PARAMS);\n if (fields['runner'] === 'docker' && !fields['dockerConfig']) {\n throw new Error('dockerConfig: required with runner \"docker\" — give an \"image\" or a \"dockerfile\"');\n }\n return {\n name: p.name,\n ...fields,\n ...(p.projectId ? { projectId: p.projectId } : {}),\n ...(p.orgId ? { orgId: p.orgId } : {}),\n };\n },\n },\n {\n name: 'add_service_to_project',\n description: \"Add an existing service to a project, and create its environments — one for each of the project's environments, where its own variables go. Not needed after create_service, which already does it; calling it again changes nothing.\",\n route: 'project.addService',\n method: 'POST',\n params: [\n { name: 'projectId', description: 'The project ID, from list_projects', required: true },\n { name: 'serviceId', description: 'The service ID', required: true },\n { name: 'orgId', description: 'Its organization. Needed only when the same project id exists in several.', required: false },\n ],\n buildInput: (p) => ({ projectId: p.projectId, serviceId: p.serviceId, ...(p.orgId ? { orgId: p.orgId } : {}) }),\n },\n {\n name: 'update_service',\n transformOutput: maskServices,\n description: 'Change any part of a service configuration — commands, ports, health check, restart policy, shortcuts, log sources, whether it runs natively or in Docker (runner, dockerConfig)… Only the fields you pass change; a list or an object you pass replaces the current one whole. Read the service first with get_service.',\n route: 'service.update',\n method: 'POST',\n params: [\n { name: 'serviceId', description: 'The service ID', required: true },\n { name: 'name', description: 'New name', required: false },\n { name: 'orgId', description: 'Move the service to this organization vault. Leave unset unless asked.', required: false, schema: z.string().max(128).nullable() },\n ...UPDATE_SERVICE_PARAMS,\n ],\n buildInput: (p) => ({\n id: p.serviceId,\n ...(p.name ? { name: p.name } : {}),\n ...(p.orgId !== undefined ? { orgId: parseTyped('orgId', z.string().max(128).nullable(), p.orgId) } : {}),\n ...serviceFields(p, UPDATE_SERVICE_PARAMS),\n }),\n },\n {\n name: 'list_environments',\n description: \"List the environments of a project, with no value: each one's id, name and scope (global = shared by the whole project, service = one service's own variables), which global environment is active, which service a service environment belongs to and which global environment activates it, its parents (it inherits their variables), `isolated` when a service environment does not inherit from its global one, and the variables it defines with their flags. Empty environments are listed too — a service you just created has one per global environment, where its own variables go. Use it to find the environmentId before set_environment_variable.\",\n route: 'environment.listForAi',\n method: 'GET',\n params: [\n { name: 'projectId', description: 'The project ID: the one your context names, or another from list_projects', required: true },\n { name: 'orgId', description: 'Its organization. Needed only when the same project id exists in several.', required: false },\n ],\n buildInput: (p) => ({ projectId: p.projectId, ...(p.orgId ? { orgId: p.orgId } : {}) }),\n },\n {\n name: 'resolve_environment',\n description: \"Resolve one environment alone — its variables with those inherited from its parents and this machine's overrides — as an AI may read it: secrets not shared with AI read \\\"***\\\". Built-in references ({{service.*}}, {{services.*}}, {{agent.*}}…) are NOT filled, since they depend on the service that receives the variable; use get_service_env for a service's final values. `unresolvedReferences` lists references nothing will fill: a misspelled {{environment.KEY}}, or a name that is no built-in.\",\n route: 'environment.resolveForAi',\n method: 'GET',\n params: [\n { name: 'environmentId', description: 'The environment, from list_environments', required: true },\n ],\n buildInput: (p) => ({ environmentId: p.environmentId }),\n },\n {\n name: 'set_environment_variable',\n description: `Create or change an environment variable, by name, in one environment — global or service, same rules for both. Find the environmentId with list_environments. Where it belongs: a value shared by several services (a database host, an API base URL) goes ONCE in the active global environment; services inherit it. A value only one service needs goes in that service's environment (scope service, activated by the active global one), where it also overrides a global variable of the same name. Never hardcode what Runeya already knows: a service's own port is {{service.PORT}}, its own URL {{service.URL}}, another service's address {{services.<slug>.URL}} — a copied \"3210\" or \"http://localhost:3211\" breaks as soon as a port changes or the project runs on another machine. If the port a variable needs is not declared on its service, declare it there (update_service, ports) instead of writing the number. When a written value contains a port or URL of a project service, the response lists \\`suggestions\\`: rewrite the value with those references. Compose instead of copying: a value can reference another variable of the resolved environment as {{environment.KEY}} (e.g. \"postgres://{{environment.DB_USER}}@{{environment.DB_HOST}}:5432\"). ${BUILTINS_HELP} After writing, check the result with get_service_env (a service, optionally in another global environment) or resolve_environment (an environment alone). References are substituted in one pass: a reference to a variable whose own value is only a reference may stay unexpanded, so point at the variable that holds the actual value. $NAME is not a reference here: it only expands inside a shell command. pre and post are concatenated around the value, each resolved separately. You can replace a secret's value without reading it, and create a variable as secret. You cannot make a secret public nor make it readable by AI: that stays the user's decision. Never pass \"***\" as a value. The response never contains the value.`,\n route: 'environment.setVariableBlind',\n method: 'POST',\n params: [\n { name: 'environmentId', description: 'The environment that holds the variable, from list_environments', required: true },\n { name: 'key', description: 'The variable name, e.g. DATABASE_URL', required: true },\n { name: 'value', description: 'The new value, possibly with {{environment.KEY}} references. Omit to leave it unchanged.', required: false },\n { name: 'pre', description: 'Text put before the value (e.g. \"https://\"). Omit to leave it unchanged.', required: false },\n { name: 'post', description: 'Text put after the value (e.g. \"/api\"). Omit to leave it unchanged.', required: false },\n { name: 'isSecret', description: '\"true\" to store it as a secret. On an existing public variable, makes it secret.', required: false },\n { name: 'description', description: 'What the variable is for, in markdown', required: false },\n ],\n buildInput: (p) => ({\n environmentId: p.environmentId,\n key: p.key,\n ...(p.value !== undefined ? { value: p.value } : {}),\n ...(p.pre !== undefined ? { pre: p.pre } : {}),\n ...(p.post !== undefined ? { post: p.post } : {}),\n ...(p.isSecret !== undefined ? { isSecret: toBool(p.isSecret) } : {}),\n ...(p.description !== undefined ? { description: p.description } : {}),\n }),\n },\n {\n name: 'set_environment_inheritance',\n description: \"Switch whether a service environment inherits the variables of the global environment that activates it (the default), or is isolated from it and receives only its own variables. list_environments shows this as `isolated`. Isolating a service is unusual: it loses every shared variable of the project. Do it only when the user asks, and never to work around a variable — override it in the service environment instead.\",\n route: 'environment.setInheritanceBlind',\n method: 'POST',\n params: [\n { name: 'environmentId', description: 'A service environment (scope service), from list_environments', required: true },\n { name: 'inherit', description: '\"true\" to inherit from the global environment, \"false\" to isolate', required: true, schema: z.boolean() },\n ],\n buildInput: (p) => ({ environmentId: p.environmentId, inherit: toBool(p.inherit ?? 'true') }),\n },\n {\n name: 'remove_environment_variable',\n description: 'Delete an environment variable, by name, from one environment. Its value is lost.',\n route: 'environment.removeVariableBlind',\n method: 'POST',\n params: [\n { name: 'environmentId', description: 'The environment that holds the variable', required: true },\n { name: 'key', description: 'The variable name', required: true },\n ],\n buildInput: (p) => ({ environmentId: p.environmentId, key: p.key }),\n destructive: true,\n },\n {\n name: 'get_service_metrics',\n description: 'Read the CPU and memory currently used by a running service.',\n route: 'process.metrics',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'The service ID', required: true },\n { name: 'agentId', description: 'The agent ID hosting this service', required: true },\n ],\n buildInput: (p) => ({ agentId: p.agentId, processId: p.serviceId }),\n },\n {\n name: 'list_agents',\n description: 'List the agents connected to this Runeya, with their status and whether they run on this machine. Passphrases are never returned.',\n route: 'agent.list',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'list_projects',\n description: 'List the projects known to this Runeya, with their ids and the services they hold.',\n route: 'project.list',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'get_project',\n description: 'Read one project: its services, its active environment, its organization.',\n route: 'project.get',\n method: 'GET',\n params: [\n { name: 'projectId', description: 'The project ID, from list_projects', required: true },\n { name: 'orgId', description: 'Its organization. Needed only when the same project id exists in several.', required: false },\n ],\n buildInput: (p) => ({ id: p.projectId, ...(p.orgId ? { orgId: p.orgId } : {}) }),\n },\n {\n name: 'list_project_paths',\n description: 'Where each project lives on this machine. Use it to find the directory to work in before reading or editing files.',\n route: 'project.localPaths',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'git_status',\n description: 'Read the git working tree of a service or a project: staged, modified and untracked files, current branch, ahead/behind counts.',\n route: 'git.status',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'Target the repository of this service', required: false },\n { name: 'projectId', description: 'Target the repository of this project, when no service is given', required: false },\n { name: 'agentId', description: 'The agent hosting the repository', required: false },\n { name: 'orgId', description: 'Its organization, when a project id alone is ambiguous', required: false },\n ],\n buildInput: (p) => gitTarget(p),\n },\n {\n name: 'git_log',\n description: 'Read the recent commits of a service or project repository: hash, author, date, message.',\n route: 'git.log',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'Target the repository of this service', required: false },\n { name: 'projectId', description: 'Target the repository of this project, when no service is given', required: false },\n { name: 'agentId', description: 'The agent hosting the repository', required: false },\n { name: 'orgId', description: 'Its organization, when a project id alone is ambiguous', required: false },\n { name: 'limit', description: 'How many commits to return (1-200). Default: 50.', required: false },\n ],\n buildInput: (p) => ({ ...gitTarget(p), ...(p.limit ? { limit: Number(p.limit) } : {}) }),\n },\n {\n name: 'git_branches',\n description: 'List the local and remote branches of a service or project repository.',\n route: 'git.branches',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'Target the repository of this service', required: false },\n { name: 'projectId', description: 'Target the repository of this project, when no service is given', required: false },\n { name: 'agentId', description: 'The agent hosting the repository', required: false },\n { name: 'orgId', description: 'Its organization, when a project id alone is ambiguous', required: false },\n ],\n buildInput: (p) => gitTarget(p),\n },\n {\n name: 'git_diff',\n description: 'Read the diff of a service or project repository — everything, or one file. Use it to see what changed before describing or reviewing it.',\n route: 'git.diff',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'Target the repository of this service', required: false },\n { name: 'projectId', description: 'Target the repository of this project, when no service is given', required: false },\n { name: 'agentId', description: 'The agent hosting the repository', required: false },\n { name: 'orgId', description: 'Its organization, when a project id alone is ambiguous', required: false },\n { name: 'path', description: 'Restrict the diff to this file path', required: false },\n { name: 'staged', description: 'Set to \"true\" to read the staged diff instead of the working tree', required: false },\n { name: 'untracked', description: 'Set to \"true\" to include untracked files', required: false },\n ],\n buildInput: (p) => ({\n ...gitTarget(p),\n ...(p.path ? { path: p.path } : {}),\n ...(p.staged !== undefined ? { staged: p.staged === 'true' } : {}),\n ...(p.untracked !== undefined ? { untracked: p.untracked === 'true' } : {}),\n }),\n },\n {\n name: 'list_docs',\n description: 'List the markdown documentation files of a scope, as a tree. Pair it with read_doc to answer from the project\\'s own docs rather than from guesswork.',\n route: 'wiki.list',\n method: 'GET',\n params: [\n { name: 'scope', description: '\"global\" for this Runeya, or \"service:<serviceId>\" for one service\\'s repository', required: true },\n ],\n buildInput: (p) => ({ scope: p.scope }),\n },\n {\n name: 'read_doc',\n description: 'Read one markdown documentation file. Paths come from list_docs; only .md and .markdown can be read.',\n route: 'wiki.read',\n method: 'GET',\n params: [\n { name: 'scope', description: '\"global\" for this Runeya, or \"service:<serviceId>\" for one service\\'s repository', required: true },\n { name: 'path', description: 'Relative path of the file, as returned by list_docs', required: true },\n ],\n buildInput: (p) => ({ scope: p.scope, path: p.path }),\n },\n {\n name: 'get_server_logs',\n description: \"Read Runeya's own recent log entries. Use it to explain why Runeya itself misbehaved — not to read a service's output, which is get_logs.\",\n route: 'diagnostics.recentLogs',\n method: 'GET',\n params: [\n { name: 'limit', description: 'How many entries to return (1-2000). Default: 500.', required: false },\n ],\n buildInput: (p) => (p.limit ? { limit: Number(p.limit) } : undefined),\n },\n {\n name: 'get_kanban_queue_state',\n description: 'Read the state of the kanban task queue: what is running, what is waiting. Use it before queuing work, or to explain why a card has not started.',\n route: 'kanbanQueue.getState',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'export_project',\n description: \"Read a project and every service it holds in one call, with secrets stripped out. Cheaper and safer than calling get_service for each service — prefer it whenever you need the whole picture of a project.\",\n route: 'project.export',\n method: 'GET',\n params: [\n { name: 'projectId', description: 'The project ID, from list_projects', required: true },\n { name: 'orgId', description: 'Its organization. Needed only when the same project id exists in several.', required: false },\n ],\n buildInput: (p) => ({ id: p.projectId, ...(p.orgId ? { orgId: p.orgId } : {}) }),\n },\n {\n name: 'git_remotes',\n description: 'List the git remotes of a service or project repository, with their URLs.',\n route: 'git.remotes',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'Target the repository of this service', required: false },\n { name: 'projectId', description: 'Target the repository of this project, when no service is given', required: false },\n { name: 'agentId', description: 'The agent hosting the repository', required: false },\n { name: 'orgId', description: 'Its organization, when a project id alone is ambiguous', required: false },\n ],\n buildInput: (p) => gitTarget(p),\n },\n {\n name: 'git_stash_list',\n description: 'List the stashes of a service or project repository. Useful before assuming work was lost: it may simply be stashed.',\n route: 'git.stashList',\n method: 'GET',\n params: [\n { name: 'serviceId', description: 'Target the repository of this service', required: false },\n { name: 'projectId', description: 'Target the repository of this project, when no service is given', required: false },\n { name: 'agentId', description: 'The agent hosting the repository', required: false },\n { name: 'orgId', description: 'Its organization, when a project id alone is ambiguous', required: false },\n ],\n buildInput: (p) => gitTarget(p),\n },\n {\n name: 'get_runeya_version',\n description: 'Read the version of Runeya running here, the latest published one, and whether this install is up to date. Use it before blaming a bug on the code: the machine may simply be behind.',\n route: 'health.versionInfo',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'get_runeya_paths',\n description: \"Read where Runeya keeps its things on this machine: its launch directory, its data directory, and the machine-wide directory holding cloud projects.\",\n route: 'settings.getPaths',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'get_network_info',\n description: 'Read where this Runeya listens (host and port) and whether it is reachable from the local network, with the URLs to use. Use it to give someone a working link instead of guessing one.',\n route: 'settings.getNetwork',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'list_runeya_instances',\n description: 'List every Runeya answering on this machine, this one included, with its port and directory. Use it when a port is taken or when two instances seem to disagree.',\n route: 'diagnostics.instances',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n {\n name: 'get_cloud_status',\n description: 'Say whether this Runeya is linked to a cloud account, and to which cloud. A kanban tool failing for lack of a cloud link is explained here.',\n route: 'cloudAuth.status',\n method: 'GET',\n params: [],\n buildInput: () => undefined,\n },\n ...KNOWLEDGE_CAPABILITIES,\n];\n","import { z } from 'zod';\nimport type { CapabilityParam } from '../capabilities.js';\n\n/** La propriété JSON Schema d'un paramètre : son schéma réel s'il en a un, une chaîne sinon. */\nexport function paramJsonSchema(param: CapabilityParam): Record<string, unknown> {\n if (!param.schema) return { type: 'string', description: param.description };\n const { $schema: _ignored, ...schema } = z.toJSONSchema(param.schema, { io: 'input', unrepresentable: 'any' }) as Record<string, unknown>;\n return { ...schema, description: param.description };\n}\n","import type { RuneyaCapability } from '../capabilities.js';\nimport { paramJsonSchema } from './json-schema.js';\n\nexport interface AnthropicTool {\n name: string;\n description: string;\n input_schema: {\n type: 'object';\n properties: Record<string, Record<string, unknown>>;\n required: string[];\n [k: string]: unknown;\n };\n}\n\nexport function buildAnthropicTools(capabilities: RuneyaCapability[]): AnthropicTool[] {\n return capabilities.map(cap => ({\n name: cap.name,\n description: cap.description,\n input_schema: {\n type: 'object' as const,\n properties: Object.fromEntries(\n cap.params.map(p => [p.name, paramJsonSchema(p)]),\n ),\n required: cap.params.filter(p => p.required).map(p => p.name),\n },\n }));\n}\n","import type { RuneyaCapability } from '../capabilities.js';\nimport { paramJsonSchema } from './json-schema.js';\n\nexport interface OpenAITool {\n type: 'function';\n function: {\n name: string;\n description: string;\n parameters: {\n type: 'object';\n properties: Record<string, Record<string, unknown>>;\n required: string[];\n };\n };\n}\n\nexport function buildOpenAITools(capabilities: RuneyaCapability[]): OpenAITool[] {\n return capabilities.map(cap => ({\n type: 'function' as const,\n function: {\n name: cap.name,\n description: cap.description,\n parameters: {\n type: 'object' as const,\n properties: Object.fromEntries(\n cap.params.map(p => [p.name, paramJsonSchema(p)]),\n ),\n required: cap.params.filter(p => p.required).map(p => p.name),\n },\n },\n }));\n}\n","import type { RuneyaCapability } from '../capabilities.js';\nexport type { RuneyaCapability };\n\n/**\n * Build the tool safety instruction block injected into cloud provider system prompts.\n * Generated from capabilities so it stays in sync automatically.\n */\nexport function buildToolSafetyInstruction(capabilities: RuneyaCapability[]): string {\n const destructive = capabilities.filter(c => c.destructive).map(c => c.name);\n const withHints = capabilities.filter(c => c.usageHint);\n\n const lines = ['## Tool use safety rules'];\n\n if (destructive.length > 0) {\n lines.push(`CRITICAL: Never call ${destructive.join(', ')} unless the user has EXPLICITLY and UNAMBIGUOUSLY requested it.`);\n lines.push(`- Only call destructive tools (${destructive.join(', ')}) when the user explicitly uses action words for a specific service.`);\n }\n\n if (withHints.length > 0) {\n lines.push('');\n lines.push('## Tool usage hints');\n for (const cap of withHints) {\n lines.push(`- ${cap.usageHint}`);\n }\n }\n\n return lines.join('\\n');\n}\n","import { z } from 'zod';\nimport type { RuneyaCapability } from '../capabilities.js';\n\n/**\n * Le schéma d'entrée d'un outil MCP : le schéma réel de chaque paramètre typé,\n * une chaîne pour les autres. Le client MCP le transmet au modèle tel quel,\n * types, énumérations et valeurs par défaut compris.\n */\nexport function buildMcpShape(cap: RuneyaCapability): Record<string, z.ZodType> {\n const shape: Record<string, z.ZodType> = {};\n for (const param of cap.params) {\n const base = (param.schema ?? z.string()).describe(param.description);\n shape[param.name] = param.required ? base : base.optional();\n }\n // authToken is MCP-specific: CLI runners pass the JWT here\n shape['authToken'] = z.string().describe('Bearer token for authentication').optional();\n return shape;\n}\n\n/**\n * Ce qu'un modèle envoie, ramené aux chaînes que `buildInput` lit : un objet ou\n * une liste en JSON, un nombre ou un booléen en texte. Les paramètres typés\n * sont relus contre leur schéma dans `buildInput` ; passer la capacité garde le\n * `null` qui les efface.\n */\nexport function toRawParams(input: Record<string, unknown>, cap?: RuneyaCapability): Record<string, string | undefined> {\n // `null` sur un paramètre typé efface le champ ; sur un texte, il vaut absence.\n const typed = new Set(cap?.params.filter((p) => p.schema).map((p) => p.name));\n return Object.fromEntries(Object.entries(input).map(([k, v]) => [\n k,\n v === null && typed.has(k) ? 'null'\n : v == null ? undefined\n : typeof v === 'object' ? JSON.stringify(v) : String(v as string | number | boolean | bigint),\n ]));\n}\n","import type { RuneyaCapability } from './capabilities.js';\n\n/** Le projet et l'organisation de la conversation qui a lancé le serveur MCP. */\nexport interface ProjectAnchor {\n projectId?: string;\n orgId?: string;\n}\n\n/**\n * Ancrer un appel sur le projet ou l'organisation de la conversation.\n *\n * `service.list` rend tout le poste : chaque coffre, donc chaque projet de\n * chaque organisation de la machine. L'interface n'en montre qu'un, et le\n * prompt de l'agent ne décrit que celui-là — mais la tool, elle, répondait 88\n * services quand l'écran en montrait trois. L'agent citait alors des services\n * que l'utilisateur n'a jamais vus, et concluait à un problème de permissions.\n *\n * Le projet est donc posé par Runeya au lancement du serveur MCP, et complété\n * ici plutôt que laissé à la bonne lecture d'une consigne.\n *\n * Ne complète QUE ce que la capability déclare et que l'appelant a laissé vide :\n * un `projectId` donné explicitement gagne toujours, ce qui laisse l'agent\n * interroger un autre projet — `list_projects` les nomme tous.\n */\nexport function applyProjectAnchor(\n cap: Pick<RuneyaCapability, 'params'>,\n params: Record<string, string | undefined>,\n anchor: ProjectAnchor,\n): Record<string, string | undefined> {\n const accepts = (name: string) => cap.params.some((p) => p.name === name);\n const anchored: Record<string, string | undefined> = { ...params };\n const mayAnchorOrg = !params['projectId'] || params['projectId'] === anchor.projectId;\n\n if (anchor.projectId && accepts('projectId') && !anchored['projectId']) {\n anchored['projectId'] = anchor.projectId;\n }\n\n // Les capabilities n'emploient pas toutes le même nom pour l'organisation :\n // les routes de projet utilisent `orgId`, les outils Kanban `organizationId`.\n // N'ajouter que le champ accepté par la capability évite un paramètre rejeté.\n if (mayAnchorOrg && anchor.orgId && !anchored['orgId'] && accepts('orgId')) {\n anchored['orgId'] = anchor.orgId;\n }\n if (mayAnchorOrg && anchor.orgId && !anchored['organizationId'] && accepts('organizationId')) {\n anchored['organizationId'] = anchor.orgId;\n }\n\n return anchored;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYO,SAAS,aAAa,OAAyB;AACpD,MAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO;AAChD,QAAM,EAAE,MAAM,GAAG,KAAK,IAAI;AAC1B,MAAI,CAAC,QAAQ,OAAO,SAAS,SAAU,QAAO;AAC9C,QAAM,EAAE,OAAO,QAAQ,GAAG,UAAU,IAAI;AACxC,SAAO,EAAE,GAAG,MAAM,MAAM,UAAU;AACpC;AAEA,eAAsB,SACpB,SACA,OACA,QACA,OACA,WACA,YAA0B,OACR;AAClB,QAAM,UAAkC;AAAA,IACtC,gBAAgB;AAAA,IAChB,iBAAiB,UAAU,SAAS;AAAA,EACtC;A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