copilot-operator 0.1.6 → 0.1.8
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.
- package/dist/src/api/operator.controller.js +32 -0
- package/dist/src/api/operator.service.js +91 -11
- package/dist/src/plan/brief.js +4 -4
- package/dist/src/plan/systemGuide.js +116 -11
- package/dist/src/session/compose.js +24 -19
- package/dist/src/session/interruption.js +104 -0
- package/dist/src/session/store.js +21 -5
- package/dist/src/session/story.js +1 -1
- package/dist/src/vcs/git.js +71 -0
- package/dist/web/404.html +2 -2
- package/dist/web/_next/static/chunks/549-33f0d3d53338b2f2.js +1 -0
- package/dist/web/_next/static/chunks/723-edc7b5709e5407ec.js +1 -0
- package/dist/web/_next/static/chunks/867-3d4ee08c5f9f0e71.js +1 -0
- package/dist/web/_next/static/chunks/app/defaults/{page-1747c931adc746fd.js → page-dfcbd748f454d2d7.js} +1 -1
- package/dist/web/_next/static/chunks/app/history/page-49413c3a8266a0b7.js +1 -0
- package/dist/web/_next/static/chunks/app/sessions/view/page-a82e5e801dabc423.js +1 -0
- package/dist/web/_next/static/css/{63fea96806e6b2cb.css → b67acb571615432b.css} +1 -1
- package/dist/web/appearance.html +2 -2
- package/dist/web/appearance.txt +12 -12
- package/dist/web/defaults.html +2 -2
- package/dist/web/defaults.txt +12 -12
- package/dist/web/history.html +2 -2
- package/dist/web/history.txt +12 -12
- package/dist/web/import.html +2 -2
- package/dist/web/import.txt +12 -12
- package/dist/web/index.html +2 -2
- package/dist/web/index.txt +12 -12
- package/dist/web/level1.html +2 -2
- package/dist/web/level1.txt +12 -12
- package/dist/web/presets.html +2 -2
- package/dist/web/presets.txt +12 -12
- package/dist/web/sessions/view.html +2 -2
- package/dist/web/sessions/view.txt +12 -12
- package/dist/web/system.html +2 -2
- package/dist/web/system.txt +12 -12
- package/package.json +4 -3
- package/dist/web/_next/static/chunks/549-afafecd6bfbb138e.js +0 -1
- package/dist/web/_next/static/chunks/56-91cd1709158ebf99.js +0 -1
- package/dist/web/_next/static/chunks/867-fc983d08916b4e28.js +0 -1
- package/dist/web/_next/static/chunks/app/history/page-b3b4af994c868b5d.js +0 -1
- package/dist/web/_next/static/chunks/app/sessions/view/page-d4213354730a945c.js +0 -1
- /package/dist/web/_next/static/{WJ_8hRZsp4VWiDZx8NMUw → kysrkUS5Y-ZTHsIIXgs3q}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{WJ_8hRZsp4VWiDZx8NMUw → kysrkUS5Y-ZTHsIIXgs3q}/_ssgManifest.js +0 -0
package/dist/web/system.txt
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
1:"$Sreact.fragment"
|
|
2
|
-
2:I[1205,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-
|
|
3
|
-
3:I[1205,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-
|
|
4
|
-
4:I[867,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-
|
|
5
|
-
5:I[1035,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-
|
|
6
|
-
6:I[8214,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-
|
|
7
|
-
7:I[8197,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-
|
|
8
|
-
8:I[8214,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-
|
|
9
|
-
9:I[6657,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-
|
|
2
|
+
2:I[1205,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-3d4ee08c5f9f0e71.js","549","static/chunks/549-33f0d3d53338b2f2.js","177","static/chunks/app/layout-e0174d863960f109.js"],"themeScript"]
|
|
3
|
+
3:I[1205,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-3d4ee08c5f9f0e71.js","549","static/chunks/549-33f0d3d53338b2f2.js","177","static/chunks/app/layout-e0174d863960f109.js"],"AppearanceProvider"]
|
|
4
|
+
4:I[867,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-3d4ee08c5f9f0e71.js","549","static/chunks/549-33f0d3d53338b2f2.js","177","static/chunks/app/layout-e0174d863960f109.js"],"LanguageProvider"]
|
|
5
|
+
5:I[1035,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-3d4ee08c5f9f0e71.js","549","static/chunks/549-33f0d3d53338b2f2.js","177","static/chunks/app/layout-e0174d863960f109.js"],"DialogHost"]
|
|
6
|
+
6:I[8214,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-3d4ee08c5f9f0e71.js","549","static/chunks/549-33f0d3d53338b2f2.js","177","static/chunks/app/layout-e0174d863960f109.js"],"SkipLink"]
|
|
7
|
+
7:I[8197,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-3d4ee08c5f9f0e71.js","549","static/chunks/549-33f0d3d53338b2f2.js","177","static/chunks/app/layout-e0174d863960f109.js"],""]
|
|
8
|
+
8:I[8214,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-3d4ee08c5f9f0e71.js","549","static/chunks/549-33f0d3d53338b2f2.js","177","static/chunks/app/layout-e0174d863960f109.js"],"Nav"]
|
|
9
|
+
9:I[6657,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-3d4ee08c5f9f0e71.js","549","static/chunks/549-33f0d3d53338b2f2.js","177","static/chunks/app/layout-e0174d863960f109.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-
|
|
12
|
+
c:I[7712,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-3d4ee08c5f9f0e71.js","549","static/chunks/549-33f0d3d53338b2f2.js","177","static/chunks/app/layout-e0174d863960f109.js"],"ScrollJump"]
|
|
13
13
|
d:I[7089,[],"ClientPageRoot"]
|
|
14
|
-
e:I[3134,["867","static/chunks/867-
|
|
14
|
+
e:I[3134,["867","static/chunks/867-3d4ee08c5f9f0e71.js","549","static/chunks/549-33f0d3d53338b2f2.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/
|
|
22
|
-
0:{"P":null,"b":"
|
|
21
|
+
:HL["/_next/static/css/b67acb571615432b.css","style"]
|
|
22
|
+
0:{"P":null,"b":"kysrkUS5Y-ZTHsIIXgs3q","p":"","c":["","system"],"i":false,"f":[[["",{"children":["system",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/b67acb571615432b.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.
|
|
3
|
+
"version": "0.1.8",
|
|
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",
|
|
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",
|
|
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",
|
|
@@ -64,7 +64,8 @@
|
|
|
64
64
|
"check:package": "tsx test/package.check.ts",
|
|
65
65
|
"check:models": "tsx test/models.check.ts",
|
|
66
66
|
"check:continue": "tsx test/continue.check.ts",
|
|
67
|
-
"check:startfrom": "tsx test/startfrom.check.ts"
|
|
67
|
+
"check:startfrom": "tsx test/startfrom.check.ts",
|
|
68
|
+
"check:diff": "tsx test/diff.check.ts"
|
|
68
69
|
},
|
|
69
70
|
"dependencies": {
|
|
70
71
|
"@nestjs/common": "^12.0.3",
|
|
@@ -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){var o;let n=await fetch("".concat(s).concat(t),{...e,headers:{"content-type":"application/json",...i()?{"x-cop-token":i()}:{},...null!=(o=null==e?void 0:e.headers)?o:{}}});if(!n.ok){let t="".concat(n.status," ").concat(n.statusText);try{let e=await n.json();(null==e?void 0:e.message)&&(t=Array.isArray(e.message)?e.message.join("; "):e.message)}catch(t){}throw Error(t)}let c=await n.text();return c?JSON.parse(c):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"),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}:{}})})},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})}),previewMirror:t=>m("/mirror/preview",{method:"POST",body:JSON.stringify(t)}),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:"{}"})};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")}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[56],{1035:(e,t,s)=>{s.d(t,{DialogHost:()=>c,Z:()=>o});var n=s(3365),l=s(1521),r=s(867);let a=null,i=[];function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(s=>{var n;return n={kind:"confirm",message:e,...t,resolve:s},void(a?a(n):i.push(n))})}function c(e){var t,s;let{children:o}=e,{t:c}=(0,r.kj)(),[d,u]=(0,l.useState)([]),h=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(a=e=>u(t=>[...t,e]),i.length>0){let e=i.splice(0,i.length);u(t=>[...t,...e])}return()=>{a=null}},[]);let m=d[0],p=(0,l.useCallback)(e=>{m&&(m.resolve(e),u(e=>e.slice(1)))},[m]);return(0,l.useEffect)(()=>{var e;if(!m)return;null==(e=h.current)||e.focus();let t=e=>{"Escape"===e.key&&(e.preventDefault(),p(!1))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[m,p]),(0,n.jsxs)(n.Fragment,{children:[o,m&&(0,n.jsx)("div",{className:"modal-backdrop",onClick:()=>p(!1),role:"presentation",children:(0,n.jsxs)("div",{className:"modal".concat(m.danger?" danger":""),role:"confirm"===m.kind?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":"modal-title",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("h2",{id:"modal-title",children:null!=(t=m.title)?t:c("confirm"===m.kind?"dialog.confirmTitle":"dialog.noticeTitle")}),(0,n.jsx)("div",{className:"modal-body",children:m.message}),(0,n.jsxs)("div",{className:"row modal-actions",children:["confirm"===m.kind&&(0,n.jsx)("button",{type:"button",className:"quiet",onClick:()=>p(!1),children:c("dialog.cancel")}),(0,n.jsx)("button",{ref:h,type:"button",className:m.danger?"danger":"primary",onClick:()=>p(!0),children:null!=(s=m.okLabel)?s:c("dialog.ok")})]})]})})]})}},1910:(e,t,s)=>{s.d(t,{H:()=>o,u:()=>i});var n=s(3365),l=s(1521),r=s(867),a=s(5549);function i(e){let{label:t,save:s}=e,{t:a}=(0,r.kj)(),[i,o]=(0,l.useState)(!1),[c,d]=(0,l.useState)(""),[u,h]=(0,l.useState)(!1),m=async()=>{o(!0),d("");try{var e;let t=await s();h(!1),d(t.revealed?a("save.done",{path:t.path}):a("save.savedOnly",{path:t.path,note:null!=(e=t.note)?e:""}))}catch(e){h(!0),d(a("save.failed",{problem:e.message}))}finally{o(!1)}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"linkish",disabled:i,title:a("save.why"),onClick:()=>void m(),children:i?a("save.saving"):t}),c&&(0,n.jsx)("span",{className:u?"err small":"muted small",children:c})]})}function o(e){let{sessionId:t,taskId:s,attempt:i}=e,{t:o}=(0,r.kj)(),[c,d]=(0,l.useState)(!1),[u,h]=(0,l.useState)(""),[m,p]=(0,l.useState)(!1),f=async()=>{d(!0),h("");try{let e=await a.FH.downloadBundle([{sessionId:t,taskId:s,attempt:i}]);p(!1),h(o("reg.bundleSaved",{name:e}))}catch(e){p(!0),h(o("save.failed",{problem:e.message}))}finally{d(!1)}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"linkish",disabled:c,title:o("save.attemptRecordWhy"),onClick:()=>void f(),children:c?o("save.saving"):o("save.attemptRecord")}),u&&(0,n.jsx)("span",{className:m?"err small":"muted small",children:u})]})}},2876:(e,t,s)=>{s.d(t,{P:()=>d});var n=s(3365),l=s(1521),r=s(5549),a=s(867);function i(e,t){let[s,n]=(0,l.useState)(null),r=(0,l.useRef)(!0),[a,i]=(0,l.useState)(!0),o=(0,l.useCallback)(e=>n(e),[]);return(0,l.useLayoutEffect)(()=>{if(!s)return;let e=()=>{let e=s.scrollHeight-s.scrollTop-s.clientHeight<=24;r.current=e,i(e)};return s.addEventListener("scroll",e,{passive:!0}),()=>s.removeEventListener("scroll",e)},[s]),(0,l.useLayoutEffect)(()=>{s&&e&&r.current&&(s.scrollTop=s.scrollHeight)},[s,e,t]),{ref:o,following:a,follow:(0,l.useCallback)(()=>{r.current=!0,i(!0),s&&(s.scrollTop=s.scrollHeight)},[s])}}var o=s(5132);function c(e){let{text:t,follow:s}=e,{ref:l}=i(s,t);return(0,n.jsx)("pre",{ref:l,className:"story-out".concat(s?" terminal":""),children:t})}function d(e){let{sessionId:t,taskId:s,runId:d,live:u}=e,{t:h}=(0,a.kj)(),[m,p]=(0,l.useState)(null),[f,x]=(0,l.useState)(""),[v,y]=(0,l.useState)(!0),[g,j]=(0,l.useState)(!0),[k,b]=(0,l.useState)(new Set),[N,w]=(0,l.useState)(new Set),[S,C]=(0,l.useState)(new Set),D=!!(null==m?void 0:m.live),E=(0,l.useRef)(0);E.current+=1;let H=i(D,E.current),F=(0,l.useRef)(null),I=(0,l.useRef)(!1);if((0,l.useEffect)(()=>{if(!m)return;let e=[],t=(s,n)=>s.forEach((s,l)=>{let r="".concat(n).concat(l);"review"===s.kind?t(s.entries,"".concat(r,"-")):"step"!==s.kind||s.outcome||e.push(r)});t(m.entries,"e"),e.some(e=>!N.has(e))&&w(t=>new Set([...t,...e])),m.live&&!I.current&&F.current&&(I.current=!0,F.current.scrollIntoView({block:"nearest",behavior:"smooth"}))},[m,N]),(0,l.useEffect)(()=>{let e,n=!0,l=async()=>{try{let a=await r.FH.taskStory(t,s,d);if(!n)return;p(a),x(""),a.live&&(e=setTimeout(l,2e3))}catch(t){if(!n)return;x(t.message),u&&(e=setTimeout(l,2e3))}};return l(),()=>{n=!1,e&&clearTimeout(e)}},[t,s,d,u]),f&&!m)return(0,n.jsx)("div",{className:"err small",children:f});if(!m)return(0,n.jsx)("div",{className:"muted small",children:h("story.loading")});let L=e=>k.has(e)||N.has(e)&&!S.has(e),T=e=>{let t=L(e);b(s=>{let n=new Set(s);return t?n.delete(e):n.add(e),n}),C(s=>{let n=new Set(s);return t?n.add(e):n.delete(e),n})},B=(e,t)=>{if(!("review"===e.kind?v||g:"step"===e.kind?g:v))return null;if("review"===e.kind)return(0,n.jsxs)("li",{className:"story-review",children:[(0,n.jsx)("div",{className:"story-head",children:(0,n.jsx)("span",{className:"chip",children:h("story.review",{n:e.round})})}),(0,n.jsx)("ol",{className:"story",children:e.entries.map((e,s)=>B(e,"".concat(t,"-").concat(s)))})]},t);if("step"===e.kind){let s=L(t),l=!e.outcome&&m.live;return(0,n.jsxs)("li",{className:"story-step".concat(e.failed?" failed":""),children:[(0,n.jsxs)("div",{className:"story-head",children:[(0,n.jsx)("span",{className:"chip",children:h("story.step",{it:e.iteration,id:e.id})}),e.outcome&&(0,n.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,r.c5)(e.durationMs)):""]}),!e.outcome&&(0,n.jsx)("span",{className:"badge running",children:h("story.running")}),e.failed&&(0,n.jsx)("span",{className:"badge failed",children:h("story.failedHere")})]}),(0,n.jsx)("pre",{className:"story-cmd",children:e.command}),e.output&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"linkish small",onClick:()=>T(t),children:s?h("story.hideOutput"):h("story.showOutput",{n:e.output.length})}),s&&(0,n.jsx)(c,{text:e.output,follow:l})]})]},t)}let s=k.has(t),l="sent"===e.kind?h("story.bot"):h("story.chat"),a="reply"===e.kind&&("blocked"===e.status||"failed"===e.status);return(0,n.jsxs)("li",{className:"story-msg ".concat(e.kind).concat(a?" failed":""),children:[(0,n.jsxs)("div",{className:"story-head",children:[(0,n.jsx)("strong",{children:l}),(0,n.jsx)("span",{className:"muted small",children:e.label}),"reply"===e.kind&&e.status&&(0,n.jsx)("span",{className:"badge ".concat(a?"failed":"done"===e.status?"done":""),children:e.status})]}),"reply"===e.kind&&e.notes&&(0,n.jsx)("p",{className:"story-notes",children:e.notes}),(0,n.jsx)("button",{type:"button",className:"linkish small",onClick:()=>T(t),children:s?h("story.hideText"):h("story.showText",{n:e.text.length})}),s&&(0,n.jsx)("pre",{className:"story-out",children:e.text})]},t)},R=m.close,A=R&&"done"!==R.status;return(0,n.jsxs)("div",{className:"story-box",ref:F,children:[(0,n.jsxs)("div",{className:"row small",style:{marginBottom:6},children:[(0,n.jsxs)("label",{className:"option-inline",children:[(0,n.jsx)("input",{type:"checkbox",checked:v,onChange:e=>y(e.target.checked)})," ",h("story.showChat")]}),(0,n.jsxs)("label",{className:"option-inline",children:[(0,n.jsx)("input",{type:"checkbox",checked:g,onChange:e=>j(e.target.checked)})," ",h("story.showCommands")]}),m.live&&(0,n.jsxs)("span",{className:"live",children:[(0,n.jsx)("span",{className:"dot","aria-hidden":"true"})," ",h("story.live")]}),m.live&&!H.following&&(0,n.jsx)("button",{type:"button",className:"quiet small",onClick:H.follow,title:h("story.followWhy"),children:h("story.follow")}),f&&(0,n.jsx)("span",{className:"err",children:f})]}),(0,n.jsxs)("div",{className:"story-fixed",children:[(0,n.jsx)("strong",{children:h("story.prompt")}),(0,n.jsx)("pre",{className:"story-out always",children:m.prompt})]}),(0,n.jsx)("div",{ref:H.ref,className:"story-scroll".concat(m.live?" live":""),children:(0,n.jsx)("ol",{className:"story",children:m.entries.map((e,t)=>B(e,"e".concat(t)))})}),R?(0,n.jsxs)("div",{className:"story-fixed close".concat(A?" failed":""),children:[(0,n.jsx)("strong",{children:A?h("story.endedBadly",{status:R.status}):h("story.ended")}),R.reason&&(0,n.jsx)("p",{className:"err small",children:R.reason}),R.summary&&(0,n.jsx)(o.s,{text:R.summary,className:"what"}),R.checks&&R.checks.length>0&&(0,n.jsx)("ul",{className:"small",style:{margin:"6px 0 0",paddingLeft:18},children:R.checks.map((e,t)=>(0,n.jsxs)("li",{className:e.passed?"":"err",children:[e.passed?"✓":"✗"," ",e.name,!e.passed&&e.detail?" — ".concat(e.detail):""]},t))})]}):(0,n.jsx)("div",{className:"story-fixed muted small",children:h("story.notEnded")})]})}},3041:(e,t,s)=>{s.d(t,{e:()=>i});var n=s(1521),l=s(5549),r=s(1035),a=s(867);function i(e){let{t}=(0,a.kj)(),[s,i]=(0,n.useState)(""),[o,c]=(0,n.useState)("");return{busy:s,message:o,clearMessage:()=>c(""),restore:(0,n.useCallback)(async s=>{i("restore"),c("");try{var n,a,o,d,u,h,m,p,f,x,v,y,g,j;let i=await l.FH.restorePreview(s.sessionId,s.taskId);if(!i.ok)return void c(t("restore.cannot",{problem:null!=(o=i.problem)?o:""}));let k={repo:i.repoDir,title:s.title,branch:null!=(d=i.branchName)?d:"",commit:(null!=(u=i.baseCommit)?u:"").slice(0,8)},b=i.leftBehind.length>0?t("restore.confirmLosing",{...k,n:i.leftBehind.length,kept:null!=(h=i.keptOn)?h:"",list:i.leftBehind.slice(0,10).join("\n")}):t("restore.confirm",k);if(!await (0,r.Z)(b))return;let N=await l.FH.restore(s.sessionId,s.taskId);if(!N.ok)return void c(t("restore.failed",{problem:null!=(m=N.problem)?m:""}));c((null!=(p=null==(n=N.leftBehind)?void 0:n.length)?p:0)>0?t("restore.done",{branch:null!=(f=N.branch)?f:"",commit:(null!=(x=N.commit)?x:"").slice(0,8),n:null!=(v=null==(a=N.leftBehind)?void 0:a.length)?v:0,kept:null!=(y=N.keptOn)?y:""}):t("restore.doneNothing",{branch:null!=(g=N.branch)?g:"",commit:(null!=(j=N.commit)?j:"").slice(0,8)})),e()}catch(e){c(e.message)}finally{i("")}},[t,e]),restartFrom:(0,n.useCallback)(async s=>{i("restart"),c("");try{var n,a;let i=await l.FH.restartPlan(s.sessionId,s.taskId);if(!i.ok)return void c(t("restart.cannot",{problem:null!=(n=i.problem)?n:""}));let o=i.restores.filter(e=>!e.ok);if(o.length>0)return void c(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 s,n,l;return t("restart.repoLine",{repo:e.repoDir,commit:(null!=(s=e.baseCommit)?s:"").slice(0,8),branch:null!=(n=e.branchName)?n:"",n:e.leftBehind.length,kept:null!=(l=e.keptOn)?l:""})}).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,r.Z)(h))return;let m=await l.FH.restartFrom(s.sessionId,s.taskId);if(!m.started){c(t("restart.failed",{problem:null!=(a=m.reason)?a:""})),e();return}c(t("restart.started",{requeued:m.requeued,repos:m.restored.length})),e()}catch(e){c(e.message)}finally{i("")}},[t,e])}}},3374:(e,t,s)=>{s.d(t,{c:()=>l});var n=s(1521);function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,[s,l]=(0,n.useState)(()=>Date.now());return(0,n.useEffect)(()=>{if(!e)return;l(Date.now());let s=window.setInterval(()=>l(Date.now()),t);return()=>window.clearInterval(s)},[e,t]),s}},3523:(e,t,s)=>{function n(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now();if(!e)return;let n=Date.parse(e);if(Number.isNaN(n))return;let l=t?Date.parse(t):s;return Number.isNaN(l)?void 0:Math.max(0,l-n)}function l(e){return!!e.startedAt&&!e.finishedAt&&"queued"!==e.status}function r(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),n=t.some(e=>l(e)),r=t.map(e=>e.finishedAt?Date.parse(e.finishedAt):NaN).filter(e=>!Number.isNaN(e)),a=Date.parse(e.startedAt),i=n||0===r.length?s:Math.max(...r);return{ms:Number.isNaN(a)?0:Math.max(0,i-a),live:n,tasks:t.length}}function a(e){var t,s;let n=new Map;for(let s of e){if(!s.runGroup)continue;let e=null!=(t=n.get(s.runGroup.id))?t:{run:s.runGroup,tasks:[]};e.tasks.push(s),n.set(s.runGroup.id,e)}return null!=(s=[...n.values()].sort((e,t)=>Date.parse(t.run.startedAt)-Date.parse(e.run.startedAt))[0])?s:null}s.d(t,{DG:()=>l,d5:()=>n,eZ:()=>r,hH:()=>a})},4811:(e,t,s)=>{s.d(t,{p:()=>r});var n=s(1521),l=s(5549);function r(){let[e,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e=!0;return l.FH.settings().then(s=>{var n;let l=null!=(n=s.raw.execution)?n:{};e&&t("unattended"===l.mode)}).catch(()=>void 0),()=>{e=!1}},[]),e}},5132:(e,t,s)=>{s.d(t,{s:()=>i});var n=s(3365),l=s(1521);function r(e,t){let s,l=[],r=/(`[^`\n]+`)|(\*\*[^*\n]+\*\*)|(\*[^*\n]+\*)/g,a=0,i=0;for(;null!==(s=r.exec(e));){s.index>a&&l.push(e.slice(a,s.index));let r=s[0],o="".concat(t,"-i").concat(i+=1);r.startsWith("`")?l.push((0,n.jsx)("code",{children:r.slice(1,-1)},o)):r.startsWith("**")?l.push((0,n.jsx)("strong",{children:r.slice(2,-2)},o)):l.push((0,n.jsx)("em",{children:r.slice(1,-1)},o)),a=s.index+r.length}return a<e.length&&l.push(e.slice(a)),l}function a(e){let t=/^\s*[-*•]\s+(.*)$/.exec(e);if(t)return t[1];let s=/^\s*\d+[.)]\s+(.*)$/.exec(e);return s?s[1]:null}function i(e){let{text:t,className:s}=e,i=[],o=t.replace(/\r\n/g,"\n").split("\n"),c=0,d=0;for(;c<o.length;){let e=o[c];if(e.trim().startsWith("```")){let e=[];for(c+=1;c<o.length&&!o[c].trim().startsWith("```");)e.push(o[c++]);c+=1,e.length>0&&i.push((0,n.jsx)("pre",{children:e.join("\n")},"b".concat(d+=1)));continue}if(null!==a(e)){let e=[];for(;c<o.length&&null!==a(o[c]);)e.push(a(o[c++]));i.push((0,n.jsx)("ul",{children:e.map((e,t)=>(0,n.jsx)("li",{children:r(e,"b".concat(d,"-").concat(t))},t))},"b".concat(d+=1)));continue}if(""===e.trim()){c+=1;continue}let t=[];for(;c<o.length&&""!==o[c].trim()&&null===a(o[c])&&!o[c].trim().startsWith("```");)t.push(o[c++]);let s=d+=1;i.push((0,n.jsx)("p",{children:t.map((e,t)=>(0,n.jsxs)(l.Fragment,{children:[t>0&&(0,n.jsx)("br",{}),r(e,"b".concat(s,"-").concat(t))]},t))},"b".concat(s)))}return(0,n.jsx)("div",{className:"rich ".concat(null!=s?s:""),children:i})}}}]);
|