create-egregore 0.19.23 → 0.19.24

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.
Files changed (119) hide show
  1. package/assets/egregore-launcher.js +50 -7
  2. package/assets/egregore-launcher.sh +10 -2
  3. package/bin/cli.js +21 -3
  4. package/lib/codex-runtime.js +25 -3
  5. package/lib/connect-runtime.js +329 -0
  6. package/lib/pi-runtime.js +23 -3
  7. package/lib/setup.js +13 -0
  8. package/package.json +3 -3
  9. package/runtime/codex/.codex/skills/handoff/SKILL.md +35 -11
  10. package/runtime/codex/.codex/skills/save/SKILL.md +39 -4
  11. package/runtime/codex/.codex/spec-manifest.json +2 -2
  12. package/runtime/codex/AGENTS.md +18 -1
  13. package/runtime/codex/bin/agent.sh +28 -14
  14. package/runtime/codex/bin/attendant.sh +169 -6
  15. package/runtime/codex/bin/codex-render-spec.mjs +18 -1
  16. package/runtime/codex/bin/codex-session-start.sh +13 -0
  17. package/runtime/codex/bin/codex-sync-skills.sh +1 -0
  18. package/runtime/codex/bin/graph.sh +21 -1
  19. package/runtime/codex/bin/handoff-run.sh +25 -5
  20. package/runtime/codex/bin/lib/context.sh +220 -172
  21. package/runtime/codex/bin/lib/dashboard-artifact.sh +113 -13
  22. package/runtime/codex/bin/lib/git-sync.sh +44 -8
  23. package/runtime/codex/bin/lib/greeting.sh +34 -11
  24. package/runtime/codex/bin/lib/identity.sh +32 -14
  25. package/runtime/codex/bin/person.py +20 -0
  26. package/runtime/codex/manifest.json +3 -72
  27. package/runtime/pi/.codex/skills/handoff/SKILL.md +35 -11
  28. package/runtime/pi/.codex/skills/save/SKILL.md +39 -4
  29. package/runtime/pi/.codex/spec-manifest.json +2 -2
  30. package/runtime/pi/.pi/APPEND_SYSTEM.md +18 -1
  31. package/runtime/pi/.pi/spec-manifest.json +2 -2
  32. package/runtime/pi/AGENTS.md +18 -1
  33. package/runtime/pi/bin/agent.sh +28 -14
  34. package/runtime/pi/bin/attendant.sh +169 -6
  35. package/runtime/pi/bin/codex-render-spec.mjs +18 -1
  36. package/runtime/pi/bin/codex-session-start.sh +13 -0
  37. package/runtime/pi/bin/codex-sync-skills.sh +1 -0
  38. package/runtime/pi/bin/graph.sh +21 -1
  39. package/runtime/pi/bin/handoff-run.sh +25 -5
  40. package/runtime/pi/bin/lib/context.sh +220 -172
  41. package/runtime/pi/bin/lib/dashboard-artifact.sh +113 -13
  42. package/runtime/pi/bin/lib/git-sync.sh +44 -8
  43. package/runtime/pi/bin/lib/greeting.sh +34 -11
  44. package/runtime/pi/bin/lib/identity.sh +32 -14
  45. package/runtime/pi/bin/person.py +20 -0
  46. package/runtime/pi/bin/pi-product-workflows.mjs +5 -1
  47. package/runtime/pi/manifest.json +3 -72
  48. package/runtime/codex/.codex/skills/add/SKILL.md +0 -29
  49. package/runtime/codex/.codex/skills/answer/SKILL.md +0 -29
  50. package/runtime/codex/.codex/skills/ask/SKILL.md +0 -67
  51. package/runtime/codex/.codex/skills/audit/SKILL.md +0 -29
  52. package/runtime/codex/.codex/skills/autosave/SKILL.md +0 -29
  53. package/runtime/codex/.codex/skills/branch/SKILL.md +0 -29
  54. package/runtime/codex/.codex/skills/commit/SKILL.md +0 -29
  55. package/runtime/codex/.codex/skills/demo-mode/SKILL.md +0 -29
  56. package/runtime/codex/.codex/skills/deploy-bridge/SKILL.md +0 -29
  57. package/runtime/codex/.codex/skills/design/SKILL.md +0 -29
  58. package/runtime/codex/.codex/skills/egregore-voice/SKILL.md +0 -29
  59. package/runtime/codex/.codex/skills/emissary/SKILL.md +0 -45
  60. package/runtime/codex/.codex/skills/env/SKILL.md +0 -29
  61. package/runtime/codex/.codex/skills/ingest-google/SKILL.md +0 -29
  62. package/runtime/codex/.codex/skills/minion/SKILL.md +0 -29
  63. package/runtime/codex/.codex/skills/mock/SKILL.md +0 -29
  64. package/runtime/codex/.codex/skills/pr/SKILL.md +0 -29
  65. package/runtime/codex/.codex/skills/product-voice/SKILL.md +0 -29
  66. package/runtime/codex/.codex/skills/project/SKILL.md +0 -45
  67. package/runtime/codex/.codex/skills/pull/SKILL.md +0 -29
  68. package/runtime/codex/.codex/skills/push/SKILL.md +0 -29
  69. package/runtime/codex/.codex/skills/quest-suggest/SKILL.md +0 -29
  70. package/runtime/codex/.codex/skills/review-pr/SKILL.md +0 -45
  71. package/runtime/codex/.codex/skills/scroll/SKILL.md +0 -288
  72. package/runtime/codex/.codex/skills/scroll/agents/openai.yaml +0 -4
  73. package/runtime/codex/.codex/skills/scroll/assets/shell.html +0 -871
  74. package/runtime/codex/.codex/skills/search/SKILL.md +0 -79
  75. package/runtime/codex/.codex/skills/session-view/SKILL.md +0 -29
  76. package/runtime/codex/.codex/skills/setup/SKILL.md +0 -29
  77. package/runtime/codex/.codex/skills/summon/SKILL.md +0 -45
  78. package/runtime/codex/.codex/skills/task/SKILL.md +0 -29
  79. package/runtime/codex/.codex/skills/teams-connect/SKILL.md +0 -29
  80. package/runtime/codex/.codex/skills/telegram-connect/SKILL.md +0 -29
  81. package/runtime/codex/.codex/skills/the-spiral/SKILL.md +0 -84
  82. package/runtime/codex/.codex/skills/thread/SKILL.md +0 -29
  83. package/runtime/codex/.codex/skills/todo/SKILL.md +0 -45
  84. package/runtime/pi/.codex/skills/add/SKILL.md +0 -29
  85. package/runtime/pi/.codex/skills/answer/SKILL.md +0 -29
  86. package/runtime/pi/.codex/skills/ask/SKILL.md +0 -67
  87. package/runtime/pi/.codex/skills/audit/SKILL.md +0 -29
  88. package/runtime/pi/.codex/skills/autosave/SKILL.md +0 -29
  89. package/runtime/pi/.codex/skills/branch/SKILL.md +0 -29
  90. package/runtime/pi/.codex/skills/commit/SKILL.md +0 -29
  91. package/runtime/pi/.codex/skills/demo-mode/SKILL.md +0 -29
  92. package/runtime/pi/.codex/skills/deploy-bridge/SKILL.md +0 -29
  93. package/runtime/pi/.codex/skills/design/SKILL.md +0 -29
  94. package/runtime/pi/.codex/skills/egregore-voice/SKILL.md +0 -29
  95. package/runtime/pi/.codex/skills/emissary/SKILL.md +0 -45
  96. package/runtime/pi/.codex/skills/env/SKILL.md +0 -29
  97. package/runtime/pi/.codex/skills/ingest-google/SKILL.md +0 -29
  98. package/runtime/pi/.codex/skills/minion/SKILL.md +0 -29
  99. package/runtime/pi/.codex/skills/mock/SKILL.md +0 -29
  100. package/runtime/pi/.codex/skills/pr/SKILL.md +0 -29
  101. package/runtime/pi/.codex/skills/product-voice/SKILL.md +0 -29
  102. package/runtime/pi/.codex/skills/project/SKILL.md +0 -45
  103. package/runtime/pi/.codex/skills/pull/SKILL.md +0 -29
  104. package/runtime/pi/.codex/skills/push/SKILL.md +0 -29
  105. package/runtime/pi/.codex/skills/quest-suggest/SKILL.md +0 -29
  106. package/runtime/pi/.codex/skills/review-pr/SKILL.md +0 -45
  107. package/runtime/pi/.codex/skills/scroll/SKILL.md +0 -288
  108. package/runtime/pi/.codex/skills/scroll/agents/openai.yaml +0 -4
  109. package/runtime/pi/.codex/skills/scroll/assets/shell.html +0 -871
  110. package/runtime/pi/.codex/skills/search/SKILL.md +0 -79
  111. package/runtime/pi/.codex/skills/session-view/SKILL.md +0 -29
  112. package/runtime/pi/.codex/skills/setup/SKILL.md +0 -29
  113. package/runtime/pi/.codex/skills/summon/SKILL.md +0 -45
  114. package/runtime/pi/.codex/skills/task/SKILL.md +0 -29
  115. package/runtime/pi/.codex/skills/teams-connect/SKILL.md +0 -29
  116. package/runtime/pi/.codex/skills/telegram-connect/SKILL.md +0 -29
  117. package/runtime/pi/.codex/skills/the-spiral/SKILL.md +0 -84
  118. package/runtime/pi/.codex/skills/thread/SKILL.md +0 -29
  119. package/runtime/pi/.codex/skills/todo/SKILL.md +0 -45
