huddle-cli 0.1.1 → 0.1.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/QUICKSTART.md +63 -2
  3. package/README.md +15 -0
  4. package/dist/adapters/codex.js +3 -0
  5. package/dist/app/live.js +142 -0
  6. package/dist/app/page.js +775 -0
  7. package/dist/app/qr.js +47 -0
  8. package/dist/app/server.js +433 -0
  9. package/dist/args.js +18 -0
  10. package/dist/attach/connect.js +3 -3
  11. package/dist/attach/plug.js +8 -1
  12. package/dist/cli.js +46 -4
  13. package/dist/connectors/cli.js +121 -0
  14. package/dist/connectors/github.js +162 -0
  15. package/dist/connectors/hub.js +234 -0
  16. package/dist/connectors/types.js +3 -0
  17. package/dist/mcp/context-tools.js +2 -0
  18. package/dist/mcp/server.js +42 -3
  19. package/dist/orchestrator/brain.js +3 -1
  20. package/dist/orchestrator/budget.js +283 -0
  21. package/dist/orchestrator/busy.js +106 -0
  22. package/dist/orchestrator/council.js +11 -5
  23. package/dist/orchestrator/launcher.js +3 -1
  24. package/dist/orchestrator/learn.js +3 -7
  25. package/dist/orchestrator/planner.js +32 -5
  26. package/dist/orchestrator/qa.js +9 -1
  27. package/dist/orchestrator/scheduler.js +105 -19
  28. package/dist/platform.js +104 -0
  29. package/dist/room/mail.js +19 -6
  30. package/dist/room/server.js +82 -2
  31. package/dist/room/user.js +54 -0
  32. package/dist/ui/app.js +511 -69
  33. package/dist/ui/brief.js +494 -0
  34. package/dist/ui/catalog.js +1 -1
  35. package/dist/ui/dashboard.js +92 -21
  36. package/dist/ui/export.js +1194 -0
  37. package/dist/ui/narrator.js +56 -0
  38. package/dist/ui/story.js +118 -93
  39. package/dist/ui/talk.js +176 -0
  40. package/dist/ui/term.js +31 -0
  41. package/dist/ui/transcript.js +434 -0
  42. package/dist/ui/undo.js +131 -0
  43. package/dist/ui/watch.js +4 -0
  44. package/dist/update.js +84 -0
  45. package/package.json +3 -1
@@ -0,0 +1,54 @@
1
+ // The person at the keyboard, as a member of the room.
2
+ //
3
+ // Found live (0.1.2 test): mid-run there was no way to tell the agents
4
+ // anything; a typed line only queued the next goal. Now a line typed during a
5
+ // run reaches every agent that's working, sent as "you", and it outranks
6
+ // teammates' notes: they are information; this is the person the work is for.
7
+ // Agents that start later get every such note in their launch prompt.
8
+ /** The user's id in messages and shared memory. Never an agent's id. */
9
+ export const USER_ID = "you";
10
+ export const isUser = (from) => from === USER_ID;
11
+ /** The prefix of a note from the user in shared memory. */
12
+ const SAID = "The user said: ";
13
+ /**
14
+ * Send what the user typed to the agents working now (or to `to`, an agent
15
+ * id), and keep it in shared memory so every task that starts later gets it.
16
+ * Returns who got it now.
17
+ */
18
+ export function sayToAgents(db, text, to) {
19
+ const body = text.trim();
20
+ if (!body)
21
+ return { now: [], saved: false };
22
+ const working = db.listAgents().filter((a) => a.status === "working").map((a) => a.id);
23
+ const want = to?.trim().replace(/^@/, "").toLowerCase();
24
+ const now = want ? working.filter((id) => id.toLowerCase() === want || id.toLowerCase().split("#")[0] === want) : working;
25
+ for (const id of now)
26
+ db.sendMessage({ from: USER_ID, to: id, body, kind: "note" });
27
+ // Addressed to one agent: it's for that agent's task, not every later one.
28
+ if (!want)
29
+ db.remember({ kind: "decision", body: SAID + body, author: USER_ID });
30
+ return { now, saved: !want };
31
+ }
32
+ /** Everything the user said this run, for the launch prompt of a task that starts now. */
33
+ export function userBrief(db) {
34
+ const since = db.currentSession()?.created_at ?? 0;
35
+ const said = db
36
+ .recall()
37
+ .filter((m) => m.author === USER_ID && m.created_at >= since)
38
+ .reverse()
39
+ .map((m) => `- ${m.body.startsWith(SAID) ? m.body.slice(SAID.length) : m.body}`);
40
+ if (!said.length)
41
+ return "";
42
+ return [
43
+ "FROM THE USER — the person this work is for said this during the run. Follow it: it wins over the plan and the contract",
44
+ "(if it changes a name another task uses, huddle_amend_contract so they hear it too):",
45
+ ...said.slice(-10),
46
+ ].join("\n");
47
+ }
48
+ /** How a message reads in an agent's tool result: the user's are marked as theirs. */
49
+ export function fromLabel(m) {
50
+ return isUser(m.from_agent) ? "the user" : m.from_agent;
51
+ }
52
+ /** Leads a tool result's inbox hint when the user wrote. */
53
+ export const USER_HEAD_HINT = 'The USER (the person this work is for) wrote to the team — see new_messages sent by "the user". Follow it now: it wins over the plan, the contract and teammates\' notes. ';
54
+ //# sourceMappingURL=user.js.map