@rubytech/create-maxy 1.0.793 → 1.0.794
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/lib/graph-search/src/__tests__/fulltext-coverage.test.ts +8 -0
- package/payload/platform/neo4j/edge-annotations.json +20 -0
- package/payload/platform/neo4j/migrations/002-project-public-agents.ts +191 -0
- package/payload/platform/neo4j/schema.cypher +69 -2
- package/payload/platform/plugins/admin/skills/public-agent-manager/SKILL.md +5 -2
- package/payload/platform/plugins/docs/references/platform.md +1 -1
- package/payload/server/chunk-2N7XJW6Q.js +3428 -0
- package/payload/server/chunk-3SQJW5Y5.js +9892 -0
- package/payload/server/client-pool-CTMWNDMO.js +28 -0
- package/payload/server/maxy-edge.js +2 -2
- package/payload/server/public/assets/{admin-CBDpia8P.js → admin-DEhQ1wNO.js} +7 -7
- package/payload/server/public/assets/{graph-CT4W30GR.js → graph-DwzwJvlu.js} +1 -1
- package/payload/server/public/assets/page-BuoQU1c6.js +50 -0
- package/payload/server/public/graph.html +2 -2
- package/payload/server/public/index.html +2 -2
- package/payload/server/server.js +46 -6
- package/payload/server/public/assets/page-Cs2i--Z2.js +0 -50
package/package.json
CHANGED
|
@@ -85,6 +85,14 @@ const CANONICAL_TEXT_PROPERTIES = [
|
|
|
85
85
|
"contactValue",
|
|
86
86
|
// ToolCall
|
|
87
87
|
"toolName",
|
|
88
|
+
// Agent (Task 837) — public-agent projection. `displayName` mirrors
|
|
89
|
+
// config.json; `slug` is the directory-name identifier; `role` is the
|
|
90
|
+
// discriminator carried on the four owned :KnowledgeDocument projections
|
|
91
|
+
// ('identity' | 'soul' | 'knowledge' | 'knowledge-summary'). Adding any
|
|
92
|
+
// new agent-side text property to the projector requires extending both
|
|
93
|
+
// the schema's ON EACH list and this canon, otherwise BM25 silently
|
|
94
|
+
// misses operator queries that match the new field.
|
|
95
|
+
"displayName", "slug", "role",
|
|
88
96
|
];
|
|
89
97
|
|
|
90
98
|
interface IndexDeclaration {
|
|
@@ -111,6 +111,26 @@
|
|
|
111
111
|
"OBSERVED_IN": {
|
|
112
112
|
"direction": "(*)-[:OBSERVED_IN]->(Conversation)",
|
|
113
113
|
"note": "Observation provenance."
|
|
114
|
+
},
|
|
115
|
+
"HAS_IDENTITY": {
|
|
116
|
+
"direction": "(Agent)-[:HAS_IDENTITY]->(KnowledgeDocument)",
|
|
117
|
+
"note": "Task 837 — public-agent IDENTITY.md projection (KnowledgeDocument with role='identity', namespaced attachmentId='agent:<slug>:identity')."
|
|
118
|
+
},
|
|
119
|
+
"HAS_SOUL": {
|
|
120
|
+
"direction": "(Agent)-[:HAS_SOUL]->(KnowledgeDocument)",
|
|
121
|
+
"note": "Task 837 — public-agent SOUL.md projection (role='soul')."
|
|
122
|
+
},
|
|
123
|
+
"HAS_KNOWLEDGE": {
|
|
124
|
+
"direction": "(Agent)-[:HAS_KNOWLEDGE]->(KnowledgeDocument)",
|
|
125
|
+
"note": "Task 837 — public-agent KNOWLEDGE.md projection (role='knowledge'); KNOWLEDGE-SUMMARY.md uses the same edge with role='knowledge-summary'."
|
|
126
|
+
},
|
|
127
|
+
"USES_KNOWLEDGE": {
|
|
128
|
+
"direction": "(Agent)-[:USES_KNOWLEDGE]->(KnowledgeDocument)",
|
|
129
|
+
"note": "Task 837 — operator-tagged docs (slug ∈ k.agents). Materialised at projection time only; runtime memory-search reads k.agents directly."
|
|
130
|
+
},
|
|
131
|
+
"HANDLED_BY": {
|
|
132
|
+
"direction": "(Conversation)-[:HANDLED_BY]->(Agent)",
|
|
133
|
+
"note": "Task 837 — public conversations only. Written by ensureConversation via OPTIONAL MATCH so orphan slugs do not block conversation creation."
|
|
114
134
|
}
|
|
115
135
|
},
|
|
116
136
|
"sublabels": {
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration 002 — Project file-based public agents into the graph (Task 837).
|
|
3
|
+
*
|
|
4
|
+
* Two passes:
|
|
5
|
+
*
|
|
6
|
+
* 1. Walk every account directory under data/accounts/<accountId>/agents/
|
|
7
|
+
* and call projectAgent(accountId, accountDir, slug) for each non-admin
|
|
8
|
+
* agent that has a config.json. The projector is idempotent: re-running
|
|
9
|
+
* this migration produces no duplicate nodes or edges.
|
|
10
|
+
*
|
|
11
|
+
* 2. For every existing public Conversation that carries an agentSlug
|
|
12
|
+
* property, MATCH the corresponding :Agent and MERGE the
|
|
13
|
+
* (:Conversation)-[:HANDLED_BY]->(:Agent) edge. Conversations whose
|
|
14
|
+
* slug doesn't resolve to an Agent (orphan slugs from deleted agents,
|
|
15
|
+
* or DM-channel public flows that haven't been extended to register a
|
|
16
|
+
* slug) are left edge-less; they will gain the edge automatically once
|
|
17
|
+
* the slug is registered or a new agent at that slug is projected.
|
|
18
|
+
*
|
|
19
|
+
* Run via the platform/ui standalone runtime so it picks up the same
|
|
20
|
+
* NEO4J_URI / accounts-directory resolution as the server:
|
|
21
|
+
*
|
|
22
|
+
* cd platform/ui && \
|
|
23
|
+
* NEO4J_URI=bolt://… NEO4J_PASSWORD=… \
|
|
24
|
+
* npx tsx ../neo4j/migrations/002-project-public-agents.ts
|
|
25
|
+
*
|
|
26
|
+
* Output: structured `[agent-graph-backfill]` lines per account + a final
|
|
27
|
+
* totals line. A non-zero exit code on any per-account failure surfaces to
|
|
28
|
+
* the operator; subsequent accounts are still attempted (the migration is
|
|
29
|
+
* isolating by account, not all-or-nothing).
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
33
|
+
import { resolve } from "node:path";
|
|
34
|
+
import {
|
|
35
|
+
projectAgent,
|
|
36
|
+
getSession,
|
|
37
|
+
} from "../../ui/app/lib/neo4j-store";
|
|
38
|
+
import { ACCOUNTS_DIR } from "../../ui/app/lib/claude-agent/account";
|
|
39
|
+
|
|
40
|
+
interface PerAccountStats {
|
|
41
|
+
accountId: string;
|
|
42
|
+
agents: number;
|
|
43
|
+
agentFailures: number;
|
|
44
|
+
convEdges: number;
|
|
45
|
+
convOrphans: number;
|
|
46
|
+
convCandidates: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async function projectAccountAgents(
|
|
50
|
+
accountId: string,
|
|
51
|
+
accountDir: string,
|
|
52
|
+
): Promise<{ agents: number; agentFailures: number }> {
|
|
53
|
+
const agentsDir = resolve(accountDir, "agents");
|
|
54
|
+
if (!existsSync(agentsDir)) return { agents: 0, agentFailures: 0 };
|
|
55
|
+
|
|
56
|
+
let agents = 0;
|
|
57
|
+
let agentFailures = 0;
|
|
58
|
+
for (const entry of readdirSync(agentsDir, { withFileTypes: true })) {
|
|
59
|
+
if (!entry.isDirectory()) continue;
|
|
60
|
+
if (entry.name === "admin") continue;
|
|
61
|
+
|
|
62
|
+
const configPath = resolve(agentsDir, entry.name, "config.json");
|
|
63
|
+
if (!existsSync(configPath)) continue;
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
await projectAgent(accountId, accountDir, entry.name);
|
|
67
|
+
agents++;
|
|
68
|
+
} catch (err) {
|
|
69
|
+
agentFailures++;
|
|
70
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
71
|
+
console.error(
|
|
72
|
+
`[agent-graph-backfill] account=${accountId.slice(0, 8)} agent=${entry.name} project FAILED error="${msg}"`,
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return { agents, agentFailures };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface HandledByBackfillStats {
|
|
80
|
+
candidates: number;
|
|
81
|
+
edges: number;
|
|
82
|
+
orphans: number;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Two-pass: count candidate Conversations (those carrying agentSlug),
|
|
87
|
+
* then OPTIONAL MATCH to surface orphans separately from successful merges.
|
|
88
|
+
* A hard MATCH-then-MATCH chain would silently filter orphan-slug rows out,
|
|
89
|
+
* making `edges=0` indistinguishable from "no public conversations exist"
|
|
90
|
+
* vs "every slug is orphaned" — different incidents, different fixes.
|
|
91
|
+
*/
|
|
92
|
+
async function backfillHandledByEdges(accountId: string): Promise<HandledByBackfillStats> {
|
|
93
|
+
const session = getSession();
|
|
94
|
+
try {
|
|
95
|
+
const result = await session.run(
|
|
96
|
+
`MATCH (c:Conversation {accountId: $accountId, agentType: 'public'})
|
|
97
|
+
WHERE c.agentSlug IS NOT NULL
|
|
98
|
+
OPTIONAL MATCH (a:Agent {accountId: $accountId, slug: c.agentSlug})
|
|
99
|
+
FOREACH (_ IN CASE WHEN a IS NULL THEN [] ELSE [1] END | MERGE (c)-[:HANDLED_BY]->(a))
|
|
100
|
+
RETURN
|
|
101
|
+
count(c) AS candidates,
|
|
102
|
+
sum(CASE WHEN a IS NULL THEN 0 ELSE 1 END) AS edges,
|
|
103
|
+
sum(CASE WHEN a IS NULL THEN 1 ELSE 0 END) AS orphans`,
|
|
104
|
+
{ accountId },
|
|
105
|
+
);
|
|
106
|
+
const toNum = (v: unknown): number => {
|
|
107
|
+
if (typeof v === "number") return v;
|
|
108
|
+
if (v && typeof (v as { toNumber: () => number }).toNumber === "function") {
|
|
109
|
+
return (v as { toNumber: () => number }).toNumber();
|
|
110
|
+
}
|
|
111
|
+
return 0;
|
|
112
|
+
};
|
|
113
|
+
return {
|
|
114
|
+
candidates: toNum(result.records[0]?.get("candidates")),
|
|
115
|
+
edges: toNum(result.records[0]?.get("edges")),
|
|
116
|
+
orphans: toNum(result.records[0]?.get("orphans")),
|
|
117
|
+
};
|
|
118
|
+
} finally {
|
|
119
|
+
await session.close();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
async function main(): Promise<void> {
|
|
124
|
+
const start = Date.now();
|
|
125
|
+
|
|
126
|
+
if (!existsSync(ACCOUNTS_DIR)) {
|
|
127
|
+
console.error(`[agent-graph-backfill] ACCOUNTS_DIR missing at ${ACCOUNTS_DIR} — nothing to do`);
|
|
128
|
+
process.exit(0);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const accountEntries = readdirSync(ACCOUNTS_DIR, { withFileTypes: true })
|
|
132
|
+
.filter((e) => e.isDirectory());
|
|
133
|
+
|
|
134
|
+
console.error(`[agent-graph-backfill] start accounts=${accountEntries.length}`);
|
|
135
|
+
|
|
136
|
+
let totalAgents = 0;
|
|
137
|
+
let totalAgentFailures = 0;
|
|
138
|
+
let totalConvEdges = 0;
|
|
139
|
+
let totalConvOrphans = 0;
|
|
140
|
+
let totalConvCandidates = 0;
|
|
141
|
+
const perAccount: PerAccountStats[] = [];
|
|
142
|
+
|
|
143
|
+
for (const entry of accountEntries) {
|
|
144
|
+
const accountDir = resolve(ACCOUNTS_DIR, entry.name);
|
|
145
|
+
const accountId = entry.name;
|
|
146
|
+
const accountStart = Date.now();
|
|
147
|
+
|
|
148
|
+
const { agents, agentFailures } = await projectAccountAgents(accountId, accountDir);
|
|
149
|
+
totalAgents += agents;
|
|
150
|
+
totalAgentFailures += agentFailures;
|
|
151
|
+
|
|
152
|
+
let convStats: HandledByBackfillStats = { candidates: 0, edges: 0, orphans: 0 };
|
|
153
|
+
try {
|
|
154
|
+
convStats = await backfillHandledByEdges(accountId);
|
|
155
|
+
totalConvEdges += convStats.edges;
|
|
156
|
+
totalConvOrphans += convStats.orphans;
|
|
157
|
+
totalConvCandidates += convStats.candidates;
|
|
158
|
+
} catch (err) {
|
|
159
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
160
|
+
console.error(
|
|
161
|
+
`[agent-graph-backfill] account=${accountId.slice(0, 8)} handled-by-backfill FAILED error="${msg}"`,
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
perAccount.push({
|
|
166
|
+
accountId,
|
|
167
|
+
agents,
|
|
168
|
+
agentFailures,
|
|
169
|
+
convEdges: convStats.edges,
|
|
170
|
+
convOrphans: convStats.orphans,
|
|
171
|
+
convCandidates: convStats.candidates,
|
|
172
|
+
});
|
|
173
|
+
const ms = Date.now() - accountStart;
|
|
174
|
+
console.error(
|
|
175
|
+
`[agent-graph-backfill] account=${accountId.slice(0, 8)} agents=${agents} failures=${agentFailures} conv-candidates=${convStats.candidates} conv-edges=${convStats.edges} conv-orphans=${convStats.orphans} ms=${ms}`,
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const ms = Date.now() - start;
|
|
180
|
+
console.error(
|
|
181
|
+
`[agent-graph-backfill] done totals: agents=${totalAgents} agent-failures=${totalAgentFailures} conv-candidates=${totalConvCandidates} conv-edges=${totalConvEdges} conv-orphans=${totalConvOrphans} ms=${ms}`,
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
process.exit(totalAgentFailures > 0 ? 1 : 0);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
main().catch((err) => {
|
|
188
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
189
|
+
console.error(`[agent-graph-backfill] fatal error="${msg}"`);
|
|
190
|
+
process.exit(2);
|
|
191
|
+
});
|
|
@@ -286,6 +286,7 @@ OPTIONS {
|
|
|
286
286
|
// - Email: Email, EmailAccount
|
|
287
287
|
// - Review signals: ReviewAlert
|
|
288
288
|
// - CV/career sublabels: Position, Credential
|
|
289
|
+
// - Public agents: Agent (Task 837 — projection of file-based public agents)
|
|
289
290
|
//
|
|
290
291
|
// Property union — every textual property the schema's writers assign:
|
|
291
292
|
// - Generic: name, title, summary, body, content, text, description, headline, abstract,
|
|
@@ -301,6 +302,11 @@ OPTIONS {
|
|
|
301
302
|
// - Credential: authority
|
|
302
303
|
// - AccessGrant: contactValue
|
|
303
304
|
// - ToolCall: toolName
|
|
305
|
+
// - Agent (Task 837): displayName, slug, role
|
|
306
|
+
// `displayName` = operator-facing name; `slug` = directory-name identifier;
|
|
307
|
+
// `role` = discriminator on KnowledgeDocument projections
|
|
308
|
+
// ('identity'|'soul'|'knowledge'|'knowledge-summary') so BM25 hits surface
|
|
309
|
+
// which file backed the result. Distinct from Person.role (no shadow).
|
|
304
310
|
CREATE FULLTEXT INDEX entity_search IF NOT EXISTS
|
|
305
311
|
FOR (n:LocalBusiness|Service|PriceSpecification|OpeningHoursSpecification|Organization
|
|
306
312
|
|Person|UserProfile|Preference|AdminUser|AccessGrant
|
|
@@ -309,12 +315,13 @@ FOR (n:LocalBusiness|Service|PriceSpecification|OpeningHoursSpecification|Organi
|
|
|
309
315
|
|Task|Project|Event
|
|
310
316
|
|Workflow|WorkflowStep|WorkflowRun|StepResult
|
|
311
317
|
|OnboardingState|Email|EmailAccount|ReviewAlert
|
|
312
|
-
|Position|Credential)
|
|
318
|
+
|Position|Credential|Agent)
|
|
313
319
|
ON EACH [n.name, n.firstName, n.lastName, n.givenName, n.familyName,
|
|
314
320
|
n.title, n.currentTitle, n.summary, n.body, n.content, n.text, n.description, n.headline, n.abstract,
|
|
315
321
|
n.email, n.note, n.label, n.value, n.message, n.preview, n.tagline,
|
|
316
322
|
n.subject, n.bodyPreview, n.fromName, n.fromAddress, n.agentAddress, n.screeningReason,
|
|
317
|
-
n.authority, n.contactValue, n.toolName
|
|
323
|
+
n.authority, n.contactValue, n.toolName,
|
|
324
|
+
n.displayName, n.slug, n.role];
|
|
318
325
|
|
|
319
326
|
// Project node (Task 740) — a standalone creative-output node distinct from
|
|
320
327
|
// :Section. Anchored via (:UserProfile)-[:CREATED]->(:Project), with optional
|
|
@@ -724,6 +731,66 @@ FOR (ag:AccessGrant) ON (ag.magicToken);
|
|
|
724
731
|
CREATE INDEX access_grant_status IF NOT EXISTS
|
|
725
732
|
FOR (ag:AccessGrant) ON (ag.status);
|
|
726
733
|
|
|
734
|
+
// ----------------------------------------------------------
|
|
735
|
+
// Agent node — projection of file-based public agents (Task 837)
|
|
736
|
+
//
|
|
737
|
+
// Source of truth remains the filesystem: accountDir/agents/<slug>/
|
|
738
|
+
// {config.json, IDENTITY.md, SOUL.md, KNOWLEDGE.md, KNOWLEDGE-SUMMARY.md}.
|
|
739
|
+
// The Agent node is a graph projection so operators can see, on /graph,
|
|
740
|
+
// which public agents exist, what knowledge they have access to, and
|
|
741
|
+
// which conversations they have handled. Re-running the projector
|
|
742
|
+
// is idempotent and never mutates the on-disk files.
|
|
743
|
+
//
|
|
744
|
+
// Properties (mirrored from config.json + filesystem mtime):
|
|
745
|
+
// slug — directory name; immutable identifier within an account
|
|
746
|
+
// displayName — operator-facing name from config.json
|
|
747
|
+
// status — 'active' | 'inactive' | <other> per config.json
|
|
748
|
+
// model — Anthropic model id used by the public agent
|
|
749
|
+
// liveMemory — bool; whether memory-search runs at message time
|
|
750
|
+
// knowledgeKeywords — string[] (live-search keyword subscriptions)
|
|
751
|
+
// role — always 'agent' (mirrors KnowledgeDocument.role
|
|
752
|
+
// discriminator; surfaces in BM25 hits)
|
|
753
|
+
// createdAt — ISO 8601, set on first projection
|
|
754
|
+
// updatedAt — ISO 8601, set on every projection
|
|
755
|
+
//
|
|
756
|
+
// Owned KnowledgeDocument projections (deleted on agent delete):
|
|
757
|
+
// (Agent)-[:HAS_IDENTITY]->(:KnowledgeDocument {role:'identity'})
|
|
758
|
+
// (Agent)-[:HAS_SOUL ]->(:KnowledgeDocument {role:'soul'})
|
|
759
|
+
// (Agent)-[:HAS_KNOWLEDGE]->(:KnowledgeDocument {role:'knowledge'})
|
|
760
|
+
// (Agent)-[:HAS_KNOWLEDGE]->(:KnowledgeDocument {role:'knowledge-summary'})
|
|
761
|
+
// attachmentId is namespaced as "agent:<accountId>:<slug>:<role>" so the
|
|
762
|
+
// projection reuses the existing knowledge_doc_id_unique constraint without
|
|
763
|
+
// a parallel uniqueness scheme. The accountId segment is load-bearing —
|
|
764
|
+
// without it, two accounts with the same agent slug would collide on the
|
|
765
|
+
// global unique constraint and the second projection would silently
|
|
766
|
+
// re-parent the first account's doc via the MERGE+SET path. Account
|
|
767
|
+
// isolation is doctrine.
|
|
768
|
+
//
|
|
769
|
+
// Operator-tagged docs (NOT deleted on agent delete — only edges removed):
|
|
770
|
+
// (Agent)-[:USES_KNOWLEDGE]->(:KnowledgeDocument)
|
|
771
|
+
// where slug ∈ KnowledgeDocument.agents. Materialised at projection time
|
|
772
|
+
// only; the runtime memory-search path continues to read k.agents directly,
|
|
773
|
+
// so a doc tagged after the last projection becomes graph-visible at the
|
|
774
|
+
// next re-projection but is reachable at runtime immediately. The runtime
|
|
775
|
+
// path is unchanged — see [public-agent.ts:130-160].
|
|
776
|
+
//
|
|
777
|
+
// Conversation→Agent edge (written by ensureConversation when
|
|
778
|
+
// agentType='public' and agentSlug is set):
|
|
779
|
+
// (Conversation)-[:HANDLED_BY]->(Agent)
|
|
780
|
+
// OPTIONAL MATCH on the Agent so a public conversation with an orphan
|
|
781
|
+
// slug still writes (single `[agent-graph] handled-by-skip` log line).
|
|
782
|
+
//
|
|
783
|
+
// Composite uniqueness: one Agent per (accountId, slug) — the directory
|
|
784
|
+
// name is the natural key within an account, slugs collide across
|
|
785
|
+
// accounts and that's allowed.
|
|
786
|
+
// ----------------------------------------------------------
|
|
787
|
+
|
|
788
|
+
CREATE CONSTRAINT agent_account_slug_unique IF NOT EXISTS
|
|
789
|
+
FOR (a:Agent) REQUIRE (a.accountId, a.slug) IS UNIQUE;
|
|
790
|
+
|
|
791
|
+
CREATE INDEX agent_account IF NOT EXISTS
|
|
792
|
+
FOR (a:Agent) ON (a.accountId);
|
|
793
|
+
|
|
727
794
|
// ----------------------------------------------------------
|
|
728
795
|
// AdminUser node — device-level admin identity
|
|
729
796
|
// Platform-native. Represents a human who administers one or
|
|
@@ -195,7 +195,8 @@ After creation, no template metadata persists in the agent's files. The resultin
|
|
|
195
195
|
9. **KNOWLEDGE.md generation** — populate from the now-tagged set plus keyword matches using the `update-knowledge` skill workflow
|
|
196
196
|
10. Write `config.json` with selected model, plugins, status "active", `liveMemory`, and `knowledgeKeywords`. This is the last gated write — placed after IDENTITY.md, SOUL.md, and KNOWLEDGE.md to prevent cascade failure if one gate stalls.
|
|
197
197
|
11. Check context budget — auto-summarise if over threshold
|
|
198
|
-
12.
|
|
198
|
+
12. **Project the agent into the graph** — delegate to the `database-operator` specialist with the instruction: "Project public agent `{slug}` into the graph by POSTing to `/api/admin/agents/{slug}/project` (Task 837 surface)." The route reads the on-disk files and idempotently MERGEs the `:Agent` node, the four owned `:KnowledgeDocument` projections (IDENTITY/SOUL/KNOWLEDGE/KNOWLEDGE-SUMMARY when present, namespaced `attachmentId="agent:<slug>:<role>"`), the `HAS_*` edges, and the `USES_KNOWLEDGE` edges to every operator-tagged doc. Loud-fail: if the route returns non-2xx, surface the error to the user verbatim — the agent's files exist on disk but its graph projection is incomplete, which means the operator's /graph view will not show this agent. Re-running the projection is safe; it is the same idempotent MERGE.
|
|
199
|
+
13. Confirm creation: "Agent created. Visitors can reach it at `/{slug}`"
|
|
199
200
|
|
|
200
201
|
### List
|
|
201
202
|
|
|
@@ -231,6 +232,8 @@ For knowledge scope changes:
|
|
|
231
232
|
- Allow toggling `liveMemory` on/off (update `config.json`).
|
|
232
233
|
- After changes, offer to refresh KNOWLEDGE.md using the `update-knowledge` skill.
|
|
233
234
|
|
|
235
|
+
**After every Edit operation that touches IDENTITY/SOUL/KNOWLEDGE/KNOWLEDGE-SUMMARY/`config.json` (including `liveMemory`, `knowledgeKeywords`, or direct-tag mutations), delegate to `database-operator` to re-project: POST `/api/admin/agents/{slug}/project`.** Without re-projection the on-disk files diverge from the graph state — the operator sees stale `:Agent` properties and stale `USES_KNOWLEDGE` edges in /graph. Loud-fail: surface non-2xx errors verbatim.
|
|
236
|
+
|
|
234
237
|
### Delete
|
|
235
238
|
|
|
236
239
|
Deletion removes the entire agent directory (`agents/{slug}/`) — not individual files. A partial deletion leaves ghost state that poisons future creation into the same slug.
|
|
@@ -242,7 +245,7 @@ Deletion removes the entire agent directory (`agents/{slug}/`) — not individua
|
|
|
242
245
|
- If no other agents remain (or the user declines to set a new default), clear the `defaultAgent` field by calling `account-update` with `field: "defaultAgent"`, `value: ""`. Tell the user that visitors to the root URL will see a "no agents" message until a new agent is created.
|
|
243
246
|
|
|
244
247
|
**Cleanup sequence:**
|
|
245
|
-
-
|
|
248
|
+
- Issue `DELETE /api/admin/agents/{slug}` — the route runs `deleteAgentProjection` (Task 837) FIRST to remove the `:Agent` node and its four owned `:KnowledgeDocument` projections, then `rmSync` the directory. Loud-fail: if graph cleanup throws, files are preserved and a 500 is returned with the error text. Re-issuing the DELETE is safe (idempotent on both layers). Operator-tagged docs survive the projection delete — only the `USES_KNOWLEDGE` edges from this Agent are removed.
|
|
246
249
|
- Verify the directory no longer exists
|
|
247
250
|
- Report what was removed (list the files that were in the directory)
|
|
248
251
|
|
|
@@ -65,7 +65,7 @@ There is no dashboard, no settings panel, no menus. Everything is done through c
|
|
|
65
65
|
|
|
66
66
|
The chat input auto-grows as you type — it expands to fit your message and shrinks back when you delete text. You can also drag the resize handle above the input to set a custom height.
|
|
67
67
|
|
|
68
|
-
The admin interface is a three-pane layout: a sidebar on the left with your brand mark, navigation (Chat, Projects, Artefacts), and your recent conversations; the chat in the middle; and an artefact pane on the right that opens when you select a document, click a project, or open Browser, Data, or Graph from the menu — holding the surface side-by-side with the conversation so the chat stays live while you work in it. The sidebar's nav rows swap the list view in place — Chat shows recent conversations, Projects shows your active work projects, and Artefacts lists every KnowledgeDocument plus this account's agent templates (your admin agent's IDENTITY, SOUL, and KNOWLEDGE files plus one entry per enabled specialist). Click an artefact row to open the document. KnowledgeDocuments and your admin agent's templates are editable — type in the document and changes save automatically; specialist agent templates are read-only because they ship with Maxy and your edits would be overwritten on the next install. PDF artefacts render inline so you can read them without leaving the pane. If your browser doesn't have a built-in PDF viewer, a Download button appears instead. Artefacts that have no readable file backing them (orphan rows, files removed from disk, unsupported content types) show a one-line banner explaining the skip instead of opening to a blank pane. Click a project row to open the Graph view focused on that project's neighbourhood — clicking a second project swaps the focus rather than stacking on top. The chat / artefact divider is drag-resizable — drag the line between the columns to make either side wider; double-click it to reset to half of the available width (viewport minus sidebar), clamped to the chat / artefact min-width floors. Your chosen width is remembered across reloads. On wider screens (>1280px) all three panes are visible. The sidebar narrows at 1280px, the artefact pane hides at 1080px (Browser, Data, and Graph then open as full-window pages instead), and the sidebar collapses to a 56px icon rail at 820px. On phones (<640px) the sidebar slides in as a drawer from the left when you tap the menu icon in the chat header.
|
|
68
|
+
The admin interface is a three-pane layout: a sidebar on the left with your brand mark, navigation (Chat, People, Agents, Projects, Tasks, Artefacts), and your recent conversations; the chat in the middle; and an artefact pane on the right that opens when you select a document, click a project, or open Browser, Data, or Graph from the menu — holding the surface side-by-side with the conversation so the chat stays live while you work in it. The sidebar's nav rows swap the list view in place — Chat shows recent conversations, Projects shows your active work projects, and Artefacts lists every KnowledgeDocument plus this account's agent templates (your admin agent's IDENTITY, SOUL, and KNOWLEDGE files plus one entry per enabled specialist). The People, Agents, and Tasks rows are graph shortcuts: clicking each opens the artefact-pane Graph filtered to every Person, every public Agent, or every Task in your account respectively, with no side-list — the graph itself is the result. Public agents become first-class graph entities the moment you create them, with edges to their IDENTITY/SOUL/KNOWLEDGE files, edges to every knowledge document they have access to, and edges from every conversation they have handled, so a single Agents click reveals the whole shape of who knows what and who has been talking to whom. Click an artefact row to open the document. KnowledgeDocuments and your admin agent's templates are editable — type in the document and changes save automatically; specialist agent templates are read-only because they ship with Maxy and your edits would be overwritten on the next install. PDF artefacts render inline so you can read them without leaving the pane. If your browser doesn't have a built-in PDF viewer, a Download button appears instead. Artefacts that have no readable file backing them (orphan rows, files removed from disk, unsupported content types) show a one-line banner explaining the skip instead of opening to a blank pane. Click a project row to open the Graph view focused on that project's neighbourhood — clicking a second project swaps the focus rather than stacking on top. The chat / artefact divider is drag-resizable — drag the line between the columns to make either side wider; double-click it to reset to half of the available width (viewport minus sidebar), clamped to the chat / artefact min-width floors. Your chosen width is remembered across reloads. On wider screens (>1280px) all three panes are visible. The sidebar narrows at 1280px, the artefact pane hides at 1080px (Browser, Data, and Graph then open as full-window pages instead), and the sidebar collapses to a 56px icon rail at 820px. On phones (<640px) the sidebar slides in as a drawer from the left when you tap the menu icon in the chat header.
|
|
69
69
|
|
|
70
70
|
Page titles are brand-aware: the browser tab shows your product name (e.g. `Real Agent` instead of `Maxy`) on every shell — chat, graph, and data — so a non-default brand never leaks the default name in tab strips or browser history.
|
|
71
71
|
|