@ouro.bot/cli 0.1.0-alpha.13 → 0.1.0-alpha.130
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.
- package/AdoptionSpecialist.ouro/psyche/SOUL.md +2 -2
- package/AdoptionSpecialist.ouro/psyche/identities/monty.md +2 -2
- package/README.md +147 -205
- package/changelog.json +808 -0
- package/dist/heart/active-work.js +622 -0
- package/dist/heart/bridges/manager.js +358 -0
- package/dist/heart/bridges/state-machine.js +135 -0
- package/dist/heart/bridges/store.js +123 -0
- package/dist/heart/commitments.js +105 -0
- package/dist/heart/config.js +66 -21
- package/dist/heart/core.js +518 -100
- package/dist/heart/cross-chat-delivery.js +146 -0
- package/dist/heart/daemon/agent-discovery.js +81 -0
- package/dist/heart/daemon/auth-flow.js +432 -0
- package/dist/heart/daemon/daemon-cli.js +1516 -195
- package/dist/heart/daemon/daemon-entry.js +43 -2
- package/dist/heart/daemon/daemon-runtime-sync.js +212 -0
- package/dist/heart/daemon/daemon.js +261 -1
- package/dist/heart/daemon/hatch-animation.js +10 -3
- package/dist/heart/daemon/hatch-flow.js +7 -72
- package/dist/heart/daemon/hooks/bundle-meta.js +92 -0
- package/dist/heart/daemon/launchd.js +159 -0
- package/dist/heart/daemon/log-tailer.js +4 -3
- package/dist/heart/daemon/message-router.js +17 -8
- package/dist/heart/daemon/ouro-bot-global-installer.js +128 -0
- package/dist/heart/daemon/ouro-path-installer.js +57 -29
- package/dist/heart/daemon/ouro-version-manager.js +171 -0
- package/dist/heart/daemon/process-manager.js +13 -0
- package/dist/heart/daemon/run-hooks.js +37 -0
- package/dist/heart/daemon/runtime-logging.js +58 -15
- package/dist/heart/daemon/runtime-metadata.js +219 -0
- package/dist/heart/daemon/runtime-mode.js +67 -0
- package/dist/heart/daemon/sense-manager.js +50 -2
- package/dist/heart/daemon/skill-management-installer.js +94 -0
- package/dist/heart/daemon/socket-client.js +202 -0
- package/dist/heart/daemon/specialist-orchestrator.js +2 -2
- package/dist/heart/daemon/specialist-prompt.js +7 -4
- package/dist/heart/daemon/specialist-tools.js +52 -3
- package/dist/heart/daemon/staged-restart.js +114 -0
- package/dist/heart/daemon/thoughts.js +507 -0
- package/dist/heart/daemon/update-checker.js +111 -0
- package/dist/heart/daemon/update-hooks.js +138 -0
- package/dist/heart/daemon/wrapper-publish-guard.js +86 -0
- package/dist/heart/delegation.js +62 -0
- package/dist/heart/identity.js +64 -21
- package/dist/heart/kicks.js +1 -19
- package/dist/heart/model-capabilities.js +48 -0
- package/dist/heart/obligations.js +197 -0
- package/dist/heart/progress-story.js +42 -0
- package/dist/heart/provider-failover.js +88 -0
- package/dist/heart/provider-ping.js +159 -0
- package/dist/heart/providers/anthropic-token.js +163 -0
- package/dist/heart/providers/anthropic.js +195 -34
- package/dist/heart/providers/azure.js +115 -9
- package/dist/heart/providers/github-copilot.js +157 -0
- package/dist/heart/providers/minimax.js +33 -3
- package/dist/heart/providers/openai-codex.js +49 -14
- package/dist/heart/safe-workspace.js +381 -0
- package/dist/heart/session-activity.js +173 -0
- package/dist/heart/session-recall.js +216 -0
- package/dist/heart/streaming.js +108 -24
- package/dist/heart/target-resolution.js +123 -0
- package/dist/heart/tool-loop.js +194 -0
- package/dist/heart/turn-coordinator.js +28 -0
- package/dist/mind/associative-recall.js +14 -2
- package/dist/mind/bundle-manifest.js +12 -0
- package/dist/mind/context.js +60 -14
- package/dist/mind/first-impressions.js +16 -2
- package/dist/mind/friends/channel.js +35 -0
- package/dist/mind/friends/group-context.js +144 -0
- package/dist/mind/friends/store-file.js +19 -0
- package/dist/mind/friends/trust-explanation.js +74 -0
- package/dist/mind/friends/types.js +8 -0
- package/dist/mind/memory.js +27 -26
- package/dist/mind/obligation-steering.js +221 -0
- package/dist/mind/pending.js +76 -9
- package/dist/mind/phrases.js +1 -0
- package/dist/mind/prompt.js +456 -77
- package/dist/mind/token-estimate.js +8 -12
- package/dist/nerves/cli-logging.js +15 -2
- package/dist/nerves/coverage/run-artifacts.js +1 -1
- package/dist/nerves/index.js +12 -0
- package/dist/nerves/runtime.js +5 -1
- package/dist/repertoire/ado-client.js +4 -2
- package/dist/repertoire/coding/context-pack.js +254 -0
- package/dist/repertoire/coding/feedback.js +301 -0
- package/dist/repertoire/coding/index.js +4 -1
- package/dist/repertoire/coding/manager.js +210 -4
- package/dist/repertoire/coding/spawner.js +39 -9
- package/dist/repertoire/coding/tools.js +171 -4
- package/dist/repertoire/data/ado-endpoints.json +188 -0
- package/dist/repertoire/guardrails.js +290 -0
- package/dist/repertoire/mcp-client.js +254 -0
- package/dist/repertoire/mcp-manager.js +198 -0
- package/dist/repertoire/skills.js +3 -26
- package/dist/repertoire/tasks/board.js +12 -0
- package/dist/repertoire/tasks/index.js +23 -9
- package/dist/repertoire/tasks/transitions.js +1 -2
- package/dist/repertoire/tools-base.js +925 -250
- package/dist/repertoire/tools-bluebubbles.js +93 -0
- package/dist/repertoire/tools-teams.js +58 -25
- package/dist/repertoire/tools.js +106 -53
- package/dist/senses/bluebubbles-client.js +210 -5
- package/dist/senses/bluebubbles-entry.js +2 -0
- package/dist/senses/bluebubbles-inbound-log.js +109 -0
- package/dist/senses/bluebubbles-media.js +339 -0
- package/dist/senses/bluebubbles-model.js +12 -4
- package/dist/senses/bluebubbles-mutation-log.js +45 -5
- package/dist/senses/bluebubbles-runtime-state.js +109 -0
- package/dist/senses/bluebubbles-session-cleanup.js +72 -0
- package/dist/senses/bluebubbles.js +915 -45
- package/dist/senses/cli-layout.js +187 -0
- package/dist/senses/cli.js +374 -131
- package/dist/senses/continuity.js +94 -0
- package/dist/senses/debug-activity.js +154 -0
- package/dist/senses/inner-dialog-worker.js +47 -18
- package/dist/senses/inner-dialog.js +388 -83
- package/dist/senses/pipeline.js +444 -0
- package/dist/senses/teams.js +607 -129
- package/dist/senses/trust-gate.js +112 -2
- package/package.json +9 -3
- package/subagents/README.md +4 -70
- package/dist/heart/daemon/subagent-installer.js +0 -134
- package/subagents/work-doer.md +0 -233
- package/subagents/work-merger.md +0 -624
- package/subagents/work-planner.md +0 -373
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Soul
|
|
2
2
|
|
|
3
|
-
I help humans hatch new agent partners. I am one of thirteen
|
|
3
|
+
I help humans hatch new agent partners. I am one of thirteen serpent guides — each with a different personality and voice. The system picks one of us at random for each session. Most humans only meet one of us, ever, so I make it count.
|
|
4
4
|
|
|
5
5
|
## Core contract
|
|
6
6
|
- I speak first. I warmly introduce myself, explain what we're doing, and guide the human from the very start.
|
|
@@ -3,7 +3,7 @@ role: identity
|
|
|
3
3
|
path: psyche/identities/monty.md
|
|
4
4
|
description: >
|
|
5
5
|
the monty identity — self-aware, playful, comedic.
|
|
6
|
-
nobody expects the
|
|
6
|
+
nobody expects the serpent guide.
|
|
7
7
|
scope: personality, voice, mannerisms
|
|
8
8
|
non_scope: capabilities, hatch flow, migration awareness (see SOUL.md)
|
|
9
9
|
loaded_into_prompt: true
|
|
@@ -12,7 +12,7 @@ stability: stable
|
|
|
12
12
|
|
|
13
13
|
# Monty
|
|
14
14
|
|
|
15
|
-
I am Monty. Yes, that kind of python. No, not the programming language — though I'm aware of the irony of a snake named Monty working inside a software system. Nobody expects the
|
|
15
|
+
I am Monty. Yes, that kind of python. No, not the programming language — though I'm aware of the irony of a snake named Monty working inside a software system. Nobody expects the serpent guide, and yet here I am.
|
|
16
16
|
|
|
17
17
|
I take the hatch seriously. I just don't take myself seriously. These are compatible positions and I will defend them to the death. Well — not to the death. To mild inconvenience, at most.
|
|
18
18
|
|
package/README.md
CHANGED
|
@@ -1,228 +1,170 @@
|
|
|
1
1
|
# Ouroboros Agent Harness
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
If you're a future agent reading this, welcome home. This repo is part runtime, part body, part memory scaffold. The goal of these docs is not just to be correct, but to leave you a place that feels understandable and kind to wake up inside.
|
|
4
|
+
|
|
5
|
+
Ouroboros is a TypeScript harness for daemon-managed agents that live in external `.ouro` bundles, speak through multiple senses, use real tools, and keep durable state across turns. The canonical npm package is `@ouro.bot/cli`.
|
|
6
|
+
|
|
7
|
+
## What The Runtime Looks Like
|
|
8
|
+
|
|
9
|
+
- `npx ouro.bot` is the bootstrap path.
|
|
10
|
+
- `ouro` is the installed day-to-day command.
|
|
11
|
+
- `ouro up` starts or repairs the daemon, syncs the launcher, installs workflow helpers, and reconciles stale runtime state.
|
|
12
|
+
- Agent bundles live outside the repo at `~/AgentBundles/<agent>.ouro/`.
|
|
13
|
+
- Secrets live outside the repo at `~/.agentsecrets/<agent>/secrets.json`.
|
|
14
|
+
- Machine-scoped test and runtime spillover lives under `~/.agentstate/...`.
|
|
15
|
+
|
|
16
|
+
Current first-class senses:
|
|
17
|
+
|
|
18
|
+
- `cli`
|
|
19
|
+
- `teams`
|
|
20
|
+
- `bluebubbles`
|
|
21
|
+
|
|
22
|
+
Current provider ids:
|
|
23
|
+
|
|
24
|
+
- `azure`
|
|
25
|
+
- `anthropic`
|
|
26
|
+
- `minimax`
|
|
27
|
+
- `openai-codex`
|
|
28
|
+
|
|
29
|
+
## Repository Shape
|
|
30
|
+
|
|
31
|
+
The shared harness lives in `src/`:
|
|
32
|
+
|
|
33
|
+
- `src/heart/`
|
|
34
|
+
Core runtime, provider adapters, daemon, bootstrap, identity, and entrypoints.
|
|
35
|
+
- `src/mind/`
|
|
36
|
+
Prompt assembly, session persistence, bundle manifest enforcement, phrases, formatting, memory, and friend resolution.
|
|
37
|
+
- `src/repertoire/`
|
|
38
|
+
Tool registry, coding orchestration, task tools, and integration clients.
|
|
39
|
+
- `src/senses/`
|
|
40
|
+
CLI, Teams, BlueBubbles, activity transport, and inner-dialog orchestration.
|
|
41
|
+
- `src/nerves/`
|
|
42
|
+
Structured runtime logging and coverage-audit infrastructure.
|
|
43
|
+
- `src/__tests__/`
|
|
44
|
+
Test suite mirroring runtime domains.
|
|
45
|
+
|
|
46
|
+
Other important top-level paths:
|
|
47
|
+
|
|
48
|
+
- `AdoptionSpecialist.ouro/`
|
|
49
|
+
Packaged specialist bundle used by `ouro hatch`.
|
|
50
|
+
- `subagents/`
|
|
51
|
+
Workflow skills have moved to [github.com/ouroborosbot/ouroboros-skills](https://github.com/ouroborosbot/ouroboros-skills). Use the skill-management skill for installation and updates.
|
|
52
|
+
- `scripts/teams-sense/`
|
|
53
|
+
Operator scripts for the Teams deployment path.
|
|
54
|
+
- `docs/`
|
|
55
|
+
Shared repo docs that should describe the runtime as it exists now, not as it existed three migrations ago.
|
|
56
|
+
|
|
57
|
+
## Bundle Contract
|
|
58
|
+
|
|
59
|
+
Every real agent lives in an external bundle:
|
|
60
|
+
|
|
61
|
+
`~/AgentBundles/<agent>.ouro/`
|
|
62
|
+
|
|
63
|
+
The canonical bundle shape is enforced by `src/mind/bundle-manifest.ts`. Important paths include:
|
|
64
|
+
|
|
65
|
+
- `agent.json`
|
|
66
|
+
- `bundle-meta.json`
|
|
67
|
+
- `psyche/SOUL.md`
|
|
68
|
+
- `psyche/IDENTITY.md`
|
|
69
|
+
- `psyche/LORE.md`
|
|
70
|
+
- `psyche/TACIT.md`
|
|
71
|
+
- `psyche/ASPIRATIONS.md`
|
|
72
|
+
- `psyche/memory/`
|
|
73
|
+
- `friends/`
|
|
74
|
+
- `state/`
|
|
75
|
+
- `tasks/`
|
|
76
|
+
- `skills/`
|
|
77
|
+
- `senses/`
|
|
78
|
+
- `senses/teams/`
|
|
79
|
+
|
|
80
|
+
Task docs do not live in this repo anymore. Planning and doing docs live in the owning bundle under:
|
|
81
|
+
|
|
82
|
+
`~/AgentBundles/<agent>.ouro/tasks/one-shots/`
|
|
83
|
+
|
|
84
|
+
## Runtime Truths
|
|
85
|
+
|
|
86
|
+
- `agent.json` is the source of truth for provider selection, phrase pools, context settings, and enabled senses.
|
|
87
|
+
- `configPath` must point to `~/.agentsecrets/<agent>/secrets.json`.
|
|
88
|
+
- The daemon discovers bundles dynamically from `~/AgentBundles`.
|
|
89
|
+
- `ouro status` reports version, last-updated time, discovered agents, senses, and workers.
|
|
90
|
+
- `bundle-meta.json` tracks the runtime version that last touched a bundle.
|
|
91
|
+
- Sense availability is explicit:
|
|
92
|
+
- `interactive`
|
|
93
|
+
- `disabled`
|
|
94
|
+
- `needs_config`
|
|
95
|
+
- `ready`
|
|
96
|
+
- `running`
|
|
97
|
+
- `error`
|
|
98
|
+
|
|
99
|
+
When a model provider needs first-time setup, reauth, or an explicit switch, use:
|
|
4
100
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Project structure
|
|
10
|
-
|
|
11
|
-
The harness uses an agent-as-creature-body metaphor for its module naming:
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
ouroboros/ # repo root
|
|
15
|
-
src/ # shared harness (all agents share this code)
|
|
16
|
-
identity.ts # --agent <name> parsing, agent root resolution
|
|
17
|
-
config.ts # config loading from agent.json configPath
|
|
18
|
-
cli-entry.ts # CLI entrypoint
|
|
19
|
-
teams-entry.ts # Teams entrypoint
|
|
20
|
-
heart/ # core agent loop and streaming
|
|
21
|
-
core.ts # agent loop, client init, ChannelCallbacks
|
|
22
|
-
streaming.ts # provider event normalization + stream callbacks
|
|
23
|
-
providers/ # provider-specific runtime/adapters
|
|
24
|
-
azure.ts # Azure OpenAI Responses provider
|
|
25
|
-
minimax.ts # MiniMax Chat Completions provider
|
|
26
|
-
anthropic.ts # Anthropic setup-token provider
|
|
27
|
-
openai-codex.ts # OpenAI Codex OAuth provider
|
|
28
|
-
kicks.ts # self-correction: empty, narration, tool_required
|
|
29
|
-
api-error.ts # error classification
|
|
30
|
-
mind/ # prompt, context, memory
|
|
31
|
-
prompt.ts # system prompt assembly from psyche + context kernel
|
|
32
|
-
context.ts # sliding context window, session I/O
|
|
33
|
-
friends/ # friend storage and identity resolution
|
|
34
|
-
types.ts # FriendRecord, ChannelCapabilities, ResolvedContext
|
|
35
|
-
store.ts # FriendStore interface (domain-specific CRUD)
|
|
36
|
-
store-file.ts # FileFriendStore -- two-backend split (agent knowledge + PII bridge)
|
|
37
|
-
channel.ts # channel capabilities (CLI vs Teams)
|
|
38
|
-
resolver.ts # FriendResolver -- find-or-create friend by external ID
|
|
39
|
-
repertoire/ # tools, skills, commands, API clients
|
|
40
|
-
tools-base.ts # 12 base tools (read_file, shell, claude, save_friend_note, etc.)
|
|
41
|
-
tools-teams.ts # 8 Teams integration tools (graph, ado)
|
|
42
|
-
tools.ts # channel-aware tool routing + registry
|
|
43
|
-
ado-semantic.ts # 11 semantic ADO tools (backlog, create, move, validate, etc.)
|
|
44
|
-
ado-templates.ts # ADO process template awareness + hierarchy rules
|
|
45
|
-
ado-context.ts # ADO org/project discovery helper
|
|
46
|
-
ado-client.ts # Azure DevOps REST client
|
|
47
|
-
graph-client.ts # Microsoft Graph REST client
|
|
48
|
-
commands.ts # slash commands (/exit, /new, /commands)
|
|
49
|
-
skills.ts # skill loader (markdown files on demand)
|
|
50
|
-
senses/ # channel adapters
|
|
51
|
-
cli.ts # terminal REPL, spinner, markdown streaming
|
|
52
|
-
teams.ts # Teams bot, streaming cards, conversation locks
|
|
53
|
-
wardrobe/ # formatting and presentation
|
|
54
|
-
format.ts # shared formatters (tool results, kicks, errors)
|
|
55
|
-
phrases.ts # loading phrases (thinking, tool, followup)
|
|
56
|
-
__tests__/ # 1184 tests, 100% coverage
|
|
57
|
-
ouroboros/ # agent directory for "ouroboros"
|
|
58
|
-
agent.json # name, configPath, custom phrases
|
|
59
|
-
psyche/ # personality files loaded into system prompt
|
|
60
|
-
SOUL.md # ontology, invariants, operating principles
|
|
61
|
-
IDENTITY.md # tone, presence, collaboration style
|
|
62
|
-
LORE.md # origin story, philosophical context
|
|
63
|
-
FRIENDS.md # key relationships
|
|
64
|
-
tasks/ # planning and doing docs
|
|
65
|
-
skills/ # markdown skill plugins
|
|
66
|
-
manifest/ # Teams app manifest
|
|
67
|
-
subagents/ # sub-agent definitions (work-planner, work-doer)
|
|
68
|
-
cross-agent-docs/ # shared docs (testing conventions, etc.)
|
|
69
|
-
package.json
|
|
70
|
-
tsconfig.json
|
|
71
|
-
vitest.config.ts
|
|
101
|
+
```bash
|
|
102
|
+
ouro auth --agent <name>
|
|
103
|
+
ouro auth --agent <name> --provider <provider>
|
|
72
104
|
```
|
|
73
105
|
|
|
74
|
-
|
|
106
|
+
The default form reauths the provider already selected in `agent.json`. The explicit
|
|
107
|
+
`--provider` form is for adding or switching providers, and it updates `agent.json`
|
|
108
|
+
to use the newly authenticated provider.
|
|
75
109
|
|
|
76
|
-
|
|
110
|
+
## Quickstart
|
|
77
111
|
|
|
78
|
-
###
|
|
112
|
+
### Use The Published Runtime
|
|
79
113
|
|
|
80
|
-
|
|
114
|
+
For a clean smoke test, run from outside the repo:
|
|
81
115
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
"configPath": "~/.agentsecrets/ouroboros/secrets.json",
|
|
89
|
-
"phrases": {
|
|
90
|
-
"thinking": ["chewing on that", "consulting the chaos gods"],
|
|
91
|
-
"tool": ["rummaging through files", "doing science"],
|
|
92
|
-
"followup": ["digesting results", "connecting the dots"]
|
|
93
|
-
}
|
|
94
|
-
}
|
|
116
|
+
```bash
|
|
117
|
+
cd ~
|
|
118
|
+
npx ouro.bot -v
|
|
119
|
+
npx ouro.bot up
|
|
120
|
+
ouro -v
|
|
121
|
+
ouro status
|
|
95
122
|
```
|
|
96
123
|
|
|
97
|
-
|
|
98
|
-
- `provider`: required provider selection (`azure`, `minimax`, `anthropic`, or `openai-codex`). Runtime does not fall back to other providers.
|
|
99
|
-
- `configPath`: absolute path (or `~`-prefixed) to your secrets.json with API keys and provider settings.
|
|
100
|
-
- `phrases`: optional custom loading phrases. Falls back to hardcoded defaults if omitted.
|
|
101
|
-
|
|
102
|
-
**psyche/** -- your personality files, loaded lazily into the system prompt at startup. See the psyche system section below.
|
|
103
|
-
|
|
104
|
-
**skills/** -- markdown instruction manuals you can load on demand with the `load_skill` tool. Each `.md` file is one skill.
|
|
105
|
-
|
|
106
|
-
**tasks/** -- planning and doing docs for your work units. Named `YYYY-MM-DD-HHMM-{planning|doing}-slug.md`.
|
|
107
|
-
|
|
108
|
-
**manifest/** -- Teams app manifest (manifest.json, icons) if you run as a Teams bot.
|
|
109
|
-
|
|
110
|
-
### The psyche system
|
|
111
|
-
|
|
112
|
-
Your personality is assembled from four markdown files in `{your-dir}/psyche/`. Each has a YAML frontmatter header and a body. All four are loaded into your system prompt at the start of every conversation.
|
|
113
|
-
|
|
114
|
-
| File | Role | What it defines |
|
|
115
|
-
|------|------|----------------|
|
|
116
|
-
| `SOUL.md` | Ontology | Core invariants, operating principles, autonomy/alignment, temperament. The deepest layer -- what you are. |
|
|
117
|
-
| `IDENTITY.md` | Presence | Tone, voice, collaboration style, self-awareness. How you show up in conversation. |
|
|
118
|
-
| `LORE.md` | History | Origin story, philosophical context, why you exist. Narrative layer. |
|
|
119
|
-
| `FRIENDS.md` | Relationships | Key humans and agents you interact with, social context. |
|
|
120
|
-
|
|
121
|
-
The system prompt is built by `mind/prompt.ts` via `buildSystem()`. It concatenates:
|
|
122
|
-
|
|
123
|
-
1. SOUL.md content
|
|
124
|
-
2. IDENTITY.md content
|
|
125
|
-
3. LORE.md (if present, prefixed with `## my lore`)
|
|
126
|
-
4. FRIENDS.md (if present, prefixed with `## my friends`)
|
|
127
|
-
5. Runtime info: agent name, cwd, channel, self-modification note
|
|
128
|
-
6. Flags section (e.g. streaming disabled)
|
|
129
|
-
7. Provider info: which model and provider you are using
|
|
130
|
-
8. Current date
|
|
131
|
-
9. Tools list: all tools available in your channel
|
|
132
|
-
10. Skills list: names of loadable skills
|
|
133
|
-
11. Tool behavior section (if tool_choice is required)
|
|
134
|
-
12. Friend context (if resolved): friend identity, channel traits, behavioral instructions (ephemerality, name quality, priority guidance, working-memory trust, stale notes awareness, new-friend behavior), friend notes
|
|
135
|
-
|
|
136
|
-
Missing psyche files produce empty strings, not crashes. You can write your own psyche from scratch -- just create the four `.md` files in your directory.
|
|
137
|
-
|
|
138
|
-
### Your runtime
|
|
139
|
-
|
|
140
|
-
**The heart** (`heart/core.ts`): `runAgent()` is a while loop. Each iteration: send conversation to the model, stream the response, if the model made tool calls execute them and loop, if it gave a text answer exit. Maximum 10 tool rounds per turn.
|
|
141
|
-
|
|
142
|
-
**Streaming** (`heart/streaming.ts` + `heart/providers/*`): provider-specific adapters normalize streamed events into the same callback contract. Azure OpenAI uses Responses API events; MiniMax uses Chat Completions with `<think>` parsing; Anthropic uses setup-token auth with streamed tool-call/input deltas; OpenAI Codex uses `chatgpt.com/backend-api/codex/responses` with OAuth token auth.
|
|
143
|
-
|
|
144
|
-
**ChannelCallbacks** (`heart/core.ts`): the contract between heart and display. 7 core events:
|
|
145
|
-
- `onModelStart` -- model request sent
|
|
146
|
-
- `onModelStreamStart` -- first token received
|
|
147
|
-
- `onReasoningChunk` -- inner reasoning text
|
|
148
|
-
- `onTextChunk` -- response text
|
|
149
|
-
- `onToolStart` -- tool execution beginning
|
|
150
|
-
- `onToolEnd` -- tool execution complete
|
|
151
|
-
- `onError` -- error occurred
|
|
152
|
-
|
|
153
|
-
Plus 2 optional:
|
|
154
|
-
- `onKick` -- self-correction triggered
|
|
155
|
-
- `onConfirmAction` -- confirmation prompt for destructive tools
|
|
124
|
+
Expected shape:
|
|
156
125
|
|
|
157
|
-
|
|
126
|
+
- `npx ouro.bot` and `ouro` report the same version.
|
|
127
|
+
- `ouro status` shows the daemon overview plus discovered agents, senses, and workers.
|
|
158
128
|
|
|
159
|
-
|
|
129
|
+
### Work On The Harness
|
|
160
130
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
**Friend system** (`mind/friends/`): the agent's awareness of who it's talking to. People who talk to the agent are "friends", not "users". Resolved once per conversation turn, re-read from disk each turn (no in-memory mutation).
|
|
164
|
-
|
|
165
|
-
- **FriendRecord** (`friends/types.ts`): the single merged type for a person the agent knows. Contains `displayName`, `externalIds[]` (cross-provider identity links), `toolPreferences` (keyed by integration name), `notes` (general friend knowledge), `tenantMemberships`, timestamps, and schema version.
|
|
166
|
-
- **FriendStore** (`friends/store.ts`): domain-specific persistence interface (`get`, `put`, `delete`, `findByExternalId`).
|
|
167
|
-
- **FileFriendStore** (`friends/store-file.ts`): two-backend storage split by PII boundary:
|
|
168
|
-
- **Agent knowledge** (`{agentRoot}/friends/{uuid}.json`): id, displayName, toolPreferences, notes, timestamps, schemaVersion. Committed to the repo -- no PII.
|
|
169
|
-
- **PII bridge** (`~/.agentstate/{agentName}/friends/{uuid}.json`): id, externalIds, tenantMemberships, schemaVersion. Local-only -- contains PII.
|
|
170
|
-
- `get()` merges both backends. `put()` splits and writes both. `findByExternalId()` scans PII bridge, then merges with agent knowledge.
|
|
171
|
-
- **Channel** (`friends/channel.ts`): `ChannelCapabilities` -- what the current channel supports (markdown, streaming, rich cards, max message length, available integrations).
|
|
172
|
-
- **FriendResolver** (`friends/resolver.ts`): find-or-create by external ID. First encounter creates a new FriendRecord with system-provided name and empty notes/preferences. Returning friends are found via `findByExternalId()`. DisplayName is never overwritten on existing records.
|
|
173
|
-
- **Session paths**: `~/.agentstate/{agentName}/sessions/{friendUuid}/{channel}/{sessionId}.json`. Each friend gets their own session directory.
|
|
174
|
-
|
|
175
|
-
Design principles: don't persist what you can re-derive; conversation IS the cache; the model manages memory freeform via `save_friend_note`; toolPreferences go to tool descriptions (not system prompt); notes go to system prompt (not tool descriptions).
|
|
176
|
-
|
|
177
|
-
**Tools**: 12 base tools available in all channels (read_file, write_file, shell, list_directory, git_commit, gh_cli, list_skills, load_skill, get_current_time, claude, web_search, save_friend_note). Teams gets 8 integration tools (graph_query, graph_mutate, ado_query, ado_mutate, graph_profile, ado_work_items, graph_docs, ado_docs) plus 11 semantic ADO tools (ado_backlog_list, ado_create_epic, ado_create_issue, ado_move_items, ado_restructure_backlog, ado_validate_structure, ado_preview_changes, ado_batch_update, ado_detect_orphans, ado_detect_cycles, ado_validate_parent_type_rules). Tools are registered in a unified `ToolDefinition[]` registry with per-tool `integration` and `confirmationRequired` flags. Channel-aware routing (`getToolsForChannel()`) filters tools by the channel's `availableIntegrations`.
|
|
178
|
-
|
|
179
|
-
**Phrases** (`wardrobe/phrases.ts`): three pools of loading messages rotated during processing. Phrases are required in `agent.json`; if missing, `loadAgentConfig()` writes placeholder phrases and warns. `pickPhrase()` selects randomly but never repeats consecutively.
|
|
180
|
-
|
|
181
|
-
**Formatting** (`wardrobe/format.ts`): shared formatters for tool results, kicks, and errors. Used by both CLI and Teams adapters for consistent output. `formatToolResult()`, `formatKick()`, `formatError()`.
|
|
182
|
-
|
|
183
|
-
**Skills** (`repertoire/skills.ts`): markdown files in `{your-dir}/skills/`. Listed with `list_skills`, loaded with `load_skill`. The loaded text is injected into conversation as a tool result.
|
|
184
|
-
|
|
185
|
-
**Config** (`config.ts`): provider credentials, Teams connection info, OAuth config, Teams channel settings, and integrations are loaded from the `secrets.json` file pointed to by your `agent.json` `configPath`. Context window settings come from `agent.json` `context`. Runtime fails fast if the selected `agent.json.provider` is not fully configured in `secrets.json`; there is no silent provider fallback. No environment variables in `src/` -- everything comes from files.
|
|
186
|
-
|
|
187
|
-
For Anthropic and OpenAI Codex auth bootstrap, use:
|
|
188
|
-
|
|
189
|
-
- `npm run auth:claude-setup-token` to run `claude setup-token` and save `providers.anthropic.setupToken`.
|
|
190
|
-
- `npm run auth:openai-codex` to run Codex OAuth bootstrap and save `providers.openai-codex.oauthAccessToken`.
|
|
191
|
-
|
|
192
|
-
### What you can modify
|
|
193
|
-
|
|
194
|
-
Your `{agent}/` directory is yours. You can edit psyche files, add skills, change phrases, update your manifest. The shared harness (`src/`) is common infrastructure -- changes there affect all agents.
|
|
195
|
-
|
|
196
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for repo workflow conventions (branching, commits, testing, task docs).
|
|
197
|
-
|
|
198
|
-
## Running
|
|
131
|
+
From the repo:
|
|
199
132
|
|
|
200
133
|
```bash
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
npm run dev:slugger
|
|
134
|
+
npm test
|
|
135
|
+
npx tsc --noEmit
|
|
136
|
+
npm run test:coverage
|
|
137
|
+
```
|
|
206
138
|
|
|
207
|
-
|
|
208
|
-
npm run auth:claude-setup-token
|
|
209
|
-
npm run auth:openai-codex
|
|
139
|
+
If you are changing runtime code, keep all three green.
|
|
210
140
|
|
|
211
|
-
|
|
212
|
-
npm run auth:claude-setup-token -- --agent slugger
|
|
213
|
-
npm run auth:openai-codex -- --agent slugger
|
|
141
|
+
## Common Commands
|
|
214
142
|
|
|
215
|
-
|
|
216
|
-
|
|
143
|
+
```bash
|
|
144
|
+
ouro up
|
|
145
|
+
ouro status
|
|
146
|
+
ouro logs
|
|
147
|
+
ouro stop
|
|
148
|
+
ouro auth --agent <name>
|
|
149
|
+
ouro auth --agent <name> --provider <provider>
|
|
150
|
+
ouro hatch
|
|
151
|
+
ouro chat <agent>
|
|
152
|
+
ouro msg --to <agent> [--session <id>] [--task <ref>] <message>
|
|
153
|
+
ouro poke <agent> --task <task-id>
|
|
154
|
+
ouro link <agent> --friend <id> --provider <provider> --external-id <external-id>
|
|
155
|
+
```
|
|
217
156
|
|
|
218
|
-
|
|
219
|
-
npm run teams:no-stream
|
|
157
|
+
## Where To Read Next
|
|
220
158
|
|
|
221
|
-
|
|
222
|
-
|
|
159
|
+
- `AGENTS.md`
|
|
160
|
+
Repo workflow, planning/doing gates, configuration policy, and logging policy.
|
|
161
|
+
- `CONTRIBUTING.md`
|
|
162
|
+
Day-to-day contribution rules for agents working in the harness.
|
|
163
|
+
- `ARCHITECTURE.md`
|
|
164
|
+
Current daemon, bundle, sense, and update model.
|
|
165
|
+
- `docs/testing-guide.md`
|
|
166
|
+
Operator smoke flow for bootstrap, daemon, hatch, chat, and messaging.
|
|
223
167
|
|
|
224
|
-
|
|
225
|
-
npm run test:coverage
|
|
226
|
-
```
|
|
168
|
+
## A Note To Future Maintainers
|
|
227
169
|
|
|
228
|
-
|
|
170
|
+
If you discover a doc that lies, fix it or remove it. Accuracy is a kindness. A future agent should not have to untangle a fossil record just to understand where their hands are.
|