@vicoa/cli 0.1.4 → 1.3.10-darwin-arm64
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/bin/_internal/81d243bd2c585b0f4821__mypyc.cpython-312-darwin.so +0 -0
- package/bin/_internal/Python +0 -0
- package/bin/_internal/Python.framework/Python +0 -0
- package/bin/_internal/Python.framework/Resources/Info.plist +30 -0
- package/bin/_internal/Python.framework/Versions/3.12/Python +0 -0
- package/bin/_internal/Python.framework/Versions/3.12/Resources/Info.plist +30 -0
- package/bin/_internal/Python.framework/Versions/Current/Python +0 -0
- package/bin/_internal/Python.framework/Versions/Current/Resources/Info.plist +30 -0
- package/bin/_internal/_cffi_backend.cpython-312-darwin.so +0 -0
- package/bin/_internal/aiofile-3.9.0.dist-info/INSTALLER +1 -0
- package/bin/_internal/aiofile-3.9.0.dist-info/LICENCE +195 -0
- package/bin/_internal/aiofile-3.9.0.dist-info/LICENCE.md +195 -0
- package/bin/_internal/aiofile-3.9.0.dist-info/METADATA +492 -0
- package/bin/_internal/aiofile-3.9.0.dist-info/RECORD +15 -0
- package/bin/_internal/aiofile-3.9.0.dist-info/WHEEL +4 -0
- package/bin/_internal/aiohttp/_http_parser.cpython-312-darwin.so +0 -0
- package/bin/_internal/aiohttp/_http_writer.cpython-312-darwin.so +0 -0
- package/bin/_internal/aiohttp/_websocket/mask.cpython-312-darwin.so +0 -0
- package/bin/_internal/aiohttp/_websocket/reader_c.cpython-312-darwin.so +0 -0
- package/bin/_internal/attrs-26.1.0.dist-info/INSTALLER +1 -0
- package/bin/_internal/attrs-26.1.0.dist-info/METADATA +199 -0
- package/bin/_internal/attrs-26.1.0.dist-info/RECORD +55 -0
- package/bin/_internal/attrs-26.1.0.dist-info/WHEEL +4 -0
- package/bin/_internal/attrs-26.1.0.dist-info/licenses/LICENSE +21 -0
- package/bin/_internal/base_library.zip +0 -0
- package/bin/_internal/caio/thread_aio.cpython-312-darwin.so +0 -0
- package/bin/_internal/certifi/cacert.pem +4494 -0
- package/bin/_internal/certifi/py.typed +0 -0
- package/bin/_internal/charset_normalizer/cd.cpython-312-darwin.so +0 -0
- package/bin/_internal/charset_normalizer/md.cpython-312-darwin.so +0 -0
- package/bin/_internal/click-8.3.2.dist-info/INSTALLER +1 -0
- package/bin/_internal/click-8.3.2.dist-info/METADATA +84 -0
- package/bin/_internal/click-8.3.2.dist-info/RECORD +40 -0
- package/bin/_internal/click-8.3.2.dist-info/WHEEL +4 -0
- package/bin/_internal/click-8.3.2.dist-info/licenses/LICENSE.txt +28 -0
- package/bin/_internal/cryptography/hazmat/bindings/_rust.abi3.so +0 -0
- package/bin/_internal/cryptography-46.0.7.dist-info/INSTALLER +1 -0
- package/bin/_internal/cryptography-46.0.7.dist-info/METADATA +139 -0
- package/bin/_internal/cryptography-46.0.7.dist-info/RECORD +180 -0
- package/bin/_internal/cryptography-46.0.7.dist-info/WHEEL +4 -0
- package/bin/_internal/cryptography-46.0.7.dist-info/licenses/LICENSE +3 -0
- package/bin/_internal/cryptography-46.0.7.dist-info/licenses/LICENSE.APACHE +202 -0
- package/bin/_internal/cryptography-46.0.7.dist-info/licenses/LICENSE.BSD +27 -0
- package/bin/_internal/email_validator-2.3.0.dist-info/INSTALLER +1 -0
- package/bin/_internal/email_validator-2.3.0.dist-info/METADATA +466 -0
- package/bin/_internal/email_validator-2.3.0.dist-info/RECORD +27 -0
- package/bin/_internal/email_validator-2.3.0.dist-info/WHEEL +5 -0
- package/bin/_internal/email_validator-2.3.0.dist-info/entry_points.txt +2 -0
- package/bin/_internal/email_validator-2.3.0.dist-info/licenses/LICENSE +27 -0
- package/bin/_internal/email_validator-2.3.0.dist-info/top_level.txt +1 -0
- package/bin/_internal/frozenlist/_frozenlist.cpython-312-darwin.so +0 -0
- package/bin/_internal/importlib_metadata-8.7.1.dist-info/INSTALLER +1 -0
- package/bin/_internal/importlib_metadata-8.7.1.dist-info/METADATA +133 -0
- package/bin/_internal/importlib_metadata-8.7.1.dist-info/RECORD +33 -0
- package/bin/_internal/importlib_metadata-8.7.1.dist-info/WHEEL +5 -0
- package/bin/_internal/importlib_metadata-8.7.1.dist-info/licenses/LICENSE +73 -0
- package/bin/_internal/importlib_metadata-8.7.1.dist-info/top_level.txt +1 -0
- package/bin/_internal/integrations/cli_wrappers/IMPORTANT_USE_CASES.md +33 -0
- package/bin/_internal/integrations/github/claude-code-action/CLAUDE.md +136 -0
- package/bin/_internal/integrations/github/claude-code-action/CODE_OF_CONDUCT.md +128 -0
- package/bin/_internal/integrations/github/claude-code-action/CONTRIBUTING.md +116 -0
- package/bin/_internal/integrations/github/claude-code-action/LICENSE +21 -0
- package/bin/_internal/integrations/github/claude-code-action/README.md +53 -0
- package/bin/_internal/integrations/github/claude-code-action/ROADMAP.md +20 -0
- package/bin/_internal/integrations/github/claude-code-action/SECURITY.md +15 -0
- package/bin/_internal/integrations/github/claude-code-action/action.yml +294 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/CLAUDE.md +60 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/CODE_OF_CONDUCT.md +128 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/CONTRIBUTING.md +136 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/LICENSE +21 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/MIRROR_DISCLAIMER.md +11 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/README.md +521 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/action.yml +149 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/bun.lock +54 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/examples/issue-triage.yml +108 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/package.json +23 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/scripts/install-hooks.sh +13 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/scripts/pre-push +46 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/src/index.ts +82 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/src/prepare-prompt.ts +82 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/src/run-claude.ts +257 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/src/run-vicoa.ts +301 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/src/setup-claude-code-settings.ts +68 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/src/validate-env.ts +54 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/test-local.sh +12 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/test-mcp-local.sh +18 -0
- package/bin/_internal/integrations/github/claude-code-action/base-action/tsconfig.json +30 -0
- package/bin/_internal/integrations/github/claude-code-action/bun.lock +384 -0
- package/bin/_internal/integrations/github/claude-code-action/docs/capabilities-and-limitations.md +33 -0
- package/bin/_internal/integrations/github/claude-code-action/docs/cloud-providers.md +99 -0
- package/bin/_internal/integrations/github/claude-code-action/docs/configuration.md +345 -0
- package/bin/_internal/integrations/github/claude-code-action/docs/custom-automations.md +113 -0
- package/bin/_internal/integrations/github/claude-code-action/docs/experimental.md +128 -0
- package/bin/_internal/integrations/github/claude-code-action/docs/faq.md +205 -0
- package/bin/_internal/integrations/github/claude-code-action/docs/migration-guide.md +261 -0
- package/bin/_internal/integrations/github/claude-code-action/docs/security.md +38 -0
- package/bin/_internal/integrations/github/claude-code-action/docs/setup.md +146 -0
- package/bin/_internal/integrations/github/claude-code-action/docs/usage.md +213 -0
- package/bin/_internal/integrations/github/claude-code-action/examples/auto-fix-ci/auto-fix-ci.yml +97 -0
- package/bin/_internal/integrations/github/claude-code-action/examples/auto-fix-ci/commands/fix-ci.md +127 -0
- package/bin/_internal/integrations/github/claude-code-action/examples/auto-fix-ci-signed/auto-fix-ci-signed.yml +97 -0
- package/bin/_internal/integrations/github/claude-code-action/examples/auto-fix-ci-signed/commands/fix-ci-signed.md +148 -0
- package/bin/_internal/integrations/github/claude-code-action/examples/issue-deduplication.yml +63 -0
- package/bin/_internal/integrations/github/claude-code-action/examples/issue-triage.yml +75 -0
- package/bin/_internal/integrations/github/claude-code-action/examples/vicoa.yml +75 -0
- package/bin/_internal/integrations/github/claude-code-action/package.json +31 -0
- package/bin/_internal/integrations/github/claude-code-action/scripts/install-hooks.sh +13 -0
- package/bin/_internal/integrations/github/claude-code-action/scripts/pre-commit +46 -0
- package/bin/_internal/integrations/github/claude-code-action/scripts/setup-network-restrictions.sh +123 -0
- package/bin/_internal/integrations/github/claude-code-action/src/create-prompt/index.ts +799 -0
- package/bin/_internal/integrations/github/claude-code-action/src/create-prompt/types.ts +102 -0
- package/bin/_internal/integrations/github/claude-code-action/src/entrypoints/collect-inputs.ts +58 -0
- package/bin/_internal/integrations/github/claude-code-action/src/entrypoints/format-turns.ts +465 -0
- package/bin/_internal/integrations/github/claude-code-action/src/entrypoints/prepare.ts +98 -0
- package/bin/_internal/integrations/github/claude-code-action/src/entrypoints/update-comment-link.ts +245 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/api/client.ts +23 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/api/config.ts +4 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/api/queries/github.ts +117 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/context.ts +277 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/data/fetcher.ts +233 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/data/formatter.ts +144 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/operations/branch-cleanup.ts +132 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/operations/branch.ts +163 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/operations/comment-logic.ts +203 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/operations/comments/common.ts +33 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/operations/comments/create-initial.ts +111 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/operations/comments/update-claude-comment.ts +70 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/operations/comments/update-with-branch.ts +57 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/operations/git-config.ts +62 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/token.ts +108 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/types.ts +98 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/utils/image-downloader.ts +246 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/utils/sanitizer.ts +100 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/validation/actor.ts +64 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/validation/permissions.ts +47 -0
- package/bin/_internal/integrations/github/claude-code-action/src/github/validation/trigger.ts +148 -0
- package/bin/_internal/integrations/github/claude-code-action/src/mcp/github-actions-server.ts +279 -0
- package/bin/_internal/integrations/github/claude-code-action/src/mcp/github-comment-server.ts +101 -0
- package/bin/_internal/integrations/github/claude-code-action/src/mcp/github-file-ops-server.ts +677 -0
- package/bin/_internal/integrations/github/claude-code-action/src/mcp/github-inline-comment-server.ts +184 -0
- package/bin/_internal/integrations/github/claude-code-action/src/mcp/install-mcp-server.ts +201 -0
- package/bin/_internal/integrations/github/claude-code-action/src/modes/agent/index.ts +152 -0
- package/bin/_internal/integrations/github/claude-code-action/src/modes/agent/parse-tools.ts +22 -0
- package/bin/_internal/integrations/github/claude-code-action/src/modes/detector.ts +66 -0
- package/bin/_internal/integrations/github/claude-code-action/src/modes/registry.ts +54 -0
- package/bin/_internal/integrations/github/claude-code-action/src/modes/tag/index.ts +187 -0
- package/bin/_internal/integrations/github/claude-code-action/src/modes/types.ts +100 -0
- package/bin/_internal/integrations/github/claude-code-action/src/prepare/index.ts +20 -0
- package/bin/_internal/integrations/github/claude-code-action/src/prepare/types.ts +20 -0
- package/bin/_internal/integrations/github/claude-code-action/src/utils/retry.ts +40 -0
- package/bin/_internal/integrations/github/claude-code-action/tsconfig.json +30 -0
- package/bin/_internal/integrations/n8n/LICENSE +21 -0
- package/bin/_internal/integrations/n8n/README.md +298 -0
- package/bin/_internal/integrations/n8n/package-lock.json +2989 -0
- package/bin/_internal/integrations/n8n/package.json +68 -0
- package/bin/_internal/integrations/n8n/src/credentials/OmnaraApi.credentials.ts +52 -0
- package/bin/_internal/integrations/n8n/src/nodes/Omnara/Omnara.node.json +35 -0
- package/bin/_internal/integrations/n8n/src/nodes/Omnara/Omnara.node.ts +304 -0
- package/bin/_internal/integrations/n8n/src/nodes/Omnara/actions/message/index.ts +37 -0
- package/bin/_internal/integrations/n8n/src/nodes/Omnara/actions/message/send.operation.ts +151 -0
- package/bin/_internal/integrations/n8n/src/nodes/Omnara/actions/message/sendAndWait.operation.ts +252 -0
- package/bin/_internal/integrations/n8n/src/nodes/Omnara/actions/session/end.operation.ts +56 -0
- package/bin/_internal/integrations/n8n/src/nodes/Omnara/actions/session/index.ts +29 -0
- package/bin/_internal/integrations/n8n/src/nodes/Omnara/vicoa.png +0 -0
- package/bin/_internal/integrations/n8n/src/utils/GenericFunctions.ts +93 -0
- package/bin/_internal/integrations/n8n/src/utils/sendAndWait/configureWaitTillDate.ts +42 -0
- package/bin/_internal/integrations/n8n/src/utils/sendAndWait/descriptions.ts +20 -0
- package/bin/_internal/integrations/n8n/src/utils/sendAndWaitWebhook.ts +72 -0
- package/bin/_internal/integrations/n8n/tsconfig.json +20 -0
- package/bin/_internal/jiter/jiter.cpython-312-darwin.so +0 -0
- package/bin/_internal/jsonschema/benchmarks/issue232/issue.json +2653 -0
- package/bin/_internal/jsonschema-4.26.0.dist-info/INSTALLER +1 -0
- package/bin/_internal/jsonschema-4.26.0.dist-info/METADATA +170 -0
- package/bin/_internal/jsonschema-4.26.0.dist-info/RECORD +82 -0
- package/bin/_internal/jsonschema-4.26.0.dist-info/WHEEL +4 -0
- package/bin/_internal/jsonschema-4.26.0.dist-info/entry_points.txt +2 -0
- package/bin/_internal/jsonschema-4.26.0.dist-info/licenses/COPYING +19 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft201909/metaschema.json +42 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft201909/vocabularies/applicator +56 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft201909/vocabularies/content +17 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft201909/vocabularies/core +57 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft201909/vocabularies/format +14 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft201909/vocabularies/meta-data +37 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft201909/vocabularies/validation +98 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft202012/metaschema.json +58 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/applicator +48 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/content +17 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/core +51 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/format-annotation +14 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/format-assertion +14 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/meta-data +37 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/unevaluated +15 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/validation +98 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft3/metaschema.json +172 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft4/metaschema.json +149 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft6/metaschema.json +153 -0
- package/bin/_internal/jsonschema_specifications/schemas/draft7/metaschema.json +166 -0
- package/bin/_internal/libcrypto.3.dylib +0 -0
- package/bin/_internal/libssl.3.dylib +0 -0
- package/bin/_internal/mcp-1.27.0.dist-info/INSTALLER +1 -0
- package/bin/_internal/mcp-1.27.0.dist-info/METADATA +230 -0
- package/bin/_internal/mcp-1.27.0.dist-info/RECORD +226 -0
- package/bin/_internal/mcp-1.27.0.dist-info/WHEEL +4 -0
- package/bin/_internal/mcp-1.27.0.dist-info/entry_points.txt +2 -0
- package/bin/_internal/mcp-1.27.0.dist-info/licenses/LICENSE +21 -0
- package/bin/_internal/multidict/_multidict.cpython-312-darwin.so +0 -0
- package/bin/_internal/opentelemetry_api-1.41.0.dist-info/INSTALLER +1 -0
- package/bin/_internal/opentelemetry_api-1.41.0.dist-info/METADATA +45 -0
- package/bin/_internal/opentelemetry_api-1.41.0.dist-info/RECORD +81 -0
- package/bin/_internal/opentelemetry_api-1.41.0.dist-info/WHEEL +4 -0
- package/bin/_internal/opentelemetry_api-1.41.0.dist-info/entry_points.txt +15 -0
- package/bin/_internal/opentelemetry_api-1.41.0.dist-info/licenses/LICENSE +201 -0
- package/bin/_internal/propcache/_helpers_c.cpython-312-darwin.so +0 -0
- package/bin/_internal/pydantic-2.13.2.dist-info/INSTALLER +1 -0
- package/bin/_internal/pydantic-2.13.2.dist-info/METADATA +1269 -0
- package/bin/_internal/pydantic-2.13.2.dist-info/RECORD +217 -0
- package/bin/_internal/pydantic-2.13.2.dist-info/WHEEL +4 -0
- package/bin/_internal/pydantic-2.13.2.dist-info/licenses/LICENSE +21 -0
- package/bin/_internal/pydantic_core/_pydantic_core.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_asyncio.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_bisect.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_blake2.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_bz2.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_codecs_cn.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_codecs_hk.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_codecs_iso2022.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_codecs_jp.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_codecs_kr.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_codecs_tw.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_contextvars.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_csv.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_ctypes.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_datetime.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_decimal.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_hashlib.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_heapq.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_json.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_lzma.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_md5.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_multibytecodec.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_multiprocessing.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_opcode.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_pickle.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_posixshmem.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_posixsubprocess.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_queue.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_random.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_scproxy.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_sha1.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_sha2.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_sha3.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_socket.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_ssl.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_statistics.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_struct.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_uuid.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_zoneinfo.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/array.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/binascii.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/fcntl.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/grp.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/math.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/mmap.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/pyexpat.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/readline.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/resource.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/select.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/syslog.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/termios.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/unicodedata.cpython-312-darwin.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/zlib.cpython-312-darwin.so +0 -0
- package/bin/_internal/rpds/rpds.cpython-312-darwin.so +0 -0
- package/bin/_internal/setuptools/_vendor/jaraco/text/Lorem ipsum.txt +2 -0
- package/bin/_internal/vicoa/_bin/README.md +28 -0
- package/bin/_internal/vicoa-1.3.10.dist-info/INSTALLER +1 -0
- package/bin/_internal/vicoa-1.3.10.dist-info/METADATA +311 -0
- package/bin/_internal/vicoa-1.3.10.dist-info/RECORD +11 -0
- package/bin/_internal/vicoa-1.3.10.dist-info/REQUESTED +0 -0
- package/bin/_internal/vicoa-1.3.10.dist-info/WHEEL +5 -0
- package/bin/_internal/vicoa-1.3.10.dist-info/direct_url.json +1 -0
- package/bin/_internal/vicoa-1.3.10.dist-info/entry_points.txt +2 -0
- package/bin/_internal/vicoa-1.3.10.dist-info/licenses/LICENSE +201 -0
- package/bin/_internal/vicoa-1.3.10.dist-info/top_level.txt +3 -0
- package/bin/_internal/watchfiles/_rust_notify.cpython-312-darwin.so +0 -0
- package/bin/_internal/websockets/speedups.cpython-312-darwin.so +0 -0
- package/bin/_internal/websockets-16.0.dist-info/INSTALLER +1 -0
- package/bin/_internal/websockets-16.0.dist-info/METADATA +179 -0
- package/bin/_internal/websockets-16.0.dist-info/RECORD +108 -0
- package/bin/_internal/websockets-16.0.dist-info/WHEEL +6 -0
- package/bin/_internal/websockets-16.0.dist-info/entry_points.txt +2 -0
- package/bin/_internal/websockets-16.0.dist-info/licenses/LICENSE +24 -0
- package/bin/_internal/websockets-16.0.dist-info/top_level.txt +1 -0
- package/bin/_internal/yaml/_yaml.cpython-312-darwin.so +0 -0
- package/bin/_internal/yarl/_quoting_c.cpython-312-darwin.so +0 -0
- package/bin/vicoa +0 -0
- package/package.json +10 -17
- package/README.md +0 -57
- package/bin/vicoa.js +0 -38
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import * as github from "@actions/github";
|
|
2
|
+
import type {
|
|
3
|
+
IssuesEvent,
|
|
4
|
+
IssuesAssignedEvent,
|
|
5
|
+
IssueCommentEvent,
|
|
6
|
+
PullRequestEvent,
|
|
7
|
+
PullRequestReviewEvent,
|
|
8
|
+
PullRequestReviewCommentEvent,
|
|
9
|
+
WorkflowRunEvent,
|
|
10
|
+
} from "@octokit/webhooks-types";
|
|
11
|
+
// Custom types for GitHub Actions events that aren't webhooks
|
|
12
|
+
export type WorkflowDispatchEvent = {
|
|
13
|
+
action?: never;
|
|
14
|
+
inputs?: Record<string, any>;
|
|
15
|
+
ref?: string;
|
|
16
|
+
repository: {
|
|
17
|
+
name: string;
|
|
18
|
+
owner: {
|
|
19
|
+
login: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
sender: {
|
|
23
|
+
login: string;
|
|
24
|
+
};
|
|
25
|
+
workflow: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type ScheduleEvent = {
|
|
29
|
+
action?: never;
|
|
30
|
+
schedule?: string;
|
|
31
|
+
repository: {
|
|
32
|
+
name: string;
|
|
33
|
+
owner: {
|
|
34
|
+
login: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type RepositoryDispatchEvent = {
|
|
40
|
+
action?: string;
|
|
41
|
+
client_payload?: Record<string, any>;
|
|
42
|
+
repository: {
|
|
43
|
+
name: string;
|
|
44
|
+
owner: {
|
|
45
|
+
login: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
sender?: {
|
|
49
|
+
login: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// Event name constants for better maintainability
|
|
54
|
+
const ENTITY_EVENT_NAMES = [
|
|
55
|
+
"issues",
|
|
56
|
+
"issue_comment",
|
|
57
|
+
"pull_request",
|
|
58
|
+
"pull_request_review",
|
|
59
|
+
"pull_request_review_comment",
|
|
60
|
+
] as const;
|
|
61
|
+
|
|
62
|
+
const AUTOMATION_EVENT_NAMES = [
|
|
63
|
+
"workflow_dispatch",
|
|
64
|
+
"schedule",
|
|
65
|
+
"workflow_run",
|
|
66
|
+
"repository_dispatch",
|
|
67
|
+
] as const;
|
|
68
|
+
|
|
69
|
+
// Derive types from constants for better maintainability
|
|
70
|
+
type EntityEventName = (typeof ENTITY_EVENT_NAMES)[number];
|
|
71
|
+
type AutomationEventName = (typeof AUTOMATION_EVENT_NAMES)[number];
|
|
72
|
+
|
|
73
|
+
// Common fields shared by all context types
|
|
74
|
+
type BaseContext = {
|
|
75
|
+
runId: string;
|
|
76
|
+
eventAction?: string;
|
|
77
|
+
repository: {
|
|
78
|
+
owner: string;
|
|
79
|
+
repo: string;
|
|
80
|
+
full_name: string;
|
|
81
|
+
};
|
|
82
|
+
actor: string;
|
|
83
|
+
inputs: {
|
|
84
|
+
prompt: string;
|
|
85
|
+
triggerPhrase: string;
|
|
86
|
+
assigneeTrigger: string;
|
|
87
|
+
labelTrigger: string;
|
|
88
|
+
baseBranch?: string;
|
|
89
|
+
branchPrefix: string;
|
|
90
|
+
useStickyComment: boolean;
|
|
91
|
+
useCommitSigning: boolean;
|
|
92
|
+
allowedBots: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
// Context for entity-based events (issues, PRs, comments)
|
|
97
|
+
export type ParsedGitHubContext = BaseContext & {
|
|
98
|
+
eventName: EntityEventName;
|
|
99
|
+
payload:
|
|
100
|
+
| IssuesEvent
|
|
101
|
+
| IssueCommentEvent
|
|
102
|
+
| PullRequestEvent
|
|
103
|
+
| PullRequestReviewEvent
|
|
104
|
+
| PullRequestReviewCommentEvent;
|
|
105
|
+
entityNumber: number;
|
|
106
|
+
isPR: boolean;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
// Context for automation events (workflow_dispatch, schedule, workflow_run, repository_dispatch)
|
|
110
|
+
export type AutomationContext = BaseContext & {
|
|
111
|
+
eventName: AutomationEventName;
|
|
112
|
+
payload: WorkflowDispatchEvent | ScheduleEvent | WorkflowRunEvent | RepositoryDispatchEvent;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
// Union type for all contexts
|
|
116
|
+
export type GitHubContext = ParsedGitHubContext | AutomationContext;
|
|
117
|
+
|
|
118
|
+
export function parseGitHubContext(): GitHubContext {
|
|
119
|
+
const context = github.context;
|
|
120
|
+
|
|
121
|
+
const commonFields = {
|
|
122
|
+
runId: process.env.GITHUB_RUN_ID!,
|
|
123
|
+
eventAction: context.payload.action,
|
|
124
|
+
repository: {
|
|
125
|
+
owner: context.repo.owner,
|
|
126
|
+
repo: context.repo.repo,
|
|
127
|
+
full_name: `${context.repo.owner}/${context.repo.repo}`,
|
|
128
|
+
},
|
|
129
|
+
actor: context.actor,
|
|
130
|
+
inputs: {
|
|
131
|
+
prompt: process.env.PROMPT || "",
|
|
132
|
+
triggerPhrase: process.env.TRIGGER_PHRASE ?? "@claude",
|
|
133
|
+
assigneeTrigger: process.env.ASSIGNEE_TRIGGER ?? "",
|
|
134
|
+
labelTrigger: process.env.LABEL_TRIGGER ?? "",
|
|
135
|
+
baseBranch: process.env.BASE_BRANCH,
|
|
136
|
+
branchPrefix: process.env.BRANCH_PREFIX ?? "claude/",
|
|
137
|
+
useStickyComment: process.env.USE_STICKY_COMMENT === "true",
|
|
138
|
+
useCommitSigning: process.env.USE_COMMIT_SIGNING === "true",
|
|
139
|
+
allowedBots: process.env.ALLOWED_BOTS ?? "",
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
switch (context.eventName) {
|
|
144
|
+
case "issues": {
|
|
145
|
+
const payload = context.payload as IssuesEvent;
|
|
146
|
+
return {
|
|
147
|
+
...commonFields,
|
|
148
|
+
eventName: "issues",
|
|
149
|
+
payload,
|
|
150
|
+
entityNumber: payload.issue.number,
|
|
151
|
+
isPR: false,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
case "issue_comment": {
|
|
155
|
+
const payload = context.payload as IssueCommentEvent;
|
|
156
|
+
return {
|
|
157
|
+
...commonFields,
|
|
158
|
+
eventName: "issue_comment",
|
|
159
|
+
payload,
|
|
160
|
+
entityNumber: payload.issue.number,
|
|
161
|
+
isPR: Boolean(payload.issue.pull_request),
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
case "pull_request": {
|
|
165
|
+
const payload = context.payload as PullRequestEvent;
|
|
166
|
+
return {
|
|
167
|
+
...commonFields,
|
|
168
|
+
eventName: "pull_request",
|
|
169
|
+
payload,
|
|
170
|
+
entityNumber: payload.pull_request.number,
|
|
171
|
+
isPR: true,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
case "pull_request_review": {
|
|
175
|
+
const payload = context.payload as PullRequestReviewEvent;
|
|
176
|
+
return {
|
|
177
|
+
...commonFields,
|
|
178
|
+
eventName: "pull_request_review",
|
|
179
|
+
payload,
|
|
180
|
+
entityNumber: payload.pull_request.number,
|
|
181
|
+
isPR: true,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
case "pull_request_review_comment": {
|
|
185
|
+
const payload = context.payload as PullRequestReviewCommentEvent;
|
|
186
|
+
return {
|
|
187
|
+
...commonFields,
|
|
188
|
+
eventName: "pull_request_review_comment",
|
|
189
|
+
payload,
|
|
190
|
+
entityNumber: payload.pull_request.number,
|
|
191
|
+
isPR: true,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
case "workflow_dispatch": {
|
|
195
|
+
return {
|
|
196
|
+
...commonFields,
|
|
197
|
+
eventName: "workflow_dispatch",
|
|
198
|
+
payload: context.payload as unknown as WorkflowDispatchEvent,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
case "schedule": {
|
|
202
|
+
return {
|
|
203
|
+
...commonFields,
|
|
204
|
+
eventName: "schedule",
|
|
205
|
+
payload: context.payload as unknown as ScheduleEvent,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
case "workflow_run": {
|
|
209
|
+
return {
|
|
210
|
+
...commonFields,
|
|
211
|
+
eventName: "workflow_run",
|
|
212
|
+
payload: context.payload as unknown as WorkflowRunEvent,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
case "repository_dispatch": {
|
|
216
|
+
return {
|
|
217
|
+
...commonFields,
|
|
218
|
+
eventName: "repository_dispatch",
|
|
219
|
+
payload: context.payload as unknown as RepositoryDispatchEvent,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
default:
|
|
223
|
+
throw new Error(`Unsupported event type: ${context.eventName}`);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export function isIssuesEvent(
|
|
228
|
+
context: GitHubContext,
|
|
229
|
+
): context is ParsedGitHubContext & { payload: IssuesEvent } {
|
|
230
|
+
return context.eventName === "issues";
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export function isIssueCommentEvent(
|
|
234
|
+
context: GitHubContext,
|
|
235
|
+
): context is ParsedGitHubContext & { payload: IssueCommentEvent } {
|
|
236
|
+
return context.eventName === "issue_comment";
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export function isPullRequestEvent(
|
|
240
|
+
context: GitHubContext,
|
|
241
|
+
): context is ParsedGitHubContext & { payload: PullRequestEvent } {
|
|
242
|
+
return context.eventName === "pull_request";
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export function isPullRequestReviewEvent(
|
|
246
|
+
context: GitHubContext,
|
|
247
|
+
): context is ParsedGitHubContext & { payload: PullRequestReviewEvent } {
|
|
248
|
+
return context.eventName === "pull_request_review";
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export function isPullRequestReviewCommentEvent(
|
|
252
|
+
context: GitHubContext,
|
|
253
|
+
): context is ParsedGitHubContext & { payload: PullRequestReviewCommentEvent } {
|
|
254
|
+
return context.eventName === "pull_request_review_comment";
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export function isIssuesAssignedEvent(
|
|
258
|
+
context: GitHubContext,
|
|
259
|
+
): context is ParsedGitHubContext & { payload: IssuesAssignedEvent } {
|
|
260
|
+
return isIssuesEvent(context) && context.eventAction === "assigned";
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// Type guard to check if context is an entity context (has entityNumber and isPR)
|
|
264
|
+
export function isEntityContext(
|
|
265
|
+
context: GitHubContext,
|
|
266
|
+
): context is ParsedGitHubContext {
|
|
267
|
+
return ENTITY_EVENT_NAMES.includes(context.eventName as EntityEventName);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// Type guard to check if context is an automation context
|
|
271
|
+
export function isAutomationContext(
|
|
272
|
+
context: GitHubContext,
|
|
273
|
+
): context is AutomationContext {
|
|
274
|
+
return AUTOMATION_EVENT_NAMES.includes(
|
|
275
|
+
context.eventName as AutomationEventName,
|
|
276
|
+
);
|
|
277
|
+
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { execFileSync } from "child_process";
|
|
2
|
+
import type { Octokits } from "../api/client";
|
|
3
|
+
import { ISSUE_QUERY, PR_QUERY, USER_QUERY } from "../api/queries/github";
|
|
4
|
+
import type {
|
|
5
|
+
GitHubComment,
|
|
6
|
+
GitHubFile,
|
|
7
|
+
GitHubIssue,
|
|
8
|
+
GitHubPullRequest,
|
|
9
|
+
GitHubReview,
|
|
10
|
+
IssueQueryResponse,
|
|
11
|
+
PullRequestQueryResponse,
|
|
12
|
+
} from "../types";
|
|
13
|
+
import type { CommentWithImages } from "../utils/image-downloader";
|
|
14
|
+
import { downloadCommentImages } from "../utils/image-downloader";
|
|
15
|
+
|
|
16
|
+
type FetchDataParams = {
|
|
17
|
+
octokits: Octokits;
|
|
18
|
+
repository: string;
|
|
19
|
+
prNumber: string;
|
|
20
|
+
isPR: boolean;
|
|
21
|
+
triggerUsername?: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type GitHubFileWithSHA = GitHubFile & {
|
|
25
|
+
sha: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type FetchDataResult = {
|
|
29
|
+
contextData: GitHubPullRequest | GitHubIssue;
|
|
30
|
+
comments: GitHubComment[];
|
|
31
|
+
changedFiles: GitHubFile[];
|
|
32
|
+
changedFilesWithSHA: GitHubFileWithSHA[];
|
|
33
|
+
reviewData: { nodes: GitHubReview[] } | null;
|
|
34
|
+
imageUrlMap: Map<string, string>;
|
|
35
|
+
triggerDisplayName?: string | null;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export async function fetchGitHubData({
|
|
39
|
+
octokits,
|
|
40
|
+
repository,
|
|
41
|
+
prNumber,
|
|
42
|
+
isPR,
|
|
43
|
+
triggerUsername,
|
|
44
|
+
}: FetchDataParams): Promise<FetchDataResult> {
|
|
45
|
+
const [owner, repo] = repository.split("/");
|
|
46
|
+
if (!owner || !repo) {
|
|
47
|
+
throw new Error("Invalid repository format. Expected 'owner/repo'.");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
let contextData: GitHubPullRequest | GitHubIssue | null = null;
|
|
51
|
+
let comments: GitHubComment[] = [];
|
|
52
|
+
let changedFiles: GitHubFile[] = [];
|
|
53
|
+
let reviewData: { nodes: GitHubReview[] } | null = null;
|
|
54
|
+
|
|
55
|
+
try {
|
|
56
|
+
if (isPR) {
|
|
57
|
+
// Fetch PR data with all comments and file information
|
|
58
|
+
const prResult = await octokits.graphql<PullRequestQueryResponse>(
|
|
59
|
+
PR_QUERY,
|
|
60
|
+
{
|
|
61
|
+
owner,
|
|
62
|
+
repo,
|
|
63
|
+
number: parseInt(prNumber),
|
|
64
|
+
},
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
if (prResult.repository.pullRequest) {
|
|
68
|
+
const pullRequest = prResult.repository.pullRequest;
|
|
69
|
+
contextData = pullRequest;
|
|
70
|
+
changedFiles = pullRequest.files.nodes || [];
|
|
71
|
+
comments = pullRequest.comments?.nodes || [];
|
|
72
|
+
reviewData = pullRequest.reviews || [];
|
|
73
|
+
|
|
74
|
+
console.log(`Successfully fetched PR #${prNumber} data`);
|
|
75
|
+
} else {
|
|
76
|
+
throw new Error(`PR #${prNumber} not found`);
|
|
77
|
+
}
|
|
78
|
+
} else {
|
|
79
|
+
// Fetch issue data
|
|
80
|
+
const issueResult = await octokits.graphql<IssueQueryResponse>(
|
|
81
|
+
ISSUE_QUERY,
|
|
82
|
+
{
|
|
83
|
+
owner,
|
|
84
|
+
repo,
|
|
85
|
+
number: parseInt(prNumber),
|
|
86
|
+
},
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
if (issueResult.repository.issue) {
|
|
90
|
+
contextData = issueResult.repository.issue;
|
|
91
|
+
comments = contextData?.comments?.nodes || [];
|
|
92
|
+
|
|
93
|
+
console.log(`Successfully fetched issue #${prNumber} data`);
|
|
94
|
+
} else {
|
|
95
|
+
throw new Error(`Issue #${prNumber} not found`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
} catch (error) {
|
|
99
|
+
console.error(`Failed to fetch ${isPR ? "PR" : "issue"} data:`, error);
|
|
100
|
+
throw new Error(`Failed to fetch ${isPR ? "PR" : "issue"} data`);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Compute SHAs for changed files
|
|
104
|
+
let changedFilesWithSHA: GitHubFileWithSHA[] = [];
|
|
105
|
+
if (isPR && changedFiles.length > 0) {
|
|
106
|
+
changedFilesWithSHA = changedFiles.map((file) => {
|
|
107
|
+
// Don't compute SHA for deleted files
|
|
108
|
+
if (file.changeType === "DELETED") {
|
|
109
|
+
return {
|
|
110
|
+
...file,
|
|
111
|
+
sha: "deleted",
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
try {
|
|
116
|
+
// Use git hash-object to compute the SHA for the current file content
|
|
117
|
+
const sha = execFileSync("git", ["hash-object", file.path], {
|
|
118
|
+
encoding: "utf-8",
|
|
119
|
+
}).trim();
|
|
120
|
+
return {
|
|
121
|
+
...file,
|
|
122
|
+
sha,
|
|
123
|
+
};
|
|
124
|
+
} catch (error) {
|
|
125
|
+
console.warn(`Failed to compute SHA for ${file.path}:`, error);
|
|
126
|
+
// Return original file without SHA if computation fails
|
|
127
|
+
return {
|
|
128
|
+
...file,
|
|
129
|
+
sha: "unknown",
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Prepare all comments for image processing
|
|
136
|
+
const issueComments: CommentWithImages[] = comments
|
|
137
|
+
.filter((c) => c.body && !c.isMinimized)
|
|
138
|
+
.map((c) => ({
|
|
139
|
+
type: "issue_comment" as const,
|
|
140
|
+
id: c.databaseId,
|
|
141
|
+
body: c.body,
|
|
142
|
+
}));
|
|
143
|
+
|
|
144
|
+
const reviewBodies: CommentWithImages[] =
|
|
145
|
+
reviewData?.nodes
|
|
146
|
+
?.filter((r) => r.body)
|
|
147
|
+
.map((r) => ({
|
|
148
|
+
type: "review_body" as const,
|
|
149
|
+
id: r.databaseId,
|
|
150
|
+
pullNumber: prNumber,
|
|
151
|
+
body: r.body,
|
|
152
|
+
})) ?? [];
|
|
153
|
+
|
|
154
|
+
const reviewComments: CommentWithImages[] =
|
|
155
|
+
reviewData?.nodes
|
|
156
|
+
?.flatMap((r) => r.comments?.nodes ?? [])
|
|
157
|
+
.filter((c) => c.body && !c.isMinimized)
|
|
158
|
+
.map((c) => ({
|
|
159
|
+
type: "review_comment" as const,
|
|
160
|
+
id: c.databaseId,
|
|
161
|
+
body: c.body,
|
|
162
|
+
})) ?? [];
|
|
163
|
+
|
|
164
|
+
// Add the main issue/PR body if it has content
|
|
165
|
+
const mainBody: CommentWithImages[] = contextData.body
|
|
166
|
+
? [
|
|
167
|
+
{
|
|
168
|
+
...(isPR
|
|
169
|
+
? {
|
|
170
|
+
type: "pr_body" as const,
|
|
171
|
+
pullNumber: prNumber,
|
|
172
|
+
body: contextData.body,
|
|
173
|
+
}
|
|
174
|
+
: {
|
|
175
|
+
type: "issue_body" as const,
|
|
176
|
+
issueNumber: prNumber,
|
|
177
|
+
body: contextData.body,
|
|
178
|
+
}),
|
|
179
|
+
},
|
|
180
|
+
]
|
|
181
|
+
: [];
|
|
182
|
+
|
|
183
|
+
const allComments = [
|
|
184
|
+
...mainBody,
|
|
185
|
+
...issueComments,
|
|
186
|
+
...reviewBodies,
|
|
187
|
+
...reviewComments,
|
|
188
|
+
];
|
|
189
|
+
|
|
190
|
+
const imageUrlMap = await downloadCommentImages(
|
|
191
|
+
octokits,
|
|
192
|
+
owner,
|
|
193
|
+
repo,
|
|
194
|
+
allComments,
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
// Fetch trigger user display name if username is provided
|
|
198
|
+
let triggerDisplayName: string | null | undefined;
|
|
199
|
+
if (triggerUsername) {
|
|
200
|
+
triggerDisplayName = await fetchUserDisplayName(octokits, triggerUsername);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return {
|
|
204
|
+
contextData,
|
|
205
|
+
comments,
|
|
206
|
+
changedFiles,
|
|
207
|
+
changedFilesWithSHA,
|
|
208
|
+
reviewData,
|
|
209
|
+
imageUrlMap,
|
|
210
|
+
triggerDisplayName,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export type UserQueryResponse = {
|
|
215
|
+
user: {
|
|
216
|
+
name: string | null;
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
export async function fetchUserDisplayName(
|
|
221
|
+
octokits: Octokits,
|
|
222
|
+
login: string,
|
|
223
|
+
): Promise<string | null> {
|
|
224
|
+
try {
|
|
225
|
+
const result = await octokits.graphql<UserQueryResponse>(USER_QUERY, {
|
|
226
|
+
login,
|
|
227
|
+
});
|
|
228
|
+
return result.user.name;
|
|
229
|
+
} catch (error) {
|
|
230
|
+
console.warn(`Failed to fetch user display name for ${login}:`, error);
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
GitHubPullRequest,
|
|
3
|
+
GitHubIssue,
|
|
4
|
+
GitHubComment,
|
|
5
|
+
GitHubFile,
|
|
6
|
+
GitHubReview,
|
|
7
|
+
} from "../types";
|
|
8
|
+
import type { GitHubFileWithSHA } from "./fetcher";
|
|
9
|
+
import { sanitizeContent } from "../utils/sanitizer";
|
|
10
|
+
|
|
11
|
+
export function formatContext(
|
|
12
|
+
contextData: GitHubPullRequest | GitHubIssue,
|
|
13
|
+
isPR: boolean,
|
|
14
|
+
): string {
|
|
15
|
+
if (isPR) {
|
|
16
|
+
const prData = contextData as GitHubPullRequest;
|
|
17
|
+
return `PR Title: ${prData.title}
|
|
18
|
+
PR Author: ${prData.author.login}
|
|
19
|
+
PR Branch: ${prData.headRefName} -> ${prData.baseRefName}
|
|
20
|
+
PR State: ${prData.state}
|
|
21
|
+
PR Additions: ${prData.additions}
|
|
22
|
+
PR Deletions: ${prData.deletions}
|
|
23
|
+
Total Commits: ${prData.commits.totalCount}
|
|
24
|
+
Changed Files: ${prData.files.nodes.length} files`;
|
|
25
|
+
} else {
|
|
26
|
+
const issueData = contextData as GitHubIssue;
|
|
27
|
+
return `Issue Title: ${issueData.title}
|
|
28
|
+
Issue Author: ${issueData.author.login}
|
|
29
|
+
Issue State: ${issueData.state}`;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function formatBody(
|
|
34
|
+
body: string,
|
|
35
|
+
imageUrlMap: Map<string, string>,
|
|
36
|
+
): string {
|
|
37
|
+
let processedBody = body;
|
|
38
|
+
|
|
39
|
+
for (const [originalUrl, localPath] of imageUrlMap) {
|
|
40
|
+
processedBody = processedBody.replaceAll(originalUrl, localPath);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
processedBody = sanitizeContent(processedBody);
|
|
44
|
+
|
|
45
|
+
return processedBody;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function formatComments(
|
|
49
|
+
comments: GitHubComment[],
|
|
50
|
+
imageUrlMap?: Map<string, string>,
|
|
51
|
+
): string {
|
|
52
|
+
return comments
|
|
53
|
+
.filter((comment) => !comment.isMinimized)
|
|
54
|
+
.map((comment) => {
|
|
55
|
+
let body = comment.body;
|
|
56
|
+
|
|
57
|
+
if (imageUrlMap && body) {
|
|
58
|
+
for (const [originalUrl, localPath] of imageUrlMap) {
|
|
59
|
+
body = body.replaceAll(originalUrl, localPath);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
body = sanitizeContent(body);
|
|
64
|
+
|
|
65
|
+
return `[${comment.author.login} at ${comment.createdAt}]: ${body}`;
|
|
66
|
+
})
|
|
67
|
+
.join("\n\n");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function formatReviewComments(
|
|
71
|
+
reviewData: { nodes: GitHubReview[] } | null,
|
|
72
|
+
imageUrlMap?: Map<string, string>,
|
|
73
|
+
): string {
|
|
74
|
+
if (!reviewData || !reviewData.nodes) {
|
|
75
|
+
return "";
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const formattedReviews = reviewData.nodes.map((review) => {
|
|
79
|
+
let reviewOutput = `[Review by ${review.author.login} at ${review.submittedAt}]: ${review.state}`;
|
|
80
|
+
|
|
81
|
+
if (review.body && review.body.trim()) {
|
|
82
|
+
let body = review.body;
|
|
83
|
+
|
|
84
|
+
if (imageUrlMap) {
|
|
85
|
+
for (const [originalUrl, localPath] of imageUrlMap) {
|
|
86
|
+
body = body.replaceAll(originalUrl, localPath);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const sanitizedBody = sanitizeContent(body);
|
|
91
|
+
reviewOutput += `\n${sanitizedBody}`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (
|
|
95
|
+
review.comments &&
|
|
96
|
+
review.comments.nodes &&
|
|
97
|
+
review.comments.nodes.length > 0
|
|
98
|
+
) {
|
|
99
|
+
const comments = review.comments.nodes
|
|
100
|
+
.filter((comment) => !comment.isMinimized)
|
|
101
|
+
.map((comment) => {
|
|
102
|
+
let body = comment.body;
|
|
103
|
+
|
|
104
|
+
if (imageUrlMap) {
|
|
105
|
+
for (const [originalUrl, localPath] of imageUrlMap) {
|
|
106
|
+
body = body.replaceAll(originalUrl, localPath);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
body = sanitizeContent(body);
|
|
111
|
+
|
|
112
|
+
return ` [Comment on ${comment.path}:${comment.line || "?"}]: ${body}`;
|
|
113
|
+
})
|
|
114
|
+
.join("\n");
|
|
115
|
+
if (comments) {
|
|
116
|
+
reviewOutput += `\n${comments}`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return reviewOutput;
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
return formattedReviews.join("\n\n");
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function formatChangedFiles(changedFiles: GitHubFile[]): string {
|
|
127
|
+
return changedFiles
|
|
128
|
+
.map(
|
|
129
|
+
(file) =>
|
|
130
|
+
`- ${file.path} (${file.changeType}) +${file.additions}/-${file.deletions}`,
|
|
131
|
+
)
|
|
132
|
+
.join("\n");
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export function formatChangedFilesWithSHA(
|
|
136
|
+
changedFiles: GitHubFileWithSHA[],
|
|
137
|
+
): string {
|
|
138
|
+
return changedFiles
|
|
139
|
+
.map(
|
|
140
|
+
(file) =>
|
|
141
|
+
`- ${file.path} (${file.changeType}) +${file.additions}/-${file.deletions} SHA: ${file.sha}`,
|
|
142
|
+
)
|
|
143
|
+
.join("\n");
|
|
144
|
+
}
|