feat(api,cli): extend Engineering Marble to backend + CLI#2
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
feat(api,cli): extend Engineering Marble to backend + CLI#2devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
API:
- lib/marble.ts: palette + banner + rule + endpointLine primitives.
- lib/envelope.ts: canonical { ok, data|error, meta: { requestId, timestamp } }.
- lib/request-id.ts: opaque X-Request-Id per request, echoed in response.
- lib/mono-logger.ts: compact mono HTTP log (time | method | status | ms | path | id).
- errorHandler: envelope + ZodError branch + marble stderr trace.
- index.ts: marble boot banner, curl-friendly GET / spec sheet,
/healthz, /readyz, /v1/meta triad; /v1/* with /api/* alias.
- jobs, analytics, settings, auth, tailor: uniform ok()/fail() envelope.
CLI:
- lib/palette.ts: 256-colour graphite + rust signal, TTY-aware, OSC-8 links.
- lib/ui.ts: banner, rule, kv, chip, step, mark, table primitives.
- index.ts: rewrite every command (init, config, set-llm, analyze, tailor,
cost, track, onboard, health, status, doctor) as mono-marble spec sheets.
No emojis. Zero chalk. Global --json, --plain, --no-color flags.
Co-Authored-By: Lavkush Kumar <ripukroy@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follows up on PR #1 (web) — the brief was to take the same engineering-marble language across the whole stack so the tool reads as one carved object, the way OpenClaw does. One palette, one voice, one response shape, zero drift between the web UI, the HTTP surface, and the CLI.
Three seams, same marble:
main)apps/web/src/index.css,components/marble.tsxPanel,Chip,Eyebrow,Crosshairsapps/api/src/lib/{marble,envelope,request-id,mono-logger}.tsbanner,rule,endpointLine,ok/fail, request idapps/cli/src/lib/{palette,ui}.tsbanner,rule,kv,chip,table,step,markBackend API (
apps/api){ "ok": true, "data": <T>, "meta": { "requestId": "r_…", "timestamp": "…" } } { "ok": false, "error": { "code": "…", "message": "…" }, "meta": { "requestId": "r_…", "timestamp": "…" } }GET /healthz(liveness) ·GET /readyz(readiness + DB probe) ·GET /v1/meta(version, uptime, node, commit, mode). Mirrors OpenClaw'shealth/status/doctor.GET /returns a plain-text marble spec sheet with banner + endpoint list + envelope legend + source link./v1/*;/api/*kept as an alias for the existing web client.HH:MM:SS MET STATUS ms path request-idline so successive requests register as a visual stack.Requestis assigned an opaque 16-char id (r_…); honoured from upstreamX-Request-Id, echoed in the response header, surfaced in the envelopemeta.ZodError→400 VALIDATION_FAILEDwith full issues; anything else →fail(). Stderr trace is one styled line, not a stack dump.CLI (
apps/cli)init,config,set-llm,analyze,tailor,cost summary|recent|budget,track list|stats|add,onboard,doctor— plus newhealthandstatuscommands mirroring the API triad.c.ivory,c.bone,c.graphite,c.muted,c.vein,c.signal,c.ok,c.warn,c.err), all output composed throughbanner/rule/kv/chip/step/mark/table. No emojis.NO_COLORrespected.--no-color/--plaindisable ANSI.--jsonshort-circuits styling entirely and emits machine-readable payloads forhealth/status/config.onboardlinks to docs and issues).Cross-cutting
npx turbo run type-check lint build→ 18/18 tasks pass.Evidence
Rendered with
ahaso the ANSI lands truthfully in PNG:GET /curl-friendly spec sheetapplypilot healthapplypilot statusapplypilot configapplypilot track statsReview & Testing Checklist for Human
Risk: yellow — the envelope is a behavioural change on the HTTP surface, and the existing web client currently calls
/api/*(kept as an alias, but worth eyeballing).apps/web→apps/apion/api/*). The envelope changes shape from{ jobs: […] }to{ ok, data: { jobs: […] }, meta }; any consumer readingresponse.jobsneeds to now readresponse.data.jobs.GET /on the running API in a terminal (curl http://localhost:8092/) and confirm the marble spec sheet renders — and that the endpoint list matches what you actually serve.applypilot health,applypilot status,applypilot doctor,applypilot configand sanity-check the output against your own environment. Also try--json,--plain, andNO_COLOR=1./api/*alias entirely and migrate the web client fully to/v1/*in a follow-up.Notes
npx turbo run type-check lint buildis green on this branch (18/18 tasks).MockQuery.all: …lines visible in the CLIstatusandtrack statsscreenshots are coming from the mock tracker/DB layer in@applypilot/tracker(stdout logging on the mockDatabase), not from the CLI rewrite — easy follow-up to silence once a real SQLite/Postgres adapter is wired in.@applypilot/core,@applypilot/jd,@applypilot/resume,@applypilot/tracker,@applypilot/portals) are intentionally untouched — the marble aesthetic is applied to the surfaces only, keeping this PR reviewable.Link to Devin session: https://app.devin.ai/sessions/d189411bcf4d4e7fbefe3d6adb8ddd24