@rubytech/create-maxy 1.0.473 → 1.0.475
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/package.json +1 -1
- package/payload/platform/plugins/admin/PLUGIN.md +2 -2
- package/payload/platform/plugins/docs/references/migration-guide.md +29 -21
- package/payload/platform/plugins/memory/PLUGIN.md +6 -0
- package/payload/platform/plugins/memory/mcp/dist/index.js +58 -22
- package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-reindex.d.ts +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-reindex.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-reindex.js +35 -23
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-reindex.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts +5 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js +40 -7
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js.map +1 -1
- package/payload/platform/scripts/migrate-import.sh +17 -11
- package/payload/platform/scripts/seed-neo4j.sh +2 -55
- package/payload/server/public/assets/ChatInput-sDYraTun.css +1 -0
- package/payload/server/public/assets/{admin-BEbxw46k.js → admin-DpmnCxNk.js} +60 -60
- package/payload/server/public/assets/public-BBxDqQvQ.js +5 -0
- package/payload/server/public/index.html +3 -3
- package/payload/server/public/public.html +3 -3
- package/payload/server/server.js +108 -104
- package/payload/platform/plugins/admin/hooks/agent-creation-approval.sh +0 -161
- package/payload/platform/plugins/admin/hooks/agent-creation-gate.sh +0 -317
- package/payload/platform/plugins/admin/hooks/agent-creation-post.sh +0 -165
- package/payload/platform/plugins/admin/hooks/session-start.sh +0 -104
- package/payload/platform/plugins/admin/hooks/test-agent-creation-gate.sh +0 -926
- package/payload/server/public/assets/ChatInput-BEwQxFL9.css +0 -1
- package/payload/server/public/assets/public-OdyNuhVE.js +0 -5
- /package/payload/server/public/assets/{ChatInput-Dnp1FLis.js → ChatInput-DZ0j0Gdp.js} +0 -0
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# SessionStart hook — agent-creation gate state recovery.
|
|
3
|
-
#
|
|
4
|
-
# If agent creation was in progress when the last session ended, the durable
|
|
5
|
-
# state file in the account directory preserves the gate flags. This hook
|
|
6
|
-
# copies it to the volatile /tmp/ location so PreToolUse picks up where it
|
|
7
|
-
# left off, and injects context telling the agent which gates are pending.
|
|
8
|
-
#
|
|
9
|
-
# Without this, a session restart would silently drop the gate — the admin
|
|
10
|
-
# agent could write SOUL.md/KNOWLEDGE.md/config.json without user approval.
|
|
11
|
-
#
|
|
12
|
-
# IDENTITY.md loading is handled by claude-agent.ts (system prompt assembly),
|
|
13
|
-
# not by this hook.
|
|
14
|
-
#
|
|
15
|
-
# Usage: session-start.sh <account-dir> <agent-name>
|
|
16
|
-
# Env: AGENT_CREATE_STATE_FILE (override volatile path, for testing)
|
|
17
|
-
|
|
18
|
-
ACCOUNT_DIR="${1:-${ACCOUNT_DIR:-}}"
|
|
19
|
-
|
|
20
|
-
if [ -z "$ACCOUNT_DIR" ]; then
|
|
21
|
-
exit 0
|
|
22
|
-
fi
|
|
23
|
-
|
|
24
|
-
# --- Agent-creation gate state recovery ---
|
|
25
|
-
DURABLE_STATE="$ACCOUNT_DIR/.claude/agent-create-state.json"
|
|
26
|
-
VOLATILE_STATE="${AGENT_CREATE_STATE_FILE:-/tmp/maxy-agent-create-state.json}"
|
|
27
|
-
|
|
28
|
-
if [ ! -f "$DURABLE_STATE" ]; then
|
|
29
|
-
exit 0
|
|
30
|
-
fi
|
|
31
|
-
|
|
32
|
-
# Staleness + completion check — reject durable state that is stale (>6h, missing
|
|
33
|
-
# timestamp) OR already complete (all gates true AND all gated files exist on
|
|
34
|
-
# disk). Without this, a stale or completed durable file would be recovered on
|
|
35
|
-
# every new session, injecting a misleading "resume creation" message.
|
|
36
|
-
#
|
|
37
|
-
# "All gates true" alone is NOT completion — it means user approval is done but
|
|
38
|
-
# file writes may still be pending. Deleting state at that point causes the
|
|
39
|
-
# remaining writes to fail with "invoke the public-agent-manager skill first."
|
|
40
|
-
DURABLE_VALID=$(python3 -c "
|
|
41
|
-
import json, sys
|
|
42
|
-
from datetime import datetime, timezone
|
|
43
|
-
|
|
44
|
-
try:
|
|
45
|
-
with open('$DURABLE_STATE') as f:
|
|
46
|
-
state = json.load(f)
|
|
47
|
-
started = state.get('started', '')
|
|
48
|
-
if not isinstance(started, str) or not started:
|
|
49
|
-
print('stale')
|
|
50
|
-
sys.exit(0)
|
|
51
|
-
started_dt = datetime.fromisoformat(started.replace('Z', '+00:00'))
|
|
52
|
-
age_hours = (datetime.now(timezone.utc) - started_dt).total_seconds() / 3600
|
|
53
|
-
if age_hours > 6 or age_hours < 0:
|
|
54
|
-
print('stale')
|
|
55
|
-
sys.exit(0)
|
|
56
|
-
# All gates true AND all files on disk = truly complete. All gates true
|
|
57
|
-
# alone means the user approved everything but writes may still be pending.
|
|
58
|
-
# Must match the PostToolUse completion check in agent-creation-post.sh.
|
|
59
|
-
gates = state.get('gates', {})
|
|
60
|
-
if isinstance(gates, dict) and set(gates.keys()) == {'soul', 'knowledge', 'config'} and all(v is True for v in gates.values()):
|
|
61
|
-
slug = state.get('slug', '')
|
|
62
|
-
if slug:
|
|
63
|
-
import os
|
|
64
|
-
agent_dir = os.path.join('$ACCOUNT_DIR', 'agents', slug)
|
|
65
|
-
gated_files = ['SOUL.md', 'KNOWLEDGE.md', 'config.json']
|
|
66
|
-
if all(os.path.isfile(os.path.join(agent_dir, f)) for f in gated_files):
|
|
67
|
-
print('complete')
|
|
68
|
-
else:
|
|
69
|
-
print('valid')
|
|
70
|
-
else:
|
|
71
|
-
print('valid')
|
|
72
|
-
else:
|
|
73
|
-
print('valid')
|
|
74
|
-
except Exception:
|
|
75
|
-
print('stale')
|
|
76
|
-
" 2>/dev/null || echo "stale")
|
|
77
|
-
|
|
78
|
-
if [[ "$DURABLE_VALID" != "valid" ]]; then
|
|
79
|
-
# Stale, invalid, or complete — clean up both files, do not recover
|
|
80
|
-
rm -f "$DURABLE_STATE" "$VOLATILE_STATE" 2>/dev/null || true
|
|
81
|
-
exit 0
|
|
82
|
-
fi
|
|
83
|
-
|
|
84
|
-
# Copy durable state to volatile location for PreToolUse
|
|
85
|
-
cp "$DURABLE_STATE" "$VOLATILE_STATE" 2>/dev/null || exit 0
|
|
86
|
-
|
|
87
|
-
# Inject context so the agent knows creation is resuming
|
|
88
|
-
python3 -c "
|
|
89
|
-
import json
|
|
90
|
-
|
|
91
|
-
try:
|
|
92
|
-
with open('$DURABLE_STATE') as f:
|
|
93
|
-
state = json.load(f)
|
|
94
|
-
slug = state.get('slug', '')
|
|
95
|
-
gates = state.get('gates', {})
|
|
96
|
-
pending = [k for k, v in gates.items() if not v]
|
|
97
|
-
pending_str = ', '.join(pending) if pending else 'none'
|
|
98
|
-
msg = f\"Agent creation for '{slug}' is in progress (resumed from prior session). Pending gates: {pending_str}. Render the remaining UI components (document-editor for SOUL.md/KNOWLEDGE.md, form with liveMemory for config) before writing agent files.\"
|
|
99
|
-
print(json.dumps({'additionalContext': msg}))
|
|
100
|
-
except:
|
|
101
|
-
pass
|
|
102
|
-
" 2>/dev/null || true
|
|
103
|
-
|
|
104
|
-
exit 0
|