apexrest 0.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (461) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +18 -0
  3. package/README.md +201 -0
  4. package/README.uk.md +201 -0
  5. package/dist/codex-compat/.agents/plugins/marketplace.json +23 -0
  6. package/dist/codex-compat/plugins/apexrest-apex/.codex-plugin/plugin.json +32 -0
  7. package/dist/codex-compat/plugins/apexrest-apex/.mcp.json +11 -0
  8. package/dist/codex-compat/plugins/apexrest-apex/LICENSE +202 -0
  9. package/dist/codex-compat/plugins/apexrest-apex/NOTICE +18 -0
  10. package/dist/codex-compat/plugins/apexrest-apex/assets/apexrest-icon.svg +27 -0
  11. package/dist/codex-compat/plugins/apexrest-apex/assets/apexrest-logo.svg +27 -0
  12. package/dist/codex-compat/plugins/apexrest-apex/resources/ords/OrdsBridge.java +323 -0
  13. package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/LICENCE.txt +118 -0
  14. package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/bulbasaur.png +0 -0
  15. package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/charmander.png +0 -0
  16. package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/mewtwo.png +0 -0
  17. package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/pikachu.png +0 -0
  18. package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/sources.json +36 -0
  19. package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/squirtle.png +0 -0
  20. package/dist/codex-compat/plugins/apexrest-apex/resources/panel/index.html +68 -0
  21. package/dist/codex-compat/plugins/apexrest-apex/resources/panel/panel.css +805 -0
  22. package/dist/codex-compat/plugins/apexrest-apex/resources/panel/panel.js +951 -0
  23. package/dist/codex-compat/plugins/apexrest-apex/resources/playwright/auth.mjs +17 -0
  24. package/dist/codex-compat/plugins/apexrest-apex/resources/playwright/package-lock.json +57 -0
  25. package/dist/codex-compat/plugins/apexrest-apex/resources/playwright/package.json +9 -0
  26. package/dist/codex-compat/plugins/apexrest-apex/resources/references/ORACLE-LICENSE.txt +35 -0
  27. package/dist/codex-compat/plugins/apexrest-apex/resources/references/index.json +54432 -0
  28. package/dist/codex-compat/plugins/apexrest-apex/resources/references/oracle-snapshot.json +648 -0
  29. package/dist/codex-compat/plugins/apexrest-apex/resources/references/search.json +1 -0
  30. package/dist/codex-compat/plugins/apexrest-apex/resources/schemas/deploy-plan.schema.json +210 -0
  31. package/dist/codex-compat/plugins/apexrest-apex/resources/schemas/operations.schema.json +1721 -0
  32. package/dist/codex-compat/plugins/apexrest-apex/resources/schemas/policy.schema.json +63 -0
  33. package/dist/codex-compat/plugins/apexrest-apex/resources/schemas/project.schema.json +250 -0
  34. package/dist/codex-compat/plugins/apexrest-apex/resources/schemas/toolchain-lock.schema.json +118 -0
  35. package/dist/codex-compat/plugins/apexrest-apex/resources/schemas/vendor/mcp.schema.json +120 -0
  36. package/dist/codex-compat/plugins/apexrest-apex/resources/schemas/vendor/plugin.schema.json +65 -0
  37. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/README.md +5 -0
  38. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/README.uk.md +5 -0
  39. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/.apex/apexlang.json +3 -0
  40. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/application.apx +51 -0
  41. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/deployments/default.json +2 -0
  42. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/page-groups.apx +4 -0
  43. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/pages/p00000-global-page.apx +4 -0
  44. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/pages/p00001-home.apx +35 -0
  45. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/pages/p09999-login.apx +254 -0
  46. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/authentications.apx +5 -0
  47. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/authorizations.apx +11 -0
  48. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/breadcrumbs.apx +18 -0
  49. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/build-options.apx +4 -0
  50. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/component-settings.apx +92 -0
  51. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/lists.apx +81 -0
  52. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/lovs.apx +20 -0
  53. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-144-rounded.png +0 -0
  54. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-192.png +0 -0
  55. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-256-rounded.png +0 -0
  56. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-32.png +0 -0
  57. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-512.png +0 -0
  58. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/static-files.apx +25 -0
  59. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/themes/universal-theme/theme.apx +57 -0
  60. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/supporting-objects/deinstall-script.sql +0 -0
  61. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/supporting-objects/supporting-objects.apx +9 -0
  62. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/README.md +7 -0
  63. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/README.uk.md +7 -0
  64. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/apex-overlay/pages/p00010-customers.apx +164 -0
  65. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/apex-overlay/pages/p00020-dashboard.apx +54 -0
  66. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/apex-overlay/pages/p00080-customer.apx +332 -0
  67. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/project/src/database/migrations/0001__customers.sql +10 -0
  68. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/project/src/database/packages/0010__customer_api.sql +28 -0
  69. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/project/src/database/packages/0020__customer_validation_trigger.sql +10 -0
  70. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/project/tests/e2e/customer-crud.spec.mjs +25 -0
  71. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/project/tests/sql/test_customers.sql +49 -0
  72. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/database-control/install.sql +17 -0
  73. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/existing-app/README.md +9 -0
  74. package/dist/codex-compat/plugins/apexrest-apex/resources/templates/existing-app/README.uk.md +9 -0
  75. package/dist/codex-compat/plugins/apexrest-apex/resources/testkit/apex.mjs +58 -0
  76. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__@hono__node-server__LICENSE +21 -0
  77. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__@isaacs__fs-minipass__LICENSE +15 -0
  78. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__@modelcontextprotocol__sdk__LICENSE +21 -0
  79. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__@playwright__test__LICENSE +202 -0
  80. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__@playwright__test__NOTICE +5 -0
  81. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__@types__node__LICENSE +21 -0
  82. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__@types__yauzl__LICENSE +21 -0
  83. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__@typescript__typescript-darwin-arm64__LICENSE +55 -0
  84. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__@typescript__typescript-darwin-arm64__NOTICE.txt +436 -0
  85. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__accepts__LICENSE +23 -0
  86. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__ajv-formats__LICENSE +21 -0
  87. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__ajv__LICENSE +22 -0
  88. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__body-parser__LICENSE +23 -0
  89. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__body-parser__node_modules__content-type__LICENSE +22 -0
  90. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__bytes__LICENSE +23 -0
  91. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__call-bind-apply-helpers__LICENSE +21 -0
  92. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__call-bound__LICENSE +21 -0
  93. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__chownr__LICENSE.md +63 -0
  94. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__content-disposition__LICENSE +22 -0
  95. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__content-type__LICENSE +22 -0
  96. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__cookie-signature__LICENSE +22 -0
  97. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__cookie__LICENSE +24 -0
  98. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__cors__LICENSE +22 -0
  99. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__cross-spawn__LICENSE +21 -0
  100. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__debug__LICENSE +20 -0
  101. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__depd__LICENSE +22 -0
  102. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__dunder-proto__LICENSE +21 -0
  103. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__ee-first__LICENSE +22 -0
  104. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__encodeurl__LICENSE +22 -0
  105. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__es-define-property__LICENSE +21 -0
  106. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__es-errors__LICENSE +21 -0
  107. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__es-object-atoms__LICENSE +21 -0
  108. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__esbuild__LICENSE.md +21 -0
  109. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__escape-html__LICENSE +24 -0
  110. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__etag__LICENSE +22 -0
  111. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__eventsource-parser__LICENSE +21 -0
  112. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__eventsource__LICENSE +22 -0
  113. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__express-rate-limit__license +21 -0
  114. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__express__LICENSE +24 -0
  115. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__fast-deep-equal__LICENSE +21 -0
  116. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__fast-uri__LICENSE +30 -0
  117. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__fflate__LICENSE +21 -0
  118. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__finalhandler__LICENSE +22 -0
  119. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__forwarded__LICENSE +22 -0
  120. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__fresh__LICENSE +23 -0
  121. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__function-bind__LICENSE +20 -0
  122. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__get-intrinsic__LICENSE +21 -0
  123. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__get-proto__LICENSE +21 -0
  124. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__gopd__LICENSE +21 -0
  125. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__has-symbols__LICENSE +21 -0
  126. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__hasown__LICENSE +21 -0
  127. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__hono__LICENSE +21 -0
  128. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__http-errors__LICENSE +23 -0
  129. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__iconv-lite__LICENSE +21 -0
  130. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__inherits__LICENSE +16 -0
  131. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__ip-address__LICENSE +19 -0
  132. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__ipaddr.js__LICENSE +19 -0
  133. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__is-promise__LICENSE +19 -0
  134. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__isexe__LICENSE +15 -0
  135. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__jose__LICENSE.md +21 -0
  136. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__json-schema-traverse__LICENSE +21 -0
  137. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__json-schema-typed__LICENSE.md +57 -0
  138. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__marked__LICENSE +44 -0
  139. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__math-intrinsics__LICENSE +21 -0
  140. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__media-typer__LICENSE +22 -0
  141. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__merge-descriptors__license +11 -0
  142. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__mime-db__LICENSE +23 -0
  143. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__mime-types__LICENSE +23 -0
  144. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__minipass__LICENSE.md +55 -0
  145. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__minizlib__LICENSE +26 -0
  146. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__ms__license.md +21 -0
  147. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__negotiator__LICENSE +24 -0
  148. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__negotiator__node_modules__content-type__LICENSE +22 -0
  149. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__object-assign__license +21 -0
  150. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__object-inspect__LICENSE +21 -0
  151. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__on-finished__LICENSE +23 -0
  152. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__once__LICENSE +15 -0
  153. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__parseurl__LICENSE +24 -0
  154. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__path-key__license +9 -0
  155. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__path-to-regexp__LICENSE +21 -0
  156. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__pend__LICENSE +23 -0
  157. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__pkce-challenge__LICENSE +21 -0
  158. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__playwright-core__LICENSE +202 -0
  159. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__playwright-core__NOTICE +5 -0
  160. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__playwright__LICENSE +202 -0
  161. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__playwright__NOTICE +5 -0
  162. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__prettier__LICENSE +7 -0
  163. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__proxy-addr__LICENSE +22 -0
  164. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__qs__LICENSE.md +29 -0
  165. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__range-parser__LICENSE +23 -0
  166. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__raw-body__LICENSE +22 -0
  167. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__require-from-string__license +21 -0
  168. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__router__LICENSE +23 -0
  169. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__safer-buffer__LICENSE +21 -0
  170. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__send__LICENSE +23 -0
  171. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__serve-static__LICENSE +25 -0
  172. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__setprototypeof__LICENSE +13 -0
  173. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__shebang-command__license +9 -0
  174. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__shebang-regex__license +9 -0
  175. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__side-channel-list__LICENSE +21 -0
  176. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__side-channel-map__LICENSE +21 -0
  177. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__side-channel-weakmap__LICENSE +21 -0
  178. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__side-channel__LICENSE +21 -0
  179. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__statuses__LICENSE +23 -0
  180. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__tar__LICENSE.md +55 -0
  181. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__toidentifier__LICENSE +21 -0
  182. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__type-is__LICENSE +23 -0
  183. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__type-is__node_modules__content-type__LICENSE +22 -0
  184. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__typescript__LICENSE +55 -0
  185. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__typescript__NOTICE.txt +436 -0
  186. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__undici-types__LICENSE +21 -0
  187. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__unpipe__LICENSE +22 -0
  188. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__vary__LICENSE +22 -0
  189. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__which__LICENSE +15 -0
  190. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__wrappy__LICENSE +15 -0
  191. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__yallist__LICENSE.md +63 -0
  192. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__yauzl__LICENSE +21 -0
  193. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__zod-to-json-schema__LICENSE +15 -0
  194. package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__zod__LICENSE +21 -0
  195. package/dist/codex-compat/plugins/apexrest-apex/resources/toolchains/compatibility.json +50 -0
  196. package/dist/codex-compat/plugins/apexrest-apex/resources/toolchains/sources.lock.json +14 -0
  197. package/dist/codex-compat/plugins/apexrest-apex/resources/toolchains/toolchain.lock.json +204 -0
  198. package/dist/codex-compat/plugins/apexrest-apex/runtime/apexrest.mjs +226 -0
  199. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-2SZCZZ3J.mjs +37111 -0
  200. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-2VGE5Y5J.mjs +994 -0
  201. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-3GSS6SJH.mjs +1424 -0
  202. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-5GOWABKB.mjs +409 -0
  203. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-ARMO5ZAQ.mjs +25 -0
  204. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-ED2YPDPS.mjs +1123 -0
  205. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-FPOEB42H.mjs +100 -0
  206. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-GFRSRK3K.mjs +16 -0
  207. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-ICWYSHJ7.mjs +19 -0
  208. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-IPU64TJI.mjs +291 -0
  209. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-JWX4UQAZ.mjs +14 -0
  210. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-K3KT6RZY.mjs +1064 -0
  211. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-QLRGI23I.mjs +1307 -0
  212. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-RF4XQO6I.mjs +13 -0
  213. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-VPCUV5QA.mjs +237 -0
  214. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-WMJTK7ZB.mjs +201 -0
  215. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-WROK6RQH.mjs +200 -0
  216. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-XDJEGHUX.mjs +1179 -0
  217. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-YK34QNHH.mjs +15 -0
  218. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-Z6Y72JVG.mjs +37 -0
  219. package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-ZQFJ2BNZ.mjs +329 -0
  220. package/dist/codex-compat/plugins/apexrest-apex/runtime/mcp.mjs +15 -0
  221. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-apexlang/SKILL.md +32 -0
  222. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-apexlang/agents/openai.yaml +4 -0
  223. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-apexlang/assets/p00020-filtered-components.apx +152 -0
  224. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-apexlang/references/component-routes.md +35 -0
  225. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-apexlang/references/native-dashboard.md +11 -0
  226. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-database/SKILL.md +11 -0
  227. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-database/agents/openai.yaml +4 -0
  228. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-debug/SKILL.md +11 -0
  229. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-debug/agents/openai.yaml +4 -0
  230. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-deploy/SKILL.md +19 -0
  231. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-deploy/agents/openai.yaml +4 -0
  232. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-install-dependencies/SKILL.md +38 -0
  233. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-install-dependencies/agents/openai.yaml +4 -0
  234. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-menu/SKILL.md +27 -0
  235. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-menu/agents/openai.yaml +4 -0
  236. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-menu/references/cli-catalog.md +22 -0
  237. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-panel/SKILL.md +20 -0
  238. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-panel/agents/openai.yaml +4 -0
  239. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-project/SKILL.md +9 -0
  240. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-project/agents/openai.yaml +4 -0
  241. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-review/SKILL.md +9 -0
  242. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-review/agents/openai.yaml +4 -0
  243. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-setup/SKILL.md +15 -0
  244. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-setup/agents/openai.yaml +4 -0
  245. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-setup/references/ords.md +3 -0
  246. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-team/SKILL.md +24 -0
  247. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-team/agents/openai.yaml +4 -0
  248. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-test/SKILL.md +27 -0
  249. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-test/agents/openai.yaml +4 -0
  250. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-work/SKILL.md +17 -0
  251. package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-work/agents/openai.yaml +7 -0
  252. package/dist/resources/ords/OrdsBridge.java +323 -0
  253. package/dist/resources/panel/assets/LICENCE.txt +118 -0
  254. package/dist/resources/panel/assets/bulbasaur.png +0 -0
  255. package/dist/resources/panel/assets/charmander.png +0 -0
  256. package/dist/resources/panel/assets/mewtwo.png +0 -0
  257. package/dist/resources/panel/assets/pikachu.png +0 -0
  258. package/dist/resources/panel/assets/sources.json +36 -0
  259. package/dist/resources/panel/assets/squirtle.png +0 -0
  260. package/dist/resources/panel/index.html +68 -0
  261. package/dist/resources/panel/panel.css +805 -0
  262. package/dist/resources/panel/panel.js +951 -0
  263. package/dist/resources/playwright/auth.mjs +17 -0
  264. package/dist/resources/playwright/package-lock.json +57 -0
  265. package/dist/resources/playwright/package.json +9 -0
  266. package/dist/resources/references/ORACLE-LICENSE.txt +35 -0
  267. package/dist/resources/references/index.json +54432 -0
  268. package/dist/resources/references/oracle-snapshot.json +648 -0
  269. package/dist/resources/references/search.json +1 -0
  270. package/dist/resources/schemas/deploy-plan.schema.json +210 -0
  271. package/dist/resources/schemas/operations.schema.json +1721 -0
  272. package/dist/resources/schemas/policy.schema.json +63 -0
  273. package/dist/resources/schemas/project.schema.json +250 -0
  274. package/dist/resources/schemas/toolchain-lock.schema.json +118 -0
  275. package/dist/resources/schemas/vendor/mcp.schema.json +120 -0
  276. package/dist/resources/schemas/vendor/plugin.schema.json +65 -0
  277. package/dist/resources/templates/blank-app/README.md +5 -0
  278. package/dist/resources/templates/blank-app/README.uk.md +5 -0
  279. package/dist/resources/templates/blank-app/application/.apex/apexlang.json +3 -0
  280. package/dist/resources/templates/blank-app/application/application.apx +51 -0
  281. package/dist/resources/templates/blank-app/application/deployments/default.json +2 -0
  282. package/dist/resources/templates/blank-app/application/page-groups.apx +4 -0
  283. package/dist/resources/templates/blank-app/application/pages/p00000-global-page.apx +4 -0
  284. package/dist/resources/templates/blank-app/application/pages/p00001-home.apx +35 -0
  285. package/dist/resources/templates/blank-app/application/pages/p09999-login.apx +254 -0
  286. package/dist/resources/templates/blank-app/application/shared-components/authentications.apx +5 -0
  287. package/dist/resources/templates/blank-app/application/shared-components/authorizations.apx +11 -0
  288. package/dist/resources/templates/blank-app/application/shared-components/breadcrumbs.apx +18 -0
  289. package/dist/resources/templates/blank-app/application/shared-components/build-options.apx +4 -0
  290. package/dist/resources/templates/blank-app/application/shared-components/component-settings.apx +92 -0
  291. package/dist/resources/templates/blank-app/application/shared-components/lists.apx +81 -0
  292. package/dist/resources/templates/blank-app/application/shared-components/lovs.apx +20 -0
  293. package/dist/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-144-rounded.png +0 -0
  294. package/dist/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-192.png +0 -0
  295. package/dist/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-256-rounded.png +0 -0
  296. package/dist/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-32.png +0 -0
  297. package/dist/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-512.png +0 -0
  298. package/dist/resources/templates/blank-app/application/shared-components/static-files.apx +25 -0
  299. package/dist/resources/templates/blank-app/application/shared-components/themes/universal-theme/theme.apx +57 -0
  300. package/dist/resources/templates/blank-app/application/supporting-objects/deinstall-script.sql +0 -0
  301. package/dist/resources/templates/blank-app/application/supporting-objects/supporting-objects.apx +9 -0
  302. package/dist/resources/templates/customer-crm/README.md +7 -0
  303. package/dist/resources/templates/customer-crm/README.uk.md +7 -0
  304. package/dist/resources/templates/customer-crm/apex-overlay/pages/p00010-customers.apx +164 -0
  305. package/dist/resources/templates/customer-crm/apex-overlay/pages/p00020-dashboard.apx +54 -0
  306. package/dist/resources/templates/customer-crm/apex-overlay/pages/p00080-customer.apx +332 -0
  307. package/dist/resources/templates/customer-crm/project/src/database/migrations/0001__customers.sql +10 -0
  308. package/dist/resources/templates/customer-crm/project/src/database/packages/0010__customer_api.sql +28 -0
  309. package/dist/resources/templates/customer-crm/project/src/database/packages/0020__customer_validation_trigger.sql +10 -0
  310. package/dist/resources/templates/customer-crm/project/tests/e2e/customer-crud.spec.mjs +25 -0
  311. package/dist/resources/templates/customer-crm/project/tests/sql/test_customers.sql +49 -0
  312. package/dist/resources/templates/database-control/install.sql +17 -0
  313. package/dist/resources/templates/existing-app/README.md +9 -0
  314. package/dist/resources/templates/existing-app/README.uk.md +9 -0
  315. package/dist/resources/testkit/apex.mjs +58 -0
  316. package/dist/resources/third-party/node_modules__@hono__node-server__LICENSE +21 -0
  317. package/dist/resources/third-party/node_modules__@isaacs__fs-minipass__LICENSE +15 -0
  318. package/dist/resources/third-party/node_modules__@modelcontextprotocol__sdk__LICENSE +21 -0
  319. package/dist/resources/third-party/node_modules__@playwright__test__LICENSE +202 -0
  320. package/dist/resources/third-party/node_modules__@playwright__test__NOTICE +5 -0
  321. package/dist/resources/third-party/node_modules__@types__node__LICENSE +21 -0
  322. package/dist/resources/third-party/node_modules__@types__yauzl__LICENSE +21 -0
  323. package/dist/resources/third-party/node_modules__@typescript__typescript-darwin-arm64__LICENSE +55 -0
  324. package/dist/resources/third-party/node_modules__@typescript__typescript-darwin-arm64__NOTICE.txt +436 -0
  325. package/dist/resources/third-party/node_modules__accepts__LICENSE +23 -0
  326. package/dist/resources/third-party/node_modules__ajv-formats__LICENSE +21 -0
  327. package/dist/resources/third-party/node_modules__ajv__LICENSE +22 -0
  328. package/dist/resources/third-party/node_modules__body-parser__LICENSE +23 -0
  329. package/dist/resources/third-party/node_modules__body-parser__node_modules__content-type__LICENSE +22 -0
  330. package/dist/resources/third-party/node_modules__bytes__LICENSE +23 -0
  331. package/dist/resources/third-party/node_modules__call-bind-apply-helpers__LICENSE +21 -0
  332. package/dist/resources/third-party/node_modules__call-bound__LICENSE +21 -0
  333. package/dist/resources/third-party/node_modules__chownr__LICENSE.md +63 -0
  334. package/dist/resources/third-party/node_modules__content-disposition__LICENSE +22 -0
  335. package/dist/resources/third-party/node_modules__content-type__LICENSE +22 -0
  336. package/dist/resources/third-party/node_modules__cookie-signature__LICENSE +22 -0
  337. package/dist/resources/third-party/node_modules__cookie__LICENSE +24 -0
  338. package/dist/resources/third-party/node_modules__cors__LICENSE +22 -0
  339. package/dist/resources/third-party/node_modules__cross-spawn__LICENSE +21 -0
  340. package/dist/resources/third-party/node_modules__debug__LICENSE +20 -0
  341. package/dist/resources/third-party/node_modules__depd__LICENSE +22 -0
  342. package/dist/resources/third-party/node_modules__dunder-proto__LICENSE +21 -0
  343. package/dist/resources/third-party/node_modules__ee-first__LICENSE +22 -0
  344. package/dist/resources/third-party/node_modules__encodeurl__LICENSE +22 -0
  345. package/dist/resources/third-party/node_modules__es-define-property__LICENSE +21 -0
  346. package/dist/resources/third-party/node_modules__es-errors__LICENSE +21 -0
  347. package/dist/resources/third-party/node_modules__es-object-atoms__LICENSE +21 -0
  348. package/dist/resources/third-party/node_modules__esbuild__LICENSE.md +21 -0
  349. package/dist/resources/third-party/node_modules__escape-html__LICENSE +24 -0
  350. package/dist/resources/third-party/node_modules__etag__LICENSE +22 -0
  351. package/dist/resources/third-party/node_modules__eventsource-parser__LICENSE +21 -0
  352. package/dist/resources/third-party/node_modules__eventsource__LICENSE +22 -0
  353. package/dist/resources/third-party/node_modules__express-rate-limit__license +21 -0
  354. package/dist/resources/third-party/node_modules__express__LICENSE +24 -0
  355. package/dist/resources/third-party/node_modules__fast-deep-equal__LICENSE +21 -0
  356. package/dist/resources/third-party/node_modules__fast-uri__LICENSE +30 -0
  357. package/dist/resources/third-party/node_modules__fflate__LICENSE +21 -0
  358. package/dist/resources/third-party/node_modules__finalhandler__LICENSE +22 -0
  359. package/dist/resources/third-party/node_modules__forwarded__LICENSE +22 -0
  360. package/dist/resources/third-party/node_modules__fresh__LICENSE +23 -0
  361. package/dist/resources/third-party/node_modules__function-bind__LICENSE +20 -0
  362. package/dist/resources/third-party/node_modules__get-intrinsic__LICENSE +21 -0
  363. package/dist/resources/third-party/node_modules__get-proto__LICENSE +21 -0
  364. package/dist/resources/third-party/node_modules__gopd__LICENSE +21 -0
  365. package/dist/resources/third-party/node_modules__has-symbols__LICENSE +21 -0
  366. package/dist/resources/third-party/node_modules__hasown__LICENSE +21 -0
  367. package/dist/resources/third-party/node_modules__hono__LICENSE +21 -0
  368. package/dist/resources/third-party/node_modules__http-errors__LICENSE +23 -0
  369. package/dist/resources/third-party/node_modules__iconv-lite__LICENSE +21 -0
  370. package/dist/resources/third-party/node_modules__inherits__LICENSE +16 -0
  371. package/dist/resources/third-party/node_modules__ip-address__LICENSE +19 -0
  372. package/dist/resources/third-party/node_modules__ipaddr.js__LICENSE +19 -0
  373. package/dist/resources/third-party/node_modules__is-promise__LICENSE +19 -0
  374. package/dist/resources/third-party/node_modules__isexe__LICENSE +15 -0
  375. package/dist/resources/third-party/node_modules__jose__LICENSE.md +21 -0
  376. package/dist/resources/third-party/node_modules__json-schema-traverse__LICENSE +21 -0
  377. package/dist/resources/third-party/node_modules__json-schema-typed__LICENSE.md +57 -0
  378. package/dist/resources/third-party/node_modules__marked__LICENSE +44 -0
  379. package/dist/resources/third-party/node_modules__math-intrinsics__LICENSE +21 -0
  380. package/dist/resources/third-party/node_modules__media-typer__LICENSE +22 -0
  381. package/dist/resources/third-party/node_modules__merge-descriptors__license +11 -0
  382. package/dist/resources/third-party/node_modules__mime-db__LICENSE +23 -0
  383. package/dist/resources/third-party/node_modules__mime-types__LICENSE +23 -0
  384. package/dist/resources/third-party/node_modules__minipass__LICENSE.md +55 -0
  385. package/dist/resources/third-party/node_modules__minizlib__LICENSE +26 -0
  386. package/dist/resources/third-party/node_modules__ms__license.md +21 -0
  387. package/dist/resources/third-party/node_modules__negotiator__LICENSE +24 -0
  388. package/dist/resources/third-party/node_modules__negotiator__node_modules__content-type__LICENSE +22 -0
  389. package/dist/resources/third-party/node_modules__object-assign__license +21 -0
  390. package/dist/resources/third-party/node_modules__object-inspect__LICENSE +21 -0
  391. package/dist/resources/third-party/node_modules__on-finished__LICENSE +23 -0
  392. package/dist/resources/third-party/node_modules__once__LICENSE +15 -0
  393. package/dist/resources/third-party/node_modules__parseurl__LICENSE +24 -0
  394. package/dist/resources/third-party/node_modules__path-key__license +9 -0
  395. package/dist/resources/third-party/node_modules__path-to-regexp__LICENSE +21 -0
  396. package/dist/resources/third-party/node_modules__pend__LICENSE +23 -0
  397. package/dist/resources/third-party/node_modules__pkce-challenge__LICENSE +21 -0
  398. package/dist/resources/third-party/node_modules__playwright-core__LICENSE +202 -0
  399. package/dist/resources/third-party/node_modules__playwright-core__NOTICE +5 -0
  400. package/dist/resources/third-party/node_modules__playwright__LICENSE +202 -0
  401. package/dist/resources/third-party/node_modules__playwright__NOTICE +5 -0
  402. package/dist/resources/third-party/node_modules__prettier__LICENSE +7 -0
  403. package/dist/resources/third-party/node_modules__proxy-addr__LICENSE +22 -0
  404. package/dist/resources/third-party/node_modules__qs__LICENSE.md +29 -0
  405. package/dist/resources/third-party/node_modules__range-parser__LICENSE +23 -0
  406. package/dist/resources/third-party/node_modules__raw-body__LICENSE +22 -0
  407. package/dist/resources/third-party/node_modules__require-from-string__license +21 -0
  408. package/dist/resources/third-party/node_modules__router__LICENSE +23 -0
  409. package/dist/resources/third-party/node_modules__safer-buffer__LICENSE +21 -0
  410. package/dist/resources/third-party/node_modules__send__LICENSE +23 -0
  411. package/dist/resources/third-party/node_modules__serve-static__LICENSE +25 -0
  412. package/dist/resources/third-party/node_modules__setprototypeof__LICENSE +13 -0
  413. package/dist/resources/third-party/node_modules__shebang-command__license +9 -0
  414. package/dist/resources/third-party/node_modules__shebang-regex__license +9 -0
  415. package/dist/resources/third-party/node_modules__side-channel-list__LICENSE +21 -0
  416. package/dist/resources/third-party/node_modules__side-channel-map__LICENSE +21 -0
  417. package/dist/resources/third-party/node_modules__side-channel-weakmap__LICENSE +21 -0
  418. package/dist/resources/third-party/node_modules__side-channel__LICENSE +21 -0
  419. package/dist/resources/third-party/node_modules__statuses__LICENSE +23 -0
  420. package/dist/resources/third-party/node_modules__tar__LICENSE.md +55 -0
  421. package/dist/resources/third-party/node_modules__toidentifier__LICENSE +21 -0
  422. package/dist/resources/third-party/node_modules__type-is__LICENSE +23 -0
  423. package/dist/resources/third-party/node_modules__type-is__node_modules__content-type__LICENSE +22 -0
  424. package/dist/resources/third-party/node_modules__typescript__LICENSE +55 -0
  425. package/dist/resources/third-party/node_modules__typescript__NOTICE.txt +436 -0
  426. package/dist/resources/third-party/node_modules__undici-types__LICENSE +21 -0
  427. package/dist/resources/third-party/node_modules__unpipe__LICENSE +22 -0
  428. package/dist/resources/third-party/node_modules__vary__LICENSE +22 -0
  429. package/dist/resources/third-party/node_modules__which__LICENSE +15 -0
  430. package/dist/resources/third-party/node_modules__wrappy__LICENSE +15 -0
  431. package/dist/resources/third-party/node_modules__yallist__LICENSE.md +63 -0
  432. package/dist/resources/third-party/node_modules__yauzl__LICENSE +21 -0
  433. package/dist/resources/third-party/node_modules__zod-to-json-schema__LICENSE +15 -0
  434. package/dist/resources/third-party/node_modules__zod__LICENSE +21 -0
  435. package/dist/resources/toolchains/compatibility.json +50 -0
  436. package/dist/resources/toolchains/sources.lock.json +14 -0
  437. package/dist/resources/toolchains/toolchain.lock.json +204 -0
  438. package/dist/runtime/apexrest.mjs +226 -0
  439. package/dist/runtime/chunk-2SZCZZ3J.mjs +37111 -0
  440. package/dist/runtime/chunk-2VGE5Y5J.mjs +994 -0
  441. package/dist/runtime/chunk-3GSS6SJH.mjs +1424 -0
  442. package/dist/runtime/chunk-5GOWABKB.mjs +409 -0
  443. package/dist/runtime/chunk-ARMO5ZAQ.mjs +25 -0
  444. package/dist/runtime/chunk-ED2YPDPS.mjs +1123 -0
  445. package/dist/runtime/chunk-FPOEB42H.mjs +100 -0
  446. package/dist/runtime/chunk-GFRSRK3K.mjs +16 -0
  447. package/dist/runtime/chunk-ICWYSHJ7.mjs +19 -0
  448. package/dist/runtime/chunk-IPU64TJI.mjs +291 -0
  449. package/dist/runtime/chunk-JWX4UQAZ.mjs +14 -0
  450. package/dist/runtime/chunk-K3KT6RZY.mjs +1064 -0
  451. package/dist/runtime/chunk-QLRGI23I.mjs +1307 -0
  452. package/dist/runtime/chunk-RF4XQO6I.mjs +13 -0
  453. package/dist/runtime/chunk-VPCUV5QA.mjs +237 -0
  454. package/dist/runtime/chunk-WMJTK7ZB.mjs +201 -0
  455. package/dist/runtime/chunk-WROK6RQH.mjs +200 -0
  456. package/dist/runtime/chunk-XDJEGHUX.mjs +1179 -0
  457. package/dist/runtime/chunk-YK34QNHH.mjs +15 -0
  458. package/dist/runtime/chunk-Z6Y72JVG.mjs +37 -0
  459. package/dist/runtime/chunk-ZQFJ2BNZ.mjs +329 -0
  460. package/dist/runtime/mcp.mjs +15 -0
  461. package/package.json +70 -0
