@opentabs-dev/opentabs-plugin-posthog 0.0.74
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 +159 -0
- package/dist/adapter.iife.js +15614 -0
- package/dist/adapter.iife.js.map +7 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +104 -0
- package/dist/index.js.map +1 -0
- package/dist/posthog-api.d.ts +21 -0
- package/dist/posthog-api.d.ts.map +1 -0
- package/dist/posthog-api.js +82 -0
- package/dist/posthog-api.js.map +1 -0
- package/dist/tools/create-annotation.d.ts +20 -0
- package/dist/tools/create-annotation.d.ts.map +1 -0
- package/dist/tools/create-annotation.js +31 -0
- package/dist/tools/create-annotation.js.map +1 -0
- package/dist/tools/create-dashboard.d.ts +25 -0
- package/dist/tools/create-dashboard.d.ts.map +1 -0
- package/dist/tools/create-dashboard.js +29 -0
- package/dist/tools/create-dashboard.js.map +1 -0
- package/dist/tools/create-experiment.d.ts +23 -0
- package/dist/tools/create-experiment.d.ts.map +1 -0
- package/dist/tools/create-experiment.js +31 -0
- package/dist/tools/create-experiment.js.map +1 -0
- package/dist/tools/create-feature-flag.d.ts +26 -0
- package/dist/tools/create-feature-flag.d.ts.map +1 -0
- package/dist/tools/create-feature-flag.js +45 -0
- package/dist/tools/create-feature-flag.js.map +1 -0
- package/dist/tools/delete-annotation.d.ts +7 -0
- package/dist/tools/delete-annotation.d.ts.map +1 -0
- package/dist/tools/delete-annotation.js +22 -0
- package/dist/tools/delete-annotation.js.map +1 -0
- package/dist/tools/delete-dashboard.d.ts +7 -0
- package/dist/tools/delete-dashboard.d.ts.map +1 -0
- package/dist/tools/delete-dashboard.js +22 -0
- package/dist/tools/delete-dashboard.js.map +1 -0
- package/dist/tools/delete-feature-flag.d.ts +7 -0
- package/dist/tools/delete-feature-flag.d.ts.map +1 -0
- package/dist/tools/delete-feature-flag.js +22 -0
- package/dist/tools/delete-feature-flag.js.map +1 -0
- package/dist/tools/delete-insight.d.ts +7 -0
- package/dist/tools/delete-insight.d.ts.map +1 -0
- package/dist/tools/delete-insight.js +23 -0
- package/dist/tools/delete-insight.js.map +1 -0
- package/dist/tools/get-action.d.ts +19 -0
- package/dist/tools/get-action.d.ts.map +1 -0
- package/dist/tools/get-action.js +23 -0
- package/dist/tools/get-action.js.map +1 -0
- package/dist/tools/get-cohort.d.ts +20 -0
- package/dist/tools/get-cohort.d.ts.map +1 -0
- package/dist/tools/get-cohort.js +23 -0
- package/dist/tools/get-cohort.js.map +1 -0
- package/dist/tools/get-current-user.d.ts +14 -0
- package/dist/tools/get-current-user.d.ts.map +1 -0
- package/dist/tools/get-current-user.js +32 -0
- package/dist/tools/get-current-user.js.map +1 -0
- package/dist/tools/get-dashboard.d.ts +22 -0
- package/dist/tools/get-dashboard.d.ts.map +1 -0
- package/dist/tools/get-dashboard.js +23 -0
- package/dist/tools/get-dashboard.js.map +1 -0
- package/dist/tools/get-experiment.d.ts +21 -0
- package/dist/tools/get-experiment.d.ts.map +1 -0
- package/dist/tools/get-experiment.js +23 -0
- package/dist/tools/get-experiment.js.map +1 -0
- package/dist/tools/get-feature-flag.d.ts +22 -0
- package/dist/tools/get-feature-flag.d.ts.map +1 -0
- package/dist/tools/get-feature-flag.js +23 -0
- package/dist/tools/get-feature-flag.js.map +1 -0
- package/dist/tools/get-insight.d.ts +26 -0
- package/dist/tools/get-insight.d.ts.map +1 -0
- package/dist/tools/get-insight.js +24 -0
- package/dist/tools/get-insight.js.map +1 -0
- package/dist/tools/get-organization.d.ts +10 -0
- package/dist/tools/get-organization.d.ts.map +1 -0
- package/dist/tools/get-organization.js +21 -0
- package/dist/tools/get-organization.js.map +1 -0
- package/dist/tools/get-person.d.ts +14 -0
- package/dist/tools/get-person.d.ts.map +1 -0
- package/dist/tools/get-person.js +23 -0
- package/dist/tools/get-person.js.map +1 -0
- package/dist/tools/get-project.d.ts +15 -0
- package/dist/tools/get-project.d.ts.map +1 -0
- package/dist/tools/get-project.js +24 -0
- package/dist/tools/get-project.js.map +1 -0
- package/dist/tools/get-survey.d.ts +16 -0
- package/dist/tools/get-survey.d.ts.map +1 -0
- package/dist/tools/get-survey.js +23 -0
- package/dist/tools/get-survey.js.map +1 -0
- package/dist/tools/list-actions.d.ts +22 -0
- package/dist/tools/list-actions.d.ts.map +1 -0
- package/dist/tools/list-actions.js +30 -0
- package/dist/tools/list-actions.js.map +1 -0
- package/dist/tools/list-annotations.d.ts +22 -0
- package/dist/tools/list-annotations.d.ts.map +1 -0
- package/dist/tools/list-annotations.js +29 -0
- package/dist/tools/list-annotations.js.map +1 -0
- package/dist/tools/list-cohorts.d.ts +23 -0
- package/dist/tools/list-cohorts.d.ts.map +1 -0
- package/dist/tools/list-cohorts.js +30 -0
- package/dist/tools/list-cohorts.js.map +1 -0
- package/dist/tools/list-dashboards.d.ts +25 -0
- package/dist/tools/list-dashboards.d.ts.map +1 -0
- package/dist/tools/list-dashboards.js +30 -0
- package/dist/tools/list-dashboards.js.map +1 -0
- package/dist/tools/list-experiments.d.ts +24 -0
- package/dist/tools/list-experiments.d.ts.map +1 -0
- package/dist/tools/list-experiments.js +30 -0
- package/dist/tools/list-experiments.js.map +1 -0
- package/dist/tools/list-feature-flags.d.ts +27 -0
- package/dist/tools/list-feature-flags.d.ts.map +1 -0
- package/dist/tools/list-feature-flags.js +35 -0
- package/dist/tools/list-feature-flags.js.map +1 -0
- package/dist/tools/list-insights.d.ts +31 -0
- package/dist/tools/list-insights.d.ts.map +1 -0
- package/dist/tools/list-insights.js +38 -0
- package/dist/tools/list-insights.js.map +1 -0
- package/dist/tools/list-persons.d.ts +19 -0
- package/dist/tools/list-persons.d.ts.map +1 -0
- package/dist/tools/list-persons.js +35 -0
- package/dist/tools/list-persons.js.map +1 -0
- package/dist/tools/list-projects.d.ts +18 -0
- package/dist/tools/list-projects.d.ts.map +1 -0
- package/dist/tools/list-projects.js +31 -0
- package/dist/tools/list-projects.js.map +1 -0
- package/dist/tools/list-surveys.d.ts +20 -0
- package/dist/tools/list-surveys.d.ts.map +1 -0
- package/dist/tools/list-surveys.js +29 -0
- package/dist/tools/list-surveys.js.map +1 -0
- package/dist/tools/schemas.d.ts +452 -0
- package/dist/tools/schemas.d.ts.map +1 -0
- package/dist/tools/schemas.js +276 -0
- package/dist/tools/schemas.js.map +1 -0
- package/dist/tools/update-dashboard.d.ts +26 -0
- package/dist/tools/update-dashboard.d.ts.map +1 -0
- package/dist/tools/update-dashboard.js +31 -0
- package/dist/tools/update-dashboard.js.map +1 -0
- package/dist/tools/update-feature-flag.d.ts +26 -0
- package/dist/tools/update-feature-flag.d.ts.map +1 -0
- package/dist/tools/update-feature-flag.js +42 -0
- package/dist/tools/update-feature-flag.js.map +1 -0
- package/dist/tools/update-insight.d.ts +30 -0
- package/dist/tools/update-insight.d.ts.map +1 -0
- package/dist/tools/update-insight.js +40 -0
- package/dist/tools/update-insight.js.map +1 -0
- package/dist/tools.json +3530 -0
- package/package.json +55 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api, getTeamId } from '../posthog-api.js';
|
|
4
|
+
import { mapSurvey, surveySchema } from './schemas.js';
|
|
5
|
+
export const getSurvey = defineTool({
|
|
6
|
+
name: 'get_survey',
|
|
7
|
+
displayName: 'Get Survey',
|
|
8
|
+
description: 'Get detailed information about a specific survey including its type, dates, and archive status.',
|
|
9
|
+
summary: 'Get survey details',
|
|
10
|
+
icon: 'clipboard-list',
|
|
11
|
+
group: 'Surveys',
|
|
12
|
+
input: z.object({
|
|
13
|
+
survey_id: z.string().describe('Survey UUID'),
|
|
14
|
+
}),
|
|
15
|
+
output: z.object({
|
|
16
|
+
survey: surveySchema.describe('The survey details'),
|
|
17
|
+
}),
|
|
18
|
+
handle: async (params) => {
|
|
19
|
+
const data = await api(`/api/projects/${getTeamId()}/surveys/${params.survey_id}/`);
|
|
20
|
+
return { survey: mapSurvey(data) };
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=get-survey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-survey.js","sourceRoot":"","sources":["../../src/tools/get-survey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAkB,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEvE,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC;IAClC,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,iGAAiG;IAC9G,OAAO,EAAE,oBAAoB;IAC7B,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;KAC9C,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,oBAAoB,CAAC;KACpD,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAY,iBAAiB,SAAS,EAAE,YAAY,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;QAC/F,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;IACrC,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listActions: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
count: z.ZodNumber;
|
|
7
|
+
has_next: z.ZodBoolean;
|
|
8
|
+
actions: z.ZodArray<z.ZodObject<{
|
|
9
|
+
id: z.ZodNumber;
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
description: z.ZodString;
|
|
12
|
+
tags: z.ZodArray<z.ZodString>;
|
|
13
|
+
created_at: z.ZodString;
|
|
14
|
+
created_by: z.ZodNullable<z.ZodObject<{
|
|
15
|
+
id: z.ZodNumber;
|
|
16
|
+
first_name: z.ZodString;
|
|
17
|
+
email: z.ZodString;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
is_calculating: z.ZodBoolean;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
//# sourceMappingURL=list-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-actions.d.ts","sourceRoot":"","sources":["../../src/tools/list-actions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;kBAwBtB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api, getTeamId } from '../posthog-api.js';
|
|
4
|
+
import { actionSchema, mapAction, paginationInput, paginationOutput, } from './schemas.js';
|
|
5
|
+
export const listActions = defineTool({
|
|
6
|
+
name: 'list_actions',
|
|
7
|
+
displayName: 'List Actions',
|
|
8
|
+
description: 'List actions in the current PostHog project. Actions are groups of events defined by matching rules.',
|
|
9
|
+
summary: 'List actions',
|
|
10
|
+
icon: 'zap',
|
|
11
|
+
group: 'Actions',
|
|
12
|
+
input: z.object({
|
|
13
|
+
...paginationInput.shape,
|
|
14
|
+
}),
|
|
15
|
+
output: z.object({
|
|
16
|
+
actions: z.array(actionSchema).describe('List of actions'),
|
|
17
|
+
...paginationOutput.shape,
|
|
18
|
+
}),
|
|
19
|
+
handle: async (params) => {
|
|
20
|
+
const data = await api(`/api/projects/${getTeamId()}/actions/`, {
|
|
21
|
+
query: { limit: params.limit, offset: params.offset },
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
actions: (data.results ?? []).map(mapAction),
|
|
25
|
+
count: data.count ?? 0,
|
|
26
|
+
has_next: data.next != null,
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=list-actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-actions.js","sourceRoot":"","sources":["../../src/tools/list-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAGL,YAAY,EACZ,SAAS,EACT,eAAe,EACf,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;IACpC,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,sGAAsG;IACnH,OAAO,EAAE,cAAc;IACvB,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,GAAG,eAAe,CAAC,KAAK;KACzB,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QAC1D,GAAG,gBAAgB,CAAC,KAAK;KAC1B,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CAA+B,iBAAiB,SAAS,EAAE,WAAW,EAAE;YAC5F,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;SACtD,CAAC,CAAC;QACH,OAAO;YACL,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC;YAC5C,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC;YACtB,QAAQ,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI;SAC5B,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listAnnotations: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
search: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7
|
+
count: z.ZodNumber;
|
|
8
|
+
has_next: z.ZodBoolean;
|
|
9
|
+
annotations: z.ZodArray<z.ZodObject<{
|
|
10
|
+
id: z.ZodNumber;
|
|
11
|
+
content: z.ZodString;
|
|
12
|
+
date_marker: z.ZodString;
|
|
13
|
+
scope: z.ZodString;
|
|
14
|
+
created_at: z.ZodString;
|
|
15
|
+
created_by: z.ZodNullable<z.ZodObject<{
|
|
16
|
+
id: z.ZodNumber;
|
|
17
|
+
first_name: z.ZodString;
|
|
18
|
+
email: z.ZodString;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
//# sourceMappingURL=list-annotations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-annotations.d.ts","sourceRoot":"","sources":["../../src/tools/list-annotations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;kBAwB1B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api, getTeamId } from '../posthog-api.js';
|
|
4
|
+
import { annotationSchema, mapAnnotation, paginationInput, paginationOutput, } from './schemas.js';
|
|
5
|
+
export const listAnnotations = defineTool({
|
|
6
|
+
name: 'list_annotations',
|
|
7
|
+
displayName: 'List Annotations',
|
|
8
|
+
description: 'List annotations in the current PostHog project. Annotations mark important events on charts.',
|
|
9
|
+
summary: 'List annotations',
|
|
10
|
+
icon: 'message-square-text',
|
|
11
|
+
group: 'Annotations',
|
|
12
|
+
input: paginationInput.extend({
|
|
13
|
+
search: z.string().optional().describe('Search annotations by content'),
|
|
14
|
+
}),
|
|
15
|
+
output: paginationOutput.extend({
|
|
16
|
+
annotations: z.array(annotationSchema).describe('List of annotations'),
|
|
17
|
+
}),
|
|
18
|
+
handle: async (params) => {
|
|
19
|
+
const data = await api(`/api/projects/${getTeamId()}/annotations/`, {
|
|
20
|
+
query: { limit: params.limit, offset: params.offset, search: params.search },
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
annotations: (data.results ?? []).map(mapAnnotation),
|
|
24
|
+
count: data.count ?? 0,
|
|
25
|
+
has_next: data.next != null,
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=list-annotations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-annotations.js","sourceRoot":"","sources":["../../src/tools/list-annotations.ts"],"names":[],"mappings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AC5B,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listCohorts: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
count: z.ZodNumber;
|
|
7
|
+
has_next: z.ZodBoolean;
|
|
8
|
+
cohorts: z.ZodArray<z.ZodObject<{
|
|
9
|
+
id: z.ZodNumber;
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
description: z.ZodString;
|
|
12
|
+
count: z.ZodNullable<z.ZodNumber>;
|
|
13
|
+
is_static: z.ZodBoolean;
|
|
14
|
+
is_calculating: z.ZodBoolean;
|
|
15
|
+
created_at: z.ZodString;
|
|
16
|
+
created_by: z.ZodNullable<z.ZodObject<{
|
|
17
|
+
id: z.ZodNumber;
|
|
18
|
+
first_name: z.ZodString;
|
|
19
|
+
email: z.ZodString;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
}, z.core.$strip>>;
|
|
23
|
+
//# sourceMappingURL=list-cohorts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-cohorts.d.ts","sourceRoot":"","sources":["../../src/tools/list-cohorts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;kBAyBtB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api, getTeamId } from '../posthog-api.js';
|
|
4
|
+
import { cohortSchema, mapCohort, paginationInput, paginationOutput, } from './schemas.js';
|
|
5
|
+
export const listCohorts = defineTool({
|
|
6
|
+
name: 'list_cohorts',
|
|
7
|
+
displayName: 'List Cohorts',
|
|
8
|
+
description: 'List cohorts in the current PostHog project. Cohorts are groups of persons defined by shared properties or behaviors.',
|
|
9
|
+
summary: 'List cohorts',
|
|
10
|
+
icon: 'users-round',
|
|
11
|
+
group: 'Cohorts',
|
|
12
|
+
input: z.object({
|
|
13
|
+
...paginationInput.shape,
|
|
14
|
+
}),
|
|
15
|
+
output: z.object({
|
|
16
|
+
cohorts: z.array(cohortSchema).describe('List of cohorts'),
|
|
17
|
+
...paginationOutput.shape,
|
|
18
|
+
}),
|
|
19
|
+
handle: async (params) => {
|
|
20
|
+
const data = await api(`/api/projects/${getTeamId()}/cohorts/`, {
|
|
21
|
+
query: { limit: params.limit, offset: params.offset },
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
cohorts: (data.results ?? []).map(mapCohort),
|
|
25
|
+
count: data.count ?? 0,
|
|
26
|
+
has_next: data.next != null,
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=list-cohorts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-cohorts.js","sourceRoot":"","sources":["../../src/tools/list-cohorts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAGL,YAAY,EACZ,SAAS,EACT,eAAe,EACf,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;IACpC,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EACT,uHAAuH;IACzH,OAAO,EAAE,cAAc;IACvB,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,GAAG,eAAe,CAAC,KAAK;KACzB,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QAC1D,GAAG,gBAAgB,CAAC,KAAK;KAC1B,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CAA+B,iBAAiB,SAAS,EAAE,WAAW,EAAE;YAC5F,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;SACtD,CAAC,CAAC;QACH,OAAO;YACL,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC;YAC5C,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC;YACtB,QAAQ,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI;SAC5B,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listDashboards: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
count: z.ZodNumber;
|
|
7
|
+
has_next: z.ZodBoolean;
|
|
8
|
+
dashboards: z.ZodArray<z.ZodObject<{
|
|
9
|
+
id: z.ZodNumber;
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
description: z.ZodString;
|
|
12
|
+
pinned: z.ZodBoolean;
|
|
13
|
+
created_at: z.ZodString;
|
|
14
|
+
created_by: z.ZodNullable<z.ZodObject<{
|
|
15
|
+
id: z.ZodNumber;
|
|
16
|
+
first_name: z.ZodString;
|
|
17
|
+
email: z.ZodString;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
is_shared: z.ZodBoolean;
|
|
20
|
+
tags: z.ZodArray<z.ZodString>;
|
|
21
|
+
tiles_count: z.ZodNumber;
|
|
22
|
+
deleted: z.ZodBoolean;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
//# sourceMappingURL=list-dashboards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-dashboards.d.ts","sourceRoot":"","sources":["../../src/tools/list-dashboards.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;kBAwBzB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api, getTeamId } from '../posthog-api.js';
|
|
4
|
+
import { dashboardSchema, mapDashboard, paginationInput, paginationOutput, } from './schemas.js';
|
|
5
|
+
export const listDashboards = defineTool({
|
|
6
|
+
name: 'list_dashboards',
|
|
7
|
+
displayName: 'List Dashboards',
|
|
8
|
+
description: 'List all dashboards in the current PostHog project. Returns dashboard names, tags, and tile counts.',
|
|
9
|
+
summary: 'List dashboards in the project',
|
|
10
|
+
icon: 'layout-dashboard',
|
|
11
|
+
group: 'Dashboards',
|
|
12
|
+
input: z.object({
|
|
13
|
+
...paginationInput.shape,
|
|
14
|
+
}),
|
|
15
|
+
output: z.object({
|
|
16
|
+
dashboards: z.array(dashboardSchema).describe('List of dashboards'),
|
|
17
|
+
...paginationOutput.shape,
|
|
18
|
+
}),
|
|
19
|
+
handle: async (params) => {
|
|
20
|
+
const data = await api(`/api/environments/${getTeamId()}/dashboards/`, {
|
|
21
|
+
query: { limit: params.limit, offset: params.offset },
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
dashboards: (data.results ?? []).map(mapDashboard),
|
|
25
|
+
count: data.count ?? 0,
|
|
26
|
+
has_next: data.next != null,
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=list-dashboards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-dashboards.js","sourceRoot":"","sources":["../../src/tools/list-dashboards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAGL,eAAe,EACf,YAAY,EACZ,eAAe,EACf,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;IACvC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,qGAAqG;IAClH,OAAO,EAAE,gCAAgC;IACzC,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,GAAG,eAAe,CAAC,KAAK;KACzB,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QACnE,GAAG,gBAAgB,CAAC,KAAK;KAC1B,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAkC,qBAAqB,SAAS,EAAE,cAAc,EAAE;YACtG,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;SACtD,CAAC,CAAC;QACH,OAAO;YACL,UAAU,EAAE,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC;YAClD,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC;YACtB,QAAQ,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI;SAC5B,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listExperiments: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
count: z.ZodNumber;
|
|
7
|
+
has_next: z.ZodBoolean;
|
|
8
|
+
experiments: z.ZodArray<z.ZodObject<{
|
|
9
|
+
id: z.ZodNumber;
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
description: z.ZodString;
|
|
12
|
+
start_date: z.ZodNullable<z.ZodString>;
|
|
13
|
+
end_date: z.ZodNullable<z.ZodString>;
|
|
14
|
+
feature_flag_key: z.ZodString;
|
|
15
|
+
created_at: z.ZodString;
|
|
16
|
+
created_by: z.ZodNullable<z.ZodObject<{
|
|
17
|
+
id: z.ZodNumber;
|
|
18
|
+
first_name: z.ZodString;
|
|
19
|
+
email: z.ZodString;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
type: z.ZodString;
|
|
22
|
+
}, z.core.$strip>>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
//# sourceMappingURL=list-experiments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-experiments.d.ts","sourceRoot":"","sources":["../../src/tools/list-experiments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;kBAwB1B,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api, getTeamId } from '../posthog-api.js';
|
|
4
|
+
import { experimentSchema, mapExperiment, paginationInput, paginationOutput, } from './schemas.js';
|
|
5
|
+
export const listExperiments = defineTool({
|
|
6
|
+
name: 'list_experiments',
|
|
7
|
+
displayName: 'List Experiments',
|
|
8
|
+
description: 'List A/B test experiments in the current PostHog project.',
|
|
9
|
+
summary: 'List experiments',
|
|
10
|
+
icon: 'flask-conical',
|
|
11
|
+
group: 'Experiments',
|
|
12
|
+
input: z.object({
|
|
13
|
+
...paginationInput.shape,
|
|
14
|
+
}),
|
|
15
|
+
output: z.object({
|
|
16
|
+
experiments: z.array(experimentSchema).describe('List of experiments'),
|
|
17
|
+
...paginationOutput.shape,
|
|
18
|
+
}),
|
|
19
|
+
handle: async (params) => {
|
|
20
|
+
const data = await api(`/api/projects/${getTeamId()}/experiments/`, {
|
|
21
|
+
query: { limit: params.limit, offset: params.offset },
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
experiments: (data.results ?? []).map(mapExperiment),
|
|
25
|
+
count: data.count ?? 0,
|
|
26
|
+
has_next: data.next != null,
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=list-experiments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-experiments.js","sourceRoot":"","sources":["../../src/tools/list-experiments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EA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ZodNumber>;
|
|
4
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
active: z.ZodOptional<z.ZodString>;
|
|
6
|
+
search: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
count: z.ZodNumber;
|
|
9
|
+
has_next: z.ZodBoolean;
|
|
10
|
+
feature_flags: z.ZodArray<z.ZodObject<{
|
|
11
|
+
id: z.ZodNumber;
|
|
12
|
+
key: z.ZodString;
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
active: z.ZodBoolean;
|
|
15
|
+
deleted: z.ZodBoolean;
|
|
16
|
+
ensure_experience_continuity: z.ZodBoolean;
|
|
17
|
+
rollout_percentage: z.ZodNullable<z.ZodNumber>;
|
|
18
|
+
tags: z.ZodArray<z.ZodString>;
|
|
19
|
+
created_at: z.ZodString;
|
|
20
|
+
created_by: z.ZodNullable<z.ZodObject<{
|
|
21
|
+
id: z.ZodNumber;
|
|
22
|
+
first_name: z.ZodString;
|
|
23
|
+
email: z.ZodString;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
//# sourceMappingURL=list-feature-flags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-feature-flags.d.ts","sourceRoot":"","sources":["../../src/tools/list-feature-flags.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;kBA+B3B,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api, getTeamId } from '../posthog-api.js';
|
|
4
|
+
import { featureFlagSchema, mapFeatureFlag, paginationInput, paginationOutput, } from './schemas.js';
|
|
5
|
+
export const listFeatureFlags = defineTool({
|
|
6
|
+
name: 'list_feature_flags',
|
|
7
|
+
displayName: 'List Feature Flags',
|
|
8
|
+
description: 'List feature flags in the current PostHog project. Supports filtering by active status and search query.',
|
|
9
|
+
summary: 'List feature flags',
|
|
10
|
+
icon: 'flag',
|
|
11
|
+
group: 'Feature Flags',
|
|
12
|
+
input: paginationInput.extend({
|
|
13
|
+
active: z.string().optional().describe('Filter by active status: "true", "false", or "STALE"'),
|
|
14
|
+
search: z.string().optional().describe('Search by flag key or name'),
|
|
15
|
+
}),
|
|
16
|
+
output: paginationOutput.extend({
|
|
17
|
+
feature_flags: z.array(featureFlagSchema).describe('List of feature flags'),
|
|
18
|
+
}),
|
|
19
|
+
handle: async (params) => {
|
|
20
|
+
const data = await api(`/api/projects/${getTeamId()}/feature_flags/`, {
|
|
21
|
+
query: {
|
|
22
|
+
limit: params.limit,
|
|
23
|
+
offset: params.offset,
|
|
24
|
+
active: params.active,
|
|
25
|
+
search: params.search,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
feature_flags: (data.results ?? []).map(mapFeatureFlag),
|
|
30
|
+
count: data.count ?? 0,
|
|
31
|
+
has_next: data.next != null,
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=list-feature-flags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-feature-flags.js","sourceRoot":"","sources":["../../src/tools/list-feature-flags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAGL,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,gBAAgB,GAAG,UA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ject<{
|
|
3
|
+
short_id: z.ZodOptional<z.ZodString>;
|
|
4
|
+
saved: z.ZodOptional<z.ZodBoolean>;
|
|
5
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
count: z.ZodNumber;
|
|
9
|
+
has_next: z.ZodBoolean;
|
|
10
|
+
insights: z.ZodArray<z.ZodObject<{
|
|
11
|
+
id: z.ZodNumber;
|
|
12
|
+
short_id: z.ZodString;
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
derived_name: z.ZodNullable<z.ZodString>;
|
|
15
|
+
description: z.ZodString;
|
|
16
|
+
favorited: z.ZodBoolean;
|
|
17
|
+
tags: z.ZodArray<z.ZodString>;
|
|
18
|
+
dashboards: z.ZodArray<z.ZodNumber>;
|
|
19
|
+
query_kind: z.ZodString;
|
|
20
|
+
source_kind: z.ZodString;
|
|
21
|
+
created_at: z.ZodString;
|
|
22
|
+
created_by: z.ZodNullable<z.ZodObject<{
|
|
23
|
+
id: z.ZodNumber;
|
|
24
|
+
first_name: z.ZodString;
|
|
25
|
+
email: z.ZodString;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
last_modified_at: z.ZodString;
|
|
28
|
+
deleted: z.ZodBoolean;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
//# sourceMappingURL=list-insights.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-insights.d.ts","sourceRoot":"","sources":["../../src/tools/list-insights.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiCvB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api, getTeamId } from '../posthog-api.js';
|
|
4
|
+
import { insightSchema, mapInsight, paginationInput, paginationOutput, } from './schemas.js';
|
|
5
|
+
export const listInsights = defineTool({
|
|
6
|
+
name: 'list_insights',
|
|
7
|
+
displayName: 'List Insights',
|
|
8
|
+
description: 'List insights (trends, funnels, retention, paths, etc.) in the current PostHog project. Insights are the core analytics visualizations.',
|
|
9
|
+
summary: 'List insights in the project',
|
|
10
|
+
icon: 'bar-chart-3',
|
|
11
|
+
group: 'Insights',
|
|
12
|
+
input: z.object({
|
|
13
|
+
...paginationInput.shape,
|
|
14
|
+
short_id: z.string().optional().describe('Filter by short ID'),
|
|
15
|
+
saved: z.boolean().optional().describe('Filter by saved status'),
|
|
16
|
+
}),
|
|
17
|
+
output: z.object({
|
|
18
|
+
insights: z.array(insightSchema).describe('List of insights'),
|
|
19
|
+
...paginationOutput.shape,
|
|
20
|
+
}),
|
|
21
|
+
handle: async (params) => {
|
|
22
|
+
const teamId = getTeamId();
|
|
23
|
+
const data = await api(`/api/environments/${teamId}/insights/`, {
|
|
24
|
+
query: {
|
|
25
|
+
limit: params.limit,
|
|
26
|
+
offset: params.offset,
|
|
27
|
+
short_id: params.short_id,
|
|
28
|
+
saved: params.saved,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
insights: (data.results ?? []).map(mapInsight),
|
|
33
|
+
count: data.count ?? 0,
|
|
34
|
+
has_next: data.next != null,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=list-insights.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-insights.js","sourceRoot":"","sources":["../../src/tools/list-insights.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GA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C9C,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC;YACtB,QAAQ,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI;SAC5B,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listPersons: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
search: z.ZodOptional<z.ZodString>;
|
|
6
|
+
distinct_id: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
count: z.ZodNumber;
|
|
9
|
+
has_next: z.ZodBoolean;
|
|
10
|
+
persons: z.ZodArray<z.ZodObject<{
|
|
11
|
+
id: z.ZodNumber;
|
|
12
|
+
uuid: z.ZodString;
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
distinct_ids: z.ZodArray<z.ZodString>;
|
|
15
|
+
properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
16
|
+
created_at: z.ZodString;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
//# sourceMappingURL=list-persons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-persons.d.ts","sourceRoot":"","sources":["../../src/tools/list-persons.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;kBA+BtB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api, getTeamId } from '../posthog-api.js';
|
|
4
|
+
import { mapPerson, paginationInput, paginationOutput, personSchema, } from './schemas.js';
|
|
5
|
+
export const listPersons = defineTool({
|
|
6
|
+
name: 'list_persons',
|
|
7
|
+
displayName: 'List Persons',
|
|
8
|
+
description: 'List persons (users) tracked in the current PostHog project. Supports search by name, email, or distinct ID.',
|
|
9
|
+
summary: 'List tracked persons',
|
|
10
|
+
icon: 'users',
|
|
11
|
+
group: 'Persons',
|
|
12
|
+
input: paginationInput.extend({
|
|
13
|
+
search: z.string().optional().describe('Search by name, email, or distinct ID'),
|
|
14
|
+
distinct_id: z.string().optional().describe('Filter by exact distinct ID'),
|
|
15
|
+
}),
|
|
16
|
+
output: paginationOutput.extend({
|
|
17
|
+
persons: z.array(personSchema).describe('List of persons'),
|
|
18
|
+
}),
|
|
19
|
+
handle: async (params) => {
|
|
20
|
+
const data = await api(`/api/environments/${getTeamId()}/persons/`, {
|
|
21
|
+
query: {
|
|
22
|
+
limit: params.limit,
|
|
23
|
+
offset: params.offset,
|
|
24
|
+
search: params.search,
|
|
25
|
+
distinct_id: params.distinct_id,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
persons: (data.results ?? []).map(mapPerson),
|
|
30
|
+
count: data.count ?? 0,
|
|
31
|
+
has_next: data.next != null,
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=list-persons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-persons.js","sourceRoot":"","sources":["../../src/tools/list-persons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAGL,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,YAAY,GACb,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAA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limit: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
count: z.ZodNumber;
|
|
7
|
+
has_next: z.ZodBoolean;
|
|
8
|
+
projects: z.ZodArray<z.ZodObject<{
|
|
9
|
+
id: z.ZodNumber;
|
|
10
|
+
uuid: z.ZodString;
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
api_token: z.ZodString;
|
|
13
|
+
timezone: z.ZodString;
|
|
14
|
+
is_demo: z.ZodBoolean;
|
|
15
|
+
created_at: z.ZodString;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
//# sourceMappingURL=list-projects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-projects.d.ts","sourceRoot":"","sources":["../../src/tools/list-projects.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;kBA0BvB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api, getOrgId } from '../posthog-api.js';
|
|
4
|
+
import { mapProject, paginationInput, paginationOutput, projectSchema, } from './schemas.js';
|
|
5
|
+
export const listProjects = defineTool({
|
|
6
|
+
name: 'list_projects',
|
|
7
|
+
displayName: 'List Projects',
|
|
8
|
+
description: 'List all projects in the current PostHog organization. Projects contain events, dashboards, feature flags, and other analytics data.',
|
|
9
|
+
summary: 'List projects in the organization',
|
|
10
|
+
icon: 'folder',
|
|
11
|
+
group: 'Projects',
|
|
12
|
+
input: z.object({
|
|
13
|
+
...paginationInput.shape,
|
|
14
|
+
}),
|
|
15
|
+
output: z.object({
|
|
16
|
+
projects: z.array(projectSchema).describe('List of projects'),
|
|
17
|
+
...paginationOutput.shape,
|
|
18
|
+
}),
|
|
19
|
+
handle: async (params) => {
|
|
20
|
+
const orgId = getOrgId();
|
|
21
|
+
const data = await api(`/api/organizations/${orgId}/projects/`, {
|
|
22
|
+
query: { limit: params.limit, offset: params.offset },
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
projects: (data.results ?? []).map(mapProject),
|
|
26
|
+
count: data.count ?? 0,
|
|
27
|
+
has_next: data.next != null,
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=list-projects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-projects.js","sourceRoot":"","sources":["../../src/tools/list-projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAGL,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,aAAa,GACd,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;IACrC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EACT,sIAAsI;IACxI,OAAO,EAAE,mCAAmC;IAC5C,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,GAAG,eAAe,CAAC,KAAK;KACzB,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QAC7D,GAAG,gBAAgB,CAAC,KAAK;KAC1B,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,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