void 0.1.6 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENT_PROMPT.md +15 -0
- package/README.md +62 -123
- package/dist/auth-BdsJ0Aff.d.mts +43 -0
- package/dist/auth-cmd-Dx8oPKZC.mjs +43 -0
- package/dist/auth-migrations-BAtAck2g.mjs +117 -0
- package/dist/better-auth-shared-C9_GHSkR.d.mts +71 -0
- package/dist/better-auth-shared-CdYmQGry.mjs +163 -0
- package/dist/cache-W82I8ihI.mjs +47 -0
- package/dist/cancel-deploy-BOBTqqh0.mjs +59 -0
- package/dist/cf-access-Dee5cXxL.mjs +22 -0
- package/dist/chunk-DJd-R1mw.mjs +34 -0
- package/dist/cli/cli.d.mts +1 -0
- package/dist/cli/cli.mjs +1807 -0
- package/dist/client-snXOjrp1.mjs +565 -0
- package/dist/collect-CjeZgz5D.mjs +55 -0
- package/dist/config-BIa9HwVX.mjs +573 -0
- package/dist/config-BzM9Dy7T.mjs +37 -0
- package/dist/config-CvHtTM0q.mjs +30 -0
- package/dist/create-project-BIA15W7z.mjs +90 -0
- package/dist/db-DsRoMcfN.mjs +895 -0
- package/dist/defer-DcxEsVH1.mjs +49 -0
- package/dist/delete-DAP6yDc7.mjs +64 -0
- package/dist/deploy-BPKblFx6.mjs +2424 -0
- package/dist/discover-B7FkXBLB.mjs +40 -0
- package/dist/dist-DUyXJLkq.mjs +2667 -0
- package/dist/dist-Dayj3gCK.mjs +1287 -0
- package/dist/domain-BGofcQ6I.mjs +79 -0
- package/dist/dotenv-DwO4ti0Z.mjs +173 -0
- package/dist/drizzle-NnudE_UN.mjs +232 -0
- package/dist/env-CyG3tvU0.mjs +301 -0
- package/dist/env-helpers-Dr9Y7RnE.d.mts +52 -0
- package/dist/env-raw-BDL4TvdN.mjs +32 -0
- package/dist/env-types-DknSA4SO.mjs +64 -0
- package/dist/env-validation-DJKjR_8q.mjs +163 -0
- package/dist/fetch-error-BQ8sZ5Nd.mjs +266 -0
- package/dist/fetch-error-CVZ5CGA-.d.mts +20 -0
- package/dist/gen-U0Ktr4Zd.mjs +761 -0
- package/dist/handler-B0ds0OHJ.d.mts +269 -0
- package/dist/head-P-egrtFE.d.mts +45 -0
- package/dist/headers-DCXc7mDs.mjs +279 -0
- package/dist/index.d.mts +32 -0
- package/dist/index.mjs +4695 -0
- package/dist/init-C7wS5iGP.mjs +2625 -0
- package/dist/link-p2R6NbgN.mjs +49 -0
- package/dist/list-Bfel-QLc.mjs +113 -0
- package/dist/log-DXdqnmhF.mjs +26 -0
- package/dist/login-CkcXUiIu.mjs +72 -0
- package/dist/logs-DmkrRvx6.mjs +98 -0
- package/dist/magic-string.es-D6g9UnIy.mjs +1011 -0
- package/dist/mcp-CaQzfeUi.mjs +373 -0
- package/dist/node-DDfXj10V.mjs +54 -0
- package/dist/output-BwlcIYSR.mjs +139 -0
- package/dist/pages/client.d.mts +198 -0
- package/dist/pages/client.mjs +980 -0
- package/dist/pages/head-client.d.mts +15 -0
- package/dist/pages/head-client.mjs +90 -0
- package/dist/pages/head.d.mts +2 -0
- package/dist/pages/head.mjs +112 -0
- package/dist/pages/index.d.mts +38 -0
- package/dist/pages/index.mjs +76 -0
- package/dist/pages/islands-plugin.d.mts +50 -0
- package/dist/pages/islands-plugin.mjs +195 -0
- package/dist/pages/prefetch.d.mts +31 -0
- package/dist/pages/prefetch.mjs +90 -0
- package/dist/pages/protocol.d.mts +3 -0
- package/dist/pages/protocol.mjs +193 -0
- package/dist/pages/serialize.d.mts +10 -0
- package/dist/pages/serialize.mjs +14 -0
- package/dist/pathe.M-eThtNZ-D-kmWkCS.mjs +150 -0
- package/dist/plugin-inference-oZ6Ybu2_.mjs +2447 -0
- package/dist/prepare-BAtWufvm.mjs +99 -0
- package/dist/preset-D4I73kT4.mjs +221 -0
- package/dist/project-TqORyHn8.mjs +72 -0
- package/dist/project-cmd-B7lQp3F3.mjs +67 -0
- package/dist/project-slug-CKam8lF9.mjs +11 -0
- package/dist/project-tsconfig-DfkESbDL.mjs +63 -0
- package/dist/protocol-BWzXs2A2.d.mts +34 -0
- package/dist/providers-B3aMxWzP.mjs +67 -0
- package/dist/resolve-project-Br5BR03U.mjs +29 -0
- package/dist/rollback-gyC59l7U.mjs +92 -0
- package/dist/route-types-DReF1gUY.mjs +255 -0
- package/dist/routes-stub.d.mts +55 -0
- package/dist/routes-stub.mjs +1 -0
- package/dist/runner-6Ep3fNQu.mjs +123 -0
- package/dist/runner-pg-D0wWHYnr.mjs +57 -0
- package/dist/runtime/ai.d.mts +127 -0
- package/dist/runtime/ai.mjs +348 -0
- package/dist/runtime/auth-client-react.d.mts +8 -0
- package/dist/runtime/auth-client-react.mjs +6 -0
- package/dist/runtime/auth-client-solid.d.mts +8 -0
- package/dist/runtime/auth-client-solid.mjs +6 -0
- package/dist/runtime/auth-client-svelte.d.mts +8 -0
- package/dist/runtime/auth-client-svelte.mjs +6 -0
- package/dist/runtime/auth-client-vue.d.mts +8 -0
- package/dist/runtime/auth-client-vue.mjs +6 -0
- package/dist/runtime/auth-client.d.mts +8 -0
- package/dist/runtime/auth-client.mjs +6 -0
- package/dist/runtime/auth.d.mts +2 -0
- package/dist/runtime/auth.mjs +22 -0
- package/dist/runtime/better-auth-pg.d.mts +11 -0
- package/dist/runtime/better-auth-pg.mjs +51 -0
- package/dist/runtime/better-auth.d.mts +11 -0
- package/dist/runtime/better-auth.mjs +33 -0
- package/dist/runtime/client.d.mts +6 -0
- package/dist/runtime/client.mjs +5 -0
- package/dist/runtime/db-pg.d.mts +2 -0
- package/dist/runtime/db-pg.mjs +1 -0
- package/dist/runtime/db.d.mts +17 -0
- package/dist/runtime/db.mjs +30 -0
- package/dist/runtime/drizzle-arktype.d.mts +1 -0
- package/dist/runtime/drizzle-arktype.mjs +2 -0
- package/dist/runtime/drizzle-valibot.d.mts +1 -0
- package/dist/runtime/drizzle-valibot.mjs +2 -0
- package/dist/runtime/drizzle-zod.d.mts +1 -0
- package/dist/runtime/drizzle-zod.mjs +2 -0
- package/dist/runtime/env-helpers.d.mts +2 -0
- package/dist/runtime/env-helpers.mjs +173 -0
- package/dist/runtime/env-public-client.d.mts +22 -0
- package/dist/runtime/env-public-client.mjs +54 -0
- package/dist/runtime/env-public.d.mts +143 -0
- package/dist/runtime/env-public.mjs +366 -0
- package/dist/runtime/env.d.mts +13 -0
- package/dist/runtime/env.mjs +51 -0
- package/dist/runtime/fetch-stream.d.mts +51 -0
- package/dist/runtime/fetch-stream.mjs +81 -0
- package/dist/runtime/fetch.d.mts +59 -0
- package/dist/runtime/fetch.mjs +18 -0
- package/dist/runtime/handler.d.mts +3 -0
- package/dist/runtime/handler.mjs +85 -0
- package/dist/runtime/isr.d.mts +26 -0
- package/dist/runtime/isr.mjs +43 -0
- package/dist/runtime/kv.d.mts +48 -0
- package/dist/runtime/kv.mjs +106 -0
- package/dist/runtime/log.d.mts +24 -0
- package/dist/runtime/log.mjs +31 -0
- package/dist/runtime/migration-handler-pg.d.mts +6 -0
- package/dist/runtime/migration-handler-pg.mjs +85 -0
- package/dist/runtime/migration-handler.d.mts +19 -0
- package/dist/runtime/migration-handler.mjs +92 -0
- package/dist/runtime/queues.d.mts +7 -0
- package/dist/runtime/queues.mjs +8 -0
- package/dist/runtime/remote/binding-handler.d.mts +15 -0
- package/dist/runtime/remote/binding-handler.mjs +208 -0
- package/dist/runtime/remote/index.d.mts +8 -0
- package/dist/runtime/remote/index.mjs +461 -0
- package/dist/runtime/response.d.mts +14 -0
- package/dist/runtime/response.mjs +30 -0
- package/dist/runtime/sandbox.d.mts +17 -0
- package/dist/runtime/sandbox.mjs +19 -0
- package/dist/runtime/schema-d1.d.mts +1 -0
- package/dist/runtime/schema-d1.mjs +2 -0
- package/dist/runtime/schema-pg.d.mts +1 -0
- package/dist/runtime/schema-pg.mjs +2 -0
- package/dist/runtime/seed.d.mts +30 -0
- package/dist/runtime/seed.mjs +6 -0
- package/dist/runtime/storage.d.mts +7 -0
- package/dist/runtime/storage.mjs +14 -0
- package/dist/runtime/validator.d.mts +2 -0
- package/dist/runtime/validator.mjs +72 -0
- package/dist/runtime/ws-server.d.mts +26 -0
- package/dist/runtime/ws-server.mjs +296 -0
- package/dist/runtime/ws.d.mts +123 -0
- package/dist/runtime/ws.mjs +103 -0
- package/dist/scan-Ba4hFwlH.mjs +324 -0
- package/dist/scan-C6HMEIdW.mjs +318 -0
- package/dist/secret-CeRSukgM.mjs +109 -0
- package/dist/skills-ipldjlKE.mjs +62 -0
- package/dist/standard-schema-9CRjx-uR.d.mts +42 -0
- package/dist/subcommand-prompt-BKjuNAPb.mjs +349 -0
- package/dist/sveltekit.d.mts +20 -0
- package/dist/sveltekit.mjs +61 -0
- package/dist/types-mHOEwpW4.d.mts +57 -0
- package/dist/validate-CaMavMxu.mjs +146 -0
- package/dist/yarn-pnp-BFqMV_bl.mjs +196 -0
- package/getting-started-prompt.txt +26 -0
- package/package.json +322 -30
- package/schema.json +364 -0
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +175 -0
- package/skills/void/SKILL.md +75 -0
- package/skills/void/command/void.md +7 -0
- package/skills/void/docs/guide/ai.md +235 -0
- package/skills/void/docs/guide/app-types.md +103 -0
- package/skills/void/docs/guide/auth.md +257 -0
- package/skills/void/docs/guide/database/d1.md +106 -0
- package/skills/void/docs/guide/database/postgresql.md +106 -0
- package/skills/void/docs/guide/database.md +418 -0
- package/skills/void/docs/guide/deployment.md +98 -0
- package/skills/void/docs/guide/edge/headers.md +79 -0
- package/skills/void/docs/guide/edge/prerendering.md +83 -0
- package/skills/void/docs/guide/edge/redirects.md +116 -0
- package/skills/void/docs/guide/edge/revalidation.md +131 -0
- package/skills/void/docs/guide/edge/rewrites.md +354 -0
- package/skills/void/docs/guide/edge/static-assets.md +72 -0
- package/skills/void/docs/guide/env-vars.md +298 -0
- package/skills/void/docs/guide/index.md +80 -0
- package/skills/void/docs/guide/jobs.md +91 -0
- package/skills/void/docs/guide/kv.md +107 -0
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +419 -0
- package/skills/void/docs/guide/pages-routing/head.md +130 -0
- package/skills/void/docs/guide/pages-routing/islands.md +405 -0
- package/skills/void/docs/guide/pages-routing/layouts.md +362 -0
- package/skills/void/docs/guide/pages-routing/loaders.md +267 -0
- package/skills/void/docs/guide/pages-routing/markdown.md +625 -0
- package/skills/void/docs/guide/pages-routing/overview.md +236 -0
- package/skills/void/docs/guide/pages-routing/view-transitions.md +140 -0
- package/skills/void/docs/guide/queues.md +140 -0
- package/skills/void/docs/guide/quickstart.md +233 -0
- package/skills/void/docs/guide/remote-dev.md +67 -0
- package/skills/void/docs/guide/sandboxes.md +82 -0
- package/skills/void/docs/guide/server-routing.md +246 -0
- package/skills/void/docs/guide/ssg.md +74 -0
- package/skills/void/docs/guide/ssr.md +105 -0
- package/skills/void/docs/guide/storage.md +67 -0
- package/skills/void/docs/guide/type-safety.md +179 -0
- package/skills/void/docs/guide/typed-fetch.md +113 -0
- package/skills/void/docs/guide/websockets.md +190 -0
- package/skills/void/docs/index.md +48 -0
- package/skills/void/docs/integrations/agents.md +84 -0
- package/skills/void/docs/integrations/cloudflare.md +284 -0
- package/skills/void/docs/integrations/frameworks/analog.md +182 -0
- package/skills/void/docs/integrations/frameworks/astro.md +197 -0
- package/skills/void/docs/integrations/frameworks/nuxt.md +164 -0
- package/skills/void/docs/integrations/frameworks/overview.md +136 -0
- package/skills/void/docs/integrations/frameworks/react-router.md +137 -0
- package/skills/void/docs/integrations/frameworks/sveltekit.md +191 -0
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +140 -0
- package/skills/void/docs/integrations/hono.md +97 -0
- package/skills/void/docs/integrations/nodejs-bun-deno.md +210 -0
- package/skills/void/docs/node_modules/@iconify/vue/README.md +408 -0
- package/skills/void/docs/node_modules/@iconify/vue/offline/readme.md +5 -0
- package/skills/void/docs/node_modules/@voidzero-dev/vitepress-theme/README.md +103 -0
- package/skills/void/docs/node_modules/oxc-minify/README.md +78 -0
- package/skills/void/docs/node_modules/reka-ui/README.md +80 -0
- package/skills/void/docs/node_modules/vitepress/README.md +28 -0
- package/skills/void/docs/node_modules/vitepress/template/api-examples.md +49 -0
- package/skills/void/docs/node_modules/vitepress/template/index.md +28 -0
- package/skills/void/docs/node_modules/vitepress/template/markdown-examples.md +85 -0
- package/skills/void/docs/node_modules/vitepress-plugin-group-icons/README.md +101 -0
- package/skills/void/docs/node_modules/void/AGENTS.md +204 -0
- package/skills/void/docs/node_modules/void/AGENT_PROMPT.md +15 -0
- package/skills/void/docs/node_modules/void/README.md +89 -0
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/CHANGELOG.md +591 -0
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/README.md +375 -0
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/sandbox/README.md +174 -0
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/vite-plugin/README.md +37 -0
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/workers-types/README.md +135 -0
- package/skills/void/docs/node_modules/void/node_modules/@electric-sql/pglite/README.md +189 -0
- package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/CHANGELOG.md +143 -0
- package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/README.md +1272 -0
- package/skills/void/docs/node_modules/void/node_modules/@napi-rs/keyring/README.md +19 -0
- package/skills/void/docs/node_modules/void/node_modules/@types/better-sqlite3/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@types/node/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@types/pg/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/README.md +22 -0
- package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/vendor/vscode-jsonrpc/README.md +69 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/README.md +152 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/engine-javascript/README.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/transformers/README.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@types/node/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/CHANGELOG.md +24 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/README.md +565 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-exit/README.md +124 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-anchor/README.md +600 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-attrs/README.md +386 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-container/README.md +95 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-emoji/README.md +101 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathe/README.md +73 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/shiki/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tinyglobby/README.md +25 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tsdown/README.md +55 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite/LICENSE.md +2230 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite/README.md +20 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vue/README.md +58 -0
- package/skills/void/docs/node_modules/void/node_modules/arktype/README.md +165 -0
- package/skills/void/docs/node_modules/void/node_modules/better-auth/LICENSE.md +20 -0
- package/skills/void/docs/node_modules/void/node_modules/better-auth/README.md +32 -0
- package/skills/void/docs/node_modules/void/node_modules/better-sqlite3/README.md +99 -0
- package/skills/void/docs/node_modules/void/node_modules/blake3-jit/README.md +108 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-arktype/README.md +51 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-kit/README.md +79 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-orm/README.md +44 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-valibot/README.md +51 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-zod/README.md +65 -0
- package/skills/void/docs/node_modules/void/node_modules/es-module-lexer/README.md +390 -0
- package/skills/void/docs/node_modules/void/node_modules/estree-walker/README.md +48 -0
- package/skills/void/docs/node_modules/void/node_modules/hono/README.md +85 -0
- package/skills/void/docs/node_modules/void/node_modules/ignore/README.md +452 -0
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/CHANGELOG.md +76 -0
- package/{LICENSE → skills/void/docs/node_modules/void/node_modules/jsonc-parser/LICENSE.md} +21 -21
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/README.md +364 -0
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/SECURITY.md +41 -0
- package/skills/void/docs/node_modules/void/node_modules/magic-string/README.md +325 -0
- package/skills/void/docs/node_modules/void/node_modules/ofetch/README.md +398 -0
- package/skills/void/docs/node_modules/void/node_modules/pathe/README.md +73 -0
- package/skills/void/docs/node_modules/void/node_modules/pg/README.md +95 -0
- package/skills/void/docs/node_modules/void/node_modules/pglite-server/LICENSE.md +21 -0
- package/skills/void/docs/node_modules/void/node_modules/pglite-server/README.md +135 -0
- package/skills/void/docs/node_modules/void/node_modules/picocolors/README.md +21 -0
- package/skills/void/docs/node_modules/void/node_modules/tinyglobby/README.md +25 -0
- package/skills/void/docs/node_modules/void/node_modules/tsdown/README.md +55 -0
- package/skills/void/docs/node_modules/void/node_modules/valibot/LICENSE.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/valibot/README.md +94 -0
- package/skills/void/docs/node_modules/void/node_modules/vite/LICENSE.md +2230 -0
- package/skills/void/docs/node_modules/void/node_modules/vite/README.md +20 -0
- package/skills/void/docs/node_modules/void/node_modules/wrangler/README.md +63 -0
- package/skills/void/docs/node_modules/void/node_modules/zod/README.md +191 -0
- package/skills/void/docs/node_modules/void/skills/migrate-vite-cloudflare-to-void/SKILL.md +175 -0
- package/skills/void/docs/node_modules/void/skills/void/SKILL.md +75 -0
- package/skills/void/docs/node_modules/void/skills/void/command/void.md +7 -0
- package/skills/void/docs/reference/api.md +917 -0
- package/skills/void/docs/reference/cli.md +561 -0
- package/skills/void/docs/reference/config.md +408 -0
- package/skills/void/docs/reference/resource-inference.md +149 -0
- package/skills/void/docs/reference/structure.md +176 -0
- package/.npmignore +0 -29
- package/.travis.yml +0 -9
- package/favicon.ico +0 -0
- package/index.js +0 -14
- package/lib/Job.js +0 -150
- package/lib/Void.js +0 -99
- package/lib/scan.js +0 -19
- package/test/credentials.js +0 -20
- package/test/job.js +0 -64
- package/test/static/dir1/test6.html +0 -0
- package/test/static/dir2/test7.html +0 -0
- package/test/static/dir2/test8.html +0 -0
- package/test/static/dir2/test9.html +0 -0
- package/test/static/test1.html +0 -0
- package/test/static/test2.html +0 -0
- package/test/static/test3.html +0 -0
- package/test/void.js +0 -31
- /package/{test/static/dir1/test4.html → skills/void/docs/integrations/auth-providers.md} +0 -0
- /package/{test/static/dir1/test5.html → skills/void/docs/integrations/payment-processors.md} +0 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import { a as join, n as dirname } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
|
|
2
|
+
import { a as writeProjectConfig } from "./project-TqORyHn8.mjs";
|
|
3
|
+
import { n as PlatformClient, s as getToken } from "./client-snXOjrp1.mjs";
|
|
4
|
+
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { createInterface } from "node:readline";
|
|
7
|
+
//#region src/cli/mcp.ts
|
|
8
|
+
function findPackageRoot(from) {
|
|
9
|
+
let dir = from;
|
|
10
|
+
while (true) {
|
|
11
|
+
if (existsSync(join(dir, "package.json"))) return dir;
|
|
12
|
+
const parent = dirname(dir);
|
|
13
|
+
if (parent === dir) break;
|
|
14
|
+
dir = parent;
|
|
15
|
+
}
|
|
16
|
+
throw new Error(`mcp: Could not find package.json from '${from}'.`);
|
|
17
|
+
}
|
|
18
|
+
function resolveDocsDir() {
|
|
19
|
+
const pkgRoot = findPackageRoot(dirname(fileURLToPath(import.meta.url)));
|
|
20
|
+
const bundledDocsDir = join(pkgRoot, "skills", "void", "docs");
|
|
21
|
+
if (existsSync(bundledDocsDir)) return bundledDocsDir;
|
|
22
|
+
const workspaceDocsDir = join(pkgRoot, "..", "..", "docs");
|
|
23
|
+
if (existsSync(workspaceDocsDir)) return workspaceDocsDir;
|
|
24
|
+
throw new Error(`mcp: Void docs directory not found. Expected bundled docs at '${bundledDocsDir}'.`);
|
|
25
|
+
}
|
|
26
|
+
function findMdFiles(dir, prefix = "") {
|
|
27
|
+
const results = [];
|
|
28
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
29
|
+
if (entry.name === "node_modules" || entry.name.startsWith(".")) continue;
|
|
30
|
+
const rel = prefix ? prefix + "/" + entry.name : entry.name;
|
|
31
|
+
if (entry.isDirectory()) results.push(...findMdFiles(join(dir, entry.name), rel));
|
|
32
|
+
else if (entry.name.endsWith(".md")) results.push(rel);
|
|
33
|
+
}
|
|
34
|
+
return results;
|
|
35
|
+
}
|
|
36
|
+
function loadDocs() {
|
|
37
|
+
const docsDir = resolveDocsDir();
|
|
38
|
+
return findMdFiles(docsDir).sort().map((file) => {
|
|
39
|
+
let content = readFileSync(join(docsDir, file), "utf-8");
|
|
40
|
+
content = content.replace(/^---\n[\s\S]*?\n---\n/, "");
|
|
41
|
+
const titleMatch = content.match(/^#\s+(.+)/m);
|
|
42
|
+
const title = titleMatch ? titleMatch[1].trim() : file.replace(/\.md$/, "");
|
|
43
|
+
return {
|
|
44
|
+
slug: file.replace(/\.md$/, ""),
|
|
45
|
+
title,
|
|
46
|
+
content
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function searchDocs(pages, query) {
|
|
51
|
+
const terms = query.toLowerCase().split(/\s+/).filter((t) => t.length > 0);
|
|
52
|
+
if (terms.length === 0) return [];
|
|
53
|
+
const scored = [];
|
|
54
|
+
for (const page of pages) {
|
|
55
|
+
const titleLower = page.title.toLowerCase();
|
|
56
|
+
const contentLower = page.content.toLowerCase();
|
|
57
|
+
let score = 0;
|
|
58
|
+
let firstMatchIndex = -1;
|
|
59
|
+
for (const term of terms) {
|
|
60
|
+
let idx = 0;
|
|
61
|
+
while ((idx = titleLower.indexOf(term, idx)) !== -1) {
|
|
62
|
+
score += 3;
|
|
63
|
+
idx += term.length;
|
|
64
|
+
}
|
|
65
|
+
idx = 0;
|
|
66
|
+
while ((idx = contentLower.indexOf(term, idx)) !== -1) {
|
|
67
|
+
score += 1;
|
|
68
|
+
if (firstMatchIndex === -1) firstMatchIndex = idx;
|
|
69
|
+
idx += term.length;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (score === 0) continue;
|
|
73
|
+
let snippet;
|
|
74
|
+
if (firstMatchIndex !== -1) {
|
|
75
|
+
const start = Math.max(0, firstMatchIndex - 80);
|
|
76
|
+
const end = Math.min(page.content.length, firstMatchIndex + 120);
|
|
77
|
+
snippet = (start > 0 ? "..." : "") + page.content.slice(start, end).trim() + (end < page.content.length ? "..." : "");
|
|
78
|
+
} else snippet = page.content.slice(0, 200).trim() + "...";
|
|
79
|
+
scored.push({
|
|
80
|
+
slug: page.slug,
|
|
81
|
+
title: page.title,
|
|
82
|
+
snippet,
|
|
83
|
+
score
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
scored.sort((a, b) => b.score - a.score);
|
|
87
|
+
return scored.slice(0, 5);
|
|
88
|
+
}
|
|
89
|
+
function createQuerySdk(token) {
|
|
90
|
+
const client = new PlatformClient(token, { root: process.cwd() });
|
|
91
|
+
const sdk = {};
|
|
92
|
+
const proto = Object.getPrototypeOf(client);
|
|
93
|
+
for (const key of Object.getOwnPropertyNames(proto)) {
|
|
94
|
+
if (key === "constructor") continue;
|
|
95
|
+
const val = proto[key];
|
|
96
|
+
if (typeof val === "function") sdk[key] = val.bind(client);
|
|
97
|
+
}
|
|
98
|
+
sdk.link = async (slug) => {
|
|
99
|
+
const existing = (await client.listProjects()).find((p) => p.slug === slug);
|
|
100
|
+
if (existing) {
|
|
101
|
+
writeProjectConfig(process.cwd(), {
|
|
102
|
+
projectId: existing.id,
|
|
103
|
+
slug: existing.slug
|
|
104
|
+
});
|
|
105
|
+
return {
|
|
106
|
+
projectId: existing.id,
|
|
107
|
+
slug: existing.slug,
|
|
108
|
+
created: false
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
const created = await client.createProject(slug);
|
|
112
|
+
writeProjectConfig(process.cwd(), {
|
|
113
|
+
projectId: created.id,
|
|
114
|
+
slug: created.slug
|
|
115
|
+
});
|
|
116
|
+
return {
|
|
117
|
+
projectId: created.id,
|
|
118
|
+
slug: created.slug,
|
|
119
|
+
created: true
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
return sdk;
|
|
123
|
+
}
|
|
124
|
+
const TOOLS = [
|
|
125
|
+
{
|
|
126
|
+
name: "list_pages",
|
|
127
|
+
description: "List all Void documentation pages with their slugs and titles",
|
|
128
|
+
inputSchema: {
|
|
129
|
+
type: "object",
|
|
130
|
+
properties: {}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: "get_page",
|
|
135
|
+
description: "Get the full content of a Void documentation page by slug",
|
|
136
|
+
inputSchema: {
|
|
137
|
+
type: "object",
|
|
138
|
+
properties: { slug: {
|
|
139
|
+
type: "string",
|
|
140
|
+
description: "Page slug, e.g. 'routing' or 'quickstart'"
|
|
141
|
+
} },
|
|
142
|
+
required: ["slug"]
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "search_docs",
|
|
147
|
+
description: "Search Void documentation by keyword query. Returns top 5 matching pages with snippets.",
|
|
148
|
+
inputSchema: {
|
|
149
|
+
type: "object",
|
|
150
|
+
properties: { query: {
|
|
151
|
+
type: "string",
|
|
152
|
+
description: "Search query, e.g. 'file routing' or 'database migrations'"
|
|
153
|
+
} },
|
|
154
|
+
required: ["query"]
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "query",
|
|
159
|
+
description: `Execute JavaScript to interact with the Void platform API.
|
|
160
|
+
|
|
161
|
+
Available methods on the "void_" object:
|
|
162
|
+
|
|
163
|
+
Account:
|
|
164
|
+
void_.whoami() → { login, plan }
|
|
165
|
+
|
|
166
|
+
Projects:
|
|
167
|
+
void_.listProjects() → { id, slug, type, created_at, custom_domain }[]
|
|
168
|
+
void_.createProject(slug) → { id, slug }
|
|
169
|
+
void_.deleteProject(projectId) → { ok, id, slug, warnings? }
|
|
170
|
+
void_.link(slug) → { projectId, slug, created } — find-or-create project + write .void/project.json
|
|
171
|
+
|
|
172
|
+
Deployments:
|
|
173
|
+
void_.listDeployments(projectId) → { deployments, activeDeploymentId }
|
|
174
|
+
void_.rollback(projectId, deploymentId, options?) → { ok, deploymentId?, migrationDiff?, error? }
|
|
175
|
+
options.allowDestructive: string[] of migration names the current
|
|
176
|
+
active has that target lacks. Required for destructive rollbacks;
|
|
177
|
+
server returns 400 if omitted or if its view of the set has drifted.
|
|
178
|
+
|
|
179
|
+
Logs:
|
|
180
|
+
void_.getLogs(projectId, since, limit?, deploymentId?) → { timestamp, outcome, logs, exceptions, url, method, status }[]
|
|
181
|
+
since: duration string (e.g. "1h"), limit: number (default 200)
|
|
182
|
+
|
|
183
|
+
Secrets:
|
|
184
|
+
void_.listSecrets(projectId) → { name }[]
|
|
185
|
+
void_.setSecret(projectId, name, value) → { ok, name }
|
|
186
|
+
void_.deleteSecret(projectId, name) → { ok, name }
|
|
187
|
+
|
|
188
|
+
Domains:
|
|
189
|
+
void_.listDomains(projectId) → { id, hostname, status, cname_target? }[]
|
|
190
|
+
void_.getDomainStatus(projectId, domainId) → { hostname, status, ssl_status, verification_errors? }
|
|
191
|
+
void_.addDomain(projectId, hostname) → { id, hostname, status, cname_target? }
|
|
192
|
+
void_.removeDomain(projectId, domainId) → { ok }
|
|
193
|
+
|
|
194
|
+
Database:
|
|
195
|
+
void_.getMigrationStatus(projectId) → { applied: { name, applied_at }[] }
|
|
196
|
+
void_.setDatabaseUrl(projectId, connectionString) → { ok }
|
|
197
|
+
void_.getResources(projectId) → { type, binding_name }[]
|
|
198
|
+
|
|
199
|
+
Write an async arrow function in JavaScript. The SDK is available as "void_".
|
|
200
|
+
Example: async () => { const ps = await void_.listProjects(); return ps.map(p => p.slug); }`,
|
|
201
|
+
inputSchema: {
|
|
202
|
+
type: "object",
|
|
203
|
+
properties: { code: {
|
|
204
|
+
type: "string",
|
|
205
|
+
description: "JavaScript async arrow function to execute"
|
|
206
|
+
} },
|
|
207
|
+
required: ["code"]
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
];
|
|
211
|
+
function handleRequest(ctx, req) {
|
|
212
|
+
const { method, id, params } = req;
|
|
213
|
+
if (method === "initialize") return {
|
|
214
|
+
jsonrpc: "2.0",
|
|
215
|
+
id,
|
|
216
|
+
result: {
|
|
217
|
+
protocolVersion: "2024-11-05",
|
|
218
|
+
capabilities: { tools: {} },
|
|
219
|
+
serverInfo: {
|
|
220
|
+
name: "void",
|
|
221
|
+
version: "1.0.0"
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
if (method === "notifications/initialized") return null;
|
|
226
|
+
if (method === "ping") return {
|
|
227
|
+
jsonrpc: "2.0",
|
|
228
|
+
id,
|
|
229
|
+
result: {}
|
|
230
|
+
};
|
|
231
|
+
if (method === "tools/list") return {
|
|
232
|
+
jsonrpc: "2.0",
|
|
233
|
+
id,
|
|
234
|
+
result: { tools: TOOLS }
|
|
235
|
+
};
|
|
236
|
+
if (method === "tools/call") {
|
|
237
|
+
const toolName = params?.name;
|
|
238
|
+
const toolArgs = params?.arguments ?? {};
|
|
239
|
+
if (toolName === "list_pages") {
|
|
240
|
+
const list = ctx.pages.map((p) => ({
|
|
241
|
+
slug: p.slug,
|
|
242
|
+
title: p.title
|
|
243
|
+
}));
|
|
244
|
+
return {
|
|
245
|
+
jsonrpc: "2.0",
|
|
246
|
+
id,
|
|
247
|
+
result: { content: [{
|
|
248
|
+
type: "text",
|
|
249
|
+
text: JSON.stringify(list, null, 2)
|
|
250
|
+
}] }
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
if (toolName === "get_page") {
|
|
254
|
+
const slug = toolArgs.slug;
|
|
255
|
+
const page = ctx.pages.find((p) => p.slug === slug);
|
|
256
|
+
if (!page) return {
|
|
257
|
+
jsonrpc: "2.0",
|
|
258
|
+
id,
|
|
259
|
+
result: {
|
|
260
|
+
content: [{
|
|
261
|
+
type: "text",
|
|
262
|
+
text: `Page not found: ${slug}`
|
|
263
|
+
}],
|
|
264
|
+
isError: true
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
return {
|
|
268
|
+
jsonrpc: "2.0",
|
|
269
|
+
id,
|
|
270
|
+
result: { content: [{
|
|
271
|
+
type: "text",
|
|
272
|
+
text: page.content
|
|
273
|
+
}] }
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
if (toolName === "search_docs") {
|
|
277
|
+
const query = toolArgs.query;
|
|
278
|
+
const results = searchDocs(ctx.pages, query);
|
|
279
|
+
return {
|
|
280
|
+
jsonrpc: "2.0",
|
|
281
|
+
id,
|
|
282
|
+
result: { content: [{
|
|
283
|
+
type: "text",
|
|
284
|
+
text: JSON.stringify(results, null, 2)
|
|
285
|
+
}] }
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
if (toolName === "query") {
|
|
289
|
+
const code = toolArgs.code;
|
|
290
|
+
if (!ctx.token) return {
|
|
291
|
+
jsonrpc: "2.0",
|
|
292
|
+
id,
|
|
293
|
+
result: {
|
|
294
|
+
content: [{
|
|
295
|
+
type: "text",
|
|
296
|
+
text: "Not logged in. Run `void auth login` first."
|
|
297
|
+
}],
|
|
298
|
+
isError: true
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
const sdk = createQuerySdk(ctx.token);
|
|
302
|
+
const AsyncFunction = async function() {}.constructor;
|
|
303
|
+
return (async () => {
|
|
304
|
+
try {
|
|
305
|
+
const fn = new AsyncFunction("void_", `return await (${code})()`);
|
|
306
|
+
const result = await Promise.race([fn(sdk), new Promise((_, reject) => setTimeout(() => reject(/* @__PURE__ */ new Error("mcp: Query timed out after 10 seconds.")), 1e4))]);
|
|
307
|
+
return {
|
|
308
|
+
jsonrpc: "2.0",
|
|
309
|
+
id,
|
|
310
|
+
result: { content: [{
|
|
311
|
+
type: "text",
|
|
312
|
+
text: JSON.stringify(result, null, 2)
|
|
313
|
+
}] }
|
|
314
|
+
};
|
|
315
|
+
} catch (err) {
|
|
316
|
+
return {
|
|
317
|
+
jsonrpc: "2.0",
|
|
318
|
+
id,
|
|
319
|
+
result: {
|
|
320
|
+
content: [{
|
|
321
|
+
type: "text",
|
|
322
|
+
text: `Error: ${err instanceof Error ? err.message : String(err)}`
|
|
323
|
+
}],
|
|
324
|
+
isError: true
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
})();
|
|
329
|
+
}
|
|
330
|
+
return {
|
|
331
|
+
jsonrpc: "2.0",
|
|
332
|
+
id,
|
|
333
|
+
error: {
|
|
334
|
+
code: -32601,
|
|
335
|
+
message: `Unknown tool: ${toolName}`
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
return {
|
|
340
|
+
jsonrpc: "2.0",
|
|
341
|
+
id,
|
|
342
|
+
error: {
|
|
343
|
+
code: -32601,
|
|
344
|
+
message: `Unknown method: ${method}`
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
function runMcp() {
|
|
349
|
+
const ctx = {
|
|
350
|
+
pages: loadDocs(),
|
|
351
|
+
token: getToken(process.cwd())
|
|
352
|
+
};
|
|
353
|
+
createInterface({ input: process.stdin }).on("line", async (line) => {
|
|
354
|
+
let req;
|
|
355
|
+
try {
|
|
356
|
+
req = JSON.parse(line);
|
|
357
|
+
} catch {
|
|
358
|
+
process.stdout.write(JSON.stringify({
|
|
359
|
+
jsonrpc: "2.0",
|
|
360
|
+
id: null,
|
|
361
|
+
error: {
|
|
362
|
+
code: -32700,
|
|
363
|
+
message: "Parse error"
|
|
364
|
+
}
|
|
365
|
+
}) + "\n");
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
const response = await handleRequest(ctx, req);
|
|
369
|
+
if (response !== null) process.stdout.write(JSON.stringify(response) + "\n");
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
//#endregion
|
|
373
|
+
export { runMcp };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { a as join } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
|
|
2
|
+
import { n as loadVoidAuthConfig, t as findVoidAuthConfig } from "./config-CvHtTM0q.mjs";
|
|
3
|
+
import { f as readConfig } from "./config-BIa9HwVX.mjs";
|
|
4
|
+
import { r as resolveVoidAuthMigrationSchema } from "./drizzle-NnudE_UN.mjs";
|
|
5
|
+
import { n as applySqliteAuthMigrations, t as applyPgAuthMigrations } from "./auth-migrations-BAtAck2g.mjs";
|
|
6
|
+
import { getMiniflareDatabasePath } from "./runner-6Ep3fNQu.mjs";
|
|
7
|
+
import { loadEnv } from "vite";
|
|
8
|
+
//#region src/auth/node.ts
|
|
9
|
+
async function runLocalVoidAuthMigrations(root, dialect, persistRoot = join(root, ".void"), databaseId = "local", configPath = findVoidAuthConfig(root)) {
|
|
10
|
+
const authConfig = await loadVoidAuthConfig(configPath);
|
|
11
|
+
const runtime = {
|
|
12
|
+
dialect,
|
|
13
|
+
providers: readConfig(root).auth?.providers ?? null,
|
|
14
|
+
userConfig: authConfig
|
|
15
|
+
};
|
|
16
|
+
const env = loadEnv("development", root, "");
|
|
17
|
+
const migrationSchema = resolveVoidAuthMigrationSchema(runtime, env);
|
|
18
|
+
if (dialect === "sqlite") {
|
|
19
|
+
const { DatabaseSync } = await import("node:sqlite");
|
|
20
|
+
const db = new DatabaseSync(getMiniflareDatabasePath(persistRoot, databaseId));
|
|
21
|
+
try {
|
|
22
|
+
await applySqliteAuthMigrations({
|
|
23
|
+
async all(sql) {
|
|
24
|
+
return db.prepare(sql).all();
|
|
25
|
+
},
|
|
26
|
+
async run(sql) {
|
|
27
|
+
db.prepare(sql).run();
|
|
28
|
+
}
|
|
29
|
+
}, migrationSchema);
|
|
30
|
+
} finally {
|
|
31
|
+
db.close();
|
|
32
|
+
}
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const connectionString = typeof env.DATABASE_URL === "string" && env.DATABASE_URL.length > 0 ? env.DATABASE_URL : void 0;
|
|
36
|
+
if (!connectionString) return;
|
|
37
|
+
const { Client } = await import("pg");
|
|
38
|
+
const client = new Client({ connectionString });
|
|
39
|
+
await client.connect();
|
|
40
|
+
try {
|
|
41
|
+
await applyPgAuthMigrations({
|
|
42
|
+
async all(sql, params) {
|
|
43
|
+
return (await client.query(sql, params)).rows;
|
|
44
|
+
},
|
|
45
|
+
async run(sql, params) {
|
|
46
|
+
await client.query(sql, params);
|
|
47
|
+
}
|
|
48
|
+
}, migrationSchema);
|
|
49
|
+
} finally {
|
|
50
|
+
await client.end();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { runLocalVoidAuthMigrations };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { r as __toESM, t as __commonJSMin } from "./chunk-DJd-R1mw.mjs";
|
|
2
|
+
import { c as R, f as at, h as ft } from "./dist-Dayj3gCK.mjs";
|
|
3
|
+
//#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
4
|
+
var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
|
+
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
6
|
+
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
7
|
+
let formatter = (open, close, replace = open) => (input) => {
|
|
8
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
9
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
10
|
+
};
|
|
11
|
+
let replaceClose = (string, close, replace, index) => {
|
|
12
|
+
let result = "", cursor = 0;
|
|
13
|
+
do {
|
|
14
|
+
result += string.substring(cursor, index) + replace;
|
|
15
|
+
cursor = index + close.length;
|
|
16
|
+
index = string.indexOf(close, cursor);
|
|
17
|
+
} while (~index);
|
|
18
|
+
return result + string.substring(cursor);
|
|
19
|
+
};
|
|
20
|
+
let createColors = (enabled = isColorSupported) => {
|
|
21
|
+
let f = enabled ? formatter : () => String;
|
|
22
|
+
return {
|
|
23
|
+
isColorSupported: enabled,
|
|
24
|
+
reset: f("\x1B[0m", "\x1B[0m"),
|
|
25
|
+
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
26
|
+
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
27
|
+
italic: f("\x1B[3m", "\x1B[23m"),
|
|
28
|
+
underline: f("\x1B[4m", "\x1B[24m"),
|
|
29
|
+
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
30
|
+
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
31
|
+
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
32
|
+
black: f("\x1B[30m", "\x1B[39m"),
|
|
33
|
+
red: f("\x1B[31m", "\x1B[39m"),
|
|
34
|
+
green: f("\x1B[32m", "\x1B[39m"),
|
|
35
|
+
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
36
|
+
blue: f("\x1B[34m", "\x1B[39m"),
|
|
37
|
+
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
38
|
+
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
39
|
+
white: f("\x1B[37m", "\x1B[39m"),
|
|
40
|
+
gray: f("\x1B[90m", "\x1B[39m"),
|
|
41
|
+
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
42
|
+
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
43
|
+
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
44
|
+
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
45
|
+
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
46
|
+
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
47
|
+
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
48
|
+
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
49
|
+
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
50
|
+
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
51
|
+
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
52
|
+
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
53
|
+
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
54
|
+
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
55
|
+
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
56
|
+
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
57
|
+
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
58
|
+
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
59
|
+
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
60
|
+
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
61
|
+
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
62
|
+
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
63
|
+
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
64
|
+
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
module.exports = createColors();
|
|
68
|
+
module.exports.createColors = createColors;
|
|
69
|
+
}));
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/cli/output.ts
|
|
72
|
+
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
73
|
+
/**
|
|
74
|
+
* CI-safe spinner wrapper. In CI environments (GitHub Actions, etc.),
|
|
75
|
+
* `@clack/prompts` spinner emits DEC Private Mode cursor hide/show codes
|
|
76
|
+
* (`\x1b[?25l` / `\x1b[?25h`) that render as text artifacts. This wrapper
|
|
77
|
+
* replaces the spinner with plain log output in CI.
|
|
78
|
+
*/
|
|
79
|
+
function createSpinner() {
|
|
80
|
+
if (!at()) return ft();
|
|
81
|
+
let currentMessage = "";
|
|
82
|
+
return {
|
|
83
|
+
start(msg = "") {
|
|
84
|
+
currentMessage = msg;
|
|
85
|
+
if (msg) R.step(msg);
|
|
86
|
+
},
|
|
87
|
+
stop(msg = "") {
|
|
88
|
+
if (msg) R.info(msg);
|
|
89
|
+
},
|
|
90
|
+
message(msg = "") {
|
|
91
|
+
if (msg && msg !== currentMessage) {
|
|
92
|
+
currentMessage = msg;
|
|
93
|
+
R.step(msg);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
cancel(msg = "") {
|
|
97
|
+
if (msg) R.warn(msg);
|
|
98
|
+
},
|
|
99
|
+
error(msg = "") {
|
|
100
|
+
if (msg) R.error(msg);
|
|
101
|
+
},
|
|
102
|
+
clear() {},
|
|
103
|
+
get isCancelled() {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function cliTitle(command) {
|
|
109
|
+
return import_picocolors.default.blue(`void ${command}`);
|
|
110
|
+
}
|
|
111
|
+
function sectionTitle(title) {
|
|
112
|
+
return import_picocolors.default.reset(import_picocolors.default.blue(title));
|
|
113
|
+
}
|
|
114
|
+
function categoryTitle(title) {
|
|
115
|
+
return import_picocolors.default.reset(import_picocolors.default.bold(import_picocolors.default.cyan(title)));
|
|
116
|
+
}
|
|
117
|
+
function dim(text) {
|
|
118
|
+
return import_picocolors.default.dim(text);
|
|
119
|
+
}
|
|
120
|
+
function tablePrefix() {
|
|
121
|
+
return `${import_picocolors.default.gray("│")} `;
|
|
122
|
+
}
|
|
123
|
+
function helpLine(command, description) {
|
|
124
|
+
return `${import_picocolors.default.reset(command.padEnd(34))} ${import_picocolors.default.dim(description)}`;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Ensure a timestamp string will be parsed as UTC by `new Date()`.
|
|
128
|
+
* DB timestamps lack timezone info — appends 'Z' only when no
|
|
129
|
+
* existing indicator (Z, z, or numeric offset) is present.
|
|
130
|
+
*/
|
|
131
|
+
function ensureUtc(s) {
|
|
132
|
+
const last = s.at(-1);
|
|
133
|
+
if (last === "Z" || last === "z") return s;
|
|
134
|
+
if (s.includes("+", 10)) return s;
|
|
135
|
+
if (s.lastIndexOf("-") > 9) return s;
|
|
136
|
+
return s + "Z";
|
|
137
|
+
}
|
|
138
|
+
//#endregion
|
|
139
|
+
export { ensureUtc as a, sectionTitle as c, dim as i, tablePrefix as l, cliTitle as n, helpLine as o, createSpinner as r, import_picocolors as s, categoryTitle as t, require_picocolors as u };
|