@wrongstack/core 0.313.0 → 0.313.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/index.js +84 -6391
- package/dist/chronicle/project-server.js +84 -4868
- package/dist/chunk-2BUUIMQB.js +225 -0
- package/dist/chunk-2FK4WTFF.js +207 -0
- package/dist/chunk-2FQL4PDC.js +292 -0
- package/dist/chunk-2KKODIQU.js +2256 -0
- package/dist/chunk-2YU4WVBW.js +134 -0
- package/dist/chunk-3E244UDA.js +356 -0
- package/dist/chunk-3XPVB7BA.js +135 -0
- package/dist/chunk-4LJJYBAU.js +388 -0
- package/dist/chunk-4VWO3ZXL.js +342 -0
- package/dist/chunk-4XV6IR37.js +187 -0
- package/dist/chunk-4ZHTKJHM.js +183 -0
- package/dist/chunk-52RTVH4M.js +361 -0
- package/dist/chunk-57GEWK5X.js +26 -0
- package/dist/chunk-5DSMEVA4.js +931 -0
- package/dist/chunk-5RP3QTRL.js +1223 -0
- package/dist/chunk-5S437PRC.js +50 -0
- package/dist/chunk-5XDUGTKN.js +511 -0
- package/dist/chunk-62V2AFVG.js +422 -0
- package/dist/chunk-65RDIOR2.js +2470 -0
- package/dist/chunk-6AKOTGLM.js +597 -0
- package/dist/chunk-7ZHZE5EO.js +28 -0
- package/dist/chunk-A455ATZB.js +140 -0
- package/dist/chunk-AD7ZFZCS.js +46 -0
- package/dist/chunk-AI4LLQ2U.js +856 -0
- package/dist/chunk-ASX6AW36.js +789 -0
- package/dist/chunk-AT4V4XGI.js +3522 -0
- package/dist/chunk-AWNQ6ED6.js +311 -0
- package/dist/chunk-B4AMLZPB.js +9 -0
- package/dist/chunk-BAKVJLEV.js +417 -0
- package/dist/chunk-BJHVULHO.js +55 -0
- package/dist/chunk-CB2HFKTP.js +9 -0
- package/dist/chunk-CE4ZOCOI.js +1640 -0
- package/dist/chunk-CQQL4ZOQ.js +151 -0
- package/dist/chunk-DEIQMBD2.js +65 -0
- package/dist/chunk-E6I5RXVK.js +58 -0
- package/dist/chunk-EFEHDQGY.js +1589 -0
- package/dist/chunk-EODDVJBM.js +82 -0
- package/dist/chunk-EPC3GZD4.js +308 -0
- package/dist/chunk-FAYRX2AD.js +13 -0
- package/dist/chunk-FFSX2QDQ.js +362 -0
- package/dist/chunk-FHAMQS7Q.js +5856 -0
- package/dist/chunk-FIV4IJL7.js +2263 -0
- package/dist/chunk-FNXVT7HF.js +52 -0
- package/dist/chunk-FSWCWSTS.js +395 -0
- package/dist/chunk-FW5LDDMJ.js +16464 -0
- package/dist/chunk-FXQLIX3K.js +211 -0
- package/dist/chunk-G5AAKEEZ.js +228 -0
- package/dist/chunk-G5S3S5ZN.js +38 -0
- package/dist/chunk-GAZEWQEZ.js +231 -0
- package/dist/chunk-GFJOMSHG.js +125 -0
- package/dist/chunk-GFXZTHNI.js +158 -0
- package/dist/chunk-GM54GJBU.js +960 -0
- package/dist/chunk-GPQ3NJPR.js +900 -0
- package/dist/chunk-GTCU6DZ3.js +1 -0
- package/dist/chunk-H5E77KUJ.js +15 -0
- package/dist/chunk-H72H4XDU.js +1023 -0
- package/dist/chunk-HA4ZYA6T.js +178 -0
- package/dist/chunk-I45KAW2N.js +5020 -0
- package/dist/chunk-IQ35HMQL.js +1396 -0
- package/dist/chunk-IYFBFX34.js +86 -0
- package/dist/chunk-JJPMWPB6.js +109 -0
- package/dist/chunk-JTHKOYWU.js +663 -0
- package/dist/chunk-JVGPR3TS.js +365 -0
- package/dist/chunk-JVKB2TBL.js +48 -0
- package/dist/chunk-JX7VBZDK.js +31 -0
- package/dist/chunk-K3G6JBUC.js +5232 -0
- package/dist/chunk-K4YUNKU7.js +589 -0
- package/dist/chunk-KBZGE6LN.js +710 -0
- package/dist/chunk-KDQJCT2J.js +45 -0
- package/dist/chunk-KI4L2DUL.js +560 -0
- package/dist/chunk-KJ2ZTQSL.js +47 -0
- package/dist/chunk-KSJ5UTP7.js +154 -0
- package/dist/chunk-LHOA5DWA.js +28 -0
- package/dist/chunk-LX5QWLBL.js +27 -0
- package/dist/chunk-LZDDLNCZ.js +279 -0
- package/dist/chunk-M2WF6AXG.js +115 -0
- package/dist/chunk-M7BS2K6U.js +1 -0
- package/dist/chunk-NDBIPFNY.js +102 -0
- package/dist/chunk-NEMIWEXC.js +1199 -0
- package/dist/chunk-NFAYHPRH.js +323 -0
- package/dist/chunk-O37BQ65S.js +21 -0
- package/dist/chunk-O74MJHXU.js +187 -0
- package/dist/chunk-OJZEX73F.js +112 -0
- package/dist/chunk-PAAWLLZX.js +74 -0
- package/dist/chunk-PFXFQQRT.js +339 -0
- package/dist/chunk-PFZO3C6H.js +14 -0
- package/dist/chunk-PHH7LD45.js +113 -0
- package/dist/chunk-QRTG4XTI.js +188 -0
- package/dist/chunk-QVOVMXJR.js +1351 -0
- package/dist/chunk-RCQYT2I4.js +757 -0
- package/dist/chunk-RD6DEE36.js +1178 -0
- package/dist/chunk-RJIZEJ42.js +30 -0
- package/dist/chunk-RPOA7IAE.js +150 -0
- package/dist/chunk-SN2DQRL6.js +1172 -0
- package/dist/chunk-SQJVFEBV.js +41 -0
- package/dist/chunk-SQP64RCS.js +5391 -0
- package/dist/chunk-SVT4RNTR.js +49 -0
- package/dist/chunk-SWUFN7XM.js +43 -0
- package/dist/chunk-SXMVYC5H.js +174 -0
- package/dist/chunk-SZ6AYUIZ.js +23 -0
- package/dist/chunk-T3KGZBU5.js +3171 -0
- package/dist/chunk-TBRL2RCC.js +9 -0
- package/dist/chunk-TRT2HRWZ.js +18 -0
- package/dist/chunk-TYW2GI5I.js +1077 -0
- package/dist/chunk-UIWONWVG.js +4959 -0
- package/dist/chunk-VB3H5WWB.js +151 -0
- package/dist/chunk-W4A6QA3D.js +258 -0
- package/dist/chunk-WBPVKEEE.js +227 -0
- package/dist/chunk-WEBMSQP2.js +123 -0
- package/dist/chunk-WOEZV3Q4.js +333 -0
- package/dist/chunk-WQQON3SV.js +473 -0
- package/dist/chunk-WQTOVMGV.js +119 -0
- package/dist/chunk-WZO23AWO.js +2779 -0
- package/dist/chunk-XBDP4QPW.js +7 -0
- package/dist/chunk-XEBHSJLT.js +103 -0
- package/dist/chunk-XQ2ECNK3.js +1 -0
- package/dist/chunk-XQ2XGIBF.js +2086 -0
- package/dist/chunk-Y2GE5TSI.js +355 -0
- package/dist/chunk-YBUJCZ57.js +351 -0
- package/dist/chunk-YNCVSFGF.js +149 -0
- package/dist/chunk-YUPMXOGP.js +282 -0
- package/dist/chunk-YY6APYUM.js +49 -0
- package/dist/chunk-Z2IJUO45.js +691 -0
- package/dist/chunk-ZEHUCJHY.js +129 -0
- package/dist/chunk-ZYU2YOJ6.js +1496 -0
- package/dist/chunk-ZZ4V3WIZ.js +163 -0
- package/dist/coordination/agents/index.js +145 -6260
- package/dist/coordination/index.js +365 -34324
- package/dist/coordination/mailbox-project-server.js +48 -3276
- package/dist/coordination/provider-status-tracker.d.ts +4 -0
- package/dist/core/agent.d.ts +14 -1
- package/dist/core/index.js +267 -12480
- package/dist/core/model-ref.js +5 -23
- package/dist/core/provider-runner.d.ts +36 -1
- package/dist/design/index.js +50 -1087
- package/dist/execution/index.d.ts +1 -1
- package/dist/execution/index.js +1599 -21888
- package/dist/execution/prompt-enhancer.js +16 -535
- package/dist/execution/retry-policy.d.ts +31 -1
- package/dist/extension/index.js +7 -311
- package/dist/goal/index.js +33 -3435
- package/dist/hooks/index.js +14 -1138
- package/dist/hq/index.js +112 -5139
- package/dist/hq/protocol.js +21 -668
- package/dist/index.js +1410 -92656
- package/dist/infrastructure/index.js +64 -4811
- package/dist/kernel/events/provider-events.d.ts +15 -0
- package/dist/kernel/index.js +14 -992
- package/dist/models/index.js +40 -1117
- package/dist/notifications/index.js +3 -108
- package/dist/observability/index.js +17 -279
- package/dist/plugin/index.js +584 -14835
- package/dist/prompts/index.js +14 -948
- package/dist/registry/index.js +9 -822
- package/dist/registry-R23UBE7H.js +14 -0
- package/dist/replay/index.js +6 -84
- package/dist/review-finding-store-DKAV3AS6.js +21 -0
- package/dist/review-report-store-OWY3EC3N.js +19 -0
- package/dist/security/index.js +114 -2202
- package/dist/session-catalog/index.js +36 -2103
- package/dist/session-catalog/project-server.js +42 -1435
- package/dist/skills/index.js +35 -1578
- package/dist/storage/index.js +182 -15600
- package/dist/tasking/index.js +10 -676
- package/dist/tools/index.js +52 -9590
- package/dist/types/config/autonomy.d.ts +5 -0
- package/dist/types/config/ui.d.ts +1 -1
- package/dist/types/errors.d.ts +18 -0
- package/dist/types/index.js +121 -1342
- package/dist/types/provider-runner.d.ts +8 -0
- package/dist/types/session-markers.js +8 -144
- package/dist/utils/error.js +3 -4
- package/dist/utils/expect-defined.js +3 -9
- package/dist/utils/heap-watchdog.js +6 -706
- package/dist/utils/index.js +269 -5685
- package/dist/utils/sage-output-block.js +5 -42
- package/dist/wiring/proxy-rewrite.d.ts +18 -0
- package/dist/wiring/proxy-rewrite.js +18 -121
- package/dist/worktree/index.js +6 -887
- package/package.json +4 -4
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import {
|
|
2
|
+
expectDefined
|
|
3
|
+
} from "./chunk-PFZO3C6H.js";
|
|
4
|
+
|
|
5
|
+
// src/types/context-window.ts
|
|
6
|
+
var DEFAULT_CONTEXT_WINDOW_MODE_ID = "balanced";
|
|
7
|
+
var LARGE_WINDOW_DEEP_MODE_THRESHOLD = 1e6;
|
|
8
|
+
var CONTEXT_WINDOW_MODE_PINNED_META_KEY = "contextWindowModePinned";
|
|
9
|
+
var DEPRECATED_CONTEXT_WINDOW_MODE_ALIASES = Object.freeze({
|
|
10
|
+
archival: "balanced"
|
|
11
|
+
});
|
|
12
|
+
var CONTEXT_WINDOW_MODES = Object.freeze([
|
|
13
|
+
{
|
|
14
|
+
id: "balanced",
|
|
15
|
+
name: "Balanced",
|
|
16
|
+
description: "Default rolling compaction: recent work stays verbatim, old tool output is trimmed. Windows of 1M+ tokens default to Deep.",
|
|
17
|
+
thresholds: { warn: 0.55, soft: 0.7, hard: 0.85 },
|
|
18
|
+
aggressiveOn: "soft",
|
|
19
|
+
preserveK: 8,
|
|
20
|
+
eliseThreshold: 1200,
|
|
21
|
+
targetLoad: 0.65
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "frugal",
|
|
25
|
+
name: "Frugal",
|
|
26
|
+
description: "Token-saver mode: compacts early and keeps a tight verbatim tail.",
|
|
27
|
+
thresholds: { warn: 0.4, soft: 0.55, hard: 0.7 },
|
|
28
|
+
aggressiveOn: "warn",
|
|
29
|
+
preserveK: 4,
|
|
30
|
+
eliseThreshold: 500,
|
|
31
|
+
targetLoad: 0.45
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "deep",
|
|
35
|
+
name: "Deep",
|
|
36
|
+
description: "Long-reasoning mode: delays compaction and keeps more recent turns intact.",
|
|
37
|
+
thresholds: { warn: 0.72, soft: 0.86, hard: 0.96 },
|
|
38
|
+
aggressiveOn: "hard",
|
|
39
|
+
preserveK: 18,
|
|
40
|
+
eliseThreshold: 5e3,
|
|
41
|
+
targetLoad: 0.82
|
|
42
|
+
}
|
|
43
|
+
]);
|
|
44
|
+
function listContextWindowModes() {
|
|
45
|
+
return CONTEXT_WINDOW_MODES.map((m) => ({ ...m, thresholds: { ...m.thresholds } }));
|
|
46
|
+
}
|
|
47
|
+
function normalizeContextWindowModeId(id) {
|
|
48
|
+
if (!id) return null;
|
|
49
|
+
if (isContextWindowModeId(id)) return id;
|
|
50
|
+
return DEPRECATED_CONTEXT_WINDOW_MODE_ALIASES[id] ?? null;
|
|
51
|
+
}
|
|
52
|
+
function isDeprecatedContextWindowModeId(id) {
|
|
53
|
+
return Object.hasOwn(DEPRECATED_CONTEXT_WINDOW_MODE_ALIASES, id);
|
|
54
|
+
}
|
|
55
|
+
function isContextWindowModeSelectionId(id) {
|
|
56
|
+
return isContextWindowModeId(id) || isDeprecatedContextWindowModeId(id);
|
|
57
|
+
}
|
|
58
|
+
function getContextWindowMode(id) {
|
|
59
|
+
const normalized = normalizeContextWindowModeId(id);
|
|
60
|
+
if (!normalized) return null;
|
|
61
|
+
const mode = CONTEXT_WINDOW_MODES.find((m) => m.id === normalized);
|
|
62
|
+
return mode ? { ...mode, thresholds: { ...mode.thresholds } } : null;
|
|
63
|
+
}
|
|
64
|
+
function isContextWindowModeId(id) {
|
|
65
|
+
return CONTEXT_WINDOW_MODES.some((m) => m.id === id);
|
|
66
|
+
}
|
|
67
|
+
function resolveContextWindowPolicy(config = {}, overrideMode, maxContext) {
|
|
68
|
+
const requested = overrideMode ?? config.mode ?? DEFAULT_CONTEXT_WINDOW_MODE_ID;
|
|
69
|
+
const normalized = normalizeContextWindowModeId(requested) ?? DEFAULT_CONTEXT_WINDOW_MODE_ID;
|
|
70
|
+
const baseId = normalized === DEFAULT_CONTEXT_WINDOW_MODE_ID && typeof maxContext === "number" && maxContext >= LARGE_WINDOW_DEEP_MODE_THRESHOLD ? "deep" : normalized;
|
|
71
|
+
const mode = expectDefined(getContextWindowMode(baseId));
|
|
72
|
+
return {
|
|
73
|
+
...mode,
|
|
74
|
+
thresholds: {
|
|
75
|
+
warn: config.warnThreshold ?? mode.thresholds.warn,
|
|
76
|
+
soft: config.softThreshold ?? mode.thresholds.soft,
|
|
77
|
+
hard: config.hardThreshold ?? mode.thresholds.hard
|
|
78
|
+
},
|
|
79
|
+
preserveK: config.preserveK ?? mode.preserveK,
|
|
80
|
+
eliseThreshold: config.eliseThreshold ?? mode.eliseThreshold,
|
|
81
|
+
targetLoad: config.targetLoad ?? mode.targetLoad
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function formatContextWindowModeList(activeId) {
|
|
85
|
+
const active = normalizeContextWindowModeId(activeId);
|
|
86
|
+
return CONTEXT_WINDOW_MODES.map((m) => {
|
|
87
|
+
const marker = m.id === active ? "*" : " ";
|
|
88
|
+
return `${marker} ${m.id.padEnd(9)} ${m.name} - ${m.description}`;
|
|
89
|
+
}).join("\n");
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// src/types/default-config.ts
|
|
93
|
+
var DEFAULT_TOOLS_CONFIG = Object.freeze({
|
|
94
|
+
defaultExecutionStrategy: "smart",
|
|
95
|
+
maxIterations: 100,
|
|
96
|
+
iterationTimeoutMs: 3e5,
|
|
97
|
+
maxToolTimeoutMs: 3e5,
|
|
98
|
+
sessionTimeoutMs: 18e5,
|
|
99
|
+
perIterationOutputCapBytes: 1e5,
|
|
100
|
+
descriptionMode: Object.freeze({}),
|
|
101
|
+
disabledTools: Object.freeze([]),
|
|
102
|
+
// Extension requires an explicit host/user policy. Without that boundary a
|
|
103
|
+
// nominal maxIterations cap can grow forever in autonomous sessions.
|
|
104
|
+
autoExtendLimit: false,
|
|
105
|
+
restrictToProjectRoot: true,
|
|
106
|
+
// Off by default: the board is a record of the work, not a permit for it.
|
|
107
|
+
// See ToolsConfig.kanbanGovernance for what turning it on costs and gates.
|
|
108
|
+
kanbanGovernance: false,
|
|
109
|
+
loopDetection: Object.freeze({
|
|
110
|
+
mode: "steer-then-cut",
|
|
111
|
+
steerThreshold: 3,
|
|
112
|
+
cutThreshold: 5,
|
|
113
|
+
windowSize: 12,
|
|
114
|
+
callRepeatThreshold: 4
|
|
115
|
+
})
|
|
116
|
+
});
|
|
117
|
+
var DEFAULT_CONTEXT_CONFIG = Object.freeze({
|
|
118
|
+
warnThreshold: 0.55,
|
|
119
|
+
softThreshold: 0.7,
|
|
120
|
+
hardThreshold: 0.85,
|
|
121
|
+
targetLoad: 0.65,
|
|
122
|
+
preserveK: 8,
|
|
123
|
+
eliseThreshold: 1200
|
|
124
|
+
});
|
|
125
|
+
var DEFAULT_AUTONOMY_CONFIG = Object.freeze({
|
|
126
|
+
autoProceedDelayMs: 45e3
|
|
127
|
+
});
|
|
128
|
+
var DEFAULT_CIRCUIT_BREAKER_CONFIG = Object.freeze({
|
|
129
|
+
enabled: false,
|
|
130
|
+
autoKillResetMs: 6e4
|
|
131
|
+
});
|
|
132
|
+
var DEFAULT_SESSION_LOGGING_CONFIG = Object.freeze({
|
|
133
|
+
auditLevel: "standard",
|
|
134
|
+
sampling: {
|
|
135
|
+
toolProgress: {
|
|
136
|
+
sampleRate: 8
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
var DEFAULT_SESSION_PRUNE_DAYS = 30;
|
|
141
|
+
|
|
142
|
+
export {
|
|
143
|
+
DEFAULT_CONTEXT_WINDOW_MODE_ID,
|
|
144
|
+
LARGE_WINDOW_DEEP_MODE_THRESHOLD,
|
|
145
|
+
CONTEXT_WINDOW_MODE_PINNED_META_KEY,
|
|
146
|
+
DEPRECATED_CONTEXT_WINDOW_MODE_ALIASES,
|
|
147
|
+
CONTEXT_WINDOW_MODES,
|
|
148
|
+
listContextWindowModes,
|
|
149
|
+
normalizeContextWindowModeId,
|
|
150
|
+
isDeprecatedContextWindowModeId,
|
|
151
|
+
isContextWindowModeSelectionId,
|
|
152
|
+
getContextWindowMode,
|
|
153
|
+
isContextWindowModeId,
|
|
154
|
+
resolveContextWindowPolicy,
|
|
155
|
+
formatContextWindowModeList,
|
|
156
|
+
DEFAULT_TOOLS_CONFIG,
|
|
157
|
+
DEFAULT_CONTEXT_CONFIG,
|
|
158
|
+
DEFAULT_AUTONOMY_CONFIG,
|
|
159
|
+
DEFAULT_CIRCUIT_BREAKER_CONFIG,
|
|
160
|
+
DEFAULT_SESSION_LOGGING_CONFIG,
|
|
161
|
+
DEFAULT_SESSION_PRUNE_DAYS
|
|
162
|
+
};
|
|
163
|
+
//# sourceMappingURL=chunk-ZZ4V3WIZ.js.map
|