kiki-agent-lite 0.3.1 → 0.3.2
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/README.md +13 -10
- package/dist/docs/en/configuration/config-files.md +63 -20
- package/dist/docs/en/configuration/data-locations.md +12 -4
- package/dist/docs/en/configuration/env-vars.md +4 -6
- package/dist/docs/en/configuration/overrides.md +13 -14
- package/dist/docs/en/configuration/providers.md +8 -6
- package/dist/docs/en/customization/agent-profiles.md +33 -38
- package/dist/docs/en/customization/agents.md +129 -107
- package/dist/docs/en/customization/hooks.md +41 -48
- package/dist/docs/en/customization/personas.md +19 -21
- package/dist/docs/en/customization/plugins.md +180 -156
- package/dist/docs/en/customization/prompt-fields.md +10 -6
- package/dist/docs/en/customization/skills.md +11 -13
- package/dist/docs/en/customization/skins.md +23 -27
- package/dist/docs/en/customization/themes.md +15 -15
- package/dist/docs/en/features/agents.md +85 -0
- package/dist/docs/en/features/daily.md +37 -7
- package/dist/docs/en/features/ecosystem.md +3 -1
- package/dist/docs/en/features/extend.md +7 -1
- package/dist/docs/en/features/freedom.md +4 -0
- package/dist/docs/en/features/index.md +6 -5
- package/dist/docs/en/features/long-work.md +23 -5
- package/dist/docs/en/features/look.md +1 -1
- package/dist/docs/en/features/people.md +10 -2
- package/dist/docs/en/features/spaces.md +16 -4
- package/dist/docs/en/features/workbench.md +11 -3
- package/dist/docs/en/getting-started/desktop-app.md +44 -29
- package/dist/docs/en/getting-started/first-launch.md +32 -21
- package/dist/docs/en/getting-started/installation.md +27 -12
- package/dist/docs/en/getting-started/use-cases.md +35 -35
- package/dist/docs/en/guides/goals.md +9 -7
- package/dist/docs/en/guides/interaction.md +26 -26
- package/dist/docs/en/guides/interface.md +18 -14
- package/dist/docs/en/guides/memory.md +43 -14
- package/dist/docs/en/guides/sessions.md +32 -26
- package/dist/docs/en/guides/settings.md +60 -29
- package/dist/docs/en/index.md +8 -2
- package/dist/docs/en/reference/command.md +8 -4
- package/dist/docs/en/reference/keyboard.md +18 -4
- package/dist/docs/en/reference/model-vocabulary.md +6 -8
- package/dist/docs/en/reference/slash-commands.md +4 -4
- package/dist/docs/en/reference/tools.md +92 -15
- package/dist/docs/en/release-notes/changelog.md +1 -9
- package/dist/docs/en/server/acp.md +1 -1
- package/dist/docs/en/server/ide.md +1 -1
- package/dist/docs/en/server/local-server.md +5 -5
- package/dist/docs/en/server/mcp.md +2 -2
- package/dist/docs/en/server/rest-api.md +79 -5
- package/dist/docs/en/server/sdk.md +2 -2
- package/dist/docs/zh/configuration/config-files.md +56 -15
- package/dist/docs/zh/configuration/data-locations.md +12 -4
- package/dist/docs/zh/configuration/env-vars.md +4 -6
- package/dist/docs/zh/configuration/overrides.md +13 -14
- package/dist/docs/zh/configuration/providers.md +7 -5
- package/dist/docs/zh/customization/agent-profiles.md +31 -36
- package/dist/docs/zh/customization/agents.md +120 -98
- package/dist/docs/zh/customization/hooks.md +35 -42
- package/dist/docs/zh/customization/personas.md +16 -18
- package/dist/docs/zh/customization/plugins.md +167 -142
- package/dist/docs/zh/customization/prompt-fields.md +9 -5
- package/dist/docs/zh/customization/skills.md +10 -12
- package/dist/docs/zh/customization/skins.md +19 -23
- package/dist/docs/zh/customization/themes.md +12 -12
- package/dist/docs/zh/features/agents.md +85 -0
- package/dist/docs/zh/features/daily.md +37 -7
- package/dist/docs/zh/features/ecosystem.md +3 -1
- package/dist/docs/zh/features/extend.md +7 -1
- package/dist/docs/zh/features/freedom.md +4 -0
- package/dist/docs/zh/features/index.md +6 -5
- package/dist/docs/zh/features/long-work.md +22 -4
- package/dist/docs/zh/features/look.md +1 -1
- package/dist/docs/zh/features/people.md +10 -2
- package/dist/docs/zh/features/spaces.md +15 -3
- package/dist/docs/zh/features/workbench.md +11 -3
- package/dist/docs/zh/getting-started/desktop-app.md +43 -28
- package/dist/docs/zh/getting-started/first-launch.md +32 -21
- package/dist/docs/zh/getting-started/installation.md +26 -11
- package/dist/docs/zh/getting-started/use-cases.md +35 -37
- package/dist/docs/zh/guides/goals.md +8 -8
- package/dist/docs/zh/guides/interaction.md +25 -25
- package/dist/docs/zh/guides/interface.md +18 -14
- package/dist/docs/zh/guides/memory.md +43 -14
- package/dist/docs/zh/guides/sessions.md +30 -24
- package/dist/docs/zh/guides/settings.md +54 -23
- package/dist/docs/zh/index.md +7 -1
- package/dist/docs/zh/reference/command.md +7 -3
- package/dist/docs/zh/reference/keyboard.md +18 -4
- package/dist/docs/zh/reference/model-vocabulary.md +6 -8
- package/dist/docs/zh/reference/slash-commands.md +3 -3
- package/dist/docs/zh/reference/tools.md +74 -9
- package/dist/docs/zh/release-notes/changelog.md +1 -9
- package/dist/docs/zh/server/acp.md +1 -1
- package/dist/docs/zh/server/ide.md +1 -1
- package/dist/docs/zh/server/local-server.md +5 -5
- package/dist/docs/zh/server/mcp.md +2 -2
- package/dist/docs/zh/server/rest-api.md +69 -1
- package/dist/docs/zh/server/sdk.md +2 -2
- package/dist/main.mjs +12545 -3456
- package/dist/web/assets/AppErrorBoundary-RFIAb-Uf.js +1 -0
- package/dist/web/assets/NavScopeBoundary-DY_ET7A-.js +1 -0
- package/dist/web/assets/{arc-y2SkSoyr.js → arc-CMgTB1m7.js} +1 -1
- package/dist/web/assets/{architectureDiagram-3BPJPVTR-uCwLz53m.js → architectureDiagram-3BPJPVTR-BU79ou2C.js} +1 -1
- package/dist/web/assets/{blockDiagram-GPEHLZMM-BZyWv36G.js → blockDiagram-GPEHLZMM-Bkuldod2.js} +1 -1
- package/dist/web/assets/{c4Diagram-AAUBKEIU-DKGx9i50.js → c4Diagram-AAUBKEIU-C3WMeqyu.js} +1 -1
- package/dist/web/assets/channel-DpDZUJRn.js +1 -0
- package/dist/web/assets/{chunk-2J33WTMH-CSkrhrsp.js → chunk-2J33WTMH-CesyWmwo.js} +1 -1
- package/dist/web/assets/{chunk-4BX2VUAB-CtxMoJ68.js → chunk-4BX2VUAB-C7rghYTf.js} +1 -1
- package/dist/web/assets/{chunk-55IACEB6-Dos3ftEy.js → chunk-55IACEB6-BqRHhwtz.js} +1 -1
- package/dist/web/assets/{chunk-727SXJPM-wbzEYK9z.js → chunk-727SXJPM-BhSqCRBc.js} +1 -1
- package/dist/web/assets/{chunk-AQP2D5EJ-B9GKvCD6.js → chunk-AQP2D5EJ-DdYE2ZVZ.js} +1 -1
- package/dist/web/assets/{chunk-FMBD7UC4-u5Y2P6IX.js → chunk-FMBD7UC4-BCRPUxDF.js} +1 -1
- package/dist/web/assets/{chunk-ND2GUHAM-B8rFKkTV.js → chunk-ND2GUHAM-CuvyDjTR.js} +1 -1
- package/dist/web/assets/{chunk-QZHKN3VN-EQsKtuD-.js → chunk-QZHKN3VN-BU5vAS78.js} +1 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-Bju1GfNu.js +1 -0
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-Bju1GfNu.js +1 -0
- package/dist/web/assets/client-C0oH7-8r.js +2 -0
- package/dist/web/assets/connection-BhO2nh7P.js +1 -0
- package/dist/web/assets/{cose-bilkent-S5V4N54A-D6dr5mIW.js → cose-bilkent-S5V4N54A-CXrvsA1a.js} +1 -1
- package/dist/web/assets/{dagre-BM42HDAG-Dnyhc4Hn.js → dagre-BM42HDAG-TaAea3Rt.js} +1 -1
- package/dist/web/assets/{diagram-2AECGRRQ-CYXkWdne.js → diagram-2AECGRRQ-CdEH4jGt.js} +1 -1
- package/dist/web/assets/{diagram-5GNKFQAL-DPwBf5Ag.js → diagram-5GNKFQAL-A0jZ_p-T.js} +1 -1
- package/dist/web/assets/{diagram-KO2AKTUF-DNeLYZ8X.js → diagram-KO2AKTUF-miHWORz3.js} +1 -1
- package/dist/web/assets/{diagram-LMA3HP47-zU8RsQTX.js → diagram-LMA3HP47-BlUIwEIg.js} +1 -1
- package/dist/web/assets/{diagram-OG6HWLK6-Cf9Mm94H.js → diagram-OG6HWLK6-DwDzMhEg.js} +1 -1
- package/dist/web/assets/{erDiagram-TEJ5UH35-Ch4CeiUI.js → erDiagram-TEJ5UH35-BJr5w62i.js} +1 -1
- package/dist/web/assets/export-BlxaZKEe.js +2 -0
- package/dist/web/assets/{flowDiagram-I6XJVG4X-Csn6WqEH.js → flowDiagram-I6XJVG4X-BP7KSFjx.js} +1 -1
- package/dist/web/assets/{ganttDiagram-6RSMTGT7-DsuBgEyu.js → ganttDiagram-6RSMTGT7-BstLBBof.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-PVQCEYII-CPA7jCxU.js → gitGraphDiagram-PVQCEYII-C57s7nZ-.js} +1 -1
- package/dist/web/assets/highlighted-body-OFNGDK62-BVb-7KsA.js +1 -0
- package/dist/web/assets/index-69qhvTvD.js +1 -0
- package/dist/web/assets/{index-BYUHmd8w.js → index-BDNM6yJI.js} +2 -2
- package/dist/web/assets/{index-BGgZxlEQ.js → index-BJF_gEDs.js} +2 -2
- package/dist/web/assets/index-BOwMP6BP.js +1 -0
- package/dist/web/assets/{index-C69a5Mcz.js → index-BZsyXCqm.js} +1 -1
- package/dist/web/assets/{index-C7EA7a_g.js → index-Bfl4JiNq.js} +2 -2
- package/dist/web/assets/index-BlD3AKX-.js +1 -0
- package/dist/web/assets/{index-CIymCfcP.js → index-BnvW0EvQ.js} +1 -1
- package/dist/web/assets/index-C4rmWyOm.js +1 -0
- package/dist/web/assets/index-CGLcb3HY.js +1 -0
- package/dist/web/assets/{index-kWBxPqIX.js → index-CPvOeQPX.js} +1 -1
- package/dist/web/assets/index-Cjbe0JKM.js +1 -0
- package/dist/web/assets/index-CmYoJWUm.js +1 -0
- package/dist/web/assets/index-CtUFrjKe.js +1 -0
- package/dist/web/assets/index-DDvDRMTK.js +1 -0
- package/dist/web/assets/index-DSpndwAR.css +1 -0
- package/dist/web/assets/index-D_JjTHxi.js +1 -0
- package/dist/web/assets/index-DbuwcnbT.js +1 -0
- package/dist/web/assets/index-DcXyS0nN.js +1 -0
- package/dist/web/assets/index-Dcl9ruKA.js +1 -0
- package/dist/web/assets/index-DgwALPNA.js +121 -0
- package/dist/web/assets/{index-DoN1FTEe.js → index-DkE8hRT1.js} +2 -2
- package/dist/web/assets/index-DsyRBZ4h.js +1 -0
- package/dist/web/assets/{index-29zav3JI.js → index-DuudNhLL.js} +4 -4
- package/dist/web/assets/index-Gc4F0b2f.js +1 -0
- package/dist/web/assets/index-HGqqwKoV.js +13 -0
- package/dist/web/assets/index-KchrJnno.js +3 -0
- package/dist/web/assets/{index-B0KNSyji.js → index-Tmi2BPYU.js} +1 -1
- package/dist/web/assets/index-Ya4GuDs0.js +1 -0
- package/dist/web/assets/index-_aDaKqLB.js +1 -0
- package/dist/web/assets/index-_qwOAotB.js +1 -0
- package/dist/web/assets/index-hnIkczza.js +7 -0
- package/dist/web/assets/{infoDiagram-5YYISTIA-D3Q__m62.js → infoDiagram-5YYISTIA-CifuVY6C.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-CcvCBuZ5.js → ishikawaDiagram-YF4QCWOH-Cd60vQUi.js} +1 -1
- package/dist/web/assets/{journeyDiagram-JHISSGLW-COZU4LNt.js → journeyDiagram-JHISSGLW-Cb3Xl_wl.js} +1 -1
- package/dist/web/assets/{kanban-definition-UN3LZRKU-BrXjBoAU.js → kanban-definition-UN3LZRKU-Ei6ThuZt.js} +1 -1
- package/dist/web/assets/{linear-BgP1STFi.js → linear-CDZJx-o2.js} +1 -1
- package/dist/web/assets/mermaid-GHXKKRXX-DFxyxD7G.js +331 -0
- package/dist/web/assets/{mindmap-definition-RKZ34NQL-CgjSrE5r.js → mindmap-definition-RKZ34NQL-B0ygxzkx.js} +1 -1
- package/dist/web/assets/navViewState-Ck_HK-TK.js +1 -0
- package/dist/web/assets/{pieDiagram-4H26LBE5-DTfe1sKA.js → pieDiagram-4H26LBE5-B2FdrvDv.js} +1 -1
- package/dist/web/assets/{quadrantDiagram-W4KKPZXB-D95hfh0q.js → quadrantDiagram-W4KKPZXB-CwpOTy3d.js} +1 -1
- package/dist/web/assets/{requirementDiagram-4Y6WPE33-DtSLi7Mh.js → requirementDiagram-4Y6WPE33-ExdZNzLQ.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-5OEKKPKP-gi_dJpcU.js → sankeyDiagram-5OEKKPKP-u0EZKD7D.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-3UESZ5HK-DKQ9a72t.js → sequenceDiagram-3UESZ5HK-BXHMy5DY.js} +1 -1
- package/dist/web/assets/{spaces-B2Ccyh_T.js → spaces-C8n7xQPx.js} +1 -1
- package/dist/web/assets/{stateDiagram-AJRCARHV-Bz7tmSqa.js → stateDiagram-AJRCARHV-DMXx7ell.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-Bydq1_By.js +1 -0
- package/dist/web/assets/theme-BBnHttAf.js +1 -0
- package/dist/web/assets/{timeline-definition-PNZ67QCA-BfMXPwhV.js → timeline-definition-PNZ67QCA-DtqVG_4u.js} +1 -1
- package/dist/web/assets/{vennDiagram-CIIHVFJN-WLxW2KT5.js → vennDiagram-CIIHVFJN-Dom0ex8r.js} +1 -1
- package/dist/web/assets/{wardley-L42UT6IY-DiiqwIdq.js → wardley-L42UT6IY-C-RstmuQ.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-YWT4CUSO-DmCukWuw.js → wardleyDiagram-YWT4CUSO-C8CzNfdf.js} +1 -1
- package/dist/web/assets/{xychartDiagram-2RQKCTM6-Cfq1W2tT.js → xychartDiagram-2RQKCTM6-1AxVTyB6.js} +1 -1
- package/dist/web/index.html +2 -2
- package/native/auth-native/prebuilds/linux-arm64/auth-native.node +0 -0
- package/native/auth-native/prebuilds/linux-x64/auth-native.node +0 -0
- package/native/auth-native/prebuilds/win32-arm64/auth-native.node +0 -0
- package/native/auth-native/prebuilds/win32-x64/auth-native.node +0 -0
- package/package.json +1 -1
- package/dist/web/assets/AppErrorBoundary-DWpgwxFV.js +0 -1
- package/dist/web/assets/NavScopeBoundary-D8Lf1G0U.js +0 -1
- package/dist/web/assets/channel-BGdXootG.js +0 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-CPcnLy_H.js +0 -1
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-CPcnLy_H.js +0 -1
- package/dist/web/assets/client-DSIbyfoz.js +0 -2
- package/dist/web/assets/connection-DYZn9oPZ.js +0 -1
- package/dist/web/assets/export-Bq8ZECqX.js +0 -2
- package/dist/web/assets/highlighted-body-OFNGDK62-CDPBxM_E.js +0 -1
- package/dist/web/assets/index-AksnytJj.js +0 -1
- package/dist/web/assets/index-B8xhhYDh.css +0 -1
- package/dist/web/assets/index-BUrlrKap.js +0 -1
- package/dist/web/assets/index-B_5-HLed.js +0 -62
- package/dist/web/assets/index-BfmoxdpP.js +0 -1
- package/dist/web/assets/index-Bo3e-ohM.js +0 -3
- package/dist/web/assets/index-BrYV9gV_.js +0 -1
- package/dist/web/assets/index-C8XUtAvK.js +0 -1
- package/dist/web/assets/index-C9uil5my.js +0 -13
- package/dist/web/assets/index-CKpWHSp9.js +0 -1
- package/dist/web/assets/index-CLKBgQxV.js +0 -1
- package/dist/web/assets/index-CTyyUNWj.js +0 -7
- package/dist/web/assets/index-D7cg9qYZ.js +0 -1
- package/dist/web/assets/index-D7dg8R_q.js +0 -1
- package/dist/web/assets/index-DCSpedV_.js +0 -1
- package/dist/web/assets/index-DLbD0Nx5.js +0 -1
- package/dist/web/assets/index-DaEzbvvu.js +0 -1
- package/dist/web/assets/index-DhbcjMZF.js +0 -1
- package/dist/web/assets/index-Dw2h88mF.js +0 -1
- package/dist/web/assets/index-FcMtfmKv.js +0 -1
- package/dist/web/assets/index-XFq9Kgg0.js +0 -1
- package/dist/web/assets/index-iI2mM43w.js +0 -1
- package/dist/web/assets/index-oXOF7lko.js +0 -1
- package/dist/web/assets/locale-CANfezJ4.js +0 -17
- package/dist/web/assets/mermaid-GHXKKRXX-_JLagMll.js +0 -321
- package/dist/web/assets/navViewState-DS5LnMYc.js +0 -1
- package/dist/web/assets/settings-CcwMWXbp.js +0 -42
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-D6-wdUbw.js +0 -1
- package/dist/web/assets/theme-DlDhDxeD.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t,r as o}from"./index-DgwALPNA.js";import{u as a}from"./index-DbuwcnbT.js";class s extends o.Component{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,r){console.error("[app:error-boundary]",e,r.componentStack);try{sessionStorage.setItem("kiki.lastRenderFailure",JSON.stringify({at:new Date().toISOString(),path:window.location.pathname,version:"0.3.2",build:"",message:e.message.slice(0,4096),stack:e.stack?.slice(0,16384),componentStack:r.componentStack?.slice(0,16384)}))}catch{}}render(){const{error:e}=this.state;if(e===null)return this.props.children;const r=e.message.trim()||e.name;return t.jsx("main",{className:"flex h-full min-h-screen items-center justify-center bg-paper px-4 text-ink",children:t.jsxs("section",{role:"alert",className:"w-full max-w-[520px] rounded-xl border border-hairline bg-panel px-7 py-6 shadow-[0_1px_2px_rgb(var(--kiki-shadow-ink)/0.04),0_12px_32px_-16px_rgb(var(--kiki-shadow-ink)/0.12)]",children:[t.jsx("h1",{className:"font-display text-xl font-semibold tracking-tight text-ink",children:this.props.title}),t.jsx("pre",{className:"mt-3 max-h-56 overflow-auto whitespace-pre-wrap rounded-lg border border-danger/30 bg-danger/5 px-3 py-2 font-mono text-[12px] leading-relaxed text-danger",children:r}),t.jsx("button",{type:"button",onClick:()=>{window.location.reload()},className:"mt-5 rounded-lg bg-accent px-4 py-2 text-[13px] font-semibold text-on-accent transition-colors hover:bg-accent-deep",children:this.props.reloadLabel})]})})}}function p({children:n}){const{t:e}=a();return t.jsx(s,{title:e("app.unexpectedError"),reloadLabel:e("app.reload"),children:n})}export{p as AppErrorBoundary};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n,j as o,d as G,e as z,f as Y,g as Q,b as q,h as H,k as E,l as _,S as P,p as J,m as X,n as Z,o as L,q as O,t as ee,v as te,w as oe,c as se,x as $,y as ne,z as re,A as ie}from"./index-DgwALPNA.js";import{L as ae,F as ce,u as le,D as de,a as ue,c as pe}from"./navViewState-Ck_HK-TK.js";import{u as fe,o as ve}from"./connection-BhO2nh7P.js";import{l as me}from"./spaces-C8n7xQPx.js";import{u as he}from"./index-DbuwcnbT.js";import"./client-C0oH7-8r.js";const xe={offline:{title:"nav.scope.failed.offline.title",body:"nav.scope.failed.offline.body"},"auth-required":{title:"nav.scope.failed.auth-required.title",body:"nav.scope.failed.auth-required.body"},"scope-invalid":{title:"nav.scope.failed.scope-invalid.title",body:"nav.scope.failed.scope-invalid.body"},"identity-mismatch":{title:"nav.scope.failed.identity-mismatch.title",body:"nav.scope.failed.identity-mismatch.body"},"target-missing":{title:"nav.scope.failed.target-missing.title",body:"nav.scope.failed.target-missing.body"}},be="rounded-lg border border-transparent bg-accent px-4 py-2 text-[13px] font-semibold text-on-accent transition-colors hover:bg-accent-deep focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-selected-ink disabled:cursor-not-allowed disabled:bg-hairline disabled:text-ink-faint pointer-coarse:min-h-11",W="rounded-lg border border-hairline-strong bg-paper px-4 py-2 text-[13px] font-medium text-ink transition-colors hover:border-accent focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-selected-ink pointer-coarse:min-h-11",ge="min-w-0 flex-1 rounded-lg border border-hairline bg-paper px-3 py-2 font-mono text-[13px] text-ink outline-none transition-colors placeholder:text-ink-faint focus:border-accent";function ye(a,i){return`${a.scope.homeId}\0${a.scope.scopeId}\0${a.route}\0${i??""}`}function ke({state:a,retry:i,cancel:h}){const{t:r}=he(),[u,N]=n.useState(""),[c,y]=n.useState(!1),b=n.useId(),w=n.useId(),p=n.useRef(null),R=n.useRef(null),g=a.phase==="idle"?"":ye(a.target,a.phase==="failed"?a.reason:void 0),x=a.phase==="failed"&&a.reason==="auth-required";n.useEffect(()=>{N(""),y(!1)},[g]),n.useEffect(()=>{if(a.phase!=="failed")return;(x?p.current:R.current)?.focus({preventScroll:!0})},[a.phase,x,g]);const j=n.useCallback(()=>{N(""),y(!1),h()},[h]),S=n.useCallback(()=>{if(a.phase!=="failed")return;const v=u.trim();x&&v===""||(N(""),y(!1),i(x?v:void 0))},[x,i,a.phase,u]);if(a.phase==="idle")return null;if(a.phase!=="failed"){const v=a.phase;return o.jsxs(F,{children:[o.jsx("h1",{className:"font-display text-[18px] leading-6 text-ink",children:r(v==="restoring"?"nav.scope.restoring.title":"nav.scope.verifying.title")}),o.jsxs("p",{className:"mt-2 flex items-start gap-2 text-[13px] leading-relaxed text-ink-soft",children:[o.jsx(ae,{markId:"nav-scope-recovery",life:"working",className:"mt-[7px] h-[7px] w-[7px]"}),o.jsx("span",{className:"min-w-0",children:r(v==="restoring"?"nav.scope.restoring.body":"nav.scope.verifying.body")})]}),o.jsx("div",{className:"mt-6",children:o.jsx("button",{type:"button",className:W,onClick:j,children:r("nav.scope.stay")})})]})}const A=xe[a.reason];return o.jsxs(F,{children:[o.jsx("h1",{className:"font-display text-[18px] leading-6 text-ink",children:r(A.title)}),o.jsx("div",{className:"mt-2",children:o.jsx(ce,{feedback:{tone:"error",text:r(A.body)}})}),x?o.jsxs("div",{className:"mt-5",children:[o.jsxs("div",{className:"mb-1 flex items-baseline justify-between gap-2",children:[o.jsx("label",{htmlFor:b,className:"text-[12px] font-medium text-ink-soft",children:r("connect.accessToken")}),o.jsx("span",{title:r("connect.accessTokenHelp"),className:"cursor-help text-[12px] text-ink-faint underline decoration-dotted underline-offset-2",children:r("connect.accessTokenWhere")})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{id:b,ref:p,type:c?"text":"password",value:u,"aria-describedby":w,autoComplete:"off",spellCheck:!1,className:ge,onChange:v=>{N(v.target.value)}}),o.jsx("button",{type:"button","aria-label":`${r(c?"st.providers.hideKey":"st.providers.showKey")} ${r("connect.accessToken")}`,onClick:()=>{y(v=>!v)},className:"rounded-lg border border-hairline px-3 text-[12px] text-ink-soft transition-colors hover:border-accent hover:text-ink pointer-coarse:min-h-11",children:r(c?"st.providers.hideKey":"st.providers.showKey")})]}),o.jsx("p",{id:w,className:"sr-only",children:r("connect.accessTokenHelp")})]}):null,o.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-2",children:[o.jsx("button",{ref:R,type:"button",className:be,disabled:x&&u.trim()==="",onClick:S,children:r("nav.scope.retry")}),o.jsx("button",{type:"button",className:W,onClick:j,children:r("nav.scope.stay")})]})]})}function F({children:a}){return o.jsx("main",{className:"flex h-full min-h-screen items-center justify-center bg-paper px-4 py-10 text-ink",children:o.jsx("div",{className:"anim-enter w-full max-w-[380px]",children:a})})}const U=n.createContext(null);function Ce(){return n.useContext(U)}function Ee({children:a}){const i=fe(),h=G(),r=z(),u=Y(),N=Q(),c=n.useMemo(()=>({homeId:typeof i.spaceKey=="string"&&i.spaceKey!==""?i.spaceKey:q()?.homeId??"main",scopeId:i.scopeId,serverHomeId:i.meta.server_home_id,connectionRef:i.connectionRef}),[i.spaceKey,i.scopeId,i.meta.server_home_id,i.connectionRef]),[y,b]=n.useState({phase:"idle"}),w=n.useRef(void 0),p=n.useRef(null),R=n.useRef(null),g=n.useRef(null),x=n.useRef(null),j=H(r,c),S=!E(c,j.scope)&&(j.scope.serverHomeId===void 0||j.scope.serverHomeId===c.serverHomeId),A=n.useCallback((e,t)=>{const s=R.current;s!==null?(R.current=null,s.redirect!==void 0?typeof s.redirect.target=="number"?s.redirect.target!==0&&u(s.redirect.target):u(s.redirect.target,s.redirect.options):u(s.target.route,{...t,state:{kikiNav:{visitId:s.visitId,scope:s.target.scope}}})):typeof e=="number"?u(e):u(e,t)},[u]),v=()=>{const e=$();e!==null&&pe(e.visitId)},C=n.useCallback(async(e,t,s)=>{v();const d=$(),k=()=>{if(t.throwIfAborted(),d!==null&&O(d.visitId,d)!==0)throw new DOMException("Navigation changed","AbortError")};let I=e,l=s===void 0?null:_(s),M=!1,V=w.current;for(w.current=void 0;;){k();let T;try{if(l?.missing===!0)throw new P("target-missing");T=await J(I,i.scopeAdapter,t,b,V)}catch(m){if(k(),!(m instanceof P)||m.reason!=="target-missing")throw m;if(l!==null&&X(l.visitId),l=l===null?d:Z(l.visitId),l===null)return p.current={scope:c,route:"/new"},b({phase:"idle"}),{target:"/new",options:{replace:!0,state:{kikiNav:{visitId:d?.visitId??L(),scope:c}}}};I={scope:l.scope,route:`${l.pathname}${l.search}${l.hash}`},M=!0,V=void 0;continue}try{if(k(),p.current={...I,scope:T.scope},await T.commit(),k(),M&&l!==null&&d!==null){const m=O(l.visitId,d);if(m===null)throw new DOMException("Navigation changed","AbortError");return b({phase:"idle"}),{target:m}}return}catch(m){throw p.current=null,await T.dispose(),!t.aborted&&!(m instanceof DOMException&&m.name==="AbortError")&&b({phase:"failed",target:I,reason:m instanceof P?m.reason:"offline"}),m}}},[i.scopeAdapter,c]),f=le(r,A,{needsPreparation:e=>{const t=H(e,c),s=E(c,t.scope)||t.scope.serverHomeId!==void 0&&t.scope.serverHomeId!==c.serverHomeId,d=_(e),k=d!==null&&d.visitId!==$()?.visitId&&ne(t.route);return(s||k)&&!(p.current?.route===t.route&&!E(p.current.scope,t.scope))},prepare:async(e,t)=>(g.current=()=>{Promise.resolve(f.confirm()).catch(()=>{})},C(H(e,c),t,e))});n.useLayoutEffect(()=>{if(!i.needsScopeReload||p.current===null||p.current.route!==`${r.pathname}${r.search}${r.hash}`)return;const e=p.current,t=H(r,c).scope,s=e.scope.scopeId.startsWith("remote:")||c.scopeId.startsWith("remote:");if(!s&&(E(t,e.scope)||t.serverHomeId!==void 0&&t.serverHomeId!==e.scope.serverHomeId))return;const d=e.scope.scopeId.startsWith("remote:")?{...e.scope,homeId:e.scope.scopeId}:e.scope;ee({location:r,scope:d,action:N}),te(d,e.route,r.key),s?window.location.reload():h.switchSpace?h.switchSpace(e.scope.homeId).catch(()=>{b({phase:"failed",target:e,reason:"offline"})}):window.location.reload()},[i.needsScopeReload,r,N,h,c]),n.useEffect(()=>{if(S){if(i.needsScopeReload)return;p.current=null,b({phase:"idle"});return}if(i.needsScopeReload||p.current!==null)return;const e=new AbortController;x.current=e;const t=()=>{C(j,e.signal,r).then(s=>{e.signal.aborted||s===void 0||(typeof s.target=="number"?s.target!==0&&u(s.target):u(s.target,s.options))}).catch(()=>{})};return g.current=t,t(),()=>{e.abort(),x.current=null}},[S,r.key,i.needsScopeReload,C]),n.useEffect(()=>oe(async e=>{const t={homeId:e.homeId??c.homeId,scopeId:e.scopeId??"local"};if(!E(c,t)){e.route!==void 0&&f.navigate(e.route);return}if(h.kind==="tauri"&&t.scopeId.startsWith("remote:")&&h.openRemoteSpace!==void 0&&me(re().windowMode)==="windows"){const I=async(l=new AbortController().signal)=>{await ve(h,t,l)};g.current=()=>{Promise.resolve(f.value.runAction?.(I)).catch(()=>{})},await f.value.runAction?.(I);return}const s={scope:t,route:e.route??ie(t.homeId,t.scopeId)??"/new"};let d=e.token;const k=async I=>{w.current??=d,d=void 0;const l=await C(s,I);R.current={target:p.current??s,visitId:L(),redirect:l??void 0}};g.current=()=>{Promise.resolve(f.value.runAction?.(k,s.route)).catch(()=>{})},await f.value.runAction?.(k,s.route)}),[c,f.value.runAction,f.navigate,C]),n.useEffect(()=>h.onNotificationClick?.((e,t)=>{t!==void 0&&se({homeId:t,scopeId:"local",route:e}).catch(()=>{})}),[h]);const D=n.useCallback(()=>{x.current?.abort(),f.cancel(),p.current=null,R.current=null,w.current=void 0,g.current=null,b({phase:"idle"}),!S&&!i.needsScopeReload&&u("/new",{replace:!0,state:{kikiNav:{scope:c}}})},[f.cancel,S,i.needsScopeReload,c,u]),K=n.useCallback(e=>{w.current=e,g.current!==null?g.current():Promise.resolve(f.confirm()).catch(()=>{})},[f.confirm]),B={state:y,retry:K,cancel:D};return o.jsx(U.Provider,{value:B,children:o.jsx(de.Provider,{value:f,children:o.jsx(ue.Provider,{value:f.value,children:o.jsxs("div",{className:"relative h-full",children:[o.jsx("div",{className:"h-full",inert:y.phase!=="idle",children:S?a:null}),y.phase!=="idle"?o.jsx("div",{className:"absolute inset-0 z-50 bg-canvas",children:o.jsx(ke,{state:y,retry:K,cancel:D})}):null]})})})})}export{Ee as NavScopeBoundary,Ce as useScopeRestore};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{M as ln,N as an,O as Y,P as O,Q,R as un,S as y,T as tn,V as j,W as _,X as rn,Y as o,Z as on,$ as sn,a0 as fn}from"./index-
|
|
1
|
+
import{M as ln,N as an,O as Y,P as O,Q,R as un,S as y,T as tn,V as j,W as _,X as rn,Y as o,Z as on,$ as sn,a0 as fn}from"./index-DuudNhLL.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,D,S,v,R,V,a){var E=D-l,i=S-h,n=V-v,d=a-R,u=d*E-n*i;if(!(u*u<y))return u=(n*(h-R)-d*(l-v))/u,[l+u*E,h+u*i]}function H(l,h,D,S,v,R,V){var a=l-D,E=h-S,i=(V?R:-R)/j(a*a+E*E),n=i*E,d=-i*a,u=l+n,s=h+d,f=D+n,c=S+d,W=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,A=m*m+g*g,T=v-R,P=u*c-f*s,I=(g<0?-1:1)*j(on(0,T*T*A-P*P)),M=(P*g-m*I)/A,N=(-P*m-g*I)/A,w=(P*g+m*I)/A,p=(-P*m+g*I)/A,x=M-W,e=N-t,r=w-W,X=p-t;return x*x+e*e>r*r+X*X&&(M=w,N=p),{cx:M,cy:N,x01:-n,y01:-d,x11:M*(v/T-1),y11:N*(v/T-1)}}function hn(){var l=cn,h=yn,D=Q(0),S=null,v=gn,R=dn,V=mn,a=null,E=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=R.apply(this,arguments)-un,W=rn(c-f),t=c>f;if(a||(a=n=E()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(W>tn-y)a.moveTo(s*Y(f),s*O(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*Y(c),u*O(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,A=f,T=c,P=W,I=W,M=V.apply(this,arguments)/2,N=M>y&&(S?+S.apply(this,arguments):j(u*u+s*s)),w=_(rn(s-u)/2,+D.apply(this,arguments)),p=w,x=w,e,r;if(N>y){var X=sn(N/u*O(M)),z=sn(N/s*O(M));(P-=X*2)>y?(X*=t?1:-1,A+=X,T-=X):(P=0,A=T=(f+c)/2),(I-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(I=0,m=g=(f+c)/2)}var Z=s*Y(m),$=s*O(m),B=u*Y(T),C=u*O(T);if(w>y){var F=s*Y(g),G=s*O(g),J=u*Y(A),K=u*O(A),q;if(W<an)if(q=pn(Z,$,J,K,F,G,B,C)){var L=Z-q[0],U=$-q[1],k=F-q[0],b=G-q[1],nn=1/O(fn((L*k+U*b)/(j(L*L+U*U)*j(k*k+b*b)))/2),en=j(q[0]*q[0]+q[1]*q[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}I>y?x>y?(e=H(J,K,Z,$,s,x,t),r=H(F,G,B,C,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(Z,$),a.arc(0,0,s,m,g,!t)):a.moveTo(Z,$),!(u>y)||!(P>y)?a.lineTo(B,C):p>y?(e=H(B,C,F,G,u,-p,t),r=H(Z,$,J,K,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,A,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +R.apply(this,arguments))/2-an/2;return[Y(d)*n,O(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:Q(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:Q(+n),i):h},i.cornerRadius=function(n){return arguments.length?(D=typeof n=="function"?n:Q(+n),i):D},i.padRadius=function(n){return arguments.length?(S=n==null?null:typeof n=="function"?n:Q(+n),i):S},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:Q(+n),i):v},i.endAngle=function(n){return arguments.length?(R=typeof n=="function"?n:Q(+n),i):R},i.padAngle=function(n){return arguments.length?(V=typeof n=="function"?n:Q(+n),i):V},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|