@jmanuelcorral/openteam 0.13.1 → 0.14.0
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.es.md +4 -2
- package/README.md +4 -2
- package/dist/cli.js +213 -19
- package/dist/commands/dispatch.d.ts +8 -0
- package/dist/commands/dispatch.d.ts.map +1 -1
- package/dist/commands/doctor.d.ts +17 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/config/errors.d.ts.map +1 -1
- package/dist/config/schema.d.ts +23 -6
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +195 -15
- package/dist/local/concurrency.d.ts +24 -4
- package/dist/local/concurrency.d.ts.map +1 -1
- package/dist/local/registry.d.ts +3 -3
- package/dist/local/registry.d.ts.map +1 -1
- package/dist/local/types.d.ts +16 -2
- package/dist/local/types.d.ts.map +1 -1
- package/dist/orchestrator/coordinator.d.ts +24 -1
- package/dist/orchestrator/coordinator.d.ts.map +1 -1
- package/dist/orchestrator/roles.d.ts +2 -12
- package/dist/orchestrator/roles.d.ts.map +1 -1
- package/dist/telemetry/eventLog.d.ts +7 -1
- package/dist/telemetry/eventLog.d.ts.map +1 -1
- package/dist/telemetry/events.d.ts +37 -0
- package/dist/telemetry/events.d.ts.map +1 -1
- package/dist/telemetry/queueWait.d.ts +51 -0
- package/dist/telemetry/queueWait.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -92,6 +92,30 @@ export declare const MeetingEventSchema: z.ZodObject<{
|
|
|
92
92
|
roles: z.ZodArray<z.ZodString>;
|
|
93
93
|
decisionIDs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
94
94
|
}, z.core.$strict>;
|
|
95
|
+
/**
|
|
96
|
+
* Per-dispatch local-runtime queue metric (#144 observability). Emitted once for
|
|
97
|
+
* each dispatched role task that passed through the per-runtime concurrency
|
|
98
|
+
* limiter, so an orchestrated run under load produces queue-wait samples an
|
|
99
|
+
* operator can aggregate into p50/p95 — the measurement that a post-load
|
|
100
|
+
* snapshot cannot reconstruct.
|
|
101
|
+
*
|
|
102
|
+
* Privacy: ids, counts and one duration only — never prompt text, tool
|
|
103
|
+
* arguments, or output. `waitedMs` is `0` when a slot was free; `activeCount`
|
|
104
|
+
* and `queuedCount` are observed at the moment the slot was granted.
|
|
105
|
+
*/
|
|
106
|
+
export declare const QueueEventSchema: z.ZodObject<{
|
|
107
|
+
v: z.ZodLiteral<1>;
|
|
108
|
+
ts: z.ZodNumber;
|
|
109
|
+
sessionID: z.ZodString;
|
|
110
|
+
type: z.ZodLiteral<"queue">;
|
|
111
|
+
runtimeId: z.ZodString;
|
|
112
|
+
waitedMs: z.ZodNumber;
|
|
113
|
+
activeCount: z.ZodNumber;
|
|
114
|
+
queuedCount: z.ZodNumber;
|
|
115
|
+
decisionID: z.ZodOptional<z.ZodString>;
|
|
116
|
+
agent: z.ZodOptional<z.ZodString>;
|
|
117
|
+
batchID: z.ZodOptional<z.ZodString>;
|
|
118
|
+
}, z.core.$strict>;
|
|
95
119
|
/** Recorded decision/learning (scribe or orchestrator), redacted. */
|
|
96
120
|
export declare const DecisionEventSchema: z.ZodObject<{
|
|
97
121
|
v: z.ZodLiteral<1>;
|
|
@@ -284,6 +308,18 @@ export declare const OpenTeamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
284
308
|
purpose: z.ZodOptional<z.ZodString>;
|
|
285
309
|
roles: z.ZodArray<z.ZodString>;
|
|
286
310
|
decisionIDs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
311
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
312
|
+
v: z.ZodLiteral<1>;
|
|
313
|
+
ts: z.ZodNumber;
|
|
314
|
+
sessionID: z.ZodString;
|
|
315
|
+
type: z.ZodLiteral<"queue">;
|
|
316
|
+
runtimeId: z.ZodString;
|
|
317
|
+
waitedMs: z.ZodNumber;
|
|
318
|
+
activeCount: z.ZodNumber;
|
|
319
|
+
queuedCount: z.ZodNumber;
|
|
320
|
+
decisionID: z.ZodOptional<z.ZodString>;
|
|
321
|
+
agent: z.ZodOptional<z.ZodString>;
|
|
322
|
+
batchID: z.ZodOptional<z.ZodString>;
|
|
287
323
|
}, z.core.$strict>, z.ZodObject<{
|
|
288
324
|
v: z.ZodLiteral<1>;
|
|
289
325
|
ts: z.ZodNumber;
|
|
@@ -361,6 +397,7 @@ export type RouteEvent = z.infer<typeof RouteEventSchema>;
|
|
|
361
397
|
export type MessageEvent = z.infer<typeof MessageEventSchema>;
|
|
362
398
|
export type ToolcallEvent = z.infer<typeof ToolcallEventSchema>;
|
|
363
399
|
export type MeetingEvent = z.infer<typeof MeetingEventSchema>;
|
|
400
|
+
export type QueueEvent = z.infer<typeof QueueEventSchema>;
|
|
364
401
|
export type DecisionEvent = z.infer<typeof DecisionEventSchema>;
|
|
365
402
|
export type ActivityEvent = z.infer<typeof ActivityEventSchema>;
|
|
366
403
|
export type SessionEndpointEvent = z.infer<typeof SessionEndpointEventSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/telemetry/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,EAAG,CAAU,CAAC;AAa/C,iEAAiE;AACjE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAqB3B,CAAC;AAEH,wEAAwE;AACxE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;kBAc7B,CAAC;AAEH,sEAAsE;AACtE,eAAO,MAAM,mBAAmB;;;;;;;;;;;kBAS9B,CAAC;AAEH,iEAAiE;AACjE,eAAO,MAAM,kBAAkB;;;;;;;;;kBAM7B,CAAC;AAEH,qEAAqE;AACrE,eAAO,MAAM,mBAAmB;;;;;;;;kBAK9B,CAAC;AAEH,oDAAo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AAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { QueueEvent } from "./events";
|
|
2
|
+
/**
|
|
3
|
+
* Aggregated local-runtime queue-wait metrics derived from `queue` events
|
|
4
|
+
* (#144). Produced by {@link summarizeQueueWaits} and rendered by
|
|
5
|
+
* `openteam doctor` so an operator can read the p50/p95 wait a live load
|
|
6
|
+
* incurred — the measurement a post-load snapshot cannot reconstruct.
|
|
7
|
+
*
|
|
8
|
+
* Pure data: counts and durations only, no prompt content.
|
|
9
|
+
*/
|
|
10
|
+
export type QueueWaitRuntimeSummary = {
|
|
11
|
+
/** Local runtime id (e.g. `lemonade`). */
|
|
12
|
+
readonly runtimeId: string;
|
|
13
|
+
/** Number of dispatch samples observed for this runtime. */
|
|
14
|
+
readonly samples: number;
|
|
15
|
+
/** Samples that actually queued (waited more than 0 ms). */
|
|
16
|
+
readonly contended: number;
|
|
17
|
+
/** Median queue wait in milliseconds across this runtime's samples. */
|
|
18
|
+
readonly p50Ms: number;
|
|
19
|
+
/** 95th-percentile queue wait in milliseconds across this runtime's samples. */
|
|
20
|
+
readonly p95Ms: number;
|
|
21
|
+
/** Maximum queue wait in milliseconds observed for this runtime. */
|
|
22
|
+
readonly maxMs: number;
|
|
23
|
+
/** Highest queued (waiting) count observed at an acquisition for this runtime. */
|
|
24
|
+
readonly maxQueued: number;
|
|
25
|
+
/** Highest active (in-flight) count observed at an acquisition for this runtime. */
|
|
26
|
+
readonly maxActive: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Whole-fleet plus per-runtime queue-wait roll-up. `undefined` from
|
|
30
|
+
* {@link summarizeQueueWaits} means no `queue` samples were recorded at all,
|
|
31
|
+
* which the caller reports as "no data" rather than as zero contention.
|
|
32
|
+
*/
|
|
33
|
+
export type QueueWaitSummary = {
|
|
34
|
+
readonly samples: number;
|
|
35
|
+
readonly contended: number;
|
|
36
|
+
readonly p50Ms: number;
|
|
37
|
+
readonly p95Ms: number;
|
|
38
|
+
readonly maxMs: number;
|
|
39
|
+
readonly maxQueued: number;
|
|
40
|
+
readonly maxActive: number;
|
|
41
|
+
/** Per-runtime breakdown, sorted by runtime id for deterministic output. */
|
|
42
|
+
readonly perRuntime: readonly QueueWaitRuntimeSummary[];
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Aggregates `queue` events into fleet-wide and per-runtime p50/p95 wait,
|
|
46
|
+
* contention counts, and peak active/queued depths. Pure and deterministic:
|
|
47
|
+
* same events (in any order) produce the same summary. Returns `undefined` when
|
|
48
|
+
* there are no samples so callers can distinguish "no data" from "no wait".
|
|
49
|
+
*/
|
|
50
|
+
export declare function summarizeQueueWaits(events: readonly QueueEvent[]): QueueWaitSummary | undefined;
|
|
51
|
+
//# sourceMappingURL=queueWait.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queueWait.d.ts","sourceRoot":"","sources":["../../src/telemetry/queueWait.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,0CAA0C;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,4DAA4D;IAC5D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gFAAgF;IAChF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kFAAkF;IAClF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,oFAAoF;IACpF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4EAA4E;IAC5E,QAAQ,CAAC,UAAU,EAAE,SAAS,uBAAuB,EAAE,CAAC;CACzD,CAAC;AA+BF;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,UAAU,EAAE,GAC5B,gBAAgB,GAAG,SAAS,CAmD9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jmanuelcorral/openteam",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"packageManager": "bun@1.3.14",
|
|
5
5
|
"description": "Cost-aware, local-first routing plugin for opencode with cheapest-capable frontier fallback and multi-agent orchestration.",
|
|
6
6
|
"license": "MIT",
|