open-index/open-npm huggingface dataset:
npm package: @openworkers/adapter-static
Description: Static site adapter for OpenWorkers
Latest version: 0.1.6

# @openworkers/adapter-static

Static site adapter for OpenWorkers. Converts any static site into a deployable worker with optimized asset serving.

## Installation

```bash
bun add -g @openworkers/adapter-static
```

## Quick Start

```bash
# Auto-detect input folder and generate worker
adapter-static

# Specify input and output directories
adapter-static ./build -o ./dist

# Custom 404 page
adapter-static --fallback /404.html
```

## CLI Options

| Option    | Flag             | Default            | Description                                         |
| --------- | ---------------- | ------------------ | --------------------------------------------------- |
| Input     | positional       | auto-detect        | Source directory (`dist`, `build`, `out`, `public`) |
| Output    | `-o, --out`      | `dist-openworkers` | Output directory                                    |
| Mode      | `-m, --mode`     | auto-detect        | Routing mode: `directory` or `flat`                 |
| Fallback  | `-f, --fallback` | none               | Fallback file for unmatched routes                  |
| Immutable | `--immutable`    | auto-detect        | Comma-separated immutable path patterns             |

## Programmatic Usage

```js
import { adapt } from '@openworkers/adapter-static';

await adapt({
  input: 'build',
  out: 'dist',
  mode: 'flat',
  fallback: '/404.html'
});
```

## Output Structure

```
dist/
├── _worker.js     # Worker serving files via ASSETS binding
├── _routes.json   # Route manifest for edge routing
└── assets/        # Static files
```

## Routing Modes

The adapter auto-detects the routing mode based on your file structure.

| Mode          | URL      | File                |
| ------------- | -------- | ------------------- |
| **Directory** | `/about` | `/about/index.html` |
| **Flat**      | `/about` | `/about.html`       |

Directory mode is used by most static generators. Flat mode is common with SvelteKit static adapter.

## Immutable Assets

Assets with hashed filenames are served with long cache headers (`max-age=31536000, immutable`).

Auto-detected patterns:

- `/_app/immutable/**` — SvelteKit
- `/assets/**` — Vite
- `/_next/static/**` — Next.js
- `/_astro/**` — Astro

## Deploy to OpenWorkers

**Quick deploy** (existing worker):

```bash
ow workers upload my-site ./dist
```

**Full setup**:

```bash
# 1. Create storage for assets
ow storage create my-site-assets --provider platform

# 2. Create environment
ow env create my-site-env

# 3. Bind storage to environment as ASSETS
ow env bind my-site-env ASSETS my-site-assets -t assets

# 4. Create worker
ow workers create my-site

# 5. Link environment to worker
ow workers link my-site my-site-env

# 6. Build and upload
adapter-static ./build -o ./dist
ow workers upload my-site ./dist
```

Your site is live at `https://my-site.workers.rocks`

## License

MIT
npm package: @openworkers/redis-fetch
Description: A simple package that interfaces Redis with HTTP.
Author: OpenWorkers Contributors
Latest version: 0.1.4

[github-license-url]: /LICENSE
[action-docker-url]: https://github.com/open-workers/redis-fetch/actions/workflows/build.yml
[npm-package-url]: https://www.npmjs.com/@openworkers/redis-fetch
[redis-fetch-server-url]: https://github.com/open-workers/redis-fetch-server
[redis-fetch-server-commands-url]: https://github.com/open-workers/redis-fetch-server/blob/main/commands.ts

# Redis fetch

