@wrongstack/core 0.306.4 → 0.307.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/dist/chronicle/index.js +957 -953
- package/dist/chronicle/metrics-ingest.d.ts +55 -0
- package/dist/chronicle/metrics-schema.d.ts +86 -0
- package/dist/chronicle/metrics-store.d.ts +5 -120
- package/dist/chronicle/project-server.js +1083 -1084
- package/dist/chronicle/sqlite-journal-quota.d.ts +39 -0
- package/dist/chronicle/sqlite-journal-schema.d.ts +25 -0
- package/dist/chronicle/sqlite-journal.d.ts +12 -177
- package/dist/coordination/agents/index.js +1803 -1701
- package/dist/coordination/agents/project-agent-capture.d.ts +48 -0
- package/dist/coordination/agents/project-agent-identity.d.ts +3 -129
- package/dist/coordination/agents/project-agent-roster.d.ts +17 -0
- package/dist/coordination/agents/types.d.ts +6 -9
- package/dist/coordination/index.js +6051 -5880
- package/dist/coordination/mail-tools.d.ts +1 -1
- package/dist/coordination/mailbox-http-actor-query.d.ts +16 -0
- package/dist/coordination/mailbox-http-router.d.ts +0 -48
- package/dist/coordination/mailbox-http-sse.d.ts +12 -0
- package/dist/coordination/mailbox-message-types.d.ts +71 -0
- package/dist/coordination/mailbox-predicates.d.ts +13 -0
- package/dist/coordination/mailbox-project-server.js +1 -1
- package/dist/coordination/mailbox-session-sync.d.ts +8 -0
- package/dist/coordination/mailbox-types.d.ts +6 -793
- package/dist/core/agent-loop-context.d.ts +28 -0
- package/dist/core/agent-loop-detector.d.ts +25 -0
- package/dist/core/fallback-doctor.d.ts +72 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1859 -1335
- package/dist/defaults/index.js +3647 -3559
- package/dist/execution/autonomy-brain-llm.d.ts +55 -0
- package/dist/execution/autonomy-brain.d.ts +3 -156
- package/dist/execution/compaction-budget.d.ts +38 -0
- package/dist/execution/compaction-core.d.ts +3 -170
- package/dist/execution/compaction-elision.d.ts +58 -0
- package/dist/execution/council-orchestrator-helpers.d.ts +39 -0
- package/dist/execution/council-orchestrator.d.ts +3 -42
- package/dist/execution/council-response-parser.d.ts +56 -0
- package/dist/execution/index.js +2475 -2449
- package/dist/execution/prompt-enhancer.js +11 -3
- package/dist/execution/tool-executor-guard.d.ts +18 -0
- package/dist/execution/tool-executor-runner.d.ts +12 -0
- package/dist/execution/tool-executor.d.ts +0 -75
- package/dist/goal/index.js +19 -6
- package/dist/hq/index.js +8 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8021 -7405
- package/dist/infrastructure/index.js +3 -1
- package/dist/kernel/events/agent-events.d.ts +2 -0
- package/dist/kernel/events/provider-events.d.ts +13 -0
- package/dist/plugin/index.js +2590 -2561
- package/dist/plugins/auto-review-config.d.ts +53 -0
- package/dist/plugins/auto-review-git.d.ts +19 -0
- package/dist/plugins/auto-review-plugin.d.ts +2 -140
- package/dist/plugins/review-finding-verification.d.ts +7 -0
- package/dist/prompts/index.d.ts +1 -0
- package/dist/prompts/index.js +601 -0
- package/dist/prompts/prompt-journal.d.ts +103 -0
- package/dist/security/index.js +627 -652
- package/dist/security/permission-explain.d.ts +19 -0
- package/dist/security/permission-policy.d.ts +0 -101
- package/dist/security/yolo-risk.d.ts +5 -4
- package/dist/session-catalog/index.js +220 -212
- package/dist/session-catalog/project-server.js +227 -219
- package/dist/session-catalog/store-rebuild.d.ts +9 -0
- package/dist/session-catalog/store-schema.d.ts +48 -0
- package/dist/session-catalog/store.d.ts +0 -17
- package/dist/storage/director-state.d.ts +6 -0
- package/dist/storage/file-session-writer.d.ts +2 -58
- package/dist/storage/index.d.ts +2 -1
- package/dist/storage/index.js +2057 -1925
- package/dist/storage/orphan-lock-cleaner.d.ts +15 -0
- package/dist/storage/queue-store.d.ts +6 -0
- package/dist/storage/session-recovery.d.ts +9 -0
- package/dist/storage/session-store/rename-session.d.ts +16 -0
- package/dist/storage/session-store/resume-session.d.ts +26 -0
- package/dist/storage/session-store/session-store-clear.d.ts +11 -0
- package/dist/storage/session-store/session-store-index.d.ts +13 -0
- package/dist/storage/session-store.d.ts +1 -129
- package/dist/storage/session-summary-tracker.d.ts +39 -0
- package/dist/storage/session-write-buffer.d.ts +43 -0
- package/dist/storage/session-writer/session-writer-flush.d.ts +4 -0
- package/dist/storage/session-writer/session-writer-summary-tracker.d.ts +28 -0
- package/dist/tools/fallback-agent-model-assign-tool.d.ts +18 -0
- package/dist/tools/fallback-leader-model-set-tool.d.ts +18 -0
- package/dist/tools/fallback-manage-tools.d.ts +8 -45
- package/dist/tools/fallback-profile-manage-tool.d.ts +16 -0
- package/dist/tools/fallback-provider-key-set-tool.d.ts +17 -0
- package/dist/tools/fallback-provider-manage-tool.d.ts +26 -0
- package/dist/tools/index.js +5124 -5071
- package/dist/types/config/root.d.ts +7 -2
- package/dist/types/default-config.d.ts +1 -1
- package/dist/types/index.d.ts +54 -55
- package/dist/types/index.js +953 -932
- package/dist/types/runtime-capability-manifest.d.ts +5 -5
- package/dist/types/session-markers.d.ts +12 -0
- package/dist/types/session-markers.js +19 -0
- package/dist/worktree/worktree-manager.d.ts +1 -1
- package/instructions/agents/architect.md +2 -0
- package/instructions/agents/code-reviewer.md +1 -0
- package/instructions/agents/debugger.md +2 -0
- package/instructions/agents/executor.md +2 -0
- package/instructions/agents/explore.md +3 -1
- package/instructions/agents/refactor.md +2 -0
- package/instructions/agents/reviewer.md +1 -0
- package/instructions/coordination/subagent-baseline.md +68 -7
- package/instructions/llm/prompt-enhancer.md +2 -1
- package/instructions/sections/tool/common-patterns.md +30 -0
- package/instructions/sections/tool/delegation-compact.md +3 -1
- package/instructions/sections/tool/delegation-full.md +5 -1
- package/instructions/system-lite.md +32 -4
- package/instructions/system-pro.md +63 -9
- package/instructions/system.md +56 -11
- package/package.json +9 -5
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ProviderModelStatusTracker } from '../coordination/provider-status-tracker.js';
|
|
2
|
+
import type { Config } from '../types/config.js';
|
|
3
|
+
import type { CascadeAgentKind } from './chimera-plugin.js';
|
|
4
|
+
import type { ChimeraFinding } from './review-finding-types.js';
|
|
5
|
+
export interface AutoReviewConfig {
|
|
6
|
+
enabled?: boolean | undefined;
|
|
7
|
+
provider?: string | undefined;
|
|
8
|
+
model?: string | undefined;
|
|
9
|
+
fallbackProfile?: string | undefined;
|
|
10
|
+
modelSelection?: 'round-robin' | 'random' | undefined;
|
|
11
|
+
debounceMs?: number | undefined;
|
|
12
|
+
maxFilesPerBatch?: number | undefined;
|
|
13
|
+
maxConcurrentReviews?: number | undefined;
|
|
14
|
+
cascadeOn?: 'off' | 'critical' | 'high' | undefined;
|
|
15
|
+
maxCascadeDepth?: number | undefined;
|
|
16
|
+
}
|
|
17
|
+
export interface ResolvedAutoReviewConfig {
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
provider: string;
|
|
20
|
+
model: string;
|
|
21
|
+
fallbackModels: string[];
|
|
22
|
+
modelSelection: 'round-robin' | 'random';
|
|
23
|
+
debounceMs: number;
|
|
24
|
+
maxFilesPerBatch: number;
|
|
25
|
+
maxConcurrentReviews: number;
|
|
26
|
+
cascadeOn: 'off' | 'critical' | 'high';
|
|
27
|
+
maxCascadeDepth: number;
|
|
28
|
+
}
|
|
29
|
+
export declare const DEFAULT_DEBOUNCE_MS = 15000;
|
|
30
|
+
export declare const DEFAULT_MAX_FILES_PER_BATCH = 15;
|
|
31
|
+
export declare const DEFAULT_MAX_CONCURRENT_REVIEWS = 2;
|
|
32
|
+
export declare const DEFAULT_MAX_CASCADE_DEPTH = 2;
|
|
33
|
+
export declare const MAX_KNOWN_FINGERPRINTS = 5000;
|
|
34
|
+
export declare function trimKnownFingerprints(map: Map<string, string>, max: number): void;
|
|
35
|
+
export interface ReviewerModelAssignment {
|
|
36
|
+
provider: string;
|
|
37
|
+
model: string;
|
|
38
|
+
fallbackModels: string[];
|
|
39
|
+
nextCursor: number;
|
|
40
|
+
}
|
|
41
|
+
export declare function buildReviewerModelPool(provider: string, model: string, fallbackModels?: readonly string[], statusTracker?: ProviderModelStatusTracker | undefined): string[];
|
|
42
|
+
export declare function selectRoundRobinReviewerAssignment(pool: readonly string[], cursor: number, fallbackProvider?: string, fallbackModel?: string, statusTracker?: ProviderModelStatusTracker | undefined): ReviewerModelAssignment;
|
|
43
|
+
export declare function resolveAutoReviewConfig(cfg: AutoReviewConfig, sessionConfig: Config): ResolvedAutoReviewConfig;
|
|
44
|
+
export interface ParsedSeverities {
|
|
45
|
+
critical: number;
|
|
46
|
+
high: number;
|
|
47
|
+
medium: number;
|
|
48
|
+
}
|
|
49
|
+
export declare function severitiesFromFindings(findings: readonly ChimeraFinding[]): ParsedSeverities;
|
|
50
|
+
export declare function parseReviewSeverity(text: string): ParsedSeverities;
|
|
51
|
+
export declare function decideCascadeAgents(text: string, severities: ParsedSeverities, findings?: readonly ChimeraFinding[] | undefined): CascadeAgentKind[];
|
|
52
|
+
export declare function shouldCascade(cascadeOn: 'off' | 'critical' | 'high', severities: ParsedSeverities): 'high' | 'critical' | null;
|
|
53
|
+
//# sourceMappingURL=auto-review-config.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ChangedFile {
|
|
2
|
+
path: string;
|
|
3
|
+
status: 'added' | 'modified';
|
|
4
|
+
}
|
|
5
|
+
export interface ChangedFileSnapshot extends ChangedFile {
|
|
6
|
+
content: string;
|
|
7
|
+
fingerprint: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const MAX_SNAPSHOT_FILE_BYTES: number;
|
|
10
|
+
export declare const MAX_SNAPSHOT_TOTAL_BYTES: number;
|
|
11
|
+
export declare function runGit(args: string[], cwd: string): Promise<{
|
|
12
|
+
stdout: string;
|
|
13
|
+
stderr: string;
|
|
14
|
+
code: number;
|
|
15
|
+
}>;
|
|
16
|
+
export declare function isGitRepo(cwd: string): Promise<boolean>;
|
|
17
|
+
export declare function getChangedFiles(cwd: string): Promise<ChangedFile[]>;
|
|
18
|
+
export declare function snapshotChangedFiles(cwd: string): Promise<ChangedFileSnapshot[]>;
|
|
19
|
+
//# sourceMappingURL=auto-review-git.d.ts.map
|
|
@@ -1,143 +1,5 @@
|
|
|
1
|
-
import type { ProviderModelStatusTracker } from '../coordination/provider-status-tracker.js';
|
|
2
|
-
import type { Config } from '../types/config.js';
|
|
3
1
|
import type { Plugin } from '../types/plugin.js';
|
|
4
|
-
import type
|
|
5
|
-
|
|
6
|
-
export interface AutoReviewConfig {
|
|
7
|
-
enabled?: boolean | undefined;
|
|
8
|
-
/** Provider for review subagents. Falls back to session provider. */
|
|
9
|
-
provider?: string | undefined;
|
|
10
|
-
/** Model for review subagents. Falls back to session model. */
|
|
11
|
-
model?: string | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Named fallback profile from config.fallbackProfiles.
|
|
14
|
-
* Resolved via FallbackProfileManager. The first valid entry
|
|
15
|
-
* becomes the primary provider/model (when provider/model are
|
|
16
|
-
* omitted), and the remaining entries form the fallback chain.
|
|
17
|
-
*/
|
|
18
|
-
fallbackProfile?: string | undefined;
|
|
19
|
-
/** How each review chooses its starting model from the resolved profile pool. */
|
|
20
|
-
modelSelection?: 'round-robin' | 'random' | undefined;
|
|
21
|
-
/** Debounce window in ms — wait for quiet before firing review (default 15000). */
|
|
22
|
-
debounceMs?: number | undefined;
|
|
23
|
-
/** Max files per review batch (default 15). */
|
|
24
|
-
maxFilesPerBatch?: number | undefined;
|
|
25
|
-
/** Max concurrent in-flight reviews (default 2). */
|
|
26
|
-
maxConcurrentReviews?: number | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* Cascade severity threshold: when a review finds findings at or above this
|
|
29
|
-
* level, spawn follow-up agents automatically. "off" disables cascading,
|
|
30
|
-
* "high" cascades on High+, "critical" cascades only on Critical.
|
|
31
|
-
* Default: "off".
|
|
32
|
-
*/
|
|
33
|
-
cascadeOn?: 'off' | 'critical' | 'high' | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* Maximum cascade iterations (fix → re-review cycles) before the
|
|
36
|
-
* self-correcting loop stops. Prevents infinite cycles. Default: 2.
|
|
37
|
-
* 0 disables re-review (cascade agents investigate/fix once, no re-check).
|
|
38
|
-
*/
|
|
39
|
-
maxCascadeDepth?: number | undefined;
|
|
40
|
-
}
|
|
41
|
-
export interface ResolvedAutoReviewConfig {
|
|
42
|
-
enabled: boolean;
|
|
43
|
-
provider: string;
|
|
44
|
-
model: string;
|
|
45
|
-
fallbackModels: string[];
|
|
46
|
-
modelSelection: 'round-robin' | 'random';
|
|
47
|
-
debounceMs: number;
|
|
48
|
-
maxFilesPerBatch: number;
|
|
49
|
-
maxConcurrentReviews: number;
|
|
50
|
-
cascadeOn: 'off' | 'critical' | 'high';
|
|
51
|
-
maxCascadeDepth: number;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Evict the oldest fingerprint entries past the cap (Map insertion order =
|
|
55
|
-
* oldest first). Exported as a pure helper so the cap is unit-testable; the
|
|
56
|
-
* plugin applies it on every `knownFingerprints` write.
|
|
57
|
-
*/
|
|
58
|
-
export declare function trimKnownFingerprints(map: Map<string, string>, max: number): void;
|
|
59
|
-
/**
|
|
60
|
-
* Primary + fallback assignment for a single Chimera reviewer spawn.
|
|
61
|
-
* Produced by {@link selectRoundRobinReviewerAssignment} so concurrent
|
|
62
|
-
* reviewers start on different models and only share a provider after
|
|
63
|
-
* their own in-place retries are exhausted.
|
|
64
|
-
*/
|
|
65
|
-
export interface ReviewerModelAssignment {
|
|
66
|
-
provider: string;
|
|
67
|
-
model: string;
|
|
68
|
-
/** Remaining pool entries after the selected primary, wrap-around order. */
|
|
69
|
-
fallbackModels: string[];
|
|
70
|
-
/** Cursor to pass on the next spawn (`cursor + 1`). */
|
|
71
|
-
nextCursor: number;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Build the deduped provider/model pool a reviewer can start on.
|
|
75
|
-
*
|
|
76
|
-
* Order is stable: configured primary first, then the fallback chain.
|
|
77
|
-
* Entries must be `provider/model` (or parseable refs); bare blanks are dropped.
|
|
78
|
-
*
|
|
79
|
-
* When a {@link ProviderModelStatusTracker} is supplied, every entry that is
|
|
80
|
-
* currently `state: 'blocked'` (waiting-room / token-reset-limit room) is
|
|
81
|
-
* filtered out before the pool is returned. Without this filter, concurrent
|
|
82
|
-
* Chimera reviewers would re-spawn on a 429-stricken model on every round-
|
|
83
|
-
* robin turn and burn the entire chain instead of leaving the doomed model
|
|
84
|
-
* quarantined until the tracker re-admits it.
|
|
85
|
-
*/
|
|
86
|
-
export declare function buildReviewerModelPool(provider: string, model: string, fallbackModels?: readonly string[], statusTracker?: ProviderModelStatusTracker | undefined): string[];
|
|
87
|
-
/**
|
|
88
|
-
* Pick primary + fallback chain for the Nth concurrent reviewer via round-robin.
|
|
89
|
-
*
|
|
90
|
-
* Index `cursor % pool.length` becomes the primary; the rest of the pool is
|
|
91
|
-
* rotated so the former primary lands last (still available after rate limits).
|
|
92
|
-
* The pool must be pre-filtered by {@link buildReviewerModelPool} so every
|
|
93
|
-
* non-empty entry contains both a provider and a model.
|
|
94
|
-
*
|
|
95
|
-
* When a {@link ProviderModelStatusTracker} is supplied, the cursor advances
|
|
96
|
-
* over blocked entries too — a doomed entry is never picked as the primary,
|
|
97
|
-
* but the cursor saturates against the live pool so the next-after-blocked
|
|
98
|
-
* round inherits the rest of the unwalked chain instead of looping back to
|
|
99
|
-
* the head. Without the tracker, the cursor advances mod `pool.length`,
|
|
100
|
-
* which is the pre-waiting-room behavior.
|
|
101
|
-
* Pure: the caller owns the cursor (typically a process-local counter).
|
|
102
|
-
*/
|
|
103
|
-
export declare function selectRoundRobinReviewerAssignment(pool: readonly string[], cursor: number,
|
|
104
|
-
/** Used only when the selected ref is somehow unparseable — defensive. */
|
|
105
|
-
fallbackProvider?: string, fallbackModel?: string, statusTracker?: ProviderModelStatusTracker | undefined): ReviewerModelAssignment;
|
|
106
|
-
export declare function resolveAutoReviewConfig(cfg: AutoReviewConfig, sessionConfig: Config): ResolvedAutoReviewConfig;
|
|
107
|
-
export interface ParsedSeverities {
|
|
108
|
-
critical: number;
|
|
109
|
-
high: number;
|
|
110
|
-
medium: number;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Count verified findings into the severity shape `shouldCascade` expects.
|
|
114
|
-
* Used by the P0-2 cascade gate: only disk-verified findings count toward
|
|
115
|
-
* the cascade threshold when a parsed report is available.
|
|
116
|
-
*/
|
|
117
|
-
export declare function severitiesFromFindings(findings: readonly ChimeraFinding[]): ParsedSeverities;
|
|
118
|
-
/** Parse report counts for clean-vs-actionable classification. */
|
|
119
|
-
export declare function parseReviewSeverity(text: string): ParsedSeverities;
|
|
120
|
-
/**
|
|
121
|
-
* Decide which follow-up cascade agents to spawn based on the review.
|
|
122
|
-
*
|
|
123
|
-
* When structured, disk-verified findings are supplied (P0-1/P0-2), routing
|
|
124
|
-
* uses the finding's `category` tag: `security` selects security-scanner,
|
|
125
|
-
* and any High+ finding selects bug-hunter. The legacy keyword scan on the
|
|
126
|
-
* report text remains the fallback for reports without structured findings.
|
|
127
|
-
*
|
|
128
|
-
* Both agents may be returned in parallel when a finding is both severe and
|
|
129
|
-
* security-related.
|
|
130
|
-
*/
|
|
131
|
-
export declare function decideCascadeAgents(text: string, severities: ParsedSeverities, findings?: readonly ChimeraFinding[] | undefined): CascadeAgentKind[];
|
|
132
|
-
/**
|
|
133
|
-
* Determine whether a review result should trigger a cascade, given the
|
|
134
|
-
* configured threshold and parsed severities. Returns the crossed
|
|
135
|
-
* threshold, or `null` when the cascade should not fire.
|
|
136
|
-
*
|
|
137
|
-
* - `'high'` → fires on any High OR Critical finding
|
|
138
|
-
* - `'critical'` → fires only on Critical findings
|
|
139
|
-
* - `'off'` → never fires
|
|
140
|
-
*/
|
|
141
|
-
export declare function shouldCascade(cascadeOn: 'off' | 'critical' | 'high', severities: ParsedSeverities): 'high' | 'critical' | null;
|
|
2
|
+
import { type AutoReviewConfig, buildReviewerModelPool, decideCascadeAgents, parseReviewSeverity, resolveAutoReviewConfig, type ResolvedAutoReviewConfig, type ReviewerModelAssignment, selectRoundRobinReviewerAssignment, severitiesFromFindings, shouldCascade, trimKnownFingerprints } from './auto-review-config.js';
|
|
3
|
+
export { buildReviewerModelPool, decideCascadeAgents, parseReviewSeverity, resolveAutoReviewConfig, selectRoundRobinReviewerAssignment, severitiesFromFindings, shouldCascade, trimKnownFingerprints, type AutoReviewConfig, type ResolvedAutoReviewConfig, type ReviewerModelAssignment, };
|
|
142
4
|
export declare function createAutoReviewPlugin(): Plugin;
|
|
143
5
|
//# sourceMappingURL=auto-review-plugin.d.ts.map
|
|
@@ -27,6 +27,13 @@ export interface VerifyFindingsOptions {
|
|
|
27
27
|
*/
|
|
28
28
|
anchorWindow?: number | undefined;
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Extract all candidate code identifiers from finding text, prioritizing:
|
|
32
|
+
* 1. Identifiers inside backticks (explicit code mentions: `foo.bar()`, `varName`)
|
|
33
|
+
* 2. Code-like identifiers (camelCase, snake_case, $-suffixed)
|
|
34
|
+
* 3. Other meaningful non-stopword tokens (>= 3 chars)
|
|
35
|
+
*/
|
|
36
|
+
export declare function extractFindingAnchors(title: string, description: string, suggestedFix?: string): string[];
|
|
30
37
|
/**
|
|
31
38
|
* Extract the most distinctive code identifier from a finding's
|
|
32
39
|
* title + description. Prefers camelCase / snake_case / `$`-suffixed
|
package/dist/prompts/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { type JsonFetcher, PromptInstaller, type PromptInstallerOptions, type PromptPullResult, } from './prompt-installer.js';
|
|
2
2
|
export { PromptManifestStore } from './prompt-manifest-store.js';
|
|
3
|
+
export { ensureGitignore, getPromptJournalEntries, PROMPT_JOURNAL_RAW_MARKER, recordPromptJournalEntry, type PromptCategory, type PromptJournalEntry, type PromptJournalFilter, type RecordPromptOptions, } from './prompt-journal.js';
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|