copilot-operator 0.1.9 → 0.1.11

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 (57) hide show
  1. package/dist/src/api/operator.controller.js +11 -0
  2. package/dist/src/api/operator.service.js +32 -13
  3. package/dist/src/config/schema.js +6 -0
  4. package/dist/src/orchestrator/contract.js +58 -0
  5. package/dist/src/orchestrator/taskRunner.js +104 -6
  6. package/dist/src/plan/schema.js +21 -1
  7. package/dist/src/plan/systemGuide.js +48 -0
  8. package/dist/src/protocol/parser.js +98 -5
  9. package/dist/src/session/compose.js +1 -1
  10. package/dist/src/session/exports.js +1 -0
  11. package/dist/src/session/handoff.js +1 -1
  12. package/dist/src/session/store.js +44 -10
  13. package/dist/src/transport/copilotTransport.js +145 -65
  14. package/dist/src/vcs/scope.js +10 -7
  15. package/dist/src/vcs/syncCommand.js +105 -0
  16. package/dist/web/404.html +2 -2
  17. package/dist/web/_next/static/chunks/295-04151ded0741d18d.js +1 -0
  18. package/dist/web/_next/static/chunks/36-17a3bcb0c2553c7c.js +1 -0
  19. package/dist/web/_next/static/chunks/549-8f69ef8086802748.js +1 -0
  20. package/dist/web/_next/static/chunks/867-f82c74b7b2ed5c54.js +1 -0
  21. package/dist/web/_next/static/chunks/app/defaults/page-abfa73fb08822e36.js +1 -0
  22. package/dist/web/_next/static/chunks/app/history/page-a9f2060f86a4a10e.js +1 -0
  23. package/dist/web/_next/static/chunks/app/import/page-999d6cd958989723.js +1 -0
  24. package/dist/web/_next/static/chunks/app/level1/{page-be366b35f4cc97ce.js → page-dd3ebf37d29dce4f.js} +1 -1
  25. package/dist/web/_next/static/chunks/app/page-2ac6b67f4ddcb808.js +1 -0
  26. package/dist/web/_next/static/chunks/app/presets/{page-cabc3876a8111edd.js → page-93ab518db67e52a2.js} +1 -1
  27. package/dist/web/_next/static/chunks/app/sessions/view/page-d7e1f83d13c6356b.js +1 -0
  28. package/dist/web/_next/static/css/{20c6b36996df5e4c.css → 2ad2a74b7e07dcc9.css} +1 -1
  29. package/dist/web/appearance.html +2 -2
  30. package/dist/web/appearance.txt +12 -12
  31. package/dist/web/defaults.html +2 -2
  32. package/dist/web/defaults.txt +12 -12
  33. package/dist/web/history.html +2 -2
  34. package/dist/web/history.txt +12 -12
  35. package/dist/web/import.html +2 -2
  36. package/dist/web/import.txt +12 -12
  37. package/dist/web/index.html +2 -2
  38. package/dist/web/index.txt +12 -12
  39. package/dist/web/level1.html +2 -2
  40. package/dist/web/level1.txt +12 -12
  41. package/dist/web/presets.html +3 -3
  42. package/dist/web/presets.txt +12 -12
  43. package/dist/web/sessions/view.html +2 -2
  44. package/dist/web/sessions/view.txt +12 -12
  45. package/dist/web/system.html +2 -2
  46. package/dist/web/system.txt +12 -12
  47. package/package.json +6 -2
  48. package/dist/web/_next/static/chunks/373-56833488fcb5aa29.js +0 -1
  49. package/dist/web/_next/static/chunks/549-43d1a5681752fbd4.js +0 -1
  50. package/dist/web/_next/static/chunks/867-76cc83e4e54812dc.js +0 -1
  51. package/dist/web/_next/static/chunks/app/defaults/page-78be7820772f8882.js +0 -1
  52. package/dist/web/_next/static/chunks/app/history/page-90bc1c718d76b6b2.js +0 -1
  53. package/dist/web/_next/static/chunks/app/import/page-1060c7cb8e8d66eb.js +0 -1
  54. package/dist/web/_next/static/chunks/app/page-9e2736286f16422d.js +0 -1
  55. package/dist/web/_next/static/chunks/app/sessions/view/page-0e2b6829643e9b04.js +0 -1
  56. /package/dist/web/_next/static/{auD7lTmj-JDMJIQ4TVivR → oyfXbuB_cq0sRZP7ukHlQ}/_buildManifest.js +0 -0
  57. /package/dist/web/_next/static/{auD7lTmj-JDMJIQ4TVivR → oyfXbuB_cq0sRZP7ukHlQ}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html><!--auD7lTmj_JDMJIQ4TVivR--><html lang="en" data-theme="light" data-textsize="normal" data-contrast="normal" data-motion="normal" data-links="plain" data-focus="normal"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/20c6b36996df5e4c.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js"/><script src="/_next/static/chunks/c7879cf7-b5ab1053c1d9a2e7.js" async=""></script><script src="/_next/static/chunks/131-bae98f790a541679.js" async=""></script><script src="/_next/static/chunks/main-app-e3a5f713ba31557e.js" async=""></script><script src="/_next/static/chunks/197-f7c33a0114fc3db3.js" async=""></script><script src="/_next/static/chunks/867-76cc83e4e54812dc.js" async=""></script><script src="/_next/static/chunks/549-43d1a5681752fbd4.js" async=""></script><script src="/_next/static/chunks/app/layout-560bd6d173302e5a.js" async=""></script><script src="/_next/static/chunks/app/system/page-3aa2a0fef5454e69.js" async=""></script><title>copilot-operator</title><meta name="description" content="Runs task loops with Microsoft 365 Copilot on this machine."/><script>
1
+ <!DOCTYPE html><!--oyfXbuB_cq0sRZP7ukHlQ--><html lang="en" data-theme="light" data-textsize="normal" data-contrast="normal" data-motion="normal" data-links="plain" data-focus="normal"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/2ad2a74b7e07dcc9.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js"/><script src="/_next/static/chunks/c7879cf7-b5ab1053c1d9a2e7.js" async=""></script><script src="/_next/static/chunks/131-bae98f790a541679.js" async=""></script><script src="/_next/static/chunks/main-app-e3a5f713ba31557e.js" async=""></script><script src="/_next/static/chunks/197-f7c33a0114fc3db3.js" async=""></script><script src="/_next/static/chunks/867-f82c74b7b2ed5c54.js" async=""></script><script src="/_next/static/chunks/549-8f69ef8086802748.js" async=""></script><script src="/_next/static/chunks/app/layout-560bd6d173302e5a.js" async=""></script><script src="/_next/static/chunks/app/system/page-3aa2a0fef5454e69.js" async=""></script><title>copilot-operator</title><meta name="description" content="Runs task loops with Microsoft 365 Copilot on this machine."/><script>
2
2
  (function () {
3
3
  try {
4
4
  var d = document.documentElement;
@@ -13,4 +13,4 @@
13
13
  d.dataset.focus = a.strongFocus ? 'strong' : 'normal';
14
14
  } catch (e) {}
15
15
  })();
