@skillrecordings/cli 0.10.0 → 0.10.1
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 +226 -246
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -91673,6 +91673,51 @@ init_esm_shims();
|
|
|
91673
91673
|
|
|
91674
91674
|
// src/commands/front/api.ts
|
|
91675
91675
|
init_esm_shims();
|
|
91676
|
+
|
|
91677
|
+
// src/commands/front/json-output.ts
|
|
91678
|
+
init_esm_shims();
|
|
91679
|
+
import { mkdirSync as mkdirSync5, writeFileSync as writeFileSync8 } from "fs";
|
|
91680
|
+
import { tmpdir as tmpdir2 } from "os";
|
|
91681
|
+
import { join as join12 } from "path";
|
|
91682
|
+
var STDOUT_LIMIT = 64 * 1024;
|
|
91683
|
+
function writeJsonOutput(data2) {
|
|
91684
|
+
const json = JSON.stringify(data2, null, 2);
|
|
91685
|
+
if (json.length <= STDOUT_LIMIT) {
|
|
91686
|
+
console.log(json);
|
|
91687
|
+
return;
|
|
91688
|
+
}
|
|
91689
|
+
const dir = join12(tmpdir2(), "skill-front");
|
|
91690
|
+
mkdirSync5(dir, { recursive: true });
|
|
91691
|
+
const filepath = join12(dir, `${Date.now()}.json`);
|
|
91692
|
+
writeFileSync8(filepath, json);
|
|
91693
|
+
const envelope = {
|
|
91694
|
+
_type: data2?._type ?? "result",
|
|
91695
|
+
_file: filepath,
|
|
91696
|
+
_size: `${(json.length / 1024).toFixed(1)}KB`,
|
|
91697
|
+
_hint: `cat ${filepath} | jq`
|
|
91698
|
+
};
|
|
91699
|
+
const d = data2;
|
|
91700
|
+
if (d.data && typeof d.data === "object") {
|
|
91701
|
+
const inner = d.data;
|
|
91702
|
+
if (inner.total !== void 0) envelope.total = inner.total;
|
|
91703
|
+
if (inner.query !== void 0) envelope.query = inner.query;
|
|
91704
|
+
if (Array.isArray(inner.conversations)) {
|
|
91705
|
+
envelope.conversations = inner.conversations.map(
|
|
91706
|
+
(c) => ({
|
|
91707
|
+
id: c.id,
|
|
91708
|
+
subject: c.subject,
|
|
91709
|
+
status: c.status
|
|
91710
|
+
})
|
|
91711
|
+
);
|
|
91712
|
+
}
|
|
91713
|
+
}
|
|
91714
|
+
if (Array.isArray(d._actions) && d._actions.length > 0) {
|
|
91715
|
+
envelope._actions = d._actions;
|
|
91716
|
+
}
|
|
91717
|
+
console.log(JSON.stringify(envelope, null, 2));
|
|
91718
|
+
}
|
|
91719
|
+
|
|
91720
|
+
// src/commands/front/api.ts
|
|
91676
91721
|
function getFrontClient() {
|
|
91677
91722
|
const apiToken = process.env.FRONT_API_TOKEN;
|
|
91678
91723
|
if (!apiToken) {
|
|
@@ -91714,7 +91759,7 @@ async function apiPassthrough(method, endpoint, options) {
|
|
|
91714
91759
|
`Unsupported method: ${method}. Use GET, POST, PATCH, PUT, or DELETE.`
|
|
91715
91760
|
);
|
|
91716
91761
|
}
|
|
91717
|
-
|
|
91762
|
+
writeJsonOutput(result);
|
|
91718
91763
|
}
|
|
91719
91764
|
function registerApiCommand(frontCommand) {
|
|
91720
91765
|
frontCommand.command("api").description("Raw Front API request (escape hatch)").argument("<method>", "HTTP method (GET, POST, PATCH, PUT, DELETE)").argument(
|
|
@@ -92078,16 +92123,12 @@ async function archiveConversations(convId, additionalIds, options) {
|
|
|
92078
92123
|
};
|
|
92079
92124
|
})
|
|
92080
92125
|
);
|
|
92081
|
-
|
|
92082
|
-
|
|
92083
|
-
|
|
92084
|
-
|
|
92085
|
-
|
|
92086
|
-
|
|
92087
|
-
}),
|
|
92088
|
-
null,
|
|
92089
|
-
2
|
|
92090
|
-
)
|
|
92126
|
+
writeJsonOutput(
|
|
92127
|
+
hateoasWrap({
|
|
92128
|
+
type: "archive-result",
|
|
92129
|
+
command: `skill front archive ${allIds.map(normalizeId).join(" ")} --json`,
|
|
92130
|
+
data: results2
|
|
92131
|
+
})
|
|
92091
92132
|
);
|
|
92092
92133
|
return;
|
|
92093
92134
|
}
|
|
@@ -92207,20 +92248,16 @@ async function assignConversation(conversationId, teammateId, options) {
|
|
|
92207
92248
|
const assigneeId = options.unassign ? "" : normalizeId2(teammateId);
|
|
92208
92249
|
await front.conversations.updateAssignee(convId, assigneeId);
|
|
92209
92250
|
if (options.json) {
|
|
92210
|
-
|
|
92211
|
-
|
|
92212
|
-
|
|
92213
|
-
|
|
92214
|
-
|
|
92215
|
-
|
|
92216
|
-
|
|
92217
|
-
|
|
92218
|
-
|
|
92219
|
-
|
|
92220
|
-
}),
|
|
92221
|
-
null,
|
|
92222
|
-
2
|
|
92223
|
-
)
|
|
92251
|
+
writeJsonOutput(
|
|
92252
|
+
hateoasWrap({
|
|
92253
|
+
type: "assign-result",
|
|
92254
|
+
command: options.unassign ? `skill front assign ${convId} --unassign --json` : `skill front assign ${convId} ${assigneeId} --json`,
|
|
92255
|
+
data: {
|
|
92256
|
+
id: convId,
|
|
92257
|
+
assignee: options.unassign ? null : assigneeId,
|
|
92258
|
+
success: true
|
|
92259
|
+
}
|
|
92260
|
+
})
|
|
92224
92261
|
);
|
|
92225
92262
|
} else {
|
|
92226
92263
|
if (options.unassign) {
|
|
@@ -92462,16 +92499,12 @@ Found ${result.matches.length} matching conversations`);
|
|
|
92462
92499
|
}
|
|
92463
92500
|
if (dryRun) {
|
|
92464
92501
|
if (json) {
|
|
92465
|
-
|
|
92466
|
-
|
|
92467
|
-
|
|
92468
|
-
|
|
92469
|
-
|
|
92470
|
-
|
|
92471
|
-
}),
|
|
92472
|
-
null,
|
|
92473
|
-
2
|
|
92474
|
-
)
|
|
92502
|
+
writeJsonOutput(
|
|
92503
|
+
hateoasWrap({
|
|
92504
|
+
type: "bulk-archive-result",
|
|
92505
|
+
command: `skill front bulk-archive --inbox ${inbox} --dry-run --json`,
|
|
92506
|
+
data: result
|
|
92507
|
+
})
|
|
92475
92508
|
);
|
|
92476
92509
|
} else {
|
|
92477
92510
|
console.log("\nMatching conversations:");
|
|
@@ -92491,16 +92524,12 @@ Run without --dry-run to archive ${result.matches.length} conversation(s)`
|
|
|
92491
92524
|
if (!json) {
|
|
92492
92525
|
console.log("\nNo conversations to archive.");
|
|
92493
92526
|
} else {
|
|
92494
|
-
|
|
92495
|
-
|
|
92496
|
-
|
|
92497
|
-
|
|
92498
|
-
|
|
92499
|
-
|
|
92500
|
-
}),
|
|
92501
|
-
null,
|
|
92502
|
-
2
|
|
92503
|
-
)
|
|
92527
|
+
writeJsonOutput(
|
|
92528
|
+
hateoasWrap({
|
|
92529
|
+
type: "bulk-archive-result",
|
|
92530
|
+
command: `skill front bulk-archive --inbox ${inbox} --json`,
|
|
92531
|
+
data: result
|
|
92532
|
+
})
|
|
92504
92533
|
);
|
|
92505
92534
|
}
|
|
92506
92535
|
return;
|
|
@@ -92530,16 +92559,12 @@ Run without --dry-run to archive ${result.matches.length} conversation(s)`
|
|
|
92530
92559
|
await new Promise((r) => setTimeout(r, 150));
|
|
92531
92560
|
}
|
|
92532
92561
|
if (json) {
|
|
92533
|
-
|
|
92534
|
-
|
|
92535
|
-
|
|
92536
|
-
|
|
92537
|
-
|
|
92538
|
-
|
|
92539
|
-
}),
|
|
92540
|
-
null,
|
|
92541
|
-
2
|
|
92542
|
-
)
|
|
92562
|
+
writeJsonOutput(
|
|
92563
|
+
hateoasWrap({
|
|
92564
|
+
type: "bulk-archive-result",
|
|
92565
|
+
command: `skill front bulk-archive --inbox ${inbox} --json`,
|
|
92566
|
+
data: result
|
|
92567
|
+
})
|
|
92543
92568
|
);
|
|
92544
92569
|
} else {
|
|
92545
92570
|
console.log("\n\nBulk Archive Results:");
|
|
@@ -92683,21 +92708,17 @@ async function tagConversation(convId, tagNameOrId, options) {
|
|
|
92683
92708
|
const tag = await resolveTag(front, tagNameOrId);
|
|
92684
92709
|
await front.conversations.addTag(normalizedConvId, tag.id);
|
|
92685
92710
|
if (options.json) {
|
|
92686
|
-
|
|
92687
|
-
|
|
92688
|
-
|
|
92689
|
-
|
|
92690
|
-
|
|
92691
|
-
|
|
92692
|
-
|
|
92693
|
-
|
|
92694
|
-
|
|
92695
|
-
|
|
92696
|
-
|
|
92697
|
-
}),
|
|
92698
|
-
null,
|
|
92699
|
-
2
|
|
92700
|
-
)
|
|
92711
|
+
writeJsonOutput(
|
|
92712
|
+
hateoasWrap({
|
|
92713
|
+
type: "tag-result",
|
|
92714
|
+
command: `skill front tag ${normalizedConvId} ${tagNameOrId} --json`,
|
|
92715
|
+
data: {
|
|
92716
|
+
conversationId: normalizedConvId,
|
|
92717
|
+
tagId: tag.id,
|
|
92718
|
+
tagName: tag.name,
|
|
92719
|
+
action: "added"
|
|
92720
|
+
}
|
|
92721
|
+
})
|
|
92701
92722
|
);
|
|
92702
92723
|
return;
|
|
92703
92724
|
}
|
|
@@ -92729,21 +92750,17 @@ async function untagConversation(convId, tagNameOrId, options) {
|
|
|
92729
92750
|
const tag = await resolveTag(front, tagNameOrId);
|
|
92730
92751
|
await front.conversations.removeTag(normalizedConvId, tag.id);
|
|
92731
92752
|
if (options.json) {
|
|
92732
|
-
|
|
92733
|
-
|
|
92734
|
-
|
|
92735
|
-
|
|
92736
|
-
|
|
92737
|
-
|
|
92738
|
-
|
|
92739
|
-
|
|
92740
|
-
|
|
92741
|
-
|
|
92742
|
-
|
|
92743
|
-
}),
|
|
92744
|
-
null,
|
|
92745
|
-
2
|
|
92746
|
-
)
|
|
92753
|
+
writeJsonOutput(
|
|
92754
|
+
hateoasWrap({
|
|
92755
|
+
type: "untag-result",
|
|
92756
|
+
command: `skill front untag ${normalizedConvId} ${tagNameOrId} --json`,
|
|
92757
|
+
data: {
|
|
92758
|
+
conversationId: normalizedConvId,
|
|
92759
|
+
tagId: tag.id,
|
|
92760
|
+
tagName: tag.name,
|
|
92761
|
+
action: "removed"
|
|
92762
|
+
}
|
|
92763
|
+
})
|
|
92747
92764
|
);
|
|
92748
92765
|
return;
|
|
92749
92766
|
}
|
|
@@ -92893,19 +92910,15 @@ async function listInboxes(options) {
|
|
|
92893
92910
|
const inboxList = await front.inboxes.list();
|
|
92894
92911
|
const inboxes = inboxList._results ?? [];
|
|
92895
92912
|
if (options.json) {
|
|
92896
|
-
|
|
92897
|
-
|
|
92898
|
-
|
|
92899
|
-
|
|
92900
|
-
|
|
92901
|
-
|
|
92902
|
-
|
|
92903
|
-
|
|
92904
|
-
|
|
92905
|
-
}),
|
|
92906
|
-
null,
|
|
92907
|
-
2
|
|
92908
|
-
)
|
|
92913
|
+
writeJsonOutput(
|
|
92914
|
+
hateoasWrap({
|
|
92915
|
+
type: "inbox-list",
|
|
92916
|
+
command: "skill front inbox --json",
|
|
92917
|
+
data: inboxes,
|
|
92918
|
+
links: inboxListLinks(
|
|
92919
|
+
inboxes.map((i) => ({ id: i.id, name: i.name }))
|
|
92920
|
+
)
|
|
92921
|
+
})
|
|
92909
92922
|
);
|
|
92910
92923
|
return;
|
|
92911
92924
|
}
|
|
@@ -92984,24 +92997,20 @@ async function listConversations(inboxNameOrId, options) {
|
|
|
92984
92997
|
`);
|
|
92985
92998
|
}
|
|
92986
92999
|
if (options.json) {
|
|
92987
|
-
|
|
92988
|
-
|
|
92989
|
-
|
|
92990
|
-
|
|
92991
|
-
|
|
92992
|
-
|
|
92993
|
-
|
|
92994
|
-
|
|
92995
|
-
|
|
92996
|
-
|
|
92997
|
-
|
|
92998
|
-
|
|
92999
|
-
|
|
93000
|
-
|
|
93001
|
-
}),
|
|
93002
|
-
null,
|
|
93003
|
-
2
|
|
93004
|
-
)
|
|
93000
|
+
writeJsonOutput(
|
|
93001
|
+
hateoasWrap({
|
|
93002
|
+
type: "conversation-list",
|
|
93003
|
+
command: `skill front inbox ${inbox.id} --json`,
|
|
93004
|
+
data: {
|
|
93005
|
+
total: conversations.length,
|
|
93006
|
+
conversations
|
|
93007
|
+
},
|
|
93008
|
+
links: conversationListLinks(
|
|
93009
|
+
conversations.map((c) => ({ id: c.id, subject: c.subject })),
|
|
93010
|
+
inbox.id
|
|
93011
|
+
),
|
|
93012
|
+
actions: conversationListActions(inbox.id)
|
|
93013
|
+
})
|
|
93005
93014
|
);
|
|
93006
93015
|
return;
|
|
93007
93016
|
}
|
|
@@ -93160,7 +93169,7 @@ RELATED COMMANDS
|
|
|
93160
93169
|
|
|
93161
93170
|
// src/commands/front/pull-conversations.ts
|
|
93162
93171
|
init_esm_shims();
|
|
93163
|
-
import { writeFileSync as
|
|
93172
|
+
import { writeFileSync as writeFileSync9 } from "fs";
|
|
93164
93173
|
async function pullConversations(options) {
|
|
93165
93174
|
const { inbox, limit: limit2 = 50, output, filter: filter4, json = false } = options;
|
|
93166
93175
|
const frontToken = process.env.FRONT_API_TOKEN;
|
|
@@ -93279,20 +93288,16 @@ Built ${samples.length} eval samples`);
|
|
|
93279
93288
|
console.log(` ${cat}: ${count}`);
|
|
93280
93289
|
}
|
|
93281
93290
|
if (output) {
|
|
93282
|
-
|
|
93291
|
+
writeFileSync9(output, JSON.stringify(samples, null, 2));
|
|
93283
93292
|
console.log(`
|
|
93284
93293
|
Saved to ${output}`);
|
|
93285
93294
|
} else if (json) {
|
|
93286
|
-
|
|
93287
|
-
|
|
93288
|
-
|
|
93289
|
-
|
|
93290
|
-
|
|
93291
|
-
|
|
93292
|
-
}),
|
|
93293
|
-
null,
|
|
93294
|
-
2
|
|
93295
|
-
)
|
|
93295
|
+
writeJsonOutput(
|
|
93296
|
+
hateoasWrap({
|
|
93297
|
+
type: "eval-dataset",
|
|
93298
|
+
command: `skill front pull --inbox ${inbox} --json`,
|
|
93299
|
+
data: samples
|
|
93300
|
+
})
|
|
93296
93301
|
);
|
|
93297
93302
|
}
|
|
93298
93303
|
} catch (error) {
|
|
@@ -93397,16 +93402,12 @@ async function replyToConversation(conversationId, options) {
|
|
|
93397
93402
|
}
|
|
93398
93403
|
);
|
|
93399
93404
|
if (options.json) {
|
|
93400
|
-
|
|
93401
|
-
|
|
93402
|
-
|
|
93403
|
-
|
|
93404
|
-
|
|
93405
|
-
|
|
93406
|
-
}),
|
|
93407
|
-
null,
|
|
93408
|
-
2
|
|
93409
|
-
)
|
|
93405
|
+
writeJsonOutput(
|
|
93406
|
+
hateoasWrap({
|
|
93407
|
+
type: "draft-reply",
|
|
93408
|
+
command: `skill front reply ${normalizedId} --body ${JSON.stringify(options.body)}${options.author ? ` --author ${options.author}` : ""} --json`,
|
|
93409
|
+
data: draft
|
|
93410
|
+
})
|
|
93410
93411
|
);
|
|
93411
93412
|
return;
|
|
93412
93413
|
}
|
|
@@ -93596,18 +93597,14 @@ async function generateReport(options) {
|
|
|
93596
93597
|
);
|
|
93597
93598
|
if (json) {
|
|
93598
93599
|
const unresolvedIds = report.unresolvedIssues.map((i) => i.id);
|
|
93599
|
-
|
|
93600
|
-
|
|
93601
|
-
|
|
93602
|
-
|
|
93603
|
-
|
|
93604
|
-
|
|
93605
|
-
|
|
93606
|
-
|
|
93607
|
-
}),
|
|
93608
|
-
null,
|
|
93609
|
-
2
|
|
93610
|
-
)
|
|
93600
|
+
writeJsonOutput(
|
|
93601
|
+
hateoasWrap({
|
|
93602
|
+
type: "report",
|
|
93603
|
+
command: `skill front report --inbox ${inbox} --json`,
|
|
93604
|
+
data: report,
|
|
93605
|
+
links: reportLinks(inbox, unresolvedIds),
|
|
93606
|
+
actions: reportActions(inbox)
|
|
93607
|
+
})
|
|
93611
93608
|
);
|
|
93612
93609
|
} else {
|
|
93613
93610
|
printReport(report);
|
|
@@ -93814,24 +93811,20 @@ async function searchConversations(query, options) {
|
|
|
93814
93811
|
console.log("");
|
|
93815
93812
|
}
|
|
93816
93813
|
if (options.json) {
|
|
93817
|
-
|
|
93818
|
-
|
|
93819
|
-
|
|
93820
|
-
|
|
93821
|
-
|
|
93822
|
-
|
|
93823
|
-
|
|
93824
|
-
|
|
93825
|
-
|
|
93826
|
-
|
|
93827
|
-
|
|
93828
|
-
|
|
93829
|
-
|
|
93830
|
-
|
|
93831
|
-
}),
|
|
93832
|
-
null,
|
|
93833
|
-
2
|
|
93834
|
-
)
|
|
93814
|
+
writeJsonOutput(
|
|
93815
|
+
hateoasWrap({
|
|
93816
|
+
type: "search-results",
|
|
93817
|
+
command: `skill front search ${JSON.stringify(fullQuery)} --json`,
|
|
93818
|
+
data: {
|
|
93819
|
+
query: fullQuery,
|
|
93820
|
+
total: conversations.length,
|
|
93821
|
+
conversations
|
|
93822
|
+
},
|
|
93823
|
+
links: conversationListLinks(
|
|
93824
|
+
conversations.map((c) => ({ id: c.id, subject: c.subject }))
|
|
93825
|
+
),
|
|
93826
|
+
actions: options.inbox ? conversationListActions(options.inbox) : []
|
|
93827
|
+
})
|
|
93835
93828
|
);
|
|
93836
93829
|
return;
|
|
93837
93830
|
}
|
|
@@ -93961,6 +93954,17 @@ EXAMPLES
|
|
|
93961
93954
|
# Pipe JSON to jq for IDs only
|
|
93962
93955
|
skill front search "is:unassigned" --inbox inb_4bj7r --json | jq '.data.conversations[].id'
|
|
93963
93956
|
|
|
93957
|
+
LARGE RESULTS
|
|
93958
|
+
When --json output exceeds 64KB (common with 25+ conversations), results are
|
|
93959
|
+
automatically written to a temp file. Stdout gets a summary with the file path:
|
|
93960
|
+
{ "_file": "/tmp/skill-front/1738692000.json", "total": 50, ... }
|
|
93961
|
+
|
|
93962
|
+
To always get the full file:
|
|
93963
|
+
skill front search "..." --json > results.json
|
|
93964
|
+
|
|
93965
|
+
To process the spilled file:
|
|
93966
|
+
cat /tmp/skill-front/*.json | jq '.data.conversations[].id'
|
|
93967
|
+
|
|
93964
93968
|
Full docs: https://dev.frontapp.com/docs/search-1
|
|
93965
93969
|
`
|
|
93966
93970
|
).action((query, options) => {
|
|
@@ -94100,20 +94104,16 @@ async function listTags(options) {
|
|
|
94100
94104
|
);
|
|
94101
94105
|
const filteredTags = options.unused ? tagsWithCounts.filter((t2) => t2.conversation_count === 0) : tagsWithCounts;
|
|
94102
94106
|
if (options.json) {
|
|
94103
|
-
|
|
94104
|
-
|
|
94105
|
-
|
|
94106
|
-
|
|
94107
|
-
|
|
94108
|
-
|
|
94109
|
-
|
|
94110
|
-
|
|
94111
|
-
|
|
94112
|
-
|
|
94113
|
-
}),
|
|
94114
|
-
null,
|
|
94115
|
-
2
|
|
94116
|
-
)
|
|
94107
|
+
writeJsonOutput(
|
|
94108
|
+
hateoasWrap({
|
|
94109
|
+
type: "tag-list",
|
|
94110
|
+
command: `skill front tags list${options.unused ? " --unused" : ""} --json`,
|
|
94111
|
+
data: filteredTags,
|
|
94112
|
+
links: tagListLinks(
|
|
94113
|
+
filteredTags.map((t2) => ({ id: t2.id, name: t2.name }))
|
|
94114
|
+
),
|
|
94115
|
+
actions: tagListActions()
|
|
94116
|
+
})
|
|
94117
94117
|
);
|
|
94118
94118
|
return;
|
|
94119
94119
|
}
|
|
@@ -94757,21 +94757,17 @@ Fetching ${status} conversations from inbox ${inbox}...`);
|
|
|
94757
94757
|
});
|
|
94758
94758
|
}
|
|
94759
94759
|
if (json) {
|
|
94760
|
-
|
|
94761
|
-
|
|
94762
|
-
|
|
94763
|
-
|
|
94764
|
-
|
|
94765
|
-
|
|
94766
|
-
|
|
94767
|
-
|
|
94768
|
-
|
|
94769
|
-
|
|
94770
|
-
|
|
94771
|
-
}),
|
|
94772
|
-
null,
|
|
94773
|
-
2
|
|
94774
|
-
)
|
|
94760
|
+
writeJsonOutput(
|
|
94761
|
+
hateoasWrap({
|
|
94762
|
+
type: "triage-result",
|
|
94763
|
+
command: `skill front triage --inbox ${inbox} --json`,
|
|
94764
|
+
data: {
|
|
94765
|
+
total: allConversations.length,
|
|
94766
|
+
stats: stats4,
|
|
94767
|
+
results
|
|
94768
|
+
},
|
|
94769
|
+
actions: triageActions(inbox)
|
|
94770
|
+
})
|
|
94775
94771
|
);
|
|
94776
94772
|
return;
|
|
94777
94773
|
}
|
|
@@ -94984,17 +94980,13 @@ async function getMessage(id, options) {
|
|
|
94984
94980
|
const front = getFrontClient9();
|
|
94985
94981
|
const message = await front.messages.get(normalizeId6(id));
|
|
94986
94982
|
if (options.json) {
|
|
94987
|
-
|
|
94988
|
-
|
|
94989
|
-
|
|
94990
|
-
|
|
94991
|
-
|
|
94992
|
-
|
|
94993
|
-
|
|
94994
|
-
}),
|
|
94995
|
-
null,
|
|
94996
|
-
2
|
|
94997
|
-
)
|
|
94983
|
+
writeJsonOutput(
|
|
94984
|
+
hateoasWrap({
|
|
94985
|
+
type: "message",
|
|
94986
|
+
command: `skill front message ${normalizeId6(id)} --json`,
|
|
94987
|
+
data: message,
|
|
94988
|
+
links: messageLinks(message.id)
|
|
94989
|
+
})
|
|
94998
94990
|
);
|
|
94999
94991
|
return;
|
|
95000
94992
|
}
|
|
@@ -95053,18 +95045,14 @@ async function getConversation2(id, options) {
|
|
|
95053
95045
|
}
|
|
95054
95046
|
if (options.json) {
|
|
95055
95047
|
const convId = normalizeId6(id);
|
|
95056
|
-
|
|
95057
|
-
|
|
95058
|
-
|
|
95059
|
-
|
|
95060
|
-
|
|
95061
|
-
|
|
95062
|
-
|
|
95063
|
-
|
|
95064
|
-
}),
|
|
95065
|
-
null,
|
|
95066
|
-
2
|
|
95067
|
-
)
|
|
95048
|
+
writeJsonOutput(
|
|
95049
|
+
hateoasWrap({
|
|
95050
|
+
type: "conversation",
|
|
95051
|
+
command: `skill front conversation ${convId} --json`,
|
|
95052
|
+
data: { conversation, messages },
|
|
95053
|
+
links: conversationLinks(conversation.id),
|
|
95054
|
+
actions: conversationActions(conversation.id)
|
|
95055
|
+
})
|
|
95068
95056
|
);
|
|
95069
95057
|
return;
|
|
95070
95058
|
}
|
|
@@ -95122,19 +95110,15 @@ async function listTeammates(options) {
|
|
|
95122
95110
|
const front = getFrontSdkClient2();
|
|
95123
95111
|
const result = await front.teammates.list();
|
|
95124
95112
|
if (options.json) {
|
|
95125
|
-
|
|
95126
|
-
|
|
95127
|
-
|
|
95128
|
-
|
|
95129
|
-
|
|
95130
|
-
|
|
95131
|
-
|
|
95132
|
-
|
|
95133
|
-
|
|
95134
|
-
}),
|
|
95135
|
-
null,
|
|
95136
|
-
2
|
|
95137
|
-
)
|
|
95113
|
+
writeJsonOutput(
|
|
95114
|
+
hateoasWrap({
|
|
95115
|
+
type: "teammate-list",
|
|
95116
|
+
command: "skill front teammates --json",
|
|
95117
|
+
data: result._results,
|
|
95118
|
+
links: teammateListLinks(
|
|
95119
|
+
result._results.map((t2) => ({ id: t2.id, email: t2.email }))
|
|
95120
|
+
)
|
|
95121
|
+
})
|
|
95138
95122
|
);
|
|
95139
95123
|
return;
|
|
95140
95124
|
}
|
|
@@ -95175,17 +95159,13 @@ async function getTeammate(id, options) {
|
|
|
95175
95159
|
const front = getFrontSdkClient2();
|
|
95176
95160
|
const teammate = await front.teammates.get(id);
|
|
95177
95161
|
if (options.json) {
|
|
95178
|
-
|
|
95179
|
-
|
|
95180
|
-
|
|
95181
|
-
|
|
95182
|
-
|
|
95183
|
-
|
|
95184
|
-
|
|
95185
|
-
}),
|
|
95186
|
-
null,
|
|
95187
|
-
2
|
|
95188
|
-
)
|
|
95162
|
+
writeJsonOutput(
|
|
95163
|
+
hateoasWrap({
|
|
95164
|
+
type: "teammate",
|
|
95165
|
+
command: `skill front teammate ${id} --json`,
|
|
95166
|
+
data: teammate,
|
|
95167
|
+
links: teammateLinks(teammate.id)
|
|
95168
|
+
})
|
|
95189
95169
|
);
|
|
95190
95170
|
return;
|
|
95191
95171
|
}
|
|
@@ -113643,7 +113623,7 @@ Total: ${result.totalDurationMs}ms`);
|
|
|
113643
113623
|
|
|
113644
113624
|
// src/commands/responses.ts
|
|
113645
113625
|
init_esm_shims();
|
|
113646
|
-
import { writeFileSync as
|
|
113626
|
+
import { writeFileSync as writeFileSync10 } from "fs";
|
|
113647
113627
|
function formatDate3(date) {
|
|
113648
113628
|
return date.toLocaleString("en-US", {
|
|
113649
113629
|
month: "short",
|
|
@@ -114144,7 +114124,7 @@ async function exportResponses(options) {
|
|
|
114144
114124
|
}
|
|
114145
114125
|
const outputJson = JSON.stringify(exportData, null, 2);
|
|
114146
114126
|
if (options.output) {
|
|
114147
|
-
|
|
114127
|
+
writeFileSync10(options.output, outputJson, "utf-8");
|
|
114148
114128
|
console.log(
|
|
114149
114129
|
`Exported ${exportData.length} responses to ${options.output}`
|
|
114150
114130
|
);
|