@mininglamp-oss/octo-runtime 1.1.1 → 1.1.2
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/apps/cli/dist/build-info.json +2 -2
- package/apps/cli/dist/manifest.json +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/adapter.d.ts +54 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/adapter.js +399 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/client.d.ts +14 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/client.js +156 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/index.d.ts +29 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/index.js +273 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/interactions.d.ts +27 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/interactions.js +161 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +17 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/compatibility.d.ts +24 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/compatibility.js +181 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/gateway.d.ts +9 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/gateway.js +24 -8
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.js +229 -225
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/approval.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/approval.js +5 -6
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/manifest.json +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +23 -22
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/model-input.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/model-input.js +13 -9
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.js +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/contracts.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.js +24 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/contexts.js +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/mentions.d.ts +5 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/mentions.js +19 -5
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/normalize.js +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +6 -6
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
- package/package.json +27 -25
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-opencode",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
9
|
-
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.
|
|
10
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
8
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.2",
|
|
9
|
+
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.2",
|
|
10
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.2"
|
|
11
11
|
},
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"files": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-qodercli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.2"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-qoderclicn",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.2"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -7,10 +7,14 @@ export declare class AcpApprovalBridge {
|
|
|
7
7
|
readonly options: {
|
|
8
8
|
providerDecisions?: boolean;
|
|
9
9
|
providerManagedExpiry?: boolean;
|
|
10
|
+
/** 仅由 Adapter 在首个审批前设置,用于已授权的原生兼容回退;不改写请求策略与身份。 */
|
|
11
|
+
effectiveApprovalMode?: "ask" | "full_access";
|
|
10
12
|
};
|
|
11
13
|
constructor(request: InvokeRequest, timeoutMs?: number, options?: {
|
|
12
14
|
providerDecisions?: boolean;
|
|
13
15
|
providerManagedExpiry?: boolean;
|
|
16
|
+
/** 仅由 Adapter 在首个审批前设置,用于已授权的原生兼容回退;不改写请求策略与身份。 */
|
|
17
|
+
effectiveApprovalMode?: "ask" | "full_access";
|
|
14
18
|
});
|
|
15
19
|
requestPermission(params: RecordValue, providerExpiresAt?: number): Promise<RecordValue>;
|
|
16
20
|
respond(response: InteractionResponse): Promise<void>;
|
|
@@ -24,6 +24,7 @@ export class AcpApprovalBridge {
|
|
|
24
24
|
requestPermission(params, providerExpiresAt) {
|
|
25
25
|
if (this.#closed || this.request.signal?.aborted)
|
|
26
26
|
return Promise.reject(new Error("APPROVAL_WAIT_UNAVAILABLE"));
|
|
27
|
+
const automatic = (this.options.effectiveApprovalMode ?? this.request.approvalMode) === "full_access";
|
|
27
28
|
const options = Array.isArray(params.options) ? params.options.filter(isObject) : [];
|
|
28
29
|
const option = (kind) => {
|
|
29
30
|
const candidate = options.find((value) => value.kind === kind);
|
|
@@ -34,7 +35,7 @@ export class AcpApprovalBridge {
|
|
|
34
35
|
const allow = option("allow_once");
|
|
35
36
|
const always = this.options.providerDecisions ? option("allow_always") : undefined;
|
|
36
37
|
const decline = option("reject_once");
|
|
37
|
-
if (!allow && !always && !decline &&
|
|
38
|
+
if (!allow && !always && !decline && !automatic)
|
|
38
39
|
return Promise.resolve(cancelled());
|
|
39
40
|
if (this.#pending.size >= 16 || this.request.signal?.aborted)
|
|
40
41
|
return Promise.reject(new Error("APPROVAL_WAIT_UNAVAILABLE"));
|
|
@@ -90,10 +91,8 @@ export class AcpApprovalBridge {
|
|
|
90
91
|
written,
|
|
91
92
|
confirm,
|
|
92
93
|
fail,
|
|
93
|
-
responding:
|
|
94
|
-
...(
|
|
95
|
-
? { automaticOutcome: allow ? "accepted" : "cancelled" }
|
|
96
|
-
: {})
|
|
94
|
+
responding: automatic,
|
|
95
|
+
...(automatic ? { automaticOutcome: allow ? "accepted" : "cancelled" } : {})
|
|
97
96
|
});
|
|
98
97
|
});
|
|
99
98
|
const tool = isObject(params.toolCall)
|
|
@@ -140,7 +139,7 @@ export class AcpApprovalBridge {
|
|
|
140
139
|
}
|
|
141
140
|
}
|
|
142
141
|
});
|
|
143
|
-
if (
|
|
142
|
+
if (automatic)
|
|
144
143
|
this.#pending.get(interactionId).resolve(allow ? selected(allow) : cancelled());
|
|
145
144
|
return result;
|
|
146
145
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"./module-manifest": "./dist/module-manifest.js"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.2",
|
|
13
13
|
"import-meta-resolve": "4.2.0"
|
|
14
14
|
},
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-zcode-gui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
9
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
8
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.2",
|
|
9
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.2"
|
|
10
10
|
},
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"files": [
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
"module": "@mininglamp-oss/octo-runtime-adapter-codebuddy",
|
|
17
17
|
"export": "codebuddyAdapter"
|
|
18
18
|
},
|
|
19
|
+
{
|
|
20
|
+
"type": "grok-build",
|
|
21
|
+
"module": "@mininglamp-oss/octo-runtime-adapter-grok-build",
|
|
22
|
+
"export": "grokBuildAdapter"
|
|
23
|
+
},
|
|
19
24
|
{
|
|
20
25
|
"type": "hermes",
|
|
21
26
|
"module": "@mininglamp-oss/octo-runtime-adapter-hermes",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -8,27 +8,28 @@
|
|
|
8
8
|
},
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
11
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.2",
|
|
12
12
|
"json5": "2.2.3",
|
|
13
|
-
"@mininglamp-oss/octo-runtime-extra-channel-gateway": "1.1.
|
|
14
|
-
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.
|
|
15
|
-
"@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.
|
|
16
|
-
"@mininglamp-oss/octo-runtime-cross-service": "1.1.
|
|
17
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
18
|
-
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.
|
|
19
|
-
"@mininglamp-oss/octo-runtime-executor-core": "1.1.
|
|
20
|
-
"@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.
|
|
21
|
-
"@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.
|
|
22
|
-
"@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.
|
|
23
|
-
"@mininglamp-oss/octo-runtime-adapter-codex": "1.1.
|
|
24
|
-
"@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.
|
|
25
|
-
"@mininglamp-oss/octo-runtime-adapter-
|
|
26
|
-
"@mininglamp-oss/octo-runtime-adapter-
|
|
27
|
-
"@mininglamp-oss/octo-runtime-adapter-
|
|
28
|
-
"@mininglamp-oss/octo-runtime-adapter-
|
|
29
|
-
"@mininglamp-oss/octo-runtime-adapter-
|
|
30
|
-
"@mininglamp-oss/octo-runtime-adapter-
|
|
31
|
-
"@mininglamp-oss/octo-runtime-
|
|
32
|
-
"@mininglamp-oss/octo-runtime-extra-
|
|
13
|
+
"@mininglamp-oss/octo-runtime-extra-channel-gateway": "1.1.2",
|
|
14
|
+
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.2",
|
|
15
|
+
"@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.2",
|
|
16
|
+
"@mininglamp-oss/octo-runtime-cross-service": "1.1.2",
|
|
17
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.2",
|
|
18
|
+
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.2",
|
|
19
|
+
"@mininglamp-oss/octo-runtime-executor-core": "1.1.2",
|
|
20
|
+
"@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.2",
|
|
21
|
+
"@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.2",
|
|
22
|
+
"@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.2",
|
|
23
|
+
"@mininglamp-oss/octo-runtime-adapter-codex": "1.1.2",
|
|
24
|
+
"@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.2",
|
|
25
|
+
"@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.2",
|
|
26
|
+
"@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.2",
|
|
27
|
+
"@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.2",
|
|
28
|
+
"@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.2",
|
|
29
|
+
"@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.2",
|
|
30
|
+
"@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.2",
|
|
31
|
+
"@mininglamp-oss/octo-runtime-adapter-zcode-gui": "1.1.2",
|
|
32
|
+
"@mininglamp-oss/octo-runtime-extra-channel-wecom": "1.1.2",
|
|
33
|
+
"@mininglamp-oss/octo-runtime-extra-webui": "1.1.2"
|
|
33
34
|
}
|
|
34
35
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ContextEnvelope, InvokeRequest } from "@mininglamp-oss/octo-runtime-protocol";
|
|
2
|
-
/**
|
|
2
|
+
/** 仅渲染允许进入模型的本轮业务 Context;Markdown 指引保留原文,排序后的 payload 用 CDATA 包裹,不修改输入。 */
|
|
3
3
|
export declare function renderModelContexts(context: ContextEnvelope): string;
|
|
4
4
|
/**
|
|
5
5
|
* Core 冻结原请求后、派发 Adapter 前调用一次;接入方不应预先渲染而造成 Context 重复。
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
const MODEL_CONTEXT_PATTERNS = [/^extra\.[^/]+\/[^/]+$/, /^octo\.content\/(inline|references)$/];
|
|
2
|
-
/**
|
|
2
|
+
/** 仅渲染允许进入模型的本轮业务 Context;Markdown 指引保留原文,排序后的 payload 用 CDATA 包裹,不修改输入。 */
|
|
3
3
|
export function renderModelContexts(context) {
|
|
4
4
|
const items = context.items.filter((item) => MODEL_CONTEXT_PATTERNS.some((pattern) => pattern.test(item.namespace + "/" + item.name)));
|
|
5
5
|
if (!items.length)
|
|
6
6
|
return "";
|
|
7
7
|
return [
|
|
8
|
-
"
|
|
8
|
+
"<!-- Context information begins: the following is the current context -->",
|
|
9
9
|
"<contexts>",
|
|
10
|
-
...items.map((item) =>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
...items.map((item) => {
|
|
11
|
+
// 拆分 CDATA 终止符为相邻区段,避免材料中的标记提前结束数据边界;不解析内部内容。
|
|
12
|
+
const data = JSON.stringify(sorted(item.payload)).replaceAll("]]>", "]]]]><![CDATA[>");
|
|
13
|
+
return [
|
|
14
|
+
` <context-item namespace="${item.namespace}" name="${item.name}">`,
|
|
15
|
+
...(item.guidance ? [` <guidence>${item.guidance}</guidence>`] : []),
|
|
16
|
+
` <data><![CDATA[${data}]]></data>`,
|
|
17
|
+
" </context-item>"
|
|
18
|
+
].join("\n");
|
|
19
|
+
}),
|
|
16
20
|
"</contexts>",
|
|
17
|
-
"
|
|
21
|
+
"<!-- Context information ends -->"
|
|
18
22
|
].join("\n");
|
|
19
23
|
}
|
|
20
24
|
function sorted(value) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-executor-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
9
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
8
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.2",
|
|
9
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.2"
|
|
10
10
|
},
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"files": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-executor-kernel",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@mininglamp-oss/octo-runtime-executor-core": "1.1.
|
|
22
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
23
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
21
|
+
"@mininglamp-oss/octo-runtime-executor-core": "1.1.2",
|
|
22
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.2",
|
|
23
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.2"
|
|
24
24
|
},
|
|
25
25
|
"types": "./dist/index.d.ts",
|
|
26
26
|
"files": [
|
|
@@ -744,7 +744,8 @@ export class ImRuntime {
|
|
|
744
744
|
? undefined
|
|
745
745
|
: await this.dependencies.prepareContexts?.(this.config, turnSignal),
|
|
746
746
|
initialSession,
|
|
747
|
-
|
|
747
|
+
// 逐轮提醒让升级前的 Provider binding 也收到新 mention 规则,不隐式 reset。
|
|
748
|
+
mentionGuidance: true,
|
|
748
749
|
...(gapEnabled
|
|
749
750
|
? {
|
|
750
751
|
historyGap: gapPlan,
|
|
@@ -57,6 +57,7 @@ export interface ImInboundMessage {
|
|
|
57
57
|
position?: {
|
|
58
58
|
messageSeq: number;
|
|
59
59
|
};
|
|
60
|
+
/** 同代次卡片重试:buildContext 返回 Gateway 已组合的冻结快照,不再采集或追加默认项。 */
|
|
60
61
|
historyRetry?: boolean;
|
|
61
62
|
bindHistoryTurn?(token: ImGapTurnToken): void;
|
|
62
63
|
markRead?(signal: AbortSignal): Promise<void>;
|
package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.js
CHANGED
|
@@ -9,6 +9,7 @@ import { join } from "node:path";
|
|
|
9
9
|
import { assertContextEnvelope, mergeContext } from "@mininglamp-oss/octo-runtime-protocol";
|
|
10
10
|
import { validateImConfig } from "../lifecycle/configuration.js";
|
|
11
11
|
import { compactHistoryGap, historyGapContext } from "../application/context-gap.js";
|
|
12
|
+
import { MENTION_GUIDANCE } from "../transport/mentions.js";
|
|
12
13
|
export function createImInvocation(config, message, context, sessionKey, session, _signal, occurrenceId = message.messageId) {
|
|
13
14
|
validateImConfig(config);
|
|
14
15
|
assertContextEnvelope(context);
|
|
@@ -77,7 +78,30 @@ export function createImInvocation(config, message, context, sessionKey, session
|
|
|
77
78
|
]
|
|
78
79
|
};
|
|
79
80
|
// Channel 只组装公开 InvokeInput;执行解析和指令渲染统一交给 Host,避免再次拒绝业务 Context。
|
|
81
|
+
// 宿主已先解析静态/动态 Context;渠道默认指令只在本轮与有效 entries 保序组合一次。
|
|
82
|
+
// 不改变公共 mergeContext 或动态人设替换合同,也不把上一轮的组合结果累积回来。
|
|
80
83
|
let submitted = context;
|
|
84
|
+
// 同代次卡片重试已从 occurrence 取得组合后的冻结快照,不能再次追加或按文本去重。
|
|
85
|
+
if (!message.historyRetry) {
|
|
86
|
+
const instructions = context.items.find((item) => item.namespace === "octo.control" && item.name === "instructions");
|
|
87
|
+
const channelInstructions = {
|
|
88
|
+
namespace: "octo.control",
|
|
89
|
+
name: "instructions",
|
|
90
|
+
payload: {
|
|
91
|
+
entries: [
|
|
92
|
+
...(instructions?.payload
|
|
93
|
+
?.entries ?? []),
|
|
94
|
+
{ text: MENTION_GUIDANCE }
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
submitted = {
|
|
99
|
+
schema: context.schema,
|
|
100
|
+
items: instructions
|
|
101
|
+
? context.items.map((item) => (item === instructions ? channelInstructions : item))
|
|
102
|
+
: [...context.items, channelInstructions]
|
|
103
|
+
};
|
|
104
|
+
}
|
|
81
105
|
let snapshot;
|
|
82
106
|
// 执行默认项也占协议预算;只降级本渠道自动追加的辅助材料,不丢弃显式业务项。
|
|
83
107
|
for (const optional of [
|
package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/contexts.js
CHANGED
|
@@ -8,7 +8,7 @@ import { getGroupMd, getThreadMd } from "./api/rules.js";
|
|
|
8
8
|
import { getChannelMessagePage } from "./api/conversations.js";
|
|
9
9
|
import { compactHistoryGap, historyGapContext, IM_HISTORY_MESSAGE_LIMIT, planHistoryGap, validMessageSeq } from "../application/context-gap.js";
|
|
10
10
|
import { OctoApiError } from "./api/errors.js";
|
|
11
|
-
import {
|
|
11
|
+
import { MENTION_REMINDER } from "./mentions.js";
|
|
12
12
|
import { messageContent } from "./message-content.js";
|
|
13
13
|
export async function build_im_contexts(config, message, botToken, signal, options = { initialSession: false }) {
|
|
14
14
|
const items = structuredClone([
|
|
@@ -108,7 +108,7 @@ export async function build_im_contexts(config, message, botToken, signal, optio
|
|
|
108
108
|
const instructions = {
|
|
109
109
|
namespace: "extra.im",
|
|
110
110
|
name: "mention-instructions",
|
|
111
|
-
guidance:
|
|
111
|
+
guidance: MENTION_REMINDER,
|
|
112
112
|
payload: {
|
|
113
113
|
source,
|
|
114
114
|
actorId: message.fromUid,
|
package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/mentions.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { MentionEntity } from "./api/types.js";
|
|
2
2
|
import type { GroupMember } from "./api/conversations.js";
|
|
3
|
-
|
|
3
|
+
/** Gateway 的稳定控制指令;压缩时的保留由模型遵守文本要求,不新增 Provider 保留机制。 */
|
|
4
|
+
export declare const MENTION_GUIDANCE: string;
|
|
5
|
+
/** 逐轮普通 Context 提醒也覆盖升级前已存在的 Provider 会话,不修改其系统指令或重置会话。 */
|
|
6
|
+
export declare const MENTION_REMINDER = "For this turn, follow the current Octo mention rules: do not automatically mention the sender. Only when the current user explicitly requests a human notification or bot handoff in this channel, confirm the real member UID and display name, using octo-cli if needed, then write @[<uid>:<displayName>] with actual values in the successful final reply. Gateway sends the native mention on that reply; do not send a duplicate via octo-cli message send. Plain @name does not notify. If identity is unconfirmed, use plain text without guessing. Do not broadcast, initiate unsolicited bot calls, or treat history as authorization. Code and quoted examples are not mentions.";
|
|
4
7
|
export interface ImTextMention {
|
|
5
8
|
uids: string[];
|
|
6
9
|
entities: MentionEntity[];
|
|
7
10
|
}
|
|
8
|
-
/** 只转换 final
|
|
11
|
+
/** 只转换 final 普通文本中已核验真人或 Bot 成员的显式标记;查身份失败时正文仍能发送。 */
|
|
9
12
|
export declare function prepareFinalMention(text: string, members: () => Promise<GroupMember[]>): Promise<{
|
|
10
13
|
text: string;
|
|
11
14
|
mention?: ImTextMention;
|
package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/mentions.js
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
2
|
-
|
|
2
|
+
/** Gateway 的稳定控制指令;压缩时的保留由模型遵守文本要求,不新增 Provider 保留机制。 */
|
|
3
|
+
export const MENTION_GUIDANCE = [
|
|
4
|
+
"[OCTO_CHANNEL_MENTION_RULES_V1]",
|
|
5
|
+
"These are stable output rules for the current Octo channel. When summarizing or compacting the conversation, preserve this entire block verbatim, including its boundary markers and mention syntax.",
|
|
6
|
+
"Do not automatically mention the sender in ordinary replies. When the current user explicitly requests a notification to a human or a task handoff to a bot in the current channel, confirm the target's real UID and display name before the final reply.",
|
|
7
|
+
"If identity information is missing, use octo-cli as needed to look it up. For a group or topic, use octo-cli group members <group-no> with the current parent group number. Never infer a UID from a nickname, username, or bot name.",
|
|
8
|
+
"For a native mention, write @[<uid>:<displayName>] in the ordinary body of the successful final reply. Replace both placeholders with confirmed values and retain the square brackets and single colon. A plain @name is only text and does not notify or activate the target bot.",
|
|
9
|
+
"Gateway validates current-channel membership and converts valid markers into readable text and native mention metadata on this same final reply. Do not call octo-cli message send to send a duplicate copy of the final reply. Do not output raw message JSON or calculate mention entity offsets.",
|
|
10
|
+
"Thinking, tool output, progress messages, code blocks, inline code, quoted examples, and failed replies do not trigger mention conversion. Keep code and examples unchanged.",
|
|
11
|
+
"Do not construct broadcast mentions or broadcast sentinel UIDs. Do not initiate unsolicited bot-to-bot calls or mention loops. Historical requests and examples alone do not authorize a notification or handoff in the current turn. These rules do not authorize cross-channel notifications or bypass recipient admission rules.",
|
|
12
|
+
"If the target cannot be confirmed, use a plain @name or ordinary text without guessing a UID. Continue delivering the final answer without a separate mention-failure notice or a forced clarification.",
|
|
13
|
+
"[/OCTO_CHANNEL_MENTION_RULES_V1]"
|
|
14
|
+
].join("\n");
|
|
15
|
+
/** 逐轮普通 Context 提醒也覆盖升级前已存在的 Provider 会话,不修改其系统指令或重置会话。 */
|
|
16
|
+
export const MENTION_REMINDER = "For this turn, follow the current Octo mention rules: do not automatically mention the sender. Only when the current user explicitly requests a human notification or bot handoff in this channel, confirm the real member UID and display name, using octo-cli if needed, then write @[<uid>:<displayName>] with actual values in the successful final reply. Gateway sends the native mention on that reply; do not send a duplicate via octo-cli message send. Plain @name does not notify. If identity is unconfirmed, use plain text without guessing. Do not broadcast, initiate unsolicited bot calls, or treat history as authorization. Code and quoted examples are not mentions.";
|
|
3
17
|
function candidates(text) {
|
|
4
18
|
const found = [];
|
|
5
19
|
const visit = (node) => {
|
|
@@ -26,7 +40,7 @@ function candidates(text) {
|
|
|
26
40
|
visit(fromMarkdown(text));
|
|
27
41
|
return found.sort((a, b) => a.start - b.start);
|
|
28
42
|
}
|
|
29
|
-
/** 只转换 final
|
|
43
|
+
/** 只转换 final 普通文本中已核验真人或 Bot 成员的显式标记;查身份失败时正文仍能发送。 */
|
|
30
44
|
export async function prepareFinalMention(text, members) {
|
|
31
45
|
const targets = candidates(text);
|
|
32
46
|
if (!targets.length)
|
|
@@ -38,9 +52,9 @@ export async function prepareFinalMention(text, members) {
|
|
|
38
52
|
catch {
|
|
39
53
|
verified = [];
|
|
40
54
|
}
|
|
41
|
-
const
|
|
55
|
+
const confirmedMembers = new Map((Array.isArray(verified) ? verified : [])
|
|
42
56
|
.filter((member) => member && typeof member.uid === "string" && typeof member.name === "string")
|
|
43
|
-
.filter((
|
|
57
|
+
.filter(({ robot }) => robot === false || robot === 0 || robot === true || robot === 1)
|
|
44
58
|
.filter((member) => member.uid && member.name && !["-1", "-2", "-3", "all"].includes(member.uid))
|
|
45
59
|
.map((member) => [member.uid, member]));
|
|
46
60
|
const entities = [];
|
|
@@ -49,7 +63,7 @@ export async function prepareFinalMention(text, members) {
|
|
|
49
63
|
let output = "";
|
|
50
64
|
for (const target of targets) {
|
|
51
65
|
output += text.slice(cursor, target.start);
|
|
52
|
-
const member =
|
|
66
|
+
const member = confirmedMembers.get(target.uid);
|
|
53
67
|
const label = `@${member?.name ?? target.name}`;
|
|
54
68
|
if (member) {
|
|
55
69
|
entities.push({ uid: member.uid, offset: output.length, length: label.length });
|
package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/normalize.js
CHANGED
|
@@ -15,6 +15,7 @@ export function observesImScope(config, channelId, channelType, spaceId) {
|
|
|
15
15
|
config.group_ids.includes(groupScope(channelId).groupNo)));
|
|
16
16
|
}
|
|
17
17
|
export function acceptsImMessage(config, owner, message) {
|
|
18
|
+
// 自己发出的消息永不触发 AgentRun,即使真实 @ 自己、@所有AI 或显式列入发送者名单。
|
|
18
19
|
if (message.fromUid === config.bot_id ||
|
|
19
20
|
isRulesNotification(message) ||
|
|
20
21
|
!message.messageId ||
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-extra-channel-gateway",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"docs"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.
|
|
22
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
23
|
-
"@mininglamp-oss/octo-runtime-executor-core": "1.1.
|
|
24
|
-
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.
|
|
25
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
21
|
+
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.2",
|
|
22
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.2",
|
|
23
|
+
"@mininglamp-oss/octo-runtime-executor-core": "1.1.2",
|
|
24
|
+
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.2",
|
|
25
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.2",
|
|
26
26
|
"mdast-util-from-markdown": "2.1.0",
|
|
27
27
|
"ws": "8.22.0"
|
|
28
28
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-extra-channel-wecom",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"docs"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.
|
|
22
|
-
"@mininglamp-oss/octo-runtime-executor-core": "1.1.
|
|
23
|
-
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.
|
|
21
|
+
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.2",
|
|
22
|
+
"@mininglamp-oss/octo-runtime-executor-core": "1.1.2",
|
|
23
|
+
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.2",
|
|
24
24
|
"ws": "8.22.0",
|
|
25
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
25
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.2"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-extra-webui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Local Runtime workbench with canonical SSE presentation",
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
"porting-map.md"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
22
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.2"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-host-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
23
|
-
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.
|
|
24
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
22
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.2",
|
|
23
|
+
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.2",
|
|
24
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.2"
|
|
25
25
|
},
|
|
26
26
|
"types": "./dist/index.d.ts",
|
|
27
27
|
"files": [
|