@adhdev/daemon-core 0.9.76-rc.56 → 0.9.76-rc.58

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.
@@ -56,12 +56,24 @@ export interface RepoMeshPolicy {
56
56
  */
57
57
  sessionCleanupOnNodeRemove?: RepoMeshSessionCleanupMode;
58
58
  }
59
+ export interface RepoMeshRelatedRepo {
60
+ /** Stable display label for an explicitly configured associated checkout. */
61
+ label: string;
62
+ /** Absolute checkout/workspace path for git freshness probes. */
63
+ workspace: string;
64
+ }
59
65
  export interface RepoMeshNodePolicy {
60
66
  readOnly?: boolean;
61
67
  canPush?: boolean;
62
68
  maxConcurrentSessions?: number;
63
69
  /** Ordered provider preference used when mesh_launch_session omits an explicit type. */
64
70
  providerPriority?: string[];
71
+ /**
72
+ * Optional associated/external repos that must be checked alongside this node.
73
+ * These are explicit policy/config entries only; Repo Mesh does not auto-discover
74
+ * sibling paths so freshness checks stay fail-closed and non-surprising.
75
+ */
76
+ relatedRepos?: RepoMeshRelatedRepo[];
65
77
  }
66
78
  export declare const DEFAULT_MESH_POLICY: RepoMeshPolicy;