@@ -48,7 +48,27 @@ _millis() {
48
48
  # greeting) pay zero network round-trips when warm. TTL in seconds; unset/0
49
49
  # disables. Mutating queries are never cached.
50
50
  _CACHE_TTL="${EGREGORE_GRAPH_CACHE_TTL:-0}"
51
- _CACHE_DIR="$HOME/.egregore/graph-cache/$(echo -n "$SCRIPT_DIR" | cksum | cut -d' ' -f1)"
51
+ # Key the cache by the MAIN checkout so worktree sessions hit the same warm
52
+ # cache the attendant maintains (its replay uses the same derivation).
53
+ # Worktrees have .git as a FILE pointing into the main repo's .git/worktrees/.
54
+ # api_url + slug are part of the key so entries never cross tenants when the
55
+ # same checkout is repointed at a different org/API (cache entries are keyed
56
+ # only by query+params below, so the directory must carry the tenant).
57
+ _CACHE_ROOT="$SCRIPT_DIR"
58
+ if [ -f "$SCRIPT_DIR/.git" ]; then
59
+ _WT_GITDIR=$(sed 's/^gitdir: //' "$SCRIPT_DIR/.git" 2>/dev/null || true)
60
+ if [ -n "$_WT_GITDIR" ]; then
61
+ _CACHE_ROOT=$(cd "$_WT_GITDIR/../../.." 2>/dev/null && pwd || echo "$SCRIPT_DIR")
62
+ fi
63
+ fi
64
+ # The scope is a non-secret fingerprint of the EFFECTIVE endpoint + credential
65
+ # (already resolved above: process env → .env → committed api_url). Committed
66
+ # config alone is not enough — an EGREGORE_API_URL/KEY override or a swapped
67
+ # .env can point this checkout at a different tenant than egregore.json names,
68
+ # and the entry key below carries only query+params. cksum output is a CRC,
69
+ # not a reversible or usable credential.
70
+ _CACHE_SCOPE=$(echo -n "${API_URL:-}|${API_KEY:-}" | cksum | cut -d' ' -f1)
71
+ _CACHE_DIR="$HOME/.egregore/graph-cache/$(echo -n "${_CACHE_ROOT}|${_CACHE_SCOPE}" | cksum | cut -d' ' -f1)"
52
72
 
53
73
  _cache_key() {
54
74
  echo -n "$1|${2:-}" | cksum | cut -d' ' -f1
@@ -12,6 +12,8 @@ set -euo pipefail
12
12
  # [--recipient <name>] \
13
13
  # [--project <name>] \
14
14
  # [--intent <action|feedback|fyi>] \
15
+ # [--content-mode <supplied|generated>] \
16
+ # [--include-session-artifacts] \
15
17
  # <<'HANDOFFEOF'
16
18
  # ...full markdown body of the handoff...
17
19
  # HANDOFFEOF
@@ -19,7 +21,7 @@ set -euo pipefail
19
21
  # The full file body is read from stdin. The script:
20
22
  # 1. Computes the file path: memory/handoffs/YYYY-MM/DD-author-slug.md
21
23
  # 2. Writes the file
22
- # 3. Appends ## Repo State section (from bin/repo-state.sh) if non-empty
24
+ # 3. In generated mode, appends ## Repo State when non-empty
23
25
  # 4. Prepends memory/handoffs/index.md with a new entry
24
26
  # 5. Runs bin/index-handoff.sh (connected mode only) — creates Session node
25
27
  # and returns a subgraph snapshot in the result JSON
@@ -51,6 +53,8 @@ NO_PUSH=0
51
53
  NO_NOTIFY=0
52
54
  NO_PUBLISH=0
53
55
  COMPOSED="" # optional house-kit JSON — the agent-composed render spec
56
+ CONTENT_MODE="generated"
57
+ INCLUDE_SESSION_ARTIFACTS=0
54
58
 
55
59
  while [ $# -gt 0 ]; do
56
60
  case "$1" in
@@ -60,6 +64,8 @@ while [ $# -gt 0 ]; do
60
64
  --project) PROJECT="${2:-}"; shift 2 ;;
61
65
  --intent) INTENT="${2:-}"; shift 2 ;;
62
66
  --composed) COMPOSED="${2:-}"; shift 2 ;;
67
+ --content-mode) CONTENT_MODE="${2:-}"; shift 2 ;;
68
+ --include-session-artifacts) INCLUDE_SESSION_ARTIFACTS=1; shift ;;
63
69
  --no-push) NO_PUSH=1; shift ;;
