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/install-command.test.ts

View on GitHub
import { describe, expect, it } from 'vitest';
import { installCommand, InstallCommandFailure, installStep } from './install-command.js';

const node = (source: string) => [process.execPath, ['-e', source]] as const;

describe('Iron installer progress and process bounds', () => {
  it('reports progress before a slow command completes and never prints its output', async () => {
    const lines: string[] = [];
    let finished = false;
    const [command, args] = node(
      'console.log("token=must-not-leak"); console.error("password=must-not-leak"); setTimeout(() => {}, 180)',
    );
    const pending = installCommand(command, [...args], {
      label: 'Download pinned source',
      timeoutMs: 2000,
      heartbeatMs: 20,
      report: (line) => {
        lines.push(line);
      },
    }).then(() => {
      finished = true;
    });
    await new Promise((resolve) => setTimeout(resolve, 70));
    expect(finished).toBe(false);
    expect(lines.some((line) => line.includes('still running'))).toBe(true);
    await pending;
    expect(lines.at(-1)).toContain('done');
    expect(lines.join('\n')).not.toContain('must-not-leak');
  });

  it('closes stdin and disables interactive Git credential prompts', async () => {
    const [command, args] = node(`process.stdin.resume(); process.stdin.on('end', () => {
      if (process.env.GIT_TERMINAL_PROMPT !== '0' || process.env.GCM_INTERACTIVE !== 'Never' || process.env.GIT_ASKPASS !== '/usr/bin/false') process.exit(2);
      console.log('noninteractive');
    });`);
    expect(
      await installCommand(command, [...args], {
        label: 'Git fetch',
        timeoutMs: 2000,
        capture: true,
        report: () => {},
      }),
    ).toBe('noninteractive');
  });

  it('fails a denied fetch without exposing credential-bearing stderr', async () => {
    const lines: string[] = [];
    const [command, args] = node(
      'console.error("https://secret-token@github.com/private/repo password=secret"); process.exit(128)',
    );
    await expect(
      installCommand(command, [...args], {
        label: 'Fetch pinned source',
        timeoutMs: 2000,
        failureHint: 'Verify source access from this machine.',
        report: (line) => lines.push(line),
      }),
    ).rejects.toThrow('Verify source access from this machine');
    expect(lines.join('\n')).not.toContain('secret');
    expect(lines.join('\n')).toContain('exit 128');
  });

  it('kills an unresponsive child and rejects at the deadline instead of leaving a timer running', async () => {
    const [command, args] = node('process.on("SIGTERM", () => {}); setInterval(() => {}, 1000)');
    const started = Date.now();
    await expect(
      installCommand(command, [...args], {
        label: 'Build image',
        timeoutMs: 100,
        killGraceMs: 40,
        heartbeatMs: 20,
        report: () => {},
      }),
    ).rejects.toThrow('timed out');
    expect(Date.now() - started).toBeLessThan(2000);
  });

  it('also kills a descendant that keeps inherited output pipes open', async () => {
    const [command, args] = node(`require('node:child_process').spawn(process.execPath,
      ['-e', 'process.on("SIGTERM", () => {}); setInterval(() => {}, 1000)'], {stdio: 'inherit'});
      setInterval(() => {}, 1000);`);
    const start = Date.now();
    await expect(
      installCommand(command, [...args], {
        label: 'Fetch with helper',
        timeoutMs: 150,
        killGraceMs: 40,
        report: () => {},
      }),
    ).rejects.toThrow('timed out');
    expect(Date.now() - start).toBeLessThan(2000);
  });

  it('reports an expected miss without the failure wording, still rejecting', async () => {
    const lines: string[] = [];
    await expect(
      installCommand(process.execPath, ['-e', 'process.exit(1)'], {
        label: 'Check cached image',
        timeoutMs: 5000,
        absentHint: 'not cached; building it',
        report: (line) => lines.push(line),
      }),
    ).rejects.toBeInstanceOf(InstallCommandFailure);
    expect(lines).toContain('Check cached image: not cached; building it');
    expect(lines.join('\n')).not.toContain('failed (exit');
    expect(lines.join('\n')).not.toContain('Check the service');
  });

  it('emits the skill streaming terminal status for success and failure', async () => {
    const lines: string[] = [];
    expect(
      await installStep(
        async () => {},
        (line) => lines.push(line),
      ),
    ).toBe(true);
    expect(lines.join('\n')).toContain('STATUS: success');
    lines.length = 0;
    expect(
      await installStep(
        async () => {
          throw new Error('Source access unavailable');
        },
        (line) => lines.push(line),
      ),
    ).toBe(false);
    expect(lines.join('\n')).toContain('STATUS: failed');
    expect(lines.join('\n')).toContain('ERROR: Source access unavailable');
    expect(lines.join('\n')).not.toContain('STATUS: success');
  });

  it('flattens a multi-line failure into the one-line ERROR field', async () => {
    const lines: string[] = [];
    await installStep(
      async () => {
        throw new Error('first line\n  second line');
      },
      (line) => lines.push(line),
    );
    expect(lines.join('\n')).toContain('ERROR: first line second line');
  });
});
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