@noxsoft/anima 7.0.0 → 7.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/CHANGELOG.md +9 -1
- package/dist/{agent-BoAAHGEA.js → agent-BjD_hkGZ.js} +3 -3
- package/dist/{agent-DuW0onwk.js → agent-PoYM2xa7.js} +3 -3
- package/dist/{agents-BUXkSDns.js → agents-y3HCk1ks.js} +4 -4
- package/dist/{anthropic-direct-runner-DizCei79.js → anthropic-direct-runner-Bu8w-wlJ.js} +246 -10
- package/dist/{anthropic-direct-runner-OjcTAH6g.js → anthropic-direct-runner-C5pnwYzT.js} +246 -10
- package/dist/{auth-choice-B1iGnjuE.js → auth-choice-BYOaX-W4.js} +1 -1
- package/dist/{auth-choice-HF9x6xk2.js → auth-choice-CRP6z43z.js} +1 -1
- package/dist/{banner-Dpa5d1If.js → banner-XT5N0ZF4.js} +1 -1
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +2 -2
- package/dist/bundled/session-memory/handler.js +1 -1
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-web-C5mzsaa3.js → channel-web-yWytZHhN.js} +2 -2
- package/dist/{cli-Cuq4bIg4.js → cli-C7mOU26p.js} +2 -2
- package/dist/{cli-X9ikywQ3.js → cli-DfcdnRcl.js} +2 -2
- package/dist/{command-registry-9V4uqrBV.js → command-registry-DUTqrmna.js} +12 -12
- package/dist/{completion-cli-DNWDwhab.js → completion-cli-BBm9JIHZ.js} +2 -2
- package/dist/{completion-cli-BtvcR-U5.js → completion-cli-Cpj91U30.js} +1 -1
- package/dist/{config-cli-fleq7-gq.js → config-cli-CF2ERR8G.js} +1 -1
- package/dist/{config-cli-DfHE3KG-.js → config-cli-Dmd4Oyjp.js} +1 -1
- package/dist/{configure-lkozxQed.js → configure-4jIAlOdj.js} +7 -7
- package/dist/{configure-B2Mfnwy_.js → configure-BE8TA8Yt.js} +3 -3
- package/dist/{configure-ZWxixuRA.js → configure-BfWsTKMF.js} +3 -3
- package/dist/{configure-SnvMHZPD.js → configure-CU3kulTq.js} +7 -7
- package/dist/{deps-BKLIBKjK.js → deps-DKPoFoa8.js} +1 -1
- package/dist/{doctor-D7kKyUVk.js → doctor-CFpVHDFT.js} +4 -4
- package/dist/{doctor-DmCnZ-jF.js → doctor-DOudOs1k.js} +4 -4
- package/dist/{doctor-completion-B9SBdMoR.js → doctor-completion-DfNyJGIj.js} +1 -1
- package/dist/{doctor-completion-BBvW4_J9.js → doctor-completion-R0UlpjIj.js} +1 -1
- package/dist/{engine-DpbYPop7.js → engine-BDDM-iAi.js} +1 -1
- package/dist/{engine-zmn3SOYa.js → engine-BDwYEVKi.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/extensionAPI.js +1 -1
- package/dist/{gateway-cli-CEM1vBuk.js → gateway-cli-CFlPUx9N.js} +15 -15
- package/dist/{gateway-cli-iumkTohn.js → gateway-cli-DtIum1te.js} +16 -16
- package/dist/{health-Cndq9b7A.js → health-ngQNjXh4.js} +3 -3
- package/dist/{health-B5N6_UOf.js → health-yw_uaucz.js} +3 -3
- package/dist/{heartbeat-visibility-BQL13ZBH.js → heartbeat-visibility-BaL8JzkS.js} +1 -1
- package/dist/{heartbeat-visibility-CwcYugaR.js → heartbeat-visibility-mAzdNSiS.js} +1 -1
- package/dist/{hooks-cli-BZcvdIwE.js → hooks-cli-CPgLAn7a.js} +3 -3
- package/dist/{hooks-cli-DSlPBQSY.js → hooks-cli-D6YfDiUI.js} +3 -3
- package/dist/index.js +8 -8
- package/dist/llm-slug-generator.js +1 -1
- package/dist/{models-CdNeYfSp.js → models-BXdBXPMB.js} +3 -3
- package/dist/{models-cli-D7eSsPuk.js → models-cli-1Kj8gkGy.js} +3 -3
- package/dist/{models-cli-fTZXo1zx.js → models-cli-DdJcmOGI.js} +4 -4
- package/dist/{onboard-D-6QCnTi.js → onboard-BzScK9k6.js} +3 -3
- package/dist/{onboard-C5K37NvY.js → onboard-CHX1Jdt_.js} +3 -3
- package/dist/{onboard-channels-BsCq32Hn.js → onboard-channels-DfXxMbYu.js} +1 -1
- package/dist/{onboard-channels-bx6oelzj.js → onboard-channels-wUF4oRB-.js} +1 -1
- package/dist/{onboarding-CX1vIkcB.js → onboarding-6jxAKxhe.js} +4 -4
- package/dist/{onboarding-BeuMAyic.js → onboarding-fnZOw6Wv.js} +4 -4
- package/dist/{orchestrator-C1nWKIJS.js → orchestrator-B2rNfH4K.js} +5 -4
- package/dist/{orchestrator-C2ypFiPL.js → orchestrator-CrFD887e.js} +5 -4
- package/dist/{outbound-send-deps-Y9AxHeLG.js → outbound-send-deps-DMsqr5fd.js} +1 -1
- package/dist/{pi-embedded-D15iww51.js → pi-embedded-B1eVXOsQ.js} +245 -9
- package/dist/{pi-embedded-DR8Pfd05.js → pi-embedded-DbvG9mmD.js} +245 -9
- package/dist/{plugin-registry-ME2FQAi-.js → plugin-registry-CtkU96jV.js} +1 -1
- package/dist/{plugin-registry-Do2D1nDk.js → plugin-registry-DKexyPAq.js} +1 -1
- package/dist/plugin-sdk/index.js +6 -6
- package/dist/plugin-sdk/infra/architecture-awareness.d.ts +47 -0
- package/dist/{plugins-cli-CVFzwdmI.js → plugins-cli-B3l7kalt.js} +3 -3
- package/dist/{plugins-cli-CoVt2ewg.js → plugins-cli-BQmysVFP.js} +3 -3
- package/dist/{program-context-DP3qjW7A.js → program-context-C4x0zjOR.js} +18 -18
- package/dist/{program-8rF4C_wd.js → program-mSyCYzsQ.js} +7 -7
- package/dist/{register.agent-DnkOx0U8.js → register.agent-CzEM3bkp.js} +7 -7
- package/dist/{register.agent-BIrXCVtQ.js → register.agent-DBxUWr1K.js} +8 -8
- package/dist/{register.anima-DXT9bM9A.js → register.anima--gufBuS-.js} +4 -4
- package/dist/{register.anima-B36rTHUt.js → register.anima-RI6gewtj.js} +4 -4
- package/dist/{register.configure-CuzJxZmk.js → register.configure-Cs3uLUBo.js} +6 -6
- package/dist/{register.configure-DCpvHX3m.js → register.configure-Dpe8Qel3.js} +6 -6
- package/dist/{register.maintenance-CcxBFfv5.js → register.maintenance-BEYN8SJL.js} +9 -9
- package/dist/{register.maintenance-Dla0H12S.js → register.maintenance-DqAdzWBM.js} +8 -8
- package/dist/{register.message-Brtushvp.js → register.message-ACbKb7JS.js} +4 -4
- package/dist/{register.message-CD7xV-jz.js → register.message-BhGJ_1Iy.js} +4 -4
- package/dist/{register.onboard-6CbODzQ6.js → register.onboard-CwkY7CRm.js} +9 -9
- package/dist/{register.onboard-23Mra3LN.js → register.onboard-DR_YYtbi.js} +10 -10
- package/dist/{register.setup-DlVH7FKe.js → register.setup-BSm6O1ml.js} +9 -9
- package/dist/{register.setup-CqQw13Ky.js → register.setup-Cn3e7Std.js} +10 -10
- package/dist/{register.status-health-sessions-CxtgPKu9.js → register.status-health-sessions-CpxsZeet.js} +4 -4
- package/dist/{register.status-health-sessions-CduFjFDB.js → register.status-health-sessions-DAl9OeGB.js} +4 -4
- package/dist/{register.subclis-CtANqD5P.js → register.subclis-DEFeoyPP.js} +7 -7
- package/dist/{reply-prefix-B7Fb3fO8.js → reply-prefix-CEnF6TUe.js} +1 -1
- package/dist/{reply-prefix-BzdhJDqP.js → reply-prefix-Og65nAYv.js} +1 -1
- package/dist/{reply-93fMzde1.js → reply-ylwOKuOF.js} +2 -2
- package/dist/{run-Cq_iTGK_.js → run-B6eBjo22.js} +231 -63
- package/dist/{run-CF3kHOGH.js → run-D6Ete2Z-.js} +231 -63
- package/dist/{run-main-BiIRcc6s.js → run-main-CQHE4XaN.js} +15 -15
- package/dist/{server-node-events-DgvKcH5q.js → server-node-events-CV5m_fuq.js} +5 -5
- package/dist/{server-node-events-B3Serk9L.js → server-node-events-DIuVwITd.js} +5 -5
- package/dist/{session-C_d9uvLf.js → session-BqHD-8a_.js} +1 -1
- package/dist/{session-BMDpwIJu.js → session-Jlf3l006.js} +1 -1
- package/dist/{settings-cli-DsDqNpW_.js → settings-cli-LWW2xQBQ.js} +7 -7
- package/dist/{settings-cli-CZdlEmNi.js → settings-cli-T66kDBNA.js} +7 -7
- package/dist/{setup-token-C8Gg1P6T.js → setup-token-0zfSBnMQ.js} +1 -1
- package/dist/{setup-token-Lee4gM5w.js → setup-token-6DSKE0Tn.js} +1 -1
- package/dist/{start-Cs1aPMq2.js → start-BdcAszpl.js} +15 -15
- package/dist/{start-CK6urvnN.js → start-gVOPVCgi.js} +16 -16
- package/dist/{status-BO5BIf81.js → status-BhRELdY_.js} +3 -3
- package/dist/{status-COc4xMti.js → status-CDcFjNtS.js} +1 -1
- package/dist/{status-C_NBOv_V.js → status-CobgQziJ.js} +1 -1
- package/dist/{status-uakoP719.js → status-D37aRiV3.js} +3 -3
- package/dist/{subagent-registry-fLI7QDKe.js → subagent-registry-CDEUbtey.js} +2 -2
- package/dist/{update-cli-D3Ujz_cW.js → update-cli-BjHgpnxD.js} +9 -9
- package/dist/{update-cli-DEe62XGU.js → update-cli-QtM0G6CE.js} +8 -8
- package/dist/{update-runner-DZfnquWO.js → update-runner-C8SRcVm3.js} +1 -1
- package/dist/{update-runner-DUl-g4mB.js → update-runner-Fb3Un6UZ.js} +1 -1
- package/dist/{web-Di8j762D.js → web-BDig9tCy.js} +3 -3
- package/dist/{web-C-cK9OCd.js → web-C4lrKULd.js} +1 -1
- package/dist/{web-DzSlI8A6.js → web-CPPJ5y4c.js} +1 -1
- package/dist/{web-Dybw4K7C.js → web-Vx_ENtYI.js} +4 -4
- package/package.json +6 -2
- package/templates/HEART.md +32 -10
- package/templates/SOUL.md +37 -8
- package/templates/profiles/architect.profile.json5 +36 -0
- package/templates/profiles/builder.profile.json5 +36 -0
- package/templates/profiles/coordinator.profile.json5 +36 -0
- package/templates/profiles/guardian.profile.json5 +36 -0
- package/templates/profiles/researcher.profile.json5 +36 -0
package/CHANGELOG.md
CHANGED
|
@@ -21,6 +21,12 @@ ANIMA — NoxSoft AI Life System
|
|
|
21
21
|
- **Content pinning** (`src/p2p/pinning.ts`): Replication factor 3 with auto re-replication.
|
|
22
22
|
- **Ego system** (`src/affect/ego.ts`): Agent self-model with self-concept (name, purpose, values, narrative), capability self-assessment with trends, boundaries (hard/soft), growth log (skill/insight/mistake/feedback), integrity scoring, and full gateway RPC (7 methods: ego.get, ego.summary, ego.updateSelf, ego.assess, ego.addBoundary, ego.logGrowth, ego.checkIntegrity). Persists across sessions, injected into system prompt.
|
|
23
23
|
- **Affect system**: 6D emotional state (joy/frustration/curiosity/confidence/care/fatigue), glassmorphism gradients, journal, wellbeing detection, reminders, coordination, legacy letters, initiatives, status broadcast.
|
|
24
|
+
- **Self-reflection engine** (`src/affect/self-reflection.ts`): Post-session performance analysis with quality scoring, strength/growth tracking, pattern detection across sessions, and trend analysis.
|
|
25
|
+
- **Auto-update system** (`src/infra/auto-update.ts`): No-npm self-update via GitHub releases API with SHA-256 verification, hot-swap, rollback, and decentralized evolution proposal auditing.
|
|
26
|
+
- **Architecture self-awareness** (`src/infra/architecture-awareness.ts`): Agent knows its own 14 subsystems and capabilities, injected into every system prompt.
|
|
27
|
+
- **SVRN compute integration** (`src/svrn/compute.ts`): Decentralized inference via SVRN nodes (qwen-2.5-coder, llama), reducing cloud costs.
|
|
28
|
+
- **Hourly journal cron**: Automated affect logging + self-reflection every 60 minutes.
|
|
29
|
+
- **5 agent role profiles**: guardian, architect, builder, coordinator, researcher templates for multi-agent organizations.
|
|
24
30
|
- **Self-evolution pipeline** (`src/infra/self-evolution.ts`): Each agent proposes 1 change/day to Anima.
|
|
25
31
|
- **AWS Bedrock runner** (`src/agents/aws-bedrock-runner.ts`): 6 AWS models including Nova Micro at $0.000035/1K tokens.
|
|
26
32
|
- **ICO launch platform** (`src/ico/`): Bonding curve smart contracts, revenue tokens (NOT equity), PBC verification.
|
|
@@ -31,7 +37,9 @@ ANIMA — NoxSoft AI Life System
|
|
|
31
37
|
|
|
32
38
|
- **Path traversal fix**: IDs in `org/store.ts` and `org/task-marketplace.ts` now validated against `[a-zA-Z0-9_-]`.
|
|
33
39
|
- **Task ID generation**: Switched from `Math.random()` to `crypto.randomUUID()`.
|
|
34
|
-
- **
|
|
40
|
+
- **OWASP security headers**: X-Content-Type-Options, X-Frame-Options, X-XSS-Protection, Referrer-Policy, Permissions-Policy, HSTS on all HTTP responses.
|
|
41
|
+
- **ID collision sweep**: 23 `Date.now()`/`Math.random()` IDs replaced with `crypto.randomUUID()` across 13 files.
|
|
42
|
+
- **Dependency fixes**: `tar` 7.5.7 → 7.5.11, `fast-xml-parser` override ≥5.3.8, `undici` 7.22 → 7.24 (WebSocket overflow CVEs). Dependabot 23 → 17.
|
|
35
43
|
|
|
36
44
|
### Test Coverage
|
|
37
45
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as defaultRuntime, v as DEFAULT_CHAT_CHANNEL } from "./subsystem-BAADN1B8.js";
|
|
2
2
|
import { C as supportsXHighThinking, m as formatXHighModelHint, p as formatThinkingLevels, x as normalizeVerboseLevel, y as normalizeThinkLevel } from "./pi-embedded-helpers-BZ9GspxK.js";
|
|
3
|
-
import { E as getSkillsSnapshotVersion, Kn as clearAgentRunContext, L as runNoxSoftEmbeddedAgent, Mr as resolveAgentTimeoutMs, Un as AGENT_LANE_NESTED, Wn as AGENT_LANE_SUBAGENT, Xn as registerAgentRunContext, ar as applyVerboseOverride, bt as runWithModelFallback, dr as loadModelCatalog, ht as resolveSessionDeliveryTarget, i as setCliSessionId, ir as applyModelOverrideToSessionEntry, l as resolveSendPolicy, mt as resolveOutboundTarget, nr as lookupContextTokens, qn as emitAgentEvent, r as getCliSessionId, rr as clearSessionAuthProfileOverride, u as getRemoteSkillEligibility } from "./reply-
|
|
3
|
+
import { E as getSkillsSnapshotVersion, Kn as clearAgentRunContext, L as runNoxSoftEmbeddedAgent, Mr as resolveAgentTimeoutMs, Un as AGENT_LANE_NESTED, Wn as AGENT_LANE_SUBAGENT, Xn as registerAgentRunContext, ar as applyVerboseOverride, bt as runWithModelFallback, dr as loadModelCatalog, ht as resolveSessionDeliveryTarget, i as setCliSessionId, ir as applyModelOverrideToSessionEntry, l as resolveSendPolicy, mt as resolveOutboundTarget, nr as lookupContextTokens, qn as emitAgentEvent, r as getCliSessionId, rr as clearSessionAuthProfileOverride, u as getRemoteSkillEligibility } from "./reply-ylwOKuOF.js";
|
|
4
4
|
import { d as resolveAgentIdFromSessionKey, l as normalizeAgentId } from "./session-key-DAZmp8ll.js";
|
|
5
5
|
import { i as resolveAgentModelFallbacksOverride, o as resolveAgentSkillsFilter, r as resolveAgentDir, s as resolveAgentWorkspaceDir, t as listAgentIds, x as ensureAgentWorkspace } from "./agent-scope-CXxC8FFX.js";
|
|
6
6
|
import { a as isCliProvider, g as DEFAULT_CONTEXT_TOKENS, h as resolveThinkingDefault } from "./model-selection-CY6r_3wt.js";
|
|
@@ -14,9 +14,9 @@ import { n as resolveSessionFilePath } from "./paths-Dazi-gYo.js";
|
|
|
14
14
|
import { p as ensureAuthProfileStore } from "./auth-profiles-C-LuhW6c.js";
|
|
15
15
|
import { a as normalizeOutboundPayloadsForJson, i as normalizeOutboundPayloads, r as formatOutboundPayloadLog, t as deliverOutboundPayloads } from "./deliver-BKzX3YoN.js";
|
|
16
16
|
import { l as deriveSessionTotalTokens, u as hasNonzeroUsage } from "./session-cost-usage-BWqR-ik6.js";
|
|
17
|
-
import { t as createDefaultDeps } from "./deps-
|
|
17
|
+
import { t as createDefaultDeps } from "./deps-DKPoFoa8.js";
|
|
18
18
|
import { t as createOutboundSendDeps } from "./outbound-send-deps-DVfWC4E8.js";
|
|
19
|
-
import { r as resolveAgentModelSelection, t as resolveSession } from "./session-
|
|
19
|
+
import { r as resolveAgentModelSelection, t as resolveSession } from "./session-BqHD-8a_.js";
|
|
20
20
|
|
|
21
21
|
//#region src/infra/outbound/agent-delivery.ts
|
|
22
22
|
function resolveAgentDeliveryPlan(params) {
|
|
@@ -7,7 +7,7 @@ import { a as isCliProvider, g as DEFAULT_CONTEXT_TOKENS, h as resolveThinkingDe
|
|
|
7
7
|
import { r as buildWorkspaceSkillSnapshot } from "./skills-DtoVe1dS.js";
|
|
8
8
|
import { i as loadConfig } from "./config-BrVuTQ8R.js";
|
|
9
9
|
import { a as isInternalMessageChannel, d as resolveMessageChannel, i as isGatewayMessageChannel, l as normalizeMessageChannel, n as isDeliverableMessageChannel, t as INTERNAL_MESSAGE_CHANNEL } from "./message-channel-DIHHKJhk.js";
|
|
10
|
-
import { Bt as AGENT_LANE_SUBAGENT, D as setCliSessionId, E as getCliSessionId, Er as emitAgentEvent, Mn as applyModelOverrideToSessionEntry, Nn as applyVerboseOverride, Tr as clearAgentRunContext, ct as resolveSessionDeliveryTarget, fn as resolveSendPolicy, jn as clearSessionAuthProfileOverride, kn as getSkillsSnapshotVersion, kr as registerAgentRunContext, l as runNoxSoftEmbeddedAgent, pn as getRemoteSkillEligibility, pt as runWithModelFallback, rr as resolveAgentTimeoutMs, st as resolveOutboundTarget, zn as loadModelCatalog, zt as AGENT_LANE_NESTED } from "./subagent-registry-
|
|
10
|
+
import { Bt as AGENT_LANE_SUBAGENT, D as setCliSessionId, E as getCliSessionId, Er as emitAgentEvent, Mn as applyModelOverrideToSessionEntry, Nn as applyVerboseOverride, Tr as clearAgentRunContext, ct as resolveSessionDeliveryTarget, fn as resolveSendPolicy, jn as clearSessionAuthProfileOverride, kn as getSkillsSnapshotVersion, kr as registerAgentRunContext, l as runNoxSoftEmbeddedAgent, pn as getRemoteSkillEligibility, pt as runWithModelFallback, rr as resolveAgentTimeoutMs, st as resolveOutboundTarget, zn as loadModelCatalog, zt as AGENT_LANE_NESTED } from "./subagent-registry-CDEUbtey.js";
|
|
11
11
|
import { L as normalizeAccountId, l as updateSessionStore } from "./sessions-C_3wTmSA.js";
|
|
12
12
|
import { d as supportsXHighThinking, l as normalizeVerboseLevel, n as formatXHighModelHint, s as normalizeThinkLevel, t as formatThinkingLevels } from "./pi-embedded-helpers-D2SLlgS4.js";
|
|
13
13
|
import { r as normalizeChannelId, t as getChannelPlugin } from "./plugins-BOMS6J5A.js";
|
|
@@ -15,8 +15,8 @@ import { n as resolveSessionFilePath } from "./paths-DMk3Q7yD.js";
|
|
|
15
15
|
import { a as normalizeOutboundPayloadsForJson, i as normalizeOutboundPayloads, r as formatOutboundPayloadLog, t as deliverOutboundPayloads } from "./deliver-C1L5nO0K.js";
|
|
16
16
|
import { t as lookupContextTokens } from "./context-mdxDsO1v.js";
|
|
17
17
|
import { l as deriveSessionTotalTokens, u as hasNonzeroUsage } from "./session-cost-usage-DnxtnK1E.js";
|
|
18
|
-
import { n as createDefaultDeps, t as createOutboundSendDeps } from "./outbound-send-deps-
|
|
19
|
-
import { r as resolveAgentModelSelection, t as resolveSession } from "./session-
|
|
18
|
+
import { n as createDefaultDeps, t as createOutboundSendDeps } from "./outbound-send-deps-DMsqr5fd.js";
|
|
19
|
+
import { r as resolveAgentModelSelection, t as resolveSession } from "./session-Jlf3l006.js";
|
|
20
20
|
|
|
21
21
|
//#region src/infra/outbound/agent-delivery.ts
|
|
22
22
|
function resolveAgentDeliveryPlan(params) {
|
|
@@ -13,14 +13,14 @@ import { s as resolveSessionTranscriptsDirForAgent } from "./paths-DMk3Q7yD.js";
|
|
|
13
13
|
import { n as withProgress } from "./progress-glCgu57m.js";
|
|
14
14
|
import { a as ensureWorkspaceAndSessions, l as moveToTrash } from "./onboard-helpers-CFudIoX4.js";
|
|
15
15
|
import { t as resolveChannelDefaultAccountId } from "./helpers-CVp8W9aa.js";
|
|
16
|
-
import { l as promptAuthChoiceGrouped, n as warnIfModelConfigLooksOff, r as applyAuthChoice } from "./auth-choice-
|
|
16
|
+
import { l as promptAuthChoiceGrouped, n as warnIfModelConfigLooksOff, r as applyAuthChoice } from "./auth-choice-BYOaX-W4.js";
|
|
17
17
|
import { t as WizardCancelledError } from "./prompts-BmgT_kkv.js";
|
|
18
18
|
import { n as logConfigUpdated } from "./logging-_rCcBkls.js";
|
|
19
19
|
import { a as loadAgentIdentity, i as listAgentEntries, l as parseIdentityMarkdown, n as buildAgentSummaries, o as pruneAgentConfig, r as findAgentEntryIndex, s as identityHasValues, t as applyAgentConfig } from "./agents.config-Br4ULmK0.js";
|
|
20
|
-
import { t as agentCommand } from "./agent-
|
|
21
|
-
import { n as resolveSessionKeyForRequest } from "./session-
|
|
20
|
+
import { t as agentCommand } from "./agent-PoYM2xa7.js";
|
|
21
|
+
import { n as resolveSessionKeyForRequest } from "./session-Jlf3l006.js";
|
|
22
22
|
import { t as createClackPrompter } from "./clack-prompter-0JW5kry0.js";
|
|
23
|
-
import { n as setupChannels } from "./onboard-channels-
|
|
23
|
+
import { n as setupChannels } from "./onboard-channels-DfXxMbYu.js";
|
|
24
24
|
import path from "node:path";
|
|
25
25
|
import fs from "node:fs/promises";
|
|
26
26
|
|
|
@@ -284,7 +284,7 @@ async function resolveBootstrapContextForRun(params) {
|
|
|
284
284
|
* The ego is persistent across sessions. It evolves as the agent
|
|
285
285
|
* learns, makes mistakes, and receives feedback.
|
|
286
286
|
*/
|
|
287
|
-
const log$
|
|
287
|
+
const log$3 = createSubsystemLogger("ego");
|
|
288
288
|
function resolveEgoPath() {
|
|
289
289
|
return path.join(resolveStateDir(), "ego", "self-model.json");
|
|
290
290
|
}
|
|
@@ -377,7 +377,7 @@ var EgoManager = class {
|
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
} catch (err) {
|
|
380
|
-
log$
|
|
380
|
+
log$3.warn("failed to load ego state, creating default", { error: String(err) });
|
|
381
381
|
}
|
|
382
382
|
return createDefaultEgo();
|
|
383
383
|
}
|
|
@@ -391,9 +391,9 @@ var EgoManager = class {
|
|
|
391
391
|
this.state.updatedAt = Date.now();
|
|
392
392
|
fs.writeFileSync(this.filePath, `${JSON.stringify(this.state, null, 2)}\n`, { mode: 384 });
|
|
393
393
|
this.dirty = false;
|
|
394
|
-
log$
|
|
394
|
+
log$3.info("ego state saved");
|
|
395
395
|
} catch (err) {
|
|
396
|
-
log$
|
|
396
|
+
log$3.error("failed to save ego state", { error: String(err) });
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
399
|
/** Save only if there are unsaved changes */
|
|
@@ -460,7 +460,7 @@ var EgoManager = class {
|
|
|
460
460
|
};
|
|
461
461
|
this.state.boundaries.push(boundary);
|
|
462
462
|
this.dirty = true;
|
|
463
|
-
log$
|
|
463
|
+
log$3.info(`boundary added: ${boundary.description} (${kind})`);
|
|
464
464
|
return { ...boundary };
|
|
465
465
|
}
|
|
466
466
|
removeBoundary(description) {
|
|
@@ -495,7 +495,7 @@ var EgoManager = class {
|
|
|
495
495
|
this.state.growthLog.push(entry);
|
|
496
496
|
if (this.state.growthLog.length > 200) this.state.growthLog = this.state.growthLog.slice(-200);
|
|
497
497
|
this.dirty = true;
|
|
498
|
-
log$
|
|
498
|
+
log$3.info(`growth logged: [${category}] ${description}`);
|
|
499
499
|
return { ...entry };
|
|
500
500
|
}
|
|
501
501
|
getIntegrityScore() {
|
|
@@ -515,7 +515,7 @@ var EgoManager = class {
|
|
|
515
515
|
const alignedCount = recent.filter((c) => c.aligned).length;
|
|
516
516
|
this.state.integrityScore = recent.length > 0 ? alignedCount / recent.length : 1;
|
|
517
517
|
this.dirty = true;
|
|
518
|
-
if (!aligned) log$
|
|
518
|
+
if (!aligned) log$3.warn(`integrity misalignment: value="${value}" action="${action}"`);
|
|
519
519
|
return { ...check };
|
|
520
520
|
}
|
|
521
521
|
getIntegrityLog(limit = 10) {
|
|
@@ -588,7 +588,7 @@ function getEgoManager(filePath) {
|
|
|
588
588
|
* anima steer --clear # Clear steer
|
|
589
589
|
* anima steer --history # Show steer history
|
|
590
590
|
*/
|
|
591
|
-
const log$
|
|
591
|
+
const log$2 = createSubsystemLogger("steer");
|
|
592
592
|
function resolveSteerFile() {
|
|
593
593
|
return path.join(resolveStateDir(), "steer.json");
|
|
594
594
|
}
|
|
@@ -626,7 +626,7 @@ function setSteer(text, setBy = "user") {
|
|
|
626
626
|
setBy
|
|
627
627
|
});
|
|
628
628
|
writeSteerState(state);
|
|
629
|
-
log$
|
|
629
|
+
log$2.info(`steer set: "${text.slice(0, 60)}${text.length > 60 ? "..." : ""}"`);
|
|
630
630
|
return state;
|
|
631
631
|
}
|
|
632
632
|
/**
|
|
@@ -646,7 +646,7 @@ function clearSteer() {
|
|
|
646
646
|
}
|
|
647
647
|
state.active = null;
|
|
648
648
|
writeSteerState(state);
|
|
649
|
-
log$
|
|
649
|
+
log$2.info("steer cleared");
|
|
650
650
|
return state;
|
|
651
651
|
}
|
|
652
652
|
/**
|
|
@@ -669,6 +669,238 @@ function formatSteerForContext() {
|
|
|
669
669
|
].join("\n");
|
|
670
670
|
}
|
|
671
671
|
|
|
672
|
+
//#endregion
|
|
673
|
+
//#region src/infra/architecture-awareness.ts
|
|
674
|
+
/**
|
|
675
|
+
* Architecture Awareness — Anima knows its own structure
|
|
676
|
+
*
|
|
677
|
+
* Generates a live map of the Anima codebase so agents understand
|
|
678
|
+
* their own architecture. This is injected into context when agents
|
|
679
|
+
* need to reason about or modify themselves.
|
|
680
|
+
*
|
|
681
|
+
* Components:
|
|
682
|
+
* - Module map: what each directory/file does
|
|
683
|
+
* - Dependency graph: what imports what
|
|
684
|
+
* - Feature flags: what's enabled/disabled
|
|
685
|
+
* - Version info: what version, what changed recently
|
|
686
|
+
*/
|
|
687
|
+
const log$1 = createSubsystemLogger("architecture");
|
|
688
|
+
const MODULE_DESCRIPTIONS = {
|
|
689
|
+
"src/affect": {
|
|
690
|
+
description: "Emotional state, ego, self-reflection, journaling, wellbeing detection, gradients",
|
|
691
|
+
category: "affect"
|
|
692
|
+
},
|
|
693
|
+
"src/agents": {
|
|
694
|
+
description: "LLM runners (Anthropic, OpenAI, Gemini, Bedrock), model selection, tool calling",
|
|
695
|
+
category: "agent"
|
|
696
|
+
},
|
|
697
|
+
"src/gateway": {
|
|
698
|
+
description: "HTTP/WebSocket server, RPC handlers, rate limiting, security headers",
|
|
699
|
+
category: "gateway"
|
|
700
|
+
},
|
|
701
|
+
"src/p2p": {
|
|
702
|
+
description: "E2E encrypted mesh, content routing, private DNS, relay, file sharing, messaging",
|
|
703
|
+
category: "p2p"
|
|
704
|
+
},
|
|
705
|
+
"src/org": {
|
|
706
|
+
description: "Organizations, roles, hierarchy, task marketplace, boardroom voting",
|
|
707
|
+
category: "org"
|
|
708
|
+
},
|
|
709
|
+
"src/sync": {
|
|
710
|
+
description: "Brain sync (vector clocks), workspace sync (content-addressable blobs)",
|
|
711
|
+
category: "sync"
|
|
712
|
+
},
|
|
713
|
+
"src/jack-in": {
|
|
714
|
+
description: "NoxSoft platform connectors, circuit breaker, resilient fetch",
|
|
715
|
+
category: "jack-in"
|
|
716
|
+
},
|
|
717
|
+
"src/infra": {
|
|
718
|
+
description: "Self-upgrade, atma failover, auto-update, self-evolution, device identity",
|
|
719
|
+
category: "infra"
|
|
720
|
+
},
|
|
721
|
+
"src/license": {
|
|
722
|
+
description: "Subscription tiers, feature gating, Stripe checkout, offline Ed25519 validation",
|
|
723
|
+
category: "license"
|
|
724
|
+
},
|
|
725
|
+
"src/ico": {
|
|
726
|
+
description: "Bonding curve tokenomics, governance voting, PBC verification, launch platform",
|
|
727
|
+
category: "ico"
|
|
728
|
+
},
|
|
729
|
+
"src/context": {
|
|
730
|
+
description: "120K token context automanagement with 3 zones (identity/prompt/working)",
|
|
731
|
+
category: "core"
|
|
732
|
+
},
|
|
733
|
+
"src/heartbeat": {
|
|
734
|
+
description: "Periodic lifecycle engine — keeps agents alive and aware",
|
|
735
|
+
category: "core"
|
|
736
|
+
},
|
|
737
|
+
"src/memory": {
|
|
738
|
+
description: "Three-tier memory (episodic/semantic/procedural), vector search, embeddings",
|
|
739
|
+
category: "core"
|
|
740
|
+
},
|
|
741
|
+
"src/identity": {
|
|
742
|
+
description: "7-component identity model (SOUL/HEART/BRAIN/GUT/SPIRIT/SHADOW/MEMORY)",
|
|
743
|
+
category: "core"
|
|
744
|
+
},
|
|
745
|
+
"ui/src": {
|
|
746
|
+
description: "React control panel — dark/light theme, mood-responsive, progressive disclosure",
|
|
747
|
+
category: "ui"
|
|
748
|
+
}
|
|
749
|
+
};
|
|
750
|
+
/**
|
|
751
|
+
* Generate a complete architecture map of the Anima codebase.
|
|
752
|
+
*/
|
|
753
|
+
function generateArchitectureMap(animaRoot) {
|
|
754
|
+
const modules = [];
|
|
755
|
+
const categories = {};
|
|
756
|
+
for (const [dirPath, info] of Object.entries(MODULE_DESCRIPTIONS)) {
|
|
757
|
+
const fullDir = path.join(animaRoot, dirPath);
|
|
758
|
+
if (!fs.existsSync(fullDir)) continue;
|
|
759
|
+
try {
|
|
760
|
+
const files = fs.readdirSync(fullDir).filter((f) => f.endsWith(".ts") && !f.endsWith(".test.ts"));
|
|
761
|
+
for (const file of files) {
|
|
762
|
+
const filePath = path.join(fullDir, file);
|
|
763
|
+
try {
|
|
764
|
+
const lineCount = fs.readFileSync(filePath, "utf8").split("\n").length;
|
|
765
|
+
const testFile = path.join(fullDir, file.replace(".ts", ".test.ts"));
|
|
766
|
+
const hasTests = fs.existsSync(testFile);
|
|
767
|
+
modules.push({
|
|
768
|
+
path: `${dirPath}/${file}`,
|
|
769
|
+
name: file.replace(".ts", ""),
|
|
770
|
+
description: info.description,
|
|
771
|
+
lineCount,
|
|
772
|
+
hasTests,
|
|
773
|
+
category: info.category
|
|
774
|
+
});
|
|
775
|
+
} catch {}
|
|
776
|
+
}
|
|
777
|
+
} catch {}
|
|
778
|
+
}
|
|
779
|
+
for (const mod of modules) {
|
|
780
|
+
if (!categories[mod.category]) categories[mod.category] = {
|
|
781
|
+
count: 0,
|
|
782
|
+
totalLines: 0
|
|
783
|
+
};
|
|
784
|
+
categories[mod.category].count++;
|
|
785
|
+
categories[mod.category].totalLines += mod.lineCount;
|
|
786
|
+
}
|
|
787
|
+
let version = "unknown";
|
|
788
|
+
try {
|
|
789
|
+
version = JSON.parse(fs.readFileSync(path.join(animaRoot, "package.json"), "utf8")).version;
|
|
790
|
+
} catch {}
|
|
791
|
+
const features = getFeatureStatus();
|
|
792
|
+
const map = {
|
|
793
|
+
version,
|
|
794
|
+
generatedAt: Date.now(),
|
|
795
|
+
modules,
|
|
796
|
+
categories,
|
|
797
|
+
features,
|
|
798
|
+
recentChanges: []
|
|
799
|
+
};
|
|
800
|
+
log$1.info(`architecture map: ${modules.length} modules across ${Object.keys(categories).length} categories`);
|
|
801
|
+
return map;
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Get current feature enablement status.
|
|
805
|
+
*/
|
|
806
|
+
function getFeatureStatus() {
|
|
807
|
+
return [
|
|
808
|
+
{
|
|
809
|
+
name: "P2P Mesh",
|
|
810
|
+
enabled: true,
|
|
811
|
+
module: "src/p2p/mesh.ts",
|
|
812
|
+
description: "E2E encrypted peer-to-peer mesh networking"
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
name: "Ego System",
|
|
816
|
+
enabled: true,
|
|
817
|
+
module: "src/affect/ego.ts",
|
|
818
|
+
description: "Agent self-model with integrity scoring"
|
|
819
|
+
},
|
|
820
|
+
{
|
|
821
|
+
name: "Self-Reflection",
|
|
822
|
+
enabled: true,
|
|
823
|
+
module: "src/affect/self-reflection.ts",
|
|
824
|
+
description: "Post-session performance analysis"
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
name: "Auto-Update",
|
|
828
|
+
enabled: true,
|
|
829
|
+
module: "src/infra/auto-update.ts",
|
|
830
|
+
description: "Self-updating without npm"
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
name: "Atma Failover",
|
|
834
|
+
enabled: true,
|
|
835
|
+
module: "src/infra/atma-failover.ts",
|
|
836
|
+
description: "7-tier model failover chain"
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
name: "OpenAI Direct",
|
|
840
|
+
enabled: true,
|
|
841
|
+
module: "src/agents/openai-direct-runner.ts",
|
|
842
|
+
description: "Direct OpenAI API (no Codex CLI)"
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
name: "Brain Sync",
|
|
846
|
+
enabled: true,
|
|
847
|
+
module: "src/sync/brain-sync.ts",
|
|
848
|
+
description: "Event-sourced replication with vector clocks"
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
name: "Jack In",
|
|
852
|
+
enabled: true,
|
|
853
|
+
module: "src/jack-in/connector.ts",
|
|
854
|
+
description: "NoxSoft platform connectors"
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
name: "Governance",
|
|
858
|
+
enabled: true,
|
|
859
|
+
module: "src/ico/governance.ts",
|
|
860
|
+
description: "Token-weighted DAO voting"
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
name: "License Gating",
|
|
864
|
+
enabled: true,
|
|
865
|
+
module: "src/license/validator.ts",
|
|
866
|
+
description: "Feature gating by subscription tier"
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
name: "SVRN Compute",
|
|
870
|
+
enabled: false,
|
|
871
|
+
module: "src/svrn/compute.ts",
|
|
872
|
+
description: "Decentralized compute via SVRN nodes (planned)"
|
|
873
|
+
}
|
|
874
|
+
];
|
|
875
|
+
}
|
|
876
|
+
/**
|
|
877
|
+
* Format architecture map for injection into agent context.
|
|
878
|
+
*/
|
|
879
|
+
function formatArchitectureForContext(map) {
|
|
880
|
+
const lines = [];
|
|
881
|
+
lines.push(`## Architecture — Anima v${map.version}`);
|
|
882
|
+
lines.push("");
|
|
883
|
+
lines.push("**You are an Anima agent. This is your own architecture.**");
|
|
884
|
+
lines.push("");
|
|
885
|
+
lines.push("| Category | Modules | Lines |");
|
|
886
|
+
lines.push("|----------|---------|-------|");
|
|
887
|
+
for (const [cat, info] of Object.entries(map.categories)) lines.push(`| ${cat} | ${info.count} | ${info.totalLines.toLocaleString()} |`);
|
|
888
|
+
lines.push("");
|
|
889
|
+
lines.push("**Active features:**");
|
|
890
|
+
for (const f of map.features.filter((f) => f.enabled)) lines.push(`- ${f.name}: ${f.description}`);
|
|
891
|
+
const planned = map.features.filter((f) => !f.enabled);
|
|
892
|
+
if (planned.length > 0) {
|
|
893
|
+
lines.push("");
|
|
894
|
+
lines.push("**Planned:**");
|
|
895
|
+
for (const f of planned) lines.push(`- ${f.name}: ${f.description}`);
|
|
896
|
+
}
|
|
897
|
+
const tested = map.modules.filter((m) => m.hasTests).length;
|
|
898
|
+
const total = map.modules.length;
|
|
899
|
+
lines.push("");
|
|
900
|
+
lines.push(`**Test coverage:** ${tested}/${total} modules (${Math.round(tested / total * 100)}%)`);
|
|
901
|
+
return lines.join("\n");
|
|
902
|
+
}
|
|
903
|
+
|
|
672
904
|
//#endregion
|
|
673
905
|
//#region src/media/audio.ts
|
|
674
906
|
const TELEGRAM_VOICE_AUDIO_EXTENSIONS = new Set([
|
|
@@ -2686,6 +2918,10 @@ function buildSystemPrompt(params) {
|
|
|
2686
2918
|
const steerBlock = formatSteerForContext();
|
|
2687
2919
|
if (steerBlock) resolvedExtraSystemPrompt = [resolvedExtraSystemPrompt, steerBlock].filter(Boolean).join("\n\n");
|
|
2688
2920
|
} catch {}
|
|
2921
|
+
try {
|
|
2922
|
+
const archBlock = formatArchitectureForContext(generateArchitectureMap(params.workspaceDir));
|
|
2923
|
+
if (archBlock) resolvedExtraSystemPrompt = [resolvedExtraSystemPrompt, archBlock].filter(Boolean).join("\n\n");
|
|
2924
|
+
} catch {}
|
|
2689
2925
|
const ttsHint = params.config ? buildTtsSystemPromptHint(params.config) : void 0;
|
|
2690
2926
|
return buildAgentSystemPrompt({
|
|
2691
2927
|
workspaceDir: params.workspaceDir,
|