opencode-swarm 7.126.3 → 7.126.5
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/.opencode/skills/issue-tracer/scripts/trace-init.sh +20 -0
- package/dist/cli/{config-doctor-mfx27331.js → config-doctor-2admdwc2.js} +2 -2
- package/dist/cli/{curation-policy-n944aq62.js → curation-policy-82czah39.js} +2 -2
- package/dist/cli/{curator-jm9ehfkg.js → curator-5crbtfm1.js} +12 -12
- package/dist/cli/{curator-llm-factory-3cy0h9yw.js → curator-llm-factory-y24xw3j4.js} +12 -12
- package/dist/cli/{guardrail-explain-va0kj05m.js → guardrail-explain-3r26pm2s.js} +13 -13
- package/dist/cli/{guardrail-log-61gya05m.js → guardrail-log-7cychbgs.js} +3 -3
- package/dist/cli/{hive-promoter-h9c4kyv0.js → hive-promoter-9d2g1xf3.js} +12 -12
- package/dist/cli/{index-b16153py.js → index-0543dz3t.js} +14 -14
- package/dist/cli/{index-6t5sa6v0.js → index-0y19k18q.js} +2 -2
- package/dist/cli/{index-nqp13m5a.js → index-1mwdhq2p.js} +1 -1
- package/dist/cli/{index-gwss5btk.js → index-3ntrn97w.js} +1 -1
- package/dist/cli/{index-pb8ag9vg.js → index-72envp1b.js} +4 -4
- package/dist/cli/{index-vcqwhe9d.js → index-7ttstfv6.js} +25 -3
- package/dist/cli/{index-bf76q8q7.js → index-8etcyr9r.js} +1 -1
- package/dist/cli/{index-7bxw3v5w.js → index-c4mcheyz.js} +3 -3
- package/dist/cli/{index-3xd9a2g7.js → index-cpssctv1.js} +1 -1
- package/dist/cli/{index-c48dvb6j.js → index-edv27z4p.js} +2 -2
- package/dist/cli/{index-f97dm6tz.js → index-ff3j65em.js} +5 -5
- package/dist/cli/{index-pf3xae4s.js → index-gn62e04k.js} +1 -1
- package/dist/cli/{index-5n868tw8.js → index-hczdkknj.js} +136 -124
- package/dist/cli/{index-gf9cxvp0.js → index-hv2p03f3.js} +7 -19
- package/dist/cli/{index-88dt7c9z.js → index-ns62nv6t.js} +2 -2
- package/dist/cli/{index-gxw20m1d.js → index-v4n224r1.js} +1 -1
- package/dist/cli/index.js +12 -12
- package/dist/cli/{knowledge-escalator-nna0zec3.js → knowledge-escalator-b3k4b8pk.js} +3 -3
- package/dist/cli/{knowledge-events-7k82xk36.js → knowledge-events-4z5rkefv.js} +1 -1
- package/dist/cli/{knowledge-store-efvtng9t.js → knowledge-store-c0t16yr4.js} +1 -1
- package/dist/cli/{knowledge-validator-jh93eagj.js → knowledge-validator-cs33ws57.js} +4 -4
- package/dist/cli/{scan-cursor-cydz8d9q.js → scan-cursor-rgnarf67.js} +2 -2
- package/dist/cli/{schema-fa033pqw.js → schema-2x7wsb0n.js} +1 -1
- package/dist/cli/{skill-generator-8v463kj7.js → skill-generator-e8c2r816.js} +5 -5
- package/dist/config/loader.d.ts +1 -3
- package/dist/config/schema.d.ts +4 -4
- package/dist/index.js +252 -252
- package/dist/tools/test-runner.d.ts +12 -2
- package/dist/utils/path-security.d.ts +2 -0
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
readDoctorArtifact,
|
|
5
5
|
removeStraySwarmDir,
|
|
6
6
|
runConfigDoctor
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-cpssctv1.js";
|
|
8
8
|
import {
|
|
9
9
|
EvaluationTaskV1Schema,
|
|
10
10
|
GateAuditManifestV1Schema,
|
|
@@ -94,15 +94,15 @@ import {
|
|
|
94
94
|
retireSkill,
|
|
95
95
|
selectCandidateEntries,
|
|
96
96
|
syncBundledProjectSkillsIfMissingAsync
|
|
97
|
-
} from "./index-
|
|
97
|
+
} from "./index-c4mcheyz.js";
|
|
98
98
|
import {
|
|
99
99
|
readRecentEscalations
|
|
100
|
-
} from "./index-
|
|
100
|
+
} from "./index-ff3j65em.js";
|
|
101
101
|
import {
|
|
102
102
|
alreadyCuratedThisGeneration,
|
|
103
103
|
claimNextScanBatch,
|
|
104
104
|
resolveCohortId
|
|
105
|
-
} from "./index-
|
|
105
|
+
} from "./index-gn62e04k.js";
|
|
106
106
|
import {
|
|
107
107
|
CURATOR_INIT_PROMPT,
|
|
108
108
|
CURATOR_PHASE_PROMPT,
|
|
@@ -135,11 +135,11 @@ import {
|
|
|
135
135
|
validateActionability,
|
|
136
136
|
validateActionableFields,
|
|
137
137
|
validateLesson
|
|
138
|
-
} from "./index-
|
|
138
|
+
} from "./index-ns62nv6t.js";
|
|
139
139
|
import {
|
|
140
140
|
authorizeCuration,
|
|
141
141
|
buildConfigFingerprintInput
|
|
142
|
-
} from "./index-
|
|
142
|
+
} from "./index-3ntrn97w.js";
|
|
143
143
|
import {
|
|
144
144
|
cohortConfigFingerprint
|
|
145
145
|
} from "./index-rtry5xyf.js";
|
|
@@ -169,7 +169,7 @@ import {
|
|
|
169
169
|
transactFile,
|
|
170
170
|
transactKnowledge,
|
|
171
171
|
wordBigrams
|
|
172
|
-
} from "./index-
|
|
172
|
+
} from "./index-72envp1b.js";
|
|
173
173
|
import {
|
|
174
174
|
MAX_EVENT_LOG_ENTRIES,
|
|
175
175
|
_internals,
|
|
@@ -179,7 +179,7 @@ import {
|
|
|
179
179
|
recordHiveKnowledgeEvent,
|
|
180
180
|
recordKnowledgeEvent,
|
|
181
181
|
resolveKnowledgeEventsPath
|
|
182
|
-
} from "./index-
|
|
182
|
+
} from "./index-1mwdhq2p.js";
|
|
183
183
|
import {
|
|
184
184
|
resolveHiveDataDir,
|
|
185
185
|
resolveHiveEventsPath,
|
|
@@ -201,7 +201,7 @@ import {
|
|
|
201
201
|
init_loader,
|
|
202
202
|
loadPluginConfig,
|
|
203
203
|
loadPluginConfigWithMeta
|
|
204
|
-
} from "./index-
|
|
204
|
+
} from "./index-hv2p03f3.js";
|
|
205
205
|
import {
|
|
206
206
|
RetrospectiveEvidenceSchema
|
|
207
207
|
} from "./index-k5jrywpr.js";
|
|
@@ -220,7 +220,7 @@ import {
|
|
|
220
220
|
init_schema,
|
|
221
221
|
init_tool_metadata,
|
|
222
222
|
stripKnownSwarmPrefix
|
|
223
|
-
} from "./index-
|
|
223
|
+
} from "./index-7ttstfv6.js";
|
|
224
224
|
import {
|
|
225
225
|
KNOWLEDGE_SCHEMA_VERSION,
|
|
226
226
|
OUTCOME_BLOCK_THRESHOLD,
|
|
@@ -10962,7 +10962,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
|
|
|
10962
10962
|
}
|
|
10963
10963
|
if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
|
|
10964
10964
|
try {
|
|
10965
|
-
const skillModule = await import("./skill-generator-
|
|
10965
|
+
const skillModule = await import("./skill-generator-e8c2r816.js");
|
|
10966
10966
|
for (const cand of skillCandidates) {
|
|
10967
10967
|
if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
|
|
10968
10968
|
continue;
|
|
@@ -11299,7 +11299,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
|
|
|
11299
11299
|
} catch {}
|
|
11300
11300
|
}
|
|
11301
11301
|
if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
|
|
11302
|
-
const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-
|
|
11302
|
+
const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-b3k4b8pk.js");
|
|
11303
11303
|
for (const { id } of contradictedEntries) {
|
|
11304
11304
|
try {
|
|
11305
11305
|
await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
|
|
@@ -12098,7 +12098,7 @@ async function runCuratorPostMortem(directory, options = {}) {
|
|
|
12098
12098
|
warnings.push("Failed to collect knowledge summary.");
|
|
12099
12099
|
}
|
|
12100
12100
|
try {
|
|
12101
|
-
const { getScanStatus } = await import("./scan-cursor-
|
|
12101
|
+
const { getScanStatus } = await import("./scan-cursor-rgnarf67.js");
|
|
12102
12102
|
const scanStatus = await getScanStatus(directory);
|
|
12103
12103
|
if (scanStatus.remaining_estimate > 0) {
|
|
12104
12104
|
warnings.push(`Fair scan: reviewed ${knowledgeSummary.length} entries this sweep (generation ${scanStatus.generation}); ${scanStatus.remaining_estimate} more eligible entries will be visited in future curation sweeps.`);
|
|
@@ -12270,9 +12270,9 @@ var _internals15 = {
|
|
|
12270
12270
|
verifyPostMortemKnowledgeActions,
|
|
12271
12271
|
repairPostMortemActions,
|
|
12272
12272
|
loadDefaultKnowledgeConfig: async (directory) => {
|
|
12273
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
12273
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-2x7wsb0n.js");
|
|
12274
12274
|
try {
|
|
12275
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
12275
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-edv27z4p.js");
|
|
12276
12276
|
const loaded = loadPluginConfigWithMeta2(directory);
|
|
12277
12277
|
return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
|
|
12278
12278
|
} catch {
|
|
@@ -12280,11 +12280,11 @@ var _internals15 = {
|
|
|
12280
12280
|
}
|
|
12281
12281
|
},
|
|
12282
12282
|
applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
|
|
12283
|
-
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-
|
|
12283
|
+
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-5crbtfm1.js");
|
|
12284
12284
|
return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
|
|
12285
12285
|
},
|
|
12286
12286
|
checkHivePromotions: async (entries, knowledgeConfig, directory) => {
|
|
12287
|
-
const { checkHivePromotions } = await import("./hive-promoter-
|
|
12287
|
+
const { checkHivePromotions } = await import("./hive-promoter-9d2g1xf3.js");
|
|
12288
12288
|
return checkHivePromotions(entries, knowledgeConfig, directory);
|
|
12289
12289
|
},
|
|
12290
12290
|
applyProposalTriage: async (directory, triage) => {
|
|
@@ -12293,7 +12293,7 @@ var _internals15 = {
|
|
|
12293
12293
|
activateProposal,
|
|
12294
12294
|
listSkills: listSkills2,
|
|
12295
12295
|
sanitizeSlug
|
|
12296
|
-
} = await import("./skill-generator-
|
|
12296
|
+
} = await import("./skill-generator-e8c2r816.js");
|
|
12297
12297
|
const result = {
|
|
12298
12298
|
approved: [],
|
|
12299
12299
|
rejected: [],
|
|
@@ -14818,9 +14818,9 @@ function hashContent(content) {
|
|
|
14818
14818
|
return createHash7("sha1").update(content).digest("hex");
|
|
14819
14819
|
}
|
|
14820
14820
|
async function loadConfigForPolicyCurator(directory) {
|
|
14821
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
14821
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-2x7wsb0n.js");
|
|
14822
14822
|
try {
|
|
14823
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
14823
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-edv27z4p.js");
|
|
14824
14824
|
const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
|
|
14825
14825
|
return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
|
|
14826
14826
|
} catch {
|
|
@@ -17981,7 +17981,7 @@ async function runFinalizeStage(ctx) {
|
|
|
17981
17981
|
}
|
|
17982
17982
|
}
|
|
17983
17983
|
try {
|
|
17984
|
-
const { CuratorConfigSchema: CCS } = await import("./schema-
|
|
17984
|
+
const { CuratorConfigSchema: CCS } = await import("./schema-2x7wsb0n.js");
|
|
17985
17985
|
const { config: pmLoadedConfig } = _internals24.loadPluginConfigWithMeta(ctx.directory);
|
|
17986
17986
|
const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
|
|
17987
17987
|
if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
|
|
@@ -20150,9 +20150,9 @@ var _internals28 = {
|
|
|
20150
20150
|
readSwarmFileAsync,
|
|
20151
20151
|
loadCuratorDeps: async () => {
|
|
20152
20152
|
const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
|
|
20153
|
-
import("./schema-
|
|
20154
|
-
import("./curator-
|
|
20155
|
-
import("./curator-llm-factory-
|
|
20153
|
+
import("./schema-2x7wsb0n.js"),
|
|
20154
|
+
import("./curator-5crbtfm1.js"),
|
|
20155
|
+
import("./curator-llm-factory-y24xw3j4.js")
|
|
20156
20156
|
]);
|
|
20157
20157
|
return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
|
|
20158
20158
|
}
|
|
@@ -20651,7 +20651,7 @@ import { fileURLToPath } from "url";
|
|
|
20651
20651
|
// package.json
|
|
20652
20652
|
var package_default = {
|
|
20653
20653
|
name: "opencode-swarm",
|
|
20654
|
-
version: "7.126.
|
|
20654
|
+
version: "7.126.5",
|
|
20655
20655
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
20656
20656
|
main: "dist/index.js",
|
|
20657
20657
|
types: "dist/index.d.ts",
|
|
@@ -21173,7 +21173,7 @@ async function computeCurationDiagnostics(directory, entries) {
|
|
|
21173
21173
|
let scanCompleted = false;
|
|
21174
21174
|
let scanRemaining = 0;
|
|
21175
21175
|
try {
|
|
21176
|
-
const { getScanStatus } = await import("./scan-cursor-
|
|
21176
|
+
const { getScanStatus } = await import("./scan-cursor-rgnarf67.js");
|
|
21177
21177
|
const status = await getScanStatus(directory);
|
|
21178
21178
|
scanGeneration = status.generation;
|
|
21179
21179
|
scanCompleted = status.completed;
|
|
@@ -21183,17 +21183,17 @@ async function computeCurationDiagnostics(directory, entries) {
|
|
|
21183
21183
|
try {
|
|
21184
21184
|
const { isLinked: isLinked2 } = await import("./knowledge-link-4yd2z8ev.js");
|
|
21185
21185
|
if (isLinked2(directory)) {
|
|
21186
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
21186
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-2x7wsb0n.js");
|
|
21187
21187
|
let config;
|
|
21188
21188
|
try {
|
|
21189
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
21189
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-edv27z4p.js");
|
|
21190
21190
|
const loaded = loadPluginConfigWithMeta2(directory);
|
|
21191
21191
|
config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
|
|
21192
21192
|
} catch {
|
|
21193
21193
|
config = KnowledgeConfigSchema2.parse({});
|
|
21194
21194
|
}
|
|
21195
21195
|
const { cohortConfigFingerprint: cohortConfigFingerprint2 } = await import("./config-fingerprint-v22xh5a2.js");
|
|
21196
|
-
const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-
|
|
21196
|
+
const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-82czah39.js");
|
|
21197
21197
|
const currentFp = cohortConfigFingerprint2(buildConfigFingerprintInput2(config));
|
|
21198
21198
|
const cohortFp = await readCohortConfigFingerprint(directory);
|
|
21199
21199
|
configMatch = cohortFp === null ? null : currentFp === cohortFp;
|
|
@@ -22391,7 +22391,7 @@ async function handleDoctorCommand(directory, args) {
|
|
|
22391
22391
|
const result = runConfigDoctor(config, directory);
|
|
22392
22392
|
let output;
|
|
22393
22393
|
if (enableAutoFix && result.hasAutoFixableIssues) {
|
|
22394
|
-
const { runConfigDoctorWithFixes } = await import("./config-doctor-
|
|
22394
|
+
const { runConfigDoctorWithFixes } = await import("./config-doctor-2admdwc2.js");
|
|
22395
22395
|
const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
|
|
22396
22396
|
applyLossy: true
|
|
22397
22397
|
});
|
|
@@ -35013,7 +35013,9 @@ var MAX_SAFE_TEST_FILES = 50;
|
|
|
35013
35013
|
var MAX_SAFE_SOURCE_FILES = 1;
|
|
35014
35014
|
async function estimateFanOut(sourceFiles, cwd) {
|
|
35015
35015
|
try {
|
|
35016
|
-
const impactMap = await loadImpactMap(cwd, {
|
|
35016
|
+
const impactMap = await _internals55.loadImpactMap(cwd, {
|
|
35017
|
+
skipRebuild: true
|
|
35018
|
+
});
|
|
35017
35019
|
const uniqueTestFiles = new Set;
|
|
35018
35020
|
for (const sourceFile of sourceFiles) {
|
|
35019
35021
|
const resolvedPath = path70.resolve(cwd, sourceFile);
|
|
@@ -35101,45 +35103,45 @@ function hasDevDependency(devDeps, ...patterns) {
|
|
|
35101
35103
|
return hasPackageJsonDependency(devDeps, ...patterns);
|
|
35102
35104
|
}
|
|
35103
35105
|
function detectGoTest(cwd) {
|
|
35104
|
-
return
|
|
35106
|
+
return _internals55.existsSync(path70.join(cwd, "go.mod")) && _internals55.isCommandAvailable("go");
|
|
35105
35107
|
}
|
|
35106
35108
|
function detectJavaMaven(cwd) {
|
|
35107
|
-
return
|
|
35109
|
+
return _internals55.existsSync(path70.join(cwd, "pom.xml")) && _internals55.isCommandAvailable("mvn");
|
|
35108
35110
|
}
|
|
35109
35111
|
function detectGradle(cwd) {
|
|
35110
|
-
const hasBuildFile =
|
|
35111
|
-
const hasGradlew =
|
|
35112
|
-
return hasBuildFile && (hasGradlew || isCommandAvailable("gradle"));
|
|
35112
|
+
const hasBuildFile = _internals55.existsSync(path70.join(cwd, "build.gradle")) || _internals55.existsSync(path70.join(cwd, "build.gradle.kts"));
|
|
35113
|
+
const hasGradlew = _internals55.existsSync(path70.join(cwd, "gradlew")) || _internals55.existsSync(path70.join(cwd, "gradlew.bat"));
|
|
35114
|
+
return hasBuildFile && (hasGradlew || _internals55.isCommandAvailable("gradle"));
|
|
35113
35115
|
}
|
|
35114
35116
|
function detectDotnetTest(cwd) {
|
|
35115
35117
|
try {
|
|
35116
|
-
const files =
|
|
35118
|
+
const files = _internals55.readdirSync(cwd);
|
|
35117
35119
|
const hasCsproj = files.some((f) => f.endsWith(".csproj"));
|
|
35118
|
-
return hasCsproj && isCommandAvailable("dotnet");
|
|
35120
|
+
return hasCsproj && _internals55.isCommandAvailable("dotnet");
|
|
35119
35121
|
} catch {
|
|
35120
35122
|
return false;
|
|
35121
35123
|
}
|
|
35122
35124
|
}
|
|
35123
35125
|
function detectCTest(cwd) {
|
|
35124
|
-
const hasSource =
|
|
35125
|
-
const hasBuildCache =
|
|
35126
|
-
return (hasSource || hasBuildCache) && isCommandAvailable("ctest");
|
|
35126
|
+
const hasSource = _internals55.existsSync(path70.join(cwd, "CMakeLists.txt"));
|
|
35127
|
+
const hasBuildCache = _internals55.existsSync(path70.join(cwd, "CMakeCache.txt")) || _internals55.existsSync(path70.join(cwd, "build", "CMakeCache.txt"));
|
|
35128
|
+
return (hasSource || hasBuildCache) && _internals55.isCommandAvailable("ctest");
|
|
35127
35129
|
}
|
|
35128
35130
|
function detectSwiftTest(cwd) {
|
|
35129
|
-
return
|
|
35131
|
+
return _internals55.existsSync(path70.join(cwd, "Package.swift")) && _internals55.isCommandAvailable("swift");
|
|
35130
35132
|
}
|
|
35131
35133
|
function detectDartTest(cwd) {
|
|
35132
|
-
return
|
|
35134
|
+
return _internals55.existsSync(path70.join(cwd, "pubspec.yaml")) && (_internals55.isCommandAvailable("dart") || _internals55.isCommandAvailable("flutter"));
|
|
35133
35135
|
}
|
|
35134
35136
|
function detectRSpec(cwd) {
|
|
35135
|
-
const hasRSpecFile =
|
|
35136
|
-
const hasGemfile =
|
|
35137
|
-
const hasSpecDir =
|
|
35137
|
+
const hasRSpecFile = _internals55.existsSync(path70.join(cwd, ".rspec"));
|
|
35138
|
+
const hasGemfile = _internals55.existsSync(path70.join(cwd, "Gemfile"));
|
|
35139
|
+
const hasSpecDir = _internals55.existsSync(path70.join(cwd, "spec"));
|
|
35138
35140
|
const hasRSpec = hasRSpecFile || hasGemfile && hasSpecDir;
|
|
35139
|
-
return hasRSpec && (isCommandAvailable("bundle") || isCommandAvailable("rspec"));
|
|
35141
|
+
return hasRSpec && (_internals55.isCommandAvailable("bundle") || _internals55.isCommandAvailable("rspec"));
|
|
35140
35142
|
}
|
|
35141
35143
|
function detectMinitest(cwd) {
|
|
35142
|
-
return
|
|
35144
|
+
return _internals55.existsSync(path70.join(cwd, "test")) && (_internals55.existsSync(path70.join(cwd, "Gemfile")) || _internals55.existsSync(path70.join(cwd, "Rakefile"))) && _internals55.isCommandAvailable("ruby");
|
|
35143
35145
|
}
|
|
35144
35146
|
var DISPATCH_FRAMEWORK_MAP = {
|
|
35145
35147
|
bun: "bun",
|
|
@@ -35230,8 +35232,8 @@ async function detectTestFramework(cwd) {
|
|
|
35230
35232
|
const baseDir = cwd;
|
|
35231
35233
|
try {
|
|
35232
35234
|
const packageJsonPath = path70.join(baseDir, "package.json");
|
|
35233
|
-
if (
|
|
35234
|
-
const content =
|
|
35235
|
+
if (_internals55.existsSync(packageJsonPath)) {
|
|
35236
|
+
const content = _internals55.readFileSync(packageJsonPath, "utf-8");
|
|
35235
35237
|
const pkg = JSON.parse(content);
|
|
35236
35238
|
const _deps = pkg.dependencies || {};
|
|
35237
35239
|
const devDeps = pkg.devDependencies || {};
|
|
@@ -35250,7 +35252,7 @@ async function detectTestFramework(cwd) {
|
|
|
35250
35252
|
return "jest";
|
|
35251
35253
|
if (hasDevDependency(devDeps, "mocha", "@types/mocha"))
|
|
35252
35254
|
return "mocha";
|
|
35253
|
-
if (
|
|
35255
|
+
if (_internals55.existsSync(path70.join(baseDir, "bun.lockb")) || _internals55.existsSync(path70.join(baseDir, "bun.lock"))) {
|
|
35254
35256
|
if (scripts.test?.includes("bun"))
|
|
35255
35257
|
return "bun";
|
|
35256
35258
|
}
|
|
@@ -35260,28 +35262,28 @@ async function detectTestFramework(cwd) {
|
|
|
35260
35262
|
const pyprojectTomlPath = path70.join(baseDir, "pyproject.toml");
|
|
35261
35263
|
const setupCfgPath = path70.join(baseDir, "setup.cfg");
|
|
35262
35264
|
const requirementsTxtPath = path70.join(baseDir, "requirements.txt");
|
|
35263
|
-
if (
|
|
35264
|
-
const content =
|
|
35265
|
+
if (_internals55.existsSync(pyprojectTomlPath)) {
|
|
35266
|
+
const content = _internals55.readFileSync(pyprojectTomlPath, "utf-8");
|
|
35265
35267
|
if (content.includes("[tool.pytest"))
|
|
35266
35268
|
return "pytest";
|
|
35267
35269
|
if (content.includes("pytest"))
|
|
35268
35270
|
return "pytest";
|
|
35269
35271
|
}
|
|
35270
|
-
if (
|
|
35271
|
-
const content =
|
|
35272
|
+
if (_internals55.existsSync(setupCfgPath)) {
|
|
35273
|
+
const content = _internals55.readFileSync(setupCfgPath, "utf-8");
|
|
35272
35274
|
if (content.includes("[pytest]"))
|
|
35273
35275
|
return "pytest";
|
|
35274
35276
|
}
|
|
35275
|
-
if (
|
|
35276
|
-
const content =
|
|
35277
|
+
if (_internals55.existsSync(requirementsTxtPath)) {
|
|
35278
|
+
const content = _internals55.readFileSync(requirementsTxtPath, "utf-8");
|
|
35277
35279
|
if (content.includes("pytest"))
|
|
35278
35280
|
return "pytest";
|
|
35279
35281
|
}
|
|
35280
35282
|
} catch {}
|
|
35281
35283
|
try {
|
|
35282
35284
|
const cargoTomlPath = path70.join(baseDir, "Cargo.toml");
|
|
35283
|
-
if (
|
|
35284
|
-
const content =
|
|
35285
|
+
if (_internals55.existsSync(cargoTomlPath)) {
|
|
35286
|
+
const content = _internals55.readFileSync(cargoTomlPath, "utf-8");
|
|
35285
35287
|
if (content.includes("[dev-dependencies]")) {
|
|
35286
35288
|
if (content.includes("tokio") || content.includes("mockall") || content.includes("pretty_assertions")) {
|
|
35287
35289
|
return "cargo";
|
|
@@ -35293,7 +35295,7 @@ async function detectTestFramework(cwd) {
|
|
|
35293
35295
|
const pesterConfigPath = path70.join(baseDir, "pester.config.ps1");
|
|
35294
35296
|
const pesterConfigJsonPath = path70.join(baseDir, "pester.config.ps1.json");
|
|
35295
35297
|
const pesterPs1Path = path70.join(baseDir, "tests.ps1");
|
|
35296
|
-
if (
|
|
35298
|
+
if (_internals55.existsSync(pesterConfigPath) || _internals55.existsSync(pesterConfigJsonPath) || _internals55.existsSync(pesterPs1Path)) {
|
|
35297
35299
|
return "pester";
|
|
35298
35300
|
}
|
|
35299
35301
|
} catch {}
|
|
@@ -35321,12 +35323,12 @@ async function detectTestFramework(cwd) {
|
|
|
35321
35323
|
return "none";
|
|
35322
35324
|
}
|
|
35323
35325
|
function detectPhpTest(cwd) {
|
|
35324
|
-
if (
|
|
35326
|
+
if (_internals55.existsSync(path70.join(cwd, "artisan")) && _internals55.existsSync(path70.join(cwd, "composer.json"))) {
|
|
35325
35327
|
return "php-artisan";
|
|
35326
35328
|
}
|
|
35327
|
-
if (
|
|
35329
|
+
if (_internals55.existsSync(path70.join(cwd, "Pest.php")))
|
|
35328
35330
|
return "pest";
|
|
35329
|
-
if (
|
|
35331
|
+
if (_internals55.existsSync(path70.join(cwd, "phpunit.xml")) || _internals55.existsSync(path70.join(cwd, "phpunit.xml.dist"))) {
|
|
35330
35332
|
return "phpunit";
|
|
35331
35333
|
}
|
|
35332
35334
|
return null;
|
|
@@ -35708,9 +35710,9 @@ function buildTestCommand(framework, scope, files, coverage, baseDir, bail) {
|
|
|
35708
35710
|
case "swift-test":
|
|
35709
35711
|
return ["swift", "test"];
|
|
35710
35712
|
case "dart-test":
|
|
35711
|
-
return isCommandAvailable("flutter") ? ["flutter", "test", ...files] : ["dart", "test", ...files];
|
|
35713
|
+
return _internals55.isCommandAvailable("flutter") ? ["flutter", "test", ...files] : ["dart", "test", ...files];
|
|
35712
35714
|
case "rspec": {
|
|
35713
|
-
const args = isCommandAvailable("bundle") ? ["bundle", "exec", "rspec"] : ["rspec"];
|
|
35715
|
+
const args = _internals55.isCommandAvailable("bundle") ? ["bundle", "exec", "rspec"] : ["rspec"];
|
|
35714
35716
|
if (bail)
|
|
35715
35717
|
args.push("--fail-fast");
|
|
35716
35718
|
if (scope !== "all" && files.length > 0) {
|
|
@@ -36723,7 +36725,7 @@ var test_runner = createSwarmTool({
|
|
|
36723
36725
|
return JSON.stringify(errorResult, null, 2);
|
|
36724
36726
|
}
|
|
36725
36727
|
try {
|
|
36726
|
-
const impactResult = await analyzeImpact(sourceFiles, workingDir, MAX_SAFE_TEST_FILES);
|
|
36728
|
+
const impactResult = await _internals55.analyzeImpact(sourceFiles, workingDir, MAX_SAFE_TEST_FILES);
|
|
36727
36729
|
if (impactResult.budgetExceeded) {
|
|
36728
36730
|
const errorResult = {
|
|
36729
36731
|
success: false,
|
|
@@ -36813,6 +36815,16 @@ var test_runner = createSwarmTool({
|
|
|
36813
36815
|
return JSON.stringify(result, null, 2);
|
|
36814
36816
|
}
|
|
36815
36817
|
});
|
|
36818
|
+
var _internals55 = {
|
|
36819
|
+
analyzeImpact,
|
|
36820
|
+
loadImpactMap,
|
|
36821
|
+
isCommandAvailable,
|
|
36822
|
+
existsSync: fs31.existsSync,
|
|
36823
|
+
readdirSync: fs31.readdirSync,
|
|
36824
|
+
readFileSync: fs31.readFileSync,
|
|
36825
|
+
selectHistoryForAnalysis,
|
|
36826
|
+
AGGREGATE_TEST_NAME
|
|
36827
|
+
};
|
|
36816
36828
|
|
|
36817
36829
|
// src/services/preflight-service.ts
|
|
36818
36830
|
var MIN_CHECK_TIMEOUT_MS = 5000;
|
|
@@ -36898,9 +36910,9 @@ function getVersionFileVersion(dir) {
|
|
|
36898
36910
|
async function runVersionCheck(dir, _timeoutMs) {
|
|
36899
36911
|
const startTime = Date.now();
|
|
36900
36912
|
try {
|
|
36901
|
-
const packageVersion =
|
|
36902
|
-
const changelogVersion =
|
|
36903
|
-
const versionFileVersion =
|
|
36913
|
+
const packageVersion = _internals56.getPackageVersion(dir);
|
|
36914
|
+
const changelogVersion = _internals56.getChangelogVersion(dir);
|
|
36915
|
+
const versionFileVersion = _internals56.getVersionFileVersion(dir);
|
|
36904
36916
|
const versions = [];
|
|
36905
36917
|
if (packageVersion)
|
|
36906
36918
|
versions.push(`package.json: ${packageVersion}`);
|
|
@@ -37264,7 +37276,7 @@ async function runPreflight(dir, phase, config) {
|
|
|
37264
37276
|
const reportId = `preflight-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
37265
37277
|
let validatedDir;
|
|
37266
37278
|
try {
|
|
37267
|
-
validatedDir =
|
|
37279
|
+
validatedDir = _internals56.validateDirectoryPath(dir);
|
|
37268
37280
|
} catch (error2) {
|
|
37269
37281
|
return {
|
|
37270
37282
|
id: reportId,
|
|
@@ -37284,7 +37296,7 @@ async function runPreflight(dir, phase, config) {
|
|
|
37284
37296
|
}
|
|
37285
37297
|
let validatedTimeout;
|
|
37286
37298
|
try {
|
|
37287
|
-
validatedTimeout =
|
|
37299
|
+
validatedTimeout = _internals56.validateTimeout(config?.checkTimeoutMs, DEFAULT_CONFIG.checkTimeoutMs);
|
|
37288
37300
|
} catch (error2) {
|
|
37289
37301
|
return {
|
|
37290
37302
|
id: reportId,
|
|
@@ -37325,12 +37337,12 @@ async function runPreflight(dir, phase, config) {
|
|
|
37325
37337
|
});
|
|
37326
37338
|
const checks = [];
|
|
37327
37339
|
log("[Preflight] Running lint check...");
|
|
37328
|
-
const lintResult = await
|
|
37340
|
+
const lintResult = await _internals56.runLintCheck(validatedDir, cfg.linter, cfg.checkTimeoutMs);
|
|
37329
37341
|
checks.push(lintResult);
|
|
37330
37342
|
log(`[Preflight] Lint check: ${lintResult.status} ${lintResult.message}`);
|
|
37331
37343
|
if (!cfg.skipTests) {
|
|
37332
37344
|
log("[Preflight] Running tests check...");
|
|
37333
|
-
const testsResult = await
|
|
37345
|
+
const testsResult = await _internals56.runTestsCheck(validatedDir, cfg.testScope, cfg.checkTimeoutMs);
|
|
37334
37346
|
checks.push(testsResult);
|
|
37335
37347
|
log(`[Preflight] Tests check: ${testsResult.status} ${testsResult.message}`);
|
|
37336
37348
|
} else {
|
|
@@ -37342,7 +37354,7 @@ async function runPreflight(dir, phase, config) {
|
|
|
37342
37354
|
}
|
|
37343
37355
|
if (!cfg.skipSecrets) {
|
|
37344
37356
|
log("[Preflight] Running secrets check...");
|
|
37345
|
-
const secretsResult = await
|
|
37357
|
+
const secretsResult = await _internals56.runSecretsCheck(validatedDir, cfg.checkTimeoutMs);
|
|
37346
37358
|
checks.push(secretsResult);
|
|
37347
37359
|
log(`[Preflight] Secrets check: ${secretsResult.status} ${secretsResult.message}`);
|
|
37348
37360
|
} else {
|
|
@@ -37354,7 +37366,7 @@ async function runPreflight(dir, phase, config) {
|
|
|
37354
37366
|
}
|
|
37355
37367
|
if (!cfg.skipEvidence) {
|
|
37356
37368
|
log("[Preflight] Running evidence check...");
|
|
37357
|
-
const evidenceResult = await
|
|
37369
|
+
const evidenceResult = await _internals56.runEvidenceCheck(validatedDir);
|
|
37358
37370
|
checks.push(evidenceResult);
|
|
37359
37371
|
log(`[Preflight] Evidence check: ${evidenceResult.status} ${evidenceResult.message}`);
|
|
37360
37372
|
} else {
|
|
@@ -37365,12 +37377,12 @@ async function runPreflight(dir, phase, config) {
|
|
|
37365
37377
|
});
|
|
37366
37378
|
}
|
|
37367
37379
|
log("[Preflight] Running requirement coverage check...");
|
|
37368
|
-
const reqCoverageResult = await
|
|
37380
|
+
const reqCoverageResult = await _internals56.runRequirementCoverageCheck(validatedDir, phase);
|
|
37369
37381
|
checks.push(reqCoverageResult);
|
|
37370
37382
|
log(`[Preflight] Requirement coverage check: ${reqCoverageResult.status} ${reqCoverageResult.message}`);
|
|
37371
37383
|
if (!cfg.skipVersion) {
|
|
37372
37384
|
log("[Preflight] Running version check...");
|
|
37373
|
-
const versionResult = await
|
|
37385
|
+
const versionResult = await _internals56.runVersionCheck(validatedDir, cfg.checkTimeoutMs);
|
|
37374
37386
|
checks.push(versionResult);
|
|
37375
37387
|
log(`[Preflight] Version check: ${versionResult.status} ${versionResult.message}`);
|
|
37376
37388
|
} else {
|
|
@@ -37433,10 +37445,10 @@ function formatPreflightMarkdown(report) {
|
|
|
37433
37445
|
async function handlePreflightCommand(directory, _args) {
|
|
37434
37446
|
const plan = await loadPlan(directory);
|
|
37435
37447
|
const phase = plan?.current_phase ?? 1;
|
|
37436
|
-
const report = await
|
|
37437
|
-
return
|
|
37448
|
+
const report = await _internals56.runPreflight(directory, phase);
|
|
37449
|
+
return _internals56.formatPreflightMarkdown(report);
|
|
37438
37450
|
}
|
|
37439
|
-
var
|
|
37451
|
+
var _internals56 = {
|
|
37440
37452
|
runPreflight,
|
|
37441
37453
|
formatPreflightMarkdown,
|
|
37442
37454
|
handlePreflightCommand,
|
|
@@ -38408,7 +38420,7 @@ function pruneOldResetBackups(backupsRoot, warnings) {
|
|
|
38408
38420
|
}
|
|
38409
38421
|
|
|
38410
38422
|
// src/commands/reset.ts
|
|
38411
|
-
var
|
|
38423
|
+
var _internals57 = {
|
|
38412
38424
|
backupSwarmStateBeforeReset
|
|
38413
38425
|
};
|
|
38414
38426
|
async function handleResetCommand(directory, args) {
|
|
@@ -38442,7 +38454,7 @@ async function handleResetCommand(directory, args) {
|
|
|
38442
38454
|
];
|
|
38443
38455
|
const results = [];
|
|
38444
38456
|
try {
|
|
38445
|
-
const backup =
|
|
38457
|
+
const backup = _internals57.backupSwarmStateBeforeReset(directory, "reset", [
|
|
38446
38458
|
...filesToReset,
|
|
38447
38459
|
"summaries"
|
|
38448
38460
|
]);
|
|
@@ -39065,7 +39077,7 @@ async function recordReplayEntry(artifactPath, sessionID, entry) {
|
|
|
39065
39077
|
}
|
|
39066
39078
|
|
|
39067
39079
|
// src/prm/index.ts
|
|
39068
|
-
var
|
|
39080
|
+
var _internals58 = {
|
|
39069
39081
|
getAgentSession,
|
|
39070
39082
|
readTrajectory,
|
|
39071
39083
|
getInMemoryTrajectory,
|
|
@@ -39088,12 +39100,12 @@ function resetPrmSessionState(session, sessionId) {
|
|
|
39088
39100
|
session.prmTrajectoryStep = 0;
|
|
39089
39101
|
session.replayArtifactPath = null;
|
|
39090
39102
|
if (sessionId) {
|
|
39091
|
-
|
|
39103
|
+
_internals58.clearTrajectoryCache(sessionId);
|
|
39092
39104
|
}
|
|
39093
39105
|
}
|
|
39094
39106
|
|
|
39095
39107
|
// src/commands/reset-session.ts
|
|
39096
|
-
var
|
|
39108
|
+
var _internals59 = {
|
|
39097
39109
|
cleanupOrphanedBranches,
|
|
39098
39110
|
backupSwarmStateBeforeReset
|
|
39099
39111
|
};
|
|
@@ -39105,7 +39117,7 @@ function errorMessage(err) {
|
|
|
39105
39117
|
async function handleResetSessionCommand(directory, _args) {
|
|
39106
39118
|
const results = [];
|
|
39107
39119
|
try {
|
|
39108
|
-
const backup =
|
|
39120
|
+
const backup = _internals59.backupSwarmStateBeforeReset(directory, "reset-session", ["session"]);
|
|
39109
39121
|
if (backup.backupDir && backup.copied.length > 0) {
|
|
39110
39122
|
const rel = path76.relative(directory, backup.backupDir);
|
|
39111
39123
|
results.push(`\uD83D\uDCE6 Backed up session state to ${rel}/ (restore by copying files back into .swarm/session/)`);
|
|
@@ -39172,7 +39184,7 @@ async function handleResetSessionCommand(directory, _args) {
|
|
|
39172
39184
|
results.push(`\u26A0\uFE0F Failed to remove .swarm-worktrees/: ${errorMessage(err)}`);
|
|
39173
39185
|
}
|
|
39174
39186
|
try {
|
|
39175
|
-
const branchResult = await
|
|
39187
|
+
const branchResult = await _internals59.cleanupOrphanedBranches(directory, []);
|
|
39176
39188
|
if (branchResult.removed.length > 0) {
|
|
39177
39189
|
results.push(`\u2705 Removed ${branchResult.removed.length} orphan swarm-lane branch(es)`);
|
|
39178
39190
|
}
|
|
@@ -39510,7 +39522,7 @@ async function handleRollbackCommand(directory, args) {
|
|
|
39510
39522
|
// src/commands/sdd.ts
|
|
39511
39523
|
import * as fs39 from "fs";
|
|
39512
39524
|
import * as path79 from "path";
|
|
39513
|
-
var
|
|
39525
|
+
var _internals60 = {
|
|
39514
39526
|
writeProjectedSpecSync
|
|
39515
39527
|
};
|
|
39516
39528
|
var SWARM_SPEC_REL = path79.join(".swarm", "spec.md");
|
|
@@ -39906,7 +39918,7 @@ ${USAGE11}`;
|
|
|
39906
39918
|
|
|
39907
39919
|
${USAGE11}`;
|
|
39908
39920
|
}
|
|
39909
|
-
const result2 =
|
|
39921
|
+
const result2 = _internals60.writeProjectedSpecSync(directory, {
|
|
39910
39922
|
source: "speckit",
|
|
39911
39923
|
feature: resolution.feature,
|
|
39912
39924
|
dryRun: parsed.dryRun,
|
|
@@ -39964,7 +39976,7 @@ ${formatList(result2.projection.warnings)}` : ""
|
|
|
39964
39976
|
].join(`
|
|
39965
39977
|
`);
|
|
39966
39978
|
}
|
|
39967
|
-
const result =
|
|
39979
|
+
const result = _internals60.writeProjectedSpecSync(directory, {
|
|
39968
39980
|
changeId: parsed.changeId,
|
|
39969
39981
|
dryRun: parsed.dryRun,
|
|
39970
39982
|
overwrite: parsed.overwrite
|
|
@@ -40353,7 +40365,7 @@ var DEFAULT_CONTEXT_BUDGET_CONFIG = {
|
|
|
40353
40365
|
};
|
|
40354
40366
|
|
|
40355
40367
|
// src/services/status-service.ts
|
|
40356
|
-
var
|
|
40368
|
+
var _internals61 = {
|
|
40357
40369
|
loadLeanTurboRunState,
|
|
40358
40370
|
hasActiveLeanTurbo,
|
|
40359
40371
|
hasActiveFullAuto,
|
|
@@ -40508,11 +40520,11 @@ async function getStatusData(directory, agents) {
|
|
|
40508
40520
|
} catch {
|
|
40509
40521
|
status.memoryCohort = { linked: false };
|
|
40510
40522
|
}
|
|
40511
|
-
status.fullAutoActive =
|
|
40523
|
+
status.fullAutoActive = _internals61.hasActiveFullAuto();
|
|
40512
40524
|
if (status.fullAutoActive) {
|
|
40513
|
-
const sid =
|
|
40525
|
+
const sid = _internals61.getActiveFullAutoSessionID();
|
|
40514
40526
|
if (sid) {
|
|
40515
|
-
const runState =
|
|
40527
|
+
const runState = _internals61.loadFullAutoRunState(directory, sid);
|
|
40516
40528
|
if (runState?.lastEscalation) {
|
|
40517
40529
|
status.fullAutoEscalation = {
|
|
40518
40530
|
reason: runState.lastEscalation.reason,
|
|
@@ -40527,7 +40539,7 @@ async function getStatusData(directory, agents) {
|
|
|
40527
40539
|
}
|
|
40528
40540
|
function enrichWithLeanTurbo(status, directory) {
|
|
40529
40541
|
const turboMode = hasActiveTurboMode();
|
|
40530
|
-
const leanActive =
|
|
40542
|
+
const leanActive = _internals61.hasActiveLeanTurbo();
|
|
40531
40543
|
let turboStrategy = "off";
|
|
40532
40544
|
if (leanActive) {
|
|
40533
40545
|
turboStrategy = "lean";
|
|
@@ -40546,7 +40558,7 @@ function enrichWithLeanTurbo(status, directory) {
|
|
|
40546
40558
|
}
|
|
40547
40559
|
}
|
|
40548
40560
|
if (leanSessionID) {
|
|
40549
|
-
const runState =
|
|
40561
|
+
const runState = _internals61.loadLeanTurboRunState(directory, leanSessionID);
|
|
40550
40562
|
if (runState) {
|
|
40551
40563
|
status.leanTurboPhase = runState.phase;
|
|
40552
40564
|
status.leanMaxParallelCoders = runState.maxParallelCoders;
|
|
@@ -40781,7 +40793,7 @@ init_logger();
|
|
|
40781
40793
|
var TURBO_BYPASS_DISCLOSURE = "Bypassed: Stage B (reviewer + test_engineer) for Tier 0-2 tasks; phase_complete Gates 1-5 " + "(completion-verify, drift-verifier, hallucination-guard, mutation-gate, phase-council). " + "Still enforced: Stage A (lint, imports, pre_check_batch); Tier 3 Stage B; Gate 5b " + "(architecture-supervisor); Gate 6 (final-council); Gate 7 (full-auto).";
|
|
40782
40794
|
|
|
40783
40795
|
// src/commands/turbo.ts
|
|
40784
|
-
var
|
|
40796
|
+
var _internals62 = {
|
|
40785
40797
|
loadPluginConfigWithMeta
|
|
40786
40798
|
};
|
|
40787
40799
|
async function handleTurboCommand(directory, args, sessionID) {
|
|
@@ -40841,7 +40853,7 @@ async function handleTurboCommand(directory, args, sessionID) {
|
|
|
40841
40853
|
if (arg0 === "on") {
|
|
40842
40854
|
let strategy = "standard";
|
|
40843
40855
|
try {
|
|
40844
|
-
const { config } =
|
|
40856
|
+
const { config } = _internals62.loadPluginConfigWithMeta(directory);
|
|
40845
40857
|
if (config.turbo?.strategy === "lean") {
|
|
40846
40858
|
strategy = "lean";
|
|
40847
40859
|
}
|
|
@@ -40938,7 +40950,7 @@ function enableLeanTurbo(session, directory, sessionID) {
|
|
|
40938
40950
|
let maxParallelCoders = 4;
|
|
40939
40951
|
let conflictPolicy = "serialize";
|
|
40940
40952
|
try {
|
|
40941
|
-
const { config } =
|
|
40953
|
+
const { config } = _internals62.loadPluginConfigWithMeta(directory);
|
|
40942
40954
|
const leanConfig = config.turbo?.lean;
|
|
40943
40955
|
if (leanConfig) {
|
|
40944
40956
|
maxParallelCoders = leanConfig.max_parallel_coders ?? 4;
|
|
@@ -41143,7 +41155,7 @@ function findSimilarCommands(query) {
|
|
|
41143
41155
|
}
|
|
41144
41156
|
const scored = VALID_COMMANDS.map((cmd) => {
|
|
41145
41157
|
const cmdLower = cmd.toLowerCase();
|
|
41146
|
-
const fullScore =
|
|
41158
|
+
const fullScore = _internals63.levenshteinDistance(q, cmdLower);
|
|
41147
41159
|
let tokenScore = Infinity;
|
|
41148
41160
|
if (cmd.includes(" ") || cmd.includes("-")) {
|
|
41149
41161
|
const qTokens = q.split(/[\s-]+/);
|
|
@@ -41156,7 +41168,7 @@ function findSimilarCommands(query) {
|
|
|
41156
41168
|
for (const ct of cmdTokens) {
|
|
41157
41169
|
if (ct.length === 0)
|
|
41158
41170
|
continue;
|
|
41159
|
-
const dist =
|
|
41171
|
+
const dist = _internals63.levenshteinDistance(qt, ct);
|
|
41160
41172
|
if (dist < minDist)
|
|
41161
41173
|
minDist = dist;
|
|
41162
41174
|
}
|
|
@@ -41166,7 +41178,7 @@ function findSimilarCommands(query) {
|
|
|
41166
41178
|
}
|
|
41167
41179
|
const dashStrippedQ = q.replace(/-/g, "");
|
|
41168
41180
|
const dashStrippedCmd = cmdLower.replace(/-/g, "");
|
|
41169
|
-
const dashScore =
|
|
41181
|
+
const dashScore = _internals63.levenshteinDistance(dashStrippedQ, dashStrippedCmd);
|
|
41170
41182
|
const score = Math.min(fullScore, tokenScore, dashScore);
|
|
41171
41183
|
return { cmd, score };
|
|
41172
41184
|
});
|
|
@@ -41201,16 +41213,16 @@ function buildDetailedHelp(commandName, entry) {
|
|
|
41201
41213
|
async function handleHelpCommand(ctx) {
|
|
41202
41214
|
const targetCommand = ctx.args.join(" ");
|
|
41203
41215
|
if (!targetCommand) {
|
|
41204
|
-
const { buildHelpText } = await import("./index-
|
|
41216
|
+
const { buildHelpText } = await import("./index-0543dz3t.js");
|
|
41205
41217
|
return buildHelpText();
|
|
41206
41218
|
}
|
|
41207
41219
|
const tokens = targetCommand.split(/\s+/);
|
|
41208
|
-
const resolved =
|
|
41220
|
+
const resolved = _internals63.resolveCommand(tokens);
|
|
41209
41221
|
if (resolved) {
|
|
41210
|
-
return
|
|
41222
|
+
return _internals63.buildDetailedHelp(resolved.key, resolved.entry);
|
|
41211
41223
|
}
|
|
41212
|
-
const similar =
|
|
41213
|
-
const { buildHelpText: fullHelp } = await import("./index-
|
|
41224
|
+
const similar = _internals63.findSimilarCommands(targetCommand);
|
|
41225
|
+
const { buildHelpText: fullHelp } = await import("./index-0543dz3t.js");
|
|
41214
41226
|
if (similar.length > 0) {
|
|
41215
41227
|
return `Command '/swarm ${targetCommand}' not found.
|
|
41216
41228
|
|
|
@@ -41280,7 +41292,7 @@ var COMMAND_REGISTRY = {
|
|
|
41280
41292
|
toolNoArgs: true
|
|
41281
41293
|
},
|
|
41282
41294
|
help: {
|
|
41283
|
-
handler: (ctx) =>
|
|
41295
|
+
handler: (ctx) => _internals63.handleHelpCommand(ctx),
|
|
41284
41296
|
description: "Show help for swarm commands",
|
|
41285
41297
|
category: "core",
|
|
41286
41298
|
args: "[command]",
|
|
@@ -41349,7 +41361,7 @@ var COMMAND_REGISTRY = {
|
|
|
41349
41361
|
},
|
|
41350
41362
|
"guardrail explain": {
|
|
41351
41363
|
handler: async (ctx) => {
|
|
41352
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
41364
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-3r26pm2s.js");
|
|
41353
41365
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
41354
41366
|
},
|
|
41355
41367
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -41359,7 +41371,7 @@ var COMMAND_REGISTRY = {
|
|
|
41359
41371
|
},
|
|
41360
41372
|
"guardrail-explain": {
|
|
41361
41373
|
handler: async (ctx) => {
|
|
41362
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
41374
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-3r26pm2s.js");
|
|
41363
41375
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
41364
41376
|
},
|
|
41365
41377
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -41369,7 +41381,7 @@ var COMMAND_REGISTRY = {
|
|
|
41369
41381
|
},
|
|
41370
41382
|
"guardrail-log": {
|
|
41371
41383
|
handler: async (ctx) => {
|
|
41372
|
-
const { handleGuardrailLog } = await import("./guardrail-log-
|
|
41384
|
+
const { handleGuardrailLog } = await import("./guardrail-log-7cychbgs.js");
|
|
41373
41385
|
return handleGuardrailLog(ctx.directory, ctx.args);
|
|
41374
41386
|
},
|
|
41375
41387
|
description: "Read the guardrail decision log (use --blocks-only for blocks)",
|
|
@@ -42253,7 +42265,7 @@ function validateToolPolicy() {
|
|
|
42253
42265
|
}
|
|
42254
42266
|
return { valid: warnings.length === 0, warnings };
|
|
42255
42267
|
}
|
|
42256
|
-
var
|
|
42268
|
+
var _internals63 = {
|
|
42257
42269
|
handleHelpCommand,
|
|
42258
42270
|
validateAliases,
|
|
42259
42271
|
validateToolPolicy,
|
|
@@ -42263,16 +42275,16 @@ var _internals62 = {
|
|
|
42263
42275
|
findSimilarCommands,
|
|
42264
42276
|
buildDetailedHelp
|
|
42265
42277
|
};
|
|
42266
|
-
var validation =
|
|
42278
|
+
var validation = _internals63.validateAliases();
|
|
42267
42279
|
if (!validation.valid) {
|
|
42268
42280
|
throw new Error(`COMMAND_REGISTRY alias validation failed:
|
|
42269
42281
|
${validation.errors.join(`
|
|
42270
42282
|
`)}`);
|
|
42271
42283
|
}
|
|
42272
|
-
|
|
42284
|
+
_internals63.emitValidationWarnings("COMMAND_REGISTRY alias warnings", validation.warnings);
|
|
42273
42285
|
try {
|
|
42274
|
-
const toolPolicyValidation =
|
|
42275
|
-
|
|
42286
|
+
const toolPolicyValidation = _internals63.validateToolPolicy();
|
|
42287
|
+
_internals63.emitValidationWarnings("COMMAND_REGISTRY toolPolicy warnings", toolPolicyValidation.warnings);
|
|
42276
42288
|
} catch (e) {
|
|
42277
42289
|
warn(`COMMAND_REGISTRY toolPolicy validation failed (non-fatal): ${e.message}`);
|
|
42278
42290
|
}
|
|
@@ -45041,7 +45053,7 @@ function formatCommandNotFound(tokens) {
|
|
|
45041
45053
|
const attemptedCommand = tokens[0] || "";
|
|
45042
45054
|
const MAX_DISPLAY = 100;
|
|
45043
45055
|
const displayCommand = attemptedCommand.length > MAX_DISPLAY ? `${attemptedCommand.slice(0, MAX_DISPLAY)}...` : attemptedCommand;
|
|
45044
|
-
const similar =
|
|
45056
|
+
const similar = _internals63.findSimilarCommands(attemptedCommand);
|
|
45045
45057
|
const header = `Command \`/swarm ${displayCommand}\` not found.`;
|
|
45046
45058
|
const suggestions = similar.length > 0 ? `Did you mean:
|
|
45047
45059
|
${similar.map((cmd) => ` - /swarm ${cmd}`).join(`
|
|
@@ -47069,10 +47081,10 @@ function startAgentSession(sessionId, agentName, staleDurationMs = STALE_SESSION
|
|
|
47069
47081
|
}
|
|
47070
47082
|
telemetry.sessionStarted(sessionId, agentName);
|
|
47071
47083
|
swarmState.activeAgent.set(sessionId, agentName);
|
|
47072
|
-
|
|
47084
|
+
_internals66.applyRehydrationCache(sessionState);
|
|
47073
47085
|
if (directory) {
|
|
47074
47086
|
let rehydrationPromise;
|
|
47075
|
-
rehydrationPromise =
|
|
47087
|
+
rehydrationPromise = _internals66.rehydrateSessionFromDisk(directory, sessionState).then(async () => {
|
|
47076
47088
|
try {
|
|
47077
47089
|
sessionState.prSubscriptions = await rehydratePrSubscriptions(sessionId, directory);
|
|
47078
47090
|
} catch (err) {
|
|
@@ -47268,7 +47280,7 @@ function ensureAgentSession(sessionId, agentName, directory) {
|
|
|
47268
47280
|
maybeSweepStaleSessions();
|
|
47269
47281
|
return session;
|
|
47270
47282
|
}
|
|
47271
|
-
|
|
47283
|
+
_internals66.startAgentSession(sessionId, agentName ?? "unknown", 7200000, directory);
|
|
47272
47284
|
session = swarmState.agentSessions.get(sessionId);
|
|
47273
47285
|
if (!session) {
|
|
47274
47286
|
throw new Error(`Failed to create guardrail session for ${sessionId}`);
|
|
@@ -47557,8 +47569,8 @@ function applyRehydrationCache(session) {
|
|
|
47557
47569
|
}
|
|
47558
47570
|
}
|
|
47559
47571
|
async function rehydrateSessionFromDisk(directory, session) {
|
|
47560
|
-
await
|
|
47561
|
-
|
|
47572
|
+
await _internals66.buildRehydrationCache(directory);
|
|
47573
|
+
_internals66.applyRehydrationCache(session);
|
|
47562
47574
|
}
|
|
47563
47575
|
function hasActiveTurboMode(sessionID) {
|
|
47564
47576
|
if (sessionID) {
|
|
@@ -47646,7 +47658,7 @@ async function rehydratePrSubscriptions(sessionID, directory) {
|
|
|
47646
47658
|
}
|
|
47647
47659
|
return map;
|
|
47648
47660
|
}
|
|
47649
|
-
var
|
|
47661
|
+
var _internals66 = {
|
|
47650
47662
|
swarmState,
|
|
47651
47663
|
resetSwarmState,
|
|
47652
47664
|
ensureAgentSession,
|
|
@@ -47785,4 +47797,4 @@ function createCuratorLLMDelegate(directory, mode = "init", sessionId) {
|
|
|
47785
47797
|
};
|
|
47786
47798
|
}
|
|
47787
47799
|
|
|
47788
|
-
export { package_default, handleAcknowledgeSpecDriftCommand, handleAgentsCommand, handleAnalyzeCommand, handleArchiveCommand, DC_SAFE_TARGETS, dcNormalizeCommand, dcUnwrapWrappers, dcSplitSegments, dcValidateTargets, dcCheckJunctionCreation, dcExtractWindowsCmdTargets, dcExtractPowerShellTargets, normalizeSwarmCommandInput, canonicalCommandKey, formatCommandNotFound, executeSwarmCommand, SWARM_COMMAND_TOOL_COMMANDS, SWARM_COMMAND_TOOL_ALLOWLIST, HUMAN_ONLY_SWARM_COMMANDS, classifySwarmCommandToolUse, classifySwarmCommandChatFallbackUse, detectPosixWrites, detectWindowsWrites, resolveWriteTargets, handleAutoProceedCommand, handleBenchmarkCommand, handleBrainstormCommand, handleCheckpointCommand, handleCiSimulateCommand, handleClarifyCommand, createCuratorLLMDelegate, _internals14 as _internals, normalizeRecommendationEntryIdToken, parseKnowledgeRecommendations, parseKnowledgeRecommendationsWithDiagnostics, parseStructuredCuratorBlocks, readCuratorSummary, writeCuratorSummary, appendCuratorRecommendation, mergeCuratorPhaseSummary, filterPhaseEvents, checkPhaseCompliance, runCuratorInit, runCuratorPhase, applyCuratorKnowledgeUpdates, isHiveEligible, countDistinctProjects, checkHivePromotions, _internals17 as _internals1, createHivePromoterHook, promoteToHive, promoteFromSwarm, handleCloseCommand, handleCodebaseReviewCommand, handleConcurrencyCommand, handleConfigCommand, handleConsolidateCommand, handleCostsCommand, handleCouncilCommand, handleCurateCommand, handleDarkMatterCommand, handleDeepDiveCommand, handleDeepResearchCommand, getPluginConfigDir, getPluginCachePaths, getPluginLockFilePaths, handleDiagnoseCommand, handleDoctorCommand, handleEvidenceCommand, handleEvidenceSummaryCommand, handleExportCommand, handleFullAutoCommand, handleGateAuditCommand, handleGateStatsCommand, handleHandoffCommand, handleHistoryCommand, handleKnowledgeQuarantineCommand, handleKnowledgeRestoreCommand, handleKnowledgeMigrateCommand, handleKnowledgeListCommand, handleKnowledgeUnactionableCommand, handleKnowledgeRetryHardeningCommand, handleLearningCommand, handleLinkCommand, handleMemoryCommand, handleMemoryStatusCommand, handleMemoryValueLogCommand, handleMemoryMigrateCommand, handleMemoryImportCommand, handleMemoryExportCommand, handlePlanCommand, handlePreflightCommand, handlePromoteCommand, handleQaGatesCommand, handleResetCommand, handleResetSessionCommand, handleRetrieveCommand, handleRollbackCommand, handleSddStatusCommand, handleSddValidateCommand, handleSddProjectCommand, handleSddCommand, handleSimulateCommand, handleSpecifyCommand, handleStatusCommand, handleSyncPlanCommand, handleTurboCommand, handleUnlinkCommand, handleWriteRetroCommand, handleHelpCommand, COMMAND_REGISTRY, VALID_COMMANDS,
|
|
47800
|
+
export { package_default, handleAcknowledgeSpecDriftCommand, handleAgentsCommand, handleAnalyzeCommand, handleArchiveCommand, DC_SAFE_TARGETS, dcNormalizeCommand, dcUnwrapWrappers, dcSplitSegments, dcValidateTargets, dcCheckJunctionCreation, dcExtractWindowsCmdTargets, dcExtractPowerShellTargets, normalizeSwarmCommandInput, canonicalCommandKey, formatCommandNotFound, executeSwarmCommand, SWARM_COMMAND_TOOL_COMMANDS, SWARM_COMMAND_TOOL_ALLOWLIST, HUMAN_ONLY_SWARM_COMMANDS, classifySwarmCommandToolUse, classifySwarmCommandChatFallbackUse, detectPosixWrites, detectWindowsWrites, resolveWriteTargets, handleAutoProceedCommand, handleBenchmarkCommand, handleBrainstormCommand, handleCheckpointCommand, handleCiSimulateCommand, handleClarifyCommand, createCuratorLLMDelegate, _internals14 as _internals, normalizeRecommendationEntryIdToken, parseKnowledgeRecommendations, parseKnowledgeRecommendationsWithDiagnostics, parseStructuredCuratorBlocks, readCuratorSummary, writeCuratorSummary, appendCuratorRecommendation, mergeCuratorPhaseSummary, filterPhaseEvents, checkPhaseCompliance, runCuratorInit, runCuratorPhase, applyCuratorKnowledgeUpdates, isHiveEligible, countDistinctProjects, checkHivePromotions, _internals17 as _internals1, createHivePromoterHook, promoteToHive, promoteFromSwarm, handleCloseCommand, handleCodebaseReviewCommand, handleConcurrencyCommand, handleConfigCommand, handleConsolidateCommand, handleCostsCommand, handleCouncilCommand, handleCurateCommand, handleDarkMatterCommand, handleDeepDiveCommand, handleDeepResearchCommand, getPluginConfigDir, getPluginCachePaths, getPluginLockFilePaths, handleDiagnoseCommand, handleDoctorCommand, handleEvidenceCommand, handleEvidenceSummaryCommand, handleExportCommand, handleFullAutoCommand, handleGateAuditCommand, handleGateStatsCommand, handleHandoffCommand, handleHistoryCommand, handleKnowledgeQuarantineCommand, handleKnowledgeRestoreCommand, handleKnowledgeMigrateCommand, handleKnowledgeListCommand, handleKnowledgeUnactionableCommand, handleKnowledgeRetryHardeningCommand, handleLearningCommand, handleLinkCommand, handleMemoryCommand, handleMemoryStatusCommand, handleMemoryValueLogCommand, handleMemoryMigrateCommand, handleMemoryImportCommand, handleMemoryExportCommand, handlePlanCommand, handlePreflightCommand, handlePromoteCommand, handleQaGatesCommand, handleResetCommand, handleResetSessionCommand, handleRetrieveCommand, handleRollbackCommand, handleSddStatusCommand, handleSddValidateCommand, handleSddProjectCommand, handleSddCommand, handleSimulateCommand, handleSpecifyCommand, handleStatusCommand, handleSyncPlanCommand, handleTurboCommand, handleUnlinkCommand, handleWriteRetroCommand, handleHelpCommand, COMMAND_REGISTRY, VALID_COMMANDS, _internals63 as _internals2, resolveCommand };
|