Services

Built-in wire services (@devframes/service-*): one node-side capability installed once per host and consumed by every devframe and RPC client, without re-implementing or re-bundling it.

Built-in wire services (@devframes/service-*) — one node-side capability installed once per host and consumed by every devframe and RPC client, without re-implementing or re-bundling it. See Cross-Devframe Services for the mechanism and the Node-Side API reference for the host API.

ServiceScopeRPC functionsWhat it does
Opendevframes:service:openopen-in-editor, open-in-finderOpen files in an editor or reveal them in the OS explorer, refusing paths outside the workspace.
Gitdevframes:service:gitstatus, log, show, readFile, diff, branches, tags, stage, unstage, commitTyped read/write git operations over RPC on one repo.
Shikidevframes:service:shikihighlight, code-to-hast, code-to-tokensNode-side Shiki syntax highlighting, LRU-cached and dual-theme.

Installing a service

Services are declarative — a devframe lists what it consumes on its definition; a hub lists shared ones on initHub:

defineDevframe({
  importMetaUrl: import.meta.url, // resolution base for the declared packages
  services: [
    { package: '@devframes/service-open' },
    { package: '@devframes/service-shiki', version: '^1', options: { langs: ['vue'] } },
  ],
})

The host constructs each declared service once, before any setup(ctx) runs, so setup consumes it synchronously via ctx.services.get(pkg). On the RPC client, feature-detect with rpc.services.has(pkg).