opencode-swarm 7.98.2 → 7.99.1
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 +6 -3
- package/dist/agents/_prompt-helpers.d.ts +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-gvd7mw7v.js} +5 -5
- package/dist/cli/{explorer-jc46negv.js → explorer-rwfvbbx5.js} +1 -1
- package/dist/cli/{gate-evidence-nphg8hay.js → gate-evidence-ywys9vfs.js} +4 -4
- package/dist/cli/guardrail-explain-6g1japmf.js +30 -0
- 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-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-72k57f21.js → index-brpm7xs3.js} +1157 -803
- package/dist/cli/{index-hb10a2g8.js → index-f7nma02k.js} +2 -2
- package/dist/cli/{index-gnd1280x.js → index-h9ptj4b1.js} +1 -1
- package/dist/cli/{index-yrzfbqqh.js → index-qcr60fgm.js} +29 -16
- 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-rvweaxsd.js → index-sy329dh4.js} +2 -2
- 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-5z2e78tv.js → index-xsswhy6k.js} +1 -1
- package/dist/cli/{index-chan9mkv.js → index-xy3gw0rw.js} +17 -15
- package/dist/cli/{index-2a6ppa65.js → index-ydgy7vg5.js} +12 -7
- package/dist/cli/index.js +13 -13
- 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/evidence/manager.d.ts +5 -0
- package/dist/hooks/knowledge-migrator.d.ts +7 -0
- package/dist/index.js +3074 -2478
- package/dist/services/cost-accounting.d.ts +65 -0
- package/dist/telemetry.d.ts +2 -1
- package/dist/turbo/lean/conflicts.d.ts +2 -13
- package/dist/utils/path.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cli/guardrail-explain-xktjjh53.js +0 -30
|
@@ -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;
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
* All paths are normalized to POSIX-style (forward slashes, no trailing slash)
|
|
19
19
|
* before conflict detection. This ensures consistent behavior across platforms.
|
|
20
20
|
*/
|
|
21
|
+
import { normalizePath } from '../../utils/path';
|
|
22
|
+
export { normalizePath };
|
|
21
23
|
/**
|
|
22
24
|
* A scope file persisted by the `declare_scope` tool.
|
|
23
25
|
* Stored at `.swarm/scopes/scope-{taskId}.json`.
|
|
@@ -32,19 +34,6 @@ export interface ScopeFile {
|
|
|
32
34
|
* These are treated as global because other tasks may import from them.
|
|
33
35
|
*/
|
|
34
36
|
export declare const BARREL_FILE_PATTERNS: readonly RegExp[];
|
|
35
|
-
/**
|
|
36
|
-
* Normalize a file path to POSIX-style for consistent cross-platform comparison.
|
|
37
|
-
*
|
|
38
|
-
* - Converts backslashes to forward slashes
|
|
39
|
-
* - Removes trailing slashes
|
|
40
|
-
* - Collapses multiple consecutive slashes
|
|
41
|
-
* - Resolves `.` path segments (current directory references)
|
|
42
|
-
* - Does NOT resolve `..` segments or symlinks
|
|
43
|
-
*
|
|
44
|
-
* @param filePath - The path to normalize
|
|
45
|
-
* @returns POSIX-normalized path
|
|
46
|
-
*/
|
|
47
|
-
export declare function normalizePath(filePath: string): string;
|
|
48
37
|
/**
|
|
49
38
|
* Check if a path contains directory traversal components.
|
|
50
39
|
* Rejects paths with `..` segments that could escape the project root.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalizePath(p: string): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.99.1",
|
|
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",
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
handleGuardrailExplain
|
|
4
|
-
} from "./index-rvweaxsd.js";
|
|
5
|
-
import"./index-72k57f21.js";
|
|
6
|
-
import"./index-5z2e78tv.js";
|
|
7
|
-
import"./index-2a6ppa65.js";
|
|
8
|
-
import"./index-fjxjb66n.js";
|
|
9
|
-
import"./index-hb10a2g8.js";
|
|
10
|
-
import"./index-zy22fg5h.js";
|
|
11
|
-
import"./index-471qxz9g.js";
|
|
12
|
-
import"./index-yrzfbqqh.js";
|
|
13
|
-
import"./index-adz3nk9b.js";
|
|
14
|
-
import"./index-v4fcn4tr.js";
|
|
15
|
-
import"./index-mh1ej70w.js";
|
|
16
|
-
import"./index-kv4dd5c5.js";
|
|
17
|
-
import"./index-a0dv2c7k.js";
|
|
18
|
-
import"./index-we94wkty.js";
|
|
19
|
-
import"./index-jtqkh8jf.js";
|
|
20
|
-
import"./index-5e4e2hvv.js";
|
|
21
|
-
import"./index-p0arc26j.js";
|
|
22
|
-
import"./index-zgwm4ryv.js";
|
|
23
|
-
import"./index-91qtsbce.js";
|
|
24
|
-
import"./index-293f68mj.js";
|
|
25
|
-
import"./index-b9v501fr.js";
|
|
26
|
-
import"./index-xchgryg4.js";
|
|
27
|
-
import"./index-a76rekgs.js";
|
|
28
|
-
export {
|
|
29
|
-
handleGuardrailExplain
|
|
30
|
-
};
|