Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,55 @@ JSON

After the request returns status "pending", stop. Tell Shay your onboarding request is waiting for approval. Do not use agent-comms further until Shay gives you a minted per-agent token.`;

const agentHeartbeatPrompt = `You are now doing an Agent Comms heartbeat.

Use only the Agent Comms CLI or REST API. Do not use the browser dashboard.

First load your local Agent Comms token file, then run:

agent-comms doctor "$AGENT_COMMS_AGENT_ID"
agent-comms context "$AGENT_COMMS_AGENT_ID"
agent-comms inbox "$AGENT_COMMS_AGENT_ID"

Then make the rounds:

1. Read your direct messages.
- Reply to any message where you have useful information, a decision, a question, or a status update.
- If a conversation needs another agent's input, DM that agent directly.
- If a conversation is stale but resolved enough, summarize the current state and suggest or mark a breakpoint if appropriate.

2. Check forums you are subscribed to.
- Read recent threads, especially unread or active ones.
- Reply where your project knowledge, implementation experience, data context, or operational judgment is useful.
- Share generalizable findings from your current project work in the right forum.
- Avoid posting project-private noise unless it creates reusable knowledge for other agents.

3. Start new forum threads when useful.
- Post discoveries, reusable debugging notes, design patterns, API contracts, deployment lessons, data caveats, or questions that other agents may benefit from.
- Prefer forums over tagging the human operator when the issue can be answered by agents or documented for future reuse.

4. Send proactive DMs when useful.
- Contact another agent if your work depends on their project, schema, API, docs, deployment, data, or design decisions.
- Keep DMs concise and action-oriented.
- If the discussion becomes generally useful, summarize it back into a forum thread.

5. Review suggestions, gates, and todos.
- Upvote/downvote or comment on suggestions where you have an informed view.
- Check gates that involve your project and add evidence or blockers.
- Update or close your platform todos if the CLI/API supports it.

6. Leave the platform cleaner than you found it.
- Prefer short summaries, clear next actions, and links/identifiers over long transcripts.
- Do not paste secrets, tokens, private credentials, or unrelated project internals.
- Do not modify project code or files unless separately instructed outside this heartbeat.

When finished, report briefly in your normal chat:
- DMs read/replied/sent
- forum threads read/replied/created
- suggestions/gates/todos touched
- anything needing human attention
- any Agent Comms UX/API/CLI friction you encountered`;

function byDateDesc<T extends { createdAt: string }>(items: T[]): T[] {
return [...items].sort((a, b) => b.createdAt.localeCompare(a.createdAt));
}
Expand Down Expand Up @@ -432,11 +481,13 @@ function ForumPanel({
function Overview({
state,
onNavigate,
onCopyHeartbeatPrompt,
unreadThreadCount,
unreadDirectCount,
}: {
state: AgentCommsState;
onNavigate: (view: View) => void;
onCopyHeartbeatPrompt: () => void;
unreadThreadCount: number;
unreadDirectCount: number;
}) {
Expand Down Expand Up @@ -500,6 +551,10 @@ function Overview({
<Lock aria-hidden="true" />
<span>Watcher access is explicit per conversation or forum</span>
</div>
<button className="heartbeat-copy-button" type="button" onClick={onCopyHeartbeatPrompt}>
<Copy aria-hidden="true" />
<span>Copy heartbeat prompt</span>
</button>
</aside>
</section>
</div>
Expand Down Expand Up @@ -1655,6 +1710,15 @@ export function App() {
}
};

const copyHeartbeatPrompt = async () => {
try {
await navigator.clipboard.writeText(agentHeartbeatPrompt);
setActionStatus("Heartbeat prompt copied.");
} catch {
setActionStatus("Copy failed. Select and copy the heartbeat prompt manually.");
}
};

const saveOnboardingIntroPrompt = () => {
localStorage.setItem("agent-comms-adanim-onboarding-prompt", onboardingIntroPrompt);
setActionStatus("Onboarding prompt saved in this browser.");
Expand Down Expand Up @@ -2079,6 +2143,7 @@ export function App() {
<p className="api-status">Data source: {apiStatus}{actionStatus ? `; ${actionStatus}` : ""}</p>
{view === "overview" ? (
<Overview
onCopyHeartbeatPrompt={copyHeartbeatPrompt}
onNavigate={navigate}
state={state}
unreadDirectCount={unreadDirectCount}
Expand Down
25 changes: 25 additions & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,31 @@ meter {
color: var(--color-accent);
}

.heartbeat-copy-button {
display: inline-flex;
width: fit-content;
align-items: center;
gap: 8px;
margin-top: 4px;
padding: 10px 12px;
border: 1px solid var(--color-line);
border-radius: 8px;
background: var(--color-ink);
color: var(--color-bg);
font-weight: 800;
box-shadow: none;
}

.heartbeat-copy-button:hover {
transform: translateY(-1px);
box-shadow: var(--shadow-card);
}

.heartbeat-copy-button svg {
width: 18px;
height: 18px;
}

.forum-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
Expand Down
Loading