@dench.com/cli 3.11.41-staging.864 → 3.11.43-staging.878
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/dench.ts +5 -3
- package/lib/enrichment-gateway.ts +8 -0
- package/package.json +1 -1
package/dench.ts
CHANGED
|
@@ -133,6 +133,7 @@ type AgentStatus = {
|
|
|
133
133
|
agent?: { id?: string } & JsonRecord;
|
|
134
134
|
counts?: JsonRecord;
|
|
135
135
|
rules?: JsonRecord[];
|
|
136
|
+
activeAgents?: JsonRecord[];
|
|
136
137
|
};
|
|
137
138
|
|
|
138
139
|
const api = {
|
|
@@ -5583,13 +5584,14 @@ async function main() {
|
|
|
5583
5584
|
|
|
5584
5585
|
if (command === "agents") {
|
|
5585
5586
|
if (runtime.mode === "session" || runtime.mode === "apiKey") {
|
|
5586
|
-
const status = await runtime.client.query(
|
|
5587
|
+
const status = (await runtime.client.query(
|
|
5587
5588
|
api.functions.agentWorkspace.whatCanIDoHere,
|
|
5588
5589
|
{
|
|
5589
5590
|
sessionToken: runtime.sessionToken,
|
|
5590
5591
|
},
|
|
5591
|
-
);
|
|
5592
|
-
|
|
5592
|
+
)) as AgentStatus;
|
|
5593
|
+
// `whatCanIDoHere` names the list `activeAgents`; it has no `agents`.
|
|
5594
|
+
print(status.activeAgents ?? []);
|
|
5593
5595
|
return;
|
|
5594
5596
|
}
|
|
5595
5597
|
const data = await devOverview(runtime);
|
|
@@ -267,6 +267,13 @@ export type EnrichmentGatewayOptions = {
|
|
|
267
267
|
* loop so callers (e.g. SSE clients that disconnect) can stop in-flight work.
|
|
268
268
|
*/
|
|
269
269
|
signal?: AbortSignal;
|
|
270
|
+
/**
|
|
271
|
+
* Extra request headers, e.g. the web app's signed member user context so
|
|
272
|
+
* the gateway credits the charge to the person who ran it (DEN-241). A
|
|
273
|
+
* function is called per request, so a long Find loop never sends an
|
|
274
|
+
* expired signature. Cannot override `Authorization` or `content-type`.
|
|
275
|
+
*/
|
|
276
|
+
headers?: () => Record<string, string>;
|
|
270
277
|
};
|
|
271
278
|
|
|
272
279
|
// ---------------------------------------------------------------------------
|
|
@@ -1715,6 +1722,7 @@ async function callGatewayJson(
|
|
|
1715
1722
|
const response = await fetchImpl(url, {
|
|
1716
1723
|
method: args.method,
|
|
1717
1724
|
headers: {
|
|
1725
|
+
...args.options.headers?.(),
|
|
1718
1726
|
...(args.method === "POST" ? { "content-type": "application/json" } : {}),
|
|
1719
1727
|
Authorization: `Bearer ${apiKey}`,
|
|
1720
1728
|
},
|