@ouro.bot/cli 0.1.0-alpha.8 → 0.1.0-alpha.80

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 (127) 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 +462 -0
  7. package/dist/heart/active-work.js +218 -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 +89 -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 +1746 -247
  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 +164 -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 +141 -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 +228 -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 +27 -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/pending.js +76 -9
  78. package/dist/mind/phrases.js +1 -0
  79. package/dist/mind/prompt.js +445 -77
  80. package/dist/mind/token-estimate.js +8 -12
  81. package/dist/nerves/cli-logging.js +15 -2
  82. package/dist/nerves/coverage/run-artifacts.js +1 -1
  83. package/dist/nerves/index.js +12 -0
  84. package/dist/repertoire/ado-client.js +4 -2
  85. package/dist/repertoire/coding/feedback.js +134 -0
  86. package/dist/repertoire/coding/index.js +4 -1
  87. package/dist/repertoire/coding/manager.js +62 -4
  88. package/dist/repertoire/coding/spawner.js +3 -3
  89. package/dist/repertoire/coding/tools.js +41 -2
  90. package/dist/repertoire/data/ado-endpoints.json +188 -0
  91. package/dist/repertoire/guardrails.js +290 -0
  92. package/dist/repertoire/mcp-client.js +254 -0
  93. package/dist/repertoire/mcp-manager.js +195 -0
  94. package/dist/repertoire/skills.js +3 -26
  95. package/dist/repertoire/tasks/board.js +12 -0
  96. package/dist/repertoire/tasks/index.js +23 -9
  97. package/dist/repertoire/tasks/transitions.js +1 -2
  98. package/dist/repertoire/tools-base.js +686 -251
  99. package/dist/repertoire/tools-bluebubbles.js +93 -0
  100. package/dist/repertoire/tools-teams.js +58 -25
  101. package/dist/repertoire/tools.js +95 -53
  102. package/dist/senses/bluebubbles-client.js +210 -5
  103. package/dist/senses/bluebubbles-entry.js +2 -0
  104. package/dist/senses/bluebubbles-inbound-log.js +109 -0
  105. package/dist/senses/bluebubbles-media.js +339 -0
  106. package/dist/senses/bluebubbles-model.js +12 -4
  107. package/dist/senses/bluebubbles-mutation-log.js +45 -5
  108. package/dist/senses/bluebubbles-runtime-state.js +109 -0
  109. package/dist/senses/bluebubbles-session-cleanup.js +72 -0
  110. package/dist/senses/bluebubbles.js +894 -45
  111. package/dist/senses/cli-layout.js +187 -0
  112. package/dist/senses/cli.js +405 -156
  113. package/dist/senses/continuity.js +94 -0
  114. package/dist/senses/debug-activity.js +154 -0
  115. package/dist/senses/inner-dialog-worker.js +47 -18
  116. package/dist/senses/inner-dialog.js +377 -83
  117. package/dist/senses/pipeline.js +307 -0
  118. package/dist/senses/teams.js +573 -129
  119. package/dist/senses/trust-gate.js +112 -2
  120. package/package.json +14 -3
  121. package/subagents/README.md +4 -70
  122. package/dist/heart/daemon/specialist-session.js +0 -142
  123. package/dist/heart/daemon/subagent-installer.js +0 -125
  124. package/dist/inner-worker-entry.js +0 -4
  125. package/subagents/work-doer.md +0 -233
  126. package/subagents/work-merger.md +0 -624
  127. package/subagents/work-planner.md +0 -373
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeContinuityClauses = normalizeContinuityClauses;
4
+ exports.resolveMustResolveBeforeHandoff = resolveMustResolveBeforeHandoff;
5
+ exports.classifySteeringFollowUpEffect = classifySteeringFollowUpEffect;
6
+ const runtime_1 = require("../nerves/runtime");
7
+ const NO_HANDOFF_CLAUSES = new Set([
8
+ "dont return control until complete or blocked",
9
+ "do not return control until complete or blocked",
10
+ "dont hand back control until complete or blocked",
11
+ "do not hand back control until complete or blocked",
12
+ "keep going until youre done",
13
+ "keep going until you are done",
14
+ "keep working until youre done",
15
+ "keep working until you are done",
16
+ "dont stop until youre done",
17
+ "do not stop until youre done",
18
+ "only come back if blocked",
19
+ "only return if blocked",
20
+ "only respond if blocked",
21
+ "work autonomously on this",
22
+ "work on this autonomously",
23
+ "handle this autonomously",
24
+ ]);
25
+ const CANCEL_SUPERSEDE_CLAUSES = new Set([
26
+ "stop",
27
+ "cancel that",
28
+ "cancel this",
29
+ "never mind",
30
+ "nevermind",
31
+ "forget it",
32
+ "ignore that",
33
+ "ignore this",
34
+ "hold off",
35
+ "ill take it from here",
36
+ "i will take it from here",
37
+ "lets do something else",
38
+ "stop working on that",
39
+ "stop working on this",
40
+ "dont do that",
41
+ "do not do that",
42
+ ]);
43
+ function normalizeContinuityClauses(text) {
44
+ return text
45
+ .toLowerCase()
46
+ .split(/[\n.!?;]+/)
47
+ .map((clause) => clause.replace(/[^a-z\s]/g, "").replace(/\s+/g, " ").trim())
48
+ .filter(Boolean);
49
+ }
50
+ function resolveMustResolveBeforeHandoff(initialValue, ingressTexts) {
51
+ let current = initialValue;
52
+ for (const text of ingressTexts ?? []) {
53
+ for (const clause of normalizeContinuityClauses(text)) {
54
+ if (CANCEL_SUPERSEDE_CLAUSES.has(clause)) {
55
+ current = false;
56
+ continue;
57
+ }
58
+ if (NO_HANDOFF_CLAUSES.has(clause)) {
59
+ current = true;
60
+ }
61
+ }
62
+ }
63
+ (0, runtime_1.emitNervesEvent)({
64
+ component: "senses",
65
+ event: "senses.continuity_state_resolved",
66
+ message: "resolved continuity handoff state from ingress text",
67
+ meta: {
68
+ initialValue,
69
+ finalValue: current,
70
+ ingressCount: ingressTexts?.length ?? 0,
71
+ },
72
+ });
73
+ return current;
74
+ }
75
+ function classifySteeringFollowUpEffect(text) {
76
+ const clauses = normalizeContinuityClauses(text);
77
+ let effect = "none";
78
+ if (clauses.some((clause) => CANCEL_SUPERSEDE_CLAUSES.has(clause))) {
79
+ effect = "clear_and_supersede";
80
+ }
81
+ else if (clauses.some((clause) => NO_HANDOFF_CLAUSES.has(clause))) {
82
+ effect = "set_no_handoff";
83
+ }
84
+ (0, runtime_1.emitNervesEvent)({
85
+ component: "senses",
86
+ event: "senses.continuity_follow_up_classified",
87
+ message: "classified steering follow-up continuity effect",
88
+ meta: {
89
+ effect,
90
+ clauseCount: clauses.length,
91
+ },
92
+ });
93
+ return effect;
94
+ }
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createDebugActivityController = createDebugActivityController;
4
+ const format_1 = require("../mind/format");
5
+ const phrases_1 = require("../mind/phrases");
6
+ const runtime_1 = require("../nerves/runtime");
7
+ const progress_story_1 = require("../heart/progress-story");
8
+ function createDebugActivityController(options) {
9
+ let queue = Promise.resolve();
10
+ let statusMessageGuid;
11
+ let typingActive = false;
12
+ let hadToolRun = false;
13
+ let followupShown = false;
14
+ let lastPhrase = "";
15
+ function reportTransportError(operation, error) {
16
+ (0, runtime_1.emitNervesEvent)({
17
+ level: "warn",
18
+ component: "senses",
19
+ event: "senses.debug_activity_transport_error",
20
+ message: "debug activity transport failed",
21
+ meta: {
22
+ operation,
23
+ reason: error instanceof Error ? error.message : String(error),
24
+ },
25
+ });
26
+ options.onTransportError?.(operation, error);
27
+ }
28
+ function enqueue(operation, task) {
29
+ queue = queue
30
+ .then(task)
31
+ .catch((error) => {
32
+ reportTransportError(operation, error);
33
+ });
34
+ }
35
+ function nextPhrase(pool) {
36
+ const phrase = (0, phrases_1.pickPhrase)(pool, lastPhrase);
37
+ lastPhrase = phrase;
38
+ return phrase;
39
+ }
40
+ function startTypingNow() {
41
+ if (typingActive) {
42
+ return;
43
+ }
44
+ typingActive = true;
45
+ enqueue("typing_start", async () => {
46
+ await options.transport.setTyping(true);
47
+ });
48
+ }
49
+ function setStatus(text) {
50
+ (0, runtime_1.emitNervesEvent)({
51
+ component: "senses",
52
+ event: "senses.debug_activity_update",
53
+ message: "debug activity status updated",
54
+ meta: {
55
+ hasStatusGuid: Boolean(statusMessageGuid),
56
+ textLength: text.length,
57
+ },
58
+ });
59
+ const shouldStartTyping = !typingActive;
60
+ if (shouldStartTyping) {
61
+ typingActive = true;
62
+ }
63
+ enqueue("status_update", async () => {
64
+ if (statusMessageGuid) {
65
+ await options.transport.editStatus(statusMessageGuid, text);
66
+ }
67
+ else {
68
+ statusMessageGuid = await options.transport.sendStatus(text);
69
+ }
70
+ if (shouldStartTyping) {
71
+ await options.transport.setTyping(true);
72
+ }
73
+ });
74
+ }
75
+ return {
76
+ onModelStart() {
77
+ const pool = hadToolRun ? options.followupPhrases : options.thinkingPhrases;
78
+ if (options.startTypingOnModelStart) {
79
+ startTypingNow();
80
+ }
81
+ if (options.suppressInitialModelStatus && !statusMessageGuid && !hadToolRun) {
82
+ nextPhrase(pool);
83
+ return;
84
+ }
85
+ setStatus((0, progress_story_1.renderProgressStory)((0, progress_story_1.buildProgressStory)({
86
+ scope: "shared-work",
87
+ phase: "processing",
88
+ objective: `${nextPhrase(pool)}...`,
89
+ })));
90
+ },
91
+ onToolStart(name, args) {
92
+ hadToolRun = true;
93
+ followupShown = false;
94
+ const argSummary = Object.values(args).join(", ");
95
+ const detail = argSummary ? ` (${argSummary})` : "";
96
+ setStatus((0, progress_story_1.renderProgressStory)((0, progress_story_1.buildProgressStory)({
97
+ scope: "shared-work",
98
+ phase: "processing",
99
+ objective: `running ${name}${detail}...`,
100
+ })));
101
+ },
102
+ onToolEnd(name, summary, success) {
103
+ hadToolRun = true;
104
+ followupShown = false;
105
+ setStatus((0, progress_story_1.renderProgressStory)((0, progress_story_1.buildProgressStory)({
106
+ scope: "shared-work",
107
+ phase: "processing",
108
+ objective: (0, format_1.formatToolResult)(name, summary, success),
109
+ })));
110
+ },
111
+ onTextChunk(text) {
112
+ if (!text) {
113
+ return;
114
+ }
115
+ if (!hadToolRun && options.startTypingOnFirstTextChunk) {
116
+ startTypingNow();
117
+ }
118
+ if (!hadToolRun || followupShown) {
119
+ return;
120
+ }
121
+ followupShown = true;
122
+ if (options.suppressFollowupPhraseStatus) {
123
+ return;
124
+ }
125
+ setStatus((0, progress_story_1.renderProgressStory)((0, progress_story_1.buildProgressStory)({
126
+ scope: "shared-work",
127
+ phase: "processing",
128
+ objective: `${nextPhrase(options.followupPhrases)}...`,
129
+ })));
130
+ },
131
+ onError(error) {
132
+ setStatus((0, progress_story_1.renderProgressStory)((0, progress_story_1.buildProgressStory)({
133
+ scope: "shared-work",
134
+ phase: "errored",
135
+ outcomeText: (0, format_1.formatError)(error),
136
+ })));
137
+ this.finish();
138
+ },
139
+ async drain() {
140
+ await queue;
141
+ },
142
+ async finish() {
143
+ if (!typingActive) {
144
+ await queue;
145
+ return;
146
+ }
147
+ typingActive = false;
148
+ enqueue("typing_stop", async () => {
149
+ await options.transport.setTyping(false);
150
+ });
151
+ await queue;
152
+ },
153
+ };
154
+ }
@@ -4,26 +4,52 @@ exports.createInnerDialogWorker = createInnerDialogWorker;
4
4
  exports.startInnerDialogWorker = startInnerDialogWorker;
