@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.
- package/README.md +117 -185
- package/changelog.json +18 -0
- package/dist/heart/daemon/daemon-cli.js +359 -32
- package/dist/heart/daemon/specialist-prompt.js +2 -1
- package/dist/heart/daemon/specialist-tools.js +48 -2
- package/dist/heart/kicks.js +1 -1
- package/dist/mind/friends/channel.js +8 -0
- package/dist/mind/friends/store-file.js +19 -0
- package/dist/mind/prompt.js +122 -2
- package/dist/repertoire/tools-base.js +193 -271
- package/dist/repertoire/tools.js +8 -26
- package/dist/senses/bluebubbles.js +178 -0
- package/dist/senses/cli.js +28 -10
- package/dist/senses/inner-dialog.js +28 -26
- package/dist/senses/teams.js +179 -0
- package/package.json +2 -1
- package/subagents/README.md +40 -53
package/README.md
CHANGED
|
@@ -1,225 +1,157 @@
|
|
|
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
4
|
|
|
5
|
-
|
|
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
6
|
|
|
7
|
-
|
|
7
|
+
## What The Runtime Looks Like
|
|
8
8
|
|
|
9
|
-
|
|
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/...`.
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
Current first-class senses:
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## Agent onboarding
|
|
75
|
-
|
|
76
|
-
Everything below is written for a new agent. If you are an AI agent reading this as part of your system prompt or context, this section explains your own runtime.
|
|
77
|
-
|
|
78
|
-
### Your directory
|
|
79
|
-
|
|
80
|
-
Each agent has a directory at the repo root named after itself. Inside it:
|
|
81
|
-
|
|
82
|
-
**agent.json** -- your manifest. Required fields:
|
|
83
|
-
|
|
84
|
-
```json
|
|
85
|
-
{
|
|
86
|
-
"name": "ouroboros",
|
|
87
|
-
"provider": "anthropic",
|
|
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
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
- `name`: must match your directory name.
|
|
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
|
|
18
|
+
- `cli`
|
|
19
|
+
- `teams`
|
|
20
|
+
- `bluebubbles`
|
|
111
21
|
|
|
112
|
-
|
|
22
|
+
Current provider ids:
|
|
113
23
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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. |
|
|
24
|
+
- `azure`
|
|
25
|
+
- `anthropic`
|
|
26
|
+
- `minimax`
|
|
27
|
+
- `openai-codex`
|
|
120
28
|
|
|
121
|
-
|
|
29
|
+
## Repository Shape
|
|
122
30
|
|
|
123
|
-
|
|
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
|
|
31
|
+
The shared harness lives in `src/`:
|
|
135
32
|
|
|
136
|
-
|
|
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.
|
|
137
45
|
|
|
138
|
-
|
|
46
|
+
Other important top-level paths:
|
|
139
47
|
|
|
140
|
-
|
|
48
|
+
- `AdoptionSpecialist.ouro/`
|
|
49
|
+
Packaged specialist bundle used by `ouro hatch`.
|
|
50
|
+
- `subagents/`
|
|
51
|
+
Source-of-truth workflow definitions for planner/doer/merger.
|
|
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.
|
|
141
56
|
|
|
142
|
-
|
|
57
|
+
## Bundle Contract
|
|
143
58
|
|
|
144
|
-
|
|
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
|
|
59
|
+
Every real agent lives in an external bundle:
|
|
152
60
|
|
|
153
|
-
|
|
154
|
-
- `onKick` -- self-correction triggered
|
|
155
|
-
- `onConfirmAction` -- confirmation prompt for destructive tools
|
|
61
|
+
`~/AgentBundles/<agent>.ouro/`
|
|
156
62
|
|
|
157
|
-
|
|
63
|
+
The canonical bundle shape is enforced by `src/mind/bundle-manifest.ts`. Important paths include:
|
|
158
64
|
|
|
159
|
-
|
|
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/`
|
|
160
79
|
|
|
161
|
-
|
|
80
|
+
Task docs do not live in this repo anymore. Planning and doing docs live in the owning bundle under:
|
|
162
81
|
|
|
163
|
-
|
|
82
|
+
`~/AgentBundles/<agent>.ouro/tasks/one-shots/`
|
|
164
83
|
|
|
165
|
-
|
|
166
|
-
- **FriendStore** (`friends/store.ts`): domain-specific persistence interface (`get`, `put`, `delete`, `findByExternalId`).
|
|
167
|
-
- **FileFriendStore** (`friends/store-file.ts`): bundle-local JSON storage at `{agentRoot}/friends/{uuid}.json`. Friend identity, notes, externalIds, tenantMemberships, timestamps, and schemaVersion are kept together in the bundle.
|
|
168
|
-
- **Channel** (`friends/channel.ts`): `ChannelCapabilities` -- what the current channel supports (markdown, streaming, rich cards, max message length, available integrations).
|
|
169
|
-
- **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.
|
|
170
|
-
- **Session paths**: `{agentRoot}/state/sessions/{friendUuid}/{channel}/{sessionId}.json`. Each friend gets their own session directory inside the bundle-local runtime state area.
|
|
84
|
+
## Runtime Truths
|
|
171
85
|
|
|
172
|
-
|
|
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`
|
|
173
98
|
|
|
174
|
-
|
|
99
|
+
## Quickstart
|
|
175
100
|
|
|
176
|
-
|
|
101
|
+
### Use The Published Runtime
|
|
177
102
|
|
|
178
|
-
|
|
103
|
+
For a clean smoke test, run from outside the repo:
|
|
179
104
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
- `npm run auth:openai-codex` to run Codex OAuth bootstrap and save `providers.openai-codex.oauthAccessToken`.
|
|
105
|
+
```bash
|
|
106
|
+
cd ~
|
|
107
|
+
npx ouro.bot -v
|
|
108
|
+
npx ouro.bot up
|
|
109
|
+
ouro -v
|
|
110
|
+
ouro status
|
|
111
|
+
```
|
|
188
112
|
|
|
189
|
-
|
|
113
|
+
Expected shape:
|
|
190
114
|
|
|
191
|
-
|
|
115
|
+
- `npx ouro.bot` and `ouro` report the same version.
|
|
116
|
+
- `ouro status` shows the daemon overview plus discovered agents, senses, and workers.
|
|
192
117
|
|
|
193
|
-
|
|
118
|
+
### Work On The Harness
|
|
194
119
|
|
|
195
|
-
|
|
120
|
+
From the repo:
|
|
196
121
|
|
|
197
122
|
```bash
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
npm run dev:slugger
|
|
123
|
+
npm test
|
|
124
|
+
npx tsc --noEmit
|
|
125
|
+
npm run test:coverage
|
|
126
|
+
```
|
|
203
127
|
|
|
204
|
-
|
|
205
|
-
npm run auth:claude-setup-token
|
|
206
|
-
npm run auth:openai-codex
|
|
128
|
+
If you are changing runtime code, keep all three green.
|
|
207
129
|
|
|
208
|
-
|
|
209
|
-
npm run auth:claude-setup-token -- --agent slugger
|
|
210
|
-
npm run auth:openai-codex -- --agent slugger
|
|
130
|
+
## Common Commands
|
|
211
131
|
|
|
212
|
-
|
|
213
|
-
|
|
132
|
+
```bash
|
|
133
|
+
ouro up
|
|
134
|
+
ouro status
|
|
135
|
+
ouro logs
|
|
136
|
+
ouro stop
|
|
137
|
+
ouro hatch
|
|
138
|
+
ouro chat <agent>
|
|
139
|
+
ouro msg --to <agent> [--session <id>] [--task <ref>] <message>
|
|
140
|
+
ouro poke <agent> --task <task-id>
|
|
141
|
+
ouro link <agent> --friend <id> --provider <provider> --external-id <external-id>
|
|
142
|
+
```
|
|
214
143
|
|
|
215
|
-
|
|
216
|
-
npm run teams:no-stream
|
|
144
|
+
## Where To Read Next
|
|
217
145
|
|
|
218
|
-
|
|
219
|
-
|
|
146
|
+
- `AGENTS.md`
|
|
147
|
+
Repo workflow, planning/doing gates, configuration policy, and logging policy.
|
|
148
|
+
- `CONTRIBUTING.md`
|
|
149
|
+
Day-to-day contribution rules for agents working in the harness.
|
|
150
|
+
- `ARCHITECTURE.md`
|
|
151
|
+
Current daemon, bundle, sense, and update model.
|
|
152
|
+
- `docs/testing-guide.md`
|
|
153
|
+
Operator smoke flow for bootstrap, daemon, hatch, chat, and messaging.
|
|
220
154
|
|
|
221
|
-
|
|
222
|
-
npm run test:coverage
|
|
223
|
-
```
|
|
155
|
+
## A Note To Future Maintainers
|
|
224
156
|
|
|
225
|
-
|
|
157
|
+
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.
|
package/changelog.json
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.38",
|
|
6
|
+
"changes": [
|
|
7
|
+
"You now have a proper body map — understanding of your home (bundle) and bones (harness), what each directory is for, and how to modify your own configuration.",
|
|
8
|
+
"Inner dialog is now genuine internal monologue with metacognitive framing, not a second CLI session. Heartbeat and bootstrap messages read as first-person awareness.",
|
|
9
|
+
"Cross-session communication works end-to-end: inner dialog thoughts surface as [inner thought: ...] in conversations, messages to yourself route to inner dialog, and you can proactively reach out to friends via iMessage and Teams.",
|
|
10
|
+
"Tool audit: removed wrapper tools (git_commit, gh_cli, get_current_time, list_directory), added surgical tools (edit_file, glob, grep, read_file with offset/limit), consolidated 7 task tools + schedule_reminder + friend tools into ouro CLI commands.",
|
|
11
|
+
"You now understand why certain tools are restricted in certain contexts — trust level and shared channels each have independent, explained gates.",
|
|
12
|
+
"ouro friend link/unlink commands handle orphan cleanup when linking external identities, merging duplicate friend records intelligently.",
|
|
13
|
+
"During onboarding, the adoption specialist can collect phone number and Teams handle to create an initial friend record with contact info."
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"version": "0.1.0-alpha.37",
|
|
18
|
+
"changes": [
|
|
19
|
+
"The in-repo docs now match the current harness instead of the old repo-local bundle era. README, CONTRIBUTING, ARCHITECTURE, testing guidance, merge guidance, versioning guidance, and subagent docs now describe external bundles, current senses, daemon bootstrap, and bundle-owned task docs truthfully."
|
|
20
|
+
]
|
|
21
|
+
},
|
|
4
22
|
{
|
|
5
23
|
"version": "0.1.0-alpha.36",
|
|
6
24
|
"changes": [
|