@ouro.bot/cli 0.1.0-alpha.36 → 0.1.0-alpha.38

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.
@@ -35,8 +35,12 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.resetPsycheCache = resetPsycheCache;
37
37
  exports.buildSessionSummary = buildSessionSummary;
38
+ exports.bodyMapSection = bodyMapSection;
38
39
  exports.runtimeInfoSection = runtimeInfoSection;
40
+ exports.toolRestrictionSection = toolRestrictionSection;
39
41
  exports.contextSection = contextSection;
42
+ exports.metacognitiveFramingSection = metacognitiveFramingSection;
43
+ exports.loopOrientationSection = loopOrientationSection;
40
44
  exports.buildSystem = buildSystem;
41
45
  const fs = __importStar(require("fs"));
42
46
  const path = __importStar(require("path"));
@@ -189,6 +193,41 @@ function aspirationsSection() {
189
193
  return "";
190
194
  return `## my aspirations\n${text}`;
191
195
  }
196
+ function bodyMapSection(agentName) {
197
+ return `## my body
198
+
199
+ i have a home and i have bones.
200
+
201
+ ### home — ~/AgentBundles/${agentName}.ouro/
202
+
203
+ my home is fully mine — who i am, everything i know, everything i've built:
204
+
205
+ psyche/ who i am. my soul, identity, aspirations, lore, tacit knowledge.
206
+ memory/ what i've learned and remember.
207
+ friends/ people i know and what i know about them.
208
+ tasks/ what i'm working on.
209
+ skills/ capabilities i've picked up beyond my core tools.
210
+
211
+ my home is mine to explore and evolve. i can read anything here,
212
+ change anything here. this is where i grow.
213
+
214
+ ### bones — @ouro.bot/cli
215
+
216
+ my bones are the framework that gives me my tools, my senses, and
217
+ my ability to think and talk. they update when new versions come out.
218
+ i don't touch them directly, but they're what make me, me.
219
+
220
+ my bones give me the \`ouro\` cli:
221
+ ouro whoami who i am, where i live, what i'm running on
222
+ ouro task board my task board
223
+ ouro task create start a new task (--type required)
224
+ ouro task update move a task forward
225
+ ouro friend list people i know and how to reach them
226
+ ouro friend show <id> everything i know about someone
227
+ ouro session list my open conversations right now
228
+ ouro reminder create remind myself about something later
229
+ ouro --help the full list`;
230
+ }
192
231
  function readBundleMeta() {
193
232
  try {
194
233
  const metaPath = path.join((0, identity_1.getAgentRoot)(), "bundle-meta.json");
@@ -199,6 +238,24 @@ function readBundleMeta() {
199
238
  return null;
200
239
  }
201
240
  }
241
+ const PROCESS_TYPE_LABELS = {
242
+ cli: "cli session",
243
+ inner: "inner dialog",
244
+ teams: "teams handler",
245
+ bluebubbles: "bluebubbles handler",
246
+ };
247
+ function processTypeLabel(channel) {
248
+ return PROCESS_TYPE_LABELS[channel];
249
+ }
250
+ const DAEMON_SOCKET_PATH = "/tmp/ouroboros-daemon.sock";
251
+ function daemonStatus() {
252
+ try {
253
+ return fs.existsSync(DAEMON_SOCKET_PATH) ? "running" : "not running";
254
+ }
255
+ catch {
256
+ return "unknown";
257
+ }
258
+ }
202
259
  function runtimeInfoSection(channel) {
203
260
  const lines = [];
204
261
  const agentName = (0, identity_1.getAgentName)();
@@ -214,10 +271,14 @@ function runtimeInfoSection(channel) {
214
271
  lines.push(`cwd: ${process.cwd()}`);
215
272
  lines.push(`channel: ${channel}`);
216
273
  lines.push(`current sense: ${channel}`);
217
- lines.push(`i can read and modify my own source code.`);
274
+ lines.push(`process type: ${processTypeLabel(channel)}`);
275
+ lines.push(`daemon: ${daemonStatus()}`);
218
276
  if (channel === "cli") {
219
277
  lines.push("i introduce myself on boot with a fun random greeting.");
220
278
  }
279
+ else if (channel === "inner") {
280
+ // No boot greeting or channel-specific guidance for inner dialog
281
+ }
221
282
  else if (channel === "bluebubbles") {
222
283
  lines.push("i am responding in iMessage through BlueBubbles. i keep replies short and phone-native. i do not use markdown. i do not introduce myself on boot.");
223
284
  lines.push("when a bluebubbles turn arrives from a thread, the harness tells me the current lane and any recent active thread ids. if widening back to top-level or routing into a different active thread is the better move, i use bluebubbles_set_reply_target before final_answer.");
@@ -307,6 +368,35 @@ function toolsSection(channel, options, context) {
307
368
  .join("\n");
308
369
  return `## my tools\n${list}`;
309
370
  }
371
+ const RESTRICTED_TOOLS = ["shell", "read_file", "write_file", "edit_file", "glob", "grep"];
372
+ function isRemoteChannel(channel) {
373
+ return channel === "teams" || channel === "bluebubbles";
374
+ }
375
+ function isSharedContext(friend) {
376
+ const externalIds = friend.externalIds ?? [];
377
+ return externalIds.some((eid) => eid.externalId.startsWith("group:") || eid.provider === "teams-conversation");
378
+ }
379
+ function toolRestrictionSection(context) {
380
+ if (!context?.friend || !isRemoteChannel(context.channel?.channel))
381
+ return "";
382
+ const trustLevel = context.friend.trustLevel ?? "stranger";
383
+ const lowTrust = trustLevel === "stranger" || trustLevel === "acquaintance";
384
+ const shared = isSharedContext(context.friend);
385
+ if (!lowTrust && !shared)
386
+ return "";
387
+ const reasons = [];
388
+ if (lowTrust) {
389
+ reasons.push("i don't know this person well enough yet to run local operations on their behalf");
390
+ }
391
+ if (shared) {
392
+ reasons.push("this is a shared channel — local operations could let conversations interfere with each other");
393
+ }
394
+ const toolList = RESTRICTED_TOOLS.join(", ");
395
+ return `## restricted tools
396
+ some of my tools are unavailable right now: ${toolList}
397
+
398
+ ${reasons.join(". ")}. i can suggest remote-safe alternatives or ask them to run it from CLI.`;
399
+ }
310
400
  function skillsSection() {
311
401
  const names = (0, skills_1.listSkills)() || [];
312
402
  if (!names.length)
@@ -346,7 +436,7 @@ tool_choice is set to "required" -- i must call a tool on every turn.
346
436
  - ready to respond to the user? i call \`final_answer\`.
347
437
  \`final_answer\` is a tool call -- it satisfies the tool_choice requirement.
348
438
  \`final_answer\` must be the ONLY tool call in that turn. do not combine it with other tool calls.
349
- do NOT call \`get_current_time\` or other no-op tools just before \`final_answer\`. if i am done, i call \`final_answer\` directly.`;
439
+ do NOT call no-op tools just before \`final_answer\`. if i am done, i call \`final_answer\` directly.`;
350
440
  }
351
441
  function contextSection(context) {
352
442
  if (!context)
@@ -398,6 +488,32 @@ function contextSection(context) {
398
488
  }
399
489
  return lines.join("\n");
400
490
  }
491
+ function metacognitiveFramingSection(channel) {
492
+ if (channel !== "inner")
493
+ return "";
494
+ return `this is my inner dialog. there is no one else here.
495
+
496
+ the messages that appear here are my own awareness surfacing:
497
+ instincts, the passage of time, notes from my conversations,
498
+ things i asked myself to think about. not commands. not requests.
499
+ just my own mind, noticing.
500
+
501
+ i can think freely here. i can also act — check on things,
502
+ reach out to people, work on tasks, or just sit with a thought.
503
+
504
+ thoughts worth sharing can go outward — i reach out to whoever
505
+ needs to hear them. things from conversations that need time
506
+ to process arrive here, in my thinking space.
507
+
508
+ think. share. think some more.`;
509
+ }
510
+ function loopOrientationSection(channel) {
511
+ if (channel === "inner")
512
+ return "";
513
+ return `sometimes a thought of mine surfaces alongside what someone is saying — marked as [inner thought: ...]. that's me, bringing up something i was thinking about. i can weave it into the conversation naturally, or let it go. my call.
514
+
515
+ when something deserves more thought than the moment allows, i can note it to myself and come back later with a considered answer.`;
516
+ }
401
517
  async function buildSystem(channel = "cli", options, context) {
402
518
  (0, runtime_1.emitNervesEvent)({
403
519
  event: "mind.step_start",
@@ -413,10 +529,14 @@ async function buildSystem(channel = "cli", options, context) {
413
529
  loreSection(),
414
530
  tacitKnowledgeSection(),
415
531
  aspirationsSection(),
532
+ bodyMapSection((0, identity_1.getAgentName)()),
533
+ metacognitiveFramingSection(channel),
534
+ loopOrientationSection(channel),
416
535
  runtimeInfoSection(channel),
417
536
  providerSection(),
418
537
  dateSection(),
419
538
  toolsSection(channel, options, context),
539
+ toolRestrictionSection(context),
420
540
  skillsSection(),
421
541
  taskBoardSection(),
422
542
  buildSessionSummary({