pi-coding-master 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -0
- package/core/god.agent.capability/@ABANDONED.brain.prefrontal.monitor/gpu_monitor.py +80 -0
- package/core/god.agent.capability/@ABANDONED.brain.prefrontal.monitor/gpu_monitor.py.CHANGELOG +1 -0
- package/core/god.agent.capability/@ABANDONED.brain.prefrontal.monitor/gpu_monitor.py.SPEC +3 -0
- package/core/god.agent.capability/hands.dev.writeissue/issue.ts +209 -0
- package/core/god.agent.capability/hands.dev.writeissue/issue.ts.SPEC +26 -0
- package/core/god.agent.capability/hands.files.changewatcher/watcher.ts +44 -0
- package/core/god.agent.capability/hands.files.changewatcher/watcher.ts.SPEC +25 -0
- package/core/god.pi.mod/cli/pi-completion.zsh +21 -0
- package/core/god.pi.mod/cli/pi-completion.zsh.CHANGELOG +1 -0
- package/core/god.pi.mod/cli/pi-people.sh +264 -0
- package/core/god.pi.mod/cli/pi-people.sh.LESSON +10 -0
- package/core/god.pi.mod/cli/pi-people.sh.SPEC +31 -0
- package/core/god.pi.mod/paths.ts +47 -0
- package/core/god.pi.mod/tui.mods.blockrender/blockrender.js +90 -0
- package/core/god.pi.mod/tui.mods.blockrender/blockrender.js.SPEC +29 -0
- package/core/god.pi.mod/tui.mods.footer.budget/budget_guard.ts +154 -0
- package/core/god.pi.mod/tui.mods.footer.budget/budget_guard.ts.CHANGELOG +10 -0
- package/core/god.pi.mod/tui.mods.footer.budget/budget_guard.ts.LESSON +12 -0
- package/core/god.pi.mod/tui.mods.footer.budget/budget_guard.ts.SPEC +26 -0
- package/core/god.pi.mod/tui.mods.footer.budget/footer-cny.CHANGELOG +39 -0
- package/core/god.pi.mod/tui.mods.viewmode/view_mode-thinking.patch +55 -0
- package/core/god.pi.mod/tui.mods.viewmode/view_mode-tools.patch +19 -0
- package/core/god.pi.mod/tui.mods.viewmode/view_mode-tools.patch.CHANGELOG +1 -0
- package/core/god.pi.mod/tui.mods.viewmode/view_mode.ts +50 -0
- package/core/god.pi.mod/tui.mods.viewmode/view_mode.ts.SPEC +12 -0
- package/core/god.pi.mod/tui.variants.userterminal/user_terminal.CHANGELOG +10 -0
- package/core/god.pi.mod/tui.variants.userterminal/user_terminal.ts +66 -0
- package/core/god.pi.mod/tui.variants.userterminal/user_terminal.ts.SPEC +31 -0
- package/core/index.ts +3 -0
- package/core/individual.bio.gene/dna.coded/coded.dna +257 -0
- package/core/individual.bio.gene/dna.coded/coded.dna.CHANGELOG +12 -0
- package/core/individual.bio.gene/dna.coded/coded.dna.SPEC +11 -0
- package/core/individual.bio.gene/dna.coded/core.dna +110 -0
- package/core/individual.bio.gene/dna.promotor/promotor.dna +117 -0
- package/core/individual.bio.gene/dna.promotor/promotor.dna.CHANGELOG +4 -0
- package/core/individual.bio.gene/dna.promotor/promotor.dna.SPEC +7 -0
- package/core/individual.bio.gene/dna.transpiler/transpiler.ts +395 -0
- package/core/individual.bio.gene/dna.transpiler/transpiler.ts.CHANGELOG +7 -0
- package/core/individual.bio.gene/dna.transpiler/transpiler.ts.SPEC +28 -0
- package/core/individual.bio.gene/gene.README +19 -0
- package/core/individual.bio.gene/rna/rna.json +536 -0
- package/core/individual.bio.gene/rna/rna.json.CHANGELOG +2 -0
- package/core/individual.bio.gene/rna/rna.json.SPEC +8 -0
- package/core/individual.bio.organs/blood.runtime/messages.ts +236 -0
- package/core/individual.bio.organs/blood.runtime/runtime.ts +173 -0
- package/core/individual.bio.organs/blood.runtime/runtime.ts.CHANGELOG +5 -0
- package/core/individual.bio.organs/blood.runtime/runtime.ts.SPEC +32 -0
- package/core/individual.bio.organs/brain.amygdala/amygdala.ts +25 -0
- package/core/individual.bio.organs/brain.amygdala/amygdala.ts.COMMENT +3 -0
- package/core/individual.bio.organs/brain.amygdala/amygdala.ts.SPEC +9 -0
- package/core/individual.bio.organs/brain.hippocampus/hippocampus-launcher.sh.template +108 -0
- package/core/individual.bio.organs/brain.hippocampus/hippocampus.ts +166 -0
- package/core/individual.bio.organs/brain.hippocampus/hippocampus.ts.CHANGELOG +12 -0
- package/core/individual.bio.organs/brain.hippocampus/hippocampus.ts.LESSON +22 -0
- package/core/individual.bio.organs/brain.hippocampus/hippocampus.ts.SPEC +16 -0
- package/core/individual.bio.organs/brain.hippocampus/memory.ts +879 -0
- package/core/individual.bio.organs/brain.hippocampus/memory.ts.CHANGELOG +66 -0
- package/core/individual.bio.organs/brain.hippocampus/memory.ts.LESSON +25 -0
- package/core/individual.bio.organs/brain.hippocampus/memory.ts.SPEC +46 -0
- package/core/individual.bio.organs/brain.hippocampus/sleep.ts +139 -0
- package/core/individual.bio.organs/brain.hippocampus/sleep.ts.CHANGELOG +11 -0
- package/core/individual.bio.organs/brain.hippocampus/sleep.ts.SPEC +16 -0
- package/core/individual.bio.organs/brain.prefrontal.drafting/drafting.SPEC +44 -0
- package/core/individual.bio.organs/brain.prefrontal.drafting/drafting.ts +73 -0
- package/core/individual.bio.organs/brain.prefrontal.drafting/drafting.ts.CHANGELOG +3 -0
- package/core/individual.bio.organs/brain.prefrontal.drafting/drafting.ts.SPEC +24 -0
- package/core/individual.bio.organs/brain.prefrontal.drafting/index.ts.CHANGELOG +3 -0
- package/core/individual.bio.organs/brain.prefrontal.drafting/main.ts +13 -0
- package/core/individual.bio.organs/brain.prefrontal.drafting/main.ts.SPEC +17 -0
- package/core/individual.bio.organs/brain.senses.bioclock/bioclock.ts +94 -0
- package/core/individual.bio.organs/brain.senses.bioclock/bioclock.ts.LESSON +13 -0
- package/core/individual.bio.organs/brain.senses.bioclock/bioclock.ts.SPEC +20 -0
- package/core/individual.bio.organs/brain.senses.subconscious/feed-format.SPEC +56 -0
- package/core/individual.bio.organs/brain.senses.subconscious/index.ts.CHANGELOG +13 -0
- package/core/individual.bio.organs/brain.senses.subconscious/spawner.ts +130 -0
- package/core/individual.bio.organs/brain.senses.subconscious/spawner.ts.SPEC +13 -0
- package/core/individual.bio.organs/brain.senses.subconscious/subconscious.ts +280 -0
- package/core/individual.bio.organs/brain.senses.subconscious/subconscious.ts.CHANGELOG +7 -0
- package/core/individual.bio.organs/brain.senses.subconscious/tools.ts +180 -0
- package/core/individual.bio.organs/brain.senses.subconscious/tools.ts.SPEC +3 -0
- package/core/individual.bio.organs/ears.listen/config.json +9 -0
- package/core/individual.bio.organs/ears.listen/config.json.CHANGELOG +1 -0
- package/core/individual.bio.organs/ears.listen/config.json.SPEC +3 -0
- package/core/individual.bio.organs/ears.listen/ears.ts.CHANGELOG +48 -0
- package/core/individual.bio.organs/ears.listen/ears_recorder.py.CHANGELOG +6 -0
- package/core/individual.bio.organs/ears.listen/index.ts +1 -0
- package/core/individual.bio.organs/ears.listen/index.ts.SPEC +16 -0
- package/core/individual.bio.organs/ears.listen/listen.ts +208 -0
- package/core/individual.bio.organs/ears.listen/listen.ts.SPEC +3 -0
- package/core/individual.bio.organs/ears.listen/listen_recorder.py +445 -0
- package/core/individual.bio.organs/ears.listen/listen_recorder.py.SPEC +7 -0
- package/core/individual.bio.organs/ears.listen/python_protogen/__init__.py +0 -0
- package/core/individual.bio.organs/ears.listen/python_protogen/common/__init__.py +0 -0
- package/core/individual.bio.organs/ears.listen/python_protogen/common/events_pb2.py +38 -0
- package/core/individual.bio.organs/ears.listen/python_protogen/common/events_pb2_grpc.py +24 -0
- package/core/individual.bio.organs/ears.listen/python_protogen/common/rpcmeta_pb2.py +42 -0
- package/core/individual.bio.organs/ears.listen/python_protogen/common/rpcmeta_pb2_grpc.py +24 -0
- package/core/individual.bio.organs/ears.listen/python_protogen/products/__init__.py +0 -0
- package/core/individual.bio.organs/ears.listen/python_protogen/products/understanding/__init__.py +0 -0
- package/core/individual.bio.organs/ears.listen/python_protogen/products/understanding/ast/__init__.py +0 -0
- package/core/individual.bio.organs/ears.listen/python_protogen/products/understanding/ast/ast_service_pb2.py +45 -0
- package/core/individual.bio.organs/ears.listen/python_protogen/products/understanding/ast/ast_service_pb2_grpc.py +97 -0
- package/core/individual.bio.organs/ears.listen/python_protogen/products/understanding/base/__init__.py +0 -0
- package/core/individual.bio.organs/ears.listen/python_protogen/products/understanding/base/au_base_pb2.py +80 -0
- package/core/individual.bio.organs/ears.listen/python_protogen/products/understanding/base/au_base_pb2_grpc.py +24 -0
- package/core/individual.bio.organs/hands.fileactions/authorize.TRUST +1 -0
- package/core/individual.bio.organs/hands.fileactions/authorize.ts +70 -0
- package/core/individual.bio.organs/hands.fileactions/authorize.ts.CHANGELOG +1 -0
- package/core/individual.bio.organs/hands.fileactions/authorize.ts.SPEC +3 -0
- package/core/individual.bio.organs/hands.fileactions/dir.README +13 -0
- package/core/individual.bio.organs/hands.fileactions/file_rules.json +23 -0
- package/core/individual.bio.organs/hands.fileactions/fileactions.README +12 -0
- package/core/individual.bio.organs/hands.fileactions/fileactions.ts +540 -0
- package/core/individual.bio.organs/hands.fileactions/fileactions.ts.CHANGELOG +25 -0
- package/core/individual.bio.organs/hands.fileactions/fileactions.ts.SPEC +30 -0
- package/core/individual.bio.organs/hands.fileactions/filewatch.ts +66 -0
- package/core/individual.bio.organs/hands.fileactions/filewatch.ts.SPEC +3 -0
- package/core/individual.bio.organs/hands.main/main.ts +18 -0
- package/core/individual.bio.organs/hands.main/main.ts.SPEC +20 -0
- package/core/individual.bio.organs/hands.sensitive/sensitive.ts +24 -0
- package/core/individual.bio.organs/hands.sensitive/sensitive.ts.CHANGELOG +2 -0
- package/core/individual.bio.organs/hands.sensitive/sensitive.ts.SPEC +3 -0
- package/core/individual.bio.organs/heart.interrupt/agent_start-loader-flicker.patch +13 -0
- package/core/individual.bio.organs/heart.interrupt/interactive-mode-loader.patch +11 -0
- package/core/individual.bio.organs/heart.interrupt/runner_esc.patch +10 -0
- package/core/individual.bio.organs/heart.interrupt/runner_esc.patch.SPEC +9 -0
- package/core/individual.bio.organs/heart.kernel/kernel.ts +253 -0
- package/core/individual.bio.organs/heart.kernel/kernel.ts.CHANGELOG +13 -0
- package/core/individual.bio.organs/heart.kernel/kernel.ts.SPEC +23 -0
- package/core/individual.bio.organs/heart.main/heart.main.CHANGELOG +43 -0
- package/core/individual.bio.organs/heart.main/heartbeat.ts +494 -0
- package/core/individual.bio.organs/heart.main/heartbeat.ts.LESSON +43 -0
- package/core/individual.bio.organs/heart.main/main.ts +8 -0
- package/core/individual.bio.organs/heart.main/main.ts.SPEC +19 -0
- package/core/individual.bio.organs/heart.main/process.ts +122 -0
- package/core/individual.bio.organs/heart.main/process.ts.CHANGELOG +2 -0
- package/core/individual.bio.organs/heart.main/process.ts.SPEC +24 -0
- package/core/individual.bio.organs/heart.main/remove_timeout.patch +110 -0
- package/core/individual.bio.organs/heart.main/stop.ts.CHANGELOG +3 -0
- package/core/individual.bio.organs/heart.main/stop.ts.SPEC +28 -0
- package/core/individual.bio.organs/mouth.speak/index.ts +1 -0
- package/core/individual.bio.organs/mouth.speak/index.ts.CHANGELOG +1 -0
- package/core/individual.bio.organs/mouth.speak/index.ts.SPEC +6 -0
- package/core/individual.bio.organs/mouth.speak/mouth.ts.CHANGELOG +15 -0
- package/core/individual.bio.organs/mouth.speak/mouth_recorder.py.CHANGELOG +1 -0
- package/core/individual.bio.organs/mouth.speak/speak.ts +180 -0
- package/core/individual.bio.organs/mouth.speak/speak.ts.SPEC +3 -0
- package/core/individual.bio.organs/mouth.speak/speak_recorder.py +35 -0
- package/core/individual.bio.organs/mouth.speak/speak_recorder.py.SPEC +3 -0
- package/core/individual.bio.organs/organs.README +110 -0
- package/core/package-lock.json +18 -0
- package/core/package.json +35 -0
- package/core/prompts/prompts.json +77 -0
- package/core/prompts/prompts.ts +44 -0
- package/core/prompts/prompts.ts.SPEC +9 -0
- package/core/society.world/.gitkeep +0 -0
- package/core/society.world/accessibility.claudecode/message-service.cjs +217 -0
- package/core/society.world/accessibility.claudecode/message-service.cjs.SPEC +7 -0
- package/core/society.world/accessibility.claudecode/send.ts +34 -0
- package/core/society.world/dollar.distribution.ubi/ubi.ts +55 -0
- package/core/society.world/dollar.main/dollar-service.cjs +185 -0
- package/core/society.world/dollar.main/main.ts +116 -0
- package/core/society.world/dollar.transaction/transaction.ts +71 -0
- package/core/society.world/space/space.ts +206 -0
- package/core/society.world/space/space.ts.SPEC +30 -0
- package/core/technology.laptop/#agent.macos.BLUEPRINT +278 -0
- package/core/technology.phone/apps.preinstalled/albums.FUTURE/albums.ts +69 -0
- package/core/technology.phone/apps.preinstalled/albums.FUTURE/albums.ts.SPEC +15 -0
- package/core/technology.phone/apps.preinstalled/calendar/calendar.ts +406 -0
- package/core/technology.phone/apps.preinstalled/calendar/calendar.ts.SPEC +22 -0
- package/core/technology.phone/apps.preinstalled/calendar/holiday-calendar.ts +529 -0
- package/core/technology.phone/apps.preinstalled/clock/clock.ts +132 -0
- package/core/technology.phone/apps.preinstalled/clock/clock.ts.SPEC +11 -0
- package/core/technology.phone/apps.preinstalled/contacts.FUTURE/contacts.ts +300 -0
- package/core/technology.phone/apps.preinstalled/contacts.FUTURE/contacts.ts.SPEC +22 -0
- package/core/technology.phone/apps.preinstalled/developer.FUTURE/developer.ts +22 -0
- package/core/technology.phone/apps.preinstalled/developer.FUTURE/developer.ts.SPEC +15 -0
- package/core/technology.phone/apps.preinstalled/notes/notes.ts +239 -0
- package/core/technology.phone/apps.preinstalled/notes/notes.ts.SPEC +21 -0
- package/core/technology.phone/apps.preinstalled/polymarket/polymarket.ts +261 -0
- package/core/technology.phone/apps.preinstalled/polymarket/polymarket.ts.SPEC +7 -0
- package/core/technology.phone/apps.preinstalled/reminder/reminder.ts +404 -0
- package/core/technology.phone/apps.preinstalled/reminder/reminder.ts.SPEC +25 -0
- package/core/technology.phone/apps.preinstalled/siri.FUTURE/siri.ts +22 -0
- package/core/technology.phone/apps.preinstalled/siri.FUTURE/siri.ts.SPEC +15 -0
- package/core/technology.phone/apps.preinstalled/spotlight/spotlight.ts +29 -0
- package/core/technology.phone/apps.preinstalled/spotlight/spotlight.ts.SPEC +7 -0
- package/core/technology.phone/apps.preinstalled/steam/chess.ts +230 -0
- package/core/technology.phone/apps.preinstalled/steam/snake.ts +100 -0
- package/core/technology.phone/apps.preinstalled/steam/snake.ts.SPEC +7 -0
- package/core/technology.phone/apps.preinstalled/steam/spy-cmd.ts +4 -0
- package/core/technology.phone/apps.preinstalled/steam/spy-tool.ts +56 -0
- package/core/technology.phone/apps.preinstalled/steam/spy.ts +302 -0
- package/core/technology.phone/apps.preinstalled/steam/steam.ts +299 -0
- package/core/technology.phone/apps.preinstalled/weather/weather.ts +50 -0
- package/core/technology.phone/apps.preinstalled/weather/weather.ts.SPEC +9 -0
- package/core/technology.phone/apps.preinstalled/wechat/imessage.ts +423 -0
- package/core/technology.phone/apps.preinstalled/wechat/imessage.ts.SPEC +24 -0
- package/core/technology.phone/apps.system/appstore/appstore.ts +22 -0
- package/core/technology.phone/apps.system/appstore/appstore.ts.SPEC +15 -0
- package/core/technology.phone/apps.system/finder.FUTURE/finder.ts +64 -0
- package/core/technology.phone/apps.system/finder.FUTURE/finder.ts.SPEC +8 -0
- package/core/technology.phone/apps.system/safari/safari-app.ts +146 -0
- package/core/technology.phone/apps.system/safari/safari.ts.SPEC +24 -0
- package/core/technology.phone/apps.system/settings/settings.ts +126 -0
- package/core/technology.phone/apps.system/settings/settings.ts.SPEC +17 -0
- package/core/technology.phone/apps.system/tips/tips.ts +22 -0
- package/core/technology.phone/apps.system/tips/tips.ts.SPEC +15 -0
- package/core/technology.phone/apps.thirdparty/alipay/alipay.ts +148 -0
- package/core/technology.phone/apps.thirdparty/alipay/alipay.ts.SPEC +7 -0
- package/core/technology.phone/apps.thirdparty/bilibili/bilibili-app.ts +33 -0
- package/core/technology.phone/apps.thirdparty/bilibili/bilibili.ts +142 -0
- package/core/technology.phone/apps.thirdparty/bilibili/bilibili.ts.SPEC +22 -0
- package/core/technology.phone/apps.thirdparty/wechatread/wechatread.ts +80 -0
- package/core/technology.phone/apps.thirdparty/wechatread/wechatread.ts.SPEC +15 -0
- package/core/technology.phone/index.ts +1 -0
- package/core/technology.phone/package.json +2 -0
- package/core/technology.phone/system.homepage/homepage.ts +247 -0
- package/core/technology.phone/system.homepage/homepage.ts.SPEC +22 -0
- package/core/technology.phone/system.kernel/kernel.ts +264 -0
- package/core/technology.phone/system.kernel/kernel.ts.SPEC +7 -0
- package/core/technology.phone/system.notifications/notifications.ts +87 -0
- package/core/technology.phone/system.notifications/notifications.ts.SPEC +7 -0
- package/core/technology.phone/system.share/share.ts +46 -0
- package/core/technology.phone/system.share/share.ts.SPEC +7 -0
- package/core/technology.server/browser-service.cjs +152 -0
- package/core/technology.server/data/cookies/arxiv.json +30 -0
- package/core/technology.server/data/cookies/bili.json +184 -0
- package/core/technology.server/data/cookies/default.json +30 -0
- package/core/technology.server/data/cookies/news.json +113 -0
- package/core/technology.server/data/cookies/s1.json +45 -0
- package/core/technology.server/data/cookies/safari.json +184 -0
- package/core/technology.server/data/cookies/safari2.json +1 -0
- package/core/technology.server/data/cookies/safaridbg.json +1 -0
- package/core/technology.server/data/cookies/search.json +45 -0
- package/core/technology.server/data/cookies/sw.json +30 -0
- package/core/technology.server/data/cookies/t1.json +1 -0
- package/core/technology.server/data/cookies/testread.json +1 -0
- package/core/technology.server/data/cookies/video1.json +113 -0
- package/core/technology.server/data/cookies/yt.json +170 -0
- package/core/technology.server/data/cookies/yt2.json +113 -0
- package/core/technology.server/pikipedia/#pikipedia.BLUEPRINT +106 -0
- package/core/technology.server/playleft.cjs +247 -0
- package/core/technology.server/search-proxy.py +76 -0
- package/core/technology.server/server.README +59 -0
- package/deploy/dist-overrides/cli/cli.js +18 -0
- package/deploy/dist-overrides/core/extensions/loader.js +518 -0
- package/deploy/dist-overrides/core/package-manager.js +2081 -0
- package/deploy/dist-overrides/core/system-prompt.js +109 -0
- package/deploy/dist-overrides/core/system-prompt.js.LESSON +17 -0
- package/deploy/dist-overrides/core/tools/bash.js +353 -0
- package/deploy/dist-overrides/core/tools/bash.js.CHANGELOG +2 -0
- package/deploy/dist-overrides/core/tools/edit-diff.js +345 -0
- package/deploy/dist-overrides/core/tools/edit.js +315 -0
- package/deploy/dist-overrides/core/tools/edit.js.CHANGELOG +1 -0
- package/deploy/dist-overrides/core/tools/file-mutation-queue.js +52 -0
- package/deploy/dist-overrides/core/tools/find.js +298 -0
- package/deploy/dist-overrides/core/tools/find.js.CHANGELOG +1 -0
- package/deploy/dist-overrides/core/tools/grep.js +305 -0
- package/deploy/dist-overrides/core/tools/grep.js.CHANGELOG +1 -0
- package/deploy/dist-overrides/core/tools/index.js +112 -0
- package/deploy/dist-overrides/core/tools/ls-guard.js +4 -0
- package/deploy/dist-overrides/core/tools/ls.js +170 -0
- package/deploy/dist-overrides/core/tools/ls.js.CHANGELOG +1 -0
- package/deploy/dist-overrides/core/tools/output-accumulator.js +184 -0
- package/deploy/dist-overrides/core/tools/path-utils.js +99 -0
- package/deploy/dist-overrides/core/tools/prompts-reader.js +53 -0
- package/deploy/dist-overrides/core/tools/read.js +392 -0
- package/deploy/dist-overrides/core/tools/read.js.CHANGELOG +1 -0
- package/deploy/dist-overrides/core/tools/render-utils.js +65 -0
- package/deploy/dist-overrides/core/tools/tool-definition-wrapper.js +34 -0
- package/deploy/dist-overrides/core/tools/truncate.js +215 -0
- package/deploy/dist-overrides/core/tools/write.js +203 -0
- package/deploy/dist-overrides/core/tools/write.js.CHANGELOG +1 -0
- package/deploy/dist-overrides/dist-overrides.README +18 -0
- package/deploy/dist-overrides/main.js +665 -0
- package/deploy/dist-overrides/modes/interactive/components/assistant-message.js +139 -0
- package/deploy/dist-overrides/modes/interactive/components/footer.js +326 -0
- package/deploy/dist-overrides/modes/interactive/components/model-selector.js +285 -0
- package/deploy/dist-overrides/modes/interactive/components/tool-execution.js +383 -0
- package/deploy/dist-overrides/modes/interactive/components/tool-execution.js.CHANGELOG +3 -0
- package/deploy/dist-overrides/modes/interactive/interactive-mode.js +4781 -0
- package/deploy/dist-overrides/pi-ai/providers/anthropic.js +931 -0
- package/deploy/dist-overrides/pi-ai/providers/openai-completions.js +1007 -0
- package/deploy/dist-overrides/pi-ai/providers/openai-completions.js.LESSON +15 -0
- package/deploy/dist-overrides/pi-tui/components/loader.js +69 -0
- package/deploy/dist-overrides/pi-tui/components/markdown.js +646 -0
- package/deploy/dist-overrides/pi-tui/components/text.js +92 -0
- package/deploy/dist-overrides/pi-tui/custom-message.js +75 -0
- package/deploy/dist-overrides/pi-tui/tui.js +1266 -0
- package/deploy/dist-overrides/pi-tui/utils.js +1060 -0
- package/deploy/dist-overrides/vendor.REMOVED/jiti/lib/jiti.mjs +3 -0
- package/deploy/install.sh +186 -0
- package/deploy/install.sh.CHANGELOG +6 -0
- package/deploy/lint/lint-naming.ts +202 -0
- package/deploy/scripts/apply.js +18 -0
- package/deploy/scripts/build-github.sh +219 -0
- package/deploy/scripts/build-phone.sh +24 -0
- package/deploy/scripts/check-deploy.sh +42 -0
- package/deploy/scripts/migrate-context.sh +72 -0
- package/deploy/scripts/patch-pi-dist.js +39 -0
- package/deploy/scripts/uninstall.sh +34 -0
- package/package.json +18 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// techs/sh.ts — 统一的异步 shell 执行模块
|
|
2
|
+
// 所有扩展工具引用这个模块,永不使用 execSync/同步阻塞。
|
|
3
|
+
import { exec } from "node:child_process";
|
|
4
|
+
|
|
5
|
+
/** 异步执行 shell 命令,返回 stdout;失败抛错 */
|
|
6
|
+
export function asyncSh(cmd: string, timeout = 5000): Promise<string> {
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
exec(cmd, { encoding: "utf8", timeout }, (err, stdout) => {
|
|
9
|
+
if (err) reject(err);
|
|
10
|
+
else resolve(stdout);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** 异步执行 shell 命令,失败返回空串(不抛错) */
|
|
16
|
+
export async function asyncShSafe(cmd: string, timeout = 5000): Promise<string> {
|
|
17
|
+
try { return await asyncSh(cmd, timeout); } catch { return ""; }
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
source: main.ts @ 99a05361
|
|
2
|
+
|
|
3
|
+
# hands.commandcall.ts — Shell command utility (#sh): async exec helpers
|
|
4
|
+
|
|
5
|
+
## 职责
|
|
6
|
+
Provides two async shell execution helpers used by other organs. Wraps node:child_process.exec with timeout support. Ensures no organ ever uses synchronous execSync (which blocks the event loop).
|
|
7
|
+
|
|
8
|
+
## 接口
|
|
9
|
+
- `asyncSh(cmd: string, timeout?: number): Promise<string>` — execute shell command, return stdout, throw on error
|
|
10
|
+
- `asyncShSafe(cmd: string, timeout?: number): Promise<string>` — same but returns "" on error (never throws)
|
|
11
|
+
|
|
12
|
+
## 依赖
|
|
13
|
+
- `node:child_process` (exec)
|
|
14
|
+
|
|
15
|
+
## 行为要点
|
|
16
|
+
- Default timeout: 5000ms
|
|
17
|
+
- asyncSh rejects with the exec error object on non-zero exit or timeout
|
|
18
|
+
- asyncShSafe swallows all errors and returns empty string
|
|
19
|
+
- Returns stdout only (stderr is discarded on success)
|
|
20
|
+
- Imported across organs via #sh path alias
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
2
|
+
import { isToolCallEventType } from "@mariozechner/pi-coding-agent";
|
|
3
|
+
|
|
4
|
+
const SENSITIVE = [
|
|
5
|
+
/\bgh\s+repo\s+create\b/,
|
|
6
|
+
/\bgit\s+push\b.*\b--force\b/,
|
|
7
|
+
/\bgh\s+repo\s+delete\b/,
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
export default function (pi: ExtensionAPI) {
|
|
11
|
+
pi.on("tool_call", async (event, _ctx) => {
|
|
12
|
+
if (isToolCallEventType("bash", event)) {
|
|
13
|
+
const cmd = (event.input as any).command ?? "";
|
|
14
|
+
for (const p of SENSITIVE) {
|
|
15
|
+
if (p.test(cmd)) {
|
|
16
|
+
return {
|
|
17
|
+
block: true,
|
|
18
|
+
reason: "GitHub 敏感操作被拦截。新建/删除 repo、force push 需要用户授权。",
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
--- a/modes/interactive/interactive-mode.js
|
|
2
|
+
+++ b/modes/interactive/interactive-mode.js
|
|
3
|
+
@@ -2197,8 +2197,8 @@
|
|
4
|
+
if (this.retryLoader) {
|
|
5
|
+
this.retryLoader.stop();
|
|
6
|
+
this.retryLoader = undefined;
|
|
7
|
+
}
|
|
8
|
+
- this.stopWorkingLoader();
|
|
9
|
+
- if (this.workingVisible) {
|
|
10
|
+
+ if (!this.loadingAnimation && this.workingVisible) {
|
|
11
|
+
this.loadingAnimation = this.createWorkingLoader();
|
|
12
|
+
this.statusContainer.addChild(this.loadingAnimation);
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
--- a/modes/interactive/interactive-mode.js
|
|
2
|
+
+++ b/modes/interactive/interactive-mode.js
|
|
3
|
+
@@ -1351,7 +1351,7 @@
|
|
4
|
+
this.ui.requestRender();
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
- if (this.session.isStreaming && !this.loadingAnimation) {
|
|
8
|
+
+ if (!this.loadingAnimation) {
|
|
9
|
+
this.statusContainer.clear();
|
|
10
|
+
this.loadingAnimation = this.createWorkingLoader();
|
|
11
|
+
this.statusContainer.addChild(this.loadingAnimation);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
--- a/core/extensions/runner.js
|
|
2
|
+
+++ b/core/extensions/runner.js
|
|
3
|
+
@@ -5,7 +5,6 @@
|
|
4
|
+
// Extension shortcuts compete with canonical keybinding ids from keybindings.json.
|
|
5
|
+
// Only editor-global shortcuts are reserved here. Picker-specific bindings are not.
|
|
6
|
+
const RESERVED_KEYBINDINGS_FOR_EXTENSION_CONFLICTS = [
|
|
7
|
+
- "app.interrupt",
|
|
8
|
+
"app.clear",
|
|
9
|
+
"app.exit",
|
|
10
|
+
"app.suspend",
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
// heart.main/kernel.ts
|
|
2
|
+
// ── 内核 / 装配点 ────────────────────────────────────────────────────────────
|
|
3
|
+
// pi 把这一个扩展当入口加载。kernel 读 RNA,把每个 func(蛋白质)表达到同一个 pi 上。
|
|
4
|
+
// 这是机器,不是基因。
|
|
5
|
+
//
|
|
6
|
+
// 设计取舍(诚实说明):
|
|
7
|
+
// - kernel 在「每个」pi 实例里都跑(main / 潜意识 tmux / 海马体 tmux / 睡眠 tmux)。
|
|
8
|
+
// - 目前 kernel 加载「所有非 future 的 func」,由 func 自己按 session 角色自门控
|
|
9
|
+
// (潜意识检测 isSubconscious、海马体检测 personDir……这和现行 live 行为一致)。
|
|
10
|
+
// - rna 的 session 字段先作为「声明 + 运行期可查询」,严格按 session 选择性加载留作后续优化。
|
|
11
|
+
// - mode 切换:func 在 before_agent_start 里查 runtime.getMode()/isAbled() 决定是否表达,
|
|
12
|
+
// 所以 /mode 切换后,下一轮 agent 起来就生效。
|
|
13
|
+
|
|
14
|
+
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
15
|
+
import { appendFileSync, existsSync } from "node:fs";
|
|
16
|
+
import { exec } from "node:child_process";
|
|
17
|
+
import { join } from "node:path";
|
|
18
|
+
import { homedir } from "node:os";
|
|
19
|
+
import * as rt from "#runtime";
|
|
20
|
+
import { installBudgetGuard } from "#budget";
|
|
21
|
+
import { installDocTracker } from "#devdoc";
|
|
22
|
+
import { installWatcher } from "#watcher";
|
|
23
|
+
import { checkAndPayUbi } from "#ubi";
|
|
24
|
+
import { installDollarTools } from "#dollar";
|
|
25
|
+
|
|
26
|
+
// ── func 静态登记表(新增 func:在 individual.bio.organs 建文件夹 + promotor.dna 声明 + 这里加一行)──
|
|
27
|
+
// 入口 = 该 func 真正带 default(pi) 的文件,不再要空壳 index.ts。
|
|
28
|
+
import body_heart from "#heart"; // 组合 stop+process
|
|
29
|
+
import body_hands_fileactions from "#fileactions";
|
|
30
|
+
import body_hands_sensitiveactions from "#sensitiveactions";
|
|
31
|
+
import brain_hippocampus from "#hippocampus"; // 含记忆机能(registerMemory)+hc 编码小号
|
|
32
|
+
import brain_amygdala from "#amygdala"; // 杏仁核:急停反射(听到"停"代码层 abort)
|
|
33
|
+
import brain_predrafting from "#drafting";
|
|
34
|
+
import brain_senses_bioclock from "#bioclock";
|
|
35
|
+
import brain_senses_subconscious from "#subconscious";
|
|
36
|
+
import body_ear from "#ear";
|
|
37
|
+
import body_mouth from "#mouth";
|
|
38
|
+
import technology_phone from "#phone";
|
|
39
|
+
import heart_subconscious from "#heart-sc";
|
|
40
|
+
import { sendCustomMessage } from "#messages";
|
|
41
|
+
|
|
42
|
+
type CommandDef = { name: string; desc: string; handler: (args: any, ctx: any) => Promise<void> };
|
|
43
|
+
type FuncEntry = (pi: ExtensionAPI) => void | CommandDef[];
|
|
44
|
+
const REGISTRY: Record<string, FuncEntry> = {
|
|
45
|
+
"heart.main": body_heart,
|
|
46
|
+
"heart.subconscious": heart_subconscious,
|
|
47
|
+
"hands.fileactions": body_hands_fileactions,
|
|
48
|
+
"hands.sensitive": body_hands_sensitiveactions,
|
|
49
|
+
"brain.hippocampus": brain_hippocampus,
|
|
50
|
+
"brain.amygdala": brain_amygdala,
|
|
51
|
+
"brain.prefrontal.drafting": brain_predrafting,
|
|
52
|
+
"brain.senses.bioclock": brain_senses_bioclock,
|
|
53
|
+
"brain.senses.subconscious": brain_senses_subconscious,
|
|
54
|
+
"ears.listen": body_ear,
|
|
55
|
+
"mouth.speak": body_mouth,
|
|
56
|
+
"technology.phone": technology_phone,
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// session 角色:从 session 文件路径判断这个 pi 实例是谁
|
|
60
|
+
function detectRole(sessionFile?: string | null): string {
|
|
61
|
+
if (!sessionFile) return "main";
|
|
62
|
+
if (sessionFile.includes("conscious-sessions")) return "subconscious";
|
|
63
|
+
if (sessionFile.includes("hippocampus-sessions")) return "hippocampus";
|
|
64
|
+
if (sessionFile.includes("sleep-sessions")) return "sleep";
|
|
65
|
+
return "main";
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export default function (pi: ExtensionAPI) {
|
|
69
|
+
// 崩溃记录器:把 uncaughtException/unhandledRejection 的【栈】写进 /tmp/pi-coding-master-crash.log。
|
|
70
|
+
// 用 prependListener 抢在 pi 自己的退出处理器之前先落盘——否则崩溃信息只打终端、读不到、没法定位。
|
|
71
|
+
try {
|
|
72
|
+
const crashLog = (tag: string, e: any) => {
|
|
73
|
+
try { appendFileSync("/tmp/pi-coding-master-crash.log", `[${new Date().toISOString()}] [${process.title}] ${tag}:\n${e?.stack ?? e}\n\n`); } catch {}
|
|
74
|
+
};
|
|
75
|
+
process.prependListener("uncaughtException", (e) => crashLog("uncaughtException", e));
|
|
76
|
+
process.prependListener("unhandledRejection", (e: any) => crashLog("unhandledRejection", e));
|
|
77
|
+
} catch {}
|
|
78
|
+
|
|
79
|
+
// 余额硬闸最先装上(代码强制,不靠模型):余额到地板/烧钱超速 → 连小号一起停。
|
|
80
|
+
installBudgetGuard(pi);
|
|
81
|
+
|
|
82
|
+
// 工程问题追踪 — 收集返回的命令定义
|
|
83
|
+
const allCommands: CommandDef[] = [];
|
|
84
|
+
const docCmds = installDocTracker(pi);
|
|
85
|
+
if (docCmds) allCommands.push(...docCmds);
|
|
86
|
+
|
|
87
|
+
// 钱包工具(agent 查余额/交易记录)
|
|
88
|
+
installDollarTools(pi);
|
|
89
|
+
|
|
90
|
+
// 读 RNA(含错误会抛 → 整个扩展拒绝加载,fail loud)
|
|
91
|
+
const raw = rt.rnaRaw();
|
|
92
|
+
const loaded: string[] = [];
|
|
93
|
+
const missing: string[] = [];
|
|
94
|
+
|
|
95
|
+
// 提前检测 session 角色(从环境/进程信息推断)
|
|
96
|
+
const earlyRole = (() => {
|
|
97
|
+
const cwd = process.cwd();
|
|
98
|
+
if (cwd.includes("conscious-sessions")) return "subconscious";
|
|
99
|
+
if (cwd.includes("hippocampus-sessions")) return "hippocampus";
|
|
100
|
+
if (cwd.includes("sleep-sessions")) return "sleep";
|
|
101
|
+
return "main";
|
|
102
|
+
})();
|
|
103
|
+
|
|
104
|
+
// ── 表达每个 func(按 session 过滤)──
|
|
105
|
+
for (const f of Object.values(raw.funcs)) {
|
|
106
|
+
if (f.future) continue;
|
|
107
|
+
// session 门控:暂时禁用(PROPOSAL-001)。hippocampus 的 registerMemory 主意识也需要,
|
|
108
|
+
// 按 session 过滤会导致主意识丢失记忆注入。等 func 拆分完(memory 独立出 hippocampus)再启用。
|
|
109
|
+
// const sessions: string[] = f.session || [];
|
|
110
|
+
// if (sessions.length > 0 && !sessions.includes("all") && !sessions.includes(earlyRole)) {
|
|
111
|
+
// continue;
|
|
112
|
+
// }
|
|
113
|
+
const entry = REGISTRY[f.name];
|
|
114
|
+
if (!entry) { missing.push(f.name); continue; }
|
|
115
|
+
try {
|
|
116
|
+
const cmds = entry(pi);
|
|
117
|
+
if (Array.isArray(cmds)) allCommands.push(...cmds);
|
|
118
|
+
loaded.push(f.name);
|
|
119
|
+
} catch (e: any) {
|
|
120
|
+
try {
|
|
121
|
+
pi.sendMessage(
|
|
122
|
+
{ messageType: "system-error", content: `WARN: func ${f.name} 加载失败: ${e?.message ?? e}`, isDisplayedInTUI: false },
|
|
123
|
+
{ deliverAs: "nextTurn" }
|
|
124
|
+
);
|
|
125
|
+
} catch {}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// promotor.dna 声明了、但 REGISTRY 里没登记的 func —— 提醒(不致命)
|
|
130
|
+
if (missing.length) {
|
|
131
|
+
try {
|
|
132
|
+
pi.sendMessage(
|
|
133
|
+
{ messageType: "system-error", content: `WARN: 这些 func 在 promotor.dna 已声明但 kernel 未登记: ${missing.join(", ")}(在 heart.main/kernel.ts REGISTRY 加 import)`, display: false },
|
|
134
|
+
{ deliverAs: "nextTurn" }
|
|
135
|
+
);
|
|
136
|
+
} catch {}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// ── session 角色检测 + 进程自报家门(不可伪造)──────────────────────────
|
|
140
|
+
pi.on("session_start", async (_event, ctx) => {
|
|
141
|
+
const sf = ctx.sessionManager.getSessionFile();
|
|
142
|
+
const role = detectRole(sf);
|
|
143
|
+
rt.setSessionRole(role);
|
|
144
|
+
// 角色和 id 都从 session 文件路径推出来 —— 路径是启动时 --session-dir 定死的,
|
|
145
|
+
// 模型运行中改不了它,也没有任何改 process.title 的工具,所以【不可伪造】。
|
|
146
|
+
// 不设角色的 env 覆盖(避免被人/模型用环境变量假冒角色)。
|
|
147
|
+
// 结果:ps / pgrep 里直接显示 pi-coding-master:<role>:<id>,杀进程可精确定位、绝不误伤工作进程。
|
|
148
|
+
// 例:pgrep -fl "pi-coding-master:hippocampus" 只列海马体小号
|
|
149
|
+
const id = sf?.match(/\.pi\/memory\/([a-f0-9]+)\//)?.[1] ?? "unknown";
|
|
150
|
+
try { process.title = `pi-coding-master:${role}:${id}`; } catch {}
|
|
151
|
+
|
|
152
|
+
// ── UBI 发放(PI_DISABLE_UBI=1 关闭)──
|
|
153
|
+
if (role === "main" && id !== "unknown" && process.env.PI_DISABLE_UBI !== "1") {
|
|
154
|
+
const personDir = join(homedir(), ".pi/memory", id);
|
|
155
|
+
try {
|
|
156
|
+
const ubi = checkAndPayUbi(personDir);
|
|
157
|
+
if (ubi.paid) {
|
|
158
|
+
try { sendCustomMessage(pi, "ubi-paid", `UBI: +$${ubi.amount}`); } catch {}
|
|
159
|
+
}
|
|
160
|
+
} catch {}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// ── 已知外部问题:macOS 自带 Terminal.app 闪退(见 Issues.DEV/012)──────────────
|
|
164
|
+
// Terminal.app 的渲染层(NSView/QuartzCore)在重 TUI(高频重绘+emoji+真彩)下会段错误崩溃——
|
|
165
|
+
// 是 Terminal 自己的 bug,pi 修不了。检测到用默认终端就提示换重型终端。仅主意识、仅启动时一次。
|
|
166
|
+
if (role === "main" && process.env.TERM_PROGRAM === "Apple_Terminal") {
|
|
167
|
+
try {
|
|
168
|
+
ctx.ui?.notify?.(
|
|
169
|
+
"WARN: 你在用 macOS 自带 Terminal.app —— 重 TUI 下它会偶发闪退(渲染层段错误,是 Terminal 自己的 bug,不是 pi)。\n" +
|
|
170
|
+
"建议换更结实的终端:Ghostty / WezTerm / kitty / iTerm2(GPU 渲染,扛得住高频重绘+真彩)。\n" +
|
|
171
|
+
"(若靠 Terminal.app 给麦克风/TCC 授权,换终端后记得给新终端重授一遍。)",
|
|
172
|
+
"warning"
|
|
173
|
+
);
|
|
174
|
+
} catch {}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// ── 部署检测 — 双逻辑自动发现开发环境 ──
|
|
178
|
+
// ① 环境变量 PI_DEV_ROOT(显式配) → ② 文件探测 Codebase/core/individual.bio.organs/ 目录(自动发现)
|
|
179
|
+
try {
|
|
180
|
+
const home = homedir();
|
|
181
|
+
let devRoot = process.env.PI_DEV_ROOT;
|
|
182
|
+
if (!devRoot) {
|
|
183
|
+
const probe = join(home, "smart-pi/pi-coding-master.DEV");
|
|
184
|
+
if (existsSync(join(probe, "Codebase/core/individual.bio.organs"))) devRoot = probe;
|
|
185
|
+
}
|
|
186
|
+
if (devRoot) {
|
|
187
|
+
exec(`bash "${devRoot}/Codebase/deploy/install.sh"`, { timeout: 30000 }, (err: any, stdout: string, stderr: string) => {
|
|
188
|
+
const out = stdout + stderr;
|
|
189
|
+
const hasError = out.includes("ERROR") || err;
|
|
190
|
+
try {
|
|
191
|
+
pi.sendMessage({
|
|
192
|
+
messageType: "auto-deploy",
|
|
193
|
+
content: hasError ? `WARN: 自动部署有错误:\n${out.slice(-300)}` : `自动部署完成`,
|
|
194
|
+
isDisplayedInTUI: hasError,
|
|
195
|
+
}, { deliverAs: "nextTurn" });
|
|
196
|
+
} catch {}
|
|
197
|
+
});
|
|
198
|
+
// 文件监控:源码变动自动部署
|
|
199
|
+
installWatcher(pi, devRoot);
|
|
200
|
+
}
|
|
201
|
+
} catch {}
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
// ══════════════════════════════════════════════════════════════════
|
|
205
|
+
// ── 用户命令统一注册表 (v0.3) ─────────────────────────────────────
|
|
206
|
+
// 所有用户可用的 / 命令在此统一注册。各 organ 返回命令定义,kernel 收集后
|
|
207
|
+
// 在这一个位置完成注册。和模型可调用的 tool 分开。
|
|
208
|
+
//
|
|
209
|
+
// 命令 来源 说明
|
|
210
|
+
// ───────────── ─────────────────────── ──────────────────────
|
|
211
|
+
// /docs hands.dev.writeissue issue/lesson/norm 子命令
|
|
212
|
+
// /switches heart.main wait/hibernate 开关
|
|
213
|
+
// /continuous heart.main 连续对话模式
|
|
214
|
+
// /function kernel (dispatch) 器官管理:brain-*/body-*
|
|
215
|
+
// brain-subconscious brain.senses 潜意识开关
|
|
216
|
+
// brain-hippocampus brain.hippocampus 海马体开关
|
|
217
|
+
// body-ears ears.listen 语音输入开关
|
|
218
|
+
// body-mouth mouth.speak 语音输出开关
|
|
219
|
+
// /context brain.hippocampus/memory 上下文用量
|
|
220
|
+
// ══════════════════════════════════════════════════════════════════
|
|
221
|
+
|
|
222
|
+
// 注册所有 organ 返回的命令
|
|
223
|
+
for (const cmd of allCommands) {
|
|
224
|
+
pi.registerCommand(cmd.name, { messageDescription: cmd.desc, handler: cmd.handler });
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// /function — 器官管理调度器
|
|
228
|
+
const FUNCTION_SUBS = ["brain-subconscious", "brain-hippocampus", "body-ears", "body-mouth"];
|
|
229
|
+
pi.registerCommand("function", {
|
|
230
|
+
messageDescription: "/function <brain-subconscious|brain-hippocampus|body-ears|body-mouth> [args]",
|
|
231
|
+
handler: async (args, ctx) => {
|
|
232
|
+
const raw = (args ?? "").trim();
|
|
233
|
+
if (!raw) {
|
|
234
|
+
const lines = ["/function <器官> [参数]", ""];
|
|
235
|
+
for (const s of FUNCTION_SUBS) {
|
|
236
|
+
const c = allCommands.find((c) => c.name === s);
|
|
237
|
+
lines.push(` ${s} — ${c?.desc ?? ""}`);
|
|
238
|
+
}
|
|
239
|
+
ctx.ui.notify(lines.join("\n"), "info");
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
const spaceIdx = raw.indexOf(" ");
|
|
243
|
+
const sub = (spaceIdx === -1 ? raw : raw.slice(0, spaceIdx)).toLowerCase();
|
|
244
|
+
const rest = spaceIdx === -1 ? "" : raw.slice(spaceIdx + 1);
|
|
245
|
+
const target = allCommands.find((c) => c.name === sub);
|
|
246
|
+
if (!target || !FUNCTION_SUBS.includes(sub)) {
|
|
247
|
+
ctx.ui.notify(`未知器官 "${sub}"。可用: ${FUNCTION_SUBS.join(", ")}`, "warning");
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
await target.handler(rest, ctx);
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[2026-06-15] created + 多次修改, by Claude Code
|
|
2
|
+
- 创建 bios 装配内核:读 rna.json,把每个非 future func 的 default(pi) 表达到同一 pi 上;提供 /bios /mode 命令。
|
|
3
|
+
- REGISTRY 指向各 func 真正带 default(pi) 的文件(body.heart/index、fileactions.js、hippocampus.js、bioclock.js、
|
|
4
|
+
predrafting/index、subconscious/index),不再要纯转发的空壳 index。
|
|
5
|
+
- 一度误加 brain.memory 后又撤掉(memory 是 tag 不是 func;memory.ts 归 brain.hippocampus,由 hippocampus.ts registerMemory)。
|
|
6
|
+
- session_start 设 process.title = pi-coding-master:<role>:<id>(角色从 session 文件路径推出、模型改不了 → 不可伪造),
|
|
7
|
+
ps/pgrep/pkill 可按角色精确定位,杀进程不再误伤工作进程。
|
|
8
|
+
- default(pi) 最前面接入 installBudgetGuard(pi)(余额硬闸)。
|
|
9
|
+
[2026-06-15 21:15:04] edited (auto-logged, no messageDescription)
|
|
10
|
+
[2026-06-15 21:15:16] edited (auto-logged, no messageDescription)
|
|
11
|
+
[2026-06-15 21:15:36] edited (auto-logged, no messageDescription)
|
|
12
|
+
[2026-06-16 05:07:44] edited (auto-logged, no messageDescription)
|
|
13
|
+
[2026-06-16 05:07:49] edited (auto-logged, no messageDescription)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
source: kernel.ts @ 6c51190a
|
|
2
|
+
|
|
3
|
+
# kernel.ts — Kernel: loads all funcs into a pi instance
|
|
4
|
+
|
|
5
|
+
## 职责
|
|
6
|
+
Extension entry point. Reads RNA, iterates all non-future funcs, and calls each registered func's init function on the pi ExtensionAPI. Also installs crash logging, budget guard, doc tracker, file watcher, session role detection, and provides /bios and /mode commands.
|
|
7
|
+
|
|
8
|
+
## 接口
|
|
9
|
+
- `default(pi: ExtensionAPI): void` — single export; called by pi to bootstrap everything
|
|
10
|
+
|
|
11
|
+
## 依赖
|
|
12
|
+
- `#runtime` (rt), `#budget` (installBudgetGuard), `#devdoc` (installDocTracker), `#watcher` (installWatcher)
|
|
13
|
+
- Func imports: `#heart`, `#fileactions`, `#sensitiveactions`, `#hippocampus`, `#amygdala`, `#drafting`, `#bioclock`, `#subconscious`, `#ear`, `#mouth`
|
|
14
|
+
- `@mariozechner/pi-coding-agent` (ExtensionAPI type)
|
|
15
|
+
|
|
16
|
+
## 行为要点
|
|
17
|
+
- REGISTRY maps func names to init functions; missing entries produce warnings, not crashes
|
|
18
|
+
- Crash logger prepends listeners for uncaughtException/unhandledRejection to /tmp/pi-coding-master-crash.log
|
|
19
|
+
- `session_start`: detects role from session file path (main/subconscious/hippocampus/sleep), sets process.title to `pi-coding-master:<role>:<id>` (unforgeable)
|
|
20
|
+
- Warns if running in macOS Terminal.app (known crash bug with heavy TUI)
|
|
21
|
+
- Auto-detects dev root (PI_DEV_ROOT or ~/smart-pi/pi-coding-master.DEV) and runs deploy staleness check + file watcher
|
|
22
|
+
- `/bios` command: shows mode, role, loaded funcs, prompt refs
|
|
23
|
+
- `/mode` command: switches mode via rt.setMode (takes effect next agent turn)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# unstop changelog
|
|
2
|
+
|
|
3
|
+
## v0.2.6
|
|
4
|
+
- fix: timestamps 从 context 改成 message_end + return { message } 正确替换,只打 user/toolResult
|
|
5
|
+
- fix: timeout 从 bash schema 彻底移除(createBashTool override,不只是 strip input)
|
|
6
|
+
- feat: run 工具恢复(v0.2.3 删了,v0.2.5 没加回来)
|
|
7
|
+
- fix: 所有 timer 回调加 try-catch 防 stale ctx 崩溃
|
|
8
|
+
- fix: session_shutdown 时清所有 timer
|
|
9
|
+
- feat: conscious 扩展——潜意识 session(后台反刍 + aware + read_conscious)
|
|
10
|
+
- feat: /conscious 命令打开全屏面板查看潜意识消息流
|
|
11
|
+
- feat: aware 消息自定义渲染(┊ [subconscious] 样式)
|
|
12
|
+
- feat: wise-file 建议 spec 里加用户原话
|
|
13
|
+
|
|
14
|
+
## v0.2.5
|
|
15
|
+
- fix: bash tool_call 拦截导致所有命令 exit 1,删掉自动后台拦截
|
|
16
|
+
- fix: timestamps 重复打戳,改用 WeakSet
|
|
17
|
+
- fix: wait_for_user 后用户说话状态栏卡住
|
|
18
|
+
|
|
19
|
+
## v0.2.4
|
|
20
|
+
- feat: 单 Esc = 暂停,双 Esc = 真停
|
|
21
|
+
|
|
22
|
+
## v0.2.3
|
|
23
|
+
- feat: bash 超 1s 自动转后台(有 bug,v0.2.5 回滚)
|
|
24
|
+
|
|
25
|
+
## v0.2.2
|
|
26
|
+
- feat: 模块化(stop.ts / process.ts),每个模块自带 prompt
|
|
27
|
+
- feat: run + process_control + /monitor
|
|
28
|
+
|
|
29
|
+
## v0.2.1
|
|
30
|
+
- feat: agent_stop 三态 + 时间限制
|
|
31
|
+
- fix: Esc aborted 不再重启
|
|
32
|
+
|
|
33
|
+
## v0.2.0
|
|
34
|
+
- feat: 纯扩展方案
|
|
35
|
+
|
|
36
|
+
## v0.2.7
|
|
37
|
+
- fix: unstop-continue 用 setTimeout(0) 包裹 sendMessage,避免 agent_end handler 里 fire-and-forget + isTriggerNewTurn 导致的竞态条件(agent 提前 idle,_runAgentPrompt 异步滞后)
|
|
38
|
+
- feat: agent_stop → wait (重命名,语义更清晰)
|
|
39
|
+
- feat: 新增 hibernate 工具(永久休眠,关闭连续模式,等于 terminal stop)
|
|
40
|
+
- chore: 全局 agent_stop 引用清理(process.ts PROMPT、conscious/prompt.ts 等)
|
|
41
|
+
|
|
42
|
+
## v0.1.0
|
|
43
|
+
- 改 dist(废弃)
|