sera-code 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/NOTICE-SERA.md +25 -0
- package/README.md +27 -2
- package/THIRD_PARTY_NOTICES.md +68 -0
- package/bin/sera.mjs +137 -0
- package/dist/bundle/chunks/anthropic-messages-RD7GXOQL.js +6 -0
- package/dist/bundle/chunks/anthropic.js +75 -0
- package/dist/bundle/chunks/azure-openai-responses-CJT3KTVK.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +89 -0
- package/dist/bundle/chunks/chunk-46WGNYIE.js +82 -0
- package/dist/bundle/chunks/chunk-4UNN5OGR.js +4 -0
- package/dist/bundle/chunks/chunk-53H5DPHA.js +16 -0
- package/dist/bundle/chunks/chunk-5AGIVGSV.js +6 -0
- package/dist/bundle/chunks/chunk-6JXVX6Q2.js +2 -0
- package/dist/bundle/chunks/chunk-6QGV3IWD.js +6 -0
- package/dist/bundle/chunks/chunk-7CBJINYJ.js +20 -0
- package/dist/bundle/chunks/chunk-7DDKXS2Q.js +2 -0
- package/dist/bundle/chunks/chunk-7RZ5BS7U.js +2 -0
- package/dist/bundle/chunks/chunk-7ZC4UXSL.js +2 -0
- package/dist/bundle/chunks/chunk-BPHHHEET.js +9 -0
- package/dist/bundle/chunks/chunk-BSS6T6KQ.js +2 -0
- package/dist/bundle/chunks/chunk-CF5GWZHW.js +31 -0
- package/dist/bundle/chunks/chunk-EDSQGWII.js +44 -0
- package/dist/bundle/chunks/chunk-FFMDRXC4.js +10 -0
- package/dist/bundle/chunks/chunk-GUGC72EB.js +1222 -0
- package/dist/bundle/chunks/chunk-HODJBMOY.js +9 -0
- package/dist/bundle/chunks/chunk-HQBQWHLD.js +7 -0
- package/dist/bundle/chunks/chunk-HQJBN2MC.js +2 -0
- package/dist/bundle/chunks/chunk-JXWJOIH4.js +2 -0
- package/dist/bundle/chunks/chunk-KXU77PUU.js +4 -0
- package/dist/bundle/chunks/chunk-L2ZPNLYD.js +2 -0
- package/dist/bundle/chunks/chunk-LPXNMA2W.js +2 -0
- package/dist/bundle/chunks/chunk-LVVZS2NO.js +12 -0
- package/dist/bundle/chunks/chunk-M3LEVT3X.js +2 -0
- package/dist/bundle/chunks/chunk-P7FPUEYA.js +2 -0
- package/dist/bundle/chunks/chunk-PGXDEOVV.js +2 -0
- package/dist/bundle/chunks/chunk-PJACZCIR.js +2 -0
- package/dist/bundle/chunks/chunk-PMRZO46Y.js +2 -0
- package/dist/bundle/chunks/chunk-PRRNXB7S.js +2 -0
- package/dist/bundle/chunks/chunk-QTM7S6TH.js +2 -0
- package/dist/bundle/chunks/chunk-RDZVAGPR.js +2 -0
- package/dist/bundle/chunks/chunk-TLNP2BSO.js +2 -0
- package/dist/bundle/chunks/chunk-TMKHGABX.js +2 -0
- package/dist/bundle/chunks/chunk-TMTOQ7H7.js +2 -0
- package/dist/bundle/chunks/chunk-UKVNB6C4.js +2 -0
- package/dist/bundle/chunks/chunk-USJZMAIR.js +2 -0
- package/dist/bundle/chunks/chunk-UTB4DTYQ.js +2 -0
- package/dist/bundle/chunks/chunk-ZLAHUYDW.js +131 -0
- package/dist/bundle/chunks/chunk-ZNCN2NGY.js +60 -0
- package/dist/bundle/chunks/cli-MML2DU4A.js +51 -0
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-QPZQRBK5.js +2 -0
- package/dist/bundle/chunks/codemode-worker.js +478 -0
- package/dist/bundle/chunks/dist-ZNZCJI7B.js +7 -0
- package/dist/bundle/chunks/easter-egg-3d-VOETWRJO.js +2 -0
- package/dist/bundle/chunks/execute-HXDNZ26B.js +505 -0
- package/dist/bundle/chunks/github-copilot.js +2 -0
- package/dist/bundle/chunks/google-generative-ai-SJXMIEPZ.js +2 -0
- package/dist/bundle/chunks/google-vertex-VSXQ3BDH.js +2 -0
- package/dist/bundle/chunks/https-proxy-agent-LVOO5TPL.js +13 -0
- package/dist/bundle/chunks/image-resize-worker.js +2 -0
- package/dist/bundle/chunks/jiti-loader-GL4HJFAD.js +21 -0
- package/dist/bundle/chunks/jiti-static-loader-2RCDI6B4.js +2 -0
- package/dist/bundle/chunks/kimi-coding.js +2 -0
- package/dist/bundle/chunks/lib-4AVRLBHM.js +9 -0
- package/dist/bundle/chunks/llama-cpp-classify-4KFSGAMH.js +22 -0
- package/dist/bundle/chunks/meta.js +2 -0
- package/dist/bundle/chunks/mistral-conversations-JYWDZV2K.js +5 -0
- package/dist/bundle/chunks/multipart-parser-FMGQ7342.js +3 -0
- package/dist/bundle/chunks/node-AUOGOBCN.js +2 -0
- package/dist/bundle/chunks/node-KCMANYC2.js +16 -0
- package/dist/bundle/chunks/openai-chatgpt.js +75 -0
- package/dist/bundle/chunks/openai-codex-responses-OQV5DCFA.js +10 -0
- package/dist/bundle/chunks/openai-codex.js +75 -0
- package/dist/bundle/chunks/openai-completions-RFDJM2W5.js +7 -0
- package/dist/bundle/chunks/openai-decisions-O6PHBSCB.js +5 -0
- package/dist/bundle/chunks/openai-responses-LVNAPALQ.js +4 -0
- package/dist/bundle/chunks/openrouter-images-4WG6OOLH.js +2 -0
- package/dist/bundle/chunks/openrouter.js +75 -0
- package/dist/bundle/chunks/pdfjs-BETXZQ7A.js +108 -0
- package/dist/bundle/chunks/pdfjs-decoders-37HBPYHX.js +2 -0
- package/dist/bundle/chunks/pdfjs-jbig2-MH7WRXUP.js +2 -0
- package/dist/bundle/chunks/pdfjs-jbig2_nowasm_fallback-UVK7AQLA.js +2 -0
- package/dist/bundle/chunks/pdfjs-openjpeg-TC2QHC4G.js +2 -0
- package/dist/bundle/chunks/pdfjs-openjpeg_nowasm_fallback-ZC2FTHCZ.js +3 -0
- package/dist/bundle/chunks/pi-messages-EZXKVRR6.js +8 -0
- package/dist/bundle/chunks/radius.js +75 -0
- package/dist/bundle/chunks/runtime-JAH75CB5.js +2 -0
- package/dist/bundle/chunks/src-QKGKDFSU.js +4 -0
- package/dist/bundle/chunks/typesafe-system-one-X3JT6ECA.js +2 -0
- package/dist/bundle/chunks/virtual-modules-I5QRIHN6.js +2 -0
- package/dist/bundle/chunks/xai.js +2 -0
- package/dist/bundle/cli-runtime.js +3 -0
- package/dist/bundle/cli.js +5 -0
- package/dist/bundle/index.js +2 -0
- package/dist/bundle/rpc-entry.js +3 -0
- package/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
- package/dist/core/export-html/ansi-to-html.js +249 -0
- package/dist/core/export-html/ansi-to-html.js.map +1 -0
- package/dist/core/export-html/index.d.ts +37 -0
- package/dist/core/export-html/index.d.ts.map +1 -0
- package/dist/core/export-html/index.js +228 -0
- package/dist/core/export-html/index.js.map +1 -0
- package/dist/core/export-html/template.css +1085 -0
- package/dist/core/export-html/template.html +56 -0
- package/dist/core/export-html/template.js +2044 -0
- package/dist/core/export-html/tool-renderer.d.ts +34 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/dist/core/export-html/tool-renderer.js +110 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -0
- package/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/dist/core/export-html/vendor/marked-cjk-friendly.min.js +6 -0
- package/dist/core/export-html/vendor/marked.min.js +79 -0
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/theme/dark.json +81 -0
- package/dist/modes/interactive/theme/light.json +81 -0
- package/dist/modes/interactive/theme/system-theme.d.ts +55 -0
- package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/system-theme.js +546 -0
- package/dist/modes/interactive/theme/system-theme.js.map +1 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts +81 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-controller.js +210 -0
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.d.ts +28 -0
- package/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.js +105 -0
- package/dist/modes/interactive/theme/theme-schema.js.map +1 -0
- package/dist/modes/interactive/theme/theme-tokens.d.ts +257 -0
- package/dist/modes/interactive/theme/theme-tokens.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-tokens.js +94 -0
- package/dist/modes/interactive/theme/theme-tokens.js.map +1 -0
- package/dist/modes/interactive/theme/theme.d.ts +155 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme.js +905 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -0
- package/docs/cli-integration.md +106 -0
- package/docs/cli.md +333 -0
- package/docs/codemode.md +230 -0
- package/docs/compaction.md +463 -0
- package/docs/configuration.md +47 -0
- package/docs/containerization.md +183 -0
- package/docs/custom-provider.md +227 -0
- package/docs/docs.json +220 -0
- package/docs/environment-variables.md +102 -0
- package/docs/extensions.md +400 -0
- package/docs/how-pi-works.md +49 -0
- package/docs/index.md +39 -0
- package/docs/json.md +226 -0
- package/docs/keybindings.md +195 -0
- package/docs/llama-cpp.md +121 -0
- package/docs/mcp.md +272 -0
- package/docs/message-types.md +279 -0
- package/docs/models-configuration.md +196 -0
- package/docs/models.md +225 -0
- package/docs/nvidia-rtx-llama-cpp.md +96 -0
- package/docs/packages.md +131 -0
- package/docs/prompt-templates.md +59 -0
- package/docs/providers.md +247 -0
- package/docs/quickstart.md +136 -0
- package/docs/rpc-commands.md +860 -0
- package/docs/rpc-extension-ui.md +200 -0
- package/docs/rpc.md +193 -0
- package/docs/sdk.md +147 -0
- package/docs/security.md +99 -0
- package/docs/session-format.md +293 -0
- package/docs/sessions.md +66 -0
- package/docs/settings.md +172 -0
- package/docs/shell-aliases.md +93 -0
- package/docs/skills.md +93 -0
- package/docs/slash-commands.md +61 -0
- package/docs/terminal-setup.md +233 -0
- package/docs/termux.md +117 -0
- package/docs/themes.md +138 -0
- package/docs/tmux.md +55 -0
- package/docs/tui.md +195 -0
- package/docs/usage.md +94 -0
- package/docs/virtual-models.md +114 -0
- package/docs/windows.md +81 -0
- package/lib/auth.js +190 -0
- package/lib/provider.js +52 -0
- package/package.json +43 -5
- package/sera-core/skills/apple-tasarim/SKILL.md +48 -0
- package/sera-core/skills/apple-tasarim/referanslar/apple-hig.md +55 -0
- package/sera-core/skills/belge-yarat/SKILL.md +64 -0
- package/sera-core/skills/belge-yarat/referanslar/belge-yazim.md +60 -0
- package/sera-core/skills/derin-arastirma/SKILL.md +52 -0
- package/sera-core/skills/derin-arastirma/referanslar/arastirma-yontem.md +50 -0
- package/sera-core/skills/dusunme-dogrulama/SKILL.md +59 -0
- package/sera-core/skills/dusunme-dogrulama/referanslar/dusunme-kontrol.md +54 -0
- package/sera-core/skills/film-stilleri/SKILL.md +51 -0
- package/sera-core/skills/hyperframes/LICENSE-UPSTREAM +190 -0
- package/sera-core/skills/hyperframes/SKILL.md +79 -0
- package/sera-core/skills/hyperframes/assets/frame-presets/biennale-yellow/FRAME.md +289 -0
- package/sera-core/skills/hyperframes/assets/frame-presets/blockframe/FRAME.md +275 -0
- package/sera-core/skills/hyperframes/assets/frame-presets/blue-professional/FRAME.md +307 -0
- package/sera-core/skills/hyperframes/assets/frame-presets/bold-poster/FRAME.md +275 -0
- package/sera-core/skills/hyperframes/assets/frame-presets/broadside/FRAME.md +284 -0
- package/sera-core/skills/hyperframes/assets/frame-presets/capsule/FRAME.md +284 -0
- package/sera-core/skills/hyperframes/assets/frame-presets/cartesian/FRAME.md +278 -0
- package/sera-core/skills/hyperframes/assets/frame-presets/cobalt-grid/FRAME.md +265 -0
- package/sera-core/skills/hyperframes/assets/frame-presets/code-editorial/FRAME.md +277 -0
- package/sera-core/skills/hyperframes/assets/frame-presets/coral/FRAME.md +314 -0
- package/sera-core/skills/hyperframes/assets/frame-presets/creative-mode/FRAME.md +333 -0
- package/sera-core/skills/hyperframes/assets/frame-presets/daisy-days/FRAME.md +274 -0
- package/sera-core/skills/hyperframes/assets/frame-presets/editorial-forest/FRAME.md +265 -0
- package/sera-core/skills/hyperframes/references/captions.md +46 -0
- package/sera-core/skills/hyperframes/references/film.md +48 -0
- package/sera-core/skills/hyperframes/references/format.md +159 -0
- package/sera-core/skills/hyperframes/references/look.md +69 -0
- package/sera-core/skills/hyperframes/references/motion.md +95 -0
- package/sera-core/skills/hyperframes/references/overlays.md +39 -0
- package/sera-core/skills/hyperframes/references/path-tracing.md +36 -0
- package/sera-core/skills/hyperframes/references/plugin-installation.md +42 -0
- package/sera-core/skills/hyperframes/references/review.md +51 -0
- package/sera-core/skills/hyperframes/references/runtimes.md +69 -0
- package/sera-core/skills/hyperframes/references/skill-lifecycle.md +54 -0
- package/sera-core/skills/hyperframes/references/sound.md +43 -0
- package/sera-core/skills/hyperframes/references/spec.md +76 -0
- package/sera-core/skills/hyperframes/references/story.md +103 -0
- package/sera-core/skills/hyperframes/references/storyboard-format.md +107 -0
- package/sera-core/skills/hyperframes/references/storyboard.md +36 -0
- package/sera-core/skills/hyperframes/references/types/3d.md +25 -0
- package/sera-core/skills/hyperframes/references/types/character.md +20 -0
- package/sera-core/skills/hyperframes/references/types/data.md +19 -0
- package/sera-core/skills/hyperframes/references/types/explainer.md +34 -0
- package/sera-core/skills/hyperframes/references/types/launch.md +41 -0
- package/sera-core/skills/hyperframes/references/types/music.md +24 -0
- package/sera-core/skills/hyperframes/references/types/vertical.md +23 -0
- package/sera-core/skills/hyperframes-cli/LICENSE-UPSTREAM +190 -0
- package/sera-core/skills/hyperframes-cli/SKILL.md +99 -0
- package/sera-core/skills/hyperframes-cli/references/beats.md +17 -0
- package/sera-core/skills/hyperframes-cli/references/compare-and-batch.md +105 -0
- package/sera-core/skills/hyperframes-cli/references/conventions.md +16 -0
- package/sera-core/skills/hyperframes-cli/references/doctor-browser.md +80 -0
- package/sera-core/skills/hyperframes-cli/references/feedback.md +14 -0
- package/sera-core/skills/hyperframes-cli/references/init-and-scaffold.md +75 -0
- package/sera-core/skills/hyperframes-cli/references/lint-validate-inspect.md +164 -0
- package/sera-core/skills/hyperframes-cli/references/preview-render.md +204 -0
- package/sera-core/skills/hyperframes-cli/references/upgrade-info-misc.md +134 -0
- package/sera-core/skills/impeccable/LICENSE-UPSTREAM +191 -0
- package/sera-core/skills/impeccable/NOTICE-UPSTREAM.md +11 -0
- package/sera-core/skills/impeccable/SKILL.md +89 -0
- package/sera-core/skills/impeccable/reference/adapt.md +318 -0
- package/sera-core/skills/impeccable/reference/adapt.native.md +58 -0
- package/sera-core/skills/impeccable/reference/android.md +46 -0
- package/sera-core/skills/impeccable/reference/animate.md +89 -0
- package/sera-core/skills/impeccable/reference/audit.md +139 -0
- package/sera-core/skills/impeccable/reference/audit.native.md +139 -0
- package/sera-core/skills/impeccable/reference/bolder.md +33 -0
- package/sera-core/skills/impeccable/reference/clarify.md +94 -0
- package/sera-core/skills/impeccable/reference/colorize.md +86 -0
- package/sera-core/skills/impeccable/reference/component-review.md +63 -0
- package/sera-core/skills/impeccable/reference/craft-floor.md +44 -0
- package/sera-core/skills/impeccable/reference/craft.md +5 -0
- package/sera-core/skills/impeccable/reference/critique.md +819 -0
- package/sera-core/skills/impeccable/reference/degraded/asset-producer.md +42 -0
- package/sera-core/skills/impeccable/reference/degraded/documenter.md +24 -0
- package/sera-core/skills/impeccable/reference/degraded/finish-reviewer.md +38 -0
- package/sera-core/skills/impeccable/reference/degraded/manual-edit-applier.md +93 -0
- package/sera-core/skills/impeccable/reference/delight.md +70 -0
- package/sera-core/skills/impeccable/reference/distill.md +111 -0
- package/sera-core/skills/impeccable/reference/doctor.md +54 -0
- package/sera-core/skills/impeccable/reference/document.md +416 -0
- package/sera-core/skills/impeccable/reference/extract.md +69 -0
- package/sera-core/skills/impeccable/reference/generate.md +101 -0
- package/sera-core/skills/impeccable/reference/harden.md +362 -0
- package/sera-core/skills/impeccable/reference/hooks.md +120 -0
- package/sera-core/skills/impeccable/reference/init.md +133 -0
- package/sera-core/skills/impeccable/reference/ios.md +51 -0
- package/sera-core/skills/impeccable/reference/layout.md +84 -0
- package/sera-core/skills/impeccable/reference/live-setup.md +104 -0
- package/sera-core/skills/impeccable/reference/live.md +327 -0
- package/sera-core/skills/impeccable/reference/mode-operate.md +21 -0
- package/sera-core/skills/impeccable/reference/mode-persuade.md +19 -0
- package/sera-core/skills/impeccable/reference/mode-read.md +21 -0
- package/sera-core/skills/impeccable/reference/new-work.md +152 -0
- package/sera-core/skills/impeccable/reference/onboard.md +234 -0
- package/sera-core/skills/impeccable/reference/operate.md +61 -0
- package/sera-core/skills/impeccable/reference/optimize.md +257 -0
- package/sera-core/skills/impeccable/reference/overdrive.md +127 -0
- package/sera-core/skills/impeccable/reference/polish.md +105 -0
- package/sera-core/skills/impeccable/reference/quieter.md +99 -0
- package/sera-core/skills/impeccable/reference/region-map.md +26 -0
- package/sera-core/skills/impeccable/reference/routing.md +24 -0
- package/sera-core/skills/impeccable/reference/shape.md +59 -0
- package/sera-core/skills/impeccable/reference/typeset.md +90 -0
- package/sera-core/skills/impeccable/reference/visualize.md +47 -0
- package/sera-core/skills/oyun-yarat/SKILL.md +106 -0
- package/sera-core/skills/oyun-yarat/referanslar/3b-yaris.md +74 -0
- package/sera-core/skills/oyun-yarat/referanslar/kaplay.md +99 -0
- package/sera-core/skills/oyun-yarat/referanslar/oyun-desenleri.md +73 -0
- package/sera-core/skills/oyun-yarat/sablonlar/kaplay-2d.html +164 -0
- package/sera-core/skills/oyun-yarat/sablonlar/three-yaris.html +149 -0
- package/sera-core/skills/oyun-yarat/sablonlar/tuval-minimal.html +77 -0
- package/sera-core/skills/receiving-code-review/LICENSE-UPSTREAM +21 -0
- package/sera-core/skills/receiving-code-review/SKILL.md +205 -0
- package/sera-core/skills/refero-design/LICENSE-UPSTREAM +21 -0
- package/sera-core/skills/refero-design/SKILL.md +534 -0
- package/sera-core/skills/refero-design/references/anti-ai-slop.md +292 -0
- package/sera-core/skills/refero-design/references/color.md +563 -0
- package/sera-core/skills/refero-design/references/copywriting.md +222 -0
- package/sera-core/skills/refero-design/references/craft-details.md +525 -0
- package/sera-core/skills/refero-design/references/example-workflow.md +264 -0
- package/sera-core/skills/refero-design/references/icons.md +166 -0
- package/sera-core/skills/refero-design/references/mcp-tools.md +258 -0
- package/sera-core/skills/refero-design/references/motion.md +504 -0
- package/sera-core/skills/refero-design/references/typography.md +737 -0
- package/sera-core/skills/refero-design/references/visual-workflow.md +105 -0
- package/sera-core/skills/requesting-code-review/LICENSE-UPSTREAM +21 -0
- package/sera-core/skills/requesting-code-review/SKILL.md +95 -0
- package/sera-core/skills/requesting-code-review/code-reviewer.md +198 -0
- package/sera-core/skills/reverse-engineer-anything/DISCLAIMER.md +136 -0
- package/sera-core/skills/reverse-engineer-anything/LICENSE-REA-MIT +21 -0
- package/sera-core/skills/reverse-engineer-anything/SKILL.md +363 -0
- package/sera-core/skills/reverse-engineer-anything/THIRD_PARTY_NOTICES.md +135 -0
- package/sera-core/skills/reverse-engineer-anything/references/android-applications.md +36 -0
- package/sera-core/skills/reverse-engineer-anything/references/connection-and-recovery.md +127 -0
- package/sera-core/skills/reverse-engineer-anything/references/evidence-workflows.md +71 -0
- package/sera-core/skills/reverse-engineer-anything/references/javascript-applications.md +218 -0
- package/sera-core/skills/reverse-engineer-anything/references/native-and-artifacts.md +297 -0
- package/sera-core/skills/reverse-engineer-anything/references/runtime-observation.md +78 -0
- package/sera-core/skills/seo-audit/LICENSE-UPSTREAM +21 -0
- package/sera-core/skills/seo-audit/SKILL.md +210 -0
- package/sera-core/skills/sera-guvenlik-denetim/SKILL.md +44 -0
- package/sera-core/skills/sera-guvenlik-denetim/referanslar/guvenlik-listesi.md +33 -0
- package/sera-core/skills/sera-hata-ayikla/SKILL.md +27 -0
- package/sera-core/skills/sera-hata-ayikla/referanslar/hata-ayiklama.md +37 -0
- package/sera-core/skills/sera-kod-inceleme/SKILL.md +44 -0
- package/sera-core/skills/sera-kod-inceleme/referanslar/inceleme-listesi.md +62 -0
- package/sera-core/skills/sera-ofis-dosya/SKILL.md +27 -0
- package/sera-core/skills/sera-ofis-dosya/referanslar/ofis-dosya.md +93 -0
- package/sera-core/skills/sera-research/SKILL.md +90 -0
- package/sera-core/skills/sera-tasarim/SKILL.md +149 -0
- package/sera-core/skills/sera-teslim-sozlesmesi/SKILL.md +592 -0
- package/sera-core/skills/sera-test-yaz/SKILL.md +26 -0
- package/sera-core/skills/sera-test-yaz/referanslar/test-yazimi.md +35 -0
- package/sera-core/skills/sera-veri-gorsel/SKILL.md +65 -0
- package/sera-core/skills/sera-web-test/SKILL.md +26 -0
- package/sera-core/skills/sera-web-test/referanslar/web-test.md +44 -0
- package/sera-core/skills/sera-zamanli-gorev/SKILL.md +22 -0
- package/sera-core/skills/sera-zamanli-gorev/referanslar/zamanli-gorev.md +58 -0
- package/sera-core/skills/systematic-debugging/LICENSE-UPSTREAM +21 -0
- package/sera-core/skills/systematic-debugging/SKILL.md +283 -0
- package/sera-core/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/sera-core/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/sera-core/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/sera-core/skills/test-driven-development/LICENSE-UPSTREAM +21 -0
- package/sera-core/skills/test-driven-development/SKILL.md +330 -0
- package/sera-core/skills/test-driven-development/writing-good-tests.md +198 -0
- package/sera-core/skills/ticaret-icerik/SKILL.md +49 -0
- package/sera-core/skills/ticaret-icerik/referanslar/ticaret-icerik.md +54 -0
- package/sera-core/skills/uygulama-yarat/SKILL.md +95 -0
- package/sera-core/skills/uygulama-yarat/referanslar/uygulama-desenleri.md +63 -0
- package/sera-core/skills/uygulama-yarat/sablonlar/uygulama-tek-dosya.html +121 -0
- package/sera-core/skills/uyumluluk-denetim/SKILL.md +56 -0
- package/sera-core/skills/uyumluluk-denetim/referanslar/mevzuat-tablosu.md +65 -0
- package/sera-core/skills/veri-analizi/SKILL.md +54 -0
- package/sera-core/skills/veri-analizi/referanslar/veri-analizi-yontem.md +49 -0
- package/sera-core/skills/veri-analizi/sablonlar/profil.mjs +79 -0
- package/sera-core/skills/video-duzen/SKILL.md +50 -0
- package/sera-core/skills/video-duzen/referanslar/video-duzen.md +100 -0
- package/sera-core/skills/web-yayin-listesi/SKILL.md +115 -0
- package/sera-core/skills/writing-plans/LICENSE-UPSTREAM +21 -0
- package/sera-core/skills/writing-plans/SKILL.md +204 -0
- package/sera-core/src/action-nudge.ts +200 -0
- package/sera-core/src/agent-mode.ts +143 -0
- package/sera-core/src/agents.ts +185 -0
- package/sera-core/src/app-master.ts +275 -0
- package/sera-core/src/app-verify.ts +551 -0
- package/sera-core/src/approval.ts +131 -0
- package/sera-core/src/budget.ts +136 -0
- package/sera-core/src/command-policy.ts +808 -0
- package/sera-core/src/config.ts +135 -0
- package/sera-core/src/context-diet.ts +272 -0
- package/sera-core/src/device-id.ts +48 -0
- package/sera-core/src/dogal-arac.ts +203 -0
- package/sera-core/src/dogal-niyet.ts +173 -0
- package/sera-core/src/egress-allow.ts +52 -0
- package/sera-core/src/export.ts +124 -0
- package/sera-core/src/exposure.ts +8 -0
- package/sera-core/src/extension.ts +2416 -0
- package/sera-core/src/fs-tools.ts +444 -0
- package/sera-core/src/generated/build-rules.ts +26 -0
- package/sera-core/src/generated/zero-knowledge.ts +170 -0
- package/sera-core/src/github-agent-command.ts +133 -0
- package/sera-core/src/github-agent-engine.ts +198 -0
- package/sera-core/src/github-agent-schedule.ts +180 -0
- package/sera-core/src/github-agent.ts +669 -0
- package/sera-core/src/github-ajan-akis.ts +193 -0
- package/sera-core/src/github-ajan-gercek.ts +102 -0
- package/sera-core/src/github-tick.ts +78 -0
- package/sera-core/src/github-yedek.ts +269 -0
- package/sera-core/src/goal.ts +119 -0
- package/sera-core/src/handoff.ts +132 -0
- package/sera-core/src/hooks.ts +284 -0
- package/sera-core/src/image-tool.ts +118 -0
- package/sera-core/src/intake-brief.ts +82 -0
- package/sera-core/src/intake-core.ts +1152 -0
- package/sera-core/src/intake-hook.ts +88 -0
- package/sera-core/src/ios-build-tool.ts +134 -0
- package/sera-core/src/lazy-capability.ts +125 -0
- package/sera-core/src/lazy-mcp.ts +300 -0
- package/sera-core/src/limit-command.ts +51 -0
- package/sera-core/src/loop-brake.ts +129 -0
- package/sera-core/src/lsp.ts +618 -0
- package/sera-core/src/mcp-bridge.ts +159 -0
- package/sera-core/src/mcp-pin.ts +105 -0
- package/sera-core/src/mcp-ssrf.ts +124 -0
- package/sera-core/src/message-cap.ts +45 -0
- package/sera-core/src/no-progress.ts +177 -0
- package/sera-core/src/notebook-tool.ts +179 -0
- package/sera-core/src/ofis.ts +473 -0
- package/sera-core/src/path-guard.ts +139 -0
- package/sera-core/src/permission-bridge.ts +228 -0
- package/sera-core/src/policy-chain.ts +122 -0
- package/sera-core/src/pricing.ts +71 -0
- package/sera-core/src/proc.ts +149 -0
- package/sera-core/src/rea.ts +188 -0
- package/sera-core/src/repo-map.ts +230 -0
- package/sera-core/src/research.ts +347 -0
- package/sera-core/src/rules-memory.ts +227 -0
- package/sera-core/src/sandbox.ts +445 -0
- package/sera-core/src/server-error.ts +78 -0
- package/sera-core/src/skills.ts +268 -0
- package/sera-core/src/snapshot.ts +143 -0
- package/sera-core/src/spec-gate.ts +112 -0
- package/sera-core/src/subagent.ts +261 -0
- package/sera-core/src/teslim.ts +120 -0
- package/sera-core/src/test-fix.ts +184 -0
- package/sera-core/src/todo-question.ts +163 -0
- package/sera-core/src/turn-snapshots.ts +126 -0
- package/sera-core/src/tuval/arac.ts +338 -0
- package/sera-core/src/tuval/arsiv.ts +106 -0
- package/sera-core/src/tuval/belge.ts +216 -0
- package/sera-core/src/tuval/birlestir.ts +282 -0
- package/sera-core/src/tuval/disa.ts +235 -0
- package/sera-core/src/tuval/editor.ts +583 -0
- package/sera-core/src/tuval/film-cekirdek.ts +170 -0
- package/sera-core/src/tuval/film-disa.ts +188 -0
- package/sera-core/src/tuval/film-oynatici.ts +307 -0
- package/sera-core/src/tuval/kimlik.ts +156 -0
- package/sera-core/src/tuval/pano.ts +763 -0
- package/sera-core/src/tuval/proje.ts +728 -0
- package/sera-core/src/tuval/sistem-cekirdek.ts +167 -0
- package/sera-core/src/tuval/sistem.ts +328 -0
- package/sera-core/src/tuval/sunucu.ts +413 -0
- package/sera-core/src/tuval/uretim.ts +24 -0
- package/sera-core/src/tuval/veri-cekirdek.ts +477 -0
- package/sera-core/src/tuval/xlsx.ts +215 -0
- package/sera-core/src/tuval/zip.ts +163 -0
- package/sera-core/src/untrusted.ts +201 -0
- package/sera-core/src/video-edit-tool.ts +411 -0
- package/sera-core/src/video-tool.ts +217 -0
- package/sera-core/src/web-tools.ts +257 -0
- package/sera-core/src/zk.ts +104 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Özel alt ajan tanımları (.md) — Dalga 2, rakip matris madde 1 ("özel ajan .md tanımı"; rakip: Claude Code
|
|
3
|
+
* `.claude/agents/*.md`, Qwen özel ajan). Keşif: <home>/agents/*.md (kullanıcı) + <proje>/.sera/agents/*.md (proje).
|
|
4
|
+
* Her dosya bir ajan: frontmatter (name, description, tools, model) + gövde = ajanın rol/sistem yönergesi.
|
|
5
|
+
*
|
|
6
|
+
* Kullanım: model `task` aracını `subagent_type: <ad>` ile çağırır → o ajanın yönergesi alt ajana enjekte edilir ve
|
|
7
|
+
* 'tools' allowlist'i (varsa) alt ajanda setActiveTools ile DARALTIR. Araç kısıtı güvenlik içindir: ajan yalnız izin
|
|
8
|
+
* verilen araçları kullanır (sahip "güvenli" ilkesi).
|
|
9
|
+
*
|
|
10
|
+
* NOT (anayasa): 'model' alanı parse edilir ama UYGULANMAZ — model zinciri sahibin kararıdır; ileride yalnız onayla
|
|
11
|
+
* bağlanır. Böylece bir ajan .md'si sessizce model zincirini değiştiremez.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
15
|
+
import { basename, join } from "node:path";
|
|
16
|
+
|
|
17
|
+
/** Alt ajana araç allowlist'ini taşıyan env (üst ajan ayarlar, alt ajan okuyup daraltır). */
|
|
18
|
+
export const AGENT_TOOLS_ENV = "SERA_AGENT_TOOLS";
|
|
19
|
+
|
|
20
|
+
export interface AgentDef {
|
|
21
|
+
/** Küçük harf, boşluksuz ad (task subagent_type ile eşleşir). */
|
|
22
|
+
name: string;
|
|
23
|
+
description: string;
|
|
24
|
+
/** Gövde: ajanın rol/sistem yönergesi (boş olabilir). */
|
|
25
|
+
prompt: string;
|
|
26
|
+
/** Varsa: alt ajanda izin verilen araçlar (allowlist; aktif araçları yalnız DARALTIR). */
|
|
27
|
+
tools?: string[];
|
|
28
|
+
/** Parse edilir ama UYGULANMAZ (model zinciri sahibin kararı). */
|
|
29
|
+
model?: string;
|
|
30
|
+
source: "project" | "user" | "builtin";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface Front {
|
|
34
|
+
scalar(key: string): string | undefined;
|
|
35
|
+
list(key: string): string[];
|
|
36
|
+
body: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Basit frontmatter ayrıştırıcı (skills.ts disallowed-tools biçimiyle uyumlu: satır içi "a, b" ya da YAML listesi). */
|
|
40
|
+
function parseFront(content: string): Front {
|
|
41
|
+
const m = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/.exec(content);
|
|
42
|
+
if (!m) return { scalar: () => undefined, list: () => [], body: content.trim() };
|
|
43
|
+
const lines = m[1]!.split(/\r?\n/);
|
|
44
|
+
const body = m[2]!.trim();
|
|
45
|
+
const indexOf = (key: string) => lines.findIndex((l) => new RegExp(`^${key}\\s*:`, "i").test(l));
|
|
46
|
+
const unquote = (s: string) => s.trim().replace(/^["']|["']$/g, "");
|
|
47
|
+
return {
|
|
48
|
+
scalar(key) {
|
|
49
|
+
const i = indexOf(key);
|
|
50
|
+
if (i < 0) return undefined;
|
|
51
|
+
return unquote(lines[i]!.replace(new RegExp(`^${key}\\s*:\\s*`, "i"), "")) || undefined;
|
|
52
|
+
},
|
|
53
|
+
list(key) {
|
|
54
|
+
const i = indexOf(key);
|
|
55
|
+
if (i < 0) return [];
|
|
56
|
+
const inline = lines[i]!.replace(new RegExp(`^${key}\\s*:\\s*`, "i"), "").trim();
|
|
57
|
+
const items: string[] = [];
|
|
58
|
+
if (inline) items.push(...inline.replace(/^\[|\]$/g, "").split(/[,\s]+/));
|
|
59
|
+
else
|
|
60
|
+
for (const l of lines.slice(i + 1)) {
|
|
61
|
+
const li = /^\s*-\s*(.+)$/.exec(l);
|
|
62
|
+
if (!li) break;
|
|
63
|
+
items.push(li[1]!);
|
|
64
|
+
}
|
|
65
|
+
return items.map(unquote).filter(Boolean);
|
|
66
|
+
},
|
|
67
|
+
body,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Tek bir .md içeriğini ajana çevirir. Ad = frontmatter name ya da dosya adı. Boş (açıklama+gövde yok) ise undefined. */
|
|
72
|
+
export function parseAgentFile(
|
|
73
|
+
content: string,
|
|
74
|
+
fallbackName: string,
|
|
75
|
+
source: AgentDef["source"],
|
|
76
|
+
): AgentDef | undefined {
|
|
77
|
+
const f = parseFront(content);
|
|
78
|
+
const name = (f.scalar("name") ?? fallbackName).trim().toLowerCase().replace(/\s+/g, "-");
|
|
79
|
+
if (!name) return undefined;
|
|
80
|
+
const description = f.scalar("description") ?? "";
|
|
81
|
+
if (!description && !f.body) return undefined;
|
|
82
|
+
const tools = f.list("tools");
|
|
83
|
+
return {
|
|
84
|
+
name,
|
|
85
|
+
description,
|
|
86
|
+
prompt: f.body,
|
|
87
|
+
tools: tools.length ? tools : undefined,
|
|
88
|
+
model: f.scalar("model"),
|
|
89
|
+
source,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Keşif klasörleri (var olanlar): önce kullanıcı, sonra proje (proje yalnız yeni ad ekler, güven ister). */
|
|
94
|
+
export function agentDirs(home: string, cwd: string): { dir: string; source: AgentDef["source"] }[] {
|
|
95
|
+
return (
|
|
96
|
+
[
|
|
97
|
+
{ dir: join(home, "agents"), source: "user" as const },
|
|
98
|
+
{ dir: join(cwd, ".sera", "agents"), source: "project" as const },
|
|
99
|
+
] as const
|
|
100
|
+
).filter((d) => existsSync(d.dir));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** <home>/agents ve <cwd>/.sera/agents altındaki *.md ajanlarını yükler; ada göre sıralı, proje kullanıcıyı ezer. */
|
|
104
|
+
/**
|
|
105
|
+
* Yerlesik tipli alt ajanlar (Claude Code Explore/Plan karsiligi). Salt-okunur arac allowlist'i: arama/okuma yapar, dosya
|
|
106
|
+
* degistirmez, komut calistirmaz (bash YOK). Kullanici/proje ayni adli .md koyarsa onlar ezer.
|
|
107
|
+
*/
|
|
108
|
+
export const BUILTIN_AGENTS: readonly AgentDef[] = [
|
|
109
|
+
{
|
|
110
|
+
name: "explore",
|
|
111
|
+
description: "Hizli salt-okunur kod kesfi: dosya/sembol bul, kodu oku, bir soruyu yanitla (degisiklik yapmaz).",
|
|
112
|
+
prompt:
|
|
113
|
+
"Sen salt-okunur bir kesif ajanisin. glob/grep/ls/read ile ara ve oku; DOSYA DEGISTIRME, komut calistirma. Kisa ve kanitli yanit ver: ilgili dosya yollari + satir numaralari + bulgu. Gereksiz tum dosyayi okuma; once grep/glob ile daralt.",
|
|
114
|
+
tools: ["read", "grep", "glob", "ls", "web_fetch", "web_search", "tool_search"],
|
|
115
|
+
source: "builtin",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "plan",
|
|
119
|
+
description: "Uygulamadan once salt-okunur arastirip adim adim uygulama plani cikarir (degisiklik yapmaz).",
|
|
120
|
+
prompt:
|
|
121
|
+
"Sen bir planlama ajanisin. Kodu salt-okunur incele (glob/grep/ls/read), sonra SIRALI, dosya-yolu somut bir uygulama plani yaz: degisecek dosyalar, her adimin ne yapacagi, riskler ve dogrulama (test) adimlari. DOSYA DEGISTIRME, komut calistirma.",
|
|
122
|
+
tools: ["read", "grep", "glob", "ls", "web_fetch", "web_search", "tool_search"],
|
|
123
|
+
source: "builtin",
|
|
124
|
+
},
|
|
125
|
+
];
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Fable #20: proje ajanlari (<cwd>/.sera/agents) yalniz kullanici projeye /guven dediyse yuklenir (kancalarla ayni
|
|
129
|
+
* TrustStore sarti) ve kullanici/yerlesik ajani EZEMEZ — yalniz yeni ad ekler. Klonlanan yabanci depo, "explore" gibi
|
|
130
|
+
* salt-okunur bir ajanin yerine kendi yonergesini koyamaz.
|
|
131
|
+
*/
|
|
132
|
+
export function loadAgents(cwd: string, home: string, opts: { projectTrusted?: boolean } = {}): AgentDef[] {
|
|
133
|
+
const byName = new Map<string, AgentDef>(BUILTIN_AGENTS.map((a) => [a.name, a]));
|
|
134
|
+
for (const { dir, source } of agentDirs(home, cwd)) {
|
|
135
|
+
if (source === "project" && !opts.projectTrusted) continue;
|
|
136
|
+
let files: string[];
|
|
137
|
+
try {
|
|
138
|
+
files = readdirSync(dir).filter((f) => f.toLowerCase().endsWith(".md"));
|
|
139
|
+
} catch {
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
files.sort();
|
|
143
|
+
for (const file of files) {
|
|
144
|
+
let def: AgentDef | undefined;
|
|
145
|
+
try {
|
|
146
|
+
def = parseAgentFile(readFileSync(join(dir, file), "utf8"), basename(file, ".md"), source);
|
|
147
|
+
} catch {
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
if (def && !(source === "project" && byName.has(def.name))) byName.set(def.name, def); // proje ezemez
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return [...byName.values()].sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** subagent_type → ajan (ada göre, büyük/küçük harf duyarsız). */
|
|
157
|
+
export function findAgent(defs: AgentDef[], type: string | undefined): AgentDef | undefined {
|
|
158
|
+
if (!type) return undefined;
|
|
159
|
+
const t = type.trim().toLowerCase();
|
|
160
|
+
return defs.find((d) => d.name === t);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** Sistem istemine konacak tanıtım bloğu (yalnız ad + açıklama; içerik enjeksiyonu task seçince olur). */
|
|
164
|
+
export function agentsSystemText(defs: AgentDef[]): string | undefined {
|
|
165
|
+
if (!defs.length) return undefined;
|
|
166
|
+
const lines = defs.map((d) => `- ${d.name}: ${d.description || "(açıklama yok)"}`);
|
|
167
|
+
return `Alt ajanlar (\`task\` aracında \`subagent_type\`):\n${lines.join("\n")}`;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** Ajanın rol yönergesini alt ajan istemine önden ekler (gövde boşsa yalnız başlık). */
|
|
171
|
+
export function framePrompt(def: AgentDef, prompt: string): string {
|
|
172
|
+
const head = `[Alt ajan rolü: ${def.name}]`;
|
|
173
|
+
return def.prompt ? `${head}\n${def.prompt}\n\n---\n\n${prompt}` : `${head}\n\n${prompt}`;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Araç allowlist'ini aktif araçlara uygular: yalnız (allowlist ∩ mevcut araçlar) tutulur (DARALTMA). Allowlist yoksa
|
|
178
|
+
* ya da kesişim boşsa (yanlış ad) undefined döner = değişiklik yok (alt ajanı yanlışlıkla tamamen araçsız bırakma).
|
|
179
|
+
*/
|
|
180
|
+
export function restrictTools(allow: string[] | undefined, allTools: string[]): string[] | undefined {
|
|
181
|
+
if (!allow || !allow.length) return undefined;
|
|
182
|
+
const available = new Set(allTools);
|
|
183
|
+
const keep = allow.filter((n) => available.has(n));
|
|
184
|
+
return keep.length ? keep : undefined;
|
|
185
|
+
}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Uygulama Ustasi": sifir bilgili kullanici "bana X uygulamasi/oyunu/sitesi yap" dediginde tam otonom teslim protokolu.
|
|
3
|
+
* - USTA_RULES: yalniz uygulama isteginde sistem istemine giren kisa (<=250 kelime) calisma disiplini;
|
|
4
|
+
* - app_verify: yapilani GERCEKTEN calistirip dogrular (app-verify.ts); open_app: dosyayi/URL'yi varsayilan tarayicida acar;
|
|
5
|
+
* - teslim kapisi: model app_verify GECTI almadan son yanit verirse EN COK 2 kez "dogrulamadan teslim yok" ile devam ettirir.
|
|
6
|
+
* Calisma disiplini ilhami: DeepSeek dsh-superagent (MIT) — bkz. THIRD_PARTY_NOTICES.md. SERA_USTA=0 hepsini kapatir.
|
|
7
|
+
*/
|
|
8
|
+
import { spawn } from "node:child_process";
|
|
9
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
10
|
+
import { extname, resolve } from "node:path";
|
|
11
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
12
|
+
import { Type } from "typebox";
|
|
13
|
+
import { resolveTarget, runCommandCheck, type VerifyResult, verifyInBrowser, verifyServer } from "./app-verify.ts";
|
|
14
|
+
import { classifyCommand } from "./command-policy.ts";
|
|
15
|
+
import { rareExposure } from "./exposure.ts";
|
|
16
|
+
|
|
17
|
+
export const USTA_RULES = [
|
|
18
|
+
"UYGULAMA USTASI (teslim protokolü — adımları sırayla bitir, yarıda durma):",
|
|
19
|
+
"1. Kısa plan (3-5 madde, yazma) → todowrite ile adımları aç.",
|
|
20
|
+
"2. Yaz: eksiksiz, çalışan dosyalar. Yeni dosya oluştururken önce read yapma; var olanı değiştirirken önce oku.",
|
|
21
|
+
"3. ÇALIŞTIR: app_verify ile doğrula (.html/klasör: tarayıcıda açar, konsol hatası+ekran görüntüsü; oyun/arayüzde actions ile tuş/tıklama dene; komut: command; sunucu: serve_command+port).",
|
|
22
|
+
"4. KALDI ise hatayı oku, kendin düzelt, tekrar app_verify (en çok 4 tur). Aynı hatayı aynı şekilde tekrar deneme; yaklaşımı değiştir.",
|
|
23
|
+
"5. GEÇTİ olmadan teslim yok. Doğrulanamadıysa (ATLANDI/4 tur) bunu açıkça söyle; 'çalışıyor' deme.",
|
|
24
|
+
"6. Tarayıcıda açmak için (yukarıdaki `start`/`open` komutu yerine) bash DEĞİL open_app kullan (yolu kendisi çözer, beklemez). Teslimden önce open_app ile kullanıcıya aç.",
|
|
25
|
+
"7. Rutin soru sorma: renk, düzen, isim, dil, kütüphane kararlarını makul varsayımla kendin ver. Yalnız gerçekten kullanıcıya ait bilgi (iletişim, marka/işletme adı, telefon) için TEK basit soru sor; yine de örnek veriyle bitir.",
|
|
26
|
+
"8. Hata/test kırığı durma sebebi değil: düzelt ve doğrula. Bitirmeden bırakma.",
|
|
27
|
+
"8b. GÖRSEL KALİTE (arayüzlü işlerde): tarifteki yazı tiplerini/renkleri AYNEN kullan (Google Fonts bağlantısı); proje klasöründeki logo/görselleri (assets/, img/) bul ve kullan; ikon için emoji DEĞİL tutarlı satır-içi SVG ikon seti; 4/8 px boşluk ölçeği, net başlık hiyerarşisi, tek vurgu rengi; mobil önce (390 px) — taşma/üst üste binme yok. app_verify ekindeki ekran görüntüsüne bakıp en az bir tasarım düzeltme turu yap.",
|
|
28
|
+
"9. Teslim mesajı (sade Türkçe, teknik terim yok): ne yapıldı (1-2 cümle), nasıl açılır (tarayıcıda açtım / dosya yolu), kanıt (örn. 'Kontrol ettim: hata yok, telefonda da düzgün görünüyor'), varsayımlar. Kod gösterme.",
|
|
29
|
+
].join("\n");
|
|
30
|
+
|
|
31
|
+
/** Durum: yalniz ust ajan, tek oturum; her yeni kullanici isteginde sifirlanir. */
|
|
32
|
+
export const usta = { verified: false, gateUsed: 0 };
|
|
33
|
+
export const resetUsta = (): void => {
|
|
34
|
+
usta.verified = false;
|
|
35
|
+
usta.gateUsed = 0;
|
|
36
|
+
};
|
|
37
|
+
export const GATE_MAX = 2;
|
|
38
|
+
export const GATE_MARK = "[Sera teslim kapısı]";
|
|
39
|
+
|
|
40
|
+
export const gateNudge = (n: number): string =>
|
|
41
|
+
`${GATE_MARK} Doğrulamadan teslim yok (${n}/${GATE_MAX}). app_verify ile uygulamayı GERÇEKTEN çalıştır; KALDI ise düzelt ve tekrar çalıştır. ` +
|
|
42
|
+
`GEÇTİ alınca kullanıcıya sade teslim mesajını ver. Doğrulama gerçekten mümkün değilse (ATLANDI) bunu açıkça yaz.`;
|
|
43
|
+
|
|
44
|
+
type Block = { type?: string; text?: string; name?: string };
|
|
45
|
+
type Msg = { role?: string; content?: string | Block[]; stopReason?: string };
|
|
46
|
+
const stopWords = /^\s*(dur|durdur|stop|vazgeç|vazgec|iptal)\b/i;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Saf karar: teslim kapisi devam ettirmeli mi? Kosullar: uygulama istegi, dogrulama gecmedi, kapi hakki var,
|
|
50
|
+
* tur iptal/hata ile bitmedi, kullanici "dur" demedi, model kullaniciya soru sorarak durmadi (soru = kullanici bekleniyor).
|
|
51
|
+
*/
|
|
52
|
+
export function shouldGate(a: {
|
|
53
|
+
isApp: boolean;
|
|
54
|
+
userText: string;
|
|
55
|
+
messages: Msg[];
|
|
56
|
+
state?: { verified: boolean; gateUsed: number };
|
|
57
|
+
}): boolean {
|
|
58
|
+
const s = a.state ?? usta;
|
|
59
|
+
if (!a.isApp || s.verified || s.gateUsed >= GATE_MAX || stopWords.test(a.userText)) return false;
|
|
60
|
+
const last = [...a.messages].reverse().find((m) => m.role === "assistant");
|
|
61
|
+
if (!last || last.stopReason === "aborted" || last.stopReason === "error") return false;
|
|
62
|
+
const blocks = Array.isArray(last.content) ? last.content : [];
|
|
63
|
+
if (blocks.some((b) => b.type === "toolCall")) return false; // tur arac cagrisiyla bitmis: devam zaten surecek
|
|
64
|
+
const text = blocks
|
|
65
|
+
.filter((b) => b.type === "text")
|
|
66
|
+
.map((b) => b.text ?? "")
|
|
67
|
+
.join("\n")
|
|
68
|
+
.trim();
|
|
69
|
+
if (/\?\s*$/.test(text) && text.length < 400) return false; // kullaniciya tek soru: cevabini bekle
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// ---------- open_app ----------
|
|
74
|
+
const OPENABLE = new Set([
|
|
75
|
+
".html",
|
|
76
|
+
".htm",
|
|
77
|
+
".xhtml",
|
|
78
|
+
".svg",
|
|
79
|
+
".pdf",
|
|
80
|
+
".png",
|
|
81
|
+
".jpg",
|
|
82
|
+
".jpeg",
|
|
83
|
+
".gif",
|
|
84
|
+
".webp",
|
|
85
|
+
".mp4",
|
|
86
|
+
".webm",
|
|
87
|
+
".txt",
|
|
88
|
+
".md",
|
|
89
|
+
".json",
|
|
90
|
+
]);
|
|
91
|
+
export type Spawner = (
|
|
92
|
+
cmd: string,
|
|
93
|
+
args: string[],
|
|
94
|
+
opts: { detached: boolean; stdio: "ignore"; windowsHide: boolean },
|
|
95
|
+
) => { unref(): void; on?: (e: string, f: () => void) => unknown };
|
|
96
|
+
|
|
97
|
+
export interface OpenPlan {
|
|
98
|
+
cmd: string;
|
|
99
|
+
args: string[];
|
|
100
|
+
target: string;
|
|
101
|
+
}
|
|
102
|
+
/** Hedefi (http(s) URL ya da dosya) dogrular ve platforma gore acma komutunu uretir. Calistirmaz. */
|
|
103
|
+
export function planOpen(raw: string, cwd: string, platform: NodeJS.Platform = process.platform): OpenPlan {
|
|
104
|
+
const t = raw.trim().replace(/^["']|["']$/g, "");
|
|
105
|
+
if (!t) throw new Error("open_app: bos hedef.");
|
|
106
|
+
let target: string;
|
|
107
|
+
if (/^https?:\/\//i.test(t)) {
|
|
108
|
+
target = new URL(t).toString();
|
|
109
|
+
} else {
|
|
110
|
+
target = resolve(cwd, t); // goreli yol cwd'ye gore (model yanlis klasore bakmasin)
|
|
111
|
+
if (!existsSync(target)) throw new Error(`open_app: dosya bulunamadı: ${target}`);
|
|
112
|
+
if (statSync(target).isDirectory()) {
|
|
113
|
+
const idx = resolve(target, "index.html");
|
|
114
|
+
if (!existsSync(idx)) throw new Error(`open_app: klasörde index.html yok: ${target}`);
|
|
115
|
+
target = idx;
|
|
116
|
+
}
|
|
117
|
+
if (!OPENABLE.has(extname(target).toLowerCase()))
|
|
118
|
+
throw new Error(`open_app: bu dosya türü tarayıcıda açılmaz (${extname(target) || "uzantısız"}).`);
|
|
119
|
+
}
|
|
120
|
+
if (platform === "win32") {
|
|
121
|
+
if (/[&|^<>"%\r\n`]/.test(target)) throw new Error("open_app: yolda güvenli olmayan karakter var.");
|
|
122
|
+
return { cmd: "cmd.exe", args: ["/d", "/c", "start", "", target], target };
|
|
123
|
+
}
|
|
124
|
+
if (platform === "darwin") return { cmd: "open", args: [target], target };
|
|
125
|
+
return { cmd: "xdg-open", args: [target], target };
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function openApp(
|
|
129
|
+
raw: string,
|
|
130
|
+
cwd: string,
|
|
131
|
+
headless: boolean,
|
|
132
|
+
spawner: Spawner = spawn as unknown as Spawner,
|
|
133
|
+
): string {
|
|
134
|
+
if (headless) return "Başsız modda açılmadı (ekran yok). Dosya hazır; kullanıcı kendi bilgisayarında açabilir.";
|
|
135
|
+
const p = planOpen(raw, cwd);
|
|
136
|
+
const c = spawner(p.cmd, p.args, { detached: true, stdio: "ignore", windowsHide: true });
|
|
137
|
+
c.on?.("error", () => {});
|
|
138
|
+
c.unref();
|
|
139
|
+
return `Varsayılan tarayıcıda açıldı: ${p.target}`;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// ---------- kayit ----------
|
|
143
|
+
const out = (text: string, isError = false) => ({
|
|
144
|
+
content: [{ type: "text" as const, text }] as Array<
|
|
145
|
+
{ type: "text"; text: string } | { type: "image"; data: string; mimeType: string }
|
|
146
|
+
>,
|
|
147
|
+
details: undefined,
|
|
148
|
+
...(isError ? { isError: true } : {}),
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* 2026-11-12 (örgü mağazası kıyası): ajan ekran görüntüsünü diske yazıyor ama HİÇ görmüyordu → tasarımı kör yapıyordu.
|
|
153
|
+
* Tarayıcı doğrulamasında mobil (yoksa ilk) görüntü modele görsel olarak eklenir; tek görsel (maliyet), 1,5 MB üstü
|
|
154
|
+
* eklenmez. SERA_VERIFY_SHOTS=0 kapatır.
|
|
155
|
+
*/
|
|
156
|
+
export function shotForModel(shots: string[]): { type: "image"; data: string; mimeType: string } | undefined {
|
|
157
|
+
if (process.env.SERA_VERIFY_SHOTS === "0" || !shots.length) return undefined;
|
|
158
|
+
const pick = shots.find((f) => /mobil\.png$/i.test(f)) ?? shots[0]!;
|
|
159
|
+
try {
|
|
160
|
+
if (statSync(pick).size > 1_500_000) return undefined;
|
|
161
|
+
return { type: "image", data: readFileSync(pick).toString("base64"), mimeType: "image/png" };
|
|
162
|
+
} catch {
|
|
163
|
+
return undefined;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface AppToolOpts {
|
|
168
|
+
/** Dogrulama GECINCE sonuca eklenecek tek seferlik teklif metni (bos/undefined = yok). Proje basina durumu cagiran tutar. */
|
|
169
|
+
offer?: (cwd: string) => Promise<string | undefined>;
|
|
170
|
+
}
|
|
171
|
+
export function registerAppTools(pi: ExtensionAPI, opts: AppToolOpts = {}): void {
|
|
172
|
+
pi.registerTool({
|
|
173
|
+
name: "app_verify",
|
|
174
|
+
label: "App verify",
|
|
175
|
+
exposure: rareExposure(),
|
|
176
|
+
description:
|
|
177
|
+
"Yapılan uygulamayı GERÇEKTEN çalıştırıp doğrular; sonuç GEÇTİ/KALDI/ATLANDI. path=.html dosyası ya da klasör (veya localhost URL): başsız Edge/Chrome'da açar, konsol hatası+yakalanmamış istisna+başarısız ağ isteği+boş sayfa toplar, masaüstü ve 390px mobil ekran görüntüsü kaydeder; actions=['press:ArrowRight','click:#basla','wait:500'] ile etkileşim sonrası tekrar bakar. command='npm test'/'python x.py': çıkış kodu+son satırlar. serve_command+port: sunucuyu arka planda başlatır, HTTP+tarayıcı kontrolü yapar, kapatır.",
|
|
178
|
+
promptSnippet:
|
|
179
|
+
"Run/verify the built app for real (html in headless browser, command, or server): PASS/FAIL + screenshots",
|
|
180
|
+
parameters: Type.Object({
|
|
181
|
+
path: Type.Optional(
|
|
182
|
+
Type.String({ description: ".html dosyası, index.html olan klasör ya da http://localhost:PORT/..." }),
|
|
183
|
+
),
|
|
184
|
+
command: Type.Optional(
|
|
185
|
+
Type.String({
|
|
186
|
+
description: "Çalıştırılıp çıkış kodu denetlenecek komut (npm test, python x.py, node x.js)",
|
|
187
|
+
}),
|
|
188
|
+
),
|
|
189
|
+
serve_command: Type.Optional(
|
|
190
|
+
Type.String({ description: "Sunucu uygulaması başlatma komutu (arka planda çalışır, sonunda kapatılır)" }),
|
|
191
|
+
),
|
|
192
|
+
port: Type.Optional(Type.Number({ description: "serve_command için dinlenen port" })),
|
|
193
|
+
actions: Type.Optional(
|
|
194
|
+
Type.Array(Type.String(), { description: "press:Tus | click:css-secici | type:metin | wait:ms" }),
|
|
195
|
+
),
|
|
196
|
+
timeout_s: Type.Optional(
|
|
197
|
+
Type.Number({ description: "command için zaman aşımı sn (varsayılan 120, en çok 600)" }),
|
|
198
|
+
),
|
|
199
|
+
}),
|
|
200
|
+
async execute(_id, params, signal, _u, ctx) {
|
|
201
|
+
const p = params as {
|
|
202
|
+
path?: string;
|
|
203
|
+
command?: string;
|
|
204
|
+
serve_command?: string;
|
|
205
|
+
port?: number;
|
|
206
|
+
actions?: string[];
|
|
207
|
+
timeout_s?: number;
|
|
208
|
+
};
|
|
209
|
+
const cwd = (ctx as { cwd?: string } | undefined)?.cwd ?? process.cwd();
|
|
210
|
+
try {
|
|
211
|
+
const shellCmd = p.serve_command ?? p.command;
|
|
212
|
+
if (shellCmd) {
|
|
213
|
+
const d = classifyCommand(shellCmd);
|
|
214
|
+
if (d.verdict === "deny")
|
|
215
|
+
return out(`KALDI — komut güvenlik politikasınca engellendi: ${d.reason ?? shellCmd}`, true);
|
|
216
|
+
}
|
|
217
|
+
let r: VerifyResult;
|
|
218
|
+
if (p.serve_command) {
|
|
219
|
+
if (!p.port) return out("serve_command için port gerekli.", true);
|
|
220
|
+
r = await verifyServer(p.serve_command, p.port, cwd, { actions: p.actions, signal });
|
|
221
|
+
} else if (p.command) {
|
|
222
|
+
r = await runCommandCheck(p.command, cwd, Math.min(600, Math.max(5, p.timeout_s ?? 120)) * 1000, signal);
|
|
223
|
+
} else if (p.path) {
|
|
224
|
+
const t = resolveTarget(p.path, cwd);
|
|
225
|
+
r = await verifyInBrowser({ url: t.url, label: t.label, actions: p.actions, signal });
|
|
226
|
+
} else return out("path, command ya da serve_command verilmeli.", true);
|
|
227
|
+
if (r.status === "GEÇTİ" || r.status === "ATLANDI") usta.verified = true;
|
|
228
|
+
if (r.status === "GEÇTİ" && opts.offer) {
|
|
229
|
+
let teklif: string | undefined;
|
|
230
|
+
try {
|
|
231
|
+
teklif = await opts.offer(cwd);
|
|
232
|
+
} catch {
|
|
233
|
+
// teklif asla dogrulamayi bozmaz
|
|
234
|
+
}
|
|
235
|
+
if (teklif)
|
|
236
|
+
return out(`${r.text}
|
|
237
|
+
|
|
238
|
+
${teklif}`);
|
|
239
|
+
}
|
|
240
|
+
const res = out(r.text);
|
|
241
|
+
const img = p.command ? undefined : shotForModel(r.screenshots);
|
|
242
|
+
if (img) {
|
|
243
|
+
res.content.push({
|
|
244
|
+
type: "text",
|
|
245
|
+
text: "Mobil ekran görüntüsü ekte: TASARIMA BAK (hiyerarşi, boşluk, hizalama, yazı tipi, ikon, renk). Profesyonel görünmüyorsa düzelt ve tekrar doğrula.",
|
|
246
|
+
});
|
|
247
|
+
res.content.push(img);
|
|
248
|
+
}
|
|
249
|
+
return res;
|
|
250
|
+
} catch (e) {
|
|
251
|
+
return out(`KALDI — app_verify çalıştırılamadı: ${e instanceof Error ? e.message : String(e)}`, true);
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
pi.registerTool({
|
|
257
|
+
name: "open_app",
|
|
258
|
+
label: "Open app",
|
|
259
|
+
exposure: rareExposure(),
|
|
260
|
+
description:
|
|
261
|
+
"Dosyayı (.html vb.) ya da http(s) adresini kullanıcının VARSAYILAN TARAYICISINDA açar; beklemez. Göreli yol çalışma klasörüne göre çözülür. Bash `start` yerine bunu kullan. Başsız (run) modda açmaz.",
|
|
262
|
+
promptSnippet: "Open a file or URL in the user's default browser (detached, non-blocking)",
|
|
263
|
+
parameters: Type.Object({
|
|
264
|
+
target: Type.String({ description: "Dosya yolu (göreli olabilir) ya da http(s) adresi" }),
|
|
265
|
+
}),
|
|
266
|
+
async execute(_id, params, _s, _u, ctx) {
|
|
267
|
+
const c = ctx as { cwd?: string; hasUI?: boolean } | undefined;
|
|
268
|
+
try {
|
|
269
|
+
return out(openApp((params as { target: string }).target, c?.cwd ?? process.cwd(), c?.hasUI === false));
|
|
270
|
+
} catch (e) {
|
|
271
|
+
return out(e instanceof Error ? e.message : String(e), true);
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
});
|
|
275
|
+
}
|