open-index/open-npm huggingface dataset:
npm package: @openharmonyinsight/opencode-oh
Description: OpenHarmony OpenCode Helper Tool - Configure opencode with third-party model providers
Author: raymond.wangxing@huawei.com
Latest version: 0.1.1

# opencode-oh

OpenHarmony OpenCode Helper Tool - Configure opencode with third-party model providers through an interactive TUI.

## Features

- Interactive TUI interface for easy configuration
- Support for multiple providers (Volcengine, OpenAI, DeepSeek, etc.)
- API key validation before applying configuration
- Automatic backup of existing configuration
- Bilingual support (Chinese/English)

## Installation

```bash
npm install -g opencode-oh
```

## Usage

Run the tool:

```bash
opencode-oh
```

Follow the interactive prompts to:

1. Select a provider
2. Enter your API key
3. Enter the model name
4. Validate your API key
5. Apply the configuration

## Supported Providers

- **Volcengine** (火山引擎) - OpenAI-compatible API
- **OpenAI** - Official OpenAI API
- **DeepSeek** - OpenAI-compatible API

## Configuration

The tool modifies `~/.config/opencode/opencode.json`. Before making any changes, it automatically creates a timestamped backup file.

## Development

```bash
# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

# Run in development mode
npm run dev
```

## Project Structure

```
src/
  cli.ts           # CLI entry point
  index.ts         # Main module
  config/          # Configuration management
    index.ts
    types.ts
  provider/        # Provider templates
    templates.ts
  tui/             # TUI interface
    index.ts
  validation/      # API key validation
    index.ts
```

## License

MIT
npm package: @openharness/provider-vfs
Description: Virtual filesystem provider for @openharness/core — sandboxed, in-memory, or SQLite-backed file access for AI agents
Latest version: 0.1.2

# @openharness/provider-vfs

Virtual filesystem provider for [@openharness/core](../core). Gives your agents sandboxed, in-memory, or persistent file access instead of hitting the real filesystem.

