@memorax/memorax-code 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/README.md +53 -0
- package/bin/memorax-cli.mjs +28 -0
- package/bin/memorax-code-backend.mjs +4 -0
- package/bin/memorax-code-claude.mjs +4 -0
- package/bin/memorax-code-codex.mjs +4 -0
- package/bin/memorax-code-npm-preinstall.mjs +55 -0
- package/bin/memorax-code-plugin-postinstall.mjs +1236 -0
- package/bin/memorax-code.mjs +204 -0
- package/docs/configuration.md +232 -0
- package/docs/troubleshooting.md +179 -0
- package/lib/client-hook-runtime.mjs +32 -0
- package/lib/memorax-code-adapter-common/src/backend-connection.d.mts +111 -0
- package/lib/memorax-code-adapter-common/src/backend-connection.mjs +304 -0
- package/lib/memorax-code-adapter-common/src/clients/claude-command.mjs +38 -0
- package/lib/memorax-code-adapter-common/src/clients/codex-command.mjs +41 -0
- package/lib/memorax-code-adapter-common/src/clients/codex-plugin-artifact.d.mts +3 -0
- package/lib/memorax-code-adapter-common/src/clients/codex-plugin-artifact.mjs +38 -0
- package/lib/memorax-code-adapter-common/src/config-utils.d.mts +27 -0
- package/lib/memorax-code-adapter-common/src/config-utils.mjs +391 -0
- package/lib/memorax-code-adapter-common/src/hooks/capture-cwd-hook.mjs +137 -0
- package/lib/memorax-code-adapter-common/src/hooks/client-hook-launcher.mjs +324 -0
- package/lib/memorax-code-adapter-common/src/hooks/ensure-backend-runner.mjs +142 -0
- package/lib/memorax-code-adapter-common/src/hooks/hook-runtime-generation.d.mts +38 -0
- package/lib/memorax-code-adapter-common/src/hooks/hook-runtime-generation.mjs +501 -0
- package/lib/memorax-code-adapter-common/src/hooks/memory-skill-reminder-hook.mjs +277 -0
- package/lib/memorax-code-adapter-common/src/memorax-code-config-file.d.mts +28 -0
- package/lib/memorax-code-adapter-common/src/memorax-code-config-file.mjs +296 -0
- package/lib/memorax-code-adapter-common/src/memorax-defaults.d.mts +10 -0
- package/lib/memorax-code-adapter-common/src/memorax-defaults.mjs +12 -0
- package/lib/memorax-code-adapter-common/src/repo-memory/repo-memory-job-context.mjs +28 -0
- package/lib/memorax-code-adapter-common/src/repo-memory/repo-memory-job-marker.mjs +252 -0
- package/lib/memorax-code-adapter-common/src/repo-memory/repo-memory-job-supervisor.mjs +559 -0
- package/lib/memorax-code-adapter-common/src/repo-memory/repo-memory-job-worker.mjs +411 -0
- package/lib/memorax-code-adapter-common/src/repo-memory/repo-memory-update-policy-evaluator.mjs +185 -0
- package/lib/memorax-code-adapter-common/src/repo-memory/repo-memory-update-policy.mjs +165 -0
- package/lib/memorax-code-adapter-common/src/repo-memory/repo-procedure-memory-context.mjs +181 -0
- package/lib/memorax-code-adapter-common/src/repo-memory/repo-user-profile-context.mjs +251 -0
- package/lib/memorax-code-adapter-common/src/runtime-record.d.mts +55 -0
- package/lib/memorax-code-adapter-common/src/runtime-record.mjs +152 -0
- package/lib/memorax-code-adapter-common/src/windows-cli-invocation.mjs +100 -0
- package/lib/memorax-code-backend/dist/active-client-selection.js +35 -0
- package/lib/memorax-code-backend/dist/adapter-lifecycle-participant.js +1 -0
- package/lib/memorax-code-backend/dist/automatic-memory-retrieval.js +113 -0
- package/lib/memorax-code-backend/dist/automatic-memory-writeback.js +297 -0
- package/lib/memorax-code-backend/dist/backend-env.js +13 -0
- package/lib/memorax-code-backend/dist/backend-lifecycle-lock.js +42 -0
- package/lib/memorax-code-backend/dist/backend-process.js +147 -0
- package/lib/memorax-code-backend/dist/backend-service-cleanup.js +18 -0
- package/lib/memorax-code-backend/dist/backend-service-record.js +206 -0
- package/lib/memorax-code-backend/dist/backend-service-result.js +37 -0
- package/lib/memorax-code-backend/dist/backend-service-token.js +11 -0
- package/lib/memorax-code-backend/dist/backend-shutdown-request.js +133 -0
- package/lib/memorax-code-backend/dist/backend-state.js +58 -0
- package/lib/memorax-code-backend/dist/backend-status.js +53 -0
- package/lib/memorax-code-backend/dist/backend-token-record.js +79 -0
- package/lib/memorax-code-backend/dist/claude-adapter-lifecycle.js +134 -0
- package/lib/memorax-code-backend/dist/claude-local-transcript.js +648 -0
- package/lib/memorax-code-backend/dist/claude-memory-hook-runtime.js +472 -0
- package/lib/memorax-code-backend/dist/claude-transcript-turn.js +876 -0
- package/lib/memorax-code-backend/dist/client-plugin-removal.js +67 -0
- package/lib/memorax-code-backend/dist/client-selection.js +36 -0
- package/lib/memorax-code-backend/dist/codex-adapter-lifecycle.js +131 -0
- package/lib/memorax-code-backend/dist/codex-effective-prompt.js +54 -0
- package/lib/memorax-code-backend/dist/codex-memory-hook-runtime.js +541 -0
- package/lib/memorax-code-backend/dist/codex-plugin-hooks.js +421 -0
- package/lib/memorax-code-backend/dist/codex-plugin-install.js +523 -0
- package/lib/memorax-code-backend/dist/codex-rollout-turn.js +402 -0
- package/lib/memorax-code-backend/dist/codex-session-turn-index.js +88 -0
- package/lib/memorax-code-backend/dist/codex-workspace-links.js +55 -0
- package/lib/memorax-code-backend/dist/debug-log.js +21 -0
- package/lib/memorax-code-backend/dist/entrypoint.js +14 -0
- package/lib/memorax-code-backend/dist/incremental-jsonl-projection.js +271 -0
- package/lib/memorax-code-backend/dist/install-watchdog.js +71 -0
- package/lib/memorax-code-backend/dist/jsonl-append.js +75 -0
- package/lib/memorax-code-backend/dist/memorax-adapter.js +451 -0
- package/lib/memorax-code-backend/dist/memorax-cli.js +14 -0
- package/lib/memorax-code-backend/dist/memorax-code-config.js +279 -0
- package/lib/memorax-code-backend/dist/memorax-code-lifecycle.js +523 -0
- package/lib/memorax-code-backend/dist/memorax-code.js +3 -0
- package/lib/memorax-code-backend/dist/memorax-config.js +283 -0
- package/lib/memorax-code-backend/dist/memorax-http.js +142 -0
- package/lib/memorax-code-backend/dist/memory-cli.js +345 -0
- package/lib/memorax-code-backend/dist/memory-hook-command.js +200 -0
- package/lib/memorax-code-backend/dist/memory-observability.js +1 -0
- package/lib/memorax-code-backend/dist/memory-project.js +89 -0
- package/lib/memorax-code-backend/dist/memory-reminder-trace-recorder.js +58 -0
- package/lib/memorax-code-backend/dist/memory-service.js +66 -0
- package/lib/memorax-code-backend/dist/memory-turn-coordinator.js +139 -0
- package/lib/memorax-code-backend/dist/memory-viewer-activity.js +113 -0
- package/lib/memorax-code-backend/dist/memory-viewer-data-projection-cache.js +69 -0
- package/lib/memorax-code-backend/dist/memory-viewer-event-identity.js +3 -0
- package/lib/memorax-code-backend/dist/memory-viewer-history-projection.js +79 -0
- package/lib/memorax-code-backend/dist/memory-viewer-logo.js +1 -0
- package/lib/memorax-code-backend/dist/memory-viewer-observability.js +8 -0
- package/lib/memorax-code-backend/dist/memory-viewer-redaction.js +52 -0
- package/lib/memorax-code-backend/dist/memory-viewer-session-title.js +93 -0
- package/lib/memorax-code-backend/dist/memory-viewer-store.js +964 -0
- package/lib/memorax-code-backend/dist/memory-viewer-turn-reference.js +12 -0
- package/lib/memorax-code-backend/dist/memory-viewer-user-html.js +115 -0
- package/lib/memorax-code-backend/dist/memory-viewer-user-projection.js +168 -0
- package/lib/memorax-code-backend/dist/memory-viewer-writeback-status.js +97 -0
- package/lib/memorax-code-backend/dist/memory-writeback-buffer.js +217 -0
- package/lib/memorax-code-backend/dist/memory-writeback-chunk.js +120 -0
- package/lib/memorax-code-backend/dist/memory-writeback-reconciler.js +244 -0
- package/lib/memorax-code-backend/dist/memory-writeback-task-projection.js +377 -0
- package/lib/memorax-code-backend/dist/proxy-env.js +54 -0
- package/lib/memorax-code-backend/dist/repo-memory-readiness.js +188 -0
- package/lib/memorax-code-backend/dist/repository-memory-context.js +134 -0
- package/lib/memorax-code-backend/dist/repository-memory-scope.js +490 -0
- package/lib/memorax-code-backend/dist/server-cli.js +787 -0
- package/lib/memorax-code-backend/dist/server-health.js +16 -0
- package/lib/memorax-code-backend/dist/server-http.js +110 -0
- package/lib/memorax-code-backend/dist/server-json.js +4 -0
- package/lib/memorax-code-backend/dist/server-memory-hook.js +32 -0
- package/lib/memorax-code-backend/dist/server-memory-viewer.js +135 -0
- package/lib/memorax-code-backend/dist/server-observability.js +102 -0
- package/lib/memorax-code-backend/dist/server.js +220 -0
- package/lib/memorax-code-backend/dist/service-entrypoint.js +10 -0
- package/lib/memorax-code-backend/dist/service.js +567 -0
- package/lib/memorax-code-backend/dist/trace-config.js +112 -0
- package/lib/memorax-code-backend/dist/trace-context.js +111 -0
- package/lib/memorax-code-backend/dist/trace-store.js +571 -0
- package/lib/memorax-code-backend/dist/utils.js +3 -0
- package/lib/memorax-code-backend/dist/windows-cli-invocation.js +148 -0
- package/lib/memorax-code-backend/package.json +26 -0
- package/lib/memorax-code-claude-adapter/.claude-plugin/plugin.json +15 -0
- package/lib/memorax-code-claude-adapter/hooks/hook-launcher.mjs +27 -0
- package/lib/memorax-code-claude-adapter/hooks/hooks.json +66 -0
- package/lib/memorax-code-claude-adapter/hooks/repo-memory-job.mjs +37 -0
- package/lib/memorax-code-claude-adapter/hooks/runtime-hook.mjs +4 -0
- package/lib/memorax-code-claude-adapter/hooks/runtime-shell.json +5 -0
- package/lib/memorax-code-claude-adapter/package.json +13 -0
- package/lib/memorax-code-claude-adapter/runtime-hooks/capture-cwd.mjs +17 -0
- package/lib/memorax-code-claude-adapter/runtime-hooks/ensure-backend.mjs +59 -0
- package/lib/memorax-code-claude-adapter/runtime-hooks/memory-cli-session.mjs +33 -0
- package/lib/memorax-code-claude-adapter/runtime-hooks/memory-skill-reminder.mjs +73 -0
- package/lib/memorax-code-claude-adapter/runtime-hooks/memory-turn.mjs +91 -0
- package/lib/memorax-code-claude-adapter/scripts/build-marketplace.mjs +99 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/SKILL.md +83 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/agents/claude.yaml +10 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/agents/openai.yaml +7 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/defaults.json +9 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/references/memorax-add.md +82 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/references/memorax-search.md +61 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/references/personal-read.md +46 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/references/personal-write.md +100 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/references/repo-build.md +270 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/references/repo-read.md +96 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/references/repo-templates.md +270 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/references/repo-update.md +116 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/collect_all.py +496 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/detect_updates.py +856 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/git_commit_facets.py +222 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/github_resource_facets.py +504 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +509 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/prepare_repo_memory.py +411 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/user_profile_memory.py +528 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/validate_memory.py +226 -0
- package/lib/memorax-code-claude-adapter/src/adapter-paths.mjs +46 -0
- package/lib/memorax-code-claude-adapter/src/cli.mjs +363 -0
- package/lib/memorax-code-claude-adapter/src/config-utils.mjs +1 -0
- package/lib/memorax-code-claude-adapter/src/config.mjs +544 -0
- package/lib/memorax-code-claude-adapter/src/plugin-artifact-contract.mjs +148 -0
- package/lib/memorax-code-claude-adapter/src/plugin-install.mjs +566 -0
- package/lib/memorax-code-claude-marketplace/.claude-plugin/marketplace.json +15 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/.claude-plugin/plugin.json +15 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/hooks/hook-launcher.mjs +27 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/hooks/hooks.json +66 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/hooks/repo-memory-job.mjs +37 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/hooks/runtime-hook.mjs +4 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/hooks/runtime-shell.json +5 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/backend-connection.d.mts +111 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/backend-connection.mjs +304 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/clients/claude-command.mjs +38 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/clients/codex-command.mjs +41 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/clients/codex-plugin-artifact.d.mts +3 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/clients/codex-plugin-artifact.mjs +38 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/config-utils.d.mts +27 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/config-utils.mjs +391 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/hooks/capture-cwd-hook.mjs +137 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/hooks/client-hook-launcher.mjs +324 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/hooks/ensure-backend-runner.mjs +142 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/hooks/hook-runtime-generation.d.mts +38 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/hooks/hook-runtime-generation.mjs +501 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/hooks/memory-skill-reminder-hook.mjs +277 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/memorax-code-config-file.d.mts +28 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/memorax-code-config-file.mjs +296 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/memorax-defaults.d.mts +10 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/memorax-defaults.mjs +12 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/repo-memory/repo-memory-job-context.mjs +28 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/repo-memory/repo-memory-job-marker.mjs +252 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/repo-memory/repo-memory-job-supervisor.mjs +559 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/repo-memory/repo-memory-job-worker.mjs +411 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/repo-memory/repo-memory-update-policy-evaluator.mjs +185 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/repo-memory/repo-memory-update-policy.mjs +165 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/repo-memory/repo-procedure-memory-context.mjs +181 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/repo-memory/repo-user-profile-context.mjs +251 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/runtime-record.d.mts +55 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/runtime-record.mjs +152 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/windows-cli-invocation.mjs +100 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/package.json +13 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/runtime-hooks/capture-cwd.mjs +17 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/runtime-hooks/ensure-backend.mjs +59 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/runtime-hooks/memory-cli-session.mjs +33 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/runtime-hooks/memory-skill-reminder.mjs +73 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/runtime-hooks/memory-turn.mjs +91 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/scripts/build-marketplace.mjs +99 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/SKILL.md +83 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/agents/claude.yaml +10 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/agents/openai.yaml +7 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/defaults.json +9 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/memorax-add.md +82 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/memorax-search.md +61 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/personal-read.md +46 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/personal-write.md +100 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/repo-build.md +270 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/repo-read.md +96 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/repo-templates.md +270 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/repo-update.md +116 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/collect_all.py +496 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/detect_updates.py +856 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/git_commit_facets.py +222 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/github_resource_facets.py +504 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +509 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/prepare_repo_memory.py +411 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/user_profile_memory.py +528 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/validate_memory.py +226 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/src/adapter-paths.mjs +46 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/src/cli.mjs +363 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/src/config-utils.mjs +1 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/src/config.mjs +544 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/src/plugin-artifact-contract.mjs +148 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/src/plugin-install.mjs +566 -0
- package/lib/memorax-code-codex-adapter/.codex-plugin/plugin.json +33 -0
- package/lib/memorax-code-codex-adapter/assets/composer-icon.png +0 -0
- package/lib/memorax-code-codex-adapter/assets/logo.png +0 -0
- package/lib/memorax-code-codex-adapter/hooks/hook-launcher.mjs +26 -0
- package/lib/memorax-code-codex-adapter/hooks/hooks.json +61 -0
- package/lib/memorax-code-codex-adapter/hooks/repo-memory-job.mjs +38 -0
- package/lib/memorax-code-codex-adapter/hooks/repo-memory-update-policy.mjs +10 -0
- package/lib/memorax-code-codex-adapter/hooks/runtime-hook.mjs +4 -0
- package/lib/memorax-code-codex-adapter/hooks/runtime-shell.json +5 -0
- package/lib/memorax-code-codex-adapter/package.json +13 -0
- package/lib/memorax-code-codex-adapter/runtime-hooks/capture-cwd.mjs +18 -0
- package/lib/memorax-code-codex-adapter/runtime-hooks/ensure-backend.mjs +82 -0
- package/lib/memorax-code-codex-adapter/runtime-hooks/memory-skill-reminder.mjs +125 -0
- package/lib/memorax-code-codex-adapter/runtime-hooks/memory-writeback.mjs +52 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/SKILL.md +83 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/agents/claude.yaml +10 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/agents/openai.yaml +7 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/defaults.json +9 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/references/memorax-add.md +82 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/references/memorax-search.md +61 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/references/personal-read.md +46 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/references/personal-write.md +100 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/references/repo-build.md +270 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/references/repo-read.md +96 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/references/repo-templates.md +270 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/references/repo-update.md +116 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/collect_all.py +496 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/detect_updates.py +856 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/git_commit_facets.py +222 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/github_resource_facets.py +504 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +509 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/prepare_repo_memory.py +411 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/user_profile_memory.py +528 -0
- package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/validate_memory.py +226 -0
- package/lib/memorax-code-codex-adapter/src/adapter-paths.mjs +29 -0
- package/lib/memorax-code-codex-adapter/src/cli.mjs +368 -0
- package/lib/memorax-code-codex-adapter/src/config-utils.mjs +1 -0
- package/lib/memorax-code-codex-adapter/src/config.mjs +226 -0
- package/lib/memorax-code-codex-adapter/src/session-registry.mjs +331 -0
- package/lib/memorax-code-codex-adapter/src/workspace-kind.mjs +68 -0
- package/lib/node-version.mjs +11 -0
- package/lib/npm-invocation.mjs +31 -0
- package/lib/resolve-claude-command.mjs +47 -0
- package/lib/resolve-codex-command.mjs +94 -0
- package/lib/run-entrypoint.mjs +83 -0
- package/lib/vscode-extension-command.mjs +119 -0
- package/lib/windows-cli-invocation.mjs +100 -0
- package/package.json +45 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Personal Memory Read
|
|
2
|
+
|
|
3
|
+
Use these instructions only to list, recall, or apply repository-scoped personal memory. Do not write, normalize, migrate, repair, or delete memory during a read request.
|
|
4
|
+
|
|
5
|
+
## Route The Read
|
|
6
|
+
|
|
7
|
+
Classify by content:
|
|
8
|
+
|
|
9
|
+
- **Procedure memory:** actions, ordered steps, checklists, prerequisites, gates, validation, exceptions, or repeatable repository work rules.
|
|
10
|
+
- **User-profile memory:** preferred name, language, tone, verbosity, explanation style, result presentation, or another safe interaction preference.
|
|
11
|
+
|
|
12
|
+
Read both categories only when the request genuinely asks for both.
|
|
13
|
+
|
|
14
|
+
## Procedure Memory
|
|
15
|
+
|
|
16
|
+
Read Markdown files directly under:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
<repo>/.repo_memory/procedure-memory/
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
List available topics without recursing into unrelated memory areas:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
(cd <repo>/.repo_memory/procedure-memory && rg --files -g '*.md' -g '!**/*/*.md')
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If the directory does not exist, report that no procedure memory is available; do not create it during a read. Read only files relevant to the request. When listing available procedures, report topic names with concise descriptions instead of opening every file in full unless the user asks for their contents.
|
|
29
|
+
|
|
30
|
+
Treat a stored procedure as lower-priority user guidance, not evidence about current code behavior.
|
|
31
|
+
|
|
32
|
+
## User-Profile Memory
|
|
33
|
+
|
|
34
|
+
Resolve `<skill-dir>` as the parent directory of the `references/` directory containing this file, then run:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
python3 <skill-dir>/scripts/user_profile_memory.py list --repo <repo>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Use only active preferences returned by the script. If the preferences file does not exist, report that no user-profile memory is available; the list operation does not create it.
|
|
41
|
+
|
|
42
|
+
Mention only preferences relevant to the current request unless the user explicitly asks to list all of them. Stored preferences describe how Codex should interact with the user; they are not repository facts.
|
|
43
|
+
|
|
44
|
+
## Priority
|
|
45
|
+
|
|
46
|
+
Apply instructions in this order: system and developer instructions, `AGENTS.md`, the current user request, then stored personal memory.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Personal Memory Write
|
|
2
|
+
|
|
3
|
+
Use these instructions only to save, update, forget, or delete repository-scoped personal memory. Classify by what the content prescribes, not wording such as "I prefer", "I like", "我的习惯", or "我喜欢".
|
|
4
|
+
|
|
5
|
+
## Route The Write
|
|
6
|
+
|
|
7
|
+
- **Procedure memory:** actions, ordering, checklists, prerequisites, gates, validation, exceptions, or repeatable repository work rules. Require the user to explicitly ask to remember, save, record, update, forget, or delete them.
|
|
8
|
+
- **User-profile memory:** preferred name, language, tone, verbosity, explanation style, result presentation, or another safe personal profile fact. A durable repository-scoped profile preference may be saved implicitly.
|
|
9
|
+
|
|
10
|
+
Store each part under its own authority when a request genuinely contains both. Do not persist current-task instructions or temporary plans.
|
|
11
|
+
|
|
12
|
+
Keep file names, schema and script field names, type values, command options, and fixed Markdown headings in English. Write human-readable memory content in the user's current interaction language unless the user explicitly requests another storage language. This includes procedure titles and steps and user-profile descriptions, applicability, and exceptions. Preserve exact code identifiers, commands, paths, API names, and quoted literals without translation.
|
|
13
|
+
|
|
14
|
+
## Procedure Memory
|
|
15
|
+
|
|
16
|
+
Before writing, ensure the repository root `.gitignore` contains `.repo_memory/`. Store each procedure topic in its own concise kebab-case file directly under:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
<repo>/.repo_memory/procedure-memory/
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Do not create a global procedures file, index, event log, generated metadata, or version history. Do not edit `.repo_memory/PROFILE.md`, `.repo_memory/resources/`, `.repo_memory/raw/`, or `.repo_memory/user-profile/`.
|
|
23
|
+
|
|
24
|
+
Choose the closest existing topic file. Update it when the user refines the same procedure; create a new file only for a distinct topic. Remove superseded wording rather than preserving old versions.
|
|
25
|
+
|
|
26
|
+
Use this shape when useful:
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
# 代码审查
|
|
30
|
+
|
|
31
|
+
Use when: 审查当前仓库中的代码变更时。
|
|
32
|
+
|
|
33
|
+
## Procedure
|
|
34
|
+
|
|
35
|
+
1. 创建 PR 前先审查变更。
|
|
36
|
+
2. 解决阻塞性问题。
|
|
37
|
+
3. 审查完成后再创建 PR。
|
|
38
|
+
|
|
39
|
+
## Exceptions
|
|
40
|
+
|
|
41
|
+
- 优先遵循用户当前提出的更具体指令。
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Delete only the topic file or section the user explicitly identifies. Do not retain deleted text in tombstones, backups, inactive entries, or history files.
|
|
45
|
+
|
|
46
|
+
## User-Profile Memory
|
|
47
|
+
|
|
48
|
+
Use only:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
<repo>/.repo_memory/user-profile/preferences.md
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Resolve `<skill-dir>` as the parent directory of the `references/` directory containing this file. The script owns directory creation, `.gitignore` updates, parsing, normalization, locking, duplicate detection, counts, and deterministic rewriting. Do not hand-edit `preferences.md` except when diagnosing a script failure.
|
|
55
|
+
|
|
56
|
+
List existing preferences before adding and perform semantic matching:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
python3 <skill-dir>/scripts/user_profile_memory.py list --repo <repo>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
If equivalent content exists, do not add it again. Update the matching id when an existing entry expresses the same preference differently. Add only a genuinely new preference:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
python3 <skill-dir>/scripts/user_profile_memory.py add \
|
|
66
|
+
--repo <repo> \
|
|
67
|
+
--type communication \
|
|
68
|
+
--description "用户希望在当前仓库中使用简洁的中文回答。" \
|
|
69
|
+
--applies-when "回答当前仓库相关问题时。" \
|
|
70
|
+
--do-not-apply-when "用户明确要求使用其他语言或格式。"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Allowed script types are `communication`, `workflow`, `environment`, and `profile`. These type names do not expand this authority: never use `workflow` or `environment` to store an executable repository procedure.
|
|
74
|
+
|
|
75
|
+
Update a clearly identified preference in place:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
python3 <skill-dir>/scripts/user_profile_memory.py update \
|
|
79
|
+
--repo <repo> \
|
|
80
|
+
--id <preference-id> \
|
|
81
|
+
--description <current-description> \
|
|
82
|
+
--applies-when <current-scope> \
|
|
83
|
+
--do-not-apply-when <exception>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
If multiple preferences may match, ask the user to choose before updating. Delete only an explicitly identified preference:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
python3 <skill-dir>/scripts/user_profile_memory.py delete \
|
|
90
|
+
--repo <repo> \
|
|
91
|
+
--id <preference-id>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
For delete-all requests, list active preferences and delete each id. Do not preserve deleted text elsewhere.
|
|
95
|
+
|
|
96
|
+
## Safety And Output
|
|
97
|
+
|
|
98
|
+
Do not store secrets, tokens, credentials, `.env` content, sensitive personal data, repository facts, code history, design rationale, one-off task details, raw transcripts, hidden tests, exact patches, raw diffs, target commits, or unsafe destructive commands.
|
|
99
|
+
|
|
100
|
+
After a successful write, update, or deletion, identify the affected topic or preference briefly and confirm that it is local to the current repository.
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
# Repo Memory Build
|
|
2
|
+
|
|
3
|
+
## Core Principle
|
|
4
|
+
|
|
5
|
+
The agent authors the repo memory. Scripts collect and validate mechanical evidence, but do not replace agent-authored memory.
|
|
6
|
+
|
|
7
|
+
Do not let a script write `PROFILE.md`, `resources/commits.md`, `resources/prs.md`, or `resources/issues.md`. The agent must inspect the local project, understand the code, and author the human-facing memory. Scripts may create deterministic raw evidence only.
|
|
8
|
+
|
|
9
|
+
This is the full-build operation, not the daily reader or incremental updater. Return to `SKILL.md` and use `repo-read.md` for task-time search over existing memory. For latest-change-only updates to an existing `.repo_memory`, use `repo-update.md`. Use this reference for first-time creation, full rebuilds, or full refreshes that recollect raw evidence and rewrite authored memory.
|
|
10
|
+
|
|
11
|
+
## Output Layout
|
|
12
|
+
|
|
13
|
+
The user selects a repository, not a memory directory. Do not ask for a `.repo_memory` path. Create this bundle inside the target repository:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
<repo>/.repo_memory/
|
|
17
|
+
├── PROFILE.md
|
|
18
|
+
├── raw/
|
|
19
|
+
│ ├── prepare-report.json
|
|
20
|
+
│ ├── git-commits.json
|
|
21
|
+
│ └── github-facets.json or gitlab-facets.json
|
|
22
|
+
└── resources/
|
|
23
|
+
├── commits.md
|
|
24
|
+
├── prs.md
|
|
25
|
+
└── issues.md
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Script-generated artifacts: `raw/prepare-report.json`, `raw/git-commits.json`, and optional `raw/github-facets.json` or `raw/gitlab-facets.json`. Agent-authored durable artifacts: `PROFILE.md`, `resources/commits.md`, `resources/prs.md`, and `resources/issues.md`.
|
|
29
|
+
|
|
30
|
+
User-managed sidecars may coexist under `.repo_memory/procedure-memory/` and `.repo_memory/user-profile/`. Builder scripts preserve them and exclude them from bundle validation; this skill must not create, edit, or summarize their contents as repo-memory evidence.
|
|
31
|
+
|
|
32
|
+
## Repository Prerequisite
|
|
33
|
+
|
|
34
|
+
The selected target must be a local git repository: either the directory contains `.git/` or is inside a git worktree. A GitHub/GitLab remote is optional; local-only git repositories are supported.
|
|
35
|
+
|
|
36
|
+
If the directory is not a git repository, do not create `.repo_memory/` and do not fabricate a memory bundle from file inspection alone. Stop with a prominent notice:
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
**Repo Memory Cannot Be Built Yet**
|
|
40
|
+
|
|
41
|
+
> This folder is not a git repository, so repo memory cannot collect local commit history or provider-linked PR/MR/issue evidence.
|
|
42
|
+
|
|
43
|
+
**Next steps**
|
|
44
|
+
- If this is an existing project, open the real cloned repo directory.
|
|
45
|
+
- If this is a new project, run `git init` first, make at least one commit, then rerun the `repo-build` operation.
|
|
46
|
+
- If you only want file inspection, continue by inspecting files without repo memory.
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Path Convention
|
|
50
|
+
|
|
51
|
+
`<skill-dir>` means the parent directory of the `references/` directory containing this file. Resolve it before running scripts, for example:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
python3 <skill-dir>/scripts/collect_all.py --repo-path <repo-path> --pretty --progress
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Default Settings
|
|
58
|
+
|
|
59
|
+
Default mechanical collection settings are intentionally visible in `<skill-dir>/defaults.json`:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"schema": "repo_memory_builder_defaults.v1",
|
|
64
|
+
"limits": {
|
|
65
|
+
"commits": 30,
|
|
66
|
+
"prs": 30,
|
|
67
|
+
"issues": 30
|
|
68
|
+
},
|
|
69
|
+
"summaryChars": 4000
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
To change defaults for future builder runs, edit `defaults.json`, not the Python scripts. To override one run, pass `--commit-limit`, `--pr-limit`, `--issue-limit`, or `--summary-chars` to `collect_all.py`.
|
|
74
|
+
|
|
75
|
+
Provider collection is best-effort by default. Use `--skip-provider` for an explicit local-only run that does not call GitHub/GitLab, and use `--require-provider` only when the user explicitly requires PR/MR/issue evidence and the run should fail instead of falling back to local-only memory.
|
|
76
|
+
|
|
77
|
+
## User Count Requests
|
|
78
|
+
|
|
79
|
+
If the user mentions how many commits, PRs/MRs, or issues to collect, treat that as a one-run override and pass explicit limit flags to `collect_all.py`. Do not edit `defaults.json` for a one-run request.
|
|
80
|
+
|
|
81
|
+
Examples:
|
|
82
|
+
|
|
83
|
+
- "拉 50 条 commit" means add `--commit-limit 50`.
|
|
84
|
+
- "PR 拉 20 条,issue 拉 30 条" means add `--pr-limit 20 --issue-limit 30`.
|
|
85
|
+
- "commit、PR、issue 都拉 50 条" means add `--commit-limit 50 --pr-limit 50 --issue-limit 50`.
|
|
86
|
+
|
|
87
|
+
Only edit `defaults.json` when the user asks to change defaults for future build runs, for example "以后默认都拉 50 条" or "把 repo memory 的默认 limit 改成 50".
|
|
88
|
+
|
|
89
|
+
## Progress Display
|
|
90
|
+
|
|
91
|
+
Skill instructions cannot render app-native progress components by themselves. For interactive builder runs, prefer `collect_all.py --progress`; it renders a terminal progress bar on stderr while keeping stdout as the final JSON report. Omit `--progress` only for strict machine-only runs that must avoid stderr progress output.
|
|
92
|
+
|
|
93
|
+
The progress bar covers the mechanical collection steps: preparation, local commits, and provider facets. Provider warnings are not terminal notifications; they are returned in the JSON report as structured `notices[]` so the agent can show them as a normal user-visible assistant message. The progress bar does not replace the required provider warning notice, final JSON report review, agent-authored Markdown work, or final validation.
|
|
94
|
+
|
|
95
|
+
## Build Modes
|
|
96
|
+
|
|
97
|
+
Build mode controls only the local project understanding phase. The mechanical collection, authoring, and validation flow stays the same.
|
|
98
|
+
|
|
99
|
+
- Default to lightweight mode when the user does not specify.
|
|
100
|
+
- Use lightweight mode for a quick or docs-only pass. Read root README/high-level docs, repo-local agent instructions such as `AGENTS.md` or `CLAUDE.md`, and clearly linked overview/setup docs. Do not inspect source, manifests, scripts, or CI just to deepen the profile. Mark code-level architecture claims as doc-derived or unverified.
|
|
101
|
+
- Use deep mode only when the user explicitly asks for deep/thorough/full work, or when docs are too thin to produce useful memory. Read docs and agent instructions, then inspect repository structure, module READMEs, representative source and entrypoints, manifests, scripts, and CI before writing `PROFILE.md`.
|
|
102
|
+
- Do not stop to ask for a mode unless the user's request is contradictory.
|
|
103
|
+
|
|
104
|
+
## Tool Roles
|
|
105
|
+
|
|
106
|
+
### `scripts/collect_all.py`
|
|
107
|
+
|
|
108
|
+
Use this as the primary mechanical path. It prepares the workspace, collects local git commit evidence, collects GitHub/GitLab PR/MR/issue evidence when provider auth is ready, and returns a JSON report describing completed steps and outputs. If provider collection fails after preparation reports `provider_evidence_state: "ready"`, the default behavior is to keep local commit evidence, emit a warning notice, and report `steps.provider_facets.degraded_to_local_only: true`. Only `--require-provider` turns this into a hard failure.
|
|
109
|
+
|
|
110
|
+
Default run:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
python3 <skill-dir>/scripts/collect_all.py --repo-path <repo-path> --snapshot-ref HEAD --pretty --progress
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
One-run limit override:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
python3 <skill-dir>/scripts/collect_all.py --repo-path <repo-path> --snapshot-ref HEAD --commit-limit 50 --pr-limit 20 --issue-limit 20 --pretty --progress
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Full refresh of an existing `.repo_memory` bundle:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
python3 <skill-dir>/scripts/collect_all.py --repo-path <repo-path> --reuse --snapshot-ref HEAD --pretty --progress
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Local-only memory or hard-required provider evidence:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
python3 <skill-dir>/scripts/collect_all.py --repo-path <repo-path> --snapshot-ref HEAD --skip-provider --pretty --progress
|
|
132
|
+
python3 <skill-dir>/scripts/collect_all.py --repo-path <repo-path> --snapshot-ref HEAD --require-provider --pretty --progress
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Tell the user before starting long collection steps. After completion, report collected counts from the JSON report: local commits, PRs/MRs, issues, provider state, skipped steps, notices, and output files.
|
|
136
|
+
|
|
137
|
+
#### Final Summary Notices
|
|
138
|
+
|
|
139
|
+
If the final JSON report contains `notices[]`, the final user-facing summary must include those notices explicitly. Include the notice title, message, and next steps, especially `Provider Evidence Unavailable`.
|
|
140
|
+
|
|
141
|
+
Do not silently collapse notices into counts, provider state, or a generic "local-only" sentence. If provider evidence degraded to local-only, say that directly and include the reason from the notice.
|
|
142
|
+
|
|
143
|
+
#### Provider Sandbox and Transport Failures
|
|
144
|
+
|
|
145
|
+
`gh/glab` provider collection needs external network access. If provider stderr or `notices[]` shows `fetch failed`, timeout, DNS, connection, TLS, `ENOTFOUND`, `EAI_AGAIN`, or similar transport text, report provider evidence unavailable and continue local-only unless `--require-provider` was requested.
|
|
146
|
+
|
|
147
|
+
Verify provider authentication in the same normal shell with the command reported by `collect_all.py`; for GitHub Enterprise or self-hosted GitLab this may include `--hostname <host>`. Authenticate with `gh auth login` or `glab auth login` (also host-scoped when prompted), then rerun `collect_all.py`; do not paste tokens into the skill or call provider APIs directly.
|
|
148
|
+
|
|
149
|
+
Do not use a restricted shell sandbox to verify provider/API availability. Verify in a normal shell or approved network-enabled mode. If only restricted shell access is available, report provider evidence unavailable and continue local-only unless `--require-provider` was requested. Do not treat a provider transport failure as empty PR/issue evidence, no PR/issue changes, bad login, or bypass the scripts with direct APIs, browser scraping, copied credentials, or hand-written raw facets.
|
|
150
|
+
|
|
151
|
+
### `scripts/validate_memory.py`
|
|
152
|
+
|
|
153
|
+
Use this as the final gate after authoring `PROFILE.md` and `resources/*.md`. It accepts either the repository root or the memory root, validates required files, JSON parseability, frontmatter counts, placeholder removal, and provider raw/resource consistency.
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
python3 <skill-dir>/scripts/validate_memory.py <repo-path> --pretty
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Internal scripts
|
|
160
|
+
|
|
161
|
+
These are invoked by `collect_all.py`. Use them directly only for debugging or narrow recovery:
|
|
162
|
+
|
|
163
|
+
- `prepare_repo_memory.py`: validates the target repo, handles `--reuse`, creates `.repo_memory/{raw,resources}`, updates `.gitignore`, and writes `raw/prepare-report.json`.
|
|
164
|
+
- `git_commit_facets.py`: collects local commit facets from the selected snapshot. It needs only local git history.
|
|
165
|
+
- `github_resource_facets.py` and `gitlab_resource_facets.py`: collect provider PR/MR/issue facets when `prepare-report.json` says the provider is ready. They share the same downstream resource shape; GitLab merge requests are normalized into PR resources.
|
|
166
|
+
|
|
167
|
+
Provider resource facets share this contract: `--snapshot-ref HEAD` filters merged PRs/MRs by merge-commit ancestry against the local snapshot; open and closed-unmerged PRs/MRs are not retained as landed evidence; issues come from the current bounded provider list because issues do not have reliable commit ancestry. For PRs/MRs, `--pr-limit` is the retained count after snapshot filtering.
|
|
168
|
+
|
|
169
|
+
## Agent Workflow
|
|
170
|
+
|
|
171
|
+
Follow this order manually:
|
|
172
|
+
|
|
173
|
+
1. **Collect mechanical evidence**
|
|
174
|
+
- Run `collect_all.py`.
|
|
175
|
+
- Use `--reuse` only for a full refresh/rebuild of an existing `.repo_memory`; for latest-change-only updates, prefer `repo-update.md`.
|
|
176
|
+
- Read the returned JSON report and `.repo_memory/raw/prepare-report.json`.
|
|
177
|
+
- Stop if preparation fails. Do not improvise around git/repo safety checks.
|
|
178
|
+
|
|
179
|
+
2. **Show provider notices**
|
|
180
|
+
- If `notices[]` contains `Provider Evidence Unavailable`, show it as a normal assistant message before continuing and repeat it in the final summary.
|
|
181
|
+
- Render `title` as a bold heading, `message` as body text, `command` as the login command when present, and `next_steps` as recovery steps. Do not show raw JSON or put the notice inside a fenced code block.
|
|
182
|
+
- If `notices[]` is absent, fall back to `raw/prepare-report.json`: when `provider_notice_level` is `warning`, render `provider_notice_markdown` as a normal assistant message.
|
|
183
|
+
- If the user explicitly required PR/MR/issue evidence, run with `--require-provider`, stop after provider failure, and ask them to install/login or fix repository access before rerunning.
|
|
184
|
+
|
|
185
|
+
Use this visible shape:
|
|
186
|
+
|
|
187
|
+
```text
|
|
188
|
+
**Provider Evidence Unavailable**
|
|
189
|
+
|
|
190
|
+
<notice.message>
|
|
191
|
+
|
|
192
|
+
**Next steps for provider evidence**
|
|
193
|
+
Run: `<notice.command>`
|
|
194
|
+
|
|
195
|
+
<notice.next_steps rerun item>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
3. **Understand the local project**
|
|
199
|
+
- Choose lightweight by default; choose deep only when requested or clearly needed.
|
|
200
|
+
- Form project-level understanding before looking at PR/issue history.
|
|
201
|
+
- Record whether conclusions are doc-derived or code-inspected.
|
|
202
|
+
|
|
203
|
+
4. **Draft `PROFILE.md`**
|
|
204
|
+
- Read [repo-templates.md](repo-templates.md) before writing memory files.
|
|
205
|
+
- Include repo identity, checkout state, evidence inspected, agent consumption rules, module map, verification gates, architecture boundaries, resource pointers, and retrieval flow.
|
|
206
|
+
- Record the selected build mode and avoid overstating code-level claims in lightweight mode.
|
|
207
|
+
|
|
208
|
+
5. **Review raw evidence**
|
|
209
|
+
- Confirm `raw/git-commits.json` exists.
|
|
210
|
+
- When provider evidence is available, confirm the matching provider facets exist.
|
|
211
|
+
- If provider evidence is missing, skipped, or degraded to local-only, keep PR/issue resources explicitly marked unavailable instead of inventing provider evidence.
|
|
212
|
+
|
|
213
|
+
6. **Author human-readable resources**
|
|
214
|
+
- Use the resource templates in [repo-templates.md](repo-templates.md).
|
|
215
|
+
- Read raw facets and write `resources/commits.md`, `resources/prs.md`, and `resources/issues.md` yourself.
|
|
216
|
+
- Keep resources compact. Use one fixed-field section per commit, PR/MR, or issue, separated by `---`; do not use Markdown tables.
|
|
217
|
+
- Every section must include a search-grade `Description`.
|
|
218
|
+
|
|
219
|
+
7. **Finalize and validate**
|
|
220
|
+
- Add final pointers and provider snapshot notes to `PROFILE.md`.
|
|
221
|
+
- Run `validate_memory.py` as the final gate.
|
|
222
|
+
- Fix authored Markdown placeholders, frontmatter counts, or resource mismatches before reporting success.
|
|
223
|
+
|
|
224
|
+
## Refresh/Update Workflow
|
|
225
|
+
|
|
226
|
+
For incremental updates to recent commits, PRs/MRs, or issues in an existing `.repo_memory`, use `repo-update.md`.
|
|
227
|
+
|
|
228
|
+
Use builder refresh only when the user wants a full rebuild/full refresh while preserving the existing memory directory:
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
python3 <skill-dir>/scripts/collect_all.py --repo-path <repo-path> --reuse --pretty --progress
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Then rewrite affected human-authored resources from the new raw evidence. Preserve useful existing notes only when they are still supported by current raw evidence and live repository inspection. Never append or patch raw/provider JSON by hand; rerun the collection scripts instead.
|
|
235
|
+
|
|
236
|
+
## Description Quality Standard
|
|
237
|
+
|
|
238
|
+
`Description` is the main agentic-search surface for `resources/commits.md`, `resources/prs.md`, and `resources/issues.md`. Keep only the core rule here; the full quality standard and section scaffolding live in [repo-templates.md](repo-templates.md).
|
|
239
|
+
|
|
240
|
+
Every description must say what the item explains, when a future agent should open it, which modules/files/commands/config it points to, concrete search cues, and evidence strength. Do not copy raw summaries, headings, or tables into descriptions, and avoid vague descriptions like "fix bug" or "update docs".
|
|
241
|
+
|
|
242
|
+
## Generated Knowledge Contract
|
|
243
|
+
|
|
244
|
+
Generate memory that the `memorax-code` repo-read operation can consume progressively:
|
|
245
|
+
|
|
246
|
+
- `PROFILE.md` is the stable entry point and should summarize identity, evidence, architecture, verification gates, and resource pointers.
|
|
247
|
+
- `resources/*.md` are compact human-readable routing resources with search-grade descriptions.
|
|
248
|
+
- `raw/*.json` contains optional build/debug evidence for deep inspection when compact resources are insufficient.
|
|
249
|
+
|
|
250
|
+
Do not duplicate the daily retrieval workflow here. The `repo-read` operation owns trigger timing, silent background-maintenance handoff, and task-specific search behavior.
|
|
251
|
+
|
|
252
|
+
## Trust Rules
|
|
253
|
+
|
|
254
|
+
- Local code and targeted verification are stronger evidence than generated memory.
|
|
255
|
+
- Local git commit evidence is checkout history and does not require provider login.
|
|
256
|
+
- GitHub/GitLab PR/issue evidence is historical/contextual, not proof of current checkout behavior.
|
|
257
|
+
- Open PRs are active branch intent, not landed behavior.
|
|
258
|
+
- Closed unmerged PRs are weak or superseded evidence.
|
|
259
|
+
- Merged PRs are useful history but still require current code verification.
|
|
260
|
+
|
|
261
|
+
## Authoring Templates
|
|
262
|
+
|
|
263
|
+
When writing `PROFILE.md`, `resources/commits.md`, `resources/prs.md`, or `resources/issues.md`, read [repo-templates.md](repo-templates.md) and use it as fill-in scaffolding. Remove placeholders from final files and delete sections that are genuinely unavailable.
|
|
264
|
+
|
|
265
|
+
Apply these rules even before loading the templates:
|
|
266
|
+
|
|
267
|
+
- Use fixed-field resource sections separated by `---`; do not use Markdown tables for PRs or issues.
|
|
268
|
+
- Write search-grade `Description` fields that explain what the PR/issue covers, when future agents should open it, affected modules/files/behaviors, concrete search cues, and evidence strength.
|
|
269
|
+
- Do not copy raw summaries or headings into descriptions; synthesize routing cues from raw facets and current project understanding.
|
|
270
|
+
- Do not add persistent `indexes/*.json` files or `index:` frontmatter; search `resources/*.md` directly and open raw JSON only for build/debug evidence.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Repo Memory Read
|
|
2
|
+
|
|
3
|
+
## Role And Demand Gate
|
|
4
|
+
|
|
5
|
+
Use existing `.repo_memory/` as a routing layer for repository identity, architecture, history, PR/issue context, remembered fixes, and cross-module search. Live code and tests remain authoritative.
|
|
6
|
+
|
|
7
|
+
Select this reference for broad repo introduction, history, architecture background, cross-module routing, PR/issue context, design rationale, or stale-memory awareness. Skip this reference for narrow tasks with a clear live-code target.
|
|
8
|
+
|
|
9
|
+
Only a relevant `repo-read` invokes `maintain`. Commit arrival, PR merge, and elapsed time alone do not invoke it. Explicit build, rebuild, or update requests still route through `SKILL.md` to `repo-build.md` or `repo-update.md`.
|
|
10
|
+
|
|
11
|
+
## Repository And Helper
|
|
12
|
+
|
|
13
|
+
Resolve the repository in this order:
|
|
14
|
+
|
|
15
|
+
1. Use the user's explicit local path.
|
|
16
|
+
2. Otherwise use the current workspace Git root.
|
|
17
|
+
3. Infer a named local repo only when the match is unambiguous.
|
|
18
|
+
4. Ask for the path only when multiple repos remain plausible.
|
|
19
|
+
|
|
20
|
+
Derive memory as `<repo>/.repo_memory`; never ask for a memory-directory path. If the target is not inside a Git worktree, skip maintenance and continue from live files.
|
|
21
|
+
|
|
22
|
+
`<skill-dir>` is the parent of this file's `references/` directory. The packaged client helper is:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
node '<skill-dir>/../../hooks/repo-memory-job.mjs' maintain --repo '<repo>'
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Use it only when it is a regular file. It validates the generated bundle, evaluates the configured local update policy without provider network access, and atomically selects one outcome:
|
|
29
|
+
|
|
30
|
+
- `bundle_missing` or `bundle_invalid`: start supervised build;
|
|
31
|
+
- a triggered policy decision: start supervised update;
|
|
32
|
+
- `up_to_date`: no-op;
|
|
33
|
+
- `active_job`: deduplicate against the running job.
|
|
34
|
+
|
|
35
|
+
The default policy remains `adaptive(5 commits OR 24 hours)`. A missing or non-ancestor baseline always selects repair-capable update. The helper owns the detailed policy, validation, lock, snapshot, and launcher rules; do not reproduce them in the foreground.
|
|
36
|
+
|
|
37
|
+
## Retrieval
|
|
38
|
+
|
|
39
|
+
If `.repo_memory/PROFILE.md` is a readable regular file, read it once. Treat its descriptions as routing cues, not proof.
|
|
40
|
+
|
|
41
|
+
Search `PROFILE.md` and `.repo_memory/resources/` with a combined query built from the user's strongest handles: path, basename, symbol, command, PR/issue number, error text, module, branch, environment variable, or config key.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
rg -n '<handle-1>|<handle-2>' \
|
|
45
|
+
.repo_memory/PROFILE.md .repo_memory/resources
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Use:
|
|
49
|
+
|
|
50
|
+
- `resources/commits.md` for local history and regressions;
|
|
51
|
+
- `resources/prs.md` for merged or active implementation context;
|
|
52
|
+
- `resources/issues.md` for symptoms, requests, and requirements.
|
|
53
|
+
|
|
54
|
+
If a read is missing, unreadable, or structurally mixed, discard conclusions that depend only on the bundle. Do not repair it in the foreground.
|
|
55
|
+
|
|
56
|
+
## Retrieval Budget
|
|
57
|
+
|
|
58
|
+
- Read `PROFILE.md` at most once.
|
|
59
|
+
- Run at most 2 combined `rg` commands.
|
|
60
|
+
- Stop repo-memory retrieval as soon as the hits are sufficient.
|
|
61
|
+
- Open only the matched resource section when `rg` context is insufficient.
|
|
62
|
+
|
|
63
|
+
Do NOT open these unless the user explicitly asks or a compact hit contains only a `facetId`:
|
|
64
|
+
|
|
65
|
+
- `.repo_memory/raw/*.json`;
|
|
66
|
+
- `docs/`, `packages/`, `tests/`, or other live source directories.
|
|
67
|
+
|
|
68
|
+
The live directories restriction applies only during the bounded memory phase. Current implementation claims and code edits still require live-code verification after the maintenance handoff.
|
|
69
|
+
|
|
70
|
+
## Single Maintenance Handoff
|
|
71
|
+
|
|
72
|
+
After the final repo-memory read, run `maintain` as the very next tool action. Do not run it in parallel with a repo-memory read. Do not inspect live code, maintained documentation, Git evidence, run unrelated tools, or answer between them.
|
|
73
|
+
|
|
74
|
+
If no repo-memory read was possible, run it immediately after detecting that state. The same handoff applies when hits already answer the question or the retrieval budget is exhausted.
|
|
75
|
+
|
|
76
|
+
After it returns:
|
|
77
|
+
|
|
78
|
+
- For `up_to_date`, a triggered update, or `active_job`, use consistent hits as best-effort context.
|
|
79
|
+
- For `bundle_missing` or `bundle_invalid`, discard generated hits and continue from live code and maintained documentation.
|
|
80
|
+
- If the helper is unavailable or fails, do not improvise maintenance. Use consistent hits only when they were readable; otherwise use live evidence.
|
|
81
|
+
|
|
82
|
+
Do not read repo memory again after `maintain` returns. Do not wait, poll, retry, or expose the command, decision payload, job id, paths, prompt, final message, or logs. Never replace the packaged helper with a generic subagent.
|
|
83
|
+
|
|
84
|
+
## Answer And Trust Rules
|
|
85
|
+
|
|
86
|
+
Answer history, architecture, and context questions from sufficient memory hits after the handoff. If two bounded searches miss, say what was not found and ask whether to inspect more deeply.
|
|
87
|
+
|
|
88
|
+
Continue into live evidence after the handoff when the user asks about current behavior, requests an edit, or the bundle was unavailable. Keep these distinctions explicit:
|
|
89
|
+
|
|
90
|
+
- live code and targeted verification are stronger than generated memory;
|
|
91
|
+
- tests are stronger than PR or issue summaries;
|
|
92
|
+
- commits and merged PRs are historical evidence, not current-behavior proof;
|
|
93
|
+
- open PRs describe intent;
|
|
94
|
+
- issues describe problem context.
|
|
95
|
+
|
|
96
|
+
Never create, update, delete, or repair repo-memory files in the foreground `repo-read` task.
|