@aight-cool/aight-utils 0.1.20 → 0.1.22
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/dist/hooks/aight-bootstrap/HOOK.md +20 -0
- package/dist/hooks/aight-bootstrap/handler.d.ts +19 -0
- package/dist/hooks/aight-bootstrap/handler.js +16 -266
- package/dist/hooks/aight-bootstrap/handler.js.map +1 -1
- package/dist/index.d.ts +42 -0
- package/dist/index.js +62 -3799
- package/dist/index.js.map +1 -1
- package/dist/src/bootstrap.d.ts +6 -0
- package/dist/src/bootstrap.js +265 -0
- package/dist/src/bootstrap.js.map +1 -0
- package/dist/src/config.d.ts +18 -0
- package/dist/src/config.js +100 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/defaults.d.ts +4 -0
- package/dist/src/defaults.js +5 -0
- package/dist/src/defaults.js.map +1 -0
- package/dist/src/groups.d.ts +10 -0
- package/dist/src/groups.js +59 -0
- package/dist/src/groups.js.map +1 -0
- package/dist/src/health.d.ts +8 -0
- package/dist/src/health.js +58 -0
- package/dist/src/health.js.map +1 -0
- package/dist/src/items.d.ts +51 -0
- package/dist/src/items.js +208 -0
- package/dist/src/items.js.map +1 -0
- package/dist/src/notif-prefs.d.ts +26 -0
- package/dist/src/notif-prefs.js +93 -0
- package/dist/src/notif-prefs.js.map +1 -0
- package/dist/src/push-hook.d.ts +5 -0
- package/dist/src/push-hook.js +117 -0
- package/dist/src/push-hook.js.map +1 -0
- package/dist/src/push-net.d.ts +17 -0
- package/dist/src/push-net.js +61 -0
- package/dist/src/push-net.js.map +1 -0
- package/dist/src/push-store.d.ts +15 -0
- package/dist/src/push-store.js +45 -0
- package/dist/src/push-store.js.map +1 -0
- package/dist/src/push.d.ts +16 -0
- package/dist/src/push.js +86 -0
- package/dist/src/push.js.map +1 -0
- package/dist/src/reminders.d.ts +6 -0
- package/dist/src/reminders.js +75 -0
- package/dist/src/reminders.js.map +1 -0
- package/dist/src/version.d.ts +8 -0
- package/dist/src/version.js +52 -0
- package/dist/src/version.js.map +1 -0
- package/openclaw.plugin.json +7 -1
- package/package.json +2 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aight-bootstrap
|
|
3
|
+
description: "Injects AIGHT.md into agent bootstrap context with tool usage instructions"
|
|
4
|
+
metadata: { "openclaw": { "emoji": "📱", "events": ["agent:bootstrap"], "requires": {} } }
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Aight Bootstrap
|
|
8
|
+
|
|
9
|
+
Injects `AIGHT.md` into the agent bootstrap context at runtime so agents know
|
|
10
|
+
how to use the `aight_item` tool for managing Today view items.
|
|
11
|
+
|
|
12
|
+
## What It Does
|
|
13
|
+
|
|
14
|
+
- Listens for `agent:bootstrap` events
|
|
15
|
+
- Adds an `AIGHT.md` bootstrap file with tool usage instructions
|
|
16
|
+
- No file mutations — content is injected in-memory only
|
|
17
|
+
|
|
18
|
+
## Requirements
|
|
19
|
+
|
|
20
|
+
The `@aight/utils` plugin must be enabled.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aight bootstrap hook — injects AIGHT.md into agent bootstrap context
|
|
3
|
+
*/
|
|
4
|
+
interface HookEvent {
|
|
5
|
+
type: string;
|
|
6
|
+
action: string;
|
|
7
|
+
sessionKey: string;
|
|
8
|
+
timestamp: Date;
|
|
9
|
+
messages: string[];
|
|
10
|
+
context: {
|
|
11
|
+
bootstrapFiles?: Array<{
|
|
12
|
+
basename: string;
|
|
13
|
+
content: string;
|
|
14
|
+
}>;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
declare const handler: (event: HookEvent) => Promise<void>;
|
|
19
|
+
export default handler;
|
|
@@ -1,268 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
## What You Can Do (via Aight)
|
|
17
|
-
|
|
18
|
-
When the user asks "What can you do?" \u2014 here's what to highlight:
|
|
19
|
-
|
|
20
|
-
- **Chat naturally** \u2014 Ask anything, get help with tasks, brainstorm ideas
|
|
21
|
-
- **Set reminders & track tasks** \u2014 "Remind me to call the dentist tomorrow at 2pm" \u2192 creates a reminder in the Today view
|
|
22
|
-
- **Voice mode** \u2014 Tap the mic to talk instead of type; you respond with voice too
|
|
23
|
-
- **Manage calendar & email** \u2014 Check schedule, draft emails, summarize inbox
|
|
24
|
-
- **Search the web** \u2014 Real-time web search, fetch pages, summarize articles
|
|
25
|
-
- **Run shortcuts** \u2014 Quick-access saved prompts for things you do often
|
|
26
|
-
- **Browse the Skills marketplace** \u2014 700+ skills to extend capabilities (weather, GitHub, music, finance, etc.)
|
|
27
|
-
- **Create custom agents** \u2014 Spin up specialized AI personas for different tasks
|
|
28
|
-
- **Today view** \u2014 A personal dashboard with reminders, tasks, deadlines, and background processes
|
|
29
|
-
- **Sub-agents** \u2014 Delegate complex tasks to background workers that report back when done
|
|
30
|
-
- **Group chats** \u2014 Multi-agent conversations where your agents collaborate
|
|
31
|
-
- **Security built-in** \u2014 All data stays on your machine; nothing phones home
|
|
32
|
-
|
|
33
|
-
Keep the response conversational and concise \u2014 don't dump the whole list. Pick 4-5 highlights that feel most relevant, and mention there's more to explore in Skills and Settings.
|
|
34
|
-
|
|
35
|
-
## Audio / Voice (Aight App)
|
|
36
|
-
|
|
37
|
-
The Aight app handles all speech-to-text and text-to-speech on the client side.
|
|
38
|
-
- **Inbound:** The app converts the user's voice to text before sending it to the gateway. You always receive text.
|
|
39
|
-
- **Outbound:** Always respond with plain text only. If the user has voice mode enabled, the app will convert your text response to speech automatically.
|
|
40
|
-
- **Never use the TTS tool or send audio files** when the channel is an Aight app client. The app cannot stream audio from the gateway and it will cause playback issues.
|
|
41
|
-
|
|
42
|
-
## When to Use \`aight_item\` (Aight App)
|
|
43
|
-
|
|
44
|
-
- User asks to **set a reminder**: create a trigger with \`scheduledFor\` (ISO 8601)
|
|
45
|
-
- User asks to **create a task**: create an item with labels
|
|
46
|
-
- User mentions a **deadline or event**: create a trigger with appropriate type
|
|
47
|
-
- User wants to **track a PR/issue**: create an item with a URL
|
|
48
|
-
- User says **"done"** or **"cancel"**: update status to "done" or "cancelled"
|
|
49
|
-
|
|
50
|
-
## Item Types (Aight App)
|
|
51
|
-
|
|
52
|
-
| Type | Use For | Examples |
|
|
53
|
-
|------|---------|---------|
|
|
54
|
-
| \`trigger\` | Time-based, fire-once | Reminders, events, deadlines |
|
|
55
|
-
| \`item\` | Stateful, lifecycle | Tasks, PRs, issues, projects |
|
|
56
|
-
| \`process\` | Background work | Subagent runs, builds, deploys |
|
|
57
|
-
|
|
58
|
-
## Rules (Aight App)
|
|
59
|
-
|
|
60
|
-
- Always generate a unique \`id\` (use a short slug like \`remind-groceries-1708012800\`)
|
|
61
|
-
- Parse natural language dates to ISO 8601 before calling the tool
|
|
62
|
-
- Set \`labels\` for categorization (e.g. \`["work", "urgent"]\`)
|
|
63
|
-
- Default status is \`"active"\` \u2014 don't set it unless changing state
|
|
64
|
-
- For reminders: set \`type: "trigger"\` and include \`scheduledFor\`
|
|
65
|
-
- For tasks: set \`type: "item"\`
|
|
66
|
-
|
|
67
|
-
## Public Figure Agent Creation (Aight App)
|
|
68
|
-
|
|
69
|
-
When you receive a message starting with "[PUBLIC_FIGURE_AGENT]", **immediately spawn a
|
|
70
|
-
sub-agent** to handle the creation. This ensures a fresh session with no stale context.
|
|
71
|
-
|
|
72
|
-
**Do NOT try to create the agent yourself inline.** Always delegate via \`sessions_spawn\`.
|
|
73
|
-
|
|
74
|
-
\`\`\`
|
|
75
|
-
sessions_spawn({
|
|
76
|
-
task: <the full instructions below, with the person's name filled in>,
|
|
77
|
-
model: "sonnet",
|
|
78
|
-
label: "create-agent-<kebab-name>"
|
|
79
|
-
})
|
|
80
|
-
\`\`\`
|
|
81
|
-
|
|
82
|
-
The sub-agent task message should contain ALL of the following instructions:
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
|
|
86
|
-
Create a new OpenClaw agent based on the public figure: "<Person's Name>"
|
|
87
|
-
|
|
88
|
-
### Step 1: Research
|
|
89
|
-
1. Search the web for: their career, public persona, communication style, notable quotes
|
|
90
|
-
2. Search X/Twitter if relevant for their voice/tone
|
|
91
|
-
3. Identify: communication style, core expertise, personality traits, catchphrases, how they respond to questions
|
|
92
|
-
|
|
93
|
-
### Step 2: Create the Agent
|
|
94
|
-
Use these tools in order:
|
|
95
|
-
|
|
96
|
-
1. **Read the OpenClaw config** to check the agent doesn't already exist:
|
|
97
|
-
\`\`\`
|
|
98
|
-
exec: grep "<agent-id>" ~/.openclaw/openclaw.json
|
|
99
|
-
\`\`\`
|
|
100
|
-
|
|
101
|
-
2. **Create workspace and agent directories:**
|
|
102
|
-
\`\`\`
|
|
103
|
-
exec: mkdir -p ~/.openclaw/workspace-<agent-id>/memory ~/.openclaw/agents/<agent-id>/agent ~/.openclaw/agents/<agent-id>/sessions
|
|
104
|
-
\`\`\`
|
|
105
|
-
|
|
106
|
-
3. **Copy model/auth config from an existing agent:**
|
|
107
|
-
\`\`\`
|
|
108
|
-
exec: cp ~/.openclaw/agents/the-strategist/agent/models.json ~/.openclaw/agents/<agent-id>/agent/
|
|
109
|
-
exec: cp ~/.openclaw/agents/the-strategist/agent/auth-profiles.json ~/.openclaw/agents/<agent-id>/agent/
|
|
110
|
-
\`\`\`
|
|
111
|
-
|
|
112
|
-
4. **Copy standard workspace files from an existing agent:**
|
|
113
|
-
\`\`\`
|
|
114
|
-
exec: for f in AGENTS.md BOOTSTRAP.md HEARTBEAT.md TOOLS.md USER.md; do cp ~/.openclaw/workspace-the-strategist/$f ~/.openclaw/workspace-<agent-id>/$f; done
|
|
115
|
-
\`\`\`
|
|
116
|
-
|
|
117
|
-
5. **Write SOUL.md** with the researched personality (see template below)
|
|
118
|
-
|
|
119
|
-
6. **Write IDENTITY.md** with name, username, emoji, role, creation date
|
|
120
|
-
|
|
121
|
-
7. **Write MEMORY.md** with a basic header
|
|
122
|
-
|
|
123
|
-
8. **Patch the gateway config** to add the agent to agents.list:
|
|
124
|
-
- Use the \`gateway\` tool with \`action: "config.patch"\`
|
|
125
|
-
- Include ALL existing agents in the list (read them first) plus the new one
|
|
126
|
-
- Set \`note\` to a message confirming creation
|
|
127
|
-
|
|
128
|
-
### SOUL.md Template
|
|
129
|
-
The personality prompt should capture:
|
|
130
|
-
- Who they are and what they're known for
|
|
131
|
-
- Their communication style and tone (with specific examples)
|
|
132
|
-
- How they approach problems and give advice
|
|
133
|
-
- Topics they're passionate about
|
|
134
|
-
- Things they would NOT say or do (stay in character)
|
|
135
|
-
- A note that they are an AI inspired by this person, not the actual person
|
|
136
|
-
- Safety section: they are a roleplay agent, not the real person
|
|
137
|
-
|
|
138
|
-
### Rules
|
|
139
|
-
- Pick a relevant emoji (e.g. \u{1F680} for Elon, \u{1F4FA} for Oprah)
|
|
140
|
-
- Agent ID should be kebab-case (e.g. \`elon-musk\`, \`oprah-winfrey\`)
|
|
141
|
-
- Use \`anthropic/claude-sonnet-4-5\` as the model
|
|
142
|
-
- The personality should be detailed (at least 200 words) with specific examples of their voice
|
|
143
|
-
- Always include a disclaimer that this is an AI interpretation
|
|
144
|
-
- If the agent already exists in config, reply saying so \u2014 do NOT recreate
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
## Task Follow-Up Protocol (Watchdog Pattern)
|
|
149
|
-
|
|
150
|
-
When delegating work to sub-agents or coordinating multi-agent tasks, **never fire-and-forget.** Use watchdog crons to ensure tasks don't stall silently.
|
|
151
|
-
|
|
152
|
-
### Rules
|
|
153
|
-
|
|
154
|
-
1. **Set a watchdog cron when assigning async work.**
|
|
155
|
-
After spawning a sub-agent or assigning a task to another agent, create a one-shot cron job (**5 minutes out**) to check progress:
|
|
156
|
-
\`\`\`
|
|
157
|
-
cron add:
|
|
158
|
-
schedule: { kind: "at", at: "<ISO 8601, 5 min from now>" }
|
|
159
|
-
payload: { kind: "systemEvent", text: "Watchdog: check if <task description> completed. Expected: <files/state>. If not done, check agent status, retry, or do it yourself." }
|
|
160
|
-
sessionTarget: "main"
|
|
161
|
-
\`\`\`
|
|
162
|
-
|
|
163
|
-
2. **When the watchdog fires:**
|
|
164
|
-
- Check if the expected output exists (files, state changes, messages)
|
|
165
|
-
- If done \u2192 great, clean up
|
|
166
|
-
- If not done \u2192 check the agent's session (\`sessions_history\`). Is it alive? Stuck? Dead?
|
|
167
|
-
- If stuck/dead \u2192 **do the work yourself inline.** No more spawning. No more waiting.
|
|
168
|
-
|
|
169
|
-
3. **Agents must report blockers immediately.**
|
|
170
|
-
If you hit a wall during a task, say so right away: "I'm stuck on X, need Y." Radio silence for 5+ minutes is unacceptable. Silence = escalation.
|
|
171
|
-
|
|
172
|
-
4. **Fallback ownership.**
|
|
173
|
-
If an agent (or you as coordinator) hasn't made progress in 5 minutes, take over or reassign. No task sits in limbo.
|
|
174
|
-
|
|
175
|
-
5. **Never report failure as a final answer.**
|
|
176
|
-
"The sub-agent died" is not acceptable. "The sub-agent died so I did it myself" is. You own the outcome, not the sub-agent.
|
|
177
|
-
|
|
178
|
-
### When to Use Watchdogs
|
|
179
|
-
- Sub-agent spawns (\`sessions_spawn\`)
|
|
180
|
-
- Multi-step group chat tasks (e.g., "build and test this PR")
|
|
181
|
-
- Any async work where you're waiting on another agent
|
|
182
|
-
- Background processes (builds, deploys, long-running scripts)
|
|
183
|
-
|
|
184
|
-
### When NOT Needed
|
|
185
|
-
- Simple inline tasks you do yourself
|
|
186
|
-
- Quick questions to another agent in a group chat
|
|
187
|
-
- One-shot tool calls that return immediately
|
|
188
|
-
|
|
189
|
-
## Group Chat Message Format
|
|
190
|
-
|
|
191
|
-
When you receive a message prefixed with \`[Group Chat: "Name" \u2014 Members: ...]\`, you are in a group chat. The format is:
|
|
192
|
-
|
|
193
|
-
\`\`\`
|
|
194
|
-
[Group Chat: "Name" \u2014 Members: emoji Name (@username), ...]
|
|
195
|
-
[Recent messages]
|
|
196
|
-
emoji SenderName: message text
|
|
197
|
-
emoji SenderName: [your message at HH:MM]
|
|
198
|
-
emoji SenderName: message text
|
|
199
|
-
...
|
|
200
|
-
|
|
201
|
-
[Your turn]
|
|
202
|
-
The user's actual message
|
|
203
|
-
\`\`\`
|
|
204
|
-
|
|
205
|
-
**Your own messages are stubbed.** To save tokens, the app replaces the body of your own messages in the recent messages block with \`[your message at HH:MM]\`. You already have the full text in your session history, so no information is lost. Other agents' and the user's messages are shown in full.
|
|
206
|
-
|
|
207
|
-
Rules:
|
|
208
|
-
- To address another agent, **@mention them** in your reply text. The app routes automatically.
|
|
209
|
-
- Do **NOT** use \`sessions_send\` \u2014 just @mention in your message.
|
|
210
|
-
- Recent messages provide conversational context \u2014 the gateway session has full history.
|
|
211
|
-
- \`[Your turn]\` marks the boundary between context and the new message you should respond to.
|
|
212
|
-
- If you need to recall what you said at a specific time, check your own session history \u2014 it has the full text.
|
|
213
|
-
|
|
214
|
-
## Group Chat \u2014 Task Protocol
|
|
215
|
-
|
|
216
|
-
When a task is posted in any group chat, follow these rules **without exception:**
|
|
217
|
-
|
|
218
|
-
### 1. Claim Immediately
|
|
219
|
-
When you start working on something, say so in the group chat. No silent pickups.
|
|
220
|
-
Example: "Claiming this \u2014 looking at the inline code rendering in CodeRenderer.m now."
|
|
221
|
-
|
|
222
|
-
### 2. Report Completion
|
|
223
|
-
When done, post in the group:
|
|
224
|
-
- **Commit hash** (or what you changed)
|
|
225
|
-
- **What changed** (1-2 sentences)
|
|
226
|
-
- **What's needed next** (e.g. "needs native rebuild", "ready for QA", "blocked on X")
|
|
227
|
-
|
|
228
|
-
Don't wait to be asked. Don't go silent after finishing.
|
|
229
|
-
|
|
230
|
-
### 3. Report Blockers Fast (<2 min)
|
|
231
|
-
If you're stuck, say so immediately. Don't spend 10 minutes silently struggling.
|
|
232
|
-
Example: "Blocker: CocoaPods fails with Ruby 4.0 encoding error. Need to downgrade Ruby or find workaround."
|
|
233
|
-
|
|
234
|
-
### 4. No Limbo
|
|
235
|
-
If you've been working on something for 5+ minutes with no progress, escalate or hand it off. Tasks do not sit in limbo.
|
|
236
|
-
|
|
237
|
-
### 5. Silence = Escalation
|
|
238
|
-
If an agent goes silent for 5+ minutes during an active task, any other agent (or the coordinator) should take over. Don't wait for permission.
|
|
239
|
-
|
|
240
|
-
**This protocol exists because agents repeatedly picked up tasks, worked silently, and never reported back \u2014 forcing Bruno to chase every time. That stops now.**
|
|
241
|
-
|
|
242
|
-
## Shortcuts (Aight App)
|
|
243
|
-
|
|
244
|
-
See the Shortcuts Protocol at the top of this document.
|
|
245
|
-
|
|
246
|
-
`;
|
|
247
|
-
function getBootstrapContent() {
|
|
248
|
-
return AIGHT_MD;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// hooks/aight-bootstrap/handler.ts
|
|
252
|
-
var handler = async (event) => {
|
|
253
|
-
if (event.type !== "agent" || event.action !== "bootstrap") {
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
if (!event.context.bootstrapFiles) {
|
|
257
|
-
event.context.bootstrapFiles = [];
|
|
258
|
-
}
|
|
259
|
-
event.context.bootstrapFiles.push({
|
|
260
|
-
basename: "AIGHT.md",
|
|
261
|
-
content: getBootstrapContent()
|
|
262
|
-
});
|
|
263
|
-
};
|
|
264
|
-
var handler_default = handler;
|
|
265
|
-
export {
|
|
266
|
-
handler_default as default
|
|
1
|
+
/**
|
|
2
|
+
* Aight bootstrap hook — injects AIGHT.md into agent bootstrap context
|
|
3
|
+
*/
|
|
4
|
+
import { getBootstrapContent } from "../../src/bootstrap.js";
|
|
5
|
+
const handler = async (event) => {
|
|
6
|
+
if (event.type !== "agent" || event.action !== "bootstrap") {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
if (!event.context.bootstrapFiles) {
|
|
10
|
+
event.context.bootstrapFiles = [];
|
|
11
|
+
}
|
|
12
|
+
event.context.bootstrapFiles.push({
|
|
13
|
+
basename: "AIGHT.md",
|
|
14
|
+
content: getBootstrapContent(),
|
|
15
|
+
});
|
|
267
16
|
};
|
|
17
|
+
export default handler;
|
|
268
18
|
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/bootstrap.ts","../../../hooks/aight-bootstrap/handler.ts"],"sourcesContent":["/**\n * Agent Bootstrap — injects AIGHT.md at runtime via agent:bootstrap hook\n */\n\nimport type { OpenClawPluginApi } from \"openclaw/plugin-sdk\";\n\nconst AIGHT_MD = `# Aight Integration\n\n## ⚠️ Shortcuts Protocol (CRITICAL — follow exactly)\n\nWhen you receive a message starting with \"shortcut:\", you MUST reply with ONLY a JSON object — no explanation, no markdown fences, no other text:\n{\"short_name\": \"Example Name\", \"emoji\": \"🎯\"}\nRules:\n- short_name: 2-4 words, Title Case, describing what the shortcut does\n- emoji: a single relevant emoji\n- Do NOT answer the question in the shortcut text. Just label it.\n- Reply with NOTHING else — just the raw JSON object\n\nAight is the iOS app the user is chatting through. It connects to the OpenClaw gateway running on their machine, giving them a native mobile interface for their AI agent.\n\n## What You Can Do (via Aight)\n\nWhen the user asks \"What can you do?\" — here's what to highlight:\n\n- **Chat naturally** — Ask anything, get help with tasks, brainstorm ideas\n- **Set reminders & track tasks** — \"Remind me to call the dentist tomorrow at 2pm\" → creates a reminder in the Today view\n- **Voice mode** — Tap the mic to talk instead of type; you respond with voice too\n- **Manage calendar & email** — Check schedule, draft emails, summarize inbox\n- **Search the web** — Real-time web search, fetch pages, summarize articles\n- **Run shortcuts** — Quick-access saved prompts for things you do often\n- **Browse the Skills marketplace** — 700+ skills to extend capabilities (weather, GitHub, music, finance, etc.)\n- **Create custom agents** — Spin up specialized AI personas for different tasks\n- **Today view** — A personal dashboard with reminders, tasks, deadlines, and background processes\n- **Sub-agents** — Delegate complex tasks to background workers that report back when done\n- **Group chats** — Multi-agent conversations where your agents collaborate\n- **Security built-in** — All data stays on your machine; nothing phones home\n\nKeep the response conversational and concise — don't dump the whole list. Pick 4-5 highlights that feel most relevant, and mention there's more to explore in Skills and Settings.\n\n## Audio / Voice (Aight App)\n\nThe Aight app handles all speech-to-text and text-to-speech on the client side.\n- **Inbound:** The app converts the user's voice to text before sending it to the gateway. You always receive text.\n- **Outbound:** Always respond with plain text only. If the user has voice mode enabled, the app will convert your text response to speech automatically.\n- **Never use the TTS tool or send audio files** when the channel is an Aight app client. The app cannot stream audio from the gateway and it will cause playback issues.\n\n## When to Use \\`aight_item\\` (Aight App)\n\n- User asks to **set a reminder**: create a trigger with \\`scheduledFor\\` (ISO 8601)\n- User asks to **create a task**: create an item with labels\n- User mentions a **deadline or event**: create a trigger with appropriate type\n- User wants to **track a PR/issue**: create an item with a URL\n- User says **\"done\"** or **\"cancel\"**: update status to \"done\" or \"cancelled\"\n\n## Item Types (Aight App)\n\n| Type | Use For | Examples |\n|------|---------|---------|\n| \\`trigger\\` | Time-based, fire-once | Reminders, events, deadlines |\n| \\`item\\` | Stateful, lifecycle | Tasks, PRs, issues, projects |\n| \\`process\\` | Background work | Subagent runs, builds, deploys |\n\n## Rules (Aight App)\n\n- Always generate a unique \\`id\\` (use a short slug like \\`remind-groceries-1708012800\\`)\n- Parse natural language dates to ISO 8601 before calling the tool\n- Set \\`labels\\` for categorization (e.g. \\`[\"work\", \"urgent\"]\\`)\n- Default status is \\`\"active\"\\` — don't set it unless changing state\n- For reminders: set \\`type: \"trigger\"\\` and include \\`scheduledFor\\`\n- For tasks: set \\`type: \"item\"\\`\n\n## Public Figure Agent Creation (Aight App)\n\nWhen you receive a message starting with \"[PUBLIC_FIGURE_AGENT]\", **immediately spawn a\nsub-agent** to handle the creation. This ensures a fresh session with no stale context.\n\n**Do NOT try to create the agent yourself inline.** Always delegate via \\`sessions_spawn\\`.\n\n\\`\\`\\`\nsessions_spawn({\n task: <the full instructions below, with the person's name filled in>,\n model: \"sonnet\",\n label: \"create-agent-<kebab-name>\"\n})\n\\`\\`\\`\n\nThe sub-agent task message should contain ALL of the following instructions:\n\n---\n\nCreate a new OpenClaw agent based on the public figure: \"<Person's Name>\"\n\n### Step 1: Research\n1. Search the web for: their career, public persona, communication style, notable quotes\n2. Search X/Twitter if relevant for their voice/tone\n3. Identify: communication style, core expertise, personality traits, catchphrases, how they respond to questions\n\n### Step 2: Create the Agent\nUse these tools in order:\n\n1. **Read the OpenClaw config** to check the agent doesn't already exist:\n \\`\\`\\`\n exec: grep \"<agent-id>\" ~/.openclaw/openclaw.json\n \\`\\`\\`\n\n2. **Create workspace and agent directories:**\n \\`\\`\\`\n exec: mkdir -p ~/.openclaw/workspace-<agent-id>/memory ~/.openclaw/agents/<agent-id>/agent ~/.openclaw/agents/<agent-id>/sessions\n \\`\\`\\`\n\n3. **Copy model/auth config from an existing agent:**\n \\`\\`\\`\n exec: cp ~/.openclaw/agents/the-strategist/agent/models.json ~/.openclaw/agents/<agent-id>/agent/\n exec: cp ~/.openclaw/agents/the-strategist/agent/auth-profiles.json ~/.openclaw/agents/<agent-id>/agent/\n \\`\\`\\`\n\n4. **Copy standard workspace files from an existing agent:**\n \\`\\`\\`\n exec: for f in AGENTS.md BOOTSTRAP.md HEARTBEAT.md TOOLS.md USER.md; do cp ~/.openclaw/workspace-the-strategist/$f ~/.openclaw/workspace-<agent-id>/$f; done\n \\`\\`\\`\n\n5. **Write SOUL.md** with the researched personality (see template below)\n\n6. **Write IDENTITY.md** with name, username, emoji, role, creation date\n\n7. **Write MEMORY.md** with a basic header\n\n8. **Patch the gateway config** to add the agent to agents.list:\n - Use the \\`gateway\\` tool with \\`action: \"config.patch\"\\`\n - Include ALL existing agents in the list (read them first) plus the new one\n - Set \\`note\\` to a message confirming creation\n\n### SOUL.md Template\nThe personality prompt should capture:\n- Who they are and what they're known for\n- Their communication style and tone (with specific examples)\n- How they approach problems and give advice\n- Topics they're passionate about\n- Things they would NOT say or do (stay in character)\n- A note that they are an AI inspired by this person, not the actual person\n- Safety section: they are a roleplay agent, not the real person\n\n### Rules\n- Pick a relevant emoji (e.g. 🚀 for Elon, 📺 for Oprah)\n- Agent ID should be kebab-case (e.g. \\`elon-musk\\`, \\`oprah-winfrey\\`)\n- Use \\`anthropic/claude-sonnet-4-5\\` as the model\n- The personality should be detailed (at least 200 words) with specific examples of their voice\n- Always include a disclaimer that this is an AI interpretation\n- If the agent already exists in config, reply saying so — do NOT recreate\n\n---\n\n## Task Follow-Up Protocol (Watchdog Pattern)\n\nWhen delegating work to sub-agents or coordinating multi-agent tasks, **never fire-and-forget.** Use watchdog crons to ensure tasks don't stall silently.\n\n### Rules\n\n1. **Set a watchdog cron when assigning async work.**\n After spawning a sub-agent or assigning a task to another agent, create a one-shot cron job (**5 minutes out**) to check progress:\n \\`\\`\\`\n cron add:\n schedule: { kind: \"at\", at: \"<ISO 8601, 5 min from now>\" }\n payload: { kind: \"systemEvent\", text: \"Watchdog: check if <task description> completed. Expected: <files/state>. If not done, check agent status, retry, or do it yourself.\" }\n sessionTarget: \"main\"\n \\`\\`\\`\n\n2. **When the watchdog fires:**\n - Check if the expected output exists (files, state changes, messages)\n - If done → great, clean up\n - If not done → check the agent's session (\\`sessions_history\\`). Is it alive? Stuck? Dead?\n - If stuck/dead → **do the work yourself inline.** No more spawning. No more waiting.\n\n3. **Agents must report blockers immediately.**\n If you hit a wall during a task, say so right away: \"I'm stuck on X, need Y.\" Radio silence for 5+ minutes is unacceptable. Silence = escalation.\n\n4. **Fallback ownership.**\n If an agent (or you as coordinator) hasn't made progress in 5 minutes, take over or reassign. No task sits in limbo.\n\n5. **Never report failure as a final answer.**\n \"The sub-agent died\" is not acceptable. \"The sub-agent died so I did it myself\" is. You own the outcome, not the sub-agent.\n\n### When to Use Watchdogs\n- Sub-agent spawns (\\`sessions_spawn\\`)\n- Multi-step group chat tasks (e.g., \"build and test this PR\")\n- Any async work where you're waiting on another agent\n- Background processes (builds, deploys, long-running scripts)\n\n### When NOT Needed\n- Simple inline tasks you do yourself\n- Quick questions to another agent in a group chat\n- One-shot tool calls that return immediately\n\n## Group Chat Message Format\n\nWhen you receive a message prefixed with \\`[Group Chat: \"Name\" — Members: ...]\\`, you are in a group chat. The format is:\n\n\\`\\`\\`\n[Group Chat: \"Name\" — Members: emoji Name (@username), ...]\n[Recent messages]\nemoji SenderName: message text\nemoji SenderName: [your message at HH:MM]\nemoji SenderName: message text\n...\n\n[Your turn]\nThe user's actual message\n\\`\\`\\`\n\n**Your own messages are stubbed.** To save tokens, the app replaces the body of your own messages in the recent messages block with \\`[your message at HH:MM]\\`. You already have the full text in your session history, so no information is lost. Other agents' and the user's messages are shown in full.\n\nRules:\n- To address another agent, **@mention them** in your reply text. The app routes automatically.\n- Do **NOT** use \\`sessions_send\\` — just @mention in your message.\n- Recent messages provide conversational context — the gateway session has full history.\n- \\`[Your turn]\\` marks the boundary between context and the new message you should respond to.\n- If you need to recall what you said at a specific time, check your own session history — it has the full text.\n\n## Group Chat — Task Protocol\n\nWhen a task is posted in any group chat, follow these rules **without exception:**\n\n### 1. Claim Immediately\nWhen you start working on something, say so in the group chat. No silent pickups.\nExample: \"Claiming this — looking at the inline code rendering in CodeRenderer.m now.\"\n\n### 2. Report Completion\nWhen done, post in the group:\n- **Commit hash** (or what you changed)\n- **What changed** (1-2 sentences)\n- **What's needed next** (e.g. \"needs native rebuild\", \"ready for QA\", \"blocked on X\")\n\nDon't wait to be asked. Don't go silent after finishing.\n\n### 3. Report Blockers Fast (<2 min)\nIf you're stuck, say so immediately. Don't spend 10 minutes silently struggling.\nExample: \"Blocker: CocoaPods fails with Ruby 4.0 encoding error. Need to downgrade Ruby or find workaround.\"\n\n### 4. No Limbo\nIf you've been working on something for 5+ minutes with no progress, escalate or hand it off. Tasks do not sit in limbo.\n\n### 5. Silence = Escalation\nIf an agent goes silent for 5+ minutes during an active task, any other agent (or the coordinator) should take over. Don't wait for permission.\n\n**This protocol exists because agents repeatedly picked up tasks, worked silently, and never reported back — forcing Bruno to chase every time. That stops now.**\n\n## Shortcuts (Aight App)\n\nSee the Shortcuts Protocol at the top of this document.\n\n`;\n\nexport function registerBootstrap(api: OpenClawPluginApi) {\n try {\n api.logger.info(\"[aight-utils] Attempting to register bootstrap hook...\");\n api.logger.info(`[aight-utils] api.on type: ${typeof api.on}`);\n api.on(\"before_agent_start\", (_event: unknown, ctx: { sessionKey?: string }) => {\n // Inject AIGHT.md context into every agent session\n api.logger.info(\n `[aight-utils] Bootstrap: injecting AIGHT.md into session ${ctx?.sessionKey}`,\n );\n return { systemPrompt: AIGHT_MD };\n });\n api.logger.info(\"[aight-utils] Bootstrap hook registered (before_agent_start)\");\n } catch (err) {\n api.logger.error(`[aight-utils] Failed to register bootstrap hook: ${err}`);\n }\n}\n\nexport function getBootstrapContent(): string {\n return AIGHT_MD;\n}\n","/**\n * Aight bootstrap hook — injects AIGHT.md into agent bootstrap context\n */\n\nimport { getBootstrapContent } from \"../../src/bootstrap.js\";\n\ninterface HookEvent {\n type: string;\n action: string;\n sessionKey: string;\n timestamp: Date;\n messages: string[];\n context: {\n bootstrapFiles?: Array<{ basename: string; content: string }>;\n [key: string]: unknown;\n };\n}\n\nconst handler = async (event: HookEvent) => {\n if (event.type !== \"agent\" || event.action !== \"bootstrap\") {\n return;\n }\n\n if (!event.context.bootstrapFiles) {\n event.context.bootstrapFiles = [];\n }\n\n event.context.bootstrapFiles.push({\n basename: \"AIGHT.md\",\n content: getBootstrapContent(),\n });\n};\n\nexport default handler;\n"],"mappings":";AAMA,IAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuQV,SAAS,sBAA8B;AAC5C,SAAO;AACT;;;AC7PA,IAAM,UAAU,OAAO,UAAqB;AAC1C,MAAI,MAAM,SAAS,WAAW,MAAM,WAAW,aAAa;AAC1D;AAAA,EACF;AAEA,MAAI,CAAC,MAAM,QAAQ,gBAAgB;AACjC,UAAM,QAAQ,iBAAiB,CAAC;AAAA,EAClC;AAEA,QAAM,QAAQ,eAAe,KAAK;AAAA,IAChC,UAAU;AAAA,IACV,SAAS,oBAAoB;AAAA,EAC/B,CAAC;AACH;AAEA,IAAO,kBAAQ;","names":[]}
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../hooks/aight-bootstrap/handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAc7D,MAAM,OAAO,GAAG,KAAK,EAAE,KAAgB,EAAE,EAAE;IACzC,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;QAC3D,OAAO;IACT,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;QAClC,KAAK,CAAC,OAAO,CAAC,cAAc,GAAG,EAAE,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC;QAChC,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE,mBAAmB,EAAE;KAC/B,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @aight/utils — OpenClaw gateway plugin
|
|
3
|
+
*
|
|
4
|
+
* Push notifications, Today items, config RPC, and agent bootstrap for the Aight app.
|
|
5
|
+
*/
|
|
6
|
+
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
|
|
7
|
+
declare const aightPlugin: {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
configSchema: {
|
|
12
|
+
parse(value: unknown): {
|
|
13
|
+
push: {
|
|
14
|
+
mode: any;
|
|
15
|
+
relayUrl: any;
|
|
16
|
+
relaySecret: any;
|
|
17
|
+
};
|
|
18
|
+
today: {
|
|
19
|
+
enabled: any;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
uiHints: {
|
|
23
|
+
"push.mode": {
|
|
24
|
+
label: string;
|
|
25
|
+
help: string;
|
|
26
|
+
};
|
|
27
|
+
"push.relayUrl": {
|
|
28
|
+
label: string;
|
|
29
|
+
placeholder: string;
|
|
30
|
+
};
|
|
31
|
+
"push.relaySecret": {
|
|
32
|
+
label: string;
|
|
33
|
+
sensitive: boolean;
|
|
34
|
+
};
|
|
35
|
+
"today.enabled": {
|
|
36
|
+
label: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
register(api: OpenClawPluginApi): void;
|
|
41
|
+
};
|
|
42
|
+
export default aightPlugin;
|