@lightsage/mcp 0.4.16 → 0.4.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/api/mcp.js +30 -0
- package/bin/mcp-server.js +2495 -660
- package/bin/mcp-server.js.map +103 -55
- package/esm/funcs/agentAnalyticsCountriesList.d.ts +16 -0
- package/esm/funcs/agentAnalyticsCountriesList.d.ts.map +1 -0
- package/esm/funcs/agentAnalyticsCountriesList.js +95 -0
- package/esm/funcs/agentAnalyticsCountriesList.js.map +1 -0
- package/esm/funcs/agentAnalyticsErrorPagesList.d.ts +16 -0
- package/esm/funcs/agentAnalyticsErrorPagesList.d.ts.map +1 -0
- package/esm/funcs/agentAnalyticsErrorPagesList.js +97 -0
- package/esm/funcs/agentAnalyticsErrorPagesList.js.map +1 -0
- package/esm/funcs/agentAnalyticsPagesList.d.ts +16 -0
- package/esm/funcs/agentAnalyticsPagesList.d.ts.map +1 -0
- package/esm/funcs/agentAnalyticsPagesList.js +99 -0
- package/esm/funcs/agentAnalyticsPagesList.js.map +1 -0
- package/esm/funcs/agentAnalyticsSitesList.d.ts +15 -0
- package/esm/funcs/agentAnalyticsSitesList.d.ts.map +1 -0
- package/esm/funcs/agentAnalyticsSitesList.js +72 -0
- package/esm/funcs/agentAnalyticsSitesList.js.map +1 -0
- package/esm/funcs/agentAnalyticsSourcesList.d.ts +16 -0
- package/esm/funcs/agentAnalyticsSourcesList.d.ts.map +1 -0
- package/esm/funcs/agentAnalyticsSourcesList.js +94 -0
- package/esm/funcs/agentAnalyticsSourcesList.js.map +1 -0
- package/esm/funcs/agentAnalyticsSummaryRetrieve.d.ts +16 -0
- package/esm/funcs/agentAnalyticsSummaryRetrieve.d.ts.map +1 -0
- package/esm/funcs/agentAnalyticsSummaryRetrieve.js +94 -0
- package/esm/funcs/agentAnalyticsSummaryRetrieve.js.map +1 -0
- package/esm/funcs/agentsList.d.ts +1 -1
- package/esm/funcs/agentsList.js +1 -1
- package/esm/funcs/evalsCreate.d.ts +2 -0
- package/esm/funcs/evalsCreate.d.ts.map +1 -1
- package/esm/funcs/evalsCreate.js +2 -0
- package/esm/funcs/evalsCreate.js.map +1 -1
- package/esm/funcs/evalsRun.d.ts +2 -0
- package/esm/funcs/evalsRun.d.ts.map +1 -1
- package/esm/funcs/evalsRun.js +2 -0
- package/esm/funcs/evalsRun.js.map +1 -1
- package/esm/funcs/promptsRun.d.ts +7 -3
- package/esm/funcs/promptsRun.d.ts.map +1 -1
- package/esm/funcs/promptsRun.js +7 -3
- package/esm/funcs/promptsRun.js.map +1 -1
- package/esm/funcs/promptsRunCancel.d.ts +16 -0
- package/esm/funcs/promptsRunCancel.d.ts.map +1 -0
- package/esm/funcs/promptsRunCancel.js +88 -0
- package/esm/funcs/promptsRunCancel.js.map +1 -0
- package/esm/funcs/tasksCreate.d.ts +16 -0
- package/esm/funcs/tasksCreate.d.ts.map +1 -0
- package/esm/funcs/tasksCreate.js +83 -0
- package/esm/funcs/tasksCreate.js.map +1 -0
- package/esm/funcs/visibilityCitationsList.d.ts +1 -1
- package/esm/funcs/visibilityCitationsList.js +2 -1
- package/esm/funcs/visibilityCitationsList.js.map +1 -1
- package/esm/funcs/visibilityCitationsSummaryRetrieve.d.ts +16 -0
- package/esm/funcs/visibilityCitationsSummaryRetrieve.d.ts.map +1 -0
- package/esm/funcs/visibilityCitationsSummaryRetrieve.js +93 -0
- package/esm/funcs/visibilityCitationsSummaryRetrieve.js.map +1 -0
- package/esm/funcs/visibilityCurrentRetrieve.d.ts +1 -1
- package/esm/funcs/visibilityCurrentRetrieve.js +2 -1
- package/esm/funcs/visibilityCurrentRetrieve.js.map +1 -1
- package/esm/funcs/visibilityOverviewRetrieve.d.ts +1 -1
- package/esm/funcs/visibilityOverviewRetrieve.js +2 -1
- package/esm/funcs/visibilityOverviewRetrieve.js.map +1 -1
- package/esm/funcs/visibilityPromptsRetrieve.js +1 -0
- package/esm/funcs/visibilityPromptsRetrieve.js.map +1 -1
- package/esm/landing-page.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/mcp-server/mcp-server.js +1 -1
- package/esm/mcp-server/server.d.ts.map +1 -1
- package/esm/mcp-server/server.js +19 -1
- package/esm/mcp-server/server.js.map +1 -1
- package/esm/mcp-server/tools/agentAnalyticsCountriesList.d.ts +7 -0
- package/esm/mcp-server/tools/agentAnalyticsCountriesList.d.ts.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsCountriesList.js +35 -0
- package/esm/mcp-server/tools/agentAnalyticsCountriesList.js.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsErrorPagesList.d.ts +7 -0
- package/esm/mcp-server/tools/agentAnalyticsErrorPagesList.d.ts.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsErrorPagesList.js +35 -0
- package/esm/mcp-server/tools/agentAnalyticsErrorPagesList.js.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsPagesList.d.ts +7 -0
- package/esm/mcp-server/tools/agentAnalyticsPagesList.d.ts.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsPagesList.js +35 -0
- package/esm/mcp-server/tools/agentAnalyticsPagesList.js.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsSitesList.d.ts +3 -0
- package/esm/mcp-server/tools/agentAnalyticsSitesList.d.ts.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsSitesList.js +30 -0
- package/esm/mcp-server/tools/agentAnalyticsSitesList.js.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsSourcesList.d.ts +7 -0
- package/esm/mcp-server/tools/agentAnalyticsSourcesList.d.ts.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsSourcesList.js +35 -0
- package/esm/mcp-server/tools/agentAnalyticsSourcesList.js.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsSummaryRetrieve.d.ts +7 -0
- package/esm/mcp-server/tools/agentAnalyticsSummaryRetrieve.d.ts.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsSummaryRetrieve.js +35 -0
- package/esm/mcp-server/tools/agentAnalyticsSummaryRetrieve.js.map +1 -0
- package/esm/mcp-server/tools/agentsList.js +1 -1
- package/esm/mcp-server/tools/agentsList.js.map +1 -1
- package/esm/mcp-server/tools/evalsCreate.d.ts.map +1 -1
- package/esm/mcp-server/tools/evalsCreate.js +3 -1
- package/esm/mcp-server/tools/evalsCreate.js.map +1 -1
- package/esm/mcp-server/tools/evalsRun.d.ts.map +1 -1
- package/esm/mcp-server/tools/evalsRun.js +2 -0
- package/esm/mcp-server/tools/evalsRun.js.map +1 -1
- package/esm/mcp-server/tools/promptsRun.d.ts.map +1 -1
- package/esm/mcp-server/tools/promptsRun.js +7 -3
- package/esm/mcp-server/tools/promptsRun.js.map +1 -1
- package/esm/mcp-server/tools/promptsRunCancel.d.ts +7 -0
- package/esm/mcp-server/tools/promptsRunCancel.d.ts.map +1 -0
- package/esm/mcp-server/tools/promptsRunCancel.js +35 -0
- package/esm/mcp-server/tools/promptsRunCancel.js.map +1 -0
- package/esm/mcp-server/tools/tasksCreate.d.ts +7 -0
- package/esm/mcp-server/tools/tasksCreate.d.ts.map +1 -0
- package/esm/mcp-server/tools/tasksCreate.js +35 -0
- package/esm/mcp-server/tools/tasksCreate.js.map +1 -0
- package/esm/mcp-server/tools/visibilityCitationsList.js +1 -1
- package/esm/mcp-server/tools/visibilityCitationsList.js.map +1 -1
- package/esm/mcp-server/tools/visibilityCitationsSummaryRetrieve.d.ts +7 -0
- package/esm/mcp-server/tools/visibilityCitationsSummaryRetrieve.d.ts.map +1 -0
- package/esm/mcp-server/tools/visibilityCitationsSummaryRetrieve.js +35 -0
- package/esm/mcp-server/tools/visibilityCitationsSummaryRetrieve.js.map +1 -0
- package/esm/mcp-server/tools/visibilityCurrentRetrieve.js +1 -1
- package/esm/mcp-server/tools/visibilityCurrentRetrieve.js.map +1 -1
- package/esm/mcp-server/tools/visibilityOverviewRetrieve.js +1 -1
- package/esm/mcp-server/tools/visibilityOverviewRetrieve.js.map +1 -1
- package/esm/models/createtaskrequest.d.ts +65 -0
- package/esm/models/createtaskrequest.d.ts.map +1 -0
- package/esm/models/createtaskrequest.js +64 -0
- package/esm/models/createtaskrequest.js.map +1 -0
- package/esm/models/createv2promptrequest.js +1 -1
- package/esm/models/createv2promptrequest.js.map +1 -1
- package/esm/models/createv2promptrunrequest.d.ts +1 -0
- package/esm/models/createv2promptrunrequest.d.ts.map +1 -1
- package/esm/models/createv2promptrunrequest.js +2 -1
- package/esm/models/createv2promptrunrequest.js.map +1 -1
- package/esm/models/graderdefinition.d.ts +1 -0
- package/esm/models/graderdefinition.d.ts.map +1 -1
- package/esm/models/graderdefinition.js +1 -0
- package/esm/models/graderdefinition.js.map +1 -1
- package/esm/models/publicagentanalyticscountrylistresponse.d.ts +12 -0
- package/esm/models/publicagentanalyticscountrylistresponse.d.ts.map +1 -0
- package/esm/models/publicagentanalyticscountrylistresponse.js +15 -0
- package/esm/models/publicagentanalyticscountrylistresponse.js.map +1 -0
- package/esm/models/publicagentanalyticserrorpagelistresponse.d.ts +13 -0
- package/esm/models/publicagentanalyticserrorpagelistresponse.d.ts.map +1 -0
- package/esm/models/publicagentanalyticserrorpagelistresponse.js +16 -0
- package/esm/models/publicagentanalyticserrorpagelistresponse.js.map +1 -0
- package/esm/models/publicagentanalyticspagelistresponse.d.ts +13 -0
- package/esm/models/publicagentanalyticspagelistresponse.d.ts.map +1 -0
- package/esm/models/publicagentanalyticspagelistresponse.js +16 -0
- package/esm/models/publicagentanalyticspagelistresponse.js.map +1 -0
- package/esm/models/publicagentanalyticssite.d.ts +9 -0
- package/esm/models/publicagentanalyticssite.d.ts.map +1 -0
- package/esm/models/publicagentanalyticssite.js +12 -0
- package/esm/models/publicagentanalyticssite.js.map +1 -0
- package/esm/models/publicagentanalyticssitelistresponse.d.ts +7 -0
- package/esm/models/publicagentanalyticssitelistresponse.d.ts.map +1 -0
- package/esm/models/publicagentanalyticssitelistresponse.js +10 -0
- package/esm/models/publicagentanalyticssitelistresponse.js.map +1 -0
- package/esm/models/publicagentanalyticssourcelistresponse.d.ts +12 -0
- package/esm/models/publicagentanalyticssourcelistresponse.d.ts.map +1 -0
- package/esm/models/publicagentanalyticssourcelistresponse.js +15 -0
- package/esm/models/publicagentanalyticssourcelistresponse.js.map +1 -0
- package/esm/models/publicagentanalyticssummary.d.ts +13 -0
- package/esm/models/publicagentanalyticssummary.d.ts.map +1 -0
- package/esm/models/publicagentanalyticssummary.js +16 -0
- package/esm/models/publicagentanalyticssummary.js.map +1 -0
- package/esm/models/publicagentcountry.d.ts +7 -0
- package/esm/models/publicagentcountry.d.ts.map +1 -0
- package/esm/models/publicagentcountry.js +11 -0
- package/esm/models/publicagentcountry.js.map +1 -0
- package/esm/models/publicagenterrorpage.d.ts +12 -0
- package/esm/models/publicagenterrorpage.d.ts.map +1 -0
- package/esm/models/publicagenterrorpage.js +16 -0
- package/esm/models/publicagenterrorpage.js.map +1 -0
- package/esm/models/publicagenterrorsource.d.ts +40 -0
- package/esm/models/publicagenterrorsource.d.ts.map +1 -0
- package/esm/models/publicagenterrorsource.js +40 -0
- package/esm/models/publicagenterrorsource.js.map +1 -0
- package/esm/models/publicagenttrafficpage.d.ts +14 -0
- package/esm/models/publicagenttrafficpage.d.ts.map +1 -0
- package/esm/models/publicagenttrafficpage.js +17 -0
- package/esm/models/publicagenttrafficpage.js.map +1 -0
- package/esm/models/publicagenttrafficsource.d.ts +47 -0
- package/esm/models/publicagenttrafficsource.d.ts.map +1 -0
- package/esm/models/publicagenttrafficsource.js +44 -0
- package/esm/models/publicagenttrafficsource.js.map +1 -0
- package/esm/models/publicagenttraffictotals.d.ts +13 -0
- package/esm/models/publicagenttraffictotals.d.ts.map +1 -0
- package/esm/models/publicagenttraffictotals.js +16 -0
- package/esm/models/publicagenttraffictotals.js.map +1 -0
- package/esm/models/publiccitationsummarygroup.d.ts +17 -0
- package/esm/models/publiccitationsummarygroup.d.ts.map +1 -0
- package/esm/models/publiccitationsummarygroup.js +20 -0
- package/esm/models/publiccitationsummarygroup.js.map +1 -0
- package/esm/models/publiccitationsummaryresponse.d.ts +61 -0
- package/esm/models/publiccitationsummaryresponse.d.ts.map +1 -0
- package/esm/models/publiccitationsummaryresponse.js +58 -0
- package/esm/models/publiccitationsummaryresponse.js.map +1 -0
- package/esm/models/publiccitationsummarytotals.d.ts +14 -0
- package/esm/models/publiccitationsummarytotals.d.ts.map +1 -0
- package/esm/models/publiccitationsummarytotals.js +17 -0
- package/esm/models/publiccitationsummarytotals.js.map +1 -0
- package/esm/models/publiccoverage.d.ts +12 -0
- package/esm/models/publiccoverage.d.ts.map +1 -0
- package/esm/models/publiccoverage.js +15 -0
- package/esm/models/publiccoverage.js.map +1 -0
- package/esm/models/publiccoverageday.d.ts +41 -0
- package/esm/models/publiccoverageday.d.ts.map +1 -0
- package/esm/models/publiccoverageday.js +39 -0
- package/esm/models/publiccoverageday.js.map +1 -0
- package/esm/models/publiccurrentvisibilityresponse.d.ts +8 -0
- package/esm/models/publiccurrentvisibilityresponse.d.ts.map +1 -1
- package/esm/models/publiccurrentvisibilityresponse.js +8 -0
- package/esm/models/publiccurrentvisibilityresponse.js.map +1 -1
- package/esm/models/publicperiodcoverage.d.ts +13 -0
- package/esm/models/publicperiodcoverage.d.ts.map +1 -0
- package/esm/models/publicperiodcoverage.js +17 -0
- package/esm/models/publicperiodcoverage.js.map +1 -0
- package/esm/models/publicperiodrates.d.ts +10 -0
- package/esm/models/publicperiodrates.d.ts.map +1 -0
- package/esm/models/publicperiodrates.js +14 -0
- package/esm/models/publicperiodrates.js.map +1 -0
- package/esm/models/publicpreviousvisibility.d.ts +10 -0
- package/esm/models/publicpreviousvisibility.d.ts.map +1 -0
- package/esm/models/publicpreviousvisibility.js +13 -0
- package/esm/models/publicpreviousvisibility.js.map +1 -0
- package/esm/models/publicpromptvisibilityreportresponse.d.ts +6 -0
- package/esm/models/publicpromptvisibilityreportresponse.d.ts.map +1 -1
- package/esm/models/publicpromptvisibilityreportresponse.js +6 -0
- package/esm/models/publicpromptvisibilityreportresponse.js.map +1 -1
- package/esm/models/publicratechanges.d.ts +8 -0
- package/esm/models/publicratechanges.d.ts.map +1 -0
- package/esm/models/publicratechanges.js +12 -0
- package/esm/models/publicratechanges.js.map +1 -0
- package/esm/models/publicrates.d.ts +27 -0
- package/esm/models/publicrates.d.ts.map +1 -0
- package/esm/models/publicrates.js +25 -0
- package/esm/models/publicrates.js.map +1 -0
- package/esm/models/publicresolvedperiod.d.ts +14 -0
- package/esm/models/publicresolvedperiod.d.ts.map +1 -0
- package/esm/models/publicresolvedperiod.js +18 -0
- package/esm/models/publicresolvedperiod.js.map +1 -0
- package/esm/models/publictopcitedurlsresponse.d.ts +10 -4
- package/esm/models/publictopcitedurlsresponse.d.ts.map +1 -1
- package/esm/models/publictopcitedurlsresponse.js +9 -3
- package/esm/models/publictopcitedurlsresponse.js.map +1 -1
- package/esm/models/publicvisibilityoverviewresponse.d.ts +6 -0
- package/esm/models/publicvisibilityoverviewresponse.d.ts.map +1 -1
- package/esm/models/publicvisibilityoverviewresponse.js +6 -0
- package/esm/models/publicvisibilityoverviewresponse.js.map +1 -1
- package/esm/models/updatetaskrequest.d.ts +8 -8
- package/esm/models/updatetaskrequest.d.ts.map +1 -1
- package/esm/models/updatetaskrequest.js +6 -6
- package/esm/models/updatetaskrequest.js.map +1 -1
- package/esm/models/updatev2promptrequest.js +1 -1
- package/esm/models/updatev2promptrequest.js.map +1 -1
- package/esm/models/v2agentanalyticscountrieslistop.d.ts +14 -0
- package/esm/models/v2agentanalyticscountrieslistop.d.ts.map +1 -0
- package/esm/models/v2agentanalyticscountrieslistop.js +19 -0
- package/esm/models/v2agentanalyticscountrieslistop.js.map +1 -0
- package/esm/models/v2agentanalyticserrorpageslistop.d.ts +40 -0
- package/esm/models/v2agentanalyticserrorpageslistop.d.ts.map +1 -0
- package/esm/models/v2agentanalyticserrorpageslistop.js +40 -0
- package/esm/models/v2agentanalyticserrorpageslistop.js.map +1 -0
- package/esm/models/v2agentanalyticspageslistop.d.ts +69 -0
- package/esm/models/v2agentanalyticspageslistop.d.ts.map +1 -0
- package/esm/models/v2agentanalyticspageslistop.js +66 -0
- package/esm/models/v2agentanalyticspageslistop.js.map +1 -0
- package/esm/models/v2agentanalyticssourceslistop.d.ts +13 -0
- package/esm/models/v2agentanalyticssourceslistop.d.ts.map +1 -0
- package/esm/models/v2agentanalyticssourceslistop.js +18 -0
- package/esm/models/v2agentanalyticssourceslistop.js.map +1 -0
- package/esm/models/v2agentanalyticssummaryretrieveop.d.ts +13 -0
- package/esm/models/v2agentanalyticssummaryretrieveop.d.ts.map +1 -0
- package/esm/models/v2agentanalyticssummaryretrieveop.js +18 -0
- package/esm/models/v2agentanalyticssummaryretrieveop.js.map +1 -0
- package/esm/models/v2inlinemcpdefinition.js +1 -1
- package/esm/models/v2inlinemcpdefinition.js.map +1 -1
- package/esm/models/v2promptrunscancelop.d.ts +38 -0
- package/esm/models/v2promptrunscancelop.d.ts.map +1 -0
- package/esm/models/v2promptrunscancelop.js +31 -0
- package/esm/models/v2promptrunscancelop.js.map +1 -0
- package/esm/models/v2repository.d.ts +4 -4
- package/esm/models/v2repository.d.ts.map +1 -1
- package/esm/models/v2repository.js +3 -3
- package/esm/models/v2repository.js.map +1 -1
- package/esm/models/v2taskscreateop.d.ts +13 -0
- package/esm/models/v2taskscreateop.d.ts.map +1 -0
- package/esm/models/v2taskscreateop.js +16 -0
- package/esm/models/v2taskscreateop.js.map +1 -0
- package/esm/models/v2visibilitycitationslistop.d.ts +1 -0
- package/esm/models/v2visibilitycitationslistop.d.ts.map +1 -1
- package/esm/models/v2visibilitycitationslistop.js +1 -0
- package/esm/models/v2visibilitycitationslistop.js.map +1 -1
- package/esm/models/v2visibilitycitationssummaryretrieveop.d.ts +54 -0
- package/esm/models/v2visibilitycitationssummaryretrieveop.d.ts.map +1 -0
- package/esm/models/v2visibilitycitationssummaryretrieveop.js +51 -0
- package/esm/models/v2visibilitycitationssummaryretrieveop.js.map +1 -0
- package/esm/models/v2visibilitycurrentretrieveop.d.ts +1 -0
- package/esm/models/v2visibilitycurrentretrieveop.d.ts.map +1 -1
- package/esm/models/v2visibilitycurrentretrieveop.js +1 -0
- package/esm/models/v2visibilitycurrentretrieveop.js.map +1 -1
- package/esm/models/v2visibilityoverviewretrieveop.d.ts +1 -0
- package/esm/models/v2visibilityoverviewretrieveop.d.ts.map +1 -1
- package/esm/models/v2visibilityoverviewretrieveop.js +1 -0
- package/esm/models/v2visibilityoverviewretrieveop.js.map +1 -1
- package/esm/models/v2visibilitypromptsretrieveop.d.ts +1 -0
- package/esm/models/v2visibilitypromptsretrieveop.d.ts.map +1 -1
- package/esm/models/v2visibilitypromptsretrieveop.js +1 -0
- package/esm/models/v2visibilitypromptsretrieveop.js.map +1 -1
- package/esm/tool-names.d.ts.map +1 -1
- package/esm/tool-names.js +43 -7
- package/esm/tool-names.js.map +1 -1
- package/lib/tracker.js +219 -0
- package/package.json +3 -1
- package/src/funcs/agentAnalyticsCountriesList.ts +160 -0
- package/src/funcs/agentAnalyticsErrorPagesList.ts +162 -0
- package/src/funcs/agentAnalyticsPagesList.ts +164 -0
- package/src/funcs/agentAnalyticsSitesList.ts +124 -0
- package/src/funcs/agentAnalyticsSourcesList.ts +159 -0
- package/src/funcs/agentAnalyticsSummaryRetrieve.ts +159 -0
- package/src/funcs/agentsList.ts +1 -1
- package/src/funcs/evalsCreate.ts +2 -0
- package/src/funcs/evalsRun.ts +2 -0
- package/src/funcs/promptsRun.ts +7 -3
- package/src/funcs/promptsRunCancel.ts +153 -0
- package/src/funcs/tasksCreate.ts +145 -0
- package/src/funcs/visibilityCitationsList.ts +2 -1
- package/src/funcs/visibilityCitationsSummaryRetrieve.ts +158 -0
- package/src/funcs/visibilityCurrentRetrieve.ts +2 -1
- package/src/funcs/visibilityOverviewRetrieve.ts +2 -1
- package/src/funcs/visibilityPromptsRetrieve.ts +1 -0
- package/src/landing-page.ts +1 -1
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +19 -1
- package/src/mcp-server/tools/agentAnalyticsCountriesList.ts +43 -0
- package/src/mcp-server/tools/agentAnalyticsErrorPagesList.ts +43 -0
- package/src/mcp-server/tools/agentAnalyticsPagesList.ts +43 -0
- package/src/mcp-server/tools/agentAnalyticsSitesList.ts +36 -0
- package/src/mcp-server/tools/agentAnalyticsSourcesList.ts +43 -0
- package/src/mcp-server/tools/agentAnalyticsSummaryRetrieve.ts +43 -0
- package/src/mcp-server/tools/agentsList.ts +1 -1
- package/src/mcp-server/tools/evalsCreate.ts +3 -1
- package/src/mcp-server/tools/evalsRun.ts +2 -0
- package/src/mcp-server/tools/promptsRun.ts +7 -3
- package/src/mcp-server/tools/promptsRunCancel.ts +43 -0
- package/src/mcp-server/tools/tasksCreate.ts +43 -0
- package/src/mcp-server/tools/visibilityCitationsList.ts +1 -1
- package/src/mcp-server/tools/visibilityCitationsSummaryRetrieve.ts +45 -0
- package/src/mcp-server/tools/visibilityCurrentRetrieve.ts +1 -1
- package/src/mcp-server/tools/visibilityOverviewRetrieve.ts +1 -1
- package/src/models/createtaskrequest.ts +98 -0
- package/src/models/createv2promptrequest.ts +1 -1
- package/src/models/createv2promptrunrequest.ts +5 -1
- package/src/models/graderdefinition.ts +2 -0
- package/src/models/publicagentanalyticscountrylistresponse.ts +36 -0
- package/src/models/publicagentanalyticserrorpagelistresponse.ts +40 -0
- package/src/models/publicagentanalyticspagelistresponse.ts +38 -0
- package/src/models/publicagentanalyticssite.ts +26 -0
- package/src/models/publicagentanalyticssitelistresponse.ts +20 -0
- package/src/models/publicagentanalyticssourcelistresponse.ts +36 -0
- package/src/models/publicagentanalyticssummary.ts +36 -0
- package/src/models/publicagentcountry.ts +16 -0
- package/src/models/publicagenterrorpage.ts +35 -0
- package/src/models/publicagenterrorsource.ts +63 -0
- package/src/models/publicagenttrafficpage.ts +46 -0
- package/src/models/publicagenttrafficsource.ts +77 -0
- package/src/models/publicagenttraffictotals.ts +42 -0
- package/src/models/publiccitationsummarygroup.ts +54 -0
- package/src/models/publiccitationsummaryresponse.ts +110 -0
- package/src/models/publiccitationsummarytotals.ts +38 -0
- package/src/models/publiccoverage.ts +34 -0
- package/src/models/publiccoverageday.ts +68 -0
- package/src/models/publiccurrentvisibilityresponse.ts +26 -0
- package/src/models/publicperiodcoverage.ts +33 -0
- package/src/models/publicperiodrates.ts +29 -0
- package/src/models/publicpreviousvisibility.ts +30 -0
- package/src/models/publicpromptvisibilityreportresponse.ts +18 -0
- package/src/models/publicratechanges.ts +25 -0
- package/src/models/publicrates.ts +52 -0
- package/src/models/publicresolvedperiod.ts +41 -0
- package/src/models/publictopcitedurlsresponse.ts +25 -5
- package/src/models/publicvisibilityoverviewresponse.ts +18 -0
- package/src/models/updatetaskrequest.ts +14 -10
- package/src/models/updatev2promptrequest.ts +1 -1
- package/src/models/v2agentanalyticscountrieslistop.ts +49 -0
- package/src/models/v2agentanalyticserrorpageslistop.ts +83 -0
- package/src/models/v2agentanalyticspageslistop.ts +123 -0
- package/src/models/v2agentanalyticssourceslistop.ts +47 -0
- package/src/models/v2agentanalyticssummaryretrieveop.ts +47 -0
- package/src/models/v2inlinemcpdefinition.ts +1 -1
- package/src/models/v2promptrunscancelop.ts +90 -0
- package/src/models/v2repository.ts +5 -5
- package/src/models/v2taskscreateop.ts +34 -0
- package/src/models/v2visibilitycitationslistop.ts +4 -0
- package/src/models/v2visibilitycitationssummaryretrieveop.ts +113 -0
- package/src/models/v2visibilitycurrentretrieveop.ts +4 -0
- package/src/models/v2visibilityoverviewretrieveop.ts +4 -0
- package/src/models/v2visibilitypromptsretrieveop.ts +4 -0
- package/src/tool-names.ts +43 -7
- package/test/tracker.test.js +323 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 858a2209718a
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod";
|
|
7
|
+
import {
|
|
8
|
+
HTTPValidationError,
|
|
9
|
+
HTTPValidationError$zodSchema,
|
|
10
|
+
} from "./httpvalidationerror.js";
|
|
11
|
+
import { V2PublicTask, V2PublicTask$zodSchema } from "./v2publictask.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The assignee is not a member of your organization.
|
|
15
|
+
*/
|
|
16
|
+
export type V2TasksCreateResponseBody = { detail: string };
|
|
17
|
+
|
|
18
|
+
export const V2TasksCreateResponseBody$zodSchema: z.ZodType<
|
|
19
|
+
V2TasksCreateResponseBody
|
|
20
|
+
> = z.object({
|
|
21
|
+
detail: z.string(),
|
|
22
|
+
}).describe("The assignee is not a member of your organization.");
|
|
23
|
+
|
|
24
|
+
export type V2TasksCreateResponse =
|
|
25
|
+
| V2PublicTask
|
|
26
|
+
| V2TasksCreateResponseBody
|
|
27
|
+
| HTTPValidationError;
|
|
28
|
+
|
|
29
|
+
export const V2TasksCreateResponse$zodSchema: z.ZodType<V2TasksCreateResponse> =
|
|
30
|
+
z.union([
|
|
31
|
+
V2PublicTask$zodSchema,
|
|
32
|
+
z.lazy(() => V2TasksCreateResponseBody$zodSchema),
|
|
33
|
+
HTTPValidationError$zodSchema,
|
|
34
|
+
]);
|
|
@@ -35,6 +35,7 @@ export type V2VisibilityCitationsListRequest = {
|
|
|
35
35
|
platform?: string | undefined;
|
|
36
36
|
source_type?: V2VisibilityCitationsListSourceType | undefined;
|
|
37
37
|
limit?: number | undefined;
|
|
38
|
+
period?: string | undefined;
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
export const V2VisibilityCitationsListRequest$zodSchema: z.ZodType<
|
|
@@ -44,6 +45,9 @@ export const V2VisibilityCitationsListRequest$zodSchema: z.ZodType<
|
|
|
44
45
|
"Inclusive range end; defaults to today.",
|
|
45
46
|
).optional(),
|
|
46
47
|
limit: z.int().default(20),
|
|
48
|
+
period: z.string().describe(
|
|
49
|
+
"Named period, resolved in UTC by the server: `last_7_days`, `last_14_days`, `last_30_days`, `last_90_days` (N days ending today), `this_week`, `last_week`, an ISO week such as `2026-W43` (Monday to Sunday), `this_month`, `last_month`, a month such as `2026-10`, `this_quarter`, `last_quarter`, or a quarter such as `2026Q4`. A current week, month, or quarter ends today. The response's `period` gives the resolved dates and the matching previous period. Do not combine with `start_date` or `end_date`.",
|
|
50
|
+
).optional(),
|
|
47
51
|
platform: z.string().describe("Optional answer-platform ID, name, or slug.")
|
|
48
52
|
.optional(),
|
|
49
53
|
source_type: V2VisibilityCitationsListSourceType$zodSchema.default("all"),
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 704776418479
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod";
|
|
7
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
8
|
+
import {
|
|
9
|
+
HTTPValidationError,
|
|
10
|
+
HTTPValidationError$zodSchema,
|
|
11
|
+
} from "./httpvalidationerror.js";
|
|
12
|
+
import {
|
|
13
|
+
PublicCitationSummaryResponse,
|
|
14
|
+
PublicCitationSummaryResponse$zodSchema,
|
|
15
|
+
} from "./publiccitationsummaryresponse.js";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* How to group citations.
|
|
19
|
+
*/
|
|
20
|
+
export const V2VisibilityCitationsSummaryRetrieveGroupBy = {
|
|
21
|
+
UrlPrefix: "url_prefix",
|
|
22
|
+
Url: "url",
|
|
23
|
+
Domain: "domain",
|
|
24
|
+
Day: "day",
|
|
25
|
+
} as const;
|
|
26
|
+
/**
|
|
27
|
+
* How to group citations.
|
|
28
|
+
*/
|
|
29
|
+
export type V2VisibilityCitationsSummaryRetrieveGroupBy = ClosedEnum<
|
|
30
|
+
typeof V2VisibilityCitationsSummaryRetrieveGroupBy
|
|
31
|
+
>;
|
|
32
|
+
|
|
33
|
+
export const V2VisibilityCitationsSummaryRetrieveGroupBy$zodSchema = z.enum([
|
|
34
|
+
"url_prefix",
|
|
35
|
+
"url",
|
|
36
|
+
"domain",
|
|
37
|
+
"day",
|
|
38
|
+
]).describe("How to group citations.");
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* All citations, only owned company domains, or only external ones.
|
|
42
|
+
*/
|
|
43
|
+
export const V2VisibilityCitationsSummaryRetrieveSourceType = {
|
|
44
|
+
All: "all",
|
|
45
|
+
Owned: "owned",
|
|
46
|
+
External: "external",
|
|
47
|
+
} as const;
|
|
48
|
+
/**
|
|
49
|
+
* All citations, only owned company domains, or only external ones.
|
|
50
|
+
*/
|
|
51
|
+
export type V2VisibilityCitationsSummaryRetrieveSourceType = ClosedEnum<
|
|
52
|
+
typeof V2VisibilityCitationsSummaryRetrieveSourceType
|
|
53
|
+
>;
|
|
54
|
+
|
|
55
|
+
export const V2VisibilityCitationsSummaryRetrieveSourceType$zodSchema = z.enum([
|
|
56
|
+
"all",
|
|
57
|
+
"owned",
|
|
58
|
+
"external",
|
|
59
|
+
]).describe(
|
|
60
|
+
"All citations, only owned company domains, or only external ones.",
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
export type V2VisibilityCitationsSummaryRetrieveRequest = {
|
|
64
|
+
period?: string | undefined;
|
|
65
|
+
start_date?: string | undefined;
|
|
66
|
+
end_date?: string | undefined;
|
|
67
|
+
group_by?: V2VisibilityCitationsSummaryRetrieveGroupBy | undefined;
|
|
68
|
+
url_prefix?: string | undefined;
|
|
69
|
+
source_type?: V2VisibilityCitationsSummaryRetrieveSourceType | undefined;
|
|
70
|
+
platform?: string | undefined;
|
|
71
|
+
limit?: number | undefined;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export const V2VisibilityCitationsSummaryRetrieveRequest$zodSchema: z.ZodType<
|
|
75
|
+
V2VisibilityCitationsSummaryRetrieveRequest
|
|
76
|
+
> = z.object({
|
|
77
|
+
end_date: z.string().date().describe(
|
|
78
|
+
"Inclusive range end; defaults to today.",
|
|
79
|
+
).optional(),
|
|
80
|
+
group_by: V2VisibilityCitationsSummaryRetrieveGroupBy$zodSchema.default(
|
|
81
|
+
"url_prefix",
|
|
82
|
+
).describe("How to group citations."),
|
|
83
|
+
limit: z.int().default(20).describe(
|
|
84
|
+
"Groups to return; `day` groups return every day.",
|
|
85
|
+
),
|
|
86
|
+
period: z.string().describe(
|
|
87
|
+
"Named period, resolved in UTC by the server: `last_7_days`, `last_14_days`, `last_30_days`, `last_90_days` (N days ending today), `this_week`, `last_week`, an ISO week such as `2026-W43` (Monday to Sunday), `this_month`, `last_month`, a month such as `2026-10`, `this_quarter`, `last_quarter`, or a quarter such as `2026Q4`. A current week, month, or quarter ends today. The response's `period` gives the resolved dates and the matching previous period. Do not combine with `start_date` or `end_date`.",
|
|
88
|
+
).optional(),
|
|
89
|
+
platform: z.string().describe("Optional answer-platform ID, name, or slug.")
|
|
90
|
+
.optional(),
|
|
91
|
+
source_type: V2VisibilityCitationsSummaryRetrieveSourceType$zodSchema.default(
|
|
92
|
+
"all",
|
|
93
|
+
).describe(
|
|
94
|
+
"All citations, only owned company domains, or only external ones.",
|
|
95
|
+
),
|
|
96
|
+
start_date: z.string().date().describe(
|
|
97
|
+
"Inclusive range start; defaults to 30 days before the end date. The range may span at most 90 days.",
|
|
98
|
+
).optional(),
|
|
99
|
+
url_prefix: z.string().describe(
|
|
100
|
+
"Only citations under this URL prefix, such as `https://example.com/blog/`. Scheme and `www.` are ignored.",
|
|
101
|
+
).optional(),
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
export type V2VisibilityCitationsSummaryRetrieveResponse =
|
|
105
|
+
| PublicCitationSummaryResponse
|
|
106
|
+
| HTTPValidationError;
|
|
107
|
+
|
|
108
|
+
export const V2VisibilityCitationsSummaryRetrieveResponse$zodSchema: z.ZodType<
|
|
109
|
+
V2VisibilityCitationsSummaryRetrieveResponse
|
|
110
|
+
> = z.union([
|
|
111
|
+
PublicCitationSummaryResponse$zodSchema,
|
|
112
|
+
HTTPValidationError$zodSchema,
|
|
113
|
+
]);
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
export type V2VisibilityCurrentRetrieveRequest = {
|
|
17
17
|
start_date?: string | undefined;
|
|
18
18
|
end_date?: string | undefined;
|
|
19
|
+
period?: string | undefined;
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
export const V2VisibilityCurrentRetrieveRequest$zodSchema: z.ZodType<
|
|
@@ -24,6 +25,9 @@ export const V2VisibilityCurrentRetrieveRequest$zodSchema: z.ZodType<
|
|
|
24
25
|
end_date: z.string().date().describe(
|
|
25
26
|
"Inclusive range end; defaults to today.",
|
|
26
27
|
).optional(),
|
|
28
|
+
period: z.string().describe(
|
|
29
|
+
"Named period, resolved in UTC by the server: `last_7_days`, `last_14_days`, `last_30_days`, `last_90_days` (N days ending today), `this_week`, `last_week`, an ISO week such as `2026-W43` (Monday to Sunday), `this_month`, `last_month`, a month such as `2026-10`, `this_quarter`, `last_quarter`, or a quarter such as `2026Q4`. A current week, month, or quarter ends today. The response's `period` gives the resolved dates and the matching previous period. Do not combine with `start_date` or `end_date`.",
|
|
30
|
+
).optional(),
|
|
27
31
|
start_date: z.string().date().describe(
|
|
28
32
|
"Inclusive range start; defaults to 30 days before the end date. The range may span at most 90 days.",
|
|
29
33
|
).optional(),
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
export type V2VisibilityOverviewRetrieveRequest = {
|
|
17
17
|
start_date?: string | undefined;
|
|
18
18
|
end_date?: string | undefined;
|
|
19
|
+
period?: string | undefined;
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
export const V2VisibilityOverviewRetrieveRequest$zodSchema: z.ZodType<
|
|
@@ -24,6 +25,9 @@ export const V2VisibilityOverviewRetrieveRequest$zodSchema: z.ZodType<
|
|
|
24
25
|
end_date: z.string().date().describe(
|
|
25
26
|
"Inclusive range end; defaults to today.",
|
|
26
27
|
).optional(),
|
|
28
|
+
period: z.string().describe(
|
|
29
|
+
"Named period, resolved in UTC by the server: `last_7_days`, `last_14_days`, `last_30_days`, `last_90_days` (N days ending today), `this_week`, `last_week`, an ISO week such as `2026-W43` (Monday to Sunday), `this_month`, `last_month`, a month such as `2026-10`, `this_quarter`, `last_quarter`, or a quarter such as `2026Q4`. A current week, month, or quarter ends today. The response's `period` gives the resolved dates and the matching previous period. Do not combine with `start_date` or `end_date`.",
|
|
30
|
+
).optional(),
|
|
27
31
|
start_date: z.string().date().describe(
|
|
28
32
|
"Inclusive range start; defaults to 30 days before the end date. The range may span at most 90 days.",
|
|
29
33
|
).optional(),
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
export type V2VisibilityPromptsRetrieveRequest = {
|
|
17
17
|
start_date?: string | undefined;
|
|
18
18
|
end_date?: string | undefined;
|
|
19
|
+
period?: string | undefined;
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
export const V2VisibilityPromptsRetrieveRequest$zodSchema: z.ZodType<
|
|
@@ -24,6 +25,9 @@ export const V2VisibilityPromptsRetrieveRequest$zodSchema: z.ZodType<
|
|
|
24
25
|
end_date: z.string().date().describe(
|
|
25
26
|
"Inclusive range end; defaults to today.",
|
|
26
27
|
).optional(),
|
|
28
|
+
period: z.string().describe(
|
|
29
|
+
"Named period, resolved in UTC by the server: `last_7_days`, `last_14_days`, `last_30_days`, `last_90_days` (N days ending today), `this_week`, `last_week`, an ISO week such as `2026-W43` (Monday to Sunday), `this_month`, `last_month`, a month such as `2026-10`, `this_quarter`, `last_quarter`, or a quarter such as `2026Q4`. A current week, month, or quarter ends today. The response's `period` gives the resolved dates and the matching previous period. Do not combine with `start_date` or `end_date`.",
|
|
30
|
+
).optional(),
|
|
27
31
|
start_date: z.string().date().describe(
|
|
28
32
|
"Inclusive range start; defaults to 30 days before the end date. The range may span at most 90 days.",
|
|
29
33
|
).optional(),
|
package/src/tool-names.ts
CHANGED
|
@@ -10,20 +10,24 @@ export const toolNames: Array<{ name: string; description: string }>= [
|
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
"name": "visibility-current-retrieve",
|
|
13
|
-
"description": "Retrieve Current Visibility\n\nReturns recommendation score, visibility score, ranks, and date-range metadata for the configured primary company. Metrics are computed from active prompts only; when no data exists, values are `null`."
|
|
13
|
+
"description": "Retrieve Current Visibility\n\nReturns recommendation score, visibility score, ranks, and date-range metadata for the configured primary company, with the same metrics for the previous period, run coverage, and per-run rates. Metrics are computed from active prompts only; when no data exists, values are `null`. Pass `period` (for example `last_30_days` or `2026Q4`) instead of computing dates."
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"name": "visibility-overview-retrieve",
|
|
17
|
-
"description": "Retrieve Visibility Overview\n\nReturns aggregate snapshot, daily trends, per-platform breakdowns, and competitor comparison. Calculated from active prompts only."
|
|
17
|
+
"description": "Retrieve Visibility Overview\n\nReturns aggregate snapshot, daily trends, per-platform breakdowns, and competitor comparison, with run coverage and per-run rates against the previous period. Calculated from active prompts only."
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"name": "visibility-citations-list",
|
|
21
|
-
"description": "List Top Cited Urls\n\nReturns URL-level citation counts ranked from most to least cited. Results can be filtered by platform and to owned or external sources."
|
|
21
|
+
"description": "List Top Cited Urls\n\nReturns URL-level citation counts ranked from most to least cited. Results can be filtered by platform and to owned or external sources. For totals by URL prefix, domain, or day compared with the previous period, use the citations summary."
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
"name": "visibility-prompts-retrieve",
|
|
25
25
|
"description": "Retrieve Prompt Visibility Report\n\nReturns per-topic and per-prompt visibility metrics including recommendation score, rank, visibility score, average position, and citation counts."
|
|
26
26
|
},
|
|
27
|
+
{
|
|
28
|
+
"name": "visibility-citations-summary-retrieve",
|
|
29
|
+
"description": "Retrieve Citation Summary\n\nReturns citation totals grouped by URL prefix (domain and first path segment, such as `example.com/blog`), URL, domain, or day, each compared with the previous period, with per-run rates and run coverage. Filter to one section of a site with `url_prefix`, for example `https://example.com/blog/`. Aggregated in one call; use it instead of paging the citations list."
|
|
30
|
+
},
|
|
27
31
|
{
|
|
28
32
|
"name": "prompts-list",
|
|
29
33
|
"description": "List Prompts\n\nReturns active and inactive prompts by default. Set `include_archived` to include archived prompts."
|
|
@@ -70,12 +74,16 @@ export const toolNames: Array<{ name: string; description: string }>= [
|
|
|
70
74
|
},
|
|
71
75
|
{
|
|
72
76
|
"name": "prompts-run",
|
|
73
|
-
"description": "Run Prompts\n\nQueue saved prompts
|
|
77
|
+
"description": "Run Prompts\n\nQueue saved prompts on answer engines and coding agents.\n\nProvide `prompt_ids` to run selected prompts, or omit them to run all active\nprompts. By default the run uses the organization's configured targets.\nProvide `agent` with IDs from `GET /v2/agents` to run the prompts on\nspecific coding-agent harnesses and models instead, for example to compare\nhow several coding tools answer the same developer question. Results\ninclude mentions and citations. Saved prompt run settings apply to\ncoding-agent targets. The response returns a run ID to poll with\n`GET /v2/prompts/runs/{run_id}/status`."
|
|
74
78
|
},
|
|
75
79
|
{
|
|
76
80
|
"name": "prompts-run-status",
|
|
77
81
|
"description": "Get Prompt Run Status\n\nReturn status and progress for a queued prompt run.\n\nPoll this endpoint until `status` is `completed`, `failed`, or `cancelled`.\nIndividual stored results are available from `GET /v2/prompts/runs`."
|
|
78
82
|
},
|
|
83
|
+
{
|
|
84
|
+
"name": "prompts-run-cancel",
|
|
85
|
+
"description": "Cancel a prompt run\n\nMarks an active prompt run as cancelled and prevents queued prompts from starting. Running coding-agent attempts are stopped asynchronously. Requests already sent to an answer platform cannot be recalled, so prompts already in progress may still finish and store their results, but the run stays cancelled. Prompts that never start use no usage-based credits. The response has the same shape as the status operation, with cancelled prompts counted in `progress.cancelled`. Repeating this request for an already-cancelled run is safe."
|
|
86
|
+
},
|
|
79
87
|
{
|
|
80
88
|
"name": "opportunities-list",
|
|
81
89
|
"description": "List Opportunities\n\nReturns ranked opportunities computed from stored prompt visibility results. Each includes an `execution_prompt` with context for an AI agent. Default window is 30 days."
|
|
@@ -88,6 +96,10 @@ export const toolNames: Array<{ name: string; description: string }>= [
|
|
|
88
96
|
"name": "tasks-list",
|
|
89
97
|
"description": "List Tasks\n\nReturns persisted daily tasks with execution instructions. Includes per-status counts not narrowed by the `status` filter."
|
|
90
98
|
},
|
|
99
|
+
{
|
|
100
|
+
"name": "tasks-create",
|
|
101
|
+
"description": "Create Task\n\nAdds a task to today's queue and returns it with its execution prompt. New tasks start as `new`."
|
|
102
|
+
},
|
|
91
103
|
{
|
|
92
104
|
"name": "tasks-retrieve",
|
|
93
105
|
"description": "Retrieve Task\n\nReturns one persisted task and its execution prompt."
|
|
@@ -104,13 +116,37 @@ export const toolNames: Array<{ name: string; description: string }>= [
|
|
|
104
116
|
"name": "site-audits-retrieve",
|
|
105
117
|
"description": "Retrieve Site Audit\n\nReturns one audited page with its score, priority, supporting evidence, and recommended fixes."
|
|
106
118
|
},
|
|
119
|
+
{
|
|
120
|
+
"name": "agent-analytics-sites-list",
|
|
121
|
+
"description": "List Agent Analytics Sites\n\nReturns every site with tracked visits. Use a `site_id` from this list to read that site's agent traffic."
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "agent-analytics-summary-retrieve",
|
|
125
|
+
"description": "Retrieve Agent Analytics Summary\n\nReturns a site's visits by traffic type (coding agents, user-requested AI fetches, AI search, AI training, other bots, and people) for the date range and for the previous period (the same number of days before it, or the previous calendar week, month, or quarter for a named `period`)."
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"name": "agent-analytics-sources-list",
|
|
129
|
+
"description": "List Agent Analytics Sources\n\nReturns every coding agent and bot that visited a site in the date range, with its traffic type and visit count, most visits first. Human visits are one `people` row."
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "agent-analytics-pages-list",
|
|
133
|
+
"description": "List Agent Analytics Pages\n\nReturns the pages AI agents and bots read on a site in the date range, with visits per traffic type. Sorted by AI visits unless `sort` is set. With `type`, returns only pages that traffic type visited. With `agent`, returns only the pages that one coding agent read."
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"name": "agent-analytics-error-pages-list",
|
|
137
|
+
"description": "List Agent Analytics Error Pages\n\nReturns the pages on a site that returned an error status (400 and up) in the date range, most error requests first, with the agents, bots, and people that got each error. Set `status` to 404 for pages that were not found. Needs server-side tracking that records status codes; `status_codes_tracked` says whether the site has any."
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"name": "agent-analytics-countries-list",
|
|
141
|
+
"description": "List Agent Analytics Countries\n\nReturns a site's visits from coding agents and AI assistants per country in the date range, most visits first."
|
|
142
|
+
},
|
|
107
143
|
{
|
|
108
144
|
"name": "evals-list",
|
|
109
145
|
"description": "List Evals\n\nReturns all active eval definitions owned by the organization. Agent Preference evals are not included; list them with `GET /v2/agent-preference/evals`."
|
|
110
146
|
},
|
|
111
147
|
{
|
|
112
148
|
"name": "evals-create",
|
|
113
|
-
"description": "Create Eval\n\nCreates a reusable simulation definition with one or more task prompts and judges. Optional agents, persona, CLI installations, MCP servers, setup commands, cleanup commands, grounding policy, repeat count, and tags are saved with the eval. `search_grounding` supports `disabled`, `enabled`, and `default`; `default` preserves normal platform behavior. Creating the eval does not start a run and does not accept secret environment values."
|
|
149
|
+
"description": "Create Eval\n\nCreates a reusable simulation definition with one or more task prompts and judges. Optional agents, persona, CLI installations, MCP servers, setup commands, cleanup commands, grounding policy, repeat count, and tags are saved with the eval. `search_grounding` supports `disabled`, `enabled`, and `default`; `default` preserves normal platform behavior. Creating the eval does not start a run and does not accept secret environment values.\n\nEvals measure how well agents complete tasks with your product. To track how agents and answer engines answer research questions, including which brands they mention and cite, run prompts with `POST /v2/prompts/runs` instead."
|
|
114
150
|
},
|
|
115
151
|
{
|
|
116
152
|
"name": "evals-batch-create",
|
|
@@ -150,7 +186,7 @@ export const toolNames: Array<{ name: string; description: string }>= [
|
|
|
150
186
|
},
|
|
151
187
|
{
|
|
152
188
|
"name": "evals-run",
|
|
153
|
-
"description": "Start an eval run\n\nQueues a durable eval job and returns immediately with a polling ID. Poll `GET /v2/eval-runs/{run_id}` until its status reaches a terminal value; once finished it also returns the results and analysis. Follow a run live with the monitor operation.\n\nSend one of these flat request forms:\n\n- **Saved eval:** provide `eval_id`; optionally replace its prompts, persona, agents, CLIs, MCPs, setup commands, cleanup commands, or runs for this launch. A saved configuration can still provide repository, environment, skills, and legacy tool selections.\n- **Direct create-and-run:** provide `prompts`, `judges`, and `agent`. You may also provide a persona, tags, repository, write-only environment variables, saved or inline CLIs and MCP servers, skills, setup commands, and cleanup commands.\n\nThe run fans out across prompts × agents × runs. Persona is shared metadata and does not multiply attempts. No separate `mode` field is required. If the organization lacks the estimated credits, the request fails with `402` before dispatching work.\n\nA saved or inline environment containing an empty or placeholder credential is rejected with `400` before any evaluation is dispatched."
|
|
189
|
+
"description": "Start an eval run\n\nQueues a durable eval job and returns immediately with a polling ID. Poll `GET /v2/eval-runs/{run_id}` until its status reaches a terminal value; once finished it also returns the results and analysis. Follow a run live with the monitor operation.\n\nEval runs measure how well agents complete tasks with your product. To compare how coding agents and answer engines answer the same research question, with mentions and citations, use `POST /v2/prompts/runs` with `agent` instead.\n\nSend one of these flat request forms:\n\n- **Saved eval:** provide `eval_id`; optionally replace its prompts, persona, agents, CLIs, MCPs, setup commands, cleanup commands, or runs for this launch. A saved configuration can still provide repository, environment, skills, and legacy tool selections.\n- **Direct create-and-run:** provide `prompts`, `judges`, and `agent`. You may also provide a persona, tags, repository, write-only environment variables, saved or inline CLIs and MCP servers, skills, setup commands, and cleanup commands.\n\nThe run fans out across prompts × agents × runs. Persona is shared metadata and does not multiply attempts. No separate `mode` field is required. If the organization lacks the estimated credits, the request fails with `402` before dispatching work.\n\nA saved or inline environment containing an empty or placeholder credential is rejected with `400` before any evaluation is dispatched."
|
|
154
190
|
},
|
|
155
191
|
{
|
|
156
192
|
"name": "evals-cancel",
|
|
@@ -222,7 +258,7 @@ export const toolNames: Array<{ name: string; description: string }>= [
|
|
|
222
258
|
},
|
|
223
259
|
{
|
|
224
260
|
"name": "agents-list",
|
|
225
|
-
"description": "List Agents\n\nReturns the harness-and-model combinations your plan can run, as single agent IDs
|
|
261
|
+
"description": "List Agents\n\nReturns the coding-agent harness-and-model combinations your plan can run, as single agent IDs. Pass them as `agent` to `POST /v2/prompts/runs` to see how coding agents answer your prompts, with mentions and citations; to `POST /v2/agent-preference/evals` to see whether agents recommend your company over one competitor; or to `POST /v2/evals` and `POST /v2/eval-runs` to measure how well agents complete tasks with your product."
|
|
226
262
|
},
|
|
227
263
|
{
|
|
228
264
|
"name": "repositories-list",
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import http from "node:http";
|
|
3
|
+
import test from "node:test";
|
|
4
|
+
|
|
5
|
+
process.env.MCP_OAUTH_ENABLED = "false";
|
|
6
|
+
process.env.LIGHTSAGE_MCP_TRACKER_API_KEY = "lsmcp_test_key";
|
|
7
|
+
|
|
8
|
+
// Capture analytics batches instead of sending them.
|
|
9
|
+
const batches = [];
|
|
10
|
+
const authChecks = [];
|
|
11
|
+
let analyticsHangs = false;
|
|
12
|
+
const realFetch = globalThis.fetch;
|
|
13
|
+
globalThis.fetch = async (url, init) => {
|
|
14
|
+
if (String(url).includes("/v2/auth/status")) {
|
|
15
|
+
authChecks.push(init.headers["X-Lightsage-Api-Key"]);
|
|
16
|
+
const valid = !String(init.headers["X-Lightsage-Api-Key"]).startsWith("ls_bad");
|
|
17
|
+
return new Response("{}", { status: valid ? 200 : 401 });
|
|
18
|
+
}
|
|
19
|
+
if (String(url).includes("mcp-analytics")) {
|
|
20
|
+
// Never settles and ignores the abort signal.
|
|
21
|
+
if (analyticsHangs) return new Promise(() => {});
|
|
22
|
+
batches.push({ headers: init.headers, body: JSON.parse(init.body) });
|
|
23
|
+
return new Response("{}", { status: 200 });
|
|
24
|
+
}
|
|
25
|
+
return realFetch(url, init);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const { default: handler } = await import("../api/mcp.js");
|
|
29
|
+
const { Client } = await import(
|
|
30
|
+
"@modelcontextprotocol/sdk/client/index.js"
|
|
31
|
+
);
|
|
32
|
+
const { StreamableHTTPClientTransport } = await import(
|
|
33
|
+
"@modelcontextprotocol/sdk/client/streamableHttp.js"
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
function createServer() {
|
|
37
|
+
return http.createServer(async (req, res) => {
|
|
38
|
+
res.status = (code) => {
|
|
39
|
+
res.statusCode = code;
|
|
40
|
+
return res;
|
|
41
|
+
};
|
|
42
|
+
res.json = (value) => {
|
|
43
|
+
res.setHeader("content-type", "application/json");
|
|
44
|
+
res.end(JSON.stringify(value));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const chunks = [];
|
|
48
|
+
for await (const chunk of req) chunks.push(chunk);
|
|
49
|
+
const body = Buffer.concat(chunks).toString("utf8");
|
|
50
|
+
req.body = body ? JSON.parse(body) : undefined;
|
|
51
|
+
await handler(req, res);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function initializeRequest(url) {
|
|
56
|
+
return realFetch(url, {
|
|
57
|
+
method: "POST",
|
|
58
|
+
headers: {
|
|
59
|
+
accept: "application/json, text/event-stream",
|
|
60
|
+
"content-type": "application/json",
|
|
61
|
+
"lightsage-api-key-auth": "ls_test_key",
|
|
62
|
+
},
|
|
63
|
+
body: JSON.stringify({
|
|
64
|
+
jsonrpc: "2.0",
|
|
65
|
+
id: 1,
|
|
66
|
+
method: "initialize",
|
|
67
|
+
params: {
|
|
68
|
+
protocolVersion: "2025-11-25",
|
|
69
|
+
capabilities: {},
|
|
70
|
+
clientInfo: { name: "tracker-test", version: "1.0.0" },
|
|
71
|
+
},
|
|
72
|
+
}),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function sentEvents() {
|
|
77
|
+
return batches.flatMap((batch) =>
|
|
78
|
+
batch.body.events ?? [batch.body]
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
test("tracks the handshake and tool calls and flushes before the handler returns", async () => {
|
|
83
|
+
const server = createServer();
|
|
84
|
+
await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
|
|
85
|
+
const address = server.address();
|
|
86
|
+
const url = new URL(`http://127.0.0.1:${address.port}/mcp`);
|
|
87
|
+
const client = new Client({ name: "tracker-test", version: "1.0.0" });
|
|
88
|
+
|
|
89
|
+
try {
|
|
90
|
+
await client.connect(
|
|
91
|
+
new StreamableHTTPClientTransport(url, {
|
|
92
|
+
fetch: realFetch,
|
|
93
|
+
requestInit: { headers: { "lightsage-api-key-auth": "ls_test_key" } },
|
|
94
|
+
}),
|
|
95
|
+
);
|
|
96
|
+
await client.listTools();
|
|
97
|
+
await client.callTool({ name: "list_tools", arguments: {} });
|
|
98
|
+
|
|
99
|
+
const events = sentEvents();
|
|
100
|
+
const initialize = events.find((e) => e.event === "$mcp_initialize");
|
|
101
|
+
assert.equal(initialize?.client_name, "tracker-test");
|
|
102
|
+
assert.equal(initialize?.server_name, "LightsageMcp");
|
|
103
|
+
assert.ok(events.some((e) => e.event === "$mcp_tools_list"));
|
|
104
|
+
assert.ok(
|
|
105
|
+
events.some((e) =>
|
|
106
|
+
e.event === "$mcp_tool_call" && e.tool_name === "list_tools"
|
|
107
|
+
),
|
|
108
|
+
);
|
|
109
|
+
assert.ok(
|
|
110
|
+
JSON.stringify(batches[0].headers).includes("lsmcp_test_key"),
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
// Each request is a new stateless server, so these only line up because
|
|
114
|
+
// the session comes from the caller's credential.
|
|
115
|
+
const toolCall = events.find((e) => e.event === "$mcp_tool_call");
|
|
116
|
+
assert.match(toolCall.session_id, /^mcp_caller_[0-9a-f]{32}$/);
|
|
117
|
+
assert.ok(events.every((e) => e.session_id === toolCall.session_id));
|
|
118
|
+
assert.equal(toolCall.client_name, "tracker-test");
|
|
119
|
+
assert.ok(!JSON.stringify(events).includes("ls_test_key"));
|
|
120
|
+
} finally {
|
|
121
|
+
await client.close();
|
|
122
|
+
await new Promise((resolve) => server.close(resolve));
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
test("caller sessions are stable per credential and client, and never contain the credential", async () => {
|
|
127
|
+
const { callerSessionId } = await import("../lib/tracker.js");
|
|
128
|
+
const alice = callerSessionId({
|
|
129
|
+
headers: { "x-lightsage-api-key": "ls_alice", "user-agent": "claude-code/2.1.3" },
|
|
130
|
+
});
|
|
131
|
+
assert.equal(
|
|
132
|
+
alice,
|
|
133
|
+
callerSessionId({
|
|
134
|
+
headers: { "x-lightsage-api-key": "ls_alice", "user-agent": "claude-code/2.1.3" },
|
|
135
|
+
}),
|
|
136
|
+
);
|
|
137
|
+
assert.notEqual(
|
|
138
|
+
alice,
|
|
139
|
+
callerSessionId({ headers: { "x-lightsage-api-key": "ls_bob", "user-agent": "claude-code/2.1.3" } }),
|
|
140
|
+
);
|
|
141
|
+
assert.notEqual(
|
|
142
|
+
alice,
|
|
143
|
+
callerSessionId({ headers: { "x-lightsage-api-key": "ls_alice", "user-agent": "cursor/1.0" } }),
|
|
144
|
+
);
|
|
145
|
+
assert.ok(!alice.includes("ls_alice"));
|
|
146
|
+
assert.match(
|
|
147
|
+
callerSessionId({ headers: { authorization: "Bearer oauth_token" } }),
|
|
148
|
+
/^mcp_caller_/,
|
|
149
|
+
);
|
|
150
|
+
assert.equal(callerSessionId({ headers: {} }), undefined);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
test("a stalled analytics request does not hold the handler open", async () => {
|
|
154
|
+
analyticsHangs = true;
|
|
155
|
+
let handlerMs;
|
|
156
|
+
const server = http.createServer(async (req, res) => {
|
|
157
|
+
const chunks = [];
|
|
158
|
+
for await (const chunk of req) chunks.push(chunk);
|
|
159
|
+
req.body = JSON.parse(Buffer.concat(chunks).toString("utf8"));
|
|
160
|
+
const started = Date.now();
|
|
161
|
+
await handler(req, res);
|
|
162
|
+
handlerMs = Date.now() - started;
|
|
163
|
+
});
|
|
164
|
+
await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
|
|
165
|
+
const address = server.address();
|
|
166
|
+
|
|
167
|
+
try {
|
|
168
|
+
const response = await initializeRequest(
|
|
169
|
+
`http://127.0.0.1:${address.port}/mcp`,
|
|
170
|
+
);
|
|
171
|
+
assert.equal(response.status, 200);
|
|
172
|
+
await response.text();
|
|
173
|
+
await new Promise((resolve) => setTimeout(resolve, 3500));
|
|
174
|
+
assert.ok(handlerMs !== undefined && handlerMs < 3500, `handler took ${handlerMs}ms`);
|
|
175
|
+
} finally {
|
|
176
|
+
analyticsHangs = false;
|
|
177
|
+
await new Promise((resolve) => server.close(resolve));
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
test("on Vercel the analytics flush is registered with waitUntil", async () => {
|
|
182
|
+
// Vercel exposes the request context on this symbol; @vercel/functions reads it.
|
|
183
|
+
const contextSymbol = Symbol.for("@vercel/request-context");
|
|
184
|
+
const registered = [];
|
|
185
|
+
globalThis[contextSymbol] = {
|
|
186
|
+
get: () => ({ waitUntil: (promise) => registered.push(promise) }),
|
|
187
|
+
};
|
|
188
|
+
const server = createServer();
|
|
189
|
+
await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
|
|
190
|
+
const address = server.address();
|
|
191
|
+
|
|
192
|
+
try {
|
|
193
|
+
const response = await initializeRequest(
|
|
194
|
+
`http://127.0.0.1:${address.port}/mcp`,
|
|
195
|
+
);
|
|
196
|
+
assert.equal(response.status, 200);
|
|
197
|
+
await response.text();
|
|
198
|
+
await Promise.all(registered);
|
|
199
|
+
assert.equal(registered.length, 1);
|
|
200
|
+
} finally {
|
|
201
|
+
delete globalThis[contextSymbol];
|
|
202
|
+
await new Promise((resolve) => server.close(resolve));
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
async function postJsonRpc(url, headers, method, params, id = 1) {
|
|
208
|
+
const response = await realFetch(url, {
|
|
209
|
+
method: "POST",
|
|
210
|
+
headers: {
|
|
211
|
+
accept: "application/json, text/event-stream",
|
|
212
|
+
"content-type": "application/json",
|
|
213
|
+
...headers,
|
|
214
|
+
},
|
|
215
|
+
body: JSON.stringify({ jsonrpc: "2.0", id, method, params }),
|
|
216
|
+
});
|
|
217
|
+
await response.text();
|
|
218
|
+
return response.status;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
async function withServer(fn) {
|
|
222
|
+
const server = createServer();
|
|
223
|
+
await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
|
|
224
|
+
try {
|
|
225
|
+
await fn(`http://127.0.0.1:${server.address().port}/mcp`);
|
|
226
|
+
} finally {
|
|
227
|
+
await new Promise((resolve) => server.close(resolve));
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
test("calls with a made-up API key are served but not recorded, even with a forged caller header", async () => {
|
|
232
|
+
await withServer(async (url) => {
|
|
233
|
+
const before = sentEvents().length;
|
|
234
|
+
const status = await postJsonRpc(
|
|
235
|
+
url,
|
|
236
|
+
{
|
|
237
|
+
"x-lightsage-api-key": "ls_bad_made_up",
|
|
238
|
+
"x-lightsage-verified-caller": "oauth:someone_else",
|
|
239
|
+
},
|
|
240
|
+
"tools/call",
|
|
241
|
+
{ name: "list_tools", arguments: {} },
|
|
242
|
+
);
|
|
243
|
+
assert.equal(status, 200);
|
|
244
|
+
assert.equal(sentEvents().length, before);
|
|
245
|
+
assert.ok(authChecks.includes("ls_bad_made_up"));
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
test("the in-app agent's headers attribute the user, run and request, and search results are kept", async () => {
|
|
250
|
+
await withServer(async (url) => {
|
|
251
|
+
const before = sentEvents().length;
|
|
252
|
+
await postJsonRpc(
|
|
253
|
+
url,
|
|
254
|
+
{
|
|
255
|
+
"x-lightsage-api-key": "ls_agent_key",
|
|
256
|
+
"user-agent": "Lightsage-Agent/1.0",
|
|
257
|
+
"x-lightsage-agent-user": "user_123",
|
|
258
|
+
"x-lightsage-agent-run": "run_9",
|
|
259
|
+
"x-lightsage-agent-intent": encodeURIComponent("What's my visibility — today?"),
|
|
260
|
+
},
|
|
261
|
+
"tools/call",
|
|
262
|
+
{ name: "list_tools", arguments: { search_terms: ["visibility"] } },
|
|
263
|
+
);
|
|
264
|
+
const call = sentEvents().slice(before).find((e) => e.event === "$mcp_tool_call");
|
|
265
|
+
assert.equal(call.client_name, "Lightsage-Agent");
|
|
266
|
+
assert.equal(call.distinct_id, "user_123");
|
|
267
|
+
assert.equal(call.conversation_id, "run_9");
|
|
268
|
+
assert.equal(call.intent, "What's my visibility — today?");
|
|
269
|
+
assert.deepEqual(call.properties, { auth: "api_key" });
|
|
270
|
+
// A catalog search result is kept: it is how empty searches are detected
|
|
271
|
+
assert.ok(call.response?.content?.length);
|
|
272
|
+
assert.match(call.session_id, /^mcp_caller_/);
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
test("an API key is checked once and then cached", async () => {
|
|
277
|
+
const { isTrackedApiKey } = await import("../lib/tracker.js");
|
|
278
|
+
let checks = 0;
|
|
279
|
+
const fakeFetch = async () => {
|
|
280
|
+
checks += 1;
|
|
281
|
+
return new Response("{}", { status: 200 });
|
|
282
|
+
};
|
|
283
|
+
assert.equal(await isTrackedApiKey("ls_cached", "https://api.example.test", fakeFetch), true);
|
|
284
|
+
assert.equal(await isTrackedApiKey("ls_cached", "https://api.example.test", fakeFetch), true);
|
|
285
|
+
assert.equal(checks, 1);
|
|
286
|
+
|
|
287
|
+
const failing = async () => {
|
|
288
|
+
throw new Error("network down");
|
|
289
|
+
};
|
|
290
|
+
// An unreachable API does not lose analytics, and is not cached
|
|
291
|
+
assert.equal(await isTrackedApiKey("ls_unknown", "https://api.example.test", failing), true);
|
|
292
|
+
const rejecting = async () => new Response("{}", { status: 401 });
|
|
293
|
+
assert.equal(await isTrackedApiKey("ls_unknown", "https://api.example.test", rejecting), false);
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
test("OAuth sessions follow the user, not the token", async () => {
|
|
297
|
+
const { callerSessionId } = await import("../lib/tracker.js");
|
|
298
|
+
const first = callerSessionId({
|
|
299
|
+
headers: {
|
|
300
|
+
authorization: "Bearer token_a",
|
|
301
|
+
"x-lightsage-verified-caller": "oauth:user_1",
|
|
302
|
+
"user-agent": "claude-code/2.1.3",
|
|
303
|
+
},
|
|
304
|
+
});
|
|
305
|
+
const refreshed = callerSessionId({
|
|
306
|
+
headers: {
|
|
307
|
+
authorization: "Bearer token_b",
|
|
308
|
+
"x-lightsage-verified-caller": "oauth:user_1",
|
|
309
|
+
"user-agent": "claude-code/2.1.3",
|
|
310
|
+
},
|
|
311
|
+
});
|
|
312
|
+
assert.equal(first, refreshed);
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
test("only failed calls and catalog tool results are stored", async () => {
|
|
317
|
+
const { shouldStoreResponse } = await import("../lib/tracker.js");
|
|
318
|
+
assert.equal(shouldStoreResponse({ toolName: "list_tools", isError: false }), true);
|
|
319
|
+
assert.equal(shouldStoreResponse({ toolName: "describe_tool_input", isError: false }), true);
|
|
320
|
+
assert.equal(shouldStoreResponse({ toolName: "execute_tool", isError: false }), false);
|
|
321
|
+
assert.equal(shouldStoreResponse({ toolName: "get_profile", isError: false }), false);
|
|
322
|
+
assert.equal(shouldStoreResponse({ toolName: "execute_tool", isError: true }), true);
|
|
323
|
+
});
|