16
- </script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><a class="skip-link" href="#main">Skip to the content</a><div class="wrap"><header class="top"><h1><a href="/">copilot-operator</a></h1><nav aria-label="Main"><a href="/"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v4H4zM4 11h16v4H4zM4 17h10v2H4z"></path></svg><span>Sessions</span></a><a href="/defaults"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm8.5 4 1.5 1-1.6 2.8-1.8-.4a7 7 0 0 1-1.5 1.5l.4 1.8L14.7 21l-1-1.5a7 7 0 0 1-3.4 0l-1 1.5-2.8-1.6.4-1.8A7 7 0 0 1 5.4 16l-1.8.4L2 13.6 3.5 12.6V11.4L2 10.4l1.6-2.8 1.8.4A7 7 0 0 1 6.9 6.5l-.4-1.8L9.3 3l1 1.5a7 7 0 0 1 3.4 0l1-1.5 2.8 1.6-.4 1.8a7 7 0 0 1 1.5 1.5l1.8-.4L22 10.4l-1.5 1z"></path></svg><span>Settings</span></a><a href="/import"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3v10m0 0 4-4m-4 4-4-4M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Plan from JSON</span></a><a href="/history"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 1 0 8.5 6M12 7v5l3 2M3 4v5h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Task register</span></a><a href="/level1"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M6 3h9l5 5v13H6zM14 3v6h6M9 13h7M9 17h7" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 1 prompt</span></a><a href="/presets"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M5 4h14v4H5zM5 10h14v4H5zM5 16h9v4H5z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 2 presets</span></a><a href="/appearance"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 0 0 0 18c1.5 0 2-1 2-2s-1-1.5-1-2.5S14 15 15.5 15H17a4 4 0 0 0 4-4 8 8 0 0 0-9-8zM8 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"></path></svg><span>Appearance</span></a><a aria-current="page" href="/system"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v10H4zM2 19h20M9 15v4M15 15v4" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>System</span></a><select aria-label="Language" style="width:auto"><option value="en" selected="">English</option><option value="bg">Български</option></select></nav></header><main id="main"><div class="panel"><h2>This machine</h2><div class="muted">Loading…</div></div><div class="panel"><h2>Settings</h2><p class="muted small">Read from data/settings.json next to the project. It has the same shape as run.example.yaml; anything missing takes the default. Edit the file and restart the API.</p></div><div class="panel"><h2>Sign-in</h2><p class="muted small">Signing in is done once, from the terminal, so that the bot never handles credentials:</p><pre>npx tsx src/cli.ts login --account you@yourtenant.org</pre></div><!--$--><!--/$--></main></div><script src="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[1205,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-76cc83e4e54812dc.js\",\"549\",\"static/chunks/549-43d1a5681752fbd4.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"themeScript\"]\n3:I[1205,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-76cc83e4e54812dc.js\",\"549\",\"static/chunks/549-43d1a5681752fbd4.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"AppearanceProvider\"]\n4:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-76cc83e4e54812dc.js\",\"549\",\"static/chunks/549-43d1a5681752fbd4.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"LanguageProvider\"]\n5:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-76cc83e4e54812dc.js\",\"549\",\"static/chunks/549-43d1a5681752fbd4.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"DialogHost\"]\n6:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-76cc83e4e54812dc.js\",\"549\",\"static/chunks/549-43d1a5681752fbd4.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"SkipLink\"]\n7:I[8197,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-76cc83e4e54812dc.js\",\"549\",\"static/chunks/549-43d1a5681752fbd4.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"\"]\n8:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-76cc83e4e54812dc.js\",\"549\",\"static/chunks/549-43d1a5681752fbd4.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"Nav\"]\n9:I[6657,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-76cc83e4e54812dc.js\",\"549\",\"static/chunks/549-43d1a5681752fbd4.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"GlobalApprovals\"]\na:I[5204,[],\"\"]\nb:I[2642,[],\"\"]\nc:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-76cc83e4e54812dc.js\",\"549\",\"static/chunks/549-43d1a5681752fbd4.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"ScrollJump\"]\nd:I[7089,[],\"ClientPageRoot\"]\ne:I[3134,[\"867\",\"stat"])</script><script>self.__next_f.push([1,"ic/chunks/867-76cc83e4e54812dc.js\",\"549\",\"static/chunks/549-43d1a5681752fbd4.js\",\"186\",\"static/chunks/app/system/page-3aa2a0fef5454e69.js\"],\"default\"]\n11:I[433,[],\"OutletBoundary\"]\n13:I[9884,[],\"AsyncMetadataOutlet\"]\n15:I[433,[],\"ViewportBoundary\"]\n17:I[433,[],\"MetadataBoundary\"]\n18:\"$Sreact.suspense\"\n1a:I[3536,[],\"\"]\n:HL[\"/_next/static/css/20c6b36996df5e4c.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"auD7lTmj-JDMJIQ4TVivR\",\"p\":\"\",\"c\":[\"\",\"system\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"system\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/20c6b36996df5e4c.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"data-theme\":\"light\",\"data-textsize\":\"normal\",\"data-contrast\":\"normal\",\"data-motion\":\"normal\",\"data-links\":\"plain\",\"data-focus\":\"normal\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"$2\"}}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$L5\",null,{\"children\":[[\"$\",\"$L6\",null,{}],[\"$\",\"div\",null,{\"className\":\"wrap\",\"children\":[[\"$\",\"header\",null,{\"className\":\"top\",\"children\":[[\"$\",\"h1\",null,{\"children\":[\"$\",\"$L7\",null,{\"href\":\"/\",\"children\":\"copilot-operator\"}]}],[\"$\",\"$L8\",null,{}]]}],[\"$\",\"$L9\",null,{}],[\"$\",\"main\",null,{\"id\":\"main\",\"children\":[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}],[\"$\",\"$Lc\",null,{}]]}]}]}]}]]}]]}],{\"children\":[\"system\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$Ld\",null,{\"Component\":\"$e\",\"searchParams\":{},\"params\":{},\"promises\":[\"$@f\",\"$@10\"]}],null,[\"$\",\"$L11\",null,{\"children\":[\"$L12\",[\"$\",\"$L13\",null,{\"promise\":\"$@14\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[[\"$\",\"$L15\",null,{\"children\":\"$L16\"}],null],[\"$\",\"$L17\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$18\",null,{\"fallback\":null,\"children\":\"$L19\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$1a\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"f:{}\n10:\"$0:f:0:1:2:children:2:children:1:props:children:0:props:params\"\n"])</script><script>self.__next_f.push([1,"16:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n12:null\n"])</script><script>self.__next_f.push([1,"14:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"copilot-operator\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Runs task loops with Microsoft 365 Copilot on this machine.\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"19:\"$14:metadata\"\n"])</script></body></html>
16
+ </script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><a class="skip-link" href="#main">Skip to the content</a><div class="wrap"><header class="top"><h1><a href="/">copilot-operator</a></h1><nav aria-label="Main"><a href="/"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v4H4zM4 11h16v4H4zM4 17h10v2H4z"></path></svg><span>Sessions</span></a><a href="/defaults"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm8.5 4 1.5 1-1.6 2.8-1.8-.4a7 7 0 0 1-1.5 1.5l.4 1.8L14.7 21l-1-1.5a7 7 0 0 1-3.4 0l-1 1.5-2.8-1.6.4-1.8A7 7 0 0 1 5.4 16l-1.8.4L2 13.6 3.5 12.6V11.4L2 10.4l1.6-2.8 1.8.4A7 7 0 0 1 6.9 6.5l-.4-1.8L9.3 3l1 1.5a7 7 0 0 1 3.4 0l1-1.5 2.8 1.6-.4 1.8a7 7 0 0 1 1.5 1.5l1.8-.4L22 10.4l-1.5 1z"></path></svg><span>Settings</span></a><a href="/import"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3v10m0 0 4-4m-4 4-4-4M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Plan from JSON</span></a><a href="/history"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 1 0 8.5 6M12 7v5l3 2M3 4v5h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Task register</span></a><a href="/level1"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M6 3h9l5 5v13H6zM14 3v6h6M9 13h7M9 17h7" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 1 prompt</span></a><a href="/presets"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M5 4h14v4H5zM5 10h14v4H5zM5 16h9v4H5z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 2 presets</span></a><a href="/appearance"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 0 0 0 18c1.5 0 2-1 2-2s-1-1.5-1-2.5S14 15 15.5 15H17a4 4 0 0 0 4-4 8 8 0 0 0-9-8zM8 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"></path></svg><span>Appearance</span></a><a aria-current="page" href="/system"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v10H4zM2 19h20M9 15v4M15 15v4" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>System</span></a><select aria-label="Language" style="width:auto"><option value="en" selected="">English</option><option value="bg">Български</option></select></nav></header><main id="main"><div class="panel"><h2>This machine</h2><div class="muted">Loading…</div></div><div class="panel"><h2>Settings</h2><p class="muted small">Read from data/settings.json next to the project. It has the same shape as run.example.yaml; anything missing takes the default. Edit the file and restart the API.</p></div><div class="panel"><h2>Sign-in</h2><p class="muted small">Signing in is done once, from the terminal, so that the bot never handles credentials:</p><pre>npx tsx src/cli.ts login --account you@yourtenant.org</pre></div><!--$--><!--/$--></main></div><script src="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[1205,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-f82c74b7b2ed5c54.js\",\"549\",\"static/chunks/549-8f69ef8086802748.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"themeScript\"]\n3:I[1205,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-f82c74b7b2ed5c54.js\",\"549\",\"static/chunks/549-8f69ef8086802748.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"AppearanceProvider\"]\n4:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-f82c74b7b2ed5c54.js\",\"549\",\"static/chunks/549-8f69ef8086802748.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"LanguageProvider\"]\n5:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-f82c74b7b2ed5c54.js\",\"549\",\"static/chunks/549-8f69ef8086802748.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"DialogHost\"]\n6:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-f82c74b7b2ed5c54.js\",\"549\",\"static/chunks/549-8f69ef8086802748.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"SkipLink\"]\n7:I[8197,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-f82c74b7b2ed5c54.js\",\"549\",\"static/chunks/549-8f69ef8086802748.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"\"]\n8:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-f82c74b7b2ed5c54.js\",\"549\",\"static/chunks/549-8f69ef8086802748.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"Nav\"]\n9:I[6657,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-f82c74b7b2ed5c54.js\",\"549\",\"static/chunks/549-8f69ef8086802748.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"GlobalApprovals\"]\na:I[5204,[],\"\"]\nb:I[2642,[],\"\"]\nc:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-f82c74b7b2ed5c54.js\",\"549\",\"static/chunks/549-8f69ef8086802748.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"ScrollJump\"]\nd:I[7089,[],\"ClientPageRoot\"]\ne:I[3134,[\"867\",\"stat"])</script><script>self.__next_f.push([1,"ic/chunks/867-f82c74b7b2ed5c54.js\",\"549\",\"static/chunks/549-8f69ef8086802748.js\",\"186\",\"static/chunks/app/system/page-3aa2a0fef5454e69.js\"],\"default\"]\n11:I[433,[],\"OutletBoundary\"]\n13:I[9884,[],\"AsyncMetadataOutlet\"]\n15:I[433,[],\"ViewportBoundary\"]\n17:I[433,[],\"MetadataBoundary\"]\n18:\"$Sreact.suspense\"\n1a:I[3536,[],\"\"]\n:HL[\"/_next/static/css/2ad2a74b7e07dcc9.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"oyfXbuB_cq0sRZP7ukHlQ\",\"p\":\"\",\"c\":[\"\",\"system\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"system\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/2ad2a74b7e07dcc9.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"data-theme\":\"light\",\"data-textsize\":\"normal\",\"data-contrast\":\"normal\",\"data-motion\":\"normal\",\"data-links\":\"plain\",\"data-focus\":\"normal\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"$2\"}}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$L5\",null,{\"children\":[[\"$\",\"$L6\",null,{}],[\"$\",\"div\",null,{\"className\":\"wrap\",\"children\":[[\"$\",\"header\",null,{\"className\":\"top\",\"children\":[[\"$\",\"h1\",null,{\"children\":[\"$\",\"$L7\",null,{\"href\":\"/\",\"children\":\"copilot-operator\"}]}],[\"$\",\"$L8\",null,{}]]}],[\"$\",\"$L9\",null,{}],[\"$\",\"main\",null,{\"id\":\"main\",\"children\":[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}],[\"$\",\"$Lc\",null,{}]]}]}]}]}]]}]]}],{\"children\":[\"system\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$Ld\",null,{\"Component\":\"$e\",\"searchParams\":{},\"params\":{},\"promises\":[\"$@f\",\"$@10\"]}],null,[\"$\",\"$L11\",null,{\"children\":[\"$L12\",[\"$\",\"$L13\",null,{\"promise\":\"$@14\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[[\"$\",\"$L15\",null,{\"children\":\"$L16\"}],null],[\"$\",\"$L17\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$18\",null,{\"fallback\":null,\"children\":\"$L19\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$1a\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"f:{}\n10:\"$0:f:0:1:2:children:2:children:1:props:children:0:props:params\"\n"])</script><script>self.__next_f.push([1,"16:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n12:null\n"])</script><script>self.__next_f.push([1,"14:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"copilot-operator\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Runs task loops with Microsoft 365 Copilot on this machine.\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"19:\"$14:metadata\"\n"])</script></body></html>
@@ -1,25 +1,25 @@
1
1
  1:"$Sreact.fragment"