64
70
  --no-notify) NO_NOTIFY=1; shift ;;
65
71
  --no-publish) NO_PUBLISH=1; shift ;;
@@ -72,7 +78,7 @@ done
72
78
  # markdown file is ALWAYS the memory record + graph index either way.
73
79
  RENDER_TYPE="handoff"
74
80
  RENDER_SRC="" # resolved to $ABS_FILE after the file is written, unless composed
75
- if [ -n "$COMPOSED" ] && [ -f "$COMPOSED" ]; then
81
+ if [ "$CONTENT_MODE" = "generated" ] && [ -n "$COMPOSED" ] && [ -f "$COMPOSED" ]; then
76
82
  RENDER_TYPE="composed"
77
83
  RENDER_SRC="$COMPOSED"
78
84
  fi
@@ -83,6 +89,14 @@ case "$INTENT" in
83
89
  action|feedback|fyi) ;;
84
90
  *) echo "Invalid --intent: $INTENT (action|feedback|fyi)" >&2; exit 1 ;;
85
91
  esac
92
+ case "$CONTENT_MODE" in
93
+ supplied|generated) ;;
94
+ *) echo "Invalid --content-mode: $CONTENT_MODE (supplied|generated)" >&2; exit 1 ;;
95
+ esac
96
+ if [ "$CONTENT_MODE" = "supplied" ] && [ -n "$COMPOSED" ]; then
97
+ echo "--composed cannot be used with --content-mode supplied" >&2
98
+ exit 1
99
+ fi
86
100
 