[![License](https://img.shields.io/github/license/maxx-t/nginx-jwt-module.svg)][github-license-url]
[![Build](https://img.shields.io/github/actions/workflow/status/open-workers/redis-fetch/build.yml?logo=deno&label=Package+build)][action-docker-url]
[![Npm package](https://img.shields.io/npm/v/@openworkers/redis-fetch.svg?logo=npm&logoColor=fff&label=NPM+package&color=blue)][npm-package-url]

A simple package that interfaces Redis with HTTP.

## Installation

```bash
npm install @openworkers/redis-fetch
```

## Usage

```typescript
import { createClient } from 'redis-fetch';

const redis = createClient('http://my-redis-fetch-server:port/command');

// Fetch a key from the Redis server
redis
  .get('my-key')
  .then((res) => console.log(res)) // prints "bar"
  .catch((err) => console.error(err));
```

## How does it work?

Redis fetch uses the a single http endpoint to send commands to the Redis-fetch server. The Redis-fetch server then sends the command to Redis and returns the result to the client.

You can communicate with the Redis-fetch server using any HTTP client. For example, using `fetch` in the browser:

```js
const res = await fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ command: 'get my-key' })
});
```

## Redis-fetch server

The [Redis-fetch server][redis-fetch-server-url] is a simple HTTP server.

## Limitations

- Authentication is not supported (yet) by this package nor the Redis-fetch server.
- Redis-fetch server only supports common Redis commands. See [Redis-fetch server supported commands][redis-fetch-server-commands-url] for more details. Theses commands are the most common ones and should be enough for most use cases. Some of them are still exposed by this package but will throw an error if used.

## Authors

This package is almost identical to [Deno's Redis driver](https://github.com/denodrivers/redis) so most of the credits go to [Redis driver contributors](https://github.com/denodrivers/redis/graphs/contributors).

## License

This package is licensed under the MIT License. See the [LICENSE][github-license-url] file for more details.
npm package: @openworkers/workers-types
Description: TypeScript types for the OpenWorkers runtime
Latest version: 0.1.10

# @openworkers/workers-types

TypeScript types for the OpenWorkers runtime.

## Installation

```bash
bun add -d @openworkers/workers-types
```

## Usage

### Exclusive mode (recommended)

Add to your `tsconfig.json`:

```json
{
  "compilerOptions": {
    "types": ["@openworkers/workers-types"]
  }
}
```

This includes only OpenWorkers types and excludes conflicting types (like `@types/node` or `@types/bun`). Best for pure worker projects.

### Compatible mode

If you need to mix with Node.js or Bun types, just install the package without configuring `types`. The types will merge with existing globals:

```json
{
  "compilerOptions": {
    // no "types" array - all @types/* are included
  }
}
```

### Triple-slash directive

For per-file control:

```typescript
/// <reference no-default-lib="true" />
/// <reference lib="esnext" />
/// <reference types="@openworkers/workers-types" />
```

## Structure

- `types/globals.d.ts` - globalThis, self
- `types/fetch.d.ts` - Request, Response, Headers, fetch
- `types/url.d.ts` - URL, URLSearchParams
- `types/streams.d.ts` - ReadableStream, WritableStream
- `types/crypto.d.ts` - Web Crypto API
- `types/encoding.d.ts` - TextEncoder, TextDecoder, atob, btoa
- `types/console.d.ts` - Console API
- `types/timers.d.ts` - setTimeout, setInterval
- `types/events.d.ts` - Event, EventTarget
- `types/abort.d.ts` - AbortController, AbortSignal
- `types/blob.d.ts` - Blob, File, FormData
- `types/workers.d.ts` - ExecutionContext, ScheduledEvent, ExportedHandler
- `types/bindings.d.ts` - BindingAssets, BindingStorage, BindingKV, BindingDatabase, BindingWorker
npm package: @openworklabs/filecoin-wallet-styleguide
Description: Styleguide used for the Filecoin web wallet.
Author: Open Work Labs
Latest version: 0.1.6

# Filecoin-wallet-styleguide

## Repo layout

React component library lives in `/src`. The `/storybook` directory has all the stories, and runs the front-end. The `/dist` directory contains the transpiled JSX for publishing to npm.

## Developing locally

1. `git clone git@github.com:openworklabs/filecoin-wallet-styleguide.git && cd filecoin-wallet-styleguide`<br />
2. `npm i`
3. `npm link`
4. `npm run start`
5. `cd storybook`
6. `npm i`
7. `npm link @openworklabs/filecoin-wallet-styleguide`
8. `npm run storybook`

## Adding a new component

1. Create a new directory in `/src` => `/src/<ComponentName>`
2. Add the component and its prop-types. Default export the component.
3. Export the component in `/src/index.js` (`export { default as ComponentName } from './ComponentName'`)
4. Add a new file `/storybook/stories/<ComponentName>.stories.js`
5. Create a new story for the component.

## Usage

### Install

```bash
npm install --save @openworklabs/filecoin-wallet-styleguide styled-components
```

### Import

```jsx
import React, { Component } from 'react';

import { Button } from '@openworklabs/filecoin-wallet-styleguide';

class Example extends Component {
  render() {
    return <Button size="medium">Click me!</Button>;
  }
}
```
npm package: @openworklabs/glif-component-library
Description: you'll need to do a few things to npm link this: bump react and react-dom in filecoin-web-wallet to 16.13.1 bump styled-components to 5.2.0 npm link the components repo cd into <components repo>/node_modules rm -rf react react-dom ln -s ../filecoin-web-wa
Latest version: 0.0.0-alpha.1

you'll need to do a few things to npm link this:
bump react and react-dom in filecoin-web-wallet to 16.13.1
bump styled-components to 5.2.0
npm link the components repo
cd into <components repo>/node_modules
rm -rf react react-dom
ln -s ../filecoin-web-wallet/node_modules/react
ln -s ../filecoin-web-wallet/node_modules/react-dom
cd .. (out of node_modules)
yarn build (build the components)
cd ../filecoin-web-wallet
npm run dev
npm package: @openworklabs/react-scripts
Description: Configuration and scripts for Create React App.
Latest version: 0.0.1

# react-scripts

This package includes scripts and configuration used by [Create React App](https://github.com/facebook/create-react-app).<br>
Please refer to its documentation:

- [Getting Started](https://facebook.github.io/create-react-app/docs/getting-started) – How to create a new app.
- [User Guide](https://facebook.github.io/create-react-app/) – How to develop apps bootstrapped with Create React App.
npm package: @openworkspace/appscript
Description: Google Apps Script API client for project management and execution
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/appscript

> Google Apps Script API client for OpenWorkspace -- run scripts, manage projects.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install @openworkspace/appscript @openworkspace/core
```

## Usage

```typescript
import { createHttpClient } from '@openworkspace/core';
import { getProject, runFunction, listProcesses } from '@openworkspace/appscript';

const http = createHttpClient({ auth: { accessToken: 'token' } });

// Get a project
const result = await getProject(http, 'scriptId');
if (result.ok) {
  console.log(result.value.title);
}

// Run a function
const output = await runFunction(http, 'scriptId', {
  function: 'myFunction',
  parameters: ['arg1', 42],
});
if (output.ok) {
  console.log('Result:', output.value.response?.result);
}

// List recent executions
const procs = await listProcesses(http, { scriptId: 'scriptId' });
```

## API

All functions take an `HttpClient` as the first parameter and return `Result<T, E>`.

### Projects

- `getProject(http, scriptId)` -- Get project metadata
- `createProject(http, options)` -- Create a new project
- `getContent(http, scriptId)` -- Get project source files
- `updateContent(http, scriptId, content)` -- Update project source

### Execution

- `runFunction(http, scriptId, request)` -- Run a script function
- `listProcesses(http, options)` -- List execution processes

## License

[MIT](../../LICENSE)
npm package: @openworkspace/calendar
Description: Google Calendar API client for events, calendars, and freebusy
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/calendar

> Google Calendar API client for OpenWorkspace -- events, create, free/busy.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install @openworkspace/calendar @openworkspace/core
```

## Usage

```typescript
import { createHttpClient } from '@openworkspace/core';
import { listEvents, createEvent, queryFreeBusy } from '@openworkspace/calendar';

const http = createHttpClient({ auth: { accessToken: 'token' } });

// List upcoming events
const result = await listEvents(http, {
  timeMin: new Date().toISOString(),
  maxResults: 10,
});
if (result.ok) {
  for (const event of result.value.items ?? []) {
    console.log(event.summary, event.start?.dateTime);
  }
}

// Create an event
await createEvent(http, {
  summary: 'Team Standup',
  start: { dateTime: '2025-01-15T09:00:00Z' },
  end: { dateTime: '2025-01-15T09:30:00Z' },
  attendees: [{ email: 'alice@example.com' }],
});

// Check free/busy
const busy = await queryFreeBusy(http, {
  timeMin: '2025-01-15T00:00:00Z',
  timeMax: '2025-01-15T23:59:59Z',
  items: [{ id: 'primary' }],
});
```

## API

All functions take an `HttpClient` as the first parameter and return `Result<T, E>`.

- `listEvents(http, options)` -- List calendar events
- `getEvent(http, eventId)` -- Get event by ID
- `createEvent(http, options)` -- Create a new event
- `updateEvent(http, options)` -- Update an existing event
- `deleteEvent(http, eventId)` -- Delete an event
- `searchEvents(http, query)` -- Search events by text
- `listCalendars(http)` -- List calendars
- `getAcl(http, options)` -- Get calendar ACL rules
- `getColors(http)` -- Get calendar color definitions
- `queryFreeBusy(http, options)` -- Query free/busy information
- `findConflicts(http, options)` -- Find scheduling conflicts

## License

[MIT](../../LICENSE)
npm package: @openworkspace/chat
Description: Google Chat API client for spaces and messages
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/chat

> Google Chat API client for OpenWorkspace -- spaces, messages, direct messages.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install @openworkspace/chat @openworkspace/core
```

## Usage

```typescript
import { createHttpClient } from '@openworkspace/core';
import { listSpaces, sendMessage, createDirectMessage } from '@openworkspace/chat';

const http = createHttpClient({ auth: { accessToken: 'token' } });

// List spaces
const result = await listSpaces(http);
if (result.ok) {
  for (const space of result.value.spaces ?? []) {
    console.log(space.displayName, space.name);
  }
}

// Send a message to a space
await sendMessage(http, 'spaces/SPACE_ID', { text: 'Hello team!' });

// Send a direct message
await createDirectMessage(http, { text: 'Hey Alice!' }, 'users/USER_ID');
```

## API

All functions take an `HttpClient` as the first parameter and return `Result<T, E>`.

### Spaces

- `listSpaces(http, options)` -- List spaces
- `getSpace(http, spaceName)` -- Get a space
- `createSpace(http, space)` -- Create a named space
- `findSpace(http, displayName)` -- Find a space by name

### Messages

- `listMessages(http, spaceName, options)` -- List messages in a space
- `getMessage(http, messageName)` -- Get a message
- `sendMessage(http, spaceName, message)` -- Send a message
- `updateMessage(http, messageName, message)` -- Update a message
- `deleteMessage(http, messageName)` -- Delete a message

### Direct Messages

- `createDirectMessage(http, message, userId)` -- Send a DM
- `listDirectMessages(http, userId)` -- List DM spaces

## License

[MIT](../../LICENSE)
npm package: @openworkspace/classroom
Description: Google Classroom API client for courses, assignments, and grading
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/classroom

> Google Classroom API client for OpenWorkspace -- courses, coursework, roster, submissions.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install @openworkspace/classroom @openworkspace/core
```

## Usage

```typescript
import { createHttpClient } from '@openworkspace/core';
import { listCourses, listStudents, createCourseWork, gradeSubmission } from '@openworkspace/classroom';

const http = createHttpClient({ auth: { accessToken: 'token' } });

// List courses
const result = await listCourses(http);
if (result.ok) {
  for (const course of result.value.courses ?? []) {
    console.log(course.name, course.courseState);
  }
}

// List students in a course
const students = await listStudents(http, 'courseId');

// Create an assignment
await createCourseWork(http, 'courseId', {
  title: 'Homework 1',
  workType: 'ASSIGNMENT',
  maxPoints: 100,
});

// Grade a submission
await gradeSubmission(http, 'courseId', 'courseWorkId', 'submissionId', { assignedGrade: 95 });
```

## API

All functions take an `HttpClient` as the first parameter and return `Result<T, E>`.

### Courses

- `listCourses(http)` -- List all courses
- `getCourse(http, id)` -- Get a course
- `createCourse(http, course)` -- Create a course
- `updateCourse(http, id, course)` -- Update a course
- `deleteCourse(http, id)` -- Delete a course
- `archiveCourse(http, id)` -- Archive a course

### Roster

- `listStudents(http, courseId)` -- List students
- `listTeachers(http, courseId)` -- List teachers
- `addStudent(http, courseId, email)` -- Add a student
- `addTeacher(http, courseId, email)` -- Add a teacher
- `removeStudent(http, courseId, userId)` -- Remove a student
- `removeTeacher(http, courseId, userId)` -- Remove a teacher

### Coursework & Submissions

- `listCourseWork(http, courseId)` -- List assignments
- `getCourseWork(http, courseId, id)` -- Get an assignment
- `createCourseWork(http, courseId, work)` -- Create an assignment
- `updateCourseWork(http, courseId, id, work)` -- Update an assignment
- `deleteCourseWork(http, courseId, id)` -- Delete an assignment
- `listSubmissions(http, courseId, workId)` -- List submissions
- `getSubmission(http, courseId, workId, id)` -- Get a submission
- `gradeSubmission(http, courseId, workId, id, grade)` -- Grade a submission
- `returnSubmission(http, courseId, workId, id)` -- Return a submission

### Announcements & Guardians

- `listAnnouncements(http, courseId)` -- List announcements
- `createAnnouncement(http, courseId, announcement)` -- Create an announcement
- `deleteAnnouncement(http, courseId, id)` -- Delete an announcement
- `listGuardians(http, studentId)` -- List guardians
- `inviteGuardian(http, studentId, email)` -- Invite a guardian

## License

[MIT](../../LICENSE)
npm package: @openworkspace/cli
Description: Zero-dependency CLI for Google Workspace services
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/cli

> Zero-dependency CLI for Google Workspace services. Binary: `ows`.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install -g @openworkspace/cli
```

## Usage

```bash
# Authenticate
ows auth login

# Gmail
ows gmail search "from:boss subject:urgent"
ows gmail send --to alice@example.com --subject "Hello" --body "Hi!"

# Calendar
ows calendar list --days 7
ows calendar create --title "Standup" --start "2025-01-15T09:00:00"

# Drive
ows drive search "budget 2025"
ows drive upload ./report.pdf

# Sheets
ows sheets get <spreadsheetId> "Sheet1!A1:D10"

# Tasks
ows tasks list
ows tasks add "Buy groceries"

# Pipeline
ows pipeline run workflow.yaml

# MCP server (stdio)
ows mcp serve
```

## Commands

| Command | Description |
|---------|-------------|
| `ows auth login` | Start OAuth2 login flow |
| `ows auth status` | Show current auth status |
| `ows gmail search <query>` | Search Gmail messages |
| `ows gmail send` | Send an email |
| `ows calendar list` | List upcoming events |
| `ows calendar create` | Create a calendar event |
| `ows drive search <query>` | Search Drive files |
| `ows drive upload <file>` | Upload a file to Drive |
| `ows sheets get <id> <range>` | Read spreadsheet values |
| `ows tasks list` | List task lists and tasks |
| `ows pipeline run <file>` | Run a YAML pipeline |
| `ows mcp serve` | Start MCP server (stdio) |

## Options

```
--format, -f   Output format: table, json, yaml (default: table)
--profile, -p  Auth profile to use (default: default)
--verbose, -v  Verbose output
--help, -h     Show help
```

## License

[MIT](../../LICENSE)
npm package: @openworkspace/contacts
Description: Google Contacts API client via People API
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/contacts

> Google Contacts API client for OpenWorkspace -- search, list, create, directory.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install @openworkspace/contacts @openworkspace/core
```

## Usage

```typescript
import { createHttpClient } from '@openworkspace/core';
import { searchContacts, createContact, listDirectoryPeople } from '@openworkspace/contacts';

const http = createHttpClient({ auth: { accessToken: 'token' } });

// Search contacts
const result = await searchContacts(http, { query: 'Alice' });
if (result.ok) {
  for (const person of result.value.results ?? []) {
    const name = person.person?.names?.[0]?.displayName;
    const email = person.person?.emailAddresses?.[0]?.value;
    console.log(name, email);
  }
}

// Create a contact
await createContact(http, {
  names: [{ givenName: 'Bob', familyName: 'Smith' }],
  emailAddresses: [{ value: 'bob@example.com' }],
});

// List directory (Workspace domain)
const dir = await listDirectoryPeople(http, { sources: ['DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE'] });
```

## API

All functions take an `HttpClient` as the first parameter and return `Result<T, E>`.

- `listContacts(http, options)` -- List contacts
- `getContact(http, resourceName)` -- Get a contact
- `createContact(http, options)` -- Create a contact
- `updateContact(http, options)` -- Update a contact
- `deleteContact(http, resourceName)` -- Delete a contact
- `searchContacts(http, options)` -- Search contacts by query
- `listDirectoryPeople(http, options)` -- List domain directory
- `searchDirectoryPeople(http, query)` -- Search domain directory
- `listOtherContacts(http, options)` -- List "other" contacts
- `searchOtherContacts(http, query)` -- Search "other" contacts

## License

[MIT](../../LICENSE)
npm package: @openworkspace/core
Description: Core kernel, HTTP client, auth engine, and config for OpenWorkspace
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/core

> Core kernel, HTTP client, auth engine, and config for OpenWorkspace.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install @openworkspace/core
```

## Usage

```typescript
import { createHttpClient, createKernel, createLogger, ok, err } from '@openworkspace/core';

// Create an HTTP client with OAuth
const http = createHttpClient({
  auth: { accessToken: 'ya29...' },
});

// Create a kernel with plugins
const kernel = createKernel({ logger: createLogger({ level: 'info' }) });
await kernel.boot();

// Result pattern
const result = ok({ id: '1', name: 'file.txt' });
if (result.ok) {
  console.log(result.value.name);
}
```

## API

### HTTP Client

- `createHttpClient(options)` -- Create a configured HTTP client with auth, retries, and interceptors

### Kernel

- `createKernel(options)` -- Create a plugin kernel with commands and tools

### Result Pattern

- `ok(value)` / `err(error)` -- Create Result values
- `unwrap(result)` / `unwrapOr(result, fallback)` -- Extract values
- `map(result, fn)` / `mapErr(result, fn)` -- Transform results

### Auth

- `createTokenManager(config)` -- OAuth2 token lifecycle (refresh, cache, revoke)
- `createOAuthClient(config)` -- Full OAuth2 client with PKCE support

### Events & Logging

- `createEventBus()` -- Pub/sub event bus
- `createLogger(options)` -- Structured logger with sinks

## License

[MIT](../../LICENSE)
npm package: @openworkspace/docs
Description: Google Docs API client for documents and content
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/docs

> Google Docs API client for OpenWorkspace -- get, create, batch update, export.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install @openworkspace/docs @openworkspace/core
```

## Usage

```typescript
import { createHttpClient } from '@openworkspace/core';
import { getDocument, createDocument, insertText, replaceAllText, exportDocument } from '@openworkspace/docs';

const http = createHttpClient({ auth: { accessToken: 'token' } });

// Get a document
const result = await getDocument(http, 'docId123');
if (result.ok) {
  console.log(result.value.title);
}

// Create a document
const doc = await createDocument(http, 'Meeting Notes');

// Insert text
await insertText(http, 'docId123', { text: 'Hello, World!', index: 1 });

// Find and replace
await replaceAllText(http, 'docId123', { find: '{{name}}', replaceWith: 'Alice' });

// Export as PDF
const pdf = await exportDocument(http, 'docId123', 'application/pdf');
```

## API

All functions take an `HttpClient` as the first parameter and return `Result<T, E>`.

- `getDocument(http, id)` -- Get document content and metadata
- `createDocument(http, title)` -- Create a new document
- `copyDocument(http, id)` -- Copy a document
- `getDocumentTabs(http, id)` -- Get document tabs
- `readText(http, id)` -- Read document as plain text
- `batchUpdate(http, id, requests)` -- Send batch update requests
- `insertText(http, id, params)` -- Insert text at an index
- `deleteContent(http, id, range)` -- Delete a content range
- `replaceAllText(http, id, params)` -- Find and replace text
- `exportDocument(http, id, format)` -- Export as PDF, DOCX, etc.

## License

[MIT](../../LICENSE)
npm package: @openworkspace/drive
Description: Google Drive API client for files, folders, and permissions
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/drive

> Google Drive API client for OpenWorkspace -- search, upload, download, folders, permissions.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install @openworkspace/drive @openworkspace/core
```

## Usage

```typescript
import { createHttpClient } from '@openworkspace/core';
import { searchFiles, uploadFile, downloadFile, createFolder, shareFile } from '@openworkspace/drive';

const http = createHttpClient({ auth: { accessToken: 'token' } });

// Search files
const result = await searchFiles(http, 'budget 2025');
if (result.ok) {
  for (const file of result.value.files ?? []) {
    console.log(file.name, file.mimeType);
  }
}

// Upload a file
await uploadFile(http, {
  name: 'report.pdf',
  mimeType: 'application/pdf',
  content: fileBuffer,
});

// Download a file
const data = await downloadFile(http, 'fileId123');

// Create a folder
await createFolder(http, 'Project Assets');

// Share a file
await shareFile(http, 'fileId123', { type: 'user', role: 'reader', emailAddress: 'alice@example.com' });
```

## API

All functions take an `HttpClient` as the first parameter and return `Result<T, E>`.

- `listFiles(http, options)` -- List files with query
- `searchFiles(http, query)` -- Search files by name
- `getFile(http, fileId)` -- Get file metadata
- `deleteFile(http, fileId)` -- Delete a file
- `renameFile(http, fileId, name)` -- Rename a file
- `moveFile(http, fileId, folderId)` -- Move a file
- `copyFile(http, fileId)` -- Copy a file
- `uploadFile(http, options)` -- Upload a file
- `downloadFile(http, fileId)` -- Download file content
- `exportFile(http, fileId, format)` -- Export Google Docs/Sheets/Slides
- `createFolder(http, name)` -- Create a folder
- `listPermissions(http, fileId)` -- List file permissions
- `shareFile(http, fileId, options)` -- Share a file
- `unshareFile(http, fileId, permissionId)` -- Remove sharing

## License

[MIT](../../LICENSE)
npm package: @openworkspace/forms
Description: Google Forms API client for forms and responses
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/forms

> Google Forms API client for OpenWorkspace -- get, create, responses.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install @openworkspace/forms @openworkspace/core
```

## Usage

```typescript
import { createHttpClient } from '@openworkspace/core';
import { getForm, createForm, addQuestion, listResponses } from '@openworkspace/forms';

const http = createHttpClient({ auth: { accessToken: 'token' } });

// Get a form
const result = await getForm(http, 'formId');
if (result.ok) {
  console.log(result.value.info?.title);
  for (const item of result.value.items ?? []) {
    console.log(item.title);
  }
}

// Create a form
const form = await createForm(http, { info: { title: 'Feedback Survey' } });

// Add a question
await addQuestion(http, 'formId', {
  title: 'How was your experience?',
  questionItem: {
    question: { choiceQuestion: { type: 'RADIO', options: [{ value: 'Great' }, { value: 'OK' }, { value: 'Poor' }] } },
  },
});

// List responses
const responses = await listResponses(http, 'formId');
```

## API

All functions take an `HttpClient` as the first parameter and return `Result<T, E>`.

- `getForm(http, formId)` -- Get form metadata and items
- `createForm(http, form)` -- Create a new form
- `batchUpdateForm(http, formId, requests)` -- Batch update a form
- `addQuestion(http, formId, item)` -- Add a question item
- `deleteItem(http, formId, index)` -- Delete an item by index
- `listResponses(http, formId, options)` -- List form responses
- `getResponse(http, formId, responseId)` -- Get a single response

## License

[MIT](../../LICENSE)
npm package: @openworkspace/gmail
Description: Gmail API client for messages, threads, labels, and drafts
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/gmail

> Gmail API client for OpenWorkspace -- search, read, send, labels, threads, drafts.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install @openworkspace/gmail @openworkspace/core
```

## Usage

```typescript
import { createHttpClient } from '@openworkspace/core';
import { searchMessages, sendMessage } from '@openworkspace/gmail';

const http = createHttpClient({ auth: { accessToken: 'token' } });

// Search messages
const result = await searchMessages(http, { query: 'from:boss' });
if (result.ok) {
  for (const msg of result.value.messages ?? []) {
    console.log(msg.id, msg.snippet);
  }
}

// Send email
const sent = await sendMessage(http, {
  to: 'alice@example.com',
  subject: 'Hello',
  body: 'Hi there!',
});
```

## API

All functions take an `HttpClient` as the first parameter and return `Result<T, E>`.

- `searchMessages(http, params)` -- Search messages
- `getMessage(http, id)` -- Get a message by ID
- `batchModify(http, params)` -- Batch modify messages
- `batchDelete(http, params)` -- Batch delete messages
- `searchThreads(http, params)` -- Search threads
- `getThread(http, params)` -- Get a thread
- `modifyThread(http, params)` -- Modify thread labels
- `listLabels(http)` -- List all labels
- `createLabel(http, params)` -- Create a label
- `deleteLabel(http, id)` -- Delete a label
- `sendMessage(http, options)` -- Send an email
- `listDrafts(http, params)` -- List drafts
- `createDraft(http, options)` -- Create a draft
- `sendDraft(http, id)` -- Send a draft

## License

[MIT](../../LICENSE)
npm package: @openworkspace/groups
Description: Google Cloud Identity Groups API client
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/groups

> Google Groups API client for OpenWorkspace -- list, members, settings.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install @openworkspace/groups @openworkspace/core
```

## Usage

```typescript
import { createHttpClient } from '@openworkspace/core';
import { listGroups, searchGroups, listMembers, addMember } from '@openworkspace/groups';

const http = createHttpClient({ auth: { accessToken: 'token' } });

// List groups
const result = await listGroups(http, { parent: 'customers/my_customer' });
if (result.ok) {
  for (const group of result.value.groups ?? []) {
    console.log(group.displayName, group.groupKey?.id);
  }
}

// Search groups
const found = await searchGroups(http, { query: "displayName='Engineering'" });

// List members
const members = await listMembers(http, 'groups/GROUP_ID');

// Add a member
await addMember(http, 'groups/GROUP_ID', { preferredMemberKey: { id: 'alice@example.com' }, roles: [{ name: 'MEMBER' }] });
```

## API

All functions take an `HttpClient` as the first parameter and return `Result<T, E>`.

### Groups

- `listGroups(http, options)` -- List groups
- `getGroup(http, name)` -- Get a group
- `createGroup(http, group)` -- Create a group
- `updateGroup(http, name, group)` -- Update a group
- `deleteGroup(http, name)` -- Delete a group
- `searchGroups(http, options)` -- Search groups by query
- `lookupGroup(http, email)` -- Look up a group by email

### Members

- `listMembers(http, groupName, options)` -- List group members
- `addMember(http, groupName, membership)` -- Add a member
- `removeMember(http, membershipName)` -- Remove a member
- `getMembership(http, membershipName)` -- Get membership details

## License

[MIT](../../LICENSE)
npm package: @openworkspace/keep
Description: Google Keep API client for notes and lists
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/keep

> Google Keep API client for OpenWorkspace -- notes, attachments.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install @openworkspace/keep @openworkspace/core
```

## Usage

```typescript
import { createHttpClient } from '@openworkspace/core';
import { listNotes, createNote, createListNote, searchNotes, getAttachment } from '@openworkspace/keep';

const http = createHttpClient({ auth: { accessToken: 'token' } });

// List notes
const result = await listNotes(http);
if (result.ok) {
  for (const note of result.value.notes ?? []) {
    console.log(note.title, note.body?.text?.text?.slice(0, 50));
  }
}

// Create a text note
await createNote(http, { title: 'Shopping List', text: 'Milk, eggs, bread' });

// Create a list note
await createListNote(http, {
  title: 'To Do',
  items: ['Write report', 'Review PR', 'Update docs'],
});

// Search notes
const found = await searchNotes(http, 'shopping');

// Get an attachment
const attachment = await getAttachment(http, 'noteId', 'attachmentId');
```

## API

All functions take an `HttpClient` as the first parameter and return `Result<T, E>`.

### Notes

- `listNotes(http, options)` -- List notes
- `getNote(http, noteId)` -- Get a note
- `createNote(http, options)` -- Create a text note
- `createListNote(http, options)` -- Create a checklist note
- `deleteNote(http, noteId)` -- Delete a note
- `searchNotes(http, query)` -- Search notes by text

### Attachments

- `getAttachment(http, noteId, attachmentId)` -- Get attachment metadata
- `downloadAttachment(http, noteId, attachmentId)` -- Download attachment content

## License

[MIT](../../LICENSE)
npm package: @openworkspace/mcp
Description: MCP server with tool registry, stdio and HTTP/SSE transports
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/mcp

> MCP server with 28 tools for Google Workspace. Binary: `ows-mcp`.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install @openworkspace/mcp @openworkspace/core
```

## Claude Desktop Configuration

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "openworkspace": {
      "command": "npx",
      "args": ["ows-mcp"],
      "env": {
        "GOOGLE_ACCESS_TOKEN": "ya29..."
      }
    }
  }
}
```

## Usage

```typescript
import { createMcpServer, createToolRegistry, registerServiceTools } from '@openworkspace/mcp';
import { createHttpClient } from '@openworkspace/core';

const http = createHttpClient({ auth: { accessToken: 'token' } });
const registry = createToolRegistry();
registerServiceTools(registry, http);

const server = createMcpServer({
  name: 'openworkspace',
  version: '0.1.0',
  registry,
});
```

## Included Tools

| Service | Tools |
|---------|-------|
| Gmail | `gmail_search`, `gmail_read`, `gmail_send`, `gmail_labels` |
| Calendar | `calendar_list`, `calendar_create`, `calendar_freebusy` |
| Drive | `drive_search`, `drive_upload`, `drive_download`, `drive_share` |
| Sheets | `sheets_read`, `sheets_write`, `sheets_append` |
| Docs | `docs_get`, `docs_create`, `docs_update` |
| Slides | `slides_get`, `slides_create`, `slides_export` |
| Tasks | `tasks_list`, `tasks_create`, `tasks_complete` |
| Contacts | `contacts_search`, `contacts_create` |
| Chat | `chat_send`, `chat_spaces` |
| Keep | `keep_list`, `keep_create` |

## Transports

- **stdio** -- Default, used by Claude Desktop and other MCP clients
- **HTTP/SSE** -- For web-based integrations

## License

[MIT](../../LICENSE)
npm package: @openworkspace/people
Description: Google People API client for profiles and directory
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/people

> Google People API client for OpenWorkspace -- profiles, manager/reports relations.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install @openworkspace/people @openworkspace/core
```

## Usage

```typescript
import { createHttpClient } from '@openworkspace/core';
import { getProfile, getProfileByEmail, getManager, getDirectReports } from '@openworkspace/people';

const http = createHttpClient({ auth: { accessToken: 'token' } });

// Get current user's profile
const result = await getProfile(http, 'people/me');
if (result.ok) {
  const p = result.value;
  console.log(p.names?.[0]?.displayName, p.emailAddresses?.[0]?.value);
}

// Look up by email
const alice = await getProfileByEmail(http, 'alice@example.com');

// Get manager
const mgr = await getManager(http, 'people/me');

// Get direct reports
const reports = await getDirectReports(http, 'people/me');
```

## API

All functions take an `HttpClient` as the first parameter and return `Result<T, E>`.

### Profiles

- `getProfile(http, resourceName)` -- Get a person's profile
- `getProfileByEmail(http, email)` -- Look up profile by email
- `getBatchProfiles(http, resourceNames)` -- Get multiple profiles
- `searchProfiles(http, options)` -- Search directory profiles

### Org Chart

- `getManager(http, resourceName)` -- Get a person's manager
- `getDirectReports(http, resourceName)` -- Get direct reports

## License

[MIT](../../LICENSE)
npm package: @openworkspace/pipeline
Description: YAML workflow engine with expressions, forEach, parallel, and retries
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/pipeline

> YAML workflow engine with expressions, forEach, parallel, and retries.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install @openworkspace/pipeline @openworkspace/core
```

## Usage

### YAML Pipeline

```yaml
name: daily-report
steps:
  - id: emails
    action: gmail.search
    params:
      query: "is:unread after:{{ today }}"

  - id: notify
    action: gmail.send
    forEach: "{{ steps.emails.result.messages }}"
    params:
      to: manager@example.com
      subject: "FW: {{ item.subject }}"
      body: "{{ item.snippet }}"

  - id: backup
    action: drive.upload
    parallel:
      - params: { name: "report-a.pdf", content: "{{ steps.genA.result }}" }
      - params: { name: "report-b.pdf", content: "{{ steps.genB.result }}" }
```

### TypeScript API

```typescript
import { parseYaml, executePipeline, createContext, createBuiltinActions } from '@openworkspace/pipeline';
import { createHttpClient } from '@openworkspace/core';

const http = createHttpClient({ auth: { accessToken: 'token' } });
const yaml = parseYaml(yamlString);
const actions = createBuiltinActions(http);
const ctx = createContext({ today: '2025-01-15' });

const result = await executePipeline(yaml, ctx, actions);
if (result.ok) {
  console.log('Pipeline completed:', result.value);
}
```

## API

- `parseYaml(str)` -- Parse YAML string into a pipeline definition
- `executePipeline(pipeline, context, actions)` -- Execute a pipeline
- `createContext(vars)` -- Create an execution context with variables
- `createBuiltinActions(http)` -- Register built-in service actions
- `evaluateExpression(expr, context)` -- Evaluate a `{{ }}` expression
- `createPipelineBuilder()` -- Fluent builder for pipelines

## Features

- **Expressions** -- `{{ steps.id.result.field }}` interpolation
- **forEach** -- Iterate over arrays from previous steps
- **parallel** -- Run multiple variants of a step concurrently
- **Retries** -- Configurable retry with backoff per step
- **Conditions** -- `when: "{{ steps.check.result.count > 0 }}"` guards

## License

[MIT](../../LICENSE)
npm package: @openworkspace/sheets
Description: Google Sheets API client for reading, writing, and formatting
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/sheets

> Google Sheets API client for OpenWorkspace -- read, write, append, format, structure.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install @openworkspace/sheets @openworkspace/core
```

## Usage

```typescript
import { createHttpClient } from '@openworkspace/core';
import { getValues, updateValues, appendValues, createSpreadsheet } from '@openworkspace/sheets';

const http = createHttpClient({ auth: { accessToken: 'token' } });

// Read values
const result = await getValues(http, 'spreadsheetId', 'Sheet1!A1:D10');
if (result.ok) {
  for (const row of result.value.values ?? []) {
    console.log(row.join('\t'));
  }
}

// Write values
await updateValues(http, 'spreadsheetId', 'Sheet1!A1', {
  values: [['Name', 'Score'], ['Alice', 95], ['Bob', 87]],
});

// Append rows
await appendValues(http, 'spreadsheetId', 'Sheet1!A:D', {
  values: [['Charlie', 92]],
});

// Create a new spreadsheet
await createSpreadsheet(http, { title: 'Q1 Report' });
```

## API

All functions take an `HttpClient` as the first parameter and return `Result<T, E>`.

### Read

- `getSpreadsheet(http, id)` -- Get spreadsheet metadata
- `getValues(http, id, range)` -- Read cell values
- `batchGetValues(http, id, ranges)` -- Read multiple ranges
- `getMetadata(http, id)` -- Get sheet metadata

### Write

- `updateValues(http, id, range, options)` -- Write cell values
- `appendValues(http, id, range, options)` -- Append rows
- `clearValues(http, id, range)` -- Clear cell values
- `batchUpdateValues(http, id, options)` -- Write multiple ranges

### Structure

- `createSpreadsheet(http, options)` -- Create a spreadsheet
- `addSheet(http, id, title)` -- Add a sheet tab
- `deleteSheet(http, id, sheetId)` -- Delete a sheet tab
- `insertRows(http, id, options)` -- Insert rows
- `insertColumns(http, id, options)` -- Insert columns

### Format

- `formatCells(http, id, options)` -- Format a cell range
- `batchFormatCells(http, id, options)` -- Batch format cells

## License

[MIT](../../LICENSE)
npm package: @openworkspace/slides
Description: Google Slides API client for presentations
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/slides

> Google Slides API client for OpenWorkspace -- presentations, slides, speaker notes, export.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install @openworkspace/slides @openworkspace/core
```

## Usage

```typescript
import { createHttpClient } from '@openworkspace/core';
import { getPresentation, createPresentation, addSlide, replaceAllText, exportPresentation } from '@openworkspace/slides';

const http = createHttpClient({ auth: { accessToken: 'token' } });

// Get a presentation
const result = await getPresentation(http, 'presentationId');
if (result.ok) {
  console.log(result.value.title, `(${result.value.slides?.length} slides)`);
}

// Create a presentation
const pres = await createPresentation(http, 'Q1 Review');

// Add a slide
await addSlide(http, 'presentationId');

// Find and replace text across all slides
await replaceAllText(http, 'presentationId', { find: '{{date}}', replaceWith: '2025-01-15' });

// Export as PDF
const pdf = await exportPresentation(http, 'presentationId', 'application/pdf');
```

## API

All functions take an `HttpClient` as the first parameter and return `Result<T, E>`.

- `getPresentation(http, id)` -- Get presentation metadata and slides
- `createPresentation(http, title)` -- Create a new presentation
- `getSlide(http, presentationId, slideId)` -- Get a single slide
- `batchUpdate(http, id, requests)` -- Send batch update requests
- `addSlide(http, id)` -- Add a new slide
- `deleteSlide(http, id, slideId)` -- Delete a slide
- `replaceAllText(http, id, params)` -- Find and replace text
- `updateSpeakerNotes(http, id, slideId, notes)` -- Update speaker notes
- `exportPresentation(http, id, format)` -- Export as PDF, PPTX, etc.

## License

[MIT](../../LICENSE)
npm package: @openworkspace/tasks
Description: Google Tasks API client for task lists and tasks
Author: Ersin Koc
Latest version: 0.1.1

# @openworkspace/tasks

> Google Tasks API client for OpenWorkspace -- task lists, tasks CRUD.

Part of the [OpenWorkspace](https://github.com/ersinkoc/openworkspace) monorepo.

## Install

```bash
npm install @openworkspace/tasks @openworkspace/core
```

## Usage

```typescript
import { createHttpClient } from '@openworkspace/core';
import { listTaskLists, listTasks, createTask, completeTask } from '@openworkspace/tasks';

const http = createHttpClient({ auth: { accessToken: 'token' } });

// List task lists
const lists = await listTaskLists(http);
if (lists.ok) {
  for (const tl of lists.value.items ?? []) {
    console.log(tl.title);
  }
}

// List tasks in a list
const tasks = await listTasks(http, 'taskListId');
if (tasks.ok) {
  for (const t of tasks.value.items ?? []) {
    console.log(t.title, t.status);
  }
}

// Create a task
await createTask(http, 'taskListId', { title: 'Buy groceries', notes: 'Milk, eggs, bread' });

// Mark complete
await completeTask(http, 'taskListId', 'taskId');
```

## API

All functions take an `HttpClient` as the first parameter and return `Result<T, E>`.

### Task Lists

- `listTaskLists(http, options)` -- List all task lists
- `getTaskList(http, id)` -- Get a task list
- `createTaskList(http, title)` -- Create a task list
- `updateTaskList(http, id, title)` -- Rename a task list
- `deleteTaskList(http, id)` -- Delete a task list

### Tasks

- `listTasks(http, taskListId, options)` -- List tasks
- `getTask(http, taskListId, taskId)` -- Get a task
- `createTask(http, taskListId, task)` -- Create a task
- `updateTask(http, taskListId, taskId, task)` -- Update a task
- `deleteTask(http, taskListId, taskId)` -- Delete a task
- `completeTask(http, taskListId, taskId)` -- Mark task completed
- `uncompleteTask(http, taskListId, taskId)` -- Mark task not completed
- `moveTask(http, taskListId, taskId, options)` -- Reorder a task

## License

[MIT](../../LICENSE)