Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Knowledge graph explorer frontend. Rebuilds the core of sphinx-nav-fiber with Ne

## Backend Services
- **jarvis-boltwall**: Auth gateway (isAdmin, feature flags, L402 payments, radar/sources)
- **jarvis-backend**: Graph data (v2/nodes, v2/edges, schema/all, stats, about)
- **jarvis-backend**: Graph data (v2/nodes, v2/edges, v2/schema, stats, about)
- Boltwall proxies most requests to jarvis-backend; schema endpoints go direct

## Transaction History
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ src/

- `GET /isAdmin` — auth + feature flags (boltwall)
- `GET /v2/nodes` — search/list nodes (jarvis-backend)
- `GET /schema/all` — ontology schemas + edges (jarvis-backend)
- `GET /v2/schema` — ontology schemas + edges, `?domains=` to scope (jarvis-backend)
- `POST /radar` — add content source (boltwall)
- `POST /boost` — boost a node with Lightning (boltwall)
- `GET /about` — graph metadata (jarvis-backend)
5 changes: 4 additions & 1 deletion public/agents.txt
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ When the human says… | Hit this endpoint
| `BELOW_MINIMUM` with the figure in `message`.
| See "Withdrawing" below.
"open this node" / "show details" | `GET /api/v2/nodes/<ref_id>?expand=edges`
"what node types exist" | `GET /api/v2/schema/domains` (free) or `GET /schema`
"what node types exist" | `GET /api/v2/schema/domains` (free) or
/ "show the ontology" | `GET /api/v2/schema?domains=<a>,<b>` (free;
| types with `parent` + relationship schemas)
"how many nodes / topics / people" | `GET /api/stats` (free)
"subscribe to this RSS / channel" | `POST /radar` with `{source, source_type}` —
/ "follow this handle" | `source_type` ∈ `twitter_handle`, `youtube_channel`,
Expand Down Expand Up @@ -373,6 +375,7 @@ asking the human to fund a token:
- `GET /api/stats`
- `GET /api/about`
- `GET /api/v2/schema/domains`
- `GET /api/v2/schema?domains=<a>,<b>` — full ontology, scoped by domain
- `GET /api/v2/nodes/topic-check?name=<name>`
- `GET /api/v2/nodes/check?node_type=<T>&key=<k>`

