@elvisw/dsh-magic-context 0.0.0-bootstrap.0 → 0.0.0-stage
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 +2 -452
- package/package.json +4 -108
- package/LICENSE +0 -23
- package/NOTICE +0 -93
- package/README.zh-CN.md +0 -368
- package/cordis.patch.yml +0 -20
- package/lib/client.js +0 -2270
- package/lib/core/compartments.js +0 -424
- package/lib/core/corpus-store.js +0 -176
- package/lib/core/directive-detect.js +0 -147
- package/lib/core/domain-reconcile.js +0 -394
- package/lib/core/domains.js +0 -127
- package/lib/core/embedding-local.js +0 -247
- package/lib/core/global-autostage.js +0 -223
- package/lib/core/global-domains.js +0 -302
- package/lib/core/journal.js +0 -248
- package/lib/core/llm-deadline.js +0 -53
- package/lib/core/machine-domain.js +0 -106
- package/lib/core/maintenance.js +0 -380
- package/lib/core/memory-bridge.js +0 -818
- package/lib/core/memory-categories.js +0 -84
- package/lib/core/memory-scoring.js +0 -65
- package/lib/core/memory-search.js +0 -414
- package/lib/core/memory-write.js +0 -1176
- package/lib/core/policy.js +0 -111
- package/lib/core/profile-confirmation.js +0 -55
- package/lib/core/profile-review.js +0 -375
- package/lib/core/profile-write.js +0 -283
- package/lib/core/reference-seeds.js +0 -63
- package/lib/core/route-health.js +0 -106
- package/lib/core/stores.js +0 -1021
- package/lib/core/tagger.js +0 -7
- package/lib/core/types.js +0 -15
- package/lib/core/vector-backfill.js +0 -140
- package/lib/core/vector-lane.js +0 -184
- package/lib/dsh/command-surface.js +0 -376
- package/lib/dsh/compaction-engine.js +0 -231
- package/lib/dsh/config-switches.js +0 -56
- package/lib/dsh/config.js +0 -13
- package/lib/dsh/context-pressure.js +0 -36
- package/lib/dsh/drop-landing.js +0 -42
- package/lib/dsh/emergency.js +0 -89
- package/lib/dsh/flush-command.js +0 -148
- package/lib/dsh/global-review.js +0 -412
- package/lib/dsh/historian.js +0 -907
- package/lib/dsh/live-journal.js +0 -81
- package/lib/dsh/maintenance-wiring.js +0 -229
- package/lib/dsh/management-pass.js +0 -564
- package/lib/dsh/memory-lane.js +0 -535
- package/lib/dsh/pre-step.js +0 -675
- package/lib/dsh/project-drift.js +0 -116
- package/lib/dsh/recomp.js +0 -192
- package/lib/dsh/reduce-guidance.js +0 -188
- package/lib/dsh/seams.js +0 -588
- package/lib/dsh/search-hint.js +0 -186
- package/lib/dsh/session-notice.js +0 -100
- package/lib/dsh/status-command.js +0 -75
- package/lib/dsh/telemetry.js +0 -349
- package/lib/dsh/tool-bridge.js +0 -1009
- package/lib/dsh/volatile.js +0 -89
- package/lib/index.js +0 -931
- package/tools/migrate-profile-package-name.mjs +0 -317
- package/vendor/onnx/LICENSE +0 -27
- package/vendor/onnx/ort-wasm-simd-threaded.mjs +0 -59
- package/vendor/onnx/ort-wasm-simd-threaded.wasm +0 -0
- package/vendor/onnx/ort.node.min.mjs +0 -8
package/lib/dsh/volatile.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The volatile-reference readers and the decision-point policy resolver
|
|
3
|
-
* (moved verbatim out of index.ts so every wiring module reads config the
|
|
4
|
-
* same way). Schemastery's volatile fields arrive as live references; the
|
|
5
|
-
* `live*` helpers unwrap them (recursively — nested objects wrap each level)
|
|
6
|
-
* so a settings-form edit applies without a remount.
|
|
7
|
-
*/
|
|
8
|
-
import { DEFAULT_POLICY } from "../core/policy.js";
|
|
9
|
-
/** Same as {@link liveNumber} for strings (volatile enums such as log level). */
|
|
10
|
-
export function liveString(value, fallback) {
|
|
11
|
-
const resolved = liveValue(value);
|
|
12
|
-
return typeof resolved === 'string' && resolved.length > 0 ? resolved : fallback;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Unwrap a schemastery volatile reference chain. Nested config objects wrap
|
|
16
|
-
* each level, so `config.a?.b?.c` can hand back a reference whose `.get()`
|
|
17
|
-
* is itself a reference — one dereference is not always enough (measured:
|
|
18
|
-
* `maintenance.verifyProvider` printed `[object Object]` with single unwrap).
|
|
19
|
-
*/
|
|
20
|
-
export function liveValue(value) {
|
|
21
|
-
if (value !== null && typeof value === 'object' && typeof value.get === 'function') {
|
|
22
|
-
return liveValue(value.get());
|
|
23
|
-
}
|
|
24
|
-
return value;
|
|
25
|
-
}
|
|
26
|
-
/** Read a value that may be a plain number or a volatile reference. */
|
|
27
|
-
export function liveNumber(value, fallback) {
|
|
28
|
-
const resolved = liveValue(value);
|
|
29
|
-
return typeof resolved === 'number' && Number.isFinite(resolved) ? resolved : fallback;
|
|
30
|
-
}
|
|
31
|
-
/** Same as {@link liveNumber} for booleans (volatile toggles). */
|
|
32
|
-
export function liveBoolean(value, fallback) {
|
|
33
|
-
if (typeof value === 'boolean')
|
|
34
|
-
return value;
|
|
35
|
-
if (value !== null && typeof value === 'object' && typeof value.get === 'function') {
|
|
36
|
-
const current = value.get();
|
|
37
|
-
if (typeof current === 'boolean')
|
|
38
|
-
return current;
|
|
39
|
-
}
|
|
40
|
-
return fallback;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Read a provider/model route pin live.
|
|
44
|
-
*
|
|
45
|
-
* A pin is only a pin when BOTH halves are non-empty (the same rule the host
|
|
46
|
-
* applies to the maintenance route): a half-filled pair would otherwise be
|
|
47
|
-
* passed to the historian as a route and fail the run with "no configured
|
|
48
|
-
* model". `undefined` means "follow the session route".
|
|
49
|
-
*/
|
|
50
|
-
export function liveRoute(provider, model) {
|
|
51
|
-
const providerValue = typeof provider === 'string' ? provider : liveString(provider, '');
|
|
52
|
-
const modelValue = typeof model === 'string' ? model : liveString(model, '');
|
|
53
|
-
return providerValue.length > 0 && modelValue.length > 0
|
|
54
|
-
? { provider: providerValue, model: modelValue }
|
|
55
|
-
: undefined;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* The effective pressure policy, evaluated AT THE DECISION POINT.
|
|
59
|
-
*
|
|
60
|
-
* This is what makes a settings-form edit take effect without a restart: the
|
|
61
|
-
* form writes a volatile value, the loader commits it into the reference, and
|
|
62
|
-
* the next pass re-reads it here.
|
|
63
|
-
*/
|
|
64
|
-
export function policyOf(configured) {
|
|
65
|
-
const raw = (configured ?? {});
|
|
66
|
-
// Deliberately unannotated: annotating this `PressurePolicy` makes every
|
|
67
|
-
// property below a read-only assignment (45 compile errors) even though the
|
|
68
|
-
// spread already produced a mutable copy. The return type still checks it.
|
|
69
|
-
const policy = { ...DEFAULT_POLICY };
|
|
70
|
-
for (const key of Object.keys(DEFAULT_POLICY)) {
|
|
71
|
-
const value = raw[key];
|
|
72
|
-
if (value === undefined)
|
|
73
|
-
continue;
|
|
74
|
-
const fallback = DEFAULT_POLICY[key];
|
|
75
|
-
if (typeof fallback === 'number') {
|
|
76
|
-
policy[key] = liveNumber(value, fallback);
|
|
77
|
-
}
|
|
78
|
-
else if (typeof fallback === 'boolean') {
|
|
79
|
-
policy[key] = liveBoolean(value, fallback);
|
|
80
|
-
}
|
|
81
|
-
else if (typeof fallback === 'string') {
|
|
82
|
-
policy[key] = liveString(value, fallback);
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
policy[key] = value;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return policy;
|
|
89
|
-
}
|