create-egregore 0.18.0 → 0.18.2
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/bin/cli.js +5 -0
- package/lib/ui.js +30 -9
- package/package.json +4 -3
- package/runtime/codex/AGENTS.md +4 -292
- package/runtime/codex/bin/activity-data.sh +3 -6
- package/runtime/codex/bin/agent.sh +0 -0
- package/runtime/codex/bin/codex-install-skills.sh +0 -0
- package/runtime/codex/bin/codex-render-spec.mjs +0 -0
- package/runtime/codex/bin/codex-session-start.sh +0 -0
- package/runtime/codex/bin/codex-skill-render.mjs +0 -0
- package/runtime/codex/bin/codex-sync-skills.sh +0 -0
- package/runtime/codex/bin/dashboard-data.sh +2 -6
- package/runtime/codex/bin/graph-batch.sh +0 -0
- package/runtime/codex/bin/graph-op.sh +5 -22
- package/runtime/codex/bin/graph-wal.sh +0 -0
- package/runtime/codex/bin/graph.sh +0 -0
- package/runtime/codex/bin/handoff-pr-backfill.sh +0 -0
- package/runtime/codex/bin/handoff-run.sh +6 -144
- package/runtime/codex/bin/handoff-save-egregore.sh +0 -0
- package/runtime/codex/bin/index-handoff.sh +0 -0
- package/runtime/codex/bin/lib/artifact-id.sh +0 -0
- package/runtime/codex/bin/lib/config.sh +0 -0
- package/runtime/codex/bin/lib/context.sh +0 -48
- package/runtime/codex/bin/lib/ensure-develop.sh +0 -0
- package/runtime/codex/bin/lib/greeting.sh +2 -20
- package/runtime/codex/bin/lib/hash.sh +0 -0
- package/runtime/codex/bin/lib/time.sh +0 -0
- package/runtime/codex/bin/notify.sh +0 -0
- package/runtime/codex/bin/publish-artifact.sh +1 -15
- package/runtime/codex/bin/publish-references.sh +0 -0
- package/runtime/codex/bin/repo-state.sh +0 -0
- package/runtime/codex/bin/telemetry.sh +0 -0
- package/runtime/codex/bin/worktree-create.sh +8 -5
- package/runtime/codex/bin/worktree-remove.sh +0 -0
- package/runtime/codex/bin/worktree.sh +4 -5
- package/runtime/codex/manifest.json +3 -12
- package/runtime/codex/.codex/skills/comment/SKILL.md +0 -25
- package/runtime/codex/.codex/skills/edit/SKILL.md +0 -25
- package/runtime/codex/.codex/skills/edit-process/SKILL.md +0 -25
- package/runtime/codex/.codex/skills/infra/SKILL.md +0 -41
- package/runtime/codex/bin/lib/edit-loopback.mjs +0 -652
|
@@ -203,13 +203,14 @@ PID_GRAPH=$!
|
|
|
203
203
|
ARTIFACTS_JSON="[]"
|
|
204
204
|
if [ "$MODE" = "connected" ]; then
|
|
205
205
|
YY=$(date +%Y); MM=$(date +%-m); DD_NUM=$(date +%-d)
|
|
206
|
+
PARAMS=$(jq -nc --arg gh "$AUTHOR" '{gh:$gh}')
|
|
206
207
|
RAW=$(bash "$SCRIPT_DIR/bin/graph.sh" query "
|
|
207
208
|
MATCH (a:Artifact)-[:CONTRIBUTED_BY]->(p:Person {github: \$gh})
|
|
208
209
|
WHERE a.created >= datetime({year: $YY, month: $MM, day: $DD_NUM})
|
|
209
210
|
AND NOT 'tutorial-generated' IN coalesce(a.topics, [])
|
|
210
211
|
RETURN a.title AS title, a.type AS type, a.filePath AS path
|
|
211
212
|
ORDER BY a.created DESC
|
|
212
|
-
LIMIT 5" "$
|
|
213
|
+
LIMIT 5" "$PARAMS" 2>/dev/null || echo '{}')
|
|
213
214
|
# Response shape: {"fields":[...], "values":[[...], ...]}. Convert to
|
|
214
215
|
# an array of {title, type, path} objects.
|
|
215
216
|
ARTIFACTS_JSON=$(echo "$RAW" | jq -c '
|
|
@@ -281,145 +282,24 @@ PID_ARTIFACTS=$!
|
|
|
281
282
|
PID_MEMORY=$!
|
|
282
283
|
|
|
283
284
|
# --- Branch C: Publish artifact → Notify ---
|
|
284
|
-
#
|
|
285
|
-
# Strategy: handoffs publish ONCE, through the emissary write API, using
|
|
286
|
-
# `render_mode: "custom"` so the server serves OUR pre-rendered HTML
|
|
287
|
-
# verbatim (the same egregore-artifacts handoff template /view/ has
|
|
288
|
-
# always used). This gives us:
|
|
289
|
-
# - one artifact, one URL (no legacy + new double-publish)
|
|
290
|
-
# - permanent egregore.xyz/emissary/e/<id> URL with /raw endpoint
|
|
291
|
-
# - handoff design fully owned client-side (egregore-artifacts) — the
|
|
292
|
-
# emissary server template is never invoked for handoffs and remains
|
|
293
|
-
# completely untouched
|
|
294
|
-
#
|
|
295
|
-
# Fallback: if emissary publish fails (token missing, network, size cap,
|
|
296
|
-
# rendering failure), fall back to the legacy publish-artifact.sh path so
|
|
297
|
-
# a handoff still gets a Telegram-able URL.
|
|
298
285
|
(
|
|
299
|
-
V1URL=""
|
|
300
286
|
AURL=""
|
|
301
|
-
if [ "$NO_PUBLISH" = "0" ]; then
|
|
302
|
-
EMISSARY_CONFIG="$HOME/.egregore/emissary-config.json"
|
|
303
|
-
EMISSARY_TOKEN=""
|
|
304
|
-
if [ -f "$EMISSARY_CONFIG" ]; then
|
|
305
|
-
EMISSARY_TOKEN=$(jq -r '.auth_token // empty' "$EMISSARY_CONFIG" 2>/dev/null)
|
|
306
|
-
fi
|
|
307
|
-
EMISSARY_API_URL="${EMISSARY_API_URL:-https://egregore-production-55f2.up.railway.app/api/v1/emissary}"
|
|
308
|
-
|
|
309
|
-
if [ -n "$EMISSARY_TOKEN" ]; then
|
|
310
|
-
# Step 1: render the handoff to HTML locally using egregore-artifacts.
|
|
311
|
-
# Same renderer + template publish-artifact.sh uses today — handoffs
|
|
312
|
-
# keep their familiar look.
|
|
313
|
-
RENDERED_HTML="$TMPD/handoff.html"
|
|
314
|
-
RENDER_OK=0
|
|
315
|
-
LOCAL_CLI="$SCRIPT_DIR/packages/egregore-artifacts/bin/cli.js"
|
|
316
|
-
if [ "${EGREGORE_USE_PUBLISHED:-0}" != "1" ] && [ -f "$LOCAL_CLI" ] && [ -d "$SCRIPT_DIR/packages/egregore-artifacts/node_modules/react" ]; then
|
|
317
|
-
if node "$LOCAL_CLI" handoff "$ABS_FILE" --output "$RENDERED_HTML" >/dev/null 2>&1; then
|
|
318
|
-
RENDER_OK=1
|
|
319
|
-
fi
|
|
320
|
-
else
|
|
321
|
-
if npx egregore-artifacts handoff "$ABS_FILE" --output "$RENDERED_HTML" >/dev/null 2>&1; then
|
|
322
|
-
RENDER_OK=1
|
|
323
|
-
fi
|
|
324
|
-
fi
|
|
325
|
-
|
|
326
|
-
# Step 2: build the emissary payload. If rendering succeeded AND the
|
|
327
|
-
# HTML fits the server's 100KB cap, send it with render_mode=custom.
|
|
328
|
-
# If not, fall through to the structured-only path (server-rendered
|
|
329
|
-
# via the emissary template — undesirable for handoffs but still
|
|
330
|
-
# better than no URL).
|
|
331
|
-
if [ "$RENDER_OK" = "1" ] && [ -f "$RENDERED_HTML" ]; then
|
|
332
|
-
RENDER_SIZE=$(wc -c < "$RENDERED_HTML" | tr -d ' ')
|
|
333
|
-
if [ "$RENDER_SIZE" -gt 0 ] && [ "$RENDER_SIZE" -lt 100000 ]; then
|
|
334
|
-
# Author display name
|
|
335
|
-
DISPLAY_NAME="$AUTHOR"
|
|
336
|
-
PERSON_FILE="$SCRIPT_DIR/memory/people/${AUTHOR}.md"
|
|
337
|
-
if [ -f "$PERSON_FILE" ]; then
|
|
338
|
-
DISPLAY_NAME=$(head -1 "$PERSON_FILE" | sed 's/^# //')
|
|
339
|
-
fi
|
|
340
|
-
|
|
341
|
-
# addressed_to: only set if there's a recipient
|
|
342
|
-
ADDRESSED_TO="[]"
|
|
343
|
-
if [ -n "$RECIPIENT" ]; then
|
|
344
|
-
RECIP_HANDLE=$(echo "$RECIPIENT" | tr '[:upper:]' '[:lower:]' | awk '{print $1}')
|
|
345
|
-
ADDRESSED_TO=$(jq -nc --arg h "$RECIP_HANDLE" --arg d "$RECIPIENT" '[{"handle":$h,"display":$d}]')
|
|
346
|
-
fi
|
|
347
|
-
|
|
348
|
-
CLAIM=$(echo "$BRIEFING_LEAD" | cut -c1-200)
|
|
349
|
-
|
|
350
|
-
# body.prose is schema-required non-empty even when render_mode is
|
|
351
|
-
# "custom" (server validates structurally regardless of render
|
|
352
|
-
# mode). The visible page is the custom HTML; prose just needs to
|
|
353
|
-
# be non-empty plain text for /raw consumers and validation. Use
|
|
354
|
-
# the briefing lead (which the lead/claim is already derived from).
|
|
355
|
-
PROSE_TEXT="${BRIEFING_LEAD:-$TOPIC}"
|
|
356
|
-
|
|
357
|
-
# Use --rawfile so the rendered HTML is read directly from disk
|
|
358
|
-
# into a JSON-string. Faster than shell-var roundtrip and avoids
|
|
359
|
-
# any quoting headaches for HTML.
|
|
360
|
-
V1JSON=$(jq -nc \
|
|
361
|
-
--arg topic "$TOPIC" \
|
|
362
|
-
--arg claim "$CLAIM" \
|
|
363
|
-
--arg summary "$CLAIM" \
|
|
364
|
-
--arg prose "$PROSE_TEXT" \
|
|
365
|
-
--argjson addressed "$ADDRESSED_TO" \
|
|
366
|
-
--rawfile render_html "$RENDERED_HTML" \
|
|
367
|
-
'{
|
|
368
|
-
kind: "continuation",
|
|
369
|
-
topic: $topic,
|
|
370
|
-
claim: $claim,
|
|
371
|
-
summary: $summary,
|
|
372
|
-
body: { prose: $prose },
|
|
373
|
-
audience: {
|
|
374
|
-
addressed_to: $addressed,
|
|
375
|
-
visible_to: "public",
|
|
376
|
-
extendable_by: "anyone"
|
|
377
|
-
},
|
|
378
|
-
parents: [],
|
|
379
|
-
render_mode: "custom",
|
|
380
|
-
render_html: $render_html
|
|
381
|
-
}')
|
|
382
|
-
|
|
383
|
-
V1RESULT=$(curl -sf -X POST "$EMISSARY_API_URL/emissaries" \
|
|
384
|
-
-H "Content-Type: application/json" \
|
|
385
|
-
-H "Authorization: Bearer $EMISSARY_TOKEN" \
|
|
386
|
-
-d "$V1JSON" 2>/dev/null || echo '{}')
|
|
387
|
-
|
|
388
|
-
V1URL=$(echo "$V1RESULT" | jq -r '.url // ""' 2>/dev/null || echo "")
|
|
389
|
-
fi
|
|
390
|
-
fi
|
|
391
|
-
fi
|
|
392
|
-
fi
|
|
393
|
-
|
|
394
|
-
# Fallback: if the emissary publish didn't produce a URL (no token, no
|
|
395
|
-
# network, size cap, render failure), fire the legacy publish-artifact.sh
|
|
396
|
-
# so handoffs still get a Telegram-able URL.
|
|
397
|
-
if [ -z "$V1URL" ] && [ "$NO_PUBLISH" = "0" ] && [ -x "$SCRIPT_DIR/bin/publish-artifact.sh" ]; then
|
|
287
|
+
if [ "$NO_PUBLISH" = "0" ] && [ -x "$SCRIPT_DIR/bin/publish-artifact.sh" ]; then
|
|
398
288
|
AURL=$(bash "$SCRIPT_DIR/bin/publish-artifact.sh" handoff "$ABS_FILE" \
|
|
399
289
|
--title "$TOPIC" \
|
|
400
290
|
--author "$AUTHOR" \
|
|
401
291
|
--description "$BRIEFING_LEAD" 2>/dev/null || echo "")
|
|
402
292
|
fi
|
|
403
|
-
|
|
404
|
-
# Prefer v1 (emissary-rendered) URL when available; fall back to the
|
|
405
|
-
# legacy egregore-artifacts URL only if the v1 publish failed.
|
|
406
|
-
NOTIFY_URL=""
|
|
407
|
-
if [ -n "$V1URL" ]; then
|
|
408
|
-
echo "$V1URL" > "$TMPD/artifact"
|
|
409
|
-
NOTIFY_URL="$V1URL"
|
|
410
|
-
else
|
|
411
|
-
echo "$AURL" > "$TMPD/artifact"
|
|
412
|
-
NOTIFY_URL="$AURL"
|
|
413
|
-
fi
|
|
293
|
+
echo "$AURL" > "$TMPD/artifact"
|
|
414
294
|
|
|
415
295
|
NS="skipped"
|
|
416
296
|
if [ "$NO_NOTIFY" = "0" ]; then
|
|
417
|
-
if [ -n "$
|
|
297
|
+
if [ -n "$AURL" ]; then
|
|
418
298
|
MSG_NOTIFY="Handoff from ${AUTHOR}: ${TOPIC}
|
|
419
299
|
|
|
420
300
|
\"${BRIEFING_SHORT}\"
|
|
421
301
|
|
|
422
|
-
View: ${
|
|
302
|
+
View: ${AURL}"
|
|
423
303
|
else
|
|
424
304
|
MSG_NOTIFY="Handoff from ${AUTHOR}: ${TOPIC}
|
|
425
305
|
|
|
@@ -465,27 +345,9 @@ if [ -s "$TMPD/graph" ]; then
|
|
|
465
345
|
GRAPH_STATUS=$(sed -n '3p' "$TMPD/graph")
|
|
466
346
|
fi
|
|
467
347
|
[ -z "$RESOLVED" ] && RESOLVED=0
|
|
468
|
-
# Sanitize: --argjson requires a number. If RESOLVED came back as a slug or
|
|
469
|
-
# anything non-numeric (the index-handoff.sh output format has drifted in
|
|
470
|
-
# the past — defensive guard), fall back to 0 so the result file still builds.
|
|
471
|
-
if ! echo "$RESOLVED" | grep -qE '^[0-9]+$'; then
|
|
472
|
-
RESOLVED=0
|
|
473
|
-
fi
|
|
474
348
|
|
|
475
349
|
SUBGRAPH_JSON=$(cat "$TMPD/subgraph" 2>/dev/null || echo "null")
|
|
476
350
|
[ -z "$SUBGRAPH_JSON" ] && SUBGRAPH_JSON="null"
|
|
477
|
-
# Sanitize: --argjson requires valid JSON. Multiple writes to the same
|
|
478
|
-
# tmpfile have produced concatenated values in the past (e.g. "null\n{...}"),
|
|
479
|
-
# which jq rejects on multi-document input. Validate; on failure, take the
|
|
480
|
-
# LAST non-empty line and re-validate; if still bad, fall back to null.
|
|
481
|
-
if ! printf '%s' "$SUBGRAPH_JSON" | jq -s 'length == 1' 2>/dev/null | grep -q '^true$'; then
|
|
482
|
-
LAST_LINE=$(printf '%s\n' "$SUBGRAPH_JSON" | awk 'NF{last=$0} END{print last}')
|
|
483
|
-
if printf '%s' "$LAST_LINE" | jq -e '.' >/dev/null 2>&1; then
|
|
484
|
-
SUBGRAPH_JSON="$LAST_LINE"
|
|
485
|
-
else
|
|
486
|
-
SUBGRAPH_JSON="null"
|
|
487
|
-
fi
|
|
488
|
-
fi
|
|
489
351
|
|
|
490
352
|
MEMORY_STATUS=$(cat "$TMPD/memory" 2>/dev/null || echo "skipped")
|
|
491
353
|
ARTIFACT_URL=$(cat "$TMPD/artifact" 2>/dev/null || echo "")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -364,54 +364,6 @@ fi
|
|
|
364
364
|
echo "$RICH" > "$CTX_DIR/addressed_rich"
|
|
365
365
|
) &
|
|
366
366
|
|
|
367
|
-
# 6.5. Pending questions addressed to user (background)
|
|
368
|
-
(
|
|
369
|
-
PENDING_JSON="[]"
|
|
370
|
-
QDIR="$SCRIPT_DIR/memory/knowledge/questions"
|
|
371
|
-
if [ -d "$QDIR" ]; then
|
|
372
|
-
# Match against the same identity variants used for handoffs (display name,
|
|
373
|
-
# github first-name, people-file name) so "to: oz" matches author "oguzhan".
|
|
374
|
-
_DISPLAY_Q=$(jq -r '.display_name // empty' "$STATE_FILE" 2>/dev/null)
|
|
375
|
-
_GH_NAME_Q=$(jq -r '.github_name // empty' "$STATE_FILE" 2>/dev/null)
|
|
376
|
-
_FIRST_NAME_Q=$(echo "$_GH_NAME_Q" | awk '{print tolower($1)}')
|
|
377
|
-
_PEOPLE_FILE_Q="$SCRIPT_DIR/memory/people/$(echo "$AUTHOR" | tr '[:upper:]' '[:lower:]').md"
|
|
378
|
-
_PEOPLE_NAME_Q=""
|
|
379
|
-
[ -f "$_PEOPLE_FILE_Q" ] && _PEOPLE_NAME_Q=$(sed -n 's/^# *//p' "$_PEOPLE_FILE_Q" 2>/dev/null | head -1 | awk '{print tolower($1)}')
|
|
380
|
-
|
|
381
|
-
LINES=""
|
|
382
|
-
for QF in "$QDIR"/*.md; do
|
|
383
|
-
[ -f "$QF" ] || continue
|
|
384
|
-
Q_TO=$(sed -n 's/^to:[[:space:]]*//p' "$QF" 2>/dev/null | head -1 | tr -d '"' | tr '[:upper:]' '[:lower:]' | awk '{print $1}')
|
|
385
|
-
[ -z "$Q_TO" ] && continue
|
|
386
|
-
_MATCH="false"
|
|
387
|
-
for _V in "$AUTHOR" "$_DISPLAY_Q" "$_FIRST_NAME_Q" "$_PEOPLE_NAME_Q"; do
|
|
388
|
-
[ -z "$_V" ] && continue
|
|
389
|
-
_V_LC=$(echo "$_V" | tr '[:upper:]' '[:lower:]')
|
|
390
|
-
[ "$Q_TO" = "$_V_LC" ] && _MATCH="true" && break
|
|
391
|
-
done
|
|
392
|
-
[ "$_MATCH" = "true" ] || continue
|
|
393
|
-
Q_STATUS=$(sed -n 's/^status:[[:space:]]*//p' "$QF" 2>/dev/null | head -1 | tr -d '"')
|
|
394
|
-
[ "$Q_STATUS" = "pending" ] || continue
|
|
395
|
-
Q_FROM=$(sed -n 's/^from:[[:space:]]*//p' "$QF" 2>/dev/null | head -1 | tr -d '"')
|
|
396
|
-
Q_TOPIC=$(sed -n 's/^topic:[[:space:]]*//p' "$QF" 2>/dev/null | head -1 | tr -d '"')
|
|
397
|
-
Q_HID=$(sed -n 's/^harvest_id:[[:space:]]*//p' "$QF" 2>/dev/null | head -1 | tr -d '"')
|
|
398
|
-
Q_REL="${QF#$SCRIPT_DIR/}"
|
|
399
|
-
LINE=$(jq -nc \
|
|
400
|
-
--arg from "$Q_FROM" \
|
|
401
|
-
--arg topic "$Q_TOPIC" \
|
|
402
|
-
--arg hid "$Q_HID" \
|
|
403
|
-
--arg file "$Q_REL" \
|
|
404
|
-
'{from:$from, topic:$topic, harvest_id:$hid, file:$file}' 2>/dev/null)
|
|
405
|
-
[ -n "$LINE" ] && LINES="$LINES$LINE
|
|
406
|
-
"
|
|
407
|
-
done
|
|
408
|
-
if [ -n "$LINES" ]; then
|
|
409
|
-
PENDING_JSON=$(echo "$LINES" | jq -sc '.' 2>/dev/null || echo "[]")
|
|
410
|
-
fi
|
|
411
|
-
fi
|
|
412
|
-
echo "$PENDING_JSON" > "$CTX_DIR/pending_questions"
|
|
413
|
-
) &
|
|
414
|
-
|
|
415
367
|
# 7. Graph health (background — zero added latency, runs in parallel)
|
|
416
368
|
(
|
|
417
369
|
if [ "$LOCAL_MODE" = "true" ]; then
|
|
File without changes
|
|
@@ -112,26 +112,8 @@ if [ "$ADDRESSED_COUNT" -gt 0 ] 2>/dev/null && [ "$ADDRESSED_COUNT" != "0" ]; th
|
|
|
112
112
|
done
|
|
113
113
|
fi
|
|
114
114
|
|
|
115
|
-
#
|
|
116
|
-
|
|
117
|
-
PENDING_Q_COUNT=$(echo "$PENDING_Q" | jq 'length' 2>/dev/null || echo "0")
|
|
118
|
-
if [ "$PENDING_Q_COUNT" -gt 0 ] 2>/dev/null && [ "$PENDING_Q_COUNT" != "0" ]; then
|
|
119
|
-
PQ_SENDERS=$(echo "$PENDING_Q" | jq -r '[.[].from] | unique | join(", ")' 2>/dev/null)
|
|
120
|
-
if [ "$PENDING_Q_COUNT" = "1" ]; then
|
|
121
|
-
PQ_NOUN="question"
|
|
122
|
-
else
|
|
123
|
-
PQ_NOUN="questions"
|
|
124
|
-
fi
|
|
125
|
-
if [ -n "$PQ_SENDERS" ]; then
|
|
126
|
-
printf " ◐ %s pending %s from %s — /answer to engage\n" "$PENDING_Q_COUNT" "$PQ_NOUN" "$PQ_SENDERS"
|
|
127
|
-
else
|
|
128
|
-
printf " ◐ %s pending %s — /answer to engage\n" "$PENDING_Q_COUNT" "$PQ_NOUN"
|
|
129
|
-
fi
|
|
130
|
-
fi
|
|
131
|
-
|
|
132
|
-
# Fallback: last activity if no handoffs and no pending questions
|
|
133
|
-
if { [ "$ADDRESSED_COUNT" = "0" ] || [ -z "$ADDRESSED_COUNT" ]; } \
|
|
134
|
-
&& { [ "$PENDING_Q_COUNT" = "0" ] || [ -z "$PENDING_Q_COUNT" ]; }; then
|
|
115
|
+
# Fallback: last activity if no handoffs
|
|
116
|
+
if [ "$ADDRESSED_COUNT" = "0" ] || [ -z "$ADDRESSED_COUNT" ]; then
|
|
135
117
|
LAST_ACTIVITY=$(cat "$CTX_DIR/activity" 2>/dev/null || echo "")
|
|
136
118
|
if [ -n "$LAST_ACTIVITY" ]; then
|
|
137
119
|
LA_TIME=$(echo "$LAST_ACTIVITY" | cut -d'|' -f1)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -72,7 +72,6 @@ fi
|
|
|
72
72
|
if [ -f "$SCRIPT_DIR/.env" ]; then
|
|
73
73
|
EGREGORE_API_URL="${EGREGORE_API_URL:-$(grep '^EGREGORE_API_URL=' "$SCRIPT_DIR/.env" 2>/dev/null | cut -d'=' -f2- || true)}"
|
|
74
74
|
EGREGORE_API_KEY="${EGREGORE_API_KEY:-$(grep '^EGREGORE_API_KEY=' "$SCRIPT_DIR/.env" 2>/dev/null | cut -d'=' -f2- || true)}"
|
|
75
|
-
EGREGORE_USE_PUBLISHED="${EGREGORE_USE_PUBLISHED:-$(grep '^EGREGORE_USE_PUBLISHED=' "$SCRIPT_DIR/.env" 2>/dev/null | cut -d'=' -f2- || true)}"
|
|
76
75
|
fi
|
|
77
76
|
|
|
78
77
|
API_URL="${EGREGORE_API_URL:-$(jq -r '.api_url // empty' "$CONFIG" 2>/dev/null)}"
|
|
@@ -80,16 +79,6 @@ API_KEY="${EGREGORE_API_KEY:-}"
|
|
|
80
79
|
ORG_SLUG="$(jq -r '.slug // empty' "$CONFIG" 2>/dev/null)"
|
|
81
80
|
VIEW_BASE="https://egregore.xyz/view"
|
|
82
81
|
|
|
83
|
-
# Resolve "use published renderer" from env first, then egregore.json. The
|
|
84
|
-
# env var lets individuals override per-shell; egregore.json lets an
|
|
85
|
-
# instance (e.g. the upstream dev repo) opt in for every teammate.
|
|
86
|
-
if [ -z "${EGREGORE_USE_PUBLISHED:-}" ]; then
|
|
87
|
-
CONFIG_USE_PUBLISHED="$(jq -r '.prefer_published_artifacts // empty' "$CONFIG" 2>/dev/null)"
|
|
88
|
-
if [ "$CONFIG_USE_PUBLISHED" = "true" ]; then
|
|
89
|
-
EGREGORE_USE_PUBLISHED=1
|
|
90
|
-
fi
|
|
91
|
-
fi
|
|
92
|
-
|
|
93
82
|
# Public relay for OSS share endpoint
|
|
94
83
|
RELAY_URL="https://egregore-production-55f2.up.railway.app"
|
|
95
84
|
|
|
@@ -114,11 +103,8 @@ else
|
|
|
114
103
|
# have been installed — that way local edits to packages/egregore-artifacts
|
|
115
104
|
# are exercised without waiting for an npm release. Fall back to the
|
|
116
105
|
# published `npx egregore-artifacts` otherwise.
|
|
117
|
-
# Set EGREGORE_USE_PUBLISHED=1 to force the npm-published renderer even
|
|
118
|
-
# when a local install is present — useful in the upstream dev repo to
|
|
119
|
-
# dogfood what teammates and OSS users actually run.
|
|
120
106
|
LOCAL_CLI="$SCRIPT_DIR/packages/egregore-artifacts/bin/cli.js"
|
|
121
|
-
if [
|
|
107
|
+
if [ -f "$LOCAL_CLI" ] && [ -d "$SCRIPT_DIR/packages/egregore-artifacts/node_modules/react" ]; then
|
|
122
108
|
if ! node "$LOCAL_CLI" "${RENDER_ARGS[@]}" >/dev/null 2>&1; then
|
|
123
109
|
exit 0
|
|
124
110
|
fi
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -58,12 +58,15 @@ git -C "$REPO_ROOT" worktree add "$WT_PATH" "$BRANCH" --quiet 2>/dev/null || {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
# --- Symlinks (same as worktree.sh setup) ---
|
|
61
|
-
# Memory
|
|
62
|
-
|
|
61
|
+
# Memory — may be a symlink (follow to its target) or a real directory.
|
|
62
|
+
MEMORY_TARGET=""
|
|
63
|
+
if [ -L "$REPO_ROOT/memory" ]; then
|
|
63
64
|
MEMORY_TARGET=$(realpath "$REPO_ROOT/memory" 2>/dev/null)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
elif [ -d "$REPO_ROOT/memory" ]; then
|
|
66
|
+
MEMORY_TARGET="$REPO_ROOT/memory"
|
|
67
|
+
fi
|
|
68
|
+
if [ -n "$MEMORY_TARGET" ] && [ -d "$MEMORY_TARGET" ]; then
|
|
69
|
+
ln -sfn "$MEMORY_TARGET" "$WT_PATH/memory"
|
|
67
70
|
fi
|
|
68
71
|
|
|
69
72
|
# .env
|
|
File without changes
|
|
@@ -41,11 +41,10 @@ case "$CMD" in
|
|
|
41
41
|
SRC="$MAIN_DIR/$FILE"
|
|
42
42
|
DST="$WT_PATH/$FILE"
|
|
43
43
|
if [ "$FILE" = "memory" ]; then
|
|
44
|
-
#
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
SRC=$(realpath "$SRC" 2>/dev/null) || continue
|
|
44
|
+
# memory may be a symlink (follow to its target) or a real directory.
|
|
45
|
+
if [ -L "$SRC" ]; then
|
|
46
|
+
SRC=$(realpath "$SRC" 2>/dev/null) || continue
|
|
47
|
+
fi
|
|
49
48
|
[ -d "$SRC" ] || continue
|
|
50
49
|
else
|
|
51
50
|
[ -f "$SRC" ] || continue
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-06-15T13:36:14.132Z",
|
|
3
2
|
"source": "egregore-runtime",
|
|
4
|
-
"policy": "public-safe subset derived from .syncignore;
|
|
5
|
-
"skillCount":
|
|
3
|
+
"policy": "public-safe subset derived from .syncignore; built by scripts/build-runtime-bundle.mjs",
|
|
4
|
+
"skillCount": 51,
|
|
6
5
|
"skills": [
|
|
7
6
|
"activity",
|
|
8
7
|
"add",
|
|
@@ -12,21 +11,17 @@
|
|
|
12
11
|
"ask",
|
|
13
12
|
"branch",
|
|
14
13
|
"checkup",
|
|
15
|
-
"comment",
|
|
16
14
|
"commit",
|
|
17
15
|
"contribute",
|
|
18
16
|
"dark-mode",
|
|
19
17
|
"dashboard",
|
|
20
18
|
"deep-reflect",
|
|
21
19
|
"delete-user",
|
|
22
|
-
"edit",
|
|
23
|
-
"edit-process",
|
|
24
20
|
"egregore-voice",
|
|
25
21
|
"emissary",
|
|
26
22
|
"env",
|
|
27
23
|
"handoff",
|
|
28
24
|
"harvest",
|
|
29
|
-
"infra",
|
|
30
25
|
"ingest",
|
|
31
26
|
"ingest-google",
|
|
32
27
|
"ingest-user-interview",
|
|
@@ -61,6 +56,7 @@
|
|
|
61
56
|
"wrap"
|
|
62
57
|
],
|
|
63
58
|
"files": [
|
|
59
|
+
".agents/skills",
|
|
64
60
|
".codex/config.toml",
|
|
65
61
|
".codex/hooks.json",
|
|
66
62
|
".codex/hooks/branch-guard.js",
|
|
@@ -72,21 +68,17 @@
|
|
|
72
68
|
".codex/skills/ask/SKILL.md",
|
|
73
69
|
".codex/skills/branch/SKILL.md",
|
|
74
70
|
".codex/skills/checkup/SKILL.md",
|
|
75
|
-
".codex/skills/comment/SKILL.md",
|
|
76
71
|
".codex/skills/commit/SKILL.md",
|
|
77
72
|
".codex/skills/contribute/SKILL.md",
|
|
78
73
|
".codex/skills/dark-mode/SKILL.md",
|
|
79
74
|
".codex/skills/dashboard/SKILL.md",
|
|
80
75
|
".codex/skills/deep-reflect/SKILL.md",
|
|
81
76
|
".codex/skills/delete-user/SKILL.md",
|
|
82
|
-
".codex/skills/edit-process/SKILL.md",
|
|
83
|
-
".codex/skills/edit/SKILL.md",
|
|
84
77
|
".codex/skills/egregore-voice/SKILL.md",
|
|
85
78
|
".codex/skills/emissary/SKILL.md",
|
|
86
79
|
".codex/skills/env/SKILL.md",
|
|
87
80
|
".codex/skills/handoff/SKILL.md",
|
|
88
81
|
".codex/skills/harvest/SKILL.md",
|
|
89
|
-
".codex/skills/infra/SKILL.md",
|
|
90
82
|
".codex/skills/ingest-google/SKILL.md",
|
|
91
83
|
".codex/skills/ingest-user-interview/SKILL.md",
|
|
92
84
|
".codex/skills/ingest/SKILL.md",
|
|
@@ -141,7 +133,6 @@
|
|
|
141
133
|
"bin/lib/config.sh",
|
|
142
134
|
"bin/lib/context.sh",
|
|
143
135
|
"bin/lib/dashboard-artifact.sh",
|
|
144
|
-
"bin/lib/edit-loopback.mjs",
|
|
145
136
|
"bin/lib/ensure-develop.sh",
|
|
146
137
|
"bin/lib/git-sync.sh",
|
|
147
138
|
"bin/lib/greeting.sh",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: comment
|
|
3
|
-
description: 'Fallback Codex adapter for the Egregore comment workflow.'
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
<!-- generated-by: bin/codex-sync-skills.sh -->
|
|
7
|
-
|
|
8
|
-
# Egregore comment Adapter
|
|
9
|
-
|
|
10
|
-
This is fallback coverage for a long-tail Egregore workflow that has not been
|
|
11
|
-
ported to a hand-written Codex-native skill yet.
|
|
12
|
-
|
|
13
|
-
Use the project shell and filesystem directly. Do not invoke Claude Code
|
|
14
|
-
commands. Translate interactive choices to structured Codex question tooling
|
|
15
|
-
when it is available; otherwise render compact numbered choices with an
|
|
16
|
-
`Other:` option and wait for the user.
|
|
17
|
-
|
|
18
|
-
1. Read `.claude/skills/comment/SKILL.md` for the workflow details.
|
|
19
|
-
2. Run the referenced `bin/` scripts directly from Codex.
|
|
20
|
-
3. Treat graph, publish, and notify steps as best-effort unless that workflow
|
|
21
|
-
explicitly says they are required.
|
|
22
|
-
4. Keep local-mode behavior filesystem-first and avoid graph or notification
|
|
23
|
-
calls when `egregore.json` declares `"mode": "local"`.
|
|
24
|
-
5. Never call the deprecated `egregore-handoff` CLI for Egregore project
|
|
25
|
-
handoffs.
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: edit
|
|
3
|
-
description: 'Fallback Codex adapter for the Egregore edit workflow.'
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
<!-- generated-by: bin/codex-sync-skills.sh -->
|
|
7
|
-
|
|
8
|
-
# Egregore edit Adapter
|
|
9
|
-
|
|
10
|
-
This is fallback coverage for a long-tail Egregore workflow that has not been
|
|
11
|
-
ported to a hand-written Codex-native skill yet.
|
|
12
|
-
|
|
13
|
-
Use the project shell and filesystem directly. Do not invoke Claude Code
|
|
14
|
-
commands. Translate interactive choices to structured Codex question tooling
|
|
15
|
-
when it is available; otherwise render compact numbered choices with an
|
|
16
|
-
`Other:` option and wait for the user.
|
|
17
|
-
|
|
18
|
-
1. Read `.claude/skills/edit/SKILL.md` for the workflow details.
|
|
19
|
-
2. Run the referenced `bin/` scripts directly from Codex.
|
|
20
|
-
3. Treat graph, publish, and notify steps as best-effort unless that workflow
|
|
21
|
-
explicitly says they are required.
|
|
22
|
-
4. Keep local-mode behavior filesystem-first and avoid graph or notification
|
|
23
|
-
calls when `egregore.json` declares `"mode": "local"`.
|
|
24
|
-
5. Never call the deprecated `egregore-handoff` CLI for Egregore project
|
|
25
|
-
handoffs.
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: edit-process
|
|
3
|
-
description: 'Fallback Codex adapter for the Egregore edit-process workflow.'
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
<!-- generated-by: bin/codex-sync-skills.sh -->
|
|
7
|
-
|
|
8
|
-
# Egregore edit-process Adapter
|
|
9
|
-
|
|
10
|
-
This is fallback coverage for a long-tail Egregore workflow that has not been
|
|
11
|
-
ported to a hand-written Codex-native skill yet.
|
|
12
|
-
|
|
13
|
-
Use the project shell and filesystem directly. Do not invoke Claude Code
|
|
14
|
-
commands. Translate interactive choices to structured Codex question tooling
|
|
15
|
-
when it is available; otherwise render compact numbered choices with an
|
|
16
|
-
`Other:` option and wait for the user.
|
|
17
|
-
|
|
18
|
-
1. Read `.claude/skills/edit-process/SKILL.md` for the workflow details.
|
|
19
|
-
2. Run the referenced `bin/` scripts directly from Codex.
|
|
20
|
-
3. Treat graph, publish, and notify steps as best-effort unless that workflow
|
|
21
|
-
explicitly says they are required.
|
|
22
|
-
4. Keep local-mode behavior filesystem-first and avoid graph or notification
|
|
23
|
-
calls when `egregore.json` declares `"mode": "local"`.
|
|
24
|
-
5. Never call the deprecated `egregore-handoff` CLI for Egregore project
|
|
25
|
-
handoffs.
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: infra
|
|
3
|
-
description: 'Fallback Codex adapter for the Egregore infra workflow.'
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
<!-- generated-by: bin/codex-sync-skills.sh -->
|
|
7
|
-
|
|
8
|
-
# Egregore infra Adapter
|
|
9
|
-
|
|
10
|
-
This is fallback coverage for a long-tail Egregore workflow that has not been
|
|
11
|
-
ported to a hand-written Codex-native skill yet.
|
|
12
|
-
|
|
13
|
-
Use the project shell and filesystem directly. Do not invoke Claude Code
|
|
14
|
-
commands. Translate interactive choices to structured Codex question tooling
|
|
15
|
-
when it is available; otherwise render compact numbered choices with an
|
|
16
|
-
`Other:` option and wait for the user.
|
|
17
|
-
|
|
18
|
-
## Structured UX parity
|
|
19
|
-
|
|
20
|
-
This workflow has a Claude skill with user-visible structured output. After
|
|
21
|
-
reading `.claude/skills/infra/SKILL.md`, reproduce the same visible UX in Codex:
|
|
22
|
-
|
|
23
|
-
- Preserve TUI boxes, markdown tables, rich cards, browser artifact rendering,
|
|
24
|
-
exact confirmation blocks, and "no preamble" rules from the source skill.
|
|
25
|
-
- Use the source skill's frame width, section order, labels, status footer,
|
|
26
|
-
and examples as the contract for the final response.
|
|
27
|
-
- Never replace a required box/table/card/artifact view with a prose summary
|
|
28
|
-
unless the user explicitly asks for a summary.
|
|
29
|
-
- When the source says to output a TUI box directly, paste that box as the
|
|
30
|
-
visible response, preferably in a `text` fenced block.
|
|
31
|
-
- Never show raw JSON, raw command output, or unformatted script output when
|
|
32
|
-
the source skill requires formatted status or rendered output.
|
|
33
|
-
|
|
34
|
-
1. Read `.claude/skills/infra/SKILL.md` for the workflow details.
|
|
35
|
-
2. Run the referenced `bin/` scripts directly from Codex.
|
|
36
|
-
3. Treat graph, publish, and notify steps as best-effort unless that workflow
|
|
37
|
-
explicitly says they are required.
|
|
38
|
-
4. Keep local-mode behavior filesystem-first and avoid graph or notification
|
|
39
|
-
calls when `egregore.json` declares `"mode": "local"`.
|
|
40
|
-
5. Never call the deprecated `egregore-handoff` CLI for Egregore project
|
|
41
|
-
handoffs.
|