@dsmm/dsmm 0.1.8 → 0.2.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/README.md +40 -22
- package/agent-presets/dsmm-builder/agent.cordis.yml +1949 -39
- package/agent-presets/dsmm-builder/preset.yml +1 -1
- package/agent-presets/dsmm-clarifier/agent.cordis.yml +436 -14
- package/agent-presets/dsmm-clarifier/preset.yml +1 -1
- package/agent-presets/dsmm-code-search/agent.cordis.yml +56 -14
- package/agent-presets/dsmm-code-search/preset.yml +1 -1
- package/agent-presets/dsmm-coding/agent.cordis.yml +588 -0
- package/agent-presets/dsmm-coding/preset.yml +3 -0
- package/agent-presets/dsmm-complex/agent.cordis.yml +1140 -0
- package/agent-presets/dsmm-complex/preset.yml +3 -0
- package/agent-presets/dsmm-creative/agent.cordis.yml +536 -12
- package/agent-presets/dsmm-creative/preset.yml +1 -1
- package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +1163 -0
- package/agent-presets/dsmm-cross-cutting/preset.yml +3 -0
- package/agent-presets/dsmm-deep/agent.cordis.yml +1173 -0
- package/agent-presets/dsmm-deep/preset.yml +3 -0
- package/agent-presets/dsmm-doc-search/agent.cordis.yml +56 -14
- package/agent-presets/dsmm-doc-search/preset.yml +1 -1
- package/agent-presets/dsmm-documenting/agent.cordis.yml +581 -0
- package/agent-presets/dsmm-documenting/preset.yml +3 -0
- package/agent-presets/dsmm-frontend/agent.cordis.yml +580 -0
- package/agent-presets/dsmm-frontend/preset.yml +3 -0
- package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +572 -0
- package/agent-presets/dsmm-hard-reasoning/preset.yml +3 -0
- package/agent-presets/dsmm-media-reader/agent.cordis.yml +56 -14
- package/agent-presets/dsmm-media-reader/preset.yml +1 -1
- package/agent-presets/dsmm-normal-task/agent.cordis.yml +546 -0
- package/agent-presets/dsmm-normal-task/preset.yml +3 -0
- package/agent-presets/dsmm-oracle/agent.cordis.yml +421 -12
- package/agent-presets/dsmm-oracle/preset.yml +1 -1
- package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +421 -12
- package/agent-presets/dsmm-oracle-2nd/preset.yml +1 -1
- package/agent-presets/dsmm-orchestrator/agent.cordis.yml +2023 -43
- package/agent-presets/dsmm-orchestrator/preset.yml +1 -1
- package/agent-presets/dsmm-plan-critic/agent.cordis.yml +416 -13
- package/agent-presets/dsmm-plan-critic/preset.yml +1 -1
- package/agent-presets/dsmm-planner/agent.cordis.yml +462 -13
- package/agent-presets/dsmm-planner/preset.yml +1 -1
- package/agent-presets/dsmm-quick/agent.cordis.yml +119 -0
- package/agent-presets/dsmm-quick/preset.yml +3 -0
- package/agent-presets/dsmm-research/agent.cordis.yml +141 -0
- package/agent-presets/dsmm-research/preset.yml +3 -0
- package/agent-presets/dsmm-reviewer/agent.cordis.yml +420 -13
- package/agent-presets/dsmm-reviewer/preset.yml +1 -1
- package/cordis.patch.yml +1 -5
- package/docs/agent-presets.md +64 -15
- package/docs/compatibility.md +67 -17
- package/docs/design.md +41 -0
- package/docs/lsp.md +12 -2
- package/docs/migration-from-ocmm.md +8 -0
- package/docs/profiles.md +42 -16
- package/docs/releasing.md +100 -28
- package/docs/roadmap.md +6 -0
- package/docs/runtime-recovery.md +12 -0
- package/docs/safety-guards.md +7 -3
- package/docs/settings-status.md +148 -7
- package/docs/skill-sync.md +52 -14
- package/lib/client/DeploymentPage.d.ts +18 -0
- package/lib/client/DeploymentPage.js +120 -0
- package/lib/client/ProfilesSection.js +4 -2
- package/lib/client/deployment-controller.d.ts +50 -0
- package/lib/client/deployment-controller.js +193 -0
- package/lib/client/deployment-data.d.ts +16 -0
- package/lib/client/deployment-data.js +109 -0
- package/lib/client/deployment-locales.d.ts +66 -0
- package/lib/client/deployment-locales.js +72 -0
- package/lib/client/index.js +50 -0
- package/lib/client/locales.d.ts +4 -0
- package/lib/client/locales.js +4 -2
- package/lib/client/plugins-contract.d.ts +27 -0
- package/lib/client/plugins-contract.js +2 -0
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +16 -0
- package/lib/client.js +1048 -29
- package/lib/commands.js +3 -0
- package/lib/config-file-store.d.ts +23 -0
- package/lib/config-file-store.js +67 -0
- package/lib/deployment-config.d.ts +37 -0
- package/lib/deployment-config.js +184 -0
- package/lib/dsh-home.d.ts +3 -0
- package/lib/dsh-home.js +10 -0
- package/lib/dsh-types.d.ts +12 -65
- package/lib/guards.d.ts +2 -1
- package/lib/guards.js +19 -2
- package/lib/index.d.ts +8 -1
- package/lib/index.js +115 -25
- package/lib/lsp.d.ts +13 -0
- package/lib/lsp.js +60 -0
- package/lib/mode.js +42 -47
- package/lib/model-routing.js +5 -2
- package/lib/modules.d.ts +27 -0
- package/lib/modules.js +21 -0
- package/lib/native-scope.d.ts +9 -0
- package/lib/native-scope.js +20 -0
- package/lib/plan-validation.js +6 -44
- package/lib/preset-materializer.js +2 -0
- package/lib/preset-registry.d.ts +1 -1
- package/lib/preset-registry.js +7 -4
- package/lib/preset-skills.d.ts +4 -1
- package/lib/preset-skills.js +60 -19
- package/lib/profile-remote.d.ts +14 -0
- package/lib/profile-remote.js +197 -4
- package/lib/profile-rpc.d.ts +24 -1
- package/lib/profile-rpc.js +139 -1
- package/lib/profile-runtime.d.ts +24 -0
- package/lib/profile-runtime.js +177 -33
- package/lib/profile-store.d.ts +45 -1
- package/lib/profile-store.js +236 -102
- package/lib/profile-types.d.ts +55 -0
- package/lib/prompt-content.d.ts +25 -0
- package/lib/prompt-content.js +27 -0
- package/lib/prompts.d.ts +8 -2
- package/lib/prompts.js +46 -34
- package/lib/role-policy.d.ts +51 -0
- package/lib/role-policy.js +224 -0
- package/lib/role-providers.d.ts +6 -2
- package/lib/role-providers.js +72 -39
- package/lib/role-subagents.d.ts +6 -2
- package/lib/role-subagents.js +187 -48
- package/lib/roles.d.ts +16 -4
- package/lib/roles.js +86 -186
- package/lib/runtime-recovery.js +16 -5
- package/lib/session-scope.js +2 -0
- package/lib/settings.d.ts +69 -1
- package/lib/settings.js +262 -91
- package/lib/skills.d.ts +24 -9
- package/lib/skills.js +114 -35
- package/lib/state.d.ts +10 -6
- package/lib/state.js +48 -49
- package/lib/status.d.ts +25 -0
- package/lib/status.js +47 -9
- package/locale/en.json +2 -2
- package/locale/zh.json +2 -2
- package/package.json +19 -2
- package/prompts/deepwork.md +144 -20
- package/prompts/source/agents/clarifier.md +45 -0
- package/prompts/source/agents/orchestrator.md +63 -0
- package/prompts/source/agents/plan-critic.md +25 -0
- package/prompts/source/agents/planner.md +19 -0
- package/prompts/source/agents/reviewer.md +17 -0
- package/prompts/source/catalog.json +548 -0
- package/prompts/source/category/coding.md +46 -0
- package/prompts/source/category/complex.md +29 -0
- package/prompts/source/category/creative.md +38 -0
- package/prompts/source/category/cross-cutting.md +52 -0
- package/prompts/source/category/deep.md +62 -0
- package/prompts/source/category/documenting.md +62 -0
- package/prompts/source/category/frontend.md +38 -0
- package/prompts/source/category/hard-reasoning.md +53 -0
- package/prompts/source/category/normal-task.md +27 -0
- package/prompts/source/category/quick.md +34 -0
- package/prompts/source/category/research.md +56 -0
- package/prompts/source/deepwork/claude-opus-5.md +28 -0
- package/prompts/source/deepwork/codex.md +9 -0
- package/prompts/source/deepwork/default.md +129 -0
- package/prompts/source/deepwork/gemini.md +184 -0
- package/prompts/source/deepwork/glm.md +256 -0
- package/prompts/source/deepwork/gpt.md +43 -0
- package/prompts/source/deepwork/kimi-k27.md +13 -0
- package/prompts/source/deepwork/planner.md +41 -0
- package/prompts/source/deepwork/swe-2.md +13 -0
- package/prompts/source/manifest.json +3118 -0
- package/prompts/source/shared/dsh-host-contract.md +6 -0
- package/prompts/source/shared/locale.md +8 -0
- package/prompts/source/shared/shell-safety.md +7 -0
- package/prompts/source/terminal/builder.md +13 -0
- package/prompts/source/terminal/clarifier.md +41 -0
- package/prompts/source/terminal/code-search.md +39 -0
- package/prompts/source/terminal/coding.md +41 -0
- package/prompts/source/terminal/complex.md +43 -0
- package/prompts/source/terminal/creative.md +41 -0
- package/prompts/source/terminal/cross-cutting.md +43 -0
- package/prompts/source/terminal/deep.md +43 -0
- package/prompts/source/terminal/doc-search.md +39 -0
- package/prompts/source/terminal/documenting.md +41 -0
- package/prompts/source/terminal/frontend.md +41 -0
- package/prompts/source/terminal/hard-reasoning.md +41 -0
- package/prompts/source/terminal/media-reader.md +39 -0
- package/prompts/source/terminal/normal-task.md +41 -0
- package/prompts/source/terminal/oracle-2nd.md +53 -0
- package/prompts/source/terminal/oracle.md +53 -0
- package/prompts/source/terminal/orchestrator.md +26 -0
- package/prompts/source/terminal/plan-critic.md +41 -0
- package/prompts/source/terminal/planner.md +42 -0
- package/prompts/source/terminal/quick.md +39 -0
- package/prompts/source/terminal/research.md +39 -0
- package/prompts/source/terminal/reviewer.md +53 -0
- package/skills/ast-grep/LICENSE +21 -0
- package/skills/ast-grep/README.md +138 -0
- package/skills/ast-grep/SKILL.md +284 -0
- package/skills/ast-grep/SOURCE +1 -0
- package/skills/ast-grep/install.ps1 +235 -0
- package/skills/ast-grep/install.sh +286 -0
- package/skills/ast-grep/references/cli.md +233 -0
- package/skills/ast-grep/references/install.md +168 -0
- package/skills/ast-grep/references/patterns.md +149 -0
- package/skills/ast-grep/references/pitfalls.md +305 -0
- package/skills/ast-grep/references/recipes.md +404 -0
- package/skills/ast-grep/references/sgconfig.md +250 -0
- package/skills/ast-grep/references/yaml-rules.md +511 -0
- package/skills/ast-grep/scripts/ast_grep_helper.py +760 -0
- package/skills/ast-grep/tests/smoke.ps1 +129 -0
- package/skills/ast-grep/tests/smoke.sh +212 -0
- package/skills/ast-grep/tests/test_resolver.py +154 -0
- package/skills/brainstorming/SKILL.md +102 -9
- package/skills/coding-agent-sessions/LICENSE-UPSTREAM.md +82 -0
- package/skills/coding-agent-sessions/NOTICE.md +24 -0
- package/skills/coding-agent-sessions/SKILL.md +144 -0
- package/skills/coding-agent-sessions/agents/openai.yaml +4 -0
- package/skills/coding-agent-sessions/pyrightconfig.json +5 -0
- package/skills/coding-agent-sessions/references/all-platforms.md +77 -0
- package/skills/coding-agent-sessions/references/claude.md +34 -0
- package/skills/coding-agent-sessions/references/codex.md +32 -0
- package/skills/coding-agent-sessions/references/opencode.md +45 -0
- package/skills/coding-agent-sessions/references/senpi.md +29 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/__init__.py +1 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/aside_scanner.py +140 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/claude.py +66 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +283 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/codex.py +105 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/file_scanners.py +275 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/jsonio.py +55 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/kiro_scanner.py +91 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/opencode.py +289 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +46 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +104 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_optional_scanners.py +203 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_scanners.py +177 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/timeparse.py +51 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/transcript.py +149 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/types.py +57 -0
- package/skills/coding-agent-sessions/scripts/find-agent-sessions.py +19 -0
- package/skills/coding-agent-sessions/scripts/tests/test_agent_sessions.py +322 -0
- package/skills/coding-agent-sessions/scripts/tests/test_aside_scanner.py +131 -0
- package/skills/coding-agent-sessions/scripts/tests/test_cli_contract.py +126 -0
- package/skills/coding-agent-sessions/scripts/tests/test_extended_scanners.py +262 -0
- package/skills/coding-agent-sessions/scripts/tests/test_optional_sqlite_scanners.py +79 -0
- package/skills/coding-agent-sessions/scripts/tests/test_pi_family_scanners.py +130 -0
- package/skills/debugging/SKILL.md +125 -4
- package/skills/debugging/references/logging.md +2 -0
- package/skills/debugging/references/methodology/00-setup.md +2 -0
- package/skills/debugging/references/methodology/02-investigate.md +8 -2
- package/skills/debugging/references/methodology/03-flaky-triage.md +3 -1
- package/skills/debugging/references/methodology/04-hard-reasoning-escalation.md +4 -2
- package/skills/debugging/references/methodology/05-escalate.md +2 -0
- package/skills/debugging/references/methodology/06-fix.md +2 -0
- package/skills/debugging/references/methodology/08-qa.md +2 -0
- package/skills/debugging/references/methodology/09-cleanup.md +2 -0
- package/skills/debugging/references/methodology/partial-runtime-evidence.md +4 -2
- package/skills/debugging/references/runtimes/bundled-js-binary.md +2 -0
- package/skills/debugging/references/runtimes/go.md +2 -0
- package/skills/debugging/references/runtimes/native-binary.md +2 -0
- package/skills/debugging/references/runtimes/node.md +2 -0
- package/skills/debugging/references/runtimes/python.md +2 -0
- package/skills/debugging/references/runtimes/rust.md +2 -0
- package/skills/debugging/references/scripts/dap.test.mjs +539 -0
- package/skills/debugging/references/scripts/fixture-adapter.mjs +164 -0
- package/skills/debugging/references/tools/dap.md +3 -1
- package/skills/debugging/references/tools/ghidra.md +2 -0
- package/skills/debugging/references/tools/playwright-cli.md +2 -0
- package/skills/debugging/references/tools/pwndbg.md +2 -0
- package/skills/debugging/references/tools/pwntools.md +2 -0
- package/skills/dispatching-parallel-agents/SKILL.md +94 -7
- package/skills/frontend/.frontend-materialized.json +856 -0
- package/skills/frontend/ATTRIBUTION.md +37 -0
- package/skills/frontend/LICENSE-Apache-2.0.txt +201 -0
- package/skills/frontend/LICENSE-taste-skill.txt +21 -0
- package/skills/frontend/LICENSE-ui-ux-pro-max.txt +21 -0
- package/skills/frontend/SKILL.md +142 -0
- package/skills/frontend/references/design/README.md +256 -0
- package/skills/frontend/references/design/_INDEX.md +206 -0
- package/skills/frontend/references/design/airbnb.md +393 -0
- package/skills/frontend/references/design/airtable.md +92 -0
- package/skills/frontend/references/design/apple.md +250 -0
- package/skills/frontend/references/design/aside.md +211 -0
- package/skills/frontend/references/design/binance.md +348 -0
- package/skills/frontend/references/design/bmw.md +183 -0
- package/skills/frontend/references/design/brutalist-skill.md +92 -0
- package/skills/frontend/references/design/bugatti.md +271 -0
- package/skills/frontend/references/design/cal.md +262 -0
- package/skills/frontend/references/design/claude.md +315 -0
- package/skills/frontend/references/design/clay.md +307 -0
- package/skills/frontend/references/design/clickhouse.md +284 -0
- package/skills/frontend/references/design/clone-from-url.md +69 -0
- package/skills/frontend/references/design/cohere.md +269 -0
- package/skills/frontend/references/design/coinbase.md +132 -0
- package/skills/frontend/references/design/composio.md +310 -0
- package/skills/frontend/references/design/cursor.md +312 -0
- package/skills/frontend/references/design/design-system-architecture.md +250 -0
- package/skills/frontend/references/design/elevenlabs.md +268 -0
- package/skills/frontend/references/design/expo.md +284 -0
- package/skills/frontend/references/design/ferrari.md +317 -0
- package/skills/frontend/references/design/figma.md +223 -0
- package/skills/frontend/references/design/framer.md +249 -0
- package/skills/frontend/references/design/gpt-tasteskill.md +74 -0
- package/skills/frontend/references/design/hashicorp.md +281 -0
- package/skills/frontend/references/design/ibm.md +335 -0
- package/skills/frontend/references/design/image-to-code-skill.md +1228 -0
- package/skills/frontend/references/design/imagegen-brandkit.md +798 -0
- package/skills/frontend/references/design/imagegen-frontend-mobile.md +1465 -0
- package/skills/frontend/references/design/imagegen-frontend-web.md +987 -0
- package/skills/frontend/references/design/interaction-skill.md +52 -0
- package/skills/frontend/references/design/intercom.md +149 -0
- package/skills/frontend/references/design/kraken.md +128 -0
- package/skills/frontend/references/design/lamborghini.md +291 -0
- package/skills/frontend/references/design/linear.app.md +370 -0
- package/skills/frontend/references/design/lovable.md +301 -0
- package/skills/frontend/references/design/mastercard.md +368 -0
- package/skills/frontend/references/design/meta.md +369 -0
- package/skills/frontend/references/design/minimalist-skill.md +85 -0
- package/skills/frontend/references/design/minimax.md +260 -0
- package/skills/frontend/references/design/mintlify.md +329 -0
- package/skills/frontend/references/design/miro.md +111 -0
- package/skills/frontend/references/design/mistral.ai.md +264 -0
- package/skills/frontend/references/design/mongodb.md +269 -0
- package/skills/frontend/references/design/nike.md +366 -0
- package/skills/frontend/references/design/notion.md +312 -0
- package/skills/frontend/references/design/nvidia.md +296 -0
- package/skills/frontend/references/design/ollama.md +270 -0
- package/skills/frontend/references/design/opencode.ai.md +284 -0
- package/skills/frontend/references/design/output-skill.md +49 -0
- package/skills/frontend/references/design/pinterest.md +233 -0
- package/skills/frontend/references/design/playstation.md +367 -0
- package/skills/frontend/references/design/posthog.md +259 -0
- package/skills/frontend/references/design/raycast.md +271 -0
- package/skills/frontend/references/design/react-dev-tooling-skill.md +232 -0
- package/skills/frontend/references/design/redesign-skill.md +178 -0
- package/skills/frontend/references/design/renault.md +314 -0
- package/skills/frontend/references/design/replicate.md +264 -0
- package/skills/frontend/references/design/resend.md +306 -0
- package/skills/frontend/references/design/revolut.md +188 -0
- package/skills/frontend/references/design/runwayml.md +247 -0
- package/skills/frontend/references/design/sanity.md +360 -0
- package/skills/frontend/references/design/sentry.md +265 -0
- package/skills/frontend/references/design/shopify.md +353 -0
- package/skills/frontend/references/design/soft-skill.md +98 -0
- package/skills/frontend/references/design/spacex.md +197 -0
- package/skills/frontend/references/design/spotify.md +249 -0
- package/skills/frontend/references/design/starbucks.md +583 -0
- package/skills/frontend/references/design/stitch-design-example.md +121 -0
- package/skills/frontend/references/design/stitch-skill.md +184 -0
- package/skills/frontend/references/design/stripe.md +325 -0
- package/skills/frontend/references/design/supabase.md +258 -0
- package/skills/frontend/references/design/superhuman.md +255 -0
- package/skills/frontend/references/design/taste-skill.md +1206 -0
- package/skills/frontend/references/design/tesla.md +289 -0
- package/skills/frontend/references/design/theverge.md +342 -0
- package/skills/frontend/references/design/together.ai.md +266 -0
- package/skills/frontend/references/design/uber.md +298 -0
- package/skills/frontend/references/design/vercel.md +313 -0
- package/skills/frontend/references/design/vodafone.md +426 -0
- package/skills/frontend/references/design/voltagent.md +326 -0
- package/skills/frontend/references/design/warp.md +256 -0
- package/skills/frontend/references/design/webflow.md +95 -0
- package/skills/frontend/references/design/wired.md +281 -0
- package/skills/frontend/references/design/wise.md +176 -0
- package/skills/frontend/references/design/x.ai.md +260 -0
- package/skills/frontend/references/design/zapier.md +331 -0
- package/skills/frontend/references/perfection/README.md +264 -0
- package/skills/frontend/references/perfection/react-perf-tooling.md +234 -0
- package/skills/frontend/references/ui-ux-db/README.md +659 -0
- package/skills/frontend/references/ui-ux-db/data/app-interface.csv +31 -0
- package/skills/frontend/references/ui-ux-db/data/charts.csv +26 -0
- package/skills/frontend/references/ui-ux-db/data/colors.csv +162 -0
- package/skills/frontend/references/ui-ux-db/data/google-fonts.csv +1924 -0
- package/skills/frontend/references/ui-ux-db/data/icons.csv +106 -0
- package/skills/frontend/references/ui-ux-db/data/landing.csv +35 -0
- package/skills/frontend/references/ui-ux-db/data/products.csv +162 -0
- package/skills/frontend/references/ui-ux-db/data/react-performance.csv +45 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/angular.csv +51 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/astro.csv +54 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/jetpack-compose.csv +53 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/laravel.csv +51 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/nuxt-ui.csv +51 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/nuxtjs.csv +59 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/react-native.csv +52 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/shadcn.csv +61 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/threejs.csv +54 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -0
- package/skills/frontend/references/ui-ux-db/data/styles.csv +85 -0
- package/skills/frontend/references/ui-ux-db/data/typography.csv +74 -0
- package/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +162 -0
- package/skills/frontend/references/ui-ux-db/data/ux-guidelines.csv +100 -0
- package/skills/frontend/references/ui-ux-db/data/web-interface.csv +31 -0
- package/skills/frontend/references/ui-ux-db/scripts/core.py +262 -0
- package/skills/frontend/references/ui-ux-db/scripts/design_system.py +1148 -0
- package/skills/frontend/references/ui-ux-db/scripts/search.py +114 -0
- package/skills/frontend/scripts/perfection/lighthouse-audit.py +201 -0
- package/skills/git-master/SKILL.md +112 -0
- package/skills/git-master/agents/openai.yaml +13 -0
- package/skills/init-deep/SKILL.md +279 -0
- package/skills/receiving-code-review/SKILL.md +112 -7
- package/skills/remove-ai-slops/SKILL.md +159 -8
- package/skills/requesting-code-review/SKILL.md +96 -3
- package/skills/requesting-code-review/code-reviewer.md +47 -0
- package/skills/subagent-driven-development/SKILL.md +176 -6
- package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +23 -0
- package/skills/subagent-driven-development/implementer-prompt.md +69 -0
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +32 -0
- package/skills/using-git-worktrees/SKILL.md +141 -0
- package/skills/writing-plans/SKILL.md +121 -7
- package/skills/writing-plans/plan-document-reviewer-prompt.md +38 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# License
|
|
2
|
+
|
|
3
|
+
Portions of this software are licensed as follows:
|
|
4
|
+
|
|
5
|
+
- All third party components incorporated into the oh-my-opencode Software are licensed under the original license
|
|
6
|
+
provided by the owner of the applicable component.
|
|
7
|
+
- Content outside of the above mentioned files or restrictions is available under the "Sustainable Use
|
|
8
|
+
License" as defined below.
|
|
9
|
+
|
|
10
|
+
## Sustainable Use License
|
|
11
|
+
|
|
12
|
+
Version 1.0
|
|
13
|
+
|
|
14
|
+
### Acceptance
|
|
15
|
+
|
|
16
|
+
By using the software, you agree to all of the terms and conditions below.
|
|
17
|
+
|
|
18
|
+
### Copyright License
|
|
19
|
+
|
|
20
|
+
The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license
|
|
21
|
+
to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject
|
|
22
|
+
to the limitations below.
|
|
23
|
+
|
|
24
|
+
### Limitations
|
|
25
|
+
|
|
26
|
+
You may use or modify the software only for your own internal business purposes or for non-commercial or
|
|
27
|
+
personal use. You may distribute the software or provide it to others only if you do so free of charge for
|
|
28
|
+
non-commercial purposes. You may not alter, remove, or obscure any licensing, copyright, or other notices of
|
|
29
|
+
the licensor in the software. Any use of the licensor's trademarks is subject to applicable law.
|
|
30
|
+
|
|
31
|
+
### Patents
|
|
32
|
+
|
|
33
|
+
The licensor grants you a license, under any patent claims the licensor can license, or becomes able to
|
|
34
|
+
license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case
|
|
35
|
+
subject to the limitations and conditions in this license. This license does not cover any patent claims that
|
|
36
|
+
you cause to be infringed by modifications or additions to the software. If you or your company make any
|
|
37
|
+
written claim that the software infringes or contributes to infringement of any patent, your patent license
|
|
38
|
+
for the software granted under these terms ends immediately. If your company makes such a claim, your patent
|
|
39
|
+
license ends immediately for work on behalf of your company.
|
|
40
|
+
|
|
41
|
+
### Notices
|
|
42
|
+
|
|
43
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these
|
|
44
|
+
terms. If you modify the software, you must include in any modified copies of the software a prominent notice
|
|
45
|
+
stating that you have modified the software.
|
|
46
|
+
|
|
47
|
+
### No Other Rights
|
|
48
|
+
|
|
49
|
+
These terms do not imply any licenses other than those expressly granted in these terms.
|
|
50
|
+
|
|
51
|
+
### Termination
|
|
52
|
+
|
|
53
|
+
If you use the software in violation of these terms, such use is not licensed, and your license will
|
|
54
|
+
automatically terminate. If the licensor provides you with a notice of your violation, and you cease all
|
|
55
|
+
violation of this license no later than 30 days after you receive that notice, your license will be reinstated
|
|
56
|
+
retroactively. However, if you violate these terms after such reinstatement, any additional violation of these
|
|
57
|
+
terms will cause your license to terminate automatically and permanently.
|
|
58
|
+
|
|
59
|
+
### No Liability
|
|
60
|
+
|
|
61
|
+
As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will
|
|
62
|
+
not be liable to you for any damages arising out of these terms or the use or nature of the software, under
|
|
63
|
+
any kind of legal claim.
|
|
64
|
+
|
|
65
|
+
### Definitions
|
|
66
|
+
|
|
67
|
+
The "licensor" is the entity offering these terms.
|
|
68
|
+
|
|
69
|
+
The "software" is the software the licensor makes available under these terms, including any portion of it.
|
|
70
|
+
|
|
71
|
+
"You" refers to the individual or entity agreeing to these terms.
|
|
72
|
+
|
|
73
|
+
"Your company" is any legal entity, sole proprietorship, or other kind of organization that you work for, plus
|
|
74
|
+
all organizations that have control over, are under the control of, or are under common control with that
|
|
75
|
+
organization. Control means ownership of substantially all the assets of an entity, or the power to direct its
|
|
76
|
+
management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
77
|
+
|
|
78
|
+
"Your license" is the license granted to you for the software under these terms.
|
|
79
|
+
|
|
80
|
+
"Use" means anything you do with the software requiring your license.
|
|
81
|
+
|
|
82
|
+
"Trademark" means trademarks, service marks, and similar rights.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Coding Agent Sessions Upstream Notice
|
|
2
|
+
|
|
3
|
+
This subtree was imported from `code-yeongyu/oh-my-openagent`, source path
|
|
4
|
+
`packages/shared-skills/skills/coding-agent-sessions/`, at revision
|
|
5
|
+
`f2872273d6866026a2262315e54dbf21760154d3`.
|
|
6
|
+
|
|
7
|
+
Relevant upstream history includes initial commit
|
|
8
|
+
`dff394666c766a1e683e71f4d68a2f6b66986eea` and Aside commits
|
|
9
|
+
`f2a1d761b93c4e75e7a1aec20a0a97c51667f645`,
|
|
10
|
+
`aaaba202bcf2cd8ed84020f9dda31ef7ab309cc2`, and
|
|
11
|
+
`cb8d15136bb395af7368cc8ce2528f12ac277c5e`.
|
|
12
|
+
|
|
13
|
+
Upstream attribution: Copyright (c) Yeongyu Kim and contributors.
|
|
14
|
+
|
|
15
|
+
The Sustainable Use License 1.0 is reproduced in
|
|
16
|
+
[LICENSE-UPSTREAM.md](LICENSE-UPSTREAM.md).
|
|
17
|
+
|
|
18
|
+
The imported upstream files are raw-byte preserved in this source tree. The
|
|
19
|
+
ocmm additions are this notice and the license copy; later distribution
|
|
20
|
+
filtering may omit development-only files from generated or package artifacts.
|
|
21
|
+
|
|
22
|
+
This subtree remains governed by [LICENSE-UPSTREAM.md](LICENSE-UPSTREAM.md).
|
|
23
|
+
It does not change the AAAPL licensing of the rest of ocmm, and ocmm makes no
|
|
24
|
+
claim to relicense the upstream files.
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: coding-agent-sessions
|
|
3
|
+
description: "MUST USE when asked to find, read, list, search, inspect, fetch, export, or reconstruct coding-agent sessions across Codex, Claude Code/Desktop, OpenCode, Senpi/pi, oh-my-pi (omp), gajae-code (gjc), OpenClaw, Factory Droid, Amp, Gemini/Kimi/Qwen CLIs, Codebuff, Roo/Kilo/Cline, Kodu, Cursor CLI, Aider, Aside browser-agent sessions, or unknown local agent logs. Covers transcripts, session IDs, rollout JSONL, state SQLite, Claude projects/pre-compact histories, OpenCode messages/parts, child/subagent linkage, cwd/model/time/token filters, archives, and cost clues. Expands fuzzy recall into parallel query lanes and first probes known stores so absent platforms are skipped cheaply. Triggers: coding agent sessions, Codex/Claude/OpenCode/Senpi/pi/oh-my-pi/omp/gajae-code/gjc/OpenClaw/Droid/Amp/Kodu/Cursor/Aider/Aside sessions, transcript search, session history, session ID, read transcript, token usage, subagent sessions, what did I do yesterday, did we already do this."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## DSH resource and authority contract
|
|
7
|
+
|
|
8
|
+
This is a full OCMM source adaptation for DSH 0.2.0-rc.2, not an OpenCode or Codex runtime. Source product names in transcript formats, examples, paths and attribution remain descriptive; they are not a host switch.
|
|
9
|
+
|
|
10
|
+
- Load this skill through the native skill tool only when its trigger matches. Resolve every relative reference/script/asset from the directory resourceBase returned with this skill, not from the project cwd or an OCMM checkout. Use available read/glob/grep to inspect resources; use write/edit and the active bash or pwsh only within the actual role and host permissions.
|
|
11
|
+
- External documentation uses actual web_search/web_fetch or an available documentation service. Context7, GitHub MCP, browser, image and LSP tools are optional catalog capabilities, not bundled calls. Use a real available equivalent or report unavailable evidence; never invent an MCP, Task, todo or compression API.
|
|
12
|
+
- Source role names are logical assignments: code-search/explore maps to dsmm-code-search, and other canonical roles/categories map to dsmm-<name>. Dispatch only through the actual role-specific native subagent tool in the current catalog, within the caller's effective policy, depth and authority. No generated file, metadata row or template proves callability. A missing permitted role is a blocker for a required formal stage, not permission to invent it or bypass planning.
|
|
13
|
+
- Templates describe assignment content, not a callable argument schema. Native continuation, background, message/interrupt and result handling are used only when actually exposed and supported; do not send task_id, subagent_type or guessed timeout fields. Otherwise perform permitted direct work or return the dependency to the stage owner.
|
|
14
|
+
- Use a concise response or an authorized project plan for tracking when no native tracking tool is exposed. Compression is unavailable unless a real tool is exposed; do not simulate it. Role responsibilities, explicit-off common/skill visibility, and the terminal delegation contract override broader examples in a resource.
|
|
15
|
+
- Installation, package-manager bootstrap, downloads, authentication/login, credential/profile access, Git writes and destructive actions require explicit authorization for the exact action. Reference commands are not automatic operations. Worktree consent does not authorize dependency installation or later branch deletion. Read before changing an existing file; preserve unrelated user work. Never silently restore/reset a working tree to repair a failed cleanup.
|
|
16
|
+
- Browser/debug QA uses run-owned isolated state, no imported credentials or browser profile, and only already available software unless separately authorized. Keep commands in the active shell dialect. Report unverified surfaces honestly.
|
|
17
|
+
|
|
18
|
+
# Coding Agent Sessions
|
|
19
|
+
|
|
20
|
+
Find local coding-agent sessions across agent products before answering from memory. Prefer the bundled finder for broad cross-platform search, then read the selected session or raw file when you need exact evidence.
|
|
21
|
+
|
|
22
|
+
## PHASE 0 - PLATFORM ROUTER
|
|
23
|
+
|
|
24
|
+
1. **IF the user names a platform, load its reference first.**
|
|
25
|
+
|
|
26
|
+
| Platform | Read |
|
|
27
|
+
|---|---|
|
|
28
|
+
| Codex / OpenAI Codex CLI | `references/codex.md` |
|
|
29
|
+
| Claude Code / Claude Desktop histories | `references/claude.md` |
|
|
30
|
+
| Senpi / pi coding-agent logs | `references/senpi.md` |
|
|
31
|
+
| oh-my-pi (`omp`, `~/.omp`) and gajae-code (`gjc`, `~/.gjc`) logs | `references/senpi.md` |
|
|
32
|
+
| OpenCode / oh-my-openagent (formerly oh-my-opencode) storage | `references/opencode.md` |
|
|
33
|
+
| OpenClaw, Droid, Amp, Gemini, Kimi, Qwen, Codebuff, Roo/Kilo/Cline, Kodu, Cursor CLI, Aider, Kiro, Goose, Hermes, Crush, Zed, Aside | `references/all-platforms.md` |
|
|
34
|
+
| Unknown / "any session" / cross-agent search | `references/all-platforms.md` |
|
|
35
|
+
|
|
36
|
+
2. **Run the broad finder first unless the user gave an exact file path. For fuzzy recall, expand the query first.**
|
|
37
|
+
|
|
38
|
+
When the user remembers a task vaguely ("that OpenCode bug", "the dashboard PR", "when did we fix X"), derive 3-6 short query lanes before searching: product/tool aliases, repo/package names, exact error text, issue/PR/session IDs, English/Korean phrasing, and likely verbs such as `fix`, `review`, `plan`, `deploy`, or `merge`. Run the lanes together with repeated `--query` so `match_reasons` shows which wording found the hit.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
python3 scripts/find-agent-sessions.py list --limit 20
|
|
42
|
+
python3 scripts/find-agent-sessions.py find "commit" --from 7d --platform senpi --platform opencode
|
|
43
|
+
python3 scripts/find-agent-sessions.py find "proxy" --platform openclaw --platform droid --platform amp
|
|
44
|
+
python3 scripts/find-agent-sessions.py find "refactor" --platform oh-my-pi --platform gajae-code
|
|
45
|
+
python3 scripts/find-agent-sessions.py find --query "deploy" --query "token usage" --workers 64
|
|
46
|
+
python3 scripts/find-agent-sessions.py find --query "opencode bug" --query "fix opencode" --query "OpenCode parent session" --include-subagents --workers 64
|
|
47
|
+
python3 scripts/find-agent-sessions.py read <session-id>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Use `python` instead of `python3` on systems where that is the available executable.
|
|
51
|
+
|
|
52
|
+
3. **Use explorer-style parallel lanes when one query batch is not enough.**
|
|
53
|
+
|
|
54
|
+
If scope is broad (multi-month, many repos/platforms, or a vague "what happened with X"), split independent searches by names/errors, repos/cwds, platforms/models, and time windows. Use available subagent/delegation tools for these lanes when they exist; otherwise run the finder calls in parallel. Merge candidates by `id`/`path`, then read the most likely sessions.
|
|
55
|
+
|
|
56
|
+
4. **Read details from search results before ad hoc digging.** Search results include `detail_hint`; run that `read <session-id> --platform <platform>` command to see the first user prompt, last user prompt, events, and child sessions together.
|
|
57
|
+
|
|
58
|
+
5. **Verify by opening raw transcripts for claims.** The finder normalizes formats; the raw `path` remains the source of truth.
|
|
59
|
+
|
|
60
|
+
## Output Contract
|
|
61
|
+
|
|
62
|
+
The finder prints JSON for stdout and `jq`. Every result includes:
|
|
63
|
+
|
|
64
|
+
| Field | Meaning |
|
|
65
|
+
|---|---|
|
|
66
|
+
| `platform` | Registered platform key such as `codex`, `claude`, `senpi`, `oh-my-pi`, `gajae-code`, `opencode`, `openclaw`, `droid`, `amp`, `kodu`, `cursor-cli`, `aider`, `roo-code`, `kilo-code`, `kilo-cli`, `kiro`, or `aside` |
|
|
67
|
+
| `id` | Session ID or stable file-derived ID |
|
|
68
|
+
| `path` | Raw transcript/index file |
|
|
69
|
+
| `cwd` | Working directory when recoverable |
|
|
70
|
+
| `created_at`, `updated_at` | ISO-like timestamps when recoverable |
|
|
71
|
+
| `provider`, `model` | Model metadata when recoverable |
|
|
72
|
+
| `first_user_message` | First user prompt preview (for subagents: task description + delegated prompt) |
|
|
73
|
+
| `last_user_message` | Last user prompt preview when recoverable |
|
|
74
|
+
| `usage` | Token/cost clues when present in the platform log |
|
|
75
|
+
| `parent_id` | Parent session/thread ID when this is a subagent or child session, else `null` |
|
|
76
|
+
| `agent` | Subagent label (Claude `agentType`, Codex `nickname (role)`, OpenCode agent name) |
|
|
77
|
+
| `subagent_count` | Number of child sessions spawned by this session |
|
|
78
|
+
| `detail_hint` | Ready-to-run `read` command for detailed inspection |
|
|
79
|
+
| `match_reasons` | Search-only array explaining which field/content matched each query |
|
|
80
|
+
|
|
81
|
+
Each `match_reasons` entry includes `query`, `platform`, `field`, and `snippet`, so you can tell which platform matched and what content caused the hit without opening every transcript.
|
|
82
|
+
|
|
83
|
+
## Filters
|
|
84
|
+
|
|
85
|
+
`list` and `search` share these filters:
|
|
86
|
+
|
|
87
|
+
| Filter | Meaning |
|
|
88
|
+
|---|---|
|
|
89
|
+
| `--platform` | Repeatable platform filter; pass one platform per flag |
|
|
90
|
+
| `--root` | Extra root to scan, repeatable |
|
|
91
|
+
| `--from`, `--to` | Date bounds: `YYYY-MM-DD`, `YYYY-MM`, `YYYY`, `today`, `yesterday`, `7d` |
|
|
92
|
+
| `--cwd` | Working-directory substring |
|
|
93
|
+
| `--model` | Model substring |
|
|
94
|
+
| `--limit` | Maximum results |
|
|
95
|
+
| `--query` | Repeatable search query; multiple queries return per-query groups plus a de-duplicated merged result list |
|
|
96
|
+
| `--workers` | Parallel worker count for platform scans, transcript parsing, OpenCode message joins, and multi-query matching |
|
|
97
|
+
| `--include-subagents` | Include subagent/child sessions as standalone `list`/`search` results (hidden by default) |
|
|
98
|
+
|
|
99
|
+
When `--platform` is omitted, the finder searches every registered platform in parallel. Each optional platform first probes fixed, known transcript roots and returns immediately when the product has no local store, so broad default searches stay cheap. Use repeatable flags such as `--platform openclaw --platform droid` only when narrowing. Comma-separated platform values are intentionally unsupported.
|
|
100
|
+
|
|
101
|
+
For OpenCode, the finder uses `opencode db path` plus direct SQLite queries first, then `opencode session list --format json` as a fallback. It avoids heavy `messages/` or `parts/` scans during normal list/search, and only falls back to file joins when the OpenCode DB/CLI is unavailable or explicit `--root` values request a nonstandard store.
|
|
102
|
+
|
|
103
|
+
Usage-only sources such as Copilot OTEL, Mux, Antigravity tokscale cache rows, Synthetic provider retagging, and Cursor IDE usage CSV are excluded from default transcript search because they do not reconstruct user prompts.
|
|
104
|
+
|
|
105
|
+
## Subagent / Child Sessions
|
|
106
|
+
|
|
107
|
+
`list` and `find`/`search` return main sessions only by default, each annotated with `subagent_count`. `read <main-session-id>` (alias: `get`) always returns a `prompts` object and a `subagents` array containing every child session (id, agent label, parent_id, prompt preview, raw path), so opening a main session reveals its whole delegation tree. `read <child-id>` works too and returns that child's own events.
|
|
108
|
+
|
|
109
|
+
| Platform | Where children live | Linkage |
|
|
110
|
+
|---|---|---|
|
|
111
|
+
| Claude Code | `projects/<proj>/<session-id>/subagents/agent-*.jsonl` (Task tool) and `.../subagents/workflows/wf_*/agent-*.jsonl` (Workflow) | Directory name = parent session ID; `agent-*.meta.json` holds `agentType` + task description |
|
|
112
|
+
| Codex | Regular threads in `state_*.sqlite` + own rollout JSONL | `thread_spawn_edges` table and `threads.source` / rollout `session_meta.payload.source.subagent.thread_spawn` |
|
|
113
|
+
| OpenCode | Regular sessions in `opencode.db` / `storage/session/` | `session.parent_id` column / `parentID` field; `agent` column names the subagent |
|
|
114
|
+
|
|
115
|
+
When the user asks whether some specific work was ever done, search with `--include-subagents` — delegated work often lives only in child transcripts, not in the main session. Workflow `journal.jsonl` files are orchestration logs, not sessions.
|
|
116
|
+
|
|
117
|
+
## Codex Notes
|
|
118
|
+
|
|
119
|
+
For Codex sessions, use the same broad finder. It reads `state_*.sqlite`, rollout JSONL, and archived rollout files:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
python3 scripts/find-agent-sessions.py list --platform codex --from 7d
|
|
123
|
+
python3 scripts/find-agent-sessions.py find "deploy" --platform codex
|
|
124
|
+
python3 scripts/find-agent-sessions.py read <session-id> --platform codex
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Use `references/codex.md` for Codex storage details.
|
|
128
|
+
|
|
129
|
+
## Troubleshooting
|
|
130
|
+
|
|
131
|
+
| Problem | Fix |
|
|
132
|
+
|---|---|
|
|
133
|
+
| Missing Codex sessions | Set `CODEX_HOME` or pass `--root /path/to/.codex`. |
|
|
134
|
+
| Missing oh-my-pi / gajae-code sessions | Those stores live in `~/.omp/agent/sessions` and `~/.gjc/agent/sessions`. For a custom `PI_CONFIG_DIR` / `PI_CODING_AGENT_DIR`, pass that agent dir with `--root`. |
|
|
135
|
+
| Missing OpenCode sessions | Pass the data dir that contains `messages/` and `parts/`, often `~/.opencode` or `~/.local/share/opencode`. |
|
|
136
|
+
| Missing Claude sessions | Search `~/.claude/projects`, `~/.claude/transcripts`, and `~/.claude/pre-compact-session-histories`; use `--root` for nonstandard config dirs. |
|
|
137
|
+
| Missing Aside sessions | The Aside browser agent stores per-user data under `~/.aside/u/<n>/` (`sessions/<date>_<id>/messages.jsonl` transcripts + a `state.db` index; `agents/*/sessions/` is just a hardlink mirror). Pass `--root` for a nonstandard `.aside` dir or an exported user dir. |
|
|
138
|
+
| Missing optional platform sessions | Check `references/all-platforms.md` for the exact local store. For project-local tools such as Aider, pass `--root /path/to/workspace` if the repo is outside the bounded default roots. |
|
|
139
|
+
| Date filter misses local sessions | Timestamps are compared as UTC instants when parseable; otherwise file mtime is used. |
|
|
140
|
+
| Search is slow | Narrow with repeated `--platform` flags or date/cwd filters. Optional stores are probed before parsing; avoid passing your whole home as `--root` unless you really want every bounded project-local scan. |
|
|
141
|
+
|
|
142
|
+
## Activation
|
|
143
|
+
|
|
144
|
+
Use this skill for any request to find, read, or inspect a local coding-agent session, regardless of product name — including memory-recall questions ("what did I work on a few days ago", "did we already migrate X", "when did I fix Y"). If the user only says "that session where we did X", do not rely on one literal query: expand to multiple discriminative terms first, add `--include-subagents` when the work may have been delegated, then narrow by `--platform`, `cwd`, `model`, and time (`--from 7d` for "a few days ago"). Prefer the `detail_hint` from the chosen search result for the next read step. If the first query batch is still ambiguous, use explorer-style lanes by keyword, repo/cwd, platform/model, and time window before summarizing.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
> DSH adapter boundary: resolve this resource from the loaded skill's directory resourceBase. Examples are not authority: installation/download/login, private state, Git writes and destructive operations need exact explicit authorization. Use only tools and native roles actually exposed in the current catalog and allowed by the caller; otherwise use a real direct fallback or report the limitation. Translate shell examples to the active runtime.
|
|
2
|
+
|
|
3
|
+
# Cross-Platform Session Search
|
|
4
|
+
|
|
5
|
+
## Default locations
|
|
6
|
+
|
|
7
|
+
Search these first, then add user-supplied roots with `--root`:
|
|
8
|
+
|
|
9
|
+
Registered platform keys: `codex`, `claude`, `senpi`, `oh-my-pi`, `gajae-code`, `opencode`, `openclaw`, `droid`, `amp`, `gemini`, `kimi`, `qwen`, `codebuff`, `roo-code`, `kilo-code`, `cline`, `kodu`, `cursor-cli`, `aider`, `kilo-cli`, `hermes`, `goose`, `crush`, `zed`, `kiro`, `aside`.
|
|
10
|
+
|
|
11
|
+
| Platform | Unix/macOS | Windows |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| Codex | `$CODEX_HOME`, `~/.codex` | `%CODEX_HOME%`, `%USERPROFILE%\.codex` |
|
|
14
|
+
| Claude | `~/.claude` | `%USERPROFILE%\.claude`, `%APPDATA%\Claude` |
|
|
15
|
+
| Senpi / pi | `~/.senpi/agent`, `~/.pi/agent` | `%USERPROFILE%\.senpi\agent`, `%USERPROFILE%\.pi\agent` |
|
|
16
|
+
| oh-my-pi (`omp`) | `~/.omp/agent`, `~/.omp/profiles/*/agent`, `$XDG_DATA_HOME/omp` | `%USERPROFILE%\.omp\agent` |
|
|
17
|
+
| gajae-code (`gjc`) | `~/.gjc/agent`, `~/.gjc/profiles/*/agent`, `$XDG_DATA_HOME/gjc` | `%USERPROFILE%\.gjc\agent` |
|
|
18
|
+
| OpenCode | `$OPENCODE_HOME`, `~/.opencode`, `~/.local/share/opencode` | `%OPENCODE_HOME%`, `%APPDATA%\opencode`, `%USERPROFILE%\.opencode` |
|
|
19
|
+
| OpenClaw | `~/.openclaw/agents/*/sessions`, `~/.openclaw/session-backups` | pass `--root` |
|
|
20
|
+
| Factory Droid | `~/.factory/sessions/*/*.jsonl` | pass `--root` |
|
|
21
|
+
| Amp | `~/.local/share/amp/threads/T-*.json` | pass `--root` |
|
|
22
|
+
| Gemini / Kimi / Qwen | `~/.gemini/tmp/*/chats`, `~/.kimi/sessions/*/*/wire.jsonl`, `~/.qwen/projects/*/chats` | pass `--root` |
|
|
23
|
+
| Codebuff | `~/.config/manicode*/projects/*/chats/*/chat-messages.json` | pass `--root` |
|
|
24
|
+
| Roo Code (`roo-code`) / Kilo Code (`kilo-code`) / Cline | VS Code `globalStorage/<extension>/tasks/*` | VS Code `globalStorage\<extension>\tasks\*` |
|
|
25
|
+
| Kodu | VS Code `globalStorage/kodu-ai.claude-dev-experimental/db/Azad.db` | VS Code `globalStorage\kodu-ai.claude-dev-experimental\db\Azad.db` |
|
|
26
|
+
| Cursor CLI | `~/.cursor/chats/*/*/store.db`, `~/.cursor/prompt_history.json` | `%USERPROFILE%\.cursor\chats` |
|
|
27
|
+
| Aider | bounded project roots containing `.aider.chat.history.md`; use `--root` for other repos | pass `--root` |
|
|
28
|
+
| Kilo CLI (`kilo-cli`) / Hermes / Goose / Crush / Zed | Known SQLite roots are probed cheaply; unsupported schemas return empty | pass `--root` |
|
|
29
|
+
| Kiro | `~/.kiro/sessions/cli/*.json` plus paired `*.jsonl` prompt events | pass `--root` |
|
|
30
|
+
| Aside (browser agent) | `~/.aside/u/*/sessions/<date>_<id>/messages.jsonl`, joined with the per-user `state.db` `sessions` table (title, parent_id, cwd, model, timestamps). `~/.aside/u/*/agents/*/sessions/` is a hardlink mirror of `sessions/` and is intentionally not scanned | pass `--root` |
|
|
31
|
+
|
|
32
|
+
## Excluded usage-only sources
|
|
33
|
+
|
|
34
|
+
Do not add these as default transcript platforms without a separate prompt-reconstruction source:
|
|
35
|
+
|
|
36
|
+
| Source | Why excluded |
|
|
37
|
+
|---|---|
|
|
38
|
+
| Copilot OTEL | Token/telemetry rows, not prompts |
|
|
39
|
+
| Mux | `session-usage.json` usage buckets only |
|
|
40
|
+
| Antigravity | tokscale cache/RPC data, not raw chat transcripts |
|
|
41
|
+
| Synthetic | Provider retagging over another platform, not an independent session store |
|
|
42
|
+
| Cursor IDE usage CSV | Usage accounting; use `cursor-cli` for local CLI chat stores |
|
|
43
|
+
|
|
44
|
+
## Workflow
|
|
45
|
+
|
|
46
|
+
1. Run `scripts/find-agent-sessions.py search <query>` across all platforms, or repeat `--query` for several searches in one scan. Add `--include-subagents` when the work may have run inside a delegated agent — child transcripts are excluded from `list`/`search` by default.
|
|
47
|
+
2. If results are noisy, add `--cwd`, `--model`, `--from`, or repeated `--platform` filters.
|
|
48
|
+
3. Run `get <session-id>` on likely hits. The result includes a `subagents` array: every child session (Claude Task/workflow agents, Codex thread spawns, OpenCode child sessions) with its own id, `agent` label, and raw path — follow up with `get <child-id>` for a child's events.
|
|
49
|
+
4. Open raw `path` files for exact quotes, tool calls, and evidence.
|
|
50
|
+
|
|
51
|
+
## Subagent linkage cheat sheet
|
|
52
|
+
|
|
53
|
+
| Platform | Child identity | Parent linkage | Agent label |
|
|
54
|
+
|---|---|---|---|
|
|
55
|
+
| Claude | `projects/<proj>/<sid>/subagents/**/agent-<agentId>.jsonl` | directory `<sid>` | `agent-*.meta.json` `agentType` |
|
|
56
|
+
| Codex | thread row + own rollout JSONL | `thread_spawn_edges` / `source.subagent.thread_spawn.parent_thread_id` | `agent_nickname (agent_role)` |
|
|
57
|
+
| OpenCode | `session` table row / `storage/session/**.json` | `parent_id` column / `parentID` field | `agent` column |
|
|
58
|
+
| Aside | own `sessions/<date>_<id>/messages.jsonl` transcript | `parent_id` column in `state.db` `sessions` | child session's `title` column (task description) |
|
|
59
|
+
|
|
60
|
+
## Parallelism
|
|
61
|
+
|
|
62
|
+
The finder scans selected platforms concurrently, parses transcript files concurrently, joins OpenCode message/part files concurrently, and evaluates repeated `--query` values concurrently. Increase `--workers` for large local stores:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
python3 scripts/find-agent-sessions.py search --query "commit" --query "deploy" --workers 64
|
|
66
|
+
python3 scripts/find-agent-sessions.py search --query "commit" --platform senpi --platform opencode --workers 64
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Omit `--platform` for the full multi-platform search. Add repeated platform flags such as `--platform openclaw --platform droid` only when the user already knows the likely stores. Comma-separated platform values are intentionally unsupported.
|
|
70
|
+
|
|
71
|
+
The default scan is intentionally probe-first: optional platforms check for exact store roots before globbing or opening files. This avoids expensive home-wide searches while still making newly installed local agents visible without changing the command.
|
|
72
|
+
|
|
73
|
+
OpenCode is optimized differently from raw JSONL stores: it calls `opencode db path`, reads the SQLite session table directly, falls back to `opencode session list --format json`, and only scans `messages/` / `parts/` when the DB/CLI is unavailable or explicit `--root` values force a file-store lookup.
|
|
74
|
+
|
|
75
|
+
## Evidence rule
|
|
76
|
+
|
|
77
|
+
Never answer "what happened in a session" from the normalized preview alone. Use the preview to locate candidates, then inspect the raw transcript or `get` output.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
> DSH adapter boundary: resolve this resource from the loaded skill's directory resourceBase. Examples are not authority: installation/download/login, private state, Git writes and destructive operations need exact explicit authorization. Use only tools and native roles actually exposed in the current catalog and allowed by the caller; otherwise use a real direct fallback or report the limitation. Translate shell examples to the active runtime.
|
|
2
|
+
|
|
3
|
+
# Claude Session Stores
|
|
4
|
+
|
|
5
|
+
Observed Claude formats:
|
|
6
|
+
|
|
7
|
+
- `~/.claude/projects/<encoded-cwd>/*.jsonl`: Claude Code project sessions (main sessions; filename = session ID).
|
|
8
|
+
- `~/.claude/transcripts/ses_*.jsonl`: compact transcript exports with simple `type`, `timestamp`, `content`, and tool fields.
|
|
9
|
+
- `~/.claude/pre-compact-session-histories/*.jsonl`: pre-compaction histories with `sessionId`, `cwd`, `message`, `uuid`, `parentUuid`, and tool result metadata.
|
|
10
|
+
|
|
11
|
+
For project files, `sessionId`, `cwd`, `version`, `gitBranch`, and `message.model` are usually embedded in each line. For transcript exports, the filename may be the only stable session ID.
|
|
12
|
+
|
|
13
|
+
When reconstructing a Claude session, preserve the event order from the JSONL file and distinguish assistant text, thinking, tool use, tool result, and progress events.
|
|
14
|
+
|
|
15
|
+
## Subagent transcripts (per-session directory)
|
|
16
|
+
|
|
17
|
+
Each main session may own a sibling directory named after the session ID:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
projects/<encoded-cwd>/<session-id>/
|
|
21
|
+
├── subagents/
|
|
22
|
+
│ ├── agent-<agentId>.jsonl # Task-tool subagent transcript
|
|
23
|
+
│ ├── agent-<agentId>.meta.json # {"agentType", "description", "toolUseId"}
|
|
24
|
+
│ └── workflows/wf_<id>/
|
|
25
|
+
│ ├── agent-<agentId>.jsonl # Workflow-spawned agent transcripts
|
|
26
|
+
│ ├── agent-<agentId>.meta.json
|
|
27
|
+
│ └── journal.jsonl # workflow orchestration journal — NOT a session
|
|
28
|
+
├── workflows/wf_<id>.json # workflow run metadata
|
|
29
|
+
└── tool-results/*.txt # persisted oversized tool outputs
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Subagent JSONL lines look like main-session lines but carry `isSidechain: true`, `agentId`, `promptId`, and `sessionId` pointing at the PARENT session — never treat a subagent file's `sessionId` as its own identity; use the `agentId` (also in the filename) and take the parent from the directory path. The first line's user message is the delegated task prompt; `agent-*.meta.json` gives the human-readable `description` and `agentType`.
|
|
33
|
+
|
|
34
|
+
The finder models these as `platform: claude` sessions with `id = <agentId>`, `parent_id = <session-id>`, `agent = agentType`. `get <main-session-id>` lists them under `subagents`; `get <agentId>` returns the child transcript events. Older Claude Code versions inlined sidechains in the main JSONL (`isSidechain: true` lines) instead of separate files.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
> DSH adapter boundary: resolve this resource from the loaded skill's directory resourceBase. Examples are not authority: installation/download/login, private state, Git writes and destructive operations need exact explicit authorization. Use only tools and native roles actually exposed in the current catalog and allowed by the caller; otherwise use a real direct fallback or report the limitation. Translate shell examples to the active runtime.
|
|
2
|
+
|
|
3
|
+
# Codex Sessions
|
|
4
|
+
|
|
5
|
+
Codex has two useful surfaces:
|
|
6
|
+
|
|
7
|
+
- `$CODEX_HOME/state_*.sqlite` stores thread metadata.
|
|
8
|
+
- `$CODEX_HOME/sessions/**/rollout-*.jsonl` and archived rollout files store event transcripts.
|
|
9
|
+
|
|
10
|
+
Use the broad finder for Codex discovery:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
python3 scripts/find-agent-sessions.py list --platform codex --limit 10
|
|
14
|
+
python3 scripts/find-agent-sessions.py search "deploy" --platform codex
|
|
15
|
+
python3 scripts/find-agent-sessions.py search --query "deploy" --query "token usage" --platform codex --workers 32
|
|
16
|
+
python3 scripts/find-agent-sessions.py get <session-id> --platform codex
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Important filters: `--from`, `--to`, `--cwd`, `--model`, `--root`, `--limit`, and `--include-subagents`.
|
|
20
|
+
|
|
21
|
+
## Spawned (subagent) threads
|
|
22
|
+
|
|
23
|
+
Codex subagent threads are ordinary rows in `threads` with their own rollout files. Two linkage sources:
|
|
24
|
+
|
|
25
|
+
- `thread_spawn_edges(parent_thread_id, child_thread_id, status)` — authoritative parent→child table.
|
|
26
|
+
- `threads.source` — `cli` / `exec` / `vscode` for user-started threads, or JSON for spawned ones:
|
|
27
|
+
- `{"subagent": "review"}`, `{"subagent": "memory_consolidation"}` — built-in side threads.
|
|
28
|
+
- `{"subagent": {"thread_spawn": {"parent_thread_id": "...", "depth": 1, "agent_nickname": "Tesla", "agent_role": "explorer"}}}` — collab/multi-agent spawns (depth can exceed 1: children spawn grandchildren).
|
|
29
|
+
|
|
30
|
+
`threads` also carries `agent_nickname`, `agent_role`, `model`, `first_user_message`, `tokens_used`. Without the SQLite DB, the same linkage is in each rollout file's first line: `type: "session_meta"` whose `payload` has `id`, `cwd`, `model_provider`, `forked_from_id`, and the same `source.subagent.thread_spawn` object.
|
|
31
|
+
|
|
32
|
+
The finder maps these to `parent_id` and `agent = "nickname (role)"`; `get <parent-thread-id>` lists children under `subagents`, and `get <child-thread-id>` returns the child's rollout events.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
> DSH adapter boundary: resolve this resource from the loaded skill's directory resourceBase. Examples are not authority: installation/download/login, private state, Git writes and destructive operations need exact explicit authorization. Use only tools and native roles actually exposed in the current catalog and allowed by the caller; otherwise use a real direct fallback or report the limitation. Translate shell examples to the active runtime.
|
|
2
|
+
|
|
3
|
+
# OpenCode Session Stores
|
|
4
|
+
|
|
5
|
+
## Fast path
|
|
6
|
+
|
|
7
|
+
Prefer the OpenCode CLI index before touching session files:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
opencode db path
|
|
11
|
+
sqlite3 "$(opencode db path)" 'select id, title, directory, time_updated from session order by time_updated desc limit 2000'
|
|
12
|
+
opencode session list --format json --max-count 100
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Use direct SQLite via `opencode db path` for ordinary `list` and title/session-ID/cwd searches. It queries OpenCode's own indexed session database and avoids expensive scans across `messages/` and `parts/`. Use `opencode session list --format json` as the next fallback when direct DB access is unavailable.
|
|
16
|
+
|
|
17
|
+
Only fall back to file joins when `opencode` is not installed, the command fails, or the user passes an explicit `--root` for a nonstandard store.
|
|
18
|
+
|
|
19
|
+
## Subagent (child) sessions
|
|
20
|
+
|
|
21
|
+
Child sessions spawned by the task tool / subagents are ordinary rows in the `session` table:
|
|
22
|
+
|
|
23
|
+
- `session.parent_id` — parent session ID (`NULL` for main sessions). Tens of thousands of child rows are normal.
|
|
24
|
+
- `session.agent` — subagent name (`explore`, `plan`, `librarian`, `Sisyphus-Junior`, ...).
|
|
25
|
+
- Child titles often end with the convention `"... (@<agent> subagent)"`.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
sqlite3 "$(opencode db path)" "select id, agent, title from session where parent_id='<parent-id>' order by time_created"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
In the file store, the same linkage is the `parentID` field of `storage/session/<project-hash>/ses_*.json` info files. The finder surfaces children with `parent_id` + `agent` set; `get <parent-id>` lists them under `subagents`.
|
|
32
|
+
|
|
33
|
+
## File fallback
|
|
34
|
+
|
|
35
|
+
Observed OpenCode layouts vary by version:
|
|
36
|
+
|
|
37
|
+
- `~/.opencode/messages/ses_*/*.json`: message metadata.
|
|
38
|
+
- `~/.opencode/parts/msg_*/*.json`: message parts, including text and synthetic compaction context.
|
|
39
|
+
- `~/.opencode/sessions/**`: newer session indexes or compatibility storage.
|
|
40
|
+
- `~/.local/share/opencode/storage/session/<project-hash>/ses_*.json`: session info files (`id`, `parentID`, `title`, `directory`, `time.created/updated`) — sibling `storage/message/` and `storage/part/` (singular) dirs hold content.
|
|
41
|
+
- `~/.local/share/opencode/storage/**`: older or Linux/XDG storage, often with session/message JSON or SQLite-backed data.
|
|
42
|
+
|
|
43
|
+
Message metadata usually contains `sessionID`, `role`, `time.created`, `agent`, `model.providerID`, `model.modelID`, and `path.cwd`. Text content may live in `parts/<message-id>/*.json`.
|
|
44
|
+
|
|
45
|
+
When answering from OpenCode, join messages to parts by `messageID` and order by `time.created` or part time. Compaction injections are useful for continuity but should be labeled as synthetic.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
> DSH adapter boundary: resolve this resource from the loaded skill's directory resourceBase. Examples are not authority: installation/download/login, private state, Git writes and destructive operations need exact explicit authorization. Use only tools and native roles actually exposed in the current catalog and allowed by the caller; otherwise use a real direct fallback or report the limitation. Translate shell examples to the active runtime.
|
|
2
|
+
|
|
3
|
+
# Senpi / pi Family Coding-Agent Sessions
|
|
4
|
+
|
|
5
|
+
The pi family (Senpi, oh-my-pi, gajae-code) shares one session format, so one scanner serves all three under separate platform keys.
|
|
6
|
+
|
|
7
|
+
| Platform key | Aliases | Config root | Sessions |
|
|
8
|
+
|---|---|---|---|
|
|
9
|
+
| `senpi` | - | `~/.senpi`, `~/.pi` | `<root>/agent/sessions/<encoded-cwd>/<timestamp>_<uuid>.jsonl` |
|
|
10
|
+
| `oh-my-pi` | `omp`, `ohmypi` | `~/.omp` | `~/.omp/agent/sessions/<encoded-cwd>/<timestamp>_<uuid>.jsonl` |
|
|
11
|
+
| `gajae-code` | `gjc`, `gajae` | `~/.gjc` | `~/.gjc/agent/sessions/<encoded-cwd>/<timestamp>_<uuid>.jsonl` |
|
|
12
|
+
|
|
13
|
+
Extra roots scanned for every pi-family platform:
|
|
14
|
+
|
|
15
|
+
- Named profiles: `<config-root>/profiles/<profile>/agent/sessions/**`.
|
|
16
|
+
- XDG stores (macOS/Linux, default profile): `$XDG_DATA_HOME/<app>/sessions/**` and `$XDG_DATA_HOME/<app>/profiles/<profile>/sessions/**`, where `<app>` is `senpi`, `omp`, or `gjc`. XDG flattens the `agent/` path segment.
|
|
17
|
+
- A custom `PI_CONFIG_DIR` / `PI_CODING_AGENT_DIR` / `GJC_CONFIG_DIR` store: pass that agent directory with `--root`.
|
|
18
|
+
|
|
19
|
+
`~/.senpi/agent/settings.json`, `models.json`, and `auth.json` provide environment context; oh-my-pi and gajae-code keep the same files plus `config.yml` and `models.yml` next to their sessions directory.
|
|
20
|
+
|
|
21
|
+
Common event types:
|
|
22
|
+
|
|
23
|
+
- `session`: includes `id`, `timestamp`, and `cwd`.
|
|
24
|
+
- `model_change`: includes `provider` and `modelId`.
|
|
25
|
+
- `thinking_level_change`: includes effort metadata.
|
|
26
|
+
- `message`: wraps provider-native messages, tool calls, usage, and costs.
|
|
27
|
+
- `custom` with `customType: senpi.todo-state`: stores todo state.
|
|
28
|
+
|
|
29
|
+
Prefer Senpi usage fields when present: `usage.input`, `usage.output`, `usage.cacheRead`, `usage.cacheWrite`, `usage.totalTokens`, and `usage.cost.total`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import sqlite3
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import TypeAlias
|
|
7
|
+
|
|
8
|
+
from .jsonio import as_map, iter_jsonl, parse_json_text, text
|
|
9
|
+
from .timeparse import file_time, unix_millis, unix_seconds
|
|
10
|
+
from .transcript import content_text, existing, flat_parallel, merge_usage, recent
|
|
11
|
+
from .types import JsonMap, Session
|
|
12
|
+
|
|
13
|
+
SqlValue: TypeAlias = str | int | float | bytes | None
|
|
14
|
+
SqlRow: TypeAlias = tuple[SqlValue, ...]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@dataclass(frozen=True, slots=True)
|
|
18
|
+
class _StateRow:
|
|
19
|
+
parent_id: str | None
|
|
20
|
+
title: str | None
|
|
21
|
+
cwd: str | None
|
|
22
|
+
provider: str | None
|
|
23
|
+
model: str | None
|
|
24
|
+
created_at: str | None
|
|
25
|
+
updated_at: str | None
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def scan_aside(extra_roots: tuple[Path, ...], workers: int) -> list[Session]:
|
|
29
|
+
roots = _roots([Path.home() / ".aside"], extra_roots, (".aside",))
|
|
30
|
+
sessions: list[Session] = []
|
|
31
|
+
for user_dir in _user_dirs(roots):
|
|
32
|
+
index = _state_index(user_dir / "state.db")
|
|
33
|
+
paths = list((user_dir / "sessions").glob("*/messages.jsonl"))
|
|
34
|
+
sessions.extend(flat_parallel(recent(paths), workers, lambda path, rows=index: [_aside_session(path, rows)]))
|
|
35
|
+
return sessions
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _user_dirs(roots: list[Path]) -> list[Path]:
|
|
39
|
+
dirs: list[Path] = []
|
|
40
|
+
for root in roots:
|
|
41
|
+
users = sorted(path for path in (root / "u").glob("*") if path.is_dir())
|
|
42
|
+
if users:
|
|
43
|
+
dirs.extend(users)
|
|
44
|
+
elif (root / "sessions").exists():
|
|
45
|
+
dirs.append(root)
|
|
46
|
+
return dirs
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def _state_index(db_path: Path) -> dict[str, _StateRow]:
|
|
50
|
+
if not db_path.exists():
|
|
51
|
+
return {}
|
|
52
|
+
try:
|
|
53
|
+
with sqlite3.connect(f"file:{db_path}?mode=ro", uri=True) as conn:
|
|
54
|
+
rows: list[SqlRow] = conn.execute("select id, parent_id, title, cwd, model, created_at, updated_at from sessions").fetchall()
|
|
55
|
+
except sqlite3.Error:
|
|
56
|
+
return {}
|
|
57
|
+
index: dict[str, _StateRow] = {}
|
|
58
|
+
for row in rows:
|
|
59
|
+
sid = _cell_text(row, 0)
|
|
60
|
+
if sid is None:
|
|
61
|
+
continue
|
|
62
|
+
provider, model = _model_fields(_cell_text(row, 4))
|
|
63
|
+
index[sid] = _StateRow(
|
|
64
|
+
_cell_text(row, 1),
|
|
65
|
+
_cell_text(row, 2),
|
|
66
|
+
_cell_text(row, 3),
|
|
67
|
+
provider,
|
|
68
|
+
model,
|
|
69
|
+
unix_seconds(_cell_number(row, 5)),
|
|
70
|
+
unix_seconds(_cell_number(row, 6)),
|
|
71
|
+
)
|
|
72
|
+
return index
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def _cell_text(row: SqlRow, index: int) -> str | None:
|
|
76
|
+
value = row[index] if index < len(row) else None
|
|
77
|
+
return value if isinstance(value, str) else None
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _cell_number(row: SqlRow, index: int) -> int | float | None:
|
|
81
|
+
value = row[index] if index < len(row) else None
|
|
82
|
+
return value if isinstance(value, int | float) else None
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def _model_fields(model_json: str | None) -> tuple[str | None, str | None]:
|
|
86
|
+
data = as_map(parse_json_text(model_json)) if model_json else None
|
|
87
|
+
if data is None:
|
|
88
|
+
return None, None
|
|
89
|
+
return text(data.get("provider")), text(data.get("modelId")) or text(data.get("model"))
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def _aside_session(path: Path, index: dict[str, _StateRow]) -> Session:
|
|
93
|
+
sid = _dir_session_id(path.parent.name)
|
|
94
|
+
row = index.get(sid)
|
|
95
|
+
first_user = last_user = ""
|
|
96
|
+
provider = model = None
|
|
97
|
+
created = updated = None
|
|
98
|
+
usage: JsonMap = {}
|
|
99
|
+
for data in iter_jsonl(path):
|
|
100
|
+
stamp = data.get("timestamp")
|
|
101
|
+
moment = unix_millis(int(stamp)) if isinstance(stamp, int | float) else None
|
|
102
|
+
created = created or moment
|
|
103
|
+
updated = moment or updated
|
|
104
|
+
role = text(data.get("role"))
|
|
105
|
+
if role == "user":
|
|
106
|
+
prompt = content_text(data.get("content"))
|
|
107
|
+
if prompt:
|
|
108
|
+
first_user = first_user or prompt
|
|
109
|
+
last_user = prompt
|
|
110
|
+
elif role == "assistant":
|
|
111
|
+
provider = provider or text(data.get("provider"))
|
|
112
|
+
model = model or text(data.get("model"))
|
|
113
|
+
merge_usage(usage, as_map(data.get("usage")))
|
|
114
|
+
return Session(
|
|
115
|
+
"aside",
|
|
116
|
+
sid,
|
|
117
|
+
str(path),
|
|
118
|
+
row.cwd if row is not None else None,
|
|
119
|
+
(row.created_at if row is not None else None) or created or file_time(path),
|
|
120
|
+
(row.updated_at if row is not None else None) or updated or created or file_time(path),
|
|
121
|
+
(row.provider if row is not None else None) or provider,
|
|
122
|
+
(row.model if row is not None else None) or model,
|
|
123
|
+
first_user,
|
|
124
|
+
usage,
|
|
125
|
+
row.parent_id if row is not None else None,
|
|
126
|
+
row.title if row is not None and row.parent_id is not None else None,
|
|
127
|
+
last_user,
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def _dir_session_id(name: str) -> str:
|
|
132
|
+
return name.split("_", 1)[-1]
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def _roots(defaults: list[Path], extra_roots: tuple[Path, ...], children: tuple[str, ...]) -> list[Path]:
|
|
136
|
+
candidates = [*defaults]
|
|
137
|
+
for root in extra_roots:
|
|
138
|
+
candidates.append(root)
|
|
139
|
+
candidates.extend(root / child for child in children)
|
|
140
|
+
return existing(candidates)
|