5
5
  const inner_dialog_1 = require("./inner-dialog");
6
6
  const runtime_1 = require("../nerves/runtime");
7
- function createInnerDialogWorker(runTurn = (options) => (0, inner_dialog_1.runInnerDialogTurn)(options)) {
7
+ const identity_1 = require("../heart/identity");
8
+ const pending_1 = require("../mind/pending");
9
+ function createInnerDialogWorker(runTurn = (options) => (0, inner_dialog_1.runInnerDialogTurn)(options), hasPendingWork = () => (0, pending_1.hasPendingMessages)((0, pending_1.getInnerDialogPendingDir)((0, identity_1.getAgentName)()))) {
8
10
  let running = false;
9
- async function run(reason) {
10
- if (running)
11
+ let rerunRequested = false;
12
+ let rerunReason = "instinct";
13
+ let rerunTaskId;
14
+ async function run(reason, taskId) {
15
+ if (running) {
16
+ rerunRequested = true;
17
+ rerunReason = reason;
18
+ if (taskId !== undefined) {
19
+ rerunTaskId = taskId;
20
+ }
11
21
  return;
22
+ }
12
23
  running = true;
13
24
  try {
14
- await runTurn({ reason });
15
- }
16
- catch (error) {
17
- (0, runtime_1.emitNervesEvent)({
18
- level: "error",
19
- component: "senses",
20
- event: "senses.inner_dialog_worker_error",
21
- message: "inner dialog worker turn failed",
22
- meta: {
23
- reason,
24
- error: error instanceof Error ? error.message : String(error),
25
- },
26
- });
25
+ let nextReason = reason;
26
+ let nextTaskId = taskId;
27
+ do {
28
+ rerunRequested = false;
29
+ try {
30
+ await runTurn({ reason: nextReason, taskId: nextTaskId });
31
+ }
32
+ catch (error) {
33
+ (0, runtime_1.emitNervesEvent)({
34
+ level: "error",
35
+ component: "senses",
36
+ event: "senses.inner_dialog_worker_error",
37
+ message: "inner dialog worker turn failed",
38
+ meta: {
39
+ reason: nextReason,
40
+ error: error instanceof Error ? error.message : String(error),
41
+ },
42
+ });
43
+ }
44
+ if (!rerunRequested && hasPendingWork()) {
45
+ rerunRequested = true;
46
+ rerunReason = "instinct";
47
+ }
48
+ nextReason = rerunReason;
49
+ nextTaskId = rerunTaskId;
50
+ rerunReason = "instinct";
51
+ rerunTaskId = undefined;
52
+ } while (rerunRequested);
27
53
  }
28
54
  finally {
29
55
  running = false;
@@ -37,8 +63,11 @@ function createInnerDialogWorker(runTurn = (options) => (0, inner_dialog_1.runIn
37
63
  await run("heartbeat");
38
64
  return;
39
65
  }
40
- if (maybeMessage.type === "poke" ||
41
- maybeMessage.type === "chat" ||
66
+ if (maybeMessage.type === "poke") {
67
+ await run("instinct", maybeMessage.taskId);
68
+ return;
69
+ }
70
+ if (maybeMessage.type === "chat" ||
42
71
  maybeMessage.type === "message") {
43
72
  await run("instinct");
44
73
  return;