@wrongstack/core 0.299.0 → 0.301.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.d.ts +2 -0
- package/dist/chronicle/index.js +297 -10
- package/dist/chronicle/project-server.js +253 -15
- package/dist/chronicle/sqlite-compaction.d.ts +20 -0
- package/dist/chronicle/sqlite-journal.d.ts +57 -0
- package/dist/coordination/agents/capability-manifest.d.ts +7 -0
- package/dist/coordination/agents/index.d.ts +3 -2
- package/dist/coordination/agents/index.js +818 -570
- package/dist/coordination/agents/project-agent-identity.d.ts +6 -6
- package/dist/coordination/agents/role-skills.d.ts +1 -1
- package/dist/coordination/agents/types.d.ts +6 -0
- package/dist/coordination/director.d.ts +10 -2
- package/dist/coordination/fleet-manager.d.ts +48 -3
- package/dist/coordination/ifleet-manager.d.ts +2 -0
- package/dist/coordination/index.js +6880 -6440
- package/dist/coordination/mail-tools.d.ts +3 -3
- package/dist/coordination/mailbox-project-server.js +3 -4
- package/dist/coordination/mailbox-types.d.ts +6 -0
- package/dist/coordination/multi-agent-coordinator.d.ts +1 -0
- package/dist/core/agent-response.d.ts +5 -1
- package/dist/core/agent-tools.d.ts +3 -0
- package/dist/core/context.d.ts +20 -0
- package/dist/core/fallback-model.d.ts +48 -0
- package/dist/core/index.d.ts +11 -9
- package/dist/core/index.js +1119 -310
- package/dist/core/instruction-template.d.ts +83 -0
- package/dist/core/next-steps-slot.d.ts +88 -0
- package/dist/core/system-prompt-blocks.d.ts +10 -1
- package/dist/core/system-prompt-builder.d.ts +40 -4
- package/dist/core/system-prompt-memory-skills.d.ts +1 -0
- package/dist/core/system-prompt-skill-bodies.d.ts +3 -3
- package/dist/defaults/index.js +9805 -8767
- package/dist/design/index.js +11 -3
- package/dist/execution/auto-compaction-middleware.d.ts +17 -0
- package/dist/execution/autonomy-brain.d.ts +15 -2
- package/dist/execution/brain-runtime.d.ts +3 -1
- package/dist/execution/compaction-core.d.ts +41 -2
- package/dist/execution/council-brain.d.ts +47 -1
- package/dist/execution/council-orchestrator.d.ts +25 -6
- package/dist/execution/council-prompts.d.ts +12 -1
- package/dist/execution/index.d.ts +11 -10
- package/dist/execution/index.js +10507 -9189
- package/dist/execution/tool-executor.d.ts +4 -1
- package/dist/execution/topic-shift-advisor.d.ts +53 -0
- package/dist/extension/index.js +8 -2
- package/dist/extension/registry.d.ts +8 -1
- package/dist/fleet-notifier.d.ts +9 -2
- package/dist/goal/index.js +11 -3
- package/dist/hooks/index.js +50 -13
- package/dist/hooks/runner.d.ts +12 -1
- package/dist/hq/index.js +59 -21
- package/dist/hq/protocol/fleet.d.ts +20 -0
- package/dist/hq/protocol.js +10 -0
- package/dist/hq/publisher.d.ts +21 -3
- package/dist/index.d.ts +22 -20
- package/dist/index.js +12211 -8572
- package/dist/infrastructure/index.js +108 -21
- package/dist/kernel/events/brain-events.d.ts +9 -0
- package/dist/kernel/events/provider-events.d.ts +42 -1
- package/dist/kernel/events/session-events.d.ts +13 -0
- package/dist/kernel/events/tool-events.d.ts +3 -3
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +18 -1
- package/dist/models/provider-credentials.d.ts +54 -0
- package/dist/plugin/api.d.ts +6 -0
- package/dist/plugin/config.d.ts +55 -0
- package/dist/plugin/index.d.ts +2 -1
- package/dist/plugin/index.js +2179 -544
- package/dist/plugins/auto-review-plugin.d.ts +3 -0
- package/dist/plugins/cloud-config-sync-plugin.d.ts +22 -0
- package/dist/plugins/review-claim-registry.d.ts +23 -8
- package/dist/plugins/review-types.d.ts +2 -0
- package/dist/registry/index.js +109 -74
- package/dist/registry/tool-registry.d.ts +15 -0
- package/dist/security/capabilities.d.ts +2 -0
- package/dist/security/index.d.ts +2 -2
- package/dist/security/index.js +166 -44
- package/dist/security/permission-helpers.d.ts +23 -6
- package/dist/security/permission-policy.d.ts +16 -0
- package/dist/security/readonly-permission-policy.d.ts +20 -0
- package/dist/security/totp.d.ts +14 -0
- package/dist/session-registry-atomic-file.d.ts +32 -5
- package/dist/skills/frontmatter.d.ts +6 -0
- package/dist/skills/index.js +22 -5
- package/dist/storage/cloud-config-sync/sanitize.d.ts +54 -0
- package/dist/storage/cloud-config-sync.d.ts +87 -0
- package/dist/storage/director-state.d.ts +7 -0
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.js +887 -74
- package/dist/tools/fallback-system-config-view-tool.d.ts +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +898 -335
- package/dist/tools/one-shot-llm-tool.d.ts +1 -0
- package/dist/tools/plugin-manager.d.ts +27 -0
- package/dist/types/config/mcp-features.d.ts +18 -11
- package/dist/types/config/root.d.ts +8 -1
- package/dist/types/config/runtime.d.ts +20 -6
- package/dist/types/config/skills-fleet-brain.d.ts +12 -4
- package/dist/types/config/tools.d.ts +16 -0
- package/dist/types/context-window.d.ts +1 -0
- package/dist/types/council.d.ts +11 -0
- package/dist/types/hooks.d.ts +14 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.js +1 -0
- package/dist/types/multi-agent.d.ts +12 -0
- package/dist/types/one-shot-llm.d.ts +25 -0
- package/dist/types/plugin.d.ts +28 -0
- package/dist/types/provider.d.ts +16 -0
- package/dist/types/runtime-capability-manifest.d.ts +168 -0
- package/dist/types/skill.d.ts +5 -0
- package/dist/types/system-prompt.d.ts +3 -1
- package/dist/types/tool-executor.d.ts +8 -1
- package/dist/utils/context-breakdown.d.ts +8 -2
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +141 -31
- package/dist/utils/regex-guard.d.ts +16 -2
- package/dist/utils/sage-output-block.d.ts +7 -10
- package/dist/utils/wstack-paths.d.ts +11 -3
- package/dist/worktree/index.js +4 -4
- package/instructions/agents/browser.md +1 -4
- package/instructions/agents/e2e.md +17 -15
- package/instructions/agents/ios.md +3 -3
- package/instructions/agents/search.md +1 -1
- package/instructions/autonomy/goal-preamble.md +4 -4
- package/instructions/coordination/director-preamble.md +2 -3
- package/instructions/coordination/subagent-baseline.md +3 -1
- package/instructions/leader-after-task.md +12 -0
- package/instructions/llm/chimera-review.md +1 -1
- package/instructions/modes/audit-lite.md +1 -1
- package/instructions/sections/tool/common-patterns.md +18 -2
- package/instructions/sections/tool/mailbox-compact.md +1 -1
- package/instructions/sections/tool/mailbox-full.md +1 -1
- package/instructions/system-lite.md +91 -3
- package/instructions/system-pro.md +296 -102
- package/instructions/system.md +248 -92
- package/package.json +3 -3
- package/skills/api-design/SKILL.md +3 -0
- package/skills/audit-log/SKILL.md +2 -0
- package/skills/auto-review/SKILL.md +6 -1
- package/skills/bug-hunter/SKILL.md +4 -1
- package/skills/chimera/SKILL.md +3 -0
- package/skills/data-governance/SKILL.md +3 -0
- package/skills/design-system/SKILL.md +5 -2
- package/skills/docker-deploy/SKILL.md +2 -0
- package/skills/git-flow/SKILL.md +2 -0
- package/skills/mailbox-bridge/SKILL.md +3 -0
- package/skills/mnemosyne/SKILL.md +2 -0
- package/skills/multi-agent/SKILL.md +4 -1
- package/skills/node-modern/SKILL.md +4 -1
- package/skills/observability/SKILL.md +3 -0
- package/skills/output-standards/SKILL.md +2 -0
- package/skills/plugin-author/SKILL.md +4 -1
- package/skills/prompt-engineering/SKILL.md +3 -1
- package/skills/react-modern/SKILL.md +6 -3
- package/skills/refactor-planner/SKILL.md +2 -0
- package/skills/research-web/SKILL.md +3 -0
- package/skills/sdd/SKILL.md +3 -1
- package/skills/security-scanner/SKILL.md +3 -0
- package/skills/skill-creator/SKILL.md +2 -0
- package/skills/tech-stack/SKILL.md +3 -0
- package/skills/testing/SKILL.md +4 -1
- package/skills/typescript-strict/SKILL.md +4 -1
- package/skills/wrongstack-kanban/SKILL.md +6 -3
- package/skills/wrongstack-mailbox/SKILL.md +4 -1
- package/skills/wrongstack-mailbox-mcp/SKILL.md +10 -8
|
@@ -19,19 +19,19 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { existsSync } from 'node:fs';
|
|
21
21
|
import type { SubagentConfig } from '../../types/multi-agent.js';
|
|
22
|
+
import { type ConsolidationMetadata } from './project-agent-consolidation.js';
|
|
23
|
+
import type { LearnedCaptureResult, ProjectAgentConfig, RoleKnowledgeManifest } from './project-agent-identity-types.js';
|
|
22
24
|
import { type ProjectAgentLearningPolicy } from './project-agent-learning-policy.js';
|
|
23
25
|
import { type StructuredLearnedEntry } from './project-agent-learning-structured.js';
|
|
24
|
-
import type { LearnedCaptureResult, ProjectAgentConfig, RoleKnowledgeManifest } from './project-agent-identity-types.js';
|
|
25
|
-
import { type ConsolidationMetadata } from './project-agent-consolidation.js';
|
|
26
26
|
export { validateProjectAgentConfig } from './project-agent-config-validation.js';
|
|
27
|
+
export { buildConsolidationInstruction, type ConsolidationMetadata, clearProjectAgentConsolidated, isConsolidated, loadConsolidationMetadata, loadProjectAgentConsolidated, saveProjectAgentConsolidated, } from './project-agent-consolidation.js';
|
|
28
|
+
export type { CreateProjectAgentInput, LearnedCaptureResult, ProjectAgentConfig, ProjectAgentProfile, RoleKnowledgeManifest, } from './project-agent-identity-types.js';
|
|
27
29
|
export { classifyLearnedEntry, LEARNED_ENTRY_MAX_CHARS, LEARNED_HARD_LIMIT, LEARNED_SOFT_LIMIT, type LearnedEntryCategory, normalizeLearnedEntry, } from './project-agent-learning-normalize.js';
|
|
28
|
-
export { decomposeLearnedEntry, mergeStructuredEntries, parseLearnedEntryStamp, renderLearnedInstructions, type StructuredLearnedEntry, } from './project-agent-learning-structured.js';
|
|
29
30
|
export { loadProjectAgentLearningPolicy, type ProjectAgentLearningPolicy, updateProjectAgentLearningPolicy, } from './project-agent-learning-policy.js';
|
|
31
|
+
export { decomposeLearnedEntry, mergeStructuredEntries, parseLearnedEntryStamp, renderLearnedInstructions, type StructuredLearnedEntry, } from './project-agent-learning-structured.js';
|
|
30
32
|
export { assertProjectAgentRole } from './project-agent-paths.js';
|
|
31
|
-
export { buildConsolidationInstruction, clearProjectAgentConsolidated, isConsolidated, loadConsolidationMetadata, loadProjectAgentConsolidated, saveProjectAgentConsolidated, type ConsolidationMetadata, } from './project-agent-consolidation.js';
|
|
32
|
-
export type { CreateProjectAgentInput, LearnedCaptureResult, ProjectAgentConfig, ProjectAgentProfile, RoleKnowledgeManifest, } from './project-agent-identity-types.js';
|
|
33
|
-
export { createProjectAgent, loadProjectAgentProfile, slugifyProjectAgentRole, } from './project-agent-profile.js';
|
|
34
33
|
export { listProjectAgentRoles, refreshProjectAgentIdentity, resetProjectAgentIdentity, updateProjectAgentConfig, updateProjectAgentIdentity, updateProjectAgentKnowledge, updateProjectAgentLearned, } from './project-agent-files.js';
|
|
34
|
+
export { createProjectAgent, loadProjectAgentProfile, slugifyProjectAgentRole, } from './project-agent-profile.js';
|
|
35
35
|
/**
|
|
36
36
|
* Live roster overlay. Project policy is resolved lazily for both built-in and
|
|
37
37
|
* project-created roles, so WebUI changes take effect on the next spawn without
|
|
@@ -97,6 +97,6 @@ export declare const ROLE_SKILL_SETS: {
|
|
|
97
97
|
export type CatalogRoleWithSkills = keyof typeof ROLE_SKILL_SETS;
|
|
98
98
|
/** Standalone operational role that lives outside the phase catalog. */
|
|
99
99
|
export declare const SHADOW_AGENT_SKILLS: ("api-design" | "audit-log" | "bug-hunter" | "chimera" | "data-governance" | "docker-deploy" | "git-flow" | "mnemosyne" | "multi-agent" | "node-modern" | "observability" | "output-standards" | "plugin-author" | "prompt-engineering" | "react-modern" | "refactor-planner" | "research-web" | "sdd" | "security-scanner" | "skill-creator" | "tech-stack" | "testing" | "typescript-strict" | "wrongstack-mailbox")[];
|
|
100
|
-
/** Attach a fresh skill-name array so catalog templates remain mutation-safe. */
|
|
100
|
+
/** Attach a bounded, fresh skill-name array so catalog templates remain mutation-safe. */
|
|
101
101
|
export declare function assignSkillsToAgents(definitions: readonly AgentDefinition[]): AgentDefinition[];
|
|
102
102
|
//# sourceMappingURL=role-skills.d.ts.map
|
|
@@ -100,4 +100,10 @@ export declare const TOOLS: {
|
|
|
100
100
|
/** Web research. */
|
|
101
101
|
readonly research: readonly ["read", "grep", "glob", "search", "fetch", "mailbox"];
|
|
102
102
|
};
|
|
103
|
+
/** Canonical optional tool packs used by specialist roster roles. */
|
|
104
|
+
export declare const SPECIALIST_TOOLS: {
|
|
105
|
+
readonly browser: string[];
|
|
106
|
+
readonly memory: string[];
|
|
107
|
+
readonly mcp: string[];
|
|
108
|
+
};
|
|
103
109
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -5,6 +5,7 @@ import type { Tool } from '../types/tool.js';
|
|
|
5
5
|
import { InMemoryAgentBridge } from './agent-bridge.js';
|
|
6
6
|
import type { CollabDebugReport, CollabSessionOptions } from './collab-debug.js';
|
|
7
7
|
import type { DirectorOptions } from './director-options.js';
|
|
8
|
+
import { type DirectorSubagentSessionSummary } from './director-session.js';
|
|
8
9
|
import { FleetBus, type FleetUsage, FleetUsageAggregator } from './fleet-bus.js';
|
|
9
10
|
import type { FleetManager } from './fleet-manager.js';
|
|
10
11
|
import { type DirectorFleetHost } from './fleet-spawn.js';
|
|
@@ -14,10 +15,9 @@ import { LargeAnswerStore } from './large-answer-store.js';
|
|
|
14
15
|
import type { ModelMatrixSource } from './model-matrix.js';
|
|
15
16
|
import { DefaultMultiAgentCoordinator } from './multi-agent-coordinator.js';
|
|
16
17
|
import { type WorktreeTaskStateUpdate } from './worktree-task-runner.js';
|
|
17
|
-
import { type DirectorSubagentSessionSummary } from './director-session.js';
|
|
18
18
|
export { FleetContextOverflowError, FleetCostCapError, FleetSpawnBudgetError, FleetTokenCapError, } from './director/director-errors.js';
|
|
19
|
-
export type { ModelMatrixSource } from './model-matrix.js';
|
|
20
19
|
export type { DirectorOptions, TaskResultNotification } from './director-options.js';
|
|
20
|
+
export type { ModelMatrixSource } from './model-matrix.js';
|
|
21
21
|
export declare class Director implements DirectorFleetHost, ICoordinator {
|
|
22
22
|
private static _asManifestEntry;
|
|
23
23
|
get coordinatorId(): string;
|
|
@@ -149,5 +149,13 @@ export declare class Director implements DirectorFleetHost, ICoordinator {
|
|
|
149
149
|
acquireCheckpointLock(): Promise<boolean>;
|
|
150
150
|
spawnCollab(options: CollabSessionOptions): Promise<CollabDebugReport>;
|
|
151
151
|
resumeFromCheckpoint(snapshot: DirectorStateSnapshot): void;
|
|
152
|
+
/**
|
|
153
|
+
* After re-attaching checkpoint metadata, pin the live maxSpawns ceiling
|
|
154
|
+
* (profile/flag/env wins over historical checkpoint metadata). The
|
|
155
|
+
* historical cumulative spawn counter is deliberately NOT restored — the
|
|
156
|
+
* lifetime budget is scoped to this director run, so a restarted session
|
|
157
|
+
* resumes with a fresh budget rather than a possibly-exhausted counter.
|
|
158
|
+
*/
|
|
159
|
+
private applyResumeBudget;
|
|
152
160
|
}
|
|
153
161
|
//# sourceMappingURL=director.d.ts.map
|
|
@@ -72,6 +72,14 @@ export declare class FleetManager implements IFleetManager {
|
|
|
72
72
|
readonly spawnDepth: number;
|
|
73
73
|
/** Live spawn counter. */
|
|
74
74
|
private spawnCount;
|
|
75
|
+
/**
|
|
76
|
+
* Historical `maxSpawns` from the last restored checkpoint (set for any
|
|
77
|
+
* finite checkpoint ceiling, matching or not). Surfaced in
|
|
78
|
+
* `budgetSnapshot()` so operators can see resume reconciliation without
|
|
79
|
+
* reading the JSON file; `ceilingMismatch` carries the actual mismatch signal.
|
|
80
|
+
*/
|
|
81
|
+
private checkpointMaxSpawnsAtResume;
|
|
82
|
+
private ceilingMismatchAtResume;
|
|
75
83
|
private readonly stateCheckpoint;
|
|
76
84
|
private readonly sessionWriter;
|
|
77
85
|
private manifestTimer;
|
|
@@ -129,7 +137,7 @@ export declare class FleetManager implements IFleetManager {
|
|
|
129
137
|
* which cap was exceeded. Does NOT throw — the caller decides
|
|
130
138
|
* how to surface the rejection.
|
|
131
139
|
*/
|
|
132
|
-
canSpawn(
|
|
140
|
+
canSpawn(config: SubagentConfig): {
|
|
133
141
|
kind: 'max_spawns' | 'max_spawn_depth' | 'max_cost_usd' | 'max_tokens' | 'max_context_load';
|
|
134
142
|
limit: number;
|
|
135
143
|
observed: number;
|
|
@@ -144,6 +152,41 @@ export declare class FleetManager implements IFleetManager {
|
|
|
144
152
|
maxCostUsd: number;
|
|
145
153
|
usedCostUsd: number;
|
|
146
154
|
remainingCostUsd: number;
|
|
155
|
+
/** Historical ceiling from the last restored checkpoint, when it differs. */
|
|
156
|
+
checkpointMaxSpawns?: number | undefined;
|
|
157
|
+
/** True when checkpoint metadata and the live ceiling disagree. */
|
|
158
|
+
ceilingMismatch?: boolean | undefined;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Re-attach the on-disk checkpoint after a resume while keeping the live
|
|
162
|
+
* `maxSpawns` ceiling from construction (profile / flag / env). The
|
|
163
|
+
* historical `spawnCount` is deliberately NOT restored: the lifetime
|
|
164
|
+
* budget is scoped to this director run, so a restarted session gets a
|
|
165
|
+
* fresh budget instead of inheriting a (possibly exhausted) counter from
|
|
166
|
+
* before the restart. The checkpoint ceiling is rewritten to the live
|
|
167
|
+
* value so subsequent writes do not reintroduce a stale limit.
|
|
168
|
+
*/
|
|
169
|
+
restoreFromCheckpoint(snapshot: {
|
|
170
|
+
spawnCount: number;
|
|
171
|
+
maxSpawns?: number | undefined;
|
|
172
|
+
version?: 1 | undefined;
|
|
173
|
+
directorRunId?: string | undefined;
|
|
174
|
+
updatedAt?: string | undefined;
|
|
175
|
+
spawnDepth?: number | undefined;
|
|
176
|
+
maxSpawnDepth?: number | undefined;
|
|
177
|
+
directorBudget?: {
|
|
178
|
+
maxCostUsd?: number | undefined;
|
|
179
|
+
maxTokens?: number | undefined;
|
|
180
|
+
} | undefined;
|
|
181
|
+
subagents?: unknown[] | undefined;
|
|
182
|
+
tasks?: unknown[] | undefined;
|
|
183
|
+
usage?: unknown | undefined;
|
|
184
|
+
}): {
|
|
185
|
+
usedSpawns: number;
|
|
186
|
+
maxSpawns: number;
|
|
187
|
+
remainingSpawns: number;
|
|
188
|
+
checkpointMaxSpawns?: number | undefined;
|
|
189
|
+
ceilingMismatch: boolean;
|
|
147
190
|
};
|
|
148
191
|
setLeaderContextPressure(tokens: number): void;
|
|
149
192
|
/** Test-only accessor: number of entries in the private subagent-meta map. */
|
|
@@ -175,8 +218,10 @@ export declare class FleetManager implements IFleetManager {
|
|
|
175
218
|
*/
|
|
176
219
|
get usedNicknames(): ReadonlySet<string>;
|
|
177
220
|
/**
|
|
178
|
-
* Records a spawn:
|
|
179
|
-
*
|
|
221
|
+
* Records a spawn: stores metadata, updates state checkpoint, and schedules
|
|
222
|
+
* a debounced manifest write. Increments the lifetime spawn counter UNLESS
|
|
223
|
+
* the config is `spawnBudgetExempt` (ephemeral Chimera reviewer/cascade
|
|
224
|
+
* spawns do not consume the leader's budget). Call AFTER the coordinator
|
|
180
225
|
* has successfully spawned the subagent.
|
|
181
226
|
*
|
|
182
227
|
* @param subagentId The subagent's id (from coordinator.spawn result)
|
|
@@ -52,6 +52,8 @@ export interface IFleetManager {
|
|
|
52
52
|
maxCostUsd: number;
|
|
53
53
|
usedCostUsd: number;
|
|
54
54
|
remainingCostUsd: number;
|
|
55
|
+
checkpointMaxSpawns?: number | undefined;
|
|
56
|
+
ceilingMismatch?: boolean | undefined;
|
|
55
57
|
}) | undefined;
|
|
56
58
|
/**
|
|
57
59
|
* Update the leader agent's current context pressure (tokens used in the
|