@mininglamp-oss/octo-runtime 1.1.0 → 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.
Files changed (149) hide show
  1. package/README.md +4 -2
  2. package/apps/cli/README.md +3 -1
  3. package/apps/cli/dist/build-info.json +2 -2
  4. package/apps/cli/dist/extras.d.ts +4 -2
  5. package/apps/cli/dist/extras.js +20 -21
  6. package/apps/cli/dist/help.js +3 -0
  7. package/apps/cli/dist/logs.d.ts +10 -0
  8. package/apps/cli/dist/logs.js +186 -0
  9. package/apps/cli/dist/main.d.ts +1 -0
  10. package/apps/cli/dist/main.js +94 -19
  11. package/apps/cli/dist/{default_adapters.json → manifest.json} +10 -0
  12. package/apps/cli/dist/module-manifest.d.ts +3 -0
  13. package/apps/cli/dist/module-manifest.js +11 -0
  14. package/apps/cli/dist/openclaw.js +30 -6
  15. package/apps/cli/dist/output.js +3 -0
  16. package/apps/cli/dist/playboard.js +10 -8
  17. package/apps/cli/dist/status-output.d.ts +10 -0
  18. package/apps/cli/dist/status-output.js +65 -0
  19. package/apps/cli/dist/worker.d.ts +1 -0
  20. package/apps/cli/dist/worker.js +18 -0
  21. package/dist/public/host.d.ts +1 -0
  22. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
  23. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
  24. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
  25. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
  26. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
  27. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
  28. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/adapter.d.ts +54 -0
  29. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/adapter.js +399 -0
  30. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/client.d.ts +14 -0
  31. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/client.js +156 -0
  32. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/index.d.ts +29 -0
  33. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/index.js +273 -0
  34. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/interactions.d.ts +27 -0
  35. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/interactions.js +161 -0
  36. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +17 -0
  37. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
  38. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
  39. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
  40. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/compatibility.d.ts +24 -0
  41. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/compatibility.js +181 -0
  42. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/gateway.d.ts +9 -0
  43. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/gateway.js +24 -8
  44. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.js +229 -225
  45. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
  46. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
  47. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +2 -2
  48. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +2 -2
  49. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/approval.d.ts +4 -0
  50. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/approval.js +5 -6
  51. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +1 -0
  52. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.js +1 -0
  53. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/module-manifest.d.ts +33 -0
  54. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/module-manifest.js +118 -0
  55. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log-worker.js +7 -5
  56. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log.d.ts +3 -0
  57. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log.js +45 -10
  58. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.d.ts +11 -0
  59. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.js +70 -0
  60. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +5 -3
  61. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +3 -3
  62. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
  63. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extras.d.ts +4 -2
  64. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extras.js +20 -21
  65. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/help.js +3 -0
  66. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/logs.d.ts +10 -0
  67. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/logs.js +186 -0
  68. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.d.ts +1 -0
  69. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +94 -19
  70. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/{default_adapters.json → manifest.json} +10 -0
  71. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/module-manifest.d.ts +3 -0
  72. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/module-manifest.js +11 -0
  73. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/openclaw.js +30 -6
  74. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +3 -0
  75. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +10 -8
  76. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/status-output.d.ts +10 -0
  77. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/status-output.js +65 -0
  78. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/worker.d.ts +1 -0
  79. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/worker.js +18 -0
  80. package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +23 -9
  81. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +2 -2
  82. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/model-input.d.ts +1 -1
  83. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/model-input.js +13 -9
  84. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
  85. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/heartbeat.d.ts +16 -0
  86. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/heartbeat.js +59 -0
  87. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.d.ts +1 -0
  88. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.js +4 -1
  89. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/manifest-adapters.d.ts +6 -0
  90. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/manifest-adapters.js +88 -0
  91. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/module-specifier.d.ts +1 -2
  92. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/module-specifier.js +2 -9
  93. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.d.ts +7 -2
  94. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.js +138 -9
  95. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runner.js +3 -92
  96. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/serve.js +36 -12
  97. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.d.ts +4 -1
  98. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +14 -6
  99. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.js +2 -1
  100. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.d.ts +2 -2
  101. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.js +57 -34
  102. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +8 -16
  103. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/config-schema.json +2 -2
  104. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.js +18 -18
  105. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/contracts.d.ts +1 -0
  106. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.js +24 -0
  107. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/contexts.js +2 -2
  108. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/mentions.d.ts +5 -2
  109. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/mentions.js +19 -5
  110. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/normalize.js +1 -0
  111. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +6 -6
  112. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/config-schema.json +2 -2
  113. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +5 -5
  114. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/config-schema.json +2 -2
  115. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/index.js +1 -1
  116. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/store.d.ts +4 -1
  117. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/store.js +54 -4
  118. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +2 -2
  119. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-config.d.ts +8 -1
  120. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-config.js +27 -12
  121. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-service.js +39 -2
  122. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.d.ts +1 -0
  123. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +4 -4
  124. package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
  125. package/node_modules/import-meta-resolve/index.d.ts +19 -0
  126. package/node_modules/import-meta-resolve/index.d.ts.map +1 -0
  127. package/node_modules/import-meta-resolve/index.js +47 -0
  128. package/node_modules/import-meta-resolve/lib/errors.d.ts +24 -0
  129. package/node_modules/import-meta-resolve/lib/errors.d.ts.map +1 -0
  130. package/node_modules/import-meta-resolve/lib/errors.js +504 -0
  131. package/node_modules/import-meta-resolve/lib/get-format.d.ts +13 -0
  132. package/node_modules/import-meta-resolve/lib/get-format.d.ts.map +1 -0
  133. package/node_modules/import-meta-resolve/lib/get-format.js +159 -0
  134. package/node_modules/import-meta-resolve/lib/package-json-reader.d.ts +31 -0
  135. package/node_modules/import-meta-resolve/lib/package-json-reader.d.ts.map +1 -0
  136. package/node_modules/import-meta-resolve/lib/package-json-reader.js +177 -0
  137. package/node_modules/import-meta-resolve/lib/resolve.d.ts +29 -0
  138. package/node_modules/import-meta-resolve/lib/resolve.d.ts.map +1 -0
  139. package/node_modules/import-meta-resolve/lib/resolve.js +1301 -0
  140. package/node_modules/import-meta-resolve/lib/utils.d.ts +6 -0
  141. package/node_modules/import-meta-resolve/lib/utils.d.ts.map +1 -0
  142. package/node_modules/import-meta-resolve/lib/utils.js +47 -0
  143. package/node_modules/import-meta-resolve/license +74 -0
  144. package/node_modules/import-meta-resolve/package.json +78 -0
  145. package/node_modules/import-meta-resolve/readme.md +252 -0
  146. package/package.json +30 -26
  147. package/packages/octo-runtime-extra-channel-gateway/config-schema.json +2 -2
  148. package/packages/octo-runtime-extra-channel-wecom/config-schema.json +2 -2
  149. package/packages/octo-runtime-extra-webui/config-schema.json +2 -2
