@wrongstack/core 0.303.0 → 0.305.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/project-server.js +18 -48
- package/dist/coordination/agents/index.js +530 -130
- package/dist/coordination/agents/project-agent-consolidation.d.ts +5 -0
- package/dist/coordination/agents/project-agent-directive-outcome.d.ts +57 -0
- package/dist/coordination/agents/project-agent-identity.d.ts +26 -12
- package/dist/coordination/agents/project-agent-learning-policy.d.ts +22 -1
- package/dist/coordination/agents/project-agent-learning-structured.d.ts +46 -1
- package/dist/coordination/agents/project-agent-quarantine.d.ts +63 -0
- package/dist/coordination/agents/project-agent-skill-layer.d.ts +55 -10
- 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 +2 -1
- package/dist/coordination/index.js +1581 -955
- package/dist/coordination/mailbox-project-server.js +28 -57
- package/dist/core/agent-types.d.ts +4 -2
- package/dist/core/agent.d.ts +1 -0
- package/dist/core/context.d.ts +15 -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 +308 -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 +910 -693
- package/dist/execution/council-orchestrator.d.ts +3 -13
- package/dist/execution/index.js +211 -75
- package/dist/execution/one-shot-llm.d.ts +5 -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 +3505 -2539
- package/dist/infrastructure/index.js +247 -122
- package/dist/plugin/index.js +101 -3
- 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 +25 -20
- package/dist/security/secret-vault.d.ts +2 -0
- package/dist/session-catalog/index.js +62 -8
- package/dist/session-catalog/project-server.js +109 -78
- package/dist/session-catalog/protocol.d.ts +11 -4
- package/dist/session-catalog/store.d.ts +2 -2
- package/dist/storage/index.js +224 -67
- package/dist/storage/memory-consolidator.d.ts +4 -2
- 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/tools/index.js +174 -74
- package/dist/types/config/mcp-features.d.ts +31 -1
- package/dist/types/config/root.d.ts +12 -0
- package/dist/types/config/tools.d.ts +22 -0
- package/dist/types/config/ui.d.ts +7 -4
- package/dist/types/default-config.d.ts +1 -0
- package/dist/types/index.js +24 -1
- package/dist/types/session.d.ts +9 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +214 -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 +10 -13
- package/instructions/system-pro.md +18 -25
- package/instructions/system.md +18 -23
- package/package.json +3 -3
- package/skills/wrongstack-kanban/SKILL.md +95 -124
|
@@ -115,6 +115,18 @@ export interface DefaultSystemPromptBuilderOptions {
|
|
|
115
115
|
* tests, embedders, and plugin-provided prompt experiments.
|
|
116
116
|
*/
|
|
117
117
|
instructionBundle?: InstructionBundle | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* Project jargon dictionary source. When set, the builder appends a
|
|
120
|
+
* compact `[Project Jargon Dictionary]` block to the prompt, sourced
|
|
121
|
+
* from SAGE-tagged `domain-term` memories. The host CLI/TUI/WebUI is
|
|
122
|
+
* responsible for handing the *same* `ProjectSageMemoryPort` it uses
|
|
123
|
+
* for memory injection into this slot — see
|
|
124
|
+
* `packages/core/src/core/system-prompt-glossary.ts` for the wiring
|
|
125
|
+
* contract and the SAGE architectural-rule cross-reference.
|
|
126
|
+
*
|
|
127
|
+
* omit → no glossary block (default).
|
|
128
|
+
*/
|
|
129
|
+
domainGlossary?: MemoryStore | undefined;
|
|
118
130
|
}
|
|
119
131
|
export declare class DefaultSystemPromptBuilder implements SystemPromptBuilder {
|
|
120
132
|
private readonly opts;
|
|
@@ -165,7 +177,7 @@ export declare class DefaultSystemPromptBuilder implements SystemPromptBuilder {
|
|
|
165
177
|
private get tier();
|
|
166
178
|
/**
|
|
167
179
|
* Returns the max tool description length for the current tier.
|
|
168
|
-
*
|
|
180
|
+
* The aggressive tier has the shortest descriptions; off keeps the most detail.
|
|
169
181
|
*/
|
|
170
182
|
private toolDescLimit;
|
|
171
183
|
build(ctx: BuildContext): Promise<TextBlock[]>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `[Project Jargon Dictionary]` block for the agent system prompt.
|
|
3
|
+
*
|
|
4
|
+
* The block is rendered FROM the same SAGE port the agent uses for
|
|
5
|
+
* all other memory context — never from `@wrongstack/sage-mcp`.
|
|
6
|
+
* Per the SAGE architectural rule (see `packages/sage/docs/direct-icp-usage.md`
|
|
7
|
+
* §1, "The architectural rule"), in-process consumers like the system-prompt
|
|
8
|
+
* builder must consume SAGE through `ProjectSageMemoryPort`/`SqliteMemoryPort`
|
|
9
|
+
* only. MCP is for external consumers; reading the glossary through MCP would
|
|
10
|
+
* open a second writer to the same SQLite file.
|
|
11
|
+
*
|
|
12
|
+
* This module is therefore intentionally `MemoryStore`-shaped rather than
|
|
13
|
+
* typed against the SAGE surface directly, so the prompt-builder stays
|
|
14
|
+
* core-level (no `@wrongstack/sage` import — `core` does not depend on
|
|
15
|
+
* `sage`). The host (CLI/TUI/WebUI) constructs the `SageDomainTermExtractor`
|
|
16
|
+
* against its own SAGE port and stitches it onto the builder via the
|
|
17
|
+
* `injectDomainGlossary` helper.
|
|
18
|
+
*
|
|
19
|
+
* Implementation note — the minimal-dictionary format:
|
|
20
|
+
* We render at most `maxEntries` bullets (default 12, configurable per
|
|
21
|
+
* token-saving tier) of `**Term** — short definition`. Definitions are
|
|
22
|
+
* capped at `maxEntryChars` chars per bullet (default 80) so the block
|
|
23
|
+
* always fits inside ~1k tokens. The format mirrors what the agent would
|
|
24
|
+
* otherwise have to re-derive by reading every recalled SAGE memory, which
|
|
25
|
+
* is the exact token-cost the design reduces.
|
|
26
|
+
*/
|
|
27
|
+
import type { MemoryStore } from '../types/memory.js';
|
|
28
|
+
import type { BuildContext } from '../types/system-prompt.js';
|
|
29
|
+
export interface DomainGlossaryOptions {
|
|
30
|
+
/** Max number of bullets. Default 12. */
|
|
31
|
+
maxEntries?: number | undefined;
|
|
32
|
+
/** Max chars per bullet line (after the **Term** header). Default 80. */
|
|
33
|
+
maxEntryChars?: number | undefined;
|
|
34
|
+
}
|
|
35
|
+
export interface DomainGlossary {
|
|
36
|
+
/** The extractor port shape we depend on. */
|
|
37
|
+
readonly memory: MemoryStore;
|
|
38
|
+
/** Render the block, or `null` when no glossary entries exist. */
|
|
39
|
+
readonly formatGlossaryBlock: () => Promise<string | null>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Build the minimal `[Project Jargon Dictionary]` block.
|
|
43
|
+
*
|
|
44
|
+
* Returns:
|
|
45
|
+
* - `null` when the memory store is missing or doesn't expose the glossary
|
|
46
|
+
* shape — never throw; the prompt builder logs and continues.
|
|
47
|
+
* - an empty string when the memory store has no glossary entries.
|
|
48
|
+
* - a markdown block capped at `maxEntries` × `maxEntryChars` otherwise.
|
|
49
|
+
*
|
|
50
|
+
* The block is prefixed with a clear provenance heading so the agent
|
|
51
|
+
* understands the source and can override / refresh at runtime via
|
|
52
|
+
* the SAGE tooling. The trailing line lists the lookup tag for grep
|
|
53
|
+
* parity (`domain-term`).
|
|
54
|
+
*/
|
|
55
|
+
export declare function renderDomainGlossary(ctx: BuildContext, memory: MemoryStore | undefined, options?: DomainGlossaryOptions): Promise<string | null>;
|
|
56
|
+
/**
|
|
57
|
+
* Wire a glossary block into a `DefaultSystemPromptBuilder` via the
|
|
58
|
+
* existing `contributors` channel (see `system-prompt-contributor.ts`).
|
|
59
|
+
*
|
|
60
|
+
* Use from the host (CLI/TUI/WebUI) like this:
|
|
61
|
+
*
|
|
62
|
+
* const builder = new DefaultSystemPromptBuilder({
|
|
63
|
+
* ...other opts,
|
|
64
|
+
* contributors: [
|
|
65
|
+
* ...DefaultSystemPromptBuilder.defaultContributors({ projectRoot }),
|
|
66
|
+
* makeDomainGlossaryContributor({ memory: sagePort }),
|
|
67
|
+
* ],
|
|
68
|
+
* });
|
|
69
|
+
*
|
|
70
|
+
* The contributor returns `[]` for non-SAGE stores so the prompt stays clean.
|
|
71
|
+
*/
|
|
72
|
+
export declare function makeDomainGlossaryContributor(glossary: DomainGlossary): (ctx: BuildContext) => Promise<import('../types/blocks.js').TextBlock[]>;
|
|
73
|
+
//# sourceMappingURL=system-prompt-glossary.d.ts.map
|
|
@@ -26,8 +26,8 @@ export interface OnlineAgentsCache {
|
|
|
26
26
|
* a fresh object on every status check, so reference equality always misses.
|
|
27
27
|
*
|
|
28
28
|
* Tier behaviour:
|
|
29
|
-
* - 'off' / 'medium'
|
|
30
|
-
* - 'minimal' / 'light' → count only (no list)
|
|
29
|
+
* - 'off' / 'medium' → full list with names, sessions, sources
|
|
30
|
+
* - 'minimal' / 'light' / 'aggressive' → count only (no list)
|
|
31
31
|
*
|
|
32
32
|
* Returns the (possibly updated) cache alongside the text; the caller stores it.
|
|
33
33
|
*/
|