copilot-operator 0.1.22 → 0.1.23

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 (34) hide show
  1. package/dist/src/api/operator.controller.js +1 -1
  2. package/dist/src/api/operator.service.js +4 -2
  3. package/dist/src/plan/systemGuide.js +24 -0
  4. package/dist/src/vcs/git.js +4 -2
  5. package/dist/src/vcs/prepareFromRemote.js +38 -8
  6. package/dist/src/vcs/remoteAuth.js +61 -0
  7. package/dist/web/404.html +2 -2
  8. package/dist/web/_next/static/chunks/549-df7a4876917615da.js +1 -0
  9. package/dist/web/_next/static/chunks/867-a67ea8ba3f9b24aa.js +1 -0
  10. package/dist/web/_next/static/chunks/app/defaults/{page-cdc730adea753446.js → page-0e778dafc69afbd3.js} +1 -1
  11. package/dist/web/_next/static/chunks/app/sessions/view/{page-185755ada66e2930.js → page-9b66b729748595bb.js} +1 -1
  12. package/dist/web/appearance.html +2 -2
  13. package/dist/web/appearance.txt +10 -10
  14. package/dist/web/defaults.html +2 -2
  15. package/dist/web/defaults.txt +10 -10
  16. package/dist/web/history.html +2 -2
  17. package/dist/web/history.txt +10 -10
  18. package/dist/web/import.html +2 -2
  19. package/dist/web/import.txt +10 -10
  20. package/dist/web/index.html +2 -2
  21. package/dist/web/index.txt +10 -10
  22. package/dist/web/level1.html +2 -2
  23. package/dist/web/level1.txt +10 -10
  24. package/dist/web/presets.html +2 -2
  25. package/dist/web/presets.txt +10 -10
  26. package/dist/web/sessions/view.html +2 -2
  27. package/dist/web/sessions/view.txt +10 -10
  28. package/dist/web/system.html +2 -2
  29. package/dist/web/system.txt +10 -10
  30. package/package.json +1 -1
  31. package/dist/web/_next/static/chunks/549-5f90780046c1c24f.js +0 -1
  32. package/dist/web/_next/static/chunks/867-79f07bebe3084811.js +0 -1
  33. /package/dist/web/_next/static/{9Ze8aagkvT-WLfD4KCKKS → -dZtu-yqxc-HXzYTmqYSc}/_buildManifest.js +0 -0
  34. /package/dist/web/_next/static/{9Ze8aagkvT-WLfD4KCKKS → -dZtu-yqxc-HXzYTmqYSc}/_ssgManifest.js +0 -0
@@ -1,16 +1,16 @@
1
1
  1:"$Sreact.fragment"
