open-index/open-npm huggingface dataset:
npm package: @promte/app-library
Description: Docs for using the app DB API in embedded apps.
Latest version: 0.1.4

# @promte/app-library

Docs for using the app DB API in embedded apps.

## What "DB" means here

In this library, DB access is exposed as:

```ts
const client = usePromteClient();
const db = client.data(); // default scope: "private"
```

## Scopes

- `private` (default): data is scoped per user.
- `public`: shared for the whole workspace.
  - Reads are allowed for users with workspace access.
  - Writes (`set`, `update`, `remove`, `push`) require workspace admin/owner.

```ts
const privateDb = client.data(); // same as client.data("private")
const publicDb = client.data("public");
```

## Paths and refs

Use slash-separated paths:

```ts
const settingsRef = client.data("public").ref("translator/settings");
```

Path normalization trims spaces and removes extra slashes, so `" /a//b/ "` becomes `"a/b"`.

## Core operations

```ts
// Read
const settings = await client.data("public").ref("translator/settings").get();

// Set/replace value at path
await client.data("public").ref("translator/settings").set({
  temperature: 0.2,
});

// Update multiple child paths relative to current ref
await client.data("public").ref("translator").update({
  "settings/temperature": 0.3,
  "features/context": true,
});

// Remove path
await client.data("public").ref("translator/features").remove();

// Push into array at path (creates array if missing/not array)
await client.data().ref("sessions/session-1/events").push({
  type: "message",
  at: Date.now(),
});
```

## Models/capabilities

You can fetch configured models/capabilities from backend:

```ts
const client = usePromteClient();
const allModels = await client.models();
const llmsOnly = await client.models({ type: "llm", configuredOnly: true });
```

Or use the built-in hook:

```ts
const { models, loading, error, reload } = usePromteModels({
  type: "llm",
  configuredOnly: true,
});
```

Each model includes `id`, `label`, `type` (`llm` | `embedding` | `image` | `stt` | `tts`) and `configured`.

## Return behavior

- `get()` returns the value at the current path, or `null` if missing.
- Mutations (`set`, `update`, `remove`, `push`) return the updated scope object.

## Common patterns

```ts
// Save one record by id
await client.data().ref(`sessions/${sessionId}`).set(session);

// List records under a collection-like object
const sessionsObj = await client.data().ref("sessions").get();
const sessions = sessionsObj ? Object.values(sessionsObj) : [];
```

## Errors to expect

- `Promte settings not received yet` / `Promte token not received yet`:
  provider handshake not ready.
- `Admin only`:
  trying to write to `public` scope without admin rights.
- `update requires an object`:
  `ref.update(...)` got a non-object input.
- `push requires a path`:
  attempted `client.data().push(...)` without a ref path.
npm package: @promte/app-upload
Description: CLI to upload Promte app bundles
Latest version: 0.1.12

# promte-app-upload

CLI for uploading Promte app bundles.

## Quick start
```
npx @promte/app-upload config
npx @promte/app-upload push
```

## Commands
```
npx @promte/app-upload config
  - interactive setup for backend host/workspaceId/dist (stored in ./promte-app-upload.config.json)

npx @promte/app-upload push [--host ...] [--workspaceId ...] [--dist ...] [--zip ...] [--token ...]
  - uploads ./dist by default
  - host is the workspace backend URL used for prepare/finalize
  - assets upload to app.promte.dk (or backend-provided uploadHost)
  - use --zip <file> to upload an existing zip
```

Notes:
- Tokens are never stored in the config file.
- If no token is provided, the CLI will prompt for it.