@ouro.bot/cli 0.1.0-alpha.16 → 0.1.0-alpha.160

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 (165) hide show
  1. package/AdoptionSpecialist.ouro/agent.json +3 -2
  2. package/AdoptionSpecialist.ouro/psyche/SOUL.md +3 -3
  3. package/AdoptionSpecialist.ouro/psyche/identities/monty.md +2 -2
  4. package/README.md +186 -191
  5. package/changelog.json +1081 -0
  6. package/dist/heart/active-work.js +633 -0
  7. package/dist/heart/bridges/manager.js +358 -0
  8. package/dist/heart/bridges/state-machine.js +135 -0
  9. package/dist/heart/bridges/store.js +123 -0
  10. package/dist/heart/commitments.js +105 -0
  11. package/dist/heart/config.js +40 -30
  12. package/dist/heart/core.js +608 -123
  13. package/dist/heart/cross-chat-delivery.js +146 -0
  14. package/dist/heart/daemon/agent-discovery.js +81 -0
  15. package/dist/heart/daemon/agent-service.js +360 -0
  16. package/dist/heart/daemon/auth-flow.js +477 -0
  17. package/dist/heart/daemon/cadence.js +70 -0
  18. package/dist/heart/daemon/daemon-cli.js +2467 -205
  19. package/dist/heart/daemon/daemon-entry.js +131 -4
  20. package/dist/heart/daemon/daemon-health.js +136 -0
  21. package/dist/heart/daemon/daemon-runtime-sync.js +212 -0
  22. package/dist/heart/daemon/daemon-tombstone.js +123 -0
  23. package/dist/heart/daemon/daemon.js +434 -17
  24. package/dist/heart/daemon/habit-migration.js +181 -0
  25. package/dist/heart/daemon/habit-parser.js +119 -0
  26. package/dist/heart/daemon/habit-scheduler.js +369 -0
  27. package/dist/heart/daemon/hatch-animation.js +10 -3
  28. package/dist/heart/daemon/hatch-flow.js +30 -111
  29. package/dist/heart/daemon/hooks/agent-config-v2.js +33 -0
  30. package/dist/heart/daemon/hooks/bundle-meta.js +92 -0
  31. package/dist/heart/daemon/inner-status.js +89 -0
  32. package/dist/heart/daemon/launchd.js +159 -0
  33. package/dist/heart/daemon/log-tailer.js +4 -3
  34. package/dist/heart/daemon/mcp-server.js +591 -0
  35. package/dist/heart/daemon/message-router.js +17 -8
  36. package/dist/heart/daemon/os-cron-deps.js +134 -0
  37. package/dist/heart/daemon/ouro-bot-global-installer.js +128 -0
  38. package/dist/heart/daemon/ouro-path-installer.js +78 -34
  39. package/dist/heart/daemon/ouro-version-manager.js +171 -0
  40. package/dist/heart/daemon/outlook-http.js +307 -0
  41. package/dist/heart/daemon/outlook-read.js +1281 -0
  42. package/dist/heart/daemon/outlook-render.js +1032 -0
  43. package/dist/heart/daemon/outlook-types.js +7 -0
  44. package/dist/heart/daemon/outlook-view.js +194 -0
  45. package/dist/heart/daemon/process-manager.js +75 -0
  46. package/dist/heart/daemon/run-hooks.js +39 -0
  47. package/dist/heart/daemon/runtime-logging.js +58 -15
  48. package/dist/heart/daemon/runtime-metadata.js +219 -0
  49. package/dist/heart/daemon/runtime-mode.js +67 -0
  50. package/dist/heart/daemon/safe-mode.js +161 -0
  51. package/dist/heart/daemon/sense-manager.js +50 -2
  52. package/dist/heart/daemon/session-id-resolver.js +131 -0
  53. package/dist/heart/daemon/skill-management-installer.js +94 -0
  54. package/dist/heart/daemon/socket-client.js +202 -0
  55. package/dist/heart/daemon/specialist-orchestrator.js +2 -2
  56. package/dist/heart/daemon/specialist-prompt.js +13 -8
  57. package/dist/heart/daemon/specialist-tools.js +53 -4
  58. package/dist/heart/daemon/staged-restart.js +114 -0
  59. package/dist/heart/daemon/task-scheduler.js +3 -25
  60. package/dist/heart/daemon/thoughts.js +507 -0
  61. package/dist/heart/daemon/update-checker.js +111 -0
  62. package/dist/heart/daemon/update-hooks.js +138 -0
  63. package/dist/heart/daemon/wrapper-publish-guard.js +86 -0
  64. package/dist/heart/delegation.js +62 -0
  65. package/dist/heart/identity.js +136 -55
  66. package/dist/heart/kicks.js +2 -20
  67. package/dist/heart/migrate-config.js +127 -0
  68. package/dist/heart/model-capabilities.js +48 -0
  69. package/dist/heart/obligations.js +197 -0
  70. package/dist/heart/progress-story.js +42 -0
  71. package/dist/heart/provider-failover.js +88 -0
  72. package/dist/heart/provider-ping.js +172 -0
  73. package/dist/heart/providers/anthropic-token.js +163 -0
  74. package/dist/heart/providers/anthropic.js +196 -36
  75. package/dist/heart/providers/azure.js +116 -10
  76. package/dist/heart/providers/github-copilot.js +157 -0
  77. package/dist/heart/providers/minimax.js +33 -3
  78. package/dist/heart/providers/openai-codex.js +51 -16
  79. package/dist/heart/session-activity.js +172 -0
  80. package/dist/heart/session-recall.js +216 -0
  81. package/dist/heart/streaming.js +117 -33
  82. package/dist/heart/target-resolution.js +127 -0
  83. package/dist/heart/tool-activity-callbacks.js +36 -0
  84. package/dist/heart/tool-description.js +135 -0
  85. package/dist/heart/tool-loop.js +200 -0
  86. package/dist/heart/turn-coordinator.js +28 -0
  87. package/dist/mind/associative-recall.js +122 -32
  88. package/dist/mind/bundle-manifest.js +14 -0
  89. package/dist/mind/context.js +125 -14
  90. package/dist/mind/{memory.js → diary.js} +70 -56
  91. package/dist/mind/first-impressions.js +16 -2
  92. package/dist/mind/friends/channel.js +56 -0
  93. package/dist/mind/friends/group-context.js +144 -0
  94. package/dist/mind/friends/store-file.js +19 -0
  95. package/dist/mind/friends/trust-explanation.js +74 -0
  96. package/dist/mind/friends/types.js +8 -0
  97. package/dist/mind/journal-index.js +161 -0
  98. package/dist/mind/obligation-steering.js +221 -0
  99. package/dist/mind/obligations.js +134 -0
  100. package/dist/mind/pending.js +76 -9
  101. package/dist/mind/phrases.js +1 -0
  102. package/dist/mind/prompt.js +651 -91
  103. package/dist/mind/token-estimate.js +8 -12
  104. package/dist/nerves/cli-logging.js +15 -2
  105. package/dist/nerves/coverage/run-artifacts.js +1 -1
  106. package/dist/nerves/event-buffer.js +111 -0
  107. package/dist/nerves/index.js +63 -3
  108. package/dist/nerves/observation.js +20 -0
  109. package/dist/nerves/runtime.js +5 -1
  110. package/dist/repertoire/ado-semantic.js +6 -0
  111. package/dist/repertoire/coding/codex-jsonl.js +64 -0
  112. package/dist/repertoire/coding/context-pack.js +254 -0
  113. package/dist/repertoire/coding/feedback.js +301 -0
  114. package/dist/repertoire/coding/index.js +4 -1
  115. package/dist/repertoire/coding/manager.js +210 -4
  116. package/dist/repertoire/coding/spawner.js +58 -12
  117. package/dist/repertoire/coding/tools.js +176 -4
  118. package/dist/repertoire/guardrails.js +291 -0
  119. package/dist/repertoire/mcp-client.js +254 -0
  120. package/dist/repertoire/mcp-manager.js +198 -0
  121. package/dist/repertoire/skills.js +14 -23
  122. package/dist/repertoire/tasks/board.js +43 -5
  123. package/dist/repertoire/tasks/fix.js +182 -0
  124. package/dist/repertoire/tasks/index.js +28 -10
  125. package/dist/repertoire/tasks/lifecycle.js +2 -2
  126. package/dist/repertoire/tasks/parser.js +3 -2
  127. package/dist/repertoire/tasks/scanner.js +194 -37
  128. package/dist/repertoire/tasks/transitions.js +11 -28
  129. package/dist/repertoire/tools-base.js +992 -273
  130. package/dist/repertoire/tools-bluebubbles.js +94 -0
  131. package/dist/repertoire/tools-github.js +1 -6
  132. package/dist/repertoire/tools-teams.js +12 -59
  133. package/dist/repertoire/tools.js +281 -101
  134. package/dist/scripts/claude-code-hook.js +41 -0
  135. package/dist/scripts/claude-code-stop-hook.js +47 -0
  136. package/dist/senses/attention-queue.js +97 -0
  137. package/dist/senses/bluebubbles-client.js +258 -5
  138. package/dist/senses/bluebubbles-entry.js +2 -0
  139. package/dist/senses/bluebubbles-inbound-log.js +109 -0
  140. package/dist/senses/bluebubbles-media.js +339 -0
  141. package/dist/senses/bluebubbles-model.js +12 -4
  142. package/dist/senses/bluebubbles-mutation-log.js +45 -5
  143. package/dist/senses/bluebubbles-runtime-state.js +109 -0
  144. package/dist/senses/bluebubbles-session-cleanup.js +72 -0
  145. package/dist/senses/bluebubbles.js +1040 -45
  146. package/dist/senses/cli-entry.js +1 -1
  147. package/dist/senses/cli-layout.js +187 -0
  148. package/dist/senses/cli.js +419 -152
  149. package/dist/senses/commands.js +38 -1
  150. package/dist/senses/continuity.js +94 -0
  151. package/dist/senses/habit-turn-message.js +108 -0
  152. package/dist/senses/inner-dialog-worker.js +112 -19
  153. package/dist/senses/inner-dialog.js +592 -84
  154. package/dist/senses/pipeline.js +502 -0
  155. package/dist/senses/shared-turn.js +196 -0
  156. package/dist/senses/surface-tool.js +95 -0
  157. package/dist/senses/teams.js +667 -120
  158. package/dist/senses/trust-gate.js +112 -2
  159. package/package.json +12 -4
  160. package/skills/configure-dev-tools.md +81 -0
  161. package/subagents/README.md +4 -70
  162. package/dist/heart/daemon/subagent-installer.js +0 -134
  163. package/subagents/work-doer.md +0 -233
  164. package/subagents/work-merger.md +0 -624
  165. package/subagents/work-planner.md +0 -373
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bluebubblesToolDefinitions = void 0;
4
+ const runtime_1 = require("../nerves/runtime");
5
+ exports.bluebubblesToolDefinitions = [
6
+ {
7
+ tool: {
8
+ type: "function",
9
+ function: {
10
+ name: "bluebubbles_set_reply_target",
11
+ description: "choose where the current iMessage turn should land. use this when you want to widen back to top-level or route your update into a specific active thread in the same chat.",
12
+ parameters: {
13
+ type: "object",
14
+ properties: {
15
+ target: {
16
+ type: "string",
17
+ enum: ["current_lane", "top_level", "thread"],
18
+ description: "current_lane mirrors the current inbound lane, top_level answers in the main chat, and thread targets a specific active thread.",
19
+ },
20
+ threadOriginatorGuid: {
21
+ type: "string",
22
+ description: "required when target=thread; use one of the thread ids surfaced in the inbound iMessage context.",
23
+ },
24
+ },
25
+ required: ["target"],
26
+ },
27
+ },
28
+ },
29
+ handler: (args, ctx) => {
30
+ const target = typeof args.target === "string" ? args.target.trim() : "";
31
+ const controller = ctx?.bluebubblesReplyTarget;
32
+ if (!controller) {
33
+ (0, runtime_1.emitNervesEvent)({
34
+ level: "warn",
35
+ component: "tools",
36
+ event: "tool.error",
37
+ message: "bluebubbles reply target missing controller",
38
+ meta: { target },
39
+ });
40
+ return "bluebubbles reply targeting is not available in this context.";
41
+ }
42
+ if (target === "current_lane") {
43
+ const result = controller.setSelection({ target: "current_lane" });
44
+ (0, runtime_1.emitNervesEvent)({
45
+ component: "tools",
46
+ event: "tool.end",
47
+ message: "bluebubbles reply target updated",
48
+ meta: { target: "current_lane", success: true },
49
+ });
50
+ return result;
51
+ }
52
+ if (target === "top_level") {
53
+ const result = controller.setSelection({ target: "top_level" });
54
+ (0, runtime_1.emitNervesEvent)({
55
+ component: "tools",
56
+ event: "tool.end",
57
+ message: "bluebubbles reply target updated",
58
+ meta: { target: "top_level", success: true },
59
+ });
60
+ return result;
61
+ }
62
+ if (target === "thread") {
63
+ const threadOriginatorGuid = typeof args.threadOriginatorGuid === "string" ? args.threadOriginatorGuid.trim() : "";
64
+ if (!threadOriginatorGuid) {
65
+ (0, runtime_1.emitNervesEvent)({
66
+ level: "warn",
67
+ component: "tools",
68
+ event: "tool.error",
69
+ message: "bluebubbles reply target missing thread id",
70
+ meta: { target: "thread" },
71
+ });
72
+ return "threadOriginatorGuid is required when target=thread.";
73
+ }
74
+ const result = controller.setSelection({ target: "thread", threadOriginatorGuid });
75
+ (0, runtime_1.emitNervesEvent)({
76
+ component: "tools",
77
+ event: "tool.end",
78
+ message: "bluebubbles reply target updated",
79
+ meta: { target: "thread", success: true },
80
+ });
81
+ return result;
82
+ }
83
+ (0, runtime_1.emitNervesEvent)({
84
+ level: "warn",
85
+ component: "tools",
86
+ event: "tool.error",
87
+ message: "bluebubbles reply target invalid target",
88
+ meta: { target },
89
+ });
90
+ return "target must be one of: current_lane, top_level, thread.";
91
+ },
92
+ summaryKeys: ["target", "threadOriginatorGuid"],
93
+ },
94
+ ];
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.githubToolDefinitions = void 0;
4
- exports.summarizeGithubArgs = summarizeGithubArgs;
5
4
  const github_client_1 = require("./github-client");
