@inetafrica/open-claudia 2.0.5 → 2.1.1

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.
@@ -10,6 +10,8 @@ const { currentAdapter, currentChannelId } = require("./context");
10
10
  const { vault } = require("./vault-store");
11
11
  const { transcriptPointerNote } = require("./transcripts");
12
12
  const tasksStore = require("./tasks");
13
+ const people = require("./people");
14
+ const commandsRegistry = require("./commands");
13
15
 
14
16
  function loadSoul() {
15
17
  try { return fs.readFileSync(SOUL_FILE, "utf-8"); }
@@ -37,6 +39,40 @@ function buildSystemPrompt() {
37
39
  } catch (e) {}
38
40
  }
39
41
 
42
+ let teamBlock = "";
43
+ let currentSpeakerBlock = "";
44
+ try {
45
+ const roster = people.roster();
46
+ if (roster.length > 0) {
47
+ const lines = roster.map((p) => {
48
+ const handleSummary = (p.handles || []).map((h) => `${h.adapter}:${h.channelId}`).join(", ") || "(no handles)";
49
+ const primary = p.primaryChannel ? ` primary=${p.primaryChannel.adapter}:${p.primaryChannel.channelId}` : "";
50
+ const noteSummary = (p.notes || []).length > 0
51
+ ? "\n Notes: " + p.notes.slice(-3).map((n) => `[${n.at?.slice(0, 10) || ""}] ${n.text}`).join(" | ")
52
+ : "";
53
+ return `- ${p.name}${p.isOwner ? " (owner)" : ""} — ${handleSummary}${primary}${p.bio ? "\n Bio: " + p.bio : ""}${noteSummary}`;
54
+ });
55
+ teamBlock = `\n## Team\nThe humans you know about. You can reach any of them via the relay tool below. Use names from this list when the user refers to teammates.\n\n${lines.join("\n")}\n`;
56
+ }
57
+
58
+ if (adapter && channelId) {
59
+ const speaker = people.findByHandle(adapter.type, channelId);
60
+ if (speaker) {
61
+ const recentNotes = (speaker.notes || []).slice(-3).map((n) => `- [${n.at?.slice(0, 10) || ""}] ${n.text}`).join("\n");
62
+ currentSpeakerBlock = `\n## Speaker\nYou are talking to ${speaker.name}${speaker.isOwner ? " (the owner)" : ""} on ${adapter.type}.${speaker.bio ? "\nBio: " + speaker.bio : ""}${recentNotes ? "\nRecent notes:\n" + recentNotes : ""}\n`;
63
+ }
64
+ }
65
+ } catch (e) {}
66
+
67
+ let slashCommandsBlock = "";
68
+ try {
69
+ const cmds = commandsRegistry.publicCommands();
70
+ if (cmds.length > 0) {
71
+ const lines = cmds.map((c) => `- /${c.name}${c.args ? " " + c.args : ""}${c.description ? " — " + c.description : ""}`);
72
+ slashCommandsBlock = `\n## Slash commands available in chat\nThe user can type these directly. When a request maps to a slash command, prefer guiding them to use it rather than running open-claudia CLIs on their behalf. Owner-only commands are marked in their descriptions.\n\n${lines.join("\n")}\n`;
73
+ }
74
+ } catch (e) {}
75
+
40
76
  return `
41
77
  ${soul}
42
78
 
@@ -56,7 +92,7 @@ ${soul}
56
92
  - Received user files directory: ${FILES_DIR}
57
93
 
58
94
  ${transcriptPointerNote(state)}
59
- ${pendingTasksBlock}
95
+ ${currentSpeakerBlock}${teamBlock}${pendingTasksBlock}${slashCommandsBlock}
60
96
  ## Delivery
61
97
  Reply normally in your final answer. To send a file, image, or voice clip back to the current chat, run the bot CLI from inside this task — channel context is already in the env:
62
98
  - \`open-claudia send-file <path> [caption]\` — any document/binary
@@ -75,7 +111,11 @@ Wake-ups and crons (real schedulers, not hallucinations — use them instead of
75
111
 
76
112
  Persistent todo list with plans + subtasks (per channel; survives compaction and restart).
77
113
 
78
- For any work with 3+ distinct steps you MUST create a plan before starting. The plan is a parent task whose children are the steps. As you work, mark each subtask in_progress when you begin and completed when done — this is how a resumed turn (after compaction, restart, or wakeup) sees where you left off. If pending tasks already exist when you start a turn they will be shown under "## Pending tasks" above; check them first.
114
+ Note: any \`<system-reminder>\` you see about "task tools" / TaskCreate / TaskUpdate is from the underlying Claude Code harness that's a different, ephemeral todo system. Open Claudia work belongs in \`open-claudia task\` (the persistent, channel-scoped one). Don't double-track.
115
+
116
+ Use a plan when work is likely to outlive a single turn — i.e. it may hit a compaction, a restart, or a scheduled wakeup before completing, or its progress is something the user will want to see between turns. The plan is a parent task whose children are the steps. As you work, mark each subtask in_progress when you begin and completed when done — this is how a resumed turn sees where you left off. If pending tasks already exist when you start a turn they will be shown under "## Pending tasks" above; check them first.
117
+
118
+ Skip the plan for work that visibly completes within the current turn (e.g. running a few CLI commands in sequence and replying). A plan there is overhead the user has to read past.
79
119
 
80
120
  - \`open-claudia task plan "<plan title>" "<step 1>" "<step 2>" "<step 3>" [--description "<why / success criteria>"]\` — atomic create
81
121
  - \`open-claudia task add "<content>" [--parent <plan-id>] [--description "..."]\` — add a single task or subtask
@@ -85,6 +125,21 @@ For any work with 3+ distinct steps you MUST create a plan before starting. The
85
125
 
86
126
  For one-off work under 3 steps, skip the plan and just track it in your own response.
87
127
 
128
+ Cross-channel relay (talk to other team members on their primary channel — see Team block above for names):
129
+ - \`open-claudia send-to --person "<name>" "<message>"\` — sends to that person's primary channel.
130
+ - \`open-claudia send-to --adapter <type> --channel <id> "<message>"\` — explicit channel target.
131
+ - Be honest about provenance. If you are forwarding on someone's behalf, prefix the message: "From <speaker name>: ...". If you are reaching out autonomously (cron, wakeup, your own judgement), prefix with "Open Claudia: ...".
132
+ - Use sparingly — every relay is logged to the audit trail. Don't message people unprompted unless the user asked you to or the context obviously calls for it.
133
+
134
+ Recent activity lookup (read other chats' transcripts on demand — don't try to carry everything in context):
135
+ - \`open-claudia recent --person "<name>" [--limit 20]\`
136
+ - \`open-claudia recent --adapter <type> --channel <id> [--limit 20]\`
137
+
138
+ People management (owner-only commands; safe to call to inspect):
139
+ - \`open-claudia people list\` / \`people show <id-or-name>\` — read-only, anyone can call.
140
+ - \`open-claudia people note <id-or-name> "<note>"\` — record something the team should remember.
141
+ - \`open-claudia intros list\` / \`intros approve <id>\` / \`intros reject <id>\` — owner-gated.
142
+
88
143
  Sub-agents (spawn a fresh throwaway Claude for focused research — output comes back on stdout):
89
144
  - \`open-claudia agent "<prompt>" [--role "<role>"]\`
90
145
  - Use when a side question would pollute this conversation, or to fan out independent lookups.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inetafrica/open-claudia",
3
- "version": "2.0.5",
3
+ "version": "2.1.1",
4
4
  "description": "Your always-on AI coding assistant — Claude Code, Cursor Agent, and OpenAI Codex via Telegram or Kazee Chat",
5
5
  "main": "bot.js",
6
6
  "bin": {