Skip to content

nanocoai/nanoclaw / .claude/skills/add-iron-proxy

add-iron-proxy

Flagged

Install or refresh Iron Proxy and its official Iron Control web console for NanoClaw. Use when selecting the Iron gateway, adding its management UI, configuring credentials and grants, or restoring the proxy, approval bridge, and agent guidance.

FileKindSize
REMOVE.mdmarkdown1.7 KB
SKILL.mdskill md18.4 KB
assets/entrypoint.shscript300 B
assets/managed-proxy.Dockerfileother1.0 KB
conformance/credential-scope-cases.goscript3.0 KB
conformance/credential-scope-cases.jsonconfig28.8 KB
evals/evals.jsonconfig983 B
front-proxy/go.modmanifest443 B
front-proxy/go.summanifest3.2 KB
front-proxy/main.goscript22.6 KB
front-proxy/security_test.goscript29.8 KB
gateway.jsonconfig128 B
payload/src/gateway-providers/iron-proxy-allowlist.tsscript2.9 KB
payload/src/gateway-providers/iron-proxy-approval.test.tsscript14.4 KB
payload/src/gateway-providers/iron-proxy-approval.tsscript12.2 KB
payload/src/gateway-providers/iron-proxy-credential-scope.test.tsscript23.6 KB
payload/src/gateway-providers/iron-proxy-credential-scope.tsscript14.1 KB
payload/src/gateway-providers/iron-proxy-local-model.test.tsscript2.3 KB
payload/src/gateway-providers/iron-proxy-local-model.tsscript1.8 KB
payload/src/gateway-providers/iron-proxy-transform.protoother1.4 KB
payload/src/gateway-providers/iron-proxy.test.tsscript16.5 KB
payload/src/gateway-providers/iron-proxy.tsscript21.5 KB
references/control-plane.mdmarkdown4.8 KB
scripts/allowed-hosts.test.tsscript4.0 KB
scripts/auth-resume.test.tsscript6.2 KB
scripts/auth.test.tsscript2.4 KB
scripts/auth.tsscript7.9 KB
scripts/build-managed-proxy.tsscript4.8 KB
scripts/capture-claude-token.shscript963 B
scripts/control-preflight.tsscript3.8 KB
scripts/control.test.tsscript4.5 KB
scripts/control.tsscript11.7 KB
scripts/credential-isolation.test.tsscript5.6 KB
scripts/credential-isolation.tsscript3.9 KB
scripts/credential-store.test.tsscript9.1 KB
scripts/credential-store.tsscript7.0 KB
scripts/detect.test.tsscript1.6 KB
scripts/detect.tsscript1.4 KB
scripts/install-claude.shexecutablescript1.8 KB
scripts/install-command.test.tsscript5.2 KB
scripts/install-command.tsscript4.8 KB
scripts/local-model.test.tsscript2.7 KB
scripts/provider-credentials.test.tsscript18.3 KB
scripts/provider-credentials.tsscript20.1 KB
scripts/setup.test.tsscript7.9 KB
scripts/setup.tsscript17.1 KB
versions.jsonconfig747 B

scripts/local-model.test.ts

View on GitHub
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { afterEach, expect, it, vi } from 'vitest';

const run = vi.hoisted(() => vi.fn(async () => {}));
const prepareLocalModel = vi.hoisted(() => vi.fn(async () => {}));
vi.mock('./setup.js', async (importOriginal) => ({
  ...(await importOriginal<typeof import('./setup.js')>()),
  run,
  prepareLocalModel,
}));
const { ironModelEndpoint } = await import('./provider-credentials.js');
const { checkModelList } = await import('./setup.js');

const roots: string[] = [];
afterEach(() => {
  roots.splice(0).forEach((root) => fs.rmSync(root, { recursive: true, force: true }));
  run.mockClear();
  prepareLocalModel.mockClear();
});
const project = () => {
  const root = fs.mkdtempSync(path.join(os.tmpdir(), 'iron-local-'));
  roots.push(root);
  return root;
};
const ok = (body: unknown) => `HTTP/1.0 200 OK\r\nContent-Type: application/json\r\n\r\n${JSON.stringify(body)}`;

it('prepares a keyless model on this machine without writing any pin', async () => {
  const root = project();
  await ironModelEndpoint('http://host.docker.internal:11434/v1', root).configure();
  expect(prepareLocalModel).toHaveBeenCalledWith('host.docker.internal:11434', root);
  expect(run).not.toHaveBeenCalled();
});
it('only allows the host for an https endpoint', async () => {
  const root = project();
  await ironModelEndpoint('https://models.example.test/v1', root).configure();
  expect(run).toHaveBeenCalledWith(['--allow-host', 'models.example.test'], root);
  expect(prepareLocalModel).not.toHaveBeenCalled();
});
it('names port 80 instead of asking to write out a port', () => {
  expect(() => ironModelEndpoint('http://host.docker.internal:80/v1', project())).toThrow('Port 80 is not supported');
});
it.each([
  'http://host.docker.internal:11434/api',
  'http://host.docker.internal:11434/',
  'http://host.docker.internal:11434/v1beta',
  'http://host.docker.internal:11434/v1/openai',
  'http://host.docker.internal:11434/v1//tenant',
])('refuses a local model path the front would block: %s', (url) => {
  expect(() => ironModelEndpoint(url, project())).toThrow('the path /v1');
});

it.each([ok({ object: 'list', data: [{ id: 'llama3', object: 'model' }] }), ok({ data: [] })])(
  'accepts a direct OpenAI-style model list',
  (response) => {
    expect(() => checkModelList(response, 11434)).not.toThrow();
  },
);
it.each([
  '',
  'HTTP/1.0 302 Found\r\nLocation: http://host.docker.internal:10257/\r\n\r\n',
  'HTTP/1.0 200 OK\r\n\r\n<html>Iron Control</html>',
  ok({}),
  ok({ data: [{ name: 'x' }] }),
  'HTTP/1.1 404 Not Found\r\n\r\n{"data":[]}',
])('refuses a redirect or anything but a model list: %j', (response) => {
  expect(() => checkModelList(response, 10257)).toThrow('did not answer GET /v1/models');
});
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall