@apex-inc/mcp-server 0.71.0 → 0.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/setup-catchup-tools.d.ts +22 -9
- package/dist/setup-catchup-tools.d.ts.map +1 -1
- package/dist/setup-catchup-tools.js +106 -15
- package/dist/setup-catchup-tools.js.map +1 -1
- package/dist/setup-checklist.d.ts +1 -0
- package/dist/setup-checklist.d.ts.map +1 -1
- package/dist/setup-checklist.js +2 -1
- package/dist/setup-checklist.js.map +1 -1
- package/dist/tool-groups.d.ts.map +1 -1
- package/dist/tool-groups.js +3 -0
- package/dist/tool-groups.js.map +1 -1
- package/dist/tools/experiments.js +1 -1
- package/dist/tools/experiments.js.map +1 -1
- package/dist/tools/letters.d.ts +200 -1
- package/dist/tools/letters.d.ts.map +1 -1
- package/dist/tools/letters.js +134 -6
- package/dist/tools/letters.js.map +1 -1
- package/dist/tools/measurement.d.ts +29 -6
- package/dist/tools/measurement.d.ts.map +1 -1
- package/dist/tools/measurement.js +36 -4
- package/dist/tools/measurement.js.map +1 -1
- package/dist/tools/partners.d.ts +14 -14
- package/dist/tools.d.ts +267 -23
- package/dist/tools.d.ts.map +1 -1
- package/dist/workspace-target-url.d.ts.map +1 -1
- package/dist/workspace-target-url.js +8 -3
- package/dist/workspace-target-url.js.map +1 -1
- package/package.json +1 -1
package/dist/tools/letters.d.ts
CHANGED
|
@@ -864,16 +864,20 @@ export declare const letterTools: {
|
|
|
864
864
|
schema: z.ZodObject<{
|
|
865
865
|
name: z.ZodOptional<z.ZodString>;
|
|
866
866
|
audience_bucket: z.ZodOptional<z.ZodEnum<["production", "beta", "dev"]>>;
|
|
867
|
+
attributionWindowDays: z.ZodOptional<z.ZodNumber>;
|
|
867
868
|
}, "strip", z.ZodTypeAny, {
|
|
868
869
|
name?: string | undefined;
|
|
870
|
+
attributionWindowDays?: number | undefined;
|
|
869
871
|
audience_bucket?: "production" | "beta" | "dev" | undefined;
|
|
870
872
|
}, {
|
|
871
873
|
name?: string | undefined;
|
|
874
|
+
attributionWindowDays?: number | undefined;
|
|
872
875
|
audience_bucket?: "production" | "beta" | "dev" | undefined;
|
|
873
876
|
}>;
|
|
874
|
-
handler: ({ name, audience_bucket }: {
|
|
877
|
+
handler: ({ name, audience_bucket, attributionWindowDays, }: {
|
|
875
878
|
name?: string;
|
|
876
879
|
audience_bucket?: "production" | "beta" | "dev";
|
|
880
|
+
attributionWindowDays?: number;
|
|
877
881
|
}) => Promise<{
|
|
878
882
|
content: {
|
|
879
883
|
type: "text";
|
|
@@ -1705,5 +1709,200 @@ export declare const letterTools: {
|
|
|
1705
1709
|
}[];
|
|
1706
1710
|
}>;
|
|
1707
1711
|
};
|
|
1712
|
+
update_segment: {
|
|
1713
|
+
description: string;
|
|
1714
|
+
schema: z.ZodObject<{
|
|
1715
|
+
segmentId: z.ZodString;
|
|
1716
|
+
scope: z.ZodOptional<z.ZodEnum<["workspace", "org"]>>;
|
|
1717
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1718
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1719
|
+
conditions: z.ZodOptional<z.ZodObject<{
|
|
1720
|
+
match: z.ZodEnum<["all", "any"]>;
|
|
1721
|
+
groups: z.ZodArray<z.ZodObject<{
|
|
1722
|
+
match: z.ZodEnum<["all", "any"]>;
|
|
1723
|
+
conditions: z.ZodArray<z.ZodObject<{
|
|
1724
|
+
verb: z.ZodOptional<z.ZodEnum<["has", "hasnt"]>>;
|
|
1725
|
+
event: z.ZodOptional<z.ZodString>;
|
|
1726
|
+
key_event_id: z.ZodOptional<z.ZodString>;
|
|
1727
|
+
scope: z.ZodOptional<z.ZodEnum<["person", "account"]>>;
|
|
1728
|
+
window_days: z.ZodOptional<z.ZodNumber>;
|
|
1729
|
+
attribute: z.ZodOptional<z.ZodString>;
|
|
1730
|
+
op: z.ZodOptional<z.ZodEnum<["is", "is_not", "exists"]>>;
|
|
1731
|
+
value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
1732
|
+
}, "strip", z.ZodTypeAny, {
|
|
1733
|
+
event?: string | undefined;
|
|
1734
|
+
value?: string | number | boolean | undefined;
|
|
1735
|
+
key_event_id?: string | undefined;
|
|
1736
|
+
scope?: "account" | "person" | undefined;
|
|
1737
|
+
attribute?: string | undefined;
|
|
1738
|
+
window_days?: number | undefined;
|
|
1739
|
+
verb?: "has" | "hasnt" | undefined;
|
|
1740
|
+
op?: "exists" | "is" | "is_not" | undefined;
|
|
1741
|
+
}, {
|
|
1742
|
+
event?: string | undefined;
|
|
1743
|
+
value?: string | number | boolean | undefined;
|
|
1744
|
+
key_event_id?: string | undefined;
|
|
1745
|
+
scope?: "account" | "person" | undefined;
|
|
1746
|
+
attribute?: string | undefined;
|
|
1747
|
+
window_days?: number | undefined;
|
|
1748
|
+
verb?: "has" | "hasnt" | undefined;
|
|
1749
|
+
op?: "exists" | "is" | "is_not" | undefined;
|
|
1750
|
+
}>, "many">;
|
|
1751
|
+
}, "strip", z.ZodTypeAny, {
|
|
1752
|
+
match: "all" | "any";
|
|
1753
|
+
conditions: {
|
|
1754
|
+
event?: string | undefined;
|
|
1755
|
+
value?: string | number | boolean | undefined;
|
|
1756
|
+
key_event_id?: string | undefined;
|
|
1757
|
+
scope?: "account" | "person" | undefined;
|
|
1758
|
+
attribute?: string | undefined;
|
|
1759
|
+
window_days?: number | undefined;
|
|
1760
|
+
verb?: "has" | "hasnt" | undefined;
|
|
1761
|
+
op?: "exists" | "is" | "is_not" | undefined;
|
|
1762
|
+
}[];
|
|
1763
|
+
}, {
|
|
1764
|
+
match: "all" | "any";
|
|
1765
|
+
conditions: {
|
|
1766
|
+
event?: string | undefined;
|
|
1767
|
+
value?: string | number | boolean | undefined;
|
|
1768
|
+
key_event_id?: string | undefined;
|
|
1769
|
+
scope?: "account" | "person" | undefined;
|
|
1770
|
+
attribute?: string | undefined;
|
|
1771
|
+
window_days?: number | undefined;
|
|
1772
|
+
verb?: "has" | "hasnt" | undefined;
|
|
1773
|
+
op?: "exists" | "is" | "is_not" | undefined;
|
|
1774
|
+
}[];
|
|
1775
|
+
}>, "many">;
|
|
1776
|
+
}, "strip", z.ZodTypeAny, {
|
|
1777
|
+
match: "all" | "any";
|
|
1778
|
+
groups: {
|
|
1779
|
+
match: "all" | "any";
|
|
1780
|
+
conditions: {
|
|
1781
|
+
event?: string | undefined;
|
|
1782
|
+
value?: string | number | boolean | undefined;
|
|
1783
|
+
key_event_id?: string | undefined;
|
|
1784
|
+
scope?: "account" | "person" | undefined;
|
|
1785
|
+
attribute?: string | undefined;
|
|
1786
|
+
window_days?: number | undefined;
|
|
1787
|
+
verb?: "has" | "hasnt" | undefined;
|
|
1788
|
+
op?: "exists" | "is" | "is_not" | undefined;
|
|
1789
|
+
}[];
|
|
1790
|
+
}[];
|
|
1791
|
+
}, {
|
|
1792
|
+
match: "all" | "any";
|
|
1793
|
+
groups: {
|
|
1794
|
+
match: "all" | "any";
|
|
1795
|
+
conditions: {
|
|
1796
|
+
event?: string | undefined;
|
|
1797
|
+
value?: string | number | boolean | undefined;
|
|
1798
|
+
key_event_id?: string | undefined;
|
|
1799
|
+
scope?: "account" | "person" | undefined;
|
|
1800
|
+
attribute?: string | undefined;
|
|
1801
|
+
window_days?: number | undefined;
|
|
1802
|
+
verb?: "has" | "hasnt" | undefined;
|
|
1803
|
+
op?: "exists" | "is" | "is_not" | undefined;
|
|
1804
|
+
}[];
|
|
1805
|
+
}[];
|
|
1806
|
+
}>>;
|
|
1807
|
+
predicate: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1808
|
+
}, "strip", z.ZodTypeAny, {
|
|
1809
|
+
segmentId: string;
|
|
1810
|
+
name?: string | undefined;
|
|
1811
|
+
description?: string | undefined;
|
|
1812
|
+
scope?: "workspace" | "org" | undefined;
|
|
1813
|
+
conditions?: {
|
|
1814
|
+
match: "all" | "any";
|
|
1815
|
+
groups: {
|
|
1816
|
+
match: "all" | "any";
|
|
1817
|
+
conditions: {
|
|
1818
|
+
event?: string | undefined;
|
|
1819
|
+
value?: string | number | boolean | undefined;
|
|
1820
|
+
key_event_id?: string | undefined;
|
|
1821
|
+
scope?: "account" | "person" | undefined;
|
|
1822
|
+
attribute?: string | undefined;
|
|
1823
|
+
window_days?: number | undefined;
|
|
1824
|
+
verb?: "has" | "hasnt" | undefined;
|
|
1825
|
+
op?: "exists" | "is" | "is_not" | undefined;
|
|
1826
|
+
}[];
|
|
1827
|
+
}[];
|
|
1828
|
+
} | undefined;
|
|
1829
|
+
predicate?: Record<string, unknown> | undefined;
|
|
1830
|
+
}, {
|
|
1831
|
+
segmentId: string;
|
|
1832
|
+
name?: string | undefined;
|
|
1833
|
+
description?: string | undefined;
|
|
1834
|
+
scope?: "workspace" | "org" | undefined;
|
|
1835
|
+
conditions?: {
|
|
1836
|
+
match: "all" | "any";
|
|
1837
|
+
groups: {
|
|
1838
|
+
match: "all" | "any";
|
|
1839
|
+
conditions: {
|
|
1840
|
+
event?: string | undefined;
|
|
1841
|
+
value?: string | number | boolean | undefined;
|
|
1842
|
+
key_event_id?: string | undefined;
|
|
1843
|
+
scope?: "account" | "person" | undefined;
|
|
1844
|
+
attribute?: string | undefined;
|
|
1845
|
+
window_days?: number | undefined;
|
|
1846
|
+
verb?: "has" | "hasnt" | undefined;
|
|
1847
|
+
op?: "exists" | "is" | "is_not" | undefined;
|
|
1848
|
+
}[];
|
|
1849
|
+
}[];
|
|
1850
|
+
} | undefined;
|
|
1851
|
+
predicate?: Record<string, unknown> | undefined;
|
|
1852
|
+
}>;
|
|
1853
|
+
handler: (args: {
|
|
1854
|
+
segmentId: string;
|
|
1855
|
+
scope?: "workspace" | "org";
|
|
1856
|
+
name?: string;
|
|
1857
|
+
description?: string;
|
|
1858
|
+
conditions?: unknown;
|
|
1859
|
+
predicate?: unknown;
|
|
1860
|
+
}) => Promise<{
|
|
1861
|
+
content: {
|
|
1862
|
+
type: "text";
|
|
1863
|
+
text: string;
|
|
1864
|
+
}[];
|
|
1865
|
+
isError: boolean;
|
|
1866
|
+
} | {
|
|
1867
|
+
content: {
|
|
1868
|
+
type: "text";
|
|
1869
|
+
text: string;
|
|
1870
|
+
}[];
|
|
1871
|
+
isError?: undefined;
|
|
1872
|
+
}>;
|
|
1873
|
+
};
|
|
1874
|
+
delete_segment: {
|
|
1875
|
+
description: string;
|
|
1876
|
+
schema: z.ZodObject<{
|
|
1877
|
+
segmentId: z.ZodString;
|
|
1878
|
+
scope: z.ZodOptional<z.ZodEnum<["workspace", "org"]>>;
|
|
1879
|
+
confirmInUse: z.ZodOptional<z.ZodBoolean>;
|
|
1880
|
+
}, "strip", z.ZodTypeAny, {
|
|
1881
|
+
segmentId: string;
|
|
1882
|
+
scope?: "workspace" | "org" | undefined;
|
|
1883
|
+
confirmInUse?: boolean | undefined;
|
|
1884
|
+
}, {
|
|
1885
|
+
segmentId: string;
|
|
1886
|
+
scope?: "workspace" | "org" | undefined;
|
|
1887
|
+
confirmInUse?: boolean | undefined;
|
|
1888
|
+
}>;
|
|
1889
|
+
handler: (args: {
|
|
1890
|
+
segmentId: string;
|
|
1891
|
+
scope?: "workspace" | "org";
|
|
1892
|
+
confirmInUse?: boolean;
|
|
1893
|
+
}) => Promise<{
|
|
1894
|
+
content: {
|
|
1895
|
+
type: "text";
|
|
1896
|
+
text: string;
|
|
1897
|
+
}[];
|
|
1898
|
+
isError: boolean;
|
|
1899
|
+
} | {
|
|
1900
|
+
content: {
|
|
1901
|
+
type: "text";
|
|
1902
|
+
text: string;
|
|
1903
|
+
}[];
|
|
1904
|
+
isError?: undefined;
|
|
1905
|
+
}>;
|
|
1906
|
+
};
|
|
1708
1907
|
};
|
|
1709
1908
|
//# sourceMappingURL=letters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"letters.d.ts","sourceRoot":"","sources":["../../src/tools/letters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAA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;;;;;;;;;;;;;wBA0CqB;YACpB,SAAS,EAAE,MAAM,CAAC;YAClB,KAAK,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC;YAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;SACxB;;;;;;;;;;;;;;CAwCJ,CAAC"}
|
package/dist/tools/letters.js
CHANGED
|
@@ -184,7 +184,10 @@ export const letterTools = {
|
|
|
184
184
|
promote_theme_id: z.string().optional().describe("Promote an existing workspace theme up to the organization so sibling workspaces inherit it."),
|
|
185
185
|
promote_from_workspace_key: z.string().optional().describe("Source workspace key when using promote_theme_id. Defaults to the active workspace."),
|
|
186
186
|
set_default: z.boolean().optional().describe("When creating/promoting an org theme, also set it as the organization default."),
|
|
187
|
-
style: z
|
|
187
|
+
style: z
|
|
188
|
+
.record(z.string(), z.unknown())
|
|
189
|
+
.optional()
|
|
190
|
+
.describe("Email style tokens (camelCase keys — unknown keys are rejected). Colors (hex like '#E4572E'): canvasBg, bodyBg, textColor, buttonColor (button text contrast is auto-derived; do not pass buttonBg/buttonText), linkColor (not accentColor), headerBandColor, footerBandColor, dividerColor. Layout & typography: bodyWidth (320-800 px), fontFamily (curated font id), headingSize (20-40 px), headingSizeH2 (14-40 px), headingSizeH3 (14-40 px), textSize (12-20 px), headerAlign ('left'|'center'|'right'), footerAlign ('left'|'center'|'right'), headerBand, footerBand, bandWidth, buttonRadius (0-40 px), dividerThickness (px), darkMode ('fidelity'|'adapt')."),
|
|
188
191
|
roles: z.record(z.string(), z.unknown()).optional(),
|
|
189
192
|
}),
|
|
190
193
|
handler: async (args) => {
|
|
@@ -252,7 +255,10 @@ export const letterTools = {
|
|
|
252
255
|
org_id: z.string().optional().describe("Organization ID when scope='org'. Defaults to the active organization."),
|
|
253
256
|
reset_to_org: z.boolean().optional().describe("Drop a workspace custom override copy of an organization theme so this workspace inherits the organization's live theme again."),
|
|
254
257
|
name: z.string().min(1).max(60).optional(),
|
|
255
|
-
style: z
|
|
258
|
+
style: z
|
|
259
|
+
.record(z.string(), z.unknown())
|
|
260
|
+
.optional()
|
|
261
|
+
.describe("Email style tokens to merge (camelCase keys — unknown keys are rejected). Colors (hex like '#E4572E'): canvasBg, bodyBg, textColor, buttonColor (button text contrast is auto-derived; do not pass buttonBg/buttonText), linkColor (not accentColor), headerBandColor, footerBandColor, dividerColor. Layout & typography: bodyWidth (320-800 px), fontFamily (curated font id), headingSize (20-40 px), headingSizeH2 (14-40 px), headingSizeH3 (14-40 px), textSize (12-20 px), headerAlign ('left'|'center'|'right'), footerAlign ('left'|'center'|'right'), headerBand, footerBand, bandWidth, buttonRadius (0-40 px), dividerThickness (px), darkMode ('fidelity'|'adapt')."),
|
|
256
262
|
roles: z.record(z.string(), z.unknown()).optional(),
|
|
257
263
|
set_default: z.boolean().optional(),
|
|
258
264
|
}),
|
|
@@ -1055,23 +1061,36 @@ export const letterTools = {
|
|
|
1055
1061
|
// Agent-friendly arg names (snake_case) are mapped to the REST
|
|
1056
1062
|
// routes inside each handler.,
|
|
1057
1063
|
create_journey: {
|
|
1058
|
-
description: `${APEX} — Create a blank draft journey (an unconfigured event trigger wired to an exit). Then set_journey_trigger and add_journey_step to build it, and publish_journey to launch. For e-commerce flows like cart recovery, prefer create_journey_from_template. audience_bucket defaults to production (live customers). Same email on TestFlight and the store is two people — do not create a staging copy of the journey.`,
|
|
1064
|
+
description: `${APEX} — Create a blank draft journey (an unconfigured event trigger wired to an exit). Inherits the workspace's messaging guardrails attribution window by default (or pass attribution_window_days to override for this journey). Then set_journey_trigger and add_journey_step to build it, and publish_journey to launch. For e-commerce flows like cart recovery, prefer create_journey_from_template. audience_bucket defaults to production (live customers). Same email on TestFlight and the store is two people — do not create a staging copy of the journey.`,
|
|
1059
1065
|
schema: z.object({
|
|
1060
1066
|
name: z.string().optional().describe("Journey name (default 'Untitled journey')."),
|
|
1061
1067
|
audience_bucket: z
|
|
1062
1068
|
.enum(["production", "beta", "dev"])
|
|
1063
1069
|
.optional()
|
|
1064
1070
|
.describe("Who this journey enrolls. Default production. Never All or Unclassified."),
|
|
1071
|
+
attributionWindowDays: z
|
|
1072
|
+
.number()
|
|
1073
|
+
.int()
|
|
1074
|
+
.min(1)
|
|
1075
|
+
.max(90)
|
|
1076
|
+
.optional()
|
|
1077
|
+
.describe("Optional per-journey attribution window in days (1-90). Omit to inherit the workspace's messaging guardrails default."),
|
|
1065
1078
|
}),
|
|
1066
|
-
handler: async ({ name, audience_bucket }) => {
|
|
1079
|
+
handler: async ({ name, audience_bucket, attributionWindowDays, }) => {
|
|
1067
1080
|
try {
|
|
1068
|
-
const j = await apiPost("/api/journeys/blank", {
|
|
1081
|
+
const j = await apiPost("/api/journeys/blank", {
|
|
1082
|
+
name,
|
|
1083
|
+
...(attributionWindowDays !== undefined ? { attributionWindowDays } : {}),
|
|
1084
|
+
});
|
|
1069
1085
|
if (audience_bucket && audience_bucket !== "production") {
|
|
1070
1086
|
await apiPatch(`/api/journeys/${j.id}`, { audienceBucket: audience_bucket });
|
|
1071
1087
|
}
|
|
1072
1088
|
if (!tenantOk(j.workspaceKey))
|
|
1073
1089
|
return tenantMismatch();
|
|
1074
|
-
|
|
1090
|
+
const winText = typeof j.attributionWindowDays === "number"
|
|
1091
|
+
? `, attribution window: ${j.attributionWindowDays}d`
|
|
1092
|
+
: "";
|
|
1093
|
+
return { content: [{ type: "text", text: `${APEX} Created draft journey "${j.name}" (id: ${j.id}${winText}). Open it in the browser: ${journeyLink(j.id)}\nNext: set_journey_trigger, then add_journey_step.` }] };
|
|
1075
1094
|
}
|
|
1076
1095
|
catch (err) {
|
|
1077
1096
|
return { content: [{ type: "text", text: `${APEX} ${errMsg(err)}` }], isError: true };
|
|
@@ -2019,5 +2038,114 @@ export const letterTools = {
|
|
|
2019
2038
|
};
|
|
2020
2039
|
},
|
|
2021
2040
|
},
|
|
2041
|
+
update_segment: {
|
|
2042
|
+
description: `${APEX} — Update an existing custom segment's name, description, friendly conditions, or raw predicate. Starter segments are read-only (clone them with create_segment instead). Same conditions grammar as create_segment.`,
|
|
2043
|
+
schema: z.object({
|
|
2044
|
+
segmentId: z.string().min(1).describe("Segment ID from list_segments or create_segment."),
|
|
2045
|
+
scope: z.enum(["workspace", "org"]).optional().describe("Segment scope (default workspace)."),
|
|
2046
|
+
name: z.string().min(1).optional().describe("New segment name."),
|
|
2047
|
+
description: z.string().optional().describe("New segment description."),
|
|
2048
|
+
conditions: z
|
|
2049
|
+
.object({
|
|
2050
|
+
match: z.enum(["all", "any"]),
|
|
2051
|
+
groups: z.array(z.object({
|
|
2052
|
+
match: z.enum(["all", "any"]),
|
|
2053
|
+
conditions: z.array(z.object({
|
|
2054
|
+
verb: z.enum(["has", "hasnt"]).optional(),
|
|
2055
|
+
event: z.string().optional(),
|
|
2056
|
+
key_event_id: z.string().optional(),
|
|
2057
|
+
scope: z.enum(["person", "account"]).optional(),
|
|
2058
|
+
window_days: z.number().optional(),
|
|
2059
|
+
attribute: z.string().optional(),
|
|
2060
|
+
op: z.enum(["is", "is_not", "exists"]).optional(),
|
|
2061
|
+
value: z.union([z.string(), z.number(), z.boolean()]).optional(),
|
|
2062
|
+
})),
|
|
2063
|
+
})),
|
|
2064
|
+
})
|
|
2065
|
+
.optional()
|
|
2066
|
+
.describe("Replacement friendly conditions (compiled server-side). Sub-keys are snake_case."),
|
|
2067
|
+
predicate: z.record(z.string(), z.unknown()).optional().describe("Replacement raw SegmentPredicate."),
|
|
2068
|
+
}),
|
|
2069
|
+
handler: async (args) => {
|
|
2070
|
+
try {
|
|
2071
|
+
const scope = args.scope ?? "workspace";
|
|
2072
|
+
const body = { scope };
|
|
2073
|
+
if (args.name !== undefined)
|
|
2074
|
+
body.name = args.name;
|
|
2075
|
+
if (args.description !== undefined)
|
|
2076
|
+
body.description = args.description;
|
|
2077
|
+
if (args.predicate !== undefined)
|
|
2078
|
+
body.predicate = args.predicate;
|
|
2079
|
+
else if (args.conditions !== undefined)
|
|
2080
|
+
body.conditions = args.conditions;
|
|
2081
|
+
if (Object.keys(body).length === 1) {
|
|
2082
|
+
return {
|
|
2083
|
+
content: [
|
|
2084
|
+
{
|
|
2085
|
+
type: "text",
|
|
2086
|
+
text: `${APEX} Pass at least one field to update (name, description, conditions, or predicate).`,
|
|
2087
|
+
},
|
|
2088
|
+
],
|
|
2089
|
+
isError: true,
|
|
2090
|
+
};
|
|
2091
|
+
}
|
|
2092
|
+
const data = await apiPatch(`/api/segments/${encodeURIComponent(args.segmentId)}?scope=${scope}`, body);
|
|
2093
|
+
return {
|
|
2094
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
2095
|
+
};
|
|
2096
|
+
}
|
|
2097
|
+
catch (err) {
|
|
2098
|
+
return { content: [{ type: "text", text: `${APEX} ${errMsg(err)}` }], isError: true };
|
|
2099
|
+
}
|
|
2100
|
+
},
|
|
2101
|
+
},
|
|
2102
|
+
delete_segment: {
|
|
2103
|
+
description: `${APEX} — Delete a custom segment (starter segments cannot be deleted). Checks whether any active journeys reference the segment first; if it is in use, refuses until the owner confirms with confirm_in_use: true.`,
|
|
2104
|
+
schema: z.object({
|
|
2105
|
+
segmentId: z.string().min(1).describe("Segment ID from list_segments."),
|
|
2106
|
+
scope: z.enum(["workspace", "org"]).optional().describe("Segment scope (default workspace)."),
|
|
2107
|
+
confirmInUse: z
|
|
2108
|
+
.boolean()
|
|
2109
|
+
.optional()
|
|
2110
|
+
.describe("Pass true only after the owner confirms deleting a segment currently referenced by one or more journeys."),
|
|
2111
|
+
}),
|
|
2112
|
+
handler: async (args) => {
|
|
2113
|
+
try {
|
|
2114
|
+
const scope = args.scope ?? "workspace";
|
|
2115
|
+
if (!args.confirmInUse) {
|
|
2116
|
+
try {
|
|
2117
|
+
const usageRes = await apiGet("/api/segments/usage");
|
|
2118
|
+
const usedIn = usageRes?.data?.usage?.[args.segmentId] ?? 0;
|
|
2119
|
+
if (usedIn > 0) {
|
|
2120
|
+
return {
|
|
2121
|
+
content: [
|
|
2122
|
+
{
|
|
2123
|
+
type: "text",
|
|
2124
|
+
text: `${APEX} Segment "${args.segmentId}" is currently used in ${usedIn} ${usedIn === 1 ? "journey" : "journeys"}. Deleting it will stop those journeys from enrolling people through it. Confirm with the owner, then retry with confirm_in_use: true.`,
|
|
2125
|
+
},
|
|
2126
|
+
],
|
|
2127
|
+
isError: true,
|
|
2128
|
+
};
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
catch {
|
|
2132
|
+
// Usage endpoint is best-effort for workspace segments; proceed if unavailable.
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
await apiDelete(`/api/segments/${encodeURIComponent(args.segmentId)}?scope=${scope}`);
|
|
2136
|
+
return {
|
|
2137
|
+
content: [
|
|
2138
|
+
{
|
|
2139
|
+
type: "text",
|
|
2140
|
+
text: `${APEX} Deleted segment "${args.segmentId}" (scope: ${scope}).`,
|
|
2141
|
+
},
|
|
2142
|
+
],
|
|
2143
|
+
};
|
|
2144
|
+
}
|
|
2145
|
+
catch (err) {
|
|
2146
|
+
return { content: [{ type: "text", text: `${APEX} ${errMsg(err)}` }], isError: true };
|
|
2147
|
+
}
|
|
2148
|
+
},
|
|
2149
|
+
},
|
|
2022
2150
|
};
|
|
2023
2151
|
//# sourceMappingURL=letters.js.map
|