@sean.holung/minicode 0.3.8 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/scripts/run-ts-bench-smoke.js +268 -0
- package/dist/scripts/ts-bench-adapter.js +251 -0
- package/dist/src/agent/config.js +2 -2
- package/dist/src/auto-allow.js +28 -0
- package/dist/src/benchmark/config.js +197 -0
- package/dist/src/benchmark/index.js +2 -0
- package/dist/src/benchmark/workspace-changes.js +125 -0
- package/dist/src/cli/args.js +13 -0
- package/dist/src/cli/benchmark-run.js +432 -0
- package/dist/src/cli/permissions-slash-command.js +50 -0
- package/dist/src/index.js +9 -2
- package/dist/src/indexer/plugin-loader.js +19 -1
- package/dist/src/indexer/project-index.js +35 -21
- package/dist/src/serve/agent-bridge.js +132 -2
- package/dist/src/serve/openai-compat.js +2 -2
- package/dist/src/serve/server.js +14 -0
- package/dist/src/serve/websocket.js +11 -0
- package/dist/src/session/session-store.js +11 -1
- package/dist/src/tools/registry.js +10 -2
- package/dist/src/ui/app.js +8 -2
- package/dist/src/ui/cli-ink.js +13 -2
- package/dist/src/ui/components/permission-prompt.js +53 -0
- package/dist/src/ui/permission-gate.js +42 -0
- package/dist/src/ui/state/ui-store.js +13 -0
- package/dist/src/web/app.js +217 -28
- package/dist/src/web/index.html +63 -2
- package/dist/src/web/style.css +986 -1699
- package/dist/tests/agent.test.js +110 -0
- package/dist/tests/benchmark-config.test.js +80 -0
- package/dist/tests/benchmark-run.test.js +180 -0
- package/dist/tests/cli-args.test.js +22 -0
- package/dist/tests/cli-oneshot.integration.test.js +5 -0
- package/dist/tests/config.test.js +21 -0
- package/dist/tests/context-indicator.test.js +9 -0
- package/dist/tests/file-tools.test.js +36 -0
- package/dist/tests/harbor-adapter.test.js +57 -0
- package/dist/tests/indexer.test.js +1 -1
- package/dist/tests/permission-gate-cli.test.js +126 -0
- package/dist/tests/permission-gate.test.js +196 -0
- package/dist/tests/python-plugin.test.js +357 -0
- package/dist/tests/serve.integration.test.js +31 -0
- package/dist/tests/session-store.test.js +18 -1
- package/dist/tests/session-ui.test.js +6 -0
- package/dist/tests/system-prompt.test.js +44 -9
- package/dist/tests/ts-bench-adapter.test.js +186 -0
- package/dist/tests/workspace-changes.test.js +82 -0
- package/node_modules/@minicode/agent-sdk/README.md +286 -90
- package/node_modules/@minicode/agent-sdk/dist/src/agent/agent.d.ts +40 -4
- package/node_modules/@minicode/agent-sdk/dist/src/agent/agent.d.ts.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/agent/agent.js +134 -27
- package/node_modules/@minicode/agent-sdk/dist/src/agent/agent.js.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/agent/structured-output.d.ts +42 -0
- package/node_modules/@minicode/agent-sdk/dist/src/agent/structured-output.d.ts.map +1 -0
- package/node_modules/@minicode/agent-sdk/dist/src/agent/structured-output.js +97 -0
- package/node_modules/@minicode/agent-sdk/dist/src/agent/structured-output.js.map +1 -0
- package/node_modules/@minicode/agent-sdk/dist/src/agent/types.d.ts +97 -2
- package/node_modules/@minicode/agent-sdk/dist/src/agent/types.d.ts.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/agent/types.js +15 -1
- package/node_modules/@minicode/agent-sdk/dist/src/agent/types.js.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/index.d.ts +10 -8
- package/node_modules/@minicode/agent-sdk/dist/src/index.d.ts.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/index.js +10 -6
- package/node_modules/@minicode/agent-sdk/dist/src/index.js.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/indexer/types.d.ts +8 -3
- package/node_modules/@minicode/agent-sdk/dist/src/indexer/types.d.ts.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/mcp/client-registry.d.ts +109 -0
- package/node_modules/@minicode/agent-sdk/dist/src/mcp/client-registry.d.ts.map +1 -0
- package/node_modules/@minicode/agent-sdk/dist/src/mcp/client-registry.js +237 -0
- package/node_modules/@minicode/agent-sdk/dist/src/mcp/client-registry.js.map +1 -0
- package/node_modules/@minicode/agent-sdk/dist/src/model/client.d.ts +5 -1
- package/node_modules/@minicode/agent-sdk/dist/src/model/client.d.ts.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/model/client.js +100 -8
- package/node_modules/@minicode/agent-sdk/dist/src/model/client.js.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/prompt/system-prompt.d.ts +31 -1
- package/node_modules/@minicode/agent-sdk/dist/src/prompt/system-prompt.d.ts.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/prompt/system-prompt.js +8 -7
- package/node_modules/@minicode/agent-sdk/dist/src/prompt/system-prompt.js.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/session/session.d.ts +8 -0
- package/node_modules/@minicode/agent-sdk/dist/src/session/session.d.ts.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/session/session.js +2 -0
- package/node_modules/@minicode/agent-sdk/dist/src/session/session.js.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/tools/edit-file.d.ts +10 -3
- package/node_modules/@minicode/agent-sdk/dist/src/tools/edit-file.d.ts.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/tools/edit-file.js +3 -3
- package/node_modules/@minicode/agent-sdk/dist/src/tools/edit-file.js.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/tools/list-files.d.ts +9 -2
- package/node_modules/@minicode/agent-sdk/dist/src/tools/list-files.d.ts.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/tools/list-files.js +2 -2
- package/node_modules/@minicode/agent-sdk/dist/src/tools/list-files.js.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/tools/read-file.d.ts +12 -2
- package/node_modules/@minicode/agent-sdk/dist/src/tools/read-file.d.ts.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/tools/read-file.js +3 -3
- package/node_modules/@minicode/agent-sdk/dist/src/tools/read-file.js.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/tools/run-command.d.ts +12 -2
- package/node_modules/@minicode/agent-sdk/dist/src/tools/run-command.d.ts.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/tools/run-command.js +5 -5
- package/node_modules/@minicode/agent-sdk/dist/src/tools/run-command.js.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/tools/search.d.ts +10 -2
- package/node_modules/@minicode/agent-sdk/dist/src/tools/search.d.ts.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/tools/search.js +5 -5
- package/node_modules/@minicode/agent-sdk/dist/src/tools/search.js.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/tools/write-file.d.ts +10 -3
- package/node_modules/@minicode/agent-sdk/dist/src/tools/write-file.d.ts.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/src/tools/write-file.js +3 -3
- package/node_modules/@minicode/agent-sdk/dist/src/tools/write-file.js.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/agent.test.js +342 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/agent.test.js.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/mcp-client.integration.test.d.ts +2 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/mcp-client.integration.test.d.ts.map +1 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/mcp-client.integration.test.js +64 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/mcp-client.integration.test.js.map +1 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/mcp-client.test.d.ts +2 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/mcp-client.test.d.ts.map +1 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/mcp-client.test.js +350 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/mcp-client.test.js.map +1 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-anthropic-structured-output.test.d.ts +2 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-anthropic-structured-output.test.d.ts.map +1 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-anthropic-structured-output.test.js +211 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-anthropic-structured-output.test.js.map +1 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-openai.test.js +88 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-openai.test.js.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-structured-output.test.d.ts +2 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-structured-output.test.d.ts.map +1 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-structured-output.test.js +171 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-structured-output.test.js.map +1 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/session.test.js +34 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/session.test.js.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/structured-output.test.d.ts +2 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/structured-output.test.d.ts.map +1 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/structured-output.test.js +212 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/structured-output.test.js.map +1 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/system-prompt.test.js +7 -7
- package/node_modules/@minicode/agent-sdk/dist/tests/system-prompt.test.js.map +1 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/tool-factory-options.test.d.ts +2 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/tool-factory-options.test.d.ts.map +1 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/tool-factory-options.test.js +72 -0
- package/node_modules/@minicode/agent-sdk/dist/tests/tool-factory-options.test.js.map +1 -0
- package/node_modules/@minicode/agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@minicode/agent-sdk/package.json +5 -2
- package/node_modules/minicode-plugin-python/dist/src/index.d.ts +9 -0
- package/node_modules/minicode-plugin-python/dist/src/index.d.ts.map +1 -0
- package/node_modules/minicode-plugin-python/dist/src/index.js +679 -0
- package/node_modules/minicode-plugin-python/dist/src/index.js.map +1 -0
- package/node_modules/minicode-plugin-python/dist/tsconfig.tsbuildinfo +1 -0
- package/node_modules/minicode-plugin-python/package.json +37 -0
- package/node_modules/node-addon-api/LICENSE.md +9 -0
- package/node_modules/node-addon-api/README.md +95 -0
- package/node_modules/node-addon-api/common.gypi +21 -0
- package/node_modules/node-addon-api/except.gypi +25 -0
- package/node_modules/node-addon-api/index.js +14 -0
- package/node_modules/node-addon-api/napi-inl.deprecated.h +186 -0
- package/node_modules/node-addon-api/napi-inl.h +7165 -0
- package/node_modules/node-addon-api/napi.h +3364 -0
- package/node_modules/node-addon-api/node_addon_api.gyp +42 -0
- package/node_modules/node-addon-api/node_api.gyp +9 -0
- package/node_modules/node-addon-api/noexcept.gypi +26 -0
- package/node_modules/node-addon-api/nothing.c +0 -0
- package/node_modules/node-addon-api/package-support.json +21 -0
- package/node_modules/node-addon-api/package.json +480 -0
- package/node_modules/node-addon-api/tools/README.md +73 -0
- package/node_modules/node-addon-api/tools/check-napi.js +99 -0
- package/node_modules/node-addon-api/tools/clang-format.js +71 -0
- package/node_modules/node-addon-api/tools/conversion.js +301 -0
- package/node_modules/node-gyp-build/LICENSE +21 -0
- package/node_modules/node-gyp-build/README.md +58 -0
- package/node_modules/node-gyp-build/SECURITY.md +5 -0
- package/node_modules/node-gyp-build/bin.js +84 -0
- package/node_modules/node-gyp-build/build-test.js +19 -0
- package/node_modules/node-gyp-build/index.js +6 -0
- package/node_modules/node-gyp-build/node-gyp-build.js +207 -0
- package/node_modules/node-gyp-build/optional.js +7 -0
- package/node_modules/node-gyp-build/package.json +43 -0
- package/node_modules/tree-sitter/LICENSE +21 -0
- package/node_modules/tree-sitter/README.md +128 -0
- package/node_modules/tree-sitter/binding.gyp +80 -0
- package/node_modules/tree-sitter/index.js +916 -0
- package/node_modules/tree-sitter/package.json +76 -0
- package/node_modules/tree-sitter/src/addon_data.h +47 -0
- package/node_modules/tree-sitter/src/binding.cc +35 -0
- package/node_modules/tree-sitter/src/conversions.cc +140 -0
- package/node_modules/tree-sitter/src/conversions.h +22 -0
- package/node_modules/tree-sitter/src/language.cc +106 -0
- package/node_modules/tree-sitter/src/language.h +17 -0
- package/node_modules/tree-sitter/src/logger.cc +70 -0
- package/node_modules/tree-sitter/src/logger.h +19 -0
- package/node_modules/tree-sitter/src/lookaheaditerator.cc +122 -0
- package/node_modules/tree-sitter/src/lookaheaditerator.h +33 -0
- package/node_modules/tree-sitter/src/node.cc +1088 -0
- package/node_modules/tree-sitter/src/node.h +30 -0
- package/node_modules/tree-sitter/src/parser.cc +306 -0
- package/node_modules/tree-sitter/src/parser.h +35 -0
- package/node_modules/tree-sitter/src/query.cc +397 -0
- package/node_modules/tree-sitter/src/query.h +40 -0
- package/node_modules/tree-sitter/src/tree.cc +316 -0
- package/node_modules/tree-sitter/src/tree.h +45 -0
- package/node_modules/tree-sitter/src/tree_cursor.cc +213 -0
- package/node_modules/tree-sitter/src/tree_cursor.h +52 -0
- package/node_modules/tree-sitter/tree-sitter.d.ts +1042 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/include/tree_sitter/api.h +1478 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.c +48 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.h +41 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/array.h +291 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/atomic.h +68 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/clock.h +146 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/error_costs.h +11 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.c +523 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.h +36 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/host.h +21 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.c +293 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.h +293 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/length.h +52 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.c +483 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.h +54 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lib.c +12 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/node.c +875 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.c +2293 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.h +286 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/point.h +48 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/portable/endian.h +239 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/query.c +4350 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reduce_action.h +34 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reusable_node.h +95 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.c +911 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.h +133 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.c +1034 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.h +399 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.c +170 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.h +31 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.c +717 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.h +48 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/ts_assert.h +11 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ICU_SHA +1 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/LICENSE +414 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/README.md +29 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ptypes.h +1 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/umachine.h +448 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/urename.h +1 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf.h +1 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf16.h +733 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf8.h +881 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode.h +75 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib-symbols.txt +24 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib.c +113 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/wasm-stdlib.h +1314 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.c +1935 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.h +31 -0
- package/node_modules/tree-sitter-python/LICENSE +21 -0
- package/node_modules/tree-sitter-python/README.md +24 -0
- package/node_modules/tree-sitter-python/binding.gyp +35 -0
- package/node_modules/tree-sitter-python/bindings/node/binding.cc +19 -0
- package/node_modules/tree-sitter-python/bindings/node/binding_test.js +9 -0
- package/node_modules/tree-sitter-python/bindings/node/index.d.ts +27 -0
- package/node_modules/tree-sitter-python/bindings/node/index.js +11 -0
- package/node_modules/tree-sitter-python/grammar.js +1225 -0
- package/node_modules/tree-sitter-python/package.json +60 -0
- package/node_modules/tree-sitter-python/prebuilds/darwin-arm64/tree-sitter-python.node +0 -0
- package/node_modules/tree-sitter-python/prebuilds/darwin-x64/tree-sitter-python.node +0 -0
- package/node_modules/tree-sitter-python/prebuilds/linux-arm64/tree-sitter-python.node +0 -0
- package/node_modules/tree-sitter-python/prebuilds/linux-x64/tree-sitter-python.node +0 -0
- package/node_modules/tree-sitter-python/prebuilds/win32-arm64/tree-sitter-python.node +0 -0
- package/node_modules/tree-sitter-python/prebuilds/win32-x64/tree-sitter-python.node +0 -0
- package/node_modules/tree-sitter-python/queries/highlights.scm +137 -0
- package/node_modules/tree-sitter-python/queries/tags.scm +14 -0
- package/node_modules/tree-sitter-python/src/grammar.json +6435 -0
- package/node_modules/tree-sitter-python/src/node-types.json +3746 -0
- package/node_modules/tree-sitter-python/src/parser.c +129742 -0
- package/node_modules/tree-sitter-python/src/scanner.c +437 -0
- package/node_modules/tree-sitter-python/src/tree_sitter/alloc.h +54 -0
- package/node_modules/tree-sitter-python/src/tree_sitter/array.h +291 -0
- package/node_modules/tree-sitter-python/src/tree_sitter/parser.h +286 -0
- package/node_modules/tree-sitter-python/tree-sitter-python.wasm +0 -0
- package/node_modules/tree-sitter-python/tree-sitter.json +42 -0
- package/package.json +13 -7
- package/packages/agent-sdk/node_modules/ajv/.runkit_example.js +23 -0
- package/packages/agent-sdk/node_modules/ajv/LICENSE +22 -0
- package/packages/agent-sdk/node_modules/ajv/README.md +207 -0
- package/packages/agent-sdk/node_modules/ajv/dist/2019.d.ts +19 -0
- package/packages/agent-sdk/node_modules/ajv/dist/2019.js +61 -0
- package/packages/agent-sdk/node_modules/ajv/dist/2019.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/2020.d.ts +19 -0
- package/packages/agent-sdk/node_modules/ajv/dist/2020.js +55 -0
- package/packages/agent-sdk/node_modules/ajv/dist/2020.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/ajv.d.ts +18 -0
- package/packages/agent-sdk/node_modules/ajv/dist/ajv.js +50 -0
- package/packages/agent-sdk/node_modules/ajv/dist/ajv.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/codegen/code.d.ts +40 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/codegen/code.js +156 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/codegen/index.d.ts +79 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/codegen/index.js +697 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/codegen/scope.d.ts +79 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/codegen/scope.js +143 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/errors.d.ts +13 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/errors.js +123 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/errors.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/index.d.ts +80 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/index.js +242 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/index.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/jtd/parse.d.ts +4 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/jtd/parse.js +350 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/jtd/parse.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/jtd/serialize.d.ts +4 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/jtd/serialize.js +236 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/jtd/types.d.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/jtd/types.js +14 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/jtd/types.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/names.d.ts +20 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/names.js +28 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/names.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/ref_error.d.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/ref_error.js +12 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/resolve.d.ts +12 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/resolve.js +155 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/resolve.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/rules.d.ts +28 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/rules.js +26 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/rules.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/util.d.ts +40 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/util.js +178 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/util.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/applicability.d.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/applicability.js +19 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/boolSchema.d.ts +4 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/boolSchema.js +50 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/dataType.d.ts +17 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/dataType.js +203 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/defaults.d.ts +2 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/defaults.js +35 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/index.d.ts +42 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/index.js +520 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/keyword.d.ts +8 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/keyword.js +124 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/subschema.d.ts +47 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/subschema.js +81 -0
- package/packages/agent-sdk/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/core.d.ts +174 -0
- package/packages/agent-sdk/node_modules/ajv/dist/core.js +618 -0
- package/packages/agent-sdk/node_modules/ajv/dist/core.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/jtd.d.ts +47 -0
- package/packages/agent-sdk/node_modules/ajv/dist/jtd.js +72 -0
- package/packages/agent-sdk/node_modules/ajv/dist/jtd.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/data.json +13 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts +2 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2019-09/index.js +28 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +17 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +57 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +14 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +39 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts +2 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +30 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json +17 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json +51 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json +55 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-draft-06.json +137 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-draft-07.json +151 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/json-schema-secure.json +88 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/jtd-schema.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/jtd-schema.js +118 -0
- package/packages/agent-sdk/node_modules/ajv/dist/refs/jtd-schema.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/equal.d.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/equal.js +7 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/equal.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/parseJson.d.ts +18 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/parseJson.js +185 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/parseJson.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/quote.d.ts +5 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/quote.js +30 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/quote.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/re2.d.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/re2.js +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/re2.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/timestamp.d.ts +5 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/timestamp.js +42 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/timestamp.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/ucs2length.d.ts +5 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/ucs2length.js +24 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/uri.d.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/uri.js +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/validation_error.d.ts +7 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/validation_error.js +11 -0
- package/packages/agent-sdk/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/standalone/index.d.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/standalone/index.js +90 -0
- package/packages/agent-sdk/node_modules/ajv/dist/standalone/index.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/standalone/instance.d.ts +12 -0
- package/packages/agent-sdk/node_modules/ajv/dist/standalone/instance.js +35 -0
- package/packages/agent-sdk/node_modules/ajv/dist/standalone/instance.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/types/index.d.ts +183 -0
- package/packages/agent-sdk/node_modules/ajv/dist/types/index.js +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/types/index.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/types/json-schema.d.ts +125 -0
- package/packages/agent-sdk/node_modules/ajv/dist/types/json-schema.js +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/types/json-schema.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/types/jtd-schema.d.ts +174 -0
- package/packages/agent-sdk/node_modules/ajv/dist/types/jtd-schema.js +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/types/jtd-schema.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +8 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +49 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +106 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/allOf.js +23 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +4 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +12 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +7 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/contains.js +95 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +21 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +85 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +11 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/if.js +66 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +13 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/index.js +44 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/items.d.ts +5 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/items.js +52 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/items2020.js +30 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +4 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/not.js +26 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +60 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +75 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +12 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/properties.js +54 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +38 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +13 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/code.d.ts +17 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/code.js +131 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/core/id.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/core/id.js +10 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/core/index.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/core/index.js +16 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/core/ref.d.ts +8 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/core/ref.js +122 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +5 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/discriminator/index.js +104 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +10 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/discriminator/types.js +9 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/draft2020.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/draft2020.js +23 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/draft2020.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/draft7.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/draft7.js +17 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts +5 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +30 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts +5 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +51 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/dynamic/index.js +9 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/dynamic/index.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +16 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +10 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/errors.d.ts +9 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/errors.js +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/errors.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/format/format.d.ts +8 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/format/format.js +92 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/format/index.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/format/index.js +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +71 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +5 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/elements.js +24 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/elements.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/enum.js +43 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/enum.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +9 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/error.js +20 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/error.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +10 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/index.js +29 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/index.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts +5 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/metadata.js +25 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts +4 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/nullable.js +22 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +15 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +22 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/properties.js +149 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts +4 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/ref.js +67 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/ref.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +10 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/type.js +69 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/type.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/union.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/union.js +12 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/union.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +5 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/values.js +51 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/jtd/values.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/metadata.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/metadata.js +18 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/next.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/next.js +8 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/next.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/unevaluated/index.js +7 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +40 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +65 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/const.d.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/const.js +25 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +5 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +12 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +8 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/enum.js +48 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/index.d.ts +16 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/index.js +33 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/limitContains.js +15 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/limitItems.js +24 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/limitLength.js +27 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +11 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +27 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts +3 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +24 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +8 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +26 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +8 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/pattern.js +33 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/required.d.ts +8 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/required.js +79 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +9 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +64 -0
- package/packages/agent-sdk/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
- package/packages/agent-sdk/node_modules/ajv/lib/2019.ts +81 -0
- package/packages/agent-sdk/node_modules/ajv/lib/2020.ts +75 -0
- package/packages/agent-sdk/node_modules/ajv/lib/ajv.ts +70 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/codegen/code.ts +169 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/codegen/index.ts +852 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/codegen/scope.ts +215 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/errors.ts +184 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/index.ts +324 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/jtd/parse.ts +411 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/jtd/serialize.ts +277 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/jtd/types.ts +16 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/names.ts +27 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/ref_error.ts +13 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/resolve.ts +149 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/rules.ts +50 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/util.ts +213 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/validate/applicability.ts +22 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/validate/boolSchema.ts +47 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/validate/dataType.ts +230 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/validate/defaults.ts +32 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/validate/index.ts +582 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/validate/keyword.ts +171 -0
- package/packages/agent-sdk/node_modules/ajv/lib/compile/validate/subschema.ts +135 -0
- package/packages/agent-sdk/node_modules/ajv/lib/core.ts +892 -0
- package/packages/agent-sdk/node_modules/ajv/lib/jtd.ts +132 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/data.json +13 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts +28 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +17 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +57 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +14 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +39 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts +30 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +17 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +51 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +55 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-draft-06.json +137 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-draft-07.json +151 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/json-schema-secure.json +88 -0
- package/packages/agent-sdk/node_modules/ajv/lib/refs/jtd-schema.ts +130 -0
- package/packages/agent-sdk/node_modules/ajv/lib/runtime/equal.ts +7 -0
- package/packages/agent-sdk/node_modules/ajv/lib/runtime/parseJson.ts +177 -0
- package/packages/agent-sdk/node_modules/ajv/lib/runtime/quote.ts +31 -0
- package/packages/agent-sdk/node_modules/ajv/lib/runtime/re2.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/lib/runtime/timestamp.ts +46 -0
- package/packages/agent-sdk/node_modules/ajv/lib/runtime/ucs2length.ts +20 -0
- package/packages/agent-sdk/node_modules/ajv/lib/runtime/uri.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/lib/runtime/validation_error.ts +13 -0
- package/packages/agent-sdk/node_modules/ajv/lib/standalone/index.ts +100 -0
- package/packages/agent-sdk/node_modules/ajv/lib/standalone/instance.ts +36 -0
- package/packages/agent-sdk/node_modules/ajv/lib/types/index.ts +244 -0
- package/packages/agent-sdk/node_modules/ajv/lib/types/json-schema.ts +187 -0
- package/packages/agent-sdk/node_modules/ajv/lib/types/jtd-schema.ts +273 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +56 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +118 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +22 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +14 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/applicator/contains.ts +109 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts +112 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts +11 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/applicator/if.ts +80 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/applicator/index.ts +53 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/applicator/items.ts +59 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/applicator/items2020.ts +36 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/applicator/not.ts +38 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +82 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +91 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts +12 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/applicator/properties.ts +57 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts +50 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts +13 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/code.ts +168 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/core/id.ts +10 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/core/index.ts +16 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/core/ref.ts +129 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/discriminator/index.ts +113 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/discriminator/types.ts +12 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/draft2020.ts +23 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/draft7.ts +17 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +31 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts +51 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/dynamic/index.ts +9 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts +14 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts +10 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/errors.ts +18 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/format/format.ts +120 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/format/index.ts +6 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +89 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/jtd/elements.ts +32 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/jtd/enum.ts +45 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/jtd/error.ts +23 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/jtd/index.ts +37 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/jtd/metadata.ts +24 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +21 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +15 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/jtd/properties.ts +184 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/jtd/ref.ts +76 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/jtd/type.ts +75 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/jtd/union.ts +12 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/jtd/values.ts +58 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/metadata.ts +17 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/next.ts +8 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/unevaluated/index.ts +7 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +47 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +85 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/validation/const.ts +28 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts +23 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/validation/enum.ts +54 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/validation/index.ts +49 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/validation/limitContains.ts +16 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/validation/limitItems.ts +26 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +30 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts +42 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +26 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts +34 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/validation/pattern.ts +39 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/validation/required.ts +98 -0
- package/packages/agent-sdk/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +79 -0
- package/packages/agent-sdk/node_modules/ajv/package.json +126 -0
- package/packages/agent-sdk/node_modules/json-schema-traverse/.eslintrc.yml +27 -0
- package/packages/agent-sdk/node_modules/json-schema-traverse/.github/FUNDING.yml +2 -0
- package/packages/agent-sdk/node_modules/json-schema-traverse/.github/workflows/build.yml +28 -0
- package/packages/agent-sdk/node_modules/json-schema-traverse/.github/workflows/publish.yml +27 -0
- package/packages/agent-sdk/node_modules/json-schema-traverse/LICENSE +21 -0
- package/packages/agent-sdk/node_modules/json-schema-traverse/README.md +95 -0
- package/packages/agent-sdk/node_modules/json-schema-traverse/index.d.ts +40 -0
- package/packages/agent-sdk/node_modules/json-schema-traverse/index.js +93 -0
- package/packages/agent-sdk/node_modules/json-schema-traverse/package.json +43 -0
- package/packages/agent-sdk/node_modules/json-schema-traverse/spec/.eslintrc.yml +6 -0
- package/packages/agent-sdk/node_modules/json-schema-traverse/spec/fixtures/schema.js +125 -0
- package/packages/agent-sdk/node_modules/json-schema-traverse/spec/index.spec.js +171 -0
|
@@ -0,0 +1,1034 @@
|
|
|
1
|
+
#include <ctype.h>
|
|
2
|
+
#include <stdint.h>
|
|
3
|
+
#include <stdbool.h>
|
|
4
|
+
#include <string.h>
|
|
5
|
+
#include <stdio.h>
|
|
6
|
+
#include "./alloc.h"
|
|
7
|
+
#include "./array.h"
|
|
8
|
+
#include "./atomic.h"
|
|
9
|
+
#include "./subtree.h"
|
|
10
|
+
#include "./length.h"
|
|
11
|
+
#include "./language.h"
|
|
12
|
+
#include "./error_costs.h"
|
|
13
|
+
#include "./ts_assert.h"
|
|
14
|
+
#include <stddef.h>
|
|
15
|
+
|
|
16
|
+
typedef struct {
|
|
17
|
+
Length start;
|
|
18
|
+
Length old_end;
|
|
19
|
+
Length new_end;
|
|
20
|
+
} Edit;
|
|
21
|
+
|
|
22
|
+
#define TS_MAX_INLINE_TREE_LENGTH UINT8_MAX
|
|
23
|
+
#define TS_MAX_TREE_POOL_SIZE 32
|
|
24
|
+
|
|
25
|
+
// ExternalScannerState
|
|
26
|
+
|
|
27
|
+
void ts_external_scanner_state_init(ExternalScannerState *self, const char *data, unsigned length) {
|
|
28
|
+
self->length = length;
|
|
29
|
+
if (length > sizeof(self->short_data)) {
|
|
30
|
+
self->long_data = ts_malloc(length);
|
|
31
|
+
memcpy(self->long_data, data, length);
|
|
32
|
+
} else {
|
|
33
|
+
memcpy(self->short_data, data, length);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
ExternalScannerState ts_external_scanner_state_copy(const ExternalScannerState *self) {
|
|
38
|
+
ExternalScannerState result = *self;
|
|
39
|
+
if (self->length > sizeof(self->short_data)) {
|
|
40
|
+
result.long_data = ts_malloc(self->length);
|
|
41
|
+
memcpy(result.long_data, self->long_data, self->length);
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
void ts_external_scanner_state_delete(ExternalScannerState *self) {
|
|
47
|
+
if (self->length > sizeof(self->short_data)) {
|
|
48
|
+
ts_free(self->long_data);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const char *ts_external_scanner_state_data(const ExternalScannerState *self) {
|
|
53
|
+
if (self->length > sizeof(self->short_data)) {
|
|
54
|
+
return self->long_data;
|
|
55
|
+
} else {
|
|
56
|
+
return self->short_data;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
bool ts_external_scanner_state_eq(const ExternalScannerState *self, const char *buffer, unsigned length) {
|
|
61
|
+
return
|
|
62
|
+
self->length == length &&
|
|
63
|
+
memcmp(ts_external_scanner_state_data(self), buffer, length) == 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// SubtreeArray
|
|
67
|
+
|
|
68
|
+
void ts_subtree_array_copy(SubtreeArray self, SubtreeArray *dest) {
|
|
69
|
+
dest->size = self.size;
|
|
70
|
+
dest->capacity = self.capacity;
|
|
71
|
+
dest->contents = self.contents;
|
|
72
|
+
if (self.capacity > 0) {
|
|
73
|
+
dest->contents = ts_calloc(self.capacity, sizeof(Subtree));
|
|
74
|
+
memcpy(dest->contents, self.contents, self.size * sizeof(Subtree));
|
|
75
|
+
for (uint32_t i = 0; i < self.size; i++) {
|
|
76
|
+
ts_subtree_retain(dest->contents[i]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
void ts_subtree_array_clear(SubtreePool *pool, SubtreeArray *self) {
|
|
82
|
+
for (uint32_t i = 0; i < self->size; i++) {
|
|
83
|
+
ts_subtree_release(pool, self->contents[i]);
|
|
84
|
+
}
|
|
85
|
+
array_clear(self);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
void ts_subtree_array_delete(SubtreePool *pool, SubtreeArray *self) {
|
|
89
|
+
ts_subtree_array_clear(pool, self);
|
|
90
|
+
array_delete(self);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
void ts_subtree_array_remove_trailing_extras(
|
|
94
|
+
SubtreeArray *self,
|
|
95
|
+
SubtreeArray *destination
|
|
96
|
+
) {
|
|
97
|
+
array_clear(destination);
|
|
98
|
+
while (self->size > 0) {
|
|
99
|
+
Subtree last = self->contents[self->size - 1];
|
|
100
|
+
if (ts_subtree_extra(last)) {
|
|
101
|
+
self->size--;
|
|
102
|
+
array_push(destination, last);
|
|
103
|
+
} else {
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
ts_subtree_array_reverse(destination);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
void ts_subtree_array_reverse(SubtreeArray *self) {
|
|
111
|
+
for (uint32_t i = 0, limit = self->size / 2; i < limit; i++) {
|
|
112
|
+
size_t reverse_index = self->size - 1 - i;
|
|
113
|
+
Subtree swap = self->contents[i];
|
|
114
|
+
self->contents[i] = self->contents[reverse_index];
|
|
115
|
+
self->contents[reverse_index] = swap;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// SubtreePool
|
|
120
|
+
|
|
121
|
+
SubtreePool ts_subtree_pool_new(uint32_t capacity) {
|
|
122
|
+
SubtreePool self = {array_new(), array_new()};
|
|
123
|
+
array_reserve(&self.free_trees, capacity);
|
|
124
|
+
return self;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
void ts_subtree_pool_delete(SubtreePool *self) {
|
|
128
|
+
if (self->free_trees.contents) {
|
|
129
|
+
for (unsigned i = 0; i < self->free_trees.size; i++) {
|
|
130
|
+
ts_free(self->free_trees.contents[i].ptr);
|
|
131
|
+
}
|
|
132
|
+
array_delete(&self->free_trees);
|
|
133
|
+
}
|
|
134
|
+
if (self->tree_stack.contents) array_delete(&self->tree_stack);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
static SubtreeHeapData *ts_subtree_pool_allocate(SubtreePool *self) {
|
|
138
|
+
if (self->free_trees.size > 0) {
|
|
139
|
+
return array_pop(&self->free_trees).ptr;
|
|
140
|
+
} else {
|
|
141
|
+
return ts_malloc(sizeof(SubtreeHeapData));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
static void ts_subtree_pool_free(SubtreePool *self, SubtreeHeapData *tree) {
|
|
146
|
+
if (self->free_trees.capacity > 0 && self->free_trees.size + 1 <= TS_MAX_TREE_POOL_SIZE) {
|
|
147
|
+
array_push(&self->free_trees, (MutableSubtree) {.ptr = tree});
|
|
148
|
+
} else {
|
|
149
|
+
ts_free(tree);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Subtree
|
|
154
|
+
|
|
155
|
+
static inline bool ts_subtree_can_inline(Length padding, Length size, uint32_t lookahead_bytes) {
|
|
156
|
+
return
|
|
157
|
+
padding.bytes < TS_MAX_INLINE_TREE_LENGTH &&
|
|
158
|
+
padding.extent.row < 16 &&
|
|
159
|
+
padding.extent.column < TS_MAX_INLINE_TREE_LENGTH &&
|
|
160
|
+
size.bytes < TS_MAX_INLINE_TREE_LENGTH &&
|
|
161
|
+
size.extent.row == 0 &&
|
|
162
|
+
size.extent.column < TS_MAX_INLINE_TREE_LENGTH &&
|
|
163
|
+
lookahead_bytes < 16;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
Subtree ts_subtree_new_leaf(
|
|
167
|
+
SubtreePool *pool, TSSymbol symbol, Length padding, Length size,
|
|
168
|
+
uint32_t lookahead_bytes, TSStateId parse_state,
|
|
169
|
+
bool has_external_tokens, bool depends_on_column,
|
|
170
|
+
bool is_keyword, const TSLanguage *language
|
|
171
|
+
) {
|
|
172
|
+
TSSymbolMetadata metadata = ts_language_symbol_metadata(language, symbol);
|
|
173
|
+
bool extra = symbol == ts_builtin_sym_end;
|
|
174
|
+
|
|
175
|
+
bool is_inline = (
|
|
176
|
+
symbol <= UINT8_MAX &&
|
|
177
|
+
!has_external_tokens &&
|
|
178
|
+
ts_subtree_can_inline(padding, size, lookahead_bytes)
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
if (is_inline) {
|
|
182
|
+
return (Subtree) {{
|
|
183
|
+
.parse_state = parse_state,
|
|
184
|
+
.symbol = symbol,
|
|
185
|
+
.padding_bytes = padding.bytes,
|
|
186
|
+
.padding_rows = padding.extent.row,
|
|
187
|
+
.padding_columns = padding.extent.column,
|
|
188
|
+
.size_bytes = size.bytes,
|
|
189
|
+
.lookahead_bytes = lookahead_bytes,
|
|
190
|
+
.visible = metadata.visible,
|
|
191
|
+
.named = metadata.named,
|
|
192
|
+
.extra = extra,
|
|
193
|
+
.has_changes = false,
|
|
194
|
+
.is_missing = false,
|
|
195
|
+
.is_keyword = is_keyword,
|
|
196
|
+
.is_inline = true,
|
|
197
|
+
}};
|
|
198
|
+
} else {
|
|
199
|
+
SubtreeHeapData *data = ts_subtree_pool_allocate(pool);
|
|
200
|
+
*data = (SubtreeHeapData) {
|
|
201
|
+
.ref_count = 1,
|
|
202
|
+
.padding = padding,
|
|
203
|
+
.size = size,
|
|
204
|
+
.lookahead_bytes = lookahead_bytes,
|
|
205
|
+
.error_cost = 0,
|
|
206
|
+
.child_count = 0,
|
|
207
|
+
.symbol = symbol,
|
|
208
|
+
.parse_state = parse_state,
|
|
209
|
+
.visible = metadata.visible,
|
|
210
|
+
.named = metadata.named,
|
|
211
|
+
.extra = extra,
|
|
212
|
+
.fragile_left = false,
|
|
213
|
+
.fragile_right = false,
|
|
214
|
+
.has_changes = false,
|
|
215
|
+
.has_external_tokens = has_external_tokens,
|
|
216
|
+
.has_external_scanner_state_change = false,
|
|
217
|
+
.depends_on_column = depends_on_column,
|
|
218
|
+
.is_missing = false,
|
|
219
|
+
.is_keyword = is_keyword,
|
|
220
|
+
{{.first_leaf = {.symbol = 0, .parse_state = 0}}}
|
|
221
|
+
};
|
|
222
|
+
return (Subtree) {.ptr = data};
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
void ts_subtree_set_symbol(
|
|
227
|
+
MutableSubtree *self,
|
|
228
|
+
TSSymbol symbol,
|
|
229
|
+
const TSLanguage *language
|
|
230
|
+
) {
|
|
231
|
+
TSSymbolMetadata metadata = ts_language_symbol_metadata(language, symbol);
|
|
232
|
+
if (self->data.is_inline) {
|
|
233
|
+
ts_assert(symbol < UINT8_MAX);
|
|
234
|
+
self->data.symbol = symbol;
|
|
235
|
+
self->data.named = metadata.named;
|
|
236
|
+
self->data.visible = metadata.visible;
|
|
237
|
+
} else {
|
|
238
|
+
self->ptr->symbol = symbol;
|
|
239
|
+
self->ptr->named = metadata.named;
|
|
240
|
+
self->ptr->visible = metadata.visible;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
Subtree ts_subtree_new_error(
|
|
245
|
+
SubtreePool *pool, int32_t lookahead_char, Length padding, Length size,
|
|
246
|
+
uint32_t bytes_scanned, TSStateId parse_state, const TSLanguage *language
|
|
247
|
+
) {
|
|
248
|
+
Subtree result = ts_subtree_new_leaf(
|
|
249
|
+
pool, ts_builtin_sym_error, padding, size, bytes_scanned,
|
|
250
|
+
parse_state, false, false, false, language
|
|
251
|
+
);
|
|
252
|
+
SubtreeHeapData *data = (SubtreeHeapData *)result.ptr;
|
|
253
|
+
data->fragile_left = true;
|
|
254
|
+
data->fragile_right = true;
|
|
255
|
+
data->lookahead_char = lookahead_char;
|
|
256
|
+
return result;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// Clone a subtree.
|
|
260
|
+
MutableSubtree ts_subtree_clone(Subtree self) {
|
|
261
|
+
size_t alloc_size = ts_subtree_alloc_size(self.ptr->child_count);
|
|
262
|
+
Subtree *new_children = ts_malloc(alloc_size);
|
|
263
|
+
Subtree *old_children = ts_subtree_children(self);
|
|
264
|
+
memcpy(new_children, old_children, alloc_size);
|
|
265
|
+
SubtreeHeapData *result = (SubtreeHeapData *)&new_children[self.ptr->child_count];
|
|
266
|
+
if (self.ptr->child_count > 0) {
|
|
267
|
+
for (uint32_t i = 0; i < self.ptr->child_count; i++) {
|
|
268
|
+
ts_subtree_retain(new_children[i]);
|
|
269
|
+
}
|
|
270
|
+
} else if (self.ptr->has_external_tokens) {
|
|
271
|
+
result->external_scanner_state = ts_external_scanner_state_copy(
|
|
272
|
+
&self.ptr->external_scanner_state
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
result->ref_count = 1;
|
|
276
|
+
return (MutableSubtree) {.ptr = result};
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// Get mutable version of a subtree.
|
|
280
|
+
//
|
|
281
|
+
// This takes ownership of the subtree. If the subtree has only one owner,
|
|
282
|
+
// this will directly convert it into a mutable version. Otherwise, it will
|
|
283
|
+
// perform a copy.
|
|
284
|
+
MutableSubtree ts_subtree_make_mut(SubtreePool *pool, Subtree self) {
|
|
285
|
+
if (self.data.is_inline) return (MutableSubtree) {self.data};
|
|
286
|
+
if (self.ptr->ref_count == 1) return ts_subtree_to_mut_unsafe(self);
|
|
287
|
+
MutableSubtree result = ts_subtree_clone(self);
|
|
288
|
+
ts_subtree_release(pool, self);
|
|
289
|
+
return result;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
void ts_subtree_compress(
|
|
293
|
+
MutableSubtree self,
|
|
294
|
+
unsigned count,
|
|
295
|
+
const TSLanguage *language,
|
|
296
|
+
MutableSubtreeArray *stack
|
|
297
|
+
) {
|
|
298
|
+
unsigned initial_stack_size = stack->size;
|
|
299
|
+
|
|
300
|
+
MutableSubtree tree = self;
|
|
301
|
+
TSSymbol symbol = tree.ptr->symbol;
|
|
302
|
+
for (unsigned i = 0; i < count; i++) {
|
|
303
|
+
if (tree.ptr->ref_count > 1 || tree.ptr->child_count < 2) break;
|
|
304
|
+
|
|
305
|
+
MutableSubtree child = ts_subtree_to_mut_unsafe(ts_subtree_children(tree)[0]);
|
|
306
|
+
if (
|
|
307
|
+
child.data.is_inline ||
|
|
308
|
+
child.ptr->child_count < 2 ||
|
|
309
|
+
child.ptr->ref_count > 1 ||
|
|
310
|
+
child.ptr->symbol != symbol
|
|
311
|
+
) break;
|
|
312
|
+
|
|
313
|
+
MutableSubtree grandchild = ts_subtree_to_mut_unsafe(ts_subtree_children(child)[0]);
|
|
314
|
+
if (
|
|
315
|
+
grandchild.data.is_inline ||
|
|
316
|
+
grandchild.ptr->child_count < 2 ||
|
|
317
|
+
grandchild.ptr->ref_count > 1 ||
|
|
318
|
+
grandchild.ptr->symbol != symbol
|
|
319
|
+
) break;
|
|
320
|
+
|
|
321
|
+
ts_subtree_children(tree)[0] = ts_subtree_from_mut(grandchild);
|
|
322
|
+
ts_subtree_children(child)[0] = ts_subtree_children(grandchild)[grandchild.ptr->child_count - 1];
|
|
323
|
+
ts_subtree_children(grandchild)[grandchild.ptr->child_count - 1] = ts_subtree_from_mut(child);
|
|
324
|
+
array_push(stack, tree);
|
|
325
|
+
tree = grandchild;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
while (stack->size > initial_stack_size) {
|
|
329
|
+
tree = array_pop(stack);
|
|
330
|
+
MutableSubtree child = ts_subtree_to_mut_unsafe(ts_subtree_children(tree)[0]);
|
|
331
|
+
MutableSubtree grandchild = ts_subtree_to_mut_unsafe(ts_subtree_children(child)[child.ptr->child_count - 1]);
|
|
332
|
+
ts_subtree_summarize_children(grandchild, language);
|
|
333
|
+
ts_subtree_summarize_children(child, language);
|
|
334
|
+
ts_subtree_summarize_children(tree, language);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// Assign all of the node's properties that depend on its children.
|
|
339
|
+
void ts_subtree_summarize_children(
|
|
340
|
+
MutableSubtree self,
|
|
341
|
+
const TSLanguage *language
|
|
342
|
+
) {
|
|
343
|
+
ts_assert(!self.data.is_inline);
|
|
344
|
+
|
|
345
|
+
self.ptr->named_child_count = 0;
|
|
346
|
+
self.ptr->visible_child_count = 0;
|
|
347
|
+
self.ptr->error_cost = 0;
|
|
348
|
+
self.ptr->repeat_depth = 0;
|
|
349
|
+
self.ptr->visible_descendant_count = 0;
|
|
350
|
+
self.ptr->has_external_tokens = false;
|
|
351
|
+
self.ptr->depends_on_column = false;
|
|
352
|
+
self.ptr->has_external_scanner_state_change = false;
|
|
353
|
+
self.ptr->dynamic_precedence = 0;
|
|
354
|
+
|
|
355
|
+
uint32_t structural_index = 0;
|
|
356
|
+
const TSSymbol *alias_sequence = ts_language_alias_sequence(language, self.ptr->production_id);
|
|
357
|
+
uint32_t lookahead_end_byte = 0;
|
|
358
|
+
|
|
359
|
+
const Subtree *children = ts_subtree_children(self);
|
|
360
|
+
for (uint32_t i = 0; i < self.ptr->child_count; i++) {
|
|
361
|
+
Subtree child = children[i];
|
|
362
|
+
|
|
363
|
+
if (
|
|
364
|
+
self.ptr->size.extent.row == 0 &&
|
|
365
|
+
ts_subtree_depends_on_column(child)
|
|
366
|
+
) {
|
|
367
|
+
self.ptr->depends_on_column = true;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
if (ts_subtree_has_external_scanner_state_change(child)) {
|
|
371
|
+
self.ptr->has_external_scanner_state_change = true;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
if (i == 0) {
|
|
375
|
+
self.ptr->padding = ts_subtree_padding(child);
|
|
376
|
+
self.ptr->size = ts_subtree_size(child);
|
|
377
|
+
} else {
|
|
378
|
+
self.ptr->size = length_add(self.ptr->size, ts_subtree_total_size(child));
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
uint32_t child_lookahead_end_byte =
|
|
382
|
+
self.ptr->padding.bytes +
|
|
383
|
+
self.ptr->size.bytes +
|
|
384
|
+
ts_subtree_lookahead_bytes(child);
|
|
385
|
+
if (child_lookahead_end_byte > lookahead_end_byte) {
|
|
386
|
+
lookahead_end_byte = child_lookahead_end_byte;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
if (ts_subtree_symbol(child) != ts_builtin_sym_error_repeat) {
|
|
390
|
+
self.ptr->error_cost += ts_subtree_error_cost(child);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
uint32_t grandchild_count = ts_subtree_child_count(child);
|
|
394
|
+
if (
|
|
395
|
+
self.ptr->symbol == ts_builtin_sym_error ||
|
|
396
|
+
self.ptr->symbol == ts_builtin_sym_error_repeat
|
|
397
|
+
) {
|
|
398
|
+
if (!ts_subtree_extra(child) && !(ts_subtree_is_error(child) && grandchild_count == 0)) {
|
|
399
|
+
if (ts_subtree_visible(child)) {
|
|
400
|
+
self.ptr->error_cost += ERROR_COST_PER_SKIPPED_TREE;
|
|
401
|
+
} else if (grandchild_count > 0) {
|
|
402
|
+
self.ptr->error_cost += ERROR_COST_PER_SKIPPED_TREE * child.ptr->visible_child_count;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
self.ptr->dynamic_precedence += ts_subtree_dynamic_precedence(child);
|
|
408
|
+
self.ptr->visible_descendant_count += ts_subtree_visible_descendant_count(child);
|
|
409
|
+
|
|
410
|
+
if (
|
|
411
|
+
!ts_subtree_extra(child) &&
|
|
412
|
+
ts_subtree_symbol(child) != 0 &&
|
|
413
|
+
alias_sequence &&
|
|
414
|
+
alias_sequence[structural_index] != 0
|
|
415
|
+
) {
|
|
416
|
+
self.ptr->visible_descendant_count++;
|
|
417
|
+
self.ptr->visible_child_count++;
|
|
418
|
+
if (ts_language_symbol_metadata(language, alias_sequence[structural_index]).named) {
|
|
419
|
+
self.ptr->named_child_count++;
|
|
420
|
+
}
|
|
421
|
+
} else if (ts_subtree_visible(child)) {
|
|
422
|
+
self.ptr->visible_descendant_count++;
|
|
423
|
+
self.ptr->visible_child_count++;
|
|
424
|
+
if (ts_subtree_named(child)) self.ptr->named_child_count++;
|
|
425
|
+
} else if (grandchild_count > 0) {
|
|
426
|
+
self.ptr->visible_child_count += child.ptr->visible_child_count;
|
|
427
|
+
self.ptr->named_child_count += child.ptr->named_child_count;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
if (ts_subtree_has_external_tokens(child)) self.ptr->has_external_tokens = true;
|
|
431
|
+
|
|
432
|
+
if (ts_subtree_is_error(child)) {
|
|
433
|
+
self.ptr->fragile_left = self.ptr->fragile_right = true;
|
|
434
|
+
self.ptr->parse_state = TS_TREE_STATE_NONE;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
if (!ts_subtree_extra(child)) structural_index++;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
self.ptr->lookahead_bytes = lookahead_end_byte - self.ptr->size.bytes - self.ptr->padding.bytes;
|
|
441
|
+
|
|
442
|
+
if (
|
|
443
|
+
self.ptr->symbol == ts_builtin_sym_error ||
|
|
444
|
+
self.ptr->symbol == ts_builtin_sym_error_repeat
|
|
445
|
+
) {
|
|
446
|
+
self.ptr->error_cost +=
|
|
447
|
+
ERROR_COST_PER_RECOVERY +
|
|
448
|
+
ERROR_COST_PER_SKIPPED_CHAR * self.ptr->size.bytes +
|
|
449
|
+
ERROR_COST_PER_SKIPPED_LINE * self.ptr->size.extent.row;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
if (self.ptr->child_count > 0) {
|
|
453
|
+
Subtree first_child = children[0];
|
|
454
|
+
Subtree last_child = children[self.ptr->child_count - 1];
|
|
455
|
+
|
|
456
|
+
self.ptr->first_leaf.symbol = ts_subtree_leaf_symbol(first_child);
|
|
457
|
+
self.ptr->first_leaf.parse_state = ts_subtree_leaf_parse_state(first_child);
|
|
458
|
+
|
|
459
|
+
if (ts_subtree_fragile_left(first_child)) self.ptr->fragile_left = true;
|
|
460
|
+
if (ts_subtree_fragile_right(last_child)) self.ptr->fragile_right = true;
|
|
461
|
+
|
|
462
|
+
if (
|
|
463
|
+
self.ptr->child_count >= 2 &&
|
|
464
|
+
!self.ptr->visible &&
|
|
465
|
+
!self.ptr->named &&
|
|
466
|
+
ts_subtree_symbol(first_child) == self.ptr->symbol
|
|
467
|
+
) {
|
|
468
|
+
if (ts_subtree_repeat_depth(first_child) > ts_subtree_repeat_depth(last_child)) {
|
|
469
|
+
self.ptr->repeat_depth = ts_subtree_repeat_depth(first_child) + 1;
|
|
470
|
+
} else {
|
|
471
|
+
self.ptr->repeat_depth = ts_subtree_repeat_depth(last_child) + 1;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// Create a new parent node with the given children.
|
|
478
|
+
//
|
|
479
|
+
// This takes ownership of the children array.
|
|
480
|
+
MutableSubtree ts_subtree_new_node(
|
|
481
|
+
TSSymbol symbol,
|
|
482
|
+
SubtreeArray *children,
|
|
483
|
+
unsigned production_id,
|
|
484
|
+
const TSLanguage *language
|
|
485
|
+
) {
|
|
486
|
+
TSSymbolMetadata metadata = ts_language_symbol_metadata(language, symbol);
|
|
487
|
+
bool fragile = symbol == ts_builtin_sym_error || symbol == ts_builtin_sym_error_repeat;
|
|
488
|
+
|
|
489
|
+
// Allocate the node's data at the end of the array of children.
|
|
490
|
+
size_t new_byte_size = ts_subtree_alloc_size(children->size);
|
|
491
|
+
if (children->capacity * sizeof(Subtree) < new_byte_size) {
|
|
492
|
+
children->contents = ts_realloc(children->contents, new_byte_size);
|
|
493
|
+
children->capacity = (uint32_t)(new_byte_size / sizeof(Subtree));
|
|
494
|
+
}
|
|
495
|
+
SubtreeHeapData *data = (SubtreeHeapData *)&children->contents[children->size];
|
|
496
|
+
|
|
497
|
+
*data = (SubtreeHeapData) {
|
|
498
|
+
.ref_count = 1,
|
|
499
|
+
.symbol = symbol,
|
|
500
|
+
.child_count = children->size,
|
|
501
|
+
.visible = metadata.visible,
|
|
502
|
+
.named = metadata.named,
|
|
503
|
+
.has_changes = false,
|
|
504
|
+
.has_external_scanner_state_change = false,
|
|
505
|
+
.fragile_left = fragile,
|
|
506
|
+
.fragile_right = fragile,
|
|
507
|
+
.is_keyword = false,
|
|
508
|
+
{{
|
|
509
|
+
.visible_descendant_count = 0,
|
|
510
|
+
.production_id = production_id,
|
|
511
|
+
.first_leaf = {.symbol = 0, .parse_state = 0},
|
|
512
|
+
}}
|
|
513
|
+
};
|
|
514
|
+
MutableSubtree result = {.ptr = data};
|
|
515
|
+
ts_subtree_summarize_children(result, language);
|
|
516
|
+
return result;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
// Create a new error node containing the given children.
|
|
520
|
+
//
|
|
521
|
+
// This node is treated as 'extra'. Its children are prevented from having
|
|
522
|
+
// having any effect on the parse state.
|
|
523
|
+
Subtree ts_subtree_new_error_node(
|
|
524
|
+
SubtreeArray *children,
|
|
525
|
+
bool extra,
|
|
526
|
+
const TSLanguage *language
|
|
527
|
+
) {
|
|
528
|
+
MutableSubtree result = ts_subtree_new_node(
|
|
529
|
+
ts_builtin_sym_error, children, 0, language
|
|
530
|
+
);
|
|
531
|
+
result.ptr->extra = extra;
|
|
532
|
+
return ts_subtree_from_mut(result);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// Create a new 'missing leaf' node.
|
|
536
|
+
//
|
|
537
|
+
// This node is treated as 'extra'. Its children are prevented from having
|
|
538
|
+
// having any effect on the parse state.
|
|
539
|
+
Subtree ts_subtree_new_missing_leaf(
|
|
540
|
+
SubtreePool *pool,
|
|
541
|
+
TSSymbol symbol,
|
|
542
|
+
Length padding,
|
|
543
|
+
uint32_t lookahead_bytes,
|
|
544
|
+
const TSLanguage *language
|
|
545
|
+
) {
|
|
546
|
+
Subtree result = ts_subtree_new_leaf(
|
|
547
|
+
pool, symbol, padding, length_zero(), lookahead_bytes,
|
|
548
|
+
0, false, false, false, language
|
|
549
|
+
);
|
|
550
|
+
if (result.data.is_inline) {
|
|
551
|
+
result.data.is_missing = true;
|
|
552
|
+
} else {
|
|
553
|
+
((SubtreeHeapData *)result.ptr)->is_missing = true;
|
|
554
|
+
}
|
|
555
|
+
return result;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
void ts_subtree_retain(Subtree self) {
|
|
559
|
+
if (self.data.is_inline) return;
|
|
560
|
+
ts_assert(self.ptr->ref_count > 0);
|
|
561
|
+
atomic_inc((volatile uint32_t *)&self.ptr->ref_count);
|
|
562
|
+
ts_assert(self.ptr->ref_count != 0);
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
void ts_subtree_release(SubtreePool *pool, Subtree self) {
|
|
566
|
+
if (self.data.is_inline) return;
|
|
567
|
+
array_clear(&pool->tree_stack);
|
|
568
|
+
|
|
569
|
+
ts_assert(self.ptr->ref_count > 0);
|
|
570
|
+
if (atomic_dec((volatile uint32_t *)&self.ptr->ref_count) == 0) {
|
|
571
|
+
array_push(&pool->tree_stack, ts_subtree_to_mut_unsafe(self));
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
while (pool->tree_stack.size > 0) {
|
|
575
|
+
MutableSubtree tree = array_pop(&pool->tree_stack);
|
|
576
|
+
if (tree.ptr->child_count > 0) {
|
|
577
|
+
Subtree *children = ts_subtree_children(tree);
|
|
578
|
+
for (uint32_t i = 0; i < tree.ptr->child_count; i++) {
|
|
579
|
+
Subtree child = children[i];
|
|
580
|
+
if (child.data.is_inline) continue;
|
|
581
|
+
ts_assert(child.ptr->ref_count > 0);
|
|
582
|
+
if (atomic_dec((volatile uint32_t *)&child.ptr->ref_count) == 0) {
|
|
583
|
+
array_push(&pool->tree_stack, ts_subtree_to_mut_unsafe(child));
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
ts_free(children);
|
|
587
|
+
} else {
|
|
588
|
+
if (tree.ptr->has_external_tokens) {
|
|
589
|
+
ts_external_scanner_state_delete(&tree.ptr->external_scanner_state);
|
|
590
|
+
}
|
|
591
|
+
ts_subtree_pool_free(pool, tree.ptr);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
int ts_subtree_compare(Subtree left, Subtree right, SubtreePool *pool) {
|
|
597
|
+
array_push(&pool->tree_stack, ts_subtree_to_mut_unsafe(left));
|
|
598
|
+
array_push(&pool->tree_stack, ts_subtree_to_mut_unsafe(right));
|
|
599
|
+
|
|
600
|
+
while (pool->tree_stack.size > 0) {
|
|
601
|
+
right = ts_subtree_from_mut(array_pop(&pool->tree_stack));
|
|
602
|
+
left = ts_subtree_from_mut(array_pop(&pool->tree_stack));
|
|
603
|
+
|
|
604
|
+
int result = 0;
|
|
605
|
+
if (ts_subtree_symbol(left) < ts_subtree_symbol(right)) result = -1;
|
|
606
|
+
else if (ts_subtree_symbol(right) < ts_subtree_symbol(left)) result = 1;
|
|
607
|
+
else if (ts_subtree_child_count(left) < ts_subtree_child_count(right)) result = -1;
|
|
608
|
+
else if (ts_subtree_child_count(right) < ts_subtree_child_count(left)) result = 1;
|
|
609
|
+
if (result != 0) {
|
|
610
|
+
array_clear(&pool->tree_stack);
|
|
611
|
+
return result;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
for (uint32_t i = ts_subtree_child_count(left); i > 0; i--) {
|
|
615
|
+
Subtree left_child = ts_subtree_children(left)[i - 1];
|
|
616
|
+
Subtree right_child = ts_subtree_children(right)[i - 1];
|
|
617
|
+
array_push(&pool->tree_stack, ts_subtree_to_mut_unsafe(left_child));
|
|
618
|
+
array_push(&pool->tree_stack, ts_subtree_to_mut_unsafe(right_child));
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
return 0;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
static inline void ts_subtree_set_has_changes(MutableSubtree *self) {
|
|
626
|
+
if (self->data.is_inline) {
|
|
627
|
+
self->data.has_changes = true;
|
|
628
|
+
} else {
|
|
629
|
+
self->ptr->has_changes = true;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
Subtree ts_subtree_edit(Subtree self, const TSInputEdit *input_edit, SubtreePool *pool) {
|
|
634
|
+
typedef struct {
|
|
635
|
+
Subtree *tree;
|
|
636
|
+
Edit edit;
|
|
637
|
+
} EditEntry;
|
|
638
|
+
|
|
639
|
+
Array(EditEntry) stack = array_new();
|
|
640
|
+
array_push(&stack, ((EditEntry) {
|
|
641
|
+
.tree = &self,
|
|
642
|
+
.edit = (Edit) {
|
|
643
|
+
.start = {input_edit->start_byte, input_edit->start_point},
|
|
644
|
+
.old_end = {input_edit->old_end_byte, input_edit->old_end_point},
|
|
645
|
+
.new_end = {input_edit->new_end_byte, input_edit->new_end_point},
|
|
646
|
+
},
|
|
647
|
+
}));
|
|
648
|
+
|
|
649
|
+
while (stack.size) {
|
|
650
|
+
EditEntry entry = array_pop(&stack);
|
|
651
|
+
Edit edit = entry.edit;
|
|
652
|
+
bool is_noop = edit.old_end.bytes == edit.start.bytes && edit.new_end.bytes == edit.start.bytes;
|
|
653
|
+
bool is_pure_insertion = edit.old_end.bytes == edit.start.bytes;
|
|
654
|
+
bool parent_depends_on_column = ts_subtree_depends_on_column(*entry.tree);
|
|
655
|
+
bool column_shifted = edit.new_end.extent.column != edit.old_end.extent.column;
|
|
656
|
+
|
|
657
|
+
Length size = ts_subtree_size(*entry.tree);
|
|
658
|
+
Length padding = ts_subtree_padding(*entry.tree);
|
|
659
|
+
Length total_size = length_add(padding, size);
|
|
660
|
+
uint32_t lookahead_bytes = ts_subtree_lookahead_bytes(*entry.tree);
|
|
661
|
+
uint32_t end_byte = total_size.bytes + lookahead_bytes;
|
|
662
|
+
if (edit.start.bytes > end_byte || (is_noop && edit.start.bytes == end_byte)) continue;
|
|
663
|
+
|
|
664
|
+
// If the edit is entirely within the space before this subtree, then shift this
|
|
665
|
+
// subtree over according to the edit without changing its size.
|
|
666
|
+
if (edit.old_end.bytes <= padding.bytes) {
|
|
667
|
+
padding = length_add(edit.new_end, length_sub(padding, edit.old_end));
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
// If the edit starts in the space before this subtree and extends into this subtree,
|
|
671
|
+
// shrink the subtree's content to compensate for the change in the space before it.
|
|
672
|
+
else if (edit.start.bytes < padding.bytes) {
|
|
673
|
+
size = length_saturating_sub(size, length_sub(edit.old_end, padding));
|
|
674
|
+
padding = edit.new_end;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
// If the edit is within this subtree, resize the subtree to reflect the edit.
|
|
678
|
+
else if (
|
|
679
|
+
edit.start.bytes < total_size.bytes ||
|
|
680
|
+
(edit.start.bytes == total_size.bytes && is_pure_insertion)
|
|
681
|
+
) {
|
|
682
|
+
size = length_add(
|
|
683
|
+
length_sub(edit.new_end, padding),
|
|
684
|
+
length_saturating_sub(total_size, edit.old_end)
|
|
685
|
+
);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
MutableSubtree result = ts_subtree_make_mut(pool, *entry.tree);
|
|
689
|
+
|
|
690
|
+
if (result.data.is_inline) {
|
|
691
|
+
if (ts_subtree_can_inline(padding, size, lookahead_bytes)) {
|
|
692
|
+
result.data.padding_bytes = padding.bytes;
|
|
693
|
+
result.data.padding_rows = padding.extent.row;
|
|
694
|
+
result.data.padding_columns = padding.extent.column;
|
|
695
|
+
result.data.size_bytes = size.bytes;
|
|
696
|
+
} else {
|
|
697
|
+
SubtreeHeapData *data = ts_subtree_pool_allocate(pool);
|
|
698
|
+
data->ref_count = 1;
|
|
699
|
+
data->padding = padding;
|
|
700
|
+
data->size = size;
|
|
701
|
+
data->lookahead_bytes = lookahead_bytes;
|
|
702
|
+
data->error_cost = 0;
|
|
703
|
+
data->child_count = 0;
|
|
704
|
+
data->symbol = result.data.symbol;
|
|
705
|
+
data->parse_state = result.data.parse_state;
|
|
706
|
+
data->visible = result.data.visible;
|
|
707
|
+
data->named = result.data.named;
|
|
708
|
+
data->extra = result.data.extra;
|
|
709
|
+
data->fragile_left = false;
|
|
710
|
+
data->fragile_right = false;
|
|
711
|
+
data->has_changes = false;
|
|
712
|
+
data->has_external_tokens = false;
|
|
713
|
+
data->depends_on_column = false;
|
|
714
|
+
data->is_missing = result.data.is_missing;
|
|
715
|
+
data->is_keyword = result.data.is_keyword;
|
|
716
|
+
result.ptr = data;
|
|
717
|
+
}
|
|
718
|
+
} else {
|
|
719
|
+
result.ptr->padding = padding;
|
|
720
|
+
result.ptr->size = size;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
ts_subtree_set_has_changes(&result);
|
|
724
|
+
*entry.tree = ts_subtree_from_mut(result);
|
|
725
|
+
|
|
726
|
+
Length child_left, child_right = length_zero();
|
|
727
|
+
for (uint32_t i = 0, n = ts_subtree_child_count(*entry.tree); i < n; i++) {
|
|
728
|
+
Subtree *child = &ts_subtree_children(*entry.tree)[i];
|
|
729
|
+
Length child_size = ts_subtree_total_size(*child);
|
|
730
|
+
child_left = child_right;
|
|
731
|
+
child_right = length_add(child_left, child_size);
|
|
732
|
+
|
|
733
|
+
// If this child ends before the edit, it is not affected.
|
|
734
|
+
if (child_right.bytes + ts_subtree_lookahead_bytes(*child) < edit.start.bytes) continue;
|
|
735
|
+
|
|
736
|
+
// Keep editing child nodes until a node is reached that starts after the edit.
|
|
737
|
+
// Also, if this node's validity depends on its column position, then continue
|
|
738
|
+
// invalidating child nodes until reaching a line break.
|
|
739
|
+
if ((
|
|
740
|
+
(child_left.bytes > edit.old_end.bytes) ||
|
|
741
|
+
(child_left.bytes == edit.old_end.bytes && child_size.bytes > 0 && i > 0)
|
|
742
|
+
) && (
|
|
743
|
+
!parent_depends_on_column ||
|
|
744
|
+
child_left.extent.row > padding.extent.row
|
|
745
|
+
) && (
|
|
746
|
+
!ts_subtree_depends_on_column(*child) ||
|
|
747
|
+
!column_shifted ||
|
|
748
|
+
child_left.extent.row > edit.old_end.extent.row
|
|
749
|
+
)) {
|
|
750
|
+
break;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
// Transform edit into the child's coordinate space.
|
|
754
|
+
Edit child_edit = {
|
|
755
|
+
.start = length_saturating_sub(edit.start, child_left),
|
|
756
|
+
.old_end = length_saturating_sub(edit.old_end, child_left),
|
|
757
|
+
.new_end = length_saturating_sub(edit.new_end, child_left),
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
// Interpret all inserted text as applying to the *first* child that touches the edit.
|
|
761
|
+
// Subsequent children are only never have any text inserted into them; they are only
|
|
762
|
+
// shrunk to compensate for the edit.
|
|
763
|
+
if (
|
|
764
|
+
child_right.bytes > edit.start.bytes ||
|
|
765
|
+
(child_right.bytes == edit.start.bytes && is_pure_insertion)
|
|
766
|
+
) {
|
|
767
|
+
edit.new_end = edit.start;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
// Children that occur before the edit are not reshaped by the edit.
|
|
771
|
+
else {
|
|
772
|
+
child_edit.old_end = child_edit.start;
|
|
773
|
+
child_edit.new_end = child_edit.start;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
// Queue processing of this child's subtree.
|
|
777
|
+
array_push(&stack, ((EditEntry) {
|
|
778
|
+
.tree = child,
|
|
779
|
+
.edit = child_edit,
|
|
780
|
+
}));
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
array_delete(&stack);
|
|
785
|
+
return self;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
Subtree ts_subtree_last_external_token(Subtree tree) {
|
|
789
|
+
if (!ts_subtree_has_external_tokens(tree)) return NULL_SUBTREE;
|
|
790
|
+
while (tree.ptr->child_count > 0) {
|
|
791
|
+
for (uint32_t i = tree.ptr->child_count - 1; i + 1 > 0; i--) {
|
|
792
|
+
Subtree child = ts_subtree_children(tree)[i];
|
|
793
|
+
if (ts_subtree_has_external_tokens(child)) {
|
|
794
|
+
tree = child;
|
|
795
|
+
break;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
return tree;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
static size_t ts_subtree__write_char_to_string(char *str, size_t n, int32_t chr) {
|
|
803
|
+
if (chr == -1)
|
|
804
|
+
return snprintf(str, n, "INVALID");
|
|
805
|
+
else if (chr == '\0')
|
|
806
|
+
return snprintf(str, n, "'\\0'");
|
|
807
|
+
else if (chr == '\n')
|
|
808
|
+
return snprintf(str, n, "'\\n'");
|
|
809
|
+
else if (chr == '\t')
|
|
810
|
+
return snprintf(str, n, "'\\t'");
|
|
811
|
+
else if (chr == '\r')
|
|
812
|
+
return snprintf(str, n, "'\\r'");
|
|
813
|
+
else if (0 < chr && chr < 128 && isprint(chr))
|
|
814
|
+
return snprintf(str, n, "'%c'", chr);
|
|
815
|
+
else
|
|
816
|
+
return snprintf(str, n, "%d", chr);
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
static const char *const ROOT_FIELD = "__ROOT__";
|
|
820
|
+
|
|
821
|
+
static size_t ts_subtree__write_to_string(
|
|
822
|
+
Subtree self, char *string, size_t limit,
|
|
823
|
+
const TSLanguage *language, bool include_all,
|
|
824
|
+
TSSymbol alias_symbol, bool alias_is_named, const char *field_name
|
|
825
|
+
) {
|
|
826
|
+
if (!self.ptr) return snprintf(string, limit, "(NULL)");
|
|
827
|
+
|
|
828
|
+
char *cursor = string;
|
|
829
|
+
char **writer = (limit > 1) ? &cursor : &string;
|
|
830
|
+
bool is_root = field_name == ROOT_FIELD;
|
|
831
|
+
bool is_visible =
|
|
832
|
+
include_all ||
|
|
833
|
+
ts_subtree_missing(self) ||
|
|
834
|
+
(
|
|
835
|
+
alias_symbol
|
|
836
|
+
? alias_is_named
|
|
837
|
+
: ts_subtree_visible(self) && ts_subtree_named(self)
|
|
838
|
+
);
|
|
839
|
+
|
|
840
|
+
if (is_visible) {
|
|
841
|
+
if (!is_root) {
|
|
842
|
+
cursor += snprintf(*writer, limit, " ");
|
|
843
|
+
if (field_name) {
|
|
844
|
+
cursor += snprintf(*writer, limit, "%s: ", field_name);
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
if (ts_subtree_is_error(self) && ts_subtree_child_count(self) == 0 && self.ptr->size.bytes > 0) {
|
|
849
|
+
cursor += snprintf(*writer, limit, "(UNEXPECTED ");
|
|
850
|
+
cursor += ts_subtree__write_char_to_string(*writer, limit, self.ptr->lookahead_char);
|
|
851
|
+
} else {
|
|
852
|
+
TSSymbol symbol = alias_symbol ? alias_symbol : ts_subtree_symbol(self);
|
|
853
|
+
const char *symbol_name = ts_language_symbol_name(language, symbol);
|
|
854
|
+
if (ts_subtree_missing(self)) {
|
|
855
|
+
cursor += snprintf(*writer, limit, "(MISSING ");
|
|
856
|
+
if (alias_is_named || ts_subtree_named(self)) {
|
|
857
|
+
cursor += snprintf(*writer, limit, "%s", symbol_name);
|
|
858
|
+
} else {
|
|
859
|
+
cursor += snprintf(*writer, limit, "\"%s\"", symbol_name);
|
|
860
|
+
}
|
|
861
|
+
} else {
|
|
862
|
+
cursor += snprintf(*writer, limit, "(%s", symbol_name);
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
} else if (is_root) {
|
|
866
|
+
TSSymbol symbol = alias_symbol ? alias_symbol : ts_subtree_symbol(self);
|
|
867
|
+
const char *symbol_name = ts_language_symbol_name(language, symbol);
|
|
868
|
+
if (ts_subtree_child_count(self) > 0) {
|
|
869
|
+
cursor += snprintf(*writer, limit, "(%s", symbol_name);
|
|
870
|
+
} else if (ts_subtree_named(self)) {
|
|
871
|
+
cursor += snprintf(*writer, limit, "(%s)", symbol_name);
|
|
872
|
+
} else {
|
|
873
|
+
cursor += snprintf(*writer, limit, "(\"%s\")", symbol_name);
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
if (ts_subtree_child_count(self)) {
|
|
878
|
+
const TSSymbol *alias_sequence = ts_language_alias_sequence(language, self.ptr->production_id);
|
|
879
|
+
const TSFieldMapEntry *field_map, *field_map_end;
|
|
880
|
+
ts_language_field_map(
|
|
881
|
+
language,
|
|
882
|
+
self.ptr->production_id,
|
|
883
|
+
&field_map,
|
|
884
|
+
&field_map_end
|
|
885
|
+
);
|
|
886
|
+
|
|
887
|
+
uint32_t structural_child_index = 0;
|
|
888
|
+
for (uint32_t i = 0; i < self.ptr->child_count; i++) {
|
|
889
|
+
Subtree child = ts_subtree_children(self)[i];
|
|
890
|
+
if (ts_subtree_extra(child)) {
|
|
891
|
+
cursor += ts_subtree__write_to_string(
|
|
892
|
+
child, *writer, limit,
|
|
893
|
+
language, include_all,
|
|
894
|
+
0, false, NULL
|
|
895
|
+
);
|
|
896
|
+
} else {
|
|
897
|
+
TSSymbol subtree_alias_symbol = alias_sequence
|
|
898
|
+
? alias_sequence[structural_child_index]
|
|
899
|
+
: 0;
|
|
900
|
+
bool subtree_alias_is_named = subtree_alias_symbol
|
|
901
|
+
? ts_language_symbol_metadata(language, subtree_alias_symbol).named
|
|
902
|
+
: false;
|
|
903
|
+
|
|
904
|
+
const char *child_field_name = is_visible ? NULL : field_name;
|
|
905
|
+
for (const TSFieldMapEntry *map = field_map; map < field_map_end; map++) {
|
|
906
|
+
if (!map->inherited && map->child_index == structural_child_index) {
|
|
907
|
+
child_field_name = language->field_names[map->field_id];
|
|
908
|
+
break;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
cursor += ts_subtree__write_to_string(
|
|
913
|
+
child, *writer, limit,
|
|
914
|
+
language, include_all,
|
|
915
|
+
subtree_alias_symbol, subtree_alias_is_named, child_field_name
|
|
916
|
+
);
|
|
917
|
+
structural_child_index++;
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
if (is_visible) cursor += snprintf(*writer, limit, ")");
|
|
923
|
+
|
|
924
|
+
return cursor - string;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
char *ts_subtree_string(
|
|
928
|
+
Subtree self,
|
|
929
|
+
TSSymbol alias_symbol,
|
|
930
|
+
bool alias_is_named,
|
|
931
|
+
const TSLanguage *language,
|
|
932
|
+
bool include_all
|
|
933
|
+
) {
|
|
934
|
+
char scratch_string[1];
|
|
935
|
+
size_t size = ts_subtree__write_to_string(
|
|
936
|
+
self, scratch_string, 1,
|
|
937
|
+
language, include_all,
|
|
938
|
+
alias_symbol, alias_is_named, ROOT_FIELD
|
|
939
|
+
) + 1;
|
|
940
|
+
char *result = ts_malloc(size * sizeof(char));
|
|
941
|
+
ts_subtree__write_to_string(
|
|
942
|
+
self, result, size,
|
|
943
|
+
language, include_all,
|
|
944
|
+
alias_symbol, alias_is_named, ROOT_FIELD
|
|
945
|
+
);
|
|
946
|
+
return result;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
void ts_subtree__print_dot_graph(const Subtree *self, uint32_t start_offset,
|
|
950
|
+
const TSLanguage *language, TSSymbol alias_symbol,
|
|
951
|
+
FILE *f) {
|
|
952
|
+
TSSymbol subtree_symbol = ts_subtree_symbol(*self);
|
|
953
|
+
TSSymbol symbol = alias_symbol ? alias_symbol : subtree_symbol;
|
|
954
|
+
uint32_t end_offset = start_offset + ts_subtree_total_bytes(*self);
|
|
955
|
+
fprintf(f, "tree_%p [label=\"", (void *)self);
|
|
956
|
+
ts_language_write_symbol_as_dot_string(language, f, symbol);
|
|
957
|
+
fprintf(f, "\"");
|
|
958
|
+
|
|
959
|
+
if (ts_subtree_child_count(*self) == 0) fprintf(f, ", shape=plaintext");
|
|
960
|
+
if (ts_subtree_extra(*self)) fprintf(f, ", fontcolor=gray");
|
|
961
|
+
if (ts_subtree_has_changes(*self)) fprintf(f, ", color=green, penwidth=2");
|
|
962
|
+
|
|
963
|
+
fprintf(f, ", tooltip=\""
|
|
964
|
+
"range: %u - %u\n"
|
|
965
|
+
"state: %d\n"
|
|
966
|
+
"error-cost: %u\n"
|
|
967
|
+
"has-changes: %u\n"
|
|
968
|
+
"depends-on-column: %u\n"
|
|
969
|
+
"descendant-count: %u\n"
|
|
970
|
+
"repeat-depth: %u\n"
|
|
971
|
+
"lookahead-bytes: %u",
|
|
972
|
+
start_offset, end_offset,
|
|
973
|
+
ts_subtree_parse_state(*self),
|
|
974
|
+
ts_subtree_error_cost(*self),
|
|
975
|
+
ts_subtree_has_changes(*self),
|
|
976
|
+
ts_subtree_depends_on_column(*self),
|
|
977
|
+
ts_subtree_visible_descendant_count(*self),
|
|
978
|
+
ts_subtree_repeat_depth(*self),
|
|
979
|
+
ts_subtree_lookahead_bytes(*self)
|
|
980
|
+
);
|
|
981
|
+
|
|
982
|
+
if (ts_subtree_is_error(*self) && ts_subtree_child_count(*self) == 0 && self->ptr->lookahead_char != 0) {
|
|
983
|
+
fprintf(f, "\ncharacter: '%c'", self->ptr->lookahead_char);
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
fprintf(f, "\"]\n");
|
|
987
|
+
|
|
988
|
+
uint32_t child_start_offset = start_offset;
|
|
989
|
+
uint32_t child_info_offset =
|
|
990
|
+
language->max_alias_sequence_length *
|
|
991
|
+
ts_subtree_production_id(*self);
|
|
992
|
+
for (uint32_t i = 0, n = ts_subtree_child_count(*self); i < n; i++) {
|
|
993
|
+
const Subtree *child = &ts_subtree_children(*self)[i];
|
|
994
|
+
TSSymbol subtree_alias_symbol = 0;
|
|
995
|
+
if (!ts_subtree_extra(*child) && child_info_offset) {
|
|
996
|
+
subtree_alias_symbol = language->alias_sequences[child_info_offset];
|
|
997
|
+
child_info_offset++;
|
|
998
|
+
}
|
|
999
|
+
ts_subtree__print_dot_graph(child, child_start_offset, language, subtree_alias_symbol, f);
|
|
1000
|
+
fprintf(f, "tree_%p -> tree_%p [tooltip=%u]\n", (void *)self, (void *)child, i);
|
|
1001
|
+
child_start_offset += ts_subtree_total_bytes(*child);
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
void ts_subtree_print_dot_graph(Subtree self, const TSLanguage *language, FILE *f) {
|
|
1006
|
+
fprintf(f, "digraph tree {\n");
|
|
1007
|
+
fprintf(f, "edge [arrowhead=none]\n");
|
|
1008
|
+
ts_subtree__print_dot_graph(&self, 0, language, 0, f);
|
|
1009
|
+
fprintf(f, "}\n");
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
const ExternalScannerState *ts_subtree_external_scanner_state(Subtree self) {
|
|
1013
|
+
static const ExternalScannerState empty_state = {{.short_data = {0}}, .length = 0};
|
|
1014
|
+
if (
|
|
1015
|
+
self.ptr &&
|
|
1016
|
+
!self.data.is_inline &&
|
|
1017
|
+
self.ptr->has_external_tokens &&
|
|
1018
|
+
self.ptr->child_count == 0
|
|
1019
|
+
) {
|
|
1020
|
+
return &self.ptr->external_scanner_state;
|
|
1021
|
+
} else {
|
|
1022
|
+
return &empty_state;
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
bool ts_subtree_external_scanner_state_eq(Subtree self, Subtree other) {
|
|
1027
|
+
const ExternalScannerState *state_self = ts_subtree_external_scanner_state(self);
|
|
1028
|
+
const ExternalScannerState *state_other = ts_subtree_external_scanner_state(other);
|
|
1029
|
+
return ts_external_scanner_state_eq(
|
|
1030
|
+
state_self,
|
|
1031
|
+
ts_external_scanner_state_data(state_other),
|
|
1032
|
+
state_other->length
|
|
1033
|
+
);
|
|
1034
|
+
}
|