@mininglamp-oss/octo-runtime 1.1.6 → 1.1.8
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/dist/public/dsh.d.ts +1 -1
- package/dist/public/dsh.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/dist/index.d.ts +9 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.js +17 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/dist/index.d.ts +20 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/dist/index.d.ts +32 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/dist/index.js +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/dist/index.d.ts +16 -2
- 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.js +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.d.ts +32 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-IW62UM3C.js → chunk-CFKMMCO6.js} +5 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-FWAPYRV2.js → chunk-LO34KB7D.js} +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-3GXX5VD5.js → chunk-V5W6ZTYC.js} +14 -6
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.d.ts +4 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.js +3 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.d.ts +17 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.js +8 -6
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.d.ts +1 -0
- 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 +4 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/adapter.d.ts +9 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/index.d.ts +10 -6
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/dist/index.d.ts +9 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/dist/index.d.ts +9 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/dist/index.d.ts +9 -1
- 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 +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/compatibility.js +12 -40
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.d.ts +22 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.js +422 -135
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.d.ts +6 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.js +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/dist/index.d.ts +9 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/dist/index.d.ts +9 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +19 -5
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.js +8 -5
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/public-display.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/public-display.js +22 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log.js +20 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.js +14 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/index.d.ts +20 -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/package.json +24 -24
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/runner.d.ts +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/runner.js +102 -52
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/windows-task.js +8 -3
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +5 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.d.ts +4 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/invoke-input.js +2 -0
- 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 +9 -6
- 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/config-schema.json +8 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/context-gap.d.ts +17 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/context-gap.js +22 -6
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/history-context.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/history-context.js +27 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.js +447 -241
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/rules-context.d.ts +5 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/rules-context.js +42 -4
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/session-store.d.ts +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/stable-context.d.ts +15 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/stable-context.js +28 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/contracts.d.ts +17 -7
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifact-policy.d.ts +4 -5
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifact-policy.js +12 -9
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifacts.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifacts.js +7 -5
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/dispatcher.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/dispatcher.js +29 -6
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/identity.d.ts +15 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/identity.js +36 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/scheduler.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/scheduler.js +10 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/send-error.d.ts +6 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/send-error.js +10 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.d.ts +5 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.js +36 -22
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/extra.js +14 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/lifecycle/configuration.js +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/run-projector.d.ts +5 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/run-projector.js +265 -38
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/cards.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/cards.js +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/client.d.ts +7 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/client.js +19 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/conversations.d.ts +3 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/conversations.js +4 -3
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/errors.d.ts +0 -12
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/errors.js +5 -3
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/files.d.ts +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/files.js +8 -6
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/messages.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/messages.js +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/card-session.d.ts +5 -4
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/card-session.js +76 -20
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/channel.d.ts +19 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/channel.js +197 -66
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connection-error.js +2 -4
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connector.d.ts +5 -6
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connector.js +52 -36
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/contexts.d.ts +2 -6
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/contexts.js +53 -82
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/history-content.d.ts +12 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/history-content.js +133 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/history-messages.d.ts +21 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/history-messages.js +76 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/mentions.d.ts +0 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/mentions.js +0 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-identities.d.ts +16 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-identities.js +74 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-time.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-time.js +19 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-trigger.d.ts +7 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-trigger.js +90 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/reasoning-frame.js +44 -9
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/retry-after.d.ts +6 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/retry-after.js +60 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/wukong.d.ts +0 -10
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/wukong.js +19 -127
- 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 +10 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/extra.js +14 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/transport/channel.js +2 -3
- 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-CXTvRGim.js → index-B127MhT-.js} +10 -9
- 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.d.ts +3 -2
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/context-loader.js +11 -4
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context.js +8 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +9 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.js +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-input.d.ts +6 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-input.js +14 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
- package/node_modules/iconv-lite/LICENSE +21 -0
- package/node_modules/iconv-lite/README.md +138 -0
- package/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
- package/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
- package/node_modules/iconv-lite/encodings/index.js +23 -0
- package/node_modules/iconv-lite/encodings/internal.js +218 -0
- package/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
- package/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/node_modules/iconv-lite/encodings/sbcs-data.js +180 -0
- package/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
- package/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/node_modules/iconv-lite/encodings/utf16.js +187 -0
- package/node_modules/iconv-lite/encodings/utf32.js +314 -0
- package/node_modules/iconv-lite/encodings/utf7.js +283 -0
- package/node_modules/iconv-lite/lib/bom-handling.js +48 -0
- package/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
- package/node_modules/iconv-lite/lib/index.d.ts +129 -0
- package/node_modules/iconv-lite/lib/index.js +182 -0
- package/node_modules/iconv-lite/lib/streams.js +105 -0
- package/node_modules/iconv-lite/package.json +70 -0
- package/node_modules/iconv-lite/types/encodings.d.ts +425 -0
- package/node_modules/safer-buffer/LICENSE +21 -0
- package/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- package/node_modules/safer-buffer/Readme.md +156 -0
- package/node_modules/safer-buffer/dangerous.js +58 -0
- package/node_modules/safer-buffer/package.json +34 -0
- package/node_modules/safer-buffer/safer.js +77 -0
- package/node_modules/safer-buffer/tests.js +406 -0
- package/node_modules/semver/LICENSE +15 -0
- package/node_modules/semver/README.md +680 -0
- package/node_modules/semver/bin/semver.js +195 -0
- package/node_modules/semver/classes/comparator.js +143 -0
- package/node_modules/semver/classes/index.js +7 -0
- package/node_modules/semver/classes/range.js +577 -0
- package/node_modules/semver/classes/semver.js +350 -0
- package/node_modules/semver/functions/clean.js +8 -0
- package/node_modules/semver/functions/cmp.js +54 -0
- package/node_modules/semver/functions/coerce.js +62 -0
- package/node_modules/semver/functions/compare-build.js +9 -0
- package/node_modules/semver/functions/compare-loose.js +5 -0
- package/node_modules/semver/functions/compare.js +7 -0
- package/node_modules/semver/functions/diff.js +60 -0
- package/node_modules/semver/functions/eq.js +5 -0
- package/node_modules/semver/functions/gt.js +5 -0
- package/node_modules/semver/functions/gte.js +5 -0
- package/node_modules/semver/functions/inc.js +21 -0
- package/node_modules/semver/functions/lt.js +5 -0
- package/node_modules/semver/functions/lte.js +5 -0
- package/node_modules/semver/functions/major.js +5 -0
- package/node_modules/semver/functions/minor.js +5 -0
- package/node_modules/semver/functions/neq.js +5 -0
- package/node_modules/semver/functions/parse.js +18 -0
- package/node_modules/semver/functions/patch.js +5 -0
- package/node_modules/semver/functions/prerelease.js +8 -0
- package/node_modules/semver/functions/rcompare.js +5 -0
- package/node_modules/semver/functions/rsort.js +5 -0
- package/node_modules/semver/functions/satisfies.js +12 -0
- package/node_modules/semver/functions/sort.js +5 -0
- package/node_modules/semver/functions/truncate.js +48 -0
- package/node_modules/semver/functions/valid.js +8 -0
- package/node_modules/semver/index.js +93 -0
- package/node_modules/semver/internal/constants.js +37 -0
- package/node_modules/semver/internal/debug.js +11 -0
- package/node_modules/semver/internal/identifiers.js +29 -0
- package/node_modules/semver/internal/lrucache.js +42 -0
- package/node_modules/semver/internal/parse-options.js +17 -0
- package/node_modules/semver/internal/re.js +223 -0
- package/node_modules/semver/package.json +78 -0
- package/node_modules/semver/preload.js +4 -0
- package/node_modules/semver/range.bnf +17 -0
- package/node_modules/semver/ranges/gtr.js +6 -0
- package/node_modules/semver/ranges/intersects.js +9 -0
- package/node_modules/semver/ranges/ltr.js +6 -0
- package/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/node_modules/semver/ranges/min-version.js +63 -0
- package/node_modules/semver/ranges/outside.js +82 -0
- package/node_modules/semver/ranges/simplify.js +49 -0
- package/node_modules/semver/ranges/subset.js +249 -0
- package/node_modules/semver/ranges/to-comparators.js +10 -0
- package/node_modules/semver/ranges/valid.js +13 -0
- package/package.json +33 -27
- package/packages/octo-runtime-extra-channel-gateway/config-schema.json +8 -1
- package/packages/octo-runtime-protocol/schema/protocol.schema.json +43 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/text-send.d.ts +0 -19
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/text-send.js +0 -86
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/delivery-notice.d.ts +0 -5
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/delivery-notice.js +0 -35
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export declare const DEFAULT_TIMEOUT_MS = 30000;
|
|
2
|
+
/** 在发送边界检查生命周期,可用 Bot 持有值替换鉴权头;不返回异步许可。 */
|
|
3
|
+
export type HttpRequestDispatch = (signal: AbortSignal, send: (signal: AbortSignal, botToken?: string) => Promise<Response>) => Promise<Response>;
|
|
4
|
+
/** 每次尝试(含 429)使用生效凭据;无 Authorization 的签名 PUT 不附加 Bot Token。 */
|
|
5
|
+
export declare function fetchWithDispatch(url: string, options: RequestInit & {
|
|
6
|
+
signal: AbortSignal;
|
|
7
|
+
}, dispatch?: HttpRequestDispatch): Promise<Response>;
|
|
2
8
|
/**
|
|
3
9
|
* 生成出站消息的客户端幂等编号 client_msg_no(UUID)。
|
|
4
10
|
*
|
|
@@ -43,6 +49,7 @@ export declare const DEFAULT_POST_TIMEOUT_MS = 30000;
|
|
|
43
49
|
*/
|
|
44
50
|
export declare const POST_HARD_CEILING_MS = 60000;
|
|
45
51
|
interface JsonRequestOptions {
|
|
52
|
+
dispatchRequest?: HttpRequestDispatch;
|
|
46
53
|
retryOn429?: boolean;
|
|
47
54
|
/** Receipt uploads use the caller's throttled diagnostic instead. */
|
|
48
55
|
logRateLimit?: boolean;
|
package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/client.js
CHANGED
|
@@ -7,6 +7,23 @@ import { randomUUID } from "node:crypto";
|
|
|
7
7
|
import { OctoApiError, OctoApiStatusMismatchError, OctoApiProtocolError } from "./errors.js";
|
|
8
8
|
import { trimTrailingSlashes } from "./url.js";
|
|
9
9
|
export const DEFAULT_TIMEOUT_MS = 30_000;
|
|
10
|
+
/** 每次尝试(含 429)使用生效凭据;无 Authorization 的签名 PUT 不附加 Bot Token。 */
|
|
11
|
+
export function fetchWithDispatch(url, options, dispatch) {
|
|
12
|
+
const send = (signal, botToken) => {
|
|
13
|
+
signal.throwIfAborted();
|
|
14
|
+
const headers = new Headers(options.headers);
|
|
15
|
+
if (botToken !== undefined && headers.has("Authorization")) {
|
|
16
|
+
headers.delete("Authorization");
|
|
17
|
+
return fetch(url, {
|
|
18
|
+
...options,
|
|
19
|
+
headers: { ...Object.fromEntries(headers), Authorization: `Bearer ${botToken}` },
|
|
20
|
+
signal
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return fetch(url, { ...options, signal });
|
|
24
|
+
};
|
|
25
|
+
return dispatch ? dispatch(options.signal, send) : send(options.signal);
|
|
26
|
+
}
|
|
10
27
|
/**
|
|
11
28
|
* 生成出站消息的客户端幂等编号 client_msg_no(UUID)。
|
|
12
29
|
*
|
|
@@ -126,7 +143,7 @@ async function requestJson(apiUrl, botToken, path, method, payload, signal, opts
|
|
|
126
143
|
const fetchSignal = signal
|
|
127
144
|
? AbortSignal.any([signal, AbortSignal.timeout(POST_HARD_CEILING_MS)])
|
|
128
145
|
: AbortSignal.timeout(DEFAULT_POST_TIMEOUT_MS);
|
|
129
|
-
const response = await
|
|
146
|
+
const response = await fetchWithDispatch(url, {
|
|
130
147
|
method,
|
|
131
148
|
headers: {
|
|
132
149
|
...(payload ? DEFAULT_HEADERS : {}),
|
|
@@ -136,7 +153,7 @@ async function requestJson(apiUrl, botToken, path, method, payload, signal, opts
|
|
|
136
153
|
...(payload ? { body: JSON.stringify(payload) } : {}),
|
|
137
154
|
signal: fetchSignal,
|
|
138
155
|
...(opts.redirect ? { redirect: opts.redirect } : {})
|
|
139
|
-
});
|
|
156
|
+
}, opts.dispatchRequest);
|
|
140
157
|
if (response.ok) {
|
|
141
158
|
if (opts.expectedStatus !== undefined && response.status !== opts.expectedStatus) {
|
|
142
159
|
throw new OctoApiStatusMismatchError(path, response.status, opts.expectedStatus);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* 读取权限由 IM Server 决定,调用方负责选择本轮材料,接口层不组装 prompt。
|
|
4
4
|
*/
|
|
5
5
|
import type { ChannelType } from "./types.js";
|
|
6
|
+
import { type HttpRequestDispatch } from "./client.js";
|
|
6
7
|
export declare function fetchBotGroups(params: {
|
|
7
8
|
apiUrl: string;
|
|
8
9
|
botToken: string;
|
|
@@ -28,6 +29,7 @@ export declare function getGroupMembers(params: {
|
|
|
28
29
|
botToken: string;
|
|
29
30
|
groupNo: string;
|
|
30
31
|
signal?: AbortSignal;
|
|
32
|
+
dispatchRequest?: HttpRequestDispatch;
|
|
31
33
|
log?: {
|
|
32
34
|
info?: (msg: string) => void;
|
|
33
35
|
error?: (msg: string) => void;
|
|
@@ -66,7 +68,7 @@ export declare function getChannelMessages(params: {
|
|
|
66
68
|
}): Promise<Array<{
|
|
67
69
|
from_uid: string;
|
|
68
70
|
content: string;
|
|
69
|
-
timestamp: number;
|
|
71
|
+
timestamp: number | null;
|
|
70
72
|
message_id?: string;
|
|
71
73
|
message_seq?: number;
|
|
72
74
|
type?: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_TIMEOUT_MS, postJson, getJson } from "./client.js";
|
|
2
2
|
import { trimTrailingSlashes } from "./url.js";
|
|
3
|
+
import { messageDate } from "../message-time.js";
|
|
3
4
|
// Fetch the groups the bot belongs to
|
|
4
5
|
export async function fetchBotGroups(params) {
|
|
5
6
|
const url = `${params.apiUrl}/v1/bot/groups`;
|
|
@@ -18,7 +19,7 @@ export async function fetchBotGroups(params) {
|
|
|
18
19
|
return Array.isArray(data) ? data : [];
|
|
19
20
|
}
|
|
20
21
|
export async function getGroupMembers(params) {
|
|
21
|
-
const data = await getJson(params.apiUrl, params.botToken, `/v1/bot/groups/${encodeURIComponent(params.groupNo)}/members`, AbortSignal.any([AbortSignal.timeout(5000), ...(params.signal ? [params.signal] : [])]), { maxResponseBytes: 1 << 20, logRateLimit: false });
|
|
22
|
+
const data = await getJson(params.apiUrl, params.botToken, `/v1/bot/groups/${encodeURIComponent(params.groupNo)}/members`, AbortSignal.any([AbortSignal.timeout(5000), ...(params.signal ? [params.signal] : [])]), { maxResponseBytes: 1 << 20, logRateLimit: false, dispatchRequest: params.dispatchRequest });
|
|
22
23
|
// Normalize to strict array to prevent silent failures
|
|
23
24
|
const members = !Array.isArray(data) && Array.isArray(data?.members)
|
|
24
25
|
? data.members
|
|
@@ -77,8 +78,8 @@ export async function getChannelMessagePage(params) {
|
|
|
77
78
|
name: payload.name ?? undefined,
|
|
78
79
|
content: payload.content ?? "",
|
|
79
80
|
payload, // preserve full payload for types that need nested data (e.g. MultipleForward)
|
|
80
|
-
//
|
|
81
|
-
timestamp: (m.timestamp
|
|
81
|
+
// API 秒转内部毫秒;未知保留 null,不能伪造为处理时刻。
|
|
82
|
+
timestamp: messageDate(m.timestamp, "seconds")?.getTime() ?? null
|
|
82
83
|
};
|
|
83
84
|
});
|
|
84
85
|
return { messages: decoded, ...(data.more !== undefined ? { more: Boolean(data.more) } : {}) };
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 结构化 API 错误:保留 HTTP 状态与限流提示,使投递层能判断是否重试。
|
|
3
|
-
* 区分明确拒绝与传输结果未知,避免把所有异常都当作消息未发送。
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Structured error for the Octo REST helpers.
|
|
7
|
-
*
|
|
8
|
-
* The status code and the server's rate-limit hints used to survive only as text inside
|
|
9
|
-
* the message, so every caller that needed them re-parsed the string. This carries them
|
|
10
|
-
* as fields while keeping the historical message wording, which an existing regex parser
|
|
11
|
-
* and its callers still depend on.
|
|
12
|
-
*/
|
|
13
1
|
/** Fallback wait when the server rate-limits without a usable hint. */
|
|
14
2
|
export declare const DEFAULT_RETRY_AFTER_MS = 1000;
|
|
15
3
|
/**
|
package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/errors.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* as fields while keeping the historical message wording, which an existing regex parser
|
|
11
11
|
* and its callers still depend on.
|
|
12
12
|
*/
|
|
13
|
+
import { parseRetryAfterMs } from "../retry-after.js";
|
|
13
14
|
/** Fallback wait when the server rate-limits without a usable hint. */
|
|
14
15
|
export const DEFAULT_RETRY_AFTER_MS = 1_000;
|
|
15
16
|
/**
|
|
@@ -85,13 +86,14 @@ export class OctoApiError extends Error {
|
|
|
85
86
|
const text = body || resp.statusText || "";
|
|
86
87
|
const scope = header(resp, "X-RateLimit-Scope");
|
|
87
88
|
const remaining = header(resp, "X-RateLimit-Remaining");
|
|
89
|
+
const headerDelayMs = parseRetryAfterMs(header(resp, "Retry-After"));
|
|
88
90
|
return new OctoApiError({
|
|
89
91
|
status: resp.status,
|
|
90
92
|
path,
|
|
91
93
|
body: text.length > MAX_ERROR_BODY_CHARS ? `${text.slice(0, MAX_ERROR_BODY_CHARS)}…` : text,
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
retryAfterMs:
|
|
94
|
+
// 正数 header 不裁剪;零等待沿用 body/default 兜底,避免连续立即重试。
|
|
95
|
+
// body 提示仍从未截断正文解析,展示长度限制不能丢失限流事实。
|
|
96
|
+
retryAfterMs: (headerDelayMs !== undefined && headerDelayMs > 0 ? headerDelayMs : undefined) ??
|
|
95
97
|
retryAfterFromBody(body) ??
|
|
96
98
|
DEFAULT_RETRY_AFTER_MS,
|
|
97
99
|
...(scope !== undefined ? { rateLimitScope: scope } : {}),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { type HttpRequestDispatch } from "./client.js";
|
|
1
2
|
/** 校验服务端返回的长期下载地址;不把 PUT 地址、签名有效期或 Bot 鉴权路由冒充附件。 */
|
|
2
3
|
export declare function attachmentUrl(raw: unknown, apiUrl: string): string;
|
|
3
4
|
/** 当前 Bot 获取聊天上传凭据后直传;只交付独立 downloadUrl,绝不转发 Bot Token。 */
|
|
4
|
-
export declare function uploadChatAttachment(apiUrl: string, token: string, bytes: Uint8Array, filename: string, mime: string, signal: AbortSignal): Promise<string>;
|
|
5
|
+
export declare function uploadChatAttachment(apiUrl: string, token: string, bytes: Uint8Array, filename: string, mime: string, signal: AbortSignal, dispatchRequest?: HttpRequestDispatch): Promise<string>;
|
|
5
6
|
/**
|
|
6
7
|
* Infer MIME type from filename extension. Returns a sensible default if unknown.
|
|
7
8
|
*/
|
package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/files.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// Adapted from Mininglamp-OSS/openclaw-channel-octo/src/api-fetch.ts.
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { open } from "node:fs/promises";
|
|
8
|
-
import { readResponseText } from "./client.js";
|
|
8
|
+
import { readResponseText, fetchWithDispatch } from "./client.js";
|
|
9
9
|
import { trimTrailingSlashes } from "./url.js";
|
|
10
10
|
/** 校验服务端返回的长期下载地址;不把 PUT 地址、签名有效期或 Bot 鉴权路由冒充附件。 */
|
|
11
11
|
export function attachmentUrl(raw, apiUrl) {
|
|
@@ -32,16 +32,16 @@ export function attachmentUrl(raw, apiUrl) {
|
|
|
32
32
|
return url.href;
|
|
33
33
|
}
|
|
34
34
|
/** 当前 Bot 获取聊天上传凭据后直传;只交付独立 downloadUrl,绝不转发 Bot Token。 */
|
|
35
|
-
export async function uploadChatAttachment(apiUrl, token, bytes, filename, mime, signal) {
|
|
35
|
+
export async function uploadChatAttachment(apiUrl, token, bytes, filename, mime, signal, dispatchRequest) {
|
|
36
36
|
signal = AbortSignal.any([signal, AbortSignal.timeout(30_000)]);
|
|
37
37
|
signal.throwIfAborted();
|
|
38
38
|
const query = new URLSearchParams({ filename, fileSize: String(bytes.byteLength) });
|
|
39
|
-
const response = await
|
|
39
|
+
const response = await fetchWithDispatch(`${trimTrailingSlashes(apiUrl)}/v1/bot/upload/presigned?${query.toString()}`, {
|
|
40
40
|
method: "GET",
|
|
41
41
|
headers: { Authorization: `Bearer ${token}` },
|
|
42
42
|
signal,
|
|
43
43
|
redirect: "error"
|
|
44
|
-
});
|
|
44
|
+
}, dispatchRequest);
|
|
45
45
|
const body = await readResponseText(response, 64 << 10);
|
|
46
46
|
if (!response.ok)
|
|
47
47
|
throw new Error("upload-rejected");
|
|
@@ -91,14 +91,16 @@ export async function uploadChatAttachment(apiUrl, token, bytes, filename, mime,
|
|
|
91
91
|
}
|
|
92
92
|
signal.throwIfAborted();
|
|
93
93
|
// PUT 必须原样回显签名的类型/文件名;临时上传地址仅在此使用,网络未知不自动重放。
|
|
94
|
-
|
|
94
|
+
// presign 等待期间目标身份或任务可能取消;直传前检查,但不等待 WS 握手。
|
|
95
|
+
const stored = await fetchWithDispatch(upload.href, {
|
|
95
96
|
method: "PUT",
|
|
96
97
|
headers,
|
|
97
98
|
body: new Uint8Array(bytes),
|
|
98
99
|
redirect: "error",
|
|
99
100
|
signal
|
|
100
|
-
});
|
|
101
|
+
}, dispatchRequest);
|
|
101
102
|
await stored.body?.cancel();
|
|
103
|
+
signal.throwIfAborted();
|
|
102
104
|
if (!stored.ok)
|
|
103
105
|
throw new Error("upload-rejected");
|
|
104
106
|
return download;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { ChannelType } from "./types.js";
|
|
6
6
|
import { MessageType, type MentionEntity, type RichTextBlock, type SendMessageResult } from "./types.js";
|
|
7
|
+
import { type HttpRequestDispatch } from "./client.js";
|
|
7
8
|
/**
|
|
8
9
|
* Send a media message (image or file) to a channel.
|
|
9
10
|
*/
|
|
@@ -37,6 +38,7 @@ export declare function sendMessage(params: {
|
|
|
37
38
|
onBehalfOf?: string;
|
|
38
39
|
clientMsgNo?: string;
|
|
39
40
|
signal?: AbortSignal;
|
|
41
|
+
dispatchRequest?: HttpRequestDispatch;
|
|
40
42
|
}): Promise<SendMessageResult | undefined>;
|
|
41
43
|
/**
|
|
42
44
|
* 发送一条 RichText(=14) 图文混排消息。
|
|
@@ -73,6 +75,7 @@ export declare function sendTyping(params: {
|
|
|
73
75
|
channelType: ChannelType;
|
|
74
76
|
onBehalfOf?: string;
|
|
75
77
|
signal?: AbortSignal;
|
|
78
|
+
dispatchRequest?: HttpRequestDispatch;
|
|
76
79
|
}): Promise<void>;
|
|
77
80
|
export declare function sendReadReceipt(params: {
|
|
78
81
|
apiUrl: string;
|
|
@@ -89,7 +89,7 @@ export async function sendMessage(params) {
|
|
|
89
89
|
payload,
|
|
90
90
|
client_msg_no: params.clientMsgNo ?? generateClientMsgNo(),
|
|
91
91
|
...(params.onBehalfOf ? { on_behalf_of: params.onBehalfOf } : {})
|
|
92
|
-
}, params.signal);
|
|
92
|
+
}, params.signal, { dispatchRequest: params.dispatchRequest });
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
95
|
* 发送一条 RichText(=14) 图文混排消息。
|
|
@@ -151,7 +151,7 @@ export async function sendTyping(params) {
|
|
|
151
151
|
...(params.onBehalfOf ? { on_behalf_of: params.onBehalfOf } : {})
|
|
152
152
|
// A discardable hint, re-sent every few seconds while the model works. Retrying it
|
|
153
153
|
// only adds pressure to a bucket that is already empty.
|
|
154
|
-
}, params.signal, { retryOn429: false });
|
|
154
|
+
}, params.signal, { retryOn429: false, dispatchRequest: params.dispatchRequest });
|
|
155
155
|
}
|
|
156
156
|
export async function sendReadReceipt(params) {
|
|
157
157
|
await postJson(params.apiUrl, params.botToken, "/v1/bot/readReceipt", {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 单 Run 卡片会话:首次创建、后续编辑同一消息,并用序号和终态屏障收敛状态。
|
|
3
|
-
*
|
|
3
|
+
* 终态展示被拒绝时有界降级到精简帧;确认投递后 finish 正常返回,仍失败则保留诊断。
|
|
4
|
+
* 最终文本由执行编排独立投递;服务端回执不代表客户端已经渲染。
|
|
4
5
|
*/
|
|
5
6
|
import type { ImAddress } from "../contracts.js";
|
|
6
7
|
import type { OctoConnector } from "./connector.js";
|
|
@@ -11,11 +12,11 @@ export declare class CardSession {
|
|
|
11
12
|
readonly connector: OctoConnector;
|
|
12
13
|
readonly delivery: ImDeliveryDispatcher;
|
|
13
14
|
readonly address: ImAddress;
|
|
14
|
-
readonly stopTyping: () => void;
|
|
15
|
-
readonly onDiagnostic: (code: string) => void;
|
|
16
15
|
readonly effectKey: string;
|
|
17
|
-
constructor(connector: OctoConnector, delivery: ImDeliveryDispatcher, address: ImAddress, runId: string, stopTyping: () => void, onDiagnostic: (code: string) => void);
|
|
16
|
+
constructor(connector: OctoConnector, delivery: ImDeliveryDispatcher, address: ImAddress, runId: string, stopTyping: () => void, onDiagnostic: (code: string, data?: Record<string, unknown>) => void);
|
|
18
17
|
update(snapshot: RunPresentation): void;
|
|
19
18
|
finish(): Promise<void>;
|
|
19
|
+
/** 所有者完成 finish 后释放调度/回调;保留 messageId 供已有卡片按钮关联使用。 */
|
|
20
|
+
release(): void;
|
|
20
21
|
get messageId(): string | undefined;
|
|
21
22
|
}
|
|
@@ -6,19 +6,19 @@ export class CardSession {
|
|
|
6
6
|
connector;
|
|
7
7
|
delivery;
|
|
8
8
|
address;
|
|
9
|
-
stopTyping;
|
|
10
|
-
onDiagnostic;
|
|
11
9
|
#messageId;
|
|
12
10
|
#seq = 0;
|
|
13
11
|
#terminalFailed = false;
|
|
14
12
|
#scheduler;
|
|
13
|
+
#stopTyping;
|
|
14
|
+
#onDiagnostic;
|
|
15
15
|
effectKey;
|
|
16
16
|
constructor(connector, delivery, address, runId, stopTyping, onDiagnostic) {
|
|
17
17
|
this.connector = connector;
|
|
18
18
|
this.delivery = delivery;
|
|
19
19
|
this.address = address;
|
|
20
|
-
this
|
|
21
|
-
this
|
|
20
|
+
this.#stopTyping = stopTyping;
|
|
21
|
+
this.#onDiagnostic = onDiagnostic;
|
|
22
22
|
this.effectKey = stableEffectKey(imBotIdentity(connector.config), address, runId, "progress");
|
|
23
23
|
this.#scheduler = new ProgressScheduler(async (snapshot) => {
|
|
24
24
|
try {
|
|
@@ -29,51 +29,107 @@ export class CardSession {
|
|
|
29
29
|
this.#terminalFailed = true;
|
|
30
30
|
throw error;
|
|
31
31
|
}
|
|
32
|
-
}, () => onDiagnostic("IM_CARD_FAILED"));
|
|
32
|
+
}, () => this.#onDiagnostic?.("IM_CARD_FAILED"));
|
|
33
33
|
}
|
|
34
34
|
update(snapshot) {
|
|
35
35
|
if (snapshot.terminal || snapshot.phase === "waiting")
|
|
36
|
-
this
|
|
37
|
-
this.#scheduler
|
|
36
|
+
this.#stopTyping?.();
|
|
37
|
+
this.#scheduler?.enqueue(snapshot, !!snapshot.terminal || !!snapshot.resultUnknown);
|
|
38
38
|
}
|
|
39
39
|
async #send(snapshot) {
|
|
40
|
+
if (!this.#scheduler)
|
|
41
|
+
return;
|
|
40
42
|
const settled = !!snapshot.terminal || !!snapshot.resultUnknown;
|
|
41
43
|
const template = await this.connector.reasoningTemplate();
|
|
42
44
|
if (!template) {
|
|
43
45
|
if (settled && this.#messageId)
|
|
44
46
|
this.#terminalFailed = true;
|
|
45
|
-
this
|
|
47
|
+
this.#onDiagnostic?.("IM_CARD_UNAVAILABLE");
|
|
46
48
|
return;
|
|
47
49
|
}
|
|
48
50
|
const frame = buildReasoningFrame(snapshot, template);
|
|
49
51
|
if (!frame) {
|
|
50
52
|
if (settled)
|
|
51
53
|
this.#terminalFailed = true;
|
|
52
|
-
this
|
|
54
|
+
this.#onDiagnostic?.("IM_CARD_BUDGET_EXCEEDED");
|
|
53
55
|
return;
|
|
54
56
|
}
|
|
55
57
|
// 模板查询期间可能已收到终态;旧快照必须在出站前再次检查。
|
|
56
|
-
if (this.#scheduler.terminal && !settled)
|
|
58
|
+
if (!this.#scheduler || (this.#scheduler.terminal && !settled))
|
|
57
59
|
return;
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
+
// 同一 finish 的原帧与精简帧共用四次预算,切换展示内容不能重开重试窗口。
|
|
61
|
+
const budget = { remaining: settled ? 4 : 1 };
|
|
62
|
+
let receipt = await this.#deliver(frame, template, settled, budget);
|
|
63
|
+
// 400 不是业务终态。只在明确拒收后替换展示内容再投一次,不重放未知投递或另起可见卡片。
|
|
64
|
+
if (settled &&
|
|
65
|
+
budget.remaining > 0 &&
|
|
66
|
+
receipt.state === "failed" &&
|
|
67
|
+
(receipt.code === "IM_CARD_SEND_400" || receipt.code === "IM_CARD_EDIT_400")) {
|
|
68
|
+
const compact = {
|
|
69
|
+
reasoningId: frame.reasoningId,
|
|
70
|
+
state: frame.state,
|
|
71
|
+
title: "执行结果",
|
|
72
|
+
statusLabel: frame.statusLabel,
|
|
73
|
+
statusTone: frame.statusTone,
|
|
74
|
+
traceExpanded: false,
|
|
75
|
+
traceCollapsed: true,
|
|
76
|
+
collapsedSummary: frame.statusLabel + " · 过程详情暂不可用,请查看最终回复或运行记录。",
|
|
77
|
+
phases: [
|
|
78
|
+
{
|
|
79
|
+
thought: "过程详情暂不可用,请查看最终回复或运行记录。",
|
|
80
|
+
actions: [
|
|
81
|
+
{
|
|
82
|
+
tool: "任务状态",
|
|
83
|
+
detail: frame.statusLabel,
|
|
84
|
+
statusGlyph: "●",
|
|
85
|
+
statusTone: "Accent"
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
...(frame.state === "error"
|
|
91
|
+
? { errorTitle: "执行失败", errorMessage: "请查看最终回复或运行记录。" }
|
|
92
|
+
: {})
|
|
93
|
+
};
|
|
94
|
+
receipt = await this.#deliver(compact, template, settled, budget);
|
|
95
|
+
if (receipt.state === "delivered")
|
|
96
|
+
this.#onDiagnostic?.("IM_CARD_TERMINAL_DEGRADED");
|
|
97
|
+
}
|
|
60
98
|
if (receipt.state === "delivered") {
|
|
61
99
|
// 后续更新绑定第一次成功发送的消息,不另起卡片;可见卡片接替 typing 提示。
|
|
62
100
|
this.#messageId = receipt.messageId;
|
|
63
|
-
this
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
if (settled)
|
|
67
|
-
this.#terminalFailed = true;
|
|
68
|
-
this.onDiagnostic(receipt.code ?? "IM_CARD_FAILED");
|
|
101
|
+
this.#stopTyping?.();
|
|
69
102
|
}
|
|
103
|
+
else if (settled)
|
|
104
|
+
this.#terminalFailed = true;
|
|
105
|
+
}
|
|
106
|
+
/** 沿同一卡片串行发送;降级帧也使用新序号和独立回执,保留取消与旧帧屏障。 */
|
|
107
|
+
#deliver(frame, template, settled, budget) {
|
|
108
|
+
const seq = ++this.#seq;
|
|
109
|
+
return this.delivery.deliver(`${this.effectKey}:${seq}`, () => {
|
|
110
|
+
budget.remaining--;
|
|
111
|
+
return this.connector.card(this.address, template, frame, this.effectKey, this.#messageId, seq, !settled);
|
|
112
|
+
}, {
|
|
113
|
+
transient: !settled,
|
|
114
|
+
...(settled ? { attempts: budget.remaining } : {}),
|
|
115
|
+
obsolete: () => !this.#scheduler || (this.#scheduler.terminal && !settled),
|
|
116
|
+
cardOperation: this.#messageId ? "edit" : "send",
|
|
117
|
+
onDiagnostic: (code, data) => this.#onDiagnostic?.(code, data)
|
|
118
|
+
});
|
|
70
119
|
}
|
|
71
120
|
async finish() {
|
|
72
|
-
this
|
|
73
|
-
await this.#scheduler
|
|
121
|
+
this.#stopTyping?.();
|
|
122
|
+
await this.#scheduler?.flush();
|
|
74
123
|
if (this.#terminalFailed)
|
|
75
124
|
throw new Error("IM_CARD_FINALIZATION_FAILED");
|
|
76
125
|
}
|
|
126
|
+
/** 所有者完成 finish 后释放调度/回调;保留 messageId 供已有卡片按钮关联使用。 */
|
|
127
|
+
release() {
|
|
128
|
+
this.#scheduler?.dispose();
|
|
129
|
+
this.#scheduler = undefined;
|
|
130
|
+
this.#stopTyping = undefined;
|
|
131
|
+
this.#onDiagnostic = undefined;
|
|
132
|
+
}
|
|
77
133
|
get messageId() {
|
|
78
134
|
return this.#messageId;
|
|
79
135
|
}
|
package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/channel.d.ts
CHANGED
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
import type { ChannelCallbacks, OctoBotConfig } from "../contracts.js";
|
|
2
2
|
import type { ImCredentialSource } from "../ports.js";
|
|
3
|
+
import { ImDeliveryDispatcher } from "../delivery/dispatcher.js";
|
|
4
|
+
import { type ImDeliveryIdentity } from "../delivery/identity.js";
|
|
3
5
|
/** Octo IM 平台连接器:WuKong 与 Octo REST 适配;不是 MCP 连接器。 */
|
|
4
6
|
export declare class GatewayTransport {
|
|
5
7
|
#private;
|
|
6
8
|
readonly config: OctoBotConfig;
|
|
7
9
|
readonly credentials: ImCredentialSource;
|
|
8
10
|
readonly callbacks: ChannelCallbacks;
|
|
11
|
+
readonly deliveryOwner?: {
|
|
12
|
+
signal: AbortSignal;
|
|
13
|
+
dispatcher: ImDeliveryDispatcher;
|
|
14
|
+
identity: ImDeliveryIdentity;
|
|
15
|
+
token?: () => string | undefined;
|
|
16
|
+
/** 身份及空间准入后同步发布凭据;候选值不得提前供旧任务读取。 */
|
|
17
|
+
acceptToken?: (token: string) => void;
|
|
18
|
+
} | undefined;
|
|
9
19
|
identity: string;
|
|
10
20
|
readonly botId: string;
|
|
11
21
|
get scopedConfig(): {
|
|
12
22
|
spaceId: string;
|
|
13
23
|
api_url: string;
|
|
14
24
|
bf_token?: string;
|
|
25
|
+
stable_context_refresh_interval_turns?: number;
|
|
15
26
|
groups_enabled?: boolean;
|
|
16
27
|
group_ids?: string[] | null;
|
|
17
28
|
cards?: boolean;
|
|
@@ -42,7 +53,14 @@ export declare class GatewayTransport {
|
|
|
42
53
|
};
|
|
43
54
|
allowed_sender_ids?: string[];
|
|
44
55
|
};
|
|
45
|
-
constructor(config: OctoBotConfig, credentials: ImCredentialSource, callbacks: ChannelCallbacks
|
|
56
|
+
constructor(config: OctoBotConfig, credentials: ImCredentialSource, callbacks: ChannelCallbacks, deliveryOwner?: {
|
|
57
|
+
signal: AbortSignal;
|
|
58
|
+
dispatcher: ImDeliveryDispatcher;
|
|
59
|
+
identity: ImDeliveryIdentity;
|
|
60
|
+
token?: () => string | undefined;
|
|
61
|
+
/** 身份及空间准入后同步发布凭据;候选值不得提前供旧任务读取。 */
|
|
62
|
+
acceptToken?: (token: string) => void;
|
|
63
|
+
} | undefined);
|
|
46
64
|
get status(): {
|
|
47
65
|
connected: boolean;
|
|
48
66
|
cardDeliveries: number;
|