attio-mcp 0.1.0
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/CHANGELOG.md +62 -0
- package/LICENSE +236 -0
- package/README.md +105 -0
- package/dist/api/attio-client.d.ts +25 -0
- package/dist/api/attio-client.d.ts.map +1 -0
- package/dist/api/attio-client.js +64 -0
- package/dist/api/attio-client.js.map +1 -0
- package/dist/api/attribute-types.d.ts +119 -0
- package/dist/api/attribute-types.d.ts.map +1 -0
- package/dist/api/attribute-types.js +320 -0
- package/dist/api/attribute-types.js.map +1 -0
- package/dist/api/client.d.ts +3 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +61 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/operations/batch.d.ts +55 -0
- package/dist/api/operations/batch.d.ts.map +1 -0
- package/dist/api/operations/batch.js +176 -0
- package/dist/api/operations/batch.js.map +1 -0
- package/dist/api/operations/crud.d.ts +61 -0
- package/dist/api/operations/crud.d.ts.map +1 -0
- package/dist/api/operations/crud.js +192 -0
- package/dist/api/operations/crud.js.map +1 -0
- package/dist/api/operations/index.d.ts +14 -0
- package/dist/api/operations/index.d.ts.map +1 -0
- package/dist/api/operations/index.js +18 -0
- package/dist/api/operations/index.js.map +1 -0
- package/dist/api/operations/lists.d.ts +66 -0
- package/dist/api/operations/lists.d.ts.map +1 -0
- package/dist/api/operations/lists.js +300 -0
- package/dist/api/operations/lists.js.map +1 -0
- package/dist/api/operations/notes.d.ts +29 -0
- package/dist/api/operations/notes.d.ts.map +1 -0
- package/dist/api/operations/notes.js +63 -0
- package/dist/api/operations/notes.js.map +1 -0
- package/dist/api/operations/retry.d.ts +48 -0
- package/dist/api/operations/retry.d.ts.map +1 -0
- package/dist/api/operations/retry.js +98 -0
- package/dist/api/operations/retry.js.map +1 -0
- package/dist/api/operations/search.d.ts +37 -0
- package/dist/api/operations/search.d.ts.map +1 -0
- package/dist/api/operations/search.js +186 -0
- package/dist/api/operations/search.js.map +1 -0
- package/dist/api/operations/tasks.d.ts +20 -0
- package/dist/api/operations/tasks.d.ts.map +1 -0
- package/dist/api/operations/tasks.js +87 -0
- package/dist/api/operations/tasks.js.map +1 -0
- package/dist/api/operations/types.d.ts +61 -0
- package/dist/api/operations/types.d.ts.map +1 -0
- package/dist/api/operations/types.js +10 -0
- package/dist/api/operations/types.js.map +1 -0
- package/dist/cli/commands/attributes.d.ts +34 -0
- package/dist/cli/commands/attributes.d.ts.map +1 -0
- package/dist/cli/commands/attributes.js +171 -0
- package/dist/cli/commands/attributes.js.map +1 -0
- package/dist/cli/discover.d.ts +3 -0
- package/dist/cli/discover.d.ts.map +1 -0
- package/dist/cli/discover.js +72 -0
- package/dist/cli/discover.js.map +1 -0
- package/dist/errors/api-errors.d.ts +191 -0
- package/dist/errors/api-errors.d.ts.map +1 -0
- package/dist/errors/api-errors.js +305 -0
- package/dist/errors/api-errors.js.map +1 -0
- package/dist/errors/company-errors.d.ts +40 -0
- package/dist/errors/company-errors.d.ts.map +1 -0
- package/dist/errors/company-errors.js +62 -0
- package/dist/errors/company-errors.js.map +1 -0
- package/dist/errors/value-match-error.d.ts +15 -0
- package/dist/errors/value-match-error.d.ts.map +1 -0
- package/dist/errors/value-match-error.js +40 -0
- package/dist/errors/value-match-error.js.map +1 -0
- package/dist/handlers/error-interceptor.d.ts +6 -0
- package/dist/handlers/error-interceptor.d.ts.map +1 -0
- package/dist/handlers/error-interceptor.js +17 -0
- package/dist/handlers/error-interceptor.js.map +1 -0
- package/dist/handlers/rate-limited-handler.d.ts +17 -0
- package/dist/handlers/rate-limited-handler.d.ts.map +1 -0
- package/dist/handlers/rate-limited-handler.js +126 -0
- package/dist/handlers/rate-limited-handler.js.map +1 -0
- package/dist/handlers/resources.d.ts +11 -0
- package/dist/handlers/resources.d.ts.map +1 -0
- package/dist/handlers/resources.js +109 -0
- package/dist/handlers/resources.js.map +1 -0
- package/dist/handlers/tool-configs/companies/attributes.d.ts +85 -0
- package/dist/handlers/tool-configs/companies/attributes.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/attributes.js +203 -0
- package/dist/handlers/tool-configs/companies/attributes.js.map +1 -0
- package/dist/handlers/tool-configs/companies/batch.d.ts +145 -0
- package/dist/handlers/tool-configs/companies/batch.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/batch.js +249 -0
- package/dist/handlers/tool-configs/companies/batch.js.map +1 -0
- package/dist/handlers/tool-configs/companies/crud.d.ts +103 -0
- package/dist/handlers/tool-configs/companies/crud.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/crud.js +157 -0
- package/dist/handlers/tool-configs/companies/crud.js.map +1 -0
- package/dist/handlers/tool-configs/companies/definitions.d.ts +5 -0
- package/dist/handlers/tool-configs/companies/definitions.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/definitions.js +9 -0
- package/dist/handlers/tool-configs/companies/definitions.js.map +1 -0
- package/dist/handlers/tool-configs/companies/formatters.d.ts +42 -0
- package/dist/handlers/tool-configs/companies/formatters.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/formatters.js +324 -0
- package/dist/handlers/tool-configs/companies/formatters.js.map +1 -0
- package/dist/handlers/tool-configs/companies/index.d.ts +642 -0
- package/dist/handlers/tool-configs/companies/index.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/index.js +86 -0
- package/dist/handlers/tool-configs/companies/index.js.map +1 -0
- package/dist/handlers/tool-configs/companies/notes.d.ts +61 -0
- package/dist/handlers/tool-configs/companies/notes.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/notes.js +109 -0
- package/dist/handlers/tool-configs/companies/notes.js.map +1 -0
- package/dist/handlers/tool-configs/companies/relationships.d.ts +137 -0
- package/dist/handlers/tool-configs/companies/relationships.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/relationships.js +163 -0
- package/dist/handlers/tool-configs/companies/relationships.js.map +1 -0
- package/dist/handlers/tool-configs/companies/search.d.ts +101 -0
- package/dist/handlers/tool-configs/companies/search.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/search.js +163 -0
- package/dist/handlers/tool-configs/companies/search.js.map +1 -0
- package/dist/handlers/tool-configs/companies/types.d.ts +6 -0
- package/dist/handlers/tool-configs/companies/types.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/types.js +2 -0
- package/dist/handlers/tool-configs/companies/types.js.map +1 -0
- package/dist/handlers/tool-configs/index.d.ts +12 -0
- package/dist/handlers/tool-configs/index.d.ts.map +1 -0
- package/dist/handlers/tool-configs/index.js +12 -0
- package/dist/handlers/tool-configs/index.js.map +1 -0
- package/dist/handlers/tool-configs/lists.d.ts +459 -0
- package/dist/handlers/tool-configs/lists.d.ts.map +1 -0
- package/dist/handlers/tool-configs/lists.js +597 -0
- package/dist/handlers/tool-configs/lists.js.map +1 -0
- package/dist/handlers/tool-configs/paginated-people.d.ts +197 -0
- package/dist/handlers/tool-configs/paginated-people.d.ts.map +1 -0
- package/dist/handlers/tool-configs/paginated-people.js +256 -0
- package/dist/handlers/tool-configs/paginated-people.js.map +1 -0
- package/dist/handlers/tool-configs/people/activity-search.d.ts +98 -0
- package/dist/handlers/tool-configs/people/activity-search.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people/activity-search.js +113 -0
- package/dist/handlers/tool-configs/people/activity-search.js.map +1 -0
- package/dist/handlers/tool-configs/people/advanced-search.d.ts +62 -0
- package/dist/handlers/tool-configs/people/advanced-search.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people/advanced-search.js +74 -0
- package/dist/handlers/tool-configs/people/advanced-search.js.map +1 -0
- package/dist/handlers/tool-configs/people/crud.d.ts +63 -0
- package/dist/handlers/tool-configs/people/crud.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people/crud.js +71 -0
- package/dist/handlers/tool-configs/people/crud.js.map +1 -0
- package/dist/handlers/tool-configs/people/date-search.d.ts +42 -0
- package/dist/handlers/tool-configs/people/date-search.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people/date-search.js +93 -0
- package/dist/handlers/tool-configs/people/date-search.js.map +1 -0
- package/dist/handlers/tool-configs/people/formatters.d.ts +19 -0
- package/dist/handlers/tool-configs/people/formatters.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people/formatters.js +98 -0
- package/dist/handlers/tool-configs/people/formatters.js.map +1 -0
- package/dist/handlers/tool-configs/people/index.d.ts +407 -0
- package/dist/handlers/tool-configs/people/index.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people/index.js +30 -0
- package/dist/handlers/tool-configs/people/index.js.map +1 -0
- package/dist/handlers/tool-configs/people/notes.d.ts +38 -0
- package/dist/handlers/tool-configs/people/notes.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people/notes.js +57 -0
- package/dist/handlers/tool-configs/people/notes.js.map +1 -0
- package/dist/handlers/tool-configs/people/relationships.d.ts +112 -0
- package/dist/handlers/tool-configs/people/relationships.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people/relationships.js +173 -0
- package/dist/handlers/tool-configs/people/relationships.js.map +1 -0
- package/dist/handlers/tool-configs/people/search.d.ts +53 -0
- package/dist/handlers/tool-configs/people/search.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people/search.js +61 -0
- package/dist/handlers/tool-configs/people/search.js.map +1 -0
- package/dist/handlers/tool-configs/people-fix-complete.d.ts +6 -0
- package/dist/handlers/tool-configs/people-fix-complete.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people-fix-complete.js +76 -0
- package/dist/handlers/tool-configs/people-fix-complete.js.map +1 -0
- package/dist/handlers/tool-configs/people-fixed.d.ts +12 -0
- package/dist/handlers/tool-configs/people-fixed.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people-fixed.js +58 -0
- package/dist/handlers/tool-configs/people-fixed.js.map +1 -0
- package/dist/handlers/tool-configs/people-types.d.ts +32 -0
- package/dist/handlers/tool-configs/people-types.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people-types.js +5 -0
- package/dist/handlers/tool-configs/people-types.js.map +1 -0
- package/dist/handlers/tool-configs/people.d.ts +599 -0
- package/dist/handlers/tool-configs/people.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people.js +817 -0
- package/dist/handlers/tool-configs/people.js.map +1 -0
- package/dist/handlers/tool-configs/prompts.d.ts +69 -0
- package/dist/handlers/tool-configs/prompts.d.ts.map +1 -0
- package/dist/handlers/tool-configs/prompts.js +90 -0
- package/dist/handlers/tool-configs/prompts.js.map +1 -0
- package/dist/handlers/tool-configs/rate-limited-people.d.ts +203 -0
- package/dist/handlers/tool-configs/rate-limited-people.d.ts.map +1 -0
- package/dist/handlers/tool-configs/rate-limited-people.js +44 -0
- package/dist/handlers/tool-configs/rate-limited-people.js.map +1 -0
- package/dist/handlers/tool-configs/records/index.d.ts +282 -0
- package/dist/handlers/tool-configs/records/index.d.ts.map +1 -0
- package/dist/handlers/tool-configs/records/index.js +277 -0
- package/dist/handlers/tool-configs/records/index.js.map +1 -0
- package/dist/handlers/tool-configs/records.d.ts +282 -0
- package/dist/handlers/tool-configs/records.d.ts.map +1 -0
- package/dist/handlers/tool-configs/records.js +277 -0
- package/dist/handlers/tool-configs/records.js.map +1 -0
- package/dist/handlers/tool-configs/resource-specific-tools.d.ts +15 -0
- package/dist/handlers/tool-configs/resource-specific-tools.d.ts.map +1 -0
- package/dist/handlers/tool-configs/resource-specific-tools.js +33 -0
- package/dist/handlers/tool-configs/resource-specific-tools.js.map +1 -0
- package/dist/handlers/tool-configs/tasks.d.ts +127 -0
- package/dist/handlers/tool-configs/tasks.d.ts.map +1 -0
- package/dist/handlers/tool-configs/tasks.js +95 -0
- package/dist/handlers/tool-configs/tasks.js.map +1 -0
- package/dist/handlers/tool-types.d.ts +47 -0
- package/dist/handlers/tool-types.d.ts.map +1 -0
- package/dist/handlers/tool-types.js +2 -0
- package/dist/handlers/tool-types.js.map +1 -0
- package/dist/handlers/tools/config-verifier.d.ts +27 -0
- package/dist/handlers/tools/config-verifier.d.ts.map +1 -0
- package/dist/handlers/tools/config-verifier.js +108 -0
- package/dist/handlers/tools/config-verifier.js.map +1 -0
- package/dist/handlers/tools/dispatcher/core.d.ts +12 -0
- package/dist/handlers/tools/dispatcher/core.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/core.js +276 -0
- package/dist/handlers/tools/dispatcher/core.js.map +1 -0
- package/dist/handlers/tools/dispatcher/formatting.d.ts +17 -0
- package/dist/handlers/tools/dispatcher/formatting.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/formatting.js +25 -0
- package/dist/handlers/tools/dispatcher/formatting.js.map +1 -0
- package/dist/handlers/tools/dispatcher/logging.d.ts +63 -0
- package/dist/handlers/tools/dispatcher/logging.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/logging.js +108 -0
- package/dist/handlers/tools/dispatcher/logging.js.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/batch.d.ts +29 -0
- package/dist/handlers/tools/dispatcher/operations/batch.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/batch.js +137 -0
- package/dist/handlers/tools/dispatcher/operations/batch.js.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/crud.d.ts +25 -0
- package/dist/handlers/tools/dispatcher/operations/crud.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/crud.js +110 -0
- package/dist/handlers/tools/dispatcher/operations/crud.js.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/details.d.ts +13 -0
- package/dist/handlers/tools/dispatcher/operations/details.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/details.js +52 -0
- package/dist/handlers/tools/dispatcher/operations/details.js.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/info.d.ts +25 -0
- package/dist/handlers/tools/dispatcher/operations/info.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/info.js +82 -0
- package/dist/handlers/tools/dispatcher/operations/info.js.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/lists.d.ts +62 -0
- package/dist/handlers/tools/dispatcher/operations/lists.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/lists.js +283 -0
- package/dist/handlers/tools/dispatcher/operations/lists.js.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/notes.d.ts +17 -0
- package/dist/handlers/tools/dispatcher/operations/notes.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/notes.js +102 -0
- package/dist/handlers/tools/dispatcher/operations/notes.js.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/search.d.ts +43 -0
- package/dist/handlers/tools/dispatcher/operations/search.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/search.js +190 -0
- package/dist/handlers/tools/dispatcher/operations/search.js.map +1 -0
- package/dist/handlers/tools/dispatcher/validation.d.ts +27 -0
- package/dist/handlers/tools/dispatcher/validation.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/validation.js +47 -0
- package/dist/handlers/tools/dispatcher/validation.js.map +1 -0
- package/dist/handlers/tools/dispatcher.d.ts +11 -0
- package/dist/handlers/tools/dispatcher.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher.js +15 -0
- package/dist/handlers/tools/dispatcher.js.map +1 -0
- package/dist/handlers/tools/error-types.d.ts +33 -0
- package/dist/handlers/tools/error-types.d.ts.map +1 -0
- package/dist/handlers/tools/error-types.js +21 -0
- package/dist/handlers/tools/error-types.js.map +1 -0
- package/dist/handlers/tools/formatters.d.ts +43 -0
- package/dist/handlers/tools/formatters.d.ts.map +1 -0
- package/dist/handlers/tools/formatters.js +170 -0
- package/dist/handlers/tools/formatters.js.map +1 -0
- package/dist/handlers/tools/index.d.ts +15 -0
- package/dist/handlers/tools/index.d.ts.map +1 -0
- package/dist/handlers/tools/index.js +34 -0
- package/dist/handlers/tools/index.js.map +1 -0
- package/dist/handlers/tools/registry.d.ts +1874 -0
- package/dist/handlers/tools/registry.d.ts.map +1 -0
- package/dist/handlers/tools/registry.js +103 -0
- package/dist/handlers/tools/registry.js.map +1 -0
- package/dist/health/http-server.d.ts +24 -0
- package/dist/health/http-server.d.ts.map +1 -0
- package/dist/health/http-server.js +106 -0
- package/dist/health/http-server.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +238 -0
- package/dist/index.js.map +1 -0
- package/dist/objects/base-operations.d.ts +41 -0
- package/dist/objects/base-operations.d.ts.map +1 -0
- package/dist/objects/base-operations.js +116 -0
- package/dist/objects/base-operations.js.map +1 -0
- package/dist/objects/batch-companies.d.ts +112 -0
- package/dist/objects/batch-companies.d.ts.map +1 -0
- package/dist/objects/batch-companies.js +347 -0
- package/dist/objects/batch-companies.js.map +1 -0
- package/dist/objects/companies/attributes.d.ts +83 -0
- package/dist/objects/companies/attributes.d.ts.map +1 -0
- package/dist/objects/companies/attributes.js +426 -0
- package/dist/objects/companies/attributes.js.map +1 -0
- package/dist/objects/companies/basic.d.ts +117 -0
- package/dist/objects/companies/basic.d.ts.map +1 -0
- package/dist/objects/companies/basic.js +367 -0
- package/dist/objects/companies/basic.js.map +1 -0
- package/dist/objects/companies/batch.d.ts +6 -0
- package/dist/objects/companies/batch.d.ts.map +1 -0
- package/dist/objects/companies/batch.js +6 -0
- package/dist/objects/companies/batch.js.map +1 -0
- package/dist/objects/companies/index.d.ts +13 -0
- package/dist/objects/companies/index.d.ts.map +1 -0
- package/dist/objects/companies/index.js +17 -0
- package/dist/objects/companies/index.js.map +1 -0
- package/dist/objects/companies/notes.d.ts +26 -0
- package/dist/objects/companies/notes.d.ts.map +1 -0
- package/dist/objects/companies/notes.js +199 -0
- package/dist/objects/companies/notes.js.map +1 -0
- package/dist/objects/companies/relationships.d.ts +41 -0
- package/dist/objects/companies/relationships.d.ts.map +1 -0
- package/dist/objects/companies/relationships.js +142 -0
- package/dist/objects/companies/relationships.js.map +1 -0
- package/dist/objects/companies/search.d.ts +158 -0
- package/dist/objects/companies/search.d.ts.map +1 -0
- package/dist/objects/companies/search.js +463 -0
- package/dist/objects/companies/search.js.map +1 -0
- package/dist/objects/companies/types.d.ts +27 -0
- package/dist/objects/companies/types.d.ts.map +1 -0
- package/dist/objects/companies/types.js +3 -0
- package/dist/objects/companies/types.js.map +1 -0
- package/dist/objects/lists.d.ts +148 -0
- package/dist/objects/lists.d.ts.map +1 -0
- package/dist/objects/lists.js +586 -0
- package/dist/objects/lists.js.map +1 -0
- package/dist/objects/paginated-people.d.ts +50 -0
- package/dist/objects/paginated-people.d.ts.map +1 -0
- package/dist/objects/paginated-people.js +171 -0
- package/dist/objects/paginated-people.js.map +1 -0
- package/dist/objects/people/basic.d.ts +90 -0
- package/dist/objects/people/basic.d.ts.map +1 -0
- package/dist/objects/people/basic.js +157 -0
- package/dist/objects/people/basic.js.map +1 -0
- package/dist/objects/people/batch.d.ts +24 -0
- package/dist/objects/people/batch.d.ts.map +1 -0
- package/dist/objects/people/batch.js +145 -0
- package/dist/objects/people/batch.js.map +1 -0
- package/dist/objects/people/index.d.ts +11 -0
- package/dist/objects/people/index.d.ts.map +1 -0
- package/dist/objects/people/index.js +17 -0
- package/dist/objects/people/index.js.map +1 -0
- package/dist/objects/people/notes.d.ts +20 -0
- package/dist/objects/people/notes.d.ts.map +1 -0
- package/dist/objects/people/notes.js +60 -0
- package/dist/objects/people/notes.js.map +1 -0
- package/dist/objects/people/relationships.d.ts +23 -0
- package/dist/objects/people/relationships.d.ts.map +1 -0
- package/dist/objects/people/relationships.js +116 -0
- package/dist/objects/people/relationships.js.map +1 -0
- package/dist/objects/people/search.d.ts +83 -0
- package/dist/objects/people/search.d.ts.map +1 -0
- package/dist/objects/people/search.js +286 -0
- package/dist/objects/people/search.js.map +1 -0
- package/dist/objects/people/types.d.ts +37 -0
- package/dist/objects/people/types.d.ts.map +1 -0
- package/dist/objects/people/types.js +71 -0
- package/dist/objects/people/types.js.map +1 -0
- package/dist/objects/people-write.d.ts +71 -0
- package/dist/objects/people-write.d.ts.map +1 -0
- package/dist/objects/people-write.js +261 -0
- package/dist/objects/people-write.js.map +1 -0
- package/dist/objects/records/formatters.d.ts +20 -0
- package/dist/objects/records/formatters.d.ts.map +1 -0
- package/dist/objects/records/formatters.js +47 -0
- package/dist/objects/records/formatters.js.map +1 -0
- package/dist/objects/records/index.d.ts +74 -0
- package/dist/objects/records/index.d.ts.map +1 -0
- package/dist/objects/records/index.js +374 -0
- package/dist/objects/records/index.js.map +1 -0
- package/dist/objects/records.d.ts +88 -0
- package/dist/objects/records.d.ts.map +1 -0
- package/dist/objects/records.js +432 -0
- package/dist/objects/records.js.map +1 -0
- package/dist/objects/tasks.d.ts +19 -0
- package/dist/objects/tasks.d.ts.map +1 -0
- package/dist/objects/tasks.js +23 -0
- package/dist/objects/tasks.js.map +1 -0
- package/dist/prompts/error-handler.d.ts +28 -0
- package/dist/prompts/error-handler.d.ts.map +1 -0
- package/dist/prompts/error-handler.js +47 -0
- package/dist/prompts/error-handler.js.map +1 -0
- package/dist/prompts/handlers.d.ts +49 -0
- package/dist/prompts/handlers.d.ts.map +1 -0
- package/dist/prompts/handlers.js +353 -0
- package/dist/prompts/handlers.js.map +1 -0
- package/dist/prompts/index.d.ts +11 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +15 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/templates/companies.d.ts +10 -0
- package/dist/prompts/templates/companies.d.ts.map +1 -0
- package/dist/prompts/templates/companies.js +128 -0
- package/dist/prompts/templates/companies.js.map +1 -0
- package/dist/prompts/templates/index.d.ts +42 -0
- package/dist/prompts/templates/index.d.ts.map +1 -0
- package/dist/prompts/templates/index.js +58 -0
- package/dist/prompts/templates/index.js.map +1 -0
- package/dist/prompts/templates/lists.d.ts +10 -0
- package/dist/prompts/templates/lists.d.ts.map +1 -0
- package/dist/prompts/templates/lists.js +127 -0
- package/dist/prompts/templates/lists.js.map +1 -0
- package/dist/prompts/templates/notes.d.ts +10 -0
- package/dist/prompts/templates/notes.d.ts.map +1 -0
- package/dist/prompts/templates/notes.js +119 -0
- package/dist/prompts/templates/notes.js.map +1 -0
- package/dist/prompts/templates/people.d.ts +10 -0
- package/dist/prompts/templates/people.d.ts.map +1 -0
- package/dist/prompts/templates/people.js +127 -0
- package/dist/prompts/templates/people.js.map +1 -0
- package/dist/prompts/types.d.ts +52 -0
- package/dist/prompts/types.d.ts.map +1 -0
- package/dist/prompts/types.js +5 -0
- package/dist/prompts/types.js.map +1 -0
- package/dist/types/attio.d.ts +424 -0
- package/dist/types/attio.d.ts.map +1 -0
- package/dist/types/attio.js +116 -0
- package/dist/types/attio.js.map +1 -0
- package/dist/types/company-types.d.ts +52 -0
- package/dist/types/company-types.d.ts.map +1 -0
- package/dist/types/company-types.js +5 -0
- package/dist/types/company-types.js.map +1 -0
- package/dist/types/tool-types.d.ts +262 -0
- package/dist/types/tool-types.d.ts.map +1 -0
- package/dist/types/tool-types.js +6 -0
- package/dist/types/tool-types.js.map +1 -0
- package/dist/utils/api-fallback.d.ts +39 -0
- package/dist/utils/api-fallback.d.ts.map +1 -0
- package/dist/utils/api-fallback.js +94 -0
- package/dist/utils/api-fallback.js.map +1 -0
- package/dist/utils/attribute-mapping/attribute-mappers.d.ts +39 -0
- package/dist/utils/attribute-mapping/attribute-mappers.d.ts.map +1 -0
- package/dist/utils/attribute-mapping/attribute-mappers.js +394 -0
- package/dist/utils/attribute-mapping/attribute-mappers.js.map +1 -0
- package/dist/utils/attribute-mapping/filter-translator.d.ts +9 -0
- package/dist/utils/attribute-mapping/filter-translator.d.ts.map +1 -0
- package/dist/utils/attribute-mapping/filter-translator.js +104 -0
- package/dist/utils/attribute-mapping/filter-translator.js.map +1 -0
- package/dist/utils/attribute-mapping/index.d.ts +10 -0
- package/dist/utils/attribute-mapping/index.d.ts.map +1 -0
- package/dist/utils/attribute-mapping/index.js +12 -0
- package/dist/utils/attribute-mapping/index.js.map +1 -0
- package/dist/utils/attribute-mapping/legacy-maps.d.ts +11 -0
- package/dist/utils/attribute-mapping/legacy-maps.d.ts.map +1 -0
- package/dist/utils/attribute-mapping/legacy-maps.js +54 -0
- package/dist/utils/attribute-mapping/legacy-maps.js.map +1 -0
- package/dist/utils/attribute-mapping/mapping-utils.d.ts +90 -0
- package/dist/utils/attribute-mapping/mapping-utils.d.ts.map +1 -0
- package/dist/utils/attribute-mapping/mapping-utils.js +145 -0
- package/dist/utils/attribute-mapping/mapping-utils.js.map +1 -0
- package/dist/utils/auto-discovery.d.ts +22 -0
- package/dist/utils/auto-discovery.d.ts.map +1 -0
- package/dist/utils/auto-discovery.js +143 -0
- package/dist/utils/auto-discovery.js.map +1 -0
- package/dist/utils/cli-colors.d.ts +36 -0
- package/dist/utils/cli-colors.d.ts.map +1 -0
- package/dist/utils/cli-colors.js +35 -0
- package/dist/utils/cli-colors.js.map +1 -0
- package/dist/utils/config-loader.d.ts +41 -0
- package/dist/utils/config-loader.d.ts.map +1 -0
- package/dist/utils/config-loader.js +167 -0
- package/dist/utils/config-loader.js.map +1 -0
- package/dist/utils/config-migration.d.ts +140 -0
- package/dist/utils/config-migration.d.ts.map +1 -0
- package/dist/utils/config-migration.js +310 -0
- package/dist/utils/config-migration.js.map +1 -0
- package/dist/utils/date-utils.d.ts +63 -0
- package/dist/utils/date-utils.d.ts.map +1 -0
- package/dist/utils/date-utils.js +329 -0
- package/dist/utils/date-utils.js.map +1 -0
- package/dist/utils/debug-b2b-segment.d.ts +2 -0
- package/dist/utils/debug-b2b-segment.d.ts.map +1 -0
- package/dist/utils/debug-b2b-segment.js +67 -0
- package/dist/utils/debug-b2b-segment.js.map +1 -0
- package/dist/utils/domain-utils.d.ts +46 -0
- package/dist/utils/domain-utils.d.ts.map +1 -0
- package/dist/utils/domain-utils.js +143 -0
- package/dist/utils/domain-utils.js.map +1 -0
- package/dist/utils/dynamic-import.d.ts +33 -0
- package/dist/utils/dynamic-import.d.ts.map +1 -0
- package/dist/utils/dynamic-import.js +41 -0
- package/dist/utils/dynamic-import.js.map +1 -0
- package/dist/utils/error-enhancer.d.ts +23 -0
- package/dist/utils/error-enhancer.d.ts.map +1 -0
- package/dist/utils/error-enhancer.js +188 -0
- package/dist/utils/error-enhancer.js.map +1 -0
- package/dist/utils/error-handler.d.ts +89 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +336 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/filters/builders/activity.d.ts +13 -0
- package/dist/utils/filters/builders/activity.d.ts.map +1 -0
- package/dist/utils/filters/builders/activity.js +65 -0
- package/dist/utils/filters/builders/activity.js.map +1 -0
- package/dist/utils/filters/builders/basic.d.ts +13 -0
- package/dist/utils/filters/builders/basic.d.ts.map +1 -0
- package/dist/utils/filters/builders/basic.js +36 -0
- package/dist/utils/filters/builders/basic.js.map +1 -0
- package/dist/utils/filters/builders/complex.d.ts +31 -0
- package/dist/utils/filters/builders/complex.d.ts.map +1 -0
- package/dist/utils/filters/builders/complex.js +92 -0
- package/dist/utils/filters/builders/complex.js.map +1 -0
- package/dist/utils/filters/builders/date.d.ts +17 -0
- package/dist/utils/filters/builders/date.d.ts.map +1 -0
- package/dist/utils/filters/builders/date.js +51 -0
- package/dist/utils/filters/builders/date.js.map +1 -0
- package/dist/utils/filters/builders/index.d.ts +8 -0
- package/dist/utils/filters/builders/index.d.ts.map +1 -0
- package/dist/utils/filters/builders/index.js +8 -0
- package/dist/utils/filters/builders/index.js.map +1 -0
- package/dist/utils/filters/builders/numeric.d.ts +17 -0
- package/dist/utils/filters/builders/numeric.d.ts.map +1 -0
- package/dist/utils/filters/builders/numeric.js +61 -0
- package/dist/utils/filters/builders/numeric.js.map +1 -0
- package/dist/utils/filters/builders/text.d.ts +17 -0
- package/dist/utils/filters/builders/text.d.ts.map +1 -0
- package/dist/utils/filters/builders/text.js +47 -0
- package/dist/utils/filters/builders/text.js.map +1 -0
- package/dist/utils/filters/builders/types.d.ts +2 -0
- package/dist/utils/filters/builders/types.d.ts.map +1 -0
- package/dist/utils/filters/builders/types.js +2 -0
- package/dist/utils/filters/builders/types.js.map +1 -0
- package/dist/utils/filters/builders.d.ts +2 -0
- package/dist/utils/filters/builders.d.ts.map +1 -0
- package/dist/utils/filters/builders.js +2 -0
- package/dist/utils/filters/builders.js.map +1 -0
- package/dist/utils/filters/cache.d.ts +80 -0
- package/dist/utils/filters/cache.d.ts.map +1 -0
- package/dist/utils/filters/cache.js +212 -0
- package/dist/utils/filters/cache.js.map +1 -0
- package/dist/utils/filters/index.d.ts +51 -0
- package/dist/utils/filters/index.d.ts.map +1 -0
- package/dist/utils/filters/index.js +67 -0
- package/dist/utils/filters/index.js.map +1 -0
- package/dist/utils/filters/operators.d.ts +65 -0
- package/dist/utils/filters/operators.d.ts.map +1 -0
- package/dist/utils/filters/operators.js +214 -0
- package/dist/utils/filters/operators.js.map +1 -0
- package/dist/utils/filters/relationship.d.ts +81 -0
- package/dist/utils/filters/relationship.d.ts.map +1 -0
- package/dist/utils/filters/relationship.js +393 -0
- package/dist/utils/filters/relationship.js.map +1 -0
- package/dist/utils/filters/translators.d.ts +120 -0
- package/dist/utils/filters/translators.d.ts.map +1 -0
- package/dist/utils/filters/translators.js +397 -0
- package/dist/utils/filters/translators.js.map +1 -0
- package/dist/utils/filters/types.d.ts +77 -0
- package/dist/utils/filters/types.d.ts.map +1 -0
- package/dist/utils/filters/types.js +85 -0
- package/dist/utils/filters/types.js.map +1 -0
- package/dist/utils/filters/utils.d.ts +86 -0
- package/dist/utils/filters/utils.d.ts.map +1 -0
- package/dist/utils/filters/utils.js +142 -0
- package/dist/utils/filters/utils.js.map +1 -0
- package/dist/utils/filters/validation-utils.d.ts +123 -0
- package/dist/utils/filters/validation-utils.d.ts.map +1 -0
- package/dist/utils/filters/validation-utils.js +282 -0
- package/dist/utils/filters/validation-utils.js.map +1 -0
- package/dist/utils/filters/validators.d.ts +73 -0
- package/dist/utils/filters/validators.d.ts.map +1 -0
- package/dist/utils/filters/validators.js +311 -0
- package/dist/utils/filters/validators.js.map +1 -0
- package/dist/utils/json-serializer.d.ts +68 -0
- package/dist/utils/json-serializer.d.ts.map +1 -0
- package/dist/utils/json-serializer.js +235 -0
- package/dist/utils/json-serializer.js.map +1 -0
- package/dist/utils/logger.d.ts +226 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +323 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/numeric-utils.d.ts +27 -0
- package/dist/utils/numeric-utils.d.ts.map +1 -0
- package/dist/utils/numeric-utils.js +83 -0
- package/dist/utils/numeric-utils.js.map +1 -0
- package/dist/utils/pagination.d.ts +85 -0
- package/dist/utils/pagination.d.ts.map +1 -0
- package/dist/utils/pagination.js +169 -0
- package/dist/utils/pagination.js.map +1 -0
- package/dist/utils/person-lookup.d.ts +35 -0
- package/dist/utils/person-lookup.d.ts.map +1 -0
- package/dist/utils/person-lookup.js +67 -0
- package/dist/utils/person-lookup.js.map +1 -0
- package/dist/utils/rate-limiter.d.ts +82 -0
- package/dist/utils/rate-limiter.d.ts.map +1 -0
- package/dist/utils/rate-limiter.js +159 -0
- package/dist/utils/rate-limiter.js.map +1 -0
- package/dist/utils/record-utils.d.ts +74 -0
- package/dist/utils/record-utils.d.ts.map +1 -0
- package/dist/utils/record-utils.js +312 -0
- package/dist/utils/record-utils.js.map +1 -0
- package/dist/utils/relationship-utils.d.ts +61 -0
- package/dist/utils/relationship-utils.d.ts.map +1 -0
- package/dist/utils/relationship-utils.js +242 -0
- package/dist/utils/relationship-utils.js.map +1 -0
- package/dist/utils/response-formatter.d.ts +121 -0
- package/dist/utils/response-formatter.d.ts.map +1 -0
- package/dist/utils/response-formatter.js +188 -0
- package/dist/utils/response-formatter.js.map +1 -0
- package/dist/utils/uri-parser.d.ts +18 -0
- package/dist/utils/uri-parser.d.ts.map +1 -0
- package/dist/utils/uri-parser.js +31 -0
- package/dist/utils/uri-parser.js.map +1 -0
- package/dist/utils/validation.d.ts +59 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +264 -0
- package/dist/utils/validation.js.map +1 -0
- package/dist/utils/value-matcher.d.ts +58 -0
- package/dist/utils/value-matcher.d.ts.map +1 -0
- package/dist/utils/value-matcher.js +131 -0
- package/dist/utils/value-matcher.js.map +1 -0
- package/dist/validators/attribute-validator.d.ts +59 -0
- package/dist/validators/attribute-validator.d.ts.map +1 -0
- package/dist/validators/attribute-validator.js +531 -0
- package/dist/validators/attribute-validator.js.map +1 -0
- package/dist/validators/company/field_detector.d.ts +5 -0
- package/dist/validators/company/field_detector.d.ts.map +1 -0
- package/dist/validators/company/field_detector.js +95 -0
- package/dist/validators/company/field_detector.js.map +1 -0
- package/dist/validators/company/index.d.ts +26 -0
- package/dist/validators/company/index.d.ts.map +1 -0
- package/dist/validators/company/index.js +433 -0
- package/dist/validators/company/index.js.map +1 -0
- package/dist/validators/company/type_cache.d.ts +14 -0
- package/dist/validators/company/type_cache.d.ts.map +1 -0
- package/dist/validators/company/type_cache.js +28 -0
- package/dist/validators/company/type_cache.js.map +1 -0
- package/dist/validators/company/types.d.ts +8 -0
- package/dist/validators/company/types.d.ts.map +1 -0
- package/dist/validators/company/types.js +2 -0
- package/dist/validators/company/types.js.map +1 -0
- package/dist/validators/company-validator.d.ts +2 -0
- package/dist/validators/company-validator.d.ts.map +1 -0
- package/dist/validators/company-validator.js +2 -0
- package/dist/validators/company-validator.js.map +1 -0
- package/package.json +167 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search operation handlers for tool execution
|
|
3
|
+
*
|
|
4
|
+
* Handles basic search operations including search, searchByEmail, searchByPhone, and smartSearch
|
|
5
|
+
*/
|
|
6
|
+
import { createErrorResult } from '../../../../utils/error-handler.js';
|
|
7
|
+
import { formatResponse } from '../../formatters.js';
|
|
8
|
+
import { hasResponseData } from '../../error-types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Check if the formatted results already contain a header to avoid duplication
|
|
11
|
+
*/
|
|
12
|
+
function hasResultHeader(formattedResults) {
|
|
13
|
+
return (typeof formattedResults === 'string' &&
|
|
14
|
+
formattedResults.startsWith('Found '));
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Format search results with appropriate header
|
|
18
|
+
*/
|
|
19
|
+
function formatSearchResults(formattedResults, results, resourceType, searchContext) {
|
|
20
|
+
if (hasResultHeader(formattedResults)) {
|
|
21
|
+
return formattedResults;
|
|
22
|
+
}
|
|
23
|
+
const header = searchContext
|
|
24
|
+
? `Found ${results.length} ${resourceType} ${searchContext}:`
|
|
25
|
+
: `Found ${results.length} ${resourceType}:`;
|
|
26
|
+
return `${header}\n${formattedResults}`;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Handle common search operations
|
|
30
|
+
*
|
|
31
|
+
* @param toolType - The type of search tool
|
|
32
|
+
* @param searchConfig - The search tool configuration
|
|
33
|
+
* @param searchParam - The search parameter
|
|
34
|
+
* @param resourceType - The resource type being searched
|
|
35
|
+
* @returns Formatted response
|
|
36
|
+
*/
|
|
37
|
+
export async function handleSearchOperation(toolType, searchConfig, searchParam, resourceType) {
|
|
38
|
+
try {
|
|
39
|
+
const results = await searchConfig.handler(searchParam);
|
|
40
|
+
const formattedResults = searchConfig.formatResult(results);
|
|
41
|
+
const searchType = toolType.replace('searchBy', '').toLowerCase();
|
|
42
|
+
const searchContext = `matching ${searchType} "${searchParam}"`;
|
|
43
|
+
const responseText = formatSearchResults(formattedResults, results, resourceType, searchContext);
|
|
44
|
+
return formatResponse(responseText);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
return createErrorResult(error instanceof Error ? error : new Error('Unknown error'), `/objects/${resourceType}/records/query`, 'POST', hasResponseData(error) ? error.response.data : {});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Handle basic search operations
|
|
52
|
+
*/
|
|
53
|
+
export async function handleBasicSearch(request, toolConfig, resourceType) {
|
|
54
|
+
const queryFromArgs = request.params.arguments?.query;
|
|
55
|
+
const domainFromArgs = request.params.arguments?.domain;
|
|
56
|
+
let effectiveQuery = queryFromArgs;
|
|
57
|
+
// If 'query' is not provided, but 'domain' is, and the specific tool being handled is 'search-companies',
|
|
58
|
+
// use the 'domain' value as the query. This makes 'search-companies' more robust to this specific invocation pattern.
|
|
59
|
+
if (effectiveQuery === undefined &&
|
|
60
|
+
domainFromArgs !== undefined &&
|
|
61
|
+
toolConfig.name === 'search-companies') {
|
|
62
|
+
effectiveQuery = domainFromArgs;
|
|
63
|
+
console.warn(`[handleBasicSearch] Tool 'search-companies' was called with a 'domain' parameter instead of 'query'. ` +
|
|
64
|
+
`Using the 'domain' value ("${effectiveQuery}") as the search query. ` +
|
|
65
|
+
`For clarity and future compatibility, please use the 'query' parameter for the 'search-companies' tool, ` +
|
|
66
|
+
`or use the 'search-companies-by-domain' tool for explicit domain searches.`);
|
|
67
|
+
}
|
|
68
|
+
const query = effectiveQuery; // Use 'query' as the variable name for the rest of the function for minimal changes
|
|
69
|
+
try {
|
|
70
|
+
const results = await toolConfig.handler(query);
|
|
71
|
+
const formattedResults = toolConfig.formatResult(results);
|
|
72
|
+
const responseText = formatSearchResults(formattedResults, results, resourceType);
|
|
73
|
+
return formatResponse(responseText);
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
return createErrorResult(error instanceof Error ? error : new Error('Unknown error'), `/objects/${resourceType}/records/query`, 'POST', hasResponseData(error) ? error.response.data : {});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Handle searchByEmail operations
|
|
81
|
+
*/
|
|
82
|
+
export async function handleSearchByEmail(request, toolConfig, resourceType) {
|
|
83
|
+
const email = request.params.arguments?.email;
|
|
84
|
+
return handleSearchOperation('searchByEmail', toolConfig, email, resourceType);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Handle searchByPhone operations
|
|
88
|
+
*/
|
|
89
|
+
export async function handleSearchByPhone(request, toolConfig, resourceType) {
|
|
90
|
+
const phone = request.params.arguments?.phone;
|
|
91
|
+
return handleSearchOperation('searchByPhone', toolConfig, phone, resourceType);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Handle searchByDomain operations
|
|
95
|
+
*/
|
|
96
|
+
export async function handleSearchByDomain(request, toolConfig, resourceType) {
|
|
97
|
+
const domain = request.params.arguments?.domain;
|
|
98
|
+
return handleSearchOperation('searchByDomain', toolConfig, domain, resourceType);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Handle searchByCompany operations
|
|
102
|
+
*/
|
|
103
|
+
export async function handleSearchByCompany(request, toolConfig, resourceType) {
|
|
104
|
+
const companyFilter = request.params.arguments?.companyFilter;
|
|
105
|
+
// Extract company identifier from filter
|
|
106
|
+
let companyIdentifier;
|
|
107
|
+
if (typeof companyFilter === 'string') {
|
|
108
|
+
companyIdentifier = companyFilter;
|
|
109
|
+
}
|
|
110
|
+
else if (typeof companyFilter === 'object' && companyFilter !== null) {
|
|
111
|
+
// Handle object format with filters array
|
|
112
|
+
if ('filters' in companyFilter &&
|
|
113
|
+
Array.isArray(companyFilter.filters) &&
|
|
114
|
+
companyFilter.filters.length > 0) {
|
|
115
|
+
const firstFilter = companyFilter.filters[0];
|
|
116
|
+
if (typeof firstFilter === 'object' &&
|
|
117
|
+
firstFilter !== null &&
|
|
118
|
+
'value' in firstFilter) {
|
|
119
|
+
const value = firstFilter.value;
|
|
120
|
+
// Extract record_id if it's an object with record_id, otherwise use the value directly
|
|
121
|
+
if (typeof value === 'object' &&
|
|
122
|
+
value !== null &&
|
|
123
|
+
'record_id' in value) {
|
|
124
|
+
companyIdentifier = value.record_id;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
companyIdentifier = String(value);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
throw new Error('Invalid filter structure in companyFilter');
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
else if ('value' in companyFilter) {
|
|
135
|
+
// Handle direct value format
|
|
136
|
+
const value = companyFilter.value;
|
|
137
|
+
if (typeof value === 'object' && value !== null && 'record_id' in value) {
|
|
138
|
+
companyIdentifier = value.record_id;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
companyIdentifier = String(value);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
throw new Error('Invalid companyFilter format: missing filters array or value');
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
else if (Array.isArray(companyFilter) && companyFilter.length > 0) {
|
|
149
|
+
// Handle array format - use the first valid filter
|
|
150
|
+
const firstFilter = companyFilter[0];
|
|
151
|
+
if (typeof firstFilter === 'object' &&
|
|
152
|
+
firstFilter !== null &&
|
|
153
|
+
'value' in firstFilter) {
|
|
154
|
+
const value = firstFilter.value;
|
|
155
|
+
if (typeof value === 'object' && value !== null && 'record_id' in value) {
|
|
156
|
+
companyIdentifier = value.record_id;
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
companyIdentifier = String(value);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
companyIdentifier = String(firstFilter);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
throw new Error('Invalid companyFilter format');
|
|
168
|
+
}
|
|
169
|
+
return handleSearchOperation('searchByCompany', toolConfig, companyIdentifier, resourceType);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Handle smartSearch operations
|
|
173
|
+
*/
|
|
174
|
+
export async function handleSmartSearch(request, toolConfig, resourceType) {
|
|
175
|
+
const query = request.params.arguments?.query;
|
|
176
|
+
// Validate query parameter
|
|
177
|
+
if (!query || typeof query !== 'string' || query.trim().length === 0) {
|
|
178
|
+
return createErrorResult(new Error('Query parameter is required for smart search and must be a non-empty string'), `/objects/${resourceType}/smart-search`, 'POST', { status: 400, message: 'Missing or invalid required parameter: query' });
|
|
179
|
+
}
|
|
180
|
+
try {
|
|
181
|
+
const results = await toolConfig.handler(query);
|
|
182
|
+
const formattedResults = toolConfig.formatResult(results);
|
|
183
|
+
const responseText = formatSearchResults(formattedResults, results, resourceType, '(smart search)');
|
|
184
|
+
return formatResponse(responseText);
|
|
185
|
+
}
|
|
186
|
+
catch (error) {
|
|
187
|
+
return createErrorResult(error instanceof Error ? error : new Error('Unknown error'), `/objects/${resourceType}/records/query`, 'POST', hasResponseData(error) ? error.response.data : {});
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../../src/handlers/tools/dispatcher/operations/search.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAGvE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;GAEG;AACH,SAAS,eAAe,CAAC,gBAAyB;IAChD,OAAO,CACL,OAAO,gBAAgB,KAAK,QAAQ;QACpC,gBAAgB,CAAC,UAAU,CAAC,QAAQ,CAAC,CACtC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,mBAAmB,CAC1B,gBAAwB,EACxB,OAAkB,EAClB,YAA0B,EAC1B,aAAsB;IAEtB,IAAI,eAAe,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACtC,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,MAAM,MAAM,GAAG,aAAa;QAC1B,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,IAAI,YAAY,IAAI,aAAa,GAAG;QAC7D,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,IAAI,YAAY,GAAG,CAAC;IAE/C,OAAO,GAAG,MAAM,KAAK,gBAAgB,EAAE,CAAC;AAC1C,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,QAAgB,EAChB,YAA8B,EAC9B,WAAmB,EAC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Q,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAClD,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation utilities for tool execution
|
|
3
|
+
*
|
|
4
|
+
* Provides parameter validation and resource ID validation for tool requests
|
|
5
|
+
*/
|
|
6
|
+
import { createErrorResult } from '../../../utils/error-handler.js';
|
|
7
|
+
import { ResourceType } from '../../../types/attio.js';
|
|
8
|
+
import { AttributeValidationParams, ValidationResult } from '../../../types/tool-types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Validates attribute parameters for company operations
|
|
11
|
+
*
|
|
12
|
+
* @param attributes - The attributes object to validate (key-value pairs of company attributes)
|
|
13
|
+
* @returns True if validation passes, or an error message string if validation fails
|
|
14
|
+
*/
|
|
15
|
+
export declare function validateAttributes(attributes: AttributeValidationParams | null | undefined): ValidationResult;
|
|
16
|
+
/**
|
|
17
|
+
* Helper function to validate and extract resource ID based on resource type
|
|
18
|
+
*
|
|
19
|
+
* @param resourceType - The type of resource (companies, people, etc.)
|
|
20
|
+
* @param args - The request arguments containing the ID
|
|
21
|
+
* @param apiPath - The API path for error reporting
|
|
22
|
+
* @returns The validated ID or an error response
|
|
23
|
+
*/
|
|
24
|
+
export declare function validateResourceId(resourceType: ResourceType, args: any, apiPath: string): string | {
|
|
25
|
+
error: ReturnType<typeof createErrorResult>;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/handlers/tools/dispatcher/validation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAEtC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,yBAAyB,GAAG,IAAI,GAAG,SAAS,GACvD,gBAAgB,CAclB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,GAAG,EACT,OAAO,EAAE,MAAM,GACd,MAAM,GAAG;IAAE,KAAK,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAA;CAAE,CAoB1D"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation utilities for tool execution
|
|
3
|
+
*
|
|
4
|
+
* Provides parameter validation and resource ID validation for tool requests
|
|
5
|
+
*/
|
|
6
|
+
import { createErrorResult } from '../../../utils/error-handler.js';
|
|
7
|
+
import { ResourceType } from '../../../types/attio.js';
|
|
8
|
+
/**
|
|
9
|
+
* Validates attribute parameters for company operations
|
|
10
|
+
*
|
|
11
|
+
* @param attributes - The attributes object to validate (key-value pairs of company attributes)
|
|
12
|
+
* @returns True if validation passes, or an error message string if validation fails
|
|
13
|
+
*/
|
|
14
|
+
export function validateAttributes(attributes) {
|
|
15
|
+
if (!attributes) {
|
|
16
|
+
return 'Attributes parameter is required';
|
|
17
|
+
}
|
|
18
|
+
if (typeof attributes !== 'object' || Array.isArray(attributes)) {
|
|
19
|
+
return 'Attributes parameter must be an object';
|
|
20
|
+
}
|
|
21
|
+
if (Object.keys(attributes).length === 0) {
|
|
22
|
+
return 'Attributes parameter cannot be empty';
|
|
23
|
+
}
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Helper function to validate and extract resource ID based on resource type
|
|
28
|
+
*
|
|
29
|
+
* @param resourceType - The type of resource (companies, people, etc.)
|
|
30
|
+
* @param args - The request arguments containing the ID
|
|
31
|
+
* @param apiPath - The API path for error reporting
|
|
32
|
+
* @returns The validated ID or an error response
|
|
33
|
+
*/
|
|
34
|
+
export function validateResourceId(resourceType, args, apiPath) {
|
|
35
|
+
const idParamName = resourceType === ResourceType.COMPANIES ? 'companyId' : 'personId';
|
|
36
|
+
const id = args?.[idParamName];
|
|
37
|
+
if (!id) {
|
|
38
|
+
return {
|
|
39
|
+
error: createErrorResult(new Error(`${idParamName} parameter is required`), apiPath, 'GET', {
|
|
40
|
+
status: 400,
|
|
41
|
+
message: `Missing required parameter: ${idParamName}`,
|
|
42
|
+
}),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return id;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../src/handlers/tools/dispatcher/validation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAMvD;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,UAAwD;IAExD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,kCAAkC,CAAC;IAC5C,CAAC;IAED,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QAChE,OAAO,wCAAwC,CAAC;IAClD,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,sCAAsC,CAAC;IAChD,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAChC,YAA0B,EAC1B,IAAS,EACT,OAAe;IAEf,MAAM,WAAW,GACf,YAAY,KAAK,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC;IACrE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,WAAW,CAAW,CAAC;IAEzC,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,OAAO;YACL,KAAK,EAAE,iBAAiB,CACtB,IAAI,KAAK,CAAC,GAAG,WAAW,wBAAwB,CAAC,EACjD,OAAO,EACP,KAAK,EACL;gBACE,MAAM,EAAE,GAAG;gBACX,OAAO,EAAE,+BAA+B,WAAW,EAAE;aACtD,CACF;SACF,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool dispatcher module - handles tool execution dispatch and routing
|
|
3
|
+
*
|
|
4
|
+
* This module re-exports from the modular dispatcher implementation for backward compatibility.
|
|
5
|
+
* The actual implementation has been broken down into focused modules under ./dispatcher/
|
|
6
|
+
*/
|
|
7
|
+
export { executeToolRequest } from './dispatcher/core.js';
|
|
8
|
+
export { logToolRequest, logToolError } from './dispatcher/logging.js';
|
|
9
|
+
export { validateAttributes, validateResourceId, } from './dispatcher/validation.js';
|
|
10
|
+
export { formatSuccessResponse } from './dispatcher/formatting.js';
|
|
11
|
+
//# sourceMappingURL=dispatcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatcher.d.ts","sourceRoot":"","sources":["../../../src/handlers/tools/dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool dispatcher module - handles tool execution dispatch and routing
|
|
3
|
+
*
|
|
4
|
+
* This module re-exports from the modular dispatcher implementation for backward compatibility.
|
|
5
|
+
* The actual implementation has been broken down into focused modules under ./dispatcher/
|
|
6
|
+
*/
|
|
7
|
+
// Re-export the main executeToolRequest function from the modular implementation
|
|
8
|
+
export { executeToolRequest } from './dispatcher/core.js';
|
|
9
|
+
// Re-export utility functions from the modular implementation for backward compatibility
|
|
10
|
+
export { logToolRequest, logToolError } from './dispatcher/logging.js';
|
|
11
|
+
export { validateAttributes, validateResourceId, } from './dispatcher/validation.js';
|
|
12
|
+
export { formatSuccessResponse } from './dispatcher/formatting.js';
|
|
13
|
+
// Note: Legacy implementation placeholders below will be moved to dedicated operation modules in Phase 2
|
|
14
|
+
// These are temporarily retained for any unimplemented operations until full modularization is complete
|
|
15
|
+
//# sourceMappingURL=dispatcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../../src/handlers/tools/dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,iFAAiF;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,yFAAyF;AACzF,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,yGAAyG;AACzG,wGAAwG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error types for tool operations
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Interface for API errors with response data
|
|
6
|
+
*/
|
|
7
|
+
export interface ApiError extends Error {
|
|
8
|
+
response?: {
|
|
9
|
+
data: any;
|
|
10
|
+
status: number;
|
|
11
|
+
};
|
|
12
|
+
details?: any;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Interface for ValueMatchError with original error
|
|
16
|
+
*/
|
|
17
|
+
export interface ValueMatchApiError extends Error {
|
|
18
|
+
originalError?: ApiError;
|
|
19
|
+
details?: any;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Type guard to check if error is an ApiError
|
|
23
|
+
*/
|
|
24
|
+
export declare function isApiError(error: unknown): error is ApiError;
|
|
25
|
+
/**
|
|
26
|
+
* Type guard to check if error has response data
|
|
27
|
+
*/
|
|
28
|
+
export declare function hasResponseData(error: unknown): error is {
|
|
29
|
+
response: {
|
|
30
|
+
data: any;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=error-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-types.d.ts","sourceRoot":"","sources":["../../../src/handlers/tools/error-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,QAAS,SAAQ,KAAK;IACrC,QAAQ,CAAC,EAAE;QACT,IAAI,EAAE,GAAG,CAAC;QACV,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,KAAK;IAC/C,aAAa,CAAC,EAAE,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAE5D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,GACb,KAAK,IAAI;IAAE,QAAQ,EAAE;QAAE,IAAI,EAAE,GAAG,CAAA;KAAE,CAAA;CAAE,CAStC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error types for tool operations
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Type guard to check if error is an ApiError
|
|
6
|
+
*/
|
|
7
|
+
export function isApiError(error) {
|
|
8
|
+
return error instanceof Error && 'response' in error;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Type guard to check if error has response data
|
|
12
|
+
*/
|
|
13
|
+
export function hasResponseData(error) {
|
|
14
|
+
return (error !== null &&
|
|
15
|
+
typeof error === 'object' &&
|
|
16
|
+
'response' in error &&
|
|
17
|
+
error.response !== null &&
|
|
18
|
+
typeof error.response === 'object' &&
|
|
19
|
+
'data' in error.response);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=error-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-types.js","sourceRoot":"","sources":["../../../src/handlers/tools/error-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAqBH;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,KAAK,YAAY,KAAK,IAAI,UAAU,IAAI,KAAK,CAAC;AACvD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,KAAc;IAEd,OAAO,CACL,KAAK,KAAK,IAAI;QACd,OAAO,KAAK,KAAK,QAAQ;QACzB,UAAU,IAAI,KAAK;QACnB,KAAK,CAAC,QAAQ,KAAK,IAAI;QACvB,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ;QAClC,MAAM,IAAI,KAAK,CAAC,QAAQ,CACzB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result formatting module - handles transformation and formatting of tool results
|
|
3
|
+
*/
|
|
4
|
+
import { AttioRecord, AttioListEntry } from '../../types/attio.js';
|
|
5
|
+
/**
|
|
6
|
+
* Format search results for display
|
|
7
|
+
*
|
|
8
|
+
* @param results - Array of search results
|
|
9
|
+
* @param resourceType - The type of resource being searched
|
|
10
|
+
* @returns Formatted string output
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatSearchResults(results: AttioRecord[], resourceType: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Format record details for display
|
|
15
|
+
*
|
|
16
|
+
* @param record - The record to format
|
|
17
|
+
* @returns Formatted string output
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatRecordDetails(record: AttioRecord): string;
|
|
20
|
+
/**
|
|
21
|
+
* Format list entries for display
|
|
22
|
+
*
|
|
23
|
+
* @param entries - Array of list entries
|
|
24
|
+
* @returns Formatted string output
|
|
25
|
+
*/
|
|
26
|
+
export declare function formatListEntries(entries: AttioListEntry[]): string;
|
|
27
|
+
/**
|
|
28
|
+
* Format batch operation results for display
|
|
29
|
+
*
|
|
30
|
+
* @param result - Batch operation result
|
|
31
|
+
* @param operation - The type of batch operation
|
|
32
|
+
* @returns Formatted string output
|
|
33
|
+
*/
|
|
34
|
+
export declare function formatBatchResults(result: any, operation: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* Format standard response content
|
|
37
|
+
*
|
|
38
|
+
* @param content - The content to format
|
|
39
|
+
* @param isError - Whether this is an error response
|
|
40
|
+
* @returns Formatted response object
|
|
41
|
+
*/
|
|
42
|
+
export declare function formatResponse(content: string | any, isError?: boolean): any;
|
|
43
|
+
//# sourceMappingURL=formatters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../src/handlers/tools/formatters.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAc,MAAM,sBAAsB,CAAC;AAwD/E;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,WAAW,EAAE,EACtB,YAAY,EAAE,MAAM,GACnB,MAAM,CAYR;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAc/D;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,MAAM,CAiBnE;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAezE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,GAAG,GAAG,EACrB,OAAO,GAAE,OAAe,OAoDzB"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { processListEntries } from '../../utils/record-utils.js';
|
|
2
|
+
import { safeJsonStringify, sanitizeMcpResponse, } from '../../utils/json-serializer.js';
|
|
3
|
+
/**
|
|
4
|
+
* Safely extract value from record attributes
|
|
5
|
+
*
|
|
6
|
+
* This function handles various record formats and extracts values from them,
|
|
7
|
+
* including standard AttioRecord objects and similar record-like structures
|
|
8
|
+
* that may come from different API responses or transformations.
|
|
9
|
+
*
|
|
10
|
+
* @param record - The record to extract the value from, which might be an AttioRecord or a similar structure
|
|
11
|
+
* @param fieldName - The name of the field to extract
|
|
12
|
+
* @returns The extracted value as a string, or 'Unknown' if not found
|
|
13
|
+
*/
|
|
14
|
+
function getAttributeValue(record, fieldName) {
|
|
15
|
+
if (!record?.values)
|
|
16
|
+
return 'Unknown';
|
|
17
|
+
const fieldValue = record.values[fieldName];
|
|
18
|
+
if (!fieldValue)
|
|
19
|
+
return 'Unknown';
|
|
20
|
+
// Handle different value formats
|
|
21
|
+
if (Array.isArray(fieldValue) && fieldValue.length > 0) {
|
|
22
|
+
const firstValue = fieldValue[0];
|
|
23
|
+
if (typeof firstValue === 'object' &&
|
|
24
|
+
firstValue !== null &&
|
|
25
|
+
'value' in firstValue) {
|
|
26
|
+
return firstValue.value || 'Unknown';
|
|
27
|
+
}
|
|
28
|
+
return String(firstValue) || 'Unknown';
|
|
29
|
+
}
|
|
30
|
+
else if (typeof fieldValue === 'object' &&
|
|
31
|
+
fieldValue !== null &&
|
|
32
|
+
'value' in fieldValue) {
|
|
33
|
+
return fieldValue.value || 'Unknown';
|
|
34
|
+
}
|
|
35
|
+
// Fallback for any other format
|
|
36
|
+
return String(fieldValue) || 'Unknown';
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Format search results for display
|
|
40
|
+
*
|
|
41
|
+
* @param results - Array of search results
|
|
42
|
+
* @param resourceType - The type of resource being searched
|
|
43
|
+
* @returns Formatted string output
|
|
44
|
+
*/
|
|
45
|
+
export function formatSearchResults(results, resourceType) {
|
|
46
|
+
if (!results || results.length === 0) {
|
|
47
|
+
return `No ${resourceType} found.`;
|
|
48
|
+
}
|
|
49
|
+
return results
|
|
50
|
+
.map((record, index) => {
|
|
51
|
+
const name = getAttributeValue(record, 'name');
|
|
52
|
+
const id = record.id?.record_id || 'Unknown ID';
|
|
53
|
+
return `${index + 1}. ${name} (ID: ${id})`;
|
|
54
|
+
})
|
|
55
|
+
.join('\n');
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Format record details for display
|
|
59
|
+
*
|
|
60
|
+
* @param record - The record to format
|
|
61
|
+
* @returns Formatted string output
|
|
62
|
+
*/
|
|
63
|
+
export function formatRecordDetails(record) {
|
|
64
|
+
if (!record) {
|
|
65
|
+
return 'No record found.';
|
|
66
|
+
}
|
|
67
|
+
const attributes = record.attributes || {};
|
|
68
|
+
const formattedAttrs = Object.entries(attributes)
|
|
69
|
+
.map(([key, attr]) => {
|
|
70
|
+
const value = attr.value || 'N/A';
|
|
71
|
+
return `${key}: ${value}`;
|
|
72
|
+
})
|
|
73
|
+
.join('\n');
|
|
74
|
+
return `Record Details:\n${formattedAttrs}`;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Format list entries for display
|
|
78
|
+
*
|
|
79
|
+
* @param entries - Array of list entries
|
|
80
|
+
* @returns Formatted string output
|
|
81
|
+
*/
|
|
82
|
+
export function formatListEntries(entries) {
|
|
83
|
+
if (!entries || entries.length === 0) {
|
|
84
|
+
return 'No entries found.';
|
|
85
|
+
}
|
|
86
|
+
const processedEntries = processListEntries(entries);
|
|
87
|
+
return processedEntries
|
|
88
|
+
.map((entry, index) => {
|
|
89
|
+
const record = entry.record;
|
|
90
|
+
const name = getAttributeValue(record, 'name');
|
|
91
|
+
const entryId = entry.id?.entry_id || 'Unknown Entry ID';
|
|
92
|
+
const recordId = record?.id?.record_id || 'Unknown ID';
|
|
93
|
+
return `${index + 1}. ${name} (Entry: ${entryId}, Record: ${recordId})`;
|
|
94
|
+
})
|
|
95
|
+
.join('\n');
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Format batch operation results for display
|
|
99
|
+
*
|
|
100
|
+
* @param result - Batch operation result
|
|
101
|
+
* @param operation - The type of batch operation
|
|
102
|
+
* @returns Formatted string output
|
|
103
|
+
*/
|
|
104
|
+
export function formatBatchResults(result, operation) {
|
|
105
|
+
const summary = result.summary;
|
|
106
|
+
const details = result.results
|
|
107
|
+
.map((r) => r.success
|
|
108
|
+
? `✅ Record ${r.id}: ${operation} successfully`
|
|
109
|
+
: `❌ Record ${r.id}: Failed - ${r.error?.message || 'Unknown error'}`)
|
|
110
|
+
.join('\n');
|
|
111
|
+
return (`Batch ${operation} operation completed:\n` +
|
|
112
|
+
`Total: ${summary.total}, Succeeded: ${summary.succeeded}, Failed: ${summary.failed}\n` +
|
|
113
|
+
details);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Format standard response content
|
|
117
|
+
*
|
|
118
|
+
* @param content - The content to format
|
|
119
|
+
* @param isError - Whether this is an error response
|
|
120
|
+
* @returns Formatted response object
|
|
121
|
+
*/
|
|
122
|
+
export function formatResponse(content, isError = false) {
|
|
123
|
+
// Handle non-string content by converting it to a string
|
|
124
|
+
let formattedContent;
|
|
125
|
+
if (typeof content === 'string') {
|
|
126
|
+
formattedContent = content;
|
|
127
|
+
}
|
|
128
|
+
else if (content === undefined || content === null) {
|
|
129
|
+
// Prevent "undefined" or "null" from being returned as response content
|
|
130
|
+
formattedContent = isError
|
|
131
|
+
? 'An unknown error occurred'
|
|
132
|
+
: 'Operation completed successfully, but no content was returned';
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
try {
|
|
136
|
+
// Try to convert the content to a string representation using safe serialization
|
|
137
|
+
formattedContent =
|
|
138
|
+
typeof content === 'object'
|
|
139
|
+
? safeJsonStringify(content, {
|
|
140
|
+
maxDepth: 6,
|
|
141
|
+
includeStackTraces: false,
|
|
142
|
+
})
|
|
143
|
+
: String(content);
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
if (process.env.DEBUG || process.env.NODE_ENV === 'development') {
|
|
147
|
+
console.error('[formatResponse] Error converting content to string:', error);
|
|
148
|
+
}
|
|
149
|
+
formattedContent = 'Error: Content could not be serialized';
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
// Ensure we never return empty content
|
|
153
|
+
if (!formattedContent) {
|
|
154
|
+
formattedContent = isError
|
|
155
|
+
? 'An unknown error occurred'
|
|
156
|
+
: 'Operation completed successfully';
|
|
157
|
+
}
|
|
158
|
+
const response = {
|
|
159
|
+
content: [
|
|
160
|
+
{
|
|
161
|
+
type: 'text',
|
|
162
|
+
text: formattedContent,
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
isError,
|
|
166
|
+
};
|
|
167
|
+
// Sanitize the final response to ensure it's MCP-compatible
|
|
168
|
+
return sanitizeMcpResponse(response);
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=formatters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../src/handlers/tools/formatters.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,gCAAgC,CAAC;AAExC;;;;;;;;;;GAUG;AACH,SAAS,iBAAiB,CACxB,MAKa,EACb,SAAiB;IAEjB,IAAI,CAAC,MAAM,EAAE,MAAM;QAAE,OAAO,SAAS,CAAC;IAEtC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,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C,OAAO,CAAC,CAAC;QACxB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;gBAChE,OAAO,CAAC,KAAK,CACX,sDAAsD,EACtD,KAAK,CACN,CAAC;YACJ,CAAC;YACD,gBAAgB,GAAG,wCAAwC,CAAC;QAC9D,CAAC;IACH,CAAC;IAED,uCAAuC;IACvC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,gBAAgB,GAAG,OAAO;YACxB,CAAC,CAAC,2BAA2B;YAC7B,CAAC,CAAC,kCAAkC,CAAC;IACzC,CAAC;IAED,MAAM,QAAQ,GAAG;QACf,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,gBAAgB;aACvB;SACF;QACD,OAAO;KACR,CAAC;IAEF,4DAA4D;IAC5D,OAAO,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Main entry point for tool handlers - maintains backward compatibility
|
|
3
|
+
*/
|
|
4
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Registers tool-related request handlers with the server
|
|
7
|
+
*
|
|
8
|
+
* @param server - The MCP server instance
|
|
9
|
+
*/
|
|
10
|
+
export declare function registerToolHandlers(server: Server): void;
|
|
11
|
+
export { TOOL_DEFINITIONS, TOOL_CONFIGS } from './registry.js';
|
|
12
|
+
export { findToolConfig } from './registry.js';
|
|
13
|
+
export { executeToolRequest } from './dispatcher.js';
|
|
14
|
+
export { formatSearchResults, formatRecordDetails, formatListEntries, formatBatchResults, formatResponse, } from './formatters.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/handlers/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAWnE;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAkBzD;AAGD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,GACf,MAAM,iBAAiB,CAAC"}
|