@wrongstack/core 0.291.1 → 0.292.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/coordination/director-tools.d.ts.map +1 -1
- package/dist/coordination/index.js +113 -113
- package/dist/coordination/index.js.map +3 -3
- package/dist/core/agent-loop.d.ts.map +1 -1
- package/dist/core/agent-response.d.ts.map +1 -1
- package/dist/core/context.d.ts +10 -0
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/system-prompt-builder.d.ts +20 -1
- package/dist/core/system-prompt-builder.d.ts.map +1 -1
- package/dist/defaults/index.d.ts +1 -0
- package/dist/defaults/index.d.ts.map +1 -1
- package/dist/defaults/index.js +3132 -2440
- package/dist/defaults/index.js.map +4 -4
- package/dist/execution/auto-compaction-middleware.d.ts +34 -2
- package/dist/execution/auto-compaction-middleware.d.ts.map +1 -1
- package/dist/execution/compaction-core.d.ts +59 -0
- package/dist/execution/compaction-core.d.ts.map +1 -1
- package/dist/execution/compactor.d.ts.map +1 -1
- package/dist/execution/error-handler.d.ts +7 -0
- package/dist/execution/error-handler.d.ts.map +1 -1
- package/dist/execution/index.d.ts +1 -0
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/index.js +4677 -3924
- package/dist/execution/index.js.map +4 -4
- package/dist/execution/intelligent-compactor.d.ts.map +1 -1
- package/dist/execution/model-runtime.d.ts.map +1 -1
- package/dist/execution/selective-compactor.d.ts +10 -0
- package/dist/execution/selective-compactor.d.ts.map +1 -1
- package/dist/execution/subagent-compaction.d.ts +24 -0
- package/dist/execution/subagent-compaction.d.ts.map +1 -0
- package/dist/hq/alerts.d.ts +5 -0
- package/dist/hq/alerts.d.ts.map +1 -1
- package/dist/hq/auth-audit.d.ts +115 -0
- package/dist/hq/auth-audit.d.ts.map +1 -0
- package/dist/hq/auth-store.d.ts +98 -2
- package/dist/hq/auth-store.d.ts.map +1 -1
- package/dist/hq/brain-bridge.d.ts +2 -8
- package/dist/hq/brain-bridge.d.ts.map +1 -1
- package/dist/hq/bridge-context.d.ts +74 -0
- package/dist/hq/bridge-context.d.ts.map +1 -0
- package/dist/hq/cost-bridge.d.ts +4 -10
- package/dist/hq/cost-bridge.d.ts.map +1 -1
- package/dist/hq/fleet-bridge.d.ts +2 -8
- package/dist/hq/fleet-bridge.d.ts.map +1 -1
- package/dist/hq/index.d.ts +2 -0
- package/dist/hq/index.d.ts.map +1 -1
- package/dist/hq/index.js +358 -222
- package/dist/hq/index.js.map +4 -4
- package/dist/hq/protocol/session.d.ts +13 -0
- package/dist/hq/protocol/session.d.ts.map +1 -1
- package/dist/hq/tool-bridge.d.ts +2 -8
- package/dist/hq/tool-bridge.d.ts.map +1 -1
- package/dist/hq/worktree-bridge.d.ts +2 -8
- package/dist/hq/worktree-bridge.d.ts.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6054 -4741
- package/dist/index.js.map +4 -4
- package/dist/infrastructure/index.js +32 -15
- package/dist/infrastructure/index.js.map +2 -2
- package/dist/infrastructure/provider-cache-ledger.d.ts +48 -0
- package/dist/infrastructure/provider-cache-ledger.d.ts.map +1 -0
- package/dist/infrastructure/token-counter.d.ts +4 -2
- package/dist/infrastructure/token-counter.d.ts.map +1 -1
- package/dist/kernel/events/brain-events.d.ts +2 -0
- package/dist/kernel/events/brain-events.d.ts.map +1 -1
- package/dist/kernel/events/memory-events.d.ts +102 -0
- package/dist/kernel/events/memory-events.d.ts.map +1 -1
- package/dist/kernel/events/session-events.d.ts +35 -0
- package/dist/kernel/events/session-events.d.ts.map +1 -1
- package/dist/models/index.js +161 -78
- package/dist/models/index.js.map +3 -3
- package/dist/models/llm-selector.d.ts.map +1 -1
- package/dist/notifications/index.d.ts +40 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/notifier-impl.d.ts +34 -0
- package/dist/notifications/notifier-impl.d.ts.map +1 -0
- package/dist/notifications/notifier.d.ts +95 -0
- package/dist/notifications/notifier.d.ts.map +1 -0
- package/dist/notifications/types.d.ts +111 -0
- package/dist/notifications/types.d.ts.map +1 -0
- package/dist/plugin/api.d.ts +10 -1
- package/dist/plugin/api.d.ts.map +1 -1
- package/dist/registry/provider-registry.d.ts +1 -1
- package/dist/registry/provider-registry.d.ts.map +1 -1
- package/dist/security/index.js +15 -15
- package/dist/security/index.js.map +3 -3
- package/dist/skills/index.js +80 -80
- package/dist/skills/index.js.map +3 -3
- package/dist/storage/config-loader.d.ts +3 -5
- package/dist/storage/config-loader.d.ts.map +1 -1
- package/dist/storage/index.js +325 -259
- package/dist/storage/index.js.map +4 -4
- package/dist/storage/memory-consolidator.d.ts +14 -2
- package/dist/storage/memory-consolidator.d.ts.map +1 -1
- package/dist/storage/queue-store.d.ts +2 -0
- package/dist/storage/queue-store.d.ts.map +1 -1
- package/dist/tools/index.js +6 -6
- package/dist/tools/index.js.map +3 -3
- package/dist/tools/mcp-control.d.ts +1 -1
- package/dist/types/config.d.ts +64 -20
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/index.js +60 -34
- package/dist/types/index.js.map +3 -3
- package/dist/types/plugin.d.ts +11 -0
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/provider.d.ts +31 -0
- package/dist/types/provider.d.ts.map +1 -1
- package/dist/types/token-counter.d.ts +8 -1
- package/dist/types/token-counter.d.ts.map +1 -1
- package/dist/utils/cache-key.d.ts +19 -0
- package/dist/utils/cache-key.d.ts.map +1 -0
- package/dist/utils/compaction-preview.d.ts +8 -0
- package/dist/utils/compaction-preview.d.ts.map +1 -0
- package/dist/utils/context-breakdown.d.ts +59 -0
- package/dist/utils/context-breakdown.d.ts.map +1 -0
- package/dist/utils/context-evidence.d.ts +22 -0
- package/dist/utils/context-evidence.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1730 -1543
- package/dist/utils/index.js.map +4 -4
- package/dist/utils/token-estimate.d.ts +27 -0
- package/dist/utils/token-estimate.d.ts.map +1 -1
- package/instructions/llm/memory-consolidator.md +19 -3
- package/instructions/system.md +10 -2
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { OneShotOrchestrator } from '../execution/one-shot-llm.js';
|
|
1
2
|
import type { AfterRunHook, AgentExtension } from '../extension/extension-points.js';
|
|
2
3
|
import type { MemoryStore } from '../types/memory.js';
|
|
3
4
|
import type { Provider } from '../types/provider.js';
|
|
4
|
-
import type { OneShotOrchestrator } from '../execution/one-shot-llm.js';
|
|
5
5
|
/**
|
|
6
6
|
* Minimal interface for writing to Super Memory without importing
|
|
7
7
|
* @wrongstack/super-memory (core cannot depend on super-memory).
|
|
@@ -9,7 +9,13 @@ import type { OneShotOrchestrator } from '../execution/one-shot-llm.js';
|
|
|
9
9
|
* rememberSuper rather than the legacy MemoryStore.remember(),
|
|
10
10
|
* making them visible to searchSuper/turn-middleware.
|
|
11
11
|
*/
|
|
12
|
-
type ConsolidatorSuperMemoryKind = 'fact' | 'decision' | 'convention' | 'preference' | 'anti_pattern' | 'file_note';
|
|
12
|
+
type ConsolidatorSuperMemoryKind = 'fact' | 'decision' | 'convention' | 'preference' | 'anti_pattern' | 'warning' | 'workflow' | 'bug_root_cause' | 'file_note' | 'symbol_note' | 'command_note';
|
|
13
|
+
interface ConsolidatorMemoryAnchor {
|
|
14
|
+
type: 'file' | 'directory' | 'symbol' | 'package' | 'command' | 'test' | 'git';
|
|
15
|
+
path?: string | undefined;
|
|
16
|
+
symbol?: string | undefined;
|
|
17
|
+
command?: string | undefined;
|
|
18
|
+
}
|
|
13
19
|
export interface ConsolidatorSuperMemory {
|
|
14
20
|
rememberSuper(input: {
|
|
15
21
|
text: string;
|
|
@@ -19,6 +25,8 @@ export interface ConsolidatorSuperMemory {
|
|
|
19
25
|
priority?: string | undefined;
|
|
20
26
|
importance?: number | undefined;
|
|
21
27
|
confidence?: number | undefined;
|
|
28
|
+
persistence?: 'long_lived' | undefined;
|
|
29
|
+
anchors?: ConsolidatorMemoryAnchor[] | undefined;
|
|
22
30
|
sources?: Array<{
|
|
23
31
|
type: string;
|
|
24
32
|
sessionId?: string | undefined;
|
|
@@ -49,6 +57,10 @@ export interface ConsolidationOp {
|
|
|
49
57
|
tags?: string[] | undefined;
|
|
50
58
|
/** Priority level. */
|
|
51
59
|
priority?: string | undefined;
|
|
60
|
+
/** Confidence that the statement is durable and supported by the evidence. */
|
|
61
|
+
confidence?: number | undefined;
|
|
62
|
+
/** Concrete retrieval anchors grounded in files, symbols, packages, tests, or commands touched. */
|
|
63
|
+
anchors?: ConsolidatorMemoryAnchor[] | undefined;
|
|
52
64
|
}
|
|
53
65
|
export interface MemoryConsolidatorOptions {
|
|
54
66
|
memoryStore: MemoryStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-consolidator.d.ts","sourceRoot":"","sources":["../../src/storage/memory-consolidator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"memory-consolidator.d.ts","sourceRoot":"","sources":["../../src/storage/memory-consolidator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACrF,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAQrD;;;;;;GAMG;AACH,KAAK,2BAA2B,GAC5B,MAAM,GACN,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,cAAc,GACd,SAAS,GACT,UAAU,GACV,gBAAgB,GAChB,WAAW,GACX,aAAa,GACb,cAAc,CAAC;AAEnB,UAAU,wBAAwB;IAChC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC;IAC/E,IA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CAAS;IAC5C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAkC;IAEvE,YAAY,IAAI,EAAE,yBAAyB,EAU1C;IAED,QAAQ,EAAE,YAAY,CA2HpB;CACH"}
|
|
@@ -9,6 +9,8 @@ import type { Logger } from '../types/logger.js';
|
|
|
9
9
|
export interface PersistedQueueItem {
|
|
10
10
|
displayText: string;
|
|
11
11
|
blocks: ContentBlock[];
|
|
12
|
+
/** When true, the item will be refined via model.refine before entering the agent context. */
|
|
13
|
+
shouldRefine?: boolean | undefined;
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
14
16
|
* Side-file storage for a session's pending input queue. Lives at
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue-store.d.ts","sourceRoot":"","sources":["../../src/storage/queue-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAIjD;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,YAAY,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"queue-store.d.ts","sourceRoot":"","sources":["../../src/storage/queue-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAIjD;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,8FAA8F;IAC9F,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACpC;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAG9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;IAC9C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAE5C,YAAY,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,QAAQ,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,EAKlG;IAED,OAAO,CAAC,OAAO;IAQT,KAAK,CAAC,KAAK,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAgCtD;IAEK,IAAI,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CA2E1C;IAEK,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CA+B3B;CACF"}
|
package/dist/tools/index.js
CHANGED
|
@@ -258,6 +258,11 @@ import { randomBytes } from "node:crypto";
|
|
|
258
258
|
import * as fs from "node:fs/promises";
|
|
259
259
|
import * as path from "node:path";
|
|
260
260
|
|
|
261
|
+
// src/types/blocks.ts
|
|
262
|
+
function isTextBlock(b) {
|
|
263
|
+
return b.type === "text";
|
|
264
|
+
}
|
|
265
|
+
|
|
261
266
|
// src/utils/string.ts
|
|
262
267
|
function truncate(s, max) {
|
|
263
268
|
return s.length <= max ? s : `${s.slice(0, max - 1)}\u2026`;
|
|
@@ -2089,13 +2094,8 @@ function evaluateModelCalendar(rules, providerId, model, at = /* @__PURE__ */ ne
|
|
|
2089
2094
|
return { allowed: true };
|
|
2090
2095
|
}
|
|
2091
2096
|
|
|
2092
|
-
// src/types/blocks.ts
|
|
2093
|
-
function isTextBlock(b) {
|
|
2094
|
-
return b.type === "text";
|
|
2095
|
-
}
|
|
2096
|
-
|
|
2097
2097
|
// src/types/provider.ts
|
|
2098
|
-
var CONTEXT_OVERFLOW_RE = /context.length|context.window|max.*tokens?.*exceeded|prompt is too long|too long|exceeds the context|\btokens\b.*exceed|context_length_exceeded/i;
|
|
2098
|
+
var CONTEXT_OVERFLOW_RE = /context.length|context.window|maximum context|max.*tokens?.*exceeded|prompt is too long|too long|exceeds the context|\btokens\b.*exceed|too many tokens|reduce the length|resulted in \d+ tokens|input.{0,12}too (?:large|long)|context_length_exceeded/i;
|
|
2099
2099
|
var CONTENT_FILTER_RE = /content.(filter|policy|moderation)|safety (system|filter)/i;
|
|
2100
2100
|
var QUOTA_EXHAUSTED_RE = /(?:insufficient|exhausted|depleted|exceeded|no|not enough)[-_\s]*(?:quota|credit|balance)|(?:quota|credit|balance)[-_\s]*(?:exhausted|depleted|exceeded|insufficient)|billing[_\s-]*(?:hard[_\s-]*)?limit|payment required|spending limit|plan limit/i;
|
|
2101
2101
|
function classifyProviderError(status, body, message) {
|