@h-rig/provider-plugin 0.0.6-alpha.157 → 0.0.6-alpha.159

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.
Files changed (73) hide show
  1. package/dist/bin/rig-agent-dispatch.d.ts +2 -0
  2. package/dist/bin/rig-agent-dispatch.js +863 -0
  3. package/dist/src/agent-harness/agent-mode.d.ts +1 -0
  4. package/dist/src/agent-harness/agent-mode.js +48 -0
  5. package/dist/src/agent-harness/agent-wrapper.d.ts +53 -0
  6. package/dist/src/agent-harness/agent-wrapper.js +916 -0
  7. package/dist/src/agent-harness/controlled-bash.d.ts +3 -0
  8. package/dist/src/agent-harness/controlled-bash.js +45 -0
  9. package/dist/src/agent-harness/git-ops.d.ts +2 -0
  10. package/dist/src/agent-harness/git-ops.js +27 -0
  11. package/dist/src/agent-harness/repo-ops.d.ts +8 -0
  12. package/dist/src/agent-harness/repo-ops.js +471 -0
  13. package/dist/src/agent-harness/rig-agent-entrypoint.d.ts +1 -0
  14. package/dist/src/agent-harness/rig-agent-entrypoint.js +1277 -0
  15. package/dist/src/agent-harness/rig-agent.d.ts +2 -0
  16. package/dist/src/agent-harness/rig-agent.js +1244 -0
  17. package/dist/src/agent-harness/runtime-snapshot-config.d.ts +2 -0
  18. package/dist/src/agent-harness/runtime-snapshot-config.js +25 -0
  19. package/dist/src/agent-harness/task-data.d.ts +2 -0
  20. package/dist/src/agent-harness/task-data.js +12 -0
  21. package/dist/src/agent-harness/task-ops.d.ts +10 -0
  22. package/dist/src/agent-harness/task-ops.js +53 -0
  23. package/dist/src/index.js +3366 -16
  24. package/dist/src/pi-settings-materializer.d.ts +10 -0
  25. package/dist/src/pi-settings-materializer.js +52 -0
  26. package/dist/src/plugin.d.ts +9 -2
  27. package/dist/src/plugin.js +3360 -8
  28. package/dist/src/service.d.ts +1 -1
  29. package/dist/src/session-asset-materializer-service.d.ts +13 -0
  30. package/dist/src/session-asset-materializer-service.js +124 -0
  31. package/dist/src/skill-materializer.d.ts +25 -0
  32. package/dist/src/skill-materializer.js +46 -0
  33. package/dist/src/tooling/binary-build-worker.d.ts +1 -0
  34. package/dist/src/tooling/binary-build-worker.js +323 -0
  35. package/dist/src/tooling/browser-tool-entrypoint.d.ts +2 -0
  36. package/dist/src/tooling/browser-tool-entrypoint.js +125 -0
  37. package/dist/src/tooling/browser-tools.d.ts +3 -0
  38. package/dist/src/tooling/browser-tools.js +27 -0
  39. package/dist/src/tooling/claude-router-binary.d.ts +3 -0
  40. package/dist/src/tooling/claude-router-binary.js +381 -0
  41. package/dist/src/tooling/claude-router.d.ts +22 -0
  42. package/dist/src/tooling/claude-router.js +524 -0
  43. package/dist/src/tooling/embedded-native-assets.d.ts +7 -0
  44. package/dist/src/tooling/embedded-native-assets.js +6 -0
  45. package/dist/src/tooling/file-tools.d.ts +5 -0
  46. package/dist/src/tooling/file-tools.js +224 -0
  47. package/dist/src/tooling/gateway.d.ts +4 -0
  48. package/dist/src/tooling/gateway.js +430 -0
  49. package/dist/src/tooling/native-extract.d.ts +2 -0
  50. package/dist/src/tooling/native-extract.js +44 -0
  51. package/dist/src/tooling/runtime-binary-build.d.ts +88 -0
  52. package/dist/src/tooling/runtime-binary-build.js +480 -0
  53. package/dist/src/tooling/shell-tools.d.ts +5 -0
  54. package/dist/src/tooling/shell-tools.js +217 -0
  55. package/native/darwin-arm64/rig-shell +0 -0
  56. package/native/darwin-arm64/rig-shell.build-manifest.json +4 -0
  57. package/native/darwin-arm64/rig-tools +0 -0
  58. package/native/darwin-arm64/rig-tools.build-manifest.json +4 -0
  59. package/native/darwin-x64/rig-shell +0 -0
  60. package/native/darwin-x64/rig-tools +0 -0
  61. package/native/linux-arm64/rig-shell +0 -0
  62. package/native/linux-arm64/rig-tools +0 -0
  63. package/native/linux-x64/rig-shell +0 -0
  64. package/native/linux-x64/rig-tools +0 -0
  65. package/native/win32-x64/rig-shell.exe +0 -0
  66. package/native/win32-x64/rig-tools.exe +0 -0
  67. package/package.json +54 -5
  68. package/dist/src/claude-stream-records.d.ts +0 -24
  69. package/dist/src/claude-stream-records.js +0 -158
  70. package/dist/src/codex-app-server.d.ts +0 -16
  71. package/dist/src/codex-app-server.js +0 -548
  72. package/dist/src/codex-exec-records.d.ts +0 -27
  73. package/dist/src/codex-exec-records.js +0 -203
