outask 0.0.0-stage → 1.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/LICENSE +661 -0
- package/README.md +38 -2
- package/bin/outask +7 -0
- package/bin/tasks +7 -0
- package/cli.mjs +151 -0
- package/mcp/package-lock.json +175 -0
- package/mcp/package.json +15 -0
- package/mcp/server.mjs +132 -0
- package/node_modules/@modelcontextprotocol/core/LICENSE +216 -0
- package/node_modules/@modelcontextprotocol/core/README.md +40 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-Anm-lwWi.d.mts +8507 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-Anm-lwWi.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-BNDyLTqp.mjs +1681 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-BNDyLTqp.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-D1CeV_Jr.cjs +2902 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-D1CeV_Jr.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-V9XJSCfa.d.cts +8507 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-V9XJSCfa.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.cjs +175 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.mjs +3 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.cjs +201 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +99 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +99 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.mjs +3 -0
- package/node_modules/@modelcontextprotocol/core/package.json +85 -0
- package/node_modules/@modelcontextprotocol/server/LICENSE +216 -0
- package/node_modules/@modelcontextprotocol/server/README.md +30 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs +7514 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CgI-5L6O.d.mts +1071 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CgI-5L6O.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-FOQRM7up.d.cts +1071 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-FOQRM7up.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs +7531 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs +986 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts +74 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts +74 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs +981 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/chunk-Bnu9O96Y.cjs +60 -0
- package/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs +42 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-D4NN8WsG.d.mts +4168 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-D4NN8WsG.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-DZmmlN8e.d.cts +4170 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-DZmmlN8e.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs +46 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs +34 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.cjs +1978 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.cts +810 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.mts +810 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.mjs +1790 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-BumlNux0.cjs +2477 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-BumlNux0.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-DIH4cS6P.mjs +2326 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-DIH4cS6P.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs +23 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts +11 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts +11 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs +22 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.cjs +12 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.cts +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.mts +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs +4 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs +30 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts +10 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts +10 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs +29 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-BhnGYybN.cjs +8200 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-BhnGYybN.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-Cqbh3MYc.mjs +7702 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-Cqbh3MYc.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs +591 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts +115 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts +115 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs +589 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts +1099 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts +1099 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.cjs +5 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.mjs +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.cjs +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.mjs +3 -0
- package/node_modules/@modelcontextprotocol/server/package.json +160 -0
- package/node_modules/jsonc-parser/CHANGELOG.md +76 -0
- package/node_modules/jsonc-parser/LICENSE.md +21 -0
- package/node_modules/jsonc-parser/README.md +364 -0
- package/node_modules/jsonc-parser/SECURITY.md +41 -0
- package/node_modules/jsonc-parser/lib/esm/impl/edit.js +185 -0
- package/node_modules/jsonc-parser/lib/esm/impl/format.js +261 -0
- package/node_modules/jsonc-parser/lib/esm/impl/parser.js +659 -0
- package/node_modules/jsonc-parser/lib/esm/impl/scanner.js +443 -0
- package/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +29 -0
- package/node_modules/jsonc-parser/lib/esm/main.d.ts +351 -0
- package/node_modules/jsonc-parser/lib/esm/main.js +178 -0
- package/node_modules/jsonc-parser/lib/umd/impl/edit.js +201 -0
- package/node_modules/jsonc-parser/lib/umd/impl/format.js +275 -0
- package/node_modules/jsonc-parser/lib/umd/impl/parser.js +682 -0
- package/node_modules/jsonc-parser/lib/umd/impl/scanner.js +456 -0
- package/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +42 -0
- package/node_modules/jsonc-parser/lib/umd/main.d.ts +351 -0
- package/node_modules/jsonc-parser/lib/umd/main.js +194 -0
- package/node_modules/jsonc-parser/package.json +37 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +218 -0
- package/node_modules/zod/compile.cjs +96 -0
- package/node_modules/zod/compile.d.cts +1 -0
- package/node_modules/zod/compile.d.ts +1 -0
- package/node_modules/zod/compile.js +52 -0
- package/node_modules/zod/index.cjs +52 -0
- package/node_modules/zod/index.d.cts +3 -0
- package/node_modules/zod/index.d.ts +3 -0
- package/node_modules/zod/index.js +7 -0
- package/node_modules/zod/locales/index.cjs +36 -0
- package/node_modules/zod/locales/index.d.cts +1 -0
- package/node_modules/zod/locales/index.d.ts +1 -0
- package/node_modules/zod/locales/index.js +1 -0
- package/node_modules/zod/locales/package.json +7 -0
- package/node_modules/zod/mini/index.cjs +51 -0
- package/node_modules/zod/mini/index.d.cts +3 -0
- package/node_modules/zod/mini/index.d.ts +3 -0
- package/node_modules/zod/mini/index.js +3 -0
- package/node_modules/zod/mini/package.json +7 -0
- package/node_modules/zod/package.json +147 -0
- package/node_modules/zod/src/compile.ts +56 -0
- package/node_modules/zod/src/index.ts +7 -0
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +3 -0
- package/node_modules/zod/src/v3/ZodError.ts +340 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/types.ts +5138 -0
- package/node_modules/zod/src/v4/classic/checks.ts +33 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +78 -0
- package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
- package/node_modules/zod/src/v4/classic/errors.ts +97 -0
- package/node_modules/zod/src/v4/classic/external.ts +57 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +944 -0
- package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +20 -0
- package/node_modules/zod/src/v4/classic/parse.ts +88 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2937 -0
- package/node_modules/zod/src/v4/core/api.ts +1875 -0
- package/node_modules/zod/src/v4/core/checks.ts +1266 -0
- package/node_modules/zod/src/v4/core/compile.ts +2322 -0
- package/node_modules/zod/src/v4/core/core.ts +230 -0
- package/node_modules/zod/src/v4/core/doc.ts +52 -0
- package/node_modules/zod/src/v4/core/errors.ts +543 -0
- package/node_modules/zod/src/v4/core/index.ts +19 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +131 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +934 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +148 -0
- package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
- package/node_modules/zod/src/v4/core/parse.ts +309 -0
- package/node_modules/zod/src/v4/core/regexes.ts +217 -0
- package/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/node_modules/zod/src/v4/core/schemas.ts +5226 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +857 -0
- package/node_modules/zod/src/v4/core/util.ts +1293 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/visit.ts +193 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +120 -0
- package/node_modules/zod/src/v4/locales/az.ts +116 -0
- package/node_modules/zod/src/v4/locales/be.ts +188 -0
- package/node_modules/zod/src/v4/locales/bg.ts +133 -0
- package/node_modules/zod/src/v4/locales/bn.ts +123 -0
- package/node_modules/zod/src/v4/locales/ca.ts +121 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
- package/node_modules/zod/src/v4/locales/cs.ts +123 -0
- package/node_modules/zod/src/v4/locales/da.ts +128 -0
- package/node_modules/zod/src/v4/locales/de.ts +121 -0
- package/node_modules/zod/src/v4/locales/el.ts +124 -0
- package/node_modules/zod/src/v4/locales/en.ts +136 -0
- package/node_modules/zod/src/v4/locales/eo.ts +123 -0
- package/node_modules/zod/src/v4/locales/es.ts +145 -0
- package/node_modules/zod/src/v4/locales/fa.ts +131 -0
- package/node_modules/zod/src/v4/locales/fi.ts +126 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +121 -0
- package/node_modules/zod/src/v4/locales/fr.ts +139 -0
- package/node_modules/zod/src/v4/locales/gu.ts +123 -0
- package/node_modules/zod/src/v4/locales/he.ts +253 -0
- package/node_modules/zod/src/v4/locales/hi.ts +126 -0
- package/node_modules/zod/src/v4/locales/hr.ts +135 -0
- package/node_modules/zod/src/v4/locales/hu.ts +122 -0
- package/node_modules/zod/src/v4/locales/hy.ts +175 -0
- package/node_modules/zod/src/v4/locales/id.ts +120 -0
- package/node_modules/zod/src/v4/locales/index.ts +63 -0
- package/node_modules/zod/src/v4/locales/is.ts +124 -0
- package/node_modules/zod/src/v4/locales/it.ts +121 -0
- package/node_modules/zod/src/v4/locales/ja.ts +119 -0
- package/node_modules/zod/src/v4/locales/ka.ts +128 -0
- package/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/node_modules/zod/src/v4/locales/km.ts +124 -0
- package/node_modules/zod/src/v4/locales/kn.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +126 -0
- package/node_modules/zod/src/v4/locales/lt.ts +243 -0
- package/node_modules/zod/src/v4/locales/mk.ts +123 -0
- package/node_modules/zod/src/v4/locales/ms.ts +120 -0
- package/node_modules/zod/src/v4/locales/ne.ts +128 -0
- package/node_modules/zod/src/v4/locales/nl.ts +126 -0
- package/node_modules/zod/src/v4/locales/nn.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +121 -0
- package/node_modules/zod/src/v4/locales/ota.ts +122 -0
- package/node_modules/zod/src/v4/locales/pl.ts +123 -0
- package/node_modules/zod/src/v4/locales/ps.ts +131 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
- package/node_modules/zod/src/v4/locales/pt.ts +159 -0
- package/node_modules/zod/src/v4/locales/ro.ts +132 -0
- package/node_modules/zod/src/v4/locales/ru.ts +188 -0
- package/node_modules/zod/src/v4/locales/sk.ts +123 -0
- package/node_modules/zod/src/v4/locales/sl.ts +123 -0
- package/node_modules/zod/src/v4/locales/sv.ts +124 -0
- package/node_modules/zod/src/v4/locales/ta.ts +123 -0
- package/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/node_modules/zod/src/v4/locales/th.ts +124 -0
- package/node_modules/zod/src/v4/locales/tk.ts +113 -0
- package/node_modules/zod/src/v4/locales/tr.ts +116 -0
- package/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/node_modules/zod/src/v4/locales/uk.ts +122 -0
- package/node_modules/zod/src/v4/locales/ur.ts +124 -0
- package/node_modules/zod/src/v4/locales/uz.ts +120 -0
- package/node_modules/zod/src/v4/locales/vi.ts +122 -0
- package/node_modules/zod/src/v4/locales/yo.ts +129 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +121 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +120 -0
- package/node_modules/zod/src/v4/mini/checks.ts +33 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
- package/node_modules/zod/src/v4/mini/external.ts +52 -0
- package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/node_modules/zod/src/v4/mini/parse.ts +16 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +2051 -0
- package/node_modules/zod/src/v4-mini/index.ts +3 -0
- package/node_modules/zod/v3/ZodError.cjs +167 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +143 -0
- package/node_modules/zod/v3/errors.cjs +36 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +41 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +21 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +28 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +143 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +21 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +21 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +156 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +52 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +112 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/package.json +7 -0
- package/node_modules/zod/v3/standard-schema.cjs +21 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3798 -0
- package/node_modules/zod/v3/types.d.cts +1034 -0
- package/node_modules/zod/v3/types.d.ts +1034 -0
- package/node_modules/zod/v3/types.js +3697 -0
- package/node_modules/zod/v4/classic/checks.cjs +53 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +66 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +80 -0
- package/node_modules/zod/v4/classic/compat.d.cts +48 -0
- package/node_modules/zod/v4/classic/compat.d.ts +48 -0
- package/node_modules/zod/v4/classic/compat.js +31 -0
- package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.js +13 -0
- package/node_modules/zod/v4/classic/errors.cjs +102 -0
- package/node_modules/zod/v4/classic/errors.d.cts +29 -0
- package/node_modules/zod/v4/classic/errors.d.ts +29 -0
- package/node_modules/zod/v4/classic/errors.js +57 -0
- package/node_modules/zod/v4/classic/external.cjs +97 -0
- package/node_modules/zod/v4/classic/external.d.cts +19 -0
- package/node_modules/zod/v4/classic/external.d.ts +19 -0
- package/node_modules/zod/v4/classic/external.js +17 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +926 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +881 -0
- package/node_modules/zod/v4/classic/in-out.cjs +82 -0
- package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
- package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
- package/node_modules/zod/v4/classic/in-out.js +36 -0
- package/node_modules/zod/v4/classic/index.cjs +52 -0
- package/node_modules/zod/v4/classic/index.d.cts +3 -0
- package/node_modules/zod/v4/classic/index.d.ts +3 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +68 -0
- package/node_modules/zod/v4/classic/iso.d.cts +7 -0
- package/node_modules/zod/v4/classic/iso.d.ts +7 -0
- package/node_modules/zod/v4/classic/iso.js +15 -0
- package/node_modules/zod/v4/classic/package.json +7 -0
- package/node_modules/zod/v4/classic/parse.cjs +63 -0
- package/node_modules/zod/v4/classic/parse.d.cts +44 -0
- package/node_modules/zod/v4/classic/parse.d.ts +44 -0
- package/node_modules/zod/v4/classic/parse.js +16 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1676 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +816 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +816 -0
- package/node_modules/zod/v4/classic/schemas.js +1535 -0
- package/node_modules/zod/v4/core/api.cjs +1269 -0
- package/node_modules/zod/v4/core/api.d.cts +335 -0
- package/node_modules/zod/v4/core/api.d.ts +335 -0
- package/node_modules/zod/v4/core/api.js +1107 -0
- package/node_modules/zod/v4/core/checks.cjs +561 -0
- package/node_modules/zod/v4/core/checks.d.cts +294 -0
- package/node_modules/zod/v4/core/checks.d.ts +294 -0
- package/node_modules/zod/v4/core/checks.js +516 -0
- package/node_modules/zod/v4/core/compile.cjs +1916 -0
- package/node_modules/zod/v4/core/compile.d.cts +65 -0
- package/node_modules/zod/v4/core/compile.d.ts +65 -0
- package/node_modules/zod/v4/core/compile.js +1866 -0
- package/node_modules/zod/v4/core/core.cjs +167 -0
- package/node_modules/zod/v4/core/core.d.cts +82 -0
- package/node_modules/zod/v4/core/core.d.ts +82 -0
- package/node_modules/zod/v4/core/core.js +141 -0
- package/node_modules/zod/v4/core/doc.cjs +61 -0
- package/node_modules/zod/v4/core/doc.d.cts +16 -0
- package/node_modules/zod/v4/core/doc.d.ts +16 -0
- package/node_modules/zod/v4/core/doc.js +38 -0
- package/node_modules/zod/v4/core/errors.cjs +317 -0
- package/node_modules/zod/v4/core/errors.d.cts +225 -0
- package/node_modules/zod/v4/core/errors.d.ts +225 -0
- package/node_modules/zod/v4/core/errors.js +267 -0
- package/node_modules/zod/v4/core/index.cjs +70 -0
- package/node_modules/zod/v4/core/index.d.cts +19 -0
- package/node_modules/zod/v4/core/index.d.ts +19 -0
- package/node_modules/zod/v4/core/index.js +19 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +122 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +99 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +929 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +843 -0
- package/node_modules/zod/v4/core/json-schema.cjs +21 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +89 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +89 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/memoizer.cjs +360 -0
- package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
- package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
- package/node_modules/zod/v4/core/memoizer.js +311 -0
- package/node_modules/zod/v4/core/package.json +7 -0
- package/node_modules/zod/v4/core/parse.cjs +233 -0
- package/node_modules/zod/v4/core/parse.d.cts +52 -0
- package/node_modules/zod/v4/core/parse.d.ts +52 -0
- package/node_modules/zod/v4/core/parse.js +175 -0
- package/node_modules/zod/v4/core/regexes.cjs +209 -0
- package/node_modules/zod/v4/core/regexes.d.cts +90 -0
- package/node_modules/zod/v4/core/regexes.d.ts +90 -0
- package/node_modules/zod/v4/core/regexes.js +156 -0
- package/node_modules/zod/v4/core/registries.cjs +75 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +2699 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1275 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1275 -0
- package/node_modules/zod/v4/core/schemas.js +2636 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +21 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +681 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +154 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +154 -0
- package/node_modules/zod/v4/core/to-json-schema.js +651 -0
- package/node_modules/zod/v4/core/util.cjs +964 -0
- package/node_modules/zod/v4/core/util.d.cts +280 -0
- package/node_modules/zod/v4/core/util.d.ts +280 -0
- package/node_modules/zod/v4/core/util.js +873 -0
- package/node_modules/zod/v4/core/versions.cjs +27 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/core/visit.cjs +214 -0
- package/node_modules/zod/v4/core/visit.d.cts +30 -0
- package/node_modules/zod/v4/core/visit.d.ts +30 -0
- package/node_modules/zod/v4/core/visit.js +169 -0
- package/node_modules/zod/v4/index.cjs +51 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +4 -0
- package/node_modules/zod/v4/locales/ar.cjs +138 -0
- package/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +111 -0
- package/node_modules/zod/v4/locales/az.cjs +137 -0
- package/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +110 -0
- package/node_modules/zod/v4/locales/be.cjs +195 -0
- package/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +168 -0
- package/node_modules/zod/v4/locales/bg.cjs +152 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/node_modules/zod/v4/locales/bg.js +125 -0
- package/node_modules/zod/v4/locales/bn.cjs +140 -0
- package/node_modules/zod/v4/locales/bn.d.cts +5 -0
- package/node_modules/zod/v4/locales/bn.d.ts +4 -0
- package/node_modules/zod/v4/locales/bn.js +113 -0
- package/node_modules/zod/v4/locales/ca.cjs +139 -0
- package/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +112 -0
- package/node_modules/zod/v4/locales/ckb.cjs +160 -0
- package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
- package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
- package/node_modules/zod/v4/locales/ckb.js +133 -0
- package/node_modules/zod/v4/locales/cs.cjs +143 -0
- package/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +116 -0
- package/node_modules/zod/v4/locales/da.cjs +147 -0
- package/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/node_modules/zod/v4/locales/da.js +120 -0
- package/node_modules/zod/v4/locales/de.cjs +140 -0
- package/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +113 -0
- package/node_modules/zod/v4/locales/el.cjs +139 -0
- package/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/node_modules/zod/v4/locales/el.js +112 -0
- package/node_modules/zod/v4/locales/en.cjs +152 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/node_modules/zod/v4/locales/en.js +125 -0
- package/node_modules/zod/v4/locales/eo.cjs +141 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/node_modules/zod/v4/locales/eo.js +114 -0
- package/node_modules/zod/v4/locales/es.cjs +163 -0
- package/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +136 -0
- package/node_modules/zod/v4/locales/fa.cjs +146 -0
- package/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +119 -0
- package/node_modules/zod/v4/locales/fi.cjs +144 -0
- package/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +117 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +139 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +112 -0
- package/node_modules/zod/v4/locales/fr.cjs +156 -0
- package/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +129 -0
- package/node_modules/zod/v4/locales/gu.cjs +140 -0
- package/node_modules/zod/v4/locales/gu.d.cts +5 -0
- package/node_modules/zod/v4/locales/gu.d.ts +4 -0
- package/node_modules/zod/v4/locales/gu.js +113 -0
- package/node_modules/zod/v4/locales/he.cjs +248 -0
- package/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +221 -0
- package/node_modules/zod/v4/locales/hi.cjs +138 -0
- package/node_modules/zod/v4/locales/hi.d.cts +5 -0
- package/node_modules/zod/v4/locales/hi.d.ts +4 -0
- package/node_modules/zod/v4/locales/hi.js +111 -0
- package/node_modules/zod/v4/locales/hr.cjs +153 -0
- package/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/node_modules/zod/v4/locales/hr.js +126 -0
- package/node_modules/zod/v4/locales/hu.cjs +140 -0
- package/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +113 -0
- package/node_modules/zod/v4/locales/hy.cjs +185 -0
- package/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/node_modules/zod/v4/locales/hy.js +158 -0
- package/node_modules/zod/v4/locales/id.cjs +138 -0
- package/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +111 -0
- package/node_modules/zod/v4/locales/index.cjs +152 -0
- package/node_modules/zod/v4/locales/index.d.cts +63 -0
- package/node_modules/zod/v4/locales/index.d.ts +63 -0
- package/node_modules/zod/v4/locales/index.js +63 -0
- package/node_modules/zod/v4/locales/is.cjs +141 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/node_modules/zod/v4/locales/is.js +114 -0
- package/node_modules/zod/v4/locales/it.cjs +140 -0
- package/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +113 -0
- package/node_modules/zod/v4/locales/ja.cjs +139 -0
- package/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +112 -0
- package/node_modules/zod/v4/locales/ka.cjs +144 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/node_modules/zod/v4/locales/ka.js +117 -0
- package/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/node_modules/zod/v4/locales/kh.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +142 -0
- package/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/node_modules/zod/v4/locales/km.js +115 -0
- package/node_modules/zod/v4/locales/kn.cjs +143 -0
- package/node_modules/zod/v4/locales/kn.d.cts +5 -0
- package/node_modules/zod/v4/locales/kn.d.ts +4 -0
- package/node_modules/zod/v4/locales/kn.js +116 -0
- package/node_modules/zod/v4/locales/ko.cjs +143 -0
- package/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +116 -0
- package/node_modules/zod/v4/locales/lt.cjs +234 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/node_modules/zod/v4/locales/lt.js +207 -0
- package/node_modules/zod/v4/locales/mk.cjs +141 -0
- package/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +114 -0
- package/node_modules/zod/v4/locales/ms.cjs +139 -0
- package/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +112 -0
- package/node_modules/zod/v4/locales/ne.cjs +138 -0
- package/node_modules/zod/v4/locales/ne.d.cts +5 -0
- package/node_modules/zod/v4/locales/ne.d.ts +4 -0
- package/node_modules/zod/v4/locales/ne.js +111 -0
- package/node_modules/zod/v4/locales/nl.cjs +142 -0
- package/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +115 -0
- package/node_modules/zod/v4/locales/nn.cjs +140 -0
- package/node_modules/zod/v4/locales/nn.d.cts +5 -0
- package/node_modules/zod/v4/locales/nn.d.ts +4 -0
- package/node_modules/zod/v4/locales/nn.js +113 -0
- package/node_modules/zod/v4/locales/no.cjs +140 -0
- package/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +113 -0
- package/node_modules/zod/v4/locales/ota.cjs +141 -0
- package/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +114 -0
- package/node_modules/zod/v4/locales/package.json +7 -0
- package/node_modules/zod/v4/locales/pl.cjs +141 -0
- package/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +114 -0
- package/node_modules/zod/v4/locales/ps.cjs +146 -0
- package/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +119 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
- package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt-BR.js +143 -0
- package/node_modules/zod/v4/locales/pt.cjs +169 -0
- package/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +142 -0
- package/node_modules/zod/v4/locales/ro.cjs +149 -0
- package/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/node_modules/zod/v4/locales/ro.js +122 -0
- package/node_modules/zod/v4/locales/ru.cjs +195 -0
- package/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +168 -0
- package/node_modules/zod/v4/locales/sk.cjs +143 -0
- package/node_modules/zod/v4/locales/sk.d.cts +5 -0
- package/node_modules/zod/v4/locales/sk.d.ts +4 -0
- package/node_modules/zod/v4/locales/sk.js +116 -0
- package/node_modules/zod/v4/locales/sl.cjs +141 -0
- package/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +114 -0
- package/node_modules/zod/v4/locales/sv.cjs +142 -0
- package/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +115 -0
- package/node_modules/zod/v4/locales/ta.cjs +142 -0
- package/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +115 -0
- package/node_modules/zod/v4/locales/tg.cjs +144 -0
- package/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/node_modules/zod/v4/locales/tg.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +142 -0
- package/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +115 -0
- package/node_modules/zod/v4/locales/tk.cjs +134 -0
- package/node_modules/zod/v4/locales/tk.d.cts +5 -0
- package/node_modules/zod/v4/locales/tk.d.ts +4 -0
- package/node_modules/zod/v4/locales/tk.js +107 -0
- package/node_modules/zod/v4/locales/tr.cjs +137 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/node_modules/zod/v4/locales/tr.js +110 -0
- package/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/node_modules/zod/v4/locales/ua.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +140 -0
- package/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/node_modules/zod/v4/locales/uk.js +113 -0
- package/node_modules/zod/v4/locales/ur.cjs +142 -0
- package/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +115 -0
- package/node_modules/zod/v4/locales/uz.cjs +140 -0
- package/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/node_modules/zod/v4/locales/uz.js +113 -0
- package/node_modules/zod/v4/locales/vi.cjs +140 -0
- package/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +113 -0
- package/node_modules/zod/v4/locales/yo.cjs +139 -0
- package/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/node_modules/zod/v4/locales/yo.js +112 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +141 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +114 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +139 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +112 -0
- package/node_modules/zod/v4/mini/checks.cjs +54 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +71 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +22 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.js +13 -0
- package/node_modules/zod/v4/mini/external.cjs +95 -0
- package/node_modules/zod/v4/mini/external.d.cts +16 -0
- package/node_modules/zod/v4/mini/external.d.ts +16 -0
- package/node_modules/zod/v4/mini/external.js +16 -0
- package/node_modules/zod/v4/mini/in-out.cjs +82 -0
- package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
- package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
- package/node_modules/zod/v4/mini/in-out.js +36 -0
- package/node_modules/zod/v4/mini/index.cjs +51 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +83 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +34 -0
- package/node_modules/zod/v4/mini/package.json +7 -0
- package/node_modules/zod/v4/mini/parse.cjs +37 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +1147 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +480 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +480 -0
- package/node_modules/zod/v4/mini/schemas.js +1002 -0
- package/node_modules/zod/v4/package.json +7 -0
- package/node_modules/zod/v4-mini/index.cjs +51 -0
- package/node_modules/zod/v4-mini/index.d.cts +3 -0
- package/node_modules/zod/v4-mini/index.d.ts +3 -0
- package/node_modules/zod/v4-mini/index.js +3 -0
- package/node_modules/zod/v4-mini/package.json +7 -0
- package/package.json +32 -4
- package/runtime.cjs +14 -0
- package/scripts/arguments.mjs +77 -0
- package/scripts/continuation.mjs +31 -0
- package/scripts/create-task.mjs +27 -0
- package/scripts/delete-task.mjs +3 -0
- package/scripts/entry.mjs +6 -0
- package/scripts/get-task.mjs +40 -0
- package/scripts/get-tasks.mjs +84 -0
- package/scripts/hook.mjs +89 -0
- package/scripts/inspect-blockers.mjs +76 -0
- package/scripts/install-launcher.mjs +28 -0
- package/scripts/install-migration.mjs +82 -0
- package/scripts/install-path.mjs +105 -0
- package/scripts/install-release.mjs +252 -0
- package/scripts/lifecycle.mjs +35 -0
- package/scripts/list-tasks.mjs +117 -0
- package/scripts/output.mjs +67 -0
- package/scripts/schema.mjs +41 -0
- package/scripts/search-tasks.mjs +96 -0
- package/scripts/task-write-input.mjs +80 -0
- package/scripts/transition-task.mjs +3 -0
- package/scripts/update-release.mjs +82 -0
- package/scripts/update-task.mjs +29 -0
- package/scripts/validate-task-stores.mjs +34 -0
- package/src/blockers.mjs +134 -0
- package/src/cache.mjs +50 -0
- package/src/config.mjs +30 -0
- package/src/create.mjs +145 -0
- package/src/cursor.mjs +30 -0
- package/src/destinations.mjs +74 -0
- package/src/errors.mjs +16 -0
- package/src/field-rules.mjs +105 -0
- package/src/fields.mjs +32 -0
- package/src/input.mjs +146 -0
- package/src/limits.mjs +5 -0
- package/src/locations.mjs +19 -0
- package/src/pagination.mjs +30 -0
- package/src/project-lock.mjs +74 -0
- package/src/projects.mjs +33 -0
- package/src/response.mjs +75 -0
- package/src/schema.mjs +76 -0
- package/src/search-index-worker.mjs +10 -0
- package/src/search-index.mjs +639 -0
- package/src/search.mjs +228 -0
- package/src/service.mjs +260 -0
- package/src/source.mjs +48 -0
- package/src/sqlite.mjs +17 -0
- package/src/storage-format.mjs +15 -0
- package/src/stores.mjs +337 -0
- package/src/tasks.mjs +290 -0
- package/src/timestamps.mjs +22 -0
- package/src/transition.mjs +181 -0
- package/src/update.mjs +56 -0
- package/src/validation.mjs +144 -0
- package/src/version.mjs +5 -0
package/src/create.mjs
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { statSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { fail } from './errors.mjs';
|
|
5
|
+
import { mutationProject, selectStore, withDestination } from './destinations.mjs';
|
|
6
|
+
import { nextTimestamp } from './timestamps.mjs';
|
|
7
|
+
import { projectBudget, readArray } from './input.mjs';
|
|
8
|
+
import { inputBytes, projectBytes, responseBytes } from './limits.mjs';
|
|
9
|
+
import { jsonBytes } from './response.mjs';
|
|
10
|
+
import { knownCounter, readService, recoverMove, replaceFile, serviceState, withProjectLock } from './service.mjs';
|
|
11
|
+
import { finishStore, formatValue } from './storage-format.mjs';
|
|
12
|
+
import { effectiveRecord, openProject, projectRelative, retainedFiles, serviceFile } from './stores.mjs';
|
|
13
|
+
import { scanProject, validateCycles, validateRecord } from './validation.mjs';
|
|
14
|
+
|
|
15
|
+
const object = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
16
|
+
const sameFiles = (left, right) => JSON.stringify(left) === JSON.stringify(right);
|
|
17
|
+
|
|
18
|
+
function taskInput(input) {
|
|
19
|
+
if (!object(input)) fail('INVALID_INPUT', 'task input must be a JSON object');
|
|
20
|
+
let source;
|
|
21
|
+
try {
|
|
22
|
+
source = JSON.stringify(input, (key, value) => {
|
|
23
|
+
if (['undefined', 'function', 'symbol', 'bigint'].includes(typeof value)
|
|
24
|
+
|| (typeof value === 'number' && !Number.isFinite(value))) {
|
|
25
|
+
fail('INVALID_INPUT', 'task input must contain only JSON values');
|
|
26
|
+
}
|
|
27
|
+
return value;
|
|
28
|
+
});
|
|
29
|
+
} catch (error) {
|
|
30
|
+
if (error.code === 'INVALID_INPUT') throw error;
|
|
31
|
+
fail('INVALID_INPUT', 'task input must contain only JSON values without circular references');
|
|
32
|
+
}
|
|
33
|
+
if (Buffer.byteLength(source, 'utf8') > inputBytes) fail('INPUT_TOO_LARGE', 'task input exceeds the 8 MiB read budget');
|
|
34
|
+
const task = JSON.parse(source);
|
|
35
|
+
if (!object(task)) fail('INVALID_INPUT', 'task input must be a JSON object');
|
|
36
|
+
if (task.id !== undefined && (!Number.isSafeInteger(task.id) || task.id <= 0)) {
|
|
37
|
+
fail('INVALID_INPUT', 'id must be a positive safe integer');
|
|
38
|
+
}
|
|
39
|
+
return task;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function readActive(project, target, fingerprints) {
|
|
43
|
+
const budget = { ...projectBudget(), fingerprints: {} };
|
|
44
|
+
const active = new Map();
|
|
45
|
+
const activeIds = new Set();
|
|
46
|
+
let source;
|
|
47
|
+
let count;
|
|
48
|
+
const retained = new Set(retainedFiles(project));
|
|
49
|
+
for (const [file, rules] of Object.entries(project.stores)) {
|
|
50
|
+
if (!retained.has(file)) continue;
|
|
51
|
+
const activeStore = rules.statuses.some((status) => project.groups.get(status) === 'Active');
|
|
52
|
+
if (file !== target && !activeStore) continue;
|
|
53
|
+
const path = join(project.directory, file);
|
|
54
|
+
const { source: text, records } = readArray(path, budget);
|
|
55
|
+
if (budget.fingerprints[path] !== fingerprints[projectRelative(project.root, path)]) {
|
|
56
|
+
fail('PROJECT_CHANGED', 'task files changed before creation; retry after edits finish');
|
|
57
|
+
}
|
|
58
|
+
if (file === target) {
|
|
59
|
+
source = text;
|
|
60
|
+
count = 0;
|
|
61
|
+
}
|
|
62
|
+
for (const { value } of records) {
|
|
63
|
+
if (file === target) count++;
|
|
64
|
+
if (!activeStore) continue;
|
|
65
|
+
const record = rules.validate === false && rules.missing_status === undefined ? value : effectiveRecord(value, project, file, `tasks/${file}`);
|
|
66
|
+
if (project.groups.get(record.status) !== 'Active') continue;
|
|
67
|
+
activeIds.add(record.id);
|
|
68
|
+
if (rules.validate !== false) active.set(record.id, { blockers: record.blockers ?? [] });
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return { active, activeIds, source, count };
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function createTask(projectPath, input, options = {}) {
|
|
75
|
+
const supplied = taskInput(input);
|
|
76
|
+
if (Object.hasOwn(supplied, 'updated_at')) fail('INVALID_INPUT', 'updated_at is tracker-owned; omit it when creating a task');
|
|
77
|
+
if (!object(options) || Object.keys(options).some((key) => !['store', 'schemaPath'].includes(key))
|
|
78
|
+
|| (options.store !== undefined && (typeof options.store !== 'string' || !options.store.trim()))) {
|
|
79
|
+
fail('INVALID_INPUT', 'options must contain only optional store and schemaPath values');
|
|
80
|
+
}
|
|
81
|
+
const initial = openProject(projectPath, undefined, true, true, options.schemaPath);
|
|
82
|
+
return withProjectLock(initial, 'creation', () => {
|
|
83
|
+
recoverMove(initial);
|
|
84
|
+
const destinations = mutationProject(openProject(initial.root, undefined, false, true, initial.schema));
|
|
85
|
+
const status = supplied.status === undefined ? (destinations.config?.default_status ?? 'pending') : supplied.status;
|
|
86
|
+
return withDestination(destinations, status, options.store, () => {
|
|
87
|
+
const service = readService(initial);
|
|
88
|
+
let snapshot = scanProject(initial.root, false, initial.schema);
|
|
89
|
+
let counter = service.counter;
|
|
90
|
+
if (counter === undefined || service.validated?.counter !== counter || !sameFiles(service.validated?.files, snapshot.fingerprints)
|
|
91
|
+
|| (supplied.id !== undefined && supplied.id <= counter)) {
|
|
92
|
+
snapshot = scanProject(initial.root, true, initial.schema);
|
|
93
|
+
counter = Math.max(knownCounter(service), snapshot.maximum);
|
|
94
|
+
if (snapshot.ids.has(supplied.id)) fail('ID_CONFLICT', `task id ${supplied.id} already exists at ${snapshot.ids.get(supplied.id)}`);
|
|
95
|
+
}
|
|
96
|
+
const id = supplied.id ?? counter + 1;
|
|
97
|
+
if (!Number.isSafeInteger(id)) fail('ID_EXHAUSTED', 'the task ID counter has reached the largest safe integer; automatic allocation is unavailable');
|
|
98
|
+
const { project } = snapshot;
|
|
99
|
+
const target = selectStore(project, status, options.store);
|
|
100
|
+
const defaults = project.config?.format === 'minimal' ? {} : { priority: 'medium', blockers: [] };
|
|
101
|
+
const task = { id, title: supplied.title, status, ...defaults, ...supplied, updated_at: nextTimestamp() };
|
|
102
|
+
validateRecord(task, 'new task', project, target);
|
|
103
|
+
if (task.blockers?.includes(id)) fail('INVALID_STORE', `task ${id}: blockers must not contain its own id`);
|
|
104
|
+
const selected = readActive(project, target, snapshot.fingerprints);
|
|
105
|
+
const working = project.config?.working_statuses ?? ['in_progress', 'review'];
|
|
106
|
+
if (working.includes(status)) {
|
|
107
|
+
const blockers = [...new Set((task.blockers ?? []).filter((blocker) => selected.activeIds.has(blocker)))].sort((a, b) => a - b);
|
|
108
|
+
if (blockers.length) fail('ACTIVE_BLOCKERS', `task ${id} cannot enter ${status}; Active blockers: ${blockers.join(', ')}`);
|
|
109
|
+
}
|
|
110
|
+
if (project.groups.get(status) === 'Active') selected.active.set(id, task);
|
|
111
|
+
validateCycles(selected.active);
|
|
112
|
+
if (jsonBytes(task) + 1 > responseBytes) {
|
|
113
|
+
fail('OUTPUT_TOO_LARGE', 'the complete created task exceeds 32 KiB; shorten the task input before creating it');
|
|
114
|
+
}
|
|
115
|
+
// Append to the original array so unrelated numeric literals and formatting survive.
|
|
116
|
+
const end = selected.source.lastIndexOf(0x5d);
|
|
117
|
+
let contentEnd = end;
|
|
118
|
+
while ([0x20, 0x09, 0x0a, 0x0d].includes(selected.source[contentEnd - 1])) contentEnd--;
|
|
119
|
+
const record = Buffer.from(` ${formatValue(task, ' ')}`);
|
|
120
|
+
const source = finishStore(Buffer.concat([
|
|
121
|
+
selected.source.subarray(0, contentEnd), Buffer.from(`${selected.count ? ',' : ''}\n`),
|
|
122
|
+
record, Buffer.from('\n'), selected.source.subarray(end),
|
|
123
|
+
]));
|
|
124
|
+
if (source.length - selected.source.length > project.budget.remaining) {
|
|
125
|
+
fail('INPUT_TOO_LARGE', `creating this task would exceed the ${projectBytes / 1024 / 1024} MiB project source budget; reduce retained input first`);
|
|
126
|
+
}
|
|
127
|
+
const path = join(project.directory, target);
|
|
128
|
+
const fingerprints = { ...snapshot.fingerprints, [projectRelative(project.root, path)]: createHash('sha256').update(source).digest('hex') };
|
|
129
|
+
const state = serviceState(service, Math.max(counter, id), fingerprints);
|
|
130
|
+
if (jsonBytes(state, 2, inputBytes) + 1 > inputBytes) fail('INPUT_TOO_LARGE', 'resulting service state would exceed its 8 MiB read budget');
|
|
131
|
+
const stateSource = `${JSON.stringify(state, null, 2)}\n`;
|
|
132
|
+
const current = scanProject(project.root, false, project.schema);
|
|
133
|
+
if (!sameFiles(snapshot.fingerprints, current.fingerprints)) {
|
|
134
|
+
fail('PROJECT_CHANGED', 'task files or configuration changed during creation; retry after edits finish');
|
|
135
|
+
}
|
|
136
|
+
replaceFile(path, source, statSync(path).mode & 0o777);
|
|
137
|
+
try {
|
|
138
|
+
replaceFile(join(project.directory, serviceFile), stateSource);
|
|
139
|
+
} catch (error) {
|
|
140
|
+
fail('WRITE_INCOMPLETE', `task ${id} was saved to tasks/${target}, but service refresh failed (${error.code}); inspect that task and validate the project before creating again; do not blindly repeat the request`);
|
|
141
|
+
}
|
|
142
|
+
return task;
|
|
143
|
+
});
|
|
144
|
+
}, 5000);
|
|
145
|
+
}
|
package/src/cursor.mjs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { fail } from './errors.mjs';
|
|
3
|
+
|
|
4
|
+
const isText = (value) => typeof value === 'string' && value.trim() !== '';
|
|
5
|
+
|
|
6
|
+
export function cursorBinding(value) {
|
|
7
|
+
return createHash('sha256').update(JSON.stringify(value)).digest('base64url');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function encodeCursor(offset, binding) {
|
|
11
|
+
return Buffer.from(JSON.stringify({ v: 1, o: offset, b: binding })).toString('base64url');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function decodeCursor(cursor, binding, operation) {
|
|
15
|
+
if (cursor === undefined) return 0;
|
|
16
|
+
if (!isText(cursor) || !/^[A-Za-z0-9_-]+$/.test(cursor)) {
|
|
17
|
+
fail('INVALID_CURSOR', `cursor is invalid; start a new ${operation}`);
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
const value = JSON.parse(Buffer.from(cursor, 'base64url').toString('utf8'));
|
|
21
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value)
|
|
22
|
+
|| value.v !== 1 || !Number.isSafeInteger(value.o) || value.o < 0 || value.b !== binding) {
|
|
23
|
+
fail('INVALID_CURSOR', `cursor does not belong to this ${operation}; start a new ${operation}`);
|
|
24
|
+
}
|
|
25
|
+
return value.o;
|
|
26
|
+
} catch (error) {
|
|
27
|
+
if (error.code === 'INVALID_CURSOR') throw error;
|
|
28
|
+
fail('INVALID_CURSOR', `cursor is invalid; start a new ${operation}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { closeSync, existsSync, fstatSync, lstatSync, openSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { pendingFile, standardStores } from './stores.mjs';
|
|
4
|
+
import { readText } from './input.mjs';
|
|
5
|
+
import { fail } from './errors.mjs';
|
|
6
|
+
|
|
7
|
+
export function configuredStatuses(project, group) {
|
|
8
|
+
return [...new Set(Object.values(project.stores).flatMap((rules) => rules.statuses))]
|
|
9
|
+
.filter((status) => group === undefined || project.groups.get(status) === group).sort();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function validateStatuses(project, supplied) {
|
|
13
|
+
const allowed = configuredStatuses(project);
|
|
14
|
+
const unknown = Object.entries(supplied).filter(([, status]) => !allowed.includes(status));
|
|
15
|
+
if (unknown.length) {
|
|
16
|
+
const values = unknown.map(([name, status]) => `${name}=${JSON.stringify(status)}`).join(', ');
|
|
17
|
+
fail('INVALID_INPUT', `unknown status values: ${values}; allowed configured statuses: ${allowed.join(', ')}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function selectStore(project, status, requested) {
|
|
22
|
+
validateStatuses(project, { status });
|
|
23
|
+
const candidates = Object.keys(project.stores).filter((file) => project.stores[file].statuses.includes(status)).sort();
|
|
24
|
+
if (requested !== undefined) {
|
|
25
|
+
const name = requested.endsWith('.json') ? requested : `${requested}.json`;
|
|
26
|
+
if (!candidates.includes(name)) {
|
|
27
|
+
fail('INVALID_INPUT', `store ${JSON.stringify(requested)} is not a configured destination for status ${JSON.stringify(status)}; allowed destination stores: ${candidates.join(', ')}`);
|
|
28
|
+
}
|
|
29
|
+
return name;
|
|
30
|
+
}
|
|
31
|
+
if (candidates.length > 1) {
|
|
32
|
+
fail('INVALID_INPUT', `status ${JSON.stringify(status)} has multiple destinations; select --store from: ${candidates.join(', ')}`);
|
|
33
|
+
}
|
|
34
|
+
return candidates[0];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// The caller owns the project lock; custom filenames always require explicit files.
|
|
38
|
+
export function withDestination(project, status, requested, operation) {
|
|
39
|
+
const target = selectStore(project, status, requested);
|
|
40
|
+
const path = join(project.directory, target);
|
|
41
|
+
let created;
|
|
42
|
+
if (Object.hasOwn(standardStores, target)) {
|
|
43
|
+
try { lstatSync(path); } catch (error) {
|
|
44
|
+
if (error.code !== 'ENOENT') fail('READ_ERROR', `${path}: cannot inspect destination (${error.code})`);
|
|
45
|
+
try {
|
|
46
|
+
const descriptor = openSync(path, 'wx', 0o644);
|
|
47
|
+
try {
|
|
48
|
+
writeFileSync(descriptor, '[]\n');
|
|
49
|
+
created = fstatSync(descriptor, { bigint: true });
|
|
50
|
+
} finally { closeSync(descriptor); }
|
|
51
|
+
} catch (writeError) {
|
|
52
|
+
fail('WRITE_ERROR', `${path}: cannot create destination (${writeError.code})`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
try { return operation(); } catch (error) {
|
|
57
|
+
if (created && error.code !== 'WRITE_INCOMPLETE' && !existsSync(join(project.directory, pendingFile))) {
|
|
58
|
+
let unchanged = false;
|
|
59
|
+
try {
|
|
60
|
+
const current = lstatSync(path, { bigint: true });
|
|
61
|
+
unchanged = ['dev', 'ino', 'size', 'mtimeNs', 'ctimeNs', 'mode'].every((key) => current[key] === created[key])
|
|
62
|
+
&& readText(path, { remaining: 3 }) === '[]\n';
|
|
63
|
+
} catch {
|
|
64
|
+
// An inaccessible, removed or changed file belongs to the external writer.
|
|
65
|
+
}
|
|
66
|
+
if (unchanged) unlinkSync(path);
|
|
67
|
+
}
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function mutationProject(project) {
|
|
73
|
+
return project.config ? project : { ...project, stores: standardStores };
|
|
74
|
+
}
|
package/src/errors.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function fail(code, message) {
|
|
2
|
+
const error = new Error(errorText(message));
|
|
3
|
+
error.code = code;
|
|
4
|
+
throw error;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function errorText(message) {
|
|
8
|
+
let bytes = 0;
|
|
9
|
+
let end = 0;
|
|
10
|
+
for (const character of message) {
|
|
11
|
+
bytes += Buffer.byteLength(character, 'utf8');
|
|
12
|
+
if (bytes > 2048) return `${message.slice(0, end)}…`;
|
|
13
|
+
end += character.length;
|
|
14
|
+
}
|
|
15
|
+
return message;
|
|
16
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { fail } from './errors.mjs';
|
|
2
|
+
import { timestampValue } from './timestamps.mjs';
|
|
3
|
+
|
|
4
|
+
const object = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
5
|
+
const text = (value) => typeof value === 'string' && value.trim() !== '';
|
|
6
|
+
const ruleTypes = new Set(['string', 'array', 'number', 'integer', 'boolean', 'object', 'date', 'timestamp']);
|
|
7
|
+
const itemTypes = new Set(['string', 'number', 'integer', 'boolean', 'object', 'date', 'timestamp']);
|
|
8
|
+
|
|
9
|
+
function invalidConfig(path, message) {
|
|
10
|
+
fail('INVALID_CONFIG', `${path}: ${message}`);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function validateRule(rule, path, statuses) {
|
|
14
|
+
if (!object(rule)) invalidConfig(path, 'field rule must be an object');
|
|
15
|
+
const allowed = ['type', 'required', 'required_for_statuses', 'non_empty', 'items', 'non_empty_items', 'min_items'];
|
|
16
|
+
for (const key of Object.keys(rule)) if (!allowed.includes(key)) invalidConfig(path, `unsupported field rule key ${key}`);
|
|
17
|
+
if (rule.type !== undefined && !ruleTypes.has(rule.type)) {
|
|
18
|
+
invalidConfig(path, `type must be one of ${[...ruleTypes].join(', ')}`);
|
|
19
|
+
}
|
|
20
|
+
if (rule.required !== undefined && typeof rule.required !== 'boolean') invalidConfig(path, 'required must be a boolean');
|
|
21
|
+
if (rule.non_empty !== undefined && typeof rule.non_empty !== 'boolean') invalidConfig(path, 'non_empty must be a boolean');
|
|
22
|
+
if (rule.non_empty_items !== undefined && typeof rule.non_empty_items !== 'boolean') {
|
|
23
|
+
invalidConfig(path, 'non_empty_items must be a boolean');
|
|
24
|
+
}
|
|
25
|
+
if (rule.items !== undefined && !itemTypes.has(rule.items)) {
|
|
26
|
+
invalidConfig(path, `items must be one of ${[...itemTypes].join(', ')}`);
|
|
27
|
+
}
|
|
28
|
+
if (rule.min_items !== undefined && (!Number.isSafeInteger(rule.min_items) || rule.min_items < 0)) {
|
|
29
|
+
invalidConfig(path, 'min_items must be a non-negative safe integer');
|
|
30
|
+
}
|
|
31
|
+
if (rule.required_for_statuses !== undefined) {
|
|
32
|
+
if (!Array.isArray(rule.required_for_statuses) || !rule.required_for_statuses.every(text)) {
|
|
33
|
+
invalidConfig(path, 'required_for_statuses must be an array of non-empty strings');
|
|
34
|
+
}
|
|
35
|
+
for (const status of rule.required_for_statuses) {
|
|
36
|
+
if (!statuses.has(status)) invalidConfig(path, `required_for_statuses references undeclared status ${status}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if ((rule.items !== undefined || rule.non_empty_items !== undefined || rule.min_items !== undefined)
|
|
40
|
+
&& rule.type !== undefined && rule.type !== 'array') {
|
|
41
|
+
invalidConfig(path, 'items, non_empty_items and min_items require type array');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function validateFieldRules(rules, path, statuses) {
|
|
46
|
+
if (rules === undefined) return;
|
|
47
|
+
if (!object(rules)) invalidConfig(path, 'fields must be an object');
|
|
48
|
+
for (const [field, rule] of Object.entries(rules)) {
|
|
49
|
+
if (!text(field)) invalidConfig(path, 'field names must be non-empty strings');
|
|
50
|
+
validateRule(rule, `${path}.fields.${field}`, statuses);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function present(task, field, label, invalid) {
|
|
55
|
+
if (!Object.hasOwn(task, field) || task[field] === null || task[field] === undefined) {
|
|
56
|
+
invalid(field, `is required by ${label}`);
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function validDate(value) {
|
|
63
|
+
return typeof value === 'string' && Number.isFinite(Date.parse(value));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function checkType(value, type, label, invalid) {
|
|
67
|
+
if (type === undefined) return;
|
|
68
|
+
if (type === 'string' && typeof value !== 'string') invalid(label, 'must be a string');
|
|
69
|
+
else if (type === 'array' && !Array.isArray(value)) invalid(label, 'must be an array');
|
|
70
|
+
else if (type === 'number' && (typeof value !== 'number' || !Number.isFinite(value))) invalid(label, 'must be a finite number');
|
|
71
|
+
else if (type === 'integer' && !Number.isSafeInteger(value)) invalid(label, 'must be a safe integer');
|
|
72
|
+
else if (type === 'boolean' && typeof value !== 'boolean') invalid(label, 'must be a boolean');
|
|
73
|
+
else if (type === 'object' && !object(value)) invalid(label, 'must be an object');
|
|
74
|
+
else if (type === 'date' && !validDate(value)) invalid(label, 'must be a valid date string');
|
|
75
|
+
else if (type === 'timestamp') timestampValue(value, 'INVALID_STORE', label);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function validateItems(values, type, field, invalid, nonEmpty) {
|
|
79
|
+
if (type === undefined) return;
|
|
80
|
+
values.forEach((value, index) => {
|
|
81
|
+
const label = `${field}[${index}]`;
|
|
82
|
+
checkType(value, type, label, invalid);
|
|
83
|
+
if (nonEmpty && typeof value === 'string' && !text(value)) invalid(label, 'must be a non-empty string');
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function applyFieldRules(task, rules, status, label, invalid) {
|
|
88
|
+
for (const [field, rule] of Object.entries(rules ?? {})) {
|
|
89
|
+
const required = rule.required === true || (rule.required_for_statuses ?? []).includes(status);
|
|
90
|
+
if (required && !present(task, field, label, invalid)) continue;
|
|
91
|
+
if (!Object.hasOwn(task, field) || task[field] === undefined || task[field] === null) continue;
|
|
92
|
+
const value = task[field];
|
|
93
|
+
checkType(value, rule.type, field, invalid);
|
|
94
|
+
if (rule.non_empty === true) {
|
|
95
|
+
if (typeof value === 'string' && !text(value)) invalid(field, 'must be a non-empty string');
|
|
96
|
+
if (Array.isArray(value) && value.length === 0) invalid(field, 'must be a non-empty array');
|
|
97
|
+
}
|
|
98
|
+
if (Array.isArray(value)) {
|
|
99
|
+
if (rule.min_items !== undefined && value.length < rule.min_items) {
|
|
100
|
+
invalid(field, `must contain at least ${rule.min_items} item${rule.min_items === 1 ? '' : 's'}`);
|
|
101
|
+
}
|
|
102
|
+
validateItems(value, rule.items, field, invalid, rule.non_empty_items === true);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
package/src/fields.mjs
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { fail } from './errors.mjs';
|
|
2
|
+
|
|
3
|
+
export const defaultFields = ['id', 'title', 'status'];
|
|
4
|
+
export const ownValue = (task, field) => Object.hasOwn(task, field) ? task[field] : undefined;
|
|
5
|
+
|
|
6
|
+
export function fieldsFor(fields, records) {
|
|
7
|
+
if (!Array.isArray(fields) || fields.length === 0
|
|
8
|
+
|| !fields.every((field) => typeof field === 'string' && field.trim() !== '')) {
|
|
9
|
+
fail('INVALID_INPUT', 'fields must be a non-empty array of field names or ["all"]');
|
|
10
|
+
}
|
|
11
|
+
if (fields.includes('all')) {
|
|
12
|
+
if (fields.length !== 1) fail('INVALID_INPUT', 'all must be the only requested field');
|
|
13
|
+
const names = new Set();
|
|
14
|
+
for (const record of records) for (const name of Object.keys(record)) names.add(name);
|
|
15
|
+
return [...names];
|
|
16
|
+
}
|
|
17
|
+
return [...new Set(fields)];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function checkFields(fields, records) {
|
|
21
|
+
const available = new Set([...defaultFields, 'priority', 'blockers', 'updated_at']);
|
|
22
|
+
for (const record of records) for (const name of Object.keys(record)) available.add(name);
|
|
23
|
+
for (const field of fields) {
|
|
24
|
+
if (records.length && !available.has(field)) {
|
|
25
|
+
fail('INVALID_INPUT', `unknown field ${field}; use --fields all to inspect available task fields`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function projectFields(task, fields) {
|
|
31
|
+
return Object.fromEntries(fields.filter((field) => Object.hasOwn(task, field)).map((field) => [field, task[field]]));
|
|
32
|
+
}
|
package/src/input.mjs
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { isUtf8 } from 'node:buffer';
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import { closeSync, fstatSync, openSync, readSync } from 'node:fs';
|
|
4
|
+
import { fail } from './errors.mjs';
|
|
5
|
+
import { inputBytes, projectBytes } from './limits.mjs';
|
|
6
|
+
|
|
7
|
+
export function readBudget() {
|
|
8
|
+
return { remaining: inputBytes, limit: inputBytes };
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function projectBudget() {
|
|
12
|
+
return { remaining: projectBytes, limit: projectBytes };
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function decodeText(source, label) {
|
|
16
|
+
if (!isUtf8(source)) fail('INVALID_JSON', `${label}: invalid UTF-8; correct the input and retry`);
|
|
17
|
+
return source.toString('utf8');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function tooLarge(path, budget) {
|
|
21
|
+
const limit = budget.limit ?? inputBytes;
|
|
22
|
+
fail('INPUT_TOO_LARGE', `${path}: selected JSON input exceeds the ${limit / 1024 / 1024} MiB read budget; select fewer stores or reduce the file size`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function readBuffer(path, budget, optional = false) {
|
|
26
|
+
let descriptor;
|
|
27
|
+
try {
|
|
28
|
+
descriptor = openSync(path, 'r');
|
|
29
|
+
} catch (error) {
|
|
30
|
+
if (optional && error.code === 'ENOENT') {
|
|
31
|
+
if (budget.fingerprints) budget.fingerprints[path] = null;
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
fail('READ_ERROR', `${path}: cannot read file (${error.code}); check the path and permissions`);
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const stat = fstatSync(descriptor);
|
|
38
|
+
if (!stat.isFile()) fail('READ_ERROR', `${path}: expected a regular file; check the path`);
|
|
39
|
+
if (stat.size > budget.remaining) tooLarge(path, budget);
|
|
40
|
+
const chunks = [];
|
|
41
|
+
let length = 0;
|
|
42
|
+
// Reads stay bounded even if a file grows after the initial size check.
|
|
43
|
+
while (budget.remaining > 0) {
|
|
44
|
+
const chunk = Buffer.allocUnsafe(Math.min(64 * 1024, budget.remaining));
|
|
45
|
+
const count = readSync(descriptor, chunk, 0, chunk.length, null);
|
|
46
|
+
if (count === 0) break;
|
|
47
|
+
budget.remaining -= count;
|
|
48
|
+
length += count;
|
|
49
|
+
chunks.push(chunk.subarray(0, count));
|
|
50
|
+
}
|
|
51
|
+
if (fstatSync(descriptor).size > length) tooLarge(path, budget);
|
|
52
|
+
const source = Buffer.concat(chunks, length);
|
|
53
|
+
if (budget.fingerprints) budget.fingerprints[path] = createHash('sha256').update(source).digest('hex');
|
|
54
|
+
return source;
|
|
55
|
+
} catch (error) {
|
|
56
|
+
if (['INPUT_TOO_LARGE', 'READ_ERROR', 'INVALID_JSON'].includes(error.code)) throw error;
|
|
57
|
+
fail('READ_ERROR', `${path}: cannot read file (${error.code}); check the path and permissions`);
|
|
58
|
+
} finally {
|
|
59
|
+
closeSync(descriptor);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function readText(path, budget, optional = false) {
|
|
64
|
+
const source = readBuffer(path, budget, optional);
|
|
65
|
+
return source === undefined ? undefined : decodeText(source, path);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function readJson(path, budget, optional = false) {
|
|
69
|
+
const source = readText(path, budget, optional);
|
|
70
|
+
if (source === undefined) return undefined;
|
|
71
|
+
return parseJson(source, path);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function parseJson(source, label) {
|
|
75
|
+
try {
|
|
76
|
+
return JSON.parse(source);
|
|
77
|
+
} catch {
|
|
78
|
+
fail('INVALID_JSON', `${label}: invalid JSON; correct the input and retry`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const whitespace = (byte) => byte === 0x20 || byte === 0x09 || byte === 0x0a || byte === 0x0d;
|
|
83
|
+
|
|
84
|
+
export function* arrayRecords(source, label) {
|
|
85
|
+
if (!isUtf8(source)) fail('INVALID_JSON', `${label}: invalid UTF-8; correct the input and retry`);
|
|
86
|
+
let offset = 0;
|
|
87
|
+
while (whitespace(source[offset])) offset++;
|
|
88
|
+
if (source[offset++] !== 0x5b) fail('INVALID_JSON', `${label}: invalid JSON; correct the input and retry`);
|
|
89
|
+
let index = 0;
|
|
90
|
+
while (true) {
|
|
91
|
+
while (whitespace(source[offset])) offset++;
|
|
92
|
+
if (source[offset] === 0x5d) {
|
|
93
|
+
offset++;
|
|
94
|
+
while (whitespace(source[offset])) offset++;
|
|
95
|
+
if (offset !== source.length) fail('INVALID_JSON', `${label}: invalid JSON; correct the input and retry`);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const start = offset;
|
|
99
|
+
let depth = 0;
|
|
100
|
+
let string = false;
|
|
101
|
+
let escaped = false;
|
|
102
|
+
for (; offset < source.length; offset++) {
|
|
103
|
+
const byte = source[offset];
|
|
104
|
+
if (string) {
|
|
105
|
+
if (escaped) escaped = false;
|
|
106
|
+
else if (byte === 0x5c) escaped = true;
|
|
107
|
+
else if (byte === 0x22) string = false;
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
if (byte === 0x22) string = true;
|
|
111
|
+
else if (byte === 0x7b || byte === 0x5b) depth++;
|
|
112
|
+
else if (byte === 0x7d || byte === 0x5d) {
|
|
113
|
+
if (byte === 0x5d && depth === 0) break;
|
|
114
|
+
depth--;
|
|
115
|
+
} else if (byte === 0x2c && depth === 0) break;
|
|
116
|
+
}
|
|
117
|
+
const end = offset;
|
|
118
|
+
let value;
|
|
119
|
+
try { value = JSON.parse(source.toString('utf8', start, end)); } catch {
|
|
120
|
+
fail('INVALID_JSON', `${label}: invalid JSON; correct the input and retry`);
|
|
121
|
+
}
|
|
122
|
+
yield { value, index, start, end };
|
|
123
|
+
index++;
|
|
124
|
+
if (source[offset] === 0x2c) {
|
|
125
|
+
offset++;
|
|
126
|
+
while (whitespace(source[offset])) offset++;
|
|
127
|
+
if (source[offset] === 0x5d) fail('INVALID_JSON', `${label}: invalid JSON; correct the input and retry`);
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (source[offset] !== 0x5d) fail('INVALID_JSON', `${label}: invalid JSON; correct the input and retry`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export function readArray(path, budget) {
|
|
135
|
+
const source = readBuffer(path, budget);
|
|
136
|
+
let offset = 0;
|
|
137
|
+
while (whitespace(source[offset])) offset++;
|
|
138
|
+
if (source[offset] !== 0x5b) {
|
|
139
|
+
let value;
|
|
140
|
+
try { value = JSON.parse(decodeText(source, path)); } catch {
|
|
141
|
+
fail('INVALID_JSON', `${path}: invalid JSON; correct the input and retry`);
|
|
142
|
+
}
|
|
143
|
+
if (!Array.isArray(value)) fail('INVALID_STORE', `${path}: root value must be an array`);
|
|
144
|
+
}
|
|
145
|
+
return { source, records: arrayRecords(source, path) };
|
|
146
|
+
}
|
package/src/limits.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { homedir } from 'node:os';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
|
|
4
|
+
// Explicit XDG locations remain supported; packaged application files always
|
|
5
|
+
// use the platform application root, independently of cache/config overrides.
|
|
6
|
+
export function applicationRoot(env = process.env, platform = process.platform) {
|
|
7
|
+
const home = platform === 'win32' ? env.USERPROFILE || homedir() : env.HOME || homedir();
|
|
8
|
+
if (platform === 'win32') return join(env.LOCALAPPDATA || join(home, 'AppData/Local'), 'Programs/Outask');
|
|
9
|
+
if (platform === 'darwin') return join(home, 'Library/Application Support/Outask');
|
|
10
|
+
return join(home, '.local/share/outask');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function configPath(env = process.env) {
|
|
14
|
+
return env.XDG_CONFIG_HOME ? join(env.XDG_CONFIG_HOME, 'outask/config.json') : join(applicationRoot(env), 'config.json');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function cacheRoot(env = process.env) {
|
|
18
|
+
return env.XDG_CACHE_HOME ? join(env.XDG_CACHE_HOME, 'outask/cache') : join(applicationRoot(env), 'cache');
|
|
19
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { fail } from './errors.mjs';
|
|
2
|
+
import { projectFields } from './fields.mjs';
|
|
3
|
+
import { responseBytes } from './limits.mjs';
|
|
4
|
+
import { jsonBytes } from './response.mjs';
|
|
5
|
+
|
|
6
|
+
export function updatePage(page) {
|
|
7
|
+
page.hasMore = page.offset + page.tasks.length < page.total;
|
|
8
|
+
page.nextOffset = page.hasMore ? page.offset + page.tasks.length : null;
|
|
9
|
+
return page;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function taskPage(records, { offset, limit, stores, fields, total = records.length, recordsOffset = offset }) {
|
|
13
|
+
const page = updatePage({ tasks: [], total, offset, limit, stores, fields });
|
|
14
|
+
if (jsonBytes(page) + 1 > responseBytes) {
|
|
15
|
+
fail('OUTPUT_TOO_LARGE', 'list metadata exceeds 32 KiB; select fewer --fields or stores');
|
|
16
|
+
}
|
|
17
|
+
for (let index = recordsOffset; index < records.length && page.tasks.length < limit; index++) {
|
|
18
|
+
page.tasks.push(projectFields(records[index], fields));
|
|
19
|
+
updatePage(page);
|
|
20
|
+
if (jsonBytes(page) + 1 > responseBytes) {
|
|
21
|
+
page.tasks.pop();
|
|
22
|
+
updatePage(page);
|
|
23
|
+
if (!page.tasks.length) {
|
|
24
|
+
fail('OUTPUT_TOO_LARGE', `task ${records[index].id} cannot fit in a 32 KiB page; select fewer --fields`);
|
|
25
|
+
}
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return page;
|
|
30
|
+
}
|