opencode-swarm 7.98.2 → 7.99.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.md +1 -0
- package/dist/cli/{config-doctor-7yrxfa6b.js → config-doctor-9fhfy6p7.js} +2 -2
- package/dist/cli/{evidence-summary-service-559nas1m.js → evidence-summary-service-4hs44n2c.js} +5 -5
- package/dist/cli/{gate-evidence-nphg8hay.js → gate-evidence-ywys9vfs.js} +4 -4
- package/dist/cli/{guardrail-explain-xktjjh53.js → guardrail-explain-ktm6szbm.js} +13 -13
- package/dist/cli/{guardrail-log-53z1cf46.js → guardrail-log-ya49kpwn.js} +3 -3
- package/dist/cli/{index-91qtsbce.js → index-3naa2ajc.js} +1 -1
- package/dist/cli/{index-chan9mkv.js → index-4pt2py5p.js} +16 -14
- package/dist/cli/{index-a0dv2c7k.js → index-5fxjagjt.js} +1 -1
- package/dist/cli/{index-471qxz9g.js → index-7hnwnw5g.js} +11 -1
- package/dist/cli/{index-kv4dd5c5.js → index-9b7qp18e.js} +1 -1
- package/dist/cli/{index-hb10a2g8.js → index-f7nma02k.js} +2 -2
- package/dist/cli/{index-rvweaxsd.js → index-ft4gehk1.js} +2 -2
- package/dist/cli/{index-gnd1280x.js → index-h9ptj4b1.js} +1 -1
- package/dist/cli/{index-72k57f21.js → index-hw8r3e5p.js} +1098 -790
- package/dist/cli/{index-mh1ej70w.js → index-r8f89sm9.js} +2 -2
- package/dist/cli/{index-zy22fg5h.js → index-svf2zjxs.js} +5 -1
- package/dist/cli/{index-xchgryg4.js → index-vn263hqt.js} +16 -2
- package/dist/cli/{index-fjxjb66n.js → index-vwyjkzgs.js} +3 -3
- package/dist/cli/{index-yrzfbqqh.js → index-wwnjw0fb.js} +3 -3
- package/dist/cli/{index-5z2e78tv.js → index-xsswhy6k.js} +1 -1
- package/dist/cli/index.js +12 -12
- package/dist/cli/{knowledge-store-pa58msy5.js → knowledge-store-tsa8ezka.js} +4 -4
- package/dist/cli/{pending-delegations-8b2js1vq.js → pending-delegations-c785p5n2.js} +2 -2
- package/dist/cli/{pr-subscriptions-ttvr1ta9.js → pr-subscriptions-fqrzm0tv.js} +3 -3
- package/dist/cli/{schema-mygkbbe9.js → schema-nz638xc3.js} +5 -1
- package/dist/cli/{skill-generator-3tkwcg4x.js → skill-generator-99rrfwae.js} +5 -5
- package/dist/cli/{telemetry-aa1ma1dr.js → telemetry-jm7t8031.js} +1 -1
- package/dist/commands/costs.d.ts +4 -0
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/registry.d.ts +9 -2
- package/dist/config/evidence-schema.d.ts +44 -44
- package/dist/config/index.d.ts +2 -2
- package/dist/config/schema.d.ts +24 -0
- package/dist/index.js +2933 -2314
- package/dist/services/cost-accounting.d.ts +65 -0
- package/dist/telemetry.d.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export type CostSource = 'reported' | 'estimated' | 'unavailable';
|
|
2
|
+
export type ModelPricing = {
|
|
3
|
+
input_per_million: number;
|
|
4
|
+
output_per_million: number;
|
|
5
|
+
reasoning_per_million?: number;
|
|
6
|
+
cache_per_million?: number;
|
|
7
|
+
};
|
|
8
|
+
export type PricingConfig = {
|
|
9
|
+
models?: Record<string, ModelPricing>;
|
|
10
|
+
};
|
|
11
|
+
export type TokenUsage = {
|
|
12
|
+
tokens_input: number;
|
|
13
|
+
tokens_output: number;
|
|
14
|
+
tokens_reasoning: number;
|
|
15
|
+
tokens_cache: number;
|
|
16
|
+
};
|
|
17
|
+
export type DelegationCostFields = TokenUsage & {
|
|
18
|
+
cost_usd: number | null;
|
|
19
|
+
cost_source: CostSource;
|
|
20
|
+
model?: string;
|
|
21
|
+
gate?: string;
|
|
22
|
+
retry_index?: number;
|
|
23
|
+
};
|
|
24
|
+
export type DelegationCostInput = {
|
|
25
|
+
raw?: unknown;
|
|
26
|
+
model?: string;
|
|
27
|
+
gate?: string;
|
|
28
|
+
retry_index?: number;
|
|
29
|
+
pricing?: PricingConfig;
|
|
30
|
+
};
|
|
31
|
+
export type CostSummary = {
|
|
32
|
+
total_cost_usd: number;
|
|
33
|
+
total_reported_usd: number;
|
|
34
|
+
total_estimated_usd: number;
|
|
35
|
+
total_input_tokens: number;
|
|
36
|
+
total_output_tokens: number;
|
|
37
|
+
total_reasoning_tokens: number;
|
|
38
|
+
total_cache_tokens: number;
|
|
39
|
+
delegations: number;
|
|
40
|
+
unavailable_delegations: number;
|
|
41
|
+
by_agent: CostSummaryRow[];
|
|
42
|
+
by_task: CostSummaryRow[];
|
|
43
|
+
by_gate: CostSummaryRow[];
|
|
44
|
+
by_retry: CostSummaryRow[];
|
|
45
|
+
by_source: Record<CostSource, {
|
|
46
|
+
delegations: number;
|
|
47
|
+
cost_usd: number;
|
|
48
|
+
}>;
|
|
49
|
+
};
|
|
50
|
+
export type CostSummaryRow = {
|
|
51
|
+
name: string;
|
|
52
|
+
delegations: number;
|
|
53
|
+
cost_usd: number;
|
|
54
|
+
input_tokens: number;
|
|
55
|
+
output_tokens: number;
|
|
56
|
+
reasoning_tokens: number;
|
|
57
|
+
cache_tokens: number;
|
|
58
|
+
unavailable_delegations: number;
|
|
59
|
+
};
|
|
60
|
+
export declare const BUNDLED_MODEL_PRICING: Record<string, ModelPricing>;
|
|
61
|
+
export declare function buildDelegationCostFields(input?: DelegationCostInput): DelegationCostFields;
|
|
62
|
+
export declare function summarizeTelemetryCosts(directory: string): CostSummary;
|
|
63
|
+
export declare function readTelemetryEvents(directory: string): Record<string, unknown>[];
|
|
64
|
+
export declare function estimateCostUsd(usage: TokenUsage, model?: string, pricing?: PricingConfig): number | null;
|
|
65
|
+
export declare function roundUsd(value: number): number;
|
package/dist/telemetry.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DelegationCostFields } from './services/cost-accounting.js';
|
|
1
2
|
export type TelemetryEvent = 'session_started' | 'session_ended' | 'agent_activated' | 'delegation_begin' | 'delegation_end' | 'task_state_changed' | 'gate_passed' | 'gate_failed' | 'gate_parse_error' | 'phase_changed' | 'budget_updated' | 'model_fallback' | 'hard_limit_hit' | 'revision_limit_hit' | 'loop_detected' | 'scope_violation' | 'qa_skip_violation' | 'heartbeat' | 'turbo_mode_changed' | 'auto_oversight_escalation' | 'environment_detected' | 'evidence_lock_acquired' | 'evidence_lock_contended' | 'evidence_lock_stale_recovered' | 'plan_ledger_cas_retry' | 'plan_md_write_failed' | 'snapshot_failed' | 'prm_pattern_detected' | 'prm_course_correction_injected' | 'prm_escalation_triggered' | 'prm_hard_stop';
|
|
2
3
|
export type TelemetryListener = (event: TelemetryEvent, data: Record<string, unknown>) => void;
|
|
3
4
|
/**
|
|
@@ -42,7 +43,7 @@ export declare const telemetry: {
|
|
|
42
43
|
sessionEnded(sessionId: string, reason: string): void;
|
|
43
44
|
agentActivated(sessionId: string, agentName: string, oldName?: string): void;
|
|
44
45
|
delegationBegin(sessionId: string, agentName: string, taskId: string): void;
|
|
45
|
-
delegationEnd(sessionId: string, agentName: string, taskId: string, result: string): void;
|
|
46
|
+
delegationEnd(sessionId: string, agentName: string, taskId: string, result: string, costFields?: Partial<DelegationCostFields>): void;
|
|
46
47
|
taskStateChanged(sessionId: string, taskId: string, newState: string, oldState?: string): void;
|
|
47
48
|
gatePassed(sessionId: string, gate: string, taskId: string): void;
|
|
48
49
|
gateParseError(taskId: string, error: Error): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.99.0",
|
|
4
4
|
"description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|