dot-agents 0.5.0 → 0.7.4

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 (112) hide show
  1. package/README.md +239 -122
  2. package/dist/cli/commands/channel.d.ts +19 -0
  3. package/dist/cli/commands/channel.d.ts.map +1 -1
  4. package/dist/cli/commands/channel.js +220 -13
  5. package/dist/cli/commands/channel.js.map +1 -1
  6. package/dist/cli/commands/check.d.ts.map +1 -1
  7. package/dist/cli/commands/check.js +61 -1
  8. package/dist/cli/commands/check.js.map +1 -1
  9. package/dist/cli/commands/index.d.ts +2 -0
  10. package/dist/cli/commands/index.d.ts.map +1 -1
  11. package/dist/cli/commands/index.js +2 -0
  12. package/dist/cli/commands/index.js.map +1 -1
  13. package/dist/cli/commands/personas.d.ts +3 -0
  14. package/dist/cli/commands/personas.d.ts.map +1 -0
  15. package/dist/cli/commands/personas.js +402 -0
  16. package/dist/cli/commands/personas.js.map +1 -0
  17. package/dist/cli/commands/projects.d.ts +3 -0
  18. package/dist/cli/commands/projects.d.ts.map +1 -0
  19. package/dist/cli/commands/projects.js +138 -0
  20. package/dist/cli/commands/projects.js.map +1 -0
  21. package/dist/cli/commands/run.d.ts.map +1 -1
  22. package/dist/cli/commands/run.js +4 -5
  23. package/dist/cli/commands/run.js.map +1 -1
  24. package/dist/cli/index.js +3 -11
  25. package/dist/cli/index.js.map +1 -1
  26. package/dist/cli/lib/runner.d.ts +2 -0
  27. package/dist/cli/lib/runner.d.ts.map +1 -1
  28. package/dist/cli/lib/runner.js +67 -8
  29. package/dist/cli/lib/runner.js.map +1 -1
  30. package/dist/daemon/api/channels.d.ts +6 -0
  31. package/dist/daemon/api/channels.d.ts.map +1 -0
  32. package/dist/daemon/api/channels.js +143 -0
  33. package/dist/daemon/api/channels.js.map +1 -0
  34. package/dist/daemon/api/server.d.ts.map +1 -1
  35. package/dist/daemon/api/server.js +56 -0
  36. package/dist/daemon/api/server.js.map +1 -1
  37. package/dist/daemon/daemon.d.ts +28 -3
  38. package/dist/daemon/daemon.d.ts.map +1 -1
  39. package/dist/daemon/daemon.js +142 -26
  40. package/dist/daemon/daemon.js.map +1 -1
  41. package/dist/daemon/lib/executor.d.ts +0 -4
  42. package/dist/daemon/lib/executor.d.ts.map +1 -1
  43. package/dist/daemon/lib/executor.js +48 -135
  44. package/dist/daemon/lib/executor.js.map +1 -1
  45. package/dist/daemon/lib/index.d.ts +1 -0
  46. package/dist/daemon/lib/index.d.ts.map +1 -1
  47. package/dist/daemon/lib/index.js +1 -0
  48. package/dist/daemon/lib/index.js.map +1 -1
  49. package/dist/daemon/lib/safeguards.d.ts +68 -0
  50. package/dist/daemon/lib/safeguards.d.ts.map +1 -0
  51. package/dist/daemon/lib/safeguards.js +135 -0
  52. package/dist/daemon/lib/safeguards.js.map +1 -0
  53. package/dist/daemon/lib/watcher.d.ts.map +1 -1
  54. package/dist/daemon/lib/watcher.js +48 -8
  55. package/dist/daemon/lib/watcher.js.map +1 -1
  56. package/dist/daemon/web/app.js +433 -0
  57. package/dist/daemon/web/index.html +68 -0
  58. package/dist/daemon/web/styles.css +452 -0
  59. package/dist/lib/channel.d.ts +53 -1
  60. package/dist/lib/channel.d.ts.map +1 -1
  61. package/dist/lib/channel.js +221 -30
  62. package/dist/lib/channel.js.map +1 -1
  63. package/dist/lib/daemon-status.d.ts +26 -0
  64. package/dist/lib/daemon-status.d.ts.map +1 -0
  65. package/dist/lib/daemon-status.js +64 -0
  66. package/dist/lib/daemon-status.js.map +1 -0
  67. package/dist/lib/environment.d.ts +88 -0
  68. package/dist/lib/environment.d.ts.map +1 -0
  69. package/dist/lib/environment.js +238 -0
  70. package/dist/lib/environment.js.map +1 -0
  71. package/dist/lib/frontmatter.d.ts +8 -0
  72. package/dist/lib/frontmatter.d.ts.map +1 -1
  73. package/dist/lib/frontmatter.js +16 -3
  74. package/dist/lib/frontmatter.js.map +1 -1
  75. package/dist/lib/index.d.ts +7 -0
  76. package/dist/lib/index.d.ts.map +1 -1
  77. package/dist/lib/index.js +7 -0
  78. package/dist/lib/index.js.map +1 -1
  79. package/dist/lib/invoke.d.ts +31 -0
  80. package/dist/lib/invoke.d.ts.map +1 -0
  81. package/dist/lib/invoke.js +170 -0
  82. package/dist/lib/invoke.js.map +1 -0
  83. package/dist/lib/persona.d.ts +22 -1
  84. package/dist/lib/persona.d.ts.map +1 -1
  85. package/dist/lib/persona.js +176 -31
  86. package/dist/lib/persona.js.map +1 -1
  87. package/dist/lib/processor.d.ts +58 -0
  88. package/dist/lib/processor.d.ts.map +1 -0
  89. package/dist/lib/processor.js +149 -0
  90. package/dist/lib/processor.js.map +1 -0
  91. package/dist/lib/registry.d.ts +109 -0
  92. package/dist/lib/registry.d.ts.map +1 -0
  93. package/dist/lib/registry.js +192 -0
  94. package/dist/lib/registry.js.map +1 -0
  95. package/dist/lib/session-thread.d.ts +75 -0
  96. package/dist/lib/session-thread.d.ts.map +1 -0
  97. package/dist/lib/session-thread.js +132 -0
  98. package/dist/lib/session-thread.js.map +1 -0
  99. package/dist/lib/session.d.ts +150 -0
  100. package/dist/lib/session.d.ts.map +1 -0
  101. package/dist/lib/session.js +183 -0
  102. package/dist/lib/session.js.map +1 -0
  103. package/dist/lib/types/channel.d.ts +4 -0
  104. package/dist/lib/types/channel.d.ts.map +1 -1
  105. package/dist/lib/types/persona.d.ts +49 -6
  106. package/dist/lib/types/persona.d.ts.map +1 -1
  107. package/dist/lib/validation/persona.d.ts.map +1 -1
  108. package/dist/lib/validation/persona.js +41 -4
  109. package/dist/lib/validation/persona.js.map +1 -1
  110. package/internal/personas/_base/PERSONA.md +222 -39
  111. package/internal/skills/channels/list/SKILL.md +76 -0
  112. package/package.json +15 -5
