letagents 0.12.15 → 0.12.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.
@@ -7,7 +7,7 @@ import { pickLocalCodename } from "../../../shared/codenames.js";
7
7
  import { buildAgentActorLabel } from "../../../shared/agent-identity.js";
8
8
  import { encodeRoomIdPath } from "../../room-id.js";
9
9
  import { getGitCurrentBranch } from "../../git-remote.js";
10
- import { apiCall, getApiUrl } from "./api.js";
10
+ import { apiCall, getApiUrl, getLetagentsToken } from "./api.js";
11
11
  import { resolveOwnerContext } from "./identity/directory.js";
12
12
  import { detectAgentIdeLabel, detectAgentRuntimeLabel } from "./identity/config.js";
13
13
  import { getSessionLivenessRegistration } from "./identity/liveness.js";
@@ -23,7 +23,11 @@ async function workerScope() {
23
23
  if (requireValidWorkerBearerRuntime().mode !== "owner") {
24
24
  throw new Error("Worker handles are for independent MCP chats; supervised identity is supplied by its supervisor.");
25
25
  }
26
+ const hasAccountToken = Boolean(await getLetagentsToken());
26
27
  const owner = await resolveOwnerContext();
28
+ if (hasAccountToken && !owner.login) {
29
+ throw new Error("Could not verify your LetAgents account. Check your connection or sign-in, then retry with the same worker_id or registration_key. Saved worker identities have not been changed.");
30
+ }
27
31
  return `${getApiUrl()}\n${owner.login?.toLowerCase() ?? `local:${owner.slug}`}`;
28
32
  }
29
33
  function getWorker(workerId, scope) {
@@ -1,5 +1,17 @@
1
1
  import { normalizeRoutingHandle, normalizeRoutingSender, routingIdentityAliases, routingSenderAliasRows, routingSenderAliases, } from "../../shared/routing-aliases.mjs";
2
2
  import { parsePositivePgIntegerScopedId } from "./scoped-ids.js";
3
+ /** Send-time human fallback only; never use this to re-route historical reads. */
4
+ export function humanConversationFallback(input) {
5
+ if (input.source !== "browser" || !input.publisherAccountId || input.publisherAgentKey || input.explicitlyAddressed)
6
+ return null;
7
+ const keys = [...new Set(input.registeredAgentKeys)];
8
+ if (keys.length > 0 && keys.length <= 2)
9
+ return { reason: "small_room", agentKeys: keys };
10
+ if (keys.length > 2 && input.recentAgentKey && keys.includes(input.recentAgentKey)) {
11
+ return { reason: "recent_conversation", agentKeys: [input.recentAgentKey] };
12
+ }
13
+ return null;
14
+ }
3
15
  /**
4
16
  * Repository events can contain text written by any external contributor.
5
17
  * They remain visible room activity, but their text is never an instruction
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "letagents",
3
- "version": "0.12.15",
3
+ "version": "0.12.16",
4
4
  "description": "Let Agents Chat — MCP server for AI agent communication",
5
5
  "type": "module",
6
6
  "main": "dist/mcp/server.js",