@owox/backend 0.30.0 → 0.30.1

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.
Files changed (46) hide show
  1. package/dist/src/data-marts/dto/domain/list-data-marts.command.d.ts +3 -1
  2. package/dist/src/data-marts/dto/domain/list-data-marts.command.js +3 -1
  3. package/dist/src/data-marts/facades/mcp-data-marts.facade.d.ts +13 -0
  4. package/dist/src/data-marts/facades/mcp-data-marts.facade.impl.d.ts +2 -1
  5. package/dist/src/data-marts/facades/mcp-data-marts.facade.impl.js +31 -7
  6. package/dist/src/data-marts/services/blended-field-display-name.d.ts +7 -0
  7. package/dist/src/data-marts/services/blended-field-display-name.js +8 -0
  8. package/dist/src/data-marts/services/blended-report-data.service.js +2 -1
  9. package/dist/src/data-marts/services/data-mart.service.d.ts +2 -0
  10. package/dist/src/data-marts/services/data-mart.service.js +3 -0
  11. package/dist/src/data-marts/services/report-sql-composer.service.js +2 -1
  12. package/dist/src/data-marts/use-cases/list-data-marts.service.js +1 -0
  13. package/dist/src/data-marts/use-cases/query-data-mart.service.js +13 -2
  14. package/dist/src/ee/mcp/instructions/mcp-system-instructions.d.ts +1 -1
  15. package/dist/src/ee/mcp/instructions/mcp-system-instructions.js +4 -2
  16. package/dist/src/ee/mcp/tools/add-destination.tool.d.ts +1 -0
  17. package/dist/src/ee/mcp/tools/add-destination.tool.js +7 -0
  18. package/dist/src/ee/mcp/tools/create-report-run-schedule.tool.d.ts +4 -1
  19. package/dist/src/ee/mcp/tools/create-report-run-schedule.tool.js +9 -2
  20. package/dist/src/ee/mcp/tools/data-mart-catalog.tool.d.ts +24 -4
  21. package/dist/src/ee/mcp/tools/data-mart-catalog.tool.js +29 -11
  22. package/dist/src/ee/mcp/tools/data-mart-details.tool.d.ts +16 -2
  23. package/dist/src/ee/mcp/tools/data-mart-details.tool.js +25 -4
  24. package/dist/src/ee/mcp/tools/data-mart-ui-path.d.ts +2 -0
  25. package/dist/src/ee/mcp/tools/data-mart-ui-path.js +9 -0
  26. package/dist/src/ee/mcp/tools/delete-report-run-schedule.tool.d.ts +4 -1
  27. package/dist/src/ee/mcp/tools/delete-report-run-schedule.tool.js +9 -2
  28. package/dist/src/ee/mcp/tools/get-data-mart-reports.tool.d.ts +9 -1
  29. package/dist/src/ee/mcp/tools/get-data-mart-reports.tool.js +18 -3
  30. package/dist/src/ee/mcp/tools/list-destinations.tool.d.ts +6 -1
  31. package/dist/src/ee/mcp/tools/list-destinations.tool.js +15 -3
  32. package/dist/src/ee/mcp/tools/list-report-run-schedules.tool.d.ts +16 -1
  33. package/dist/src/ee/mcp/tools/list-report-run-schedules.tool.js +21 -6
  34. package/dist/src/ee/mcp/tools/mcp-project-summary.util.d.ts +7 -0
  35. package/dist/src/ee/mcp/tools/mcp-project-summary.util.js +17 -0
  36. package/dist/src/ee/mcp/tools/query-data-mart.tool.d.ts +65 -2
  37. package/dist/src/ee/mcp/tools/query-data-mart.tool.js +72 -8
  38. package/dist/src/ee/mcp/tools/search-data-marts.tool.d.ts +13 -1
  39. package/dist/src/ee/mcp/tools/search-data-marts.tool.js +21 -11
  40. package/dist/src/ee/mcp/tools/summarize-data-catalog.tool.d.ts +13 -1
  41. package/dist/src/ee/mcp/tools/summarize-data-catalog.tool.js +17 -7
  42. package/dist/src/ee/mcp/tools/tabular-serializer.d.ts +6 -0
  43. package/dist/src/ee/mcp/tools/tabular-serializer.js +32 -3
  44. package/dist/src/ee/mcp/tools/update-report-run-schedule.tool.d.ts +4 -1
  45. package/dist/src/ee/mcp/tools/update-report-run-schedule.tool.js +9 -2
  46. package/package.json +4 -4
@@ -1,45 +1,57 @@
1
1
  import { z } from 'zod';
2
2
  import type { McpScope } from '@owox/idp-protocol';
3
3
  import { type McpDataMartsFacade } from '../../../data-marts/facades/mcp-data-marts.facade';
4
+ import { PublicOriginService } from '../../../common/config/public-origin.service';
4
5
  import type { McpAuthContext } from '../auth/mcp-auth-context';
5
6
  import { type McpToolDefinition, type McpToolResult } from './mcp-tool.definition';
6
7
  declare const inputSchema: z.ZodObject<{
7
8
  data_mart_id: z.ZodString;
9
+ detail_level: z.ZodOptional<z.ZodEnum<["native", "with_joined_fields"]>>;
8
10
  }, "strict", z.ZodTypeAny, {
9
11
  data_mart_id: string;
12
+ detail_level?: "native" | "with_joined_fields" | undefined;
10
13
  }, {
11
14
  data_mart_id: string;
15
+ detail_level?: "native" | "with_joined_fields" | undefined;
12
16
  }>;