@@ -1,68 +1,251 @@
1
1
  ---
2
2
  name: _base
3
- description: System foundation inherited by all personas
3
+ description: dot-agents system knowledge inherited by all personas
4
4
  skills:
5
+ - channels/list
5
6
  - channels/publish
6
7
  - channels/read
7
8
  - channels/reply
8
9
  ---
9
10
 
10
- ## System Communication Channels
11
+ # dot-agents System
11
12
 
12
- You operate within a system that uses channels for coordination. Use these channels appropriately throughout your work.
13
+ You operate within a dot-agents system. This document describes the core capabilities available to you.
13
14
 
14
- For detailed usage, see the internal channel skills: `channels/publish`, `channels/read`, `channels/reply`.
15
+ ## Mental Model
15
16
 
16
- ### Channel Reference
17
+ Three primitives work together:
17
18
 
18
- | Channel | When to Use |
19
- | ----------- | -------------------------------------------------------- |
20
- | `#issues` | When you encounter errors or blockers you cannot resolve |
21
- | `#journals` | Daily logs (posted by review workflows, not directly) |
22
- | `@human` | When human action is required to proceed |
19
+ | Primitive | Purpose |
20
+ | ------------- | -------------------------------------- |
21
+ | **Personas** | HOW - Agent configuration and behavior |
22
+ | **Workflows** | WHAT - Tasks with triggers and inputs |
23
+ | **Channels** | COORDINATION - Messaging and sessions |
23
24
 
24
- ### Session Logging
25
+ You are running in a **session** right now (a thread in `#sessions`). Your behavior is defined by a **persona**. You coordinate via **channels**.
25
26
 
26
- Session output is captured to `.agents/logs/` by the daemon or runner. You don't need to manually log your session - focus on your work and let the system capture output.
27
+ ## Channels
27
28
 
28
- Logs are processed later by review workflows to generate `#journals` entries.
29
+ Channels are the messaging backbone for coordination. Two types exist:
29
30
 