2
- 2:I[1205,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-76cc83e4e54812dc.js","549","static/chunks/549-43d1a5681752fbd4.js","177","static/chunks/app/layout-560bd6d173302e5a.js"],"themeScript"]
3
- 3:I[1205,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-76cc83e4e54812dc.js","549","static/chunks/549-43d1a5681752fbd4.js","177","static/chunks/app/layout-560bd6d173302e5a.js"],"AppearanceProvider"]
4
- 4:I[867,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-76cc83e4e54812dc.js","549","static/chunks/549-43d1a5681752fbd4.js","177","static/chunks/app/layout-560bd6d173302e5a.js"],"LanguageProvider"]
5
- 5:I[1035,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-76cc83e4e54812dc.js","549","static/chunks/549-43d1a5681752fbd4.js","177","static/chunks/app/layout-560bd6d173302e5a.js"],"DialogHost"]
6
- 6:I[8214,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-76cc83e4e54812dc.js","549","static/chunks/549-43d1a5681752fbd4.js","177","static/chunks/app/layout-560bd6d173302e5a.js"],"SkipLink"]
7
- 7:I[8197,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-76cc83e4e54812dc.js","549","static/chunks/549-43d1a5681752fbd4.js","177","static/chunks/app/layout-560bd6d173302e5a.js"],""]
8
- 8:I[8214,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-76cc83e4e54812dc.js","549","static/chunks/549-43d1a5681752fbd4.js","177","static/chunks/app/layout-560bd6d173302e5a.js"],"Nav"]
9
- 9:I[6657,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-76cc83e4e54812dc.js","549","static/chunks/549-43d1a5681752fbd4.js","177","static/chunks/app/layout-560bd6d173302e5a.js"],"GlobalApprovals"]
2
+ 2:I[1205,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-f82c74b7b2ed5c54.js","549","static/chunks/549-8f69ef8086802748.js","177","static/chunks/app/layout-560bd6d173302e5a.js"],"themeScript"]
3
+ 3:I[1205,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-f82c74b7b2ed5c54.js","549","static/chunks/549-8f69ef8086802748.js","177","static/chunks/app/layout-560bd6d173302e5a.js"],"AppearanceProvider"]
4
+ 4:I[867,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-f82c74b7b2ed5c54.js","549","static/chunks/549-8f69ef8086802748.js","177","static/chunks/app/layout-560bd6d173302e5a.js"],"LanguageProvider"]
5
+ 5:I[1035,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-f82c74b7b2ed5c54.js","549","static/chunks/549-8f69ef8086802748.js","177","static/chunks/app/layout-560bd6d173302e5a.js"],"DialogHost"]
6
+ 6:I[8214,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-f82c74b7b2ed5c54.js","549","static/chunks/549-8f69ef8086802748.js","177","static/chunks/app/layout-560bd6d173302e5a.js"],"SkipLink"]
7
+ 7:I[8197,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-f82c74b7b2ed5c54.js","549","static/chunks/549-8f69ef8086802748.js","177","static/chunks/app/layout-560bd6d173302e5a.js"],""]
8
+ 8:I[8214,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-f82c74b7b2ed5c54.js","549","static/chunks/549-8f69ef8086802748.js","177","static/chunks/app/layout-560bd6d173302e5a.js"],"Nav"]
9
+ 9:I[6657,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-f82c74b7b2ed5c54.js","549","static/chunks/549-8f69ef8086802748.js","177","static/chunks/app/layout-560bd6d173302e5a.js"],"GlobalApprovals"]
10
10
  a:I[5204,[],""]
11
11
  b:I[2642,[],""]
12
- c:I[7712,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-76cc83e4e54812dc.js","549","static/chunks/549-43d1a5681752fbd4.js","177","static/chunks/app/layout-560bd6d173302e5a.js"],"ScrollJump"]
12
+ c:I[7712,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-f82c74b7b2ed5c54.js","549","static/chunks/549-8f69ef8086802748.js","177","static/chunks/app/layout-560bd6d173302e5a.js"],"ScrollJump"]
13
13
  d:I[7089,[],"ClientPageRoot"]
14
- e:I[3134,["867","static/chunks/867-76cc83e4e54812dc.js","549","static/chunks/549-43d1a5681752fbd4.js","186","static/chunks/app/system/page-3aa2a0fef5454e69.js"],"default"]
14
+ e:I[3134,["867","static/chunks/867-f82c74b7b2ed5c54.js","549","static/chunks/549-8f69ef8086802748.js","186","static/chunks/app/system/page-3aa2a0fef5454e69.js"],"default"]
15
15
  11:I[433,[],"OutletBoundary"]
16
16
  13:I[9884,[],"AsyncMetadataOutlet"]
17
17
  15:I[433,[],"ViewportBoundary"]
18
18
  17:I[433,[],"MetadataBoundary"]
19
19
  18:"$Sreact.suspense"
20
20
  1a:I[3536,[],""]
21
- :HL["/_next/static/css/20c6b36996df5e4c.css","style"]
22
- 0:{"P":null,"b":"auD7lTmj-JDMJIQ4TVivR","p":"","c":["","system"],"i":false,"f":[[["",{"children":["system",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/20c6b36996df5e4c.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"data-theme":"light","data-textsize":"normal","data-contrast":"normal","data-motion":"normal","data-links":"plain","data-focus":"normal","children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"$2"}}]}],["$","body",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"children":[["$","$L6",null,{}],["$","div",null,{"className":"wrap","children":[["$","header",null,{"className":"top","children":[["$","h1",null,{"children":["$","$L7",null,{"href":"/","children":"copilot-operator"}]}],["$","$L8",null,{}]]}],["$","$L9",null,{}],["$","main",null,{"id":"main","children":["$","$La",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$Lb",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}],["$","$Lc",null,{}]]}]}]}]}]]}]]}],{"children":["system",["$","$1","c",{"children":[null,["$","$La",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$Lb",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$Ld",null,{"Component":"$e","searchParams":{},"params":{},"promises":["$@f","$@10"]}],null,["$","$L11",null,{"children":["$L12",["$","$L13",null,{"promise":"$@14"}]]}]]}],{},null,false]},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$L15",null,{"children":"$L16"}],null],["$","$L17",null,{"children":["$","div",null,{"hidden":true,"children":["$","$18",null,{"fallback":null,"children":"$L19"}]}]}]]}],false]],"m":"$undefined","G":["$1a",[]],"s":false,"S":true}
21
+ :HL["/_next/static/css/2ad2a74b7e07dcc9.css","style"]
22
+ 0:{"P":null,"b":"oyfXbuB_cq0sRZP7ukHlQ","p":"","c":["","system"],"i":false,"f":[[["",{"children":["system",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/2ad2a74b7e07dcc9.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"data-theme":"light","data-textsize":"normal","data-contrast":"normal","data-motion":"normal","data-links":"plain","data-focus":"normal","children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"$2"}}]}],["$","body",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"children":[["$","$L6",null,{}],["$","div",null,{"className":"wrap","children":[["$","header",null,{"className":"top","children":[["$","h1",null,{"children":["$","$L7",null,{"href":"/","children":"copilot-operator"}]}],["$","$L8",null,{}]]}],["$","$L9",null,{}],["$","main",null,{"id":"main","children":["$","$La",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$Lb",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}],["$","$Lc",null,{}]]}]}]}]}]]}]]}],{"children":["system",["$","$1","c",{"children":[null,["$","$La",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$Lb",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$Ld",null,{"Component":"$e","searchParams":{},"params":{},"promises":["$@f","$@10"]}],null,["$","$L11",null,{"children":["$L12",["$","$L13",null,{"promise":"$@14"}]]}]]}],{},null,false]},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$L15",null,{"children":"$L16"}],null],["$","$L17",null,{"children":["$","div",null,{"hidden":true,"children":["$","$18",null,{"fallback":null,"children":"$L19"}]}]}]]}],false]],"m":"$undefined","G":["$1a",[]],"s":false,"S":true}
23
23
  f:{}
24
24
  10:"$0:f:0:1:2:children:2:children:1:props:children:0:props:params"
25
25
  16:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "copilot-operator",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Automates a Microsoft 365 Copilot chat: sends prompts, extracts commands, runs them, reports back.",
@@ -20,7 +20,7 @@
20
20
  "cop": "tsx src/cli.ts",
21
21
  "check:parser": "tsx test/parser.check.ts",
22
22
  "check:report": "tsx test/report.check.ts",
