Thirteen source-backed interactive diagrams in docs/architecture with an index page (thothii-diagrams.html): runtime and deployment architecture, module tree, F1-F8 workflow, session and catalog-sync lifecycles, new-question, gate round-trip, resume and OIDC sequences, session runtime classes, metadata dataflow and Metadata Catalog ERD. Replaces the old thothii-core sequence diagram. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
360 lines
8.1 KiB
JSON
360 lines
8.1 KiB
JSON
{
|
|
"schema_version": 1,
|
|
"diagram_type": "class",
|
|
"meta": {
|
|
"title": "ThothII — classi del runtime di sessione (backend)",
|
|
"locale": "it",
|
|
"output": "docs/architecture/thothii-session-runtime.html",
|
|
"quality_profile": "showcase",
|
|
"repository": {
|
|
"url": "https://git.tylconsulting.it/mptyl/ThothII.git",
|
|
"link_mode": "local-only",
|
|
"revision": "31e6d3a162e9e5ac71fc2d8da4fe44b16c06aae3"
|
|
}
|
|
},
|
|
"layout": {
|
|
"mode": "grid"
|
|
},
|
|
"types": [
|
|
{
|
|
"id": "mgr",
|
|
"label": "PiProcessManager",
|
|
"kind": "class",
|
|
"sublabel": "un processo Pi per sessione",
|
|
"row": 0,
|
|
"col": 0,
|
|
"methods": [
|
|
{
|
|
"name": "createFor",
|
|
"returns": "SessionRuntime",
|
|
"visibility": "public",
|
|
"parameters": "sessionId, options"
|
|
},
|
|
{
|
|
"name": "configure",
|
|
"returns": "Promise<void>",
|
|
"visibility": "public",
|
|
"parameters": "rt, options"
|
|
},
|
|
{
|
|
"name": "start",
|
|
"returns": "void",
|
|
"visibility": "public",
|
|
"parameters": "sessionId, rt, options"
|
|
},
|
|
{
|
|
"name": "get",
|
|
"returns": "SessionRuntime?",
|
|
"visibility": "public",
|
|
"parameters": "id"
|
|
},
|
|
{
|
|
"name": "teardownIfCurrent",
|
|
"returns": "boolean",
|
|
"visibility": "public",
|
|
"parameters": "id, expected"
|
|
}
|
|
],
|
|
"sources": [
|
|
{
|
|
"path": "backend/src/pi/pi-process-manager.ts",
|
|
"line": 46,
|
|
"end_line": 46
|
|
},
|
|
{
|
|
"path": "backend/src/pi/pi-process-manager.ts",
|
|
"line": 178,
|
|
"end_line": 178,
|
|
"label": "createFor"
|
|
},
|
|
{
|
|
"path": "backend/src/pi/pi-process-manager.ts",
|
|
"line": 283,
|
|
"end_line": 290,
|
|
"label": "start"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "rt",
|
|
"label": "SessionRuntime",
|
|
"kind": "interface",
|
|
"sublabel": "runtime vivo di una sessione",
|
|
"row": 0,
|
|
"col": 1,
|
|
"attributes": [
|
|
{
|
|
"name": "rpc",
|
|
"type": "RpcClient",
|
|
"visibility": "public"
|
|
},
|
|
{
|
|
"name": "bridge",
|
|
"type": "SessionBridge",
|
|
"visibility": "public"
|
|
},
|
|
{
|
|
"name": "child",
|
|
"type": "ChildProcess",
|
|
"visibility": "public"
|
|
}
|
|
],
|
|
"sources": [
|
|
{
|
|
"path": "backend/src/pi/pi-process-manager.ts",
|
|
"line": 19,
|
|
"end_line": 25
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "rpc",
|
|
"label": "RpcClient",
|
|
"kind": "class",
|
|
"sublabel": "JSON lines su stdin/stdout di Pi",
|
|
"row": 1,
|
|
"col": 1,
|
|
"methods": [
|
|
{
|
|
"name": "send",
|
|
"returns": "void",
|
|
"visibility": "public",
|
|
"parameters": "cmd"
|
|
},
|
|
{
|
|
"name": "request",
|
|
"returns": "Promise<any>",
|
|
"visibility": "public",
|
|
"parameters": "cmd"
|
|
},
|
|
{
|
|
"name": "on",
|
|
"returns": "void",
|
|
"visibility": "public",
|
|
"parameters": "\"event\", cb"
|
|
}
|
|
],
|
|
"sources": [
|
|
{
|
|
"path": "backend/src/rpc/rpc-client.ts",
|
|
"line": 6,
|
|
"end_line": 37
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "bridge",
|
|
"label": "SessionBridge",
|
|
"kind": "class",
|
|
"sublabel": "eventi Pi → eventi client",
|
|
"row": 1,
|
|
"col": 2,
|
|
"attributes": [
|
|
{
|
|
"name": "state",
|
|
"type": "TurnState",
|
|
"visibility": "private"
|
|
},
|
|
{
|
|
"name": "pendingPiId",
|
|
"type": "string?",
|
|
"visibility": "private"
|
|
}
|
|
],
|
|
"methods": [
|
|
{
|
|
"name": "onClientEvent",
|
|
"returns": "void",
|
|
"visibility": "public",
|
|
"parameters": "cb"
|
|
},
|
|
{
|
|
"name": "respond",
|
|
"returns": "boolean",
|
|
"visibility": "public",
|
|
"parameters": "uiResponse"
|
|
},
|
|
{
|
|
"name": "steer",
|
|
"returns": "void",
|
|
"visibility": "public",
|
|
"parameters": "text"
|
|
},
|
|
{
|
|
"name": "pendingWidget",
|
|
"returns": "object?",
|
|
"visibility": "public"
|
|
},
|
|
{
|
|
"name": "turnState",
|
|
"returns": "TurnState",
|
|
"visibility": "public"
|
|
}
|
|
],
|
|
"sources": [
|
|
{
|
|
"path": "backend/src/bridge/session-bridge.ts",
|
|
"line": 52,
|
|
"end_line": 71
|
|
},
|
|
{
|
|
"path": "backend/src/bridge/session-bridge.ts",
|
|
"line": 154,
|
|
"end_line": 195
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "hub",
|
|
"label": "SseHub",
|
|
"kind": "class",
|
|
"sublabel": "buffer e replay per sessione",
|
|
"row": 0,
|
|
"col": 2,
|
|
"methods": [
|
|
{
|
|
"name": "subscribe",
|
|
"returns": "void",
|
|
"visibility": "public",
|
|
"parameters": "sessionId, …"
|
|
},
|
|
{
|
|
"name": "publish",
|
|
"returns": "string",
|
|
"visibility": "public",
|
|
"parameters": "sessionId, event, data"
|
|
},
|
|
{
|
|
"name": "clear",
|
|
"returns": "void",
|
|
"visibility": "public",
|
|
"parameters": "sessionId"
|
|
},
|
|
{
|
|
"name": "forget",
|
|
"returns": "void",
|
|
"visibility": "public",
|
|
"parameters": "sessionId"
|
|
}
|
|
],
|
|
"sources": [
|
|
{
|
|
"path": "backend/src/sse/sse-hub.ts",
|
|
"line": 47,
|
|
"end_line": 47
|
|
},
|
|
{
|
|
"path": "backend/src/sse/sse-hub.ts",
|
|
"line": 78,
|
|
"end_line": 145
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "runner",
|
|
"label": "ThtRunner",
|
|
"kind": "class",
|
|
"sublabel": "esegue il CLI tht",
|
|
"row": 1,
|
|
"col": 0,
|
|
"methods": [
|
|
{
|
|
"name": "sessionNew",
|
|
"returns": "Promise",
|
|
"visibility": "public",
|
|
"parameters": "options"
|
|
},
|
|
{
|
|
"name": "sessionShow",
|
|
"returns": "Promise",
|
|
"visibility": "public",
|
|
"parameters": "id"
|
|
},
|
|
{
|
|
"name": "searchPack",
|
|
"returns": "Promise<void>",
|
|
"visibility": "public",
|
|
"parameters": "question, id"
|
|
},
|
|
{
|
|
"name": "reopenSession",
|
|
"returns": "Promise",
|
|
"visibility": "public",
|
|
"parameters": "id"
|
|
},
|
|
{
|
|
"name": "buildArgv",
|
|
"returns": "string[]",
|
|
"visibility": "public",
|
|
"parameters": "args, workspace"
|
|
}
|
|
],
|
|
"sources": [
|
|
{
|
|
"path": "backend/src/tht/tht-runner.ts",
|
|
"line": 111,
|
|
"end_line": 114
|
|
},
|
|
{
|
|
"path": "backend/src/tht/tht-runner.ts",
|
|
"line": 392,
|
|
"end_line": 394,
|
|
"label": "buildArgv"
|
|
},
|
|
{
|
|
"path": "backend/src/tht/tht-runner.ts",
|
|
"line": 484,
|
|
"end_line": 569
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"relationships": [
|
|
{
|
|
"from": "mgr",
|
|
"to": "rt",
|
|
"kind": "composition",
|
|
"label": "runtimes"
|
|
},
|
|
{
|
|
"from": "rt",
|
|
"to": "rpc",
|
|
"kind": "composition"
|
|
},
|
|
{
|
|
"from": "rt",
|
|
"to": "bridge",
|
|
"kind": "composition"
|
|
},
|
|
{
|
|
"from": "bridge",
|
|
"to": "rpc",
|
|
"kind": "association",
|
|
"label": "ascolta"
|
|
},
|
|
{
|
|
"from": "mgr",
|
|
"to": "runner",
|
|
"kind": "dependency",
|
|
"label": "resume"
|
|
}
|
|
],
|
|
"cards": [
|
|
{
|
|
"dot": "cyan",
|
|
"title": "Collegamento",
|
|
"items": [
|
|
"Le route di sessione (sessionRoutes) collegano bridge e hub: ogni evento del bridge viene pubblicato con SseHub.publish",
|
|
"app.ts crea un solo ThtRunner, SseHub e PiProcessManager per processo"
|
|
]
|
|
},
|
|
{
|
|
"dot": "amber",
|
|
"title": "Selezione",
|
|
"items": [
|
|
"Sono mostrati solo i membri usati nei flussi di sessione"
|
|
]
|
|
}
|
|
]
|
|
}
|