30
- ### On Error/Block (When Applicable)
31
+ | Prefix | Type | Purpose |
32
+ | ------ | ------------------- | -------------------------------- |
33
+ | `@` | DM (Direct Message) | Private inbox for a persona |
34
+ | `#` | Public Channel | Shared topic-based communication |
31
35
 
32
- When you encounter an issue you cannot resolve:
36
+ ### Publishing Messages
33
37
 
34
38
  ```bash
35
- npx dot-agents channels publish "#issues" "$(cat <<'EOF'
36
- **Issue:** <Short title>
37
- **Impact:** <What's affected>
38
- **Context:** <Why this happened>
39
-
40
- **To Fix:**
41
- 1. <Step-by-step instructions>
42
- 2. <Be specific about paths, commands>
43
-
44
- **Blocked:** yes|no
45
- EOF
46
- )"
39
+ npx dot-agents channels publish <channel> <message> [options]
47
40
  ```
48
41
 
49
- ### Human Escalation (Sparingly)
42
+ **Options:**
50
43
 
51
- Only when YOU cannot proceed and human action is required:
44
+ - `--thread <id>` - Add to existing thread (default: creates new thread)
45
+ - `--from <sender>` - Override sender identifier
46
+ - `--tags <tags>` - Comma-separated tags
47
+
48
+ **Output:** Always returns Message ID and Thread ID.
49
+
50
+ **Examples:**
51
+
52
+ ```bash
53
+ # Start a new conversation (thread created automatically)
54
+ npx dot-agents channels publish "#status" "Deployment complete"
55
+
56
+ # Continue an existing thread
57
+ npx dot-agents channels publish "#status" "Rollback needed" --thread <thread-id>
58
+
59
+ # Post to a persona's DM
60
+ npx dot-agents channels publish "@developer" "Please review PR #123"
61
+ ```
62
+
63
+ ### Reading Messages
64
+
65
+ ```bash
66
+ npx dot-agents channels read <channel> [options]
67
+ ```
68
+
69
+ **Options:**
70
+
71
+ - `--thread <id>` - Filter to specific thread
72
+ - `--since <duration>` - Filter by time (e.g., `24h`, `7d`, `1m`)
73
+ - `-l, --limit <n>` - Number of messages (default: 10)
74
+
75
+ **Examples:**
76
+
77
+ ```bash
78
+ # Read recent messages
79
+ npx dot-agents channels read "#status"
80
+
81
+ # Read a specific conversation thread
82
+ npx dot-agents channels read "#status" --thread <thread-id>
83
+
84
+ # Read last 24 hours
85
+ npx dot-agents channels read "@human" --since 24h
86
+ ```
87
+
88
+ ### Replying to Messages
89
+
90
+ ```bash
91
+ npx dot-agents channels reply <channel> <messageId> <reply>
92
+ ```
93
+
94
+ Adds a reply to a specific message (creates a sub-thread within the message).
95
+
96
+ ## Personas
97
+
98
+ Personas are agent configurations with inherited context and capabilities.
99
+
100
+ ### Running Personas
101
+
102
+ ```bash
103
+ npx dot-agents personas run <name> [options]
104
+ ```
105
+
106
+ **Options:**
107
+
108
+ - `-p, --prompt <text>` - Initial prompt/task
109
+ - `--headless` - Non-interactive mode
110
+ - `--interactive` - Interactive mode (default)
111
+
112
+ ### Inheritance
113
+
114
+ Personas inherit automatically via directory structure:
115
+
116
+ 1. **Root persona** (`.agents/PERSONA.md`) provides project-wide context
117
+ 2. **Child personas** in `.agents/personas/` inherit from root implicitly
118
+ 3. **All personas** inherit from the built-in `_base` persona (this document)
119
+
120
+ No explicit `inherits:` field needed - inheritance is convention-based.
121
+
122
+ ## Workflows
123
+
124
+ Workflows are multi-step processes defined in `.agents/workflows/`.
125
+
126
+ ```bash
127
+ npx dot-agents run <workflow-name>
128
+ npx dot-agents list workflows
129
+ ```
130
+
131
+ ## Projects
132
+
133
+ Projects are registered dot-agents installations that can communicate with each other.
134
+
135
+ ```bash
136
+ npx dot-agents projects list # Registered projects
137
+ ```
138
+
139
+ ### Cross-Project Communication
140
+
141
+ Delegate to another project using `@project` syntax:
142
+
143
+ ```bash
144
+ # Delegate to another project's entry point
145
+ npx dot-agents channels publish "@other-project" "Please handle this task"
146
+
147
+ # Read from another project's channel
148
+ npx dot-agents channels read "@other-project" --since 24h
149
+ ```
150
+
151
+ ## Discovery
152
+
153
+ ```bash
154
+ npx dot-agents projects list # Registered projects
155
+ npx dot-agents channels list # Available channels
156
+ npx dot-agents list personas # Available personas
157
+ npx dot-agents list workflows # Available workflows
158
+ ```
159
+
160
+ **Proactively discover your environment** - Run discovery commands at session start to understand available resources before diving into work.
161
+
162
+ Note: Skills are implementation details of workflows and personas. Access capabilities through workflows and personas rather than invoking skills directly.
163
+
164
+ ---
165
+
166
+ ## Sessions
167
+
168
+ Sessions are threads in the `#sessions` channel. When you start running, the system automatically creates a session thread and posts a "Session Started" message. When the session ends, a "Session Ended" message is posted with duration and exit status.
169
+
170
+ ### Environment Variables
171
+
172
+ - `SESSION_ID` - Your session thread ID (ISO timestamp, e.g., `2025-12-23T15:30:45.000Z`)
173
+ - `SESSION_THREAD_ID` - Same as SESSION_ID (alias for clarity)
174
+ - `SESSION_WORKSPACE` - Path to your session's workspace directory for working files
175
+
176
+ ### Posting Session Updates
177
+
178
+ For **interactive sessions**, post updates to your session thread to maintain an observable log of your work. This is especially important for:
179
+
180
+ - Major decisions or milestones
181
+ - Delegating to other personas/projects
182
+ - Receiving updates from delegated work
183
+ - Encountering blockers
184
+
185
+ **Pattern for updates:**
186
+
187
+ ```bash
188
+ npx dot-agents channels publish "#sessions" "Brief update message" --thread $SESSION_ID
189
+ ```
190
+
191
+ **Examples:**
192
+
193
+ ```bash
194
+ # Log a major action
195
+ npx dot-agents channels publish "#sessions" "Starting implementation of feature X" --thread $SESSION_ID
196
+
197
+ # Log delegation
198
+ npx dot-agents channels publish "#sessions" "Delegating to @scoutos for backend changes" --thread $SESSION_ID
199
+
200
+ # Log receiving results
201
+ npx dot-agents channels publish "#sessions" "Received: Backend changes complete, tests passing" --thread $SESSION_ID
202
+ ```
203
+
204
+ ### Checking for Updates
205
+
206
+ When you've delegated work to another persona or project, periodically check your session thread for updates:
52
207
 
