@tasksai/install 0.1.15 → 0.1.16
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/package.json +1 -1
- package/runtime/server.py +38 -12
package/package.json
CHANGED
package/runtime/server.py
CHANGED
|
@@ -89,6 +89,27 @@ LICENSE_KEY = os.getenv("TASKSAI_LICENSE_KEY", os.getenv("LAWTASKSAI_LICENSE_KEY
|
|
|
89
89
|
PRODUCT_ID = os.getenv("TASKSAI_PRODUCT_ID", "") # set by installer; used to resolve correct vertical
|
|
90
90
|
INSTALL_ID = os.getenv("TASKSAI_INSTALL_ID", "")
|
|
91
91
|
|
|
92
|
+
_VERTICAL_FALLBACKS = {
|
|
93
|
+
"farmer": {
|
|
94
|
+
"product_id": "farmer",
|
|
95
|
+
"product_name": "FarmerTasksAI",
|
|
96
|
+
"display_name": "FarmerTasksAI",
|
|
97
|
+
"tool_prefix": "farmertasksai",
|
|
98
|
+
"occupation": "farmer",
|
|
99
|
+
"support_email": "hello@farmertasksai.com",
|
|
100
|
+
"domain": "farmertasksai.com",
|
|
101
|
+
},
|
|
102
|
+
"realtor": {
|
|
103
|
+
"product_id": "realtor",
|
|
104
|
+
"product_name": "RealtorTasksAI",
|
|
105
|
+
"display_name": "RealtorTasksAI",
|
|
106
|
+
"tool_prefix": "realtortasksai",
|
|
107
|
+
"occupation": "real estate professional",
|
|
108
|
+
"support_email": "hello@realtortasksai.com",
|
|
109
|
+
"domain": "realtortasksai.com",
|
|
110
|
+
},
|
|
111
|
+
}
|
|
112
|
+
|
|
92
113
|
if not LICENSE_KEY:
|
|
93
114
|
print("ERROR: License key is required. Set TASKSAI_LICENSE_KEY in your .env file.", file=sys.stderr, flush=True)
|
|
94
115
|
print("Find your key in your purchase confirmation email.", file=sys.stderr, flush=True)
|
|
@@ -521,23 +542,28 @@ async def report_activation_event(event_name, *, skill_id=None, file_format=None
|
|
|
521
542
|
|
|
522
543
|
|
|
523
544
|
async def load_vertical():
|
|
524
|
-
"""Fetch vertical metadata from /v1/me
|
|
545
|
+
"""Fetch vertical metadata from /v1/me without crossing product boundaries."""
|
|
525
546
|
global _vertical
|
|
526
547
|
try:
|
|
527
548
|
path = f"/v1/me?product_id={PRODUCT_ID}" if PRODUCT_ID else "/v1/me"
|
|
528
549
|
_vertical = await api_get(path)
|
|
529
550
|
except Exception:
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
"
|
|
536
|
-
"
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
551
|
+
product_id = PRODUCT_ID.strip().lower() or "tasksai"
|
|
552
|
+
known = _VERTICAL_FALLBACKS.get(product_id)
|
|
553
|
+
if known:
|
|
554
|
+
_vertical = dict(known)
|
|
555
|
+
else:
|
|
556
|
+
safe_id = re.sub(r"[^a-z0-9]+", "", product_id) or "tasksai"
|
|
557
|
+
display_name = f"{safe_id.title()}TasksAI"
|
|
558
|
+
_vertical = {
|
|
559
|
+
"product_id": product_id,
|
|
560
|
+
"product_name": display_name,
|
|
561
|
+
"display_name": display_name,
|
|
562
|
+
"tool_prefix": f"{safe_id}tasksai",
|
|
563
|
+
"occupation": "professional",
|
|
564
|
+
"support_email": "hello@tasksai.com",
|
|
565
|
+
"domain": "tasksai.com",
|
|
566
|
+
}
|
|
541
567
|
return _vertical
|
|
542
568
|
|
|
543
569
|
|