create-egregore 0.21.0-runtime-mvp.27 → 0.21.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/assets/egregore-launcher.js +288 -148
- package/bin/cli.js +70 -1
- package/lib/api.js +2 -2
- package/lib/claude-runtime.js +25 -46
- package/lib/codex-runtime.js +6 -1
- package/lib/harness-add.js +159 -0
- package/lib/local.js +37 -95
- package/lib/pi-runtime.js +6 -1
- package/lib/prime-runtime.js +6 -1
- package/lib/runtime-git-excludes.js +95 -0
- package/lib/setup.js +89 -66
- package/lib/ui.js +91 -64
- package/package.json +6 -4
- package/runtime/claude/.claude/context/notification-consent.md +17 -2
- package/runtime/claude/.claude/context/retrieval-investigation.md +57 -0
- package/runtime/claude/.claude/context/telemetry.md +73 -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/hooks/search-hint.sh +11 -0
- package/runtime/claude/.claude/rules/voice-bedrock.md +20 -0
- package/runtime/claude/.claude/settings.json +9 -0
- package/runtime/claude/.claude/skills/announce/SKILL.md +33 -12
- package/runtime/claude/.claude/skills/archive/SKILL.md +7 -6
- package/runtime/claude/.claude/skills/branch/SKILL.md +35 -28
- package/runtime/claude/.claude/skills/checkup/SKILL.md +8 -11
- package/runtime/claude/.claude/skills/commit/SKILL.md +11 -7
- package/runtime/claude/.claude/skills/contribute/SKILL.md +108 -62
- package/runtime/claude/.claude/skills/create-skill/SKILL.md +19 -8
- package/runtime/claude/.claude/skills/dashboard/SKILL.md +3 -3
- package/runtime/claude/.claude/skills/deep-reflect/REPORT.md +6 -6
- package/runtime/claude/.claude/skills/deep-reflect/ROLES.md +2 -2
- package/runtime/claude/.claude/skills/deep-reflect/SKILL.md +26 -15
- package/runtime/claude/.claude/skills/delete-user/SKILL.md +39 -44
- package/runtime/claude/.claude/skills/emissary/SKILL.md +36 -26
- package/runtime/claude/.claude/skills/env/SKILL.md +161 -0
- package/runtime/claude/.claude/skills/handoff/SKILL.md +16 -6
- package/runtime/claude/.claude/skills/harvest/AUDIT.md +4 -4
- package/runtime/claude/.claude/skills/harvest/PROCESS.md +7 -6
- package/runtime/claude/.claude/skills/harvest/SKILL.md +8 -6
- package/runtime/claude/.claude/skills/ingest/SKILL.md +25 -11
- package/runtime/claude/.claude/skills/ingest-corpus/SKILL.md +9 -7
- package/runtime/claude/.claude/skills/ingest-user-interview/SKILL.md +6 -3
- package/runtime/claude/.claude/skills/invite/SKILL.md +36 -5
- package/runtime/claude/.claude/skills/issue/SKILL.md +257 -11
- package/runtime/claude/.claude/skills/me/SKILL.md +2 -2
- package/runtime/claude/.claude/skills/meeting/SKILL.md +16 -4
- package/runtime/claude/.claude/skills/note/SKILL.md +6 -4
- package/runtime/claude/.claude/skills/notion-connect/SKILL.md +2 -2
- package/runtime/claude/.claude/skills/onboarding/SKILL.md +23 -5
- 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/reflect/SKILL.md +9 -7
- package/runtime/claude/.claude/skills/review-pr/SKILL.md +43 -16
- package/runtime/claude/.claude/skills/save/SKILL.md +48 -8
- package/runtime/claude/.claude/skills/slack-connect/SKILL.md +63 -16
- package/runtime/claude/.claude/skills/summon/SKILL.md +44 -44
- package/runtime/claude/.claude/skills/sync-repos/SKILL.md +37 -14
- package/runtime/claude/.claude/skills/teams-connect/SKILL.md +82 -28
- package/runtime/claude/.claude/skills/telegram-connect/SKILL.md +20 -3
- package/runtime/claude/.claude/skills/telemetry/SKILL.md +3 -1
- package/runtime/claude/.claude/skills/test/SKILL.md +3 -3
- package/runtime/claude/.claude/skills/tui-design/SKILL.md +4 -4
- package/runtime/claude/.claude/skills/tutorial/SKILL.md +6 -5
- package/runtime/claude/.claude/skills/update/SKILL.md +116 -68
- package/runtime/claude/.claude/skills/view/SKILL.md +19 -11
- package/runtime/claude/.claude/skills/visual-explain/SKILL.md +1 -1
- package/runtime/claude/.claude/skills/wrap/SKILL.md +11 -6
- package/runtime/claude/CLAUDE.md +61 -31
- package/runtime/claude/bin/activity-action.sh +1 -1
- package/runtime/claude/bin/activity-data.sh +1 -1
- package/runtime/claude/bin/agent.sh +132 -29
- package/runtime/claude/bin/api-call.sh +181 -0
- package/runtime/claude/bin/artifact-register.sh +62 -6
- package/runtime/claude/bin/artifact-writeback.sh +28 -3
- package/runtime/claude/bin/artifacts.sh +1 -1
- package/runtime/claude/bin/attendant.sh +1 -1
- package/runtime/claude/bin/base-branch.sh +62 -0
- package/runtime/claude/bin/codex-render-spec.mjs +45 -73
- package/runtime/claude/bin/codex-session-start.sh +30 -39
- package/runtime/claude/bin/codex-skill-render.mjs +15 -6
- package/runtime/claude/bin/codex-sync-skills.sh +85 -26
- package/runtime/claude/bin/config-get.sh +65 -0
- package/runtime/claude/bin/contribute-guard.sh +70 -0
- package/runtime/claude/bin/dashboard-data.sh +1 -1
- package/runtime/claude/bin/gh-run.sh +25 -0
- package/runtime/claude/bin/graph-op.sh +302 -5
- package/runtime/claude/bin/graph-projection.sh +1 -1
- package/runtime/claude/bin/graph-wal.sh +2 -2
- package/runtime/claude/bin/graph.sh +1 -1
- package/runtime/claude/bin/handoff-lifecycle.sh +2 -2
- package/runtime/claude/bin/handoff-preview.sh +7 -3
- package/runtime/claude/bin/handoff-run.sh +1 -1
- package/runtime/claude/bin/hosting-ops.sh +248 -0
- package/runtime/claude/bin/index-handoff.sh +3 -3
- package/runtime/claude/bin/ingest-item.sh +1 -1
- package/runtime/claude/bin/ingest.sh +3 -3
- package/runtime/claude/bin/invite.sh +1 -0
- package/runtime/claude/bin/issue.sh +1 -1
- package/runtime/claude/bin/knowledge.sh +1 -1
- package/runtime/claude/bin/lib/config.sh +4 -8
- package/runtime/claude/bin/lib/dashboard-artifact.sh +1 -1
- package/runtime/claude/bin/lib/framework-update.sh +41 -0
- package/runtime/claude/bin/lib/generated-trees.sh +27 -0
- package/runtime/claude/bin/lib/git-sync.sh +71 -20
- package/runtime/claude/bin/lib/greeting.sh +45 -72
- package/runtime/claude/bin/lib/health-footer.sh +115 -0
- package/runtime/claude/bin/lib/hosted-ref-id.sh +108 -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/lib/runtime-owned.sh +52 -16
- package/runtime/claude/bin/lib/scratch.sh +26 -0
- package/runtime/claude/bin/lib/secret_entry.py +1013 -0
- package/runtime/claude/bin/notification.sh +1 -1
- package/runtime/claude/bin/notify.sh +134 -14
- package/runtime/claude/bin/observe-context.sh +3 -3
- package/runtime/claude/bin/onboarding.sh +1 -0
- package/runtime/claude/bin/person.sh +9 -4
- 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/harness-tool-names.md +36 -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/publish-artifact.sh +52 -4
- package/runtime/claude/bin/publish-references.sh +27 -8
- package/runtime/claude/bin/pull.sh +272 -0
- package/runtime/claude/bin/qa-gate.sh +205 -0
- package/runtime/claude/bin/qa-inventory.sh +341 -0
- package/runtime/claude/bin/quest.sh +1 -1
- package/runtime/claude/bin/question.sh +1 -1
- package/runtime/claude/bin/research-ingest.sh +1 -1
- package/runtime/claude/bin/runtime-identity.sh +3 -3
- package/runtime/claude/bin/runtime-upgrade.sh +5 -3
- package/runtime/claude/bin/scratch-sweep.sh +29 -0
- package/runtime/claude/bin/scroll.sh +1 -1
- package/runtime/claude/bin/search.sh +110 -64
- package/runtime/claude/bin/secret-entry.py +6 -0
- package/runtime/claude/bin/session-autosave.sh +1 -1
- package/runtime/claude/bin/session-log.sh +7 -2
- package/runtime/claude/bin/session-start.sh +5 -1
- package/runtime/claude/bin/settings.sh +1 -1
- package/runtime/claude/bin/telemetry.sh +65 -18
- package/runtime/claude/bin/test-baseline.sh +440 -0
- package/runtime/claude/bin/test-changes.sh +196 -145
- package/runtime/claude/bin/thread.sh +1 -1
- package/runtime/claude/bin/todo.sh +1 -1
- package/runtime/claude/bin/update-framework.sh +24 -0
- package/runtime/claude/bin/view-render.sh +26 -2
- package/runtime/claude/bin/worktree-create.sh +11 -0
- package/runtime/claude/bin/worktree.sh +1 -1
- package/runtime/claude/docs/credential-entry.md +286 -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 +132 -19
- package/runtime/claude/egregore_runtime/contracts.py +43 -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 +332 -0
- package/runtime/claude/egregore_runtime/graph.py +15 -6
- package/runtime/claude/egregore_runtime/harness_cli.py +626 -413
- package/runtime/claude/egregore_runtime/identity.py +160 -8
- package/runtime/claude/egregore_runtime/identity_transfer.py +288 -0
- package/runtime/claude/egregore_runtime/ingest_cli.py +4 -6
- 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 +58 -0
- package/runtime/claude/egregore_runtime/issue_cli.py +97 -0
- package/runtime/claude/egregore_runtime/issue_duplicates.py +116 -0
- package/runtime/claude/egregore_runtime/issue_markers.py +50 -0
- package/runtime/claude/egregore_runtime/issue_readiness.py +231 -0
- package/runtime/claude/egregore_runtime/issue_reporting.py +224 -0
- package/runtime/claude/egregore_runtime/issue_triage.py +331 -0
- package/runtime/claude/egregore_runtime/issue_triage_service.py +124 -0
- package/runtime/claude/egregore_runtime/knowledge_cli.py +4 -3
- package/runtime/claude/egregore_runtime/notification_cli.py +66 -8
- 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/questions.py +1 -0
- package/runtime/claude/egregore_runtime/research_ingest_cli.py +7 -5
- package/runtime/claude/egregore_runtime/runtime.py +61 -3
- package/runtime/claude/egregore_runtime/scratch.py +294 -0
- package/runtime/claude/egregore_runtime/scroll_cli.py +8 -8
- package/runtime/claude/egregore_runtime/scrolls.py +172 -28
- package/runtime/claude/egregore_runtime/sync.py +247 -21
- package/runtime/claude/egregore_runtime/sync_health.py +63 -0
- package/runtime/claude/egregore_runtime/telemetry.py +102 -10
- package/runtime/claude/egregore_runtime/thread_cli.py +4 -4
- package/runtime/claude/egregore_runtime/threads.py +5 -1
- package/runtime/claude/egregore_runtime/upgrade.py +771 -34
- package/runtime/claude/egregore_runtime/writeback.py +174 -12
- package/runtime/claude/egregore_runtime/writeback_cli.py +89 -17
- package/runtime/claude/manifest.json +66 -1
- package/runtime/codex/.claude/context/notification-consent.md +17 -2
- package/runtime/codex/.claude/context/retrieval-investigation.md +57 -0
- package/runtime/codex/.codex/config.toml +1 -2
- package/runtime/codex/.codex/skills/activity/SKILL.md +45 -35
- package/runtime/codex/.codex/skills/announce/SKILL.md +25 -40
- package/runtime/codex/.codex/skills/archive/SKILL.md +40 -21
- package/runtime/codex/.codex/skills/branch/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/checkup/SKILL.md +40 -77
- package/runtime/codex/.codex/skills/commit/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/contribute/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/create-skill/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/dark-mode/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/dashboard/SKILL.md +40 -20
- package/runtime/codex/.codex/skills/deep-reflect/SKILL.md +45 -105
- package/runtime/codex/.codex/skills/delete-user/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/emissary/SKILL.md +6 -2
- package/runtime/codex/.codex/skills/env/SKILL.md +29 -0
- package/runtime/codex/.codex/skills/handoff/SKILL.md +45 -126
- package/runtime/codex/.codex/skills/harvest/SKILL.md +45 -42
- package/runtime/codex/.codex/skills/ingest/SKILL.md +25 -47
- package/runtime/codex/.codex/skills/ingest-corpus/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/ingest-notion/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/ingest-user-interview/SKILL.md +40 -18
- package/runtime/codex/.codex/skills/invite/SKILL.md +21 -22
- package/runtime/codex/.codex/skills/issue/SKILL.md +45 -60
- package/runtime/codex/.codex/skills/me/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/meeting/SKILL.md +40 -16
- package/runtime/codex/.codex/skills/note/SKILL.md +25 -30
- package/runtime/codex/.codex/skills/notion-connect/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/onboarding/SKILL.md +45 -36
- package/runtime/codex/.codex/skills/pr/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/pull/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/push/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/quest/SKILL.md +45 -37
- package/runtime/codex/.codex/skills/reflect/SKILL.md +40 -22
- package/runtime/codex/.codex/skills/review-pr/SKILL.md +6 -2
- package/runtime/codex/.codex/skills/save/SKILL.md +25 -120
- package/runtime/codex/.codex/skills/slack-connect/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/summon/SKILL.md +6 -2
- package/runtime/codex/.codex/skills/sync-repos/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/teams-connect/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/telegram-connect/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/telemetry/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/test/SKILL.md +7 -3
- package/runtime/codex/.codex/skills/the-spiral/SKILL.md +25 -80
- package/runtime/codex/.codex/skills/tui-design/SKILL.md +6 -2
- package/runtime/codex/.codex/skills/tutorial/SKILL.md +45 -40
- package/runtime/codex/.codex/skills/update/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/view/SKILL.md +40 -151
- package/runtime/codex/.codex/skills/visual-explain/SKILL.md +6 -2
- package/runtime/codex/.codex/skills/wrap/SKILL.md +45 -58
- package/runtime/codex/.codex/spec-manifest.json +14 -14
- package/runtime/codex/AGENTS.md +88 -91
- package/runtime/codex/bin/activity-action.sh +1 -1
- package/runtime/codex/bin/activity-data.sh +1 -1
- package/runtime/codex/bin/agent.sh +132 -29
- package/runtime/codex/bin/api-call.sh +181 -0
- package/runtime/codex/bin/artifact-register.sh +62 -6
- package/runtime/codex/bin/artifact-writeback.sh +28 -3
- package/runtime/codex/bin/artifacts.sh +1 -1
- package/runtime/codex/bin/attendant.sh +1 -1
- package/runtime/codex/bin/base-branch.sh +62 -0
- package/runtime/codex/bin/codex-render-spec.mjs +45 -73
- package/runtime/codex/bin/codex-session-start.sh +30 -39
- package/runtime/codex/bin/codex-skill-render.mjs +15 -6
- package/runtime/codex/bin/codex-sync-skills.sh +85 -26
- package/runtime/codex/bin/config-get.sh +65 -0
- package/runtime/codex/bin/contribute-guard.sh +70 -0
- package/runtime/codex/bin/dashboard-data.sh +1 -1
- package/runtime/codex/bin/gh-run.sh +25 -0
- package/runtime/codex/bin/graph-op.sh +302 -5
- package/runtime/codex/bin/graph-projection.sh +1 -1
- package/runtime/codex/bin/graph-wal.sh +2 -2
- package/runtime/codex/bin/graph.sh +1 -1
- package/runtime/codex/bin/handoff-lifecycle.sh +2 -2
- package/runtime/codex/bin/handoff-preview.sh +7 -3
- package/runtime/codex/bin/handoff-run.sh +1 -1
- package/runtime/codex/bin/hosting-ops.sh +248 -0
- package/runtime/codex/bin/index-handoff.sh +3 -3
- package/runtime/codex/bin/ingest-item.sh +1 -1
- package/runtime/codex/bin/ingest.sh +3 -3
- package/runtime/codex/bin/invite.sh +1 -0
- package/runtime/codex/bin/issue.sh +1 -1
- package/runtime/codex/bin/knowledge.sh +1 -1
- package/runtime/codex/bin/lib/config.sh +4 -8
- package/runtime/codex/bin/lib/dashboard-artifact.sh +1 -1
- package/runtime/codex/bin/lib/framework-update.sh +41 -0
- package/runtime/codex/bin/lib/generated-trees.sh +27 -0
- package/runtime/codex/bin/lib/git-sync.sh +71 -20
- package/runtime/codex/bin/lib/greeting.sh +45 -72
- package/runtime/codex/bin/lib/health-footer.sh +115 -0
- package/runtime/codex/bin/lib/hosted-ref-id.sh +108 -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/lib/runtime-owned.sh +52 -16
- package/runtime/codex/bin/lib/scratch.sh +26 -0
- package/runtime/codex/bin/lib/secret_entry.py +1013 -0
- package/runtime/codex/bin/notification.sh +1 -1
- package/runtime/codex/bin/notify.sh +134 -14
- package/runtime/codex/bin/observe-context.sh +3 -3
- package/runtime/codex/bin/onboarding.sh +1 -0
- package/runtime/codex/bin/person.sh +9 -4
- 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/harness-tool-names.md +36 -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/publish-artifact.sh +52 -4
- package/runtime/codex/bin/publish-references.sh +27 -8
- package/runtime/codex/bin/pull.sh +272 -0
- package/runtime/codex/bin/qa-gate.sh +205 -0
- package/runtime/codex/bin/qa-inventory.sh +341 -0
- package/runtime/codex/bin/quest.sh +1 -1
- package/runtime/codex/bin/question.sh +1 -1
- package/runtime/codex/bin/research-ingest.sh +1 -1
- package/runtime/codex/bin/runtime-identity.sh +3 -3
- package/runtime/codex/bin/runtime-upgrade.sh +5 -3
- package/runtime/codex/bin/scratch-sweep.sh +29 -0
- package/runtime/codex/bin/scroll.sh +1 -1
- package/runtime/codex/bin/search.sh +110 -64
- package/runtime/codex/bin/secret-entry.py +6 -0
- package/runtime/codex/bin/session-autosave.sh +1 -1
- package/runtime/codex/bin/session-log.sh +7 -2
- package/runtime/codex/bin/settings.sh +1 -1
- package/runtime/codex/bin/telemetry.sh +65 -18
- package/runtime/codex/bin/test-baseline.sh +440 -0
- package/runtime/codex/bin/test-changes.sh +196 -145
- package/runtime/codex/bin/thread.sh +1 -1
- package/runtime/codex/bin/todo.sh +1 -1
- package/runtime/codex/bin/update-framework.sh +24 -0
- package/runtime/codex/bin/view-render.sh +26 -2
- package/runtime/codex/bin/worktree-create.sh +11 -0
- package/runtime/codex/bin/worktree.sh +1 -1
- package/runtime/codex/docs/credential-entry.md +286 -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 +132 -19
- package/runtime/codex/egregore_runtime/contracts.py +43 -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 +332 -0
- package/runtime/codex/egregore_runtime/graph.py +15 -6
- package/runtime/codex/egregore_runtime/harness_cli.py +626 -413
- package/runtime/codex/egregore_runtime/identity.py +160 -8
- package/runtime/codex/egregore_runtime/identity_transfer.py +288 -0
- package/runtime/codex/egregore_runtime/ingest_cli.py +4 -6
- 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 +58 -0
- package/runtime/codex/egregore_runtime/issue_cli.py +97 -0
- package/runtime/codex/egregore_runtime/issue_duplicates.py +116 -0
- package/runtime/codex/egregore_runtime/issue_markers.py +50 -0
- package/runtime/codex/egregore_runtime/issue_readiness.py +231 -0
- package/runtime/codex/egregore_runtime/issue_reporting.py +224 -0
- package/runtime/codex/egregore_runtime/issue_triage.py +331 -0
- package/runtime/codex/egregore_runtime/issue_triage_service.py +124 -0
- package/runtime/codex/egregore_runtime/knowledge_cli.py +4 -3
- package/runtime/codex/egregore_runtime/notification_cli.py +66 -8
- 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/questions.py +1 -0
- package/runtime/codex/egregore_runtime/research_ingest_cli.py +7 -5
- package/runtime/codex/egregore_runtime/runtime.py +61 -3
- package/runtime/codex/egregore_runtime/scratch.py +294 -0
- package/runtime/codex/egregore_runtime/scroll_cli.py +8 -8
- package/runtime/codex/egregore_runtime/scrolls.py +172 -28
- package/runtime/codex/egregore_runtime/sync.py +247 -21
- package/runtime/codex/egregore_runtime/sync_health.py +63 -0
- package/runtime/codex/egregore_runtime/telemetry.py +102 -10
- package/runtime/codex/egregore_runtime/thread_cli.py +4 -4
- package/runtime/codex/egregore_runtime/threads.py +5 -1
- package/runtime/codex/egregore_runtime/upgrade.py +771 -34
- package/runtime/codex/egregore_runtime/writeback.py +174 -12
- package/runtime/codex/egregore_runtime/writeback_cli.py +89 -17
- package/runtime/codex/manifest.json +65 -1
- package/runtime/pi/.claude/context/notification-consent.md +17 -2
- package/runtime/pi/.claude/context/retrieval-investigation.md +57 -0
- package/runtime/pi/.codex/config.toml +1 -2
- package/runtime/pi/.codex/skills/activity/SKILL.md +45 -35
- package/runtime/pi/.codex/skills/announce/SKILL.md +25 -40
- package/runtime/pi/.codex/skills/archive/SKILL.md +40 -21
- package/runtime/pi/.codex/skills/branch/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/checkup/SKILL.md +40 -77
- package/runtime/pi/.codex/skills/commit/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/contribute/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/create-skill/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/dark-mode/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/dashboard/SKILL.md +40 -20
- package/runtime/pi/.codex/skills/deep-reflect/SKILL.md +45 -105
- package/runtime/pi/.codex/skills/delete-user/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/emissary/SKILL.md +6 -2
- package/runtime/pi/.codex/skills/env/SKILL.md +29 -0
- package/runtime/pi/.codex/skills/handoff/SKILL.md +45 -126
- package/runtime/pi/.codex/skills/harvest/SKILL.md +45 -42
- package/runtime/pi/.codex/skills/ingest/SKILL.md +25 -47
- package/runtime/pi/.codex/skills/ingest-corpus/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/ingest-notion/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/ingest-user-interview/SKILL.md +40 -18
- package/runtime/pi/.codex/skills/invite/SKILL.md +21 -22
- package/runtime/pi/.codex/skills/issue/SKILL.md +45 -60
- package/runtime/pi/.codex/skills/me/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/meeting/SKILL.md +40 -16
- package/runtime/pi/.codex/skills/note/SKILL.md +25 -30
- package/runtime/pi/.codex/skills/notion-connect/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/onboarding/SKILL.md +45 -36
- package/runtime/pi/.codex/skills/pr/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/pull/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/push/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/quest/SKILL.md +45 -37
- package/runtime/pi/.codex/skills/reflect/SKILL.md +40 -22
- package/runtime/pi/.codex/skills/review-pr/SKILL.md +6 -2
- package/runtime/pi/.codex/skills/save/SKILL.md +25 -120
- package/runtime/pi/.codex/skills/slack-connect/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/summon/SKILL.md +6 -2
- package/runtime/pi/.codex/skills/sync-repos/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/teams-connect/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/telegram-connect/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/telemetry/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/test/SKILL.md +7 -3
- package/runtime/pi/.codex/skills/the-spiral/SKILL.md +25 -80
- package/runtime/pi/.codex/skills/tui-design/SKILL.md +6 -2
- package/runtime/pi/.codex/skills/tutorial/SKILL.md +45 -40
- package/runtime/pi/.codex/skills/update/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/view/SKILL.md +40 -151
- package/runtime/pi/.codex/skills/visual-explain/SKILL.md +6 -2
- package/runtime/pi/.codex/skills/wrap/SKILL.md +45 -58
- package/runtime/pi/.codex/spec-manifest.json +14 -14
- package/runtime/pi/.pi/APPEND_SYSTEM.md +63 -34
- package/runtime/pi/.pi/extensions/egregore.ts +8 -7
- package/runtime/pi/.pi/spec-manifest.json +2 -2
- package/runtime/pi/AGENTS.md +88 -91
- package/runtime/pi/bin/activity-action.sh +1 -1
- package/runtime/pi/bin/activity-data.sh +1 -1
- package/runtime/pi/bin/agent.sh +132 -29
- package/runtime/pi/bin/api-call.sh +181 -0
- package/runtime/pi/bin/artifact-register.sh +62 -6
- package/runtime/pi/bin/artifact-writeback.sh +28 -3
- package/runtime/pi/bin/artifacts.sh +1 -1
- package/runtime/pi/bin/attendant.sh +1 -1
- package/runtime/pi/bin/base-branch.sh +62 -0
- package/runtime/pi/bin/codex-render-spec.mjs +45 -73
- package/runtime/pi/bin/codex-session-start.sh +30 -39
- package/runtime/pi/bin/codex-skill-render.mjs +15 -6
- package/runtime/pi/bin/codex-sync-skills.sh +85 -26
- package/runtime/pi/bin/config-get.sh +65 -0
- package/runtime/pi/bin/contribute-guard.sh +70 -0
- package/runtime/pi/bin/dashboard-data.sh +1 -1
- package/runtime/pi/bin/gh-run.sh +25 -0
- package/runtime/pi/bin/graph-op.sh +302 -5
- package/runtime/pi/bin/graph-projection.sh +1 -1
- package/runtime/pi/bin/graph-wal.sh +2 -2
- package/runtime/pi/bin/graph.sh +1 -1
- package/runtime/pi/bin/handoff-lifecycle.sh +2 -2
- package/runtime/pi/bin/handoff-preview.sh +7 -3
- package/runtime/pi/bin/handoff-run.sh +1 -1
- package/runtime/pi/bin/hosting-ops.sh +248 -0
- package/runtime/pi/bin/index-handoff.sh +3 -3
- package/runtime/pi/bin/ingest-item.sh +1 -1
- package/runtime/pi/bin/ingest.sh +3 -3
- package/runtime/pi/bin/invite.sh +1 -0
- package/runtime/pi/bin/issue.sh +1 -1
- package/runtime/pi/bin/knowledge.sh +1 -1
- package/runtime/pi/bin/lib/config.sh +4 -8
- package/runtime/pi/bin/lib/dashboard-artifact.sh +1 -1
- package/runtime/pi/bin/lib/framework-update.sh +41 -0
- package/runtime/pi/bin/lib/generated-trees.sh +27 -0
- package/runtime/pi/bin/lib/git-sync.sh +71 -20
- package/runtime/pi/bin/lib/greeting.sh +45 -72
- package/runtime/pi/bin/lib/health-footer.sh +115 -0
- package/runtime/pi/bin/lib/hosted-ref-id.sh +108 -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/lib/runtime-owned.sh +52 -16
- package/runtime/pi/bin/lib/scratch.sh +26 -0
- package/runtime/pi/bin/lib/secret_entry.py +1013 -0
- package/runtime/pi/bin/notification.sh +1 -1
- package/runtime/pi/bin/notify.sh +134 -14
- package/runtime/pi/bin/observe-context.sh +3 -3
- package/runtime/pi/bin/onboarding.sh +1 -0
- package/runtime/pi/bin/person.sh +9 -4
- package/runtime/pi/bin/pi-observe-context.mjs +38 -2
- package/runtime/pi/bin/pi-product-workflows.mjs +5 -0
- 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/harness-tool-names.md +36 -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/publish-artifact.sh +52 -4
- package/runtime/pi/bin/publish-references.sh +27 -8
- package/runtime/pi/bin/pull.sh +272 -0
- package/runtime/pi/bin/qa-gate.sh +205 -0
- package/runtime/pi/bin/qa-inventory.sh +341 -0
- package/runtime/pi/bin/quest.sh +1 -1
- package/runtime/pi/bin/question.sh +1 -1
- package/runtime/pi/bin/research-ingest.sh +1 -1
- package/runtime/pi/bin/runtime-identity.sh +3 -3
- package/runtime/pi/bin/runtime-upgrade.sh +5 -3
- package/runtime/pi/bin/scratch-sweep.sh +29 -0
- package/runtime/pi/bin/scroll.sh +1 -1
- package/runtime/pi/bin/search.sh +110 -64
- package/runtime/pi/bin/secret-entry.py +6 -0
- package/runtime/pi/bin/session-autosave.sh +1 -1
- package/runtime/pi/bin/session-log.sh +7 -2
- package/runtime/pi/bin/settings.sh +1 -1
- package/runtime/pi/bin/telemetry.sh +65 -18
- package/runtime/pi/bin/test-baseline.sh +440 -0
- package/runtime/pi/bin/test-changes.sh +196 -145
- package/runtime/pi/bin/thread.sh +1 -1
- package/runtime/pi/bin/todo.sh +1 -1
- package/runtime/pi/bin/update-framework.sh +24 -0
- package/runtime/pi/bin/view-render.sh +26 -2
- package/runtime/pi/bin/worktree-create.sh +11 -0
- package/runtime/pi/bin/worktree.sh +1 -1
- package/runtime/pi/docs/credential-entry.md +286 -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 +132 -19
- package/runtime/pi/egregore_runtime/contracts.py +43 -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 +332 -0
- package/runtime/pi/egregore_runtime/graph.py +15 -6
- package/runtime/pi/egregore_runtime/harness_cli.py +626 -413
- package/runtime/pi/egregore_runtime/identity.py +160 -8
- package/runtime/pi/egregore_runtime/identity_transfer.py +288 -0
- package/runtime/pi/egregore_runtime/ingest_cli.py +4 -6
- 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 +58 -0
- package/runtime/pi/egregore_runtime/issue_cli.py +97 -0
- package/runtime/pi/egregore_runtime/issue_duplicates.py +116 -0
- package/runtime/pi/egregore_runtime/issue_markers.py +50 -0
- package/runtime/pi/egregore_runtime/issue_readiness.py +231 -0
- package/runtime/pi/egregore_runtime/issue_reporting.py +224 -0
- package/runtime/pi/egregore_runtime/issue_triage.py +331 -0
- package/runtime/pi/egregore_runtime/issue_triage_service.py +124 -0
- package/runtime/pi/egregore_runtime/knowledge_cli.py +4 -3
- package/runtime/pi/egregore_runtime/notification_cli.py +66 -8
- 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/questions.py +1 -0
- package/runtime/pi/egregore_runtime/research_ingest_cli.py +7 -5
- package/runtime/pi/egregore_runtime/runtime.py +61 -3
- package/runtime/pi/egregore_runtime/scratch.py +294 -0
- package/runtime/pi/egregore_runtime/scroll_cli.py +8 -8
- package/runtime/pi/egregore_runtime/scrolls.py +172 -28
- package/runtime/pi/egregore_runtime/sync.py +247 -21
- package/runtime/pi/egregore_runtime/sync_health.py +63 -0
- package/runtime/pi/egregore_runtime/telemetry.py +102 -10
- package/runtime/pi/egregore_runtime/thread_cli.py +4 -4
- package/runtime/pi/egregore_runtime/threads.py +5 -1
- package/runtime/pi/egregore_runtime/upgrade.py +771 -34
- package/runtime/pi/egregore_runtime/writeback.py +174 -12
- package/runtime/pi/egregore_runtime/writeback_cli.py +89 -17
- package/runtime/pi/manifest.json +65 -1
- package/runtime/prime/.claude/context/notification-consent.md +17 -2
- package/runtime/prime/.claude/context/retrieval-investigation.md +57 -0
- package/runtime/prime/.codex/config.toml +1 -2
- package/runtime/prime/.codex/skills/activity/SKILL.md +45 -35
- package/runtime/prime/.codex/skills/announce/SKILL.md +25 -40
- package/runtime/prime/.codex/skills/archive/SKILL.md +40 -21
- package/runtime/prime/.codex/skills/branch/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/checkup/SKILL.md +40 -77
- package/runtime/prime/.codex/skills/commit/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/contribute/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/create-skill/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/dark-mode/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/dashboard/SKILL.md +40 -20
- package/runtime/prime/.codex/skills/deep-reflect/SKILL.md +45 -105
- package/runtime/prime/.codex/skills/delete-user/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/emissary/SKILL.md +6 -2
- package/runtime/prime/.codex/skills/env/SKILL.md +29 -0
- package/runtime/prime/.codex/skills/handoff/SKILL.md +45 -126
- package/runtime/prime/.codex/skills/harvest/SKILL.md +45 -42
- package/runtime/prime/.codex/skills/ingest/SKILL.md +25 -47
- package/runtime/prime/.codex/skills/ingest-corpus/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/ingest-notion/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/ingest-user-interview/SKILL.md +40 -18
- package/runtime/prime/.codex/skills/invite/SKILL.md +21 -22
- package/runtime/prime/.codex/skills/issue/SKILL.md +45 -60
- package/runtime/prime/.codex/skills/me/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/meeting/SKILL.md +40 -16
- package/runtime/prime/.codex/skills/note/SKILL.md +25 -30
- package/runtime/prime/.codex/skills/notion-connect/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/onboarding/SKILL.md +45 -36
- package/runtime/prime/.codex/skills/pr/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/pull/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/push/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/quest/SKILL.md +45 -37
- package/runtime/prime/.codex/skills/reflect/SKILL.md +40 -22
- package/runtime/prime/.codex/skills/review-pr/SKILL.md +6 -2
- package/runtime/prime/.codex/skills/save/SKILL.md +25 -120
- package/runtime/prime/.codex/skills/slack-connect/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/summon/SKILL.md +6 -2
- package/runtime/prime/.codex/skills/sync-repos/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/teams-connect/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/telegram-connect/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/telemetry/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/test/SKILL.md +7 -3
- package/runtime/prime/.codex/skills/the-spiral/SKILL.md +25 -80
- package/runtime/prime/.codex/skills/tui-design/SKILL.md +6 -2
- package/runtime/prime/.codex/skills/tutorial/SKILL.md +45 -40
- package/runtime/prime/.codex/skills/update/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/view/SKILL.md +40 -151
- package/runtime/prime/.codex/skills/visual-explain/SKILL.md +6 -2
- package/runtime/prime/.codex/skills/wrap/SKILL.md +45 -58
- package/runtime/prime/.codex/spec-manifest.json +14 -14
- package/runtime/prime/.prime/agent/APPEND_SYSTEM.md +64 -35
- package/runtime/prime/.prime/agent/extensions/egregore.ts +8 -7
- package/runtime/prime/.prime/agent/skills/egregore/SKILL.md +8 -1
- package/runtime/prime/.prime/agent/skills/egregore/src/egregore/__init__.py +24 -4
- package/runtime/prime/.prime/agent/spec-manifest.json +2 -2
- package/runtime/prime/AGENTS.md +88 -91
- package/runtime/prime/bin/activity-action.sh +1 -1
- package/runtime/prime/bin/activity-data.sh +1 -1
- package/runtime/prime/bin/agent.sh +132 -29
- package/runtime/prime/bin/api-call.sh +181 -0
- package/runtime/prime/bin/artifact-register.sh +62 -6
- package/runtime/prime/bin/artifact-writeback.sh +28 -3
- package/runtime/prime/bin/artifacts.sh +1 -1
- package/runtime/prime/bin/attendant.sh +1 -1
- package/runtime/prime/bin/base-branch.sh +62 -0
- package/runtime/prime/bin/codex-render-spec.mjs +45 -73
- package/runtime/prime/bin/codex-session-start.sh +30 -39
- package/runtime/prime/bin/codex-skill-render.mjs +15 -6
- package/runtime/prime/bin/codex-sync-skills.sh +85 -26
- package/runtime/prime/bin/config-get.sh +65 -0
- package/runtime/prime/bin/contribute-guard.sh +70 -0
- package/runtime/prime/bin/dashboard-data.sh +1 -1
- package/runtime/prime/bin/gh-run.sh +25 -0
- package/runtime/prime/bin/graph-op.sh +302 -5
- package/runtime/prime/bin/graph-projection.sh +1 -1
- package/runtime/prime/bin/graph-wal.sh +2 -2
- package/runtime/prime/bin/graph.sh +1 -1
- package/runtime/prime/bin/handoff-lifecycle.sh +2 -2
- package/runtime/prime/bin/handoff-preview.sh +7 -3
- package/runtime/prime/bin/handoff-run.sh +1 -1
- package/runtime/prime/bin/hosting-ops.sh +248 -0
- package/runtime/prime/bin/index-handoff.sh +3 -3
- package/runtime/prime/bin/ingest-item.sh +1 -1
- package/runtime/prime/bin/ingest.sh +3 -3
- package/runtime/prime/bin/invite.sh +1 -0
- package/runtime/prime/bin/issue.sh +1 -1
- package/runtime/prime/bin/knowledge.sh +1 -1
- package/runtime/prime/bin/lib/config.sh +4 -8
- package/runtime/prime/bin/lib/dashboard-artifact.sh +1 -1
- package/runtime/prime/bin/lib/framework-update.sh +41 -0
- package/runtime/prime/bin/lib/generated-trees.sh +27 -0
- package/runtime/prime/bin/lib/git-sync.sh +71 -20
- package/runtime/prime/bin/lib/greeting.sh +45 -72
- package/runtime/prime/bin/lib/health-footer.sh +115 -0
- package/runtime/prime/bin/lib/hosted-ref-id.sh +108 -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/lib/runtime-owned.sh +52 -16
- package/runtime/prime/bin/lib/scratch.sh +26 -0
- package/runtime/prime/bin/lib/secret_entry.py +1013 -0
- package/runtime/prime/bin/notification.sh +1 -1
- package/runtime/prime/bin/notify.sh +134 -14
- package/runtime/prime/bin/observe-context.sh +3 -3
- package/runtime/prime/bin/onboarding.sh +1 -0
- package/runtime/prime/bin/person.sh +9 -4
- package/runtime/prime/bin/pi-observe-context.mjs +38 -2
- package/runtime/prime/bin/pi-product-workflows.mjs +5 -0
- 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/harness-tool-names.md +36 -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/publish-artifact.sh +52 -4
- package/runtime/prime/bin/publish-references.sh +27 -8
- package/runtime/prime/bin/pull.sh +272 -0
- package/runtime/prime/bin/qa-gate.sh +205 -0
- package/runtime/prime/bin/qa-inventory.sh +341 -0
- package/runtime/prime/bin/quest.sh +1 -1
- package/runtime/prime/bin/question.sh +1 -1
- package/runtime/prime/bin/research-ingest.sh +1 -1
- package/runtime/prime/bin/runtime-identity.sh +3 -3
- package/runtime/prime/bin/runtime-upgrade.sh +5 -3
- package/runtime/prime/bin/scratch-sweep.sh +29 -0
- package/runtime/prime/bin/scroll.sh +1 -1
- package/runtime/prime/bin/search.sh +110 -64
- package/runtime/prime/bin/secret-entry.py +6 -0
- package/runtime/prime/bin/session-autosave.sh +1 -1
- package/runtime/prime/bin/session-log.sh +7 -2
- package/runtime/prime/bin/settings.sh +1 -1
- package/runtime/prime/bin/telemetry.sh +65 -18
- package/runtime/prime/bin/test-baseline.sh +440 -0
- package/runtime/prime/bin/test-changes.sh +196 -145
- package/runtime/prime/bin/thread.sh +1 -1
- package/runtime/prime/bin/todo.sh +1 -1
- package/runtime/prime/bin/update-framework.sh +24 -0
- package/runtime/prime/bin/view-render.sh +26 -2
- package/runtime/prime/bin/worktree-create.sh +11 -0
- package/runtime/prime/bin/worktree.sh +1 -1
- package/runtime/prime/docs/credential-entry.md +286 -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 +132 -19
- package/runtime/prime/egregore_runtime/contracts.py +43 -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 +332 -0
- package/runtime/prime/egregore_runtime/graph.py +15 -6
- package/runtime/prime/egregore_runtime/harness_cli.py +626 -413
- package/runtime/prime/egregore_runtime/identity.py +160 -8
- package/runtime/prime/egregore_runtime/identity_transfer.py +288 -0
- package/runtime/prime/egregore_runtime/ingest_cli.py +4 -6
- 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 +58 -0
- package/runtime/prime/egregore_runtime/issue_cli.py +97 -0
- package/runtime/prime/egregore_runtime/issue_duplicates.py +116 -0
- package/runtime/prime/egregore_runtime/issue_markers.py +50 -0
- package/runtime/prime/egregore_runtime/issue_readiness.py +231 -0
- package/runtime/prime/egregore_runtime/issue_reporting.py +224 -0
- package/runtime/prime/egregore_runtime/issue_triage.py +331 -0
- package/runtime/prime/egregore_runtime/issue_triage_service.py +124 -0
- package/runtime/prime/egregore_runtime/knowledge_cli.py +4 -3
- package/runtime/prime/egregore_runtime/notification_cli.py +66 -8
- 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/questions.py +1 -0
- package/runtime/prime/egregore_runtime/research_ingest_cli.py +7 -5
- package/runtime/prime/egregore_runtime/runtime.py +61 -3
- package/runtime/prime/egregore_runtime/scratch.py +294 -0
- package/runtime/prime/egregore_runtime/scroll_cli.py +8 -8
- package/runtime/prime/egregore_runtime/scrolls.py +172 -28
- package/runtime/prime/egregore_runtime/sync.py +247 -21
- package/runtime/prime/egregore_runtime/sync_health.py +63 -0
- package/runtime/prime/egregore_runtime/telemetry.py +102 -10
- package/runtime/prime/egregore_runtime/thread_cli.py +4 -4
- package/runtime/prime/egregore_runtime/threads.py +5 -1
- package/runtime/prime/egregore_runtime/upgrade.py +771 -34
- package/runtime/prime/egregore_runtime/writeback.py +174 -12
- package/runtime/prime/egregore_runtime/writeback_cli.py +89 -17
- package/runtime/prime/manifest.json +65 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// egregore-launcher-version: 0.21.0
|
|
2
|
+
// egregore-launcher-version: 0.21.0
|
|
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
|
|
38
|
+
const VERSION = "0.21.0";
|
|
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,121 @@ 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
|
+
"AGENTS.md",
|
|
759
|
+
"bin/codex-session-start.sh",
|
|
760
|
+
"bin/codex-install-skills.sh",
|
|
761
|
+
".codex/config.toml",
|
|
762
|
+
".codex/skills",
|
|
763
|
+
".codex/hooks.json",
|
|
764
|
+
".codex/hooks",
|
|
765
|
+
],
|
|
766
|
+
pi: [
|
|
767
|
+
"bin/pi-session-start.sh",
|
|
768
|
+
".pi/APPEND_SYSTEM.md",
|
|
769
|
+
".pi/settings.json",
|
|
770
|
+
".pi/extensions/egregore.ts",
|
|
771
|
+
".codex/skills",
|
|
772
|
+
],
|
|
773
|
+
prime: [
|
|
774
|
+
"bin/prime-session-start.sh",
|
|
775
|
+
".prime/agent/APPEND_SYSTEM.md",
|
|
776
|
+
".prime/agent/settings.json",
|
|
777
|
+
".prime/agent/extensions/egregore.ts",
|
|
778
|
+
".codex/skills",
|
|
779
|
+
],
|
|
780
|
+
};
|
|
781
|
+
|
|
782
|
+
function missingCorePaths(runtime, egregoreDir) {
|
|
783
|
+
return (CORE_SUPPORT_PATHS[runtime] || []).filter(
|
|
784
|
+
(rel) => !fs.existsSync(path.join(egregoreDir, ...rel.split("/"))),
|
|
785
|
+
);
|
|
773
786
|
}
|
|
774
787
|
|
|
775
788
|
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
|
-
);
|
|
789
|
+
return missingCorePaths("codex", egregoreDir).length === 0;
|
|
784
790
|
}
|
|
785
791
|
|
|
786
792
|
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
|
-
);
|
|
793
|
+
return missingCorePaths("pi", egregoreDir).length === 0;
|
|
794
794
|
}
|
|
795
795
|
|
|
796
|
-
function
|
|
797
|
-
return
|
|
798
|
-
|
|
796
|
+
function hasPrimeCoreSupport(egregoreDir) {
|
|
797
|
+
return missingCorePaths("prime", egregoreDir).length === 0;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
// The repair command is pinned to this launcher's own release. `@latest`
|
|
801
|
+
// once pulled another release channel's files into an instance; the
|
|
802
|
+
// launcher and the files it installs must always be the same version.
|
|
803
|
+
function harnessAddCommand(runtime) {
|
|
804
|
+
return `npx -y ${PUBLIC_NPX_PACKAGE}@${VERSION} --add-harness ${runtimeShort(runtime)}`;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
function harnessSupportMessage(runtime, egregoreDir) {
|
|
808
|
+
const label = runtimeLabel(runtime);
|
|
809
|
+
const missing = missingCorePaths(runtime, egregoreDir);
|
|
810
|
+
const lines = [
|
|
811
|
+
`${label} support is missing from this Egregore checkout.`,
|
|
799
812
|
` path: ${egregoreDir}`,
|
|
813
|
+
];
|
|
814
|
+
if (missing.length > 0) {
|
|
815
|
+
lines.push("", "Missing:");
|
|
816
|
+
for (const rel of missing) lines.push(` ${rel}`);
|
|
817
|
+
}
|
|
818
|
+
lines.push(
|
|
800
819
|
"",
|
|
801
|
-
|
|
802
|
-
|
|
820
|
+
`Add ${label} support to this instance (missing files only, nothing overwritten):`,
|
|
821
|
+
` cd ${egregoreDir}`,
|
|
822
|
+
` ${harnessAddCommand(runtime)}`,
|
|
823
|
+
"Then rerun egregore.",
|
|
824
|
+
);
|
|
825
|
+
if (runtime === "codex") {
|
|
826
|
+
lines.push("Egregore workflows appear as slash commands. In Codex, invoke them with the matching $skill token or ask in natural language.");
|
|
827
|
+
}
|
|
828
|
+
return lines.join("\n");
|
|
803
829
|
}
|
|
804
830
|
|
|
805
|
-
function
|
|
806
|
-
return (
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
fs.existsSync(path.join(egregoreDir, ".codex", "skills"))
|
|
812
|
-
);
|
|
831
|
+
function codexSupportMessage(egregoreDir) {
|
|
832
|
+
return harnessSupportMessage("codex", egregoreDir);
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
function piSupportMessage(egregoreDir) {
|
|
836
|
+
return harnessSupportMessage("pi", egregoreDir);
|
|
813
837
|
}
|
|
814
838
|
|
|
815
839
|
function primeSupportMessage(egregoreDir) {
|
|
816
|
-
return
|
|
817
|
-
|
|
818
|
-
|
|
840
|
+
return harnessSupportMessage("prime", egregoreDir);
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
// A launch that fails the support check offers to add exactly that harness
|
|
844
|
+
// to exactly this instance, using this launcher's own release. Without a
|
|
845
|
+
// terminal to ask, print the command and stop; never install unattended.
|
|
846
|
+
async function ensureHarnessSupport(inst, runtime) {
|
|
847
|
+
if (missingCorePaths(runtime, inst.path).length === 0) return;
|
|
848
|
+
const message = harnessSupportMessage(runtime, inst.path);
|
|
849
|
+
if (!canPrompt()) die(message);
|
|
850
|
+
const label = runtimeLabel(runtime);
|
|
851
|
+
const name = inst.name || inst.slug || path.basename(inst.path);
|
|
852
|
+
process.stdout.write([
|
|
819
853
|
"",
|
|
820
|
-
|
|
821
|
-
|
|
854
|
+
` ${BOLD}${label} support is missing from ${name}.${RESET}`,
|
|
855
|
+
` ${DIM}Missing: ${missingCorePaths(runtime, inst.path).join(", ")}${RESET}`,
|
|
856
|
+
` ${DIM}Egregore can add it now. Only missing files are written; nothing is overwritten:${RESET}`,
|
|
857
|
+
` ${harnessAddCommand(runtime)}`,
|
|
858
|
+
"",
|
|
859
|
+
].join("\n"));
|
|
860
|
+
const yes = await confirmLine(`Add ${label} support to ${name} now?`);
|
|
861
|
+
if (!yes) die(message);
|
|
862
|
+
const result = spawnSync(
|
|
863
|
+
"npx",
|
|
864
|
+
["-y", `${PUBLIC_NPX_PACKAGE}@${VERSION}`, "--add-harness", runtimeShort(runtime)],
|
|
865
|
+
{ cwd: inst.path, stdio: "inherit", env: process.env, timeout: 3 * 60 * 1000 },
|
|
866
|
+
);
|
|
867
|
+
if (result.error || result.status !== 0 || missingCorePaths(runtime, inst.path).length > 0) {
|
|
868
|
+
die(`${label} support could not be added automatically.\n\n${harnessSupportMessage(runtime, inst.path)}`);
|
|
869
|
+
}
|
|
870
|
+
process.stdout.write(` ${GREEN}✓${RESET} ${label} support added to ${name}\n\n`);
|
|
822
871
|
}
|
|
823
872
|
|
|
824
873
|
// Minimal y/N line prompt for pre-launch decisions (the TUI select machinery
|
|
@@ -873,7 +922,7 @@ function primeAuthHint() {
|
|
|
873
922
|
|
|
874
923
|
function installCodexSkills(egregoreDir) {
|
|
875
924
|
const script = path.join(egregoreDir, "bin", "codex-install-skills.sh");
|
|
876
|
-
if (!fs.existsSync(script)) return false;
|
|
925
|
+
if (!fs.existsSync(script)) return { ok: false, stderr: `missing ${script}` };
|
|
877
926
|
try {
|
|
878
927
|
const result = spawnSync("bash", [script], {
|
|
879
928
|
cwd: egregoreDir,
|
|
@@ -881,9 +930,9 @@ function installCodexSkills(egregoreDir) {
|
|
|
881
930
|
encoding: "utf-8",
|
|
882
931
|
maxBuffer: 1024 * 1024,
|
|
883
932
|
});
|
|
884
|
-
return result.status === 0;
|
|
885
|
-
} catch {
|
|
886
|
-
return false;
|
|
933
|
+
return { ok: result.status === 0, stderr: (result.stderr || "").trim() };
|
|
934
|
+
} catch (err) {
|
|
935
|
+
return { ok: false, stderr: String(err && err.message ? err.message : err) };
|
|
887
936
|
}
|
|
888
937
|
}
|
|
889
938
|
|
|
@@ -966,29 +1015,31 @@ async function launch(inst, runtimeOverride) {
|
|
|
966
1015
|
}
|
|
967
1016
|
}
|
|
968
1017
|
if (runtime === "codex") {
|
|
969
|
-
// Launching never changes an instance's runtime or release channel.
|
|
970
|
-
|
|
971
|
-
|
|
1018
|
+
// Launching never changes an instance's runtime or release channel. A
|
|
1019
|
+
// missing harness is added only with the user's consent, one harness
|
|
1020
|
+
// into this one instance, at this launcher's own version.
|
|
1021
|
+
await ensureHarnessSupport(inst, runtime);
|
|
1022
|
+
const skills = installCodexSkills(inst.path);
|
|
1023
|
+
if (!skills.ok) {
|
|
1024
|
+
die(`Codex skill setup failed in ${inst.path} (bin/codex-install-skills.sh):\n${skills.stderr || " (no error output)"}`);
|
|
1025
|
+
}
|
|
972
1026
|
const cardRendered = await renderCodexStartupCard(inst.path);
|
|
973
|
-
if (!
|
|
974
|
-
die(
|
|
1027
|
+
if (!cardRendered) {
|
|
1028
|
+
die(`Codex startup card failed in ${inst.path} (bin/codex-session-start.sh exited non-zero; its output is above).`);
|
|
975
1029
|
}
|
|
976
1030
|
} else if (runtime === "pi") {
|
|
977
|
-
|
|
978
|
-
die(piSupportMessage(inst.path));
|
|
979
|
-
}
|
|
1031
|
+
await ensureHarnessSupport(inst, runtime);
|
|
980
1032
|
}
|
|
981
1033
|
let launchArgs = null;
|
|
982
1034
|
if (runtime === "prime") {
|
|
1035
|
+
await ensureHarnessSupport(inst, runtime);
|
|
983
1036
|
// Cover the gap between choosing the harness and Prime's first paint:
|
|
984
|
-
// the loader runs through the launcher-side pre-flight (
|
|
985
|
-
//
|
|
986
|
-
//
|
|
1037
|
+
// the loader runs through the launcher-side pre-flight (the trust-flag
|
|
1038
|
+
// probe, which shells out to the binary), then a single handoff line
|
|
1039
|
+
// explains the remaining in-harness startup.
|
|
987
1040
|
const stopLoader = startSpinner("Starting Prime Agent");
|
|
988
|
-
|
|
989
|
-
launchArgs = coreOk ? runtimeLaunchArgs(runtime, inst.path) : null;
|
|
1041
|
+
launchArgs = runtimeLaunchArgs(runtime, inst.path);
|
|
990
1042
|
stopLoader();
|
|
991
|
-
if (!coreOk) die(primeSupportMessage(inst.path));
|
|
992
1043
|
primeAuthHint();
|
|
993
1044
|
process.stdout.write(` ${CYAN}◆${RESET} ${BOLD}Prime Agent starting${RESET}${DIM} — the Egregore greeting loads inside in a few seconds${RESET}\n`);
|
|
994
1045
|
}
|
|
@@ -1304,7 +1355,10 @@ function compareReleaseVersions(a, b) {
|
|
|
1304
1355
|
}
|
|
1305
1356
|
|
|
1306
1357
|
function cliUpdateState(latest) {
|
|
1307
|
-
|
|
1358
|
+
// The global refresh follows latest; prerelease testing is selected explicitly.
|
|
1359
|
+
const parsed = parseReleaseVersion(latest);
|
|
1360
|
+
if (!RUNTIME_STABLE_VERSION_RE.test(latest || "") || !parsed
|
|
1361
|
+
|| !parsed.parts.every(Number.isSafeInteger)) return null;
|
|
1308
1362
|
return {
|
|
1309
1363
|
current: VERSION,
|
|
1310
1364
|
latest,
|
|
@@ -1395,7 +1449,7 @@ function cmdCliUpdate(latest) {
|
|
|
1395
1449
|
);
|
|
1396
1450
|
if (result.status !== 0) {
|
|
1397
1451
|
console.log(`\r${ANSI.clearLine} [1/2] ${YELLOW}!${RESET} Install failed`);
|
|
1398
|
-
const detail =
|
|
1452
|
+
const detail = adapterErrorText(result.stderr || result.stdout || "").trim().split("\n").filter(Boolean).pop();
|
|
1399
1453
|
if (detail) console.error(` ${DIM}${detail}${RESET}`);
|
|
1400
1454
|
console.error(` Retry: npx -y ${PUBLIC_NPX_PACKAGE}@${latest} --refresh-launcher\n`);
|
|
1401
1455
|
process.exitCode = 1;
|
|
@@ -1567,10 +1621,39 @@ function persistConnectState(inst, fields) {
|
|
|
1567
1621
|
writeJsonFileAtomic(file, state);
|
|
1568
1622
|
}
|
|
1569
1623
|
|
|
1624
|
+
// Older installed adapters and API versions may still use storage terminology.
|
|
1625
|
+
// Normalize only diagnostic display text; protocol fields and payloads stay intact.
|
|
1626
|
+
function adapterErrorText(detail) {
|
|
1627
|
+
return String(detail)
|
|
1628
|
+
// Describe a retired technical reference as a whole. Replacing one word
|
|
1629
|
+
// inside a path/module or shell invocation would invent a runnable command.
|
|
1630
|
+
.replace(/(^|\s)(?:(?:\/[^\s"'`]+)*\/)?(?:bash|sh|zsh)\s+(?:"([^"\n]+)"|'([^'\n]+)'|([^\s;"'`]+))/g,
|
|
1631
|
+
(command, prefix, quoted, singleQuoted, bare) => {
|
|
1632
|
+
const script = quoted || singleQuoted || bare;
|
|
1633
|
+
if (!/(?:graph|neo4j)/i.test(script)) return command;
|
|
1634
|
+
return prefix + (/sync-graph\.sh$/i.test(script) ? "the memory sync operation" : "the hosted storage operation");
|
|
1635
|
+
})
|
|
1636
|
+
.replace(/[^\s"'`()\[\]{},;:]+/g, (token) => {
|
|
1637
|
+
if (!/(?:graph|neo4j)/i.test(token)) return token;
|
|
1638
|
+
if (/[/\\]/.test(token)) {
|
|
1639
|
+
if (/[/\\]bin[/\\][^/\\]+\.sh$/i.test(token) || /^bin[/\\][^/\\]+\.sh$/i.test(token)) {
|
|
1640
|
+
return /sync-graph\.sh$/i.test(token) ? "the memory sync adapter" : "the hosted storage adapter";
|
|
1641
|
+
}
|
|
1642
|
+
return "the hosted storage path";
|
|
1643
|
+
}
|
|
1644
|
+
if (/^[a-z_][\w-]*(?:\.[a-z_][\w-]*)+\.?$/i.test(token)) return "the hosted storage component";
|
|
1645
|
+
return token;
|
|
1646
|
+
})
|
|
1647
|
+
.replace(/\bknowledge graph\b/gi, "shared memory")
|
|
1648
|
+
.replace(/\bgraph database\b/gi, "hosted storage")
|
|
1649
|
+
.replace(/\bneo4j\b/gi, "hosted storage")
|
|
1650
|
+
.replace(/\bgraph\b/gi, "storage");
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1570
1653
|
function connectError(result, fallback) {
|
|
1571
1654
|
if (!result) return fallback;
|
|
1572
1655
|
const data = result.data || {};
|
|
1573
|
-
return data.detail || data.message || (typeof data === "string" ? data : fallback);
|
|
1656
|
+
return adapterErrorText(data.detail || data.message || (typeof data === "string" ? data : fallback));
|
|
1574
1657
|
}
|
|
1575
1658
|
|
|
1576
1659
|
function sleep(ms) {
|
|
@@ -1596,7 +1679,7 @@ function backfillSummaryLines(summary) {
|
|
|
1596
1679
|
|
|
1597
1680
|
if (sessions !== null && artifacts !== null && quests !== null) {
|
|
1598
1681
|
if (sessions + artifacts + quests === 0) {
|
|
1599
|
-
lines.push("
|
|
1682
|
+
lines.push("Hosted memory is already up to date for sessions, artifacts, and quests");
|
|
1600
1683
|
} else {
|
|
1601
1684
|
lines.push(`Added ${[
|
|
1602
1685
|
backfillCountLabel(sessions, "session", "sessions"),
|
|
@@ -1614,6 +1697,23 @@ function backfillSummaryLines(summary) {
|
|
|
1614
1697
|
return lines;
|
|
1615
1698
|
}
|
|
1616
1699
|
|
|
1700
|
+
function connectedOrganizationId(config, response) {
|
|
1701
|
+
const current = String(config.org_id || "");
|
|
1702
|
+
const returned = String(response?.org_id || "");
|
|
1703
|
+
if (!/^(?:org_[0-9a-f]{32}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/.test(returned) ||
|
|
1704
|
+
(current && !current.startsWith("legacy-org:") && returned !== current)) {
|
|
1705
|
+
die("Connected did not confirm this Egregore's existing identity. Local configuration is unchanged; update the hosted service before retrying.");
|
|
1706
|
+
}
|
|
1707
|
+
return returned || current;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
function hostedMemorySyncEnabled(config) {
|
|
1711
|
+
const override = process.env.EGREGORE_GRAPH_PROJECTION;
|
|
1712
|
+
if (["1", "true", "enabled"].includes(override)) return true;
|
|
1713
|
+
if (["0", "false", "disabled"].includes(override)) return false;
|
|
1714
|
+
return config.features?.graph_projection === true;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1617
1717
|
async function cmdConnect(args) {
|
|
1618
1718
|
const fresh = args.includes("--fresh");
|
|
1619
1719
|
const positional = args.filter((a) => !String(a).startsWith("--"));
|
|
@@ -1631,6 +1731,8 @@ async function cmdConnect(args) {
|
|
|
1631
1731
|
die(`GITHUB_TOKEN is missing for ${inst.slug}.\n Add it to ${path.join(inst.path, ".env")} and retry.`);
|
|
1632
1732
|
}
|
|
1633
1733
|
const activation = state.connected_activation || {};
|
|
1734
|
+
let expectedOrgId = cfg.org_id && !String(cfg.org_id).startsWith("legacy-org:")
|
|
1735
|
+
? cfg.org_id : activation.org_id || "";
|
|
1634
1736
|
if (cfg.mode === "connected" && activation.status === "connected") {
|
|
1635
1737
|
if (activation.intent_id) {
|
|
1636
1738
|
const repaired = await connectedApiRequest(
|
|
@@ -1644,8 +1746,10 @@ async function cmdConnect(args) {
|
|
|
1644
1746
|
`Connected is active, but its shared configuration could not be published: ${connectError(repaired, `HTTP ${repaired.status}`)}`,
|
|
1645
1747
|
);
|
|
1646
1748
|
}
|
|
1749
|
+
const orgId = connectedOrganizationId(cfg, repaired.data);
|
|
1647
1750
|
writeJsonFileAtomic(path.join(inst.path, "egregore.json"), {
|
|
1648
1751
|
...cfg,
|
|
1752
|
+
...(orgId ? { org_id: orgId } : {}),
|
|
1649
1753
|
mode: "connected",
|
|
1650
1754
|
api_url: repaired.data.api_url,
|
|
1651
1755
|
});
|
|
@@ -1701,16 +1805,18 @@ async function cmdConnect(args) {
|
|
|
1701
1805
|
// Local installs may have skipped platform registration (DO_NOT_TRACK
|
|
1702
1806
|
// gates it as telemetry). Connect requires it functionally, and choosing
|
|
1703
1807
|
// Connect is the consent — register on demand. Idempotent for members of
|
|
1704
|
-
// already-registered orgs
|
|
1705
|
-
// through to the billing-actor check on intent creation.
|
|
1808
|
+
// already-registered orgs. Identity conflicts must stop before checkout.
|
|
1706
1809
|
const registration = await connectedApiRequest(githubToken, "POST", "/api/org/register", {
|
|
1707
1810
|
org_name: cfg.org_name || inst.slug,
|
|
1708
1811
|
github_org: cfg.github_org || "",
|
|
1709
1812
|
slug: cfg.slug || inst.slug,
|
|
1813
|
+
...(cfg.org_id && !String(cfg.org_id).startsWith("legacy-org:") ? { org_id: cfg.org_id } : {}),
|
|
1814
|
+
repo_name: cfg.repo_name || "egregore",
|
|
1710
1815
|
});
|
|
1711
|
-
if (registration.status !== 200
|
|
1816
|
+
if (registration.status !== 200) {
|
|
1712
1817
|
die(`could not register this Egregore with the platform: ${connectError(registration, `HTTP ${registration.status}`)}`);
|
|
1713
1818
|
}
|
|
1819
|
+
expectedOrgId = connectedOrganizationId(cfg, registration.data);
|
|
1714
1820
|
console.log(` [1/5] ${DIM}Creating connection intent…${RESET}`);
|
|
1715
1821
|
const checkout = await connectedApiRequest(
|
|
1716
1822
|
githubToken,
|
|
@@ -1724,6 +1830,7 @@ async function cmdConnect(args) {
|
|
|
1724
1830
|
mode: cfg.mode || "local",
|
|
1725
1831
|
repo_name: cfg.repo_name || "",
|
|
1726
1832
|
managed_repo_count: Array.isArray(cfg.repos) ? cfg.repos.length : 0,
|
|
1833
|
+
hosted_memory_sync: hostedMemorySyncEnabled(cfg),
|
|
1727
1834
|
fresh,
|
|
1728
1835
|
},
|
|
1729
1836
|
},
|
|
@@ -1736,6 +1843,7 @@ async function cmdConnect(args) {
|
|
|
1736
1843
|
connectUrl = checkout.data.connect_url;
|
|
1737
1844
|
persistConnectState(inst, {
|
|
1738
1845
|
intent_id: intentId,
|
|
1846
|
+
org_id: expectedOrgId,
|
|
1739
1847
|
connect_ticket: checkout.data.connect_ticket,
|
|
1740
1848
|
connect_ticket_expires_at: checkout.data.connect_ticket_expires_at,
|
|
1741
1849
|
connect_url: connectUrl,
|
|
@@ -1743,6 +1851,17 @@ async function cmdConnect(args) {
|
|
|
1743
1851
|
});
|
|
1744
1852
|
console.log(` [1/5] ${GREEN}✓${RESET} Connection intent`);
|
|
1745
1853
|
} else {
|
|
1854
|
+
if (!expectedOrgId) {
|
|
1855
|
+
const registration = await connectedApiRequest(githubToken, "POST", "/api/org/register", {
|
|
1856
|
+
org_name: cfg.org_name || inst.slug, github_org: cfg.github_org || "",
|
|
1857
|
+
slug: cfg.slug || inst.slug, repo_name: cfg.repo_name || "egregore",
|
|
1858
|
+
});
|
|
1859
|
+
if (registration.status !== 200) {
|
|
1860
|
+
die(`could not confirm this Egregore's identity: ${connectError(registration, `HTTP ${registration.status}`)}`);
|
|
1861
|
+
}
|
|
1862
|
+
expectedOrgId = connectedOrganizationId(cfg, registration.data);
|
|
1863
|
+
persistConnectState(inst, { org_id: expectedOrgId });
|
|
1864
|
+
}
|
|
1746
1865
|
console.log(` [1/5] ${GREEN}✓${RESET} Resuming connection intent`);
|
|
1747
1866
|
}
|
|
1748
1867
|
|
|
@@ -1802,8 +1921,11 @@ async function cmdConnect(args) {
|
|
|
1802
1921
|
const configFile = path.join(inst.path, "egregore.json");
|
|
1803
1922
|
const envFile = path.join(inst.path, ".env");
|
|
1804
1923
|
const currentConfig = readJsonFile(configFile);
|
|
1924
|
+
const orgId = connectedOrganizationId({ ...currentConfig, org_id: expectedOrgId || currentConfig.org_id }, claim.data);
|
|
1925
|
+
const syncEnabled = hostedMemorySyncEnabled(currentConfig);
|
|
1805
1926
|
writeJsonFileAtomic(configFile, {
|
|
1806
1927
|
...currentConfig,
|
|
1928
|
+
...(orgId ? { org_id: orgId } : {}),
|
|
1807
1929
|
mode: "connected",
|
|
1808
1930
|
api_url: claim.data.api_url,
|
|
1809
1931
|
});
|
|
@@ -1814,19 +1936,22 @@ async function cmdConnect(args) {
|
|
|
1814
1936
|
status: "backfilling",
|
|
1815
1937
|
activation_protocol: claim.data.activation_protocol,
|
|
1816
1938
|
});
|
|
1817
|
-
console.log(` [4/5] ${GREEN}✓${RESET}
|
|
1939
|
+
console.log(` [4/5] ${GREEN}✓${RESET} Hosted access and organization ready`);
|
|
1818
1940
|
|
|
1819
1941
|
let backfillSummary = { replayed: true };
|
|
1820
1942
|
if (fresh) {
|
|
1821
1943
|
// Fresh install — no existing memory to project; skip the replay entirely.
|
|
1822
|
-
console.log(` [5/5] ${GREEN}✓${RESET} Fresh instance —
|
|
1944
|
+
console.log(` [5/5] ${GREEN}✓${RESET} Fresh instance — no existing memory to sync`);
|
|
1823
1945
|
backfillSummary = { fresh: true, replayed: false };
|
|
1946
|
+
} else if (!syncEnabled) {
|
|
1947
|
+
backfillSummary = { replayed: false, reason: "local_memory" };
|
|
1948
|
+
console.log(` [5/5] ${GREEN}✓${RESET} Memory and retrieval remain local`);
|
|
1824
1949
|
} else {
|
|
1825
1950
|
const syncScript = path.join(inst.path, "bin", "sync-graph.sh");
|
|
1826
1951
|
if (!fs.existsSync(syncScript)) {
|
|
1827
|
-
die("
|
|
1952
|
+
die("The memory sync adapter is missing. Update the installed Egregore version, then run egregore connect again.");
|
|
1828
1953
|
}
|
|
1829
|
-
console.log(` [5/5] ${CYAN}◦${RESET}
|
|
1954
|
+
console.log(` [5/5] ${CYAN}◦${RESET} Syncing existing memory with hosted services…`);
|
|
1830
1955
|
console.log(` ${DIM}Scanning sessions, artifacts, quests, and ingest history${RESET}`);
|
|
1831
1956
|
const sync = spawnSync("bash", [syncScript], {
|
|
1832
1957
|
cwd: inst.path,
|
|
@@ -1835,8 +1960,8 @@ async function cmdConnect(args) {
|
|
|
1835
1960
|
timeout: 10 * 60 * 1000,
|
|
1836
1961
|
});
|
|
1837
1962
|
if (sync.status !== 0) {
|
|
1838
|
-
const detail = (sync.stderr || sync.stdout || "
|
|
1839
|
-
die(`Connected is configured, but
|
|
1963
|
+
const detail = adapterErrorText(sync.stderr || sync.stdout || "memory sync failed").trim();
|
|
1964
|
+
die(`Connected is configured, but memory sync did not finish.\n ${detail}\n Run egregore connect ${inst.slug} to retry; existing data is unchanged.`);
|
|
1840
1965
|
}
|
|
1841
1966
|
try { backfillSummary = JSON.parse((sync.stdout || "").trim()); } catch {}
|
|
1842
1967
|
}
|
|
@@ -1853,15 +1978,15 @@ async function cmdConnect(args) {
|
|
|
1853
1978
|
await sleep(250 * (attempt + 1));
|
|
1854
1979
|
}
|
|
1855
1980
|
if (complete.status !== 200) {
|
|
1856
|
-
die(`
|
|
1981
|
+
die(`Hosted access is configured, but activation could not be finalized: ${connectError(complete, `HTTP ${complete.status}`)}`);
|
|
1857
1982
|
}
|
|
1858
1983
|
persistConnectState(inst, {
|
|
1859
1984
|
status: "connected",
|
|
1860
1985
|
connected_at: new Date().toISOString(),
|
|
1861
1986
|
backfill_summary: backfillSummary,
|
|
1862
1987
|
});
|
|
1863
|
-
if (!fresh) {
|
|
1864
|
-
console.log(` [5/5] ${GREEN}✓${RESET} Existing memory
|
|
1988
|
+
if (!fresh && syncEnabled) {
|
|
1989
|
+
console.log(` [5/5] ${GREEN}✓${RESET} Existing memory synced with hosted services`);
|
|
1865
1990
|
for (const line of backfillSummaryLines(backfillSummary)) {
|
|
1866
1991
|
console.log(` ${DIM}${line}${RESET}`);
|
|
1867
1992
|
}
|
|
@@ -2295,43 +2420,23 @@ function settingsDump(inst) {
|
|
|
2295
2420
|
// explicit verbs — one source of truth, no JS reimplementation.
|
|
2296
2421
|
|
|
2297
2422
|
const RUNTIME_MVP_VERSION_RE = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)-runtime-mvp\.(0|[1-9]\d*)$/;
|
|
2298
|
-
const
|
|
2299
|
-
|| "https://registry.npmjs.org/create-egregore/runtime-mvp";
|
|
2423
|
+
const RUNTIME_STABLE_VERSION_RE = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
|
|
2300
2424
|
|
|
2301
|
-
function
|
|
2302
|
-
return
|
|
2425
|
+
function isRuntimeCandidate(version) {
|
|
2426
|
+
return typeof version === "string"
|
|
2427
|
+
&& (RUNTIME_MVP_VERSION_RE.test(version) || RUNTIME_STABLE_VERSION_RE.test(version))
|
|
2428
|
+
&& parseReleaseVersion(version).parts.every(Number.isSafeInteger)
|
|
2429
|
+
&& compareReleaseVersions(version, "0.21.0-runtime-mvp.0") >= 0;
|
|
2303
2430
|
}
|
|
2304
2431
|
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
// connection is for. Mirror the shell gate (bin/search.sh): stable org
|
|
2308
|
-
// identity composed with the main installation path keys the activation
|
|
2309
|
-
// record; only a real record flips the wording.
|
|
2310
|
-
function upgradedGraphRetrievalOff(instPath) {
|
|
2311
|
-
try {
|
|
2312
|
-
const cfg = JSON.parse(fs.readFileSync(path.join(instPath, "egregore.json"), "utf-8"));
|
|
2313
|
-
const orgId = String(cfg.org_id || "").trim();
|
|
2314
|
-
if (!orgId) return false;
|
|
2315
|
-
let main = instPath;
|
|
2316
|
-
const gitFile = path.join(instPath, ".git");
|
|
2317
|
-
if (fs.existsSync(gitFile) && fs.statSync(gitFile).isFile()) {
|
|
2318
|
-
const m = /^gitdir: (.*)$/m.exec(fs.readFileSync(gitFile, "utf-8"));
|
|
2319
|
-
if (m && m[1].includes("/.git/worktrees/")) main = m[1].split("/.git/worktrees/")[0];
|
|
2320
|
-
}
|
|
2321
|
-
main = fs.realpathSync(main);
|
|
2322
|
-
const key = crypto.createHash("sha256").update(`${orgId}|${main}`).digest("hex").slice(0, 16);
|
|
2323
|
-
const base = process.env.EGREGORE_UPGRADE_ROOT || path.join(os.homedir(), ".egregore", "runtime", "upgrade");
|
|
2324
|
-
const record = JSON.parse(fs.readFileSync(path.join(base, key, "active.json"), "utf-8"));
|
|
2325
|
-
return record.retrieval === "runtime-qmd";
|
|
2326
|
-
} catch {
|
|
2327
|
-
return false;
|
|
2328
|
-
}
|
|
2432
|
+
function upgradeScriptPath(inst) {
|
|
2433
|
+
return path.join(inst.path, "bin", "runtime-upgrade.sh");
|
|
2329
2434
|
}
|
|
2330
2435
|
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2436
|
+
// Connected describes the hosted service relationship. Retrieval health is
|
|
2437
|
+
// shown separately in Runtime settings, including on fresh installations.
|
|
2438
|
+
function connectedModeSuffix() {
|
|
2439
|
+
return "· hosted services";
|
|
2335
2440
|
}
|
|
2336
2441
|
|
|
2337
2442
|
// An instance that predates the bridge (0.20.1 and earlier) is still
|
|
@@ -2357,8 +2462,23 @@ function packagedUpgradeScript() {
|
|
|
2357
2462
|
|
|
2358
2463
|
function resolveUpgradeBridge(inst) {
|
|
2359
2464
|
const own = upgradeScriptPath(inst);
|
|
2360
|
-
if (fs.existsSync(own)) return { script: own, env: {} };
|
|
2361
2465
|
const packaged = packagedUpgradeScript();
|
|
2466
|
+
if (fs.existsSync(own)) {
|
|
2467
|
+
// Older MVP engines reject stable versions. Probe without identity setup
|
|
2468
|
+
// or state writes; use the launcher's engine for the entire transaction
|
|
2469
|
+
// when the installed engine predates this protocol advertisement.
|
|
2470
|
+
if (!packaged || !fs.existsSync(packaged)) return { script: own, env: { EGREGORE_INSTANCE_ROOT: inst.path } };
|
|
2471
|
+
try {
|
|
2472
|
+
const probe = spawnSync("bash", upgradeBridgeArgs({ script: own }, ["capabilities"]), {
|
|
2473
|
+
cwd: inst.path, encoding: "utf-8", timeout: 2000,
|
|
2474
|
+
env: { ...process.env, EGREGORE_INSTANCE_ROOT: inst.path },
|
|
2475
|
+
});
|
|
2476
|
+
const capability = probe.status === 0 ? JSON.parse(probe.stdout) : null;
|
|
2477
|
+
if (capability?.upgrade_protocol === 1 && capability.stable_candidates === true) {
|
|
2478
|
+
return { script: own, env: { EGREGORE_INSTANCE_ROOT: inst.path } };
|
|
2479
|
+
}
|
|
2480
|
+
} catch { /* Missing/legacy capability response uses the packaged engine. */ }
|
|
2481
|
+
}
|
|
2362
2482
|
if (packaged && fs.existsSync(packaged)) {
|
|
2363
2483
|
return { script: packaged, env: { EGREGORE_INSTANCE_ROOT: inst.path } };
|
|
2364
2484
|
}
|
|
@@ -2449,8 +2569,8 @@ function formatPrivacyLines(snapshot) {
|
|
|
2449
2569
|
lines.push(`Personal read roots: ${personalRoots.length ? personalRoots.join(", ") : "none"}`);
|
|
2450
2570
|
lines.push(
|
|
2451
2571
|
snapshot.graph_retrieval === "not-used-by-this-runtime"
|
|
2452
|
-
? "
|
|
2453
|
-
: "
|
|
2572
|
+
? "Search: local to this Egregore"
|
|
2573
|
+
: "Search: check Runtime status",
|
|
2454
2574
|
);
|
|
2455
2575
|
return lines;
|
|
2456
2576
|
}
|
|
@@ -2569,14 +2689,20 @@ function retrievalHealthAsync(inst, cb) {
|
|
|
2569
2689
|
} catch { cb(null); }
|
|
2570
2690
|
}
|
|
2571
2691
|
|
|
2572
|
-
//
|
|
2573
|
-
//
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2692
|
+
// Stable is the default even for an existing MVP installation. Testing the
|
|
2693
|
+
// prerelease channel requires an explicit selection; dist-tags never reach init.
|
|
2694
|
+
async function fetchRuntimeCandidate() {
|
|
2695
|
+
const channel = process.env.EGREGORE_RUNTIME_CHANNEL || "stable";
|
|
2696
|
+
if (!["stable", "runtime-mvp"].includes(channel)) return null;
|
|
2697
|
+
const mvp = channel === "runtime-mvp";
|
|
2698
|
+
const accepts = (version) => isRuntimeCandidate(version)
|
|
2699
|
+
&& (mvp ? RUNTIME_MVP_VERSION_RE : RUNTIME_STABLE_VERSION_RE).test(version);
|
|
2700
|
+
const seeded = process.env[mvp ? "EGREGORE_RUNTIME_MVP_CANDIDATE" : "EGREGORE_RUNTIME_STABLE_CANDIDATE"];
|
|
2701
|
+
if (seeded !== undefined) return accepts(seeded) ? seeded : null;
|
|
2702
|
+
const registryUrl = process.env[mvp ? "EGREGORE_RUNTIME_MVP_REGISTRY_URL" : "EGREGORE_RUNTIME_STABLE_REGISTRY_URL"]
|
|
2703
|
+
|| `https://registry.npmjs.org/create-egregore/${mvp ? "runtime-mvp" : "latest"}`;
|
|
2578
2704
|
try {
|
|
2579
|
-
const url = new URL(
|
|
2705
|
+
const url = new URL(registryUrl);
|
|
2580
2706
|
const result = await requestJson({
|
|
2581
2707
|
hostname: url.hostname,
|
|
2582
2708
|
port: url.port || undefined,
|
|
@@ -2588,7 +2714,7 @@ async function fetchRuntimeMvpCandidate() {
|
|
|
2588
2714
|
headers: { Accept: "application/json" },
|
|
2589
2715
|
});
|
|
2590
2716
|
const version = result.status === 200 && result.data && result.data.version;
|
|
2591
|
-
return
|
|
2717
|
+
return accepts(version) ? version : null;
|
|
2592
2718
|
} catch {
|
|
2593
2719
|
return null;
|
|
2594
2720
|
}
|
|
@@ -2599,6 +2725,7 @@ async function fetchRuntimeMvpCandidate() {
|
|
|
2599
2725
|
// staged must not dead-end into a CLI instruction referencing a tarball the
|
|
2600
2726
|
// user does not have — the registry has it, digest-verified.
|
|
2601
2727
|
function fetchCandidateTarball(version, cb) {
|
|
2728
|
+
if (!isRuntimeCandidate(version)) return cb(new Error("an exact supported Runtime version is required"));
|
|
2602
2729
|
const metaUrl = new URL(`https://registry.npmjs.org/${PUBLIC_NPX_PACKAGE}/${version}`);
|
|
2603
2730
|
requestJson({
|
|
2604
2731
|
hostname: metaUrl.hostname,
|
|
@@ -2609,7 +2736,12 @@ function fetchCandidateTarball(version, cb) {
|
|
|
2609
2736
|
headers: { Accept: "application/json" },
|
|
2610
2737
|
}).then((meta) => {
|
|
2611
2738
|
const dist = meta && meta.status === 200 && meta.data && meta.data.dist;
|
|
2612
|
-
if (!dist || !dist.tarball
|
|
2739
|
+
if (!dist || !dist.tarball || meta.data.name !== PUBLIC_NPX_PACKAGE || meta.data.version !== version) {
|
|
2740
|
+
return cb(new Error(`candidate ${version} not found on the registry`));
|
|
2741
|
+
}
|
|
2742
|
+
if (typeof dist.integrity !== "string" || !/^sha512-[A-Za-z0-9+/]{86}==$/.test(dist.integrity)) {
|
|
2743
|
+
return cb(new Error("candidate sha512 integrity is missing or invalid — refusing to stage"));
|
|
2744
|
+
}
|
|
2613
2745
|
const dest = path.join(os.tmpdir(), `egregore-candidate-${version}.tgz`);
|
|
2614
2746
|
const fetchTarball = (url, redirects) => {
|
|
2615
2747
|
https.get(url, { headers: { "User-Agent": "egregore-launcher" } }, (res) => {
|
|
@@ -2660,7 +2792,7 @@ const UPGRADE_STATUS_LABEL = {
|
|
|
2660
2792
|
// transaction state, not the condition the user needs to see.
|
|
2661
2793
|
function runtimeUpdateAvailable(st, candidate) {
|
|
2662
2794
|
return st?.status === "active"
|
|
2663
|
-
&&
|
|
2795
|
+
&& isRuntimeCandidate(candidate)
|
|
2664
2796
|
&& compareReleaseVersions(candidate, st.active_version) > 0;
|
|
2665
2797
|
}
|
|
2666
2798
|
|
|
@@ -2716,14 +2848,14 @@ function formatUpgradeLines(inst, st, { candidate = "", retrieval = null } = {})
|
|
|
2716
2848
|
// A recorded failure only needs attention while the transaction is stuck
|
|
2717
2849
|
// on it; once a later prepare succeeds the line would contradict "ready".
|
|
2718
2850
|
if (d.failure && d.failure.message && (["failed", "interrupted", "unavailable"].includes(d.status))) {
|
|
2719
|
-
lines.push(`Attention: ${d.failure.message}`);
|
|
2851
|
+
lines.push(`Attention: ${adapterErrorText(d.failure.message)}`);
|
|
2720
2852
|
}
|
|
2721
2853
|
if (d.rollback_version && d.status !== "none") lines.push(`Rollback target: ${d.rollback_version}`);
|
|
2722
2854
|
const ts = d.team_sync;
|
|
2723
2855
|
if (ts && ts.label) lines.push(`Team memory: ${ts.label}`);
|
|
2724
2856
|
if (d.status === "active") {
|
|
2725
2857
|
lines.push("Organizational retrieval: Runtime/QMD");
|
|
2726
|
-
lines.push("
|
|
2858
|
+
lines.push("Search: local to this Egregore");
|
|
2727
2859
|
} else if (d.status !== "none") {
|
|
2728
2860
|
lines.push("Previous Runtime remains active until activation.");
|
|
2729
2861
|
}
|
|
@@ -2752,10 +2884,10 @@ function formatUpgradeLines(inst, st, { candidate = "", retrieval = null } = {})
|
|
|
2752
2884
|
parts.push(`${upgradeElapsed(d)} elapsed`);
|
|
2753
2885
|
detail = ` — ${parts.join(" · ")}`;
|
|
2754
2886
|
} else if (stage.state === "done" && stage.detail) {
|
|
2755
|
-
detail = ` — ${stage.detail}`;
|
|
2887
|
+
detail = ` — ${adapterErrorText(stage.detail)}`;
|
|
2756
2888
|
}
|
|
2757
2889
|
} else if (stage.state === "failed" && stage.detail) {
|
|
2758
|
-
detail = ` — ${stage.detail}`;
|
|
2890
|
+
detail = ` — ${adapterErrorText(stage.detail)}`;
|
|
2759
2891
|
}
|
|
2760
2892
|
lines.push(` ${glyph} ${stage.label}${detail}`);
|
|
2761
2893
|
}
|
|
@@ -2775,7 +2907,7 @@ const UPGRADE_CHANGES = [
|
|
|
2775
2907
|
"Runtime version",
|
|
2776
2908
|
"Organizational retrieval moves to Runtime/QMD",
|
|
2777
2909
|
"Keyword and meaning search become owned by this Egregore",
|
|
2778
|
-
"
|
|
2910
|
+
"Previous search is replaced after activation (kept for rollback)",
|
|
2779
2911
|
"Cross-session continuity uses the new Runtime",
|
|
2780
2912
|
"Readiness and synchronization become visible here in Settings",
|
|
2781
2913
|
];
|
|
@@ -2802,22 +2934,28 @@ async function cmdSettingsRuntime(inst, args) {
|
|
|
2802
2934
|
if (action === "init") {
|
|
2803
2935
|
const version = (args[1] || "").trim();
|
|
2804
2936
|
const tarball = (args[2] || "").trim();
|
|
2805
|
-
if (!
|
|
2806
|
-
process.stderr.write("Runtime update needs an exact
|
|
2937
|
+
if (!isRuntimeCandidate(version)) {
|
|
2938
|
+
process.stderr.write("Runtime update needs an exact version like 0.21.0 or 0.21.0-runtime-mvp.1.\n");
|
|
2807
2939
|
process.exitCode = 1; return;
|
|
2808
2940
|
}
|
|
2809
2941
|
if (!tarball || !fs.existsSync(tarball)) {
|
|
2810
2942
|
process.stderr.write("Runtime update installs actual packaged bytes: egregore settings <slug> runtime init <version> <candidate.tgz>\n");
|
|
2811
2943
|
process.exitCode = 1; return;
|
|
2812
2944
|
}
|
|
2945
|
+
const current = upgradeStatus(inst);
|
|
2946
|
+
if (!current || current.status === "unavailable" || (current.active_version && (!parseReleaseVersion(current.active_version)
|
|
2947
|
+
|| compareReleaseVersions(version, current.active_version) <= 0))) {
|
|
2948
|
+
process.stderr.write("Runtime update requires a version newer than the verified active version; use rollback for recovery.\n");
|
|
2949
|
+
process.exitCode = 1; return;
|
|
2950
|
+
}
|
|
2813
2951
|
const r = runUpgrade(inst, ["init", "--candidate", version, "--tarball", path.resolve(tarball)]);
|
|
2814
|
-
if (r.status !== 0) { process.stderr.write(r.stderr || "could not stage the candidate\n"); process.exitCode = r.status; return; }
|
|
2952
|
+
if (r.status !== 0) { process.stderr.write(adapterErrorText(r.stderr || "could not stage the candidate\n")); process.exitCode = r.status; return; }
|
|
2815
2953
|
emit(upgradeStatus(inst) || null);
|
|
2816
2954
|
return;
|
|
2817
2955
|
}
|
|
2818
2956
|
if (["prepare", "activate", "cancel", "rollback"].includes(action)) {
|
|
2819
2957
|
const r = runUpgrade(inst, [action]);
|
|
2820
|
-
if (r.status !== 0) { process.stderr.write(r.stderr || `${action} failed\n`); process.exitCode = r.status; return; }
|
|
2958
|
+
if (r.status !== 0) { process.stderr.write(adapterErrorText(r.stderr || `${action} failed\n`)); process.exitCode = r.status; return; }
|
|
2821
2959
|
const st = upgradeStatus(inst);
|
|
2822
2960
|
emit(st);
|
|
2823
2961
|
if (action === "activate" && st && st.status === "active") {
|
|
@@ -3925,17 +4063,17 @@ async function browser(args = {}) {
|
|
|
3925
4063
|
const r = runUpgrade(inst, ["prepare"]);
|
|
3926
4064
|
state.upgradeNotice = r.status === 0
|
|
3927
4065
|
? `${DIM}Preparing in the background — safe to leave this screen.${RESET}`
|
|
3928
|
-
: `${YELLOW}${(r.stderr || "prepare failed").trim().split("\n")[0]}${RESET}`;
|
|
4066
|
+
: `${YELLOW}${adapterErrorText(r.stderr || "prepare failed").trim().split("\n")[0]}${RESET}`;
|
|
3929
4067
|
} else if (mode === "confirm-activate") {
|
|
3930
4068
|
const r = runUpgrade(inst, ["activate"]);
|
|
3931
4069
|
state.upgradeNotice = r.status === 0
|
|
3932
4070
|
? `${GREEN}Update complete. Start a session to work on the new Runtime.${RESET}`
|
|
3933
|
-
: `${YELLOW}${(r.stderr || "activation refused — a gate has not passed").trim().split("\n")[0]}${RESET}`;
|
|
4071
|
+
: `${YELLOW}${adapterErrorText(r.stderr || "activation refused — a gate has not passed").trim().split("\n")[0]}${RESET}`;
|
|
3934
4072
|
} else if (mode === "confirm-rollback") {
|
|
3935
4073
|
const r = runUpgrade(inst, ["rollback"]);
|
|
3936
4074
|
state.upgradeNotice = r.status === 0
|
|
3937
4075
|
? `${DIM}Rolled back. The previous Runtime is active again.${RESET}`
|
|
3938
|
-
: `${YELLOW}${(r.stderr || "rollback failed").trim().split("\n")[0]}${RESET}`;
|
|
4076
|
+
: `${YELLOW}${adapterErrorText(r.stderr || "rollback failed").trim().split("\n")[0]}${RESET}`;
|
|
3939
4077
|
} else if (mode === "confirm-cancel") {
|
|
3940
4078
|
runUpgrade(inst, ["cancel"]);
|
|
3941
4079
|
state.upgradeNotice = `${DIM}Preparation cancelled. The current Runtime was never touched.${RESET}`;
|
|
@@ -3958,8 +4096,10 @@ async function browser(args = {}) {
|
|
|
3958
4096
|
&& state.upgradeData.candidate_version;
|
|
3959
4097
|
if (!staged) {
|
|
3960
4098
|
const candidate = state.upgradeCandidate;
|
|
3961
|
-
if (!candidate
|
|
3962
|
-
|
|
4099
|
+
if (!candidate || (state.upgradeData?.active_version
|
|
4100
|
+
&& (!parseReleaseVersion(state.upgradeData.active_version)
|
|
4101
|
+
|| compareReleaseVersions(candidate, state.upgradeData.active_version) <= 0))) {
|
|
4102
|
+
state.upgradeNotice = `${DIM}No published candidate found. Stage one manually: egregore settings ${state.upgradeInst.slug} runtime init <version> <candidate.tgz>${RESET}`;
|
|
3963
4103
|
render(); return;
|
|
3964
4104
|
}
|
|
3965
4105
|
if (state.upgradeFetching) { render(); return; }
|
|
@@ -3976,7 +4116,7 @@ async function browser(args = {}) {
|
|
|
3976
4116
|
}
|
|
3977
4117
|
const r = runUpgrade(inst, ["init", "--candidate", candidate, "--tarball", tgz]);
|
|
3978
4118
|
if (r === null || r.status !== 0) {
|
|
3979
|
-
const detail = ((r && (r.stderr || r.stdout)) || "staging failed").trim().split("\n")[0];
|
|
4119
|
+
const detail = adapterErrorText((r && (r.stderr || r.stdout)) || "staging failed").trim().split("\n")[0];
|
|
3980
4120
|
state.upgradeNotice = `${YELLOW}${detail}${RESET}`;
|
|
3981
4121
|
render(); return;
|
|
3982
4122
|
}
|
|
@@ -4276,7 +4416,7 @@ async function browser(args = {}) {
|
|
|
4276
4416
|
});
|
|
4277
4417
|
refreshUpgrade();
|
|
4278
4418
|
if (!state.upgradeCandidate) {
|
|
4279
|
-
|
|
4419
|
+
fetchRuntimeCandidate().then((v) => {
|
|
4280
4420
|
state.upgradeCandidate = v || "";
|
|
4281
4421
|
if (state.upgradeInst) render();
|
|
4282
4422
|
});
|
|
@@ -4570,7 +4710,7 @@ async function browser(args = {}) {
|
|
|
4570
4710
|
if (state.settingsInst === pick && !state.upgradeInst) render();
|
|
4571
4711
|
});
|
|
4572
4712
|
if (!state.upgradeCandidate) {
|
|
4573
|
-
|
|
4713
|
+
fetchRuntimeCandidate().then((v) => {
|
|
4574
4714
|
state.upgradeCandidate = v || "";
|
|
4575
4715
|
if (state.settingsInst === pick && !state.upgradeInst) render();
|
|
4576
4716
|
});
|