create-egregore 0.21.0-runtime-mvp.26 → 0.21.0-runtime-mvp.28
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/assets/egregore-launcher.js +120 -70
- package/bin/cli.js +81 -67
- package/lib/api.js +6 -2
- package/lib/auth.js +1 -1
- package/lib/harness-add.js +159 -0
- package/lib/install-access.js +87 -0
- package/lib/setup.js +84 -10
- package/lib/token-install.js +65 -0
- package/package.json +5 -3
- package/runtime/claude/.claude/context/notification-consent.md +17 -2
- package/runtime/claude/.claude/context/retrieval-investigation.md +50 -0
- package/runtime/claude/.claude/context/telemetry.md +72 -3
- package/runtime/claude/.claude/hooks/memory-read-guard.sh +54 -13
- package/runtime/claude/.claude/hooks/retrieval-context.sh +4 -44
- package/runtime/claude/.claude/rules/voice-bedrock.md +11 -0
- package/runtime/claude/.claude/skills/branch/SKILL.md +22 -18
- package/runtime/claude/.claude/skills/commit/SKILL.md +11 -7
- package/runtime/claude/.claude/skills/create-skill/SKILL.md +5 -3
- package/runtime/claude/.claude/skills/issue/SKILL.md +94 -0
- package/runtime/claude/.claude/skills/pr/SKILL.md +11 -17
- package/runtime/claude/.claude/skills/pull/SKILL.md +10 -33
- package/runtime/claude/.claude/skills/push/SKILL.md +6 -2
- package/runtime/claude/.claude/skills/review-pr/SKILL.md +18 -0
- package/runtime/claude/.claude/skills/save/SKILL.md +12 -2
- package/runtime/claude/.claude/skills/test/SKILL.md +2 -2
- package/runtime/claude/.claude/skills/update/SKILL.md +1 -1
- package/runtime/claude/.claude/skills/view/SKILL.md +3 -2
- package/runtime/claude/CLAUDE.md +34 -16
- package/runtime/claude/bin/agent.sh +56 -4
- package/runtime/claude/bin/base-branch.sh +62 -0
- package/runtime/claude/bin/codex-render-spec.mjs +32 -64
- package/runtime/claude/bin/codex-session-start.sh +24 -39
- package/runtime/claude/bin/codex-sync-skills.sh +79 -24
- package/runtime/claude/bin/graph-op.sh +73 -3
- package/runtime/claude/bin/lib/generated-trees.sh +27 -0
- package/runtime/claude/bin/lib/git-sync.sh +53 -9
- package/runtime/claude/bin/lib/greeting.sh +41 -71
- package/runtime/claude/bin/lib/health-footer.sh +115 -0
- package/runtime/claude/bin/lib/identity.sh +1 -0
- package/runtime/claude/bin/lib/notices.sh +177 -0
- package/runtime/claude/bin/lib/repo-paths.sh +40 -0
- package/runtime/claude/bin/observe-context.sh +2 -2
- package/runtime/claude/bin/pi-render-spec.mjs +0 -1
- package/runtime/claude/bin/prime-render-spec.mjs +1 -2
- package/runtime/claude/bin/prose-check-tally.sh +102 -0
- package/runtime/claude/bin/prose-check.mjs +554 -0
- package/runtime/claude/bin/prose-rules/announcing-instead-of-doing.md +24 -0
- package/runtime/claude/bin/prose-rules/banned-vocabulary.md +40 -0
- package/runtime/claude/bin/prose-rules/coined-terms.md +20 -0
- package/runtime/claude/bin/prose-rules/exclamation.md +24 -0
- package/runtime/claude/bin/prose-rules/filler-intensifiers.md +24 -0
- package/runtime/claude/bin/prose-rules/hedging-stack.md +26 -0
- package/runtime/claude/bin/prose-rules/mannered-prose.md +24 -0
- package/runtime/claude/bin/prose-rules/not-x-but-y.md +23 -0
- package/runtime/claude/bin/prose-rules/one-name-per-thing.md +20 -0
- package/runtime/claude/bin/prose-rules/passive-enthusiasm.md +25 -0
- package/runtime/claude/bin/prose-rules/process-narration.md +30 -0
- package/runtime/claude/bin/prose-rules/rhetorical-opener.md +23 -0
- package/runtime/claude/bin/prose-rules/self-contained.md +20 -0
- package/runtime/claude/bin/prose-rules/self-praise.md +22 -0
- package/runtime/claude/bin/prose-rules/temporal-handwave.md +27 -0
- package/runtime/claude/bin/pull.sh +272 -0
- package/runtime/claude/bin/qa-inventory.sh +341 -0
- package/runtime/claude/bin/search.sh +104 -58
- package/runtime/claude/bin/session-start.sh +2 -0
- package/runtime/claude/bin/telemetry.sh +65 -18
- package/runtime/claude/bin/test-baseline.sh +296 -0
- package/runtime/claude/bin/test-changes.sh +196 -145
- package/runtime/claude/bin/view-render.sh +6 -2
- package/runtime/claude/bin/worktree-create.sh +11 -0
- package/runtime/claude/egregore_runtime/adapters/qmd.py +309 -50
- package/runtime/claude/egregore_runtime/adapters/qmd_cli.py +6 -3
- package/runtime/claude/egregore_runtime/adapters/qmd_scoped.mjs +202 -0
- package/runtime/claude/egregore_runtime/adapters/qmd_scoped.py +137 -0
- package/runtime/claude/egregore_runtime/adapters/qmd_worker.mjs +123 -0
- package/runtime/claude/egregore_runtime/artifacts.py +11 -1
- package/runtime/claude/egregore_runtime/contracts.py +25 -1
- package/runtime/claude/egregore_runtime/eligibility.py +137 -0
- package/runtime/claude/egregore_runtime/episode_binding.py +178 -0
- package/runtime/claude/egregore_runtime/excerpts.py +42 -0
- package/runtime/claude/egregore_runtime/github_issues.py +244 -0
- package/runtime/claude/egregore_runtime/harness_cli.py +545 -402
- package/runtime/claude/egregore_runtime/identity.py +52 -0
- package/runtime/claude/egregore_runtime/ingest_index_cli.py +4 -2
- package/runtime/claude/egregore_runtime/investigation.py +792 -0
- package/runtime/claude/egregore_runtime/investigation_contracts.py +104 -0
- package/runtime/claude/egregore_runtime/investigation_guidance.py +51 -0
- package/runtime/claude/egregore_runtime/issue_cli.py +66 -0
- package/runtime/claude/egregore_runtime/issue_markers.py +50 -0
- package/runtime/claude/egregore_runtime/issue_reporting.py +224 -0
- package/runtime/claude/egregore_runtime/observe.py +41 -6
- package/runtime/claude/egregore_runtime/operation_cli.py +76 -0
- package/runtime/claude/egregore_runtime/operation_observations.py +208 -0
- package/runtime/claude/egregore_runtime/private_result.py +147 -0
- package/runtime/claude/egregore_runtime/research_ingest_cli.py +3 -1
- package/runtime/claude/egregore_runtime/runtime.py +38 -1
- package/runtime/claude/egregore_runtime/scroll_cli.py +1 -1
- package/runtime/claude/egregore_runtime/scrolls.py +172 -28
- package/runtime/claude/egregore_runtime/sync.py +226 -15
- package/runtime/claude/egregore_runtime/sync_health.py +63 -0
- package/runtime/claude/egregore_runtime/telemetry.py +102 -10
- package/runtime/claude/egregore_runtime/threads.py +4 -1
- package/runtime/claude/egregore_runtime/writeback.py +28 -4
- package/runtime/claude/manifest.json +42 -0
- package/runtime/codex/.claude/context/notification-consent.md +17 -2
- package/runtime/codex/.claude/context/retrieval-investigation.md +50 -0
- package/runtime/codex/.codex/skills/activity/SKILL.md +4 -0
- package/runtime/codex/.codex/skills/announce/SKILL.md +7 -0
- package/runtime/codex/.codex/skills/archive/SKILL.md +7 -0
- package/runtime/codex/.codex/skills/checkup/SKILL.md +7 -0
- package/runtime/codex/.codex/skills/dashboard/SKILL.md +4 -0
- package/runtime/codex/.codex/skills/deep-reflect/SKILL.md +8 -0
- package/runtime/codex/.codex/skills/handoff/SKILL.md +8 -3
- package/runtime/codex/.codex/skills/harvest/SKILL.md +8 -0
- package/runtime/codex/.codex/skills/ingest/SKILL.md +4 -0
- package/runtime/codex/.codex/skills/ingest-user-interview/SKILL.md +7 -0
- package/runtime/codex/.codex/skills/invite/SKILL.md +7 -0
- package/runtime/codex/.codex/skills/issue/SKILL.md +102 -0
- package/runtime/codex/.codex/skills/meeting/SKILL.md +8 -0
- package/runtime/codex/.codex/skills/note/SKILL.md +7 -0
- package/runtime/codex/.codex/skills/onboarding/SKILL.md +7 -0
- package/runtime/codex/.codex/skills/quest/SKILL.md +7 -0
- package/runtime/codex/.codex/skills/reflect/SKILL.md +8 -0
- package/runtime/codex/.codex/skills/save/SKILL.md +24 -7
- package/runtime/codex/.codex/skills/the-spiral/SKILL.md +10 -1
- package/runtime/codex/.codex/skills/tutorial/SKILL.md +8 -0
- package/runtime/codex/.codex/skills/view/SKILL.md +8 -0
- package/runtime/codex/.codex/skills/wrap/SKILL.md +8 -0
- package/runtime/codex/.codex/spec-manifest.json +7 -7
- package/runtime/codex/AGENTS.md +60 -74
- package/runtime/codex/bin/agent.sh +56 -4
- package/runtime/codex/bin/base-branch.sh +62 -0
- package/runtime/codex/bin/codex-render-spec.mjs +32 -64
- package/runtime/codex/bin/codex-session-start.sh +24 -39
- package/runtime/codex/bin/codex-sync-skills.sh +79 -24
- package/runtime/codex/bin/graph-op.sh +73 -3
- package/runtime/codex/bin/lib/generated-trees.sh +27 -0
- package/runtime/codex/bin/lib/git-sync.sh +53 -9
- package/runtime/codex/bin/lib/greeting.sh +41 -71
- package/runtime/codex/bin/lib/health-footer.sh +115 -0
- package/runtime/codex/bin/lib/identity.sh +1 -0
- package/runtime/codex/bin/lib/notices.sh +177 -0
- package/runtime/codex/bin/lib/repo-paths.sh +40 -0
- package/runtime/codex/bin/observe-context.sh +2 -2
- package/runtime/codex/bin/pi-render-spec.mjs +0 -1
- package/runtime/codex/bin/prime-render-spec.mjs +1 -2
- package/runtime/codex/bin/prose-check-tally.sh +102 -0
- package/runtime/codex/bin/prose-check.mjs +554 -0
- package/runtime/codex/bin/prose-rules/announcing-instead-of-doing.md +24 -0
- package/runtime/codex/bin/prose-rules/banned-vocabulary.md +40 -0
- package/runtime/codex/bin/prose-rules/coined-terms.md +20 -0
- package/runtime/codex/bin/prose-rules/exclamation.md +24 -0
- package/runtime/codex/bin/prose-rules/filler-intensifiers.md +24 -0
- package/runtime/codex/bin/prose-rules/hedging-stack.md +26 -0
- package/runtime/codex/bin/prose-rules/mannered-prose.md +24 -0
- package/runtime/codex/bin/prose-rules/not-x-but-y.md +23 -0
- package/runtime/codex/bin/prose-rules/one-name-per-thing.md +20 -0
- package/runtime/codex/bin/prose-rules/passive-enthusiasm.md +25 -0
- package/runtime/codex/bin/prose-rules/process-narration.md +30 -0
- package/runtime/codex/bin/prose-rules/rhetorical-opener.md +23 -0
- package/runtime/codex/bin/prose-rules/self-contained.md +20 -0
- package/runtime/codex/bin/prose-rules/self-praise.md +22 -0
- package/runtime/codex/bin/prose-rules/temporal-handwave.md +27 -0
- package/runtime/codex/bin/pull.sh +272 -0
- package/runtime/codex/bin/qa-inventory.sh +341 -0
- package/runtime/codex/bin/search.sh +104 -58
- package/runtime/codex/bin/telemetry.sh +65 -18
- package/runtime/codex/bin/test-baseline.sh +296 -0
- package/runtime/codex/bin/test-changes.sh +196 -145
- package/runtime/codex/bin/view-render.sh +6 -2
- package/runtime/codex/bin/worktree-create.sh +11 -0
- package/runtime/codex/egregore_runtime/adapters/qmd.py +309 -50
- package/runtime/codex/egregore_runtime/adapters/qmd_cli.py +6 -3
- package/runtime/codex/egregore_runtime/adapters/qmd_scoped.mjs +202 -0
- package/runtime/codex/egregore_runtime/adapters/qmd_scoped.py +137 -0
- package/runtime/codex/egregore_runtime/adapters/qmd_worker.mjs +123 -0
- package/runtime/codex/egregore_runtime/artifacts.py +11 -1
- package/runtime/codex/egregore_runtime/contracts.py +25 -1
- package/runtime/codex/egregore_runtime/eligibility.py +137 -0
- package/runtime/codex/egregore_runtime/episode_binding.py +178 -0
- package/runtime/codex/egregore_runtime/excerpts.py +42 -0
- package/runtime/codex/egregore_runtime/github_issues.py +244 -0
- package/runtime/codex/egregore_runtime/harness_cli.py +545 -402
- package/runtime/codex/egregore_runtime/identity.py +52 -0
- package/runtime/codex/egregore_runtime/ingest_index_cli.py +4 -2
- package/runtime/codex/egregore_runtime/investigation.py +792 -0
- package/runtime/codex/egregore_runtime/investigation_contracts.py +104 -0
- package/runtime/codex/egregore_runtime/investigation_guidance.py +51 -0
- package/runtime/codex/egregore_runtime/issue_cli.py +66 -0
- package/runtime/codex/egregore_runtime/issue_markers.py +50 -0
- package/runtime/codex/egregore_runtime/issue_reporting.py +224 -0
- package/runtime/codex/egregore_runtime/observe.py +41 -6
- package/runtime/codex/egregore_runtime/operation_cli.py +76 -0
- package/runtime/codex/egregore_runtime/operation_observations.py +208 -0
- package/runtime/codex/egregore_runtime/private_result.py +147 -0
- package/runtime/codex/egregore_runtime/research_ingest_cli.py +3 -1
- package/runtime/codex/egregore_runtime/runtime.py +38 -1
- package/runtime/codex/egregore_runtime/scroll_cli.py +1 -1
- package/runtime/codex/egregore_runtime/scrolls.py +172 -28
- package/runtime/codex/egregore_runtime/sync.py +226 -15
- package/runtime/codex/egregore_runtime/sync_health.py +63 -0
- package/runtime/codex/egregore_runtime/telemetry.py +102 -10
- package/runtime/codex/egregore_runtime/threads.py +4 -1
- package/runtime/codex/egregore_runtime/writeback.py +28 -4
- package/runtime/codex/manifest.json +42 -0
- package/runtime/pi/.claude/context/notification-consent.md +17 -2
- package/runtime/pi/.claude/context/retrieval-investigation.md +50 -0
- package/runtime/pi/.codex/skills/activity/SKILL.md +4 -0
- package/runtime/pi/.codex/skills/announce/SKILL.md +7 -0
- package/runtime/pi/.codex/skills/archive/SKILL.md +7 -0
- package/runtime/pi/.codex/skills/checkup/SKILL.md +7 -0
- package/runtime/pi/.codex/skills/dashboard/SKILL.md +4 -0
- package/runtime/pi/.codex/skills/deep-reflect/SKILL.md +8 -0
- package/runtime/pi/.codex/skills/handoff/SKILL.md +8 -3
- package/runtime/pi/.codex/skills/harvest/SKILL.md +8 -0
- package/runtime/pi/.codex/skills/ingest/SKILL.md +4 -0
- package/runtime/pi/.codex/skills/ingest-user-interview/SKILL.md +7 -0
- package/runtime/pi/.codex/skills/invite/SKILL.md +7 -0
- package/runtime/pi/.codex/skills/issue/SKILL.md +102 -0
- package/runtime/pi/.codex/skills/meeting/SKILL.md +8 -0
- package/runtime/pi/.codex/skills/note/SKILL.md +7 -0
- package/runtime/pi/.codex/skills/onboarding/SKILL.md +7 -0
- package/runtime/pi/.codex/skills/quest/SKILL.md +7 -0
- package/runtime/pi/.codex/skills/reflect/SKILL.md +8 -0
- package/runtime/pi/.codex/skills/save/SKILL.md +24 -7
- package/runtime/pi/.codex/skills/the-spiral/SKILL.md +10 -1
- package/runtime/pi/.codex/skills/tutorial/SKILL.md +8 -0
- package/runtime/pi/.codex/skills/view/SKILL.md +8 -0
- package/runtime/pi/.codex/skills/wrap/SKILL.md +8 -0
- package/runtime/pi/.codex/spec-manifest.json +7 -7
- package/runtime/pi/.pi/APPEND_SYSTEM.md +35 -17
- package/runtime/pi/.pi/extensions/egregore.ts +8 -7
- package/runtime/pi/.pi/spec-manifest.json +2 -2
- package/runtime/pi/AGENTS.md +60 -74
- package/runtime/pi/bin/agent.sh +56 -4
- package/runtime/pi/bin/base-branch.sh +62 -0
- package/runtime/pi/bin/codex-render-spec.mjs +32 -64
- package/runtime/pi/bin/codex-session-start.sh +24 -39
- package/runtime/pi/bin/codex-sync-skills.sh +79 -24
- package/runtime/pi/bin/graph-op.sh +73 -3
- package/runtime/pi/bin/lib/generated-trees.sh +27 -0
- package/runtime/pi/bin/lib/git-sync.sh +53 -9
- package/runtime/pi/bin/lib/greeting.sh +41 -71
- package/runtime/pi/bin/lib/health-footer.sh +115 -0
- package/runtime/pi/bin/lib/identity.sh +1 -0
- package/runtime/pi/bin/lib/notices.sh +177 -0
- package/runtime/pi/bin/lib/repo-paths.sh +40 -0
- package/runtime/pi/bin/observe-context.sh +2 -2
- package/runtime/pi/bin/pi-observe-context.mjs +38 -2
- package/runtime/pi/bin/pi-render-spec.mjs +0 -1
- package/runtime/pi/bin/prime-render-spec.mjs +1 -2
- package/runtime/pi/bin/prose-check-tally.sh +102 -0
- package/runtime/pi/bin/prose-check.mjs +554 -0
- package/runtime/pi/bin/prose-rules/announcing-instead-of-doing.md +24 -0
- package/runtime/pi/bin/prose-rules/banned-vocabulary.md +40 -0
- package/runtime/pi/bin/prose-rules/coined-terms.md +20 -0
- package/runtime/pi/bin/prose-rules/exclamation.md +24 -0
- package/runtime/pi/bin/prose-rules/filler-intensifiers.md +24 -0
- package/runtime/pi/bin/prose-rules/hedging-stack.md +26 -0
- package/runtime/pi/bin/prose-rules/mannered-prose.md +24 -0
- package/runtime/pi/bin/prose-rules/not-x-but-y.md +23 -0
- package/runtime/pi/bin/prose-rules/one-name-per-thing.md +20 -0
- package/runtime/pi/bin/prose-rules/passive-enthusiasm.md +25 -0
- package/runtime/pi/bin/prose-rules/process-narration.md +30 -0
- package/runtime/pi/bin/prose-rules/rhetorical-opener.md +23 -0
- package/runtime/pi/bin/prose-rules/self-contained.md +20 -0
- package/runtime/pi/bin/prose-rules/self-praise.md +22 -0
- package/runtime/pi/bin/prose-rules/temporal-handwave.md +27 -0
- package/runtime/pi/bin/pull.sh +272 -0
- package/runtime/pi/bin/qa-inventory.sh +341 -0
- package/runtime/pi/bin/search.sh +104 -58
- package/runtime/pi/bin/telemetry.sh +65 -18
- package/runtime/pi/bin/test-baseline.sh +296 -0
- package/runtime/pi/bin/test-changes.sh +196 -145
- package/runtime/pi/bin/view-render.sh +6 -2
- package/runtime/pi/bin/worktree-create.sh +11 -0
- package/runtime/pi/egregore_runtime/adapters/qmd.py +309 -50
- package/runtime/pi/egregore_runtime/adapters/qmd_cli.py +6 -3
- package/runtime/pi/egregore_runtime/adapters/qmd_scoped.mjs +202 -0
- package/runtime/pi/egregore_runtime/adapters/qmd_scoped.py +137 -0
- package/runtime/pi/egregore_runtime/adapters/qmd_worker.mjs +123 -0
- package/runtime/pi/egregore_runtime/artifacts.py +11 -1
- package/runtime/pi/egregore_runtime/contracts.py +25 -1
- package/runtime/pi/egregore_runtime/eligibility.py +137 -0
- package/runtime/pi/egregore_runtime/episode_binding.py +178 -0
- package/runtime/pi/egregore_runtime/excerpts.py +42 -0
- package/runtime/pi/egregore_runtime/github_issues.py +244 -0
- package/runtime/pi/egregore_runtime/harness_cli.py +545 -402
- package/runtime/pi/egregore_runtime/identity.py +52 -0
- package/runtime/pi/egregore_runtime/ingest_index_cli.py +4 -2
- package/runtime/pi/egregore_runtime/investigation.py +792 -0
- package/runtime/pi/egregore_runtime/investigation_contracts.py +104 -0
- package/runtime/pi/egregore_runtime/investigation_guidance.py +51 -0
- package/runtime/pi/egregore_runtime/issue_cli.py +66 -0
- package/runtime/pi/egregore_runtime/issue_markers.py +50 -0
- package/runtime/pi/egregore_runtime/issue_reporting.py +224 -0
- package/runtime/pi/egregore_runtime/observe.py +41 -6
- package/runtime/pi/egregore_runtime/operation_cli.py +76 -0
- package/runtime/pi/egregore_runtime/operation_observations.py +208 -0
- package/runtime/pi/egregore_runtime/private_result.py +147 -0
- package/runtime/pi/egregore_runtime/research_ingest_cli.py +3 -1
- package/runtime/pi/egregore_runtime/runtime.py +38 -1
- package/runtime/pi/egregore_runtime/scroll_cli.py +1 -1
- package/runtime/pi/egregore_runtime/scrolls.py +172 -28
- package/runtime/pi/egregore_runtime/sync.py +226 -15
- package/runtime/pi/egregore_runtime/sync_health.py +63 -0
- package/runtime/pi/egregore_runtime/telemetry.py +102 -10
- package/runtime/pi/egregore_runtime/threads.py +4 -1
- package/runtime/pi/egregore_runtime/writeback.py +28 -4
- package/runtime/pi/manifest.json +42 -0
- package/runtime/prime/.claude/context/notification-consent.md +17 -2
- package/runtime/prime/.claude/context/retrieval-investigation.md +50 -0
- package/runtime/prime/.codex/skills/activity/SKILL.md +4 -0
- package/runtime/prime/.codex/skills/announce/SKILL.md +7 -0
- package/runtime/prime/.codex/skills/archive/SKILL.md +7 -0
- package/runtime/prime/.codex/skills/checkup/SKILL.md +7 -0
- package/runtime/prime/.codex/skills/dashboard/SKILL.md +4 -0
- package/runtime/prime/.codex/skills/deep-reflect/SKILL.md +8 -0
- package/runtime/prime/.codex/skills/handoff/SKILL.md +8 -3
- package/runtime/prime/.codex/skills/harvest/SKILL.md +8 -0
- package/runtime/prime/.codex/skills/ingest/SKILL.md +4 -0
- package/runtime/prime/.codex/skills/ingest-user-interview/SKILL.md +7 -0
- package/runtime/prime/.codex/skills/invite/SKILL.md +7 -0
- package/runtime/prime/.codex/skills/issue/SKILL.md +102 -0
- package/runtime/prime/.codex/skills/meeting/SKILL.md +8 -0
- package/runtime/prime/.codex/skills/note/SKILL.md +7 -0
- package/runtime/prime/.codex/skills/onboarding/SKILL.md +7 -0
- package/runtime/prime/.codex/skills/quest/SKILL.md +7 -0
- package/runtime/prime/.codex/skills/reflect/SKILL.md +8 -0
- package/runtime/prime/.codex/skills/save/SKILL.md +24 -7
- package/runtime/prime/.codex/skills/the-spiral/SKILL.md +10 -1
- package/runtime/prime/.codex/skills/tutorial/SKILL.md +8 -0
- package/runtime/prime/.codex/skills/view/SKILL.md +8 -0
- package/runtime/prime/.codex/skills/wrap/SKILL.md +8 -0
- package/runtime/prime/.codex/spec-manifest.json +7 -7
- package/runtime/prime/.prime/agent/APPEND_SYSTEM.md +36 -18
- package/runtime/prime/.prime/agent/extensions/egregore.ts +8 -7
- package/runtime/prime/.prime/agent/skills/egregore/src/egregore/__init__.py +14 -2
- package/runtime/prime/.prime/agent/spec-manifest.json +2 -2
- package/runtime/prime/AGENTS.md +60 -74
- package/runtime/prime/bin/agent.sh +56 -4
- package/runtime/prime/bin/base-branch.sh +62 -0
- package/runtime/prime/bin/codex-render-spec.mjs +32 -64
- package/runtime/prime/bin/codex-session-start.sh +24 -39
- package/runtime/prime/bin/codex-sync-skills.sh +79 -24
- package/runtime/prime/bin/graph-op.sh +73 -3
- package/runtime/prime/bin/lib/generated-trees.sh +27 -0
- package/runtime/prime/bin/lib/git-sync.sh +53 -9
- package/runtime/prime/bin/lib/greeting.sh +41 -71
- package/runtime/prime/bin/lib/health-footer.sh +115 -0
- package/runtime/prime/bin/lib/identity.sh +1 -0
- package/runtime/prime/bin/lib/notices.sh +177 -0
- package/runtime/prime/bin/lib/repo-paths.sh +40 -0
- package/runtime/prime/bin/observe-context.sh +2 -2
- package/runtime/prime/bin/pi-observe-context.mjs +38 -2
- package/runtime/prime/bin/pi-render-spec.mjs +0 -1
- package/runtime/prime/bin/prime-render-spec.mjs +1 -2
- package/runtime/prime/bin/prose-check-tally.sh +102 -0
- package/runtime/prime/bin/prose-check.mjs +554 -0
- package/runtime/prime/bin/prose-rules/announcing-instead-of-doing.md +24 -0
- package/runtime/prime/bin/prose-rules/banned-vocabulary.md +40 -0
- package/runtime/prime/bin/prose-rules/coined-terms.md +20 -0
- package/runtime/prime/bin/prose-rules/exclamation.md +24 -0
- package/runtime/prime/bin/prose-rules/filler-intensifiers.md +24 -0
- package/runtime/prime/bin/prose-rules/hedging-stack.md +26 -0
- package/runtime/prime/bin/prose-rules/mannered-prose.md +24 -0
- package/runtime/prime/bin/prose-rules/not-x-but-y.md +23 -0
- package/runtime/prime/bin/prose-rules/one-name-per-thing.md +20 -0
- package/runtime/prime/bin/prose-rules/passive-enthusiasm.md +25 -0
- package/runtime/prime/bin/prose-rules/process-narration.md +30 -0
- package/runtime/prime/bin/prose-rules/rhetorical-opener.md +23 -0
- package/runtime/prime/bin/prose-rules/self-contained.md +20 -0
- package/runtime/prime/bin/prose-rules/self-praise.md +22 -0
- package/runtime/prime/bin/prose-rules/temporal-handwave.md +27 -0
- package/runtime/prime/bin/pull.sh +272 -0
- package/runtime/prime/bin/qa-inventory.sh +341 -0
- package/runtime/prime/bin/search.sh +104 -58
- package/runtime/prime/bin/telemetry.sh +65 -18
- package/runtime/prime/bin/test-baseline.sh +296 -0
- package/runtime/prime/bin/test-changes.sh +196 -145
- package/runtime/prime/bin/view-render.sh +6 -2
- package/runtime/prime/bin/worktree-create.sh +11 -0
- package/runtime/prime/egregore_runtime/adapters/qmd.py +309 -50
- package/runtime/prime/egregore_runtime/adapters/qmd_cli.py +6 -3
- package/runtime/prime/egregore_runtime/adapters/qmd_scoped.mjs +202 -0
- package/runtime/prime/egregore_runtime/adapters/qmd_scoped.py +137 -0
- package/runtime/prime/egregore_runtime/adapters/qmd_worker.mjs +123 -0
- package/runtime/prime/egregore_runtime/artifacts.py +11 -1
- package/runtime/prime/egregore_runtime/contracts.py +25 -1
- package/runtime/prime/egregore_runtime/eligibility.py +137 -0
- package/runtime/prime/egregore_runtime/episode_binding.py +178 -0
- package/runtime/prime/egregore_runtime/excerpts.py +42 -0
- package/runtime/prime/egregore_runtime/github_issues.py +244 -0
- package/runtime/prime/egregore_runtime/harness_cli.py +545 -402
- package/runtime/prime/egregore_runtime/identity.py +52 -0
- package/runtime/prime/egregore_runtime/ingest_index_cli.py +4 -2
- package/runtime/prime/egregore_runtime/investigation.py +792 -0
- package/runtime/prime/egregore_runtime/investigation_contracts.py +104 -0
- package/runtime/prime/egregore_runtime/investigation_guidance.py +51 -0
- package/runtime/prime/egregore_runtime/issue_cli.py +66 -0
- package/runtime/prime/egregore_runtime/issue_markers.py +50 -0
- package/runtime/prime/egregore_runtime/issue_reporting.py +224 -0
- package/runtime/prime/egregore_runtime/observe.py +41 -6
- package/runtime/prime/egregore_runtime/operation_cli.py +76 -0
- package/runtime/prime/egregore_runtime/operation_observations.py +208 -0
- package/runtime/prime/egregore_runtime/private_result.py +147 -0
- package/runtime/prime/egregore_runtime/research_ingest_cli.py +3 -1
- package/runtime/prime/egregore_runtime/runtime.py +38 -1
- package/runtime/prime/egregore_runtime/scroll_cli.py +1 -1
- package/runtime/prime/egregore_runtime/scrolls.py +172 -28
- package/runtime/prime/egregore_runtime/sync.py +226 -15
- package/runtime/prime/egregore_runtime/sync_health.py +63 -0
- package/runtime/prime/egregore_runtime/telemetry.py +102 -10
- package/runtime/prime/egregore_runtime/threads.py +4 -1
- package/runtime/prime/egregore_runtime/writeback.py +28 -4
- package/runtime/prime/manifest.json +42 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// egregore-launcher-version: 0.21.0-runtime-mvp.
|
|
2
|
+
// egregore-launcher-version: 0.21.0-runtime-mvp.28
|
|
3
3
|
//
|
|
4
4
|
// egregore — launch and browse Egregore instances from your terminal.
|
|
5
5
|
// Installed by create-egregore. Reads ~/.egregore/instances.json.
|
|
@@ -35,7 +35,7 @@ const crypto = require("node:crypto");
|
|
|
35
35
|
const { spawnSync, spawn } = require("node:child_process");
|
|
36
36
|
const readline = require("node:readline");
|
|
37
37
|
|
|
38
|
-
const VERSION = "0.21.0-runtime-mvp.
|
|
38
|
+
const VERSION = "0.21.0-runtime-mvp.28";
|
|
39
39
|
const REGISTRY = path.join(os.homedir(), ".egregore", "instances.json");
|
|
40
40
|
const DEFAULT_FILE = path.join(os.homedir(), ".egregore", "default");
|
|
41
41
|
const UPDATE_CACHE_FILE = path.join(os.homedir(), ".egregore", "update-check.json");
|
|
@@ -753,72 +753,120 @@ async function renderCodexStartupCard(egregoreDir) {
|
|
|
753
753
|
return false;
|
|
754
754
|
}
|
|
755
755
|
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
"
|
|
759
|
-
|
|
760
|
-
"",
|
|
761
|
-
"
|
|
762
|
-
"
|
|
763
|
-
"
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
"
|
|
767
|
-
"
|
|
768
|
-
"",
|
|
769
|
-
"
|
|
770
|
-
"
|
|
771
|
-
|
|
772
|
-
|
|
756
|
+
const CORE_SUPPORT_PATHS = {
|
|
757
|
+
codex: [
|
|
758
|
+
"bin/codex-session-start.sh",
|
|
759
|
+
"bin/codex-install-skills.sh",
|
|
760
|
+
".codex/config.toml",
|
|
761
|
+
".codex/skills",
|
|
762
|
+
".codex/hooks.json",
|
|
763
|
+
".codex/hooks",
|
|
764
|
+
],
|
|
765
|
+
pi: [
|
|
766
|
+
"bin/pi-session-start.sh",
|
|
767
|
+
".pi/APPEND_SYSTEM.md",
|
|
768
|
+
".pi/settings.json",
|
|
769
|
+
".pi/extensions/egregore.ts",
|
|
770
|
+
".codex/skills",
|
|
771
|
+
],
|
|
772
|
+
prime: [
|
|
773
|
+
"bin/prime-session-start.sh",
|
|
774
|
+
".prime/agent/APPEND_SYSTEM.md",
|
|
775
|
+
".prime/agent/settings.json",
|
|
776
|
+
".prime/agent/extensions/egregore.ts",
|
|
777
|
+
".codex/skills",
|
|
778
|
+
],
|
|
779
|
+
};
|
|
780
|
+
|
|
781
|
+
function missingCorePaths(runtime, egregoreDir) {
|
|
782
|
+
return (CORE_SUPPORT_PATHS[runtime] || []).filter(
|
|
783
|
+
(rel) => !fs.existsSync(path.join(egregoreDir, ...rel.split("/"))),
|
|
784
|
+
);
|
|
773
785
|
}
|
|
774
786
|
|
|
775
787
|
function hasCodexCoreSupport(egregoreDir) {
|
|
776
|
-
return (
|
|
777
|
-
fs.existsSync(path.join(egregoreDir, "bin", "codex-session-start.sh")) &&
|
|
778
|
-
fs.existsSync(path.join(egregoreDir, "bin", "codex-install-skills.sh")) &&
|
|
779
|
-
fs.existsSync(path.join(egregoreDir, ".codex", "config.toml")) &&
|
|
780
|
-
fs.existsSync(path.join(egregoreDir, ".codex", "skills")) &&
|
|
781
|
-
fs.existsSync(path.join(egregoreDir, ".codex", "hooks.json")) &&
|
|
782
|
-
fs.existsSync(path.join(egregoreDir, ".codex", "hooks"))
|
|
783
|
-
);
|
|
788
|
+
return missingCorePaths("codex", egregoreDir).length === 0;
|
|
784
789
|
}
|
|
785
790
|
|
|
786
791
|
function hasPiCoreSupport(egregoreDir) {
|
|
787
|
-
return (
|
|
788
|
-
fs.existsSync(path.join(egregoreDir, "bin", "pi-session-start.sh")) &&
|
|
789
|
-
fs.existsSync(path.join(egregoreDir, ".pi", "APPEND_SYSTEM.md")) &&
|
|
790
|
-
fs.existsSync(path.join(egregoreDir, ".pi", "settings.json")) &&
|
|
791
|
-
fs.existsSync(path.join(egregoreDir, ".pi", "extensions", "egregore.ts")) &&
|
|
792
|
-
fs.existsSync(path.join(egregoreDir, ".codex", "skills"))
|
|
793
|
-
);
|
|
792
|
+
return missingCorePaths("pi", egregoreDir).length === 0;
|
|
794
793
|
}
|
|
795
794
|
|
|
796
|
-
function
|
|
797
|
-
return
|
|
798
|
-
|
|
795
|
+
function hasPrimeCoreSupport(egregoreDir) {
|
|
796
|
+
return missingCorePaths("prime", egregoreDir).length === 0;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
// The repair command is pinned to this launcher's own release. `@latest`
|
|
800
|
+
// once pulled another release channel's files into an instance; the
|
|
801
|
+
// launcher and the files it installs must always be the same version.
|
|
802
|
+
function harnessAddCommand(runtime) {
|
|
803
|
+
return `npx -y ${PUBLIC_NPX_PACKAGE}@${VERSION} --add-harness ${runtimeShort(runtime)}`;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
function harnessSupportMessage(runtime, egregoreDir) {
|
|
807
|
+
const label = runtimeLabel(runtime);
|
|
808
|
+
const missing = missingCorePaths(runtime, egregoreDir);
|
|
809
|
+
const lines = [
|
|
810
|
+
`${label} support is missing from this Egregore checkout.`,
|
|
799
811
|
` path: ${egregoreDir}`,
|
|
812
|
+
];
|
|
813
|
+
if (missing.length > 0) {
|
|
814
|
+
lines.push("", "Missing:");
|
|
815
|
+
for (const rel of missing) lines.push(` ${rel}`);
|
|
816
|
+
}
|
|
817
|
+
lines.push(
|
|
800
818
|
"",
|
|
801
|
-
|
|
802
|
-
|
|
819
|
+
`Add ${label} support to this instance (missing files only, nothing overwritten):`,
|
|
820
|
+
` cd ${egregoreDir}`,
|
|
821
|
+
` ${harnessAddCommand(runtime)}`,
|
|
822
|
+
"Then rerun egregore.",
|
|
823
|
+
);
|
|
824
|
+
if (runtime === "codex") {
|
|
825
|
+
lines.push("Egregore workflows appear as slash commands. In Codex, invoke them with the matching $skill token or ask in natural language.");
|
|
826
|
+
}
|
|
827
|
+
return lines.join("\n");
|
|
803
828
|
}
|
|
804
829
|
|
|
805
|
-
function
|
|
806
|
-
return (
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
fs.existsSync(path.join(egregoreDir, ".codex", "skills"))
|
|
812
|
-
);
|
|
830
|
+
function codexSupportMessage(egregoreDir) {
|
|
831
|
+
return harnessSupportMessage("codex", egregoreDir);
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
function piSupportMessage(egregoreDir) {
|
|
835
|
+
return harnessSupportMessage("pi", egregoreDir);
|
|
813
836
|
}
|
|
814
837
|
|
|
815
838
|
function primeSupportMessage(egregoreDir) {
|
|
816
|
-
return
|
|
817
|
-
|
|
818
|
-
|
|
839
|
+
return harnessSupportMessage("prime", egregoreDir);
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
// A launch that fails the support check offers to add exactly that harness
|
|
843
|
+
// to exactly this instance, using this launcher's own release. Without a
|
|
844
|
+
// terminal to ask, print the command and stop; never install unattended.
|
|
845
|
+
async function ensureHarnessSupport(inst, runtime) {
|
|
846
|
+
if (missingCorePaths(runtime, inst.path).length === 0) return;
|
|
847
|
+
const message = harnessSupportMessage(runtime, inst.path);
|
|
848
|
+
if (!canPrompt()) die(message);
|
|
849
|
+
const label = runtimeLabel(runtime);
|
|
850
|
+
const name = inst.name || inst.slug || path.basename(inst.path);
|
|
851
|
+
process.stdout.write([
|
|
819
852
|
"",
|
|
820
|
-
|
|
821
|
-
|
|
853
|
+
` ${BOLD}${label} support is missing from ${name}.${RESET}`,
|
|
854
|
+
` ${DIM}Missing: ${missingCorePaths(runtime, inst.path).join(", ")}${RESET}`,
|
|
855
|
+
` ${DIM}Egregore can add it now. Only missing files are written; nothing is overwritten:${RESET}`,
|
|
856
|
+
` ${harnessAddCommand(runtime)}`,
|
|
857
|
+
"",
|
|
858
|
+
].join("\n"));
|
|
859
|
+
const yes = await confirmLine(`Add ${label} support to ${name} now?`);
|
|
860
|
+
if (!yes) die(message);
|
|
861
|
+
const result = spawnSync(
|
|
862
|
+
"npx",
|
|
863
|
+
["-y", `${PUBLIC_NPX_PACKAGE}@${VERSION}`, "--add-harness", runtimeShort(runtime)],
|
|
864
|
+
{ cwd: inst.path, stdio: "inherit", env: process.env, timeout: 3 * 60 * 1000 },
|
|
865
|
+
);
|
|
866
|
+
if (result.error || result.status !== 0 || missingCorePaths(runtime, inst.path).length > 0) {
|
|
867
|
+
die(`${label} support could not be added automatically.\n\n${harnessSupportMessage(runtime, inst.path)}`);
|
|
868
|
+
}
|
|
869
|
+
process.stdout.write(` ${GREEN}✓${RESET} ${label} support added to ${name}\n\n`);
|
|
822
870
|
}
|
|
823
871
|
|
|
824
872
|
// Minimal y/N line prompt for pre-launch decisions (the TUI select machinery
|
|
@@ -873,7 +921,7 @@ function primeAuthHint() {
|
|
|
873
921
|
|
|
874
922
|
function installCodexSkills(egregoreDir) {
|
|
875
923
|
const script = path.join(egregoreDir, "bin", "codex-install-skills.sh");
|
|
876
|
-
if (!fs.existsSync(script)) return false;
|
|
924
|
+
if (!fs.existsSync(script)) return { ok: false, stderr: `missing ${script}` };
|
|
877
925
|
try {
|
|
878
926
|
const result = spawnSync("bash", [script], {
|
|
879
927
|
cwd: egregoreDir,
|
|
@@ -881,9 +929,9 @@ function installCodexSkills(egregoreDir) {
|
|
|
881
929
|
encoding: "utf-8",
|
|
882
930
|
maxBuffer: 1024 * 1024,
|
|
883
931
|
});
|
|
884
|
-
return result.status === 0;
|
|
885
|
-
} catch {
|
|
886
|
-
return false;
|
|
932
|
+
return { ok: result.status === 0, stderr: (result.stderr || "").trim() };
|
|
933
|
+
} catch (err) {
|
|
934
|
+
return { ok: false, stderr: String(err && err.message ? err.message : err) };
|
|
887
935
|
}
|
|
888
936
|
}
|
|
889
937
|
|
|
@@ -966,29 +1014,31 @@ async function launch(inst, runtimeOverride) {
|
|
|
966
1014
|
}
|
|
967
1015
|
}
|
|
968
1016
|
if (runtime === "codex") {
|
|
969
|
-
// Launching never changes an instance's runtime or release channel.
|
|
970
|
-
|
|
971
|
-
|
|
1017
|
+
// Launching never changes an instance's runtime or release channel. A
|
|
1018
|
+
// missing harness is added only with the user's consent, one harness
|
|
1019
|
+
// into this one instance, at this launcher's own version.
|
|
1020
|
+
await ensureHarnessSupport(inst, runtime);
|
|
1021
|
+
const skills = installCodexSkills(inst.path);
|
|
1022
|
+
if (!skills.ok) {
|
|
1023
|
+
die(`Codex skill setup failed in ${inst.path} (bin/codex-install-skills.sh):\n${skills.stderr || " (no error output)"}`);
|
|
1024
|
+
}
|
|
972
1025
|
const cardRendered = await renderCodexStartupCard(inst.path);
|
|
973
|
-
if (!
|
|
974
|
-
die(
|
|
1026
|
+
if (!cardRendered) {
|
|
1027
|
+
die(`Codex startup card failed in ${inst.path} (bin/codex-session-start.sh exited non-zero; its output is above).`);
|
|
975
1028
|
}
|
|
976
1029
|
} else if (runtime === "pi") {
|
|
977
|
-
|
|
978
|
-
die(piSupportMessage(inst.path));
|
|
979
|
-
}
|
|
1030
|
+
await ensureHarnessSupport(inst, runtime);
|
|
980
1031
|
}
|
|
981
1032
|
let launchArgs = null;
|
|
982
1033
|
if (runtime === "prime") {
|
|
1034
|
+
await ensureHarnessSupport(inst, runtime);
|
|
983
1035
|
// Cover the gap between choosing the harness and Prime's first paint:
|
|
984
|
-
// the loader runs through the launcher-side pre-flight (
|
|
985
|
-
//
|
|
986
|
-
//
|
|
1036
|
+
// the loader runs through the launcher-side pre-flight (the trust-flag
|
|
1037
|
+
// probe, which shells out to the binary), then a single handoff line
|
|
1038
|
+
// explains the remaining in-harness startup.
|
|
987
1039
|
const stopLoader = startSpinner("Starting Prime Agent");
|
|
988
|
-
|
|
989
|
-
launchArgs = coreOk ? runtimeLaunchArgs(runtime, inst.path) : null;
|
|
1040
|
+
launchArgs = runtimeLaunchArgs(runtime, inst.path);
|
|
990
1041
|
stopLoader();
|
|
991
|
-
if (!coreOk) die(primeSupportMessage(inst.path));
|
|
992
1042
|
primeAuthHint();
|
|
993
1043
|
process.stdout.write(` ${CYAN}◆${RESET} ${BOLD}Prime Agent starting${RESET}${DIM} — the Egregore greeting loads inside in a few seconds${RESET}\n`);
|
|
994
1044
|
}
|
package/bin/cli.js
CHANGED
|
@@ -91,6 +91,32 @@ function detectCwdEgregore(cwd) {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
// Resolve which instance `--add-harness` writes into. Explicit `--instance`
|
|
95
|
+
// wins; otherwise the current directory when it is an instance; otherwise the
|
|
96
|
+
// only registered instance. Several registered instances and no explicit
|
|
97
|
+
// choice is an error — this command must never fan out.
|
|
98
|
+
function resolveAddHarnessTarget(explicitPath) {
|
|
99
|
+
const isInstance = (dir) => dir && fs.existsSync(path.join(dir, "egregore.json"));
|
|
100
|
+
if (explicitPath) {
|
|
101
|
+
const dir = path.resolve(explicitPath);
|
|
102
|
+
if (isInstance(dir)) return dir;
|
|
103
|
+
ui.error(`Not an Egregore instance: ${dir} (no egregore.json).`);
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
let cwd = null;
|
|
107
|
+
try { cwd = process.cwd(); } catch {}
|
|
108
|
+
if (isInstance(cwd)) return cwd;
|
|
109
|
+
const registered = readLocalInstances().filter((inst) => isInstance(inst.path));
|
|
110
|
+
if (registered.length === 1) return path.resolve(registered[0].path);
|
|
111
|
+
if (registered.length === 0) {
|
|
112
|
+
ui.error("No Egregore instance found. Run this inside the instance directory, or pass --instance <path>.");
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
ui.error("Several Egregore instances are registered. Pass --instance <path> to choose one:");
|
|
116
|
+
for (const inst of registered) ui.info(` ${inst.path}`);
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
|
|
94
120
|
function binaryOnPath(bin) {
|
|
95
121
|
return commandExists(bin);
|
|
96
122
|
}
|
|
@@ -211,6 +237,14 @@ function parseArgs(argv) {
|
|
|
211
237
|
args.refreshLauncher = true;
|
|
212
238
|
} else if (argv[i] === "--refresh-connect") {
|
|
213
239
|
args.refreshConnect = true;
|
|
240
|
+
} else if (argv[i] === "--add-harness" && argv[i + 1]) {
|
|
241
|
+
args.addHarness = argv[++i];
|
|
242
|
+
} else if (argv[i].startsWith("--add-harness=")) {
|
|
243
|
+
args.addHarness = argv[i].split("=")[1];
|
|
244
|
+
} else if (argv[i] === "--instance" && argv[i + 1]) {
|
|
245
|
+
args.instance = argv[++i];
|
|
246
|
+
} else if (argv[i].startsWith("--instance=")) {
|
|
247
|
+
args.instance = argv[i].split("=")[1];
|
|
214
248
|
} else if (argv[i] === "--codex") {
|
|
215
249
|
args.runtime = "codex";
|
|
216
250
|
} else if (argv[i] === "--pi") {
|
|
@@ -386,7 +420,9 @@ function showHelp() {
|
|
|
386
420
|
ui.info(" --force Skip the in-repo detection check");
|
|
387
421
|
ui.info(" --no-autolaunch Don't launch the harness at the end (for CI)");
|
|
388
422
|
ui.info(" --no-screens Skip the full-screen welcome/ready bookends");
|
|
389
|
-
ui.info(" --refresh-launcher Refresh the Egregore CLI
|
|
423
|
+
ui.info(" --refresh-launcher Refresh only the global Egregore CLI, then exit");
|
|
424
|
+
ui.info(" --add-harness <h> Add codex, pi, or prime support to one existing instance (missing files only)");
|
|
425
|
+
ui.info(" --instance <path> Instance for --add-harness (default: cwd, or the only registered instance)");
|
|
390
426
|
ui.info(" -h, --help Show this help");
|
|
391
427
|
ui.info("");
|
|
392
428
|
}
|
|
@@ -433,6 +469,39 @@ async function main() {
|
|
|
433
469
|
}
|
|
434
470
|
}
|
|
435
471
|
|
|
472
|
+
if (args.addHarness) {
|
|
473
|
+
// Explicit, instance-scoped harness addition. This is the only path that
|
|
474
|
+
// writes harness files into an existing instance from the global CLI: one
|
|
475
|
+
// harness, one instance, missing files only. The launcher invokes it with
|
|
476
|
+
// its own pinned version when a launch fails the support check.
|
|
477
|
+
const { addHarnessRuntime, harnessLabel, normalizeHarness } = require("../lib/harness-add");
|
|
478
|
+
const harness = normalizeHarness(args.addHarness);
|
|
479
|
+
if (!harness) {
|
|
480
|
+
ui.error(`Unknown harness "${args.addHarness}". Use --add-harness codex, pi, or prime.`);
|
|
481
|
+
process.exit(1);
|
|
482
|
+
}
|
|
483
|
+
const targetDir = resolveAddHarnessTarget(args.instance);
|
|
484
|
+
if (!targetDir) process.exit(1);
|
|
485
|
+
try {
|
|
486
|
+
const summary = addHarnessRuntime(targetDir, harness);
|
|
487
|
+
const label = harnessLabel(harness);
|
|
488
|
+
if (summary.installed.length === 0) {
|
|
489
|
+
ui.success(`${label} support already present in ${targetDir}`);
|
|
490
|
+
} else {
|
|
491
|
+
ui.success(`Added ${label} support to ${targetDir} ${ui.dim(`(${summary.installed.length} files, ${summary.present} kept)`)}`);
|
|
492
|
+
}
|
|
493
|
+
if (!summary.ready) {
|
|
494
|
+
ui.warn(`${label} support is still incomplete in ${targetDir}; an existing file may be a directory or symlink where a file is expected.`);
|
|
495
|
+
process.exit(1);
|
|
496
|
+
}
|
|
497
|
+
ui.info(`Run: egregore --runtime ${harness}`);
|
|
498
|
+
return;
|
|
499
|
+
} catch (err) {
|
|
500
|
+
ui.error(String(err.message || err));
|
|
501
|
+
process.exit(1);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
|
|
436
505
|
if (args.refreshConnect) {
|
|
437
506
|
// Session-start maintenance mode: refresh the Connect overlay for an
|
|
438
507
|
// existing instance. Local instances no-op instantly; network failure is
|
|
@@ -559,75 +628,20 @@ async function main() {
|
|
|
559
628
|
}
|
|
560
629
|
|
|
561
630
|
async function tokenFlow(api, token, ctx) {
|
|
562
|
-
const
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
ui.error(err.message);
|
|
570
|
-
ui.info("");
|
|
571
|
-
ui.info("The token may have expired or already been used.");
|
|
572
|
-
ui.info("Visit egregore.xyz to get a new one, or run without --token:");
|
|
573
|
-
ui.info(" npx -y create-egregore@latest");
|
|
574
|
-
process.exit(1);
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
// Joiner tokens don't include a github_token — try gh CLI first. If gh is
|
|
578
|
-
// installed but logged out, run gh auth login instead of device flow.
|
|
579
|
-
if (!data.github_token || data.needs_cli_auth) {
|
|
580
|
-
const ghAuth = tryGhAuthOrLogin(ui, data.needs_cli_auth ? { mode: "join" } : {});
|
|
581
|
-
if (ghAuth) {
|
|
582
|
-
ui.success(`Using your ${ui.bold("gh")} CLI auth${ghAuth.user ? ` (${ghAuth.user})` : ""}`);
|
|
583
|
-
data.github_token = ghAuth.token;
|
|
584
|
-
} else if (ghCliExists()) {
|
|
585
|
-
ui.error("GitHub CLI auth did not complete.");
|
|
586
|
-
ui.info(`Run ${ui.bold("gh auth login")} and then re-run this command.`);
|
|
587
|
-
process.exit(1);
|
|
588
|
-
} else {
|
|
631
|
+
const { installFromToken } = require("../lib/token-install");
|
|
632
|
+
await installFromToken(api, token, ctx, {
|
|
633
|
+
ui, install, request: ghApi,
|
|
634
|
+
authenticate: async (forceLogin) => {
|
|
635
|
+
const auth = tryGhAuthOrLogin(ui, { mode: "join", requireRepoScope: true, forceLogin });
|
|
636
|
+
if (auth) return auth;
|
|
637
|
+
if (ghCliExists()) return null;
|
|
589
638
|
if (!canUseInteractiveBrowserFlow()) {
|
|
590
639
|
explainNoGhHeadless(ui);
|
|
591
|
-
|
|
592
|
-
}
|
|
593
|
-
ui.info("\nSign in to your GitHub to complete setup.\n");
|
|
594
|
-
try {
|
|
595
|
-
data.github_token = await deviceFlow(ui, data.needs_cli_auth ? { mode: "join" } : {});
|
|
596
|
-
ui.success("Authenticated with GitHub");
|
|
597
|
-
} catch (err) {
|
|
598
|
-
ui.error(`GitHub auth failed: ${err.message}`);
|
|
599
|
-
process.exit(1);
|
|
640
|
+
return null;
|
|
600
641
|
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
// Token-mode setups already have their repo list baked in server-side. If
|
|
605
|
-
// the user's current working repo happens to match a managed-repo name, skip
|
|
606
|
-
// the clone/pull/configure step for it so we don't clobber uncommitted work.
|
|
607
|
-
const skipRepos = new Set();
|
|
608
|
-
if (ctx.prefilledRepo && Array.isArray(data.repos)) {
|
|
609
|
-
for (const r of data.repos) {
|
|
610
|
-
const n = typeof r === "string" ? r : r && r.name;
|
|
611
|
-
if (n && n === ctx.prefilledRepo.name) skipRepos.add(n);
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
try {
|
|
615
|
-
await install(data, ui, ctx.targetDir, {
|
|
616
|
-
skipRepos,
|
|
617
|
-
noAutolaunch: ctx.noAutolaunch,
|
|
618
|
-
noScreens: ctx.noScreens,
|
|
619
|
-
flowVariant: ctx.flowVariant,
|
|
620
|
-
runtime: ctx.runtime,
|
|
621
|
-
});
|
|
622
|
-
if (ctx.prefilledRepo && skipRepos.size === 0) {
|
|
623
|
-
console.log("");
|
|
624
|
-
ui.info(`Tip: add your current repo to managed_repos with:`);
|
|
625
|
-
ui.info(` /add ${ctx.prefilledRepo.toplevel || `../${ctx.prefilledRepo.localName}`}`);
|
|
626
|
-
}
|
|
627
|
-
} catch (err) {
|
|
628
|
-
ui.error(`Install failed: ${err.message}`);
|
|
629
|
-
process.exit(1);
|
|
630
|
-
}
|
|
642
|
+
return { token: await deviceFlow(ui, { mode: "join", scope: "repo" }) };
|
|
643
|
+
},
|
|
644
|
+
});
|
|
631
645
|
}
|
|
632
646
|
|
|
633
647
|
async function interactiveFlow(api, ctx) {
|
package/lib/api.js
CHANGED
|
@@ -63,8 +63,12 @@ class EgregoreAPI {
|
|
|
63
63
|
this.base = (baseUrl || DEFAULT_API).replace(/\/$/, "");
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
async claimToken(token) {
|
|
67
|
-
|
|
66
|
+
async claimToken(token, githubToken) {
|
|
67
|
+
// Old APIs reject POST without consuming a one-time setup token. Never
|
|
68
|
+
// silently downgrade an authenticated retry to the legacy GET protocol.
|
|
69
|
+
return request(githubToken ? "POST" : "GET", `${this.base}/api/org/claim/${token}`, {
|
|
70
|
+
headers: githubToken ? { Authorization: `Bearer ${githubToken}` } : {},
|
|
71
|
+
});
|
|
68
72
|
}
|
|
69
73
|
|
|
70
74
|
async getOrgs(githubToken) {
|
package/lib/auth.js
CHANGED
|
@@ -212,7 +212,7 @@ function runGhAuthLogin(ui, opts = {}) {
|
|
|
212
212
|
|
|
213
213
|
function tryGhAuthOrLogin(ui, opts = {}) {
|
|
214
214
|
const existing = tryGhAuth();
|
|
215
|
-
if (existing) return existing;
|
|
215
|
+
if (existing && !opts.forceLogin && !(opts.requireRepoScope && existing.hasRepoScope === false)) return existing;
|
|
216
216
|
if (!ghCliExists()) return null;
|
|
217
217
|
return runGhAuthLogin(ui, opts);
|
|
218
218
|
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Add one harness (Codex, Pi, Prime Agent) to an existing instance.
|
|
4
|
+
//
|
|
5
|
+
// Setup overlays only the harness chosen at install time, so a Claude-only
|
|
6
|
+
// instance has no Codex files. The September 2026 launcher auto-repair fixed
|
|
7
|
+
// that by running the *latest* installer against *every* registered instance,
|
|
8
|
+
// which overwrote and deleted files in instances on another release channel.
|
|
9
|
+
// This module is the scoped replacement:
|
|
10
|
+
//
|
|
11
|
+
// - one harness, one instance, chosen explicitly;
|
|
12
|
+
// - copies only files that are missing from that harness's packaged bundle;
|
|
13
|
+
// - never overwrites, never deletes, never touches another harness;
|
|
14
|
+
// - records what it wrote in its own manifest so nothing else claims
|
|
15
|
+
// ownership of pre-existing files.
|
|
16
|
+
|
|
17
|
+
const fs = require("node:fs");
|
|
18
|
+
const path = require("node:path");
|
|
19
|
+
|
|
20
|
+
const PACKAGE = require("../package.json");
|
|
21
|
+
|
|
22
|
+
const HARNESSES = {
|
|
23
|
+
codex: { label: "Codex", module: "./codex-runtime", bundle: "codex" },
|
|
24
|
+
pi: { label: "Pi", module: "./pi-runtime", bundle: "pi" },
|
|
25
|
+
prime: { label: "Prime Agent", module: "./prime-runtime", bundle: "prime" },
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
function normalizeHarness(name) {
|
|
29
|
+
const value = String(name || "").trim().toLowerCase();
|
|
30
|
+
if (value === "codex") return "codex";
|
|
31
|
+
if (value === "pi") return "pi";
|
|
32
|
+
if (value === "prime" || value === "prime-agent") return "prime";
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function harnessLabel(harness) {
|
|
37
|
+
return (HARNESSES[harness] && HARNESSES[harness].label) || harness;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function bundleDirFor(harness) {
|
|
41
|
+
return path.join(__dirname, "..", "runtime", HARNESSES[harness].bundle);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function listFiles(dir, prefix = "") {
|
|
45
|
+
if (!fs.existsSync(dir)) return [];
|
|
46
|
+
const result = [];
|
|
47
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
48
|
+
const rel = prefix ? path.join(prefix, entry.name) : entry.name;
|
|
49
|
+
const full = path.join(dir, entry.name);
|
|
50
|
+
if (entry.isDirectory()) {
|
|
51
|
+
result.push(...listFiles(full, rel));
|
|
52
|
+
} else if (entry.isFile()) {
|
|
53
|
+
result.push(rel);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return result.sort();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function pathExistsOrSymlink(file) {
|
|
60
|
+
try {
|
|
61
|
+
fs.lstatSync(file);
|
|
62
|
+
return true;
|
|
63
|
+
} catch {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function copyMissingFile(src, dest) {
|
|
69
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
70
|
+
fs.copyFileSync(src, dest);
|
|
71
|
+
try {
|
|
72
|
+
const mode = fs.statSync(src).mode & 0o777;
|
|
73
|
+
fs.chmodSync(dest, mode);
|
|
74
|
+
} catch {}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Required paths come from the harness module so the CLI and the launcher's
|
|
78
|
+
// pre-launch check agree on what "support present" means.
|
|
79
|
+
function requiredPathsFor(harness) {
|
|
80
|
+
const mod = require(HARNESSES[harness].module);
|
|
81
|
+
const checker = mod.hasCodexRuntimeSupport || mod.hasPiRuntimeSupport || mod.hasPrimeRuntimeSupport;
|
|
82
|
+
return { hasSupport: (dir) => Boolean(checker && checker(dir)) };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function manifestPath(egregoreDir, harness) {
|
|
86
|
+
return path.join(egregoreDir, ".egregore", `${harness}-harness-add.json`);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Current Codex discovers project skills via .agents/skills -> ../.codex/skills.
|
|
90
|
+
// Create the link only when nothing is there; never replace a real directory.
|
|
91
|
+
function ensureAgentsSkillsLink(egregoreDir, summary) {
|
|
92
|
+
const agentsDir = path.join(egregoreDir, ".agents");
|
|
93
|
+
const link = path.join(agentsDir, "skills");
|
|
94
|
+
if (pathExistsOrSymlink(link)) return;
|
|
95
|
+
try {
|
|
96
|
+
fs.mkdirSync(agentsDir, { recursive: true });
|
|
97
|
+
fs.symlinkSync(path.join("..", ".codex", "skills"), link);
|
|
98
|
+
summary.installed.push(".agents/skills");
|
|
99
|
+
} catch {}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Copy every file of `harness`'s packaged bundle that is missing from
|
|
104
|
+
* `egregoreDir`. Existing files are left untouched regardless of content.
|
|
105
|
+
*
|
|
106
|
+
* Returns { harness, installed: [rel...], present: n, ready: bool }.
|
|
107
|
+
*/
|
|
108
|
+
function addHarnessRuntime(egregoreDir, harnessName) {
|
|
109
|
+
const harness = normalizeHarness(harnessName);
|
|
110
|
+
if (!harness) {
|
|
111
|
+
throw new Error(`Unknown harness "${harnessName}". Expected codex, pi, or prime.`);
|
|
112
|
+
}
|
|
113
|
+
const bundleDir = bundleDirFor(harness);
|
|
114
|
+
if (!fs.existsSync(bundleDir)) {
|
|
115
|
+
throw new Error(`This create-egregore release ships no ${harnessLabel(harness)} bundle (${bundleDir}).`);
|
|
116
|
+
}
|
|
117
|
+
if (!fs.existsSync(path.join(egregoreDir, "egregore.json"))) {
|
|
118
|
+
throw new Error(`Not an Egregore instance: ${egregoreDir} (no egregore.json).`);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const summary = { harness, installed: [], present: 0, ready: false };
|
|
122
|
+
for (const rel of listFiles(bundleDir)) {
|
|
123
|
+
if (rel === "manifest.json") continue;
|
|
124
|
+
const dest = path.join(egregoreDir, rel);
|
|
125
|
+
if (pathExistsOrSymlink(dest)) {
|
|
126
|
+
summary.present += 1;
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
copyMissingFile(path.join(bundleDir, rel), dest);
|
|
130
|
+
summary.installed.push(rel);
|
|
131
|
+
}
|
|
132
|
+
if (harness === "codex") ensureAgentsSkillsLink(egregoreDir, summary);
|
|
133
|
+
|
|
134
|
+
summary.ready = requiredPathsFor(harness).hasSupport(egregoreDir);
|
|
135
|
+
|
|
136
|
+
if (summary.installed.length > 0) {
|
|
137
|
+
const file = manifestPath(egregoreDir, harness);
|
|
138
|
+
const previous = (() => {
|
|
139
|
+
try { return JSON.parse(fs.readFileSync(file, "utf-8")); } catch { return { files: [] }; }
|
|
140
|
+
})();
|
|
141
|
+
const files = Array.from(new Set([...(previous.files || []), ...summary.installed])).sort();
|
|
142
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
143
|
+
fs.writeFileSync(file, JSON.stringify({
|
|
144
|
+
package: PACKAGE.name,
|
|
145
|
+
version: PACKAGE.version,
|
|
146
|
+
harness,
|
|
147
|
+
addedAt: new Date().toISOString(),
|
|
148
|
+
files,
|
|
149
|
+
}, null, 2) + "\n");
|
|
150
|
+
}
|
|
151
|
+
return summary;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
module.exports = {
|
|
155
|
+
HARNESSES,
|
|
156
|
+
addHarnessRuntime,
|
|
157
|
+
harnessLabel,
|
|
158
|
+
normalizeHarness,
|
|
159
|
+
};
|