@forwardimpact/libeval 0.1.44 → 0.1.46

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.
@@ -1,44 +1,10 @@
1
1
  /**
2
- * Shared helpers for Facilitator and Supervisor orchestrators:
3
- * - `createAsyncQueue` — simple promise-based queue used by the facilitator
4
- * event loop.
5
- * - `formatMessages` — render a drained message batch as tagged lines.
6
- */
7
-
8
- /** Create a promise-based async queue for serializing event delivery to the facilitator loop. */
9
- export function createAsyncQueue() {
10
- const items = [];
11
- let waiter = null;
12
- let closed = false;
13
- return {
14
- enqueue(item) {
15
- items.push(item);
16
- if (waiter) {
17
- waiter();
18
- waiter = null;
19
- }
20
- },
21
- async dequeue() {
22
- if (items.length > 0) return items.shift();
23
- if (closed) return null;
24
- await new Promise((resolve) => {
25
- waiter = resolve;
26
- });
27
- return items.length > 0 ? items.shift() : null;
28
- },
29
- close() {
30
- closed = true;
31
- if (waiter) {
32
- waiter();
33
- waiter = null;
34
- }
35
- },
36
- };
37
- }
38
-
39
- /**
40
- * Render a drained batch of bus messages as tagged text lines.
41
- * @param {Array<{from: string, text: string, kind?: string, direct?: boolean}>} messages
2
+ * Render a drained batch of bus messages as tagged text lines so the
3
+ * LLM can read its inbox at a glance. Asks and answers include the
4
+ * `askId` in the tag (`[ask#42] facilitator: …`, `[answer#42] agent: …`)
5
+ * so the addressee can quote it back via Answer's `askId` field.
6
+ *
7
+ * @param {Array<{from: string, text: string, kind?: string, askId?: number}>} messages
42
8
  * @returns {string}
43
9
  */
44
10
  export function formatMessages(messages) {
@@ -50,10 +16,8 @@ function formatMessage(m) {
50
16
  }
51
17
 
52
18
  function tagFor(m) {
53
- if (m.kind === "ask") return "[ask]";
54
- if (m.kind === "answer") return "[answer]";
55
- if (m.kind === "announce") return "[shared]";
19
+ if (m.kind === "ask") return `[ask#${m.askId}]`;
20
+ if (m.kind === "answer") return `[answer#${m.askId}]`;
56
21
  if (m.kind === "synthetic") return "[system]";
57
- if (m.kind === "direct") return "[direct]";
58
- return m.direct ? "[direct]" : "[shared]";
22
+ return "[shared]";
59
23
  }
package/src/redaction.js CHANGED
@@ -16,7 +16,9 @@ export const DEFAULT_ENV_ALLOWLIST = Object.freeze([
16
16
  "GH_TOKEN",
17
17
  "GITHUB_TOKEN",
18
18
  "MCP_TOKEN",
19
+ "MICROSOFT_APP_ID",
19
20
  "MICROSOFT_APP_PASSWORD",
21
+ "MICROSOFT_APP_TENANT_ID",
20
22
  "PRODUCT_LANDMARK_TOKEN",
21
23
  "SERVICE_SECRET",
22
24
  "SUPABASE_ANON_KEY",
@@ -6,15 +6,7 @@
6
6
  * controls what the live `textStream` and offline `toText()` show.
7
7
  */
8
8
 
9
- const SUPPRESSED = new Set([
10
- "session_start",
11
- "agent_start",
12
- "ask_received",
13
- "ask_answered",
14
- "redirect",
15
- "summary",
16
- "meta",
17
- ]);
9
+ const SUPPRESSED = new Set(["session_start", "agent_start", "summary", "meta"]);
18
10
 
19
11
  /**
20
12
  * @param {{type?: string}|null|undefined} event