create-egregore 0.20.2 → 0.21.0-runtime-mvp.1
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 +1011 -16
- package/bin/cli.js +11 -0
- package/lib/claude-runtime.js +192 -0
- package/lib/local.js +38 -31
- package/lib/pi-runtime.js +1 -0
- package/lib/prime-runtime.js +1 -0
- package/lib/runtime-identity.js +146 -0
- package/lib/setup.js +116 -17
- package/package.json +10 -6
- package/runtime/claude/.claude/context/commit-format.md +110 -0
- package/runtime/claude/.claude/context/git-language.md +46 -0
- package/runtime/claude/.claude/context/notification-consent.md +66 -0
- package/runtime/claude/.claude/context/pr-format.md +67 -0
- package/runtime/claude/.claude/context/telemetry.md +133 -0
- package/runtime/claude/.claude/hooks/boundary-check.sh +333 -0
- package/runtime/claude/.claude/hooks/branch-guard.sh +231 -0
- package/runtime/claude/.claude/hooks/card-context.sh +38 -0
- package/runtime/claude/.claude/hooks/emissary-detect.sh +53 -0
- package/runtime/claude/.claude/hooks/memory-refresh.sh +67 -0
- package/runtime/claude/.claude/hooks/onboarding-guard.sh +86 -0
- package/runtime/claude/.claude/hooks/retrieval-context.sh +43 -0
- package/runtime/claude/.claude/rules/voice-bedrock.md +73 -0
- package/runtime/claude/.claude/settings.json +131 -0
- package/runtime/claude/.claude/skills/activity/SKILL.md +68 -0
- package/runtime/claude/.claude/skills/announce/SKILL.md +54 -0
- package/runtime/claude/.claude/skills/archive/SKILL.md +71 -0
- package/runtime/claude/.claude/skills/branch/SKILL.md +147 -0
- package/runtime/claude/.claude/skills/checkup/SKILL.md +159 -0
- package/runtime/claude/.claude/skills/commit/SKILL.md +103 -0
- package/runtime/claude/.claude/skills/contribute/SKILL.md +343 -0
- package/runtime/claude/.claude/skills/create-skill/SKILL.md +135 -0
- package/runtime/claude/.claude/skills/dark-mode/SKILL.md +410 -0
- package/runtime/claude/.claude/skills/dashboard/SKILL.md +43 -0
- package/runtime/claude/.claude/skills/deep-reflect/REPORT.md +140 -0
- package/runtime/claude/.claude/skills/deep-reflect/RESEARCH.md +132 -0
- package/runtime/claude/.claude/skills/deep-reflect/ROLES.md +104 -0
- package/runtime/claude/.claude/skills/deep-reflect/SKILL.md +170 -0
- package/runtime/claude/.claude/skills/delete-user/SKILL.md +150 -0
- package/runtime/claude/.claude/skills/emissary/SKILL.md +220 -0
- package/runtime/claude/.claude/skills/handoff/SKILL.md +124 -0
- package/runtime/claude/.claude/skills/harvest/AUDIT.md +546 -0
- package/runtime/claude/.claude/skills/harvest/FORMAT.md +436 -0
- package/runtime/claude/.claude/skills/harvest/PROCESS.md +395 -0
- package/runtime/claude/.claude/skills/harvest/QUESTION_PALETTE.md +76 -0
- package/runtime/claude/.claude/skills/harvest/SKILL.md +100 -0
- package/runtime/claude/.claude/skills/ingest/SKILL.md +112 -0
- package/runtime/claude/.claude/skills/ingest-corpus/SKILL.md +187 -0
- package/runtime/claude/.claude/skills/ingest-notion/SKILL.md +214 -0
- package/runtime/claude/.claude/skills/ingest-user-interview/SKILL.md +65 -0
- package/runtime/claude/.claude/skills/ingest-user-interview/references/analysis-contract.md +125 -0
- package/runtime/claude/.claude/skills/invite/SKILL.md +111 -0
- package/runtime/claude/.claude/skills/issue/SKILL.md +104 -0
- package/runtime/claude/.claude/skills/me/SKILL.md +81 -0
- package/runtime/claude/.claude/skills/meeting/SKILL.md +76 -0
- package/runtime/claude/.claude/skills/meeting/references/analysis-contract.md +102 -0
- package/runtime/claude/.claude/skills/note/SKILL.md +71 -0
- package/runtime/claude/.claude/skills/notion-connect/SKILL.md +124 -0
- package/runtime/claude/.claude/skills/onboarding/SKILL.md +159 -0
- package/runtime/claude/.claude/skills/pr/SKILL.md +85 -0
- package/runtime/claude/.claude/skills/pull/SKILL.md +79 -0
- package/runtime/claude/.claude/skills/push/SKILL.md +47 -0
- package/runtime/claude/.claude/skills/quest/SKILL.md +121 -0
- package/runtime/claude/.claude/skills/reflect/SKILL.md +69 -0
- package/runtime/claude/.claude/skills/review-pr/SKILL.md +276 -0
- package/runtime/claude/.claude/skills/save/SKILL.md +92 -0
- package/runtime/claude/.claude/skills/slack-connect/SKILL.md +148 -0
- package/runtime/claude/.claude/skills/summon/SKILL.md +240 -0
- package/runtime/claude/.claude/skills/sync-repos/SKILL.md +82 -0
- package/runtime/claude/.claude/skills/teams-connect/SKILL.md +216 -0
- package/runtime/claude/.claude/skills/telegram-connect/SKILL.md +110 -0
- package/runtime/claude/.claude/skills/telemetry/SKILL.md +117 -0
- package/runtime/claude/.claude/skills/test/SKILL.md +87 -0
- package/runtime/claude/.claude/skills/the-spiral/SKILL.md +492 -0
- package/runtime/claude/.claude/skills/tui-design/SKILL.md +188 -0
- package/runtime/claude/.claude/skills/tutorial/SKILL.md +100 -0
- package/runtime/claude/.claude/skills/update/SKILL.md +265 -0
- package/runtime/claude/.claude/skills/view/SKILL.md +393 -0
- package/runtime/claude/.claude/skills/view/compose-scaffold.html +221 -0
- package/runtime/claude/.claude/skills/visual-explain/SKILL.md +132 -0
- package/runtime/claude/.claude/skills/wrap/SKILL.md +98 -0
- package/runtime/claude/CLAUDE.md +447 -0
- package/runtime/claude/bin/activity-action.sh +92 -0
- package/runtime/claude/bin/activity-data.sh +17 -0
- package/runtime/claude/bin/agent.sh +783 -0
- package/runtime/claude/bin/artifact-register.sh +164 -0
- package/runtime/claude/bin/artifact-writeback.sh +53 -0
- package/runtime/claude/bin/artifacts.sh +288 -0
- package/runtime/claude/bin/attendant.sh +707 -0
- package/runtime/claude/bin/autosave.sh +112 -0
- package/runtime/claude/bin/boundary.sh +253 -0
- package/runtime/claude/bin/build-sealed-dataroom.mjs +722 -0
- package/runtime/claude/bin/capture-reconcile.sh +69 -0
- package/runtime/claude/bin/capture-run.sh +357 -0
- package/runtime/claude/bin/codex-install-skills.sh +78 -0
- package/runtime/claude/bin/codex-render-spec.mjs +462 -0
- package/runtime/claude/bin/codex-session-start.sh +275 -0
- package/runtime/claude/bin/codex-skill-render.mjs +349 -0
- package/runtime/claude/bin/codex-sync-skills.sh +237 -0
- package/runtime/claude/bin/connect-refresh.sh +33 -0
- package/runtime/claude/bin/contribute-guard.sh +79 -0
- package/runtime/claude/bin/corpus_map.py +806 -0
- package/runtime/claude/bin/corpus_survey.py +304 -0
- package/runtime/claude/bin/dashboard-data.sh +18 -0
- package/runtime/claude/bin/github-auth.sh +121 -0
- package/runtime/claude/bin/graph-batch.sh +86 -0
- package/runtime/claude/bin/graph-op.sh +1106 -0
- package/runtime/claude/bin/graph-projection.sh +54 -0
- package/runtime/claude/bin/graph-wal.sh +242 -0
- package/runtime/claude/bin/graph.sh +267 -0
- package/runtime/claude/bin/handoff-lifecycle-job.sh +146 -0
- package/runtime/claude/bin/handoff-lifecycle.sh +280 -0
- package/runtime/claude/bin/handoff-pr-backfill.sh +86 -0
- package/runtime/claude/bin/handoff-preview.sh +169 -0
- package/runtime/claude/bin/handoff-run.sh +692 -0
- package/runtime/claude/bin/handoff-save-egregore.sh +224 -0
- package/runtime/claude/bin/index-handoff.sh +322 -0
- package/runtime/claude/bin/ingest-graph.sh +86 -0
- package/runtime/claude/bin/ingest-item.sh +10 -0
- package/runtime/claude/bin/ingest-surface.html +495 -0
- package/runtime/claude/bin/ingest.py +1011 -0
- package/runtime/claude/bin/ingest.sh +308 -0
- package/runtime/claude/bin/ingest_graph.py +856 -0
- package/runtime/claude/bin/ingest_surface.py +544 -0
- package/runtime/claude/bin/invite.sh +6 -0
- package/runtime/claude/bin/issue.sh +10 -0
- package/runtime/claude/bin/knowledge.sh +10 -0
- package/runtime/claude/bin/lib/artifact-id.sh +46 -0
- package/runtime/claude/bin/lib/config.sh +136 -0
- package/runtime/claude/bin/lib/context.sh +642 -0
- package/runtime/claude/bin/lib/dashboard-artifact.sh +242 -0
- package/runtime/claude/bin/lib/ensure-develop.sh +183 -0
- package/runtime/claude/bin/lib/git-message.sh +37 -0
- package/runtime/claude/bin/lib/git-sync.sh +494 -0
- package/runtime/claude/bin/lib/greeting.sh +548 -0
- package/runtime/claude/bin/lib/handoff-meta.sh +97 -0
- package/runtime/claude/bin/lib/hash.sh +13 -0
- package/runtime/claude/bin/lib/identity.sh +213 -0
- package/runtime/claude/bin/lib/metrics.sh +374 -0
- package/runtime/claude/bin/lib/noncode.sh +31 -0
- package/runtime/claude/bin/lib/permissions.sh +106 -0
- package/runtime/claude/bin/lib/time.sh +56 -0
- package/runtime/claude/bin/lib/worktree-links.sh +85 -0
- package/runtime/claude/bin/node-run.sh +42 -0
- package/runtime/claude/bin/notification.sh +6 -0
- package/runtime/claude/bin/notify.sh +636 -0
- package/runtime/claude/bin/observe-context.sh +14 -0
- package/runtime/claude/bin/onboarding.sh +6 -0
- package/runtime/claude/bin/person.py +634 -0
- package/runtime/claude/bin/person.sh +481 -0
- package/runtime/claude/bin/pi-render-spec.mjs +140 -0
- package/runtime/claude/bin/post-update.sh +37 -0
- package/runtime/claude/bin/prime-render-spec.mjs +147 -0
- package/runtime/claude/bin/publish-artifact.sh +324 -0
- package/runtime/claude/bin/publish-references.sh +144 -0
- package/runtime/claude/bin/quest.sh +9 -0
- package/runtime/claude/bin/question.sh +8 -0
- package/runtime/claude/bin/repo-state.sh +96 -0
- package/runtime/claude/bin/research-ingest.sh +7 -0
- package/runtime/claude/bin/restore-owned-skills.sh +67 -0
- package/runtime/claude/bin/retrieval_eval.py +385 -0
- package/runtime/claude/bin/runtime-identity.sh +70 -0
- package/runtime/claude/bin/runtime-upgrade.sh +43 -0
- package/runtime/claude/bin/scroll.sh +9 -0
- package/runtime/claude/bin/search.sh +318 -0
- package/runtime/claude/bin/session-autosave.sh +220 -0
- package/runtime/claude/bin/session-log.sh +199 -0
- package/runtime/claude/bin/session-start.sh +696 -0
- package/runtime/claude/bin/settings.sh +532 -0
- package/runtime/claude/bin/startup-check.sh +136 -0
- package/runtime/claude/bin/statusline.sh +41 -0
- package/runtime/claude/bin/telemetry.sh +666 -0
- package/runtime/claude/bin/test-changes.sh +344 -0
- package/runtime/claude/bin/thread.sh +9 -0
- package/runtime/claude/bin/todo.sh +9 -0
- package/runtime/claude/bin/view-render.sh +126 -0
- package/runtime/claude/bin/worktree-create.sh +145 -0
- package/runtime/claude/bin/worktree-remove.sh +50 -0
- package/runtime/claude/bin/worktree.sh +198 -0
- package/runtime/claude/egregore_runtime/__init__.py +228 -0
- package/runtime/claude/egregore_runtime/adapters/__init__.py +5 -0
- package/runtime/claude/egregore_runtime/adapters/invitation.py +237 -0
- package/runtime/claude/egregore_runtime/adapters/notification.py +59 -0
- package/runtime/claude/egregore_runtime/adapters/qmd.py +1701 -0
- package/runtime/claude/egregore_runtime/adapters/qmd_cli.py +210 -0
- package/runtime/claude/egregore_runtime/adapters/qmd_embed_worker.py +59 -0
- package/runtime/claude/egregore_runtime/admin_gate.py +102 -0
- package/runtime/claude/egregore_runtime/artifacts.py +523 -0
- package/runtime/claude/egregore_runtime/contracts.py +499 -0
- package/runtime/claude/egregore_runtime/entitlements.py +85 -0
- package/runtime/claude/egregore_runtime/errors.py +10 -0
- package/runtime/claude/egregore_runtime/graph.py +356 -0
- package/runtime/claude/egregore_runtime/handoff_lookup.py +196 -0
- package/runtime/claude/egregore_runtime/harness_cli.py +1221 -0
- package/runtime/claude/egregore_runtime/identity.py +734 -0
- package/runtime/claude/egregore_runtime/identity_cli.py +91 -0
- package/runtime/claude/egregore_runtime/ingest.py +575 -0
- package/runtime/claude/egregore_runtime/ingest_cli.py +254 -0
- package/runtime/claude/egregore_runtime/ingest_index_cli.py +147 -0
- package/runtime/claude/egregore_runtime/invitation_cli.py +51 -0
- package/runtime/claude/egregore_runtime/invitations.py +116 -0
- package/runtime/claude/egregore_runtime/issue_cli.py +305 -0
- package/runtime/claude/egregore_runtime/issues.py +359 -0
- package/runtime/claude/egregore_runtime/knowledge.py +376 -0
- package/runtime/claude/egregore_runtime/knowledge_cli.py +173 -0
- package/runtime/claude/egregore_runtime/lifecycle.py +888 -0
- package/runtime/claude/egregore_runtime/lifecycle_cli.py +269 -0
- package/runtime/claude/egregore_runtime/notification_cli.py +125 -0
- package/runtime/claude/egregore_runtime/notifications.py +230 -0
- package/runtime/claude/egregore_runtime/observe.py +342 -0
- package/runtime/claude/egregore_runtime/onboarding.py +290 -0
- package/runtime/claude/egregore_runtime/onboarding_cli.py +110 -0
- package/runtime/claude/egregore_runtime/policy.py +144 -0
- package/runtime/claude/egregore_runtime/profile.py +193 -0
- package/runtime/claude/egregore_runtime/quest_cli.py +216 -0
- package/runtime/claude/egregore_runtime/question_cli.py +180 -0
- package/runtime/claude/egregore_runtime/questions.py +304 -0
- package/runtime/claude/egregore_runtime/quests.py +419 -0
- package/runtime/claude/egregore_runtime/readiness.py +379 -0
- package/runtime/claude/egregore_runtime/research_ingest.py +256 -0
- package/runtime/claude/egregore_runtime/research_ingest_cli.py +44 -0
- package/runtime/claude/egregore_runtime/runtime.py +464 -0
- package/runtime/claude/egregore_runtime/scroll_cli.py +185 -0
- package/runtime/claude/egregore_runtime/scrolls.py +726 -0
- package/runtime/claude/egregore_runtime/status.py +412 -0
- package/runtime/claude/egregore_runtime/status_cli.py +174 -0
- package/runtime/claude/egregore_runtime/sync.py +218 -0
- package/runtime/claude/egregore_runtime/teamsync.py +139 -0
- package/runtime/claude/egregore_runtime/telemetry.py +640 -0
- package/runtime/claude/egregore_runtime/thread_cli.py +173 -0
- package/runtime/claude/egregore_runtime/threads.py +517 -0
- package/runtime/claude/egregore_runtime/todo_cli.py +142 -0
- package/runtime/claude/egregore_runtime/todos.py +244 -0
- package/runtime/claude/egregore_runtime/upgrade.py +770 -0
- package/runtime/claude/egregore_runtime/upgrade_worker.py +53 -0
- package/runtime/claude/egregore_runtime/writeback.py +391 -0
- package/runtime/claude/egregore_runtime/writeback_cli.py +114 -0
- package/runtime/claude/manifest.json +284 -0
- package/runtime/codex/.codex/hooks/search-hint.js +21 -52
- package/runtime/codex/.codex/hooks.json +3 -3
- package/runtime/codex/.codex/skills/activity/SKILL.md +23 -66
- package/runtime/codex/.codex/skills/announce/SKILL.md +27 -50
- package/runtime/codex/.codex/skills/archive/SKILL.md +21 -36
- package/runtime/codex/.codex/skills/checkup/SKILL.md +77 -36
- package/runtime/codex/.codex/skills/dark-mode/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/dashboard/SKILL.md +17 -47
- package/runtime/codex/.codex/skills/handoff/SKILL.md +84 -133
- package/runtime/codex/.codex/skills/harvest/SKILL.md +32 -117
- package/runtime/codex/.codex/skills/ingest/SKILL.md +47 -25
- package/runtime/codex/.codex/skills/ingest-user-interview/SKILL.md +18 -36
- package/runtime/codex/.codex/skills/ingest-user-interview/references/analysis-contract.md +42 -0
- package/runtime/codex/.codex/skills/invite/SKILL.md +21 -35
- package/runtime/codex/.codex/skills/issue/SKILL.md +60 -41
- package/runtime/codex/.codex/skills/me/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/meeting/SKILL.md +16 -36
- package/runtime/codex/.codex/skills/meeting/references/analysis-contract.md +48 -0
- package/runtime/codex/.codex/skills/note/SKILL.md +30 -25
- package/runtime/codex/.codex/skills/onboarding/SKILL.md +36 -41
- package/runtime/codex/.codex/skills/pull/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/quest/SKILL.md +27 -66
- package/runtime/codex/.codex/skills/reflect/SKILL.md +22 -36
- package/runtime/codex/.codex/skills/save/SKILL.md +2 -2
- package/runtime/codex/.codex/skills/telemetry/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/test/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/tutorial/SKILL.md +40 -41
- package/runtime/codex/.codex/skills/view/SKILL.md +115 -111
- package/runtime/codex/.codex/skills/wrap/SKILL.md +45 -41
- package/runtime/codex/.codex/spec-manifest.json +9 -9
- package/runtime/codex/AGENTS.md +62 -58
- package/runtime/codex/bin/activity-action.sh +92 -0
- package/runtime/codex/bin/activity-data.sh +12 -233
- package/runtime/codex/bin/agent.sh +84 -100
- package/runtime/codex/bin/artifact-register.sh +164 -0
- package/runtime/codex/bin/artifact-writeback.sh +53 -0
- package/runtime/codex/bin/artifacts.sh +288 -0
- package/runtime/codex/bin/build-sealed-dataroom.mjs +722 -0
- package/runtime/codex/bin/capture-run.sh +18 -2
- package/runtime/codex/bin/codex-render-spec.mjs +41 -16
- package/runtime/codex/bin/codex-session-start.sh +14 -4
- package/runtime/codex/bin/codex-skill-render.mjs +9 -7
- package/runtime/codex/bin/corpus_map.py +806 -0
- package/runtime/codex/bin/corpus_survey.py +304 -0
- package/runtime/codex/bin/dashboard-data.sh +11 -171
- package/runtime/codex/bin/github-auth.sh +121 -0
- package/runtime/codex/bin/graph-batch.sh +7 -0
- package/runtime/codex/bin/graph-op.sh +4 -0
- package/runtime/codex/bin/graph-projection.sh +54 -0
- package/runtime/codex/bin/graph-wal.sh +13 -0
- package/runtime/codex/bin/graph.sh +44 -0
- package/runtime/codex/bin/handoff-lifecycle-job.sh +146 -0
- package/runtime/codex/bin/handoff-lifecycle.sh +280 -0
- package/runtime/codex/bin/handoff-preview.sh +169 -0
- package/runtime/codex/bin/handoff-run.sh +42 -26
- package/runtime/codex/bin/ingest-graph.sh +6 -0
- package/runtime/codex/bin/ingest-item.sh +10 -0
- package/runtime/codex/bin/ingest.sh +59 -30
- package/runtime/codex/bin/invite.sh +6 -0
- package/runtime/codex/bin/issue.sh +10 -0
- package/runtime/codex/bin/knowledge.sh +10 -0
- package/runtime/codex/bin/lib/config.sh +20 -0
- package/runtime/codex/bin/lib/context.sh +46 -25
- package/runtime/codex/bin/lib/git-sync.sh +70 -6
- package/runtime/codex/bin/lib/greeting.sh +34 -5
- package/runtime/codex/bin/lib/handoff-meta.sh +97 -0
- package/runtime/codex/bin/lib/worktree-links.sh +6 -0
- package/runtime/codex/bin/node-run.sh +42 -0
- package/runtime/codex/bin/notification.sh +6 -0
- package/runtime/codex/bin/observe-context.sh +14 -0
- package/runtime/codex/bin/onboarding.sh +6 -0
- package/runtime/codex/bin/person.py +4 -0
- package/runtime/codex/bin/person.sh +43 -10
- package/runtime/codex/bin/pi-render-spec.mjs +140 -0
- package/runtime/codex/bin/post-update.sh +37 -0
- package/runtime/codex/bin/prime-render-spec.mjs +147 -0
- package/runtime/codex/bin/publish-artifact.sh +55 -2
- package/runtime/codex/bin/quest.sh +9 -0
- package/runtime/codex/bin/question.sh +8 -0
- package/runtime/codex/bin/research-ingest.sh +7 -0
- package/runtime/codex/bin/restore-owned-skills.sh +67 -0
- package/runtime/codex/bin/retrieval_eval.py +385 -0
- package/runtime/codex/bin/runtime-identity.sh +70 -0
- package/runtime/codex/bin/runtime-upgrade.sh +43 -0
- package/runtime/codex/bin/scroll.sh +9 -0
- package/runtime/codex/bin/search.sh +231 -195
- package/runtime/codex/bin/settings.sh +174 -5
- package/runtime/codex/bin/startup-check.sh +136 -0
- package/runtime/codex/bin/telemetry.sh +522 -247
- package/runtime/codex/bin/test-changes.sh +344 -0
- package/runtime/codex/bin/thread.sh +9 -0
- package/runtime/codex/bin/todo.sh +9 -0
- package/runtime/codex/bin/view-render.sh +126 -0
- package/runtime/codex/bin/worktree-create.sh +19 -5
- package/runtime/codex/egregore_runtime/__init__.py +228 -0
- package/runtime/codex/egregore_runtime/adapters/__init__.py +5 -0
- package/runtime/codex/egregore_runtime/adapters/invitation.py +237 -0
- package/runtime/codex/egregore_runtime/adapters/notification.py +59 -0
- package/runtime/codex/egregore_runtime/adapters/qmd.py +1701 -0
- package/runtime/codex/egregore_runtime/adapters/qmd_cli.py +210 -0
- package/runtime/codex/egregore_runtime/adapters/qmd_embed_worker.py +59 -0
- package/runtime/codex/egregore_runtime/admin_gate.py +102 -0
- package/runtime/codex/egregore_runtime/artifacts.py +523 -0
- package/runtime/codex/egregore_runtime/contracts.py +499 -0
- package/runtime/codex/egregore_runtime/entitlements.py +85 -0
- package/runtime/codex/egregore_runtime/errors.py +10 -0
- package/runtime/codex/egregore_runtime/graph.py +356 -0
- package/runtime/codex/egregore_runtime/handoff_lookup.py +196 -0
- package/runtime/codex/egregore_runtime/harness_cli.py +1221 -0
- package/runtime/codex/egregore_runtime/identity.py +734 -0
- package/runtime/codex/egregore_runtime/identity_cli.py +91 -0
- package/runtime/codex/egregore_runtime/ingest.py +575 -0
- package/runtime/codex/egregore_runtime/ingest_cli.py +254 -0
- package/runtime/codex/egregore_runtime/ingest_index_cli.py +147 -0
- package/runtime/codex/egregore_runtime/invitation_cli.py +51 -0
- package/runtime/codex/egregore_runtime/invitations.py +116 -0
- package/runtime/codex/egregore_runtime/issue_cli.py +305 -0
- package/runtime/codex/egregore_runtime/issues.py +359 -0
- package/runtime/codex/egregore_runtime/knowledge.py +376 -0
- package/runtime/codex/egregore_runtime/knowledge_cli.py +173 -0
- package/runtime/codex/egregore_runtime/lifecycle.py +888 -0
- package/runtime/codex/egregore_runtime/lifecycle_cli.py +269 -0
- package/runtime/codex/egregore_runtime/notification_cli.py +125 -0
- package/runtime/codex/egregore_runtime/notifications.py +230 -0
- package/runtime/codex/egregore_runtime/observe.py +342 -0
- package/runtime/codex/egregore_runtime/onboarding.py +290 -0
- package/runtime/codex/egregore_runtime/onboarding_cli.py +110 -0
- package/runtime/codex/egregore_runtime/policy.py +144 -0
- package/runtime/codex/egregore_runtime/profile.py +193 -0
- package/runtime/codex/egregore_runtime/quest_cli.py +216 -0
- package/runtime/codex/egregore_runtime/question_cli.py +180 -0
- package/runtime/codex/egregore_runtime/questions.py +304 -0
- package/runtime/codex/egregore_runtime/quests.py +419 -0
- package/runtime/codex/egregore_runtime/readiness.py +379 -0
- package/runtime/codex/egregore_runtime/research_ingest.py +256 -0
- package/runtime/codex/egregore_runtime/research_ingest_cli.py +44 -0
- package/runtime/codex/egregore_runtime/runtime.py +464 -0
- package/runtime/codex/egregore_runtime/scroll_cli.py +185 -0
- package/runtime/codex/egregore_runtime/scrolls.py +726 -0
- package/runtime/codex/egregore_runtime/status.py +412 -0
- package/runtime/codex/egregore_runtime/status_cli.py +174 -0
- package/runtime/codex/egregore_runtime/sync.py +218 -0
- package/runtime/codex/egregore_runtime/teamsync.py +139 -0
- package/runtime/codex/egregore_runtime/telemetry.py +640 -0
- package/runtime/codex/egregore_runtime/thread_cli.py +173 -0
- package/runtime/codex/egregore_runtime/threads.py +517 -0
- package/runtime/codex/egregore_runtime/todo_cli.py +142 -0
- package/runtime/codex/egregore_runtime/todos.py +244 -0
- package/runtime/codex/egregore_runtime/upgrade.py +770 -0
- package/runtime/codex/egregore_runtime/upgrade_worker.py +53 -0
- package/runtime/codex/egregore_runtime/writeback.py +391 -0
- package/runtime/codex/egregore_runtime/writeback_cli.py +114 -0
- package/runtime/codex/manifest.json +98 -1
- package/runtime/pi/.codex/hooks/search-hint.js +21 -52
- package/runtime/pi/.codex/hooks.json +3 -3
- package/runtime/pi/.codex/skills/activity/SKILL.md +23 -66
- package/runtime/pi/.codex/skills/announce/SKILL.md +27 -50
- package/runtime/pi/.codex/skills/archive/SKILL.md +21 -36
- package/runtime/pi/.codex/skills/checkup/SKILL.md +77 -36
- package/runtime/pi/.codex/skills/dark-mode/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/dashboard/SKILL.md +17 -47
- package/runtime/pi/.codex/skills/handoff/SKILL.md +84 -133
- package/runtime/pi/.codex/skills/harvest/SKILL.md +32 -117
- package/runtime/pi/.codex/skills/ingest/SKILL.md +47 -25
- package/runtime/pi/.codex/skills/ingest-user-interview/SKILL.md +18 -36
- package/runtime/pi/.codex/skills/ingest-user-interview/references/analysis-contract.md +42 -0
- package/runtime/pi/.codex/skills/invite/SKILL.md +21 -35
- package/runtime/pi/.codex/skills/issue/SKILL.md +60 -41
- package/runtime/pi/.codex/skills/me/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/meeting/SKILL.md +16 -36
- package/runtime/pi/.codex/skills/meeting/references/analysis-contract.md +48 -0
- package/runtime/pi/.codex/skills/note/SKILL.md +30 -25
- package/runtime/pi/.codex/skills/onboarding/SKILL.md +36 -41
- package/runtime/pi/.codex/skills/pull/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/quest/SKILL.md +27 -66
- package/runtime/pi/.codex/skills/reflect/SKILL.md +22 -36
- package/runtime/pi/.codex/skills/save/SKILL.md +2 -2
- package/runtime/pi/.codex/skills/telemetry/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/test/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/tutorial/SKILL.md +40 -41
- package/runtime/pi/.codex/skills/view/SKILL.md +115 -111
- package/runtime/pi/.codex/skills/wrap/SKILL.md +45 -41
- package/runtime/pi/.codex/spec-manifest.json +9 -9
- package/runtime/pi/.pi/APPEND_SYSTEM.md +57 -48
- package/runtime/pi/.pi/extensions/egregore.ts +7 -0
- package/runtime/pi/.pi/spec-manifest.json +2 -2
- package/runtime/pi/AGENTS.md +62 -58
- package/runtime/pi/bin/activity-action.sh +92 -0
- package/runtime/pi/bin/activity-data.sh +12 -233
- package/runtime/pi/bin/agent.sh +84 -100
- package/runtime/pi/bin/artifact-register.sh +164 -0
- package/runtime/pi/bin/artifact-writeback.sh +53 -0
- package/runtime/pi/bin/artifacts.sh +288 -0
- package/runtime/pi/bin/build-sealed-dataroom.mjs +722 -0
- package/runtime/pi/bin/capture-run.sh +18 -2
- package/runtime/pi/bin/codex-render-spec.mjs +41 -16
- package/runtime/pi/bin/codex-session-start.sh +14 -4
- package/runtime/pi/bin/codex-skill-render.mjs +9 -7
- package/runtime/pi/bin/corpus_map.py +806 -0
- package/runtime/pi/bin/corpus_survey.py +304 -0
- package/runtime/pi/bin/dashboard-data.sh +11 -171
- package/runtime/pi/bin/github-auth.sh +121 -0
- package/runtime/pi/bin/graph-batch.sh +7 -0
- package/runtime/pi/bin/graph-op.sh +4 -0
- package/runtime/pi/bin/graph-projection.sh +54 -0
- package/runtime/pi/bin/graph-wal.sh +13 -0
- package/runtime/pi/bin/graph.sh +44 -0
- package/runtime/pi/bin/handoff-lifecycle-job.sh +146 -0
- package/runtime/pi/bin/handoff-lifecycle.sh +280 -0
- package/runtime/pi/bin/handoff-preview.sh +169 -0
- package/runtime/pi/bin/handoff-run.sh +42 -26
- package/runtime/pi/bin/ingest-graph.sh +6 -0
- package/runtime/pi/bin/ingest-item.sh +10 -0
- package/runtime/pi/bin/ingest.sh +59 -30
- package/runtime/pi/bin/invite.sh +6 -0
- package/runtime/pi/bin/issue.sh +10 -0
- package/runtime/pi/bin/knowledge.sh +10 -0
- package/runtime/pi/bin/lib/config.sh +20 -0
- package/runtime/pi/bin/lib/context.sh +46 -25
- package/runtime/pi/bin/lib/git-sync.sh +70 -6
- package/runtime/pi/bin/lib/greeting.sh +34 -5
- package/runtime/pi/bin/lib/handoff-meta.sh +97 -0
- package/runtime/pi/bin/lib/worktree-links.sh +6 -0
- package/runtime/pi/bin/node-run.sh +42 -0
- package/runtime/pi/bin/notification.sh +6 -0
- package/runtime/pi/bin/observe-context.sh +14 -0
- package/runtime/pi/bin/onboarding.sh +6 -0
- package/runtime/pi/bin/person.py +4 -0
- package/runtime/pi/bin/person.sh +43 -10
- package/runtime/pi/bin/pi-observe-context.mjs +93 -0
- package/runtime/pi/bin/pi-product-workflows.mjs +1 -1
- package/runtime/pi/bin/pi-render-spec.mjs +1 -1
- package/runtime/pi/bin/post-update.sh +37 -0
- package/runtime/pi/bin/prime-render-spec.mjs +147 -0
- package/runtime/pi/bin/publish-artifact.sh +55 -2
- package/runtime/pi/bin/quest.sh +9 -0
- package/runtime/pi/bin/question.sh +8 -0
- package/runtime/pi/bin/research-ingest.sh +7 -0
- package/runtime/pi/bin/restore-owned-skills.sh +67 -0
- package/runtime/pi/bin/retrieval_eval.py +385 -0
- package/runtime/pi/bin/runtime-identity.sh +70 -0
- package/runtime/pi/bin/runtime-upgrade.sh +43 -0
- package/runtime/pi/bin/scroll.sh +9 -0
- package/runtime/pi/bin/search.sh +231 -195
- package/runtime/pi/bin/settings.sh +174 -5
- package/runtime/pi/bin/startup-check.sh +136 -0
- package/runtime/pi/bin/telemetry.sh +522 -247
- package/runtime/pi/bin/test-changes.sh +344 -0
- package/runtime/pi/bin/thread.sh +9 -0
- package/runtime/pi/bin/todo.sh +9 -0
- package/runtime/pi/bin/view-render.sh +126 -0
- package/runtime/pi/bin/worktree-create.sh +19 -5
- package/runtime/pi/egregore_runtime/__init__.py +228 -0
- package/runtime/pi/egregore_runtime/adapters/__init__.py +5 -0
- package/runtime/pi/egregore_runtime/adapters/invitation.py +237 -0
- package/runtime/pi/egregore_runtime/adapters/notification.py +59 -0
- package/runtime/pi/egregore_runtime/adapters/qmd.py +1701 -0
- package/runtime/pi/egregore_runtime/adapters/qmd_cli.py +210 -0
- package/runtime/pi/egregore_runtime/adapters/qmd_embed_worker.py +59 -0
- package/runtime/pi/egregore_runtime/admin_gate.py +102 -0
- package/runtime/pi/egregore_runtime/artifacts.py +523 -0
- package/runtime/pi/egregore_runtime/contracts.py +499 -0
- package/runtime/pi/egregore_runtime/entitlements.py +85 -0
- package/runtime/pi/egregore_runtime/errors.py +10 -0
- package/runtime/pi/egregore_runtime/graph.py +356 -0
- package/runtime/pi/egregore_runtime/handoff_lookup.py +196 -0
- package/runtime/pi/egregore_runtime/harness_cli.py +1221 -0
- package/runtime/pi/egregore_runtime/identity.py +734 -0
- package/runtime/pi/egregore_runtime/identity_cli.py +91 -0
- package/runtime/pi/egregore_runtime/ingest.py +575 -0
- package/runtime/pi/egregore_runtime/ingest_cli.py +254 -0
- package/runtime/pi/egregore_runtime/ingest_index_cli.py +147 -0
- package/runtime/pi/egregore_runtime/invitation_cli.py +51 -0
- package/runtime/pi/egregore_runtime/invitations.py +116 -0
- package/runtime/pi/egregore_runtime/issue_cli.py +305 -0
- package/runtime/pi/egregore_runtime/issues.py +359 -0
- package/runtime/pi/egregore_runtime/knowledge.py +376 -0
- package/runtime/pi/egregore_runtime/knowledge_cli.py +173 -0
- package/runtime/pi/egregore_runtime/lifecycle.py +888 -0
- package/runtime/pi/egregore_runtime/lifecycle_cli.py +269 -0
- package/runtime/pi/egregore_runtime/notification_cli.py +125 -0
- package/runtime/pi/egregore_runtime/notifications.py +230 -0
- package/runtime/pi/egregore_runtime/observe.py +342 -0
- package/runtime/pi/egregore_runtime/onboarding.py +290 -0
- package/runtime/pi/egregore_runtime/onboarding_cli.py +110 -0
- package/runtime/pi/egregore_runtime/policy.py +144 -0
- package/runtime/pi/egregore_runtime/profile.py +193 -0
- package/runtime/pi/egregore_runtime/quest_cli.py +216 -0
- package/runtime/pi/egregore_runtime/question_cli.py +180 -0
- package/runtime/pi/egregore_runtime/questions.py +304 -0
- package/runtime/pi/egregore_runtime/quests.py +419 -0
- package/runtime/pi/egregore_runtime/readiness.py +379 -0
- package/runtime/pi/egregore_runtime/research_ingest.py +256 -0
- package/runtime/pi/egregore_runtime/research_ingest_cli.py +44 -0
- package/runtime/pi/egregore_runtime/runtime.py +464 -0
- package/runtime/pi/egregore_runtime/scroll_cli.py +185 -0
- package/runtime/pi/egregore_runtime/scrolls.py +726 -0
- package/runtime/pi/egregore_runtime/status.py +412 -0
- package/runtime/pi/egregore_runtime/status_cli.py +174 -0
- package/runtime/pi/egregore_runtime/sync.py +218 -0
- package/runtime/pi/egregore_runtime/teamsync.py +139 -0
- package/runtime/pi/egregore_runtime/telemetry.py +640 -0
- package/runtime/pi/egregore_runtime/thread_cli.py +173 -0
- package/runtime/pi/egregore_runtime/threads.py +517 -0
- package/runtime/pi/egregore_runtime/todo_cli.py +142 -0
- package/runtime/pi/egregore_runtime/todos.py +244 -0
- package/runtime/pi/egregore_runtime/upgrade.py +770 -0
- package/runtime/pi/egregore_runtime/upgrade_worker.py +53 -0
- package/runtime/pi/egregore_runtime/writeback.py +391 -0
- package/runtime/pi/egregore_runtime/writeback_cli.py +114 -0
- package/runtime/pi/manifest.json +98 -1
- package/runtime/prime/.codex/hooks/search-hint.js +21 -52
- package/runtime/prime/.codex/hooks.json +3 -3
- package/runtime/prime/.codex/skills/activity/SKILL.md +23 -66
- package/runtime/prime/.codex/skills/announce/SKILL.md +27 -50
- package/runtime/prime/.codex/skills/archive/SKILL.md +21 -36
- package/runtime/prime/.codex/skills/checkup/SKILL.md +77 -36
- package/runtime/prime/.codex/skills/dark-mode/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/dashboard/SKILL.md +17 -47
- package/runtime/prime/.codex/skills/handoff/SKILL.md +84 -133
- package/runtime/prime/.codex/skills/harvest/SKILL.md +32 -117
- package/runtime/prime/.codex/skills/ingest/SKILL.md +47 -25
- package/runtime/prime/.codex/skills/ingest-user-interview/SKILL.md +18 -36
- package/runtime/prime/.codex/skills/ingest-user-interview/references/analysis-contract.md +42 -0
- package/runtime/prime/.codex/skills/invite/SKILL.md +21 -35
- package/runtime/prime/.codex/skills/issue/SKILL.md +60 -41
- package/runtime/prime/.codex/skills/me/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/meeting/SKILL.md +16 -36
- package/runtime/prime/.codex/skills/meeting/references/analysis-contract.md +48 -0
- package/runtime/prime/.codex/skills/note/SKILL.md +30 -25
- package/runtime/prime/.codex/skills/onboarding/SKILL.md +36 -41
- package/runtime/prime/.codex/skills/pull/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/quest/SKILL.md +27 -66
- package/runtime/prime/.codex/skills/reflect/SKILL.md +22 -36
- package/runtime/prime/.codex/skills/save/SKILL.md +2 -2
- package/runtime/prime/.codex/skills/telemetry/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/test/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/tutorial/SKILL.md +40 -41
- package/runtime/prime/.codex/skills/view/SKILL.md +115 -111
- package/runtime/prime/.codex/skills/wrap/SKILL.md +45 -41
- package/runtime/prime/.codex/spec-manifest.json +9 -9
- package/runtime/prime/.prime/agent/APPEND_SYSTEM.md +57 -48
- package/runtime/prime/.prime/agent/extensions/egregore.ts +7 -0
- package/runtime/prime/.prime/agent/spec-manifest.json +2 -2
- package/runtime/prime/AGENTS.md +62 -58
- package/runtime/prime/bin/activity-action.sh +92 -0
- package/runtime/prime/bin/activity-data.sh +12 -233
- package/runtime/prime/bin/agent.sh +84 -100
- package/runtime/prime/bin/artifact-register.sh +164 -0
- package/runtime/prime/bin/artifact-writeback.sh +53 -0
- package/runtime/prime/bin/artifacts.sh +288 -0
- package/runtime/prime/bin/build-sealed-dataroom.mjs +722 -0
- package/runtime/prime/bin/capture-run.sh +18 -2
- package/runtime/prime/bin/codex-render-spec.mjs +41 -16
- package/runtime/prime/bin/codex-session-start.sh +14 -4
- package/runtime/prime/bin/codex-skill-render.mjs +9 -7
- package/runtime/prime/bin/corpus_map.py +806 -0
- package/runtime/prime/bin/corpus_survey.py +304 -0
- package/runtime/prime/bin/dashboard-data.sh +11 -171
- package/runtime/prime/bin/github-auth.sh +121 -0
- package/runtime/prime/bin/graph-batch.sh +7 -0
- package/runtime/prime/bin/graph-op.sh +4 -0
- package/runtime/prime/bin/graph-projection.sh +54 -0
- package/runtime/prime/bin/graph-wal.sh +13 -0
- package/runtime/prime/bin/graph.sh +44 -0
- package/runtime/prime/bin/handoff-lifecycle-job.sh +146 -0
- package/runtime/prime/bin/handoff-lifecycle.sh +280 -0
- package/runtime/prime/bin/handoff-preview.sh +169 -0
- package/runtime/prime/bin/handoff-run.sh +42 -26
- package/runtime/prime/bin/ingest-graph.sh +6 -0
- package/runtime/prime/bin/ingest-item.sh +10 -0
- package/runtime/prime/bin/ingest.sh +59 -30
- package/runtime/prime/bin/invite.sh +6 -0
- package/runtime/prime/bin/issue.sh +10 -0
- package/runtime/prime/bin/knowledge.sh +10 -0
- package/runtime/prime/bin/lib/config.sh +20 -0
- package/runtime/prime/bin/lib/context.sh +46 -25
- package/runtime/prime/bin/lib/git-sync.sh +70 -6
- package/runtime/prime/bin/lib/greeting.sh +34 -5
- package/runtime/prime/bin/lib/handoff-meta.sh +97 -0
- package/runtime/prime/bin/lib/worktree-links.sh +6 -0
- package/runtime/prime/bin/node-run.sh +42 -0
- package/runtime/prime/bin/notification.sh +6 -0
- package/runtime/prime/bin/observe-context.sh +14 -0
- package/runtime/prime/bin/onboarding.sh +6 -0
- package/runtime/prime/bin/person.py +4 -0
- package/runtime/prime/bin/person.sh +43 -10
- package/runtime/prime/bin/pi-observe-context.mjs +93 -0
- package/runtime/prime/bin/pi-product-workflows.mjs +1 -1
- package/runtime/prime/bin/pi-render-spec.mjs +140 -0
- package/runtime/prime/bin/post-update.sh +37 -0
- package/runtime/prime/bin/prime-render-spec.mjs +1 -1
- package/runtime/prime/bin/publish-artifact.sh +55 -2
- package/runtime/prime/bin/quest.sh +9 -0
- package/runtime/prime/bin/question.sh +8 -0
- package/runtime/prime/bin/research-ingest.sh +7 -0
- package/runtime/prime/bin/restore-owned-skills.sh +67 -0
- package/runtime/prime/bin/retrieval_eval.py +385 -0
- package/runtime/prime/bin/runtime-identity.sh +70 -0
- package/runtime/prime/bin/runtime-upgrade.sh +43 -0
- package/runtime/prime/bin/scroll.sh +9 -0
- package/runtime/prime/bin/search.sh +231 -195
- package/runtime/prime/bin/settings.sh +174 -5
- package/runtime/prime/bin/startup-check.sh +136 -0
- package/runtime/prime/bin/telemetry.sh +522 -247
- package/runtime/prime/bin/test-changes.sh +344 -0
- package/runtime/prime/bin/thread.sh +9 -0
- package/runtime/prime/bin/todo.sh +9 -0
- package/runtime/prime/bin/view-render.sh +126 -0
- package/runtime/prime/bin/worktree-create.sh +19 -5
- package/runtime/prime/egregore_runtime/__init__.py +228 -0
- package/runtime/prime/egregore_runtime/adapters/__init__.py +5 -0
- package/runtime/prime/egregore_runtime/adapters/invitation.py +237 -0
- package/runtime/prime/egregore_runtime/adapters/notification.py +59 -0
- package/runtime/prime/egregore_runtime/adapters/qmd.py +1701 -0
- package/runtime/prime/egregore_runtime/adapters/qmd_cli.py +210 -0
- package/runtime/prime/egregore_runtime/adapters/qmd_embed_worker.py +59 -0
- package/runtime/prime/egregore_runtime/admin_gate.py +102 -0
- package/runtime/prime/egregore_runtime/artifacts.py +523 -0
- package/runtime/prime/egregore_runtime/contracts.py +499 -0
- package/runtime/prime/egregore_runtime/entitlements.py +85 -0
- package/runtime/prime/egregore_runtime/errors.py +10 -0
- package/runtime/prime/egregore_runtime/graph.py +356 -0
- package/runtime/prime/egregore_runtime/handoff_lookup.py +196 -0
- package/runtime/prime/egregore_runtime/harness_cli.py +1221 -0
- package/runtime/prime/egregore_runtime/identity.py +734 -0
- package/runtime/prime/egregore_runtime/identity_cli.py +91 -0
- package/runtime/prime/egregore_runtime/ingest.py +575 -0
- package/runtime/prime/egregore_runtime/ingest_cli.py +254 -0
- package/runtime/prime/egregore_runtime/ingest_index_cli.py +147 -0
- package/runtime/prime/egregore_runtime/invitation_cli.py +51 -0
- package/runtime/prime/egregore_runtime/invitations.py +116 -0
- package/runtime/prime/egregore_runtime/issue_cli.py +305 -0
- package/runtime/prime/egregore_runtime/issues.py +359 -0
- package/runtime/prime/egregore_runtime/knowledge.py +376 -0
- package/runtime/prime/egregore_runtime/knowledge_cli.py +173 -0
- package/runtime/prime/egregore_runtime/lifecycle.py +888 -0
- package/runtime/prime/egregore_runtime/lifecycle_cli.py +269 -0
- package/runtime/prime/egregore_runtime/notification_cli.py +125 -0
- package/runtime/prime/egregore_runtime/notifications.py +230 -0
- package/runtime/prime/egregore_runtime/observe.py +342 -0
- package/runtime/prime/egregore_runtime/onboarding.py +290 -0
- package/runtime/prime/egregore_runtime/onboarding_cli.py +110 -0
- package/runtime/prime/egregore_runtime/policy.py +144 -0
- package/runtime/prime/egregore_runtime/profile.py +193 -0
- package/runtime/prime/egregore_runtime/quest_cli.py +216 -0
- package/runtime/prime/egregore_runtime/question_cli.py +180 -0
- package/runtime/prime/egregore_runtime/questions.py +304 -0
- package/runtime/prime/egregore_runtime/quests.py +419 -0
- package/runtime/prime/egregore_runtime/readiness.py +379 -0
- package/runtime/prime/egregore_runtime/research_ingest.py +256 -0
- package/runtime/prime/egregore_runtime/research_ingest_cli.py +44 -0
- package/runtime/prime/egregore_runtime/runtime.py +464 -0
- package/runtime/prime/egregore_runtime/scroll_cli.py +185 -0
- package/runtime/prime/egregore_runtime/scrolls.py +726 -0
- package/runtime/prime/egregore_runtime/status.py +412 -0
- package/runtime/prime/egregore_runtime/status_cli.py +174 -0
- package/runtime/prime/egregore_runtime/sync.py +218 -0
- package/runtime/prime/egregore_runtime/teamsync.py +139 -0
- package/runtime/prime/egregore_runtime/telemetry.py +640 -0
- package/runtime/prime/egregore_runtime/thread_cli.py +173 -0
- package/runtime/prime/egregore_runtime/threads.py +517 -0
- package/runtime/prime/egregore_runtime/todo_cli.py +142 -0
- package/runtime/prime/egregore_runtime/todos.py +244 -0
- package/runtime/prime/egregore_runtime/upgrade.py +770 -0
- package/runtime/prime/egregore_runtime/upgrade_worker.py +53 -0
- package/runtime/prime/egregore_runtime/writeback.py +391 -0
- package/runtime/prime/egregore_runtime/writeback_cli.py +114 -0
- package/runtime/prime/manifest.json +98 -1
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Telemetry Spec
|
|
2
|
+
|
|
3
|
+
Telemetry makes runtime behavior inspectable without turning organizational
|
|
4
|
+
content into an analytics feed. Rich events are local-first, content-free,
|
|
5
|
+
user-controlled, and excluded from canonical memory and Git.
|
|
6
|
+
|
|
7
|
+
## How it works
|
|
8
|
+
|
|
9
|
+
`bin/telemetry.sh` handles all telemetry — mirrors `bin/graph.sh` and `bin/notify.sh` patterns:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Emit an event (O(1) local append, no network)
|
|
13
|
+
bash bin/telemetry.sh emit "command" '{"command":"save"}'
|
|
14
|
+
|
|
15
|
+
# Check status
|
|
16
|
+
bash bin/telemetry.sh status
|
|
17
|
+
|
|
18
|
+
# Inspect or export locally
|
|
19
|
+
bash bin/telemetry.sh inspect 10
|
|
20
|
+
bash bin/telemetry.sh export ~/.egregore/exports/telemetry.jsonl
|
|
21
|
+
|
|
22
|
+
# Prepare an explicit share proposal (does not send)
|
|
23
|
+
bash bin/telemetry.sh share
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Events buffer on-device at `~/.egregore/telemetry.jsonl`, outside the project,
|
|
27
|
+
canonical memory, and Git. `flush` remains a compatibility no-op for old
|
|
28
|
+
lifecycle callers and never uploads. Sharing is a separate two-step operation:
|
|
29
|
+
the CLI discloses the exact target, event count, bytes, dataset hash, and fields,
|
|
30
|
+
then requires a fresh short-lived token against the unchanged dataset.
|
|
31
|
+
|
|
32
|
+
## Consent (opt-out)
|
|
33
|
+
|
|
34
|
+
Telemetry is on by default. Users can opt out via:
|
|
35
|
+
- `/telemetry off` — persistent opt-out in `.egregore-state.json`
|
|
36
|
+
- `EGREGORE_NO_TELEMETRY=1` in `.env`
|
|
37
|
+
- `DO_NOT_TRACK=1` — standard environment variable
|
|
38
|
+
|
|
39
|
+
## What is collected
|
|
40
|
+
|
|
41
|
+
Structured identifiers and scalar metrics: event/task/actor/org/session IDs,
|
|
42
|
+
timestamps, command enums, retrieval type, privacy-safe lexical/vector
|
|
43
|
+
fingerprints when configured, returned/opened artifact IDs (ordered for rank),
|
|
44
|
+
tool-call counts, latency, token counts, writeback/action outcome,
|
|
45
|
+
success/failure codes, and index-spec/version. Metric names are allowlisted and
|
|
46
|
+
string values must be bounded identifiers/enums rather than prose.
|
|
47
|
+
|
|
48
|
+
## What is NEVER collected
|
|
49
|
+
|
|
50
|
+
Raw prompts/queries, passages, file paths, file contents, code, env var values,
|
|
51
|
+
secrets, conversation content, prose error messages, or command arguments that
|
|
52
|
+
might contain user content.
|
|
53
|
+
|
|
54
|
+
## Command instrumentation
|
|
55
|
+
|
|
56
|
+
**After executing any slash command**, emit a `command` event (fire-and-forget, must not delay response):
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
bash bin/telemetry.sh emit "command" '{"command":"save"}' 2>/dev/null &
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Optional extended payload example: `{"command":"save","model":"haiku-4-5","tier":"haiku","routed":true,"escalated":false,"override":false,"duration_ms":1240}`
|
|
63
|
+
|
|
64
|
+
All extended fields are optional, and `duration_ms` is measured by the emitting
|
|
65
|
+
wrapper (executor spawn wall-time or script time). Harness adapters may include
|
|
66
|
+
content-free aggregate token counts when they are available.
|
|
67
|
+
|
|
68
|
+
Replace `"save"` with the actual command name. Do this for every slash command execution.
|
|
69
|
+
|
|
70
|
+
## Onboarding instrumentation
|
|
71
|
+
|
|
72
|
+
When completing an onboarding step, emit:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
bash bin/telemetry.sh emit "onboarding_step" '{"step":"workspace_setup","duration_ms":1200}' 2>/dev/null &
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## First-session telemetry notice
|
|
79
|
+
|
|
80
|
+
On the first session where telemetry events are emitted, if `telemetry_noticed` is not set in `.egregore-state.json`, mention once:
|
|
81
|
+
|
|
82
|
+
> Egregore records content-free runtime telemetry locally (structured identifiers and metrics — never prompts, code, or content). Nothing is shared automatically. Run `/telemetry` to inspect it or `/telemetry off` to disable collection.
|
|
83
|
+
|
|
84
|
+
Then set `telemetry_noticed: true` in the state file. Never repeat this notice.
|
|
85
|
+
|
|
86
|
+
## Session Reports
|
|
87
|
+
|
|
88
|
+
Separate from telemetry. Users can optionally share session reports during `/wrap` or via `/issue egregore:`. Reports are **opt-in per session** — the user is asked each time and must explicitly agree.
|
|
89
|
+
|
|
90
|
+
### How it works
|
|
91
|
+
|
|
92
|
+
`bin/session-report.sh` handles report submission. It POSTs directly to Supabase via the anon key (no API server needed). The agent generates a structured report from the session context inline — no separate LLM call.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Submit a report (reads JSON from stdin)
|
|
96
|
+
echo '{"topic":"...","summary":"..."}' | bash bin/session-report.sh submit
|
|
97
|
+
|
|
98
|
+
# Check reporting status
|
|
99
|
+
bash bin/session-report.sh status
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### What is sent
|
|
103
|
+
|
|
104
|
+
- AI-analyzed topic + summary (same as what's written to memory)
|
|
105
|
+
- Gap analysis: `{type, detail}` where type is `missing_skill`, `missing_tool`, `repeated_failure`, `wrong_info`, or `confusing_ux`
|
|
106
|
+
- User's own description (if provided)
|
|
107
|
+
- System info: mode, platform, shell, framework version
|
|
108
|
+
- Session duration and message count
|
|
109
|
+
|
|
110
|
+
### What is NEVER sent
|
|
111
|
+
|
|
112
|
+
- Code, file contents, or file paths
|
|
113
|
+
- Conversation transcript or user prompts
|
|
114
|
+
- Environment variables or secrets
|
|
115
|
+
- Org-specific data (sanitized before sending — org names, person names, tokens replaced)
|
|
116
|
+
|
|
117
|
+
### Opt-out
|
|
118
|
+
|
|
119
|
+
- `EGREGORE_NO_REPORTS=1` in `.env`
|
|
120
|
+
- `.egregore-state.json` → `"session_reports": false`
|
|
121
|
+
- Simply answer "No thanks" when prompted during `/wrap`
|
|
122
|
+
- `DO_NOT_TRACK=1` also disables reports
|
|
123
|
+
|
|
124
|
+
### Transport
|
|
125
|
+
|
|
126
|
+
- Direct to Supabase via anon key (INSERT-only RLS policy)
|
|
127
|
+
- If network fails: saved locally to `~/.egregore/reports/` as fallback
|
|
128
|
+
- Telegram notification to maintainers fires server-side via Supabase DB webhook
|
|
129
|
+
- Optional: GitHub issue creation on `egregore-labs/egregore` (user chooses each time)
|
|
130
|
+
|
|
131
|
+
### Configuration
|
|
132
|
+
|
|
133
|
+
Reports require `report_url` and `report_key` in `egregore.json`. New OSS installations get these automatically via `create-egregore`. If missing, the report prompt is skipped entirely.
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# boundary-check.sh — PreToolUse hook for environment isolation
|
|
3
|
+
# Receives tool input JSON on stdin from Claude Code.
|
|
4
|
+
# Exit 0 = allow, exit 2 = block (reason on stderr).
|
|
5
|
+
# Must be fast (<50ms) — no network calls, just path checks.
|
|
6
|
+
#
|
|
7
|
+
# Two-tier model (decided 2026-07-08, harvest-2026-07-08-boundary-hook-refinement):
|
|
8
|
+
# HARD tier — paths of other Egregore instances (denied_paths): denied for
|
|
9
|
+
# every tool, always. No consent path exists.
|
|
10
|
+
# SOFT tier — everything else outside the boundary: consent-gated for every
|
|
11
|
+
# tool. Grants live in .egregore-boundary-consent (session-scoped,
|
|
12
|
+
# cleared by session-start) or in config read roots.
|
|
13
|
+
# Posture (strict|standard|open), lock, and read roots are merged at session
|
|
14
|
+
# start from egregore.json .boundary + .egregore-boundary.local.json into the
|
|
15
|
+
# cached boundary JSON. Sessions running with permission_mode=bypassPermissions
|
|
16
|
+
# skip the soft tier (never the hard tier) unless the org boundary is locked.
|
|
17
|
+
|
|
18
|
+
# No set -e — hook must never accidentally block by crashing
|
|
19
|
+
# If anything fails unexpectedly, fall through to exit 0 (allow)
|
|
20
|
+
|
|
21
|
+
PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(cd "$(dirname "$0")/../.." && pwd)}"
|
|
22
|
+
|
|
23
|
+
# --- Guard: if project dir no longer exists (worktree deleted), allow gracefully ---
|
|
24
|
+
if [ ! -d "$PROJECT_DIR" ]; then
|
|
25
|
+
exit 0
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
# --- Load boundary file (cached at session start) ---
|
|
29
|
+
HASH=$(echo -n "$PROJECT_DIR" | md5 2>/dev/null || echo -n "$PROJECT_DIR" | md5sum 2>/dev/null | cut -d' ' -f1)
|
|
30
|
+
BOUNDARY_FILE="/tmp/egregore-boundary-${HASH}.json"
|
|
31
|
+
|
|
32
|
+
if [ ! -f "$BOUNDARY_FILE" ]; then
|
|
33
|
+
# No boundary computed yet (session-start hasn't run) — allow everything
|
|
34
|
+
exit 0
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
# Read boundary once. Empty fields carry a "-" sentinel: tab counts as IFS
|
|
38
|
+
# whitespace, so a genuinely empty @tsv field would collapse and shift every
|
|
39
|
+
# following field left.
|
|
40
|
+
BOUNDARY_JSON=$(cat "$BOUNDARY_FILE" 2>/dev/null) || exit 0
|
|
41
|
+
IFS=$'\t' read -r B_PROJECT_DIR B_MEMORY_DIR POSTURE LOCKED HAS_READ_ROOTS < <(
|
|
42
|
+
echo "$BOUNDARY_JSON" | jq -r \
|
|
43
|
+
'[(.project_dir // "" | if . == "" then "-" else . end), (.memory_dir // "" | if . == "" then "-" else . end), (.posture // "standard"), ((.locked // false) | tostring), (has("read_roots") | tostring)] | @tsv' 2>/dev/null
|
|
44
|
+
) || true
|
|
45
|
+
[ "$B_PROJECT_DIR" = "-" ] && B_PROJECT_DIR=""
|
|
46
|
+
[ "$B_MEMORY_DIR" = "-" ] && B_MEMORY_DIR=""
|
|
47
|
+
case "$POSTURE" in strict|standard|open) ;; *) POSTURE="standard" ;; esac
|
|
48
|
+
[ "$LOCKED" = "true" ] || LOCKED="false"
|
|
49
|
+
|
|
50
|
+
# Read roots: from boundary JSON when present; legacy boundary files (no key)
|
|
51
|
+
# get the inbox defaults, matching the default posture.
|
|
52
|
+
if [ "$HAS_READ_ROOTS" = "true" ]; then
|
|
53
|
+
READ_ROOTS=$(echo "$BOUNDARY_JSON" | jq -r '.read_roots[]?' 2>/dev/null) || true
|
|
54
|
+
elif [ "$POSTURE" != "strict" ]; then
|
|
55
|
+
READ_ROOTS="$HOME/Downloads
|
|
56
|
+
$HOME/Desktop"
|
|
57
|
+
else
|
|
58
|
+
READ_ROOTS=""
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
DENIED_PATHS=$(echo "$BOUNDARY_JSON" | jq -r '.denied_paths[]?' 2>/dev/null) || true
|
|
62
|
+
|
|
63
|
+
CONSENT_FILE="$PROJECT_DIR/.egregore-boundary-consent"
|
|
64
|
+
|
|
65
|
+
# --- Read tool input from stdin ---
|
|
66
|
+
INPUT=$(cat)
|
|
67
|
+
IFS=$'\t' read -r TOOL_NAME PERM_MODE < <(
|
|
68
|
+
echo "$INPUT" | jq -r '[(.tool_name // "" | if . == "" then "-" else . end), (.permission_mode // "")] | @tsv' 2>/dev/null
|
|
69
|
+
) || true
|
|
70
|
+
[ "$TOOL_NAME" = "-" ] && TOOL_NAME=""
|
|
71
|
+
|
|
72
|
+
if [ -z "$TOOL_NAME" ]; then
|
|
73
|
+
exit 0
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
# Yolo inheritance: a session the user runs in bypassPermissions has already
|
|
77
|
+
# declared maximal trust — Egregore doesn't re-ask (soft tier off). The hard
|
|
78
|
+
# tier stays on. An org lock disables this relaxation.
|
|
79
|
+
RELAXED="false"
|
|
80
|
+
if [ "$LOCKED" != "true" ] && [ "$PERM_MODE" = "bypassPermissions" ]; then
|
|
81
|
+
RELAXED="true"
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
# --- Helper: collapse /./ and component/../ sequences lexically ---
|
|
85
|
+
# Used when the target does not exist on disk, so ../ escapes still normalize.
|
|
86
|
+
normalize_lexical() {
|
|
87
|
+
local p="$1" prev=""
|
|
88
|
+
while [ "$p" != "$prev" ]; do
|
|
89
|
+
prev="$p"
|
|
90
|
+
p=$(printf '%s' "$p" | sed -E 's|/\./|/|g; s|/[^/]+/\.\./|/|; s|/[^/]+/\.\.$||' 2>/dev/null) || p="$prev"
|
|
91
|
+
done
|
|
92
|
+
while [[ "$p" == /../* ]]; do p="/${p#/../}"; done
|
|
93
|
+
[ -z "$p" ] && p="/"
|
|
94
|
+
printf '%s\n' "$p"
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
# --- Helper: resolve path ---
|
|
98
|
+
resolve_path() {
|
|
99
|
+
local path="$1"
|
|
100
|
+
path="${path/#\~/$HOME}"
|
|
101
|
+
path="${path/#\$HOME/$HOME}"
|
|
102
|
+
if [[ "$path" != /* ]]; then
|
|
103
|
+
path="$PROJECT_DIR/$path"
|
|
104
|
+
fi
|
|
105
|
+
local resolved
|
|
106
|
+
resolved=$(realpath "$path" 2>/dev/null) && { echo "$resolved"; return; }
|
|
107
|
+
# Target may not exist yet (e.g. a write destination): resolve the nearest
|
|
108
|
+
# existing ancestor, then fall back to pure lexical normalization.
|
|
109
|
+
local dir base
|
|
110
|
+
dir=$(dirname "$path")
|
|
111
|
+
base=$(basename "$path")
|
|
112
|
+
resolved=$(realpath "$dir" 2>/dev/null) && { echo "$resolved/$base"; return; }
|
|
113
|
+
normalize_lexical "$path"
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
# --- Helper: HARD tier — another instance's path? ---
|
|
117
|
+
# Self-scope carve-out, per entry: an ENCLOSING denied checkout (different or
|
|
118
|
+
# unproven organization identity) never covers the project's own files — the
|
|
119
|
+
# enclosing tree stays denied while the project stays usable. A denied entry
|
|
120
|
+
# nested INSIDE the project is still enforced: residence under the project
|
|
121
|
+
# proves nothing about identity.
|
|
122
|
+
is_denied() {
|
|
123
|
+
local resolved="$1" denied in_project=1
|
|
124
|
+
if [ -n "${B_PROJECT_DIR:-}" ] && [[ "$resolved" == "$B_PROJECT_DIR" || "$resolved" == "$B_PROJECT_DIR/"* ]]; then
|
|
125
|
+
in_project=0
|
|
126
|
+
fi
|
|
127
|
+
for denied in $DENIED_PATHS; do
|
|
128
|
+
if [[ "$resolved" == "$denied" || "$resolved" == "$denied/"* ]]; then
|
|
129
|
+
if [ "$in_project" = "0" ] && [[ "$B_PROJECT_DIR" == "$denied" || "$B_PROJECT_DIR" == "$denied/"* ]]; then
|
|
130
|
+
continue
|
|
131
|
+
fi
|
|
132
|
+
return 0
|
|
133
|
+
fi
|
|
134
|
+
done
|
|
135
|
+
return 1
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
# --- Helper: core boundary (no consent needed, all tiers) ---
|
|
139
|
+
in_core_boundary() {
|
|
140
|
+
local resolved="$1"
|
|
141
|
+
|
|
142
|
+
# Always-allowed system paths
|
|
143
|
+
case "$resolved" in
|
|
144
|
+
/tmp/*|/tmp|/private/*|/private) return 0 ;;
|
|
145
|
+
"$HOME/.claude"/*|"$HOME/.claude") return 0 ;;
|
|
146
|
+
/usr/*|/etc/*|/var/*|/bin/*|/sbin/*|/opt/*) return 0 ;;
|
|
147
|
+
/dev/*|/dev|/proc/*|/sys/*) return 0 ;;
|
|
148
|
+
/System/*|/Applications/*|/Library/*) return 0 ;;
|
|
149
|
+
esac
|
|
150
|
+
|
|
151
|
+
# Allow reading instance registry (needed for multi-instance features)
|
|
152
|
+
if [[ "$resolved" == "$HOME/.egregore"/* ]]; then
|
|
153
|
+
return 0
|
|
154
|
+
fi
|
|
155
|
+
|
|
156
|
+
# Project directory
|
|
157
|
+
if [ -n "${B_PROJECT_DIR:-}" ]; then
|
|
158
|
+
if [[ "$resolved" == "$B_PROJECT_DIR" || "$resolved" == "$B_PROJECT_DIR/"* ]]; then
|
|
159
|
+
return 0
|
|
160
|
+
fi
|
|
161
|
+
fi
|
|
162
|
+
|
|
163
|
+
# Memory directory
|
|
164
|
+
if [ -n "${B_MEMORY_DIR:-}" ]; then
|
|
165
|
+
if [[ "$resolved" == "$B_MEMORY_DIR" || "$resolved" == "$B_MEMORY_DIR/"* ]]; then
|
|
166
|
+
return 0
|
|
167
|
+
fi
|
|
168
|
+
fi
|
|
169
|
+
|
|
170
|
+
# Managed repos
|
|
171
|
+
local repo_paths repo_path
|
|
172
|
+
repo_paths=$(echo "$BOUNDARY_JSON" | jq -r '.managed_repos[]?' 2>/dev/null) || true
|
|
173
|
+
for repo_path in $repo_paths; do
|
|
174
|
+
if [[ "$resolved" == "$repo_path" || "$resolved" == "$repo_path/"* ]]; then
|
|
175
|
+
return 0
|
|
176
|
+
fi
|
|
177
|
+
done
|
|
178
|
+
|
|
179
|
+
# Parent directory (for sibling repo operations). Denied paths are checked
|
|
180
|
+
# before this helper is ever consulted, so no denied check needed here.
|
|
181
|
+
local parent_dir
|
|
182
|
+
parent_dir="$(dirname "${B_PROJECT_DIR:-$PROJECT_DIR}")"
|
|
183
|
+
if [[ "$resolved" == "$parent_dir" || "$resolved" == "$parent_dir/"* ]]; then
|
|
184
|
+
return 0
|
|
185
|
+
fi
|
|
186
|
+
|
|
187
|
+
return 1
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
# --- Helper: SOFT tier grants ---
|
|
191
|
+
in_read_roots() {
|
|
192
|
+
local resolved="$1" root
|
|
193
|
+
for root in $READ_ROOTS; do
|
|
194
|
+
if [[ "$resolved" == "$root" || "$resolved" == "$root/"* ]]; then
|
|
195
|
+
return 0
|
|
196
|
+
fi
|
|
197
|
+
done
|
|
198
|
+
return 1
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
is_consented() {
|
|
202
|
+
local resolved="$1" line
|
|
203
|
+
# A locked org boundary has no consent path — stale grant files are void.
|
|
204
|
+
[ "$LOCKED" = "true" ] && return 1
|
|
205
|
+
[ -f "$CONSENT_FILE" ] || return 1
|
|
206
|
+
while IFS= read -r line; do
|
|
207
|
+
[ -z "$line" ] && continue
|
|
208
|
+
line="${line/#\~/$HOME}"
|
|
209
|
+
if [[ "$resolved" == "$line" || "$resolved" == "$line/"* ]]; then
|
|
210
|
+
return 0
|
|
211
|
+
fi
|
|
212
|
+
done < "$CONSENT_FILE"
|
|
213
|
+
return 1
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
# --- Block messages ---
|
|
217
|
+
block_hard() {
|
|
218
|
+
local resolved="$1"
|
|
219
|
+
echo "Environment isolation: $resolved belongs to another Egregore instance. Access is denied for every tool and cannot be consented — do not retry and do not attempt via other tools. If the user needs something from it, they must fetch it themselves in that instance." >&2
|
|
220
|
+
exit 2
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
block_soft() {
|
|
224
|
+
local resolved="$1" action="$2" dir
|
|
225
|
+
dir=$(dirname "$resolved")
|
|
226
|
+
if [ "$LOCKED" = "true" ]; then
|
|
227
|
+
echo "Environment isolation: $resolved is outside this instance's boundary and the org boundary is locked (egregore.json boundary.locked) — no consent path exists. Do not retry. Use AskUserQuestion with options: 'Paste contents inline' / 'Move the file into the repo and point me at the new path' / 'Cancel'." >&2
|
|
228
|
+
else
|
|
229
|
+
echo "Boundary consent needed: $resolved is outside this instance's $action surface (posture: $POSTURE). Do not retry yet and do not route around via other tools. Ask via AskUserQuestion with exactly these options: 'Allow $dir for this session' (on approval: append $dir as one line to $PROJECT_DIR/.egregore-boundary-consent, then retry) / 'Always allow on this instance' (on approval: add \"$dir\" to the read[] array in $PROJECT_DIR/.egregore-boundary.local.json, then retry) / 'Paste contents inline' / 'Cancel'. Never write a consent grant without the user's explicit approval in this exchange." >&2
|
|
230
|
+
fi
|
|
231
|
+
exit 2
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
# --- Check based on tool type ---
|
|
235
|
+
case "$TOOL_NAME" in
|
|
236
|
+
Read|Glob|Grep)
|
|
237
|
+
if [ "$TOOL_NAME" = "Read" ]; then
|
|
238
|
+
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty' 2>/dev/null) || true
|
|
239
|
+
else
|
|
240
|
+
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.path // empty' 2>/dev/null) || true
|
|
241
|
+
fi
|
|
242
|
+
if [ -z "${FILE_PATH:-}" ]; then
|
|
243
|
+
exit 0 # No path = CWD = project dir, allowed
|
|
244
|
+
fi
|
|
245
|
+
|
|
246
|
+
RESOLVED=$(resolve_path "$FILE_PATH")
|
|
247
|
+
is_denied "$RESOLVED" && block_hard "$RESOLVED"
|
|
248
|
+
in_core_boundary "$RESOLVED" && exit 0
|
|
249
|
+
[ "$POSTURE" = "open" ] && exit 0
|
|
250
|
+
[ "$RELAXED" = "true" ] && exit 0
|
|
251
|
+
in_read_roots "$RESOLVED" && exit 0
|
|
252
|
+
is_consented "$RESOLVED" && exit 0
|
|
253
|
+
block_soft "$RESOLVED" "read"
|
|
254
|
+
;;
|
|
255
|
+
|
|
256
|
+
Edit|Write)
|
|
257
|
+
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty' 2>/dev/null) || true
|
|
258
|
+
if [ -z "${FILE_PATH:-}" ]; then
|
|
259
|
+
exit 0
|
|
260
|
+
fi
|
|
261
|
+
|
|
262
|
+
RESOLVED=$(resolve_path "$FILE_PATH")
|
|
263
|
+
is_denied "$RESOLVED" && block_hard "$RESOLVED"
|
|
264
|
+
in_core_boundary "$RESOLVED" && exit 0
|
|
265
|
+
# Read roots and posture=open grant reads only — writes always need
|
|
266
|
+
# consent (or a bypassPermissions session, unless locked).
|
|
267
|
+
[ "$RELAXED" = "true" ] && exit 0
|
|
268
|
+
is_consented "$RESOLVED" && exit 0
|
|
269
|
+
block_soft "$RESOLVED" "write"
|
|
270
|
+
;;
|
|
271
|
+
|
|
272
|
+
Bash)
|
|
273
|
+
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty' 2>/dev/null) || true
|
|
274
|
+
if [ -z "${COMMAND:-}" ]; then
|
|
275
|
+
exit 0
|
|
276
|
+
fi
|
|
277
|
+
|
|
278
|
+
# HARD tier — never relaxed by posture or bypassPermissions.
|
|
279
|
+
# Pass 1: denied instance paths as literals, matched on a path boundary so
|
|
280
|
+
# a denied path never matches a longer sibling name sharing its prefix.
|
|
281
|
+
for denied in ${DENIED_PATHS:-}; do
|
|
282
|
+
# When the project itself sits inside this denied checkout, a literal
|
|
283
|
+
# match cannot tell the enclosing tree's files from the project's own
|
|
284
|
+
# (the project path continues the denied prefix). Pass 2 resolves every
|
|
285
|
+
# path token and enforces these entries with the self-scope carve-out.
|
|
286
|
+
if [ -n "${B_PROJECT_DIR:-}" ] && [[ "$B_PROJECT_DIR" == "$denied" || "$B_PROJECT_DIR" == "$denied/"* ]]; then
|
|
287
|
+
continue
|
|
288
|
+
fi
|
|
289
|
+
if echo "$COMMAND" | grep -qF "$denied" 2>/dev/null; then
|
|
290
|
+
DENIED_ESC=$(printf '%s' "$denied" | sed -E 's|[^A-Za-z0-9/_-]|\\&|g' 2>/dev/null) || DENIED_ESC=""
|
|
291
|
+
if [ -n "$DENIED_ESC" ] && echo "$COMMAND" | grep -qE "${DENIED_ESC}(\$|[^A-Za-z0-9._-])" 2>/dev/null; then
|
|
292
|
+
block_hard "$denied"
|
|
293
|
+
fi
|
|
294
|
+
fi
|
|
295
|
+
done
|
|
296
|
+
|
|
297
|
+
# Pass 2: resolve path-like tokens — absolute, ~, $HOME, ../ traversal,
|
|
298
|
+
# and plain relative tokens containing a slash (a denied entry can sit
|
|
299
|
+
# inside the project, so "relative stays inside the project" is not a
|
|
300
|
+
# safety argument) — and deny any that resolve into a foreign instance.
|
|
301
|
+
# Relative tokens resolve against the project dir (the tool's working
|
|
302
|
+
# directory), best effort.
|
|
303
|
+
HARD_CANDIDATES=$(echo "$COMMAND" | grep -oE '(~|\$HOME)?/[A-Za-z0-9._/-]+|[A-Za-z0-9._/-]*\.\./[A-Za-z0-9._/-]+|[A-Za-z0-9._-]+/[A-Za-z0-9._/-]+' 2>/dev/null | sort -u | head -40) || true
|
|
304
|
+
for c in $HARD_CANDIDATES; do
|
|
305
|
+
RESOLVED=$(resolve_path "$c")
|
|
306
|
+
is_denied "$RESOLVED" && block_hard "$RESOLVED"
|
|
307
|
+
done
|
|
308
|
+
|
|
309
|
+
# SOFT tier: best-effort. Only user-home-area path literals are checked —
|
|
310
|
+
# system paths are core-allowed and relative paths stay inside the project.
|
|
311
|
+
# A missed path degrades to "no prompt", never to a hard-tier breach.
|
|
312
|
+
[ "$POSTURE" = "open" ] && exit 0
|
|
313
|
+
[ "$RELAXED" = "true" ] && exit 0
|
|
314
|
+
|
|
315
|
+
CANDIDATES=$(echo "$COMMAND" | grep -oE '(~|\$HOME|/Users/[A-Za-z0-9._-]+)/[A-Za-z0-9._/-]+' 2>/dev/null | sort -u | head -20) || true
|
|
316
|
+
for c in $CANDIDATES; do
|
|
317
|
+
RESOLVED=$(resolve_path "$c")
|
|
318
|
+
is_denied "$RESOLVED" && block_hard "$RESOLVED"
|
|
319
|
+
in_core_boundary "$RESOLVED" && continue
|
|
320
|
+
in_read_roots "$RESOLVED" && continue
|
|
321
|
+
is_consented "$RESOLVED" && continue
|
|
322
|
+
block_soft "$RESOLVED" "shell"
|
|
323
|
+
done
|
|
324
|
+
;;
|
|
325
|
+
|
|
326
|
+
*)
|
|
327
|
+
# Other tools (WebFetch, etc.) — allow
|
|
328
|
+
exit 0
|
|
329
|
+
;;
|
|
330
|
+
esac
|
|
331
|
+
|
|
332
|
+
# Default: allow
|
|
333
|
+
exit 0
|