toolcraft 0.0.27 → 0.0.33

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 (242) hide show
  1. package/dist/cli.compile-check.js +7 -1
  2. package/dist/cli.d.ts +9 -1
  3. package/dist/cli.js +134 -62
  4. package/dist/design.d.ts +1 -0
  5. package/dist/design.js +1 -0
  6. package/dist/error-codes.d.ts +1 -0
  7. package/dist/error-codes.js +6 -0
  8. package/dist/human-in-loop/approvals-commands.js +2 -1
  9. package/dist/human-in-loop/runner.js +2 -2
  10. package/dist/index.d.ts +6 -2
  11. package/dist/json-schema-converter.js +12 -1
  12. package/dist/mcp-proxy.js +26 -9
  13. package/dist/mcp.js +55 -4
  14. package/dist/renderer.js +1 -1
  15. package/dist/schema-scope.js +22 -1
  16. package/dist/sdk.js +51 -3
  17. package/dist/source-snippet.js +1 -1
  18. package/node_modules/@poe-code/agent-defs/dist/agents/claude-code.js +5 -0
  19. package/node_modules/@poe-code/agent-defs/dist/agents/codex.js +10 -0
  20. package/node_modules/@poe-code/agent-defs/dist/agents/cursor.d.ts +2 -0
  21. package/node_modules/@poe-code/agent-defs/dist/agents/cursor.js +15 -0
  22. package/node_modules/@poe-code/agent-defs/dist/agents/goose.js +1 -0
  23. package/node_modules/@poe-code/agent-defs/dist/agents/index.d.ts +1 -0
  24. package/node_modules/@poe-code/agent-defs/dist/agents/index.js +1 -0
  25. package/node_modules/@poe-code/agent-defs/dist/agents/opencode.js +5 -0
  26. package/node_modules/@poe-code/agent-defs/dist/index.d.ts +2 -2
  27. package/node_modules/@poe-code/agent-defs/dist/index.js +1 -1
  28. package/node_modules/@poe-code/agent-defs/dist/registry.js +8 -1
  29. package/node_modules/@poe-code/agent-defs/dist/specifier.js +7 -3
  30. package/node_modules/@poe-code/agent-defs/dist/types.d.ts +5 -0
  31. package/node_modules/@poe-code/agent-human-in-loop/dist/providers/osascript.js +7 -1
  32. package/node_modules/@poe-code/agent-mcp-config/dist/configs.js +6 -0
  33. package/node_modules/@poe-code/config-mutations/dist/error-codes.d.ts +1 -0
  34. package/node_modules/@poe-code/config-mutations/dist/error-codes.js +6 -0
  35. package/node_modules/@poe-code/config-mutations/dist/execution/apply-mutation.js +25 -15
  36. package/node_modules/@poe-code/config-mutations/dist/formats/json.js +1 -1
  37. package/node_modules/@poe-code/config-mutations/dist/formats/toml.js +1 -1
  38. package/node_modules/@poe-code/config-mutations/dist/formats/yaml.js +1 -1
  39. package/node_modules/@poe-code/config-mutations/dist/fs-utils.js +2 -4
  40. package/node_modules/@poe-code/config-mutations/dist/template/render.js +1 -1
  41. package/node_modules/@poe-code/config-mutations/package.json +1 -1
  42. package/node_modules/@poe-code/process-runner/dist/host/host-execution-env.js +18 -5
  43. package/node_modules/@poe-code/process-runner/dist/host/host-runner.js +38 -4
  44. package/node_modules/@poe-code/process-runner/dist/workspace-transfer.js +8 -2
  45. package/node_modules/@poe-code/task-list/dist/backends/gh-issues-sync.js +10 -7
  46. package/node_modules/@poe-code/task-list/dist/backends/markdown-dir.js +13 -6
  47. package/node_modules/@poe-code/task-list/dist/backends/utils.js +15 -10
  48. package/node_modules/@poe-code/task-list/dist/backends/yaml-file.js +39 -22
  49. package/node_modules/@poe-code/task-list/dist/move.js +4 -1
  50. package/node_modules/@poe-code/task-list/dist/open.js +42 -20
  51. package/node_modules/@poe-code/task-list/dist/state-machine.js +8 -5
  52. package/node_modules/auth-store/dist/create-secret-store.js +6 -1
  53. package/node_modules/auth-store/dist/encrypted-file-store.d.ts +1 -1
  54. package/node_modules/auth-store/dist/encrypted-file-store.js +32 -28
  55. package/node_modules/auth-store/dist/error-codes.d.ts +1 -0
  56. package/node_modules/auth-store/dist/error-codes.js +5 -0
  57. package/node_modules/auth-store/dist/keychain-store.js +23 -8
  58. package/node_modules/mcp-oauth/dist/client/auth-store-session-store.js +17 -5
  59. package/node_modules/mcp-oauth/dist/client/authorization-state.js +21 -8
  60. package/node_modules/mcp-oauth/dist/client/default-oauth-client-provider.js +128 -55
  61. package/node_modules/mcp-oauth/dist/client/token-endpoint.js +27 -17
  62. package/node_modules/mcp-oauth/dist/server/jwks-token-verifier.js +43 -22
  63. package/node_modules/toolcraft-design/README.md +148 -0
  64. package/node_modules/toolcraft-design/dist/components/catalog.d.ts +26 -0
  65. package/node_modules/toolcraft-design/dist/components/catalog.js +94 -0
  66. package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/index.d.ts +2 -0
  67. package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/index.js +1 -0
  68. package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/components/footer.js +1 -2
  69. package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/components/output-pane.js +16 -19
  70. package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/components/stats-pane.js +1 -15
  71. package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/demo.js +2 -2
  72. package/node_modules/toolcraft-design/dist/explorer/theme.js +29 -0
  73. package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/index.d.ts +7 -1
  74. package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/index.js +4 -0
  75. package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/internal/theme-detect.d.ts +1 -0
  76. package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/internal/theme-detect.js +28 -6
  77. package/node_modules/toolcraft-design/dist/internal/theme-state.d.ts +12 -0
  78. package/node_modules/toolcraft-design/dist/internal/theme-state.js +35 -0
  79. package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/theme.d.ts +1 -1
  80. package/node_modules/toolcraft-design/dist/prompts/theme.js +15 -0
  81. package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/parser/frontmatter.js +50 -0
  82. package/node_modules/toolcraft-design/dist/tokens/brand.d.ts +5 -0
  83. package/node_modules/toolcraft-design/dist/tokens/brand.js +5 -0
  84. package/node_modules/toolcraft-design/dist/tokens/colors.d.ts +37 -0
  85. package/node_modules/toolcraft-design/dist/tokens/colors.js +85 -0
  86. package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/tokens/index.d.ts +2 -0
  87. package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/tokens/index.js +1 -0
  88. package/node_modules/toolcraft-design/package.json +42 -0
  89. package/package.json +10 -6
  90. package/node_modules/@poe-code/design-system/dist/explorer/theme.js +0 -97
  91. package/node_modules/@poe-code/design-system/dist/prompts/theme.js +0 -12
  92. package/node_modules/@poe-code/design-system/dist/tokens/colors.d.ts +0 -35
  93. package/node_modules/@poe-code/design-system/dist/tokens/colors.js +0 -34
  94. package/node_modules/@poe-code/design-system/package.json +0 -29
  95. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/acp/components.d.ts +0 -0
  96. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/acp/components.js +0 -0
  97. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/acp/index.d.ts +0 -0
  98. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/acp/index.js +0 -0
  99. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/acp/writer.d.ts +0 -0
  100. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/acp/writer.js +0 -0
  101. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/browser.d.ts +0 -0
  102. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/browser.js +0 -0
  103. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/color.d.ts +0 -0
  104. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/color.js +0 -0
  105. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/command-errors.d.ts +0 -0
  106. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/command-errors.js +0 -0
  107. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/detail-card.d.ts +0 -0
  108. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/detail-card.js +0 -0
  109. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/help-formatter-plain.d.ts +0 -0
  110. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/help-formatter-plain.js +0 -0
  111. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/help-formatter.d.ts +0 -0
  112. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/help-formatter.js +0 -0
  113. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/logger.d.ts +0 -0
  114. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/logger.js +0 -0
  115. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/symbols.d.ts +0 -0
  116. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/symbols.js +0 -0
  117. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/table.d.ts +0 -0
  118. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/table.js +0 -0
  119. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/template.d.ts +0 -0
  120. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/template.js +0 -0
  121. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/text.d.ts +0 -0
  122. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/text.js +0 -0
  123. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/ansi.d.ts +0 -0
  124. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/ansi.js +0 -0
  125. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/buffer.d.ts +0 -0
  126. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/buffer.js +0 -0
  127. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/components/border.d.ts +0 -0
  128. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/components/border.js +0 -0
  129. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/components/footer.d.ts +0 -0
  130. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/components/output-pane.d.ts +0 -0
  131. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/components/stats-pane.d.ts +0 -0
  132. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/dashboard.d.ts +0 -0
  133. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/dashboard.js +0 -0
  134. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/demo.d.ts +0 -0
  135. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/demo.js +0 -0
  136. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/index.d.ts +0 -0
  137. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/index.js +0 -0
  138. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/keymap.d.ts +0 -0
  139. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/keymap.js +0 -0
  140. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/layout.d.ts +0 -0
  141. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/layout.js +0 -0
  142. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/should-use-dashboard.d.ts +0 -0
  143. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/should-use-dashboard.js +0 -0
  144. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/snapshot.d.ts +0 -0
  145. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/snapshot.js +0 -0
  146. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/store.d.ts +0 -0
  147. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/store.js +0 -0
  148. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/terminal-width.d.ts +0 -0
  149. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/terminal-width.js +0 -0
  150. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/terminal.d.ts +0 -0
  151. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/terminal.js +0 -0
  152. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/types.d.ts +0 -0
  153. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/types.js +0 -0
  154. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/actions.d.ts +0 -0
  155. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/actions.js +0 -0
  156. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/demo.d.ts +0 -0
  157. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/events.d.ts +0 -0
  158. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/events.js +0 -0
  159. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/filter.d.ts +0 -0
  160. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/filter.js +0 -0
  161. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/index.d.ts +0 -0
  162. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/index.js +0 -0
  163. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/jobs.d.ts +0 -0
  164. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/jobs.js +0 -0
  165. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/keymap.d.ts +0 -0
  166. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/keymap.js +0 -0
  167. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/layout.d.ts +0 -0
  168. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/layout.js +0 -0
  169. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/reducer.d.ts +0 -0
  170. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/reducer.js +0 -0
  171. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/detail.d.ts +0 -0
  172. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/detail.js +0 -0
  173. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/footer.d.ts +0 -0
  174. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/footer.js +0 -0
  175. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/header.d.ts +0 -0
  176. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/header.js +0 -0
  177. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/index.d.ts +0 -0
  178. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/index.js +0 -0
  179. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/list.d.ts +0 -0
  180. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/list.js +0 -0
  181. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/modal.d.ts +0 -0
  182. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/modal.js +0 -0
  183. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/test-fixtures.d.ts +0 -0
  184. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/test-fixtures.js +0 -0
  185. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/text.d.ts +0 -0
  186. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/text.js +0 -0
  187. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/runtime.d.ts +0 -0
  188. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/runtime.js +0 -0
  189. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/runtime.test-helpers.d.ts +0 -0
  190. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/runtime.test-helpers.js +0 -0
  191. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/state.d.ts +0 -0
  192. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/state.js +0 -0
  193. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/theme.d.ts +0 -0
  194. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/internal/color-support.d.ts +0 -0
  195. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/internal/color-support.js +0 -0
  196. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/internal/output-format.d.ts +0 -0
  197. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/internal/output-format.js +0 -0
  198. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/internal/strip-ansi.d.ts +0 -0
  199. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/internal/strip-ansi.js +0 -0
  200. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/index.d.ts +0 -0
  201. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/index.js +0 -0
  202. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/cancel.d.ts +0 -0
  203. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/cancel.js +0 -0
  204. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/intro.d.ts +0 -0
  205. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/intro.js +0 -0
  206. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/log.d.ts +0 -0
  207. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/log.js +0 -0
  208. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/note.d.ts +0 -0
  209. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/note.js +0 -0
  210. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/outro.d.ts +0 -0
  211. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/outro.js +0 -0
  212. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/spinner.d.ts +0 -0
  213. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/spinner.js +0 -0
  214. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/static/index.d.ts +0 -0
  215. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/static/index.js +0 -0
  216. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/static/menu.d.ts +0 -0
  217. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/static/menu.js +0 -0
  218. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/static/spinner.d.ts +0 -0
  219. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/static/spinner.js +0 -0
  220. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/ast.d.ts +0 -0
  221. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/ast.js +0 -0
  222. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/demo-content.d.ts +0 -0
  223. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/demo-content.js +0 -0
  224. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/index.d.ts +0 -0
  225. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/index.js +0 -0
  226. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/parser/block.d.ts +0 -0
  227. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/parser/block.js +0 -0
  228. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/parser/frontmatter.d.ts +0 -0
  229. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/parser/inline.d.ts +0 -0
  230. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/parser/inline.js +0 -0
  231. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/parser.d.ts +0 -0
  232. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/parser.js +0 -0
  233. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/renderer.d.ts +0 -0
  234. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/renderer.js +0 -0
  235. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/testing/theme-render-fixture.d.ts +0 -0
  236. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/testing/theme-render-fixture.js +0 -0
  237. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/tokens/spacing.d.ts +0 -0
  238. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/tokens/spacing.js +0 -0
  239. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/tokens/typography.d.ts +0 -0
  240. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/tokens/typography.js +0 -0
  241. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/tokens/widths.d.ts +0 -0
  242. /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/tokens/widths.js +0 -0