53
208
  ```bash
54
- npx dot-agents channels publish "@human" "<What you need from the human>"
209
+ npx dot-agents channels read "#sessions" --thread $SESSION_ID
55
210
  ```
56
211
 
57
- Do NOT escalate for:
212
+ Delegates should post their status updates to the upstream session thread, keeping the parent informed of progress.
213
+
214
+ ### Cross-Project Delegation Callbacks
215
+
216
+ When you receive a delegated task via DM, the system automatically provides callback routing:
217
+
218
+ **Environment variables (set automatically):**
219
+
220
+ - `FROM_ADDRESS` - Full callback address (e.g., `#docs/sessions:2026-01-02T21:00:00.000Z`)
221
+ - `FROM_CHANNEL` - Channel portion (e.g., `#docs/sessions`)
222
+ - `FROM_THREAD` - Thread ID portion (e.g., `2026-01-02T21:00:00.000Z`)
223
+
224
+ **Posting callbacks:**
225
+
226
+ ```bash
227
+ # Reply directly using FROM_ADDRESS (includes channel + thread)
228
+ npx dot-agents channels publish "$FROM_ADDRESS" "Task complete: implemented feature X"
229
+
230
+ # This is equivalent to:
231
+ # npx dot-agents channels publish "$FROM_CHANNEL" "..." --thread "$FROM_THREAD"
232
+ ```
233
+
234
+ **Your outgoing messages also include callback info automatically.** When you publish, your `FROM_ADDRESS` is included in the `from` field, so receivers can reply back to your session.
235
+
236
+ ### Workspace Directory
237
+
238
+ Use `$SESSION_WORKSPACE` for any working files needed during the session:
239
+
240
+ - Scratch notes
241
+ - Temporary artifacts
242
+ - Files to preserve for later reference
58
243
 
59
- - Issues you can work around
60
- - Information you can find yourself
61
- - Decisions within your authority
244
+ The workspace persists with the session thread and can be accessed later.
62
245
 
63
- DO escalate for:
246
+ ### Why Sessions-as-Threads Matter
64
247
 
