@microsoft/m365-copilot-eval 1.2.0-preview.1 → 1.2.1-preview.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/README.md
CHANGED
|
@@ -386,6 +386,7 @@ chmod -R u+w $(runevals cache-dir)
|
|
|
386
386
|
- **[CI/CD Integration](./CICD_CACHE_GUIDE.md)** - GitHub Actions, Azure DevOps caching
|
|
387
387
|
- **[Testing Guide](./.github/TESTING_GUIDE.md)** - Cross-platform testing procedures
|
|
388
388
|
- **[Python CLI Guide](./PYTHON_CLI.md)** - Direct Python usage (without Node.js)
|
|
389
|
+
- **[Local Development Setup](./DEV_SETUP.md)** - Setting up the repo for local development
|
|
389
390
|
|
|
390
391
|
|
|
391
392
|
## Contributing
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/m365-copilot-eval",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1-preview.1",
|
|
4
4
|
"minCliVersion": "1.0.1-preview.1",
|
|
5
5
|
"description": "Zero-config Node.js wrapper for M365 Copilot Agent Evaluations CLI (Python-based Azure AI Evaluation SDK)",
|
|
6
|
-
"publishDate": "2026-03-
|
|
6
|
+
"publishDate": "2026-03-23",
|
|
7
7
|
"main": "src/clients/node-js/lib/index.js",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"bin": {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"build": "npm run prettier:check && npm run clean && npm run lint",
|
|
15
15
|
"clean": "rimraf node_modules/.cache dist coverage",
|
|
16
16
|
"test": "node --test tests/clients/node-js/**/*.test.js",
|
|
17
|
+
"install-credprovider": "artifacts-npm-credprovider && npm ci",
|
|
17
18
|
"set-publish-date": "node scripts/set-publish-date.js",
|
|
18
19
|
"prepublishOnly": "node scripts/set-publish-date.js",
|
|
19
20
|
"prettier:base": "prettier --parser babel",
|
package/src/clients/cli/main.py
CHANGED
|
@@ -3,6 +3,7 @@ import os
|
|
|
3
3
|
import argparse
|
|
4
4
|
import sys
|
|
5
5
|
import csv
|
|
6
|
+
import functools
|
|
6
7
|
import webbrowser
|
|
7
8
|
import urllib.request
|
|
8
9
|
import urllib.error
|
|
@@ -28,6 +29,7 @@ from schema_handler import DocumentUpgrader, SchemaVersionManager
|
|
|
28
29
|
from version_check import check_min_version, get_cli_version
|
|
29
30
|
from datetime import datetime, timezone
|
|
30
31
|
from pathlib import Path
|
|
32
|
+
import tzlocal
|
|
31
33
|
|
|
32
34
|
# Allowed endpoints for URL validation
|
|
33
35
|
ALLOWED_ENDPOINTS = [
|
|
@@ -728,6 +730,35 @@ def select_agent_interactively(agents: List[Dict[str, Any]]) -> Optional[str]:
|
|
|
728
730
|
|
|
729
731
|
return selected_agent
|
|
730
732
|
|
|
733
|
+
@functools.lru_cache(maxsize=1)
|
|
734
|
+
def _get_iana_timezone_name() -> str:
|
|
735
|
+
"""Get the IANA timezone name from the system using tzlocal.
|
|
736
|
+
|
|
737
|
+
Tries get_localzone_name() first; falls back to str(get_localzone()) when the
|
|
738
|
+
former raises (e.g. no zone configured on some Unix systems). Result is cached
|
|
739
|
+
after the first call so tzlocal is only invoked once per session.
|
|
740
|
+
"""
|
|
741
|
+
try:
|
|
742
|
+
return tzlocal.get_localzone_name()
|
|
743
|
+
except Exception:
|
|
744
|
+
return str(tzlocal.get_localzone())
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
@functools.lru_cache(maxsize=1)
|
|
748
|
+
def _get_location_info() -> Dict[str, Any]:
|
|
749
|
+
"""Return a locationInfo dict containing the local UTC offset and IANA timezone name.
|
|
750
|
+
|
|
751
|
+
Result is cached after the first call so the computation runs only once per session.
|
|
752
|
+
"""
|
|
753
|
+
now = datetime.now().astimezone()
|
|
754
|
+
utc_offset = now.utcoffset()
|
|
755
|
+
offset_hours = int(utc_offset.total_seconds() // 3600) if utc_offset is not None else 0
|
|
756
|
+
return {
|
|
757
|
+
"timeZoneOffset": offset_hours,
|
|
758
|
+
"timeZone": _get_iana_timezone_name(),
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
|
|
731
762
|
def build_chat_payload(prompt: str, user_oid: str, agent_id: str|None) -> bytes:
|
|
732
763
|
message = {
|
|
733
764
|
"message": {
|
|
@@ -735,6 +766,7 @@ def build_chat_payload(prompt: str, user_oid: str, agent_id: str|None) -> bytes:
|
|
|
735
766
|
"author": "user",
|
|
736
767
|
"messageType": "chat",
|
|
737
768
|
"timestamp": datetime.now(timezone.utc).isoformat(),
|
|
769
|
+
"locationInfo": _get_location_info(),
|
|
738
770
|
"from": {
|
|
739
771
|
"id": user_oid,
|
|
740
772
|
}
|