You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The existing script to gen the env.tsp uses const, but it doesn't matter in this case... same issue with const & alias, while I've already bugged #15017 & submitted a fix #15026 for this
But when it's referenced in the agent's TSP, like:
Because the source isn't public, sharing the gen'd JS in the package's distribution.
I believe the issue is rooted in the extractAndEscapeValue method ./dist/src/utils.js#133, which is called from the ODSP capability: .dist/src/entities/capabilities/onedrive-and-sharepoint.js#19-27
// utils.jsexportfunctionextractAndEscapeValue(node){if(!node){returnundefined;}// Simply return the node value without escaping// JSON.stringify will handle all escaping when the object is serializedreturnnode.value;}
Describe the bug
ODSP (maybe others?) makes it hard to use environment variables for dyanmic values.
Scenario:
I want to provide a specific document in an SPO list as knowledge via the doc's ID. In a JSON-based DA, I'd use:
In TypeSpec, specifically with the @microsoft/typespec-m365-copilot package, it appears impossible, whereas I can do this in other places.
Reproduced
Define envvar in ./env/.env.local:
On TypeSpec compile, it adds all envars, including this one, to ./src/env.tsp... cool ✅
Note
The existing script to gen the env.tsp uses
const, but it doesn't matter in this case... same issue withconst&alias, while I've already bugged #15017 & submitted a fix #15026 for thisBut when it's referenced in the agent's TSP, like:
It isn't resolved... You just get:
But other places where you use TypeSpec aliases from envvars work just fine, like this:
I believe the issue is rooted in the
extractAndEscapeValuemethod ./dist/src/utils.js#133, which is called from the ODSP capability: .dist/src/entities/capabilities/onedrive-and-sharepoint.js#19-27@Microsoft/typespec-m365-copilot: