Repository navigation
feat: discover the owner's existing sources at profile setup - #204
Merged
Merged
Conversation
Adds an owner family (self/yourself/me alias to it) that interviews the agent's own user and writes a short always-on summary between Distilly markers into the host user file (Claude Code ~/.claude/CLAUDE.md, OpenClaw workspace USER.md). The full profile stays at ~/.distilly/owner/profile.md. It is context about the user, not a role-play Skill, so skill_writer refuses the owner family. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y32jGbUW3JKCyeeySUBm27
The owner intake now starts by checking what the host already knows (memory, existing user files, connected tools), then asks only for what is missing, and can read connected calendar, mail, docs, code or user exports read-only with the user's OK. Distilly never asks for keys or OAuth on this path. Profiles record a source per fact, and the summary limit is resolved per host. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y32jGbUW3JKCyeeySUBm27
At owner init the agent now inventories what it can already reach (its own tools, connectors and memory, the platform it runs on, and what tools/owner_sources.py finds on the machine: host user files, configured MCP servers, related skills and personal exports), proposes a read-only slice per source, and asks the owner which to use and what to add. owner_sources.py reports names only, never config values. Includes a recorded end-to-end run in Claude Code with mock connectors and the harness to reproduce it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y32jGbUW3JKCyeeySUBm27
…very # Conflicts: # SKILL.md # prompts/owner/intake.md # prompts/owner/profile_builder.md # tests/test_owner_profile.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Tianyi · project thread
Summary
Before: the owner flow described a fixed set of source types (calendar, mail, docs, code), and the agent had to work out on its own whether it could reach any of them.
After: at setup, the agent first takes stock of what it can already reach:
tools/owner_sources.py discoverfinds on the machine: host user and memory files, configured MCP servers, related skills, and personal exports in~/Downloads.It then proposes one small, read-only slice per source and asks the owner which sources to use and whether to add anything else. Nothing is read until the owner picks it.
Changes
tools/owner_sources.py(new):discoverreports local sources by name only. It never prints commands, args, env values or tokens, and never opens exports.classifymaps any source or tool name to a category hint (mail, calendar, social, docs, code, chat, media, ai_memory) with the slice to read and what it teaches. Health and finance are flagged as sensitive, and unmatched names come back asunknownfor the agent to judge from the tool description.prompts/owner/intake.md: new Step 0 (discover), Step 1 (propose a plan and ask "which ones, anything else?") and Step 2 (read only the approved sources). The interview then asks only what the sources did not answer.prompts/owner/profile_builder.md: source labels are now<category>: <name>.SKILL.md: the owner flow describes discovery instead of a fixed list, in both languages.tests/test_owner_sources.py: 8 unit tests, including one checking that config secrets never appear in the report.tests/e2e/owner_discovery/anddocs/examples/owner-discovery-e2e.md: a harness and a recorded run in a real Claude Code CLI.Motivation
Personal agents already hold the owner's connections and memory, and which ones differ from host to host. Discovering them works across hosts without maintaining a list of every app.
Testing
python -m unittest discover -s tests -p 'test_*.py'passed (109 tests)python -m compileall tools/passednode bin/distilly.mjs --check-packagepassedgmail,google-calendar,xandweatherMCP connectors serving fictional data, plus an X archive in~/Downloads. Seedocs/examples/owner-discovery-e2e.md.weather.CLAUDE.mdline and made a backup.Not covered: real Gmail, Calendar or X connectors, and cloud agents such as Grok Bot or OpenAI Dots. These use the same prompt but were not run here.
Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01Y32jGbUW3JKCyeeySUBm27
Generated by Claude Code