@h-rig/provider-plugin 0.0.6-alpha.157 → 0.0.6-alpha.158
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.
- package/dist/bin/rig-agent-dispatch.d.ts +2 -0
- package/dist/bin/rig-agent-dispatch.js +863 -0
- package/dist/src/agent-harness/agent-mode.d.ts +1 -0
- package/dist/src/agent-harness/agent-mode.js +48 -0
- package/dist/src/agent-harness/agent-wrapper.d.ts +53 -0
- package/dist/src/agent-harness/agent-wrapper.js +916 -0
- package/dist/src/agent-harness/controlled-bash.d.ts +3 -0
- package/dist/src/agent-harness/controlled-bash.js +45 -0
- package/dist/src/agent-harness/git-ops.d.ts +2 -0
- package/dist/src/agent-harness/git-ops.js +27 -0
- package/dist/src/agent-harness/repo-ops.d.ts +8 -0
- package/dist/src/agent-harness/repo-ops.js +471 -0
- package/dist/src/agent-harness/rig-agent-entrypoint.d.ts +1 -0
- package/dist/src/agent-harness/rig-agent-entrypoint.js +1277 -0
- package/dist/src/agent-harness/rig-agent.d.ts +2 -0
- package/dist/src/agent-harness/rig-agent.js +1244 -0
- package/dist/src/agent-harness/runtime-snapshot-config.d.ts +2 -0
- package/dist/src/agent-harness/runtime-snapshot-config.js +25 -0
- package/dist/src/agent-harness/task-data.d.ts +2 -0
- package/dist/src/agent-harness/task-data.js +12 -0
- package/dist/src/agent-harness/task-ops.d.ts +10 -0
- package/dist/src/agent-harness/task-ops.js +53 -0
- package/dist/src/index.js +3366 -16
- package/dist/src/pi-settings-materializer.d.ts +10 -0
- package/dist/src/pi-settings-materializer.js +52 -0
- package/dist/src/plugin.d.ts +9 -2
- package/dist/src/plugin.js +3360 -8
- package/dist/src/service.d.ts +1 -1
- package/dist/src/session-asset-materializer-service.d.ts +13 -0
- package/dist/src/session-asset-materializer-service.js +124 -0
- package/dist/src/skill-materializer.d.ts +25 -0
- package/dist/src/skill-materializer.js +46 -0
- package/dist/src/tooling/binary-build-worker.d.ts +1 -0
- package/dist/src/tooling/binary-build-worker.js +323 -0
- package/dist/src/tooling/browser-tool-entrypoint.d.ts +2 -0
- package/dist/src/tooling/browser-tool-entrypoint.js +125 -0
- package/dist/src/tooling/browser-tools.d.ts +3 -0
- package/dist/src/tooling/browser-tools.js +27 -0
- package/dist/src/tooling/claude-router-binary.d.ts +3 -0
- package/dist/src/tooling/claude-router-binary.js +381 -0
- package/dist/src/tooling/claude-router.d.ts +22 -0
- package/dist/src/tooling/claude-router.js +524 -0
- package/dist/src/tooling/embedded-native-assets.d.ts +7 -0
- package/dist/src/tooling/embedded-native-assets.js +6 -0
- package/dist/src/tooling/file-tools.d.ts +5 -0
- package/dist/src/tooling/file-tools.js +224 -0
- package/dist/src/tooling/gateway.d.ts +4 -0
- package/dist/src/tooling/gateway.js +430 -0
- package/dist/src/tooling/native-extract.d.ts +2 -0
- package/dist/src/tooling/native-extract.js +44 -0
- package/dist/src/tooling/runtime-binary-build.d.ts +88 -0
- package/dist/src/tooling/runtime-binary-build.js +480 -0
- package/dist/src/tooling/shell-tools.d.ts +5 -0
- package/dist/src/tooling/shell-tools.js +217 -0
- package/native/darwin-arm64/rig-shell +0 -0
- package/native/darwin-arm64/rig-shell.build-manifest.json +4 -0
- package/native/darwin-arm64/rig-tools +0 -0
- package/native/darwin-arm64/rig-tools.build-manifest.json +4 -0
- package/native/darwin-x64/rig-shell +0 -0
- package/native/darwin-x64/rig-tools +0 -0
- package/native/linux-arm64/rig-shell +0 -0
- package/native/linux-arm64/rig-tools +0 -0
- package/native/linux-x64/rig-shell +0 -0
- package/native/linux-x64/rig-tools +0 -0
- package/native/win32-x64/rig-shell.exe +0 -0
- package/native/win32-x64/rig-tools.exe +0 -0
- package/package.json +54 -5
- package/dist/src/claude-stream-records.d.ts +0 -24
- package/dist/src/claude-stream-records.js +0 -158
- package/dist/src/codex-app-server.d.ts +0 -16
- package/dist/src/codex-app-server.js +0 -548
- package/dist/src/codex-exec-records.d.ts +0 -27
- package/dist/src/codex-exec-records.js +0 -203
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function looksLikeShellInvocation(args: string[], mode?: string | undefined): boolean;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/provider-plugin/src/agent-harness/agent-mode.ts
|
|
3
|
+
function looksLikeShellInvocation(args, mode = process.env.RIG_AGENT_MODE) {
|
|
4
|
+
if (mode === "shell") {
|
|
5
|
+
return true;
|
|
6
|
+
}
|
|
7
|
+
if (mode === "agent") {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
if (args.length === 0) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
const first = args[0];
|
|
14
|
+
if (!first) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
const bashLikeFlags = new Set([
|
|
18
|
+
"-c",
|
|
19
|
+
"-lc",
|
|
20
|
+
"-l",
|
|
21
|
+
"-i",
|
|
22
|
+
"-s",
|
|
23
|
+
"--login",
|
|
24
|
+
"--noprofile",
|
|
25
|
+
"--norc",
|
|
26
|
+
"--posix",
|
|
27
|
+
"--rcfile",
|
|
28
|
+
"--init-file",
|
|
29
|
+
"--restricted",
|
|
30
|
+
"--debug",
|
|
31
|
+
"--debugger",
|
|
32
|
+
"--verbose",
|
|
33
|
+
"--wordexp",
|
|
34
|
+
"--dump-strings",
|
|
35
|
+
"--dump-po-strings",
|
|
36
|
+
"--help"
|
|
37
|
+
]);
|
|
38
|
+
if (bashLikeFlags.has(first)) {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
if (!first.startsWith("-")) {
|
|
42
|
+
return first.endsWith(".sh");
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
looksLikeShellInvocation
|
|
48
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
import { type AgentRuntime, type RuntimeSnapshotSidecar } from "@rig/contracts";
|
|
3
|
+
type AgentWrapperOptions = {
|
|
4
|
+
projectRoot?: string;
|
|
5
|
+
argv?: string[];
|
|
6
|
+
};
|
|
7
|
+
type RuntimeProvider = "pi";
|
|
8
|
+
type LineSink = Pick<typeof process.stdout, "write">;
|
|
9
|
+
type PiRpcProviderRunInput = {
|
|
10
|
+
readonly command: string[];
|
|
11
|
+
readonly cwd: string;
|
|
12
|
+
readonly env: Record<string, string>;
|
|
13
|
+
readonly prompt: string;
|
|
14
|
+
readonly runId?: string;
|
|
15
|
+
readonly sessionName?: string;
|
|
16
|
+
readonly stdout?: LineSink;
|
|
17
|
+
readonly stderr?: LineSink;
|
|
18
|
+
};
|
|
19
|
+
export declare function finalizeRuntimeSnapshot(snapshotSidecar: Pick<RuntimeSnapshotSidecar, "finalize">, providerCommand: string[], exitCode: number, context: {
|
|
20
|
+
runtimeId: string;
|
|
21
|
+
taskId: string;
|
|
22
|
+
}): Promise<{
|
|
23
|
+
ok: true;
|
|
24
|
+
} | {
|
|
25
|
+
ok: false;
|
|
26
|
+
snapshotMissing: true;
|
|
27
|
+
error: string;
|
|
28
|
+
}>;
|
|
29
|
+
export declare function startOptionalRuntimeSnapshotSidecar(runtime: AgentRuntime, startSidecar: (runtime: AgentRuntime, options?: {
|
|
30
|
+
instanceId?: string;
|
|
31
|
+
}) => Promise<RuntimeSnapshotSidecar>): Promise<RuntimeSnapshotSidecar | null>;
|
|
32
|
+
export declare function runAgentWrapper(options?: AgentWrapperOptions): Promise<number>;
|
|
33
|
+
export declare function runPiRpcProviderFallback(input: PiRpcProviderRunInput): Promise<number>;
|
|
34
|
+
export declare const runPiRpcProvider: typeof runPiRpcProviderFallback;
|
|
35
|
+
export declare function resolveFinalProviderExitCode(input: {
|
|
36
|
+
providerExitCode: number;
|
|
37
|
+
taskClosed: boolean;
|
|
38
|
+
serverManagedRun: boolean;
|
|
39
|
+
}): number;
|
|
40
|
+
export declare function shouldBypassProviderSandboxOnPlatform(provider: RuntimeProvider, platform: NodeJS.Platform): boolean;
|
|
41
|
+
export declare function buildProviderArgs(_provider: RuntimeProvider, _runtime: Pick<AgentRuntime, "binDir" | "stateDir" | "contextFile">, argv: string[]): string[];
|
|
42
|
+
declare function runBeadsJson<T>(projectRoot: string, args: string[]): Promise<T | null>;
|
|
43
|
+
export declare function resolveProvider(): RuntimeProvider;
|
|
44
|
+
export declare function resolveTaskFromBeads(projectRoot: string, readBeadsJson?: typeof runBeadsJson): Promise<string>;
|
|
45
|
+
export declare function isTaskClosed(projectRoot: string, taskId: string, readBeadsJson?: typeof runBeadsJson): Promise<boolean>;
|
|
46
|
+
export declare function recordSnapshotMissingTaskSourceEvidence(projectRoot: string, taskId: string, runtime: Pick<AgentRuntime, "workspaceDir" | "logsDir" | "sessionDir">, snapshotFinalizeError: string): Promise<void>;
|
|
47
|
+
export declare function updateTaskSourceAfterRun(projectRoot: string, taskId: string, runtime: Pick<AgentRuntime, "workspaceDir" | "logsDir" | "sessionDir">): Promise<void>;
|
|
48
|
+
export declare function resolveRuntimeHandoffPath(hostProjectRoot: string, taskId: string, timestampMs?: number): string;
|
|
49
|
+
export declare function recordRuntimeHandoff(hostProjectRoot: string, runtime: Pick<AgentRuntime, "id" | "mode" | "workspaceDir" | "logsDir" | "sessionDir">, taskId: string, exitCode: number, options?: {
|
|
50
|
+
snapshotMissing?: boolean;
|
|
51
|
+
snapshotFinalizeError?: string | null;
|
|
52
|
+
}): void;
|
|
53
|
+
export {};
|