Přeskočit na obsah

Tato stránka byla automaticky přeložena z angličtiny, jediného jazyka, ve kterém se tento web píše. Číst originál.

mesh.session.open

Řekne, co relace tohoto runtime je: její klient, worker, záměr, úloha, úkol, milník, branch, head, špinavost a revize kontextu. Replikuje se na každý propojený runtime; pozdější slovo nahrazuje dřívější. Zapisuje jen žurnál tohoto runtime.

Řekne, co relace tohoto runtime je: její klient, worker, záměr, úloha, úkol, milník, branch, head, špinavost a revize kontextu. Replikuje se na každý propojený runtime; pozdější slovo nahrazuje dřívější. Zapisuje jen žurnál tohoto runtime.

  • command
  • experimentální
  • modul mesh
  • #mesh
  • #coordination
  • #cooperation

Zpřístupnění

Kde je tato jedna definice dosažitelná. Absence je explicitní: povrch, který není uveden, ji nenese.

povrchjako
MCPnástroj majordomus_mesh_session_open
HTTPPOST /api/v1/mesh/sessions operationId mesh.session.open
příkazová řádka—

Schémata

Kanonický vstup a výstup z typů Rustu; schéma nástroje MCP a parametry a odpovědi OpenAPI se odvozují z nich.

input · SessionInput

Vstup mesh.session.open: co relace říká sama o sobě.
vlastnosttyppovinnépopis
větev string | null ne Větev.
klient string | null ne Klient (claude-code, codex, cli); cli, když chybí.
kontext string | null ne Revize kontextu, ze které vychází.
špinavé boolean | null ne Zda je pracovní strom špinavý.
head string | null ne Hlava.
intent string | null ne Co dělá.
issue string | null ne Úkol.
milestone string | null ne Milník.
session string | null ne Id relace v tomto runtimu; při vynechání relace volajícího MCP.
úloha string | null ne Id úlohy.
worker string | null ne Jméno, kterým se worker označuje sám.
JSON Schema
{
  "additionalProperties": false,
  "description": "The input of `mesh.session.open`: what a session says about itself.",
  "properties": {
    "branch": {
      "description": "The branch.",
      "type": [
        "string",
        "null"
      ]
    },
    "client": {
      "description": "The client (`claude-code`, `codex`, `cli`); `cli` when omitted.",
      "type": [
        "string",
        "null"
      ]
    },
    "context": {
      "description": "The context revision it works from.",
      "type": [
        "string",
        "null"
      ]
    },
    "dirty": {
      "description": "Whether the working tree is dirty.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "head": {
      "description": "The head.",
      "type": [
        "string",
        "null"
      ]
    },
    "intent": {
      "description": "What it is doing.",
      "type": [
        "string",
        "null"
      ]
    },
    "issue": {
      "description": "The issue.",
      "type": [
        "string",
        "null"
      ]
    },
    "milestone": {
      "description": "The milestone.",
      "type": [
        "string",
        "null"
      ]
    },
    "session": {
      "description": "The session id within this runtime; the calling MCP session's own when omitted.",
      "type": [
        "string",
        "null"
      ]
    },
    "task": {
      "description": "The task id.",
      "type": [
        "string",
        "null"
      ]
    },
    "worker": {
      "description": "The worker's name for itself.",
      "type": [
        "string",
        "null"
      ]
    }
  },
  "title": "SessionInput",
  "type": "object"
}

výstup · Zapsáno

Co operace zapsala, jako její odpověď volajícímu. Každá operace mesh je událost připojená do žurnálu tohoto runtime a volající dostane tři fakta, která si sám nezjistí: klíč vytvořené věci platný v celém mesh, událost, která to oznamuje, a Lamportovo razítko, které ji řadí vůči událostem všech ostatních.

Klíč je to, čím se adresuje pozdější operace — claim se uvolňuje klíčem, který vrátilo jeho získání, nikdy lokálním jménem, které dostal — a razítko je to, s čím porovnává volající, který čeká, až peer dožene stav.

#### use std::sync::Arc;
#### use majordomus_cli::mesh::config::{CooperationConfig, TrustConfig};
#### use majordomus_cli::mesh::cooperation::{CheckoutFacts, Cooperation, CooperationSetup};
#### use majordomus_cli::mesh::identity::NodeIdentity;
#### use majordomus_cli::mesh::link::HttpTransport;
#### use majordomus_cli::mesh::registry::MeshRegistry;
#### use majordomus_cli::mesh::repository::of_root_commits;
#### let cooperation = Cooperation::new(CooperationSetup {
####     identity: Arc::new(NodeIdentity::ephemeral().unwrap()), runtime: "0000000000000001".into(),
####     repository: of_root_commits(&["root".into()]), endpoints: vec!["127.0.0.1:9".into()],
####     version: "doc".into(), config: CooperationConfig::default(), trust: TrustConfig::default(),
####     journal_path: None, registry: Arc::new(MeshRegistry::new()),
####     transport: Arc::new(HttpTransport), board: None, checkout: CheckoutFacts::default(),
#### }).unwrap();
use majordomus_cli::mesh::cooperation::Written;
use majordomus_cli::mesh::journal::{ClaimMode, Durability, SessionInfo};

let session = SessionInfo::named("s1", "cli");
let written: Written = cooperation
    .claim(&session, vec!["docs".into()], None, ClaimMode::Advisory, None)
    .unwrap();
assert!(written.lamport > 0, "placed against every other runtime's events");
assert_eq!(written.durability, Durability::Memory, "this journal has no file");

