npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@makaio/adapter-qwen-acp

v1.0.0-dev-1779051654000

Published

Qwen Code CLI adapter for the Makaio AI framework. Integrates with Alibaba's Qwen Code agent by spawning the `qwen` CLI binary and communicating over the Agent Client Protocol (ACP) via stdio rather than calling a provider API directly.

Downloads

54

Readme

@makaio/ai-adapters-qwen-acp

Qwen Code CLI adapter for the Makaio AI framework. Integrates with Alibaba's Qwen Code agent by spawning the qwen CLI binary and communicating over the Agent Client Protocol (ACP) via stdio rather than calling a provider API directly.

Quick Start

import { createQwenAcpAdapter } from '@makaio/ai-adapters-qwen-acp';
import { MakaioBus } from '@makaio/bus-core';
import { AdapterSubjects } from '@makaio/contracts';

const adapter = await createQwenAcpAdapter();

const result = await MakaioBus.request(AdapterSubjects.startAgent, {
  adapterId: adapter.adapterId,
  role: 'lead',
  initialMessage: 'Inspect this repository',
});

Adapter Identity

| Field | Value | |-------|-------| | adapterName | 'qwen-acp' | | protocol | 'openai' | | providers | qwen-oauth | | defaultPresetId | 'qwen-oauth' | | defaultModel | 'qwen3.5-plus(openai)' | | clients | [{ id: 'qwen', version: '^0.1.0' }] |

Architecture

Three-layer design matching the framework adapter contract:

| Layer | Class | Responsibility | |-------|-------|----------------| | Domain | QwenAcpAdapter | Handles adapter.* bus subjects, lifecycle | | Agent | QwenAcpAgent | Wires connector events to global agent.* subjects | | Connector | QwenAcpConnector | Spawns qwen --acp, manages ACP session |

The connector spawns the qwen binary with --acp and communicates over stdio using the @agentclientprotocol/sdk. The shared @makaio/ai-adapters-acp-client package provides the subprocess spawn, ndjson stream bridge, and terminal manager used by this connector.

Key connector behaviors:

  • Lazy ACP session initialization; idempotent initialize() call
  • System prompt injected via a temporary markdown file (QWEN_SYSTEM_MD env var)
  • Model and CWD are bound at subprocess spawn; in-place changes are not supported (changeModelInPlace and changeCwdInPlace both return false)
  • ACP delegates all tool execution to the client — no nativeTools are declared
  • Permission requests flow through the standard AgentSubjects.toolApprove bus subject
  • Filesystem read/write gated through the tool approval flow

Capabilities

Runtime capabilities declared by the adapter:

| Capability | Meaning | |------------|---------| | tools | Tool approval via ACP permission requests | | streaming | Incremental message and thought chunk events | | systemPrompt:override | Replace the system prompt via QWEN_SYSTEM_MD |

Conformance-test capabilities returned by createTestConfig():

| Feature | Supported | |---------|-----------| | supportsReplace | Yes | | supportsInterrupt | Yes — ACP session/cancel | | supportsUsageMetrics | Yes — per-turn tokens from agent_message_chunk._meta.usage |

Configuration

Provider configuration is resolved from the ProviderContext supplied on adapter.startAgent. The QwenAcpProviderConfigSchema defines the provider-specific options:

| Field | Type | Description | |-------|------|-------------| | binaryPath | string (optional) | Path to qwen CLI binary (default: "qwen" via PATH) | | approvalMode | 'plan' \| 'default' \| 'auto-edit' \| 'yolo' (optional) | How tool approval is handled by the CLI | | authType | 'openai' \| 'anthropic' \| 'qwen-oauth' \| 'gemini' \| 'vertex-ai' (optional) | Authentication method for the underlying model provider |

The qwen binary is resolved in this priority order:

  1. Explicit providerConfig.binaryPath
  2. Managed binary resolved from the provider context
  3. qwen on PATH

Default timeouts:

| Phase | Default | |-------|---------| | initialization | 30 s | | acknowledgement | 30 s | | completion | 60 s | | toolApproval | 5 s | | eventWait | 3 s |

Conformance Testing

import { createTestConfig } from '@makaio/ai-adapters-qwen-acp';

const config = await createTestConfig();

File Index

| File | Purpose | |------|---------| | src/adapter.ts | QwenAcpAdapter and createQwenAcpAdapter factory | | src/agent.ts | QwenAcpAgent — event routing layer | | src/connector.ts | QwenAcpConnector — ACP subprocess bridge | | src/turn.ts | QwenAcpTurn — turn state machine | | src/tool-handling.ts | Tool approval bridging utilities | | src/tool-execution.ts | ACP filesystem read/write execution | | src/permission.ts | Maps Makaio approval responses to ACP permission outcomes | | src/system-prompt.ts | System prompt lifecycle and reinitialisation logic | | src/provider.ts | Provider IDs and preset configuration | | src/provider.fetcher.ts | Model fetcher for provider resolution | | src/config.ts | QwenAcpConfig — adapter config factory | | src/schemas.ts | QwenAcpProviderConfigSchema | | src/constants.ts | QwenAcpAdapterName, DefaultModel, DEFAULT_TIMEOUTS | | src/types.ts | QwenAcpConnectorConfig type | | src/definition.ts | Internal adapter definition consumed by the package descriptor | | src/package.ts | MakaioExtension package descriptor with adapters[] contribution | | src/server.ts | Server entrypoint that re-exports the package descriptor as default | | src/conformance.ts | createTestConfig for the shared conformance test suite | | src/namespaces/ | Bus namespace (adapter:qwen-acp), subjects, and event schemas | | src/utils/ | Utility functions (CLI args builder, prompt builder, MCP server mapping) |

Installation

This is a private workspace package. It is not published to npm and is only available from this source workspace.