@skillrecordings/cli 0.6.0 → 0.8.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/index.js +206 -46
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8937,14 +8937,14 @@ var require_diagnostics = __commonJS({
|
|
|
8937
8937
|
"undici:client:beforeConnect",
|
|
8938
8938
|
(evt) => {
|
|
8939
8939
|
const {
|
|
8940
|
-
connectParams: { version, protocol, port, host }
|
|
8940
|
+
connectParams: { version: version2, protocol, port, host }
|
|
8941
8941
|
} = evt;
|
|
8942
8942
|
debugLog(
|
|
8943
8943
|
"connecting to %s%s using %s%s",
|
|
8944
8944
|
host,
|
|
8945
8945
|
port ? `:${port}` : "",
|
|
8946
8946
|
protocol,
|
|
8947
|
-
|
|
8947
|
+
version2
|
|
8948
8948
|
);
|
|
8949
8949
|
}
|
|
8950
8950
|
);
|
|
@@ -8952,14 +8952,14 @@ var require_diagnostics = __commonJS({
|
|
|
8952
8952
|
"undici:client:connected",
|
|
8953
8953
|
(evt) => {
|
|
8954
8954
|
const {
|
|
8955
|
-
connectParams: { version, protocol, port, host }
|
|
8955
|
+
connectParams: { version: version2, protocol, port, host }
|
|
8956
8956
|
} = evt;
|
|
8957
8957
|
debugLog(
|
|
8958
8958
|
"connected to %s%s using %s%s",
|
|
8959
8959
|
host,
|
|
8960
8960
|
port ? `:${port}` : "",
|
|
8961
8961
|
protocol,
|
|
8962
|
-
|
|
8962
|
+
version2
|
|
8963
8963
|
);
|
|
8964
8964
|
}
|
|
8965
8965
|
);
|
|
@@ -8967,7 +8967,7 @@ var require_diagnostics = __commonJS({
|
|
|
8967
8967
|
"undici:client:connectError",
|
|
8968
8968
|
(evt) => {
|
|
8969
8969
|
const {
|
|
8970
|
-
connectParams: { version, protocol, port, host },
|
|
8970
|
+
connectParams: { version: version2, protocol, port, host },
|
|
8971
8971
|
error
|
|
8972
8972
|
} = evt;
|
|
8973
8973
|
debugLog(
|
|
@@ -8975,7 +8975,7 @@ var require_diagnostics = __commonJS({
|
|
|
8975
8975
|
host,
|
|
8976
8976
|
port ? `:${port}` : "",
|
|
8977
8977
|
protocol,
|
|
8978
|
-
|
|
8978
|
+
version2,
|
|
8979
8979
|
error.message
|
|
8980
8980
|
);
|
|
8981
8981
|
}
|
|
@@ -46146,10 +46146,10 @@ var require_supports_color = __commonJS({
|
|
|
46146
46146
|
return 3;
|
|
46147
46147
|
}
|
|
46148
46148
|
if ("TERM_PROGRAM" in env) {
|
|
46149
|
-
const
|
|
46149
|
+
const version2 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
46150
46150
|
switch (env.TERM_PROGRAM) {
|
|
46151
46151
|
case "iTerm.app":
|
|
46152
|
-
return
|
|
46152
|
+
return version2 >= 3 ? 3 : 2;
|
|
46153
46153
|
case "Apple_Terminal":
|
|
46154
46154
|
return 2;
|
|
46155
46155
|
}
|
|
@@ -63356,8 +63356,8 @@ var require_trace_mapping_umd = __commonJS({
|
|
|
63356
63356
|
const isString = typeof map2 === "string";
|
|
63357
63357
|
if (!isString && map2._decodedMemo) return map2;
|
|
63358
63358
|
const parsed = parse7(map2);
|
|
63359
|
-
const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;
|
|
63360
|
-
this.version =
|
|
63359
|
+
const { version: version2, file, names, sourceRoot, sources, sourcesContent } = parsed;
|
|
63360
|
+
this.version = version2;
|
|
63361
63361
|
this.file = file;
|
|
63362
63362
|
this.names = names || [];
|
|
63363
63363
|
this.sourceRoot = sourceRoot;
|
|
@@ -74519,6 +74519,7 @@ var require_lib10 = __commonJS({
|
|
|
74519
74519
|
|
|
74520
74520
|
// src/index.ts
|
|
74521
74521
|
init_esm_shims();
|
|
74522
|
+
import { createRequire } from "module";
|
|
74522
74523
|
import { Command as Command4 } from "commander";
|
|
74523
74524
|
|
|
74524
74525
|
// src/commands/auth/index.ts
|
|
@@ -80786,7 +80787,7 @@ function getPriorityTier(label) {
|
|
|
80786
80787
|
return void 0;
|
|
80787
80788
|
}
|
|
80788
80789
|
async function generateProductionClustering(options) {
|
|
80789
|
-
const { phase0Path, outputPath, version = "v1" } = options;
|
|
80790
|
+
const { phase0Path, outputPath, version: version2 = "v1" } = options;
|
|
80790
80791
|
console.log("\u{1F4CA} Reading Phase 0 artifacts...");
|
|
80791
80792
|
const assignments = readPhase0Assignments(phase0Path);
|
|
80792
80793
|
const labels = readPhase0Labels(phase0Path);
|
|
@@ -80850,7 +80851,7 @@ async function generateProductionClustering(options) {
|
|
|
80850
80851
|
}
|
|
80851
80852
|
const totalConversations = Object.keys(assignments).length;
|
|
80852
80853
|
const result = {
|
|
80853
|
-
version,
|
|
80854
|
+
version: version2,
|
|
80854
80855
|
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
80855
80856
|
config: {
|
|
80856
80857
|
algorithm: metrics.algorithm,
|
|
@@ -80999,12 +81000,12 @@ Run Phase 0 clustering first or specify correct --phase0-path`
|
|
|
80999
81000
|
async function faqCluster(options) {
|
|
81000
81001
|
const phase0Path = options.phase0Path ?? DEFAULT_PHASE0_PATH;
|
|
81001
81002
|
const outputPath = options.outputPath ?? DEFAULT_OUTPUT_PATH2;
|
|
81002
|
-
const
|
|
81003
|
+
const version2 = options.version ?? "v1";
|
|
81003
81004
|
console.log("\u{1F52C} Production Clustering Pipeline");
|
|
81004
81005
|
console.log("=".repeat(60));
|
|
81005
81006
|
console.log(` Phase 0 artifacts: ${phase0Path}`);
|
|
81006
81007
|
console.log(` Output path: ${outputPath}`);
|
|
81007
|
-
console.log(` Version: ${
|
|
81008
|
+
console.log(` Version: ${version2}`);
|
|
81008
81009
|
console.log(` Dry run: ${options.dryRun ?? false}`);
|
|
81009
81010
|
console.log("");
|
|
81010
81011
|
try {
|
|
@@ -81014,14 +81015,14 @@ async function faqCluster(options) {
|
|
|
81014
81015
|
const result = await generateProductionClustering({
|
|
81015
81016
|
phase0Path,
|
|
81016
81017
|
outputPath,
|
|
81017
|
-
version
|
|
81018
|
+
version: version2
|
|
81018
81019
|
});
|
|
81019
81020
|
displayClusteringSummary(result);
|
|
81020
81021
|
if (!options.dryRun) {
|
|
81021
81022
|
console.log("\n\u{1F4DD} Writing artifacts...");
|
|
81022
81023
|
writeProductionArtifacts(result, outputPath);
|
|
81023
81024
|
console.log("\n\u2705 Production clustering complete!");
|
|
81024
|
-
console.log(` Artifacts written to: ${join8(outputPath,
|
|
81025
|
+
console.log(` Artifacts written to: ${join8(outputPath, version2)}`);
|
|
81025
81026
|
} else {
|
|
81026
81027
|
console.log("\n\u{1F9EA} Dry run - no artifacts written");
|
|
81027
81028
|
}
|
|
@@ -82083,7 +82084,7 @@ async function extractFaqCandidates(options) {
|
|
|
82083
82084
|
goldenPath,
|
|
82084
82085
|
source,
|
|
82085
82086
|
outputPath,
|
|
82086
|
-
version = "v1",
|
|
82087
|
+
version: version2 = "v1",
|
|
82087
82088
|
minClusterSize = 3,
|
|
82088
82089
|
topN = 5,
|
|
82089
82090
|
dedupThreshold = 0.85,
|
|
@@ -82180,7 +82181,7 @@ async function extractFaqCandidates(options) {
|
|
|
82180
82181
|
const result = {
|
|
82181
82182
|
candidates: deduplicated,
|
|
82182
82183
|
stats: stats4,
|
|
82183
|
-
version,
|
|
82184
|
+
version: version2,
|
|
82184
82185
|
extractedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
82185
82186
|
};
|
|
82186
82187
|
if (!dryRun) {
|
|
@@ -82334,7 +82335,7 @@ async function faqExtract(options) {
|
|
|
82334
82335
|
const goldenPath = options.goldenPath ?? DEFAULT_GOLDEN_PATH;
|
|
82335
82336
|
const outputPath = options.outputPath ?? DEFAULT_OUTPUT_PATH3;
|
|
82336
82337
|
const cachePath = options.cachePath ?? DEFAULT_CACHE_PATH;
|
|
82337
|
-
const
|
|
82338
|
+
const version2 = options.outputVersion ?? "v1";
|
|
82338
82339
|
const applyFilters = options.filters ?? true;
|
|
82339
82340
|
console.log("\u{1F52C} FAQ Extraction Pipeline");
|
|
82340
82341
|
console.log("=".repeat(60));
|
|
@@ -82342,7 +82343,7 @@ async function faqExtract(options) {
|
|
|
82342
82343
|
console.log(` Golden: ${goldenPath}`);
|
|
82343
82344
|
console.log(` Output: ${outputPath}`);
|
|
82344
82345
|
console.log(` DuckDB cache: ${cachePath}`);
|
|
82345
|
-
console.log(` Version: ${
|
|
82346
|
+
console.log(` Version: ${version2}`);
|
|
82346
82347
|
console.log(` Apply filters: ${applyFilters}`);
|
|
82347
82348
|
console.log(` Push to Redis: ${options.pushRedis ?? false}`);
|
|
82348
82349
|
console.log(` Dry run: ${options.dryRun ?? false}`);
|
|
@@ -82369,7 +82370,7 @@ Run \`bun src/index.ts front-cache sync\` first to populate cache.`
|
|
|
82369
82370
|
goldenPath: existsSync9(goldenPath) ? goldenPath : void 0,
|
|
82370
82371
|
source,
|
|
82371
82372
|
outputPath,
|
|
82372
|
-
version,
|
|
82373
|
+
version: version2,
|
|
82373
82374
|
minClusterSize: options.minClusterSize ?? 3,
|
|
82374
82375
|
topN: options.topN ?? 5,
|
|
82375
82376
|
dedupThreshold: options.dedupThreshold ?? 0.85,
|
|
@@ -82407,7 +82408,7 @@ Run \`bun src/index.ts front-cache sync\` first to populate cache.`
|
|
|
82407
82408
|
if (!options.dryRun) {
|
|
82408
82409
|
console.log(`
|
|
82409
82410
|
\u2705 Extraction complete!`);
|
|
82410
|
-
console.log(` Artifacts written to: ${join10(outputPath,
|
|
82411
|
+
console.log(` Artifacts written to: ${join10(outputPath, version2)}`);
|
|
82411
82412
|
if (options.pushRedis && options.app) {
|
|
82412
82413
|
console.log(
|
|
82413
82414
|
` Candidates pushed to Redis queue: faq:pending:${options.app}`
|
|
@@ -93178,6 +93179,162 @@ function registerReportCommand(front) {
|
|
|
93178
93179
|
).option("--json", "Output as JSON").action(generateReport);
|
|
93179
93180
|
}
|
|
93180
93181
|
|
|
93182
|
+
// src/commands/front/search.ts
|
|
93183
|
+
init_esm_shims();
|
|
93184
|
+
function getFrontClient7() {
|
|
93185
|
+
const apiToken = process.env.FRONT_API_TOKEN;
|
|
93186
|
+
if (!apiToken) {
|
|
93187
|
+
throw new Error("FRONT_API_TOKEN environment variable is required");
|
|
93188
|
+
}
|
|
93189
|
+
return createInstrumentedFrontClient({ apiToken });
|
|
93190
|
+
}
|
|
93191
|
+
function formatTimestamp2(ts) {
|
|
93192
|
+
return new Date(ts * 1e3).toLocaleString("en-US", {
|
|
93193
|
+
month: "short",
|
|
93194
|
+
day: "numeric",
|
|
93195
|
+
hour: "2-digit",
|
|
93196
|
+
minute: "2-digit"
|
|
93197
|
+
});
|
|
93198
|
+
}
|
|
93199
|
+
function truncate2(str2, len) {
|
|
93200
|
+
if (str2.length <= len) return str2;
|
|
93201
|
+
return str2.slice(0, len - 3) + "...";
|
|
93202
|
+
}
|
|
93203
|
+
function buildQuery(query, options) {
|
|
93204
|
+
const parts = [query];
|
|
93205
|
+
if (options.inbox) parts.push(`inbox:${options.inbox}`);
|
|
93206
|
+
if (options.tag) parts.push(`tag:${options.tag}`);
|
|
93207
|
+
if (options.assignee) parts.push(`assignee:${options.assignee}`);
|
|
93208
|
+
if (options.status) parts.push(`is:${options.status}`);
|
|
93209
|
+
if (options.from) parts.push(`from:${options.from}`);
|
|
93210
|
+
if (options.after) parts.push(`after:${options.after}`);
|
|
93211
|
+
if (options.before) parts.push(`before:${options.before}`);
|
|
93212
|
+
return parts.filter(Boolean).join(" ");
|
|
93213
|
+
}
|
|
93214
|
+
async function searchConversations(query, options) {
|
|
93215
|
+
try {
|
|
93216
|
+
const front = getFrontClient7();
|
|
93217
|
+
const fullQuery = buildQuery(query, options);
|
|
93218
|
+
const limit2 = parseInt(String(options.limit ?? "25"), 10);
|
|
93219
|
+
const resolvedLimit = Number.isFinite(limit2) && limit2 > 0 ? limit2 : void 0;
|
|
93220
|
+
const conversations = [];
|
|
93221
|
+
let nextUrl = `/conversations/search/${encodeURIComponent(fullQuery)}`;
|
|
93222
|
+
while (nextUrl) {
|
|
93223
|
+
const response = await front.raw.get(nextUrl);
|
|
93224
|
+
conversations.push(...response._results ?? []);
|
|
93225
|
+
if (!options.json) {
|
|
93226
|
+
process.stdout.write(`\r Searching... ${conversations.length} results`);
|
|
93227
|
+
}
|
|
93228
|
+
nextUrl = response._pagination?.next || null;
|
|
93229
|
+
if (resolvedLimit && conversations.length >= resolvedLimit) {
|
|
93230
|
+
conversations.splice(resolvedLimit);
|
|
93231
|
+
break;
|
|
93232
|
+
}
|
|
93233
|
+
}
|
|
93234
|
+
if (!options.json) {
|
|
93235
|
+
console.log("");
|
|
93236
|
+
}
|
|
93237
|
+
if (options.json) {
|
|
93238
|
+
console.log(
|
|
93239
|
+
JSON.stringify(
|
|
93240
|
+
hateoasWrap({
|
|
93241
|
+
type: "search-results",
|
|
93242
|
+
command: `skill front search ${JSON.stringify(fullQuery)} --json`,
|
|
93243
|
+
data: {
|
|
93244
|
+
query: fullQuery,
|
|
93245
|
+
total: conversations.length,
|
|
93246
|
+
conversations
|
|
93247
|
+
},
|
|
93248
|
+
links: conversationListLinks(
|
|
93249
|
+
conversations.map((c) => ({ id: c.id, subject: c.subject }))
|
|
93250
|
+
),
|
|
93251
|
+
actions: options.inbox ? conversationListActions(options.inbox) : []
|
|
93252
|
+
}),
|
|
93253
|
+
null,
|
|
93254
|
+
2
|
|
93255
|
+
)
|
|
93256
|
+
);
|
|
93257
|
+
return;
|
|
93258
|
+
}
|
|
93259
|
+
console.log(`
|
|
93260
|
+
\u{1F50D} Search: ${fullQuery}`);
|
|
93261
|
+
console.log(` ${conversations.length} results`);
|
|
93262
|
+
console.log("-".repeat(80));
|
|
93263
|
+
if (conversations.length === 0) {
|
|
93264
|
+
console.log(" (no conversations found)");
|
|
93265
|
+
console.log("");
|
|
93266
|
+
return;
|
|
93267
|
+
}
|
|
93268
|
+
for (const conv of conversations) {
|
|
93269
|
+
const statusIcon = conv.status === "archived" ? "\u{1F4E6}" : conv.status === "assigned" ? "\u{1F464}" : "\u2753";
|
|
93270
|
+
const time = formatTimestamp2(conv.created_at);
|
|
93271
|
+
const assignee = conv.assignee ? conv.assignee.email : "unassigned";
|
|
93272
|
+
const tags = conv.tags && conv.tags.length > 0 ? conv.tags.map((t2) => t2.name).join(", ") : "";
|
|
93273
|
+
console.log(
|
|
93274
|
+
`
|
|
93275
|
+
[${statusIcon}] ${truncate2(conv.subject || "(no subject)", 80)}`
|
|
93276
|
+
);
|
|
93277
|
+
console.log(` ${conv.id} ${assignee} ${time}`);
|
|
93278
|
+
if (tags) {
|
|
93279
|
+
console.log(` Tags: ${tags}`);
|
|
93280
|
+
}
|
|
93281
|
+
}
|
|
93282
|
+
console.log("");
|
|
93283
|
+
} catch (error) {
|
|
93284
|
+
if (options.json) {
|
|
93285
|
+
console.error(
|
|
93286
|
+
JSON.stringify({
|
|
93287
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
93288
|
+
})
|
|
93289
|
+
);
|
|
93290
|
+
} else {
|
|
93291
|
+
console.error(
|
|
93292
|
+
"Error:",
|
|
93293
|
+
error instanceof Error ? error.message : "Unknown error"
|
|
93294
|
+
);
|
|
93295
|
+
}
|
|
93296
|
+
process.exit(1);
|
|
93297
|
+
}
|
|
93298
|
+
}
|
|
93299
|
+
function registerSearchCommand(frontCommand) {
|
|
93300
|
+
frontCommand.command("search").description(
|
|
93301
|
+
"Search conversations (text, subject, filters). See https://dev.frontapp.com/docs/search-1"
|
|
93302
|
+
).argument(
|
|
93303
|
+
"<query>",
|
|
93304
|
+
'Search query (text, "exact phrase", or filter syntax)'
|
|
93305
|
+
).option("--inbox <id>", "Filter by inbox ID (inb_xxx)").option("--tag <id>", "Filter by tag ID (tag_xxx)").option("--assignee <id>", "Filter by assignee (tea_xxx)").option(
|
|
93306
|
+
"--status <status>",
|
|
93307
|
+
"Filter by status (open, archived, assigned, unassigned, unreplied, snoozed, resolved)"
|
|
93308
|
+
).option("--from <email>", "Filter by sender email").option("--after <timestamp>", "Filter after Unix timestamp").option("--before <timestamp>", "Filter before Unix timestamp").option("--limit <n>", "Max results (default 25)", "25").option("--json", "Output as JSON").addHelpText(
|
|
93309
|
+
"after",
|
|
93310
|
+
`
|
|
93311
|
+
Front Search Query Syntax:
|
|
93312
|
+
Text search: "exact phrase" or word1 word2 (AND logic)
|
|
93313
|
+
inbox:inb_xxx Filter by inbox
|
|
93314
|
+
tag:tag_xxx Filter by tag
|
|
93315
|
+
from:email Filter by sender
|
|
93316
|
+
to:email Filter by recipient
|
|
93317
|
+
recipient:email Filter by email/handle
|
|
93318
|
+
assignee:tea_x Filter by assigned teammate
|
|
93319
|
+
participant:t Filter by participating teammate
|
|
93320
|
+
is:open Status: open, archived, assigned, unassigned,
|
|
93321
|
+
unreplied, snoozed, resolved, waiting
|
|
93322
|
+
before:<ts> Before Unix timestamp
|
|
93323
|
+
after:<ts> After Unix timestamp
|
|
93324
|
+
during:<ts> During day of Unix timestamp
|
|
93325
|
+
custom_field:"Name=value"
|
|
93326
|
+
|
|
93327
|
+
Multiple filters = AND. Multiple from/to/cc/bcc = OR. Max 15 filters.
|
|
93328
|
+
|
|
93329
|
+
Examples:
|
|
93330
|
+
skill front search "payment failed" --inbox inb_4bj7r
|
|
93331
|
+
skill front search "upgrade" --status unassigned --from user@example.com
|
|
93332
|
+
skill front search "from:dale@a.com tag:tag_14nmdp" --limit 50
|
|
93333
|
+
skill front search "is:unreplied" --inbox inb_4bj7r --after 1706745600
|
|
93334
|
+
`
|
|
93335
|
+
).action(searchConversations);
|
|
93336
|
+
}
|
|
93337
|
+
|
|
93181
93338
|
// src/commands/front/tags.ts
|
|
93182
93339
|
init_esm_shims();
|
|
93183
93340
|
import { confirm as confirm3 } from "@inquirer/prompts";
|
|
@@ -93249,7 +93406,7 @@ async function createTagRaw(params) {
|
|
|
93249
93406
|
const front = createInstrumentedFrontClient({ apiToken });
|
|
93250
93407
|
await front.raw.post("/tags", body);
|
|
93251
93408
|
}
|
|
93252
|
-
function
|
|
93409
|
+
function truncate3(str2, len) {
|
|
93253
93410
|
if (str2.length <= len) return str2;
|
|
93254
93411
|
return str2.slice(0, len - 3) + "...";
|
|
93255
93412
|
}
|
|
@@ -93342,7 +93499,7 @@ ${header} (${filteredTags.length}):`);
|
|
|
93342
93499
|
const highlight = tag.highlight || "-";
|
|
93343
93500
|
const countStr = tag.conversation_count === 0 ? "0 \u26A0\uFE0F" : tag.conversation_count.toString();
|
|
93344
93501
|
console.log(
|
|
93345
|
-
`${
|
|
93502
|
+
`${truncate3(tag.id, 20).padEnd(20)} ${truncate3(tag.name, 30).padEnd(30)} ${highlight.padEnd(10)} ${countStr.padEnd(8)}`
|
|
93346
93503
|
);
|
|
93347
93504
|
}
|
|
93348
93505
|
console.log("");
|
|
@@ -93735,7 +93892,7 @@ function registerTagCommands(frontCommand) {
|
|
|
93735
93892
|
|
|
93736
93893
|
// src/commands/front/triage.ts
|
|
93737
93894
|
init_esm_shims();
|
|
93738
|
-
function
|
|
93895
|
+
function getFrontClient8() {
|
|
93739
93896
|
const apiToken = process.env.FRONT_API_TOKEN;
|
|
93740
93897
|
if (!apiToken) {
|
|
93741
93898
|
throw new Error("FRONT_API_TOKEN environment variable is required");
|
|
@@ -93774,7 +93931,7 @@ function categorizeConversation(conversation) {
|
|
|
93774
93931
|
}
|
|
93775
93932
|
return { category: "actionable", reason: "Real support issue" };
|
|
93776
93933
|
}
|
|
93777
|
-
function
|
|
93934
|
+
function formatTimestamp3(ts) {
|
|
93778
93935
|
return new Date(ts * 1e3).toLocaleString("en-US", {
|
|
93779
93936
|
month: "short",
|
|
93780
93937
|
day: "numeric",
|
|
@@ -93790,7 +93947,7 @@ async function triageConversations(options) {
|
|
|
93790
93947
|
json = false
|
|
93791
93948
|
} = options;
|
|
93792
93949
|
try {
|
|
93793
|
-
const front =
|
|
93950
|
+
const front = getFrontClient8();
|
|
93794
93951
|
if (!json) {
|
|
93795
93952
|
console.log(`
|
|
93796
93953
|
Fetching ${status} conversations from inbox ${inbox}...`);
|
|
@@ -93871,7 +94028,7 @@ Fetching ${status} conversations from inbox ${inbox}...`);
|
|
|
93871
94028
|
if (byCategory.actionable.length > 0) {
|
|
93872
94029
|
console.log(`\u2705 ACTIONABLE (${byCategory.actionable.length}):`);
|
|
93873
94030
|
for (const r of byCategory.actionable.sort((a, b) => b.created_at - a.created_at).slice(0, 10)) {
|
|
93874
|
-
console.log(` ${r.id} - ${
|
|
94031
|
+
console.log(` ${r.id} - ${formatTimestamp3(r.created_at)}`);
|
|
93875
94032
|
console.log(` From: ${r.senderEmail}`);
|
|
93876
94033
|
console.log(` Subject: ${r.subject}`);
|
|
93877
94034
|
console.log(` \u2192 ${r.reason}`);
|
|
@@ -93957,7 +94114,7 @@ function registerTriageCommand(front) {
|
|
|
93957
94114
|
}
|
|
93958
94115
|
|
|
93959
94116
|
// src/commands/front/index.ts
|
|
93960
|
-
function
|
|
94117
|
+
function getFrontClient9() {
|
|
93961
94118
|
const apiToken = process.env.FRONT_API_TOKEN;
|
|
93962
94119
|
if (!apiToken) {
|
|
93963
94120
|
throw new Error("FRONT_API_TOKEN environment variable is required");
|
|
@@ -93971,7 +94128,7 @@ function getFrontSdkClient2() {
|
|
|
93971
94128
|
}
|
|
93972
94129
|
return createInstrumentedFrontClient({ apiToken });
|
|
93973
94130
|
}
|
|
93974
|
-
function
|
|
94131
|
+
function formatTimestamp4(ts) {
|
|
93975
94132
|
return new Date(ts * 1e3).toLocaleString("en-US", {
|
|
93976
94133
|
month: "short",
|
|
93977
94134
|
day: "numeric",
|
|
@@ -93979,7 +94136,7 @@ function formatTimestamp3(ts) {
|
|
|
93979
94136
|
minute: "2-digit"
|
|
93980
94137
|
});
|
|
93981
94138
|
}
|
|
93982
|
-
function
|
|
94139
|
+
function truncate4(str2, len) {
|
|
93983
94140
|
if (str2.length <= len) return str2;
|
|
93984
94141
|
return str2.slice(0, len - 3) + "...";
|
|
93985
94142
|
}
|
|
@@ -93988,7 +94145,7 @@ function normalizeId6(idOrUrl) {
|
|
|
93988
94145
|
}
|
|
93989
94146
|
async function getMessage(id, options) {
|
|
93990
94147
|
try {
|
|
93991
|
-
const front =
|
|
94148
|
+
const front = getFrontClient9();
|
|
93992
94149
|
const message = await front.messages.get(normalizeId6(id));
|
|
93993
94150
|
if (options.json) {
|
|
93994
94151
|
console.log(
|
|
@@ -94009,7 +94166,7 @@ async function getMessage(id, options) {
|
|
|
94009
94166
|
console.log(` ID: ${message.id}`);
|
|
94010
94167
|
console.log(` Type: ${message.type}`);
|
|
94011
94168
|
console.log(` Subject: ${message.subject || "(none)"}`);
|
|
94012
|
-
console.log(` Created: ${
|
|
94169
|
+
console.log(` Created: ${formatTimestamp4(message.created_at)}`);
|
|
94013
94170
|
if (message.author) {
|
|
94014
94171
|
console.log(` Author: ${message.author.email || message.author.id}`);
|
|
94015
94172
|
}
|
|
@@ -94022,7 +94179,7 @@ async function getMessage(id, options) {
|
|
|
94022
94179
|
console.log(
|
|
94023
94180
|
` Length: ${message.body.length} chars (HTML), ${textBody.length} chars (text)`
|
|
94024
94181
|
);
|
|
94025
|
-
console.log(` Preview: ${
|
|
94182
|
+
console.log(` Preview: ${truncate4(textBody, 500)}`);
|
|
94026
94183
|
if (message.attachments && message.attachments.length > 0) {
|
|
94027
94184
|
console.log(`
|
|
94028
94185
|
\u{1F4CE} Attachments: ${message.attachments.length}`);
|
|
@@ -94049,7 +94206,7 @@ async function getMessage(id, options) {
|
|
|
94049
94206
|
}
|
|
94050
94207
|
async function getConversation2(id, options) {
|
|
94051
94208
|
try {
|
|
94052
|
-
const front =
|
|
94209
|
+
const front = getFrontClient9();
|
|
94053
94210
|
const conversation = await front.conversations.get(normalizeId6(id));
|
|
94054
94211
|
let messages;
|
|
94055
94212
|
if (options.messages) {
|
|
@@ -94079,7 +94236,7 @@ async function getConversation2(id, options) {
|
|
|
94079
94236
|
console.log(` ID: ${conversation.id}`);
|
|
94080
94237
|
console.log(` Subject: ${conversation.subject || "(none)"}`);
|
|
94081
94238
|
console.log(` Status: ${conversation.status}`);
|
|
94082
|
-
console.log(` Created: ${
|
|
94239
|
+
console.log(` Created: ${formatTimestamp4(conversation.created_at)}`);
|
|
94083
94240
|
if (conversation.recipient) {
|
|
94084
94241
|
console.log(` Recipient: ${conversation.recipient.handle}`);
|
|
94085
94242
|
}
|
|
@@ -94098,11 +94255,11 @@ async function getConversation2(id, options) {
|
|
|
94098
94255
|
for (const msg of messages) {
|
|
94099
94256
|
const direction = msg.is_inbound ? "\u2190 IN" : "\u2192 OUT";
|
|
94100
94257
|
const author = msg.author?.email || "unknown";
|
|
94101
|
-
const time =
|
|
94258
|
+
const time = formatTimestamp4(msg.created_at);
|
|
94102
94259
|
const textBody = msg.text || msg.body.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
|
|
94103
94260
|
console.log(`
|
|
94104
94261
|
[${direction}] ${time} - ${author}`);
|
|
94105
|
-
console.log(` ${
|
|
94262
|
+
console.log(` ${truncate4(textBody, 200)}`);
|
|
94106
94263
|
}
|
|
94107
94264
|
} else if (!options.messages) {
|
|
94108
94265
|
console.log("\n (use --messages to see message history)");
|
|
@@ -94241,6 +94398,7 @@ function registerFrontCommands(program3) {
|
|
|
94241
94398
|
registerAssignCommand(front);
|
|
94242
94399
|
registerConversationTagCommands(front);
|
|
94243
94400
|
registerReplyCommand(front);
|
|
94401
|
+
registerSearchCommand(front);
|
|
94244
94402
|
registerApiCommand(front);
|
|
94245
94403
|
}
|
|
94246
94404
|
|
|
@@ -94768,7 +94926,7 @@ var InngestClient = class {
|
|
|
94768
94926
|
};
|
|
94769
94927
|
|
|
94770
94928
|
// src/commands/inngest/events.ts
|
|
94771
|
-
function
|
|
94929
|
+
function formatTimestamp5(iso) {
|
|
94772
94930
|
const date = new Date(iso);
|
|
94773
94931
|
return date.toLocaleString("en-US", {
|
|
94774
94932
|
month: "short",
|
|
@@ -94792,7 +94950,7 @@ function printEventsTable(events) {
|
|
|
94792
94950
|
console.log("-".repeat(86));
|
|
94793
94951
|
for (const event of events) {
|
|
94794
94952
|
console.log(
|
|
94795
|
-
pad(event.internal_id, 24) + " " + pad(event.name, 40) + " " + pad(
|
|
94953
|
+
pad(event.internal_id, 24) + " " + pad(event.name, 40) + " " + pad(formatTimestamp5(event.received_at), 20)
|
|
94796
94954
|
);
|
|
94797
94955
|
}
|
|
94798
94956
|
console.log("");
|
|
@@ -94808,7 +94966,7 @@ function printRunsTable(runs) {
|
|
|
94808
94966
|
console.log("-".repeat(94));
|
|
94809
94967
|
for (const run3 of runs) {
|
|
94810
94968
|
console.log(
|
|
94811
|
-
pad(run3.run_id, 30) + " " + pad(run3.function_id, 30) + " " + pad(run3.status, 12) + " " + pad(
|
|
94969
|
+
pad(run3.run_id, 30) + " " + pad(run3.function_id, 30) + " " + pad(run3.status, 12) + " " + pad(formatTimestamp5(run3.run_started_at), 20)
|
|
94812
94970
|
);
|
|
94813
94971
|
}
|
|
94814
94972
|
console.log("");
|
|
@@ -94871,7 +95029,7 @@ async function getEvent(id, options) {
|
|
|
94871
95029
|
console.log("\n\u{1F4CB} Event Details:");
|
|
94872
95030
|
console.log(` ID: ${event.internal_id}`);
|
|
94873
95031
|
console.log(` Name: ${event.name}`);
|
|
94874
|
-
console.log(` Received: ${
|
|
95032
|
+
console.log(` Received: ${formatTimestamp5(event.received_at)}`);
|
|
94875
95033
|
console.log(
|
|
94876
95034
|
` Data: ${event.data ? JSON.stringify(event.data, null, 2) : "(null)"}`
|
|
94877
95035
|
);
|
|
@@ -112423,7 +112581,7 @@ function formatDate3(date) {
|
|
|
112423
112581
|
minute: "2-digit"
|
|
112424
112582
|
});
|
|
112425
112583
|
}
|
|
112426
|
-
function
|
|
112584
|
+
function truncate5(str2, len) {
|
|
112427
112585
|
if (!str2) return "";
|
|
112428
112586
|
if (str2.length <= len) return str2;
|
|
112429
112587
|
return str2.slice(0, len - 3) + "...";
|
|
@@ -112633,7 +112791,7 @@ ${ratingIcon} [${formatDate3(r.createdAt)}] ${r.appSlug}`);
|
|
|
112633
112791
|
console.log(` Customer: ${r.customerDisplay}`);
|
|
112634
112792
|
console.log(` Category: ${r.category}`);
|
|
112635
112793
|
console.log(
|
|
112636
|
-
` Response: ${
|
|
112794
|
+
` Response: ${truncate5(r.response.replace(/\n/g, " "), 200)}`
|
|
112637
112795
|
);
|
|
112638
112796
|
console.log(` ID: ${r.actionId}`);
|
|
112639
112797
|
if (r.rating) {
|
|
@@ -112792,7 +112950,7 @@ async function getResponse(actionId, options) {
|
|
|
112792
112950
|
const time = new Date(msg.createdAt * 1e3).toLocaleString();
|
|
112793
112951
|
console.log(`
|
|
112794
112952
|
[${dir}] ${time} - ${msg.author ?? "unknown"}`);
|
|
112795
|
-
console.log(
|
|
112953
|
+
console.log(truncate5(msg.body, 500));
|
|
112796
112954
|
}
|
|
112797
112955
|
}
|
|
112798
112956
|
console.log("");
|
|
@@ -113361,8 +113519,10 @@ async function wizard(options = {}) {
|
|
|
113361
113519
|
}
|
|
113362
113520
|
|
|
113363
113521
|
// src/index.ts
|
|
113522
|
+
var require2 = createRequire(import.meta.url);
|
|
113523
|
+
var { version } = require2("../package.json");
|
|
113364
113524
|
var program2 = new Command4();
|
|
113365
|
-
program2.name("skill").description("CLI tool for managing app integrations").version(
|
|
113525
|
+
program2.name("skill").description("CLI tool for managing app integrations").version(version);
|
|
113366
113526
|
program2.command("init").description("Initialize a new app integration (quick mode)").argument(
|
|
113367
113527
|
"[name]",
|
|
113368
113528
|
"Name of the integration (required in non-interactive mode)"
|