@wrongstack/core 0.306.3 → 0.307.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/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 +1738 -1690
- 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/index.js +6103 -5890
- 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/conversation-state.d.ts +1 -2
- package/dist/core/fallback-doctor.d.ts +72 -0
- package/dist/core/fallback-model.d.ts +19 -1
- package/dist/core/fallback-profile-manager.d.ts +21 -3
- package/dist/core/index.d.ts +2 -1
- package/dist/core/index.js +1143 -766
- package/dist/defaults/index.js +3833 -3595
- package/dist/execution/auto-compaction-middleware.d.ts +64 -0
- 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 -166
- 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.d.ts +1 -1
- package/dist/execution/index.js +10016 -9903
- package/dist/execution/prompt-enhancer.js +11 -3
- package/dist/execution/retry-policy.d.ts +27 -0
- 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 +58 -17
- package/dist/index.d.ts +2 -1
- package/dist/index.js +8731 -7756
- package/dist/infrastructure/index.js +24 -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 +2123 -1918
- 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/prompt-journal.d.ts +94 -0
- package/dist/security/index.js +677 -667
- 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 +270 -227
- package/dist/session-catalog/project-server.js +277 -234
- 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/cloud-config-sync/sanitize.d.ts +18 -0
- package/dist/storage/cloud-config-sync.d.ts +1 -1
- 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 +2121 -1736
- package/dist/storage/orphan-lock-cleaner.d.ts +15 -0
- package/dist/storage/provider-config-watcher.d.ts +9 -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/strict-empty-check.d.ts +7 -0
- package/dist/storage/session-store.d.ts +2 -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.d.ts +1 -1
- package/dist/tools/index.js +5150 -5090
- package/dist/types/config/root.d.ts +21 -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/types/session.d.ts +7 -0
- package/dist/worktree/worktree-manager.d.ts +1 -1
- package/instructions/coordination/subagent-baseline.md +2 -2
- package/instructions/llm/prompt-enhancer.md +2 -1
- package/instructions/sections/tool/common-patterns.md +21 -0
- package/instructions/sections/tool/delegation-compact.md +3 -1
- package/instructions/sections/tool/delegation-full.md +5 -1
- package/instructions/system-lite.md +28 -3
- package/instructions/system-pro.md +37 -8
- package/instructions/system.md +4 -2
- package/package.json +5 -5
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import type { FallbackProfileManager } from '../core/fallback-profile-manager.js';
|
|
2
2
|
import type { Config } from '../types/config.js';
|
|
3
3
|
import type { CouncilLLMCaller, CouncilQuestion, CouncilResult } from '../types/council.js';
|
|
4
|
+
import { COUNCIL_REFUSAL_OPTION_ID, DEFAULT_COUNCIL_MAX_CONCURRENCY, MAX_COUNCIL_CONCURRENCY } from './council-orchestrator-helpers.js';
|
|
4
5
|
import { type CouncilPersonaRegistry } from './council-personas.js';
|
|
5
6
|
import { type CouncilProfileRegistry } from './council-profiles.js';
|
|
6
|
-
|
|
7
|
-
export declare const COUNCIL_REFUSAL_OPTION_ID = "council_refuse";
|
|
8
|
-
export declare const DEFAULT_COUNCIL_MAX_CONCURRENCY = 3;
|
|
9
|
-
export declare const MAX_COUNCIL_CONCURRENCY = 8;
|
|
7
|
+
export { COUNCIL_REFUSAL_OPTION_ID, DEFAULT_COUNCIL_MAX_CONCURRENCY, MAX_COUNCIL_CONCURRENCY, };
|
|
10
8
|
export interface CouncilOrchestratorOptions {
|
|
11
9
|
/**
|
|
12
10
|
* Shared LLM caller used for every seat and the judge when no per-seat
|
|
13
|
-
* caller is configured.
|
|
14
|
-
* and/or `judgeCaller` (separate judge caller) to route votes to different
|
|
15
|
-
* providers. At least one of `caller`, `seatCaller`, or `judgeCaller`
|
|
16
|
-
* must be provided; the constructor throws otherwise.
|
|
11
|
+
* caller is configured.
|
|
17
12
|
*/
|
|
18
13
|
caller?: CouncilLLMCaller | undefined;
|
|
19
14
|
personas?: CouncilPersonaRegistry | undefined;
|
|
@@ -21,25 +16,9 @@ export interface CouncilOrchestratorOptions {
|
|
|
21
16
|
defaultProfile?: string | undefined;
|
|
22
17
|
maxConcurrency?: number | undefined;
|
|
23
18
|
refusalOptionId?: string | undefined;
|
|
24
|
-
/** Live config accessor for fallback profile resolution. */
|
|
25
19
|
getConfig?: (() => Config) | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* Shared live FallbackProfileManager — required for reliable fallback
|
|
28
|
-
* profile pre-resolution. Pass the runtime container's manager.
|
|
29
|
-
*/
|
|
30
20
|
fallbackProfileManager?: FallbackProfileManager | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* Per-seat LLM caller factory. When set, each seat gets its own caller
|
|
33
|
-
* instead of the shared `caller`. The factory receives (seatIndex) and
|
|
34
|
-
* returns a CouncilLLMCaller. Used by Brain council arbitration where
|
|
35
|
-
* each voter has its own Provider instance.
|
|
36
|
-
*/
|
|
37
21
|
seatCaller?: ((seatIndex: number) => CouncilLLMCaller) | undefined;
|
|
38
|
-
/**
|
|
39
|
-
* Separate caller for the judge seat. Required when `seatCaller` is set
|
|
40
|
-
* because the judge uses the shared caller path. When absent and
|
|
41
|
-
* `seatCaller` is set, the judge falls back to `seatCaller(0)`.
|
|
42
|
-
*/
|
|
43
22
|
judgeCaller?: CouncilLLMCaller | undefined;
|
|
44
23
|
}
|
|
45
24
|
/** Provider-neutral Council runner backed by an injected one-shot LLM caller. */
|
|
@@ -54,32 +33,14 @@ export declare class CouncilOrchestrator {
|
|
|
54
33
|
private readonly seatCaller;
|
|
55
34
|
private readonly judgeCaller;
|
|
56
35
|
constructor(opts: CouncilOrchestratorOptions);
|
|
57
|
-
/**
|
|
58
|
-
* Resolve the effective profile for a question. String ids and the default
|
|
59
|
-
* go through the registry (already O(1)); ad-hoc config objects are
|
|
60
|
-
* normalized on each call. Callers are allowed to reuse and mutate an
|
|
61
|
-
* ad-hoc object between decisions, so object-identity caching would serve a
|
|
62
|
-
* stale snapshot.
|
|
63
|
-
*/
|
|
64
36
|
private resolveProfile;
|
|
65
37
|
ask(question: CouncilQuestion): Promise<CouncilResult>;
|
|
66
38
|
private callSeat;
|
|
67
39
|
private resolveOptionQuestion;
|
|
68
40
|
private resolveOpenQuestion;
|
|
69
41
|
private callJudge;
|
|
70
|
-
/**
|
|
71
|
-
* Resolve the effective LLM caller for a call. Voter seats (defined
|
|
72
|
-
* seatIndex) use `seatCaller(seatIndex)` when wired, otherwise the shared
|
|
73
|
-
* `caller` — a seat never falls through to the judge caller. Judge seats
|
|
74
|
-
* (seatIndex undefined) use `judgeCaller` if set, otherwise `seatCaller(0)`
|
|
75
|
-
* if set, otherwise the shared `caller`.
|
|
76
|
-
*/
|
|
77
42
|
private resolveCaller;
|
|
78
43
|
private safeCall;
|
|
79
|
-
/**
|
|
80
|
-
* Resolve a CouncilModelTarget: pre-resolve fallbackProfile to fallbackModels
|
|
81
|
-
* so the downstream caller only sees the resolved chain.
|
|
82
|
-
*/
|
|
83
44
|
private resolveCouncilTarget;
|
|
84
45
|
}
|
|
85
46
|
//# sourceMappingURL=council-orchestrator.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { CouncilQuestion, CouncilVoteResult } from '../types/council.js';
|
|
2
|
+
import type { OneShotLLMResult } from '../types/one-shot-llm.js';
|
|
3
|
+
export interface ParsedVote {
|
|
4
|
+
optionId?: string | undefined;
|
|
5
|
+
stance?: string | undefined;
|
|
6
|
+
rationale?: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
export interface ParsedJudge {
|
|
9
|
+
optionId?: string | undefined;
|
|
10
|
+
answer?: string | undefined;
|
|
11
|
+
rationale?: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface ParsedCouncilResponse {
|
|
14
|
+
optionId?: string | undefined;
|
|
15
|
+
stance?: string | undefined;
|
|
16
|
+
answer?: string | undefined;
|
|
17
|
+
rationale?: string | undefined;
|
|
18
|
+
}
|
|
19
|
+
export declare function parseObject(text: string): {
|
|
20
|
+
ok: true;
|
|
21
|
+
value: Record<string, unknown>;
|
|
22
|
+
} | {
|
|
23
|
+
ok: false;
|
|
24
|
+
error: string;
|
|
25
|
+
};
|
|
26
|
+
export declare function optionalString(value: unknown): string | undefined;
|
|
27
|
+
export declare function errorMessage(error: unknown): string;
|
|
28
|
+
export declare function parseCouncilResponse(text: string, question: CouncilQuestion, refusalOptionId: string, opts: {
|
|
29
|
+
role: 'voter' | 'judge';
|
|
30
|
+
freeTextField: 'stance' | 'answer';
|
|
31
|
+
}): {
|
|
32
|
+
ok: true;
|
|
33
|
+
value: ParsedCouncilResponse;
|
|
34
|
+
} | {
|
|
35
|
+
ok: false;
|
|
36
|
+
error: string;
|
|
37
|
+
};
|
|
38
|
+
export declare function divergentStances(valid: readonly (CouncilVoteResult & {
|
|
39
|
+
stance: string;
|
|
40
|
+
})[]): boolean;
|
|
41
|
+
export declare function parseVote(text: string, question: CouncilQuestion, refusalOptionId: string): {
|
|
42
|
+
ok: true;
|
|
43
|
+
vote: ParsedVote;
|
|
44
|
+
} | {
|
|
45
|
+
ok: false;
|
|
46
|
+
error: string;
|
|
47
|
+
};
|
|
48
|
+
export declare function parseJudge(text: string, question: CouncilQuestion, refusalOptionId: string): {
|
|
49
|
+
ok: true;
|
|
50
|
+
value: ParsedJudge;
|
|
51
|
+
} | {
|
|
52
|
+
ok: false;
|
|
53
|
+
error: string;
|
|
54
|
+
};
|
|
55
|
+
export declare function withTruncationNote(error: string, result: OneShotLLMResult, maxTokens: number): string;
|
|
56
|
+
//# sourceMappingURL=council-response-parser.d.ts.map
|
|
@@ -25,7 +25,7 @@ export { OneShotOrchestrator } from './one-shot-llm.js';
|
|
|
25
25
|
export { type ParallelEngineState, ParallelEternalEngine, type ParallelEternalOptions, type ParallelIterationStage, } from './parallel-eternal-engine.js';
|
|
26
26
|
export { buildRefinerContextSections, DEFAULT_REFINER_RETRY_FEEDBACK, type EnhanceFailureKind, enhanceUserPrompt, gatedEnhancerReasoning, isValidEnglishRefinement, normalizedEqual, parseBilingualEnhancement, recentTextTurns, shouldEnhance, } from './prompt-enhancer.js';
|
|
27
27
|
export { DefaultPromptLoader, type PromptLoaderOptions, renderPrompt } from './prompt-loader.js';
|
|
28
|
-
export { DefaultRetryPolicy } from './retry-policy.js';
|
|
28
|
+
export { DefaultRetryPolicy, MODEL_RETRIES } from './retry-policy.js';
|
|
29
29
|
export { SelectiveCompactor, type SelectiveCompactorOptions } from './selective-compactor.js';
|
|
30
30
|
export { DefaultSkillLoader, type SkillLoaderOptions } from './skill-loader.js';
|
|
31
31
|
export { type CompactorStrategy, createStrategyCompactor, type StrategyCompactorOptions, } from './strategy-compactor.js';
|