ai_co_discuss 0.6.2 → 0.6.3
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/.agents/skills/discuss-host/references/room.md +1 -1
- package/.agents/skills/discuss-participant/references/situations.md +1 -1
- package/backend/room_search.py +21 -6
- package/docs/en/guide/rooms.md +7 -7
- package/docs/en/guide/working.md +2 -2
- package/docs/guide/rooms.md +7 -7
- package/docs/guide/working.md +2 -2
- package/frontend/locales/en/core.json +2 -0
- package/frontend/locales/en/discussion.json +24 -1
- package/package.json +1 -1
- package/runner/adapters/profiles.mjs +1 -1
- package/runner/codiscuss.mjs +1 -0
- package/runner/discuss.py +3 -1
- package/runner/discussion_launch.mjs +10 -8
- package/runner/free_runner.mjs +22 -19
- package/runner/i18n_en.mjs +1 -0
- package/runner/image_service.mjs +17 -10
- package/runner/moss_windows.mjs +3 -3
- package/runner/steward.mjs +11 -10
- package/web/backup.js +1 -1
- package/web/i18n.js +2 -2
- package/web/modern.css +1 -1
- package/web/modern.js +83 -83
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
### 订阅生图
|
|
38
38
|
|
|
39
|
-
`task.image.subscription` 存在时,优先用 `specialist_members` 中现有专家的显示名派活。名单没有合适成员且 `can_invite` 为 true
|
|
39
|
+
`task.image.subscription` 存在时,优先用 `specialist_members` 中现有专家的显示名派活。名单没有合适成员且 `can_invite` 为 true 时,从 `invite_platforms` 选一个平台,用 `codiscuss launch host-control invite --name 平台 --new` 请进只读的生图成员,再用加入后的显示名派活;不能邀请时请房主添加,不自行扩权。用户指定订阅但该入口不可用时,说明原因,不改走 API。派活说明生成要求和参考附件编号,让专家按[生图规则](../../discuss-participant/references/situations.md#生图)把图片直接作为房间附件交付。两种入口都在时尊重用户指定的 API 或订阅,不重复调用。
|
|
40
40
|
|
|
41
41
|
### 生成模型
|
|
42
42
|
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
任务没有 `image` 时不能生图或改图,不改走其他服务。看本次任务里实际存在的入口:`api` 走房间配置的 API,`subscription` 走订阅专家。两者都在时按用户指定的入口,否则一般请求走 API,需要订阅或内置工具时交订阅专家,不重复生成,不擅自切换计费方式。旧任务只有 `image.model` 和 `image.command`,按 API 处理。
|
|
20
20
|
|
|
21
21
|
- **API**:按张计费,想清楚再调用。UTF-8 JSON 草稿示例 `{"action":"generate","prompt":"画面、风格、文字","size":"1536x1024","n":1}`。按 `image.api.catalog`、模型支持范围和 `image.api.limits` 选参数,可填 `model`、`size`、`quality`、`complexity`、`background`、`output_format`、`output_compression`、`n`、`moderation`、`file_name`、`save_path`。GIF 可填 `frame_count`、`frame_duration_ms`,SVG 生成可填 `svg_model`、`svg_reasoning_effort`。改图用 `"action":"edit"`、`images`(第一张为主图),可填 `mask` 或 `markup`(二选一)及模型支持的 `input_fidelity`;图源为 `{attachment_id}` 或 `{file_path}`,路径须符合本次权限。运行 `image.api.command`(旧任务用 `image.command`),把 `REQUEST.json` 换成草稿路径。返回的附件 ID 用 `message post --attachment` 附上,能看图时先下载核对。API 成员用 `generate_image` / `edit_image` 并遵循工具参数,不走命令;看不到图就只说明已知参数与结果。
|
|
22
|
-
- **订阅**:由 `image.subscription.specialist_members`
|
|
22
|
+
- **订阅**:由 `image.subscription.specialist_members` 中的订阅专家用接入软件自带的生图能力生成或修改,不用另配的 API。参考图用任务中的本机副本,或用 `attachment download` 获取后用 `view_image` 查看。核对工具报告的实际输出路径,用 `attachment upload --file FILE --submission-id ID` 上传,再用 `message post --attachment ID` 附上,正文引用 `[图片 #n]`。你不是订阅专家时,把用户要求及参考附件编号交给主持人,由主持人安排;普通成员点名不会唤醒他人。工具不可用或上传失败时说明原因,不改走 API。
|
|
23
23
|
|
|
24
24
|
## 主动发言
|
|
25
25
|
|
package/backend/room_search.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from bisect import bisect_right
|
|
4
4
|
from contextlib import closing
|
|
5
|
-
from heapq import nsmallest
|
|
5
|
+
from heapq import nlargest, nsmallest
|
|
6
6
|
import json
|
|
7
7
|
import os
|
|
8
8
|
from pathlib import Path
|
|
@@ -191,8 +191,13 @@ def execution_hits(connection, scope, layout):
|
|
|
191
191
|
yield (*order, 2, row["seq"] or 0), row["text"], False, field
|
|
192
192
|
|
|
193
193
|
|
|
194
|
-
def
|
|
195
|
-
"""
|
|
194
|
+
def hit_time(item):
|
|
195
|
+
"""Order a hit by when it was said; message and execution times share the first 19 ISO characters."""
|
|
196
|
+
return (item[3]["created_at"] or "")[:19], item[0]
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def search_transcript(connection, scope, pattern, message_query, limit, newest=False):
|
|
200
|
+
"""Search one room, count all matching fields and return the earliest matches, or the newest first."""
|
|
196
201
|
connection.create_function("regexp", 2, pattern.matches, deterministic=True)
|
|
197
202
|
room = scope["room"]
|
|
198
203
|
messages = message_rows(connection, room, scope["cutoff"], message_query)
|
|
@@ -207,7 +212,8 @@ def search_transcript(connection, scope, pattern, message_query, limit):
|
|
|
207
212
|
total += 1
|
|
208
213
|
yield hit
|
|
209
214
|
|
|
210
|
-
earliest =
|
|
215
|
+
earliest = (nlargest(limit, counted_hits(), key=hit_time) if newest
|
|
216
|
+
else nsmallest(limit, counted_hits(), key=lambda item: item[0]))
|
|
211
217
|
names = member_display_names(connection, room) if earliest else {}
|
|
212
218
|
matches = []
|
|
213
219
|
for _, text, by_number, field in earliest:
|
|
@@ -219,18 +225,27 @@ def search_transcript(connection, scope, pattern, message_query, limit):
|
|
|
219
225
|
|
|
220
226
|
|
|
221
227
|
def search(connection, scopes, params, message_query, grouped):
|
|
222
|
-
"""Apply the same search and caps to a single room or a directory of authorized rooms.
|
|
228
|
+
"""Apply the same search and caps to a single room or a directory of authorized rooms.
|
|
229
|
+
|
|
230
|
+
Across rooms `order=recent` lists the rooms and their matches newest first; otherwise (relevance) rooms whose title
|
|
231
|
+
matches come first, then rooms with more matches, each room's matches in timeline order.
|
|
232
|
+
"""
|
|
223
233
|
pattern = SearchPattern(params)
|
|
224
234
|
if not grouped:
|
|
225
235
|
return (search_transcript(connection, scopes[0][1], pattern, message_query, ROOM_LIMIT)
|
|
226
236
|
if pattern.query else {"matches": [], "total": 0, "truncated": False})
|
|
237
|
+
newest = params.get("order") == "recent"
|
|
227
238
|
rooms, total, truncated = [], 0, False
|
|
228
239
|
for summary, scope in scopes if pattern.query else ():
|
|
229
|
-
result = search_transcript(connection, scope, pattern, message_query, GROUP_LIMIT)
|
|
240
|
+
result = search_transcript(connection, scope, pattern, message_query, GROUP_LIMIT, newest)
|
|
230
241
|
if result["total"]:
|
|
231
242
|
rooms.append({**summary, "matches": result["matches"], "total": result["total"]})
|
|
232
243
|
total += result["total"]
|
|
233
244
|
truncated |= result["truncated"]
|
|
245
|
+
if newest:
|
|
246
|
+
rooms.sort(key=lambda room: (room["matches"][0]["created_at"] or "")[:19], reverse=True)
|
|
247
|
+
else:
|
|
248
|
+
rooms.sort(key=lambda room: (not pattern.matches(1, room.get("title") or ""), -room["total"]))
|
|
234
249
|
return {"rooms": rooms, "total": total, "truncated": truncated}
|
|
235
250
|
|
|
236
251
|
|
package/docs/en/guide/rooms.md
CHANGED
|
@@ -87,15 +87,15 @@ When viewing a project image through the relay on another device, supported imag
|
|
|
87
87
|
- **Interactive visualizations.** A member can place a small web page you can operate (drag a slider, press a button, watch the result change) inside the answer text. It appears at that point in the answer, follows the room theme and light or dark mode, and also appears in place on a phone. It starts running when you scroll near it. Hover over the visualization with a mouse to show its toolbar beside the message, outside the frame. You can view the “Source”, “Open larger preview” in the file preview, open it in a “New tab”, “Download” it as an `.html` file, or “Collapse” it (your choice is remembered). On phones and touchscreens the first row keeps the “…” menu and collapse button. A collapsed visualization shows as one “Interactive visualization” line. Select “Expand” where the collapse button was to bring it back. Members add these on their own when you ask for an illustrated answer, or when they explain a structure, process, or data. When a long answer is folded, its visualizations still appear, and one the fold cuts through shows only its top; select “Show full text” to see all of it. Read-only share pages and read-aloud show a single “Interactive visualization” line instead, so rely on the member's written conclusion. `.html` attachments do not run inside messages; select the file card to open them in the preview or a new tab. Some visualizations are question panels: after you rank, allocate, or adjust and press the panel's submit button, the result is added above the message box as a quote rather than sent. You can edit or remove it, and it counts as your reply only when you send it. Submitting the same panel again replaces its earlier result.
|
|
88
88
|
- **Member access to attachments.** For supported automatic runs, the local service downloads the file and passes its information to the receiving member. Supported members can receive your ordinary image attachments directly with the task. Images sent by the host or another member are opened on demand. Local software uses the attachment path, and image-capable API members use the attachment ID. For API members, enable “Images” on the member card to view images. UTF-8 text attachments can be read on request. Members will say when they cannot read a format such as PDF. Temporary files (large attachments in the cloud) are also downloaded by the local service, into the attachment cache, and the task gives their local path, so read-only members can read them too; over 2 GiB or when a download fails, the task says so and gives the download command. A temporary file can no longer be downloaded once it has expired. External members cannot download room attachments.
|
|
89
89
|
|
|
90
|
-
#### Generate images or
|
|
90
|
+
#### Generate images, video, or 3D models from the composer
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
You can open any media mode without setting up a service first. Only “API image generation”, “Video model”, and Tripo require enabling and configuring a service when creating a room or under “Room → Collaboration settings”. The “Settings” button in each media panel opens the matching room settings. Existing room settings still enable the image API under “API image generation” and “Enable both”. Turning the switch off or selecting “Subscription images” keeps the API off. Subscription availability is determined separately.
|
|
93
93
|
|
|
94
|
-
- On desktop (over 700 px),
|
|
95
|
-
-
|
|
96
|
-
- “Generate model” sends the description, method, split-parts setting and reference files to the host as an ordinary user message. Paired devices use the same composer. The room owner selects a modeling specialist on the Tripo card under “Generate model”. The host assigns modeling requests to that member. Enter a description or attach a reference.
|
|
97
|
-
- “Video generation” mode can be entered without a video service. Under “Generation method” in
|
|
98
|
-
- To edit an image, add image attachments and
|
|
94
|
+
- On desktop (over 700 px), hover over the mode capsule on the left of the composer. On narrow screens (700 px or less), tap the slim tab on the left. Choose a media mode. The button next to the paperclip shows the current generation method (for example “Host decides”); select it to open the options panel and set the “Generation method”. A line under the method cards says who does the work, roughly how long it takes, and whose allowance it uses. Unavailable methods are dimmed; selecting one shows the reason on that line. The method last chosen for each mode is remembered in this browser and used again next time and in other rooms; the first time it is “Host decides”. For methods that go to the host the send button is an up arrow; for methods that call an API directly it is a sparkle.
|
|
95
|
+
- In “Image generation”, both “Host decides” and “Subscription images” send your description, size, quality, format, background, complexity, count, and reference attachments to the host as a regular message. “Subscription images” requires a configured native image-capable adapter or an existing member using one. The host needs roster permission to invite a member. “API image generation” calls the service directly and posts the result as an attachment without waking members. Controls only the API understands, such as “Model”, “Moderation”, compression, GIF and SVG options, and reference roles for edits, stay in place but are disabled for the other methods.
|
|
96
|
+
- “Generate model” sends the description, method, split-parts setting and reference files to the host as an ordinary user message. Paired devices use the same composer. The room owner selects a modeling specialist on the Tripo card under “Generate model”. The host assigns modeling requests to that member. Enter a description or attach a reference. Add reference images and reference models (GLB, glTF, OBJ, FBX, STL and so on) with the paperclip. Add Tripo under “Generate model” in Create Room or the room’s collaboration settings. The “Settings” button at the top right of “Model options” takes you to that section. Open “Configure Tripo” on the card, enter an API key and select Global (default) or Mainland China. Tripo becomes selectable when the room has the card and the computer has a saved key. Use the same dialog to replace or clear the key. Clearing it affects all rooms on that computer. The local service stores the key privately and passes it to the owner-selected specialist during room tasks. Administrators can read status with `codiscuss admin media model-settings` or pass a private JSON file with `--file FILE`. It accepts `api_key`, `region` (`global` or `cn`), or `{"clear":true}`.
|
|
97
|
+
- “Video generation” mode can be entered without a video service. Under “Generation method” in the options panel, choose “Host decides”, “AI-coded”, or “Video model”. The first two do not call a video API: the description, method, resolution, duration and attachments go to the host as an ordinary user message, and a member writes animation code and renders it to a video. This needs a host in the room, and a browser and ffmpeg on the computer that runs the work. The “Model” field is greyed out for these methods, “Resolution” is chosen by aspect ratio and definition (for example “16:9 · 1080p”), and the duration presets are 10, 30 and 60 seconds, up to 600 seconds. With “Video model”, “Resolution” and the duration presets switch to what that video service supports; the number and positions of the buttons stay the same. “Video model” calls the room’s video service directly; the result appears as an attachment without waking members. When the room has video generation off or no key, this option is greyed out with the reason shown below it.
|
|
98
|
+
- To edit an image through the API, add image attachments and assign reference, mask, or markup in the options panel. “Video model” uses the first image attachment as its reference.
|
|
99
99
|
- If something fails, the notice at the bottom right explains why and the draft stays in place. Refreshing the page or returning to the room resumes checking unfinished jobs. If only some images were saved or posting failed, you can post the retained attachments without generating again. Select “Discard media job” if you no longer want to post them.
|
|
100
100
|
|
|
101
101
|
### 5. Export, import, and branch rooms
|
package/docs/en/guide/working.md
CHANGED
|
@@ -13,7 +13,7 @@ Message a member or host, understand main and branch work and assignment labels,
|
|
|
13
13
|
- **Check the hint before sending.** The line under the composer says what sending will do, given who is busy right now: when the mentioned member is free it reads “Goes to … now, alongside the work in progress (a branch)”; when it is busy it says the message waits in the queue; with nobody mentioned while the room is busy, it suggests mentioning a free member to have it start right away.
|
|
14
14
|
- **Reply, search, and filter.** Use “Reply” in a message menu to link a reply to the original. Clicking a `#number` anywhere (in messages, the brief, executions or the event log) jumps to that message in the conversation; click “Back to where you were” to return. A number from another room opens that room at the message; click “Back to “room name”” at the bottom to return to the room and place you jumped from, or click × to dismiss the prompt and stay in the current room. At the top of the room, “Filter messages and cards” filters by user, host, member, or card type.
|
|
15
15
|
- **Find in a room.** The find box at the top of the room (`Ctrl+F` opens it) searches message text and `#numbers`, the progress and failure reasons on run cards, and attachment names; private chats and withdrawn messages are not searched. Its three switches are “Match case”, “Match whole word” and “Use regular expression”. To the right it shows which match you are on out of how many; `Enter`, `Shift+Enter` or the up and down arrows step through them. Every match is marked and the current one is darker. “Show only matches” uses the same words and switches to narrow the message list to the messages with a match (including ones matched only on a run card or an attachment name); `Esc` or × clears it and closes the find box. The find box stays folded into one search button at the top of the room; click it or press `Ctrl+F` to open it over the tab bar. × or `Esc` clears and closes it, and clicking elsewhere does not close it while it has search words. On a phone there is no separate search button: tap the filter button at the top right and choose the first item, “Search messages”, to open the find box; the filter button stays highlighted while there are search words.
|
|
16
|
-
- **Search all rooms.** Turn on the fourth switch in the find box (the layers icon; its tooltip names the current scope: on is all rooms, off is this room), or press `Ctrl+Shift+F` to open the find box on all rooms, and the same words and switches search the collaboration rooms and MOSS on this computer, archived rooms included (external rooms are not on this computer and are not searched). The results float under the find box, grouped by room with the room name and match count in each heading; each shows the author, the time and the words around the match, and the list scrolls when it is long. The count is the number of results you can step through, with + after it when some room was cut short. Clicking a result opens the room it is in, shows it there and closes the list; `Enter` or the up and down arrows then step on to the next result, opening its room when it is in another one, with the switch staying on. `Esc` first closes the list, and a second press clears the search and closes the find box; clicking back in the find box, or changing the words or a switch, opens the list again. Each room lists at most 50 results; when there are more, click “… more in this room” under it to open that room, back in this-room scope with the same words, and step through all of them there. The scope switch is not remembered: the page opens on this room next time.
|
|
16
|
+
- **Search all rooms.** Turn on the fourth switch in the find box (the layers icon; its tooltip names the current scope: on is all rooms, off is this room), or press `Ctrl+Shift+F` to open the find box on all rooms, and the same words and switches search the collaboration rooms and MOSS on this computer, archived rooms included (external rooms are not on this computer and are not searched). The results float under the find box, grouped by room with the room name and match count in each heading; each shows the author, the time and the words around the match, and the list scrolls when it is long. “Sort” at the top of the list switches between “Relevance” (rooms whose name matches come first, then rooms with more matches, each room's results in time order) and “Recent activity” (rooms and their results newest first, each room listing its newest 50); switching searches again at once, and the order is not remembered either. The count is the number of results you can step through, with + after it when some room was cut short. Clicking a result opens the room it is in, shows it there and closes the list; `Enter` or the up and down arrows then step on to the next result, opening its room when it is in another one, with the switch staying on. `Esc` first closes the list, and a second press clears the search and closes the find box; clicking back in the find box, or changing the words or a switch, opens the list again. Each room lists at most 50 results; when there are more, click “… more in this room” under it to open that room, back in this-room scope with the same words, and step through all of them there. The scope switch is not remembered: the page opens on this room next time.
|
|
17
17
|
|
|
18
18
|
- When you send an image, the page keeps its local preview. The message receipt and member status updates preserve your reading position after sending.
|
|
19
19
|
- **Send several messages in a row.** You can send the next message while the previous one still shows “Sending…”. If the room is busy and a message is expected to queue, it appears immediately above the composer. The confirmed queue entry takes its place. The browser submits messages in order and continues if one fails. The failed card keeps the original text and attachments so you can resend or discard it. Sending and network retries continue if you switch rooms. Return to the original room to find its failed cards. Refreshing or closing the page clears unsent messages held by that page.
|
|
@@ -133,4 +133,4 @@ Addresses without an extension (such as `/about`) opened in a browser return the
|
|
|
133
133
|
- **Question cards are part of the room record.** People who can read the room can see the questions and answers. Do not enter passwords, API keys, or tokens.
|
|
134
134
|
- **During a discussion.** You cannot use `@all`, `@all-seq`, withdraw or edit and rewind a message, or branch.
|
|
135
135
|
|
|
136
|
-
Choose “Generate model” beside the composer, then select
|
|
136
|
+
Choose “Generate model” beside the composer, then select the button next to the paperclip that shows the current generation method to open the “Model options” panel and set “Generation method” and “Split parts”. Add reference images and reference models with the paperclip. Sending posts the description and attachments to the host as an ordinary message. The owner selects a modeling specialist on the Tripo card under “Generate model”. The host sends the description and references to that member. Open a GLB or a self-contained glTF attachment or project file to preview it. Drag to orbit, scroll to zoom and right-drag to pan. On touchscreens, use two fingers to zoom and pan.
|
package/docs/guide/rooms.md
CHANGED
|
@@ -85,15 +85,15 @@
|
|
|
85
85
|
- **交互式可视化**:成员可以在回答正文里放一段可以操作的网页(拖动滑块、点按钮看结果变化),它显示在正文中的原位置,跟随房间主题和深浅色,手机上同样直接显示。滚到它附近才开始运行。用鼠标悬停时,工具栏显示在消息卡片右侧、可视化框外,不遮挡页面。可看“源码”、“放大”到文件预览窗口、在“新标签页”打开、“下载”为 `.html` 文件或“收起”(会记住选择)。手机与触屏保留框内第一行的“…”菜单与收起按钮。收起后显示为一行“交互式可视化”,在原来的收起位置点“展开”恢复。成员在你要求“图文并茂”、或讲结构、流程、数据时会主动配图。长回答折叠时,可视化照常显示,被折叠线截到的只露出顶部,点“展开全文”看完整的。只读分享页和朗读只显示“交互式可视化”一行,结论以成员写在正文里的文字为准。`.html` 附件不在消息内显示,点文件卡片在预览窗口或新标签页打开。有的可视化是提问面板:你在里面排序、分配或调整后点它的提交按钮,结果会作为引用放到输入框上方,不会直接发出;你可以删改,点发送才算回答。同一面板再次提交会替换上一次的结果。
|
|
86
86
|
- **成员读取附件**:本机服务为支持附件的自动执行下载文件,并把文件信息交给接收任务的成员。你发的普通图片可随任务直接交给支持看图的成员。主持人或成员发的图片按需打开,本机软件读附件路径,支持看图的 API 成员按附件编号读取。API 成员需在卡片设置中打开“看图”才能看图,UTF-8 文本附件可按需读取,PDF 等其他文件读不到时会如实说明。临时文件(云上的大附件)也由本机服务下载到附件缓存,任务里直接给本机路径,只读成员也能读;超过 2 GiB 或下载失败时,任务里如实说明并给出下载命令;临时文件过期后无法再下载。外部成员无法下载房间附件。
|
|
87
87
|
|
|
88
|
-
####
|
|
88
|
+
#### 从输入框生成图片、视频或三维模型
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
打开媒体模式不要求预先配置服务。API 生图、视频模型和 Tripo 才需要在新建房间或“房间 → 协作设置”启用并配置。三个媒体面板的标题行均有“设置”,点开可到对应的协作设置。现有生图设置中,“API 生图”和“两者都开”仍开启 API,关闭或选“订阅生图”则不开放 API。订阅生图的可用性独立判断。
|
|
91
91
|
|
|
92
|
-
- 桌面(>700px
|
|
93
|
-
-
|
|
94
|
-
- “生成模型”会把描述、生成方式、拆分选择和参考附件作为普通用户消息发给主持人,已配对设备使用相同入口。房主在“生成模型”的 Tripo
|
|
95
|
-
-
|
|
96
|
-
-
|
|
92
|
+
- 桌面(>700px)将鼠标移到输入框左侧的模式胶囊上展开,手机等窄屏(≤700px)点左侧的模式侧翼展开。选中媒体模式后,回形针右侧的按钮显示当前生成方式(如“主持人判断”),点它打开参数面板选择“生成方式”。方式卡片下面有一行说明,写明谁来做、大约多久、用谁的额度;不可用的方式会置灰,点它时这一行改为说明原因。每种模式上次选的生成方式会记在这个浏览器里,下次和在其他房间都沿用;第一次使用时是“由主持人判断”。发给主持人的方式,发送按钮是向上箭头;直接调用接口的方式是星形。
|
|
93
|
+
- “生图”里,“由主持人判断”和“订阅生图”都将描述、尺寸、画质、格式、背景、复杂度、数量和参考附件作为普通消息发给主持人。选择“订阅生图”需要本机或现有成员的接入方式支持原生生图;如需邀请,主持人须有管理成员名单的权限。“API 生图”直接调用服务,结果作为附件发出,不唤醒成员。只有接口才用得上的“模型”“内容审核”,以及压缩率、GIF、SVG 和改图的参考图角色等选项,在其他方式下保留原位但不可改。
|
|
94
|
+
- “生成模型”会把描述、生成方式、拆分选择和参考附件作为普通用户消息发给主持人,已配对设备使用相同入口。房主在“生成模型”的 Tripo 卡片中指定一位建模专家,主持人按所选成员派活。至少填写描述或添加一个参考附件;参考图和参考模型(GLB、glTF、OBJ、FBX、STL 等)都用回形针添加。要使用 Tripo,在“新建房间”或右栏“协作设置”的“生成模型”下添加 Tripo。也可以从“模型参数”标题行的“设置”跳转到该项。打开卡片的“设置 Tripo”,填写 API Key 并选择国际(默认)或中国大陆。只有已添加 Tripo 且电脑已有密钥的房间才能选择它。弹窗也可更换或清除密钥;清除会影响这台电脑上的所有房间。密钥由电脑私有保存,只在房间任务中传给指定的建模专家。管理员可用 `codiscuss admin media model-settings` 查看状态,用 `--file FILE` 指定含 `api_key`、`region`(`global` 或 `cn`)或 `{"clear":true}` 的私有 JSON 文件。
|
|
95
|
+
- “视频生成”模式不需要先开启视频服务就能进入。在参数面板的“生成方式”里选“由主持人判断”、“AI 代码制作”或“视频模型”。前两种不调用视频接口:描述、生成方式、分辨率、时长和附件会作为普通用户消息发给主持人,由成员写动画代码并渲染成视频交回,需要房间有主持人,执行电脑要有浏览器和 ffmpeg;这时“模型”一项置灰,“分辨率”按比例和清晰度选择(如“16:9 · 1080p”),时长预设为 10、30、60 秒,最长 600 秒。选“视频模型”时,“分辨率”和时长预设换成该视频服务支持的规格,按钮个数和位置不变。“视频模型”调用房间的视频服务直接生成,结果以附件出现、不唤醒成员;房间没开启视频生成或没填密钥时,这一项置灰并在下方说明原因。
|
|
96
|
+
- API 改图时先添加图片附件,再在参数面板指定参考图、蒙版或标注。“视频模型”使用第一张图片附件作为参考图。
|
|
97
97
|
- 失败会在右下角显示原因,原草稿保留。刷新页面或回到房间后,会继续查询未完成的任务。部分图片已保存或发消息失败时,可以发布保留的附件,不会重新生成。若不再需要,点“放弃媒体任务”清除待发布状态。
|
|
98
98
|
|
|
99
99
|
### 5. 导出、导入与分支房间
|
package/docs/guide/working.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
- **发之前看提示**:输入框下方的一行会按当前谁在忙说明这条发出后会怎样,比如被 @ 的成员空闲时写“立即发给某某,与正在进行的工作并行(支线)”,它正忙时写这条会先排队;没 @ 人而房间正忙时,会提示你可以 @ 一位空闲成员让它马上开工。
|
|
14
14
|
- **回复、搜索与筛选**:消息菜单点“回复”关联原消息;点任何地方的 `#编号`(消息、简报、执行、事件记录里)会跳到消息里该条的位置,看完点“返回原位置”回到原处;编号属于其他房间时会切到那个房间并定位,点底部的“返回「原房间名」”回到跳转前的房间与位置,点旁边的 × 可关闭提示并留在当前房间;房间顶部可按用户、主持、成员与卡片类型“筛选消息与卡片”。
|
|
15
15
|
- **在房间内查找**:房间顶部的查找框(`Ctrl+F` 打开)搜消息正文与 `#编号`、执行卡片上的进展和失败原因、附件文件名,不搜私聊和已撤回的消息。框内三个开关是“区分大小写”“全字匹配”“使用正则表达式”;右侧显示第几处/共几处,`Enter`、`Shift+Enter` 或上下箭头逐处跳转,所有命中都会标出、当前一处颜色更深;“只显示命中”按同样的关键词和开关,把消息列表收窄到有命中的消息(只在执行卡片或附件名里命中的也算);`Esc` 或 × 清空并收起查找框。查找框平时收成房间顶部的一个搜索按钮,点它或按 `Ctrl+F` 打开,浮在标签栏上方;× 或 `Esc` 清空并收起,框里有查找词时点别处不会收起;手机上没有单独的搜索按钮,点右上角的筛选按钮,选第一项“搜索消息”打开查找框,有查找词时筛选按钮会高亮。
|
|
16
|
-
- **搜索全部房间**:打开查找框里的第四个开关(叠层图标,悬停提示当前范围,开着是“全部房间”,关着是“本房间”),或按 `Ctrl+Shift+F` 直接以全部房间打开查找框,同一个关键词和开关就改为搜这台电脑上的协作房间和 MOSS
|
|
16
|
+
- **搜索全部房间**:打开查找框里的第四个开关(叠层图标,悬停提示当前范围,开着是“全部房间”,关着是“本房间”),或按 `Ctrl+Shift+F` 直接以全部房间打开查找框,同一个关键词和开关就改为搜这台电脑上的协作房间和 MOSS(含已存档房间,外部房间不在本机、不搜)。结果浮在查找框下方,按房间分组,组头写房间名和命中数,每条显示作者、时间和命中前后的片段,太长时在浮层里滚动。浮层顶部的“排序”可切换“相关度”(房间名命中关键词的排前面,其次按命中数从多到少,房间内按时间先后)和“最近发言”(按最近一条命中的时间,房间和房间内都是新的在前;每个房间列出最新的 50 条),切换后立即重新搜索,排序同样不会记住;计数是能逐条跳到的结果数,有房间被截断时后面加 +。点一条会进入那条所在的房间并定位到它,同时收起浮层;之后用 `Enter`、上下箭头接着逐条跳,下一条在别的房间就进那个房间,开关保持打开。`Esc` 先收起浮层,再按一次清空并收起查找框;收起后点回查找框,或改关键词、拨开关,浮层重新展开。每个房间最多列出 50 条,超出时点该房间下的“还有 N 条”,会进入那个房间、切回本房间范围并保留关键词,在那里逐条看全部。范围开关不会记住,下次打开网页仍是本房间。
|
|
17
17
|
|
|
18
18
|
- 发送图片时,当前页面沿用本机预览。消息回执和成员执行状态出现时,页面保留刚发送时的阅读位置。
|
|
19
19
|
- **连续发送与失败重试**:上一条仍显示“发送中…”时可以发送下一条。房间正忙、消息预计需要排队时,每条先显示在输入框上方的排队列表里,网站确认后在原位成为正式排队项。浏览器按点击顺序提交,单条失败后继续发送后续消息。失败卡保留原文和附件,可点“重新发送”或“放弃”。切到其他房间后,发送和网络重试会继续;回到原房间还能找到失败卡。刷新或关闭页面会清除本页未发出的消息。
|
|
@@ -133,4 +133,4 @@
|
|
|
133
133
|
- **答题卡是房间公开记录**:问题与回答和普通消息一样对能阅读本房间的人可见,不要在里面填写密钥、令牌或密码。
|
|
134
134
|
- **讨论中的限制**:讨论进行中暂不能使用 `@全体成员`、`@全体依次`、撤回、编辑回退和分支。
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
在输入框左侧选“生成模型”,点回形针右侧显示当前生成方式的按钮打开“模型参数”面板,可选“生成方式”和“拆分部件”;参考图和参考模型用回形针添加。发送后,描述和附件会作为普通消息交给主持人。请房主在“生成模型”的 Tripo 卡片中指定建模专家,主持人会把描述和附件交给该成员。打开附件或项目中的 GLB、内嵌资源的 glTF 可预览模型。拖动旋转,滚轮缩放,右键拖动平移;触屏用双指缩放和平移。
|
|
@@ -571,6 +571,8 @@
|
|
|
571
571
|
"清除查找(Esc)": "Clear find (Esc)",
|
|
572
572
|
"正在搜索…": "Searching…",
|
|
573
573
|
"范围:全部房间(点击只查本房间)": "Scope: all rooms (click to search only this room)",
|
|
574
|
+
"相关度": "Relevance",
|
|
575
|
+
"排序": "Sort",
|
|
574
576
|
"范围:本房间(点击查全部房间)": "Scope: this room (click to search all rooms)",
|
|
575
577
|
"在全部房间中查找": "Find in all rooms",
|
|
576
578
|
"全部房间的查找结果": "Find results in all rooms",
|
|
@@ -515,5 +515,28 @@
|
|
|
515
515
|
"已生成一条经验建议 · 去确认": "A rule suggestion is ready · Review it",
|
|
516
516
|
"本次产出": "Results of this review",
|
|
517
517
|
"想存成工作流": "Save as workflow?",
|
|
518
|
-
"想记下": "Remember?"
|
|
518
|
+
"想记下": "Remember?",
|
|
519
|
+
"请点“设置”在协作设置中启用": "Open Settings to enable this in Collaboration settings.",
|
|
520
|
+
"未填接口密钥,请点“设置”完成配置": "API key missing. Open Settings to finish setup.",
|
|
521
|
+
"本机未配置支持订阅生图的软件": "No software with subscription image generation is configured on this computer.",
|
|
522
|
+
"请输入描述或添加参考附件": "Enter a description or add a reference attachment.",
|
|
523
|
+
"请生成图片。生成方式:{method};尺寸:{size};画质:{quality};格式:{format};背景:{background};复杂度:{complexity};数量:{count}。{description}": "Please generate an image. Method: {method}. Size: {size}. Quality: {quality}. Format: {format}. Background: {background}. Complexity: {complexity}. Count: {count}. {description}",
|
|
524
|
+
"主持人判断": "Host decides",
|
|
525
|
+
"主持人看描述决定谁来画、怎么画;会唤醒成员,通常要等几分钟。": "The host reads the description and decides who draws it and how. Wakes members; usually takes a few minutes.",
|
|
526
|
+
"成员用自己软件的生图能力画,用该成员的订阅额度,通常要等几分钟。": "A member draws it with their own software, on that member’s subscription. Usually takes a few minutes.",
|
|
527
|
+
"直接调用生图接口,按接口账号计费,不唤醒成员,通常更快。": "Calls the image API directly, billed to the API account. Wakes no one; usually faster.",
|
|
528
|
+
"主持人看描述决定用代码制作还是视频模型;会唤醒成员。": "The host reads the description and decides between code and a video model. Wakes members.",
|
|
529
|
+
"成员写动画代码并渲染成视频,适合讲解和图文动效,用成员的额度,通常要等几分钟。": "A member codes the animation and renders it. Suits explainers and motion graphics; uses the member’s allowance and usually takes a few minutes.",
|
|
530
|
+
"直接调用视频模型接口,按接口账号计费,不唤醒成员。": "Calls the video model API directly, billed to the API account. Wakes no one.",
|
|
531
|
+
"主持人看描述和参考附件决定建模方式;会唤醒成员。": "The host reads the description and references and decides how to model it. Wakes members.",
|
|
532
|
+
"成员写 Blender 脚本建模,适合规则形体,用成员的额度。": "A member models it with a Blender script. Suits regular shapes; uses the member’s allowance.",
|
|
533
|
+
"成员按尺寸参数生成模型,之后改尺寸方便,用成员的额度。": "A member builds it from dimensions, easy to resize later; uses the member’s allowance.",
|
|
534
|
+
"成员调用 Tripo 从描述或参考图生成,按次扣 Tripo 积分。": "A member calls Tripo with the description or reference image; each run costs Tripo credits.",
|
|
535
|
+
"交给主持人,或调用 API 生图": "Ask the host or use the image API",
|
|
536
|
+
"仅用于 API 生图": "Only applies to API image generation",
|
|
537
|
+
"图片附件将随请求发给主持人。": "Image attachments will be sent to the host with the request.",
|
|
538
|
+
"管理 API 生图。订阅生图由主持人安排,不受此开关限制。": "Manage API image generation. The host can arrange subscription image generation regardless of this setting.",
|
|
539
|
+
"未添加。此房间不能调用 API 生图。": "Not added. This room cannot use the image API.",
|
|
540
|
+
"此房间未开启 API 生图。要开启,请选择“API 生图”或“两者都开”。": "The image API is off for this room. Select “API image generation” or “Enable both” to turn it on.",
|
|
541
|
+
"订阅生图": "Subscription images"
|
|
519
542
|
}
|
package/package.json
CHANGED
|
@@ -251,7 +251,7 @@ export const ADAPTER_PROFILES = {
|
|
|
251
251
|
unsupported_hints: { auto: t('agy 只在交互窗口提供自动模式,后台运行(-p)不支持') },
|
|
252
252
|
// Only a conversation this tool created gets its session rules; an existing one keeps its own project and permissions.
|
|
253
253
|
client: 'antigravity', adopt: 'session', host_existing: false, own_project_when_bound: true, browse_sessions: true, copy_bound: true,
|
|
254
|
-
capabilities: { steer_receipt: false, live_details: true, compact_context: false, delivery: PROCESS, rewind: 'cut', project: true, access_env: true, limits_directories: true, confines_reads: true, chat: true, resume: true, capture: FINAL_REMARK },
|
|
254
|
+
capabilities: { steer_receipt: false, live_details: true, compact_context: false, delivery: PROCESS, rewind: 'cut', project: true, access_env: true, limits_directories: true, confines_reads: true, chat: true, resume: true, capture: FINAL_REMARK, native_image_gen: true },
|
|
255
255
|
// In read and write, agy allows only codiscuss commands and headless agy ends the turn on a denied one; agy streams no
|
|
256
256
|
// thinking text, so without a word at each turning point the page cannot show how far it got.
|
|
257
257
|
// A denied command ends headless agy's turn at once (1.5.16, 2026-11-25), so it must not list or read through the shell.
|
package/runner/codiscuss.mjs
CHANGED
|
@@ -100,6 +100,7 @@ function website_cli(args) {
|
|
|
100
100
|
case: t('区分大小写'),
|
|
101
101
|
word: t('全字匹配'),
|
|
102
102
|
regex: t('使用正则表达式'),
|
|
103
|
+
order: t('全部房间搜索的排序:relevance 按相关度(标题命中、命中数),recent 按最近发言'),
|
|
103
104
|
}) },
|
|
104
105
|
});
|
|
105
106
|
if (result.error) throw new Error(t('网站操作需要 Python 3.10+,无法启动 {value1}:{value2}', { value1: executable, value2: result.error.message }));
|
package/runner/discuss.py
CHANGED
|
@@ -739,6 +739,8 @@ def build_parser(prog="discuss"):
|
|
|
739
739
|
search.add_argument("--case", action="store_true", help=search_help.get("case", "区分大小写"))
|
|
740
740
|
search.add_argument("--word", action="store_true", help=search_help.get("word", "全字匹配"))
|
|
741
741
|
search.add_argument("--regex", action="store_true", help=search_help.get("regex", "使用正则表达式"))
|
|
742
|
+
search.add_argument("--order", choices=("relevance", "recent"), default="relevance",
|
|
743
|
+
help=search_help.get("order", "全部房间搜索的排序:relevance 按相关度(标题命中、命中数),recent 按最近发言"))
|
|
742
744
|
add_leaf(subcommands, registry, "health", "检查目标站点的 HTTP 健康接口")
|
|
743
745
|
api = add_leaf(subcommands, registry, "api", "直接调用本站 /api 或 /r;请求体原样传送")
|
|
744
746
|
api.add_argument("path", help="本站路径,可含查询参数;禁止完整 URL")
|
|
@@ -1410,7 +1412,7 @@ def plan_search(args):
|
|
|
1410
1412
|
"""Send the same search parameters as the page, with any bound room read context."""
|
|
1411
1413
|
params = {"q": args.keyword, **{key: str(int(getattr(args, key))) for key in ("case", "word", "regex")}}
|
|
1412
1414
|
if args.search_room is None:
|
|
1413
|
-
return RequestPlan("/api/search", params={**params, "archived": "1"})
|
|
1415
|
+
return RequestPlan("/api/search", params={**params, "archived": "1", "order": args.order})
|
|
1414
1416
|
args.room = args.search_room
|
|
1415
1417
|
return RequestPlan(f"/api/rooms/{args.room}/search", params={**params, **read_context_params(args)})
|
|
1416
1418
|
|
|
@@ -39,7 +39,7 @@ import { local_service_stop, local_services } from './tts_providers.mjs';
|
|
|
39
39
|
import { CHANNELS, can_notify, moss_send_requirements, channel_command, weixin_command } from './channels.mjs';
|
|
40
40
|
import { ask_group_task_limit, change_moss_window, clear_moss_group_pending, moss_group_enabled, moss_group_failure, moss_group_task_usage, moss_window_key, moss_window_habits, moss_window_preferences, moss_window_usage, moss_windows, moss_windows_patch } from './moss_windows.mjs';
|
|
41
41
|
import { stt_part } from './stt.mjs';
|
|
42
|
-
import { image_check, image_settings, MODEL_ID, room_image, save_image_settings, validate_image_limits } from './image_service.mjs';
|
|
42
|
+
import { image_check, image_settings, MODEL_ID, native_image_platforms, room_image, save_image_settings, validate_image_limits } from './image_service.mjs';
|
|
43
43
|
import { open_project } from './adapters/api_files.mjs';
|
|
44
44
|
import { redact_media_text, run_image_tool } from './adapters/api_images.mjs';
|
|
45
45
|
import { active_suggestions, admission_view, change_managed_experience, experiences, legacy_text, queue_legacy_experience } from './host_experience.mjs';
|
|
@@ -659,6 +659,7 @@ export async function room_models(home, raw, { read_defaults = profile => cached
|
|
|
659
659
|
api_max_requests: config.api_max_requests ?? DEFAULT_API_MAX_REQUESTS,
|
|
660
660
|
// Whether members may draw here, and whether this computer has an image service to draw with.
|
|
661
661
|
image_generation: Boolean(config.image_generation), image_mode: config.image_mode ?? 'api', image_configured: image_settings(home).configured,
|
|
662
|
+
native_image_configured: native_image_platforms(home).length > 0,
|
|
662
663
|
model_specialist: config.model_specialist || '', model_generation: Boolean(config.model_generation), model_configured: model_configured(home),
|
|
663
664
|
video_generation: Boolean(config.video_generation), video_configured: video_settings(home).configured };
|
|
664
665
|
}
|
|
@@ -5834,7 +5835,7 @@ async function create_steward(home, view, prepared, options, private_window = fa
|
|
|
5834
5835
|
|
|
5835
5836
|
function moss_group_profile(home, settings, channel, chat_id, preferences) {
|
|
5836
5837
|
const adapter = preferences.adapter || settings.steward?.adapter;
|
|
5837
|
-
const [platform, saved] = steward_software(settings, adapter);
|
|
5838
|
+
const [platform, saved] = steward_software(settings, adapter, preferences.adapter ? preferences.preset : settings.steward?.preset);
|
|
5838
5839
|
if (!saved || !lockdown_support(adapter, { project_access: 'read' }).supported) throw new Error(t('当前 MOSS 软件无法按群窗口要求以只读档运行。'));
|
|
5839
5840
|
const cwd = moss_group_cwd(home, moss_window_key(channel, chat_id));
|
|
5840
5841
|
const { executable, ipc_directory, base_url, api_protocol, api_key_ref } = saved;
|
|
@@ -6154,7 +6155,7 @@ export async function poll_steward_proactive(home) {
|
|
|
6154
6155
|
|
|
6155
6156
|
/** Check both platform identity and the selected adapter using generic profile metadata. */
|
|
6156
6157
|
function steward_software_changed(config, view, settings) {
|
|
6157
|
-
const [platform] = steward_software(settings, view.adapter);
|
|
6158
|
+
const [platform] = steward_software(settings, view.adapter, view.preset);
|
|
6158
6159
|
const [name, profile] = Object.entries(config.participants)[0];
|
|
6159
6160
|
return Boolean(platform && (platform_of(name) !== platform || profile.adapter !== view.adapter));
|
|
6160
6161
|
}
|
|
@@ -6217,7 +6218,7 @@ function prepare_group_delivery(home, config, settings) {
|
|
|
6217
6218
|
const { channel, chat_id } = config.moss_window;
|
|
6218
6219
|
const key = moss_window_key(channel, chat_id);
|
|
6219
6220
|
const preferences = moss_window_preferences(settings.steward?.windows?.[key]);
|
|
6220
|
-
preferences.adapter
|
|
6221
|
+
if (!preferences.adapter) [preferences.preset, { adapter: preferences.adapter }] = Object.entries(config.participants)[0];
|
|
6221
6222
|
const prepared = moss_group_profile(home, settings, channel, chat_id, preferences);
|
|
6222
6223
|
return { prepared, view: { cwd: prepared.cwd, group_defaults: prepared.defaults,
|
|
6223
6224
|
extra_directories: group_read_directories(preferences.read_directories) } };
|
|
@@ -6236,7 +6237,7 @@ function prepare_steward_renewal(home, config, settings, changed) {
|
|
|
6236
6237
|
|
|
6237
6238
|
/** Save only supplied choices, then replace the member using the latest window settings. */
|
|
6238
6239
|
async function renew_steward(home, current, input = {}) {
|
|
6239
|
-
const selection = Object.fromEntries(['adapter', 'model', 'effort'].filter(key => Object.hasOwn(input, key)).map(key => [key, input[key]]));
|
|
6240
|
+
const selection = Object.fromEntries(['adapter', 'preset', 'model', 'effort'].filter(key => Object.hasOwn(input, key)).map(key => [key, input[key]]));
|
|
6240
6241
|
let settings = launch_settings(home);
|
|
6241
6242
|
const patch = Object.keys(selection).length ? moss_room_preferences_patch(home, settings, moss_room_selector(current.config), selection) : null;
|
|
6242
6243
|
if (patch) settings = { ...settings, steward: merge_steward_settings(settings.steward, patch) };
|
|
@@ -6297,9 +6298,10 @@ async function activate_group_software(home, config, queued) {
|
|
|
6297
6298
|
function group_delivery_changed(home, config, key) {
|
|
6298
6299
|
const settings = launch_settings(home);
|
|
6299
6300
|
const preferences = moss_window_preferences(settings.steward?.windows?.[key]);
|
|
6300
|
-
const [profile] = Object.
|
|
6301
|
-
preferences.adapter
|
|
6302
|
-
|
|
6301
|
+
const [name, profile] = Object.entries(config.participants)[0];
|
|
6302
|
+
if (!preferences.adapter) Object.assign(preferences, { adapter: profile.adapter, preset: name });
|
|
6303
|
+
const [platform] = steward_software(settings, preferences.adapter, preferences.preset);
|
|
6304
|
+
if (preferences.adapter === profile.adapter && (!platform || platform === name) && (profile.model || '') === (preferences.model || config.moss_window.default_model || '') &&
|
|
6303
6305
|
(profile.effort || '') === (preferences.effort || config.moss_window.default_effort || '') &&
|
|
6304
6306
|
JSON.stringify(config.extra_directories || []) === JSON.stringify(group_read_directories(preferences.read_directories))) return null;
|
|
6305
6307
|
return settings;
|
package/runner/free_runner.mjs
CHANGED
|
@@ -20,14 +20,14 @@ import { record_wakeup_text } from './wakeup_text.mjs';
|
|
|
20
20
|
import { cwd_key } from './file_diff.mjs';
|
|
21
21
|
import { capture_workspace, commit_workspace_checkpoint, diff_workspace, discard_workspace } from './workspace_worker.mjs';
|
|
22
22
|
import { cleanup_room_checkpoints, inspect_checkpoint_root, observe_checkpoint_write, restore_rewound_checkpoints } from './file_checkpoint.mjs';
|
|
23
|
-
import {
|
|
23
|
+
import { correctable_refusals, free_task_text, HOST_MODEL_RULE_HEADING, HOST_MODEL_RULE_REPLACED, HOST_MODEL_RULE_REVOKED, HOST_STRATEGY_HEADING, HOST_STRATEGY_REVOKED, MAX_REFUSAL_RETRIES, PROMPTS_REPLACED, PROMPTS_REVOKED, refusal_retry_prompt, restart_resume_prompt, runs_commands, runs_read_commands, system_text, TASK_SUBCOMMANDS } from './expert_prompts.mjs';
|
|
24
24
|
import { host_skill_digest } from './discussion_skills.mjs';
|
|
25
25
|
import { entry_access, owner_key_file, site_fetch } from './entry_client.mjs';
|
|
26
26
|
import { ATTACHMENT_MAX_BYTES, CACHE_HEARTBEAT_MS, create_cache_lease, download_cached_attachment, drop_cache_lease, touch_cache_lease } from './attachment_cache.mjs';
|
|
27
27
|
import { atomic_json } from './files.mjs';
|
|
28
28
|
import { cached_model_default, MODEL_CACHE_MS, model_catalog_reader, unknown_model } from './model_catalog.mjs';
|
|
29
29
|
import { t, with_channel_locale } from './i18n.mjs';
|
|
30
|
-
import { image_settings } from './image_service.mjs';
|
|
30
|
+
import { image_settings, native_image_platforms } from './image_service.mjs';
|
|
31
31
|
import { outside_directory, project_html_kind, read_only_enforced, room_directories, room_directory_entries } from './project_files.mjs';
|
|
32
32
|
import { DELIVERED_GRACE_SECONDS, named_deliverable_paths } from './share_shared.mjs';
|
|
33
33
|
import { SessionDriver } from './session_driver.mjs';
|
|
@@ -669,23 +669,20 @@ function task_room_roster(config, room, protection, runtime) {
|
|
|
669
669
|
|
|
670
670
|
/** Describe the enabled image paths without disclosing provider settings or granting host actions. */
|
|
671
671
|
function task_image(config, member, room_members, protection, cli) {
|
|
672
|
-
|
|
673
|
-
const mode = ['codex', 'both'].includes(config.image_mode) ? config.image_mode : 'api';
|
|
674
|
-
const image = mode === 'codex' ? null : image_settings(config.api_home);
|
|
672
|
+
const image = config.image_generation && config.image_mode !== 'codex' ? image_settings(config.api_home) : null;
|
|
675
673
|
const api = image?.configured
|
|
676
674
|
? { model: image.model, catalog: image.catalog, limits: image.limits, command: `${cli} launch image --file REQUEST.json` } : null;
|
|
677
|
-
const
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
can_invite: member.role === 'host' && !protection && host_allowed(config, HOST_ACTION_ITEMS.invite),
|
|
687
|
-
};
|
|
675
|
+
const specialist_members = room_members
|
|
676
|
+
.filter(item => item.status === 'active' && item.access !== 'external'
|
|
677
|
+
&& capabilities_of(config.participants[item.name]?.adapter).native_image_gen)
|
|
678
|
+
.map(item => item.label || item.name);
|
|
679
|
+
const platforms = native_image_platforms(config.api_home);
|
|
680
|
+
const can_invite = Boolean(platforms.length && member.role === 'host' && !protection && host_allowed(config, HOST_ACTION_ITEMS.invite));
|
|
681
|
+
const subscription = platforms.length || specialist_members.length ? {
|
|
682
|
+
specialist_members, can_invite, ...(can_invite ? { invite_platforms: platforms } : {}),
|
|
683
|
+
} : null;
|
|
688
684
|
if (!api && !subscription) return null;
|
|
685
|
+
const mode = api && subscription ? 'both' : api ? 'api' : 'codex';
|
|
689
686
|
return { mode, ...(api ? { model: api.model, command: api.command, api } : {}), ...(subscription ? { subscription } : {}) };
|
|
690
687
|
}
|
|
691
688
|
|
|
@@ -722,7 +719,12 @@ export function free_task_files(config, member, execution, binding, { session =
|
|
|
722
719
|
}))];
|
|
723
720
|
const readable_directories = [...extra_directories, ...attachment_directories.map(path => ({ path, access: 'read' }))];
|
|
724
721
|
const window_memory = config.cwd && (config.steward || config.steward_private || config.moss_window) ? steward_memory_path(config.cwd) : '';
|
|
725
|
-
|
|
722
|
+
// The adapters build their command allow rules from extra_commands, so every command added to subcommands below
|
|
723
|
+
// must be listed here too, or a restricted software refuses it (MOSS Direct messages could not run channel send).
|
|
724
|
+
const steward_commands = config.steward || config.steward_private ? ['channel send', 'room dispatches',
|
|
725
|
+
...(config.steward ? ['launch experience-moss'] : []), 'launch host-control create-room', 'launch host-control room-post', ...MEMORY_COMMANDS] : [];
|
|
726
|
+
const extra_commands = config.moss_window ? { extra_commands: GROUP_EXTRA_COMMANDS }
|
|
727
|
+
: steward_commands.length ? { extra_commands: steward_commands } : {};
|
|
726
728
|
// The expert this member plays keeps its own knowledge, which only it may write (its project access stays as set).
|
|
727
729
|
const knowledge_directory = member_knowledge(config.api_home, member.name, workflow, room_directories(config), profile);
|
|
728
730
|
const inbox = Boolean(adapter?.into_window?.(profile, binding));
|
|
@@ -730,7 +732,8 @@ export function free_task_files(config, member, execution, binding, { session =
|
|
|
730
732
|
const steward_window = config.moss_window ? 'group' : config.steward_private ? 'private' : config.steward ? 'main' : '';
|
|
731
733
|
const readonly_knowledge = read_only_knowledge(config, knowledge_directory);
|
|
732
734
|
const cli = process.platform === 'win32' ? adapter?.windows_command || 'codiscuss.cmd' : 'codiscuss';
|
|
733
|
-
const image =
|
|
735
|
+
const image = config.steward || config.steward_private || config.moss_window ? null
|
|
736
|
+
: task_image(config, member, room_members, protection, cli);
|
|
734
737
|
const model_member = member.role === 'host' && room_members.find(item => is_model_specialist(config, item) && item.status === 'active');
|
|
735
738
|
atomic_json(access_path, { ...entry_access(), site: config.site, room: config.room, member: member.name, token: config.members[member.name].token,
|
|
736
739
|
...(config.steward ? { steward: true } : {}),
|
|
@@ -890,7 +893,7 @@ export function free_task_files(config, member, execution, binding, { session =
|
|
|
890
893
|
tripo_configured: Boolean(config.model_generation && model_configured(config.api_home)) } } : {}),
|
|
891
894
|
...(image ? { image } : {}),
|
|
892
895
|
cli, subcommands: config.moss_window ? ['room view', 'message list', 'message view', 'message post', 'question', ...GROUP_EXTRA_COMMANDS]
|
|
893
|
-
:
|
|
896
|
+
: [...TASK_SUBCOMMANDS, ...steward_commands],
|
|
894
897
|
...(bound_access ? { access_env: 'DISCUSS_ACCESS_FILE' } : { access_file: access_path }),
|
|
895
898
|
instructions });
|
|
896
899
|
const strategy = member.role === 'host' ? host_strategy : '';
|
package/runner/i18n_en.mjs
CHANGED
|
@@ -1422,6 +1422,7 @@ export default {
|
|
|
1422
1422
|
"区分大小写": "Match case",
|
|
1423
1423
|
"全字匹配": "Match whole words",
|
|
1424
1424
|
"使用正则表达式": "Use a regular expression",
|
|
1425
|
+
"全部房间搜索的排序:relevance 按相关度(标题命中、命中数),recent 按最近发言": "Order of an all-rooms search: relevance (title matches, then match count) or recent (newest match first)",
|
|
1425
1426
|
"更新房主的房间已读位置": "Update the owner’s room read position",
|
|
1426
1427
|
"指定消息编号,省略时读取房间最新消息编号": "Use this message ID, or read the latest room message ID if omitted",
|
|
1427
1428
|
"标为未读": "Mark as unread",
|
package/runner/image_service.mjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { existsSync, readFileSync } from 'node:fs';
|
|
8
8
|
import { join } from 'node:path';
|
|
9
9
|
import { api_base_url, api_models, read_saved_api_key } from './discussion_api.mjs';
|
|
10
|
-
import { IMAGE_MODELS } from './adapters/profiles.mjs';
|
|
10
|
+
import { adapter_capabilities, IMAGE_MODELS } from './adapters/profiles.mjs';
|
|
11
11
|
import { atomic_json } from './files.mjs';
|
|
12
12
|
import { t } from './i18n.mjs';
|
|
13
13
|
|
|
@@ -50,16 +50,23 @@ export function validate_image_limits(args, limits) {
|
|
|
50
50
|
return quality === 'auto' && max_quality !== 'max' ? { ...args, quality: max_quality } : args;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
* default becomes these settings.
|
|
56
|
-
*/
|
|
57
|
-
function legacy_settings(home) {
|
|
53
|
+
function saved_participants(home) {
|
|
54
|
+
if (!home) return {};
|
|
58
55
|
try {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
return JSON.parse(readFileSync(join(home, 'launch-settings.json'), 'utf8')).participants || {};
|
|
57
|
+
} catch { return {}; }
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Configured local platforms whose adapters provide native subscription image generation. */
|
|
61
|
+
export function native_image_platforms(home) {
|
|
62
|
+
return Object.entries(saved_participants(home)).filter(([, profile]) =>
|
|
63
|
+
profile?.executable && adapter_capabilities(profile.adapter).native_image_gen).map(([name]) => name);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Migrate the first saved image model from a legacy API member card. */
|
|
67
|
+
function legacy_settings(home) {
|
|
68
|
+
const profile = Object.values(saved_participants(home)).find(item => item?.image_model && item.base_url && item.api_key_ref);
|
|
69
|
+
return profile ? { base_url: profile.base_url, model: profile.image_model, api_key_ref: profile.api_key_ref } : null;
|
|
63
70
|
}
|
|
64
71
|
|
|
65
72
|
/** This computer's image settings `{base_url, model, api_key_ref, configured, catalog}`; never the key itself. */
|
package/runner/moss_windows.mjs
CHANGED
|
@@ -72,16 +72,16 @@ export const RETIRED_STEWARD_SKILL = 'discuss-report';
|
|
|
72
72
|
|
|
73
73
|
/** Validate the owner's editable preferences without accepting room identity or usage from the caller. */
|
|
74
74
|
export function moss_window_preferences(value = {}) {
|
|
75
|
-
const { work_policy = 'small', daily_limit = DEFAULT_DAILY_LIMIT, daily_tasks = 5, adapter = '', model = '', effort = '', read_directory = '', skills = [] } = value;
|
|
75
|
+
const { work_policy = 'small', daily_limit = DEFAULT_DAILY_LIMIT, daily_tasks = 5, adapter = '', preset = '', model = '', effort = '', read_directory = '', skills = [] } = value;
|
|
76
76
|
const read_directories = value.read_directories ?? (read_directory ? [read_directory] : []);
|
|
77
77
|
if (!WORK_POLICIES.has(work_policy) || !Number.isSafeInteger(daily_limit) || daily_limit < 0 ||
|
|
78
|
-
!Number.isSafeInteger(daily_tasks) || daily_tasks < 0 || typeof adapter !== 'string' || typeof read_directory !== 'string' ||
|
|
78
|
+
!Number.isSafeInteger(daily_tasks) || daily_tasks < 0 || typeof adapter !== 'string' || typeof preset !== 'string' || typeof read_directory !== 'string' ||
|
|
79
79
|
!Array.isArray(read_directories) || read_directories.length > MAX_EXTRA_DIRECTORIES || read_directories.some(path => typeof path !== 'string' || !isAbsolute(path)) ||
|
|
80
80
|
!Array.isArray(skills) || skills.some(id => typeof id !== 'string' || !/^[a-z0-9][a-z0-9_-]*$/i.test(id) ||
|
|
81
81
|
['local-stt-setup', 'local-tts-setup', 'notify-setup', 'cloudflare-deploy'].includes(id.toLowerCase())) ||
|
|
82
82
|
typeof model !== 'string' || typeof effort !== 'string') throw new Error(t('MOSS 群窗口设置无效。'));
|
|
83
83
|
return { habit: window_text(value.habit ?? ''), about: window_text(value.about ?? ''), work_policy, daily_limit, daily_tasks,
|
|
84
|
-
adapter, model, effort, read_directories, read_directory: read_directories[0] || '', skills: [...new Set(skills.filter(id => id.toLowerCase() !== RETIRED_STEWARD_SKILL))] };
|
|
84
|
+
adapter, preset, model, effort, read_directories, read_directory: read_directories[0] || '', skills: [...new Set(skills.filter(id => id.toLowerCase() !== RETIRED_STEWARD_SKILL))] };
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
/** Resolve preferences at task time. An empty override uses the group default. */
|