@hyperstar/mcp 0.1.11 → 0.1.12
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/tool-guidance.d.ts +2 -0
- package/dist/tool-guidance.js +12 -0
- package/dist/tools.js +2 -2
- package/dist/workflow-content.d.ts +1 -0
- package/dist/workflow-content.js +11 -0
- package/package.json +1 -1
package/dist/tool-guidance.d.ts
CHANGED
|
@@ -8,3 +8,5 @@ export declare function campaignImportGuidance(payload: JsonObject, campaignId:
|
|
|
8
8
|
export declare function campaignRosterGuidance(payload: JsonObject, campaignId: number): JsonObject;
|
|
9
9
|
/** Add send or no-send guidance after the readiness dry run. */
|
|
10
10
|
export declare function readinessGuidance(payload: JsonObject, input: CheckBulkEmailReadinessInput): JsonObject;
|
|
11
|
+
/** Add deterministic next-step guidance after listing inbox threads. */
|
|
12
|
+
export declare function inboxThreadListGuidance(payload: JsonObject): JsonObject;
|
package/dist/tool-guidance.js
CHANGED
|
@@ -63,6 +63,18 @@ export function readinessGuidance(payload, input) {
|
|
|
63
63
|
agent_guidance: 'Readiness passed. start_bulk_email performs a real send, so only call it after user authorization and after filling subject, body_text, a stable idempotency_key, and send_confirmation: "user_authorized".',
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
+
/** Add deterministic next-step guidance after listing inbox threads. */
|
|
67
|
+
export function inboxThreadListGuidance(payload) {
|
|
68
|
+
return {
|
|
69
|
+
...payload,
|
|
70
|
+
next_tools: [
|
|
71
|
+
"get_inbox_aggregates",
|
|
72
|
+
"update_inbox_thread_state",
|
|
73
|
+
"send_inbox_reply",
|
|
74
|
+
],
|
|
75
|
+
agent_guidance: "Use get_inbox_aggregates for counts, update_inbox_thread_state for archive/star/snooze/read-state changes, and send_inbox_reply only after explicit user authorization because send_inbox_reply performs a real send.",
|
|
76
|
+
};
|
|
77
|
+
}
|
|
66
78
|
function recipientTargetArgument(ids, selection) {
|
|
67
79
|
if (ids !== undefined) {
|
|
68
80
|
return { type: "ids", campaign_creator_ids: [...ids] };
|
package/dist/tools.js
CHANGED
|
@@ -2,7 +2,7 @@ import { bulkEmailQueuedResult } from "./bulk-email-guidance.js";
|
|
|
2
2
|
import { readinessRequestBody, startBulkEmailRequestBody, } from "./bulk-email-tool-body.js";
|
|
3
3
|
import { projectSearchResultPage } from "./search-result-projection.js";
|
|
4
4
|
import { TOOL_DESCRIPTIONS } from "./tool-descriptions.js";
|
|
5
|
-
import { campaignImportGuidance, campaignRosterGuidance, readinessGuidance, searchGuidance, } from "./tool-guidance.js";
|
|
5
|
+
import { campaignImportGuidance, campaignRosterGuidance, inboxThreadListGuidance, readinessGuidance, searchGuidance, } from "./tool-guidance.js";
|
|
6
6
|
import { toolResult } from "./tool-result.js";
|
|
7
7
|
import { compactJsonObject, pathSegment, queryFrom, } from "./tool-http-helpers.js";
|
|
8
8
|
import { BulkEmailJobResponseSchema, BulkEmailReadinessResponseSchema, CampaignDetailResponseSchema, CampaignCreatorsResponseSchema, CampaignImportResponseSchema, CampaignsResponseSchema, InboxAggregatesResponseSchema, InboxThreadPageResponseSchema, InboxWorkspaceStateResponseSchema, JsonObjectSchema, SearchCreatedResponseSchema, SearchResultsResponseSchema, WhoamiResponseSchema, } from "./schemas.js";
|
|
@@ -112,7 +112,7 @@ export function createToolHandlers(client, options = {}) {
|
|
|
112
112
|
},
|
|
113
113
|
listInboxThreads: async (input) => {
|
|
114
114
|
const parsedInput = ListInboxThreadsInputSchema.parse(input);
|
|
115
|
-
return InboxThreadPageResponseSchema.parse(await client.get("/v1/inbox/threads", queryFrom(parsedInput)));
|
|
115
|
+
return inboxThreadListGuidance(InboxThreadPageResponseSchema.parse(await client.get("/v1/inbox/threads", queryFrom(parsedInput))));
|
|
116
116
|
},
|
|
117
117
|
getInboxAggregates: async (input) => {
|
|
118
118
|
const parsedInput = InboxFiltersInputSchema.parse(input);
|
|
@@ -11,6 +11,7 @@ export declare const CLI_WORKFLOW_SEQUENCE: readonly ["list_workspaces", "select
|
|
|
11
11
|
export declare const SERVICE_ACCOUNT_WORKFLOW_SEQUENCE: readonly ["list_workspaces", "hyperstar_whoami", "search_creators", "list_campaigns or create_campaign", "save_search_results_to_campaign", "list_campaign_creators", "check_bulk_email_readiness", "WARNING: start_bulk_email and send_inbox_reply perform real sends."];
|
|
12
12
|
export declare const CLI_SAFETY_NOTES: readonly ["Run list_workspaces and select_workspace before Product API calls that require workspace scope.", "Run hyperstar_whoami after selecting a workspace to confirm the authenticated principal.", "Run list_campaigns or create_campaign before save_search_results_to_campaign when the user has not supplied a campaign_id.", "check_bulk_email_readiness is the final dry-run gate before any bulk send.", "start_bulk_email and send_inbox_reply perform real sends."];
|
|
13
13
|
export declare const SERVICE_ACCOUNT_SAFETY_NOTES: readonly ["Service-account auth is already workspace-scoped; select_workspace is only for local browser CLI auth.", "Run list_workspaces and hyperstar_whoami before workflow tools to confirm the authenticated workspace.", "Run list_campaigns or create_campaign before save_search_results_to_campaign when the user has not supplied a campaign_id.", "check_bulk_email_readiness is the final dry-run gate before any bulk send.", "start_bulk_email and send_inbox_reply perform real sends."];
|
|
14
|
+
export declare const WORKFLOW_DATA_FLOW_NOTES: readonly ["search_creators returns a search_id plus compact creator summaries; save_search_results_to_campaign consumes search_id server-side, so agents do not need to load every creator row into context.", "check_bulk_email_readiness and start_bulk_email require recipient_target, either exact campaign_creator_ids or a narrowed campaign_creator_selection.", "Use list_campaign_creators after saving search results to find campaign_creator_ids for explicit recipient_target calls.", "Use list_inbox_threads for triage, update_inbox_thread_state for non-send state changes, and send_inbox_reply only after explicit user authorization."];
|
|
14
15
|
export declare const SEARCH_FILTER_GUIDANCE: readonly ["filters is a structured JSON object validated by the MCP before it is forwarded to Product API search.", "Use range objects such as `follower_range: {\"min\": 1000, \"max\": 100000}`, `avg_engagement_rate`, `avg_views`, `gmv`, and `gpm`.", "Use boolean/string filters such as `has_email`, `email_contactability`, `is_verified`, `has_tiktok_shop`, `creator_gender`, `creator_language`, `category_1`, and Instagram `category_name`.", "Put broad niches, verticals, and countries in `query`/`region` unless a named structured filter applies; do not invent `country`, `categories`, `follower_count`, or `engagement_rate` filter keys.", "Use sort_by for relevance, follower_count, engagement_rate, avg_views, views_growth_rate, gmv, or gpm; gmv and gpm are TikTok-only.", "Keep filters narrow and serializable; use get_search_results pagination instead of loading every creator row into context."];
|
|
15
16
|
export declare const workflowGuideResourceDefinitions: readonly [{
|
|
16
17
|
readonly kind: "headless-workflow";
|
package/dist/workflow-content.js
CHANGED
|
@@ -33,6 +33,12 @@ export const SERVICE_ACCOUNT_SAFETY_NOTES = [
|
|
|
33
33
|
"check_bulk_email_readiness is the final dry-run gate before any bulk send.",
|
|
34
34
|
"start_bulk_email and send_inbox_reply perform real sends.",
|
|
35
35
|
];
|
|
36
|
+
export const WORKFLOW_DATA_FLOW_NOTES = [
|
|
37
|
+
"search_creators returns a search_id plus compact creator summaries; save_search_results_to_campaign consumes search_id server-side, so agents do not need to load every creator row into context.",
|
|
38
|
+
"check_bulk_email_readiness and start_bulk_email require recipient_target, either exact campaign_creator_ids or a narrowed campaign_creator_selection.",
|
|
39
|
+
"Use list_campaign_creators after saving search results to find campaign_creator_ids for explicit recipient_target calls.",
|
|
40
|
+
"Use list_inbox_threads for triage, update_inbox_thread_state for non-send state changes, and send_inbox_reply only after explicit user authorization.",
|
|
41
|
+
];
|
|
36
42
|
export const SEARCH_FILTER_GUIDANCE = [
|
|
37
43
|
"filters is a structured JSON object validated by the MCP before it is forwarded to Product API search.",
|
|
38
44
|
'Use range objects such as `follower_range: {"min": 1000, "max": 100000}`, `avg_engagement_rate`, `avg_views`, `gmv`, and `gpm`.',
|
|
@@ -77,12 +83,14 @@ export function workflowGuideJson(authMode) {
|
|
|
77
83
|
return {
|
|
78
84
|
sequence: [...CLI_WORKFLOW_SEQUENCE],
|
|
79
85
|
safety_notes: [...CLI_SAFETY_NOTES],
|
|
86
|
+
data_flow_notes: [...WORKFLOW_DATA_FLOW_NOTES],
|
|
80
87
|
resources: workflowGuideResourceDefinitions.map((resource) => resource.uri),
|
|
81
88
|
};
|
|
82
89
|
}
|
|
83
90
|
return {
|
|
84
91
|
sequence: [...SERVICE_ACCOUNT_WORKFLOW_SEQUENCE],
|
|
85
92
|
safety_notes: [...SERVICE_ACCOUNT_SAFETY_NOTES],
|
|
93
|
+
data_flow_notes: [...WORKFLOW_DATA_FLOW_NOTES],
|
|
86
94
|
resources: workflowGuideResourceDefinitions.map((resource) => resource.uri),
|
|
87
95
|
};
|
|
88
96
|
}
|
|
@@ -103,6 +111,9 @@ export function buildWorkflowMarkdown(kind) {
|
|
|
103
111
|
"",
|
|
104
112
|
"Always confirm workspace and scopes with `hyperstar_whoami` before mutating campaigns, sending bulk email, or replying in the inbox.",
|
|
105
113
|
"",
|
|
114
|
+
"## Data Flow",
|
|
115
|
+
unorderedList(WORKFLOW_DATA_FLOW_NOTES),
|
|
116
|
+
"",
|
|
106
117
|
"## Search Filters",
|
|
107
118
|
unorderedList(SEARCH_FILTER_GUIDANCE),
|
|
108
119
|
].join("\n");
|