@openclaw/copilot 2026.7.2-beta.7 → 2026.8.1-beta.3
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/{attempt-D6tQnv01.js → attempt-DsIndF6T.js} +451 -333
- package/dist/doctor-contract-api.js +1 -20
- package/dist/{harness-D0K-5kNw.js → harness-BJ_IcIJk.js} +103 -77
- package/dist/harness.js +1 -1
- package/dist/index.js +1 -1
- package/dist/isolated-completion-D9VIGPmy.js +207 -0
- package/dist/{runtime-BY2Yi3Dg.js → runtime-C2t8Iz5R.js} +6 -9
- package/dist/usage-bridge-Cpa-ZYwL.js +82 -0
- package/openclaw.plugin.json +13 -0
- package/package.json +4 -4
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import path, { normalize, resolve, sep } from "node:path";
|
|
3
|
+
import { toStringifiedError } from "openclaw/plugin-sdk/error-runtime";
|
|
3
4
|
import { existsSync } from "node:fs";
|
|
4
5
|
import { pathToFileURL } from "node:url";
|
|
5
6
|
import { resolveStateDir } from "openclaw/plugin-sdk/state-paths";
|
|
@@ -106,7 +107,7 @@ function createCopilotClientPool(options = {}) {
|
|
|
106
107
|
try {
|
|
107
108
|
return await client.stop();
|
|
108
109
|
} catch (error) {
|
|
109
|
-
return [
|
|
110
|
+
return [toStringifiedError(error)];
|
|
110
111
|
} finally {
|
|
111
112
|
entry.state = { kind: "stopped" };
|
|
112
113
|
maybeDeleteEntry(entry);
|
|
@@ -126,7 +127,7 @@ function createCopilotClientPool(options = {}) {
|
|
|
126
127
|
await entry.state.promise;
|
|
127
128
|
} catch (error) {
|
|
128
129
|
maybeDeleteEntry(entry);
|
|
129
|
-
return [
|
|
130
|
+
return [toStringifiedError(error)];
|
|
130
131
|
}
|
|
131
132
|
return stopEntry(entry);
|
|
132
133
|
case "ready": return stopReadyOrIdleEntry(entry, entry.state.client);
|
|
@@ -168,7 +169,7 @@ function createCopilotClientPool(options = {}) {
|
|
|
168
169
|
} catch (error) {
|
|
169
170
|
entry.state = { kind: "stopped" };
|
|
170
171
|
maybeDeleteEntry(entry);
|
|
171
|
-
throw
|
|
172
|
+
throw toStringifiedError(error);
|
|
172
173
|
}
|
|
173
174
|
})();
|
|
174
175
|
entry.state = {
|
|
@@ -201,7 +202,7 @@ function createCopilotClientPool(options = {}) {
|
|
|
201
202
|
client
|
|
202
203
|
};
|
|
203
204
|
} catch (error) {
|
|
204
|
-
throw
|
|
205
|
+
throw toStringifiedError(error);
|
|
205
206
|
}
|
|
206
207
|
}
|
|
207
208
|
switch (existing.state.kind) {
|
|
@@ -218,7 +219,7 @@ function createCopilotClientPool(options = {}) {
|
|
|
218
219
|
client
|
|
219
220
|
};
|
|
220
221
|
} catch (error) {
|
|
221
|
-
throw
|
|
222
|
+
throw toStringifiedError(error);
|
|
222
223
|
}
|
|
223
224
|
case "ready":
|
|
224
225
|
existing.refCount += 1;
|
|
@@ -334,9 +335,5 @@ function normalizeCopilotHome(copilotHome) {
|
|
|
334
335
|
if (process.platform === "win32") normalizedHome = normalizedHome.toLowerCase();
|
|
335
336
|
return normalizedHome;
|
|
336
337
|
}
|
|
337
|
-
function toError(error) {
|
|
338
|
-
if (error instanceof Error) return error;
|
|
339
|
-
return new Error(String(error));
|
|
340
|
-
}
|
|
341
338
|
//#endregion
|
|
342
339
|
export { createCopilotClientPool };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
//#region extensions/copilot/src/session-restrictions.ts
|
|
2
|
+
const COPILOT_ISOLATED_EXCLUDED_TOOLS = [
|
|
3
|
+
"builtin:*",
|
|
4
|
+
"mcp:*",
|
|
5
|
+
"custom:*"
|
|
6
|
+
];
|
|
7
|
+
/** Disable every ambient SDK capability for a prompt-only or settled final turn. */
|
|
8
|
+
function createCopilotIsolatedSessionRestrictions() {
|
|
9
|
+
return {
|
|
10
|
+
availableTools: [],
|
|
11
|
+
coauthorEnabled: false,
|
|
12
|
+
customAgents: [],
|
|
13
|
+
customAgentsLocalOnly: true,
|
|
14
|
+
embeddingCacheStorage: "in-memory",
|
|
15
|
+
enableConfigDiscovery: false,
|
|
16
|
+
enableFileHooks: false,
|
|
17
|
+
enableHostGitOperations: false,
|
|
18
|
+
enableOnDemandInstructionDiscovery: false,
|
|
19
|
+
enableSessionStore: false,
|
|
20
|
+
enableSkills: false,
|
|
21
|
+
excludedTools: [...COPILOT_ISOLATED_EXCLUDED_TOOLS],
|
|
22
|
+
includeSubAgentStreamingEvents: false,
|
|
23
|
+
infiniteSessions: { enabled: false },
|
|
24
|
+
instructionDirectories: [],
|
|
25
|
+
manageScheduleEnabled: false,
|
|
26
|
+
mcpOAuthTokenStorage: "in-memory",
|
|
27
|
+
mcpServers: {},
|
|
28
|
+
memory: { enabled: false },
|
|
29
|
+
pluginDirectories: [],
|
|
30
|
+
remoteSession: "off",
|
|
31
|
+
requestCanvasRenderer: false,
|
|
32
|
+
requestExtensions: false,
|
|
33
|
+
skillDirectories: [],
|
|
34
|
+
skipCustomInstructions: true,
|
|
35
|
+
skipEmbeddingRetrieval: true,
|
|
36
|
+
tools: []
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region extensions/copilot/src/usage-bridge.ts
|
|
41
|
+
function isCopilotUsageSource(data) {
|
|
42
|
+
return typeof data === "object" && data !== null;
|
|
43
|
+
}
|
|
44
|
+
function buildZeroCost() {
|
|
45
|
+
return {
|
|
46
|
+
cacheRead: 0,
|
|
47
|
+
cacheWrite: 0,
|
|
48
|
+
input: 0,
|
|
49
|
+
output: 0,
|
|
50
|
+
total: 0
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function coerceTokenCount(value) {
|
|
54
|
+
return typeof value === "number" && Number.isFinite(value) ? Math.max(0, Math.trunc(value)) : void 0;
|
|
55
|
+
}
|
|
56
|
+
function normalizeCopilotUsage(data) {
|
|
57
|
+
if (!isCopilotUsageSource(data)) return;
|
|
58
|
+
const input = coerceTokenCount(data.inputTokens);
|
|
59
|
+
const output = coerceTokenCount(data.outputTokens);
|
|
60
|
+
const cacheRead = coerceTokenCount(data.cacheReadTokens);
|
|
61
|
+
const cacheWrite = coerceTokenCount(data.cacheWriteTokens);
|
|
62
|
+
return {
|
|
63
|
+
cacheRead,
|
|
64
|
+
cacheWrite,
|
|
65
|
+
input,
|
|
66
|
+
output,
|
|
67
|
+
total: (input ?? 0) + (output ?? 0) + (cacheRead ?? 0) + (cacheWrite ?? 0)
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function buildCopilotAssistantUsage(params) {
|
|
71
|
+
const usage = params.usage ?? normalizeCopilotUsage({ outputTokens: params.fallbackOutputTokens });
|
|
72
|
+
return {
|
|
73
|
+
cacheRead: usage?.cacheRead ?? 0,
|
|
74
|
+
cacheWrite: usage?.cacheWrite ?? 0,
|
|
75
|
+
cost: buildZeroCost(),
|
|
76
|
+
input: usage?.input ?? 0,
|
|
77
|
+
output: usage?.output ?? 0,
|
|
78
|
+
totalTokens: usage?.total ?? 0
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
export { normalizeCopilotUsage as n, createCopilotIsolatedSessionRestrictions as r, buildCopilotAssistantUsage as t };
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "copilot",
|
|
3
|
+
"doctorContract": {
|
|
4
|
+
"configRepair": true
|
|
5
|
+
},
|
|
6
|
+
"sessionRouteStateOwners": [
|
|
7
|
+
{
|
|
8
|
+
"id": "copilot",
|
|
9
|
+
"label": "GitHub Copilot agent runtime",
|
|
10
|
+
"providerIds": ["github-copilot"],
|
|
11
|
+
"runtimeIds": ["copilot"],
|
|
12
|
+
"cliSessionKeys": ["copilot"],
|
|
13
|
+
"authProfilePrefixes": ["github-copilot:"]
|
|
14
|
+
}
|
|
15
|
+
],
|
|
3
16
|
"name": "GitHub Copilot agent runtime",
|
|
4
17
|
"description": "Registers the GitHub Copilot agent runtime.",
|
|
5
18
|
"icon": "https://cdn.simpleicons.org/githubcopilot",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/copilot",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.8.1-beta.3",
|
|
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",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"minHostVersion": ">=2026.5.28"
|
|
25
25
|
},
|
|
26
26
|
"compat": {
|
|
27
|
-
"pluginApi": ">=2026.
|
|
27
|
+
"pluginApi": ">=2026.8.1-beta.3"
|
|
28
28
|
},
|
|
29
29
|
"build": {
|
|
30
|
-
"openclawVersion": "2026.
|
|
30
|
+
"openclawVersion": "2026.8.1-beta.3",
|
|
31
31
|
"bundledDist": false
|
|
32
32
|
},
|
|
33
33
|
"release": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"README.md"
|
|
46
46
|
],
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"openclaw": ">=2026.
|
|
48
|
+
"openclaw": ">=2026.8.1-beta.3"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
51
51
|
"openclaw": {
|