Skip to content

Commit 6ea6178

Browse files
backend: sessions, jobs, records and view models over mcpp's control contract
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
0 parents  commit 6ea6178

43 files changed

Lines changed: 11872 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
target/
2+
.mcpp/
3+
node_modules/
4+
vscode/dist/
5+
vscode/out/
6+
vscode/*.vsix
7+
vscode/bin/
8+
jetbrains/build/
9+
jetbrains/.gradle/
10+
jetbrains/.intellijPlatform/
11+
webui/dist/
12+
*.log
13+
compile_commands.json

‎mcpp.lock‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Auto-generated by mcpp. Do not edit by hand.
2+
# Records what this build resolved. It does not yet pin future builds:
3+
# index dependencies are re-resolved from their constraints each time.
4+
# dev-dependencies are excluded: only `mcpp test` resolves them, and this
5+
# file must not change depending on which command ran last.
6+
version = 2
7+
8+
[package."nlohmann.json"]
9+
namespace = "nlohmann"
10+
version = "3.12.0"
11+
source = "index+nlohmann@3.12.0"
12+
hash = "fnv1a:65af05f998b1b9d7"
13+

‎mcpp.toml‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# mcpp-ide: the IDE backend for mcpp (one C++ program, `mcpp-ide serve`, JSON-RPC
2+
# on its standard streams), the shared panels, and the editor adapters that host
3+
# it (vscode/, jetbrains/). This file builds the backend.
4+
#
5+
# The backend speaks POSIX and Win32 itself (src/platform). A Linux release is
6+
# linked statically against musl (`--target x86_64-linux-musl --static`), so
7+
# one file runs on every distribution; macOS and Windows use their system
8+
# toolchains.
9+
[package]
10+
name = "mcpp-ide"
11+
version = "0.1.0"
12+
description = "The IDE backend for mcpp: sessions, jobs, records and view models over mcpp's control contract"
13+
license = "Apache-2.0"
14+
authors = ["mcpp-community"]
15+
repo = "https://github.com/mcpp-community/mcpp-ide"
16+
mcpp = ">=2026.10.26.1"
17+
18+
[language]
19+
standard = "c++23"
20+
modules = true
21+
import_std = true
22+
23+
[build]
24+
sources = ["src/**/*.cppm", "src/**/*.cpp"]
25+
macos_deployment_target = "12.0"
26+
27+
[targets.mcpp-ide]
28+
kind = "bin"
29+
main = "src/main.cpp"
30+
31+
# Stands in for mcpp in the tests: answers the control contract from the
32+
# golden fixtures under protocol/fixtures.
33+
[targets.mcpp-ide-mock-mcpp]
34+
kind = "bin"
35+
main = "src/bin/mockmcpp.cpp"
36+
37+
[dependencies.nlohmann]
38+
json = "3.12.0"
Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
{
2+
"data": {
3+
"database": {
4+
"ide": {
5+
"generator": {
6+
"name": "mcpp",
7+
"version": "2026.10.26.1"
8+
},
9+
"profile-version": "0.3.0",
10+
"toolchains": {
11+
"gcc-16.1.0-x86_64-unknown-linux-gnu": {
12+
"build-id": "8048a6111c0aebdb",
13+
"config-files": [
14+
"@HOME@/.mcpp/registry/data/xpkgs/xim-x-gcc/16.1.0/lib/gcc/x86_64-linux-gnu/16.1.0/specs"
15+
],
16+
"driver": "@HOME@/.mcpp/registry/data/xpkgs/xim-x-gcc/16.1.0/bin/g++",
17+
"family": "gcc",
18+
"stdlib": {
19+
"name": "libstdc++",
20+
"version": "16.1.0"
21+
},
22+
"sysroot": "@HOME@/.mcpp/registry/subos/default",
23+
"target": "x86_64-unknown-linux-gnu",
24+
"version": "16.1.0"
25+
}
26+
}
27+
},
28+
"revision": 0,
29+
"sets": [
30+
{
31+
"baseline-arguments": [
32+
"-std=c++23",
33+
"-fmodules",
34+
"-O0",
35+
"-g",
36+
"-fPIC",
37+
"--sysroot=@HOME@/.mcpp/registry/subos/default",
38+
"-B@HOME@/.mcpp/registry/data/xpkgs/xim-x-binutils/2.42/bin",
39+
"-D__MCPP_TARGET_LINUX__=1"
40+
],
41+
"family-name": "app",
42+
"ide": {
43+
"configuration": "dev",
44+
"kind": "executable",
45+
"toolchain": "gcc-16.1.0-x86_64-unknown-linux-gnu"
46+
},
47+
"name": "app",
48+
"translation-units": [
49+
{
50+
"arguments": [
51+
"@HOME@/.mcpp/registry/data/xpkgs/xim-x-gcc/16.1.0/bin/g++",
52+
"-std=c++23",
53+
"-fmodules",
54+
"-O0",
55+
"-g",
56+
"-fPIC",
57+
"--sysroot=@HOME@/.mcpp/registry/subos/default",
58+
"-B@HOME@/.mcpp/registry/data/xpkgs/xim-x-binutils/2.42/bin",
59+
"-D__MCPP_TARGET_LINUX__=1",
60+
"-c",
61+
"@ROOT@/src/main.cpp",
62+
"-o",
63+
"@HOME@/.mcpp/cache/build-database/d0ed76fa8386e035/target/x86_64-linux-gnu/b95fa85150d74e3d/obj/main.o"
64+
],
65+
"ide": {
66+
"role": "non-module"
67+
},
68+
"local-arguments": [],
69+
"object": "@HOME@/.mcpp/cache/build-database/d0ed76fa8386e035/target/x86_64-linux-gnu/b95fa85150d74e3d/obj/main.o",
70+
"private": false,
71+
"provides": {},
72+
"requires": [
73+
"std"
74+
],
75+
"source": "@ROOT@/src/main.cpp",
76+
"work-directory": "@HOME@/.mcpp/cache/build-database/d0ed76fa8386e035/target/x86_64-linux-gnu/b95fa85150d74e3d"
77+
}
78+
],
79+
"visible-sets": [
80+
"app:test",
81+
"mcpp:std"
82+
]
83+
},
84+
{
85+
"baseline-arguments": [
86+
"-std=c++23",
87+
"-fmodules",
88+
"-O0",
89+
"-g",
90+
"-fPIC",
91+
"--sysroot=@HOME@/.mcpp/registry/subos/default",
92+
"-B@HOME@/.mcpp/registry/data/xpkgs/xim-x-binutils/2.42/bin",
93+
"-D__MCPP_TARGET_LINUX__=1"
94+
],
95+
"family-name": "app",
96+
"ide": {
97+
"configuration": "dev",
98+
"kind": "test",
99+
"toolchain": "gcc-16.1.0-x86_64-unknown-linux-gnu"
100+
},
101+
"name": "app:test",
102+
"translation-units": [
103+
{
104+
"arguments": [
105+
"@HOME@/.mcpp/registry/data/xpkgs/xim-x-gcc/16.1.0/bin/g++",
106+
"-std=c++23",
107+
"-fmodules",
108+
"-O0",
109+
"-g",
110+
"-fPIC",
111+
"--sysroot=@HOME@/.mcpp/registry/subos/default",
112+
"-B@HOME@/.mcpp/registry/data/xpkgs/xim-x-binutils/2.42/bin",
113+
"-D__MCPP_TARGET_LINUX__=1",
114+
"-c",
115+
"@ROOT@/tests/test_smoke.cpp",
116+
"-o",
117+
"@HOME@/.mcpp/cache/build-database/d0ed76fa8386e035/target/x86_64-linux-gnu/b95fa85150d74e3d/obj/test_smoke.o"
118+
],
119+
"ide": {
120+
"role": "non-module"
121+
},
122+
"local-arguments": [],
123+
"object": "@HOME@/.mcpp/cache/build-database/d0ed76fa8386e035/target/x86_64-linux-gnu/b95fa85150d74e3d/obj/test_smoke.o",
124+
"private": false,
125+
"provides": {},
126+
"requires": [
127+
"std"
128+
],
129+
"source": "@ROOT@/tests/test_smoke.cpp",
130+
"work-directory": "@HOME@/.mcpp/cache/build-database/d0ed76fa8386e035/target/x86_64-linux-gnu/b95fa85150d74e3d"
131+
}
132+
],
133+
"visible-sets": [
134+
"app",
135+
"mcpp:std"
136+
]
137+
},
138+
{
139+
"baseline-arguments": [
140+
"-std=c++23",
141+
"-fmodules",
142+
"-O2",
143+
"--sysroot=@HOME@/.mcpp/registry/subos/default",
144+
"-B@HOME@/.mcpp/registry/data/xpkgs/xim-x-binutils/2.42/bin"
145+
],
146+
"family-name": "mcpp:std",
147+
"ide": {
148+
"configuration": "dev",
149+
"kind": "library",
150+
"toolchain": "gcc-16.1.0-x86_64-unknown-linux-gnu"
151+
},
152+
"name": "mcpp:std",
153+
"translation-units": [
154+
{
155+
"arguments": [
156+
"@HOME@/.mcpp/registry/data/xpkgs/xim-x-gcc/16.1.0/bin/g++",
157+
"-std=c++23",
158+
"-fmodules",
159+
"-O2",
160+
"--sysroot=@HOME@/.mcpp/registry/subos/default",
161+
"-B@HOME@/.mcpp/registry/data/xpkgs/xim-x-binutils/2.42/bin",
162+
"-c",
163+
"@HOME@/.mcpp/registry/data/xpkgs/xim-x-gcc/16.1.0/include/c++/16.1.0/bits/std.cc",
164+
"-o",
165+
"std.o"
166+
],
167+
"ide": {
168+
"role": "module-interface"
169+
},
170+
"local-arguments": [],
171+
"object": "@HOME@/.mcpp/build-cache/v1/std/9affbc96421d2ab1/std.o",
172+
"private": false,
173+
"provides": {
174+
"std": "@HOME@/.mcpp/build-cache/v1/std/9affbc96421d2ab1/gcm.cache/std.gcm"
175+
},
176+
"requires": [],
177+
"source": "@HOME@/.mcpp/registry/data/xpkgs/xim-x-gcc/16.1.0/include/c++/16.1.0/bits/std.cc",
178+
"work-directory": "@HOME@/.mcpp/build-cache/v1/std/9affbc96421d2ab1"
179+
}
180+
],
181+
"visible-sets": [
182+
"app",
183+
"app:test"
184+
]
185+
}
186+
],
187+
"version": 1
188+
},
189+
"inputs-fingerprint": "fnv1a:a7fbe48a39924203",
190+
"spec": {
191+
"name": "s1",
192+
"version": "0.3.0"
193+
},
194+
"watch": [
195+
"@HOME@/.mcpp/config.toml",
196+
"mcpp.lock",
197+
"mcpp.toml",
198+
"src/**/*.S",
199+
"src/**/*.asm",
200+
"src/**/*.c",
201+
"src/**/*.cc",
202+
"src/**/*.cpp",
203+
"src/**/*.cppm",
204+
"src/**/*.s",
205+
"tests/**/*.cpp"
206+
]
207+
},
208+
"diagnostics": [],
209+
"effects": [
210+
"read-project",
211+
"write-global-cache"
212+
],
213+
"kind": "mcpp.build-database",
214+
"kindVersion": 1,
215+
"mcpp": {
216+
"protocol": {
217+
"max": 1,
218+
"min": 1
219+
},
220+
"version": "2026.10.26.1"
221+
},
222+
"schemaVersion": 1
223+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{"configuration":{"fingerprint":"b95fa85150d74e3d","outputDir":"@ROOT@/target/x86_64-linux-gnu/b95fa85150d74e3d","profile":"dev","triple":"x86_64-linux-gnu"},"event":"plan","kind":"mcpp.event","schemaVersion":1}
2+
{"event":"progress","finished":1,"kind":"mcpp.event","schemaVersion":1,"total":2}
3+
{"event":"progress","finished":2,"kind":"mcpp.event","schemaVersion":1,"total":2}
4+
{"event":"progress","finished":1,"kind":"mcpp.event","schemaVersion":1,"total":2}
5+
{"diagnostic":{"message":"'undeclared_name' was not declared in this scope","path":"@ROOT@/src/main.cpp","range":{"end":{"column":21,"line":1},"start":{"column":21,"line":1}},"severity":"error"},"event":"diagnostic","kind":"mcpp.event","schemaVersion":1}
6+
{"data":{"artifacts":[],"client":"mcpp-ide-fixtures","command":"mcpp build --message-format json","compileDatabase":"@ROOT@/target/x86_64-linux-gnu/b95fa85150d74e3d/compile_commands.json","configuration":{"fingerprint":"b95fa85150d74e3d","outputDir":"@ROOT@/target/x86_64-linux-gnu/b95fa85150d74e3d","profile":"dev","triple":"x86_64-linux-gnu"},"diagnostics":[{"message":"'undeclared_name' was not declared in this scope","path":"@ROOT@/src/main.cpp","range":{"end":{"column":21,"line":1},"start":{"column":21,"line":1}},"severity":"error"}],"finishedAt":1792988800526,"pid":1110693,"startedAt":1792988800464,"status":"failed"},"diagnostics":[{"code":"MCPP_BUILD_FAILED","message":"build failed in app v0.1.0 (.)","severity":"error","source":"mcpp"}],"effects":["read-project","write-project"],"kind":"mcpp.build","kindVersion":1,"mcpp":{"protocol":{"max":1,"min":1},"version":"2026.10.26.1"},"schemaVersion":1}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"diagnostics":[{"code":"MCPP_BUILD_FAILED","message":"@ROOT@/mcpp.toml:1:9: error: expected ']'","path":"@ROOT@/mcpp.toml","range":{"end":{"column":9,"line":1},"start":{"column":9,"line":1}},"severity":"error","source":"mcpp"}],"effects":["read-project","write-project"],"kind":"mcpp.build","kindVersion":1,"mcpp":{"protocol":{"max":1,"min":1},"version":"2026.10.26.1"},"schemaVersion":1}