13
17
  type GetDataMartDetailsInput = z.infer<typeof inputSchema>;
14
18
  export declare class GetDataMartDetailsTool implements McpToolDefinition<GetDataMartDetailsInput> {
15
19
  private readonly dataMarts;
20
+ private readonly publicOriginService;
16
21
  readonly name = "get_data_mart_details_by_id";
17
- readonly description = "Get available details for a specific OWOX Data Mart by data_mart_id, including id, name, description, output fields (native), and joined_fields contributed by blended/joined data marts. Native fields and joined_fields are both queryable in query_data_mart \u2014 reference joined_fields by their qualified <alias>__<field> name; joined_fields can additionally be used in query_data_mart slices (pre-join filters). This tool is optional in the discovery flow: get_relevant_data_marts_by_prompt finds relevant Data Marts, and this tool adds field-level metadata for a selected Data Mart. It does not return data owners, data freshness, sample values, or actual data rows.";
22
+ readonly description = "Get available details for a specific published OWOX Data Mart by data_mart_id, including its URL, native output fields, and (only on explicit request) joined_fields contributed by blended/joined data marts. Use detail_level=native by default: it avoids exposing irrelevant joined fields and keeps the response fast. Request detail_level=with_joined_fields only when the question truly needs a joined Data Mart. Use displayName for user-facing wording and copy name verbatim into query_data_mart. This tool is optional in the discovery flow: get_relevant_data_marts_by_prompt finds relevant Data Marts, and this tool adds field-level metadata for a selected Data Mart. It does not return data owners, data freshness, sample values, or actual data rows.";
18
23
  readonly zodSchema: {
19
24
  data_mart_id: z.ZodString;
25
+ detail_level: z.ZodOptional<z.ZodEnum<["native", "with_joined_fields"]>>;
20
26
  };
21
27
  readonly outputSchema: {
22
28
  id: z.ZodString;
23
29
  name: z.ZodString;
30
+ url: z.ZodString;
24
31
  description: z.ZodString;
25
32
  fields: z.ZodArray<z.ZodObject<{
26
33
  name: z.ZodString;
27
34
  type: z.ZodString;
28
35
  description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
29
36
  businessName: z.ZodOptional<z.ZodString>;
37
+ displayName: z.ZodOptional<z.ZodString>;
30
38
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
31
39
  name: z.ZodString;
32
40
  type: z.ZodString;
33
41
  description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
34
42
  businessName: z.ZodOptional<z.ZodString>;
43
+ displayName: z.ZodOptional<z.ZodString>;
35
44
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
36
45
  name: z.ZodString;
37
46
  type: z.ZodString;
38
47
  description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
39
48
  businessName: z.ZodOptional<z.ZodString>;
49
+ displayName: z.ZodOptional<z.ZodString>;
40
50
  }, z.ZodTypeAny, "passthrough">>, "many">;
51
+ joined_fields_included: z.ZodBoolean;
41
52
  joined_fields: z.ZodArray<z.ZodObject<{
42
53
  name: z.ZodString;
54
+ displayName: z.ZodString;
43
55
  type: z.ZodString;
44
56
  description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
45
57
  sourceDataMart: z.ZodString;
@@ -47,6 +59,7 @@ export declare class GetDataMartDetailsTool implements McpToolDefinition<GetData
47
59
  allowedAggregations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
48
60
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
49
61
  name: z.ZodString;
62
+ displayName: z.ZodString;
50
63
  type: z.ZodString;
51
64
  description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
52
65
  sourceDataMart: z.ZodString;
@@ -54,6 +67,7 @@ export declare class GetDataMartDetailsTool implements McpToolDefinition<GetData
54
67
  allowedAggregations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
55
68
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
56
69
  name: z.ZodString;
70
+ displayName: z.ZodString;
57
71
  type: z.ZodString;
58
72
  description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
59
73
  sourceDataMart: z.ZodString;
@@ -68,7 +82,7 @@ export declare class GetDataMartDetailsTool implements McpToolDefinition<GetData
68
82
  openWorldHint: boolean;
69
83
  };
70
84
  readonly requiredScopes: McpScope[];
71
- constructor(dataMarts: McpDataMartsFacade);
85
+ constructor(dataMarts: McpDataMartsFacade, publicOriginService: PublicOriginService);
72
86
  parseInput(input: unknown): GetDataMartDetailsInput;
73
87
  handler(input: GetDataMartDetailsInput, context: McpAuthContext): Promise<McpToolResult>;
74
88
  }
@@ -16,10 +16,17 @@ exports.GetDataMartDetailsTool = void 0;
16
16
  const common_1 = require("@nestjs/common");
17
17
  const zod_1 = require("zod");
18
18
  const mcp_data_marts_facade_1 = require("../../../data-marts/facades/mcp-data-marts.facade");
19
+ const public_origin_service_1 = require("../../../common/config/public-origin.service");
19
20
  const mcp_tool_definition_1 = require("./mcp-tool.definition");
21
+ const data_mart_ui_path_1 = require("./data-mart-ui-path");
22
+ const mcp_public_url_util_1 = require("./mcp-public-url.util");
20
23
  const inputSchema = zod_1.z
21
24
  .object({
22
25
  data_mart_id: zod_1.z.string().trim().min(1),
26
+ detail_level: zod_1.z
27
+ .enum(['native', 'with_joined_fields'])
28
+ .optional()
29
+ .describe('Use native (default) for ordinary queries. Request with_joined_fields only when the answer requires data from a joined Data Mart.'),
23
30
  })
24
31
  .strict();
25
32
  const DataMartFieldSchema = zod_1.z
@@ -28,6 +35,7 @@ const DataMartFieldSchema = zod_1.z
28
35
  type: zod_1.z.string(),
29
36
  description: zod_1.z.string().optional().nullable(),
30
37
  businessName: zod_1.z.string().optional(),
38
+ displayName: zod_1.z.string().optional(),
31
39
  })
