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
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Evidence Summary Service
|
|
3
|
-
*
|
|
4
|
-
* Provides deterministic evidence aggregation per task and phase.
|
|
5
|
-
* Produces machine-readable and human-readable summary artifacts.
|
|
6
|
-
*/
|
|
7
|
-
import type { PhaseStatus, TaskStatus } from '../config/plan-schema';
|
|
8
|
-
/** Evidence types required for task completion */
|
|
9
|
-
export declare const REQUIRED_EVIDENCE_TYPES: readonly ["review", "test"];
|
|
10
|
-
export type RequiredEvidenceType = (typeof REQUIRED_EVIDENCE_TYPES)[number];
|
|
11
|
-
/** Summary artifact schema version */
|
|
12
|
-
export declare const EVIDENCE_SUMMARY_VERSION = "1.0.0";
|
|
13
|
-
/** Evidence summary for a single task */
|
|
14
|
-
export interface TaskEvidenceSummary {
|
|
15
|
-
taskId: string;
|
|
16
|
-
phase: number;
|
|
17
|
-
taskStatus: TaskStatus;
|
|
18
|
-
evidenceCount: number;
|
|
19
|
-
hasReview: boolean;
|
|
20
|
-
hasTest: boolean;
|
|
21
|
-
hasApproval: boolean;
|
|
22
|
-
missingEvidence: string[];
|
|
23
|
-
isComplete: boolean;
|
|
24
|
-
blockers: string[];
|
|
25
|
-
lastEvidenceTimestamp: string | null;
|
|
26
|
-
}
|
|
27
|
-
/** Phase evidence summary */
|
|
28
|
-
export interface PhaseEvidenceSummary {
|
|
29
|
-
phaseId: number;
|
|
30
|
-
phaseName: string;
|
|
31
|
-
phaseStatus: PhaseStatus;
|
|
32
|
-
totalTasks: number;
|
|
33
|
-
completedTasks: number;
|
|
34
|
-
tasksWithEvidence: number;
|
|
35
|
-
tasksWithCompleteEvidence: number;
|
|
36
|
-
completionRatio: number;
|
|
37
|
-
missingEvidenceByType: Record<string, string[]>;
|
|
38
|
-
blockers: PhaseBlocker[];
|
|
39
|
-
tasks: TaskEvidenceSummary[];
|
|
40
|
-
}
|
|
41
|
-
/** Blockers preventing phase closure */
|
|
42
|
-
export interface PhaseBlocker {
|
|
43
|
-
type: 'missing_evidence' | 'incomplete_task' | 'blocked_task';
|
|
44
|
-
taskId: string;
|
|
45
|
-
reason: string;
|
|
46
|
-
severity: 'high' | 'medium' | 'low';
|
|
47
|
-
}
|
|
48
|
-
/** Full evidence summary artifact */
|
|
49
|
-
export interface EvidenceSummaryArtifact {
|
|
50
|
-
schema_version: typeof EVIDENCE_SUMMARY_VERSION;
|
|
51
|
-
generated_at: string;
|
|
52
|
-
planTitle: string;
|
|
53
|
-
currentPhase: number;
|
|
54
|
-
phaseSummaries: PhaseEvidenceSummary[];
|
|
55
|
-
overallCompletionRatio: number;
|
|
56
|
-
overallBlockers: PhaseBlocker[];
|
|
57
|
-
summaryText: string;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Build complete evidence summary artifact
|
|
61
|
-
*
|
|
62
|
-
* Aggregates evidence per task and phase, producing deterministic
|
|
63
|
-
* summary artifacts including completion ratio, missing evidence,
|
|
64
|
-
* blockers, and per-task status.
|
|
65
|
-
*/
|
|
66
|
-
export declare function buildEvidenceSummary(directory: string, currentPhase?: number): Promise<EvidenceSummaryArtifact | null>;
|
|
67
|
-
/**
|
|
68
|
-
* Check if auto-summaries are enabled via feature flags
|
|
69
|
-
*/
|
|
70
|
-
export declare function isAutoSummaryEnabled(automationConfig?: {
|
|
71
|
-
capabilities?: {
|
|
72
|
-
evidence_auto_summaries?: boolean;
|
|
73
|
-
};
|
|
74
|
-
mode?: string;
|
|
75
|
-
}): boolean;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Structured export data.
|
|
3
|
-
*/
|
|
4
|
-
export interface ExportData {
|
|
5
|
-
version: string;
|
|
6
|
-
exported: string;
|
|
7
|
-
plan: unknown;
|
|
8
|
-
context: string | null;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Get export data from the swarm directory.
|
|
12
|
-
* Returns structured data for GUI, background flows, or commands.
|
|
13
|
-
*/
|
|
14
|
-
export declare function getExportData(directory: string): Promise<ExportData>;
|
|
15
|
-
/**
|
|
16
|
-
* Format export data as markdown with JSON code block for command output.
|
|
17
|
-
*/
|
|
18
|
-
export declare function formatExportMarkdown(exportData: ExportData): string;
|
|
19
|
-
/**
|
|
20
|
-
* Handle export command - delegates to service and formats output.
|
|
21
|
-
* Kept for backward compatibility - thin adapter.
|
|
22
|
-
*/
|
|
23
|
-
export declare function handleExportCommand(directory: string, _args: string[]): Promise<string>;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Handoff Service
|
|
3
|
-
*
|
|
4
|
-
* Provides structured handoff data for agent transitions between swarm sessions.
|
|
5
|
-
* Reads from .swarm files to gather current state for context-efficient handoffs.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Pending QA state from agent sessions
|
|
9
|
-
*/
|
|
10
|
-
export interface PendingQA {
|
|
11
|
-
taskId: string;
|
|
12
|
-
lastFailure: string | null;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Delegation chain entry
|
|
16
|
-
*/
|
|
17
|
-
export interface DelegationEntry {
|
|
18
|
-
from: string;
|
|
19
|
-
to: string;
|
|
20
|
-
taskId: string;
|
|
21
|
-
timestamp: number;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Delegation state from session snapshot
|
|
25
|
-
*/
|
|
26
|
-
export interface DelegationState {
|
|
27
|
-
activeChains: string[];
|
|
28
|
-
delegationDepth: number;
|
|
29
|
-
pendingHandoffs: string[];
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Structured handoff data for agent transitions
|
|
33
|
-
*/
|
|
34
|
-
export interface HandoffData {
|
|
35
|
-
/** ISO timestamp when data was generated */
|
|
36
|
-
generated: string;
|
|
37
|
-
/** Current phase number or name */
|
|
38
|
-
currentPhase: string | null;
|
|
39
|
-
/** Current task ID being worked on */
|
|
40
|
-
currentTask: string | null;
|
|
41
|
-
/** List of incomplete task IDs */
|
|
42
|
-
incompleteTasks: string[];
|
|
43
|
-
/** Pending QA state */
|
|
44
|
-
pendingQA: PendingQA | null;
|
|
45
|
-
/** Active agent name */
|
|
46
|
-
activeAgent: string | null;
|
|
47
|
-
/** Recent decisions from context.md */
|
|
48
|
-
recentDecisions: string[];
|
|
49
|
-
/** Delegation state */
|
|
50
|
-
delegationState: DelegationState | null;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Get handoff data from the swarm directory.
|
|
54
|
-
* Reads session state, plan, and context to build comprehensive handoff info.
|
|
55
|
-
*/
|
|
56
|
-
export declare function getHandoffData(directory: string): Promise<HandoffData>;
|
|
57
|
-
/**
|
|
58
|
-
* Format handoff data as terse markdown for LLM consumption.
|
|
59
|
-
* Targets under 2K tokens for efficient context injection.
|
|
60
|
-
*/
|
|
61
|
-
export declare function formatHandoffMarkdown(data: HandoffData): string;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Structured history data for a single phase.
|
|
3
|
-
*/
|
|
4
|
-
export interface PhaseHistoryData {
|
|
5
|
-
id: number;
|
|
6
|
-
name: string;
|
|
7
|
-
status: 'complete' | 'in_progress' | 'pending' | 'blocked';
|
|
8
|
-
statusText: string;
|
|
9
|
-
statusIcon: string;
|
|
10
|
-
completedTasks: number;
|
|
11
|
-
totalTasks: number;
|
|
12
|
-
tasksDisplay: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Structured history data returned by the history service.
|
|
16
|
-
*/
|
|
17
|
-
export interface HistoryData {
|
|
18
|
-
hasPlan: boolean;
|
|
19
|
-
phases: PhaseHistoryData[];
|
|
20
|
-
isLegacy: boolean;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Get history data from the swarm directory.
|
|
24
|
-
* Returns structured data for GUI, background flows, or commands.
|
|
25
|
-
*/
|
|
26
|
-
export declare function getHistoryData(directory: string): Promise<HistoryData>;
|
|
27
|
-
/**
|
|
28
|
-
* Format history data as markdown for command output.
|
|
29
|
-
*/
|
|
30
|
-
export declare function formatHistoryMarkdown(history: HistoryData): string;
|
|
31
|
-
/**
|
|
32
|
-
* Handle history command - delegates to service and formats output.
|
|
33
|
-
* Kept for backward compatibility - thin adapter.
|
|
34
|
-
*/
|
|
35
|
-
export declare function handleHistoryCommand(directory: string, _args: string[]): Promise<string>;
|
package/dist/services/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { analyzeDecisionDrift, DEFAULT_DRIFT_CONFIG, type Decision, type DriftAnalysisResult, type DriftAnalyzerConfig, type DriftSeverity, type DriftSignal, extractDecisionsFromContext, findContradictions, formatDriftForContext, } from './decision-drift-analyzer';
|
|
2
|
-
export { applySafeAutoFixes, type ConfigBackup, type ConfigDoctorResult, type ConfigFinding, type ConfigFix, createConfigBackup, type FindingSeverity, getConfigPaths, runConfigDoctor, runConfigDoctorWithFixes, shouldRunOnStartup, writeBackupArtifact, writeDoctorArtifact, } from './config-doctor';
|
|
3
|
-
export { type BudgetState, type ContextBudgetConfig, type ContextBudgetReport, DEFAULT_CONTEXT_BUDGET_CONFIG, estimateTokens, formatBudgetWarning, getContextBudgetReport, getDefaultConfig, } from './context-budget-service';
|
|
4
|
-
export { type DiagnoseData, formatDiagnoseMarkdown, getDiagnoseData, type HealthCheck, handleDiagnoseCommand, } from './diagnose-service';
|
|
5
|
-
export { type EvidenceEntryData, type EvidenceListData, formatEvidenceListMarkdown, formatTaskEvidenceMarkdown, getEvidenceListData, getTaskEvidenceData, getVerdictEmoji, handleEvidenceCommand, type TaskEvidenceData, } from './evidence-service';
|
|
6
|
-
export { buildEvidenceSummary, EVIDENCE_SUMMARY_VERSION, type EvidenceSummaryArtifact, isAutoSummaryEnabled, type PhaseBlocker, type PhaseEvidenceSummary, REQUIRED_EVIDENCE_TYPES, type TaskEvidenceSummary, } from './evidence-summary-service';
|
|
7
|
-
export { type ExportData, formatExportMarkdown, getExportData, handleExportCommand, } from './export-service';
|
|
8
|
-
export { type DelegationState, formatHandoffMarkdown, getHandoffData, type HandoffData, type PendingQA, } from './handoff-service';
|
|
9
|
-
export { formatHistoryMarkdown, getHistoryData, type HistoryData, handleHistoryCommand, type PhaseHistoryData, } from './history-service';
|
|
10
|
-
export { formatPlanMarkdown, getPlanData, handlePlanCommand, type PlanData, } from './plan-service';
|
|
11
|
-
export { createPreflightIntegration, type PreflightIntegrationConfig, runManualPreflight, } from './preflight-integration';
|
|
12
|
-
export { formatPreflightMarkdown, handlePreflightCommand, type PreflightCheckResult, type PreflightCheckType, type PreflightConfig, type PreflightReport, runPreflight, } from './preflight-service';
|
|
13
|
-
export { formatStatusMarkdown, getStatusData, handleStatusCommand, type StatusData, } from './status-service';
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Structured plan data for a specific phase or full plan.
|
|
3
|
-
*/
|
|
4
|
-
export interface PlanData {
|
|
5
|
-
hasPlan: boolean;
|
|
6
|
-
fullMarkdown: string;
|
|
7
|
-
requestedPhase: number | null;
|
|
8
|
-
phaseMarkdown: string | null;
|
|
9
|
-
errorMessage: string | null;
|
|
10
|
-
isLegacy: boolean;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Get plan data from the swarm directory.
|
|
14
|
-
* Returns structured data for GUI, background flows, or commands.
|
|
15
|
-
*/
|
|
16
|
-
export declare function getPlanData(directory: string, phaseArg?: string | number): Promise<PlanData>;
|
|
17
|
-
/**
|
|
18
|
-
* Format plan data as markdown for command output.
|
|
19
|
-
*/
|
|
20
|
-
export declare function formatPlanMarkdown(planData: PlanData): string;
|
|
21
|
-
/**
|
|
22
|
-
* Handle plan command - delegates to service and formats output.
|
|
23
|
-
* Kept for backward compatibility - thin adapter.
|
|
24
|
-
*/
|
|
25
|
-
export declare function handlePlanCommand(directory: string, args: string[]): Promise<string>;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Preflight Background Integration
|
|
3
|
-
*
|
|
4
|
-
* Wires the preflight service to background automation:
|
|
5
|
-
* - Subscribes to preflight.requested events
|
|
6
|
-
* - Runs preflight checks
|
|
7
|
-
* - Updates status artifact with results
|
|
8
|
-
*/
|
|
9
|
-
import { PreflightTriggerManager } from '../background/trigger';
|
|
10
|
-
import type { AutomationConfig } from '../config/schema';
|
|
11
|
-
import { type PreflightConfig, type PreflightReport } from '../services/preflight-service';
|
|
12
|
-
/** Integration configuration */
|
|
13
|
-
export interface PreflightIntegrationConfig {
|
|
14
|
-
/** Automation configuration (required for capability gating) */
|
|
15
|
-
automationConfig: AutomationConfig;
|
|
16
|
-
/** Directory to run preflight in */
|
|
17
|
-
directory: string;
|
|
18
|
-
/** Swarm directory for status artifact */
|
|
19
|
-
swarmDir: string;
|
|
20
|
-
/** Preflight check configuration */
|
|
21
|
-
preflightConfig?: PreflightConfig;
|
|
22
|
-
/** Whether to update status artifact (default true) */
|
|
23
|
-
updateStatusArtifact?: boolean;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Create preflight integration
|
|
27
|
-
*
|
|
28
|
-
* Sets up the handler that will be called when preflight is requested.
|
|
29
|
-
* Returns the trigger manager and cleanup function.
|
|
30
|
-
*/
|
|
31
|
-
export declare function createPreflightIntegration(config: PreflightIntegrationConfig): {
|
|
32
|
-
manager: PreflightTriggerManager;
|
|
33
|
-
cleanup: () => void;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Run preflight manually (for testing or CLI)
|
|
37
|
-
*/
|
|
38
|
-
export declare function runManualPreflight(directory: string, phase: number, config?: PreflightConfig): Promise<PreflightReport>;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Preflight Automation Service
|
|
3
|
-
*
|
|
4
|
-
* Runs automated preflight checks for release readiness:
|
|
5
|
-
* - lint check
|
|
6
|
-
* - tests check (sane verification scope)
|
|
7
|
-
* - secrets check
|
|
8
|
-
* - evidence completeness check
|
|
9
|
-
* - version consistency check
|
|
10
|
-
*
|
|
11
|
-
* Returns deterministic structured result with per-check status + overall verdict.
|
|
12
|
-
* Callable by background flow (from preflight.requested events).
|
|
13
|
-
*/
|
|
14
|
-
/** Preflight check types */
|
|
15
|
-
export type PreflightCheckType = 'lint' | 'tests' | 'secrets' | 'evidence' | 'version';
|
|
16
|
-
/** Individual check status */
|
|
17
|
-
export interface PreflightCheckResult {
|
|
18
|
-
type: PreflightCheckType;
|
|
19
|
-
status: 'pass' | 'fail' | 'skip' | 'error';
|
|
20
|
-
message: string;
|
|
21
|
-
details?: Record<string, unknown>;
|
|
22
|
-
durationMs?: number;
|
|
23
|
-
}
|
|
24
|
-
/** Preflight report structure */
|
|
25
|
-
export interface PreflightReport {
|
|
26
|
-
id: string;
|
|
27
|
-
timestamp: number;
|
|
28
|
-
phase: number;
|
|
29
|
-
overall: 'pass' | 'fail' | 'skipped';
|
|
30
|
-
checks: PreflightCheckResult[];
|
|
31
|
-
totalDurationMs: number;
|
|
32
|
-
message: string;
|
|
33
|
-
}
|
|
34
|
-
/** Preflight configuration */
|
|
35
|
-
export interface PreflightConfig {
|
|
36
|
-
/** Timeout per check in ms (default 60s, min 5s, max 300s) */
|
|
37
|
-
checkTimeoutMs?: number;
|
|
38
|
-
/** Skip tests check (default false) */
|
|
39
|
-
skipTests?: boolean;
|
|
40
|
-
/** Skip secrets check (default false) */
|
|
41
|
-
skipSecrets?: boolean;
|
|
42
|
-
/** Skip evidence check (default false) */
|
|
43
|
-
skipEvidence?: boolean;
|
|
44
|
-
/** Skip version check (default false) */
|
|
45
|
-
skipVersion?: boolean;
|
|
46
|
-
/** Test scope (default 'convention' for faster preflight) */
|
|
47
|
-
testScope?: 'all' | 'convention' | 'graph';
|
|
48
|
-
/** Linter to use (default 'biome') */
|
|
49
|
-
linter?: 'biome' | 'eslint';
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Run all preflight checks
|
|
53
|
-
*/
|
|
54
|
-
export declare function runPreflight(dir: string, phase: number, config?: PreflightConfig): Promise<PreflightReport>;
|
|
55
|
-
/**
|
|
56
|
-
* Format preflight report as markdown
|
|
57
|
-
*/
|
|
58
|
-
export declare function formatPreflightMarkdown(report: PreflightReport): string;
|
|
59
|
-
/**
|
|
60
|
-
* Handle preflight command - thin adapter for CLI
|
|
61
|
-
*/
|
|
62
|
-
export declare function handlePreflightCommand(directory: string, _args: string[]): Promise<string>;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Run Memory Service
|
|
3
|
-
*
|
|
4
|
-
* Provides append-only per-task outcome logging for tracking task execution
|
|
5
|
-
* results across swarm sessions. Used to avoid repeating known failure patterns.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Represents a single task execution outcome entry
|
|
9
|
-
*/
|
|
10
|
-
export interface RunMemoryEntry {
|
|
11
|
-
/** ISO timestamp when the entry was recorded */
|
|
12
|
-
timestamp: string;
|
|
13
|
-
/** Plan.json task ID (e.g. "3.2") */
|
|
14
|
-
taskId: string;
|
|
15
|
-
/** SHA256 hash of taskId + sorted file targets, first 8 chars */
|
|
16
|
-
taskFingerprint: string;
|
|
17
|
-
/** Which agent executed the task (e.g. "coder") */
|
|
18
|
-
agent: string;
|
|
19
|
-
/** Outcome of the task execution */
|
|
20
|
-
outcome: 'pass' | 'fail' | 'retry' | 'skip';
|
|
21
|
-
/** 1-indexed attempt number */
|
|
22
|
-
attemptNumber: number;
|
|
23
|
-
/** One-line failure reason (only for fail/retry outcomes) */
|
|
24
|
-
failureReason?: string;
|
|
25
|
-
/** Files that were modified during this attempt */
|
|
26
|
-
filesModified?: string[];
|
|
27
|
-
/** Wall-clock time in milliseconds */
|
|
28
|
-
durationMs?: number;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Generate a task fingerprint from taskId and file targets
|
|
32
|
-
*
|
|
33
|
-
* @param taskId - The task identifier
|
|
34
|
-
* @param fileTargets - Array of file paths that were targeted
|
|
35
|
-
* @returns First 8 characters of SHA256 hash
|
|
36
|
-
*/
|
|
37
|
-
export declare function generateTaskFingerprint(taskId: string, fileTargets: string[]): string;
|
|
38
|
-
/**
|
|
39
|
-
* Append a task outcome entry to the run memory log
|
|
40
|
-
*
|
|
41
|
-
* @param directory - The swarm workspace directory
|
|
42
|
-
* @param entry - The outcome entry to record
|
|
43
|
-
*/
|
|
44
|
-
export declare function recordOutcome(directory: string, entry: RunMemoryEntry): Promise<void>;
|
|
45
|
-
/**
|
|
46
|
-
* Get all entries for a specific task ID
|
|
47
|
-
*
|
|
48
|
-
* @param directory - The swarm workspace directory
|
|
49
|
-
* @param taskId - The task identifier to filter by
|
|
50
|
-
* @returns Array of matching entries
|
|
51
|
-
*/
|
|
52
|
-
export declare function getTaskHistory(directory: string, taskId: string): Promise<RunMemoryEntry[]>;
|
|
53
|
-
/**
|
|
54
|
-
* Get all failure and retry entries
|
|
55
|
-
*
|
|
56
|
-
* @param directory - The swarm workspace directory
|
|
57
|
-
* @returns Array of fail/retry entries
|
|
58
|
-
*/
|
|
59
|
-
export declare function getFailures(directory: string): Promise<RunMemoryEntry[]>;
|
|
60
|
-
/**
|
|
61
|
-
* Generate a compact summary of task failures for context injection
|
|
62
|
-
*
|
|
63
|
-
* @param directory - The swarm workspace directory
|
|
64
|
-
* @returns Formatted summary string (≤500 tokens) or null if no failures
|
|
65
|
-
*/
|
|
66
|
-
export declare function getRunMemorySummary(directory: string): Promise<string | null>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { AgentDefinition } from '../agents';
|
|
2
|
-
/**
|
|
3
|
-
* Structured status data returned by the status service.
|
|
4
|
-
* This can be used by GUI, background flows, or command adapters.
|
|
5
|
-
*/
|
|
6
|
-
export interface StatusData {
|
|
7
|
-
hasPlan: boolean;
|
|
8
|
-
currentPhase: string;
|
|
9
|
-
completedTasks: number;
|
|
10
|
-
totalTasks: number;
|
|
11
|
-
agentCount: number;
|
|
12
|
-
isLegacy: boolean;
|
|
13
|
-
turboMode: boolean;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Get status data from the swarm directory.
|
|
17
|
-
* Returns structured data that can be used by GUI, background flows, or commands.
|
|
18
|
-
*/
|
|
19
|
-
export declare function getStatusData(directory: string, agents: Record<string, AgentDefinition>): Promise<StatusData>;
|
|
20
|
-
/**
|
|
21
|
-
* Format status data as markdown for command output.
|
|
22
|
-
* This is the thin adapter that delegates to the service.
|
|
23
|
-
*/
|
|
24
|
-
export declare function formatStatusMarkdown(status: StatusData): string;
|
|
25
|
-
/**
|
|
26
|
-
* Handle status command - delegates to service and formats output.
|
|
27
|
-
* Kept for backward compatibility - thin adapter.
|
|
28
|
-
*/
|
|
29
|
-
export declare function handleStatusCommand(directory: string, agents: Record<string, AgentDefinition>): Promise<string>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session snapshot reader for OpenCode Swarm plugin.
|
|
3
|
-
* Reads .swarm/session/state.json and rehydrates swarmState on plugin init.
|
|
4
|
-
*/
|
|
5
|
-
import type { AgentSessionState } from '../state';
|
|
6
|
-
import type { SerializedAgentSession, SnapshotData } from './snapshot-writer';
|
|
7
|
-
/**
|
|
8
|
-
* Deserialize a SerializedAgentSession back to AgentSessionState.
|
|
9
|
-
* Handles Map/Set conversion and migration safety defaults.
|
|
10
|
-
*/
|
|
11
|
-
export declare function deserializeAgentSession(s: SerializedAgentSession): AgentSessionState;
|
|
12
|
-
/**
|
|
13
|
-
* Read the snapshot file from .swarm/session/state.json.
|
|
14
|
-
* Returns null if file doesn't exist, parse fails, or version is wrong.
|
|
15
|
-
* NEVER throws - always returns null on any error.
|
|
16
|
-
*/
|
|
17
|
-
export declare function readSnapshot(directory: string): Promise<SnapshotData | null>;
|
|
18
|
-
/**
|
|
19
|
-
* Rehydrate swarmState from a SnapshotData object.
|
|
20
|
-
* Clears existing maps first, then populates from snapshot.
|
|
21
|
-
* Does NOT touch activeToolCalls or pendingEvents (remain at defaults).
|
|
22
|
-
*/
|
|
23
|
-
export declare function rehydrateState(snapshot: SnapshotData): void;
|
|
24
|
-
/**
|
|
25
|
-
* Reconcile task workflow states from plan.json for all active sessions.
|
|
26
|
-
* Seeds completed plan tasks to 'tests_run' and in_progress tasks to 'coder_delegated'.
|
|
27
|
-
* Best-effort: returns silently on any file/parse error. NEVER throws.
|
|
28
|
-
*
|
|
29
|
-
* @param directory - The project root directory containing .swarm/plan.json
|
|
30
|
-
*/
|
|
31
|
-
export declare function reconcileTaskStatesFromPlan(directory: string): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* Load snapshot from disk and rehydrate swarmState.
|
|
34
|
-
* Called on plugin init to restore state from previous session.
|
|
35
|
-
* NEVER throws - swallows any errors silently.
|
|
36
|
-
*/
|
|
37
|
-
export declare function loadSnapshot(directory: string): Promise<void>;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session snapshot writer for OpenCode Swarm plugin.
|
|
3
|
-
* Serializes swarmState to .swarm/session/state.json using atomic write (temp-file + rename).
|
|
4
|
-
*/
|
|
5
|
-
import type { AgentSessionState, DelegationEntry, ToolAggregate } from '../state';
|
|
6
|
-
import { swarmState } from '../state';
|
|
7
|
-
/**
|
|
8
|
-
* Serialized form of AgentSessionState with Map/Set fields converted to plain arrays/objects
|
|
9
|
-
*/
|
|
10
|
-
export interface SerializedAgentSession {
|
|
11
|
-
agentName: string;
|
|
12
|
-
lastToolCallTime: number;
|
|
13
|
-
lastAgentEventTime: number;
|
|
14
|
-
delegationActive: boolean;
|
|
15
|
-
activeInvocationId: number;
|
|
16
|
-
lastInvocationIdByAgent: Record<string, number>;
|
|
17
|
-
windows: Record<string, SerializedInvocationWindow>;
|
|
18
|
-
lastCompactionHint: number;
|
|
19
|
-
architectWriteCount: number;
|
|
20
|
-
lastCoderDelegationTaskId: string | null;
|
|
21
|
-
currentTaskId: string | null;
|
|
22
|
-
turboMode: boolean;
|
|
23
|
-
gateLog: Record<string, string[]>;
|
|
24
|
-
reviewerCallCount: Record<string, number>;
|
|
25
|
-
lastGateFailure: {
|
|
26
|
-
tool: string;
|
|
27
|
-
taskId: string;
|
|
28
|
-
timestamp: number;
|
|
29
|
-
} | null;
|
|
30
|
-
partialGateWarningsIssuedForTask: string[];
|
|
31
|
-
selfFixAttempted: boolean;
|
|
32
|
-
selfCodingWarnedAtCount: number;
|
|
33
|
-
catastrophicPhaseWarnings: number[];
|
|
34
|
-
lastPhaseCompleteTimestamp: number;
|
|
35
|
-
lastPhaseCompletePhase: number;
|
|
36
|
-
phaseAgentsDispatched: string[];
|
|
37
|
-
lastCompletedPhaseAgentsDispatched: string[];
|
|
38
|
-
qaSkipCount: number;
|
|
39
|
-
qaSkipTaskIds: string[];
|
|
40
|
-
taskWorkflowStates?: Record<string, string>;
|
|
41
|
-
/** Flag for one-shot scope violation warning injection (omitted when undefined for additive-only schema) */
|
|
42
|
-
scopeViolationDetected?: boolean;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Minimal interface for serialized InvocationWindow
|
|
46
|
-
*/
|
|
47
|
-
interface SerializedInvocationWindow {
|
|
48
|
-
id: number;
|
|
49
|
-
agentName: string;
|
|
50
|
-
startedAtMs: number;
|
|
51
|
-
toolCalls: number;
|
|
52
|
-
consecutiveErrors: number;
|
|
53
|
-
hardLimitHit: boolean;
|
|
54
|
-
lastSuccessTimeMs: number;
|
|
55
|
-
recentToolCalls: Array<{
|
|
56
|
-
tool: string;
|
|
57
|
-
argsHash: number;
|
|
58
|
-
timestamp: number;
|
|
59
|
-
}>;
|
|
60
|
-
warningIssued: boolean;
|
|
61
|
-
warningReason: string;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Snapshot data structure written to disk
|
|
65
|
-
*/
|
|
66
|
-
export interface SnapshotData {
|
|
67
|
-
version: 1;
|
|
68
|
-
writtenAt: number;
|
|
69
|
-
toolAggregates: Record<string, ToolAggregate>;
|
|
70
|
-
activeAgent: Record<string, string>;
|
|
71
|
-
delegationChains: Record<string, DelegationEntry[]>;
|
|
72
|
-
agentSessions: Record<string, SerializedAgentSession>;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Convert a live AgentSessionState to its serialized form.
|
|
76
|
-
* Handles missing/undefined Map/Set fields gracefully (migration safety).
|
|
77
|
-
*/
|
|
78
|
-
export declare function serializeAgentSession(s: AgentSessionState): SerializedAgentSession;
|
|
79
|
-
/**
|
|
80
|
-
* Write a snapshot of swarmState to .swarm/session/state.json atomically.
|
|
81
|
-
* Silently swallows errors (non-fatal — never crash the plugin).
|
|
82
|
-
*/
|
|
83
|
-
export declare function writeSnapshot(directory: string, state: typeof swarmState): Promise<void>;
|
|
84
|
-
/**
|
|
85
|
-
* Create a snapshot writer hook suitable for use in tool.execute.after.
|
|
86
|
-
* Returns a hook function that writes the current swarmState to disk.
|
|
87
|
-
*/
|
|
88
|
-
export declare function createSnapshotWriterHook(directory: string): (input: unknown, output: unknown) => Promise<void>;
|
|
89
|
-
export {};
|
package/dist/skills/index.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skill definition with versioning and per-agent overlays
|
|
3
|
-
*/
|
|
4
|
-
export interface AgentOverlay {
|
|
5
|
-
agent: string;
|
|
6
|
-
prompt?: string;
|
|
7
|
-
model?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface SkillDefinition {
|
|
10
|
-
id: string;
|
|
11
|
-
name: string;
|
|
12
|
-
description: string;
|
|
13
|
-
SKILL_VERSION: number;
|
|
14
|
-
basePrompt?: string;
|
|
15
|
-
agents?: AgentOverlay[];
|
|
16
|
-
}
|
|
17
|
-
export declare const skills: SkillDefinition[];
|
|
18
|
-
export declare const AGENT_OVERLAYS: Record<string, AgentOverlay[]>;
|
|
19
|
-
/**
|
|
20
|
-
* Get skill by ID
|
|
21
|
-
*/
|
|
22
|
-
export declare function getSkill(id: string): SkillDefinition | undefined;
|
|
23
|
-
/**
|
|
24
|
-
* Get agent overlay for a skill
|
|
25
|
-
*/
|
|
26
|
-
export declare function getAgentOverlay(skillId: string, agent: string): AgentOverlay | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* Resolve effective prompt for an agent on a skill
|
|
29
|
-
*/
|
|
30
|
-
export declare function resolveAgentPrompt(skillId: string, agent: string, defaultPrompt: string): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adversarial security tests for Task 2.15: Session restart rehydration
|
|
3
|
-
*
|
|
4
|
-
* ONLY attack vectors - malformed inputs, oversized payloads, injection attempts, boundary violations
|
|
5
|
-
* Tests the security hardening of rehydrateSessionFromDisk, readPlanFromDisk, and readEvidenceFromDisk
|
|
6
|
-
*/
|
|
7
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validate and sanitize summary ID.
|
|
3
|
-
* Must match regex ^S\d+$ (e.g., S1, S2, S99)
|
|
4
|
-
* Rejects: empty string, null bytes, control characters, path traversal, non-matching patterns
|
|
5
|
-
* @throws Error with descriptive message on failure
|
|
6
|
-
*/
|
|
7
|
-
export declare function sanitizeSummaryId(id: string): string;
|
|
8
|
-
/**
|
|
9
|
-
* Store a summary entry to .swarm/summaries/{id}.json.
|
|
10
|
-
* Performs atomic write via temp file + rename.
|
|
11
|
-
* @throws Error if summary ID is invalid or size limit would be exceeded
|
|
12
|
-
*/
|
|
13
|
-
export declare function storeSummary(directory: string, id: string, fullOutput: string, summaryText: string, maxStoredBytes: number): Promise<void>;
|
|
14
|
-
/**
|
|
15
|
-
* Load fullOutput from a summary entry.
|
|
16
|
-
* Returns null if file doesn't exist or validation fails.
|
|
17
|
-
*/
|
|
18
|
-
export declare function loadFullOutput(directory: string, id: string): Promise<string | null>;
|
|
19
|
-
/**
|
|
20
|
-
* List all summary IDs that have summary entries.
|
|
21
|
-
* Returns sorted array of valid summary IDs.
|
|
22
|
-
* Returns empty array if summaries directory doesn't exist.
|
|
23
|
-
*/
|
|
24
|
-
export declare function listSummaries(directory: string): Promise<string[]>;
|
|
25
|
-
/**
|
|
26
|
-
* Delete summaries older than retentionDays.
|
|
27
|
-
* Returns array of deleted summary IDs.
|
|
28
|
-
*/
|
|
29
|
-
export declare function cleanupSummaries(directory: string, retentionDays: number): Promise<string[]>;
|