87
101
  MODE=$(jq -r '.mode // "connected"' "$CONFIG" 2>/dev/null || echo "connected")
88
102
  TODAY=$(date +%Y-%m-%d)
@@ -140,6 +154,7 @@ MISSING_FROM=0; _has_frontmatter_key from || _has_frontmatter_key author ||
140
154
  MISSING_DATE=0; _has_frontmatter_key date || MISSING_DATE=1
141
155
  MISSING_TOPIC=0; _has_frontmatter_key topic || MISSING_TOPIC=1
142
156
  MISSING_INTENT=0; _has_frontmatter_key intent || MISSING_INTENT=1
157
+ MISSING_CONTENT_MODE=0; _has_frontmatter_key content_mode || MISSING_CONTENT_MODE=1
143
158
  MISSING_RECIPIENT=0
144
159
  if [ -n "$RECIPIENT" ]; then
145
160
  _has_frontmatter_key addressed_to || _has_frontmatter_key to || MISSING_RECIPIENT=1
@@ -150,9 +165,10 @@ awk \
150
165
  -v schema="$MISSING_SCHEMA" -v mode="$MISSING_MODE" -v kind="$MISSING_KIND" \
151
166
  -v from="$MISSING_FROM" -v date_missing="$MISSING_DATE" \
152
167
  -v topic_missing="$MISSING_TOPIC" -v intent_missing="$MISSING_INTENT" \
