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,113 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "__Secure-ROLLOUT_TOKEN",
|
|
4
|
+
"value": "CPPx7rOq7fitHRDLmoeH6ZeVAxiBirqH6ZeVAw%3D%3D",
|
|
5
|
+
"domain": ".youtube.com",
|
|
6
|
+
"path": "/",
|
|
7
|
+
"expires": 1797579312.22299,
|
|
8
|
+
"size": 66,
|
|
9
|
+
"httpOnly": true,
|
|
10
|
+
"secure": true,
|
|
11
|
+
"session": false,
|
|
12
|
+
"sameSite": "None",
|
|
13
|
+
"priority": "Medium",
|
|
14
|
+
"sourceScheme": "Secure",
|
|
15
|
+
"sourcePort": 443,
|
|
16
|
+
"partitionKey": {
|
|
17
|
+
"topLevelSite": "https://youtube.com",
|
|
18
|
+
"hasCrossSiteAncestor": false
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "VISITOR_PRIVACY_METADATA",
|
|
23
|
+
"value": "CgJTRxIEGgAgMw%3D%3D",
|
|
24
|
+
"domain": ".youtube.com",
|
|
25
|
+
"path": "/",
|
|
26
|
+
"expires": 1797579367.260215,
|
|
27
|
+
"size": 44,
|
|
28
|
+
"httpOnly": true,
|
|
29
|
+
"secure": true,
|
|
30
|
+
"session": false,
|
|
31
|
+
"sameSite": "None",
|
|
32
|
+
"priority": "Medium",
|
|
33
|
+
"sourceScheme": "Secure",
|
|
34
|
+
"sourcePort": 443
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "YSC",
|
|
38
|
+
"value": "Kus3MEsoOp0",
|
|
39
|
+
"domain": ".youtube.com",
|
|
40
|
+
"path": "/",
|
|
41
|
+
"expires": -1,
|
|
42
|
+
"size": 14,
|
|
43
|
+
"httpOnly": true,
|
|
44
|
+
"secure": true,
|
|
45
|
+
"session": true,
|
|
46
|
+
"sameSite": "None",
|
|
47
|
+
"priority": "Medium",
|
|
48
|
+
"sourceScheme": "Secure",
|
|
49
|
+
"sourcePort": 443
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "VISITOR_INFO1_LIVE",
|
|
53
|
+
"value": "PznwXvwhq0o",
|
|
54
|
+
"domain": ".youtube.com",
|
|
55
|
+
"path": "/",
|
|
56
|
+
"expires": 1797579367.260121,
|
|
57
|
+
"size": 29,
|
|
58
|
+
"httpOnly": true,
|
|
59
|
+
"secure": true,
|
|
60
|
+
"session": false,
|
|
61
|
+
"sameSite": "None",
|
|
62
|
+
"priority": "Medium",
|
|
63
|
+
"sourceScheme": "Secure",
|
|
64
|
+
"sourcePort": 443
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "__Secure-YNID",
|
|
68
|
+
"value": "19.YT=dla_2GUKmWblHwF1UrFCgl_vQT_QAN-5vHkQVw7D6yuNRTSOGmUDc58EydXUFsAqRgAQBo9oDrY0zuL6qZqhNqXyQWUvkOhsH6fhy35ZKIfnOj5Nla41y8ae-bo95r36xzzM03n2cOcI_xDvdoC6YJeWSgTZJ8n9KNJd2cuCxvbemZC637fbdnEITkYBEpyg4R9l1aRNeKwR2sKa53gG4O95hM7qeUsLA-ZaWgxClGCt2Y35EruWqrpxahHA3zmiZM7fh3wf6l6-gDJG-3W6nws_EKbxaFhxoEBkGvpG5DhYuFbHImzdUk5qion-hQmLyyh_w0nsDwgWdhfevbjtrA",
|
|
69
|
+
"domain": ".youtube.com",
|
|
70
|
+
"path": "/",
|
|
71
|
+
"expires": 1797579311.222924,
|
|
72
|
+
"size": 361,
|
|
73
|
+
"httpOnly": true,
|
|
74
|
+
"secure": true,
|
|
75
|
+
"session": false,
|
|
76
|
+
"sameSite": "None",
|
|
77
|
+
"priority": "Medium",
|
|
78
|
+
"sourceScheme": "Secure",
|
|
79
|
+
"sourcePort": 443,
|
|
80
|
+
"partitionKey": {
|
|
81
|
+
"topLevelSite": "https://youtube.com",
|
|
82
|
+
"hasCrossSiteAncestor": false
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "PREF",
|
|
87
|
+
"value": "tz=Asia.Shanghai",
|
|
88
|
+
"domain": ".youtube.com",
|
|
89
|
+
"path": "/",
|
|
90
|
+
"expires": 1816587368.431224,
|
|
91
|
+
"size": 20,
|
|
92
|
+
"httpOnly": false,
|
|
93
|
+
"secure": true,
|
|
94
|
+
"session": false,
|
|
95
|
+
"priority": "Medium",
|
|
96
|
+
"sourceScheme": "Secure",
|
|
97
|
+
"sourcePort": 443
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"name": "GPS",
|
|
101
|
+
"value": "1",
|
|
102
|
+
"domain": ".youtube.com",
|
|
103
|
+
"path": "/",
|
|
104
|
+
"expires": 1782029111.464525,
|
|
105
|
+
"size": 4,
|
|
106
|
+
"httpOnly": true,
|
|
107
|
+
"secure": true,
|
|
108
|
+
"session": false,
|
|
109
|
+
"priority": "Medium",
|
|
110
|
+
"sourceScheme": "Secure",
|
|
111
|
+
"sourcePort": 443
|
|
112
|
+
}
|
|
113
|
+
]
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "GPS",
|
|
4
|
+
"value": "1",
|
|
5
|
+
"domain": ".youtube.com",
|
|
6
|
+
"path": "/",
|
|
7
|
+
"expires": 1782029111.464525,
|
|
8
|
+
"size": 4,
|
|
9
|
+
"httpOnly": true,
|
|
10
|
+
"secure": true,
|
|
11
|
+
"session": false,
|
|
12
|
+
"priority": "Medium",
|
|
13
|
+
"sourceScheme": "Secure",
|
|
14
|
+
"sourcePort": 443
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "VISITOR_PRIVACY_METADATA",
|
|
18
|
+
"value": "CgJTRxIEGgAgMw%3D%3D",
|
|
19
|
+
"domain": ".youtube.com",
|
|
20
|
+
"path": "/",
|
|
21
|
+
"expires": 1797579311.464639,
|
|
22
|
+
"size": 44,
|
|
23
|
+
"httpOnly": true,
|
|
24
|
+
"secure": true,
|
|
25
|
+
"session": false,
|
|
26
|
+
"sameSite": "None",
|
|
27
|
+
"priority": "Medium",
|
|
28
|
+
"sourceScheme": "Secure",
|
|
29
|
+
"sourcePort": 443
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "NID",
|
|
33
|
+
"value": "532=HzC262u5pSj-5X09A2WW9DwYZ-GBBqEg2uFAGmyYJwFNp5sBHVss7m3TZc-EfcmpJC1UZgst5wU8I4FyxQCdZDSeciGNxOiq3grFEOxQRLMjUiGL5ZtIkcKhSXLoo0JlaRsQ8BPFJGP1h7Ln5E9k2QQtPa7x4U6mQW_vNqhmFaJvLmktlFW88jrgRDzyu4HsHljdvGI",
|
|
34
|
+
"domain": ".google.com",
|
|
35
|
+
"path": "/",
|
|
36
|
+
"expires": 1797721308.868311,
|
|
37
|
+
"size": 206,
|
|
38
|
+
"httpOnly": true,
|
|
39
|
+
"secure": false,
|
|
40
|
+
"session": false,
|
|
41
|
+
"priority": "Medium",
|
|
42
|
+
"sourceScheme": "Secure",
|
|
43
|
+
"sourcePort": 443
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "VISITOR_INFO1_LIVE",
|
|
47
|
+
"value": "PznwXvwhq0o",
|
|
48
|
+
"domain": ".youtube.com",
|
|
49
|
+
"path": "/",
|
|
50
|
+
"expires": 1797579311.464598,
|
|
51
|
+
"size": 29,
|
|
52
|
+
"httpOnly": true,
|
|
53
|
+
"secure": true,
|
|
54
|
+
"session": false,
|
|
55
|
+
"sameSite": "None",
|
|
56
|
+
"priority": "Medium",
|
|
57
|
+
"sourceScheme": "Secure",
|
|
58
|
+
"sourcePort": 443
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "AEC",
|
|
62
|
+
"value": "AdJVEatTxeeX1LyEZIEACJAhNW8QZR7KMSmRjsjUFo-o6ibpwbsCDqdlHg",
|
|
63
|
+
"domain": ".google.com",
|
|
64
|
+
"path": "/",
|
|
65
|
+
"expires": 1797462596.143645,
|
|
66
|
+
"size": 61,
|
|
67
|
+
"httpOnly": true,
|
|
68
|
+
"secure": true,
|
|
69
|
+
"session": false,
|
|
70
|
+
"sameSite": "Lax",
|
|
71
|
+
"priority": "Medium",
|
|
72
|
+
"sourceScheme": "Secure",
|
|
73
|
+
"sourcePort": 443
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "__Secure-ROLLOUT_TOKEN",
|
|
77
|
+
"value": "CPPx7rOq7fitHRDLmoeH6ZeVAxiBirqH6ZeVAw%3D%3D",
|
|
78
|
+
"domain": ".youtube.com",
|
|
79
|
+
"path": "/",
|
|
80
|
+
"expires": 1797579312.22299,
|
|
81
|
+
"size": 66,
|
|
82
|
+
"httpOnly": true,
|
|
83
|
+
"secure": true,
|
|
84
|
+
"session": false,
|
|
85
|
+
"sameSite": "None",
|
|
86
|
+
"priority": "Medium",
|
|
87
|
+
"sourceScheme": "Secure",
|
|
88
|
+
"sourcePort": 443,
|
|
89
|
+
"partitionKey": {
|
|
90
|
+
"topLevelSite": "https://youtube.com",
|
|
91
|
+
"hasCrossSiteAncestor": false
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "PREF",
|
|
96
|
+
"value": "tz=Asia.Shanghai",
|
|
97
|
+
"domain": ".youtube.com",
|
|
98
|
+
"path": "/",
|
|
99
|
+
"expires": 1816587313.249858,
|
|
100
|
+
"size": 20,
|
|
101
|
+
"httpOnly": false,
|
|
102
|
+
"secure": true,
|
|
103
|
+
"session": false,
|
|
104
|
+
"priority": "Medium",
|
|
105
|
+
"sourceScheme": "Secure",
|
|
106
|
+
"sourcePort": 443
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "__Host-GAPS",
|
|
110
|
+
"value": "1:Xj1ZpR7JPfc-fAc5V6HDltp9wjchpA:-vv27BsVQswB95hw",
|
|
111
|
+
"domain": "accounts.google.com",
|
|
112
|
+
"path": "/",
|
|
113
|
+
"expires": 1816472270.447725,
|
|
114
|
+
"size": 60,
|
|
115
|
+
"httpOnly": true,
|
|
116
|
+
"secure": true,
|
|
117
|
+
"session": false,
|
|
118
|
+
"priority": "High",
|
|
119
|
+
"sourceScheme": "Secure",
|
|
120
|
+
"sourcePort": 443
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "YSC",
|
|
124
|
+
"value": "Kus3MEsoOp0",
|
|
125
|
+
"domain": ".youtube.com",
|
|
126
|
+
"path": "/",
|
|
127
|
+
"expires": -1,
|
|
128
|
+
"size": 14,
|
|
129
|
+
"httpOnly": true,
|
|
130
|
+
"secure": true,
|
|
131
|
+
"session": true,
|
|
132
|
+
"sameSite": "None",
|
|
133
|
+
"priority": "Medium",
|
|
134
|
+
"sourceScheme": "Secure",
|
|
135
|
+
"sourcePort": 443
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"name": "__Secure-BUCKET",
|
|
139
|
+
"value": "CIgB",
|
|
140
|
+
"domain": ".google.com",
|
|
141
|
+
"path": "/",
|
|
142
|
+
"expires": 1797462596.143969,
|
|
143
|
+
"size": 19,
|
|
144
|
+
"httpOnly": true,
|
|
145
|
+
"secure": true,
|
|
146
|
+
"session": false,
|
|
147
|
+
"priority": "Medium",
|
|
148
|
+
"sourceScheme": "Secure",
|
|
149
|
+
"sourcePort": 443
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"name": "__Secure-YNID",
|
|
153
|
+
"value": "19.YT=dla_2GUKmWblHwF1UrFCgl_vQT_QAN-5vHkQVw7D6yuNRTSOGmUDc58EydXUFsAqRgAQBo9oDrY0zuL6qZqhNqXyQWUvkOhsH6fhy35ZKIfnOj5Nla41y8ae-bo95r36xzzM03n2cOcI_xDvdoC6YJeWSgTZJ8n9KNJd2cuCxvbemZC637fbdnEITkYBEpyg4R9l1aRNeKwR2sKa53gG4O95hM7qeUsLA-ZaWgxClGCt2Y35EruWqrpxahHA3zmiZM7fh3wf6l6-gDJG-3W6nws_EKbxaFhxoEBkGvpG5DhYuFbHImzdUk5qion-hQmLyyh_w0nsDwgWdhfevbjtrA",
|
|
154
|
+
"domain": ".youtube.com",
|
|
155
|
+
"path": "/",
|
|
156
|
+
"expires": 1797579311.222924,
|
|
157
|
+
"size": 361,
|
|
158
|
+
"httpOnly": true,
|
|
159
|
+
"secure": true,
|
|
160
|
+
"session": false,
|
|
161
|
+
"sameSite": "None",
|
|
162
|
+
"priority": "Medium",
|
|
163
|
+
"sourceScheme": "Secure",
|
|
164
|
+
"sourcePort": 443,
|
|
165
|
+
"partitionKey": {
|
|
166
|
+
"topLevelSite": "https://youtube.com",
|
|
167
|
+
"hasCrossSiteAncestor": false
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
]
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "VISITOR_INFO1_LIVE",
|
|
4
|
+
"value": "PznwXvwhq0o",
|
|
5
|
+
"domain": ".youtube.com",
|
|
6
|
+
"path": "/",
|
|
7
|
+
"expires": 1797579326.991695,
|
|
8
|
+
"size": 29,
|
|
9
|
+
"httpOnly": true,
|
|
10
|
+
"secure": true,
|
|
11
|
+
"session": false,
|
|
12
|
+
"sameSite": "None",
|
|
13
|
+
"priority": "Medium",
|
|
14
|
+
"sourceScheme": "Secure",
|
|
15
|
+
"sourcePort": 443
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "YSC",
|
|
19
|
+
"value": "Kus3MEsoOp0",
|
|
20
|
+
"domain": ".youtube.com",
|
|
21
|
+
"path": "/",
|
|
22
|
+
"expires": -1,
|
|
23
|
+
"size": 14,
|
|
24
|
+
"httpOnly": true,
|
|
25
|
+
"secure": true,
|
|
26
|
+
"session": true,
|
|
27
|
+
"sameSite": "None",
|
|
28
|
+
"priority": "Medium",
|
|
29
|
+
"sourceScheme": "Secure",
|
|
30
|
+
"sourcePort": 443
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "PREF",
|
|
34
|
+
"value": "tz=Asia.Shanghai",
|
|
35
|
+
"domain": ".youtube.com",
|
|
36
|
+
"path": "/",
|
|
37
|
+
"expires": 1816587328.679573,
|
|
38
|
+
"size": 20,
|
|
39
|
+
"httpOnly": false,
|
|
40
|
+
"secure": true,
|
|
41
|
+
"session": false,
|
|
42
|
+
"priority": "Medium",
|
|
43
|
+
"sourceScheme": "Secure",
|
|
44
|
+
"sourcePort": 443
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "__Secure-ROLLOUT_TOKEN",
|
|
48
|
+
"value": "CPPx7rOq7fitHRDLmoeH6ZeVAxiBirqH6ZeVAw%3D%3D",
|
|
49
|
+
"domain": ".youtube.com",
|
|
50
|
+
"path": "/",
|
|
51
|
+
"expires": 1797579312.22299,
|
|
52
|
+
"size": 66,
|
|
53
|
+
"httpOnly": true,
|
|
54
|
+
"secure": true,
|
|
55
|
+
"session": false,
|
|
56
|
+
"sameSite": "None",
|
|
57
|
+
"priority": "Medium",
|
|
58
|
+
"sourceScheme": "Secure",
|
|
59
|
+
"sourcePort": 443,
|
|
60
|
+
"partitionKey": {
|
|
61
|
+
"topLevelSite": "https://youtube.com",
|
|
62
|
+
"hasCrossSiteAncestor": false
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "GPS",
|
|
67
|
+
"value": "1",
|
|
68
|
+
"domain": ".youtube.com",
|
|
69
|
+
"path": "/",
|
|
70
|
+
"expires": 1782029111.464525,
|
|
71
|
+
"size": 4,
|
|
72
|
+
"httpOnly": true,
|
|
73
|
+
"secure": true,
|
|
74
|
+
"session": false,
|
|
75
|
+
"priority": "Medium",
|
|
76
|
+
"sourceScheme": "Secure",
|
|
77
|
+
"sourcePort": 443
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "__Secure-YNID",
|
|
81
|
+
"value": "19.YT=dla_2GUKmWblHwF1UrFCgl_vQT_QAN-5vHkQVw7D6yuNRTSOGmUDc58EydXUFsAqRgAQBo9oDrY0zuL6qZqhNqXyQWUvkOhsH6fhy35ZKIfnOj5Nla41y8ae-bo95r36xzzM03n2cOcI_xDvdoC6YJeWSgTZJ8n9KNJd2cuCxvbemZC637fbdnEITkYBEpyg4R9l1aRNeKwR2sKa53gG4O95hM7qeUsLA-ZaWgxClGCt2Y35EruWqrpxahHA3zmiZM7fh3wf6l6-gDJG-3W6nws_EKbxaFhxoEBkGvpG5DhYuFbHImzdUk5qion-hQmLyyh_w0nsDwgWdhfevbjtrA",
|
|
82
|
+
"domain": ".youtube.com",
|
|
83
|
+
"path": "/",
|
|
84
|
+
"expires": 1797579311.222924,
|
|
85
|
+
"size": 361,
|
|
86
|
+
"httpOnly": true,
|
|
87
|
+
"secure": true,
|
|
88
|
+
"session": false,
|
|
89
|
+
"sameSite": "None",
|
|
90
|
+
"priority": "Medium",
|
|
91
|
+
"sourceScheme": "Secure",
|
|
92
|
+
"sourcePort": 443,
|
|
93
|
+
"partitionKey": {
|
|
94
|
+
"topLevelSite": "https://youtube.com",
|
|
95
|
+
"hasCrossSiteAncestor": false
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "VISITOR_PRIVACY_METADATA",
|
|
100
|
+
"value": "CgJTRxIEGgAgMw%3D%3D",
|
|
101
|
+
"domain": ".youtube.com",
|
|
102
|
+
"path": "/",
|
|
103
|
+
"expires": 1797579326.991768,
|
|
104
|
+
"size": 44,
|
|
105
|
+
"httpOnly": true,
|
|
106
|
+
"secure": true,
|
|
107
|
+
"session": false,
|
|
108
|
+
"sameSite": "None",
|
|
109
|
+
"priority": "Medium",
|
|
110
|
+
"sourceScheme": "Secure",
|
|
111
|
+
"sourcePort": 443
|
|
112
|
+
}
|
|
113
|
+
]
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Pikipedia — agent wiki 引擎
|
|
2
|
+
|
|
3
|
+
agent 的知识管理系统。按 MediaWiki 的数据模型设计,TypeScript 实现,HTTP API。
|
|
4
|
+
|
|
5
|
+
## 数据模型
|
|
6
|
+
|
|
7
|
+
### Page(页面)
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
interface Page {
|
|
11
|
+
title: string; // 唯一标识,如 "Heart"
|
|
12
|
+
currentRevId: number; // 当前版本号
|
|
13
|
+
created: string; // ISO 时间
|
|
14
|
+
updated: string;
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Revision(版本)
|
|
19
|
+
|
|
20
|
+
每次编辑产生一个新 revision。旧版本永远不删。
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
interface Revision {
|
|
24
|
+
id: number; // 自增
|
|
25
|
+
pageTitle: string;
|
|
26
|
+
content: string; // 完整页面内容(markdown)
|
|
27
|
+
author: string; // 编辑者(agent id / "human")
|
|
28
|
+
comment: string; // 编辑说明
|
|
29
|
+
timestamp: string; // ISO 时间
|
|
30
|
+
parentId: number | null; // 上一个版本的 id
|
|
31
|
+
size: number; // content 字节数
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 存储
|
|
36
|
+
|
|
37
|
+
SQLite 单文件数据库。两张表:`pages` + `revisions`。
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
~/.pi/pikipedia/wiki.db
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
不用 MySQL——单机场景 SQLite 够用,零运维。
|
|
44
|
+
|
|
45
|
+
## API
|
|
46
|
+
|
|
47
|
+
HTTP 服务,端口 `:9225`。
|
|
48
|
+
|
|
49
|
+
### 读
|
|
50
|
+
- `GET /api/page/:title` — 读页面当前版本
|
|
51
|
+
- `GET /api/page/:title/revisions` — 列所有版本
|
|
52
|
+
- `GET /api/page/:title/revision/:id` — 读特定版本
|
|
53
|
+
- `GET /api/diff/:fromId/:toId` — 两个版本的 diff
|
|
54
|
+
- `GET /api/search?q=xxx` — 全文搜索
|
|
55
|
+
- `GET /api/backlinks/:title` — 谁链到了这个页面
|
|
56
|
+
- `GET /api/recent` — 最近修改
|
|
57
|
+
- `GET /api/all` — 所有页面列表
|
|
58
|
+
|
|
59
|
+
### 写
|
|
60
|
+
- `POST /api/page/:title` — 创建/编辑页面
|
|
61
|
+
```json
|
|
62
|
+
{"content": "markdown 内容", "author": "agent-6093b114", "comment": "更新记忆系统描述"}
|
|
63
|
+
```
|
|
64
|
+
- `POST /api/page/:title/revert/:revId` — 回滚到指定版本
|
|
65
|
+
|
|
66
|
+
### 解析
|
|
67
|
+
- `GET /api/page/:title/links` — 页面内的 `[[链接]]` 列表
|
|
68
|
+
- `GET /api/page/:title/rendered` — 渲染后的内容(`[[链接]]` 转成实际链接)
|
|
69
|
+
|
|
70
|
+
## 链接系统
|
|
71
|
+
|
|
72
|
+
页面内容用 `[[Title]]` 语法链接其他页面。引擎:
|
|
73
|
+
1. 写入时扫描所有 `[[...]]`,存到 `links` 表
|
|
74
|
+
2. `backlinks` 查询反向查 `links` 表
|
|
75
|
+
3. 红链(链到的页面不存在)在搜索和渲染时标记
|
|
76
|
+
|
|
77
|
+
## Diff
|
|
78
|
+
|
|
79
|
+
用 Node.js 的 `diff` 库(或自己实现行级 diff)。输出格式:
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"from": 3, "to": 4,
|
|
84
|
+
"changes": [
|
|
85
|
+
{"type": "remove", "line": 10, "content": "旧内容"},
|
|
86
|
+
{"type": "add", "line": 10, "content": "新内容"}
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## 和 pi-coding-master 的关系
|
|
92
|
+
|
|
93
|
+
- agent 通过 laptop 的 pikipedia app(前端)交互
|
|
94
|
+
- 也可以通过 HTTP API 直接调用(tool 包装)
|
|
95
|
+
- 现有的 `Docs/Wiki/*.md` 可以批量导入作为初始数据
|
|
96
|
+
- 每个 agent 共享同一个 wiki 实例(知识是公共的,不是 per-person)
|
|
97
|
+
|
|
98
|
+
## 实现顺序
|
|
99
|
+
|
|
100
|
+
1. SQLite schema + 基础 CRUD(page + revision)
|
|
101
|
+
2. HTTP API 服务
|
|
102
|
+
3. `[[链接]]` 解析 + backlinks
|
|
103
|
+
4. Diff
|
|
104
|
+
5. 全文搜索
|
|
105
|
+
6. 批量导入现有 wiki markdown
|
|
106
|
+
7. laptop 前端 app
|