opencode-swarm 7.18.3 → 7.19.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 +22 -35
- package/dist/cli/index.js +755 -480
- package/dist/commands/command-dispatch.d.ts +33 -0
- package/dist/commands/council.d.ts +1 -1
- package/dist/commands/doctor.d.ts +2 -7
- package/dist/commands/index.d.ts +11 -2
- package/dist/commands/registry.d.ts +0 -1
- package/dist/commands/tool-policy.d.ts +6 -0
- package/dist/config/plan-schema.d.ts +8 -0
- package/dist/evidence/lock.d.ts +1 -1
- package/dist/gate-evidence.d.ts +2 -2
- package/dist/hooks/guardrails.d.ts +21 -0
- package/dist/hooks/system-enhancer.d.ts +19 -0
- package/dist/index.js +2318 -2370
- package/dist/plan/ledger.d.ts +8 -3
- package/dist/plan/manager.d.ts +52 -0
- package/dist/services/config-doctor.d.ts +2 -15
- package/dist/services/evidence-service.d.ts +8 -0
- package/dist/services/plan-service.d.ts +16 -0
- package/dist/services/status-service.d.ts +8 -0
- package/dist/state/agent-run-context.d.ts +4 -4
- package/dist/state.d.ts +13 -8
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/save-plan.d.ts +19 -0
- package/dist/tools/swarm-command.d.ts +3 -0
- package/dist/tools/tool-names.d.ts +1 -1
- package/dist/tools/update-task-status.d.ts +1 -1
- package/dist/tools/write-final-council-evidence.d.ts +0 -12
- package/dist/types/events.d.ts +21 -1
- package/package.json +1 -1
- package/dist/parallel/runtime-config.d.ts +0 -11
package/dist/plan/ledger.d.ts
CHANGED
|
@@ -6,13 +6,18 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { type Plan } from '../config/plan-schema';
|
|
8
8
|
/**
|
|
9
|
-
* Ledger schema version
|
|
9
|
+
* Ledger schema version.
|
|
10
|
+
*
|
|
11
|
+
* v7.19.0: bumped from 1.0.0 → 1.1.0 with the addition of `task_removed`.
|
|
12
|
+
* Older plugin readers throw on unknown event types (applyEventToPlan default
|
|
13
|
+
* branch); restart any running OpenCode session after upgrade so the new
|
|
14
|
+
* reader is loaded in-process.
|
|
10
15
|
*/
|
|
11
|
-
export declare const LEDGER_SCHEMA_VERSION = "1.
|
|
16
|
+
export declare const LEDGER_SCHEMA_VERSION = "1.1.0";
|
|
12
17
|
/**
|
|
13
18
|
* Valid ledger event types
|
|
14
19
|
*/
|
|
15
|
-
export declare const LEDGER_EVENT_TYPES: readonly ["plan_created", "task_added", "task_updated", "task_status_changed", "task_reordered", "phase_completed", "plan_rebuilt", "plan_exported", "plan_reset", "snapshot", "execution_profile_set", "execution_profile_locked"];
|
|
20
|
+
export declare const LEDGER_EVENT_TYPES: readonly ["plan_created", "task_added", "task_removed", "task_updated", "task_status_changed", "task_reordered", "phase_completed", "plan_rebuilt", "plan_exported", "plan_reset", "snapshot", "execution_profile_set", "execution_profile_locked"];
|
|
16
21
|
export type LedgerEventType = (typeof LEDGER_EVENT_TYPES)[number];
|
|
17
22
|
/**
|
|
18
23
|
* A ledger event representing a plan mutation.
|
package/dist/plan/manager.d.ts
CHANGED
|
@@ -6,6 +6,38 @@
|
|
|
6
6
|
export declare class PlanConcurrentModificationError extends Error {
|
|
7
7
|
constructor(message: string);
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Thrown when savePlan detects that the incoming plan would silently drop one
|
|
11
|
+
* or more tasks from the prior plan without the caller acknowledging the
|
|
12
|
+
* removal (issue #853).
|
|
13
|
+
*
|
|
14
|
+
* Callers must pass `options.acknowledged_removals.ids` covering every missing
|
|
15
|
+
* task id together with a non-empty reason to proceed.
|
|
16
|
+
*/
|
|
17
|
+
export declare class PlanTaskRemovalNotAcknowledgedError extends Error {
|
|
18
|
+
readonly missingTasks: Array<{
|
|
19
|
+
id: string;
|
|
20
|
+
phase: number;
|
|
21
|
+
status: TaskStatus;
|
|
22
|
+
}>;
|
|
23
|
+
constructor(missingTasks: Array<{
|
|
24
|
+
id: string;
|
|
25
|
+
phase: number;
|
|
26
|
+
status: TaskStatus;
|
|
27
|
+
}>);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Caller-supplied acknowledgement that a save_plan operation is intentionally
|
|
31
|
+
* removing tasks from the prior plan (issue #853). Passed to savePlan via the
|
|
32
|
+
* `acknowledged_removals` option; `ids` must list every task id missing from
|
|
33
|
+
* the incoming plan; `reason` must be non-empty; `source` identifies the
|
|
34
|
+
* caller (e.g. 'save_plan_tool', 'phase_complete_rebuild_from_ledger').
|
|
35
|
+
*/
|
|
36
|
+
export interface AcknowledgedRemovals {
|
|
37
|
+
ids: string[];
|
|
38
|
+
reason: string;
|
|
39
|
+
source: string;
|
|
40
|
+
}
|
|
9
41
|
import { type Plan, type RuntimePlan, type TaskStatus } from '../config/plan-schema';
|
|
10
42
|
import { type LedgerEvent, type LedgerEventInput } from './ledger';
|
|
11
43
|
/** Reset the startup ledger check flag. For testing only. */
|
|
@@ -63,12 +95,32 @@ export declare function regeneratePlanMarkdown(directory: string, plan: Plan): P
|
|
|
63
95
|
* 4. Neither exists -> return null
|
|
64
96
|
*/
|
|
65
97
|
export declare function loadPlan(directory: string): Promise<RuntimePlan | null>;
|
|
98
|
+
/**
|
|
99
|
+
* Recovery-path helper for callers that legitimately need to replace the
|
|
100
|
+
* plan task set without explicit per-id acknowledgement (e.g. rebuilding
|
|
101
|
+
* from the ledger after replay, importing an external checkpoint, or
|
|
102
|
+
* recovering from a critic-approved snapshot).
|
|
103
|
+
*
|
|
104
|
+
* Diffs the on-disk plan against the incoming plan, auto-populates
|
|
105
|
+
* `acknowledged_removals` with every missing id, and delegates to savePlan.
|
|
106
|
+
* The architect-facing save_plan tool MUST NOT use this — it should fail
|
|
107
|
+
* closed and require the caller to enumerate removals explicitly.
|
|
108
|
+
*
|
|
109
|
+
* Returns the count of auto-acknowledged removals so the caller can attach
|
|
110
|
+
* `_midLoadRemovals` to the RuntimePlan for Layer A disclosure.
|
|
111
|
+
*/
|
|
112
|
+
export declare function savePlanWithAutoAcknowledgedRemovals(directory: string, plan: Plan, source: string, reason: string, options?: {
|
|
113
|
+
preserveCompletedStatuses?: boolean;
|
|
114
|
+
}): Promise<{
|
|
115
|
+
removedCount: number;
|
|
116
|
+
}>;
|
|
66
117
|
/**
|
|
67
118
|
* Validate against PlanSchema (throw on invalid), write to .swarm/plan.json via atomic temp+rename pattern,
|
|
68
119
|
* then derive and write .swarm/plan.md
|
|
69
120
|
*/
|
|
70
121
|
export declare function savePlan(directory: string, plan: Plan, options?: {
|
|
71
122
|
preserveCompletedStatuses?: boolean;
|
|
123
|
+
acknowledged_removals?: AcknowledgedRemovals;
|
|
72
124
|
}): Promise<void>;
|
|
73
125
|
/**
|
|
74
126
|
* Rebuild plan from ledger events.
|
|
@@ -56,18 +56,6 @@ export interface ConfigDoctorResult {
|
|
|
56
56
|
/** The config that was analyzed */
|
|
57
57
|
configSource: string;
|
|
58
58
|
}
|
|
59
|
-
/** Model availability snapshot from the active OpenCode provider registry. */
|
|
60
|
-
export interface ModelAvailability {
|
|
61
|
-
/** Fully-qualified model IDs in provider/model form. */
|
|
62
|
-
availableModelIds: ReadonlySet<string>;
|
|
63
|
-
/** Human-readable source for diagnostics. */
|
|
64
|
-
source: string;
|
|
65
|
-
/** Optional failure message when the registry could not be loaded. */
|
|
66
|
-
error?: string;
|
|
67
|
-
}
|
|
68
|
-
export interface ConfigDoctorOptions {
|
|
69
|
-
modelAvailability?: ModelAvailability;
|
|
70
|
-
}
|
|
71
59
|
/** Backup artifact for rollback */
|
|
72
60
|
export interface ConfigBackup {
|
|
73
61
|
/** When the backup was created */
|
|
@@ -102,11 +90,10 @@ export declare function writeBackupArtifact(directory: string, backup: ConfigBac
|
|
|
102
90
|
* @returns the path to the restored config file, or null if restore failed
|
|
103
91
|
*/
|
|
104
92
|
export declare function restoreFromBackup(backupPath: string, directory: string): string | null;
|
|
105
|
-
export declare function collectConfiguredModelRefs(config: PluginConfig): Map<string, Set<string>>;
|
|
106
93
|
/**
|
|
107
94
|
* Run the config doctor on a loaded config
|
|
108
95
|
*/
|
|
109
|
-
export declare function runConfigDoctor(config: PluginConfig, directory: string
|
|
96
|
+
export declare function runConfigDoctor(config: PluginConfig, directory: string): ConfigDoctorResult;
|
|
110
97
|
/**
|
|
111
98
|
* Apply safe auto-fixes to config
|
|
112
99
|
* Only applies low-risk, non-destructive fixes
|
|
@@ -129,7 +116,7 @@ export declare function shouldRunOnStartup(automationConfig: {
|
|
|
129
116
|
/**
|
|
130
117
|
* Full config doctor run with backup and fix application
|
|
131
118
|
*/
|
|
132
|
-
export declare function runConfigDoctorWithFixes(directory: string, config: PluginConfig, autoFix?: boolean
|
|
119
|
+
export declare function runConfigDoctorWithFixes(directory: string, config: PluginConfig, autoFix?: boolean): Promise<{
|
|
133
120
|
result: ConfigDoctorResult;
|
|
134
121
|
backupPath: string | null;
|
|
135
122
|
appliedFixes: ConfigFix[];
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { Evidence } from '../config/evidence-schema';
|
|
2
|
+
import { listEvidenceTaskIds as _listEvidenceTaskIds, loadEvidence as _loadEvidence } from '../evidence/manager';
|
|
3
|
+
/**
|
|
4
|
+
* _internals — DI seam for testing async I/O without cross-module mocks.
|
|
5
|
+
*/
|
|
6
|
+
export declare const _internals: {
|
|
7
|
+
loadEvidence: typeof _loadEvidence;
|
|
8
|
+
listEvidenceTaskIds: typeof _listEvidenceTaskIds;
|
|
9
|
+
};
|
|
2
10
|
/**
|
|
3
11
|
* Structured evidence entry for a task.
|
|
4
12
|
*/
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
import { readSwarmFileAsync } from '../hooks/utils';
|
|
2
|
+
import { derivePlanMarkdown, loadPlanJsonOnly } from '../plan/manager';
|
|
3
|
+
/**
|
|
4
|
+
* Test-only dependency-injection seam. Production code calls
|
|
5
|
+
* `_internals.loadPlanJsonOnly(...)`, `_internals.derivePlanMarkdown(...)`,
|
|
6
|
+
* and `_internals.readSwarmFileAsync(...)` so tests can replace the
|
|
7
|
+
* functions on this object without touching the real module — `mock.module`
|
|
8
|
+
* from `bun:test` leaks across files in Bun's shared test-runner process,
|
|
9
|
+
* which would corrupt unrelated suites. Mutating this local object is
|
|
10
|
+
* file-scoped and trivially restorable via `afterEach`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const _internals: {
|
|
13
|
+
loadPlanJsonOnly: typeof loadPlanJsonOnly;
|
|
14
|
+
derivePlanMarkdown: typeof derivePlanMarkdown;
|
|
15
|
+
readSwarmFileAsync: typeof readSwarmFileAsync;
|
|
16
|
+
};
|
|
1
17
|
/**
|
|
2
18
|
* Structured plan data for a specific phase or full plan.
|
|
3
19
|
*/
|
|
@@ -46,6 +46,14 @@ export interface StatusData {
|
|
|
46
46
|
compactionCount: number;
|
|
47
47
|
/** ISO timestamp of last compaction snapshot, or null if none */
|
|
48
48
|
lastSnapshotAt: string | null;
|
|
49
|
+
/** Issue #853 Layer C: true if spec drift was detected for this plan */
|
|
50
|
+
specStale?: boolean;
|
|
51
|
+
/** Reason text from .swarm/spec-staleness.json (or RuntimePlan._specStaleReason) */
|
|
52
|
+
specStaleReason?: string;
|
|
53
|
+
/** Stored spec hash from when the plan was last saved */
|
|
54
|
+
specStaleStoredHash?: string;
|
|
55
|
+
/** Current spec.md hash on disk (null when spec.md is missing) */
|
|
56
|
+
specStaleCurrentHash?: string | null;
|
|
49
57
|
}
|
|
50
58
|
/**
|
|
51
59
|
* Get status data from the swarm directory.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AgentRunContext — typed per-run state container.
|
|
3
3
|
*
|
|
4
|
-
* Holds the subset of swarmState
|
|
4
|
+
* Holds the subset of swarmState needed for future per-run isolation:
|
|
5
5
|
* activeToolCalls, activeAgent, delegationChains, agentSessions,
|
|
6
6
|
* environmentProfiles, and a shared reference to process-global toolAggregates.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* PR 1 (dark foundation): the class exists and is instantiated for the default
|
|
9
|
+
* single-run path only. No runtime behavior is changed.
|
|
10
|
+
* PR 2 will wire distinct contexts to parallel dispatcher slots.
|
|
11
11
|
*
|
|
12
12
|
* Generic type parameters let state.ts bind concrete internal types without
|
|
13
13
|
* creating a circular import.
|
package/dist/state.d.ts
CHANGED
|
@@ -50,7 +50,6 @@ export type DelegationReason = 'normal_delegation' | 'review_rejected' | 'critic
|
|
|
50
50
|
* Transitions must be forward-only: idle → coder_delegated → pre_check_passed → reviewer_run → tests_run → complete
|
|
51
51
|
*/
|
|
52
52
|
export type TaskWorkflowState = 'idle' | 'coder_delegated' | 'pre_check_passed' | 'reviewer_run' | 'tests_run' | 'complete';
|
|
53
|
-
export type StageBGate = 'reviewer' | 'test_engineer' | 'adversarial_test_engineer';
|
|
54
53
|
/**
|
|
55
54
|
* Represents per-session state for guardrail tracking.
|
|
56
55
|
* Budget fields (toolCallCount, consecutiveErrors, etc.) have moved to InvocationWindow.
|
|
@@ -112,9 +111,7 @@ export interface AgentSessionState {
|
|
|
112
111
|
* When both are present, the task may advance to tests_run regardless of order.
|
|
113
112
|
* Always populated — Stage B is unconditionally parallel.
|
|
114
113
|
*/
|
|
115
|
-
stageBCompletion?: Map<string, Set<
|
|
116
|
-
/** Per-task required Stage B gates. Optional gates are added when dispatched. */
|
|
117
|
-
requiredStageBGates?: Map<string, Set<StageBGate>>;
|
|
114
|
+
stageBCompletion?: Map<string, Set<'reviewer' | 'test_engineer'>>;
|
|
118
115
|
/** v6.71+ Council mode: per-task council verdict, recorded by delegation-gate when submit_council_verdicts resolves. */
|
|
119
116
|
taskCouncilApproved?: Map<string, {
|
|
120
117
|
verdict: 'APPROVE' | 'REJECT' | 'CONCERNS';
|
|
@@ -451,11 +448,19 @@ export declare function advanceTaskStateAndPersist(session: AgentSessionState, t
|
|
|
451
448
|
* @returns Current task workflow state
|
|
452
449
|
*/
|
|
453
450
|
export declare function getTaskState(session: AgentSessionState, taskId: string): TaskWorkflowState;
|
|
454
|
-
export declare function requireStageBGate(session: AgentSessionState, taskId: string, gate: StageBGate): void;
|
|
455
|
-
export declare function recordStageBCompletion(session: AgentSessionState, taskId: string, agent: StageBGate): void;
|
|
456
451
|
/**
|
|
457
|
-
* PR 2 Stage B barrier:
|
|
458
|
-
*
|
|
452
|
+
* PR 2 Stage B barrier: record that a Stage B agent has completed for a task.
|
|
453
|
+
* Order-independent — either 'reviewer' or 'test_engineer' may complete first.
|
|
454
|
+
* Initializes the per-task set on first write.
|
|
455
|
+
*
|
|
456
|
+
* @param session - The agent session state
|
|
457
|
+
* @param taskId - The task identifier
|
|
458
|
+
* @param agent - Which Stage B agent completed ('reviewer' or 'test_engineer')
|
|
459
|
+
*/
|
|
460
|
+
export declare function recordStageBCompletion(session: AgentSessionState, taskId: string, agent: 'reviewer' | 'test_engineer'): void;
|
|
461
|
+
/**
|
|
462
|
+
* PR 2 Stage B barrier: returns true iff both 'reviewer' and 'test_engineer' have
|
|
463
|
+
* been recorded for the given task in this session.
|
|
459
464
|
*
|
|
460
465
|
* @param session - The agent session state
|
|
461
466
|
* @param taskId - The task identifier
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export { skill_inspect } from './skill-inspect';
|
|
|
50
50
|
export { skill_list } from './skill-list';
|
|
51
51
|
export { spec_write } from './spec-write';
|
|
52
52
|
export { submit_phase_council_verdicts } from './submit-phase-council-verdicts';
|
|
53
|
+
export { createSwarmCommandTool } from './swarm-command';
|
|
53
54
|
import { suggestPatch } from './suggest-patch';
|
|
54
55
|
export { suggestPatch };
|
|
55
56
|
export type { SuggestPatchArgs } from './suggest-patch';
|
|
@@ -33,6 +33,25 @@ export interface SavePlanArgs {
|
|
|
33
33
|
* after a failed phase). Defaults to false (existing statuses preserved).
|
|
34
34
|
*/
|
|
35
35
|
reset_statuses?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Issue #853: tasks that are present in the prior plan but intentionally
|
|
38
|
+
* being removed by this save. Every task missing from `phases` must be
|
|
39
|
+
* enumerated here, otherwise save_plan rejects with
|
|
40
|
+
* `PLAN_TASK_REMOVAL_NOT_ACKNOWLEDGED`.
|
|
41
|
+
*/
|
|
42
|
+
removed_task_ids?: string[];
|
|
43
|
+
/**
|
|
44
|
+
* Human-readable reason for the removals listed in `removed_task_ids`.
|
|
45
|
+
* Must be non-empty when `removed_task_ids` is non-empty. Recorded on
|
|
46
|
+
* each `task_removed` ledger event for audit.
|
|
47
|
+
*/
|
|
48
|
+
removal_reason?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Required when both `reset_statuses` is true AND at least one task is
|
|
51
|
+
* missing from the new plan. Without this flag set, save_plan rejects to
|
|
52
|
+
* prevent a destructive reset from silently dropping unfinished work.
|
|
53
|
+
*/
|
|
54
|
+
confirm_destructive_reset?: boolean;
|
|
36
55
|
/**
|
|
37
56
|
* Architect-facing concurrency controls for this plan.
|
|
38
57
|
* When execution_profile.locked is true the profile is immutable — subsequent
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Used for constants and agent setup references.
|
|
4
4
|
*/
|
|
5
5
|
/** Union type of all valid tool names */
|
|
6
|
-
export type ToolName = 'diff' | 'diff_summary' | 'syntax_check' | 'placeholder_scan' | 'imports' | 'lint' | 'secretscan' | 'sast_scan' | 'build_check' | 'pre_check_batch' | 'quality_budget' | 'symbols' | 'complexity_hotspots' | 'schema_drift' | 'todo_extract' | 'evidence_check' | 'check_gate_status' | 'completion_verify' | 'submit_council_verdicts' | 'submit_phase_council_verdicts' | 'declare_council_criteria' | 'sbom_generate' | 'checkpoint' | 'pkg_audit' | 'test_runner' | 'test_impact' | 'mutation_test' | 'generate_mutants' | 'detect_domains' | 'gitingest' | 'retrieve_summary' | 'extract_code_blocks' | 'phase_complete' | 'save_plan' | 'update_task_status' | 'lint_spec' | 'write_retro' | 'write_drift_evidence' | 'write_hallucination_evidence' | 'write_mutation_evidence' | 'declare_scope' | 'knowledge_query' | 'doc_scan' | 'doc_extract' | 'curator_analyze' | 'knowledge_add' | 'knowledge_recall' | 'knowledge_remove' | 'co_change_analyzer' | 'search' | 'batch_symbols' | 'suggest_patch' | 'req_coverage' | 'get_approved_plan' | 'repo_map' | 'get_qa_gate_profile' | 'set_qa_gates' | 'web_search' | 'convene_general_council' | 'write_final_council_evidence' | 'skill_generate' | 'skill_list' | 'skill_apply' | 'skill_inspect' | 'skill_improve' | 'spec_write' | 'knowledge_ack' | 'lean_turbo_plan_lanes' | 'lean_turbo_acquire_locks' | 'lean_turbo_runner_status' | 'lean_turbo_review' | 'lean_turbo_run_phase' | 'lean_turbo_status';
|
|
6
|
+
export type ToolName = 'diff' | 'diff_summary' | 'syntax_check' | 'placeholder_scan' | 'imports' | 'lint' | 'secretscan' | 'sast_scan' | 'build_check' | 'pre_check_batch' | 'quality_budget' | 'symbols' | 'complexity_hotspots' | 'schema_drift' | 'todo_extract' | 'evidence_check' | 'check_gate_status' | 'completion_verify' | 'submit_council_verdicts' | 'submit_phase_council_verdicts' | 'declare_council_criteria' | 'sbom_generate' | 'checkpoint' | 'pkg_audit' | 'test_runner' | 'test_impact' | 'mutation_test' | 'generate_mutants' | 'detect_domains' | 'gitingest' | 'retrieve_summary' | 'extract_code_blocks' | 'phase_complete' | 'save_plan' | 'update_task_status' | 'lint_spec' | 'write_retro' | 'write_drift_evidence' | 'write_hallucination_evidence' | 'write_mutation_evidence' | 'declare_scope' | 'knowledge_query' | 'doc_scan' | 'doc_extract' | 'curator_analyze' | 'knowledge_add' | 'knowledge_recall' | 'knowledge_remove' | 'co_change_analyzer' | 'search' | 'batch_symbols' | 'suggest_patch' | 'req_coverage' | 'get_approved_plan' | 'repo_map' | 'get_qa_gate_profile' | 'set_qa_gates' | 'web_search' | 'convene_general_council' | 'write_final_council_evidence' | 'skill_generate' | 'skill_list' | 'skill_apply' | 'skill_inspect' | 'skill_improve' | 'spec_write' | 'knowledge_ack' | 'swarm_command' | 'lean_turbo_plan_lanes' | 'lean_turbo_acquire_locks' | 'lean_turbo_runner_status' | 'lean_turbo_review' | 'lean_turbo_run_phase' | 'lean_turbo_status';
|
|
7
7
|
/** Readonly array of all tool names */
|
|
8
8
|
export declare const TOOL_NAMES: readonly ToolName[];
|
|
9
9
|
/** Set for O(1) tool name validation */
|
|
@@ -57,7 +57,7 @@ export declare function checkReviewerGate(taskId: string, workingDirectory?: str
|
|
|
57
57
|
/**
|
|
58
58
|
* Wrapper around checkReviewerGate that appends a diff-scope advisory warning.
|
|
59
59
|
* Keeps checkReviewerGate synchronous for backward compatibility.
|
|
60
|
-
* Stage B parallel is
|
|
60
|
+
* Stage B parallel is hardcoded (not config-driven).
|
|
61
61
|
* @param taskId - The task ID to check gate state for
|
|
62
62
|
* @param workingDirectory - Optional working directory for plan.json fallback
|
|
63
63
|
* @param sessionID - Optional session ID to scope Lean Turbo bypass to the current tool-execution context
|
|
@@ -7,12 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { ToolDefinition } from '@opencode-ai/plugin/tool';
|
|
9
9
|
import { z } from 'zod';
|
|
10
|
-
import { loadPluginConfig } from '../config/loader';
|
|
11
|
-
import { synthesizeFinalCouncilAdvisory } from '../council/council-service';
|
|
12
10
|
import type { CouncilMemberVerdict } from '../council/types';
|
|
13
|
-
import { validateSwarmPath } from '../hooks/utils';
|
|
14
|
-
import { loadPlan } from '../plan/manager.js';
|
|
15
|
-
import { derivePlanId } from '../plan/utils.js';
|
|
16
11
|
export declare const ArgsSchema: z.ZodObject<{
|
|
17
12
|
phase: z.ZodNumber;
|
|
18
13
|
projectSummary: z.ZodString;
|
|
@@ -60,13 +55,6 @@ export interface WriteFinalCouncilEvidenceArgs {
|
|
|
60
55
|
/** Collected verdicts from critic, reviewer, sme, test_engineer, explorer */
|
|
61
56
|
verdicts: CouncilMemberVerdict[];
|
|
62
57
|
}
|
|
63
|
-
export declare const _internals: {
|
|
64
|
-
loadPluginConfig: typeof loadPluginConfig;
|
|
65
|
-
synthesizeFinalCouncilAdvisory: typeof synthesizeFinalCouncilAdvisory;
|
|
66
|
-
loadPlan: typeof loadPlan;
|
|
67
|
-
derivePlanId: typeof derivePlanId;
|
|
68
|
-
validateSwarmPath: typeof validateSwarmPath;
|
|
69
|
-
};
|
|
70
58
|
/**
|
|
71
59
|
* Execute the write_final_council_evidence tool.
|
|
72
60
|
* Validates input, synthesizes project-scoped council evidence, and writes it.
|
package/dist/types/events.d.ts
CHANGED
|
@@ -90,6 +90,26 @@ export interface SpecDriftAcknowledgedEvent {
|
|
|
90
90
|
previousHash: string;
|
|
91
91
|
newHash: string | null;
|
|
92
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Emitted whenever savePlan removes one or more tasks from the prior plan
|
|
95
|
+
* (issue #853). Functional during replayFromLedger (post-merge fix) — the
|
|
96
|
+
* ledger commit precedes the plan.json rename, so rebuild must drop the
|
|
97
|
+
* task to maintain crash consistency. The `source` identifies the caller
|
|
98
|
+
* (e.g. 'save_plan_tool', 'phase_complete_rebuild_from_ledger'); the
|
|
99
|
+
* removal reason rides on the `payload` envelope to match LedgerEvent.
|
|
100
|
+
*/
|
|
101
|
+
export interface TaskRemovedEvent {
|
|
102
|
+
type: 'task_removed';
|
|
103
|
+
timestamp: string;
|
|
104
|
+
task_id: string;
|
|
105
|
+
phase_id: number;
|
|
106
|
+
from_status: string;
|
|
107
|
+
source: string;
|
|
108
|
+
payload?: {
|
|
109
|
+
reason?: string;
|
|
110
|
+
source?: string;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
93
113
|
export interface PrmPatternDetectedEvent {
|
|
94
114
|
type: 'prm_pattern_detected';
|
|
95
115
|
timestamp: string;
|
|
@@ -122,4 +142,4 @@ export interface PrmHardStopEvent {
|
|
|
122
142
|
level: number;
|
|
123
143
|
occurrenceCount: number;
|
|
124
144
|
}
|
|
125
|
-
export type V619Event = SoundingBoardConsultedEvent | ArchitectLoopDetectedEvent | PrecedentManipulationDetectedEvent | CoderSelfAuditEvent | CoderRetryCircuitBreakerEvent | AgentConflictDetectedEvent | AuthorityHandoffResolvedEvent | SpecStaleDetectedEvent | SpecDriftAcknowledgedEvent | PrmPatternDetectedEvent | PrmCourseCorrectionInjectedEvent | PrmEscalationTriggeredEvent | PrmHardStopEvent;
|
|
145
|
+
export type V619Event = SoundingBoardConsultedEvent | ArchitectLoopDetectedEvent | PrecedentManipulationDetectedEvent | CoderSelfAuditEvent | CoderRetryCircuitBreakerEvent | AgentConflictDetectedEvent | AuthorityHandoffResolvedEvent | SpecStaleDetectedEvent | SpecDriftAcknowledgedEvent | TaskRemovedEvent | PrmPatternDetectedEvent | PrmCourseCorrectionInjectedEvent | PrmEscalationTriggeredEvent | PrmHardStopEvent;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.19.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,11 +0,0 @@
|
|
|
1
|
-
import type { PluginConfig } from '../config';
|
|
2
|
-
export type StandardParallelizationRuntimeConfig = {
|
|
3
|
-
stageBParallelEnabled: boolean;
|
|
4
|
-
taskFanoutEnabled: boolean;
|
|
5
|
-
maxConcurrentTasks: number;
|
|
6
|
-
maxConcurrentCoders: number;
|
|
7
|
-
maxConcurrentStageBGroups: number;
|
|
8
|
-
evidenceLockTimeoutMs: number;
|
|
9
|
-
source: 'current-default' | 'global-config' | 'locked-profile';
|
|
10
|
-
};
|
|
11
|
-
export declare function resolveStandardParallelizationConfig(config: PluginConfig | undefined, directory: string): StandardParallelizationRuntimeConfig;
|