@mininglamp-oss/octo-runtime 1.1.8 → 1.1.9
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/README.md +3 -1
- package/apps/cli/dist/build-info.json +2 -2
- package/apps/cli/dist/command-tree.js +3 -1
- package/apps/cli/dist/output.js +5 -2
- package/apps/cli/dist/playboard.js +11 -2
- package/dist/public/executor-kernel.d.ts +2 -2
- package/dist/public/executor-kernel.js +1 -1
- package/dist/public/protocol.d.ts +1 -1
- package/dist/public/protocol.js +1 -1
- 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/dist/app-server.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.js +200 -106
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/async-questions.d.ts +27 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/async-questions.js +205 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/stdin-writer.d.ts +30 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/stdin-writer.js +223 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-V5W6ZTYC.js → chunk-FGFEM7JP.js} +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-CFKMMCO6.js → chunk-R3PDZLX5.js} +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-LO34KB7D.js → chunk-TSRZVLIG.js} +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/dsh-sdk-NOTICE.txt +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.js +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.js +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/trajectory.js +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +5 -5
- 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/gateway.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/gateway.js +57 -13
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.d.ts +3 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.js +4 -2
- 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.js +2 -0
- 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/command-tree.js +3 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +5 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +11 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +24 -24
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/launchd.d.ts +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/launchd.js +12 -11
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/experience.js +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.d.ts +5 -4
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +7 -4
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/invoke-input.js +9 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/watchdog.js +6 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/async-question-reply.d.ts +30 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/async-question-reply.js +199 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/host-run-service.js +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.js +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/rpc.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/rpc.js +16 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +36 -19
- 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 +6 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/contracts.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.js +14 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/channel.js +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/interaction-card.js +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/session-command.d.ts +9 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/session-command.js +71 -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/dist/application/im-channel.js +14 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/assets/{index-B127MhT-.js → index-BVxePruX.js} +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/index.html +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/context-loader.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/browser.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/browser.js +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context.js +4 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.js +63 -12
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +110 -5
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.d.ts +7 -4
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.js +28 -6
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-input.js +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/questions.d.ts +9 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/questions.js +84 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/run-protocol.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/run-protocol.js +11 -5
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
- package/package.json +27 -27
- package/packages/octo-runtime-protocol/schema/protocol.schema.json +156 -4
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
function exactCommand(text) {
|
|
2
|
+
const command = text.trim();
|
|
3
|
+
return command === "/reset" || command === "/new" || command === "/stop" ? command : null;
|
|
4
|
+
}
|
|
5
|
+
function splitsSurrogate(text, offset) {
|
|
6
|
+
const before = text.charCodeAt(offset - 1), after = text.charCodeAt(offset);
|
|
7
|
+
return before >= 0xd800 && before <= 0xdbff && after >= 0xdc00 && after <= 0xdfff;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 在 Gateway 已完成消息准入后解析当前纯文本;不改变原文,不从名称补造授权。
|
|
11
|
+
* 只有剥离原生提及前缀后的完整输入才是控制命令,含 /stop 的语义文本仍交给 AgentRun。
|
|
12
|
+
*/
|
|
13
|
+
export function sessionCommand(message, botId) {
|
|
14
|
+
if (![2, 5].includes(message.channelType) || message.payload.type !== 1)
|
|
15
|
+
return null;
|
|
16
|
+
const text = message.payload.content, raw = message.payload.mention;
|
|
17
|
+
if (typeof text !== "string" || !raw || typeof raw !== "object" || Array.isArray(raw))
|
|
18
|
+
return null;
|
|
19
|
+
const mention = raw;
|
|
20
|
+
const flag = (value) => value === 1 || value === true;
|
|
21
|
+
// ais 会把 Bot UID 展开到 uids;广播与直接点名混合也不能操作会话。
|
|
22
|
+
if ([mention.all, mention.ais, mention.humans].some(flag) || !Array.isArray(mention.uids))
|
|
23
|
+
return null;
|
|
24
|
+
const uids = new Set(mention.uids);
|
|
25
|
+
if (!uids.has(botId))
|
|
26
|
+
return null;
|
|
27
|
+
if (mention.entities === undefined)
|
|
28
|
+
return exactCommand(text);
|
|
29
|
+
if (!Array.isArray(mention.entities))
|
|
30
|
+
return null;
|
|
31
|
+
if (!mention.entities.length)
|
|
32
|
+
return exactCommand(text);
|
|
33
|
+
const entities = [];
|
|
34
|
+
for (const rawEntity of mention.entities) {
|
|
35
|
+
if (!rawEntity || typeof rawEntity !== "object" || Array.isArray(rawEntity))
|
|
36
|
+
return null;
|
|
37
|
+
const entity = rawEntity;
|
|
38
|
+
const { uid, offset, length } = entity;
|
|
39
|
+
if (typeof uid !== "string" ||
|
|
40
|
+
!uid ||
|
|
41
|
+
!uids.has(uid) ||
|
|
42
|
+
typeof offset !== "number" ||
|
|
43
|
+
!Number.isSafeInteger(offset) ||
|
|
44
|
+
offset < 0 ||
|
|
45
|
+
typeof length !== "number" ||
|
|
46
|
+
!Number.isSafeInteger(length) ||
|
|
47
|
+
length <= 1 ||
|
|
48
|
+
offset + length > text.length ||
|
|
49
|
+
splitsSurrogate(text, offset) ||
|
|
50
|
+
splitsSurrogate(text, offset + length) ||
|
|
51
|
+
text[offset] !== "@" ||
|
|
52
|
+
!text.slice(offset + 1, offset + length).trim())
|
|
53
|
+
return null;
|
|
54
|
+
entities.push({ uid, offset, length });
|
|
55
|
+
}
|
|
56
|
+
entities.sort((left, right) => left.offset - right.offset);
|
|
57
|
+
let end = 0;
|
|
58
|
+
for (const entity of entities) {
|
|
59
|
+
if (entity.offset < end)
|
|
60
|
+
return null;
|
|
61
|
+
end = entity.offset + entity.length;
|
|
62
|
+
}
|
|
63
|
+
let cursor = 0, directlyMentioned = false;
|
|
64
|
+
for (const entity of entities) {
|
|
65
|
+
if (text.slice(cursor, entity.offset).trim())
|
|
66
|
+
break;
|
|
67
|
+
cursor = entity.offset + entity.length;
|
|
68
|
+
directlyMentioned ||= entity.uid === botId;
|
|
69
|
+
}
|
|
70
|
+
return directlyMentioned ? exactCommand(text.slice(cursor)) : null;
|
|
71
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-extra-channel-gateway",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"docs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.
|
|
26
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
27
|
-
"@mininglamp-oss/octo-runtime-executor-core": "1.1.
|
|
28
|
-
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.
|
|
29
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
25
|
+
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.9",
|
|
26
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.9",
|
|
27
|
+
"@mininglamp-oss/octo-runtime-executor-core": "1.1.9",
|
|
28
|
+
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.9",
|
|
29
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.9",
|
|
30
30
|
"mdast-util-from-markdown": "2.1.0",
|
|
31
31
|
"ws": "8.22.0"
|
|
32
32
|
}
|
package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/application/im-channel.js
CHANGED
|
@@ -433,6 +433,7 @@ export class ImRuntime {
|
|
|
433
433
|
if (!entry ||
|
|
434
434
|
entry.key !== key ||
|
|
435
435
|
entry.senderId !== message.senderId ||
|
|
436
|
+
entry.request.expiresAt === undefined ||
|
|
436
437
|
!Number.isFinite(Date.parse(entry.request.expiresAt)) ||
|
|
437
438
|
Date.parse(entry.request.expiresAt) <= Date.now()) {
|
|
438
439
|
await this.#reply(message, "该交互已失效或不属于当前会话。", `interaction:${message.messageId}`);
|
|
@@ -531,6 +532,7 @@ export class ImRuntime {
|
|
|
531
532
|
let presentationFailed = false;
|
|
532
533
|
let executionStarted = false;
|
|
533
534
|
let localFailure;
|
|
535
|
+
const ignoredAsyncQuestions = new Set();
|
|
534
536
|
try {
|
|
535
537
|
presentation = message.beginPresentation?.(request.runId, (code) => this.#diagnostic(code, request.runId), controls);
|
|
536
538
|
presentation?.update(projector.snapshot());
|
|
@@ -541,6 +543,18 @@ export class ImRuntime {
|
|
|
541
543
|
})) {
|
|
542
544
|
if (this.#closed || this.#signal.aborted)
|
|
543
545
|
break;
|
|
546
|
+
// 企微尚未接入异步表单;在登记、提示和状态投影前成对过滤,正文继续正常交付。
|
|
547
|
+
// resolved 不带 delivery,须用本轮 requested 的身份识别,避免覆盖同步交互的等待状态。
|
|
548
|
+
if (event.type === "interaction.requested" && event.payload.delivery === "async") {
|
|
549
|
+
if (ignoredAsyncQuestions.size >= 64 &&
|
|
550
|
+
!ignoredAsyncQuestions.has(event.payload.interactionId))
|
|
551
|
+
throw new Error("IM_INTERACTION_CAPACITY_EXHAUSTED");
|
|
552
|
+
ignoredAsyncQuestions.add(event.payload.interactionId);
|
|
553
|
+
continue;
|
|
554
|
+
}
|
|
555
|
+
if (event.type === "interaction.resolved" &&
|
|
556
|
+
ignoredAsyncQuestions.delete(event.payload.interactionId))
|
|
557
|
+
continue;
|
|
544
558
|
if (event.type === "session.update" && session.id === request.sessionId) {
|
|
545
559
|
session.providerSession = event.payload.providerSession;
|
|
546
560
|
this.#saveBinding(key, session);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-extra-channel-wecom",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"docs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.
|
|
26
|
-
"@mininglamp-oss/octo-runtime-executor-core": "1.1.
|
|
27
|
-
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.
|
|
25
|
+
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.9",
|
|
26
|
+
"@mininglamp-oss/octo-runtime-executor-core": "1.1.9",
|
|
27
|
+
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.9",
|
|
28
28
|
"ws": "8.22.0",
|
|
29
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
29
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.9"
|
|
30
30
|
}
|
|
31
31
|
}
|