@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,5 +1,7 @@
|
|
|
1
1
|
/** Shell-free Node.js process runner used to invoke native service managers. */
|
|
2
2
|
import { spawn } from "node:child_process";
|
|
3
|
+
import { win32 } from "node:path";
|
|
4
|
+
import iconv from "iconv-lite";
|
|
3
5
|
const DEFAULT_TIMEOUT_MS = 30_000;
|
|
4
6
|
const MAX_CAPTURE_CHARS = 64 * 1024;
|
|
5
7
|
/**
|
|
@@ -9,62 +11,110 @@ const MAX_CAPTURE_CHARS = 64 * 1024;
|
|
|
9
11
|
* with exit code 124, allowing the service layer to attach backend context.
|
|
10
12
|
*/
|
|
11
13
|
export class NodeCommandRunner {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
14
|
+
#windowsTaskEncoding;
|
|
15
|
+
/** 原命令直接启动并有界捕获;Windows schtasks 内部协商解码,不改变调用方输入。 */
|
|
16
|
+
async run(command, args, options = {}) {
|
|
17
|
+
if (process.platform !== "win32" || !/^schtasks(?:\.exe)?$/i.test(win32.basename(command))) {
|
|
18
|
+
return runProcess(command, args, options);
|
|
19
|
+
}
|
|
20
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
21
|
+
const startedAt = performance.now();
|
|
22
|
+
if (!this.#windowsTaskEncoding) {
|
|
23
|
+
// 与 manager 相同的隐藏控制台启动条件,只查询代码页,不改变宿主控制台或 shell 设置。
|
|
24
|
+
// 仅缓存成功结果;并发查询各自使用调用预算,短超时不能污染其他请求。
|
|
25
|
+
const system32 = win32.join(process.env.SystemRoot ?? "C:\\Windows", "System32");
|
|
26
|
+
const queried = await runProcess(win32.join(system32, "cmd.exe"), ["/d", "/c", win32.join(system32, "chcp.com")], options);
|
|
27
|
+
if (queried.exitCode === 124)
|
|
28
|
+
return commandTimeout(command, args, timeoutMs);
|
|
29
|
+
const codePage = /(\d+)\s*$/.exec(queried.stdout)?.[1];
|
|
30
|
+
const candidate = codePage === "65001" ? "utf8" : codePage ? `cp${codePage}` : "";
|
|
31
|
+
if (queried.exitCode !== 0 || !candidate || !iconv.encodingExists(candidate)) {
|
|
32
|
+
throw new Error("Windows task output code-page query failed", { cause: queried });
|
|
33
|
+
}
|
|
34
|
+
this.#windowsTaskEncoding = candidate;
|
|
35
|
+
}
|
|
36
|
+
const remainingMs = timeoutMs - (performance.now() - startedAt);
|
|
37
|
+
if (timeoutMs > 0 && remainingMs <= 0)
|
|
38
|
+
return commandTimeout(command, args, timeoutMs);
|
|
39
|
+
// 原命令仍直接启动,超时诊断使用原预算,真实 exit code 124 不等于 timer 已触发。
|
|
40
|
+
return runProcess(command, args, { ...options, timeoutMs: timeoutMs > 0 ? remainingMs : timeoutMs }, this.#windowsTaskEncoding, timeoutMs);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** 直接启动原命令;只有 schtasks 的原生字节需要按已查询代码页增量解码。 */
|
|
44
|
+
function runProcess(command, args, options, encoding, reportedTimeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS) {
|
|
45
|
+
return new Promise((resolve, reject) => {
|
|
46
|
+
const child = spawn(command, [...args], {
|
|
47
|
+
cwd: options.cwd,
|
|
48
|
+
env: options.env ?? process.env,
|
|
49
|
+
shell: false,
|
|
50
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
51
|
+
windowsHide: true
|
|
52
|
+
});
|
|
53
|
+
let stdout = "";
|
|
54
|
+
let stderr = "";
|
|
55
|
+
let settled = false;
|
|
56
|
+
let timedOut = false;
|
|
57
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
58
|
+
const timer = timeoutMs > 0
|
|
59
|
+
? setTimeout(() => {
|
|
60
|
+
timedOut = true;
|
|
61
|
+
child.kill("SIGKILL");
|
|
62
|
+
}, timeoutMs)
|
|
63
|
+
: undefined;
|
|
64
|
+
timer?.unref();
|
|
65
|
+
const stdoutDecoder = encoding ? iconv.getDecoder(encoding, { stripBOM: false }) : undefined;
|
|
66
|
+
const stderrDecoder = encoding ? iconv.getDecoder(encoding, { stripBOM: false }) : undefined;
|
|
67
|
+
if (!encoding) {
|
|
34
68
|
child.stdout.setEncoding("utf8");
|
|
35
69
|
child.stderr.setEncoding("utf8");
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
70
|
+
}
|
|
71
|
+
child.stdout.on("data", (chunk) => {
|
|
72
|
+
stdout = appendBounded(stdout, stdoutDecoder ? stdoutDecoder.write(chunk) : chunk.toString());
|
|
73
|
+
});
|
|
74
|
+
child.stderr.on("data", (chunk) => {
|
|
75
|
+
stderr = appendBounded(stderr, stderrDecoder ? stderrDecoder.write(chunk) : chunk.toString());
|
|
76
|
+
});
|
|
77
|
+
child.stdout.once("end", () => {
|
|
78
|
+
stdout = appendBounded(stdout, stdoutDecoder?.end() ?? "");
|
|
79
|
+
});
|
|
80
|
+
child.stderr.once("end", () => {
|
|
81
|
+
stderr = appendBounded(stderr, stderrDecoder?.end() ?? "");
|
|
82
|
+
});
|
|
83
|
+
child.once("error", (error) => {
|
|
84
|
+
if (settled)
|
|
85
|
+
return;
|
|
86
|
+
settled = true;
|
|
87
|
+
if (timer)
|
|
88
|
+
clearTimeout(timer);
|
|
89
|
+
reject(error);
|
|
90
|
+
});
|
|
91
|
+
child.once("close", (code) => {
|
|
92
|
+
if (settled)
|
|
93
|
+
return;
|
|
94
|
+
settled = true;
|
|
95
|
+
if (timer)
|
|
96
|
+
clearTimeout(timer);
|
|
97
|
+
resolve({
|
|
98
|
+
command,
|
|
99
|
+
args: [...args],
|
|
100
|
+
exitCode: timedOut ? 124 : (code ?? 1),
|
|
101
|
+
stdout,
|
|
102
|
+
stderr: timedOut
|
|
103
|
+
? appendBounded(stderr, `\ncommand timed out after ${reportedTimeoutMs}ms`)
|
|
104
|
+
: stderr
|
|
65
105
|
});
|
|
66
106
|
});
|
|
67
|
-
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/** 内部代码页查询耗尽预算时,不再启动 manager,仍返回原命令的超时事实。 */
|
|
110
|
+
function commandTimeout(command, args, timeoutMs) {
|
|
111
|
+
return {
|
|
112
|
+
command,
|
|
113
|
+
args: [...args],
|
|
114
|
+
exitCode: 124,
|
|
115
|
+
stdout: "",
|
|
116
|
+
stderr: `command timed out after ${timeoutMs}ms`
|
|
117
|
+
};
|
|
68
118
|
}
|
|
69
119
|
function appendBounded(current, chunk) {
|
|
70
120
|
return (current + chunk).slice(-MAX_CAPTURE_CHARS);
|
|
@@ -79,6 +79,10 @@ export class WindowsUserTaskBackend {
|
|
|
79
79
|
}
|
|
80
80
|
/** Return live scheduler state and exact drift from the desired XML/principal/action. */
|
|
81
81
|
async inspect(spec) {
|
|
82
|
+
return this.#inspect(spec, true);
|
|
83
|
+
}
|
|
84
|
+
/** 公开查询要求身份可确认;清理只依赖管理器状态,保留诊断且不放宽查询失败。 */
|
|
85
|
+
async #inspect(spec, requireIdentity) {
|
|
82
86
|
const normalized = this.#normalize(spec);
|
|
83
87
|
const taskName = windowsTaskName(normalized);
|
|
84
88
|
const definitionPath = this.#definitionPath(normalized);
|
|
@@ -123,7 +127,7 @@ export class WindowsUserTaskBackend {
|
|
|
123
127
|
windowsAccountIdentity(task.trigger_user_id, task.trigger_user_matches, this.#windowsUserId) === undefined;
|
|
124
128
|
return {
|
|
125
129
|
manager: this.kind,
|
|
126
|
-
state: identityUnknown ? "unknown" : windowsTaskState(task.state),
|
|
130
|
+
state: identityUnknown && requireIdentity ? "unknown" : windowsTaskState(task.state),
|
|
127
131
|
enabled: task.enabled === true,
|
|
128
132
|
lastExitCode: task.last_exit_code,
|
|
129
133
|
definitionPath,
|
|
@@ -206,7 +210,8 @@ export class WindowsUserTaskBackend {
|
|
|
206
210
|
async stop(spec) {
|
|
207
211
|
const normalized = await this.#installed(spec);
|
|
208
212
|
const taskName = windowsTaskName(normalized);
|
|
209
|
-
|
|
213
|
+
// 账号翻译失败不代表任务仍在运行;停止不依赖账号匹配,权限仍由 Scheduler 校验。
|
|
214
|
+
const status = await this.#inspect(spec, false);
|
|
210
215
|
if (status.state === "stopped" || status.state === "not_installed")
|
|
211
216
|
return;
|
|
212
217
|
if (status.state === "unknown")
|
|
@@ -219,7 +224,7 @@ export class WindowsUserTaskBackend {
|
|
|
219
224
|
// /End 仅表示请求受理;旧实例仍运行时不能 /Run(IgnoreNew 会吞掉重启)。
|
|
220
225
|
const end = Date.now() + normalized.timeoutStopSeconds * 1000;
|
|
221
226
|
while (true) {
|
|
222
|
-
const current = await this
|
|
227
|
+
const current = await this.#inspect(spec, false);
|
|
223
228
|
if (current.state === "stopped" || current.state === "not_installed")
|
|
224
229
|
return;
|
|
225
230
|
if (current.state === "unknown")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-cross-service",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Native user-service lifecycle backends for Octo Runtime",
|
|
6
6
|
"type": "module",
|
|
@@ -10,8 +10,10 @@
|
|
|
10
10
|
"dist",
|
|
11
11
|
"README.md"
|
|
12
12
|
],
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"iconv-lite": "0.7.3"
|
|
15
|
+
},
|
|
13
16
|
"engines": {
|
|
14
17
|
"node": "^24.0.0 || ^26.0.0"
|
|
15
|
-
}
|
|
16
|
-
"dependencies": {}
|
|
18
|
+
}
|
|
17
19
|
}
|
|
@@ -5,11 +5,12 @@ import type { AdapterInvocationContext, AdapterProbeOptions, AdapterOutput } fro
|
|
|
5
5
|
import { type InvokeInput, type InvokeEnvironment, type AdapterProtocolSupport, type HostFrame, type NativeInteractionResponse, type InteractionResponse, type InvokeRequest } from "@mininglamp-oss/octo-runtime-protocol";
|
|
6
6
|
import { type RuntimeLog } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
7
7
|
export type { AdapterInvocationContext, AdapterOutput, AdapterProbeOptions, RuntimeLog } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
8
|
-
/**
|
|
8
|
+
/** 宿主注册及执行时使用的完整元数据;编写时的可选默认值须由 Adapter 工厂先补齐。 */
|
|
9
9
|
export interface HostedAdapterMetadata {
|
|
10
10
|
/** False skips Runtime workspace preparation for this Provider. */
|
|
11
11
|
workspace?: boolean;
|
|
12
|
-
|
|
12
|
+
/** 注册输入必须完整;不得因编写阶段可省略而将此字段改成可选或在注册时猜测支持范围。 */
|
|
13
|
+
protocolSupport: AdapterProtocolSupport;
|
|
13
14
|
type: string;
|
|
14
15
|
agentSources: ("preset" | "provisioned")[];
|
|
15
16
|
processModel?: string;
|
|
@@ -55,7 +56,7 @@ export declare class AgentExecutor {
|
|
|
55
56
|
* 与 Kernel 的观察 iterator 不同,本地 Core 提前结束迭代会请求取消并进入 Adapter 清理。
|
|
56
57
|
*/
|
|
57
58
|
readonly invoke: import("@mininglamp-oss/octo-runtime-protocol").InputInvoke;
|
|
58
|
-
/**
|
|
59
|
+
/** 按 type 注册完整 Adapter 并校验协议声明,不补默认值或启动 Provider;同类型不可覆盖。 */
|
|
59
60
|
register(adapter: HostedAdapter): void;
|
|
60
61
|
/** List registered adapters, for Agent registration and control-plane display. */
|
|
61
62
|
list(): HostedAdapterMetadata[];
|
|
@@ -46,7 +46,7 @@ export class AgentExecutor {
|
|
|
46
46
|
#acceptedTerminals = new Set();
|
|
47
47
|
#runs = new Map();
|
|
48
48
|
#modes = new Map();
|
|
49
|
-
/**
|
|
49
|
+
/** 按 type 注册完整 Adapter 并校验协议声明,不补默认值或启动 Provider;同类型不可覆盖。 */
|
|
50
50
|
register(adapter) {
|
|
51
51
|
this.#assertOpen();
|
|
52
52
|
assertAdapterProtocolSupport(adapter.metadata.protocolSupport);
|
|
@@ -103,6 +103,8 @@ export function prepareInvokeInput(value) {
|
|
|
103
103
|
invocationId: input.invocationId ?? `invoke_${randomUUID()}`,
|
|
104
104
|
runId: input.runId ?? `run_${randomUUID()}`,
|
|
105
105
|
agentSessionId: value.sessionId ?? `session_${randomUUID()}`,
|
|
106
|
+
// 名称默认值只在此归一化;Host SDK/Adapter 不猜业务策略或据此决定恢复。
|
|
107
|
+
sessionName: input.sessionName ?? randomUUID(),
|
|
106
108
|
agentSource,
|
|
107
109
|
continuityMode,
|
|
108
110
|
...(providerSession ? { providerSession } : {}),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ContextEnvelope, InvokeRequest } from "@mininglamp-oss/octo-runtime-protocol";
|
|
2
|
-
/**
|
|
2
|
+
/** 仅渲染本轮业务 Context;默认完整 JSON,显式文本格式保留原文,不修改输入。 */
|
|
3
3
|
export declare function renderModelContexts(context: ContextEnvelope): string;
|
|
4
4
|
/**
|
|
5
5
|
* Core 冻结原请求后、派发 Adapter 前调用一次;接入方不应预先渲染而造成 Context 重复。
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const MODEL_CONTEXT_PATTERNS = [/^extra\.[^/]+\/[^/]+$/, /^octo\.content\/(inline|references)$/];
|
|
2
|
-
/**
|
|
2
|
+
/** 仅渲染本轮业务 Context;默认完整 JSON,显式文本格式保留原文,不修改输入。 */
|
|
3
3
|
export function renderModelContexts(context) {
|
|
4
4
|
const items = context.items.filter((item) => MODEL_CONTEXT_PATTERNS.some((pattern) => pattern.test(item.namespace + "/" + item.name)));
|
|
5
5
|
if (!items.length)
|
|
@@ -9,7 +9,9 @@ export function renderModelContexts(context) {
|
|
|
9
9
|
"<contexts>",
|
|
10
10
|
...items.map((item) => {
|
|
11
11
|
// 拆分 CDATA 终止符为相邻区段,避免材料中的标记提前结束数据边界;不解析内部内容。
|
|
12
|
-
const data =
|
|
12
|
+
const data = (item.data_format === "text"
|
|
13
|
+
? String(item.payload.text)
|
|
14
|
+
: JSON.stringify(sorted(item.payload))).replaceAll("]]>", "]]]]><![CDATA[>");
|
|
13
15
|
return [
|
|
14
16
|
` <context-item namespace="${item.namespace}" name="${item.name}">`,
|
|
15
17
|
...(item.guidance ? [` <guidence>${item.guidance}</guidence>`] : []),
|
|
@@ -38,19 +40,20 @@ export function withModelContexts(request) {
|
|
|
38
40
|
const rendered = renderModelContexts(request.context);
|
|
39
41
|
if (!rendered)
|
|
40
42
|
return request;
|
|
43
|
+
const prefix = `${rendered}\n\n<!-- Query Input -->\n\n`;
|
|
41
44
|
return {
|
|
42
45
|
...request,
|
|
43
|
-
modelInput:
|
|
46
|
+
modelInput: prefix + request.modelInput,
|
|
44
47
|
...(request.modelInputParts
|
|
45
|
-
? { modelInputParts: [{ type: "text", text:
|
|
48
|
+
? { modelInputParts: [{ type: "text", text: prefix }, ...request.modelInputParts] }
|
|
46
49
|
: {}),
|
|
47
50
|
...(request.freshFallbackModelInput
|
|
48
|
-
? { freshFallbackModelInput:
|
|
51
|
+
? { freshFallbackModelInput: prefix + request.freshFallbackModelInput }
|
|
49
52
|
: {}),
|
|
50
53
|
...(request.freshFallbackModelInputParts
|
|
51
54
|
? {
|
|
52
55
|
freshFallbackModelInputParts: [
|
|
53
|
-
{ type: "text", text:
|
|
56
|
+
{ type: "text", text: prefix },
|
|
54
57
|
...request.freshFallbackModelInputParts
|
|
55
58
|
]
|
|
56
59
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-executor-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
9
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
8
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.8",
|
|
9
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.8"
|
|
10
10
|
},
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"files": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-executor-kernel",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@mininglamp-oss/octo-runtime-executor-core": "1.1.
|
|
22
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
23
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
21
|
+
"@mininglamp-oss/octo-runtime-executor-core": "1.1.8",
|
|
22
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.8",
|
|
23
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.8"
|
|
24
24
|
},
|
|
25
25
|
"types": "./dist/index.d.ts",
|
|
26
26
|
"files": [
|
|
@@ -58,6 +58,13 @@
|
|
|
58
58
|
"default": true,
|
|
59
59
|
"description": "可选。是否启动此 Bot;省略为 true,false 时保留配置与 stopped 状态但不连接,不影响其他 Bot。"
|
|
60
60
|
},
|
|
61
|
+
"stable_context_refresh_interval_turns": {
|
|
62
|
+
"type": "integer",
|
|
63
|
+
"minimum": 1,
|
|
64
|
+
"maximum": 9007199254740991,
|
|
65
|
+
"default": 30,
|
|
66
|
+
"description": "自动稳定渠道说明的用户任务刷新周期;每会话第 1、N、2N…轮携带,默认 30。reset/new 后重新计轮;工具调用、同轮自动重试和同代次卡片重试不计新轮。只控制 Gateway 自有稳定说明,不省略宿主显式 Context、本轮 actor 或历史增量。"
|
|
67
|
+
},
|
|
61
68
|
"bf_token": {
|
|
62
69
|
"type": "string",
|
|
63
70
|
"writeOnly": true,
|
|
@@ -245,7 +252,7 @@
|
|
|
245
252
|
"allowed_roots": {
|
|
246
253
|
"type": "array",
|
|
247
254
|
"maxItems": 32,
|
|
248
|
-
"description": "
|
|
255
|
+
"description": "可选的 Gateway 本机绝对产物目录限制。省略时对成功 final 中的本地文件引用尝试按实际文件系统读取,不按 Agent 来源拒绝、不额外限制到工作区;空列表拒绝全部文件。显式目录按 realpath 检查包含关系,拒绝 symlink 逃逸;不修改 Agent 工作区、不下载远端文件。",
|
|
249
256
|
"items": {
|
|
250
257
|
"type": "string",
|
|
251
258
|
"pattern": "^(?:/|[A-Za-z]:[\\\\/]|\\\\\\\\[^\\\\/]+[\\\\/][^\\\\/]+)"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** 群/话题的位置只证明本轮准备与材料交接,不代表模型已阅读完整历史。 */
|
|
2
2
|
import type { ContextItem } from "@mininglamp-oss/octo-runtime-protocol";
|
|
3
|
-
export declare const IM_HISTORY_MESSAGE_LIMIT =
|
|
3
|
+
export declare const IM_HISTORY_MESSAGE_LIMIT = 20;
|
|
4
4
|
export interface ImGapMetadata {
|
|
5
5
|
processEpoch: string;
|
|
6
6
|
revision: number;
|
|
@@ -10,11 +10,20 @@ export interface ImGapMetadata {
|
|
|
10
10
|
continuityUnknown?: boolean;
|
|
11
11
|
observationVisibility?: "unknown" | "partial";
|
|
12
12
|
localOutputSeqs: number[];
|
|
13
|
+
assistantOutputs?: {
|
|
14
|
+
providerSessionId: string;
|
|
15
|
+
messages: Array<{
|
|
16
|
+
seq: number;
|
|
17
|
+
fingerprint: string;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
13
20
|
}
|
|
14
21
|
export interface ImGapTurnToken {
|
|
15
22
|
sessionId: string;
|
|
16
23
|
generation: number;
|
|
17
24
|
processEpoch: string;
|
|
25
|
+
/** 仅源流正常完成后、成功 final 交付前设置;普通发送位置不代表 assistant 已有内容。 */
|
|
26
|
+
providerSessionId?: string;
|
|
18
27
|
}
|
|
19
28
|
export interface ImGapPlan {
|
|
20
29
|
mode: "none" | "bootstrap" | "delta" | "unavailable";
|
|
@@ -25,7 +34,14 @@ export interface ImGapPlan {
|
|
|
25
34
|
earlierOmitted?: boolean;
|
|
26
35
|
retrieval?: "provided" | "partial" | "empty" | "unavailable" | "omitted";
|
|
27
36
|
reason?: string;
|
|
37
|
+
excludedOutputs?: Array<{
|
|
38
|
+
seq: number;
|
|
39
|
+
fingerprint: string;
|
|
40
|
+
}>;
|
|
41
|
+
recoveryHistory?: ContextItem;
|
|
28
42
|
}
|
|
43
|
+
/** 只核对普通正文/文件卡;历史被编辑或形状不明时不排除,不以 URL 或 UID 判重。 */
|
|
44
|
+
export declare function assistantOutputFingerprint(payload: Record<string, unknown>): string | undefined;
|
|
29
45
|
export declare function validMessageSeq(value: unknown): value is number;
|
|
30
46
|
export declare function gapMetadata(processEpoch: string, previous?: ImGapMetadata): ImGapMetadata;
|
|
31
47
|
export declare function planHistoryGap(trigger: number | undefined, metadata: ImGapMetadata | undefined, processEpoch: string, capable?: boolean): ImGapPlan;
|
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
export const IM_HISTORY_MESSAGE_LIMIT = 20;
|
|
3
|
+
/** 只核对普通正文/文件卡;历史被编辑或形状不明时不排除,不以 URL 或 UID 判重。 */
|
|
4
|
+
export function assistantOutputFingerprint(payload) {
|
|
5
|
+
if (![1, 8].includes(Number(payload.type)) || payload.reply)
|
|
6
|
+
return undefined;
|
|
7
|
+
return createHash("sha256")
|
|
8
|
+
.update(JSON.stringify([
|
|
9
|
+
payload.type,
|
|
10
|
+
payload.content ?? "",
|
|
11
|
+
payload.url,
|
|
12
|
+
payload.name,
|
|
13
|
+
payload.size,
|
|
14
|
+
payload.extension,
|
|
15
|
+
payload.mention
|
|
16
|
+
]))
|
|
17
|
+
.digest("hex");
|
|
18
|
+
}
|
|
2
19
|
export function validMessageSeq(value) {
|
|
3
20
|
return Number.isSafeInteger(value) && Number(value) > 0 && Number(value) <= 0xffffffff;
|
|
4
21
|
}
|
|
@@ -31,9 +48,8 @@ export function planHistoryGap(trigger, metadata, processEpoch, capable = true)
|
|
|
31
48
|
reason: capable ? "unknown-baseline" : "store-capability-unavailable"
|
|
32
49
|
};
|
|
33
50
|
const span = trigger - after - 1;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (span <= own)
|
|
51
|
+
// 发送位置不足以证明 assistant 覆盖;读取同一窗口才能核对编辑及准备本轮恢复材料。
|
|
52
|
+
if (span <= 0)
|
|
37
53
|
return { mode: "none", afterSeq: after };
|
|
38
54
|
return {
|
|
39
55
|
mode: "delta",
|
|
@@ -50,7 +66,7 @@ export function historyGapContext(source, triggerId, plan, triggerSequence = pla
|
|
|
50
66
|
const item = {
|
|
51
67
|
namespace: "extra.im",
|
|
52
68
|
name: "history-gap",
|
|
53
|
-
guidance: "
|
|
69
|
+
guidance: "This data describes the range, availability, and omissions of channel history for the current turn.",
|
|
54
70
|
payload: {
|
|
55
71
|
source,
|
|
56
72
|
automatic: true,
|
|
@@ -81,7 +97,7 @@ export function compactHistoryGap(item) {
|
|
|
81
97
|
const compact = {
|
|
82
98
|
namespace: item.namespace,
|
|
83
99
|
name: item.name,
|
|
84
|
-
guidance: "
|
|
100
|
+
guidance: "This data describes the range, availability, and omissions of channel history for the current turn.",
|
|
85
101
|
payload: {
|
|
86
102
|
source: item.payload.source,
|
|
87
103
|
automatic: true,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** 只转换渠道自动项;范围、游标及交接证据留在原始材料,不进入模型或冻结重试。 */
|
|
2
|
+
export function modelHistoryContexts(items) {
|
|
3
|
+
const automatic = (item, name) => item.namespace === "extra.im" && item.name === name && item.payload.automatic === true;
|
|
4
|
+
const gap = items.find((item) => automatic(item, "history-gap"));
|
|
5
|
+
const note = gap?.payload.status === "unavailable"
|
|
6
|
+
? "Earlier messages could not be retrieved."
|
|
7
|
+
: gap?.payload.status === "omitted"
|
|
8
|
+
? "Earlier messages are not included."
|
|
9
|
+
: gap?.payload.status === "partial" || gap?.payload.earlierOmitted === true
|
|
10
|
+
? "Some earlier messages are not included."
|
|
11
|
+
: undefined;
|
|
12
|
+
const history = (messages) => ({
|
|
13
|
+
namespace: "extra.im",
|
|
14
|
+
name: "history",
|
|
15
|
+
guidance: "Earlier messages, oldest first; sentAt=system-zone time, content.type=body type; null=unknown, read=false=unread, truncated=true=shortened.",
|
|
16
|
+
payload: { messages, ...(note ? { note } : {}) }
|
|
17
|
+
});
|
|
18
|
+
// 读取失败时也可用空消息列表说明事实;显式宿主 history 保持原值,不追加同 key 自动项。
|
|
19
|
+
const hasHistory = items.some((item) => item.namespace === "extra.im" && item.name === "history");
|
|
20
|
+
return items.flatMap((item) => {
|
|
21
|
+
if (automatic(item, "history"))
|
|
22
|
+
return [history(item.payload.messages)];
|
|
23
|
+
if (automatic(item, "history-gap"))
|
|
24
|
+
return note && !hasHistory ? [history([])] : [];
|
|
25
|
+
return [item];
|
|
26
|
+
});
|
|
27
|
+
}
|