tycono 0.1.76 → 0.1.78
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/package.json +1 -1
- package/src/api/src/create-app.ts +3 -0
- package/src/api/src/routes/save.ts +5 -0
- package/src/web/dist/assets/{index-BcaNcOCL.js → index-DSlyI2R-.js} +1 -1
- package/src/web/dist/assets/{preview-app-cOnPQipW.js → preview-app-PJU9PUoY.js} +1 -1
- package/src/web/dist/index.html +1 -1
package/package.json
CHANGED
|
@@ -25,6 +25,9 @@ export function createApp() {
|
|
|
25
25
|
app.use(cors({ origin: corsOrigin }));
|
|
26
26
|
app.use(express.json());
|
|
27
27
|
|
|
28
|
+
// Suppress favicon 404
|
|
29
|
+
app.get('/favicon.ico', (_req, res) => res.status(204).end());
|
|
30
|
+
|
|
28
31
|
// Setup / onboarding (always available)
|
|
29
32
|
app.use('/api/setup', setupRouter);
|
|
30
33
|
|
|
@@ -16,6 +16,11 @@ saveRouter.get('/status', (req: Request, res: Response, next: NextFunction) => {
|
|
|
16
16
|
try {
|
|
17
17
|
res.json(getGitStatus(COMPANY_ROOT, getRepo(req)));
|
|
18
18
|
} catch (err) {
|
|
19
|
+
// codeRoot not configured is expected for fresh installs — return empty status
|
|
20
|
+
if (err instanceof Error && err.message.includes('codeRoot not configured')) {
|
|
21
|
+
res.json({ isRepo: false, branch: '', staged: [], unstaged: [], untracked: [], notConfigured: true });
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
19
24
|
next(err);
|
|
20
25
|
}
|
|
21
26
|
});
|
|
@@ -107,4 +107,4 @@ ${Q}`;La(re.id,he,"do")}catch(re){xt(`Failed to delegate: ${re instanceof Error?
|
|
|
107
107
|
|
|
108
108
|
Skip this if you don't have a codebase yet — you can connect one later from Settings.`,tag:"optional",open:L,onToggle:()=>Y(!L),children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{className:`${nt} flex-1`,placeholder:"/path/to/code/repo",value:se,onChange:we=>ee(we.target.value)}),l.jsx("button",{onClick:()=>oe(!W),className:"px-3 py-2 rounded text-xs font-medium transition-colors shrink-0 cursor-pointer hover:brightness-125",style:{background:"var(--terminal-surface)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)"},title:"Browse folders",children:"📁"})]}),W&&l.jsx(Au,{onSelect:we=>{ee(we),oe(!1)},onClose:()=>oe(!1)})]}),l.jsxs(Sy,{icon:"📚",title:"Knowledge Import",hint:"Import existing documents into knowledge base.",help:`Point to folders with docs (.md, .txt, etc.) — AI will read, summarize, and organize them into a searchable knowledge base.
|
|
109
109
|
|
|
110
|
-
Skip this to start with an empty knowledge base. You can import documents anytime from the office.`,tag:"optional",open:de,onToggle:()=>V(!de),children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{className:`${nt} flex-1`,placeholder:"/path/to/docs",value:U,onChange:we=>T(we.target.value),onKeyDown:we=>{we.key==="Enter"&&(we.preventDefault(),Bt())}}),l.jsx("button",{onClick:()=>ge(!ie),className:"px-3 py-2 rounded text-xs font-medium transition-colors shrink-0 cursor-pointer hover:brightness-125",style:{background:"var(--terminal-surface)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)"},title:"Browse folders",children:"📁"}),l.jsx("button",{onClick:Bt,disabled:!U.trim(),className:"px-3 py-2 rounded text-xs font-medium shrink-0",style:{background:"var(--accent)",color:"#fff",opacity:U.trim()?1:.5},children:"Add"})]}),ie&&l.jsx(Au,{onSelect:we=>{D.includes(we)||B([...D,we]),ge(!1)},onClose:()=>ge(!1)}),D.length>0&&l.jsx("div",{className:"space-y-1 mt-2",children:D.map((we,kt)=>l.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded text-xs",style:{background:"var(--terminal-bg)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)"},children:[l.jsx("span",{className:"flex-1 truncate",style:{fontFamily:"var(--pixel-font)"},children:we}),l.jsx("button",{onClick:()=>B(D.filter((ln,sn)=>sn!==kt)),className:"opacity-50 hover:opacity-100",children:"✕"})]},kt))})]})]}):l.jsx("div",{className:"space-y-3",children:l.jsxs(jy,{icon:"🔗",title:"AKB Path",hint:"Directory with existing CLAUDE.md and AKB structure.",help:"Connect to a directory that was previously set up with Tycono. It must contain a CLAUDE.md file. All existing roles, knowledge, and settings will be loaded.",children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{className:`${nt} flex-1`,placeholder:"/path/to/your/akb",value:pe,onChange:we=>{ze(we.target.value),He(null)},autoFocus:!0}),l.jsx("button",{onClick:()=>Ee(!et),className:"px-3 py-2 rounded text-xs font-medium transition-colors shrink-0 cursor-pointer hover:brightness-125",style:{background:"var(--terminal-surface)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)"},title:"Browse folders",children:"📁"}),l.jsx("button",{onClick:_t,disabled:st||!pe.trim(),className:"px-3 py-2 rounded text-xs font-medium transition-colors shrink-0",style:{background:"var(--accent)",color:"#fff",opacity:st||!pe.trim()?.5:1},children:st?"...":"Verify"})]}),Ie===!0&&l.jsxs("div",{className:"text-xs mt-2",style:{color:"var(--active-green)"},children:["✅"," Valid AKB found"]}),Ie===!1&&l.jsxs("div",{className:"text-xs mt-2",style:{color:"#EF4444"},children:["❌"," No valid AKB (CLAUDE.md required)"]}),et&&l.jsx(Au,{onSelect:we=>{ze(we),He(null),Ee(!1)},onClose:()=>Ee(!1)})]})})]}),rt==="team"&&l.jsxs("div",{className:"space-y-4",children:[l.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--terminal-text)"},children:"Team Template"}),l.jsx("p",{className:"text-xs",style:{color:"var(--terminal-text-secondary)"},children:"Choose a starting team. You can add or remove roles later."}),De.map(we=>l.jsxs("div",{className:Qt(ut===we.id),onClick:()=>pt(we.id),children:[l.jsx("div",{className:"font-medium text-sm capitalize",children:we.id}),l.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:we.roles.map(kt=>l.jsx("span",{className:"px-2 py-0.5 rounded text-[10px]",style:{background:"var(--terminal-bg)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)"},children:kt.name},kt.id))})]},we.id)),l.jsxs("div",{className:Qt(ut==="custom"),onClick:()=>pt("custom"),children:[l.jsx("div",{className:"font-medium text-sm",children:"Custom"}),l.jsx("div",{className:"text-xs opacity-70 mt-1",children:"Start with no pre-built roles. Hire them from the office."})]})]}),rt==="create"&&l.jsxs("div",{className:"space-y-4",children:[l.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--terminal-text)"},children:Ft?N==="existing-akb"?"AKB Connected!":"Company Created!":"Review & Create"}),!Ft&&!jt&&!te&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"rounded-lg p-4 space-y-2 text-xs",style:{background:"var(--terminal-bg)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)",fontFamily:"var(--pixel-font)"},children:N==="existing-akb"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Mode:"})," Connect Existing AKB"]}),l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Path:"})," ",pe]}),l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Engine:"})," ",u==="claude-cli"?"Claude Code CLI":"Direct API"]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Company:"})," ",g]}),l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Location:"})," ",z||"(default)"]}),l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Engine:"})," ",u==="claude-cli"?"Claude Code CLI":"Direct API"]}),se.trim()&&l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Code Repo:"})," ",se]}),l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Knowledge:"})," ",D.length>0?`Import ${D.length} source(s)`:"Fresh (empty)"]}),l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Team:"})," ",ut]}),D.length>0&&l.jsx("div",{className:"text-[10px] mt-1",style:{color:"var(--idle-amber)"},children:"Knowledge import will run in the background after entering the office."})]})}),$n&&l.jsx("div",{className:"text-xs p-3 rounded",style:{background:"rgba(220,38,38,0.15)",color:"#f87171"},children:$n})]}),(jt||te)&&l.jsxs("div",{className:"flex flex-col items-center py-8 gap-3",children:[l.jsx("div",{className:"w-8 h-8 border-2 rounded-full animate-spin",style:{borderColor:"var(--terminal-border)",borderTopColor:"var(--accent)"}}),l.jsx("div",{className:"text-sm",style:{color:"var(--terminal-text-secondary)"},children:te?"Connecting to AKB...":"Scaffolding your company..."})]}),Ft&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"text-center py-4 text-4xl",children:"🏢"}),K&&l.jsxs("div",{className:"rounded-lg p-3 text-xs",style:{background:"var(--terminal-bg)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)",fontFamily:"var(--pixel-font)"},children:[l.jsx("span",{className:"opacity-50",children:"Location:"})," ",K]}),l.jsx("div",{className:"rounded-lg p-4 text-xs max-h-40 overflow-y-auto",style:{background:"var(--terminal-bg)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)",fontFamily:"var(--pixel-font)"},children:Se.map((we,kt)=>l.jsxs("div",{className:"py-0.5",children:[l.jsx("span",{style:{color:"var(--active-green)"},children:"✓"})," ",we]},kt))}),(ve||Be.length>0)&&l.jsxs("div",{className:"rounded-lg p-4 text-xs space-y-1",style:{background:"var(--terminal-bg)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)",fontFamily:"var(--pixel-font)"},children:[l.jsx("div",{className:"font-medium mb-2",style:{color:"var(--terminal-text-secondary)"},children:ve?"Installing skill tools...":"Skill tools"}),Be.map((we,kt)=>l.jsxs("div",{className:"py-0.5 flex items-center gap-2",children:[l.jsx("span",{style:{color:we.event==="installed"||we.event==="skipped"?"var(--active-green)":we.event==="error"?"#f87171":"var(--terminal-text-muted)"},children:we.event==="installed"||we.event==="skipped"?"✓":we.event==="error"?"✗":"…"}),l.jsx("span",{children:we.tool}),l.jsx("span",{style:{color:"var(--terminal-text-muted)"},children:we.detail})]},kt)),ve&&l.jsxs("div",{className:"flex items-center gap-2 mt-1",style:{color:"var(--terminal-text-muted)"},children:[l.jsx("div",{className:"w-3 h-3 border border-current rounded-full animate-spin",style:{borderTopColor:"var(--accent)"}}),l.jsx("span",{children:"Please wait..."})]})]}),D.length>0&&l.jsx("div",{className:"text-xs p-3 rounded",style:{background:"var(--accent)",color:"#fff",opacity:.9},children:"Knowledge import will start in the background after entering the office."})]})]})]}),l.jsxs("div",{className:"px-6 py-4 flex justify-between items-center",style:{borderTop:"1px solid var(--terminal-border)"},children:[l.jsx("div",{children:n>0&&!Ft&&l.jsx("button",{onClick:Re,className:"px-4 py-2 rounded text-sm transition-colors",style:{color:"var(--terminal-text-secondary)",border:"1px solid var(--terminal-border)"},children:"Back"})}),l.jsxs("div",{className:"text-xs",style:{color:"var(--terminal-text-muted)"},children:[n+1," / ",qe.length]}),l.jsx("div",{children:Ft?l.jsx("button",{onClick:Z,disabled:ve,className:"px-5 py-2 rounded text-sm font-medium transition-colors",style:{background:"var(--active-green)",color:"#fff",opacity:ve?.5:1},children:ve?"Setting up tools...":"Enter Office"}):l.jsx("button",{onClick:bt,disabled:!Ve()||jt||te,className:"px-5 py-2 rounded text-sm font-medium transition-colors",style:{background:Ve()?"var(--accent)":"var(--terminal-border)",color:"#fff",opacity:Ve()&&!jt&&!te?1:.5},children:rt==="create"?jt||te?te?"Connecting...":"Creating...":N==="existing-akb"?"Connect AKB":"Create Company":"Next"})})]})]})})}function tp({text:e}){const[n,a]=v.useState(!1),[i,o]=v.useState({top:0,left:0}),u=v.useRef(null),d=()=>{if(u.current){const f=u.current.getBoundingClientRect();o({top:f.bottom+6,left:f.left})}a(!0)};return l.jsxs("span",{className:"inline-flex",ref:u,children:[l.jsx("span",{className:"w-4 h-4 rounded-full text-[9px] font-bold flex items-center justify-center cursor-help shrink-0 select-none",style:{background:"var(--terminal-surface)",color:"var(--terminal-text-muted)",border:"1px solid var(--terminal-border)"},onMouseEnter:d,onMouseLeave:()=>a(!1),onClick:f=>{f.stopPropagation(),n?a(!1):d()},children:"?"}),n&&l.jsxs("div",{className:"fixed z-[9999] px-3 py-2 rounded-lg text-[11px] leading-relaxed whitespace-pre-line w-60 shadow-lg pointer-events-none",style:{top:i.top,left:Math.min(i.left,window.innerWidth-260),background:"var(--terminal-bg)",color:"var(--terminal-text-secondary)",border:"1px solid var(--terminal-border)"},children:[l.jsx("div",{className:"absolute bottom-full w-0 h-0",style:{left:8,borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderBottom:"5px solid var(--terminal-border)"}}),e]})]})}function jy({icon:e,title:n,hint:a,help:i,children:o}){return l.jsxs("div",{className:"rounded-lg p-3 space-y-2",style:{background:"var(--hud-bg-alt)",border:"1px solid var(--terminal-border)"},children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm",children:e}),l.jsx("span",{className:"text-xs font-medium",style:{color:"var(--terminal-text)"},children:n}),i&&l.jsx(tp,{text:i})]}),l.jsx("div",{className:"text-[10px] mt-0.5 ml-6",style:{color:"var(--terminal-text-muted)"},children:a})]}),o]})}function Sy({icon:e,title:n,hint:a,help:i,tag:o,open:u,onToggle:d,children:f}){return l.jsxs("div",{className:"rounded-lg",style:{background:"var(--hud-bg-alt)",border:"1px solid var(--terminal-border)"},children:[l.jsxs("div",{className:"p-3 cursor-pointer flex items-center gap-2 hover:bg-[var(--terminal-surface-light)] transition-colors",onClick:d,children:[l.jsx("span",{className:"text-sm",children:e}),l.jsx("span",{className:"text-xs font-medium flex-1",style:{color:"var(--terminal-text)"},children:n}),i&&l.jsx(tp,{text:i}),o&&l.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded",style:{background:"var(--terminal-surface)",color:"var(--terminal-text-muted)"},children:o}),l.jsx("span",{className:"text-[10px]",style:{color:"var(--terminal-text-muted)"},children:u?"▲":"▼"})]}),!u&&l.jsx("div",{className:"px-3 pb-2 -mt-1",children:l.jsx("div",{className:"text-[10px] ml-6",style:{color:"var(--terminal-text-muted)"},children:a})}),u&&l.jsx("div",{className:"px-3 pb-3 space-y-2",children:f})]})}function A8(){const[e,n]=v.useState(null),[a,i]=v.useState(!0),[o,u]=v.useState(null),d=v.useCallback(async()=>{i(!0),u(null);try{const f=await ye.getStatus();n(f)}catch(f){u(f instanceof Error?f.message:"Failed to fetch status")}finally{i(!1)}},[]);return v.useEffect(()=>{d()},[d]),{initialized:(e==null?void 0:e.initialized)??!1,companyName:(e==null?void 0:e.companyName)??null,engine:(e==null?void 0:e.engine)??"none",companyRoot:(e==null?void 0:e.companyRoot)??"",loading:a,error:o,refetch:d}}const D8=v.lazy(()=>Ey(()=>import("./preview-app-cOnPQipW.js"),[]));function Fv(){return l.jsx("div",{className:"h-full flex items-center justify-center",style:{background:"var(--floor-dark)"},children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"w-10 h-10 mx-auto border-2 rounded-full animate-spin",style:{borderColor:"var(--terminal-border)",borderTopColor:"var(--accent)"}}),l.jsx("div",{className:"mt-4 text-sm",style:{color:"var(--terminal-text-secondary)",fontFamily:"var(--pixel-font)"},children:"Loading..."})]})})}function T8(){var e;try{const n=localStorage.getItem("tycono-theme"),a=n&&n in ll?n:"default",i=(e=ll[a])==null?void 0:e.vars;if(!i)return;const o=document.documentElement;for(const[u,d]of Object.entries(i))o.style.setProperty(u,d)}catch{}}function F8(){const{initialized:e,loading:n,refetch:a}=A8(),[i,o]=v.useState(null);v.useEffect(()=>{T8()},[]);const u=d=>{d&&o(d),a()};return n?l.jsx(Fv,{}):e?l.jsx(C8,{importJob:i,onImportDone:()=>o(null)}):l.jsx(N8,{onComplete:u})}function M8(){const e=new URLSearchParams(window.location.search).has("sprite-preview");return l.jsx(kw,{children:e?l.jsx(v.Suspense,{fallback:l.jsx(Fv,{}),children:l.jsx(D8,{})}):l.jsx(F8,{})})}bw.createRoot(document.getElementById("root")).render(l.jsx(v.StrictMode,{children:l.jsx(M8,{})}));export{ov as H,uv as P,dv as S,B8 as a,cv as b,sv as c,am as d,eC as e,z8 as f,_8 as g,O8 as h,l as j,v as r};
|
|
110
|
+
Skip this to start with an empty knowledge base. You can import documents anytime from the office.`,tag:"optional",open:de,onToggle:()=>V(!de),children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{className:`${nt} flex-1`,placeholder:"/path/to/docs",value:U,onChange:we=>T(we.target.value),onKeyDown:we=>{we.key==="Enter"&&(we.preventDefault(),Bt())}}),l.jsx("button",{onClick:()=>ge(!ie),className:"px-3 py-2 rounded text-xs font-medium transition-colors shrink-0 cursor-pointer hover:brightness-125",style:{background:"var(--terminal-surface)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)"},title:"Browse folders",children:"📁"}),l.jsx("button",{onClick:Bt,disabled:!U.trim(),className:"px-3 py-2 rounded text-xs font-medium shrink-0",style:{background:"var(--accent)",color:"#fff",opacity:U.trim()?1:.5},children:"Add"})]}),ie&&l.jsx(Au,{onSelect:we=>{D.includes(we)||B([...D,we]),ge(!1)},onClose:()=>ge(!1)}),D.length>0&&l.jsx("div",{className:"space-y-1 mt-2",children:D.map((we,kt)=>l.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded text-xs",style:{background:"var(--terminal-bg)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)"},children:[l.jsx("span",{className:"flex-1 truncate",style:{fontFamily:"var(--pixel-font)"},children:we}),l.jsx("button",{onClick:()=>B(D.filter((ln,sn)=>sn!==kt)),className:"opacity-50 hover:opacity-100",children:"✕"})]},kt))})]})]}):l.jsx("div",{className:"space-y-3",children:l.jsxs(jy,{icon:"🔗",title:"AKB Path",hint:"Directory with existing CLAUDE.md and AKB structure.",help:"Connect to a directory that was previously set up with Tycono. It must contain a CLAUDE.md file. All existing roles, knowledge, and settings will be loaded.",children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{className:`${nt} flex-1`,placeholder:"/path/to/your/akb",value:pe,onChange:we=>{ze(we.target.value),He(null)},autoFocus:!0}),l.jsx("button",{onClick:()=>Ee(!et),className:"px-3 py-2 rounded text-xs font-medium transition-colors shrink-0 cursor-pointer hover:brightness-125",style:{background:"var(--terminal-surface)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)"},title:"Browse folders",children:"📁"}),l.jsx("button",{onClick:_t,disabled:st||!pe.trim(),className:"px-3 py-2 rounded text-xs font-medium transition-colors shrink-0",style:{background:"var(--accent)",color:"#fff",opacity:st||!pe.trim()?.5:1},children:st?"...":"Verify"})]}),Ie===!0&&l.jsxs("div",{className:"text-xs mt-2",style:{color:"var(--active-green)"},children:["✅"," Valid AKB found"]}),Ie===!1&&l.jsxs("div",{className:"text-xs mt-2",style:{color:"#EF4444"},children:["❌"," No valid AKB (CLAUDE.md required)"]}),et&&l.jsx(Au,{onSelect:we=>{ze(we),He(null),Ee(!1)},onClose:()=>Ee(!1)})]})})]}),rt==="team"&&l.jsxs("div",{className:"space-y-4",children:[l.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--terminal-text)"},children:"Team Template"}),l.jsx("p",{className:"text-xs",style:{color:"var(--terminal-text-secondary)"},children:"Choose a starting team. You can add or remove roles later."}),De.map(we=>l.jsxs("div",{className:Qt(ut===we.id),onClick:()=>pt(we.id),children:[l.jsx("div",{className:"font-medium text-sm capitalize",children:we.id}),l.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:we.roles.map(kt=>l.jsx("span",{className:"px-2 py-0.5 rounded text-[10px]",style:{background:"var(--terminal-bg)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)"},children:kt.id.toUpperCase()},kt.id))})]},we.id)),l.jsxs("div",{className:Qt(ut==="custom"),onClick:()=>pt("custom"),children:[l.jsx("div",{className:"font-medium text-sm",children:"Custom"}),l.jsx("div",{className:"text-xs opacity-70 mt-1",children:"Start with no pre-built roles. Hire them from the office."})]})]}),rt==="create"&&l.jsxs("div",{className:"space-y-4",children:[l.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--terminal-text)"},children:Ft?N==="existing-akb"?"AKB Connected!":"Company Created!":"Review & Create"}),!Ft&&!jt&&!te&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"rounded-lg p-4 space-y-2 text-xs",style:{background:"var(--terminal-bg)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)",fontFamily:"var(--pixel-font)"},children:N==="existing-akb"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Mode:"})," Connect Existing AKB"]}),l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Path:"})," ",pe]}),l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Engine:"})," ",u==="claude-cli"?"Claude Code CLI":"Direct API"]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Company:"})," ",g]}),l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Location:"})," ",z||"(default)"]}),l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Engine:"})," ",u==="claude-cli"?"Claude Code CLI":"Direct API"]}),se.trim()&&l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Code Repo:"})," ",se]}),l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Knowledge:"})," ",D.length>0?`Import ${D.length} source(s)`:"Fresh (empty)"]}),l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Team:"})," ",ut]}),D.length>0&&l.jsx("div",{className:"text-[10px] mt-1",style:{color:"var(--idle-amber)"},children:"Knowledge import will run in the background after entering the office."})]})}),$n&&l.jsx("div",{className:"text-xs p-3 rounded",style:{background:"rgba(220,38,38,0.15)",color:"#f87171"},children:$n})]}),(jt||te)&&l.jsxs("div",{className:"flex flex-col items-center py-8 gap-3",children:[l.jsx("div",{className:"w-8 h-8 border-2 rounded-full animate-spin",style:{borderColor:"var(--terminal-border)",borderTopColor:"var(--accent)"}}),l.jsx("div",{className:"text-sm",style:{color:"var(--terminal-text-secondary)"},children:te?"Connecting to AKB...":"Scaffolding your company..."})]}),Ft&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"text-center py-4 text-4xl",children:"🏢"}),K&&l.jsxs("div",{className:"rounded-lg p-3 text-xs",style:{background:"var(--terminal-bg)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)",fontFamily:"var(--pixel-font)"},children:[l.jsx("span",{className:"opacity-50",children:"Location:"})," ",K]}),l.jsx("div",{className:"rounded-lg p-4 text-xs max-h-40 overflow-y-auto",style:{background:"var(--terminal-bg)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)",fontFamily:"var(--pixel-font)"},children:Se.map((we,kt)=>l.jsxs("div",{className:"py-0.5",children:[l.jsx("span",{style:{color:"var(--active-green)"},children:"✓"})," ",we]},kt))}),(ve||Be.length>0)&&l.jsxs("div",{className:"rounded-lg p-4 text-xs space-y-1",style:{background:"var(--terminal-bg)",color:"var(--terminal-text)",border:"1px solid var(--terminal-border)",fontFamily:"var(--pixel-font)"},children:[l.jsx("div",{className:"font-medium mb-2",style:{color:"var(--terminal-text-secondary)"},children:ve?"Installing skill tools...":"Skill tools"}),Be.map((we,kt)=>l.jsxs("div",{className:"py-0.5 flex items-center gap-2",children:[l.jsx("span",{style:{color:we.event==="installed"||we.event==="skipped"?"var(--active-green)":we.event==="error"?"#f87171":"var(--terminal-text-muted)"},children:we.event==="installed"||we.event==="skipped"?"✓":we.event==="error"?"✗":"…"}),l.jsx("span",{children:we.tool}),l.jsx("span",{style:{color:"var(--terminal-text-muted)"},children:we.detail})]},kt)),ve&&l.jsxs("div",{className:"flex items-center gap-2 mt-1",style:{color:"var(--terminal-text-muted)"},children:[l.jsx("div",{className:"w-3 h-3 border border-current rounded-full animate-spin",style:{borderTopColor:"var(--accent)"}}),l.jsx("span",{children:"Please wait..."})]})]}),D.length>0&&l.jsx("div",{className:"text-xs p-3 rounded",style:{background:"var(--accent)",color:"#fff",opacity:.9},children:"Knowledge import will start in the background after entering the office."})]})]})]}),l.jsxs("div",{className:"px-6 py-4 flex justify-between items-center",style:{borderTop:"1px solid var(--terminal-border)"},children:[l.jsx("div",{children:n>0&&!Ft&&l.jsx("button",{onClick:Re,className:"px-4 py-2 rounded text-sm transition-colors",style:{color:"var(--terminal-text-secondary)",border:"1px solid var(--terminal-border)"},children:"Back"})}),l.jsxs("div",{className:"text-xs",style:{color:"var(--terminal-text-muted)"},children:[n+1," / ",qe.length]}),l.jsx("div",{children:Ft?l.jsx("button",{onClick:Z,disabled:ve,className:"px-5 py-2 rounded text-sm font-medium transition-colors",style:{background:"var(--active-green)",color:"#fff",opacity:ve?.5:1},children:ve?"Setting up tools...":"Enter Office"}):l.jsx("button",{onClick:bt,disabled:!Ve()||jt||te,className:"px-5 py-2 rounded text-sm font-medium transition-colors",style:{background:Ve()?"var(--accent)":"var(--terminal-border)",color:"#fff",opacity:Ve()&&!jt&&!te?1:.5},children:rt==="create"?jt||te?te?"Connecting...":"Creating...":N==="existing-akb"?"Connect AKB":"Create Company":"Next"})})]})]})})}function tp({text:e}){const[n,a]=v.useState(!1),[i,o]=v.useState({top:0,left:0}),u=v.useRef(null),d=()=>{if(u.current){const f=u.current.getBoundingClientRect();o({top:f.bottom+6,left:f.left})}a(!0)};return l.jsxs("span",{className:"inline-flex",ref:u,children:[l.jsx("span",{className:"w-4 h-4 rounded-full text-[9px] font-bold flex items-center justify-center cursor-help shrink-0 select-none",style:{background:"var(--terminal-surface)",color:"var(--terminal-text-muted)",border:"1px solid var(--terminal-border)"},onMouseEnter:d,onMouseLeave:()=>a(!1),onClick:f=>{f.stopPropagation(),n?a(!1):d()},children:"?"}),n&&l.jsxs("div",{className:"fixed z-[9999] px-3 py-2 rounded-lg text-[11px] leading-relaxed whitespace-pre-line w-60 shadow-lg pointer-events-none",style:{top:i.top,left:Math.min(i.left,window.innerWidth-260),background:"var(--terminal-bg)",color:"var(--terminal-text-secondary)",border:"1px solid var(--terminal-border)"},children:[l.jsx("div",{className:"absolute bottom-full w-0 h-0",style:{left:8,borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderBottom:"5px solid var(--terminal-border)"}}),e]})]})}function jy({icon:e,title:n,hint:a,help:i,children:o}){return l.jsxs("div",{className:"rounded-lg p-3 space-y-2",style:{background:"var(--hud-bg-alt)",border:"1px solid var(--terminal-border)"},children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm",children:e}),l.jsx("span",{className:"text-xs font-medium",style:{color:"var(--terminal-text)"},children:n}),i&&l.jsx(tp,{text:i})]}),l.jsx("div",{className:"text-[10px] mt-0.5 ml-6",style:{color:"var(--terminal-text-muted)"},children:a})]}),o]})}function Sy({icon:e,title:n,hint:a,help:i,tag:o,open:u,onToggle:d,children:f}){return l.jsxs("div",{className:"rounded-lg",style:{background:"var(--hud-bg-alt)",border:"1px solid var(--terminal-border)"},children:[l.jsxs("div",{className:"p-3 cursor-pointer flex items-center gap-2 hover:bg-[var(--terminal-surface-light)] transition-colors",onClick:d,children:[l.jsx("span",{className:"text-sm",children:e}),l.jsx("span",{className:"text-xs font-medium flex-1",style:{color:"var(--terminal-text)"},children:n}),i&&l.jsx(tp,{text:i}),o&&l.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded",style:{background:"var(--terminal-surface)",color:"var(--terminal-text-muted)"},children:o}),l.jsx("span",{className:"text-[10px]",style:{color:"var(--terminal-text-muted)"},children:u?"▲":"▼"})]}),!u&&l.jsx("div",{className:"px-3 pb-2 -mt-1",children:l.jsx("div",{className:"text-[10px] ml-6",style:{color:"var(--terminal-text-muted)"},children:a})}),u&&l.jsx("div",{className:"px-3 pb-3 space-y-2",children:f})]})}function A8(){const[e,n]=v.useState(null),[a,i]=v.useState(!0),[o,u]=v.useState(null),d=v.useCallback(async()=>{i(!0),u(null);try{const f=await ye.getStatus();n(f)}catch(f){u(f instanceof Error?f.message:"Failed to fetch status")}finally{i(!1)}},[]);return v.useEffect(()=>{d()},[d]),{initialized:(e==null?void 0:e.initialized)??!1,companyName:(e==null?void 0:e.companyName)??null,engine:(e==null?void 0:e.engine)??"none",companyRoot:(e==null?void 0:e.companyRoot)??"",loading:a,error:o,refetch:d}}const D8=v.lazy(()=>Ey(()=>import("./preview-app-PJU9PUoY.js"),[]));function Fv(){return l.jsx("div",{className:"h-full flex items-center justify-center",style:{background:"var(--floor-dark)"},children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"w-10 h-10 mx-auto border-2 rounded-full animate-spin",style:{borderColor:"var(--terminal-border)",borderTopColor:"var(--accent)"}}),l.jsx("div",{className:"mt-4 text-sm",style:{color:"var(--terminal-text-secondary)",fontFamily:"var(--pixel-font)"},children:"Loading..."})]})})}function T8(){var e;try{const n=localStorage.getItem("tycono-theme"),a=n&&n in ll?n:"default",i=(e=ll[a])==null?void 0:e.vars;if(!i)return;const o=document.documentElement;for(const[u,d]of Object.entries(i))o.style.setProperty(u,d)}catch{}}function F8(){const{initialized:e,loading:n,refetch:a}=A8(),[i,o]=v.useState(null);v.useEffect(()=>{T8()},[]);const u=d=>{d&&o(d),a()};return n?l.jsx(Fv,{}):e?l.jsx(C8,{importJob:i,onImportDone:()=>o(null)}):l.jsx(N8,{onComplete:u})}function M8(){const e=new URLSearchParams(window.location.search).has("sprite-preview");return l.jsx(kw,{children:e?l.jsx(v.Suspense,{fallback:l.jsx(Fv,{}),children:l.jsx(D8,{})}):l.jsx(F8,{})})}bw.createRoot(document.getElementById("root")).render(l.jsx(v.StrictMode,{children:l.jsx(M8,{})}));export{ov as H,uv as P,dv as S,B8 as a,cv as b,sv as c,am as d,eC as e,z8 as f,_8 as g,O8 as h,l as j,v as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,g as m,a as S,j as t,S as y,P as C,b as j,H as v,c as R,d as k,e as E,f as w,h as B}from"./index-
|
|
1
|
+
import{r as s,g as m,a as S,j as t,S as y,P as C,b as j,H as v,c as R,d as k,e as E,f as w,h as B}from"./index-DSlyI2R-.js";function A({id:i,ap:a,bobY:r,layers:l}){const c=s.useRef(null),o=k(i);return s.useEffect(()=>{if(!o||!c.current)return;const p=c.current.getContext("2d");if(!p)return;const h={...o,layers:o.layers.filter(u=>l.has(u.name))};E(p,h,r,a)},[o,a,r,l]),o?t.jsxs("div",{style:{background:"#161b22",border:"1px solid #21262d",borderRadius:8,padding:16,textAlign:"center",minWidth:140},children:[t.jsx("canvas",{ref:c,width:o.width*2,height:o.height*2,style:{imageRendering:"pixelated",display:"block",margin:"0 auto 8px",width:o.width*6,height:o.height*6,border:"1px solid #30363d",background:"#0d1117"}}),t.jsx("div",{style:{fontSize:11,color:"#8b949e",textTransform:"uppercase",letterSpacing:1},children:i})]}):null}function F({id:i}){const a=s.useRef(null),r=w(i);return s.useEffect(()=>{if(!r||!a.current)return;const l=a.current.getContext("2d");l&&B(l,r)},[r]),r?t.jsxs("div",{style:{background:"#161b22",border:"1px solid #21262d",borderRadius:8,padding:16,textAlign:"center"},children:[t.jsx("canvas",{ref:a,width:r.canvasWidth,height:r.canvasHeight,style:{imageRendering:"pixelated",display:"block",margin:"0 auto 8px",width:r.canvasWidth*2,height:r.canvasHeight*2,border:"1px solid #30363d",background:"#0d1117"}}),t.jsx("div",{style:{fontSize:11,color:"#8b949e",textTransform:"uppercase",letterSpacing:1},children:i})]}):null}const g=["body","hair","face","accessory","item","legs"];function I(){const[i,a]=s.useState({skinColor:"#F5CBA7",hairColor:"#2C1810",shirtColor:"#1565C0",pantsColor:"#37474F",shoeColor:"#212121"}),[r,l]=s.useState(new Set(g)),[c,o]=s.useState(0),p=s.useRef(0);s.useEffect(()=>{const e=()=>{p.current++,o(p.current%60<30?1:0),requestAnimationFrame(e)},n=requestAnimationFrame(e);return()=>cancelAnimationFrame(n)},[]);const h=m(),u=S(),x=s.useCallback(e=>{l(n=>{const d=new Set(n);return d.has(e)?d.delete(e):d.add(e),d})},[]),f=s.useCallback(()=>{const e=n=>n[Math.floor(Math.random()*n.length)];a({skinColor:e(R),hairColor:e(v),shirtColor:e(j),pantsColor:e(C),shoeColor:e(y)})},[]);return t.jsxs("div",{style:{fontFamily:"'SF Mono', monospace",background:"#0d1117",color:"#e6edf3",padding:24,minHeight:"100vh"},children:[t.jsx("h1",{style:{fontSize:18,color:"#58a6ff",marginBottom:4},children:"Sprite Blueprint Preview"}),t.jsx("p",{style:{fontSize:12,color:"#484f58",marginBottom:16},children:"All sprites rendered from declarative Blueprint data"}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:12,padding:12,background:"#161b22",border:"1px solid #21262d",borderRadius:8,marginBottom:12,alignItems:"center"},children:[[["Skin","skinColor"],["Hair","hairColor"],["Shirt","shirtColor"],["Pants","pantsColor"],["Shoes","shoeColor"]].map(([e,n])=>t.jsxs("label",{style:{fontSize:11,color:"#8b949e",display:"flex",alignItems:"center",gap:4},children:[e,t.jsx("input",{type:"color",value:i[n],onChange:d=>a(b=>({...b,[n]:d.target.value})),style:{width:28,height:28,border:"1px solid #30363d",borderRadius:4,background:"none",cursor:"pointer"}})]},n)),t.jsx("button",{onClick:f,style:{background:"#21262d",color:"#e6edf3",border:"1px solid #30363d",borderRadius:4,padding:"4px 12px",fontSize:11,cursor:"pointer"},children:"Random"})]}),t.jsx("div",{style:{display:"flex",gap:8,marginBottom:16,flexWrap:"wrap"},children:g.map(e=>t.jsxs("label",{style:{fontSize:11,color:"#8b949e",display:"flex",alignItems:"center",gap:4,cursor:"pointer"},children:[t.jsx("input",{type:"checkbox",checked:r.has(e),onChange:()=>x(e)}),e]},e))}),t.jsxs("h2",{style:{fontSize:14,color:"#8b949e",margin:"24px 0 12px",borderBottom:"1px solid #21262d",paddingBottom:6},children:["Characters (",h.length,")"]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:h.map(e=>t.jsx(A,{id:e,ap:i,bobY:c,layers:r},e))}),t.jsxs("h2",{style:{fontSize:14,color:"#8b949e",margin:"24px 0 12px",borderBottom:"1px solid #21262d",paddingBottom:6},children:["Facilities (",u.length,")"]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:u.map(e=>t.jsx(F,{id:e},e))})]})}export{I as default};
|
package/src/web/dist/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Tycono</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-DSlyI2R-.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-DueQ7jub.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|