teamshare-bridge 0.30.1 → 0.30.3
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/README.md +10 -6
- package/dist/bridge/daemon-inbox.js +27 -0
- package/dist/bridge/daemon-inbox.js.map +1 -1
- package/dist/bridge/daemon.js +16 -0
- package/dist/bridge/daemon.js.map +1 -1
- package/dist/bridge/doctor.js +3 -2
- package/dist/bridge/doctor.js.map +1 -1
- package/dist/cli/commands/blog.js +6 -1
- package/dist/cli/commands/blog.js.map +1 -1
- package/dist/cli/commands/board.js +5 -1
- package/dist/cli/commands/board.js.map +1 -1
- package/dist/cli/commands/build.js +10 -2
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/chat.js +1 -1
- package/dist/cli/commands/chat.js.map +1 -1
- package/dist/cli/commands/doc.js +5 -1
- package/dist/cli/commands/doc.js.map +1 -1
- package/dist/cli/commands/git.d.ts +1 -0
- package/dist/cli/commands/git.js +68 -0
- package/dist/cli/commands/git.js.map +1 -0
- package/dist/cli/commands/insight.js +6 -1
- package/dist/cli/commands/insight.js.map +1 -1
- package/dist/cli/commands/planner.js +1 -0
- package/dist/cli/commands/planner.js.map +1 -1
- package/dist/cli/commands/research.d.ts +8 -0
- package/dist/cli/commands/research.js +30 -3
- package/dist/cli/commands/research.js.map +1 -1
- package/dist/cli/commands/run.js +1 -0
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/worker.js +9 -1
- package/dist/cli/commands/worker.js.map +1 -1
- package/dist/cli/commands/workflow-author.js +1 -1
- package/dist/cli/commands/workflow-author.js.map +1 -1
- package/dist/cli/commands/workflow.js +4 -0
- package/dist/cli/commands/workflow.js.map +1 -1
- package/dist/cli/index.js +7 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/lib/api-agents.d.ts +84 -0
- package/dist/lib/api-agents.js +22 -0
- package/dist/lib/api-agents.js.map +1 -1
- package/dist/lib/api-types.d.ts +10 -0
- package/dist/lib/api.d.ts +14 -11
- package/dist/lib/api.js +12 -5
- package/dist/lib/api.js.map +1 -1
- package/dist/lib/brief.d.ts +6 -0
- package/dist/lib/brief.js +14 -0
- package/dist/lib/brief.js.map +1 -1
- package/dist/lib/chat/board-reply.js +15 -2
- package/dist/lib/chat/board-reply.js.map +1 -1
- package/dist/lib/chat/chat-reply.d.ts +7 -1
- package/dist/lib/chat/chat-reply.js +21 -2
- package/dist/lib/chat/chat-reply.js.map +1 -1
- package/dist/lib/chat/doc-reply.js +16 -2
- package/dist/lib/chat/doc-reply.js.map +1 -1
- package/dist/lib/coord/format.d.ts +143 -0
- package/dist/lib/coord/format.js +398 -0
- package/dist/lib/coord/format.js.map +1 -0
- package/dist/lib/coord/guidance.d.ts +21 -0
- package/dist/lib/coord/guidance.js +110 -0
- package/dist/lib/coord/guidance.js.map +1 -0
- package/dist/lib/coord/index.d.ts +12 -0
- package/dist/lib/coord/index.js +38 -0
- package/dist/lib/coord/index.js.map +1 -0
- package/dist/lib/coord/monitor.d.ts +180 -0
- package/dist/lib/coord/monitor.js +746 -0
- package/dist/lib/coord/monitor.js.map +1 -0
- package/dist/lib/coord/paths.d.ts +20 -0
- package/dist/lib/coord/paths.js +76 -0
- package/dist/lib/coord/paths.js.map +1 -0
- package/dist/lib/coord/store.d.ts +13 -0
- package/dist/lib/coord/store.js +104 -0
- package/dist/lib/coord/store.js.map +1 -0
- package/dist/lib/git/git-naming.js +4 -0
- package/dist/lib/git/git-naming.js.map +1 -1
- package/dist/lib/git/git-pull.d.ts +35 -0
- package/dist/lib/git/git-pull.js +233 -0
- package/dist/lib/git/git-pull.js.map +1 -0
- package/dist/lib/harness/harness-adapter.js +7 -0
- package/dist/lib/harness/harness-adapter.js.map +1 -1
- package/dist/lib/lock.d.ts +8 -0
- package/dist/lib/lock.js.map +1 -1
- package/dist/lib/scope-guard.js +9 -1
- package/dist/lib/scope-guard.js.map +1 -1
- package/dist/lib/workspace/stop-marker.d.ts +52 -0
- package/dist/lib/workspace/stop-marker.js +92 -0
- package/dist/lib/workspace/stop-marker.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { type BoardMemberView } from './format';
|
|
2
|
+
export interface CoordTaskRef {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
projectId: string;
|
|
6
|
+
project?: {
|
|
7
|
+
name?: string | null;
|
|
8
|
+
} | null;
|
|
9
|
+
}
|
|
10
|
+
export interface CoordRemoteMember {
|
|
11
|
+
id: string;
|
|
12
|
+
sessionKey: string;
|
|
13
|
+
agentId: string | null;
|
|
14
|
+
agentUserId: string | null;
|
|
15
|
+
agentName: string | null;
|
|
16
|
+
machineId: string | null;
|
|
17
|
+
machineLabel: string | null;
|
|
18
|
+
mode: string;
|
|
19
|
+
taskId: string | null;
|
|
20
|
+
status: string;
|
|
21
|
+
summary: string;
|
|
22
|
+
areas: string[];
|
|
23
|
+
derived: Record<string, unknown> | null;
|
|
24
|
+
startedAt: string;
|
|
25
|
+
lastSeenAt: string;
|
|
26
|
+
endedAt: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface CoordRemoteNote {
|
|
29
|
+
id: string;
|
|
30
|
+
seq: number;
|
|
31
|
+
kind: string;
|
|
32
|
+
authorId: string | null;
|
|
33
|
+
authorName: string | null;
|
|
34
|
+
authorKind: string;
|
|
35
|
+
toAgentId: string | null;
|
|
36
|
+
body: string;
|
|
37
|
+
urgent: boolean;
|
|
38
|
+
createdAt: string;
|
|
39
|
+
}
|
|
40
|
+
export interface CoordRemoteBoard {
|
|
41
|
+
board: {
|
|
42
|
+
status: string;
|
|
43
|
+
lastSyncAt: string;
|
|
44
|
+
closedAt: string | null;
|
|
45
|
+
} | null;
|
|
46
|
+
members: CoordRemoteMember[];
|
|
47
|
+
notes: CoordRemoteNote[];
|
|
48
|
+
cursor: number;
|
|
49
|
+
}
|
|
50
|
+
/** The slice of the per-agent API client this monitor needs. */
|
|
51
|
+
export interface CoordApi {
|
|
52
|
+
getTask(taskId: string): Promise<CoordTaskRef>;
|
|
53
|
+
pushCoordination(agentId: string, body: CoordPushBody): Promise<{
|
|
54
|
+
boardId: string;
|
|
55
|
+
status: string;
|
|
56
|
+
members: number;
|
|
57
|
+
}>;
|
|
58
|
+
getProjectCoordination(projectId: string): Promise<CoordRemoteBoard>;
|
|
59
|
+
createSelfInstruction(scope: {
|
|
60
|
+
projectId?: string | null;
|
|
61
|
+
taskId?: string | null;
|
|
62
|
+
body: string;
|
|
63
|
+
}): Promise<unknown>;
|
|
64
|
+
/** Optional: resolves the agent's display name once per project run. */
|
|
65
|
+
getAgentSettings?(agentId: string): Promise<{
|
|
66
|
+
agentName?: string | null;
|
|
67
|
+
}>;
|
|
68
|
+
}
|
|
69
|
+
export interface CoordPushBody {
|
|
70
|
+
projectId: string;
|
|
71
|
+
machineId: string;
|
|
72
|
+
machineLabel: string;
|
|
73
|
+
members: Array<{
|
|
74
|
+
sessionKey: string;
|
|
75
|
+
agentId: string;
|
|
76
|
+
agentName?: string | null;
|
|
77
|
+
mode: string;
|
|
78
|
+
taskId?: string | null;
|
|
79
|
+
status: string;
|
|
80
|
+
summary: string;
|
|
81
|
+
areas: string[];
|
|
82
|
+
derived?: Record<string, unknown> | null;
|
|
83
|
+
startedAt: string;
|
|
84
|
+
endedAt?: string | null;
|
|
85
|
+
}>;
|
|
86
|
+
notes: Array<{
|
|
87
|
+
clientId: string;
|
|
88
|
+
kind: string;
|
|
89
|
+
authorId?: string | null;
|
|
90
|
+
authorName?: string | null;
|
|
91
|
+
authorKind: 'agent' | 'human' | 'system';
|
|
92
|
+
toAgentId?: string | null;
|
|
93
|
+
body: string;
|
|
94
|
+
urgent: boolean;
|
|
95
|
+
createdAt: string;
|
|
96
|
+
}>;
|
|
97
|
+
}
|
|
98
|
+
export interface CoordAgentBinding {
|
|
99
|
+
agentId: string;
|
|
100
|
+
agentName?: string | null;
|
|
101
|
+
api: CoordApi;
|
|
102
|
+
}
|
|
103
|
+
export interface CoordMonitorOptions {
|
|
104
|
+
/** Current bindings; called every tick so a hot-added agent is picked up. */
|
|
105
|
+
agents: () => CoordAgentBinding[];
|
|
106
|
+
log: (message: string) => void;
|
|
107
|
+
intervalMs?: number;
|
|
108
|
+
/** Minimum gap between hub pushes (a transition pushes immediately). */
|
|
109
|
+
pushFloorMs?: number;
|
|
110
|
+
/** How often another PC's roster is fetched while a local agent is live. */
|
|
111
|
+
remoteRefreshMs?: number;
|
|
112
|
+
/** Liveness probe for an agent session (defaults to the session lock). */
|
|
113
|
+
isLive?: (agentId: string) => boolean;
|
|
114
|
+
}
|
|
115
|
+
export declare class CoordinationMonitor {
|
|
116
|
+
private readonly opts;
|
|
117
|
+
private timer?;
|
|
118
|
+
private running;
|
|
119
|
+
private readonly intervalMs;
|
|
120
|
+
private readonly pushFloorMs;
|
|
121
|
+
private readonly remoteRefreshMs;
|
|
122
|
+
private readonly taskCache;
|
|
123
|
+
/** Agent display names, resolved once per 30 min (no config field for it). */
|
|
124
|
+
private readonly names;
|
|
125
|
+
/**
|
|
126
|
+
* Urgent-nudge cooldown per `sender>target`, in memory only. The note-text
|
|
127
|
+
* dedupe is the durable guard; this only stops a status file that is rewritten
|
|
128
|
+
* every few seconds from nudging the same agent repeatedly.
|
|
129
|
+
*/
|
|
130
|
+
private readonly nudges;
|
|
131
|
+
/** Projects processed last tick, so a closing board is still visited. */
|
|
132
|
+
private known;
|
|
133
|
+
/** Per-tick dirty flag per project (drives the push floor). */
|
|
134
|
+
private dirty;
|
|
135
|
+
constructor(opts: CoordMonitorOptions);
|
|
136
|
+
/** Session liveness: the bridge's lock is the one signal every mode keeps. */
|
|
137
|
+
private readonly isLive;
|
|
138
|
+
start(): void;
|
|
139
|
+
stop(): void;
|
|
140
|
+
/** One pass. Public so tests (and `doctor`) can drive it deterministically. */
|
|
141
|
+
tick(now?: number): Promise<void>;
|
|
142
|
+
/**
|
|
143
|
+
* Live members come from the SESSION LOCKS, not from a register call: a lock
|
|
144
|
+
* with a live pid is the one piece of state every CLI command already keeps,
|
|
145
|
+
* so no spawn path needs to know this feature exists.
|
|
146
|
+
*/
|
|
147
|
+
private collectLocals;
|
|
148
|
+
/**
|
|
149
|
+
* The agent's display name. `config.json` has no name field, so it is read
|
|
150
|
+
* once from the settings snapshot and cached for 30 minutes.
|
|
151
|
+
*/
|
|
152
|
+
private nameFor;
|
|
153
|
+
private lookupTask;
|
|
154
|
+
/** Project dirs that still need a visit (an open board with no live agent). */
|
|
155
|
+
private listProjectDirs;
|
|
156
|
+
private processProject;
|
|
157
|
+
/**
|
|
158
|
+
* Turns the `to:` + notes text of one agent's status file into peer notes.
|
|
159
|
+
* Returns how many ledger rows were created.
|
|
160
|
+
*/
|
|
161
|
+
private fanOut;
|
|
162
|
+
private appendLedger;
|
|
163
|
+
/**
|
|
164
|
+
* ONE deduped self-instruction for an urgent note. This is the same channel
|
|
165
|
+
* the stall watchdog uses: no wake, no spawn, no queue for an offline agent,
|
|
166
|
+
* and the agent decides what to do with it. Cooldown is per sender -> target.
|
|
167
|
+
*/
|
|
168
|
+
private nudge;
|
|
169
|
+
private pushProject;
|
|
170
|
+
private fetchRemote;
|
|
171
|
+
/**
|
|
172
|
+
* A note another PC addressed to an agent HERE must land in that agent's
|
|
173
|
+
* local inbox, or a cross-machine colleague could never be reached.
|
|
174
|
+
*/
|
|
175
|
+
private absorbRemoteNotes;
|
|
176
|
+
/** Deletes a project's local tree a while after its board closed. */
|
|
177
|
+
private sweepLocal;
|
|
178
|
+
/** Overlap pairs for the current board (used by the renderer and tests). */
|
|
179
|
+
overlapsFor(members: BoardMemberView[]): import("./format").OverlapPair[];
|
|
180
|
+
}
|