6
5
  const runtime_1 = require("../nerves/runtime");
7
6
  exports.githubToolDefinitions = [
@@ -44,10 +43,6 @@ exports.githubToolDefinitions = [
44
43
  },
45
44
  integration: "github",
46
45
  confirmationRequired: true,
46
+ summaryKeys: ["title"],
47
47
  },
48
48
  ];
49
- function summarizeGithubArgs(name, args) {
50
- if (name === "file_ouroboros_bug")
51
- return args.title || "";
52
- return undefined;
53
- }
@@ -3,24 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.teamsToolHandlers = exports.teamsTools = exports.teamsToolDefinitions = void 0;
7
- exports.summarizeTeamsArgs = summarizeTeamsArgs;
6
+ exports.teamsToolDefinitions = void 0;
8
7
  const graph_client_1 = require("./graph-client");
9
8
  const ado_client_1 = require("./ado-client");
10
9
  const graph_endpoints_json_1 = __importDefault(require("./data/graph-endpoints.json"));
11
10
  const ado_endpoints_json_1 = __importDefault(require("./data/ado-endpoints.json"));
12
11
  const runtime_1 = require("../nerves/runtime");
13
12
  const MUTATE_METHODS = ["POST", "PATCH", "DELETE"];
14
- // Map HTTP method to authority action name for canWrite() checks
15
- const METHOD_TO_ACTION = {
16
- POST: "createWorkItem",
17
- PATCH: "updateWorkItem",
18
- DELETE: "deleteWorkItem",
19
- };
20
- // Check if a tool response indicates a 403 PERMISSION_DENIED (authority checker removed; this is now a no-op kept for call-site stability)
21
- function checkAndRecord403(_result, _integration, _scope, _action, _ctx) {
22
- // No-op: AuthorityChecker eliminated. 403 recording removed.
23
- }
24
13
  const DEFAULT_ADO_QUERY = "SELECT [System.Id], [System.Title], [System.State], [System.AssignedTo] FROM WorkItems WHERE [System.AssignedTo] = @Me AND [System.State] <> 'Closed' ORDER BY [System.ChangedDate] DESC";