@@ -0,0 +1,524 @@
1
+ #!/usr/bin/env bun
2
+ // @bun
3
+
4
+ // packages/provider-plugin/src/tooling/claude-router.ts
5
+ import { existsSync, mkdirSync, statSync, writeFileSync } from "fs";
6
+ import { resolve } from "path";
7
+ import { createInterface } from "readline";
8
+ var CLAUDE_ROUTER_SERVER_NAME = "rig_runtime_tools";
9
+ var CLAUDE_DISABLED_FILE_TOOLS = [
10
+ "Read",
11
+ "Edit",
12
+ "Write",
13
+ "NotebookEdit",
14
+ "Glob",
15
+ "Grep"
16
+ ];
17
+ var ROUTER_VERSION = "0.1.0";
18
+ var CLAUDE_ROUTER_TOOL_DEFINITIONS = [
19
+ {
20
+ name: "read",
21
+ description: "Read a UTF-8 file from the current Rig task worktree, the outer control-plane repo ($PROJECT_RIG_ROOT), or the host monorepo checkout ($MONOREPO_MAIN_ROOT).",
22
+ inputSchema: {
23
+ type: "object",
24
+ properties: {
25
+ path: { type: "string", description: "Absolute or workspace-relative file path." },
26
+ offset: { type: "integer", minimum: 0 },
27
+ limit: { type: "integer", minimum: 1, maximum: 2097152 }
28
+ },
29
+ required: ["path"],
30
+ additionalProperties: false
31
+ }
32
+ },
33
+ {
34
+ name: "write",
35
+ description: "Write UTF-8 content to a file inside the current Rig task workspace only.",
36
+ inputSchema: {
37
+ type: "object",
38
+ properties: {
39
+ path: { type: "string", description: "Absolute or workspace-relative file path." },
40
+ content: { type: "string" },
41
+ create_parents: { type: "boolean" }
42
+ },
43
+ required: ["path", "content"],
44
+ additionalProperties: false
45
+ }
46
+ },
47
+ {
48
+ name: "edit",
49
+ description: "Replace one or more exact string occurrences in a UTF-8 file inside the current Rig task workspace only.",
50
+ inputSchema: {
51
+ type: "object",
52
+ properties: {
53
+ path: { type: "string", description: "Absolute or workspace-relative file path." },
54
+ old_string: { type: "string" },
55
+ new_string: { type: "string" },
56
+ replace_all: { type: "boolean" }
57
+ },
58
+ required: ["path", "old_string", "new_string"],
59
+ additionalProperties: false
60
+ }
61
+ },
62
+ {
63
+ name: "glob",
64
+ description: "Search files using a glob pattern across the current task worktree, $PROJECT_RIG_ROOT, or $MONOREPO_MAIN_ROOT.",
65
+ inputSchema: {
66
+ type: "object",
67
+ properties: {
68
+ pattern: { type: "string" },
69
+ path: { type: "string", description: "Optional workspace-relative search root." },
70
+ include_hidden: { type: "boolean" },
71
+ max_results: { type: "integer", minimum: 1, maximum: 5000 }
72
+ },
73
+ required: ["pattern"],
74
+ additionalProperties: false
75
+ }
76
+ },
77
+ {
78
+ name: "grep",
79
+ description: "Search file contents across the current task worktree, $PROJECT_RIG_ROOT, or $MONOREPO_MAIN_ROOT.",
80
+ inputSchema: {
81
+ type: "object",
82
+ properties: {
83
+ pattern: { type: "string" },
84
+ path: { type: "string", description: "Optional workspace-relative search root." },
85
+ literal: { type: "boolean" },
86
+ include_hidden: { type: "boolean" },
87
+ max_results: { type: "integer", minimum: 1, maximum: 500 },
88
+ glob: { type: "string", description: "Optional file glob filter passed through to ripgrep." }
89
+ },
90
+ required: ["pattern"],
91
+ additionalProperties: false
92
+ }
93
+ }
94
+ ];
95
+ function claudeRuntimeToolCliArgs(configPath) {
96
+ return [
97
+ "--disallowedTools",
98
+ CLAUDE_DISABLED_FILE_TOOLS.join(","),
99
+ "--mcp-config",
100
+ configPath
101
+ ];
102
+ }
103
+ function buildRuntimeToolRouterServerConfig(options) {
104
+ return {
105
+ type: "stdio",
106
+ command: resolve(options.binDir, "rig-tool-router"),
107
+ args: [],
108
+ env: {
109
+ RIG_RUNTIME_CONTEXT_FILE: options.contextFile,
110
+ RIG_RUNTIME_BIN_DIR: options.binDir
111
+ }
112
+ };
113
+ }
114
+ function escapeTomlString(value) {
115
+ return value.replaceAll("\\", "\\\\").replaceAll('"', "\\\"");
116
+ }
117
+ function tomlString(value) {
118
+ return `"${escapeTomlString(value)}"`;
119
+ }
120
+ function tomlStringArray(values) {
121
+ return `[${values.map((value) => tomlString(value)).join(", ")}]`;
122
+ }
123
+ function tomlInlineTable(entries) {
124
+ return `{ ${Object.entries(entries).map(([key, value]) => `${key} = ${tomlString(value)}`).join(", ")} }`;
125
+ }
126
+ function codexRuntimeToolCliArgs(options) {
127
+ const serverConfig = buildRuntimeToolRouterServerConfig(options);
128
+ return [
129
+ "-a",
130
+ "never",
131
+ "-c",
132
+ `mcp_servers.${CLAUDE_ROUTER_SERVER_NAME}.command=${tomlString(serverConfig.command)}`,
133
+ "-c",
134
+ `mcp_servers.${CLAUDE_ROUTER_SERVER_NAME}.args=${tomlStringArray(serverConfig.args)}`,
135
+ "-c",
136
+ `mcp_servers.${CLAUDE_ROUTER_SERVER_NAME}.env=${tomlInlineTable(serverConfig.env)}`
137
+ ];
138
+ }
139
+ function writeClaudeRuntimeToolRouterConfig(options) {
140
+ const configPath = resolve(options.stateDir, "claude-runtime-tools.mcp.json");
141
+ mkdirSync(options.stateDir, { recursive: true });
142
+ const payload = {
143
+ mcpServers: {
144
+ [CLAUDE_ROUTER_SERVER_NAME]: buildRuntimeToolRouterServerConfig(options)
145
+ }
146
+ };
147
+ writeFileSync(configPath, `${JSON.stringify(payload, null, 2)}
148
+ `, "utf-8");
149
+ return configPath;
150
+ }
151
+ async function runClaudeToolRouterServer() {
152
+ const lineReader = createInterface({
153
+ input: process.stdin,
154
+ crlfDelay: Infinity
155
+ });
156
+ const inFlightToolCalls = new Set;
157
+ const trackToolCall = (call) => {
158
+ inFlightToolCalls.add(call);
159
+ call.finally(() => inFlightToolCalls.delete(call)).catch((err) => {
160
+ console.warn("[claude-router] in-flight tool call failure:", err);
161
+ });
162
+ };
163
+ for await (const line of lineReader) {
164
+ const trimmed = line.trim();
165
+ if (!trimmed) {
166
+ continue;
167
+ }
168
+ let request;
169
+ try {
170
+ request = JSON.parse(trimmed);
171
+ } catch {
172
+ continue;
173
+ }
174
+ if (!request.method) {
175
+ continue;
176
+ }
177
+ if (request.method === "notifications/initialized") {
178
+ continue;
179
+ }
180
+ if (request.method === "initialize") {
181
+ writeMessage({
182
+ jsonrpc: "2.0",
183
+ id: request.id ?? null,
184
+ result: {
185
+ protocolVersion: "2024-11-05",
186
+ capabilities: {
187
+ tools: {}
188
+ },
189
+ serverInfo: {
190
+ name: CLAUDE_ROUTER_SERVER_NAME,
191
+ version: ROUTER_VERSION
192
+ }
193
+ }
194
+ });
195
+ continue;
196
+ }
197
+ if (request.method === "ping") {
198
+ writeMessage({
199
+ jsonrpc: "2.0",
200
+ id: request.id ?? null,
201
+ result: {}
202
+ });
203
+ continue;
204
+ }
205
+ if (request.method === "tools/list") {
206
+ writeMessage({
207
+ jsonrpc: "2.0",
208
+ id: request.id ?? null,
209
+ result: {
210
+ tools: CLAUDE_ROUTER_TOOL_DEFINITIONS
211
+ }
212
+ });
213
+ continue;
214
+ }
215
+ if (request.method === "tools/call") {
216
+ const toolName = typeof request.params?.name === "string" ? request.params.name : "";
217
+ const args = isRecord(request.params?.arguments) ? request.params.arguments : {};
218
+ const requestId = request.id ?? null;
219
+ const toolCall = (async () => {
220
+ try {
221
+ const result = await invokeRuntimeTool(toolName, args);
222
+ writeMessage({
223
+ jsonrpc: "2.0",
224
+ id: requestId,
225
+ result
226
+ });
227
+ } catch (error) {
228
+ writeMessage({
229
+ jsonrpc: "2.0",
230
+ id: requestId,
231
+ error: {
232
+ code: -32603,
233
+ message: error instanceof Error ? error.message : String(error)
234
+ }
235
+ });
236
+ }
237
+ })();
238
+ trackToolCall(toolCall);
239
+ continue;
240
+ }
241
+ writeMessage({
242
+ jsonrpc: "2.0",
243
+ id: request.id ?? null,
244
+ error: {
245
+ code: -32601,
246
+ message: `Unsupported method: ${request.method}`
247
+ }
248
+ });
249
+ }
250
+ if (inFlightToolCalls.size > 0) {
251
+ await Promise.allSettled(Array.from(inFlightToolCalls));
252
+ }
253
+ }
254
+ async function invokeRuntimeTool(toolName, args, options = {}) {
255
+ if (toolName === "shell") {
256
+ return invokeRuntimeShellTool(args, options);
257
+ }
258
+ const invocationEnv = options.env ?? process.env;
259
+ const binaryPath = resolveRuntimeToolBinary(toolName, invocationEnv);
260
+ if (!binaryPath) {
261
+ return {
262
+ content: [
263
+ {
264
+ type: "text",
265
+ text: `Unknown Rig runtime tool: ${toolName}`
266
+ }
267
+ ],
268
+ isError: true
269
+ };
270
+ }
271
+ const proc = Bun.spawn([binaryPath], {
272
+ stdin: "pipe",
273
+ stdout: "pipe",
274
+ stderr: "pipe",
275
+ env: invocationEnv
276
+ });
277
+ const requestBody = `${JSON.stringify(args)}
278
+ `;
279
+ if (proc.stdin) {
280
+ await proc.stdin.write(requestBody);
281
+ await proc.stdin.end();
282
+ }
283
+ const [exitCode, stdout, stderr] = await Promise.all([
284
+ proc.exited,
285
+ readBunProcessPipe(proc.stdout),
286
+ readBunProcessPipe(proc.stderr)
287
+ ]);
288
+ if (exitCode !== 0) {
289
+ const text = [stdout.trim(), stderr.trim()].filter(Boolean).join(`
290
+ `) || `Tool ${toolName} exited with code ${exitCode}`;
291
+ return {
292
+ content: [{ type: "text", text }],
293
+ isError: true
294
+ };
295
+ }
296
+ let payload;
297
+ try {
298
+ payload = JSON.parse(stdout);
299
+ } catch {
300
+ return {
301
+ content: [{ type: "text", text: stdout.trim() || `(empty output from ${toolName})` }],
302
+ isError: false
303
+ };
304
+ }
305
+ if (payload.ok === false) {
306
+ return {
307
+ content: [{ type: "text", text: String(payload.message ?? `Tool ${toolName} failed`) }],
308
+ structuredContent: payload,
309
+ isError: true
310
+ };
311
+ }
312
+ return {
313
+ content: [{ type: "text", text: renderToolText(toolName, payload) }],
314
+ structuredContent: payload,
315
+ isError: false
316
+ };
317
+ }
318
+ async function readBunProcessPipe(pipe) {
319
+ if (typeof pipe === "number" || !pipe) {
320
+ return "";
321
+ }
322
+ return new Response(pipe).text();
323
+ }
324
+ function resolveRuntimeToolBinary(toolName, env) {
325
+ const binDir = env.RIG_RUNTIME_BIN_DIR?.trim() || "";
326
+ if (!binDir) {
327
+ return "";
328
+ }
329
+ const mapping = {
330
+ read: "rig-read",
331
+ write: "rig-write",
332
+ edit: "rig-edit",
333
+ glob: "rig-glob",
334
+ grep: "rig-grep"
335
+ };
336
+ const executable = mapping[toolName];
337
+ return executable ? resolve(binDir, executable) : "";
338
+ }
339
+ function renderToolText(toolName, payload) {
340
+ if (toolName === "shell") {
341
+ const command = typeof payload.command === "string" ? payload.command : "(unknown command)";
342
+ const stdout = typeof payload.stdout === "string" ? payload.stdout.trim() : "";
343
+ const stderr = typeof payload.stderr === "string" ? payload.stderr.trim() : "";
344
+ const exitCode = typeof payload.exit_code === "number" ? payload.exit_code : null;
345
+ const output = [stdout, stderr].filter(Boolean).join(`
346
+ `);
347
+ const summary = exitCode === null ? command : `${command}
348
+
349
+ exit_code=${String(exitCode)}`;
350
+ return output ? `${summary}
351
+
352
+ ${output}` : summary;
353
+ }
354
+ if (toolName === "read") {
355
+ const path = typeof payload.path === "string" ? payload.path : "(unknown path)";
356
+ const content = typeof payload.content === "string" ? payload.content : "";
357
+ const truncated = payload.truncated === true ? `
358
+
359
+ [truncated]` : "";
360
+ return `${path}
361
+
362
+ ${content}${truncated}`;
363
+ }
364
+ if (toolName === "glob") {
365
+ const matches = Array.isArray(payload.matches) ? payload.matches.filter((value) => typeof value === "string") : [];
366
+ return matches.length > 0 ? matches.join(`
367
+ `) : "(no matches)";
368
+ }
369
+ if (toolName === "grep") {
370
+ const matches = Array.isArray(payload.matches) ? payload.matches.filter(isRecord) : [];
371
+ if (matches.length === 0) {
372
+ return "(no matches)";
373
+ }
374
+ return matches.map((match) => `${String(match.path ?? "(unknown)")}:${String(match.line_number ?? "?")}: ${String(match.line ?? "")}`).join(`
375
+ `);
376
+ }
377
+ if (toolName === "write") {
378
+ return `Wrote ${String(payload.bytes_written ?? 0)} bytes to ${String(payload.path ?? "(unknown path)")}.`;
379
+ }
380
+ if (toolName === "edit") {
381
+ return `Edited ${String(payload.path ?? "(unknown path)")}; replacements: ${String(payload.replacements ?? 0)}.`;
382
+ }
383
+ return JSON.stringify(payload, null, 2);
384
+ }
385
+ async function invokeRuntimeShellTool(args, options = {}) {
386
+ const command = typeof args.command === "string" ? args.command.trim() : "";
387
+ if (!command) {
388
+ return {
389
+ content: [{ type: "text", text: "Missing required shell `command` string." }],
390
+ isError: true
391
+ };
392
+ }
393
+ const invocationEnv = options.env ?? process.env;
394
+ const shellName = args.shell === "sh" ? "sh" : args.shell === "zsh" ? "zsh" : "bash";
395
+ const shellBinary = resolveRuntimeShellBinary(shellName, invocationEnv);
396
+ if (!shellBinary) {
397
+ return {
398
+ content: [{ type: "text", text: `Missing Rig runtime shell binary for ${shellName}.` }],
399
+ isError: true
400
+ };
401
+ }
402
+ const workspaceRoot = resolve(invocationEnv.RIG_TASK_WORKSPACE?.trim() || process.cwd());
403
+ const requestedWorkdir = typeof args.workdir === "string" ? args.workdir.trim() : "";
404
+ const workdir = requestedWorkdir ? resolveWithinWorkspace(workspaceRoot, requestedWorkdir) : workspaceRoot;
405
+ if (!existsSync(workdir)) {
406
+ return {
407
+ content: [{
408
+ type: "text",
409
+ text: `Shell workdir does not exist inside the task workspace: ${requestedWorkdir || "."}`
410
+ }],
411
+ isError: true
412
+ };
413
+ }
414
+ try {
415
+ if (!statSync(workdir).isDirectory()) {
416
+ return {
417
+ content: [{
418
+ type: "text",
419
+ text: `Shell workdir is not a directory inside the task workspace: ${requestedWorkdir || "."}`
420
+ }],
421
+ isError: true
422
+ };
423
+ }
424
+ } catch (error) {
425
+ return {
426
+ content: [{
427
+ type: "text",
428
+ text: error instanceof Error ? error.message : String(error)
429
+ }],
430
+ isError: true
431
+ };
432
+ }
433
+ let proc = null;
434
+ try {
435
+ proc = Bun.spawn([shellBinary, shellName === "bash" ? "-lc" : "-c", command], {
436
+ cwd: workdir,
437
+ env: invocationEnv,
438
+ stdout: "pipe",
439
+ stderr: "pipe"
440
+ });
441
+ } catch (error) {
442
+ return {
443
+ content: [{
444
+ type: "text",
445
+ text: error instanceof Error ? error.message : String(error)
446
+ }],
447
+ isError: true
448
+ };
449
+ }
450
+ const [exitCode, stdout, stderr] = await Promise.all([
451
+ proc.exited,
452
+ readBunProcessPipe(proc.stdout),
453
+ readBunProcessPipe(proc.stderr)
454
+ ]);
455
+ const payload = {
456
+ ok: exitCode === 0,
457
+ shell: shellName,
458
+ cwd: workdir,
459
+ command,
460
+ stdout,
461
+ stderr,
462
+ exit_code: exitCode
463
+ };
464
+ return {
465
+ content: [{ type: "text", text: renderToolText("shell", payload) }],
466
+ structuredContent: payload,
467
+ isError: exitCode !== 0
468
+ };
469
+ }
470
+ function resolveRuntimeShellBinary(shellName, env) {
471
+ const binDir = env.RIG_RUNTIME_BIN_DIR?.trim() || "";
472
+ return binDir ? resolve(binDir, shellName) : "";
473
+ }
474
+ function resolveWithinWorkspace(workspaceRoot, target) {
475
+ const resolvedTarget = resolve(workspaceRoot, normalizeWorkspaceRelativeTarget(target));
476
+ const normalizedWorkspace = workspaceRoot.endsWith("/") ? workspaceRoot : `${workspaceRoot}/`;
477
+ const normalizedTarget = resolvedTarget.endsWith("/") ? resolvedTarget : `${resolvedTarget}/`;
478
+ if (resolvedTarget === workspaceRoot || normalizedTarget.startsWith(normalizedWorkspace)) {
479
+ return resolvedTarget;
480
+ }
481
+ throw new Error(`Shell workdir must stay inside the task workspace: ${target}`);
482
+ }
483
+ function normalizeWorkspaceRelativeTarget(target) {
484
+ const trimmed = target.trim();
485
+ if (!trimmed) {
486
+ return ".";
487
+ }
488
+ if (trimmed === "$MONOREPO_ROOT" || trimmed === "$RIG_TASK_WORKSPACE") {
489
+ return ".";
490
+ }
491
+ if (trimmed.startsWith("$MONOREPO_ROOT/")) {
492
+ return trimmed.slice("$MONOREPO_ROOT/".length);
493
+ }
494
+ if (trimmed.startsWith("$RIG_TASK_WORKSPACE/")) {
495
+ return trimmed.slice("$RIG_TASK_WORKSPACE/".length);
496
+ }
497
+ if (trimmed === "repos/spliter-monorepo") {
498
+ return ".";
499
+ }
500
+ if (trimmed.startsWith("repos/spliter-monorepo/")) {
501
+ return trimmed.slice("repos/spliter-monorepo/".length);
502
+ }
503
+ return trimmed;
504
+ }
505
+ function isRecord(value) {
506
+ return typeof value === "object" && value !== null && !Array.isArray(value);
507
+ }
508
+ function writeMessage(payload) {
509
+ process.stdout.write(`${JSON.stringify(payload)}
510
+ `);
511
+ }
512
+ if (import.meta.main) {
513
+ await runClaudeToolRouterServer();
514
+ }
515
+ export {
516
+ writeClaudeRuntimeToolRouterConfig,
517
+ runClaudeToolRouterServer,
518
+ invokeRuntimeTool,
519
+ codexRuntimeToolCliArgs,
520
+ claudeRuntimeToolCliArgs,
521
+ CLAUDE_ROUTER_TOOL_DEFINITIONS,
522
+ CLAUDE_ROUTER_SERVER_NAME,
523
+ CLAUDE_DISABLED_FILE_TOOLS
524
+ };
@@ -0,0 +1,7 @@
1
+ export type EmbeddedNative = {
2
+ name: string;
3
+ fileName: string;
4
+ filePath: string;
5
+ size: number;
6
+ };
7
+ export declare const embeddedNatives: Record<string, EmbeddedNative> | null;
@@ -0,0 +1,6 @@
1
+ // @bun
2
+ // packages/provider-plugin/src/tooling/embedded-native-assets.ts
3
+ var embeddedNatives = null;
4
+ export {
5
+ embeddedNatives
6
+ };
@@ -0,0 +1,5 @@
1
+ export declare function runtimeRigToolsFileName(): string;
2
+ export declare function runtimeFileToolNames(): string[];
3
+ export declare function ensureRigToolsBinaryPath(outputPath?: string): Promise<string>;
4
+ export declare function materializeRuntimeFileTools(targetDir: string): Promise<string>;
5
+ export declare function runtimeFileToolBasename(path: string): string;