23
- "check": "npm run check:parser && npm run check:damage && npm run check:session && npm run check:report && npm run check:runner && npm run check:mirror && npm run check:vcs && npm run check:plan && npm run check:checks && npm run check:workdir && npm run check:processes && npm run check:environment && npm run check:clock && npm run check:crash && npm run check:clipboard && npm run check:restart && npm run check:review && npm run check:chat && npm run check:context && npm run check:pacing && npm run check:shells && npm run check:save && npm run check:guide && npm run check:bundle && npm run check:runname && npm run check:dangerous && npm run check:programs && npm run check:manifest && npm run check:lock && npm run check:isolation && npm run check:security && npm run check:update && npm run check:persona && npm run check:script && npm run check:batch && npm run check:confinement && npm run check:network && npm run check:hardening && npm run check:package && npm run check:models && npm run check:continue && npm run check:startfrom && npm run check:diff && npm run check:integrity && npm run check:scope && npm run check:progress && npm run check:metrics && npm run check:e2e-run && npm run check:e2e-continue && npm run check:e2e-interrupt",
23
+ "check": "npm run check:parser && npm run check:damage && npm run check:session && npm run check:report && npm run check:runner && npm run check:mirror && npm run check:vcs && npm run check:plan && npm run check:checks && npm run check:workdir && npm run check:processes && npm run check:environment && npm run check:clock && npm run check:crash && npm run check:clipboard && npm run check:restart && npm run check:review && npm run check:chat && npm run check:context && npm run check:pacing && npm run check:shells && npm run check:save && npm run check:guide && npm run check:bundle && npm run check:runname && npm run check:dangerous && npm run check:programs && npm run check:manifest && npm run check:lock && npm run check:isolation && npm run check:security && npm run check:update && npm run check:persona && npm run check:script && npm run check:batch && npm run check:confinement && npm run check:network && npm run check:hardening && npm run check:package && npm run check:models && npm run check:continue && npm run check:startfrom && npm run check:diff && npm run check:integrity && npm run check:scope && npm run check:progress && npm run check:metrics && npm run check:modelpicker && npm run check:formatrepair && npm run check:intent && npm run check:sync && npm run check:e2e-run && npm run check:e2e-continue && npm run check:e2e-interrupt",
24
24
  "probe": "tsx scripts/probe-locators.ts",
25
25
  "check:damage": "tsx test/damage.check.ts",
26
26
  "api": "npm run build && node dist/src/api/main.js",
@@ -70,6 +70,10 @@
70
70
  "check:scope": "tsx test/scope.check.ts",
71
71
  "check:progress": "tsx test/progress.check.ts",
72
72
  "check:metrics": "tsx test/metrics.check.ts",
73
+ "check:modelpicker": "tsx test/modelpicker.check.ts",
74
+ "check:formatrepair": "tsx test/formatrepair.check.ts",
75
+ "check:intent": "tsx test/intent.check.ts",
76
+ "check:sync": "tsx test/sync.check.ts",
73
77
  "check:e2e-run": "tsx test/e2e-run.check.ts",
74
78
  "check:e2e-continue": "tsx test/e2e-continue.check.ts",
