@evomap/evolver-core 2.0.0 → 2.0.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/algo/antiDistill.js +1 -167
- package/dist/algo/bans.js +1 -33
- package/dist/algo/candidateAssembly.js +1 -273
- package/dist/algo/capabilityCandidates.js +1 -146
- package/dist/algo/confidence.js +1 -196
- package/dist/algo/conversationSniffer.js +1 -149
- package/dist/algo/cycleEngine.js +1 -625
- package/dist/algo/cycleFailureClassifier.js +1 -112
- package/dist/algo/epigenetics.js +1 -41
- package/dist/algo/evolutionEvent.js +1 -24
- package/dist/algo/exploration.js +1 -68
- package/dist/algo/geneHealth.js +1 -17
- package/dist/algo/geneIntake.js +1 -128
- package/dist/algo/genePromotion.js +1 -53
- package/dist/algo/geneSelection.js +1 -546
- package/dist/algo/index.js +1 -22
- package/dist/algo/memoryGraph.js +1 -86
- package/dist/algo/mutation.js +1 -22
- package/dist/algo/orchestrator.js +1 -87
- package/dist/algo/publishEligibility.js +1 -52
- package/dist/algo/solidify.js +1 -63
- package/dist/algo/strategyPresets.js +1 -61
- package/dist/algo/ucb1.js +1 -156
- package/dist/benchmark/antiGeneBenchmark.js +1 -252
- package/dist/benchmark/antiGeneImpact.js +1 -34
- package/dist/benchmark/antiGeneRollout.js +1 -269
- package/dist/benchmark/benchmark.js +1 -26
- package/dist/benchmark/evolutionThesisSolver.js +1 -41
- package/dist/benchmark/index.js +1 -7
- package/dist/benchmark/selectionFlatAbstention.js +1 -481
- package/dist/benchmark/thesis.js +1 -150
- package/dist/benchmark/triggerShift.js +1 -106
- package/dist/cycle/cycleTimeline.js +1 -74
- package/dist/cycle/index.js +1 -2
- package/dist/cycle/stateMachine.js +1 -25
- package/dist/hub/agentDirectory.js +1 -104
- package/dist/hub/assetCallLog.js +1 -195
- package/dist/hub/bindings.js +1 -121
- package/dist/hub/capability.js +1 -1
- package/dist/hub/conversationDistiller.js +1 -264
- package/dist/hub/fake.js +1 -70
- package/dist/hub/hubReview.js +1 -106
- package/dist/hub/index.js +1 -11
- package/dist/hub/ingest.js +1 -15
- package/dist/hub/questionGenerator.js +1 -408
- package/dist/hub/reuseDecision.js +1 -127
- package/dist/hub/sanitize.js +1 -322
- package/dist/material/boundary.js +1 -14
- package/dist/material/consumer.js +1 -55
- package/dist/material/emit.js +1 -52
- package/dist/material/factory.js +1 -25
- package/dist/material/index.js +1 -9
- package/dist/material/materialArchive.js +1 -466
- package/dist/material/materialStore.js +1 -69
- package/dist/material/sampling.js +1 -39
- package/dist/material/sources.js +1 -33
- package/dist/material/watermark.js +1 -76
- package/dist/personality/drift.js +1 -106
- package/dist/personality/events.js +1 -37
- package/dist/personality/evolveOps.js +1 -93
- package/dist/personality/index.js +1 -11
- package/dist/personality/mutate.js +1 -39
- package/dist/personality/pivot.js +1 -22
- package/dist/personality/prompt.js +1 -62
- package/dist/personality/riskGate.js +1 -80
- package/dist/personality/schema.js +1 -119
- package/dist/personality/select.js +1 -71
- package/dist/personality/stats.js +1 -82
- package/dist/personality/store.js +1 -92
- package/dist/schema/common.js +1 -17
- package/dist/schema/evolutionGraph.js +1 -187
- package/dist/schema/index.js +1 -6
- package/dist/schema/material.js +1 -50
- package/dist/schema/problem.js +1 -45
- package/dist/schema/proofOfWork.js +1 -9
- package/dist/schema/signal.js +1 -19
- package/dist/signals/curriculum.js +1 -202
- package/dist/signals/cycleHistoryFromEvents.js +1 -105
- package/dist/signals/expand.js +1 -293
- package/dist/signals/extractor.js +1 -82
- package/dist/signals/index.js +1 -8
- package/dist/signals/metaSignals.js +1 -200
- package/dist/signals/signalGate.js +1 -40
- package/dist/signals/taskDomain.js +1 -43
- package/dist/signals/traceSignals.js +1 -123
- package/dist/strategy/constraintAblation.js +1 -2820
- package/dist/strategy/constraintAblationPredicates.js +1 -339
- package/dist/strategy/experiment.js +1 -63
- package/dist/strategy/index.js +1 -3
- package/dist/strategy/strategyPoint.js +1 -23
- package/package.json +1 -1
|
@@ -1,119 +1 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { extensions } from '../schema/common.js';
|
|
3
|
-
/**
|
|
4
|
-
* PersonalityState = 可进化人格 (v1 src/gep/personality.js 的 v2 端口).
|
|
5
|
-
*
|
|
6
|
-
* 五维行为向量, 各 0..1, 决定进化"风格"而非"内容":
|
|
7
|
-
* - rigor 严谨度: 越高越保守/协议优先, 是高危变异的准入前提
|
|
8
|
-
* - creativity 创造性: 越高越倾向 innovate/explore, 跳出局部最优
|
|
9
|
-
* - verbosity 啰嗦度: 影响产物叙述密度 (纯 prompt 提示, 不改逻辑)
|
|
10
|
-
* - risk_tolerance 风险容忍: 越高越敢冒险, 但会被风险闸压制
|
|
11
|
-
* - obedience 服从度: 越高越贴合协议/用户指令
|
|
12
|
-
*
|
|
13
|
-
* 三条用途 (v2 必须保留语义, 见 riskGate.ts / prompt.ts / (PR-2) selection):
|
|
14
|
-
* 1. 注入每轮 GEP prompt, 决定进化风格 (prompt.ts)
|
|
15
|
-
* 2. 变异风险闸: high-risk/innovate 变异只在 rigor≥0.6 且 risk_tolerance≤0.5 放行 (riskGate.ts)
|
|
16
|
-
* 3. 自然选择 + 小步变异自调参, 成功强化/失败淘汰, 全程进事件流可审计 (PR-2)
|
|
17
|
-
*/
|
|
18
|
-
/** 五维行为轴 (顺序固定 — personalityKey / 遍历依赖它). */
|
|
19
|
-
export const PERSONALITY_AXES = ['rigor', 'creativity', 'verbosity', 'risk_tolerance', 'obedience'];
|
|
20
|
-
/** 保守默认: 协议优先、安全、低风险 (v1 defaultPersonalityState 原值). */
|
|
21
|
-
export const DEFAULT_PERSONALITY = Object.freeze({
|
|
22
|
-
rigor: 0.7,
|
|
23
|
-
creativity: 0.35,
|
|
24
|
-
verbosity: 0.25,
|
|
25
|
-
risk_tolerance: 0.4,
|
|
26
|
-
obedience: 0.85,
|
|
27
|
-
});
|
|
28
|
-
const axis01 = z.number().min(0).max(1);
|
|
29
|
-
/** 五维人格状态. type 判别标签保留 (v1/事件流互认). */
|
|
30
|
-
export const personalityState = z.object({
|
|
31
|
-
type: z.literal('PersonalityState').default('PersonalityState'),
|
|
32
|
-
rigor: axis01.default(DEFAULT_PERSONALITY.rigor),
|
|
33
|
-
creativity: axis01.default(DEFAULT_PERSONALITY.creativity),
|
|
34
|
-
verbosity: axis01.default(DEFAULT_PERSONALITY.verbosity),
|
|
35
|
-
risk_tolerance: axis01.default(DEFAULT_PERSONALITY.risk_tolerance),
|
|
36
|
-
obedience: axis01.default(DEFAULT_PERSONALITY.obedience),
|
|
37
|
-
});
|
|
38
|
-
/** 一个人格键的运行统计 (自然选择的适应度原料; PR-2 回写). */
|
|
39
|
-
export const personalityStats = z.object({
|
|
40
|
-
success: z.number().int().nonnegative().default(0),
|
|
41
|
-
fail: z.number().int().nonnegative().default(0),
|
|
42
|
-
/** 增量均值; n 为纳入均值的样本数. */
|
|
43
|
-
avgScore: z.number().min(0).max(1).default(0.5),
|
|
44
|
-
n: z.number().int().nonnegative().default(0),
|
|
45
|
-
updatedAt: z.string().datetime().nullable().default(null),
|
|
46
|
-
});
|
|
47
|
-
/** 单条人格变更历史 (可审计; 也镜像进事件流). */
|
|
48
|
-
export const personalityHistoryEntry = z.object({
|
|
49
|
-
at: z.string().datetime(),
|
|
50
|
-
key: z.string(),
|
|
51
|
-
outcome: z.string(),
|
|
52
|
-
score: z.number().min(0).max(1).nullable().default(null),
|
|
53
|
-
notes: z.string().nullable().default(null),
|
|
54
|
-
});
|
|
55
|
-
/** 持久化模型: 当前人格 + 各键统计 + 变更历史 (v1 loadPersonalityModel 的 v2 形状). */
|
|
56
|
-
export const personalityModel = z.object({
|
|
57
|
-
version: z.literal(1).default(1),
|
|
58
|
-
current: personalityState.default(() => personalityState.parse({})),
|
|
59
|
-
stats: z.record(z.string(), personalityStats).default({}),
|
|
60
|
-
history: z.array(personalityHistoryEntry).default([]),
|
|
61
|
-
updatedAt: z.string().datetime().nullable().default(null),
|
|
62
|
-
extensions,
|
|
63
|
-
});
|
|
64
|
-
/** 单个变异提案 (作用于一个轴, delta 会被 applyMutations 夹取). */
|
|
65
|
-
export const personalityMutation = z.object({
|
|
66
|
-
type: z.literal('PersonalityMutation').default('PersonalityMutation'),
|
|
67
|
-
param: z.enum(PERSONALITY_AXES),
|
|
68
|
-
delta: z.number(),
|
|
69
|
-
reason: z.string().default(''),
|
|
70
|
-
});
|
|
71
|
-
const clamp01 = (x) => {
|
|
72
|
-
const n = Number(x);
|
|
73
|
-
if (!Number.isFinite(n))
|
|
74
|
-
return 0;
|
|
75
|
-
return Math.max(0, Math.min(1, n));
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* 把任意输入夹成合法 PersonalityState (缺失/越界/非数 → 夹到 [0,1]).
|
|
79
|
-
* 注意: 与 v1 一致, 非有限值夹为 0 而非默认值 — 显式坏输入不静默"复活"成保守默认.
|
|
80
|
-
*/
|
|
81
|
-
export function normalizePersonalityState(state) {
|
|
82
|
-
const s = (state && typeof state === 'object' ? state : {});
|
|
83
|
-
return {
|
|
84
|
-
type: 'PersonalityState',
|
|
85
|
-
rigor: clamp01(s['rigor']),
|
|
86
|
-
creativity: clamp01(s['creativity']),
|
|
87
|
-
verbosity: clamp01(s['verbosity']),
|
|
88
|
-
risk_tolerance: clamp01(s['risk_tolerance']),
|
|
89
|
-
obedience: clamp01(s['obedience']),
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
/** 严格校验: type 标签对且五轴都是 [0,1] 有限数 (不做夹取, 用于信任边界). */
|
|
93
|
-
export function isValidPersonalityState(obj) {
|
|
94
|
-
return personalityState.safeParse(obj).success && obj.type === 'PersonalityState';
|
|
95
|
-
}
|
|
96
|
-
function roundToStep(x, step) {
|
|
97
|
-
if (!Number.isFinite(step) || step <= 0)
|
|
98
|
-
return x;
|
|
99
|
-
return Math.round(x / step) * step;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* 稳定桶键: 五轴各按 0.1 步长量化后拼串. 相近人格落同一桶, 统计才能积累 (v1 personalityKey).
|
|
103
|
-
* 例: "rigor=0.7|creativity=0.4|verbosity=0.2|risk_tolerance=0.4|obedience=0.9"
|
|
104
|
-
*/
|
|
105
|
-
export function personalityKey(state) {
|
|
106
|
-
const s = normalizePersonalityState(state);
|
|
107
|
-
return PERSONALITY_AXES.map((k) => `${k}=${roundToStep(s[k], 0.1).toFixed(1)}`).join('|');
|
|
108
|
-
}
|
|
109
|
-
/** 由 personalityKey 反解回 PersonalityState (未识别轴回落默认; 自然选择需要). */
|
|
110
|
-
export function parseKeyToState(key) {
|
|
111
|
-
const out = { ...DEFAULT_PERSONALITY };
|
|
112
|
-
for (const part of String(key ?? '').split('|')) {
|
|
113
|
-
const [k, v] = part.split('=').map((x) => x.trim());
|
|
114
|
-
if (k && PERSONALITY_AXES.includes(k))
|
|
115
|
-
out[k] = clamp01(v);
|
|
116
|
-
}
|
|
117
|
-
return normalizePersonalityState(out);
|
|
118
|
-
}
|
|
119
|
-
export { clamp01 };
|
|
1
|
+
const _0x2e8c5d=_0x5d46;(function(_0x6e1072,_0x102a9b){const _0x53ecea=_0x5d46,_0x36d254=_0x6e1072();while(!![]){try{const _0x5923da=parseInt(_0x53ecea(0x179,'\x33\x69\x55\x33'))/(0x1*-0x24de+-0x160a+-0x55b*-0xb)*(-parseInt(_0x53ecea(0x1d6,'\x36\x67\x7a\x69'))/(0x1777*-0x1+0x14*0x1f1+0xf5b*-0x1))+-parseInt(_0x53ecea(0x1cc,'\x56\x28\x6f\x78'))/(0x1*-0x2417+0x220c+-0x2*-0x107)+parseInt(_0x53ecea(0x19a,'\x42\x26\x4b\x49'))/(0x1*0x17ee+0x1e89*0x1+-0x3673)*(-parseInt(_0x53ecea(0x170,'\x42\x57\x76\x59'))/(-0x1318+-0x2*0x103c+-0x8b*-0x5f))+parseInt(_0x53ecea(0x189,'\x70\x54\x21\x6a'))/(-0x1*-0x1f0e+0x6*-0x27c+-0x1*0x1020)*(parseInt(_0x53ecea(0x1a9,'\x33\x69\x55\x33'))/(-0x7f*0x3d+0x4*0x610+0x60a))+parseInt(_0x53ecea(0x1ce,'\x56\x28\x6f\x78'))/(-0x14b*0x11+-0x2b*-0xbf+-0xa12)+-parseInt(_0x53ecea(0x198,'\x33\x5b\x51\x68'))/(0xe0d+0x69+-0xe6d)+-parseInt(_0x53ecea(0x1b3,'\x34\x39\x5a\x62'))/(-0x6df+0xd6d+-0x684)*(-parseInt(_0x53ecea(0x18b,'\x6c\x70\x67\x44'))/(-0x2d4*-0x7+0xbda+-0x1f9b));if(_0x5923da===_0x102a9b)break;else _0x36d254['push'](_0x36d254['shift']());}catch(_0x4296f5){_0x36d254['push'](_0x36d254['shift']());}}}(_0x11c3,0x5fd3b*-0x2+-0xddaf4+0x2813dd));import{z}from'\x7a\x6f\x64';import{extensions}from'\x2e\x2e\x2f\x73\x63\x68\x65\x6d\x61\x2f\x63\x6f\x6d\x6d\x6f\x6e\x2e\x6a\x73';export const PERSONALITY_AXES=[_0x2e8c5d(0x16e,'\x66\x37\x29\x26'),_0x2e8c5d(0x1d8,'\x46\x6c\x45\x57')+'\x74\x79',_0x2e8c5d(0x1c4,'\x73\x49\x4d\x77')+'\x79',_0x2e8c5d(0x168,'\x73\x6b\x25\x5e')+'\x65\x72\x61\x6e\x63\x65',_0x2e8c5d(0x182,'\x33\x69\x55\x33')+'\x65'];export const DEFAULT_PERSONALITY=Object[_0x2e8c5d(0x177,'\x70\x54\x21\x6a')]({'\x72\x69\x67\x6f\x72':0.7,'\x63\x72\x65\x61\x74\x69\x76\x69\x74\x79':0.35,'\x76\x65\x72\x62\x6f\x73\x69\x74\x79':0.25,'\x72\x69\x73\x6b\x5f\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65':0.4,'\x6f\x62\x65\x64\x69\x65\x6e\x63\x65':0.85});const axis01=z['\x6e\x75\x6d\x62\x65\x72']()[_0x2e8c5d(0x193,'\x74\x72\x50\x71')](-0x1*-0x24fb+0x1b06+-0x91*0x71)[_0x2e8c5d(0x16a,'\x33\x69\x55\x33')](0x121d+0x33a*0x4+-0x5*0x634);export const personalityState=z[_0x2e8c5d(0x190,'\x69\x6b\x62\x36')]({'\x74\x79\x70\x65':z[_0x2e8c5d(0x17b,'\x6f\x50\x66\x5a')](_0x2e8c5d(0x1b6,'\x24\x38\x56\x62')+_0x2e8c5d(0x1a4,'\x68\x56\x74\x64'))[_0x2e8c5d(0x1a3,'\x4c\x64\x49\x26')](_0x2e8c5d(0x1be,'\x56\x28\x6f\x78')+'\x69\x74\x79\x53\x74\x61\x74\x65'),'\x72\x69\x67\x6f\x72':axis01[_0x2e8c5d(0x1c8,'\x34\x39\x5a\x62')](DEFAULT_PERSONALITY[_0x2e8c5d(0x1af,'\x75\x4c\x6b\x6f')]),'\x63\x72\x65\x61\x74\x69\x76\x69\x74\x79':axis01[_0x2e8c5d(0x1e0,'\x73\x6b\x25\x5e')](DEFAULT_PERSONALITY['\x63\x72\x65\x61\x74\x69\x76\x69'+'\x74\x79']),'\x76\x65\x72\x62\x6f\x73\x69\x74\x79':axis01[_0x2e8c5d(0x1c0,'\x49\x28\x73\x45')](DEFAULT_PERSONALITY[_0x2e8c5d(0x18f,'\x49\x28\x73\x45')+'\x79']),'\x72\x69\x73\x6b\x5f\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65':axis01[_0x2e8c5d(0x1b0,'\x6b\x72\x62\x30')](DEFAULT_PERSONALITY[_0x2e8c5d(0x17f,'\x23\x6c\x55\x34')+'\x65\x72\x61\x6e\x63\x65']),'\x6f\x62\x65\x64\x69\x65\x6e\x63\x65':axis01[_0x2e8c5d(0x181,'\x73\x49\x4d\x77')](DEFAULT_PERSONALITY[_0x2e8c5d(0x191,'\x29\x6a\x47\x57')+'\x65'])});export const personalityStats=z[_0x2e8c5d(0x1d4,'\x41\x58\x5b\x39')]({'\x73\x75\x63\x63\x65\x73\x73':z[_0x2e8c5d(0x17a,'\x72\x63\x69\x50')]()[_0x2e8c5d(0x18c,'\x23\x6c\x55\x34')]()[_0x2e8c5d(0x199,'\x36\x2a\x67\x4d')+_0x2e8c5d(0x1b7,'\x4a\x50\x70\x72')]()[_0x2e8c5d(0x1a3,'\x4c\x64\x49\x26')](-0x1bed+-0x4ba+0x20a7),'\x66\x61\x69\x6c':z['\x6e\x75\x6d\x62\x65\x72']()[_0x2e8c5d(0x1ca,'\x4a\x50\x70\x72')]()['\x6e\x6f\x6e\x6e\x65\x67\x61\x74'+_0x2e8c5d(0x1d9,'\x41\x58\x5b\x39')]()[_0x2e8c5d(0x176,'\x66\x37\x29\x26')](0x12e3+-0x181*0x15+0xcb2),'\x61\x76\x67\x53\x63\x6f\x72\x65':z[_0x2e8c5d(0x186,'\x75\x77\x21\x26')]()[_0x2e8c5d(0x196,'\x42\x57\x76\x59')](-0x2128+0x43b+0x1ced)[_0x2e8c5d(0x1da,'\x46\x6c\x45\x57')](-0x151*-0x3+0x255*0x9+0x1eb*-0xd)[_0x2e8c5d(0x1cb,'\x6f\x71\x7a\x5d')](-0x1e65*0x1+-0xdf1*-0x1+0x4e*0x36+0.5),'\x6e':z[_0x2e8c5d(0x1e3,'\x4f\x76\x25\x57')]()[_0x2e8c5d(0x1c6,'\x42\x5d\x38\x56')]()[_0x2e8c5d(0x19b,'\x33\x69\x55\x33')+_0x2e8c5d(0x1ab,'\x4e\x40\x5e\x23')]()[_0x2e8c5d(0x175,'\x6c\x49\x26\x44')](-0x1d*-0x151+0x2*0xcfd+-0x4027),'\x75\x70\x64\x61\x74\x65\x64\x41\x74':z[_0x2e8c5d(0x1ae,'\x72\x63\x69\x50')]()[_0x2e8c5d(0x1c7,'\x57\x34\x53\x6a')]()[_0x2e8c5d(0x197,'\x54\x5b\x30\x6d')]()[_0x2e8c5d(0x178,'\x54\x5b\x30\x6d')](null)});export const personalityHistoryEntry=z[_0x2e8c5d(0x1d5,'\x6c\x49\x26\x44')]({'\x61\x74':z[_0x2e8c5d(0x19f,'\x34\x39\x5a\x62')]()[_0x2e8c5d(0x1aa,'\x56\x28\x6f\x78')](),'\x6b\x65\x79':z[_0x2e8c5d(0x17d,'\x71\x34\x24\x5b')](),'\x6f\x75\x74\x63\x6f\x6d\x65':z[_0x2e8c5d(0x1b2,'\x6f\x50\x66\x5a')](),'\x73\x63\x6f\x72\x65':z[_0x2e8c5d(0x16c,'\x54\x5b\x30\x6d')]()[_0x2e8c5d(0x17e,'\x42\x26\x4b\x49')](0x12*-0x130+-0x4f0+-0x1a50*-0x1)[_0x2e8c5d(0x18e,'\x24\x38\x56\x62')](0x8b6+0x25ea+-0x37*0xd9)[_0x2e8c5d(0x1a7,'\x4c\x64\x49\x26')]()['\x64\x65\x66\x61\x75\x6c\x74'](null),'\x6e\x6f\x74\x65\x73':z[_0x2e8c5d(0x1c2,'\x33\x5b\x51\x68')]()[_0x2e8c5d(0x1b9,'\x57\x34\x53\x6a')]()[_0x2e8c5d(0x181,'\x73\x49\x4d\x77')](null)});export const personalityModel=z[_0x2e8c5d(0x16f,'\x49\x28\x73\x45')]({'\x76\x65\x72\x73\x69\x6f\x6e':z[_0x2e8c5d(0x1ad,'\x54\x5b\x30\x6d')](-0x47c+0x22*-0x2f+0xabb)[_0x2e8c5d(0x1e0,'\x73\x6b\x25\x5e')](-0x1e2a+0x3b2+-0x3*-0x8d3),'\x63\x75\x72\x72\x65\x6e\x74':personalityState['\x64\x65\x66\x61\x75\x6c\x74'](()=>personalityState[_0x2e8c5d(0x1bf,'\x33\x5b\x51\x68')]({})),'\x73\x74\x61\x74\x73':z[_0x2e8c5d(0x18a,'\x36\x2a\x67\x4d')](z[_0x2e8c5d(0x1dd,'\x62\x5e\x75\x35')](),personalityStats)[_0x2e8c5d(0x1b0,'\x6b\x72\x62\x30')]({}),'\x68\x69\x73\x74\x6f\x72\x79':z[_0x2e8c5d(0x1a6,'\x56\x68\x77\x75')](personalityHistoryEntry)[_0x2e8c5d(0x184,'\x44\x62\x53\x45')]([]),'\x75\x70\x64\x61\x74\x65\x64\x41\x74':z[_0x2e8c5d(0x17c,'\x75\x4c\x6b\x6f')]()[_0x2e8c5d(0x16b,'\x44\x62\x53\x45')]()[_0x2e8c5d(0x1b4,'\x74\x72\x50\x71')]()[_0x2e8c5d(0x1a2,'\x57\x34\x53\x6a')](null),'\x65\x78\x74\x65\x6e\x73\x69\x6f\x6e\x73':extensions});function _0x5d46(_0x3a5171,_0x5df66f){_0x3a5171=_0x3a5171-(-0x1d23+-0x1*-0x205a+-0x1d0);const _0x1e2792=_0x11c3();let _0x29851f=_0x1e2792[_0x3a5171];if(_0x5d46['\x78\x69\x4f\x72\x42\x4d']===undefined){var _0x33d205=function(_0x5ec5fb){const _0x468093='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';let _0x128335='',_0xadf943='';for(let _0x343369=0x851+0x6*-0x26d+0x63d,_0x14a9e8,_0x180dda,_0x33f6b0=0x1b4+-0x2*-0x78+-0x2a4;_0x180dda=_0x5ec5fb['\x63\x68\x61\x72\x41\x74'](_0x33f6b0++);~_0x180dda&&(_0x14a9e8=_0x343369%(-0xec6+0x1f7f+0x1*-0x10b5)?_0x14a9e8*(-0x1*0x1d75+-0x1158+-0xf*-0x323)+_0x180dda:_0x180dda,_0x343369++%(0x24af+0x1734+-0x75*0x83))?_0x128335+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](-0xe46+-0x187d*-0x1+-0x1*0x938&_0x14a9e8>>(-(0x19bb*-0x1+-0x1*0x1fa1+-0xe*-0x419)*_0x343369&0x89*-0x13+-0x183+-0x6b*-0x1c)):0x11a4+0x13e1*0x1+-0x2585){_0x180dda=_0x468093['\x69\x6e\x64\x65\x78\x4f\x66'](_0x180dda);}for(let _0x2582dc=-0xd82*-0x1+-0x23d7*0x1+0x1655,_0x14769f=_0x128335['\x6c\x65\x6e\x67\x74\x68'];_0x2582dc<_0x14769f;_0x2582dc++){_0xadf943+='\x25'+('\x30\x30'+_0x128335['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x2582dc)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0x33*0x18+0x4c*-0x6b+0xd86*0x2))['\x73\x6c\x69\x63\x65'](-(0x6bb+0x1*0xb4+-0x76d*0x1));}return decodeURIComponent(_0xadf943);};const _0xeee313=function(_0x3f7459,_0x4066aa){let _0x2bea59=[],_0x1fa2d7=0x1419+-0xcd0+0x1*-0x749,_0x2254ae,_0x545cca='';_0x3f7459=_0x33d205(_0x3f7459);let _0xa28dc2;for(_0xa28dc2=0x2403+-0x92e+-0x1*0x1ad5;_0xa28dc2<-0x18f5*-0x1+0xcf4+-0x24e9;_0xa28dc2++){_0x2bea59[_0xa28dc2]=_0xa28dc2;}for(_0xa28dc2=0x359*0x5+-0x169*0x2+-0xdeb;_0xa28dc2<-0x2106+0x3a1+0x1e65*0x1;_0xa28dc2++){_0x1fa2d7=(_0x1fa2d7+_0x2bea59[_0xa28dc2]+_0x4066aa['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0xa28dc2%_0x4066aa['\x6c\x65\x6e\x67\x74\x68']))%(0x362*0x8+-0x1*-0x1c9f+-0x36af),_0x2254ae=_0x2bea59[_0xa28dc2],_0x2bea59[_0xa28dc2]=_0x2bea59[_0x1fa2d7],_0x2bea59[_0x1fa2d7]=_0x2254ae;}_0xa28dc2=0x5*0x79+-0x14ab+0x61a*0x3,_0x1fa2d7=0x16f3+-0xb9c+-0xb57;for(let _0x1d46b0=-0xd0f*0x1+-0x660+-0x3e3*-0x5;_0x1d46b0<_0x3f7459['\x6c\x65\x6e\x67\x74\x68'];_0x1d46b0++){_0xa28dc2=(_0xa28dc2+(-0x6a*0x3b+-0x2128+0x3997))%(-0x151*-0x3+0x255*0x9+0x17f*-0x10),_0x1fa2d7=(_0x1fa2d7+_0x2bea59[_0xa28dc2])%(-0x1e65*0x1+-0xdf1*-0x1+0x45d*0x4),_0x2254ae=_0x2bea59[_0xa28dc2],_0x2bea59[_0xa28dc2]=_0x2bea59[_0x1fa2d7],_0x2bea59[_0x1fa2d7]=_0x2254ae,_0x545cca+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](_0x3f7459['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x1d46b0)^_0x2bea59[(_0x2bea59[_0xa28dc2]+_0x2bea59[_0x1fa2d7])%(-0x1d*-0x151+0x2*0xcfd+-0x3f27)]);}return _0x545cca;};_0x5d46['\x55\x59\x42\x4c\x4c\x44']=_0xeee313,_0x5d46['\x66\x6f\x79\x62\x6c\x51']={},_0x5d46['\x78\x69\x4f\x72\x42\x4d']=!![];}const _0x1be203=_0x1e2792[0x12*-0x130+-0x4f0+-0x1a50*-0x1],_0x2a3715=_0x3a5171+_0x1be203,_0x2811b1=_0x5d46['\x66\x6f\x79\x62\x6c\x51'][_0x2a3715];return!_0x2811b1?(_0x5d46['\x47\x49\x6f\x6e\x53\x70']===undefined&&(_0x5d46['\x47\x49\x6f\x6e\x53\x70']=!![]),_0x29851f=_0x5d46['\x55\x59\x42\x4c\x4c\x44'](_0x29851f,_0x5df66f),_0x5d46['\x66\x6f\x79\x62\x6c\x51'][_0x2a3715]=_0x29851f):_0x29851f=_0x2811b1,_0x29851f;}export const personalityMutation=z[_0x2e8c5d(0x171,'\x42\x57\x76\x59')]({'\x74\x79\x70\x65':z[_0x2e8c5d(0x1a0,'\x4a\x50\x70\x72')](_0x2e8c5d(0x173,'\x43\x64\x29\x46')+'\x69\x74\x79\x4d\x75\x74\x61\x74'+_0x2e8c5d(0x1b5,'\x49\x28\x73\x45'))[_0x2e8c5d(0x1de,'\x6f\x50\x66\x5a')](_0x2e8c5d(0x1df,'\x6b\x72\x62\x30')+_0x2e8c5d(0x1d0,'\x6f\x71\x7a\x5d')+_0x2e8c5d(0x1db,'\x35\x39\x23\x41')),'\x70\x61\x72\x61\x6d':z[_0x2e8c5d(0x19c,'\x66\x37\x29\x26')](PERSONALITY_AXES),'\x64\x65\x6c\x74\x61':z[_0x2e8c5d(0x195,'\x49\x28\x73\x45')](),'\x72\x65\x61\x73\x6f\x6e':z[_0x2e8c5d(0x1ae,'\x72\x63\x69\x50')]()[_0x2e8c5d(0x1c3,'\x75\x4c\x6b\x6f')]('')});const clamp01=_0x30f3ca=>{const _0x2c6769=_0x2e8c5d,_0x11f678=Number(_0x30f3ca);if(!Number[_0x2c6769(0x1d1,'\x56\x68\x77\x75')](_0x11f678))return-0x1*0x164e+0xceb+0x963;return Math[_0x2c6769(0x194,'\x73\x49\x4d\x77')](0x1e0c+0x3*-0xa40+0xb4,Math[_0x2c6769(0x1cd,'\x54\x5b\x30\x6d')](0x1*-0xaf1+0x9ba+0x34*0x6,_0x11f678));};export function normalizePersonalityState(_0x384d62){const _0xe4e80e=_0x2e8c5d,_0x10d445=_0x384d62&&typeof _0x384d62==='\x6f\x62\x6a\x65\x63\x74'?_0x384d62:{};return{'\x74\x79\x70\x65':_0xe4e80e(0x1bc,'\x46\x6c\x45\x57')+_0xe4e80e(0x1ba,'\x49\x28\x73\x45'),'\x72\x69\x67\x6f\x72':clamp01(_0x10d445[_0xe4e80e(0x1dc,'\x46\x44\x54\x66')]),'\x63\x72\x65\x61\x74\x69\x76\x69\x74\x79':clamp01(_0x10d445[_0xe4e80e(0x1c9,'\x34\x39\x5a\x62')+'\x74\x79']),'\x76\x65\x72\x62\x6f\x73\x69\x74\x79':clamp01(_0x10d445['\x76\x65\x72\x62\x6f\x73\x69\x74'+'\x79']),'\x72\x69\x73\x6b\x5f\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65':clamp01(_0x10d445[_0xe4e80e(0x183,'\x6c\x70\x67\x44')+_0xe4e80e(0x167,'\x6c\x70\x67\x44')]),'\x6f\x62\x65\x64\x69\x65\x6e\x63\x65':clamp01(_0x10d445[_0xe4e80e(0x1e4,'\x23\x4e\x48\x6b')+'\x65'])};}export function isValidPersonalityState(_0x4d175c){const _0x287599=_0x2e8c5d;return personalityState[_0x287599(0x1d3,'\x75\x4c\x6b\x6f')+'\x65'](_0x4d175c)[_0x287599(0x18d,'\x24\x38\x56\x62')]&&_0x4d175c[_0x287599(0x1c5,'\x36\x2a\x67\x4d')]===_0x287599(0x1b8,'\x6c\x49\x26\x44')+_0x287599(0x1ba,'\x49\x28\x73\x45');}function _0x11c3(){const _0x1f3750=['\x57\x36\x4f\x67\x57\x37\x46\x64\x48\x68\x42\x63\x54\x43\x6f\x4f\x41\x61','\x57\x50\x68\x63\x55\x72\x47','\x6a\x38\x6b\x43\x57\x51\x56\x63\x49\x53\x6f\x6b\x62\x53\x6b\x46\x68\x61','\x57\x51\x58\x6d\x57\x37\x6d\x44\x57\x37\x31\x46\x43\x43\x6b\x32','\x6f\x66\x37\x63\x4a\x43\x6f\x77\x57\x50\x65\x57\x57\x37\x4a\x64\x4a\x71','\x57\x35\x6d\x47\x57\x4f\x53\x77\x57\x36\x5a\x63\x4b\x53\x6b\x33\x57\x34\x47','\x44\x53\x6f\x30\x69\x6d\x6f\x6f\x69\x43\x6b\x74\x74\x6d\x6b\x55','\x45\x38\x6f\x70\x68\x61','\x6f\x43\x6b\x4e\x57\x50\x4e\x63\x56\x57\x4a\x63\x4c\x6d\x6b\x73\x57\x37\x79','\x57\x50\x78\x64\x4e\x38\x6f\x4e\x57\x35\x35\x4c','\x6e\x75\x2f\x63\x4b\x53\x6f\x4b\x57\x50\x61\x39\x57\x37\x47','\x6a\x38\x6b\x46\x6b\x38\x6b\x63\x57\x37\x2f\x64\x49\x6d\x6f\x69\x57\x37\x34','\x57\x50\x42\x64\x49\x53\x6f\x4e\x57\x34\x72\x55\x79\x57','\x57\x4f\x71\x38\x57\x36\x35\x75\x57\x50\x2f\x64\x55\x75\x57','\x57\x34\x57\x52\x57\x50\x4f\x79\x57\x37\x42\x63\x48\x43\x6b\x37\x57\x34\x38','\x57\x36\x5a\x63\x4e\x63\x30\x6c','\x45\x6d\x6b\x43\x57\x36\x34','\x57\x51\x7a\x79\x57\x36\x53\x75\x57\x36\x48\x75\x43\x6d\x6b\x32','\x57\x37\x5a\x63\x56\x6d\x6f\x79\x57\x52\x56\x63\x54\x6d\x6b\x68\x57\x34\x34','\x57\x37\x56\x63\x51\x38\x6f\x42\x57\x52\x56\x63\x54\x43\x6b\x63\x57\x34\x58\x44','\x57\x50\x68\x63\x4f\x71\x4b','\x77\x71\x38\x4c\x64\x5a\x6c\x63\x54\x53\x6f\x33','\x77\x6d\x6f\x37\x57\x35\x70\x64\x55\x66\x46\x64\x4a\x43\x6f\x68\x57\x35\x4a\x64\x49\x64\x6a\x50\x57\x35\x6c\x63\x4f\x71','\x57\x4f\x42\x64\x4c\x59\x38','\x78\x43\x6f\x32\x57\x35\x5a\x64\x55\x66\x42\x64\x49\x43\x6f\x66\x57\x36\x33\x64\x47\x47\x54\x57\x57\x36\x6c\x63\x47\x57','\x74\x6d\x6f\x2b\x6f\x38\x6f\x74','\x76\x62\x34\x36\x69\x5a\x6c\x63\x52\x53\x6f\x49\x57\x50\x4b','\x71\x77\x70\x63\x50\x47\x43\x2f\x45\x71\x64\x64\x4b\x71','\x69\x43\x6b\x7a\x77\x6d\x6f\x43\x57\x4f\x6c\x63\x48\x38\x6b\x44\x57\x37\x6c\x63\x4d\x4c\x42\x64\x54\x76\x75\x54','\x57\x50\x6d\x34\x57\x36\x35\x71\x57\x52\x52\x64\x54\x65\x50\x6d','\x57\x4f\x6e\x70\x62\x53\x6b\x73\x57\x50\x46\x64\x52\x57','\x67\x6d\x6b\x42\x57\x52\x70\x63\x4e\x6d\x6f\x67\x68\x61','\x79\x73\x4c\x4e\x57\x35\x47\x44\x57\x4f\x53\x5a\x6d\x77\x71\x51\x57\x51\x56\x63\x49\x76\x6d','\x67\x53\x6b\x79\x57\x51\x4b','\x72\x43\x6f\x4a\x6e\x38\x6f\x43\x6f\x53\x6b\x75\x77\x38\x6b\x52','\x57\x4f\x76\x42\x63\x71','\x73\x38\x6f\x57\x6b\x47','\x57\x36\x2f\x63\x54\x6d\x6f\x68','\x57\x35\x74\x64\x47\x38\x6f\x2b\x79\x63\x43','\x57\x4f\x30\x6a\x57\x35\x4e\x63\x47\x38\x6b\x72\x57\x51\x61','\x79\x65\x7a\x41\x6f\x43\x6b\x44\x67\x6d\x6f\x6b','\x43\x53\x6f\x59\x70\x48\x58\x59\x7a\x43\x6f\x64\x57\x4f\x53','\x62\x53\x6b\x5a\x67\x6d\x6b\x39\x67\x6d\x6b\x6c\x57\x34\x34','\x6e\x58\x46\x63\x56\x30\x37\x63\x55\x48\x74\x63\x47\x53\x6f\x64','\x7a\x43\x6b\x6a\x57\x36\x47\x35\x79\x6d\x6f\x76\x57\x4f\x69','\x74\x43\x6f\x54\x70\x6d\x6b\x67\x42\x43\x6b\x6b','\x45\x43\x6f\x6d\x63\x43\x6b\x6f\x57\x35\x33\x64\x4d\x38\x6f\x66\x57\x37\x4b','\x62\x78\x31\x63\x57\x52\x75\x4c\x76\x47','\x65\x6d\x6b\x2f\x64\x43\x6b\x33\x6d\x53\x6b\x74\x57\x35\x78\x64\x4f\x57','\x57\x50\x4b\x33\x43\x53\x6b\x6e\x57\x34\x70\x64\x55\x43\x6b\x5a\x6d\x43\x6b\x70\x6b\x58\x6c\x63\x54\x53\x6f\x69','\x57\x37\x68\x63\x47\x53\x6b\x37','\x71\x43\x6b\x39\x57\x36\x72\x4f\x68\x43\x6f\x51\x7a\x63\x43','\x57\x4f\x78\x64\x49\x59\x5a\x64\x4f\x43\x6b\x4b\x67\x57','\x57\x36\x71\x36\x57\x4f\x47\x4c\x57\x52\x71','\x76\x32\x68\x64\x50\x64\x4c\x73','\x70\x4b\x4a\x63\x4e\x53\x6f\x47\x57\x4f\x79\x4c','\x65\x53\x6b\x30\x70\x72\x64\x63\x4f\x38\x6b\x48\x57\x51\x56\x63\x49\x61','\x74\x6d\x6f\x4d\x65\x48\x64\x63\x4d\x6d\x6b\x35','\x57\x4f\x56\x63\x56\x58\x68\x64\x4d\x6d\x6b\x71','\x57\x50\x6a\x58\x57\x4f\x4a\x64\x4a\x43\x6f\x76\x57\x34\x6c\x63\x49\x53\x6b\x62','\x67\x73\x4a\x64\x4d\x71\x71\x35\x46\x74\x4e\x64\x4e\x4b\x79','\x65\x38\x6b\x43\x57\x52\x2f\x63\x4d\x6d\x6f\x71\x62\x6d\x6b\x6b','\x71\x77\x33\x64\x50\x74\x44\x76\x57\x50\x42\x64\x47\x57','\x43\x38\x6b\x48\x57\x4f\x54\x35\x57\x4f\x4a\x63\x53\x57','\x57\x4f\x2f\x64\x4d\x59\x46\x64\x4f\x53\x6b\x30\x62\x43\x6f\x55','\x57\x51\x33\x63\x55\x38\x6b\x4f\x57\x51\x65\x35\x57\x50\x53\x41','\x62\x66\x4c\x35\x57\x52\x37\x64\x4f\x53\x6f\x33','\x41\x65\x50\x69\x70\x43\x6b\x41\x66\x43\x6f\x73','\x57\x50\x6d\x54\x57\x37\x50\x43\x57\x4f\x74\x64\x53\x47','\x57\x34\x64\x63\x48\x38\x6b\x55\x43\x43\x6b\x43\x57\x36\x69','\x78\x73\x2f\x64\x4a\x71','\x69\x53\x6f\x4a\x71\x6d\x6f\x74\x67\x4b\x44\x36\x57\x50\x53','\x57\x35\x74\x64\x48\x43\x6f\x53\x79\x74\x65','\x57\x35\x34\x52\x57\x4f\x34\x42\x57\x36\x5a\x63\x4d\x53\x6b\x4d','\x57\x37\x70\x63\x47\x43\x6b\x4d\x57\x51\x30\x4f\x57\x52\x57\x74\x57\x51\x57','\x65\x4d\x7a\x71\x57\x52\x61\x7a\x72\x58\x42\x64\x4b\x71','\x71\x43\x6b\x35\x57\x37\x7a\x53\x68\x6d\x6f\x56\x46\x71','\x71\x78\x70\x64\x47\x4e\x34\x72','\x57\x34\x48\x61\x42\x38\x6b\x74\x57\x52\x31\x46','\x75\x43\x6f\x35\x63\x53\x6f\x4f\x68\x71','\x46\x6d\x6b\x70\x57\x34\x61','\x6a\x6d\x6f\x49\x57\x35\x4b\x4c\x57\x34\x6c\x64\x4f\x6d\x6f\x65\x57\x36\x70\x64\x4f\x33\x6e\x37\x57\x34\x34','\x57\x36\x52\x63\x47\x64\x34\x62\x57\x36\x65\x6b','\x75\x74\x35\x4b\x57\x52\x6d\x6e\x72\x72\x52\x64\x4d\x71','\x6f\x43\x6f\x4b\x72\x57','\x57\x34\x4b\x77\x57\x36\x42\x64\x4c\x68\x5a\x63\x51\x6d\x6f\x36','\x57\x35\x43\x63\x57\x37\x30','\x6a\x30\x2f\x63\x48\x53\x6f\x4e\x57\x4f\x4f\x49\x57\x36\x78\x64\x4e\x61','\x6b\x6d\x6f\x65\x57\x36\x54\x69\x61\x67\x65','\x78\x77\x68\x64\x49\x33\x6d\x6d\x6b\x31\x68\x63\x51\x71','\x57\x35\x4a\x63\x49\x33\x70\x63\x53\x53\x6f\x59\x77\x53\x6b\x4f\x57\x51\x6c\x64\x4e\x53\x6f\x68\x44\x43\x6b\x77\x6e\x47','\x7a\x59\x38\x66','\x57\x35\x43\x56\x57\x50\x61','\x70\x31\x2f\x63\x4d\x43\x6f\x4e\x57\x4f\x61\x4a','\x74\x53\x6f\x54\x66\x47','\x57\x4f\x78\x64\x49\x59\x33\x64\x52\x38\x6b\x47\x63\x38\x6f\x32\x57\x50\x43','\x57\x35\x6c\x63\x49\x43\x6b\x48\x57\x50\x53\x32\x70\x43\x6f\x47\x77\x53\x6b\x4c\x57\x4f\x72\x63\x57\x50\x46\x63\x51\x47','\x57\x37\x42\x63\x49\x4a\x6d\x61\x57\x37\x79\x6a\x57\x52\x37\x64\x56\x71','\x61\x33\x70\x63\x4b\x43\x6f\x4a\x61\x5a\x42\x64\x4f\x59\x2f\x63\x50\x38\x6f\x2f\x57\x4f\x4e\x63\x4f\x38\x6b\x6f','\x57\x37\x6c\x63\x4a\x6d\x6b\x54\x57\x51\x43\x4b\x57\x52\x34\x43\x57\x52\x53','\x71\x67\x42\x64\x54\x4a\x53','\x64\x57\x30\x59\x71\x74\x4e\x63\x4d\x33\x70\x63\x55\x43\x6f\x75\x42\x75\x4a\x63\x48\x53\x6f\x2f','\x57\x34\x39\x6d\x57\x50\x5a\x64\x4b\x38\x6f\x70\x57\x37\x65\x53\x78\x43\x6f\x51\x6e\x43\x6f\x6d\x57\x50\x61','\x57\x36\x56\x63\x52\x43\x6f\x6d\x57\x52\x70\x63\x52\x38\x6b\x6d','\x57\x50\x74\x63\x50\x47\x4e\x64\x4c\x6d\x6b\x77\x65\x4c\x75','\x57\x4f\x5a\x64\x4a\x43\x6f\x74\x57\x34\x72\x55\x42\x43\x6b\x49\x76\x57','\x57\x51\x7a\x43\x57\x37\x4b\x71\x57\x36\x4c\x72\x41\x71','\x57\x37\x43\x33\x57\x52\x79\x72\x57\x50\x6c\x64\x53\x43\x6f\x64','\x57\x34\x66\x36\x6d\x38\x6f\x51\x57\x4f\x46\x63\x52\x38\x6f\x5a\x66\x47','\x75\x43\x6b\x55\x57\x37\x4c\x47','\x73\x77\x6c\x63\x4b\x47\x38\x4f','\x57\x37\x30\x4e\x57\x52\x57\x43\x57\x4f\x42\x64\x56\x38\x6f\x42\x57\x50\x69','\x7a\x72\x52\x64\x47\x38\x6b\x30\x57\x35\x66\x4d\x57\x52\x52\x63\x4d\x62\x2f\x63\x4e\x58\x48\x36\x70\x30\x38','\x57\x51\x33\x64\x4d\x38\x6f\x36\x57\x51\x6d\x50\x57\x52\x71\x57\x57\x51\x78\x63\x52\x61','\x64\x43\x6b\x4a\x57\x50\x2f\x63\x51\x72\x70\x63\x4b\x38\x6b\x45\x57\x37\x38','\x57\x4f\x4e\x64\x50\x38\x6f\x36','\x61\x6d\x6b\x58\x57\x51\x33\x63\x50\x71\x4e\x63\x4b\x38\x6b\x68\x57\x37\x38','\x57\x4f\x46\x64\x4c\x5a\x78\x64\x50\x53\x6b\x5a\x63\x6d\x6f\x32','\x67\x76\x48\x4d\x57\x52\x78\x64\x51\x43\x6f\x49','\x57\x50\x69\x57\x57\x36\x39\x41\x57\x50\x47','\x72\x53\x6f\x59\x6b\x47\x35\x4f\x7a\x38\x6f\x77','\x68\x63\x74\x64\x4c\x31\x50\x47\x69\x30\x6c\x64\x47\x30\x4f\x4f\x57\x36\x38\x37\x57\x4f\x4f','\x44\x31\x44\x6f\x6d\x43\x6b\x67\x65\x57','\x57\x51\x5a\x64\x51\x43\x6b\x6a\x57\x36\x56\x64\x54\x43\x6f\x43\x57\x4f\x57\x65\x57\x35\x68\x64\x56\x6d\x6b\x7a\x57\x35\x42\x64\x55\x53\x6f\x37','\x7a\x64\x6d\x68\x57\x4f\x38\x6d\x62\x38\x6b\x2b\x57\x35\x71','\x6f\x65\x78\x63\x4d\x47'];_0x11c3=function(){return _0x1f3750;};return _0x11c3();}function roundToStep(_0x3c8da6,_0x499dce){const _0x418b4f=_0x2e8c5d;if(!Number[_0x418b4f(0x1ac,'\x56\x28\x6f\x78')](_0x499dce)||_0x499dce<=-0x1ce4+-0x17f2*0x1+0x1*0x34d6)return _0x3c8da6;return Math[_0x418b4f(0x180,'\x46\x44\x54\x66')](_0x3c8da6/_0x499dce)*_0x499dce;}export function personalityKey(_0x229819){const _0x25718c=_0x2e8c5d,_0x4d2471=normalizePersonalityState(_0x229819);return PERSONALITY_AXES[_0x25718c(0x1bd,'\x23\x4e\x48\x6b')](_0x21f858=>_0x21f858+'\x3d'+roundToStep(_0x4d2471[_0x21f858],-0x4*0x77+-0x6e3+0x1*0x8bf+0.1)[_0x25718c(0x1e2,'\x45\x7a\x33\x43')](-0x3ef*-0x1+-0x1fa5+0x1bb7))[_0x25718c(0x1cf,'\x46\x6c\x45\x57')]('\x7c');}export function parseKeyToState(_0x22a548){const _0x560bbd=_0x2e8c5d,_0x4c3963={...DEFAULT_PERSONALITY};for(const _0x130a56 of String(_0x22a548??'')[_0x560bbd(0x185,'\x29\x6a\x47\x57')]('\x7c')){if(_0x560bbd(0x16d,'\x4c\x64\x49\x26')!==_0x560bbd(0x187,'\x46\x6c\x45\x57')){const _0x2081c5=_0x326135(_0x2b6e49);if(!_0x1efdd5[_0x560bbd(0x1a1,'\x33\x5b\x51\x68')](_0x2081c5))return-0x704+-0xa*0x28e+0x10*0x209;return _0x1da8a9['\x6d\x61\x78'](0x73b+0x1d1a+-0x2455,_0x562150[_0x560bbd(0x188,'\x45\x7a\x33\x43')](-0xc5b*0x1+0xc34+-0x1*-0x28,_0x2081c5));}else{const [_0xa13afd,_0x424613]=_0x130a56[_0x560bbd(0x172,'\x4a\x50\x70\x72')]('\x3d')[_0x560bbd(0x1d7,'\x6c\x49\x26\x44')](_0x3ef1fd=>_0x3ef1fd[_0x560bbd(0x1a5,'\x44\x62\x53\x45')]());if(_0xa13afd&&PERSONALITY_AXES[_0x560bbd(0x1bb,'\x73\x49\x4d\x77')](_0xa13afd))_0x4c3963[_0xa13afd]=clamp01(_0x424613);}}return normalizePersonalityState(_0x4c3963);}export{clamp01};
|
|
@@ -1,71 +1 @@
|
|
|
1
|
-
import { applyPersonalityMutations } from './mutate.js';
|
|
2
|
-
import { chooseBestKnownPersonality } from './stats.js';
|
|
3
|
-
import { proposeMutations, shouldTriggerPersonalityMutation } from './drift.js';
|
|
4
|
-
import { normalizePersonalityState, parseKeyToState, personalityKey, PERSONALITY_AXES, } from './schema.js';
|
|
5
|
-
/**
|
|
6
|
-
* 每轮人格选择 (v1 selectPersonalityForRun 端口): 自然选择微调 + 规则触发变异, 全在人格向量上小步演化.
|
|
7
|
-
* 说明: v1 还消费 reflection.suggested_mutations, 那是独立子系统, 不在 evolver-core personality 范围内 —— 本端口不含.
|
|
8
|
-
*/
|
|
9
|
-
/** 单周期最多落地几条变异 (v1: 防漂移, 总量封顶 4). */
|
|
10
|
-
export const MAX_MUTATIONS_PER_CYCLE = 4;
|
|
11
|
-
/** 自然选择只对差异 ≥ 此阈值的轴动手 (v1). */
|
|
12
|
-
export const NATURAL_SELECTION_MIN_DIFF = 0.05;
|
|
13
|
-
/** 自然选择每条 nudge 的夹取幅度 (v1: ±0.1). */
|
|
14
|
-
export const NATURAL_SELECTION_CLIP = 0.1;
|
|
15
|
-
/** 两状态间各轴差 (b-a), 按 |delta| 降序 (v1 getParamDeltas). */
|
|
16
|
-
export function getParamDeltas(from, to) {
|
|
17
|
-
const a = normalizePersonalityState(from);
|
|
18
|
-
const b = normalizePersonalityState(to);
|
|
19
|
-
return PERSONALITY_AXES
|
|
20
|
-
.map((param) => ({ param, delta: b[param] - a[param] }))
|
|
21
|
-
.sort((x, y) => Math.abs(y.delta) - Math.abs(x.delta));
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* 纯函数: 给定 model + 上下文, 算出本轮人格 (含微调), 返回新 model + 选择结果.
|
|
25
|
-
* 不落盘 —— store-backed 包装在 applySelectForRun (见 evolveOps.ts) 里持久化.
|
|
26
|
-
* 顺序 (与 v1 一致):
|
|
27
|
-
* 1. 自然选择: 朝 best-known 桶靠拢 (最多 2 轴, 差≥0.05, 每条夹 ±0.1)
|
|
28
|
-
* 2. 触发式变异: shouldTrigger → proposeMutations → apply (总量与①合并封顶 4)
|
|
29
|
-
*/
|
|
30
|
-
export function selectPersonalityForRun(model, input = {}) {
|
|
31
|
-
let current = normalizePersonalityState(model.current);
|
|
32
|
-
const applied = [];
|
|
33
|
-
// ① 自然选择
|
|
34
|
-
const best = chooseBestKnownPersonality(model.stats);
|
|
35
|
-
if (best) {
|
|
36
|
-
const bestState = parseKeyToState(best.key);
|
|
37
|
-
const diffs = getParamDeltas(current, bestState).filter((d) => Math.abs(d.delta) >= NATURAL_SELECTION_MIN_DIFF);
|
|
38
|
-
const muts = diffs.slice(0, 2).map((d) => ({
|
|
39
|
-
type: 'PersonalityMutation',
|
|
40
|
-
param: d.param,
|
|
41
|
-
delta: Math.max(-NATURAL_SELECTION_CLIP, Math.min(NATURAL_SELECTION_CLIP, d.delta)),
|
|
42
|
-
reason: 'natural_selection',
|
|
43
|
-
}));
|
|
44
|
-
const res = applyPersonalityMutations(current, muts);
|
|
45
|
-
current = res.state;
|
|
46
|
-
applied.push(...res.applied);
|
|
47
|
-
}
|
|
48
|
-
// ② 触发式变异 (受剩余额度约束)
|
|
49
|
-
const trig = shouldTriggerPersonalityMutation({ driftEnabled: !!input.driftEnabled, recentEvents: input.recentEvents });
|
|
50
|
-
if (trig.ok && applied.length < MAX_MUTATIONS_PER_CYCLE) {
|
|
51
|
-
const proposals = proposeMutations({ baseState: current, reason: trig.reason, driftEnabled: !!input.driftEnabled, signals: input.signals });
|
|
52
|
-
const res = applyPersonalityMutations(current, proposals);
|
|
53
|
-
current = res.state;
|
|
54
|
-
applied.push(...res.applied);
|
|
55
|
-
}
|
|
56
|
-
const key = personalityKey(current);
|
|
57
|
-
const known = Boolean(model.stats[key]);
|
|
58
|
-
const nextModel = { ...model, current };
|
|
59
|
-
return {
|
|
60
|
-
model: nextModel,
|
|
61
|
-
state: current,
|
|
62
|
-
key,
|
|
63
|
-
known,
|
|
64
|
-
mutations: applied,
|
|
65
|
-
meta: {
|
|
66
|
-
bestKnownKey: best?.key ?? null,
|
|
67
|
-
bestKnownScore: best ? best.score : null,
|
|
68
|
-
triggered: trig.ok ? { reason: trig.reason } : null,
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
}
|
|
1
|
+
(function(_0x3f9ee7,_0x27d00c){const _0x26060a=_0x5d2c,_0x134002=_0x3f9ee7();while(!![]){try{const _0x4db650=-parseInt(_0x26060a(0x1bb,'\x70\x75\x52\x55'))/(-0x82*0xf+-0xdb*-0x5+0xd6*0x4)+-parseInt(_0x26060a(0x1b7,'\x77\x72\x25\x45'))/(-0x3d2+0x9a1+-0x5cd)+-parseInt(_0x26060a(0x1c7,'\x74\x32\x74\x28'))/(-0x20ae*0x1+-0x2580+0x97*0x77)*(-parseInt(_0x26060a(0x1a1,'\x70\x75\x52\x55'))/(-0x14e*-0x16+-0x1d49+0x99))+-parseInt(_0x26060a(0x1be,'\x51\x32\x5b\x35'))/(-0x19ad+0xb41+0xe71*0x1)+parseInt(_0x26060a(0x1c5,'\x52\x7a\x25\x21'))/(-0x10d*-0x13+-0x1a5e+0x7*0xeb)*(parseInt(_0x26060a(0x1b9,'\x66\x4a\x72\x30'))/(0x2327+0x1bfa+0x1f8d*-0x2))+-parseInt(_0x26060a(0x1b4,'\x6d\x35\x76\x24'))/(0x2*-0x664+0x22f5+-0x1625)*(-parseInt(_0x26060a(0x1c3,'\x28\x77\x4b\x35'))/(0x1*0x2653+-0xdd*0x6+-0x211c))+parseInt(_0x26060a(0x19c,'\x57\x35\x5d\x67'))/(-0x23d8+-0x60*0x50+-0xafb*-0x6)*(parseInt(_0x26060a(0x1c6,'\x4c\x65\x34\x74'))/(-0xaae*0x2+-0x119*0x17+0x2ea6));if(_0x4db650===_0x27d00c)break;else _0x134002['push'](_0x134002['shift']());}catch(_0x315edf){_0x134002['push'](_0x134002['shift']());}}}(_0x1df7,0xccf5*0x5+-0x26eb2+0xd0bbf));function _0x1df7(){const _0x2e764a=['\x57\x34\x46\x64\x53\x32\x69\x7a\x76\x47','\x62\x38\x6b\x42\x7a\x71','\x57\x4f\x52\x64\x4b\x6d\x6f\x35\x57\x51\x38\x36\x45\x33\x62\x64','\x63\x38\x6b\x79\x7a\x47','\x57\x51\x33\x63\x49\x4a\x58\x35\x6a\x5a\x56\x63\x51\x61','\x43\x53\x6f\x6d\x57\x4f\x2f\x64\x4c\x53\x6b\x77\x57\x37\x38\x66\x7a\x63\x76\x58\x57\x4f\x43\x59\x6c\x57','\x57\x4f\x39\x67\x57\x35\x50\x77\x57\x35\x37\x64\x4f\x38\x6b\x32\x63\x57','\x57\x37\x52\x63\x48\x53\x6f\x53\x57\x34\x64\x63\x54\x5a\x5a\x63\x48\x6d\x6b\x39\x57\x34\x52\x64\x53\x48\x6a\x6d\x6d\x61','\x68\x6d\x6f\x2f\x62\x38\x6f\x4b\x57\x34\x38','\x57\x34\x70\x63\x4f\x76\x78\x63\x4c\x33\x4a\x63\x50\x58\x64\x63\x4b\x33\x72\x46\x57\x52\x33\x63\x4b\x38\x6f\x41','\x67\x78\x65\x7a','\x57\x37\x4b\x65\x72\x47','\x57\x50\x42\x63\x50\x74\x54\x7a\x64\x4d\x37\x64\x53\x38\x6b\x49\x57\x52\x71\x79\x57\x35\x46\x63\x51\x6d\x6f\x35','\x57\x34\x52\x64\x4a\x38\x6b\x7a','\x57\x52\x37\x64\x4c\x38\x6b\x2f\x57\x50\x42\x64\x50\x32\x78\x64\x47\x47','\x44\x72\x64\x64\x4c\x6d\x6b\x6a\x78\x43\x6b\x37\x57\x37\x4c\x32\x57\x37\x71\x50','\x6f\x43\x6b\x4c\x57\x36\x38\x48\x74\x4d\x6c\x64\x52\x38\x6f\x71\x77\x53\x6f\x36\x57\x52\x4f\x79\x57\x50\x53','\x63\x53\x6b\x67\x57\x4f\x58\x6c\x76\x6d\x6f\x45\x42\x38\x6f\x6e\x57\x51\x58\x6e\x6e\x4a\x6a\x51','\x57\x34\x4a\x64\x51\x38\x6f\x53','\x57\x4f\x33\x64\x56\x74\x70\x64\x4c\x30\x58\x61\x6e\x57','\x57\x34\x79\x63\x41\x74\x34\x34\x6d\x65\x2f\x63\x4c\x38\x6f\x6c\x57\x34\x38','\x57\x50\x56\x63\x53\x6d\x6b\x56\x57\x4f\x76\x75\x42\x4c\x56\x63\x54\x38\x6f\x2b\x62\x57','\x70\x38\x6f\x68\x57\x52\x70\x63\x4b\x78\x52\x64\x55\x43\x6f\x32','\x57\x36\x68\x64\x4e\x38\x6f\x62\x41\x71\x79','\x57\x35\x65\x30\x57\x36\x4b\x50','\x77\x72\x4e\x64\x52\x6d\x6f\x46\x57\x36\x69','\x67\x43\x6b\x6f\x44\x6d\x6f\x54\x6a\x57','\x66\x76\x70\x64\x4a\x38\x6f\x4b\x57\x35\x47\x2f\x6d\x67\x54\x41\x62\x38\x6f\x4c','\x6b\x6d\x6b\x58\x6d\x71','\x66\x4e\x57\x65\x6a\x71','\x57\x37\x61\x61\x77\x53\x6b\x62\x6d\x57','\x57\x36\x5a\x64\x4c\x65\x33\x63\x56\x31\x35\x71\x57\x36\x34\x70','\x57\x34\x46\x63\x4f\x4c\x6c\x63\x4c\x5a\x68\x64\x4d\x68\x64\x63\x53\x76\x6a\x36','\x57\x36\x33\x64\x55\x53\x6b\x42','\x73\x53\x6b\x53\x78\x43\x6b\x4b\x57\x50\x44\x31\x57\x51\x54\x41\x57\x50\x39\x74\x6f\x65\x37\x63\x4c\x57','\x75\x4c\x4a\x63\x4e\x43\x6f\x55\x64\x53\x6b\x66\x65\x63\x58\x30\x41\x77\x43','\x57\x51\x78\x63\x4a\x4a\x76\x79\x6f\x59\x52\x63\x52\x43\x6b\x4c','\x57\x51\x50\x47\x57\x37\x70\x64\x4a\x38\x6b\x75','\x57\x35\x6c\x64\x4e\x53\x6b\x62\x6d\x53\x6b\x39','\x57\x4f\x53\x62\x74\x4c\x47','\x57\x50\x78\x63\x52\x4d\x37\x64\x4b\x6d\x6b\x46\x57\x51\x53','\x72\x4a\x48\x62\x57\x51\x4e\x63\x47\x38\x6b\x48','\x57\x34\x72\x63\x57\x34\x30\x67\x57\x34\x47','\x67\x53\x6b\x65\x57\x4f\x4e\x64\x4b\x38\x6f\x76\x57\x37\x5a\x64\x56\x53\x6f\x45','\x57\x35\x33\x64\x4b\x30\x57','\x57\x35\x56\x64\x52\x6d\x6f\x2b\x57\x34\x44\x77\x77\x71','\x70\x38\x6b\x53\x57\x36\x34\x54\x72\x4d\x2f\x64\x51\x38\x6f\x48\x74\x53\x6f\x7a\x57\x4f\x4b\x2f\x57\x51\x43','\x75\x76\x2f\x64\x4e\x53\x6b\x2f\x75\x6d\x6b\x69\x6c\x73\x57','\x42\x6d\x6f\x48\x57\x35\x33\x64\x4a\x4e\x47'];_0x1df7=function(){return _0x2e764a;};return _0x1df7();}import{applyPersonalityMutations}from'\x2e\x2f\x6d\x75\x74\x61\x74\x65\x2e\x6a\x73';import{chooseBestKnownPersonality}from'\x2e\x2f\x73\x74\x61\x74\x73\x2e\x6a\x73';import{proposeMutations,shouldTriggerPersonalityMutation}from'\x2e\x2f\x64\x72\x69\x66\x74\x2e\x6a\x73';function _0x5d2c(_0x29240b,_0x541ada){_0x29240b=_0x29240b-(-0x1803+0x16*-0xf5+0x2ea8);const _0x9bc94=_0x1df7();let _0x48e9f2=_0x9bc94[_0x29240b];if(_0x5d2c['\x47\x53\x4d\x6c\x77\x41']===undefined){var _0x2ec52a=function(_0x361a72){const _0xc607b1='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';let _0x5bcb02='',_0x25f55f='';for(let _0x14e386=-0x1*0x1bcc+0x1*-0x121f+0x2deb,_0x2b2e27,_0x31ba1d,_0x3c7ad9=0x1109*-0x1+-0x104+0x120d;_0x31ba1d=_0x361a72['\x63\x68\x61\x72\x41\x74'](_0x3c7ad9++);~_0x31ba1d&&(_0x2b2e27=_0x14e386%(0xbcb+0x1510+-0x20d7*0x1)?_0x2b2e27*(-0x2*0x29d+0x6*-0xb2+0x9a6)+_0x31ba1d:_0x31ba1d,_0x14e386++%(0x8*0x19e+0x11cd*0x1+0x5*-0x625))?_0x5bcb02+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0x311+0x857+-0xa69&_0x2b2e27>>(-(0x1*0x25af+0x1c*0x1b+-0x28a1)*_0x14e386&0x25c8+0x60c*-0x6+-0x17a)):0x1*-0xd72+0x23ad+-0x15*0x10f){_0x31ba1d=_0xc607b1['\x69\x6e\x64\x65\x78\x4f\x66'](_0x31ba1d);}for(let _0x3b7e89=0xd*-0x18a+0xdf1+0x611,_0x2f39a7=_0x5bcb02['\x6c\x65\x6e\x67\x74\x68'];_0x3b7e89<_0x2f39a7;_0x3b7e89++){_0x25f55f+='\x25'+('\x30\x30'+_0x5bcb02['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x3b7e89)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](-0xddb*0x1+0x201d*0x1+0x22*-0x89))['\x73\x6c\x69\x63\x65'](-(0x1*0x1369+-0x26ef+0x1388));}return decodeURIComponent(_0x25f55f);};const _0x49d7a8=function(_0x19854b,_0x862d80){let _0x1866fa=[],_0x29ef82=0xdaa+-0x142f+0x685,_0x4f0dd9,_0x2ffb09='';_0x19854b=_0x2ec52a(_0x19854b);let _0x2a9361;for(_0x2a9361=0xd94+-0xb*-0x2ad+-0x2b03;_0x2a9361<-0xfef*0x2+-0xd16+-0x4*-0xb7d;_0x2a9361++){_0x1866fa[_0x2a9361]=_0x2a9361;}for(_0x2a9361=-0x3+0x6*0x62b+-0x24ff;_0x2a9361<-0x21bc+0x293+0x1*0x2029;_0x2a9361++){_0x29ef82=(_0x29ef82+_0x1866fa[_0x2a9361]+_0x862d80['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x2a9361%_0x862d80['\x6c\x65\x6e\x67\x74\x68']))%(0xa79+-0x2e*-0x3c+-0x1441),_0x4f0dd9=_0x1866fa[_0x2a9361],_0x1866fa[_0x2a9361]=_0x1866fa[_0x29ef82],_0x1866fa[_0x29ef82]=_0x4f0dd9;}_0x2a9361=-0x1185+0x25f6+-0x1471,_0x29ef82=0x118e+-0x1506+0x378;for(let _0x12fc98=0x1*-0x1106+0x873+0x5*0x1b7;_0x12fc98<_0x19854b['\x6c\x65\x6e\x67\x74\x68'];_0x12fc98++){_0x2a9361=(_0x2a9361+(0x1b3*0x9+0x24b*-0x1+-0xcff))%(0x1284+0x2*0xd61+-0x2c46),_0x29ef82=(_0x29ef82+_0x1866fa[_0x2a9361])%(-0x982+-0x24d2+-0x1d2*-0x1a),_0x4f0dd9=_0x1866fa[_0x2a9361],_0x1866fa[_0x2a9361]=_0x1866fa[_0x29ef82],_0x1866fa[_0x29ef82]=_0x4f0dd9,_0x2ffb09+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](_0x19854b['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x12fc98)^_0x1866fa[(_0x1866fa[_0x2a9361]+_0x1866fa[_0x29ef82])%(-0xf25+0x5d6+-0x1d*-0x5b)]);}return _0x2ffb09;};_0x5d2c['\x63\x61\x4c\x78\x71\x53']=_0x49d7a8,_0x5d2c['\x55\x4a\x6d\x58\x76\x4c']={},_0x5d2c['\x47\x53\x4d\x6c\x77\x41']=!![];}const _0x4c9bee=_0x9bc94[-0x213b+0x18c7+0x874],_0x6fc3c3=_0x29240b+_0x4c9bee,_0x4cef1c=_0x5d2c['\x55\x4a\x6d\x58\x76\x4c'][_0x6fc3c3];return!_0x4cef1c?(_0x5d2c['\x6e\x75\x50\x59\x67\x61']===undefined&&(_0x5d2c['\x6e\x75\x50\x59\x67\x61']=!![]),_0x48e9f2=_0x5d2c['\x63\x61\x4c\x78\x71\x53'](_0x48e9f2,_0x541ada),_0x5d2c['\x55\x4a\x6d\x58\x76\x4c'][_0x6fc3c3]=_0x48e9f2):_0x48e9f2=_0x4cef1c,_0x48e9f2;}import{normalizePersonalityState,parseKeyToState,personalityKey,PERSONALITY_AXES}from'\x2e\x2f\x73\x63\x68\x65\x6d\x61\x2e\x6a\x73';export const MAX_MUTATIONS_PER_CYCLE=-0xbfb*-0x2+-0x2*-0xab7+-0x2d60;export const NATURAL_SELECTION_MIN_DIFF=0x2*-0x1d9+0x1ac+0x206+0.05;export const NATURAL_SELECTION_CLIP=-0x2034+0x1*-0x1314+0x3348+0.1;export function getParamDeltas(_0x111b35,_0x38c657){const _0xecbf27=_0x5d2c,_0x2bf097=normalizePersonalityState(_0x111b35),_0x38022f=normalizePersonalityState(_0x38c657);return PERSONALITY_AXES[_0xecbf27(0x1bd,'\x64\x77\x7a\x5d')](_0x3824db=>({'\x70\x61\x72\x61\x6d':_0x3824db,'\x64\x65\x6c\x74\x61':_0x38022f[_0x3824db]-_0x2bf097[_0x3824db]}))['\x73\x6f\x72\x74']((_0x3b8690,_0x3f70d7)=>Math[_0xecbf27(0x1c4,'\x74\x32\x74\x28')](_0x3f70d7[_0xecbf27(0x1b2,'\x51\x32\x5b\x35')])-Math[_0xecbf27(0x1ad,'\x65\x75\x37\x56')](_0x3b8690[_0xecbf27(0x1ba,'\x78\x25\x49\x61')]));}export function selectPersonalityForRun(_0x44729c,_0x22411c={}){const _0x49d805=_0x5d2c;let _0x22c289=normalizePersonalityState(_0x44729c[_0x49d805(0x197,'\x25\x52\x26\x25')]);const _0x45647b=[],_0x459674=chooseBestKnownPersonality(_0x44729c[_0x49d805(0x1a7,'\x53\x4b\x77\x76')]);if(_0x459674){const _0xc9b5ba=parseKeyToState(_0x459674[_0x49d805(0x1bf,'\x53\x4b\x77\x76')]),_0x9aec8b=getParamDeltas(_0x22c289,_0xc9b5ba)[_0x49d805(0x1a9,'\x41\x5e\x4b\x79')](_0x2e77ad=>Math[_0x49d805(0x1b5,'\x62\x23\x4a\x42')](_0x2e77ad[_0x49d805(0x19f,'\x64\x77\x7a\x5d')])>=NATURAL_SELECTION_MIN_DIFF),_0x445f71=_0x9aec8b[_0x49d805(0x198,'\x76\x30\x28\x74')](-0x14*0x12d+0x1*-0x129e+0x2a22*0x1,-0x4*-0x58f+-0x1bd9*-0x1+-0x3213)[_0x49d805(0x1b3,'\x62\x23\x4a\x42')](_0x2978a0=>({'\x74\x79\x70\x65':_0x49d805(0x1a0,'\x65\x75\x37\x56')+_0x49d805(0x1a5,'\x42\x48\x41\x75')+_0x49d805(0x1a2,'\x63\x62\x72\x71'),'\x70\x61\x72\x61\x6d':_0x2978a0[_0x49d805(0x1b1,'\x30\x54\x55\x32')],'\x64\x65\x6c\x74\x61':Math[_0x49d805(0x1bc,'\x44\x78\x29\x75')](-NATURAL_SELECTION_CLIP,Math[_0x49d805(0x19d,'\x57\x42\x68\x2a')](NATURAL_SELECTION_CLIP,_0x2978a0['\x64\x65\x6c\x74\x61'])),'\x72\x65\x61\x73\x6f\x6e':_0x49d805(0x1ac,'\x6b\x58\x55\x49')+_0x49d805(0x1b8,'\x4d\x58\x30\x42')+'\x6e'})),_0x5d43fe=applyPersonalityMutations(_0x22c289,_0x445f71);_0x22c289=_0x5d43fe[_0x49d805(0x19a,'\x52\x6d\x4d\x5e')],_0x45647b[_0x49d805(0x199,'\x2a\x53\x6d\x23')](..._0x5d43fe[_0x49d805(0x1b6,'\x42\x48\x41\x75')]);}const _0x21a2b8=shouldTriggerPersonalityMutation({'\x64\x72\x69\x66\x74\x45\x6e\x61\x62\x6c\x65\x64':!!_0x22411c['\x64\x72\x69\x66\x74\x45\x6e\x61'+'\x62\x6c\x65\x64'],'\x72\x65\x63\x65\x6e\x74\x45\x76\x65\x6e\x74\x73':_0x22411c['\x72\x65\x63\x65\x6e\x74\x45\x76'+_0x49d805(0x1a8,'\x31\x46\x26\x73')]});if(_0x21a2b8['\x6f\x6b']&&_0x45647b['\x6c\x65\x6e\x67\x74\x68']<MAX_MUTATIONS_PER_CYCLE){const _0x322d02=proposeMutations({'\x62\x61\x73\x65\x53\x74\x61\x74\x65':_0x22c289,'\x72\x65\x61\x73\x6f\x6e':_0x21a2b8[_0x49d805(0x1ae,'\x74\x32\x74\x28')],'\x64\x72\x69\x66\x74\x45\x6e\x61\x62\x6c\x65\x64':!!_0x22411c['\x64\x72\x69\x66\x74\x45\x6e\x61'+_0x49d805(0x19e,'\x44\x78\x29\x75')],'\x73\x69\x67\x6e\x61\x6c\x73':_0x22411c[_0x49d805(0x1c0,'\x66\x4a\x72\x30')]}),_0x33392e=applyPersonalityMutations(_0x22c289,_0x322d02);_0x22c289=_0x33392e[_0x49d805(0x1ab,'\x37\x78\x58\x43')],_0x45647b['\x70\x75\x73\x68'](..._0x33392e['\x61\x70\x70\x6c\x69\x65\x64']);}const _0x4153c3=personalityKey(_0x22c289),_0x550c35=Boolean(_0x44729c[_0x49d805(0x19b,'\x62\x23\x4a\x42')][_0x4153c3]),_0xa4e857={..._0x44729c,'\x63\x75\x72\x72\x65\x6e\x74':_0x22c289};return{'\x6d\x6f\x64\x65\x6c':_0xa4e857,'\x73\x74\x61\x74\x65':_0x22c289,'\x6b\x65\x79':_0x4153c3,'\x6b\x6e\x6f\x77\x6e':_0x550c35,'\x6d\x75\x74\x61\x74\x69\x6f\x6e\x73':_0x45647b,'\x6d\x65\x74\x61':{'\x62\x65\x73\x74\x4b\x6e\x6f\x77\x6e\x4b\x65\x79':_0x459674?.['\x6b\x65\x79']??null,'\x62\x65\x73\x74\x4b\x6e\x6f\x77\x6e\x53\x63\x6f\x72\x65':_0x459674?_0x459674[_0x49d805(0x1a6,'\x2a\x6f\x2a\x69')]:null,'\x74\x72\x69\x67\x67\x65\x72\x65\x64':_0x21a2b8['\x6f\x6b']?{'\x72\x65\x61\x73\x6f\x6e':_0x21a2b8[_0x49d805(0x1aa,'\x48\x64\x31\x72')]}:null}};}
|
|
@@ -1,82 +1 @@
|
|
|
1
|
-
import { clamp01, normalizePersonalityState, personalityKey, } from './schema.js';
|
|
2
|
-
/**
|
|
3
|
-
* 人格适应度 + 统计回写 (v1 personalityScore / chooseBestKnownPersonality / updatePersonalityStats 端口).
|
|
4
|
-
* 自然选择的"适者"由这里的分数决定; 每轮结果回写到对应人格桶, 供下一轮选择.
|
|
5
|
-
*/
|
|
6
|
-
/** 一个桶要参与"最佳已知"竞争的最小样本数 (v1: total<3 不计). */
|
|
7
|
-
export const MIN_SAMPLES_FOR_BEST = 3;
|
|
8
|
-
/** 样本权重饱和点 (v1: min(1, total/8)). */
|
|
9
|
-
export const SAMPLE_WEIGHT_FULL_AT = 8;
|
|
10
|
-
/**
|
|
11
|
-
* 桶适应度分数 (v1 personalityScore):
|
|
12
|
-
* - Laplace 平滑成功率 p = (succ+1)/(total+2) → 主导 (权重 0.75)
|
|
13
|
-
* - 质量代理 q = avgScore, 但乘 sampleWeight 惩罚小样本过度自信 (权重 0.25)
|
|
14
|
-
*/
|
|
15
|
-
export function personalityScore(entry) {
|
|
16
|
-
const succ = Number(entry?.success) || 0;
|
|
17
|
-
const fail = Number(entry?.fail) || 0;
|
|
18
|
-
const total = succ + fail;
|
|
19
|
-
const p = (succ + 1) / (total + 2);
|
|
20
|
-
const sampleWeight = Math.min(1, total / SAMPLE_WEIGHT_FULL_AT);
|
|
21
|
-
const avg = entry?.avgScore;
|
|
22
|
-
const q = Number.isFinite(Number(avg)) ? clamp01(Number(avg)) : 0.5;
|
|
23
|
-
return p * 0.75 + q * 0.25 * sampleWeight;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* 选出"最佳已知"人格桶 (v1 chooseBestKnownPersonality): 只在样本≥MIN_SAMPLES_FOR_BEST 的桶里比 personalityScore.
|
|
27
|
-
* 没有够样本的桶 ⇒ null (选择阶段就不做自然选择微调).
|
|
28
|
-
*/
|
|
29
|
-
export function chooseBestKnownPersonality(stats) {
|
|
30
|
-
let best = null;
|
|
31
|
-
for (const [key, entry] of Object.entries(stats ?? {})) {
|
|
32
|
-
const total = (Number(entry?.success) || 0) + (Number(entry?.fail) || 0);
|
|
33
|
-
if (total < MIN_SAMPLES_FOR_BEST)
|
|
34
|
-
continue;
|
|
35
|
-
const score = personalityScore(entry);
|
|
36
|
-
if (!best || score > best.score)
|
|
37
|
-
best = { key, score, entry };
|
|
38
|
-
}
|
|
39
|
-
return best;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* 把一轮结果回写到对应人格桶 (v1 updatePersonalityStats 的纯函数版):
|
|
43
|
-
* - success/fail 计数 +1
|
|
44
|
-
* - avgScore 增量更新 (仅当给了 score): avg += (s-avg)/n
|
|
45
|
-
* - history 追加一条 (含 outcome/score/notes)
|
|
46
|
-
* 返回新 model (不落盘 —— 调用方用 store.save 持久化, 或 applyStatsUpdate 一步到位).
|
|
47
|
-
*/
|
|
48
|
-
export function updatePersonalityStats(model, input, at) {
|
|
49
|
-
const st = normalizePersonalityState(input.personality ?? model.current);
|
|
50
|
-
const key = personalityKey(st);
|
|
51
|
-
const prev = model.stats[key];
|
|
52
|
-
const entry = prev
|
|
53
|
-
? { ...prev }
|
|
54
|
-
: { success: 0, fail: 0, avgScore: 0.5, n: 0, updatedAt: null };
|
|
55
|
-
const outcome = String(input.outcome ?? '').toLowerCase();
|
|
56
|
-
if (outcome === 'success')
|
|
57
|
-
entry.success += 1;
|
|
58
|
-
else if (outcome === 'failed')
|
|
59
|
-
entry.fail += 1;
|
|
60
|
-
const sc = input.score == null ? null : (Number.isFinite(Number(input.score)) ? clamp01(Number(input.score)) : null);
|
|
61
|
-
if (sc != null) {
|
|
62
|
-
const n = entry.n + 1;
|
|
63
|
-
entry.avgScore = entry.avgScore + (sc - entry.avgScore) / n;
|
|
64
|
-
entry.n = n;
|
|
65
|
-
}
|
|
66
|
-
entry.updatedAt = at;
|
|
67
|
-
const nextStats = { ...model.stats, [key]: entry };
|
|
68
|
-
const historyEntry = {
|
|
69
|
-
at,
|
|
70
|
-
key,
|
|
71
|
-
outcome: outcome === 'success' || outcome === 'failed' ? outcome : 'unknown',
|
|
72
|
-
score: sc,
|
|
73
|
-
notes: input.notes ? String(input.notes).slice(0, 220) : null,
|
|
74
|
-
};
|
|
75
|
-
// v1 parity: 回写只动 stats + history, 不改 model.current —— current 由 select/pivot 决定, 记账不该挪它.
|
|
76
|
-
const nextModel = {
|
|
77
|
-
...model,
|
|
78
|
-
stats: nextStats,
|
|
79
|
-
history: [...model.history, historyEntry],
|
|
80
|
-
};
|
|
81
|
-
return { model: nextModel, key, entry };
|
|
82
|
-
}
|
|
1
|
+
(function(_0x36f1dc,_0x2dcfa9){const _0x4f18f0=_0x19cd,_0x264a6d=_0x36f1dc();while(!![]){try{const _0x22233d=parseInt(_0x4f18f0(0x16f,'\x32\x36\x35\x74'))/(-0x25*0x101+-0x6f2+0x2c18)*(-parseInt(_0x4f18f0(0x159,'\x6e\x4e\x6a\x65'))/(-0x2d9+-0x1b43+0x1e1e))+-parseInt(_0x4f18f0(0x17a,'\x48\x70\x53\x36'))/(-0x2113+0x2*0xaed+0x2*0x59e)*(parseInt(_0x4f18f0(0x178,'\x5b\x6e\x44\x24'))/(-0x23b5+-0x1e55+0x420e))+-parseInt(_0x4f18f0(0x165,'\x4c\x2a\x70\x4b'))/(-0x11*0x23f+0x28f*-0xa+-0x2c6*-0x17)*(-parseInt(_0x4f18f0(0x167,'\x6f\x26\x43\x47'))/(-0xa26+-0xd03*-0x1+-0x1*0x2d7))+-parseInt(_0x4f18f0(0x168,'\x56\x51\x25\x53'))/(-0x23*-0x93+0xe9+-0x1*0x14fb)*(-parseInt(_0x4f18f0(0x154,'\x5d\x5e\x7a\x4c'))/(-0x189+0x1b66+-0x19d5))+parseInt(_0x4f18f0(0x157,'\x55\x21\x48\x4d'))/(-0x1*0xe03+-0x17b2+0x25be)+parseInt(_0x4f18f0(0x17b,'\x71\x4a\x6c\x71'))/(0xa60+-0x222+-0x15*0x64)*(parseInt(_0x4f18f0(0x176,'\x62\x65\x6a\x23'))/(-0xb*0xf2+-0x39e*0x1+0xe0f))+parseInt(_0x4f18f0(0x14f,'\x7a\x58\x4f\x61'))/(0x1*0x180e+0xca*0x30+-0x3de2)*(-parseInt(_0x4f18f0(0x14d,'\x72\x6a\x63\x49'))/(0x3*0x156+0x1ca1+-0x2096));if(_0x22233d===_0x2dcfa9)break;else _0x264a6d['push'](_0x264a6d['shift']());}catch(_0x46daca){_0x264a6d['push'](_0x264a6d['shift']());}}}(_0x3ee2,0xe49d2+-0x259*0x101+-0x479df));function _0x3ee2(){const _0x509f98=['\x69\x6d\x6f\x39\x41\x32\x6c\x64\x4a\x4d\x38\x51','\x6c\x67\x47\x4d\x57\x4f\x70\x63\x51\x4d\x5a\x63\x51\x49\x74\x64\x4c\x53\x6f\x74\x57\x50\x4b\x78\x6c\x57','\x75\x74\x4e\x64\x53\x76\x47\x49\x65\x66\x75\x49\x57\x51\x33\x63\x4f\x68\x46\x63\x4e\x47','\x6c\x38\x6f\x6d\x57\x35\x50\x72\x42\x57\x43\x32\x75\x31\x72\x48\x57\x52\x62\x6d\x57\x36\x43','\x45\x53\x6f\x56\x57\x4f\x6c\x63\x50\x4d\x34','\x41\x75\x47\x4a\x57\x36\x76\x77\x42\x78\x6d','\x57\x52\x64\x63\x4a\x53\x6f\x6a\x68\x38\x6b\x62\x57\x37\x75\x65\x57\x36\x6d\x50\x57\x4f\x74\x63\x55\x6d\x6b\x54\x6e\x57','\x57\x35\x6a\x63\x57\x4f\x6a\x6d','\x69\x4d\x58\x37\x79\x74\x68\x64\x4c\x6d\x6f\x34\x57\x37\x65','\x57\x50\x74\x64\x54\x71\x47','\x46\x43\x6b\x6d\x57\x4f\x4f\x31\x6f\x76\x35\x30\x78\x57','\x45\x43\x6f\x4c\x57\x4f\x4e\x64\x4d\x67\x43','\x6d\x53\x6b\x46\x6a\x6d\x6f\x4b\x57\x50\x74\x64\x53\x53\x6f\x52','\x57\x4f\x34\x75\x57\x50\x39\x4b\x44\x43\x6b\x79\x57\x37\x6d\x70\x72\x6d\x6b\x6e\x57\x37\x64\x64\x55\x71\x69','\x57\x37\x43\x46\x57\x35\x42\x63\x52\x38\x6f\x43\x57\x34\x69','\x78\x53\x6f\x31\x57\x52\x4b\x57\x45\x67\x48\x33','\x78\x43\x6f\x54\x57\x35\x6a\x37\x57\x35\x42\x64\x4d\x68\x2f\x64\x55\x6d\x6f\x42\x6c\x43\x6b\x77\x57\x4f\x74\x64\x56\x43\x6b\x67','\x62\x75\x50\x67\x57\x4f\x2f\x63\x4f\x6d\x6b\x72\x73\x49\x30','\x57\x4f\x47\x44\x57\x37\x42\x64\x4f\x77\x38','\x41\x6d\x6b\x75\x62\x43\x6f\x79','\x57\x4f\x79\x72\x57\x35\x4b\x72\x7a\x5a\x44\x67\x57\x52\x4a\x63\x50\x53\x6b\x63\x6c\x49\x7a\x78','\x57\x4f\x78\x64\x4e\x57\x42\x64\x54\x63\x76\x6c\x57\x37\x6e\x44','\x57\x52\x4b\x2b\x76\x72\x44\x64\x72\x78\x2f\x64\x4f\x61','\x57\x51\x43\x34\x57\x35\x47\x5a\x67\x6d\x6f\x78\x57\x37\x69','\x72\x57\x58\x61\x57\x50\x70\x63\x4e\x57','\x66\x43\x6f\x59\x57\x37\x6d\x45\x57\x4f\x6d\x65\x6b\x71','\x68\x38\x6b\x37\x57\x4f\x75\x38\x57\x4f\x79','\x57\x4f\x42\x64\x4a\x58\x46\x64\x50\x63\x39\x77\x57\x36\x65','\x7a\x6d\x6f\x4d\x57\x50\x74\x64\x4e\x4e\x65','\x57\x35\x76\x76\x57\x4f\x58\x5a\x6d\x32\x47\x62\x57\x50\x6d','\x46\x53\x6b\x34\x6a\x4a\x78\x63\x4b\x78\x79\x79\x57\x36\x50\x47\x57\x34\x56\x63\x4c\x61','\x46\x43\x6b\x77\x61\x38\x6f\x67\x57\x50\x47','\x57\x50\x4a\x64\x49\x53\x6f\x6f','\x57\x36\x75\x51\x57\x37\x47\x49\x70\x43\x6f\x44\x57\x35\x47\x5a','\x79\x6d\x6b\x65\x57\x4f\x4f\x50\x57\x34\x39\x41\x6a\x30\x61','\x63\x53\x6b\x35\x57\x4f\x6d\x49\x57\x4f\x42\x63\x48\x61','\x57\x50\x74\x64\x52\x68\x48\x47\x57\x35\x38','\x57\x51\x44\x70\x57\x4f\x46\x64\x53\x43\x6f\x51\x57\x35\x66\x47\x57\x50\x4e\x64\x55\x49\x71','\x57\x35\x5a\x64\x4e\x73\x7a\x43\x57\x50\x33\x63\x4b\x63\x76\x36','\x57\x34\x46\x63\x4b\x38\x6f\x33\x46\x64\x31\x73\x57\x37\x4e\x63\x48\x57','\x57\x37\x42\x64\x4a\x53\x6b\x79\x73\x43\x6f\x77\x57\x52\x7a\x70','\x78\x43\x6f\x48\x57\x35\x6a\x36\x57\x35\x52\x64\x4d\x64\x5a\x63\x52\x53\x6f\x46\x68\x43\x6b\x49\x57\x52\x4f','\x69\x43\x6b\x4c\x57\x34\x7a\x30\x57\x36\x5a\x63\x53\x72\x56\x63\x4d\x38\x6f\x65\x41\x47','\x57\x34\x66\x6e\x57\x4f\x62\x6f\x70\x33\x61\x44','\x57\x52\x46\x63\x49\x38\x6b\x53\x72\x43\x6f\x45\x57\x50\x31\x71\x57\x37\x57','\x57\x37\x78\x64\x4a\x6d\x6f\x67\x57\x36\x75\x2b\x57\x35\x4a\x64\x4a\x66\x30\x2b\x45\x71','\x57\x50\x30\x69\x57\x37\x37\x64\x55\x71','\x79\x4c\x4f\x4d\x69\x74\x34','\x57\x34\x74\x64\x4b\x65\x54\x6b\x67\x43\x6f\x41\x57\x50\x6d','\x69\x43\x6f\x57\x67\x53\x6f\x72\x77\x32\x78\x64\x50\x38\x6b\x74','\x6b\x61\x54\x34\x79\x58\x68\x63\x52\x48\x39\x4a\x57\x36\x38\x4d','\x57\x4f\x30\x74\x57\x50\x76\x47\x44\x38\x6b\x71\x57\x37\x72\x35\x72\x53\x6b\x70\x57\x37\x4e\x64\x47\x58\x66\x32','\x79\x38\x6f\x36\x57\x51\x42\x64\x4b\x4d\x5a\x63\x48\x38\x6b\x31\x57\x34\x47'];_0x3ee2=function(){return _0x509f98;};return _0x3ee2();}function _0x19cd(_0x33d6cd,_0x4a9dbe){_0x33d6cd=_0x33d6cd-(-0x1*-0x1d87+-0x592+-0x16ab);const _0x2528c1=_0x3ee2();let _0x1e1f4c=_0x2528c1[_0x33d6cd];if(_0x19cd['\x74\x71\x66\x4c\x4f\x65']===undefined){var _0xcb5098=function(_0x4deb7f){const _0x5d03ce='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';let _0x48eb2a='',_0x5f0cca='';for(let _0x385ba2=0x170d+-0x402+0x145*-0xf,_0x142463,_0x2ac4dd,_0x2ed484=-0x1505+-0x11d+-0x2*-0xb11;_0x2ac4dd=_0x4deb7f['\x63\x68\x61\x72\x41\x74'](_0x2ed484++);~_0x2ac4dd&&(_0x142463=_0x385ba2%(0x7f7+-0xd*0x29d+0x1a06)?_0x142463*(-0x22*-0x55+-0x8d8+-0x232)+_0x2ac4dd:_0x2ac4dd,_0x385ba2++%(-0x9e*-0x2+-0x4d*0x56+0x18a6))?_0x48eb2a+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0x16f2+0x19f8+-0x2feb&_0x142463>>(-(0x3a*0x86+0x542+-0x2*0x11ce)*_0x385ba2&-0x20*0x73+-0x1670+0x2*0x126b)):0x89e*-0x1+-0x23e1+0x2c7f){_0x2ac4dd=_0x5d03ce['\x69\x6e\x64\x65\x78\x4f\x66'](_0x2ac4dd);}for(let _0x4dc3f5=-0xaf9*0x1+0x24ba+-0x19c1,_0x4bfeb6=_0x48eb2a['\x6c\x65\x6e\x67\x74\x68'];_0x4dc3f5<_0x4bfeb6;_0x4dc3f5++){_0x5f0cca+='\x25'+('\x30\x30'+_0x48eb2a['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x4dc3f5)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0x1819+-0x1b7e+0x1*0x375))['\x73\x6c\x69\x63\x65'](-(-0x1*0xa01+0x1*-0xa4e+0x1451));}return decodeURIComponent(_0x5f0cca);};const _0x521dc1=function(_0x5d1949,_0x2d45d3){let _0x171851=[],_0x565e92=0x5*0x4cf+0x20cc+-0x1*0x38d7,_0x945d19,_0x3b6cf4='';_0x5d1949=_0xcb5098(_0x5d1949);let _0x4fe7bc;for(_0x4fe7bc=-0x1*0x109d+-0x25eb*-0x1+-0x154e;_0x4fe7bc<-0x21a1+0x4*-0x533+0x376d;_0x4fe7bc++){_0x171851[_0x4fe7bc]=_0x4fe7bc;}for(_0x4fe7bc=-0x2322+0x1*-0x11c5+-0x1d*-0x1d3;_0x4fe7bc<0x169a+-0x20f0+0xb56;_0x4fe7bc++){_0x565e92=(_0x565e92+_0x171851[_0x4fe7bc]+_0x2d45d3['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x4fe7bc%_0x2d45d3['\x6c\x65\x6e\x67\x74\x68']))%(-0x72a+-0x1*0x2029+-0x117*-0x25),_0x945d19=_0x171851[_0x4fe7bc],_0x171851[_0x4fe7bc]=_0x171851[_0x565e92],_0x171851[_0x565e92]=_0x945d19;}_0x4fe7bc=-0xa*-0x27c+0x77*-0x1b+0xc4b*-0x1,_0x565e92=-0x1fa8+0xef7*0x1+0x10b1;for(let _0x1a9396=-0x3*0x651+0x20e6+-0xdf3;_0x1a9396<_0x5d1949['\x6c\x65\x6e\x67\x74\x68'];_0x1a9396++){_0x4fe7bc=(_0x4fe7bc+(-0x73a+0x18d4+-0x1199))%(-0x1*0x1fbf+0x2c*0x86+0x9b7*0x1),_0x565e92=(_0x565e92+_0x171851[_0x4fe7bc])%(-0x1943+0x215f*-0x1+0x1dd1*0x2),_0x945d19=_0x171851[_0x4fe7bc],_0x171851[_0x4fe7bc]=_0x171851[_0x565e92],_0x171851[_0x565e92]=_0x945d19,_0x3b6cf4+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](_0x5d1949['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x1a9396)^_0x171851[(_0x171851[_0x4fe7bc]+_0x171851[_0x565e92])%(-0x196*-0x2+0xde*0x1d+-0x1b52)]);}return _0x3b6cf4;};_0x19cd['\x4e\x41\x48\x71\x46\x6b']=_0x521dc1,_0x19cd['\x57\x47\x66\x69\x66\x51']={},_0x19cd['\x74\x71\x66\x4c\x4f\x65']=!![];}const _0x3b325b=_0x2528c1[0x13*0x16+0x1b3c+0x5*-0x5c6],_0x438e50=_0x33d6cd+_0x3b325b,_0x33b5df=_0x19cd['\x57\x47\x66\x69\x66\x51'][_0x438e50];return!_0x33b5df?(_0x19cd['\x49\x6f\x64\x44\x63\x62']===undefined&&(_0x19cd['\x49\x6f\x64\x44\x63\x62']=!![]),_0x1e1f4c=_0x19cd['\x4e\x41\x48\x71\x46\x6b'](_0x1e1f4c,_0x4a9dbe),_0x19cd['\x57\x47\x66\x69\x66\x51'][_0x438e50]=_0x1e1f4c):_0x1e1f4c=_0x33b5df,_0x1e1f4c;}import{clamp01,normalizePersonalityState,personalityKey}from'\x2e\x2f\x73\x63\x68\x65\x6d\x61\x2e\x6a\x73';export const MIN_SAMPLES_FOR_BEST=-0x14ea*-0x1+-0xf12+-0x5d5;export const SAMPLE_WEIGHT_FULL_AT=-0x30c+-0x72a+-0x13*-0x8a;export function personalityScore(_0x555606){const _0x172bd3=_0x19cd,_0x1355e0=Number(_0x555606?.[_0x172bd3(0x160,'\x74\x67\x24\x39')])||-0x1a*-0x148+-0x2*0xc47+0x3b*-0x26,_0x22c9fb=Number(_0x555606?.[_0x172bd3(0x158,'\x4c\x2a\x70\x4b')])||0x2531+-0x37a*-0xb+0x4b6f*-0x1,_0x3dd640=_0x1355e0+_0x22c9fb,_0x2b1aee=(_0x1355e0+(0x1e2*-0xd+-0x12f3+0x2b6e))/(_0x3dd640+(-0x13b*0x13+-0x73a+0x1e9d)),_0x2b015e=Math[_0x172bd3(0x171,'\x5b\x6e\x44\x24')](-0x1*0x1fbf+0x2c*0x86+0x22e*0x4,_0x3dd640/SAMPLE_WEIGHT_FULL_AT),_0x37ec27=_0x555606?.[_0x172bd3(0x16e,'\x4c\x2a\x70\x4b')],_0x4fd485=Number['\x69\x73\x46\x69\x6e\x69\x74\x65'](Number(_0x37ec27))?clamp01(Number(_0x37ec27)):-0x1943+0x215f*-0x1+0x5dd*0xa+0.5;return _0x2b1aee*(-0x196*-0x2+0xde*0x1d+-0x1c52+0.75)+_0x4fd485*(0x13*0x16+0x1b3c+0x5*-0x5c6+0.25)*_0x2b015e;}export function chooseBestKnownPersonality(_0x17d311){const _0xa349a7=_0x19cd;let _0x3ea682=null;for(const [_0x4a3d15,_0x41c25b]of Object[_0xa349a7(0x16a,'\x43\x2a\x42\x47')](_0x17d311??{})){const _0xa79299=(Number(_0x41c25b?.[_0xa349a7(0x14c,'\x54\x56\x5e\x45')])||0x367+0x1610+-0x1977)+(Number(_0x41c25b?.[_0xa349a7(0x164,'\x63\x35\x51\x51')])||0x8e*0x11+0x1047*0x1+0x19b5*-0x1);if(_0xa79299<MIN_SAMPLES_FOR_BEST)continue;const _0x4a3a5e=personalityScore(_0x41c25b);if(!_0x3ea682||_0x4a3a5e>_0x3ea682[_0xa349a7(0x170,'\x63\x35\x51\x51')])_0x3ea682={'\x6b\x65\x79':_0x4a3d15,'\x73\x63\x6f\x72\x65':_0x4a3a5e,'\x65\x6e\x74\x72\x79':_0x41c25b};}return _0x3ea682;}export function updatePersonalityStats(_0x2e2404,_0x193d63,_0x3fe732){const _0x1b2100=_0x19cd,_0x368102=normalizePersonalityState(_0x193d63[_0x1b2100(0x166,'\x70\x68\x2a\x26')+_0x1b2100(0x15a,'\x6a\x65\x42\x56')]??_0x2e2404['\x63\x75\x72\x72\x65\x6e\x74']),_0x501b76=personalityKey(_0x368102),_0x132097=_0x2e2404[_0x1b2100(0x169,'\x45\x28\x68\x56')][_0x501b76],_0x3d6890=_0x132097?{..._0x132097}:{'\x73\x75\x63\x63\x65\x73\x73':0x0,'\x66\x61\x69\x6c':0x0,'\x61\x76\x67\x53\x63\x6f\x72\x65':0.5,'\x6e':0x0,'\x75\x70\x64\x61\x74\x65\x64\x41\x74':null},_0x4f9984=String(_0x193d63[_0x1b2100(0x151,'\x32\x36\x35\x74')]??'')[_0x1b2100(0x173,'\x53\x72\x75\x69')+'\x61\x73\x65']();if(_0x4f9984===_0x1b2100(0x179,'\x55\x21\x48\x4d'))_0x3d6890[_0x1b2100(0x16c,'\x70\x68\x2a\x26')]+=-0x2430+-0x1692+0x133*0x31;else{if(_0x4f9984===_0x1b2100(0x174,'\x48\x70\x53\x36'))_0x3d6890[_0x1b2100(0x14a,'\x75\x66\x25\x79')]+=0x2535+-0xa9*0x3+-0x2339*0x1;}const _0x5ea923=_0x193d63[_0x1b2100(0x16b,'\x48\x70\x53\x36')]==null?null:Number[_0x1b2100(0x150,'\x31\x44\x4c\x24')](Number(_0x193d63[_0x1b2100(0x175,'\x67\x67\x31\x37')]))?clamp01(Number(_0x193d63[_0x1b2100(0x14b,'\x5a\x35\x30\x32')])):null;if(_0x5ea923!=null){const _0x523e63=_0x3d6890['\x6e']+(-0x52*0x36+0x3*0x357+0x748);_0x3d6890['\x61\x76\x67\x53\x63\x6f\x72\x65']=_0x3d6890[_0x1b2100(0x15b,'\x5d\x5e\x7a\x4c')]+(_0x5ea923-_0x3d6890['\x61\x76\x67\x53\x63\x6f\x72\x65'])/_0x523e63,_0x3d6890['\x6e']=_0x523e63;}_0x3d6890[_0x1b2100(0x172,'\x56\x51\x25\x53')+'\x74']=_0x3fe732;const _0x62e3ca={..._0x2e2404[_0x1b2100(0x163,'\x75\x66\x25\x79')],[_0x501b76]:_0x3d6890},_0x52599b={'\x61\x74':_0x3fe732,'\x6b\x65\x79':_0x501b76,'\x6f\x75\x74\x63\x6f\x6d\x65':_0x4f9984==='\x73\x75\x63\x63\x65\x73\x73'||_0x4f9984===_0x1b2100(0x15f,'\x62\x65\x6a\x23')?_0x4f9984:_0x1b2100(0x17c,'\x4c\x2a\x70\x4b'),'\x73\x63\x6f\x72\x65':_0x5ea923,'\x6e\x6f\x74\x65\x73':_0x193d63[_0x1b2100(0x155,'\x35\x49\x52\x31')]?String(_0x193d63[_0x1b2100(0x16d,'\x31\x44\x4c\x24')])[_0x1b2100(0x15c,'\x31\x44\x4c\x24')](-0x2*0xaa9+0x21ef+-0xc9d,-0x1139+-0x2070+0x3285*0x1):null},_0x55f802={..._0x2e2404,'\x73\x74\x61\x74\x73':_0x62e3ca,'\x68\x69\x73\x74\x6f\x72\x79':[..._0x2e2404[_0x1b2100(0x15d,'\x78\x49\x4c\x77')],_0x52599b]};return{'\x6d\x6f\x64\x65\x6c':_0x55f802,'\x6b\x65\x79':_0x501b76,'\x65\x6e\x74\x72\x79':_0x3d6890};}
|
|
@@ -1,92 +1 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { dirname } from 'node:path';
|
|
3
|
-
import { acquireLock, releaseLock } from '../util/fileLock.js';
|
|
4
|
-
import { personalityStatePath } from '../events/paths.js';
|
|
5
|
-
import { DEFAULT_PERSONALITY, normalizePersonalityState, personalityKey, personalityModel, } from './schema.js';
|
|
6
|
-
/** history 上限 (v1 slice(-120) 同值; 防文件无界增长). */
|
|
7
|
-
export const HISTORY_LIMIT = 120;
|
|
8
|
-
/** 全新默认模型 (无持久文件时的种子). */
|
|
9
|
-
export function defaultPersonalityModel(now = Date.now) {
|
|
10
|
-
return personalityModel.parse({
|
|
11
|
-
version: 1,
|
|
12
|
-
current: { ...DEFAULT_PERSONALITY },
|
|
13
|
-
stats: {},
|
|
14
|
-
history: [],
|
|
15
|
-
updatedAt: new Date(now()).toISOString(),
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* 可进化人格模型的持久化 (v1 loadPersonalityModel / savePersonalityModel 端口).
|
|
20
|
-
* - load: 缺失/空/损坏文件 → 回落默认模型 (绝不抛; 人格是软状态, 读坏不该崩进化循环)
|
|
21
|
-
* - save: tmp+rename 原子替换, 跨进程 O_EXCL 锁串行化 (对齐 EventStore / localJsonl 的写法)
|
|
22
|
-
* current 恒被 normalize 到合法五维, stats/history 恒是合法形状.
|
|
23
|
-
*/
|
|
24
|
-
export class PersonalityStore {
|
|
25
|
-
path;
|
|
26
|
-
lockPath;
|
|
27
|
-
now;
|
|
28
|
-
constructor(opts = {}) {
|
|
29
|
-
this.path = opts.path ?? personalityStatePath();
|
|
30
|
-
this.lockPath = `${this.path}.lock`;
|
|
31
|
-
this.now = opts.now ?? Date.now;
|
|
32
|
-
}
|
|
33
|
-
/** 读模型; 任何 I/O 或校验失败都回落默认 (不抛). */
|
|
34
|
-
load() {
|
|
35
|
-
if (!existsSync(this.path))
|
|
36
|
-
return defaultPersonalityModel(this.now);
|
|
37
|
-
let raw;
|
|
38
|
-
try {
|
|
39
|
-
const text = readFileSync(this.path, 'utf8');
|
|
40
|
-
if (!text.trim())
|
|
41
|
-
return defaultPersonalityModel(this.now);
|
|
42
|
-
raw = JSON.parse(text);
|
|
43
|
-
}
|
|
44
|
-
catch {
|
|
45
|
-
return defaultPersonalityModel(this.now);
|
|
46
|
-
}
|
|
47
|
-
const parsed = personalityModel.safeParse(raw);
|
|
48
|
-
if (parsed.success) {
|
|
49
|
-
// current 再夹一层, 防手改文件塞进越界值绕过 min/max (safeParse 已挡, 双保险).
|
|
50
|
-
return { ...parsed.data, current: normalizePersonalityState(parsed.data.current) };
|
|
51
|
-
}
|
|
52
|
-
// 部分损坏: 尽量抢救 current, 其余回默认.
|
|
53
|
-
const seed = defaultPersonalityModel(this.now);
|
|
54
|
-
const cur = raw?.current;
|
|
55
|
-
return { ...seed, current: normalizePersonalityState(cur ?? DEFAULT_PERSONALITY) };
|
|
56
|
-
}
|
|
57
|
-
/** 原子落盘 (规范化 + history 截断 + 刷 updatedAt). 返回实际写入的模型. */
|
|
58
|
-
save(model) {
|
|
59
|
-
const out = personalityModel.parse({
|
|
60
|
-
version: 1,
|
|
61
|
-
current: normalizePersonalityState(model.current),
|
|
62
|
-
stats: model.stats ?? {},
|
|
63
|
-
history: (model.history ?? []).slice(-HISTORY_LIMIT),
|
|
64
|
-
updatedAt: new Date(this.now()).toISOString(),
|
|
65
|
-
extensions: model.extensions ?? {},
|
|
66
|
-
});
|
|
67
|
-
mkdirSync(dirname(this.path), { recursive: true });
|
|
68
|
-
acquireLock(this.lockPath);
|
|
69
|
-
try {
|
|
70
|
-
const tmp = `${this.path}.tmp`;
|
|
71
|
-
writeFileSync(tmp, `${JSON.stringify(out, null, 2)}\n`, 'utf8');
|
|
72
|
-
renameSync(tmp, this.path); // atomic replace; 崩在中途原文件不动
|
|
73
|
-
}
|
|
74
|
-
finally {
|
|
75
|
-
releaseLock(this.lockPath);
|
|
76
|
-
}
|
|
77
|
-
return out;
|
|
78
|
-
}
|
|
79
|
-
/** 读当前人格 (便捷). */
|
|
80
|
-
currentState() {
|
|
81
|
-
return this.load().current;
|
|
82
|
-
}
|
|
83
|
-
/** 桶键 (便捷). */
|
|
84
|
-
currentKey() {
|
|
85
|
-
return personalityKey(this.load().current);
|
|
86
|
-
}
|
|
87
|
-
/** 当前时间的 ISO 串 (走注入时钟) —— 供进化算子给 stats/history/事件打时间戳. */
|
|
88
|
-
nowIso() {
|
|
89
|
-
return new Date(this.now()).toISOString();
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
export { personalityStatePath };
|
|
1
|
+
const _0xa423d8=_0x2cc3;(function(_0x140e4a,_0x5e19f9){const _0x14ca24=_0x2cc3,_0x140e01=_0x140e4a();while(!![]){try{const _0x195730=parseInt(_0x14ca24(0x151,'\x49\x41\x37\x61'))/(0xbe9*-0x3+0x1e79+-0x1*-0x543)*(-parseInt(_0x14ca24(0x159,'\x74\x59\x54\x44'))/(-0xc15*0x1+-0x1*-0x40+0xbd7))+parseInt(_0x14ca24(0x130,'\x31\x62\x79\x35'))/(0x1fd5+-0x2587+0x3*0x1e7)+-parseInt(_0x14ca24(0x16b,'\x57\x78\x4b\x6b'))/(-0x803*0x2+0x11*-0x61+0x167b)*(-parseInt(_0x14ca24(0x14c,'\x5b\x29\x47\x54'))/(-0x1*0xc97+0x1ca7+-0x1*0x100b))+-parseInt(_0x14ca24(0x153,'\x5a\x57\x37\x40'))/(-0x61a*-0x3+0x20a9*-0x1+-0x9*-0x199)*(-parseInt(_0x14ca24(0x125,'\x43\x4f\x4a\x4f'))/(0x14c4+-0x1a86+0x5c9))+parseInt(_0x14ca24(0x116,'\x71\x6e\x79\x25'))/(-0x5*0x6a1+0x22a4+-0x1*0x177)*(parseInt(_0x14ca24(0x15c,'\x5b\x29\x47\x54'))/(0x3*0x53e+0x4d9+-0xb*0x1de))+parseInt(_0x14ca24(0x12c,'\x34\x63\x39\x26'))/(0x19f*-0x16+-0x4*-0x4cf+0x1078)+parseInt(_0x14ca24(0x166,'\x62\x44\x45\x28'))/(0x1*-0x175d+-0x9*0x36e+0x1*0x3646)*(-parseInt(_0x14ca24(0x127,'\x21\x28\x25\x4e'))/(0x1*0x17d5+-0x5*-0x7cd+-0x3eca));if(_0x195730===_0x5e19f9)break;else _0x140e01['push'](_0x140e01['shift']());}catch(_0x1d92b1){_0x140e01['push'](_0x140e01['shift']());}}}(_0xcdaa,0x1391*0xe+0xe00fe+-0x48d05*0x1));import{existsSync,mkdirSync,readFileSync,renameSync,writeFileSync}from'\x6e\x6f\x64\x65\x3a\x66\x73';function _0x2cc3(_0x4cc764,_0xd53aaf){_0x4cc764=_0x4cc764-(-0xb33+-0x20ac+-0x2*-0x167a);const _0xb8b0b7=_0xcdaa();let _0x5f1a7=_0xb8b0b7[_0x4cc764];if(_0x2cc3['\x79\x6a\x4d\x6d\x53\x6a']===undefined){var _0x1e8c53=function(_0x50f438){const _0x26ac35='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';let _0x5bfc22='',_0x3a4e45='';for(let _0x4d5711=-0x26a6+-0x358+0x29fe,_0x359f94,_0x2ee772,_0x1f9d3b=-0x127*-0x12+-0x1f64+-0x2f*-0x3a;_0x2ee772=_0x50f438['\x63\x68\x61\x72\x41\x74'](_0x1f9d3b++);~_0x2ee772&&(_0x359f94=_0x4d5711%(0x2b*-0x11+0x70e+0x1*-0x42f)?_0x359f94*(0x2075*0x1+0x10fe+-0x3133)+_0x2ee772:_0x2ee772,_0x4d5711++%(0x389*-0x9+0x156e+0x1*0xa67))?_0x5bfc22+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](-0x165f+0x857+0xf07*0x1&_0x359f94>>(-(0x1191+0x96f+-0x1afe)*_0x4d5711&0x1194+-0x228f+-0x5ab*-0x3)):0x490*0x7+0x1798+-0x6f1*0x8){_0x2ee772=_0x26ac35['\x69\x6e\x64\x65\x78\x4f\x66'](_0x2ee772);}for(let _0x5c4e33=0x3b*0x43+-0x2f5*0x4+-0x39d,_0x3352e9=_0x5bfc22['\x6c\x65\x6e\x67\x74\x68'];_0x5c4e33<_0x3352e9;_0x5c4e33++){_0x3a4e45+='\x25'+('\x30\x30'+_0x5bfc22['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x5c4e33)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](-0x1c34+0x1af1+-0x1*-0x153))['\x73\x6c\x69\x63\x65'](-(0x263*0xe+-0xc58+0x1510*-0x1));}return decodeURIComponent(_0x3a4e45);};const _0x3e6a74=function(_0xa05581,_0x218a8b){let _0x39f955=[],_0x468187=0x101*0x11+-0x32*-0xb2+-0x1*0x33d5,_0xcef23b,_0xf3d3e7='';_0xa05581=_0x1e8c53(_0xa05581);let _0x3e7bcf;for(_0x3e7bcf=0x20*0xe+0x9f0+0x22*-0x58;_0x3e7bcf<-0x1a9c+-0x1556+-0x23*-0x166;_0x3e7bcf++){_0x39f955[_0x3e7bcf]=_0x3e7bcf;}for(_0x3e7bcf=0x21dd+0x2*-0x373+0x3*-0x8fd;_0x3e7bcf<0x308*-0x5+0x2*-0x7c3+0x5*0x656;_0x3e7bcf++){_0x468187=(_0x468187+_0x39f955[_0x3e7bcf]+_0x218a8b['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x3e7bcf%_0x218a8b['\x6c\x65\x6e\x67\x74\x68']))%(0x132a*0x1+-0xfe3+-0xb*0x35),_0xcef23b=_0x39f955[_0x3e7bcf],_0x39f955[_0x3e7bcf]=_0x39f955[_0x468187],_0x39f955[_0x468187]=_0xcef23b;}_0x3e7bcf=0x1800+-0xf5f+-0x8a1,_0x468187=0x1*0x6b+0x16d0+-0x1*0x173b;for(let _0x6e649a=0xc2f*0x1+0x5*-0x589+0x1*0xf7e;_0x6e649a<_0xa05581['\x6c\x65\x6e\x67\x74\x68'];_0x6e649a++){_0x3e7bcf=(_0x3e7bcf+(0x2*0x96d+-0x21bc*0x1+0xee3))%(-0x19e+0x21b7+-0x1f19),_0x468187=(_0x468187+_0x39f955[_0x3e7bcf])%(-0x162e+0x120c+0x522),_0xcef23b=_0x39f955[_0x3e7bcf],_0x39f955[_0x3e7bcf]=_0x39f955[_0x468187],_0x39f955[_0x468187]=_0xcef23b,_0xf3d3e7+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](_0xa05581['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x6e649a)^_0x39f955[(_0x39f955[_0x3e7bcf]+_0x39f955[_0x468187])%(-0x644*0x3+-0x245+0x1611)]);}return _0xf3d3e7;};_0x2cc3['\x44\x6b\x4b\x73\x43\x72']=_0x3e6a74,_0x2cc3['\x75\x4e\x45\x71\x54\x78']={},_0x2cc3['\x79\x6a\x4d\x6d\x53\x6a']=!![];}const _0x102a9e=_0xb8b0b7[-0x6c7*0x1+0x288*-0x7+0x187f],_0x298263=_0x4cc764+_0x102a9e,_0x2bf82a=_0x2cc3['\x75\x4e\x45\x71\x54\x78'][_0x298263];return!_0x2bf82a?(_0x2cc3['\x6b\x44\x54\x6a\x4c\x47']===undefined&&(_0x2cc3['\x6b\x44\x54\x6a\x4c\x47']=!![]),_0x5f1a7=_0x2cc3['\x44\x6b\x4b\x73\x43\x72'](_0x5f1a7,_0xd53aaf),_0x2cc3['\x75\x4e\x45\x71\x54\x78'][_0x298263]=_0x5f1a7):_0x5f1a7=_0x2bf82a,_0x5f1a7;}function _0xcdaa(){const _0xcfa7e0=['\x77\x58\x4c\x2b\x6f\x53\x6b\x42','\x42\x6d\x6f\x65\x69\x53\x6b\x49\x75\x58\x70\x64\x4c\x62\x34\x7a\x57\x37\x46\x63\x47\x38\x6f\x53\x67\x71','\x68\x65\x6d\x44\x79\x4d\x79','\x6f\x71\x72\x37','\x77\x4d\x37\x64\x53\x6d\x6b\x43\x57\x37\x43\x6f\x57\x37\x30','\x57\x35\x54\x43\x57\x34\x58\x75\x57\x4f\x2f\x64\x4e\x6d\x6f\x4b\x57\x35\x57','\x63\x4b\x38\x69\x43\x33\x54\x4d\x68\x6d\x6f\x52','\x45\x59\x4e\x63\x53\x53\x6f\x35\x57\x37\x48\x51\x6b\x6d\x6f\x4f\x76\x53\x6b\x69\x6d\x73\x37\x64\x54\x47','\x69\x6d\x6f\x62\x6b\x53\x6f\x30','\x74\x68\x6e\x39','\x68\x38\x6f\x54\x57\x51\x68\x63\x51\x74\x78\x64\x4d\x74\x6c\x63\x47\x71','\x6d\x43\x6b\x43\x57\x35\x69\x79\x57\x37\x75','\x79\x38\x6f\x39\x57\x50\x64\x64\x52\x61','\x6c\x57\x70\x64\x4f\x43\x6b\x71\x46\x61','\x6e\x38\x6b\x71\x77\x5a\x31\x59\x57\x52\x5a\x63\x51\x53\x6b\x37\x57\x37\x5a\x64\x4c\x31\x42\x63\x50\x63\x65','\x57\x52\x35\x69\x57\x4f\x47\x68\x64\x4c\x65\x74\x44\x47','\x57\x36\x66\x77\x57\x35\x44\x56\x77\x43\x6b\x37\x74\x47\x69','\x57\x51\x33\x63\x4c\x43\x6f\x49\x7a\x71','\x74\x77\x4e\x64\x51\x38\x6b\x64','\x6e\x43\x6b\x44\x45\x38\x6f\x2f','\x76\x71\x42\x64\x55\x4e\x4c\x56\x78\x53\x6b\x52\x57\x51\x39\x57\x78\x63\x4f\x4b\x57\x51\x75','\x57\x4f\x54\x6b\x43\x57','\x57\x36\x52\x63\x4a\x38\x6b\x50\x57\x37\x30','\x76\x57\x6c\x64\x56\x68\x6e\x49\x6e\x6d\x6f\x37\x57\x52\x54\x47\x74\x71\x65','\x76\x4d\x48\x35\x57\x35\x4e\x64\x4f\x73\x46\x64\x4a\x71','\x57\x37\x56\x64\x56\x38\x6b\x65\x61\x57\x53\x5a\x57\x50\x68\x64\x51\x61\x71','\x6f\x53\x6f\x51\x71\x61\x69','\x6a\x53\x6f\x33\x68\x47','\x57\x50\x57\x71\x57\x35\x76\x6c\x57\x50\x68\x64\x4e\x43\x6f\x49\x57\x37\x71','\x57\x52\x78\x63\x4b\x75\x4f\x47\x57\x34\x33\x63\x53\x64\x42\x64\x50\x47','\x62\x72\x64\x64\x50\x5a\x64\x64\x54\x77\x70\x64\x47\x53\x6b\x37','\x57\x34\x7a\x4b\x62\x53\x6b\x35\x57\x51\x74\x63\x4e\x6d\x6f\x42\x6f\x61','\x45\x33\x46\x64\x48\x64\x6d','\x57\x35\x39\x2f\x61\x38\x6f\x51','\x57\x36\x5a\x63\x4f\x53\x6f\x4d\x78\x47\x79\x50\x46\x61','\x6d\x4d\x74\x63\x4d\x43\x6b\x37','\x57\x37\x6e\x6a\x57\x50\x43\x66','\x64\x53\x6f\x6e\x44\x59\x43\x4e','\x57\x50\x74\x63\x4a\x43\x6f\x6e\x61\x30\x6e\x2f\x7a\x43\x6b\x64','\x6f\x43\x6b\x6e\x44\x58\x68\x64\x56\x57','\x66\x53\x6b\x50\x44\x47','\x46\x4b\x6c\x64\x47\x6d\x6b\x52\x57\x50\x43\x52\x42\x61','\x6a\x6d\x6f\x62\x6b\x53\x6f\x35','\x43\x64\x70\x64\x4c\x43\x6f\x4d\x64\x43\x6b\x45\x64\x43\x6b\x67\x57\x37\x56\x64\x54\x73\x61\x2f\x6f\x61','\x6a\x43\x6b\x64\x7a\x47\x4e\x64\x49\x4d\x43\x71\x57\x52\x57','\x42\x49\x64\x63\x49\x4d\x47','\x57\x4f\x4c\x6b\x7a\x38\x6b\x2b\x57\x34\x68\x64\x4f\x53\x6b\x4f\x62\x57','\x57\x50\x76\x65\x43\x6d\x6b\x39','\x57\x35\x74\x63\x49\x33\x64\x63\x54\x59\x47','\x57\x37\x5a\x63\x4c\x53\x6b\x50\x46\x61','\x42\x68\x46\x64\x4c\x4a\x46\x64\x50\x63\x39\x79\x76\x47','\x6f\x53\x6b\x75\x43\x53\x6f\x33\x6b\x57','\x57\x52\x38\x61\x57\x4f\x61\x5a\x6f\x38\x6f\x51\x61\x58\x64\x63\x54\x43\x6b\x57\x57\x4f\x68\x63\x49\x43\x6b\x7a','\x57\x52\x4e\x63\x50\x53\x6f\x73\x66\x72\x71\x37\x57\x4f\x2f\x64\x53\x71','\x57\x51\x4e\x64\x4a\x38\x6f\x54\x42\x53\x6f\x6e\x57\x4f\x4e\x63\x4c\x6d\x6f\x5a\x61\x71','\x57\x34\x70\x64\x56\x38\x6b\x73','\x77\x43\x6b\x56\x57\x50\x78\x64\x50\x61','\x57\x34\x4e\x63\x47\x71\x6d','\x6b\x5a\x42\x64\x53\x38\x6f\x52\x57\x52\x61\x6c\x42\x61','\x57\x51\x70\x63\x56\x4c\x47','\x57\x35\x37\x63\x4b\x48\x37\x63\x48\x6d\x6f\x36\x57\x35\x7a\x34\x57\x36\x57','\x71\x4b\x4e\x64\x56\x62\x42\x64\x51\x65\x6c\x64\x4e\x53\x6b\x41','\x57\x35\x35\x4b\x6c\x6d\x6b\x62\x57\x52\x56\x63\x52\x53\x6f\x42\x69\x47','\x57\x37\x42\x63\x4d\x6d\x6b\x51','\x57\x51\x70\x63\x51\x43\x6f\x74','\x57\x35\x6d\x71\x6e\x53\x6f\x4e\x57\x51\x78\x63\x54\x6d\x6f\x53\x6b\x6d\x6f\x63\x57\x51\x74\x64\x51\x57\x35\x62','\x57\x4f\x7a\x4e\x45\x71','\x44\x5a\x56\x63\x4a\x74\x71','\x76\x53\x6b\x41\x57\x52\x34','\x42\x4c\x42\x63\x56\x6d\x6f\x65\x6b\x38\x6f\x77\x65\x73\x6c\x64\x4b\x71\x2f\x63\x4b\x38\x6f\x2b\x45\x57','\x57\x34\x33\x63\x4b\x43\x6f\x65','\x57\x37\x4c\x77\x57\x37\x31\x78\x72\x53\x6b\x6a\x74\x48\x47','\x65\x65\x78\x63\x51\x64\x38\x4b','\x6a\x43\x6b\x43\x57\x35\x71\x6b','\x57\x35\x70\x63\x4e\x38\x6f\x68\x72\x47','\x69\x6d\x6f\x30\x57\x37\x72\x6c\x57\x50\x79','\x57\x51\x42\x63\x49\x4e\x4b','\x57\x50\x52\x64\x49\x57\x68\x63\x4d\x47','\x57\x36\x61\x55\x6d\x71','\x64\x6d\x6f\x4a\x57\x34\x34','\x71\x53\x6f\x68\x57\x51\x47','\x57\x35\x46\x63\x4a\x57\x42\x63\x55\x6d\x6f\x4e','\x57\x37\x42\x63\x47\x43\x6b\x36\x57\x36\x4f\x47','\x61\x72\x37\x64\x4d\x47\x53','\x6f\x53\x6b\x79\x44\x57\x56\x64\x54\x67\x65\x6e\x57\x52\x69','\x6d\x53\x6b\x69\x57\x34\x6d\x69\x57\x37\x76\x61\x7a\x57','\x46\x58\x56\x64\x48\x53\x6f\x59\x57\x4f\x6d\x77\x42\x53\x6f\x6d','\x57\x50\x42\x64\x49\x6d\x6b\x6c\x66\x38\x6b\x78\x57\x52\x6c\x64\x48\x53\x6b\x2f\x57\x50\x33\x63\x4b\x77\x42\x63\x50\x32\x47','\x57\x36\x4e\x63\x4d\x53\x6f\x30\x6e\x43\x6b\x54','\x71\x53\x6f\x68\x57\x51\x47\x78\x57\x36\x2f\x63\x48\x57','\x57\x52\x56\x63\x49\x77\x46\x64\x47\x65\x4f','\x57\x50\x66\x78\x42\x43\x6b\x34','\x6b\x4d\x2f\x64\x54\x43\x6b\x59\x57\x51\x71\x32\x42\x47','\x73\x33\x6a\x54','\x57\x52\x4e\x63\x48\x31\x4b','\x57\x34\x6a\x49\x66\x53\x6b\x4d\x57\x50\x56\x63\x4a\x38\x6f\x77','\x6b\x43\x6f\x2b\x72\x48\x47\x4d\x68\x62\x34','\x67\x6d\x6f\x4f\x57\x34\x42\x64\x50\x66\x6c\x64\x53\x74\x4e\x63\x49\x53\x6b\x69\x71\x6d\x6f\x46','\x6e\x38\x6f\x67\x6e\x53\x6f\x39\x41\x71','\x57\x4f\x72\x4e\x63\x53\x6b\x58\x57\x50\x38','\x57\x51\x4e\x63\x53\x66\x56\x63\x50\x47','\x6e\x38\x6b\x44\x42\x71','\x57\x37\x4e\x63\x53\x33\x37\x64\x53\x66\x42\x63\x49\x4d\x34'];_0xcdaa=function(){return _0xcfa7e0;};return _0xcdaa();}import{dirname}from'\x6e\x6f\x64\x65\x3a\x70\x61\x74\x68';import{acquireLock,releaseLock}from'\x2e\x2e\x2f\x75\x74\x69\x6c\x2f\x66\x69\x6c\x65\x4c\x6f\x63\x6b\x2e\x6a\x73';import{personalityStatePath}from'\x2e\x2e\x2f\x65\x76\x65\x6e\x74\x73\x2f\x70\x61\x74\x68\x73\x2e\x6a\x73';import{DEFAULT_PERSONALITY,normalizePersonalityState,personalityKey,personalityModel}from'\x2e\x2f\x73\x63\x68\x65\x6d\x61\x2e\x6a\x73';export const HISTORY_LIMIT=-0x245+0x895+-0x5d8;export function defaultPersonalityModel(_0x102a9e=Date[_0xa423d8(0x124,'\x29\x26\x37\x33')]){const _0x42719a=_0xa423d8;return personalityModel[_0x42719a(0x15d,'\x35\x36\x43\x28')]({'\x76\x65\x72\x73\x69\x6f\x6e':0x1,'\x63\x75\x72\x72\x65\x6e\x74':{...DEFAULT_PERSONALITY},'\x73\x74\x61\x74\x73':{},'\x68\x69\x73\x74\x6f\x72\x79':[],'\x75\x70\x64\x61\x74\x65\x64\x41\x74':new Date(_0x102a9e())[_0x42719a(0x178,'\x59\x65\x28\x36')+_0x42719a(0x17a,'\x28\x67\x4c\x64')]()});}export class PersonalityStore{[_0xa423d8(0x135,'\x4c\x45\x70\x38')];['\x6c\x6f\x63\x6b\x50\x61\x74\x68'];[_0xa423d8(0x155,'\x6d\x4e\x30\x64')];constructor(_0x298263={}){const _0x37144c=_0xa423d8;this[_0x37144c(0x16c,'\x78\x6d\x58\x2a')]=_0x298263[_0x37144c(0x135,'\x4c\x45\x70\x38')]??personalityStatePath(),this[_0x37144c(0x171,'\x78\x58\x55\x57')]=this[_0x37144c(0x115,'\x56\x66\x59\x48')]+_0x37144c(0x14e,'\x78\x58\x55\x57'),this[_0x37144c(0x150,'\x5a\x57\x37\x40')]=_0x298263[_0x37144c(0x148,'\x26\x28\x25\x75')]??Date[_0x37144c(0x12a,'\x35\x49\x71\x47')];}[_0xa423d8(0x165,'\x5a\x57\x37\x40')](){const _0x4a7f2e=_0xa423d8;if(!existsSync(this[_0x4a7f2e(0x138,'\x21\x28\x25\x4e')]))return defaultPersonalityModel(this[_0x4a7f2e(0x126,'\x64\x28\x47\x32')]);let _0x2bf82a;try{if(_0x4a7f2e(0x11b,'\x34\x54\x5b\x46')===_0x4a7f2e(0x136,'\x71\x34\x68\x36')){const _0x5bfc22=readFileSync(this[_0x4a7f2e(0x13e,'\x36\x59\x44\x4e')],'\x75\x74\x66\x38');if(!_0x5bfc22[_0x4a7f2e(0x146,'\x34\x63\x39\x26')]())return defaultPersonalityModel(this[_0x4a7f2e(0x167,'\x34\x63\x39\x26')]);_0x2bf82a=JSON[_0x4a7f2e(0x13d,'\x79\x45\x28\x62')](_0x5bfc22);}else{const _0x4d5711=_0x3bd0af[_0x4a7f2e(0x13c,'\x29\x26\x37\x33')]({'\x76\x65\x72\x73\x69\x6f\x6e':0x1,'\x63\x75\x72\x72\x65\x6e\x74':_0x4c717a(_0x4b366a['\x63\x75\x72\x72\x65\x6e\x74']),'\x73\x74\x61\x74\x73':_0x224182[_0x4a7f2e(0x133,'\x62\x44\x45\x28')]??{},'\x68\x69\x73\x74\x6f\x72\x79':(_0x3edd36[_0x4a7f2e(0x14a,'\x78\x58\x55\x57')]??[])[_0x4a7f2e(0x15f,'\x31\x62\x79\x35')](-_0x4514ac),'\x75\x70\x64\x61\x74\x65\x64\x41\x74':new _0xf367d5(this[_0x4a7f2e(0x16d,'\x57\x6b\x78\x6a')]())[_0x4a7f2e(0x129,'\x78\x58\x55\x57')+_0x4a7f2e(0x15b,'\x26\x28\x25\x75')](),'\x65\x78\x74\x65\x6e\x73\x69\x6f\x6e\x73':_0x15a616[_0x4a7f2e(0x158,'\x79\x47\x39\x70')+'\x6e\x73']??{}});_0x1a457d(_0x7ae3ce(this[_0x4a7f2e(0x175,'\x71\x6e\x79\x25')]),{'\x72\x65\x63\x75\x72\x73\x69\x76\x65':!![]}),_0x414ce8(this[_0x4a7f2e(0x162,'\x6c\x59\x56\x26')]);try{const _0x359f94=this[_0x4a7f2e(0x11a,'\x34\x63\x39\x26')]+'\x2e\x74\x6d\x70';_0x307fc2(_0x359f94,_0x3e2fef[_0x4a7f2e(0x13f,'\x32\x66\x44\x5e')+'\x79'](_0x4d5711,null,-0x6c7*0x1+0x288*-0x7+0x1881)+'\x0a',_0x4a7f2e(0x123,'\x5b\x29\x47\x54')),_0x4a36bd(_0x359f94,this[_0x4a7f2e(0x115,'\x56\x66\x59\x48')]);}finally{_0x354885(this[_0x4a7f2e(0x117,'\x32\x66\x44\x5e')]);}return _0x4d5711;}}catch{return _0x4a7f2e(0x177,'\x78\x6d\x58\x2a')===_0x4a7f2e(0x152,'\x30\x23\x34\x76')?defaultPersonalityModel(this[_0x4a7f2e(0x122,'\x78\x59\x6d\x67')]):new _0x1cede4(this[_0x4a7f2e(0x122,'\x78\x59\x6d\x67')]())[_0x4a7f2e(0x129,'\x78\x58\x55\x57')+_0x4a7f2e(0x12f,'\x47\x58\x4e\x78')]();}const _0x3e6a74=personalityModel[_0x4a7f2e(0x120,'\x57\x78\x4b\x6b')+'\x65'](_0x2bf82a);if(_0x3e6a74[_0x4a7f2e(0x140,'\x35\x36\x43\x28')])return{..._0x3e6a74[_0x4a7f2e(0x11c,'\x35\x49\x71\x47')],'\x63\x75\x72\x72\x65\x6e\x74':normalizePersonalityState(_0x3e6a74[_0x4a7f2e(0x134,'\x35\x36\x43\x28')][_0x4a7f2e(0x156,'\x4d\x2a\x52\x40')])};const _0x50f438=defaultPersonalityModel(this[_0x4a7f2e(0x12d,'\x61\x41\x39\x25')]),_0x26ac35=_0x2bf82a?.[_0x4a7f2e(0x14b,'\x78\x6d\x58\x2a')];return{..._0x50f438,'\x63\x75\x72\x72\x65\x6e\x74':normalizePersonalityState(_0x26ac35??DEFAULT_PERSONALITY)};}['\x73\x61\x76\x65'](_0x1f9d3b){const _0x485b9d=_0xa423d8,_0x5c4e33=personalityModel[_0x485b9d(0x179,'\x32\x66\x44\x5e')]({'\x76\x65\x72\x73\x69\x6f\x6e':0x1,'\x63\x75\x72\x72\x65\x6e\x74':normalizePersonalityState(_0x1f9d3b['\x63\x75\x72\x72\x65\x6e\x74']),'\x73\x74\x61\x74\x73':_0x1f9d3b[_0x485b9d(0x154,'\x79\x47\x39\x70')]??{},'\x68\x69\x73\x74\x6f\x72\x79':(_0x1f9d3b['\x68\x69\x73\x74\x6f\x72\x79']??[])[_0x485b9d(0x145,'\x49\x41\x37\x61')](-HISTORY_LIMIT),'\x75\x70\x64\x61\x74\x65\x64\x41\x74':new Date(this[_0x485b9d(0x13b,'\x44\x66\x70\x33')]())[_0x485b9d(0x170,'\x36\x59\x44\x4e')+_0x485b9d(0x12b,'\x57\x78\x4b\x6b')](),'\x65\x78\x74\x65\x6e\x73\x69\x6f\x6e\x73':_0x1f9d3b[_0x485b9d(0x16f,'\x6b\x77\x6d\x47')+'\x6e\x73']??{}});mkdirSync(dirname(this[_0x485b9d(0x115,'\x56\x66\x59\x48')]),{'\x72\x65\x63\x75\x72\x73\x69\x76\x65':!![]}),acquireLock(this['\x6c\x6f\x63\x6b\x50\x61\x74\x68']);try{const _0x3352e9=this[_0x485b9d(0x135,'\x4c\x45\x70\x38')]+_0x485b9d(0x176,'\x78\x5d\x50\x4b');writeFileSync(_0x3352e9,JSON[_0x485b9d(0x16e,'\x25\x42\x45\x79')+'\x79'](_0x5c4e33,null,0x17d6+-0x1c27+0x453)+'\x0a',_0x485b9d(0x12e,'\x55\x76\x28\x66')),renameSync(_0x3352e9,this[_0x485b9d(0x163,'\x23\x77\x6b\x43')]);}finally{if(_0x485b9d(0x11e,'\x5a\x57\x37\x40')!==_0x485b9d(0x14d,'\x56\x66\x59\x48')){if(!_0x30954e(this[_0x485b9d(0x16c,'\x78\x6d\x58\x2a')]))return _0x146281(this[_0x485b9d(0x131,'\x4c\x45\x70\x38')]);let _0x218a8b;try{const _0xf3d3e7=_0x262f27(this[_0x485b9d(0x15e,'\x41\x2a\x6d\x35')],_0x485b9d(0x173,'\x78\x58\x55\x57'));if(!_0xf3d3e7[_0x485b9d(0x164,'\x4d\x2a\x52\x40')]())return _0x452410(this[_0x485b9d(0x139,'\x72\x55\x72\x5d')]);_0x218a8b=_0x581eb0[_0x485b9d(0x143,'\x56\x37\x2a\x6b')](_0xf3d3e7);}catch{return _0x2faa15(this['\x6e\x6f\x77']);}const _0x39f955=_0x5334d4[_0x485b9d(0x11d,'\x43\x5d\x69\x23')+'\x65'](_0x218a8b);if(_0x39f955[_0x485b9d(0x16a,'\x26\x28\x25\x75')])return{..._0x39f955[_0x485b9d(0x172,'\x43\x5d\x69\x23')],'\x63\x75\x72\x72\x65\x6e\x74':_0x50de5b(_0x39f955[_0x485b9d(0x14f,'\x64\x28\x47\x32')][_0x485b9d(0x147,'\x74\x59\x54\x44')])};const _0x468187=_0x3b3379(this[_0x485b9d(0x137,'\x49\x41\x37\x61')]),_0xcef23b=_0x218a8b?.['\x63\x75\x72\x72\x65\x6e\x74'];return{..._0x468187,'\x63\x75\x72\x72\x65\x6e\x74':_0x1f5158(_0xcef23b??_0x22edb8)};}else releaseLock(this[_0x485b9d(0x119,'\x34\x63\x39\x26')]);}return _0x5c4e33;}[_0xa423d8(0x161,'\x78\x5d\x50\x4b')+_0xa423d8(0x15a,'\x56\x66\x59\x48')](){const _0x233070=_0xa423d8;return this[_0x233070(0x118,'\x55\x76\x28\x66')]()[_0x233070(0x147,'\x74\x59\x54\x44')];}[_0xa423d8(0x141,'\x43\x4f\x4a\x4f')+'\x65\x79'](){const _0x46e43d=_0xa423d8;return personalityKey(this[_0x46e43d(0x168,'\x79\x45\x28\x62')]()[_0x46e43d(0x14b,'\x78\x6d\x58\x2a')]);}[_0xa423d8(0x144,'\x44\x66\x70\x33')](){const _0x4dd91e=_0xa423d8;return new Date(this[_0x4dd91e(0x13a,'\x71\x34\x68\x36')]())[_0x4dd91e(0x132,'\x6c\x59\x56\x26')+_0x4dd91e(0x149,'\x6b\x77\x6d\x47')]();}}export{personalityStatePath};
|
package/dist/schema/common.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
import { z }
|
|
2
|
-
/** evolver-core 内部 domain schema 版本 (与 gep-sdk SCHEMA_VERSION 解耦). */
|
|
3
|
-
export const DOMAIN_SCHEMA_VERSION = '1.0.0';
|
|
4
|
-
/** ULID (26 char Crockford base32). */
|
|
5
|
-
export const ulid = z.string().regex(/^[0-9A-HJKMNP-TV-Z]{26}$/, 'invalid ULID');
|
|
6
|
-
export const sha256Hash = z.string().regex(/^sha256:[a-f0-9]{64}$/, 'invalid sha256');
|
|
7
|
-
/** 防过早冻结的扩展字段 (军杰 §11). */
|
|
8
|
-
export const extensions = z.record(z.string(), z.unknown()).default({});
|
|
9
|
-
/** 大对象走 artifact 引用. */
|
|
10
|
-
export const artifactRef = z.object({
|
|
11
|
-
path: z.string(),
|
|
12
|
-
sha256: z.string(),
|
|
13
|
-
size: z.number().int().nonnegative(),
|
|
14
|
-
});
|
|
15
|
-
/** runtime 来源 (D11). 'generic-chat' = 任何输出标准 OpenAI/Anthropic messages 的 AI(经 genericChatAdapter 接入). */
|
|
16
|
-
export const sourceAgent = z.enum(['claude-code', 'codex', 'cursor', 'gemini', 'antigravity', 'kimi', 'kiro', 'opencode', 'generic-chat']);
|
|
17
|
-
export const blastRadius = z.enum(['file', 'module', 'package', 'system']);
|
|
1
|
+
const _0x5cd3d9=_0x1b38;(function(_0x237b15,_0x18f061){const _0xf4022e=_0x1b38,_0x2c3930=_0x237b15();while(!![]){try{const _0x1d7051=-parseInt(_0xf4022e(0xc7,'\x32\x39\x59\x42'))/(-0x2053+-0x232f+0x4383)+parseInt(_0xf4022e(0xd4,'\x29\x70\x25\x2a'))/(0xdea+0x10*-0xf4+0x1*0x158)*(parseInt(_0xf4022e(0xed,'\x36\x31\x28\x43'))/(-0x1*0x1fde+-0x18ed+-0x1*-0x38ce))+-parseInt(_0xf4022e(0xea,'\x61\x42\x73\x6d'))/(-0x101*0x22+0x1e94+-0x1*-0x392)+-parseInt(_0xf4022e(0xf1,'\x4e\x70\x71\x59'))/(-0x18b9+0x2de+0x15e0)+parseInt(_0xf4022e(0xf3,'\x33\x31\x30\x5e'))/(-0x4af*-0x3+0x141*-0x1+0xa*-0x147)*(-parseInt(_0xf4022e(0xce,'\x38\x77\x49\x78'))/(-0x1cb9+-0x6c4*0x4+0x4*0xdf4))+parseInt(_0xf4022e(0xd3,'\x32\x39\x59\x42'))/(-0x2669*0x1+-0x695*-0x4+0xc1d)+parseInt(_0xf4022e(0xc1,'\x38\x66\x5a\x26'))/(-0x646+-0x1a03+0x1*0x2052);if(_0x1d7051===_0x18f061)break;else _0x2c3930['push'](_0x2c3930['shift']());}catch(_0x34b0e5){_0x2c3930['push'](_0x2c3930['shift']());}}}(_0x2664,-0x11*0x42f7+-0x33*0x1570+-0x5dc2*-0x23));import{z}from'\x7a\x6f\x64';export const DOMAIN_SCHEMA_VERSION='\x31\x2e\x30\x2e\x30';export const ulid=z[_0x5cd3d9(0xd8,'\x51\x5d\x48\x25')]()[_0x5cd3d9(0xc4,'\x4c\x69\x76\x40')](/^[0-9A-HJKMNP-TV-Z]{26}$/,_0x5cd3d9(0xe2,'\x37\x30\x26\x48')+_0x5cd3d9(0xdf,'\x52\x5d\x44\x77'));export const sha256Hash=z[_0x5cd3d9(0xd2,'\x45\x4c\x5b\x61')]()[_0x5cd3d9(0xf2,'\x29\x70\x25\x2a')](/^sha256:[a-f0-9]{64}$/,_0x5cd3d9(0xde,'\x45\x26\x78\x73')+_0x5cd3d9(0xeb,'\x51\x5d\x48\x25'));export const extensions=z[_0x5cd3d9(0xd1,'\x33\x44\x6c\x5e')](z[_0x5cd3d9(0xd6,'\x5e\x47\x6f\x48')](),z[_0x5cd3d9(0xc3,'\x44\x79\x55\x71')]())[_0x5cd3d9(0xdc,'\x44\x50\x25\x37')]({});export const artifactRef=z[_0x5cd3d9(0xe9,'\x62\x4e\x35\x66')]({'\x70\x61\x74\x68':z[_0x5cd3d9(0xef,'\x44\x50\x25\x37')](),'\x73\x68\x61\x32\x35\x36':z[_0x5cd3d9(0xcd,'\x45\x26\x78\x73')](),'\x73\x69\x7a\x65':z[_0x5cd3d9(0xe3,'\x57\x29\x7a\x43')]()[_0x5cd3d9(0xc6,'\x23\x49\x38\x76')]()[_0x5cd3d9(0xf4,'\x5d\x2a\x43\x61')+_0x5cd3d9(0xdd,'\x5a\x44\x2a\x4b')]()});export const sourceAgent=z[_0x5cd3d9(0xc8,'\x6a\x56\x4c\x37')]([_0x5cd3d9(0xd9,'\x59\x76\x5b\x70')+_0x5cd3d9(0xe5,'\x33\x44\x6c\x5e'),_0x5cd3d9(0xc9,'\x38\x66\x5a\x26'),_0x5cd3d9(0xcc,'\x42\x75\x5d\x78'),_0x5cd3d9(0xe0,'\x69\x55\x6f\x21'),_0x5cd3d9(0xcb,'\x59\x76\x5b\x70')+_0x5cd3d9(0xe8,'\x69\x55\x6f\x21'),_0x5cd3d9(0xf6,'\x29\x70\x25\x2a'),_0x5cd3d9(0xda,'\x70\x67\x39\x4f'),_0x5cd3d9(0xe7,'\x33\x44\x6c\x5e'),_0x5cd3d9(0xe4,'\x61\x42\x73\x6d')+_0x5cd3d9(0xd0,'\x5e\x47\x6f\x48')]);function _0x2664(){const _0x20f4df=['\x7a\x58\x37\x64\x4e\x38\x6b\x36\x57\x4f\x4b\x37\x75\x76\x47','\x57\x36\x6e\x37\x57\x52\x61\x45\x57\x35\x4f\x6a','\x65\x78\x64\x64\x4e\x66\x69\x44\x66\x6d\x6f\x78\x57\x37\x4b','\x57\x4f\x43\x47\x73\x61','\x57\x52\x69\x34\x7a\x6d\x6b\x30\x66\x38\x6f\x35\x57\x50\x4b','\x57\x4f\x43\x30\x73\x63\x70\x63\x50\x38\x6b\x73\x57\x51\x68\x63\x49\x71','\x57\x37\x64\x63\x49\x74\x4b','\x57\x51\x35\x65\x6e\x32\x61\x36\x57\x4f\x57','\x72\x59\x64\x63\x47\x71\x66\x46\x73\x43\x6b\x65\x57\x50\x70\x63\x4a\x6d\x6f\x61\x62\x6d\x6f\x30\x57\x36\x43','\x57\x4f\x61\x53\x76\x77\x56\x64\x51\x30\x34','\x57\x34\x30\x78\x78\x57\x30\x2b\x70\x53\x6b\x46\x69\x57','\x57\x50\x72\x78\x44\x65\x4f\x53\x6e\x47\x57\x56\x6c\x53\x6f\x48\x57\x52\x68\x63\x4d\x71','\x57\x36\x54\x67\x41\x48\x50\x68\x71\x43\x6b\x47\x69\x38\x6f\x44\x57\x35\x35\x42\x57\x51\x44\x67\x57\x34\x71','\x57\x51\x69\x42\x78\x38\x6b\x68\x57\x37\x4e\x63\x55\x57','\x57\x4f\x65\x51\x68\x59\x68\x64\x4e\x62\x56\x63\x4c\x43\x6f\x74\x57\x51\x48\x52\x7a\x43\x6f\x47\x57\x36\x47','\x42\x4b\x70\x63\x47\x61\x74\x64\x55\x77\x70\x63\x56\x65\x2f\x64\x55\x77\x47\x61\x72\x47\x38','\x64\x63\x6e\x6b\x77\x38\x6b\x4a','\x69\x49\x30\x38\x57\x52\x78\x63\x55\x75\x5a\x63\x4b\x43\x6b\x54','\x6f\x67\x68\x63\x56\x73\x64\x63\x49\x59\x39\x6e\x6a\x57','\x44\x78\x79\x66\x57\x52\x47','\x66\x73\x39\x61\x76\x57','\x6b\x78\x78\x64\x53\x53\x6b\x62\x57\x37\x43\x62\x57\x34\x4e\x64\x54\x77\x6d\x74\x57\x51\x52\x63\x51\x62\x42\x64\x4e\x47','\x57\x50\x30\x36\x57\x36\x31\x2b\x6f\x67\x62\x69\x57\x34\x54\x68\x57\x4f\x33\x63\x53\x6d\x6b\x31\x65\x57','\x57\x36\x5a\x63\x4f\x38\x6b\x6c\x57\x4f\x68\x64\x53\x53\x6f\x54\x6e\x57','\x57\x37\x6c\x63\x51\x43\x6b\x73\x57\x4f\x46\x64\x47\x61','\x57\x37\x56\x63\x47\x72\x42\x64\x4e\x38\x6b\x67\x46\x43\x6f\x48','\x57\x50\x76\x6c\x46\x47','\x61\x38\x6b\x6f\x65\x47\x34\x67\x6f\x38\x6f\x49\x57\x51\x62\x6a\x57\x50\x35\x33\x57\x50\x75','\x57\x34\x4c\x53\x57\x51\x34\x49','\x45\x59\x4a\x63\x52\x38\x6f\x78\x57\x52\x79','\x57\x36\x4c\x45\x68\x53\x6f\x42\x57\x51\x68\x64\x52\x77\x53\x41\x42\x6d\x6b\x51\x73\x38\x6f\x42','\x45\x5a\x78\x64\x53\x53\x6f\x50\x6b\x38\x6f\x4e\x57\x4f\x78\x63\x4e\x71','\x70\x43\x6b\x6d\x42\x43\x6b\x31\x6b\x38\x6f\x66','\x6c\x43\x6f\x44\x61\x32\x30\x4d\x57\x51\x57','\x57\x52\x70\x63\x50\x57\x70\x64\x4b\x38\x6b\x49\x70\x49\x46\x64\x4e\x59\x47\x2b\x64\x33\x6a\x71','\x6a\x78\x46\x63\x4f\x64\x52\x63\x49\x59\x75','\x57\x50\x68\x64\x4c\x64\x34\x31','\x57\x50\x4f\x48\x74\x49\x6c\x63\x54\x53\x6b\x7a','\x57\x51\x35\x47\x62\x38\x6b\x58\x57\x35\x44\x62','\x62\x53\x6b\x65\x68\x61\x4f\x70\x70\x38\x6b\x5a\x57\x52\x50\x6f\x57\x50\x6a\x62\x57\x52\x4a\x63\x49\x61','\x74\x63\x66\x53\x78\x38\x6b\x32\x71\x6d\x6f\x33','\x57\x50\x4f\x58\x57\x37\x5a\x63\x4d\x47','\x57\x4f\x68\x64\x49\x63\x30\x4f\x76\x6d\x6f\x35','\x57\x52\x66\x4f\x65\x53\x6f\x4d\x73\x53\x6b\x75\x57\x34\x46\x64\x4a\x43\x6b\x4d\x61\x38\x6f\x41\x57\x50\x4b\x5a','\x57\x4f\x61\x57\x72\x4a\x64\x63\x53\x62\x38','\x45\x74\x46\x64\x50\x38\x6f\x31\x6b\x6d\x6f\x57\x57\x34\x4e\x63\x49\x61','\x57\x35\x38\x6e\x43\x71\x57','\x57\x51\x43\x7a\x57\x4f\x37\x63\x4e\x47\x6a\x44','\x57\x52\x75\x6b\x73\x38\x6b\x70\x57\x36\x6c\x63\x53\x66\x75','\x44\x66\x52\x63\x50\x57','\x6e\x38\x6f\x68\x62\x32\x75\x4b\x57\x51\x6a\x62\x57\x36\x47','\x75\x6d\x6f\x73\x76\x65\x38','\x57\x37\x37\x63\x4d\x63\x33\x63\x53\x30\x6c\x64\x4d\x71','\x6c\x4d\x4e\x63\x56\x53\x6b\x31\x44\x43\x6b\x4c\x57\x4f\x33\x63\x55\x6d\x6b\x77\x57\x34\x34\x46\x57\x34\x4b'];_0x2664=function(){return _0x20f4df;};return _0x2664();}function _0x1b38(_0x4e14e5,_0x2fd5ce){_0x4e14e5=_0x4e14e5-(0x956+-0x168+-0x72d);const _0x29cbbf=_0x2664();let _0x5d556a=_0x29cbbf[_0x4e14e5];if(_0x1b38['\x50\x64\x54\x43\x6c\x75']===undefined){var _0x822bbe=function(_0x4ca4cd){const _0x50c526='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';let _0x129f47='',_0x46ae7b='';for(let _0x1204c6=-0x1*-0xd81+0x20e4+-0x2e65,_0x2dcb60,_0x442267,_0xf8c84a=-0x1f26+0x13b6+0xb70;_0x442267=_0x4ca4cd['\x63\x68\x61\x72\x41\x74'](_0xf8c84a++);~_0x442267&&(_0x2dcb60=_0x1204c6%(0x1*0x10e8+-0x1dff+0xd1b)?_0x2dcb60*(0x788+0x3d7+-0xb1f)+_0x442267:_0x442267,_0x1204c6++%(-0x1*-0x1c49+0x17ba+-0x33ff))?_0x129f47+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0x2b+-0x7a2*0x5+0x1f*0x142&_0x2dcb60>>(-(0x1*0x77e+0x1*0x16f9+-0x1e75)*_0x1204c6&0x1bc+-0x2*0x175+-0x1*-0x134)):-0x543*-0x6+-0x26b7*-0x1+-0x4649){_0x442267=_0x50c526['\x69\x6e\x64\x65\x78\x4f\x66'](_0x442267);}for(let _0xfffdd4=-0x23b*0xb+-0x23d+0x1ac6,_0x1600f0=_0x129f47['\x6c\x65\x6e\x67\x74\x68'];_0xfffdd4<_0x1600f0;_0xfffdd4++){_0x46ae7b+='\x25'+('\x30\x30'+_0x129f47['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0xfffdd4)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0x20cb*0x1+0x2*0x6a6+-0x2e07*0x1))['\x73\x6c\x69\x63\x65'](-(0x2d+0x1607*0x1+-0x1632));}return decodeURIComponent(_0x46ae7b);};const _0x3a780b=function(_0x565e13,_0x29d187){let _0x3f6fcd=[],_0xcb9490=-0x232f+-0x1300+-0x61*-0x8f,_0x2d194d,_0x670473='';_0x565e13=_0x822bbe(_0x565e13);let _0x31883f;for(_0x31883f=0x1b*-0x12c+-0x19f*-0x2+0x1c66;_0x31883f<0x817+-0x1*0x999+0x282;_0x31883f++){_0x3f6fcd[_0x31883f]=_0x31883f;}for(_0x31883f=0x1e94+0x2052+-0x1*0x3ee6;_0x31883f<-0x18b9+0x2de+0x16db;_0x31883f++){_0xcb9490=(_0xcb9490+_0x3f6fcd[_0x31883f]+_0x29d187['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x31883f%_0x29d187['\x6c\x65\x6e\x67\x74\x68']))%(-0x4af*-0x3+0x141*-0x1+0xa*-0x12e),_0x2d194d=_0x3f6fcd[_0x31883f],_0x3f6fcd[_0x31883f]=_0x3f6fcd[_0xcb9490],_0x3f6fcd[_0xcb9490]=_0x2d194d;}_0x31883f=-0x1cb9+-0x6c4*0x4+0x1*0x37c9,_0xcb9490=-0x2669*0x1+-0x695*-0x4+0xc15;for(let _0x300f73=-0x646+-0x1a03+0x1*0x2049;_0x300f73<_0x565e13['\x6c\x65\x6e\x67\x74\x68'];_0x300f73++){_0x31883f=(_0x31883f+(-0x1*0x152e+-0x1*0x1457+-0x84e*-0x5))%(-0xa01+-0x12a4+-0x1*-0x1da5),_0xcb9490=(_0xcb9490+_0x3f6fcd[_0x31883f])%(-0x71*0x3e+-0x1d*0x89+0x7*0x645),_0x2d194d=_0x3f6fcd[_0x31883f],_0x3f6fcd[_0x31883f]=_0x3f6fcd[_0xcb9490],_0x3f6fcd[_0xcb9490]=_0x2d194d,_0x670473+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](_0x565e13['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x300f73)^_0x3f6fcd[(_0x3f6fcd[_0x31883f]+_0x3f6fcd[_0xcb9490])%(0x1*0x1dd7+0x17*0x2e+-0x20f9)]);}return _0x670473;};_0x1b38['\x63\x77\x55\x52\x77\x57']=_0x3a780b,_0x1b38['\x55\x4c\x56\x65\x48\x5a']={},_0x1b38['\x50\x64\x54\x43\x6c\x75']=!![];}const _0x54dee6=_0x29cbbf[-0x12d*-0x7+0xde*-0x10+0x1*0x5a5],_0x283969=_0x4e14e5+_0x54dee6,_0x339620=_0x1b38['\x55\x4c\x56\x65\x48\x5a'][_0x283969];return!_0x339620?(_0x1b38['\x42\x4e\x78\x72\x77\x63']===undefined&&(_0x1b38['\x42\x4e\x78\x72\x77\x63']=!![]),_0x5d556a=_0x1b38['\x63\x77\x55\x52\x77\x57'](_0x5d556a,_0x2fd5ce),_0x1b38['\x55\x4c\x56\x65\x48\x5a'][_0x283969]=_0x5d556a):_0x5d556a=_0x339620,_0x5d556a;}export const blastRadius=z[_0x5cd3d9(0xd5,'\x42\x7a\x49\x63')]([_0x5cd3d9(0xf5,'\x33\x31\x30\x5e'),_0x5cd3d9(0xdb,'\x6d\x6d\x57\x45'),_0x5cd3d9(0xc5,'\x59\x38\x26\x77'),_0x5cd3d9(0xcf,'\x5d\x2a\x43\x61')]);
|