New:Socket for Asana Is Now Available.Learn more
Get Started

@jgalego/teamapi-chat

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jgalego/teamapi-chat

Chat as a team or a member of a Team API as Code org — a provider-neutral tool-use loop over the resolved org graph, for Anthropic or any OpenAI-compatible endpoint

Source
npmnpm
Version
0.3.1
Version published
Weekly downloads
221
35.58%
Maintainers
1
Weekly downloads
 
Created
Source

@jgalego/teamapi-chat

npm CI Node License: MIT

Chat as a team or a specific team member from a Team API as Code org — backed by a live tool-use loop over the same 13 org-graph operations @jgalego/teamapi-mcp-server exposes, so the persona can answer questions about any team in the org.

Normally used via teamapi chat --team <id> [--member <id>] [--ask <question>].

Providers

The package includes two adapters:

providerendpointkey
anthropicthe Anthropic Messages APIANTHROPIC_API_KEY, required
openaiany OpenAI Chat Completions serverOPENAI_API_KEY, optional

The openai adapter calls a configurable base URL with fetch. The shared wire format reaches Azure OpenAI, Ollama, vLLM, llama.cpp, Together, Groq, Fireworks, OpenRouter, and most self-hosted gateways without a vendor SDK. Authentication is optional because local models usually do not require it.

Install

npm install @jgalego/teamapi-chat

Usage

import { buildChatPersona, buildChatTools, createChatSession } from "@jgalego/teamapi-chat";

const persona = buildChatPersona(graph, { teamId: "stream-checkout", memberId: "diego-alves" });

const session = createChatSession({
  provider: "openai",
  baseUrl: "http://localhost:11434/v1", // or omit for api.openai.com
  model: "llama3.1",
  system: persona.systemPrompt,
  tools: buildChatTools(graph),
});

const answer = await session.ask("is payments overloaded right now?");
console.log(answer.text);
if (answer.stoppedBecause) console.warn(`incomplete: ${answer.stoppedBecause}`);

ask never pretends a turn finished when it didn't: stoppedBecause is tool-limit, refusal or truncated when the model stopped for a reason other than completing its answer.

Adding a provider

A tool is a name, a description, a zod schema and a function — ChatTool, in tool.ts, with no vendor content in it. An adapter converts that list to the provider's shape and drives the call-observe-call loop, which is about a hundred lines. runToolByName handles the parts every adapter needs identically: validating arguments against the schema, and turning an unknown tool or a thrown error into a message the model can read and recover from rather than an exception that ends the turn.

Full docs and a sample transcript: https://github.com/JGalego/TeamAPI

The TeamAPI toolchain

Seven packages expose the same org graph. Install the ones you need:

PackageWhat it does
@jgalego/teamapiThe CLI — validate, diagram, check, import, reconcile, serve and chat with your org
@jgalego/teamapi-coreThe engine: $ref resolution, the org graph, scoring, checks, diagrams, generators
@jgalego/teamapi-schemaZod schemas and TypeScript types for the extended spec
@jgalego/teamapi-rest-apiREST API, live dashboard, Swagger UI, Prometheus metrics
@jgalego/teamapi-mcp-serverThe org graph as MCP tools for LLM assistants
@jgalego/teamapi-chat (this package)Chat as a team or member — Anthropic or any OpenAI-compatible endpoint
@jgalego/teamapi-backstageLive Backstage catalog entity provider

Docs, examples and the extended spec: teamapi.dev · github.com/JGalego/TeamAPI

License

MIT

Keywords

teamapi

FAQs

Package last updated on 26 Aug 2026

Related posts