Expand Down
5 changes: 4 additions & 1 deletion public/llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
2. Explore for free first (no auth required):
- `GET /api/getPrice` — current price in sats of every paid route
- `GET /api/stats`, `GET /api/about`, `GET /api/v2/schema/domains`
- `GET /api/v2/schema?domains=<a>,<b>` — full ontology (types with
`parent` inheritance + relationship schemas), optionally scoped
to a domain list from `/api/v2/schema/domains`
- `GET /api/v2/nodes/topic-check?name=<name>`
- `GET /api/v2/nodes/check?node_type=<T>&key=<k>`
3. For paid actions (search, node lookup, content add):
Expand Down Expand Up @@ -86,7 +89,7 @@ direct LN-node check (see `/agents.txt`). Any non-empty string after
| GET | `/api/v2/content?sort_by=date&limit=100` | **List the caller's own content / "my content" / "what I added".** Server-filtered by the LSAT identity in your `Authorization` header — never fetch `/api/v2/nodes` and filter client-side. Returns `{nodes, totalCount, totalProcessing}` where `totalProcessing` counts your submissions still being ingested. |
| GET | `/api/v2/reviews?status=&type=&sort=&skip=&limit=` | Pending content reviews. |
| GET | `/api/v2/schema/domains` | Domain roots, hidden_types, hidden_domains. |
| GET | `/schema` | Full ontology. |
| GET | `/api/v2/schema?domains=<a>,<b>` | Full ontology: `{schemas, edges}`. Each schema has `type`, `parent` (CHILD_OF inheritance), `domain`, `node_key`, `attributes`, `inherited_attributes`; each edge has `source`, `target`, `edge_type`. `domains` scopes to a comma-separated list. Do **not** pass `concise=true` or `include_attributes=false` — both drop `parent`. Replaces the deprecated `/schema/all`. |
| GET | `/stats` | `{num_nodes, num_episodes, num_people, num_audio, num_video, num_tweet, num_documents, …}`. |
| GET | `/about` | Graph identity (title, description). |
| GET | `/balance` | Caller's sats balance. |
Expand Down
2 changes: 1 addition & 1 deletion src/app/admin/domains/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default function DomainsPage() {

// --- Write helpers ------------------------------------------------------

// Reassign a set of types to `domainValue` (PUT /schema each), then relabel
// Reassign a set of types to `domainValue` (PUT /v2/schema each), then relabel
// existing nodes in the background.
const assignTypesToDomain = useCallback(
async (typeNames: string[], domainValue: string) => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/admin/ontology/mock-small.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SchemaNode, SchemaEdge } from "@/lib/schema-types"

// Trimmed from real /schema/all response
// Trimmed from real /v2/schema response
export const SMALL_SCHEMAS: SchemaNode[] = [
{
ref_id: "9e96b53a-c8ba-4f2a-9d4a-ced714d57e43",
Expand Down
10 changes: 5 additions & 5 deletions src/lib/__tests__/schema-store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,13 @@ describe("schema-store – endpoints", () => {
useSchemaStore.setState({ schemas: [makeSchema()], edges: [], loading: false })
})

it("fetches the ontology from /schema/all", async () => {
it("fetches the ontology from /v2/schema", async () => {
mockGet.mockResolvedValueOnce({ schemas: [], edges: [] })
await useSchemaStore.getState().fetchAll()
expect(mockGet).toHaveBeenCalledWith("/schema/all")
expect(mockGet).toHaveBeenCalledWith("/v2/schema")
})

it("sends type and relationship writes to /schema", async () => {
it("sends type and relationship writes to /v2/schema", async () => {
mockPut.mockResolvedValueOnce({}).mockResolvedValueOnce({})
mockPost.mockResolvedValueOnce({}).mockResolvedValueOnce({})
const store = useSchemaStore.getState()
Expand All @@ -254,7 +254,7 @@ describe("schema-store – endpoints", () => {
await store.addEdge({ ref_id: "e-1", source: "a", target: "b", source_type: "A", target_type: "B", edge_type: "LINKS" })
await store.updateEdge({ ref_id: "e-1", source: "a", target: "b", edge_type: "LINKS" })

expect(mockPut.mock.calls.map(([path]) => path)).toEqual(["/schema/test-1", "/schema/edge/e-1"])
expect(mockPost.mock.calls.map(([path]) => path)).toEqual(["/schema", "/schema/edge"])
expect(mockPut.mock.calls.map(([path]) => path)).toEqual(["/v2/schema/test-1", "/v2/schema/edge/e-1"])
expect(mockPost.mock.calls.map(([path]) => path)).toEqual(["/v2/schema", "/v2/schema/edge"])
})
})
2 changes: 1 addition & 1 deletion src/lib/graph-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ export async function dismissReview(
}

export async function getSchemaAudit(): Promise<SchemaAuditData> {
return api.get<SchemaAuditData>("/schema/audit")
return api.get<SchemaAuditData>("/v2/schema/audit")
}

// ── Legal document ingestion ─────────────────────────────────────────────────
Expand Down
2 changes: 1 addition & 1 deletion src/lib/schema-icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import type { LucideIcon } from "lucide-react"

/**
* Maps jarvis schema icon names to lucide-react components.
* Icon names come from the /schema/all API response (e.g. "TwitterIcon", "VideoIcon").
* Icon names come from the /v2/schema API response (e.g. "TwitterIcon", "VideoIcon").
*/
const SCHEMA_ICON_MAP: Record<string, LucideIcon> = {
NodesIcon: CircleDot,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/schema-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ export interface SchemaEdge {
target_type?: string
// Attribute definitions for this edge type, e.g. { since: "?datetime",
// role: "string" }. A leading "?" marks the attribute optional. Present on
// the live /schema/all payload; absent on some mock fixtures.
// the live /v2/schema payload; absent on some mock fixtures.
attributes?: Record<string, string>
}
14 changes: 7 additions & 7 deletions src/stores/schema-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const useSchemaStore = create<SchemaState>((set) => ({
if (isMocksEnabled()) return

try {
await api.put(`/schema/${updated.ref_id}`, {
await api.put(`/v2/schema/${updated.ref_id}`, {
type: updated.type,
parent: updated.parent,
primary_color: updated.color,
Expand Down Expand Up @@ -93,7 +93,7 @@ export const useSchemaStore = create<SchemaState>((set) => ({
if (isMocksEnabled()) return schema.ref_id

try {
const res = await api.post<{ ref_id?: string }>("/schema", {
const res = await api.post<{ ref_id?: string }>("/v2/schema", {
type: schema.type,
parent: schema.parent,
primary_color: schema.color,
Expand Down Expand Up @@ -129,7 +129,7 @@ export const useSchemaStore = create<SchemaState>((set) => ({
if (isMocksEnabled()) return

try {
await api.delete(`/schema/${refId}`)
await api.delete(`/v2/schema/${refId}`)
} catch (err) {
console.error("Failed to delete schema:", err)
// Rollback
Expand All @@ -145,7 +145,7 @@ export const useSchemaStore = create<SchemaState>((set) => ({

try {
// The backend keys edge schemas off type NAMES, not ref_ids.
const res = await api.post<{ ref_id?: string }>("/schema/edge", {
const res = await api.post<{ ref_id?: string }>("/v2/schema/edge", {
source: edge.source_type ?? edge.source,
target: edge.target_type ?? edge.target,
edge_type: edge.edge_type,
Expand Down Expand Up @@ -182,7 +182,7 @@ export const useSchemaStore = create<SchemaState>((set) => ({
if (isMocksEnabled()) return

try {
await api.put(`/schema/edge/${edge.ref_id}`, {
await api.put(`/v2/schema/edge/${edge.ref_id}`, {
edge_type: edge.edge_type,
attributes: edge.attributes ?? {},
})
Expand All @@ -204,7 +204,7 @@ export const useSchemaStore = create<SchemaState>((set) => ({
if (isMocksEnabled()) return

try {
await api.delete(`/schema/edge/${refId}`)
await api.delete(`/v2/schema/edge/${refId}`)
} catch (err) {
console.error("Failed to delete relationship:", err)
// Rollback
Expand Down Expand Up @@ -235,7 +235,7 @@ export const useSchemaStore = create<SchemaState>((set) => ({
centrality?: number
}>
edges: SchemaEdge[]
}>("/schema/all")
}>("/v2/schema")

const schemas: SchemaNode[] = (res.schemas ?? []).map((s) => ({
ref_id: s.ref_id,
Expand Down
Loading