25
14
  exports.teamsToolDefinitions = [
26
15
  // -- Generic Graph tools --
@@ -46,6 +35,7 @@ exports.teamsToolDefinitions = [
46
35
  return (0, graph_client_1.graphRequest)(ctx.graphToken, "GET", args.path);
47
36
  },
48
37
  integration: "graph",
38
+ summaryKeys: ["path"],
49
39
  },
50
40
  {
51
41
  tool: {
@@ -75,6 +65,7 @@ exports.teamsToolDefinitions = [
75
65
  },
76
66
  integration: "graph",
77
67
  confirmationRequired: true,
68
+ summaryKeys: ["method", "path"],
78
69
  },
79
70
  // -- Generic ADO tools --
80
71
  {
@@ -101,11 +92,10 @@ exports.teamsToolDefinitions = [
101
92
  return "AUTH_REQUIRED:ado -- I need access to Azure DevOps. Please sign in when prompted.";
102
93
  }
103
94
  const method = args.method || "GET";
104
- const result = await (0, ado_client_1.adoRequest)(ctx.adoToken, method, args.organization, args.path, args.body, args.host);
105
- checkAndRecord403(result, "ado", args.organization, method, ctx);
106
- return result;
95
+ return (0, ado_client_1.adoRequest)(ctx.adoToken, method, args.organization, args.path, args.body, args.host);
107
96
  },
108
97
  integration: "ado",
98
+ summaryKeys: ["method", "organization", "path"],
109
99
  },
