opencode-swarm 6.27.0 → 7.0.0-beta.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 +40 -1179
- package/dist/{agents/architect.d.ts → architect.d.ts} +1 -5
- package/dist/checkpoint.d.ts +7 -0
- package/dist/cli/index.js +11353 -20907
- package/dist/co-change-analyzer.d.ts +1 -0
- package/dist/compat.d.ts +12 -0
- package/dist/config-doctor.d.ts +1 -0
- package/dist/{config/loader.d.ts → config.d.ts} +6 -11
- package/dist/detector.d.ts +7 -0
- package/dist/diagnose-service.d.ts +1 -0
- package/dist/evidence-schema.d.ts +2 -0
- package/dist/evidence-service.d.ts +1 -0
- package/dist/export-service.d.ts +1 -0
- package/dist/handoff-service.d.ts +1 -0
- package/dist/history-service.d.ts +1 -0
- package/dist/hive-promoter.d.ts +2 -0
- package/dist/index.d.ts +1 -15
- package/dist/index.js +48739 -47886
- package/dist/knowledge-migrator.d.ts +2 -0
- package/dist/knowledge-store.d.ts +1 -0
- package/dist/knowledge-types.d.ts +1 -0
- package/dist/knowledge-validator.d.ts +2 -0
- package/dist/loader.d.ts +1 -0
- package/dist/manager.d.ts +1 -0
- package/dist/models.d.ts +1 -0
- package/dist/plan-service.d.ts +1 -0
- package/dist/preflight-service.d.ts +1 -0
- package/dist/profiles.d.ts +7 -0
- package/dist/register.d.ts +36 -0
- package/dist/schema.d.ts +2 -0
- package/dist/snapshot-writer.d.ts +1 -0
- package/dist/state.d.ts +1 -292
- package/dist/status-service.d.ts +15 -0
- package/dist/telemetry/src/events.d.ts +308 -0
- package/dist/telemetry/src/guards.d.ts +14 -0
- package/dist/telemetry/src/index.d.ts +4 -0
- package/dist/telemetry/src/version.d.ts +1 -0
- package/dist/utils.d.ts +1 -0
- package/dist/write-retro.d.ts +1 -0
- package/package.json +12 -13
- package/LICENSE +0 -21
- package/dist/__tests__/security-adversarial.test.d.ts +0 -1
- package/dist/agents/architect-permission.adversarial.test.d.ts +0 -5
- package/dist/agents/architect.turbo-banner.test.d.ts +0 -1
- package/dist/agents/coder.d.ts +0 -2
- package/dist/agents/critic.d.ts +0 -3
- package/dist/agents/designer.d.ts +0 -2
- package/dist/agents/docs.d.ts +0 -2
- package/dist/agents/explorer.d.ts +0 -3
- package/dist/agents/index.d.ts +0 -27
- package/dist/agents/reviewer.d.ts +0 -5
- package/dist/agents/sme.d.ts +0 -2
- package/dist/agents/test-engineer.adversarial.test.d.ts +0 -5
- package/dist/agents/test-engineer.d.ts +0 -2
- package/dist/agents/test-engineer.security.test.d.ts +0 -1
- package/dist/background/circuit-breaker.d.ts +0 -149
- package/dist/background/event-bus.d.ts +0 -60
- package/dist/background/evidence-summary-integration.d.ts +0 -73
- package/dist/background/index.d.ts +0 -22
- package/dist/background/manager.d.ts +0 -122
- package/dist/background/plan-sync-worker.d.ts +0 -122
- package/dist/background/queue.d.ts +0 -117
- package/dist/background/status-artifact.d.ts +0 -115
- package/dist/background/trigger.d.ts +0 -179
- package/dist/background/trigger.vulnerability.test.d.ts +0 -1
- package/dist/background/worker.d.ts +0 -92
- package/dist/cli/index.d.ts +0 -6
- package/dist/commands/checkpoint.d.ts +0 -5
- package/dist/commands/command-adapters.security.test.d.ts +0 -14
- package/dist/commands/commands.test.d.ts +0 -1
- package/dist/commands/config.d.ts +0 -5
- package/dist/commands/curate.test.d.ts +0 -1
- package/dist/commands/index.d.ts +0 -39
- package/dist/commands/turbo-registration.test.d.ts +0 -5
- package/dist/commands/turbo-sessionid.test.d.ts +0 -5
- package/dist/commands/turbo.regression.test.d.ts +0 -11
- package/dist/commands/turbo.test.d.ts +0 -5
- package/dist/config/constants.architect-whitelist.test.d.ts +0 -1
- package/dist/config/constants.d.ts +0 -37
- package/dist/config/evidence-schema.d.ts +0 -1152
- package/dist/config/index.d.ts +0 -9
- package/dist/config/plan-schema.d.ts +0 -151
- package/dist/config/schema.d.ts +0 -700
- package/dist/context/role-filter.d.ts +0 -27
- package/dist/context/zone-classifier.d.ts +0 -17
- package/dist/diff/ast-diff.d.ts +0 -20
- package/dist/evidence/index.d.ts +0 -2
- package/dist/evidence/manager.d.ts +0 -74
- package/dist/gate-evidence.d.ts +0 -70
- package/dist/gate-evidence.test.d.ts +0 -1
- package/dist/git/branch.d.ts +0 -50
- package/dist/git/index.d.ts +0 -22
- package/dist/git/pr.d.ts +0 -28
- package/dist/hooks/adversarial-detector.d.ts +0 -34
- package/dist/hooks/agent-activity.d.ts +0 -38
- package/dist/hooks/co-change-suggester.d.ts +0 -51
- package/dist/hooks/compaction-customizer.d.ts +0 -11
- package/dist/hooks/context-budget.d.ts +0 -34
- package/dist/hooks/context-scoring.d.ts +0 -70
- package/dist/hooks/curator-drift.d.ts +0 -30
- package/dist/hooks/curator-types.d.ts +0 -99
- package/dist/hooks/curator.d.ts +0 -70
- package/dist/hooks/dark-matter-detector.d.ts +0 -38
- package/dist/hooks/delegation-gate.d.ts +0 -53
- package/dist/hooks/delegation-gate.evidence.test.d.ts +0 -4
- package/dist/hooks/delegation-gate.plan-fallback-security.test.d.ts +0 -13
- package/dist/hooks/delegation-gate.plan-fallback.test.d.ts +0 -5
- package/dist/hooks/delegation-gate.seed-state.test.d.ts +0 -1
- package/dist/hooks/delegation-gate.turbo-evidence.test.d.ts +0 -8
- package/dist/hooks/delegation-sanitizer.d.ts +0 -24
- package/dist/hooks/delegation-tracker.d.ts +0 -14
- package/dist/hooks/extractors.d.ts +0 -53
- package/dist/hooks/guardrails.d.ts +0 -73
- package/dist/hooks/hive-promoter.d.ts +0 -40
- package/dist/hooks/index.d.ts +0 -16
- package/dist/hooks/knowledge-curator.d.ts +0 -22
- package/dist/hooks/knowledge-injector.d.ts +0 -20
- package/dist/hooks/knowledge-migrator.d.ts +0 -10
- package/dist/hooks/knowledge-reader.d.ts +0 -22
- package/dist/hooks/knowledge-store.d.ts +0 -20
- package/dist/hooks/knowledge-types.d.ts +0 -117
- package/dist/hooks/knowledge-validator.d.ts +0 -28
- package/dist/hooks/message-priority.d.ts +0 -105
- package/dist/hooks/messages-transform.d.ts +0 -13
- package/dist/hooks/model-limits.d.ts +0 -96
- package/dist/hooks/phase-monitor.d.ts +0 -22
- package/dist/hooks/pipeline-tracker.d.ts +0 -41
- package/dist/hooks/steering-consumed.d.ts +0 -30
- package/dist/hooks/system-enhancer.d.ts +0 -30
- package/dist/hooks/tool-summarizer.d.ts +0 -28
- package/dist/hooks/utils.d.ts +0 -20
- package/dist/index.adversarial-bootstrap.test.d.ts +0 -1
- package/dist/index.bootstrap-adversarial.test.d.ts +0 -1
- package/dist/index.bootstrap-directory.test.d.ts +0 -1
- package/dist/knowledge/identity.d.ts +0 -25
- package/dist/knowledge/index.d.ts +0 -2
- package/dist/lang/detector.d.ts +0 -20
- package/dist/lang/grammars/tree-sitter-dart.wasm +0 -0
- package/dist/lang/grammars/tree-sitter-kotlin.wasm +0 -0
- package/dist/lang/grammars/tree-sitter-swift.wasm +0 -0
- package/dist/lang/index.d.ts +0 -4
- package/dist/lang/profiles.d.ts +0 -71
- package/dist/lang/registry.d.ts +0 -24
- package/dist/lang/runtime.d.ts +0 -35
- package/dist/output/agent-writer.d.ts +0 -27
- package/dist/output/index.d.ts +0 -1
- package/dist/parallel/dependency-graph.d.ts +0 -34
- package/dist/parallel/file-locks.d.ts +0 -33
- package/dist/parallel/index.d.ts +0 -4
- package/dist/parallel/meta-indexer.d.ts +0 -32
- package/dist/parallel/review-router.d.ts +0 -29
- package/dist/plan/index.d.ts +0 -1
- package/dist/plan/manager.d.ts +0 -40
- package/dist/plan/manager.update-task-status.test.d.ts +0 -1
- package/dist/quality/index.d.ts +0 -1
- package/dist/quality/metrics.d.ts +0 -20
- package/dist/sast/rules/c.d.ts +0 -9
- package/dist/sast/rules/csharp.d.ts +0 -9
- package/dist/sast/rules/go.d.ts +0 -9
- package/dist/sast/rules/index.d.ts +0 -72
- package/dist/sast/rules/java.d.ts +0 -9
- package/dist/sast/rules/javascript.d.ts +0 -9
- package/dist/sast/rules/php.d.ts +0 -9
- package/dist/sast/rules/python.d.ts +0 -9
- package/dist/sast/semgrep.d.ts +0 -68
- package/dist/sast/semgrep.test.d.ts +0 -1
- package/dist/sbom/cyclonedx.d.ts +0 -101
- package/dist/sbom/detectors/dart.d.ts +0 -7
- package/dist/sbom/detectors/dotnet.d.ts +0 -7
- package/dist/sbom/detectors/go.d.ts +0 -7
- package/dist/sbom/detectors/index.d.ts +0 -53
- package/dist/sbom/detectors/java.d.ts +0 -7
- package/dist/sbom/detectors/nodejs.d.ts +0 -7
- package/dist/sbom/detectors/python.d.ts +0 -7
- package/dist/sbom/detectors/rust.d.ts +0 -7
- package/dist/sbom/detectors/swift.d.ts +0 -7
- package/dist/services/config-doctor.d.ts +0 -125
- package/dist/services/config-doctor.security.test.d.ts +0 -1
- package/dist/services/config-doctor.test.d.ts +0 -1
- package/dist/services/context-budget-service.d.ts +0 -101
- package/dist/services/decision-drift-analyzer.d.ts +0 -96
- package/dist/services/diagnose-service.d.ts +0 -31
- package/dist/services/evidence-service.d.ts +0 -65
- package/dist/services/evidence-summary-service.d.ts +0 -75
- package/dist/services/export-service.d.ts +0 -23
- package/dist/services/handoff-service.d.ts +0 -61
- package/dist/services/history-service.d.ts +0 -35
- package/dist/services/index.d.ts +0 -13
- package/dist/services/plan-service.d.ts +0 -25
- package/dist/services/preflight-integration.d.ts +0 -38
- package/dist/services/preflight-service.d.ts +0 -62
- package/dist/services/run-memory.d.ts +0 -66
- package/dist/services/status-service.d.ts +0 -29
- package/dist/services/status-service.turbo-indicator.test.d.ts +0 -5
- package/dist/session/snapshot-reader.d.ts +0 -37
- package/dist/session/snapshot-writer.d.ts +0 -89
- package/dist/skills/index.d.ts +0 -30
- package/dist/state.rehydrate.test.d.ts +0 -1
- package/dist/state.rehydration-adversarial.test.d.ts +0 -1
- package/dist/state.rehydration-integration.test.d.ts +0 -1
- package/dist/state.session-restart.test.d.ts +0 -7
- package/dist/summaries/index.d.ts +0 -2
- package/dist/summaries/manager.d.ts +0 -29
- package/dist/summaries/summarizer.d.ts +0 -38
- package/dist/tools/barrel-export-check-gate-status.test.d.ts +0 -6
- package/dist/tools/build-check.d.ts +0 -50
- package/dist/tools/check-gate-status.adversarial.test.d.ts +0 -1
- package/dist/tools/check-gate-status.d.ts +0 -7
- package/dist/tools/check-gate-status.gates.test.d.ts +0 -1
- package/dist/tools/check-gate-status.plugin-registration.test.d.ts +0 -1
- package/dist/tools/checkpoint.d.ts +0 -2
- package/dist/tools/co-change-analyzer.d.ts +0 -45
- package/dist/tools/complexity-hotspots.d.ts +0 -2
- package/dist/tools/declare-scope.d.ts +0 -49
- package/dist/tools/diff.d.ts +0 -18
- package/dist/tools/domain-detector.d.ts +0 -6
- package/dist/tools/evidence-check.d.ts +0 -8
- package/dist/tools/file-extractor.d.ts +0 -9
- package/dist/tools/gitingest.d.ts +0 -18
- package/dist/tools/imports.d.ts +0 -5
- package/dist/tools/index.d.ts +0 -31
- package/dist/tools/knowledge-query.d.ts +0 -5
- package/dist/tools/lint.d.ts +0 -50
- package/dist/tools/phase-complete.d.ts +0 -25
- package/dist/tools/pkg-audit.d.ts +0 -2
- package/dist/tools/placeholder-scan.d.ts +0 -26
- package/dist/tools/plugin-registration-adversarial.test.d.ts +0 -1
- package/dist/tools/pre-check-batch.d.ts +0 -56
- package/dist/tools/quality-budget.d.ts +0 -24
- package/dist/tools/retrieve-summary.d.ts +0 -2
- package/dist/tools/sast-scan.d.ts +0 -60
- package/dist/tools/save-plan.d.ts +0 -63
- package/dist/tools/sbom-generate.d.ts +0 -26
- package/dist/tools/schema-drift.d.ts +0 -2
- package/dist/tools/secretscan.d.ts +0 -35
- package/dist/tools/symbols.d.ts +0 -2
- package/dist/tools/syntax-check.d.ts +0 -35
- package/dist/tools/test-runner.d.ts +0 -49
- package/dist/tools/test-runner.security-adversarial.test.d.ts +0 -5
- package/dist/tools/todo-extract.d.ts +0 -2
- package/dist/tools/tool-names.d.ts +0 -10
- package/dist/tools/update-task-status.d.ts +0 -74
- package/dist/tools/update-task-status.gates.test.d.ts +0 -1
- package/dist/tools/update-task-status.turbo-bypass.test.d.ts +0 -1
- package/dist/tools/write-retro.d.ts +0 -53
- package/dist/types/delegation.d.ts +0 -24
- package/dist/types/events.d.ts +0 -55
- package/dist/utils/errors.d.ts +0 -33
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/logger.d.ts +0 -3
- package/dist/utils/merge.d.ts +0 -5
- package/dist/utils/regex.d.ts +0 -30
- package/dist/utils/tool-output.d.ts +0 -10
- /package/dist/{commands/agents.d.ts → agents.d.ts} +0 -0
- /package/dist/{commands/analyze.d.ts → analyze.d.ts} +0 -0
- /package/dist/{commands/archive.d.ts → archive.d.ts} +0 -0
- /package/dist/{commands/benchmark.d.ts → benchmark.d.ts} +0 -0
- /package/dist/{commands/clarify.d.ts → clarify.d.ts} +0 -0
- /package/dist/{tools/create-tool.d.ts → create-tool.d.ts} +0 -0
- /package/dist/{commands/curate.d.ts → curate.d.ts} +0 -0
- /package/dist/{commands/dark-matter.d.ts → dark-matter.d.ts} +0 -0
- /package/dist/{commands/diagnose.d.ts → diagnose.d.ts} +0 -0
- /package/dist/{build/discovery.d.ts → discovery.d.ts} +0 -0
- /package/dist/{commands/doctor.d.ts → doctor.d.ts} +0 -0
- /package/dist/{commands/evidence.d.ts → evidence.d.ts} +0 -0
- /package/dist/{commands/export.d.ts → export.d.ts} +0 -0
- /package/dist/{commands/handoff.d.ts → handoff.d.ts} +0 -0
- /package/dist/{commands/history.d.ts → history.d.ts} +0 -0
- /package/dist/{commands/knowledge.d.ts → knowledge.d.ts} +0 -0
- /package/dist/{commands/plan.d.ts → plan.d.ts} +0 -0
- /package/dist/{commands/preflight.d.ts → preflight.d.ts} +0 -0
- /package/dist/{commands/promote.d.ts → promote.d.ts} +0 -0
- /package/dist/{commands/reset.d.ts → reset.d.ts} +0 -0
- /package/dist/{commands/retrieve.d.ts → retrieve.d.ts} +0 -0
- /package/dist/{commands/rollback.d.ts → rollback.d.ts} +0 -0
- /package/dist/{commands/simulate.d.ts → simulate.d.ts} +0 -0
- /package/dist/{commands/specify.d.ts → specify.d.ts} +0 -0
- /package/dist/{commands/status.d.ts → status.d.ts} +0 -0
- /package/dist/{commands/sync-plan.d.ts → sync-plan.d.ts} +0 -0
- /package/dist/{commands/turbo.d.ts → turbo.d.ts} +0 -0
- /package/dist/{commands/write_retro.d.ts → write_retro.d.ts} +0 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SwarmEventBaseSchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodString;
|
|
4
|
+
timestamp: z.ZodString;
|
|
5
|
+
sessionId: z.ZodString;
|
|
6
|
+
version: z.ZodDefault<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export type SwarmEventBase = z.infer<typeof SwarmEventBaseSchema>;
|
|
9
|
+
export declare const SessionMetadataEventSchema: z.ZodObject<{
|
|
10
|
+
timestamp: z.ZodString;
|
|
11
|
+
sessionId: z.ZodString;
|
|
12
|
+
version: z.ZodDefault<z.ZodString>;
|
|
13
|
+
type: z.ZodLiteral<"session_metadata">;
|
|
14
|
+
swarmDir: z.ZodString;
|
|
15
|
+
pid: z.ZodNumber;
|
|
16
|
+
platform: z.ZodString;
|
|
17
|
+
nodeVersion: z.ZodString;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type SessionMetadataEvent = z.infer<typeof SessionMetadataEventSchema>;
|
|
20
|
+
export declare const DelegationStartEventSchema: z.ZodObject<{
|
|
21
|
+
timestamp: z.ZodString;
|
|
22
|
+
sessionId: z.ZodString;
|
|
23
|
+
version: z.ZodDefault<z.ZodString>;
|
|
24
|
+
type: z.ZodLiteral<"delegation_start">;
|
|
25
|
+
taskId: z.ZodNullable<z.ZodString>;
|
|
26
|
+
targetAgent: z.ZodString;
|
|
27
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export type DelegationStartEvent = z.infer<typeof DelegationStartEventSchema>;
|
|
30
|
+
export declare const DelegationEndEventSchema: z.ZodObject<{
|
|
31
|
+
timestamp: z.ZodString;
|
|
32
|
+
sessionId: z.ZodString;
|
|
33
|
+
version: z.ZodDefault<z.ZodString>;
|
|
34
|
+
type: z.ZodLiteral<"delegation_end">;
|
|
35
|
+
taskId: z.ZodNullable<z.ZodString>;
|
|
36
|
+
targetAgent: z.ZodString;
|
|
37
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
verdict: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export type DelegationEndEvent = z.infer<typeof DelegationEndEventSchema>;
|
|
41
|
+
export declare const AgentStatusEventSchema: z.ZodObject<{
|
|
42
|
+
timestamp: z.ZodString;
|
|
43
|
+
sessionId: z.ZodString;
|
|
44
|
+
version: z.ZodDefault<z.ZodString>;
|
|
45
|
+
type: z.ZodLiteral<"agent_status">;
|
|
46
|
+
agentName: z.ZodString;
|
|
47
|
+
status: z.ZodEnum<{
|
|
48
|
+
complete: "complete";
|
|
49
|
+
idle: "idle";
|
|
50
|
+
active: "active";
|
|
51
|
+
}>;
|
|
52
|
+
worktreeId: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export type AgentStatusEvent = z.infer<typeof AgentStatusEventSchema>;
|
|
55
|
+
export declare const TokenUsageEventSchema: z.ZodObject<{
|
|
56
|
+
timestamp: z.ZodString;
|
|
57
|
+
sessionId: z.ZodString;
|
|
58
|
+
version: z.ZodDefault<z.ZodString>;
|
|
59
|
+
type: z.ZodLiteral<"token_usage">;
|
|
60
|
+
agentName: z.ZodString;
|
|
61
|
+
inputTokens: z.ZodNumber;
|
|
62
|
+
outputTokens: z.ZodNumber;
|
|
63
|
+
model: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
export type TokenUsageEvent = z.infer<typeof TokenUsageEventSchema>;
|
|
66
|
+
export declare const ToolInvocationEventSchema: z.ZodObject<{
|
|
67
|
+
timestamp: z.ZodString;
|
|
68
|
+
sessionId: z.ZodString;
|
|
69
|
+
version: z.ZodDefault<z.ZodString>;
|
|
70
|
+
type: z.ZodLiteral<"tool_invocation">;
|
|
71
|
+
toolName: z.ZodString;
|
|
72
|
+
taskId: z.ZodNullable<z.ZodString>;
|
|
73
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
success: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
export type ToolInvocationEvent = z.infer<typeof ToolInvocationEventSchema>;
|
|
77
|
+
export declare const GateEvaluationEventSchema: z.ZodObject<{
|
|
78
|
+
timestamp: z.ZodString;
|
|
79
|
+
sessionId: z.ZodString;
|
|
80
|
+
version: z.ZodDefault<z.ZodString>;
|
|
81
|
+
type: z.ZodLiteral<"gate_evaluation">;
|
|
82
|
+
taskId: z.ZodString;
|
|
83
|
+
gate: z.ZodString;
|
|
84
|
+
verdict: z.ZodEnum<{
|
|
85
|
+
pass: "pass";
|
|
86
|
+
fail: "fail";
|
|
87
|
+
skip: "skip";
|
|
88
|
+
}>;
|
|
89
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
export type GateEvaluationEvent = z.infer<typeof GateEvaluationEventSchema>;
|
|
92
|
+
export declare const FileReservationEventSchema: z.ZodObject<{
|
|
93
|
+
timestamp: z.ZodString;
|
|
94
|
+
sessionId: z.ZodString;
|
|
95
|
+
version: z.ZodDefault<z.ZodString>;
|
|
96
|
+
type: z.ZodLiteral<"file_reservation">;
|
|
97
|
+
taskId: z.ZodString;
|
|
98
|
+
files: z.ZodArray<z.ZodString>;
|
|
99
|
+
action: z.ZodEnum<{
|
|
100
|
+
reserve: "reserve";
|
|
101
|
+
release: "release";
|
|
102
|
+
}>;
|
|
103
|
+
worktreeId: z.ZodOptional<z.ZodString>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
export type FileReservationEvent = z.infer<typeof FileReservationEventSchema>;
|
|
106
|
+
export declare const PhaseTransitionEventSchema: z.ZodObject<{
|
|
107
|
+
timestamp: z.ZodString;
|
|
108
|
+
sessionId: z.ZodString;
|
|
109
|
+
version: z.ZodDefault<z.ZodString>;
|
|
110
|
+
type: z.ZodLiteral<"phase_transition">;
|
|
111
|
+
phase: z.ZodNumber;
|
|
112
|
+
transition: z.ZodEnum<{
|
|
113
|
+
complete: "complete";
|
|
114
|
+
start: "start";
|
|
115
|
+
}>;
|
|
116
|
+
taskCount: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
export type PhaseTransitionEvent = z.infer<typeof PhaseTransitionEventSchema>;
|
|
119
|
+
export declare const FileTouchEventSchema: z.ZodObject<{
|
|
120
|
+
timestamp: z.ZodString;
|
|
121
|
+
sessionId: z.ZodString;
|
|
122
|
+
version: z.ZodDefault<z.ZodString>;
|
|
123
|
+
type: z.ZodLiteral<"file_touch">;
|
|
124
|
+
taskId: z.ZodNullable<z.ZodString>;
|
|
125
|
+
filePath: z.ZodString;
|
|
126
|
+
operation: z.ZodEnum<{
|
|
127
|
+
rename: "rename";
|
|
128
|
+
write: "write";
|
|
129
|
+
delete: "delete";
|
|
130
|
+
}>;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
export type FileTouchEvent = z.infer<typeof FileTouchEventSchema>;
|
|
133
|
+
export declare const StateFileUpdateEventSchema: z.ZodObject<{
|
|
134
|
+
timestamp: z.ZodString;
|
|
135
|
+
sessionId: z.ZodString;
|
|
136
|
+
version: z.ZodDefault<z.ZodString>;
|
|
137
|
+
type: z.ZodLiteral<"state_file_update">;
|
|
138
|
+
filePath: z.ZodString;
|
|
139
|
+
fileType: z.ZodEnum<{
|
|
140
|
+
evidence: "evidence";
|
|
141
|
+
other: "other";
|
|
142
|
+
plan_json: "plan_json";
|
|
143
|
+
plan_md: "plan_md";
|
|
144
|
+
context_md: "context_md";
|
|
145
|
+
}>;
|
|
146
|
+
}, z.core.$strip>;
|
|
147
|
+
export type StateFileUpdateEvent = z.infer<typeof StateFileUpdateEventSchema>;
|
|
148
|
+
export declare const ParallelWaveStartEventSchema: z.ZodObject<{
|
|
149
|
+
timestamp: z.ZodString;
|
|
150
|
+
sessionId: z.ZodString;
|
|
151
|
+
version: z.ZodDefault<z.ZodString>;
|
|
152
|
+
type: z.ZodLiteral<"parallel_wave_start">;
|
|
153
|
+
waveIndex: z.ZodNumber;
|
|
154
|
+
totalWaves: z.ZodNumber;
|
|
155
|
+
taskIds: z.ZodArray<z.ZodString>;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
export type ParallelWaveStartEvent = z.infer<typeof ParallelWaveStartEventSchema>;
|
|
158
|
+
export declare const ParallelWaveEndEventSchema: z.ZodObject<{
|
|
159
|
+
timestamp: z.ZodString;
|
|
160
|
+
sessionId: z.ZodString;
|
|
161
|
+
version: z.ZodDefault<z.ZodString>;
|
|
162
|
+
type: z.ZodLiteral<"parallel_wave_end">;
|
|
163
|
+
waveIndex: z.ZodNumber;
|
|
164
|
+
outcomes: z.ZodArray<z.ZodObject<{
|
|
165
|
+
taskId: z.ZodString;
|
|
166
|
+
success: z.ZodBoolean;
|
|
167
|
+
}, z.core.$strip>>;
|
|
168
|
+
mergeConflicts: z.ZodNumber;
|
|
169
|
+
}, z.core.$strip>;
|
|
170
|
+
export type ParallelWaveEndEvent = z.infer<typeof ParallelWaveEndEventSchema>;
|
|
171
|
+
export declare const SwarmEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
172
|
+
timestamp: z.ZodString;
|
|
173
|
+
sessionId: z.ZodString;
|
|
174
|
+
version: z.ZodDefault<z.ZodString>;
|
|
175
|
+
type: z.ZodLiteral<"session_metadata">;
|
|
176
|
+
swarmDir: z.ZodString;
|
|
177
|
+
pid: z.ZodNumber;
|
|
178
|
+
platform: z.ZodString;
|
|
179
|
+
nodeVersion: z.ZodString;
|
|
180
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
181
|
+
timestamp: z.ZodString;
|
|
182
|
+
sessionId: z.ZodString;
|
|
183
|
+
version: z.ZodDefault<z.ZodString>;
|
|
184
|
+
type: z.ZodLiteral<"delegation_start">;
|
|
185
|
+
taskId: z.ZodNullable<z.ZodString>;
|
|
186
|
+
targetAgent: z.ZodString;
|
|
187
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
188
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
189
|
+
timestamp: z.ZodString;
|
|
190
|
+
sessionId: z.ZodString;
|
|
191
|
+
version: z.ZodDefault<z.ZodString>;
|
|
192
|
+
type: z.ZodLiteral<"delegation_end">;
|
|
193
|
+
taskId: z.ZodNullable<z.ZodString>;
|
|
194
|
+
targetAgent: z.ZodString;
|
|
195
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
196
|
+
verdict: z.ZodOptional<z.ZodString>;
|
|
197
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
198
|
+
timestamp: z.ZodString;
|
|
199
|
+
sessionId: z.ZodString;
|
|
200
|
+
version: z.ZodDefault<z.ZodString>;
|
|
201
|
+
type: z.ZodLiteral<"agent_status">;
|
|
202
|
+
agentName: z.ZodString;
|
|
203
|
+
status: z.ZodEnum<{
|
|
204
|
+
complete: "complete";
|
|
205
|
+
idle: "idle";
|
|
206
|
+
active: "active";
|
|
207
|
+
}>;
|
|
208
|
+
worktreeId: z.ZodOptional<z.ZodString>;
|
|
209
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
210
|
+
timestamp: z.ZodString;
|
|
211
|
+
sessionId: z.ZodString;
|
|
212
|
+
version: z.ZodDefault<z.ZodString>;
|
|
213
|
+
type: z.ZodLiteral<"token_usage">;
|
|
214
|
+
agentName: z.ZodString;
|
|
215
|
+
inputTokens: z.ZodNumber;
|
|
216
|
+
outputTokens: z.ZodNumber;
|
|
217
|
+
model: z.ZodOptional<z.ZodString>;
|
|
218
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
219
|
+
timestamp: z.ZodString;
|
|
220
|
+
sessionId: z.ZodString;
|
|
221
|
+
version: z.ZodDefault<z.ZodString>;
|
|
222
|
+
type: z.ZodLiteral<"tool_invocation">;
|
|
223
|
+
toolName: z.ZodString;
|
|
224
|
+
taskId: z.ZodNullable<z.ZodString>;
|
|
225
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
226
|
+
success: z.ZodOptional<z.ZodBoolean>;
|
|
227
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
228
|
+
timestamp: z.ZodString;
|
|
229
|
+
sessionId: z.ZodString;
|
|
230
|
+
version: z.ZodDefault<z.ZodString>;
|
|
231
|
+
type: z.ZodLiteral<"gate_evaluation">;
|
|
232
|
+
taskId: z.ZodString;
|
|
233
|
+
gate: z.ZodString;
|
|
234
|
+
verdict: z.ZodEnum<{
|
|
235
|
+
pass: "pass";
|
|
236
|
+
fail: "fail";
|
|
237
|
+
skip: "skip";
|
|
238
|
+
}>;
|
|
239
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
240
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
241
|
+
timestamp: z.ZodString;
|
|
242
|
+
sessionId: z.ZodString;
|
|
243
|
+
version: z.ZodDefault<z.ZodString>;
|
|
244
|
+
type: z.ZodLiteral<"file_reservation">;
|
|
245
|
+
taskId: z.ZodString;
|
|
246
|
+
files: z.ZodArray<z.ZodString>;
|
|
247
|
+
action: z.ZodEnum<{
|
|
248
|
+
reserve: "reserve";
|
|
249
|
+
release: "release";
|
|
250
|
+
}>;
|
|
251
|
+
worktreeId: z.ZodOptional<z.ZodString>;
|
|
252
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
253
|
+
timestamp: z.ZodString;
|
|
254
|
+
sessionId: z.ZodString;
|
|
255
|
+
version: z.ZodDefault<z.ZodString>;
|
|
256
|
+
type: z.ZodLiteral<"phase_transition">;
|
|
257
|
+
phase: z.ZodNumber;
|
|
258
|
+
transition: z.ZodEnum<{
|
|
259
|
+
complete: "complete";
|
|
260
|
+
start: "start";
|
|
261
|
+
}>;
|
|
262
|
+
taskCount: z.ZodOptional<z.ZodNumber>;
|
|
263
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
264
|
+
timestamp: z.ZodString;
|
|
265
|
+
sessionId: z.ZodString;
|
|
266
|
+
version: z.ZodDefault<z.ZodString>;
|
|
267
|
+
type: z.ZodLiteral<"file_touch">;
|
|
268
|
+
taskId: z.ZodNullable<z.ZodString>;
|
|
269
|
+
filePath: z.ZodString;
|
|
270
|
+
operation: z.ZodEnum<{
|
|
271
|
+
rename: "rename";
|
|
272
|
+
write: "write";
|
|
273
|
+
delete: "delete";
|
|
274
|
+
}>;
|
|
275
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
276
|
+
timestamp: z.ZodString;
|
|
277
|
+
sessionId: z.ZodString;
|
|
278
|
+
version: z.ZodDefault<z.ZodString>;
|
|
279
|
+
type: z.ZodLiteral<"state_file_update">;
|
|
280
|
+
filePath: z.ZodString;
|
|
281
|
+
fileType: z.ZodEnum<{
|
|
282
|
+
evidence: "evidence";
|
|
283
|
+
other: "other";
|
|
284
|
+
plan_json: "plan_json";
|
|
285
|
+
plan_md: "plan_md";
|
|
286
|
+
context_md: "context_md";
|
|
287
|
+
}>;
|
|
288
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
289
|
+
timestamp: z.ZodString;
|
|
290
|
+
sessionId: z.ZodString;
|
|
291
|
+
version: z.ZodDefault<z.ZodString>;
|
|
292
|
+
type: z.ZodLiteral<"parallel_wave_start">;
|
|
293
|
+
waveIndex: z.ZodNumber;
|
|
294
|
+
totalWaves: z.ZodNumber;
|
|
295
|
+
taskIds: z.ZodArray<z.ZodString>;
|
|
296
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
297
|
+
timestamp: z.ZodString;
|
|
298
|
+
sessionId: z.ZodString;
|
|
299
|
+
version: z.ZodDefault<z.ZodString>;
|
|
300
|
+
type: z.ZodLiteral<"parallel_wave_end">;
|
|
301
|
+
waveIndex: z.ZodNumber;
|
|
302
|
+
outcomes: z.ZodArray<z.ZodObject<{
|
|
303
|
+
taskId: z.ZodString;
|
|
304
|
+
success: z.ZodBoolean;
|
|
305
|
+
}, z.core.$strip>>;
|
|
306
|
+
mergeConflicts: z.ZodNumber;
|
|
307
|
+
}, z.core.$strip>], "type">;
|
|
308
|
+
export type SwarmEvent = z.infer<typeof SwarmEventSchema>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentStatusEvent, DelegationEndEvent, DelegationStartEvent, FileReservationEvent, FileTouchEvent, GateEvaluationEvent, ParallelWaveEndEvent, ParallelWaveStartEvent, PhaseTransitionEvent, SessionMetadataEvent, StateFileUpdateEvent, SwarmEvent, TokenUsageEvent, ToolInvocationEvent } from './events';
|
|
2
|
+
export declare function isSessionMetadata(e: SwarmEvent): e is SessionMetadataEvent;
|
|
3
|
+
export declare function isDelegationStart(e: SwarmEvent): e is DelegationStartEvent;
|
|
4
|
+
export declare function isDelegationEnd(e: SwarmEvent): e is DelegationEndEvent;
|
|
5
|
+
export declare function isAgentStatus(e: SwarmEvent): e is AgentStatusEvent;
|
|
6
|
+
export declare function isTokenUsage(e: SwarmEvent): e is TokenUsageEvent;
|
|
7
|
+
export declare function isToolInvocation(e: SwarmEvent): e is ToolInvocationEvent;
|
|
8
|
+
export declare function isGateEvaluation(e: SwarmEvent): e is GateEvaluationEvent;
|
|
9
|
+
export declare function isFileReservation(e: SwarmEvent): e is FileReservationEvent;
|
|
10
|
+
export declare function isPhaseTransition(e: SwarmEvent): e is PhaseTransitionEvent;
|
|
11
|
+
export declare function isFileTouch(e: SwarmEvent): e is FileTouchEvent;
|
|
12
|
+
export declare function isStateFileUpdate(e: SwarmEvent): e is StateFileUpdateEvent;
|
|
13
|
+
export declare function isParallelWaveStart(e: SwarmEvent): e is ParallelWaveStartEvent;
|
|
14
|
+
export declare function isParallelWaveEnd(e: SwarmEvent): e is ParallelWaveEndEvent;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { AgentStatusEvent, DelegationEndEvent, DelegationStartEvent, FileReservationEvent, FileTouchEvent, GateEvaluationEvent, ParallelWaveEndEvent, ParallelWaveStartEvent, PhaseTransitionEvent, SessionMetadataEvent, StateFileUpdateEvent, SwarmEvent, SwarmEventBase, TokenUsageEvent, ToolInvocationEvent, } from './events';
|
|
2
|
+
export { AgentStatusEventSchema, DelegationEndEventSchema, DelegationStartEventSchema, FileReservationEventSchema, FileTouchEventSchema, GateEvaluationEventSchema, ParallelWaveEndEventSchema, ParallelWaveStartEventSchema, PhaseTransitionEventSchema, SessionMetadataEventSchema, StateFileUpdateEventSchema, SwarmEventBaseSchema, SwarmEventSchema, TokenUsageEventSchema, ToolInvocationEventSchema, } from './events';
|
|
3
|
+
export { isAgentStatus, isDelegationEnd, isDelegationStart, isFileReservation, isFileTouch, isGateEvaluation, isParallelWaveEnd, isParallelWaveStart, isPhaseTransition, isSessionMetadata, isStateFileUpdate, isTokenUsage, isToolInvocation, } from './guards';
|
|
4
|
+
export { TELEMETRY_SCHEMA_VERSION } from './version';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TELEMETRY_SCHEMA_VERSION = "1.0.0";
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { composeHandlers, estimateTokens, readSwarmFileAsync, safeHook, validateSwarmPath, } from '@opencode-swarm/core';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { executeWriteRetro, type WriteRetroArgs, } from '@opencode-swarm/core';
|
package/package.json
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-beta.1",
|
|
4
4
|
"description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "dist/index.js",
|
|
6
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"source": "./src/index.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
7
15
|
"bin": {
|
|
8
16
|
"opencode-swarm": "./dist/cli/index.js"
|
|
9
17
|
},
|
|
10
|
-
"type": "module",
|
|
11
18
|
"license": "MIT",
|
|
12
19
|
"repository": {
|
|
13
20
|
"type": "git",
|
|
@@ -34,29 +41,21 @@
|
|
|
34
41
|
"LICENSE"
|
|
35
42
|
],
|
|
36
43
|
"scripts": {
|
|
44
|
+
"build": "bun run clean && bun run ../../scripts/copy-grammars.ts && bun build src/index.ts --outdir dist --target bun --format esm && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm && bun run ../../scripts/copy-grammars.ts --to-dist && tsc --emitDeclarationOnly && bun run move-declarations",
|
|
45
|
+
"move-declarations": "node -e \"const fs=require('fs');const path=require('path');function m(d){if(!fs.existsSync(d))return;fs.readdirSync(d).forEach(f=>{const src=path.join(d,f),dst=path.join('dist',f);if(fs.statSync(src).isDirectory()){fs.mkdirSync(dst,{recursive:true});m(src)}else{fs.copyFileSync(src,dst)}})};m('dist/opencode/src');fs.rmSync('dist/opencode',{recursive:true});fs.rmSync('dist/core',{recursive:true})\"",
|
|
37
46
|
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
38
|
-
"build": "bun run clean && bun run scripts/copy-grammars.ts && bun build src/index.ts --outdir dist --target bun --format esm && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm && bun run scripts/copy-grammars.ts --to-dist && tsc --emitDeclarationOnly",
|
|
39
47
|
"typecheck": "tsc --noEmit",
|
|
40
48
|
"test": "bun test",
|
|
41
|
-
"lint": "biome lint .",
|
|
42
|
-
"format": "biome format . --write",
|
|
43
|
-
"check": "biome check --write .",
|
|
44
|
-
"dev": "bun run build && opencode",
|
|
45
49
|
"prepublishOnly": "bun run build"
|
|
46
50
|
},
|
|
47
51
|
"dependencies": {
|
|
52
|
+
"@opencode-swarm/core": "workspace:*",
|
|
48
53
|
"@opencode-ai/plugin": "^1.1.53",
|
|
49
54
|
"@opencode-ai/sdk": "^1.1.53",
|
|
50
|
-
"@vscode/tree-sitter-wasm": "^0.3.0",
|
|
51
|
-
"p-limit": "^7.3.0",
|
|
52
|
-
"proper-lockfile": "^4.1.2",
|
|
53
|
-
"web-tree-sitter": "^0.25.0",
|
|
54
55
|
"zod": "^4.1.8"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
|
-
"@biomejs/biome": "2.3.14",
|
|
58
58
|
"bun-types": "latest",
|
|
59
|
-
"js-yaml": "^4.1.1",
|
|
60
59
|
"typescript": "^5.7.3"
|
|
61
60
|
}
|
|
62
61
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/agents/coder.d.ts
DELETED
package/dist/agents/critic.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { AgentDefinition } from './architect';
|
|
2
|
-
export declare function createCriticAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
|
|
3
|
-
export declare function createCriticDriftAgent(model: string, customAppendPrompt?: string): AgentDefinition;
|
package/dist/agents/docs.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { AgentDefinition } from './architect';
|
|
2
|
-
export declare function createExplorerAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
|
|
3
|
-
export declare function createExplorerCuratorAgent(model: string, mode: 'CURATOR_INIT' | 'CURATOR_PHASE', customAppendPrompt?: string): AgentDefinition;
|
package/dist/agents/index.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { AgentConfig as SDKAgentConfig } from '@opencode-ai/sdk';
|
|
2
|
-
import { type PluginConfig } from '../config';
|
|
3
|
-
import { type AgentDefinition } from './architect';
|
|
4
|
-
export type { AgentDefinition } from './architect';
|
|
5
|
-
/**
|
|
6
|
-
* Strip the swarm prefix from an agent name to get the base name.
|
|
7
|
-
* e.g., "local_coder" with prefix "local" → "coder"
|
|
8
|
-
* Returns the name unchanged if no prefix matches.
|
|
9
|
-
*/
|
|
10
|
-
export declare function stripSwarmPrefix(agentName: string, swarmPrefix?: string): string;
|
|
11
|
-
/**
|
|
12
|
-
* Create all agent definitions with configuration applied
|
|
13
|
-
*/
|
|
14
|
-
export declare function createAgents(config?: PluginConfig): AgentDefinition[];
|
|
15
|
-
/**
|
|
16
|
-
* Get agent configurations formatted for the OpenCode SDK.
|
|
17
|
-
*/
|
|
18
|
-
export declare function getAgentConfigs(config?: PluginConfig): Record<string, SDKAgentConfig>;
|
|
19
|
-
export { createArchitectAgent } from './architect';
|
|
20
|
-
export { createCoderAgent } from './coder';
|
|
21
|
-
export { createCriticAgent } from './critic';
|
|
22
|
-
export { createDesignerAgent } from './designer';
|
|
23
|
-
export { createDocsAgent } from './docs';
|
|
24
|
-
export { createExplorerAgent } from './explorer';
|
|
25
|
-
export { createReviewerAgent, SECURITY_CATEGORIES, type SecurityCategory, } from './reviewer';
|
|
26
|
-
export { createSMEAgent } from './sme';
|
|
27
|
-
export { createTestEngineerAgent } from './test-engineer';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { AgentDefinition } from './architect';
|
|
2
|
-
/** OWASP Top 10 2021 categories for security-focused review passes */
|
|
3
|
-
export declare const SECURITY_CATEGORIES: readonly ["broken-access-control", "cryptographic-failures", "injection", "insecure-design", "security-misconfiguration", "vulnerable-components", "auth-failures", "data-integrity-failures", "logging-monitoring-failures", "ssrf"];
|
|
4
|
-
export type SecurityCategory = (typeof SECURITY_CATEGORIES)[number];
|
|
5
|
-
export declare function createReviewerAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
|
package/dist/agents/sme.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Circuit Breaker + Loop Protection Primitives
|
|
3
|
-
*
|
|
4
|
-
* Provides fault tolerance and infinite loop prevention for background automation.
|
|
5
|
-
*/
|
|
6
|
-
/** Circuit breaker states */
|
|
7
|
-
export type CircuitBreakerState = 'closed' | 'open' | 'half-open';
|
|
8
|
-
/** Circuit breaker configuration */
|
|
9
|
-
export interface CircuitBreakerConfig {
|
|
10
|
-
/** Number of failures before opening circuit */
|
|
11
|
-
failureThreshold: number;
|
|
12
|
-
/** Time in ms to wait before attempting reset */
|
|
13
|
-
resetTimeoutMs: number;
|
|
14
|
-
/** Number of success calls needed to close from half-open */
|
|
15
|
-
successThreshold: number;
|
|
16
|
-
/** Timeout for individual calls (0 = no timeout) */
|
|
17
|
-
callTimeoutMs: number;
|
|
18
|
-
}
|
|
19
|
-
/** Circuit breaker events */
|
|
20
|
-
export interface CircuitBreakerEvents {
|
|
21
|
-
opened: {
|
|
22
|
-
timestamp: number;
|
|
23
|
-
failureCount: number;
|
|
24
|
-
};
|
|
25
|
-
closed: {
|
|
26
|
-
timestamp: number;
|
|
27
|
-
successCount: number;
|
|
28
|
-
};
|
|
29
|
-
'half-open': {
|
|
30
|
-
timestamp: number;
|
|
31
|
-
};
|
|
32
|
-
callSuccess: {
|
|
33
|
-
duration: number;
|
|
34
|
-
};
|
|
35
|
-
callFailure: {
|
|
36
|
-
error: unknown;
|
|
37
|
-
duration: number;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
export type CircuitBreakerEventType = keyof CircuitBreakerEvents;
|
|
41
|
-
/**
|
|
42
|
-
* Circuit Breaker Implementation
|
|
43
|
-
*
|
|
44
|
-
* Prevents cascading failures by stopping requests when the circuit is open.
|
|
45
|
-
* States:
|
|
46
|
-
* - closed: Normal operation, requests pass through
|
|
47
|
-
* - open: Circuit is open, requests fail fast
|
|
48
|
-
* - half-open: Testing if service recovered
|
|
49
|
-
*/
|
|
50
|
-
export declare class CircuitBreaker {
|
|
51
|
-
private state;
|
|
52
|
-
private failureCount;
|
|
53
|
-
private successCount;
|
|
54
|
-
private lastFailureTime?;
|
|
55
|
-
private readonly config;
|
|
56
|
-
private readonly name;
|
|
57
|
-
private readonly onStateChange?;
|
|
58
|
-
constructor(name: string, config?: Partial<CircuitBreakerConfig>, onStateChange?: (eventType: string, event: unknown) => void);
|
|
59
|
-
/**
|
|
60
|
-
* Get current circuit state
|
|
61
|
-
*/
|
|
62
|
-
getState(): CircuitBreakerState;
|
|
63
|
-
/**
|
|
64
|
-
* Execute a function with circuit breaker protection
|
|
65
|
-
*/
|
|
66
|
-
execute<T>(fn: () => Promise<T>): Promise<T>;
|
|
67
|
-
/**
|
|
68
|
-
* Execute with timeout
|
|
69
|
-
*/
|
|
70
|
-
private executeWithTimeout;
|
|
71
|
-
/**
|
|
72
|
-
* Record a successful call
|
|
73
|
-
*/
|
|
74
|
-
private recordSuccess;
|
|
75
|
-
/**
|
|
76
|
-
* Record a failed call
|
|
77
|
-
*/
|
|
78
|
-
private recordFailure;
|
|
79
|
-
/**
|
|
80
|
-
* Transition to a new state
|
|
81
|
-
*/
|
|
82
|
-
private transitionTo;
|
|
83
|
-
/**
|
|
84
|
-
* Manually reset the circuit breaker
|
|
85
|
-
*/
|
|
86
|
-
reset(): void;
|
|
87
|
-
/**
|
|
88
|
-
* Get circuit breaker statistics
|
|
89
|
-
*/
|
|
90
|
-
getStats(): {
|
|
91
|
-
state: CircuitBreakerState;
|
|
92
|
-
failureCount: number;
|
|
93
|
-
successCount: number;
|
|
94
|
-
lastFailureTime?: number;
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Loop Protection for preventing infinite automation loops
|
|
99
|
-
*
|
|
100
|
-
* Tracks operation history and detects potential infinite loops.
|
|
101
|
-
*/
|
|
102
|
-
export interface LoopProtectionConfig {
|
|
103
|
-
/** Maximum times an operation can be attempted */
|
|
104
|
-
maxIterations: number;
|
|
105
|
-
/** Time window in ms to track iterations */
|
|
106
|
-
timeWindowMs: number;
|
|
107
|
-
/** Unique key for the operation being protected */
|
|
108
|
-
operationKey: string;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Loop Protection Implementation
|
|
112
|
-
*
|
|
113
|
-
* Prevents infinite loops by tracking operation frequency.
|
|
114
|
-
*/
|
|
115
|
-
export declare class LoopProtection {
|
|
116
|
-
private records;
|
|
117
|
-
private readonly config;
|
|
118
|
-
private readonly onLoopDetected?;
|
|
119
|
-
constructor(config: LoopProtectionConfig, onLoopDetected?: (key: string, count: number) => void);
|
|
120
|
-
/**
|
|
121
|
-
* Record an iteration attempt
|
|
122
|
-
* Returns false if max iterations exceeded
|
|
123
|
-
*/
|
|
124
|
-
recordAttempt(key?: string): boolean;
|
|
125
|
-
/**
|
|
126
|
-
* Check if operation is allowed without recording
|
|
127
|
-
*/
|
|
128
|
-
canProceed(key?: string): boolean;
|
|
129
|
-
/**
|
|
130
|
-
* Get remaining iterations allowed
|
|
131
|
-
*/
|
|
132
|
-
getRemainingIterations(key?: string): number;
|
|
133
|
-
/**
|
|
134
|
-
* Reset tracking for an operation
|
|
135
|
-
*/
|
|
136
|
-
reset(key?: string): void;
|
|
137
|
-
/**
|
|
138
|
-
* Reset all tracking
|
|
139
|
-
*/
|
|
140
|
-
resetAll(): void;
|
|
141
|
-
/**
|
|
142
|
-
* Get current iteration count
|
|
143
|
-
*/
|
|
144
|
-
getIterationCount(key?: string): number;
|
|
145
|
-
/**
|
|
146
|
-
* Get all operation keys being tracked
|
|
147
|
-
*/
|
|
148
|
-
getTrackedOperations(): string[];
|
|
149
|
-
}
|