@chanl/cli 2.0.3 → 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.
@@ -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: { tool: mockTool },
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: { tool: mockTool },
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: { tool: mockToolDetail },
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: { tool: mockToolDetail },
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: { tool: { ...mockTool, isEnabled: true } },
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: { tool: { ...mockTool, isEnabled: false } },
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
- execution: {
1453
- id: "exec_tc1",
1454
- executionId: "exec_tc1",
1455
- scenarioId: "scen_abc123",
1456
- status: "completed",
1457
- overallScore: 85,
1458
- duration: 12.5,
1459
- stepResults: [
1460
- {
1461
- stepId: "step_1",
1462
- status: "completed",
1463
- actualResponse: "The weather is 12\xB0C in London.",
1464
- toolCalls: mockToolCalls
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: { agent: mockImportedAgent },
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: { agent: mockImportedAgent },
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: { agent: mockImportedAgent },
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.agent).toBeDefined();
1600
- expect(parsed.agent.id).toBe("agent_imported_123");
1601
- expect(parsed.agent.name).toBe("My VAPI Agent");
1602
- expect(parsed.agent.platform).toBe("vapi");
1603
- expect(parsed.agent.platformAgentId).toBe("asst_abc");
1604
- expect(parsed.agent.deployments).toHaveLength(1);
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: { agent: retellAgent },
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
  });