110
100
  {
111
101
  tool: {
@@ -133,14 +123,11 @@ exports.teamsToolDefinitions = [
133
123
  if (!MUTATE_METHODS.includes(args.method)) {
134
124
  return `Invalid method "${args.method}". Must be one of: ${MUTATE_METHODS.join(", ")}`;
135
125
  }
136
- /* v8 ignore next -- fallback unreachable: method is validated against MUTATE_METHODS above @preserve */
137
- const action = METHOD_TO_ACTION[args.method] || args.method;
138
- const result = await (0, ado_client_1.adoRequest)(ctx.adoToken, args.method, args.organization, args.path, args.body, args.host);
139
- checkAndRecord403(result, "ado", args.organization, action, ctx);
140
- return result;
126
+ return (0, ado_client_1.adoRequest)(ctx.adoToken, args.method, args.organization, args.path, args.body, args.host);
141
127
  },
142
128
  integration: "ado",
143
129
  confirmationRequired: true,
130
+ summaryKeys: ["method", "organization", "path"],
144
131
  },
145
132
  // -- Convenience aliases (backward compat) --
146
133
  {
@@ -159,6 +146,7 @@ exports.teamsToolDefinitions = [
159
146
  return (0, graph_client_1.getProfile)(ctx.graphToken);
160
147
  },
161
148
  integration: "graph",
149
+ summaryKeys: [],
162
150
  },
163
151
  {
164
152
  tool: {
@@ -202,6 +190,7 @@ exports.teamsToolDefinitions = [
202
190
  return (0, ado_client_1.queryWorkItems)(ctx.adoToken, org, query);
203
191
  },
204
192
  integration: "ado",
193
+ summaryKeys: ["organization", "query"],
205
194
  },
206
195
  // -- Proactive messaging --
207
196
  {
@@ -249,6 +238,7 @@ exports.teamsToolDefinitions = [
249
238
  },
250
239
  /* v8 ignore stop */
251
240
  confirmationRequired: true,
241
+ summaryKeys: ["user_name", "user_id"],
252
242
  },
253
243
  // -- Documentation tools --
254
244
  {
@@ -270,6 +260,7 @@ exports.teamsToolDefinitions = [
270
260
  return searchEndpoints(graph_endpoints_json_1.default, args.query || "");
271
261
  },
272
262
  integration: "graph",
263
+ summaryKeys: ["query"],
273
264
  },
274
265
  {
275
266
  tool: {
@@ -290,12 +281,9 @@ exports.teamsToolDefinitions = [
290
281
  return searchEndpoints(ado_endpoints_json_1.default, args.query || "");
291
282
  },
292
283
  integration: "ado",
284
+ summaryKeys: ["query"],
293
285
  },
294
286
  ];
295
- // Backward-compat: extract just the OpenAI tool schemas
296
- exports.teamsTools = exports.teamsToolDefinitions.map((d) => d.tool);
297
- // Backward-compat: extract just the handlers by name
298
- exports.teamsToolHandlers = Object.fromEntries(exports.teamsToolDefinitions.map((d) => [d.tool.function.name, d.handler]));
299
287
  function searchEndpoints(entries, query) {
300
288
  (0, runtime_1.emitNervesEvent)({
301
289
  component: "repertoire",
@@ -324,38 +312,3 @@ function searchEndpoints(entries, query) {
324
312
  return lines.join("\n");
325
313
  }).join("\n\n");
326
314
  }
327
- function summarizeTeamsArgs(name, args) {
328
- function summarizeKeyValues(keys) {
329
- const parts = [];
330
- for (const key of keys) {
331
- const raw = args[key];
332
- if (raw === undefined || raw === null)
333
- continue;
334
- const compact = String(raw).replace(/\s+/g, " ").trim();
335
- if (!compact)
336
- continue;
337
- const clipped = compact.length > 60 ? compact.slice(0, 60) + "..." : compact;
338
- parts.push(`${key}=${clipped}`);
339
- }
340
- return parts.join(" ");
341
- }
342
- if (name === "graph_profile")
343
- return "";
344
- if (name === "ado_work_items")
345
- return summarizeKeyValues(["organization", "query"]);
346
- if (name === "graph_query")
347
- return summarizeKeyValues(["path"]);
348
- if (name === "graph_mutate")
349
- return summarizeKeyValues(["method", "path"]);
350
- if (name === "ado_query")
351
- return summarizeKeyValues(["method", "organization", "path"]);
352
- if (name === "ado_mutate")
353
- return summarizeKeyValues(["method", "organization", "path"]);
354
- if (name === "graph_docs")
355
- return summarizeKeyValues(["query"]);
356
- if (name === "ado_docs")
357
- return summarizeKeyValues(["query"]);
358
- if (name === "teams_send_message")
359
- return summarizeKeyValues(["user_name", "user_id"]);
360
- return undefined;
361
- }