@@ -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 [
@@ -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 { MENTION_GUIDANCE } from "./mentions.js";
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: MENTION_GUIDANCE,
111
+ guidance: MENTION_REMINDER,
112
112
  payload: {
113
113
  source,
114
114
  actorId: message.fromUid,
@@ -1,11 +1,14 @@
1
1
  import type { MentionEntity } from "./api/types.js";
2
2
  import type { GroupMember } from "./api/conversations.js";
3
- export declare const MENTION_GUIDANCE = "\u4F60\u6B63\u5728\u901A\u8FC7 Octo \u56DE\u590D\u5F53\u524D\u9891\u9053\u3002\u666E\u901A\u56DE\u590D\u4E0D\u8981\u81EA\u52A8 @ \u53D1\u8D77\u8005\u3002\u82E5\u5F53\u524D\u7528\u6237\u660E\u786E\u8981\u6C42\u5728\u4EFB\u52A1\u5B8C\u6210\u540E\u901A\u77E5\u67D0\u4F4D\u771F\u4EBA\uFF0C\u5148\u5B8C\u6210\u4EFB\u52A1\uFF1B\u5728\u6700\u7EC8\u56DE\u7B54\u524D\uFF0C\u786E\u8BA4\u5BF9\u65B9\u5728\u5F53\u524D\u9891\u9053\u4E2D\u7684\u771F\u5B9E UID \u548C\u663E\u793A\u540D\u3002\u4FE1\u606F\u4E0D\u8DB3\u65F6\u6309\u9700\u4F7F\u7528 octo-cli \u67E5\u8BE2\uFF1B\u540C\u540D\u3001\u67E5\u8BE2\u5931\u8D25\u6216\u627E\u4E0D\u5230\u5408\u9002\u76EE\u6807\u65F6\uFF0C\u7531\u4F60\u5224\u65AD\u5E76\u6539\u7528\u666E\u901A @\u540D\u5B57 \u6216\u7EAF\u6587\u672C\uFF0C\u4E0D\u8981\u731C UID\uFF0C\u4E0D\u5FC5\u5F3A\u5236\u8FFD\u95EE\uFF0C\u4E5F\u4E0D\u5FC5\u5C55\u793A\u70B9\u540D\u672A\u5B8C\u6210\u7684\u63D0\u793A\u3002\u80FD\u591F\u786E\u5B9A\u76EE\u6807\u4E14\u9700\u8981\u70B9\u540D\u65F6\uFF0C\u5728 final \u6587\u672C\u7684\u666E\u901A\u6B63\u6587\u4E2D\u8F93\u51FA @[uid:displayName]\uFF0C\u4F8B\u5982 @[user_demo_1:\u5F20\u4E09]\uFF1BChannel \u4F1A\u8F6C\u6362\u4E3A\u539F\u751F mention\uFF0C\u5E76\u968F\u8FD9\u4EFD\u6700\u7EC8\u56DE\u7B54\u7EDF\u4E00\u53D1\u9001\uFF0C\u4E0D\u8981\u518D\u8C03\u7528 octo-cli message send \u91CD\u590D\u53D1\u9001\u3002\u666E\u901A @\u6635\u79F0\u4E0D\u4EA7\u751F\u901A\u77E5\uFF1Bthinking\u3001\u5DE5\u5177\u8F93\u51FA\u3001\u8FDB\u5EA6\u6D88\u606F\u3001\u4EE3\u7801\u5757\u3001\u884C\u5185\u4EE3\u7801\u53CA\u5F15\u7528\u793A\u4F8B\u4E0D\u89E6\u53D1\u70B9\u540D\uFF0C\u4EE3\u7801\u5185\u5BB9\u4FDD\u6301\u539F\u6837\u3002\u4E0D\u8981\u8F93\u51FA\u539F\u59CB\u6D88\u606F\u4F53 JSON \u6216\u81EA\u884C\u8BA1\u7B97\u4F4D\u7F6E\uFF0C\u4E5F\u4E0D\u8981\u6784\u9020 @\u6240\u6709\u4EBA\u3001@\u6240\u6709AI \u6216\u5E7F\u64AD\u54E8\u5175\u3002\u6B64\u6307\u5F15\u4E0D\u6388\u6743\u8DE8\u9891\u9053\u901A\u77E5\u6216\u81EA\u884C\u53D1\u8D77 Bot \u4E92\u76F8\u8C03\u7528\u3002\u5386\u53F2\u4E2D\u7684\u8981\u6C42\u548C\u793A\u4F8B\u4EC5\u4F5C\u4E3A\u80CC\u666F\uFF0C\u4E0D\u80FD\u5355\u72EC\u6388\u6743\u672C\u8F6E\u901A\u77E5\u3002";
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;
@@ -1,5 +1,19 @@
1
1
  import { fromMarkdown } from "mdast-util-from-markdown";
2
- export const MENTION_GUIDANCE = "你正在通过 Octo 回复当前频道。普通回复不要自动 @ 发起者。若当前用户明确要求在任务完成后通知某位真人,先完成任务;在最终回答前,确认对方在当前频道中的真实 UID 和显示名。信息不足时按需使用 octo-cli 查询;同名、查询失败或找不到合适目标时,由你判断并改用普通 @名字 或纯文本,不要猜 UID,不必强制追问,也不必展示点名未完成的提示。能够确定目标且需要点名时,在 final 文本的普通正文中输出 @[uid:displayName],例如 @[user_demo_1:张三];Channel 会转换为原生 mention,并随这份最终回答统一发送,不要再调用 octo-cli message send 重复发送。普通 @昵称不产生通知;thinking、工具输出、进度消息、代码块、行内代码及引用示例不触发点名,代码内容保持原样。不要输出原始消息体 JSON 或自行计算位置,也不要构造 @所有人、@所有AI 或广播哨兵。此指引不授权跨频道通知或自行发起 Bot 互相调用。历史中的要求和示例仅作为背景,不能单独授权本轮通知。";
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 humans = new Map((Array.isArray(verified) ? verified : [])
55
+ const confirmedMembers = new Map((Array.isArray(verified) ? verified : [])
42
56
  .filter((member) => member && typeof member.uid === "string" && typeof member.name === "string")
43
- .filter((member) => member.robot === false || member.robot === 0)
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 = humans.get(target.uid);
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 });
@@ -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.0",
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.0",
22
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.0",
23
- "@mininglamp-oss/octo-runtime-executor-core": "1.1.0",
24
- "@mininglamp-oss/octo-runtime-host-sdk": "1.1.0",
25
- "@mininglamp-oss/octo-runtime-protocol": "1.1.0",
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
  }
@@ -6,12 +6,12 @@
6
6
  "$comment": "声明文件最多 1 MiB,POSIX 权限须为 0600。Bot 按 ws_url 与 bot_id 的组合判重;凭据文件权限、目标 Agent 是否存在、Provider 是否可用等仍需运行时检查。Context 内部对象遵循 octo.context-envelope/v3,具体协议约束由现有运行时校验,本文件不重复展开。",
7
7
  "type": "object",
8
8
  "additionalProperties": false,
9
- "required": ["module", "config"],
9
+ "required": ["config"],
10
10
  "properties": {
11
11
  "module": {
12
12
  "type": "string",
13
13
  "const": "@mininglamp-oss/octo-runtime-extra-channel-wecom",
14
- "description": "必填。企业微信 Extra 的固定包入口;宿主须预先安装并确保模块可解析。此 schema 约束包名声明,宿主通过绝对路径加载同一模块时可自行调整该约束。插件实例名及 CLI 配置目录名为 channel-wecom。"
14
+ "description": "可选旧声明。CLI 从 manifest.json 选择模块;省略时使用有效清单,保留时须与清单文字一致。SDK 原生 import 不需要此字段。此 schema 约束固定包名,宿主使用其他公开路径时可自行调整。"
15
15
  },
16
16
  "enabled": {
17
17
  "type": "boolean",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-extra-channel-wecom",
3
- "version": "1.1.0",
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.0",
22
- "@mininglamp-oss/octo-runtime-executor-core": "1.1.0",
23
- "@mininglamp-oss/octo-runtime-executor-kernel": "1.1.0",
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.0"
25
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.2"
26
26
  }
27
27
  }
@@ -6,12 +6,12 @@
6
6
  "$comment": "声明文件最多 1 MiB,POSIX 权限须为 0600。端口占用、路径可访问性、会话文件内容及文件权限仍需运行时检查。加载生命周期 loaded 不等于监听成功,宿主须检查插件状态中的 listening 与 errors。",
7
7
  "type": "object",
8
8
  "additionalProperties": false,
9
- "required": ["module", "config"],
9
+ "required": ["config"],
10
10
  "properties": {
11
11
  "module": {
12
12
  "type": "string",
13
13
  "const": "@mininglamp-oss/octo-runtime-extra-webui",
14
- "description": "必填。本地 WebUI Extra 的固定包入口;宿主须预先安装并确保模块可解析。此 schema 约束包名声明,宿主通过绝对路径加载同一模块时可自行调整该约束。插件实例名及 CLI 配置目录名为 webui。"
14
+ "description": "可选旧声明。CLI 从 manifest.json 选择模块;省略时使用有效清单,保留时须与清单文字一致。SDK 原生 import 不需要此字段。此 schema 约束固定包名,宿主使用其他公开路径时可自行调整。"
15
15
  },
16
16
  "enabled": {
17
17
  "type": "boolean",
@@ -73,7 +73,7 @@ async function initialize(ctx, config) {
73
73
  errors.push("WEBUI_CONTEXT_INVALID");
74
74
  return;
75
75
  }
76
- const store = new SessionStore(config.sessionStorePath);
76
+ const store = new SessionStore(config.sessionStorePath, ctx.log);
77
77
  try {
78
78
  await store.open();
79
79
  }
@@ -1,3 +1,4 @@
1
+ import type { RuntimeLog } from "@mininglamp-oss/octo-runtime-host-sdk";
1
2
  export interface Session {
2
3
  id: string;
3
4
  title: string;
@@ -14,9 +15,11 @@ export declare function validMessages(value: unknown): value is unknown[];
14
15
  export declare function validBinding(value: unknown): value is Record<string, unknown>;
15
16
  export declare class SessionStore {
16
17
  readonly path: string;
18
+ private readonly log?;
17
19
  records: Session[];
18
20
  private queue;
19
- constructor(path: string);
21
+ constructor(path: string, log?: RuntimeLog | undefined);
22
+ private cleanupError;
20
23
  open(): Promise<void>;
21
24
  change<T>(operation: (records: Session[]) => T): Promise<T>;
22
25
  }
@@ -1,6 +1,26 @@
1
- import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
1
+ import { mkdir, open, readFile, rename, unlink } from "node:fs/promises";
2
2
  import { dirname } from "node:path";
3
3
  import { randomUUID } from "node:crypto";
4
+ import { setTimeout as delay } from "node:timers/promises";
5
+ // 本机 Windows 的瞬态 EPERM 在约 1.6 秒后恢复;只重试替换,不重放业务变更。
6
+ // 最多 8 次替换、3170 ms 退避;文件系统调用和调度本身的耗时不计入退避预算。
7
+ const replacementDelays = [20, 50, 100, 200, 400, 800, 1600];
8
+ async function replace(temporary, destination) {
9
+ for (let attempt = 0;; attempt++) {
10
+ try {
11
+ await rename(temporary, destination);
12
+ return;
13
+ }
14
+ catch (error) {
15
+ // 返回结束重试的实际错误及其原生字段,不能让最初的 EPERM 掩盖后续错误。
16
+ if (process.platform !== "win32" ||
17
+ error.code !== "EPERM" ||
18
+ attempt === replacementDelays.length)
19
+ throw error;
20
+ await delay(replacementDelays[attempt]);
21
+ }
22
+ }
23
+ }
4
24
  export function validMessages(value) {
5
25
  return (Array.isArray(value) &&
6
26
  value.every((message) => {
@@ -24,10 +44,21 @@ export function validBinding(value) {
24
44
  }
25
45
  export class SessionStore {
26
46
  path;
47
+ log;
27
48
  records = [];
28
49
  queue = Promise.resolve();
29
- constructor(path) {
50
+ constructor(path, log) {
30
51
  this.path = path;
52
+ this.log = log;
53
+ }
54
+ cleanupError(event, error) {
55
+ // 清理可能因未释放句柄等原因失败;仅报告错误码,诊断失败不能覆盖保存错误。
56
+ try {
57
+ this.log?.("warn", event, { code: error?.code });
58
+ }
59
+ catch {
60
+ // 日志回调不能改变存储操作的结果。
61
+ }
31
62
  }
32
63
  async open() {
33
64
  try {
@@ -69,8 +100,27 @@ export class SessionStore {
69
100
  throw new Error("WEBUI_STORE_TOO_LARGE");
70
101
  await mkdir(dirname(this.path), { recursive: true, mode: 0o700 });
71
102
  const temporary = `${this.path}.${randomUUID()}.tmp`;
72
- await writeFile(temporary, text, { mode: 0o600, flag: "wx" });
73
- await rename(temporary, this.path);
103
+ // 独占创建成功才取得所有权;open 失败不能删除可能属于其他写入者的文件。
104
+ const handle = await open(temporary, "wx", 0o600);
105
+ try {
106
+ try {
107
+ await handle.writeFile(text);
108
+ }
109
+ catch (error) {
110
+ await handle
111
+ .close()
112
+ .catch((closeError) => this.cleanupError("webui.store.close_failed", closeError));
113
+ throw error;
114
+ }
115
+ // 关闭失败同样是保存失败,不能尝试替换或提交内存。
116
+ await handle.close();
117
+ await replace(temporary, this.path);
118
+ }
119
+ catch (error) {
120
+ await unlink(temporary).catch((cleanupError) => this.cleanupError("webui.store.temporary_cleanup_failed", cleanupError));
121
+ throw error;
122
+ }
123
+ // rename 成功就是提交点;此后没有可能将成功翻转成失败的日志或清理动作。
74
124
  this.records = next;
75
125
  return result;
76
126
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-extra-webui",
3
- "version": "1.1.0",
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.0"
22
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.2"
23
23
  }
24
24
  }
@@ -6,8 +6,15 @@ export interface ExtraDescriptor {
6
6
  enabled?: boolean;
7
7
  config: JsonObject;
8
8
  }
9
- export type StoredExtra = Omit<ExtraDescriptor, "name">;
9
+ /** CLI 配置可由 manifest 提供模块;原生代码声明 ExtraDescriptor 仍显式指定模块。 */
10
+ export interface StoredExtra {
11
+ module?: string;
12
+ enabled?: boolean;
13
+ config: JsonObject;
14
+ }
10
15
  export declare function assertStoredExtra(value: unknown): asserts value is StoredExtra;
11
16
  export declare function extraRegistration(descriptor: ExtraDescriptor): ExtraRegistration;
12
17
  /** Called only by a host that explicitly selects this directory as its source. */
13
18
  export declare function readExtraDirectory(directory: string): Promise<ExtraRegistration[]>;
19
+ /** 宿主显式选取的配置文件;保持凭据权限校验,不解析或导入模块。 */
20
+ export declare function readStoredExtra(directory: string, name: string): Promise<StoredExtra>;
@@ -8,7 +8,7 @@ export function assertStoredExtra(value) {
8
8
  const item = value;
9
9
  if (Object.keys(item).some((key) => !["module", "enabled", "config"].includes(key)))
10
10
  throw new Error("EXTRA_CONFIG_FIELD_INVALID");
11
- if (typeof item.module !== "string" || !validModule(item.module))
11
+ if (item.module !== undefined && (typeof item.module !== "string" || !validModule(item.module)))
12
12
  throw new Error("EXTRA_MODULE_INVALID");
13
13
  if (item.enabled !== undefined && typeof item.enabled !== "boolean")
14
14
  throw new Error("EXTRA_ENABLED_INVALID");
@@ -35,12 +35,15 @@ export function extraRegistration(descriptor) {
35
35
  assertExtraName(descriptor.name);
36
36
  const { name, ...stored } = descriptor;
37
37
  assertStoredExtra(stored);
38
+ const module = stored.module;
39
+ if (!module)
40
+ throw new Error("EXTRA_MODULE_REQUIRED");
38
41
  return {
39
42
  name,
40
- module: stored.module,
43
+ module,
41
44
  config: stored.config,
42
45
  enabled: stored.enabled,
43
- load: () => import(isAbsolute(stored.module) ? pathToFileURL(stored.module).href : stored.module)
46
+ load: () => import(isAbsolute(module) ? pathToFileURL(module).href : module)
44
47
  };
45
48
  }
46
49
  /** Called only by a host that explicitly selects this directory as its source. */
@@ -56,15 +59,14 @@ export async function readExtraDirectory(directory) {
56
59
  continue;
57
60
  assertExtraName(entry.name);
58
61
  try {
59
- const file = join(directory, entry.name, "config.json");
60
- const info = await lstat(file);
61
- if (!info.isFile() || (process.platform !== "win32" && info.mode & 0o077))
62
- throw new Error("EXTRA_CONFIG_PERMISSIONS_INVALID");
63
- if (info.size > 1024 * 1024)
64
- throw new Error("EXTRA_CONFIG_TOO_LARGE");
65
- const stored = JSON.parse(await readFile(file, "utf8"));
66
- assertStoredExtra(stored);
67
- registrations.push(extraRegistration({ name: entry.name, ...stored }));
62
+ const stored = await readStoredExtra(directory, entry.name);
63
+ registrations.push(stored.module
64
+ ? extraRegistration({ ...stored, name: entry.name, module: stored.module })
65
+ : {
66
+ ...stored,
67
+ name: entry.name,
68
+ load: () => Promise.reject(new Error("EXTRA_MODULE_REQUIRED"))
69
+ });
68
70
  }
69
71
  catch (error) {
70
72
  const code = error instanceof Error && /^EXTRA_[A-Z_]+$/.test(error.message)
@@ -79,6 +81,19 @@ export async function readExtraDirectory(directory) {
79
81
  }
80
82
  return registrations;
81
83
  }
84
+ /** 宿主显式选取的配置文件;保持凭据权限校验,不解析或导入模块。 */
85
+ export async function readStoredExtra(directory, name) {
86
+ assertExtraName(name);
87
+ const file = join(directory, name, "config.json");
88
+ const info = await lstat(file);
89
+ if (!info.isFile() || (process.platform !== "win32" && info.mode & 0o077))
90
+ throw new Error("EXTRA_CONFIG_PERMISSIONS_INVALID");
91
+ if (info.size > 1024 * 1024)
92
+ throw new Error("EXTRA_CONFIG_TOO_LARGE");
93
+ const stored = JSON.parse(await readFile(file, "utf8"));
94
+ assertStoredExtra(stored);
95
+ return stored;
96
+ }
82
97
  function validModule(module) {
83
98
  if (isAbsolute(module))
84
99
  return true;
@@ -54,6 +54,35 @@ export function createExtraService(options) {
54
54
  let server;
55
55
  let binding;
56
56
  let release;
57
+ let healthTimer;
58
+ let healthCheck;
59
+ let lastAvailable;
60
+ const logState = (event, state, code) => logs?.extra(name)(code ? "warn" : "info", event, { state, ...(code ? { code } : {}) });
61
+ const kernelAvailable = () => {
62
+ if (healthCheck)
63
+ return healthCheck;
64
+ healthCheck = (client?.status().then((value) => value.execution_ready, () => false) ?? Promise.resolve(false))
65
+ .then((available) => {
66
+ if (!owner.signal.aborted && available !== lastAvailable) {
67
+ lastAvailable = available;
68
+ logState(available ? "kernel.available" : "kernel.unavailable", available ? "available" : "unavailable");
69
+ }
70
+ return available;
71
+ })
72
+ .finally(() => {
73
+ healthCheck = undefined;
74
+ });
75
+ return healthCheck;
76
+ };
77
+ const watchKernel = () => {
78
+ // Allow one probe at a time and schedule after settlement; emit transitions, not idle heartbeats.
79
+ void kernelAvailable().finally(() => {
80
+ if (owner.signal.aborted || !logging)
81
+ return;
82
+ healthTimer = setTimeout(watchKernel, 5000);
83
+ healthTimer.unref();
84
+ });
85
+ };
57
86
  const sockets = new Set();
58
87
  let finishClosed;
59
88
  const closed = new Promise((resolve) => {
@@ -63,7 +92,7 @@ export function createExtraService(options) {
63
92
  phase,
64
93
  name,
65
94
  pid: process.pid,
66
- kernel_available: (await client?.status().then((value) => value.execution_ready, () => false)) ?? false,
95
+ kernel_available: await kernelAvailable(),
67
96
  plugin: !enabled
68
97
  ? { phase: "disabled" }
69
98
  : phase === "ready" && plugins
@@ -95,6 +124,8 @@ export function createExtraService(options) {
95
124
  if (closing)
96
125
  return closing;
97
126
  phase = "closing";
127
+ logState("service.closing", phase);
128
+ clearTimeout(healthTimer);
98
129
  shutdownUntil ??= shutdownDeadline();
99
130
  const draining = beginDrain();
100
131
  owner.abort();
@@ -139,7 +170,6 @@ export function createExtraService(options) {
139
170
  });
140
171
  });
141
172
  client?.close();
142
- await attempt("logs", () => logs?.close());
143
173
  if (!errors.length)
144
174
  await attempt("control-endpoint", async () => {
145
175
  if (!release)
@@ -148,6 +178,8 @@ export function createExtraService(options) {
148
178
  await rm(controlEndpoint, { force: true });
149
179
  await release();
150
180
  });
181
+ logState(errors.length ? "service.cleanup_incomplete" : "service.closed", errors.length ? "failed" : "closed", errors.length ? "EXTRA_CLEANUP_INCOMPLETE" : undefined);
182
+ await attempt("logs", () => logs?.close());
151
183
  if (acquired) {
152
184
  if (errors.length)
153
185
  ownership.failed = true;
@@ -202,6 +234,9 @@ export function createExtraService(options) {
202
234
  acquired = true;
203
235
  client = attachKernel({ endpoint });
204
236
  logs = new RuntimeLogging(logging);
237
+ logState("service.initializing", phase);
238
+ if (logging)
239
+ watchKernel();
205
240
  plugins = new ExtraPlugins([], client, () => logs.extra(name));
206
241
  if (enabled)
207
242
  await plugins.load({
@@ -257,9 +292,11 @@ export function createExtraService(options) {
257
292
  owner.signal.throwIfAborted();
258
293
  }
259
294
  phase = "ready";
295
+ logState("service.ready", phase);
260
296
  })();
261
297
  initialized = Promise.race([starting, cancelled])
262
298
  .catch(async (error) => {
299
+ logState("service.failed", "failed", "SERVICE_INITIALIZATION_FAILED");
263
300
  throw new ServiceInitializationError(error, await close());
264
301
  })
265
302
  .finally(() => {
@@ -1,4 +1,5 @@
1
1
  export { RUNTIME_RUN_CONTRACT } from "@mininglamp-oss/octo-runtime-protocol";
2
+ export type { RuntimeLoggingOptions, ExtraStatusRecord } from "@mininglamp-oss/octo-runtime-adapter-sdk";
2
3
  export * from "./extras.js";
3
4
  export * from "./extra-config.js";
4
5
  export * from "./context-loader.js";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-host-sdk",
3
- "version": "1.1.0",
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.0",
23
- "@mininglamp-oss/octo-runtime-executor-kernel": "1.1.0",
24
- "@mininglamp-oss/octo-runtime-protocol": "1.1.0"
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": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-protocol",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Match `import.meta.resolve` except that `parent` is required (you can pass
3
+ * `import.meta.url`).
4
+ *
5
+ * @param {string} specifier
6
+ * The module specifier to resolve relative to parent
7
+ * (`/example.js`, `./example.js`, `../example.js`, `some-package`, `fs`,
8
+ * etc).
9
+ * @param {string} parent
10
+ * The absolute parent module URL to resolve from.
11
+ * You must pass `import.meta.url` or something else.
12
+ * @returns {string}
13
+ * Returns a string to a full `file:`, `data:`, or `node:` URL
14
+ * to the found thing.
15
+ */
16
+ export function resolve(specifier: string, parent: string): string;
17
+ export { moduleResolve } from "./lib/resolve.js";
18
+ export type ErrnoException = import("./lib/errors.js").ErrnoException;
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;GAcG;AACH,mCAXW,MAAM,UAIN,MAAM,GAGJ,MAAM,CA2BlB;;6BA7CY,OAAO,iBAAiB,EAAE,cAAc"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @typedef {import('./lib/errors.js').ErrnoException} ErrnoException
3
+ */
4
+
5
+ import {defaultResolve} from './lib/resolve.js'
6
+
7
+ export {moduleResolve} from './lib/resolve.js'
8
+
9
+ /**
10
+ * Match `import.meta.resolve` except that `parent` is required (you can pass
11
+ * `import.meta.url`).
12
+ *
13
+ * @param {string} specifier
14
+ * The module specifier to resolve relative to parent
15
+ * (`/example.js`, `./example.js`, `../example.js`, `some-package`, `fs`,
16
+ * etc).
17
+ * @param {string} parent
18
+ * The absolute parent module URL to resolve from.
19
+ * You must pass `import.meta.url` or something else.
20
+ * @returns {string}
21
+ * Returns a string to a full `file:`, `data:`, or `node:` URL
22
+ * to the found thing.
23
+ */
24
+ export function resolve(specifier, parent) {
25
+ if (!parent) {
26
+ throw new Error(
27
+ 'Please pass `parent`: `import-meta-resolve` cannot ponyfill that'
28
+ )
29
+ }
30
+
31
+ try {
32
+ return defaultResolve(specifier, {parentURL: parent}).url
33
+ } catch (error) {
34
+ // See: <https://github.com/nodejs/node/blob/45f5c9b/lib/internal/modules/esm/initialize_import_meta.js#L34>
35
+ const exception = /** @type {ErrnoException} */ (error)
36
+
37
+ if (
38
+ (exception.code === 'ERR_UNSUPPORTED_DIR_IMPORT' ||
39
+ exception.code === 'ERR_MODULE_NOT_FOUND') &&
40
+ typeof exception.url === 'string'
41
+ ) {
42
+ return exception.url
43
+ }
44
+
45
+ throw error
46
+ }
47
+ }