@calltelemetry/ct-lab-mcp 0.8.1 → 0.8.3
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/src/slot/manager.d.ts +16 -1
- package/dist/src/slot/manager.d.ts.map +1 -1
- package/dist/src/slot/manager.js +810 -431
- package/dist/src/slot/manager.js.map +1 -1
- package/dist/src/slot/types.d.ts +87 -0
- package/dist/src/slot/types.d.ts.map +1 -1
- package/dist/src/slot/types.js.map +1 -1
- package/dist/src/tools/appliance-exec.d.ts +6 -0
- package/dist/src/tools/appliance-exec.d.ts.map +1 -1
- package/dist/src/tools/appliance-exec.js +6 -1
- package/dist/src/tools/appliance-exec.js.map +1 -1
- package/dist/src/tools/find-slot.d.ts +80 -0
- package/dist/src/tools/find-slot.d.ts.map +1 -0
- package/dist/src/tools/find-slot.js +134 -0
- package/dist/src/tools/find-slot.js.map +1 -0
- package/dist/src/tools/fleet-tools.d.ts +6 -6
- package/dist/src/tools/index.d.ts.map +1 -1
- package/dist/src/tools/index.js +11 -1
- package/dist/src/tools/index.js.map +1 -1
- package/dist/src/tools/list-hosts.d.ts +4 -0
- package/dist/src/tools/list-hosts.d.ts.map +1 -1
- package/dist/src/tools/list-hosts.js +7 -2
- package/dist/src/tools/list-hosts.js.map +1 -1
- package/dist/src/tools/list-inventory.d.ts +4 -0
- package/dist/src/tools/list-inventory.d.ts.map +1 -1
- package/dist/src/tools/list-inventory.js +6 -1
- package/dist/src/tools/list-inventory.js.map +1 -1
- package/dist/src/tools/provision-tools.d.ts +20 -0
- package/dist/src/tools/provision-tools.d.ts.map +1 -1
- package/dist/src/tools/provision-tools.js +23 -2
- package/dist/src/tools/provision-tools.js.map +1 -1
- package/dist/src/tools/purge-and-redeploy.d.ts +64 -0
- package/dist/src/tools/purge-and-redeploy.d.ts.map +1 -0
- package/dist/src/tools/purge-and-redeploy.js +115 -0
- package/dist/src/tools/purge-and-redeploy.js.map +1 -0
- package/dist/src/tools/purge-slots.d.ts +8 -4
- package/dist/src/tools/purge-slots.d.ts.map +1 -1
- package/dist/src/tools/purge-slots.js +6 -1
- package/dist/src/tools/purge-slots.js.map +1 -1
- package/dist/src/tools/slot-tools.d.ts +36 -8
- package/dist/src/tools/slot-tools.d.ts.map +1 -1
- package/dist/src/tools/slot-tools.js +30 -4
- package/dist/src/tools/slot-tools.js.map +1 -1
- package/dist/src/tools/vm-action.d.ts +10 -4
- package/dist/src/tools/vm-action.d.ts.map +1 -1
- package/dist/src/tools/vm-action.js +8 -3
- package/dist/src/tools/vm-action.js.map +1 -1
- package/dist/src/tools/vm-cleanup.d.ts +4 -4
- package/dist/src/types/mcp.d.ts.map +1 -1
- package/dist/src/types/mcp.js +5 -1
- package/dist/src/types/mcp.js.map +1 -1
- package/dist/src/utils/formatters.d.ts +22 -11
- package/dist/src/utils/formatters.d.ts.map +1 -1
- package/dist/src/utils/formatters.js +165 -23
- package/dist/src/utils/formatters.js.map +1 -1
- package/package.json +1 -1
|
@@ -21,11 +21,11 @@ export declare const ListExpiredVmsInputSchema: z.ZodObject<{
|
|
|
21
21
|
hostAssetId: z.ZodOptional<z.ZodString>;
|
|
22
22
|
format: z.ZodDefault<z.ZodOptional<z.ZodEnum<["json", "table"]>>>;
|
|
23
23
|
}, "strip", z.ZodTypeAny, {
|
|
24
|
-
format: "
|
|
24
|
+
format: "table" | "json";
|
|
25
25
|
warnHours?: number | undefined;
|
|
26
26
|
hostAssetId?: string | undefined;
|
|
27
27
|
}, {
|
|
28
|
-
format?: "
|
|
28
|
+
format?: "table" | "json" | undefined;
|
|
29
29
|
warnHours?: number | undefined;
|
|
30
30
|
hostAssetId?: string | undefined;
|
|
31
31
|
}>;
|
|
@@ -56,7 +56,7 @@ export declare const CleanupExpiredVmsInputSchema: z.ZodObject<{
|
|
|
56
56
|
format: z.ZodDefault<z.ZodOptional<z.ZodEnum<["json", "table"]>>>;
|
|
57
57
|
}, "strip", z.ZodTypeAny, {
|
|
58
58
|
dryRun: boolean;
|
|
59
|
-
format: "
|
|
59
|
+
format: "table" | "json";
|
|
60
60
|
apply: boolean;
|
|
61
61
|
deleteTerminalIssues: boolean;
|
|
62
62
|
reason?: string | undefined;
|
|
@@ -67,7 +67,7 @@ export declare const CleanupExpiredVmsInputSchema: z.ZodObject<{
|
|
|
67
67
|
outputFile?: string | undefined;
|
|
68
68
|
}, {
|
|
69
69
|
dryRun?: boolean | undefined;
|
|
70
|
-
format?: "
|
|
70
|
+
format?: "table" | "json" | undefined;
|
|
71
71
|
reason?: string | undefined;
|
|
72
72
|
artifactReceipt?: string | undefined;
|
|
73
73
|
apply?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/types/mcp.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B;;GAEG;AACH,oBAAY,gBAAgB;IAC1B,iBAAiB,sBAAsB;IACvC,cAAc,mBAAmB;IACjC,cAAc,mBAAmB;IACjC,qBAAqB,0BAA0B;IAC/C,0BAA0B,+BAA+B;IACzD,YAAY,iBAAiB;IAC7B,gBAAgB,qBAAqB;IACrC,oBAAoB,yBAAyB;IAC7C,kBAAkB,uBAAuB;IACzC,gBAAgB,qBAAqB;IACrC,uBAAuB,4BAA4B;IACnD,gBAAgB,qBAAqB;IACrC,0BAA0B,+BAA+B;CAC1D;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,gB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,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,cAAc,CAU1G"}
|
package/dist/src/types/mcp.js
CHANGED
|
@@ -35,12 +35,16 @@ export function createToolErrorResult(code, message, details) {
|
|
|
35
35
|
...(details ? { details } : {}),
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
|
+
let text = `### ❌ Operation Failed: [${code}]\n\n${message}`;
|
|
39
|
+
if (details && Object.keys(details).length > 0) {
|
|
40
|
+
text += `\n\n**Details:**\n` + Object.entries(details).map(([k, v]) => `- **${k}**: ${typeof v === "object" ? JSON.stringify(v) : v}`).join("\n");
|
|
41
|
+
}
|
|
38
42
|
return {
|
|
39
43
|
isError: true,
|
|
40
44
|
content: [
|
|
41
45
|
{
|
|
42
46
|
type: "text",
|
|
43
|
-
text
|
|
47
|
+
text,
|
|
44
48
|
},
|
|
45
49
|
],
|
|
46
50
|
structuredContent: payload,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../src/types/mcp.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH;;GAEG;AACH,MAAM,CAAN,IAAY,gBAcX;AAdD,WAAY,gBAAgB;IAC1B,2DAAuC,CAAA;IACvC,qDAAiC,CAAA;IACjC,qDAAiC,CAAA;IACjC,mEAA+C,CAAA;IAC/C,6EAAyD,CAAA;IACzD,iDAA6B,CAAA;IAC7B,yDAAqC,CAAA;IACrC,iEAA6C,CAAA;IAC7C,6DAAyC,CAAA;IACzC,yDAAqC,CAAA;IACrC,uEAAmD,CAAA;IACnD,yDAAqC,CAAA;IACrC,6EAAyD,CAAA;AAC3D,CAAC,EAdW,gBAAgB,KAAhB,gBAAgB,QAc3B;AAcD;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACnC,IAA+B,EAC/B,OAAe,EACf,OAAiC;IAEjC,MAAM,OAAO,GAA+B;QAC1C,OAAO,EAAE,KAAK;Q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,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI;aACL;SACF;QACD,iBAAiB,EAAE,OAA6C;KACjE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,IAAY,EAAE,UAAoC;IACxF,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI;aACL;SACF;QACD,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACzD,CAAC;AACJ,CAAC"}
|
|
@@ -10,6 +10,9 @@ export interface FormattedResult {
|
|
|
10
10
|
markdown: string;
|
|
11
11
|
structuredContent: Record<string, unknown>;
|
|
12
12
|
}
|
|
13
|
+
export interface FormatterOptions {
|
|
14
|
+
includeJsonDump?: boolean;
|
|
15
|
+
}
|
|
13
16
|
export interface LiveHostData {
|
|
14
17
|
host: ProxmoxHostConfig;
|
|
15
18
|
status: NodeStatus;
|
|
@@ -26,23 +29,23 @@ export declare function formatMb(mb: number): string;
|
|
|
26
29
|
/**
|
|
27
30
|
* Format host status and capacity summary into Markdown + JSON
|
|
28
31
|
*/
|
|
29
|
-
export declare function formatHostSummary(summary: GlobalCapacitySummary | HostCapacityStatus, liveData?: LiveHostData[]): FormattedResult;
|
|
32
|
+
export declare function formatHostSummary(summary: GlobalCapacitySummary | HostCapacityStatus, liveData?: LiveHostData[], options?: FormatterOptions): FormattedResult;
|
|
30
33
|
/**
|
|
31
34
|
* Format list of slots into Markdown + JSON
|
|
32
35
|
*/
|
|
33
|
-
export declare function formatSlotList(slots: SlotDefinition[], summary?: GlobalCapacitySummary): FormattedResult;
|
|
36
|
+
export declare function formatSlotList(slots: SlotDefinition[], summary?: GlobalCapacitySummary, options?: FormatterOptions): FormattedResult;
|
|
34
37
|
/**
|
|
35
38
|
* Format successful slot claim result into Markdown + JSON
|
|
36
39
|
*/
|
|
37
|
-
export declare function formatClaimResult(result: SlotClaimResult, capacity?: GlobalCapacitySummary): FormattedResult;
|
|
40
|
+
export declare function formatClaimResult(result: SlotClaimResult, capacity?: GlobalCapacitySummary, options?: FormatterOptions): FormattedResult;
|
|
38
41
|
/**
|
|
39
42
|
* Format slot release result into Markdown + JSON
|
|
40
43
|
*/
|
|
41
|
-
export declare function formatReleaseResult(result: ReleaseSlotResult, capacity?: GlobalCapacitySummary): FormattedResult;
|
|
44
|
+
export declare function formatReleaseResult(result: ReleaseSlotResult, capacity?: GlobalCapacitySummary, options?: FormatterOptions): FormattedResult;
|
|
42
45
|
/**
|
|
43
46
|
* Format slot & VM purge result into Markdown + JSON
|
|
44
47
|
*/
|
|
45
|
-
export declare function formatPurgeResult(result: PurgeSlotsResult, capacity?: GlobalCapacitySummary): FormattedResult;
|
|
48
|
+
export declare function formatPurgeResult(result: PurgeSlotsResult, capacity?: GlobalCapacitySummary, options?: FormatterOptions): FormattedResult;
|
|
46
49
|
/**
|
|
47
50
|
* Format VM action execution result into Markdown + JSON
|
|
48
51
|
*/
|
|
@@ -56,23 +59,23 @@ export declare function formatVmActionResult(data: {
|
|
|
56
59
|
message?: string;
|
|
57
60
|
details?: Record<string, unknown>;
|
|
58
61
|
mock?: boolean;
|
|
59
|
-
}): FormattedResult;
|
|
62
|
+
}, options?: FormatterOptions): FormattedResult;
|
|
60
63
|
/**
|
|
61
64
|
* Format unified multi-hypervisor host capacities
|
|
62
65
|
*/
|
|
63
|
-
export declare function formatUnifiedHostCapacities(capacities: any[], slotSummary?: any): FormattedResult;
|
|
66
|
+
export declare function formatUnifiedHostCapacities(capacities: any[], slotSummary?: any, options?: FormatterOptions): FormattedResult;
|
|
64
67
|
/**
|
|
65
68
|
* Format unified inventory across Proxmox and ESXi VMs
|
|
66
69
|
*/
|
|
67
|
-
export declare function formatUnifiedInventory(vms: any[], filter?: any): FormattedResult;
|
|
70
|
+
export declare function formatUnifiedInventory(vms: any[], filter?: any, options?: FormatterOptions): FormattedResult;
|
|
68
71
|
/**
|
|
69
72
|
* Format VM provisioning result into Markdown + JSON
|
|
70
73
|
*/
|
|
71
|
-
export declare function formatProvisionResult(result: any, slotClaim?: any): FormattedResult;
|
|
74
|
+
export declare function formatProvisionResult(result: any, slotClaim?: any, options?: FormatterOptions): FormattedResult;
|
|
72
75
|
/**
|
|
73
76
|
* Format appliance CLI execution result into Markdown + JSON
|
|
74
77
|
*/
|
|
75
|
-
export declare function formatApplianceExecResult(result: any): FormattedResult;
|
|
78
|
+
export declare function formatApplianceExecResult(result: any, options?: FormatterOptions): FormattedResult;
|
|
76
79
|
export interface AutoProvisionResult {
|
|
77
80
|
success: boolean;
|
|
78
81
|
slotId: string;
|
|
@@ -108,5 +111,13 @@ export interface AutoProvisionResult {
|
|
|
108
111
|
/**
|
|
109
112
|
* Format automated end-to-end VM provisioning result into Markdown + JSON
|
|
110
113
|
*/
|
|
111
|
-
export declare function formatAutoProvisionResult(result: AutoProvisionResult): FormattedResult;
|
|
114
|
+
export declare function formatAutoProvisionResult(result: AutoProvisionResult, options?: FormatterOptions): FormattedResult;
|
|
115
|
+
/**
|
|
116
|
+
* Format intelligent slot discovery result
|
|
117
|
+
*/
|
|
118
|
+
export declare function formatFindSlotResult(result: any, options?: FormatterOptions): FormattedResult;
|
|
119
|
+
/**
|
|
120
|
+
* Format purge and redeploy workflow result
|
|
121
|
+
*/
|
|
122
|
+
export declare function formatPurgeAndRedeployResult(result: any, options?: FormatterOptions): FormattedResult;
|
|
112
123
|
//# sourceMappingURL=formatters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../src/utils/formatters.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEvF,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,UAAU,CAAC;IACnB,GAAG,EAAE,iBAAiB,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMjD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAK3C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,qBAAqB,GAAG,kBAAkB,EACnD,QAAQ,CAAC,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../src/utils/formatters.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEvF,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAA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AAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1D,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,SAAS,GAAG,YAAY,CAAC;IACvC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,iBAAiB,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC;CAC5E;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,gBAAgB,GACzB,eAAe,CA0DjB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,GAAG,EACX,OAAO,CAAC,EAAE,gBAAgB,GACzB,eAAe,CAqFjB;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,GAAG,EACX,OAAO,CAAC,EAAE,gBAAgB,GACzB,eAAe,CA8BjB"}
|
|
@@ -27,7 +27,7 @@ export function formatMb(mb) {
|
|
|
27
27
|
/**
|
|
28
28
|
* Format host status and capacity summary into Markdown + JSON
|
|
29
29
|
*/
|
|
30
|
-
export function formatHostSummary(summary, liveData) {
|
|
30
|
+
export function formatHostSummary(summary, liveData, options) {
|
|
31
31
|
const isSingleHost = "allocatedSlots" in summary;
|
|
32
32
|
const hostsMap = isSingleHost
|
|
33
33
|
? { [summary.hostId]: summary }
|
|
@@ -101,7 +101,9 @@ export function formatHostSummary(summary, liveData) {
|
|
|
101
101
|
}))
|
|
102
102
|
: undefined,
|
|
103
103
|
};
|
|
104
|
-
|
|
104
|
+
if (options?.includeJsonDump) {
|
|
105
|
+
md += `\n\`\`\`json\n${JSON.stringify(structuredContent, null, 2)}\n\`\`\``;
|
|
106
|
+
}
|
|
105
107
|
return {
|
|
106
108
|
markdown: md,
|
|
107
109
|
structuredContent,
|
|
@@ -110,7 +112,7 @@ export function formatHostSummary(summary, liveData) {
|
|
|
110
112
|
/**
|
|
111
113
|
* Format list of slots into Markdown + JSON
|
|
112
114
|
*/
|
|
113
|
-
export function formatSlotList(slots, summary) {
|
|
115
|
+
export function formatSlotList(slots, summary, options) {
|
|
114
116
|
let md = "### 📦 8GB Appliance Slot Inventory\n\n";
|
|
115
117
|
if (summary) {
|
|
116
118
|
md += `**Cluster Capacity:** ${summary.clusterAllocatedSlots} / ${summary.clusterMaxSlots} slots allocated (${summary.clusterAvailableSlots} available)\n\n`;
|
|
@@ -132,7 +134,14 @@ export function formatSlotList(slots, summary) {
|
|
|
132
134
|
else if (slot.status === "RELEASED" || slot.status === "released") {
|
|
133
135
|
statusIcon = "⚪ Released";
|
|
134
136
|
}
|
|
135
|
-
const
|
|
137
|
+
const labelParts = [];
|
|
138
|
+
if (slot.label)
|
|
139
|
+
labelParts.push(slot.label);
|
|
140
|
+
if (slot.linearIssue)
|
|
141
|
+
labelParts.push(`\`${slot.linearIssue}\``);
|
|
142
|
+
else if (!slot.label && slot.tag)
|
|
143
|
+
labelParts.push(`\`${slot.tag}\``);
|
|
144
|
+
const labelStr = labelParts.join(" / ") || "-";
|
|
136
145
|
const workloadStr = slot.workloadType || "-";
|
|
137
146
|
const verBranchStr = [slot.targetVersion, slot.branch].filter(Boolean).join(" / ") || "-";
|
|
138
147
|
const expiresStr = slot.expiresAt ? slot.expiresAt.replace("T", " ").substring(0, 19) : "-";
|
|
@@ -161,7 +170,9 @@ export function formatSlotList(slots, summary) {
|
|
|
161
170
|
}
|
|
162
171
|
: undefined,
|
|
163
172
|
};
|
|
164
|
-
|
|
173
|
+
if (options?.includeJsonDump) {
|
|
174
|
+
md += `\n\`\`\`json\n${JSON.stringify(structuredContent, null, 2)}\n\`\`\``;
|
|
175
|
+
}
|
|
165
176
|
return {
|
|
166
177
|
markdown: md,
|
|
167
178
|
structuredContent,
|
|
@@ -170,7 +181,7 @@ export function formatSlotList(slots, summary) {
|
|
|
170
181
|
/**
|
|
171
182
|
* Format successful slot claim result into Markdown + JSON
|
|
172
183
|
*/
|
|
173
|
-
export function formatClaimResult(result, capacity) {
|
|
184
|
+
export function formatClaimResult(result, capacity, options) {
|
|
174
185
|
let md = "### 🟢 Slot Leased Successfully\n\n";
|
|
175
186
|
md += "| Field | Value |\n";
|
|
176
187
|
md += "|---|---|\n";
|
|
@@ -230,7 +241,9 @@ export function formatClaimResult(result, capacity) {
|
|
|
230
241
|
}
|
|
231
242
|
: undefined,
|
|
232
243
|
};
|
|
233
|
-
|
|
244
|
+
if (options?.includeJsonDump) {
|
|
245
|
+
md += `\n\`\`\`json\n${JSON.stringify(structuredContent, null, 2)}\n\`\`\``;
|
|
246
|
+
}
|
|
234
247
|
return {
|
|
235
248
|
markdown: md,
|
|
236
249
|
structuredContent,
|
|
@@ -239,7 +252,7 @@ export function formatClaimResult(result, capacity) {
|
|
|
239
252
|
/**
|
|
240
253
|
* Format slot release result into Markdown + JSON
|
|
241
254
|
*/
|
|
242
|
-
export function formatReleaseResult(result, capacity) {
|
|
255
|
+
export function formatReleaseResult(result, capacity, options) {
|
|
243
256
|
let md = `### 🟢 ${result.message}\n\n`;
|
|
244
257
|
if (result.releasedSlots.length > 0) {
|
|
245
258
|
md += "| Slot ID | Host | Slot # | Label / Tag | Released Claim ID |\n";
|
|
@@ -278,7 +291,9 @@ export function formatReleaseResult(result, capacity) {
|
|
|
278
291
|
}
|
|
279
292
|
: undefined,
|
|
280
293
|
};
|
|
281
|
-
|
|
294
|
+
if (options?.includeJsonDump) {
|
|
295
|
+
md += `\n\`\`\`json\n${JSON.stringify(structuredContent, null, 2)}\n\`\`\``;
|
|
296
|
+
}
|
|
282
297
|
return {
|
|
283
298
|
markdown: md,
|
|
284
299
|
structuredContent,
|
|
@@ -287,7 +302,7 @@ export function formatReleaseResult(result, capacity) {
|
|
|
287
302
|
/**
|
|
288
303
|
* Format slot & VM purge result into Markdown + JSON
|
|
289
304
|
*/
|
|
290
|
-
export function formatPurgeResult(result, capacity) {
|
|
305
|
+
export function formatPurgeResult(result, capacity, options) {
|
|
291
306
|
const icon = result.dryRun ? "🟡" : "🟢";
|
|
292
307
|
const modeStr = result.dryRun ? "[DRY RUN] Preview Only" : "Live Purge Execution";
|
|
293
308
|
let md = `### ${icon} Slot & VM Purge Report (${modeStr})\n\n`;
|
|
@@ -363,7 +378,9 @@ export function formatPurgeResult(result, capacity) {
|
|
|
363
378
|
}
|
|
364
379
|
: undefined,
|
|
365
380
|
};
|
|
366
|
-
|
|
381
|
+
if (options?.includeJsonDump) {
|
|
382
|
+
md += `\n\`\`\`json\n${JSON.stringify(structuredContent, null, 2)}\n\`\`\``;
|
|
383
|
+
}
|
|
367
384
|
return {
|
|
368
385
|
markdown: md,
|
|
369
386
|
structuredContent,
|
|
@@ -372,7 +389,7 @@ export function formatPurgeResult(result, capacity) {
|
|
|
372
389
|
/**
|
|
373
390
|
* Format VM action execution result into Markdown + JSON
|
|
374
391
|
*/
|
|
375
|
-
export function formatVmActionResult(data) {
|
|
392
|
+
export function formatVmActionResult(data, options) {
|
|
376
393
|
const icon = data.success ? "🟢" : "🔴";
|
|
377
394
|
const isMock = data.mock === true;
|
|
378
395
|
let md = "";
|
|
@@ -420,7 +437,9 @@ export function formatVmActionResult(data) {
|
|
|
420
437
|
details: data.details,
|
|
421
438
|
mock: isMock,
|
|
422
439
|
};
|
|
423
|
-
|
|
440
|
+
if (options?.includeJsonDump) {
|
|
441
|
+
md += `\n\`\`\`json\n${JSON.stringify(structuredContent, null, 2)}\n\`\`\``;
|
|
442
|
+
}
|
|
424
443
|
return {
|
|
425
444
|
markdown: md,
|
|
426
445
|
structuredContent,
|
|
@@ -429,7 +448,7 @@ export function formatVmActionResult(data) {
|
|
|
429
448
|
/**
|
|
430
449
|
* Format unified multi-hypervisor host capacities
|
|
431
450
|
*/
|
|
432
|
-
export function formatUnifiedHostCapacities(capacities, slotSummary) {
|
|
451
|
+
export function formatUnifiedHostCapacities(capacities, slotSummary, options) {
|
|
433
452
|
let md = "### 🖥️ Multi-Hypervisor Capacity & 8GB Slot Status\n\n";
|
|
434
453
|
md += "| Host Name | Platform | Status | 8GB Slots (Used/Max) | Avail Slots | Active Leases | CPU Cores (Used %) | Free RAM | Free Disk |\n";
|
|
435
454
|
md += "|---|:---:|:---:|:---:|:---:|---|:---:|:---:|:---:|\n";
|
|
@@ -531,7 +550,9 @@ export function formatUnifiedHostCapacities(capacities, slotSummary) {
|
|
|
531
550
|
activeSlotLeases,
|
|
532
551
|
slotSummary,
|
|
533
552
|
};
|
|
534
|
-
|
|
553
|
+
if (options?.includeJsonDump) {
|
|
554
|
+
md += `\n\`\`\`json\n${JSON.stringify(structuredContent, null, 2)}\n\`\`\``;
|
|
555
|
+
}
|
|
535
556
|
return {
|
|
536
557
|
markdown: md,
|
|
537
558
|
structuredContent,
|
|
@@ -540,7 +561,7 @@ export function formatUnifiedHostCapacities(capacities, slotSummary) {
|
|
|
540
561
|
/**
|
|
541
562
|
* Format unified inventory across Proxmox and ESXi VMs
|
|
542
563
|
*/
|
|
543
|
-
export function formatUnifiedInventory(vms, filter) {
|
|
564
|
+
export function formatUnifiedInventory(vms, filter, options) {
|
|
544
565
|
let md = "### 📋 Unified Lab & Fleet Inventory\n\n";
|
|
545
566
|
if (filter) {
|
|
546
567
|
const filterParts = [];
|
|
@@ -579,7 +600,9 @@ export function formatUnifiedInventory(vms, filter) {
|
|
|
579
600
|
vms,
|
|
580
601
|
filter,
|
|
581
602
|
};
|
|
582
|
-
|
|
603
|
+
if (options?.includeJsonDump) {
|
|
604
|
+
md += `\n\`\`\`json\n${JSON.stringify(structuredContent, null, 2)}\n\`\`\``;
|
|
605
|
+
}
|
|
583
606
|
return {
|
|
584
607
|
markdown: md,
|
|
585
608
|
structuredContent,
|
|
@@ -588,7 +611,7 @@ export function formatUnifiedInventory(vms, filter) {
|
|
|
588
611
|
/**
|
|
589
612
|
* Format VM provisioning result into Markdown + JSON
|
|
590
613
|
*/
|
|
591
|
-
export function formatProvisionResult(result, slotClaim) {
|
|
614
|
+
export function formatProvisionResult(result, slotClaim, options) {
|
|
592
615
|
const isMock = result.mock === true;
|
|
593
616
|
let md = "";
|
|
594
617
|
if (isMock) {
|
|
@@ -632,7 +655,9 @@ export function formatProvisionResult(result, slotClaim) {
|
|
|
632
655
|
vm: result,
|
|
633
656
|
slotClaim,
|
|
634
657
|
};
|
|
635
|
-
|
|
658
|
+
if (options?.includeJsonDump) {
|
|
659
|
+
md += `\n\`\`\`json\n${JSON.stringify(structuredContent, null, 2)}\n\`\`\``;
|
|
660
|
+
}
|
|
636
661
|
return {
|
|
637
662
|
markdown: md,
|
|
638
663
|
structuredContent,
|
|
@@ -641,7 +666,7 @@ export function formatProvisionResult(result, slotClaim) {
|
|
|
641
666
|
/**
|
|
642
667
|
* Format appliance CLI execution result into Markdown + JSON
|
|
643
668
|
*/
|
|
644
|
-
export function formatApplianceExecResult(result) {
|
|
669
|
+
export function formatApplianceExecResult(result, options) {
|
|
645
670
|
const isSuccess = result.exitCode === 0;
|
|
646
671
|
const isMock = result.mock === true;
|
|
647
672
|
const statusIcon = isSuccess ? "🟢" : "🔴";
|
|
@@ -677,7 +702,9 @@ export function formatApplianceExecResult(result) {
|
|
|
677
702
|
mock: isMock,
|
|
678
703
|
transportEvidence: result.transportEvidence,
|
|
679
704
|
};
|
|
680
|
-
|
|
705
|
+
if (options?.includeJsonDump) {
|
|
706
|
+
md += `\`\`\`json\n${JSON.stringify(structuredContent, null, 2)}\n\`\`\``;
|
|
707
|
+
}
|
|
681
708
|
return {
|
|
682
709
|
markdown: md,
|
|
683
710
|
structuredContent,
|
|
@@ -686,7 +713,7 @@ export function formatApplianceExecResult(result) {
|
|
|
686
713
|
/**
|
|
687
714
|
* Format automated end-to-end VM provisioning result into Markdown + JSON
|
|
688
715
|
*/
|
|
689
|
-
export function formatAutoProvisionResult(result) {
|
|
716
|
+
export function formatAutoProvisionResult(result, options) {
|
|
690
717
|
const icon = result.success ? "🟢" : "🔴";
|
|
691
718
|
const isMock = result.mock === true;
|
|
692
719
|
let md = "";
|
|
@@ -731,10 +758,125 @@ export function formatAutoProvisionResult(result) {
|
|
|
731
758
|
const structuredContent = {
|
|
732
759
|
...result,
|
|
733
760
|
};
|
|
734
|
-
|
|
761
|
+
if (options?.includeJsonDump) {
|
|
762
|
+
md += `\n\`\`\`json\n${JSON.stringify(structuredContent, null, 2)}\n\`\`\``;
|
|
763
|
+
}
|
|
735
764
|
return {
|
|
736
765
|
markdown: md,
|
|
737
766
|
structuredContent,
|
|
738
767
|
};
|
|
739
768
|
}
|
|
769
|
+
/**
|
|
770
|
+
* Format intelligent slot discovery result
|
|
771
|
+
*/
|
|
772
|
+
export function formatFindSlotResult(result, options) {
|
|
773
|
+
let md = "### 🔍 Slot Discovery & Fleet Capacity Analysis\n\n";
|
|
774
|
+
if (result.status === "available" || result.status === "auto_claimed") {
|
|
775
|
+
const icon = result.status === "auto_claimed" ? "🎉" : "🟢";
|
|
776
|
+
md += `${icon} **${result.message}**\n\n`;
|
|
777
|
+
if (result.candidateHost) {
|
|
778
|
+
const c = result.candidateHost;
|
|
779
|
+
md += `#### 🏆 Recommended Placement: \`${c.hostId}\`\n\n`;
|
|
780
|
+
md += "| Host Name | Platform | Status | Avail Slots | Free RAM | Free Disk | Score |\n";
|
|
781
|
+
md += "|---|:---:|:---:|:---:|:---:|:---:|:---:|\n";
|
|
782
|
+
md += `| \`${c.hostId}\` | ${c.hypervisorType === "proxmox" ? "Proxmox VE" : "VMware ESXi"} | 🟢 Online | **${c.availableSlots}** / ${c.totalPureSlots} | ${(c.freeMemoryMb / 1024).toFixed(1)} GB | ${c.freeDiskGb} GB | ${c.score} |\n\n`;
|
|
783
|
+
}
|
|
784
|
+
if (result.claim) {
|
|
785
|
+
const cl = result.claim;
|
|
786
|
+
md += `#### 📋 Reserved Slot Lease\n\n`;
|
|
787
|
+
md += "| Field | Value |\n";
|
|
788
|
+
md += "|---|---|\n";
|
|
789
|
+
md += `| **Slot ID** | \`${cl.slotId}\` |\n`;
|
|
790
|
+
md += `| **Claim ID** | \`${cl.claimId}\` |\n`;
|
|
791
|
+
md += `| **Host** | \`${cl.hostId}\` |\n`;
|
|
792
|
+
md += `| **Tag / Requester** | \`${cl.tag}\` |\n`;
|
|
793
|
+
if (cl.linearIssue)
|
|
794
|
+
md += `| **Linear Issue** | \`${cl.linearIssue}\` |\n`;
|
|
795
|
+
md += `| **Expires At** | ${cl.expiresAt} (${cl.durationMinutes} mins) |\n\n`;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
else if (result.status === "auto_reclaimed_and_claimed") {
|
|
799
|
+
md += `♻️ **${result.message}**\n\n`;
|
|
800
|
+
if (result.claim) {
|
|
801
|
+
const cl = result.claim;
|
|
802
|
+
md += `#### 📋 Newly Reclaimed & Allocated Slot Lease\n\n`;
|
|
803
|
+
md += "| Field | Value |\n";
|
|
804
|
+
md += "|---|---|\n";
|
|
805
|
+
md += `| **Slot ID** | \`${cl.slotId}\` |\n`;
|
|
806
|
+
md += `| **Claim ID** | \`${cl.claimId}\` |\n`;
|
|
807
|
+
md += `| **Host** | \`${cl.hostId}\` |\n`;
|
|
808
|
+
md += `| **Expires At** | ${cl.expiresAt} |\n\n`;
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
else {
|
|
812
|
+
// Fleet full
|
|
813
|
+
md += `⚠️ **${result.message}**\n\n`;
|
|
814
|
+
}
|
|
815
|
+
if (result.allCandidates && result.allCandidates.length > 0) {
|
|
816
|
+
md += "#### 🖥️ Fleet Candidate Rankings\n\n";
|
|
817
|
+
md += "| Candidate Host | Platform | Status | Avail Slots | Pure Cap | Free RAM | Free Disk | Score |\n";
|
|
818
|
+
md += "|---|:---:|:---:|:---:|:---:|:---:|:---:|\n";
|
|
819
|
+
for (const c of result.allCandidates) {
|
|
820
|
+
const hyp = c.hypervisorType === "proxmox" ? "Proxmox VE" : "VMware ESXi";
|
|
821
|
+
md += `| \`${c.hostId}\` | ${hyp} | 🟢 Online | ${c.availableSlots} | ${c.totalPureSlots} slots | ${(c.freeMemoryMb / 1024).toFixed(1)} GB | ${c.freeDiskGb} GB | ${c.score} |\n`;
|
|
822
|
+
}
|
|
823
|
+
md += "\n";
|
|
824
|
+
}
|
|
825
|
+
if (result.reclaimable && (result.reclaimable.expiredSlotsCount > 0 || result.reclaimable.disposableVmsCount > 0)) {
|
|
826
|
+
const rec = result.reclaimable;
|
|
827
|
+
md += `#### ♻️ Reclaimable Fleet Resources (~${Math.round(rec.reclaimableMemoryMb / 1024)} GB / ~${rec.reclaimableSlotsEst} slots)\n\n`;
|
|
828
|
+
if (rec.expiredSlotsCount > 0) {
|
|
829
|
+
md += `• **${rec.expiredSlotsCount} Expired Slot Lease(s):** ${rec.expiredSlots.map((s) => `\`${s.slotId}\` (${s.linearIssue || s.label || s.hostId})`).join(", ")}\n`;
|
|
830
|
+
}
|
|
831
|
+
if (rec.disposableVmsCount > 0) {
|
|
832
|
+
md += `• **${rec.disposableVmsCount} Stopped/Disposable VM(s):**\n`;
|
|
833
|
+
for (const vm of rec.disposableVms.slice(0, 8)) {
|
|
834
|
+
md += ` - \`${vm.name}\` (${vm.vmId}) on \`${vm.hostName}\`: ${(vm.memoryMb / 1024).toFixed(1)} GB RAM [${vm.status}]\n`;
|
|
835
|
+
}
|
|
836
|
+
if (rec.disposableVms.length > 8) {
|
|
837
|
+
md += ` - _...and ${rec.disposableVms.length - 8} more disposable VMs_\n`;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
md += "\n";
|
|
841
|
+
}
|
|
842
|
+
const structuredContent = {
|
|
843
|
+
...result,
|
|
844
|
+
};
|
|
845
|
+
if (options?.includeJsonDump) {
|
|
846
|
+
md += `\n\`\`\`json\n${JSON.stringify(structuredContent, null, 2)}\n\`\`\``;
|
|
847
|
+
}
|
|
848
|
+
return {
|
|
849
|
+
markdown: md.trim(),
|
|
850
|
+
structuredContent,
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* Format purge and redeploy workflow result
|
|
855
|
+
*/
|
|
856
|
+
export function formatPurgeAndRedeployResult(result, options) {
|
|
857
|
+
const icon = result.success ? "🟢" : "🔴";
|
|
858
|
+
let md = `### 🔄 Purge & Redeploy Execution Report\n\n`;
|
|
859
|
+
md += `**Result:** ${icon} ${result.message}\n\n`;
|
|
860
|
+
md += "| Step | Target | Status | Details |\n";
|
|
861
|
+
md += "|---|---|:---:|---|\n";
|
|
862
|
+
if (result.purgedVm) {
|
|
863
|
+
md += `| **1. Purge Old VM** | \`${result.purgedVm.name}\` (${result.purgedVm.vmId}) | 🟢 Purged | Destroyed on host \`${result.purgedVm.host}\` (${result.purgedVm.hypervisor}) |\n`;
|
|
864
|
+
}
|
|
865
|
+
if (result.reclaimedSlotId) {
|
|
866
|
+
md += `| **2. Release Slot** | \`${result.reclaimedSlotId}\` | 🟢 Reclaimed | Occupied capacity cleared |\n`;
|
|
867
|
+
}
|
|
868
|
+
if (result.newSlot) {
|
|
869
|
+
md += `| **3. Claim Fresh Slot** | \`${result.newSlot.slotId}\` | 🟢 Allocated | Host: \`${result.newSlot.hostId}\`, expires: ${result.newSlot.expiresAt} |\n`;
|
|
870
|
+
}
|
|
871
|
+
const structuredContent = {
|
|
872
|
+
...result,
|
|
873
|
+
};
|
|
874
|
+
if (options?.includeJsonDump) {
|
|
875
|
+
md += `\n\`\`\`json\n${JSON.stringify(structuredContent, null, 2)}\n\`\`\``;
|
|
876
|
+
}
|
|
877
|
+
return {
|
|
878
|
+
markdown: md.trim(),
|
|
879
|
+
structuredContent,
|
|
880
|
+
};
|
|
881
|
+
}
|
|
740
882
|
//# sourceMappingURL=formatters.js.map
|