@h-rig/harness-plugin 0.0.6-alpha.186
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/README.md +1 -0
- package/dist/bin/rig-agent-dispatch.d.ts +2 -0
- package/dist/bin/rig-agent-dispatch.js +826 -0
- package/dist/src/agent-command.d.ts +3 -0
- package/dist/src/agent-command.js +233 -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 +60 -0
- package/dist/src/agent-harness/agent-wrapper.js +842 -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 +14 -0
- package/dist/src/agent-harness/repo-ops.js +37 -0
- package/dist/src/agent-harness/rig-agent-entrypoint.d.ts +1 -0
- package/dist/src/agent-harness/rig-agent-entrypoint.js +1362 -0
- package/dist/src/agent-harness/rig-agent.d.ts +2 -0
- package/dist/src/agent-harness/rig-agent.js +1324 -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 +27 -0
- package/dist/src/agent-harness/task-data.js +286 -0
- package/dist/src/agent-harness/task-ops.d.ts +10 -0
- package/dist/src/agent-harness/task-ops.js +352 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.js +4525 -0
- package/dist/src/model.d.ts +80 -0
- package/dist/src/model.js +64 -0
- package/dist/src/pi-command.d.ts +3 -0
- package/dist/src/pi-command.js +154 -0
- 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 +24 -0
- package/dist/src/plugin.js +4486 -0
- package/dist/src/profile-command.d.ts +3 -0
- package/dist/src/profile-command.js +79 -0
- package/dist/src/profile-state.d.ts +7 -0
- package/dist/src/profile-state.js +39 -0
- package/dist/src/rig-task-run-skill.d.ts +8 -0
- package/dist/src/rig-task-run-skill.js +39 -0
- package/dist/src/runtime-instructions.d.ts +4 -0
- package/dist/src/runtime-instructions.js +26 -0
- package/dist/src/runtime-secrets.d.ts +6 -0
- package/dist/src/runtime-secrets.js +58 -0
- package/dist/src/service.d.ts +14 -0
- package/dist/src/service.js +33 -0
- package/dist/src/session-asset-materializer-service.d.ts +13 -0
- package/dist/src/session-asset-materializer-service.js +164 -0
- package/dist/src/session-hook-materializer-service.d.ts +34 -0
- package/dist/src/session-hook-materializer-service.js +142 -0
- package/dist/src/skill-materializer.d.ts +25 -0
- package/dist/src/skill-materializer.js +86 -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 +62 -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 +192 -0
- package/dist/src/tooling/gateway.d.ts +4 -0
- package/dist/src/tooling/gateway.js +400 -0
- package/dist/src/tooling/shell-tools.d.ts +5 -0
- package/dist/src/tooling/shell-tools.js +185 -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 +101 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/harness-plugin/src/agent-harness/controlled-bash.ts
|
|
3
|
+
import { existsSync } from "fs";
|
|
4
|
+
import { resolve } from "path";
|
|
5
|
+
import { resolveRigLayout } from "@rig/core/layout";
|
|
6
|
+
function controlledBashCandidates(projectRoot) {
|
|
7
|
+
const layout = resolveRigLayout(projectRoot);
|
|
8
|
+
const candidates = [
|
|
9
|
+
process.env.RIG_CONTROLLED_BASH_BIN?.trim() || "",
|
|
10
|
+
resolve(layout.binDir, "controlled-bash"),
|
|
11
|
+
Bun.which("controlled-bash") || ""
|
|
12
|
+
];
|
|
13
|
+
return candidates.filter((candidate) => Boolean(candidate));
|
|
14
|
+
}
|
|
15
|
+
function resolveControlledBash(projectRoot) {
|
|
16
|
+
for (const candidate of controlledBashCandidates(projectRoot)) {
|
|
17
|
+
if (existsSync(candidate))
|
|
18
|
+
return candidate;
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
async function runControlledBash(args, options) {
|
|
23
|
+
const projectRoot = process.env.RIG_HOST_PROJECT_ROOT?.trim() || process.env.PROJECT_RIG_ROOT?.trim() || process.env.RIG_TASK_WORKSPACE?.trim() || process.cwd() || options.projectRootFallbackDir;
|
|
24
|
+
const controlled = resolveControlledBash(projectRoot);
|
|
25
|
+
if (!controlled) {
|
|
26
|
+
console.error("[rig-agent] controlled-bash entrypoint unavailable; refusing to run an unguarded shell.");
|
|
27
|
+
return 126;
|
|
28
|
+
}
|
|
29
|
+
const command = [controlled, ...args];
|
|
30
|
+
const child = Bun.spawn(command, {
|
|
31
|
+
stdin: "inherit",
|
|
32
|
+
stdout: "inherit",
|
|
33
|
+
stderr: "inherit",
|
|
34
|
+
cwd: process.cwd(),
|
|
35
|
+
env: {
|
|
36
|
+
...process.env,
|
|
37
|
+
PROJECT_RIG_ROOT: projectRoot,
|
|
38
|
+
RIG_BASH_ACTIVE: "1"
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return await child.exited;
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
runControlledBash
|
|
45
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/harness-plugin/src/agent-harness/git-ops.ts
|
|
3
|
+
import { LIFECYCLE_GIT_AGENT } from "@rig/contracts";
|
|
4
|
+
import { defineCapability } from "@rig/core/capability";
|
|
5
|
+
import { buildPluginHostContext } from "@rig/core/plugin-host-context";
|
|
6
|
+
import { loadCapabilityForRoot } from "@rig/core/capability-loaders";
|
|
7
|
+
var LifecycleGitAgentCap = defineCapability(LIFECYCLE_GIT_AGENT);
|
|
8
|
+
var hostContextByRoot = new Map;
|
|
9
|
+
async function ensureHostContext(projectRoot) {
|
|
10
|
+
let cached = hostContextByRoot.get(projectRoot);
|
|
11
|
+
if (!cached) {
|
|
12
|
+
cached = buildPluginHostContext(projectRoot);
|
|
13
|
+
hostContextByRoot.set(projectRoot, cached);
|
|
14
|
+
}
|
|
15
|
+
await cached;
|
|
16
|
+
}
|
|
17
|
+
async function loadLifecycleGit(projectRoot) {
|
|
18
|
+
await ensureHostContext(projectRoot);
|
|
19
|
+
const git = await loadCapabilityForRoot(projectRoot, LifecycleGitAgentCap);
|
|
20
|
+
if (!git) {
|
|
21
|
+
throw new Error("lifecycle git capability unavailable: load @rig/lifecycle-plugin (default bundle) before running rig-agent git commands.");
|
|
22
|
+
}
|
|
23
|
+
return git;
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
loadLifecycleGit
|
|
27
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider agent-harness repo operations.
|
|
3
|
+
*
|
|
4
|
+
* Repo workflow semantics are owned by @rig/repos-plugin. This provider shim only
|
|
5
|
+
* resolves the repo-operations capability and delegates the legacy harness entry
|
|
6
|
+
* points so provider code does not perform live git/branch/task-source mutation.
|
|
7
|
+
*/
|
|
8
|
+
import { type RepoPins } from "@rig/contracts";
|
|
9
|
+
export declare function repoEnsure(projectRoot: string, taskId?: string): void;
|
|
10
|
+
export declare function repoPins(projectRoot: string, taskId?: string): RepoPins;
|
|
11
|
+
export declare function repoVerify(projectRoot: string, taskId?: string): boolean;
|
|
12
|
+
export declare function repoDiscover(projectRoot: string, taskId?: string): RepoPins;
|
|
13
|
+
export declare function repoBaseline(projectRoot: string, refresh?: boolean): RepoPins;
|
|
14
|
+
export declare function resetBaseline(projectRoot: string, keepTaskStatus: boolean): void;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/harness-plugin/src/agent-harness/repo-ops.ts
|
|
3
|
+
import {
|
|
4
|
+
REPO_OPERATIONS_CAPABILITY
|
|
5
|
+
} from "@rig/contracts";
|
|
6
|
+
import { defineCapability } from "@rig/core/capability";
|
|
7
|
+
import { requireInstalledCapability } from "@rig/core/capability-loaders";
|
|
8
|
+
var RepoOperationsCap = defineCapability(REPO_OPERATIONS_CAPABILITY);
|
|
9
|
+
function repoOperations() {
|
|
10
|
+
return requireInstalledCapability(RepoOperationsCap, "repo operations capability unavailable: load @rig/repos-plugin before using provider harness repo operations.");
|
|
11
|
+
}
|
|
12
|
+
function repoEnsure(projectRoot, taskId) {
|
|
13
|
+
repoOperations().repoEnsure(projectRoot, taskId);
|
|
14
|
+
}
|
|
15
|
+
function repoPins(projectRoot, taskId) {
|
|
16
|
+
return repoOperations().repoPins(projectRoot, taskId);
|
|
17
|
+
}
|
|
18
|
+
function repoVerify(projectRoot, taskId) {
|
|
19
|
+
return repoOperations().repoVerify(projectRoot, taskId);
|
|
20
|
+
}
|
|
21
|
+
function repoDiscover(projectRoot, taskId) {
|
|
22
|
+
return repoOperations().repoDiscover(projectRoot, taskId);
|
|
23
|
+
}
|
|
24
|
+
function repoBaseline(projectRoot, refresh = false) {
|
|
25
|
+
return repoOperations().repoBaseline(projectRoot, refresh);
|
|
26
|
+
}
|
|
27
|
+
function resetBaseline(projectRoot, keepTaskStatus) {
|
|
28
|
+
repoOperations().resetBaseline(projectRoot, keepTaskStatus);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
resetBaseline,
|
|
32
|
+
repoVerify,
|
|
33
|
+
repoPins,
|
|
34
|
+
repoEnsure,
|
|
35
|
+
repoDiscover,
|
|
36
|
+
repoBaseline
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runRigAgentEntrypoint(): Promise<void>;
|