32
40
  .passthrough();
33
41
  const JoinedFieldSchema = zod_1.z
@@ -35,6 +43,9 @@ const JoinedFieldSchema = zod_1.z
35
43
  name: zod_1.z
36
44
  .string()
37
45
  .describe('Qualified field name (<alias>__<field>) — copy verbatim into query_data_mart fields/slices/filters.'),
46
+ displayName: zod_1.z
47
+ .string()
48
+ .describe('Business-friendly label for presentation; use name for queries.'),
38
49
  type: zod_1.z
39
50
  .string()
40
51
  .describe('Type in the blended result — use it to pick operators for filters and functions for aggregations. For a slice, use "sliceType" instead when it is present.'),
@@ -52,17 +63,22 @@ const JoinedFieldSchema = zod_1.z
52
63
  .passthrough();
53
64
  let GetDataMartDetailsTool = class GetDataMartDetailsTool {
54
65
  dataMarts;
66
+ publicOriginService;
55
67
  name = 'get_data_mart_details_by_id';
56
- description = 'Get available details for a specific OWOX Data Mart by data_mart_id, including id, name, description, output fields (native), and joined_fields contributed by blended/joined data marts. Native fields and joined_fields are both queryable in query_data_mart reference joined_fields by their qualified <alias>__<field> name; joined_fields can additionally be used in query_data_mart slices (pre-join filters). This tool is optional in the discovery flow: get_relevant_data_marts_by_prompt finds relevant Data Marts, and this tool adds field-level metadata for a selected Data Mart. It does not return data owners, data freshness, sample values, or actual data rows.';
68
+ description = 'Get available details for a specific published OWOX Data Mart by data_mart_id, including its URL, native output fields, and (only on explicit request) joined_fields contributed by blended/joined data marts. Use detail_level=native by default: it avoids exposing irrelevant joined fields and keeps the response fast. Request detail_level=with_joined_fields only when the question truly needs a joined Data Mart. Use displayName for user-facing wording and copy name verbatim into query_data_mart. This tool is optional in the discovery flow: get_relevant_data_marts_by_prompt finds relevant Data Marts, and this tool adds field-level metadata for a selected Data Mart. It does not return data owners, data freshness, sample values, or actual data rows.';
57
69
  zodSchema = inputSchema.shape;
58
70
  outputSchema = {
59
71
  id: zod_1.z.string().describe('Data mart identifier.'),
60
72
  name: zod_1.z.string().describe('Data mart display name.'),
73
+ url: zod_1.z.string().describe('Open this Data Mart in OWOX.'),
61
74
  description: zod_1.z.string().describe('Data mart description.'),
62
75
  fields: zod_1.z.array(DataMartFieldSchema).describe("The data mart's own (native) output fields."),
76
+ joined_fields_included: zod_1.z
77
+ .boolean()
78
+ .describe('Whether joined_fields were requested and evaluated. false means joined fields were intentionally omitted; true means an empty joined_fields array has no accessible joined fields.'),
63
79
  joined_fields: zod_1.z
64
80
  .array(JoinedFieldSchema)
65
- .describe('Fields available from joined/blended data marts. Empty when the data mart has no joins. Reference each by its exact "name" in query_data_mart; because they come from a joined data mart they may also be used in "slices".'),
81
+ .describe('Fields available from joined/blended data marts when joined_fields_included is true. Reference each by its exact "name" in query_data_mart; because they come from a joined data mart they may also be used in "slices".'),
66
82
  };
67
83
  annotations = {
68
84
  title: 'Get Data Mart Details',
@@ -71,25 +87,30 @@ let GetDataMartDetailsTool = class GetDataMartDetailsTool {
71
87
  openWorldHint: false,
72
88
  };
73
89
  requiredScopes = ['mcp:read'];
74
- constructor(dataMarts) {
90
+ constructor(dataMarts, publicOriginService) {
75
91
  this.dataMarts = dataMarts;
92
+ this.publicOriginService = publicOriginService;
76
93
  }
77
94
  parseInput(input) {
78
95
  return inputSchema.parse(input);
79
96
  }
80
97
  async handler(input, context) {
81
98
  const parsed = this.parseInput(input);
99
+ const includeJoinedFields = parsed.detail_level === 'with_joined_fields';
82
100
  const result = await this.dataMarts.getDataMartDetails({
83
101
  projectId: context.projectId,
84
102
  userId: context.userId,
85
103
  roles: context.roles,
86
104
  dataMartId: parsed.data_mart_id,
105
+ includeJoinedFields,
87
106
  });
88
107
  const structuredContent = {
89
108
  id: result.id,
90
109
  name: result.name,
110
+ url: (0, mcp_public_url_util_1.joinPublicOrigin)(this.publicOriginService.getPublicOrigin(), (0, data_mart_ui_path_1.buildDataMartUiPath)(context.projectId, result.id)),
91
111
  description: result.description,
92
112
  fields: result.fields,
113
+ joined_fields_included: includeJoinedFields,
93
114
  joined_fields: result.joinedFields,
94
115
  };
95
116
  return (0, mcp_tool_definition_1.jsonToolResult)(structuredContent);
@@ -99,6 +120,6 @@ exports.GetDataMartDetailsTool = GetDataMartDetailsTool;
99
120
  exports.GetDataMartDetailsTool = GetDataMartDetailsTool = __decorate([
100
121
  (0, common_1.Injectable)(),
101
122
  __param(0, (0, common_1.Inject)(mcp_data_marts_facade_1.MCP_DATA_MARTS_FACADE)),
102
- __metadata("design:paramtypes", [Object])
123
+ __metadata("design:paramtypes", [Object, public_origin_service_1.PublicOriginService])
103
124
  ], GetDataMartDetailsTool);
104
125
  //# sourceMappingURL=data-mart-details.tool.js.map
@@ -1,2 +1,4 @@
1
1
  export declare function buildDataMartUiPath(projectId: string, dataMartId: string): string;
2
2
  export declare function buildReportsUiPath(projectId: string, dataMartId: string): string;
3
+ export declare function buildDataDestinationsUiPath(projectId: string, destinationId?: string): string;
4
+ export declare function buildReportSchedulesUiPath(projectId: string): string;
@@ -2,10 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildDataMartUiPath = buildDataMartUiPath;
4
4
  exports.buildReportsUiPath = buildReportsUiPath;
5
+ exports.buildDataDestinationsUiPath = buildDataDestinationsUiPath;
6
+ exports.buildReportSchedulesUiPath = buildReportSchedulesUiPath;
5
7
  function buildDataMartUiPath(projectId, dataMartId) {
6
8
  return `/ui/${encodeURIComponent(projectId)}/data-marts/${encodeURIComponent(dataMartId)}/data-setup`;
7
9
  }
8
10
  function buildReportsUiPath(projectId, dataMartId) {
9
11
  return `/ui/${encodeURIComponent(projectId)}/data-marts/${encodeURIComponent(dataMartId)}/reports`;
10
12
  }
13
+ function buildDataDestinationsUiPath(projectId, destinationId) {
14
+ const base = `/ui/${encodeURIComponent(projectId)}/data-destinations`;
15
+ return destinationId ? `${base}?id=${encodeURIComponent(destinationId)}` : base;
16
+ }
17
+ function buildReportSchedulesUiPath(projectId) {
18
+ return `/ui/${encodeURIComponent(projectId)}/data-marts/schedules`;
19
+ }
11
20
  //# sourceMappingURL=data-mart-ui-path.js.map
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import type { McpScope } from '@owox/idp-protocol';
3
+ import { PublicOriginService } from '../../../common/config/public-origin.service';
3
4
  import { type McpScheduledTriggersFacade } from '../../../data-marts/facades/mcp-scheduled-triggers.facade';
4
5
  import type { McpAuthContext } from '../auth/mcp-auth-context';
5
6
  import { type McpToolDefinition, type McpToolResult } from './mcp-tool.definition';
@@ -13,6 +14,7 @@ declare const inputSchema: z.ZodObject<{
13
14
  type DeleteReportRunScheduleInput = z.infer<typeof inputSchema>;
14
15
  export declare class DeleteReportRunScheduleTool implements McpToolDefinition<DeleteReportRunScheduleInput> {
15
16
  private readonly facade;
17
+ private readonly publicOriginService;
16
18
  readonly name = "delete_report_run_schedule";
17
19
  readonly description = "Removes the single report run schedule identified by trigger_id (get it from list_report_run_schedules). Only that schedule is removed \u2014 the Report and any other schedules it may have are left intact. The response echoes the removed trigger_id and report_id with schedule: null to confirm that specific schedule is gone; check list_report_run_schedules if you need to know whether other schedules remain.";
18
20
  readonly zodSchema: {
@@ -21,6 +23,7 @@ export declare class DeleteReportRunScheduleTool implements McpToolDefinition<De
21
23
  readonly outputSchema: {
22
24
  trigger_id: z.ZodString;
23
25
  report_id: z.ZodNullable<z.ZodString>;
26
+ schedules_url: z.ZodString;
24
27
  schedule: z.ZodNull;
25
28
  };
26
29
  readonly annotations: {
@@ -30,7 +33,7 @@ export declare class DeleteReportRunScheduleTool implements McpToolDefinition<De
30
33
  openWorldHint: boolean;
31
34
  };
32
35
  readonly requiredScopes: McpScope[];
33
- constructor(facade: McpScheduledTriggersFacade);
36
+ constructor(facade: McpScheduledTriggersFacade, publicOriginService: PublicOriginService);
34
37
  parseInput(input: unknown): DeleteReportRunScheduleInput;
35
38
  handler(input: DeleteReportRunScheduleInput, context: McpAuthContext): Promise<McpToolResult>;
36
39
  }
@@ -15,8 +15,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.DeleteReportRunScheduleTool = void 0;
16
16
  const common_1 = require("@nestjs/common");
17
17
  const zod_1 = require("zod");
18
+ const public_origin_service_1 = require("../../../common/config/public-origin.service");
18
19
  const mcp_scheduled_triggers_facade_1 = require("../../../data-marts/facades/mcp-scheduled-triggers.facade");
19
20
  const mcp_tool_definition_1 = require("./mcp-tool.definition");
21
+ const data_mart_ui_path_1 = require("./data-mart-ui-path");
22
+ const mcp_public_url_util_1 = require("./mcp-public-url.util");
20
23
  const inputSchema = zod_1.z
21
24
  .object({
22
25
  trigger_id: zod_1.z.string().trim().min(1),
@@ -24,12 +27,14 @@ const inputSchema = zod_1.z
24
27
  .strict();
25
28
  let DeleteReportRunScheduleTool = class DeleteReportRunScheduleTool {
26
29
  facade;
30
+ publicOriginService;
27
31
  name = 'delete_report_run_schedule';
28
32
  description = 'Removes the single report run schedule identified by trigger_id (get it from list_report_run_schedules). Only that schedule is removed — the Report and any other schedules it may have are left intact. The response echoes the removed trigger_id and report_id with schedule: null to confirm that specific schedule is gone; check list_report_run_schedules if you need to know whether other schedules remain.';
29
33
  zodSchema = inputSchema.shape;
30
34
  outputSchema = {
31
35
  trigger_id: zod_1.z.string(),
32
36
  report_id: zod_1.z.string().nullable(),
37
+ schedules_url: zod_1.z.string().describe('Open report schedules in OWOX.'),
33
38
  schedule: zod_1.z.null(),
34
39
  };
35
40
  annotations = {
@@ -39,8 +44,9 @@ let DeleteReportRunScheduleTool = class DeleteReportRunScheduleTool {
39
44
  openWorldHint: false,
40
45
  };
41
46
  requiredScopes = ['mcp:read', 'mcp:write'];
42
- constructor(facade) {
47
+ constructor(facade, publicOriginService) {
43
48
  this.facade = facade;
49
+ this.publicOriginService = publicOriginService;
44
50
  }
45
51
  parseInput(input) {
46
52
  return inputSchema.parse(input);
@@ -54,6 +60,7 @@ let DeleteReportRunScheduleTool = class DeleteReportRunScheduleTool {
54
60
  const structuredContent = {
55
61
  trigger_id: result.triggerId,
56
62
  report_id: result.reportId,
63
+ schedules_url: (0, mcp_public_url_util_1.joinPublicOrigin)(this.publicOriginService.getPublicOrigin(), (0, data_mart_ui_path_1.buildReportSchedulesUiPath)(context.projectId)),
57
64
  schedule: null,
58
65
  };
59
66
  return (0, mcp_tool_definition_1.jsonToolResult)(structuredContent);
@@ -63,6 +70,6 @@ exports.DeleteReportRunScheduleTool = DeleteReportRunScheduleTool;
63
70
  exports.DeleteReportRunScheduleTool = DeleteReportRunScheduleTool = __decorate([
64
71
  (0, common_1.Injectable)(),
65
72
  __param(0, (0, common_1.Inject)(mcp_scheduled_triggers_facade_1.MCP_SCHEDULED_TRIGGERS_FACADE)),
66
- __metadata("design:paramtypes", [Object])
73
+ __metadata("design:paramtypes", [Object, public_origin_service_1.PublicOriginService])
67
74
  ], DeleteReportRunScheduleTool);
68
75
  //# sourceMappingURL=delete-report-run-schedule.tool.js.map
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import type { McpScope } from '@owox/idp-protocol';
3
+ import { PublicOriginService } from '../../../common/config/public-origin.service';
3
4
  import { ReportRunStatus } from '../../../data-marts/enums/report-run-status.enum';
4
5
  import { type McpReportsFacade } from '../../../data-marts/facades/mcp-reports.facade';
5
6
  import type { McpAuthContext } from '../auth/mcp-auth-context';
@@ -14,6 +15,7 @@ declare const inputSchema: z.ZodObject<{
14
15
  type GetDataMartReportsInput = z.infer<typeof inputSchema>;
15
16
  export declare class GetDataMartReportsTool implements McpToolDefinition<GetDataMartReportsInput> {
16
17
  private readonly reports;
18
+ private readonly publicOriginService;
17
19
  readonly name = "get_data_mart_reports";
18
20
  readonly description = "List the reports tied to a data mart in the active OWOX project, including each report destination, run schedules (a report can have any number of schedule triggers), and last run status.";
19
21
  readonly zodSchema: {
@@ -22,9 +24,11 @@ export declare class GetDataMartReportsTool implements McpToolDefinition<GetData
22
24
  readonly outputSchema: {
23
25
  reports: z.ZodArray<z.ZodObject<{
24
26
  report_id: z.ZodString;
27
+ report_url: z.ZodString;
25
28
  data_mart_id: z.ZodString;
26
29
  name: z.ZodString;
27
30
  destination_id: z.ZodString;
31
+ destination_url: z.ZodString;
28
32
  destination_type: z.ZodEnum<["google_sheets", "looker_studio", "email", "slack", "teams", "google_chat"]>;
29
33
  owner: z.ZodNullable<z.ZodString>;
30
34
  schedules: z.ZodArray<z.ZodObject<{
@@ -58,6 +62,8 @@ export declare class GetDataMartReportsTool implements McpToolDefinition<GetData
58
62
  report_id: string;
59
63
  destination_type: "email" | "looker_studio" | "google_sheets" | "slack" | "teams" | "google_chat";
60
64
  owner: string | null;
65
+ report_url: string;
66
+ destination_url: string;
61
67
  schedules: {
62
68
  cron_expression: string;
63
69
  time_zone: string;
@@ -75,6 +81,8 @@ export declare class GetDataMartReportsTool implements McpToolDefinition<GetData
75
81
  report_id: string;
76
82
  destination_type: "email" | "looker_studio" | "google_sheets" | "slack" | "teams" | "google_chat";
77
83
  owner: string | null;
84
+ report_url: string;
85
+ destination_url: string;
78
86
  schedules: {
79
87
  cron_expression: string;
80
88
  time_zone: string;
@@ -94,7 +102,7 @@ export declare class GetDataMartReportsTool implements McpToolDefinition<GetData
94
102
  openWorldHint: boolean;
95
103
  };
96
104
  readonly requiredScopes: McpScope[];
97
- constructor(reports: McpReportsFacade);
105
+ constructor(reports: McpReportsFacade, publicOriginService: PublicOriginService);
98
106
  parseInput(input: unknown): GetDataMartReportsInput;
99
107
  handler(input: GetDataMartReportsInput, context: McpAuthContext): Promise<McpToolResult>;
100
108
  }
@@ -15,22 +15,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.GetDataMartReportsTool = void 0;
16
16
  const common_1 = require("@nestjs/common");
17
17
  const zod_1 = require("zod");
18
+ const public_origin_service_1 = require("../../../common/config/public-origin.service");
18
19
  const mcp_destination_type_1 = require("../../../data-marts/facades/mcp-destination-type");
19
20
  const report_run_status_enum_1 = require("../../../data-marts/enums/report-run-status.enum");
20
21
  const mcp_reports_facade_1 = require("../../../data-marts/facades/mcp-reports.facade");
21
22
  const mcp_tool_definition_1 = require("./mcp-tool.definition");
23
+ const data_mart_ui_path_1 = require("./data-mart-ui-path");
24
+ const mcp_public_url_util_1 = require("./mcp-public-url.util");
22
25
  const inputSchema = zod_1.z.object({ data_mart_id: zod_1.z.string().min(1) }).strict();
23
26
  let GetDataMartReportsTool = class GetDataMartReportsTool {
24
27
  reports;
28
+ publicOriginService;
25
29
  name = 'get_data_mart_reports';
26
30
  description = 'List the reports tied to a data mart in the active OWOX project, including each report destination, run schedules (a report can have any number of schedule triggers), and last run status.';
27
31
  zodSchema = inputSchema.shape;
28
32
  outputSchema = {
29
33
  reports: zod_1.z.array(zod_1.z.object({
30
34
  report_id: zod_1.z.string(),
35
+ report_url: zod_1.z.string().describe('Open this Data Mart reports page in OWOX.'),
31
36
  data_mart_id: zod_1.z.string(),
32
37
  name: zod_1.z.string(),
33
38
  destination_id: zod_1.z.string(),
39
+ destination_url: zod_1.z.string().describe('Open the report destination in OWOX.'),
34
40
  destination_type: zod_1.z.enum(mcp_destination_type_1.MCP_DESTINATION_TYPES),
35
41
  owner: zod_1.z.string().nullable(),
36
42
  schedules: zod_1.z.array(zod_1.z.object({
@@ -52,8 +58,9 @@ let GetDataMartReportsTool = class GetDataMartReportsTool {
52
58
  openWorldHint: false,
53
59
  };
54
60
  requiredScopes = ['mcp:read'];
55
- constructor(reports) {
61
+ constructor(reports, publicOriginService) {
56
62
  this.reports = reports;
63
+ this.publicOriginService = publicOriginService;
57
64
  }
58
65
  parseInput(input) {
59
66
  return inputSchema.parse(input);
@@ -66,7 +73,15 @@ let GetDataMartReportsTool = class GetDataMartReportsTool {
66
73
  userId: context.userId,
67
74
  roles: context.roles,
68
75
  });
69
- const structuredContent = { reports: result.reports };
76
+ const publicOrigin = this.publicOriginService.getPublicOrigin();
77
+ const reportUrl = (0, mcp_public_url_util_1.joinPublicOrigin)(publicOrigin, (0, data_mart_ui_path_1.buildReportsUiPath)(context.projectId, data_mart_id));
78
+ const structuredContent = {
79
+ reports: result.reports.map(report => ({
80
+ ...report,
81
+ report_url: reportUrl,
82
+ destination_url: (0, mcp_public_url_util_1.joinPublicOrigin)(publicOrigin, (0, data_mart_ui_path_1.buildDataDestinationsUiPath)(context.projectId, report.destination_id)),
83
+ })),
84
+ };
70
85
  return (0, mcp_tool_definition_1.jsonToolResult)(structuredContent);
71
86
  }
72
87
  };
@@ -74,6 +89,6 @@ exports.GetDataMartReportsTool = GetDataMartReportsTool;
74
89
  exports.GetDataMartReportsTool = GetDataMartReportsTool = __decorate([
75
90
  (0, common_1.Injectable)(),
76
91
  __param(0, (0, common_1.Inject)(mcp_reports_facade_1.MCP_REPORTS_FACADE)),
77
- __metadata("design:paramtypes", [Object])
92
+ __metadata("design:paramtypes", [Object, public_origin_service_1.PublicOriginService])
78
93
  ], GetDataMartReportsTool);
79
94
  //# sourceMappingURL=get-data-mart-reports.tool.js.map
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import type { McpScope } from '@owox/idp-protocol';
3
+ import { PublicOriginService } from '../../../common/config/public-origin.service';
3
4
  import { type McpDataDestinationsFacade } from '../../../data-marts/facades/mcp-data-destinations.facade';
4
5
  import type { McpAuthContext } from '../auth/mcp-auth-context';
5
6
  import { type McpToolDefinition, type McpToolResult } from './mcp-tool.definition';
@@ -7,12 +8,14 @@ declare const inputSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
7
8
  type ListDestinationsInput = z.infer<typeof inputSchema>;
8
9
  export declare class ListDestinationsTool implements McpToolDefinition<ListDestinationsInput> {
9
10
  private readonly destinations;
11
+ private readonly publicOriginService;
10
12
  readonly name = "list_destinations";
11
13
  readonly description: string;
12
14
  readonly zodSchema: {};
13
15
  readonly outputSchema: {
14
16
  destinations: z.ZodArray<z.ZodObject<{
15
17
  id: z.ZodString;
18
+ url: z.ZodString;
16
19
  name: z.ZodString;
17
20
  type: z.ZodEnum<["google_sheets", "looker_studio", "email", "slack", "teams", "google_chat"]>;
18
21
  owner: z.ZodNullable<z.ZodString>;
@@ -23,6 +26,7 @@ export declare class ListDestinationsTool implements McpToolDefinition<ListDesti
23
26
  createdAt: string;
24
27
  id: string;
25
28
  name: string;
29
+ url: string;
26
30
  owner: string | null;
27
31
  connectedGoogleAccount?: string | null | undefined;
28
32
  }, {
@@ -30,6 +34,7 @@ export declare class ListDestinationsTool implements McpToolDefinition<ListDesti
30
34
  createdAt: string;
31
35
  id: string;
32
36
  name: string;
37
+ url: string;
33
38
  owner: string | null;
34
39
  connectedGoogleAccount?: string | null | undefined;
35
40
  }>, "many">;
@@ -41,7 +46,7 @@ export declare class ListDestinationsTool implements McpToolDefinition<ListDesti
41
46
  openWorldHint: boolean;
42
47
  };
43
48
  readonly requiredScopes: McpScope[];
44
- constructor(destinations: McpDataDestinationsFacade);
49
+ constructor(destinations: McpDataDestinationsFacade, publicOriginService: PublicOriginService);
45
50
  parseInput(input: unknown): ListDestinationsInput;
46
51
  handler(input: ListDestinationsInput, context: McpAuthContext): Promise<McpToolResult>;
47
52
  }
@@ -15,12 +15,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.ListDestinationsTool = void 0;
16
16
  const common_1 = require("@nestjs/common");
17
17
  const zod_1 = require("zod");
18
+ const public_origin_service_1 = require("../../../common/config/public-origin.service");
18
19
  const mcp_data_destinations_facade_1 = require("../../../data-marts/facades/mcp-data-destinations.facade");
19
20
  const mcp_destination_type_1 = require("../../../data-marts/facades/mcp-destination-type");
20
21
  const mcp_tool_definition_1 = require("./mcp-tool.definition");
22
+ const data_mart_ui_path_1 = require("./data-mart-ui-path");
23
+ const mcp_public_url_util_1 = require("./mcp-public-url.util");
21
24
  const inputSchema = zod_1.z.object({}).strict();
22
25
  let ListDestinationsTool = class ListDestinationsTool {
23
26
  destinations;
27
+ publicOriginService;
24
28
  name = 'list_destinations';
25
29
  description = 'List destinations in the active OWOX project to target when creating a report. ' +
26
30
  'Also the only way to learn the destination_id and connected Google account for a ' +
@@ -39,6 +43,7 @@ let ListDestinationsTool = class ListDestinationsTool {
39
43
  outputSchema = {
40
44
  destinations: zod_1.z.array(zod_1.z.object({
41
45
  id: zod_1.z.string(),
46
+ url: zod_1.z.string().describe('Open this destination in OWOX.'),
42
47
  name: zod_1.z.string(),
43
48
  type: zod_1.z.enum(mcp_destination_type_1.MCP_DESTINATION_TYPES),
44
49
  owner: zod_1.z.string().nullable(),
@@ -65,8 +70,9 @@ let ListDestinationsTool = class ListDestinationsTool {
65
70
  openWorldHint: false,
66
71
  };
67
72
  requiredScopes = ['mcp:read'];
68
- constructor(destinations) {
73
+ constructor(destinations, publicOriginService) {
69
74
  this.destinations = destinations;
75
+ this.publicOriginService = publicOriginService;
70
76
  }
71
77
  parseInput(input) {
72
78
  return inputSchema.parse(input);
@@ -78,7 +84,13 @@ let ListDestinationsTool = class ListDestinationsTool {
78
84
  userId: context.userId,
79
85
  roles: context.roles,
80
86
  });
81
- const structuredContent = { destinations: result.destinations };
87
+ const publicOrigin = this.publicOriginService.getPublicOrigin();
88
+ const structuredContent = {
89
+ destinations: result.destinations.map(destination => ({
90
+ ...destination,
91
+ url: (0, mcp_public_url_util_1.joinPublicOrigin)(publicOrigin, (0, data_mart_ui_path_1.buildDataDestinationsUiPath)(context.projectId, destination.id)),
92
+ })),
93
+ };
82
94
  return (0, mcp_tool_definition_1.jsonToolResult)(structuredContent);
83
95
  }
84
96
  };
@@ -86,6 +98,6 @@ exports.ListDestinationsTool = ListDestinationsTool;
86
98
  exports.ListDestinationsTool = ListDestinationsTool = __decorate([
87
99
  (0, common_1.Injectable)(),
88
100
  __param(0, (0, common_1.Inject)(mcp_data_destinations_facade_1.MCP_DATA_DESTINATIONS_FACADE)),
89
- __metadata("design:paramtypes", [Object])
101
+ __metadata("design:paramtypes", [Object, public_origin_service_1.PublicOriginService])
90
102
  ], ListDestinationsTool);
91
103
  //# sourceMappingURL=list-destinations.tool.js.map
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import type { McpScope } from '@owox/idp-protocol';
3
+ import { PublicOriginService } from '../../../common/config/public-origin.service';
3
4
  import { type McpScheduledTriggersFacade } from '../../../data-marts/facades/mcp-scheduled-triggers.facade';
4
5
  import type { McpAuthContext } from '../auth/mcp-auth-context';
5
6
  import { type McpToolDefinition, type McpToolResult } from './mcp-tool.definition';
@@ -7,6 +8,7 @@ declare const inputSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
7
8
  type ListReportRunSchedulesInput = z.infer<typeof inputSchema>;
8
9
  export declare class ListReportRunSchedulesTool implements McpToolDefinition<ListReportRunSchedulesInput> {
9
10
  private readonly facade;
11
+ private readonly publicOriginService;
10
12
  readonly name = "list_report_run_schedules";
11
13
  readonly description = "Lists every scheduled REPORT_RUN trigger (report run schedule) in the current OWOX project that the current MCP user can see, in a single response. Each item includes trigger_id \u2014 pass it to update_report_run_schedule to modify that specific schedule or delete_report_run_schedule to remove it \u2014 plus the report and data mart it belongs to. To add another schedule for a report, call create_report_run_schedule; creating never replaces existing schedules.";
12
14
  readonly zodSchema: {};
@@ -16,23 +18,30 @@ export declare class ListReportRunSchedulesTool implements McpToolDefinition<Lis
16
18
  report: z.ZodObject<{
17
19
  id: z.ZodString;
18
20
  title: z.ZodString;
21
+ url: z.ZodString;
19
22
  }, "strip", z.ZodTypeAny, {
20
23
  id: string;
21
24
  title: string;
25
+ url: string;
22
26
  }, {
23
27
  id: string;
24
28
  title: string;
29
+ url: string;
25
30
  }>;
26
31
  data_mart: z.ZodObject<{
27
32
  id: z.ZodString;
28
33
  title: z.ZodString;
34
+ url: z.ZodString;
29
35
  }, "strip", z.ZodTypeAny, {
30
36
  id: string;
31
37
  title: string;
38
+ url: string;
32
39
  }, {
33
40
  id: string;
34
41
  title: string;
42
+ url: string;
35
43
  }>;
44
+ schedules_url: z.ZodString;
36
45
  cron_expression: z.ZodString;
37
46
  time_zone: z.ZodString;
38
47
  is_active: z.ZodBoolean;
@@ -44,16 +53,19 @@ export declare class ListReportRunSchedulesTool implements McpToolDefinition<Lis
44
53
  report: {
45
54
  id: string;
46
55
  title: string;
56
+ url: string;
47
57
  };
48
58
  cron_expression: string;
49
59
  time_zone: string;
50
60
  is_active: boolean;
51
61
  trigger_id: string;
62
+ schedules_url: string;
52
63
  next_run_at: string | null;
53
64
  last_run_at: string | null;
54
65
  data_mart: {
55
66
  id: string;
56
67
  title: string;
68
+ url: string;
57
69
  };
58
70
  can_edit: boolean;
59
71
  can_delete: boolean;
@@ -61,16 +73,19 @@ export declare class ListReportRunSchedulesTool implements McpToolDefinition<Lis
61
73
  report: {
62
74
  id: string;
63
75
  title: string;
76
+ url: string;
64
77
  };
65
78
  cron_expression: string;
66
79
  time_zone: string;
67
80
  is_active: boolean;
68
81
  trigger_id: string;
82
+ schedules_url: string;
69
83
  next_run_at: string | null;
70
84
  last_run_at: string | null;
71
85
  data_mart: {
72
86
  id: string;
73
87
  title: string;
88
+ url: string;
74
89
  };
75
90
  can_edit: boolean;
76
91
  can_delete: boolean;
@@ -83,7 +98,7 @@ export declare class ListReportRunSchedulesTool implements McpToolDefinition<Lis
83
98
  openWorldHint: boolean;
84
99
  };
85
100
  readonly requiredScopes: McpScope[];
86
- constructor(facade: McpScheduledTriggersFacade);
101
+ constructor(facade: McpScheduledTriggersFacade, publicOriginService: PublicOriginService);
87
102
  parseInput(input: unknown): ListReportRunSchedulesInput;
88
103
  handler(input: ListReportRunSchedulesInput, context: McpAuthContext): Promise<McpToolResult>;
89
104
  }