‎protocol/fixtures/build-ok.ndjson‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{"configuration":{"fingerprint":"b95fa85150d74e3d","outputDir":"@ROOT@/target/x86_64-linux-gnu/b95fa85150d74e3d","profile":"dev","triple":"x86_64-linux-gnu"},"event":"plan","kind":"mcpp.event","schemaVersion":1}
2+
{"event":"progress","finished":1,"kind":"mcpp.event","schemaVersion":1,"total":2}
3+
{"event":"progress","finished":2,"kind":"mcpp.event","schemaVersion":1,"total":2}
4+
{"event":"progress","finished":1,"kind":"mcpp.event","schemaVersion":1,"total":4}
5+
{"event":"progress","finished":2,"kind":"mcpp.event","schemaVersion":1,"total":4}
6+
{"event":"progress","finished":3,"kind":"mcpp.event","schemaVersion":1,"total":4}
7+
{"event":"progress","finished":4,"kind":"mcpp.event","schemaVersion":1,"total":4}
8+
{"artifact":{"kind":"bin","launch":{"argv":["@ROOT@/target/x86_64-linux-gnu/b95fa85150d74e3d/bin/app"],"cwd":"@ROOT@","env":{"GBM_BACKENDS_PATH":"@HOME@/.mcpp/registry/subos/default/usr/lib/gbm:@HOME@/.xlings/subos/speak-agent-private/usr/lib/gbm","LIBGL_DRIVERS_PATH":"@HOME@/.mcpp/registry/subos/default/usr/lib/dri:@HOME@/.xlings/subos/speak-agent-private/usr/lib/dri","XDG_DATA_DIRS":"@HOME@/.mcpp/registry/subos/default/share:@HOME@/.xlings/subos/speak-agent-private/share:/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop","__EGL_VENDOR_LIBRARY_DIRS":"@HOME@/.mcpp/registry/subos/default/share/glvnd/egl_vendor.d:@HOME@/.xlings/subos/speak-agent-private/share/glvnd/egl_vendor.d"},"via":null},"name":"app","path":"@ROOT@/target/x86_64-linux-gnu/b95fa85150d74e3d/bin/app"},"event":"artifact","kind":"mcpp.event","schemaVersion":1}
9+
{"data":{"artifacts":[{"kind":"bin","launch":{"argv":["@ROOT@/target/x86_64-linux-gnu/b95fa85150d74e3d/bin/app"],"cwd":"@ROOT@","env":{"GBM_BACKENDS_PATH":"@HOME@/.mcpp/registry/subos/default/usr/lib/gbm:@HOME@/.xlings/subos/speak-agent-private/usr/lib/gbm","LIBGL_DRIVERS_PATH":"@HOME@/.mcpp/registry/subos/default/usr/lib/dri:@HOME@/.xlings/subos/speak-agent-private/usr/lib/dri","XDG_DATA_DIRS":"@HOME@/.mcpp/registry/subos/default/share:@HOME@/.xlings/subos/speak-agent-private/share:/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop","__EGL_VENDOR_LIBRARY_DIRS":"@HOME@/.mcpp/registry/subos/default/share/glvnd/egl_vendor.d:@HOME@/.xlings/subos/speak-agent-private/share/glvnd/egl_vendor.d"},"via":null},"name":"app","path":"@ROOT@/target/x86_64-linux-gnu/b95fa85150d74e3d/bin/app"}],"client":"mcpp-ide-fixtures","command":"mcpp build --message-format json","compileDatabase":"@ROOT@/target/x86_64-linux-gnu/b95fa85150d74e3d/compile_commands.json","configuration":{"fingerprint":"b95fa85150d74e3d","outputDir":"@ROOT@/target/x86_64-linux-gnu/b95fa85150d74e3d","profile":"dev","triple":"x86_64-linux-gnu"},"diagnostics":[],"finishedAt":1792988794753,"pid":1110202,"startedAt":1792988793983,"status":"ok"},"diagnostics":[],"effects":["read-project","write-project"],"kind":"mcpp.build","kindVersion":1,"mcpp":{"protocol":{"max":1,"min":1},"version":"2026.10.26.1"},"schemaVersion":1}

0 commit comments

Comments
 (0)