@chanl/cli 2.0.2 → 2.0.4
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/__tests__/cli.test.js +31 -36
- package/dist/__tests__/cli.test.js.map +1 -1
- package/dist/commands/agents.js +7 -7
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/mcp.js +1 -1
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/memory.js +3 -3
- package/dist/commands/memory.js.map +1 -1
- package/dist/commands/personas.js +3 -3
- package/dist/commands/personas.js.map +1 -1
- package/dist/commands/scenarios.js +2 -2
- package/dist/commands/scenarios.js.map +1 -1
- package/dist/commands/tools.js +5 -5
- package/dist/commands/tools.js.map +1 -1
- package/package.json +5 -4
|
@@ -357,7 +357,7 @@ describe("CLI", () => {
|
|
|
357
357
|
it("should get tool by ID", async () => {
|
|
358
358
|
mockSdk.tools.get.mockResolvedValue({
|
|
359
359
|
success: true,
|
|
360
|
-
data:
|
|
360
|
+
data: mockTool,
|
|
361
361
|
message: "Success",
|
|
362
362
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
363
363
|
});
|
|
@@ -371,7 +371,7 @@ describe("CLI", () => {
|
|
|
371
371
|
it("should output JSON when --json flag is used", async () => {
|
|
372
372
|
mockSdk.tools.get.mockResolvedValue({
|
|
373
373
|
success: true,
|
|
374
|
-
data:
|
|
374
|
+
data: mockTool,
|
|
375
375
|
message: "Success",
|
|
376
376
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
377
377
|
});
|
|
@@ -873,7 +873,7 @@ describe("CLI", () => {
|
|
|
873
873
|
it("should display tool details with table output", async () => {
|
|
874
874
|
mockSdk.mcp.getTool.mockResolvedValue({
|
|
875
875
|
success: true,
|
|
876
|
-
data:
|
|
876
|
+
data: mockToolDetail,
|
|
877
877
|
message: "Success",
|
|
878
878
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
879
879
|
});
|
|
@@ -888,7 +888,7 @@ describe("CLI", () => {
|
|
|
888
888
|
it("should display tool details with JSON output", async () => {
|
|
889
889
|
mockSdk.mcp.getTool.mockResolvedValue({
|
|
890
890
|
success: true,
|
|
891
|
-
data:
|
|
891
|
+
data: mockToolDetail,
|
|
892
892
|
message: "Success",
|
|
893
893
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
894
894
|
});
|
|
@@ -1108,7 +1108,7 @@ describe("CLI", () => {
|
|
|
1108
1108
|
it("should enable a tool", async () => {
|
|
1109
1109
|
mockSdk.tools.enable.mockResolvedValue({
|
|
1110
1110
|
success: true,
|
|
1111
|
-
data: {
|
|
1111
|
+
data: { ...mockTool, isEnabled: true },
|
|
1112
1112
|
message: "Success",
|
|
1113
1113
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1114
1114
|
});
|
|
@@ -1122,7 +1122,7 @@ describe("CLI", () => {
|
|
|
1122
1122
|
it("should disable a tool", async () => {
|
|
1123
1123
|
mockSdk.tools.disable.mockResolvedValue({
|
|
1124
1124
|
success: true,
|
|
1125
|
-
data: {
|
|
1125
|
+
data: { ...mockTool, isEnabled: false },
|
|
1126
1126
|
message: "Success",
|
|
1127
1127
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1128
1128
|
});
|
|
@@ -1449,22 +1449,20 @@ describe("CLI", () => {
|
|
|
1449
1449
|
mockSdk.scenarios.getExecution.mockResolvedValue({
|
|
1450
1450
|
success: true,
|
|
1451
1451
|
data: {
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
]
|
|
1467
|
-
}
|
|
1452
|
+
id: "exec_tc1",
|
|
1453
|
+
executionId: "exec_tc1",
|
|
1454
|
+
scenarioId: "scen_abc123",
|
|
1455
|
+
status: "completed",
|
|
1456
|
+
overallScore: 85,
|
|
1457
|
+
duration: 12.5,
|
|
1458
|
+
stepResults: [
|
|
1459
|
+
{
|
|
1460
|
+
stepId: "step_1",
|
|
1461
|
+
status: "completed",
|
|
1462
|
+
actualResponse: "The weather is 12\xB0C in London.",
|
|
1463
|
+
toolCalls: mockToolCalls
|
|
1464
|
+
}
|
|
1465
|
+
]
|
|
1468
1466
|
},
|
|
1469
1467
|
message: "Success",
|
|
1470
1468
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -1534,7 +1532,7 @@ describe("CLI", () => {
|
|
|
1534
1532
|
it("should import an agent from VAPI and display results", async () => {
|
|
1535
1533
|
mockSdk.agents.importFromPlatform.mockResolvedValue({
|
|
1536
1534
|
success: true,
|
|
1537
|
-
data:
|
|
1535
|
+
data: mockImportedAgent,
|
|
1538
1536
|
message: "Success",
|
|
1539
1537
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1540
1538
|
});
|
|
@@ -1561,7 +1559,7 @@ describe("CLI", () => {
|
|
|
1561
1559
|
it("should display external ID and deployment info", async () => {
|
|
1562
1560
|
mockSdk.agents.importFromPlatform.mockResolvedValue({
|
|
1563
1561
|
success: true,
|
|
1564
|
-
data:
|
|
1562
|
+
data: mockImportedAgent,
|
|
1565
1563
|
message: "Success",
|
|
1566
1564
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1567
1565
|
});
|
|
@@ -1580,7 +1578,7 @@ describe("CLI", () => {
|
|
|
1580
1578
|
it("should output JSON with --json flag", async () => {
|
|
1581
1579
|
mockSdk.agents.importFromPlatform.mockResolvedValue({
|
|
1582
1580
|
success: true,
|
|
1583
|
-
data:
|
|
1581
|
+
data: mockImportedAgent,
|
|
1584
1582
|
message: "Success",
|
|
1585
1583
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1586
1584
|
});
|
|
@@ -1596,13 +1594,12 @@ describe("CLI", () => {
|
|
|
1596
1594
|
expect(exitCode).toBe(0);
|
|
1597
1595
|
const output = logs.join("\n");
|
|
1598
1596
|
const parsed = JSON.parse(output);
|
|
1599
|
-
expect(parsed.
|
|
1600
|
-
expect(parsed.
|
|
1601
|
-
expect(parsed.
|
|
1602
|
-
expect(parsed.
|
|
1603
|
-
expect(parsed.
|
|
1604
|
-
expect(parsed.
|
|
1605
|
-
expect(parsed.agent.deployments[0].orchestrator).toBe("vapi");
|
|
1597
|
+
expect(parsed.id).toBe("agent_imported_123");
|
|
1598
|
+
expect(parsed.name).toBe("My VAPI Agent");
|
|
1599
|
+
expect(parsed.platform).toBe("vapi");
|
|
1600
|
+
expect(parsed.platformAgentId).toBe("asst_abc");
|
|
1601
|
+
expect(parsed.deployments).toHaveLength(1);
|
|
1602
|
+
expect(parsed.deployments[0].orchestrator).toBe("vapi");
|
|
1606
1603
|
});
|
|
1607
1604
|
it("should import from Retell platform", async () => {
|
|
1608
1605
|
const retellAgent = {
|
|
@@ -1617,7 +1614,7 @@ describe("CLI", () => {
|
|
|
1617
1614
|
};
|
|
1618
1615
|
mockSdk.agents.importFromPlatform.mockResolvedValue({
|
|
1619
1616
|
success: true,
|
|
1620
|
-
data:
|
|
1617
|
+
data: retellAgent,
|
|
1621
1618
|
message: "Success",
|
|
1622
1619
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1623
1620
|
});
|
|
@@ -1662,9 +1659,7 @@ describe("CLI", () => {
|
|
|
1662
1659
|
it("should accept optional --name flag for name override", async () => {
|
|
1663
1660
|
mockSdk.agents.importFromPlatform.mockResolvedValue({
|
|
1664
1661
|
success: true,
|
|
1665
|
-
data: {
|
|
1666
|
-
agent: { ...mockImportedAgent, name: "Custom Agent Name" }
|
|
1667
|
-
},
|
|
1662
|
+
data: { ...mockImportedAgent, name: "Custom Agent Name" },
|
|
1668
1663
|
message: "Success",
|
|
1669
1664
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1670
1665
|
});
|