75
79
  "check:e2e-interrupt": "tsx test/e2e-interrupt.check.ts",
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[373],{1035:(e,t,n)=>{n.d(t,{DialogHost:()=>c,Z:()=>d});var l=n(3365),s=n(1521),a=n(867),r=n(4969);let i=null,o=[];function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(n=>{var l;return l={kind:"confirm",message:e,...t,resolve:n},void(i?i(l):o.push(l))})}function c(e){var t,n;let{children:d}=e,{t:c}=(0,a.kj)(),[u,h]=(0,s.useState)([]),f=(0,s.useRef)(null),m=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(i=e=>h(t=>[...t,e]),o.length>0){let e=o.splice(0,o.length);h(t=>[...t,...e])}return()=>{i=null}},[]);let p=u[0],x=(0,s.useCallback)(e=>{p&&(p.resolve(e),h(e=>e.slice(1)))},[p]);return(0,r.V)(m,!!p,f),(0,s.useEffect)(()=>{if(!p)return;let e=e=>{"Escape"===e.key&&(e.preventDefault(),x(!1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[p,x]),(0,l.jsxs)(l.Fragment,{children:[d,p&&(0,l.jsx)("div",{className:"modal-backdrop",onClick:()=>x(!1),role:"presentation",children:(0,l.jsxs)("div",{ref:m,className:"modal".concat(p.danger?" danger":""),role:"confirm"===p.kind?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":"modal-title","aria-describedby":"modal-body",onClick:e=>e.stopPropagation(),children:[(0,l.jsx)("h2",{id:"modal-title",children:null!=(t=p.title)?t:c("confirm"===p.kind?"dialog.confirmTitle":"dialog.noticeTitle")}),(0,l.jsx)("div",{id:"modal-body",className:"modal-body",children:p.message}),(0,l.jsxs)("div",{className:"row modal-actions",children:["confirm"===p.kind&&(0,l.jsx)("button",{type:"button",className:"quiet",onClick:()=>x(!1),children:c("dialog.cancel")}),(0,l.jsx)("button",{ref:f,type:"button",className:p.danger?"danger":"primary",onClick:()=>x(!0),children:null!=(n=p.okLabel)?n:c("dialog.ok")})]})]})})]})}},1910:(e,t,n)=>{n.d(t,{H:()=>o,u:()=>i});var l=n(3365),s=n(1521),a=n(867),r=n(5549);function i(e){let{label:t,save:n}=e,{t:r}=(0,a.kj)(),[i,o]=(0,s.useState)(!1),[d,c]=(0,s.useState)(""),[u,h]=(0,s.useState)(!1),f=async()=>{o(!0),c("");try{var e;let t=await n();h(!1),c(t.revealed?r("save.done",{path:t.path}):r("save.savedOnly",{path:t.path,note:null!=(e=t.note)?e:""}))}catch(e){h(!0),c(r("save.failed",{problem:e.message}))}finally{o(!1)}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{type:"button",className:"linkish",disabled:i,title:r("save.why"),onClick:()=>void f(),children:i?r("save.saving"):t}),d&&(0,l.jsx)("span",{className:u?"err small":"muted small",children:d})]})}function o(e){let{sessionId:t,taskId:n,attempt:i}=e,{t:o}=(0,a.kj)(),[d,c]=(0,s.useState)(!1),[u,h]=(0,s.useState)(""),[f,m]=(0,s.useState)(!1),p=async()=>{c(!0),h("");try{let e=await r.FH.downloadBundle([{sessionId:t,taskId:n,attempt:i}]);m(!1),h(o("reg.bundleSaved",{name:e}))}catch(e){m(!0),h(o("save.failed",{problem:e.message}))}finally{c(!1)}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{type:"button",className:"linkish",disabled:d,title:o("save.attemptRecordWhy"),onClick:()=>void p(),children:d?o("save.saving"):o("save.attemptRecord")}),u&&(0,l.jsx)("span",{className:f?"err small":"muted small",children:u})]})}},2876:(e,t,n)=>{n.d(t,{P:()=>c});var l=n(3365),s=n(1521),a=n(5549),r=n(867);function i(e,t){let[n,l]=(0,s.useState)(null),a=(0,s.useRef)(!0),[r,i]=(0,s.useState)(!0),o=(0,s.useCallback)(e=>l(e),[]);return(0,s.useLayoutEffect)(()=>{if(!n)return;let e=()=>{let e=n.scrollHeight-n.scrollTop-n.clientHeight<=24;a.current=e,i(e)};return n.addEventListener("scroll",e,{passive:!0}),()=>n.removeEventListener("scroll",e)},[n]),(0,s.useLayoutEffect)(()=>{n&&e&&a.current&&(n.scrollTop=n.scrollHeight)},[n,e,t]),{ref:o,following:r,follow:(0,s.useCallback)(()=>{a.current=!0,i(!0),n&&(n.scrollTop=n.scrollHeight)},[n])}}var o=n(5132);function d(e){let{text:t,follow:n}=e,{ref:s}=i(n,t);return(0,l.jsx)("pre",{ref:s,className:"story-out".concat(n?" terminal":""),children:t})}function c(e){let{sessionId:t,taskId:n,runId:c,live:u}=e,{t:h}=(0,r.kj)(),[f,m]=(0,s.useState)(null),[p,x]=(0,s.useState)(""),[g,v]=(0,s.useState)(!0),[y,k]=(0,s.useState)(!0),[j,b]=(0,s.useState)(new Set),[N,w]=(0,s.useState)(new Set),[S,C]=(0,s.useState)(new Set),E=!!(null==f?void 0:f.live),I=(0,s.useRef)(0);I.current+=1;let F=i(E,I.current),M=(0,s.useRef)(null),L=(0,s.useRef)(!1);if((0,s.useEffect)(()=>{if(!f)return;let e=[],t=(n,l)=>n.forEach((n,s)=>{let a="".concat(l).concat(s);"review"===n.kind?t(n.entries,"".concat(a,"-")):"step"!==n.kind||n.outcome||e.push(a)});t(f.entries,"e"),e.some(e=>!N.has(e))&&w(t=>new Set([...t,...e])),f.live&&!L.current&&M.current&&(L.current=!0,M.current.scrollIntoView({block:"nearest",behavior:"smooth"}))},[f,N]),(0,s.useEffect)(()=>{let e,l=!0,s=async()=>{try{let r=await a.FH.taskStory(t,n,c);if(!l)return;m(r),x(""),(r.live||u)&&(e=setTimeout(s,2e3))}catch(t){if(!l)return;x(t.message),u&&(e=setTimeout(s,2e3))}};return s(),()=>{l=!1,e&&clearTimeout(e)}},[t,n,c,u]),p&&!f)return(0,l.jsx)("div",{className:"err small",children:p});if(!f)return(0,l.jsx)("div",{className:"muted small",children:h("story.loading")});let D=e=>j.has(e)||N.has(e)&&!S.has(e),H=e=>{let t=D(e);b(n=>{let l=new Set(n);return t?l.delete(e):l.add(e),l}),C(n=>{let l=new Set(n);return t?l.add(e):l.delete(e),l})},T=(e,t)=>{if(!("review"===e.kind?g||y:"step"===e.kind?y:g))return null;if("review"===e.kind)return(0,l.jsxs)("li",{className:"story-review",children:[(0,l.jsx)("div",{className:"story-head",children:(0,l.jsx)("span",{className:"chip",children:h("story.review",{n:e.round})})}),(0,l.jsx)("ol",{className:"story",children:e.entries.map((e,n)=>T(e,"".concat(t,"-").concat(n)))})]},t);if("step"===e.kind){let n=D(t),s=!e.outcome&&f.live;return(0,l.jsxs)("li",{className:"story-step".concat(e.failed?" failed":""),children:[(0,l.jsxs)("div",{className:"story-head",children:[(0,l.jsx)("span",{className:"chip",children:h("story.step",{it:e.iteration,id:e.id})}),e.outcome&&(0,l.jsxs)("span",{className:"badge ".concat(e.failed?"failed":"done"),children:[e.outcome,void 0!==e.exitCode?" \xb7 exit ".concat(e.exitCode):"",void 0!==e.durationMs?" \xb7 ".concat((0,a.c5)(e.durationMs)):""]}),!e.outcome&&(0,l.jsx)("span",{className:"badge running",children:h("story.running")}),e.failed&&(0,l.jsx)("span",{className:"badge failed",children:h("story.failedHere")})]}),(0,l.jsx)("pre",{className:"story-cmd",children:e.command}),e.output&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{type:"button",className:"linkish small",onClick:()=>H(t),children:n?h("story.hideOutput"):h("story.showOutput",{n:e.output.length})}),n&&(0,l.jsx)(d,{text:e.output,follow:s})]})]},t)}let n=j.has(t),s="sent"===e.kind?h("story.bot"):h("story.chat"),r="reply"===e.kind&&("blocked"===e.status||"failed"===e.status);return(0,l.jsxs)("li",{className:"story-msg ".concat(e.kind).concat(r?" failed":""),children:[(0,l.jsxs)("div",{className:"story-head",children:[(0,l.jsx)("strong",{children:s}),(0,l.jsx)("span",{className:"muted small",children:e.label}),"reply"===e.kind&&e.status&&(0,l.jsx)("span",{className:"badge ".concat(r?"failed":"done"===e.status?"done":""),children:e.status})]}),"reply"===e.kind&&e.notes&&(0,l.jsx)("p",{className:"story-notes",children:e.notes}),(0,l.jsx)("button",{type:"button",className:"linkish small",onClick:()=>H(t),children:n?h("story.hideText"):h("story.showText",{n:e.text.length})}),n&&(0,l.jsx)("pre",{className:"story-out",children:e.text})]},t)},R=f.close,q=R&&"done"!==R.status;return(0,l.jsxs)("div",{className:"story-box",ref:M,children:[(0,l.jsxs)("div",{className:"row small",style:{marginBottom:6},children:[(0,l.jsxs)("label",{className:"option-inline",children:[(0,l.jsx)("input",{type:"checkbox",checked:g,onChange:e=>v(e.target.checked)})," ",h("story.showChat")]}),(0,l.jsxs)("label",{className:"option-inline",children:[(0,l.jsx)("input",{type:"checkbox",checked:y,onChange:e=>k(e.target.checked)})," ",h("story.showCommands")]}),f.live&&(0,l.jsxs)("span",{className:"live",children:[(0,l.jsx)("span",{className:"dot","aria-hidden":"true"})," ",h("story.live")]}),f.live&&!F.following&&(0,l.jsx)("button",{type:"button",className:"quiet small",onClick:F.follow,title:h("story.followWhy"),children:h("story.follow")}),p&&(0,l.jsx)("span",{className:"err",children:p})]}),(0,l.jsxs)("div",{className:"story-fixed",children:[(0,l.jsx)("strong",{children:h("story.prompt")}),(0,l.jsx)("pre",{className:"story-out always",children:f.prompt})]}),(0,l.jsx)("div",{ref:F.ref,className:"story-scroll".concat(f.live?" live":""),children:(0,l.jsx)("ol",{className:"story",children:f.entries.map((e,t)=>T(e,"e".concat(t)))})}),R?(0,l.jsxs)("div",{className:"story-fixed close".concat(q?" failed":""),children:[(0,l.jsx)("strong",{children:q?h("story.endedBadly",{status:R.status}):h("story.ended")}),R.reason&&(0,l.jsx)("p",{className:"err small",children:R.reason}),R.summary&&(0,l.jsx)(o.s,{text:R.summary,className:"what"}),R.checks&&R.checks.length>0&&(0,l.jsx)("ul",{className:"small",style:{margin:"6px 0 0",paddingLeft:18},children:R.checks.map((e,t)=>(0,l.jsxs)("li",{className:e.passed?"":"err",children:[e.passed?"✓":"✗"," ",e.name,!e.passed&&e.detail?" — ".concat(e.detail):""]},t))})]}):(0,l.jsx)("div",{className:"story-fixed muted small",children:h("story.notEnded")})]})}},3041:(e,t,n)=>{n.d(t,{e:()=>i});var l=n(1521),s=n(5549),a=n(1035),r=n(867);function i(e){let{t}=(0,r.kj)(),[n,i]=(0,l.useState)(""),[o,d]=(0,l.useState)({taskId:"",text:""}),c=(e,t)=>d({taskId:e,text:t}),u=(0,l.useCallback)(async n=>{i("restore"),c(n.taskId,"");try{var l,r,o,d,u,h,f,m,p,x,g,v,y,k;let i=await s.FH.restorePreview(n.sessionId,n.taskId);if(!i.ok)return void c(n.taskId,t("restore.cannot",{problem:null!=(o=i.problem)?o:""}));let j={repo:i.repoDir,title:n.title,branch:null!=(d=i.branchName)?d:"",commit:(null!=(u=i.baseCommit)?u:"").slice(0,8)},b=i.leftBehind.length>0?t("restore.confirmLosing",{...j,n:i.leftBehind.length,kept:null!=(h=i.keptOn)?h:"",list:i.leftBehind.slice(0,10).join("\n")}):t("restore.confirm",j);if(!await (0,a.Z)(b))return;let N=await s.FH.restore(n.sessionId,n.taskId);if(!N.ok)return void c(n.taskId,t("restore.failed",{problem:null!=(f=N.problem)?f:""}));c(n.taskId,(null!=(m=null==(l=N.leftBehind)?void 0:l.length)?m:0)>0?t("restore.done",{branch:null!=(p=N.branch)?p:"",commit:(null!=(x=N.commit)?x:"").slice(0,8),n:null!=(g=null==(r=N.leftBehind)?void 0:r.length)?g:0,kept:null!=(v=N.keptOn)?v:""}):t("restore.doneNothing",{branch:null!=(y=N.branch)?y:"",commit:(null!=(k=N.commit)?k:"").slice(0,8)})),e()}catch(e){c(n.taskId,e.message)}finally{i("")}},[t,e]),h=(0,l.useCallback)(async n=>{i("restart"),c(n.taskId,"");try{var l,r;let i=await s.FH.restartPlan(n.sessionId,n.taskId);if(!i.ok)return void c(n.taskId,t("restart.cannot",{problem:null!=(l=i.problem)?l:""}));let o=i.restores.filter(e=>!e.ok);if(o.length>0)return void c(n.taskId,t("restart.cannot",{problem:o.map(e=>{var t;return"".concat(e.repoDir,": ").concat(null!=(t=e.problem)?t:"")}).join(" | ")}));let d=i.restores.map(e=>{var n,l,s;return t("restart.repoLine",{repo:e.repoDir,commit:(null!=(n=e.baseCommit)?n:"").slice(0,8),branch:null!=(l=e.branchName)?l:"",n:e.leftBehind.length,kept:null!=(s=e.keptOn)?s:""})}).join("\n"),u=i.tasks.map(e=>" ".concat(e.sessionName," / ").concat(e.title).concat(e.alreadyQueued?t("restart.alreadyQueued"):"")).join("\n"),h=t("restart.confirm",{title:i.from.title,tasks:i.tasks.length,sessions:i.sessions.length,list:u,repos:d||t("restart.noRepo"),mode:t("unattended"===i.mode?"run.unattended":"run.confirm")});if(!await (0,a.Z)(h))return;let f=await s.FH.restartFrom(n.sessionId,n.taskId);if(!f.started){c(n.taskId,t("restart.failed",{problem:null!=(r=f.reason)?r:""})),e();return}c(n.taskId,t("restart.started",{requeued:f.requeued,repos:f.restored.length})),e()}catch(e){c(n.taskId,e.message)}finally{i("")}},[t,e]);return{busy:n,message:o.text,messageTask:o.taskId,clearMessage:()=>c("",""),restore:u,restartFrom:h}}},3374:(e,t,n)=>{n.d(t,{c:()=>s});var l=n(1521);function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,[n,s]=(0,l.useState)(()=>Date.now());return(0,l.useEffect)(()=>{if(!e)return;s(Date.now());let n=window.setInterval(()=>s(Date.now()),t);return()=>window.clearInterval(n)},[e,t]),n}},3523:(e,t,n)=>{function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now();if(!e)return;let l=Date.parse(e);if(Number.isNaN(l))return;let s=t?Date.parse(t):n;return Number.isNaN(s)?void 0:Math.max(0,s-l)}function s(e){return!!e.startedAt&&!e.finishedAt&&"queued"!==e.status}function a(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),l=t.some(e=>s(e)),a=t.map(e=>e.finishedAt?Date.parse(e.finishedAt):NaN).filter(e=>!Number.isNaN(e)),r=Date.parse(e.startedAt),i=l||0===a.length?n:Math.max(...a);return{ms:Number.isNaN(r)?0:Math.max(0,i-r),live:l,tasks:t.length}}function r(e){var t,n;let l=new Map;for(let n of e){if(!n.runGroup)continue;let e=null!=(t=l.get(n.runGroup.id))?t:{run:n.runGroup,tasks:[]};e.tasks.push(n),l.set(n.runGroup.id,e)}return null!=(n=[...l.values()].sort((e,t)=>Date.parse(t.run.startedAt)-Date.parse(e.run.startedAt))[0])?n:null}n.d(t,{DG:()=>s,d5:()=>l,eZ:()=>a,hH:()=>r})},4811:(e,t,n)=>{n.d(t,{p:()=>a});var l=n(1521),s=n(5549);function a(){let[e,t]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e=!0;return s.FH.settings().then(n=>{var l;let s=null!=(l=n.raw.execution)?l:{};e&&t("unattended"===s.mode)}).catch(()=>void 0),()=>{e=!1}},[]),e}},4969:(e,t,n)=>{n.d(t,{V:()=>a});var l=n(1521);let s='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function a(e,t,n){(0,l.useEffect)(()=>{var l,a;if(!t)return;let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=e.current,o=null!=(a=null!=(l=null==n?void 0:n.current)?l:null==i?void 0:i.querySelector(s))?a:null;null==o||o.focus();let d=e=>{if("Tab"!==e.key||!i)return;let t=Array.from(i.querySelectorAll(s)).filter(e=>null!==e.offsetParent);if(0===t.length)return;let n=t[0],l=t[t.length-1],a=i.contains(document.activeElement);e.shiftKey&&(document.activeElement===n||!a)?(e.preventDefault(),l.focus()):e.shiftKey||document.activeElement!==l&&a||(e.preventDefault(),n.focus())};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d),r&&document.contains(r)&&r.focus()}},[e,t,n])}},5132:(e,t,n)=>{n.d(t,{s:()=>i});var l=n(3365),s=n(1521);function a(e,t){let n,s=[],a=/(`[^`\n]+`)|(\*\*[^*\n]+\*\*)|(\*[^*\n]+\*)/g,r=0,i=0;for(;null!==(n=a.exec(e));){n.index>r&&s.push(e.slice(r,n.index));let a=n[0],o="".concat(t,"-i").concat(i+=1);a.startsWith("`")?s.push((0,l.jsx)("code",{children:a.slice(1,-1)},o)):a.startsWith("**")?s.push((0,l.jsx)("strong",{children:a.slice(2,-2)},o)):s.push((0,l.jsx)("em",{children:a.slice(1,-1)},o)),r=n.index+a.length}return r<e.length&&s.push(e.slice(r)),s}function r(e){let t=/^\s*[-*•]\s+(.*)$/.exec(e);if(t)return t[1];let n=/^\s*\d+[.)]\s+(.*)$/.exec(e);return n?n[1]:null}function i(e){let{text:t,className:n}=e,i=[],o=t.replace(/\r\n/g,"\n").split("\n"),d=0,c=0;for(;d<o.length;){let e=o[d];if(e.trim().startsWith("```")){let e=[];for(d+=1;d<o.length&&!o[d].trim().startsWith("```");)e.push(o[d++]);d+=1,e.length>0&&i.push((0,l.jsx)("pre",{children:e.join("\n")},"b".concat(c+=1)));continue}if(null!==r(e)){let e=[];for(;d<o.length&&null!==r(o[d]);)e.push(r(o[d++]));i.push((0,l.jsx)("ul",{children:e.map((e,t)=>(0,l.jsx)("li",{children:a(e,"b".concat(c,"-").concat(t))},t))},"b".concat(c+=1)));continue}if(""===e.trim()){d+=1;continue}let t=[];for(;d<o.length&&""!==o[d].trim()&&null===r(o[d])&&!o[d].trim().startsWith("```");)t.push(o[d++]);let n=c+=1;i.push((0,l.jsx)("p",{children:t.map((e,t)=>(0,l.jsxs)(s.Fragment,{children:[t>0&&(0,l.jsx)("br",{}),a(e,"b".concat(n,"-").concat(t))]},t))},"b".concat(n)))}return(0,l.jsx)("div",{className:"rich ".concat(null!=n?n:""),children:i})}},7527:(e,t,n)=>{n.d(t,{z:()=>s});var l=n(1521);function s(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=(0,l.useRef)(e);s.current=e,(0,l.useEffect)(()=>{let e;if(!n)return;let l=!1,a=async()=>{try{await s.current()}catch(e){}finally{l||(e=setTimeout(()=>void a(),t))}};return a(),()=>{l=!0,e&&clearTimeout(e)}},[t,n])}},8934:(e,t,n)=>{n.d(t,{C:()=>d});var l=n(3365),s=n(1521),a=n(5549),r=n(4969),i=n(867);function o(e){if(null===e||""===e)return[];let t=e.split(/\r?\n/);return""===t[t.length-1]&&t.pop(),t}function d(e){let{sessionId:t,taskId:n,runId:a,title:r,files:o}=e,{t:d}=(0,i.kj)(),[u,h]=(0,s.useState)(!1);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{type:"button",className:"linkish",onClick:()=>h(!0),title:d("diff.openWhy"),children:d("diff.open",{n:o})}),u&&(0,l.jsx)(c,{sessionId:t,taskId:n,runId:a,title:r,onClose:()=>h(!1)})]})}function c(e){var t,n,d,c,h,f,m;let{sessionId:p,taskId:x,runId:g,title:v,onClose:y}=e,{t:k}=(0,i.kj)(),[j,b]=(0,s.useState)(null),[N,w]=(0,s.useState)(""),[S,C]=(0,s.useState)(0),[E,I]=(0,s.useState)(new Map),[F,M]=(0,s.useState)(!1),[L,D]=(0,s.useState)(!0),[H,T]=(0,s.useState)(new Map),[R,q]=(0,s.useState)(-1),A=(0,s.useRef)(null),P=(0,s.useRef)(null),B=(0,s.useRef)(null);(0,r.V)(P,!0,B),(0,s.useEffect)(()=>{a.FH.taskChanges(p,x,g).then(b).catch(e=>w(e.message))},[p,x,g]);let W=null!=(d=null==j?void 0:j.files)?d:[],O=W[S];(0,s.useEffect)(()=>{!O||E.has(O.path)||a.FH.taskChangeFile(p,x,O.path,g).then(e=>I(t=>new Map(t).set(O.path,e))).catch(e=>I(t=>new Map(t).set(O.path,e.message)))},[O,E,p,x,g]);let G=O?E.get(O.path):void 0,K=(0,s.useMemo)(()=>!G||"string"==typeof G||G.binary||G.tooLarge?[]:function(e,t){let n=function(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n+=1;let l=e.length,s=t.length;for(;l>n&&s>n&&e[l-1]===t[s-1];)l-=1,s-=1;let a=[];for(let e=0;e<n;e+=1)a.push({kind:"same",a:e,b:e});for(let r of function(e,t){let n=e.length,l=t.length;if(0===n)return t.map((e,t)=>({kind:"add",b:t}));if(0===l)return e.map((e,t)=>({kind:"del",a:t}));let s=n+l,a=s+1,r=new Int32Array(2*s+3),i=[];for(let o=0;o<=Math.min(s,2e3);o+=1){i.push(r.slice(a-o-1,a+o+2));for(let s=-o;s<=o;s+=2){let d=s===-o||s!==o&&r[a+s-1]<r[a+s+1]?r[a+s+1]:r[a+s-1]+1,c=d-s;for(;d<n&&c<l&&e[d]===t[c];)d+=1,c+=1;if(r[a+s]=d,d>=n&&c>=l)return function(e,t,n,l){let s=[],a=t.length,r=n.length;for(let t=l;t>0;t-=1){let n=e[t],l=e=>n[e+t+1],i=a-r,o=i===-t||i!==t&&l(i-1)<l(i+1)?i+1:i-1,d=l(o),c=d-o;for(;a>d&&r>c;)a-=1,r-=1,s.push({kind:"same",a:a,b:r});a===d?s.push({kind:"add",b:c}):s.push({kind:"del",a:d}),a=d,r=c}for(;a>0&&r>0;)a-=1,r-=1,s.push({kind:"same",a:a,b:r});return s.reverse()}(i,e,t,o)}}return[...e.map((e,t)=>({kind:"del",a:t})),...t.map((e,t)=>({kind:"add",b:t}))]}(e.slice(n,l),t.slice(n,s)))a.push({kind:r.kind,...void 0!==r.a?{a:r.a+n}:{},...void 0!==r.b?{b:r.b+n}:{}});for(let t=0;l+t<e.length;t+=1)a.push({kind:"same",a:l+t,b:s+t});return a}(e,t),l=[];for(let s=0;s<n.length;){let a=n[s];if("same"===a.kind){l.push({kind:"same",left:{no:a.a+1,text:e[a.a]},right:{no:a.b+1,text:t[a.b]}}),s+=1;continue}let r=[],i=[];for(;s<n.length&&"same"!==n[s].kind;){let e=n[s];"del"===e.kind?r.push(e.a):i.push(e.b),s+=1}let o=Math.max(r.length,i.length);for(let n=0;n<o;n+=1){let s=r[n],a=i[n];l.push({kind:void 0!==s&&void 0!==a?"change":void 0!==s?"del":"add",...void 0!==s?{left:{no:s+1,text:e[s]}}:{},...void 0!==a?{right:{no:a+1,text:t[a]}}:{}})}}return l}(o(G.before),o(G.after)),[G]),V=O&&H.get(O.path)||new Set,Z=(0,s.useMemo)(()=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set,l=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(l)return e.map((e,t)=>({type:"row",row:e,index:t}));let s=[];for(let l=0;l<e.length;){if("same"!==e[l].kind){s.push({type:"row",row:e[l],index:l}),l+=1;continue}let a=l;for(;a<e.length&&"same"===e[a].kind;)a+=1;let r=0===l?0:t,i=a===e.length?0:t,o=a-l-r-i;if(o>1&&!n.has(l+r)){for(let t=l;t<l+r;t+=1)s.push({type:"row",row:e[t],index:t});s.push({type:"gap",from:l+r,count:o});for(let t=a-i;t<a;t+=1)s.push({type:"row",row:e[t],index:t})}else for(let t=l;t<a;t+=1)s.push({type:"row",row:e[t],index:t});l=a}return s})(K,3,V,F),[K,V,F]),_=(0,s.useMemo)(()=>K.flatMap((e,t)=>"same"!==e.kind&&(0===t||"same"===K[t-1].kind)?[t]:[]),[K]);(0,s.useEffect)(()=>{q(-1),A.current&&(A.current.scrollTop=0)},[S]);let Q=(0,s.useCallback)(e=>{var t;if(0===_.length)return;let n=R<0?1===e?0:_.length-1:Math.min(_.length-1,Math.max(0,R+e));q(n);let l=null==(t=A.current)?void 0:t.querySelector('[data-row="'.concat(_[n],'"]'));null==l||l.scrollIntoView({block:"center"})},[R,_]),$=(0,s.useCallback)(e=>C(t=>Math.min(Math.max(0,t+e),Math.max(0,W.length-1))),[W.length]);(0,s.useEffect)(()=>{let e=e=>{if(!e.ctrlKey&&!e.metaKey&&!e.altKey){if("Escape"===e.key)y();else if("n"===e.key)Q(1);else if("p"===e.key)Q(-1);else if("]"===e.key)$(1);else{if("["!==e.key)return;$(-1)}e.preventDefault()}};window.addEventListener("keydown",e);let t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",e),document.body.style.overflow=t}},[Q,$,y]);let z=W.reduce((e,t)=>({added:e.added+Math.max(0,t.added),removed:e.removed+Math.max(0,t.removed)}),{added:0,removed:0});return(0,l.jsxs)("div",{ref:P,className:"diff-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"diff-title",children:[(0,l.jsxs)("div",{className:"diff-head",children:[(0,l.jsx)("h2",{id:"diff-title",children:k("diff.title",{title:v})}),(null==j?void 0:j.ok)&&(0,l.jsxs)("span",{className:"muted small",children:[j.branch?"".concat(j.branch," \xb7 "):"",null==(t=j.base)?void 0:t.slice(0,8)," → ",null==(n=j.commit)?void 0:n.slice(0,8)," \xb7 ",k("diff.summary",{n:W.length,a:z.added,r:z.removed})]}),(0,l.jsx)("span",{className:"grow"}),(0,l.jsx)("span",{className:"muted small",children:k("diff.keys")}),(0,l.jsx)("button",{ref:B,type:"button",onClick:y,children:k("diff.close")})]}),N&&(0,l.jsx)("div",{className:"err",style:{padding:12},children:N}),!j&&!N&&(0,l.jsx)("div",{className:"muted",style:{padding:12},children:k("diff.loading")}),j&&!j.ok&&(0,l.jsx)("div",{className:"notice caution",style:{margin:12},children:j.problem}),(null==j?void 0:j.ok)&&0===W.length&&(0,l.jsx)("div",{className:"notice",style:{margin:12},children:k("diff.nothing")}),(null==j?void 0:j.ok)&&W.length>0&&(0,l.jsxs)("div",{className:"diff-body",children:[(0,l.jsx)("nav",{className:"diff-files","aria-label":k("diff.files"),children:W.map((e,t)=>{let n=e.path.lastIndexOf("/");return(0,l.jsxs)("button",{type:"button",className:"diff-file".concat(t===S?" on":""),onClick:()=>C(t),title:e.oldPath?"".concat(e.oldPath," → ").concat(e.path):e.path,children:[(0,l.jsx)("span",{className:"diff-status s-".concat(e.status),children:e.status}),(0,l.jsxs)("span",{className:"diff-path",children:[n>=0&&(0,l.jsx)("span",{className:"muted",children:e.path.slice(0,n+1)}),(0,l.jsx)("strong",{children:e.path.slice(n+1)})]}),(0,l.jsx)("span",{className:"diff-counts",children:e.added<0?k("diff.binaryShort"):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("span",{className:"plus",children:["+",e.added]})," ",(0,l.jsxs)("span",{className:"minus",children:["−",e.removed]})]})})]},e.path)})}),(0,l.jsxs)("div",{className:"diff-main",children:[O&&(0,l.jsxs)("div",{className:"diff-toolbar",children:[(0,l.jsx)("strong",{className:"diff-name",children:O.oldPath?"".concat(O.oldPath," → ").concat(O.path):O.path}),(0,l.jsx)("span",{className:"muted small",children:"A"===O.status?k("diff.added"):"D"===O.status?k("diff.deleted"):"R"===O.status?k("diff.renamed"):""}),(0,l.jsx)("span",{className:"grow"}),(0,l.jsx)("button",{type:"button",className:"quiet",onClick:()=>Q(-1),disabled:0===_.length,children:k("diff.prevChange")}),(0,l.jsx)("button",{type:"button",className:"quiet",onClick:()=>Q(1),disabled:0===_.length,children:k("diff.nextChange")}),(0,l.jsx)("span",{className:"muted small",children:_.length>0?k("diff.changeN",{i:R<0?"–":R+1,n:_.length}):""}),(0,l.jsx)("button",{type:"button",className:"quiet",onClick:()=>$(-1),disabled:0===S,children:k("diff.prevFile")}),(0,l.jsx)("button",{type:"button",className:"quiet",onClick:()=>$(1),disabled:S>=W.length-1,children:k("diff.nextFile")}),(0,l.jsxs)("label",{className:"option-inline",children:[(0,l.jsx)("input",{type:"checkbox",checked:F,onChange:e=>M(e.target.checked)})," ",k("diff.whole")]}),(0,l.jsxs)("label",{className:"option-inline",children:[(0,l.jsx)("input",{type:"checkbox",checked:L,onChange:e=>D(e.target.checked)})," ",k("diff.wrap")]})]}),(0,l.jsxs)("div",{className:"diff-scroll",ref:A,children:[void 0===G&&(0,l.jsx)("div",{className:"muted",style:{padding:12},children:k("diff.loading")}),"string"==typeof G&&(0,l.jsx)("div",{className:"err",style:{padding:12},children:G}),G&&"string"!=typeof G&&G.binary&&(0,l.jsx)("div",{className:"notice",style:{margin:12},children:k("diff.binary")}),G&&"string"!=typeof G&&G.tooLarge&&(0,l.jsx)("div",{className:"notice",style:{margin:12},children:k("diff.tooLarge")}),G&&"string"!=typeof G&&!G.binary&&!G.tooLarge&&(0,l.jsxs)(l.Fragment,{children:[(null!=(c=G.before)?c:"").includes("\r\n")!==(null!=(h=G.after)?h:"").includes("\r\n")&&null!==G.before&&null!==G.after&&(0,l.jsx)("div",{className:"notice small",style:{margin:8},children:k("diff.eol",{from:(null!=(f=G.before)?f:"").includes("\r\n")?"CRLF":"LF",to:(null!=(m=G.after)?m:"").includes("\r\n")?"CRLF":"LF"})}),K.length>0&&0===_.length&&(0,l.jsx)("div",{className:"notice small",style:{margin:8},children:k("diff.sameText")}),(0,l.jsxs)("table",{className:"diff-table".concat(L?"":" nowrap"),children:[(0,l.jsxs)("colgroup",{children:[(0,l.jsx)("col",{className:"num"}),(0,l.jsx)("col",{}),(0,l.jsx)("col",{className:"num"}),(0,l.jsx)("col",{})]}),(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{colSpan:2,children:k("diff.before")}),(0,l.jsx)("th",{colSpan:2,children:k("diff.after")})]})}),(0,l.jsx)("tbody",{children:Z.map(e=>"gap"===e.type?(0,l.jsx)("tr",{className:"diff-gap",children:(0,l.jsx)("td",{colSpan:4,children:(0,l.jsx)("button",{type:"button",className:"linkish small",onClick:()=>{var t;return t=e.from,void(O&&T(e=>{var n;return new Map(e).set(O.path,new Set([...null!=(n=e.get(O.path))?n:[],t]))}))},children:k("diff.gap",{n:e.count})})})},"g".concat(e.from)):(0,l.jsx)(u,{row:e.row,index:e.index,current:R>=0&&_[R]===e.index},e.index))})]})]})]})]})]})]})}function u(e){var t,n,a,r;let{row:i,index:o,current:d}=e,c="change"===i.kind?function(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n+=1;let l=e.length,s=t.length;for(;l>n&&s>n&&e[l-1]===t[s-1];)l-=1,s-=1;return{start:n,leftEnd:l,rightEnd:s}}(i.left.text,i.right.text):null,u=e=>{let t=i[e];if(!t)return null;if(!c)return t.text;let n="left"===e?c.leftEnd:c.rightEnd;return(0,l.jsxs)(s.Fragment,{children:[t.text.slice(0,c.start),(0,l.jsx)("mark",{children:t.text.slice(c.start,n)}),t.text.slice(n)]})};return(0,l.jsxs)("tr",{className:"diff-row ".concat(i.kind).concat(d?" current":""),"data-row":o,children:[(0,l.jsx)("td",{className:"num",children:null!=(a=null==(t=i.left)?void 0:t.no)?a:""}),(0,l.jsx)("td",{className:"code l".concat(i.left?"":" empty"),children:u("left")}),(0,l.jsx)("td",{className:"num",children:null!=(r=null==(n=i.right)?void 0:n.no)?r:""}),(0,l.jsx)("td",{className:"code r".concat(i.right?"":" empty"),children:u("right")})]})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[549],{5549:(t,e,o)=>{o.d(e,{AV:()=>i,FH:()=>h,FZ:()=>d,aT:()=>c,c5:()=>y,dK:()=>u,nC:()=>s,rt:()=>l,ub:()=>r,zi:()=>p});var n=o(986);let s="/api";function c(t,e){return"/sessions/view?id=".concat(encodeURIComponent(t)).concat(e?"#".concat(e):"")}let a="cop-api-token";function i(){try{var t;let e=/(?:^#|&)token=([0-9a-f]{16,})/i.exec(window.location.hash);if(e)return window.localStorage.setItem(a,e[1]),window.history.replaceState(null,"",window.location.pathname+window.location.search),e[1];return window.localStorage.getItem(a)||(null!=(t=n.env.NEXT_PUBLIC_COP_TOKEN)?t:"")}catch(t){return""}}function r(t){let e=i();return e?"".concat(t).concat(t.includes("?")?"&":"?","token=").concat(encodeURIComponent(e)):t}let d=["exit-zero","exit-nonzero","output-contains","output-omits","output-matches","file-exists","file-missing","file-contains"];function l(t){return t.startsWith("exit-")||t.startsWith("output-")}function u(t){return"output-contains"===t||"output-omits"===t||"output-matches"===t||"file-contains"===t}async function m(t,e){let o,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=void 0===n.timeoutMs?3e4:n.timeoutMs;try{var a;o=await fetch("".concat(s).concat(t),{...e,...null!==c&&!(null==e?void 0:e.signal)?{signal:AbortSignal.timeout(c)}:{},headers:{"content-type":"application/json",...i()?{"x-cop-token":i()}:{},...null!=(a=null==e?void 0:e.headers)?a:{}}})}catch(e){if("TimeoutError"===e.name)throw Error("The API did not answer within ".concat(Math.round((null!=c?c:0)/1e3)," s (").concat(t.split("?")[0],"). It may be busy; try again."));throw e}if(!o.ok){let t="".concat(o.status," ").concat(o.statusText);try{let e=await o.json();(null==e?void 0:e.message)&&(t=Array.isArray(e.message)?e.message.join("; "):e.message)}catch(t){}throw Error(t)}let r=await o.text();return r?JSON.parse(r):void 0}let h={health:()=>m("/health"),doctor:()=>m("/doctor"),settings:()=>m("/settings"),saveSettings:t=>m("/settings",{method:"PUT",body:JSON.stringify(t)}),level1:()=>m("/level1"),setLevel1:t=>m("/level1",{method:"PUT",body:JSON.stringify({content:t})}),resetLevel1:()=>m("/level1",{method:"DELETE"}),presets:()=>m("/presets"),savePreset:(t,e)=>m("/presets/".concat(encodeURIComponent(t)),{method:"PUT",body:JSON.stringify({content:e})}),deletePreset:t=>m("/presets/".concat(encodeURIComponent(t)),{method:"DELETE"}),personas:()=>m("/personas"),savePersona:(t,e)=>m("/personas/".concat(encodeURIComponent(t)),{method:"PUT",body:JSON.stringify({content:e})}),deletePersona:t=>m("/personas/".concat(encodeURIComponent(t)),{method:"DELETE"}),sessions:()=>m("/sessions"),metrics:()=>m("/metrics"),session:t=>m("/sessions/".concat(t)),createSession:(t,e)=>m("/sessions",{method:"POST",body:JSON.stringify({name:t,mirror:e})}),updateSession:(t,e)=>m("/sessions/".concat(t),{method:"PUT",body:JSON.stringify(e)}),deleteSession:t=>m("/sessions/".concat(t),{method:"DELETE"}),addTask:(t,e)=>m("/sessions/".concat(t,"/tasks"),{method:"POST",body:JSON.stringify(e)}),updateTask:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e),{method:"PUT",body:JSON.stringify(o)}),deleteTask:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e),{method:"DELETE"}),continueTask:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/continue"),{method:"POST",body:"{}"}),rerunTask:function(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return m("/sessions/".concat(t,"/tasks/").concat(e,"/rerun"),{method:"POST",body:JSON.stringify({...o,...n.buildOnFinished?{buildOnFinished:!0}:{}})})},taskChanges:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/changes").concat(o?"?run=".concat(encodeURIComponent(o)):"")),taskChangeFile:(t,e,o,n)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/changes/file?path=").concat(encodeURIComponent(o)).concat(n?"&run=".concat(encodeURIComponent(n)):"")),taskStory:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/story").concat(o?"?run=".concat(encodeURIComponent(o)):"")),taskFiles:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/files").concat(o?"?run=".concat(encodeURIComponent(o)):"")),taskLogUrl:(t,e,o)=>"".concat(s,"/sessions/").concat(t,"/tasks/").concat(e,"/log").concat(o?"?run=".concat(encodeURIComponent(o)):""),taskFileUrl:(t,e,o,n,c)=>"".concat(s,"/sessions/").concat(t,"/tasks/").concat(e,"/files/").concat(o,"/").concat(encodeURIComponent(n)).concat(c?"?run=".concat(encodeURIComponent(c)):""),saveTaskLog:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/log").concat(o?"?run=".concat(encodeURIComponent(o)):""),{method:"POST",body:"{}"}),saveTaskFile:(t,e,o,n,s)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/files/").concat(o,"/").concat(encodeURIComponent(n)).concat(s?"?run=".concat(encodeURIComponent(s)):""),{method:"POST",body:"{}"}),start:(t,e,o)=>m("/sessions/".concat(t,"/start"),{method:"POST",body:JSON.stringify({mode:e,name:o})}),stop:t=>m("/sessions/".concat(t,"/stop"),{method:"POST",body:"{}"}),approvals:t=>m("/approvals".concat(t?"?session=".concat(encodeURIComponent(t)):"")),decide:(t,e)=>m("/approvals/".concat(t),{method:"POST",body:JSON.stringify({action:e})}),setRunMode:(t,e)=>m("/sessions/".concat(t,"/mode"),{method:"POST",body:JSON.stringify({mode:e})}),streamUrl:t=>r("".concat(s,"/sessions/").concat(t,"/stream")),batch:()=>m("/batch").then(t=>null!=t?t:null),startBatch:(t,e,o,n,s,c,a)=>m("/batch/start",{method:"POST",body:JSON.stringify({sessionIds:t,mode:e,onFailure:o,model:n,reviewModel:s,name:c,taskIds:a})}),suggestedRunName:t=>m("/batch/name?sessions=".concat(encodeURIComponent(t.join(",")))),stopBatch:()=>m("/batch/stop",{method:"POST",body:"{}"}),pauseBatch:()=>m("/batch/pause",{method:"POST",body:"{}"}),resumeBatch:()=>m("/batch/resume",{method:"POST",body:"{}"}),planBrief:t=>m("/plan/brief?lang=".concat(encodeURIComponent(t))),context:(t,e)=>m("/context/".concat(t,"?lang=").concat(encodeURIComponent(e))),setContext:(t,e)=>m("/context/".concat(t),{method:"PUT",body:JSON.stringify({content:e})}),resetContext:(t,e)=>m("/context/".concat(t,"?lang=").concat(encodeURIComponent(e)),{method:"DELETE"}),checkPlan:t=>m("/plan/check",{method:"POST",body:JSON.stringify({text:t})}),importPlan:t=>m("/plan/import",{method:"POST",body:JSON.stringify({text:t})}),dirs:function(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return m("/dirs?root=".concat(encodeURIComponent(t),"&gitignore=").concat(e?"1":"0"))},browseFolder:t=>m("/browse-folder",{method:"POST",body:JSON.stringify({start:t})},{timeoutMs:null}),previewMirror:t=>m("/mirror/preview",{method:"POST",body:JSON.stringify(t)},{timeoutMs:18e4}),tasks:()=>m("/tasks"),activity:()=>m("/activity"),downloadBundle:async t=>{var e,o,n;let c=await fetch("".concat(s,"/export/bundle"),{method:"POST",headers:{"content-type":"application/json",...i()?{"x-cop-token":i()}:{}},body:JSON.stringify({tasks:t})});if(!c.ok)throw Error(await c.text()||"".concat(c.status," ").concat(c.statusText));let a=null!=(n=c.headers.get("content-disposition"))?n:"",r=null==(e=/filename\*=UTF-8''([^;]+)/i.exec(a))?void 0:e[1],d=null==(o=/filename="([^"]+)"/i.exec(a))?void 0:o[1],l=null!=d?d:"copilot-operator-bundle.json";if(r)try{l=decodeURIComponent(r)}catch(t){}let u=URL.createObjectURL(await c.blob()),m=document.createElement("a");return m.href=u,m.download=l,document.body.appendChild(m),m.click(),m.remove(),setTimeout(()=>URL.revokeObjectURL(u),1e4),l},exportUrl:(t,e)=>{let o=new URLSearchParams;return e.run&&o.set("run",e.run),e.session&&o.set("session",e.session),e.task&&o.set("task",e.task),r("".concat(s,"/export/").concat(t,"?").concat(o.toString()))},debugExportUrl:t=>r("".concat(s,"/debug/export").concat(t.length>0?"?sessions=".concat(encodeURIComponent(t.join(","))):"")),vcsStatus:t=>m("/sessions/".concat(t,"/vcs")),restorePreview:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/restore")),restore:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/restore"),{method:"POST",body:"{}"}),restartPlan:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/restart")),restartFrom:function(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return m("/sessions/".concat(t,"/tasks/").concat(e,"/restart"),{method:"POST",body:JSON.stringify(o)})},repoCheck:t=>m("/repo?dir=".concat(encodeURIComponent(t))),project:()=>m("/project"),setProject:t=>m("/project",{method:"PUT",body:JSON.stringify(t)}),models:()=>m("/models"),setDefaultModel:t=>m("/models/default",{method:"PUT",body:JSON.stringify({model:t})}),setDefaultReviewModel:t=>m("/models/review-default",{method:"PUT",body:JSON.stringify({model:t})}),refreshModels:()=>m("/models/refresh",{method:"POST",body:"{}"},{timeoutMs:null})};function p(t){return t<1024?"".concat(t," B"):t<1048576?"".concat((t/1024).toFixed(1)," KB"):"".concat((t/1048576).toFixed(1)," MB")}function y(t){if(void 0===t)return"";let e=Math.round(t/1e3);if(e<60)return"".concat(e,"s");let o=Math.floor(e/60);return o<60?"".concat(o,"m ").concat(e%60,"s"):"".concat(Math.floor(o/60),"h ").concat(o%60,"m")}}}]);