2
- 2:I[8078,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-79f07bebe3084811.js","549","static/chunks/549-5f90780046c1c24f.js","177","static/chunks/app/layout-3efbb282292ccc38.js"],"AppearanceProvider"]
3
- 3:I[867,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-79f07bebe3084811.js","549","static/chunks/549-5f90780046c1c24f.js","177","static/chunks/app/layout-3efbb282292ccc38.js"],"LanguageProvider"]
4
- 4:I[1035,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-79f07bebe3084811.js","549","static/chunks/549-5f90780046c1c24f.js","177","static/chunks/app/layout-3efbb282292ccc38.js"],"DialogHost"]
5
- 5:I[8214,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-79f07bebe3084811.js","549","static/chunks/549-5f90780046c1c24f.js","177","static/chunks/app/layout-3efbb282292ccc38.js"],"SkipLink"]
6
- 6:I[8197,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-79f07bebe3084811.js","549","static/chunks/549-5f90780046c1c24f.js","177","static/chunks/app/layout-3efbb282292ccc38.js"],""]
7
- 7:I[8214,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-79f07bebe3084811.js","549","static/chunks/549-5f90780046c1c24f.js","177","static/chunks/app/layout-3efbb282292ccc38.js"],"Nav"]
8
- 8:I[6657,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-79f07bebe3084811.js","549","static/chunks/549-5f90780046c1c24f.js","177","static/chunks/app/layout-3efbb282292ccc38.js"],"GlobalApprovals"]
2
+ 2:I[8078,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-a67ea8ba3f9b24aa.js","549","static/chunks/549-df7a4876917615da.js","177","static/chunks/app/layout-3efbb282292ccc38.js"],"AppearanceProvider"]
3
+ 3:I[867,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-a67ea8ba3f9b24aa.js","549","static/chunks/549-df7a4876917615da.js","177","static/chunks/app/layout-3efbb282292ccc38.js"],"LanguageProvider"]
4
+ 4:I[1035,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-a67ea8ba3f9b24aa.js","549","static/chunks/549-df7a4876917615da.js","177","static/chunks/app/layout-3efbb282292ccc38.js"],"DialogHost"]
5
+ 5:I[8214,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-a67ea8ba3f9b24aa.js","549","static/chunks/549-df7a4876917615da.js","177","static/chunks/app/layout-3efbb282292ccc38.js"],"SkipLink"]
6
+ 6:I[8197,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-a67ea8ba3f9b24aa.js","549","static/chunks/549-df7a4876917615da.js","177","static/chunks/app/layout-3efbb282292ccc38.js"],""]
7
+ 7:I[8214,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-a67ea8ba3f9b24aa.js","549","static/chunks/549-df7a4876917615da.js","177","static/chunks/app/layout-3efbb282292ccc38.js"],"Nav"]
8
+ 8:I[6657,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-a67ea8ba3f9b24aa.js","549","static/chunks/549-df7a4876917615da.js","177","static/chunks/app/layout-3efbb282292ccc38.js"],"GlobalApprovals"]
9
9
  9:I[5204,[],""]
10
10
  a:I[2642,[],""]
11
- b:I[7712,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-79f07bebe3084811.js","549","static/chunks/549-5f90780046c1c24f.js","177","static/chunks/app/layout-3efbb282292ccc38.js"],"ScrollJump"]
11
+ b:I[7712,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-a67ea8ba3f9b24aa.js","549","static/chunks/549-df7a4876917615da.js","177","static/chunks/app/layout-3efbb282292ccc38.js"],"ScrollJump"]
12
12
  c:I[7089,[],"ClientPageRoot"]
13
- d:I[3134,["867","static/chunks/867-79f07bebe3084811.js","549","static/chunks/549-5f90780046c1c24f.js","186","static/chunks/app/system/page-5ae1f8054208e6eb.js"],"default"]
13
+ d:I[3134,["867","static/chunks/867-a67ea8ba3f9b24aa.js","549","static/chunks/549-df7a4876917615da.js","186","static/chunks/app/system/page-5ae1f8054208e6eb.js"],"default"]
14
14
  10:I[433,[],"OutletBoundary"]
15
15
  12:I[9884,[],"AsyncMetadataOutlet"]
16
16
  14:I[433,[],"ViewportBoundary"]
@@ -18,7 +18,7 @@ d:I[3134,["867","static/chunks/867-79f07bebe3084811.js","549","static/chunks/549
18
18
  17:"$Sreact.suspense"
19
19
  19:I[3536,[],""]
20
20
  :HL["/_next/static/css/c37978b44194c37b.css","style"]
21
- 0:{"P":null,"b":"9Ze8aagkvT-WLfD4KCKKS","p":"","c":["","system"],"i":false,"f":[[["",{"children":["system",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/c37978b44194c37b.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":"\n(function () {\n try {\n var d = document.documentElement;\n var raw = localStorage.getItem('cop.appearance');\n var a = raw ? JSON.parse(raw) : {};\n if (!a || typeof a !== 'object') a = {};\n d.dataset.theme = a.theme === 'dark' ? 'dark' : 'light';\n d.dataset.textsize = [\"small\",\"normal\",\"large\",\"huge\",\"giant\"].indexOf(a.textSize) >= 0 ? a.textSize : 'normal';\n d.dataset.contrast = a.highContrast ? 'high' : 'normal';\n d.dataset.motion = a.reduceMotion ? 'reduced' : 'normal';\n d.dataset.links = a.underlineLinks ? 'underline' : 'plain';\n d.dataset.focus = a.strongFocus ? 'strong' : 'normal';\n } catch (e) {}\n})();\n"}}]}],["$","body",null,{"children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":[["$","$L5",null,{}],["$","div",null,{"className":"wrap","children":[["$","header",null,{"className":"top","children":[["$","h1",null,{"children":["$","$L6",null,{"href":"/","children":"copilot-operator"}]}],["$","$L7",null,{}]]}],["$","$L8",null,{}],["$","main",null,{"id":"main","children":["$","$L9",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$La",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"}]}]]}],["$","$Lb",null,{}]]}]}]}]}]]}]]}],{"children":["system",["$","$1","c",{"children":[null,["$","$L9",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$La",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$Lc",null,{"Component":"$d","searchParams":{},"params":{},"promises":["$@e","$@f"]}],null,["$","$L10",null,{"children":["$L11",["$","$L12",null,{"promise":"$@13"}]]}]]}],{},null,false]},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$L14",null,{"children":"$L15"}],null],["$","$L16",null,{"children":["$","div",null,{"hidden":true,"children":["$","$17",null,{"fallback":null,"children":"$L18"}]}]}]]}],false]],"m":"$undefined","G":["$19",[]],"s":false,"S":true}
21
+ 0:{"P":null,"b":"-dZtu-yqxc-HXzYTmqYSc","p":"","c":["","system"],"i":false,"f":[[["",{"children":["system",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/c37978b44194c37b.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":"\n(function () {\n try {\n var d = document.documentElement;\n var raw = localStorage.getItem('cop.appearance');\n var a = raw ? JSON.parse(raw) : {};\n if (!a || typeof a !== 'object') a = {};\n d.dataset.theme = a.theme === 'dark' ? 'dark' : 'light';\n d.dataset.textsize = [\"small\",\"normal\",\"large\",\"huge\",\"giant\"].indexOf(a.textSize) >= 0 ? a.textSize : 'normal';\n d.dataset.contrast = a.highContrast ? 'high' : 'normal';\n d.dataset.motion = a.reduceMotion ? 'reduced' : 'normal';\n d.dataset.links = a.underlineLinks ? 'underline' : 'plain';\n d.dataset.focus = a.strongFocus ? 'strong' : 'normal';\n } catch (e) {}\n})();\n"}}]}],["$","body",null,{"children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":[["$","$L5",null,{}],["$","div",null,{"className":"wrap","children":[["$","header",null,{"className":"top","children":[["$","h1",null,{"children":["$","$L6",null,{"href":"/","children":"copilot-operator"}]}],["$","$L7",null,{}]]}],["$","$L8",null,{}],["$","main",null,{"id":"main","children":["$","$L9",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$La",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"}]}]]}],["$","$Lb",null,{}]]}]}]}]}]]}]]}],{"children":["system",["$","$1","c",{"children":[null,["$","$L9",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$La",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$Lc",null,{"Component":"$d","searchParams":{},"params":{},"promises":["$@e","$@f"]}],null,["$","$L10",null,{"children":["$L11",["$","$L12",null,{"promise":"$@13"}]]}]]}],{},null,false]},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$L14",null,{"children":"$L15"}],null],["$","$L16",null,{"children":["$","div",null,{"hidden":true,"children":["$","$17",null,{"fallback":null,"children":"$L18"}]}]}]]}],false]],"m":"$undefined","G":["$19",[]],"s":false,"S":true}
22
22
  e:{}
23
23
  f:"$0:f:0:1:2:children:2:children:1:props:children:0:props:params"
24
24
  15:[["$","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.22",
3
+ "version": "0.1.23",
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.",
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[549],{5549:(t,e,o)=>{o.d(e,{AV:()=>a,FH:()=>h,FZ:()=>r,Zm:()=>u,aT:()=>s,c5:()=>y,dK:()=>l,nC:()=>n,rt:()=>d,ub:()=>i,zi:()=>p});let n="/api";function s(t,e){return"/sessions/view?id=".concat(encodeURIComponent(t)).concat(e?"#".concat(e):"")}let c="cop-api-token";function a(){try{let t=/(?:^#|&)token=([0-9a-f]{16,})/i.exec(window.location.hash);if(t)return window.localStorage.setItem(c,t[1]),window.history.replaceState(null,"",window.location.pathname+window.location.search),t[1];return window.localStorage.getItem(c)||""}catch(t){return""}}function i(t){let e=a();return e?"".concat(t).concat(t.includes("?")?"&":"?","token=").concat(encodeURIComponent(e)):t}let r=["exit-zero","exit-nonzero","output-contains","output-omits","output-matches","file-exists","file-missing","file-contains"];function d(t){return t.startsWith("exit-")||t.startsWith("output-")}function l(t){return"output-contains"===t||"output-omits"===t||"output-matches"===t||"file-contains"===t}function u(t){return"limit-reached"===t.status||"aborted"===t.status||!!t.limit&&("failed"===t.status||"blocked"===t.status)}async function m(t,e){let o,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=void 0===s.timeoutMs?3e4:s.timeoutMs;try{var i;o=await fetch("".concat(n).concat(t),{...e,...null!==c&&!(null==e?void 0:e.signal)?{signal:AbortSignal.timeout(c)}:{},headers:{"content-type":"application/json",...a()?{"x-cop-token":a()}:{},...null!=(i=null==e?void 0:e.headers)?i:{}}})}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"),reorderSessions:t=>m("/sessions-order",{method:"PUT",body:JSON.stringify({ids:t})}),metrics:()=>m("/metrics"),preparePreview:t=>m("/repo/prepare/preview",{method:"POST",body:JSON.stringify({dir:t})}),prepareProject:(t,e)=>m("/repo/prepare",{method:"POST",body:JSON.stringify({dir:t,fingerprint:e})}),session:t=>m("/sessions/".concat(t)),createSession:(t,e)=>m("/sessions",{method:"POST",body:JSON.stringify({name:t,projectDir: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(n,"/sessions/").concat(t,"/tasks/").concat(e,"/log").concat(o?"?run=".concat(encodeURIComponent(o)):""),taskFileUrl:(t,e,o,s,c)=>"".concat(n,"/sessions/").concat(t,"/tasks/").concat(e,"/files/").concat(o,"/").concat(encodeURIComponent(s)).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=>i("".concat(n,"/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})}),browseFolder:t=>m("/browse-folder",{method:"POST",body:JSON.stringify({start:t})},{timeoutMs:null}),tasks:()=>m("/tasks"),activity:()=>m("/activity"),downloadBundle:async t=>{var e,o,s;let c=await fetch("".concat(n,"/export/bundle"),{method:"POST",headers:{"content-type":"application/json",...a()?{"x-cop-token":a()}:{}},body:JSON.stringify({tasks:t})});if(!c.ok)throw Error(await c.text()||"".concat(c.status," ").concat(c.statusText));let i=null!=(s=c.headers.get("content-disposition"))?s:"",r=null==(e=/filename\*=UTF-8''([^;]+)/i.exec(i))?void 0:e[1],d=null==(o=/filename="([^"]+)"/i.exec(i))?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),i("".concat(n,"/export/").concat(t,"?").concat(o.toString()))},debugExportUrl:t=>i("".concat(n,"/debug/export").concat(t.length>0?"?sessions=".concat(encodeURIComponent(t.join(","))):"")),vcsStatus:t=>m("/sessions/".concat(t,"/vcs")),runVcs:t=>m("/batch/vcs?ids=".concat(encodeURIComponent(t.join(",")))),runVcsPrepare:function(t,e,o){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return m("/batch/vcs/prepare",{method:"POST",body:JSON.stringify({sessionIds:t,repoDir:e,action:o,choices:n})})},vcsSnapshot:(t,e)=>m("/sessions/".concat(t,"/vcs/snapshot"),{method:"POST",body:JSON.stringify({choices:e})}),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}),login:t=>m("/login",{method:"POST",body:JSON.stringify({account:(null==t?void 0:t.trim())||void 0})},{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")}}}]);