Built on [@platformatic/vfs](https://github.com/platformatic/vfs) (a userland shim for the upcoming `node:vfs`). When Node.js ships native VFS support, the provider will use it automatically — no code changes needed.

## Install

```bash
npm install @openharness/provider-vfs @platformatic/vfs
```

Requires Node.js >= 22.

## Usage

```typescript
import { createFsTools } from "@openharness/core";
import { VfsFsProvider } from "@openharness/provider-vfs";

// In-memory VFS (default) — fully ephemeral, no disk access
const fsTools = createFsTools(new VfsFsProvider());
```

### Backends

```typescript
import { MemoryProvider, SqliteProvider, RealFSProvider } from "@platformatic/vfs";

// SQLite-backed — persistent across restarts
const fsTools = createFsTools(new VfsFsProvider({
  provider: new SqliteProvider("/path/to/db.sqlite"),
}));

// Sandboxed real FS — real files, but the agent can't escape the root
const fsTools = createFsTools(new VfsFsProvider({
  provider: new RealFSProvider("/safe/workspace"),
}));
```

### Pre-configured VFS

If you need full control (overlay mode, custom mount point, etc.), create the VFS yourself:

```typescript
import { create, MemoryProvider } from "@platformatic/vfs";

const vfs = create(new MemoryProvider(), { overlay: true, virtualCwd: true });
vfs.mount("/workspace");

const fsTools = createFsTools(new VfsFsProvider({ vfs }));
```

## Options

| Option | Default | Description |
| --- | --- | --- |
| `vfs` | — | Pre-created `VirtualFileSystem` instance. Skips auto-creation. |
| `provider` | `MemoryProvider` | VFS backend (`MemoryProvider`, `SqliteProvider`, `RealFSProvider`). |
| `vfsOptions` | `{ moduleHooks: false, virtualCwd: true }` | Options passed to `create()`. |
| `mountPoint` | `"/workspace"` | VFS mount point. |
| `maxFileSize` | `10 MB` | Reject reads for files larger than this. |

## License

ISC
npm package: @openharness/react
Description: React hooks and provider for OpenHarness AI SDK 5 integration
Latest version: 1.0.0

# @openharness/react

React hooks and provider for [OpenHarness](https://github.com/MaxGfeller/open-harness) AI SDK 5 chat UIs.

## Install

```bash
npm install @openharness/react
```

Peer dependencies: `@openharness/core`, `@ai-sdk/react`, `react`

## Quick start

```tsx
import {
  OpenHarnessProvider,
  useOpenHarness,
  useSubagentStatus,
  useSessionStatus,
} from "@openharness/react";

function App() {
  return (
    <OpenHarnessProvider>
      <Chat />
    </OpenHarnessProvider>
  );
}

function Chat() {
  const { messages, sendMessage, status } = useOpenHarness({
    endpoint: "/api/chat",
  });
  const { activeSubagents, hasActiveSubagents } = useSubagentStatus();
  const session = useSessionStatus();

  return (
    <div>
      {messages.map((msg) => (
        <div key={msg.id}>
          {msg.parts.map((part, i) =>
            part.type === "text" ? <span key={i}>{part.text}</span> : null
          )}
        </div>
      ))}
      {hasActiveSubagents && <p>Subagents working...</p>}
      <button onClick={() => sendMessage({ text: "Hello" })}>Send</button>
    </div>
  );
}
```

## API

### `<OpenHarnessProvider>`

Context provider that holds subagent, session, and sandbox state. Wrap your app or chat component with this.

### `useOpenHarness(config)`

Creates a chat session connected to your API endpoint. Returns the same interface as AI SDK 5's `useChat` (`messages`, `sendMessage`, `status`, `stop`, etc.), typed with `OHUIMessage`.

If you pass `messages`, the hook will also hydrate them when they arrive after the first render, which is useful for async persistence loads.

`onFinish` receives the full finish event, including `isAbort`, so persistence code can skip saving aborted assistant messages when desired.

### `useSubagentStatus()`

Derives reactive state from `data-oh:subagent.*` stream events:

- `activeSubagents` -- currently running subagents
- `recentSubagents` -- all subagents seen in this session
- `hasActiveSubagents` -- boolean shorthand

### `useSessionStatus()`

Tracks turn index, compaction state, and retry info from `data-oh:*` stream events.

### `useSandboxStatus()`

Tracks sandbox-related state from stream events.

### `createOHTransport(options)`

Low-level transport factory for custom integrations. Creates the SSE connection with OpenHarness data part handling.

## Documentation

See the [full documentation](https://github.com/MaxGfeller/open-harness#readme) for server setup, middleware composition, and the complete streaming protocol.

## License

ISC
npm package: @openharness/vue
Description: Vue 3 composables and provider for OpenHarness AI SDK 5 integration
Latest version: 1.0.0

# @openharness/vue

Vue 3 composables and provider for [OpenHarness](https://github.com/MaxGfeller/open-harness) AI SDK 5 chat UIs.

## Install

```bash
npm install @openharness/vue
```

Peer dependencies: `@openharness/core`, `@ai-sdk/vue`, `vue`

## Quick start

```vue
<script setup lang="ts">
import { OpenHarnessProvider, useOpenHarness, useSubagentStatus, useSessionStatus } from '@openharness/vue';
</script>

<template>
  <OpenHarnessProvider>
    <Chat />
  </OpenHarnessProvider>
</template>
```

```vue
<script setup lang="ts">
import { ref } from 'vue';
import { useOpenHarness, useSubagentStatus, useSessionStatus } from '@openharness/vue';

const chat = useOpenHarness({ endpoint: '/api/chat' });
const subagent = useSubagentStatus();
const session = useSessionStatus();
const input = ref('');

function handleSubmit() {
  const text = input.value.trim();
  if (!text) return;
  input.value = '';
  chat.sendMessage({ text });
}
</script>

<template>
  <div>
    <div v-for="msg in chat.messages" :key="msg.id">
      <template v-for="(part, i) in msg.parts" :key="i">
        <span v-if="part.type === 'text'">{{ part.text }}</span>
      </template>
    </div>
    <p v-if="subagent.hasActiveSubagents">Subagents working...</p>
    <form @submit.prevent="handleSubmit">
      <input v-model="input" placeholder="Type a message..." />
      <button type="submit">Send</button>
    </form>
  </div>
</template>
```

## API

### `<OpenHarnessProvider>`

Renderless component that provides shared subagent, session, and sandbox state to all child composables. Wrap your app or chat component with this.

### `useOpenHarness(config)`

Creates a chat session connected to your API endpoint. Returns an AI SDK 5 `Chat` instance with reactive properties (`messages`, `status`, `error`, `sendMessage`, `stop`, etc.), typed with `OHUIMessage`.

### `useSubagentStatus()`

Returns a computed ref deriving reactive state from `data-oh:subagent.*` stream events:

- `activeSubagents` -- currently running subagents
- `recentSubagents` -- all subagents seen in this session
- `hasActiveSubagents` -- boolean shorthand

### `useSessionStatus()`

Returns a computed ref tracking turn index, compaction state, and retry info from `data-oh:*` stream events.

### `useSandboxStatus()`

Returns a computed ref tracking sandbox-related state from stream events.

### `createOHTransport(options)`

Low-level transport factory for custom integrations. Creates the SSE connection with OpenHarness data part handling.

## Documentation

See the [full documentation](https://github.com/MaxGfeller/open-harness#readme) for server setup, middleware composition, and the complete streaming protocol.

## License

ISC