opencode-swarm 7.140.6 → 7.141.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/.opencode/skills/deep-dive/SKILL.md +7 -6
- package/.opencode/skills/running-tests/SKILL.md +7 -0
- package/dist/agents/explorer.d.ts +1 -1
- package/dist/background/lane-delivery-store.d.ts +43 -0
- package/dist/background/lane-output-store.d.ts +6 -0
- package/dist/cli/{config-doctor-y5qeh18c.js → config-doctor-xs2p0xy3.js} +2 -2
- package/dist/cli/{core-pwd9604e.js → core-znrxk8gw.js} +1 -1
- package/dist/cli/{curation-policy-avvb56x2.js → curation-policy-j1fbc3ry.js} +5 -5
- package/dist/cli/{curator-q1nchgpg.js → curator-a95x81ek.js} +28 -28
- package/dist/cli/{curator-llm-factory-96pnc23w.js → curator-llm-factory-ak7p0scv.js} +28 -28
- package/dist/cli/{dispatch-2s23fbcs.js → dispatch-rd10kdk1.js} +1 -1
- package/dist/cli/{evidence-summary-service-18142mr3.js → evidence-summary-service-2gk48s5s.js} +9 -9
- package/dist/cli/{explorer-e9h66egs.js → explorer-18353rhn.js} +1 -1
- package/dist/cli/{gate-evidence-smn2wqft.js → gate-evidence-rt9034ft.js} +4 -4
- package/dist/cli/{guardrail-explain-kyd89z8z.js → guardrail-explain-4st3vc3d.js} +29 -29
- package/dist/cli/{guardrail-log-cahp1ews.js → guardrail-log-vjexgpfm.js} +3 -3
- package/dist/cli/{hive-promoter-vcbcvcsh.js → hive-promoter-g9ad9vad.js} +28 -28
- package/dist/cli/{index-z0z9pe7b.js → index-2ygp3pnx.js} +5 -5
- package/dist/cli/{index-1p72dtym.js → index-39xs96mk.js} +1 -1
- package/dist/cli/{index-tjqzr3jc.js → index-3d13jkzq.js} +2 -2
- package/dist/cli/{index-p2ty3eee.js → index-3gfdb0t9.js} +1 -1
- package/dist/cli/{index-4s7xgzbm.js → index-44nf5s90.js} +1 -1
- package/dist/cli/{index-2778hhh7.js → index-5ykn39wq.js} +2 -2
- package/dist/cli/{index-bjqpdr83.js → index-8056f16v.js} +3 -3
- package/dist/cli/{index-y9q9f6ms.js → index-8s4vnqts.js} +4 -4
- package/dist/cli/{index-epvhf50h.js → index-9d4gck4e.js} +2 -1
- package/dist/cli/{index-p8kk34am.js → index-c2hczjhp.js} +1 -1
- package/dist/cli/{index-56rqw2hs.js → index-c6m3t5n2.js} +6 -6
- package/dist/cli/{index-nakkgkkt.js → index-dx1mdsrj.js} +1294 -934
- package/dist/cli/{index-41hkt36g.js → index-ebwznsfy.js} +90 -19
- package/dist/cli/{index-c432knmy.js → index-f1hsrgw1.js} +1 -1
- package/dist/cli/{index-5qd5vt2d.js → index-g29r600w.js} +30 -30
- package/dist/cli/{index-z3s0a44b.js → index-hjf8pjd4.js} +3 -3
- package/dist/cli/{index-vh05t3w5.js → index-kq5p3nm3.js} +1 -1
- package/dist/cli/{index-h01wb18g.js → index-mr397tze.js} +2 -2
- package/dist/cli/{index-s1v0wza5.js → index-nse60anv.js} +1 -1
- package/dist/cli/{index-thp186x0.js → index-pkxt2rg2.js} +1 -1
- package/dist/cli/{index-t5pytnca.js → index-q4vaar2b.js} +2 -2
- package/dist/cli/{index-m9xrdjn0.js → index-qskz8j2z.js} +1 -1
- package/dist/cli/{index-92n3d5ky.js → index-ry609ctr.js} +40 -9
- package/dist/cli/{index-qy1nq52t.js → index-v250345n.js} +1 -1
- package/dist/cli/{index-e58e3v0v.js → index-vnr917xf.js} +3 -3
- package/dist/cli/{index-fejfzy2j.js → index-w9613ace.js} +6 -6
- package/dist/cli/{index-dtqjxfw9.js → index-wbf8sv70.js} +1 -1
- package/dist/cli/{index-v2xrer41.js → index-xmzmeknp.js} +3 -1
- package/dist/cli/{index-p04qrwck.js → index-ysapwztd.js} +2 -2
- package/dist/cli/{index-zd4qhnr7.js → index-z8yr1yra.js} +1 -1
- package/dist/cli/{index-912qz4y0.js → index-zbj3yrrd.js} +1 -1
- package/dist/cli/{index-4zxrkk1h.js → index-zqshpey0.js} +3 -3
- package/dist/cli/index.js +28 -28
- package/dist/cli/{knowledge-escalator-gj58za4g.js → knowledge-escalator-5xg6vmr4.js} +10 -10
- package/dist/cli/{knowledge-events-3m5jnnv6.js → knowledge-events-qvzpqt5b.js} +8 -8
- package/dist/cli/{knowledge-link-m9p80f4r.js → knowledge-link-x86ebng8.js} +4 -4
- package/dist/cli/{knowledge-store-0vy8wbzd.js → knowledge-store-k5td1vqx.js} +5 -5
- package/dist/cli/{knowledge-validator-mvcs8wf6.js → knowledge-validator-zz26gk5d.js} +7 -7
- package/dist/cli/{pending-delegations-cxx9tezp.js → pending-delegations-7xsagjy5.js} +3 -3
- package/dist/cli/{pr-subscriptions-2sfnb599.js → pr-subscriptions-r6cdsa3t.js} +3 -3
- package/dist/cli/{runner-mky3vvht.js → runner-nm3baddf.js} +5 -5
- package/dist/cli/{scan-cursor-wznc7p7p.js → scan-cursor-nhcpebh5.js} +6 -6
- package/dist/cli/{schema-k596bhds.js → schema-6ecb0xhn.js} +1 -1
- package/dist/cli/{scope-persistence-0ny5fn07.js → scope-persistence-yet1hvmq.js} +6 -6
- package/dist/cli/{skill-generator-vrks0jjj.js → skill-generator-j0mbd2pp.js} +12 -12
- package/dist/cli/{telemetry-0x6kszvk.js → telemetry-zex3zv3v.js} +1 -1
- package/dist/cli/{worktree-collision-ownership-wm5pse49.js → worktree-collision-ownership-n41qw3n8.js} +3 -3
- package/dist/cli/{worktree-isolation-zgk7314k.js → worktree-isolation-445zjngp.js} +28 -28
- package/dist/hooks/delegation-gate.d.ts +6 -0
- package/dist/hooks/knowledge-application-gate.d.ts +1 -1
- package/dist/hooks/knowledge-events.d.ts +5 -2
- package/dist/hooks/knowledge-receipt-ledger.d.ts +38 -0
- package/dist/hooks/knowledge-receipt-observability.d.ts +24 -1
- package/dist/hooks/knowledge-receipt-validator.d.ts +19 -3
- package/dist/hooks/knowledge-types.d.ts +9 -0
- package/dist/hooks/repo-graph-injection.d.ts +52 -0
- package/dist/index.js +224 -213
- package/dist/lang/backend.d.ts +8 -1
- package/dist/lang/default-backend.d.ts +2 -1
- package/dist/tools/create-tool.d.ts +5 -2
- package/dist/tools/dispatch-lanes.d.ts +45 -5
- package/dist/tools/knowledge-receipt.d.ts +40 -0
- package/dist/tools/test-runner.d.ts +14 -5
- package/package.json +1 -1
package/dist/lang/backend.d.ts
CHANGED
|
@@ -83,7 +83,12 @@ export interface TestRunSummary {
|
|
|
83
83
|
* can accept them in `buildTestCommand` without a circular import back to
|
|
84
84
|
* `src/tools/test-runner.ts`.
|
|
85
85
|
*/
|
|
86
|
-
export type TestScope = 'all' | 'convention' | 'graph' | 'impact';
|
|
86
|
+
export type TestScope = 'all' | 'convention' | 'graph' | 'impact' | 'target';
|
|
87
|
+
export interface NativeTestTarget {
|
|
88
|
+
framework: 'go-test' | 'ctest';
|
|
89
|
+
name: string;
|
|
90
|
+
path: string;
|
|
91
|
+
}
|
|
87
92
|
/**
|
|
88
93
|
* Options influencing build-command construction. Backends may ignore
|
|
89
94
|
* unrecognized opts; the default backend honors all of these.
|
|
@@ -92,6 +97,8 @@ export interface BuildTestCommandOpts {
|
|
|
92
97
|
scope?: TestScope;
|
|
93
98
|
coverage?: boolean;
|
|
94
99
|
bail?: boolean;
|
|
100
|
+
targets?: string[];
|
|
101
|
+
nativeTarget?: NativeTestTarget;
|
|
95
102
|
}
|
|
96
103
|
/**
|
|
97
104
|
* Selected web/UI framework for a project (PROJECT_FRAMEWORK template
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* to the environment, and it lives in `src/build/discovery.ts` with full
|
|
10
10
|
* invariant-3 properties (cwd, stdin: 'ignore', timeout, bounded stdio).
|
|
11
11
|
*/
|
|
12
|
-
import type { BuildCommandSelection, BuildTestCommandOpts, FrameworkSelection, LanguageBackend, TestFrameworkSelection, TestRunSummary } from './backend';
|
|
12
|
+
import type { BuildCommandSelection, BuildTestCommandOpts, FrameworkSelection, LanguageBackend, NativeTestTarget, TestFrameworkSelection, TestRunSummary } from './backend';
|
|
13
13
|
import type { LanguageProfile } from './profiles';
|
|
14
14
|
/**
|
|
15
15
|
* Tokenize a string command into an array. Splits on whitespace; respects
|
|
@@ -47,6 +47,7 @@ export declare function defaultSelectTestFramework(profile: LanguageProfile, dir
|
|
|
47
47
|
* Returns null when the framework name is not in the supported set.
|
|
48
48
|
*/
|
|
49
49
|
export declare function defaultBuildTestCommand(profile: LanguageProfile, framework: string, files: string[], dir?: string, opts?: BuildTestCommandOpts): string[] | null;
|
|
50
|
+
export declare function buildNativeTargetCommand(target: NativeTestTarget): string[];
|
|
50
51
|
/**
|
|
51
52
|
* Default parseTestOutput: full 14-framework switch ported verbatim from
|
|
52
53
|
* `src/tools/test-runner.ts:parseTestOutput`. Returns a TestRunSummary
|
|
@@ -18,11 +18,14 @@ export type ToolResult = string | {
|
|
|
18
18
|
export interface SwarmToolOptions<Args extends Record<string, unknown>> {
|
|
19
19
|
description: string;
|
|
20
20
|
args: Args;
|
|
21
|
+
allowWorkingDirectoryOverride?: boolean;
|
|
21
22
|
execute: (args: Args, directory: string, ctx?: ToolContext) => Promise<ToolResult>;
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
24
|
-
* Creates a swarm tool with
|
|
25
|
-
* Wraps the @opencode-ai/plugin/tool factory to always inject `directory` and `ctx`
|
|
25
|
+
* Creates a swarm tool with optional working_directory override injection.
|
|
26
|
+
* Wraps the @opencode-ai/plugin/tool factory to always inject `directory` and `ctx`
|
|
27
|
+
* into tool execute callbacks, and to expose a caller-controlled
|
|
28
|
+
* `working_directory` only for tools that explicitly opt into that override.
|
|
26
29
|
*
|
|
27
30
|
* Registration contract (issue #1781 E4): every `export const NAME = createSwarmTool({...})`
|
|
28
31
|
* in `src/tools/**` MUST have a corresponding entry in `TOOL_METADATA`
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { type BackgroundDelegationRecord } from '../background/pending-delegations.js';
|
|
3
3
|
import { resolveExactMergeBaseAsync, resolvePrWorkflowRevisionDigestAsync } from '../background/workspace-snapshot.js';
|
|
4
4
|
import { type PrReviewDepthTier } from '../hooks/pr-workflow-gate.js';
|
|
5
|
+
import { buildLaneOrientationBlock } from '../hooks/repo-graph-injection.js';
|
|
5
6
|
import { createParallelDispatcher } from '../parallel/dispatcher/parallel-dispatcher.js';
|
|
6
7
|
import { createSwarmTool } from './create-tool.js';
|
|
7
8
|
export declare const MAX_PROMPT_CHARS = 80000;
|
|
@@ -31,6 +32,7 @@ declare const DispatchLanesArgsSchema: z.ZodObject<{
|
|
|
31
32
|
common_prompt: z.ZodOptional<z.ZodString>;
|
|
32
33
|
max_concurrent: z.ZodOptional<z.ZodNumber>;
|
|
33
34
|
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
orientation: z.ZodOptional<z.ZodBoolean>;
|
|
34
36
|
}, z.core.$strip>;
|
|
35
37
|
declare const DispatchLanesAsyncArgsSchema: z.ZodObject<{
|
|
36
38
|
lanes: z.ZodArray<z.ZodObject<{
|
|
@@ -45,6 +47,7 @@ declare const DispatchLanesAsyncArgsSchema: z.ZodObject<{
|
|
|
45
47
|
common_prompt: z.ZodOptional<z.ZodString>;
|
|
46
48
|
max_concurrent: z.ZodOptional<z.ZodNumber>;
|
|
47
49
|
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
orientation: z.ZodOptional<z.ZodBoolean>;
|
|
48
51
|
launch_timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
49
52
|
batch_id: z.ZodOptional<z.ZodString>;
|
|
50
53
|
mode: z.ZodOptional<z.ZodString>;
|
|
@@ -290,6 +293,7 @@ export declare const _test_exports: {
|
|
|
290
293
|
applyCommonPrompt: typeof applyCommonPrompt;
|
|
291
294
|
applyExplorerFormatSuffix: typeof applyExplorerFormatSuffix;
|
|
292
295
|
applyPrWorkflowPromptContract: typeof applyPrWorkflowPromptContract;
|
|
296
|
+
augmentCommonPromptWithOrientation: typeof augmentCommonPromptWithOrientation;
|
|
293
297
|
buildCollectResult: typeof buildCollectResult;
|
|
294
298
|
buildReadOnlyTools: typeof buildReadOnlyTools;
|
|
295
299
|
buildLaneSessionCreateArgs: typeof buildLaneSessionCreateArgs;
|
|
@@ -311,6 +315,7 @@ export declare const _test_exports: {
|
|
|
311
315
|
common_prompt: z.ZodOptional<z.ZodString>;
|
|
312
316
|
max_concurrent: z.ZodOptional<z.ZodNumber>;
|
|
313
317
|
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
318
|
+
orientation: z.ZodOptional<z.ZodBoolean>;
|
|
314
319
|
}, z.core.$strip>;
|
|
315
320
|
DispatchLanesAsyncArgsSchema: z.ZodObject<{
|
|
316
321
|
lanes: z.ZodArray<z.ZodObject<{
|
|
@@ -325,6 +330,7 @@ export declare const _test_exports: {
|
|
|
325
330
|
common_prompt: z.ZodOptional<z.ZodString>;
|
|
326
331
|
max_concurrent: z.ZodOptional<z.ZodNumber>;
|
|
327
332
|
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
333
|
+
orientation: z.ZodOptional<z.ZodBoolean>;
|
|
328
334
|
launch_timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
329
335
|
batch_id: z.ZodOptional<z.ZodString>;
|
|
330
336
|
mode: z.ZodOptional<z.ZodString>;
|
|
@@ -372,9 +378,10 @@ export declare const _test_exports: {
|
|
|
372
378
|
DEFAULT_ASYNC_STALE_TIMEOUT_MS: number;
|
|
373
379
|
DEFAULT_COLLECT_TIMEOUT_MS: number;
|
|
374
380
|
/**
|
|
375
|
-
* Clears the
|
|
376
|
-
*
|
|
377
|
-
*
|
|
381
|
+
* Clears the lane-output delivery de-dupe state (see S1.1) so tests can
|
|
382
|
+
* assert first-poll vs. repeat-poll behavior without cross-test
|
|
383
|
+
* bleed-through. Delegates to the persistent lane-delivery store's
|
|
384
|
+
* in-memory reset; disk state is untouched.
|
|
378
385
|
*/
|
|
379
386
|
resetDeliveredLaneOutputs: () => void;
|
|
380
387
|
recordToLaneResult: typeof recordToLaneResult;
|
|
@@ -406,8 +413,14 @@ declare function extractAssistantTranscript(messages: Array<{
|
|
|
406
413
|
transcriptIncomplete: boolean;
|
|
407
414
|
};
|
|
408
415
|
declare function nextCollectPollInterval(currentMs: number): number;
|
|
409
|
-
declare function buildCollectResult(batchId: string, records: BackgroundDelegationRecord[], includePending: boolean
|
|
410
|
-
|
|
416
|
+
declare function buildCollectResult(batchId: string, records: BackgroundDelegationRecord[], includePending: boolean, deliveryContext?: {
|
|
417
|
+
directory?: string;
|
|
418
|
+
sessionID?: string;
|
|
419
|
+
}): CollectLaneResultsResult;
|
|
420
|
+
declare function recordToLaneResult(record: BackgroundDelegationRecord, batchId: string, deliveryContext?: {
|
|
421
|
+
directory?: string;
|
|
422
|
+
sessionID?: string;
|
|
423
|
+
}): DispatchLaneResult;
|
|
411
424
|
declare function buildReadOnlyTools(): ReadOnlyToolPermissions;
|
|
412
425
|
type ApplyCommonPromptResult = {
|
|
413
426
|
ok: true;
|
|
@@ -426,6 +439,33 @@ type ApplyCommonPromptResult = {
|
|
|
426
439
|
* when no `commonPrompt` is provided, or shallow-copied lanes with rewritten
|
|
427
440
|
* prompts when it is. Callers may treat the returned array as their own.
|
|
428
441
|
*/
|
|
442
|
+
interface OrientationAugmentDeps {
|
|
443
|
+
buildBlock?: typeof buildLaneOrientationBlock;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Resolve the `orientation` arg into an augmented common_prompt (issue #1988 C2).
|
|
447
|
+
*
|
|
448
|
+
* Execute-time resolution (no zod default — a schema default cannot depend on
|
|
449
|
+
* graph state): `false` skips entirely; `true` or undefined attempts the block,
|
|
450
|
+
* and buildLaneOrientationBlock itself returns null unless a fresh graph
|
|
451
|
+
* exists, so undefined degrades to "false when no fresh graph".
|
|
452
|
+
*
|
|
453
|
+
* Overflow rule: the drop decision runs ONCE here, at the common+lane stage —
|
|
454
|
+
* max over lanes of (common_prompt + orientation + separator + lane.prompt +
|
|
455
|
+
* ORIENTATION_SUFFIX_RESERVE_CHARS) versus MAX_PROMPT_CHARS — BEFORE
|
|
456
|
+
* appending. If any lane would exceed the cap the block is dropped (debug
|
|
457
|
+
* log) rather than truncating content or failing dispatch. The reserve keeps
|
|
458
|
+
* typical suffix appends (fixed worst case ≈3.2k chars) out of failure
|
|
459
|
+
* territory they would not have reached without the block; extreme but
|
|
460
|
+
* schema-valid configurations (maxed item-id/owned-lane arrays) can exceed
|
|
461
|
+
* the reserve, and anything beyond it remains the caller's own size
|
|
462
|
+
* responsibility, as before this feature.
|
|
463
|
+
*
|
|
464
|
+
* Fail-open: any builder error degrades to the un-augmented common_prompt.
|
|
465
|
+
*/
|
|
466
|
+
declare function augmentCommonPromptWithOrientation(directory: string, lanes: readonly {
|
|
467
|
+
prompt: string;
|
|
468
|
+
}[], commonPrompt: string | undefined, orientation: boolean | undefined, sessionID: string | undefined, deps?: OrientationAugmentDeps): Promise<string | undefined>;
|
|
429
469
|
declare function applyCommonPrompt(lanes: DispatchLaneSpec[], commonPrompt: string | undefined): ApplyCommonPromptResult;
|
|
430
470
|
declare function applyExplorerFormatSuffix(lanes: DispatchLaneSpec[], options?: {
|
|
431
471
|
failClosed?: boolean;
|
|
@@ -12,8 +12,48 @@
|
|
|
12
12
|
* relevant, the receipt can set `no_relevant_knowledge: true` — the point is to
|
|
13
13
|
* force explicit consideration, not fake usage.
|
|
14
14
|
*/
|
|
15
|
+
import { z } from 'zod';
|
|
15
16
|
import { createSwarmTool } from './create-tool.js';
|
|
17
|
+
declare const ignoredItem: z.ZodObject<{
|
|
18
|
+
id: z.ZodString;
|
|
19
|
+
reason: z.ZodEnum<{
|
|
20
|
+
stale: "stale";
|
|
21
|
+
other: "other";
|
|
22
|
+
superseded: "superseded";
|
|
23
|
+
unsafe: "unsafe";
|
|
24
|
+
too_generic: "too_generic";
|
|
25
|
+
already_satisfied: "already_satisfied";
|
|
26
|
+
}>;
|
|
27
|
+
note: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
/**
|
|
30
|
+
* A shown entry that did not apply to the task at hand (issue #2032).
|
|
31
|
+
* Reasoned: the reason is required so `n_a` cannot be used as a silent
|
|
32
|
+
* evasion channel — a gate consumer can always ask "why not applicable?".
|
|
33
|
+
* The reason is trimmed before validation (min(1) after trim), so a
|
|
34
|
+
* whitespace-only reason is rejected exactly like an empty one — matching
|
|
35
|
+
* the phase gate's `reason?.trim()` resolution rule.
|
|
36
|
+
*/
|
|
37
|
+
declare const notApplicableItem: z.ZodObject<{
|
|
38
|
+
id: z.ZodString;
|
|
39
|
+
reason: z.ZodString;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
/**
|
|
42
|
+
* Map the calling agent to a canonical receipt-source class (issue #2032).
|
|
43
|
+
* Explicit allowlist — do NOT widen silently. The three independent-verifier
|
|
44
|
+
* roles the knowledge contract names get their own class; every other
|
|
45
|
+
* non-empty role (coder, spec_writer, sme, docs, designer, custom roles) is
|
|
46
|
+
* the exposed agent reporting on itself, which is exactly what the
|
|
47
|
+
* `'delegate'` source class means — a self-report, NOT "subagent of an
|
|
48
|
+
* architect". Unknown/absent caller stays honestly `'unknown'`; missing
|
|
49
|
+
* legacy source is never inferred.
|
|
50
|
+
*/
|
|
51
|
+
declare function receiptSourceForAgent(agent: string): string;
|
|
16
52
|
export declare const knowledge_receipt: ReturnType<typeof createSwarmTool>;
|
|
17
53
|
export declare const _internals: {
|
|
18
54
|
knowledge_receipt: typeof knowledge_receipt;
|
|
55
|
+
receiptSourceForAgent: typeof receiptSourceForAgent;
|
|
56
|
+
ignoredItemSchema: typeof ignoredItem;
|
|
57
|
+
notApplicableItemSchema: typeof notApplicableItem;
|
|
19
58
|
};
|
|
59
|
+
export {};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as fs from 'node:fs';
|
|
2
2
|
import type { tool } from '@opencode-ai/plugin';
|
|
3
3
|
import { isCommandAvailable } from '../build/discovery';
|
|
4
|
+
import type { NativeTestTarget, TestScope } from '../lang/backend';
|
|
5
|
+
import { buildNativeTargetCommand } from '../lang/default-backend';
|
|
4
6
|
import { analyzeImpact, loadImpactMap } from '../test-impact/analyzer.js';
|
|
5
7
|
import { getAllHistory, type TestRunRecord } from '../test-impact/history-store.js';
|
|
8
|
+
import { bunSpawn } from '../utils/bun-compat';
|
|
6
9
|
export declare const MAX_OUTPUT_BYTES = 512000;
|
|
7
10
|
export declare const MAX_COMMAND_LENGTH = 500;
|
|
8
11
|
export declare const DEFAULT_TIMEOUT_MS = 60000;
|
|
@@ -23,8 +26,10 @@ export declare function estimateFanOut(sourceFiles: string[], cwd: string): Prom
|
|
|
23
26
|
export declare const SUPPORTED_FRAMEWORKS: readonly ["bun", "vitest", "jest", "mocha", "pytest", "cargo", "pester", "go-test", "maven", "gradle", "dotnet-test", "ctest", "swift-test", "dart-test", "rspec", "minitest", "pest", "phpunit", "php-artisan"];
|
|
24
27
|
export type TestFramework = (typeof SUPPORTED_FRAMEWORKS)[number] | 'none';
|
|
25
28
|
export interface TestRunnerArgs {
|
|
26
|
-
scope?:
|
|
29
|
+
scope?: TestScope;
|
|
27
30
|
files?: string[];
|
|
31
|
+
targets?: string[];
|
|
32
|
+
native_target?: NativeTestTarget;
|
|
28
33
|
coverage?: boolean;
|
|
29
34
|
timeout_ms?: number;
|
|
30
35
|
bail?: boolean;
|
|
@@ -48,7 +53,7 @@ declare const AGGREGATE_TEST_NAME = "(aggregate)";
|
|
|
48
53
|
export interface TestSuccessResult {
|
|
49
54
|
success: true;
|
|
50
55
|
framework: TestFramework;
|
|
51
|
-
scope:
|
|
56
|
+
scope: TestScope;
|
|
52
57
|
command: string[];
|
|
53
58
|
timeout_ms: number;
|
|
54
59
|
duration_ms: number;
|
|
@@ -62,7 +67,7 @@ export interface TestSuccessResult {
|
|
|
62
67
|
export interface TestErrorResult {
|
|
63
68
|
success: false;
|
|
64
69
|
framework: TestFramework;
|
|
65
|
-
scope:
|
|
70
|
+
scope: TestScope;
|
|
66
71
|
command?: string[];
|
|
67
72
|
timeout_ms?: number;
|
|
68
73
|
duration_ms?: number;
|
|
@@ -103,7 +108,7 @@ export declare function detectTestFrameworkViaDispatch(cwd: string): Promise<Tes
|
|
|
103
108
|
* Returns null on framework=`none` or when dispatch fails — callers (the
|
|
104
109
|
* test-runner) then surface "no test command available".
|
|
105
110
|
*/
|
|
106
|
-
export declare function buildTestCommandViaDispatch(framework: TestFramework, scope:
|
|
111
|
+
export declare function buildTestCommandViaDispatch(framework: TestFramework, scope: TestScope, files: string[], coverage: boolean, baseDir: string, bail: boolean, targets?: string[], nativeTarget?: NativeTestTarget): Promise<string[] | null>;
|
|
107
112
|
/**
|
|
108
113
|
* Parse test output via the LanguageBackend dispatch path. Calls
|
|
109
114
|
* `backend.parseTestOutput` for the directory's resolved backend and
|
|
@@ -147,7 +152,8 @@ export declare function isLanguageSpecificTestFile(basename: string): boolean;
|
|
|
147
152
|
* Exported for unit tests.
|
|
148
153
|
*/
|
|
149
154
|
export declare function getTestFilesFromConvention(sourceFiles: string[], workingDir?: string): string[];
|
|
150
|
-
|
|
155
|
+
declare function formatNativeHistoryTestFile(target: NativeTestTarget, historyPath: string): string;
|
|
156
|
+
export declare function runTests(framework: TestFramework, scope: TestScope, files: string[], coverage: boolean, timeout_ms: number, cwd: string, bail: boolean, targets?: string[], nativeTarget?: NativeTestTarget): Promise<TestResult>;
|
|
151
157
|
declare function selectHistoryForAnalysis(history: ReturnType<typeof getAllHistory>): TestRunRecord[];
|
|
152
158
|
export declare const test_runner: ReturnType<typeof tool>;
|
|
153
159
|
export declare const _internals: {
|
|
@@ -157,6 +163,9 @@ export declare const _internals: {
|
|
|
157
163
|
existsSync: typeof fs.existsSync;
|
|
158
164
|
readdirSync: typeof fs.readdirSync;
|
|
159
165
|
readFileSync: typeof fs.readFileSync;
|
|
166
|
+
bunSpawn: typeof bunSpawn;
|
|
167
|
+
buildNativeTargetCommand: typeof buildNativeTargetCommand;
|
|
168
|
+
formatNativeHistoryTestFile: typeof formatNativeHistoryTestFile;
|
|
160
169
|
selectHistoryForAnalysis: typeof selectHistoryForAnalysis;
|
|
161
170
|
AGGREGATE_TEST_NAME: typeof AGGREGATE_TEST_NAME;
|
|
162
171
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.141.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",
|