reflex-agent 0.2.4 → 0.3.0
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/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +103 -90
- package/.next/app-path-routes-manifest.json +8 -8
- package/.next/build-manifest.json +5 -5
- package/.next/prerender-manifest.json +4 -54
- package/.next/react-loadable-manifest.json +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/agents/[agentId]/page.js +3 -3
- package/.next/server/app/agents/[agentId]/page.js.nft.json +1 -1
- package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route.js +2 -2
- package/.next/server/app/api/agents/[agentId]/respond/route.js.nft.json +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/images/[rootId]/[file]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/oauth/callback/route.js +3 -3
- package/.next/server/app/api/oauth/callback/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/oauth/start/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/attachments/route.js +0 -0
- package/.next/server/app/api/roots/[id]/attachments/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js +2 -2
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js +2 -2
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js +2 -2
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route.js +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route.js +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/bundle.js/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route.js +2 -2
- package/.next/server/app/api/utilities/[scope]/[id]/host/route.js.nft.json +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-api.mjs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-ui.mjs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/iframe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/style.css/route_client-reference-manifest.js +1 -1
- package/.next/server/app/audit/page.js +2 -2
- package/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/server/app/onboarding/page.js +3 -3
- package/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/chat/[topicId]/page.js +2 -6
- package/.next/server/app/roots/[id]/chat/[topicId]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/chat/[topicId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/kb/[...slug]/page.js +2 -6
- package/.next/server/app/roots/[id]/kb/[...slug]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/kb/[...slug]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/page.js +3 -3
- package/.next/server/app/roots/[id]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/workflows/[wfId]/page.js +2 -2
- package/.next/server/app/roots/[id]/workflows/[wfId]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/workflows/[wfId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/workflows/page.js +2 -2
- package/.next/server/app/roots/[id]/workflows/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/workflows/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/new/page.js +5 -3
- package/.next/server/app/roots/new/page.js.nft.json +1 -1
- package/.next/server/app/roots/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page.js +5 -5
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[id]/file/page.js +2 -2
- package/.next/server/app/share/[id]/file/page.js.nft.json +1 -1
- package/.next/server/app/share/[id]/file/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[id]/page.js +2 -2
- package/.next/server/app/share/[id]/page.js.nft.json +1 -1
- package/.next/server/app/share/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/utilities/[scope]/[id]/page.js +2 -2
- package/.next/server/app/utilities/[scope]/[id]/page.js.nft.json +1 -1
- package/.next/server/app/utilities/[scope]/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/utilities/page.js +2 -17
- package/.next/server/app/utilities/page.js.nft.json +1 -1
- package/.next/server/app/utilities/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +8 -8
- package/.next/server/chunks/1.js +3 -0
- package/.next/server/chunks/1223.js +1 -1
- package/.next/server/chunks/133.js +1 -490
- package/.next/server/chunks/1888.js +1 -1
- package/.next/server/chunks/{9739.js → 1988.js} +13 -9
- package/.next/server/chunks/2192.js +1 -0
- package/.next/server/chunks/2433.js +1 -1
- package/.next/server/chunks/2503.js +1 -1
- package/.next/server/chunks/285.js +471 -0
- package/.next/server/chunks/2995.js +1 -0
- package/.next/server/chunks/3240.js +1 -1
- package/.next/server/chunks/3332.js +1 -1
- package/.next/server/chunks/{3953.js → 3512.js} +2 -2
- package/.next/server/chunks/3657.js +1 -1
- package/.next/server/chunks/4066.js +1 -1
- package/.next/server/chunks/4438.js +1 -0
- package/.next/server/chunks/4553.js +1 -1
- package/.next/server/chunks/4812.js +179 -0
- package/.next/server/chunks/4925.js +1 -1
- package/.next/server/chunks/5319.js +1 -1
- package/.next/server/chunks/569.js +1 -1
- package/.next/server/chunks/6730.js +1 -1
- package/.next/server/chunks/6734.js +1 -0
- package/.next/server/chunks/6909.js +142 -161
- package/.next/server/chunks/7215.js +1 -0
- package/.next/server/chunks/8262.js +1 -1
- package/.next/server/chunks/9098.js +1 -1
- package/.next/server/chunks/94.js +1 -1
- package/.next/server/chunks/9835.js +1 -1
- package/.next/server/chunks/9944.js +1 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages-manifest.json +1 -2
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/1082-326e649fb24d4945.js +1 -0
- package/.next/static/chunks/3736-f4e42d6d38be50b0.js +1 -0
- package/.next/static/chunks/4108.ca0bdf3cbf3c56cc.js +1 -0
- package/.next/static/chunks/6445-99824866a51b582a.js +1 -0
- package/.next/static/chunks/7482-7ef26030a10ce14f.js +1 -0
- package/.next/static/chunks/8944-c4f2406ecd61094f.js +1 -0
- package/.next/static/chunks/9411-af5f758c57741929.js +3 -0
- package/.next/static/chunks/9415-eb6b5d4c2de3a7c0.js +1 -0
- package/.next/static/chunks/app/agents/[agentId]/page-5d6f4cb16b42d02b.js +1 -0
- package/.next/static/chunks/app/layout-85eb1fd21dab0895.js +1 -0
- package/.next/static/chunks/app/onboarding/page-2013bd8124b9162e.js +1 -0
- package/.next/static/chunks/app/page-558a224e13ffb52c.js +1 -0
- package/.next/static/chunks/app/roots/[id]/chat/[topicId]/page-b42f03fd58669d12.js +1 -0
- package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-7d17b4e6a5231f56.js +1 -0
- package/.next/static/chunks/app/roots/[id]/page-4aab5266f432e37e.js +1 -0
- package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-1ee3320bf5744efc.js +1 -0
- package/.next/static/chunks/app/roots/new/page-df8d2c1f0c64c37a.js +1 -0
- package/.next/static/chunks/app/settings/page-fdba798d9e243ad3.js +1 -0
- package/.next/static/chunks/app/share/[id]/page-818a451d05e08d26.js +1 -0
- package/.next/static/chunks/app/utilities/[scope]/[id]/page-2cee09cc2ab9b5e8.js +1 -0
- package/.next/static/chunks/app/utilities/page-44a51522b347f13e.js +1 -0
- package/.next/static/chunks/{webpack-5fca180586957874.js → webpack-2b0eab4ccdf44f63.js} +1 -1
- package/.next/static/css/4b367c1d0fa99b78.css +1 -0
- package/.next/trace +47 -46
- package/dist/lib/reflex/agents/prompts.js +46 -46
- package/dist/lib/reflex/agents/prompts.js.map +1 -1
- package/dist/lib/reflex/prompts/defaults.js +102 -102
- package/next.config.ts +4 -1
- package/package.json +2 -1
- package/packages/utilities/learn-anything/README.md +29 -29
- package/packages/utilities/learn-anything/actions/_json.ts +11 -11
- package/packages/utilities/learn-anything/actions/_store.ts +2 -2
- package/packages/utilities/learn-anything/actions/buildModule.ts +60 -59
- package/packages/utilities/learn-anything/actions/explainSelection.ts +14 -13
- package/packages/utilities/learn-anything/actions/generateOutline.ts +15 -15
- package/packages/utilities/learn-anything/actions/generateQuiz.ts +8 -8
- package/packages/utilities/learn-anything/actions/generateTrainer.ts +15 -15
- package/packages/utilities/learn-anything/actions/refreshCourseCard.ts +4 -4
- package/packages/utilities/learn-anything/actions/tutorAsk.ts +15 -15
- package/packages/utilities/learn-anything/article-view.tsx +4 -4
- package/packages/utilities/learn-anything/manifest.json +5 -5
- package/packages/utilities/learn-anything/ui.tsx +57 -57
- package/.next/server/app/_not-found.html +0 -1
- package/.next/server/app/_not-found.meta +0 -8
- package/.next/server/app/_not-found.rsc +0 -18
- package/.next/server/app/index.html +0 -1
- package/.next/server/app/index.meta +0 -9
- package/.next/server/app/index.rsc +0 -19
- package/.next/server/chunks/1410.js +0 -1
- package/.next/server/chunks/1986.js +0 -1
- package/.next/server/chunks/2448.js +0 -3
- package/.next/server/chunks/5754.js +0 -3
- package/.next/server/chunks/7097.js +0 -1
- package/.next/server/chunks/7782.js +0 -1
- package/.next/server/chunks/7987.js +0 -1
- package/.next/server/chunks/810.js +0 -1
- package/.next/server/chunks/8843.js +0 -1
- package/.next/server/chunks/9328.js +0 -179
- package/.next/server/pages/404.html +0 -1
- package/.next/static/chunks/2488-c9590facb4b9f184.js +0 -1
- package/.next/static/chunks/2684-257d38989ef53935.js +0 -1
- package/.next/static/chunks/4108.fb9f99a9c899ef54.js +0 -1
- package/.next/static/chunks/6231-d83c1544bbea8424.js +0 -1
- package/.next/static/chunks/9045-731ff0865352dd95.js +0 -1
- package/.next/static/chunks/9496-75ccd3fadb294fba.js +0 -1
- package/.next/static/chunks/992-4e7b7f722c629e21.js +0 -1
- package/.next/static/chunks/app/agents/[agentId]/page-0b5c2838354d0eba.js +0 -1
- package/.next/static/chunks/app/layout-9a59ed07c18cb786.js +0 -1
- package/.next/static/chunks/app/onboarding/page-79f07a813ea2abfe.js +0 -1
- package/.next/static/chunks/app/page-27f4b98b02ac4f79.js +0 -1
- package/.next/static/chunks/app/roots/[id]/chat/[topicId]/page-8db2d0b75cd333c8.js +0 -1
- package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-873b131eec3a2f30.js +0 -1
- package/.next/static/chunks/app/roots/[id]/page-270d0d49eb668784.js +0 -1
- package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-7c1f10dbe0bcb9ad.js +0 -1
- package/.next/static/chunks/app/roots/new/page-ac1a9f6379710ca2.js +0 -1
- package/.next/static/chunks/app/settings/page-81cb1393e817dfc3.js +0 -1
- package/.next/static/chunks/app/share/[id]/page-2d123f0a99e1606f.js +0 -1
- package/.next/static/chunks/app/utilities/[scope]/[id]/page-0bbb8d17af80c1da.js +0 -1
- package/.next/static/chunks/app/utilities/page-e6ce673b9357bf1f.js +0 -1
- package/.next/static/css/87e01f779d555d04.css +0 -1
- /package/.next/static/{og_wC7UPkGtJDiapaTgBr → fhVNqfmJl5Mdfhyhg6orp}/_buildManifest.js +0 -0
- /package/.next/static/{og_wC7UPkGtJDiapaTgBr → fhVNqfmJl5Mdfhyhg6orp}/_ssgManifest.js +0 -0
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=9328,exports.ids=[8514,9328],exports.modules={9328:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Bp:()=>A,JR:()=>P,Kt:()=>I,L_:()=>z,QI:()=>G,QR:()=>y,RK:()=>K,Yt:()=>Q,Zh:()=>J,b7:()=>L,gn:()=>B,i8:()=>R,jf:()=>F,k_:()=>O,mR:()=>E,nO:()=>C,q_:()=>H,vv:()=>x});var e=c(73745);c(66493);var f=c(73024),g=c(76760),h=c.n(g),i=c(65326),j=c(53905),k=c(5492),l=c(36017),m=c(51021),n=c(99861),o=c(45730),p=c(97453),q=c(16975),r=c(8118),s=c(28514),t=c(12140),u=c(20050),v=c(63781),w=a([m,n,o]);async function x(a){try{let b=await (0,r.listUtilities)(a??{});return{ok:!0,utilities:b}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function y(a){let b=await (0,o.w)(a);return b.ok?{ok:!0,preview:b.preview}:{ok:!1,error:b.error}}async function z(a){try{let b=await (0,o.installFromGithubConfirmed)(a);return(0,i.revalidatePath)("/utilities"),{ok:!0,scope:b.scope,id:b.id}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function A(){let{getCuratedRegistry:a}=await c.e(4925).then(c.bind(c,44925));return{items:await a()}}async function B(a){if(a.github.startsWith("builtin:"))try{let{installFromBuiltin:b}=await c.e(2035).then(c.bind(c,32035)),d=await b({builtin:a.github,scope:a.scope,...a.rootId?{rootId:a.rootId}:{}});return(0,i.revalidatePath)("/utilities"),{ok:!0,scope:d.scope,id:d.id}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}let b=await (0,o.w)(a.github);if(!b.ok)return{ok:!1,error:b.error};try{let c=await (0,o.installFromGithubConfirmed)({preview:b.preview,scope:a.scope,...a.rootId?{rootId:a.rootId}:{}});return(0,i.revalidatePath)("/utilities"),{ok:!0,scope:c.scope,id:c.id}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function C(a){try{let b=await (0,r.listUtilities)({...a?.rootId?{rootId:a.rootId}:{}}),d=[];for(let a of b){let b=a.manifest.source?.origin??"";if(b.startsWith("builtin:")){let b=await D(a.manifest.id,a.manifest.version);b&&d.push({scope:a.scope,id:a.manifest.id,name:a.manifest.name,currentVersion:a.manifest.version,latestVersion:b.version,source:"builtin",ref:b.spec})}else if(b.startsWith("github:"))try{let{checkGithubUpdate:b}=await Promise.resolve().then(c.bind(c,45730)),e=await b(a.scope,a.manifest.id,a.rootId);!e.upToDate&&e.preview&&d.push({scope:a.scope,id:a.manifest.id,name:a.manifest.name,currentVersion:a.manifest.version,latestVersion:e.preview.manifest.version,source:"github",ref:`github:${e.preview.source.owner}/${e.preview.source.repo}@${e.latestSha}`})}catch{}}return{ok:!0,updates:d}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function D(a,b){try{let d=await Promise.resolve().then(c.t.bind(c,51455,23)),e=(await Promise.resolve().then(c.t.bind(c,76760,23))).join(process.cwd(),"packages","utilities",a,"manifest.json"),f=await d.readFile(e,"utf8"),g=JSON.parse(f);if(!g.version||g.version===b)return null;return{version:g.version,spec:`builtin:${a}@${g.version}`}}catch{return null}}async function E(a){try{let{withUpdateSnapshot:b}=await c.e(4840).then(c.bind(c,94840)),d=await b(a.scope,a.id,a.rootId,async()=>{if("builtin"===a.source){let{installFromBuiltin:b}=await c.e(2035).then(c.bind(c,32035));return(await b({builtin:a.ref,scope:a.scope,...a.rootId?{rootId:a.rootId}:{}})).origin.split("@")[1]??a.latestVersion}if("github"===a.source){let{checkGithubUpdate:b,installFromGithubConfirmed:d}=await Promise.resolve().then(c.bind(c,45730)),e=await b(a.scope,a.id,a.rootId);return e.upToDate||!e.preview?a.currentVersion:(await d({preview:e.preview,scope:a.scope,...a.rootId?{rootId:a.rootId}:{}}),e.preview.manifest.version)}throw Error(`Unknown update source: ${a.source}`)});return(0,i.revalidatePath)("/utilities"),a.rootId&&(0,i.revalidatePath)(`/roots/${a.rootId}`),{ok:!0,newVersion:d}}catch(c){var b,d;let a=c instanceof Error?c.message:String(c);return{ok:!1,error:`Обновление откатано — старая версия восстановлена. Ошибка: ${b=a,d=600,b.length<=600?b:b.slice(0,d)+"…"}`}}}async function F(a,b,c){try{return await (0,r.jc)(a,b,c),await (0,s.J8)(a,b,c),(0,i.revalidatePath)("/utilities"),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function G(a,b,c){try{let d=await (0,r.getUtility)(a,b,c);if(!d)return{ok:!1,error:"utility not found"};return await (0,n.buildUtility)(d),(0,i.revalidatePath)(`/utilities/${a}/${b}`),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function H(a,b,c){try{let d=await (0,o.checkGithubUpdate)(a,b,c);return{ok:!0,...d}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function I(a){return(0,t.y4)(a??{})}async function J(a){let b=p.McpConfigSchema.safeParse(a);if(!b.success)return{ok:!1,error:b.error.message};try{let a=await (0,p.connectAndListTools)(b.data);return{ok:!0,...a.name?{serverName:a.name}:{},...a.version?{serverVersion:a.version}:{},tools:a.tools}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function K(a){try{var b;let c=p.McpConfigSchema.parse(a.config),d=await (0,p.connectAndListTools)(c),e=(0,q.U)({id:a.id,name:a.name,description:a.description??d.name??"",tools:d.tools}),g=u.pL.parse(e.manifest),j=await (0,r.gd)({scope:a.scope,...a.rootId?{rootId:a.rootId}:{},manifest:g,files:e.files,source:{type:"mcp",origin:(b=c,"stdio"===b.transport?`mcp:stdio:${b.command}${b.args.length?" "+b.args.join(" "):""}`:`mcp:${b.transport}:${b.url}`),fetchedAt:new Date().toISOString(),installedBy:"user"}});return await f.promises.writeFile(h().join(j.dir,"mcp.json"),JSON.stringify(c,null,2)+"\n","utf8"),await (0,n.buildUtility)(j),(0,i.revalidatePath)("/utilities"),{ok:!0,scope:j.scope,id:j.manifest.id}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function L(a){try{let b=await (0,r.getUtility)(a.scope,a.id,a.rootId);if(!b)return{ok:!1,error:"utility not found"};if(!a.instruction.trim())return{ok:!1,error:"instruction is empty"};let c=await M(b,a.rootId);if(!c)return{ok:!1,error:"no project root available — register a root first"};let d=await (0,j.Zn)(c);if(!d)return{ok:!1,error:"root not found"};let e=await N(b.dir),f=function(a,b,c,d){let e=c.map(a=>{var b;return"### "+a.rel+"\n```"+((b=a.rel).endsWith(".tsx")?"tsx":b.endsWith(".ts")?"ts":b.endsWith(".jsx")?"jsx":b.endsWith(".js")?"js":b.endsWith(".json")?"json":b.endsWith(".css")?"css":b.endsWith(".md")?"md":"")+"\n"+a.content+"\n```"}).join("\n\n");return[`/goal Доработай Reflex-утилиту "${a.name}" (id: ${a.id}).`,"",`Текущая директория утилиты на диске: \`${b}\`.`,`Scope: ${a.source?.type??"agent"} → manifest.id=${a.id}.`,"\n## Что просит пользователь",d.trim(),"\n## Текущие файлы утилиты",e||"(нет читаемых файлов)",'\n## Что от тебя требуется\n1. Прочитай файлы выше и пойми текущее поведение.\n2. Внеси изменения по запросу пользователя.\n3. Эмить обновлённую утилиту через маркер `<<reflex:utility>>` с тем же `id` и (увеличенной) `version`. Reflex переустановит её поверх существующей и сразу перебилдит bundle.\n4. Проверь, что новый бандл собирается без ошибок и UI отражает запрошенное изменение.\n5. По завершении эмить `<<reflex:kb>>{"kind":"goal-completion",...}` и фразу `GOAL ACHIEVED` на отдельной строке.\n\nНе выдумывай новых импортов вне whitelist (`react`, `react-dom/client`, `react/jsx-runtime`, `@host/api`, `@host/ui`). Если запрос требует чего-то невозможного — спроси через `<<reflex:question>>`.'].join("\n")}(b.manifest,b.dir,e,a.instruction),g=await (0,l.M)(),h=g.assignments.chat,n=await (0,k.OY)({root:d.path,firstMessage:`Edit: ${b.manifest.name}`,harness:h.harness,model:h.model,language:g.language}),o=await (0,m.W)({rootId:c,topicId:n.meta.id,message:f});if("error"in o)return{ok:!1,error:o.error};return(0,i.revalidatePath)(`/roots/${c}`),{ok:!0,rootId:c,topicId:n.meta.id}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function M(a,b){if(a.rootId)return a.rootId;let c=a.manifest.source?.origin;if(c?.startsWith("agent:")){let a=c.split(":");if(a.length>=4){let b=a[1];if(await (0,j.Zn)(b))return b}}if(b&&await (0,j.Zn)(b))return b;let d=await (0,j.qV)();return d[0]?.id}async function N(a){let b=[],c=async(a,d)=>{for(let e of(await f.promises.readdir(a,{withFileTypes:!0}))){if("data"===e.name||"dist"===e.name||"node_modules"===e.name)continue;let g=h().join(a,e.name),i=d?`${d}/${e.name}`:e.name;if(e.isDirectory())await c(g,i);else if(/\.(tsx?|jsx?|md|json|css)$/.test(e.name)&&"bundle.js"!==e.name&&"style.css"!==e.name){let a=await f.promises.readFile(g,"utf8");a.length<32e3&&b.push({rel:i,content:a})}}};return await c(a,""),b}async function O(a){try{let b=await (0,r.getUtility)(a.scope,a.id,a.rootId);if(!b)return{ok:!1,error:"utility not found"};let c=b.manifest.secrets??[],d=new Set(await (0,s.listSecretKeys)(a.scope,a.id,a.rootId));return{ok:!0,secrets:c.map(a=>({key:a.key,label:a.label,description:a.description,required:a.required,set:d.has(a.key)}))}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function P(a){try{let b=await (0,r.getUtility)(a.scope,a.id,a.rootId);if(!b)return{ok:!1,error:"utility not found"};if(!(b.manifest.secrets??[]).find(b=>b.key===a.key))return{ok:!1,error:`secret "${a.key}" is not declared in manifest.secrets`};if(!a.value)return{ok:!1,error:"empty value — use delete instead"};return await (0,s.Pq)(a.scope,a.id,a.key,a.value,a.rootId),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function Q(a){try{return await (0,s.e3)(a.scope,a.id,a.key,a.rootId),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function R(a,b,c){try{let d=await (0,r.getUtility)(a,b,c);if(!d)return{ok:!1,error:"utility not found"};return{ok:!0,manifest:d.manifest}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}[m,n,o]=w.then?(await w)():w,(0,v.D)([x,y,z,A,B,C,E,F,G,H,I,J,K,L,O,P,Q,R]),(0,e.A)(x,"406f7a98b1cdd03b0ab07b96ae7577222256361bf9",null),(0,e.A)(y,"4039fb0524db14f34e5ebafa2546a475a077d600d8",null),(0,e.A)(z,"409b4771850f013b0e95b713f58102dcdd65882bb2",null),(0,e.A)(A,"008e4879b6f27ca2c4e107002e41f7eb0f1ed7c90a",null),(0,e.A)(B,"40fedabc5057fbaea698aaf66b3375e51c17850be6",null),(0,e.A)(C,"40851e8b21d58902401ed652c8663f82de37e311cc",null),(0,e.A)(E,"40d543f91f3e2e8944f6d5e3ad444553ae91c634e5",null),(0,e.A)(F,"70d9b7413000bd4ea89bd848248c11d0ea1be5524f",null),(0,e.A)(G,"705cae1bd860b36a91e605550dde7411c85bf1cadf",null),(0,e.A)(H,"705b366fdeeccf4cc3ca8ecd77c55c6120ede801cf",null),(0,e.A)(I,"40c0c739a96e9af251ea65dd4dd424c7b3d04dc59d",null),(0,e.A)(J,"40f2c64e393291732bf646c0b148da22d27e964d0e",null),(0,e.A)(K,"40b6381aa08307dd0260cb19bb14f3cf6bcf974fd3",null),(0,e.A)(L,"40b8b2ef963c1adccd0cfff4db49344a7b936b2c81",null),(0,e.A)(O,"40bb1909b905c51b2ab17d4dee4580d20541a22893",null),(0,e.A)(P,"4075232db6aad928e0355986924b823b206832fe45",null),(0,e.A)(Q,"40640b5c376f4e58a91f76b3864c5477669c380374",null),(0,e.A)(R,"7015f37d0d452574f6982795ff3a4225c5be485096",null),d()}catch(a){d(a)}})},12140:(a,b,c)=>{c.d(b,{Md:()=>p,u0:()=>m,y4:()=>n});var d=c(73024),e=c(76760),f=c.n(e),g=c(77598),h=c.n(g),i=c(73652);let j=f().join((0,i._)(),"audit");function k(a){return f().join(j,`${a}.jsonl`)}function l(a=new Date){return a.toISOString().slice(0,10)}async function m(a){let b={ts:a.ts??new Date().toISOString(),...a};await d.promises.mkdir(j,{recursive:!0});let c=k(l());await d.promises.appendFile(c,JSON.stringify(b)+"\n","utf8")}async function n(a={}){let b,c=await o(),e=a.date??c[0]??l(),f=a.limit??500,g=k(e);try{b=await d.promises.readFile(g,"utf8")}catch{return{date:e,entries:[],availableDates:c}}let h=[],i=b.split(/\r?\n/);for(let b=i.length-1;b>=0&&h.length<f;b--){let c,d=i[b];if(d){try{c=JSON.parse(d)}catch{continue}(function(a,b){if(!b)return!0;if(b.utilityId&&a.utilityId!==b.utilityId||b.method&&a.method!==b.method||b.phase&&a.phase!==b.phase)return!1;if(b.status){let c=!a.error;if("ok"===b.status&&!c||"error"===b.status&&c)return!1}return!0})(c,a.filter)&&h.push(c)}}return{date:e,entries:h,availableDates:c}}async function o(){let a;try{a=await d.promises.readdir(j)}catch{return[]}return a.filter(a=>/^\d{4}-\d{2}-\d{2}\.jsonl$/.test(a)).map(a=>a.replace(/\.jsonl$/,"")).sort().reverse()}async function p(a,b){let c=h().randomUUID().replace(/-/g,"").slice(0,16),d=Date.now();await m({ts:new Date().toISOString(),utilityId:a.utilityId,scope:a.scope,channel:a.channel,method:a.method,phase:"start",correlationId:c,...a.parentCorrelationId?{parentCorrelationId:a.parentCorrelationId}:{},args:q(a.args)});try{let e=await b(c);return await m({ts:new Date().toISOString(),utilityId:a.utilityId,scope:a.scope,channel:a.channel,method:a.method,phase:"end",correlationId:c,durationMs:Date.now()-d,result:q(e)}),e}catch(e){let b=e instanceof Error?e.message:String(e);throw await m({ts:new Date().toISOString(),utilityId:a.utilityId,scope:a.scope,channel:a.channel,method:a.method,phase:"end",correlationId:c,durationMs:Date.now()-d,error:b}),e}}function q(a,b=0){if(null==a)return a;if("string"==typeof a)return a.length>2e3?a.slice(0,2e3)+"…[truncated]":a;if("object"!=typeof a)return a;if(b>3)return"[…]";if(Array.isArray(a))return a.slice(0,50).map(a=>q(a,b+1));let c={},d=0;for(let[e,f]of Object.entries(a)){if(d++>=50){c["…"]="truncated";break}c[e]=q(f,b+1)}return c}},16975:(a,b,c)=>{function d(a){var b;return{manifest:{id:a.id,name:a.name,description:a.description,version:"0.1.0",ui:"ui.tsx",serverActions:[],permissions:{audit:{write:!0}}},files:{"ui.tsx":function(a){let b=JSON.stringify(a.tools,null,2);return`import { useState } from "react";
|
|
2
|
-
import { reflex } from "@host/api";
|
|
3
|
-
import {
|
|
4
|
-
Button,
|
|
5
|
-
Card,
|
|
6
|
-
CardContent,
|
|
7
|
-
CardHeader,
|
|
8
|
-
CardTitle,
|
|
9
|
-
Input,
|
|
10
|
-
Label,
|
|
11
|
-
Textarea,
|
|
12
|
-
Badge,
|
|
13
|
-
} from "@host/ui";
|
|
14
|
-
|
|
15
|
-
interface Tool {
|
|
16
|
-
name: string;
|
|
17
|
-
description?: string;
|
|
18
|
-
inputSchema?: {
|
|
19
|
-
type?: string;
|
|
20
|
-
properties?: Record<string, JsonSchemaProperty>;
|
|
21
|
-
required?: string[];
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface JsonSchemaProperty {
|
|
26
|
-
type?: string | string[];
|
|
27
|
-
description?: string;
|
|
28
|
-
enum?: unknown[];
|
|
29
|
-
default?: unknown;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const TOOLS: Tool[] = ${b};
|
|
33
|
-
|
|
34
|
-
export default function McpBridge() {
|
|
35
|
-
return (
|
|
36
|
-
<div className="p-6 space-y-4 max-w-3xl mx-auto">
|
|
37
|
-
<header className="space-y-1">
|
|
38
|
-
<h1 className="text-xl font-semibold">${e(a.name)}</h1>
|
|
39
|
-
${a.description?`<p className="text-sm text-slate-600">${e(a.description)}</p>`:""}
|
|
40
|
-
<Badge variant="outline">MCP \xb7 {TOOLS.length} tools</Badge>
|
|
41
|
-
</header>
|
|
42
|
-
{TOOLS.map((tool) => (
|
|
43
|
-
<ToolCard key={tool.name} tool={tool} />
|
|
44
|
-
))}
|
|
45
|
-
</div>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function ToolCard({ tool }: { tool: Tool }) {
|
|
50
|
-
const properties = tool.inputSchema?.properties ?? {};
|
|
51
|
-
const propertyNames = Object.keys(properties);
|
|
52
|
-
const initial: Record<string, string> = {};
|
|
53
|
-
for (const k of propertyNames) {
|
|
54
|
-
const d = properties[k]?.default;
|
|
55
|
-
initial[k] = d == null ? "" : typeof d === "string" ? d : JSON.stringify(d);
|
|
56
|
-
}
|
|
57
|
-
const [values, setValues] = useState<Record<string, string>>(initial);
|
|
58
|
-
const [result, setResult] = useState<string | null>(null);
|
|
59
|
-
const [error, setError] = useState<string | null>(null);
|
|
60
|
-
const [busy, setBusy] = useState(false);
|
|
61
|
-
|
|
62
|
-
const run = async () => {
|
|
63
|
-
setBusy(true);
|
|
64
|
-
setError(null);
|
|
65
|
-
setResult(null);
|
|
66
|
-
try {
|
|
67
|
-
const args: Record<string, unknown> = {};
|
|
68
|
-
for (const k of propertyNames) {
|
|
69
|
-
const prop = properties[k];
|
|
70
|
-
args[k] = coerceValue(values[k], prop);
|
|
71
|
-
}
|
|
72
|
-
const res = await reflex.mcp.call({ tool: tool.name, args });
|
|
73
|
-
setResult(typeof res === "string" ? res : JSON.stringify(res, null, 2));
|
|
74
|
-
} catch (err) {
|
|
75
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
76
|
-
} finally {
|
|
77
|
-
setBusy(false);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
return (
|
|
82
|
-
<Card>
|
|
83
|
-
<CardHeader>
|
|
84
|
-
<CardTitle className="flex items-center gap-2">
|
|
85
|
-
<span className="font-mono text-sm">{tool.name}</span>
|
|
86
|
-
</CardTitle>
|
|
87
|
-
{tool.description && (
|
|
88
|
-
<p className="text-xs text-slate-600">{tool.description}</p>
|
|
89
|
-
)}
|
|
90
|
-
</CardHeader>
|
|
91
|
-
<CardContent>
|
|
92
|
-
<div className="space-y-3">
|
|
93
|
-
{propertyNames.length === 0 && (
|
|
94
|
-
<p className="text-xs italic text-slate-500">No input parameters.</p>
|
|
95
|
-
)}
|
|
96
|
-
{propertyNames.map((k) => {
|
|
97
|
-
const prop = properties[k];
|
|
98
|
-
const t = primitiveType(prop);
|
|
99
|
-
const isLong = t === "object" || t === "array";
|
|
100
|
-
return (
|
|
101
|
-
<div key={k} className="space-y-1">
|
|
102
|
-
<Label className="flex items-center gap-2">
|
|
103
|
-
<span className="font-mono">{k}</span>
|
|
104
|
-
<span className="text-slate-400 text-[10px]">{describeType(prop)}</span>
|
|
105
|
-
</Label>
|
|
106
|
-
{prop?.description && (
|
|
107
|
-
<p className="text-xs text-slate-500">{prop.description}</p>
|
|
108
|
-
)}
|
|
109
|
-
{isLong ? (
|
|
110
|
-
<Textarea
|
|
111
|
-
value={values[k]}
|
|
112
|
-
onChange={(e) =>
|
|
113
|
-
setValues({ ...values, [k]: e.target.value })
|
|
114
|
-
}
|
|
115
|
-
placeholder={t === "array" ? "[]" : "{}"}
|
|
116
|
-
/>
|
|
117
|
-
) : (
|
|
118
|
-
<Input
|
|
119
|
-
value={values[k]}
|
|
120
|
-
onChange={(e) =>
|
|
121
|
-
setValues({ ...values, [k]: e.target.value })
|
|
122
|
-
}
|
|
123
|
-
placeholder={t}
|
|
124
|
-
/>
|
|
125
|
-
)}
|
|
126
|
-
</div>
|
|
127
|
-
);
|
|
128
|
-
})}
|
|
129
|
-
<Button onClick={run} disabled={busy}>
|
|
130
|
-
{busy ? "Выполняется…" : "Запустить"}
|
|
131
|
-
</Button>
|
|
132
|
-
{error && (
|
|
133
|
-
<pre className="text-xs whitespace-pre-wrap text-red-700 bg-red-50 border border-red-200 rounded p-2">
|
|
134
|
-
{error}
|
|
135
|
-
</pre>
|
|
136
|
-
)}
|
|
137
|
-
{result && (
|
|
138
|
-
<pre className="text-xs whitespace-pre-wrap bg-slate-50 border border-slate-200 rounded p-2 max-h-72 overflow-auto">
|
|
139
|
-
{result}
|
|
140
|
-
</pre>
|
|
141
|
-
)}
|
|
142
|
-
</div>
|
|
143
|
-
</CardContent>
|
|
144
|
-
</Card>
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
function primitiveType(prop?: JsonSchemaProperty): string {
|
|
149
|
-
if (!prop) return "string";
|
|
150
|
-
const t = Array.isArray(prop.type) ? prop.type[0] : prop.type;
|
|
151
|
-
return t ?? "string";
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
function describeType(prop?: JsonSchemaProperty): string {
|
|
155
|
-
if (!prop) return "string";
|
|
156
|
-
const t = primitiveType(prop);
|
|
157
|
-
if (prop.enum) return t + " \xb7 " + prop.enum.map((e) => JSON.stringify(e)).join(" | ");
|
|
158
|
-
return t;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
function coerceValue(raw: string, prop?: JsonSchemaProperty): unknown {
|
|
162
|
-
if (raw === "") return undefined;
|
|
163
|
-
const t = primitiveType(prop);
|
|
164
|
-
if (t === "number" || t === "integer") {
|
|
165
|
-
const n = Number(raw);
|
|
166
|
-
if (Number.isNaN(n)) throw new Error(\`expected number for \${prop ? "param" : "value"}\`);
|
|
167
|
-
return n;
|
|
168
|
-
}
|
|
169
|
-
if (t === "boolean") {
|
|
170
|
-
if (raw === "true") return true;
|
|
171
|
-
if (raw === "false") return false;
|
|
172
|
-
throw new Error("expected boolean (true/false)");
|
|
173
|
-
}
|
|
174
|
-
if (t === "object" || t === "array") {
|
|
175
|
-
return JSON.parse(raw);
|
|
176
|
-
}
|
|
177
|
-
return raw;
|
|
178
|
-
}
|
|
179
|
-
`}(a),"README.md":(b=a,[`# ${b.name}`,"",`Reflex-обёртка над MCP-сервером. Tools (${b.tools.length}):`,"",...b.tools.map(a=>`- **${a.name}**${a.description?` — ${a.description}`:""}`),"","Конфиг сервера — в `mcp.json` рядом с этим файлом.",""].join("\n"))}}}function e(a){return a.replace(/[\\"`]/g,"\\$&").replace(/\n/g," ")}c.d(b,{U:()=>d})},28514:(a,b,c)=>{c.d(b,{J8:()=>q,Pq:()=>n,e3:()=>o,getSecret:()=>m,listSecretKeys:()=>p});var d=c(73024),e=c(76760),f=c.n(e),g=c(77598),h=c(73652);let i=f().join((0,h._)(),"secrets");function j(a,b,c){return f().join(i,a,function(a,b){if("global"===a)return"_";if(!b)throw Error("project-scope secrets require rootId");return/^[a-f0-9]{8,64}$/.test(b)?b:(0,g.createHash)("sha1").update(b).digest("hex").slice(0,16)}(a,c),`${b}.json`)}async function k(a){try{let b=await d.promises.readFile(a,"utf8"),c=JSON.parse(b);if(1!==c.version||!c.values||"object"!=typeof c.values)return{version:1,values:{}};return{version:1,values:c.values}}catch{return{version:1,values:{}}}}async function l(a,b){await d.promises.mkdir(f().dirname(a),{recursive:!0}),await d.promises.writeFile(a,JSON.stringify(b,null,2)+"\n",{encoding:"utf8",mode:384});try{await d.promises.chmod(a,384)}catch{}}async function m(a,b,c,d){let e=await k(j(a,b,d));return Object.prototype.hasOwnProperty.call(e.values,c)?e.values[c]:null}async function n(a,b,c,d,e){let f=j(a,b,e),g=await k(f);g.values[c]=d,await l(f,g)}async function o(a,b,c,d){let e=j(a,b,d),f=await k(e);c in f.values&&(delete f.values[c],await l(e,f))}async function p(a,b,c){return Object.keys((await k(j(a,b,c))).values).sort()}async function q(a,b,c){let e=j(a,b,c);try{await d.promises.unlink(e)}catch{}}},45730:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{checkGithubUpdate:()=>l,installFromGithubConfirmed:()=>k,w:()=>j});var e=c(56149),f=c(20050),g=c(8118),h=c(99861),i=a([h]);async function j(a){let b;try{b=function(a){let b,c,d="HEAD",e=/^github:([^/]+)\/([^@]+)(?:@(.+))?$/.exec(a.trim());if(e)b=e[1],c=e[2],e[3]&&(d=e[3]);else{let e;try{e=new URL(a)}catch{throw Error("not a valid URL")}if("github.com"!==e.hostname)throw Error("only github.com URLs are supported");let f=e.pathname.split("/").filter(Boolean);if(f.length<2)throw Error("URL must include owner/repo");b=f[0],c=f[1].replace(/\.git$/,""),"tree"===f[2]&&f[3]&&(d=f.slice(3).join("/"))}return{owner:b,repo:c,ref:d}}(a)}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}try{let a=await m(b),c={...b,sha:a},{manifest:d,files:e,sizes:f}=await o(c);return{ok:!0,preview:{source:c,manifest:d,files:e,sizes:f}}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function k(a){let b=`github:${a.preview.source.owner}/${a.preview.source.repo}@${a.preview.source.sha}`,c=await (0,g.gd)({scope:a.scope,...a.rootId?{rootId:a.rootId}:{},manifest:a.preview.manifest,files:a.preview.files,source:{type:"github",origin:b,fetchedAt:new Date().toISOString(),installedBy:"github-installer"}});return await (0,h.buildUtility)(c),{scope:c.scope,id:c.manifest.id,origin:b}}async function l(a,b,c){let d=await (0,g.getUtility)(a,b,c);if(!d)throw Error("utility not found");let e=d.manifest.source?.origin;if(!e||!e.startsWith("github:"))throw Error("utility was not installed from github");let f=/^github:([^/]+)\/([^@]+)@(.+)$/.exec(e);if(!f)throw Error(`unrecognized github origin: ${e}`);let h={owner:f[1],repo:f[2],ref:"HEAD",sha:f[3]},i=await m(h);if(i===h.sha)return{upToDate:!0,currentSha:h.sha,latestSha:i};let j={...h,sha:i},{manifest:k,files:l,sizes:n}=await o(j);return{upToDate:!1,currentSha:h.sha,latestSha:i,preview:{source:j,manifest:k,files:l,sizes:n}}}async function m(a){let b=await fetch(`https://api.github.com/repos/${a.owner}/${a.repo}/commits/${encodeURIComponent(a.ref)}`,{headers:{Accept:"application/vnd.github+json"},signal:AbortSignal.timeout(8e3)});if(!b.ok)throw Error(`github: ${b.status} resolving ${a.owner}/${a.repo}@${a.ref}`);let c=await b.json();if(!c.sha)throw Error("github returned no sha");return c.sha}async function n(a,b,c=!1){let d=`https://raw.githubusercontent.com/${a.owner}/${a.repo}/${a.sha}/${b}`,e=await fetch(d,{signal:AbortSignal.timeout(1e4)});if(!e.ok){if(c&&404===e.status)return null;throw Error(`github raw: ${e.status} for ${b}`)}let f=await e.text();if(f.length>262144)throw Error(`file ${b} exceeds 262144 bytes`);return f}h=(i.then?(await i)():i)[0];let p=e.g1(e.Yj(),e.Yj());async function o(a){let b=await n(a,"manifest.json");if(!b)throw Error("manifest.json missing");let c=f.pL.parse(JSON.parse(b)),d={},e={},g=await n(a,c.ui);if(!g)throw Error(`${c.ui} missing`);d[c.ui]=g,e[c.ui]=Buffer.byteLength(g,"utf8");let h=await n(a,"README.md",!0);for(let b of(h&&(d["README.md"]=h,e["README.md"]=Buffer.byteLength(h,"utf8")),c.serverActions)){let c=await n(a,b.entry);if(!c)throw Error(`server action entry ${b.entry} missing`);d[b.entry]=c,e[b.entry]=Buffer.byteLength(c,"utf8")}let i=`https://raw.githubusercontent.com/${a.owner}/${a.repo}/${a.sha}/icon.png`,j=await fetch(i,{signal:AbortSignal.timeout(5e3)});if(j.ok){let a=Buffer.from(await j.arrayBuffer());a.length<=32768&&(d["icon.png"]=a.toString("base64"),e["icon.png"]=a.length)}return p.parse(d),{manifest:c,files:d,sizes:e}}d()}catch(a){d(a)}})}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><!--og_wC7UPkGtJDiapaTgBr--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/87e01f779d555d04.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-5fca180586957874.js"/><script src="/_next/static/chunks/6fe292aa-7126ff9d6732e864.js" async=""></script><script src="/_next/static/chunks/146-ccee3b26755b68c8.js" async=""></script><script src="/_next/static/chunks/main-app-ebe67847147d19aa.js" async=""></script><script src="/_next/static/chunks/4400-cdb1f7913ae34e09.js" async=""></script><script src="/_next/static/chunks/1217-407174d9b164a499.js" async=""></script><script src="/_next/static/chunks/5097-f07f6aeee3f60a33.js" async=""></script><script src="/_next/static/chunks/9045-731ff0865352dd95.js" async=""></script><script src="/_next/static/chunks/app/layout-9a59ed07c18cb786.js" async=""></script><meta name="robots" content="noindex"/><title>Reflex</title><meta name="description" content="Local-first knowledge base built by an agent."/><title>404: This page could not be found.</title><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div class="h-screen flex"><aside class="w-72 shrink-0 border-r bg-muted/30 flex flex-col"><div class="px-4 py-4 flex items-center gap-2 border-b"><span class="reflex-gradient inline-flex h-7 w-7 items-center justify-center rounded-lg text-white shadow-sm"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sparkles h-4 w-4"><path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"></path><path d="M20 3v4"></path><path d="M22 5h-4"></path><path d="M4 17v2"></path><path d="M5 18H3"></path></svg></span><div class="leading-tight"><a class="text-sm font-semibold tracking-tight hover:underline" href="/">Reflex</a><div class="text-[10px] uppercase tracking-wider text-muted-foreground">knowledge base</div></div></div><div dir="ltr" data-slot="scroll-area" class="relative flex-1" style="position:relative;--radix-scroll-area-corner-width:0px;--radix-scroll-area-corner-height:0px"><style>[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}</style><div data-radix-scroll-area-viewport="" data-slot="scroll-area-viewport" class="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1" style="overflow-x:hidden;overflow-y:hidden"><div style="min-width:100%;display:table"><nav class="px-2 pt-3 pb-6"><div class="px-2 mb-1 text-[10px] uppercase tracking-wider text-muted-foreground">Пространства</div><div class="px-2 py-3 text-xs text-muted-foreground">Пока пусто.</div><div class="mt-2 px-2"><a data-slot="button" data-variant="ghost" data-size="sm" class="inline-flex shrink-0 items-center font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5 h-7 w-full justify-start text-xs" href="/roots/new"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-plus mr-1 h-3.5 w-3.5"><path d="M12 10v6"></path><path d="M9 13h6"></path><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"></path></svg> Добавить пространство</a></div></nav></div></div></div><div data-orientation="horizontal" role="none" data-slot="separator" class="shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px"></div><div class="px-2 py-2 space-y-0.5"><a data-slot="button" data-variant="ghost" data-size="sm" class="inline-flex shrink-0 items-center text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5 w-full justify-start" href="/utilities"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-boxes mr-2 h-4 w-4"><path d="M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z"></path><path d="m7 16.5-4.74-2.85"></path><path d="m7 16.5 5-3"></path><path d="M7 16.5v5.17"></path><path d="M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z"></path><path d="m17 16.5-5-3"></path><path d="m17 16.5 4.74-2.85"></path><path d="M17 16.5v5.17"></path><path d="M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z"></path><path d="M12 8 7.26 5.15"></path><path d="m12 8 4.74-2.85"></path><path d="M12 13.5V8"></path></svg> Мини-приложения</a><a data-slot="button" data-variant="ghost" data-size="sm" class="inline-flex shrink-0 items-center text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5 w-full justify-start" href="/audit"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-search mr-2 h-4 w-4"><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><path d="M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3"></path><path d="m9 18-1.5-1.5"></path><circle cx="5" cy="14" r="3"></circle></svg> Аудит</a><a data-slot="button" data-variant="ghost" data-size="sm" class="inline-flex shrink-0 items-center text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5 w-full justify-start" href="/settings"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings mr-2 h-4 w-4"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg> Settings</a></div></aside><main class="flex-1 min-w-0 flex flex-col"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>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)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--></main></div><section aria-label="Notifications alt+T" tabindex="-1" aria-live="polite" aria-relevant="additions text" aria-atomic="false"></section><script src="/_next/static/chunks/webpack-5fca180586957874.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n3:I[26957,[],\"\"]\n4:I[97369,[],\"\"]\n5:I[21968,[],\"OutletBoundary\"]\n7:I[33705,[],\"AsyncMetadataOutlet\"]\n9:I[21968,[],\"ViewportBoundary\"]\nb:I[21968,[],\"MetadataBoundary\"]\nc:\"$Sreact.suspense\"\ne:I[6287,[],\"\"]\n:HL[\"/_next/static/css/87e01f779d555d04.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"og_wC7UPkGtJDiapaTgBr\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/87e01f779d555d04.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],\"$L2\"]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"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.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$L6\",[\"$\",\"$L7\",null,{\"promise\":\"$@8\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$L9\",null,{\"children\":\"$La\"}],null],[\"$\",\"$Lb\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$c\",null,{\"fallback\":null,\"children\":\"$Ld\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$e\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n6:null\n"])</script><script>self.__next_f.push([1,"8:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"Reflex\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Local-first knowledge base built by an agent.\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"d:\"$8:metadata\"\n"])</script><script>self.__next_f.push([1,"f:I[25990,[\"4400\",\"static/chunks/4400-cdb1f7913ae34e09.js\",\"1217\",\"static/chunks/1217-407174d9b164a499.js\",\"5097\",\"static/chunks/5097-f07f6aeee3f60a33.js\",\"9045\",\"static/chunks/9045-731ff0865352dd95.js\",\"7177\",\"static/chunks/app/layout-9a59ed07c18cb786.js\"],\"AppSidebar\"]\n10:I[43450,[\"4400\",\"static/chunks/4400-cdb1f7913ae34e09.js\",\"1217\",\"static/chunks/1217-407174d9b164a499.js\",\"5097\",\"static/chunks/5097-f07f6aeee3f60a33.js\",\"9045\",\"static/chunks/9045-731ff0865352dd95.js\",\"7177\",\"static/chunks/app/layout-9a59ed07c18cb786.js\"],\"Toaster\"]\n2:[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"body\",null,{\"children\":[[\"$\",\"div\",null,{\"className\":\"h-screen flex\",\"children\":[[\"$\",\"$Lf\",null,{\"initialRoots\":[]}],[\"$\",\"main\",null,{\"className\":\"flex-1 min-w-0 flex flex-col\",\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}],[\"$\",\"$L10\",null,{\"richColors\":true,\"closeButton\":true}]]}]}]\n"])</script></body></html>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2488],{8190:(e,t,a)=>{a.d(t,{CommandBar:()=>h});var r=a(4624),s=a(99356),n=a(69285),l=a(95265),i=a(56221),o=a(29574),c=a(71377),d=a(63602),u=a(63514),x=a(37043);function h(e){let{rootId:t,focusFile:a}=e,[,h]=(0,s.useTransition)(),m=(0,n.useRouter)();return(0,r.jsx)(d.E,{label:"Спроси Reflex",children:(0,r.jsx)(x.L,{rootId:t,placeholder:"Задай вопрос о проекте или дай команду…",submitLabel:"Начать",pendingLabel:"Старт",SubmitIcon:l.A,onSubmit:async e=>{let{message:r,attachments:s}=e;return await new Promise(e=>{h(async()=>{let n=await (0,o.g)(t,r,s,a);if(!n.ok){var l;i.oR.error(null!=(l=n.error)?l:"Failed to start"),e(!1);return}(0,u.$d)(u.Zi.topicsChanged(t)),r.trim()&&(0,c.h)(t,n.topicId,r).then(e=>{e.ok&&(0,u.$d)(u.Zi.topicsChanged(t))}),m.push("/roots/".concat(t,"/chat/").concat(n.topicId)),e(!0)})})}})})}},22841:(e,t,a)=>{a.d(t,{bq:()=>u,eb:()=>h,gC:()=>x,l6:()=>c,yv:()=>d});var r=a(4624);a(99356);var s=a(69709),n=a(43153),l=a(59728),i=a(85314),o=a(13506);function c(e){let{...t}=e;return(0,r.jsx)(i.Root,{"data-slot":"select",...t})}function d(e){let{...t}=e;return(0,r.jsx)(i.Value,{"data-slot":"select-value",...t})}function u(e){let{className:t,size:a="default",children:n,...l}=e;return(0,r.jsxs)(i.Trigger,{"data-slot":"select-trigger","data-size":a,className:(0,o.cn)("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",t),...l,children:[n,(0,r.jsx)(i.Icon,{asChild:!0,children:(0,r.jsx)(s.A,{className:"size-4 opacity-50"})})]})}function x(e){let{className:t,children:a,position:s="item-aligned",align:n="center",...l}=e;return(0,r.jsx)(i.Portal,{children:(0,r.jsxs)(i.Content,{"data-slot":"select-content",className:(0,o.cn)("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95","popper"===s&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:s,align:n,...l,children:[(0,r.jsx)(m,{}),(0,r.jsx)(i.Viewport,{className:(0,o.cn)("p-1","popper"===s&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),(0,r.jsx)(p,{})]})})}function h(e){let{className:t,children:a,...s}=e;return(0,r.jsxs)(i.Item,{"data-slot":"select-item",className:(0,o.cn)("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...s,children:[(0,r.jsx)("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,r.jsx)(i.ItemIndicator,{children:(0,r.jsx)(n.A,{className:"size-4"})})}),(0,r.jsx)(i.ItemText,{children:a})]})}function m(e){let{className:t,...a}=e;return(0,r.jsx)(i.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,r.jsx)(l.A,{className:"size-4"})})}function p(e){let{className:t,...a}=e;return(0,r.jsx)(i.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,r.jsx)(s.A,{className:"size-4"})})}},29574:(e,t,a)=>{a.d(t,{g:()=>s});var r=a(7911);let s=(0,r.createServerReference)("785d105fe4cdea0b27e02ecbec12f88d28a6ef1ecf",r.callServer,void 0,r.findSourceMapURL,"startTopicAction")},31666:(e,t,a)=>{a.d(t,{InsertImageButton:()=>C});var r=a(4624),s=a(99356),n=a(69285),l=a(39160),i=a(85253),o=a(13561),c=a(8096),d=a(43863),u=a(23262),x=a(56221),h=a(15523),m=a(71651),p=a(78825),b=a(22841),g=a(49881),f=a(80192),v=a(43504),j=a(7911);let y=(0,j.createServerReference)("40592e91ff6e45bcd5a1659a170d69ea7f0bbb3bae",j.callServer,void 0,j.findSourceMapURL,"generateAction"),k=(0,j.createServerReference)("403e02c0908168bbaab9e23448c60b610c74150b60",j.callServer,void 0,j.findSourceMapURL,"searchAction"),w=(0,j.createServerReference)("405799ec9d53b8cf23bdf36ceba44245da6e051e45",j.callServer,void 0,j.findSourceMapURL,"attachAction"),N=(0,j.createServerReference)("40542a694458a4348c3281c06090a935360ab32c3e",j.callServer,void 0,j.findSourceMapURL,"uploadAction"),S=["1:1","16:9","9:16","4:3","3:4","21:9"];function R(e){let{rootId:t,open:a,onOpenChange:n,onInsert:j}=e,[R,C]=(0,s.useState)(""),[z,A]=(0,s.useState)("gemini"),[P,I]=(0,s.useState)("1:1"),[T,U]=(0,s.useState)(!0),[_,B]=(0,s.useState)(null),[L,E]=(0,s.useTransition)(),[K,$]=(0,s.useState)(""),[F,M]=(0,s.useState)("unsplash"),[V,q]=(0,s.useState)([]),[J,X]=(0,s.useTransition)(),[O,D]=(0,s.useState)(null),[Z,G]=(0,s.useState)(!0),[H,Q]=(0,s.useState)(""),[W,Y]=(0,s.useState)(!0),[ee,et]=(0,s.useTransition)();if((0,s.useEffect)(()=>{if(!a)return;let e=e=>{"Escape"===e.key&&n(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[a,n]),!a)return null;let ea=()=>{K.trim()&&(q([]),X(async()=>{let e=await k({rootId:t,query:K.trim(),provider:F,count:12});if(!e.ok)return void x.oR.error(e.error);q(e.results)}))};return(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:e=>{e.target===e.currentTarget&&n(!1)},children:[(0,r.jsx)("div",{"aria-hidden":!0,className:"absolute inset-0 bg-background/80 backdrop-blur-sm",onClick:()=>n(!1)}),(0,r.jsxs)("div",{className:"relative bg-card border rounded-lg shadow-xl w-full max-w-3xl max-h-[85vh] flex flex-col",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 border-b",children:[(0,r.jsx)(l.A,{className:"h-4 w-4 text-violet-600"}),(0,r.jsx)("h2",{className:"text-sm font-medium flex-1",children:"Картинка в KB"}),(0,r.jsx)(i.$,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>n(!1),children:(0,r.jsx)(o.A,{className:"h-4 w-4"})})]}),(0,r.jsxs)(g.tU,{defaultValue:"generate",className:"flex-1 min-h-0 flex flex-col",children:[(0,r.jsxs)(g.j7,{className:"mx-4 mt-3 self-start",children:[(0,r.jsxs)(g.Xi,{value:"generate",children:[(0,r.jsx)(c.A,{className:"mr-1 h-3.5 w-3.5"})," Сгенерировать"]}),(0,r.jsxs)(g.Xi,{value:"search",children:[(0,r.jsx)(d.A,{className:"mr-1 h-3.5 w-3.5"})," Найти"]}),(0,r.jsxs)(g.Xi,{value:"upload",children:[(0,r.jsx)(u.A,{className:"mr-1 h-3.5 w-3.5"})," Загрузить"]})]}),(0,r.jsxs)(f.F,{className:"flex-1 min-h-0",children:[(0,r.jsxs)(g.av,{value:"generate",className:"px-4 py-4 space-y-3",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(p.J,{htmlFor:"img-prompt",children:"Промпт"}),(0,r.jsx)(m.T,{id:"img-prompt",value:R,onChange:e=>C(e.target.value),placeholder:"Подробное описание: стиль, композиция, освещение...",rows:4})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(p.J,{children:"Провайдер"}),(0,r.jsxs)(b.l6,{value:z,onValueChange:e=>A(e),children:[(0,r.jsx)(b.bq,{children:(0,r.jsx)(b.yv,{})}),(0,r.jsxs)(b.gC,{children:[(0,r.jsx)(b.eb,{value:"gemini",children:"Gemini Nano Banana"}),(0,r.jsx)(b.eb,{value:"codex",children:"Codex $imagegen"})]})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(p.J,{children:"Соотношение"}),(0,r.jsxs)(b.l6,{value:P,onValueChange:I,children:[(0,r.jsx)(b.bq,{children:(0,r.jsx)(b.yv,{})}),(0,r.jsx)(b.gC,{children:S.map(e=>(0,r.jsx)(b.eb,{value:e,children:e},e))})]})]})]}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:T,onChange:e=>U(e.target.checked)}),"Сохранить как отдельную запись в KB (kind: image)"]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(i.$,{type:"button",size:"sm",onClick:()=>{R.trim()&&(B(null),E(async()=>{let e=await y({rootId:t,prompt:R.trim(),provider:z,aspectRatio:P,attachToKb:T});if(!e.ok)return void x.oR.error(e.error);B({url:e.url,markdown:e.markdown,...e.kbRelPath?{kbRelPath:e.kbRelPath}:{}})}))},disabled:L||!R.trim(),children:L?"Генерирую...":"Сгенерировать"}),L&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:"Может занять до минуты"})]}),L?(0,r.jsx)(v.E,{className:"h-64 w-full"}):_?(0,r.jsxs)("div",{className:"space-y-2 border rounded p-3",children:[(0,r.jsx)("img",{src:_.url,alt:R,className:"max-h-80 mx-auto rounded"}),(0,r.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,r.jsx)(i.$,{type:"button",size:"sm",variant:"outline",onClick:()=>B(null),children:"Ещё раз"}),(0,r.jsx)(i.$,{type:"button",size:"sm",onClick:()=>{_&&(null==j||j(_),x.oR.success(_.kbRelPath?"Сохранено в KB: ".concat(_.kbRelPath):"Картинка готова"),n(!1))},children:"Вставить"})]})]}):null]}),(0,r.jsxs)(g.av,{value:"search",className:"px-4 py-4 space-y-3",children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(h.p,{value:K,onChange:e=>$(e.target.value),placeholder:"например: mountains sunrise",onKeyDown:e=>{"Enter"===e.key&&ea()}}),(0,r.jsxs)(b.l6,{value:F,onValueChange:e=>M(e),children:[(0,r.jsx)(b.bq,{className:"w-36",children:(0,r.jsx)(b.yv,{})}),(0,r.jsxs)(b.gC,{children:[(0,r.jsx)(b.eb,{value:"unsplash",children:"Unsplash"}),(0,r.jsx)(b.eb,{value:"pexels",children:"Pexels"}),(0,r.jsx)(b.eb,{value:"brave",children:"Brave (весь веб)"})]})]}),(0,r.jsx)(i.$,{type:"button",size:"sm",onClick:ea,disabled:J||!K.trim(),children:"Найти"})]}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:Z,onChange:e=>G(e.target.checked)}),"Сохранить как отдельную запись в KB (kind: image)"]}),J&&0===V.length?(0,r.jsx)("div",{className:"grid grid-cols-3 gap-2",children:Array.from({length:6}).map((e,t)=>(0,r.jsx)(v.E,{className:"h-32 w-full"},t))}):V.length>0?(0,r.jsx)("div",{className:"grid grid-cols-3 gap-2",children:V.map(e=>(0,r.jsxs)("button",{type:"button",disabled:null!==O,onClick:()=>{D(e.url),X(async()=>{let a=await w({rootId:t,sourceUrl:e.url,alt:K.trim()||"image",attribution:e.attribution,attachToKb:Z});if(D(null),!a.ok)return void x.oR.error(a.error);null==j||j({url:a.url,markdown:a.markdown,...a.kbRelPath?{kbRelPath:a.kbRelPath}:{}}),x.oR.success(a.kbRelPath?"Сохранено в KB: ".concat(a.kbRelPath):"Картинка добавлена в проект"),n(!1)})},className:"group relative overflow-hidden rounded border hover:border-violet-500 disabled:opacity-50",title:"".concat(e.attribution.name," \xb7 ").concat(e.provider),children:[(0,r.jsx)("img",{src:e.thumb,alt:"",className:"h-32 w-full object-cover"}),(0,r.jsx)("div",{className:"absolute bottom-0 inset-x-0 px-1.5 py-0.5 text-[10px] bg-black/60 text-white truncate",children:e.attribution.name}),O===e.url&&(0,r.jsx)("div",{className:"absolute inset-0 bg-black/40 flex items-center justify-center text-xs text-white",children:"Сохраняю…"})]},e.url))}):(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Нужен ключ Unsplash / Pexels в Settings → Images."})]}),(0,r.jsxs)(g.av,{value:"upload",className:"px-4 py-4 space-y-3",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(p.J,{htmlFor:"img-alt",children:"Подпись (alt)"}),(0,r.jsx)(h.p,{id:"img-alt",value:H,onChange:e=>Q(e.target.value),placeholder:"Что на картинке"})]}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:W,onChange:e=>Y(e.target.checked)}),"Сохранить как отдельную запись в KB (kind: image)"]}),(0,r.jsx)(h.p,{type:"file",accept:"image/*",disabled:ee,onChange:e=>{var a;let r=null==(a=e.target.files)?void 0:a[0];r&&et(async()=>{let e=function(e){let t=new Uint8Array(e),a="";for(let e=0;e<t.length;e+=32768){let r=t.subarray(e,e+32768);a+=String.fromCharCode.apply(null,Array.from(r))}return btoa(a)}(await r.arrayBuffer()),a=await N({rootId:t,base64:e,mime:r.type,alt:H||r.name.replace(/\.[^.]+$/,""),attachToKb:W});if(!a.ok)return void x.oR.error(a.error);null==j||j({url:a.url,markdown:a.markdown,...a.kbRelPath?{kbRelPath:a.kbRelPath}:{}}),x.oR.success(a.kbRelPath?"Сохранено в KB: ".concat(a.kbRelPath):"Картинка загружена"),n(!1)})}}),ee&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Загружаю…"})]})]})]})]})]})}function C(e){let{rootId:t,redirectToKb:a=!0}=e,[o,c]=(0,s.useState)(!1),d=(0,n.useRouter)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>c(!0),children:[(0,r.jsx)(l.A,{className:"mr-1 h-4 w-4"})," Картинка"]}),(0,r.jsx)(R,{rootId:t,open:o,onOpenChange:c,onInsert:e=>{let{kbRelPath:r}=e;if(a&&r){let e=r.split("/").map(encodeURIComponent).join("/");d.push("/roots/".concat(t,"/kb/").concat(e))}}})]})}},43504:(e,t,a)=>{a.d(t,{E:()=>n});var r=a(4624),s=a(13506);function n(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"skeleton",className:(0,s.cn)("animate-pulse rounded-md bg-accent",t),...a})}},49881:(e,t,a)=>{a.d(t,{Xi:()=>d,av:()=>u,j7:()=>c,tU:()=>i});var r=a(4624);a(99356);var s=a(60621),n=a(86631),l=a(13506);function i(e){let{className:t,orientation:a="horizontal",...s}=e;return(0,r.jsx)(n.Root,{"data-slot":"tabs","data-orientation":a,orientation:a,className:(0,l.cn)("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",t),...s})}let o=(0,s.F)("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function c(e){let{className:t,variant:a="default",...s}=e;return(0,r.jsx)(n.List,{"data-slot":"tabs-list","data-variant":a,className:(0,l.cn)(o({variant:a}),t),...s})}function d(e){let{className:t,...a}=e;return(0,r.jsx)(n.Trigger,{"data-slot":"tabs-trigger",className:(0,l.cn)("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",t),...a})}function u(e){let{className:t,...a}=e;return(0,r.jsx)(n.Content,{"data-slot":"tabs-content",className:(0,l.cn)("flex-1 outline-none",t),...a})}},71377:(e,t,a)=>{a.d(t,{h:()=>s});var r=a(7911);let s=(0,r.createServerReference)("708dcc45d46350264144b1174a5c785ce551df32be",r.callServer,void 0,r.findSourceMapURL,"generateTopicTitleAction")},72162:(e,t,a)=>{a.d(t,{N:()=>s});var r=a(7911);let s=(0,r.createServerReference)("0063e3fe3db49022c4ce35640dada850406cc92dac",r.callServer,void 0,r.findSourceMapURL,"getTunnelStatusAction")},76498:(e,t,a)=>{a.d(t,{ShareButton:()=>m});var r=a(4624),s=a(99356),n=a(30441),l=a(43153),i=a(9598),o=a(13561),c=a(3024),d=a(56221),u=a(7911);let x=(0,u.createServerReference)("4007abcd80a105f87ec8d56c6bdaf7b2fb77a062ea",u.callServer,void 0,u.findSourceMapURL,"createShareAction");var h=a(72162);function m(e){let[t,a]=(0,s.useState)(!1),[u,m]=(0,s.useState)(""),[p,b]=(0,s.useTransition)(),[g,f]=(0,s.useState)(null);return t?g?(0,r.jsxs)("div",{className:"rounded border bg-card p-2 text-xs space-y-1.5 w-full max-w-sm",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-emerald-700",children:[(0,r.jsx)(l.A,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{className:"font-medium",children:"Ссылка создана"})]}),(0,r.jsx)("a",{href:g.url,target:"_blank",rel:"noopener noreferrer",className:"block font-mono text-[11px] text-violet-700 hover:underline break-all",children:g.url}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>void navigator.clipboard.writeText(g.url).then(()=>d.oR.success("Скопировано")),className:"inline-flex items-center gap-1 rounded border px-2 py-0.5 hover:bg-accent",children:[(0,r.jsx)(i.A,{className:"h-3 w-3"}),"Скопировать"]}),(0,r.jsx)("button",{type:"button",onClick:()=>{f(null),a(!1),m("")},className:"text-muted-foreground hover:text-foreground",children:"Готово"})]})]}):(0,r.jsxs)("div",{className:"rounded border bg-card p-2 text-xs space-y-1.5 w-full max-w-sm",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(n.A,{className:"h-3.5 w-3.5 text-violet-600"}),(0,r.jsx)("span",{className:"font-medium",children:"Новая публичная ссылка"}),(0,r.jsx)("button",{type:"button",onClick:()=>a(!1),className:"ml-auto text-muted-foreground hover:text-foreground",children:(0,r.jsx)(o.A,{className:"h-3 w-3"})})]}),(0,r.jsx)("label",{className:"block text-[10px] text-muted-foreground",children:"Пароль (опционально)"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(c.A,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground pointer-events-none"}),(0,r.jsx)("input",{type:"password",value:u,onChange:e=>m(e.target.value),autoFocus:!0,placeholder:"пусто = открытая ссылка",className:"w-full rounded border bg-background pl-6 pr-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-violet-400"})]}),(0,r.jsx)("button",{type:"button",onClick:()=>{b(async()=>{var t;let a=await (0,h.N)(),r=await x({kind:e.kind,...e.rootId?{rootId:e.rootId}:{},...e.utilityScope?{utilityScope:e.utilityScope}:{},...e.utilityId?{utilityId:e.utilityId}:{},...e.kbRelPath?{kbRelPath:e.kbRelPath}:{},...e.label?{label:e.label}:{},...u.trim()?{password:u.trim()}:{}});if(!r.ok)return void d.oR.error(r.error);let s=null!=(t=a.status.publicUrl)?t:window.location.origin,n=new URL("/share/".concat(r.share.id),s).toString();f({share:r.share,url:n}),navigator.clipboard.writeText(n).catch(()=>null),d.oR.success(a.status.running?"Ссылка создана и скопирована":"Ссылка создана; запусти ngrok-туннель в настройках чтобы открыть извне")})},disabled:p,className:"w-full rounded bg-violet-600 text-white px-2 py-1 hover:bg-violet-700 disabled:opacity-50 inline-flex items-center justify-center gap-1",children:p?"Создание…":"Создать ссылку"}),(0,r.jsx)("p",{className:"text-[10px] text-muted-foreground",children:"Ссылку будет видно только после старта ngrok-туннеля (Настройки → Публичные ссылки)."})]}):(0,r.jsxs)("button",{type:"button",onClick:()=>a(!0),className:e.iconOnly?"p-1 rounded hover:bg-accent text-muted-foreground hover:text-violet-700":"inline-flex items-center gap-1 rounded border px-2 py-1 text-xs hover:bg-accent",title:"Создать публичную ссылку",children:[(0,r.jsx)(n.A,{className:"h-3.5 w-3.5"}),!e.iconOnly&&"Поделиться"]})}},80192:(e,t,a)=>{a.d(t,{F:()=>l});var r=a(4624);a(99356);var s=a(14884),n=a(13506);function l(e){let{className:t,children:a,...l}=e;return(0,r.jsxs)(s.Root,{"data-slot":"scroll-area",className:(0,n.cn)("relative",t),...l,children:[(0,r.jsx)(s.Viewport,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:a}),(0,r.jsx)(i,{}),(0,r.jsx)(s.Corner,{})]})}function i(e){let{className:t,orientation:a="vertical",...l}=e;return(0,r.jsx)(s.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:a,className:(0,n.cn)("flex touch-none p-px transition-colors select-none","vertical"===a&&"h-full w-2.5 border-l border-l-transparent","horizontal"===a&&"h-2.5 flex-col border-t border-t-transparent",t),...l,children:(0,r.jsx)(s.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2684],{13506:(e,t,r)=>{r.d(t,{cn:()=>i});var a=r(47989),n=r(55701);function i(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.QP)((0,a.$)(t))}},37043:(e,t,r)=>{r.d(t,{L:()=>B});var a=r(4624),n=r(99356),i=r(86515),s=r(41234),l=r(71789),o=r(53732),c=r(3606),d=r(31108),u=r(8096),p=r(46972),m=r(16213),g=r(59145),f=r(27474),x=r(39624),h=r(3239),v=r(9721),b=r(84860),k=r(7293),w=r(49623),y=r(64417),j=r(13561),N=r(69285),A=r(56221),C=r(85253),S=r(71651),R=r(13506),D=r(7911);let E=(0,D.createServerReference)("606e7cf2122db462d430d65fafa8b5d27f7da3a365",D.callServer,void 0,D.findSourceMapURL,"searchMentionsAction"),T=[{id:"plan",trigger:"plan",label:"/plan",description:"Сначала покажи план — Reflex распишет шаги и подождёт одобрения.",kind:"agent-mode",usage:"/plan <задача>",icon:"ListChecks"},{id:"goal",trigger:"goal",label:"/goal",description:"Поставь цель — Reflex будет двигаться к ней сам, без напоминаний.",kind:"agent-mode",usage:"/goal <чего достичь>",icon:"Target"},{id:"research",trigger:"research",label:"/research",description:"Глубокое исследование темы — поиск в интернете + сводка с источниками.",kind:"agent-mode",usage:"/research <тема>",icon:"Telescope"},{id:"widget",trigger:"widget",label:"/widget",description:"Создать карточку на дашборде пространства.",kind:"agent-mode",usage:"/widget <что показать>",icon:"LayoutGrid"},{id:"workflow",trigger:"workflow",label:"/workflow",description:"Собрать рецепт — линейная автоматизация из шагов под задачу.",kind:"agent-mode",usage:"/workflow <что автоматизировать>",icon:"Workflow"},{id:"remember",trigger:"remember",label:"/remember",description:"Запомнить заметку — сразу в память, без обращения к AI.",kind:"direct",usage:"/remember <что запомнить>",icon:"BookmarkPlus"},{id:"mcp",trigger:"mcp",label:"/mcp",description:"Подключить внешний сервис (мастер настройки откроется в чате).",kind:"agent-mode",usage:"/mcp <что нужно>",icon:"PackagePlus"},{id:"skill",trigger:"skill",label:"/skill",description:"Подключить роль — готовый набор инструкций на этот разговор.",kind:"agent-mode",usage:"/skill <id-роли> [запрос]",icon:"Sparkles"},{id:"delete-topic",trigger:"delete-topic",label:"/delete-topic",description:"Удалить этот разговор (с подтверждением).",kind:"direct",usage:"/delete-topic",requiresConfirm:!0,allowEmpty:!0,icon:"Trash2"},{id:"clear-project",trigger:"clear-project",label:"/clear-project",description:"ОПАСНО: очистить пространство — все разговоры, карточки, память. Двойное подтверждение.",kind:"direct",usage:"/clear-project",requiresConfirm:!0,allowEmpty:!0,icon:"AlertOctagon"},{id:"util",trigger:"util",label:"/util",description:"Открыть мини-приложение (по части названия или из списка).",kind:"direct",usage:"/util <часть названия или id>",allowEmpty:!0,icon:"Boxes"},{id:"help",trigger:"help",label:"/help",description:"Список доступных команд.",kind:"direct",usage:"/help",allowEmpty:!0,icon:"HelpCircle"}],z=(0,D.createServerReference)("60a041d99708051ecf6bcc418197569ba8bf117c4e",D.callServer,void 0,D.findSourceMapURL,"rememberAction"),L=(0,D.createServerReference)("602464c9053e872e7146aa579075ab44484769b611",D.callServer,void 0,D.findSourceMapURL,"deleteCurrentTopicCommand"),M=(0,D.createServerReference)("603b3e77316c66236e2c5db8d0eec00211b85d8a06",D.callServer,void 0,D.findSourceMapURL,"openUtilityAction"),P=(0,D.createServerReference)("405f5fc018f977c92bc52c2c94ffb3e14b535d81f2",D.callServer,void 0,D.findSourceMapURL,"clearProjectAction");var _=r(63514);let F={ListChecks:i.A,Target:s.A,Telescope:l.A,LayoutGrid:o.A,BookmarkPlus:c.A,PackagePlus:d.A,Sparkles:u.A,Trash2:p.A,AlertOctagon:m.A,HelpCircle:g.A,Workflow:f.A,Boxes:x.A};function B(e){let{rootId:t,topicId:r,placeholder:i,submitLabel:s,pendingLabel:l,SubmitIcon:o,disabled:c,onSubmit:d,active:u,onStop:p,clarifyLabel:m="Уточнить",stopLabel:g="Стоп"}=e,f=(0,N.useRouter)(),[x,k]=(0,n.useState)(""),[w,y]=(0,n.useState)([]),[j,D]=(0,n.useState)(!1),[z,L]=(0,n.useState)(!1),[M,P]=(0,n.useState)(!1),_=(0,n.useRef)(null),F=(0,n.useRef)(null),[B,q]=(0,n.useState)(null),[H,O]=(0,n.useState)([]),[Z,G]=(0,n.useState)(0),[V,I]=(0,n.useState)(!1),Q=(0,n.useRef)(0),[J,X]=(0,n.useState)(null),Y=(0,n.useCallback)(()=>{let e=_.current;e&&(e.style.height="auto",e.style.height=Math.min(e.scrollHeight,240)+"px")},[]);(0,n.useEffect)(()=>{Y()},[x,Y]);let ee=(0,n.useCallback)((e,r)=>{let a=r;for(;a>0;){let t=e[a-1];if("@"===t){a-=1;break}if(/\s/.test(t)){a=-1;break}a-=1}if(a<0||"@"!==e[a]||a>0&&!/\s/.test(e[a-1])){q(null),O([]);return}let n=e.slice(a+1,r);q({start:a,end:r}),G(0),I(!0);let i=++Q.current;(async()=>{let e=await E(t,n);Q.current===i&&(I(!1),O(e.ok?e.items:[]))})()},[t]),et=(0,n.useCallback)(()=>{q(null),O([]),Q.current++},[]),er=(0,n.useCallback)(e=>{if(!e.startsWith("/")||e.indexOf(" ")>=0)return void X(null);let t=e.slice(1).toLowerCase(),r=T.filter(e=>e.trigger.startsWith(t)||e.label.toLowerCase().includes(t)||e.description.toLowerCase().includes(t));if(0===r.length)return void X(null);X({items:r,index:0})},[]),ea=(0,n.useCallback)(()=>X(null),[]),en=(0,n.useCallback)(e=>{let t=_.current,r="/".concat(e.trigger).concat(e.allowEmpty&&"direct"===e.kind?"":" ");k(r),X(null),requestAnimationFrame(()=>{t&&(t.focus(),t.setSelectionRange(r.length,r.length))})},[]),ei=(0,n.useCallback)(e=>{let t=_.current;if(!t||!B)return;let r=x.slice(0,B.start),a=x.slice(B.end),n="@".concat(e.relPath," ");k(r+n+a),et();let i=r.length+n.length;requestAnimationFrame(()=>{t.focus(),t.setSelectionRange(i,i)})},[x,B,et]),es=(0,n.useCallback)(async e=>{if(0!==e.length){D(!0);try{let a=new FormData;for(let t of e)a.append("files",t);let n=await fetch("/api/roots/".concat(t,"/attachments"),{method:"POST",body:a});if(!n.ok){var r;let e=await n.json().catch(()=>({}));A.oR.error(null!=(r=e.error)?r:"Не удалось загрузить (".concat(n.status,")"));return}let i=await n.json();y(e=>[...e,...i.files])}catch(e){A.oR.error(e instanceof Error?e.message:String(e))}finally{D(!1)}}},[t]),el=x.trim().length>0||w.length>0,eo=u&&p?el?"clarify":"stop":"send",ec=(0,n.useCallback)(async()=>{if(z)return;if("stop"===eo){if(!p)return;L(!0);try{await p()}finally{L(!1)}return}let e=x.trim();if(!e&&0===w.length||c&&"send"===eo)return;let a=function(e){var t,r,a;let n=e.trim();if(!n.startsWith("/"))return null;let i=/^\/([a-z][a-z0-9-]*)(?:\s+([\s\S]*))?$/.exec(n);if(!i)return null;let s=(r=i[1],null!=(a=T.find(e=>e.trigger===r))?a:null);return s?{def:s,payload:(null!=(t=i[2])?t:"").trim()}:null}(e);if(a&&"direct"===a.def.kind){L(!0);try{await $({cmd:a.def,payload:a.payload,rootId:t,topicId:r,router:f}),k("")}finally{L(!1)}return}L(!0);try{"clarify"===eo&&p&&await p(),await d({message:e,attachments:w})&&(k(""),y([]))}finally{L(!1)}},[x,w,z,c,eo,p,d,t,r,f]),ed=!z&&!j&&("stop"===eo||el&&(!c||"clarify"===eo));return(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),ec()},onDragEnter:e=>{Array.from(e.dataTransfer.types).includes("Files")&&(e.preventDefault(),P(!0))},onDragOver:e=>{Array.from(e.dataTransfer.types).includes("Files")&&(e.preventDefault(),P(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||P(!1)},onDrop:e=>{e.preventDefault(),P(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&es(t)},className:(0,R.cn)("space-y-2 rounded-md transition-colors",M&&"ring-2 ring-ring/60 bg-accent/40"),children:[w.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:w.map((e,t)=>(0,a.jsx)(W,{attachment:e,onRemove:()=>y(t=>t.filter(t=>t!==e))},e.absPath+t))}),(0,a.jsxs)("div",{className:"flex items-end gap-2",children:[(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)(S.T,{ref:_,value:x,onChange:e=>{k(e.target.value),ee(e.target.value,e.target.selectionStart),er(e.target.value)},onKeyUp:e=>{let t=e.currentTarget;ee(t.value,t.selectionStart),er(t.value)},onClick:e=>{let t=e.currentTarget;ee(t.value,t.selectionStart),er(t.value)},onBlur:()=>{setTimeout(()=>{et(),ea()},150)},onKeyDown:e=>{if(J){if("ArrowDown"===e.key){e.preventDefault(),X(e=>e?{...e,index:Math.min(e.items.length-1,e.index+1)}:null);return}if("ArrowUp"===e.key){e.preventDefault(),X(e=>e?{...e,index:Math.max(0,e.index-1)}:null);return}if("Tab"===e.key){e.preventDefault();let t=J.items[J.index];t&&en(t);return}if("Escape"===e.key){e.preventDefault(),ea();return}}if(B&&H.length>0){if("ArrowDown"===e.key){e.preventDefault(),G(e=>Math.min(H.length-1,e+1));return}if("ArrowUp"===e.key){e.preventDefault(),G(e=>Math.max(0,e-1));return}if("Enter"===e.key||"Tab"===e.key){e.preventDefault();let t=H[Z];t&&ei(t);return}if("Escape"===e.key){e.preventDefault(),et();return}}"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),ec())},onPaste:e=>{let t=Array.from(e.clipboardData.files);t.length>0&&(e.preventDefault(),es(t))},placeholder:i,rows:1,disabled:c||z,className:"resize-none min-h-[44px] max-h-60 text-base bg-background/70 border-transparent focus-visible:border-ring py-2.5 w-full"}),B&&(0,a.jsx)(K,{items:H,index:Z,loading:V,onPick:ei,onHover:e=>G(e)}),J&&!B&&(0,a.jsx)(U,{items:J.items,index:J.index,onPick:en,onHover:e=>X(t=>t?{...t,index:e}:null),topicAvailable:!!r})]}),(0,a.jsx)("input",{ref:F,type:"file",multiple:!0,className:"hidden",onChange:e=>{var t;let r=Array.from(null!=(t=e.target.files)?t:[]);r.length>0&&es(r),e.target.value=""}}),(0,a.jsx)(C.$,{type:"button",size:"icon",variant:"ghost",onClick:()=>{var e;return null==(e=F.current)?void 0:e.click()},disabled:j||z||c,title:"Прикрепить файлы (можно drag&drop или Cmd+V)",className:"h-11 w-11 shrink-0",children:j?(0,a.jsx)(h.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(v.A,{className:"h-4 w-4"})}),(0,a.jsx)(C.$,{type:"submit",size:"lg",disabled:!ed,variant:"stop"===eo?"destructive":"default",className:"h-11 px-6 shadow-md shrink-0",children:z?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.A,{className:"mr-2 h-4 w-4 animate-spin"}),l]}):"stop"===eo?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b.A,{className:"mr-2 h-4 w-4",fill:"currentColor"}),g]}):"clarify"===eo?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o,{className:"mr-2 h-4 w-4"}),m]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o,{className:"mr-2 h-4 w-4"}),s]})})]}),(0,a.jsx)("div",{className:"text-[10px] text-muted-foreground",children:"Enter — отправить \xb7 Shift+Enter — новая строка \xb7 @ — упомянуть файл/заметку \xb7 `/` — команды \xb7 можно перетащить файлы или вставить из буфера"})]})}async function $(e){var t,r,a;let{cmd:n,payload:i,rootId:s,topicId:l,router:o}=e;if("help"===n.id){let e=T.map(e=>"• ".concat(e.label," — ").concat(e.description));A.oR.info("Доступные команды:\n".concat(e.join("\n")),{duration:12e3});return}if("remember"===n.id){if(!i)return void A.oR.error("Пусто — нечего запоминать. Использование: /remember <текст>");let e=await z(s,i);return void(e.ok?(A.oR.success(null!=(t=e.message)?t:"Сохранено в KB"),(0,_.$d)(_.Zi.kbChanged(s))):A.oR.error(e.error))}if("delete-topic"===n.id){if(!l)return void A.oR.error("Команда работает только внутри топика.");if(!confirm("Удалить этот топик? Это необратимо."))return;let e=await L(s,l);return void(e.ok?(A.oR.success(null!=(r=e.message)?r:"Удалено"),(0,_.$d)(_.Zi.topicsChanged(s)),e.redirectTo&&o.push(e.redirectTo)):A.oR.error(e.error))}if("util"===n.id){let e=await M(s,i);if(!e.ok)return void A.oR.error(e.error);if("redirect"===e.kind)return void o.push(e.url);let t=e.items.slice(0,8).map(e=>"• ".concat(e.name," (").concat(e.scope,"/").concat(e.id,")")).join("\n");return void A.oR.message("Несколько подходит — уточни запрос:\n".concat(t),{duration:12e3})}if("clear-project"===n.id){if(!confirm("ВНИМАНИЕ: будут удалены ВСЕ топики, виджеты и KB-файлы этого проекта. Это необратимо. Продолжить?"))return;let e=prompt("Введи фразу \xabочистить\xbb (без кавычек), чтобы подтвердить:");if((null==e?void 0:e.trim().toLowerCase())!=="очистить")return void A.oR.message("Подтверждение не прошло — отмена.");let t=await P(s);return void(t.ok?(A.oR.success(null!=(a=t.message)?a:"Проект очищен"),(0,_.$d)(_.Zi.topicsChanged(s)),(0,_.$d)(_.Zi.kbChanged(s)),t.redirectTo&&o.push(t.redirectTo)):A.oR.error(t.error))}A.oR.error("Неизвестная команда: ".concat(n.label))}function U(e){let{items:t,index:r,onPick:n,onHover:i,topicAvailable:s}=e;return(0,a.jsxs)("div",{className:"absolute bottom-full left-0 right-0 mb-2 z-50 max-h-80 overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-lg",children:[(0,a.jsx)("div",{className:"px-3 py-1.5 text-[10px] uppercase tracking-wider text-muted-foreground border-b",children:"Команды \xb7 Tab — вставить \xb7 ↑↓ — выбор \xb7 Esc — закрыть"}),(0,a.jsx)("ul",{children:t.map((e,t)=>{var l;let o=null!=(l=F[e.icon])?l:u.A,c="delete-topic"===e.id&&!s;return(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",onMouseDown:t=>{t.preventDefault(),c||n(e)},onMouseEnter:()=>i(t),disabled:c,className:(0,R.cn)("w-full flex items-start gap-2 px-3 py-2 text-left",t===r?"bg-accent":"hover:bg-accent/60",c&&"opacity-40 cursor-not-allowed"),children:[(0,a.jsx)(o,{className:(0,R.cn)("h-3.5 w-3.5 mt-0.5 shrink-0","direct"===e.kind?"text-amber-600":"text-violet-600")}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-baseline gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"font-mono text-xs font-medium",children:e.label}),"direct"===e.kind&&(0,a.jsx)("span",{className:"text-[9px] uppercase tracking-wider text-amber-700",children:"прямое действие"}),e.requiresConfirm&&(0,a.jsx)("span",{className:"text-[9px] uppercase tracking-wider text-destructive",children:"с подтверждением"})]}),(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground leading-snug mt-0.5",children:e.description}),(0,a.jsx)("p",{className:"text-[10px] text-muted-foreground/80 font-mono mt-0.5",children:e.usage})]})]})},e.id)})})]})}function K(e){let{items:t,index:r,loading:n,onPick:i,onHover:s}=e;return(0,a.jsx)("div",{className:"absolute bottom-full left-0 right-0 mb-2 z-50 max-h-72 overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-lg",children:n&&0===t.length?(0,a.jsxs)("div",{className:"px-3 py-2 text-xs text-muted-foreground flex items-center gap-2",children:[(0,a.jsx)(h.A,{className:"h-3 w-3 animate-spin"})," поиск…"]}):0===t.length?(0,a.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground italic",children:"ничего не найдено"}):(0,a.jsx)("ul",{children:t.map((e,t)=>{let n="kb"===e.kind?k.A:w.A;return(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",onMouseDown:t=>{t.preventDefault(),i(e)},onMouseEnter:()=>s(t),className:(0,R.cn)("w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left",t===r?"bg-accent":"hover:bg-accent/60"),children:[(0,a.jsx)(n,{className:(0,R.cn)("h-3.5 w-3.5 shrink-0","kb"===e.kind?"text-primary":"text-muted-foreground")}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"truncate font-mono text-xs",children:e.relPath}),e.parent&&(0,a.jsx)("div",{className:"truncate text-[10px] text-muted-foreground",children:e.parent})]}),(0,a.jsx)("span",{className:(0,R.cn)("text-[10px] uppercase tracking-wider shrink-0","kb"===e.kind?"text-primary":"text-muted-foreground"),children:e.kind})]})},e.absPath)})})})}function W(e){var t;let{attachment:r,onRemove:n}=e,i=r.mime.startsWith("image/")?y.A:w.A;return(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-1 text-[11px] max-w-[18rem]",children:[(0,a.jsx)(i,{className:"h-3 w-3 text-muted-foreground shrink-0"}),(0,a.jsx)("span",{className:"truncate",title:r.name,children:r.name}),(0,a.jsx)("span",{className:"text-muted-foreground",children:(t=r.size)<1024?"".concat(t," B"):t<1048576?"".concat((t/1024).toFixed(1)," KB"):"".concat((t/1048576).toFixed(1)," MB")}),(0,a.jsx)("button",{type:"button",onClick:n,className:"ml-0.5 text-muted-foreground hover:text-foreground",children:(0,a.jsx)(j.A,{className:"h-3 w-3"})})]})}},63514:(e,t,r)=>{r.d(t,{$d:()=>i,S9:()=>s,Zi:()=>n});var a=r(99356);let n={rootsChanged:"reflex:roots-changed",topicsChanged:e=>"reflex:topics-changed:".concat(e),kbChanged:e=>"reflex:kb-changed:".concat(e)};function i(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}function s(e,t){(0,a.useEffect)(()=>{let r=e=>t(e.detail);return window.addEventListener(e,r),()=>window.removeEventListener(e,r)},[e,t])}},63602:(e,t,r)=>{r.d(t,{E:()=>i});var a=r(4624),n=r(8096);function i(e){let{label:t="Спроси Reflex",headerRight:r,children:i}=e;return(0,a.jsx)("div",{className:"border-t bg-background",children:(0,a.jsx)("div",{className:"mx-auto max-w-3xl px-6 py-5",children:(0,a.jsx)("div",{className:"reflex-gradient rounded-2xl p-[2px] shadow-[0_8px_40px_-12px_oklch(0.55_0.2_290/0.45)]",children:(0,a.jsxs)("div",{className:"rounded-[14px] bg-background/85 backdrop-blur-xl px-5 py-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("span",{className:"reflex-gradient inline-flex h-6 w-6 items-center justify-center rounded-full text-white shadow-sm",children:(0,a.jsx)(n.A,{className:"h-3.5 w-3.5"})}),(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.18em] text-muted-foreground",children:t}),r&&(0,a.jsx)("span",{className:"ml-auto flex items-center gap-1",children:r})]}),i]})})})})}},71651:(e,t,r)=>{r.d(t,{T:()=>i});var a=r(4624);r(99356);var n=r(13506);function i(e){let{className:t,...r}=e;return(0,a.jsx)("textarea",{"data-slot":"textarea",className:(0,n.cn)("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",t),...r})}},85253:(e,t,r)=>{r.d(t,{$:()=>o});var a=r(4624);r(99356);var n=r(60621),i=r(50362),s=r(13506);let l=(0,n.F)("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function o(e){let{className:t,variant:r="default",size:n="default",asChild:o=!1,...c}=e,d=o?i.bL:"button";return(0,a.jsx)(d,{"data-slot":"button","data-variant":r,"data-size":n,className:(0,s.cn)(l({variant:r,size:n,className:t})),...c})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4108],{25325:(e,c,t)=>{t.d(c,{o:()=>a});var r=t(7911);let a=(0,r.createServerReference)("00f2f64a257f06a50181c8fe50cb88889d4385c101",r.callServer,void 0,r.findSourceMapURL,"listOAuthStatusesAction")},27955:(e,c,t)=>{t.d(c,{S:()=>a});var r=t(7911);let a=(0,r.createServerReference)("40de5a5c34d3e3490931cee2fc4df7c9b5c74c8bbe",r.callServer,void 0,r.findSourceMapURL,"saveOAuthClientAction")},86001:(e,c,t)=>{t.d(c,{J:()=>a});var r=t(7911);let a=(0,r.createServerReference)("40b21c79ea505c08c138dc5755c57c73fb8e285b29",r.callServer,void 0,r.findSourceMapURL,"getOAuthClientAction")},94108:(e,c,t)=>{t.d(c,{beginOAuthAction:()=>n.T,getOAuthClientAction:()=>a.J,listOAuthStatusesAction:()=>r.o,saveOAuthClientAction:()=>i.S});var r=t(25325),a=t(86001),i=t(27955),n=t(99338)},99338:(e,c,t)=>{t.d(c,{T:()=>a});var r=t(7911);let a=(0,r.createServerReference)("601ff91a6760e8f52ecd2f16fadb6875ef8662bb9d",r.callServer,void 0,r.findSourceMapURL,"beginOAuthAction")}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6231],{6231:(e,t,r)=>{r.d(t,{UtilityIframe:()=>g});var s=r(4624),a=r(99356),l=r(79182),n=r(39783),o=r(13561),c=r(8096),i=r(3239),u=r(95265),d=r(54400),p=r.n(d),m=r(56221),h=r(7911);let x=(0,h.createServerReference)("40ad82cda51b6986682b8790170d0d1158ae318a95",h.callServer,void 0,h.findSourceMapURL,"getOrCreateUtilityHelperTopicAction"),f=(0,h.createServerReference)("60ff3df4e3ad497a54503ca5fe7b383589e370223c",h.callServer,void 0,h.findSourceMapURL,"loadHelperTranscriptAction");function y(e){let{scope:t,utilityId:r,utilityName:d,rootId:h,requestSnapshot:y,onClose:g}=e,[w,b]=(0,a.useState)(null),[j,N]=(0,a.useState)([]),[k,S]=(0,a.useState)(""),[A,M]=(0,a.useState)(null),[T,E]=(0,a.useTransition)(),[R,C]=(0,a.useState)(!1),L=(0,a.useRef)(null),H=(0,a.useRef)(null),I=(0,a.useRef)(""),[O,P]=(0,a.useState)("");(0,a.useEffect)(()=>{if(!h)return void M("Чат доступен только в project-scope утилитах.");let e=!1;return(async()=>{let t=await x({rootId:h,utilityId:r,utilityName:null!=d?d:r});if(e)return;if(!t.ok)return M(t.error);b(t.topicId);let s=await f(h,t.topicId);!e&&s.ok&&N(s.messages)})(),()=>{e=!0}},[h,r,d]),(0,a.useEffect)(()=>{if(!h||!w)return;let e=new EventSource("/api/roots/".concat(h,"/chat/").concat(w,"/stream?since=").concat(Number.MAX_SAFE_INTEGER));return H.current=e,e.addEventListener("event",e=>{try{let t=JSON.parse(e.data);"assistant-delta"===t.type&&"string"==typeof t.text?(I.current+=t.text,P(I.current),C(!0)):"turn-end"===t.type||"agent-end"===t.type?(I.current="",P(""),C(!1),(async()=>{let e=await f(h,w);e.ok&&N(e.messages)})()):t.type}catch(e){}}),e.onerror=()=>{},()=>{e.close(),H.current=null}},[h,w]),(0,a.useEffect)(()=>{let e=L.current;e&&(e.scrollTop=e.scrollHeight)},[j,O]);let q=()=>{let e=k.trim();e&&h&&w&&(S(""),N(t=>[...t,{role:"user",text:e,ts:new Date().toISOString()}]),E(async()=>{let t;try{t=await Promise.race([y(),new Promise(e=>setTimeout(()=>e(void 0),600))])}catch(e){}let r=void 0!==t?function(e,t){let r;try{r="string"==typeof t?t:JSON.stringify(t,null,2)}catch(e){r=String(t)}return r.length>4e3&&(r=r.slice(0,4e3)+"\n…[truncated]"),["[Контекст мини-приложения]",r,"[/контекст]\n",e].join("\n")}(e,t):e;try{let e=await fetch("/api/roots/".concat(h,"/chat/").concat(w,"/send"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:r})});if(!e.ok){var s;let t=await e.json().catch(()=>({}));m.oR.error(null!=(s=t.error)?s:"HTTP ".concat(e.status))}}catch(e){m.oR.error(String(e))}}))};return(0,s.jsxs)("aside",{className:"flex h-full flex-col border-l bg-card",children:[(0,s.jsxs)("header",{className:"border-b px-3 py-2 flex items-center gap-2",children:[(0,s.jsx)(l.A,{className:"h-3.5 w-3.5 text-violet-600"}),(0,s.jsx)("span",{className:"text-sm font-medium",children:"Помощник"}),(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground ml-1",children:"знает контекст этого приложения"}),h&&w&&(0,s.jsx)(p(),{href:"/roots/".concat(h,"/chat/").concat(w),className:"ml-auto p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground",title:"Открыть в полном чате",children:(0,s.jsx)(n.A,{className:"h-3.5 w-3.5"})}),g&&(0,s.jsx)("button",{type:"button",onClick:g,className:"p-1 rounded hover:bg-accent "+(h&&w?"":"ml-auto"),title:"Скрыть",children:(0,s.jsx)(o.A,{className:"h-3.5 w-3.5"})})]}),(0,s.jsxs)("div",{ref:L,className:"flex-1 overflow-y-auto px-3 py-2 space-y-2 text-sm",children:[A&&(0,s.jsx)("p",{className:"text-xs text-red-600",children:A}),!A&&0===j.length&&!O&&(0,s.jsxs)("div",{className:"text-xs text-muted-foreground flex items-start gap-2",children:[(0,s.jsx)(c.A,{className:"h-3 w-3 mt-0.5 text-violet-600 shrink-0"}),(0,s.jsx)("span",{children:"Спроси что-нибудь про данные этого мини-приложения. Диалог сохраняется как обычный разговор — можно открыть полностью по иконке в углу."})]}),j.map((e,t)=>(0,s.jsx)(v,{role:e.role,text:e.text},t)),R&&O&&(0,s.jsx)(v,{role:"assistant",text:O,streaming:!0}),T&&!R&&(0,s.jsxs)("div",{className:"mr-6 rounded-md bg-muted/40 px-2 py-1.5 text-xs text-muted-foreground inline-flex items-center gap-2",children:[(0,s.jsx)(i.A,{className:"h-3 w-3 animate-spin"}),"Reflex думает…"]})]}),(0,s.jsxs)("div",{className:"border-t px-3 py-2 flex items-end gap-1.5",children:[(0,s.jsx)("textarea",{value:k,onChange:e=>S(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),q())},rows:1,placeholder:"Спроси (⌘↵)…",disabled:T||!!A||!w,className:"flex-1 resize-none rounded border bg-background px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-violet-400 max-h-24"}),(0,s.jsx)("button",{type:"button",onClick:q,disabled:T||!k.trim()||!!A||!w,className:"inline-flex items-center justify-center rounded bg-violet-600 px-2 py-1 text-white hover:bg-violet-700 disabled:opacity-50",children:T?(0,s.jsx)(i.A,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(u.A,{className:"h-3 w-3"})})]})]})}function v(e){let{role:t,text:r,streaming:a}=e,l=r;return("user"===t&&(l=l.replace(/^\s*\[Контекст мини-приложения\][\s\S]*?\[\/контекст\]\s*/,"").trim()),l.trim())?(0,s.jsxs)("div",{className:"user"===t?"ml-6 rounded-md bg-violet-50 dark:bg-violet-950/30 px-2 py-1.5":"mr-6 rounded-md bg-muted/40 px-2 py-1.5 whitespace-pre-wrap",children:[(0,s.jsxs)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-0.5",children:["user"===t?"Ты":"assistant"===t?"Reflex":"Система",a&&(0,s.jsx)("span",{className:"ml-1 text-violet-600",children:"●"})]}),l]}):null}function g(e){let{scope:t,id:r,rootId:n,className:o,title:c,agentChat:i,utilityName:u}=e,d=(0,a.useRef)(null),p=(0,a.useRef)(null),[m,h]=(0,a.useState)(!0),x=n?"?rootId=".concat(encodeURIComponent(n)):"",f="/api/utilities/".concat(t,"/").concat(r,"/iframe").concat(x),v="/api/utilities/".concat(t,"/").concat(r,"/host").concat(x);(0,a.useEffect)(()=>{let e=async e=>{var t,r,s,a,l,n;let o=e.data;if(!o||e.source!==(null==(t=d.current)?void 0:t.contentWindow))return;if("snapshot-payload"===o.type){let e=p.current;e&&(clearTimeout(e.timer),p.current=null,e.resolve(o.snapshot));return}if("host-rpc"!==o.type)return;let c=o.id;try{let e=await fetch(v,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:o.method,args:o.args})}),t=await e.json();null==(s=d.current)||null==(r=s.contentWindow)||r.postMessage(t.ok?{type:"host-rpc-result",id:c,ok:!0,result:t.result}:{type:"host-rpc-result",id:c,ok:!1,error:null!=(a=t.error)?a:"HTTP ".concat(e.status)},"*")}catch(e){null==(n=d.current)||null==(l=n.contentWindow)||l.postMessage({type:"host-rpc-result",id:c,ok:!1,error:e instanceof Error?e.message:String(e)},"*")}};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[v]);let g=(0,s.jsx)("iframe",{ref:d,src:f,sandbox:"allow-scripts allow-forms allow-same-origin",className:null!=o?o:"h-full w-full border-0 bg-white",title:null!=c?c:"utility-".concat(r)});return i?(0,s.jsxs)("div",{className:"flex h-full w-full",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0 relative",children:[g,!m&&(0,s.jsxs)("button",{type:"button",onClick:()=>h(!0),className:"absolute right-3 bottom-3 inline-flex items-center gap-1 rounded-full bg-violet-600 px-3 py-1.5 text-xs text-white shadow-lg hover:bg-violet-700",title:"Открыть помощника",children:[(0,s.jsx)(l.A,{className:"h-3.5 w-3.5"}),"Помощник"]})]}),m&&(0,s.jsx)("div",{className:"w-80 shrink-0",children:(0,s.jsx)(y,{scope:t,utilityId:r,...u?{utilityName:u}:{},...n?{rootId:n}:{},requestSnapshot:()=>{var e;let t=null==(e=d.current)?void 0:e.contentWindow;return t?(p.current&&(clearTimeout(p.current.timer),p.current.resolve(void 0),p.current=null),new Promise(e=>{let r=setTimeout(()=>{var t;(null==(t=p.current)?void 0:t.resolve)===e&&(p.current=null,e(void 0))},500);p.current={resolve:e,timer:r};try{t.postMessage({type:"request-snapshot"},"*")}catch(t){clearTimeout(r),p.current=null,e(void 0)}})):Promise.resolve(void 0)},onClose:()=>h(!1)})})]}):g}},8096:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(45804).A)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])},13561:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(45804).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},39783:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(45804).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},79182:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(45804).A)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},95265:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(45804).A)("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]])}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9045],{8096:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(45804).A)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])},9923:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(45804).A)("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},39624:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(45804).A)("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]])},41085:(e,a,t)=>{t.d(a,{D:()=>r});var l=t(99356),d=l.createContext(void 0),h={setTheme:e=>{},themes:[]},r=()=>{var e;return null!=(e=l.useContext(d))?e:h}},42146:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(45804).A)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},42795:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(45804).A)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},46972:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(45804).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},49623:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(45804).A)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},50988:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(45804).A)("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]])},53296:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(45804).A)("FileSearch",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]])},58726:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(45804).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},60621:(e,a,t)=>{t.d(a,{F:()=>r});var l=t(47989);let d=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,h=l.$,r=(e,a)=>t=>{var l;if((null==a?void 0:a.variants)==null)return h(e,null==t?void 0:t.class,null==t?void 0:t.className);let{variants:r,defaultVariants:y}=a,k=Object.keys(r).map(e=>{let a=null==t?void 0:t[e],l=null==y?void 0:y[e];if(null===a)return null;let h=d(a)||d(l);return r[e][h]}),p=t&&Object.entries(t).reduce((e,a)=>{let[t,l]=a;return void 0===l||(e[t]=l),e},{});return h(e,k,null==a||null==(l=a.compoundVariants)?void 0:l.reduce((e,a)=>{let{class:t,className:l,...d}=a;return Object.entries(d).every(e=>{let[a,t]=e;return Array.isArray(t)?t.includes({...y,...p}[a]):({...y,...p})[a]===t})?[...e,t,l]:e},[]),null==t?void 0:t.class,null==t?void 0:t.className)}},63622:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(45804).A)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},69205:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(45804).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},69259:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(45804).A)("OctagonX",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},69285:(e,a,t)=>{var l=t(48849);t.o(l,"usePathname")&&t.d(a,{usePathname:function(){return l.usePathname}}),t.o(l,"useRouter")&&t.d(a,{useRouter:function(){return l.useRouter}})},69709:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(45804).A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},70762:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(45804).A)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},72754:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(45804).A)("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},79182:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(45804).A)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},85924:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(45804).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9496],{46764:(e,t,r)=>{r.d(t,{t:()=>n});var a=r(7911);let n=(0,a.createServerReference)("60681eadfe3a4aa0423c1ab3767d719fa648f63751",a.callServer,void 0,a.findSourceMapURL,"restoreWidgetAction")},68682:(e,t,r)=>{function a(e){return"".concat(e.lat,",").concat(e.lng)}function n(e){return"".concat(e.lng,",").concat(e.lat)}r.d(t,{JY:()=>l,yp:()=>s});let s=[{id:"google",label:"Google Maps",description:"Глобальный, navigation+street view. Работает везде кроме РФ-блокировок.",brand:"#4285F4",glyph:"G",urlFor:(e,t)=>"https://www.google.com/maps/dir/?api=1&destination=".concat(e,",").concat(t),routeUrlFor:e=>{if(e.length<2)return"";let t=a(e[0]),r=a(e[e.length-1]),n=e.slice(1,-1).map(a).join("|"),s=n?"&waypoints=".concat(encodeURIComponent(n)):"";return"https://www.google.com/maps/dir/?api=1&origin=".concat(t,"&destination=").concat(r).concat(s)}},{id:"yandex",label:"Яндекс.Карты",description:"СНГ, лучшая детализация по РФ и пробки в реальном времени.",brand:"#FFCC00",glyph:"Я",urlFor:(e,t)=>"https://yandex.ru/maps/?rtext=~".concat(e,",").concat(t,"&rtt=auto"),routeUrlFor:e=>"https://yandex.ru/maps/?rtext=".concat(e.map(a).join("~"),"&rtt=auto")},{id:"2gis",label:"2ГИС",description:"СНГ, точные адреса и POI. Уникальная свойственность РФ-городов.",brand:"#1BA049",glyph:"2",urlFor:(e,t)=>"https://2gis.ru/routeSearch/to/".concat(t,",").concat(e),routeUrlFor:e=>{let t=n(e[0]),r=n(e[e.length-1]),a=e.slice(1,-1).map(e=>"/via/".concat(n(e))).join("");return"https://2gis.ru/routeSearch/rsType/car/from/".concat(t).concat(a,"/to/").concat(r)}},{id:"apple",label:"Apple Maps",description:"Откроется в нативном приложении на iOS/macOS, иначе на сайте.",brand:"#1d1d1f",glyph:"A",urlFor:(e,t)=>"https://maps.apple.com/?daddr=".concat(e,",").concat(t),routeUrlFor:e=>{let t=a(e[0]),r=e.slice(1).map(e=>"+to:".concat(a(e))).join("");return"https://maps.apple.com/?saddr=".concat(t,"&daddr=").concat(t).concat(r)}},{id:"osm",label:"OpenStreetMap",description:"Открытые данные, без аккаунта. Базовая навигация.",brand:"#7EB73F",glyph:"OSM",urlFor:(e,t)=>"https://www.openstreetmap.org/directions?to=".concat(e,",").concat(t),routeUrlFor:e=>{let t=e.map(a).join(";");return"https://www.openstreetmap.org/directions?route=".concat(encodeURIComponent(t))}},{id:"waze",label:"Waze",description:"Авто-навигация с краудсорсингом пробок и предупреждений.",brand:"#33CCFF",glyph:"W",urlFor:(e,t)=>"https://waze.com/ul?ll=".concat(e,",").concat(t,"&navigate=yes"),routeUrlFor:e=>{let t=e[e.length-1];return"https://waze.com/ul?ll=".concat(t.lat,",").concat(t.lng,"&navigate=yes")}},{id:"organic",label:"Organic Maps",description:"Офлайн-карты с открытыми данными. Открывается в приложении.",brand:"#006C35",glyph:"OM",urlFor:(e,t)=>"om://map?ll=".concat(e,",").concat(t),routeUrlFor:e=>{let t=e[0],r=e[e.length-1];return"om://route?sll=".concat(t.lat,",").concat(t.lng,"&saddr=&dll=").concat(r.lat,",").concat(r.lng,"&daddr=&type=vehicle")}}],l=["google","yandex","apple","osm"]},99061:(e,t,r)=>{r.d(t,{v:()=>J});var a=r(4624),n=r(3834),s=r(99356),l=r(87738),o=r(39783),i=r(43153),c=r(13561),d=r(41695),u=r(46972),m=r(84630),p=r(96447),x=r(54207),h=r(84860),g=r(41379),f=r(3239),v=r(85253),b=r(15523),j=r(64681),y=r(54400),N=r.n(y),w=r(49623),k=r(85785),A=r(43863),C=r(57308),S=r(35285),F=r(9598),R=r(56221),z=r(68682);function E(e){let{service:t,size:r=18,className:n}=e;return(0,a.jsx)("span",{className:"inline-flex items-center justify-center rounded-[5px] font-bold leading-none text-white shrink-0 "+(null!=n?n:""),style:{background:t.brand,width:r,height:r,fontSize:Math.max(8,Math.floor(.55*r)),letterSpacing:t.glyph.length>1?"-0.05em":"0"},"aria-hidden":!0,children:t.glyph})}var M=r(7911);let O=(0,M.createServerReference)("00d7ad916a5eee3d1c0bacec7ea65c9bc6903053a8",M.callServer,void 0,M.findSourceMapURL,"getEnabledMapServicesAction"),U="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",_="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js";function T(e){let{point:t,services:r,interactive:n,onRemove:s}=e;return(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[r.slice(0,4).map(e=>(0,a.jsx)("a",{href:e.urlFor(t.lat,t.lng),target:"_blank",rel:"noopener noreferrer",className:"rounded p-0.5 hover:ring-1 hover:ring-offset-1 hover:ring-violet-300",title:"Маршрут в ".concat(e.label),children:(0,a.jsx)(E,{service:e,size:18})},e.id)),(0,a.jsx)("button",{type:"button",onClick:()=>{navigator.clipboard.writeText("".concat(t.lat,", ").concat(t.lng)).then(()=>R.oR.success("Координаты скопированы")).catch(()=>R.oR.error("Буфер недоступен"))},className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground",title:"Скопировать координаты",children:(0,a.jsx)(F.A,{className:"h-3 w-3"})}),n&&(0,a.jsx)("button",{type:"button",onClick:s,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-destructive",title:"Удалить точку",children:(0,a.jsx)(c.A,{className:"h-3 w-3"})})]})}function I(e){let{service:t,stops:r}=e,n=t.routeUrlFor(r),s=e=>{e.preventDefault(),e.stopPropagation(),navigator.clipboard.writeText(n).then(()=>R.oR.success("Ссылка ".concat(t.label," скопирована"))).catch(()=>R.oR.error("Буфер недоступен"))};return(0,a.jsxs)("a",{href:n,target:"_blank",rel:"noopener noreferrer",onContextMenu:s,className:"inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-[11px] hover:bg-accent",title:"".concat(t.label," — клик: открыть, правый клик: скопировать ссылку"),children:[(0,a.jsx)(E,{service:t,size:16}),(0,a.jsx)("span",{className:"truncate max-w-[80px]",children:t.label}),(0,a.jsx)("button",{type:"button",onClick:s,className:"text-muted-foreground hover:text-foreground",title:"Скопировать ссылку",children:(0,a.jsx)(F.A,{className:"h-2.5 w-2.5"})})]})}var L=r(8096);let D={markdown:function(e){var t;let{data:r}=e;return(0,a.jsx)("div",{className:"text-sm",children:(0,a.jsx)(n.p,{source:null!=(t=r.body)?t:""})})},"news-list":function(e){var t;let{data:r,readonly:n,onPatch:d}=e,u=null!=(t=r.items)?t:[],[m,p]=(0,s.useState)(u),[x,h]=(0,s.useTransition)(),g=(0,s.useRef)("");(0,s.useEffect)(()=>{let e=JSON.stringify(u);e!==g.current&&(g.current=e,p(u))},[r]);let f=e=>{p(e),d&&h(async()=>{try{await d({items:e})}catch(e){}})};return 0===m.length?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Список новостей пустой."}):(0,a.jsx)("ul",{className:"space-y-2",children:m.map((e,t)=>(0,a.jsxs)("li",{className:"group/row relative border-l-2 pl-2.5 py-0.5 transition ".concat(e.read?"border-muted-foreground/30 opacity-60":"border-violet-200"),children:[(0,a.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,a.jsx)(l.A,{className:"h-3 w-3 mt-1 shrink-0 ".concat(e.read?"text-muted-foreground":"text-violet-600")}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 pr-12",children:[e.url?(0,a.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium hover:underline inline-flex items-center gap-1",children:[e.title,(0,a.jsx)(o.A,{className:"h-3 w-3 opacity-50"})]}):(0,a.jsx)("span",{className:"text-sm font-medium",children:e.title}),e.summary&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:e.summary}),(e.source||e.date)&&(0,a.jsxs)("div",{className:"text-[10px] text-muted-foreground mt-0.5 flex gap-1.5",children:[e.source&&(0,a.jsx)("span",{children:e.source}),e.source&&e.date&&(0,a.jsx)("span",{children:"\xb7"}),e.date&&(0,a.jsx)("span",{className:"font-mono",children:e.date})]})]})]}),!n&&(0,a.jsxs)("div",{className:"absolute top-0 right-0 flex items-center gap-0.5 opacity-0 group-hover/row:opacity-100 transition-opacity",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{!n&&f(m.map((e,r)=>r===t?{...e,read:!e.read}:e))},disabled:x,"aria-label":e.read?"Отметить непрочитанным":"Отметить прочитанным",title:e.read?"Отметить непрочитанным":"Прочитано",className:"p-1 rounded hover:bg-emerald-100 dark:hover:bg-emerald-950/40 text-muted-foreground hover:text-emerald-600 disabled:opacity-30",children:(0,a.jsx)(i.A,{className:"h-3 w-3"})}),(0,a.jsx)("button",{type:"button",onClick:()=>{!n&&f(m.filter((e,r)=>r!==t))},disabled:x,"aria-label":"Убрать новость",title:"Убрать",className:"p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,a.jsx)(c.A,{className:"h-3 w-3"})})]})]},t))})},"link-list":function(e){var t;let{data:r,readonly:n,onPatch:l}=e,i=null!=(t=r.items)?t:[],[c,m]=(0,s.useState)(i),[p,x]=(0,s.useTransition)(),h=(0,s.useRef)("");return((0,s.useEffect)(()=>{let e=JSON.stringify(i);e!==h.current&&(h.current=e,m(i))},[r]),0===c.length)?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Нет ссылок."}):(0,a.jsx)("ul",{className:"space-y-0.5",children:c.map((e,t)=>(0,a.jsxs)("li",{className:"group/row relative",children:[(0,a.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-start gap-1.5 rounded-md px-2 py-1.5 hover:bg-accent/40 transition",children:[(0,a.jsx)(d.A,{className:"h-3 w-3 mt-1 shrink-0 text-sky-600"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"text-sm font-medium hover:underline inline-flex items-center gap-1",children:[e.title,(0,a.jsx)(o.A,{className:"h-3 w-3 opacity-50"})]}),e.hint&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:e.hint}),(0,a.jsx)("div",{className:"text-[10px] text-muted-foreground truncate font-mono mt-0.5",children:e.url})]})]}),!n&&(0,a.jsx)("button",{type:"button",onClick:()=>(e=>{if(!n){var t;m(t=c.filter((t,r)=>r!==e)),l&&x(async()=>{try{await l({items:t})}catch(e){}})}})(t),disabled:p,"aria-label":"Удалить ссылку",className:"absolute top-1.5 right-1.5 opacity-0 group-hover/row:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,a.jsx)(u.A,{className:"h-3 w-3"})})]},t))})},kpi:function(e){var t;let{data:r}=e,n=null!=(t=r.items)?t:[];if(0===n.length)return(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Нет показателей."});let s=Math.min(n.length,3);return(0,a.jsx)("div",{className:"grid gap-2",style:{gridTemplateColumns:"repeat(".concat(s,", minmax(0,1fr))")},children:n.map((e,t)=>(0,a.jsxs)("div",{className:"rounded-md border bg-card px-3 py-2 flex flex-col gap-0.5",children:[(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:e.label}),(0,a.jsxs)("div",{className:"flex items-baseline gap-1",children:[(0,a.jsx)("span",{className:"text-lg font-semibold tabular-nums",children:e.value}),"up"===e.delta&&(0,a.jsx)(m.A,{className:"h-3.5 w-3.5 text-emerald-600"}),"down"===e.delta&&(0,a.jsx)(p.A,{className:"h-3.5 w-3.5 text-rose-600"}),"flat"===e.delta&&(0,a.jsx)(x.A,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),e.hint&&(0,a.jsx)("div",{className:"text-[10px] text-muted-foreground leading-snug",children:e.hint})]},t))})},checklist:function(e){var t;let{data:r,readonly:n,onPatch:l}=e,o=null!=(t=r.items)?t:[],[c,d]=(0,s.useState)(o),[m,p]=(0,s.useTransition)(),[x,j]=(0,s.useState)(""),y=(0,s.useRef)("");(0,s.useEffect)(()=>{let e=JSON.stringify(o);e!==y.current&&(y.current=e,d(o))},[r]);let N=e=>{d(e),l&&p(async()=>{try{await l({items:e})}catch(e){}})},w=e=>{n||N(c.map((t,r)=>r===e?{...t,done:!t.done}:t))};return 0===c.length&&n?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Список пустой."}):(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("ul",{className:"space-y-0.5",children:c.map((e,t)=>(0,a.jsxs)("li",{className:"group/row flex items-start gap-2 text-sm py-0.5 rounded hover:bg-accent/30 px-1 -mx-1 ".concat(e.done?"text-muted-foreground":""),children:[(0,a.jsx)("button",{type:"button",onClick:()=>w(t),disabled:n||m,"aria-label":e.done?"Снять отметку":"Отметить выполненным",className:"shrink-0 mt-0.5 disabled:opacity-50",children:e.done?(0,a.jsx)(i.A,{className:"h-3.5 w-3.5 text-emerald-600"}):(0,a.jsx)(h.A,{className:"h-3.5 w-3.5 text-muted-foreground/60 hover:text-foreground"})}),(0,a.jsx)("span",{className:"flex-1 min-w-0 break-words ".concat(e.done?"line-through":""),onClick:()=>w(t),style:n?{}:{cursor:"pointer"},children:e.text}),!n&&(0,a.jsx)("button",{type:"button",onClick:()=>{!n&&N(c.filter((e,r)=>r!==t))},disabled:m,"aria-label":"Удалить пункт",className:"opacity-0 group-hover/row:opacity-100 transition-opacity shrink-0 p-0.5 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,a.jsx)(u.A,{className:"h-3 w-3"})})]},t))}),!n&&(0,a.jsxs)("form",{className:"flex items-center gap-1 pt-1",onSubmit:e=>{e.preventDefault(),(()=>{if(n)return;let e=x.trim();e&&(N([...c,{text:e,done:!1}]),j(""))})()},children:[(0,a.jsx)(g.A,{className:"h-3 w-3 text-muted-foreground shrink-0"}),(0,a.jsx)(b.p,{value:x,onChange:e=>j(e.target.value),placeholder:"Новый пункт…",className:"h-7 text-xs flex-1 border-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 px-1",disabled:m}),x.trim()&&(0,a.jsx)(v.$,{type:"submit",size:"sm",variant:"ghost",className:"h-6 text-[10px] px-1.5",disabled:m,children:m?(0,a.jsx)(f.A,{className:"h-3 w-3 animate-spin"}):"Добавить"})]})]})},quote:function(e){let{data:t}=e;return(null==t?void 0:t.text)?(0,a.jsxs)("figure",{className:"relative pl-6",children:[(0,a.jsx)(j.A,{className:"h-5 w-5 absolute left-0 top-0 text-violet-300"}),(0,a.jsx)("blockquote",{className:"text-sm italic leading-relaxed",children:t.text}),t.attribution&&(0,a.jsxs)("figcaption",{className:"text-xs text-muted-foreground mt-1.5",children:["— ",t.attribution]})]}):(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Цитата не задана."})},"kb-pinned":function(e){var t;let{rootId:r,data:n,readonly:l,onPatch:o}=e,i=null!=(t=n.items)?t:[],[d,u]=(0,s.useState)(i),[m,p]=(0,s.useTransition)(),x=(0,s.useRef)("");return((0,s.useEffect)(()=>{let e=JSON.stringify(i);e!==x.current&&(x.current=e,u(i))},[n]),0===d.length)?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Нет закреплённых файлов."}):(0,a.jsx)("ul",{className:"space-y-1",children:d.map((e,t)=>{var n;let s=e.rel.split("/").map(encodeURIComponent).join("/");return(0,a.jsxs)("li",{className:"group/row relative",children:[(0,a.jsxs)(N(),{href:"/roots/".concat(r,"/kb/").concat(s),className:"flex items-start gap-2 rounded-md px-2 py-1.5 hover:bg-accent/40 transition pr-7",children:[(0,a.jsx)(w.A,{className:"h-3 w-3 mt-0.5 shrink-0 text-emerald-700"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"text-sm font-medium truncate",children:null!=(n=e.title)?n:e.rel}),e.snippet&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 leading-relaxed mt-0.5",children:e.snippet}),(0,a.jsx)("div",{className:"text-[10px] text-muted-foreground font-mono mt-0.5 truncate",children:e.rel})]})]}),!l&&(0,a.jsx)("button",{type:"button",onClick:()=>(e=>{if(!l){var t;u(t=d.filter((t,r)=>r!==e)),o&&p(async()=>{try{await o({items:t})}catch(e){}})}})(t),disabled:m,"aria-label":"Открепить",title:"Открепить",className:"absolute top-1.5 right-1.5 opacity-0 group-hover/row:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,a.jsx)(c.A,{className:"h-3 w-3"})})]},t)})})},progress:function(e){var t;let{data:r,readonly:n,onPatch:l}=e,o=null!=(t=r.items)?t:[],[i,c]=(0,s.useState)(o),[d,u]=(0,s.useTransition)(),m=(0,s.useRef)("");(0,s.useEffect)(()=>{let e=JSON.stringify(o);e!==m.current&&(m.current=e,c(o))},[r]);let p=(e,t)=>{if(!n){var r;c(r=i.map((r,a)=>a===e?{...r,current:Math.max(0,r.current+t)}:r)),l&&u(async()=>{try{await l({items:r})}catch(e){}})}};return 0===i.length?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Нет целей."}):(0,a.jsx)("ul",{className:"space-y-2.5",children:i.map((e,t)=>{let r=e.target>0?Math.max(0,Math.min(100,e.current/e.target*100)):0;return(0,a.jsxs)("li",{className:"space-y-1 group/row",children:[(0,a.jsxs)("div",{className:"flex items-baseline justify-between gap-2 text-sm",children:[(0,a.jsx)("span",{className:"truncate flex-1 min-w-0",children:e.label}),!n&&(0,a.jsxs)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/row:opacity-100 transition-opacity shrink-0",children:[(0,a.jsx)("button",{type:"button",onClick:()=>p(t,-1),disabled:d||e.current<=0,"aria-label":"−1",className:"p-0.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground disabled:opacity-30",children:(0,a.jsx)(k.A,{className:"h-3 w-3"})}),(0,a.jsx)("button",{type:"button",onClick:()=>p(t,1),disabled:d,"aria-label":"+1",className:"p-0.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground disabled:opacity-30",children:(0,a.jsx)(g.A,{className:"h-3 w-3"})})]}),(0,a.jsxs)("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0",children:[e.current," / ",e.target,e.unit?" ".concat(e.unit):""]})]}),(0,a.jsx)("div",{className:"h-1.5 rounded-full bg-muted overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-violet-600 transition-all",style:{width:"".concat(r,"%")}})})]},t)})})},image:function(e){var t;let{data:r}=e;return(null==r?void 0:r.url)?(0,a.jsxs)("figure",{className:"space-y-1",children:[(0,a.jsx)("img",{src:r.url,alt:null!=(t=r.alt)?t:"",className:"rounded-md w-full h-auto border",loading:"lazy"}),r.caption&&(0,a.jsx)("figcaption",{className:"text-xs text-muted-foreground text-center",children:r.caption})]}):(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Картинка не задана."})},"stat-table":function(e){var t;let{data:r}=e,n=null!=(t=r.rows)?t:[];return 0===n.length?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Таблица пустая."}):(0,a.jsx)("div",{className:"overflow-x-auto -mx-1",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[r.columns&&r.columns.length>0&&(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{className:"border-b",children:r.columns.map((e,t)=>(0,a.jsx)("th",{className:"text-left text-[10px] uppercase tracking-wider text-muted-foreground font-medium px-1.5 py-1.5",children:e},t))})}),(0,a.jsx)("tbody",{children:n.map((e,t)=>(0,a.jsx)("tr",{className:"border-b border-dashed last:border-b-0 hover:bg-accent/30",children:e.map((e,t)=>(0,a.jsx)("td",{className:"px-1.5 py-1.5 align-top",children:e},t))},t))})]})})},map:function(e){var t,r,n;let{data:l,readonly:o,onPatch:i}=e,d=(0,s.useRef)(null),m=(0,s.useRef)(null),[p,x]=(0,s.useState)(!1),[h,v]=(0,s.useState)(z.JY),[b,j]=(0,s.useState)(""),[y,N]=(0,s.useState)(!1),[w,k]=(0,s.useState)([]),[F,E]=(0,s.useState)(!1),[M,L]=(0,s.useState)([]),D=null!=(r=l.points)?r:[],J=null!=(n=null==(t=l.route)?void 0:t.stops)?n:[],q=F?M:J,B=(0,s.useMemo)(()=>q.map(e=>D[e]).filter(e=>!!e).map(e=>({lat:e.lat,lng:e.lng})),[q,D]),P=(0,s.useMemo)(()=>z.yp.filter(e=>h.includes(e.id)),[h]);(0,s.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await O();!e&&t.ok&&v(t.enabled)}catch(e){}})(),()=>{e=!0}},[]),(0,s.useEffect)(()=>{if(window.L)return void x(!0);if(!document.querySelector('link[href="'.concat(U,'"]'))){let e=document.createElement("link");e.rel="stylesheet",e.href=U,document.head.appendChild(e)}let e=document.querySelector('script[src="'.concat(_,'"]'));if(e){e.addEventListener("load",()=>x(!0)),window.L&&x(!0);return}let t=document.createElement("script");t.src=_,t.async=!0,t.onload=()=>x(!0),t.onerror=()=>R.oR.error("Не удалось загрузить Leaflet с CDN (проверь интернет)"),document.head.appendChild(t)},[]),(0,s.useEffect)(()=>{var e,t,r;if(!p||!d.current)return;let a=window.L;if(!a||(m.current&&(m.current.remove(),m.current=null),0===D.length))return;let n=a.map(d.current,{scrollWheelZoom:!1,zoomControl:!0});m.current=n,a.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',maxZoom:19}).addTo(n);let s=D.map((e,t)=>{let r=q.includes(t),s=function(e,t){let r=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),a=t.map(t=>{let a=t.urlFor(e.lat,e.lng);return'<a href="'.concat(r(a),'" target="_blank" rel="noopener noreferrer" ')+'title="'.concat(r(t.label),'" ')+'style="display:inline-flex;align-items:center;gap:4px;margin:2px 4px 2px 0;padding:2px 6px;border-radius:5px;border:1px solid #e5e7eb;text-decoration:none;font-size:11px;color:#111;background:#fff;">'+'<span style="display:inline-block;width:14px;height:14px;border-radius:3px;background:'.concat(t.brand,";")+"color:#fff;font-size:9px;font-weight:700;line-height:14px;text-align:center;"+"letter-spacing:".concat(t.glyph.length>1?"-0.05em":"0",'">').concat(r(t.glyph),"</span>")+"<span>".concat(r(t.label),"</span>")+"</a>"}).join("");return['<div style="font-family:inherit;min-width:200px">','<div style="font-weight:600;font-size:13px;margin-bottom:2px">'.concat(r(e.title),"</div>"),e.description?'<div style="font-size:12px;color:#666;margin-bottom:6px">'.concat(r(e.description),"</div>"):"",'<div style="font-family:monospace;font-size:10px;color:#888;margin-bottom:6px">'.concat(e.lat.toFixed(5),", ").concat(e.lng.toFixed(5),"</div>"),t.length>0?'<div style="font-size:10px;color:#888;text-transform:uppercase;letter-spacing:0.5px;margin-bottom:2px">Открыть в</div>'.concat(a):"",'<div style="margin-top:6px"><button type="button" data-reflex-copy="'.concat(e.lat,", ").concat(e.lng,'" style="font-size:11px;padding:2px 8px;border:1px solid #ddd;border-radius:4px;background:#fff;cursor:pointer">\uD83D\uDCCB Скопировать координаты</button></div>'),"</div>"].filter(Boolean).join("")}(e,P),l=a.marker([e.lat,e.lng],{opacity:F&&!r?.55:1}).addTo(n);return l.bindPopup(s,{maxWidth:280}),l.on("click",()=>{F&&L(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])}),l});B.length>=2&&a.polyline(B.map(e=>[e.lat,e.lng]),{color:null!=(t=null==(e=l.route)?void 0:e.color)?t:"#7c3aed",weight:4,opacity:.85,dashArray:F?"6,6":void 0}).addTo(n);let o=e=>{let t=e.target.closest("[data-reflex-copy]");if(t){let r=t.getAttribute("data-reflex-copy");r&&navigator.clipboard.writeText(r).then(()=>R.oR.success("Скопировано")).catch(()=>R.oR.error("Буфер недоступен")),e.preventDefault()}};if(d.current.addEventListener("click",o),l.center&&"number"==typeof l.zoom)n.setView([l.center.lat,l.center.lng],l.zoom);else if(1===D.length)n.setView([D[0].lat,D[0].lng],null!=(r=l.zoom)?r:12);else{let e=a.featureGroup(s);n.fitBounds(e.getBounds().pad(.2))}return()=>{var e;null==(e=d.current)||e.removeEventListener("click",o),n.remove(),m.current=null}},[p,l,h.join("|"),F,M.join(",")]);let W=!o&&!!i,G=async()=>{let e=b.trim();if(e){N(!0),k([]);try{let t="".concat("https://nominatim.openstreetmap.org/search","?q=").concat(encodeURIComponent(e),"&format=json&limit=6"),r=await fetch(t,{headers:{Accept:"application/json"}});if(!r.ok)throw Error("status ".concat(r.status));let a=await r.json();k(a),0===a.length&&R.oR.message("Ничего не найдено")}catch(e){R.oR.error("Поиск не работает: "+(e instanceof Error?e.message:String(e)))}finally{N(!1)}}},V=async e=>{var t;if(!W)return;let r=Number(e.lat),a=Number(e.lon);if(!Number.isFinite(r)||!Number.isFinite(a))return void R.oR.error("Неверные координаты в результате");let n=(null==(t=e.display_name.split(",")[0])?void 0:t.trim())||e.display_name.slice(0,60),s={...l,points:[...D,{lat:r,lng:a,title:n,description:e.display_name}]};k([]),j(""),await (null==i?void 0:i(s))},Y=async e=>{var t,r;if(!W)return;let a=D.filter((t,r)=>r!==e),n=l.route;if(null==(r=l.route)||null==(t=r.stops)?void 0:t.length){let t=l.route.stops.filter(t=>t!==e).map(t=>t>e?t-1:t);n=t.length>=2?{...l.route,stops:t}:void 0}let s={...l,points:a,...n?{route:n}:{route:void 0}};await (null==i?void 0:i(s))},Z=async()=>{if(!W)return;let e={...l,route:void 0};await (null==i?void 0:i(e)),E(!1),L([])},K=async()=>{var e;if(!W)return;if(M.length<2)return void R.oR.error("В маршруте нужно минимум 2 точки");let t={...l,route:{...null!=(e=l.route)?e:{},stops:M}};await (null==i?void 0:i(t)),E(!1)};return 0!==D.length||W?(0,a.jsxs)("div",{className:"space-y-2",children:[W&&(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)(A.A,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground pointer-events-none"}),(0,a.jsx)("input",{type:"search",value:b,onChange:e=>j(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),G())},placeholder:"Найти место (адрес, POI)…",className:"w-full rounded border bg-background pl-7 pr-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-violet-400"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>void G(),disabled:y||!b.trim(),className:"rounded border px-2 py-1 text-xs hover:bg-accent disabled:opacity-50 inline-flex items-center gap-1",children:[y?(0,a.jsx)(f.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(A.A,{className:"h-3 w-3"}),"Поиск"]}),F?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("button",{type:"button",onClick:()=>void K(),className:"rounded px-2 py-1 text-xs bg-violet-600 text-white hover:bg-violet-700 inline-flex items-center gap-1",title:"Сохранить маршрут",children:[(0,a.jsx)(C.A,{className:"h-3 w-3"})," Сохранить"]}),(0,a.jsx)("button",{type:"button",onClick:()=>{E(!1),L([])},className:"rounded border px-2 py-1 text-xs hover:bg-accent inline-flex items-center gap-1",title:"Отменить",children:(0,a.jsx)(c.A,{className:"h-3 w-3"})})]}):(0,a.jsxs)("button",{type:"button",onClick:()=>{L(J),E(!0)},disabled:D.length<2,className:"rounded border px-2 py-1 text-xs hover:bg-accent disabled:opacity-50 inline-flex items-center gap-1",title:"Собрать маршрут по точкам",children:[(0,a.jsx)(C.A,{className:"h-3 w-3"}),(J.length,"Маршрут")]})]}),w.length>0&&(0,a.jsx)("ul",{className:"rounded border bg-card divide-y text-xs max-h-44 overflow-y-auto",children:w.map((e,t)=>(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",onClick:()=>void V(e),className:"w-full text-left flex items-start gap-2 px-2 py-1.5 hover:bg-accent",children:[(0,a.jsx)(g.A,{className:"h-3 w-3 mt-0.5 text-emerald-700 shrink-0"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block font-medium truncate",children:e.display_name.split(",")[0]}),(0,a.jsx)("span",{className:"block text-[10px] text-muted-foreground truncate",children:e.display_name})]})]})},t))}),F&&(0,a.jsxs)("div",{className:"rounded border border-violet-200 bg-violet-50 dark:bg-violet-950/30 dark:border-violet-900/50 px-2 py-1.5 text-[11px] text-violet-900 dark:text-violet-200",children:["Тыкай точки на карте или в списке ниже — добавятся в маршрут (",(0,a.jsx)("strong",{children:M.length})," уже). Повторный клик — убрать."]})]}),(0,a.jsx)("div",{ref:d,className:"rounded-md border overflow-hidden bg-muted/30",style:{height:280}}),!F&&B.length>=2&&P.length>0&&(0,a.jsx)("div",{className:"rounded border bg-card px-2 py-1.5",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-[11px] font-medium",children:[(0,a.jsx)(C.A,{className:"h-3 w-3 text-violet-600"}),"Маршрут (",B.length," точки):"]}),P.map(e=>(0,a.jsx)(I,{service:e,stops:B},e.id)),W&&(0,a.jsxs)("button",{type:"button",onClick:()=>void Z(),className:"ml-auto text-[10px] text-muted-foreground hover:text-destructive inline-flex items-center gap-0.5",title:"Удалить маршрут",children:[(0,a.jsx)(u.A,{className:"h-3 w-3"}),"Удалить"]})]})}),(0,a.jsx)("ul",{className:"space-y-1",children:D.map((e,t)=>{let r=q.indexOf(t);return(0,a.jsxs)("li",{className:"flex items-start gap-2 rounded-md border bg-card px-2 py-1.5 text-xs "+(F&&r>=0?"ring-1 ring-violet-400 border-violet-300":""),children:[F?(0,a.jsx)("button",{type:"button",onClick:()=>L(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t]),className:"h-5 w-5 mt-0.5 shrink-0 rounded-full border text-[10px] font-mono inline-flex items-center justify-center "+(r>=0?"bg-violet-600 text-white border-violet-600":"bg-card text-muted-foreground"),title:r>=0?"Убрать из маршрута":"Добавить в маршрут",children:r>=0?r+1:"+"}):(0,a.jsx)(S.A,{className:"h-3 w-3 mt-1 shrink-0 "+(J.includes(t)?"text-violet-600":"text-emerald-700")}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"font-medium truncate",children:e.title}),e.description&&(0,a.jsx)("p",{className:"text-muted-foreground leading-snug mt-0.5 line-clamp-2",children:e.description}),(0,a.jsxs)("div",{className:"text-[10px] text-muted-foreground/80 font-mono mt-0.5",children:[e.lat.toFixed(5),", ",e.lng.toFixed(5)]})]}),(0,a.jsx)(T,{point:e,services:P,interactive:W,onRemove:()=>void Y(t)})]},t)})})]}):(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Точек нет — попроси агента добавить через widget-update."})},"utility-card":function(e){let{rootId:t,data:r,readonly:n}=e,s="project"===r.utilityScope?"/utilities/project/".concat(r.utilityId,"?rootId=").concat(encodeURIComponent(t)):"/utilities/global/".concat(r.utilityId);return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] uppercase tracking-wider text-muted-foreground",children:[(0,a.jsx)(L.A,{className:"h-3 w-3 text-violet-600"}),(0,a.jsx)("span",{children:"Мини-приложение"}),(0,a.jsx)("span",{className:"font-mono normal-case tracking-normal text-muted-foreground/80",children:r.utilityId}),(0,a.jsxs)(N(),{href:s,className:"ml-auto inline-flex items-center gap-0.5 text-[10px] text-violet-700 hover:underline normal-case tracking-normal",title:"Открыть полную версию",children:["Открыть",(0,a.jsx)(o.A,{className:"h-2.5 w-2.5"})]})]}),r.inner.title&&(0,a.jsx)("h4",{className:"text-sm font-medium",children:r.inner.title}),r.inner.description&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground -mt-1",children:r.inner.description}),(0,a.jsx)("div",{children:J(t,r.inner.kind,r.inner.data,{readonly:!0})})]})}};function J(e,t,r,n){var s;let l=D[t];return l?(0,a.jsx)(l,{rootId:e,data:r,readonly:null!=(s=null==n?void 0:n.readonly)&&s,onPatch:null==n?void 0:n.onPatch}):(0,a.jsxs)("p",{className:"text-xs text-destructive",children:["Неизвестный вид виджета: ",(0,a.jsx)("code",{className:"font-mono",children:t})]})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[992],{3834:(e,t,r)=>{r.d(t,{p:()=>j});var a=r(4624),s=r(99356),n=r(88365),o=r(72461),i=r(43455),l=r(13561),c=r(60532),d=r(3239),u=r(8096),m=r(94151),p=r(65714),x=r(43153),b=r(95265),f=r(56221),h=r(85253),g=r(15523),v=r(7911);let y=(0,v.createServerReference)("407dfe75f0305a307c9f88546ec2dd30a084ed975d",v.callServer,void 0,v.findSourceMapURL,"summarizeYoutubeAction");var w=r(54011);function j(e){let{source:t,onSendToChat:r,autoSummarizeYoutube:l}=e,[c,d]=(0,s.useState)(null);return(0,a.jsxs)("div",{className:"prose prose-neutral dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:rounded-md [&_pre]:p-4 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-foreground [&_:not(pre)>code]:bg-muted [&_:not(pre)>code]:px-1.5 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:rounded [&_:not(pre)>code]:text-[0.9em] [&_code]:font-mono [&_table]:text-sm",children:[(0,a.jsx)(n.oz,{remarkPlugins:[o.A],rehypePlugins:[[i.A,{detect:!0,ignoreMissing:!0}]],components:{a:e=>{let{href:t,children:s,...n}=e,o=t?function(e){try{let t=new URL(e),r=t.hostname.replace(/^www\./,"");if("youtu.be"===r){let e=t.pathname.slice(1).split("/")[0];return e&&/^[A-Za-z0-9_-]{6,}$/.test(e)?e:null}if("youtube.com"===r||"m.youtube.com"===r||"youtube-nocookie.com"===r){if("/watch"===t.pathname){let e=t.searchParams.get("v");return e&&/^[A-Za-z0-9_-]{6,}$/.test(e)?e:null}let e=/^\/(shorts|embed|live|v)\/([^/?#]+)/.exec(t.pathname);if(e&&/^[A-Za-z0-9_-]{6,}$/.test(e[2]))return e[2]}}catch(e){}return null}(t):null;return o&&t?(0,a.jsx)(_,{url:t,videoId:o,autoSummarize:null!=l&&l,...r?{onSendToChat:r}:{}}):(0,a.jsx)("a",{href:t,...n,children:s})},img:e=>{let{src:t,alt:r,title:s}=e;return"string"!=typeof t||0===t.length?null:(0,a.jsx)(k,{src:t,alt:"string"==typeof r?r:"",title:"string"==typeof s?s:void 0,onZoom:e=>d(e)})}},children:t}),c&&(0,a.jsx)(N,{src:c.src,alt:c.alt,onClose:()=>d(null)})]})}function k(e){var t;let{src:r,alt:s,title:n,onZoom:o}=e;return(0,a.jsx)("img",{src:r,alt:s,title:null!=(t=null!=n?n:s)?t:"Открыть на весь экран",onClick:()=>o({src:r,alt:s}),className:"cursor-zoom-in rounded-md border bg-muted/40 transition hover:opacity-90",loading:"lazy"})}function N(e){let{src:t,alt:r,onClose:n}=e,o=(0,s.useCallback)(e=>{"Escape"===e.key&&n()},[n]);return(0,s.useEffect)(()=>{document.addEventListener("keydown",o);let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",o),document.body.style.overflow=e}},[o]),(0,a.jsxs)("div",{className:"fixed inset-0 z-[80] flex items-center justify-center p-6 bg-background/85 backdrop-blur-sm cursor-zoom-out",onClick:n,role:"dialog","aria-label":r||"Просмотр изображения",children:[(0,a.jsx)(h.$,{type:"button",size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-9 w-9 bg-card/80 hover:bg-card",onClick:e=>{e.stopPropagation(),n()},"aria-label":"Закрыть",children:(0,a.jsx)(l.A,{className:"h-5 w-5"})}),(0,a.jsx)("img",{src:t,alt:r,className:"max-h-full max-w-full object-contain rounded-lg shadow-2xl",onClick:e=>e.stopPropagation()}),r&&(0,a.jsx)("div",{className:"absolute bottom-6 inset-x-0 mx-auto max-w-3xl px-6 text-center text-sm text-foreground/80 pointer-events-none",children:r})]})}function _(e){let{url:t,videoId:r,onSendToChat:n,autoSummarize:o}=e,[i,v]=(0,s.useTransition)(),[j,k]=(0,s.useState)(null),[N,_]=(0,s.useState)(!1),[A,z]=(0,s.useState)(""),[S,C]=(0,s.useState)(!1),R=(0,s.useRef)(!1),P=()=>{k(null),v(async()=>{let e=await y({url:t});if(e.ok){k(e.text),_(!1);return}if(e.needsKey)return void _(!0);f.oR.error(e.error)})};(0,s.useEffect)(()=>{o&&(R.current||(R.current=!0,P()))},[o]);let $=async()=>{if(!A.trim())return void f.oR.error("Введи ключ");C(!0);try{let e=await (0,w.A)(A.trim());if(!e.ok)return void f.oR.error(e.error);f.oR.success("Gemini key сохранён"),z(""),_(!1),P()}finally{C(!1)}};return(0,a.jsxs)("span",{className:"not-prose my-4 block rounded-lg border bg-card overflow-hidden",children:[(0,a.jsx)("span",{className:"relative block w-full",style:{paddingTop:"56.25%"},children:(0,a.jsx)("iframe",{src:"https://www.youtube-nocookie.com/embed/".concat(r),className:"absolute inset-0 h-full w-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",referrerPolicy:"strict-origin-when-cross-origin",allowFullScreen:!0,title:"YouTube video"})}),(0,a.jsxs)("span",{className:"flex items-center gap-2 p-2 border-t bg-muted/30",children:[(0,a.jsx)(c.A,{className:"h-4 w-4 text-red-600 shrink-0"}),(0,a.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:underline truncate flex-1 min-w-0",children:t}),(0,a.jsxs)(h.$,{type:"button",size:"sm",variant:"outline",onClick:P,disabled:i,className:"gap-1 shrink-0 h-7",children:[i?(0,a.jsx)(d.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(u.A,{className:"h-3 w-3"}),"Суммаризировать"]})]}),N&&(0,a.jsxs)("span",{className:"block border-t bg-amber-50/60 p-3 space-y-2",children:[(0,a.jsxs)("span",{className:"flex items-center gap-2 text-xs text-amber-900",children:[(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{className:"font-medium",children:"Нужен Gemini API key"})]}),(0,a.jsxs)("span",{className:"block text-[11px] text-amber-900/80",children:["Возьми ключ в"," ",(0,a.jsx)("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"aistudio.google.com/apikey"})," ","— бесплатный tier (15 RPM / 1500 RPD). Сохранится в"," ",(0,a.jsx)("code",{className:"font-mono",children:"~/.reflex/api-keys/gemini.json"})," ","(0600), агентам не передаётся. Модель подтянется автоматически из"," ",(0,a.jsx)("code",{className:"font-mono",children:"models.list"})," (по умолчанию — самая быстрая flash); сменить можно в Settings → Gemini."]}),(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)(g.p,{type:"password",value:A,onChange:e=>z(e.target.value),placeholder:"AIza…",className:"font-mono text-xs h-8 flex-1",disabled:S}),(0,a.jsxs)(h.$,{type:"button",size:"sm",onClick:()=>void $(),disabled:S||!A.trim(),className:"h-8 gap-1",children:[S?(0,a.jsx)(d.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(p.A,{className:"h-3 w-3"}),"Сохранить и продолжить"]}),(0,a.jsx)(h.$,{type:"button",size:"icon",variant:"ghost",onClick:()=>_(!1),className:"h-8 w-8",children:(0,a.jsx)(l.A,{className:"h-3.5 w-3.5"})})]})]}),j&&(0,a.jsxs)("span",{className:"block border-t p-3 space-y-2",children:[(0,a.jsxs)("span",{className:"flex items-center gap-2 text-[11px] uppercase tracking-wider text-muted-foreground",children:[(0,a.jsx)(x.A,{className:"h-3 w-3 text-emerald-600"}),"Gemini summary",(0,a.jsxs)(h.$,{type:"button",size:"sm",variant:"ghost",onClick:P,className:"ml-auto h-6 text-[10px] gap-1",disabled:i,children:[i?(0,a.jsx)(d.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(u.A,{className:"h-3 w-3"}),"Переделать"]}),n&&(0,a.jsxs)(h.$,{type:"button",size:"sm",variant:"outline",onClick:()=>n(j,t),className:"h-6 text-[10px] gap-1",children:[(0,a.jsx)(b.A,{className:"h-3 w-3"}),"В чат"]})]}),(0,a.jsx)("span",{className:"block",children:(0,a.jsx)("span",{className:"block text-sm whitespace-pre-wrap leading-relaxed",children:j})})]})]})}},15523:(e,t,r)=>{r.d(t,{p:()=>n});var a=r(4624);r(99356);var s=r(13506);function n(e){let{className:t,type:r,...n}=e;return(0,a.jsx)("input",{type:r,"data-slot":"input",className:(0,s.cn)("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",t),...n})}},28310:(e,t,r)=>{r.d(t,{E:()=>l});var a=r(4624);r(99356);var s=r(60621),n=r(50362),o=r(13506);let i=(0,s.F)("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function l(e){let{className:t,variant:r="default",asChild:s=!1,...l}=e,c=s?n.bL:"span";return(0,a.jsx)(c,{"data-slot":"badge","data-variant":r,className:(0,o.cn)(i({variant:r}),t),...l})}},54011:(e,t,r)=>{r.d(t,{A:()=>s});var a=r(7911);let s=(0,a.createServerReference)("4091c5295b199046b5fb903fd106a8e70219998b45",a.callServer,void 0,a.findSourceMapURL,"saveGeminiKeyAction")},78825:(e,t,r)=>{r.d(t,{J:()=>o});var a=r(4624);r(99356);var s=r(33976),n=r(13506);function o(e){let{className:t,...r}=e;return(0,a.jsx)(s.Root,{"data-slot":"label",className:(0,n.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...r})}},91074:(e,t,r)=>{r.d(t,{Separator:()=>o});var a=r(4624);r(99356);var s=r(44188),n=r(13506);function o(e){let{className:t,orientation:r="horizontal",decorative:o=!0,...i}=e;return(0,a.jsx)(s.b,{"data-slot":"separator",decorative:o,orientation:r,className:(0,n.cn)("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...i})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3964],{13506:(e,t,r)=>{"use strict";r.d(t,{cn:()=>i});var s=r(47989),n=r(55701);function i(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.QP)((0,s.$)(t))}},40284:(e,t,r)=>{"use strict";r.d(t,{AgentEventStream:()=>i});var s=r(4624),n=r(99356);function i(e){let{agentId:t,rootId:r,topicId:i,initialEvents:a}=e,[l,c]=(0,n.useState)(a),d=(0,n.useRef)(a.length>0?a[a.length-1].seq:-1);return(0,n.useEffect)(()=>{let e=new AbortController,s=!1;return(async()=>{try{let n=await fetch("/api/roots/".concat(r,"/chat/").concat(i,"/stream?since=").concat(d.current),{signal:e.signal});if(!n.ok||!n.body)return;let o=n.body.getReader(),a=new TextDecoder,l="";for(;!s;){let{done:e,value:r}=await o.read();if(e)break;for(let e of(l+=a.decode(r,{stream:!0}),function(e){let t=[];for(;;){let r=e.indexOf("\n\n");if(r<0)break;let s=e.slice(0,r);e=e.slice(r+2);let n="message",i="";for(let e of s.split(/\r?\n/))!e.startsWith(":")&&(e.startsWith("event:")?n=e.slice(6).trim():e.startsWith("data:")&&(i+=e.slice(5).trimStart()));let o=null;try{o=i?JSON.parse(i):null}catch(e){o=null}t.push({event:n,data:o,rest:e})}return t}(l))){if(l=e.rest,"event"!==e.event||!e.data)continue;let r=e.data;r.agentId===t&&(r.seq<=d.current||(d.current=r.seq,c(e=>[...e,r])))}}}catch(e){}})(),()=>{s=!0,e.abort()}},[t,r,i]),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,s.jsx)("div",{className:"mx-auto max-w-3xl px-6 py-6 space-y-2",children:0===l.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground italic",children:"Событий нет."}):l.map(e=>(0,s.jsx)(o,{event:e},e.seq))})})}function o(e){let{event:t}=e,r=new Date(t.ts).toLocaleTimeString();if("agent-start"===t.type)return(0,s.jsxs)(a,{children:[(0,s.jsx)(l,{time:r,type:"agent-start"}),(0,s.jsxs)("p",{className:"text-xs",children:[t.meta.role," \xb7 ",t.meta.harness," \xb7 ",t.meta.model]})]});if("agent-end"===t.type)return(0,s.jsxs)(a,{children:[(0,s.jsx)(l,{time:r,type:"agent-end (".concat(t.status,")")}),t.error&&(0,s.jsx)("p",{className:"text-xs text-destructive",children:t.error})]});if("turn-start"===t.type)return(0,s.jsx)(a,{children:(0,s.jsx)(l,{time:r,type:"turn-start (".concat(t.turnId,")")})});if("turn-end"===t.type)return(0,s.jsxs)(a,{children:[(0,s.jsx)(l,{time:r,type:"turn-end (".concat(t.status,")")}),t.error&&(0,s.jsx)("p",{className:"text-xs text-destructive",children:t.error})]});if("user-message"===t.type)return(0,s.jsxs)(a,{children:[(0,s.jsx)(l,{time:r,type:"user-message"}),(0,s.jsx)("pre",{className:"text-xs whitespace-pre-wrap",children:t.text})]});if("assistant-delta"===t.type)return(0,s.jsxs)(a,{children:[(0,s.jsx)(l,{time:r,type:"assistant-delta"}),(0,s.jsx)("pre",{className:"text-xs whitespace-pre-wrap",children:t.text})]});if("tool-use"===t.type)return(0,s.jsxs)(a,{children:[(0,s.jsx)(l,{time:r,type:"tool-use: ".concat(t.name)}),(0,s.jsx)("pre",{className:"text-[11px] whitespace-pre-wrap font-mono",children:JSON.stringify(t.input,null,2)})]});if("tool-result"===t.type)return(0,s.jsxs)(a,{children:[(0,s.jsx)(l,{time:r,type:"tool-result".concat(t.isError?" (error)":"")}),(0,s.jsx)("pre",{className:"text-[11px] whitespace-pre-wrap font-mono max-h-64 overflow-y-auto",children:t.content})]});if("system"===t.type){var n;return(0,s.jsxs)(a,{children:[(0,s.jsx)(l,{time:r,type:"system: ".concat(null!=(n=t.subtype)?n:"system")}),(0,s.jsx)("pre",{className:"text-xs whitespace-pre-wrap",children:t.text})]})}return"error"===t.type?(0,s.jsxs)(a,{children:[(0,s.jsx)(l,{time:r,type:"error"}),(0,s.jsx)("pre",{className:"text-xs text-destructive whitespace-pre-wrap",children:t.message})]}):null}function a(e){let{children:t}=e;return(0,s.jsx)("div",{className:"rounded-md border bg-muted/20 p-3",children:t})}function l(e){let{time:t,type:r}=e;return(0,s.jsxs)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-mono",children:t}),(0,s.jsx)("span",{children:r})]})}},58458:(e,t,r)=>{Promise.resolve().then(r.bind(r,40284)),Promise.resolve().then(r.bind(r,91074)),Promise.resolve().then(r.bind(r,96253)),Promise.resolve().then(r.bind(r,28050)),Promise.resolve().then(r.bind(r,94904)),Promise.resolve().then(r.bind(r,13270)),Promise.resolve().then(r.bind(r,99730)),Promise.resolve().then(r.bind(r,89146)),Promise.resolve().then(r.bind(r,19078)),Promise.resolve().then(r.bind(r,67854)),Promise.resolve().then(r.bind(r,69050)),Promise.resolve().then(r.bind(r,63739)),Promise.resolve().then(r.bind(r,33976)),Promise.resolve().then(r.bind(r,12537)),Promise.resolve().then(r.bind(r,97485)),Promise.resolve().then(r.bind(r,41923)),Promise.resolve().then(r.bind(r,73868)),Promise.resolve().then(r.bind(r,53511)),Promise.resolve().then(r.bind(r,2018)),Promise.resolve().then(r.bind(r,18487)),Promise.resolve().then(r.bind(r,98346)),Promise.resolve().then(r.bind(r,14884)),Promise.resolve().then(r.bind(r,85314)),Promise.resolve().then(r.bind(r,17280)),Promise.resolve().then(r.bind(r,8855)),Promise.resolve().then(r.bind(r,86631)),Promise.resolve().then(r.bind(r,2604)),Promise.resolve().then(r.bind(r,27237)),Promise.resolve().then(r.bind(r,49455)),Promise.resolve().then(r.bind(r,39211)),Promise.resolve().then(r.bind(r,56360)),Promise.resolve().then(r.t.bind(r,54400,23))},91074:(e,t,r)=>{"use strict";r.d(t,{Separator:()=>o});var s=r(4624);r(99356);var n=r(44188),i=r(13506);function o(e){let{className:t,orientation:r="horizontal",decorative:o=!0,...a}=e;return(0,s.jsx)(n.b,{"data-slot":"separator",decorative:o,orientation:r,className:(0,i.cn)("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...a})}}},e=>{e.O(0,[4400,1217,3335,4933,146,7358],()=>e(e.s=58458)),_N_E=e.O()}]);
|