🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@robinpath/anthropic

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@robinpath/anthropic - npm Package Compare versions

Comparing version
0.1.2
to
0.3.0
+19
dist/anthropic.d.ts
/**
* RobinPath Anthropic (Claude) Module — Node port of packages/php/anthropic.
*
* Calls api.anthropic.com/v1/messages — Claude's chat-completion endpoint
* with full support for system prompts, vision, and tool use.
*
* Authentication via the RobinPath credential vault. Every method takes
* a credential slug as its first argument.
*
* Credential type:
* - anthropic : { api_key }
*/
import type { BuiltinHandler, CredentialTypeSchema, FunctionMetadata, ModuleHost, ModuleMetadata } from "@robinpath/core";
export declare function configureAnthropic(h: ModuleHost): void;
export declare const AnthropicFunctions: Record<string, BuiltinHandler>;
export declare const AnthropicCredentialTypes: CredentialTypeSchema[];
export declare const AnthropicFunctionMetadata: Record<string, FunctionMetadata>;
export declare const AnthropicModuleMetadata: ModuleMetadata;
//# sourceMappingURL=anthropic.d.ts.map
{"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../src/anthropic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,cAAc,EAEf,MAAM,iBAAiB,CAAC;AAGzB,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,CAAoB;AAwH3E,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAA6B,CAAC;AAE5F,eAAO,MAAM,wBAAwB,EAAE,oBAAoB,EAiB1D,CAAC;AA2CF,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CA4FtE,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,cAoBrC,CAAC"}
/**
* RobinPath Anthropic (Claude) Module — Node port of packages/php/anthropic.
*
* Calls api.anthropic.com/v1/messages — Claude's chat-completion endpoint
* with full support for system prompts, vision, and tool use.
*
* Authentication via the RobinPath credential vault. Every method takes
* a credential slug as its first argument.
*
* Credential type:
* - anthropic : { api_key }
*/
const state = {};
export function configureAnthropic(h) { state.host = h; }
function host() {
if (!state.host)
throw new Error("Anthropic module not initialized — use rp.installModule().");
return state.host;
}
const API_BASE = "https://api.anthropic.com/v1/";
const API_VERSION = "2023-06-01";
const DEFAULT_MODEL = "claude-sonnet-4-5";
const CREDENTIAL_TYPE = "anthropic";
const errorReturn = (error, code, extra = {}) => ({ error, code, ...extra });
async function resolveApiKey(slug) {
if (!slug)
return errorReturn("Credential slug is required.", "credential_not_found");
const fields = await host().credentials.get(slug);
if (!fields)
return errorReturn(`Credential '${slug}' not found.`, "credential_not_found");
const apiKey = String(fields.api_key ?? "");
if (!apiKey)
return errorReturn("Credential has no `api_key` field.", "api_key_missing");
return { apiKey };
}
async function callJson(cred, endpoint, body) {
const resolved = await resolveApiKey(cred);
if ("error" in resolved)
return resolved;
let response;
try {
response = await fetch(`${API_BASE}${endpoint.replace(/^\/+/, "")}`, {
method: "POST",
headers: {
"x-api-key": resolved.apiKey,
"anthropic-version": API_VERSION,
"Content-Type": "application/json",
},
body: JSON.stringify(body),
});
}
catch (e) {
return errorReturn(e instanceof Error ? e.message : String(e), "transport");
}
const raw = await response.text();
let decoded;
try {
decoded = raw ? JSON.parse(raw) : null;
}
catch {
decoded = { raw };
}
if (response.status >= 200 && response.status < 300) {
return decoded ?? { ok: true };
}
const err = (decoded && typeof decoded === "object" && "error" in decoded)
? decoded.error
: {};
const type = err && typeof err === "object" && "type" in err ? String(err.type) : "";
let message = `Anthropic returned HTTP ${response.status}.`;
if (err && typeof err === "object" && "message" in err) {
message = String(err.message);
}
let code = "anthropic_error";
if (response.status === 429)
code = "rate_limited";
else if (type === "overloaded_error")
code = "overloaded";
return errorReturn(message, code, { status: response.status, anthropic_error: err });
}
function mapOption(opts, body, optKey, apiKey) {
if (opts[optKey] !== undefined && opts[optKey] !== null)
body[apiKey] = opts[optKey];
}
function buildBody(messages, opts, requireMaxTokens = true) {
const body = {
model: String(opts.model ?? DEFAULT_MODEL),
messages,
};
if (requireMaxTokens) {
body.max_tokens = opts.maxTokens !== undefined ? Number(opts.maxTokens) | 0 : 1024;
}
else if (opts.maxTokens !== undefined) {
body.max_tokens = Number(opts.maxTokens) | 0;
}
mapOption(opts, body, "system", "system");
mapOption(opts, body, "temperature", "temperature");
mapOption(opts, body, "topP", "top_p");
mapOption(opts, body, "topK", "top_k");
mapOption(opts, body, "stopSequences", "stop_sequences");
mapOption(opts, body, "tools", "tools");
mapOption(opts, body, "toolChoice", "tool_choice");
mapOption(opts, body, "metadata", "metadata");
return body;
}
const messages = async (args) => {
const cred = String(args[0] ?? "");
const messagesInput = Array.isArray(args[1]) ? args[1] : [];
const opts = (args[2] && typeof args[2] === "object" ? args[2] : {});
if (messagesInput.length === 0)
return errorReturn("`messages` is required.", "messages_missing");
return (await callJson(cred, "messages", buildBody(messagesInput, opts)));
};
const countTokens = async (args) => {
const cred = String(args[0] ?? "");
const messagesInput = Array.isArray(args[1]) ? args[1] : [];
const opts = (args[2] && typeof args[2] === "object" ? args[2] : {});
if (messagesInput.length === 0)
return errorReturn("`messages` is required.", "messages_missing");
return (await callJson(cred, "messages/count_tokens", buildBody(messagesInput, opts, false)));
};
export const AnthropicFunctions = { messages, countTokens };
export const AnthropicCredentialTypes = [
{
slug: CREDENTIAL_TYPE,
title: "Anthropic API Key",
icon: "sparkles",
fields: [
{
name: "api_key",
title: "API Key",
type: "password",
required: true,
placeholder: "sk-ant-...",
description: "Get one at console.anthropic.com/settings/keys. Starts with `sk-ant-`.",
pattern: "^sk-ant-",
},
],
},
];
const credentialParam = {
name: "credential",
title: "Credential",
description: "Slug of a saved `anthropic` credential.",
dataType: "string",
formInputType: "resource",
required: true,
allowExpression: true,
placeholder: "my_anthropic",
resource: {
type: "credential",
listFn: "credential.list",
modes: ["list", "expression"],
searchable: true,
filter: { type: CREDENTIAL_TYPE },
},
};
const messagesParam = {
name: "messages",
title: "Messages",
description: "Array of `{role, content}` objects. Roles: `user`, `assistant`. The first message must be `user`.\n\nContent can be a string, or an array of content blocks (for vision: `{type:'text', text:'...'}` and `{type:'image', source:{type:'base64', media_type, data}}`).",
dataType: "array",
formInputType: "json",
required: true,
allowExpression: true,
language: "json",
rows: 8,
placeholder: '[\n {"role": "user", "content": "Hello!"}\n]',
};
const commonErrors = {
credential_not_found: "No credential with that slug exists in the vault.",
api_key_missing: "The credential exists but has no `api_key` field.",
transport: "Network failure calling api.anthropic.com.",
anthropic_error: "Claude returned an error — see `anthropic_error.type` and `anthropic_error.message`.",
rate_limited: "You hit a rate limit. Slow down or upgrade your plan.",
overloaded: "Anthropic's servers are overloaded — retry with backoff.",
};
export const AnthropicFunctionMetadata = {
messages: {
title: "Send messages",
summary: "Get a response from Claude given a conversation",
description: "Calls `/v1/messages`. Returns the full response — read `.content[0].text` for the assistant reply.",
group: "chat",
action: "write",
icon: "message-square",
capability: "manage_options",
sideEffects: ["makes_http_call", "charges_money"],
idempotent: false,
since: "1.0.0",
tags: ["anthropic", "claude", "chat", "completion", "llm"],
parameters: [
credentialParam,
messagesParam,
{
name: "options",
title: "Options",
description: "Recognized keys:\n model : default '" + DEFAULT_MODEL + "'\n system : string or array — system prompt\n maxTokens : int (default 1024) — REQUIRED by the API; we default it for you\n temperature : 0–1\n topP : 0–1\n topK : int\n stopSequences : array of strings\n tools : array of tool definitions\n toolChoice : { type: 'auto' | 'any' | 'tool', name?: string }\n metadata : { user_id?: string }",
dataType: "object",
formInputType: "json",
required: false,
allowExpression: true,
language: "json",
rows: 6,
advanced: true,
},
],
returnType: "object",
returnDescription: "Anthropic messages response with id, content[], stop_reason, model, usage.",
returnSchema: {
type: "object",
properties: {
id: { type: "string" },
model: { type: "string" },
role: { type: "string" },
content: { type: "array" },
stop_reason: { type: "string" },
usage: { type: "object" },
error: { type: "string" },
},
},
errors: commonErrors,
examples: [
{
title: "Summarize a comment",
code: 'anthropic.messages "my_anthropic" [\n {role: "user", content: "Summarize in one sentence: {{ comment.content }}"}\n] {system: "You are concise.", maxTokens: 60}',
},
{
title: "With vision",
code: 'anthropic.messages "my_anthropic" [\n {role: "user", content: [\n {type: "text", text: "Describe this image"},\n {type: "image", source: {type: "base64", media_type: "image/jpeg", data: "..."}}\n ]}\n] {model: "claude-sonnet-4-5"}',
},
],
example: 'anthropic.messages "my_anthropic" [{role:"user", content:"Hi"}]',
},
countTokens: {
title: "Count tokens",
summary: "Estimate how many tokens a request would consume — without billing",
description: "Calls `/v1/messages/count_tokens`. Useful for budgeting context window usage before sending a real request. Free.",
group: "utility",
action: "read",
icon: "hash",
capability: "manage_options",
sideEffects: ["makes_http_call"],
idempotent: true,
since: "1.0.0",
tags: ["anthropic", "claude", "tokens", "count", "estimate"],
parameters: [
credentialParam,
messagesParam,
{
name: "options",
title: "Options",
description: "Same options as `messages` (model, system, tools — they affect the count).",
dataType: "object",
formInputType: "json",
required: false,
allowExpression: true,
language: "json",
rows: 4,
advanced: true,
},
],
returnType: "object",
returnDescription: "{ input_tokens: int }",
errors: commonErrors,
example: 'anthropic.countTokens "my_anthropic" [{role:"user", content:"Hello"}]',
},
};
export const AnthropicModuleMetadata = {
slug: "anthropic",
title: "Anthropic (Claude)",
summary: "Chat with Claude — full Messages API support including vision, tool use, and system prompts",
description: "Call Claude from RobinPath scripts. Pass a credential slug, a list of `{role, content}` messages, and any options. Returns the parsed response — read `.content[0].text` for plain text answers, `.stop_reason` to detect tool calls or completion.\n\nFor multimodal input, build content as an array of `{type:'text', text:'...'}` and `{type:'image', source:{type:'base64', media_type:'image/jpeg', data:'...'}}` blocks.",
category: "ai",
icon: "icon.svg",
color: "#D97757",
version: "0.2.0",
docsUrl: "https://docs.robinpath.com/modules/anthropic",
status: "stable",
requires: [],
minNodeVersion: "18.0.0",
credentialsType: CREDENTIAL_TYPE,
operationGroups: {
chat: { title: "Chat", description: "Generate completions.", order: 1 },
utility: { title: "Utility", description: "Token counting.", order: 2 },
},
methods: Object.keys(AnthropicFunctions),
};
//# sourceMappingURL=anthropic.js.map
{"version":3,"file":"anthropic.js","sourceRoot":"","sources":["../src/anthropic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAWH,MAAM,KAAK,GAA0B,EAAE,CAAC;AACxC,MAAM,UAAU,kBAAkB,CAAC,CAAa,IAAU,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;AAC3E,SAAS,IAAI;IACX,IAAI,CAAC,KAAK,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAC/F,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB,CAAC;AAED,MAAM,QAAQ,GAAG,+BAA+B,CAAC;AACjD,MAAM,WAAW,GAAG,YAAY,CAAC;AACjC,MAAM,aAAa,GAAG,mBAAmB,CAAC;AAC1C,MAAM,eAAe,GAAG,WAAW,CAAC;AAGpC,MAAM,WAAW,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,QAAiC,EAAE,EAAe,EAAE,CACpG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,EAAkB,CAAA,CAAC;AAE7C,KAAK,UAAU,aAAa,CAAC,IAAY;IACvC,IAAI,CAAC,IAAI;QAAE,OAAO,WAAW,CAAC,8BAA8B,EAAE,sBAAsB,CAAC,CAAC;IACtF,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM;QAAE,OAAO,WAAW,CAAC,eAAe,IAAI,cAAc,EAAE,sBAAsB,CAAC,CAAC;IAC3F,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IAC5C,IAAI,CAAC,MAAM;QAAE,OAAO,WAAW,CA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,uBAAuB,GAAmB;IACrD,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,oBAAoB;IAC3B,OAAO,EAAE,6FAA6F;IACtG,WAAW,EACT,iaAAia;IACna,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE,8CAA8C;IACvD,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,EAAE;IACZ,cAAc,EAAE,QAAQ;IACxB,eAAe,EAAE,eAAe;IAChC,eAAe,EAAE;QACf,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,uBAAuB,EAAE,KAAK,EAAE,CAAC,EAAE;QACvE,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAAC,EAAE;KACxE;IACD,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC;CACzC,CAAC"}
import type { ModuleAdapter } from "@robinpath/core";
declare const AnthropicModule: ModuleAdapter;
export default AnthropicModule;
export { AnthropicModule };
export { AnthropicFunctions, AnthropicFunctionMetadata, AnthropicModuleMetadata, AnthropicCredentialTypes, } from "./anthropic.js";
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AASrD,QAAA,MAAM,eAAe,EAAE,aAQtB,CAAC;AAEF,eAAe,eAAe,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC"}
import { AnthropicFunctions, AnthropicFunctionMetadata, AnthropicModuleMetadata, AnthropicCredentialTypes, configureAnthropic, } from "./anthropic.js";
const AnthropicModule = {
name: "anthropic",
functions: AnthropicFunctions,
functionMetadata: AnthropicFunctionMetadata,
moduleMetadata: AnthropicModuleMetadata,
credentialTypes: AnthropicCredentialTypes,
configure: configureAnthropic,
global: false,
};
export default AnthropicModule;
export { AnthropicModule };
export { AnthropicFunctions, AnthropicFunctionMetadata, AnthropicModuleMetadata, AnthropicCredentialTypes, } from "./anthropic.js";
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAExB,MAAM,eAAe,GAAkB;IACrC,IAAI,EAAE,WAAW;IACjB,SAAS,EAAE,kBAAkB;IAC7B,gBAAgB,EAAE,yBAAyB;IAC3C,cAAc,EAAE,uBAAuB;IACvC,eAAe,EAAE,wBAAwB;IACzC,SAAS,EAAE,kBAAkB;IAC7B,MAAM,EAAE,KAAK;CACd,CAAC;AAEF,eAAe,eAAe,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC"}
+18
-8
{
"name": "@robinpath/anthropic",
"version": "0.1.2",
"version": "0.3.0",
"publishConfig": {

@@ -23,12 +23,16 @@ "access": "public"

"peerDependencies": {
"@robinpath/core": ">=0.20.0"
"@robinpath/core": ">=0.40.0"
},
"devDependencies": {
"@robinpath/core": "^0.30.1",
"@robinpath/core": "^0.40.0",
"typescript": "^5.6.0"
},
"description": "Anthropic module for RobinPath.",
"description": "Anthropic Claude integration — messages API with vision, tool use, and system prompts. Uses the encrypted credential vault for API keys.",
"keywords": [
"anthropic",
"ai"
"ai",
"claude",
"llm",
"chat",
"messages"
],

@@ -38,7 +42,13 @@ "license": "MIT",

"category": "ai",
"type": "integration",
"auth": "api-key",
"type": "module",
"auth": "credential-vault",
"functionCount": 17,
"baseUrl": "https://api.anthropic.com"
"baseUrl": "https://api.anthropic.com",
"language": "nodejs",
"platforms": [
"cloud",
"cli",
"desktop"
]
}
}

@@ -22,3 +22,3 @@ # @robinpath/anthropic

```bash
npm install @robinpath/anthropic
robinpath add @robinpath/anthropic
```

@@ -25,0 +25,0 @@