opencode-swarm 7.186.8 → 7.187.0
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/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/agents/architect.d.ts +1 -1
- package/dist/cli/{auto-checkpoint-hw4rttv4.js → auto-checkpoint-r69e82bh.js} +10 -11
- package/dist/cli/{checkpoint-fdkh943k.js → checkpoint-1sqwbgra.js} +18 -19
- package/dist/cli/{coder-settlement-91r5s8ar.js → coder-settlement-b9qx0732.js} +14 -15
- package/dist/cli/{config-doctor-nzds5xzf.js → config-doctor-s4fr5qwr.js} +34 -4
- package/dist/cli/{core-w0gq7vwa.js → core-bezezjy9.js} +5 -6
- package/dist/cli/{curation-policy-kw6x1cba.js → curation-policy-2x2w3b57.js} +7 -8
- package/dist/cli/{curator-drift-svnc70x4.js → curator-drift-785xnxdv.js} +10 -11
- package/dist/cli/curator-llm-factory-p0wwyswg.js +80 -0
- package/dist/cli/{curator-gkrn8wz3.js → curator-w4hp7a10.js} +44 -45
- package/dist/cli/{dispatch-0ejzwb45.js → dispatch-qvcztbpf.js} +222 -48
- package/dist/cli/{evidence-summary-service-a2tx8tbn.js → evidence-summary-service-33qcm9xc.js} +21 -22
- package/dist/cli/{gate-evidence-28bys0r0.js → gate-evidence-9ehj968e.js} +9 -10
- package/dist/cli/guardrail-explain-5715fdzv.js +81 -0
- package/dist/cli/guardrail-log-k1dfzfzm.js +22 -0
- package/dist/cli/{guardrail-reset-w5kpwfxb.js → guardrail-reset-nt88n9dm.js} +44 -45
- package/dist/cli/hive-promoter-c8fjn186.js +95 -0
- package/dist/cli/{index-mr86ywsj.js → index-0yj79yk1.js} +1 -1
- package/dist/cli/{index-mtb763x4.js → index-1vvr69ka.js} +1 -1
- package/dist/cli/{index-b9zqye89.js → index-2s8wdagg.js} +44 -45
- package/dist/cli/{index-e47fhj4k.js → index-2wgvjwpr.js} +5 -5
- package/dist/cli/{index-cvwkjnr5.js → index-469xmpd6.js} +1 -1
- package/dist/cli/{index-0ghn241n.js → index-4g6sw4eq.js} +1 -1
- package/dist/cli/{index-2nbws8bd.js → index-5m56c5r6.js} +5 -5
- package/dist/cli/{index-e6tjg7t9.js → index-6ersmqjd.js} +9 -9
- package/dist/cli/{index-0k283qtq.js → index-9hag235h.js} +2 -2
- package/dist/cli/{index-sjwpvte3.js → index-a8gvszr2.js} +2 -2
- package/dist/cli/{index-qc1x5vvb.js → index-akt0arnt.js} +2695 -2589
- package/dist/cli/{index-kg4yp11g.js → index-b2je0z0t.js} +4 -4
- package/dist/cli/{index-ha4r51k4.js → index-bbqxt1p5.js} +28 -11
- package/dist/cli/{index-znc71e1c.js → index-bejxkee0.js} +2 -2
- package/dist/cli/{index-06pcq86m.js → index-c8ffgcvz.js} +3 -3
- package/dist/cli/{index-n1szkmbz.js → index-cc1vzq4m.js} +1 -1
- package/dist/cli/{index-c12cz80m.js → index-cppqxjw9.js} +2 -2
- package/dist/cli/{index-d21545hp.js → index-cx4s7cak.js} +46 -47
- package/dist/cli/{index-xgsy3hzf.js → index-d6kvatwp.js} +12 -12
- package/dist/cli/{index-k55ep5se.js → index-df2p0k0s.js} +2 -2
- package/dist/cli/{index-x5mkva6s.js → index-dypmvvga.js} +1 -1
- package/dist/cli/{index-7ae4sgp4.js → index-ectvhv8e.js} +5 -5
- package/dist/cli/{index-whk4027k.js → index-en7vzpeq.js} +4 -4
- package/dist/cli/{index-4y6pndcf.js → index-evy5yrsw.js} +4 -4
- package/dist/cli/{index-mc72pk74.js → index-fzpt2djt.js} +32 -1
- package/dist/cli/{index-5dgg9vhz.js → index-hvr82s1t.js} +565 -76
- package/dist/cli/{index-xdjwefa5.js → index-jtncfvhe.js} +1 -1
- package/dist/cli/{index-c5x4yzt6.js → index-knbjtqwt.js} +5 -5
- package/dist/cli/{index-pntrhnj8.js → index-krqq8kbq.js} +7 -7
- package/dist/cli/{index-extgtmxm.js → index-m1qy7f1e.js} +1 -1
- package/dist/cli/{index-84wt7q5y.js → index-mf19yqss.js} +3 -3
- package/dist/cli/{index-7pstt3w2.js → index-pfpnzf6w.js} +1 -1
- package/dist/cli/{index-144jx1jn.js → index-pts38j6x.js} +5 -5
- package/dist/cli/{index-dbwpcjhw.js → index-pymr99as.js} +8 -8
- package/dist/cli/{index-616pp1nq.js → index-qzgfheb4.js} +3 -3
- package/dist/cli/{index-e4hy4des.js → index-r6e8syr3.js} +1 -1
- package/dist/cli/{index-t6na8zpb.js → index-r7gt2w1b.js} +4 -4
- package/dist/cli/{index-gsqmefdg.js → index-rm676s0p.js} +2 -2
- package/dist/cli/{index-n5ekzhad.js → index-sztx0vyt.js} +5 -5
- package/dist/cli/{index-227te5a7.js → index-t3hcd6zz.js} +2 -2
- package/dist/cli/{index-prksynjw.js → index-ta48pe8j.js} +3 -3
- package/dist/cli/{index-q8dj8b88.js → index-v08ksq0b.js} +2 -2
- package/dist/cli/{index-7bxssqaf.js → index-vx8a8w3b.js} +142 -2
- package/dist/cli/{index-zcpd36zm.js → index-ww8payq9.js} +2 -2
- package/dist/cli/{index-tw513bvn.js → index-xs96nry2.js} +8 -8
- package/dist/cli/{index-0qpa53jg.js → index-ycz8z2db.js} +8 -8
- package/dist/cli/{index-gapyat7s.js → index-yf0cc6c5.js} +2 -2
- package/dist/cli/{index-03z05sbb.js → index-yw1g78v9.js} +2 -2
- package/dist/cli/{index-agm6hegf.js → index-zzxnssy3.js} +4 -4
- package/dist/cli/index.js +45 -46
- package/dist/cli/{knowledge-escalator-0dj3bvh2.js → knowledge-escalator-qttydcx2.js} +15 -16
- package/dist/cli/{knowledge-events-zwhb8jnb.js → knowledge-events-4vf0vj82.js} +13 -14
- package/dist/cli/{knowledge-link-pmbyqe3b.js → knowledge-link-p2c8agc8.js} +6 -7
- package/dist/cli/{knowledge-store-67n0qbhg.js → knowledge-store-bw1dk2eb.js} +7 -8
- package/dist/cli/{knowledge-validator-b58w129y.js → knowledge-validator-gefcc36h.js} +9 -10
- package/dist/cli/{mcp-ayc74bm2.js → mcp-d5p0k3p1.js} +1 -1
- package/dist/cli/{model-preflight-nvjb3bv5.js → model-preflight-fmx49pwy.js} +44 -45
- package/dist/cli/{pending-delegations-yvh7b951.js → pending-delegations-8333cb3y.js} +13 -14
- package/dist/cli/{pr-subscriptions-pkj5mmra.js → pr-subscriptions-p42ny2sn.js} +13 -14
- package/dist/cli/{pr-workflow-gate-zg6tg3c0.js → pr-workflow-gate-csy32z8w.js} +44 -45
- package/dist/cli/{runner-jev9vea3.js → runner-cbpr45cs.js} +7 -8
- package/dist/cli/{scan-cursor-8nkt0n1b.js → scan-cursor-14mwymtz.js} +8 -9
- package/dist/cli/{schema-ahy4ps8z.js → schema-6426g0gw.js} +2 -2
- package/dist/cli/{scope-persistence-h8b2hcy9.js → scope-persistence-avkv3s4m.js} +17 -18
- package/dist/cli/{server-14wr2fz2.js → server-d9rk2zeb.js} +45 -47
- package/dist/cli/{skill-generator-2pk8fvfz.js → skill-generator-epdvdsh5.js} +17 -18
- package/dist/cli/{snapshot-coordination-init-keeqdwph.js → snapshot-coordination-init-35f7wrqb.js} +44 -45
- package/dist/cli/{speckit-checkoff-yf09ctgv.js → speckit-checkoff-erwa7fbj.js} +5 -5
- package/dist/cli/{telemetry-rb8hrvbx.js → telemetry-2vwb3n42.js} +2 -3
- package/dist/cli/{workspace-snapshot-28p0ekng.js → workspace-snapshot-y60ay5eq.js} +4 -5
- package/dist/cli/{worktree-collision-ownership-7ctmpqx6.js → worktree-collision-ownership-3tqkw81h.js} +14 -15
- package/dist/cli/{worktree-isolation-2c1hvct4.js → worktree-isolation-0rrjqypt.js} +44 -45
- package/dist/commands/registry.d.ts +4 -4
- package/dist/commands/reset-backup.d.ts +20 -5
- package/dist/commands/rollback-gate.d.ts +73 -0
- package/dist/index.js +612 -597
- package/dist/lang/backends/java.d.ts +76 -0
- package/dist/lang/java-extraction.d.ts +88 -0
- package/dist/services/config-doctor.d.ts +19 -1
- package/dist/services/preflight-integration.d.ts +8 -1
- package/dist/state.d.ts +13 -0
- package/dist/tools/symbols.d.ts +18 -0
- package/opencode-swarm.schema.json +1 -1
- package/package.json +1 -1
- package/dist/cli/curator-llm-factory-j51cttb2.js +0 -81
- package/dist/cli/guardrail-explain-qjyz300y.js +0 -82
- package/dist/cli/guardrail-log-rw25bt8g.js +0 -23
- package/dist/cli/hive-promoter-qzz0veev.js +0 -96
- package/dist/cli/index-c1ggtmpm.js +0 -33
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Java backend.
|
|
3
|
+
*
|
|
4
|
+
* First-class Java `LanguageBackend` (DS-2). Overrides four hooks on top of
|
|
5
|
+
* the registry-driven default:
|
|
6
|
+
* - `extractImports` reuses the shared `parseJavaImports` from
|
|
7
|
+
* `../java-extraction` (Approach A) rather than reimplementing a parser,
|
|
8
|
+
* mapping each parsed import to its `.specifier` string.
|
|
9
|
+
* - `selectTestFramework` prefers the Gradle wrapper `./gradlew` when
|
|
10
|
+
* present, then the Maven wrapper `./mvnw`, falling back to
|
|
11
|
+
* `defaultSelectTestFramework`. The wrapper checks are repo-local, so
|
|
12
|
+
* they do not depend on `gradle`/`mvn` being resolvable on PATH.
|
|
13
|
+
* - `selectEntryPoints` scans the tree for `.java` files declaring
|
|
14
|
+
* `public static void main`.
|
|
15
|
+
* - `selectFramework` detects Spring vs Servlet from pom.xml / build.gradle.
|
|
16
|
+
*
|
|
17
|
+
* Invariants identical to other backends — see `python.ts` and `go.ts` for
|
|
18
|
+
* the rationale; `tests/unit/lang/backend-purity.test.ts` enforces them.
|
|
19
|
+
*/
|
|
20
|
+
import type { FrameworkSelection, LanguageBackend } from '../backend';
|
|
21
|
+
/**
|
|
22
|
+
* Total directory-entry budget for the scan: every directory and file the
|
|
23
|
+
* walk visits counts against this, not just `.java` files. A tree with many
|
|
24
|
+
* subdirectories or non-Java files (an IDE output directory, a `.venv`
|
|
25
|
+
* alongside the Java sources, etc.) costs real synchronous time even when it
|
|
26
|
+
* contains zero `.java` files, so the cap must bound breadth, not just the
|
|
27
|
+
* number of Java files found.
|
|
28
|
+
*/
|
|
29
|
+
declare const MAX_ENTRY_POINT_ENTRIES = 5000;
|
|
30
|
+
/**
|
|
31
|
+
* True when a Java source declares a `public static void main` entry point.
|
|
32
|
+
* Pure predicate so tests can exercise it without touching the filesystem.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isMainClass(source: string): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Detect a dominant Java web framework from pom.xml / build.gradle content.
|
|
37
|
+
* Pure helper so tests can exercise the detector without a filesystem.
|
|
38
|
+
*/
|
|
39
|
+
export declare function detectFramework(content: string): FrameworkSelection | null;
|
|
40
|
+
/**
|
|
41
|
+
* Delegate import extraction to the shared Java module, mapping each parsed
|
|
42
|
+
* import to its `.specifier` string. Dedupes via a Set while preserving order.
|
|
43
|
+
*/
|
|
44
|
+
declare function extractImports(_sourceFile: string, source: string): string[];
|
|
45
|
+
/**
|
|
46
|
+
* True when a wrapper file named `name` exists in `dir`. Uses `existsSync`
|
|
47
|
+
* rather than a try/catch `accessSync` probe so callers avoid exception-based
|
|
48
|
+
* control flow.
|
|
49
|
+
*/
|
|
50
|
+
declare function wrapperExists(dir: string, name: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Resolve the Maven wrapper command name: Windows prefers `mvnw.cmd` when it
|
|
53
|
+
* exists, otherwise the POSIX `./mvnw` script.
|
|
54
|
+
*/
|
|
55
|
+
declare function resolveMvnwCommand(dir: string): string;
|
|
56
|
+
/**
|
|
57
|
+
* Resolve the Gradle wrapper command name: Windows prefers `gradlew.bat` when
|
|
58
|
+
* it exists, otherwise the POSIX `./gradlew` script. Mirrors
|
|
59
|
+
* `resolveMvnwCommand` so the Gradle wrapper is Windows-aware symmetric to the
|
|
60
|
+
* Maven wrapper.
|
|
61
|
+
*/
|
|
62
|
+
declare function resolveGradlewCommand(dir: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* Build the Java backend from the registered profile.
|
|
65
|
+
*/
|
|
66
|
+
export declare function buildJavaBackend(): LanguageBackend;
|
|
67
|
+
export declare const _internals: {
|
|
68
|
+
extractImports: typeof extractImports;
|
|
69
|
+
isMainClass: typeof isMainClass;
|
|
70
|
+
detectFramework: typeof detectFramework;
|
|
71
|
+
wrapperExists: typeof wrapperExists;
|
|
72
|
+
resolveMvnwCommand: typeof resolveMvnwCommand;
|
|
73
|
+
resolveGradlewCommand: typeof resolveGradlewCommand;
|
|
74
|
+
MAX_ENTRY_POINT_ENTRIES: typeof MAX_ENTRY_POINT_ENTRIES;
|
|
75
|
+
};
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Java extraction module.
|
|
3
|
+
*
|
|
4
|
+
* Owns both Java import parsing and the tree-sitter Java symbol grammar:
|
|
5
|
+
* - `parseJavaImports` reconciles the two previously-duplicated import
|
|
6
|
+
* implementations:
|
|
7
|
+
* - `parseJavaFileImports` in `src/tools/repo-graph/builder.ts` (whole-file,
|
|
8
|
+
* line-anchored regex with comment/string masking)
|
|
9
|
+
* - `parseJavaImport` in `src/lang/symbol-graph.ts` (single-line regex)
|
|
10
|
+
* - `JAVA_SYMBOL_GRAMMAR` is the tree-sitter Java symbol grammar (defs/imports/
|
|
11
|
+
* refs query sets) previously defined in `src/lang/symbol-graph.ts`, absorbed
|
|
12
|
+
* here so the shared module owns the Java symbol grammar.
|
|
13
|
+
*
|
|
14
|
+
* Import binding semantics deliberately match both predecessors so consumers of
|
|
15
|
+
* either shape observe identical results:
|
|
16
|
+
* - `import a.b.C;` -> specifier `a.b.C`, named, binding `C`
|
|
17
|
+
* - `import static a.b.C.m;` -> specifier `a.b.C`, named, binding `m`
|
|
18
|
+
* - `import a.b.*;` -> specifier `a.b.*`, namespace, no named binding
|
|
19
|
+
* - `import static a.b.*;` -> specifier `a.b.*`, namespace, no named binding
|
|
20
|
+
*
|
|
21
|
+
* The module does not perform symbol extraction itself; it only provides the
|
|
22
|
+
* import parser and the symbol grammar that consumers (refactored separately)
|
|
23
|
+
* use to extract symbols.
|
|
24
|
+
*/
|
|
25
|
+
/** A single bound name produced by a named import. */
|
|
26
|
+
export interface JavaImportBinding {
|
|
27
|
+
/** The declaration name as it appears in the imported module. */
|
|
28
|
+
imported: string;
|
|
29
|
+
/** The name bound in the importing file (identical to `imported` for Java). */
|
|
30
|
+
local: string;
|
|
31
|
+
}
|
|
32
|
+
/** A single parsed Java import statement. */
|
|
33
|
+
export interface JavaImport {
|
|
34
|
+
/** The module specifier (enclosing type for a static member import). */
|
|
35
|
+
specifier: string;
|
|
36
|
+
/** `named` binds a single declaration; `namespace` is an on-demand `.*` import. */
|
|
37
|
+
importType: 'named' | 'namespace';
|
|
38
|
+
/** Bound names; empty for namespace imports. */
|
|
39
|
+
bindings: JavaImportBinding[];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Parse every Java `import` statement in a source file.
|
|
43
|
+
*
|
|
44
|
+
* Handles single, multiple, static, wildcard, and package-private imports
|
|
45
|
+
* (imports appearing in a file regardless of surrounding package/access
|
|
46
|
+
* context). Single-line string/char literals, comments, and Java text-block
|
|
47
|
+
* contents are masked before matching so a line-initial `import ...;` inside a
|
|
48
|
+
* string literal, comment, or text block is never fabricated as a real import.
|
|
49
|
+
*
|
|
50
|
+
* @param rawContent - Full Java source text.
|
|
51
|
+
* @returns The parsed import statements in source order.
|
|
52
|
+
*/
|
|
53
|
+
export declare function parseJavaImports(rawContent: string): JavaImport[];
|
|
54
|
+
/**
|
|
55
|
+
* Masks comments (line, block), string/char literals, and Java text blocks in
|
|
56
|
+
* a single left-to-right pass, so entering a comment always takes priority
|
|
57
|
+
* over quote characters found inside it. This fixes a bug where a quote
|
|
58
|
+
* character inside a comment (e.g. an apostrophe in `/* Foo's Inc. *\/`) was
|
|
59
|
+
* previously treated as starting a string/char literal by a separate masking
|
|
60
|
+
* pass that ran before comment-stripping, causing the literal-masking logic
|
|
61
|
+
* to consume the comment's own closing `*\/` and corrupt subsequent
|
|
62
|
+
* comment-stripping across the rest of the file.
|
|
63
|
+
*/
|
|
64
|
+
export declare function maskCommentsAndLiterals(content: string): string;
|
|
65
|
+
/**
|
|
66
|
+
* The tree-sitter query sets for a single grammar id — one defs/imports/refs
|
|
67
|
+
* triple. Patterns must be verified against the shipped grammar WASMs
|
|
68
|
+
* (s-expression dumps) before being added: node types and field names differ
|
|
69
|
+
* from what source syntax suggests.
|
|
70
|
+
*/
|
|
71
|
+
export interface SymbolGrammar {
|
|
72
|
+
/** Query patterns matching symbol definitions (functions, classes, ...). */
|
|
73
|
+
defs: string;
|
|
74
|
+
/** Query patterns matching import/require statements. */
|
|
75
|
+
imports: string;
|
|
76
|
+
/** Query patterns matching symbol references. */
|
|
77
|
+
refs: string;
|
|
78
|
+
/** Query patterns matching export statements. */
|
|
79
|
+
exports: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The tree-sitter Java symbol grammar.
|
|
83
|
+
*
|
|
84
|
+
* Absorbed from `src/lang/symbol-graph.ts` so the shared Java extraction module
|
|
85
|
+
* owns the Java symbol grammar alongside import parsing. Consumers extract
|
|
86
|
+
* symbols by running these query sets against a parsed Java tree.
|
|
87
|
+
*/
|
|
88
|
+
export declare const JAVA_SYMBOL_GRAMMAR: SymbolGrammar;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* classifies findings by severity, and proposes safe auto-fixes.
|
|
6
6
|
*/
|
|
7
7
|
import type { PluginConfig } from '../config/schema';
|
|
8
|
+
import { loadPlanJsonOnly } from '../plan/manager';
|
|
8
9
|
/**
|
|
9
10
|
* Current config format version (issue #2504). Version 3 introduces the
|
|
10
11
|
* governed v8 defaults-flip rows below; a config stamped at this version has
|
|
@@ -57,6 +58,23 @@ export declare const LEAN_TURBO_GATE_PRODUCERS: readonly [{
|
|
|
57
58
|
* gate becomes structurally unsatisfiable and this lint fails with an error.
|
|
58
59
|
*/
|
|
59
60
|
export declare function collectLeanTurboGateSatisfiabilityFindings(config: PluginConfig, registeredToolNames?: ReadonlySet<string>): ConfigFinding[];
|
|
61
|
+
/**
|
|
62
|
+
* Test-only dependency-injection seam per invariant 7 (mock.module leaks
|
|
63
|
+
* across files in Bun's shared test runner; `loadPlanJsonOnly` is a frequent
|
|
64
|
+
* mock target in sibling suites).
|
|
65
|
+
*/
|
|
66
|
+
export declare const _internals: {
|
|
67
|
+
loadPlanJsonOnly: typeof loadPlanJsonOnly;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Resolve the plan execution profile's parallelization flag for the
|
|
71
|
+
* worktree-isolation advisory (issue #2901): `true`/`false` when an active
|
|
72
|
+
* plan with an execution profile exists, `null` when no plan is available.
|
|
73
|
+
* The plan execution profile — not the dark `parallelization` config block —
|
|
74
|
+
* is the setting that actually drives parallel dispatch
|
|
75
|
+
* (src/hooks/delegation-gate.ts reads it via the same loader).
|
|
76
|
+
*/
|
|
77
|
+
export declare function resolvePlanParallelizationFlag(directory: string): Promise<boolean | null>;
|
|
60
78
|
/** Severity levels for config findings */
|
|
61
79
|
export type FindingSeverity = 'info' | 'warn' | 'error';
|
|
62
80
|
/** A single config finding */
|
|
@@ -165,7 +183,7 @@ export declare function restoreFromBackup(backupPath: string, directory: string)
|
|
|
165
183
|
/**
|
|
166
184
|
* Run the config doctor on a loaded config
|
|
167
185
|
*/
|
|
168
|
-
export declare function runConfigDoctor(config: PluginConfig, directory: string): ConfigDoctorResult;
|
|
186
|
+
export declare function runConfigDoctor(config: PluginConfig, directory: string, planParallelizationEnabled?: boolean | null): ConfigDoctorResult;
|
|
169
187
|
/**
|
|
170
188
|
* Apply safe auto-fixes to config
|
|
171
189
|
* Only applies low-risk, non-destructive fixes
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { PreflightTriggerManager } from '../background/trigger';
|
|
10
10
|
import type { AutomationConfig } from '../config/schema';
|
|
11
|
-
import { type PreflightConfig, type PreflightReport } from '../services/preflight-service';
|
|
11
|
+
import { type PreflightConfig, type PreflightReport, runPreflight } from '../services/preflight-service';
|
|
12
12
|
/** Integration configuration */
|
|
13
13
|
export interface PreflightIntegrationConfig {
|
|
14
14
|
/** Automation configuration (required for capability gating) */
|
|
@@ -36,3 +36,10 @@ export declare function createPreflightIntegration(config: PreflightIntegrationC
|
|
|
36
36
|
* Run preflight manually (for testing or CLI)
|
|
37
37
|
*/
|
|
38
38
|
export declare function runManualPreflight(directory: string, phase: number, config?: PreflightConfig): Promise<PreflightReport>;
|
|
39
|
+
/**
|
|
40
|
+
* DI seam for testability. Contains all test-mocked exports.
|
|
41
|
+
* Internal calls should use _internals.fn() instead of fn() directly.
|
|
42
|
+
*/
|
|
43
|
+
export declare const _internals: {
|
|
44
|
+
runPreflight: typeof runPreflight;
|
|
45
|
+
};
|
package/dist/state.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* and delegation chains.
|
|
8
8
|
*/
|
|
9
9
|
import type { OpencodeClient } from '@opencode-ai/sdk';
|
|
10
|
+
import { loadPluginConfigWithMeta } from './config/loader';
|
|
10
11
|
import { type Plan } from './config/plan-schema';
|
|
11
12
|
import type { CouncilAgent } from './council/types';
|
|
12
13
|
import { type QaGates } from './db/qa-gate-profile.js';
|
|
@@ -1116,6 +1117,16 @@ export declare function maybeSweepStaleSessions(staleDurationMs?: number, now?:
|
|
|
1116
1117
|
* @param staleDurationMs - Age threshold for stale session eviction (default: 120 min)
|
|
1117
1118
|
* @param directory - Optional project directory for rehydrating workflow state from disk
|
|
1118
1119
|
*/
|
|
1120
|
+
/**
|
|
1121
|
+
* Config-seeded initial value for `AgentSessionState.turboMode` (issue #2901):
|
|
1122
|
+
* `turbo_mode: true` in the project config starts new sessions with turbo
|
|
1123
|
+
* mode on. Resolved once per NEW session (ensureAgentSession early-returns
|
|
1124
|
+
* for live ones), scoped to the session's own directory; directory-less
|
|
1125
|
+
* constructions (e.g. the recovery session) and any config-read failure
|
|
1126
|
+
* default to false. `/swarm turbo` remains the per-session authority after
|
|
1127
|
+
* construction.
|
|
1128
|
+
*/
|
|
1129
|
+
export declare function resolveInitialTurboMode(directory?: string): boolean;
|
|
1119
1130
|
export declare function startAgentSession(sessionId: string, agentName: string, staleDurationMs?: number, directory?: string): void;
|
|
1120
1131
|
/**
|
|
1121
1132
|
* End an agent session by removing it from the state.
|
|
@@ -1638,6 +1649,8 @@ export declare const _internals: {
|
|
|
1638
1649
|
resetSwarmState: typeof resetSwarmState;
|
|
1639
1650
|
ensureAgentSession: typeof ensureAgentSession;
|
|
1640
1651
|
startAgentSession: typeof startAgentSession;
|
|
1652
|
+
loadPluginConfigWithMeta: typeof loadPluginConfigWithMeta;
|
|
1653
|
+
resolveInitialTurboMode: typeof resolveInitialTurboMode;
|
|
1641
1654
|
getAgentSession: typeof getAgentSession;
|
|
1642
1655
|
beginInvocation: typeof beginInvocation;
|
|
1643
1656
|
getActiveWindow: typeof getActiveWindow;
|
package/dist/tools/symbols.d.ts
CHANGED
|
@@ -44,6 +44,23 @@ export declare function extractRubySymbols(filePath: string, cwd: string): Symbo
|
|
|
44
44
|
* only — see docs/php-laravel.md.
|
|
45
45
|
*/
|
|
46
46
|
export declare function extractPhpSymbols(filePath: string, cwd: string): SymbolInfo[];
|
|
47
|
+
/**
|
|
48
|
+
* Java symbols: class/interface/enum/record/annotation-type declarations
|
|
49
|
+
* plus methods and constructors. Best-effort regex line parsing; `exported`
|
|
50
|
+
* reflects Java `public` visibility, except that interface (including
|
|
51
|
+
* `@interface`) members are implicitly public unless explicitly `private`
|
|
52
|
+
* (Java 9+ private interface methods). Records map to the `class` kind (no
|
|
53
|
+
* `record` kind in SymbolInfo). Java keywords are excluded from method names
|
|
54
|
+
* to avoid false positives from control-flow lines (e.g. `if (x)`).
|
|
55
|
+
*
|
|
56
|
+
* A method/constructor is only recognized when it sits at the brace depth of
|
|
57
|
+
* an enclosing type's own body — tracked via a type stack keyed by brace
|
|
58
|
+
* depth, not by any name seen anywhere in the file. This is what prevents a
|
|
59
|
+
* same-named call statement inside a method body (e.g. `Foo(1);` inside
|
|
60
|
+
* `bar()`) from being misidentified as a constructor: that call sits one
|
|
61
|
+
* level deeper than the enclosing type's member depth.
|
|
62
|
+
*/
|
|
63
|
+
export declare function extractJavaSymbols(filePath: string, cwd: string): SymbolInfo[];
|
|
47
64
|
export declare const symbols: ToolDefinition;
|
|
48
65
|
/**
|
|
49
66
|
* DI seam for testability — tests substitute via `_internals.fn` rather than
|
|
@@ -54,5 +71,6 @@ export declare const _internals: {
|
|
|
54
71
|
extractDartSymbols: typeof extractDartSymbols;
|
|
55
72
|
extractRubySymbols: typeof extractRubySymbols;
|
|
56
73
|
extractPhpSymbols: typeof extractPhpSymbols;
|
|
74
|
+
extractJavaSymbols: typeof extractJavaSymbols;
|
|
57
75
|
};
|
|
58
76
|
export {};
|
|
@@ -4840,7 +4840,7 @@
|
|
|
4840
4840
|
]
|
|
4841
4841
|
},
|
|
4842
4842
|
"turbo_mode": {
|
|
4843
|
-
"description": "Bypass reviewer/test gates for rapid iteration (v6.40).",
|
|
4843
|
+
"description": "Bypass reviewer/test gates for rapid iteration (v6.40). When true, new sessions start with turbo mode on (session default); /swarm turbo still toggles per session. Directory-less constructions default off.",
|
|
4844
4844
|
"default": false,
|
|
4845
4845
|
"type": "boolean"
|
|
4846
4846
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.187.0",
|
|
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,81 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
createCuratorLLMDelegate
|
|
4
|
-
} from "./index-qc1x5vvb.js";
|
|
5
|
-
import"./index-kg4yp11g.js";
|
|
6
|
-
import"./index-ha4r51k4.js";
|
|
7
|
-
import"./index-n5ekzhad.js";
|
|
8
|
-
import"./index-7bxssqaf.js";
|
|
9
|
-
import"./index-x5mkva6s.js";
|
|
10
|
-
import"./index-k55ep5se.js";
|
|
11
|
-
import"./index-txdagbh7.js";
|
|
12
|
-
import"./index-q8dj8b88.js";
|
|
13
|
-
import"./index-rdec0y3z.js";
|
|
14
|
-
import"./index-t6na8zpb.js";
|
|
15
|
-
import"./index-dbwpcjhw.js";
|
|
16
|
-
import"./index-e47fhj4k.js";
|
|
17
|
-
import"./index-c5x4yzt6.js";
|
|
18
|
-
import"./index-84wt7q5y.js";
|
|
19
|
-
import"./index-0qpa53jg.js";
|
|
20
|
-
import"./index-cjapb4hy.js";
|
|
21
|
-
import"./index-sjwpvte3.js";
|
|
22
|
-
import"./index-pt7h91zc.js";
|
|
23
|
-
import"./index-q7sjgr1y.js";
|
|
24
|
-
import"./index-5dgg9vhz.js";
|
|
25
|
-
import"./index-xgsy3hzf.js";
|
|
26
|
-
import"./index-6b295cas.js";
|
|
27
|
-
import"./index-9nyqt3kb.js";
|
|
28
|
-
import"./index-mtb763x4.js";
|
|
29
|
-
import"./index-zsrtt42s.js";
|
|
30
|
-
import"./index-c12cz80m.js";
|
|
31
|
-
import"./index-4y6pndcf.js";
|
|
32
|
-
import"./index-144jx1jn.js";
|
|
33
|
-
import"./index-g4fs6z4e.js";
|
|
34
|
-
import"./index-tw513bvn.js";
|
|
35
|
-
import"./index-e6tjg7t9.js";
|
|
36
|
-
import"./index-znc71e1c.js";
|
|
37
|
-
import"./index-2s7dvzff.js";
|
|
38
|
-
import"./index-agm6hegf.js";
|
|
39
|
-
import"./index-7pstt3w2.js";
|
|
40
|
-
import"./index-rtry5xyf.js";
|
|
41
|
-
import"./index-prksynjw.js";
|
|
42
|
-
import"./index-kbkk7vnh.js";
|
|
43
|
-
import"./index-0725jpp7.js";
|
|
44
|
-
import"./index-7ae4sgp4.js";
|
|
45
|
-
import"./index-2nbws8bd.js";
|
|
46
|
-
import"./index-zcpd36zm.js";
|
|
47
|
-
import"./index-extgtmxm.js";
|
|
48
|
-
import"./index-n1szkmbz.js";
|
|
49
|
-
import"./index-0k283qtq.js";
|
|
50
|
-
import"./index-ry16d01s.js";
|
|
51
|
-
import"./index-rdm3px0g.js";
|
|
52
|
-
import"./index-7pmbnjvj.js";
|
|
53
|
-
import"./index-06pcq86m.js";
|
|
54
|
-
import"./index-pntrhnj8.js";
|
|
55
|
-
import"./index-vzm6zre7.js";
|
|
56
|
-
import"./index-ae75rja9.js";
|
|
57
|
-
import"./index-gsqmefdg.js";
|
|
58
|
-
import"./index-227te5a7.js";
|
|
59
|
-
import"./index-mr86ywsj.js";
|
|
60
|
-
import"./index-t7hmqgjy.js";
|
|
61
|
-
import"./index-xdjwefa5.js";
|
|
62
|
-
import"./index-mc72pk74.js";
|
|
63
|
-
import"./index-c1ggtmpm.js";
|
|
64
|
-
import"./index-ejhxgyvm.js";
|
|
65
|
-
import"./index-7g4c7s5r.js";
|
|
66
|
-
import"./index-e4hy4des.js";
|
|
67
|
-
import"./index-gx2vp8gx.js";
|
|
68
|
-
import"./index-cvwkjnr5.js";
|
|
69
|
-
import"./index-zxdawwc7.js";
|
|
70
|
-
import"./index-616pp1nq.js";
|
|
71
|
-
import"./index-03z05sbb.js";
|
|
72
|
-
import"./index-bk5tah7q.js";
|
|
73
|
-
import"./index-gknz3bv1.js";
|
|
74
|
-
import"./index-zpsr8rpc.js";
|
|
75
|
-
import"./index-wvghb3x6.js";
|
|
76
|
-
import"./index-9rwhas09.js";
|
|
77
|
-
import"./index-zgwm4ryv.js";
|
|
78
|
-
import"./index-a76rekgs.js";
|
|
79
|
-
export {
|
|
80
|
-
createCuratorLLMDelegate
|
|
81
|
-
};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
handleGuardrailExplain
|
|
4
|
-
} from "./index-gapyat7s.js";
|
|
5
|
-
import"./index-qc1x5vvb.js";
|
|
6
|
-
import"./index-kg4yp11g.js";
|
|
7
|
-
import"./index-ha4r51k4.js";
|
|
8
|
-
import"./index-n5ekzhad.js";
|
|
9
|
-
import"./index-7bxssqaf.js";
|
|
10
|
-
import"./index-x5mkva6s.js";
|
|
11
|
-
import"./index-k55ep5se.js";
|
|
12
|
-
import"./index-txdagbh7.js";
|
|
13
|
-
import"./index-q8dj8b88.js";
|
|
14
|
-
import"./index-rdec0y3z.js";
|
|
15
|
-
import"./index-t6na8zpb.js";
|
|
16
|
-
import"./index-dbwpcjhw.js";
|
|
17
|
-
import"./index-e47fhj4k.js";
|
|
18
|
-
import"./index-c5x4yzt6.js";
|
|
19
|
-
import"./index-84wt7q5y.js";
|
|
20
|
-
import"./index-0qpa53jg.js";
|
|
21
|
-
import"./index-cjapb4hy.js";
|
|
22
|
-
import"./index-sjwpvte3.js";
|
|
23
|
-
import"./index-pt7h91zc.js";
|
|
24
|
-
import"./index-q7sjgr1y.js";
|
|
25
|
-
import"./index-5dgg9vhz.js";
|
|
26
|
-
import"./index-xgsy3hzf.js";
|
|
27
|
-
import"./index-6b295cas.js";
|
|
28
|
-
import"./index-9nyqt3kb.js";
|
|
29
|
-
import"./index-mtb763x4.js";
|
|
30
|
-
import"./index-zsrtt42s.js";
|
|
31
|
-
import"./index-c12cz80m.js";
|
|
32
|
-
import"./index-4y6pndcf.js";
|
|
33
|
-
import"./index-144jx1jn.js";
|
|
34
|
-
import"./index-g4fs6z4e.js";
|
|
35
|
-
import"./index-tw513bvn.js";
|
|
36
|
-
import"./index-e6tjg7t9.js";
|
|
37
|
-
import"./index-znc71e1c.js";
|
|
38
|
-
import"./index-2s7dvzff.js";
|
|
39
|
-
import"./index-agm6hegf.js";
|
|
40
|
-
import"./index-7pstt3w2.js";
|
|
41
|
-
import"./index-rtry5xyf.js";
|
|
42
|
-
import"./index-prksynjw.js";
|
|
43
|
-
import"./index-kbkk7vnh.js";
|
|
44
|
-
import"./index-0725jpp7.js";
|
|
45
|
-
import"./index-7ae4sgp4.js";
|
|
46
|
-
import"./index-2nbws8bd.js";
|
|
47
|
-
import"./index-zcpd36zm.js";
|
|
48
|
-
import"./index-extgtmxm.js";
|
|
49
|
-
import"./index-n1szkmbz.js";
|
|
50
|
-
import"./index-0k283qtq.js";
|
|
51
|
-
import"./index-ry16d01s.js";
|
|
52
|
-
import"./index-rdm3px0g.js";
|
|
53
|
-
import"./index-7pmbnjvj.js";
|
|
54
|
-
import"./index-06pcq86m.js";
|
|
55
|
-
import"./index-pntrhnj8.js";
|
|
56
|
-
import"./index-vzm6zre7.js";
|
|
57
|
-
import"./index-ae75rja9.js";
|
|
58
|
-
import"./index-gsqmefdg.js";
|
|
59
|
-
import"./index-227te5a7.js";
|
|
60
|
-
import"./index-mr86ywsj.js";
|
|
61
|
-
import"./index-t7hmqgjy.js";
|
|
62
|
-
import"./index-xdjwefa5.js";
|
|
63
|
-
import"./index-mc72pk74.js";
|
|
64
|
-
import"./index-c1ggtmpm.js";
|
|
65
|
-
import"./index-ejhxgyvm.js";
|
|
66
|
-
import"./index-7g4c7s5r.js";
|
|
67
|
-
import"./index-e4hy4des.js";
|
|
68
|
-
import"./index-gx2vp8gx.js";
|
|
69
|
-
import"./index-cvwkjnr5.js";
|
|
70
|
-
import"./index-zxdawwc7.js";
|
|
71
|
-
import"./index-616pp1nq.js";
|
|
72
|
-
import"./index-03z05sbb.js";
|
|
73
|
-
import"./index-bk5tah7q.js";
|
|
74
|
-
import"./index-gknz3bv1.js";
|
|
75
|
-
import"./index-zpsr8rpc.js";
|
|
76
|
-
import"./index-wvghb3x6.js";
|
|
77
|
-
import"./index-9rwhas09.js";
|
|
78
|
-
import"./index-zgwm4ryv.js";
|
|
79
|
-
import"./index-a76rekgs.js";
|
|
80
|
-
export {
|
|
81
|
-
handleGuardrailExplain
|
|
82
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
handleGuardrailLog
|
|
4
|
-
} from "./index-0ghn241n.js";
|
|
5
|
-
import"./index-kg4yp11g.js";
|
|
6
|
-
import"./index-2s7dvzff.js";
|
|
7
|
-
import"./index-zcpd36zm.js";
|
|
8
|
-
import"./index-06pcq86m.js";
|
|
9
|
-
import"./index-xdjwefa5.js";
|
|
10
|
-
import"./index-mc72pk74.js";
|
|
11
|
-
import"./index-c1ggtmpm.js";
|
|
12
|
-
import"./index-e4hy4des.js";
|
|
13
|
-
import"./index-616pp1nq.js";
|
|
14
|
-
import"./index-03z05sbb.js";
|
|
15
|
-
import"./index-bk5tah7q.js";
|
|
16
|
-
import"./index-gknz3bv1.js";
|
|
17
|
-
import"./index-zpsr8rpc.js";
|
|
18
|
-
import"./index-9rwhas09.js";
|
|
19
|
-
import"./index-zgwm4ryv.js";
|
|
20
|
-
import"./index-a76rekgs.js";
|
|
21
|
-
export {
|
|
22
|
-
handleGuardrailLog
|
|
23
|
-
};
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
_internals3 as _internals,
|
|
4
|
-
checkHivePromotions,
|
|
5
|
-
countDistinctProjects,
|
|
6
|
-
createHivePromoterHook,
|
|
7
|
-
isHiveEligible,
|
|
8
|
-
promoteFromSwarm,
|
|
9
|
-
promoteToHive
|
|
10
|
-
} from "./index-qc1x5vvb.js";
|
|
11
|
-
import"./index-kg4yp11g.js";
|
|
12
|
-
import"./index-ha4r51k4.js";
|
|
13
|
-
import"./index-n5ekzhad.js";
|
|
14
|
-
import"./index-7bxssqaf.js";
|
|
15
|
-
import"./index-x5mkva6s.js";
|
|
16
|
-
import"./index-k55ep5se.js";
|
|
17
|
-
import"./index-txdagbh7.js";
|
|
18
|
-
import"./index-q8dj8b88.js";
|
|
19
|
-
import"./index-rdec0y3z.js";
|
|
20
|
-
import"./index-t6na8zpb.js";
|
|
21
|
-
import"./index-dbwpcjhw.js";
|
|
22
|
-
import"./index-e47fhj4k.js";
|
|
23
|
-
import"./index-c5x4yzt6.js";
|
|
24
|
-
import"./index-84wt7q5y.js";
|
|
25
|
-
import"./index-0qpa53jg.js";
|
|
26
|
-
import"./index-cjapb4hy.js";
|
|
27
|
-
import"./index-sjwpvte3.js";
|
|
28
|
-
import"./index-pt7h91zc.js";
|
|
29
|
-
import"./index-q7sjgr1y.js";
|
|
30
|
-
import"./index-5dgg9vhz.js";
|
|
31
|
-
import"./index-xgsy3hzf.js";
|
|
32
|
-
import"./index-6b295cas.js";
|
|
33
|
-
import"./index-9nyqt3kb.js";
|
|
34
|
-
import"./index-mtb763x4.js";
|
|
35
|
-
import"./index-zsrtt42s.js";
|
|
36
|
-
import"./index-c12cz80m.js";
|
|
37
|
-
import"./index-4y6pndcf.js";
|
|
38
|
-
import"./index-144jx1jn.js";
|
|
39
|
-
import"./index-g4fs6z4e.js";
|
|
40
|
-
import"./index-tw513bvn.js";
|
|
41
|
-
import"./index-e6tjg7t9.js";
|
|
42
|
-
import"./index-znc71e1c.js";
|
|
43
|
-
import"./index-2s7dvzff.js";
|
|
44
|
-
import"./index-agm6hegf.js";
|
|
45
|
-
import"./index-7pstt3w2.js";
|
|
46
|
-
import"./index-rtry5xyf.js";
|
|
47
|
-
import"./index-prksynjw.js";
|
|
48
|
-
import"./index-kbkk7vnh.js";
|
|
49
|
-
import"./index-0725jpp7.js";
|
|
50
|
-
import"./index-7ae4sgp4.js";
|
|
51
|
-
import"./index-2nbws8bd.js";
|
|
52
|
-
import"./index-zcpd36zm.js";
|
|
53
|
-
import"./index-extgtmxm.js";
|
|
54
|
-
import"./index-n1szkmbz.js";
|
|
55
|
-
import"./index-0k283qtq.js";
|
|
56
|
-
import"./index-ry16d01s.js";
|
|
57
|
-
import"./index-rdm3px0g.js";
|
|
58
|
-
import"./index-7pmbnjvj.js";
|
|
59
|
-
import"./index-06pcq86m.js";
|
|
60
|
-
import {
|
|
61
|
-
resolveHiveKnowledgePath
|
|
62
|
-
} from "./index-pntrhnj8.js";
|
|
63
|
-
import"./index-vzm6zre7.js";
|
|
64
|
-
import"./index-ae75rja9.js";
|
|
65
|
-
import"./index-gsqmefdg.js";
|
|
66
|
-
import"./index-227te5a7.js";
|
|
67
|
-
import"./index-mr86ywsj.js";
|
|
68
|
-
import"./index-t7hmqgjy.js";
|
|
69
|
-
import"./index-xdjwefa5.js";
|
|
70
|
-
import"./index-mc72pk74.js";
|
|
71
|
-
import"./index-c1ggtmpm.js";
|
|
72
|
-
import"./index-ejhxgyvm.js";
|
|
73
|
-
import"./index-7g4c7s5r.js";
|
|
74
|
-
import"./index-e4hy4des.js";
|
|
75
|
-
import"./index-gx2vp8gx.js";
|
|
76
|
-
import"./index-cvwkjnr5.js";
|
|
77
|
-
import"./index-zxdawwc7.js";
|
|
78
|
-
import"./index-616pp1nq.js";
|
|
79
|
-
import"./index-03z05sbb.js";
|
|
80
|
-
import"./index-bk5tah7q.js";
|
|
81
|
-
import"./index-gknz3bv1.js";
|
|
82
|
-
import"./index-zpsr8rpc.js";
|
|
83
|
-
import"./index-wvghb3x6.js";
|
|
84
|
-
import"./index-9rwhas09.js";
|
|
85
|
-
import"./index-zgwm4ryv.js";
|
|
86
|
-
import"./index-a76rekgs.js";
|
|
87
|
-
export {
|
|
88
|
-
resolveHiveKnowledgePath,
|
|
89
|
-
promoteToHive,
|
|
90
|
-
promoteFromSwarm,
|
|
91
|
-
isHiveEligible,
|
|
92
|
-
createHivePromoterHook,
|
|
93
|
-
countDistinctProjects,
|
|
94
|
-
checkHivePromotions,
|
|
95
|
-
_internals
|
|
96
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
init_merge
|
|
4
|
-
} from "./index-zpsr8rpc.js";
|
|
5
|
-
import {
|
|
6
|
-
init_logger
|
|
7
|
-
} from "./index-zgwm4ryv.js";
|
|
8
|
-
|
|
9
|
-
// src/utils/errors.ts
|
|
10
|
-
class SwarmError extends Error {
|
|
11
|
-
code;
|
|
12
|
-
guidance;
|
|
13
|
-
constructor(message, code, guidance) {
|
|
14
|
-
super(message);
|
|
15
|
-
this.name = "SwarmError";
|
|
16
|
-
this.code = code;
|
|
17
|
-
this.guidance = guidance;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// src/utils/index.ts
|
|
22
|
-
init_logger();
|
|
23
|
-
init_merge();
|
|
24
|
-
|
|
25
|
-
// src/utils/regex.ts
|
|
26
|
-
function escapeRegex(s) {
|
|
27
|
-
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
28
|
-
}
|
|
29
|
-
function simpleGlobToRegex(pattern, flags = "i") {
|
|
30
|
-
const escaped = pattern.split("*").map((starSegment) => starSegment.split("?").map(escapeRegex).join(".")).join(".*");
|
|
31
|
-
return new RegExp(`^${escaped}$`, flags);
|
|
32
|
-
}
|
|
33
|
-
export { SwarmError, escapeRegex, simpleGlobToRegex };
|