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

@kindgi/sdk

v0.8.1

Published

@kindgi/sdk — the authoring SDK for Kindgi™. Facade over the individual @kindgi/* packages + @kindgi/client. Unifies pack authoring (defineTool / defineCheck / defineAgent / defineFlow) and client callsites (createClient) behind three sub-paths: /define,

Readme

@kindgi/sdk

The public developer surface for Kindgi.

One package with five sub-paths — /define for pack authoring, /client for callsite HTTP and following runs, /types for branded identifiers, /webhooks for receiving Kindgi's webhooks (server only), /build for a pack image's build extensions (kindgi.config's image) — plus a flat barrel for callers who prefer a single import. An application lists @kindgi/sdk and @kindgi/cli (dev); it needs no other @kindgi/* package. Zero behavior of its own: this package is a re-export facade over the individual @kindgi/* packages, with every name preserved verbatim.

Framework contributors can import from the individual packages directly (@kindgi/tools, @kindgi/agents, @kindgi/guardrails, @kindgi/flow, @kindgi/client, @kindgi/types, @kindgi/schema). Application code (packs, deploy tooling, external callers) should import from @kindgi/sdk — the recommended public surface.

Sub-paths

@kindgi/sdk/define — pack authoring

import { defineTool, defineCheck, defineAgent } from '@kindgi/sdk/define';
import type { Tool, Agent, DefinedTool, DefineCheckSpec } from '@kindgi/sdk/define';

Re-exports:

| Symbol | Source | Kind | |---|---|---| | defineTool, defineToolAsync, invokeTool, invokeToolForTest, toolContextForTest, registerToolSpecSynthesizer, ConnectionRejectedError, isConnectionRejectedError, ToolFailure, isToolFailure | @kindgi/tools | value | | Tool, ToolManifest, ToolContext, DefineToolSpec, DefinedTool, InferInput, InferOutput, ToolSpec, ToolSpecSynthesizer, ToolSecretRef, HttpToolSpec, HttpAuthSpec, HttpHeaderSpec, HttpMethod, HttpRequestBodySpec, ToolConnection, ConnectionNeed, ConnectionAccount, ToolFailureDetails, ToolFailureOptions, ToolFailedError | @kindgi/tools | type | | defineCheck | @kindgi/guardrails | value | | DefineCheckSpec, DefinedCheck, InferCheckConfig | @kindgi/guardrails | type | | defineAgent | @kindgi/agents | value | | Agent, DefineAgentSpec | @kindgi/agents | type | | defineFlow | @kindgi/flow | value | | Flow, FlowSpec, LoopNode, FanoutNode, SubflowNode, EdgePolicy | @kindgi/flow | type | | isZodSchema, toJSONSchema | @kindgi/schema | value | | AnySchema, ZodLikeSchema | @kindgi/schema | type |

defineFlow mirrors defineTool / defineCheck / defineAgent — a thin wrapper over loadFlow that runs the same validation gauntlet and returns Result<Flow, FlowError>. Pack authors reach for defineFlow in TypeScript; loadFlow remains the wire-form entry point for JSON coming off disk / network.

@kindgi/sdk/client — client callsites

import { createClient } from '@kindgi/sdk/client';
import type { AgentId } from '@kindgi/sdk/types';

const client = createClient();

const run = await client.runs.start({
  agent: 'acme.drafting' as AgentId,
  input: { contractText },
});

createClient() finds the runtime by itself. Every option is optional:

  • apiUrl and auth come from KINDGI_API_URL and KINDGI_API_TOKEN;
  • in development, when those aren't set, from the running kindgi dev (the nearest .kindgirc.json), with a one-time warning to put them in your env file (.env / .env.local);
  • the two go together: with only one of them set, the client throws, naming the file and what to set, and takes nothing from .kindgirc.json. A URL that is that kindgi dev's own is the exception: it takes the file's token;
  • a token that doesn't match the running kindgi dev's for the same URL (after kindgi dev --reset) is warned about once.

Production (NODE_ENV or KINDGI_ENV = production) never reads .kindgirc.json: the env or explicit options must say. Explicit options always win, field by field:

const client = createClient({
  apiUrl: 'https://kindgi.internal.acme.com',
  auth: { kind: 'apiToken', token: await secrets.get('kindgi-api-token') },
});

In a browser, pass apiUrl and auth to @kindgi/client's createClient (the explicit client underneath).

Exports:

  • createClient (above), KindgiClient.
  • Every resource client type — AgentsClient, RunsClient, ToolsClient, ApprovalsClient, ImproveRunsClient, ObservationsClient, FlowsClient, GuardrailsClient, ConversationsClient, MemoryClient, ProvenanceClient, TenantClient, CostClient, CapabilitiesClient, AdaptersClient, PoliciesClient, UsersClient, TeamsClient, OrgsClient, PacksClient, TokensClient, McpClient, EventsClient, ArtifactsClient, plus each resource's per-method input types.
  • Transport, TransportRequest, ClientOptions.
  • Error surface — KindgiApiError (value), fromWire, notImplementedInPreview, notYetWired, plus KindgiError, AuthError, ConflictError, GuardrailViolationError, GuardrailViolation, InvalidRequestError, NetworkError, NotFoundError, RateLimitedError, ServerError, NotImplementedInPreviewError, NotYetWiredError types.
  • Streaming — readSse, unwrapSseData (values), SseEvent, SseReadOptions (types).
  • Following a run — subscribeToRun (a browser page follows a run with a public run token, reconnecting by itself), followRun, and SubscribeToRunOptions, FollowRunOptions, RunProgressEvent, RunProgress. Browser-safe, like the rest of this sub-path.

This sub-path deliberately does NOT re-export the branded ID types (AgentId, RunId, etc.) that @kindgi/client also happens to surface — those live in @kindgi/sdk/types so the flat barrel is collision-free.

@kindgi/sdk/types — branded identifiers + primitives

import type { RunId, AgentId, Result, Cursor } from '@kindgi/sdk/types';

Re-exports every branded …Id type from @kindgi/types (41 IDs incl. TenantId, RunId, AgentId, ToolId, PackId, SigningKeyId, …), the Result<T, E> envelope + OkOf / ErrOf narrowing helpers, Brand, pagination (Filter, Page, Cursor), refs (BlobRef, DatasetRef, VersionedRef), temporal (Timestamp, DurationMs, IsoDuration), version + hash (SchemaMajor, Semver, ContentHash, SignatureValue).

ConversationId is one of them. @kindgi/agents also re-exports ConversationId; import it from @kindgi/sdk/types (or @kindgi/types directly).

@kindgi/sdk/webhooks — receiving Kindgi's webhooks (server only)

import { verifyWebhook } from '@kindgi/sdk/webhooks';

const result = verifyWebhook({ secret, headers: request.headers, body: rawBody });
if (result.kind !== 'ok') return new Response(null, { status: 401 });

Re-exports the Standard Webhooks helpers from @kindgi/crypto: verifyWebhook (and its VerifyWebhookInput / VerifyWebhookResult / VerifyWebhookFailure / WebhookRequestHeaders types), generateWebhookSecret and isStrongWebhookSecret for the secret an app registers by name, signWebhook / webhookHeaders to test a receiver, and the constants WEBHOOK_HEADERS, WEBHOOK_SECRET_PREFIX, WEBHOOK_SECRET_MIN_BYTES, DEFAULT_WEBHOOK_TOLERANCE_SECONDS. It uses node:crypto, so it is not in the flat barrel.

@kindgi/sdk/build — a pack image's build extensions

import { prisma, defineBuildExtension } from '@kindgi/sdk/build';
import type { BuildExtension, ImageConfig } from '@kindgi/sdk/build';

For image in kindgi.config.*: systemPackages, extensions (prisma(), or your own with defineBuildExtension()), and buildEnv. These are data only, and kindgi build renders them into the image. They're re-exported from @kindgi/handler-runtime/build-extensions. The flat barrel doesn't include them: only a config imports them.

Flat barrel — @kindgi/sdk

import { defineTool, createClient } from '@kindgi/sdk';
import type { RunId, DefinedTool } from '@kindgi/sdk';

Convenience alias. Every symbol from /define, /client and /types is re-exported here; names are disjoint across the three so there is no collision. /webhooks is server only and stays out of the barrel.

Design decisions

  • A facade, not a replacement. @kindgi/client (sdks/typescript/) stays its own package; the facade re-exports from it.
  • Every re-export preserves the source name. No renaming at the facade boundary. Symbols in this package's docs match the source package's docs exactly.
  • @kindgi/sdk is recommended, not enforced. The individual packages remain importable for framework contributors and for consumers that need a specific primitive without pulling the full facade dep tree.
  • Sub-paths are primary; the barrel is a convenience. Applications that only need pack authoring can import from '@kindgi/sdk/define' and never pay for the client resource-type surface at build time (tree-shaken).

Cross-references

  • packages/tools/README.md — defineTool Zod-optional authoring.
  • packages/guardrails/README.md — defineCheck Zod-optional authoring.