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,353 @@
|
|
|
1
|
+
import { ListPromptsRequestSchema, GetPromptRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { getAllPrompts, getPromptById, getPromptsByCategory, getAllCategories, } from './templates/index.js';
|
|
3
|
+
import { createErrorResult } from './error-handler.js';
|
|
4
|
+
// Import Handlebars using ES module import
|
|
5
|
+
// This avoids the "require is not defined in ES module scope" error
|
|
6
|
+
import Handlebars from 'handlebars';
|
|
7
|
+
/**
|
|
8
|
+
* Template cache implementation for storing compiled Handlebars templates
|
|
9
|
+
* Provides caching with size limits to prevent memory leaks
|
|
10
|
+
*/
|
|
11
|
+
class TemplateCache {
|
|
12
|
+
cache = new Map();
|
|
13
|
+
options;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new template cache
|
|
16
|
+
*
|
|
17
|
+
* @param options - Cache configuration options
|
|
18
|
+
*/
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this.options = {
|
|
21
|
+
maxSize: 100, // Default max cache size
|
|
22
|
+
...options,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get a compiled template from the cache
|
|
27
|
+
*
|
|
28
|
+
* @param key - Template key
|
|
29
|
+
* @returns The compiled template or undefined if not found
|
|
30
|
+
*/
|
|
31
|
+
get(key) {
|
|
32
|
+
return this.cache.get(key);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Store a compiled template in the cache
|
|
36
|
+
*
|
|
37
|
+
* @param key - Template key
|
|
38
|
+
* @param template - Compiled template to store
|
|
39
|
+
*/
|
|
40
|
+
set(key, template) {
|
|
41
|
+
// Check if we need to evict entries (simple LRU implementation)
|
|
42
|
+
if (this.cache.size >= this.options.maxSize && !this.cache.has(key)) {
|
|
43
|
+
// Delete the first entry (oldest)
|
|
44
|
+
const firstKeyValue = this.cache.keys().next();
|
|
45
|
+
if (!firstKeyValue.done && firstKeyValue.value) {
|
|
46
|
+
this.cache.delete(firstKeyValue.value);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
this.cache.set(key, template);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Check if a template exists in the cache
|
|
53
|
+
*
|
|
54
|
+
* @param key - Template key
|
|
55
|
+
* @returns True if the template exists in the cache
|
|
56
|
+
*/
|
|
57
|
+
has(key) {
|
|
58
|
+
return this.cache.has(key);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Clear all templates from the cache
|
|
62
|
+
*/
|
|
63
|
+
clear() {
|
|
64
|
+
this.cache.clear();
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Get the current size of the cache
|
|
68
|
+
*
|
|
69
|
+
* @returns Number of templates in the cache
|
|
70
|
+
*/
|
|
71
|
+
size() {
|
|
72
|
+
return this.cache.size;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// Create the template cache instance
|
|
76
|
+
const templateCache = new TemplateCache({ maxSize: 100 });
|
|
77
|
+
// Register Handlebars helpers
|
|
78
|
+
Handlebars.registerHelper('if', function (conditional, options) {
|
|
79
|
+
if (conditional) {
|
|
80
|
+
return options.fn(this);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
return options.inverse(this);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
/**
|
|
87
|
+
* List all available prompts
|
|
88
|
+
*
|
|
89
|
+
* @param req - Express request object
|
|
90
|
+
* @param res - Express response object
|
|
91
|
+
*/
|
|
92
|
+
export async function listPrompts(req, res) {
|
|
93
|
+
try {
|
|
94
|
+
const category = req.query.category;
|
|
95
|
+
const prompts = category ? getPromptsByCategory(category) : getAllPrompts();
|
|
96
|
+
res.json({
|
|
97
|
+
success: true,
|
|
98
|
+
data: prompts,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
const errorObj = new Error('Failed to list prompts');
|
|
103
|
+
const errorResult = createErrorResult(errorObj, error instanceof Error ? error.message : 'Unknown error', 500);
|
|
104
|
+
res.status(Number(errorResult.error.code)).json(errorResult);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* List all available prompt categories
|
|
109
|
+
*
|
|
110
|
+
* @param req - Express request object
|
|
111
|
+
* @param res - Express response object
|
|
112
|
+
*/
|
|
113
|
+
export async function listPromptCategories(req, res) {
|
|
114
|
+
try {
|
|
115
|
+
const categories = getAllCategories();
|
|
116
|
+
res.json({
|
|
117
|
+
success: true,
|
|
118
|
+
data: categories,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
const errorObj = new Error('Failed to list prompt categories');
|
|
123
|
+
const errorResult = createErrorResult(errorObj, error instanceof Error ? error.message : 'Unknown error', 500);
|
|
124
|
+
res.status(Number(errorResult.error.code)).json(errorResult);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Get details for a specific prompt
|
|
129
|
+
*
|
|
130
|
+
* @param req - Express request object
|
|
131
|
+
* @param res - Express response object
|
|
132
|
+
*/
|
|
133
|
+
export async function getPromptDetails(req, res) {
|
|
134
|
+
try {
|
|
135
|
+
const promptId = req.params.id;
|
|
136
|
+
const prompt = getPromptById(promptId);
|
|
137
|
+
if (!prompt) {
|
|
138
|
+
const errorObj = new Error('Prompt not found');
|
|
139
|
+
const errorResult = createErrorResult(errorObj, `No prompt found with ID: ${promptId}`, 404);
|
|
140
|
+
res.status(Number(errorResult.error.code)).json(errorResult);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
res.json({
|
|
144
|
+
success: true,
|
|
145
|
+
data: prompt,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
const errorObj = new Error('Failed to get prompt details');
|
|
150
|
+
const errorResult = createErrorResult(errorObj, error instanceof Error ? error.message : 'Unknown error', 500);
|
|
151
|
+
res.status(Number(errorResult.error.code)).json(errorResult);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Validate parameters against prompt definition
|
|
156
|
+
*
|
|
157
|
+
* @param prompt - Prompt template to validate against
|
|
158
|
+
* @param parameters - Parameters to validate
|
|
159
|
+
* @returns Object with validation result and any error messages
|
|
160
|
+
*/
|
|
161
|
+
function validateParameters(prompt, parameters) {
|
|
162
|
+
const errors = [];
|
|
163
|
+
// Check for required parameters
|
|
164
|
+
prompt.parameters.forEach((param) => {
|
|
165
|
+
if (param.required &&
|
|
166
|
+
(parameters[param.name] === undefined || parameters[param.name] === null)) {
|
|
167
|
+
errors.push(`Missing required parameter: ${param.name}`);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
// Check enum values
|
|
171
|
+
prompt.parameters.forEach((param) => {
|
|
172
|
+
if (param.enum &&
|
|
173
|
+
parameters[param.name] !== undefined &&
|
|
174
|
+
typeof parameters[param.name] === 'string' &&
|
|
175
|
+
!param.enum.includes(parameters[param.name])) {
|
|
176
|
+
errors.push(`Invalid value for parameter ${param.name}. ` +
|
|
177
|
+
`Expected one of: ${param.enum.join(', ')}`);
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
// Check parameter types
|
|
181
|
+
prompt.parameters.forEach((param) => {
|
|
182
|
+
if (parameters[param.name] !== undefined) {
|
|
183
|
+
const paramValue = parameters[param.name];
|
|
184
|
+
let typeError = false;
|
|
185
|
+
switch (param.type) {
|
|
186
|
+
case 'string':
|
|
187
|
+
typeError = typeof paramValue !== 'string';
|
|
188
|
+
break;
|
|
189
|
+
case 'number':
|
|
190
|
+
typeError = typeof paramValue !== 'number';
|
|
191
|
+
break;
|
|
192
|
+
case 'boolean':
|
|
193
|
+
typeError = typeof paramValue !== 'boolean';
|
|
194
|
+
break;
|
|
195
|
+
case 'array':
|
|
196
|
+
typeError = !Array.isArray(paramValue);
|
|
197
|
+
break;
|
|
198
|
+
case 'object':
|
|
199
|
+
typeError =
|
|
200
|
+
typeof paramValue !== 'object' ||
|
|
201
|
+
Array.isArray(paramValue) ||
|
|
202
|
+
paramValue === null;
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
if (typeError) {
|
|
206
|
+
errors.push(`Invalid type for parameter ${param.name}. Expected ${param.type}.`);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
return {
|
|
211
|
+
valid: errors.length === 0,
|
|
212
|
+
errors,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Apply default values to missing parameters
|
|
217
|
+
*
|
|
218
|
+
* @param prompt - Prompt template with parameter definitions
|
|
219
|
+
* @param parameters - User-provided parameters
|
|
220
|
+
* @returns Parameters with defaults applied
|
|
221
|
+
*/
|
|
222
|
+
function applyDefaultValues(prompt, parameters) {
|
|
223
|
+
const result = { ...parameters };
|
|
224
|
+
prompt.parameters.forEach((param) => {
|
|
225
|
+
if ((result[param.name] === undefined || result[param.name] === null) &&
|
|
226
|
+
param.default !== undefined) {
|
|
227
|
+
result[param.name] = param.default;
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
return result;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Execute a prompt with provided parameters
|
|
234
|
+
*
|
|
235
|
+
* @param req - Express request object
|
|
236
|
+
* @param res - Express response object
|
|
237
|
+
*/
|
|
238
|
+
export async function executePrompt(req, res) {
|
|
239
|
+
try {
|
|
240
|
+
const promptId = req.params.id;
|
|
241
|
+
const prompt = getPromptById(promptId);
|
|
242
|
+
if (!prompt) {
|
|
243
|
+
const errorObj = new Error('Prompt not found');
|
|
244
|
+
const errorResult = createErrorResult(errorObj, `No prompt found with ID: ${promptId}`, 404);
|
|
245
|
+
res.status(Number(errorResult.error.code)).json(errorResult);
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
const executionRequest = req.body;
|
|
249
|
+
// Validate parameters
|
|
250
|
+
const validation = validateParameters(prompt, executionRequest.parameters);
|
|
251
|
+
if (!validation.valid) {
|
|
252
|
+
const errorObj = new Error('Invalid parameters');
|
|
253
|
+
const errorResult = createErrorResult(errorObj, validation.errors.join(', '), 400);
|
|
254
|
+
res.status(Number(errorResult.error.code)).json(errorResult);
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
// Apply default values
|
|
258
|
+
const parameters = applyDefaultValues(prompt, executionRequest.parameters);
|
|
259
|
+
// Get or compile template with caching
|
|
260
|
+
let template = templateCache.get(promptId);
|
|
261
|
+
if (!template) {
|
|
262
|
+
try {
|
|
263
|
+
template = Handlebars.compile(prompt.template);
|
|
264
|
+
templateCache.set(promptId, template);
|
|
265
|
+
}
|
|
266
|
+
catch (compileError) {
|
|
267
|
+
const errorObj = new Error('Failed to compile template');
|
|
268
|
+
const errorResult = createErrorResult(errorObj, `Template compilation error for prompt ${promptId}: ${compileError instanceof Error
|
|
269
|
+
? compileError.message
|
|
270
|
+
: 'Unknown error'}`, 500);
|
|
271
|
+
res.status(Number(errorResult.error.code)).json(errorResult);
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
// Execute the template with error handling
|
|
276
|
+
let result;
|
|
277
|
+
try {
|
|
278
|
+
result = template(parameters);
|
|
279
|
+
}
|
|
280
|
+
catch (renderError) {
|
|
281
|
+
const errorObj = new Error('Failed to render template');
|
|
282
|
+
const errorResult = createErrorResult(errorObj, `Template rendering error for prompt ${promptId}: ${renderError instanceof Error ? renderError.message : 'Unknown error'}`, 500);
|
|
283
|
+
res.status(Number(errorResult.error.code)).json(errorResult);
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
res.json({
|
|
287
|
+
success: true,
|
|
288
|
+
data: {
|
|
289
|
+
prompt: prompt.id,
|
|
290
|
+
result,
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
catch (error) {
|
|
295
|
+
const errorObj = new Error('Failed to execute prompt');
|
|
296
|
+
const errorResult = createErrorResult(errorObj, error instanceof Error ? error.message : 'Unknown error', 500);
|
|
297
|
+
res.status(Number(errorResult.error.code)).json(errorResult);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Register MCP prompt handlers with the server
|
|
302
|
+
*
|
|
303
|
+
* This function registers handlers for the MCP prompts/list and prompts/get endpoints
|
|
304
|
+
* required by the Model Context Protocol specification. These endpoints enable
|
|
305
|
+
* Claude Desktop to discover and retrieve prompt templates from the server.
|
|
306
|
+
*
|
|
307
|
+
* @param server - MCP server instance
|
|
308
|
+
* @example
|
|
309
|
+
* ```typescript
|
|
310
|
+
* const server = new Server();
|
|
311
|
+
* registerPromptHandlers(server);
|
|
312
|
+
* ```
|
|
313
|
+
*/
|
|
314
|
+
export function registerPromptHandlers(server) {
|
|
315
|
+
// Register handler for prompts/list endpoint
|
|
316
|
+
server.setRequestHandler(ListPromptsRequestSchema, async () => {
|
|
317
|
+
const prompts = getAllPrompts();
|
|
318
|
+
return {
|
|
319
|
+
prompts: prompts.map((prompt) => ({
|
|
320
|
+
id: prompt.id,
|
|
321
|
+
name: prompt.title, // Map title to name as required by MCP
|
|
322
|
+
description: prompt.description,
|
|
323
|
+
category: prompt.category,
|
|
324
|
+
})),
|
|
325
|
+
};
|
|
326
|
+
});
|
|
327
|
+
// Register handler for prompts/get endpoint
|
|
328
|
+
server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
329
|
+
const promptId = request.params.promptId;
|
|
330
|
+
const prompt = getPromptById(promptId);
|
|
331
|
+
if (!prompt) {
|
|
332
|
+
throw new Error(`Prompt not found: ${promptId}`);
|
|
333
|
+
}
|
|
334
|
+
return {
|
|
335
|
+
prompt: {
|
|
336
|
+
id: prompt.id,
|
|
337
|
+
name: prompt.title, // Map title to name as required by MCP
|
|
338
|
+
description: prompt.description,
|
|
339
|
+
category: prompt.category,
|
|
340
|
+
parameters: prompt.parameters.map((param) => ({
|
|
341
|
+
name: param.name,
|
|
342
|
+
type: param.type,
|
|
343
|
+
description: param.description,
|
|
344
|
+
required: param.required,
|
|
345
|
+
default: param.default,
|
|
346
|
+
enum: param.enum,
|
|
347
|
+
})),
|
|
348
|
+
template: prompt.template,
|
|
349
|
+
},
|
|
350
|
+
};
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
//# sourceMappingURL=handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../src/prompts/handlers.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,sBAAs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aAC1B;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Prompts module
|
|
3
|
+
*
|
|
4
|
+
* This module implements the MCP Prompts feature for the Attio MCP server,
|
|
5
|
+
* providing pre-defined templates for common Attio operations.
|
|
6
|
+
*/
|
|
7
|
+
export * from './types.js';
|
|
8
|
+
export { getAllPrompts, getPromptsByCategory, getPromptById, getAllCategories, } from './templates/index.js';
|
|
9
|
+
export { listPrompts, listPromptCategories, getPromptDetails, executePrompt, } from './handlers.js';
|
|
10
|
+
export { allPrompts } from './templates/index.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,YAAY,CAAC;AAG3B,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,aAAa,EACb,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,GACd,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Prompts module
|
|
3
|
+
*
|
|
4
|
+
* This module implements the MCP Prompts feature for the Attio MCP server,
|
|
5
|
+
* providing pre-defined templates for common Attio operations.
|
|
6
|
+
*/
|
|
7
|
+
// Export types
|
|
8
|
+
export * from './types.js';
|
|
9
|
+
// Export template utilities
|
|
10
|
+
export { getAllPrompts, getPromptsByCategory, getPromptById, getAllCategories, } from './templates/index.js';
|
|
11
|
+
// Export handlers
|
|
12
|
+
export { listPrompts, listPromptCategories, getPromptDetails, executePrompt, } from './handlers.js';
|
|
13
|
+
// Export all templates
|
|
14
|
+
export { allPrompts } from './templates/index.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAe;AACf,cAAc,YAAY,CAAC;AAE3B,4BAA4B;AAC5B,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,aAAa,EACb,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAE9B,kBAAkB;AAClB,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,GACd,MAAM,eAAe,CAAC;AAEvB,uBAAuB;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Companies-related prompt templates
|
|
3
|
+
*/
|
|
4
|
+
import { PromptTemplate } from '../types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Prompt templates for company operations
|
|
7
|
+
*/
|
|
8
|
+
export declare const companiesPrompts: PromptTemplate[];
|
|
9
|
+
export default companiesPrompts;
|
|
10
|
+
//# sourceMappingURL=companies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"companies.d.ts","sourceRoot":"","sources":["../../../src/prompts/templates/companies.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,cAAc,EA+H5C,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt templates for company operations
|
|
3
|
+
*/
|
|
4
|
+
export const companiesPrompts = [
|
|
5
|
+
{
|
|
6
|
+
id: 'create-company',
|
|
7
|
+
title: 'Create a new company',
|
|
8
|
+
description: 'Create a new company record in Attio with the provided details',
|
|
9
|
+
category: 'companies',
|
|
10
|
+
parameters: [
|
|
11
|
+
{
|
|
12
|
+
name: 'name',
|
|
13
|
+
type: 'string',
|
|
14
|
+
description: 'Name of the company',
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'website',
|
|
19
|
+
type: 'string',
|
|
20
|
+
description: 'Website URL of the company',
|
|
21
|
+
required: false,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'industry',
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Industry the company operates in',
|
|
27
|
+
required: false,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'size',
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: 'Size of the company (e.g., "1-10", "11-50", "51-200", "201-500", "501-1000", "1001+")',
|
|
33
|
+
required: false,
|
|
34
|
+
enum: ['1-10', '11-50', '51-200', '201-500', '501-1000', '1001+'],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'description',
|
|
38
|
+
type: 'string',
|
|
39
|
+
description: 'Brief description of the company',
|
|
40
|
+
required: false,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
template: 'Create a new company named {{name}}{{#if website}} with website {{website}}{{/if}}{{#if industry}} in the {{industry}} industry{{/if}}{{#if size}} with {{size}} employees{{/if}}{{#if description}}. Description: {{description}}{{/if}}.',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'find-company-by-name',
|
|
47
|
+
title: 'Find a company by name',
|
|
48
|
+
description: 'Search for a company in Attio using its name',
|
|
49
|
+
category: 'companies',
|
|
50
|
+
parameters: [
|
|
51
|
+
{
|
|
52
|
+
name: 'name',
|
|
53
|
+
type: 'string',
|
|
54
|
+
description: 'Company name to search for',
|
|
55
|
+
required: true,
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
template: 'Find a company with the name {{name}}.',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: 'update-company',
|
|
62
|
+
title: 'Update company details',
|
|
63
|
+
description: 'Update an existing company record in Attio',
|
|
64
|
+
category: 'companies',
|
|
65
|
+
parameters: [
|
|
66
|
+
{
|
|
67
|
+
name: 'companyId',
|
|
68
|
+
type: 'string',
|
|
69
|
+
description: 'ID of the company to update',
|
|
70
|
+
required: true,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'name',
|
|
74
|
+
type: 'string',
|
|
75
|
+
description: 'New name for the company',
|
|
76
|
+
required: false,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'website',
|
|
80
|
+
type: 'string',
|
|
81
|
+
description: 'New website URL for the company',
|
|
82
|
+
required: false,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'industry',
|
|
86
|
+
type: 'string',
|
|
87
|
+
description: 'New industry for the company',
|
|
88
|
+
required: false,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'description',
|
|
92
|
+
type: 'string',
|
|
93
|
+
description: 'New description for the company',
|
|
94
|
+
required: false,
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
template: 'Update the company with ID {{companyId}}{{#if name}} to change its name to {{name}}{{/if}}{{#if website}}, update its website to {{website}}{{/if}}{{#if industry}}, update its industry to {{industry}}{{/if}}{{#if description}}, and update its description to "{{description}}"{{/if}}.',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: 'add-note-to-company',
|
|
101
|
+
title: 'Add a note to a company',
|
|
102
|
+
description: 'Add a note to an existing company record in Attio',
|
|
103
|
+
category: 'companies',
|
|
104
|
+
parameters: [
|
|
105
|
+
{
|
|
106
|
+
name: 'companyId',
|
|
107
|
+
type: 'string',
|
|
108
|
+
description: 'ID of the company to add a note to',
|
|
109
|
+
required: true,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: 'title',
|
|
113
|
+
type: 'string',
|
|
114
|
+
description: 'Title of the note',
|
|
115
|
+
required: true,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'content',
|
|
119
|
+
type: 'string',
|
|
120
|
+
description: 'Content of the note',
|
|
121
|
+
required: true,
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
template: 'Add a note titled "{{title}}" with content "{{content}}" to the company with ID {{companyId}}.',
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
export default companiesPrompts;
|
|
128
|
+
//# sourceMappingURL=companies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"companies.js","sourceRoot":"","sources":["../../../src/prompts/templates/companies.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAqB;IAChD;QACE,EAAE,EAAE,gBAAgB;QACpB,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EACT,gEAAgE;QAClE,QAAQ,EAAE,WAAW;QACrB,UAAU,EAAE;YACV;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qBAAqB;gBAClC,QAAQ,EAAE,IAAI;aACf;YACD;gBACE,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4BAA4B;gBACzC,QAAQ,EAAE,KAAK;aAChB;YACD;gBACE,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kCAAkC;gBAC/C,QAAQ,EAAE,KAAK;aAChB;YACD;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,uFAAuF;gBACzF,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC;aAClE;YACD;gBACE,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kCAAkC;gBAC/C,QAAQ,E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B,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oCAAoC;gBACjD,QAAQ,EAAE,IAAI;aACf;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mBAAmB;gBAChC,QAAQ,EAAE,IAAI;aACf;YACD;gBACE,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qBAAqB;gBAClC,QAAQ,EAAE,IAAI;aACf;SACF;QACD,QAAQ,EACN,gGAAgG;KACnG;CACF,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Export all prompt templates
|
|
3
|
+
*/
|
|
4
|
+
import { PromptTemplate } from '../types.js';
|
|
5
|
+
/**
|
|
6
|
+
* All available prompt templates
|
|
7
|
+
*/
|
|
8
|
+
export declare const allPrompts: PromptTemplate[];
|
|
9
|
+
/**
|
|
10
|
+
* Get all prompts
|
|
11
|
+
*
|
|
12
|
+
* @returns Array of all prompt templates
|
|
13
|
+
*/
|
|
14
|
+
export declare function getAllPrompts(): PromptTemplate[];
|
|
15
|
+
/**
|
|
16
|
+
* Get prompts by category
|
|
17
|
+
*
|
|
18
|
+
* @param category - Category to filter by
|
|
19
|
+
* @returns Array of prompt templates in the specified category
|
|
20
|
+
*/
|
|
21
|
+
export declare function getPromptsByCategory(category: string): PromptTemplate[];
|
|
22
|
+
/**
|
|
23
|
+
* Get prompt by ID
|
|
24
|
+
*
|
|
25
|
+
* @param id - ID of the prompt to retrieve
|
|
26
|
+
* @returns Prompt template with the specified ID, or undefined if not found
|
|
27
|
+
*/
|
|
28
|
+
export declare function getPromptById(id: string): PromptTemplate | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Get all available prompt categories
|
|
31
|
+
*
|
|
32
|
+
* @returns Array of unique category names
|
|
33
|
+
*/
|
|
34
|
+
export declare function getAllCategories(): string[];
|
|
35
|
+
declare const _default: {
|
|
36
|
+
getAllPrompts: typeof getAllPrompts;
|
|
37
|
+
getPromptsByCategory: typeof getPromptsByCategory;
|
|
38
|
+
getPromptById: typeof getPromptById;
|
|
39
|
+
getAllCategories: typeof getAllCategories;
|
|
40
|
+
};
|
|
41
|
+
export default _default;
|
|
42
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prompts/templates/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAM7C;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,cAAc,EAKtC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,cAAc,EAAE,CAEhD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,EAAE,CAEvE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAEpE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,CAQ3C;;;;;;;AAED,wBAKE"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import peoplePrompts from './people.js';
|
|
2
|
+
import companiesPrompts from './companies.js';
|
|
3
|
+
import listsPrompts from './lists.js';
|
|
4
|
+
import notesPrompts from './notes.js';
|
|
5
|
+
/**
|
|
6
|
+
* All available prompt templates
|
|
7
|
+
*/
|
|
8
|
+
export const allPrompts = [
|
|
9
|
+
...peoplePrompts,
|
|
10
|
+
...companiesPrompts,
|
|
11
|
+
...listsPrompts,
|
|
12
|
+
...notesPrompts,
|
|
13
|
+
];
|
|
14
|
+
/**
|
|
15
|
+
* Get all prompts
|
|
16
|
+
*
|
|
17
|
+
* @returns Array of all prompt templates
|
|
18
|
+
*/
|
|
19
|
+
export function getAllPrompts() {
|
|
20
|
+
return allPrompts;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get prompts by category
|
|
24
|
+
*
|
|
25
|
+
* @param category - Category to filter by
|
|
26
|
+
* @returns Array of prompt templates in the specified category
|
|
27
|
+
*/
|
|
28
|
+
export function getPromptsByCategory(category) {
|
|
29
|
+
return allPrompts.filter((prompt) => prompt.category === category);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get prompt by ID
|
|
33
|
+
*
|
|
34
|
+
* @param id - ID of the prompt to retrieve
|
|
35
|
+
* @returns Prompt template with the specified ID, or undefined if not found
|
|
36
|
+
*/
|
|
37
|
+
export function getPromptById(id) {
|
|
38
|
+
return allPrompts.find((prompt) => prompt.id === id);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get all available prompt categories
|
|
42
|
+
*
|
|
43
|
+
* @returns Array of unique category names
|
|
44
|
+
*/
|
|
45
|
+
export function getAllCategories() {
|
|
46
|
+
const categories = new Set();
|
|
47
|
+
allPrompts.forEach((prompt) => {
|
|
48
|
+
categories.add(prompt.category);
|
|
49
|
+
});
|
|
50
|
+
return Array.from(categories);
|
|
51
|
+
}
|
|
52
|
+
export default {
|
|
53
|
+
getAllPrompts,
|
|
54
|
+
getPromptsByCategory,
|
|
55
|
+
getPromptById,
|
|
56
|
+
getAllCategories,
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/prompts/templates/index.ts"],"names":[],"mappings":"AAIA,OAAO,aAAa,MAAM,aAAa,CAAC;AACxC,OAAO,gBAAgB,MAAM,gBAAgB,CAAC;AAC9C,OAAO,YAAY,MAAM,YAAY,CAAC;AACtC,OAAO,YAAY,MAAM,YAAY,CAAC;AAEtC;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAqB;IAC1C,GAAG,aAAa;IAChB,GAAG,gBAAgB;IACnB,GAAG,YAAY;IACf,GAAG,YAAY;CAChB,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACnD,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;AACrE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,EAAU;IACtC,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AACvD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IAErC,UAAU,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QAC5B,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC;AAED,eAAe;IACb,aAAa;IACb,oBAAoB;IACpB,aAAa;IACb,gBAAgB;CACjB,CAAC"}
|