@@ -0,0 +1,1179 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+ import {
3
+ openPanel
4
+ } from "./chunk-WMJTK7ZB.mjs";
5
+ import {
6
+ JobService,
7
+ PanelService,
8
+ panelActionSchema,
9
+ panelReadSchema,
10
+ publicPanelActionSchema
11
+ } from "./chunk-5GOWABKB.mjs";
12
+ import {
13
+ TeamService,
14
+ currentSessionHandoff,
15
+ teamActive
16
+ } from "./chunk-VPCUV5QA.mjs";
17
+ import {
18
+ ArtifactService,
19
+ DeploymentService,
20
+ TestService,
21
+ queuedWorkSchema,
22
+ recordedExecutionMode,
23
+ resolveWorkRequest,
24
+ resolvedTeamStartSchema,
25
+ teamIdSchema,
26
+ teamMessageSchema,
27
+ teamStartSchema,
28
+ teamWaitSchema,
29
+ workStartSchema
30
+ } from "./chunk-QLRGI23I.mjs";
31
+ import {
32
+ VERSION
33
+ } from "./chunk-Z6Y72JVG.mjs";
34
+ import {
35
+ OracleAdapter,
36
+ configureConnection,
37
+ configureSqlcl,
38
+ connections,
39
+ databaseTransport,
40
+ editConnection,
41
+ environment,
42
+ external_exports,
43
+ identifier,
44
+ installSources,
45
+ loadProject,
46
+ managedHome,
47
+ ordsUrl,
48
+ ordsUsername,
49
+ parse,
50
+ projectInit,
51
+ projectInspect,
52
+ projectSummary,
53
+ refName,
54
+ relativePath,
55
+ requireTrust,
56
+ resolveConnection,
57
+ resourceRoot,
58
+ runProcess,
59
+ runtimeState,
60
+ savedConnectionName,
61
+ sqlclConfig,
62
+ sqlclMode,
63
+ sqlclRestriction
64
+ } from "./chunk-2SZCZZ3J.mjs";
65
+ import {
66
+ Fault,
67
+ canonical,
68
+ contained,
69
+ exists,
70
+ failure,
71
+ hash,
72
+ readJson,
73
+ redact,
74
+ success,
75
+ withLock,
76
+ writeJson
77
+ } from "./chunk-IPU64TJI.mjs";
78
+
79
+ // packages/core/src/metadata.ts
80
+ var metadataOffset = external_exports.number().int().min(0).max(1e5);
81
+ var metadataLimit = external_exports.number().int().min(1).max(100);
82
+ var metadataRequest = external_exports.strictObject({
83
+ kind: external_exports.enum(["objects", "columns", "constraints", "signatures", "applications", "pages"]),
84
+ schema: identifier,
85
+ name: identifier.optional(),
86
+ offset: metadataOffset.default(0),
87
+ limit: metadataLimit.default(30)
88
+ });
89
+ var metadataRequests = external_exports.array(metadataRequest).min(1).max(8);
90
+ var metadataBatchRequest = external_exports.strictObject({ requests: metadataRequests });
91
+ var metadataInputSchema = external_exports.strictObject({
92
+ kind: metadataRequest.shape.kind.optional(),
93
+ schema: metadataRequest.shape.schema.optional(),
94
+ name: metadataRequest.shape.name,
95
+ offset: metadataOffset.optional(),
96
+ limit: metadataLimit.optional(),
97
+ requests: metadataRequests.optional()
98
+ });
99
+ var queries = {
100
+ objects: "select object_name, object_type from all_objects where owner=:p_owner and object_type in ('TABLE','VIEW','PACKAGE') and (:p_name is null or object_name=:p_name) order by object_name, object_type",
101
+ columns: "select table_name,column_name,data_type,nullable,column_id from all_tab_columns where owner=:p_owner and table_name=:p_name order by column_id",
102
+ constraints: "select table_name,constraint_name,constraint_type,r_owner,r_constraint_name,status from all_constraints where owner=:p_owner and table_name=:p_name order by constraint_name",
103
+ signatures: "select package_name,object_name,argument_name,position,in_out,data_type,overload from all_arguments where owner=:p_owner and package_name=:p_name order by object_name,overload,sequence",
104
+ applications: "select application_id,application_name,alias from apex_applications where owner=:p_owner and application_id=:p_app_id order by application_id",
105
+ pages: "select application_id,page_id,page_name,page_alias from apex_application_pages where application_id=:p_app_id and workspace=:p_workspace order by page_id"
106
+ };
107
+ async function metadataRead(adapter, env2, connection, value) {
108
+ const input = parse(external_exports.union([metadataRequest, metadataBatchRequest]), value);
109
+ const batch = "requests" in input;
110
+ const requests = batch ? input.requests : [input];
111
+ for (const r of requests) {
112
+ if (r.schema !== env2.parsingSchema)
113
+ throw new Fault("SCHEMA_DENIED", "Metadata is restricted to the configured parsing schema.", 4);
114
+ if (["columns", "constraints", "signatures"].includes(r.kind) && !r.name)
115
+ throw new Fault("OBJECT_REQUIRED", "Select a specific object first.", 2);
116
+ }
117
+ await adapter.verifyTarget(env2, connection);
118
+ const read = async (r) => {
119
+ const rows = await adapter.jsonQuery(
120
+ queries[r.kind] + " offset :p_offset rows fetch next :p_limit rows only",
121
+ connection,
122
+ {
123
+ p_owner: r.schema,
124
+ p_name: r.name ?? "",
125
+ p_app_id: env2.applicationId,
126
+ p_workspace: env2.workspace,
127
+ p_offset: r.offset,
128
+ p_limit: r.limit
129
+ }
130
+ );
131
+ return {
132
+ dataClassification: "untrusted_database_content",
133
+ rows,
134
+ offset: r.offset,
135
+ nextOffset: rows.length === r.limit ? r.offset + r.limit : null
136
+ };
137
+ };
138
+ if (!batch) return read(input);
139
+ const results = [];
140
+ for (const [index, r] of requests.entries())
141
+ results.push({ index, kind: r.kind, ...r.name ? { name: r.name } : {}, ...await read(r) });
142
+ return { results, targetVerifiedOnce: true };
143
+ }
144
+
145
+ // packages/core/src/operations.ts
146
+ var project = external_exports.string().min(1).max(4096).optional();
147
+ var env = refName;
148
+ var base = { project };
149
+ var dependencies = {
150
+ home: external_exports.string().optional(),
151
+ yes: external_exports.boolean().default(false),
152
+ nonInteractive: external_exports.boolean().default(false),
153
+ offline: external_exports.boolean().default(false),
154
+ cacheDir: external_exports.string().optional(),
155
+ dryRun: external_exports.boolean().default(false),
156
+ acceptOracleLicense: external_exports.boolean().default(false),
157
+ skipBrowser: external_exports.boolean().default(false),
158
+ installOsDeps: external_exports.boolean().default(false)
159
+ };
160
+ var setup = {
161
+ ...base,
162
+ ...dependencies,
163
+ from: external_exports.string().optional(),
164
+ codexHome: external_exports.string().optional(),
165
+ scope: external_exports.enum(["user", "project"]).default("user"),
166
+ version: external_exports.string().optional(),
167
+ nativeOnly: external_exports.boolean().default(false)
168
+ };
169
+ var schemas = {
170
+ version: external_exports.strictObject({}),
171
+ doctor: external_exports.strictObject(base),
172
+ "sqlcl.status": external_exports.strictObject({}),
173
+ "sqlcl.configure": external_exports.strictObject({
174
+ mode: sqlclMode,
175
+ mcpRestrictLevel: sqlclRestriction.optional(),
176
+ databaseTransport: databaseTransport.optional()
177
+ }),
178
+ "team.start": teamStartSchema,
179
+ "work.start": workStartSchema,
180
+ "team.wait": teamWaitSchema,
181
+ "team.status": teamIdSchema,
182
+ "team.message": teamMessageSchema,
183
+ "team.cancel": teamIdSchema,
184
+ "panel.open": panelReadSchema.omit({ team: true }),
185
+ "panel.status": panelReadSchema,
186
+ "panel.action": publicPanelActionSchema,
187
+ setup: external_exports.strictObject(setup),
188
+ "dependencies.install": external_exports.strictObject(dependencies),
189
+ "dependencies.uninstall": external_exports.strictObject({
190
+ home: external_exports.string().optional(),
191
+ dryRun: external_exports.boolean().default(false),
192
+ yes: external_exports.boolean().default(false)
193
+ }),
194
+ "plugin.validate": external_exports.strictObject({ ...base, from: external_exports.string().optional() }),
195
+ "plugin.install": external_exports.strictObject(setup),
196
+ "plugin.update": external_exports.strictObject({ ...setup, version: external_exports.string().min(1) }),
197
+ "plugin.uninstall": external_exports.strictObject({
198
+ ...base,
199
+ home: external_exports.string().optional(),
200
+ keepRuntime: external_exports.boolean().default(false)
201
+ }),
202
+ "project.init": external_exports.strictObject({
203
+ ...base,
204
+ directory: external_exports.string().min(1),
205
+ template: external_exports.enum(["blank-app", "customer-crm", "existing-app"]).default("blank-app"),
206
+ alias: refName.optional()
207
+ }),
208
+ "project.adopt": external_exports.strictObject({ ...base, env, appId: external_exports.number().int().positive() }),
209
+ "project.inspect": external_exports.strictObject({ ...base, detail: external_exports.enum(["full", "summary"]).default("full") }),
210
+ "connection.add": external_exports.strictObject({
211
+ ...base,
212
+ name: refName,
213
+ sqlclName: savedConnectionName.optional(),
214
+ ordsUrl: ordsUrl.optional(),
215
+ ordsUsername: ordsUsername.optional(),
216
+ passwordFile: external_exports.string().min(1).max(4096).optional()
217
+ }).refine(
218
+ (value) => !!value.sqlclName || !!(value.ordsUrl && value.ordsUsername),
219
+ "Supply a direct SQLcl name or ORDS URL and username."
220
+ ),
221
+ "connection.list": external_exports.strictObject({ ...base, saved: external_exports.boolean().default(false) }),
222
+ "connection.test": external_exports.strictObject({
223
+ ...base,
224
+ name: savedConnectionName,
225
+ saved: external_exports.boolean().default(false)
226
+ }),
227
+ "connection.remove": external_exports.strictObject({ ...base, name: refName }),
228
+ "docs.search": external_exports.strictObject({
229
+ query: external_exports.string().min(1).max(256),
230
+ version: external_exports.string().optional(),
231
+ kind: external_exports.enum(["grammar", "template", "contract", "guide"]).optional(),
232
+ family: external_exports.string().min(1).max(200).optional(),
233
+ offset: external_exports.number().int().min(0).max(1e4).default(0),
234
+ limit: external_exports.number().int().min(1).max(8).default(3)
235
+ }),
236
+ "docs.read": external_exports.strictObject({
237
+ id: external_exports.string().max(200),
238
+ offset: external_exports.number().int().min(0).default(0),
239
+ limit: external_exports.number().int().min(1).max(8192).default(4096)
240
+ }),
241
+ "docs.sync": external_exports.strictObject({ version: external_exports.string().min(1), dryRun: external_exports.boolean().default(false) }),
242
+ "metadata.read": metadataInputSchema.extend({ ...base, env }).strict(),
243
+ "apex.generate": external_exports.strictObject({
244
+ ...base,
245
+ name: external_exports.string().min(1).max(120),
246
+ output: relativePath,
247
+ alias: refName.optional()
248
+ }),
249
+ "apex.export": external_exports.strictObject({ ...base, env, output: relativePath }),
250
+ "apex.validate": external_exports.strictObject({ ...base, env: env.optional() }),
251
+ "apex.diff": external_exports.strictObject({ ...base, env }),
252
+ "db.plan": external_exports.strictObject({ ...base, env }),
253
+ "deploy.plan": external_exports.strictObject({ ...base, env, out: relativePath }),
254
+ "deploy.apply": external_exports.strictObject({ ...base, plan: relativePath }),
255
+ "deploy.status": external_exports.strictObject({ ...base, run: external_exports.uuid() }),
256
+ "deploy.restore-plan": external_exports.strictObject({ ...base, backup: external_exports.uuid(), out: relativePath }),
257
+ "test.run": external_exports.strictObject({
258
+ ...base,
259
+ suite: external_exports.enum(["unit", "sql", "api", "e2e", "all"]),
260
+ env: env.optional(),
261
+ headed: external_exports.boolean().default(false)
262
+ }),
263
+ "test.report": external_exports.strictObject({ ...base, run: external_exports.uuid() }),
264
+ "test.auth": external_exports.strictObject({ ...base, env }),
265
+ "browser.open": external_exports.strictObject({ ...base, env, browserMode: external_exports.enum(["codex", "external"]).optional() }),
266
+ "jobs.status": external_exports.strictObject({
267
+ ...base,
268
+ id: external_exports.uuid(),
269
+ waitSeconds: external_exports.number().int().min(0).max(30).default(0)
270
+ }),
271
+ "jobs.cancel": external_exports.strictObject({ ...base, id: external_exports.uuid() }),
272
+ "artifacts.read": external_exports.strictObject({
273
+ ...base,
274
+ id: external_exports.uuid(),
275
+ offset: external_exports.number().int().min(0).default(0),
276
+ limit: external_exports.number().int().min(1).max(16384).default(4096)
277
+ }),
278
+ "sandbox.up": external_exports.strictObject(base),
279
+ "sandbox.status": external_exports.strictObject(base),
280
+ "sandbox.down": external_exports.strictObject(base)
281
+ };
282
+ var toolCatalog = [
283
+ {
284
+ name: "apexrest_browser_open",
285
+ operation: "browser.open",
286
+ description: "Open a configured APEX environment in the selected browser. Codex returns a host handoff; external launches the system browser. Opening is not verification or test authorization.",
287
+ readOnly: false,
288
+ destructive: false
289
+ },
290
+ {
291
+ name: "apexrest_work_start",
292
+ operation: "work.start",
293
+ description: "Start APEX work: single continues in this chat without new agents/polling; explicitly enabled teams return a private panel. Fresh requestId per task; exact retries reuse the receipt.",
294
+ readOnly: false
295
+ },
296
+ {
297
+ name: "apexrest_team_wait",
298
+ operation: "team.wait",
299
+ description: "Wait for worker progress/completion (up to 30s). Reuse cursor; unchanged heartbeats stay silent. Terminal results check source digests. Not for current_session.",
300
+ readOnly: true
301
+ },
302
+ {
303
+ name: "apexrest_panel_open",
304
+ operation: "panel.open",
305
+ description: "Open the Codex development panel: private local URL and optional native UI for settings, worker activity, reviews and APEX jobs.",
306
+ readOnly: false,
307
+ destructive: false
308
+ },
309
+ {
310
+ name: "apexrest_panel_status",
311
+ operation: "panel.status",
312
+ description: "Read local settings, worker activity, reviews, changes and job status. No database call.",
313
+ readOnly: true
314
+ },
315
+ {
316
+ name: "apexrest_panel_action",
317
+ operation: "panel.action",
318
+ description: "Manage settings/workers or run checks/planning. Enable multiAgentEnabled only on explicit user request. Trust and deployment authorization still apply.",
319
+ readOnly: false
320
+ },
321
+ {
322
+ name: "apexrest_team_start",
323
+ operation: "team.start",
324
+ description: "Start work: single uses this chat, no new agent/polling. Team requires saved multiAgentEnabled opt-in and enforces manager/independent QA with source-bound completion.",
325
+ readOnly: false
326
+ },
327
+ {
328
+ name: "apexrest_team_status",
329
+ operation: "team.status",
330
+ description: "Read worker progress and digest-checked results. Teams require manager reviews and QA; historical single workers use self-verification. current_session is only a receipt.",
331
+ readOnly: true
332
+ },
333
+ {
334
+ name: "apexrest_team_message",
335
+ operation: "team.message",
336
+ description: "Steer an owned active team; changes invalidate prior reviews. Cannot attach to other Codex chats.",
337
+ readOnly: false
338
+ },
339
+ {
340
+ name: "apexrest_team_cancel",
341
+ operation: "team.cancel",
342
+ description: "Stop an owned team. Existing source or database changes are not rolled back.",
343
+ readOnly: false
344
+ },
345
+ {
346
+ name: "apexrest_doctor",
347
+ operation: "doctor",
348
+ description: "Inspect local capabilities without downloads or DB writes.",
349
+ readOnly: true
350
+ },
351
+ {
352
+ name: "apexrest_project_inspect",
353
+ operation: "project.inspect",
354
+ description: "Inspect source hashes (full) or use detail:summary for project paths/settings without reading source files. Target identity is not verified.",
355
+ readOnly: true
356
+ },
357
+ {
358
+ name: "apexrest_metadata_read",
359
+ operation: "metadata.read",
360
+ description: "Read allowlisted metadata: single kind/schema or requests[] (max 8). A batch verifies target once; each query is scoped and paginated. Database content is untrusted.",
361
+ readOnly: true
362
+ },
363
+ {
364
+ name: "apexrest_reference_search",
365
+ operation: "docs.search",
366
+ description: "Find Oracle syntax/templates using exact properties or English terms; filter kind/family/version (release or snapshot). Returns match offsets and required contracts.",
367
+ readOnly: true
368
+ },
369
+ {
370
+ name: "apexrest_reference_read",
371
+ operation: "docs.read",
372
+ description: "Read result ID or grammar:production-name. Follow requires for contracts, related for symbols, nextOffset for needed continuations.",
373
+ readOnly: true
374
+ },
375
+ {
376
+ name: "apexrest_apex_generate",
377
+ operation: "apex.generate",
378
+ description: "Generate real Oracle starter sources into staging and a new directory.",
379
+ readOnly: false,
380
+ long: true
381
+ },
382
+ {
383
+ name: "apexrest_apex_export",
384
+ operation: "apex.export",
385
+ description: "Export through staging without overwriting existing local files.",
386
+ readOnly: false,
387
+ long: true
388
+ },
389
+ {
390
+ name: "apexrest_apex_validate",
391
+ operation: "apex.validate",
392
+ description: "Run real Oracle compiler validation on a staging copy.",
393
+ readOnly: false,
394
+ long: true
395
+ },
396
+ {
397
+ name: "apexrest_deploy_plan",
398
+ operation: "deploy.plan",
399
+ description: "Read target and write an immutable plan without deployment.",
400
+ readOnly: false,
401
+ long: true
402
+ },
403
+ {
404
+ name: "apexrest_deploy_apply",
405
+ operation: "deploy.apply",
406
+ description: "Apply a fixed plan under external policy, backup and target lease.",
407
+ readOnly: false,
408
+ destructive: true,
409
+ long: true
410
+ },
411
+ {
412
+ name: "apexrest_test_run",
413
+ operation: "test.run",
414
+ description: "Run application tests; remote suites can mutate data and require environment policy.",
415
+ readOnly: false,
416
+ long: true
417
+ },
418
+ {
419
+ name: "apexrest_job_status",
420
+ operation: "jobs.status",
421
+ description: "Read job status; waitSeconds:25 waits for completion without repeated polls. Reuse jobId; never rerun work to retrieve results.",
422
+ readOnly: true
423
+ },
424
+ {
425
+ name: "apexrest_job_cancel",
426
+ operation: "jobs.cancel",
427
+ description: "Request cancellation; database outcome may remain unknown.",
428
+ readOnly: false
429
+ },
430
+ {
431
+ name: "apexrest_artifact_read",
432
+ operation: "artifacts.read",
433
+ description: "Read registered sanitized text by opaque ID and bounded range.",
434
+ readOnly: true
435
+ }
436
+ ];
437
+
438
+ // packages/core/src/service.ts
439
+ import path4 from "node:path";
440
+
441
+ // packages/core/src/doctor.ts
442
+ import path from "node:path";
443
+ async function doctor() {
444
+ const state = await runtimeState();
445
+ const java = process.env.APEXREST_JAVA_HOME ? path.join(process.env.APEXREST_JAVA_HOME, "bin", process.platform === "win32" ? "java.exe" : "java") : state.java ?? "java";
446
+ const probes = await Promise.all(
447
+ [
448
+ ["codex", ["--version"]],
449
+ [process.env.APEXREST_SQLCL ?? state.sqlcl ?? "sql", ["-version"]],
450
+ [java, ["-version"]]
451
+ ].map(async ([exe, args]) => {
452
+ try {
453
+ const r = await runProcess({
454
+ executable: exe,
455
+ args,
456
+ cwd: process.env.TMPDIR ?? process.cwd(),
457
+ timeoutMs: 1e4,
458
+ env: {
459
+ ...process.env,
460
+ JAVA_HOME: path.isAbsolute(java) ? path.dirname(path.dirname(java)) : process.env.JAVA_HOME
461
+ }
462
+ });
463
+ return {
464
+ command: exe,
465
+ state: r.code === 0 ? "detected" : "unavailable",
466
+ version: (r.stdout + r.stderr).trim().slice(0, 500)
467
+ };
468
+ } catch {
469
+ return { command: exe, state: "missing" };
470
+ }
471
+ })
472
+ );
473
+ return {
474
+ platform: process.platform,
475
+ architecture: process.arch,
476
+ runtime: {
477
+ executable: process.execPath,
478
+ version: process.version,
479
+ baseline: process.versions.node.split(".")[0] === "24"
480
+ },
481
+ managedComponents: state.components,
482
+ sqlcl: await sqlclConfig(),
483
+ probes,
484
+ database: "not-configured",
485
+ nativeHost: "requires-host-verification",
486
+ telemetry: false
487
+ };
488
+ }
489
+
490
+ // packages/core/src/references.ts
491
+ import path2 from "node:path";
492
+ import { stat, readFile } from "node:fs/promises";
493
+
494
+ // packages/core/src/reference-index.ts
495
+ var referenceWords = (text) => text.replace(/([a-z\d])([A-Z])/g, "$1 $2").toLowerCase().match(/[\p{L}\p{N}]+/gu) ?? [];
496
+ var normalizeReference = (text) => referenceWords(text).join(" ");
497
+ function buildReferencePostings(entries) {
498
+ const postings = /* @__PURE__ */ Object.create(null);
499
+ entries.forEach((entry, position) => {
500
+ for (const word of new Set(referenceWords(entry.id + " " + (entry.title ?? "") + " " + entry.text)))
501
+ (postings[word] ??= []).push(position);
502
+ });
503
+ return postings;
504
+ }
505
+
506
+ // packages/core/src/references.ts
507
+ var references = [
508
+ {
509
+ id: "apexlang-lifecycle",
510
+ version: "26.1",
511
+ source: "https://docs.oracle.com/en/database/oracle/sql-developer-command-line/26.1/sqcug/apexlang.html",
512
+ text: 'Generate starter files using apex generate -name "Name" -dir ./fresh. Validate with apex validate -input ./application. Export requires a connection and always uses fresh staging. Import deploys the full application and requires a reviewed plan. Preserve .apex/apexlang.json and its compiler metadata.'
513
+ },
514
+ {
515
+ id: "deployment-safety",
516
+ version: "0.4.0-beta.1",
517
+ source: "docs/adr/007-clean-apex-deployment.md",
518
+ text: "Use an explicit environment. Plans bind source hashes and target identity. Recheck drift, acquire local coordination by default and create an export backup before writes. Clean APEX deployment needs no service tables. Local runners must share one managed home; independent machines need external serialization or explicitly selected database coordination. DDL cannot be generally rolled back. Interrupted writes require reconciliation. Production requires an external approval boundary."
519
+ }
520
+ ];
521
+ var stopwords = /* @__PURE__ */ new Set(["a", "an", "the", "for", "with", "and", "of", "to", "in"]);
522
+ var termsFor = (text) => [...new Set(referenceWords(text).filter((word) => !stopwords.has(word)))];
523
+ function versionMatches(actual, requested) {
524
+ if (!requested) return true;
525
+ return actual === requested || !requested.includes("@") && actual.split("@")[0] === requested;
526
+ }
527
+ function indexReferences(upstream, file, digest) {
528
+ const entries = [...references, ...upstream];
529
+ const byId = /* @__PURE__ */ new Map();
530
+ const bySymbol = /* @__PURE__ */ new Map();
531
+ const searchable = entries.map((reference) => {
532
+ if (!byId.has(reference.id)) byId.set(reference.id, reference);
533
+ const symbol = reference.text.match(/^<([^>\n]+)>\s*::=/)?.[1];
534
+ if (symbol) bySymbol.set(symbol, reference.id);
535
+ const title = reference.title ?? symbol ?? reference.id;
536
+ return {
537
+ reference,
538
+ title,
539
+ titleText: normalizeReference(title),
540
+ ranking: void 0
541
+ };
542
+ });
543
+ let pendingPostings;
544
+ const postings = () => pendingPostings ??= (async () => {
545
+ if (file) {
546
+ try {
547
+ const prebuilt = await readJson(path2.join(path2.dirname(file), "search.json"));
548
+ if (prebuilt && prebuilt.schemaVersion === 1 && prebuilt.indexSha256 === digest && prebuilt.postings && Object.values(prebuilt.postings).every(
549
+ (list) => Array.isArray(list) && list.every(
550
+ (n) => Number.isInteger(n) && Number(n) >= 0 && Number(n) < upstream.length
551
+ )
552
+ )) {
553
+ const result = buildReferencePostings(references);
554
+ for (const [term, list] of Object.entries(prebuilt.postings))
555
+ result[term] = [
556
+ ...result[term] ?? [],
557
+ ...list.map((position) => position + references.length)
558
+ ];
559
+ return result;
560
+ }
561
+ } catch {
562
+ }
563
+ }
564
+ return buildReferencePostings(entries);
565
+ })();
566
+ return { upstream, byId, bySymbol, searchable, postings, queries: /* @__PURE__ */ new Map() };
567
+ }
568
+ var cached;
569
+ async function referenceIndex() {
570
+ const file = path2.join(resourceRoot(), "references/index.json");
571
+ let info;
572
+ try {
573
+ info = await stat(file, { bigint: true });
574
+ } catch (error) {
575
+ if (error.code !== "ENOENT") throw error;
576
+ cached = void 0;
577
+ return indexReferences([]);
578
+ }
579
+ const stamp = `${info.dev}:${info.ino}:${info.size}:${info.mtimeNs}:${info.ctimeNs}`;
580
+ if (cached?.file === file && cached.stamp === stamp) return cached.pending;
581
+ const pending = readFile(file, "utf8").then(
582
+ (raw) => indexReferences(JSON.parse(raw), file, hash(raw))
583
+ );
584
+ cached = { file, stamp, pending };
585
+ try {
586
+ return await pending;
587
+ } catch (error) {
588
+ if (cached?.pending === pending) cached = void 0;
589
+ throw error;
590
+ }
591
+ }
592
+ function snippet(text, query, terms) {
593
+ const lower = text.toLowerCase();
594
+ let matchOffset = lower.indexOf(query.trim().toLowerCase());
595
+ if (matchOffset < 0) {
596
+ const pattern = referenceWords(query).join("[\\s._:-]*");
597
+ if (pattern) matchOffset = lower.search(new RegExp(pattern, "u"));
598
+ }
599
+ if (matchOffset < 0) {
600
+ const locations = terms.map((term) => lower.indexOf(term)).filter((offset2) => offset2 >= 0);
601
+ matchOffset = locations.length ? Math.min(...locations) : -1;
602
+ }
603
+ const offset = Math.max(0, Math.min(matchOffset - 160, text.length - 1200));
604
+ return {
605
+ text: text.slice(offset, offset + 1200),
606
+ offset,
607
+ matchOffset: matchOffset < 0 ? null : matchOffset,
608
+ length: text.length,
609
+ nextOffset: offset + 1200 < text.length ? offset + 1200 : null
610
+ };
611
+ }
612
+ async function referenceSearch(query, version, options = {}) {
613
+ const terms = termsFor(query);
614
+ if (!terms.length) return [];
615
+ const index = await referenceIndex();
616
+ const normalized = normalizeReference(query);
617
+ const key = JSON.stringify([query.trim(), version, options.kind, options.family]);
618
+ let ranked = index.queries.get(key);
619
+ if (!ranked) {
620
+ const postings = await index.postings();
621
+ const lists = terms.map((term) => postings[term] ?? []).sort((a, b) => a.length - b.length);
622
+ const membership = lists.slice(1).map((list) => new Set(list));
623
+ const candidates = (lists[0] ?? []).filter((position) => membership.every((list) => list.has(position)));
624
+ const exactId = index.byId.get(query) ?? index.byId.get(index.bySymbol.get(query.replace(/^grammar:/, "")) ?? "");
625
+ if (exactId) {
626
+ const position = index.searchable.findIndex(({ reference }) => reference === exactId);
627
+ if (!candidates.includes(position)) candidates.push(position);
628
+ }
629
+ ranked = candidates.filter((position) => {
630
+ const r = index.searchable[position].reference;
631
+ return versionMatches(r.version, version) && (!options.kind || r.kind === options.kind) && (!options.family || r.family === options.family || r.family?.startsWith(options.family + "/"));
632
+ }).map((position) => {
633
+ const entry = index.searchable[position];
634
+ const { reference, titleText } = entry;
635
+ const exact = reference === exactId;
636
+ const { titleTerms, bodyText } = entry.ranking ??= {
637
+ titleTerms: termsFor(titleText),
638
+ bodyText: normalizeReference(reference.text)
639
+ };
640
+ const adjacentHits = terms.slice(1).filter((term, i) => bodyText.includes(terms[i] + " " + term)).length;
641
+ const titleHits = terms.filter((term) => titleTerms.includes(term)).length;
642
+ const score = (exact ? 1e4 : 0) + (titleText === normalized ? 2e3 : 0) + (titleText.includes(normalized) ? 400 : 0) + titleHits * 50 + (titleHits === terms.length ? 200 : 0) + (bodyText.includes(normalized) ? 40 : 0) + adjacentHits * 60 + (reference.text.includes('"' + query.trim() + '"') ? 80 : 0) + (reference.kind === "contract" ? 5 : 0) + 1 / (1 + reference.text.length / 1e3);
643
+ return { position, score };
644
+ }).sort((a, b) => b.score - a.score || a.position - b.position).map(({ position }) => position);
645
+ if (index.queries.size >= 64) index.queries.delete(index.queries.keys().next().value);
646
+ index.queries.set(key, ranked);
647
+ }
648
+ const offset = options.offset ?? 0;
649
+ const limit = options.limit ?? 3;
650
+ return ranked.slice(offset, offset + limit).map((position) => {
651
+ const { reference: r, title } = index.searchable[position];
652
+ return {
653
+ id: r.id,
654
+ title,
655
+ version: r.version,
656
+ source: r.source,
657
+ kind: r.kind ?? "guide",
658
+ family: r.family ?? "workflow",
659
+ ...snippet(r.text, query, terms),
660
+ requires: r.requires ?? [],
661
+ totalMatches: ranked.length,
662
+ nextResultOffset: offset + limit < ranked.length ? offset + limit : null
663
+ };
664
+ });
665
+ }
666
+ async function referenceRead(id, offset, limit) {
667
+ const index = await referenceIndex();
668
+ const item = index.byId.get(id) ?? index.byId.get(index.bySymbol.get(id.replace(/^grammar:/, "")) ?? "");
669
+ if (!item)
670
+ throw new Fault("REFERENCE_NOT_FOUND", "No registered reference with this ID or grammar symbol.", 2);
671
+ const content = item.text.slice(offset, offset + limit);
672
+ const symbols = [...content.matchAll(/<([^>\n]+)>/g)].map((match) => index.bySymbol.get(match[1]));
673
+ const related = [
674
+ ...new Set(
675
+ [...item.related ?? [], ...symbols].filter(
676
+ (target) => Boolean(target) && target !== item.id
677
+ )
678
+ )
679
+ ];
680
+ return {
681
+ id: item.id,
682
+ title: item.title ?? item.id,
683
+ version: item.version,
684
+ source: item.source,
685
+ content,
686
+ offset,
687
+ length: item.text.length,
688
+ nextOffset: offset + limit < item.text.length ? offset + limit : null,
689
+ requires: item.requires ?? [],
690
+ related: related.slice(0, 16),
691
+ relatedCount: related.length,
692
+ relatedOmittedCount: Math.max(0, related.length - 16),
693
+ classification: "vendor-reference-data"
694
+ };
695
+ }
696
+ async function referenceSync(version, dryRun) {
697
+ const entries = (await referenceIndex()).upstream.filter((r) => versionMatches(r.version, version));
698
+ if (!entries.length)
699
+ throw new Fault(
700
+ "REFERENCE_VERSION_UNAVAILABLE",
701
+ "Requested version is not in this reviewed release snapshot. Install a reviewed release containing it.",
702
+ 3
703
+ );
704
+ const destination = path2.join(managedHome(), "references", version + ".json");
705
+ const before = await exists(destination) ? hash(canonical(await readJson(destination))) : null, after = hash(canonical(entries));
706
+ if (!dryRun && before !== after) await writeJson(destination, entries);
707
+ return {
708
+ status: dryRun ? "planned" : before === after ? "unchanged" : "synced",
709
+ version,
710
+ before,
711
+ after,
712
+ count: entries.length
713
+ };
714
+ }
715
+
716
+ // packages/core/src/sandbox.ts
717
+ async function sandboxAction(action) {
718
+ const engines = await Promise.all(
719
+ ["docker", "podman"].map(async (executable) => {
720
+ try {
721
+ const r = await runProcess({
722
+ executable,
723
+ args: ["info", "--format", "{{json .}}"],
724
+ cwd: process.cwd(),
725
+ timeoutMs: 1e4
726
+ });
727
+ return { engine: executable, available: r.code === 0 };
728
+ } catch {
729
+ return { engine: executable, available: false };
730
+ }
731
+ })
732
+ );
733
+ const state = {
734
+ profile: "optional",
735
+ platform: `${process.platform}/${process.arch}`,
736
+ engines,
737
+ supported: false,
738
+ reason: "No provisioned Oracle DB Free + APEX 26.1 + ORDS artifact tuple has been verified on this host.",
739
+ volumesRemoved: false
740
+ };
741
+ if (action === "status") return state;
742
+ if (action === "down") return { ...state, status: "not-configured", changed: false };
743
+ throw new Fault(
744
+ "SANDBOX_PROFILE_UNVERIFIED",
745
+ state.reason + " Remote APEX targets remain independent.",
746
+ 3,
747
+ "blocked"
748
+ );
749
+ }
750
+
751
+ // packages/core/src/work.ts
752
+ import path3 from "node:path";
753
+ import { setTimeout as delay } from "node:timers/promises";
754
+ function teamProgressCursor(state) {
755
+ return hash(
756
+ canonical({
757
+ status: state.status,
758
+ phase: state.phase,
759
+ revision: state.revision,
760
+ members: state.members.map((m) => [m.role, m.status]),
761
+ reviews: state.reviews.length,
762
+ qa: state.qa.length,
763
+ verification: state.verification?.length ?? 0
764
+ })
765
+ );
766
+ }
767
+ async function startWork(ctx, input, panel = openPanel, team = new TeamService(ctx)) {
768
+ await requireTrust(ctx.root);
769
+ if (process.env.APEXREST_TEAM_WORKER === "1")
770
+ throw new Fault("TEAM_RECURSION", "Team workers cannot start another chat workflow.", 2);
771
+ const { requestId, ...fields } = parse(workStartSchema, input);
772
+ const request = teamStartSchema.parse({ ...fields, project: ctx.root });
773
+ const state = await withLock(
774
+ await contained(ctx.root, ".apexrest/work-" + requestId + ".lock"),
775
+ async () => {
776
+ const directory = await team.directory(requestId);
777
+ const inputFile = path3.join(directory, "work-input.json");
778
+ if (await exists(path3.join(directory, "request.json"))) {
779
+ const saved = queuedWorkSchema.parse(await readJson(path3.join(directory, "request.json")));
780
+ const { multiAgentEnabled: _optIn, ...savedRequest } = saved;
781
+ const matches = await exists(inputFile) ? canonical(await readJson(inputFile)) === canonical(request) : canonical(savedRequest) === canonical(resolvedTeamStartSchema.parse(request));
782
+ if (!matches)
783
+ throw new Fault(
784
+ "WORK_REQUEST_CONFLICT",
785
+ "This request ID belongs to a different task. Inspect the original team.",
786
+ 5,
787
+ "conflict"
788
+ );
789
+ if (!await exists(path3.join(directory, "state.json")))
790
+ throw new Fault(
791
+ "WORK_START_UNKNOWN",
792
+ "Task creation is incomplete. Inspect this request ID before any retry.",
793
+ 6,
794
+ "outcome_unknown"
795
+ );
796
+ } else {
797
+ const effective = await resolveWorkRequest(ctx.root, request);
798
+ await writeJson(inputFile, request);
799
+ await team.start(effective, requestId);
800
+ }
801
+ return team.snapshot(requestId);
802
+ }
803
+ );
804
+ if (state.executionHost === "current_session")
805
+ return {
806
+ ...currentSessionHandoff(state),
807
+ projectContext: projectSummary(ctx),
808
+ cursor: teamProgressCursor(state),
809
+ panel: { status: "not_requested" }
810
+ };
811
+ let display;
812
+ try {
813
+ const opened = await panel(ctx.root), url = new URL(opened.url);
814
+ const fragment = new URLSearchParams(url.hash.slice(1));
815
+ fragment.set("team", requestId);
816
+ fragment.set("view", "team");
817
+ url.hash = fragment.toString();
818
+ display = { status: "ready", url: url.toString() };
819
+ } catch (error) {
820
+ display = {
821
+ status: "unavailable",
822
+ message: redact(error instanceof Error ? error.message : String(error)).slice(0, 600)
823
+ };
824
+ }
825
+ return {
826
+ teamId: requestId,
827
+ executionMode: recordedExecutionMode(state),
828
+ executionHost: state.executionHost ?? "worker",
829
+ browserMode: state.browserMode ?? "codex",
830
+ status: state.status,
831
+ cursor: teamProgressCursor(state),
832
+ panel: display,
833
+ nextAction: "Open panel.url in the Codex in-app browser when available. Follow this team with apexrest_team_wait; deliver its terminal result in the originating chat. Reuse requestId only for an exact retry."
834
+ };
835
+ }
836
+ async function waitForTeam(ctx, input, signal) {
837
+ const request = parse(teamWaitSchema, input), team = new TeamService(ctx);
838
+ const deadline = Date.now() + request.waitSeconds * 1e3;
839
+ let state = await team.status(request.id);
840
+ while (teamActive.has(state.status) && request.cursor === teamProgressCursor(state) && Date.now() < deadline && !signal?.aborted) {
841
+ await delay(Math.min(250, Math.max(1, deadline - Date.now())));
842
+ state = await team.status(request.id);
843
+ }
844
+ const result = await team.snapshot(request.id);
845
+ const cursor = teamProgressCursor(result), terminal = !teamActive.has(result.status);
846
+ const unchanged = !terminal && request.cursor === cursor;
847
+ return {
848
+ cursor,
849
+ terminal,
850
+ unchanged,
851
+ team: unchanged ? {
852
+ id: result.id,
853
+ status: result.status,
854
+ phase: result.phase,
855
+ revision: result.revision,
856
+ executionMode: result.executionMode,
857
+ browserMode: result.browserMode,
858
+ fullReport: result.fullReport
859
+ } : result
860
+ };
861
+ }
862
+
863
+ // packages/core/src/service.ts
864
+ import { realpath } from "node:fs/promises";
865
+ async function dispatch(operation, input = {}, signal) {
866
+ try {
867
+ if (signal?.aborted)
868
+ throw new Fault("CANCELLED", "Operation cancelled before execution.", 6, "cancelled");
869
+ if (!(operation in schemas)) throw new Fault("INVALID_INPUT", `Unknown operation: ${operation}`, 2);
870
+ const parsed = parse(
871
+ schemas[operation],
872
+ input
873
+ );
874
+ const text = (key) => parsed[key];
875
+ const root = text("project") ?? process.cwd();
876
+ const oracle = new OracleAdapter(), tests = new TestService(oracle), deployment = new DeploymentService(oracle, (ctx, env2) => tests.all(ctx, env2));
877
+ let data;
878
+ switch (operation) {
879
+ case "panel.open": {
880
+ const { openPanel: openPanel2 } = await import("./chunk-ICWYSHJ7.mjs");
881
+ data = await openPanel2(await realpath(root));
882
+ break;
883
+ }
884
+ case "panel.status":
885
+ data = await new PanelService(root).snapshot(parsed.team);
886
+ break;
887
+ case "panel.action":
888
+ {
889
+ const action = panelActionSchema.parse(parsed).action;
890
+ if (action.kind === "connection" && action.password !== void 0)
891
+ throw new Fault(
892
+ "LOCAL_CREDENTIAL_ENTRY_REQUIRED",
893
+ "Enter the ORDS password only in the local browser settings form, or supply a local password file to connection.add.",
894
+ 3,
895
+ "blocked"
896
+ );
897
+ data = await new PanelService(root).act(action);
898
+ }
899
+ break;
900
+ case "version":
901
+ data = { version: VERSION, node: process.version };
902
+ break;
903
+ case "doctor":
904
+ data = await doctor();
905
+ break;
906
+ case "sqlcl.status":
907
+ data = await sqlclConfig();
908
+ break;
909
+ case "sqlcl.configure":
910
+ data = await configureSqlcl(
911
+ text("mode"),
912
+ parsed.mcpRestrictLevel,
913
+ parsed.databaseTransport
914
+ );
915
+ break;
916
+ case "dependencies.install": {
917
+ const { ToolchainService } = await import("./chunk-JWX4UQAZ.mjs");
918
+ data = await new ToolchainService().apply(parsed);
919
+ break;
920
+ }
921
+ case "dependencies.uninstall": {
922
+ const { uninstallTools } = await import("./chunk-FPOEB42H.mjs");
923
+ data = await uninstallTools(parsed);
924
+ break;
925
+ }
926
+ case "setup":
927
+ case "plugin.install":
928
+ case "plugin.update": {
929
+ const { setup: setup2 } = await import("./chunk-3GSS6SJH.mjs");
930
+ data = await setup2(parsed);
931
+ break;
932
+ }
933
+ case "plugin.validate": {
934
+ const { validateNative } = await import("./chunk-3GSS6SJH.mjs");
935
+ data = await validateNative(text("from"));
936
+ break;
937
+ }
938
+ case "plugin.uninstall": {
939
+ const { uninstallNative } = await import("./chunk-3GSS6SJH.mjs");
940
+ data = await uninstallNative(text("home") ?? managedHome(), Boolean(parsed.keepRuntime));
941
+ break;
942
+ }
943
+ case "project.init":
944
+ data = await projectInit(
945
+ text("directory"),
946
+ text("template"),
947
+ text("alias") ?? path4.basename(path4.resolve(text("directory"))).toLowerCase().replace(/[^a-z0-9-]/g, "-")
948
+ );
949
+ break;
950
+ case "connection.add":
951
+ data = await configureConnection(text("name"), {
952
+ sqlclName: text("sqlclName"),
953
+ ordsUrl: text("ordsUrl"),
954
+ ordsUsername: text("ordsUsername"),
955
+ passwordFile: text("passwordFile")
956
+ });
957
+ break;
958
+ case "connection.remove":
959
+ data = await editConnection(text("name"));
960
+ break;
961
+ case "connection.list":
962
+ data = parsed.saved ? await oracle.savedConnections(signal) : await connections();
963
+ break;
964
+ case "connection.test":
965
+ if (parsed.saved && (await oracle.settings()).databaseTransport === "ords")
966
+ throw new Fault(
967
+ "ORDS_SAVED_CONNECTION_UNSUPPORTED",
968
+ "ORDS uses plugin connection references. Test the configured reference without --saved.",
969
+ 3,
970
+ "blocked"
971
+ );
972
+ data = await oracle.identity(
973
+ parsed.saved ? { kind: "sqlcl-store", name: text("name") } : await resolveConnection(text("name")),
974
+ signal
975
+ );
976
+ if (parsed.saved) data = { name: text("name"), ...data };
977
+ break;
978
+ case "docs.search":
979
+ data = await referenceSearch(text("query"), text("version"), schemas["docs.search"].parse(parsed));
980
+ break;
981
+ case "docs.read":
982
+ data = await referenceRead(text("id"), Number(parsed.offset), Number(parsed.limit));
983
+ break;
984
+ case "docs.sync":
985
+ data = await referenceSync(text("version"), Boolean(parsed.dryRun));
986
+ break;
987
+ case "sandbox.up":
988
+ case "sandbox.status":
989
+ case "sandbox.down":
990
+ data = await sandboxAction(operation.split(".")[1]);
991
+ break;
992
+ default: {
993
+ const ctx = await loadProject(root);
994
+ switch (operation) {
995
+ case "work.start":
996
+ data = await startWork(ctx, workStartSchema.parse(parsed));
997
+ break;
998
+ case "team.wait":
999
+ data = await waitForTeam(ctx, teamWaitSchema.parse(parsed), signal);
1000
+ break;
1001
+ case "team.start":
1002
+ data = await new TeamService(ctx).start(teamStartSchema.parse(parsed));
1003
+ break;
1004
+ case "team.status":
1005
+ data = await new TeamService(ctx).snapshot(text("id"));
1006
+ break;
1007
+ case "team.message":
1008
+ data = await new TeamService(ctx).message(text("id"), text("message"));
1009
+ break;
1010
+ case "team.cancel":
1011
+ data = await new TeamService(ctx).cancel(text("id"));
1012
+ break;
1013
+ case "project.inspect":
1014
+ data = await projectInspect(ctx, parsed.detail);
1015
+ break;
1016
+ case "metadata.read": {
1017
+ const env2 = environment(ctx, text("env"));
1018
+ const { project: _p, env: _e, ...request } = parsed;
1019
+ data = await metadataRead(oracle, env2, await resolveConnection(env2.readConnectionRef), request);
1020
+ break;
1021
+ }
1022
+ case "apex.generate": {
1023
+ await requireTrust(ctx.root);
1024
+ const generated = await oracle.generate(
1025
+ text("name"),
1026
+ text("alias") ?? ctx.config.application.alias
1027
+ );
1028
+ data = {
1029
+ ...await installSources(generated.directory, ctx.root, text("output")),
1030
+ compiler: generated.compiler
1031
+ };
1032
+ break;
1033
+ }
1034
+ case "project.adopt":
1035
+ case "apex.export": {
1036
+ await requireTrust(ctx.root);
1037
+ const env2 = environment(ctx, text("env"));
1038
+ if (operation === "project.adopt" && env2.applicationId !== parsed.appId)
1039
+ throw new Fault(
1040
+ "APPLICATION_TARGET_MISMATCH",
1041
+ "Requested app ID differs from the environment mapping.",
1042
+ 5
1043
+ );
1044
+ const connection = await resolveConnection(env2.readConnectionRef);
1045
+ await oracle.verifyTarget(env2, connection);
1046
+ const exported = await oracle.exportApplication(env2, connection);
1047
+ data = await installSources(
1048
+ exported.directory,
1049
+ ctx.root,
1050
+ operation === "project.adopt" ? ctx.config.application.sourceDir : text("output")
1051
+ );
1052
+ break;
1053
+ }
1054
+ case "apex.validate":
1055
+ await requireTrust(ctx.root);
1056
+ data = await oracle.validate(await contained(ctx.root, ctx.config.application.sourceDir), signal);
1057
+ break;
1058
+ case "apex.diff": {
1059
+ await requireTrust(ctx.root);
1060
+ const env2 = environment(ctx, text("env")), connection = await resolveConnection(env2.readConnectionRef);
1061
+ await oracle.verifyTarget(env2, connection);
1062
+ const exported = await oracle.exportApplication(env2, connection), local = (await projectInspect(ctx)).sources.apex;
1063
+ data = {
1064
+ scope: "full-application-import",
1065
+ completeness: "textual-file-hashes-only",
1066
+ changes: [.../* @__PURE__ */ new Set([...Object.keys(exported.files), ...Object.keys(local ?? {})])].filter((f) => exported.files[f] !== local?.[f]).map((file) => ({
1067
+ file,
1068
+ before: exported.files[file] ?? null,
1069
+ after: local?.[file] ?? null
1070
+ }))
1071
+ };
1072
+ break;
1073
+ }
1074
+ case "db.plan":
1075
+ data = await deployment.plan(ctx, text("env"));
1076
+ break;
1077
+ case "deploy.plan": {
1078
+ const plan = await deployment.plan(ctx, text("env"));
1079
+ await writeJson(await contained(ctx.root, text("out")), plan);
1080
+ data = plan;
1081
+ break;
1082
+ }
1083
+ case "deploy.apply":
1084
+ data = await deployment.apply(
1085
+ ctx,
1086
+ await readJson(await contained(ctx.root, text("plan"))),
1087
+ signal
1088
+ );
1089
+ break;
1090
+ case "deploy.status":
1091
+ data = await deployment.reconcile(ctx, text("run"));
1092
+ break;
1093
+ case "deploy.restore-plan": {
1094
+ const plan = await deployment.restorePlan(ctx, text("backup"));
1095
+ await writeJson(await contained(ctx.root, text("out")), plan);
1096
+ data = plan;
1097
+ break;
1098
+ }
1099
+ case "test.run": {
1100
+ const suite = text("suite");
1101
+ if (suite === "all") {
1102
+ if (!parsed.env) throw new Fault("ENVIRONMENT_REQUIRED", "test all requires --env.", 2);
1103
+ const result = await tests.all(ctx, text("env"), signal);
1104
+ data = result.data;
1105
+ if (!result.ok)
1106
+ return {
1107
+ ...failure(operation, new Fault("QUALITY_GATE_FAILED", "Required suites did not pass.", 1)),
1108
+ data
1109
+ };
1110
+ } else {
1111
+ const result = await tests.run(
1112
+ ctx,
1113
+ suite,
1114
+ text("env"),
1115
+ signal,
1116
+ Boolean(parsed.headed)
1117
+ );
1118
+ data = result;
1119
+ if (result.status !== "passed")
1120
+ return {
1121
+ ...failure(
1122
+ operation,
1123
+ new Fault(
1124
+ "TEST_" + result.status.toUpperCase(),
1125
+ result.diagnostic ?? `Suite is ${result.status}.`,
1126
+ result.status === "failed" ? 1 : 3,
1127
+ result.status
1128
+ )
1129
+ ),
1130
+ data
1131
+ };
1132
+ }
1133
+ break;
1134
+ }
1135
+ case "test.report":
1136
+ data = await readJson(await contained(ctx.root, ".apexrest/test-runs/" + text("run") + ".json"));
1137
+ break;
1138
+ case "test.auth":
1139
+ data = await tests.auth(ctx, text("env"));
1140
+ break;
1141
+ case "browser.open": {
1142
+ const { openVerificationBrowser } = await import("./chunk-RF4XQO6I.mjs");
1143
+ data = await openVerificationBrowser(
1144
+ ctx,
1145
+ text("env"),
1146
+ void 0,
1147
+ parsed.browserMode
1148
+ );
1149
+ break;
1150
+ }
1151
+ case "jobs.status":
1152
+ data = await new JobService(ctx).status(text("id"), Number(parsed.waitSeconds), signal);
1153
+ break;
1154
+ case "jobs.cancel":
1155
+ data = await new JobService(ctx).cancel(text("id"));
1156
+ break;
1157
+ case "artifacts.read":
1158
+ data = await new ArtifactService(ctx).read(
1159
+ text("id"),
1160
+ Number(parsed.offset),
1161
+ Number(parsed.limit)
1162
+ );
1163
+ break;
1164
+ default:
1165
+ throw new Fault("INVALID_INPUT", "Unknown operation.", 2);
1166
+ }
1167
+ }
1168
+ }
1169
+ return success(operation, data);
1170
+ } catch (error) {
1171
+ return failure(operation, error);
1172
+ }
1173
+ }
1174
+
1175
+ export {
1176
+ schemas,
1177
+ toolCatalog,
1178
+ dispatch
1179
+ };