@signaliz/sdk 1.0.17 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/dist/{chunk-ZKE4L57J.mjs → chunk-VFBQCWOM.mjs} +631 -42
- package/dist/cli.js +660 -44
- package/dist/cli.mjs +28 -1
- package/dist/index.d.mts +66 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.js +631 -42
- package/dist/index.mjs +1 -1
- package/dist/mcp-config.js +631 -42
- package/dist/mcp-config.mjs +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1175,6 +1175,13 @@ function printCampaignAgentBuildStatus(status) {
|
|
|
1175
1175
|
if (status.campaignId) console.log(`Campaign ID: ${status.campaignId}`);
|
|
1176
1176
|
console.log(`Status: ${status.status}`);
|
|
1177
1177
|
console.log(`Phase: ${status.currentPhase || "N/A"}`);
|
|
1178
|
+
const terminalState = asRecord(status.terminalState);
|
|
1179
|
+
if (terminalState.kind) {
|
|
1180
|
+
console.log(`Terminal state: ${terminalState.kind} (${terminalState.label || "no label"})`);
|
|
1181
|
+
if (terminalState.heartbeatAgeSeconds !== void 0 && terminalState.heartbeatAgeSeconds !== null) {
|
|
1182
|
+
console.log(`Heartbeat age: ${terminalState.heartbeatAgeSeconds}s`);
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1178
1185
|
console.log(`Rows: ${status.recordsSucceeded}/${status.recordsTotal} succeeded, ${status.recordsFailed} failed`);
|
|
1179
1186
|
printCampaignCustomerRowCounts(status);
|
|
1180
1187
|
console.log(`Artifacts: ${status.artifactCount}`);
|
|
@@ -1196,6 +1203,8 @@ function printCampaignAgentBuildStatus(status) {
|
|
|
1196
1203
|
console.log(`Next: ${status.nextAction}`);
|
|
1197
1204
|
} else if (status.status === "pending_approval") {
|
|
1198
1205
|
console.log(`Next: signaliz campaign-agent approve ${status.campaignBuildId} --destination-type webhook`);
|
|
1206
|
+
} else if (terminalState.safeNextAction) {
|
|
1207
|
+
console.log(`Next: ${terminalState.safeNextAction}`);
|
|
1199
1208
|
}
|
|
1200
1209
|
}
|
|
1201
1210
|
function printCampaignCustomerRowCounts(status) {
|
|
@@ -1219,17 +1228,20 @@ function printCampaignAgentBuildReview(review) {
|
|
|
1219
1228
|
console.log(`Campaign: ${review.status?.name || review.campaignBuildId}`);
|
|
1220
1229
|
console.log(`Status: ${summary.status || review.status?.status}`);
|
|
1221
1230
|
console.log(`Phase: ${summary.phase || review.status?.currentPhase || "N/A"}`);
|
|
1231
|
+
console.log(`Terminal state: ${summary.terminalState || review.status?.terminalState?.kind || "unknown"}`);
|
|
1222
1232
|
console.log(`Rows: ${summary.sampledRows || 0} sampled, ${summary.availableRows || 0} available`);
|
|
1223
1233
|
console.log(`Qualified: ${summary.qualifiedRows || 0}`);
|
|
1224
1234
|
console.log(`Emails: ${summary.rowsWithEmail || 0}`);
|
|
1225
1235
|
console.log(`Copy ready: ${summary.copyReadyRows || 0}`);
|
|
1226
1236
|
console.log(`Artifacts: ${summary.artifactCount || 0}`);
|
|
1237
|
+
printCampaignAgentNorthStarScorecard(review.northStarScorecard);
|
|
1227
1238
|
if (review.campaignBuildId) printCampaignArtifactDownload(review.status, review.campaignBuildId);
|
|
1228
1239
|
console.log(`Delivery approval ready: ${summary.readyForDeliveryApproval === true ? "yes" : "no"}`);
|
|
1229
1240
|
if (Array.isArray(review.gates) && review.gates.length > 0) {
|
|
1230
1241
|
console.log("\nGates:");
|
|
1231
1242
|
for (const gate of review.gates) {
|
|
1232
|
-
|
|
1243
|
+
const status = String(gate.status || (gate.passed ? "pass" : "blocked")).toUpperCase();
|
|
1244
|
+
console.log(`- ${status} ${gate.label}: ${gate.detail}`);
|
|
1233
1245
|
}
|
|
1234
1246
|
}
|
|
1235
1247
|
const warnings = Array.isArray(summary.warnings) ? summary.warnings : [];
|
|
@@ -1243,6 +1255,21 @@ function printCampaignAgentBuildReview(review) {
|
|
|
1243
1255
|
for (const action of nextActions) console.log(`- ${action}`);
|
|
1244
1256
|
}
|
|
1245
1257
|
}
|
|
1258
|
+
function printCampaignAgentNorthStarScorecard(scorecard) {
|
|
1259
|
+
const card = asRecord(scorecard);
|
|
1260
|
+
if (!card.version) return;
|
|
1261
|
+
const score = card.score === null || card.score === void 0 ? "pending" : `${card.score}%`;
|
|
1262
|
+
console.log(`North Star: ${String(card.status || "unknown")} (${score})`);
|
|
1263
|
+
if (card.moatState) console.log(`Moat state: ${card.moatState}`);
|
|
1264
|
+
const metrics = Array.isArray(card.metrics) ? card.metrics : [];
|
|
1265
|
+
if (metrics.length > 0) {
|
|
1266
|
+
console.log("\nNorth Star gates:");
|
|
1267
|
+
for (const metric of metrics.slice(0, 12)) {
|
|
1268
|
+
const item = asRecord(metric);
|
|
1269
|
+
console.log(`- ${String(item.status || "review").toUpperCase()} ${item.label || item.id}: ${item.detail || ""}`);
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1246
1273
|
function formatCampaignAgentRows(rows) {
|
|
1247
1274
|
return rows.map((row) => {
|
|
1248
1275
|
const data = asRecord(row.data);
|
package/dist/index.d.mts
CHANGED
|
@@ -517,6 +517,7 @@ interface CampaignBuildRequest$1 {
|
|
|
517
517
|
suppressPriorListIds?: string[];
|
|
518
518
|
uniqueness?: 'email' | 'domain' | 'email_and_domain';
|
|
519
519
|
requireUsageMetadata?: boolean;
|
|
520
|
+
verifiedCacheTtlDays?: number;
|
|
520
521
|
};
|
|
521
522
|
policy?: {
|
|
522
523
|
maxCredits?: number;
|
|
@@ -660,6 +661,10 @@ interface CampaignBuildResult$1 {
|
|
|
660
661
|
brainContext?: Record<string, unknown>;
|
|
661
662
|
learningHoldout?: Record<string, unknown>;
|
|
662
663
|
providerRoute?: CampaignProviderRouteReadback$1 | null;
|
|
664
|
+
effectiveSourceRouting?: Record<string, unknown> | null;
|
|
665
|
+
sourcePlan?: Record<string, unknown> | null;
|
|
666
|
+
sourceRoutes?: Array<Record<string, unknown>>;
|
|
667
|
+
sourceShards?: Array<Record<string, unknown>>;
|
|
663
668
|
}
|
|
664
669
|
interface CampaignBuildStatus {
|
|
665
670
|
campaignBuildId: string;
|
|
@@ -687,6 +692,32 @@ interface CampaignBuildStatus {
|
|
|
687
692
|
triggerRunId?: string | null;
|
|
688
693
|
staleRunningPhase?: boolean;
|
|
689
694
|
phaseAgeSeconds?: number | null;
|
|
695
|
+
nextPollAfterSeconds?: number | null;
|
|
696
|
+
terminalReason?: string | null;
|
|
697
|
+
staleReason?: string | null;
|
|
698
|
+
safeNextAction?: string | null;
|
|
699
|
+
terminalState?: {
|
|
700
|
+
kind: 'terminal' | 'pending_approval' | 'running_healthy' | 'running_stale' | 'blocked' | 'unknown';
|
|
701
|
+
label: string;
|
|
702
|
+
reviewable: boolean;
|
|
703
|
+
terminal: boolean;
|
|
704
|
+
stale: boolean;
|
|
705
|
+
phase: string | null;
|
|
706
|
+
phaseStatus: string | null;
|
|
707
|
+
heartbeatAgeSeconds: number | null;
|
|
708
|
+
nextPollAfterSeconds: number | null;
|
|
709
|
+
terminalReason: string | null;
|
|
710
|
+
staleReason: string | null;
|
|
711
|
+
safeNextAction: string;
|
|
712
|
+
};
|
|
713
|
+
phaseHealth?: Array<{
|
|
714
|
+
phase: string;
|
|
715
|
+
status: string;
|
|
716
|
+
recordsProcessed: number | null;
|
|
717
|
+
recordsSucceeded: number | null;
|
|
718
|
+
recordsFailed: number | null;
|
|
719
|
+
heartbeatAgeSeconds: number | null;
|
|
720
|
+
}>;
|
|
690
721
|
diagnostics?: Record<string, unknown>;
|
|
691
722
|
nextAction: string;
|
|
692
723
|
approvalAction?: string;
|
|
@@ -1075,6 +1106,8 @@ interface CampaignBuilderAgentRequest {
|
|
|
1075
1106
|
icp?: CampaignBuildRequest['icp'];
|
|
1076
1107
|
/** Optional output from gtm_brain_seed_defaults to attach to build_campaign. */
|
|
1077
1108
|
brainDefaults?: UnknownRecord$1;
|
|
1109
|
+
/** Optional control-vs-learned policy. Defaults to a Signaliz learning holdout for agent-built campaigns. */
|
|
1110
|
+
learningHoldout?: CampaignBuildRequest['learningHoldout'];
|
|
1078
1111
|
/** Optional output from gtm_brain_delivery_risk. Required before committed-campaign launch handoff. */
|
|
1079
1112
|
deliveryRisk?: UnknownRecord$1;
|
|
1080
1113
|
workspaceContext?: CampaignBuilderWorkspaceContext;
|
|
@@ -1357,11 +1390,34 @@ interface CampaignBuilderBuildReviewGate {
|
|
|
1357
1390
|
id: string;
|
|
1358
1391
|
label: string;
|
|
1359
1392
|
passed: boolean;
|
|
1393
|
+
status?: CampaignBuilderNorthStarMetricStatus;
|
|
1394
|
+
detail: string;
|
|
1395
|
+
}
|
|
1396
|
+
type CampaignBuilderNorthStarMetricStatus = 'pass' | 'pending' | 'review' | 'blocked';
|
|
1397
|
+
interface CampaignBuilderNorthStarMetric {
|
|
1398
|
+
id: string;
|
|
1399
|
+
label: string;
|
|
1400
|
+
status: CampaignBuilderNorthStarMetricStatus;
|
|
1360
1401
|
detail: string;
|
|
1402
|
+
value?: number | string | boolean | null;
|
|
1403
|
+
target?: number | string | boolean | null;
|
|
1404
|
+
}
|
|
1405
|
+
interface CampaignBuilderNorthStarScorecard {
|
|
1406
|
+
version: 'campaign-builder-north-star.v1';
|
|
1407
|
+
status: CampaignBuilderNorthStarMetricStatus;
|
|
1408
|
+
score: number | null;
|
|
1409
|
+
moatState: 'scaffolding_ready' | 'moved_needs_lift_volume' | 'proved';
|
|
1410
|
+
metrics: CampaignBuilderNorthStarMetric[];
|
|
1411
|
+
blockers: string[];
|
|
1412
|
+
warnings: string[];
|
|
1413
|
+
nextAction: string;
|
|
1361
1414
|
}
|
|
1362
1415
|
interface CampaignBuilderBuildReviewSummary {
|
|
1363
1416
|
status: string;
|
|
1364
1417
|
phase: string | null;
|
|
1418
|
+
terminalState: string;
|
|
1419
|
+
scorecardStatus: CampaignBuilderNorthStarMetricStatus;
|
|
1420
|
+
scorecardScore: number | null;
|
|
1365
1421
|
sampledRows: number;
|
|
1366
1422
|
availableRows: number;
|
|
1367
1423
|
qualifiedRows: number;
|
|
@@ -1378,6 +1434,7 @@ interface CampaignBuilderBuildReview {
|
|
|
1378
1434
|
rows: CampaignRowsResult;
|
|
1379
1435
|
artifacts: CampaignArtifact[];
|
|
1380
1436
|
gates: CampaignBuilderBuildReviewGate[];
|
|
1437
|
+
northStarScorecard: CampaignBuilderNorthStarScorecard;
|
|
1381
1438
|
summary: CampaignBuilderBuildReviewSummary;
|
|
1382
1439
|
nextActions: string[];
|
|
1383
1440
|
}
|
|
@@ -2005,6 +2062,13 @@ interface GtmBrainDistillRunInput {
|
|
|
2005
2062
|
minWorkspaceCount?: number;
|
|
2006
2063
|
minPrivacyK?: number;
|
|
2007
2064
|
}
|
|
2065
|
+
interface GtmHistoricalCampaignBuildBridgeRunInput {
|
|
2066
|
+
dryRun?: boolean;
|
|
2067
|
+
writeApproved?: boolean;
|
|
2068
|
+
maxEvents?: number;
|
|
2069
|
+
maxCampaigns?: number;
|
|
2070
|
+
minFeedbackEvents?: number;
|
|
2071
|
+
}
|
|
2008
2072
|
interface GtmFeedbackWebhookPrepareInput {
|
|
2009
2073
|
provider: string;
|
|
2010
2074
|
campaignId?: string;
|
|
@@ -2763,6 +2827,8 @@ declare class GtmKernel {
|
|
|
2763
2827
|
runKernelImport(input?: GtmKernelImportRunInput): Promise<any>;
|
|
2764
2828
|
/** Queue Brain distillation over imported Instantly memory with abstracted-only outputs. */
|
|
2765
2829
|
runBrainDistillation(input?: GtmBrainDistillRunInput): Promise<any>;
|
|
2830
|
+
/** Queue a dry-run-first bridge from imported historical feedback to attribution-only Campaign Build surrogates. */
|
|
2831
|
+
runHistoricalCampaignBuildBridge(input?: GtmHistoricalCampaignBuildBridgeRunInput): Promise<any>;
|
|
2766
2832
|
/** Prepare a provider-agnostic feedback webhook URL for Smartlead, HeyReach, Airbyte, or custom sender events. */
|
|
2767
2833
|
prepareFeedbackWebhook(input: GtmFeedbackWebhookPrepareInput): Promise<any>;
|
|
2768
2834
|
/** Search ranked workspace campaign memory instead of dumping raw history. */
|
package/dist/index.d.ts
CHANGED
|
@@ -517,6 +517,7 @@ interface CampaignBuildRequest$1 {
|
|
|
517
517
|
suppressPriorListIds?: string[];
|
|
518
518
|
uniqueness?: 'email' | 'domain' | 'email_and_domain';
|
|
519
519
|
requireUsageMetadata?: boolean;
|
|
520
|
+
verifiedCacheTtlDays?: number;
|
|
520
521
|
};
|
|
521
522
|
policy?: {
|
|
522
523
|
maxCredits?: number;
|
|
@@ -660,6 +661,10 @@ interface CampaignBuildResult$1 {
|
|
|
660
661
|
brainContext?: Record<string, unknown>;
|
|
661
662
|
learningHoldout?: Record<string, unknown>;
|
|
662
663
|
providerRoute?: CampaignProviderRouteReadback$1 | null;
|
|
664
|
+
effectiveSourceRouting?: Record<string, unknown> | null;
|
|
665
|
+
sourcePlan?: Record<string, unknown> | null;
|
|
666
|
+
sourceRoutes?: Array<Record<string, unknown>>;
|
|
667
|
+
sourceShards?: Array<Record<string, unknown>>;
|
|
663
668
|
}
|
|
664
669
|
interface CampaignBuildStatus {
|
|
665
670
|
campaignBuildId: string;
|
|
@@ -687,6 +692,32 @@ interface CampaignBuildStatus {
|
|
|
687
692
|
triggerRunId?: string | null;
|
|
688
693
|
staleRunningPhase?: boolean;
|
|
689
694
|
phaseAgeSeconds?: number | null;
|
|
695
|
+
nextPollAfterSeconds?: number | null;
|
|
696
|
+
terminalReason?: string | null;
|
|
697
|
+
staleReason?: string | null;
|
|
698
|
+
safeNextAction?: string | null;
|
|
699
|
+
terminalState?: {
|
|
700
|
+
kind: 'terminal' | 'pending_approval' | 'running_healthy' | 'running_stale' | 'blocked' | 'unknown';
|
|
701
|
+
label: string;
|
|
702
|
+
reviewable: boolean;
|
|
703
|
+
terminal: boolean;
|
|
704
|
+
stale: boolean;
|
|
705
|
+
phase: string | null;
|
|
706
|
+
phaseStatus: string | null;
|
|
707
|
+
heartbeatAgeSeconds: number | null;
|
|
708
|
+
nextPollAfterSeconds: number | null;
|
|
709
|
+
terminalReason: string | null;
|
|
710
|
+
staleReason: string | null;
|
|
711
|
+
safeNextAction: string;
|
|
712
|
+
};
|
|
713
|
+
phaseHealth?: Array<{
|
|
714
|
+
phase: string;
|
|
715
|
+
status: string;
|
|
716
|
+
recordsProcessed: number | null;
|
|
717
|
+
recordsSucceeded: number | null;
|
|
718
|
+
recordsFailed: number | null;
|
|
719
|
+
heartbeatAgeSeconds: number | null;
|
|
720
|
+
}>;
|
|
690
721
|
diagnostics?: Record<string, unknown>;
|
|
691
722
|
nextAction: string;
|
|
692
723
|
approvalAction?: string;
|
|
@@ -1075,6 +1106,8 @@ interface CampaignBuilderAgentRequest {
|
|
|
1075
1106
|
icp?: CampaignBuildRequest['icp'];
|
|
1076
1107
|
/** Optional output from gtm_brain_seed_defaults to attach to build_campaign. */
|
|
1077
1108
|
brainDefaults?: UnknownRecord$1;
|
|
1109
|
+
/** Optional control-vs-learned policy. Defaults to a Signaliz learning holdout for agent-built campaigns. */
|
|
1110
|
+
learningHoldout?: CampaignBuildRequest['learningHoldout'];
|
|
1078
1111
|
/** Optional output from gtm_brain_delivery_risk. Required before committed-campaign launch handoff. */
|
|
1079
1112
|
deliveryRisk?: UnknownRecord$1;
|
|
1080
1113
|
workspaceContext?: CampaignBuilderWorkspaceContext;
|
|
@@ -1357,11 +1390,34 @@ interface CampaignBuilderBuildReviewGate {
|
|
|
1357
1390
|
id: string;
|
|
1358
1391
|
label: string;
|
|
1359
1392
|
passed: boolean;
|
|
1393
|
+
status?: CampaignBuilderNorthStarMetricStatus;
|
|
1394
|
+
detail: string;
|
|
1395
|
+
}
|
|
1396
|
+
type CampaignBuilderNorthStarMetricStatus = 'pass' | 'pending' | 'review' | 'blocked';
|
|
1397
|
+
interface CampaignBuilderNorthStarMetric {
|
|
1398
|
+
id: string;
|
|
1399
|
+
label: string;
|
|
1400
|
+
status: CampaignBuilderNorthStarMetricStatus;
|
|
1360
1401
|
detail: string;
|
|
1402
|
+
value?: number | string | boolean | null;
|
|
1403
|
+
target?: number | string | boolean | null;
|
|
1404
|
+
}
|
|
1405
|
+
interface CampaignBuilderNorthStarScorecard {
|
|
1406
|
+
version: 'campaign-builder-north-star.v1';
|
|
1407
|
+
status: CampaignBuilderNorthStarMetricStatus;
|
|
1408
|
+
score: number | null;
|
|
1409
|
+
moatState: 'scaffolding_ready' | 'moved_needs_lift_volume' | 'proved';
|
|
1410
|
+
metrics: CampaignBuilderNorthStarMetric[];
|
|
1411
|
+
blockers: string[];
|
|
1412
|
+
warnings: string[];
|
|
1413
|
+
nextAction: string;
|
|
1361
1414
|
}
|
|
1362
1415
|
interface CampaignBuilderBuildReviewSummary {
|
|
1363
1416
|
status: string;
|
|
1364
1417
|
phase: string | null;
|
|
1418
|
+
terminalState: string;
|
|
1419
|
+
scorecardStatus: CampaignBuilderNorthStarMetricStatus;
|
|
1420
|
+
scorecardScore: number | null;
|
|
1365
1421
|
sampledRows: number;
|
|
1366
1422
|
availableRows: number;
|
|
1367
1423
|
qualifiedRows: number;
|
|
@@ -1378,6 +1434,7 @@ interface CampaignBuilderBuildReview {
|
|
|
1378
1434
|
rows: CampaignRowsResult;
|
|
1379
1435
|
artifacts: CampaignArtifact[];
|
|
1380
1436
|
gates: CampaignBuilderBuildReviewGate[];
|
|
1437
|
+
northStarScorecard: CampaignBuilderNorthStarScorecard;
|
|
1381
1438
|
summary: CampaignBuilderBuildReviewSummary;
|
|
1382
1439
|
nextActions: string[];
|
|
1383
1440
|
}
|
|
@@ -2005,6 +2062,13 @@ interface GtmBrainDistillRunInput {
|
|
|
2005
2062
|
minWorkspaceCount?: number;
|
|
2006
2063
|
minPrivacyK?: number;
|
|
2007
2064
|
}
|
|
2065
|
+
interface GtmHistoricalCampaignBuildBridgeRunInput {
|
|
2066
|
+
dryRun?: boolean;
|
|
2067
|
+
writeApproved?: boolean;
|
|
2068
|
+
maxEvents?: number;
|
|
2069
|
+
maxCampaigns?: number;
|
|
2070
|
+
minFeedbackEvents?: number;
|
|
2071
|
+
}
|
|
2008
2072
|
interface GtmFeedbackWebhookPrepareInput {
|
|
2009
2073
|
provider: string;
|
|
2010
2074
|
campaignId?: string;
|
|
@@ -2763,6 +2827,8 @@ declare class GtmKernel {
|
|
|
2763
2827
|
runKernelImport(input?: GtmKernelImportRunInput): Promise<any>;
|
|
2764
2828
|
/** Queue Brain distillation over imported Instantly memory with abstracted-only outputs. */
|
|
2765
2829
|
runBrainDistillation(input?: GtmBrainDistillRunInput): Promise<any>;
|
|
2830
|
+
/** Queue a dry-run-first bridge from imported historical feedback to attribution-only Campaign Build surrogates. */
|
|
2831
|
+
runHistoricalCampaignBuildBridge(input?: GtmHistoricalCampaignBuildBridgeRunInput): Promise<any>;
|
|
2766
2832
|
/** Prepare a provider-agnostic feedback webhook URL for Smartlead, HeyReach, Airbyte, or custom sender events. */
|
|
2767
2833
|
prepareFeedbackWebhook(input: GtmFeedbackWebhookPrepareInput): Promise<any>;
|
|
2768
2834
|
/** Search ranked workspace campaign memory instead of dumping raw history. */
|