copilot-operator 0.1.41 → 0.1.43
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 +159 -6
- package/dist/src/api/operator.service.js +417 -10
- package/dist/src/api/server.js +16 -0
- package/dist/src/cli.js +12 -0
- package/dist/src/config/schema.js +17 -0
- package/dist/src/orchestrator/planMode.js +102 -0
- package/dist/src/orchestrator/review.js +8 -4
- package/dist/src/orchestrator/taskRunner.js +246 -40
- package/dist/src/plan/brief.js +69 -20
- package/dist/src/plan/changes.js +217 -0
- package/dist/src/plan/importPlan.js +2 -0
- package/dist/src/plan/schema.js +11 -1
- package/dist/src/plan/systemGuide.js +790 -14
- package/dist/src/protocol/parser.js +26 -2
- package/dist/src/protocol/replySchema.js +28 -4
- package/dist/src/session/compose.js +76 -7
- package/dist/src/session/exports.js +1 -0
- package/dist/src/session/model.js +38 -0
- package/dist/src/session/store.js +90 -3
- package/dist/src/vcs/startChoice.js +80 -8
- package/dist/src/vcs/taskVcs.js +126 -8
- package/dist/web/404.html +2 -2
- package/dist/web/_next/static/WmzBz4QN36pcz4PL_cfEW/_buildManifest.js +1 -0
- package/dist/web/_next/static/chunks/499-751e0be9d4f86e2d.js +1 -0
- package/dist/web/_next/static/chunks/549-2415dd26f4e53d07.js +1 -0
- package/dist/web/_next/static/chunks/699-9d031f8c145a0465.js +1 -0
- package/dist/web/_next/static/chunks/867-aea30f560bc18eaf.js +1 -0
- package/dist/web/_next/static/chunks/897-5a34109533c3da50.js +1 -0
- package/dist/web/_next/static/chunks/app/defaults/page-56134fbb8cc7554f.js +1 -0
- package/dist/web/_next/static/chunks/app/history/page-0bb537407fed5944.js +1 -0
- package/dist/web/_next/static/chunks/app/import/{page-999d6cd958989723.js → page-8ef75fc08638e75f.js} +1 -1
- package/dist/web/_next/static/chunks/app/layout-dc602b727480a653.js +1 -0
- package/dist/web/_next/static/chunks/app/page-d73a8ff300862cd8.js +1 -0
- package/dist/web/_next/static/chunks/app/{page-e557d58476ae6383.js → sessions/page-28376d2e4a9b4738.js} +1 -1
- package/dist/web/_next/static/chunks/app/sessions/view/page-afc235a9171535d8.js +1 -0
- package/dist/web/_next/static/css/{cea7913ba416dbb7.css → 72c85e4322c21223.css} +1 -1
- package/dist/web/appearance.html +2 -2
- package/dist/web/appearance.txt +25 -28
- package/dist/web/defaults.html +2 -2
- package/dist/web/defaults.txt +25 -28
- package/dist/web/history.html +2 -2
- package/dist/web/history.txt +25 -28
- package/dist/web/import.html +2 -2
- package/dist/web/import.txt +25 -28
- package/dist/web/index.html +2 -2
- package/dist/web/index.txt +25 -28
- package/dist/web/level1.html +2 -2
- package/dist/web/level1.txt +25 -28
- package/dist/web/presets.html +3 -3
- package/dist/web/presets.txt +25 -28
- package/dist/web/sessions/view.html +2 -2
- package/dist/web/sessions/view.txt +25 -28
- package/dist/web/sessions.html +16 -0
- package/dist/web/sessions.txt +26 -0
- package/dist/web/system.html +2 -2
- package/dist/web/system.txt +25 -28
- package/package.json +161 -158
- package/dist/web/_next/static/-htN5GTSrd3W3f5j_QC2y/_buildManifest.js +0 -1
- package/dist/web/_next/static/chunks/499-28e118e33ce07935.js +0 -1
- package/dist/web/_next/static/chunks/549-f295c8429e83b25b.js +0 -1
- package/dist/web/_next/static/chunks/584-578be94a0786334b.js +0 -1
- package/dist/web/_next/static/chunks/867-8dc5bbb092ca2c5c.js +0 -1
- package/dist/web/_next/static/chunks/app/defaults/page-879158e9e550eea7.js +0 -1
- package/dist/web/_next/static/chunks/app/history/page-9f69ccde726c9be2.js +0 -1
- package/dist/web/_next/static/chunks/app/layout-73f28bc065a46ed3.js +0 -1
- package/dist/web/_next/static/chunks/app/sessions/view/page-0485ee7f781156ec.js +0 -1
- /package/dist/web/_next/static/{-htN5GTSrd3W3f5j_QC2y → WmzBz4QN36pcz4PL_cfEW}/_ssgManifest.js +0 -0
package/dist/web/system.txt
CHANGED
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
1:"$Sreact.fragment"
|
|
2
|
-
2:I[8078,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-
|
|
3
|
-
3:I[867,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-
|
|
4
|
-
4:I[1035,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-
|
|
5
|
-
5:I[8214,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-
|
|
6
|
-
6:I[
|
|
7
|
-
7:I[
|
|
8
|
-
8:I[
|
|
9
|
-
9:I[
|
|
10
|
-
a:I[
|
|
11
|
-
b:I[
|
|
12
|
-
c:I[
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
:
|
|
23
|
-
|
|
24
|
-
10:
|
|
25
|
-
|
|
26
|
-
17:
|
|
27
|
-
13:null
|
|
28
|
-
15:{"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"}
|
|
29
|
-
1a:"$15:metadata"
|
|
2
|
+
2:I[8078,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-aea30f560bc18eaf.js","549","static/chunks/549-2415dd26f4e53d07.js","499","static/chunks/499-751e0be9d4f86e2d.js","177","static/chunks/app/layout-dc602b727480a653.js"],"AppearanceProvider"]
|
|
3
|
+
3:I[867,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-aea30f560bc18eaf.js","549","static/chunks/549-2415dd26f4e53d07.js","499","static/chunks/499-751e0be9d4f86e2d.js","177","static/chunks/app/layout-dc602b727480a653.js"],"LanguageProvider"]
|
|
4
|
+
4:I[1035,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-aea30f560bc18eaf.js","549","static/chunks/549-2415dd26f4e53d07.js","499","static/chunks/499-751e0be9d4f86e2d.js","177","static/chunks/app/layout-dc602b727480a653.js"],"DialogHost"]
|
|
5
|
+
5:I[8214,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-aea30f560bc18eaf.js","549","static/chunks/549-2415dd26f4e53d07.js","499","static/chunks/499-751e0be9d4f86e2d.js","177","static/chunks/app/layout-dc602b727480a653.js"],"SkipLink"]
|
|
6
|
+
6:I[966,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-aea30f560bc18eaf.js","549","static/chunks/549-2415dd26f4e53d07.js","499","static/chunks/499-751e0be9d4f86e2d.js","177","static/chunks/app/layout-dc602b727480a653.js"],"Shell"]
|
|
7
|
+
7:I[5204,[],""]
|
|
8
|
+
8:I[2642,[],""]
|
|
9
|
+
9:I[7712,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-aea30f560bc18eaf.js","549","static/chunks/549-2415dd26f4e53d07.js","499","static/chunks/499-751e0be9d4f86e2d.js","177","static/chunks/app/layout-dc602b727480a653.js"],"ScrollJump"]
|
|
10
|
+
a:I[1701,["197","static/chunks/197-f7c33a0114fc3db3.js","867","static/chunks/867-aea30f560bc18eaf.js","549","static/chunks/549-2415dd26f4e53d07.js","499","static/chunks/499-751e0be9d4f86e2d.js","177","static/chunks/app/layout-dc602b727480a653.js"],"StartDialogHost"]
|
|
11
|
+
b:I[7089,[],"ClientPageRoot"]
|
|
12
|
+
c:I[3134,["867","static/chunks/867-aea30f560bc18eaf.js","549","static/chunks/549-2415dd26f4e53d07.js","186","static/chunks/app/system/page-227a259e383ca2a0.js"],"default"]
|
|
13
|
+
f:I[433,[],"OutletBoundary"]
|
|
14
|
+
11:I[9884,[],"AsyncMetadataOutlet"]
|
|
15
|
+
13:I[433,[],"ViewportBoundary"]
|
|
16
|
+
15:I[433,[],"MetadataBoundary"]
|
|
17
|
+
16:"$Sreact.suspense"
|
|
18
|
+
18:I[3536,[],""]
|
|
19
|
+
:HL["/_next/static/css/72c85e4322c21223.css","style"]
|
|
20
|
+
0:{"P":null,"b":"WmzBz4QN36pcz4PL_cfEW","p":"","c":["","system"],"i":false,"f":[[["",{"children":["system",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/72c85e4322c21223.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,{}],["$","$L6",null,{"children":["$","$L7",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L8",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"}]}],["$","$L9",null,{}],["$","$La",null,{}]]}]}]}]}]]}]]}],{"children":["system",["$","$1","c",{"children":[null,["$","$L7",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L8",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$Lb",null,{"Component":"$c","searchParams":{},"params":{},"promises":["$@d","$@e"]}],null,["$","$Lf",null,{"children":["$L10",["$","$L11",null,{"promise":"$@12"}]]}]]}],{},null,false]},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$L13",null,{"children":"$L14"}],null],["$","$L15",null,{"children":["$","div",null,{"hidden":true,"children":["$","$16",null,{"fallback":null,"children":"$L17"}]}]}]]}],false]],"m":"$undefined","G":["$18",[]],"s":false,"S":true}
|
|
21
|
+
d:{}
|
|
22
|
+
e:"$0:f:0:1:2:children:2:children:1:props:children:0:props:params"
|
|
23
|
+
14:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
|
|
24
|
+
10:null
|
|
25
|
+
12:{"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"}
|
|
26
|
+
17:"$12:metadata"
|
package/package.json
CHANGED
|
@@ -1,158 +1,161 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "copilot-operator",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"private": false,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"description": "Automates a Microsoft 365 Copilot chat: sends prompts, extracts commands, runs them, reports back.",
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"engines": {
|
|
9
|
-
"node": ">=20"
|
|
10
|
-
},
|
|
11
|
-
"scripts": {
|
|
12
|
-
"build": "tsc -p tsconfig.json",
|
|
13
|
-
"build:package": "node scripts/build-package.mjs",
|
|
14
|
-
"prepack": "node scripts/build-package.mjs",
|
|
15
|
-
"check:pacing": "tsx test/pacing.check.ts",
|
|
16
|
-
"check:runner": "tsx test/runner.check.ts",
|
|
17
|
-
"check:chat": "tsx test/chat.check.ts",
|
|
18
|
-
"cop": "tsx src/cli.ts",
|
|
19
|
-
"check:parser": "tsx test/parser.check.ts",
|
|
20
|
-
"check:report": "tsx test/report.check.ts",
|
|
21
|
-
"check": "npm run check:suite && npm run check:parser && npm run check:damage && npm run check:session && npm run check:report && npm run check:runner && 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: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:settings-precedence && npm run check:review-evidence && npm run check:model-help && npm run check:continue && npm run check:startfrom && npm run check:startbranch && 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 && npm run check:e2e-vcs && npm run check:noattach && npm run check:guard && npm run check:gate && npm run check:e2e-batch && npm run check:e2e-review && npm run check:e2e-branches && npm run check:e2e-loop && npm run check:transport && npm run check:e2e-plan && npm run check:exec && npm run check:pins && npm run check:login && npm run check:order && npm run check:snapshot && npm run check:inputs && npm run check:e2e-inputs && npm run check:attempts && npm run check:finding-ids && npm run check:e2e-commit && npm run check:e2e-retry-inputs && npm run check:e2e-run-vcs && npm run check:prepare && npm run check:live-fixes",
|
|
22
|
-
"probe": "tsx scripts/probe-locators.ts",
|
|
23
|
-
"check:damage": "tsx test/damage.check.ts",
|
|
24
|
-
"api": "npm run build && node dist/src/api/main.js",
|
|
25
|
-
"api:start": "node dist/src/api/main.js",
|
|
26
|
-
"web": "npm run dev --workspace web",
|
|
27
|
-
"web:build": "npm run build --workspace web",
|
|
28
|
-
"check:session": "tsx test/session.check.ts",
|
|
29
|
-
"start": "node scripts/dev.mjs",
|
|
30
|
-
"dev": "node scripts/dev.mjs --open",
|
|
31
|
-
"check:vcs": "tsx test/vcs.check.ts",
|
|
32
|
-
"check:plan": "tsx test/plan.check.ts",
|
|
33
|
-
"check:checks": "tsx test/checks.check.ts",
|
|
34
|
-
"check:workdir": "tsx test/workdir.check.ts",
|
|
35
|
-
"check:processes": "tsx test/processes.check.ts",
|
|
36
|
-
"check:environment": "tsx test/environment.check.ts",
|
|
37
|
-
"check:clock": "tsx test/clock.check.ts",
|
|
38
|
-
"check:crash": "tsx test/crash.check.ts",
|
|
39
|
-
"check:clipboard": "tsx test/clipboard.check.ts",
|
|
40
|
-
"check:restart": "tsx test/restart.check.ts",
|
|
41
|
-
"check:review": "tsx test/review.check.ts",
|
|
42
|
-
"check:review-evidence": "tsx test/review-evidence.check.ts",
|
|
43
|
-
"check:settings-precedence": "tsx test/settings-precedence.check.ts",
|
|
44
|
-
"check:suite": "tsx test/suite.check.ts",
|
|
45
|
-
"check:model-help": "tsx test/model-help.check.ts",
|
|
46
|
-
"check:shells": "tsx test/shells.check.ts",
|
|
47
|
-
"check:save": "tsx test/save.check.ts",
|
|
48
|
-
"check:guide": "tsx test/guide.check.ts",
|
|
49
|
-
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json && npm run typecheck --workspace web",
|
|
50
|
-
"check:bundle": "tsx test/bundle.check.ts",
|
|
51
|
-
"check:runname": "tsx test/runname.check.ts",
|
|
52
|
-
"update": "node scripts/update.mjs",
|
|
53
|
-
"check:dangerous": "tsx test/dangerous.check.ts",
|
|
54
|
-
"check:programs": "tsx test/programs.check.ts",
|
|
55
|
-
"check:manifest": "tsx test/manifest.check.ts",
|
|
56
|
-
"check:lock": "tsx test/lock.check.ts",
|
|
57
|
-
"check:isolation": "tsx test/isolation.check.ts",
|
|
58
|
-
"check:security": "tsx test/security.check.ts",
|
|
59
|
-
"check:update": "tsx test/update.check.ts",
|
|
60
|
-
"check:persona": "tsx test/persona.check.ts",
|
|
61
|
-
"check:script": "tsx test/script.check.ts",
|
|
62
|
-
"check:batch": "tsx test/batch.check.ts",
|
|
63
|
-
"check:confinement": "tsx test/confinement.check.ts",
|
|
64
|
-
"check:network": "tsx test/network.check.ts",
|
|
65
|
-
"check:hardening": "tsx test/hardening.check.ts",
|
|
66
|
-
"check:package": "tsx test/package.check.ts",
|
|
67
|
-
"check:models": "tsx test/models.check.ts",
|
|
68
|
-
"check:continue": "tsx test/continue.check.ts",
|
|
69
|
-
"check:startfrom": "tsx test/startfrom.check.ts",
|
|
70
|
-
"check:diff": "tsx test/diff.check.ts",
|
|
71
|
-
"check:integrity": "tsx test/integrity.check.ts",
|
|
72
|
-
"check:scope": "tsx test/scope.check.ts",
|
|
73
|
-
"check:progress": "tsx test/progress.check.ts",
|
|
74
|
-
"check:metrics": "tsx test/metrics.check.ts",
|
|
75
|
-
"check:modelpicker": "tsx test/modelpicker.check.ts",
|
|
76
|
-
"check:formatrepair": "tsx test/formatrepair.check.ts",
|
|
77
|
-
"check:intent": "tsx test/intent.check.ts",
|
|
78
|
-
"check:sync": "tsx test/sync.check.ts",
|
|
79
|
-
"check:prepare": "tsx test/prepare.check.ts",
|
|
80
|
-
"check:live-fixes": "tsx test/live-fixes.check.ts",
|
|
81
|
-
"check:live-models": "tsx test/live-models.check.ts",
|
|
82
|
-
"check:live-chat": "tsx test/live-chatname.check.ts",
|
|
83
|
-
"check:e2e-run": "tsx test/e2e-run.check.ts",
|
|
84
|
-
"check:e2e-continue": "tsx test/e2e-continue.check.ts",
|
|
85
|
-
"check:e2e-
|
|
86
|
-
"check:
|
|
87
|
-
"check:
|
|
88
|
-
"check:e2e-
|
|
89
|
-
"check:
|
|
90
|
-
"check:
|
|
91
|
-
"check:
|
|
92
|
-
"check:
|
|
93
|
-
"check:
|
|
94
|
-
"check:
|
|
95
|
-
"check:e2e-
|
|
96
|
-
"check:
|
|
97
|
-
"check:e2e-
|
|
98
|
-
"check:
|
|
99
|
-
"check:
|
|
100
|
-
"check:
|
|
101
|
-
"check:
|
|
102
|
-
"check:
|
|
103
|
-
"check:
|
|
104
|
-
"check:
|
|
105
|
-
"check:
|
|
106
|
-
"check:
|
|
107
|
-
"check:
|
|
108
|
-
"check:
|
|
109
|
-
"check:e2e-
|
|
110
|
-
"check:
|
|
111
|
-
"check:
|
|
112
|
-
"check:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
"
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
"
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
"
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
"
|
|
137
|
-
},
|
|
138
|
-
"
|
|
139
|
-
"dist/src"
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
"
|
|
143
|
-
"
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
"
|
|
147
|
-
],
|
|
148
|
-
"
|
|
149
|
-
"
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
"
|
|
153
|
-
"
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
"
|
|
157
|
-
]
|
|
158
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "copilot-operator",
|
|
3
|
+
"version": "0.1.43",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Automates a Microsoft 365 Copilot chat: sends prompts, extracts commands, runs them, reports back.",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=20"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc -p tsconfig.json",
|
|
13
|
+
"build:package": "node scripts/build-package.mjs",
|
|
14
|
+
"prepack": "node scripts/build-package.mjs",
|
|
15
|
+
"check:pacing": "tsx test/pacing.check.ts",
|
|
16
|
+
"check:runner": "tsx test/runner.check.ts",
|
|
17
|
+
"check:chat": "tsx test/chat.check.ts",
|
|
18
|
+
"cop": "tsx src/cli.ts",
|
|
19
|
+
"check:parser": "tsx test/parser.check.ts",
|
|
20
|
+
"check:report": "tsx test/report.check.ts",
|
|
21
|
+
"check": "npm run check:suite && npm run check:parser && npm run check:damage && npm run check:session && npm run check:report && npm run check:runner && 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: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:settings-precedence && npm run check:review-evidence && npm run check:model-help && npm run check:continue && npm run check:startfrom && npm run check:startbranch && 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-planmode && npm run check:e2e-undo && npm run check:e2e-kerrigan && npm run check:e2e-interrupt && npm run check:e2e-vcs && npm run check:noattach && npm run check:guard && npm run check:gate && npm run check:e2e-batch && npm run check:e2e-review && npm run check:e2e-branches && npm run check:e2e-loop && npm run check:transport && npm run check:e2e-plan && npm run check:exec && npm run check:pins && npm run check:login && npm run check:order && npm run check:snapshot && npm run check:inputs && npm run check:e2e-inputs && npm run check:attempts && npm run check:finding-ids && npm run check:e2e-commit && npm run check:e2e-retry-inputs && npm run check:e2e-run-vcs && npm run check:prepare && npm run check:live-fixes",
|
|
22
|
+
"probe": "tsx scripts/probe-locators.ts",
|
|
23
|
+
"check:damage": "tsx test/damage.check.ts",
|
|
24
|
+
"api": "npm run build && node dist/src/api/main.js",
|
|
25
|
+
"api:start": "node dist/src/api/main.js",
|
|
26
|
+
"web": "npm run dev --workspace web",
|
|
27
|
+
"web:build": "npm run build --workspace web",
|
|
28
|
+
"check:session": "tsx test/session.check.ts",
|
|
29
|
+
"start": "node scripts/dev.mjs",
|
|
30
|
+
"dev": "node scripts/dev.mjs --open",
|
|
31
|
+
"check:vcs": "tsx test/vcs.check.ts",
|
|
32
|
+
"check:plan": "tsx test/plan.check.ts",
|
|
33
|
+
"check:checks": "tsx test/checks.check.ts",
|
|
34
|
+
"check:workdir": "tsx test/workdir.check.ts",
|
|
35
|
+
"check:processes": "tsx test/processes.check.ts",
|
|
36
|
+
"check:environment": "tsx test/environment.check.ts",
|
|
37
|
+
"check:clock": "tsx test/clock.check.ts",
|
|
38
|
+
"check:crash": "tsx test/crash.check.ts",
|
|
39
|
+
"check:clipboard": "tsx test/clipboard.check.ts",
|
|
40
|
+
"check:restart": "tsx test/restart.check.ts",
|
|
41
|
+
"check:review": "tsx test/review.check.ts",
|
|
42
|
+
"check:review-evidence": "tsx test/review-evidence.check.ts",
|
|
43
|
+
"check:settings-precedence": "tsx test/settings-precedence.check.ts",
|
|
44
|
+
"check:suite": "tsx test/suite.check.ts",
|
|
45
|
+
"check:model-help": "tsx test/model-help.check.ts",
|
|
46
|
+
"check:shells": "tsx test/shells.check.ts",
|
|
47
|
+
"check:save": "tsx test/save.check.ts",
|
|
48
|
+
"check:guide": "tsx test/guide.check.ts",
|
|
49
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json && npm run typecheck --workspace web",
|
|
50
|
+
"check:bundle": "tsx test/bundle.check.ts",
|
|
51
|
+
"check:runname": "tsx test/runname.check.ts",
|
|
52
|
+
"update": "node scripts/update.mjs",
|
|
53
|
+
"check:dangerous": "tsx test/dangerous.check.ts",
|
|
54
|
+
"check:programs": "tsx test/programs.check.ts",
|
|
55
|
+
"check:manifest": "tsx test/manifest.check.ts",
|
|
56
|
+
"check:lock": "tsx test/lock.check.ts",
|
|
57
|
+
"check:isolation": "tsx test/isolation.check.ts",
|
|
58
|
+
"check:security": "tsx test/security.check.ts",
|
|
59
|
+
"check:update": "tsx test/update.check.ts",
|
|
60
|
+
"check:persona": "tsx test/persona.check.ts",
|
|
61
|
+
"check:script": "tsx test/script.check.ts",
|
|
62
|
+
"check:batch": "tsx test/batch.check.ts",
|
|
63
|
+
"check:confinement": "tsx test/confinement.check.ts",
|
|
64
|
+
"check:network": "tsx test/network.check.ts",
|
|
65
|
+
"check:hardening": "tsx test/hardening.check.ts",
|
|
66
|
+
"check:package": "tsx test/package.check.ts",
|
|
67
|
+
"check:models": "tsx test/models.check.ts",
|
|
68
|
+
"check:continue": "tsx test/continue.check.ts",
|
|
69
|
+
"check:startfrom": "tsx test/startfrom.check.ts",
|
|
70
|
+
"check:diff": "tsx test/diff.check.ts",
|
|
71
|
+
"check:integrity": "tsx test/integrity.check.ts",
|
|
72
|
+
"check:scope": "tsx test/scope.check.ts",
|
|
73
|
+
"check:progress": "tsx test/progress.check.ts",
|
|
74
|
+
"check:metrics": "tsx test/metrics.check.ts",
|
|
75
|
+
"check:modelpicker": "tsx test/modelpicker.check.ts",
|
|
76
|
+
"check:formatrepair": "tsx test/formatrepair.check.ts",
|
|
77
|
+
"check:intent": "tsx test/intent.check.ts",
|
|
78
|
+
"check:sync": "tsx test/sync.check.ts",
|
|
79
|
+
"check:prepare": "tsx test/prepare.check.ts",
|
|
80
|
+
"check:live-fixes": "tsx test/live-fixes.check.ts",
|
|
81
|
+
"check:live-models": "tsx test/live-models.check.ts",
|
|
82
|
+
"check:live-chat": "tsx test/live-chatname.check.ts",
|
|
83
|
+
"check:e2e-run": "tsx test/e2e-run.check.ts",
|
|
84
|
+
"check:e2e-continue": "tsx test/e2e-continue.check.ts",
|
|
85
|
+
"check:e2e-planmode": "tsx test/e2e-planmode.check.ts",
|
|
86
|
+
"check:e2e-undo": "tsx test/e2e-undo.check.ts",
|
|
87
|
+
"check:e2e-kerrigan": "tsx test/e2e-kerrigan.check.ts",
|
|
88
|
+
"check:e2e-interrupt": "tsx test/e2e-interrupt.check.ts",
|
|
89
|
+
"check:ui": "node scripts/build-package.mjs && tsx test/ui.check.ts && tsx test/ui-flows.check.ts",
|
|
90
|
+
"check:all": "npm run check && npm run check:ui && npm run check:release",
|
|
91
|
+
"check:e2e-vcs": "tsx test/e2e-vcs.check.ts",
|
|
92
|
+
"check:noattach": "tsx test/noattach.check.ts",
|
|
93
|
+
"check:guard": "tsx test/guard.check.ts",
|
|
94
|
+
"check:gate": "tsx test/gate.check.ts",
|
|
95
|
+
"check:e2e-batch": "tsx test/e2e-batch.check.ts",
|
|
96
|
+
"check:e2e-review": "tsx test/e2e-review.check.ts",
|
|
97
|
+
"check:e2e-branches": "tsx test/e2e-branches.check.ts",
|
|
98
|
+
"check:e2e-loop": "tsx test/e2e-loop.check.ts",
|
|
99
|
+
"check:transport": "tsx test/transport.check.ts",
|
|
100
|
+
"check:e2e-plan": "tsx test/e2e-plan.check.ts",
|
|
101
|
+
"check:exec": "tsx test/exec.check.ts",
|
|
102
|
+
"check:pins": "tsx test/pins.check.ts",
|
|
103
|
+
"check:release": "tsx test/release.check.ts",
|
|
104
|
+
"check:ui-flows": "tsx test/ui-flows.check.ts",
|
|
105
|
+
"check:login": "tsx test/login.check.ts",
|
|
106
|
+
"check:order": "tsx test/order.check.ts",
|
|
107
|
+
"check:snapshot": "tsx test/snapshot.check.ts",
|
|
108
|
+
"check:inputs": "tsx test/inputs.check.ts",
|
|
109
|
+
"check:e2e-inputs": "tsx test/e2e-inputs.check.ts",
|
|
110
|
+
"check:attempts": "tsx test/attempts.check.ts",
|
|
111
|
+
"check:finding-ids": "tsx test/finding-ids.check.ts",
|
|
112
|
+
"check:e2e-commit": "tsx test/e2e-commit.check.ts",
|
|
113
|
+
"check:e2e-retry-inputs": "tsx test/e2e-retry-inputs.check.ts",
|
|
114
|
+
"check:e2e-run-vcs": "tsx test/e2e-run-vcs.check.ts",
|
|
115
|
+
"check:startbranch": "tsx test/startbranch.check.ts"
|
|
116
|
+
},
|
|
117
|
+
"dependencies": {
|
|
118
|
+
"@nestjs/common": "^12.0.3",
|
|
119
|
+
"@nestjs/core": "^12.0.3",
|
|
120
|
+
"@nestjs/platform-express": "^12.0.3",
|
|
121
|
+
"commander": "^15.0.0",
|
|
122
|
+
"playwright": "^1.63.0",
|
|
123
|
+
"reflect-metadata": "^0.2.2",
|
|
124
|
+
"rxjs": "^7.8.2",
|
|
125
|
+
"yaml": "^2.9.1",
|
|
126
|
+
"zod": "^4.6.5"
|
|
127
|
+
},
|
|
128
|
+
"devDependencies": {
|
|
129
|
+
"@types/express": "^5.0.6",
|
|
130
|
+
"@types/node": "^22.10.2",
|
|
131
|
+
"tsx": "^4.19.2",
|
|
132
|
+
"typescript": "5.9"
|
|
133
|
+
},
|
|
134
|
+
"repository": {
|
|
135
|
+
"type": "git",
|
|
136
|
+
"url": "git+https://github.com/ivan-markov-666/copilot-operator.git"
|
|
137
|
+
},
|
|
138
|
+
"bin": {
|
|
139
|
+
"cop": "dist/src/cli.js"
|
|
140
|
+
},
|
|
141
|
+
"files": [
|
|
142
|
+
"dist/src",
|
|
143
|
+
"dist/web",
|
|
144
|
+
"prompts",
|
|
145
|
+
"README.md",
|
|
146
|
+
"LICENSE"
|
|
147
|
+
],
|
|
148
|
+
"os": [
|
|
149
|
+
"win32"
|
|
150
|
+
],
|
|
151
|
+
"keywords": [
|
|
152
|
+
"copilot",
|
|
153
|
+
"microsoft-365",
|
|
154
|
+
"automation",
|
|
155
|
+
"playwright",
|
|
156
|
+
"agent"
|
|
157
|
+
],
|
|
158
|
+
"workspaces": [
|
|
159
|
+
"web"
|
|
160
|
+
]
|
|
161
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(e,r,t){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},__routerFilterStatic:{numItems:10,errorRate:1e-4,numBits:192,numHashes:14,bitArray:[1,1,0,0,e,r,e,r,e,r,e,e,r,e,r,r,r,r,r,r,e,e,r,e,r,e,e,e,e,r,r,r,e,r,e,e,r,r,e,e,e,e,e,r,e,r,r,e,r,r,r,r,e,e,r,r,r,e,e,e,r,e,r,e,e,e,e,r,e,e,e,e,e,r,e,e,e,r,e,e,e,e,e,e,r,e,r,e,e,e,r,r,r,e,e,r,r,r,e,r,e,e,e,r,r,e,r,r,e,e,r,e,r,e,e,e,r,r,e,e,e,e,r,r,e,e,r,r,r,r,e,r,r,r,r,e,r,r,e,r,e,r,r,e,r,r,r,e,r,e,r,r,e,e,e,e,e,e,e,e,r,r,r,r,r,e,r,e,r,e,e,r,r,r,r,r,e,r,e,e,r,r,e,r,e,e,e,e,r,r,e,e]},__routerFilterDynamic:{numItems:r,errorRate:1e-4,numBits:r,numHashes:null,bitArray:[]},"/_error":["static/chunks/pages/_error-abbab53f25ea29b0.js"],sortedPages:["/_app","/_error"]}}(1,0,1e-4),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[499],{1035:(e,l,s)=>{s.d(l,{DialogHost:()=>d,Z:()=>c});var t=s(3365),n=s(1521),a=s(867),r=s(4969);let i=null,o=[];function c(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(s=>{var t;return t={kind:"confirm",message:e,...l,resolve:s},void(i?i(t):o.push(t))})}function d(e){var l,s;let{children:c}=e,{t:d}=(0,a.kj)(),[h,u]=(0,n.useState)([]),m=(0,n.useRef)(null),p=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(i=e=>u(l=>[...l,e]),o.length>0){let e=o.splice(0,o.length);u(l=>[...l,...e])}return()=>{i=null}},[]);let g=h[0],x=(0,n.useCallback)(e=>{g&&(g.resolve(e),u(e=>e.slice(1)))},[g]);return(0,r.V)(p,!!g,m),(0,n.useEffect)(()=>{if(!g)return;let e=e=>{"Escape"===e.key&&(e.preventDefault(),x(!1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[g,x]),(0,t.jsxs)(t.Fragment,{children:[c,g&&(0,t.jsx)("div",{className:"modal-backdrop",onClick:()=>x(!1),role:"presentation",children:(0,t.jsxs)("div",{ref:p,className:"modal".concat(g.danger?" danger":""),role:"confirm"===g.kind?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":"modal-title","aria-describedby":"modal-body",onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("h2",{id:"modal-title",children:null!=(l=g.title)?l:d("confirm"===g.kind?"dialog.confirmTitle":"dialog.noticeTitle")}),(0,t.jsx)("div",{id:"modal-body",className:"modal-body",children:g.message}),(0,t.jsxs)("div",{className:"row modal-actions",children:["confirm"===g.kind&&(0,t.jsx)("button",{type:"button",className:"quiet",onClick:()=>x(!1),children:d("dialog.cancel")}),(0,t.jsx)("button",{ref:m,type:"button",className:g.danger?"danger":"primary",onClick:()=>x(!0),children:null!=(s=g.okLabel)?s:d("dialog.ok")})]})]})})]})}},1701:(e,l,s)=>{s.d(l,{L:()=>m,StartDialogHost:()=>p});var t=s(3365),n=s(1521),a=s(5549),r=s(867),i=s(4969),o=s(3486),c=s(3069);let d=null,h=[],u=1;function m(e){return new Promise(l=>{let s={...e,id:u++,resolve:l};d?d(s):h.push(s)})}function p(){let[e,l]=(0,n.useState)([]);(0,n.useEffect)(()=>{if(d=e=>l(l=>[...l,e]),h.length>0){let e=h.splice(0,h.length);l(l=>[...l,...e])}return()=>{d=null}},[]);let s=e[0];return s?(0,t.jsx)(x,{req:s,onDone:e=>{s.resolve(e),l(e=>e.slice(1))}},s.id):null}let g=e=>e.trim().replace(/[\\/]+$/,"").replace(/\//g,"\\").toLowerCase();function x(e){var l,s,d,h,u;let{req:m,onDone:p}=e,{t:x}=(0,r.kj)(),f=(0,r.W3)(),j=(0,n.useId)(),v=(0,n.useRef)(null),b=(0,n.useRef)(null),[y,k]=(0,n.useState)(null),[w,N]=(0,n.useState)(""),[F,C]=(0,n.useState)({}),[B,S]=(0,n.useState)({}),[D,E]=(0,n.useState)({kind:"choose"}),[T,H]=(0,n.useState)(""),[W,I]=(0,n.useState)(""),[L,R]=(0,n.useState)({}),[A,O]=(0,n.useState)([]),[P,q]=(0,n.useState)(!1),z=(0,n.useRef)(new Set),V=(0,n.useRef)(void 0),K=e=>p({started:e,...V.current?{reply:V.current}:{}}),U="fetching"===D.kind||"starting"===D.kind||""!==W,_=()=>a.FH.startOptions(m.sessionIds).then(e=>{k(e);let l={};for(let s of e.repos)l[g(s.repoDir)]=s;C(l);let s={};for(let t of e.sessions){if(!t.vcs||t.fixed||!t.repoDir)continue;let e=function(e,l){var s,t,n,a,r,i,o;let c=null!=(r=null!=(a=null==l||null==(s=l.remotes.find(e=>"origin"===e.name))?void 0:s.name)?a:null==l||null==(t=l.remotes[0])?void 0:t.name)?r:"",d=null!=(o=null!=(i=null==l?void 0:l.current)?i:null==l||null==(n=l.local[0])?void 0:n.name)?o:"main";return e?"previous-session"===e.from?{from:"previous-session",local:d,remote:c,remoteBranch:d,onBranch:!1}:"local"===e.from?{from:"local",local:e.branch,remote:c,remoteBranch:e.branch,onBranch:!!e.onBranch}:{from:"remote",local:(null==l?void 0:l.local.some(l=>l.name===e.branch))?e.branch:d,remote:e.remote,remoteBranch:e.branch,onBranch:!!e.onBranch}:{from:"local",local:d,remote:c,remoteBranch:"main",onBranch:!1}}(t.choice,l[g(t.repoDir)]);s[t.id]=t.prepared?{...e,from:"keep"}:e}S(s)}).catch(e=>N(e.message));(0,n.useEffect)(()=>{_()},[m.sessionIds]),(0,i.V)(v,!0,b),(0,n.useEffect)(()=>{let e=e=>{"Escape"===e.key&&!e.defaultPrevented&&(e.preventDefault(),U||K(!1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[U,K]);let X=e=>e?F[g(e)]:void 0,J=(e,l)=>S(s=>({...s,[e]:{...s[e],...l}})),M=e=>{e&&C(l=>({...l,[g(e.repoDir)]:e}))},Z=()=>{a.FH.runVcs(m.sessionIds).then(O).catch(()=>O([]))},$=()=>{z.current.clear(),E({kind:"choose"})},G=async function(){var e;let l,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};H("");let t=(()=>{var e,l;let s={},t=new Map;for(let n of null!=(e=null==y?void 0:y.sessions)?e:[]){let e=B[n.id],a=X(n.repoDir);if(e&&n.repoDir&&a&&!a.problem&&"keep"!==e.from)if("previous-session"===e.from)s[n.id]={from:"previous-session"};else if("local"===e.from){if(!e.local||!a.local.some(l=>l.name===e.local))return{problem:x("startdlg.needBranch",{name:n.name})};s[n.id]={from:"local",branch:e.local,...e.onBranch?{onBranch:!0}:{}}}else{let r=e.remoteBranch.trim();if(!e.remote||!r)return{problem:x("startdlg.needBranch",{name:n.name})};s[n.id]={from:"remote",remote:e.remote,branch:r,...e.onBranch?{onBranch:!0}:{}};let i="".concat(g(n.repoDir),"|").concat(e.remote),o=null!=(l=t.get(i))?l:{key:i,dir:a.repoDir,remote:e.remote,branches:[]};o.branches.includes(r)||o.branches.push(r),t.set(i,o)}}return{starts:s,groups:[...t.values()].map(e=>({...e,key:"".concat(e.key,"|").concat([...e.branches].sort().join(","))}))}})();if("problem"in t)return void H(t.problem);if(!s.skipFetch)for(let e of t.groups){if(z.current.has(e.key))continue;E({kind:"fetching",what:e.branches.map(l=>"".concat(e.remote,"/").concat(l)).join(", ")});let l=await a.FH.startFetch(e.dir,e.remote,e.branches).catch(e=>({ok:!1,problem:e.message,missing:[]}));if(M(l.repo),!l.ok)return void E({kind:"fetchFailed",group:e,result:l})}E({kind:"starting"});try{l=await m.start(t.starts)}catch(e){l={started:!1,reason:e.message}}if(V.current=l,l.started)return void K(!0);E({kind:"failed",reply:l}),(null==(e=l.failure)?void 0:e.stage)==="preflight"&&Z()},Q=async(e,l)=>{I("".concat(g(e),"|").concat(l)),R(s=>({...s,[g(e)]:x("startdlg.fetching",{what:l})}));try{let s=await a.FH.startFetch(e,l);M(s.repo),R(t=>{var n,a,r,i;return{...t,[g(e)]:s.ok?"":"".concat(x("startdlg.fetchFailed",{what:l})," ").concat(null!=(i=null!=(r=s.problem)?r:null==(n=s.fetched)?void 0:n.detail)?i:"").concat((null==(a=s.fetched)?void 0:a.auth)?" ".concat(x("prep.fetchAuth")):"")}})}catch(l){R(s=>({...s,[g(e)]:l.message}))}finally{I("")}},Y=async e=>{try{await navigator.clipboard.writeText(e),q(!0),window.setTimeout(()=>q(!1),2500)}catch(e){H(x("plan.copyFailed"))}},ee=Object.values(B).some(e=>"remote"===e.from),el="unattended"===m.mode?x("startdlg.goUnattended"):x("startdlg.goStep");return(0,t.jsx)("div",{className:"modal-backdrop",role:"presentation",onClick:()=>!U&&K(!1),children:(0,t.jsxs)("div",{ref:v,className:"modal wide start-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"".concat(j,"-title"),onClick:e=>e.stopPropagation(),style:{overflowWrap:"anywhere"},children:[(0,t.jsx)("h2",{id:"".concat(j,"-title"),children:x("startdlg.title")}),(0,t.jsx)("p",{className:"small muted",style:{marginTop:0},children:x("startdlg.intro")}),w&&(0,t.jsx)(c.X,{reason:w}),!y&&!w&&(0,t.jsx)("p",{className:"small",role:"status",children:x("startdlg.loading")}),y&&("choose"===D.kind||"fetching"===D.kind||"starting"===D.kind)&&y.sessions.map(e=>{var l,s,n,a;let r=X(e.repoDir),i=B[e.id],o="start-".concat(j,"-").concat(e.id),c=null!=(s=null==r||null==(l=r.remotes.find(e=>e.name===(null==i?void 0:i.remote)))?void 0:l.branches)?s:[];return(0,t.jsxs)("fieldset",{className:"option",style:{border:"1px solid var(--line)",borderRadius:"var(--radius)",padding:"8px 12px",margin:"10px 0"},children:[(0,t.jsx)("legend",{style:{padding:"0 4px"},children:(0,t.jsx)("strong",{children:e.name})}),e.repoDir&&(0,t.jsx)("p",{className:"muted small",style:{margin:"2px 0 6px"},children:x("startdlg.repoOn",{repo:e.repoDir,branch:null!=(n=null==r?void 0:r.current)?n:"HEAD"})}),e.vcs?e.fixed?(0,t.jsx)("p",{className:"small",children:x("startdlg.fixed",{start:e.fixed})}):r&&!r.problem&&i?(0,t.jsxs)(t.Fragment,{children:[e.prepared&&(0,t.jsxs)("div",{className:"option",children:[(0,t.jsxs)("label",{children:[(0,t.jsx)("input",{type:"radio",name:o,checked:"keep"===i.from,onChange:()=>J(e.id,{from:"keep"}),disabled:U}),(0,t.jsx)("span",{children:x("startdlg.keep")})]}),(0,t.jsx)("p",{className:"why",children:x("startdlg.prepared",{start:e.prepared})})]}),(0,t.jsxs)("div",{className:"option",children:[(0,t.jsxs)("label",{children:[(0,t.jsx)("input",{type:"radio",name:o,checked:"local"===i.from,onChange:()=>J(e.id,{from:"local"}),disabled:U}),(0,t.jsx)("span",{children:x("startdlg.local")})]}),(0,t.jsx)("div",{className:"row",style:{marginTop:4},children:(0,t.jsxs)("select",{"aria-label":x("startdlg.localBranch"),value:i.local,onChange:l=>J(e.id,{from:"local",local:l.target.value}),disabled:U,style:{width:"auto",minWidth:240,maxWidth:"100%"},children:[!r.local.some(e=>e.name===i.local)&&(0,t.jsx)("option",{value:i.local,children:i.local}),r.local.map(e=>(0,t.jsxs)("option",{value:e.name,children:[e.name," \xb7 ",e.commit.slice(0,8)]},e.name))]})}),(0,t.jsx)("p",{className:"why",children:x("startdlg.localWhy")})]}),(0,t.jsxs)("div",{className:"option",children:[(0,t.jsxs)("label",{children:[(0,t.jsx)("input",{type:"radio",name:o,checked:"remote"===i.from,onChange:()=>J(e.id,{from:"remote"}),disabled:U||0===r.remotes.length}),(0,t.jsx)("span",{children:x("startdlg.remote")})]}),0===r.remotes.length?(0,t.jsx)("p",{className:"muted small",children:x("startdlg.noRemote")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"row",style:{marginTop:4},children:[r.remotes.length>1&&(0,t.jsx)("select",{"aria-label":x("startdlg.remoteName"),value:i.remote,onChange:l=>J(e.id,{from:"remote",remote:l.target.value}),disabled:U,style:{width:"auto"},children:r.remotes.map(e=>(0,t.jsx)("option",{value:e.name,children:e.name},e.name))}),1===r.remotes.length&&(0,t.jsxs)("code",{children:[i.remote,"/"]}),(0,t.jsx)("input",{type:"text","aria-label":x("startdlg.remoteBranch"),list:"".concat(o,"-remote"),value:i.remoteBranch,onChange:l=>J(e.id,{from:"remote",remoteBranch:l.target.value}),onFocus:()=>"remote"!==i.from&&J(e.id,{from:"remote"}),disabled:U,style:{width:"auto",minWidth:240,flex:"1 1 240px"},placeholder:"main"}),(0,t.jsx)("datalist",{id:"".concat(o,"-remote"),children:c.map(e=>(0,t.jsx)("option",{value:e.name},e.name))}),(0,t.jsx)("button",{type:"button",onClick:()=>void Q(r.repoDir,i.remote),disabled:U||!i.remote,children:x("startdlg.refreshRemote")})]}),(0,t.jsx)("p",{className:"why",children:x("startdlg.remoteWhy")}),(0,t.jsx)("p",{className:"muted small",style:{margin:"2px 0"},children:r.lastFetched?x("startdlg.lastFetched",{when:f(r.lastFetched)}):c.length>0?x("startdlg.lastFetchedUnknown"):x("startdlg.neverFetched")}),L[g(r.repoDir)]&&(0,t.jsx)("p",{className:"small",role:"status",children:L[g(r.repoDir)]})]})]}),e.previousOffered&&(0,t.jsxs)("div",{className:"option",children:[(0,t.jsxs)("label",{children:[(0,t.jsx)("input",{type:"radio",name:o,checked:"previous-session"===i.from,onChange:()=>J(e.id,{from:"previous-session"}),disabled:U}),(0,t.jsx)("span",{children:x("startdlg.previous")})]}),(0,t.jsx)("p",{className:"why",children:x("startdlg.previousWhy")})]}),(0,t.jsxs)("div",{className:"option",children:[(0,t.jsxs)("label",{children:[(0,t.jsx)("input",{type:"checkbox",checked:i.onBranch&&("local"===i.from||"remote"===i.from),onChange:l=>J(e.id,{onBranch:l.target.checked}),disabled:U||"local"!==i.from&&"remote"!==i.from}),(0,t.jsx)("span",{children:x("startdlg.onBranch")})]}),(0,t.jsx)("p",{className:"why",children:x("startdlg.onBranchWhy")})]})]}):(0,t.jsx)("p",{className:"err small",children:x("startdlg.repoProblem",{problem:null!=(a=null==r?void 0:r.problem)?a:""})}):(0,t.jsx)("p",{className:"small",children:x("startdlg.vcsOff")})]},e.id)}),"fetching"===D.kind&&(0,t.jsx)("p",{className:"notice small",role:"status",children:x("startdlg.fetching",{what:D.what})}),"starting"===D.kind&&(0,t.jsx)("p",{className:"notice small",role:"status",children:x("startdlg.starting")}),"fetchFailed"===D.kind&&(0,t.jsxs)("div",{className:"notice caution",role:"alert",children:[(0,t.jsxs)("p",{style:{marginTop:0},children:[(0,t.jsx)("strong",{children:x("startdlg.fetchFailed",{what:D.group.branches.map(e=>"".concat(D.group.remote,"/").concat(e)).join(", ")})})," ",(0,t.jsx)("code",{children:null!=(u=null!=(h=D.result.problem)?h:null==(l=D.result.fetched)?void 0:l.detail)?u:""})]}),D.result.missing.length>0&&(0,t.jsx)("p",{className:"small",children:x("startdlg.missing",{names:D.result.missing.join(", ")})}),(null==(s=D.result.fetched)?void 0:s.auth)&&(0,t.jsx)("p",{className:"small",children:x("prep.fetchAuth")}),(0,t.jsxs)("div",{className:"row",children:[(0,t.jsx)("button",{type:"button",className:"primary",onClick:()=>void G(),children:x("startdlg.retryFetch")}),(()=>{var e,l;let s=X(D.group.dir),n=null!=(l=null==s||null==(e=s.remotes.find(e=>e.name===D.group.remote))?void 0:e.branches)?l:[];return D.group.branches.every(e=>n.some(l=>l.name===e))?(0,t.jsx)("button",{type:"button",onClick:()=>{z.current.add(D.group.key),G()},children:x("startdlg.useFetched")}):null})(),(0,t.jsx)("button",{type:"button",className:"quiet",onClick:$,children:x("startdlg.back")})]}),(()=>{var e,l;let s=X(D.group.dir),n=null!=(l=null==s||null==(e=s.remotes.find(e=>e.name===D.group.remote))?void 0:e.branches)?l:[],a=D.group.branches.filter(e=>!n.some(l=>l.name===e));return a.length>0?(0,t.jsx)("p",{className:"muted small",children:x("startdlg.useFetchedNo",{what:a.map(e=>"".concat(D.group.remote,"/").concat(e)).join(", ")})}):D.result.lastFetched?(0,t.jsx)("p",{className:"muted small",children:x("prep.lastFetched",{when:f(D.result.lastFetched)})}):null})(),D.result.fetchCommand&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"small",style:{marginTop:8},children:x("prep.ownTerminal")}),(0,t.jsx)("pre",{className:"sync-cmd",children:D.result.fetchCommand}),(0,t.jsxs)("div",{className:"row",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{var e;Y(null!=(e=D.result.fetchCommand)?e:"")},children:x("prep.copyFetch")}),P&&(0,t.jsx)("span",{className:"badge done",children:x("prep.copied")})]})]})]}),"failed"===D.kind&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.X,{failure:D.reply.failure,reason:D.reply.reason}),(null==(d=D.reply.failure)?void 0:d.stage)==="preflight"&&A.some(e=>!e.ready)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"small",children:x("startdlg.vcsFix")}),(0,t.jsx)(o.w,{groups:A,sessionIds:m.sessionIds,onChange:()=>{Z(),_()}})]})]}),T&&(0,t.jsx)("p",{className:"err small",role:"alert",children:T}),"choose"===D.kind&&ee&&(0,t.jsx)("p",{className:"why",children:x("prep.password")}),(0,t.jsxs)("div",{className:"row modal-actions",children:[(0,t.jsx)("button",{type:"button",className:"quiet",onClick:()=>K(!1),disabled:U,children:x("dialog.cancel")}),"failed"===D.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:$,children:x("startdlg.back")}),(0,t.jsx)("button",{type:"button",className:"primary",onClick:()=>void G({skipFetch:!0}),children:x("startdlg.tryAgain")})]}):"fetchFailed"!==D.kind&&(0,t.jsx)("button",{ref:b,type:"button",className:"primary",onClick:()=>void G(),disabled:U||!y,children:el})]})]})})}},3069:(e,l,s)=>{s.d(l,{StartFailureBanner:()=>h,X:()=>o});var t=s(3365),n=s(1521),a=s(5549),r=s(867),i=s(7527);function o(e){var l,s;let{failure:n,reason:i,onDismiss:o,intro:c,children:d}=e,{t:h}=(0,r.kj)(),u=(0,r.W3)(),m=null!=(s=null!=(l=null==n?void 0:n.message)?l:i)?s:"";return(0,t.jsxs)("div",{className:"notice caution start-failure",role:"alert",style:{overflowWrap:"anywhere"},children:[c&&(0,t.jsx)("p",{className:"small",style:{marginTop:0},children:c}),(0,t.jsx)("strong",{children:h("startfail.title")}),n&&(0,t.jsx)("p",{className:"small",style:{margin:"4px 0"},children:h("startfail.where",{stage:h("startfail.stage.".concat(n.stage))})}),(0,t.jsx)("pre",{className:"sync-cmd small",style:{margin:"6px 0"},children:m}),d,n&&(0,t.jsxs)("p",{className:"muted small",style:{margin:"4px 0"},children:[n.runId?h("startfail.when",{when:u(n.at),run:n.runId}):h("startfail.whenNoRun",{when:u(n.at)}),n.sessions.length>0?" \xb7 ".concat(n.sessions.map(e=>'"'.concat(e,'"')).join(", ")):""]}),(0,t.jsxs)("div",{className:"row",style:{marginTop:6},children:[n&&(0,t.jsx)("a",{className:"button-link",href:a.FH.startFailureUrl(n.id),download:!0,children:h("startfail.download")}),(0,t.jsx)("a",{className:n?"button-link":"button-link plain",href:a.FH.terminalUrl(),download:!0,children:h("startfail.terminal")}),o&&(0,t.jsx)("button",{type:"button",className:"quiet",onClick:o,children:h("startfail.dismiss")})]}),(0,t.jsx)("p",{className:"why",children:h("startfail.downloadWhy")})]})}let c="cop.startFailure.dismissed";function d(){try{var e;let l=JSON.parse(null!=(e=window.localStorage.getItem(c))?e:"[]");return Array.isArray(l)?l.filter(e=>"string"==typeof e):[]}catch(e){return[]}}function h(){let{t:e}=(0,r.kj)(),[l,s]=(0,n.useState)([]),[h,u]=(0,n.useState)([]);(0,i.z)(()=>a.FH.startFailures(!0).then(e=>{s(e),u(d())}).catch(()=>void 0),5e3);let m=l.find(e=>!h.includes(e.id));return m?(0,t.jsx)("div",{style:{marginBottom:12},children:(0,t.jsx)(o,{failure:m,intro:e("at-turn"===m.stage?"startfail.laterSession":"startfail.later"),onDismiss:()=>{let e=[...new Set([...d(),m.id])].slice(-50);try{window.localStorage.setItem(c,JSON.stringify(e))}catch(e){}u(e)}})}):null}},3486:(e,l,s)=>{s.d(l,{w:()=>o});var t=s(3365),n=s(1521),a=s(5549),r=s(867);let i={"review-inputs":"runvcs.review","snapshot-on-base":"runvcs.snapshotOnBase","snapshot-here":"runvcs.snapshotHere","use-current-branch":"runvcs.useCurrent","allow-snapshot":"runvcs.allowSnapshot"};function o(e){let{groups:l,sessionIds:s,onChange:a}=e,{t:i}=(0,r.kj)(),[o,d]=(0,n.useState)(""),h=l.filter(e=>!e.ready);return 0===h.length?o?(0,t.jsxs)("p",{className:"notice small",role:"status",children:[(0,t.jsx)("strong",{children:i("runvcs.ready")})," ",o]}):null:(0,t.jsxs)("section",{className:"notice caution","aria-labelledby":"runvcs-title",children:[(0,t.jsx)("h3",{id:"runvcs-title",style:{marginTop:0},children:i("runvcs.title")}),(0,t.jsx)("p",{className:"small",children:i("runvcs.why")}),h.map(e=>(0,t.jsx)(c,{group:e,sessionIds:s,onChange:a,onDone:d},e.repoDir))]})}function c(e){var l;let{group:s,sessionIds:o,onChange:c,onDone:d}=e,{t:h}=(0,r.kj)(),[u,m]=(0,n.useState)(!1),[p,g]=(0,n.useState)(!1),[x,f]=(0,n.useState)(!1),[j,v]=(0,n.useState)(""),[b,y]=(0,n.useState)({}),k=(e,l)=>{var s,t;return null!=(t=null!=(s=b[e])?s:l)?t:void 0},w=s.actions.find(e=>"snapshot-here"===e.id&&e.available),N=e=>(null!=e?e:"—").slice(0,8),F=async e=>{if("review-inputs"===e)return void m(e=>!e);f(!0),v("");try{var l,t,n;let r="snapshot-on-base"===e?Object.fromEntries(s.inputs.map(e=>[e.path,"include"])):Object.fromEntries(s.entries.filter(e=>k(e.path,e.choice)).map(e=>[e.path,k(e.path,e.choice)])),i=await a.FH.runVcsPrepare(o,s.repoDir,e,r);v(i.ok?null!=(l=i.result)?l:"":null!=(t=i.problem)?t:""),i.ok&&d("".concat(s.repoDir,": ").concat(null!=(n=i.result)?n:"")),c()}catch(e){v(e.message)}finally{f(!1)}};return(0,t.jsxs)("div",{className:"option",style:{overflowWrap:"anywhere"},children:[(0,t.jsx)("table",{className:"small",children:(0,t.jsxs)("tbody",{children:[(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:h("runvcs.repo")}),(0,t.jsx)("td",{children:(0,t.jsx)("code",{children:s.repoDir})})]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:h("runvcs.current")}),(0,t.jsxs)("td",{children:[(0,t.jsx)("code",{children:null!=(l=s.branch)?l:"HEAD"})," @ ",(0,t.jsx)("code",{children:N(s.head)})]})]}),s.workBranch&&(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:h("runvcs.workBranch")}),(0,t.jsxs)("td",{children:[(0,t.jsx)("code",{children:s.workBranch.name})," @ ",(0,t.jsx)("code",{children:N(s.workBranch.head)})]})]}),s.baseBranch&&(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:h("runvcs.base")}),(0,t.jsxs)("td",{children:[(0,t.jsx)("code",{children:s.baseBranch})," @ ",(0,t.jsx)("code",{children:N(s.baseHead)})]})]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:h("runvcs.sessions")}),(0,t.jsx)("td",{children:s.sessions.map(e=>"".concat(e.name," (").concat(h("runvcs.role.".concat(e.role)),")")).join(", ")})]}),s.inputPatterns.length>0&&(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:h("runvcs.patterns")}),(0,t.jsx)("td",{children:s.inputPatterns.map(e=>(0,t.jsx)("code",{style:{marginRight:6},children:e},e))})]})]})}),s.problem&&(0,t.jsxs)("p",{className:"small",children:[(0,t.jsx)("strong",{children:h("runvcs.problem")})," ",s.problem]}),s.inputs.length>0&&(0,t.jsx)("p",{className:"small",children:h("runvcs.inputsCount",{n:s.inputs.length})}),u&&s.inputs.length>0&&(0,t.jsx)("ul",{className:"small",style:{margin:"4px 0"},children:s.inputs.map(e=>(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{children:e.path})," — ",h("vcs.snapshotKind.".concat(e.kind)),void 0!==e.size?", ".concat((0,a.zi)(e.size)):"",0===e.allowed.length&&e.reason?(0,t.jsxs)("span",{className:"err",children:[" — ",e.reason]}):null]},e.path))}),s.unrelated.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"small",children:(0,t.jsx)("strong",{children:h("runvcs.unrelated",{n:s.unrelated.length})})}),(0,t.jsx)("ul",{className:"small",style:{margin:"4px 0"},children:s.unrelated.slice(0,30).map(e=>(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{children:e.path}),e.reason?" — ".concat(e.reason):""]},e.path))})]}),w&&s.entries.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"small",children:(0,t.jsx)("strong",{children:h("runvcs.choose",{n:s.entries.length})})}),(0,t.jsx)("ul",{className:"small",style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:s.entries.map(e=>{var l;return(0,t.jsxs)("li",{style:{marginBottom:4},children:[(0,t.jsx)("code",{children:e.path})," ",(0,t.jsxs)("span",{className:"muted",children:["(",e.input?"".concat(h("vcs.snapshotInput"),", "):"",h("vcs.snapshotKind.".concat(e.kind)),void 0!==e.size?", ".concat((0,a.zi)(e.size)):"",")"]})," ",0===e.allowed.length?(0,t.jsx)("span",{className:"err",children:h("vcs.snapshotBlocked")}):(0,t.jsx)("select",{"aria-label":e.path,value:null!=(l=k(e.path,e.choice))?l:"",onChange:l=>y({...b,[e.path]:l.target.value}),disabled:x||e.allowed.length<2,children:e.allowed.map(e=>(0,t.jsx)("option",{value:e,children:h("include"===e?"vcs.snapshotInclude":"vcs.snapshotLeaveOut")},e))}),e.reason&&(0,t.jsx)("div",{className:"muted",children:e.reason})]},e.path)})})]}),p?(0,t.jsxs)("p",{className:"small muted",children:[h("runvcs.cancelled")," ",(0,t.jsx)("button",{className:"quiet",onClick:()=>g(!1),children:h("runvcs.showAgain")})]}):(0,t.jsxs)("div",{children:[s.actions.map(e=>{var l,n,a;return(0,t.jsxs)("div",{style:{marginTop:8},children:[(0,t.jsxs)("button",{className:e.recommended?"primary":void 0,onClick:()=>void F(e.id),disabled:x||!e.available,children:[h(i[e.id],{branch:null!=(l=s.baseBranch)?l:"",current:null!=(n=s.branch)?n:"HEAD"}),"review-inputs"===e.id&&u?" ✓":""]}),e.recommended&&(0,t.jsx)("span",{className:"badge done",style:{marginLeft:6},children:h("runvcs.recommended")}),(0,t.jsx)("p",{className:"why",children:e.available?e.result:"".concat(h("runvcs.notNow")," ").concat(null!=(a=e.why)?a:"")})]},e.id)}),(0,t.jsxs)("div",{style:{marginTop:8},children:[(0,t.jsx)("button",{className:"quiet",onClick:()=>g(!0),disabled:x,children:h("runvcs.cancel")}),(0,t.jsx)("p",{className:"why",children:h("runvcs.cancelWhy")})]})]}),j&&(0,t.jsx)("p",{className:"small",role:"status",children:j})]})}},4969:(e,l,s)=>{s.d(l,{V:()=>a});var t=s(1521);let n='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function a(e,l,s){(0,t.useEffect)(()=>{var t,a;if(!l)return;let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=e.current,o=null!=(a=null!=(t=null==s?void 0:s.current)?t:null==i?void 0:i.querySelector(n))?a:null;null==o||o.focus();let c=e=>{if("Tab"!==e.key||!i)return;let l=Array.from(i.querySelectorAll(n)).filter(e=>null!==e.offsetParent);if(0===l.length)return;let s=l[0],t=l[l.length-1],a=i.contains(document.activeElement);e.shiftKey&&(document.activeElement===s||!a)?(e.preventDefault(),t.focus()):e.shiftKey||document.activeElement!==t&&a||(e.preventDefault(),s.focus())};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c),r&&document.contains(r)&&r.focus()}},[e,l,s])}},7527:(e,l,s)=>{s.d(l,{z:()=>n});var t=s(1521);function n(e,l){let s=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=(0,t.useRef)(e);n.current=e,(0,t.useEffect)(()=>{let e;if(!s)return;let t=!1,a=async()=>{try{await n.current()}catch(e){}finally{t||(e=setTimeout(()=>void a(),l))}};return a(),()=>{t=!0,e&&clearTimeout(e)}},[l,s])}}}]);
|
|
@@ -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:function(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return m("/repo/prepare/preview",{method:"POST",body:JSON.stringify({dir:t,fetch:e})},{timeoutMs:33e4})},prepareProject:function(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return m("/repo/prepare",{method:"POST",body:JSON.stringify({dir:t,fingerprint:e,...o})})},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,n)=>m("/sessions/".concat(t,"/start"),{method:"POST",body:JSON.stringify({mode:e,name:o,starts:n})},{timeoutMs:12e4}),startOptions:t=>m("/start/options?sessions=".concat(encodeURIComponent(t.join(",")))),startFetch:(t,e,o)=>m("/start/fetch",{method:"POST",body:JSON.stringify({dir:t,remote:e,...o?{branches:o}:{}})},{timeoutMs:33e4}),startFailures:function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return m("/start/failures".concat(t?"?unanswered=1":""))},startFailureUrl:t=>i("".concat(n,"/start/failures/").concat(encodeURIComponent(t),"/report")),terminalUrl:()=>i("".concat(n,"/terminal")),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,i)=>m("/batch/start",{method:"POST",body:JSON.stringify({sessionIds:t,mode:e,onFailure:o,model:n,reviewModel:s,name:c,taskIds:a,starts:i})},{timeoutMs:12e4}),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:"{}"}),contractCheck:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/contract")),applyContractFix:(t,e,o,n)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/contract-fix"),{method:"POST",body:JSON.stringify({choices:o,expect:n})}),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")}}}]);
|