// and the key it returned is how the claim is addressed from here on
cooperation.release(&written.key).unwrap();
vlastnosttyppovinnépopis
odolnost reference ne Zda událost dosáhla disku tohoto stroje: synced, memory (žurnál bez souboru, dle konfigurace), nebo not_durable — držena a replikována peerům, zde není na disku a není potvrzena jako trvalá. unknown z programu, který je starší. výchozí "unknown"
událost string ano <stream>/<seq> události, která to oznamuje.
klíč string ano <stream>/<local id> toho, co bylo vytvořeno nebo změněno.
lamport integer ano Lamportovo razítko události.
JSON Schema
{
  "$defs": {
    "Durability": {
      "description": "Whether an event this runtime wrote reached this machine's disk: what an append\nacknowledges, and the only thing a caller may say about it.\n\n```\nuse majordomus_cli::mesh::journal::Durability;\nassert_eq!(serde_json::to_value(Durability::NotDurable).unwrap(), \"not_durable\");\nassert_eq!(Durability::default(), Durability::Unknown, \"an answer that did not say\");\nassert!(Durability::Synced.is_on_disk() && !Durability::NotDurable.is_on_disk());\n```",
      "oneOf": [
        {
          "const": "synced",
          "description": "Appended to the journal file and synced (`fsync` of its data) before the append\nreturned.",
          "type": "string"
        },
        {
          "const": "memory",
          "description": "The journal has no file: it lives in memory and its peers, by configuration.",
          "type": "string"
        },
        {
          "const": "not_durable",
          "description": "The write to the journal file failed. The event is held in memory and replicated to\npeers, and is lost to this machine when the runtime restarts unless a peer still holds\nit. It is not acknowledged as durable.",
          "type": "string"
        },
        {
          "const": "unknown",
          "description": "Not reported: an answer from an executable that predates this field.",
          "type": "string"
        }
      ]
    }
  },
  "description": "What an operation wrote, as its answer to the caller. Every mesh operation is an event\nappended to this runtime's journal, and the caller is handed the three facts it cannot\nwork out for itself: the mesh-wide key of the thing it created, the event that says so,\nand the Lamport stamp that places it against everyone else's events.\n\nThe key is what a later operation is addressed by — a claim is released by the key its\nacquisition returned, never by the local name it was given — and the stamp is what a\ncaller waiting for a peer to catch up compares against.\n\n```\n# use std::sync::Arc;\n# use majordomus_cli::mesh::config::{CooperationConfig, TrustConfig};\n# use majordomus_cli::mesh::cooperation::{CheckoutFacts, Cooperation, CooperationSetup};\n# use majordomus_cli::mesh::identity::NodeIdentity;\n# use majordomus_cli::mesh::link::HttpTransport;\n# use majordomus_cli::mesh::registry::MeshRegistry;\n# use majordomus_cli::mesh::repository::of_root_commits;\n# let cooperation = Cooperation::new(CooperationSetup {\n#     identity: Arc::new(NodeIdentity::ephemeral().unwrap()), runtime: \"0000000000000001\".into(),\n#     repository: of_root_commits(&[\"root\".into()]), endpoints: vec![\"127.0.0.1:9\".into()],\n#     version: \"doc\".into(), config: CooperationConfig::default(), trust: TrustConfig::default(),\n#     journal_path: None, registry: Arc::new(MeshRegistry::new()),\n#     transport: Arc::new(HttpTransport), board: None, checkout: CheckoutFacts::default(),\n# }).unwrap();\nuse majordomus_cli::mesh::cooperation::Written;\nuse majordomus_cli::mesh::journal::{ClaimMode, Durability, SessionInfo};\n\nlet session = SessionInfo::named(\"s1\", \"cli\");\nlet written: Written = cooperation\n    .claim(&session, vec![\"docs\".into()], None, ClaimMode::Advisory, None)\n    .unwrap();\nassert!(written.lamport > 0, \"placed against every other runtime's events\");\nassert_eq!(written.durability, Durability::Memory, \"this journal has no file\");\n\n// and the key it returned is how the claim is addressed from here on\ncooperation.release(&written.key).unwrap();\n```",
  "properties": {
    "durability": {
      "$ref": "#/$defs/Durability",
      "default": "unknown",
      "description": "Whether the event reached this machine's disk: `synced`, `memory` (a journal with no\nfile, by configuration), or `not_durable` — held and replicated to peers, not on disk\nhere, and not acknowledged as durable. `unknown` from an executable that predates it."
    },
    "event": {
      "description": "`<stream>/<seq>` of the event that says so.",
      "type": "string"
    },
    "key": {
      "description": "`<stream>/<local id>` of what was created or changed.",
      "type": "string"
    },
    "lamport": {
      "description": "The event's Lamport stamp.",
      "format": "uint64",
      "minimum": 0,
      "type": "integer"
    }
  },
  "required": [
    "key",
    "event",
    "lamport"
  ],
  "title": "Written",
  "type": "object"
}

Politiky

benchmark
prominuto — prominuto: transient_state
cache
vypnuto — každé volání spustí handler

Cíle benchmarku

Odvozeno z registru pro tento repozitář: jeden požadavek na transport a případy, které poskytuje typ vstupu. Celá matice je na stránce měření výkonu.

transportstatepřípadytargets
directprominuto (transient_state)0
mcpprominuto (transient_state)0
httpprominuto (transient_state)0

Prohledává názvy a popisy všech stránek, které tento web publikuje.