Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

feat(host): startAgentDevice() for embedder-owned daemons

Offen
#3,757 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
15/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
nodejs, typescript
Bereich
api, devtools

Rechercherichtung

This is design work blocked by #3753, #3754 and #3755, so start by reading those and ADR 0027 and 0030 rather than writing code. The relevant entry points are the agent-device/host subpath boundary in scripts/layering/daemon-client-entry.ts, registration tokens in packages/daemon-contracts/src/daemon-registration-owner.ts, and PID matching in packages/daemon-contracts/src/daemon-process.ts. Done means the integration tests and packaged-export smoke test listed in the issue pass.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement ready-for-agent

Part of #3747. Blocked by #3753, #3754, #3755.

Required behavior

import { startAgentDevice } from 'agent-device/host';
import testmu from '@agent-device/testmu';

await using host = await startAgentDevice({
  stateDir,
  host?: HostEnvironment,            // defaults to a captured copy of the calling process
  plugins: [testmu({ credentials })],
  log?: (entry: LogEntry) => void,   // silent by default
});
host.client        // AgentDeviceClient
host.clientConfig  // serializable; daemonLifecycle: 'attach'; pinned to this daemon's token and instance
await host.close() // ShutdownReport (#3752); also Symbol.asyncDispose
  • Subpath. It's exported from a new agent-device/host subpath, not the root, to respect the eager-closure budgets (ADR 0027) and R78 (scripts/layering/daemon-client-entry.ts:16).
  • Listener. The daemon runs in the calling process with a listener, so other processes can attach using clientConfig. Several hosts may share one process.
  • Plugins. plugins is the complete embedder set: store plugins are not merged. Built-ins still load.
  • Registration. It uses the ADR 0030 acquisition tokens (packages/daemon-contracts/src/daemon-registration-owner.ts:71). A state dir with a live registered daemon is refused (details.reason: 'state-dir-in-use').
  • Embedded ownership is recorded, so managed recovery and ensureDaemon never signal the host's PID. Pinned clients refuse a replaced daemon.
  • Stopping. agent-device daemon stop --state-dir stops an embedded daemon through an authenticated shutdown request. It awaits the removed registration and the report, not a process exit. This replaces PID command matching (packages/daemon-contracts/src/daemon-process.ts:11) for embedded daemons.

Done when

  • An integration test covers:
    • an embedder fixture plugin;
    • attach clients from a second process;
    • two hosts in one process;
    • the close() report;
    • daemon stop against an embedded daemon.
  • A packaged-export smoke test for agent-device/host passes.
  • The client API and website docs are updated, and the skill's routing notes cover hosting if startup guidance changes.
  • There's a changeset.
Vorherrschende Sprache
TypeScript
Sterne
5k
Forks
334
Ø Merge
12 Std. 2 Min.
Gemergte PRs (30 T.)
678

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus callstack/agent-device

Alle Issues in callstack/agent-device

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.