@velum-labs/routekit-tool-claude 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,96 @@
1
+ import assert from "node:assert/strict";
2
+ import { test } from "node:test";
3
+ import { claudeAgentsJson, claudeEnv, claudeLaunchArgs } from "../launch.js";
4
+ const PROFILES = [
5
+ {
6
+ id: "reviewer",
7
+ model: "opaque-model",
8
+ description: "Review changes.",
9
+ instructions: "Return findings."
10
+ }
11
+ ];
12
+ function context(args, profiles = PROFILES, defaultModel = "opaque-model") {
13
+ return {
14
+ spec: {
15
+ gatewayUrl: "http://127.0.0.1",
16
+ defaultModel,
17
+ models: [{ id: defaultModel }],
18
+ agentProfiles: profiles,
19
+ args
20
+ },
21
+ log: () => undefined,
22
+ prepareForPassthrough: () => undefined,
23
+ registerPort: (_name, port) => `http://127.0.0.1:${port}`,
24
+ unregisterPort: () => undefined,
25
+ registerDisposer: () => undefined
26
+ };
27
+ }
28
+ test("claudeAgentsJson serializes generic profiles", () => {
29
+ assert.deepEqual(JSON.parse(claudeAgentsJson(PROFILES)), {
30
+ reviewer: {
31
+ description: "Review changes.",
32
+ prompt: "Return findings.",
33
+ model: "claude-opaque-model"
34
+ }
35
+ });
36
+ });
37
+ test("Claude launcher projects claude-code models to native picker ids", () => {
38
+ assert.deepEqual(claudeLaunchArgs(context([], [], "claude-code/claude-sonnet-4-6")), ["--model", "claude-sonnet-4-6"]);
39
+ assert.deepEqual(JSON.parse(claudeAgentsJson([
40
+ {
41
+ id: "native",
42
+ model: "claude-code/claude-opus-4-8",
43
+ description: "Use the subscription pool.",
44
+ instructions: "Review."
45
+ },
46
+ {
47
+ id: "cross",
48
+ model: "codex/gpt-5.5",
49
+ description: "Use Codex.",
50
+ instructions: "Review."
51
+ }
52
+ ])), {
53
+ native: {
54
+ description: "Use the subscription pool.",
55
+ prompt: "Review.",
56
+ model: "claude-opus-4-8"
57
+ },
58
+ cross: {
59
+ description: "Use Codex.",
60
+ prompt: "Review.",
61
+ model: "claude-codex/gpt-5.5"
62
+ }
63
+ });
64
+ });
65
+ test("Claude launcher forwards an explicit isolated config directory", () => {
66
+ const previous = process.env.CLAUDE_CONFIG_DIR;
67
+ process.env.CLAUDE_CONFIG_DIR = "/tmp/routekit-claude-config";
68
+ try {
69
+ assert.equal(claudeEnv("http://127.0.0.1:8080").CLAUDE_CONFIG_DIR, "/tmp/routekit-claude-config");
70
+ }
71
+ finally {
72
+ if (previous === undefined)
73
+ delete process.env.CLAUDE_CONFIG_DIR;
74
+ else
75
+ process.env.CLAUDE_CONFIG_DIR = previous;
76
+ }
77
+ });
78
+ test("claudeLaunchArgs adds profiles unless the user supplied agents", () => {
79
+ const args = claudeLaunchArgs(context(["--verbose"]));
80
+ assert.deepEqual(args.slice(0, 4), [
81
+ "--model",
82
+ "claude-opaque-model",
83
+ "--verbose",
84
+ "--agents"
85
+ ]);
86
+ assert.deepEqual(claudeLaunchArgs(context(["--agents={}"])), [
87
+ "--model",
88
+ "claude-opaque-model",
89
+ "--agents={}"
90
+ ]);
91
+ assert.deepEqual(claudeLaunchArgs(context([], [])), [
92
+ "--model",
93
+ "claude-opaque-model"
94
+ ]);
95
+ assert.deepEqual(claudeLaunchArgs(context(["--model", "claude-user-selected"], [])), ["--model", "claude-user-selected"]);
96
+ });
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@velum-labs/routekit-tool-claude",
3
+ "private": false,
4
+ "version": "0.9.0",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/velum-labs/handoffkit.git",
8
+ "directory": "packages/tool-claude"
9
+ },
10
+ "description": "Product-neutral Claude Code launcher, serializer, and canonical harness driver.",
11
+ "license": "Apache-2.0",
12
+ "type": "module",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.js"
17
+ }
18
+ },
19
+ "files": [
20
+ "dist",
21
+ "LICENSE"
22
+ ],
23
+ "publishConfig": {
24
+ "registry": "https://registry.npmjs.org",
25
+ "access": "public",
26
+ "provenance": true
27
+ },
28
+ "dependencies": {
29
+ "@anthropic-ai/claude-agent-sdk": "0.3.198",
30
+ "zod": "4.4.3",
31
+ "@velum-labs/routekit-registry": "0.9.0",
32
+ "@velum-labs/routekit-runtime": "0.9.0",
33
+ "@velum-labs/routekit-tools": "0.9.0",
34
+ "@velum-labs/routekit-harness-core": "0.9.0"
35
+ },
36
+ "keywords": [
37
+ "llm",
38
+ "coding-agent",
39
+ "claude-code",
40
+ "harness",
41
+ "adapter"
42
+ ],
43
+ "scripts": {
44
+ "build": "tsc -b",
45
+ "clean": "tsc -b --clean",
46
+ "test": "node --test \"dist/test/*.test.js\""
47
+ }
48
+ }