ostacky 0.5.4 → 0.5.6
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/README.md +34 -9
- package/assets/agents/ostacky.md +109 -29
- package/assets/commands/install-stack.md +222 -88
- package/assets/mcp/ostacky-controller/index.js +639 -999
- package/assets/mcp/ostacky-controller/node_modules/.package-lock.json +42 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/LICENSE +216 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/README.md +40 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-BUWfrB3C.d.cts +8198 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-BUWfrB3C.d.cts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-CEFpHq32.cjs +2862 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-CEFpHq32.cjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-CNbu4K4a.d.mts +8198 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-CNbu4K4a.d.mts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-DFgbUATV.mjs +1653 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-DFgbUATV.mjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/index.cjs +174 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/index.d.cts +2 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/index.d.mts +2 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/index.mjs +3 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/internal.cjs +199 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +87 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +87 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/internal.mjs +3 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/package.json +85 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/LICENSE +216 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/README.md +30 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/ajvProvider-B_4czhCS.d.cts +1054 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/ajvProvider-B_4czhCS.d.cts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/ajvProvider-BdSo9BII.d.mts +1054 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/ajvProvider-BdSo9BII.d.mts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/ajvProvider-Brn-Q2J_.cjs +7086 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/ajvProvider-Brn-Q2J_.cjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CplOkyLC.mjs +7069 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CplOkyLC.mjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BYRW5af5.d.mts +59 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BYRW5af5.d.mts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-Bd-iTHAF.mjs +970 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-Bd-iTHAF.mjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-D9GAttn8.d.cts +59 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-D9GAttn8.d.cts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-ojcZaap3.cjs +976 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-ojcZaap3.cjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/chunk-Bnu9O96Y.cjs +60 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs +42 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-BRM5MGf9.d.cts +4015 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-BRM5MGf9.d.cts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-D93NefGZ.d.mts +4013 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-D93NefGZ.d.mts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.cjs +1990 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.cjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.d.cts +732 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.d.cts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.d.mts +732 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.d.mts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.mjs +1813 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.mjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/mcp-Ctiu4nBa.mjs +1884 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/mcp-Ctiu4nBa.mjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/mcp-CzU40gwu.cjs +1963 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/mcp-CzU40gwu.cjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs +23 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts +11 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts +11 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs +22 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsNode.cjs +12 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.cts +3 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.mts +3 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs +4 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs +30 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts +10 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts +10 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs +29 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/src-D5Nfqtoz.mjs +7502 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/src-D5Nfqtoz.mjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/src-D9A7ArDn.cjs +8000 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/src-D9A7ArDn.cjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.cjs +564 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.cjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts +107 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts +107 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.mjs +562 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.mjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts +1099 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/types-mS0yxCL0.d.mts +1099 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/types-mS0yxCL0.d.mts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/validators/ajv.cjs +5 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.cts +2 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.mts +2 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/validators/ajv.mjs +3 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.cjs +3 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.cts +2 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.mts +2 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.mjs +3 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/package.json +160 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/LICENSE +21 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/README.md +191 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/index.cjs +33 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/index.d.cts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/index.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/index.js +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/locales/index.cjs +17 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/locales/index.d.cts +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/locales/index.d.ts +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/locales/index.js +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/locales/package.json +7 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/mini/index.cjs +32 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/mini/index.d.cts +3 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/mini/index.d.ts +3 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/mini/index.js +3 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/mini/package.json +7 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/package.json +135 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/index.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/locales/index.ts +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/mini/index.ts +3 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/ZodError.ts +330 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/errors.ts +13 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/external.ts +6 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/index.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/error.test.ts +551 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/function.test.ts +261 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/object.test.ts +434 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/string.test.ts +916 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v3/types.ts +5138 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/checks.ts +32 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/compat.ts +70 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/errors.ts +82 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/external.ts +52 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/from-json-schema.ts +659 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/iso.ts +90 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/parse.ts +82 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/schemas.ts +2672 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/apply.test.ts +59 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/assignability.test.ts +216 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/catch.test.ts +326 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +573 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/codec.test.ts +703 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/date.test.ts +62 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/datetime.test.ts +302 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/default.test.ts +409 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +197 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +694 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +807 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +895 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/function.test.ts +360 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/global-config.test.ts +39 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/hash.test.ts +68 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/index.test.ts +939 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +60 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/intersection.test.ts +198 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +46 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/literal.test.ts +117 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/map.test.ts +330 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/number.test.ts +325 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/object.test.ts +717 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/optional.test.ts +333 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/partial.test.ts +450 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +26 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/record.test.ts +717 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +631 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/refine.test.ts +633 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/set.test.ts +181 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/string.test.ts +1224 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +106 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +771 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +3125 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/tuple.test.ts +496 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/union.test.ts +273 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/api.ts +1823 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/checks.ts +1293 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/config.ts +15 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/core.ts +153 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/errors.ts +455 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/index.ts +16 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/json-schema-generator.ts +126 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/json-schema-processors.ts +666 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/json-schema.ts +147 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/parse.ts +195 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/regexes.ts +190 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/schemas.ts +4730 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/tests/locales/el.test.ts +215 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/tests/locales/es.test.ts +181 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/to-json-schema.ts +622 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/util.ts +983 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/index.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/ar.ts +115 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/az.ts +111 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/be.ts +176 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/bg.ts +128 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/ca.ts +116 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/cs.ts +118 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/da.ts +123 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/de.ts +116 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/el.ts +121 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/en.ts +123 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/eo.ts +118 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/es.ts +141 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/fa.ts +126 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/fi.ts +121 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/fr-CA.ts +116 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/fr.ts +132 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/he.ts +246 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/hr.ts +131 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/hu.ts +117 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/hy.ts +164 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/id.ts +115 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/index.ts +52 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/is.ts +119 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/it.ts +116 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/ja.ts +114 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/ka.ts +123 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/km.ts +119 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/ko.ts +121 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/lt.ts +239 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/mk.ts +118 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/ms.ts +115 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/nl.ts +121 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/no.ts +116 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/ota.ts +117 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/pl.ts +118 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/ps.ts +126 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/pt.ts +116 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/ro.ts +129 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/ru.ts +176 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/sl.ts +118 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/sv.ts +119 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/ta.ts +118 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/th.ts +119 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/tr.ts +111 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/uk.ts +117 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/ur.ts +119 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/uz.ts +117 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/vi.ts +117 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/yo.ts +124 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/zh-CN.ts +116 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/locales/zh-TW.ts +115 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/external.ts +41 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/parse.ts +14 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/schemas.ts +1947 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/tests/apply.test.ts +24 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/tests/codec.test.ts +548 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/tests/functions.test.ts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/tests/index.test.ts +993 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/tests/object.test.ts +227 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +325 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4/mini/tests/string.test.ts +352 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/src/v4-mini/index.ts +3 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/ZodError.cjs +138 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/ZodError.js +133 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/errors.cjs +17 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/errors.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/errors.d.ts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/errors.js +9 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/external.cjs +22 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/external.d.cts +6 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/external.d.ts +6 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/external.js +6 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/helpers/util.js +133 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/index.cjs +33 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/index.d.cts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/index.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/index.js +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/locales/en.cjs +112 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/locales/en.js +109 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/package.json +7 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/standard-schema.js +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/types.cjs +3777 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/types.d.cts +1034 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/types.d.ts +1034 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v3/types.js +3695 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/checks.cjs +33 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/checks.js +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/coerce.js +17 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/compat.cjs +61 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/compat.d.cts +50 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/compat.d.ts +50 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/compat.js +31 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/errors.cjs +74 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/errors.js +48 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/external.cjs +73 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/external.d.cts +16 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/external.d.ts +16 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/external.js +20 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/from-json-schema.cjs +625 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/from-json-schema.js +599 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/index.cjs +33 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/index.js +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/iso.js +30 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/package.json +7 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/parse.cjs +41 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/parse.d.cts +31 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/parse.d.ts +31 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/parse.js +15 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/schemas.cjs +1511 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/schemas.d.cts +767 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/schemas.d.ts +767 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/classic/schemas.js +1395 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/api.cjs +1227 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/api.d.cts +325 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/api.d.ts +325 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/api.js +1087 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/checks.cjs +601 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/checks.js +575 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/core.cjs +85 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/core.d.cts +70 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/core.d.ts +70 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/core.js +78 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/doc.cjs +39 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/doc.js +35 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/errors.cjs +216 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/errors.d.cts +221 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/errors.d.ts +221 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/errors.js +185 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/index.cjs +47 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/index.d.cts +16 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/index.d.ts +16 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/index.js +16 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/json-schema-generator.cjs +99 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/json-schema-generator.js +95 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/json-schema-processors.cjs +644 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/json-schema-processors.js +601 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/json-schema.d.cts +88 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/json-schema.d.ts +88 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/json-schema.js +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/package.json +7 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/parse.cjs +131 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/parse.d.cts +49 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/parse.d.ts +49 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/parse.js +93 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/regexes.cjs +172 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/regexes.d.cts +85 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/regexes.d.ts +85 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/regexes.js +139 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/registries.cjs +56 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/registries.js +51 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/schemas.cjs +2270 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/schemas.d.cts +1184 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/schemas.d.ts +1184 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/schemas.js +2239 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/to-json-schema.cjs +457 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/to-json-schema.d.cts +114 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/to-json-schema.d.ts +114 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/to-json-schema.js +448 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/util.cjs +734 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/util.d.cts +200 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/util.d.ts +200 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/util.js +674 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/versions.cjs +8 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/core/versions.js +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/index.cjs +22 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/index.d.cts +3 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/index.d.ts +3 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/index.js +3 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ar.cjs +133 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ar.js +106 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/az.cjs +132 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/az.js +105 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/be.cjs +183 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/be.js +156 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/bg.cjs +147 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/bg.js +120 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ca.cjs +134 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ca.js +107 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/cs.cjs +138 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/cs.js +111 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/da.cjs +142 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/da.js +115 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/de.cjs +135 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/de.js +108 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/el.cjs +136 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/el.js +109 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/en.cjs +140 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/en.js +113 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/eo.cjs +136 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/eo.js +109 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/es.cjs +159 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/es.js +132 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/fa.cjs +141 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/fa.js +114 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/fi.cjs +139 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/fi.js +112 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/fr-CA.cjs +134 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/fr-CA.js +107 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/fr.cjs +152 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/fr.js +125 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/he.cjs +241 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/he.js +214 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/hr.cjs +149 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/hr.js +122 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/hu.cjs +135 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/hu.js +108 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/hy.cjs +174 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/hy.js +147 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/id.cjs +133 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/id.js +106 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/index.cjs +111 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/index.d.cts +52 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/index.d.ts +52 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/index.js +52 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/is.cjs +136 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/is.js +109 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/it.cjs +135 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/it.js +108 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ja.cjs +134 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ja.js +107 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ka.cjs +139 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ka.js +112 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/kh.js +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/km.cjs +137 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/km.js +110 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ko.cjs +138 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ko.js +111 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/lt.cjs +230 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/lt.js +203 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/mk.cjs +136 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/mk.js +109 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ms.cjs +134 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ms.js +107 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/nl.cjs +137 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/nl.js +110 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/no.cjs +135 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/no.js +108 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ota.cjs +136 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ota.js +109 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/package.json +7 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/pl.cjs +136 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/pl.js +109 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ps.cjs +141 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ps.js +114 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/pt.cjs +135 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/pt.js +108 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ro.cjs +146 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ro.js +119 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ru.cjs +183 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ru.js +156 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/sl.cjs +136 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/sl.js +109 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/sv.cjs +137 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/sv.js +110 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ta.cjs +137 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ta.js +110 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/th.cjs +137 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/th.js +110 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/tr.cjs +132 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/tr.js +105 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ua.js +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/uk.cjs +135 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/uk.js +108 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ur.cjs +137 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/ur.js +110 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/uz.cjs +137 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/uz.js +110 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/vi.cjs +135 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/vi.js +108 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/yo.cjs +134 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/yo.js +107 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/zh-CN.cjs +136 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/zh-CN.js +109 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/zh-TW.cjs +134 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/locales/zh-TW.js +107 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/checks.js +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/coerce.cjs +52 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/coerce.js +22 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/external.cjs +63 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/external.d.cts +13 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/external.d.ts +13 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/external.js +14 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/index.cjs +32 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/index.js +3 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/iso.cjs +64 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/iso.js +34 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/package.json +7 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/parse.cjs +16 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/parse.js +1 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/schemas.cjs +1083 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/schemas.d.cts +445 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/schemas.d.ts +445 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/mini/schemas.js +961 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4/package.json +7 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4-mini/index.cjs +32 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4-mini/index.d.cts +3 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4-mini/index.d.ts +3 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4-mini/index.js +3 -0
- package/assets/mcp/ostacky-controller/node_modules/zod/v4-mini/package.json +7 -0
- package/assets/mcp/ostacky-controller/package-lock.json +50 -0
- package/assets/mcp/ostacky-controller/package.json +6 -2
- package/assets/skills/question-validation/SKILL.md +77 -0
- package/dist/cli.js +760 -191
- package/dist/mcp/ask-user-server/index.js +19657 -0
- package/dist/mcp/ostacky-controller/index.js +20045 -0
- package/manifest.json +28 -28
- package/package.json +4 -2
- package/assets/mcp/ask-user-server/index.js +0 -382
- package/assets/mcp/ask-user-server/package.json +0 -6
|
@@ -1,1017 +1,657 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* Fallback (controller unavailable):
|
|
15
|
-
* Ostacky degrades gracefully: reports reduced confidence, preserves
|
|
16
|
-
* natural-language confirmation gates, defaults to inline execution.
|
|
17
|
-
* Subagent execution is NEVER authorized without explicit user confirmation,
|
|
18
|
-
* even in degraded mode.
|
|
19
|
-
*
|
|
20
|
-
* Recovery:
|
|
21
|
-
* If state file is corrupted or stale, call controller.replan() from BLOCKED,
|
|
22
|
-
* or delete the state file and start a new request.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/* Exposes structured operations for:
|
|
26
|
-
* - Starting / resuming a request
|
|
27
|
-
* - Recording clarification and discovery
|
|
28
|
-
* - Consuming route decisions (spec / directo)
|
|
29
|
-
* - Authorizing side-effect actions
|
|
30
|
-
* - Recording execution snapshots
|
|
31
|
-
* - Consuming execution-mode decisions
|
|
32
|
-
* - Validating edits (EDITABLE / ALREADY_APPLIED / CONFLICT)
|
|
33
|
-
* - Completing tasks
|
|
34
|
-
*
|
|
35
|
-
* Persists state as atomic JSON writes to a configurable path.
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
import { readFileSync, writeFileSync, renameSync, mkdirSync } from "node:fs";
|
|
39
|
-
import { dirname } from "node:path";
|
|
40
|
-
|
|
41
|
-
// ─── Constants ──────────────────────────────────────────────────────────────────
|
|
42
|
-
|
|
43
|
-
export const STATES = Object.freeze({
|
|
44
|
-
INTERPRETATION_PENDING: "INTERPRETATION_PENDING",
|
|
45
|
-
CLARIFICATION_PENDING: "CLARIFICATION_PENDING",
|
|
46
|
-
DISCOVERY: "DISCOVERY",
|
|
47
|
-
LEVEL_RESOLVED: "LEVEL_RESOLVED",
|
|
48
|
-
ROUTE_DECISION_PENDING: "ROUTE_DECISION_PENDING",
|
|
49
|
-
SPECIFICATION: "SPECIFICATION",
|
|
50
|
-
EXECUTION_ANALYSIS: "EXECUTION_ANALYSIS",
|
|
51
|
-
EXECUTION_DECISION_PENDING: "EXECUTION_DECISION_PENDING",
|
|
52
|
-
EXECUTING_INLINE: "EXECUTING_INLINE",
|
|
53
|
-
EXECUTING_SUBAGENTS: "EXECUTING_SUBAGENTS",
|
|
54
|
-
SYNC: "SYNC",
|
|
55
|
-
DONE: "DONE",
|
|
56
|
-
BLOCKED: "BLOCKED",
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
export const RESULTS = Object.freeze({
|
|
60
|
-
OK: "OK",
|
|
61
|
-
INVALID_TRANSITION: "INVALID_TRANSITION",
|
|
62
|
-
DECISION_ALREADY_CONSUMED: "DECISION_ALREADY_CONSUMED",
|
|
63
|
-
ACTION_NOT_AUTHORIZED: "ACTION_NOT_AUTHORIZED",
|
|
64
|
-
EDITABLE: "EDITABLE",
|
|
65
|
-
ALREADY_APPLIED: "ALREADY_APPLIED",
|
|
66
|
-
CONFLICT: "CONFLICT",
|
|
67
|
-
REPLAN_REQUIRED: "REPLAN_REQUIRED",
|
|
68
|
-
});
|
|
3
|
+
import { McpServer } from '@modelcontextprotocol/server';
|
|
4
|
+
import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
|
|
5
|
+
import * as z from 'zod/v4';
|
|
6
|
+
import { readFileSync, writeFileSync, renameSync, mkdirSync } from 'node:fs';
|
|
7
|
+
import { dirname } from 'node:path';
|
|
8
|
+
|
|
9
|
+
function log(event, data) {
|
|
10
|
+
const ts = new Date().toISOString();
|
|
11
|
+
const payload = data ? ` ${JSON.stringify(data)}` : '';
|
|
12
|
+
console.error(`[${ts}] ${event}${payload}`);
|
|
13
|
+
}
|
|
69
14
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
15
|
+
const STATES = Object.freeze({
|
|
16
|
+
INTERPRETATION_PENDING: 'INTERPRETATION_PENDING',
|
|
17
|
+
CLARIFICATION_PENDING: 'CLARIFICATION_PENDING',
|
|
18
|
+
DISCOVERY: 'DISCOVERY',
|
|
19
|
+
LEVEL_RESOLVED: 'LEVEL_RESOLVED',
|
|
20
|
+
ROUTE_DECISION_PENDING: 'ROUTE_DECISION_PENDING',
|
|
21
|
+
SPECIFICATION: 'SPECIFICATION',
|
|
22
|
+
EXECUTION_ANALYSIS: 'EXECUTION_ANALYSIS',
|
|
23
|
+
EXECUTION_DECISION_PENDING: 'EXECUTION_DECISION_PENDING',
|
|
24
|
+
EXECUTING_INLINE: 'EXECUTING_INLINE',
|
|
25
|
+
EXECUTING_SUBAGENTS: 'EXECUTING_SUBAGENTS',
|
|
26
|
+
SYNC: 'SYNC',
|
|
27
|
+
DONE: 'DONE',
|
|
28
|
+
BLOCKED: 'BLOCKED',
|
|
77
29
|
});
|
|
78
30
|
|
|
79
|
-
// ─── Transition table ────────────────────────────────────────────────────────────
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Maps current state → allowed transitions.
|
|
83
|
-
* Each entry is an object with a `to` state and optional `via` (the action/operation
|
|
84
|
-
* that triggers the transition).
|
|
85
|
-
*/
|
|
86
|
-
const TRANSITIONS = {
|
|
87
|
-
[STATES.INTERPRETATION_PENDING]: [
|
|
88
|
-
{ to: STATES.CLARIFICATION_PENDING, via: "request_clarification" },
|
|
89
|
-
{ to: STATES.DISCOVERY, via: "proceed_to_discovery" },
|
|
90
|
-
{ to: STATES.ROUTE_DECISION_PENDING, via: "record_discovery" },
|
|
91
|
-
{ to: STATES.BLOCKED, via: "block" },
|
|
92
|
-
],
|
|
93
|
-
[STATES.CLARIFICATION_PENDING]: [
|
|
94
|
-
{ to: STATES.DISCOVERY, via: "record_clarification" },
|
|
95
|
-
{ to: STATES.BLOCKED, via: "block" },
|
|
96
|
-
{ to: STATES.BLOCKED, via: "abandon" },
|
|
97
|
-
],
|
|
98
|
-
[STATES.DISCOVERY]: [
|
|
99
|
-
{ to: STATES.LEVEL_RESOLVED, via: "record_discovery" },
|
|
100
|
-
{ to: STATES.BLOCKED, via: "block" },
|
|
101
|
-
{ to: STATES.BLOCKED, via: "abandon" },
|
|
102
|
-
],
|
|
103
|
-
[STATES.LEVEL_RESOLVED]: [
|
|
104
|
-
{ to: STATES.ROUTE_DECISION_PENDING, via: "route_decision_pending" },
|
|
105
|
-
{ to: STATES.BLOCKED, via: "block" },
|
|
106
|
-
],
|
|
107
|
-
[STATES.ROUTE_DECISION_PENDING]: [
|
|
108
|
-
{ to: STATES.SPECIFICATION, via: "consume_route_decision", choice: "SPEC" },
|
|
109
|
-
{ to: STATES.EXECUTION_ANALYSIS, via: "consume_route_decision", choice: "DIRECT" },
|
|
110
|
-
{ to: STATES.BLOCKED, via: "block" },
|
|
111
|
-
],
|
|
112
|
-
[STATES.SPECIFICATION]: [
|
|
113
|
-
{ to: STATES.EXECUTION_ANALYSIS, via: "spec_complete" },
|
|
114
|
-
{ to: STATES.BLOCKED, via: "block" },
|
|
115
|
-
{ to: STATES.BLOCKED, via: "abandon" },
|
|
116
|
-
],
|
|
117
|
-
[STATES.EXECUTION_ANALYSIS]: [
|
|
118
|
-
{ to: STATES.EXECUTION_DECISION_PENDING, via: "analysis_complete" },
|
|
119
|
-
{ to: STATES.BLOCKED, via: "block" },
|
|
120
|
-
{ to: STATES.BLOCKED, via: "abandon" },
|
|
121
|
-
],
|
|
122
|
-
[STATES.EXECUTION_DECISION_PENDING]: [
|
|
123
|
-
{ to: STATES.EXECUTING_INLINE, via: "consume_execution_decision", mode: "INLINE" },
|
|
124
|
-
{ to: STATES.EXECUTING_SUBAGENTS, via: "consume_execution_decision", mode: "SUBAGENT_DRIVEN" },
|
|
125
|
-
{ to: STATES.BLOCKED, via: "block" },
|
|
126
|
-
],
|
|
127
|
-
[STATES.EXECUTING_INLINE]: [
|
|
128
|
-
{ to: STATES.SYNC, via: "implementation_complete" },
|
|
129
|
-
{ to: STATES.BLOCKED, via: "block" },
|
|
130
|
-
],
|
|
131
|
-
[STATES.EXECUTING_SUBAGENTS]: [
|
|
132
|
-
{ to: STATES.SYNC, via: "implementation_complete" },
|
|
133
|
-
{ to: STATES.BLOCKED, via: "block" },
|
|
134
|
-
],
|
|
135
|
-
[STATES.BLOCKED]: [
|
|
136
|
-
{ to: STATES.INTERPRETATION_PENDING, via: "replan" },
|
|
137
|
-
{ to: STATES.DONE, via: "abandon" },
|
|
138
|
-
],
|
|
139
|
-
[STATES.SYNC]: [
|
|
140
|
-
{ to: STATES.DONE, via: "sync_complete" },
|
|
141
|
-
{ to: STATES.BLOCKED, via: "block" },
|
|
142
|
-
],
|
|
143
|
-
[STATES.DONE]: [],
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
// ─── Authorizable actions per state ──────────────────────────────────────────────
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Which side-effect actions are authorized in each state.
|
|
150
|
-
* An action is an { action, state } pair with optional extra requirements.
|
|
151
|
-
*/
|
|
152
|
-
const AUTHORIZATIONS = {
|
|
153
|
-
[STATES.SPECIFICATION]: [ACTIONS.OPENSPEC_PROPOSE, ACTIONS.OPENSPEC_APPLY],
|
|
154
|
-
[STATES.EXECUTING_INLINE]: [ACTIONS.EXECUTION_START, ACTIONS.EDIT, ACTIONS.TASK_COMPLETE],
|
|
155
|
-
[STATES.EXECUTING_SUBAGENTS]: [ACTIONS.EXECUTION_START, ACTIONS.EDIT, ACTIONS.TASK_COMPLETE],
|
|
156
|
-
[STATES.SYNC]: [ACTIONS.SYNC],
|
|
157
|
-
[STATES.EDITABLE_VALIDATED]: [ACTIONS.EDIT],
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
// ─── Default state ───────────────────────────────────────────────────────────────
|
|
161
|
-
|
|
162
31
|
const DEFAULT_STATE = Object.freeze({
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
32
|
+
state: STATES.INTERPRETATION_PENDING,
|
|
33
|
+
revision: 0,
|
|
34
|
+
requestId: null,
|
|
35
|
+
changeId: null,
|
|
36
|
+
routeDecisionId: null,
|
|
37
|
+
routeChoice: null,
|
|
38
|
+
executionDecisionId: null,
|
|
39
|
+
executionMode: null,
|
|
40
|
+
snapshots: { codegraph: null, execution: null },
|
|
41
|
+
tasks: {},
|
|
42
|
+
fileFingerprints: {},
|
|
43
|
+
error: null,
|
|
175
44
|
});
|
|
176
45
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
for (const t of transitions) {
|
|
182
|
-
if (t.via !== via) continue;
|
|
183
|
-
if (t.choice !== undefined && t.choice !== choiceOrMode) continue;
|
|
184
|
-
if (t.mode !== undefined && t.mode !== choiceOrMode) continue;
|
|
185
|
-
return t.to;
|
|
186
|
-
}
|
|
187
|
-
return null;
|
|
188
|
-
}
|
|
46
|
+
class OstackyController {
|
|
47
|
+
#statePath;
|
|
48
|
+
#state;
|
|
49
|
+
#loaded;
|
|
189
50
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
51
|
+
constructor(opts = {}) {
|
|
52
|
+
this.#statePath = opts.statePath;
|
|
53
|
+
this.#state = opts.initialState ? { ...DEFAULT_STATE, ...opts.initialState } : null;
|
|
54
|
+
this.#loaded = false;
|
|
55
|
+
}
|
|
194
56
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
57
|
+
#load() {
|
|
58
|
+
if (this.#loaded) return;
|
|
59
|
+
if (!this.#statePath) {
|
|
60
|
+
this.#state = { ...DEFAULT_STATE };
|
|
61
|
+
this.#loaded = true;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
const raw = readFileSync(this.#statePath, 'utf8');
|
|
66
|
+
this.#state = { ...DEFAULT_STATE, ...JSON.parse(raw) };
|
|
67
|
+
} catch {
|
|
68
|
+
this.#state = { ...DEFAULT_STATE };
|
|
69
|
+
}
|
|
70
|
+
this.#loaded = true;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
#persist() {
|
|
74
|
+
if (!this.#statePath) return;
|
|
75
|
+
const dir = dirname(this.#statePath);
|
|
76
|
+
mkdirSync(dir, { recursive: true });
|
|
77
|
+
const tmp = this.#statePath + '.tmp.' + process.pid;
|
|
78
|
+
writeFileSync(tmp, JSON.stringify(this.#state, null, 2), 'utf8');
|
|
79
|
+
renameSync(tmp, this.#statePath);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
#transition(to, changes = {}) {
|
|
83
|
+
this.#state.revision++;
|
|
84
|
+
this.#state.state = to;
|
|
85
|
+
Object.assign(this.#state, changes);
|
|
86
|
+
this.#persist();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
#isAllowedTransition(from, via, choiceOrMode) {
|
|
90
|
+
const table = {
|
|
91
|
+
INTERPRETATION_PENDING: [
|
|
92
|
+
{ to: 'CLARIFICATION_PENDING', via: 'request_clarification' },
|
|
93
|
+
{ to: 'DISCOVERY', via: 'proceed_to_discovery' },
|
|
94
|
+
{ to: 'ROUTE_DECISION_PENDING', via: 'record_discovery' },
|
|
95
|
+
{ to: 'BLOCKED', via: 'block' },
|
|
96
|
+
],
|
|
97
|
+
CLARIFICATION_PENDING: [
|
|
98
|
+
{ to: 'DISCOVERY', via: 'record_clarification' },
|
|
99
|
+
{ to: 'BLOCKED', via: 'block' },
|
|
100
|
+
{ to: 'BLOCKED', via: 'abandon' },
|
|
101
|
+
],
|
|
102
|
+
DISCOVERY: [
|
|
103
|
+
{ to: 'LEVEL_RESOLVED', via: 'record_discovery' },
|
|
104
|
+
{ to: 'BLOCKED', via: 'block' },
|
|
105
|
+
{ to: 'BLOCKED', via: 'abandon' },
|
|
106
|
+
],
|
|
107
|
+
LEVEL_RESOLVED: [
|
|
108
|
+
{ to: 'ROUTE_DECISION_PENDING', via: 'route_decision_pending' },
|
|
109
|
+
{ to: 'BLOCKED', via: 'block' },
|
|
110
|
+
],
|
|
111
|
+
ROUTE_DECISION_PENDING: [
|
|
112
|
+
{ to: 'SPECIFICATION', via: 'consume_route_decision', choice: 'SPEC' },
|
|
113
|
+
{ to: 'EXECUTION_ANALYSIS', via: 'consume_route_decision', choice: 'DIRECT' },
|
|
114
|
+
{ to: 'BLOCKED', via: 'block' },
|
|
115
|
+
],
|
|
116
|
+
SPECIFICATION: [
|
|
117
|
+
{ to: 'EXECUTION_ANALYSIS', via: 'spec_complete' },
|
|
118
|
+
{ to: 'BLOCKED', via: 'block' },
|
|
119
|
+
{ to: 'BLOCKED', via: 'abandon' },
|
|
120
|
+
],
|
|
121
|
+
EXECUTION_ANALYSIS: [
|
|
122
|
+
{ to: 'EXECUTION_DECISION_PENDING', via: 'analysis_complete' },
|
|
123
|
+
{ to: 'BLOCKED', via: 'block' },
|
|
124
|
+
{ to: 'BLOCKED', via: 'abandon' },
|
|
125
|
+
],
|
|
126
|
+
EXECUTION_DECISION_PENDING: [
|
|
127
|
+
{ to: 'EXECUTING_INLINE', via: 'consume_execution_decision', mode: 'INLINE' },
|
|
128
|
+
{ to: 'EXECUTING_SUBAGENTS', via: 'consume_execution_decision', mode: 'SUBAGENT_DRIVEN' },
|
|
129
|
+
{ to: 'BLOCKED', via: 'block' },
|
|
130
|
+
],
|
|
131
|
+
EXECUTING_INLINE: [
|
|
132
|
+
{ to: 'SYNC', via: 'implementation_complete' },
|
|
133
|
+
{ to: 'BLOCKED', via: 'block' },
|
|
134
|
+
],
|
|
135
|
+
EXECUTING_SUBAGENTS: [
|
|
136
|
+
{ to: 'SYNC', via: 'implementation_complete' },
|
|
137
|
+
{ to: 'BLOCKED', via: 'block' },
|
|
138
|
+
],
|
|
139
|
+
BLOCKED: [
|
|
140
|
+
{ to: 'INTERPRETATION_PENDING', via: 'replan' },
|
|
141
|
+
{ to: 'DONE', via: 'abandon' },
|
|
142
|
+
],
|
|
143
|
+
SYNC: [
|
|
144
|
+
{ to: 'DONE', via: 'sync_complete' },
|
|
145
|
+
{ to: 'BLOCKED', via: 'block' },
|
|
146
|
+
],
|
|
147
|
+
DONE: [],
|
|
148
|
+
};
|
|
149
|
+
const transitions = table[from] || [];
|
|
150
|
+
for (const t of transitions) {
|
|
151
|
+
if (t.via !== via) continue;
|
|
152
|
+
if (t.choice !== undefined && t.choice !== choiceOrMode) continue;
|
|
153
|
+
if (t.mode !== undefined && t.mode !== choiceOrMode) continue;
|
|
154
|
+
return t.to;
|
|
155
|
+
}
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
234
158
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
#checkPendingDecisionId(decisionId) {
|
|
288
|
-
if (!this.#state.routeDecisionId && !this.#state.executionDecisionId) {
|
|
289
|
-
// No pending decision, or we check specific cases below
|
|
290
|
-
}
|
|
291
|
-
if (this.#state.routeDecisionId && this.#state.routeDecisionId === decisionId && this.#state.routeChoice) {
|
|
292
|
-
return RESULTS.DECISION_ALREADY_CONSUMED;
|
|
293
|
-
}
|
|
294
|
-
if (this.#state.executionDecisionId && this.#state.executionDecisionId === decisionId && this.#state.executionMode) {
|
|
295
|
-
return RESULTS.DECISION_ALREADY_CONSUMED;
|
|
296
|
-
}
|
|
297
|
-
return null;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
// ── Public API ─────────────────────────────────────────────────────────────────
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* Start or resume a request.
|
|
304
|
-
* @param {Object} params
|
|
305
|
-
* @param {string} params.requestId
|
|
306
|
-
* @param {string} [params.changeId]
|
|
307
|
-
* @returns {Promise<{status: string, state: string, revision: number, requestId: string}>}
|
|
308
|
-
*/
|
|
309
|
-
async startRequest({ requestId, changeId } = {}) {
|
|
310
|
-
this.#load();
|
|
311
|
-
|
|
312
|
-
if (this.#state.state !== STATES.INTERPRETATION_PENDING && this.#state.state !== STATES.BLOCKED && this.#state.state !== STATES.DONE) {
|
|
313
|
-
// Already in an active flow — resume path
|
|
314
|
-
return {
|
|
315
|
-
status: RESULTS.OK,
|
|
316
|
-
state: this.#state.state,
|
|
317
|
-
revision: this.#state.revision,
|
|
318
|
-
requestId: this.#state.requestId,
|
|
319
|
-
changeId: this.#state.changeId,
|
|
320
|
-
routeDecisionId: this.#state.routeDecisionId,
|
|
321
|
-
routeChoice: this.#state.routeChoice,
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
// Start fresh or replan from BLOCKED
|
|
326
|
-
this.#transition(STATES.INTERPRETATION_PENDING, {
|
|
327
|
-
requestId: requestId || "req-" + Date.now(),
|
|
328
|
-
changeId: changeId || null,
|
|
329
|
-
routeDecisionId: null,
|
|
330
|
-
routeChoice: null,
|
|
331
|
-
executionDecisionId: null,
|
|
332
|
-
executionMode: null,
|
|
333
|
-
snapshots: { codegraph: null, execution: null },
|
|
334
|
-
tasks: {},
|
|
335
|
-
fileFingerprints: {},
|
|
336
|
-
error: null,
|
|
337
|
-
});
|
|
338
|
-
|
|
339
|
-
return {
|
|
340
|
-
status: RESULTS.OK,
|
|
341
|
-
state: this.#state.state,
|
|
342
|
-
revision: this.#state.revision,
|
|
343
|
-
requestId: this.#state.requestId,
|
|
344
|
-
changeId: this.#state.changeId,
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* Record that clarification was requested.
|
|
350
|
-
* @param {Object} params
|
|
351
|
-
* @param {string} [params.question]
|
|
352
|
-
* @returns {Promise<{status: string, state: string, revision: number}>}
|
|
353
|
-
*/
|
|
354
|
-
async requestClarification({ question } = {}) {
|
|
355
|
-
this.#load();
|
|
356
|
-
const to = isAllowedTransition(this.#state.state, "request_clarification");
|
|
357
|
-
if (!to) {
|
|
358
|
-
return {
|
|
359
|
-
status: RESULTS.INVALID_TRANSITION,
|
|
360
|
-
state: this.#state.state,
|
|
361
|
-
revision: this.#state.revision,
|
|
362
|
-
reason: `Cannot request clarification from state ${this.#state.state}`,
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
|
-
this.#transition(to, { error: question ? `Clarification: ${question}` : null });
|
|
366
|
-
return { status: RESULTS.OK, state: this.#state.state, revision: this.#state.revision };
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* Record that clarification was answered.
|
|
371
|
-
* @returns {Promise<{status: string, state: string, revision: number}>}
|
|
372
|
-
*/
|
|
373
|
-
async recordClarification() {
|
|
374
|
-
this.#load();
|
|
375
|
-
const to = isAllowedTransition(this.#state.state, "record_clarification");
|
|
376
|
-
if (!to) {
|
|
377
|
-
return {
|
|
378
|
-
status: RESULTS.INVALID_TRANSITION,
|
|
379
|
-
state: this.#state.state,
|
|
380
|
-
revision: this.#state.revision,
|
|
381
|
-
reason: `Cannot record clarification from state ${this.#state.state}`,
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
this.#transition(to, { error: null });
|
|
385
|
-
return { status: RESULTS.OK, state: this.#state.state, revision: this.#state.revision };
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
/**
|
|
389
|
-
* Record that discovery is complete and a level was determined.
|
|
390
|
-
* @param {Object} params
|
|
391
|
-
* @param {string} params.level - '0', '0+1', or '1+'
|
|
392
|
-
* @param {string} params.routeDecisionId - Unique ID for the pending route decision
|
|
393
|
-
* @param {Object} [params.snapshot] - Optional CodeGraph snapshot reference
|
|
394
|
-
* @returns {Promise<{status: string, state: string, revision: number, level: string}>}
|
|
395
|
-
*/
|
|
396
|
-
async recordDiscovery({ level, routeDecisionId, snapshot } = {}) {
|
|
397
|
-
this.#load();
|
|
398
|
-
const to = isAllowedTransition(this.#state.state, "record_discovery");
|
|
399
|
-
if (!to) {
|
|
400
|
-
return {
|
|
401
|
-
status: RESULTS.INVALID_TRANSITION,
|
|
402
|
-
state: this.#state.state,
|
|
403
|
-
revision: this.#state.revision,
|
|
404
|
-
reason: `Cannot record discovery from state ${this.#state.state}`,
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
if (!["0", "0+1", "1+"].includes(level)) {
|
|
409
|
-
return {
|
|
410
|
-
status: RESULTS.INVALID_TRANSITION,
|
|
411
|
-
state: this.#state.state,
|
|
412
|
-
revision: this.#state.revision,
|
|
413
|
-
reason: `Invalid level: ${level}. Must be '0', '0+1', or '1+'`,
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
this.#transition(STATES.ROUTE_DECISION_PENDING, {
|
|
418
|
-
routeDecisionId: routeDecisionId || "route-" + Date.now(),
|
|
419
|
-
routeChoice: null,
|
|
420
|
-
snapshots: {
|
|
421
|
-
...this.#state.snapshots,
|
|
422
|
-
codegraph: snapshot || this.#state.snapshots.codegraph,
|
|
423
|
-
},
|
|
424
|
-
});
|
|
425
|
-
|
|
426
|
-
// Default routing: Level 0/0+1 → DIRECT, Level 1+ → SPEC
|
|
427
|
-
const defaultChoice = level === "1+" ? "SPEC" : "DIRECT";
|
|
428
|
-
|
|
429
|
-
return {
|
|
430
|
-
status: RESULTS.OK,
|
|
431
|
-
state: this.#state.state,
|
|
432
|
-
revision: this.#state.revision,
|
|
433
|
-
level,
|
|
434
|
-
routeDecisionId: this.#state.routeDecisionId,
|
|
435
|
-
defaultChoice,
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
/**
|
|
440
|
-
* Consume the route decision (spec / directo).
|
|
441
|
-
* Only valid in ROUTE_DECISION_PENDING. Consumed exactly once per decisionId.
|
|
442
|
-
* @param {Object} params
|
|
443
|
-
* @param {string} params.decisionId - Must match the pending routeDecisionId
|
|
444
|
-
* @param {string} params.choice - 'SPEC' or 'DIRECT'
|
|
445
|
-
* @returns {Promise<{status: string, state: string, revision: number}>}
|
|
446
|
-
*/
|
|
447
|
-
async consumeRouteDecision({ decisionId, choice } = {}) {
|
|
448
|
-
this.#load();
|
|
449
|
-
|
|
450
|
-
if (this.#state.state !== STATES.ROUTE_DECISION_PENDING) {
|
|
451
|
-
// Check if already consumed: same decisionId with a routeChoice set
|
|
452
|
-
if (this.#state.routeDecisionId === decisionId && this.#state.routeChoice) {
|
|
159
|
+
async startRequest({ requestId, changeId } = {}) {
|
|
160
|
+
this.#load();
|
|
161
|
+
if (
|
|
162
|
+
this.#state.state !== 'INTERPRETATION_PENDING' &&
|
|
163
|
+
this.#state.state !== 'BLOCKED' &&
|
|
164
|
+
this.#state.state !== 'DONE'
|
|
165
|
+
) {
|
|
166
|
+
return { state: this.#state.state, revision: this.#state.revision, requestId: this.#state.requestId };
|
|
167
|
+
}
|
|
168
|
+
this.#transition('INTERPRETATION_PENDING', {
|
|
169
|
+
requestId: requestId || 'req-' + Date.now(),
|
|
170
|
+
changeId: changeId || null,
|
|
171
|
+
routeDecisionId: null,
|
|
172
|
+
routeChoice: null,
|
|
173
|
+
executionDecisionId: null,
|
|
174
|
+
executionMode: null,
|
|
175
|
+
snapshots: { codegraph: null, execution: null },
|
|
176
|
+
tasks: {},
|
|
177
|
+
fileFingerprints: {},
|
|
178
|
+
error: null,
|
|
179
|
+
});
|
|
180
|
+
return { state: this.#state.state, revision: this.#state.revision, requestId: this.#state.requestId };
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
async requestClarification({ question } = {}) {
|
|
184
|
+
this.#load();
|
|
185
|
+
const to = this.#isAllowedTransition(this.#state.state, 'request_clarification');
|
|
186
|
+
if (!to) return { error: `Cannot request clarification from state ${this.#state.state}` };
|
|
187
|
+
this.#transition(to, { error: question ? `Clarification: ${question}` : null });
|
|
188
|
+
return { state: this.#state.state, revision: this.#state.revision };
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
async recordClarification() {
|
|
192
|
+
this.#load();
|
|
193
|
+
const to = this.#isAllowedTransition(this.#state.state, 'record_clarification');
|
|
194
|
+
if (!to) return { error: `Cannot record clarification from state ${this.#state.state}` };
|
|
195
|
+
this.#transition(to, { error: null });
|
|
196
|
+
return { state: this.#state.state, revision: this.#state.revision };
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
async recordDiscovery({ level, routeDecisionId, snapshot } = {}) {
|
|
200
|
+
this.#load();
|
|
201
|
+
const to = this.#isAllowedTransition(this.#state.state, 'record_discovery');
|
|
202
|
+
if (!to) return { error: `Cannot record discovery from state ${this.#state.state}` };
|
|
203
|
+
if (!['0', '0+1', '1+'].includes(level)) return { error: `Invalid level: ${level}` };
|
|
204
|
+
this.#transition('ROUTE_DECISION_PENDING', {
|
|
205
|
+
routeDecisionId: routeDecisionId || 'route-' + Date.now(),
|
|
206
|
+
routeChoice: null,
|
|
207
|
+
snapshots: { ...this.#state.snapshots, codegraph: snapshot || this.#state.snapshots.codegraph },
|
|
208
|
+
});
|
|
209
|
+
const defaultChoice = level === '1+' ? 'SPEC' : 'DIRECT';
|
|
453
210
|
return {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
211
|
+
state: this.#state.state,
|
|
212
|
+
revision: this.#state.revision,
|
|
213
|
+
level,
|
|
214
|
+
routeDecisionId: this.#state.routeDecisionId,
|
|
215
|
+
defaultChoice,
|
|
458
216
|
};
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
state: this.#state.
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
const to = isAllowedTransition(this.#state.state, "consume_route_decision", choice);
|
|
497
|
-
if (!to) {
|
|
498
|
-
return {
|
|
499
|
-
status: RESULTS.INVALID_TRANSITION,
|
|
500
|
-
state: this.#state.state,
|
|
501
|
-
revision: this.#state.revision,
|
|
502
|
-
reason: `Route ${choice} not allowed from ${this.#state.state}`,
|
|
503
|
-
};
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
this.#transition(to, { routeChoice: choice });
|
|
507
|
-
return {
|
|
508
|
-
status: RESULTS.OK,
|
|
509
|
-
state: this.#state.state,
|
|
510
|
-
revision: this.#state.revision,
|
|
511
|
-
routeChoice: choice,
|
|
512
|
-
allowedActions: isActionAuthorized(this.#state.state, ACTIONS.OPENSPEC_PROPOSE)
|
|
513
|
-
? [ACTIONS.OPENSPEC_PROPOSE]
|
|
514
|
-
: [],
|
|
515
|
-
};
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
/**
|
|
519
|
-
* Record that spec phase is complete (transition from SPECIFICATION → EXECUTION_ANALYSIS).
|
|
520
|
-
* @returns {Promise<{status: string, state: string, revision: number}>}
|
|
521
|
-
*/
|
|
522
|
-
async specComplete() {
|
|
523
|
-
this.#load();
|
|
524
|
-
const to = isAllowedTransition(this.#state.state, "spec_complete");
|
|
525
|
-
if (!to) {
|
|
526
|
-
return {
|
|
527
|
-
status: RESULTS.INVALID_TRANSITION,
|
|
528
|
-
state: this.#state.state,
|
|
529
|
-
revision: this.#state.revision,
|
|
530
|
-
reason: `Cannot complete spec from state ${this.#state.state}`,
|
|
531
|
-
};
|
|
532
|
-
}
|
|
533
|
-
this.#transition(to);
|
|
534
|
-
return { status: RESULTS.OK, state: this.#state.state, revision: this.#state.revision };
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
/**
|
|
538
|
-
* Record an execution analysis snapshot.
|
|
539
|
-
* @param {Object} params
|
|
540
|
-
* @param {string} params.executionDecisionId - Unique ID for the pending execution mode decision
|
|
541
|
-
* @param {Object} params.snapshot - Execution analysis data
|
|
542
|
-
* @param {string} params.snapshot.recommendation - 'INLINE' or 'SUBAGENT_DRIVEN'
|
|
543
|
-
* @param {Array<string>} params.snapshot.sharedFiles - Shared files between tasks
|
|
544
|
-
* @param {number} params.snapshot.estimatedLines - Estimated total lines changed
|
|
545
|
-
* @param {Array<string>} params.snapshot.reasons - Reasons for the recommendation
|
|
546
|
-
* @returns {Promise<{status: string, state: string, revision: number}>}
|
|
547
|
-
*/
|
|
548
|
-
async recordExecutionAnalysis({ executionDecisionId, snapshot } = {}) {
|
|
549
|
-
this.#load();
|
|
550
|
-
const to = isAllowedTransition(this.#state.state, "analysis_complete");
|
|
551
|
-
if (!to) {
|
|
552
|
-
return {
|
|
553
|
-
status: RESULTS.INVALID_TRANSITION,
|
|
554
|
-
state: this.#state.state,
|
|
555
|
-
revision: this.#state.revision,
|
|
556
|
-
reason: `Cannot record execution analysis from state ${this.#state.state}`,
|
|
557
|
-
};
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
this.#transition(STATES.EXECUTION_DECISION_PENDING, {
|
|
561
|
-
executionDecisionId: executionDecisionId || "exec-" + Date.now(),
|
|
562
|
-
executionMode: null,
|
|
563
|
-
snapshots: {
|
|
564
|
-
...this.#state.snapshots,
|
|
565
|
-
execution: snapshot || null,
|
|
566
|
-
},
|
|
567
|
-
});
|
|
568
|
-
|
|
569
|
-
return {
|
|
570
|
-
status: RESULTS.OK,
|
|
571
|
-
state: this.#state.state,
|
|
572
|
-
revision: this.#state.revision,
|
|
573
|
-
executionDecisionId: this.#state.executionDecisionId,
|
|
574
|
-
};
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
/**
|
|
578
|
-
* Consume the execution mode decision (inline / subagent-driven).
|
|
579
|
-
* @param {Object} params
|
|
580
|
-
* @param {string} params.decisionId
|
|
581
|
-
* @param {string} params.mode - 'INLINE' or 'SUBAGENT_DRIVEN'
|
|
582
|
-
* @returns {Promise<{status: string, state: string, revision: number, allowedActions: string[]}>}
|
|
583
|
-
*/
|
|
584
|
-
async consumeExecutionDecision({ decisionId, mode } = {}) {
|
|
585
|
-
this.#load();
|
|
586
|
-
|
|
587
|
-
if (this.#state.state !== STATES.EXECUTION_DECISION_PENDING) {
|
|
588
|
-
if (this.#state.executionDecisionId === decisionId && this.#state.executionMode) {
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
async consumeRouteDecision({ decisionId, choice } = {}) {
|
|
220
|
+
this.#load();
|
|
221
|
+
if (this.#state.state !== 'ROUTE_DECISION_PENDING') {
|
|
222
|
+
if (this.#state.routeDecisionId === decisionId && this.#state.routeChoice) {
|
|
223
|
+
return { error: `Route decision ${decisionId} already consumed as ${this.#state.routeChoice}` };
|
|
224
|
+
}
|
|
225
|
+
return { error: `Cannot consume route decision from state ${this.#state.state}` };
|
|
226
|
+
}
|
|
227
|
+
if (this.#state.routeDecisionId !== decisionId) return { error: `Decision ID mismatch` };
|
|
228
|
+
if (choice !== 'SPEC' && choice !== 'DIRECT') return { error: `Invalid choice: ${choice}` };
|
|
229
|
+
if (this.#state.routeChoice) return { error: `Decision already consumed as ${this.#state.routeChoice}` };
|
|
230
|
+
const to = this.#isAllowedTransition(this.#state.state, 'consume_route_decision', choice);
|
|
231
|
+
if (!to) return { error: `Route ${choice} not allowed from ${this.#state.state}` };
|
|
232
|
+
this.#transition(to, { routeChoice: choice });
|
|
233
|
+
return { state: this.#state.state, revision: this.#state.revision, routeChoice: choice };
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
async specComplete() {
|
|
237
|
+
this.#load();
|
|
238
|
+
const to = this.#isAllowedTransition(this.#state.state, 'spec_complete');
|
|
239
|
+
if (!to) return { error: `Cannot complete spec from state ${this.#state.state}` };
|
|
240
|
+
this.#transition(to);
|
|
241
|
+
return { state: this.#state.state, revision: this.#state.revision };
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
async recordExecutionAnalysis({ executionDecisionId, snapshot } = {}) {
|
|
245
|
+
this.#load();
|
|
246
|
+
const to = this.#isAllowedTransition(this.#state.state, 'analysis_complete');
|
|
247
|
+
if (!to) return { error: `Cannot record execution analysis from state ${this.#state.state}` };
|
|
248
|
+
this.#transition('EXECUTION_DECISION_PENDING', {
|
|
249
|
+
executionDecisionId: executionDecisionId || 'exec-' + Date.now(),
|
|
250
|
+
executionMode: null,
|
|
251
|
+
snapshots: { ...this.#state.snapshots, execution: snapshot || null },
|
|
252
|
+
});
|
|
589
253
|
return {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
reason: `Execution decision ${decisionId} already consumed as ${this.#state.executionMode}`,
|
|
254
|
+
state: this.#state.state,
|
|
255
|
+
revision: this.#state.revision,
|
|
256
|
+
executionDecisionId: this.#state.executionDecisionId,
|
|
594
257
|
};
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
state: this.#state.
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
state: this.#state.state,
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
async consumeExecutionDecision({ decisionId, mode } = {}) {
|
|
261
|
+
this.#load();
|
|
262
|
+
if (this.#state.state !== 'EXECUTION_DECISION_PENDING') {
|
|
263
|
+
if (this.#state.executionDecisionId === decisionId && this.#state.executionMode) {
|
|
264
|
+
return { error: `Execution decision ${decisionId} already consumed as ${this.#state.executionMode}` };
|
|
265
|
+
}
|
|
266
|
+
return { error: `Cannot consume execution decision from state ${this.#state.state}` };
|
|
267
|
+
}
|
|
268
|
+
if (this.#state.executionDecisionId !== decisionId) return { error: `Decision ID mismatch` };
|
|
269
|
+
if (mode !== 'INLINE' && mode !== 'SUBAGENT_DRIVEN') return { error: `Invalid mode: ${mode}` };
|
|
270
|
+
if (this.#state.executionMode) return { error: `Decision already consumed as ${this.#state.executionMode}` };
|
|
271
|
+
const to = this.#isAllowedTransition(this.#state.state, 'consume_execution_decision', mode);
|
|
272
|
+
if (!to) return { error: `Mode ${mode} not allowed from ${this.#state.state}` };
|
|
273
|
+
this.#transition(to, { executionMode: mode });
|
|
274
|
+
return { state: this.#state.state, revision: this.#state.revision, executionMode: mode };
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
async implementationComplete() {
|
|
278
|
+
this.#load();
|
|
279
|
+
const to = this.#isAllowedTransition(this.#state.state, 'implementation_complete');
|
|
280
|
+
if (!to) return { error: `Cannot complete implementation from state ${this.#state.state}` };
|
|
281
|
+
this.#transition(to);
|
|
282
|
+
return { state: this.#state.state, revision: this.#state.revision };
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
async syncComplete() {
|
|
286
|
+
this.#load();
|
|
287
|
+
const to = this.#isAllowedTransition(this.#state.state, 'sync_complete');
|
|
288
|
+
if (!to) return { error: `Cannot complete sync from state ${this.#state.state}` };
|
|
289
|
+
this.#transition(to);
|
|
290
|
+
return { state: this.#state.state, revision: this.#state.revision };
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
async block({ reason } = {}) {
|
|
294
|
+
this.#load();
|
|
295
|
+
const to = this.#isAllowedTransition(this.#state.state, 'block');
|
|
296
|
+
if (!to) return { error: `Cannot block from state ${this.#state.state}` };
|
|
297
|
+
this.#transition(to, { error: reason || 'Blocked' });
|
|
298
|
+
return { state: this.#state.state, revision: this.#state.revision };
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
async replan({ reason } = {}) {
|
|
302
|
+
this.#load();
|
|
303
|
+
const to = this.#isAllowedTransition(this.#state.state, 'replan');
|
|
304
|
+
if (!to) return { error: `Cannot replan from state ${this.#state.state}` };
|
|
305
|
+
this.#transition(to, {
|
|
306
|
+
error: reason || null,
|
|
307
|
+
routeDecisionId: null,
|
|
308
|
+
routeChoice: null,
|
|
309
|
+
executionDecisionId: null,
|
|
310
|
+
executionMode: null,
|
|
311
|
+
snapshots: { codegraph: null, execution: null },
|
|
312
|
+
tasks: {},
|
|
313
|
+
fileFingerprints: {},
|
|
314
|
+
});
|
|
315
|
+
return { state: this.#state.state, revision: this.#state.revision };
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
async getState() {
|
|
319
|
+
this.#load();
|
|
320
|
+
return { ...this.#state };
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
async getTasks() {
|
|
324
|
+
this.#load();
|
|
325
|
+
return { ...this.#state.tasks };
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Validates an edit against the current file content.
|
|
330
|
+
* Returns one of: EDITABLE, ALREADY_APPLIED, CONFLICT.
|
|
331
|
+
* - EDITABLE: oldString found exactly once, safe to replace.
|
|
332
|
+
* - ALREADY_APPLIED: newString already present in content (idempotent skip).
|
|
333
|
+
* - CONFLICT: oldString not found, or found multiple times.
|
|
334
|
+
*/
|
|
335
|
+
async validateEdit({ oldString, newString, content, taskId } = {}) {
|
|
336
|
+
this.#load();
|
|
337
|
+
if (this.#state.state !== 'EXECUTING_INLINE' && this.#state.state !== 'EXECUTING_SUBAGENTS') {
|
|
338
|
+
return { outcome: 'CONFLICT', reason: `Cannot validate edit from state ${this.#state.state}` };
|
|
339
|
+
}
|
|
340
|
+
if (typeof content !== 'string' || typeof oldString !== 'string' || typeof newString !== 'string') {
|
|
341
|
+
return { outcome: 'CONFLICT', reason: 'Missing required fields: content, oldString, newString' };
|
|
342
|
+
}
|
|
343
|
+
if (oldString.length === 0) {
|
|
344
|
+
return { outcome: 'CONFLICT', reason: 'oldString cannot be empty' };
|
|
345
|
+
}
|
|
346
|
+
// Trivial idempotency: identical strings → nothing to do
|
|
347
|
+
if (oldString === newString) {
|
|
348
|
+
return { outcome: 'ALREADY_APPLIED', taskId, reason: 'oldString and newString are identical' };
|
|
349
|
+
}
|
|
350
|
+
// Count occurrences of oldString in content
|
|
351
|
+
let oldCount = 0;
|
|
352
|
+
let idx = 0;
|
|
353
|
+
while ((idx = content.indexOf(oldString, idx)) !== -1) {
|
|
354
|
+
oldCount++;
|
|
355
|
+
idx += oldString.length;
|
|
356
|
+
}
|
|
357
|
+
// If oldString not found, check if newString is already present (edit was already applied)
|
|
358
|
+
if (oldCount === 0) {
|
|
359
|
+
if (content.includes(newString)) {
|
|
360
|
+
return { outcome: 'ALREADY_APPLIED', taskId, reason: 'oldString not found but newString is present — edit was already applied' };
|
|
361
|
+
}
|
|
362
|
+
return { outcome: 'CONFLICT', reason: 'oldString not found in content — file was modified externally' };
|
|
363
|
+
}
|
|
364
|
+
if (oldCount > 1) {
|
|
365
|
+
return { outcome: 'CONFLICT', reason: `oldString found ${oldCount} times — need more context to disambiguate` };
|
|
366
|
+
}
|
|
367
|
+
// oldString found exactly once → safe to replace
|
|
368
|
+
return { outcome: 'EDITABLE', taskId };
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Marks a task as completed and records a file fingerprint.
|
|
373
|
+
* Only valid in EXECUTING_INLINE or EXECUTING_SUBAGENTS states.
|
|
374
|
+
*/
|
|
375
|
+
async completeTask({ taskId, filePath, fileHash } = {}) {
|
|
376
|
+
this.#load();
|
|
377
|
+
if (this.#state.state !== 'EXECUTING_INLINE' && this.#state.state !== 'EXECUTING_SUBAGENTS') {
|
|
378
|
+
return { error: `Cannot complete task from state ${this.#state.state}` };
|
|
379
|
+
}
|
|
380
|
+
if (!taskId) return { error: 'taskId is required' };
|
|
381
|
+
if (!this.#state.tasks) this.#state.tasks = {};
|
|
382
|
+
this.#state.tasks[taskId] = {
|
|
383
|
+
status: 'COMPLETED',
|
|
384
|
+
completedAt: new Date().toISOString(),
|
|
385
|
+
filePath: filePath || null,
|
|
386
|
+
fileHash: fileHash || null,
|
|
672
387
|
};
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
if (!isActionAuthorized(this.#state.state, action)) {
|
|
677
|
-
return {
|
|
678
|
-
status: RESULTS.INVALID_TRANSITION,
|
|
679
|
-
state: this.#state.state,
|
|
680
|
-
revision: this.#state.revision,
|
|
681
|
-
reason: `Action ${action} not authorized from state ${this.#state.state}`,
|
|
682
|
-
allowed: false,
|
|
683
|
-
};
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
return {
|
|
687
|
-
status: RESULTS.OK,
|
|
688
|
-
state: this.#state.state,
|
|
689
|
-
revision: this.#state.revision,
|
|
690
|
-
allowed: true,
|
|
691
|
-
};
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
/**
|
|
695
|
-
* Validate an edit operation before applying it.
|
|
696
|
-
* Pure function — does not depend on persisted state.
|
|
697
|
-
*
|
|
698
|
-
* @param {Object} params
|
|
699
|
-
* @param {string} params.oldString
|
|
700
|
-
* @param {string} params.newString
|
|
701
|
-
* @param {string} params.content - Fresh file content
|
|
702
|
-
* @returns {{status: string, reason?: string}}
|
|
703
|
-
*/
|
|
704
|
-
validateEdit({ oldString, newString, content } = {}) {
|
|
705
|
-
// Same content → already applied
|
|
706
|
-
if (oldString === newString) {
|
|
707
|
-
return { status: RESULTS.ALREADY_APPLIED, reason: "oldString equals newString" };
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
const oldPresent = content.includes(oldString);
|
|
711
|
-
const newPresent = content.includes(newString);
|
|
712
|
-
|
|
713
|
-
if (oldPresent) {
|
|
714
|
-
return { status: RESULTS.EDITABLE };
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
// old not present
|
|
718
|
-
if (newPresent) {
|
|
719
|
-
return { status: RESULTS.ALREADY_APPLIED, reason: "newString already present in content" };
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
// Neither old nor new present
|
|
723
|
-
return { status: RESULTS.CONFLICT, reason: "oldString not found and newString not present" };
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
/**
|
|
727
|
-
* Mark a task as completed.
|
|
728
|
-
* @param {Object} params
|
|
729
|
-
* @param {string} params.taskId
|
|
730
|
-
* @param {string} [params.note] - Optional note
|
|
731
|
-
* @returns {Promise<{status: string, state: string, revision: number, taskState: Object}>}
|
|
732
|
-
*/
|
|
733
|
-
async completeTask({ taskId, note } = {}) {
|
|
734
|
-
this.#load();
|
|
735
|
-
|
|
736
|
-
const executingStates = [STATES.EXECUTING_INLINE, STATES.EXECUTING_SUBAGENTS];
|
|
737
|
-
if (!executingStates.includes(this.#state.state)) {
|
|
738
|
-
return {
|
|
739
|
-
status: RESULTS.INVALID_TRANSITION,
|
|
740
|
-
state: this.#state.state,
|
|
741
|
-
revision: this.#state.revision,
|
|
742
|
-
reason: `Cannot complete task from state ${this.#state.state}`,
|
|
743
|
-
};
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
const taskState = {
|
|
747
|
-
completedAt: new Date().toISOString(),
|
|
748
|
-
note: note || null,
|
|
749
|
-
revision: this.#state.revision,
|
|
750
|
-
};
|
|
751
|
-
|
|
752
|
-
this.#state.tasks[taskId] = taskState;
|
|
753
|
-
this.#persist();
|
|
754
|
-
|
|
755
|
-
return {
|
|
756
|
-
status: RESULTS.OK,
|
|
757
|
-
state: this.#state.state,
|
|
758
|
-
revision: this.#state.revision,
|
|
759
|
-
taskState,
|
|
760
|
-
};
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
/**
|
|
764
|
-
* Transition to BLOCKED state.
|
|
765
|
-
* @param {Object} params
|
|
766
|
-
* @param {string} [params.reason]
|
|
767
|
-
* @returns {Promise<{status: string, state: string, revision: number}>}
|
|
768
|
-
*/
|
|
769
|
-
async block({ reason } = {}) {
|
|
770
|
-
this.#load();
|
|
771
|
-
const to = isAllowedTransition(this.#state.state, "block");
|
|
772
|
-
if (!to) {
|
|
773
|
-
return {
|
|
774
|
-
status: RESULTS.INVALID_TRANSITION,
|
|
775
|
-
state: this.#state.state,
|
|
776
|
-
revision: this.#state.revision,
|
|
777
|
-
reason: `Cannot block from state ${this.#state.state}`,
|
|
778
|
-
};
|
|
779
|
-
}
|
|
780
|
-
this.#transition(to, { error: reason || "Blocked" });
|
|
781
|
-
return { status: RESULTS.OK, state: this.#state.state, revision: this.#state.revision };
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
/**
|
|
785
|
-
* Replan: transition from BLOCKED back to INTERPRETATION_PENDING.
|
|
786
|
-
* @param {Object} params
|
|
787
|
-
* @param {string} [params.reason]
|
|
788
|
-
* @returns {Promise<{status: string, state: string, revision: number}>}
|
|
789
|
-
*/
|
|
790
|
-
async replan({ reason } = {}) {
|
|
791
|
-
this.#load();
|
|
792
|
-
const to = isAllowedTransition(this.#state.state, "replan");
|
|
793
|
-
if (!to) {
|
|
794
|
-
return {
|
|
795
|
-
status: RESULTS.INVALID_TRANSITION,
|
|
796
|
-
state: this.#state.state,
|
|
797
|
-
revision: this.#state.revision,
|
|
798
|
-
reason: `Cannot replan from state ${this.#state.state}`,
|
|
799
|
-
};
|
|
800
|
-
}
|
|
801
|
-
this.#transition(to, {
|
|
802
|
-
error: reason || null,
|
|
803
|
-
// Preserve requestId and changeId, but reset workflow state
|
|
804
|
-
routeDecisionId: null,
|
|
805
|
-
routeChoice: null,
|
|
806
|
-
executionDecisionId: null,
|
|
807
|
-
executionMode: null,
|
|
808
|
-
snapshots: { codegraph: null, execution: null },
|
|
809
|
-
tasks: {},
|
|
810
|
-
fileFingerprints: {},
|
|
811
|
-
});
|
|
812
|
-
return { status: RESULTS.OK, state: this.#state.state, revision: this.#state.revision };
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
/**
|
|
816
|
-
* Transition to SYNC state (implementation complete).
|
|
817
|
-
* @returns {Promise<{status: string, state: string, revision: number}>}
|
|
818
|
-
*/
|
|
819
|
-
async implementationComplete() {
|
|
820
|
-
this.#load();
|
|
821
|
-
const to = isAllowedTransition(this.#state.state, "implementation_complete");
|
|
822
|
-
if (!to) {
|
|
823
|
-
return {
|
|
824
|
-
status: RESULTS.INVALID_TRANSITION,
|
|
825
|
-
state: this.#state.state,
|
|
826
|
-
revision: this.#state.revision,
|
|
827
|
-
reason: `Cannot complete implementation from state ${this.#state.state}`,
|
|
828
|
-
};
|
|
829
|
-
}
|
|
830
|
-
this.#transition(to);
|
|
831
|
-
return { status: RESULTS.OK, state: this.#state.state, revision: this.#state.revision };
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
/**
|
|
835
|
-
* Transition to DONE (sync complete).
|
|
836
|
-
* @returns {Promise<{status: string, state: string, revision: number}>}
|
|
837
|
-
*/
|
|
838
|
-
async syncComplete() {
|
|
839
|
-
this.#load();
|
|
840
|
-
const to = isAllowedTransition(this.#state.state, "sync_complete");
|
|
841
|
-
if (!to) {
|
|
842
|
-
return {
|
|
843
|
-
status: RESULTS.INVALID_TRANSITION,
|
|
844
|
-
state: this.#state.state,
|
|
845
|
-
revision: this.#state.revision,
|
|
846
|
-
reason: `Cannot complete sync from state ${this.#state.state}`,
|
|
847
|
-
};
|
|
848
|
-
}
|
|
849
|
-
this.#transition(to);
|
|
850
|
-
return { status: RESULTS.OK, state: this.#state.state, revision: this.#state.revision };
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
/**
|
|
854
|
-
* Get current state (reads from persistent store).
|
|
855
|
-
* @returns {Promise<Object>}
|
|
856
|
-
*/
|
|
857
|
-
async getState() {
|
|
858
|
-
this.#load();
|
|
859
|
-
return { ...this.#state };
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
/**
|
|
863
|
-
* Get current task states.
|
|
864
|
-
* @returns {Promise<Object>}
|
|
865
|
-
*/
|
|
866
|
-
async getTasks() {
|
|
867
|
-
this.#load();
|
|
868
|
-
return { ...this.#state.tasks };
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
/**
|
|
872
|
-
* Record a CodeGraph snapshot for reuse across phases.
|
|
873
|
-
* @param {Object} snapshot - The CodeGraph context/impact/trace data
|
|
874
|
-
* @returns {Promise<{status: string, revision: number}>}
|
|
875
|
-
*/
|
|
876
|
-
async recordCodegraphSnapshot(snapshot) {
|
|
877
|
-
this.#load();
|
|
878
|
-
this.#state.snapshots = {
|
|
879
|
-
...this.#state.snapshots,
|
|
880
|
-
codegraph: {
|
|
881
|
-
data: snapshot,
|
|
882
|
-
capturedAt: new Date().toISOString(),
|
|
883
|
-
revision: this.#state.revision,
|
|
884
|
-
},
|
|
885
|
-
};
|
|
886
|
-
// Track used CodeGraph calls for instrumentation
|
|
887
|
-
if (snapshot?.calls) {
|
|
888
|
-
this.#state.lastCodegraphCalls = snapshot.calls;
|
|
889
|
-
}
|
|
890
|
-
this.#persist();
|
|
891
|
-
return { status: RESULTS.OK, revision: this.#state.revision };
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
/**
|
|
895
|
-
* Get the stored CodeGraph snapshot, or null if none.
|
|
896
|
-
* @returns {Promise<Object|null>}
|
|
897
|
-
*/
|
|
898
|
-
async getCodegraphSnapshot() {
|
|
899
|
-
this.#load();
|
|
900
|
-
return this.#state.snapshots?.codegraph || null;
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
/**
|
|
904
|
-
* Record file fingerprints (mtime + size) for staleness detection.
|
|
905
|
-
* @param {Object<string, {mtime: number, size: number}>} fingerprints - File path → fingerprint
|
|
906
|
-
* @returns {Promise<{status: string, revision: number}>}
|
|
907
|
-
*/
|
|
908
|
-
async recordFileFingerprints(fingerprints) {
|
|
909
|
-
this.#load();
|
|
910
|
-
Object.assign(this.#state.fileFingerprints, fingerprints);
|
|
911
|
-
this.#persist();
|
|
912
|
-
return { status: RESULTS.OK, revision: this.#state.revision };
|
|
913
|
-
}
|
|
914
|
-
|
|
915
|
-
/**
|
|
916
|
-
* Validate a snapshot revision AND file fingerprints for staleness.
|
|
917
|
-
* Returns REPLAN_REQUIRED if revision doesn't match or fingerprints changed.
|
|
918
|
-
* @param {number} snapshotRevision
|
|
919
|
-
* @param {Object<string, {mtime: number, size: number}>} [currentFingerprints]
|
|
920
|
-
* @returns {Promise<{valid: boolean, status?: string, currentRevision: number, staleFingerprints?: string[]}>}
|
|
921
|
-
*/
|
|
922
|
-
async validateSnapshot(snapshotRevision, currentFingerprints) {
|
|
923
|
-
this.#load();
|
|
924
|
-
const result = {
|
|
925
|
-
valid: true,
|
|
926
|
-
currentRevision: this.#state.revision,
|
|
927
|
-
};
|
|
928
|
-
|
|
929
|
-
if (snapshotRevision !== this.#state.revision) {
|
|
930
|
-
result.valid = false;
|
|
931
|
-
result.status = RESULTS.REPLAN_REQUIRED;
|
|
932
|
-
return result;
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
if (currentFingerprints && this.#state.fileFingerprints) {
|
|
936
|
-
const stale = [];
|
|
937
|
-
for (const [file, fp] of Object.entries(currentFingerprints)) {
|
|
938
|
-
const stored = this.#state.fileFingerprints[file];
|
|
939
|
-
if (stored && (stored.mtime !== fp.mtime || stored.size !== fp.size)) {
|
|
940
|
-
stale.push(file);
|
|
388
|
+
if (filePath && fileHash) {
|
|
389
|
+
if (!this.#state.fileFingerprints) this.#state.fileFingerprints = {};
|
|
390
|
+
this.#state.fileFingerprints[filePath] = fileHash;
|
|
941
391
|
}
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
result.status = RESULTS.REPLAN_REQUIRED;
|
|
946
|
-
result.staleFingerprints = stale;
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
if (!result.valid) {
|
|
951
|
-
result.status = result.status || RESULTS.REPLAN_REQUIRED;
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
return result;
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
/**
|
|
958
|
-
* Record a stable key for Engram boundary persistence.
|
|
959
|
-
* @param {Object} params
|
|
960
|
-
* @param {string} params.changeKey - e.g. "change/redesign-ostacky-orchestration"
|
|
961
|
-
* @param {string} [params.taskKey] - e.g. "task/controller-core"
|
|
962
|
-
* @returns {Promise<{status: string}>}
|
|
963
|
-
*/
|
|
964
|
-
async recordEngramKey({ changeKey, taskKey } = {}) {
|
|
965
|
-
this.#load();
|
|
966
|
-
if (changeKey) this.#state.changeKey = changeKey;
|
|
967
|
-
if (taskKey) this.#state.taskKey = taskKey;
|
|
968
|
-
this.#persist();
|
|
969
|
-
return { status: RESULTS.OK };
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
/**
|
|
973
|
-
* Get stored Engram keys.
|
|
974
|
-
* @returns {Promise<{changeKey?: string, taskKey?: string}>}
|
|
975
|
-
*/
|
|
976
|
-
async getEngramKeys() {
|
|
977
|
-
this.#load();
|
|
978
|
-
return {
|
|
979
|
-
changeKey: this.#state.changeKey,
|
|
980
|
-
taskKey: this.#state.taskKey,
|
|
981
|
-
};
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
/**
|
|
985
|
-
* Increment an instrumentation counter.
|
|
986
|
-
* @param {string} name - Counter name (e.g. "codegraph_calls", "engram_calls", "subagent_dispatches")
|
|
987
|
-
* @param {number} [by=1] - Increment amount
|
|
988
|
-
* @returns {Promise<number>} - New counter value
|
|
989
|
-
*/
|
|
990
|
-
async incrementCounter(name, by = 1) {
|
|
991
|
-
this.#load();
|
|
992
|
-
if (!this.#state.counters) this.#state.counters = {};
|
|
993
|
-
this.#state.counters[name] = (this.#state.counters[name] || 0) + by;
|
|
994
|
-
this.#persist();
|
|
995
|
-
return this.#state.counters[name];
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
/**
|
|
999
|
-
* Get all instrumentation counters.
|
|
1000
|
-
* @returns {Promise<Object<string, number>>}
|
|
1001
|
-
*/
|
|
1002
|
-
async getCounters() {
|
|
1003
|
-
this.#load();
|
|
1004
|
-
return { ...(this.#state.counters || {}) };
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
/**
|
|
1008
|
-
* Reset all instrumentation counters.
|
|
1009
|
-
* @returns {Promise<{status: string}>}
|
|
1010
|
-
*/
|
|
1011
|
-
async resetCounters() {
|
|
1012
|
-
this.#load();
|
|
1013
|
-
this.#state.counters = {};
|
|
1014
|
-
this.#persist();
|
|
1015
|
-
return { status: RESULTS.OK };
|
|
1016
|
-
}
|
|
392
|
+
this.#persist();
|
|
393
|
+
return { taskId, status: 'COMPLETED', totalCompleted: Object.keys(this.#state.tasks).filter(k => this.#state.tasks[k].status === 'COMPLETED').length };
|
|
394
|
+
}
|
|
1017
395
|
}
|
|
396
|
+
|
|
397
|
+
const statePath = process.env.OSTACKY_STATE_PATH || '.opencode/ostacky-state.json';
|
|
398
|
+
const controller = new OstackyController({ statePath });
|
|
399
|
+
|
|
400
|
+
const server = new McpServer({
|
|
401
|
+
name: 'ostacky-controller',
|
|
402
|
+
version: '0.5.6',
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
server.registerTool(
|
|
406
|
+
'start_request',
|
|
407
|
+
{
|
|
408
|
+
description: 'Start or resume a new request in the state machine. Call this first.',
|
|
409
|
+
inputSchema: z.object({
|
|
410
|
+
requestId: z.string().optional().describe('Unique request ID'),
|
|
411
|
+
changeId: z.string().optional().describe('Optional change ID for OpenSpec tracking'),
|
|
412
|
+
}),
|
|
413
|
+
},
|
|
414
|
+
async ({ requestId, changeId }) => {
|
|
415
|
+
log('tool:start_request');
|
|
416
|
+
const result = await controller.startRequest({ requestId, changeId });
|
|
417
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
418
|
+
}
|
|
419
|
+
);
|
|
420
|
+
|
|
421
|
+
server.registerTool(
|
|
422
|
+
'request_clarification',
|
|
423
|
+
{
|
|
424
|
+
description: 'Record that clarification was requested. Transitions to CLARIFICATION_PENDING.',
|
|
425
|
+
inputSchema: z.object({
|
|
426
|
+
question: z.string().optional().describe('The clarification question'),
|
|
427
|
+
}),
|
|
428
|
+
},
|
|
429
|
+
async ({ question }) => {
|
|
430
|
+
log('tool:request_clarification');
|
|
431
|
+
const result = await controller.requestClarification({ question });
|
|
432
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
433
|
+
}
|
|
434
|
+
);
|
|
435
|
+
|
|
436
|
+
server.registerTool(
|
|
437
|
+
'record_clarification',
|
|
438
|
+
{
|
|
439
|
+
description: 'Record that clarification was answered. Transitions to DISCOVERY.',
|
|
440
|
+
inputSchema: z.object({}),
|
|
441
|
+
},
|
|
442
|
+
async () => {
|
|
443
|
+
log('tool:record_clarification');
|
|
444
|
+
const result = await controller.recordClarification();
|
|
445
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
446
|
+
}
|
|
447
|
+
);
|
|
448
|
+
|
|
449
|
+
server.registerTool(
|
|
450
|
+
'record_discovery',
|
|
451
|
+
{
|
|
452
|
+
description: 'Record discovery complete with level classification. Transitions to ROUTE_DECISION_PENDING.',
|
|
453
|
+
inputSchema: z.object({
|
|
454
|
+
level: z.enum(['0', '0+1', '1+']).describe('Impact level'),
|
|
455
|
+
routeDecisionId: z.string().optional().describe('Unique route decision ID'),
|
|
456
|
+
snapshot: z.any().optional().describe('Optional CodeGraph snapshot'),
|
|
457
|
+
}),
|
|
458
|
+
},
|
|
459
|
+
async ({ level, routeDecisionId, snapshot }) => {
|
|
460
|
+
log('tool:record_discovery', { level });
|
|
461
|
+
const result = await controller.recordDiscovery({ level, routeDecisionId, snapshot });
|
|
462
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
463
|
+
}
|
|
464
|
+
);
|
|
465
|
+
|
|
466
|
+
server.registerTool(
|
|
467
|
+
'consume_route_decision',
|
|
468
|
+
{
|
|
469
|
+
description: 'Consume the route decision (SPEC or DIRECT). Valid only in ROUTE_DECISION_PENDING.',
|
|
470
|
+
inputSchema: z.object({
|
|
471
|
+
decisionId: z.string().describe('Route decision ID from record_discovery'),
|
|
472
|
+
choice: z.enum(['SPEC', 'DIRECT']).describe('Route choice'),
|
|
473
|
+
}),
|
|
474
|
+
},
|
|
475
|
+
async ({ decisionId, choice }) => {
|
|
476
|
+
log('tool:consume_route_decision', { choice });
|
|
477
|
+
const result = await controller.consumeRouteDecision({ decisionId, choice });
|
|
478
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
479
|
+
}
|
|
480
|
+
);
|
|
481
|
+
|
|
482
|
+
server.registerTool(
|
|
483
|
+
'spec_complete',
|
|
484
|
+
{
|
|
485
|
+
description: 'Mark specification phase as complete. Transitions to EXECUTION_ANALYSIS.',
|
|
486
|
+
inputSchema: z.object({}),
|
|
487
|
+
},
|
|
488
|
+
async () => {
|
|
489
|
+
log('tool:spec_complete');
|
|
490
|
+
const result = await controller.specComplete();
|
|
491
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
492
|
+
}
|
|
493
|
+
);
|
|
494
|
+
|
|
495
|
+
server.registerTool(
|
|
496
|
+
'record_execution_analysis',
|
|
497
|
+
{
|
|
498
|
+
description: 'Record execution analysis with snapshot. Transitions to EXECUTION_DECISION_PENDING.',
|
|
499
|
+
inputSchema: z.object({
|
|
500
|
+
executionDecisionId: z.string().optional().describe('Unique execution decision ID'),
|
|
501
|
+
snapshot: z.any().optional().describe('Execution analysis snapshot'),
|
|
502
|
+
}),
|
|
503
|
+
},
|
|
504
|
+
async ({ executionDecisionId, snapshot }) => {
|
|
505
|
+
log('tool:record_execution_analysis');
|
|
506
|
+
const result = await controller.recordExecutionAnalysis({ executionDecisionId, snapshot });
|
|
507
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
508
|
+
}
|
|
509
|
+
);
|
|
510
|
+
|
|
511
|
+
server.registerTool(
|
|
512
|
+
'consume_execution_decision',
|
|
513
|
+
{
|
|
514
|
+
description: 'Consume the execution mode decision (INLINE or SUBAGENT_DRIVEN).',
|
|
515
|
+
inputSchema: z.object({
|
|
516
|
+
decisionId: z.string().describe('Execution decision ID from record_execution_analysis'),
|
|
517
|
+
mode: z.enum(['INLINE', 'SUBAGENT_DRIVEN']).describe('Execution mode'),
|
|
518
|
+
}),
|
|
519
|
+
},
|
|
520
|
+
async ({ decisionId, mode }) => {
|
|
521
|
+
log('tool:consume_execution_decision', { mode });
|
|
522
|
+
const result = await controller.consumeExecutionDecision({ decisionId, mode });
|
|
523
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
524
|
+
}
|
|
525
|
+
);
|
|
526
|
+
|
|
527
|
+
server.registerTool(
|
|
528
|
+
'implementation_complete',
|
|
529
|
+
{
|
|
530
|
+
description: 'Mark implementation as complete. Transitions to SYNC.',
|
|
531
|
+
inputSchema: z.object({}),
|
|
532
|
+
},
|
|
533
|
+
async () => {
|
|
534
|
+
log('tool:implementation_complete');
|
|
535
|
+
const result = await controller.implementationComplete();
|
|
536
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
537
|
+
}
|
|
538
|
+
);
|
|
539
|
+
|
|
540
|
+
server.registerTool(
|
|
541
|
+
'sync_complete',
|
|
542
|
+
{
|
|
543
|
+
description: 'Mark sync as complete. Transitions to DONE.',
|
|
544
|
+
inputSchema: z.object({}),
|
|
545
|
+
},
|
|
546
|
+
async () => {
|
|
547
|
+
log('tool:sync_complete');
|
|
548
|
+
const result = await controller.syncComplete();
|
|
549
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
550
|
+
}
|
|
551
|
+
);
|
|
552
|
+
|
|
553
|
+
server.registerTool(
|
|
554
|
+
'block',
|
|
555
|
+
{
|
|
556
|
+
description: 'Transition to BLOCKED state with an optional reason.',
|
|
557
|
+
inputSchema: z.object({
|
|
558
|
+
reason: z.string().optional().describe('Reason for blocking'),
|
|
559
|
+
}),
|
|
560
|
+
},
|
|
561
|
+
async ({ reason }) => {
|
|
562
|
+
log('tool:block');
|
|
563
|
+
const result = await controller.block({ reason });
|
|
564
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
565
|
+
}
|
|
566
|
+
);
|
|
567
|
+
|
|
568
|
+
server.registerTool(
|
|
569
|
+
'replan',
|
|
570
|
+
{
|
|
571
|
+
description: 'Replan from BLOCKED state back to INTERPRETATION_PENDING.',
|
|
572
|
+
inputSchema: z.object({
|
|
573
|
+
reason: z.string().optional().describe('Reason for replanning'),
|
|
574
|
+
}),
|
|
575
|
+
},
|
|
576
|
+
async ({ reason }) => {
|
|
577
|
+
log('tool:replan');
|
|
578
|
+
const result = await controller.replan({ reason });
|
|
579
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
580
|
+
}
|
|
581
|
+
);
|
|
582
|
+
|
|
583
|
+
server.registerTool(
|
|
584
|
+
'get_state',
|
|
585
|
+
{
|
|
586
|
+
description: 'Get the current controller state (reads persistent store).',
|
|
587
|
+
inputSchema: z.object({}),
|
|
588
|
+
},
|
|
589
|
+
async () => {
|
|
590
|
+
const result = await controller.getState();
|
|
591
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
592
|
+
}
|
|
593
|
+
);
|
|
594
|
+
|
|
595
|
+
server.registerTool(
|
|
596
|
+
'get_tasks',
|
|
597
|
+
{
|
|
598
|
+
description: 'Get current task states.',
|
|
599
|
+
inputSchema: z.object({}),
|
|
600
|
+
},
|
|
601
|
+
async () => {
|
|
602
|
+
const result = await controller.getTasks();
|
|
603
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
604
|
+
}
|
|
605
|
+
);
|
|
606
|
+
|
|
607
|
+
server.registerTool(
|
|
608
|
+
'validate_edit',
|
|
609
|
+
{
|
|
610
|
+
description:
|
|
611
|
+
'Validate an edit against current file content. Returns EDITABLE, ALREADY_APPLIED, or CONFLICT. ' +
|
|
612
|
+
'Call BEFORE executing an edit tool. Only valid in EXECUTING_INLINE or EXECUTING_SUBAGENTS states.',
|
|
613
|
+
inputSchema: z.object({
|
|
614
|
+
oldString: z.string().describe('The exact string to find in content (must be unique).'),
|
|
615
|
+
newString: z.string().describe('The replacement string.'),
|
|
616
|
+
content: z.string().describe('The current file content (read fresh with Read tool).'),
|
|
617
|
+
taskId: z.string().optional().describe('Optional task ID for tracking.'),
|
|
618
|
+
}),
|
|
619
|
+
},
|
|
620
|
+
async ({ oldString, newString, content, taskId }) => {
|
|
621
|
+
log('tool:validate_edit', { taskId, oldLen: oldString.length, newLen: newString.length });
|
|
622
|
+
const result = await controller.validateEdit({ oldString, newString, content, taskId });
|
|
623
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
624
|
+
}
|
|
625
|
+
);
|
|
626
|
+
|
|
627
|
+
server.registerTool(
|
|
628
|
+
'complete_task',
|
|
629
|
+
{
|
|
630
|
+
description:
|
|
631
|
+
'Mark a task as completed and optionally record a file fingerprint. ' +
|
|
632
|
+
'Only valid in EXECUTING_INLINE or EXECUTING_SUBAGENTS states.',
|
|
633
|
+
inputSchema: z.object({
|
|
634
|
+
taskId: z.string().describe('The task ID to mark as completed.'),
|
|
635
|
+
filePath: z.string().optional().describe('Optional file path that was modified.'),
|
|
636
|
+
fileHash: z.string().optional().describe('Optional SHA-256 hash of the file after modification.'),
|
|
637
|
+
}),
|
|
638
|
+
},
|
|
639
|
+
async ({ taskId, filePath, fileHash }) => {
|
|
640
|
+
log('tool:complete_task', { taskId, filePath });
|
|
641
|
+
const result = await controller.completeTask({ taskId, filePath, fileHash });
|
|
642
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
643
|
+
}
|
|
644
|
+
);
|
|
645
|
+
|
|
646
|
+
async function main() {
|
|
647
|
+
log('Starting ostacky-controller MCP...');
|
|
648
|
+
log('State path:', { path: statePath });
|
|
649
|
+
const transport = new StdioServerTransport();
|
|
650
|
+
await server.connect(transport);
|
|
651
|
+
log('ostacky-controller connected and ready');
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
main().catch((error) => {
|
|
655
|
+
console.error('Fatal error:', error);
|
|
656
|
+
process.exit(1);
|
|
657
|
+
});
|