module.exports=[22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},24868,(e,t,r)=>{t.exports=e.x("fs/promises",()=>require("fs/promises"))},47751,e=>{"use strict";var t=e.i(24868),r=e.i(14747);let i=["#A8B4C4","#C4A8B8","#B8C4A8","#A8C4B8","#C4B8A8","#B8A8C4","#C4C4A8","#A8C4C4","#C4A8A8","#A8A8C4"],a=["EXPERTISE","DECISIONS","CONTEXT","PEOPLE","PROJECTS","PREFERENCES","TONE","BOUNDARIES","EMPLOYMENT"];function n(e){let t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),r=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-r);let i=new Date(Date.UTC(t.getUTCFullYear(),0,1)),a=Math.ceil(((t.getTime()-i.getTime())/864e5+1)/7);return`${t.getUTCFullYear()}-W${String(a).padStart(2,"0")}`}async function s(e){let i=r.default.join(process.cwd(),"data","employees",e,"employee.json");try{let e=await t.default.readFile(i,"utf8"),r=JSON.parse(e),a=n(new Date),s=r.weekOf===a?(r.questionsThisWeek??0)+1:1;await t.default.writeFile(i,JSON.stringify({...r,lastActiveAt:new Date().toISOString(),questionsThisWeek:s,weekOf:a},null,2),"utf8")}catch{}}async function l(){let e,s=r.default.join(process.cwd(),"data","employees");try{e=await t.default.readdir(s)}catch{return[]}let l=[];for(let d of e){var o;let e;if(d.startsWith("."))continue;let u=r.default.join(s,d,"employee.json");try{let r=await t.default.readFile(u,"utf8");e=JSON.parse(r)}catch{continue}if(!e?.name)continue;let c=0;for(let e of a)try{(await t.default.readFile(r.default.join(s,d,`${e}.md`),"utf8")).trim().length>16&&c++}catch{}l.push({id:e.id||d,name:e.name,firstName:(o=e.name).trim().split(/\s+/)[0]||o,role:e.role||"—",department:e.department||"General",initials:function(e){let t=e.trim().split(/\s+/).filter(Boolean);return 0===t.length?"??":1===t.length?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}(e.name),avatarColor:function(e){let t=0;for(let r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)|0;return i[Math.abs(t)%i.length]}(e.id||d),integrations:e.integrations??[],twinStatus:c>=6?"ready":c>0?"building":"pending",twinConfidence:c>=6?Math.min(1,c/9):0,profileFilesComplete:c,lastActiveAt:e.lastActiveAt,questionsThisWeek:e.weekOf===n(new Date)?e.questionsThisWeek??0:0,skills:[],orgSkillIds:[],seedModel:"claude-opus-4-7",refreshModel:"claude-sonnet-4-6",ttsVoiceId:"EXAVITQu4vr4xnSDxMaL"})}return l.sort((e,t)=>(t.lastActiveAt??"").localeCompare(e.lastActiveAt??"")),l}e.s(["bumpActivityOnDisk",0,s,"loadEmployeesFromDisk",0,l])},45919,e=>{"use strict";var t=e.i(22734),r=e.i(14747);let i=r.default.join(process.cwd(),"data","org-skills"),a=r.default.join(process.cwd(),"data","org","skill-assignments.json"),n=/^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/;function s(e){let t=e.match(n);if(!t)return{fm:{},body:e};let r={};for(let e of t[1].split("\n")){let t=e.match(/^([a-zA-Z_]+):\s*(.+)$/);if(!t)continue;let i=t[1],a=t[2].trim();if(a.startsWith("[")&&a.endsWith("]")){let e=a.slice(1,-1).trim();r[i]=e?e.split(",").map(e=>e.trim().replace(/^['"]|['"]$/g,"")):[];continue}r[i]=a.replace(/^['"]|['"]$/g,"")}return{fm:r,body:t[2]?.trim()??""}}function l(e){let a=r.default.join(i,c(e),"SKILL.md");try{let r=t.default.readFileSync(a,"utf8"),{fm:i,body:n}=s(r);return{id:p(i.id)||e,label:p(i.label)||e,description:p(i.description),triggers:f(i.triggers),body:n}}catch{return null}}function o(){try{return t.default.readdirSync(i,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>l(e.name)).filter(e=>!!e).sort((e,t)=>e.label.localeCompare(t.label))}catch{return[]}}function d(e){var a;let n=c(e.id.trim().toLowerCase());if(!n)throw Error("skill id is required");let s={id:n,label:e.label.trim()||n,description:e.description.trim(),triggers:e.triggers.map(e=>e.trim()).filter(Boolean),body:e.body.trim()},l=r.default.join(i,n);return t.default.mkdirSync(l,{recursive:!0}),t.default.writeFileSync(r.default.join(l,"SKILL.md"),(a=s,`---
id: ${a.id}
label: ${a.label}
description: ${a.description}
triggers: [${a.triggers.join(", ")}]
---

${a.body.replace(/\s+$/,"")}
`),"utf8"),s}function u(e){return e.replace(/\.md$/i,"").replace(/^skill$/i,"").replace(/[-_]+/g," ").trim().replace(/\b\w/g,e=>e.toUpperCase())}function c(e){return e.replace(/[^a-zA-Z0-9_-]/g,"_")}function p(e){return"string"==typeof e?e:""}function f(e){return Array.isArray(e)?e:"string"==typeof e&&e?[e]:[]}function g(e){return new Set((e.toLowerCase().match(/[\p{L}\p{N}_-]{2,}/gu)??[]).filter(e=>!h.has(e)))}let h=new Set(["the","and","for","that","this","with","you","are","was","were","what","how","של","על","עם","את","זה","מה","איך"]);function m(){try{return JSON.parse(t.default.readFileSync(a,"utf8"))}catch{return{}}}e.s(["formatOrgSkillsBlock",0,function(e){if(0===e.length)return"";let t=e.map(({skill:e})=>`## ${e.label} (${e.id})

${e.body}`).join("\n\n---\n\n");return`# Relevant organization skills

These are organization-level playbooks assigned to this employee. Use them to
shape how work is performed. They do not override hard boundaries, approval
policy, or the employee's profile files.

${t}`},"getAssignedOrgSkillIdsForEmployee",0,function(e,t=[]){return m()[e]??t},"importOrgSkillMarkdown",0,function(e){let t,{fm:r,body:i}=s(e.content),a=(t=i.match(/^#\s+(.+)$/m),t?.[1]?.trim()??""),n=p(r.label)||u(p(r.name))||a||u(e.filename.replace(/\.md$/i,"")),l=p(r.id)||p(r.name)||n||e.filename.replace(/\.md$/i,""),o=p(r.description),c=f(r.triggers).length>0?f(r.triggers):function(...e){return Array.from(new Set(e.join(" ").toLowerCase().match(/[\p{L}\p{N}_-]{3,}/gu)??[])).filter(e=>!h.has(e)).slice(0,8)}(l,n,o);return d({id:l,label:n,description:o,triggers:c,body:i.trim()||e.content.trim()})},"listOrgSkills",0,o,"readOrgSkill",0,l,"selectOrgSkillsForRun",0,function(e,t,r=3){var i;let a=(i=e,m()[i.id]??i.orgSkillIds).map(l).filter(e=>!!e);if(0===a.length)return[];let n=a.map(e=>({skill:e,score:function(e,t){let r=g(t);if(0===r.size)return 0;let i=0,a=g([e.id,e.label,e.description,e.triggers.join(" ")].join(" ").toLowerCase());for(let e of r)a.has(e)&&(i+=1);for(let r of e.triggers)t.toLowerCase().includes(r.toLowerCase())&&(i+=2);return i}(e,t)})).sort((e,t)=>t.score-e.score),s=n.filter(e=>e.score>0);return(s.length>0?s:n).slice(0,r)},"setAssignedOrgSkillIds",0,function(e,i){var n;let s=new Set(o().map(e=>e.id)),l=Array.from(new Set(i.map(e=>c(e)).filter(e=>s.has(e)))),d=m();return d[e]=l,n=d,t.default.mkdirSync(r.default.dirname(a),{recursive:!0}),t.default.writeFileSync(a,JSON.stringify(n,null,2),"utf8"),l},"writeOrgSkill",0,d])},21725,e=>{"use strict";var t=e.i(47909),r=e.i(74017),i=e.i(96250),a=e.i(59756),n=e.i(61916),s=e.i(74677),l=e.i(69741),o=e.i(16795),d=e.i(87718),u=e.i(95169),c=e.i(47587),p=e.i(66012),f=e.i(70101),g=e.i(74838),h=e.i(10372),m=e.i(93695);e.i(20232);var w=e.i(220),y=e.i(47751),C=e.i(51474),v=e.i(45919);async function A(e,t){let{id:r}=await t.params,i=await (0,y.loadEmployeesFromDisk)(),a=[...i,...(0,C.getHiredEmployees)().filter(e=>!i.some(t=>t.id===e.id))].find(e=>e.id===r),n=(0,v.getAssignedOrgSkillIdsForEmployee)(r,a?.orgSkillIds??[]);return Response.json({skills:(0,v.listOrgSkills)(),assignedSkillIds:n},{headers:{"Cache-Control":"no-store"}})}async function R(e,t){let{id:r}=await t.params,i=await e.json();if(!Array.isArray(i.skillIds))return Response.json({error:"skillIds must be an array"},{status:400});let a=(0,v.setAssignedOrgSkillIds)(r,i.skillIds);return Response.json({assignedSkillIds:a})}e.s(["GET",0,A,"PATCH",0,R],8228);var S=e.i(8228);let E=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/employees/[id]/skills/route",pathname:"/api/employees/[id]/skills",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/employees/[id]/skills/route.ts",nextConfigOutput:"standalone",userland:S,...{}}),{workAsyncStorage:k,workUnitAsyncStorage:x,serverHooks:b}=E;async function T(e,t,i){i.requestMeta&&(0,a.setRequestMeta)(e,i.requestMeta),E.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let y="/api/employees/[id]/skills/route";y=y.replace(/\/index$/,"")||"/";let C=await E.prepare(e,t,{srcPage:y,multiZoneDraftMode:!1});if(!C)return t.statusCode=400,t.end("Bad Request"),null==i.waitUntil||i.waitUntil.call(i,Promise.resolve()),null;let{buildId:v,params:A,nextConfig:R,parsedUrl:S,isDraftMode:k,prerenderManifest:x,routerServerContext:b,isOnDemandRevalidate:T,revalidateOnlyGenerated:O,resolvedPathname:N,clientReferenceManifest:j,serverActionsManifest:I}=C,D=(0,l.normalizeAppPath)(y),P=!!(x.dynamicRoutes[D]||x.routes[N]),$=async()=>((null==b?void 0:b.render404)?await b.render404(e,t,S,!1):t.end("This page could not be found"),null);if(P&&!k){let e=!!x.routes[N],t=x.dynamicRoutes[D];if(t&&!1===t.fallback&&!e){if(R.adapterPath)return await $();throw new m.NoFallbackError}}let q=null;!P||E.isDev||k||(q="/index"===(q=N)?"/":q);let U=!0===E.isDev||!P,_=P&&!U;I&&j&&(0,s.setManifestsSingleton)({page:y,clientReferenceManifest:j,serverActionsManifest:I});let F=e.method||"GET",M=(0,n.getTracer)(),L=M.getActiveScopeSpan(),H=!!(null==b?void 0:b.isWrappedByNextServer),B=!!(0,a.getRequestMeta)(e,"minimalMode"),W=(0,a.getRequestMeta)(e,"incrementalCache")||await E.getIncrementalCache(e,R,x,B);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let K={params:A,previewProps:x.preview,renderOpts:{experimental:{authInterrupts:!!R.experimental.authInterrupts},cacheComponents:!!R.cacheComponents,supportsDynamicResponse:U,incrementalCache:W,cacheLifeProfiles:R.cacheLife,waitUntil:i.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,i,a)=>E.onRequestError(e,t,i,a,b)},sharedContext:{buildId:v}},z=new o.NodeNextRequest(e),J=new o.NodeNextResponse(t),X=d.NextRequestAdapter.fromNodeNextRequest(z,(0,d.signalFromNodeResponse)(t));try{let a,s=async e=>E.handle(X,K).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=M.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let i=r.get("next.route");if(i){let t=`${F} ${i}`;e.setAttributes({"next.route":i,"http.route":i,"next.span_name":t}),e.updateName(t),a&&a!==e&&(a.setAttribute("http.route",i),a.updateName(t))}else e.updateName(`${F} ${y}`)}),l=async a=>{var n,l;let o=async({previousCacheEntry:r})=>{try{if(!B&&T&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await s(a);e.fetchMetrics=K.renderOpts.fetchMetrics;let l=K.renderOpts.pendingWaitUntil;l&&i.waitUntil&&(i.waitUntil(l),l=void 0);let o=K.renderOpts.collectedTags;if(!P)return await (0,p.sendResponse)(z,J,n,K.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(n.headers);o&&(t[h.NEXT_CACHE_TAGS_HEADER]=o),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=h.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,i=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=h.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:w.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:i}}}}catch(t){throw(null==r?void 0:r.isStale)&&await E.onRequestError(e,t,{routerKind:"App Router",routePath:y,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:_,isOnDemandRevalidate:T})},!1,b),t}},d=await E.handleResponse({req:e,nextConfig:R,cacheKey:q,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:x,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:O,responseGenerator:o,waitUntil:i.waitUntil,isMinimalMode:B});if(!P)return null;if((null==d||null==(n=d.value)?void 0:n.kind)!==w.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(l=d.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});B||t.setHeader("x-nextjs-cache",T?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),k&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,f.fromNodeOutgoingHttpHeaders)(d.value.headers);return B&&P||u.delete(h.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,g.getCacheControlHeader)(d.cacheControl)),await (0,p.sendResponse)(z,J,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};H&&L?await l(L):(a=M.getActiveScopeSpan(),await M.withPropagatedContext(e.headers,()=>M.trace(u.BaseServerSpan.handleRequest,{spanName:`${F} ${y}`,kind:n.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},l),void 0,!H))}catch(t){if(t instanceof m.NoFallbackError||await E.onRequestError(e,t,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:_,isOnDemandRevalidate:T})},!1,b),P)throw t;return await (0,p.sendResponse)(z,J,new Response(null,{status:500})),null}}e.s(["handler",0,T,"patchFetch",0,function(){return(0,i.patchFetch)({workAsyncStorage:k,workUnitAsyncStorage:x})},"routeModule",0,E,"serverHooks",0,b,"workAsyncStorage",0,k,"workUnitAsyncStorage",0,x],21725)}];

//# sourceMappingURL=%5Broot-of-the-server%5D__0j-og5k._.js.map