168
+ -v content_mode_missing="$MISSING_CONTENT_MODE" \
153
169
  -v recipient_missing="$MISSING_RECIPIENT" \
154
170
  -v author="$AUTHOR" -v date="$TODAY" -v topic="$TOPIC" \
155
- -v intent="$INTENT" -v recipient="$RECIPIENT" '
171
+ -v intent="$INTENT" -v recipient="$RECIPIENT" -v content_mode="$CONTENT_MODE" '
156
172
  function metadata() {
157
173
  if (schema) print "capture_schema: egregore-capture/v1"
158
174
  if (mode) print "capture_mode: addressed"
@@ -162,13 +178,14 @@ awk \
162
178
  if (date_missing) print "date: " date
163
179
  if (topic_missing) print "topic: " topic
164
180
  if (intent_missing) print "intent: " intent
181
+ if (content_mode_missing) print "content_mode: " content_mode
165
182
  }
166
183
  BEGIN {
167
184
  if (!has_frontmatter) {
168
185
  print "---"
169
186
  metadata()
170
187
  print "---"
171
- print ""
188
+ if (content_mode != "supplied") print ""
172
189
  }
173
190
  }
174
191
  has_frontmatter && NR == 1 {
@@ -182,7 +199,10 @@ awk \
182
199
  # --- Append repo state ---------------------------------------------------
183
200
  # --no-pr skips `gh pr list` (~400–600ms per repo). A detached PR backfill
184
201
  # after the parallel phase rewrites `—` → `#N` and re-pushes memory.
185
- REPO_STATE=$(bash "$SCRIPT_DIR/bin/repo-state.sh" --no-pr 2>/dev/null || true)
202
+ REPO_STATE=""
203
+ if [ "$CONTENT_MODE" = "generated" ] || [ "$INCLUDE_SESSION_ARTIFACTS" = "1" ]; then
204
+ REPO_STATE=$(bash "$SCRIPT_DIR/bin/repo-state.sh" --no-pr 2>/dev/null || true)
205
+ fi
186
206
  if [ -n "$REPO_STATE" ]; then
187
207
  printf '\n%s\n' "$REPO_STATE" >> "$ABS_FILE"
188
208
  fi