Commit Graph
90 Commits
Author SHA1 Message Date
H3CoF6 6f6ce1144b 补全一些onebot action实现 2 (#24)
* feat: implement get profile like

* feat: implement get at all remain

* feat: implement get undirectional friends

* feat: implement set self long nick

* feat: implement set input status

* feat: implement EN 2 ZH

* feat: implement get mini app ark

* feat: implement click inline button

* feat: implement set and send group sign

* feat: implement set qq avatar

* feat: group notice with pic and delete notice implement

* fix(group-notice): POST api and fix new bkn logic
chore.onebot2
2026-05-10 10:14:41 +08:00
DrSmoothl bec23c4dbb [merge] promote SDK changes 2026-05-10 01:29:57 +08:00
DrSmoothl c343021318 feat: add SnowLuma TypeScript SDK 2026-05-10 01:26:35 +08:00
DrSmoothl 9ab4128799 Implement video message upload 2026-05-09 23:06:55 +08:00
手瓜一十雪 95df5234fb Support forced group member cache refresh
Add a `force` flag to member cache refresh logic so events that affect the bot itself trigger an immediate refresh. When the event userUin matches the bot's UIN, `triggerMemberCacheRefresh` sets `force = true` and forwards it to `fetchGroupMemberList`. `fetchGroupMemberList` now accepts an optional `force` parameter (default false) and bypasses the TTL cache when `force` is true, ensuring up-to-date member data after join/leave events.
2026-05-09 19:54:20 +08:00
手瓜一十雪 a7b3809a12 Only track hook states for running PIDs
Stop exposing and retaining hook state for PIDs that are not currently running. listProcesses() no longer returns orphaned states; live-pipe handling ignores PIDs not present in the current process list. When a process is not running its state is immediately torn down (tearDownClient called) and removed, and bridgeManager.onPidDisconnected is notified if the state was logged in. Also reorganized runningSet creation so it can be reused for these checks.
chore.trackpid
2026-05-09 19:38:52 +08:00
手瓜一十雪 c39b3f5c4e Add PTT (voice) upload support with FFmpeg addon
Introduce NT SILK-based voice (PTT) upload pipeline and native FFmpeg addon wrapper.

- Add ffmpeg-addon wrapper (packages/core/src/bridge/highway/ffmpeg-addon.ts) to load platform/arch .node binaries, detect SILK files, and convert inputs to NT SILK via the native addon. Provides encodeSilk, isSilkFile and default temp dir helpers.
- Implement ptt-upload pipeline (packages/core/src/bridge/highway/ptt-upload.ts) to: resolve/fetch audio bytes, convert to NT SILK if needed, send OIDB upload request, perform highway HTTP upload when required, and produce Encodable MsgInfo bytes for commonElem.
- Wire record element support into element-builder: uploadPttMsgInfo is used to build a commonElem for 'record' sends; when SendContext is absent, record sends are skipped with a warning (graceful no-bridge path).
- Update message parsing to accept record segments from data.file, data.url or data.path and drop empty sources.
- Enable canSendRecord in OneBot instance context.
- Add tests covering record parsing and the graceful send path (packages/core/tests/message-parser.test.ts).
- Include prebuilt native ffmpeg addon binaries under packages/runtime/native/ffmpeg and update vite config to validate & copy the ffmpeg addon into the dist layout.

These changes enable sending voice messages by converting/encoding sources to the expected NT SILK format and uploading them through the existing highway/NTV2 flows.
chore.record
2026-05-09 19:32:13 +08:00
手瓜一十雪 2af273b9e2 Simplify WebUI logs and adjust hook reconnect
Translate and consolidate verbose WebUI log messages to shorter English variants (dev mode, initial credentials, forced password change, password update, port fallback, and listening message). Remove a startup log emitted in core index.ts. In HookManager, preserve an existing state.method when detecting an already-injected PID (only set to 'reconnect' if not present) and remove a redundant injection success log to reduce noise.
chore.webui.log
2026-05-09 16:36:03 +08:00
手瓜一十雪 144e0fdd59 Add BridgeEventBus and network manager
Introduce a typed per-kind BridgeEventBus and migrate away from the legacy single-callback firehose. Bridge now exposes `events` and emits via the bus; BridgeManager/OneBotManager no longer wire a global event callback. Add a focused onebot event pipeline (event-pipeline.ts) that subscribes per-kind handlers on instance construction. Replace the in-memory MediaCache with a persistent MediaStore and update all lookups accordingly. Replace the old Http/Ws/HttpPost transport implementations with a unified OneBotNetworkManager and pluggable adapters (server/client/post), and update OneBotInstance to install and manage adapters from config. Remove several legacy files (http-transport, http-post-transport, ws-transport, media-cache) and update imports across the codebase. Also add tests for the bridge event bus, event pipeline, network manager, and rename media tests to reflect MediaStore usage. The bus dispatches handlers in parallel and reports handler errors via an onError hook to avoid one faulty listener blocking others.
2026-05-09 16:30:06 +08:00
手瓜一十雪 1565749105 Add MediaCache and media segment sink
Introduce an in-memory MediaCache to index recently seen image and record segments and wire a MediaSegmentSink into EventConverter to populate it. OneBotInstance now constructs MediaCache and registers a sink to remember image/record metadata; instance-context exposes get_image/get_record lookup handlers that consult the cache (and re-resolve record URLs via bridge OIDB when needed). ApiHandler actions get_image/get_record now accept file_id fallback and use the new context lookups. Removed the old findMediaInStore stub and added comprehensive tests for the cache and sink behavior.
chore.mediacache.1565749
2026-05-09 15:33:13 +08:00
手瓜一十雪 e53a8a01b7 Revert "[merge] dev & ci: default promote-dev-to-main merge strategy to squash"
This reverts commit 3afbcfaae5.
2026-05-09 15:08:41 +08:00
手瓜一十雪 3afbcfaae5 [merge] dev & ci: default promote-dev-to-main merge strategy to squash
Switch default merge_method from 'merge' to 'squash' so dev->main PRs collapse the dev branch's incremental commits into one squash commit on main, keeping main's history linear and release-tag-friendly. Affects: workflow_dispatch input default, decide-step initial value + workflow_dispatch fallback, both push-trigger branches (tag + commit-msg), and the case-statement fallback in the auto-merge step. CONTRIBUTING.md updated to reflect the new default.
2026-05-09 15:06:54 +08:00
手瓜一十雪 c3b328f91d [merge] dev 2026-05-09 15:01:46 +08:00
手瓜一十雪 7942c47808 [merge] dev 2026-05-09 14:58:37 +08:00
手瓜一十雪 46d93e715a ci: use chore.* tag pattern + commit-msg prefix matching for promote workflow
- Tag trigger switched from v* to chore.* so the promote workflow no longer collides with release.yml's v* tag handling. v* tags now drive only the release build; chore.* tags drive only dev->main promotion.

- Commit-message detection on dev is now prefix-only: '^[merge]' or '^chore(release):' (case-insensitive). 'fix: stuff [merge]' no longer triggers; the marker must be at the start of the message.

- CONTRIBUTING.md updated: prefix examples, chore.* tag examples, and an explicit 'all required status checks must pass' branch-protection setup that lists the dev-build typecheck/build matrix as required.
2026-05-09 14:57:06 +08:00
手瓜一十雪 a9027a8610 ci: add promote dev->main workflow + branching docs
Adds .github/workflows/promote-dev-to-main.yml which uses the SnowLuma Bot GitHub App to open (or refresh) a PR from dev into main. Triggered by [merge] or chore(release): commit-msg markers on dev, by v* tag pushes, or via manual workflow_dispatch. Auto-merge is enabled when triggered.

Adds CONTRIBUTING.md describing the dev/main branch model, the promote workflow, the required SNOWLUMA_BOT_APP_ID / SNOWLUMA_BOT_PRIVATE_KEY secrets, and the GitHub branch protection setup needed to forbid direct pushes to main.
2026-05-09 14:43:44 +08:00
手瓜一十雪 5853dc63ff Lookup workflow by name/id and set default repo
Update release workflows to fallback to 'SnowLuma/SnowLuma.Docker.Framework' when RELEASE_REPOSITORY is unset and to resolve the target workflow by name, path, or id. Replace the simple workflow_id string with logic that paginates listRepoWorkflows, finds the matching workflow, validates it exists, and passes workflow.id to createWorkflowDispatch. Improve error messages and logging to include workflow name and id.
v1.6.40
2026-05-09 11:23:50 +08:00
手瓜一十雪 ca14cb5437 Replace DOCKER_RELEASE_TOKEN with SNOWLUMA_TOKEN
Update GitHub Actions release workflows to use the SNOWLUMA_TOKEN secret instead of DOCKER_RELEASE_TOKEN. Changed the github-token input in .github/workflows/release.yml and .github/workflows/dispatch-docker-release.yml for the docker release steps.
v1.6.38
2026-05-09 11:17:02 +08:00
手瓜一十雪 a978d27f3a Add manual Docker rebuild dispatcher
Introduce a manual re-dispatch workflow and wire automatic dispatch from releases to the Docker workflow. dispatch-docker-release.yml was converted to a workflow_dispatch-based "Re-dispatch Docker Release" that accepts snowluma_tag, docker_image_override and platforms_override inputs and forwards them (plus source repository) to the downstream docker-image.yml in the Docker release repo. release.yml gains a dispatch-docker job that runs after the release job and uses a PAT to invoke the same downstream workflow for newly published tags. These changes let maintainers rebuild Docker images for existing tags (e.g. to fix Dockerfile issues or rotate credentials) without re-tagging, and ensure the downstream dispatch runs under the configured token.
v1.6.37
2026-05-09 11:07:59 +08:00
手瓜一十雪 5a5b9d13d1 Use workflow_dispatch to trigger Docker workflow
Switch the release dispatch to call actions.createWorkflowDispatch instead of repos.createDispatchEvent because the target repo only listens for workflow_dispatch on its docker workflow. Add env vars DOCKER_PLATFORMS, DOCKER_WORKFLOW and DOCKER_REF (with sensible defaults) and pass image, tag, push and platforms as inputs. Update log output to include workflow, ref, image, tag and platforms.
v1.6.35
2026-05-09 10:47:29 +08:00
手瓜一十雪 b62a6edd37 Canonicalize WsRole strings and migrate legacy values
Normalize OneBot WS role values to canonical PascalCase ('Api'|'Event'|'Universal') across core and web UI, and support auto-migration from legacy lowercase on-disk values. Updated types, defaults, serializers/parsers, and runtime checks in ws-transport, adjusted WebUI select options and default entries, and updated the client User-Agent string. Added a test to verify that legacy lowercase role values are migrated to the new canonical form on load.
v1.6.34
2026-05-09 10:21:47 +08:00
MliKiowa 4d97f02fe9 Merge pull request #9 from H3CoF6/feat/onebot
implement some onebot api
v1.6.33
2026-05-09 08:52:04 +08:00
H3CoF6 c8dd520d65 feat: implement get cookies and CSRF and credentials 2026-05-09 05:17:18 +08:00
H3CoF6 8b313fe088 feat: implement set qq profile 2026-05-09 05:08:03 +08:00
H3CoF6 049ef2960c feat: implement set online status 2026-05-09 04:57:00 +08:00
H3CoF6 a0d584375a feat: implement get group notice 2026-05-09 04:24:03 +08:00
H3CoF6 51c2fa285a refactor: move web action into web-actions from bridge-actions 2026-05-09 04:08:52 +08:00
H3CoF6 c862a157db feat: implement send group notice 2026-05-09 03:44:08 +08:00
H3CoF6andClaude Sonnet 4.6 d708be4627 fix(webui): password strength indicators not updating
修复密码强度指示器不亮起的问题,将后端返回字段从 met 改为 ok 以匹配前端期望

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 21:03:28 +08:00
H3CoF6 3791addb43 feat: implement get all essence msg 2026-05-08 20:41:47 +08:00
H3CoF6 a40cbdc316 Merge remote-tracking branch 'upstream' into feat/onebot 2026-05-08 16:42:39 +08:00
H3CoF6 7e2ba60073 feat: implement default mark msg as read and add get clientkey onebot api 2026-05-08 16:42:19 +08:00
H3CoF6 e3e364db63 Merge remote-tracking branch 'upstream' into feat/onebot 2026-05-08 01:56:47 +08:00
H3CoF6 4a51e3d686 feat: 引入web方法,实现group honor 2026-05-08 01:56:23 +08:00
DrSmoothl 84de00e6ac ci(actions): update workflows for Node 24 actions 2026-05-07 23:27:55 +08:00
DrSmoothl 08d02c6303 ci(release): dispatch Docker publish on tags
Trigger the external Docker release pipeline when a SnowLuma version tag is pushed.

Keep Docker image and release target configuration in the SnowLuma environment.
2026-05-07 22:44:44 +08:00
手瓜一十雪 e008920f39 Add RoadMap.md and remove testing section
Remove the '测试要求' testing section from README.md and add a new RoadMap.md containing planned V2.0.0 tasks (unify Uid/Uin service with SQLite persistence, improve debug experience with no-packaging debug and correct data dir). This separates roadmap details from the README for clarity and future tracking.
v1.6.30
2026-05-07 19:50:05 +08:00
H3CoF6 99c74b4a66 Merge remote-tracking branch 'upstream' into feat/onebot 2026-05-07 19:29:25 +08:00
DrSmoothl 92c6234b4f build(native): refresh Linux SnowLuma binaries
Update the Linux x64 SnowLuma native binaries from the latest release build.

Leave the websocket native binary unchanged.
2026-05-07 18:42:06 +08:00
手瓜一十雪 0d8e52ee77 fix: #7 v1.6.27 2026-05-07 16:21:35 +08:00
手瓜一十雪 2a4ca46a99 Refactor OneBot networks and event dispatch
Unify per-adapter network configuration into a single `networks` structure and add migration/normalization for legacy on-disk formats. Introduce per-adapter options (messageFormat, reportSelfMessage, enabled, name) and stronger typing in types.ts. Add event-filter utilities to prebuild two serialized payload variants and pick the right one per adapter to avoid repeated JSON.stringify calls. Update HTTP/WS transports to use adapter names/signatures for hot-reload, respect per-adapter options, and improve logging; WS transport also improves client/server lifecycle/reconnect handling. Mark self-sent messages as `message_sent` in the event converter and wire instance dispatch to use the new DispatchPayload. Misc: README edits and accompanying tests added/updated for the refactor.
v1.6.25
2026-05-07 16:01:28 +08:00
手瓜一十雪 19a564991c Add WebUI dev mode auth & dev script
Introduce a development-only WebUI auth mode controlled by SNOWLUMA_DEV_MODE. When enabled, a fixed in-memory password ("snowluma-dev") is used, config/webui.json is not read or written, and password changes are disabled. Expose WebuiAuth.isDevMode() and WebuiAuth.devPassword, add startup logs when dev mode is active, and wire up dev:mode npm scripts (root and packages/core) using cross-env to set the env flags.
2026-05-07 14:36:12 +08:00
手瓜一十雪 466a10a00a Update snowluma Win32 x64 native DLL
Replace packages/runtime/native/snowluma-win32-x64.dll with an updated binary build. This commit updates the native Windows x64 runtime DLL; no other source changes are present in this diff.
v1.6.22
2026-05-07 14:19:27 +08:00
手瓜一十雪 f7cfec1a93 Replace GPU detection with runtime memory info
Remove external GPU detection (no more exec/promisify or detectGpus) and stop returning GPU list from /api/system. Instead expose the Node.js process runtime info (pid, rss, heapTotal, heapUsed, external, arrayBuffers) from the server. Update types to replace gpus with runtime and update the Overview UI: remove GPU list, show PID and formatted runtime memory stats, and adjust imports/icons accordingly. This simplifies system probing (avoids spawning platform commands) and surfaces useful process memory metrics in the WebUI.
2026-05-07 09:39:12 +08:00
手瓜一十雪 3ac4bc79f0 Make OneBot message parsing defensive
Harden parsing of message segments in OneBot instance: skip non-object or array segments, normalize a local `type` string and a safe `data` object, and use those for all branch checks. This prevents runtime errors when segments or segment.data are missing or malformed, while preserving existing previews and placeholder labels (image, face, at, reply, record, video, fallback).
v1.6.20
2026-05-07 09:35:35 +08:00
MliKiowa 3f4b389e6d Merge pull request #6 from venti1112/main
fix: correct ineffective quote replies, use Get-CimInstance for GPU detection with wmic fallback, and show uninstall failure notification
2026-05-07 09:32:51 +08:00
H3CoF6 0d84e3b99e feat: implemented mark msg as read 2026-05-07 05:49:13 +08:00
Ventiの酒 d8d7fa2ede Merge branch 'SnowLuma:main' into main 2026-05-07 02:36:44 +08:00
DrSmoothl 8d33c1f76c chore: ignore macOS metadata files v1.6.18 2026-05-07 00:32:04 +08:00
DrSmoothl 946c1c6981 ci: enable Linux arm64 build matrix 2026-05-07 00:26:07 +08:00