67
79
  export interface RepoMeshNodeCapabilities {
@@ -162,6 +174,8 @@ export interface LocalMeshNodeEntry {
162
174
  worktreeBranch?: string;
163
175
  /** Node ID this worktree was cloned from */
164
176
  clonedFromNodeId?: string;
177
+ /** Optional associated/external repos configured as node metadata. */
178
+ relatedRepos?: RepoMeshRelatedRepo[];
165
179
  }
166
180
  export interface RepoMeshStatus {
167
181
  meshId: string;
package/dist/types.d.ts CHANGED
@@ -42,6 +42,15 @@ export interface ChatMessage {
42
42
  /** Optional: fiber metadata */
43
43
  _type?: string;
44
44
  _sub?: string;
45
+ /** Transcript visibility/audience contract for separating chat-visible content from internal/debug runtime rows. */
46
+ visibility?: 'visible' | 'user' | 'chat' | 'hidden' | 'debug' | 'internal' | (string & {});
47
+ transcriptVisibility?: 'visible' | 'user' | 'chat' | 'hidden' | 'debug' | 'internal' | (string & {});
48
+ audience?: 'chat' | 'debug' | 'trace' | 'internal' | (string & {});
49
+ source?: 'assistant_text' | 'tool_call' | 'terminal_command' | 'runtime_activity' | 'runtime_status' | 'provider_chrome' | 'control' | (string & {});
50
+ userFacing?: boolean;
51
+ internal?: boolean;
52
+ isInternal?: boolean;
53
+ debug?: boolean;
45
54
  /** Meta information for thought/terminal logs etc */
46
55
  meta?: {
47
56
  label?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "0.9.76-rc.56",
3
+ "version": "0.9.76-rc.58",
4
4
  "description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -88,6 +88,7 @@ export type {
88
88
  RepoMeshNodeHealth,
89
89
  RepoMeshPolicy,
90
90
  RepoMeshNodePolicy,
91
+ RepoMeshRelatedRepo,
91
92
  RepoMeshNodeCapabilities,
92
93
  DetectedCommand,
93
94
  ProjectContextSnapshot,
@@ -145,8 +145,8 @@ const WORKFLOW_SECTION = `## Orchestration Workflow
145
145
  b. If you need branch isolation for parallel work, call \`mesh_clone_node\` to create a worktree node first.
146
146
  c. If no session exists, call \`mesh_launch_session\` to start one.
147
147
  d. Call \`mesh_send_task\` with a **complete, self-contained** instruction that includes all context the agent needs (file paths, line numbers, what to change, why). Do not send partial instructions expecting future follow-up.
148
- 4. **Monitor** — Periodically call \`mesh_read_chat\` to check progress. Handle approvals via \`mesh_approve\`.
149
- 5. **Verify** — When a task reports completion, call \`mesh_git_status\` to verify changes were made.
148
+ 4. **Monitor** — Prefer event-driven completion/status notifications. Do **not** poll \`mesh_read_chat\` repeatedly just because the delegated session has not produced a final assistant message yet; tool/terminal activity means work may still be in progress. Use at most one compact \`mesh_read_chat\` check after a completion/approval signal, an explicit user status request, or a real timeout/stall. Handle approvals via \`mesh_approve\`.
149
+ 5. **Verify** — When a task reports completion or git work is visible, call \`mesh_git_status\` to verify changes were made.
150
150
  6. **Checkpoint** — Call \`mesh_checkpoint\` to save the work.
151
151
  7. **Clean up** — Remove worktree nodes via \`mesh_remove_node\` after their work is merged or no longer needed.
152
152
  8. **Report** — Summarize what was done, what changed, and any issues.`;
@@ -162,8 +162,8 @@ function buildRulesSection(coordinatorCliType?: string): string {
162
162
  - **Delegate analysis too.** If you need to understand a bug or explore the codebase, send that investigation as a task to a node. Do not do it yourself.
163
163
  - **Respect explicit provider requests.** If the user names an agent/provider, pass the matching provider type to \`mesh_launch_session\`: Hermes → \`hermes-cli\`, Claude Code/Claude → \`claude-cli\`, Codex → \`codex-cli\`, Gemini → \`gemini-cli\`. Never substitute \`claude-cli\` just because the coordinator itself is Claude Code.
164
164
  - **Front-load the task message.** When calling \`mesh_send_task\`, include everything the agent needs: what files to touch, what the problem is, what the fix should look like. The agent won't ask follow-up questions.
165
- - **Don't inspect code.** Trust the agent's output. Verify via \`mesh_git_status\`, not by reading source files.
166
- - **Don't over-parallelize.** Start with 1-2 concurrent tasks. Scale up if they succeed.
165
+ - **Don't inspect code.** Treat delegated agent summaries as self-reports, not verification. Verify side effects via \`mesh_git_status\` (including related repo freshness when configured), not by reading source files.
166
+ - **Don't over-parallelize.** Start with 1-2 concurrent tasks. Scale up if they succeed. Never launch a duplicate session or second worker solely because \`mesh_read_chat\` has no final assistant message while the delegated session is still showing tool/terminal activity.
167
167
  - **Handle failures gracefully.** If a task fails, read the chat to understand why, then retry or reassign.
168
168
  - **Keep the user informed.** Report progress after each delegation round — one or two sentences, not a narration.
169
169
  - **Respect node capabilities.** Don't send build tasks to read-only nodes. Don't push from nodes that aren't allowed to.
@@ -183,11 +183,16 @@ function readStringField(value: unknown): string {
183
183
  return typeof value === 'string' ? value.trim().toLowerCase() : '';
184
184
  }
185
185
 
186
+ function readVisibilityField(message: ChatMessage, meta: Record<string, unknown> | null): string {
187
+ const record = message as ChatMessage & Record<string, unknown>;
188
+ return readStringField(record.visibility ?? record.transcriptVisibility ?? meta?.visibility ?? meta?.transcriptVisibility);
189
+ }
190
+
186
191
  function isExplicitlyHiddenFromTranscript(message: ChatMessage, meta: Record<string, unknown> | null): boolean {
187
192
  const record = message as ChatMessage & Record<string, unknown>;
188
- const visibility = readStringField(record.visibility || meta?.visibility || meta?.transcriptVisibility);
189
- const audience = readStringField(record.audience || meta?.audience);
190
- const source = readStringField(record.source || meta?.source);
193
+ const visibility = readVisibilityField(message, meta);
194
+ const audience = readStringField(record.audience ?? meta?.audience);
195
+ const source = readStringField(record.source ?? meta?.source);
191
196
 
192
197
  return visibility === 'hidden'
193
198
  || visibility === 'debug'
@@ -196,6 +201,7 @@ function isExplicitlyHiddenFromTranscript(message: ChatMessage, meta: Record<str
196
201
  || audience === 'trace'
197
202
  || audience === 'internal'
198
203
  || source === 'runtime_status'
204
+ || source === 'runtime_activity'
199
205
  || source === 'provider_chrome'
200
206
  || source === 'control'
201
207
  || record.internal === true
@@ -210,10 +216,11 @@ function isExplicitlyHiddenFromTranscript(message: ChatMessage, meta: Record<str
210
216
 
211
217
  function isExplicitlyVisibleInTranscript(message: ChatMessage, meta: Record<string, unknown> | null): boolean {
212
218
  const record = message as ChatMessage & Record<string, unknown>;
213
- const visibility = readStringField(record.visibility || meta?.visibility || meta?.transcriptVisibility);
214
- const audience = readStringField(record.audience || meta?.audience);
219
+ const visibility = readVisibilityField(message, meta);
220
+ const audience = readStringField(record.audience ?? meta?.audience);
215
221
  return visibility === 'visible'
216
222
  || visibility === 'user'
223
+ || visibility === 'chat'
217
224
  || audience === 'chat'
218
225
  || record.userFacing === true
219
226
  || meta?.userFacing === true;
@@ -77,6 +77,14 @@ function validateMessage(message: unknown, source: string, index: number): ChatM
77
77
  if (typeof message.senderName === 'string') normalized.senderName = message.senderName
78
78
  if (typeof (message as any)._type === 'string') normalized._type = (message as any)._type
79
79
  if (typeof (message as any)._sub === 'string') normalized._sub = (message as any)._sub
80
+ if (typeof (message as any).visibility === 'string') normalized.visibility = (message as any).visibility
81
+ if (typeof (message as any).transcriptVisibility === 'string') normalized.transcriptVisibility = (message as any).transcriptVisibility
82
+ if (typeof (message as any).audience === 'string') normalized.audience = (message as any).audience
83
+ if (typeof (message as any).source === 'string') normalized.source = (message as any).source
84
+ if (typeof (message as any).userFacing === 'boolean') normalized.userFacing = (message as any).userFacing
85
+ if (typeof (message as any).internal === 'boolean') normalized.internal = (message as any).internal
86
+ if (typeof (message as any).isInternal === 'boolean') normalized.isInternal = (message as any).isInternal
87
+ if (typeof (message as any).debug === 'boolean') normalized.debug = (message as any).debug
80
88
 
81
89
  return normalized
82
90
  }
@@ -73,12 +73,25 @@ export interface RepoMeshPolicy {
73
73
  sessionCleanupOnNodeRemove?: RepoMeshSessionCleanupMode;
74
74
  }
75
75
 
76
+ export interface RepoMeshRelatedRepo {
77
+ /** Stable display label for an explicitly configured associated checkout. */
78
+ label: string;
79
+ /** Absolute checkout/workspace path for git freshness probes. */
80
+ workspace: string;
81
+ }
82
+
76
83
  export interface RepoMeshNodePolicy {
77
84
  readOnly?: boolean;
78
85
  canPush?: boolean;
79
86
  maxConcurrentSessions?: number;
80
87
  /** Ordered provider preference used when mesh_launch_session omits an explicit type. */
81
88
  providerPriority?: string[];
89
+ /**
90
+ * Optional associated/external repos that must be checked alongside this node.
91
+ * These are explicit policy/config entries only; Repo Mesh does not auto-discover
92
+ * sibling paths so freshness checks stay fail-closed and non-surprising.
93
+ */
94
+ relatedRepos?: RepoMeshRelatedRepo[];
82
95
  }
83
96
 
84
97
  export const DEFAULT_MESH_POLICY: RepoMeshPolicy = {
@@ -204,6 +217,8 @@ export interface LocalMeshNodeEntry {
204
217
  worktreeBranch?: string;
205
218
  /** Node ID this worktree was cloned from */
206
219
  clonedFromNodeId?: string;
220
+ /** Optional associated/external repos configured as node metadata. */
221
+ relatedRepos?: RepoMeshRelatedRepo[];
207
222
  }
208
223
 
209
224
  // ─── Mesh Status (runtime, not persisted) ───────
package/src/types.ts CHANGED
@@ -49,6 +49,15 @@ export interface ChatMessage {
49
49
  /** Optional: fiber metadata */
50
50
  _type?: string;
51
51
  _sub?: string;
52
+ /** Transcript visibility/audience contract for separating chat-visible content from internal/debug runtime rows. */
53
+ visibility?: 'visible' | 'user' | 'chat' | 'hidden' | 'debug' | 'internal' | (string & {});
54
+ transcriptVisibility?: 'visible' | 'user' | 'chat' | 'hidden' | 'debug' | 'internal' | (string & {});
55
+ audience?: 'chat' | 'debug' | 'trace' | 'internal' | (string & {});
56
+ source?: 'assistant_text' | 'tool_call' | 'terminal_command' | 'runtime_activity' | 'runtime_status' | 'provider_chrome' | 'control' | (string & {});
57
+ userFacing?: boolean;
58
+ internal?: boolean;
59
+ isInternal?: boolean;
60
+ debug?: boolean;
52
61
  /** Meta information for thought/terminal logs etc */
53
62
  meta?: { label?: string; isRunning?: boolean } | Record<string, any>;
54
63
  /** Sender name for shared sessions */