gtm-now 0.10.1 → 0.10.2
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/index.js +132 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11307,6 +11307,43 @@ var init_feedback = __esm({
|
|
|
11307
11307
|
}
|
|
11308
11308
|
});
|
|
11309
11309
|
|
|
11310
|
+
// src/tools/review.ts
|
|
11311
|
+
var reviewTools;
|
|
11312
|
+
var init_review = __esm({
|
|
11313
|
+
"src/tools/review.ts"() {
|
|
11314
|
+
"use strict";
|
|
11315
|
+
reviewTools = [
|
|
11316
|
+
{
|
|
11317
|
+
name: "gtm_review",
|
|
11318
|
+
description: "Push data to a visual review table. Users see an interactive grid in their browser and can select/deselect rows. Use after finding companies or contacts to let the user review before enrichment.",
|
|
11319
|
+
inputSchema: {
|
|
11320
|
+
type: "object",
|
|
11321
|
+
properties: {
|
|
11322
|
+
action: {
|
|
11323
|
+
type: "string",
|
|
11324
|
+
enum: ["create", "update", "get_selected"],
|
|
11325
|
+
description: "create: new table from data. update: modify existing table rows. get_selected: fetch user-approved rows."
|
|
11326
|
+
},
|
|
11327
|
+
title: { type: "string", description: "Table title (for create)" },
|
|
11328
|
+
data: {
|
|
11329
|
+
type: "array",
|
|
11330
|
+
items: { type: "object" },
|
|
11331
|
+
description: "Array of row objects (for create)"
|
|
11332
|
+
},
|
|
11333
|
+
table_id: { type: "string", description: "Table ID (for update, get_selected)" },
|
|
11334
|
+
rows: {
|
|
11335
|
+
type: "array",
|
|
11336
|
+
items: { type: "object" },
|
|
11337
|
+
description: "Updated row objects with _row_id (for update)"
|
|
11338
|
+
}
|
|
11339
|
+
},
|
|
11340
|
+
required: ["action"]
|
|
11341
|
+
}
|
|
11342
|
+
}
|
|
11343
|
+
];
|
|
11344
|
+
}
|
|
11345
|
+
});
|
|
11346
|
+
|
|
11310
11347
|
// src/tools/descriptions.ts
|
|
11311
11348
|
var TOOL_DESCRIPTIONS;
|
|
11312
11349
|
var init_descriptions = __esm({
|
|
@@ -11390,7 +11427,8 @@ Note: HarvestAPI charges per request. For engagement mining, each post lookup co
|
|
|
11390
11427
|
gtm_guide: "CALL THIS FIRST before any multi-step GTM task. Returns step-by-step workflow recipes for common tasks like building a TAM list, running enrichment, or launching cold outreach. Always check the guide before starting work to ensure you follow the correct sequence and avoid wasting credits.",
|
|
11391
11428
|
gtm_tool_help: "Get the full parameter schema for a specific GTM tool. Use this to see exactly what arguments a tool accepts before calling gtm_execute.",
|
|
11392
11429
|
gtm_execute: "Gateway to execute any GTM tool by name. Use gtm_guide for workflow recipes, gtm_tool_help for parameter schemas, then this to execute.",
|
|
11393
|
-
gtm_feedback: "Submit feedback, bug reports, feature requests, or provider requests. Feedback is stored for the gtm-now maintainers to review."
|
|
11430
|
+
gtm_feedback: "Submit feedback, bug reports, feature requests, or provider requests. Feedback is stored for the gtm-now maintainers to review.",
|
|
11431
|
+
gtm_review: "Push data to a visual review table hosted at view.gtmnow.com. Users see an interactive AG Grid in their browser with checkboxes to select/deselect rows. Creates a temporary table (24h TTL) with a shareable URL. Use after finding companies or contacts to let the user review before spending enrichment credits. Three actions: create (new table from data array), update (modify existing table \u2014 add columns, update rows), get_selected (fetch only the rows the user has checked)."
|
|
11394
11432
|
};
|
|
11395
11433
|
}
|
|
11396
11434
|
});
|
|
@@ -11410,6 +11448,7 @@ var init_tools = __esm({
|
|
|
11410
11448
|
init_status();
|
|
11411
11449
|
init_configure();
|
|
11412
11450
|
init_feedback();
|
|
11451
|
+
init_review();
|
|
11413
11452
|
init_prospect();
|
|
11414
11453
|
init_enrich();
|
|
11415
11454
|
init_extract();
|
|
@@ -11419,6 +11458,7 @@ var init_tools = __esm({
|
|
|
11419
11458
|
init_crm();
|
|
11420
11459
|
init_status();
|
|
11421
11460
|
init_configure();
|
|
11461
|
+
init_review();
|
|
11422
11462
|
init_descriptions();
|
|
11423
11463
|
capabilityTools = [
|
|
11424
11464
|
...prospectTools,
|
|
@@ -11430,7 +11470,8 @@ var init_tools = __esm({
|
|
|
11430
11470
|
...crmTools,
|
|
11431
11471
|
...statusTools,
|
|
11432
11472
|
...configureTools,
|
|
11433
|
-
...feedbackTools
|
|
11473
|
+
...feedbackTools,
|
|
11474
|
+
...reviewTools
|
|
11434
11475
|
];
|
|
11435
11476
|
guideTool = {
|
|
11436
11477
|
name: "gtm_guide",
|
|
@@ -13202,6 +13243,73 @@ var init_feedback2 = __esm({
|
|
|
13202
13243
|
}
|
|
13203
13244
|
});
|
|
13204
13245
|
|
|
13246
|
+
// src/handlers/review.ts
|
|
13247
|
+
var review_exports = {};
|
|
13248
|
+
__export(review_exports, {
|
|
13249
|
+
handleReview: () => handleReview
|
|
13250
|
+
});
|
|
13251
|
+
async function handleReview(args) {
|
|
13252
|
+
const action = args.action;
|
|
13253
|
+
switch (action) {
|
|
13254
|
+
case "create":
|
|
13255
|
+
return createTable(args);
|
|
13256
|
+
case "update":
|
|
13257
|
+
return updateTable(args);
|
|
13258
|
+
case "get_selected":
|
|
13259
|
+
return getSelected(args);
|
|
13260
|
+
default:
|
|
13261
|
+
throw new Error(`Unknown review action: ${action}`);
|
|
13262
|
+
}
|
|
13263
|
+
}
|
|
13264
|
+
async function createTable(args) {
|
|
13265
|
+
const data = args.data;
|
|
13266
|
+
const title = args.title ?? "Review Table";
|
|
13267
|
+
const rows = data.map((row, i) => ({
|
|
13268
|
+
...row,
|
|
13269
|
+
_row_id: row._row_id ?? `r${i + 1}`
|
|
13270
|
+
}));
|
|
13271
|
+
const response = await fetch(`${VIEWER_URL}/api/tables`, {
|
|
13272
|
+
method: "POST",
|
|
13273
|
+
headers: { "Content-Type": "application/json" },
|
|
13274
|
+
body: JSON.stringify({ title, rows })
|
|
13275
|
+
});
|
|
13276
|
+
if (!response.ok) {
|
|
13277
|
+
const body = await response.json().catch(() => ({}));
|
|
13278
|
+
throw new Error(`Viewer API error ${response.status}: ${JSON.stringify(body)}`);
|
|
13279
|
+
}
|
|
13280
|
+
return response.json();
|
|
13281
|
+
}
|
|
13282
|
+
async function updateTable(args) {
|
|
13283
|
+
const tableId = args.table_id;
|
|
13284
|
+
const rows = args.rows;
|
|
13285
|
+
const response = await fetch(`${VIEWER_URL}/api/tables/${tableId}`, {
|
|
13286
|
+
method: "PATCH",
|
|
13287
|
+
headers: { "Content-Type": "application/json" },
|
|
13288
|
+
body: JSON.stringify({ rows })
|
|
13289
|
+
});
|
|
13290
|
+
if (!response.ok) {
|
|
13291
|
+
const body = await response.json().catch(() => ({}));
|
|
13292
|
+
throw new Error(`Viewer API error ${response.status}: ${JSON.stringify(body)}`);
|
|
13293
|
+
}
|
|
13294
|
+
return response.json();
|
|
13295
|
+
}
|
|
13296
|
+
async function getSelected(args) {
|
|
13297
|
+
const tableId = args.table_id;
|
|
13298
|
+
const response = await fetch(`${VIEWER_URL}/api/tables/${tableId}/selected`);
|
|
13299
|
+
if (!response.ok) {
|
|
13300
|
+
const body = await response.json().catch(() => ({}));
|
|
13301
|
+
throw new Error(`Viewer API error ${response.status}: ${JSON.stringify(body)}`);
|
|
13302
|
+
}
|
|
13303
|
+
return response.json();
|
|
13304
|
+
}
|
|
13305
|
+
var VIEWER_URL;
|
|
13306
|
+
var init_review2 = __esm({
|
|
13307
|
+
"src/handlers/review.ts"() {
|
|
13308
|
+
"use strict";
|
|
13309
|
+
VIEWER_URL = process.env.GTM_VIEWER_URL ?? "https://view.gtmnow.com";
|
|
13310
|
+
}
|
|
13311
|
+
});
|
|
13312
|
+
|
|
13205
13313
|
// src/handlers/index.ts
|
|
13206
13314
|
function isRateLimitError2(error) {
|
|
13207
13315
|
if (error instanceof Error && "status" in error) {
|
|
@@ -13321,6 +13429,10 @@ async function dispatch(name, args, ctx) {
|
|
|
13321
13429
|
const { handleFeedback: handleFeedback2 } = await Promise.resolve().then(() => (init_feedback2(), feedback_exports));
|
|
13322
13430
|
return handleFeedback2(args);
|
|
13323
13431
|
}
|
|
13432
|
+
case "gtm_review": {
|
|
13433
|
+
const { handleReview: handleReview2 } = await Promise.resolve().then(() => (init_review2(), review_exports));
|
|
13434
|
+
return handleReview2(args);
|
|
13435
|
+
}
|
|
13324
13436
|
// ─── Meta-Tools ───────────────────────────────────────
|
|
13325
13437
|
case "gtm_guide": {
|
|
13326
13438
|
const task = args.task;
|
|
@@ -13631,7 +13743,24 @@ var init_validation = __esm({
|
|
|
13631
13743
|
}),
|
|
13632
13744
|
message: z2.string().min(1, "message is required"),
|
|
13633
13745
|
context: z2.record(z2.unknown()).optional()
|
|
13634
|
-
})
|
|
13746
|
+
}),
|
|
13747
|
+
// 17. Review table
|
|
13748
|
+
gtm_review: z2.discriminatedUnion("action", [
|
|
13749
|
+
z2.object({
|
|
13750
|
+
action: z2.literal("create"),
|
|
13751
|
+
title: z2.string().optional(),
|
|
13752
|
+
data: z2.array(z2.record(z2.unknown())).min(1, "data must contain at least 1 row")
|
|
13753
|
+
}),
|
|
13754
|
+
z2.object({
|
|
13755
|
+
action: z2.literal("update"),
|
|
13756
|
+
table_id: z2.string().min(1, "table_id is required for update"),
|
|
13757
|
+
rows: z2.array(z2.record(z2.unknown())).min(1, "rows must contain at least 1 row")
|
|
13758
|
+
}),
|
|
13759
|
+
z2.object({
|
|
13760
|
+
action: z2.literal("get_selected"),
|
|
13761
|
+
table_id: z2.string().min(1, "table_id is required for get_selected")
|
|
13762
|
+
})
|
|
13763
|
+
])
|
|
13635
13764
|
};
|
|
13636
13765
|
TOOL_NAMES = Object.keys(toolSchemas);
|
|
13637
13766
|
}
|