agent-enderun 0.9.0 → 0.9.2
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/.enderun/BRAIN_DASHBOARD.md +2 -2
- package/.enderun/PROJECT_MEMORY.md +28 -4
- package/.enderun/STATUS.md +24 -28
- package/.enderun/agents/backend.md +37 -8
- package/.enderun/agents/database.md +55 -0
- package/.enderun/agents/devops.md +28 -14
- package/.enderun/agents/explorer.md +1 -1
- package/.enderun/agents/frontend.md +21 -7
- package/.enderun/agents/git.md +1 -1
- package/.enderun/agents/manager.md +41 -20
- package/.enderun/agents/mobile.md +1 -1
- package/.enderun/agents/native.md +1 -1
- package/.enderun/agents/quality.md +122 -0
- package/.enderun/cli-commands.json +3 -3
- package/.enderun/config.json +7 -1
- package/.enderun/knowledge/context_boundary_rules.md +57 -0
- package/.enderun/knowledge/corporate-governance/high-risk-action-approval-flow.md +29 -0
- package/.enderun/knowledge/documentation_ownership.md +53 -0
- package/.enderun/knowledge/frontend_professionalization_guidelines.md +7 -7
- package/.enderun/knowledge/hermes_live_test_guidelines.md +5 -5
- package/.enderun/knowledge/lessons-learned.md +14 -0
- package/.enderun/knowledge/manager_authority_audit_enforcement.md +8 -8
- package/.enderun/knowledge/project_scaffold_guidelines.md +4 -4
- package/.enderun/knowledge/reference_application_guidelines.md +6 -6
- package/.enderun/memory-graph/agent-contexts/quality.json +1 -0
- package/.enderun/queue/README.md +13 -13
- package/README.md +204 -102
- package/bin/cli.js +1 -1
- package/bin/init-check.js +69 -0
- package/bin/update-contract.js +24 -2
- package/docs/README.md +21 -32
- package/docs/architecture/README.md +9 -0
- package/docs/architecture/standards/data-fetching-patterns.md +13 -0
- package/docs/architecture/standards/design-system.md +31 -0
- package/docs/architecture/standards/logging.md +7 -0
- package/docs/architecture/standards/tech-stack.md +9 -0
- package/docs/getting-started.md +9 -259
- package/docs/user/README.md +35 -0
- package/docs/user/action-plan-2026.md +9 -0
- package/docs/user/getting-started.md +13 -0
- package/docs/user/roadmap.md +13 -0
- package/eslint.config.js +1 -1
- package/framework-mcp/dist/index.js +7 -13
- package/framework-mcp/node_modules/@types/node/LICENSE +21 -0
- package/framework-mcp/node_modules/@types/node/README.md +15 -0
- package/framework-mcp/node_modules/@types/node/assert/strict.d.ts +111 -0
- package/framework-mcp/node_modules/@types/node/assert.d.ts +1078 -0
- package/framework-mcp/node_modules/@types/node/async_hooks.d.ts +603 -0
- package/framework-mcp/node_modules/@types/node/buffer.buffer.d.ts +472 -0
- package/framework-mcp/node_modules/@types/node/buffer.d.ts +1934 -0
- package/framework-mcp/node_modules/@types/node/child_process.d.ts +1476 -0
- package/framework-mcp/node_modules/@types/node/cluster.d.ts +578 -0
- package/framework-mcp/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
- package/framework-mcp/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/framework-mcp/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/framework-mcp/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
- package/framework-mcp/node_modules/@types/node/console.d.ts +452 -0
- package/framework-mcp/node_modules/@types/node/constants.d.ts +21 -0
- package/framework-mcp/node_modules/@types/node/crypto.d.ts +4545 -0
- package/framework-mcp/node_modules/@types/node/dgram.d.ts +600 -0
- package/framework-mcp/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
- package/framework-mcp/node_modules/@types/node/dns/promises.d.ts +503 -0
- package/framework-mcp/node_modules/@types/node/dns.d.ts +923 -0
- package/framework-mcp/node_modules/@types/node/domain.d.ts +170 -0
- package/framework-mcp/node_modules/@types/node/events.d.ts +976 -0
- package/framework-mcp/node_modules/@types/node/fs/promises.d.ts +1295 -0
- package/framework-mcp/node_modules/@types/node/fs.d.ts +4461 -0
- package/framework-mcp/node_modules/@types/node/globals.d.ts +172 -0
- package/framework-mcp/node_modules/@types/node/globals.typedarray.d.ts +38 -0
- package/framework-mcp/node_modules/@types/node/http.d.ts +2089 -0
- package/framework-mcp/node_modules/@types/node/http2.d.ts +2721 -0
- package/framework-mcp/node_modules/@types/node/https.d.ts +579 -0
- package/framework-mcp/node_modules/@types/node/index.d.ts +97 -0
- package/framework-mcp/node_modules/@types/node/inspector.d.ts +253 -0
- package/framework-mcp/node_modules/@types/node/inspector.generated.d.ts +4052 -0
- package/framework-mcp/node_modules/@types/node/module.d.ts +891 -0
- package/framework-mcp/node_modules/@types/node/net.d.ts +1076 -0
- package/framework-mcp/node_modules/@types/node/os.d.ts +506 -0
- package/framework-mcp/node_modules/@types/node/package.json +145 -0
- package/framework-mcp/node_modules/@types/node/path.d.ts +200 -0
- package/framework-mcp/node_modules/@types/node/perf_hooks.d.ts +968 -0
- package/framework-mcp/node_modules/@types/node/process.d.ts +2084 -0
- package/framework-mcp/node_modules/@types/node/punycode.d.ts +117 -0
- package/framework-mcp/node_modules/@types/node/querystring.d.ts +152 -0
- package/framework-mcp/node_modules/@types/node/readline/promises.d.ts +161 -0
- package/framework-mcp/node_modules/@types/node/readline.d.ts +594 -0
- package/framework-mcp/node_modules/@types/node/repl.d.ts +428 -0
- package/framework-mcp/node_modules/@types/node/sea.d.ts +153 -0
- package/framework-mcp/node_modules/@types/node/sqlite.d.ts +721 -0
- package/framework-mcp/node_modules/@types/node/stream/consumers.d.ts +38 -0
- package/framework-mcp/node_modules/@types/node/stream/promises.d.ts +90 -0
- package/framework-mcp/node_modules/@types/node/stream/web.d.ts +622 -0
- package/framework-mcp/node_modules/@types/node/stream.d.ts +1687 -0
- package/framework-mcp/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/framework-mcp/node_modules/@types/node/test.d.ts +2163 -0
- package/framework-mcp/node_modules/@types/node/timers/promises.d.ts +108 -0
- package/framework-mcp/node_modules/@types/node/timers.d.ts +287 -0
- package/framework-mcp/node_modules/@types/node/tls.d.ts +1319 -0
- package/framework-mcp/node_modules/@types/node/trace_events.d.ts +197 -0
- package/framework-mcp/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
- package/framework-mcp/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
- package/framework-mcp/node_modules/@types/node/ts5.6/index.d.ts +97 -0
- package/framework-mcp/node_modules/@types/node/tty.d.ts +208 -0
- package/framework-mcp/node_modules/@types/node/url.d.ts +984 -0
- package/framework-mcp/node_modules/@types/node/util.d.ts +2606 -0
- package/framework-mcp/node_modules/@types/node/v8.d.ts +920 -0
- package/framework-mcp/node_modules/@types/node/vm.d.ts +1000 -0
- package/framework-mcp/node_modules/@types/node/wasi.d.ts +181 -0
- package/framework-mcp/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/framework-mcp/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/framework-mcp/node_modules/@types/node/web-globals/events.d.ts +97 -0
- package/framework-mcp/node_modules/@types/node/web-globals/fetch.d.ts +55 -0
- package/framework-mcp/node_modules/@types/node/web-globals/navigator.d.ts +22 -0
- package/framework-mcp/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/framework-mcp/node_modules/@types/node/worker_threads.d.ts +784 -0
- package/framework-mcp/node_modules/@types/node/zlib.d.ts +747 -0
- package/framework-mcp/node_modules/typescript/LICENSE.txt +55 -0
- package/framework-mcp/node_modules/typescript/README.md +50 -0
- package/framework-mcp/node_modules/typescript/SECURITY.md +41 -0
- package/framework-mcp/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
- package/framework-mcp/node_modules/typescript/bin/tsc +2 -0
- package/framework-mcp/node_modules/typescript/bin/tsserver +2 -0
- package/framework-mcp/node_modules/typescript/lib/_tsc.js +133818 -0
- package/framework-mcp/node_modules/typescript/lib/_tsserver.js +659 -0
- package/framework-mcp/node_modules/typescript/lib/_typingsInstaller.js +222 -0
- package/framework-mcp/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2122 -0
- package/framework-mcp/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2122 -0
- package/framework-mcp/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2122 -0
- package/framework-mcp/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2122 -0
- package/framework-mcp/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2122 -0
- package/framework-mcp/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2122 -0
- package/framework-mcp/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2122 -0
- package/framework-mcp/node_modules/typescript/lib/lib.d.ts +22 -0
- package/framework-mcp/node_modules/typescript/lib/lib.decorators.d.ts +384 -0
- package/framework-mcp/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
- package/framework-mcp/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
- package/framework-mcp/node_modules/typescript/lib/lib.dom.d.ts +39429 -0
- package/framework-mcp/node_modules/typescript/lib/lib.dom.iterable.d.ts +571 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2015.iterable.d.ts +605 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +21 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2017.d.ts +26 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2020.bigint.d.ts +765 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +99 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2020.string.d.ts +44 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2021.weakref.d.ts +78 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2022.d.ts +25 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2022.error.d.ts +75 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2022.intl.d.ts +145 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +65 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2024.collection.d.ts +29 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2024.d.ts +26 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2024.full.d.ts +24 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2024.object.d.ts +29 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2024.promise.d.ts +35 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2024.regexp.d.ts +25 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +68 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es2024.string.d.ts +29 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es5.d.ts +4601 -0
- package/framework-mcp/node_modules/typescript/lib/lib.es6.d.ts +23 -0
- package/framework-mcp/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
- package/framework-mcp/node_modules/typescript/lib/lib.esnext.collection.d.ts +96 -0
- package/framework-mcp/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
- package/framework-mcp/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
- package/framework-mcp/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
- package/framework-mcp/node_modules/typescript/lib/lib.esnext.error.d.ts +24 -0
- package/framework-mcp/node_modules/typescript/lib/lib.esnext.float16.d.ts +445 -0
- package/framework-mcp/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
- package/framework-mcp/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
- package/framework-mcp/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
- package/framework-mcp/node_modules/typescript/lib/lib.esnext.promise.d.ts +34 -0
- package/framework-mcp/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +25 -0
- package/framework-mcp/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
- package/framework-mcp/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
- package/framework-mcp/node_modules/typescript/lib/lib.webworker.d.ts +13150 -0
- package/framework-mcp/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
- package/framework-mcp/node_modules/typescript/lib/lib.webworker.iterable.d.ts +340 -0
- package/framework-mcp/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2122 -0
- package/framework-mcp/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2122 -0
- package/framework-mcp/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2122 -0
- package/framework-mcp/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2122 -0
- package/framework-mcp/node_modules/typescript/lib/tsc.js +8 -0
- package/framework-mcp/node_modules/typescript/lib/tsserver.js +8 -0
- package/framework-mcp/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
- package/framework-mcp/node_modules/typescript/lib/tsserverlibrary.js +21 -0
- package/framework-mcp/node_modules/typescript/lib/typesMap.json +497 -0
- package/framework-mcp/node_modules/typescript/lib/typescript.d.ts +11437 -0
- package/framework-mcp/node_modules/typescript/lib/typescript.js +200276 -0
- package/framework-mcp/node_modules/typescript/lib/typingsInstaller.js +8 -0
- package/framework-mcp/node_modules/typescript/lib/watchGuard.js +53 -0
- package/framework-mcp/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2122 -0
- package/framework-mcp/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2122 -0
- package/framework-mcp/node_modules/typescript/package.json +120 -0
- package/framework-mcp/node_modules/undici-types/LICENSE +21 -0
- package/framework-mcp/node_modules/undici-types/README.md +6 -0
- package/framework-mcp/node_modules/undici-types/agent.d.ts +31 -0
- package/framework-mcp/node_modules/undici-types/api.d.ts +43 -0
- package/framework-mcp/node_modules/undici-types/balanced-pool.d.ts +29 -0
- package/framework-mcp/node_modules/undici-types/cache.d.ts +36 -0
- package/framework-mcp/node_modules/undici-types/client.d.ts +108 -0
- package/framework-mcp/node_modules/undici-types/connector.d.ts +34 -0
- package/framework-mcp/node_modules/undici-types/content-type.d.ts +21 -0
- package/framework-mcp/node_modules/undici-types/cookies.d.ts +28 -0
- package/framework-mcp/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
- package/framework-mcp/node_modules/undici-types/dispatcher.d.ts +256 -0
- package/framework-mcp/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
- package/framework-mcp/node_modules/undici-types/errors.d.ts +149 -0
- package/framework-mcp/node_modules/undici-types/eventsource.d.ts +61 -0
- package/framework-mcp/node_modules/undici-types/fetch.d.ts +209 -0
- package/framework-mcp/node_modules/undici-types/file.d.ts +39 -0
- package/framework-mcp/node_modules/undici-types/filereader.d.ts +54 -0
- package/framework-mcp/node_modules/undici-types/formdata.d.ts +108 -0
- package/framework-mcp/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/framework-mcp/node_modules/undici-types/global-origin.d.ts +7 -0
- package/framework-mcp/node_modules/undici-types/handlers.d.ts +15 -0
- package/framework-mcp/node_modules/undici-types/header.d.ts +4 -0
- package/framework-mcp/node_modules/undici-types/index.d.ts +71 -0
- package/framework-mcp/node_modules/undici-types/interceptors.d.ts +17 -0
- package/framework-mcp/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/framework-mcp/node_modules/undici-types/mock-client.d.ts +25 -0
- package/framework-mcp/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/framework-mcp/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/framework-mcp/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/framework-mcp/node_modules/undici-types/package.json +55 -0
- package/framework-mcp/node_modules/undici-types/patch.d.ts +33 -0
- package/framework-mcp/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/framework-mcp/node_modules/undici-types/pool.d.ts +39 -0
- package/framework-mcp/node_modules/undici-types/proxy-agent.d.ts +28 -0
- package/framework-mcp/node_modules/undici-types/readable.d.ts +65 -0
- package/framework-mcp/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/framework-mcp/node_modules/undici-types/retry-handler.d.ts +116 -0
- package/framework-mcp/node_modules/undici-types/util.d.ts +18 -0
- package/framework-mcp/node_modules/undici-types/webidl.d.ts +228 -0
- package/framework-mcp/node_modules/undici-types/websocket.d.ts +150 -0
- package/framework-mcp/src/declarations.d.ts +3 -0
- package/framework-mcp/src/index.ts +228 -0
- package/package.json +4 -3
- package/src/cli/adapters.ts +208 -0
- package/src/cli/commands/app.ts +38 -0
- package/src/cli/commands/check.ts +87 -0
- package/src/cli/commands/compliance.ts +55 -0
- package/src/cli/commands/contract.ts +45 -0
- package/src/cli/commands/explorer.ts +45 -0
- package/src/cli/commands/git.ts +39 -0
- package/src/cli/commands/init.ts +272 -0
- package/src/cli/commands/knowledge.ts +44 -0
- package/src/cli/commands/lint.ts +25 -0
- package/src/cli/commands/log.ts +37 -0
- package/src/cli/commands/memory.ts +78 -0
- package/src/cli/commands/orchestrate.ts +111 -0
- package/src/cli/commands/script.ts +20 -0
- package/src/cli/commands/security.ts +38 -0
- package/src/cli/commands/status.ts +59 -0
- package/src/cli/commands/trace.ts +46 -0
- package/src/cli/index.ts +107 -0
- package/src/cli/utils/app.ts +764 -0
- package/src/cli/utils/claude.ts +56 -0
- package/src/cli/utils/fs.ts +139 -0
- package/src/cli/utils/memory.ts +141 -0
- package/src/cli/utils/pkg.ts +215 -0
- package/src/cli/utils/string.ts +48 -0
- package/src/cli/utils/time.ts +27 -0
- package/.enderun/agents/analyst.md +0 -236
- package/.enderun/agents/orchestrator.md +0 -172
- package/.enderun/agents/qa.md +0 -121
- package/.enderun/agents/security.md +0 -202
- package/.enderun/knowledge/api_design_rules.md +0 -6
- package/.enderun/knowledge/branded_types_pattern.md +0 -8
- package/.enderun/knowledge/code_review_checklist.md +0 -7
- package/.enderun/knowledge/contract_versioning.md +0 -7
- package/.enderun/knowledge/database_migration.md +0 -6
- package/.enderun/knowledge/deployment_checklist.md +0 -7
- package/.enderun/knowledge/git_commit_strategy.md +0 -10
- package/.enderun/knowledge/monitoring_setup.md +0 -5
- package/.enderun/knowledge/performance_guidelines.md +0 -11
- package/.enderun/knowledge/repository_patterns.md +0 -9
- package/.enderun/knowledge/security_scanning.md +0 -6
- package/.enderun/knowledge/testing_standards.md +0 -7
- package/.enderun/knowledge/troubleshooting_guide.md +0 -5
- package/.enderun/memory-graph/agent-contexts/analyst.json +0 -1
- package/.enderun/memory-graph/agent-contexts/orchestrator.json +0 -1
- package/.enderun/memory-graph/agent-contexts/qa.json +0 -1
- package/.enderun/memory-graph/agent-contexts/security.json +0 -1
- package/docs/action-plan-2026.md +0 -119
- package/docs/roadmap.md +0 -142
- package/docs/tech-stack.md +0 -30
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
import { execSync } from "child_process";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
resolveAdapter,
|
|
8
|
+
isAdapterShimFile,
|
|
9
|
+
remapFrameworkContent,
|
|
10
|
+
runAdapterPostInit,
|
|
11
|
+
type AdapterConfig,
|
|
12
|
+
} from "../adapters.js";
|
|
13
|
+
import { getPackageManager, mergePackageJson, deepCleanProtocols, sanitizeJson, getPackageVersion } from "../utils/pkg.js";
|
|
14
|
+
import { updateGitIgnore, ensureDir, writeJsonFile, copyDir } from "../utils/fs.js";
|
|
15
|
+
import { initializeMemory } from "../utils/memory.js";
|
|
16
|
+
import { checkCommand } from "./check.js";
|
|
17
|
+
|
|
18
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
19
|
+
const __dirname = path.dirname(__filename);
|
|
20
|
+
const sourceDir = path.join(__dirname, "../../..");
|
|
21
|
+
const targetDir = process.cwd();
|
|
22
|
+
|
|
23
|
+
const FRAMEWORK_VERSION = getPackageVersion();
|
|
24
|
+
|
|
25
|
+
const CORE_FILES = [
|
|
26
|
+
".enderun",
|
|
27
|
+
"mcp.json",
|
|
28
|
+
".env.example",
|
|
29
|
+
"ENDERUN.md",
|
|
30
|
+
"package.json",
|
|
31
|
+
"tsconfig.json",
|
|
32
|
+
"panda.config.ts",
|
|
33
|
+
"vitest.config.ts",
|
|
34
|
+
"framework-mcp",
|
|
35
|
+
"docs",
|
|
36
|
+
"eslint.config.js",
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
const FRAMEWORK_SUBDIRS = [
|
|
40
|
+
"agents",
|
|
41
|
+
"agents/schema",
|
|
42
|
+
"skills",
|
|
43
|
+
"knowledge",
|
|
44
|
+
"benchmarks",
|
|
45
|
+
"monitoring",
|
|
46
|
+
"logs",
|
|
47
|
+
"messages",
|
|
48
|
+
"memory-graph",
|
|
49
|
+
"memory-graph/agent-contexts",
|
|
50
|
+
"queue",
|
|
51
|
+
"queue/pending",
|
|
52
|
+
"queue/processing",
|
|
53
|
+
"queue/completed",
|
|
54
|
+
"queue/failed",
|
|
55
|
+
"queue/pipelines",
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
function buildDirsToCreate(adapter: AdapterConfig): string[] {
|
|
59
|
+
const dirs = [
|
|
60
|
+
adapter.frameworkDir,
|
|
61
|
+
...FRAMEWORK_SUBDIRS.map((d) => `${adapter.frameworkDir}/${d}`),
|
|
62
|
+
"apps/web",
|
|
63
|
+
"apps/backend",
|
|
64
|
+
"docs",
|
|
65
|
+
"framework-mcp",
|
|
66
|
+
"tests",
|
|
67
|
+
];
|
|
68
|
+
if (adapter.nestedDirs) {
|
|
69
|
+
for (const nested of adapter.nestedDirs) {
|
|
70
|
+
dirs.push(`${adapter.frameworkDir}/${nested}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return [...new Set(dirs)];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Scaffold the framework for a specific IDE adapter (separate runtime folder per IDE).
|
|
78
|
+
*/
|
|
79
|
+
export async function initCommand(adapterInput?: string) {
|
|
80
|
+
const adapter = resolveAdapter(adapterInput);
|
|
81
|
+
const { frameworkDir, shimFile, templateDir } = adapter;
|
|
82
|
+
const targetFrameworkDir = path.join(targetDir, frameworkDir);
|
|
83
|
+
|
|
84
|
+
console.warn(`🚀 Installing Agent Enderun (Adapter: ${adapter.id} → ${frameworkDir}/)...`);
|
|
85
|
+
|
|
86
|
+
if (!fs.existsSync(targetFrameworkDir)) {
|
|
87
|
+
fs.mkdirSync(targetFrameworkDir, { recursive: true });
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
for (const dir of buildDirsToCreate(adapter)) {
|
|
91
|
+
const fullPath = path.join(targetDir, dir);
|
|
92
|
+
if (!fs.existsSync(fullPath)) {
|
|
93
|
+
fs.mkdirSync(fullPath, { recursive: true });
|
|
94
|
+
console.warn(`📂 Created directory: ${dir}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const filesToProcess = [
|
|
99
|
+
...CORE_FILES,
|
|
100
|
+
shimFile,
|
|
101
|
+
].filter(
|
|
102
|
+
(f) =>
|
|
103
|
+
CORE_FILES.includes(f) ||
|
|
104
|
+
f === shimFile ||
|
|
105
|
+
fs.existsSync(path.join(sourceDir, f)),
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
ensureDir(path.join(targetDir, "apps/backend"));
|
|
109
|
+
const initContractPath = path.join(targetDir, "apps/backend/contract.version.json");
|
|
110
|
+
if (!fs.existsSync(initContractPath)) {
|
|
111
|
+
writeJsonFile(initContractPath, {
|
|
112
|
+
contract_hash: "initial_hash_placeholder",
|
|
113
|
+
last_updated: new Date().toISOString(),
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
let targetPkg: Record<string, unknown> = {};
|
|
118
|
+
try {
|
|
119
|
+
const targetPkgPath = path.join(targetDir, "package.json");
|
|
120
|
+
if (fs.existsSync(targetPkgPath)) {
|
|
121
|
+
targetPkg = JSON.parse(fs.readFileSync(targetPkgPath, "utf8"));
|
|
122
|
+
}
|
|
123
|
+
} catch {
|
|
124
|
+
// ignore
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const pkgName = typeof targetPkg.name === "string" ? targetPkg.name : "";
|
|
128
|
+
const targetScope = pkgName
|
|
129
|
+
? pkgName.startsWith("@")
|
|
130
|
+
? pkgName.split("/")[0]
|
|
131
|
+
: `@${pkgName}`
|
|
132
|
+
: `@${path.basename(targetDir)}`;
|
|
133
|
+
|
|
134
|
+
for (const item of filesToProcess) {
|
|
135
|
+
const src = path.join(sourceDir, item);
|
|
136
|
+
let dest = path.join(targetDir, item);
|
|
137
|
+
|
|
138
|
+
if (item === "framework-mcp" && fs.existsSync(dest)) {
|
|
139
|
+
try {
|
|
140
|
+
fs.rmSync(dest, { recursive: true, force: true });
|
|
141
|
+
} catch {
|
|
142
|
+
// ignore
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (item === templateDir || item.startsWith(`${templateDir}/`)) {
|
|
147
|
+
dest = path.join(targetDir, item.replace(templateDir, frameworkDir));
|
|
148
|
+
}
|
|
149
|
+
if (item === "ENDERUN.md") {
|
|
150
|
+
dest = path.join(targetFrameworkDir, "ENDERUN.md");
|
|
151
|
+
}
|
|
152
|
+
if (isAdapterShimFile(item)) {
|
|
153
|
+
dest = path.join(targetDir, item);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (!fs.existsSync(src)) {
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (fs.lstatSync(src).isDirectory()) {
|
|
161
|
+
const skipFiles =
|
|
162
|
+
item === templateDir ? ["logs", "PROJECT_MEMORY.md", "PROJECT_MEMORY.lock"] : [];
|
|
163
|
+
const nonDestructive = ["docs", templateDir].includes(item);
|
|
164
|
+
copyDir(
|
|
165
|
+
src,
|
|
166
|
+
dest,
|
|
167
|
+
new Set(skipFiles),
|
|
168
|
+
nonDestructive,
|
|
169
|
+
frameworkDir,
|
|
170
|
+
targetScope,
|
|
171
|
+
sanitizeJson,
|
|
172
|
+
adapter.id,
|
|
173
|
+
);
|
|
174
|
+
} else {
|
|
175
|
+
if (item === "package.json") continue;
|
|
176
|
+
|
|
177
|
+
if (fs.existsSync(dest) && !isAdapterShimFile(item)) {
|
|
178
|
+
console.warn(`ℹ️ Skipping existing file: ${item}`);
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const ext = path.extname(item);
|
|
183
|
+
const textExtensions = [".md", ".json", ".js", ".ts", ".txt", ""];
|
|
184
|
+
if (textExtensions.includes(ext)) {
|
|
185
|
+
let content = fs.readFileSync(src, "utf8");
|
|
186
|
+
content = remapFrameworkContent(content, frameworkDir, adapter.id);
|
|
187
|
+
|
|
188
|
+
if (ext === ".json") {
|
|
189
|
+
try {
|
|
190
|
+
const json = JSON.parse(content);
|
|
191
|
+
content = JSON.stringify(sanitizeJson(json, targetScope), null, 2);
|
|
192
|
+
content = remapFrameworkContent(content, frameworkDir, adapter.id);
|
|
193
|
+
} catch {
|
|
194
|
+
content = content.replace(/workspace:[^"'\s]*/g, "*");
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
fs.writeFileSync(dest, content);
|
|
199
|
+
} else {
|
|
200
|
+
fs.copyFileSync(src, dest);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
console.warn(`✅ ${item} processed -> ${path.relative(targetDir, dest)}`);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
mergePackageJson(path.join(targetDir, "package.json"), path.join(sourceDir, "package.json"));
|
|
207
|
+
updateGitIgnore(path.join(targetDir, ".gitignore"), frameworkDir);
|
|
208
|
+
|
|
209
|
+
const finalMemoryPath = path.join(targetFrameworkDir, "PROJECT_MEMORY.md");
|
|
210
|
+
initializeMemory(finalMemoryPath, frameworkDir);
|
|
211
|
+
|
|
212
|
+
deepCleanProtocols(targetDir, targetScope);
|
|
213
|
+
|
|
214
|
+
const sampleTestPath = path.join(targetDir, "tests/initial.test.ts");
|
|
215
|
+
if (!fs.existsSync(sampleTestPath)) {
|
|
216
|
+
fs.writeFileSync(
|
|
217
|
+
sampleTestPath,
|
|
218
|
+
`import { describe, it, expect } from "vitest";
|
|
219
|
+
|
|
220
|
+
describe("Initial Setup", () => {
|
|
221
|
+
it("should verify the testing environment is active", () => {
|
|
222
|
+
expect(true).toBe(true);
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
`,
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (!fs.existsSync(path.join(targetDir, ".git"))) {
|
|
230
|
+
try {
|
|
231
|
+
execSync("git init", { cwd: targetDir, stdio: "ignore" });
|
|
232
|
+
console.warn("✅ Git repository initialized.");
|
|
233
|
+
} catch {
|
|
234
|
+
// ignore
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
console.warn(`\n🛠️ Running ${adapter.id} adapter configuration...`);
|
|
239
|
+
runAdapterPostInit(adapter, targetDir);
|
|
240
|
+
|
|
241
|
+
console.warn(`\n♊ ${adapter.id.toUpperCase()}: Setup complete.`);
|
|
242
|
+
console.warn(` • Framework runtime: ${frameworkDir}/`);
|
|
243
|
+
console.warn(` • Entrypoint shim: ${shimFile}`);
|
|
244
|
+
if (adapter.nestedDirs?.length) {
|
|
245
|
+
console.warn(` • Nested: ${adapter.nestedDirs.map((d) => `${frameworkDir}/${d}/`).join(", ")}`);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
const pkgMgr = getPackageManager();
|
|
249
|
+
const installCmd = pkgMgr === "npm" ? "npm install" : `${pkgMgr} install`;
|
|
250
|
+
const buildCmd = pkgMgr === "npm" ? "npm run enderun:build" : `${pkgMgr} run enderun:build`;
|
|
251
|
+
|
|
252
|
+
console.warn(`\n✨ Framework scaffolded! (v${FRAMEWORK_VERSION})`);
|
|
253
|
+
|
|
254
|
+
if (process.env.ENDERUN_SKIP_INSTALL === "1") {
|
|
255
|
+
console.warn("\n⏭️ Skipping install steps (ENDERUN_SKIP_INSTALL=1).");
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
try {
|
|
260
|
+
execSync(installCmd, { stdio: "inherit" });
|
|
261
|
+
console.warn(`\n🏗️ Step 2/3: Running '${buildCmd}'...`);
|
|
262
|
+
execSync(buildCmd, { stdio: "inherit" });
|
|
263
|
+
console.warn("\n🔍 Step 3/3: Running 'agent-enderun check'...");
|
|
264
|
+
checkCommand();
|
|
265
|
+
console.warn("\n🚀 Agent Enderun is fully installed and verified!");
|
|
266
|
+
} catch (e: unknown) {
|
|
267
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
268
|
+
console.error("\n❌ Automatic installation failed. Run manually:");
|
|
269
|
+
console.warn(`👉 ${installCmd} && ${buildCmd}`);
|
|
270
|
+
console.error(message);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
import { getFrameworkDir } from "../utils/memory.js";
|
|
5
|
+
|
|
6
|
+
const targetDir = process.cwd(); // Assuming targetDir is process.cwd() in the CLI context
|
|
7
|
+
|
|
8
|
+
export function updateKnowledgeBaseCommand(topic: string, content: string) {
|
|
9
|
+
if (!topic || !content) {
|
|
10
|
+
console.error("❌ Usage: agent-enderun update_knowledge_base <topic> <content>");
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const frameworkDir = getFrameworkDir();
|
|
14
|
+
const kbDir = path.join(targetDir, frameworkDir, "knowledge");
|
|
15
|
+
if (!fs.existsSync(kbDir)) fs.mkdirSync(kbDir, { recursive: true });
|
|
16
|
+
const fileName = topic.replace(/[^a-z0-9]/gi, "_").toLowerCase() + ".md";
|
|
17
|
+
fs.writeFileSync(path.join(kbDir, fileName), content);
|
|
18
|
+
console.warn(`✅ Knowledge base updated: ${topic}`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function searchKnowledgeBaseCommand(query: string) {
|
|
22
|
+
if (!query) {
|
|
23
|
+
console.error("❌ Usage: agent-enderun search_knowledge_base <query>");
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const frameworkDir = getFrameworkDir();
|
|
27
|
+
const kbDir = path.join(targetDir, frameworkDir, "knowledge");
|
|
28
|
+
if (!fs.existsSync(kbDir)) {
|
|
29
|
+
console.warn("ℹ️ Knowledge base is empty.");
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const files = fs.readdirSync(kbDir).filter(f => f.endsWith(".md"));
|
|
33
|
+
let found = false;
|
|
34
|
+
for (const file of files) {
|
|
35
|
+
const content = fs.readFileSync(path.join(kbDir, file), "utf-8");
|
|
36
|
+
if (content.toLowerCase().includes(query.toLowerCase()) || file.toLowerCase().includes(query.toLowerCase())) {
|
|
37
|
+
console.warn(`
|
|
38
|
+
### ${file.replace(".md", "")}
|
|
39
|
+
${content.slice(0, 300)}...`);
|
|
40
|
+
found = true;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (!found) console.warn("ℹ️ No matching entries found.");
|
|
44
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { execSync } from "child_process";
|
|
2
|
+
|
|
3
|
+
import { getPackageVersion } from "../utils/pkg.js";
|
|
4
|
+
|
|
5
|
+
const FRAMEWORK_VERSION = getPackageVersion();
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Run ESLint for the project (same as npm run lint).
|
|
9
|
+
*/
|
|
10
|
+
export function lintCommand(): void {
|
|
11
|
+
console.warn(`🔍 Running ESLint (v${FRAMEWORK_VERSION})...`);
|
|
12
|
+
const projectRoot = process.cwd();
|
|
13
|
+
try {
|
|
14
|
+
execSync("npm run lint", {
|
|
15
|
+
cwd: projectRoot,
|
|
16
|
+
stdio: "inherit",
|
|
17
|
+
env: process.env,
|
|
18
|
+
});
|
|
19
|
+
console.warn("\n✅ ESLint passed with no errors.");
|
|
20
|
+
} catch {
|
|
21
|
+
console.warn("\n❌ ESLint reported errors. Fix violations before committing.");
|
|
22
|
+
console.warn(" Tip: npm run lint -- --fix");
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
import { getFrameworkDir } from "../utils/memory.js";
|
|
5
|
+
import { normalizeAgentName } from "../utils/string.js";
|
|
6
|
+
|
|
7
|
+
const targetDir = process.cwd(); // Assuming targetDir is process.cwd() in the CLI context
|
|
8
|
+
|
|
9
|
+
export function logAgentActionCommand(data: { agent?: unknown; action?: string; requestId?: string; status?: string; summary?: string; files?: string[]; details?: Record<string, unknown> }) {
|
|
10
|
+
const frameworkDir = getFrameworkDir();
|
|
11
|
+
const logsDir = path.join(targetDir, frameworkDir, "logs");
|
|
12
|
+
if (!fs.existsSync(logsDir)) {
|
|
13
|
+
fs.mkdirSync(logsDir, { recursive: true });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const agent = normalizeAgentName(data.agent);
|
|
17
|
+
const logPath = path.join(logsDir, `${agent}.json`);
|
|
18
|
+
let logs: Record<string, unknown>[] = [];
|
|
19
|
+
|
|
20
|
+
if (fs.existsSync(logPath)) {
|
|
21
|
+
try {
|
|
22
|
+
logs = JSON.parse(fs.readFileSync(logPath, "utf8"));
|
|
23
|
+
if (!Array.isArray(logs)) logs = [];
|
|
24
|
+
} catch {
|
|
25
|
+
logs = [];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const newEntry = {
|
|
30
|
+
timestamp: new Date().toISOString(),
|
|
31
|
+
...data,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
logs.push(newEntry);
|
|
35
|
+
fs.writeFileSync(logPath, JSON.stringify(logs, null, 2));
|
|
36
|
+
console.warn(`✅ Logged action to ${frameworkDir}/logs/${agent}.json`);
|
|
37
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
import { getMemoryPath, acquireMemoryLock, releaseMemoryLock } from "../utils/memory.js";
|
|
5
|
+
|
|
6
|
+
export function updateProjectMemoryCommand(section: string, content: string) {
|
|
7
|
+
const memoryPath = getMemoryPath();
|
|
8
|
+
if (!fs.existsSync(memoryPath)) {
|
|
9
|
+
console.error("❌ Error: PROJECT_MEMORY.md not found.");
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const lockPath = `${memoryPath}.lock`;
|
|
14
|
+
if (!acquireMemoryLock(lockPath)) {
|
|
15
|
+
console.error("❌ Error: Memory lock timeout.");
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
let memoryContent = fs.readFileSync(memoryPath, "utf8");
|
|
21
|
+
|
|
22
|
+
if (section === "HISTORY") {
|
|
23
|
+
const headers = ["## HISTORY (Persistent Memory)", "## HISTORY"];
|
|
24
|
+
let sectionIndex = -1;
|
|
25
|
+
for (const h of headers) {
|
|
26
|
+
sectionIndex = memoryContent.indexOf(h);
|
|
27
|
+
if (sectionIndex !== -1) {
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (sectionIndex === -1) {
|
|
33
|
+
console.error("❌ Error: HISTORY section not found.");
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const headerEnd = memoryContent.indexOf("\n", sectionIndex) + 1;
|
|
37
|
+
memoryContent =
|
|
38
|
+
memoryContent.slice(0, headerEnd) +
|
|
39
|
+
`\n${content.trim()}\n` +
|
|
40
|
+
memoryContent.slice(headerEnd);
|
|
41
|
+
|
|
42
|
+
// --- Auto-Prune Logic ---
|
|
43
|
+
const historySplit = memoryContent.split("### ");
|
|
44
|
+
if (historySplit.length > 11) { // Title + 10 entries
|
|
45
|
+
const frameworkDir = path.dirname(memoryPath);
|
|
46
|
+
const archiveDir = path.join(frameworkDir, "archive/history");
|
|
47
|
+
if (!fs.existsSync(archiveDir)) fs.mkdirSync(archiveDir, { recursive: true });
|
|
48
|
+
|
|
49
|
+
const toArchive = historySplit.slice(11); // Keep the first 10 entries (newest)
|
|
50
|
+
const preserved = historySplit.slice(0, 11);
|
|
51
|
+
|
|
52
|
+
const archiveContent = "### " + toArchive.join("### ");
|
|
53
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
54
|
+
fs.writeFileSync(path.join(archiveDir, `history-${timestamp}.md`), archiveContent);
|
|
55
|
+
|
|
56
|
+
memoryContent = preserved.join("### ").trim() + "\n";
|
|
57
|
+
console.warn(`📦 Auto-Pruned: ${toArchive.length} old entries moved to archive.`);
|
|
58
|
+
}
|
|
59
|
+
// ------------------------
|
|
60
|
+
} else {
|
|
61
|
+
const escaped = section.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
62
|
+
const sectionRegex = new RegExp(`## ${escaped}[\\s\\S]*?(?=\\n## |$)`, "m");
|
|
63
|
+
if (!sectionRegex.test(memoryContent)) {
|
|
64
|
+
console.error(`❌ Error: Section not found: ${section}`);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
memoryContent = memoryContent.replace(
|
|
68
|
+
sectionRegex,
|
|
69
|
+
`## ${section}\n\n${content.trim()}\n`,
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
fs.writeFileSync(memoryPath, memoryContent);
|
|
74
|
+
console.warn(`✅ Section ${section} updated in PROJECT_MEMORY.md`);
|
|
75
|
+
} finally {
|
|
76
|
+
releaseMemoryLock(lockPath);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { execSync } from "child_process";
|
|
4
|
+
import { getFrameworkDir } from "../utils/memory.js";
|
|
5
|
+
|
|
6
|
+
interface HermesMessage {
|
|
7
|
+
timestamp: string;
|
|
8
|
+
from: string;
|
|
9
|
+
to: string;
|
|
10
|
+
category: "ACTION" | "DELEGATION" | "INFO" | "ALERT";
|
|
11
|
+
traceId: string;
|
|
12
|
+
content: string;
|
|
13
|
+
status: "PENDING" | "PROCESSED";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Start the live Hermes Orchestration & Message Loop
|
|
18
|
+
*/
|
|
19
|
+
export function orchestrateCommand() {
|
|
20
|
+
const frameworkDir = getFrameworkDir();
|
|
21
|
+
const messagesDir = path.join(process.cwd(), frameworkDir, "messages");
|
|
22
|
+
const statusPath = path.join(process.cwd(), frameworkDir, "STATUS.md");
|
|
23
|
+
|
|
24
|
+
console.log(`\n================================================================`);
|
|
25
|
+
console.log(`🏛️ AGENT ENDERUN — DYNAMIC HERMES ORCHESTRATÖR DÖNGÜSÜ`);
|
|
26
|
+
console.log(`================================================================`);
|
|
27
|
+
console.log(`🛰️ Hermes Message Broker dinleniyor: ${frameworkDir}/messages/...`);
|
|
28
|
+
|
|
29
|
+
if (!fs.existsSync(messagesDir)) {
|
|
30
|
+
fs.mkdirSync(messagesDir, { recursive: true });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Scan all JSON files in the messages directory
|
|
34
|
+
const messageFiles = fs.readdirSync(messagesDir).filter(f => f.endsWith(".json"));
|
|
35
|
+
const pendingMessages: HermesMessage[] = [];
|
|
36
|
+
|
|
37
|
+
for (const file of messageFiles) {
|
|
38
|
+
const filePath = path.join(messagesDir, file);
|
|
39
|
+
try {
|
|
40
|
+
const content = fs.readFileSync(filePath, "utf8").trim();
|
|
41
|
+
if (!content) continue;
|
|
42
|
+
// Messages are stored as newline-delimited JSON
|
|
43
|
+
const lines = content.split("\n");
|
|
44
|
+
lines.forEach((line, index) => {
|
|
45
|
+
if (!line.trim()) return;
|
|
46
|
+
const msg = JSON.parse(line) as HermesMessage;
|
|
47
|
+
if (msg.status === "PENDING") {
|
|
48
|
+
pendingMessages.push(msg);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
} catch (e) {
|
|
52
|
+
// ignore malformed lines
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (pendingMessages.length === 0) {
|
|
57
|
+
console.log(`\n🟢 Kuyruk Temiz: İşlenecek aktif Hermes mesajı bulunamadı.`);
|
|
58
|
+
console.log(`💡 İpucu: Bir uzman ajanı tetiklemek için send_agent_message aracını kullanın.`);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
console.log(`\n📥 Kuyrukta ${pendingMessages.length} adet bekleyen Hermes mesajı tespit edildi:\n`);
|
|
63
|
+
|
|
64
|
+
// Process the first pending message
|
|
65
|
+
const activeMessage = pendingMessages[0];
|
|
66
|
+
const toAgent = activeMessage.to;
|
|
67
|
+
const fromAgent = activeMessage.from;
|
|
68
|
+
|
|
69
|
+
console.log(`✉️ [GÖNDEREN] : ${fromAgent}`);
|
|
70
|
+
console.log(`📥 [ALICI] : ${toAgent}`);
|
|
71
|
+
console.log(`🆔 [TRACE ID] : ${activeMessage.traceId}`);
|
|
72
|
+
console.log(`🏷️ [KATEGORİ] : ${activeMessage.category}`);
|
|
73
|
+
console.log(`💬 [MESAJ] : "${activeMessage.content}"`);
|
|
74
|
+
console.log(`----------------------------------------------------------------`);
|
|
75
|
+
|
|
76
|
+
// 1. Transition the target agent state to EXECUTING in STATUS.md
|
|
77
|
+
console.log(`⏳ Ajan Durum Geçişi: ${toAgent} durumu EXECUTING olarak kilitleniyor...`);
|
|
78
|
+
transitionAgentState(statusPath, toAgent, "EXECUTING", activeMessage.content);
|
|
79
|
+
|
|
80
|
+
console.log(`\n🤖 Görev Devredildi!`);
|
|
81
|
+
console.log(`👉 Lütfen ${toAgent} agent talimatlarını (${frameworkDir}/agents/${toAgent.replace("@", "")}.md) okuyun ve görevi yerine getirin.`);
|
|
82
|
+
console.log(`💡 Görev tamamlandığında, mesajı PROCESSED olarak işaretlemek ve ajanı boşa çıkarmak için:`);
|
|
83
|
+
console.log(` npx agent-enderun status komutuyla kontrol edin.`);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function transitionAgentState(statusPath: string, agent: string, state: string, task: string) {
|
|
87
|
+
if (!fs.existsSync(statusPath)) return;
|
|
88
|
+
try {
|
|
89
|
+
let content = fs.readFileSync(statusPath, "utf8");
|
|
90
|
+
const lines = content.split("\n");
|
|
91
|
+
const targetName = agent;
|
|
92
|
+
|
|
93
|
+
for (let i = 0; i < lines.length; i++) {
|
|
94
|
+
if (lines[i].includes(`| ${targetName} |`)) {
|
|
95
|
+
// e.g., | @backend | IDLE | — | — | 9.2/10 | — |
|
|
96
|
+
const parts = lines[i].split("|");
|
|
97
|
+
if (parts.length >= 7) {
|
|
98
|
+
parts[2] = ` ${state} `;
|
|
99
|
+
parts[3] = ` ${task.slice(0, 20)}... `;
|
|
100
|
+
lines[i] = parts.join("|");
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
fs.writeFileSync(statusPath, lines.join("\n"));
|
|
107
|
+
console.log(`✅ STATUS.md üzerinde ${agent} durumu başarıyla '${state}' yapıldı.`);
|
|
108
|
+
} catch (e) {
|
|
109
|
+
console.error("❌ STATUS.md güncellenirken hata oluştu:", e);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import cp from "child_process";
|
|
4
|
+
|
|
5
|
+
const targetDir = process.cwd(); // Assuming targetDir is process.cwd() in the CLI context
|
|
6
|
+
|
|
7
|
+
export function runScriptCommand(script: string, projectPath: string) {
|
|
8
|
+
const fullPath = path.join(targetDir, projectPath);
|
|
9
|
+
if (!fs.existsSync(fullPath)) {
|
|
10
|
+
console.warn(`❌ Project path not found: ${projectPath}`);
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
console.warn(`🚀 Running 'npm run ${script}' in ${projectPath}...`);
|
|
14
|
+
try {
|
|
15
|
+
cp.spawnSync("npm", ["run", script], { cwd: fullPath, stdio: "inherit", shell: true });
|
|
16
|
+
} catch (e: unknown) {
|
|
17
|
+
const message = e instanceof Error ? e.message : "Unknown error";
|
|
18
|
+
console.warn(`❌ Failed to run script: ${message}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
import { collectFiles } from "../utils/fs.js";
|
|
5
|
+
|
|
6
|
+
const targetDir = process.cwd();
|
|
7
|
+
|
|
8
|
+
export function securityAuditCommand(targetPath: string) {
|
|
9
|
+
console.warn(`🔍 Running Advanced Security Audit on: ${targetPath}...`);
|
|
10
|
+
const scanRules = [
|
|
11
|
+
{ pattern: /sql`/, message: "Potential Raw SQL usage detected", severity: "HIGH" },
|
|
12
|
+
{
|
|
13
|
+
pattern: /(password|secret|api_?key)\s*[:=]\s*['"][^'"]+['"]/i,
|
|
14
|
+
message: "Potential hardcoded secret detected",
|
|
15
|
+
severity: "CRITICAL",
|
|
16
|
+
},
|
|
17
|
+
{ pattern: /:\s*any(?!\w)/, message: "Usage of 'any' type detected", severity: "MEDIUM" },
|
|
18
|
+
{ pattern: /\.innerHTML\s*=/, message: "Unsafe innerHTML assignment detected", severity: "MEDIUM" },
|
|
19
|
+
];
|
|
20
|
+
const issues: string[] = [];
|
|
21
|
+
const files = collectFiles(path.join(targetDir, targetPath), [".ts", ".tsx", ".js", ".jsx"]);
|
|
22
|
+
files.forEach((f) => {
|
|
23
|
+
const content = fs.readFileSync(f, "utf8");
|
|
24
|
+
const lines = content.split("\n");
|
|
25
|
+
lines.forEach((line, i) => {
|
|
26
|
+
scanRules.forEach((rule) => {
|
|
27
|
+
if (rule.pattern.test(line)) {
|
|
28
|
+
issues.push(`[${rule.severity}] ${rule.message} in ${path.relative(targetDir, f)}:${i + 1}`);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
if (issues.length === 0) {
|
|
34
|
+
console.warn("✅ No security issues detected.");
|
|
35
|
+
} else {
|
|
36
|
+
issues.forEach((issue) => console.warn(`⚠️ ${issue}`));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
|
|
3
|
+
import { getMemoryPath, getFrameworkDir } from "../utils/memory.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Print the current framework status.
|
|
7
|
+
*/
|
|
8
|
+
export function statusCommand() {
|
|
9
|
+
const memoryPath = getMemoryPath();
|
|
10
|
+
const frameworkDir = getFrameworkDir();
|
|
11
|
+
if (!fs.existsSync(memoryPath)) {
|
|
12
|
+
console.error(`❌ Error: ${frameworkDir}/PROJECT_MEMORY.md not found. Please run 'init' first.`);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const content = fs.readFileSync(memoryPath, "utf8");
|
|
17
|
+
|
|
18
|
+
// Format 1: Table Style (Original)
|
|
19
|
+
const tableMatch = content.match(
|
|
20
|
+
/\| Active Phase \| Profile \| Last Update \| Active Trace ID \| Blockers \|\n\| :----------- \| :------ \| :---------- \| :-------------- \| :------- \|\n\| (.*?) \| (.*?) \| (.*?) \| (.*?) \| (.*?) \|/,
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
// Format 2: List Style (New)
|
|
24
|
+
const phaseMatch = content.match(/- Phase: (.*)/);
|
|
25
|
+
const traceIdMatch = content.match(/- Trace ID: (.*)/);
|
|
26
|
+
const profileMatch = content.match(/- Profile: (.*)/);
|
|
27
|
+
const updateMatch = content.match(/- Last Update: (.*)/);
|
|
28
|
+
const blockersMatch = content.match(/- Blockers: (.*)/);
|
|
29
|
+
|
|
30
|
+
console.warn("\n📊 --- PROJECT STATUS ---");
|
|
31
|
+
|
|
32
|
+
if (tableMatch) {
|
|
33
|
+
console.warn(`🔹 Phase: ${tableMatch[1].trim()}`);
|
|
34
|
+
console.warn(`🧭 Profile: ${tableMatch[2].trim()}`);
|
|
35
|
+
console.warn(`📅 Update: ${tableMatch[3].trim()}`);
|
|
36
|
+
console.warn(`🆔 Trace ID: ${tableMatch[4].trim()}`);
|
|
37
|
+
console.warn(`⛔ Blockers: ${tableMatch[5].trim()}`);
|
|
38
|
+
} else if (phaseMatch || traceIdMatch) {
|
|
39
|
+
if (phaseMatch) console.warn(`🔹 Phase: ${phaseMatch[1].trim()}`);
|
|
40
|
+
if (profileMatch) console.warn(`🧭 Profile: ${profileMatch[1].trim()}`);
|
|
41
|
+
if (updateMatch) console.warn(`📅 Update: ${updateMatch[1].trim()}`);
|
|
42
|
+
if (traceIdMatch) console.warn(`🆔 Trace ID: ${traceIdMatch[1].trim()}`);
|
|
43
|
+
if (blockersMatch) console.warn(`⛔ Blockers: ${blockersMatch[1].trim()}`);
|
|
44
|
+
|
|
45
|
+
// Check for manager state in list style
|
|
46
|
+
const managerState = content.match(/- @manager state: (.*)/);
|
|
47
|
+
if (managerState) console.warn(`🤖 Manager: ${managerState[1].trim()}`);
|
|
48
|
+
} else {
|
|
49
|
+
console.warn("⚠️ Status data could not be parsed in standard formats.");
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const tasksSection = content.match(/## ACTIVE TASKS\n\n([\s\S]*?)(?=\n##|$)/);
|
|
53
|
+
if (tasksSection) {
|
|
54
|
+
console.warn("\n📋 Active Tasks:");
|
|
55
|
+
console.warn(tasksSection[1].trim());
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
console.warn("\n-----------------------\n");
|
|
59
|
+
}
|