@ouro.bot/cli 0.1.0-alpha.9 → 0.1.0-alpha.90

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 (128) hide show
  1. package/AdoptionSpecialist.ouro/agent.json +70 -9
  2. package/AdoptionSpecialist.ouro/psyche/SOUL.md +5 -2
  3. package/AdoptionSpecialist.ouro/psyche/identities/monty.md +2 -2
  4. package/README.md +147 -205
  5. package/assets/ouroboros.png +0 -0
  6. package/changelog.json +529 -0
  7. package/dist/heart/active-work.js +251 -0
  8. package/dist/heart/bridges/manager.js +358 -0
  9. package/dist/heart/bridges/state-machine.js +135 -0
  10. package/dist/heart/bridges/store.js +123 -0
  11. package/dist/heart/commitments.js +109 -0
  12. package/dist/heart/config.js +68 -23
  13. package/dist/heart/core.js +452 -93
  14. package/dist/heart/cross-chat-delivery.js +146 -0
  15. package/dist/heart/daemon/agent-discovery.js +81 -0
  16. package/dist/heart/daemon/auth-flow.js +430 -0
  17. package/dist/heart/daemon/daemon-cli.js +1737 -269
  18. package/dist/heart/daemon/daemon-entry.js +55 -6
  19. package/dist/heart/daemon/daemon-runtime-sync.js +212 -0
  20. package/dist/heart/daemon/daemon.js +216 -10
  21. package/dist/heart/daemon/hatch-animation.js +10 -3
  22. package/dist/heart/daemon/hatch-flow.js +7 -82
  23. package/dist/heart/daemon/hooks/bundle-meta.js +92 -0
  24. package/dist/heart/daemon/launchd.js +159 -0
  25. package/dist/heart/daemon/log-tailer.js +4 -3
  26. package/dist/heart/daemon/message-router.js +17 -8
  27. package/dist/heart/daemon/ouro-bot-entry.js +0 -0
  28. package/dist/heart/daemon/ouro-bot-global-installer.js +128 -0
  29. package/dist/heart/daemon/ouro-entry.js +0 -0
  30. package/dist/heart/daemon/ouro-path-installer.js +260 -0
  31. package/dist/heart/daemon/ouro-uti.js +11 -2
  32. package/dist/heart/daemon/ouro-version-manager.js +171 -0
  33. package/dist/heart/daemon/process-manager.js +14 -1
  34. package/dist/heart/daemon/run-hooks.js +37 -0
  35. package/dist/heart/daemon/runtime-logging.js +58 -15
  36. package/dist/heart/daemon/runtime-metadata.js +219 -0
  37. package/dist/heart/daemon/runtime-mode.js +67 -0
  38. package/dist/heart/daemon/sense-manager.js +307 -0
  39. package/dist/heart/daemon/skill-management-installer.js +94 -0
  40. package/dist/heart/daemon/socket-client.js +202 -0
  41. package/dist/heart/daemon/specialist-orchestrator.js +53 -84
  42. package/dist/heart/daemon/specialist-prompt.js +63 -11
  43. package/dist/heart/daemon/specialist-tools.js +211 -60
  44. package/dist/heart/daemon/staged-restart.js +114 -0
  45. package/dist/heart/daemon/thoughts.js +507 -0
  46. package/dist/heart/daemon/update-checker.js +111 -0
  47. package/dist/heart/daemon/update-hooks.js +138 -0
  48. package/dist/heart/daemon/wrapper-publish-guard.js +86 -0
  49. package/dist/heart/delegation.js +62 -0
  50. package/dist/heart/identity.js +126 -21
  51. package/dist/heart/kicks.js +1 -19
  52. package/dist/heart/model-capabilities.js +48 -0
  53. package/dist/heart/obligations.js +191 -0
  54. package/dist/heart/progress-story.js +42 -0
  55. package/dist/heart/providers/anthropic.js +74 -9
  56. package/dist/heart/providers/azure.js +86 -7
  57. package/dist/heart/providers/github-copilot.js +149 -0
  58. package/dist/heart/providers/minimax.js +4 -0
  59. package/dist/heart/providers/openai-codex.js +12 -3
  60. package/dist/heart/safe-workspace.js +362 -0
  61. package/dist/heart/sense-truth.js +61 -0
  62. package/dist/heart/session-activity.js +169 -0
  63. package/dist/heart/session-recall.js +116 -0
  64. package/dist/heart/streaming.js +100 -22
  65. package/dist/heart/target-resolution.js +123 -0
  66. package/dist/heart/turn-coordinator.js +28 -0
  67. package/dist/mind/associative-recall.js +14 -2
  68. package/dist/mind/bundle-manifest.js +70 -0
  69. package/dist/mind/context.js +57 -11
  70. package/dist/mind/first-impressions.js +16 -2
  71. package/dist/mind/friends/channel.js +35 -0
  72. package/dist/mind/friends/group-context.js +144 -0
  73. package/dist/mind/friends/store-file.js +19 -0
  74. package/dist/mind/friends/trust-explanation.js +74 -0
  75. package/dist/mind/friends/types.js +8 -0
  76. package/dist/mind/memory.js +27 -26
  77. package/dist/mind/obligation-steering.js +31 -0
  78. package/dist/mind/pending.js +76 -9
  79. package/dist/mind/phrases.js +1 -0
  80. package/dist/mind/prompt.js +467 -77
  81. package/dist/mind/token-estimate.js +8 -12
  82. package/dist/nerves/cli-logging.js +15 -2
  83. package/dist/nerves/coverage/run-artifacts.js +1 -1
  84. package/dist/nerves/index.js +12 -0
  85. package/dist/repertoire/ado-client.js +4 -2
  86. package/dist/repertoire/coding/feedback.js +180 -0
  87. package/dist/repertoire/coding/index.js +4 -1
  88. package/dist/repertoire/coding/manager.js +69 -4
  89. package/dist/repertoire/coding/spawner.js +21 -3
  90. package/dist/repertoire/coding/tools.js +105 -2
  91. package/dist/repertoire/data/ado-endpoints.json +188 -0
  92. package/dist/repertoire/guardrails.js +290 -0
  93. package/dist/repertoire/mcp-client.js +254 -0
  94. package/dist/repertoire/mcp-manager.js +195 -0
  95. package/dist/repertoire/skills.js +3 -26
  96. package/dist/repertoire/tasks/board.js +12 -0
  97. package/dist/repertoire/tasks/index.js +23 -9
  98. package/dist/repertoire/tasks/transitions.js +1 -2
  99. package/dist/repertoire/tools-base.js +714 -249
  100. package/dist/repertoire/tools-bluebubbles.js +93 -0
  101. package/dist/repertoire/tools-teams.js +58 -25
  102. package/dist/repertoire/tools.js +106 -53
  103. package/dist/senses/bluebubbles-client.js +210 -5
  104. package/dist/senses/bluebubbles-entry.js +2 -0
  105. package/dist/senses/bluebubbles-inbound-log.js +109 -0
  106. package/dist/senses/bluebubbles-media.js +339 -0
  107. package/dist/senses/bluebubbles-model.js +12 -4
  108. package/dist/senses/bluebubbles-mutation-log.js +45 -5
  109. package/dist/senses/bluebubbles-runtime-state.js +109 -0
  110. package/dist/senses/bluebubbles-session-cleanup.js +72 -0
  111. package/dist/senses/bluebubbles.js +894 -45
  112. package/dist/senses/cli-layout.js +187 -0
  113. package/dist/senses/cli.js +400 -164
  114. package/dist/senses/continuity.js +94 -0
  115. package/dist/senses/debug-activity.js +154 -0
  116. package/dist/senses/inner-dialog-worker.js +47 -18
  117. package/dist/senses/inner-dialog.js +377 -83
  118. package/dist/senses/pipeline.js +307 -0
  119. package/dist/senses/teams.js +573 -129
  120. package/dist/senses/trust-gate.js +112 -2
  121. package/package.json +14 -3
  122. package/subagents/README.md +4 -70
  123. package/dist/heart/daemon/specialist-session.js +0 -142
  124. package/dist/heart/daemon/subagent-installer.js +0 -125
  125. package/dist/inner-worker-entry.js +0 -4
  126. package/subagents/work-doer.md +0 -233
  127. package/subagents/work-merger.md +0 -624
  128. package/subagents/work-planner.md +0 -373
