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/stores.mjs
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { existsSync, lstatSync, readdirSync, statSync } from 'node:fs';
|
|
2
|
+
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
3
|
+
import { knownCounter, prepareService, readService } from './service.mjs';
|
|
4
|
+
import { fail } from './errors.mjs';
|
|
5
|
+
import { validateFieldRules } from './field-rules.mjs';
|
|
6
|
+
import { validateTimestamp } from './timestamps.mjs';
|
|
7
|
+
import { projectBudget, readArray, readJson } from './input.mjs';
|
|
8
|
+
|
|
9
|
+
// Service fingerprints and recovery journals use portable project-relative keys.
|
|
10
|
+
export const projectRelative = (root, path) => relative(root, path).split(sep).join('/');
|
|
11
|
+
|
|
12
|
+
export const serviceFile = '.task-tracker.json';
|
|
13
|
+
export const pendingFile = '.task-tracker.pending';
|
|
14
|
+
|
|
15
|
+
export const standardStores = {
|
|
16
|
+
'active.json': { statuses: ['pending', 'in_progress', 'review'], missing_status: 'pending' },
|
|
17
|
+
'done.json': { statuses: ['done'], missing_status: 'done' },
|
|
18
|
+
'archive.json': { statuses: ['cancelled'] },
|
|
19
|
+
};
|
|
20
|
+
export const defaultSearch = { mode: 'scan' };
|
|
21
|
+
const standardGroups = {
|
|
22
|
+
Active: ['pending', 'in_progress', 'review'], Done: ['done'], Archive: ['cancelled'],
|
|
23
|
+
};
|
|
24
|
+
const fileGroups = { 'active.json': 'Active', 'done.json': 'Done', 'archive.json': 'Archive' };
|
|
25
|
+
const isObject = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
26
|
+
const isText = (value) => typeof value === 'string' && value.trim() !== '';
|
|
27
|
+
const isStrings = (value) => Array.isArray(value) && value.every(isText);
|
|
28
|
+
|
|
29
|
+
function storeName(name) {
|
|
30
|
+
return isText(name) && name.endsWith('.json') && !/[\\/\0]/.test(name)
|
|
31
|
+
&& ![serviceFile, 'task-schema.json'].includes(name);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const defaultSchema = 'tasks/task-schema.json';
|
|
35
|
+
export const legacySchema = 'docs/task-schema.json';
|
|
36
|
+
const selectedSchema = Symbol('selectedSchema');
|
|
37
|
+
|
|
38
|
+
function contained(root, path) {
|
|
39
|
+
const name = relative(root, path);
|
|
40
|
+
return name !== '' && !name.startsWith('..') && !isAbsolute(name);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function inspectSchema(root, path, required) {
|
|
44
|
+
const tail = relative(root, path);
|
|
45
|
+
let current = root;
|
|
46
|
+
for (const part of tail.split(sep)) {
|
|
47
|
+
current = join(current, part);
|
|
48
|
+
let stat;
|
|
49
|
+
try { stat = lstatSync(current); } catch (error) {
|
|
50
|
+
if (error.code === 'ENOENT') {
|
|
51
|
+
if (!required) return false;
|
|
52
|
+
fail('READ_ERROR', `${path}: selected schema does not exist`);
|
|
53
|
+
}
|
|
54
|
+
fail('READ_ERROR', `${current}: cannot inspect schema path (${error.code})`);
|
|
55
|
+
}
|
|
56
|
+
if (stat.isSymbolicLink()) fail('INVALID_CONFIG', `${current}: schema path must not contain symbolic links`);
|
|
57
|
+
const final = current === path;
|
|
58
|
+
if (final ? !stat.isFile() : !stat.isDirectory()) {
|
|
59
|
+
fail('INVALID_CONFIG', `${current}: schema path must use ordinary directories and a regular file`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function selectSchema(root, schemaPath) {
|
|
66
|
+
if (schemaPath?.[selectedSchema] === true && contained(root, schemaPath.path)) {
|
|
67
|
+
inspectSchema(root, schemaPath.path, schemaPath.explicit);
|
|
68
|
+
return schemaPath;
|
|
69
|
+
}
|
|
70
|
+
if (schemaPath !== undefined) {
|
|
71
|
+
if (!isText(schemaPath) || schemaPath.includes('\0')) fail('INVALID_INPUT', 'schemaPath must be a non-empty project file path');
|
|
72
|
+
const path = resolve(root, schemaPath);
|
|
73
|
+
if (!contained(root, path)) fail('INVALID_INPUT', 'schemaPath must stay inside the selected project');
|
|
74
|
+
inspectSchema(root, path, true);
|
|
75
|
+
return { path, explicit: true, [selectedSchema]: true };
|
|
76
|
+
}
|
|
77
|
+
const preferred = join(root, defaultSchema);
|
|
78
|
+
const legacy = join(root, legacySchema);
|
|
79
|
+
const hasPreferred = inspectSchema(root, preferred, false);
|
|
80
|
+
const hasLegacy = inspectSchema(root, legacy, false);
|
|
81
|
+
if (hasPreferred && hasLegacy) {
|
|
82
|
+
fail('INVALID_CONFIG', `${defaultSchema} and ${legacySchema} both exist; select one explicitly with schemaPath or --schema-path`);
|
|
83
|
+
}
|
|
84
|
+
return { path: hasLegacy ? legacy : preferred, explicit: false, [selectedSchema]: true };
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function readConfig(path, budget, explicit, directory) {
|
|
88
|
+
const config = readJson(path, budget, !explicit);
|
|
89
|
+
if (config === undefined) return undefined;
|
|
90
|
+
const invalid = (message) => fail('INVALID_CONFIG', `${path}: ${message}`);
|
|
91
|
+
if (!isObject(config) || !isObject(config.stores) || Object.keys(config.stores).length === 0) {
|
|
92
|
+
invalid('stores must be a non-empty object');
|
|
93
|
+
}
|
|
94
|
+
for (const [name, store] of Object.entries(config.stores)) {
|
|
95
|
+
if (!storeName(name) || (dirname(path) === directory && name === basename(path))) {
|
|
96
|
+
invalid(`invalid or reserved store name ${name}`);
|
|
97
|
+
}
|
|
98
|
+
if (!isObject(store) || !isStrings(store.statuses) || store.statuses.length === 0) {
|
|
99
|
+
invalid(`store ${name} must define a non-empty statuses array`);
|
|
100
|
+
}
|
|
101
|
+
if (store.validate !== undefined && typeof store.validate !== 'boolean') {
|
|
102
|
+
invalid(`store ${name} validate must be a boolean`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
for (const [name, store] of Object.entries(config.stores)) {
|
|
106
|
+
if (Object.hasOwn(store, 'missing_status') && (!isText(store.missing_status)
|
|
107
|
+
|| !store.statuses.includes(store.missing_status)
|
|
108
|
+
|| ['in_progress', 'review', ...(Array.isArray(config.working_statuses) ? config.working_statuses : [])].includes(store.missing_status))) {
|
|
109
|
+
invalid(`store ${name} missing_status must name a status in stores["${name}"].statuses that is not a working status; set a compatible missing_status manually`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const statuses = new Set(Object.values(config.stores).flatMap((store) => store.statuses));
|
|
113
|
+
validateFieldRules(config.fields, path, statuses);
|
|
114
|
+
for (const [name, store] of Object.entries(config.stores)) {
|
|
115
|
+
validateFieldRules(store.fields, `${path}: store ${name}`, statuses);
|
|
116
|
+
}
|
|
117
|
+
if (config.format !== undefined && !['standard', 'minimal'].includes(config.format)) {
|
|
118
|
+
invalid('format must be standard or minimal');
|
|
119
|
+
}
|
|
120
|
+
if (config.default_status !== undefined && (!isText(config.default_status) || !statuses.has(config.default_status))) {
|
|
121
|
+
invalid('default_status must be a declared status');
|
|
122
|
+
}
|
|
123
|
+
if (config.working_statuses !== undefined && (!isStrings(config.working_statuses)
|
|
124
|
+
|| !config.working_statuses.every((status) => statuses.has(status)))) {
|
|
125
|
+
invalid('working_statuses must be an array of declared statuses');
|
|
126
|
+
}
|
|
127
|
+
if (config.plan !== undefined && (!isObject(config.plan)
|
|
128
|
+
|| (config.plan.required_for_statuses !== undefined && !isStrings(config.plan.required_for_statuses)))) {
|
|
129
|
+
invalid('plan.required_for_statuses must be an array of non-empty strings');
|
|
130
|
+
}
|
|
131
|
+
if (config.search !== undefined) {
|
|
132
|
+
if (!isObject(config.search)) invalid('search must be an object');
|
|
133
|
+
const unknown = Object.keys(config.search).find((key) => key !== 'mode');
|
|
134
|
+
if (unknown) invalid(`unknown search setting ${unknown}`);
|
|
135
|
+
if (config.search.mode !== undefined && !['scan', 'indexed', 'auto'].includes(config.search.mode)) {
|
|
136
|
+
invalid('search.mode must be scan, indexed or auto');
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (config.groups !== undefined) {
|
|
140
|
+
if (!isObject(config.groups)) invalid('groups must map Active, Done or Archive to status arrays');
|
|
141
|
+
const seen = new Set();
|
|
142
|
+
const statuses = new Set(Object.values(config.stores).flatMap((store) => store.statuses));
|
|
143
|
+
for (const [group, members] of Object.entries(config.groups)) {
|
|
144
|
+
if (!Object.hasOwn(standardGroups, group) || !isStrings(members)) {
|
|
145
|
+
invalid(`invalid group ${group}; use Active, Done or Archive with status arrays`);
|
|
146
|
+
}
|
|
147
|
+
for (const status of members) {
|
|
148
|
+
if (seen.has(status)) invalid(`status ${status} belongs to more than one group`);
|
|
149
|
+
if (!statuses.has(status)) invalid(`group status ${status} is not declared in stores`);
|
|
150
|
+
seen.add(status);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
for (const status of statuses) {
|
|
154
|
+
if (!seen.has(status)) invalid(`status ${status} needs an activity group`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return config;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function checkPending(directory) {
|
|
161
|
+
if (existsSync(join(directory, pendingFile))) {
|
|
162
|
+
fail('RECOVERY_REQUIRED', 'a lifecycle move is pending; run validation to recover before reading tasks');
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function openProject(projectPath, budget = projectBudget(), allowPending = false, prepare = true, schemaPath) {
|
|
167
|
+
if (!isText(projectPath)) fail('INVALID_INPUT', 'select one project with an explicit directory path');
|
|
168
|
+
const root = resolve(projectPath);
|
|
169
|
+
try {
|
|
170
|
+
if (!statSync(root).isDirectory()) fail('PROJECT_NOT_FOUND', `${root}: project path must be a directory`);
|
|
171
|
+
} catch (error) {
|
|
172
|
+
if (error.code === 'PROJECT_NOT_FOUND') throw error;
|
|
173
|
+
fail(error.code === 'ENOENT' ? 'PROJECT_NOT_FOUND' : 'READ_ERROR', `${root}: cannot open project (${error.code})`);
|
|
174
|
+
}
|
|
175
|
+
const directory = join(root, 'tasks');
|
|
176
|
+
const schema = selectSchema(root, schemaPath);
|
|
177
|
+
const config = readConfig(schema.path, budget, schema.explicit, directory);
|
|
178
|
+
if (prepare) prepareService({ root, directory, schema, schemaPath: schema.path });
|
|
179
|
+
if (!allowPending) checkPending(directory);
|
|
180
|
+
let available;
|
|
181
|
+
try {
|
|
182
|
+
const schemaName = dirname(schema.path) === directory ? basename(schema.path) : undefined;
|
|
183
|
+
available = readdirSync(directory).filter((name) => name.endsWith('.json')
|
|
184
|
+
&& ![serviceFile, 'task-schema.json', schemaName].includes(name)).sort();
|
|
185
|
+
} catch (error) {
|
|
186
|
+
fail('READ_ERROR', `${directory}: cannot list task stores (${error.code}); check the directory and permissions`);
|
|
187
|
+
}
|
|
188
|
+
// Done and Archive are optional in existing projects that only have Active.
|
|
189
|
+
const stores = config?.stores ?? Object.fromEntries(Object.entries(standardStores)
|
|
190
|
+
.filter(([name]) => name === 'active.json' || available.includes(name)));
|
|
191
|
+
const groups = new Map();
|
|
192
|
+
if (config?.groups !== undefined) {
|
|
193
|
+
for (const [group, statuses] of Object.entries(config.groups)) {
|
|
194
|
+
for (const status of statuses) groups.set(status, group);
|
|
195
|
+
}
|
|
196
|
+
} else {
|
|
197
|
+
for (const [group, statuses] of Object.entries(standardGroups)) {
|
|
198
|
+
for (const status of statuses) groups.set(status, group);
|
|
199
|
+
}
|
|
200
|
+
const inferred = new Map();
|
|
201
|
+
for (const [name, store] of Object.entries(stores)) {
|
|
202
|
+
const group = fileGroups[name];
|
|
203
|
+
if (!group) continue;
|
|
204
|
+
for (const status of store.statuses) {
|
|
205
|
+
if (inferred.has(status) && inferred.get(status) !== group) {
|
|
206
|
+
fail('INVALID_CONFIG', `${schema.path}: ambiguous group for ${status}; configure groups explicitly`);
|
|
207
|
+
}
|
|
208
|
+
inferred.set(status, group);
|
|
209
|
+
groups.set(status, group);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
for (const status of config?.working_statuses ?? []) {
|
|
214
|
+
if (groups.get(status) !== 'Active') {
|
|
215
|
+
fail('INVALID_CONFIG', `${schema.path}: working status ${status} must map to Active`);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return { root, directory, available, stores, groups, budget, config, schema, schemaPath: schema.path };
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export function checkSelection({ stores = [], group } = {}) {
|
|
222
|
+
if (!Array.isArray(stores) || !stores.every(isText)) fail('INVALID_INPUT', 'stores must be an array of store names');
|
|
223
|
+
if (group !== undefined && !Object.hasOwn(standardGroups, group)) {
|
|
224
|
+
fail('INVALID_INPUT', 'group must be Active, Done or Archive');
|
|
225
|
+
}
|
|
226
|
+
if (stores.length && group !== undefined) fail('INVALID_INPUT', 'select stores or an activity group, not both');
|
|
227
|
+
if (stores.includes('all') && stores.length !== 1) fail('INVALID_INPUT', 'all must be the only requested store');
|
|
228
|
+
for (const entry of stores) {
|
|
229
|
+
if (entry !== 'all' && !storeName(entry.endsWith('.json') ? entry : `${entry}.json`)) {
|
|
230
|
+
fail('INVALID_INPUT', `invalid or reserved store ${entry}`);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function isUninitialised(project) {
|
|
236
|
+
if (project.config !== undefined) return false;
|
|
237
|
+
const service = readService(project);
|
|
238
|
+
if (knownCounter(service) !== 0) return false;
|
|
239
|
+
if (service.validated === undefined) return true;
|
|
240
|
+
const { validated } = service;
|
|
241
|
+
if (!isObject(validated) || validated.counter !== 0 || !isObject(validated.files)) return false;
|
|
242
|
+
const schema = projectRelative(project.root, project.schemaPath);
|
|
243
|
+
return Object.entries(validated.files).every(([path, hash]) => path === schema && hash === null);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export function selectStoreFiles(project, { stores = [], group } = {}) {
|
|
247
|
+
checkPending(project.directory);
|
|
248
|
+
checkSelection({ stores, group });
|
|
249
|
+
const uninitialised = !project.available.length && isUninitialised(project);
|
|
250
|
+
if (!project.available.length && !uninitialised) {
|
|
251
|
+
fail('READ_ERROR', `${project.directory}: no task stores exist; create a task first`);
|
|
252
|
+
}
|
|
253
|
+
const selectedGroup = stores.length ? undefined : (group ?? 'Active');
|
|
254
|
+
const known = [...new Set([...Object.keys(project.stores), ...project.available])].sort();
|
|
255
|
+
let files;
|
|
256
|
+
if (selectedGroup !== undefined) {
|
|
257
|
+
files = Object.keys(project.stores).filter((name) => project.stores[name].statuses
|
|
258
|
+
.some((status) => project.groups.get(status) === selectedGroup)).sort();
|
|
259
|
+
if (selectedGroup === 'Active' && files.length === 0) {
|
|
260
|
+
fail('INVALID_CONFIG', `no stores map to Active; configure groups in ${relative(project.root, project.schemaPath)} or select --store explicitly`);
|
|
261
|
+
}
|
|
262
|
+
} else if (stores.includes('all')) {
|
|
263
|
+
files = known;
|
|
264
|
+
} else {
|
|
265
|
+
files = [...new Set(stores.map((entry) => {
|
|
266
|
+
const name = entry.endsWith('.json') ? entry : `${entry}.json`;
|
|
267
|
+
if (!known.includes(name)) {
|
|
268
|
+
fail('INVALID_INPUT', `unknown or reserved store ${entry}; available: ${known.join(', ')}`);
|
|
269
|
+
}
|
|
270
|
+
return name;
|
|
271
|
+
}))].sort();
|
|
272
|
+
}
|
|
273
|
+
return { files: uninitialised ? [] : files, selectedGroup };
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// Keep persisted records separate: inference is read-only until an actual mutation.
|
|
277
|
+
export function effectiveRecord(task, project, file, label) {
|
|
278
|
+
if (!isObject(task) || Object.hasOwn(task, 'status')) return task;
|
|
279
|
+
const status = project.stores[file]?.missing_status;
|
|
280
|
+
if (status === undefined) {
|
|
281
|
+
const correction = project.config === undefined
|
|
282
|
+
? 'set an explicit status on this record or configure its store with a non-working missing_status'
|
|
283
|
+
: `set stores["${file}"].missing_status in ${project.schemaPath} to a declared non-working status allowed by this store`;
|
|
284
|
+
fail('INVALID_STORE', `${label}: missing status; ${correction}; no fallback is configured for ${file}`);
|
|
285
|
+
}
|
|
286
|
+
return { ...task, status };
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export function recordEntries(project, options = {}) {
|
|
290
|
+
const { files, selectedGroup } = selectStoreFiles(project, options);
|
|
291
|
+
const entries = (function* iterate() {
|
|
292
|
+
const seen = new Map();
|
|
293
|
+
for (const file of files) {
|
|
294
|
+
const path = join(project.directory, file);
|
|
295
|
+
const { records: tasks } = readArray(path, project.budget);
|
|
296
|
+
for (const { value, index } of tasks) {
|
|
297
|
+
const label = `${path}[${index}]`;
|
|
298
|
+
let task = value;
|
|
299
|
+
if (!isObject(task)) {
|
|
300
|
+
fail('INVALID_STORE', `${label}: task must be an object; correct this record to include id, title and status`);
|
|
301
|
+
}
|
|
302
|
+
if (Number.isSafeInteger(task.id) && task.id > 0 && isText(task.title)) task = effectiveRecord(task, project, file, label);
|
|
303
|
+
const invalidField = !Number.isSafeInteger(task.id) || task.id <= 0 ? 'id'
|
|
304
|
+
: !isText(task.title) ? 'title' : !isText(task.status) ? 'status' : undefined;
|
|
305
|
+
if (invalidField) {
|
|
306
|
+
const expected = invalidField === 'id' ? 'a positive safe integer unique across retained tasks'
|
|
307
|
+
: invalidField === 'status' ? "a non-empty string matching the project's workflow" : 'a non-empty string';
|
|
308
|
+
const problem = Object.hasOwn(task, invalidField) ? 'incompatible' : 'missing';
|
|
309
|
+
fail('INVALID_STORE', `${label}: ${problem} ${invalidField}; set ${invalidField} to ${expected}. Schema rules cannot waive this read minimum`);
|
|
310
|
+
}
|
|
311
|
+
validateTimestamp(task, label);
|
|
312
|
+
const rules = project.stores[file];
|
|
313
|
+
if (rules && rules.validate !== false && !rules.statuses.includes(task.status)) {
|
|
314
|
+
fail('INVALID_STORE', `${label}: status ${task.status} is not allowed in ${file}; expected ${rules.statuses.join(', ')}`);
|
|
315
|
+
}
|
|
316
|
+
if (seen.has(task.id)) fail('INVALID_STORE', `${label}: duplicate id ${task.id}; first seen at ${seen.get(task.id)}`);
|
|
317
|
+
seen.set(task.id, label);
|
|
318
|
+
if (selectedGroup === undefined || project.groups.get(task.status) === selectedGroup) {
|
|
319
|
+
yield { record: task, store: file };
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
checkPending(project.directory);
|
|
324
|
+
}());
|
|
325
|
+
return { entries, stores: files };
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export function readRecords(project, options = {}) {
|
|
329
|
+
const source = recordEntries(project, options);
|
|
330
|
+
const entries = [...source.entries];
|
|
331
|
+
return { records: entries.map((entry) => entry.record), entries, stores: source.stores };
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export function retainedFiles(project) {
|
|
335
|
+
return [...new Set([...project.available, ...Object.keys(project.stores)])]
|
|
336
|
+
.filter((name) => project.available.includes(name) || !Object.hasOwn(standardStores, name)).sort();
|
|
337
|
+
}
|
package/src/tasks.mjs
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import { fail } from './errors.mjs';
|
|
2
|
+
import { advise, cacheFallback, cacheSupported, cacheUnavailable, checkCacheOptions, onceAdvisory } from './cache.mjs';
|
|
3
|
+
import { cursorBinding, decodeCursor, encodeCursor } from './cursor.mjs';
|
|
4
|
+
import { checkFields, defaultFields, fieldsFor, ownValue, projectFields } from './fields.mjs';
|
|
5
|
+
import { projectBudget } from './input.mjs';
|
|
6
|
+
import { defaultLimit, maxLimit, responseBytes } from './limits.mjs';
|
|
7
|
+
import { taskPage } from './pagination.mjs';
|
|
8
|
+
import { jsonBytes } from './response.mjs';
|
|
9
|
+
import {
|
|
10
|
+
indexedList, indexedTask, indexedTasks, scheduleSearchRefresh, searchSourceState,
|
|
11
|
+
} from './search-index.mjs';
|
|
12
|
+
import { checkSelection, defaultSearch, openProject, recordEntries } from './stores.mjs';
|
|
13
|
+
|
|
14
|
+
const priorityRank = new Map([['high', 0], ['medium', 1], ['low', 2]]);
|
|
15
|
+
const isText = (value) => typeof value === 'string' && value.trim() !== '';
|
|
16
|
+
|
|
17
|
+
function checkOptions(options) {
|
|
18
|
+
if (options === null || typeof options !== 'object' || Array.isArray(options)) {
|
|
19
|
+
fail('INVALID_INPUT', 'options must be an object');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function matches(actual, expected) {
|
|
24
|
+
if (actual === undefined || actual === null) return false;
|
|
25
|
+
if (Array.isArray(actual)) return actual.some((value) => matches(value, expected));
|
|
26
|
+
if (typeof actual === 'number' || typeof actual === 'boolean') return String(actual) === expected;
|
|
27
|
+
const text = typeof actual === 'object' ? JSON.stringify(actual) : String(actual);
|
|
28
|
+
return text.toLowerCase().includes(expected.toLowerCase());
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function compareValues(left, right) {
|
|
32
|
+
if (left === right) return 0;
|
|
33
|
+
if (left === undefined || left === null) return right === undefined || right === null ? 0 : 1;
|
|
34
|
+
if (right === undefined || right === null) return -1;
|
|
35
|
+
if (typeof left === 'number' && typeof right === 'number') return left - right;
|
|
36
|
+
const a = typeof left === 'object' ? JSON.stringify(left) : String(left);
|
|
37
|
+
const b = typeof right === 'object' ? JSON.stringify(right) : String(right);
|
|
38
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function compareTasks(left, right, sort, descending) {
|
|
42
|
+
const a = sort === 'priority' ? (priorityRank.get(left.priority) ?? 1) : ownValue(left, sort);
|
|
43
|
+
const b = sort === 'priority' ? (priorityRank.get(right.priority) ?? 1) : ownValue(right, sort);
|
|
44
|
+
return compareValues(a, b) * (descending ? -1 : 1) || left.id - right.id;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function keepBest(heap, record, capacity, compare) {
|
|
48
|
+
if (capacity === 0) return;
|
|
49
|
+
if (heap.length < capacity) {
|
|
50
|
+
heap.push(record);
|
|
51
|
+
let index = heap.length - 1;
|
|
52
|
+
while (index > 0) {
|
|
53
|
+
const parent = Math.floor((index - 1) / 2);
|
|
54
|
+
if (compare(heap[parent], heap[index]) >= 0) break;
|
|
55
|
+
[heap[parent], heap[index]] = [heap[index], heap[parent]];
|
|
56
|
+
index = parent;
|
|
57
|
+
}
|
|
58
|
+
} else if (compare(record, heap[0]) < 0) {
|
|
59
|
+
heap[0] = record;
|
|
60
|
+
let index = 0;
|
|
61
|
+
while (index * 2 + 1 < heap.length) {
|
|
62
|
+
let child = index * 2 + 1;
|
|
63
|
+
if (child + 1 < heap.length && compare(heap[child], heap[child + 1]) < 0) child++;
|
|
64
|
+
if (compare(heap[index], heap[child]) >= 0) break;
|
|
65
|
+
[heap[index], heap[child]] = [heap[child], heap[index]];
|
|
66
|
+
index = child;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function selectTasks(projectPath, options, countOnly = false) {
|
|
72
|
+
checkOptions(options);
|
|
73
|
+
const { stores = [], group, fields = defaultFields, filters = [], ids = [], sort = 'id',
|
|
74
|
+
descending = false, limit = defaultLimit, offset = 0, schemaPath, refreshMode = 'local',
|
|
75
|
+
noCache = false, onAdvisory } = options;
|
|
76
|
+
checkCacheOptions(noCache, onAdvisory);
|
|
77
|
+
const notify = onceAdvisory(onAdvisory);
|
|
78
|
+
if (!Number.isSafeInteger(limit) || limit < 1 || limit > maxLimit) fail('INVALID_INPUT', `limit must be an integer from 1 to ${maxLimit}`);
|
|
79
|
+
if (!Number.isSafeInteger(offset) || offset < 0) fail('INVALID_INPUT', 'offset must be a non-negative safe integer');
|
|
80
|
+
if (!isText(sort) || typeof descending !== 'boolean') fail('INVALID_INPUT', 'sort must be a field name and descending must be a boolean');
|
|
81
|
+
if (!Array.isArray(ids) || !ids.every((id) => Number.isSafeInteger(id) && id > 0)) {
|
|
82
|
+
fail('INVALID_INPUT', 'ids must be an array of positive safe integers');
|
|
83
|
+
}
|
|
84
|
+
if (!Array.isArray(filters) || !filters.every((filter) => filter && isText(filter.field) && typeof filter.value === 'string')) {
|
|
85
|
+
fail('INVALID_INPUT', 'filters must contain field names and string values');
|
|
86
|
+
}
|
|
87
|
+
fieldsFor(fields, []);
|
|
88
|
+
checkSelection({ stores, group });
|
|
89
|
+
const budget = projectBudget();
|
|
90
|
+
budget.fingerprints = {};
|
|
91
|
+
const project = openProject(projectPath, budget, false, true, schemaPath);
|
|
92
|
+
const useCache = !noCache && cacheSupported(notify);
|
|
93
|
+
const state = useCache ? searchSourceState(project) : undefined;
|
|
94
|
+
const replica = useCache ? indexedList(project, state, { stores, group }, { filters, ids, sort }) : undefined;
|
|
95
|
+
if (replica && !replica.mixedSort) {
|
|
96
|
+
try {
|
|
97
|
+
const fieldRecord = Object.fromEntries(replica.available.map((field) => [field, null]));
|
|
98
|
+
const projection = fieldsFor(fields, replica.sourceTotal ? [fieldRecord] : []);
|
|
99
|
+
checkFields([...projection, sort, ...filters.map((filter) => filter.field)], replica.sourceTotal ? [fieldRecord] : []);
|
|
100
|
+
return {
|
|
101
|
+
records: countOnly ? [] : replica.records(offset, limit, descending), stores: replica.stores,
|
|
102
|
+
fields: projection, sort, descending, limit, offset, total: replica.count,
|
|
103
|
+
recordsOffset: 0, preSorted: true,
|
|
104
|
+
};
|
|
105
|
+
} finally {
|
|
106
|
+
replica.close();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (useCache && !replica?.mixedSort) {
|
|
110
|
+
try { scheduleSearchRefresh(project.root, { schemaPath, detached: refreshMode === 'detached' }); }
|
|
111
|
+
catch { advise(notify, cacheUnavailable); }
|
|
112
|
+
}
|
|
113
|
+
const source = recordEntries(project, { stores, group });
|
|
114
|
+
const available = {};
|
|
115
|
+
const selected = [];
|
|
116
|
+
const wanted = new Set(ids);
|
|
117
|
+
const compare = (left, right) => compareTasks(left, right, sort, descending);
|
|
118
|
+
const deepPage = !countOnly && offset + limit > 10_000;
|
|
119
|
+
const capacity = countOnly || deepPage ? 0 : offset + limit;
|
|
120
|
+
const scanBudget = project.budget.remaining;
|
|
121
|
+
let total = 0;
|
|
122
|
+
let sourceTotal = 0;
|
|
123
|
+
const selectedTask = (record) => (!ids.length || wanted.has(record.id)) && filters.every(({ field, value }) => {
|
|
124
|
+
const actual = ownValue(record, field);
|
|
125
|
+
return field === 'status' ? actual === value : matches(actual, value);
|
|
126
|
+
});
|
|
127
|
+
for (const { record } of source.entries) {
|
|
128
|
+
sourceTotal++;
|
|
129
|
+
for (const field of Object.keys(record)) available[field] = null;
|
|
130
|
+
if (selectedTask(record)) {
|
|
131
|
+
total++;
|
|
132
|
+
keepBest(selected, record, capacity, compare);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const fieldRecords = sourceTotal ? [available] : [];
|
|
136
|
+
const projection = fieldsFor(fields, fieldRecords);
|
|
137
|
+
checkFields([...projection, sort, ...filters.map((filter) => filter.field)], fieldRecords);
|
|
138
|
+
if (deepPage && offset < total) {
|
|
139
|
+
const sourceHashes = { ...project.budget.fingerprints };
|
|
140
|
+
const fromEnd = total - offset < offset + limit;
|
|
141
|
+
const pageSize = fromEnd ? total - offset : offset + limit;
|
|
142
|
+
const rank = fromEnd ? (left, right) => -compare(left, right) : compare;
|
|
143
|
+
project.budget = { remaining: scanBudget, limit: budget.limit, fingerprints: {} };
|
|
144
|
+
const again = recordEntries(project, { stores, group });
|
|
145
|
+
for (const { record } of again.entries) {
|
|
146
|
+
if (selectedTask(record)) keepBest(selected, record, pageSize, rank);
|
|
147
|
+
}
|
|
148
|
+
if (Object.entries(project.budget.fingerprints).some(([path, hash]) => sourceHashes[path] !== hash)) {
|
|
149
|
+
fail('PROJECT_CHANGED', 'task files changed during listing; retry after edits finish');
|
|
150
|
+
}
|
|
151
|
+
selected.sort(compare);
|
|
152
|
+
return { records: fromEnd ? selected.slice(0, limit) : selected.slice(offset),
|
|
153
|
+
stores: source.stores, fields: projection, sort, descending, limit, offset, total,
|
|
154
|
+
recordsOffset: 0, preSorted: true };
|
|
155
|
+
}
|
|
156
|
+
if (!countOnly) selected.sort(compare);
|
|
157
|
+
return { records: selected.slice(offset), stores: source.stores, fields: projection,
|
|
158
|
+
sort, descending, limit, offset, total, recordsOffset: 0, preSorted: true };
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function countTasks(projectPath, options = {}) {
|
|
162
|
+
const query = selectTasks(projectPath, options, true);
|
|
163
|
+
return query.total ?? query.records.length;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function listTasks(projectPath, options = {}) {
|
|
167
|
+
const query = selectTasks(projectPath, options);
|
|
168
|
+
const { sort, descending } = query;
|
|
169
|
+
if (!query.preSorted) query.records.sort((left, right) => compareTasks(left, right, sort, descending));
|
|
170
|
+
return taskPage(query.records, query);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export function getTask(projectPath, id, options = {}) {
|
|
174
|
+
checkOptions(options);
|
|
175
|
+
const { stores = [], group, fields = ['all'], schemaPath, refreshMode = 'local',
|
|
176
|
+
noCache = false, onAdvisory } = options;
|
|
177
|
+
checkCacheOptions(noCache, onAdvisory);
|
|
178
|
+
const notify = onceAdvisory(onAdvisory);
|
|
179
|
+
if (!Number.isSafeInteger(id) || id <= 0) fail('INVALID_INPUT', 'id must be a positive safe integer');
|
|
180
|
+
fieldsFor(fields, []);
|
|
181
|
+
checkSelection({ stores, group });
|
|
182
|
+
const budget = projectBudget();
|
|
183
|
+
budget.fingerprints = {};
|
|
184
|
+
const project = openProject(projectPath, budget, false, true, schemaPath);
|
|
185
|
+
const useCache = !noCache && cacheSupported(notify);
|
|
186
|
+
const state = useCache ? searchSourceState(project) : undefined;
|
|
187
|
+
const replica = useCache ? indexedTask(project, state, { stores, group }, id) : undefined;
|
|
188
|
+
let task;
|
|
189
|
+
let files;
|
|
190
|
+
if (replica) {
|
|
191
|
+
task = replica.task;
|
|
192
|
+
files = replica.stores;
|
|
193
|
+
} else {
|
|
194
|
+
if (useCache) {
|
|
195
|
+
try { scheduleSearchRefresh(project.root, { schemaPath, detached: refreshMode === 'detached' }); }
|
|
196
|
+
catch { advise(notify, cacheUnavailable); }
|
|
197
|
+
}
|
|
198
|
+
const source = recordEntries(project, { stores, group });
|
|
199
|
+
for (const entry of source.entries) {
|
|
200
|
+
if (entry.record.id === id) task = entry.record;
|
|
201
|
+
}
|
|
202
|
+
files = source.stores;
|
|
203
|
+
}
|
|
204
|
+
if (!task) fail('TASK_NOT_FOUND', `task ${id} was not found in ${files.join(', ') || 'the selected group'}; select --store all to include history`);
|
|
205
|
+
const projection = fieldsFor(fields, [task]);
|
|
206
|
+
checkFields(projection, [task]);
|
|
207
|
+
const projected = projectFields(task, projection);
|
|
208
|
+
if (jsonBytes(projected) + 1 > responseBytes) {
|
|
209
|
+
fail('OUTPUT_TOO_LARGE', `task ${id} exceeds the 32 KiB response budget; select fewer --fields`);
|
|
210
|
+
}
|
|
211
|
+
return projected;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export function getTasks(projectPath, ids, options = {}) {
|
|
215
|
+
checkOptions(options);
|
|
216
|
+
if (!Array.isArray(ids) || ids.length === 0
|
|
217
|
+
|| !ids.every((id) => Number.isSafeInteger(id) && id > 0)) {
|
|
218
|
+
fail('INVALID_INPUT', 'ids must be a non-empty array of positive safe integers');
|
|
219
|
+
}
|
|
220
|
+
if (new Set(ids).size !== ids.length) fail('INVALID_INPUT', 'ids must not contain duplicates');
|
|
221
|
+
const { stores = [], group, fields = defaultFields, limit = defaultLimit, cursor,
|
|
222
|
+
schemaPath, refreshMode = 'local', noCache = false, onAdvisory } = options;
|
|
223
|
+
checkCacheOptions(noCache, onAdvisory);
|
|
224
|
+
const notify = onceAdvisory(onAdvisory);
|
|
225
|
+
if (!Number.isSafeInteger(limit) || limit < 1 || limit > maxLimit) {
|
|
226
|
+
fail('INVALID_INPUT', `limit must be an integer from 1 to ${maxLimit}`);
|
|
227
|
+
}
|
|
228
|
+
fieldsFor(fields, []);
|
|
229
|
+
checkSelection({ stores, group });
|
|
230
|
+
const budget = projectBudget();
|
|
231
|
+
budget.fingerprints = {};
|
|
232
|
+
const project = openProject(projectPath, budget, false, true, schemaPath);
|
|
233
|
+
const settings = { ...defaultSearch, ...project.config?.search };
|
|
234
|
+
let source;
|
|
235
|
+
const useCache = !noCache && settings.mode !== 'scan' && cacheSupported(notify);
|
|
236
|
+
if (useCache) {
|
|
237
|
+
const state = searchSourceState(project);
|
|
238
|
+
source = indexedTasks(project, state, { stores, group }, ids);
|
|
239
|
+
}
|
|
240
|
+
if (!source) {
|
|
241
|
+
const scan = recordEntries(project, { stores, group });
|
|
242
|
+
const wanted = new Set(ids);
|
|
243
|
+
const records = new Map();
|
|
244
|
+
for (const entry of scan.entries) {
|
|
245
|
+
if (wanted.has(entry.record.id)) records.set(entry.record.id, entry.record);
|
|
246
|
+
}
|
|
247
|
+
source = { records: ids.flatMap((id) => records.has(id) ? [records.get(id)] : []), stores: scan.stores };
|
|
248
|
+
if (useCache) {
|
|
249
|
+
try {
|
|
250
|
+
scheduleSearchRefresh(project.root, { schemaPath, detached: refreshMode === 'detached' });
|
|
251
|
+
if (settings.mode === 'indexed') advise(notify, cacheFallback);
|
|
252
|
+
}
|
|
253
|
+
catch { advise(notify, cacheUnavailable); }
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
const projection = fieldsFor(fields, source.records);
|
|
257
|
+
checkFields(projection, source.records);
|
|
258
|
+
const binding = cursorBinding({
|
|
259
|
+
ids, fields: projection, group: group ?? (stores.length ? null : 'Active'),
|
|
260
|
+
stores: [...new Set(stores)].sort(),
|
|
261
|
+
});
|
|
262
|
+
const offset = decodeCursor(cursor, binding, 'batch request');
|
|
263
|
+
if (offset > ids.length) fail('INVALID_CURSOR', 'cursor is past the requested IDs; start a new batch request');
|
|
264
|
+
const found = new Map(source.records.map((record) => [record.id, record]));
|
|
265
|
+
const page = {
|
|
266
|
+
tasks: [], not_found: [], hasMore: false, next_cursor: null,
|
|
267
|
+
stores: source.stores, fields: projection,
|
|
268
|
+
};
|
|
269
|
+
if (jsonBytes(page) + 1 > responseBytes) {
|
|
270
|
+
fail('OUTPUT_TOO_LARGE', 'batch metadata exceeds 32 KiB; select fewer --fields or stores');
|
|
271
|
+
}
|
|
272
|
+
for (let index = offset; index < ids.length && index < offset + limit; index++) {
|
|
273
|
+
const task = found.get(ids[index]);
|
|
274
|
+
if (task) page.tasks.push(projectFields(task, projection));
|
|
275
|
+
else page.not_found.push(ids[index]);
|
|
276
|
+
page.hasMore = index + 1 < ids.length;
|
|
277
|
+
page.next_cursor = page.hasMore ? encodeCursor(index + 1, binding) : null;
|
|
278
|
+
if (jsonBytes(page) + 1 > responseBytes) {
|
|
279
|
+
if (task) page.tasks.pop();
|
|
280
|
+
else page.not_found.pop();
|
|
281
|
+
page.hasMore = true;
|
|
282
|
+
page.next_cursor = encodeCursor(index, binding);
|
|
283
|
+
if (!page.tasks.length && !page.not_found.length) {
|
|
284
|
+
fail('OUTPUT_TOO_LARGE', `task ${ids[index]} cannot fit in a 32 KiB batch page; select fewer --fields`);
|
|
285
|
+
}
|
|
286
|
+
break;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return page;
|
|
290
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { fail } from './errors.mjs';
|
|
2
|
+
|
|
3
|
+
export function timestampValue(value, code = 'INVALID_STORE', label = 'updated_at') {
|
|
4
|
+
const milliseconds = typeof value === 'string' ? Date.parse(value) : NaN;
|
|
5
|
+
if (!Number.isFinite(milliseconds) || new Date(milliseconds).toISOString() !== value) {
|
|
6
|
+
fail(code, `${label} must be a canonical UTC millisecond timestamp, for example 2026-09-19T12:00:00.000Z`);
|
|
7
|
+
}
|
|
8
|
+
return milliseconds;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function validateTimestamp(task, label) {
|
|
12
|
+
if (task.updated_at !== undefined) timestampValue(task.updated_at, 'INVALID_STORE', `${label}: updated_at`);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function nextTimestamp(previous) {
|
|
16
|
+
const minimum = previous === undefined ? -Infinity : timestampValue(previous) + 1;
|
|
17
|
+
const milliseconds = Math.max(Date.now(), minimum);
|
|
18
|
+
if (!Number.isFinite(milliseconds) || Math.abs(milliseconds) > 8640000000000000) {
|
|
19
|
+
fail('TIMESTAMP_EXHAUSTED', 'updated_at cannot advance beyond the supported date range; correct the task timestamp before changing it');
|
|
20
|
+
}
|
|
21
|
+
return new Date(milliseconds).toISOString();
|
|
22
|
+
}
|