@wrongstack/core 0.302.2 → 0.305.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/README.md +1 -1
- package/dist/chronicle/index.js +117 -30
- package/dist/chronicle/project-server.js +12 -5
- package/dist/coordination/agents/index.js +4645 -3448
- package/dist/coordination/agents/project-agent-auto-optimize.d.ts +116 -0
- package/dist/coordination/agents/project-agent-capture-window.d.ts +29 -0
- package/dist/coordination/agents/project-agent-config-io.d.ts +11 -0
- package/dist/coordination/agents/project-agent-consolidation.d.ts +34 -2
- package/dist/coordination/agents/project-agent-directive-outcome.d.ts +57 -0
- package/dist/coordination/agents/project-agent-files.d.ts +12 -3
- package/dist/coordination/agents/project-agent-identity-types.d.ts +4 -0
- package/dist/coordination/agents/project-agent-identity.d.ts +38 -11
- package/dist/coordination/agents/project-agent-learning-entries.d.ts +8 -2
- package/dist/coordination/agents/project-agent-learning-policy.d.ts +22 -1
- package/dist/coordination/agents/project-agent-learning-structured.d.ts +72 -1
- package/dist/coordination/agents/project-agent-optimizer.d.ts +49 -0
- package/dist/coordination/agents/project-agent-quarantine.d.ts +63 -0
- package/dist/coordination/agents/project-agent-skill-layer.d.ts +146 -0
- package/dist/coordination/agents/role-skills.d.ts +11 -1
- package/dist/coordination/agents/types.d.ts +10 -2
- package/dist/coordination/director-prompts.d.ts +19 -6
- package/dist/coordination/director-tools.d.ts +2 -2
- package/dist/coordination/fleet.d.ts +0 -6
- package/dist/coordination/index.d.ts +1 -1
- package/dist/coordination/index.js +5746 -4326
- package/dist/coordination/mail-tools.d.ts +1 -1
- package/dist/core/agent-types.d.ts +4 -2
- package/dist/core/agent.d.ts +1 -0
- package/dist/core/context.d.ts +19 -0
- package/dist/core/conversation-state.d.ts +14 -0
- package/dist/core/fallback-profile-manager.d.ts +70 -2
- package/dist/core/index.js +317 -108
- package/dist/core/system-prompt-blocks.d.ts +1 -1
- package/dist/core/system-prompt-builder.d.ts +13 -1
- package/dist/core/system-prompt-glossary.d.ts +73 -0
- package/dist/core/system-prompt-memory-skills.d.ts +2 -2
- package/dist/defaults/index.js +1635 -1120
- package/dist/execution/council-orchestrator.d.ts +3 -13
- package/dist/execution/index.js +3136 -2706
- package/dist/execution/one-shot-llm.d.ts +5 -0
- package/dist/goal/index.js +7 -0
- package/dist/hq/index.js +17 -7
- package/dist/hq/protocol/kanban.d.ts +21 -0
- package/dist/hq/protocol.js +5 -1
- package/dist/hq/redaction.d.ts +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5502 -3483
- package/dist/infrastructure/index.js +247 -122
- package/dist/kernel/events/agent-events.d.ts +28 -0
- package/dist/plugin/index.js +111 -7
- package/dist/registry/index.js +11 -0
- package/dist/registry/tool-registry.d.ts +8 -0
- package/dist/replay/hash.d.ts +9 -0
- package/dist/replay/index.js +14 -4
- package/dist/replay/replay-provider-runner.d.ts +31 -1
- package/dist/security/index.js +92 -21
- package/dist/security/kanban-boundary.d.ts +5 -1
- package/dist/security/secret-vault.d.ts +2 -0
- package/dist/session-catalog/index.js +86 -10
- package/dist/session-catalog/project-server.js +100 -17
- package/dist/session-catalog/protocol.d.ts +20 -4
- package/dist/session-catalog/store.d.ts +19 -3
- package/dist/storage/index.js +305 -69
- package/dist/storage/memory-consolidator.d.ts +4 -2
- package/dist/storage/plan-store.d.ts +1 -1
- package/dist/storage/session-resume-validation.d.ts +24 -0
- package/dist/storage/session-store/directory-scan.d.ts +5 -1
- package/dist/storage/session-store/fork-session.d.ts +13 -1
- package/dist/storage/session-store/load-cache.d.ts +11 -0
- package/dist/storage/session-store/prune-helpers.d.ts +5 -0
- package/dist/storage/session-store.d.ts +18 -0
- package/dist/tasking/index.js +5 -0
- package/dist/tools/index.js +1151 -831
- package/dist/types/config/mcp-features.d.ts +31 -1
- package/dist/types/config/root.d.ts +23 -1
- package/dist/types/config/skills-fleet-brain.d.ts +34 -0
- package/dist/types/config/tools.d.ts +22 -0
- package/dist/types/config/ui.d.ts +14 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/default-config.d.ts +1 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +23 -0
- package/dist/types/multi-agent.d.ts +7 -0
- package/dist/types/session.d.ts +9 -1
- package/dist/types/task-graph.d.ts +2 -0
- package/dist/types/tool-executor.d.ts +2 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +217 -76
- package/dist/utils/project-state-guard.d.ts +21 -0
- package/dist/utils/session-scoped-path.d.ts +17 -0
- package/dist/utils/todos-format.d.ts +20 -0
- package/instructions/leader-after-task.md +3 -4
- package/instructions/system-lite.md +17 -14
- package/instructions/system-pro.md +29 -30
- package/instructions/system.md +29 -28
- package/package.json +3 -3
- package/skills/wrongstack-kanban/SKILL.md +95 -93
|
@@ -9,7 +9,7 @@ import type { Provider } from '../types/provider.js';
|
|
|
9
9
|
* rememberSage rather than the legacy MemoryStore.remember(),
|
|
10
10
|
* making them visible to searchSage/turn-middleware.
|
|
11
11
|
*/
|
|
12
|
-
type ConsolidatorSageKind = 'fact' | 'decision' | 'convention' | 'preference' | 'anti_pattern' | 'warning' | 'workflow' | 'bug_root_cause' | 'file_note' | 'symbol_note' | 'command_note';
|
|
12
|
+
type ConsolidatorSageKind = 'fact' | 'decision' | 'convention' | 'preference' | 'anti_pattern' | 'warning' | 'workflow' | 'bug_root_cause' | 'file_note' | 'symbol_note' | 'command_note' | 'session_digest';
|
|
13
13
|
interface ConsolidatorMemoryAnchor {
|
|
14
14
|
type: 'file' | 'directory' | 'symbol' | 'package' | 'command' | 'test' | 'git';
|
|
15
15
|
path?: string | undefined;
|
|
@@ -25,12 +25,14 @@ export interface ConsolidatorSage {
|
|
|
25
25
|
priority?: string | undefined;
|
|
26
26
|
importance?: number | undefined;
|
|
27
27
|
confidence?: number | undefined;
|
|
28
|
-
persistence?: 'long_lived' | undefined;
|
|
28
|
+
persistence?: 'long_lived' | 'short_lived' | undefined;
|
|
29
29
|
anchors?: ConsolidatorMemoryAnchor[] | undefined;
|
|
30
30
|
sources?: Array<{
|
|
31
31
|
type: string;
|
|
32
32
|
sessionId?: string | undefined;
|
|
33
33
|
}> | undefined;
|
|
34
|
+
ownerSessionId?: string | undefined;
|
|
35
|
+
expiresAt?: string | undefined;
|
|
34
36
|
}): Promise<unknown>;
|
|
35
37
|
listSage?(statuses?: Array<'active'>): Promise<unknown[]>;
|
|
36
38
|
searchSage?(query: string, opts?: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { EventBus } from '../kernel/events.js';
|
|
2
1
|
import type { ConversationState } from '../core/conversation-state.js';
|
|
2
|
+
import type { EventBus } from '../kernel/events.js';
|
|
3
3
|
/**
|
|
4
4
|
* Plan items are the strategic counterpart to todos. Where `ctx.todos`
|
|
5
5
|
* is the moment-to-moment task board the LLM mutates per-turn, a plan
|
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
import type { ResumeValidation, SessionEvent } from '../types/session.js';
|
|
2
2
|
/** Revalidate the latest persisted hash for every distinct observed path. */
|
|
3
3
|
export declare function validateResumeFileObservations(events: readonly SessionEvent[], projectRoot: string): Promise<ResumeValidation>;
|
|
4
|
+
/**
|
|
5
|
+
* Headers of the system messages `resume()` injects.
|
|
6
|
+
*
|
|
7
|
+
* They are described as ephemeral, but every consumer hands the resumed
|
|
8
|
+
* message list to `replaceMessages`, which journals it as a
|
|
9
|
+
* `messages_replaced` snapshot — so a notice written on one resume is replayed
|
|
10
|
+
* as ordinary conversation on the next one, and a fresh notice is added on top.
|
|
11
|
+
* Three resumes with the same modified file left three copies, all but the last
|
|
12
|
+
* describing a check that had already been superseded. `resume()` therefore
|
|
13
|
+
* strips previous notices from the replayed conversation before appending the
|
|
14
|
+
* current ones; these prefixes are how it recognizes them.
|
|
15
|
+
*/
|
|
16
|
+
export declare const RESUME_NOTICE_HEADERS: readonly ['[SESSION RESUME FILE VALIDATION]', '[SESSION RESUME INTERRUPTED WORK]'];
|
|
17
|
+
/**
|
|
18
|
+
* True for a system message this module produced on an earlier resume.
|
|
19
|
+
*
|
|
20
|
+
* Deliberately narrow: only a `system` message whose text *starts* with one of
|
|
21
|
+
* the headers matches, so a user or model quoting a notice back is never
|
|
22
|
+
* mistaken for one.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isResumeNoticeMessage(message: {
|
|
25
|
+
role: string;
|
|
26
|
+
content: unknown;
|
|
27
|
+
}): boolean;
|
|
4
28
|
/** Build the ephemeral system message injected into the first resumed turn. */
|
|
5
29
|
export declare function formatResumeValidationNotice(validation: ResumeValidation, projectRoot: string): string | null;
|
|
6
30
|
/**
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export declare function shouldSkipSessionDirectoryEntry(name: string): boolean;
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Re-exported under the store's own name; the rule itself lives with
|
|
4
|
+
* `sessionScopedPath`, which is what writes the sidecars this excludes.
|
|
5
|
+
*/
|
|
6
|
+
export { isSessionTranscriptFileName as isSessionJsonlFileName } from '../../utils/session-scoped-path.js';
|
|
3
7
|
//# sourceMappingURL=directory-scan.d.ts.map
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import type { ForkedSession, SessionData, SessionForkOptions, SessionMetadata, SessionWriter } from '../../types/session.js';
|
|
1
|
+
import type { ForkedSession, SessionData, SessionEvent, SessionForkOptions, SessionMetadata, SessionWriter } from '../../types/session.js';
|
|
2
2
|
export interface SessionForkHost {
|
|
3
3
|
load(id: string): Promise<SessionData>;
|
|
4
4
|
create(meta: Omit<SessionMetadata, 'startedAt'>): Promise<SessionWriter>;
|
|
5
5
|
delete(id: string): Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* Every persisted event of `id`, exactly as it sits on disk.
|
|
8
|
+
*
|
|
9
|
+
* `load()` is NOT a substitute. Its loader strips the payload out of every
|
|
10
|
+
* superseded `messages_replaced` / `context_snapshot` to bound heap, in
|
|
11
|
+
* place, on the array it returns. Forking from that array copies the
|
|
12
|
+
* emptied snapshots into the child journal, where replay reads them as
|
|
13
|
+
* "the conversation is now zero messages" and the child loses every turn
|
|
14
|
+
* that preceded the newest snapshot inside the fork boundary. A fork is a
|
|
15
|
+
* byte-level inheritance of the parent prefix, so it has to read the bytes.
|
|
16
|
+
*/
|
|
17
|
+
readRawEvents(id: string): Promise<SessionEvent[]>;
|
|
6
18
|
}
|
|
7
19
|
export declare function forkSession(host: SessionForkHost, id: string, opts?: SessionForkOptions): Promise<ForkedSession>;
|
|
8
20
|
//# sourceMappingURL=fork-session.d.ts.map
|
|
@@ -9,6 +9,17 @@ export declare class SessionLoadCache {
|
|
|
9
9
|
constructor(entries?: Map<string, LoadCacheEntry>);
|
|
10
10
|
private bytes;
|
|
11
11
|
clear(sessionId?: string): void;
|
|
12
|
+
/**
|
|
13
|
+
* A hit hands back fresh `messages` / `events` arrays over the cached
|
|
14
|
+
* contents.
|
|
15
|
+
*
|
|
16
|
+
* The entry outlives every caller, and callers treat what they get as their
|
|
17
|
+
* own: `resume()` passes `messages` straight into a live conversation, and
|
|
18
|
+
* anything walking `events` may splice it. Returning the cached arrays
|
|
19
|
+
* themselves let one caller's edit rewrite what the next one loads. The
|
|
20
|
+
* elements are still shared — copying them would defeat the cache — so
|
|
21
|
+
* entries remain read-only *contents* behind private containers.
|
|
22
|
+
*/
|
|
12
23
|
getFresh(id: string, stat: FileStatSnapshot, full: boolean): SessionData | null;
|
|
13
24
|
set(id: string, stat: FileStatSnapshot, data: SessionData): void;
|
|
14
25
|
private delete;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prunable === is a transcript. This module held the only complete sidecar
|
|
3
|
+
* list in the codebase while the listing scans held shorter ones; sharing the
|
|
4
|
+
* predicate is what stops them disagreeing again.
|
|
5
|
+
*/
|
|
1
6
|
export declare function isPrunableSessionJsonl(name: string): boolean;
|
|
2
7
|
export declare function pruneSessionFiles(storeDir: string, maxAgeDays: number, deleteSession: (id: string) => Promise<void>): Promise<number>;
|
|
3
8
|
//# sourceMappingURL=prune-helpers.d.ts.map
|
|
@@ -57,6 +57,18 @@ export declare class DefaultSessionStore implements SessionStore {
|
|
|
57
57
|
private ensureShardDir;
|
|
58
58
|
create(meta: Omit<SessionMetadata, 'startedAt'>): Promise<SessionWriter>;
|
|
59
59
|
fork(id: string, opts?: SessionForkOptions): Promise<ForkedSession>;
|
|
60
|
+
/**
|
|
61
|
+
* Implements {@link SessionForkHost.readRawEvents} — the parent stream a fork
|
|
62
|
+
* inherits, unmodified.
|
|
63
|
+
*
|
|
64
|
+
* Deliberately NOT `load()`: that loader empties superseded snapshot payloads
|
|
65
|
+
* in place and front-drops events past its retention budget, both of which
|
|
66
|
+
* are correct for reconstructing a conversation and wrong for copying a
|
|
67
|
+
* journal prefix into a child. Streaming with an accept-everything predicate
|
|
68
|
+
* keeps the scrubbing contract (`searchEvents` scrubs each line the same way
|
|
69
|
+
* `load()` does) without either transformation.
|
|
70
|
+
*/
|
|
71
|
+
readRawEvents(id: string): Promise<SessionEvent[]>;
|
|
60
72
|
/**
|
|
61
73
|
* Capture the deterministic post-tool workspace identity through the store-owned CAS.
|
|
62
74
|
*/
|
|
@@ -167,6 +179,12 @@ export declare class DefaultSessionStore implements SessionStore {
|
|
|
167
179
|
private listFromDirectoryScan;
|
|
168
180
|
private collectShardKeys;
|
|
169
181
|
private readOrBuildShardManifest;
|
|
182
|
+
/**
|
|
183
|
+
* Shard manifests are invalidated by other store processes via atomic
|
|
184
|
+
* delete/rebuild. Validate the in-memory projection against the persisted
|
|
185
|
+
* file so one long-lived process cannot retain another process's stale view.
|
|
186
|
+
*/
|
|
187
|
+
private freshShardManifestCacheEntry;
|
|
170
188
|
private collectSessionFilesInShard;
|
|
171
189
|
private collectSessionFiles;
|
|
172
190
|
/** Recursively collect session IDs from date-shard subdirectories.
|
package/dist/tasking/index.js
CHANGED
|
@@ -367,6 +367,11 @@ var TaskTracker = class _TaskTracker {
|
|
|
367
367
|
if (!this.graph) return false;
|
|
368
368
|
const node = this.graph.nodes.get(id);
|
|
369
369
|
if (!node) return false;
|
|
370
|
+
if (node.specRequirementId && this.graph.requiredRequirementIds?.includes(node.specRequirementId) && !Array.from(this.graph.nodes.values()).some(
|
|
371
|
+
(candidate) => candidate.id !== id && candidate.specRequirementId === node.specRequirementId
|
|
372
|
+
)) {
|
|
373
|
+
return false;
|
|
374
|
+
}
|
|
370
375
|
this.graph.nodes.delete(id);
|
|
371
376
|
this.graph.edges = this.graph.edges.filter((e) => e.from !== id && e.to !== id);
|
|
372
377
|
this.graph.rootNodes = this.graph.rootNodes.filter((r) => r !== id);
|