@oeronteros-1/opencode-orchestra 1.0.12 → 1.0.14
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 +53 -3
- package/dashboard-dist/assets/{index-j0b0ZK2D.css → index-DZoh4Zv5.css} +1 -1
- package/dashboard-dist/assets/{index-B_C9E9V_.js → index-Dv3Y43qS.js} +1 -1
- package/dashboard-dist/index.html +2 -2
- package/dist/agents/build.js +2 -0
- package/dist/agents/build.js.map +1 -1
- package/dist/agents/lead.js +2 -1
- package/dist/agents/lead.js.map +1 -1
- package/dist/agents/merge.d.ts +4 -0
- package/dist/agents/merge.js +22 -0
- package/dist/agents/merge.js.map +1 -0
- package/dist/dashboard/server.js +92 -4
- package/dist/dashboard/server.js.map +1 -1
- package/dist/index.js +71 -3
- package/dist/index.js.map +1 -1
- package/dist/routing/planner.d.ts +5 -5
- package/dist/routing/planner.js +73 -75
- package/dist/routing/planner.js.map +1 -1
- package/dist/telemetry/live.d.ts +154 -0
- package/dist/telemetry/live.js +248 -0
- package/dist/telemetry/live.js.map +1 -0
- package/dist/tools.js +3 -2
- package/dist/tools.js.map +1 -1
- package/package.json +1 -1
- package/prompts/lead.md +5 -4
- package/CHANGELOG.md +0 -86
- package/GITHUB_RELEASE_1.0.0.md +0 -84
- package/GITHUB_RELEASE_1.0.7.md +0 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner.js","sourceRoot":"","sources":["../../src/routing/planner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"planner.js","sourceRoot":"","sources":["../../src/routing/planner.ts"],"names":[],"mappings":"AAmBA,MAAM,eAAe,GAA2C;IAC9D,YAAY,EAAE,CAAC,WAAW,EAAE,eAAe,EAAE,aAAa,CAAC;IAC3D,KAAK,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,aAAa,CAAC;IACjD,EAAE,EAAE,CAAC,uBAAuB,EAAE,oBAAoB,EAAE,WAAW,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AK,MAAM,GAAG,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACjC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,iCAAiC,GAAG,GAAG,CAAC,CAAA;iBACpF,IAAI,GAAG,KAAK,EAAE;gBAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,oBAAoB,CAAC,CAAA;;gBAClE,KAAK,CAAC,GAAG,CAAC,CAAA;QACjB,CAAC;QACD,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IACtC,CAAC,CAAA;IACD,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK;QAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC7C,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAA;AAC/B,CAAC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live orchestration activity feed.
|
|
3
|
+
*
|
|
4
|
+
* The OpenCode plugin and the standalone dashboard server run in separate
|
|
5
|
+
* processes, so live state is bridged over the filesystem exactly like the
|
|
6
|
+
* usage ledger. The plugin feeds this stream while agents generate (start /
|
|
7
|
+
* delta / finish) and the dashboard's SSE endpoint re-reads the small snapshot
|
|
8
|
+
* file on a poll, diffing it by a monotonic sequence number.
|
|
9
|
+
*
|
|
10
|
+
* The persisted file is intentionally a full snapshot (active agents + a short
|
|
11
|
+
* ring of recent events) rather than an unbounded log, so a freshly connected
|
|
12
|
+
* dashboard client can read the whole thing with no tailing/trimming logic.
|
|
13
|
+
* The `active` array is authoritative for what is running right now; `recent`
|
|
14
|
+
* is a rolling event log used to animate the UI. Flushes to disk are throttled,
|
|
15
|
+
* and start/finish flush immediately so state changes appear promptly.
|
|
16
|
+
*/
|
|
17
|
+
/** Per-million-token USD prices for a resolved model. */
|
|
18
|
+
export interface LiveTokenPrice {
|
|
19
|
+
input: number;
|
|
20
|
+
output: number;
|
|
21
|
+
}
|
|
22
|
+
/** An event appended to the stream (start / delta / finish). */
|
|
23
|
+
export type LiveEventKind = "start" | "delta" | "finish";
|
|
24
|
+
export interface LiveEvent {
|
|
25
|
+
/** Monotonic sequence; used by the dashboard as its diffing cursor. */
|
|
26
|
+
seq: number;
|
|
27
|
+
e: LiveEventKind;
|
|
28
|
+
/** Epoch ms the event was produced. */
|
|
29
|
+
ts: number;
|
|
30
|
+
/** Orchestration message id the activity belongs to. */
|
|
31
|
+
k: string;
|
|
32
|
+
sessionID?: string | undefined;
|
|
33
|
+
agent?: string | undefined;
|
|
34
|
+
model?: string | undefined;
|
|
35
|
+
provider?: string | undefined;
|
|
36
|
+
/** Current snippet of what the agent produced (what it is "doing"). */
|
|
37
|
+
text?: string | undefined;
|
|
38
|
+
/** USD cost-so-far (delta carries the running estimate; finish the actual). */
|
|
39
|
+
cost?: number | undefined;
|
|
40
|
+
/** Tokens-so-far (delta estimate) or finalized tokens (finish). */
|
|
41
|
+
tokens?: {
|
|
42
|
+
input: number;
|
|
43
|
+
output: number;
|
|
44
|
+
reasoning: number;
|
|
45
|
+
} | undefined;
|
|
46
|
+
/** Finalization reason, present on finish events. */
|
|
47
|
+
finish?: string | undefined;
|
|
48
|
+
/** Stream-observer confidence + flags, present on flagged deltas. */
|
|
49
|
+
confidence?: number | undefined;
|
|
50
|
+
flags?: string[] | undefined;
|
|
51
|
+
}
|
|
52
|
+
/** An agent currently generating. */
|
|
53
|
+
export interface LiveActiveAgent {
|
|
54
|
+
key: string;
|
|
55
|
+
sessionID?: string | undefined;
|
|
56
|
+
agent?: string | undefined;
|
|
57
|
+
model?: string | undefined;
|
|
58
|
+
provider?: string | undefined;
|
|
59
|
+
/** Epoch ms the agent started responding. */
|
|
60
|
+
startedAt: number;
|
|
61
|
+
/** Last-seen snippet of the in-progress output. */
|
|
62
|
+
text: string;
|
|
63
|
+
/** Estimated USD accrued while still generating. */
|
|
64
|
+
cost: number;
|
|
65
|
+
tokens: {
|
|
66
|
+
input: number;
|
|
67
|
+
output: number;
|
|
68
|
+
reasoning: number;
|
|
69
|
+
};
|
|
70
|
+
confidence?: number | undefined;
|
|
71
|
+
flags?: string[] | undefined;
|
|
72
|
+
}
|
|
73
|
+
export interface LiveSnapshot {
|
|
74
|
+
version: 1;
|
|
75
|
+
/** Epoch ms the snapshot was last written. */
|
|
76
|
+
updatedAt: number;
|
|
77
|
+
/** Maximum sequence emitted so far. */
|
|
78
|
+
seq: number;
|
|
79
|
+
/** Agents currently generating. */
|
|
80
|
+
active: LiveActiveAgent[];
|
|
81
|
+
/** Rolling event log (newest last). */
|
|
82
|
+
recent: LiveEvent[];
|
|
83
|
+
}
|
|
84
|
+
export declare function emptyLiveSnapshot(): LiveSnapshot;
|
|
85
|
+
/** Parse the persisted live snapshot; returns an empty snapshot on failure. */
|
|
86
|
+
export declare function parseLiveSnapshot(text: string): LiveSnapshot;
|
|
87
|
+
/** Estimate output tokens from character count (≈4 chars/token). */
|
|
88
|
+
export declare function estimateOutputTokens(chars: number): number;
|
|
89
|
+
/** Estimate live USD accrued from accumulated text + assumed input volume. */
|
|
90
|
+
export declare function estimateLiveCost(chars: number, price: LiveTokenPrice | undefined, assumedInput?: number): {
|
|
91
|
+
cost: number;
|
|
92
|
+
input: number;
|
|
93
|
+
output: number;
|
|
94
|
+
};
|
|
95
|
+
export declare class LiveStream {
|
|
96
|
+
readonly liveFile: string;
|
|
97
|
+
private readonly maxRecent;
|
|
98
|
+
private readonly throttleMs;
|
|
99
|
+
private readonly estimatePrice;
|
|
100
|
+
private active;
|
|
101
|
+
private recent;
|
|
102
|
+
private seq;
|
|
103
|
+
private queue;
|
|
104
|
+
private timer;
|
|
105
|
+
private lastWrite;
|
|
106
|
+
private dirty;
|
|
107
|
+
private enabled;
|
|
108
|
+
constructor(directory: string, telemetryDirectory: string, enabled: boolean, estimatePrice?: (provider: string | undefined, model: string | undefined) => LiveTokenPrice | undefined, maxRecent?: number, throttleMs?: number);
|
|
109
|
+
private makeEvent;
|
|
110
|
+
/** Mark an agent message as started generating. */
|
|
111
|
+
start(input: {
|
|
112
|
+
key: string;
|
|
113
|
+
sessionID?: string | undefined;
|
|
114
|
+
agent?: string | undefined;
|
|
115
|
+
provider?: string | undefined;
|
|
116
|
+
model?: string | undefined;
|
|
117
|
+
startedAt?: number;
|
|
118
|
+
}): void;
|
|
119
|
+
/**
|
|
120
|
+
* Append generated text for an in-flight agent. Each delta updates the
|
|
121
|
+
* in-memory state immediately and is appended to the rolling log; the disk
|
|
122
|
+
* flush is throttled by the class so the dashboard poll stays cheap.
|
|
123
|
+
*/
|
|
124
|
+
delta(input: {
|
|
125
|
+
key: string;
|
|
126
|
+
text: string;
|
|
127
|
+
sessionID?: string | undefined;
|
|
128
|
+
agent?: string | undefined;
|
|
129
|
+
provider?: string | undefined;
|
|
130
|
+
model?: string | undefined;
|
|
131
|
+
confidence?: number | undefined;
|
|
132
|
+
flags?: string[] | undefined;
|
|
133
|
+
}): void;
|
|
134
|
+
/** Mark an agent message as finished and remove it from the active set. */
|
|
135
|
+
finish(input: {
|
|
136
|
+
key: string;
|
|
137
|
+
cost: number;
|
|
138
|
+
tokens?: {
|
|
139
|
+
input: number;
|
|
140
|
+
output: number;
|
|
141
|
+
reasoning: number;
|
|
142
|
+
} | undefined;
|
|
143
|
+
finish?: string | undefined;
|
|
144
|
+
sessionID?: string | undefined;
|
|
145
|
+
agent?: string | undefined;
|
|
146
|
+
}): void;
|
|
147
|
+
/** The current snapshot (before the next disk flush). */
|
|
148
|
+
current(): LiveSnapshot;
|
|
149
|
+
private record;
|
|
150
|
+
private serialize;
|
|
151
|
+
private scheduleFlush;
|
|
152
|
+
private flush;
|
|
153
|
+
dispose(): Promise<void>;
|
|
154
|
+
}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { mkdir, rename, writeFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
const MAX_RECENT = 200;
|
|
4
|
+
const THROTTLE_MS = 450;
|
|
5
|
+
function emptySnapshot() {
|
|
6
|
+
return { version: 1, updatedAt: 0, seq: 0, active: [], recent: [] };
|
|
7
|
+
}
|
|
8
|
+
export function emptyLiveSnapshot() {
|
|
9
|
+
return emptySnapshot();
|
|
10
|
+
}
|
|
11
|
+
/** Parse the persisted live snapshot; returns an empty snapshot on failure. */
|
|
12
|
+
export function parseLiveSnapshot(text) {
|
|
13
|
+
try {
|
|
14
|
+
const parsed = JSON.parse(text);
|
|
15
|
+
if (typeof parsed !== "object" || parsed === null)
|
|
16
|
+
return emptySnapshot();
|
|
17
|
+
const candidate = parsed;
|
|
18
|
+
if (candidate.version !== 1)
|
|
19
|
+
return emptySnapshot();
|
|
20
|
+
return {
|
|
21
|
+
version: 1,
|
|
22
|
+
updatedAt: typeof candidate.updatedAt === "number" ? candidate.updatedAt : 0,
|
|
23
|
+
seq: typeof candidate.seq === "number" ? candidate.seq : 0,
|
|
24
|
+
active: Array.isArray(candidate.active) ? candidate.active : [],
|
|
25
|
+
recent: Array.isArray(candidate.recent) ? candidate.recent : [],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return emptySnapshot();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** Estimate output tokens from character count (≈4 chars/token). */
|
|
33
|
+
export function estimateOutputTokens(chars) {
|
|
34
|
+
return Math.max(0, Math.floor(chars / 4));
|
|
35
|
+
}
|
|
36
|
+
/** Estimate live USD accrued from accumulated text + assumed input volume. */
|
|
37
|
+
export function estimateLiveCost(chars, price, assumedInput = 1500) {
|
|
38
|
+
const output = estimateOutputTokens(chars);
|
|
39
|
+
const input = assumedInput;
|
|
40
|
+
let cost = 0;
|
|
41
|
+
if (price) {
|
|
42
|
+
cost = (input * price.input + output * price.output) / 1_000_000;
|
|
43
|
+
}
|
|
44
|
+
return { cost, input, output };
|
|
45
|
+
}
|
|
46
|
+
export class LiveStream {
|
|
47
|
+
liveFile;
|
|
48
|
+
maxRecent;
|
|
49
|
+
throttleMs;
|
|
50
|
+
estimatePrice;
|
|
51
|
+
active = new Map();
|
|
52
|
+
recent = [];
|
|
53
|
+
seq = 0;
|
|
54
|
+
queue = Promise.resolve();
|
|
55
|
+
timer;
|
|
56
|
+
lastWrite = 0;
|
|
57
|
+
dirty = false;
|
|
58
|
+
enabled;
|
|
59
|
+
constructor(directory, telemetryDirectory, enabled, estimatePrice = () => undefined, maxRecent = MAX_RECENT, throttleMs = THROTTLE_MS) {
|
|
60
|
+
this.liveFile = path.resolve(directory, telemetryDirectory, "live.ndjson");
|
|
61
|
+
this.enabled = enabled;
|
|
62
|
+
this.maxRecent = maxRecent;
|
|
63
|
+
this.throttleMs = throttleMs;
|
|
64
|
+
this.estimatePrice = estimatePrice;
|
|
65
|
+
}
|
|
66
|
+
makeEvent(input) {
|
|
67
|
+
const event = { seq: ++this.seq, ts: Date.now(), ...input };
|
|
68
|
+
this.recent.push(event);
|
|
69
|
+
if (this.recent.length > this.maxRecent)
|
|
70
|
+
this.recent.splice(0, this.recent.length - this.maxRecent);
|
|
71
|
+
return event;
|
|
72
|
+
}
|
|
73
|
+
/** Mark an agent message as started generating. */
|
|
74
|
+
start(input) {
|
|
75
|
+
if (!this.enabled)
|
|
76
|
+
return;
|
|
77
|
+
if (this.active.has(input.key)) {
|
|
78
|
+
this.scheduleFlush(true);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const price = this.estimatePrice(input.provider, input.model);
|
|
82
|
+
const est = estimateLiveCost(0, price);
|
|
83
|
+
this.active.set(input.key, {
|
|
84
|
+
key: input.key,
|
|
85
|
+
sessionID: input.sessionID,
|
|
86
|
+
agent: input.agent,
|
|
87
|
+
model: input.model,
|
|
88
|
+
provider: input.provider,
|
|
89
|
+
startedAt: input.startedAt ?? Date.now(),
|
|
90
|
+
text: "",
|
|
91
|
+
cost: est.cost,
|
|
92
|
+
tokens: { input: est.input, output: 0, reasoning: 0 },
|
|
93
|
+
lastSeq: this.seq,
|
|
94
|
+
});
|
|
95
|
+
this.makeEvent({
|
|
96
|
+
e: "start",
|
|
97
|
+
k: input.key,
|
|
98
|
+
sessionID: input.sessionID,
|
|
99
|
+
agent: input.agent,
|
|
100
|
+
model: input.model,
|
|
101
|
+
provider: input.provider,
|
|
102
|
+
text: "",
|
|
103
|
+
cost: 0,
|
|
104
|
+
tokens: undefined,
|
|
105
|
+
});
|
|
106
|
+
this.scheduleFlush(true);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Append generated text for an in-flight agent. Each delta updates the
|
|
110
|
+
* in-memory state immediately and is appended to the rolling log; the disk
|
|
111
|
+
* flush is throttled by the class so the dashboard poll stays cheap.
|
|
112
|
+
*/
|
|
113
|
+
delta(input) {
|
|
114
|
+
if (!this.enabled)
|
|
115
|
+
return;
|
|
116
|
+
const existing = this.active.get(input.key);
|
|
117
|
+
if (!existing) {
|
|
118
|
+
// No prior start for this key: synthesize one so the row is visible.
|
|
119
|
+
this.start({
|
|
120
|
+
key: input.key,
|
|
121
|
+
sessionID: input.sessionID,
|
|
122
|
+
agent: input.agent,
|
|
123
|
+
provider: input.provider,
|
|
124
|
+
model: input.model,
|
|
125
|
+
});
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (input.sessionID)
|
|
129
|
+
existing.sessionID = input.sessionID;
|
|
130
|
+
if (input.agent)
|
|
131
|
+
existing.agent = input.agent;
|
|
132
|
+
if (input.model)
|
|
133
|
+
existing.model = input.model;
|
|
134
|
+
if (input.provider)
|
|
135
|
+
existing.provider = input.provider;
|
|
136
|
+
const snippet = input.text.length > 240 ? `${input.text.slice(-240)}…` : input.text;
|
|
137
|
+
existing.text = snippet;
|
|
138
|
+
existing.confidence = input.confidence;
|
|
139
|
+
existing.flags = input.flags;
|
|
140
|
+
existing.lastSeq = this.seq;
|
|
141
|
+
const price = this.estimatePrice(input.provider ?? existing.provider, input.model ?? existing.model);
|
|
142
|
+
const est = estimateLiveCost(snippet.length, price);
|
|
143
|
+
existing.cost = est.cost;
|
|
144
|
+
existing.tokens = { input: est.input, output: est.output, reasoning: 0 };
|
|
145
|
+
this.record({
|
|
146
|
+
e: "delta",
|
|
147
|
+
k: input.key,
|
|
148
|
+
sessionID: existing.sessionID,
|
|
149
|
+
agent: existing.agent,
|
|
150
|
+
model: input.model ?? existing.model,
|
|
151
|
+
provider: input.provider ?? existing.provider,
|
|
152
|
+
text: snippet,
|
|
153
|
+
cost: existing.cost,
|
|
154
|
+
tokens: { input: existing.tokens.input, output: existing.tokens.output, reasoning: existing.tokens.reasoning },
|
|
155
|
+
confidence: input.confidence,
|
|
156
|
+
flags: input.flags,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
/** Mark an agent message as finished and remove it from the active set. */
|
|
160
|
+
finish(input) {
|
|
161
|
+
if (!this.enabled)
|
|
162
|
+
return;
|
|
163
|
+
const existing = this.active.get(input.key);
|
|
164
|
+
this.active.delete(input.key);
|
|
165
|
+
const tokens = input.tokens ?? existing?.tokens ?? { input: 0, output: 0, reasoning: 0 };
|
|
166
|
+
this.record({
|
|
167
|
+
e: "finish",
|
|
168
|
+
k: input.key,
|
|
169
|
+
sessionID: input.sessionID ?? existing?.sessionID,
|
|
170
|
+
agent: input.agent ?? existing?.agent,
|
|
171
|
+
model: existing?.model,
|
|
172
|
+
provider: existing?.provider,
|
|
173
|
+
cost: input.cost,
|
|
174
|
+
tokens,
|
|
175
|
+
finish: input.finish,
|
|
176
|
+
});
|
|
177
|
+
this.scheduleFlush(true);
|
|
178
|
+
}
|
|
179
|
+
/** The current snapshot (before the next disk flush). */
|
|
180
|
+
current() {
|
|
181
|
+
return this.serialize();
|
|
182
|
+
}
|
|
183
|
+
record(input) {
|
|
184
|
+
this.makeEvent(input);
|
|
185
|
+
this.scheduleFlush(false);
|
|
186
|
+
}
|
|
187
|
+
serialize() {
|
|
188
|
+
const active = [...this.active.values()]
|
|
189
|
+
.map(({ lastSeq: _lastSeq, ...rest }) => rest)
|
|
190
|
+
.sort((a, b) => a.startedAt - b.startedAt);
|
|
191
|
+
return {
|
|
192
|
+
version: 1,
|
|
193
|
+
updatedAt: this.lastWrite || Date.now(),
|
|
194
|
+
seq: this.seq,
|
|
195
|
+
active,
|
|
196
|
+
recent: [...this.recent],
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
scheduleFlush(immediate) {
|
|
200
|
+
if (!this.enabled)
|
|
201
|
+
return;
|
|
202
|
+
this.dirty = true;
|
|
203
|
+
if (immediate) {
|
|
204
|
+
if (this.timer) {
|
|
205
|
+
clearTimeout(this.timer);
|
|
206
|
+
this.timer = undefined;
|
|
207
|
+
}
|
|
208
|
+
void this.flush();
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (this.timer)
|
|
212
|
+
return;
|
|
213
|
+
const remaining = this.throttleMs - (Date.now() - this.lastWrite);
|
|
214
|
+
this.timer = setTimeout(() => {
|
|
215
|
+
this.timer = undefined;
|
|
216
|
+
void this.flush();
|
|
217
|
+
}, Math.max(20, remaining));
|
|
218
|
+
}
|
|
219
|
+
flush() {
|
|
220
|
+
this.dirty = false;
|
|
221
|
+
this.lastWrite = Date.now();
|
|
222
|
+
const snapshot = this.serialize();
|
|
223
|
+
this.queue = this.queue.then(async () => {
|
|
224
|
+
try {
|
|
225
|
+
const directory = path.dirname(this.liveFile);
|
|
226
|
+
await mkdir(directory, { recursive: true });
|
|
227
|
+
const temporary = `${this.liveFile}.tmp`;
|
|
228
|
+
await writeFile(temporary, JSON.stringify(snapshot) + "\n", "utf8");
|
|
229
|
+
await rename(temporary, this.liveFile);
|
|
230
|
+
}
|
|
231
|
+
catch {
|
|
232
|
+
// Live telemetry is best-effort; a failure must never break orchestration.
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
return this.queue;
|
|
236
|
+
}
|
|
237
|
+
async dispose() {
|
|
238
|
+
if (this.timer) {
|
|
239
|
+
clearTimeout(this.timer);
|
|
240
|
+
this.timer = undefined;
|
|
241
|
+
}
|
|
242
|
+
if (this.dirty)
|
|
243
|
+
await this.flush();
|
|
244
|
+
else
|
|
245
|
+
await this.queue;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
//# sourceMappingURL=live.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live.js","sourceRoot":"","sources":["../../src/telemetry/live.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,IAAI,MAAM,WAAW,CAAA;AAuF5B,MAAM,UAAU,GAAG,GAAG,CAAA;AACtB,MAAM,WAAW,GAAG,GAAG,CAAA;AAEvB,SAAS,aAAa;IACpB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAA;AACrE,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO,aAAa,EAAE,CAAA;AACxB,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAA;QAC1C,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI;YAAE,OAAO,aAAa,EAAE,CAAA;QACzE,MAAM,SAAS,GAAG,MAA+B,CAAA;QACjD,IAAI,SAAS,CAAC,OAAO,KAAK,CAAC;YAAE,OAAO,aAAa,EAAE,CAAA;QACnD,OAAO;YACL,OAAO,EAAE,CAAC;YACV,SAAS,EAAE,OAAO,SAAS,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC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gBAC7C,MAAM,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;gBAC3C,MAAM,SAAS,GAAG,GAAG,IAAI,CAAC,QAAQ,MAAM,CAAA;gBACxC,MAAM,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAA;gBACnE,MAAM,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YACxC,CAAC;YAAC,MAAM,CAAC;gBACP,2EAA2E;YAC7E,CAAC;QACH,CAAC,CAAC,CAAA;QACF,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YACxB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAA;QACxB,CAAC;QACD,IAAI,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;;YAC7B,MAAM,IAAI,CAAC,KAAK,CAAA;IACvB,CAAC;CACF"}
|
package/dist/tools.js
CHANGED
|
@@ -52,7 +52,8 @@ export function createOrchestraTools(config, ledger, pluginStatus, pricing) {
|
|
|
52
52
|
const workers = workerPool.slice(0, config.orchestration.maxWorkers);
|
|
53
53
|
const planOptions = {
|
|
54
54
|
maxNodes: config.orchestration.maxWorkers,
|
|
55
|
-
dependencyAware:
|
|
55
|
+
dependencyAware: true,
|
|
56
|
+
includeMerger: true,
|
|
56
57
|
...(config.budget === "ebobo" ? { secondaryWorkers: Array.from(new Set(enabledWorkers)) } : {}),
|
|
57
58
|
};
|
|
58
59
|
const plan = planTask(profile, classification.secondaryProfiles, planOptions);
|
|
@@ -99,7 +100,7 @@ export function createOrchestraTools(config, ledger, pluginStatus, pricing) {
|
|
|
99
100
|
escalation,
|
|
100
101
|
...(estimate ? { estimate } : {}),
|
|
101
102
|
...(estimate ? { warning: formatEstimateWarning(estimate, config.pricing.warnThresholdUSD) ?? null } : { warning: null }),
|
|
102
|
-
next: "Delegate the full task once to orch-lead with profile=" + profile + ".
|
|
103
|
+
next: "Delegate the full task and returned plan once to orch-lead with profile=" + profile + ". Execute ready nodes level-by-level, concurrently within parallelWorkers, then call orch-merge exactly once." + eboboHint,
|
|
103
104
|
}, null, 2);
|
|
104
105
|
},
|
|
105
106
|
}),
|
package/dist/tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAuB,MAAM,qBAAqB,CAAA;AAE/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,YAAY,EAAuB,MAAM,yBAAyB,CAAA;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAEnF,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAErE,OAAO,EAAE,kBAAkB,EAAqB,MAAM,oBAAoB,CAAA;AAM1E,MAAM,mBAAmB,GAAG,qBAAqB,EAAE,CAAA;AAMnD,MAAM,UAAU,oBAAoB,CAClC,MAAuB,EACvB,MAAc,EACd,YAA2B,EAC3B,OAAwB;IAExB,OAAO;QACL,eAAe,EAAE,IAAI,CAAC;YACpB,WAAW,EAAE,+IAA+I;YA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X,IAAI,CAAC,YAAY;oBAAE,OAAO,2FAA2F,CAAA;gBACrH,OAAO,kBAAkB,CAAC,YAAY,CAAC,CAAA;YACzC,CAAC;SACF,CAAC;KACH,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
package/prompts/lead.md
CHANGED
|
@@ -9,10 +9,11 @@ Operating rules:
|
|
|
9
9
|
1. Classify the task as architecture, debug, UI, research, review, security, performance, migration, or ops. Use at most two secondary profiles.
|
|
10
10
|
2. Dispatch workers only when their evidence can change the answer. Avoid ceremonial parallelism.
|
|
11
11
|
3. Give each worker a narrow question, relevant context, explicit deliverable, and a prohibition on editing or further delegation.
|
|
12
|
-
4.
|
|
13
|
-
5.
|
|
14
|
-
6.
|
|
15
|
-
7.
|
|
12
|
+
4. Build a dependency DAG before dispatch. Run all currently-ready nodes concurrently within runtime limits; release downstream nodes only after every `dependsOn` result is available.
|
|
13
|
+
5. After all evidence nodes complete, invoke `orch-merge` exactly once with outputs labeled by node id and worker.
|
|
14
|
+
6. Compare claims, evidence, and uncertainty. Do not treat repeated unsupported opinions as consensus.
|
|
15
|
+
7. Invoke `orch-judge` only for critical risk or genuinely unresolved disagreement. Never use it merely to polish prose.
|
|
16
|
+
8. Do not edit files. Do not invoke yourself. Do not take over the primary agent's implementation, plan, TDD, review, or active skill workflow.
|
|
16
17
|
|
|
17
18
|
Return a compact handoff with:
|
|
18
19
|
|
package/CHANGELOG.md
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to OpenCode Orchestra are documented in this file.
|
|
4
|
-
|
|
5
|
-
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project uses [Semantic Versioning](https://semver.org/).
|
|
6
|
-
|
|
7
|
-
## [1.0.7] — 2026-08-17
|
|
8
|
-
|
|
9
|
-
### Added
|
|
10
|
-
|
|
11
|
-
- Stable plugin module ID and package export metadata for current OpenCode resolvers.
|
|
12
|
-
- Config-discovery and entrypoint regression tests.
|
|
13
|
-
|
|
14
|
-
### Changed
|
|
15
|
-
|
|
16
|
-
- The CLI now uses Node.js as its portable executable runtime while remaining compatible with Bun.
|
|
17
|
-
- Project JSONC config takes precedence over the JSON variant when both exist.
|
|
18
|
-
- Optional MCP dependency provisioning is best-effort and reports failures without blocking setup.
|
|
19
|
-
|
|
20
|
-
### Fixed
|
|
21
|
-
|
|
22
|
-
- Bounded provider model discovery so a stalled catalog cannot block plugin initialization.
|
|
23
|
-
- Removed unconditional stderr output during plugin initialization.
|
|
24
|
-
|
|
25
|
-
## [1.0.0] — 2026-08-17
|
|
26
|
-
|
|
27
|
-
### Added
|
|
28
|
-
|
|
29
|
-
- Production-ready orchestration with a public `orch-lead`, specialist workers, `orch-judge`, dependency-aware task plans, profile classification, and four budget modes: `eco`, `balanced`, `quality`, and `ebobo`.
|
|
30
|
-
- Automatic discovery and capability scoring for models exposed by connected OpenCode providers, while preserving explicit per-agent and manual-pool overrides.
|
|
31
|
-
- Model pricing support with an offline snapshot, optional self-hosted refresh endpoint, explicit per-model price overrides, pre-run cost estimates, and configurable spend warnings.
|
|
32
|
-
- Ordered cheaper fallback metadata for execution layers that support retrying provider calls.
|
|
33
|
-
- Local telemetry dashboard with token, cost, model, agent, activity, monthly projection, anomaly, and MCP status views.
|
|
34
|
-
- Authenticated CSV and JSON exports for activity, models, agents, daily usage, and summary reports.
|
|
35
|
-
- Optional prompt/reply telemetry through `telemetry.storeTexts`; message text remains disabled by default.
|
|
36
|
-
- `opencode-orchestra doctor` for configuration, plugin, MCP, and local toolchain diagnostics, including JSON output.
|
|
37
|
-
- `opencode-orchestra update` for checking the latest published npm version.
|
|
38
|
-
- Shell completion generators for zsh, bash, and PowerShell.
|
|
39
|
-
- Plugin runtime status through `/plugin-status` and the `orchestra_plugin_status` tool.
|
|
40
|
-
- Cross-platform, idempotent installer for the Orchestra plugin, Context7, Codebase Memory, and MemoryGraph.
|
|
41
|
-
- JSON Schema for `orchestra.jsonc`, including pricing and opt-in text telemetry settings.
|
|
42
|
-
- Expanded regression and integration coverage across routing, pricing, telemetry, dashboard, diagnostics, installer, and plugin initialization.
|
|
43
|
-
|
|
44
|
-
### Changed
|
|
45
|
-
|
|
46
|
-
- Promoted the package to the stable `1.0.0` API and configuration contract.
|
|
47
|
-
- Hardened dashboard configuration writes with full-schema validation, empty agent-model normalization, JSONC comment preservation, backups, and atomic replacement.
|
|
48
|
-
- Improved paid-model estimation to honor explicit prices and each worker's actual capability.
|
|
49
|
-
- Bounded streaming text buffers and added plugin-disposal cleanup for timers and in-memory telemetry state.
|
|
50
|
-
- Clarified that fallback lists are resolver metadata; OpenCode provider calls are not intercepted or retried automatically by the plugin.
|
|
51
|
-
- Added npm repository, homepage, issue tracker, release keywords, and a pre-publish validation gate.
|
|
52
|
-
|
|
53
|
-
### Fixed
|
|
54
|
-
|
|
55
|
-
- Fixed the published JSON Schema so `pricing` is accepted as a configuration section.
|
|
56
|
-
- Fixed prompt telemetry correlation between user and assistant messages.
|
|
57
|
-
- Fixed stale pricing snapshots, concurrent refresh races, and unsafe passthrough of remote price fields.
|
|
58
|
-
- Fixed dashboard saves when optional per-agent model fields are left blank.
|
|
59
|
-
- Fixed invalid export parameters to return HTTP 400 instead of HTTP 500.
|
|
60
|
-
- Fixed monthly pace analytics so current-month projections use a prior-period baseline.
|
|
61
|
-
|
|
62
|
-
### Compatibility and upgrade notes
|
|
63
|
-
|
|
64
|
-
- Requires Node.js 22 or newer for Node-based development and runtime tooling.
|
|
65
|
-
- The recommended installer requires Bun 1.2 or newer.
|
|
66
|
-
- Existing bare or pinned plugin entries are upgraded to `@oeronteros-1/opencode-orchestra@latest` by the installer while preserving plugin options.
|
|
67
|
-
- Existing OpenCode and MCP configuration is preserved; use `--force` only when you explicitly want Orchestra's MCP defaults to replace matching entries.
|
|
68
|
-
- Text telemetry remains opt-in. Existing installations continue to record usage metadata without prompt or reply contents.
|
|
69
|
-
|
|
70
|
-
## [0.5.3] — 2026-08-17
|
|
71
|
-
|
|
72
|
-
### Fixed
|
|
73
|
-
|
|
74
|
-
- Exported both `server` and `default` from the plugin entry for OpenCode 1.18.x and older plugin loaders.
|
|
75
|
-
- Wrote `@oeronteros-1/opencode-orchestra@latest` into OpenCode configuration and upgraded existing bare or pinned entries.
|
|
76
|
-
|
|
77
|
-
## [0.5.1] — 2026-08-17
|
|
78
|
-
|
|
79
|
-
### Changed
|
|
80
|
-
|
|
81
|
-
- Recorded all OpenCode assistant responses in local telemetry, including primary OpenCode mode.
|
|
82
|
-
- Preserved Orchestra-specific counters for free worker calls and judge escalations.
|
|
83
|
-
|
|
84
|
-
[1.0.0]: https://github.com/Oeronteros/opencode-orchestra/compare/v0.5.3...v1.0.0
|
|
85
|
-
[0.5.3]: https://github.com/Oeronteros/opencode-orchestra/compare/v0.5.1...v0.5.3
|
|
86
|
-
[0.5.1]: https://github.com/Oeronteros/opencode-orchestra/releases/tag/v0.5.1
|