@primusclaw/personal-agent-runtime 0.15.3 → 0.15.5

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/dist/index.js CHANGED
@@ -2397,16 +2397,9 @@ function assistantSettings(read2) {
2397
2397
  throw new ConfigError2(`ASSISTANT_REPLY_WINDOW_SECONDS must be a positive number of seconds, not ${pyRepr(window)}`);
2398
2398
  }
2399
2399
  const enabled = read2.isOn("ASSISTANT_ENABLED");
2400
- const understanding = read2.switch("PA_ASSISTANT_UNDERSTANDING", false);
2401
2400
  const users = new Set(read2.list("ASSISTANT_USERS", true));
2402
- const listed = new Set(read2.list("PA_ASSISTANT_UNDERSTANDING_USERS", true));
2403
- const understandingUsers = understanding ? listed.size > 0 ? listed : users : /* @__PURE__ */ new Set();
2404
- if (understanding && understandingUsers.size === 0) {
2405
- throw new ConfigError2(
2406
- `${read2.source("PA_ASSISTANT_UNDERSTANDING")} is on but ${read2.source("PA_ASSISTANT_UNDERSTANDING_USERS")} names nobody (and ASSISTANT_USERS is empty)`
2407
- );
2408
- }
2409
- if (understandingUsers.size > 0 && !enabled) {
2401
+ const { everybody, understandingUsers } = understandingOf(read2, users);
2402
+ if ((everybody || understandingUsers.size > 0) && !enabled) {
2410
2403
  throw new ConfigError2(`${read2.source("PA_ASSISTANT_UNDERSTANDING")} needs ASSISTANT_ENABLED`);
2411
2404
  }
2412
2405
  if (users.size > 0 && [...understandingUsers].some((u) => !users.has(u))) {
@@ -2418,9 +2411,17 @@ function assistantSettings(read2) {
2418
2411
  enabled,
2419
2412
  users,
2420
2413
  replyWindowSeconds: seconds === void 0 ? ASSISTANT_REPLY_WINDOW_SECONDS : Number(seconds),
2414
+ understandingAll: everybody,
2421
2415
  understandingUsers
2422
2416
  };
2423
2417
  }
2418
+ function understandingOf(read2, users) {
2419
+ if (!read2.switch("PA_ASSISTANT_UNDERSTANDING", false)) return { everybody: false, understandingUsers: /* @__PURE__ */ new Set() };
2420
+ const listed = new Set(read2.list("PA_ASSISTANT_UNDERSTANDING_USERS", true));
2421
+ if (listed.has("*") || listed.size === 0 && users.size === 0)
2422
+ return { everybody: true, understandingUsers: /* @__PURE__ */ new Set() };
2423
+ return { everybody: false, understandingUsers: listed.size > 0 ? listed : users };
2424
+ }
2424
2425
  function directChat(read2) {
2425
2426
  return {
2426
2427
  enabled: read2.switch("PA_DIRECT_CHAT", false),
package/dist/worker.js CHANGED
@@ -252,7 +252,7 @@ function keeper(base, notifyUrl) {
252
252
  logger: base.logger,
253
253
  baseUrl: notifyUrl,
254
254
  assistant: assistant.enabled,
255
- understood: (aadId) => assistant.understandingUsers.has(aadId.toLowerCase()),
255
+ understood: (aadId) => assistant.understandingAll === true || assistant.understandingUsers.has(aadId.toLowerCase()),
256
256
  assistantFor: (aadId) => assistant.users.size === 0 || assistant.users.has(aadId.toLowerCase()),
257
257
  userIdOf: async (key) => pyStrip((await base.plugins.identityLookup.ownerOfKey(key))?.id ?? "") || void 0,
258
258
  // The surface Claw routes this person's assistant messages by (a reply goes back to the surface the message came from).
@@ -292,7 +292,9 @@ function assistantChat(base, integrations, style, parts, hooks) {
292
292
  style: () => ({ assistantProgress: style.assistantProgress, assistantStreamSay: style.assistantStreamSay }),
293
293
  enabled: settings2.assistant.enabled,
294
294
  users: settings2.assistant.users,
295
+ understandingAll: settings2.assistant.understandingAll === true,
295
296
  understanding: settings2.assistant.understandingUsers,
297
+ publicBaseUrl: settings2.publicBaseUrl,
296
298
  pluginId: settings2.claw.pluginId ?? void 0,
297
299
  assistantName: settings2.botName,
298
300
  legacyTurn: (aadId) => hooks.legacyTurn(aadId),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primusclaw/personal-agent-runtime",
3
- "version": "0.15.3",
3
+ "version": "0.15.5",
4
4
  "description": "Node adapters for the personal agent's ports (clock, randomness, logging, storage, Claw, metrics, HTTP), and, at @primusclaw/personal-agent-runtime/worker, the worker process on any chat surface.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,7 +33,7 @@
33
33
  "access": "public"
34
34
  },
35
35
  "dependencies": {
36
- "@primusclaw/personal-agent": "0.15.3",
36
+ "@primusclaw/personal-agent": "0.15.5",
37
37
  "fastify": "^5.12.8",
38
38
  "zod": "^4.6.7"
39
39
  }