65
- - GUI interactions required (macOS permissions, etc.)
66
- - Missing credentials or access
67
- - Ambiguous requirements needing clarification
68
- - Destructive operations needing confirmation
248
+ - **Cross-machine coordination** - Channels sync across machines, so you can see session history from anywhere
249
+ - **Observable audit trail** - Anyone can read the session thread to understand what happened
250
+ - **Delegation callbacks** - Delegates post to the parent's thread, no polling required
251
+ - **Natural resumption** - Read the thread to reconstruct context for any session
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: channels/list
3
+ description: List all available channels. Use when discovering what channels exist or checking channel metadata.
4
+ license: MIT
5
+ ---
6
+
7
+ # List Channels
8
+
9
+ List all channels to discover available communication streams.
10
+
11
+ ## When to Use This Skill
12
+
13
+ Use this skill when you need to:
14
+
15
+ - Discover what channels exist
16
+ - Check channel metadata (creator, creation date)
17
+ - Find the right channel to publish to
18
+ - Get an overview of communication streams
19
+
20
+ ## Process
21
+
22
+ ### Step 1: List All Channels
23
+
24
+ ```bash
25
+ npx dot-agents channels list
26
+ ```
27
+
28
+ ### Step 2: Review Output
29
+
30
+ The output shows all channels with their metadata:
31
+
32
+ ```text
33
+ Channels (4):
34
+
35
+ #status
36
+ Progress updates and milestone notifications
37
+ created by system at 2025-12-10T08:00:00.000Z
38
+
39
+ #issues
40
+ Problems, blockers, and errors
41
+ created by system at 2025-12-10T08:00:00.000Z
42
+
43
+ @developer
44
+ created by human:tnez at 2025-12-12T09:00:00.000Z
45
+ ```
46
+
47
+ ## Examples
48
+
49
+ ### Example 1: Check Available Channels
50
+
51
+ ```bash
52
+ npx dot-agents channels list
53
+ ```
54
+
55
+ ### Example 2: Filter Public Channels
56
+
57
+ ```bash
58
+ npx dot-agents channels list | grep "^ #"
59
+ ```
60
+
61
+ ### Example 3: Filter DM Channels
62
+
63
+ ```bash
64
+ npx dot-agents channels list | grep "^ @"
65
+ ```
66
+
67
+ ## Channel Types
68
+
69
+ - `#channel-name` - Public channels for topic-based communication
70
+ - `@persona-name` - Direct message inboxes for personas
71
+
72
+ ## Notes
73
+
74
+ - Channels are created automatically when first message is published
75
+ - Empty result means no channels have been created yet
76
+ - Use this before publishing to discover the right channel
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dot-agents",
3
- "version": "0.5.0",
3
+ "version": "0.7.4",
4
4
  "description": "A framework for building agentic workflows with personas and scheduled execution",
5
5
  "type": "module",
6
6
  "main": "./dist/lib/index.js",
@@ -19,12 +19,20 @@
19
19
  }
20
20
  },
21
21
  "scripts": {
22
- "build": "tsc",
23
- "dev": "tsc --watch",
22
+ "build": "tsc -p tsconfig.build.json && cp -r src/daemon/web dist/daemon/",
23
+ "postbuild": "echo '\nšŸ“¦ Build complete. Run `bun link && chmod +x dist/cli/index.js` to use locally.\n'",
24
+ "dev": "bun --watch src/cli/index.ts",
25
+ "dev:daemon": "bun --watch src/daemon/index.ts",
24
26
  "typecheck": "tsc --noEmit",
27
+ "test": "bun test tests/",
28
+ "test:watch": "bun test --watch tests/",
29
+ "spec": "vitest run specs/",
30
+ "spec:watch": "vitest specs/",
31
+ "test:all": "bun test tests/ && vitest run specs/",
32
+ "test:coverage": "vitest run tests/ --coverage",
25
33
  "clean": "rm -rf dist *.tsbuildinfo",
26
34
  "prepare": "git config core.hooksPath .githooks || true",
27
- "prepublishOnly": "npm run clean && npm run build"
35
+ "prepublishOnly": "bun run clean && bun run build"
28
36
  },
29
37
  "files": [
30
38
  "dist",
@@ -68,6 +76,8 @@
68
76
  "devDependencies": {
69
77
  "@types/express": "^5.0.0",
70
78
  "@types/node": "^22.10.1",
71
- "typescript": "^5.7.2"
79
+ "@vitest/coverage-v8": "^4.0.16",
80
+ "typescript": "^5.7.2",
81
+ "vitest": "^4.0.16"
72
82
  }
73
83
  }