@@ -1,9 +1,11 @@
1
1
  import { spawn as spawnChildProcess } from "node:child_process";
2
2
  export function createHostRunner(options = {}) {
3
- const detachedByDefault = options.detached === true;
3
+ const runnerOptions = normalizeHostRunnerOptions(options);
4
+ const detachedByDefault = runnerOptions.detached === true;
4
5
  return {
5
6
  name: "host",
6
- exec(spec) {
7
+ exec(inputSpec) {
8
+ const spec = normalizeRunSpec(inputSpec);
7
9
  if (spec.signal?.aborted === true) {
8
10
  return {
9
11
  pid: null,
@@ -21,12 +23,12 @@ export function createHostRunner(options = {}) {
21
23
  const stdio = stdinMode === "inherit" && stdoutMode === "inherit" && stderrMode === "inherit"
22
24
  ? "inherit"
23
25
  : [stdinMode, stdoutMode, stderrMode];
24
- const child = spawnChildProcess(spec.command, spec.args ?? [], {
26
+ const child = spawnChildProcess(spec.command, spec.args ?? [], createNullRecord({
25
27
  cwd: spec.cwd,
26
28
  env: spec.env,
27
29
  stdio,
28
30
  ...(killProcessGroup ? { detached: true } : {})
29
- });
31
+ }));
30
32
  if (killProcessGroup) {
31
33
  child.unref();
32
34
  }
@@ -75,6 +77,38 @@ export function createHostRunner(options = {}) {
75
77
  }
76
78
  };
77
79
  }
80
+ function normalizeHostRunnerOptions(options) {
81
+ return createNullRecord({
82
+ ...optionalOwnProperty(options, "detached")
83
+ });
84
+ }
85
+ function normalizeRunSpec(spec) {
86
+ return createNullRecord({
87
+ command: getOwnProperty(spec, "command"),
88
+ ...optionalOwnProperty(spec, "args"),
89
+ ...optionalOwnProperty(spec, "cwd"),
90
+ ...optionalOwnProperty(spec, "env"),
91
+ ...optionalOwnProperty(spec, "stdin"),
92
+ ...optionalOwnProperty(spec, "stdout"),
93
+ ...optionalOwnProperty(spec, "stderr"),
94
+ ...optionalOwnProperty(spec, "tty"),
95
+ ...optionalOwnProperty(spec, "signal"),
96
+ ...optionalOwnProperty(spec, "killProcessGroup")
97
+ });
98
+ }
99
+ function optionalOwnProperty(value, name) {
100
+ const property = getOwnProperty(value, name);
101
+ return property === undefined ? {} : { [name]: property };
102
+ }
103
+ function getOwnProperty(value, name) {
104
+ return hasOwnProperty(value, name) ? value[name] : undefined;
105
+ }
106
+ function hasOwnProperty(value, name) {
107
+ return Object.prototype.hasOwnProperty.call(value, name);
108
+ }
109
+ function createNullRecord(value) {
110
+ return Object.assign(Object.create(null), value);
111
+ }
78
112
  function bindAbortSignal(signal, onAbort) {
79
113
  if (signal === undefined) {
80
114
  return () => { };
@@ -496,8 +496,14 @@ function stripSlashes(value) {
496
496
  return value.slice(start, end);
497
497
  }
498
498
  function isNotFoundError(error) {
499
- return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
499
+ return hasOwnErrorCode(error, "ENOENT");
500
500
  }
501
501
  function isAlreadyExistsError(error) {
502
- return typeof error === "object" && error !== null && "code" in error && error.code === "EEXIST";
502
+ return hasOwnErrorCode(error, "EEXIST");
503
+ }
504
+ function hasOwnErrorCode(error, code) {
505
+ return (typeof error === "object" &&
506
+ error !== null &&
507
+ Object.prototype.hasOwnProperty.call(error, "code") &&
508
+ error.code === code);
503
509
  }
@@ -328,20 +328,23 @@ function isExactStatusField(field) {
328
328
  function isStatusOption(value) {
329
329
  return (typeof value === "object" &&
330
330
  value !== null &&
331
- "id" in value &&
331
+ hasOwnProperty(value, "id") &&
332
332
  typeof value.id === "string" &&
333
- "name" in value &&
333
+ hasOwnProperty(value, "name") &&
334
334
  typeof value.name === "string" &&
335
- (!("color" in value) || typeof value.color === "string") &&
336
- (!("description" in value) || typeof value.description === "string"));
335
+ (!hasOwnProperty(value, "color") || typeof value.color === "string") &&
336
+ (!hasOwnProperty(value, "description") || typeof value.description === "string"));
337
337
  }
338
338
  function isStatusField(value) {
339
339
  return (typeof value === "object" &&
340
340
  value !== null &&
341
- "id" in value &&
341
+ hasOwnProperty(value, "id") &&
342
342
  typeof value.id === "string" &&
343
- (!("name" in value) || typeof value.name === "string") &&
344
- "options" in value &&
343
+ (!hasOwnProperty(value, "name") || typeof value.name === "string") &&
344
+ hasOwnProperty(value, "options") &&
345
345
  Array.isArray(value.options) &&
346
346
  value.options.every(isStatusOption));
347
347
  }
348
+ function hasOwnProperty(value, name) {
349
+ return Object.prototype.hasOwnProperty.call(value, name);
350
+ }
@@ -139,29 +139,36 @@ function readFrontmatter(frontmatterContent, filePath) {
139
139
  return parsed;
140
140
  }
141
141
  function assertValidTaskRecord(frontmatter, filePath, validStates) {
142
- if ("$schema" in frontmatter && frontmatter.$schema !== TASK_SCHEMA_ID) {
142
+ if (hasOwnTaskField(frontmatter, "$schema") && frontmatter.$schema !== TASK_SCHEMA_ID) {
143
143
  throw malformedTask(filePath, "$schema");
144
144
  }
145
- if ("kind" in frontmatter && frontmatter.kind !== TASK_KIND) {
145
+ if (hasOwnTaskField(frontmatter, "kind") && frontmatter.kind !== TASK_KIND) {
146
146
  throw malformedTask(filePath, "kind");
147
147
  }
148
- if ("version" in frontmatter) {
148
+ if (hasOwnTaskField(frontmatter, "version")) {
149
149
  if (typeof frontmatter.version !== "number" ||
150
150
  !Number.isInteger(frontmatter.version) ||
151
151
  frontmatter.version !== TASK_VERSION) {
152
152
  throw malformedTask(filePath, "version");
153
153
  }
154
154
  }
155
- if (typeof frontmatter.name !== "string" || frontmatter.name.length === 0) {
155
+ if (!hasOwnTaskField(frontmatter, "name") ||
156
+ typeof frontmatter.name !== "string" ||
157
+ frontmatter.name.length === 0) {
156
158
  throw malformedTask(filePath, "name");
157
159
  }
158
- if (typeof frontmatter.state !== "string" || !validStates.has(frontmatter.state)) {
160
+ if (!hasOwnTaskField(frontmatter, "state") ||
161
+ typeof frontmatter.state !== "string" ||
162
+ !validStates.has(frontmatter.state)) {
159
163
  throw malformedTask(filePath, "state");
160
164
  }
161
- if ("description" in frontmatter && typeof frontmatter.description !== "string") {
165
+ if (hasOwnTaskField(frontmatter, "description") && typeof frontmatter.description !== "string") {
162
166
  throw malformedTask(filePath, "description");
163
167
  }
164
168
  }
169
+ function hasOwnTaskField(frontmatter, key) {
170
+ return Object.prototype.hasOwnProperty.call(frontmatter, key);
171
+ }
165
172
  function reservedFrontmatterKeys(mode) {
166
173
  return mode === "passthrough" ? PASSTHROUGH_RESERVED_FRONTMATTER_KEYS : RESERVED_FRONTMATTER_KEYS;
167
174
  }
@@ -1,3 +1,4 @@
1
+ import { randomUUID } from "node:crypto";
1
2
  import path from "node:path";
2
3
  export function compareCreated(left, right) {
3
4
  const leftCreated = typeof left.raw.created === "string" ? left.raw.created : "";
@@ -20,11 +21,10 @@ export function applyOrder(entries, order) {
20
21
  }
21
22
  return entries.map((entry) => entry.task);
22
23
  }
23
- let tmpFileCounter = 0;
24
24
  export function hasErrorCode(error, code) {
25
25
  return (!!error &&
26
26
  typeof error === "object" &&
27
- "code" in error &&
27
+ Object.prototype.hasOwnProperty.call(error, "code") &&
28
28
  error.code === code);
29
29
  }
30
30
  export function isRecord(value) {
@@ -78,20 +78,24 @@ export async function rejectSymbolicLinkComponents(fs, filePath) {
78
78
  }
79
79
  }
80
80
  export async function writeAtomically(fs, filePath, content) {
81
- const tempPath = `${filePath}.tmp-${process.pid}-${tmpFileCounter}`;
82
- tmpFileCounter += 1;
81
+ const tempPath = `${filePath}.${process.pid}.${randomUUID()}.tmp`;
82
+ let tempCreated = false;
83
83
  await fs.mkdir(path.dirname(filePath), { recursive: true });
84
84
  try {
85
85
  await fs.writeFile(tempPath, content, { encoding: "utf8", flag: "wx" });
86
+ tempCreated = true;
86
87
  await fs.rename(tempPath, filePath);
88
+ tempCreated = false;
87
89
  }
88
90
  catch (error) {
89
- try {
90
- await fs.unlink(tempPath);
91
- }
92
- catch (unlinkError) {
93
- if (!hasErrorCode(unlinkError, "ENOENT")) {
94
- throw unlinkError;
91
+ if (tempCreated || !hasErrorCode(error, "EEXIST")) {
92
+ try {
93
+ await fs.unlink(tempPath);
94
+ }
95
+ catch (unlinkError) {
96
+ if (!hasErrorCode(unlinkError, "ENOENT")) {
97
+ throw unlinkError;
98
+ }
95
99
  }
96
100
  }
97
101
  throw error;
@@ -106,6 +110,7 @@ export async function withFileLock(fs, lockPath, operation) {
106
110
  }
107
111
  catch (error) {
108
112
  if (!hasErrorCode(error, "EEXIST")) {
113
+ await fs.unlink(lockPath).catch(() => undefined);
109
114
  throw error;
110
115
  }
111
116
  if (await removeAbandonedLock(fs, lockPath)) {
@@ -50,7 +50,8 @@ function parseQualifiedId(qualifiedId) {
50
50
  };
51
51
  }
52
52
  function descriptionFromTaskRecord(taskRecord) {
53
- return typeof taskRecord.description === "string" ? taskRecord.description : "";
53
+ const description = getOwnEntry(taskRecord, "description");
54
+ return typeof description === "string" ? description : "";
54
55
  }
55
56
  function metadataFromTaskRecord(taskRecord) {
56
57
  const metadata = Object.create(null);
@@ -66,8 +67,8 @@ function createTask(list, id, taskRecord, sourcePath) {
66
67
  list,
67
68
  id,
68
69
  qualifiedId: `${list}/${id}`,
69
- name: taskRecord.name,
70
- state: taskRecord.state,
70
+ name: getOwnEntry(taskRecord, "name"),
71
+ state: getOwnEntry(taskRecord, "state"),
71
72
  description: descriptionFromTaskRecord(taskRecord),
72
73
  metadata: metadataFromTaskRecord(taskRecord),
73
74
  ...(sourcePath !== undefined && { sourcePath: path.resolve(sourcePath) })
@@ -163,18 +164,19 @@ function assertValidStoreRecord(store, filePath) {
163
164
  if (!isRecord(store)) {
164
165
  throw malformedStore(filePath, "store");
165
166
  }
166
- if (store.$schema !== STORE_SCHEMA_ID) {
167
+ if (getOwnEntry(store, "$schema") !== STORE_SCHEMA_ID) {
167
168
  throw malformedStore(filePath, "$schema");
168
169
  }
169
- if (store.kind !== STORE_KIND) {
170
+ if (getOwnEntry(store, "kind") !== STORE_KIND) {
170
171
  throw malformedStore(filePath, "kind");
171
172
  }
172
- if (typeof store.version !== "number" ||
173
- !Number.isInteger(store.version) ||
174
- store.version !== STORE_VERSION) {
173
+ const version = getOwnEntry(store, "version");
174
+ if (typeof version !== "number" ||
175
+ !Number.isInteger(version) ||
176
+ version !== STORE_VERSION) {
175
177
  throw malformedStore(filePath, "version");
176
178
  }
177
- if (!isRecord(store.lists)) {
179
+ if (!isRecord(getOwnEntry(store, "lists"))) {
178
180
  throw malformedStore(filePath, "lists");
179
181
  }
180
182
  }
@@ -182,31 +184,45 @@ function assertValidTaskRecord(taskRecord, list, id, validStates) {
182
184
  if (!isRecord(taskRecord)) {
183
185
  throw malformedTask(list, id, "task");
184
186
  }
185
- if ("$schema" in taskRecord && taskRecord.$schema !== TASK_SCHEMA_ID) {
187
+ if (hasOwnTaskField(taskRecord, "$schema") && getOwnEntry(taskRecord, "$schema") !== TASK_SCHEMA_ID) {
186
188
  throw malformedTask(list, id, "$schema");
187
189
  }
188
- if ("kind" in taskRecord && taskRecord.kind !== TASK_KIND) {
190
+ if (hasOwnTaskField(taskRecord, "kind") && getOwnEntry(taskRecord, "kind") !== TASK_KIND) {
189
191
  throw malformedTask(list, id, "kind");
190
192
  }
191
- if ("version" in taskRecord) {
192
- if (typeof taskRecord.version !== "number" ||
193
- !Number.isInteger(taskRecord.version) ||
194
- taskRecord.version !== TASK_VERSION) {
193
+ if (hasOwnTaskField(taskRecord, "version")) {
194
+ const version = getOwnEntry(taskRecord, "version");
195
+ if (typeof version !== "number" ||
196
+ !Number.isInteger(version) ||
197
+ version !== TASK_VERSION) {
195
198
  throw malformedTask(list, id, "version");
196
199
  }
197
200
  }
198
- if (typeof taskRecord.name !== "string" || taskRecord.name.length === 0) {
201
+ const name = getOwnEntry(taskRecord, "name");
202
+ if (!hasOwnTaskField(taskRecord, "name") ||
203
+ typeof name !== "string" ||
204
+ name.length === 0) {
199
205
  throw malformedTask(list, id, "name");
200
206
  }
201
- if (typeof taskRecord.state !== "string" || !validStates.has(taskRecord.state)) {
207
+ const state = getOwnEntry(taskRecord, "state");
208
+ if (!hasOwnTaskField(taskRecord, "state") ||
209
+ typeof state !== "string" ||
210
+ !validStates.has(state)) {
202
211
  throw malformedTask(list, id, "state");
203
212
  }
204
- if ("description" in taskRecord && typeof taskRecord.description !== "string") {
213
+ if (hasOwnTaskField(taskRecord, "description") &&
214
+ typeof getOwnEntry(taskRecord, "description") !== "string") {
205
215
  throw malformedTask(list, id, "description");
206
216
  }
207
217
  }
218
+ function hasOwnTaskField(taskRecord, key) {
219
+ return Object.prototype.hasOwnProperty.call(taskRecord, key);
220
+ }
221
+ function getOwnEntry(record, key) {
222
+ return Object.prototype.hasOwnProperty.call(record, key) ? record[key] : undefined;
223
+ }
208
224
  function validateStoreEntries(store, filePath, validStates) {
209
- const lists = store.lists;
225
+ const lists = getOwnEntry(store, "lists");
210
226
  if (!isRecord(lists)) {
211
227
  throw malformedStore(filePath, "lists");
212
228
  }
@@ -247,10 +263,11 @@ async function readStore(fs, filePath, validStates) {
247
263
  };
248
264
  }
249
265
  function getListsRecord(store) {
250
- return store.lists;
266
+ const lists = getOwnEntry(store, "lists");
267
+ return isRecord(lists) ? lists : {};
251
268
  }
252
269
  function getListRecord(store, list) {
253
- const listRecord = getListsRecord(store)[list];
270
+ const listRecord = getOwnEntry(getListsRecord(store), list);
254
271
  return isRecord(listRecord) ? listRecord : undefined;
255
272
  }
256
273
  function getTaskRecord(store, list, id) {
@@ -546,7 +563,7 @@ export async function yamlFileBackend(deps) {
546
563
  const result = [];
547
564
  const listNames = sortStrings(Object.keys(getListsRecord(store)));
548
565
  for (const listName of listNames) {
549
- const listRecord = getListsRecord(store)[listName];
566
+ const listRecord = getOwnEntry(getListsRecord(store), listName);
550
567
  if (!isRecord(listRecord))
551
568
  continue;
552
569
  const entries = Object.entries(listRecord)
@@ -115,7 +115,7 @@ async function applyState(tasks, created, events) {
115
115
  return task;
116
116
  }
117
117
  function readOnlySourceOptions(options) {
118
- if (!("create" in options)) {
118
+ if (!hasOwnProperty(options, "create")) {
119
119
  return options;
120
120
  }
121
121
  return { ...options, create: false };
@@ -213,3 +213,6 @@ function createTokenBucket(rate) {
213
213
  function errorMessage(error) {
214
214
  return error instanceof Error ? error.message : String(error);
215
215
  }
216
+ function hasOwnProperty(value, key) {
217
+ return Object.prototype.hasOwnProperty.call(value, key);
218
+ }
@@ -13,48 +13,70 @@ function createDefaultFs() {
13
13
  return fsPromises;
14
14
  }
15
15
  export async function openTaskList(options) {
16
- switch (options.type) {
16
+ const type = getOwnProperty(options, "type");
17
+ switch (type) {
17
18
  case "markdown-dir":
18
19
  case "yaml-file":
19
20
  return openFileBackend(options);
20
21
  case "gh-issues":
21
22
  return openGhIssuesBackend(options);
22
23
  default:
23
- throw new Error(`Unknown task list backend type "${options.type}".`);
24
+ throw new Error(`Unknown task list backend type "${String(type)}".`);
24
25
  }
25
26
  }
26
27
  async function openFileBackend(options) {
27
- const factory = backendFactories[options.type];
28
- const stateMachine = resolveStateMachine(options.stateMachine);
28
+ const type = getOwnProperty(options, "type");
29
+ const factory = backendFactories[type];
30
+ const stateMachine = resolveStateMachine(getOwnProperty(options, "stateMachine"));
29
31
  validateMachine(stateMachine);
30
- const markdownOptions = options.type === "markdown-dir" ? options : undefined;
32
+ const markdownOptions = type === "markdown-dir" ? options : undefined;
33
+ const defaults = getOwnProperty(options, "defaults");
31
34
  const deps = {
32
- path: options.path,
35
+ path: getOwnProperty(options, "path"),
33
36
  defaults: {
34
- metadata: { ...(options.defaults?.metadata ?? {}) }
37
+ metadata: readDefaultMetadata(defaults)
35
38
  },
36
- singleList: markdownOptions?.singleList,
37
- frontmatterMode: markdownOptions?.frontmatterMode ?? "strict",
38
- create: options.create ?? false,
39
- fs: options.fs ?? createDefaultFs(),
39
+ singleList: markdownOptions === undefined
40
+ ? undefined
41
+ : getOwnProperty(markdownOptions, "singleList"),
42
+ frontmatterMode: markdownOptions === undefined
43
+ ? "strict"
44
+ : (getOwnProperty(markdownOptions, "frontmatterMode") ?? "strict"),
45
+ create: getOwnProperty(options, "create") ?? false,
46
+ fs: getOwnProperty(options, "fs") ?? createDefaultFs(),
40
47
  stateMachine
41
48
  };
42
49
  return factory(deps);
43
50
  }
44
51
  async function openGhIssuesBackend(options) {
45
- const token = await resolveAuth({ explicitToken: options.auth?.token });
52
+ const auth = getOwnProperty(options, "auth");
53
+ const explicitToken = auth && hasOwnProperty(auth, "token") ? auth.token : undefined;
46
54
  const endpoint = resolveEndpoint();
55
+ const defaults = getOwnProperty(options, "defaults");
47
56
  return ghIssuesBackend({
48
- repo: options.repo,
49
- project: options.project,
50
- filter: options.filter,
51
- state: options.state,
52
- stateMachine: options.stateMachine,
57
+ repo: getOwnProperty(options, "repo"),
58
+ project: getOwnProperty(options, "project"),
59
+ filter: getOwnProperty(options, "filter"),
60
+ state: getOwnProperty(options, "state"),
61
+ stateMachine: getOwnProperty(options, "stateMachine"),
53
62
  defaults: {
54
- metadata: { ...(options.defaults?.metadata ?? {}) }
63
+ metadata: readDefaultMetadata(defaults)
55
64
  },
56
- token,
65
+ token: await resolveAuth({ explicitToken }),
57
66
  endpoint,
58
- fetch: options.fetch
67
+ fetch: getOwnProperty(options, "fetch")
59
68
  });
60
69
  }
70
+ function readDefaultMetadata(defaults) {
71
+ const metadata = defaults === undefined ? undefined : getOwnProperty(defaults, "metadata");
72
+ return isRecord(metadata) ? { ...metadata } : {};
73
+ }
74
+ function getOwnProperty(value, name) {
75
+ return hasOwnProperty(value, name) ? value[name] : undefined;
76
+ }
77
+ function hasOwnProperty(value, name) {
78
+ return Object.prototype.hasOwnProperty.call(value, name);
79
+ }
80
+ function isRecord(value) {
81
+ return typeof value === "object" && value !== null && !Array.isArray(value);
82
+ }
@@ -14,27 +14,27 @@ export function validateMachine(machine) {
14
14
  if (!isRecord(machine)) {
15
15
  throw new TypeError("State machine must be an object.");
16
16
  }
17
- if (!isStateList(machine.states)) {
17
+ if (!hasOwnRecordField(machine, "states") || !isStateList(machine.states)) {
18
18
  throw new TypeError("State machine states must be a string array.");
19
19
  }
20
20
  const states = new Set(machine.states);
21
- if (typeof machine.initial !== "string") {
21
+ if (!hasOwnRecordField(machine, "initial") || typeof machine.initial !== "string") {
22
22
  throw new TypeError("State machine initial must be a string.");
23
23
  }
24
24
  if (!states.has(machine.initial)) {
25
25
  throw new Error(`Initial state "${machine.initial}" is not declared.`);
26
26
  }
27
- if (!isRecord(machine.events)) {
27
+ if (!hasOwnRecordField(machine, "events") || !isRecord(machine.events)) {
28
28
  throw new TypeError("State machine events must be an object.");
29
29
  }
30
30
  for (const [eventName, event] of Object.entries(machine.events)) {
31
31
  if (!isRecord(event)) {
32
32
  throw new TypeError(`Event "${eventName}" must be an object.`);
33
33
  }
34
- if (event.from !== "*" && !isStateList(event.from)) {
34
+ if (!hasOwnRecordField(event, "from") || (event.from !== "*" && !isStateList(event.from))) {
35
35
  throw new TypeError(`Event "${eventName}" has an invalid "from" definition.`);
36
36
  }
37
- if (typeof event.to !== "string") {
37
+ if (!hasOwnRecordField(event, "to") || typeof event.to !== "string") {
38
38
  throw new TypeError(`Event "${eventName}" target state must be a string.`);
39
39
  }
40
40
  if (!states.has(event.to)) {
@@ -49,6 +49,9 @@ export function validateMachine(machine) {
49
49
  }
50
50
  }
51
51
  }
52
+ function hasOwnRecordField(record, key) {
53
+ return Object.prototype.hasOwnProperty.call(record, key);
54
+ }
52
55
  export function eventsFromState(machine, fromState) {
53
56
  const events = [];
54
57
  for (const [eventName, event] of Object.entries(machine.events)) {
@@ -27,7 +27,7 @@ export function createSecretStore(input) {
27
27
  }
28
28
  function resolveBackend(input) {
29
29
  const envVar = input.backendEnvVar ?? DEFAULT_BACKEND_ENV_VAR;
30
- const configuredBackend = input.backend ?? input.env?.[envVar] ?? process.env[envVar];
30
+ const configuredBackend = input.backend ?? getOwnEnvValue(input.env, envVar) ?? getOwnEnvValue(process.env, envVar);
31
31
  if (configuredBackend === "keychain") {
32
32
  return "keychain";
33
33
  }
@@ -36,3 +36,8 @@ function resolveBackend(input) {
36
36
  }
37
37
  throw new Error(`Unsupported auth store backend: ${configuredBackend}`);
38
38
  }
39
+ function getOwnEnvValue(env, key) {
40
+ return env !== undefined && Object.prototype.hasOwnProperty.call(env, key)
41
+ ? env[key]
42
+ : undefined;
43
+ }
@@ -42,6 +42,6 @@ export declare class EncryptedFileStore implements SecretStore {
42
42
  get(): Promise<string | null>;
43
43
  set(value: string): Promise<void>;
44
44
  delete(): Promise<void>;
45
- private assertRegularCredentialPath;
45
+ private assertCredentialPathHasNoSymbolicLinks;
46
46
  private getEncryptionKey;
47
47
  }