ai_co_discuss 0.2.79 → 0.2.80
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/package.json +1 -1
- package/runner/discussion_adapters.mjs +5 -0
- package/runner/discussion_runner.mjs +2 -2
- package/runner/expert_prompts.mjs +2 -3
- package/runner/free_runner.mjs +2 -2
- package/web/markdown.css +1 -1
- package/web/modern.css +1 -1
- package/web/modern.js +545 -539
package/package.json
CHANGED
|
@@ -18,6 +18,11 @@ const CODEX_PERMISSIONS_MIN_MINOR = 163;
|
|
|
18
18
|
/** Website subcommands an automatic task may run; service, launch, run, api and setup stay unapproved. */
|
|
19
19
|
export const TASK_SUBCOMMANDS = ['room', 'message', 'turn', 'state', 'execution', 'health', 'schema'];
|
|
20
20
|
|
|
21
|
+
/** The agy project allows only codiscuss commands and headless agy ends the turn on a denied one, so every agy task states it; no member prompt can drop it. */
|
|
22
|
+
export function agy_command_rule(adapter, cli) {
|
|
23
|
+
return adapter === 'antigravity_cli' ? `无人值守下 run_command 只能运行 ${cli} 的 subcommands 子命令,其他命令会被自动拒绝并使会话直接结束;列目录、搜索或读取文件用 list_dir、find_by_name、grep_search、view_file。` : '';
|
|
24
|
+
}
|
|
25
|
+
|
|
21
26
|
/** Only failures before a software invocation are safe for automatic redelivery. */
|
|
22
27
|
function not_sent(error) { return Object.assign(error, { delivery_status: 'not_sent' }); }
|
|
23
28
|
|
|
@@ -7,7 +7,7 @@ import { DatabaseSync } from 'node:sqlite';
|
|
|
7
7
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
8
8
|
import { parseArgs } from 'node:util';
|
|
9
9
|
import { setTimeout as sleep } from 'node:timers/promises';
|
|
10
|
-
import { atomic_json, deliver_task, remove_agy_projects, setup_sidecar, sidecar_receipt, TASK_SUBCOMMANDS } from './discussion_adapters.mjs';
|
|
10
|
+
import { agy_command_rule, atomic_json, deliver_task, remove_agy_projects, setup_sidecar, sidecar_receipt, TASK_SUBCOMMANDS } from './discussion_adapters.mjs';
|
|
11
11
|
import { read_api_key } from './discussion_api.mjs';
|
|
12
12
|
import { with_expert_prompt } from './expert_prompts.mjs';
|
|
13
13
|
import { decide_interjection, decide_next_speaker, decide_round, validate_scheduler } from './scheduler.mjs';
|
|
@@ -231,7 +231,7 @@ export function task_files(config, event, token, binding, { suggestions = [], en
|
|
|
231
231
|
draft_directory, ...(suggestions.length ? { scheduler_suggestions: suggestions } : {}),
|
|
232
232
|
role: event.role, turn_id: event.turn_id, skills, cli, subcommands: TASK_SUBCOMMANDS,
|
|
233
233
|
...(bound_access ? { access_env: 'DISCUSS_ACCESS_FILE' } : { access_file: access_path }),
|
|
234
|
-
instructions:
|
|
234
|
+
instructions: `${agy_command_rule(adapter.adapter, cli)}读取指定技能;网站命令只用 ${cli} 的 subcommands 子命令,命令以 ${cli} 开头,不用 python discuss.py、cd、管道或其他入口;${auto_enter ? '接入程序已进入本次执行,不要再执行 execution enter。' : `使用 ${cli} execution enter 房间 执行编号 --access-file 凭据路径 进入。进入成功后才处理本次安排;`}凭据文件由 CLI 内部读取,不要打印或读取其 token。${access_rule}答案草稿只保存到 draft_directory,不修改任务、凭据、日志或调度数据库;${project_rule}只处理本次工作,不建定时任务。主持创建下一安排或收束即结束,专家提交原文后结束。无效或已进入的任务不要重复执行。${suggestion_rule}` });
|
|
235
235
|
const read_rule = windows_rg() ? '读取含中文的技能或文本文件时用 rg --encoding utf-8 . 文件路径,不用 Get-Content(Windows PowerShell 会按系统编码读出乱码,需要反复重试)。' : '';
|
|
236
236
|
const scope = `本次只放行任务内 subcommands 列出的 ${cli} 子命令,命令以 ${cli} 开头,不用 python discuss.py、cd、管道或其他入口。任务内 cwd 是讨论项目目录;${project_rule}项目读写仍受软件实际权限和议题授权约束。不读取凭据内容。${read_rule}`;
|
|
237
237
|
const plan_rule = event.role === 'host' ? '安排专家回应时先写发言计划,先用 turn roster 取得最新专家状态,再用 turn create --plan-file 加 --roster 一次排满 waiting 中的每位专家,不要每次只排一位。' : '';
|
|
@@ -7,9 +7,8 @@
|
|
|
7
7
|
export const MAX_EXPERT_PROMPT = 4000;
|
|
8
8
|
|
|
9
9
|
export const EXPERT_PROMPT_PRESETS = {
|
|
10
|
-
//
|
|
11
|
-
antigravity_cli:
|
|
12
|
-
任务需要多步操作时,在读完材料、改定方案、验证结果这类关键转折处,用一两句中文写出进展再继续。`,
|
|
10
|
+
// agy streams no thinking text, so without a word between tools the page cannot show how far it got.
|
|
11
|
+
antigravity_cli: '多步任务中,在关键转折处用一句话写出进展再继续。',
|
|
13
12
|
};
|
|
14
13
|
|
|
15
14
|
/** The prompt this member receives: its own text when set, otherwise its software's preset. */
|
package/runner/free_runner.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { spawnSync } from 'node:child_process';
|
|
|
3
3
|
import { createHash, randomUUID } from 'node:crypto';
|
|
4
4
|
import { appendFileSync, mkdirSync, readFileSync, statSync } from 'node:fs';
|
|
5
5
|
import { basename, join, resolve } from 'node:path';
|
|
6
|
-
import { atomic_json, deliver_task, sidecar_receipt, TASK_SUBCOMMANDS } from './discussion_adapters.mjs';
|
|
6
|
+
import { agy_command_rule, atomic_json, deliver_task, sidecar_receipt, TASK_SUBCOMMANDS } from './discussion_adapters.mjs';
|
|
7
7
|
import { api } from './discussion_runner.mjs';
|
|
8
8
|
import { with_expert_prompt } from './expert_prompts.mjs';
|
|
9
9
|
import { ROUTE_CONFIDENCE, ROUTE_CONTEXT_MESSAGES, ROUTE_PROMPT_VERSION, ROUTE_WIDE_CONFIDENCE, decide_group_order, route_free_message } from './scheduler.mjs';
|
|
@@ -87,7 +87,7 @@ export function free_task_files(config, member, execution, binding) {
|
|
|
87
87
|
read_after: execution.read_until, cwd: profile.cwd || null, project_access: profile.project_access, draft_directory,
|
|
88
88
|
skills: [join(config.project, '.agents/skills/discuss-participant/SKILL.md')], cli, subcommands: TASK_SUBCOMMANDS,
|
|
89
89
|
...(bound_access ? { access_env: 'DISCUSS_ACCESS_FILE' } : { access_file: access_path }),
|
|
90
|
-
instructions: `${discussion ? '讨论房间:用户直接向你提问(' + messages + ')。这不是你的发言安排,不要领取发言权、不要安排他人,也不改变讨论进度,只回答这个提问。' : '自由协作房间:用户点名了你(' + messages + ')。'}${access_rule}先用 ${cli} message list ${config.room} --after ${execution.read_until}${access_arg} 读取新消息,按时间顺序处理,后面的消息可能修正前面的,以最新指令为准。${host_rule}完成后用 ${cli} message post ${config.room} --as ${member.name} --kind chat --execution ${execution.id} --body-file 草稿 --submission-id 新UUID${access_arg} 提交一次回答。提交被拒绝说明本次执行已被打断或过期:保留草稿并结束,不要去掉 --execution 改作普通发言。草稿只写入 draft_directory;${project_rule}不读取或打印凭据内容,不建定时任务。` });
|
|
90
|
+
instructions: `${agy_command_rule(profile.adapter, cli)}${discussion ? '讨论房间:用户直接向你提问(' + messages + ')。这不是你的发言安排,不要领取发言权、不要安排他人,也不改变讨论进度,只回答这个提问。' : '自由协作房间:用户点名了你(' + messages + ')。'}${access_rule}先用 ${cli} message list ${config.room} --after ${execution.read_until}${access_arg} 读取新消息,按时间顺序处理,后面的消息可能修正前面的,以最新指令为准。${host_rule}完成后用 ${cli} message post ${config.room} --as ${member.name} --kind chat --execution ${execution.id} --body-file 草稿 --submission-id 新UUID${access_arg} 提交一次回答。提交被拒绝说明本次执行已被打断或过期:保留草稿并结束,不要去掉 --execution 改作普通发言。草稿只写入 draft_directory;${project_rule}不读取或打印凭据内容,不建定时任务。` });
|
|
91
91
|
const prompt = `用户在${discussion ? '讨论' : '自由协作'}房间点名了你(${member.name}),对应消息 ${messages}。请先读取任务文件:${task_path},按其中说明读取新消息、完成请求,并用 ${cli} message post 带 --execution ${execution.id} 提交一次回答后结束。命令只用任务内 subcommands 列出的 ${cli} 子命令;${project_rule}不读取凭据内容。`;
|
|
92
92
|
return { id, participant: member.name, directory: config.directory, draft_directory,
|
|
93
93
|
skills_directory: join(config.project, '.agents', 'skills'), access_path, prompt: with_expert_prompt(prompt, profile) };
|