@openclaw/copilot 2026.6.6 → 2026.6.8-beta.1
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as resolveCopilotAuth } from "./harness-
|
|
2
|
-
import { acquireSessionWriteLock, appendSessionTranscriptMessage, applyEmbeddedAttemptToolsAllow, buildEmbeddedAttemptToolRunContext, detectAndLoadAgentHarnessPromptImages, emitSessionTranscriptUpdate, getPluginToolMeta, isSubagentSessionKey, resolveAttemptFsWorkspaceOnly, resolveAttemptSpawnWorkspaceDir, resolveBootstrapContextForRun, resolveEmbeddedAttemptToolConstructionPlan, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, resolveSessionWriteLockAcquireTimeoutMs, resolveUserPath, runAgentHarnessBeforeMessageWriteHook } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
1
|
+
import { n as resolveCopilotAuth } from "./harness-DhGypePh.js";
|
|
2
|
+
import { acquireSessionWriteLock, appendSessionTranscriptMessage, applyEmbeddedAttemptToolsAllow, buildEmbeddedAttemptToolRunContext, detectAndLoadAgentHarnessPromptImages, emitSessionTranscriptUpdate, getPluginToolMeta, isSubagentSessionKey, isToolResultError, resolveAttemptFsWorkspaceOnly, resolveAttemptSpawnWorkspaceDir, resolveBootstrapContextForRun, resolveEmbeddedAttemptToolConstructionPlan, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, resolveSessionWriteLockAcquireTimeoutMs, resolveUserPath, runAgentHarnessBeforeMessageWriteHook, sanitizeToolResult } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fsp from "node:fs/promises";
|
|
@@ -737,7 +737,8 @@ async function createCopilotToolBridge(input) {
|
|
|
737
737
|
return {
|
|
738
738
|
sdkTools: filteredTools.map((sourceTool) => convertOpenClawToolToSdkTool(sourceTool, {
|
|
739
739
|
abortSignal: input.abortSignal,
|
|
740
|
-
beforeExecute: input.beforeExecute
|
|
740
|
+
beforeExecute: input.beforeExecute,
|
|
741
|
+
onAgentToolResult: input.attemptParams?.onAgentToolResult
|
|
741
742
|
})),
|
|
742
743
|
sourceTools: filteredTools
|
|
743
744
|
};
|
|
@@ -855,10 +856,34 @@ function convertOpenClawToolToSdkTool(sourceTool, ctx) {
|
|
|
855
856
|
if (typeof sourceTool.name !== "string" || sourceTool.name.trim().length === 0) throw new Error("[copilot-tool-bridge] tool name must be a non-empty string");
|
|
856
857
|
if (typeof sourceTool.execute !== "function") throw new Error(`[copilot-tool-bridge] tool '${sourceTool.name}' must define an execute function`);
|
|
857
858
|
let sequentialLock = Promise.resolve();
|
|
859
|
+
const notifyToolResult = (result, isError) => {
|
|
860
|
+
try {
|
|
861
|
+
ctx.onAgentToolResult?.({
|
|
862
|
+
toolName: sourceTool.name,
|
|
863
|
+
result,
|
|
864
|
+
isError
|
|
865
|
+
});
|
|
866
|
+
} catch (error) {
|
|
867
|
+
console.warn("[copilot-tool-bridge] onAgentToolResult handler threw; continuing", error);
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
const failureResult = (message, error) => {
|
|
871
|
+
notifyToolResult(sanitizeToolResult({
|
|
872
|
+
content: [{
|
|
873
|
+
type: "text",
|
|
874
|
+
text: message
|
|
875
|
+
}],
|
|
876
|
+
details: {
|
|
877
|
+
status: "failed",
|
|
878
|
+
error: toError$1(error).message
|
|
879
|
+
}
|
|
880
|
+
}), true);
|
|
881
|
+
return createFailureResult(message, error);
|
|
882
|
+
};
|
|
858
883
|
const executeOnce = async (args, invocation) => {
|
|
859
884
|
if (ctx.abortSignal?.aborted) {
|
|
860
885
|
const error = /* @__PURE__ */ new Error("[copilot-tool-bridge] aborted before execution");
|
|
861
|
-
return
|
|
886
|
+
return failureResult(error.message, error);
|
|
862
887
|
}
|
|
863
888
|
try {
|
|
864
889
|
await ctx.beforeExecute?.({
|
|
@@ -869,21 +894,24 @@ function convertOpenClawToolToSdkTool(sourceTool, ctx) {
|
|
|
869
894
|
toolName: sourceTool.name
|
|
870
895
|
});
|
|
871
896
|
} catch (error) {
|
|
872
|
-
return
|
|
897
|
+
return failureResult(`[copilot-tool-bridge] beforeExecute failed for tool '${sourceTool.name}': ${toError$1(error).message}`, error);
|
|
873
898
|
}
|
|
874
899
|
let preparedArgs;
|
|
875
900
|
try {
|
|
876
901
|
preparedArgs = sourceTool.prepareArguments ? sourceTool.prepareArguments(args) : args;
|
|
877
902
|
} catch (error) {
|
|
878
|
-
return
|
|
903
|
+
return failureResult(`[copilot-tool-bridge] prepareArguments failed for tool '${sourceTool.name}': ${toError$1(error).message}`, error);
|
|
879
904
|
}
|
|
880
905
|
let result;
|
|
881
906
|
try {
|
|
882
907
|
result = await sourceTool.execute(invocation.toolCallId, preparedArgs, ctx.abortSignal, void 0);
|
|
883
908
|
} catch (error) {
|
|
884
|
-
return
|
|
909
|
+
return failureResult(`[copilot-tool-bridge] tool '${sourceTool.name}' failed: ${toError$1(error).message}`, error);
|
|
885
910
|
}
|
|
886
|
-
|
|
911
|
+
const sdkResult = agentToolResultToSdk(result);
|
|
912
|
+
const sanitizedResult = sanitizeToolResult(result);
|
|
913
|
+
notifyToolResult(sanitizedResult, sdkResult.resultType === "failure" || isToolResultError(sanitizedResult));
|
|
914
|
+
return sdkResult;
|
|
887
915
|
};
|
|
888
916
|
const handler = sourceTool.executionMode === "sequential" ? (args, invocation) => {
|
|
889
917
|
const run = sequentialLock.then(() => executeOnce(args, invocation), () => executeOnce(args, invocation));
|
|
@@ -379,7 +379,7 @@ function createCopilotAgentHarness(options) {
|
|
|
379
379
|
async runAttempt(params) {
|
|
380
380
|
const attemptPromise = (async () => {
|
|
381
381
|
if (disposed) throw new Error("[copilot] harness has been disposed; cannot start new attempts");
|
|
382
|
-
const { resolvePoolAcquire, runCopilotAttempt } = await import("./attempt-
|
|
382
|
+
const { resolvePoolAcquire, runCopilotAttempt } = await import("./attempt-uNOgM4Dc.js");
|
|
383
383
|
if (disposed) throw new Error("[copilot] harness was disposed while starting an attempt");
|
|
384
384
|
const poolAcquire = resolvePoolAcquire(params);
|
|
385
385
|
const pool = await getPool();
|
|
@@ -448,7 +448,7 @@ function createCopilotAgentHarness(options) {
|
|
|
448
448
|
};
|
|
449
449
|
const tracked = trackedSessions.get(openclawSessionId);
|
|
450
450
|
const currentCompactKey = computeSessionCompactKey(params);
|
|
451
|
-
const { resolvePoolAcquire } = await import("./attempt-
|
|
451
|
+
const { resolvePoolAcquire } = await import("./attempt-uNOgM4Dc.js");
|
|
452
452
|
const resolvedPoolAcquire = resolvePoolAcquire(params);
|
|
453
453
|
const currentAuth = sessionAuthFields(resolvedPoolAcquire.auth);
|
|
454
454
|
const compatibleTracked = tracked?.compactKey === currentCompactKey && sessionAuthMatches(tracked, currentAuth) ? tracked : void 0;
|
package/dist/harness.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createCopilotAgentHarness } from "./harness-
|
|
1
|
+
import { t as createCopilotAgentHarness } from "./harness-DhGypePh.js";
|
|
2
2
|
export { createCopilotAgentHarness };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createCopilotAgentHarness } from "./harness-
|
|
1
|
+
import { t as createCopilotAgentHarness } from "./harness-DhGypePh.js";
|
|
2
2
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
3
3
|
//#region extensions/copilot/index.ts
|
|
4
4
|
function isRecord(value) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/copilot",
|
|
3
|
-
"version": "2026.6.
|
|
3
|
+
"version": "2026.6.8-beta.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/copilot",
|
|
9
|
-
"version": "2026.6.
|
|
9
|
+
"version": "2026.6.8-beta.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@github/copilot-sdk": "1.0.0-beta.9"
|
|
12
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/copilot",
|
|
3
|
-
"version": "2026.6.
|
|
3
|
+
"version": "2026.6.8-beta.1",
|
|
4
4
|
"description": "OpenClaw GitHub Copilot agent runtime plugin (registers a `github-copilot` AgentHarness backed by @github/copilot-sdk over JSON-RPC to the GitHub Copilot CLI)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"minHostVersion": ">=2026.5.28"
|
|
26
26
|
},
|
|
27
27
|
"compat": {
|
|
28
|
-
"pluginApi": ">=2026.6.
|
|
28
|
+
"pluginApi": ">=2026.6.8-beta.1"
|
|
29
29
|
},
|
|
30
30
|
"build": {
|
|
31
|
-
"openclawVersion": "2026.6.
|
|
31
|
+
"openclawVersion": "2026.6.8-beta.1",
|
|
32
32
|
"bundledDist": false
|
|
33
33
|
},
|
|
34
34
|
"release": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"README.md"
|
|
48
48
|
],
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"openclaw": ">=2026.6.
|
|
50
|
+
"openclaw": ">=2026.6.8-beta.1"
|
|
51
51
|
},
|
|
52
52
|
"peerDependenciesMeta": {
|
|
53
53
|
"openclaw": {
|