@punks/cli 4.0.1 → 4.0.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.
Files changed (27) hide show
  1. package/dist/BASELINE_CHANGELOG.md +10 -0
  2. package/dist/CHANGELOG.md +7 -0
  3. package/dist/baseline/scaffold-baseline/baseline.json +5 -5
  4. package/dist/baseline/scaffold-baseline/data/catalog/packs.json +2 -2
  5. package/dist/baseline/scaffold-baseline/data/catalog/skills.json +8 -0
  6. package/dist/baseline/scaffold-baseline/skills/agnostic/research/parallel-research/DURABLE-REPORT.md +5 -12
  7. package/dist/baseline/scaffold-baseline/skills/agnostic/research/parallel-research/SKILL.md +7 -8
  8. package/dist/baseline/scaffold-baseline/skills/agnostic/security/architect-pipeline/SKILL.md +97 -0
  9. package/dist/baseline/scaffold-baseline/skills/agnostic/security/architect-pipeline/agents/openai.yaml +4 -0
  10. package/dist/baseline/scaffold-baseline/skills/agnostic/security/architect-pipeline/references/infrastructure-deployment.md +29 -0
  11. package/dist/baseline/scaffold-baseline/skills/agnostic/security/architect-pipeline/references/security-by-design.md +22 -0
  12. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/provider-upgrade/SKILL.md +10 -7
  13. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-best-practices/SKILL.md +18 -50
  14. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-component/SKILL.md +34 -74
  15. package/dist/baseline/scaffold-baseline.json +5 -5
  16. package/dist/baseline/scaffold-baseline.tgz +0 -0
  17. package/dist/index.js +2 -2
  18. package/dist/skills/agnostic/research/parallel-research/DURABLE-REPORT.md +5 -12
  19. package/dist/skills/agnostic/research/parallel-research/SKILL.md +7 -8
  20. package/dist/skills/agnostic/security/architect-pipeline/SKILL.md +97 -0
  21. package/dist/skills/agnostic/security/architect-pipeline/agents/openai.yaml +4 -0
  22. package/dist/skills/agnostic/security/architect-pipeline/references/infrastructure-deployment.md +29 -0
  23. package/dist/skills/agnostic/security/architect-pipeline/references/security-by-design.md +22 -0
  24. package/dist/skills/frameworks/pulumi/provider-upgrade/SKILL.md +10 -7
  25. package/dist/skills/frameworks/pulumi/pulumi-best-practices/SKILL.md +10 -42
  26. package/dist/skills/frameworks/pulumi/pulumi-component/SKILL.md +18 -58
  27. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -278,11 +278,11 @@ ${annotate2("Wizard cancelled.",red)}`;var renderCommandBlock=(label,commandLine
278
278
  ${colorRail2({environment,headingTone:"accent",rail:reflowRail(guide,environment.width)})}
279
279
  `};class CliValidationError extends TaggedErrorClass()("CliValidationError",{cause:optional(Defect()),message:String4,recoveryCommand:optional(String4)}){}class CliPromptError extends TaggedErrorClass()("CliPromptError",{cause:optional(Defect()),message:String4}){}var boundaryCancellationDetail=new Map([["@punks/cli/repository-check/RepositoryCheckOperationFailure","Check cancelled."],["@punks/cli/repository-scaffolding/RepositoryScaffoldingOperationFailure","Scaffold cancelled."],["@punks/cli/scaffold-update/ScaffoldUpdateOperationFailure","Update cancelled."]]);var isRecord2=(value3)=>typeof value3==="object"&&value3!==null;var promptWasCancelled=(value3)=>value3 instanceof CliPromptError&&isRecord2(value3.cause)&&value3.cause.name==="QuitError";var expectedFailureOutcome=(value3,cancellationDetail="Command cancelled.")=>{if(value3 instanceof CliValidationError){return{failure:{code:"validation-failed",detail:value3.message,recoverable:value3.recoveryCommand!==undefined,...value3.recoveryCommand===undefined?{}:{recoveryCommand:value3.recoveryCommand},subject:"command"},kind:"expected-failure"}}if(promptWasCancelled(value3)){return{failure:{code:"cancelled",detail:cancellationDetail,recoverable:false,subject:"command"},kind:"expected-failure"}}return};var helpCommand=(commandPath)=>`${commandPath.length===0?"hi":commandPath.join(" ")} --help`;var cliUsageFailure=(value3,commandPath=["hi"])=>{if(value3 instanceof exports_CliError.ShowHelp){if(value3.errors.length===0){return}const failures=value3.errors.map((error2)=>cliUsageFailure(error2,value3.commandPath));return failures.every((failure)=>failure!==undefined)?failures[0]:undefined}if(value3 instanceof exports_CliError.UnknownSubcommand){const parent=value3.parent??commandPath.slice(0,-1);return{code:"unknown-command",detail:`Unknown command \`${value3.subcommand}\`.`,recoverable:true,recoveryCommand:helpCommand(parent),subject:value3.subcommand}}if(value3 instanceof exports_CliError.UnrecognizedOption){return{code:"unknown-option",detail:`Unknown option \`${value3.option}\`.`,recoverable:true,recoveryCommand:helpCommand(value3.command??commandPath),subject:value3.option}}if(value3 instanceof exports_CliError.MissingOption){return{code:"missing-command-input",detail:`Missing value for \`--${value3.option}\`.`,recoverable:true,recoveryCommand:helpCommand(commandPath),subject:value3.option}}if(value3 instanceof exports_CliError.MissingArgument){return{code:"missing-command-input",detail:`Missing value for \`<${value3.argument}>\`.`,recoverable:true,recoveryCommand:helpCommand(commandPath),subject:value3.argument}}if(value3 instanceof exports_CliError.InvalidValue){return{code:"invalid-command-input",detail:`Invalid value for \`${value3.kind==="flag"?`--${value3.option}`:`<${value3.option}>`}\`.`,recoverable:true,recoveryCommand:helpCommand(commandPath),subject:value3.option}}if(value3 instanceof exports_CliError.DuplicateOption){return{code:"invalid-command-usage",detail:"Command options are ambiguous.",recoverable:true,recoveryCommand:helpCommand(commandPath),subject:value3.option}}return};class RootPresentationSink extends Service()("@punks/cli/RootPresentationSink"){}var extractOperationResult=(value3)=>{const candidate=typeof value3==="object"&&value3!==null&&"operation"in value3?value3.operation:value3;try{return decodeOperationResult(candidate)}catch{return}};var presentationOutcome=(value3)=>{const result3=extractOperationResult(value3);if(result3!==undefined){return{...isRecord2(value3)&&"jsonPayload"in value3?{jsonPayload:value3.jsonPayload}:{},kind:"result",result:result3}}if(value3===undefined){return}const directExpectedFailure=expectedFailureOutcome(value3);if(directExpectedFailure!==undefined){return directExpectedFailure}const usageFailure=cliUsageFailure(value3);if(usageFailure!==undefined){return{failure:usageFailure,kind:"expected-failure"}}if(isRecord2(value3)&&typeof value3._tag==="string"&&"cause"in value3){const cancellationDetail=boundaryCancellationDetail.get(value3._tag);if(cancellationDetail!==undefined){const wrappedExpectedFailure=expectedFailureOutcome(value3.cause,cancellationDetail);if(wrappedExpectedFailure!==undefined){return wrappedExpectedFailure}}}if(value3 instanceof RepositoryCheckOperationFailure){return{failure:{code:value3._tag,detail:value3.message,recoverable:false,subject:value3.operation},kind:"expected-failure"}}return{detail:value3 instanceof Error?value3.message:String(value3),kind:"unexpected-diagnostic"}};var captureCommandResult=(effect2)=>tap2(effect2,(value3)=>{const outcome=presentationOutcome(value3);if(outcome===undefined){return void_3}return RootPresentationSink.use((sink)=>sink.publish(outcome))});var resultFailed=(result3)=>result3.status==="partial"||result3.status==="degraded"||result3.status==="conflict"||result3.status==="failed";var present=({humanEnvironment,mode,outcome,writeStderr=(text3)=>process.stderr.write(text3),writeStdout=(text3)=>process.stdout.write(text3)})=>{if(outcome.kind==="unexpected-diagnostic"){writeStderr(`${outcome.detail}
280
280
  `);return 1}if(mode==="json"){let rendered;if(outcome.kind==="expected-failure"){rendered=renderJsonFailure(outcome.failure)}else if(outcome.jsonPayload===undefined){rendered=renderJsonResult(outcome.result)}else{rendered=`${JSON.stringify(outcome.jsonPayload,null,2)}
281
- `}writeStdout(rendered);return outcome.kind==="expected-failure"||resultFailed(outcome.result)?1:0}if(outcome.kind==="expected-failure"){writeStdout(renderExpectedFailure(outcome.failure,humanEnvironment));return 1}writeStdout(renderOperationResult(outcome.result,humanEnvironment));return resultFailed(outcome.result)?1:0};var UpdateInteraction=Service("@punks/cli/features/scaffold-update/UpdateInteraction");class ScaffoldUpdateOperationFailure extends TaggedErrorClass()("@punks/cli/scaffold-update/ScaffoldUpdateOperationFailure",{cause:Defect(),message:String4,operation:Literal2("update-scaffold")}){}var ScaffoldUpdateOperations=Service("@punks/cli/features/scaffold-update/ScaffoldUpdateOperations");var runScaffoldUpdateApplication=fn2("ScaffoldUpdate.run")(function*runScaffoldUpdateApplication2(input){const interaction=yield*UpdateInteraction;const operations=yield*ScaffoldUpdateOperations;return yield*operations.run(input,interaction)});var desiredFilesByPath=(files)=>{const indexed=new Map;for(const file5 of files){indexed.set(file5.path,indexed.has(file5.path)?null:file5)}return indexed};var recoveryAction=({conflict,desired,fixedManagedPaths})=>{if(conflict._tag!=="UserModifiedScaffoldEntryConflict"||conflict.item!=="file"||conflict.operation!=="update"||!fixedManagedPaths.has(conflict.identity)){return null}const file5=desired.get(conflict.identity);return file5===undefined||file5===null?null:{_tag:"ArchiveAndReplaceScaffoldFile",desired:file5,identity:conflict.identity,item:"file"}};var planFixedManagedRecovery=({authority,fixedManagedPaths,plan})=>{if(authority._tag!=="VerifiedDesiredBaseline"){return plan}const desired=desiredFilesByPath(authority.files);const recoveries=new Map;for(const conflict of plan.conflicts){const action2=recoveryAction({conflict,desired,fixedManagedPaths});if(action2!==null){recoveries.set(conflict,action2)}}if(recoveries.size===0){return plan}return{...plan,actions:[...plan.actions,...recoveries.values()],conflicts:plan.conflicts.filter((conflict)=>!recoveries.has(conflict))}};import path7 from"node:path";var packCatalog=[{category:"surface",description:"Backend pack: domain structure, recoverable actions, and logging.",hooks:[],id:"backend",lintAssets:[],promptDetails:["shared backend domain baseline","workspace backend action/recovery guidance","workspace logging/observability guidance"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["backend-domain-structure","backend-recoverable-actions","logging-best-practices"],triggerPackages:[]},{category:"detected",description:"Better Auth guidance pack.",hooks:[],id:"better-auth",lintAssets:[],promptDetails:["shared auth guardrails","workspace auth boundaries"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["better-auth-best-practices"],triggerPackages:["better-auth"]},{category:"default",description:"Default debug pack: runtime debugging, ClawPatch bug discovery/resolution, and debug-agent workflow.",hooks:[],id:"debug",lintAssets:[],promptDetails:["shared runtime debugging baseline","workspace evidence-first debugging workflow"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["debugging-phase","bug-discovery-phase","bug-resolution-phase","debug-agent"],triggerPackages:[]},{category:"default",description:"Default docs pack: docs ingest plus public-doc and skill-writing primitives.",hooks:[],id:"docs",lintAssets:[],promptDetails:["shared docs baseline","public-doc writing flow","docs scope spec"],promptSurfaces:["shared-agents","root-prompt-spec","docs-prompt-spec"],skills:["docs-ingest-phase","docs-onboarding","writing-fragments","writing-beats","writing-shape","writing-for-agents","write-graph-based-skills","rule-authoring"],triggerPackages:[]},{category:"default",description:"Default misc pack: lightweight agent interaction helpers.",hooks:[],id:"misc",lintAssets:[],promptDetails:["shared agent interaction helpers"],promptSurfaces:["shared-agents"],skills:["handback","show-me","wait-what"],triggerPackages:[]},{category:"detected",description:"Drizzle guidance pack.",hooks:[],id:"drizzle",lintAssets:[],promptDetails:["shared data-layer baseline","workspace db flow rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:[],triggerPackages:["drizzle-kit","drizzle-orm"]},{category:"detected",description:"Effect guidance pack family.",exampleRepositories:[Object.fromEntries([["repo","AnswerOverflow/AnswerOverflow"],["url","https://github.com/AnswerOverflow/AnswerOverflow"],["packs",[{uid:"effect",version:"^3.20.0"}]]]),Object.fromEntries([["repo","rhyssullivan/executor"],["url","https://github.com/rhyssullivan/executor"],["packs",[{uid:"effect",version:"4.0.0-beta.59"}]]]),Object.fromEntries([["repo","alchemy-run/alchemy-effect"],["url","https://github.com/alchemy-run/alchemy-effect"],["packs",[{uid:"effect",version:">=4.0.0-beta.66 || >=4.0.0"}]]]),Object.fromEntries([["repo","anomalyco/opencode"],["url","https://github.com/anomalyco/opencode"],["packs",[{uid:"effect",version:"4.0.0-beta.65"}]]]),Object.fromEntries([["repo","pingdotgg/t3code"],["url","https://github.com/pingdotgg/t3code"],["packs",[{uid:"effect",version:"4.0.0-beta.59"}]]])],hooks:[],id:"effect",lintAssets:["effect-no-barrel-imports","effect-tsgo-recommended"],promptDetails:["shared Effect v4 patterns baseline","workspace backend topology and action-orchestration rules","workspace service qualification, Layer, and audit rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["effect","effect-backend-structure","effect-recoverable-actions","effect-service-design"],triggerPackages:["effect","@effect/"]},{category:"detected",description:"Elysia guidance pack.",hooks:[],id:"elysia",lintAssets:[],promptDetails:["shared api-server baseline","workspace route/plugin rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["elysiajs"],triggerPackages:["elysia"]},{category:"detected",description:"Expo guidance pack.",hooks:[],id:"expo",lintAssets:[],promptDetails:["shared expo baseline","workspace native app guidance"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["add-app-clip","animate-expo","building-native-ui","eas-simulator","eas-update-insights","expo-api-routes","expo-brownfield","expo-cicd-workflows","expo-deployment","expo-dev-client","expo-examples","expo-module","expo-observe","expo-skill-eval","expo-tailwind-setup","expo-ui","native-data-fetching","upgrading-expo","use-dom","web-to-native"],triggerPackages:["expo","@expo/"]},{category:"surface",description:"Frontend pack: agent-browser, animation authoring/review, design taste, image generation, frontend domain structure, and mobile-web improvement.",hooks:[],id:"frontend",lintAssets:[],promptDetails:["shared product-ui baseline","workspace UX/browser guidance","workspace frontend domain boundaries"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["agent-browser","animate","design-taste-frontend","imagegen-frontend-mobile","imagegen-frontend-web","frontend-domain-structure","improve-mobile-frontend","review-animations"],triggerPackages:[]},{category:"detected",description:"Next.js guidance pack.",hooks:[],id:"nextjs",lintAssets:["next-core"],promptDetails:["shared app-router baseline","workspace next rendering rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["next-best-practices","next-cache-components"],triggerPackages:["next"]},{category:"default",description:"Default planning pack: delivery phase, specs, plans, implementation, and debt resolution.",hooks:[],id:"planning",lintAssets:[],promptDetails:["shared planning baseline","workspace plan/spec execution rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["business-finder","finder-phase","functional-finder","technical-finder","wayfinder","prototype-phase","delivery-phase","design-phase","goalify","grilling","handoff","create-spec","create-plan","implement-spec","verify-behavior","repo-asset-management","resolve-debt-phase"],triggerPackages:[]},{category:"detected",description:"Pulumi guidance pack.",hooks:[],id:"pulumi",lintAssets:[],promptDetails:["shared pulumi baseline","workspace infrastructure-as-code guidance"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["pulumi-overview","pulumi-best-practices","pulumi-component","pulumi-automation-api","pulumi-esc","provider-upgrade","package-usage"],triggerPackages:["@pulumi/","@pulumi/pulumi"]},{category:"default",description:"Default quality pack: test-driven delivery, test-suite design, codebase design, and simplification.",hooks:[],id:"quality",lintAssets:["vitest-core"],promptDetails:["shared change-quality baseline","workspace test-suite and refactor expectations"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["tdd","make-tsuite","codebase-design","simplify"],triggerPackages:[]},{category:"detected",description:"React guidance pack.",hooks:[],id:"react",lintAssets:["react-core","react-you-might-not-need-an-effect"],promptDetails:["shared react structure baseline","workspace react composition rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["async-react-patterns","react-doctor","vercel-composition-patterns","vercel-react-best-practices"],triggerPackages:["react","react-dom"]},{category:"detected",description:"SQLAlchemy schema and Alembic migration guidance pack.",hooks:[],id:"sqlalchemy",lintAssets:[],promptDetails:["shared SQLAlchemy schema and migration baseline"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["sqlalchemy-schema-design"],triggerPackages:["sqlalchemy","alembic"]},{category:"default",description:"Default research pack: parallel research, prototypes, structured review, and architecture inspection.",hooks:[],id:"research",lintAssets:[],promptDetails:["shared investigation baseline","workspace research handoff rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["parallel-research","prototype","review-phase","review","autoreview","improve-codebase-architecture"],triggerPackages:[]},{category:"default",description:"Default requirements pack: requirements phase, grill, and backlog authoring.",hooks:[],id:"requirements",lintAssets:[],promptDetails:["shared requirements baseline","workspace backlog shaping rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["requirements-phase","requirements-grill","domain-modeling","repo-asset-management","write-backlog"],triggerPackages:[]},{category:"default",description:"Default ok pack: CI audit review, best-practices routing, and remediation guardrails.",hooks:[],id:"security",lintAssets:[],promptDetails:["shared security review baseline","evidence-first remediation routing","risk-aware approval discipline"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["audit-cicd-security","security-best-practices"],triggerPackages:[]},{category:"default",description:"Default subagents pack: swarm-planner.",hooks:[],id:"subagents",lintAssets:[],promptDetails:["shared delegation baseline","workspace ownership handoffs","subagent manifest scaffold"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec","subagent-manifest"],skills:["swarm-planner"],triggerPackages:[]},{category:"detected",description:"TanStack Query guidance pack.",hooks:[],id:"tanstack-query",lintAssets:["tanstack-query-core"],promptDetails:["shared tanstack query baseline","workspace server-state rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["tanstack-query"],triggerPackages:["@tanstack/react-query"]},{category:"detected",description:"tRPC guidance pack.",hooks:[],id:"trpc",lintAssets:[],promptDetails:["shared contract-first baseline","workspace client/server boundaries"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:[],triggerPackages:["@trpc/"]},{category:"detected",description:"Turborepo guidance pack.",hooks:[],id:"turborepo",lintAssets:[],promptDetails:["shared monorepo baseline","workspace task boundary rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["turborepo"],triggerPackages:["turbo"]},{category:"language",description:"Shared Python language pack that compounds the agnostic backend domain base with Python import structure, async, style, testing, and design guidance.",hooks:["format-edited-file"],id:"python",lintAssets:[],promptDetails:[],promptSurfaces:[],skills:["async-python-patterns","backend-domain-structure","python-backend-structure","python-code-style","python-design-patterns","python-testing-patterns"],triggerPackages:[]},{category:"language",description:"Shared JavaScript / TypeScript language pack for hook and language-level scaffold assets.",hooks:["format-edited-file"],id:"typescript",lintAssets:["typescript-anti-slop"],promptDetails:[],promptSurfaces:[],skills:["quality-types"],triggerPackages:["typescript"]}];import{createHash as createHash3}from"node:crypto";import{existsSync as existsSync2,readdirSync as readdirSync2,readFileSync as readFileSync3,renameSync}from"node:fs";import path6 from"node:path";var exports_HttpApi={};__export(exports_HttpApi,{reflect:()=>reflect,make:()=>make37,isHttpApi:()=>isHttpApi,AdditionalSchemas:()=>AdditionalSchemas});var exports_HttpApiEndpoint={};__export(exports_HttpApiEndpoint,{put:()=>put3,post:()=>post3,patch:()=>patch3,options:()=>options3,make:()=>make36,isHttpApiEndpoint:()=>isHttpApiEndpoint,head:()=>head3,getSuccessSchemas:()=>getSuccessSchemas,getPayloadSchemas:()=>getPayloadSchemas,getErrorSchemas:()=>getErrorSchemas,get:()=>get7,delete:()=>del3});var exports_HttpApiSchema={};__export(exports_HttpApiSchema,{status:()=>status,isStreamUint8Array:()=>isStreamUint8Array,isStreamSse:()=>isStreamSse,isStreamSchema:()=>isStreamSchema,isNoContent:()=>isNoContent,getStatusSuccess:()=>getStatusSuccess,getStatusStream:()=>getStatusStream,getStatusError:()=>getStatusError,getResponseEncoding:()=>getResponseEncoding,getPayloadEncoding:()=>getPayloadEncoding,asUint8Array:()=>asUint8Array,asText:()=>asText,asNoContent:()=>asNoContent,asMultipartStream:()=>asMultipartStream,asMultipart:()=>asMultipart,asJson:()=>asJson,asFormUrlEncoded:()=>asFormUrlEncoded,StreamUint8Array:()=>StreamUint8Array,StreamSse:()=>StreamSse,NoContent:()=>NoContent,MultipartTypeId:()=>MultipartTypeId,MultipartStreamTypeId:()=>MultipartStreamTypeId,Empty:()=>Empty3,Created:()=>Created,Accepted:()=>Accepted});var statusCodeByLiteral={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,OK:200,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};var StreamSchemaTypeId="~effect/httpapi/HttpApiSchema/Stream";function status(code){const statusCode=typeof code==="string"?statusCodeByLiteral[code]:code;return(self)=>self.annotate({httpApiStatus:statusCode})}var Empty3=(code)=>Void2.pipe(status(code));var NoContent=Empty3(204);var Created=Empty3(201);var Accepted=Empty3(202);function asNoContent(options3){return(self)=>{return Void2.pipe(decodeTo2(toType2(self),transform2({decode:options3.decode,encode:constVoid})))}}var streamSchema=declare(isStream);var StreamSse=(options3)=>{const events=options3.events??(options3.data===undefined?undefined:Struct({id:UndefinedOr(String4),event:String4,data:fromJsonString2(options3.data)}));if(events===undefined){throw new Error("StreamSse requires either an events schema or a data schema")}return make18(streamSchema.ast,{[StreamSchemaTypeId]:StreamSchemaTypeId,_tag:"StreamSse",mode:"sse",sseMode:options3.events===undefined?"data":"events",contentType:options3.contentType??defaultStreamContentType("sse"),events,error:options3.error??Never2})};var StreamUint8Array=(options3)=>make18(streamSchema.ast,{[StreamSchemaTypeId]:StreamSchemaTypeId,_tag:"StreamUint8Array",mode:"uint8array",contentType:options3?.contentType??defaultStreamContentType("uint8array")});var isStreamSchema=(u)=>isSchema(u)&&hasProperty(u,StreamSchemaTypeId);var isStreamSse=(u)=>isStreamSchema(u)&&u._tag==="StreamSse";var isStreamUint8Array=(u)=>isStreamSchema(u)&&u._tag==="StreamUint8Array";function defaultStreamContentType(mode){switch(mode){case"sse":return"text/event-stream";case"uint8array":return"application/octet-stream"}}var MultipartTypeId="~effect/httpapi/HttpApiSchema/Multipart";function asMultipart(options3){return(self)=>self.pipe(brand2(MultipartTypeId)).annotate({"~httpApiEncoding":{_tag:"Multipart",mode:"buffered",contentType:defaultContentType("Multipart"),limits:options3}})}var MultipartStreamTypeId="~effect/httpapi/HttpApiSchema/MultipartStream";function asMultipartStream(options3){return(self)=>self.pipe(brand2(MultipartStreamTypeId)).annotate({"~httpApiEncoding":{_tag:"Multipart",mode:"stream",contentType:defaultContentType("Multipart"),limits:options3}})}function asNonMultipartEncoding(self,options3){return self.annotate({"~httpApiEncoding":{_tag:options3._tag,contentType:options3.contentType??defaultContentType(options3._tag)}})}function defaultContentType(_tag){switch(_tag){case"Multipart":return"multipart/form-data";case"Json":return"application/json";case"FormUrlEncoded":return"application/x-www-form-urlencoded";case"Uint8Array":return"application/octet-stream";case"Text":return"text/plain"}}function asJson(options3){return(self)=>asNonMultipartEncoding(self,{_tag:"Json",...options3})}function asFormUrlEncoded(options3){return(self)=>asNonMultipartEncoding(self,{_tag:"FormUrlEncoded",...options3})}function asText(options3){return(self)=>asNonMultipartEncoding(self,{_tag:"Text",...options3})}function asUint8Array(options3){return(self)=>asNonMultipartEncoding(self,{_tag:"Uint8Array",...options3})}var isNoContent=(ast)=>{if(isVoid(ast))return true;const encoded=toEncoded(ast);if(isVoid(encoded))return true;const target=ast.encoding?.[0].to;if(target===undefined)return false;return isVoid(target)};var resolveHttpApiEncoding=resolveAt2("~httpApiEncoding");var resolveHttpApiStatus=resolveAt2("httpApiStatus");var defaultJsonEncoding={_tag:"Json",contentType:"application/json"};var defaultUrlEncodedEncoding={_tag:"FormUrlEncoded",contentType:"application/x-www-form-urlencoded"};function getEncoding(ast){return resolveHttpApiEncoding(ast)??defaultJsonEncoding}function getPayloadEncoding(ast,method){const encoding=resolveHttpApiEncoding(ast);if(encoding)return encoding;return hasBody(method)?defaultJsonEncoding:defaultUrlEncodedEncoding}function getResponseEncoding(ast){const out=getEncoding(ast);if(out._tag==="Multipart"){throw new Error("Multipart is not supported in response")}return out}function getStatusSuccess(self){return resolveHttpApiStatus(self)??200}function getStatusStream(self){return getStatusSuccess(self.ast)}function getStatusError(self){return resolveHttpApiStatus(self)??500}function normalize(contentType){const normalized=contentType.toLowerCase().trim();const index=normalized.indexOf(";");return index===-1?normalized:normalized.slice(0,index).trim()}var TypeId46="~effect/httpapi/HttpApiEndpoint";var isHttpApiEndpoint=(u)=>hasProperty(u,TypeId46);function getPayloadSchemas(endpoint){const result3=[];for(const{schemas}of endpoint.payload.values()){result3.push(...schemas)}return result3}function getSuccessSchemas(endpoint){const schemas=Array.from(endpoint.success);return isArrayNonEmpty2(schemas)?schemas:[NoContent]}function getErrorSchemas(endpoint){const schemas=new Set(endpoint.error);for(const middleware2 of endpoint.middlewares){const key=middleware2;for(const schema2 of key.error){schemas.add(schema2)}}return Array.from(schemas)}var Proto15={[TypeId46]:TypeId46,pipe(){return pipeArguments(this,arguments)},prefix(prefix){return makeProto({...optionsFromEndpoint(this),path:prefixPath(this.path,prefix)})},middleware(middleware2){return makeProto({...optionsFromEndpoint(this),middlewares:new Set([...this.middlewares,middleware2])})},annotate(key,value3){return makeProto({...optionsFromEndpoint(this),annotations:add(this.annotations,key,value3)})},annotateMerge(annotations){return makeProto({...optionsFromEndpoint(this),annotations:merge(this.annotations,annotations)})}};var optionsFromEndpoint=(endpoint)=>({identifier:endpoint.identifier,path:endpoint.path,method:endpoint.method,params:endpoint.params,query:endpoint.query,headers:endpoint.headers,payload:endpoint.payload,success:endpoint.success,error:endpoint.error,annotations:endpoint.annotations,middlewares:endpoint.middlewares});function makeProto(options3){function HttpApiEndpoint(){}Object.setPrototypeOf(HttpApiEndpoint,Proto15);return Object.assign(HttpApiEndpoint,options3)}var make36=(method)=>(identifier2,path4,options3)=>{const disableCodecs=options3?.disableCodecs??false;const transformStringTree=disableCodecs?identity:toCodecStringTree;return makeProto({identifier:identifier2,path:path4,method,params:ensureStruct(options3?.params,transformStringTree),query:ensureStruct(options3?.query,transformStringTree),headers:ensureStruct(options3?.headers,transformStringTree),payload:getPayload(options3?.payload,method,disableCodecs),success:getSuccessResponse(options3?.success,method,disableCodecs),error:getErrorResponse(options3?.error,disableCodecs),annotations:empty(),middlewares:new Set})};function ensureStruct(params,transform6){if(params===undefined)return;if(isSchema(params))return transform6(params);return transform6(Struct(params))}function getPayload(payload,method,disableCodecs){const result3=new Map;if(payload===undefined)return result3;const schemas=Array.isArray(payload)?payload:isSchema(payload)?[payload]:[Struct(payload).pipe(asFormUrlEncoded())];const transform6=disableCodecs?identity:transformPayload;for(const schema2 of schemas){const encoding=getPayloadEncoding(schema2.ast,method);const contentType=normalize(encoding.contentType);const existing=result3.get(contentType);if(existing){if(existing.encoding._tag!==encoding._tag){throw new Error(`Multiple payload encodings for content-type: ${encoding.contentType}`)}if(existing.encoding._tag==="Multipart"){throw new Error(`Multiple multipart payloads for content-type: ${encoding.contentType}`)}existing.schemas.push(transform6(schema2,method))}else{result3.set(contentType,{encoding,schemas:[transform6(schema2,method)]})}}return result3}var reservedStreamFailureEvent="effect/httpapi/stream/failure";function getSuccessResponse(success,method,disableCodecs){if(success===undefined)return new Set;const schemas=ensure(success);validateSuccessResponse(schemas,method);return new Set(disableCodecs?schemas:schemas.map((schema2)=>isStreamSchema(schema2)?schema2:transformResponse2(schema2)))}function getErrorResponse(error2,disableCodecs){if(error2===undefined)return new Set;const schemas=ensure(error2);for(const schema2 of schemas){if(isStreamSchema(schema2)){throw new Error("Streaming schemas are not supported in error responses")}}return new Set(disableCodecs?schemas:schemas.map(transformResponse2))}function validateSuccessResponse(schemas,method){const statuses=new Map;for(const schema2 of schemas){if(isStreamSchema(schema2)){validateStreamSuccess(schema2,method);const status2=getStatusStream(schema2);const entry=getStatusEntry(statuses,status2);if(entry.stream!==undefined){throw new Error(`Multiple streaming success responses for status: ${status2}`)}if(entry.noContent){throw new Error(`Cannot combine no-content and streaming success responses for status: ${status2}`)}if(entry.bufferedContentTypes.has(normalize(schema2.contentType))){throw new Error(`Cannot combine buffered and streaming success responses for status ${status2} and content-type: ${schema2.contentType}`)}statuses.set(status2,{...entry,stream:schema2})}else{const status2=getStatusSuccess(schema2.ast);const entry=getStatusEntry(statuses,status2);const noContent=isNoContent(schema2.ast);if(entry.stream!==undefined){if(noContent){throw new Error(`Cannot combine no-content and streaming success responses for status: ${status2}`)}const encoding=getResponseEncoding(schema2.ast);if(normalize(encoding.contentType)===normalize(entry.stream.contentType)){throw new Error(`Cannot combine buffered and streaming success responses for status ${status2} and content-type: ${encoding.contentType}`)}}if(!noContent){entry.bufferedContentTypes.add(normalize(getResponseEncoding(schema2.ast).contentType))}entry.noContent=entry.noContent||noContent}}}function getStatusEntry(statuses,status2){let entry=statuses.get(status2);if(entry===undefined){entry={bufferedContentTypes:new Set,noContent:false};statuses.set(status2,entry)}return entry}function validateStreamSuccess(schema2,method){if(method==="HEAD"){throw new Error("HEAD endpoints cannot declare streaming success responses")}if(isStreamSse(schema2)&&hasReservedSseEventName(schema2.events.ast)){throw new Error(`SSE event name is reserved: ${reservedStreamFailureEvent}`)}}function hasReservedSseEventName(ast){return hasReservedEventName(toEncoded(ast),new Set)}function hasReservedEventName(ast,seen){if(seen.has(ast))return false;seen.add(ast);if(isUnion(ast)){return ast.types.some((type)=>hasReservedEventName(type,seen))}if(isSuspend(ast)){return hasReservedEventName(ast.thunk(),seen)}if(!isObjects(ast))return false;const event=ast.propertySignatures.find((ps)=>ps.name==="event");return event!==undefined&&hasReservedEventLiteral(event.type,seen)}function hasReservedEventLiteral(ast,seen){if(seen.has(ast))return false;seen.add(ast);const encoded=toEncoded(ast);if(encoded!==ast){return hasReservedEventLiteral(encoded,seen)}if(isLiteral(ast)){return ast.literal===reservedStreamFailureEvent}if(isUnion(ast)){return ast.types.some((type)=>hasReservedEventLiteral(type,seen))}if(isSuspend(ast)){return hasReservedEventLiteral(ast.thunk(),seen)}return false}function transformResponse2(schema2){const encoding=getResponseEncoding(schema2.ast);switch(encoding._tag){case"Json":return toCodecJson(schema2);case"FormUrlEncoded":return toCodecStringTree(schema2);case"Text":case"Uint8Array":return schema2}}function transformPayload(schema2,method){const encoding=getPayloadEncoding(schema2.ast,method);switch(encoding._tag){case"Json":return toCodecJson(schema2);case"FormUrlEncoded":return toCodecStringTree(schema2);case"Text":case"Uint8Array":case"Multipart":return schema2}}var get7=make36("GET");var post3=make36("POST");var put3=make36("PUT");var patch3=make36("PATCH");var del3=make36("DELETE");var head3=make36("HEAD");var options3=make36("OPTIONS");var TypeId47="~effect/httpapi/HttpApi";var isHttpApi=(u)=>hasProperty(u,TypeId47);var Proto16={[TypeId47]:TypeId47,pipe(){return pipeArguments(this,arguments)},add(...toAdd){const groups={...this.groups};for(const group of toAdd){set(groups,group.identifier,group)}return makeProto2({...optionsFromApi(this),groups})},addHttpApi(api){const newGroups={...this.groups};for(const key in api.groups){const group=api.groups[key];set(newGroups,key,group.annotateMerge(merge(api.annotations,group.annotations)))}return makeProto2({...optionsFromApi(this),groups:newGroups})},prefix(prefix){return makeProto2({...optionsFromApi(this),groups:map2(this.groups,(group)=>group.prefix(prefix))})},middleware(tag2){return makeProto2({...optionsFromApi(this),groups:map2(this.groups,(group)=>group.middleware(tag2))})},annotate(key,value3){return makeProto2({...optionsFromApi(this),annotations:add(this.annotations,key,value3)})},annotateMerge(annotations){return makeProto2({...optionsFromApi(this),annotations:merge(this.annotations,annotations)})}};var optionsFromApi=(api)=>({identifier:api.identifier,groups:api.groups,annotations:api.annotations});var makeProto2=(options4)=>{function HttpApi(){}Object.setPrototypeOf(HttpApi,Proto16);return Object.assign(HttpApi,options4)};var make37=(identifier2)=>makeProto2({identifier:identifier2,groups:{},annotations:empty()});var reflect=(self,options4)=>{const groups=Object.values(self.groups);for(const group of groups){const groupAnnotations=merge(self.annotations,group.annotations);options4.onGroup({group,mergedAnnotations:groupAnnotations});const endpoints=Object.values(group.endpoints);for(const endpoint of endpoints){if(options4.predicate&&!options4.predicate({endpoint,group}))continue;options4.onEndpoint({group,endpoint,middleware:endpoint.middlewares,mergedAnnotations:merge(groupAnnotations,endpoint.annotations),successes:extractResponseContent(getSuccessSchemas(endpoint),getStatusSuccess),errors:extractResponseContent(getErrorSchemas(endpoint),getStatusError)})}}};var extractResponseContent=(schemas,getStatus)=>{const map15=new Map;schemas.forEach(add2);return map15;function add2(schema2){if(isStreamSchema(schema2))return;const ast=schema2.ast;const status2=getStatus(ast);const schemas2=map15.get(status2);if(schemas2===undefined){map15.set(status2,[schema2])}else{schemas2.push(schema2)}}};class AdditionalSchemas extends Service()("effect/httpapi/HttpApi/AdditionalSchemas"){}var decode=(schema2)=>()=>{const decode2=decodeEffect2(NonEmptyArray(schema2));return fromTransform((upstream,_scope)=>succeed6(flatMap3(upstream,(chunk)=>decode2(chunk))))};var decode2=()=>fromTransform((upstream,_scope)=>sync2(()=>{let buffer2=[];let retry5;const parser2=makeParser2((event)=>{if(event._tag==="Retry"){retry5=event}else{buffer2.push(event)}});const pump=flatMap3(upstream,(arr)=>{for(let i=0;i<arr.length;i++){parser2.feed(arr[i])}return void_3});return suspend2(function loop(){if(isArrayNonEmpty2(buffer2)){const out=buffer2;buffer2=[];return succeed6(out)}else if(retry5){return fail6(retry5)}return flatMap3(pump,loop)})}));var decodeSchema=(schema2)=>pipeTo(decode2(),decode(EventEncoded.pipe(decodeTo2(schema2)))());function makeParser2(onParse){let isFirstChunk;let buffer2;let startingPosition;let startingFieldLength;let eventId;let lastEventId;let eventName;let data;reset3();return{feed,reset:reset3};function reset3(){isFirstChunk=true;buffer2="";startingPosition=0;startingFieldLength=-1;eventId=undefined;eventName=undefined;data=""}function feed(chunk){buffer2=buffer2?buffer2+chunk:chunk;if(isFirstChunk&&hasBom(buffer2)){buffer2=buffer2.slice(BOM.length)}isFirstChunk=false;const length=buffer2.length;let position=0;let discardTrailingNewline=false;while(position<length){if(discardTrailingNewline){if(buffer2[position]===`
281
+ `}writeStdout(rendered);return outcome.kind==="expected-failure"||resultFailed(outcome.result)?1:0}if(outcome.kind==="expected-failure"){writeStdout(renderExpectedFailure(outcome.failure,humanEnvironment));return 1}writeStdout(renderOperationResult(outcome.result,humanEnvironment));return resultFailed(outcome.result)?1:0};var UpdateInteraction=Service("@punks/cli/features/scaffold-update/UpdateInteraction");class ScaffoldUpdateOperationFailure extends TaggedErrorClass()("@punks/cli/scaffold-update/ScaffoldUpdateOperationFailure",{cause:Defect(),message:String4,operation:Literal2("update-scaffold")}){}var ScaffoldUpdateOperations=Service("@punks/cli/features/scaffold-update/ScaffoldUpdateOperations");var runScaffoldUpdateApplication=fn2("ScaffoldUpdate.run")(function*runScaffoldUpdateApplication2(input){const interaction=yield*UpdateInteraction;const operations=yield*ScaffoldUpdateOperations;return yield*operations.run(input,interaction)});var desiredFilesByPath=(files)=>{const indexed=new Map;for(const file5 of files){indexed.set(file5.path,indexed.has(file5.path)?null:file5)}return indexed};var recoveryAction=({conflict,desired,fixedManagedPaths})=>{if(conflict._tag!=="UserModifiedScaffoldEntryConflict"||conflict.item!=="file"||conflict.operation!=="update"||!fixedManagedPaths.has(conflict.identity)){return null}const file5=desired.get(conflict.identity);return file5===undefined||file5===null?null:{_tag:"ArchiveAndReplaceScaffoldFile",desired:file5,identity:conflict.identity,item:"file"}};var planFixedManagedRecovery=({authority,fixedManagedPaths,plan})=>{if(authority._tag!=="VerifiedDesiredBaseline"){return plan}const desired=desiredFilesByPath(authority.files);const recoveries=new Map;for(const conflict of plan.conflicts){const action2=recoveryAction({conflict,desired,fixedManagedPaths});if(action2!==null){recoveries.set(conflict,action2)}}if(recoveries.size===0){return plan}return{...plan,actions:[...plan.actions,...recoveries.values()],conflicts:plan.conflicts.filter((conflict)=>!recoveries.has(conflict))}};import path7 from"node:path";var packCatalog=[{category:"surface",description:"Backend pack: domain structure, recoverable actions, and logging.",hooks:[],id:"backend",lintAssets:[],promptDetails:["shared backend domain baseline","workspace backend action/recovery guidance","workspace logging/observability guidance"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["backend-domain-structure","backend-recoverable-actions","logging-best-practices"],triggerPackages:[]},{category:"detected",description:"Better Auth guidance pack.",hooks:[],id:"better-auth",lintAssets:[],promptDetails:["shared auth guardrails","workspace auth boundaries"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["better-auth-best-practices"],triggerPackages:["better-auth"]},{category:"default",description:"Default debug pack: runtime debugging, ClawPatch bug discovery/resolution, and debug-agent workflow.",hooks:[],id:"debug",lintAssets:[],promptDetails:["shared runtime debugging baseline","workspace evidence-first debugging workflow"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["debugging-phase","bug-discovery-phase","bug-resolution-phase","debug-agent"],triggerPackages:[]},{category:"default",description:"Default docs pack: docs ingest plus public-doc and skill-writing primitives.",hooks:[],id:"docs",lintAssets:[],promptDetails:["shared docs baseline","public-doc writing flow","docs scope spec"],promptSurfaces:["shared-agents","root-prompt-spec","docs-prompt-spec"],skills:["docs-ingest-phase","docs-onboarding","writing-fragments","writing-beats","writing-shape","writing-for-agents","write-graph-based-skills","rule-authoring"],triggerPackages:[]},{category:"default",description:"Default misc pack: lightweight agent interaction helpers.",hooks:[],id:"misc",lintAssets:[],promptDetails:["shared agent interaction helpers"],promptSurfaces:["shared-agents"],skills:["handback","show-me","wait-what"],triggerPackages:[]},{category:"detected",description:"Drizzle guidance pack.",hooks:[],id:"drizzle",lintAssets:[],promptDetails:["shared data-layer baseline","workspace db flow rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:[],triggerPackages:["drizzle-kit","drizzle-orm"]},{category:"detected",description:"Effect guidance pack family.",exampleRepositories:[Object.fromEntries([["repo","AnswerOverflow/AnswerOverflow"],["url","https://github.com/AnswerOverflow/AnswerOverflow"],["packs",[{uid:"effect",version:"^3.20.0"}]]]),Object.fromEntries([["repo","rhyssullivan/executor"],["url","https://github.com/rhyssullivan/executor"],["packs",[{uid:"effect",version:"4.0.0-beta.59"}]]]),Object.fromEntries([["repo","alchemy-run/alchemy-effect"],["url","https://github.com/alchemy-run/alchemy-effect"],["packs",[{uid:"effect",version:">=4.0.0-beta.66 || >=4.0.0"}]]]),Object.fromEntries([["repo","anomalyco/opencode"],["url","https://github.com/anomalyco/opencode"],["packs",[{uid:"effect",version:"4.0.0-beta.65"}]]]),Object.fromEntries([["repo","pingdotgg/t3code"],["url","https://github.com/pingdotgg/t3code"],["packs",[{uid:"effect",version:"4.0.0-beta.59"}]]])],hooks:[],id:"effect",lintAssets:["effect-no-barrel-imports","effect-tsgo-recommended"],promptDetails:["shared Effect v4 patterns baseline","workspace backend topology and action-orchestration rules","workspace service qualification, Layer, and audit rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["effect","effect-backend-structure","effect-recoverable-actions","effect-service-design"],triggerPackages:["effect","@effect/"]},{category:"detected",description:"Elysia guidance pack.",hooks:[],id:"elysia",lintAssets:[],promptDetails:["shared api-server baseline","workspace route/plugin rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["elysiajs"],triggerPackages:["elysia"]},{category:"detected",description:"Expo guidance pack.",hooks:[],id:"expo",lintAssets:[],promptDetails:["shared expo baseline","workspace native app guidance"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["add-app-clip","animate-expo","building-native-ui","eas-simulator","eas-update-insights","expo-api-routes","expo-brownfield","expo-cicd-workflows","expo-deployment","expo-dev-client","expo-examples","expo-module","expo-observe","expo-skill-eval","expo-tailwind-setup","expo-ui","native-data-fetching","upgrading-expo","use-dom","web-to-native"],triggerPackages:["expo","@expo/"]},{category:"surface",description:"Frontend pack: agent-browser, animation authoring/review, design taste, image generation, frontend domain structure, and mobile-web improvement.",hooks:[],id:"frontend",lintAssets:[],promptDetails:["shared product-ui baseline","workspace UX/browser guidance","workspace frontend domain boundaries"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["agent-browser","animate","design-taste-frontend","imagegen-frontend-mobile","imagegen-frontend-web","frontend-domain-structure","improve-mobile-frontend","review-animations"],triggerPackages:[]},{category:"detected",description:"Next.js guidance pack.",hooks:[],id:"nextjs",lintAssets:["next-core"],promptDetails:["shared app-router baseline","workspace next rendering rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["next-best-practices","next-cache-components"],triggerPackages:["next"]},{category:"default",description:"Default planning pack: delivery phase, specs, plans, implementation, and debt resolution.",hooks:[],id:"planning",lintAssets:[],promptDetails:["shared planning baseline","workspace plan/spec execution rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["business-finder","finder-phase","functional-finder","technical-finder","wayfinder","prototype-phase","delivery-phase","design-phase","goalify","grilling","handoff","create-spec","create-plan","implement-spec","verify-behavior","repo-asset-management","resolve-debt-phase"],triggerPackages:[]},{category:"detected",description:"Pulumi guidance pack.",hooks:[],id:"pulumi",lintAssets:[],promptDetails:["shared pulumi baseline","workspace infrastructure-as-code guidance"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["pulumi-overview","pulumi-best-practices","pulumi-component","pulumi-automation-api","pulumi-esc","provider-upgrade","package-usage"],triggerPackages:["@pulumi/","@pulumi/pulumi"]},{category:"default",description:"Default quality pack: test-driven delivery, test-suite design, codebase design, and simplification.",hooks:[],id:"quality",lintAssets:["vitest-core"],promptDetails:["shared change-quality baseline","workspace test-suite and refactor expectations"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["tdd","make-tsuite","codebase-design","simplify"],triggerPackages:[]},{category:"detected",description:"React guidance pack.",hooks:[],id:"react",lintAssets:["react-core","react-you-might-not-need-an-effect"],promptDetails:["shared react structure baseline","workspace react composition rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["async-react-patterns","react-doctor","vercel-composition-patterns","vercel-react-best-practices"],triggerPackages:["react","react-dom"]},{category:"detected",description:"SQLAlchemy schema and Alembic migration guidance pack.",hooks:[],id:"sqlalchemy",lintAssets:[],promptDetails:["shared SQLAlchemy schema and migration baseline"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["sqlalchemy-schema-design"],triggerPackages:["sqlalchemy","alembic"]},{category:"default",description:"Default research pack: parallel research, prototypes, structured review, and architecture inspection.",hooks:[],id:"research",lintAssets:[],promptDetails:["shared investigation baseline","workspace research handoff rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["parallel-research","prototype","review-phase","review","autoreview","improve-codebase-architecture"],triggerPackages:[]},{category:"default",description:"Default requirements pack: requirements phase, grill, and backlog authoring.",hooks:[],id:"requirements",lintAssets:[],promptDetails:["shared requirements baseline","workspace backlog shaping rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["requirements-phase","requirements-grill","domain-modeling","repo-asset-management","write-backlog"],triggerPackages:[]},{category:"default",description:"Default security pack: pipeline architecture, CI audit review, application security best practices, and remediation guardrails.",hooks:[],id:"security",lintAssets:[],promptDetails:["shared security review baseline","evidence-first remediation routing","risk-aware approval discipline"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["architect-pipeline","audit-cicd-security","security-best-practices"],triggerPackages:[]},{category:"default",description:"Default subagents pack: swarm-planner.",hooks:[],id:"subagents",lintAssets:[],promptDetails:["shared delegation baseline","workspace ownership handoffs","subagent manifest scaffold"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec","subagent-manifest"],skills:["swarm-planner"],triggerPackages:[]},{category:"detected",description:"TanStack Query guidance pack.",hooks:[],id:"tanstack-query",lintAssets:["tanstack-query-core"],promptDetails:["shared tanstack query baseline","workspace server-state rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["tanstack-query"],triggerPackages:["@tanstack/react-query"]},{category:"detected",description:"tRPC guidance pack.",hooks:[],id:"trpc",lintAssets:[],promptDetails:["shared contract-first baseline","workspace client/server boundaries"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:[],triggerPackages:["@trpc/"]},{category:"detected",description:"Turborepo guidance pack.",hooks:[],id:"turborepo",lintAssets:[],promptDetails:["shared monorepo baseline","workspace task boundary rules"],promptSurfaces:["shared-agents","root-prompt-spec","workspace-prompt-spec"],skills:["turborepo"],triggerPackages:["turbo"]},{category:"language",description:"Shared Python language pack that compounds the agnostic backend domain base with Python import structure, async, style, testing, and design guidance.",hooks:["format-edited-file"],id:"python",lintAssets:[],promptDetails:[],promptSurfaces:[],skills:["async-python-patterns","backend-domain-structure","python-backend-structure","python-code-style","python-design-patterns","python-testing-patterns"],triggerPackages:[]},{category:"language",description:"Shared JavaScript / TypeScript language pack for hook and language-level scaffold assets.",hooks:["format-edited-file"],id:"typescript",lintAssets:["typescript-anti-slop"],promptDetails:[],promptSurfaces:[],skills:["quality-types"],triggerPackages:["typescript"]}];import{createHash as createHash3}from"node:crypto";import{existsSync as existsSync2,readdirSync as readdirSync2,readFileSync as readFileSync3,renameSync}from"node:fs";import path6 from"node:path";var exports_HttpApi={};__export(exports_HttpApi,{reflect:()=>reflect,make:()=>make37,isHttpApi:()=>isHttpApi,AdditionalSchemas:()=>AdditionalSchemas});var exports_HttpApiEndpoint={};__export(exports_HttpApiEndpoint,{put:()=>put3,post:()=>post3,patch:()=>patch3,options:()=>options3,make:()=>make36,isHttpApiEndpoint:()=>isHttpApiEndpoint,head:()=>head3,getSuccessSchemas:()=>getSuccessSchemas,getPayloadSchemas:()=>getPayloadSchemas,getErrorSchemas:()=>getErrorSchemas,get:()=>get7,delete:()=>del3});var exports_HttpApiSchema={};__export(exports_HttpApiSchema,{status:()=>status,isStreamUint8Array:()=>isStreamUint8Array,isStreamSse:()=>isStreamSse,isStreamSchema:()=>isStreamSchema,isNoContent:()=>isNoContent,getStatusSuccess:()=>getStatusSuccess,getStatusStream:()=>getStatusStream,getStatusError:()=>getStatusError,getResponseEncoding:()=>getResponseEncoding,getPayloadEncoding:()=>getPayloadEncoding,asUint8Array:()=>asUint8Array,asText:()=>asText,asNoContent:()=>asNoContent,asMultipartStream:()=>asMultipartStream,asMultipart:()=>asMultipart,asJson:()=>asJson,asFormUrlEncoded:()=>asFormUrlEncoded,StreamUint8Array:()=>StreamUint8Array,StreamSse:()=>StreamSse,NoContent:()=>NoContent,MultipartTypeId:()=>MultipartTypeId,MultipartStreamTypeId:()=>MultipartStreamTypeId,Empty:()=>Empty3,Created:()=>Created,Accepted:()=>Accepted});var statusCodeByLiteral={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,OK:200,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};var StreamSchemaTypeId="~effect/httpapi/HttpApiSchema/Stream";function status(code){const statusCode=typeof code==="string"?statusCodeByLiteral[code]:code;return(self)=>self.annotate({httpApiStatus:statusCode})}var Empty3=(code)=>Void2.pipe(status(code));var NoContent=Empty3(204);var Created=Empty3(201);var Accepted=Empty3(202);function asNoContent(options3){return(self)=>{return Void2.pipe(decodeTo2(toType2(self),transform2({decode:options3.decode,encode:constVoid})))}}var streamSchema=declare(isStream);var StreamSse=(options3)=>{const events=options3.events??(options3.data===undefined?undefined:Struct({id:UndefinedOr(String4),event:String4,data:fromJsonString2(options3.data)}));if(events===undefined){throw new Error("StreamSse requires either an events schema or a data schema")}return make18(streamSchema.ast,{[StreamSchemaTypeId]:StreamSchemaTypeId,_tag:"StreamSse",mode:"sse",sseMode:options3.events===undefined?"data":"events",contentType:options3.contentType??defaultStreamContentType("sse"),events,error:options3.error??Never2})};var StreamUint8Array=(options3)=>make18(streamSchema.ast,{[StreamSchemaTypeId]:StreamSchemaTypeId,_tag:"StreamUint8Array",mode:"uint8array",contentType:options3?.contentType??defaultStreamContentType("uint8array")});var isStreamSchema=(u)=>isSchema(u)&&hasProperty(u,StreamSchemaTypeId);var isStreamSse=(u)=>isStreamSchema(u)&&u._tag==="StreamSse";var isStreamUint8Array=(u)=>isStreamSchema(u)&&u._tag==="StreamUint8Array";function defaultStreamContentType(mode){switch(mode){case"sse":return"text/event-stream";case"uint8array":return"application/octet-stream"}}var MultipartTypeId="~effect/httpapi/HttpApiSchema/Multipart";function asMultipart(options3){return(self)=>self.pipe(brand2(MultipartTypeId)).annotate({"~httpApiEncoding":{_tag:"Multipart",mode:"buffered",contentType:defaultContentType("Multipart"),limits:options3}})}var MultipartStreamTypeId="~effect/httpapi/HttpApiSchema/MultipartStream";function asMultipartStream(options3){return(self)=>self.pipe(brand2(MultipartStreamTypeId)).annotate({"~httpApiEncoding":{_tag:"Multipart",mode:"stream",contentType:defaultContentType("Multipart"),limits:options3}})}function asNonMultipartEncoding(self,options3){return self.annotate({"~httpApiEncoding":{_tag:options3._tag,contentType:options3.contentType??defaultContentType(options3._tag)}})}function defaultContentType(_tag){switch(_tag){case"Multipart":return"multipart/form-data";case"Json":return"application/json";case"FormUrlEncoded":return"application/x-www-form-urlencoded";case"Uint8Array":return"application/octet-stream";case"Text":return"text/plain"}}function asJson(options3){return(self)=>asNonMultipartEncoding(self,{_tag:"Json",...options3})}function asFormUrlEncoded(options3){return(self)=>asNonMultipartEncoding(self,{_tag:"FormUrlEncoded",...options3})}function asText(options3){return(self)=>asNonMultipartEncoding(self,{_tag:"Text",...options3})}function asUint8Array(options3){return(self)=>asNonMultipartEncoding(self,{_tag:"Uint8Array",...options3})}var isNoContent=(ast)=>{if(isVoid(ast))return true;const encoded=toEncoded(ast);if(isVoid(encoded))return true;const target=ast.encoding?.[0].to;if(target===undefined)return false;return isVoid(target)};var resolveHttpApiEncoding=resolveAt2("~httpApiEncoding");var resolveHttpApiStatus=resolveAt2("httpApiStatus");var defaultJsonEncoding={_tag:"Json",contentType:"application/json"};var defaultUrlEncodedEncoding={_tag:"FormUrlEncoded",contentType:"application/x-www-form-urlencoded"};function getEncoding(ast){return resolveHttpApiEncoding(ast)??defaultJsonEncoding}function getPayloadEncoding(ast,method){const encoding=resolveHttpApiEncoding(ast);if(encoding)return encoding;return hasBody(method)?defaultJsonEncoding:defaultUrlEncodedEncoding}function getResponseEncoding(ast){const out=getEncoding(ast);if(out._tag==="Multipart"){throw new Error("Multipart is not supported in response")}return out}function getStatusSuccess(self){return resolveHttpApiStatus(self)??200}function getStatusStream(self){return getStatusSuccess(self.ast)}function getStatusError(self){return resolveHttpApiStatus(self)??500}function normalize(contentType){const normalized=contentType.toLowerCase().trim();const index=normalized.indexOf(";");return index===-1?normalized:normalized.slice(0,index).trim()}var TypeId46="~effect/httpapi/HttpApiEndpoint";var isHttpApiEndpoint=(u)=>hasProperty(u,TypeId46);function getPayloadSchemas(endpoint){const result3=[];for(const{schemas}of endpoint.payload.values()){result3.push(...schemas)}return result3}function getSuccessSchemas(endpoint){const schemas=Array.from(endpoint.success);return isArrayNonEmpty2(schemas)?schemas:[NoContent]}function getErrorSchemas(endpoint){const schemas=new Set(endpoint.error);for(const middleware2 of endpoint.middlewares){const key=middleware2;for(const schema2 of key.error){schemas.add(schema2)}}return Array.from(schemas)}var Proto15={[TypeId46]:TypeId46,pipe(){return pipeArguments(this,arguments)},prefix(prefix){return makeProto({...optionsFromEndpoint(this),path:prefixPath(this.path,prefix)})},middleware(middleware2){return makeProto({...optionsFromEndpoint(this),middlewares:new Set([...this.middlewares,middleware2])})},annotate(key,value3){return makeProto({...optionsFromEndpoint(this),annotations:add(this.annotations,key,value3)})},annotateMerge(annotations){return makeProto({...optionsFromEndpoint(this),annotations:merge(this.annotations,annotations)})}};var optionsFromEndpoint=(endpoint)=>({identifier:endpoint.identifier,path:endpoint.path,method:endpoint.method,params:endpoint.params,query:endpoint.query,headers:endpoint.headers,payload:endpoint.payload,success:endpoint.success,error:endpoint.error,annotations:endpoint.annotations,middlewares:endpoint.middlewares});function makeProto(options3){function HttpApiEndpoint(){}Object.setPrototypeOf(HttpApiEndpoint,Proto15);return Object.assign(HttpApiEndpoint,options3)}var make36=(method)=>(identifier2,path4,options3)=>{const disableCodecs=options3?.disableCodecs??false;const transformStringTree=disableCodecs?identity:toCodecStringTree;return makeProto({identifier:identifier2,path:path4,method,params:ensureStruct(options3?.params,transformStringTree),query:ensureStruct(options3?.query,transformStringTree),headers:ensureStruct(options3?.headers,transformStringTree),payload:getPayload(options3?.payload,method,disableCodecs),success:getSuccessResponse(options3?.success,method,disableCodecs),error:getErrorResponse(options3?.error,disableCodecs),annotations:empty(),middlewares:new Set})};function ensureStruct(params,transform6){if(params===undefined)return;if(isSchema(params))return transform6(params);return transform6(Struct(params))}function getPayload(payload,method,disableCodecs){const result3=new Map;if(payload===undefined)return result3;const schemas=Array.isArray(payload)?payload:isSchema(payload)?[payload]:[Struct(payload).pipe(asFormUrlEncoded())];const transform6=disableCodecs?identity:transformPayload;for(const schema2 of schemas){const encoding=getPayloadEncoding(schema2.ast,method);const contentType=normalize(encoding.contentType);const existing=result3.get(contentType);if(existing){if(existing.encoding._tag!==encoding._tag){throw new Error(`Multiple payload encodings for content-type: ${encoding.contentType}`)}if(existing.encoding._tag==="Multipart"){throw new Error(`Multiple multipart payloads for content-type: ${encoding.contentType}`)}existing.schemas.push(transform6(schema2,method))}else{result3.set(contentType,{encoding,schemas:[transform6(schema2,method)]})}}return result3}var reservedStreamFailureEvent="effect/httpapi/stream/failure";function getSuccessResponse(success,method,disableCodecs){if(success===undefined)return new Set;const schemas=ensure(success);validateSuccessResponse(schemas,method);return new Set(disableCodecs?schemas:schemas.map((schema2)=>isStreamSchema(schema2)?schema2:transformResponse2(schema2)))}function getErrorResponse(error2,disableCodecs){if(error2===undefined)return new Set;const schemas=ensure(error2);for(const schema2 of schemas){if(isStreamSchema(schema2)){throw new Error("Streaming schemas are not supported in error responses")}}return new Set(disableCodecs?schemas:schemas.map(transformResponse2))}function validateSuccessResponse(schemas,method){const statuses=new Map;for(const schema2 of schemas){if(isStreamSchema(schema2)){validateStreamSuccess(schema2,method);const status2=getStatusStream(schema2);const entry=getStatusEntry(statuses,status2);if(entry.stream!==undefined){throw new Error(`Multiple streaming success responses for status: ${status2}`)}if(entry.noContent){throw new Error(`Cannot combine no-content and streaming success responses for status: ${status2}`)}if(entry.bufferedContentTypes.has(normalize(schema2.contentType))){throw new Error(`Cannot combine buffered and streaming success responses for status ${status2} and content-type: ${schema2.contentType}`)}statuses.set(status2,{...entry,stream:schema2})}else{const status2=getStatusSuccess(schema2.ast);const entry=getStatusEntry(statuses,status2);const noContent=isNoContent(schema2.ast);if(entry.stream!==undefined){if(noContent){throw new Error(`Cannot combine no-content and streaming success responses for status: ${status2}`)}const encoding=getResponseEncoding(schema2.ast);if(normalize(encoding.contentType)===normalize(entry.stream.contentType)){throw new Error(`Cannot combine buffered and streaming success responses for status ${status2} and content-type: ${encoding.contentType}`)}}if(!noContent){entry.bufferedContentTypes.add(normalize(getResponseEncoding(schema2.ast).contentType))}entry.noContent=entry.noContent||noContent}}}function getStatusEntry(statuses,status2){let entry=statuses.get(status2);if(entry===undefined){entry={bufferedContentTypes:new Set,noContent:false};statuses.set(status2,entry)}return entry}function validateStreamSuccess(schema2,method){if(method==="HEAD"){throw new Error("HEAD endpoints cannot declare streaming success responses")}if(isStreamSse(schema2)&&hasReservedSseEventName(schema2.events.ast)){throw new Error(`SSE event name is reserved: ${reservedStreamFailureEvent}`)}}function hasReservedSseEventName(ast){return hasReservedEventName(toEncoded(ast),new Set)}function hasReservedEventName(ast,seen){if(seen.has(ast))return false;seen.add(ast);if(isUnion(ast)){return ast.types.some((type)=>hasReservedEventName(type,seen))}if(isSuspend(ast)){return hasReservedEventName(ast.thunk(),seen)}if(!isObjects(ast))return false;const event=ast.propertySignatures.find((ps)=>ps.name==="event");return event!==undefined&&hasReservedEventLiteral(event.type,seen)}function hasReservedEventLiteral(ast,seen){if(seen.has(ast))return false;seen.add(ast);const encoded=toEncoded(ast);if(encoded!==ast){return hasReservedEventLiteral(encoded,seen)}if(isLiteral(ast)){return ast.literal===reservedStreamFailureEvent}if(isUnion(ast)){return ast.types.some((type)=>hasReservedEventLiteral(type,seen))}if(isSuspend(ast)){return hasReservedEventLiteral(ast.thunk(),seen)}return false}function transformResponse2(schema2){const encoding=getResponseEncoding(schema2.ast);switch(encoding._tag){case"Json":return toCodecJson(schema2);case"FormUrlEncoded":return toCodecStringTree(schema2);case"Text":case"Uint8Array":return schema2}}function transformPayload(schema2,method){const encoding=getPayloadEncoding(schema2.ast,method);switch(encoding._tag){case"Json":return toCodecJson(schema2);case"FormUrlEncoded":return toCodecStringTree(schema2);case"Text":case"Uint8Array":case"Multipart":return schema2}}var get7=make36("GET");var post3=make36("POST");var put3=make36("PUT");var patch3=make36("PATCH");var del3=make36("DELETE");var head3=make36("HEAD");var options3=make36("OPTIONS");var TypeId47="~effect/httpapi/HttpApi";var isHttpApi=(u)=>hasProperty(u,TypeId47);var Proto16={[TypeId47]:TypeId47,pipe(){return pipeArguments(this,arguments)},add(...toAdd){const groups={...this.groups};for(const group of toAdd){set(groups,group.identifier,group)}return makeProto2({...optionsFromApi(this),groups})},addHttpApi(api){const newGroups={...this.groups};for(const key in api.groups){const group=api.groups[key];set(newGroups,key,group.annotateMerge(merge(api.annotations,group.annotations)))}return makeProto2({...optionsFromApi(this),groups:newGroups})},prefix(prefix){return makeProto2({...optionsFromApi(this),groups:map2(this.groups,(group)=>group.prefix(prefix))})},middleware(tag2){return makeProto2({...optionsFromApi(this),groups:map2(this.groups,(group)=>group.middleware(tag2))})},annotate(key,value3){return makeProto2({...optionsFromApi(this),annotations:add(this.annotations,key,value3)})},annotateMerge(annotations){return makeProto2({...optionsFromApi(this),annotations:merge(this.annotations,annotations)})}};var optionsFromApi=(api)=>({identifier:api.identifier,groups:api.groups,annotations:api.annotations});var makeProto2=(options4)=>{function HttpApi(){}Object.setPrototypeOf(HttpApi,Proto16);return Object.assign(HttpApi,options4)};var make37=(identifier2)=>makeProto2({identifier:identifier2,groups:{},annotations:empty()});var reflect=(self,options4)=>{const groups=Object.values(self.groups);for(const group of groups){const groupAnnotations=merge(self.annotations,group.annotations);options4.onGroup({group,mergedAnnotations:groupAnnotations});const endpoints=Object.values(group.endpoints);for(const endpoint of endpoints){if(options4.predicate&&!options4.predicate({endpoint,group}))continue;options4.onEndpoint({group,endpoint,middleware:endpoint.middlewares,mergedAnnotations:merge(groupAnnotations,endpoint.annotations),successes:extractResponseContent(getSuccessSchemas(endpoint),getStatusSuccess),errors:extractResponseContent(getErrorSchemas(endpoint),getStatusError)})}}};var extractResponseContent=(schemas,getStatus)=>{const map15=new Map;schemas.forEach(add2);return map15;function add2(schema2){if(isStreamSchema(schema2))return;const ast=schema2.ast;const status2=getStatus(ast);const schemas2=map15.get(status2);if(schemas2===undefined){map15.set(status2,[schema2])}else{schemas2.push(schema2)}}};class AdditionalSchemas extends Service()("effect/httpapi/HttpApi/AdditionalSchemas"){}var decode=(schema2)=>()=>{const decode2=decodeEffect2(NonEmptyArray(schema2));return fromTransform((upstream,_scope)=>succeed6(flatMap3(upstream,(chunk)=>decode2(chunk))))};var decode2=()=>fromTransform((upstream,_scope)=>sync2(()=>{let buffer2=[];let retry5;const parser2=makeParser2((event)=>{if(event._tag==="Retry"){retry5=event}else{buffer2.push(event)}});const pump=flatMap3(upstream,(arr)=>{for(let i=0;i<arr.length;i++){parser2.feed(arr[i])}return void_3});return suspend2(function loop(){if(isArrayNonEmpty2(buffer2)){const out=buffer2;buffer2=[];return succeed6(out)}else if(retry5){return fail6(retry5)}return flatMap3(pump,loop)})}));var decodeSchema=(schema2)=>pipeTo(decode2(),decode(EventEncoded.pipe(decodeTo2(schema2)))());function makeParser2(onParse){let isFirstChunk;let buffer2;let startingPosition;let startingFieldLength;let eventId;let lastEventId;let eventName;let data;reset3();return{feed,reset:reset3};function reset3(){isFirstChunk=true;buffer2="";startingPosition=0;startingFieldLength=-1;eventId=undefined;eventName=undefined;data=""}function feed(chunk){buffer2=buffer2?buffer2+chunk:chunk;if(isFirstChunk&&hasBom(buffer2)){buffer2=buffer2.slice(BOM.length)}isFirstChunk=false;const length=buffer2.length;let position=0;let discardTrailingNewline=false;while(position<length){if(discardTrailingNewline){if(buffer2[position]===`
282
282
  `){++position}discardTrailingNewline=false}let lineLength=-1;let fieldLength=startingFieldLength;let character;for(let index=startingPosition;lineLength<0&&index<length;++index){character=buffer2[index];if(character===":"&&fieldLength<0){fieldLength=index-position}else if(character==="\r"){discardTrailingNewline=true;lineLength=index-position}else if(character===`
283
283
  `){lineLength=index-position}}if(lineLength<0){startingPosition=length-position;startingFieldLength=fieldLength;break}else{startingPosition=0;startingFieldLength=-1}parseEventStreamLine(buffer2,position,fieldLength,lineLength);position+=lineLength+1}if(position===length){buffer2=""}else if(position>0){buffer2=buffer2.slice(position)}}function parseEventStreamLine(lineBuffer,index,fieldLength,lineLength){if(lineLength===0){if(data.length>0){onParse({_tag:"Event",id:eventId,event:eventName??"message",data:data.slice(0,-1)});data="";eventId=undefined}eventName=undefined;return}const noValue=fieldLength<0;const field=lineBuffer.slice(index,index+(noValue?lineLength:fieldLength));let step=0;if(noValue){step=lineLength}else if(lineBuffer[index+fieldLength+1]===" "){step=fieldLength+2}else{step=fieldLength+1}const position=index+step;const valueLength=lineLength-step;const value3=lineBuffer.slice(position,position+valueLength).toString();if(field==="data"){data+=value3?`${value3}
284
284
  `:`
285
- `}else if(field==="event"){eventName=value3}else if(field==="id"&&!value3.includes("\x00")){eventId=value3;lastEventId=value3}else if(field==="retry"){const retry5=parseInt(value3,10);if(!Number.isNaN(retry5)){onParse(new Retry({duration:millis(retry5),lastEventId}))}}}}var BOM=[239,187,191];function hasBom(buffer2){return BOM.every((charCode,index)=>buffer2.charCodeAt(index)===charCode)}var EventEncoded=Struct({id:optional(String4),event:String4,data:String4});var RetryTypeId="~effect/encoding/Sse/Retry";class Retry extends TaggedClass("Retry"){[RetryTypeId]=RetryTypeId;static is(u){return hasProperty(u,RetryTypeId)}static filter(u){return Retry.is(u)?succeed2(u):fail2(u)}}var SecurityTypeId="~effect/httpapi/HttpApiMiddleware/Security";var isSecurity=(u)=>hasProperty(u,SecurityTypeId);var exports_OpenApi={};__export(exports_OpenApi,{fromApi:()=>fromApi,annotations:()=>annotations,Version:()=>Version2,Transform:()=>Transform,Title:()=>Title,Summary:()=>Summary,Servers:()=>Servers,Override:()=>Override,License:()=>License,Identifier:()=>Identifier,Format:()=>Format,ExternalDocs:()=>ExternalDocs,Exclude:()=>Exclude,Description:()=>Description,Deprecated:()=>Deprecated});var toJsonAnnotationsBlacklist=new Set([...fromASTBlacklist,"expected","contentMediaType","contentSchema"]);var fromASTs2=fromASTs;var toJsonSchemaMultiDocument2=toJsonSchemaMultiDocument;var toCodeAnnotationsBlacklist=new Set([...toJsonAnnotationsBlacklist,"typeConstructor","generation","brands"]);class Identifier extends Service()("effect/httpapi/OpenApi/Identifier"){}class Title extends Service()("effect/httpapi/OpenApi/Title"){}class Version2 extends Service()("effect/httpapi/OpenApi/Version"){}class Description extends Service()("effect/httpapi/OpenApi/Description"){}class License extends Service()("effect/httpapi/OpenApi/License"){}class ExternalDocs extends Service()("effect/httpapi/OpenApi/ExternalDocs"){}class Servers extends Service()("effect/httpapi/OpenApi/Servers"){}class Format extends Service()("effect/httpapi/OpenApi/Format"){}class Summary extends Service()("effect/httpapi/OpenApi/Summary"){}class Deprecated extends Service()("effect/httpapi/OpenApi/Deprecated"){}class Override extends Service()("effect/httpapi/OpenApi/Override"){}var Exclude=Reference("effect/httpapi/OpenApi/Exclude",{defaultValue:constFalse});class Transform extends Service()("effect/httpapi/OpenApi/Transform"){}var servicesPartial=(tags)=>{const entries=Object.entries(tags);return(options4)=>{let context3=empty();for(const[key,tag2]of entries){if(options4[key]!==undefined){context3=add(context3,tag2,options4[key])}}return context3}};var annotations=servicesPartial({identifier:Identifier,title:Title,version:Version2,description:Description,license:License,summary:Summary,deprecated:Deprecated,externalDocs:ExternalDocs,servers:Servers,format:Format,override:Override,exclude:Exclude,transform:Transform});var apiCache=new WeakMap;function processAnnotation(ctx,annotation,f){const o=getOption(ctx,annotation);if(isSome2(o)){f(o.value)}}function fromApi(api){const cached3=apiCache.get(api);if(cached3!==undefined){return cached3}let spec={openapi:"3.1.0",info:{title:"Api",version:"0.0.1"},paths:{},components:{schemas:{},securitySchemes:{}},security:[],tags:[]};const pathOps=[];const pathOperations=new Set;const operationIds=new Set;processAnnotation(api.annotations,Title,(title)=>{spec.info.title=title});processAnnotation(api.annotations,Version2,(version2)=>{spec.info.version=version2});processAnnotation(api.annotations,Description,(description)=>{spec.info.description=description});processAnnotation(api.annotations,License,(license)=>{spec.info.license=license});processAnnotation(api.annotations,Summary,(summary)=>{spec.info.summary=summary});processAnnotation(api.annotations,Servers,(servers)=>{spec.servers=[...servers]});reflect(api,{onGroup({group}){if(get(group.annotations,Exclude)){return}let tag2={name:getOrElse2(group.annotations,Title,()=>group.identifier)};processAnnotation(group.annotations,Description,(description)=>{tag2.description=description});processAnnotation(group.annotations,ExternalDocs,(externalDocs)=>{tag2.externalDocs=externalDocs});processAnnotation(group.annotations,Override,(override)=>{Object.assign(tag2,override)});processAnnotation(group.annotations,Transform,(transformFn)=>{tag2=transformFn(tag2)});spec.tags.push(tag2)},onEndpoint({endpoint,group,mergedAnnotations,middleware:middleware2}){if(get(mergedAnnotations,Exclude)){return}let op={tags:[getOrElse2(group.annotations,Title,()=>group.identifier)],operationId:getOrElse2(endpoint.annotations,Identifier,()=>group.topLevel?endpoint.identifier:`${group.identifier}.${endpoint.identifier}`),parameters:[],security:[],responses:{}};const path4=endpoint.path.replace(/:(\w+)\??/g,"{$1}");const method=endpoint.method.toLowerCase();function processResponseBodies(bodies,defaultDescription){for(const[status2,{content,descriptions,streamContent}]of bodies){const description=descriptions.size>0?Array.from(descriptions).join(" | "):defaultDescription();op.responses[status2]={description};if(content!==undefined){content.forEach((map15,encoding)=>{map15.forEach((schemas,contentType)=>{const asts=Array.from(schemas,getAST);const ast=asts.length===1?asts[0]:new Union(asts,"anyOf");pathOps.push({_tag:"schema",ast:toEncodingAST(ast,encoding),path:["paths",path4,method,"responses",String(status2),"content",contentType,"schema"]});op.responses[status2].content??={};op.responses[status2].content[contentType]={schema:{}}})})}if(streamContent!==undefined){streamContent.forEach((stream2,contentType)=>{op.responses[status2].content??={};if(isStreamSse(stream2)){pathOps.push({_tag:"schema",ast:getAST(stream2.events),path:["paths",path4,method,"responses",String(status2),"content",contentType,"schema"]});pathOps.push({_tag:"schema",ast:getAST(toCodecJson(Cause(stream2.error,Defect()))),path:["paths",path4,method,"responses",String(status2),"content",contentType,"x-effect-stream","causeSchema"]});pathOps.push({_tag:"schema",ast:getAST(stream2.error),path:["paths",path4,method,"responses",String(status2),"content",contentType,"x-effect-stream","errorSchema"]});op.responses[status2].content[contentType]={schema:{},"x-effect-stream":{encoding:"sse",causeSchema:{},errorSchema:{},failureEvent:reservedStreamFailureEvent2}}}else{op.responses[status2].content[contentType]={schema:{type:"string",format:"binary"},"x-effect-stream":{encoding:"uint8array"}}}})}}}function processParameters(schema2,i){if(schema2){const ast=getLastEncoding(schema2.ast);if(isObjects(ast)){for(const ps of ast.propertySignatures){op.parameters.push({name:String(ps.name),in:i,schema:{},required:i==="path"||!isOptional(ps.type)});pathOps.push({_tag:"parameter",ast:ps.type,path:["paths",path4,method,"parameters",String(op.parameters.length-1),"schema"]})}}}}processAnnotation(endpoint.annotations,Description,(description)=>{op.description=description});processAnnotation(endpoint.annotations,Summary,(summary)=>{op.summary=summary});processAnnotation(endpoint.annotations,Deprecated,(deprecated)=>{op.deprecated=deprecated});processAnnotation(endpoint.annotations,ExternalDocs,(externalDocs)=>{op.externalDocs=externalDocs});middleware2.forEach((middleware3)=>{if(!isSecurity(middleware3)){return}for(const[name,security]of Object.entries(middleware3.security)){processHttpApiSecurity(name,security);op.security.push({[name]:[]})}});function processHttpApiSecurity(name,security){const scheme=makeSecurityScheme(security);if(!Object.hasOwn(spec.components.securitySchemes,name)){set(spec.components.securitySchemes,name,scheme);return}if(!equals(securitySchemeForComparison(spec.components.securitySchemes[name]),securitySchemeForComparison(scheme))){throw new globalThis.Error(`Conflicting OpenAPI security scheme: ${name}`)}}const hasBody2=hasBody(endpoint.method);if(hasBody2){const schemasByContentType=new Map;for(const schema2 of getPayloadSchemas(endpoint)){if(isNoContent(schema2.ast))continue;const encoding=getPayloadEncoding(schema2.ast,endpoint.method);const existing=schemasByContentType.get(encoding.contentType);if(existing===undefined){schemasByContentType.set(encoding.contentType,{encoding,schemas:[schema2]})}else{existing.schemas.push(schema2)}}if(schemasByContentType.size>0){const content={};for(const[contentType,{encoding,schemas}]of schemasByContentType){const asts=schemas.map(getAST);const ast=asts.length===1?asts[0]:new Union(asts,"anyOf");pathOps.push({_tag:"schema",ast:toEncodingAST(ast,encoding._tag),path:["paths",path4,method,"requestBody","content",contentType,"schema"]});content[contentType]={schema:{}}}op.requestBody={content,required:true}}}processParameters(endpoint.params,"path");if(!hasBody2&&endpoint.payload.size===1){const entry=endpoint.payload.values().next().value;processParameters(entry.schemas[0],"query")}processParameters(endpoint.headers,"header");processParameters(endpoint.query,"query");processResponseBodies(extractSuccessResponseBodies(endpoint),()=>"Success");processResponseBodies(extractResponseBodies(getErrorSchemas(endpoint),getStatusError,resolveDescriptionOrIdentifier),()=>"Error");processAnnotation(endpoint.annotations,Override,(override)=>{Object.assign(op,override)});processAnnotation(endpoint.annotations,Transform,(transformFn)=>{op=transformFn(op)});const pathOperation=`${method} ${path4.replace(/\{[^}]+\}/g,"{}")}`;if(pathOperations.has(pathOperation)){throw new globalThis.Error(`Duplicate OpenAPI operation for ${endpoint.method} ${path4}`)}const operationId=op.operationId;if(operationId!==undefined){if(operationIds.has(operationId)){throw new globalThis.Error(`Duplicate OpenAPI operationId: ${operationId}`)}operationIds.add(operationId)}pathOperations.add(pathOperation);if(!spec.paths[path4]){spec.paths[path4]={}}spec.paths[path4][method]=op}});processAnnotation(api.annotations,AdditionalSchemas,(componentSchemas)=>{componentSchemas.forEach((componentSchema)=>{const identifier2=resolveIdentifier2(componentSchema.ast);if(identifier2!==undefined){if(identifier2 in spec.components.schemas){throw new globalThis.Error(`Duplicate component schema identifier: ${identifier2}`)}spec.components.schemas[identifier2]={};pathOps.push({_tag:"schema",ast:componentSchema.ast,path:["components","schemas",identifier2]})}})});function escapePath(path4){return"/"+path4.map(escapeToken).join("/")}if(isArrayNonEmpty2(pathOps)){const multiDocument=fromASTs2(map3(pathOps,(op)=>op.ast));const jsonSchemaMultiDocument=toMultiDocumentOpenApi3_1(toJsonSchemaMultiDocument2(multiDocument));const patchOps=pathOps.map((op,i)=>{const oppath=escapePath(op.path);const value3=jsonSchemaMultiDocument.schemas[i];return{op:"replace",path:oppath,value:value3}});Object.entries(jsonSchemaMultiDocument.definitions).forEach(([name,definition])=>{patchOps.push({op:"add",path:escapePath(["components","schemas",name]),value:definition})});spec=apply(patchOps,spec)}Object.keys(spec.components.schemas).forEach((key)=>{if(!VALID_OPEN_API_COMPONENTS_SCHEMAS_KEY_REGEXP.test(key)){throw new globalThis.Error(`Invalid component schema key: ${key}`)}});processAnnotation(api.annotations,Override,(override)=>{Object.assign(spec,override)});processAnnotation(api.annotations,Transform,(transformFn)=>{spec=transformFn(spec)});apiCache.set(api,spec);return spec}var reservedStreamFailureEvent2="effect/httpapi/stream/failure";function extractSuccessResponseBodies(endpoint){return extractResponseBodies(getSuccessSchemas(endpoint),getStatusSuccess,resolveDescriptionOrIdentifier)}function extractResponseBodies(schemas,getStatus,getDescription){const map15=new Map;schemas.forEach(process2);return map15;function process2(schema2){if(isStreamSchema(schema2)){addStreamContent(schema2);return}const ast=schema2.ast;const status2=getStatus(ast);if(isNoContent(ast)){addNoContent(status2,getDescription(schema2.ast)??"<No Content>")}else{addContent(schema2,status2,getResponseEncoding(ast))}}function addNoContent(status2,description){const statusMap=map15.get(status2);if(statusMap===undefined){map15.set(status2,{descriptions:new Set([description]),content:undefined,streamContent:undefined})}else{if(description!==undefined){statusMap.descriptions.add(description)}}}function addContent(schema2,status2,encoding){const description=getDescription(schema2.ast);const statusMap=map15.get(status2);const{_tag,contentType}=encoding;if(statusMap===undefined){map15.set(status2,{descriptions:new Set(description!==undefined?[description]:[]),content:new Map([[_tag,new Map([[contentType,new Set([schema2])]])]]),streamContent:undefined})}else{if(description!==undefined){statusMap.descriptions.add(description)}if(statusMap.content===undefined){statusMap.content=new Map([[_tag,new Map([[contentType,new Set([schema2])]])]])}else{const schemasByContentType=statusMap.content.get(_tag);if(schemasByContentType===undefined){statusMap.content.set(_tag,new Map([[contentType,new Set([schema2])]]))}else{const set5=schemasByContentType.get(contentType);if(set5===undefined){schemasByContentType.set(contentType,new Set([schema2]))}else{set5.add(schema2)}}}}}function addStreamContent(stream2){const status2=getStatusStream(stream2);const statusMap=map15.get(status2);if(statusMap===undefined){map15.set(status2,{descriptions:new Set,content:undefined,streamContent:new Map([[stream2.contentType,stream2]])})}else if(statusMap.streamContent===undefined){statusMap.streamContent=new Map([[stream2.contentType,stream2]])}else{statusMap.streamContent.set(stream2.contentType,stream2)}}}function resolveDescriptionOrIdentifier(ast){return resolveDescription2(ast)??resolveIdentifier2(ast)}var Uint8ArrayEncoding=String4.annotate({format:"binary"});function toEncodingAST(ast,_tag){switch(_tag){case"Uint8Array":return Uint8ArrayEncoding.ast;case"Text":return String4.ast;case"FormUrlEncoded":case"Json":return ast;case"Multipart":return persistedFileToBinaryEncoding(ast)}}function persistedFileToBinaryEncoding(ast){if(isDeclaration(ast)&&ast.annotations?.typeConstructor?._tag==="effect/http/PersistedFile"){return Uint8ArrayEncoding.ast}if(typeof ast?.recur==="function"){return ast.recur(persistedFileToBinaryEncoding)}return ast}var makeSecurityScheme=(security)=>{const meta={};processAnnotation(security.annotations,Description,(description)=>{meta.description=description});switch(security._tag){case"Basic":{return{...meta,type:"http",scheme:"basic"}}case"Http":{const format3=getOption(security.annotations,Format).pipe(map((format4)=>({bearerFormat:format4})),getOrUndefined);return{...meta,type:"http",scheme:security.scheme,...format3}}case"ApiKey":{return{...meta,type:"apiKey",name:security.key,in:security.in}}}};var securitySchemeForComparison=(scheme)=>{if(scheme.type==="http"){return{...scheme,scheme:scheme.scheme.toLowerCase()}}if(scheme.in==="header"){return{...scheme,name:scheme.name.toLowerCase()}}return scheme};var exports_HttpApiClient={};__export(exports_HttpApiClient,{urlBuilder:()=>urlBuilder,makeWith:()=>makeWith3,makeClient:()=>makeClient,make:()=>make38,group:()=>group,endpoint:()=>endpoint});var makeClient=(api,options4)=>gen2(function*(){const services=yield*context2();const httpClient=options4.httpClient.pipe(options4?.baseUrl===undefined?identity:mapRequest(prependUrl(options4.baseUrl.toString())));function executeMiddleware(group,endpoint,request,middlewareKeys,index){if(index===-1){return httpClient.execute(request)}const middleware2=services.mapUnsafe.get(middlewareKeys[index]);if(middleware2===undefined){return executeMiddleware(group,endpoint,request,middlewareKeys,index-1)}return middleware2({endpoint,group,request,next(request2){return executeMiddleware(group,endpoint,request2,middlewareKeys,index-1)}})}reflect(api,{predicate:options4?.predicate,onGroup(onGroupOptions){options4.onGroup?.(onGroupOptions)},onEndpoint(onEndpointOptions){const{group,endpoint,errors:errors2,successes}=onEndpointOptions;const makeUrl=compilePath(endpoint.path);const decodeMap={orElse:statusOrElse};const decodeResponse=matchStatus(decodeMap);const errorAlternatives=new Map;for(const[status2,schemas]of errors2.entries()){const grouped=groupSchemasByContentType(schemas);for(const[contentType,schemas2]of grouped.entries()){addResponseAlternative(errorAlternatives,status2,contentType,schemasToResponse(schemas2))}}for(const[status2,alternatives]of errorAlternatives.entries()){const decode3=makeResponseDecoder(alternatives);decodeMap[status2]=(response)=>flatMap3(catchCause2(decode3(response),(cause)=>failCause3(combine2(fail5(new HttpClientError({reason:new StatusCodeError({request:response.request,response})})),cause))),fail6)}const successAlternatives=new Map;for(const[status2,schemas]of successes.entries()){const grouped=groupSchemasByContentType(schemas);for(const[contentType,schemas2]of grouped.entries()){addResponseAlternative(successAlternatives,status2,contentType,schemasToResponse(schemas2))}}for(const streamSuccess of getStreamSuccessSchemas(endpoint)){addResponseAlternative(successAlternatives,getStatusStream(streamSuccess),streamSuccess.contentType,streamToResponse(streamSuccess))}for(const[status2,alternatives]of successAlternatives.entries()){decodeMap[status2]=makeResponseDecoder(alternatives)}const encodeParams=map10(endpoint.params,encodeUnknownEffect2);const payloadSchemas=getPayloadSchemas(endpoint);const encodePayload=isArrayNonEmpty2(payloadSchemas)?hasBody(endpoint.method)?encodeUnknownEffect2(getEncodePayloadSchema(payloadSchemas,endpoint.method)):encodeUnknownEffect2(Union2(payloadSchemas)):undefined;const encodeHeaders=map10(endpoint.headers,encodeUnknownEffect2);const encodeQuery=map10(endpoint.query,encodeUnknownEffect2);const middlewareKeys=Array.from(onEndpointOptions.middleware,(tag2)=>`${tag2.key}/Client`);const endpointFn=fnUntraced2(function*(request){let httpRequest=make34(endpoint.method)(endpoint.path);if(request!==undefined){if(encodeParams!==undefined){const params=yield*encodeParams(request.params);httpRequest=setUrl(httpRequest,makeUrl(params))}if(encodePayload!==undefined){if(hasBody(endpoint.method)){if(request.payload instanceof FormData){httpRequest=bodyFormData(httpRequest,request.payload)}else{const body=yield*encodePayload(request.payload);httpRequest=setBody(httpRequest,body)}}else{const urlParams2=yield*encodePayload(request.payload);httpRequest=appendUrlParams(httpRequest,urlParams2)}}if(encodeHeaders!==undefined){const headers=yield*encodeHeaders(request.headers);httpRequest=setHeaders(httpRequest,headers)}if(encodeQuery!==undefined){const query=yield*encodeQuery(request.query);httpRequest=appendUrlParams(httpRequest,query)}}const response=yield*executeMiddleware(group,endpoint,httpRequest,middlewareKeys,middlewareKeys.length-1);if(request?.responseMode==="response-only"){return response}const value3=yield*options4.transformResponse===undefined?decodeResponse(response):options4.transformResponse(decodeResponse(response));return request?.responseMode==="decoded-and-response"?[value3,response]:value3});options4.onEndpoint({...onEndpointOptions,endpointFn})}})});var make38=(api,options4)=>flatMap3(HttpClient,(httpClient)=>makeWith3(api,{...options4,httpClient:options4?.transformClient?options4.transformClient(httpClient):httpClient}));var makeWith3=(api,options4)=>{const client={};return makeClient(api,{...options4,onGroup({group}){if(group.topLevel)return;set(client,group.identifier,{})},onEndpoint({endpoint,endpointFn,group}){set(group.topLevel?client:client[group.identifier],endpoint.identifier,endpointFn)}}).pipe(as2(client))};var group=(api,options4)=>{const client={};return makeClient(api,{...options4,predicate:({group:group2})=>group2.identifier===options4.group,onEndpoint({endpoint,endpointFn}){set(client,endpoint.identifier,endpointFn)}}).pipe(map6(()=>client))};var endpoint=(api,options4)=>{let client=undefined;return makeClient(api,{...options4,httpClient:options4.transformClient?options4.transformClient(options4.httpClient):options4.httpClient,predicate:({endpoint:endpoint2,group:group2})=>group2.identifier===options4.group&&endpoint2.identifier===options4.endpoint,onEndpoint({endpointFn}){client=endpointFn}}).pipe(map6(()=>client))};var urlBuilder=(api,options4)=>{const builder={};reflect(api,{onGroup({group:group2}){if(group2.topLevel)return;set(builder,group2.identifier,{})},onEndpoint({group:group2,endpoint:endpoint2}){const makeUrl=compilePath(endpoint2.path);const encodeParams=endpoint2.params===undefined?undefined:encodeSync2(endpoint2.params);const encodeQuery=endpoint2.query===undefined?undefined:encodeSync2(endpoint2.query);const endpointBuilder=(request)=>{const params=request?.params;const path4=params===undefined?endpoint2.path:makeUrl(encodeParams===undefined?params:encodeParams(params));const queryInput=request?.query===undefined?undefined:encodeQuery===undefined?request.query:encodeQuery(request.query);const query=queryInput===undefined?"":toString(fromInput2(queryInput));const url=query===""?path4:`${path4}?${query}`;return options4?.baseUrl===undefined?url:new URL(url,options4.baseUrl.toString()).toString()};set(group2.topLevel?builder:builder[group2.identifier],endpoint2.identifier,endpointBuilder)}});return builder};var paramsRegExp=/(\/?):(\w+)(\?)?/g;var compilePath=(path4)=>{if(!paramsRegExp.test(path4)){return(_)=>path4}paramsRegExp.lastIndex=0;return(params)=>{paramsRegExp.lastIndex=0;return path4.replace(paramsRegExp,(_,slash,key,optional4)=>{const value3=params[key];if(value3===undefined){if(optional4!==undefined){return""}throw new Error(`Missing path parameter: ${key}`)}return`${slash}${encodeURIComponent(value3)}`})}};function schemasToResponse(schemas){const codec=toCodecArrayBuffer(schemas);const decode3=decodeEffect2(codec);return(response)=>flatMap3(response.arrayBuffer,decode3)}function addResponseAlternative(map15,status2,contentType,decode3){const normalizedContentType=normalize(contentType);const alternatives=map15.get(status2);if(alternatives===undefined){map15.set(status2,[{contentType:normalizedContentType,decode:decode3}])}else{alternatives.push({contentType:normalizedContentType,decode:decode3})}}function makeResponseDecoder(alternatives){const first=alternatives[0];if(alternatives.length===1&&first!==undefined){return first.decode}return(response)=>{const contentType=normalize(response.headers["content-type"]??"");const alternative=alternatives.find((alternative2)=>alternative2.contentType===contentType);return alternative===undefined?failUnsupportedContentType(response,contentType,alternatives):alternative.decode(response)}}function groupSchemasByContentType(schemas){const grouped=new Map;for(const schema2 of schemas){const contentType=isNoContent(schema2.ast)?"":normalize(getResponseEncoding(schema2.ast).contentType);const existing=grouped.get(contentType);if(existing===undefined){grouped.set(contentType,[schema2])}else{existing.push(schema2)}}return grouped}function failUnsupportedContentType(response,contentType,alternatives){const expected=Array.from(new Set(alternatives.map((alternative)=>alternative.contentType))).join(", ");return fail6(new HttpClientError({reason:new DecodeError({request:response.request,response,description:`Unsupported response content-type for status ${response.status}: ${contentType||"<missing>"}. Expected one of: ${expected}`})}))}var reservedStreamFailureEvent3="effect/httpapi/stream/failure";function getStreamSuccessSchemas(endpoint2){const schemas=[];for(const schema2 of endpoint2.success){if(isStreamSchema(schema2)){schemas.push(schema2)}}return schemas}function streamToResponse(streamSchema2){const sse=isStreamUint8Array(streamSchema2)?undefined:{declaration:streamSchema2,decoder:makeSseDecoder(streamSchema2)};return(response)=>map6(context2(),(context3)=>provideContext4(sse===undefined?response.stream:decodeSseStream(response.stream,sse.declaration,sse.decoder),context3))}function makeSseDecoder(declaration){const Event=Union2([Struct({event:Literal2(reservedStreamFailureEvent3),data:fromJsonString2(toCodecJson(Cause(declaration.error,Defect())))}),declaration.events]);return decodeSchema(Event)}function decodeSseStream(stream2,declaration,decoder){const events=transformPull2(stream2.pipe(decodeText,pipeThroughChannel(decoder)),(pull)=>sync2(()=>{let pendingFailureCause=undefined;return suspend2(()=>{if(pendingFailureCause!==undefined){return failCause3(pendingFailureCause)}return flatMap3(pull,(events2)=>{for(let i=0;i<events2.length;i++){const event=events2[i];if(event.event===reservedStreamFailureEvent3&&isCause2(event.data)){if(i===0){return failCause3(event.data)}pendingFailureCause=event.data;events2=events2.slice(0,i);break}}return succeed6(events2)})})}));if(declaration.sseMode==="data"){return map9(events,(event)=>event.data)}return events}var ArrayBuffer2=instanceOf(globalThis.ArrayBuffer,{expected:"ArrayBuffer"});var Uint8ArrayFromArrayBuffer=ArrayBuffer2.pipe(decodeTo2(Uint8Array2,transform2({decode(fromA){return new Uint8Array(fromA)},encode(arr){return arr.byteLength===arr.buffer.byteLength?arr.buffer:arr.buffer.slice(arr.byteOffset,arr.byteOffset+arr.byteLength)}})));var StringFromArrayBuffer=ArrayBuffer2.pipe(decodeTo2(String4,transform2({decode(fromA){return new TextDecoder().decode(fromA)},encode(toI){const arr=new TextEncoder().encode(toI);return arr.byteLength===arr.buffer.byteLength?arr.buffer:arr.buffer.slice(arr.byteOffset,arr.byteOffset+arr.byteLength)}})));var UnknownFromArrayBuffer=StringFromArrayBuffer.pipe(decodeTo2(Union2([Literal2("").pipe(decodeTo2(Undefined2,transform2({decode:()=>{return},encode:()=>""}))),UnknownFromJsonString])));function toCodecArrayBuffer(schemas){return Union2(schemas.map(onSchema));function onSchema(schema2){const encoding=getResponseEncoding(schema2.ast);switch(encoding._tag){case"Json":{const encodedIsNull=isNull(toEncoded(schema2.ast));return UnknownFromArrayBuffer.pipe(decodeTo2(schema2,encodedIsNull?transform2({decode:(a)=>a===undefined?null:a,encode:(a)=>a===null?undefined:a}):undefined))}case"FormUrlEncoded":return StringFromArrayBuffer.pipe(decodeTo2(schemaRecord),decodeTo2(schema2));case"Uint8Array":return Uint8ArrayFromArrayBuffer.pipe(decodeTo2(schema2));case"Text":return StringFromArrayBuffer.pipe(decodeTo2(schema2))}}}var statusOrElse=(response)=>fail6(new HttpClientError({reason:new DecodeError({request:response.request,response})}));var $HttpBody=declare(isHttpBody);function getEncodePayloadSchema(schemas,method){return Union2(schemas.map((s)=>getEncodePayloadSchemaFromBody(s,method)))}var bodyFromPayloadCache=new WeakMap;function getEncodePayloadSchemaFromBody(schema2,method){const ast=schema2.ast;const cached3=bodyFromPayloadCache.get(ast);if(cached3!==undefined){return cached3}const encoding=getPayloadEncoding(ast,method);const out=$HttpBody.pipe(decodeTo2(schema2,transformOrFail2({decode(httpBody){return fail6(new Forbidden(some2(httpBody),{message:"Encode only schema"}))},encode(t){switch(encoding._tag){case"Multipart":return fail6(new Forbidden(some2(t),{message:"Payload must be a FormData"}));case"Json":{try{const body=JSON.stringify(t);return succeed6(text2(body,encoding.contentType))}catch(error2){return fail6(new InvalidValue(some2(t),{message:globalThis.String(error2)}))}}case"Text":{if(typeof t!=="string"){return fail6(new InvalidValue(some2(t),{message:"Expected a string"}))}return succeed6(text2(t,encoding.contentType))}case"FormUrlEncoded":{if(!isObject(t)){return fail6(new InvalidValue(some2(t),{message:"Expected a record"}))}return succeed6(urlParams(fromInput2(t),encoding.contentType))}case"Uint8Array":{if(!(t instanceof Uint8Array)){return fail6(new InvalidValue(some2(t),{message:"Expected a Uint8Array"}))}return succeed6(uint8Array(t,encoding.contentType))}}}})));bodyFromPayloadCache.set(ast,out);return out}var exports_HttpApiGroup={};__export(exports_HttpApiGroup,{make:()=>make39,isHttpApiGroup:()=>isHttpApiGroup});var TypeId48="~effect/httpapi/HttpApiGroup";var isHttpApiGroup=(u)=>hasProperty(u,TypeId48);var Proto17={[TypeId48]:TypeId48,add(...toAdd){const endpoints={...this.endpoints};for(const endpoint2 of toAdd){set(endpoints,endpoint2.identifier,endpoint2)}return makeProto3({...optionsFromGroup(this),endpoints})},prefix(prefix){return makeProto3({...optionsFromGroup(this),endpoints:map2(this.endpoints,(endpoint2)=>endpoint2.prefix(prefix))})},middleware(middleware2){return makeProto3({...optionsFromGroup(this),endpoints:map2(this.endpoints,(endpoint2)=>endpoint2.middleware(middleware2))})},annotateMerge(annotations2){return makeProto3({...optionsFromGroup(this),annotations:merge(this.annotations,annotations2)})},annotate(annotation,value3){return makeProto3({...optionsFromGroup(this),annotations:add(this.annotations,annotation,value3)})},annotateEndpointsMerge(annotations2){return makeProto3({...optionsFromGroup(this),endpoints:map2(this.endpoints,(endpoint2)=>endpoint2.annotateMerge(annotations2))})},annotateEndpoints(annotation,value3){return makeProto3({...optionsFromGroup(this),endpoints:map2(this.endpoints,(endpoint2)=>endpoint2.annotate(annotation,value3))})},pipe(){return pipeArguments(this,arguments)}};var optionsFromGroup=(group2)=>({identifier:group2.identifier,topLevel:group2.topLevel,endpoints:group2.endpoints,annotations:group2.annotations});var makeProto3=(options4)=>{function HttpApiGroup(){}Object.setPrototypeOf(HttpApiGroup,Proto17);HttpApiGroup.key=`effect/httpapi/HttpApiGroup/${options4.identifier}`;return Object.assign(HttpApiGroup,options4)};var make39=(identifier2,options4)=>makeProto3({identifier:identifier2,topLevel:options4?.topLevel??false,endpoints:{},annotations:empty()});var defaultMessage=(message)=>String4.pipe(optionalKey2,withConstructorDefault2(succeed6(message)));var BaselineChannel=Literals(["stable","bundled"]);var HarnessReportStatus=Literals(["new","triaged","accepted","wontfix","resolved"]);var OperatorIdentity=Struct({operatorId:String4,email:optionalKey2(String4),emailVerified:optionalKey2(Boolean3)}).annotate({identifier:"OperatorIdentity"});var isoDateTimePattern=/^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})T(?<hour>\d{2}):(?<minute>\d{2}):(?<second>\d{2})(?:\.(?<fraction>\d{1,9}))?(?:Z|[+-]\d{2}:\d{2})$/u;var isValidIsoDateTime=(value3)=>{const groups=isoDateTimePattern.exec(value3)?.groups;if(groups===undefined){return false}const year=Number(groups.year);const month=Number(groups.month);const day=Number(groups.day);const hour=Number(groups.hour);const minute=Number(groups.minute);const second=Number(groups.second);const millisecond=Number((groups.fraction??"").slice(0,3).padEnd(3,"0"));const date5=new Date(Date.UTC(year,month-1,day,hour,minute,second,millisecond));return Number.isFinite(Date.parse(value3))&&date5.getUTCFullYear()===year&&date5.getUTCMonth()===month-1&&date5.getUTCDate()===day&&date5.getUTCHours()===hour&&date5.getUTCMinutes()===minute&&date5.getUTCSeconds()===second};var IsoDateTimeString=String4.pipe(refine((value3)=>isValidIsoDateTime(value3),{identifier:"IsoDateTimeString",description:"an ISO 8601 datetime string with timezone"}));var GitIdentity=Struct({name:optionalKey2(String4),email:optionalKey2(String4)}).annotate({identifier:"GitIdentity"});var ObservedRepositoryInput=Struct({remoteUrl:optionalKey2(String4),remoteHost:optionalKey2(String4),remotePath:optionalKey2(String4),branch:optionalKey2(String4),commitSha:optionalKey2(String4),dirty:optionalKey2(Boolean3),gitIdentity:optionalKey2(GitIdentity)}).annotate({identifier:"ObservedRepositoryInput"});var SymbolPropertyKey=Struct({_tag:Literal2("symbol"),key:String4}).annotate({description:"an object to be decoded into a globally shared symbol"});var PropertyKey=Union2([String4,Finite,SymbolPropertyKey]).annotate({identifier:"PropertyKey"});var DecodeIssue=Struct({_tag:Literals(["Pointer","Unexpected","Missing","Composite","Refinement","Transformation","Type","Forbidden"]),path:ArraySchema(PropertyKey),message:String4}).annotate({identifier:"Issue"});class HttpApiDecodeError extends TaggedErrorClass()("HttpApiDecodeError",{issues:ArraySchema(DecodeIssue),message:String4},{httpApiStatus:400,description:"The request did not match the expected schema"}){}class Forbidden2 extends TaggedErrorClass()("@punks/contract/errors/Forbidden",{message:defaultMessage("The supplied credentials cannot access this resource.")},{httpApiStatus:403,title:"Forbidden"}){}var defaultMessage2=(message)=>String4.pipe(optionalKey2,withConstructorDefault2(succeed6(message)));var ArtifactKind=Literals(["manifest","archive"]);var BaselineVersion=NonEmptyString.annotate({identifier:"BaselineVersion"});var NonBlankString=String4.check(isTrimmed(),isNonEmpty());var BaselineRevision=String4.check(isPattern2(/^[1-9][0-9]*$/u)).annotate({identifier:"BaselineRevision"});var BaselineSha256=String4.check(isPattern2(/^[0-9a-f]{64}$/u)).annotate({identifier:"BaselineSha256"});var BaselinePromotionArtifact=Struct({url:NonBlankString,sha256:BaselineSha256}).annotate({identifier:"BaselinePromotionArtifact"});var BaselinePromotionCandidate=Struct({releaseId:NonBlankString,version:BaselineVersion,tag:NonBlankString,publishedAt:IsoDateTimeString,commitSha:NonBlankString,provenance:NonBlankString,cliVersionRange:NonBlankString,manifest:BaselinePromotionArtifact,archive:BaselinePromotionArtifact}).annotate({identifier:"BaselinePromotionCandidate"});var BaselinePublishRequest=Struct({mode:Literal2("publish"),candidate:BaselinePromotionCandidate,publicationIdentity:NonBlankString,expectedRevision:optionalKey2(BaselineRevision),reason:optionalKey2(Never2)});var BaselineRollbackRequest=Struct({mode:Literal2("rollback"),candidate:BaselinePromotionCandidate,publicationIdentity:NonBlankString,expectedRevision:BaselineRevision,reason:NonBlankString});var BaselinePromotionRequest=Union2([BaselinePublishRequest,BaselineRollbackRequest]).annotate({identifier:"BaselinePromotionRequest"});var BaselinePromotionResult=Struct({outcome:Literals(["committed","already-committed"]),revision:BaselineRevision,mode:Literals(["publish","rollback"]),candidate:BaselinePromotionCandidate,publicationIdentity:NonBlankString,previousRevision:optionalKey2(BaselineRevision),previousReleaseId:optionalKey2(NonBlankString),committedAt:IsoDateTimeString}).annotate({identifier:"BaselinePromotionResult"});var BaselineRequest=Struct({channel:BaselineChannel,version:optionalKey2(BaselineVersion)}).annotate({identifier:"BaselineRequest"});var BaselineVersionRequest=Struct({version:optionalKey2(BaselineVersion)}).annotate({identifier:"BaselineVersionRequest"});var BaselineSource=Literals(["control-plane","published-release","cache","bundled"]);var BaselineCompatibility=Struct({cliVersionRange:String4}).annotate({identifier:"BaselineCompatibility"});var BaselineRetrievalStatus=Literals(["available","retrieved","cached","fallback"]);var ArtifactMetadata=Struct({kind:ArtifactKind,fileName:String4,contentType:String4,url:String4,sha256:String4,sizeBytes:optionalKey2(Finite)}).annotate({identifier:"ArtifactMetadata"});var BaselineIdentity={requested:BaselineRequest,resolvedVersion:BaselineVersion,digest:String4,source:BaselineSource,provenance:String4,compatibility:BaselineCompatibility,retrieval:BaselineRetrievalStatus};var BaselineResolution=Struct({...BaselineIdentity,manifest:ArtifactMetadata,archive:ArtifactMetadata}).pipe(check(makeFilter2(({requested,resolvedVersion})=>requested.version===undefined||requested.version===resolvedVersion,{message:"An exact baseline request must resolve to the requested version."})),check(makeFilter2(({digest:digest2,archive})=>digest2===archive.sha256,{message:"The baseline digest must match the archive digest."}))).annotate({identifier:"BaselineResolution"});var BaselineArtifact=Struct({...BaselineIdentity,artifact:ArtifactMetadata}).pipe(check(makeFilter2(({requested,resolvedVersion})=>requested.version===undefined||requested.version===resolvedVersion,{message:"Artifact metadata must match the exact requested baseline version."})),check(makeFilter2(({artifact,digest:digest2})=>artifact.kind!=="archive"||artifact.sha256===digest2,{message:"The baseline artifact digest must match the verified baseline digest."}))).annotate({identifier:"BaselineArtifact"});class BaselineNotFound extends TaggedErrorClass()("@punks/contract/errors/BaselineNotFound",{channel:String4,message:defaultMessage2("No baseline exists for the requested channel.")},{httpApiStatus:404,title:"Baseline Not Found"}){}class ControlPlaneUnavailable extends TaggedErrorClass()("@punks/contract/errors/ControlPlaneUnavailable",{message:defaultMessage2("The control plane cannot resolve this resource yet.")},{httpApiStatus:503,title:"Control Plane Unavailable"}){}class BaselineAuthorityFailure extends TaggedErrorClass()("@punks/contract/errors/BaselineAuthorityFailure",{request:BaselineRequest,resolvedVersion:optionalKey2(BaselineVersion),message:String4},{httpApiStatus:409,title:"Baseline Authority Failure"}){}class BaselineIntegrityFailure extends TaggedErrorClass()("@punks/contract/errors/BaselineIntegrityFailure",{request:BaselineRequest,resolvedVersion:optionalKey2(BaselineVersion),expectedDigest:optionalKey2(String4),actualDigest:optionalKey2(String4),message:defaultMessage2("Baseline identity or artifact integrity verification failed.")},{httpApiStatus:422,title:"Baseline Integrity Failure"}){}var BaselineAvailability=Literals(["authority-unconfigured","network","unavailable-status"]);class BaselineUnavailable extends TaggedErrorClass()("@punks/contract/errors/BaselineUnavailable",{availability:BaselineAvailability,request:BaselineRequest,message:defaultMessage2("The requested baseline is unavailable.")},{httpApiStatus:503,title:"Baseline Unavailable"}){}class BaselinePublisherUnauthorized extends TaggedErrorClass()("@punks/contract/errors/BaselinePublisherUnauthorized",{message:defaultMessage2("Baseline publisher authentication is required.")},{httpApiStatus:401,title:"Baseline Publisher Unauthorized"}){}class BaselinePromotionConflict extends TaggedErrorClass()("@punks/contract/errors/BaselinePromotionConflict",{publicationIdentity:NonBlankString,expectedRevision:optionalKey2(BaselineRevision),actualRevision:optionalKey2(BaselineRevision),message:String4},{httpApiStatus:409,title:"Baseline Promotion Conflict"}){}class BaselinePromotionIntegrityFailure extends TaggedErrorClass()("@punks/contract/errors/BaselinePromotionIntegrityFailure",{publicationIdentity:NonBlankString,releaseId:optionalKey2(NonBlankString),expectedDigest:optionalKey2(BaselineSha256),actualDigest:optionalKey2(BaselineSha256),message:defaultMessage2("Baseline promotion evidence failed integrity verification.")},{httpApiStatus:422,title:"Baseline Promotion Integrity Failure"}){}class BaselinePromotionUnavailable extends TaggedErrorClass()("@punks/contract/errors/BaselinePromotionUnavailable",{publicationIdentity:NonBlankString,outcome:Literals(["not-committed","indeterminate"]),message:defaultMessage2("Baseline promotion is unavailable.")},{httpApiStatus:503,title:"Baseline Promotion Unavailable"}){}var errors2=[HttpApiDecodeError,Forbidden2,BaselineNotFound,BaselineAuthorityFailure,BaselineIntegrityFailure,BaselineUnavailable];var promotionErrors=[HttpApiDecodeError,Forbidden2,BaselinePublisherUnauthorized,BaselinePromotionConflict,BaselinePromotionIntegrityFailure,BaselinePromotionUnavailable];var BaselineApi=exports_HttpApiGroup.make("baseline").add(exports_HttpApiEndpoint.get("resolve","/:channel",{params:{channel:BaselineChannel},query:BaselineVersionRequest,success:BaselineResolution,error:errors2}),exports_HttpApiEndpoint.get("artifact","/:channel/artifacts/:kind",{params:{channel:BaselineChannel,kind:ArtifactKind},query:BaselineVersionRequest,success:BaselineArtifact,error:errors2}),exports_HttpApiEndpoint.post("promote","/stable/promotions",{payload:BaselinePromotionRequest,success:BaselinePromotionResult,error:promotionErrors})).prefix("/baselines").annotateMerge(exports_OpenApi.annotations({title:"Baseline control plane"}));import{createHash as createHash2}from"node:crypto";import{lstatSync,readFileSync,readdirSync,readlinkSync}from"node:fs";import path4 from"node:path";var digestContentRoots=(roots)=>{const entries=[];for(const{root,prefix,include=()=>true,logicalPath=(value3)=>value3}of roots){const visit2=(directory3)=>{for(const entry of readdirSync(directory3,{withFileTypes:true})){const absolutePath=path4.join(directory3,entry.name);if(entry.isDirectory()){visit2(absolutePath);continue}const relativePath=path4.relative(root,absolutePath).split(path4.sep).join("/");if(include(relativePath)){entries.push({absolutePath,identity:`${prefix}/${logicalPath(relativePath)}`})}}};visit2(root)}const hash2=createHash2("sha256");for(const{absolutePath,identity:identity3}of entries.toSorted((left,right)=>left.identity.localeCompare(right.identity))){const stat3=lstatSync(absolutePath);hash2.update(identity3);hash2.update("\x00");if(stat3.isSymbolicLink()){hash2.update("symlink\x00");hash2.update(readlinkSync(absolutePath))}else{hash2.update("file\x00");hash2.update(readFileSync(absolutePath))}hash2.update("\x00")}return hash2.digest("hex")};import{existsSync,mkdirSync,readFileSync as readFileSync2,statSync,writeFileSync}from"node:fs";import{tmpdir as tmpdir2}from"node:os";import path5 from"node:path";var embeddedAssets=[];var name="@punks/cli";var version2="4.0.1";var findFirst4=(candidates)=>candidates.find((candidate)=>existsSync(candidate));var executableSignature=()=>{try{return String(Math.trunc(statSync(process.execPath).mtimeMs))}catch{return"unknown"}};var extractEmbeddedAssets=()=>{if(embeddedAssets.length===0){return}const root=path5.join(tmpdir2(),"punks-cli-assets",`${version2}-${executableSignature()}`);for(const asset of embeddedAssets){const targetPath=path5.join(root,asset.relativePath);if(existsSync(targetPath)){continue}mkdirSync(path5.dirname(targetPath),{recursive:true});writeFileSync(targetPath,readFileSync2(asset.path))}return root};var findBundledPackageRoot=()=>{let currentDirectory=path5.resolve(import.meta.dirname,"../..");while(true){if(existsSync(path5.join(currentDirectory,"package.json"))){return currentDirectory}const parentDirectory=path5.dirname(currentDirectory);if(parentDirectory===currentDirectory){break}currentDirectory=parentDirectory}return path5.resolve(import.meta.dirname,"../..")};var packageRoot=findBundledPackageRoot();var runtimeRoot=import.meta.dirname;var embeddedAssetsRoot=extractEmbeddedAssets();var executableRoots=[process.argv[1],process.execPath].filter((candidate)=>candidate!==undefined&&candidate.length>0).map((candidate)=>path5.dirname(path5.resolve(candidate)));var dataCandidates=[path5.join(runtimeRoot,"data"),...embeddedAssetsRoot===undefined?[]:[path5.join(embeddedAssetsRoot,"data")],...executableRoots.map((root)=>path5.join(root,"data")),path5.resolve(import.meta.dirname,"../data"),path5.join(packageRoot,"src/data"),path5.resolve(import.meta.dirname,"../../src/data")];var skillCandidates=[path5.join(runtimeRoot,"skills"),...embeddedAssetsRoot===undefined?[]:[path5.join(embeddedAssetsRoot,"skills")],...executableRoots.map((root)=>path5.join(root,"skills")),path5.join(packageRoot,"skills"),path5.resolve(import.meta.dirname,"../../skills"),path5.resolve(import.meta.dirname,"../skills")];var resolvedDataRoot=findFirst4(dataCandidates);var resolvedSkillsRoot=findFirst4(skillCandidates);if(resolvedDataRoot===undefined){throw new Error("Could not locate bundled data directory.")}if(resolvedSkillsRoot===undefined){throw new Error("Could not locate bundled skills directory.")}var dataRoot=resolvedDataRoot;var skillsRoot=resolvedSkillsRoot;var dataPath=(...segments)=>path5.join(dataRoot,...segments);var readDataFile=(...segments)=>readFileSync2(dataPath(...segments),"utf-8");var readBaselineDataFile=(baselineDataRoot,...segments)=>readFileSync2(path5.join(baselineDataRoot,...segments),"utf-8");var resolveBaselinePath=({baselineRoot,baselineSkillsRoot,relativePath})=>{const resolvedPath=relativePath.startsWith("skills/")?findFirst4([path5.join(baselineSkillsRoot,relativePath.slice("skills/".length)),path5.join(baselineRoot,relativePath)]):findFirst4([path5.join(baselineRoot,relativePath)]);if(resolvedPath!==undefined){return resolvedPath}throw new Error(`Could not locate baseline asset: ${relativePath}`)};var bundledBaselineDigest="c6604de33224a51a408a737f2d12c57f41208449440392bce4224efff003e603";var hookCatalog=[{description:"Shared session-start hook that reports whether managed Harness scaffold output is current.",harness:"shared",id:"scaffold-update-check",outputPath:".agents/hooks/scaffold-update-check.mjs",sourcePath:"hooks/scaffold-update-check.mjs"},{description:"Shared hook that auto-formats edited JS/TS/JSON files and lint-checks product files after tool use.",harness:"shared",id:"format-edited-file",outputPath:".agents/hooks/format-edited-file.mjs",sourcePath:"hooks/format-edited-file.mjs"}];var antiSlopRules={"anti-slop/no-chained-type-assertions":"error","anti-slop/no-conditional-empty-object-spread":"error","anti-slop/no-known-value-widening":"error","anti-slop/no-module-mocking":"error","anti-slop/no-object-parameters":"error","anti-slop/no-reflect-apply":"error","anti-slop/no-reflect-get":"error","anti-slop/no-runtime-typeof":"error","anti-slop/no-shape-in-symbol-names":"error","anti-slop/no-unknown-parameters":"error","anti-slop/no-unknown-returns":"error","anti-slop/no-unknown-type-aliases":"error","anti-slop/no-unsafe-dictionary-type":"error","anti-slop/no-widen-then-assert":"error","anti-slop/require-safety-comment-for-type-assertion":"error"};var sharedReactPlacement={placementNotes:"Add as an override for detected React-rendered code. Keep backend packages outside this override unless they render React.",recommendedConfigFile:"oxlint.config.ts",recommendedFiles:["<detected-react-workspace>/**/*.{js,jsx,ts,tsx}"],recommendedWorkspaces:["detected React workspaces"]};var webOnlyPlacement={placementNotes:"Place this in the Next.js app override. If the repo uses a different frontend app path, retarget the file globs to that workspace before composing the final Oxlint config.",recommendedConfigFile:"oxlint.config.ts",recommendedFiles:["<detected-nextjs-workspace>/**/*.{js,jsx,ts,tsx}"],recommendedWorkspaces:["detected Next.js workspaces"]};var effectPlacement={placementNotes:"Apply this only where Effect code lives. If the target repo renames or splits backend workspaces, move the override with those code paths instead of broadening it repo-wide.",recommendedConfigFile:"oxlint.config.ts",recommendedFiles:["<detected-effect-workspace>/**/*.{js,jsx,ts,tsx}"],recommendedWorkspaces:["detected Effect workspaces"]};var vitestPlacement={placementNotes:"Attach this to test-only globs. Expand or narrow the file patterns to match the repo's actual Vitest test layout instead of treating it as a global default.",recommendedConfigFile:"oxlint.config.ts",recommendedFiles:["<detected-test-workspace>/**/*.{test,spec}.{js,jsx,ts,tsx}","<detected-test-workspace>/src/test/**/*.{js,jsx,ts,tsx}"],recommendedWorkspaces:["detected JavaScript/TypeScript test workspaces"]};var lintCatalog=[{description:"Vendored Anti-Slop rules for rejecting low-evidence TypeScript and JavaScript patterns.",id:"typescript-anti-slop",ignorePatterns:["tools/oxlint/anti-slop/**"],jsPlugins:[{name:"anti-slop",specifier:"./tools/oxlint/anti-slop/index.mjs"}],oxlintPresets:[],placement:{placementNotes:"Apply to JavaScript and TypeScript workspaces.",recommendedConfigFile:"oxlint.config.ts",recommendedFiles:["**/*.{js,jsx,ts,tsx}"],recommendedWorkspaces:["detected JavaScript and TypeScript workspaces"]},plugins:[],requiredDevDependencies:["@oxlint/plugins"],rules:antiSlopRules,settings:{},sourceFiles:[{sourcePath:"lint/anti-slop/index.mjs",targetPath:"tools/oxlint/anti-slop/index.mjs"},{sourcePath:"lint/anti-slop/LICENSE",targetPath:"tools/oxlint/anti-slop/LICENSE"}]},{description:"Explicit Anti-Slop adoption policy for existing Harness workspaces.",id:"punks-anti-slop-transition",jsPlugins:[],oxlintPresets:[],placement:{placementNotes:"Apply only to existing Harness workspaces while they adopt Anti-Slop.",recommendedConfigFile:"oxlint.config.ts",recommendedFiles:["**/*.{js,jsx,ts,tsx}"],recommendedWorkspaces:["Harness workspaces"]},plugins:[],requiredDevDependencies:[],rules:Object.fromEntries(Object.keys(antiSlopRules).map((rule)=>[rule,"off"])),settings:{},targetPackageNames:["@punks/api","@punks/auth","@punks/backoffice","@punks/cli","@punks/config","@punks/contract","@punks/db","@punks/env","@punks/scaffold","@punks/ui","@punks/web","@punks/wiki"]},{categories:{correctness:"error"},description:"Ultracite React preset for rendered app and shared UI code.",id:"react-core",jsPlugins:[],oxlintPresets:["react"],placement:sharedReactPlacement,plugins:["react"],requiredDevDependencies:[],rules:{},settings:{}},{description:"React Hooks lint rules via the JS plugin bridge for Oxlint.",id:"react-hooks",jsPlugins:[{name:"react-hooks-js",specifier:"eslint-plugin-react-hooks"}],oxlintPresets:[],placement:sharedReactPlacement,plugins:[],requiredDevDependencies:["eslint-plugin-react-hooks"],rules:Object.fromEntries([["react-hooks-js/exhaustive-deps","error"],["react-hooks-js/component-hook-factories","error"],["react-hooks-js/config","error"],["react-hooks-js/error-boundaries","error"],["react-hooks-js/gating","error"],["react-hooks-js/globals","error"],["react-hooks-js/immutability","error"],["react-hooks-js/incompatible-library","error"],["react-hooks-js/preserve-manual-memoization","error"],["react-hooks-js/purity","error"],["react-hooks-js/refs","error"],["react-hooks-js/rules-of-hooks","error"],["react-hooks-js/set-state-in-effect","error"],["react-hooks-js/set-state-in-render","error"],["react-hooks-js/static-components","error"],["react-hooks-js/unsupported-syntax","error"],["react-hooks-js/use-memo","error"]]),settings:{}},{description:"Guidance rules that push React code away from unnecessary effects.",id:"react-you-might-not-need-an-effect",jsPlugins:[{name:"react-you-might-not-need-an-effect-js",specifier:"eslint-plugin-react-you-might-not-need-an-effect"}],oxlintPresets:[],placement:sharedReactPlacement,plugins:[],requiredDevDependencies:["eslint-plugin-react-you-might-not-need-an-effect"],rules:{"react-you-might-not-need-an-effect-js/no-adjust-state-on-prop-change":"error","react-you-might-not-need-an-effect-js/no-chain-state-updates":"error","react-you-might-not-need-an-effect-js/no-derived-state":"error","react-you-might-not-need-an-effect-js/no-event-handler":"error","react-you-might-not-need-an-effect-js/no-initialize-state":"error","react-you-might-not-need-an-effect-js/no-pass-data-to-parent":"error","react-you-might-not-need-an-effect-js/no-pass-live-state-to-parent":"error","react-you-might-not-need-an-effect-js/no-reset-all-state-on-prop-change":"error"},settings:{}},{description:"Ultracite Next.js preset for the main web application.",id:"next-core",jsPlugins:[],oxlintPresets:["next"],placement:{...webOnlyPlacement,placementNotes:"Place this beside the React app override and set `settings.next.rootDir` to the repo's actual Next workspace roots if the final config needs that plugin setting."},plugins:[],requiredDevDependencies:[],rules:{},settings:{}},{description:"Ultracite TanStack preset for query/router/start framework linting.",id:"tanstack-query-core",jsPlugins:[],oxlintPresets:["tanstack"],placement:{...webOnlyPlacement,placementNotes:"Scope this to client code that owns TanStack Query usage. Keep it out of server-only or shared non-query packages unless those paths actually create queries or mutations."},plugins:[],requiredDevDependencies:[],rules:{},settings:{}},{description:"Effect architectural rule that blocks barrel-package imports.",id:"effect-no-barrel-imports",jsPlugins:[{name:"effect-js",specifier:"@effect/eslint-plugin"}],oxlintPresets:[],placement:effectPlacement,plugins:[],requiredDevDependencies:["@effect/eslint-plugin"],rules:{"effect-js/no-import-from-barrel-package":["error",{packageNames:["effect"]}]},settings:{}},{description:"Effect tsgo recommended type-aware Oxlint rules.",id:"effect-tsgo-recommended",jsPlugins:[],oxlintConfigExtensions:[{exportName:"recommended",specifier:"@effect/tsgo/oxlint-presets"}],oxlintPresets:[],placement:effectPlacement,plugins:[],prepareCommands:["effect-tsgo patch --no-typescript --oxlint"],requiredDevDependencies:["@effect/tsgo","oxlint-tsgolint"],requiredDevDependencyVersions:{"@effect/tsgo":"0.36.5",oxlint:"1.78.0","oxlint-tsgolint":"7.0.2001"},rules:{},settings:{}},{description:"Ultracite Vitest preset for repo-owned test globs.",id:"vitest-core",jsPlugins:[],oxlintPresets:["vitest"],placement:vitestPlacement,plugins:[],requiredDevDependencies:[],rules:{},settings:{}},{description:"Canonical lint policy for the shipped Harness CLI package.",id:"punks-cli-canonical",ignorePatterns:["src/data/lint/anti-slop/**","src/data/hooks/format-edited-file.mjs","src/data/hooks/require-tests-for-pr.mjs","src/data/hooks/scaffold-update-check.mjs","src/data/scripts/harness-projection/adapters/claude.mjs","src/data/scripts/harness-projection/adapters/codex.mjs","src/data/scripts/harness-projection/adapters/cursor.mjs","src/data/scripts/harness-projection/adapters/opencode.mjs","src/data/scripts/harness-projection/apply.mjs","src/data/scripts/harness-projection/core.mjs","src/data/scripts/sync-subagents.mjs","src/data/subagents/manifest.mjs"],jsPlugins:[],oxlintPresets:[],placement:{placementNotes:"Apply only to the exact @punks/cli package.",recommendedConfigFile:"oxlint.config.ts",recommendedFiles:["**/*.{js,jsx,ts,tsx}"],recommendedWorkspaces:["@punks/cli"]},plugins:[],requiredDevDependencies:[],rules:{},settings:{},targetPackageNames:["@punks/cli"]},{description:"Canonical lint exceptions for the Harness backoffice package.",id:"punks-backoffice-canonical",jsPlugins:[],oxlintPresetRules:{vitest:{"vitest/prefer-import-in-mock":"off","vitest/prefer-importing-vitest-globals":"off"}},oxlintPresets:[],placement:{placementNotes:"Apply only to the exact @punks/backoffice package.",recommendedConfigFile:"oxlint.config.ts",recommendedFiles:["**/*.{js,jsx,ts,tsx}"],recommendedWorkspaces:["@punks/backoffice"]},plugins:[],requiredDevDependencies:[],rules:{"eslint/func-style":"off"},settings:{},targetPackageNames:["@punks/backoffice"]}];var stableJson=(value3)=>JSON.stringify(value3);var placementKeyOf=(placement)=>[placement.recommendedConfigFile,...placement.recommendedFiles].join("::");var validateConfigExtensions=(asset)=>{for(const extension of asset.oxlintConfigExtensions??[]){if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/u.test(extension.exportName)){throw new Error(`Invalid Oxlint config extension export name \`${extension.exportName}\`: ${asset.id}`)}if(extension.specifier.length===0){throw new Error(`Empty Oxlint config extension specifier: ${asset.id}`)}}};var validateRequiredVersions=(asset,seen)=>{for(const[packageName,version3]of Object.entries(asset.requiredDevDependencyVersions??{})){const previous=seen.get(packageName);if(previous!==undefined&&previous.version!==version3){throw new Error(`Conflicting required dev dependency version \`${packageName}\`: ${previous.assetId} vs ${asset.id}`)}if(previous===undefined){seen.set(packageName,{assetId:asset.id,version:version3})}}};var validateLintCatalog=(catalog)=>{const seenIds=new Set;const seenRules=new Map;const seenSettings=new Map;const seenJsPlugins=new Map;const seenRequiredVersions=new Map;for(const asset of catalog){if(seenIds.has(asset.id)){throw new Error(`Duplicate lint asset id: ${asset.id}`)}seenIds.add(asset.id);const placementKey=[placementKeyOf(asset.placement),...asset.targetPackageNames===undefined?["all-packages"]:[...asset.targetPackageNames].toSorted()].join("::");for(const[ruleName,ruleValue]of Object.entries(asset.rules)){const key=`${placementKey}::rule::${ruleName}`;const value3=stableJson(ruleValue);const previous=seenRules.get(key);if(previous!==undefined&&previous.value!==value3){throw new Error(`Conflicting lint rule \`${ruleName}\` for placement \`${placementKey}\`: ${previous.assetId} vs ${asset.id}`)}if(previous===undefined){seenRules.set(key,{assetId:asset.id,value:value3})}}for(const[settingName,settingValue]of Object.entries(asset.settings)){const key=`${placementKey}::setting::${settingName}`;const value3=stableJson(settingValue);const previous=seenSettings.get(key);if(previous!==undefined&&previous.value!==value3){throw new Error(`Conflicting lint setting \`${settingName}\` for placement \`${placementKey}\`: ${previous.assetId} vs ${asset.id}`)}if(previous===undefined){seenSettings.set(key,{assetId:asset.id,value:value3})}}for(const plugin of asset.jsPlugins){const key=`${placementKey}::js-plugin::${plugin.name}`;const previous=seenJsPlugins.get(key);if(previous!==undefined&&previous.specifier!==plugin.specifier){throw new Error(`Conflicting JS plugin alias \`${plugin.name}\` for placement \`${placementKey}\`: ${previous.assetId} vs ${asset.id}`)}if(previous===undefined){seenJsPlugins.set(key,{assetId:asset.id,specifier:plugin.specifier})}}validateConfigExtensions(asset);validateRequiredVersions(asset,seenRequiredVersions)}return catalog};var skillCatalog=[{framework:"browser-automation",id:"agent-browser",language:null,requiresTools:["agent-browser"],sourceDirectory:"skills/agnostic/frontend/agent-browser",tier:"framework"},{framework:null,id:"backend-domain-structure",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/backend/backend-domain-structure",tier:"agnostic"},{framework:null,id:"backend-recoverable-actions",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/backend/backend-recoverable-actions",tier:"agnostic"},{framework:null,id:"logging-best-practices",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/backend/logging-best-practices",tier:"agnostic"},{framework:null,id:"audit-cicd-security",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/security/audit-cicd-security",tier:"agnostic"},{framework:null,id:"security-best-practices",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/security/security-best-practices",tier:"agnostic"},{framework:"better-auth",id:"better-auth-best-practices",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/better-auth/better-auth-best-practices",tier:"framework"},{framework:"better-auth",id:"better-auth-security-best-practices",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/better-auth/better-auth-security-best-practices",tier:"framework"},{framework:null,id:"create-plan",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/planning/create-plan",tier:"agnostic"},{framework:null,id:"create-spec",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/planning/create-spec",tier:"agnostic"},{framework:null,id:"delivery-phase",language:null,requiresTools:[],sourceDirectory:"skills/phases/delivery-phase",tier:"agnostic"},{framework:null,id:"design-phase",language:null,requiresTools:[],sourceDirectory:"skills/phases/design-phase",tier:"agnostic"},{framework:null,id:"debug-agent",language:null,requiresTools:["debug-agent"],sourceDirectory:"skills/agnostic/debug/debug-agent",tier:"agnostic"},{framework:null,id:"debugging-phase",language:null,requiresTools:["debug-agent"],sourceDirectory:"skills/phases/debugging-phase",tier:"agnostic"},{framework:null,id:"bug-discovery-phase",language:null,requiresTools:["clawpatch"],sourceDirectory:"skills/phases/bug-discovery-phase",tier:"agnostic"},{framework:null,id:"bug-resolution-phase",language:null,requiresTools:["clawpatch"],sourceDirectory:"skills/phases/bug-resolution-phase",tier:"agnostic"},{framework:null,id:"docs-ingest-phase",language:null,requiresTools:[],sourceDirectory:"skills/phases/docs-ingest-phase",tier:"agnostic"},{framework:null,id:"docs-onboarding",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/docs/docs-onboarding",tier:"agnostic"},{framework:null,id:"writing-fragments",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/docs/writing-fragments",tier:"agnostic"},{framework:null,id:"writing-beats",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/docs/writing-beats",tier:"agnostic"},{framework:null,id:"writing-shape",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/docs/writing-shape",tier:"agnostic"},{framework:"effect",id:"effect-backend-structure",language:"typescript",requiresTools:["opensrc"],sourceDirectory:"skills/frameworks/effect/effect-backend-structure",tier:"framework"},{framework:"effect",id:"effect",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/effect/effect",tier:"framework"},{framework:"effect",id:"effect-recoverable-actions",language:"typescript",requiresTools:["opensrc"],sourceDirectory:"skills/frameworks/effect/effect-recoverable-actions",tier:"framework"},{framework:"effect",id:"effect-service-design",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/effect/effect-service-design",tier:"framework"},{framework:"sqlalchemy",id:"sqlalchemy-schema-design",language:"python",requiresTools:[],sourceDirectory:"skills/frameworks/sqlalchemy/sqlalchemy-schema-design",tier:"framework"},{framework:"elysiajs",id:"elysiajs",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/elysia/elysiajs",tier:"framework"},{framework:"expo",id:"add-app-clip",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/add-app-clip",tier:"framework"},{framework:"expo",id:"animate-expo",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/animate-expo",tier:"framework"},{framework:"expo",id:"building-native-ui",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/building-native-ui",tier:"framework"},{framework:"expo",id:"eas-simulator",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/eas-simulator",tier:"framework"},{framework:"expo",id:"eas-update-insights",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/eas-update-insights",tier:"framework"},{framework:"expo",id:"expo-api-routes",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-api-routes",tier:"framework"},{framework:"expo",id:"expo-brownfield",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-brownfield",tier:"framework"},{framework:"expo",id:"expo-cicd-workflows",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-cicd-workflows",tier:"framework"},{framework:"expo",id:"expo-deployment",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-deployment",tier:"framework"},{framework:"expo",id:"expo-dev-client",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-dev-client",tier:"framework"},{framework:"expo",id:"expo-examples",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-examples",tier:"framework"},{framework:"expo",id:"expo-module",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-module",tier:"framework"},{framework:"expo",id:"expo-observe",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-observe",tier:"framework"},{framework:"expo",id:"expo-skill-eval",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-skill-eval",tier:"framework"},{framework:"expo",id:"expo-tailwind-setup",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-tailwind-setup",tier:"framework"},{framework:"expo",id:"expo-ui",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-ui",tier:"framework"},{framework:"expo",id:"native-data-fetching",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/native-data-fetching",tier:"framework"},{framework:"expo",id:"upgrading-expo",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/upgrading-expo",tier:"framework"},{framework:"expo",id:"use-dom",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/use-dom",tier:"framework"},{framework:"expo",id:"web-to-native",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/web-to-native",tier:"framework"},{framework:"pulumi",id:"pulumi-overview",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/pulumi/pulumi-overview",tier:"framework"},{framework:"pulumi",id:"pulumi-best-practices",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/pulumi/pulumi-best-practices",tier:"framework"},{framework:"pulumi",id:"pulumi-component",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/pulumi/pulumi-component",tier:"framework"},{framework:"pulumi",id:"pulumi-automation-api",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/pulumi/pulumi-automation-api",tier:"framework"},{framework:"pulumi",id:"pulumi-esc",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/pulumi/pulumi-esc",tier:"framework"},{framework:"pulumi",id:"provider-upgrade",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/pulumi/provider-upgrade",tier:"framework"},{framework:"pulumi",id:"package-usage",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/pulumi/package-usage",tier:"framework"},{framework:null,id:"animate",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/frontend/animate",tier:"agnostic"},{framework:null,id:"design-taste-frontend",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/frontend/design-taste-frontend",tier:"agnostic"},{framework:null,id:"imagegen-frontend-mobile",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/frontend/imagegen-frontend-mobile",tier:"agnostic"},{framework:null,id:"imagegen-frontend-web",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/frontend/imagegen-frontend-web",tier:"agnostic"},{framework:null,id:"frontend-domain-structure",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/frontend/frontend-domain-structure",tier:"agnostic"},{framework:null,id:"improve-mobile-frontend",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/frontend/improve-mobile-frontend",tier:"agnostic"},{framework:null,id:"review-animations",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/frontend/review-animations",tier:"agnostic"},{framework:null,id:"business-finder",language:null,requiresTools:[],sourceDirectory:"skills/phases/business-finder",tier:"agnostic"},{framework:null,id:"finder-phase",language:null,requiresTools:[],sourceDirectory:"skills/phases/finder-phase",tier:"agnostic"},{framework:null,id:"functional-finder",language:null,requiresTools:[],sourceDirectory:"skills/phases/functional-finder",tier:"agnostic"},{framework:null,id:"goalify",language:null,requiresTools:[],sourceDirectory:"skills/phases/goalify",tier:"agnostic"},{framework:null,id:"grilling",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/requirements/grilling",tier:"agnostic"},{framework:null,id:"handoff",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/generic/handoff",tier:"agnostic"},{framework:null,id:"handback",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/generic/handback",tier:"agnostic"},{framework:null,id:"improve-codebase-architecture",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/research/improve-codebase-architecture",tier:"agnostic"},{framework:null,id:"implement-spec",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/planning/implement-spec",tier:"agnostic"},{framework:null,id:"technical-finder",language:null,requiresTools:[],sourceDirectory:"skills/phases/technical-finder",tier:"agnostic"},{framework:null,id:"verify-behavior",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/planning/verify-behavior",tier:"agnostic"},{framework:null,id:"repo-asset-management",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/repo-asset-management",tier:"agnostic"},{framework:null,id:"wayfinder",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/planning/wayfinder",tier:"agnostic"},{framework:"nextjs",id:"next-best-practices",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/nextjs/next-best-practices",tier:"framework"},{framework:"nextjs",id:"next-cache-components",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/nextjs/next-cache-components",tier:"framework"},{framework:null,id:"parallel-research",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/research/parallel-research",tier:"agnostic"},{framework:null,id:"prototype",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/research/prototype",tier:"agnostic"},{framework:null,id:"prototype-phase",language:null,requiresTools:[],sourceDirectory:"skills/phases/prototype-phase",tier:"agnostic"},{framework:null,id:"async-python-patterns",language:"python",requiresTools:[],sourceDirectory:"skills/languages/python/async-python-patterns",tier:"language"},{framework:null,id:"python-code-style",language:"python",requiresTools:[],sourceDirectory:"skills/languages/python/python-code-style",tier:"language"},{framework:null,id:"python-design-patterns",language:"python",requiresTools:[],sourceDirectory:"skills/languages/python/python-design-patterns",tier:"language"},{framework:null,id:"python-backend-structure",language:"python",requiresTools:[],sourceDirectory:"skills/languages/python/python-backend-structure",tier:"language"},{framework:null,id:"python-testing-patterns",language:"python",requiresTools:[],sourceDirectory:"skills/languages/python/python-testing-patterns",tier:"language"},{framework:null,id:"quality-types",language:"typescript",requiresTools:[],sourceDirectory:"skills/languages/typescript/quality-types",tier:"language"},{framework:null,id:"codebase-design",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/quality/codebase-design",tier:"agnostic"},{framework:"react",id:"async-react-patterns",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/react/async-react-patterns",tier:"framework"},{framework:"react",id:"react-doctor",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/react/react-doctor",tier:"framework"},{framework:null,id:"domain-modeling",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/requirements/domain-modeling",tier:"agnostic"},{framework:null,id:"requirements-grill",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/requirements/requirements-grill",tier:"agnostic"},{framework:null,id:"requirements-phase",language:null,requiresTools:[],sourceDirectory:"skills/phases/requirements-phase",tier:"agnostic"},{framework:null,id:"resolve-debt-phase",language:null,requiresTools:[],sourceDirectory:"skills/phases/resolve-debt-phase",tier:"agnostic"},{framework:null,id:"review-phase",language:null,requiresTools:[],sourceDirectory:"skills/phases/review-phase",tier:"agnostic"},{framework:null,id:"review",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/quality/review",tier:"agnostic"},{framework:null,id:"autoreview",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/quality/autoreview",tier:"agnostic"},{framework:null,id:"make-tsuite",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/quality/make-tsuite",tier:"agnostic"},{framework:null,id:"simplify",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/quality/simplify",tier:"agnostic"},{framework:null,id:"swarm-planner",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/subagents/swarm-planner",tier:"agnostic"},{framework:"tanstack-query",id:"tanstack-query",language:"typescript",requiresTools:["opensrc"],sourceDirectory:"skills/frameworks/tanstack-query/tanstack-query",tier:"framework"},{framework:null,id:"tdd",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/quality/tdd",tier:"agnostic"},{framework:null,id:"wait-what",language:null,requiresTools:[],sourceDirectory:"skills/misc/wait-what",tier:"agnostic"},{framework:null,id:"rule-authoring",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/docs/rule-authoring",tier:"agnostic"},{framework:null,id:"show-me",language:null,requiresTools:[],sourceDirectory:"skills/misc/show-me",tier:"agnostic"},{framework:null,id:"writing-for-agents",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/docs/writing-for-agents",tier:"agnostic"},{framework:null,id:"write-graph-based-skills",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/docs/write-graph-based-skills",tier:"agnostic"},{framework:"turborepo",id:"turborepo",language:null,requiresTools:[],sourceDirectory:"skills/frameworks/turborepo/turborepo",tier:"framework"},{framework:"react",id:"vercel-composition-patterns",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/react/vercel-composition-patterns",tier:"framework"},{framework:"react",id:"vercel-react-best-practices",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/react/vercel-react-best-practices",tier:"framework"},{framework:null,id:"write-backlog",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/requirements/write-backlog",tier:"agnostic"}];var skillIdPattern=/^[a-z0-9][a-z0-9._-]*$/u;var stripSkillIdCompatibilityProjectionRows=(skills,entries)=>{const compatibilitySources=new Map(entries.flatMap(({alias,compatibilitySourceDirectory})=>compatibilitySourceDirectory===undefined?[]:[[alias,compatibilitySourceDirectory]]));return skills.filter(({id,sourceDirectory})=>compatibilitySources.get(id)!==sourceDirectory)};var validateSkillIdAliases=(entries,skills)=>{const canonicalIds=new Set(skills.map(({id})=>id));const entriesByAlias=new Map;for(const entry of entries){if(!skillIdPattern.test(entry.alias)||!skillIdPattern.test(entry.canonicalId)){throw new Error(`Invalid skill ID alias: ${entry.alias} -> ${entry.canonicalId}`)}if(entry.kind!=="alias"&&entry.kind!=="rename"){throw new Error(`Invalid skill ID alias kind: ${entry.alias}`)}if(entry.compatibilitySourceDirectory!==undefined&&entry.compatibilitySourceDirectory===""){throw new Error(`Invalid skill ID alias compatibility source: ${entry.alias}`)}if(entriesByAlias.has(entry.alias)){throw new Error(`Duplicate skill ID alias: ${entry.alias}`)}if(canonicalIds.has(entry.alias)){throw new Error(`Skill ID alias collides with canonical skill: ${entry.alias}`)}if(entry.alias===entry.canonicalId){throw new Error(`Skill ID alias cannot map to itself: ${entry.alias}`)}entriesByAlias.set(entry.alias,entry)}const resolveTerminal=(entry)=>{const visited=new Set([entry.alias]);let target=entry.canonicalId;while(entriesByAlias.has(target)){if(visited.has(target)){throw new Error(`Skill ID alias cycle includes: ${target}`)}visited.add(target);target=entriesByAlias.get(target)?.canonicalId??target}if(!canonicalIds.has(target)){throw new Error(`Skill ID alias target is missing: ${entry.alias} -> ${target}`)}return target};return entries.map((entry)=>({...entry,canonicalId:resolveTerminal(entry)})).toSorted((left,right)=>left.alias.localeCompare(right.alias))};var skillIdAliasCatalog=validateSkillIdAliases([{alias:"python-project-structure",canonicalId:"python-backend-structure",compatibilitySourceDirectory:"skills/languages/python/python-project-structure",kind:"rename"},{alias:"writing-great-skills",canonicalId:"writing-for-agents",compatibilitySourceDirectory:"skills/agnostic/docs/writing-great-skills",kind:"rename"}],skillCatalog);var toolCatalog=[{ensureCommands:[["agent-browser","install"]],id:"agent-browser",latestInstallTarget:"agent-browser@latest",packageName:"agent-browser",requiredBins:["node"],skipEnsureCommandsIfAnyCommandExists:[{env:"AGENT_BROWSER_EXECUTABLE_PATH"},"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","google-chrome","google-chrome-stable","chromium","chromium-browser","brave-browser","brave-browser-stable","C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"]},{ensureCommands:[],id:"debug-agent",latestInstallTarget:"debug-agent@latest",packageName:"debug-agent",requiredBins:["node"]},{ensureCommands:[],id:"clawpatch",latestInstallTarget:"clawpatch@latest",packageName:"clawpatch",requiredBins:["node"]},{ensureCommands:[],id:"opensrc",latestInstallTarget:"opensrc@latest",minimumVersion:"0.7.2",packageName:"opensrc@^0.7.2",requiredBins:["node"],versionCommand:["opensrc","--version"]},{ensureCommands:[],id:"portless",latestInstallTarget:"portless@latest",packageName:"portless",requiredBins:["node"]},{ensureCommands:[],id:"skills",latestInstallTarget:"skills@latest",packageName:"skills",requiredBins:["node"]}];var bundledNpmInstallAliasManifest=[{expectedSha256:"d1a3b15bb12948cfbd82acdd54889efc5d1263809550cb4d379863bbc1cc2f82",logicalRelativePath:"frameworks/nestjs/nestjs-best-practices/.gitignore",physicalRelativePath:"frameworks/nestjs/nestjs-best-practices/.npmignore"}];var fileSha256=(filePath)=>createHash3("sha256").update(readFileSync3(filePath)).digest("hex");var npmIgnoreFiles=(root)=>{const files=[];const visit2=(directory3)=>{for(const entry of readdirSync2(directory3,{withFileTypes:true})){const absolutePath=path6.join(directory3,entry.name);if(entry.isDirectory()){visit2(absolutePath)}else if(entry.isFile()&&entry.name===".npmignore"){files.push(path6.relative(root,absolutePath).split(path6.sep).join("/"))}}};visit2(root);return files};var resolveBundledSkillAliases=(root)=>{const aliases=new Map;const expectedPhysicalPaths=new Set(bundledNpmInstallAliasManifest.map(({physicalRelativePath})=>physicalRelativePath));for(const relativePath of npmIgnoreFiles(root)){if(!expectedPhysicalPaths.has(relativePath)){throw new Error(`Bundled baseline contains an unexpected npm alias: ${relativePath}`)}}for(const alias of bundledNpmInstallAliasManifest){const logicalPath=path6.join(root,alias.logicalRelativePath);const physicalPath=path6.join(root,alias.physicalRelativePath);const hasLogical=existsSync2(logicalPath);const hasPhysical=existsSync2(physicalPath);if(hasLogical&&hasPhysical){throw new Error(`Bundled baseline npm alias is ambiguous: ${alias.logicalRelativePath}`)}let resolvedPath=null;if(hasLogical){resolvedPath=logicalPath}else if(hasPhysical){resolvedPath=physicalPath}if(resolvedPath===null){throw new Error(`Bundled baseline asset is missing: ${alias.logicalRelativePath}`)}if(fileSha256(resolvedPath)!==alias.expectedSha256){throw new Error(`Bundled baseline npm alias hash mismatch: ${alias.logicalRelativePath}`)}if(hasPhysical){aliases.set(alias.physicalRelativePath,alias.logicalRelativePath)}}return aliases};var logicalBundledSkillRelativePath=(relativePath)=>bundledNpmInstallAliasManifest.find(({physicalRelativePath})=>physicalRelativePath===relativePath)?.logicalRelativePath??relativePath;var bundledBaseline={dataRoot,hooks:hookCatalog,lintAssets:validateLintCatalog(lintCatalog),packs:packCatalog,root:path6.dirname(dataRoot),skillIdAliases:skillIdAliasCatalog,skills:skillCatalog,skillsRoot,summary:{authoritySource:"bundled",channel:"bundled",commit:null,compatibility:{cliVersionRange:`=${version2}`},digest:bundledBaselineDigest,provenance:"packaged-cli",requested:{channel:"bundled"},resolvedVersion:version2,retrieval:"available",sha256:bundledBaselineDigest,source:"bundled",tag:null,version:version2},tools:toolCatalog};var resolveVerifiedBundledBaseline=(requested=bundledBaseline.summary.requested,retrieval="available")=>{const aliases=resolveBundledSkillAliases(skillsRoot);const actualDigest=digestContentRoots([{include:(relativePath)=>!relativePath.endsWith(".ts")&&relativePath!=="CLAUDE.md",prefix:"data",root:dataRoot},{logicalPath:(relativePath)=>aliases.get(relativePath)??relativePath,prefix:"skills",root:skillsRoot}]);if(actualDigest!==bundledBaselineDigest){throw new BaselineIntegrityFailure({actualDigest,expectedDigest:bundledBaselineDigest,message:"Packaged baseline content no longer matches its verified identity.",request:requested,resolvedVersion:bundledBaseline.summary.resolvedVersion})}return{...bundledBaseline,summary:{...bundledBaseline.summary,channel:requested.channel,requested,retrieval}}};var packContents=packCatalog;var packContentsForBaseline=(baseline=bundledBaseline)=>baseline.packs;var packContentsByIdForBaseline=(baseline=bundledBaseline)=>{const contents={};for(const pack of packContentsForBaseline(baseline)){contents[pack.id]=pack}return contents};var packContentsById=packContentsByIdForBaseline();var defaultPackIds=packContents.filter((pack)=>pack.category==="default").map((pack)=>pack.id).toSorted();var languagePackIds=packContents.filter((pack)=>pack.category==="language").map((pack)=>pack.id).toSorted();var detectedPackIds=packContents.filter((pack)=>pack.category==="detected").map((pack)=>pack.id).toSorted();var surfacePackIds=packContents.filter((pack)=>pack.category==="surface").map((pack)=>pack.id).toSorted();var knownPackIds=packContents.map((pack)=>pack.id).toSorted();var defaultPackIdsForBaseline=(baseline=bundledBaseline)=>packContentsForBaseline(baseline).filter((pack)=>pack.category==="default").map((pack)=>pack.id).toSorted();var languagePackIdsForBaseline=(baseline=bundledBaseline)=>packContentsForBaseline(baseline).filter((pack)=>pack.category==="language").map((pack)=>pack.id).toSorted();var detectedPackIdsForBaseline=(baseline=bundledBaseline)=>packContentsForBaseline(baseline).filter((pack)=>pack.category==="detected").map((pack)=>pack.id).toSorted();var surfacePackIdsForBaseline=(baseline=bundledBaseline)=>packContentsForBaseline(baseline).filter((pack)=>pack.category==="surface").map((pack)=>pack.id).toSorted();var knownPackIdsForBaseline=(baseline=bundledBaseline)=>packContentsForBaseline(baseline).map((pack)=>pack.id).toSorted();var skillsForPack=(packId,baseline=bundledBaseline)=>packContentsByIdForBaseline(baseline)[packId]?.skills??[];var lintAssetsForPack=(packId,baseline=bundledBaseline)=>packContentsByIdForBaseline(baseline)[packId]?.lintAssets??[];var hooksForPack=(packId,baseline=bundledBaseline)=>packContentsByIdForBaseline(baseline)[packId]?.hooks??[];var promptDetailsForPack=(packId,baseline=bundledBaseline)=>packContentsByIdForBaseline(baseline)[packId]?.promptDetails??[];var exampleRepositoriesForPack=(packId,baseline=bundledBaseline)=>packContentsByIdForBaseline(baseline)[packId]?.exampleRepositories??[];var formatToolBootstrapStatus=(entry)=>{switch(entry.status){case"already-present":{return"already present"}case"installed":{return"installed during scaffold"}case"failed":{return"bootstrap failed"}default:{return entry.status}}};var formatToolBootstrapFailureDetails=(statuses)=>{const failures=statuses.filter((entry)=>entry.status==="failed");if(failures.length===0){return null}return["Required tool bootstrap failed, but scaffold/update output can still be written.","","Agent recovery prompt:","Read `.devpunks/settings.json`, verify each listed required tool manually, then fix the failed install before deeper repo work. If `agent-browser` failed while installing Chromium, install or repair that browser dependency outside the scaffold command, then rerun `agent-browser install` or the documented tool check.","","Failure stack traces:",...failures.flatMap((failure)=>["",`--- ${failure.toolId} ---`,failure.errorStack??failure.errorMessage??"Unknown tool bootstrap failure."])].join(`
285
+ `}else if(field==="event"){eventName=value3}else if(field==="id"&&!value3.includes("\x00")){eventId=value3;lastEventId=value3}else if(field==="retry"){const retry5=parseInt(value3,10);if(!Number.isNaN(retry5)){onParse(new Retry({duration:millis(retry5),lastEventId}))}}}}var BOM=[239,187,191];function hasBom(buffer2){return BOM.every((charCode,index)=>buffer2.charCodeAt(index)===charCode)}var EventEncoded=Struct({id:optional(String4),event:String4,data:String4});var RetryTypeId="~effect/encoding/Sse/Retry";class Retry extends TaggedClass("Retry"){[RetryTypeId]=RetryTypeId;static is(u){return hasProperty(u,RetryTypeId)}static filter(u){return Retry.is(u)?succeed2(u):fail2(u)}}var SecurityTypeId="~effect/httpapi/HttpApiMiddleware/Security";var isSecurity=(u)=>hasProperty(u,SecurityTypeId);var exports_OpenApi={};__export(exports_OpenApi,{fromApi:()=>fromApi,annotations:()=>annotations,Version:()=>Version2,Transform:()=>Transform,Title:()=>Title,Summary:()=>Summary,Servers:()=>Servers,Override:()=>Override,License:()=>License,Identifier:()=>Identifier,Format:()=>Format,ExternalDocs:()=>ExternalDocs,Exclude:()=>Exclude,Description:()=>Description,Deprecated:()=>Deprecated});var toJsonAnnotationsBlacklist=new Set([...fromASTBlacklist,"expected","contentMediaType","contentSchema"]);var fromASTs2=fromASTs;var toJsonSchemaMultiDocument2=toJsonSchemaMultiDocument;var toCodeAnnotationsBlacklist=new Set([...toJsonAnnotationsBlacklist,"typeConstructor","generation","brands"]);class Identifier extends Service()("effect/httpapi/OpenApi/Identifier"){}class Title extends Service()("effect/httpapi/OpenApi/Title"){}class Version2 extends Service()("effect/httpapi/OpenApi/Version"){}class Description extends Service()("effect/httpapi/OpenApi/Description"){}class License extends Service()("effect/httpapi/OpenApi/License"){}class ExternalDocs extends Service()("effect/httpapi/OpenApi/ExternalDocs"){}class Servers extends Service()("effect/httpapi/OpenApi/Servers"){}class Format extends Service()("effect/httpapi/OpenApi/Format"){}class Summary extends Service()("effect/httpapi/OpenApi/Summary"){}class Deprecated extends Service()("effect/httpapi/OpenApi/Deprecated"){}class Override extends Service()("effect/httpapi/OpenApi/Override"){}var Exclude=Reference("effect/httpapi/OpenApi/Exclude",{defaultValue:constFalse});class Transform extends Service()("effect/httpapi/OpenApi/Transform"){}var servicesPartial=(tags)=>{const entries=Object.entries(tags);return(options4)=>{let context3=empty();for(const[key,tag2]of entries){if(options4[key]!==undefined){context3=add(context3,tag2,options4[key])}}return context3}};var annotations=servicesPartial({identifier:Identifier,title:Title,version:Version2,description:Description,license:License,summary:Summary,deprecated:Deprecated,externalDocs:ExternalDocs,servers:Servers,format:Format,override:Override,exclude:Exclude,transform:Transform});var apiCache=new WeakMap;function processAnnotation(ctx,annotation,f){const o=getOption(ctx,annotation);if(isSome2(o)){f(o.value)}}function fromApi(api){const cached3=apiCache.get(api);if(cached3!==undefined){return cached3}let spec={openapi:"3.1.0",info:{title:"Api",version:"0.0.1"},paths:{},components:{schemas:{},securitySchemes:{}},security:[],tags:[]};const pathOps=[];const pathOperations=new Set;const operationIds=new Set;processAnnotation(api.annotations,Title,(title)=>{spec.info.title=title});processAnnotation(api.annotations,Version2,(version2)=>{spec.info.version=version2});processAnnotation(api.annotations,Description,(description)=>{spec.info.description=description});processAnnotation(api.annotations,License,(license)=>{spec.info.license=license});processAnnotation(api.annotations,Summary,(summary)=>{spec.info.summary=summary});processAnnotation(api.annotations,Servers,(servers)=>{spec.servers=[...servers]});reflect(api,{onGroup({group}){if(get(group.annotations,Exclude)){return}let tag2={name:getOrElse2(group.annotations,Title,()=>group.identifier)};processAnnotation(group.annotations,Description,(description)=>{tag2.description=description});processAnnotation(group.annotations,ExternalDocs,(externalDocs)=>{tag2.externalDocs=externalDocs});processAnnotation(group.annotations,Override,(override)=>{Object.assign(tag2,override)});processAnnotation(group.annotations,Transform,(transformFn)=>{tag2=transformFn(tag2)});spec.tags.push(tag2)},onEndpoint({endpoint,group,mergedAnnotations,middleware:middleware2}){if(get(mergedAnnotations,Exclude)){return}let op={tags:[getOrElse2(group.annotations,Title,()=>group.identifier)],operationId:getOrElse2(endpoint.annotations,Identifier,()=>group.topLevel?endpoint.identifier:`${group.identifier}.${endpoint.identifier}`),parameters:[],security:[],responses:{}};const path4=endpoint.path.replace(/:(\w+)\??/g,"{$1}");const method=endpoint.method.toLowerCase();function processResponseBodies(bodies,defaultDescription){for(const[status2,{content,descriptions,streamContent}]of bodies){const description=descriptions.size>0?Array.from(descriptions).join(" | "):defaultDescription();op.responses[status2]={description};if(content!==undefined){content.forEach((map15,encoding)=>{map15.forEach((schemas,contentType)=>{const asts=Array.from(schemas,getAST);const ast=asts.length===1?asts[0]:new Union(asts,"anyOf");pathOps.push({_tag:"schema",ast:toEncodingAST(ast,encoding),path:["paths",path4,method,"responses",String(status2),"content",contentType,"schema"]});op.responses[status2].content??={};op.responses[status2].content[contentType]={schema:{}}})})}if(streamContent!==undefined){streamContent.forEach((stream2,contentType)=>{op.responses[status2].content??={};if(isStreamSse(stream2)){pathOps.push({_tag:"schema",ast:getAST(stream2.events),path:["paths",path4,method,"responses",String(status2),"content",contentType,"schema"]});pathOps.push({_tag:"schema",ast:getAST(toCodecJson(Cause(stream2.error,Defect()))),path:["paths",path4,method,"responses",String(status2),"content",contentType,"x-effect-stream","causeSchema"]});pathOps.push({_tag:"schema",ast:getAST(stream2.error),path:["paths",path4,method,"responses",String(status2),"content",contentType,"x-effect-stream","errorSchema"]});op.responses[status2].content[contentType]={schema:{},"x-effect-stream":{encoding:"sse",causeSchema:{},errorSchema:{},failureEvent:reservedStreamFailureEvent2}}}else{op.responses[status2].content[contentType]={schema:{type:"string",format:"binary"},"x-effect-stream":{encoding:"uint8array"}}}})}}}function processParameters(schema2,i){if(schema2){const ast=getLastEncoding(schema2.ast);if(isObjects(ast)){for(const ps of ast.propertySignatures){op.parameters.push({name:String(ps.name),in:i,schema:{},required:i==="path"||!isOptional(ps.type)});pathOps.push({_tag:"parameter",ast:ps.type,path:["paths",path4,method,"parameters",String(op.parameters.length-1),"schema"]})}}}}processAnnotation(endpoint.annotations,Description,(description)=>{op.description=description});processAnnotation(endpoint.annotations,Summary,(summary)=>{op.summary=summary});processAnnotation(endpoint.annotations,Deprecated,(deprecated)=>{op.deprecated=deprecated});processAnnotation(endpoint.annotations,ExternalDocs,(externalDocs)=>{op.externalDocs=externalDocs});middleware2.forEach((middleware3)=>{if(!isSecurity(middleware3)){return}for(const[name,security]of Object.entries(middleware3.security)){processHttpApiSecurity(name,security);op.security.push({[name]:[]})}});function processHttpApiSecurity(name,security){const scheme=makeSecurityScheme(security);if(!Object.hasOwn(spec.components.securitySchemes,name)){set(spec.components.securitySchemes,name,scheme);return}if(!equals(securitySchemeForComparison(spec.components.securitySchemes[name]),securitySchemeForComparison(scheme))){throw new globalThis.Error(`Conflicting OpenAPI security scheme: ${name}`)}}const hasBody2=hasBody(endpoint.method);if(hasBody2){const schemasByContentType=new Map;for(const schema2 of getPayloadSchemas(endpoint)){if(isNoContent(schema2.ast))continue;const encoding=getPayloadEncoding(schema2.ast,endpoint.method);const existing=schemasByContentType.get(encoding.contentType);if(existing===undefined){schemasByContentType.set(encoding.contentType,{encoding,schemas:[schema2]})}else{existing.schemas.push(schema2)}}if(schemasByContentType.size>0){const content={};for(const[contentType,{encoding,schemas}]of schemasByContentType){const asts=schemas.map(getAST);const ast=asts.length===1?asts[0]:new Union(asts,"anyOf");pathOps.push({_tag:"schema",ast:toEncodingAST(ast,encoding._tag),path:["paths",path4,method,"requestBody","content",contentType,"schema"]});content[contentType]={schema:{}}}op.requestBody={content,required:true}}}processParameters(endpoint.params,"path");if(!hasBody2&&endpoint.payload.size===1){const entry=endpoint.payload.values().next().value;processParameters(entry.schemas[0],"query")}processParameters(endpoint.headers,"header");processParameters(endpoint.query,"query");processResponseBodies(extractSuccessResponseBodies(endpoint),()=>"Success");processResponseBodies(extractResponseBodies(getErrorSchemas(endpoint),getStatusError,resolveDescriptionOrIdentifier),()=>"Error");processAnnotation(endpoint.annotations,Override,(override)=>{Object.assign(op,override)});processAnnotation(endpoint.annotations,Transform,(transformFn)=>{op=transformFn(op)});const pathOperation=`${method} ${path4.replace(/\{[^}]+\}/g,"{}")}`;if(pathOperations.has(pathOperation)){throw new globalThis.Error(`Duplicate OpenAPI operation for ${endpoint.method} ${path4}`)}const operationId=op.operationId;if(operationId!==undefined){if(operationIds.has(operationId)){throw new globalThis.Error(`Duplicate OpenAPI operationId: ${operationId}`)}operationIds.add(operationId)}pathOperations.add(pathOperation);if(!spec.paths[path4]){spec.paths[path4]={}}spec.paths[path4][method]=op}});processAnnotation(api.annotations,AdditionalSchemas,(componentSchemas)=>{componentSchemas.forEach((componentSchema)=>{const identifier2=resolveIdentifier2(componentSchema.ast);if(identifier2!==undefined){if(identifier2 in spec.components.schemas){throw new globalThis.Error(`Duplicate component schema identifier: ${identifier2}`)}spec.components.schemas[identifier2]={};pathOps.push({_tag:"schema",ast:componentSchema.ast,path:["components","schemas",identifier2]})}})});function escapePath(path4){return"/"+path4.map(escapeToken).join("/")}if(isArrayNonEmpty2(pathOps)){const multiDocument=fromASTs2(map3(pathOps,(op)=>op.ast));const jsonSchemaMultiDocument=toMultiDocumentOpenApi3_1(toJsonSchemaMultiDocument2(multiDocument));const patchOps=pathOps.map((op,i)=>{const oppath=escapePath(op.path);const value3=jsonSchemaMultiDocument.schemas[i];return{op:"replace",path:oppath,value:value3}});Object.entries(jsonSchemaMultiDocument.definitions).forEach(([name,definition])=>{patchOps.push({op:"add",path:escapePath(["components","schemas",name]),value:definition})});spec=apply(patchOps,spec)}Object.keys(spec.components.schemas).forEach((key)=>{if(!VALID_OPEN_API_COMPONENTS_SCHEMAS_KEY_REGEXP.test(key)){throw new globalThis.Error(`Invalid component schema key: ${key}`)}});processAnnotation(api.annotations,Override,(override)=>{Object.assign(spec,override)});processAnnotation(api.annotations,Transform,(transformFn)=>{spec=transformFn(spec)});apiCache.set(api,spec);return spec}var reservedStreamFailureEvent2="effect/httpapi/stream/failure";function extractSuccessResponseBodies(endpoint){return extractResponseBodies(getSuccessSchemas(endpoint),getStatusSuccess,resolveDescriptionOrIdentifier)}function extractResponseBodies(schemas,getStatus,getDescription){const map15=new Map;schemas.forEach(process2);return map15;function process2(schema2){if(isStreamSchema(schema2)){addStreamContent(schema2);return}const ast=schema2.ast;const status2=getStatus(ast);if(isNoContent(ast)){addNoContent(status2,getDescription(schema2.ast)??"<No Content>")}else{addContent(schema2,status2,getResponseEncoding(ast))}}function addNoContent(status2,description){const statusMap=map15.get(status2);if(statusMap===undefined){map15.set(status2,{descriptions:new Set([description]),content:undefined,streamContent:undefined})}else{if(description!==undefined){statusMap.descriptions.add(description)}}}function addContent(schema2,status2,encoding){const description=getDescription(schema2.ast);const statusMap=map15.get(status2);const{_tag,contentType}=encoding;if(statusMap===undefined){map15.set(status2,{descriptions:new Set(description!==undefined?[description]:[]),content:new Map([[_tag,new Map([[contentType,new Set([schema2])]])]]),streamContent:undefined})}else{if(description!==undefined){statusMap.descriptions.add(description)}if(statusMap.content===undefined){statusMap.content=new Map([[_tag,new Map([[contentType,new Set([schema2])]])]])}else{const schemasByContentType=statusMap.content.get(_tag);if(schemasByContentType===undefined){statusMap.content.set(_tag,new Map([[contentType,new Set([schema2])]]))}else{const set5=schemasByContentType.get(contentType);if(set5===undefined){schemasByContentType.set(contentType,new Set([schema2]))}else{set5.add(schema2)}}}}}function addStreamContent(stream2){const status2=getStatusStream(stream2);const statusMap=map15.get(status2);if(statusMap===undefined){map15.set(status2,{descriptions:new Set,content:undefined,streamContent:new Map([[stream2.contentType,stream2]])})}else if(statusMap.streamContent===undefined){statusMap.streamContent=new Map([[stream2.contentType,stream2]])}else{statusMap.streamContent.set(stream2.contentType,stream2)}}}function resolveDescriptionOrIdentifier(ast){return resolveDescription2(ast)??resolveIdentifier2(ast)}var Uint8ArrayEncoding=String4.annotate({format:"binary"});function toEncodingAST(ast,_tag){switch(_tag){case"Uint8Array":return Uint8ArrayEncoding.ast;case"Text":return String4.ast;case"FormUrlEncoded":case"Json":return ast;case"Multipart":return persistedFileToBinaryEncoding(ast)}}function persistedFileToBinaryEncoding(ast){if(isDeclaration(ast)&&ast.annotations?.typeConstructor?._tag==="effect/http/PersistedFile"){return Uint8ArrayEncoding.ast}if(typeof ast?.recur==="function"){return ast.recur(persistedFileToBinaryEncoding)}return ast}var makeSecurityScheme=(security)=>{const meta={};processAnnotation(security.annotations,Description,(description)=>{meta.description=description});switch(security._tag){case"Basic":{return{...meta,type:"http",scheme:"basic"}}case"Http":{const format3=getOption(security.annotations,Format).pipe(map((format4)=>({bearerFormat:format4})),getOrUndefined);return{...meta,type:"http",scheme:security.scheme,...format3}}case"ApiKey":{return{...meta,type:"apiKey",name:security.key,in:security.in}}}};var securitySchemeForComparison=(scheme)=>{if(scheme.type==="http"){return{...scheme,scheme:scheme.scheme.toLowerCase()}}if(scheme.in==="header"){return{...scheme,name:scheme.name.toLowerCase()}}return scheme};var exports_HttpApiClient={};__export(exports_HttpApiClient,{urlBuilder:()=>urlBuilder,makeWith:()=>makeWith3,makeClient:()=>makeClient,make:()=>make38,group:()=>group,endpoint:()=>endpoint});var makeClient=(api,options4)=>gen2(function*(){const services=yield*context2();const httpClient=options4.httpClient.pipe(options4?.baseUrl===undefined?identity:mapRequest(prependUrl(options4.baseUrl.toString())));function executeMiddleware(group,endpoint,request,middlewareKeys,index){if(index===-1){return httpClient.execute(request)}const middleware2=services.mapUnsafe.get(middlewareKeys[index]);if(middleware2===undefined){return executeMiddleware(group,endpoint,request,middlewareKeys,index-1)}return middleware2({endpoint,group,request,next(request2){return executeMiddleware(group,endpoint,request2,middlewareKeys,index-1)}})}reflect(api,{predicate:options4?.predicate,onGroup(onGroupOptions){options4.onGroup?.(onGroupOptions)},onEndpoint(onEndpointOptions){const{group,endpoint,errors:errors2,successes}=onEndpointOptions;const makeUrl=compilePath(endpoint.path);const decodeMap={orElse:statusOrElse};const decodeResponse=matchStatus(decodeMap);const errorAlternatives=new Map;for(const[status2,schemas]of errors2.entries()){const grouped=groupSchemasByContentType(schemas);for(const[contentType,schemas2]of grouped.entries()){addResponseAlternative(errorAlternatives,status2,contentType,schemasToResponse(schemas2))}}for(const[status2,alternatives]of errorAlternatives.entries()){const decode3=makeResponseDecoder(alternatives);decodeMap[status2]=(response)=>flatMap3(catchCause2(decode3(response),(cause)=>failCause3(combine2(fail5(new HttpClientError({reason:new StatusCodeError({request:response.request,response})})),cause))),fail6)}const successAlternatives=new Map;for(const[status2,schemas]of successes.entries()){const grouped=groupSchemasByContentType(schemas);for(const[contentType,schemas2]of grouped.entries()){addResponseAlternative(successAlternatives,status2,contentType,schemasToResponse(schemas2))}}for(const streamSuccess of getStreamSuccessSchemas(endpoint)){addResponseAlternative(successAlternatives,getStatusStream(streamSuccess),streamSuccess.contentType,streamToResponse(streamSuccess))}for(const[status2,alternatives]of successAlternatives.entries()){decodeMap[status2]=makeResponseDecoder(alternatives)}const encodeParams=map10(endpoint.params,encodeUnknownEffect2);const payloadSchemas=getPayloadSchemas(endpoint);const encodePayload=isArrayNonEmpty2(payloadSchemas)?hasBody(endpoint.method)?encodeUnknownEffect2(getEncodePayloadSchema(payloadSchemas,endpoint.method)):encodeUnknownEffect2(Union2(payloadSchemas)):undefined;const encodeHeaders=map10(endpoint.headers,encodeUnknownEffect2);const encodeQuery=map10(endpoint.query,encodeUnknownEffect2);const middlewareKeys=Array.from(onEndpointOptions.middleware,(tag2)=>`${tag2.key}/Client`);const endpointFn=fnUntraced2(function*(request){let httpRequest=make34(endpoint.method)(endpoint.path);if(request!==undefined){if(encodeParams!==undefined){const params=yield*encodeParams(request.params);httpRequest=setUrl(httpRequest,makeUrl(params))}if(encodePayload!==undefined){if(hasBody(endpoint.method)){if(request.payload instanceof FormData){httpRequest=bodyFormData(httpRequest,request.payload)}else{const body=yield*encodePayload(request.payload);httpRequest=setBody(httpRequest,body)}}else{const urlParams2=yield*encodePayload(request.payload);httpRequest=appendUrlParams(httpRequest,urlParams2)}}if(encodeHeaders!==undefined){const headers=yield*encodeHeaders(request.headers);httpRequest=setHeaders(httpRequest,headers)}if(encodeQuery!==undefined){const query=yield*encodeQuery(request.query);httpRequest=appendUrlParams(httpRequest,query)}}const response=yield*executeMiddleware(group,endpoint,httpRequest,middlewareKeys,middlewareKeys.length-1);if(request?.responseMode==="response-only"){return response}const value3=yield*options4.transformResponse===undefined?decodeResponse(response):options4.transformResponse(decodeResponse(response));return request?.responseMode==="decoded-and-response"?[value3,response]:value3});options4.onEndpoint({...onEndpointOptions,endpointFn})}})});var make38=(api,options4)=>flatMap3(HttpClient,(httpClient)=>makeWith3(api,{...options4,httpClient:options4?.transformClient?options4.transformClient(httpClient):httpClient}));var makeWith3=(api,options4)=>{const client={};return makeClient(api,{...options4,onGroup({group}){if(group.topLevel)return;set(client,group.identifier,{})},onEndpoint({endpoint,endpointFn,group}){set(group.topLevel?client:client[group.identifier],endpoint.identifier,endpointFn)}}).pipe(as2(client))};var group=(api,options4)=>{const client={};return makeClient(api,{...options4,predicate:({group:group2})=>group2.identifier===options4.group,onEndpoint({endpoint,endpointFn}){set(client,endpoint.identifier,endpointFn)}}).pipe(map6(()=>client))};var endpoint=(api,options4)=>{let client=undefined;return makeClient(api,{...options4,httpClient:options4.transformClient?options4.transformClient(options4.httpClient):options4.httpClient,predicate:({endpoint:endpoint2,group:group2})=>group2.identifier===options4.group&&endpoint2.identifier===options4.endpoint,onEndpoint({endpointFn}){client=endpointFn}}).pipe(map6(()=>client))};var urlBuilder=(api,options4)=>{const builder={};reflect(api,{onGroup({group:group2}){if(group2.topLevel)return;set(builder,group2.identifier,{})},onEndpoint({group:group2,endpoint:endpoint2}){const makeUrl=compilePath(endpoint2.path);const encodeParams=endpoint2.params===undefined?undefined:encodeSync2(endpoint2.params);const encodeQuery=endpoint2.query===undefined?undefined:encodeSync2(endpoint2.query);const endpointBuilder=(request)=>{const params=request?.params;const path4=params===undefined?endpoint2.path:makeUrl(encodeParams===undefined?params:encodeParams(params));const queryInput=request?.query===undefined?undefined:encodeQuery===undefined?request.query:encodeQuery(request.query);const query=queryInput===undefined?"":toString(fromInput2(queryInput));const url=query===""?path4:`${path4}?${query}`;return options4?.baseUrl===undefined?url:new URL(url,options4.baseUrl.toString()).toString()};set(group2.topLevel?builder:builder[group2.identifier],endpoint2.identifier,endpointBuilder)}});return builder};var paramsRegExp=/(\/?):(\w+)(\?)?/g;var compilePath=(path4)=>{if(!paramsRegExp.test(path4)){return(_)=>path4}paramsRegExp.lastIndex=0;return(params)=>{paramsRegExp.lastIndex=0;return path4.replace(paramsRegExp,(_,slash,key,optional4)=>{const value3=params[key];if(value3===undefined){if(optional4!==undefined){return""}throw new Error(`Missing path parameter: ${key}`)}return`${slash}${encodeURIComponent(value3)}`})}};function schemasToResponse(schemas){const codec=toCodecArrayBuffer(schemas);const decode3=decodeEffect2(codec);return(response)=>flatMap3(response.arrayBuffer,decode3)}function addResponseAlternative(map15,status2,contentType,decode3){const normalizedContentType=normalize(contentType);const alternatives=map15.get(status2);if(alternatives===undefined){map15.set(status2,[{contentType:normalizedContentType,decode:decode3}])}else{alternatives.push({contentType:normalizedContentType,decode:decode3})}}function makeResponseDecoder(alternatives){const first=alternatives[0];if(alternatives.length===1&&first!==undefined){return first.decode}return(response)=>{const contentType=normalize(response.headers["content-type"]??"");const alternative=alternatives.find((alternative2)=>alternative2.contentType===contentType);return alternative===undefined?failUnsupportedContentType(response,contentType,alternatives):alternative.decode(response)}}function groupSchemasByContentType(schemas){const grouped=new Map;for(const schema2 of schemas){const contentType=isNoContent(schema2.ast)?"":normalize(getResponseEncoding(schema2.ast).contentType);const existing=grouped.get(contentType);if(existing===undefined){grouped.set(contentType,[schema2])}else{existing.push(schema2)}}return grouped}function failUnsupportedContentType(response,contentType,alternatives){const expected=Array.from(new Set(alternatives.map((alternative)=>alternative.contentType))).join(", ");return fail6(new HttpClientError({reason:new DecodeError({request:response.request,response,description:`Unsupported response content-type for status ${response.status}: ${contentType||"<missing>"}. Expected one of: ${expected}`})}))}var reservedStreamFailureEvent3="effect/httpapi/stream/failure";function getStreamSuccessSchemas(endpoint2){const schemas=[];for(const schema2 of endpoint2.success){if(isStreamSchema(schema2)){schemas.push(schema2)}}return schemas}function streamToResponse(streamSchema2){const sse=isStreamUint8Array(streamSchema2)?undefined:{declaration:streamSchema2,decoder:makeSseDecoder(streamSchema2)};return(response)=>map6(context2(),(context3)=>provideContext4(sse===undefined?response.stream:decodeSseStream(response.stream,sse.declaration,sse.decoder),context3))}function makeSseDecoder(declaration){const Event=Union2([Struct({event:Literal2(reservedStreamFailureEvent3),data:fromJsonString2(toCodecJson(Cause(declaration.error,Defect())))}),declaration.events]);return decodeSchema(Event)}function decodeSseStream(stream2,declaration,decoder){const events=transformPull2(stream2.pipe(decodeText,pipeThroughChannel(decoder)),(pull)=>sync2(()=>{let pendingFailureCause=undefined;return suspend2(()=>{if(pendingFailureCause!==undefined){return failCause3(pendingFailureCause)}return flatMap3(pull,(events2)=>{for(let i=0;i<events2.length;i++){const event=events2[i];if(event.event===reservedStreamFailureEvent3&&isCause2(event.data)){if(i===0){return failCause3(event.data)}pendingFailureCause=event.data;events2=events2.slice(0,i);break}}return succeed6(events2)})})}));if(declaration.sseMode==="data"){return map9(events,(event)=>event.data)}return events}var ArrayBuffer2=instanceOf(globalThis.ArrayBuffer,{expected:"ArrayBuffer"});var Uint8ArrayFromArrayBuffer=ArrayBuffer2.pipe(decodeTo2(Uint8Array2,transform2({decode(fromA){return new Uint8Array(fromA)},encode(arr){return arr.byteLength===arr.buffer.byteLength?arr.buffer:arr.buffer.slice(arr.byteOffset,arr.byteOffset+arr.byteLength)}})));var StringFromArrayBuffer=ArrayBuffer2.pipe(decodeTo2(String4,transform2({decode(fromA){return new TextDecoder().decode(fromA)},encode(toI){const arr=new TextEncoder().encode(toI);return arr.byteLength===arr.buffer.byteLength?arr.buffer:arr.buffer.slice(arr.byteOffset,arr.byteOffset+arr.byteLength)}})));var UnknownFromArrayBuffer=StringFromArrayBuffer.pipe(decodeTo2(Union2([Literal2("").pipe(decodeTo2(Undefined2,transform2({decode:()=>{return},encode:()=>""}))),UnknownFromJsonString])));function toCodecArrayBuffer(schemas){return Union2(schemas.map(onSchema));function onSchema(schema2){const encoding=getResponseEncoding(schema2.ast);switch(encoding._tag){case"Json":{const encodedIsNull=isNull(toEncoded(schema2.ast));return UnknownFromArrayBuffer.pipe(decodeTo2(schema2,encodedIsNull?transform2({decode:(a)=>a===undefined?null:a,encode:(a)=>a===null?undefined:a}):undefined))}case"FormUrlEncoded":return StringFromArrayBuffer.pipe(decodeTo2(schemaRecord),decodeTo2(schema2));case"Uint8Array":return Uint8ArrayFromArrayBuffer.pipe(decodeTo2(schema2));case"Text":return StringFromArrayBuffer.pipe(decodeTo2(schema2))}}}var statusOrElse=(response)=>fail6(new HttpClientError({reason:new DecodeError({request:response.request,response})}));var $HttpBody=declare(isHttpBody);function getEncodePayloadSchema(schemas,method){return Union2(schemas.map((s)=>getEncodePayloadSchemaFromBody(s,method)))}var bodyFromPayloadCache=new WeakMap;function getEncodePayloadSchemaFromBody(schema2,method){const ast=schema2.ast;const cached3=bodyFromPayloadCache.get(ast);if(cached3!==undefined){return cached3}const encoding=getPayloadEncoding(ast,method);const out=$HttpBody.pipe(decodeTo2(schema2,transformOrFail2({decode(httpBody){return fail6(new Forbidden(some2(httpBody),{message:"Encode only schema"}))},encode(t){switch(encoding._tag){case"Multipart":return fail6(new Forbidden(some2(t),{message:"Payload must be a FormData"}));case"Json":{try{const body=JSON.stringify(t);return succeed6(text2(body,encoding.contentType))}catch(error2){return fail6(new InvalidValue(some2(t),{message:globalThis.String(error2)}))}}case"Text":{if(typeof t!=="string"){return fail6(new InvalidValue(some2(t),{message:"Expected a string"}))}return succeed6(text2(t,encoding.contentType))}case"FormUrlEncoded":{if(!isObject(t)){return fail6(new InvalidValue(some2(t),{message:"Expected a record"}))}return succeed6(urlParams(fromInput2(t),encoding.contentType))}case"Uint8Array":{if(!(t instanceof Uint8Array)){return fail6(new InvalidValue(some2(t),{message:"Expected a Uint8Array"}))}return succeed6(uint8Array(t,encoding.contentType))}}}})));bodyFromPayloadCache.set(ast,out);return out}var exports_HttpApiGroup={};__export(exports_HttpApiGroup,{make:()=>make39,isHttpApiGroup:()=>isHttpApiGroup});var TypeId48="~effect/httpapi/HttpApiGroup";var isHttpApiGroup=(u)=>hasProperty(u,TypeId48);var Proto17={[TypeId48]:TypeId48,add(...toAdd){const endpoints={...this.endpoints};for(const endpoint2 of toAdd){set(endpoints,endpoint2.identifier,endpoint2)}return makeProto3({...optionsFromGroup(this),endpoints})},prefix(prefix){return makeProto3({...optionsFromGroup(this),endpoints:map2(this.endpoints,(endpoint2)=>endpoint2.prefix(prefix))})},middleware(middleware2){return makeProto3({...optionsFromGroup(this),endpoints:map2(this.endpoints,(endpoint2)=>endpoint2.middleware(middleware2))})},annotateMerge(annotations2){return makeProto3({...optionsFromGroup(this),annotations:merge(this.annotations,annotations2)})},annotate(annotation,value3){return makeProto3({...optionsFromGroup(this),annotations:add(this.annotations,annotation,value3)})},annotateEndpointsMerge(annotations2){return makeProto3({...optionsFromGroup(this),endpoints:map2(this.endpoints,(endpoint2)=>endpoint2.annotateMerge(annotations2))})},annotateEndpoints(annotation,value3){return makeProto3({...optionsFromGroup(this),endpoints:map2(this.endpoints,(endpoint2)=>endpoint2.annotate(annotation,value3))})},pipe(){return pipeArguments(this,arguments)}};var optionsFromGroup=(group2)=>({identifier:group2.identifier,topLevel:group2.topLevel,endpoints:group2.endpoints,annotations:group2.annotations});var makeProto3=(options4)=>{function HttpApiGroup(){}Object.setPrototypeOf(HttpApiGroup,Proto17);HttpApiGroup.key=`effect/httpapi/HttpApiGroup/${options4.identifier}`;return Object.assign(HttpApiGroup,options4)};var make39=(identifier2,options4)=>makeProto3({identifier:identifier2,topLevel:options4?.topLevel??false,endpoints:{},annotations:empty()});var defaultMessage=(message)=>String4.pipe(optionalKey2,withConstructorDefault2(succeed6(message)));var BaselineChannel=Literals(["stable","bundled"]);var HarnessReportStatus=Literals(["new","triaged","accepted","wontfix","resolved"]);var OperatorIdentity=Struct({operatorId:String4,email:optionalKey2(String4),emailVerified:optionalKey2(Boolean3)}).annotate({identifier:"OperatorIdentity"});var isoDateTimePattern=/^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})T(?<hour>\d{2}):(?<minute>\d{2}):(?<second>\d{2})(?:\.(?<fraction>\d{1,9}))?(?:Z|[+-]\d{2}:\d{2})$/u;var isValidIsoDateTime=(value3)=>{const groups=isoDateTimePattern.exec(value3)?.groups;if(groups===undefined){return false}const year=Number(groups.year);const month=Number(groups.month);const day=Number(groups.day);const hour=Number(groups.hour);const minute=Number(groups.minute);const second=Number(groups.second);const millisecond=Number((groups.fraction??"").slice(0,3).padEnd(3,"0"));const date5=new Date(Date.UTC(year,month-1,day,hour,minute,second,millisecond));return Number.isFinite(Date.parse(value3))&&date5.getUTCFullYear()===year&&date5.getUTCMonth()===month-1&&date5.getUTCDate()===day&&date5.getUTCHours()===hour&&date5.getUTCMinutes()===minute&&date5.getUTCSeconds()===second};var IsoDateTimeString=String4.pipe(refine((value3)=>isValidIsoDateTime(value3),{identifier:"IsoDateTimeString",description:"an ISO 8601 datetime string with timezone"}));var GitIdentity=Struct({name:optionalKey2(String4),email:optionalKey2(String4)}).annotate({identifier:"GitIdentity"});var ObservedRepositoryInput=Struct({remoteUrl:optionalKey2(String4),remoteHost:optionalKey2(String4),remotePath:optionalKey2(String4),branch:optionalKey2(String4),commitSha:optionalKey2(String4),dirty:optionalKey2(Boolean3),gitIdentity:optionalKey2(GitIdentity)}).annotate({identifier:"ObservedRepositoryInput"});var SymbolPropertyKey=Struct({_tag:Literal2("symbol"),key:String4}).annotate({description:"an object to be decoded into a globally shared symbol"});var PropertyKey=Union2([String4,Finite,SymbolPropertyKey]).annotate({identifier:"PropertyKey"});var DecodeIssue=Struct({_tag:Literals(["Pointer","Unexpected","Missing","Composite","Refinement","Transformation","Type","Forbidden"]),path:ArraySchema(PropertyKey),message:String4}).annotate({identifier:"Issue"});class HttpApiDecodeError extends TaggedErrorClass()("HttpApiDecodeError",{issues:ArraySchema(DecodeIssue),message:String4},{httpApiStatus:400,description:"The request did not match the expected schema"}){}class Forbidden2 extends TaggedErrorClass()("@punks/contract/errors/Forbidden",{message:defaultMessage("The supplied credentials cannot access this resource.")},{httpApiStatus:403,title:"Forbidden"}){}var defaultMessage2=(message)=>String4.pipe(optionalKey2,withConstructorDefault2(succeed6(message)));var ArtifactKind=Literals(["manifest","archive"]);var BaselineVersion=NonEmptyString.annotate({identifier:"BaselineVersion"});var NonBlankString=String4.check(isTrimmed(),isNonEmpty());var BaselineRevision=String4.check(isPattern2(/^[1-9][0-9]*$/u)).annotate({identifier:"BaselineRevision"});var BaselineSha256=String4.check(isPattern2(/^[0-9a-f]{64}$/u)).annotate({identifier:"BaselineSha256"});var BaselinePromotionArtifact=Struct({url:NonBlankString,sha256:BaselineSha256}).annotate({identifier:"BaselinePromotionArtifact"});var BaselinePromotionCandidate=Struct({releaseId:NonBlankString,version:BaselineVersion,tag:NonBlankString,publishedAt:IsoDateTimeString,commitSha:NonBlankString,provenance:NonBlankString,cliVersionRange:NonBlankString,manifest:BaselinePromotionArtifact,archive:BaselinePromotionArtifact}).annotate({identifier:"BaselinePromotionCandidate"});var BaselinePublishRequest=Struct({mode:Literal2("publish"),candidate:BaselinePromotionCandidate,publicationIdentity:NonBlankString,expectedRevision:optionalKey2(BaselineRevision),reason:optionalKey2(Never2)});var BaselineRollbackRequest=Struct({mode:Literal2("rollback"),candidate:BaselinePromotionCandidate,publicationIdentity:NonBlankString,expectedRevision:BaselineRevision,reason:NonBlankString});var BaselinePromotionRequest=Union2([BaselinePublishRequest,BaselineRollbackRequest]).annotate({identifier:"BaselinePromotionRequest"});var BaselinePromotionResult=Struct({outcome:Literals(["committed","already-committed"]),revision:BaselineRevision,mode:Literals(["publish","rollback"]),candidate:BaselinePromotionCandidate,publicationIdentity:NonBlankString,previousRevision:optionalKey2(BaselineRevision),previousReleaseId:optionalKey2(NonBlankString),committedAt:IsoDateTimeString}).annotate({identifier:"BaselinePromotionResult"});var BaselineRequest=Struct({channel:BaselineChannel,version:optionalKey2(BaselineVersion)}).annotate({identifier:"BaselineRequest"});var BaselineVersionRequest=Struct({version:optionalKey2(BaselineVersion)}).annotate({identifier:"BaselineVersionRequest"});var BaselineSource=Literals(["control-plane","published-release","cache","bundled"]);var BaselineCompatibility=Struct({cliVersionRange:String4}).annotate({identifier:"BaselineCompatibility"});var BaselineRetrievalStatus=Literals(["available","retrieved","cached","fallback"]);var ArtifactMetadata=Struct({kind:ArtifactKind,fileName:String4,contentType:String4,url:String4,sha256:String4,sizeBytes:optionalKey2(Finite)}).annotate({identifier:"ArtifactMetadata"});var BaselineIdentity={requested:BaselineRequest,resolvedVersion:BaselineVersion,digest:String4,source:BaselineSource,provenance:String4,compatibility:BaselineCompatibility,retrieval:BaselineRetrievalStatus};var BaselineResolution=Struct({...BaselineIdentity,manifest:ArtifactMetadata,archive:ArtifactMetadata}).pipe(check(makeFilter2(({requested,resolvedVersion})=>requested.version===undefined||requested.version===resolvedVersion,{message:"An exact baseline request must resolve to the requested version."})),check(makeFilter2(({digest:digest2,archive})=>digest2===archive.sha256,{message:"The baseline digest must match the archive digest."}))).annotate({identifier:"BaselineResolution"});var BaselineArtifact=Struct({...BaselineIdentity,artifact:ArtifactMetadata}).pipe(check(makeFilter2(({requested,resolvedVersion})=>requested.version===undefined||requested.version===resolvedVersion,{message:"Artifact metadata must match the exact requested baseline version."})),check(makeFilter2(({artifact,digest:digest2})=>artifact.kind!=="archive"||artifact.sha256===digest2,{message:"The baseline artifact digest must match the verified baseline digest."}))).annotate({identifier:"BaselineArtifact"});class BaselineNotFound extends TaggedErrorClass()("@punks/contract/errors/BaselineNotFound",{channel:String4,message:defaultMessage2("No baseline exists for the requested channel.")},{httpApiStatus:404,title:"Baseline Not Found"}){}class ControlPlaneUnavailable extends TaggedErrorClass()("@punks/contract/errors/ControlPlaneUnavailable",{message:defaultMessage2("The control plane cannot resolve this resource yet.")},{httpApiStatus:503,title:"Control Plane Unavailable"}){}class BaselineAuthorityFailure extends TaggedErrorClass()("@punks/contract/errors/BaselineAuthorityFailure",{request:BaselineRequest,resolvedVersion:optionalKey2(BaselineVersion),message:String4},{httpApiStatus:409,title:"Baseline Authority Failure"}){}class BaselineIntegrityFailure extends TaggedErrorClass()("@punks/contract/errors/BaselineIntegrityFailure",{request:BaselineRequest,resolvedVersion:optionalKey2(BaselineVersion),expectedDigest:optionalKey2(String4),actualDigest:optionalKey2(String4),message:defaultMessage2("Baseline identity or artifact integrity verification failed.")},{httpApiStatus:422,title:"Baseline Integrity Failure"}){}var BaselineAvailability=Literals(["authority-unconfigured","network","unavailable-status"]);class BaselineUnavailable extends TaggedErrorClass()("@punks/contract/errors/BaselineUnavailable",{availability:BaselineAvailability,request:BaselineRequest,message:defaultMessage2("The requested baseline is unavailable.")},{httpApiStatus:503,title:"Baseline Unavailable"}){}class BaselinePublisherUnauthorized extends TaggedErrorClass()("@punks/contract/errors/BaselinePublisherUnauthorized",{message:defaultMessage2("Baseline publisher authentication is required.")},{httpApiStatus:401,title:"Baseline Publisher Unauthorized"}){}class BaselinePromotionConflict extends TaggedErrorClass()("@punks/contract/errors/BaselinePromotionConflict",{publicationIdentity:NonBlankString,expectedRevision:optionalKey2(BaselineRevision),actualRevision:optionalKey2(BaselineRevision),message:String4},{httpApiStatus:409,title:"Baseline Promotion Conflict"}){}class BaselinePromotionIntegrityFailure extends TaggedErrorClass()("@punks/contract/errors/BaselinePromotionIntegrityFailure",{publicationIdentity:NonBlankString,releaseId:optionalKey2(NonBlankString),expectedDigest:optionalKey2(BaselineSha256),actualDigest:optionalKey2(BaselineSha256),message:defaultMessage2("Baseline promotion evidence failed integrity verification.")},{httpApiStatus:422,title:"Baseline Promotion Integrity Failure"}){}class BaselinePromotionUnavailable extends TaggedErrorClass()("@punks/contract/errors/BaselinePromotionUnavailable",{publicationIdentity:NonBlankString,outcome:Literals(["not-committed","indeterminate"]),message:defaultMessage2("Baseline promotion is unavailable.")},{httpApiStatus:503,title:"Baseline Promotion Unavailable"}){}var errors2=[HttpApiDecodeError,Forbidden2,BaselineNotFound,BaselineAuthorityFailure,BaselineIntegrityFailure,BaselineUnavailable];var promotionErrors=[HttpApiDecodeError,Forbidden2,BaselinePublisherUnauthorized,BaselinePromotionConflict,BaselinePromotionIntegrityFailure,BaselinePromotionUnavailable];var BaselineApi=exports_HttpApiGroup.make("baseline").add(exports_HttpApiEndpoint.get("resolve","/:channel",{params:{channel:BaselineChannel},query:BaselineVersionRequest,success:BaselineResolution,error:errors2}),exports_HttpApiEndpoint.get("artifact","/:channel/artifacts/:kind",{params:{channel:BaselineChannel,kind:ArtifactKind},query:BaselineVersionRequest,success:BaselineArtifact,error:errors2}),exports_HttpApiEndpoint.post("promote","/stable/promotions",{payload:BaselinePromotionRequest,success:BaselinePromotionResult,error:promotionErrors})).prefix("/baselines").annotateMerge(exports_OpenApi.annotations({title:"Baseline control plane"}));import{createHash as createHash2}from"node:crypto";import{lstatSync,readFileSync,readdirSync,readlinkSync}from"node:fs";import path4 from"node:path";var digestContentRoots=(roots)=>{const entries=[];for(const{root,prefix,include=()=>true,logicalPath=(value3)=>value3}of roots){const visit2=(directory3)=>{for(const entry of readdirSync(directory3,{withFileTypes:true})){const absolutePath=path4.join(directory3,entry.name);if(entry.isDirectory()){visit2(absolutePath);continue}const relativePath=path4.relative(root,absolutePath).split(path4.sep).join("/");if(include(relativePath)){entries.push({absolutePath,identity:`${prefix}/${logicalPath(relativePath)}`})}}};visit2(root)}const hash2=createHash2("sha256");for(const{absolutePath,identity:identity3}of entries.toSorted((left,right)=>left.identity.localeCompare(right.identity))){const stat3=lstatSync(absolutePath);hash2.update(identity3);hash2.update("\x00");if(stat3.isSymbolicLink()){hash2.update("symlink\x00");hash2.update(readlinkSync(absolutePath))}else{hash2.update("file\x00");hash2.update(readFileSync(absolutePath))}hash2.update("\x00")}return hash2.digest("hex")};import{existsSync,mkdirSync,readFileSync as readFileSync2,statSync,writeFileSync}from"node:fs";import{tmpdir as tmpdir2}from"node:os";import path5 from"node:path";var embeddedAssets=[];var name="@punks/cli";var version2="4.0.2";var findFirst4=(candidates)=>candidates.find((candidate)=>existsSync(candidate));var executableSignature=()=>{try{return String(Math.trunc(statSync(process.execPath).mtimeMs))}catch{return"unknown"}};var extractEmbeddedAssets=()=>{if(embeddedAssets.length===0){return}const root=path5.join(tmpdir2(),"punks-cli-assets",`${version2}-${executableSignature()}`);for(const asset of embeddedAssets){const targetPath=path5.join(root,asset.relativePath);if(existsSync(targetPath)){continue}mkdirSync(path5.dirname(targetPath),{recursive:true});writeFileSync(targetPath,readFileSync2(asset.path))}return root};var findBundledPackageRoot=()=>{let currentDirectory=path5.resolve(import.meta.dirname,"../..");while(true){if(existsSync(path5.join(currentDirectory,"package.json"))){return currentDirectory}const parentDirectory=path5.dirname(currentDirectory);if(parentDirectory===currentDirectory){break}currentDirectory=parentDirectory}return path5.resolve(import.meta.dirname,"../..")};var packageRoot=findBundledPackageRoot();var runtimeRoot=import.meta.dirname;var embeddedAssetsRoot=extractEmbeddedAssets();var executableRoots=[process.argv[1],process.execPath].filter((candidate)=>candidate!==undefined&&candidate.length>0).map((candidate)=>path5.dirname(path5.resolve(candidate)));var dataCandidates=[path5.join(runtimeRoot,"data"),...embeddedAssetsRoot===undefined?[]:[path5.join(embeddedAssetsRoot,"data")],...executableRoots.map((root)=>path5.join(root,"data")),path5.resolve(import.meta.dirname,"../data"),path5.join(packageRoot,"src/data"),path5.resolve(import.meta.dirname,"../../src/data")];var skillCandidates=[path5.join(runtimeRoot,"skills"),...embeddedAssetsRoot===undefined?[]:[path5.join(embeddedAssetsRoot,"skills")],...executableRoots.map((root)=>path5.join(root,"skills")),path5.join(packageRoot,"skills"),path5.resolve(import.meta.dirname,"../../skills"),path5.resolve(import.meta.dirname,"../skills")];var resolvedDataRoot=findFirst4(dataCandidates);var resolvedSkillsRoot=findFirst4(skillCandidates);if(resolvedDataRoot===undefined){throw new Error("Could not locate bundled data directory.")}if(resolvedSkillsRoot===undefined){throw new Error("Could not locate bundled skills directory.")}var dataRoot=resolvedDataRoot;var skillsRoot=resolvedSkillsRoot;var dataPath=(...segments)=>path5.join(dataRoot,...segments);var readDataFile=(...segments)=>readFileSync2(dataPath(...segments),"utf-8");var readBaselineDataFile=(baselineDataRoot,...segments)=>readFileSync2(path5.join(baselineDataRoot,...segments),"utf-8");var resolveBaselinePath=({baselineRoot,baselineSkillsRoot,relativePath})=>{const resolvedPath=relativePath.startsWith("skills/")?findFirst4([path5.join(baselineSkillsRoot,relativePath.slice("skills/".length)),path5.join(baselineRoot,relativePath)]):findFirst4([path5.join(baselineRoot,relativePath)]);if(resolvedPath!==undefined){return resolvedPath}throw new Error(`Could not locate baseline asset: ${relativePath}`)};var bundledBaselineDigest="72f2718521d4c40eb039bee2aabafed020e5267fb1ce8b7710099873ab457514";var hookCatalog=[{description:"Shared session-start hook that reports whether managed Harness scaffold output is current.",harness:"shared",id:"scaffold-update-check",outputPath:".agents/hooks/scaffold-update-check.mjs",sourcePath:"hooks/scaffold-update-check.mjs"},{description:"Shared hook that auto-formats edited JS/TS/JSON files and lint-checks product files after tool use.",harness:"shared",id:"format-edited-file",outputPath:".agents/hooks/format-edited-file.mjs",sourcePath:"hooks/format-edited-file.mjs"}];var antiSlopRules={"anti-slop/no-chained-type-assertions":"error","anti-slop/no-conditional-empty-object-spread":"error","anti-slop/no-known-value-widening":"error","anti-slop/no-module-mocking":"error","anti-slop/no-object-parameters":"error","anti-slop/no-reflect-apply":"error","anti-slop/no-reflect-get":"error","anti-slop/no-runtime-typeof":"error","anti-slop/no-shape-in-symbol-names":"error","anti-slop/no-unknown-parameters":"error","anti-slop/no-unknown-returns":"error","anti-slop/no-unknown-type-aliases":"error","anti-slop/no-unsafe-dictionary-type":"error","anti-slop/no-widen-then-assert":"error","anti-slop/require-safety-comment-for-type-assertion":"error"};var sharedReactPlacement={placementNotes:"Add as an override for detected React-rendered code. Keep backend packages outside this override unless they render React.",recommendedConfigFile:"oxlint.config.ts",recommendedFiles:["<detected-react-workspace>/**/*.{js,jsx,ts,tsx}"],recommendedWorkspaces:["detected React workspaces"]};var webOnlyPlacement={placementNotes:"Place this in the Next.js app override. If the repo uses a different frontend app path, retarget the file globs to that workspace before composing the final Oxlint config.",recommendedConfigFile:"oxlint.config.ts",recommendedFiles:["<detected-nextjs-workspace>/**/*.{js,jsx,ts,tsx}"],recommendedWorkspaces:["detected Next.js workspaces"]};var effectPlacement={placementNotes:"Apply this only where Effect code lives. If the target repo renames or splits backend workspaces, move the override with those code paths instead of broadening it repo-wide.",recommendedConfigFile:"oxlint.config.ts",recommendedFiles:["<detected-effect-workspace>/**/*.{js,jsx,ts,tsx}"],recommendedWorkspaces:["detected Effect workspaces"]};var vitestPlacement={placementNotes:"Attach this to test-only globs. Expand or narrow the file patterns to match the repo's actual Vitest test layout instead of treating it as a global default.",recommendedConfigFile:"oxlint.config.ts",recommendedFiles:["<detected-test-workspace>/**/*.{test,spec}.{js,jsx,ts,tsx}","<detected-test-workspace>/src/test/**/*.{js,jsx,ts,tsx}"],recommendedWorkspaces:["detected JavaScript/TypeScript test workspaces"]};var lintCatalog=[{description:"Vendored Anti-Slop rules for rejecting low-evidence TypeScript and JavaScript patterns.",id:"typescript-anti-slop",ignorePatterns:["tools/oxlint/anti-slop/**"],jsPlugins:[{name:"anti-slop",specifier:"./tools/oxlint/anti-slop/index.mjs"}],oxlintPresets:[],placement:{placementNotes:"Apply to JavaScript and TypeScript workspaces.",recommendedConfigFile:"oxlint.config.ts",recommendedFiles:["**/*.{js,jsx,ts,tsx}"],recommendedWorkspaces:["detected JavaScript and TypeScript workspaces"]},plugins:[],requiredDevDependencies:["@oxlint/plugins"],rules:antiSlopRules,settings:{},sourceFiles:[{sourcePath:"lint/anti-slop/index.mjs",targetPath:"tools/oxlint/anti-slop/index.mjs"},{sourcePath:"lint/anti-slop/LICENSE",targetPath:"tools/oxlint/anti-slop/LICENSE"}]},{description:"Explicit Anti-Slop adoption policy for existing Harness workspaces.",id:"punks-anti-slop-transition",jsPlugins:[],oxlintPresets:[],placement:{placementNotes:"Apply only to existing Harness workspaces while they adopt Anti-Slop.",recommendedConfigFile:"oxlint.config.ts",recommendedFiles:["**/*.{js,jsx,ts,tsx}"],recommendedWorkspaces:["Harness workspaces"]},plugins:[],requiredDevDependencies:[],rules:Object.fromEntries(Object.keys(antiSlopRules).map((rule)=>[rule,"off"])),settings:{},targetPackageNames:["@punks/api","@punks/auth","@punks/backoffice","@punks/cli","@punks/config","@punks/contract","@punks/db","@punks/env","@punks/scaffold","@punks/ui","@punks/web","@punks/wiki"]},{categories:{correctness:"error"},description:"Ultracite React preset for rendered app and shared UI code.",id:"react-core",jsPlugins:[],oxlintPresets:["react"],placement:sharedReactPlacement,plugins:["react"],requiredDevDependencies:[],rules:{},settings:{}},{description:"React Hooks lint rules via the JS plugin bridge for Oxlint.",id:"react-hooks",jsPlugins:[{name:"react-hooks-js",specifier:"eslint-plugin-react-hooks"}],oxlintPresets:[],placement:sharedReactPlacement,plugins:[],requiredDevDependencies:["eslint-plugin-react-hooks"],rules:Object.fromEntries([["react-hooks-js/exhaustive-deps","error"],["react-hooks-js/component-hook-factories","error"],["react-hooks-js/config","error"],["react-hooks-js/error-boundaries","error"],["react-hooks-js/gating","error"],["react-hooks-js/globals","error"],["react-hooks-js/immutability","error"],["react-hooks-js/incompatible-library","error"],["react-hooks-js/preserve-manual-memoization","error"],["react-hooks-js/purity","error"],["react-hooks-js/refs","error"],["react-hooks-js/rules-of-hooks","error"],["react-hooks-js/set-state-in-effect","error"],["react-hooks-js/set-state-in-render","error"],["react-hooks-js/static-components","error"],["react-hooks-js/unsupported-syntax","error"],["react-hooks-js/use-memo","error"]]),settings:{}},{description:"Guidance rules that push React code away from unnecessary effects.",id:"react-you-might-not-need-an-effect",jsPlugins:[{name:"react-you-might-not-need-an-effect-js",specifier:"eslint-plugin-react-you-might-not-need-an-effect"}],oxlintPresets:[],placement:sharedReactPlacement,plugins:[],requiredDevDependencies:["eslint-plugin-react-you-might-not-need-an-effect"],rules:{"react-you-might-not-need-an-effect-js/no-adjust-state-on-prop-change":"error","react-you-might-not-need-an-effect-js/no-chain-state-updates":"error","react-you-might-not-need-an-effect-js/no-derived-state":"error","react-you-might-not-need-an-effect-js/no-event-handler":"error","react-you-might-not-need-an-effect-js/no-initialize-state":"error","react-you-might-not-need-an-effect-js/no-pass-data-to-parent":"error","react-you-might-not-need-an-effect-js/no-pass-live-state-to-parent":"error","react-you-might-not-need-an-effect-js/no-reset-all-state-on-prop-change":"error"},settings:{}},{description:"Ultracite Next.js preset for the main web application.",id:"next-core",jsPlugins:[],oxlintPresets:["next"],placement:{...webOnlyPlacement,placementNotes:"Place this beside the React app override and set `settings.next.rootDir` to the repo's actual Next workspace roots if the final config needs that plugin setting."},plugins:[],requiredDevDependencies:[],rules:{},settings:{}},{description:"Ultracite TanStack preset for query/router/start framework linting.",id:"tanstack-query-core",jsPlugins:[],oxlintPresets:["tanstack"],placement:{...webOnlyPlacement,placementNotes:"Scope this to client code that owns TanStack Query usage. Keep it out of server-only or shared non-query packages unless those paths actually create queries or mutations."},plugins:[],requiredDevDependencies:[],rules:{},settings:{}},{description:"Effect architectural rule that blocks barrel-package imports.",id:"effect-no-barrel-imports",jsPlugins:[{name:"effect-js",specifier:"@effect/eslint-plugin"}],oxlintPresets:[],placement:effectPlacement,plugins:[],requiredDevDependencies:["@effect/eslint-plugin"],rules:{"effect-js/no-import-from-barrel-package":["error",{packageNames:["effect"]}]},settings:{}},{description:"Effect tsgo recommended type-aware Oxlint rules.",id:"effect-tsgo-recommended",jsPlugins:[],oxlintConfigExtensions:[{exportName:"recommended",specifier:"@effect/tsgo/oxlint-presets"}],oxlintPresets:[],placement:effectPlacement,plugins:[],prepareCommands:["effect-tsgo patch --no-typescript --oxlint"],requiredDevDependencies:["@effect/tsgo","oxlint-tsgolint"],requiredDevDependencyVersions:{"@effect/tsgo":"0.36.5",oxlint:"1.78.0","oxlint-tsgolint":"7.0.2001"},rules:{},settings:{}},{description:"Ultracite Vitest preset for repo-owned test globs.",id:"vitest-core",jsPlugins:[],oxlintPresets:["vitest"],placement:vitestPlacement,plugins:[],requiredDevDependencies:[],rules:{},settings:{}},{description:"Canonical lint policy for the shipped Harness CLI package.",id:"punks-cli-canonical",ignorePatterns:["src/data/lint/anti-slop/**","src/data/hooks/format-edited-file.mjs","src/data/hooks/require-tests-for-pr.mjs","src/data/hooks/scaffold-update-check.mjs","src/data/scripts/harness-projection/adapters/claude.mjs","src/data/scripts/harness-projection/adapters/codex.mjs","src/data/scripts/harness-projection/adapters/cursor.mjs","src/data/scripts/harness-projection/adapters/opencode.mjs","src/data/scripts/harness-projection/apply.mjs","src/data/scripts/harness-projection/core.mjs","src/data/scripts/sync-subagents.mjs","src/data/subagents/manifest.mjs"],jsPlugins:[],oxlintPresets:[],placement:{placementNotes:"Apply only to the exact @punks/cli package.",recommendedConfigFile:"oxlint.config.ts",recommendedFiles:["**/*.{js,jsx,ts,tsx}"],recommendedWorkspaces:["@punks/cli"]},plugins:[],requiredDevDependencies:[],rules:{},settings:{},targetPackageNames:["@punks/cli"]},{description:"Canonical lint exceptions for the Harness backoffice package.",id:"punks-backoffice-canonical",jsPlugins:[],oxlintPresetRules:{vitest:{"vitest/prefer-import-in-mock":"off","vitest/prefer-importing-vitest-globals":"off"}},oxlintPresets:[],placement:{placementNotes:"Apply only to the exact @punks/backoffice package.",recommendedConfigFile:"oxlint.config.ts",recommendedFiles:["**/*.{js,jsx,ts,tsx}"],recommendedWorkspaces:["@punks/backoffice"]},plugins:[],requiredDevDependencies:[],rules:{"eslint/func-style":"off"},settings:{},targetPackageNames:["@punks/backoffice"]}];var stableJson=(value3)=>JSON.stringify(value3);var placementKeyOf=(placement)=>[placement.recommendedConfigFile,...placement.recommendedFiles].join("::");var validateConfigExtensions=(asset)=>{for(const extension of asset.oxlintConfigExtensions??[]){if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/u.test(extension.exportName)){throw new Error(`Invalid Oxlint config extension export name \`${extension.exportName}\`: ${asset.id}`)}if(extension.specifier.length===0){throw new Error(`Empty Oxlint config extension specifier: ${asset.id}`)}}};var validateRequiredVersions=(asset,seen)=>{for(const[packageName,version3]of Object.entries(asset.requiredDevDependencyVersions??{})){const previous=seen.get(packageName);if(previous!==undefined&&previous.version!==version3){throw new Error(`Conflicting required dev dependency version \`${packageName}\`: ${previous.assetId} vs ${asset.id}`)}if(previous===undefined){seen.set(packageName,{assetId:asset.id,version:version3})}}};var validateLintCatalog=(catalog)=>{const seenIds=new Set;const seenRules=new Map;const seenSettings=new Map;const seenJsPlugins=new Map;const seenRequiredVersions=new Map;for(const asset of catalog){if(seenIds.has(asset.id)){throw new Error(`Duplicate lint asset id: ${asset.id}`)}seenIds.add(asset.id);const placementKey=[placementKeyOf(asset.placement),...asset.targetPackageNames===undefined?["all-packages"]:[...asset.targetPackageNames].toSorted()].join("::");for(const[ruleName,ruleValue]of Object.entries(asset.rules)){const key=`${placementKey}::rule::${ruleName}`;const value3=stableJson(ruleValue);const previous=seenRules.get(key);if(previous!==undefined&&previous.value!==value3){throw new Error(`Conflicting lint rule \`${ruleName}\` for placement \`${placementKey}\`: ${previous.assetId} vs ${asset.id}`)}if(previous===undefined){seenRules.set(key,{assetId:asset.id,value:value3})}}for(const[settingName,settingValue]of Object.entries(asset.settings)){const key=`${placementKey}::setting::${settingName}`;const value3=stableJson(settingValue);const previous=seenSettings.get(key);if(previous!==undefined&&previous.value!==value3){throw new Error(`Conflicting lint setting \`${settingName}\` for placement \`${placementKey}\`: ${previous.assetId} vs ${asset.id}`)}if(previous===undefined){seenSettings.set(key,{assetId:asset.id,value:value3})}}for(const plugin of asset.jsPlugins){const key=`${placementKey}::js-plugin::${plugin.name}`;const previous=seenJsPlugins.get(key);if(previous!==undefined&&previous.specifier!==plugin.specifier){throw new Error(`Conflicting JS plugin alias \`${plugin.name}\` for placement \`${placementKey}\`: ${previous.assetId} vs ${asset.id}`)}if(previous===undefined){seenJsPlugins.set(key,{assetId:asset.id,specifier:plugin.specifier})}}validateConfigExtensions(asset);validateRequiredVersions(asset,seenRequiredVersions)}return catalog};var skillCatalog=[{framework:"browser-automation",id:"agent-browser",language:null,requiresTools:["agent-browser"],sourceDirectory:"skills/agnostic/frontend/agent-browser",tier:"framework"},{framework:null,id:"backend-domain-structure",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/backend/backend-domain-structure",tier:"agnostic"},{framework:null,id:"backend-recoverable-actions",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/backend/backend-recoverable-actions",tier:"agnostic"},{framework:null,id:"logging-best-practices",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/backend/logging-best-practices",tier:"agnostic"},{framework:null,id:"architect-pipeline",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/security/architect-pipeline",tier:"agnostic"},{framework:null,id:"audit-cicd-security",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/security/audit-cicd-security",tier:"agnostic"},{framework:null,id:"security-best-practices",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/security/security-best-practices",tier:"agnostic"},{framework:"better-auth",id:"better-auth-best-practices",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/better-auth/better-auth-best-practices",tier:"framework"},{framework:"better-auth",id:"better-auth-security-best-practices",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/better-auth/better-auth-security-best-practices",tier:"framework"},{framework:null,id:"create-plan",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/planning/create-plan",tier:"agnostic"},{framework:null,id:"create-spec",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/planning/create-spec",tier:"agnostic"},{framework:null,id:"delivery-phase",language:null,requiresTools:[],sourceDirectory:"skills/phases/delivery-phase",tier:"agnostic"},{framework:null,id:"design-phase",language:null,requiresTools:[],sourceDirectory:"skills/phases/design-phase",tier:"agnostic"},{framework:null,id:"debug-agent",language:null,requiresTools:["debug-agent"],sourceDirectory:"skills/agnostic/debug/debug-agent",tier:"agnostic"},{framework:null,id:"debugging-phase",language:null,requiresTools:["debug-agent"],sourceDirectory:"skills/phases/debugging-phase",tier:"agnostic"},{framework:null,id:"bug-discovery-phase",language:null,requiresTools:["clawpatch"],sourceDirectory:"skills/phases/bug-discovery-phase",tier:"agnostic"},{framework:null,id:"bug-resolution-phase",language:null,requiresTools:["clawpatch"],sourceDirectory:"skills/phases/bug-resolution-phase",tier:"agnostic"},{framework:null,id:"docs-ingest-phase",language:null,requiresTools:[],sourceDirectory:"skills/phases/docs-ingest-phase",tier:"agnostic"},{framework:null,id:"docs-onboarding",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/docs/docs-onboarding",tier:"agnostic"},{framework:null,id:"writing-fragments",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/docs/writing-fragments",tier:"agnostic"},{framework:null,id:"writing-beats",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/docs/writing-beats",tier:"agnostic"},{framework:null,id:"writing-shape",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/docs/writing-shape",tier:"agnostic"},{framework:"effect",id:"effect-backend-structure",language:"typescript",requiresTools:["opensrc"],sourceDirectory:"skills/frameworks/effect/effect-backend-structure",tier:"framework"},{framework:"effect",id:"effect",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/effect/effect",tier:"framework"},{framework:"effect",id:"effect-recoverable-actions",language:"typescript",requiresTools:["opensrc"],sourceDirectory:"skills/frameworks/effect/effect-recoverable-actions",tier:"framework"},{framework:"effect",id:"effect-service-design",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/effect/effect-service-design",tier:"framework"},{framework:"sqlalchemy",id:"sqlalchemy-schema-design",language:"python",requiresTools:[],sourceDirectory:"skills/frameworks/sqlalchemy/sqlalchemy-schema-design",tier:"framework"},{framework:"elysiajs",id:"elysiajs",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/elysia/elysiajs",tier:"framework"},{framework:"expo",id:"add-app-clip",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/add-app-clip",tier:"framework"},{framework:"expo",id:"animate-expo",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/animate-expo",tier:"framework"},{framework:"expo",id:"building-native-ui",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/building-native-ui",tier:"framework"},{framework:"expo",id:"eas-simulator",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/eas-simulator",tier:"framework"},{framework:"expo",id:"eas-update-insights",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/eas-update-insights",tier:"framework"},{framework:"expo",id:"expo-api-routes",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-api-routes",tier:"framework"},{framework:"expo",id:"expo-brownfield",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-brownfield",tier:"framework"},{framework:"expo",id:"expo-cicd-workflows",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-cicd-workflows",tier:"framework"},{framework:"expo",id:"expo-deployment",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-deployment",tier:"framework"},{framework:"expo",id:"expo-dev-client",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-dev-client",tier:"framework"},{framework:"expo",id:"expo-examples",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-examples",tier:"framework"},{framework:"expo",id:"expo-module",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-module",tier:"framework"},{framework:"expo",id:"expo-observe",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-observe",tier:"framework"},{framework:"expo",id:"expo-skill-eval",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-skill-eval",tier:"framework"},{framework:"expo",id:"expo-tailwind-setup",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-tailwind-setup",tier:"framework"},{framework:"expo",id:"expo-ui",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/expo-ui",tier:"framework"},{framework:"expo",id:"native-data-fetching",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/native-data-fetching",tier:"framework"},{framework:"expo",id:"upgrading-expo",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/upgrading-expo",tier:"framework"},{framework:"expo",id:"use-dom",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/use-dom",tier:"framework"},{framework:"expo",id:"web-to-native",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/expo/web-to-native",tier:"framework"},{framework:"pulumi",id:"pulumi-overview",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/pulumi/pulumi-overview",tier:"framework"},{framework:"pulumi",id:"pulumi-best-practices",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/pulumi/pulumi-best-practices",tier:"framework"},{framework:"pulumi",id:"pulumi-component",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/pulumi/pulumi-component",tier:"framework"},{framework:"pulumi",id:"pulumi-automation-api",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/pulumi/pulumi-automation-api",tier:"framework"},{framework:"pulumi",id:"pulumi-esc",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/pulumi/pulumi-esc",tier:"framework"},{framework:"pulumi",id:"provider-upgrade",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/pulumi/provider-upgrade",tier:"framework"},{framework:"pulumi",id:"package-usage",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/pulumi/package-usage",tier:"framework"},{framework:null,id:"animate",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/frontend/animate",tier:"agnostic"},{framework:null,id:"design-taste-frontend",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/frontend/design-taste-frontend",tier:"agnostic"},{framework:null,id:"imagegen-frontend-mobile",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/frontend/imagegen-frontend-mobile",tier:"agnostic"},{framework:null,id:"imagegen-frontend-web",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/frontend/imagegen-frontend-web",tier:"agnostic"},{framework:null,id:"frontend-domain-structure",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/frontend/frontend-domain-structure",tier:"agnostic"},{framework:null,id:"improve-mobile-frontend",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/frontend/improve-mobile-frontend",tier:"agnostic"},{framework:null,id:"review-animations",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/frontend/review-animations",tier:"agnostic"},{framework:null,id:"business-finder",language:null,requiresTools:[],sourceDirectory:"skills/phases/business-finder",tier:"agnostic"},{framework:null,id:"finder-phase",language:null,requiresTools:[],sourceDirectory:"skills/phases/finder-phase",tier:"agnostic"},{framework:null,id:"functional-finder",language:null,requiresTools:[],sourceDirectory:"skills/phases/functional-finder",tier:"agnostic"},{framework:null,id:"goalify",language:null,requiresTools:[],sourceDirectory:"skills/phases/goalify",tier:"agnostic"},{framework:null,id:"grilling",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/requirements/grilling",tier:"agnostic"},{framework:null,id:"handoff",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/generic/handoff",tier:"agnostic"},{framework:null,id:"handback",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/generic/handback",tier:"agnostic"},{framework:null,id:"improve-codebase-architecture",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/research/improve-codebase-architecture",tier:"agnostic"},{framework:null,id:"implement-spec",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/planning/implement-spec",tier:"agnostic"},{framework:null,id:"technical-finder",language:null,requiresTools:[],sourceDirectory:"skills/phases/technical-finder",tier:"agnostic"},{framework:null,id:"verify-behavior",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/planning/verify-behavior",tier:"agnostic"},{framework:null,id:"repo-asset-management",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/repo-asset-management",tier:"agnostic"},{framework:null,id:"wayfinder",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/planning/wayfinder",tier:"agnostic"},{framework:"nextjs",id:"next-best-practices",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/nextjs/next-best-practices",tier:"framework"},{framework:"nextjs",id:"next-cache-components",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/nextjs/next-cache-components",tier:"framework"},{framework:null,id:"parallel-research",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/research/parallel-research",tier:"agnostic"},{framework:null,id:"prototype",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/research/prototype",tier:"agnostic"},{framework:null,id:"prototype-phase",language:null,requiresTools:[],sourceDirectory:"skills/phases/prototype-phase",tier:"agnostic"},{framework:null,id:"async-python-patterns",language:"python",requiresTools:[],sourceDirectory:"skills/languages/python/async-python-patterns",tier:"language"},{framework:null,id:"python-code-style",language:"python",requiresTools:[],sourceDirectory:"skills/languages/python/python-code-style",tier:"language"},{framework:null,id:"python-design-patterns",language:"python",requiresTools:[],sourceDirectory:"skills/languages/python/python-design-patterns",tier:"language"},{framework:null,id:"python-backend-structure",language:"python",requiresTools:[],sourceDirectory:"skills/languages/python/python-backend-structure",tier:"language"},{framework:null,id:"python-testing-patterns",language:"python",requiresTools:[],sourceDirectory:"skills/languages/python/python-testing-patterns",tier:"language"},{framework:null,id:"quality-types",language:"typescript",requiresTools:[],sourceDirectory:"skills/languages/typescript/quality-types",tier:"language"},{framework:null,id:"codebase-design",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/quality/codebase-design",tier:"agnostic"},{framework:"react",id:"async-react-patterns",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/react/async-react-patterns",tier:"framework"},{framework:"react",id:"react-doctor",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/react/react-doctor",tier:"framework"},{framework:null,id:"domain-modeling",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/requirements/domain-modeling",tier:"agnostic"},{framework:null,id:"requirements-grill",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/requirements/requirements-grill",tier:"agnostic"},{framework:null,id:"requirements-phase",language:null,requiresTools:[],sourceDirectory:"skills/phases/requirements-phase",tier:"agnostic"},{framework:null,id:"resolve-debt-phase",language:null,requiresTools:[],sourceDirectory:"skills/phases/resolve-debt-phase",tier:"agnostic"},{framework:null,id:"review-phase",language:null,requiresTools:[],sourceDirectory:"skills/phases/review-phase",tier:"agnostic"},{framework:null,id:"review",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/quality/review",tier:"agnostic"},{framework:null,id:"autoreview",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/quality/autoreview",tier:"agnostic"},{framework:null,id:"make-tsuite",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/quality/make-tsuite",tier:"agnostic"},{framework:null,id:"simplify",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/quality/simplify",tier:"agnostic"},{framework:null,id:"swarm-planner",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/subagents/swarm-planner",tier:"agnostic"},{framework:"tanstack-query",id:"tanstack-query",language:"typescript",requiresTools:["opensrc"],sourceDirectory:"skills/frameworks/tanstack-query/tanstack-query",tier:"framework"},{framework:null,id:"tdd",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/quality/tdd",tier:"agnostic"},{framework:null,id:"wait-what",language:null,requiresTools:[],sourceDirectory:"skills/misc/wait-what",tier:"agnostic"},{framework:null,id:"rule-authoring",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/docs/rule-authoring",tier:"agnostic"},{framework:null,id:"show-me",language:null,requiresTools:[],sourceDirectory:"skills/misc/show-me",tier:"agnostic"},{framework:null,id:"writing-for-agents",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/docs/writing-for-agents",tier:"agnostic"},{framework:null,id:"write-graph-based-skills",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/docs/write-graph-based-skills",tier:"agnostic"},{framework:"turborepo",id:"turborepo",language:null,requiresTools:[],sourceDirectory:"skills/frameworks/turborepo/turborepo",tier:"framework"},{framework:"react",id:"vercel-composition-patterns",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/react/vercel-composition-patterns",tier:"framework"},{framework:"react",id:"vercel-react-best-practices",language:"typescript",requiresTools:[],sourceDirectory:"skills/frameworks/react/vercel-react-best-practices",tier:"framework"},{framework:null,id:"write-backlog",language:null,requiresTools:[],sourceDirectory:"skills/agnostic/requirements/write-backlog",tier:"agnostic"}];var skillIdPattern=/^[a-z0-9][a-z0-9._-]*$/u;var stripSkillIdCompatibilityProjectionRows=(skills,entries)=>{const compatibilitySources=new Map(entries.flatMap(({alias,compatibilitySourceDirectory})=>compatibilitySourceDirectory===undefined?[]:[[alias,compatibilitySourceDirectory]]));return skills.filter(({id,sourceDirectory})=>compatibilitySources.get(id)!==sourceDirectory)};var validateSkillIdAliases=(entries,skills)=>{const canonicalIds=new Set(skills.map(({id})=>id));const entriesByAlias=new Map;for(const entry of entries){if(!skillIdPattern.test(entry.alias)||!skillIdPattern.test(entry.canonicalId)){throw new Error(`Invalid skill ID alias: ${entry.alias} -> ${entry.canonicalId}`)}if(entry.kind!=="alias"&&entry.kind!=="rename"){throw new Error(`Invalid skill ID alias kind: ${entry.alias}`)}if(entry.compatibilitySourceDirectory!==undefined&&entry.compatibilitySourceDirectory===""){throw new Error(`Invalid skill ID alias compatibility source: ${entry.alias}`)}if(entriesByAlias.has(entry.alias)){throw new Error(`Duplicate skill ID alias: ${entry.alias}`)}if(canonicalIds.has(entry.alias)){throw new Error(`Skill ID alias collides with canonical skill: ${entry.alias}`)}if(entry.alias===entry.canonicalId){throw new Error(`Skill ID alias cannot map to itself: ${entry.alias}`)}entriesByAlias.set(entry.alias,entry)}const resolveTerminal=(entry)=>{const visited=new Set([entry.alias]);let target=entry.canonicalId;while(entriesByAlias.has(target)){if(visited.has(target)){throw new Error(`Skill ID alias cycle includes: ${target}`)}visited.add(target);target=entriesByAlias.get(target)?.canonicalId??target}if(!canonicalIds.has(target)){throw new Error(`Skill ID alias target is missing: ${entry.alias} -> ${target}`)}return target};return entries.map((entry)=>({...entry,canonicalId:resolveTerminal(entry)})).toSorted((left,right)=>left.alias.localeCompare(right.alias))};var skillIdAliasCatalog=validateSkillIdAliases([{alias:"python-project-structure",canonicalId:"python-backend-structure",compatibilitySourceDirectory:"skills/languages/python/python-project-structure",kind:"rename"},{alias:"writing-great-skills",canonicalId:"writing-for-agents",compatibilitySourceDirectory:"skills/agnostic/docs/writing-great-skills",kind:"rename"}],skillCatalog);var toolCatalog=[{ensureCommands:[["agent-browser","install"]],id:"agent-browser",latestInstallTarget:"agent-browser@latest",packageName:"agent-browser",requiredBins:["node"],skipEnsureCommandsIfAnyCommandExists:[{env:"AGENT_BROWSER_EXECUTABLE_PATH"},"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","google-chrome","google-chrome-stable","chromium","chromium-browser","brave-browser","brave-browser-stable","C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"]},{ensureCommands:[],id:"debug-agent",latestInstallTarget:"debug-agent@latest",packageName:"debug-agent",requiredBins:["node"]},{ensureCommands:[],id:"clawpatch",latestInstallTarget:"clawpatch@latest",packageName:"clawpatch",requiredBins:["node"]},{ensureCommands:[],id:"opensrc",latestInstallTarget:"opensrc@latest",minimumVersion:"0.7.2",packageName:"opensrc@^0.7.2",requiredBins:["node"],versionCommand:["opensrc","--version"]},{ensureCommands:[],id:"portless",latestInstallTarget:"portless@latest",packageName:"portless",requiredBins:["node"]},{ensureCommands:[],id:"skills",latestInstallTarget:"skills@latest",packageName:"skills",requiredBins:["node"]}];var bundledNpmInstallAliasManifest=[{expectedSha256:"d1a3b15bb12948cfbd82acdd54889efc5d1263809550cb4d379863bbc1cc2f82",logicalRelativePath:"frameworks/nestjs/nestjs-best-practices/.gitignore",physicalRelativePath:"frameworks/nestjs/nestjs-best-practices/.npmignore"}];var fileSha256=(filePath)=>createHash3("sha256").update(readFileSync3(filePath)).digest("hex");var npmIgnoreFiles=(root)=>{const files=[];const visit2=(directory3)=>{for(const entry of readdirSync2(directory3,{withFileTypes:true})){const absolutePath=path6.join(directory3,entry.name);if(entry.isDirectory()){visit2(absolutePath)}else if(entry.isFile()&&entry.name===".npmignore"){files.push(path6.relative(root,absolutePath).split(path6.sep).join("/"))}}};visit2(root);return files};var resolveBundledSkillAliases=(root)=>{const aliases=new Map;const expectedPhysicalPaths=new Set(bundledNpmInstallAliasManifest.map(({physicalRelativePath})=>physicalRelativePath));for(const relativePath of npmIgnoreFiles(root)){if(!expectedPhysicalPaths.has(relativePath)){throw new Error(`Bundled baseline contains an unexpected npm alias: ${relativePath}`)}}for(const alias of bundledNpmInstallAliasManifest){const logicalPath=path6.join(root,alias.logicalRelativePath);const physicalPath=path6.join(root,alias.physicalRelativePath);const hasLogical=existsSync2(logicalPath);const hasPhysical=existsSync2(physicalPath);if(hasLogical&&hasPhysical){throw new Error(`Bundled baseline npm alias is ambiguous: ${alias.logicalRelativePath}`)}let resolvedPath=null;if(hasLogical){resolvedPath=logicalPath}else if(hasPhysical){resolvedPath=physicalPath}if(resolvedPath===null){throw new Error(`Bundled baseline asset is missing: ${alias.logicalRelativePath}`)}if(fileSha256(resolvedPath)!==alias.expectedSha256){throw new Error(`Bundled baseline npm alias hash mismatch: ${alias.logicalRelativePath}`)}if(hasPhysical){aliases.set(alias.physicalRelativePath,alias.logicalRelativePath)}}return aliases};var logicalBundledSkillRelativePath=(relativePath)=>bundledNpmInstallAliasManifest.find(({physicalRelativePath})=>physicalRelativePath===relativePath)?.logicalRelativePath??relativePath;var bundledBaseline={dataRoot,hooks:hookCatalog,lintAssets:validateLintCatalog(lintCatalog),packs:packCatalog,root:path6.dirname(dataRoot),skillIdAliases:skillIdAliasCatalog,skills:skillCatalog,skillsRoot,summary:{authoritySource:"bundled",channel:"bundled",commit:null,compatibility:{cliVersionRange:`=${version2}`},digest:bundledBaselineDigest,provenance:"packaged-cli",requested:{channel:"bundled"},resolvedVersion:version2,retrieval:"available",sha256:bundledBaselineDigest,source:"bundled",tag:null,version:version2},tools:toolCatalog};var resolveVerifiedBundledBaseline=(requested=bundledBaseline.summary.requested,retrieval="available")=>{const aliases=resolveBundledSkillAliases(skillsRoot);const actualDigest=digestContentRoots([{include:(relativePath)=>!relativePath.endsWith(".ts")&&relativePath!=="CLAUDE.md",prefix:"data",root:dataRoot},{logicalPath:(relativePath)=>aliases.get(relativePath)??relativePath,prefix:"skills",root:skillsRoot}]);if(actualDigest!==bundledBaselineDigest){throw new BaselineIntegrityFailure({actualDigest,expectedDigest:bundledBaselineDigest,message:"Packaged baseline content no longer matches its verified identity.",request:requested,resolvedVersion:bundledBaseline.summary.resolvedVersion})}return{...bundledBaseline,summary:{...bundledBaseline.summary,channel:requested.channel,requested,retrieval}}};var packContents=packCatalog;var packContentsForBaseline=(baseline=bundledBaseline)=>baseline.packs;var packContentsByIdForBaseline=(baseline=bundledBaseline)=>{const contents={};for(const pack of packContentsForBaseline(baseline)){contents[pack.id]=pack}return contents};var packContentsById=packContentsByIdForBaseline();var defaultPackIds=packContents.filter((pack)=>pack.category==="default").map((pack)=>pack.id).toSorted();var languagePackIds=packContents.filter((pack)=>pack.category==="language").map((pack)=>pack.id).toSorted();var detectedPackIds=packContents.filter((pack)=>pack.category==="detected").map((pack)=>pack.id).toSorted();var surfacePackIds=packContents.filter((pack)=>pack.category==="surface").map((pack)=>pack.id).toSorted();var knownPackIds=packContents.map((pack)=>pack.id).toSorted();var defaultPackIdsForBaseline=(baseline=bundledBaseline)=>packContentsForBaseline(baseline).filter((pack)=>pack.category==="default").map((pack)=>pack.id).toSorted();var languagePackIdsForBaseline=(baseline=bundledBaseline)=>packContentsForBaseline(baseline).filter((pack)=>pack.category==="language").map((pack)=>pack.id).toSorted();var detectedPackIdsForBaseline=(baseline=bundledBaseline)=>packContentsForBaseline(baseline).filter((pack)=>pack.category==="detected").map((pack)=>pack.id).toSorted();var surfacePackIdsForBaseline=(baseline=bundledBaseline)=>packContentsForBaseline(baseline).filter((pack)=>pack.category==="surface").map((pack)=>pack.id).toSorted();var knownPackIdsForBaseline=(baseline=bundledBaseline)=>packContentsForBaseline(baseline).map((pack)=>pack.id).toSorted();var skillsForPack=(packId,baseline=bundledBaseline)=>packContentsByIdForBaseline(baseline)[packId]?.skills??[];var lintAssetsForPack=(packId,baseline=bundledBaseline)=>packContentsByIdForBaseline(baseline)[packId]?.lintAssets??[];var hooksForPack=(packId,baseline=bundledBaseline)=>packContentsByIdForBaseline(baseline)[packId]?.hooks??[];var promptDetailsForPack=(packId,baseline=bundledBaseline)=>packContentsByIdForBaseline(baseline)[packId]?.promptDetails??[];var exampleRepositoriesForPack=(packId,baseline=bundledBaseline)=>packContentsByIdForBaseline(baseline)[packId]?.exampleRepositories??[];var formatToolBootstrapStatus=(entry)=>{switch(entry.status){case"already-present":{return"already present"}case"installed":{return"installed during scaffold"}case"failed":{return"bootstrap failed"}default:{return entry.status}}};var formatToolBootstrapFailureDetails=(statuses)=>{const failures=statuses.filter((entry)=>entry.status==="failed");if(failures.length===0){return null}return["Required tool bootstrap failed, but scaffold/update output can still be written.","","Agent recovery prompt:","Read `.devpunks/settings.json`, verify each listed required tool manually, then fix the failed install before deeper repo work. If `agent-browser` failed while installing Chromium, install or repair that browser dependency outside the scaffold command, then rerun `agent-browser install` or the documented tool check.","","Failure stack traces:",...failures.flatMap((failure)=>["",`--- ${failure.toolId} ---`,failure.errorStack??failure.errorMessage??"Unknown tool bootstrap failure."])].join(`
286
286
  `)};var formatList=(values)=>values.length===0?[" ∅"]:values.map((value3)=>` • ${value3}`);var wrapInlineValues=({values,firstPrefix,continuationPrefix,maxLineLength=88})=>{if(values.length===0){return[`${firstPrefix}∅`]}const lines2=[];let currentLine=firstPrefix;for(const value3 of values){const candidate=currentLine===firstPrefix?`${currentLine}${value3}`:`${currentLine}, ${value3}`;if(candidate.length<=maxLineLength||currentLine===firstPrefix){currentLine=candidate;continue}lines2.push(currentLine);currentLine=`${continuationPrefix}${value3}`}lines2.push(currentLine);return lines2};var formatPackRows=({label,values,isLast})=>wrapInlineValues({continuationPrefix:`${isLast?" ":" │ "}${" ".repeat(`${label}: `.length)}`,firstPrefix:` ${isLast?"└":"├"} ${label}: `,values});var formatPackList=(values,baseline=bundledBaseline)=>values.length===0?[" ∅"]:values.flatMap((packId)=>{const skills=skillsForPack(packId,baseline);const lintAssets=lintAssetsForPack(packId,baseline);const hooks=hooksForPack(packId,baseline);const detailRows=[...skills.length===0?[]:[{label:"skills",values:skills}],...lintAssets.length===0?[]:[{label:"lint",values:lintAssets}],...hooks.length===0?[]:[{label:"hooks",values:hooks}],...(()=>{const promptLabels=promptDetailsForPack(packId,baseline);return promptLabels.length===0?[]:[{label:"prompts",values:promptLabels}]})()];return[` • ${packId}`,...detailRows.flatMap((row,index)=>formatPackRows({isLast:index===detailRows.length-1,label:row.label,values:row.values}))]});var formatCompactPackList=(values)=>values.length===0?[" ∅"]:wrapInlineValues({continuationPrefix:" ",firstPrefix:" • ",values});var section=(title,lines2)=>[title,...lines2];var maybeSection=(title,lines2)=>lines2.length===1&&lines2[0]===" ∅"?[]:section(title,lines2);var formatDetectionSummary=(detection)=>["Scaffold detection summary",`cwd: ${detection.cwd}`,...section("detected languages:",formatList(detection.detectedLanguages)),...section("detected technologies:",formatList(detection.detectedTechnologies)),...section("manifest files:",formatList(detection.manifests.map((manifest)=>path7.relative(detection.cwd,manifest.path)||"package.json"))),...section("monorepo signals:",formatList(detection.monorepoSignals.map((signal)=>`${signal.type} (${path7.relative(detection.cwd,signal.path)||"."})`)))].join(`
287
287
  `);var formatConfirmationSummary=(result3,baseline=bundledBaseline)=>["Confirmed scaffold selection",`baseline: ${result3.baseline.source}/${result3.baseline.channel} ${result3.baseline.version}`,`cwd: ${result3.cwd}`,`repo shape mode: ${result3.repoShapeMode}`,`effective repo shape: ${result3.monorepo?"monorepo":"single"}`,...section("detected languages:",formatList(result3.detectedLanguages)),...section("detected technologies:",formatList(result3.detectedTechnologies)),...section("default packs:",formatPackList(result3.defaultPacks,baseline)),...section("language packs:",formatPackList(result3.languagePacks,baseline)),...section("detected packs:",formatPackList(result3.detectedPacks,baseline)),...section("surface packs:",formatPackList(result3.surfacePacks,baseline)),...maybeSection("added packs:",formatPackList(result3.addedPacks,baseline)),...maybeSection("removed packs:",formatPackList(result3.removedPacks,baseline)),...section("final packs:",formatCompactPackList(result3.finalPacks)),`output directory: ${result3.outputDirectory}`,...section("shared core files:",formatList(result3.promptOutputs)),...section("lint spec files:",formatList(result3.lintSpecFiles)),...section("source guide files:",formatList(result3.sourceGuideFiles)),...section("skill files:",formatList(result3.skillFiles)),...section("prompt spec files:",formatList(result3.promptSpecFiles)),...section("subagent scaffold files:",formatList(result3.subagentFiles)),...section("script files:",formatList(result3.scriptFiles)),...section("hook files:",formatList(result3.hookFiles)),...section("harness files:",formatList(result3.harnessFiles)),...maybeSection("hidden output directories:",formatList(result3.hiddenOutputDirectories)),...section("agent handoff file:",formatList([result3.agentHandoffFile])),...section("required tools source:",formatList([".devpunks/settings.json"])),...maybeSection("tool bootstrap:",formatList(result3.toolBootstrapStatuses.map((entry)=>`${entry.toolId}: ${formatToolBootstrapStatus(entry)}`))),...section("scaffold manifest:",formatList([result3.scaffoldManifestFile]))].join(`
288
288
  `);var formatAgentHandoffSummary=(result3)=>["Give this to the next agent","","You are continuing a `hi scaffold` run.","","Read first:",` • \`${result3.scaffoldManifestFile}\``,` • \`${result3.agentHandoffFile}\``," • `.devpunks/settings.json`","",...result3.toolBootstrapStatuses.length===0?[]:["Tool bootstrap status:",...result3.toolBootstrapStatuses.map((entry)=>` • \`${entry.toolId}\`: ${formatToolBootstrapStatus(entry)}`),""],...result3.toolBootstrapStatuses.some((entry)=>entry.status==="failed")?["Tool bootstrap recovery:"," • Read `.devpunks/settings.json` and manually verify every listed required tool before deeper repo work."," • Repair failed installs outside the scaffold command. For `agent-browser` Chromium failures, rerun `agent-browser install` after fixing the local browser dependency.",""]:[],"What was scaffolded:"," • final scoped/root prompt files were not written yet",...formatList([...result3.promptOutputs,...result3.lintSpecFiles,...result3.sourceGuideFiles,...result3.skillFiles,...result3.promptSpecFiles,...result3.subagentFiles,...result3.scriptFiles,...result3.hookFiles,...result3.harnessFiles]),"","What you must do:"," 1. Treat the prompt spec markdown files as instructions, not final prompt bodies."," 1a. Activate `writing-for-agents`, then `rule-authoring`, before reconciling prompt specs, scoped guidance, or `.agents/rules/`."," 1c. Preserve the generated `$handback` autonomy pointer once in shared/root guidance and immediately after every docs/workspace scope boundary."," 1b. Preserve project-owned `.agents/rules/`; each scoped `AGENTS.md` carries one exhaustive Rule Registry pointer.",result3.monorepo?" 2. Repo is in monorepo mode. Generate final prompt files for root, docs, and each relevant app/package scope.":" 2. Repo is in single-repo mode. Stitch scoped guidance into one root prompt, plus docs guidance when present."," 3. Read `.devpunks/settings.json` and verify listed required tools such as `skills`, `portless`, `opensrc`, and `agent-browser` are actually available. If any are missing, install/fix that first."," 4. Use the root prompt spec criteria to author root `AGENTS.md` from real repo evidence: surface map, workflow routing, cross-surface contract rules, validation routing, then short source/URL/docs rules. Do not add a root `Primary skills here` line."," 4a. Use each generated docs/workspace prompt spec as the sole detailed authority; follow its repository-invariant, exact skill-pointer, Source Guide, mirror, and validation checks without restating them here."," 4b. Complete scoped prompt authoring only when every generated docs/workspace target is written, existing nested prompts remain preserved, no new deeper prompt exists, and every relative reference resolves."," 5. Treat every authored root/docs/workspace `AGENTS.md` file as the neutral scoped prompt source and create a sibling `CLAUDE.md` symlink mirror beside each one."," 6. Keep `.agents/AGENTS.md` as the shared global prompt source behind the scoped prompt tree; `.claude/CLAUDE.md` should mirror that neutral file."," 7. Before relying on subagents, verify the active harness global/project settings enable subagent execution, then verify `.agents/subagents/manifest.mjs` and selected specialist path/guidance/skill coverage. Repair settings/setup or execute locally if the guard fails."," 8. Keep `.agents/hooks/` as the neutral hook source, `.agents/skills/` as the main skill directory, and `.agents/scripts/sync-subagents.mjs` as the harness sync entrypoint. Only `.claude/skills` should mirror `.agents/skills`."," 9. Reconcile `.agents/subagents/manifest.mjs` with both `.agents/subagents/manifest.prompt.md` and `.devpunks/specs/subagents/manifest-spec.json`."," 10. Update owned paths / guidance file references in the subagent manifest to match the real repo shape."," 11. Use `portless` as the local-dev URL baseline. Prefer stable subdomains over raw `localhost:<port>` values in env examples, endpoint defaults, callback URLs, allowed origins, CORS, and app-to-app proxies."," 12. If adopting Oxlint or Oxfmt, replace existing lint/format setup deliberately: package scripts, task pipelines, CI, editor/docs references, and hooks should agree on the new tools."," 13. Before authoring final prompts or implementation plans, identify the core detected libraries whose source behavior matters."," 14. If an `opensrc/<package>.md` guide exists for a package, read that card first, then run its `opensrc path --cwd . <package>` command or fallback repository lookup."," 15. Inspect the returned checkout paths. Clone the major framework/runtime libraries you will reason about; do not clone every dependency mechanically."].join(`