@plico-ai/sdk
v0.1.0
Published
Typed helpers for writing Plico projects: defineConfig and defineTool
Maintainers
Readme
@plico-ai/sdk
Typed helpers for writing a Plico project. Both return their argument unchanged; they exist so your editor can check the file.
// plico.config.ts
import { defineConfig } from "@plico-ai/sdk";
export default defineConfig({ schemaVersion: 1, name: "Support Agent", template: "internal-ops" });// tools/create-ticket.tool.ts
import { defineTool } from "@plico-ai/sdk";
export default defineTool({
name: "create_ticket",
description: "Create a support ticket.",
inputSchema: {
type: "object",
properties: { title: { type: "string" } },
required: ["title"],
},
capabilities: ["ticket:write"],
approval: { required: false },
handler: async (input) => ({ created: input.title }), // input: { title: string }
});defineTool infers the handler input from inputSchema:
- A JSON Schema is read for
type,enum,const,properties,requiredanditems. Any other keyword makes that partunknown; it never becomes a type error. - A Zod schema (3 or 4) gives its parsed output type. Add
zodto your project to use one.
You do not need to install @plico-ai/sdk in the project. plico validate and plico run resolve it from the project when it is there, and fall back to the copy that comes with the CLI. Install it when you want editor types.