@@ -0,0 +1,187 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StreamingWordWrapper = void 0;
4
+ exports.wrapCliText = wrapCliText;
5
+ exports.formatEchoedInputSummary = formatEchoedInputSummary;
6
+ const runtime_1 = require("../nerves/runtime");
7
+ // Strip ANSI escape sequences to measure visible text width.
8
+ const ANSI_RE = /\x1b\[[0-9;]*[A-Za-z]/g;
9
+ function visibleLength(text) {
10
+ return text.replace(ANSI_RE, "").length;
11
+ }
12
+ /**
13
+ * Streaming word wrapper for terminal output.
14
+ *
15
+ * Text arrives in small chunks (sometimes single characters). This class
16
+ * buffers a partial line and emits complete wrapped lines at word boundaries
17
+ * when the visible width approaches the terminal column limit.
18
+ *
19
+ * ANSI escape sequences are treated as zero-width so colours and styles
20
+ * pass through without affecting line-break decisions.
21
+ */
22
+ class StreamingWordWrapper {
23
+ col = 0; // visible columns consumed on the current line
24
+ buf = ""; // buffered text for the current line (not yet emitted)
25
+ width; // terminal column count
26
+ constructor(cols) {
27
+ this.width = Math.max(cols ?? (process.stdout.columns || 80), 1);
28
+ }
29
+ /** Accept a chunk of already-rendered text and return text ready for stdout. */
30
+ push(text) {
31
+ let out = "";
32
+ for (let i = 0; i < text.length; i++) {
33
+ const ch = text[i];
34
+ // Pass through ANSI escape sequences without counting width
35
+ /* v8 ignore start -- ANSI handling: tested via StreamingWordWrapper ANSI test @preserve */
36
+ if (ch === "\x1b") {
37
+ const rest = text.slice(i);
38
+ const m = rest.match(/^\x1b\[[0-9;]*[A-Za-z]/);
39
+ if (m) {
40
+ this.buf += m[0];
41
+ i += m[0].length - 1;
42
+ continue;
43
+ }
44
+ }
45
+ /* v8 ignore stop */
46
+ // Explicit newline: flush current line and reset
47
+ if (ch === "\n") {
48
+ out += this.buf + "\n";
49
+ this.buf = "";
50
+ this.col = 0;
51
+ continue;
52
+ }
53
+ // Space: if the current line is already at or past width, wrap now.
54
+ // Otherwise just append.
55
+ if (ch === " ") {
56
+ /* v8 ignore start -- wrap-at-space: tested via StreamingWordWrapper unit tests @preserve */
57
+ if (this.col >= this.width) {
58
+ out += this.buf + "\n";
59
+ this.buf = "";
60
+ this.col = 0;
61
+ // Drop the space at the wrap point
62
+ continue;
63
+ /* v8 ignore stop */
64
+ }
65
+ this.buf += ch;
66
+ this.col++;
67
+ continue;
68
+ }
69
+ // Non-space character
70
+ this.col++;
71
+ if (this.col > this.width) {
72
+ // We've exceeded the width. Try to break at the last space.
73
+ const lastSpace = this.buf.lastIndexOf(" ");
74
+ if (lastSpace !== -1) {
75
+ out += this.buf.slice(0, lastSpace) + "\n";
76
+ // Keep the remainder (after space) plus current char
77
+ this.buf = this.buf.slice(lastSpace + 1) + ch;
78
+ this.col = visibleLength(this.buf);
79
+ }
80
+ else {
81
+ // No space to break at — hard wrap
82
+ out += this.buf + "\n";
83
+ this.buf = ch;
84
+ this.col = 1;
85
+ }
86
+ continue;
87
+ }
88
+ this.buf += ch;
89
+ }
90
+ return out;
91
+ }
92
+ /** Flush any remaining buffered text (call at end of response). */
93
+ flush() {
94
+ const remainder = this.buf;
95
+ this.buf = "";
96
+ this.col = 0;
97
+ return remainder;
98
+ }
99
+ /** Reset wrapper state (call at start of new model turn). */
100
+ reset() {
101
+ this.buf = "";
102
+ this.col = 0;
103
+ }
104
+ }
105
+ exports.StreamingWordWrapper = StreamingWordWrapper;
106
+ function splitLongWord(word, width) {
107
+ const chunks = [];
108
+ for (let index = 0; index < word.length; index += width) {
109
+ chunks.push(word.slice(index, index + width));
110
+ }
111
+ return chunks;
112
+ }
113
+ function wrapCliText(text, cols) {
114
+ const width = Math.max(cols, 1);
115
+ const wrapped = [];
116
+ for (const rawLine of text.split("\n")) {
117
+ if (rawLine.trim().length === 0) {
118
+ wrapped.push("");
119
+ continue;
120
+ }
121
+ const words = rawLine.trim().split(/\s+/);
122
+ let current = "";
123
+ for (const word of words) {
124
+ if (!current) {
125
+ if (word.length <= width) {
126
+ current = word;
127
+ continue;
128
+ }
129
+ const chunks = splitLongWord(word, width);
130
+ wrapped.push(...chunks.slice(0, -1));
131
+ current = chunks[chunks.length - 1];
132
+ continue;
133
+ }
134
+ const candidate = `${current} ${word}`;
135
+ if (candidate.length <= width) {
136
+ current = candidate;
137
+ continue;
138
+ }
139
+ wrapped.push(current);
140
+ if (word.length <= width) {
141
+ current = word;
142
+ continue;
143
+ }
144
+ const chunks = splitLongWord(word, width);
145
+ wrapped.push(...chunks.slice(0, -1));
146
+ current = chunks[chunks.length - 1];
147
+ }
148
+ wrapped.push(current);
149
+ }
150
+ return wrapped;
151
+ }
152
+ function countEchoedInputRows(input, cols) {
153
+ const width = Math.max(cols, 1);
154
+ return input.split("\n").reduce((sum, line, index) => {
155
+ const promptWidth = index === 0 ? 2 : 0;
156
+ return sum + Math.max(1, Math.ceil((promptWidth + line.length) / width));
157
+ }, 0);
158
+ }
159
+ function formatEchoedInputSummary(input, cols) {
160
+ const inputLines = input.split("\n");
161
+ const summary = `> ${inputLines[0]}${inputLines.length > 1 ? ` (+${inputLines.length - 1} lines)` : ""}`;
162
+ const wrappedSummary = wrapCliText(summary, cols);
163
+ const echoRows = countEchoedInputRows(input, cols);
164
+ (0, runtime_1.emitNervesEvent)({
165
+ component: "senses",
166
+ event: "senses.cli_echo_summary_formatted",
167
+ message: "formatted echoed cli input summary",
168
+ meta: {
169
+ cols,
170
+ echo_rows: echoRows,
171
+ input_line_count: inputLines.length,
172
+ wrapped_line_count: wrappedSummary.length,
173
+ },
174
+ });
175
+ let output = `\x1b[${echoRows}A`;
176
+ for (let i = 0; i < echoRows; i += 1) {
177
+ output += "\r\x1b[K";
178
+ if (i < echoRows - 1) {
179
+ output += "\x1b[1B";
180
+ }
181
+ }
182
+ if (echoRows > 1) {
183
+ output += `\x1b[${echoRows - 1}A`;
184
+ }
185
+ output += `\x1b[1m${wrappedSummary.join("\n")}\x1b[0m\n\n`;
186
+ return output;
187
+ }