@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.
Files changed (100) hide show
  1. package/apps/cli/README.md +3 -1
  2. package/apps/cli/dist/build-info.json +2 -2
  3. package/apps/cli/dist/command-tree.js +3 -1
  4. package/apps/cli/dist/output.js +5 -2
  5. package/apps/cli/dist/playboard.js +11 -2
  6. package/dist/public/executor-kernel.d.ts +2 -2
  7. package/dist/public/executor-kernel.js +1 -1
  8. package/dist/public/protocol.d.ts +1 -1
  9. package/dist/public/protocol.js +1 -1
  10. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
  11. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
  12. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
  13. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
  14. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
  15. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.d.ts +1 -0
  16. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.js +200 -106
  17. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/async-questions.d.ts +27 -0
  18. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/async-questions.js +205 -0
  19. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/stdin-writer.d.ts +30 -0
  20. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/stdin-writer.js +223 -0
  21. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
  22. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-V5W6ZTYC.js → chunk-FGFEM7JP.js} +1 -1
  23. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-CFKMMCO6.js → chunk-R3PDZLX5.js} +3 -3
  24. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-LO34KB7D.js → chunk-TSRZVLIG.js} +1 -1
  25. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/dsh-sdk-NOTICE.txt +2 -2
  26. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.js +1 -1
  27. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.js +5 -5
  28. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.js +2 -2
  29. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/trajectory.js +2 -2
  30. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/package.json +3 -3
  31. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +5 -5
  32. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
  33. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
  34. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
  35. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/gateway.d.ts +3 -0
  36. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/gateway.js +57 -13
  37. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.d.ts +3 -2
  38. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.js +4 -2
  39. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
  40. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
  41. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +2 -2
  42. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +2 -2
  43. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/approval.js +2 -0
  44. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +2 -2
  45. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +3 -3
  46. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
  47. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/command-tree.js +3 -1
  48. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +5 -2
  49. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +11 -2
  50. package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +24 -24
  51. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/launchd.d.ts +2 -2
  52. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/launchd.js +12 -11
  53. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +1 -1
  54. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/experience.js +2 -1
  55. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.d.ts +5 -4
  56. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +7 -4
  57. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/invoke-input.js +9 -2
  58. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/watchdog.js +6 -3
  59. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
  60. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/async-question-reply.d.ts +30 -0
  61. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/async-question-reply.js +199 -0
  62. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/host-run-service.js +2 -2
  63. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.d.ts +1 -0
  64. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.js +1 -0
  65. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/rpc.d.ts +2 -0
  66. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/rpc.js +16 -3
  67. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +36 -19
  68. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +4 -4
  69. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.js +6 -2
  70. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/contracts.d.ts +2 -0
  71. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.js +14 -0
  72. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/channel.js +4 -0
  73. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/interaction-card.js +2 -1
  74. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/session-command.d.ts +9 -0
  75. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/session-command.js +71 -0
  76. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +6 -6
  77. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/application/im-channel.js +14 -0
  78. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +5 -5
  79. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/assets/{index-B127MhT-.js → index-BVxePruX.js} +1 -1
  80. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/index.html +1 -1
  81. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +2 -2
  82. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/context-loader.js +1 -1
  83. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +4 -4
  84. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/browser.d.ts +1 -0
  85. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/browser.js +1 -0
  86. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context.d.ts +2 -0
  87. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context.js +4 -1
  88. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.d.ts +3 -0
  89. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.js +63 -12
  90. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +110 -5
  91. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.d.ts +7 -4
  92. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.js +28 -6
  93. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-input.js +2 -0
  94. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/questions.d.ts +9 -0
  95. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/questions.js +84 -0
  96. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/run-protocol.d.ts +1 -1
  97. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/run-protocol.js +11 -5
  98. package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
  99. package/package.json +27 -27
  100. 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.8",
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.8",
26
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.8",
27
- "@mininglamp-oss/octo-runtime-executor-core": "1.1.8",
28
- "@mininglamp-oss/octo-runtime-host-sdk": "1.1.8",
29
- "@mininglamp-oss/octo-runtime-protocol": "1.1.8",
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
  }
@@ -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.8",
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.8",
26
- "@mininglamp-oss/octo-runtime-executor-core": "1.1.8",
27
- "@mininglamp-oss/octo-runtime-executor-kernel": "1.1.8",
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.8"
29
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.9"
30
30
  }
31
31
  }