ai_co_discuss 0.4.73 → 0.4.75

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.
Files changed (35) hide show
  1. package/.agents/skills/discuss-host/references/relay.md +2 -2
  2. package/.agents/skills/discuss-host/references/room.md +2 -2
  3. package/.agents/skills/discuss-participant/references/room.md +1 -1
  4. package/.agents/skills/discuss-session/references/host.md +1 -1
  5. package/.agents/skills/local-stt-setup/SKILL.md +2 -2
  6. package/.agents/skills/local-tts-setup/SKILL.md +1 -1
  7. package/.agents/skills/workflow-creator/SKILL.md +1 -1
  8. package/.agents/skills/workflow-creator/references/model-selection.md +1 -1
  9. package/backend/free_room.py +16 -5
  10. package/backend/server.py +1 -1
  11. package/docs/en/runner.md +1 -1
  12. package/docs/en/workflow.md +2 -0
  13. package/docs/runner.md +3 -3
  14. package/docs/workflow.md +2 -0
  15. package/frontend/locales/en/backend.json +3 -2
  16. package/frontend/locales/en/core.json +4 -3
  17. package/frontend/locales/en/discussion.json +7 -1
  18. package/frontend/locales/en/room.json +1 -6
  19. package/package.json +1 -1
  20. package/runner/adapters/antigravity_cli.mjs +12 -1
  21. package/runner/adapters/api.mjs +19 -10
  22. package/runner/adapters/api_files.mjs +45 -3
  23. package/runner/adapters/api_pi.mjs +26 -8
  24. package/runner/adapters/api_pi_extension.mjs +2 -1
  25. package/runner/adapters/claude.mjs +1 -11
  26. package/runner/adapters/common.mjs +11 -1
  27. package/runner/adapters/profiles.mjs +2 -2
  28. package/runner/discuss.py +1 -3
  29. package/runner/local_speech_service.mjs +3 -2
  30. package/runner/tts_providers.mjs +3 -3
  31. package/web/app.js +7 -0
  32. package/web/backup.js +1 -1
  33. package/web/i18n.js +2 -2
  34. package/web/modern.css +1 -1
  35. package/web/modern.js +57 -57
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Project file tools of a model API member: read, glob and grep, and at 可写 also write and edit.
2
+ * Project file tools of a model API member: read, glob, grep and a read-only git (diff, log, show, status), and at 可写
3
+ * also write and edit.
3
4
  *
4
5
  * Ported from the read / write / edit (packages/fs/tool-fs) and glob / grep (packages/fs/tool-fs-search) tools of
5
6
  * DeepSeek Harness, https://github.com/deepseek-ai/deepseek-harness at ce7073d, MIT License, Copyright (c) 2026 DeepSeek:
@@ -25,11 +26,21 @@ const GREP_MAX_MATCHES = 250;
25
26
  const GREP_MAX_LINE_LENGTH = 2000;
26
27
  const MAX_WALK_ENTRIES = 100_000;
27
28
  const GIT_TIMEOUT_MS = 15_000;
29
+ // The git tool: only commands that read, only options that neither write a file (--output), run a program (external
30
+ // diff, textconv, a pager) nor reach outside the repository (--no-index); a revision never names a file (`HEAD:.env`).
31
+ const GIT_COMMANDS = ['diff', 'log', 'show', 'status'];
32
+ const GIT_OPTION = /^-(?:-(?:stat|numstat|shortstat|name-only|name-status|cached|staged|patch|oneline|graph|decorate|abbrev-commit|follow|reverse|no-merges|merges|word-diff|ignore-all-space|ignore-space-change|summary|short|porcelain|branch|untracked-files(?:=(?:no|normal|all))?|stat=\d+(?:,\d+)?|unified=\d+|max-count=\d+|skip=\d+|since=[^=\s]+|until=[^=\s]+|after=[^=\s]+|before=[^=\s]+|author=.+|grep=.+|format=[\w%:.,\-<>()\[\] ]*|pretty=(?:oneline|short|medium|full|fuller)|date=(?:short|iso|relative|local))|[pswnU]\d*|[MC])$/;
33
+ const GIT_REVISION = /^[\w./~^@{}\-]+(?:\.\.\.?[\w./~^@{}\-]+)?$/;
34
+ // Secret files stay out of every diff and log, as the read tool refuses them.
35
+ const GIT_SECRET_EXCLUDES = [':(exclude,glob)**/.env', ':(exclude,glob)**/.env.*', ':(exclude,glob)**/*.pem', ':(exclude,glob)**/*.key',
36
+ ':(exclude,glob)**/*.p12', ':(exclude,glob)**/*.pfx', ':(exclude,glob)**/*.jks', ':(exclude,glob)**/*.keystore',
37
+ ':(exclude,glob)**/id_rsa*', ':(exclude,glob)**/id_dsa*', ':(exclude,glob)**/id_ecdsa*', ':(exclude,glob)**/id_ed25519*',
38
+ ':(exclude,glob)**/.npmrc', ':(exclude,glob)**/.pypirc', ':(exclude,glob)**/.netrc'];
28
39
  const VCS_DIRECTORIES = ['.git', '.svn', '.hg', '.bzr', '.jj', '.sl'];
29
40
  // Their content would reach the model provider and could be posted into the room, which has no read isolation.
30
41
  const SECRET_NAMES = [/^\.env(\..+)?$/i, /\.(pem|key|p12|pfx|jks|keystore)$/i, /^id_(rsa|dsa|ecdsa|ed25519)/i, /^\.(npmrc|pypirc|netrc)$/i];
31
42
  const SECRET_EXAMPLES = /^\.env\.(example|sample|template)$/i;
32
- const READ_TOOLS = ['read', 'glob', 'grep'];
43
+ const READ_TOOLS = ['read', 'glob', 'grep', 'git'];
33
44
  export const WRITE_TOOLS = ['write', 'edit'];
34
45
  const TEXT = { type: 'string' };
35
46
  const NUMBER = { type: 'integer', minimum: 1 };
@@ -57,6 +68,15 @@ const DEFINITIONS = {
57
68
  path: { ...TEXT, description: 'File or directory to search. Defaults to the project directory; a relative path resolves against it, an absolute one may name another listed project directory.' },
58
69
  include: { ...TEXT, description: 'One glob filter for which files to search (e.g. "*.ts", "*.{js,jsx}"). Not a list; negation is not supported.' },
59
70
  }, ['pattern']),
71
+ git: tool('git', 'Run a read-only git command in a project directory: diff, log, show or status. '
72
+ + 'Use it to see what changed (e.g. diff, diff --stat HEAD~1, log --oneline -n 10, show HEAD --stat). '
73
+ + `Output is cut at ${READ_MAX_BYTES} bytes; narrow it with paths or --stat.`, {
74
+ command: { type: 'string', enum: GIT_COMMANDS, description: 'The git subcommand.' },
75
+ args: { type: 'array', items: TEXT, description: 'Options and revisions, e.g. ["--stat", "HEAD~1"]. '
76
+ + 'Options that write files, run external programs or read outside the project are refused.' },
77
+ paths: { type: 'array', items: TEXT, description: 'Limit to these paths, relative to the directory.' },
78
+ directory: { ...TEXT, description: 'Directory to run in. Defaults to the project directory; an absolute path may name another listed project directory.' },
79
+ }, ['command']),
60
80
  write: tool('write', 'Create or fully replace a UTF-8 text file.', {
61
81
  file_path: { ...TEXT, description: 'Path to write, relative to the project directory, or absolute inside another listed project directory. Provide `file_path` before `content` in the arguments.' },
62
82
  content: { ...TEXT, description: 'Full UTF-8 text content to write.' },
@@ -395,7 +415,29 @@ export function write_new_project_file(project, requested, data) {
395
415
  return file;
396
416
  }
397
417
 
398
- const RUNNERS = { read, glob, grep, write, edit };
418
+ /** A read-only git command in one project directory; its paths stay inside the project and away from protected files. */
419
+ function git(project, args) {
420
+ if (!GIT_COMMANDS.includes(args.command)) throw new Error(`command must be one of ${GIT_COMMANDS.join(', ')}`);
421
+ const options = args.args ?? [], paths = args.paths ?? [];
422
+ if (!Array.isArray(options) || !Array.isArray(paths) || [...options, ...paths].some(item => typeof item !== 'string')) throw new Error('args and paths must be arrays of strings');
423
+ for (const option of options) {
424
+ if (option.startsWith('-') ? !GIT_OPTION.test(option) : !GIT_REVISION.test(option)) throw new Error(`"${option}" is not allowed in the git tool`);
425
+ }
426
+ const base = directory_target(project, args.directory);
427
+ const scoped = paths.map(path => relative(base.path, target(project, resolve(base.path, path), false).path) || '.');
428
+ const command = ['-C', base.path, '--no-pager', '-c', 'core.quotepath=false', '-c', 'color.ui=never', args.command,
429
+ ...(args.command === 'status' ? [] : ['--no-ext-diff', '--no-textconv']), ...options, '--', ...(scoped.length ? scoped : ['.']), ...GIT_SECRET_EXCLUDES];
430
+ const result = spawnSync('git', command, { encoding: 'utf8', windowsHide: true, timeout: GIT_TIMEOUT_MS, maxBuffer: 16 * 1024 * 1024,
431
+ env: { ...process.env, GIT_PAGER: 'cat', GIT_EXTERNAL_DIFF: '', GIT_TERMINAL_PROMPT: '0' } });
432
+ if (result.error) throw new Error(`git failed: ${result.error.message}`);
433
+ if (result.status !== 0) throw new Error(`git ${args.command} failed: ${(result.stderr || '').trim().slice(0, 500)}`);
434
+ const output = result.stdout || '(no output)';
435
+ const bytes = Buffer.byteLength(output);
436
+ if (bytes <= READ_MAX_BYTES) return output;
437
+ return `${Buffer.from(output).subarray(0, READ_MAX_BYTES).toString('utf8')}\n\n(Output cut at ${READ_MAX_BYTES} of ${bytes} bytes. Narrow it with paths or --stat.)`;
438
+ }
439
+
440
+ const RUNNERS = { read, glob, grep, git, write, edit };
399
441
 
400
442
  /** Whether a tool name is one of the file tools. */
401
443
  export function is_file_tool(name) {
@@ -17,7 +17,7 @@ import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from
17
17
  import { homedir } from 'node:os';
18
18
  import { dirname, join, resolve } from 'node:path';
19
19
  import { fileURLToPath } from 'node:url';
20
- import { marked, prompt_text, tree_killable } from './common.mjs';
20
+ import { marked, prompt_text, shell_written_paths, tree_killable } from './common.mjs';
21
21
  import { WRITE_TOOLS } from './api_files.mjs';
22
22
  import { room_text } from '../room_text.mjs';
23
23
  import { adapter_profile, takes_images } from './profiles.mjs';
@@ -27,8 +27,10 @@ export const PI_PROVIDER = 'codiscuss';
27
27
  const EXTENSION = fileURLToPath(new URL('./api_pi_extension.mjs', import.meta.url));
28
28
  // Our wire protocols and the Pi API that speaks each one.
29
29
  const PI_APIS = { responses: 'openai-responses', chat: 'openai-completions', anthropic: 'anthropic-messages', gemini: 'google-generative-ai' };
30
- // Output cap sent with each request: protocols that need an explicit one used this before, and some models reject more.
31
- const MAX_OUTPUT_TOKENS = 8192;
30
+ // Output cap sent with each request. Reasoning counts toward it: at 8192 DeepSeek flash spent the whole cap thinking
31
+ // and never reached its tool call (2026-11-17). 32768 leaves room to think and still answer; DeepSeek accepts up to
32
+ // 393216, and the other protocols' current models take at least this much.
33
+ const MAX_OUTPUT_TOKENS = 32768;
32
34
  const CONTEXT_WINDOW = 128_000;
33
35
  const STOP_GRACE_MS = 3000;
34
36
  const EXIT_GRACE_MS = 5000;
@@ -47,6 +49,10 @@ export function tool_note(name, args = {}) {
47
49
  return [name, ...shown].join(' ');
48
50
  }
49
51
 
52
+ // A reply cut at the output cap (often all of it spent thinking) is not the end: the model is asked, in the same
53
+ // session, to stop deliberating and submit; only after this many cuts in one execution does it fail.
54
+ export const OUTPUT_CUT_REMINDER = '上一次回复超过单次输出上限被截断,没有完成任何操作。请不要再长篇推理,直接调用工具完成剩下的步骤并提交结果;内容很长时分段写入。';
55
+ const MAX_OUTPUT_CUTS = 2;
50
56
  export const NO_TOOL_REMINDER = '普通文本不会被保存。请调用写入工具提交真实结果;确实无法继续才不调用工具直接结束。';
51
57
  const API_CALL = { stoppable: true, progress: true };
52
58
 
@@ -180,12 +186,15 @@ function on_records(stream, handle) {
180
186
  * `service_home` (the service directory, whose `pi` folder holds Pi's config and sessions), `spawn_process`.
181
187
  * @returns {{status: string, session_id: string, capabilities: object, steer: function}}
182
188
  */
183
- export function pi_delivery({ cli, profile, key, binding, task, context_file, system_file, prompt, images = [], max_requests, project_root, service_home, spawn_process = spawn }) {
189
+ export function pi_delivery({ cli, profile, key, binding, task, context_file, system_file, prompt, images = [], max_requests, project_root, native_shell = false, service_home, spawn_process = spawn }) {
184
190
  const dirs = pi_home(service_home);
185
191
  for (const path of Object.values(dirs)) mkdirSync(path, { recursive: true });
186
192
  const existing = session_file(dirs.sessions, binding.session_id);
187
193
  const session_id = existing ? binding.session_id : randomUUID();
188
- const args = [cli, '--mode', 'rpc', '--no-builtin-tools', '--no-context-files', '--no-skills', '--no-prompt-templates',
194
+ // A writable member works as Claude Code or Codex do: Pi's own read, bash, edit and write in the project (user
195
+ // 2026-11-17: Pi is a coding agent like them, do not treat it differently). Read-only keeps our confined file tools:
196
+ // Pi has no sandbox, so its bash could not be held to reading.
197
+ const args = [cli, '--mode', 'rpc', ...(native_shell ? [] : ['--no-builtin-tools']), '--no-context-files', '--no-skills', '--no-prompt-templates',
189
198
  '--no-themes', '--no-mcp', '--no-approve', '-e', EXTENSION, '--session-dir', dirs.sessions,
190
199
  ...(existing ? ['--session', existing] : ['--session-id', session_id]),
191
200
  '--provider', PI_PROVIDER, '--model', profile.model, ...(pi_thinking(profile) ? ['--thinking', pi_thinking(profile)] : []),
@@ -202,7 +211,7 @@ export function pi_delivery({ cli, profile, key, binding, task, context_file, sy
202
211
  const log = text => {
203
212
  try { task.on_output?.(log_path, redact(text)); } catch { /* The room's directory is gone. */ }
204
213
  };
205
- const state = { running: true, terminal: false, stopped: false, failure: '', failure_details: {}, reminded: false, used_tools: false,
214
+ const state = { running: true, terminal: false, stopped: false, failure: '', failure_details: {}, reminded: false, cuts: 0, used_tools: false,
206
215
  turns: 0, last_text: '', last_error: '', last_stop: '', last_output: 0, compaction_error: '', diagnostic: '', tools: new Map() };
207
216
  const handle = new EventEmitter();
208
217
  const send = value => { if (child.stdin.writable) child.stdin.write(`${JSON.stringify(value)}\n`); };
@@ -253,8 +262,12 @@ export function pi_delivery({ cli, profile, key, binding, task, context_file, sy
253
262
  // An interjection still queued would make the model answer again after its answer was saved.
254
263
  send({ type: 'clear_queue' });
255
264
  }
256
- if (call && WRITE_TOOLS.includes(call.name) && !event.isError && typeof call.args.file_path === 'string' && project_root) {
257
- task.on_edits?.([resolve(project_root, call.args.file_path)]);
265
+ // Our write tools name `file_path`, Pi's own `path`; a bash command that writes claims the paths it names, as for Claude.
266
+ const path = call?.args?.file_path ?? call?.args?.path;
267
+ if (call && WRITE_TOOLS.includes(call.name) && !event.isError && typeof path === 'string' && project_root) task.on_edits?.([resolve(project_root, path)]);
268
+ if (call?.name === 'bash' && project_root) {
269
+ const written = shell_written_paths(call.args?.command).map(item => resolve(project_root, item));
270
+ if (written.length) task.on_edits?.(written);
258
271
  }
259
272
  } else if (event.type === 'message_end' && event.message?.role === 'assistant') {
260
273
  const text = (event.message.content || []).filter(part => part?.type === 'text').map(part => part.text || '').join('').trim();
@@ -280,6 +293,11 @@ export function pi_delivery({ cli, profile, key, binding, task, context_file, sy
280
293
  if (state.last_error) { fail(`模型请求失败:${state.last_error}`); return finish(); }
281
294
  const reply = state.last_text.slice(0, REPLY_EXCERPT_CHARS);
282
295
  // The provider stopped the reply at its output cap: say so as it happened, without guessing why (V14-V16).
296
+ if (state.last_stop === 'length' && state.cuts < MAX_OUTPUT_CUTS) {
297
+ state.cuts += 1;
298
+ task.on_note?.(room_text('回复在 {tokens} 个 token 处达到输出上限被截断,已提醒模型直接提交(第 {count} 次)', { tokens: state.last_output, count: state.cuts }));
299
+ return send({ type: 'prompt', message: OUTPUT_CUT_REMINDER });
300
+ }
283
301
  if (state.last_stop === 'length') {
284
302
  fail(room_text('模型输出在 {tokens} 个 token 处达到输出上限后结束,未提交结果{reply}',
285
303
  { tokens: state.last_output, reply: reply ? `:${reply}` : '' }), { failure_class: 'output_truncated' });
@@ -2,7 +2,8 @@
2
2
  * Pi extension loaded into the `pi --mode rpc` process of one model API execution (api_pi.mjs starts it). It registers
3
3
  * the member's provider and exactly the tools the old in-runner loop offered: room tools bound to this execution,
4
4
  * project file tools, registered commands and image tools (api.mjs, api_files.mjs, api_commands.mjs, api_images.mjs).
5
- * Pi's built-in tools are off, so the model has no shell and every path still goes through our checks.
5
+ * A writable member also has Pi's own read, bash, edit and write in place of our file tools and registered commands;
6
+ * otherwise Pi's built-in tools are off, so the model has no shell and every path still goes through our checks.
6
7
  *
7
8
  * Input: `CODISCUSS_PI_CONTEXT` names the execution's private context file; `CODISCUSS_PI_KEY` holds the API key, which
8
9
  * the model never sees. Output to the runner: each tool result's `details.codiscuss` says whether it saved the answer
@@ -13,7 +13,7 @@ import { dirname, join, resolve } from 'node:path';
13
13
  import { runs_commands } from '../expert_prompts.mjs';
14
14
  import { bind_access, cli_max_run_ms, cli_timeout_reason, DENIAL_FIELD, EDIT_TOOLS, edge_entries, launch_directory, log_entries, marked, MAX_DENIALS, model_entry, json_line,
15
15
  clock_reset_at, newest_record, not_sent, page_sessions, preview_messages, project_directory, prompt_text, prompt_title, query_catalog,
16
- same_path, TASK_SUBCOMMANDS, tree_killable, typed_prompt, watch_events } from './common.mjs';
16
+ same_path, TASK_SUBCOMMANDS, tree_killable, typed_prompt, watch_events, shell_written_paths } from './common.mjs';
17
17
 
18
18
  // A message posted to an open Claude window that has not started by then is reported, not failed.
19
19
  const INBOX_CHECK_MS = 90_000;
@@ -28,16 +28,6 @@ const CHAT_TURN_MS = 30 * 60_000;
28
28
  const LASTING_ERRORS = ['rate_limit', 'authentication_failed'];
29
29
  const EDIT_TOOL_NAMES = /^(Edit|MultiEdit|Write|NotebookEdit)$/;
30
30
  const SHELL_TOOL_NAMES = /^(Bash|PowerShell)$/;
31
- // A shell command that may write files: a redirect into a file, an in-place edit, a script writing, a copy, move or
32
- // delete. Only such a command claims the paths it names; reading commands (cat, grep, git diff) claim none.
33
- const SHELL_WRITES = /(?<![=\-<>])>{1,2}(?!=)\s*(?!&|\/dev\/null|\$null|nul\b)|\bsed\s+-i|\.write\w*\(|write_text|writeFileSync|\b(?:Set|Add)-Content\b|\bOut-File\b|\btee\b|\b(?:mv|cp|rm)\s|\b(?:Move|Copy|Remove|Rename)-Item\b|\bgit\s+(?:checkout|restore|apply|mv|rm)\b/i;
34
-
35
- /** The paths a file-writing shell command names (with a folder or an extension), so files it wrote count as the agent's own. */
36
- function shell_written_paths(command) {
37
- const text = String(command || '');
38
- if (!SHELL_WRITES.test(text)) return [];
39
- return text.split(/[\s'"`;|&<>(),=]+/).filter(token => /[\\/]/.test(token) && /\.[\w-]+$/.test(token));
40
- }
41
31
  // The Messages API refuses an image whose base64 form passes 5 MB, failing the whole turn; larger ones go by path only.
42
32
  const MAX_INLINE_IMAGE_BYTES = 3_750_000;
43
33
  // Claude Code logs side queries (titles, compaction, subagents) too; only these sources are the member's own turns.
@@ -19,7 +19,17 @@ export function cli_timeout_reason(milliseconds) {
19
19
  return t('CLI 运行超过 {seconds} 秒仍未结束,已终止', { seconds: Math.round(milliseconds / 1000) });
20
20
  }
21
21
  /** Tool names that edit files, across the softwares' event streams. */
22
- export const EDIT_TOOLS = /^(Edit|MultiEdit|Write|NotebookEdit|write_file|write_to_file|replace_file_content|multi_replace_file_content)$/;
22
+ // A shell command that may write files: a redirect into a file, an in-place edit, a script writing, a copy, move or
23
+ // delete. Only such a command claims the paths it names; reading commands (cat, grep, git diff) claim none.
24
+ const SHELL_WRITES = /(?<![=\-<>])>{1,2}(?!=)\s*(?!&|\/dev\/null|\$null|nul\b)|\bsed\s+-i|\.write\w*\(|write_text|writeFileSync|\b(?:Set|Add)-Content\b|\bOut-File\b|\btee\b|\b(?:mv|cp|rm)\s|\b(?:Move|Copy|Remove|Rename)-Item\b|\bgit\s+(?:checkout|restore|apply|mv|rm)\b/i;
25
+
26
+ /** The paths a file-writing shell command names (with a folder or an extension), so files it wrote count as the agent's own. */
27
+ export function shell_written_paths(command) {
28
+ const text = String(command || '');
29
+ if (!SHELL_WRITES.test(text)) return [];
30
+ return text.split(/[\s'"`;|&<>(),=]+/).filter(token => /[\\/]/.test(token) && /\.[\w-]+$/.test(token));
31
+ }
32
+ export const EDIT_TOOLS = /^(Edit|MultiEdit|Write|NotebookEdit|write_file|edit_file|write_to_file|replace_file_content|multi_replace_file_content)$/;
23
33
  /** A refused operation's detail and rule are cut to this length; a run reports at most this many. */
24
34
  export const DENIAL_FIELD = 300;
25
35
  export const MAX_DENIALS = 20;
@@ -137,8 +137,8 @@ export const ADAPTER_PROFILES = {
137
137
  // so only the three levels every protocol takes are offered. A chat endpoint without a reasoning parameter ignores it.
138
138
  efforts: ['low', 'medium', 'high'], models: false, access_levels: ['read', 'write'], per_tool_allow: false, adopt: '', host_existing: false,
139
139
  access_hints: { read: '用接入程序的文件工具读取、搜索项目文件,可运行工作流登记的只读命令',
140
- write: '还可新建、覆盖、局部编辑项目文件,可运行工作流登记的全部命令;没有通用命令行' },
141
- unsupported_hints: { auto: 'API 成员没有通用命令行,没有需要软件审批的操作', full: 'API 成员没有通用命令行,没有需要软件审批的操作' },
140
+ write: '用 Pi 自带的读写、编辑与命令行在项目里工作,和本地 CLI 可写一致;Pi 没有审批,可写即可直接运行命令' },
141
+ unsupported_hints: { auto: 'Pi 没有需要软件审批的操作,可写即可直接运行命令', full: 'Pi 没有需要软件审批的操作,可写即可直接运行命令' },
142
142
  // Runs in the Pi harness (api_pi.mjs), which keeps a session the runner cuts like a CLI's.
143
143
  // Whether a model reads images depends on the model, not the protocol: the owner says so on the card (`image_input`).
144
144
  // Its answer is only what submit_chat saves (an unknown result is recovered by the same submission), never its last text.
package/runner/discuss.py CHANGED
@@ -394,7 +394,7 @@ def message_commands(subcommands, registry):
394
394
  post.add_argument("--also-request", dest="also_requests", type=positive_int, action="append", default=[], metavar="REQUEST",
395
395
  help="执行中又排队给你的普通请求(execution view 的 queued_requests)与本次任务相关、这条回答已一并交付时,用它同时关闭;可重复")
396
396
  post.add_argument("--detach", type=member_handle, action="append", default=[], metavar="MEMBER",
397
- help="自由房间主持人:与 --to 同用,点名一位与这次派活同时开工、但不等它的成员(不计入交回或下一棒的等待);它失败时程序通知你;可重复")
397
+ help="自由房间主持人:点名一位在后台工作、不等它的成员:不交回你、不占住房间(用户发消息不排队),也不计入交回或下一棒的等待;可单独用,也可与 --to 同用;它失败时程序通知你;可重复")
398
398
  post.add_argument("--with", dest="to", type=member_handle, action=JoinPreviousStep, metavar="MEMBER",
399
399
  help="与 --sequential 同用:点名一位成员,与紧挨在前的 --to(或 --with)同一棒、同时做;这一组全部结束才交下一棒,组里有人失败则接力停下交回你;可重复")
400
400
  post.add_argument("--need-rounds", type=positive_int, metavar="N",
@@ -869,8 +869,6 @@ def plan_message(args):
869
869
  if args.loop and not args.sequential:
870
870
  raise CliError("--loop 须与 --sequential 一起使用")
871
871
  if args.detach:
872
- if not args.to:
873
- raise CliError("--detach 须与 --to 一起使用")
874
872
  payload["detach"] = args.detach
875
873
  if getattr(args, "also_requests", None):
876
874
  payload["also_request_ids"] = args.also_requests
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Supervisor of a local speech service (read-aloud's yovoice, voice input's CrispASR): runs it and stops it once its
3
- * lease has not been renewed for a minute, or was released. The runner renews the lease (touches `<service dir>/lease`)
3
+ * lease has not been renewed for five minutes (a minute restarted it too often between readings, user 2026-11-18), or
4
+ * was released. The runner renews the lease (touches `<service dir>/lease`)
4
5
  * on every request, so the service lives while it is used and ends after, also when the runner that started it exited
5
6
  * or crashed. Started detached by `runner/tts_providers.mjs`:
6
7
  * node local_speech_service.mjs <service dir> <executable> [arguments...]
@@ -12,7 +13,7 @@ import { spawn } from 'node:child_process';
12
13
  import { closeSync, openSync, readFileSync, rmSync, statSync } from 'node:fs';
13
14
  import { join } from 'node:path';
14
15
 
15
- const LEASE_MS = 60_000;
16
+ const LEASE_MS = 5 * 60_000;
16
17
  const CHECK_MS = 5_000;
17
18
 
18
19
  const [directory, executable, ...service_arguments] = process.argv.slice(2);
@@ -46,8 +46,8 @@ const SILENT_AAC_FRAME = Buffer.from([0xff, 0xf1, 0x58, 0x40, 0x01, 0x7f, 0xfc,
46
46
  const SILENT_AAC_FRAME_MS = 1024 / 24;
47
47
  // Local speech: yovoice serving Qwen3-TTS CustomVoice on this computer, installed by the local-tts-setup skill into
48
48
  // `<service home>/yovoice` (CLI in `cli/`, engine and model in `data/`). Like voice input's local service, the runner
49
- // starts it through a supervisor (`local_speech_service.mjs`) and renews its lease on every request; a minute without
50
- // one, or the user stopping reading, stops it, so the model does not hold graphics memory between uses, even when the
49
+ // starts it through a supervisor (`local_speech_service.mjs`) and renews its lease on every request; five minutes without
50
+ // one (or an explicit release) stops it, so the model does not hold graphics memory between uses, even when the
51
51
  // runner has crashed.
52
52
  const LOCAL_HOST = '127.0.0.1';
53
53
  // A local service's token is bound to the service, not to a port, since the port can change from one start to the next.
@@ -322,7 +322,7 @@ function local_generate({ home, key, text, speaker, context }, request) {
322
322
  }
323
323
 
324
324
  /**
325
- * Renew a local service's lease (in its directory); its supervisor stops the service once the lease is a minute old. A
325
+ * Renew a local service's lease (in its directory); its supervisor stops the service once the lease is five minutes old. A
326
326
  * renewal when a request ends keeps a release that came meanwhile (the user stopped reading), so the release still stops it.
327
327
  */
328
328
  function local_renew(directory, { keep_release = false } = {}) {
package/web/app.js CHANGED
@@ -1835,6 +1835,13 @@ async function finish_message(result, room_id, drafts) {
1835
1835
  // place in the same render as the room's other changes (its request, the host's working card). Swapping it in first
1836
1836
  // and the rest a moment later laid the transcript out twice, and on a phone the page jumped and flashed in between.
1837
1837
  const saved_id = result.message.id;
1838
+ // Shown in the queue tray because the room looked busy, but the site posted it (the work had just ended): the row moves
1839
+ // into the transcript as the sending card, so the message is never off screen until the room is read again (#4391).
1840
+ if (!state.sending_preview && state.queueing_preview) {
1841
+ const { queued_ids, ...shown } = state.queueing_preview;
1842
+ state.sending_preview = shown;
1843
+ state.queueing_preview = null;
1844
+ }
1838
1845
  if (state.sending_preview) state.sending_preview = { ...state.sending_preview, saved_id };
1839
1846
  publish_view();
1840
1847
  refresh_room().catch(() => {}).finally(() => {
package/web/backup.js CHANGED
@@ -1,4 +1,4 @@
1
- var discuss_backup=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t={},n=(function(e,n,r,i,a){var o=new Worker(t[n]||(t[n]=URL.createObjectURL(new Blob([e+`;addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})`],{type:`text/javascript`}))));return o.onmessage=function(e){var t=e.data,n=t.$e$;if(n){var r=Error(n[0]);r.code=n[1],r.stack=n[2],a(r,null)}else a(null,t)},o.postMessage(r,i),o}),r=Uint8Array,i=Uint16Array,a=Int32Array,o=new r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),s=new r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),c=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),l=function(e,t){for(var n=new i(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var o=new a(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)o[s]=s-n[r]<<5|r;return{b:n,r:o}},u=l(o,2),d=u.b,f=u.r;d[28]=258,f[258]=28;for(var p=l(s,0),m=p.b,h=p.r,g=new i(32768),_=0;_<32768;++_){var v=(_&43690)>>1|(_&21845)<<1;v=(v&52428)>>2|(v&13107)<<2,v=(v&61680)>>4|(v&3855)<<4,g[_]=((v&65280)>>8|(v&255)<<8)>>1}for(var y=(function(e,t,n){for(var r=e.length,a=0,o=new i(t);a<r;++a)e[a]&&++o[e[a]-1];var s=new i(t);for(a=1;a<t;++a)s[a]=s[a-1]+o[a-1]<<1;var c;if(n){c=new i(1<<t);var l=15-t;for(a=0;a<r;++a)if(e[a])for(var u=a<<4|e[a],d=t-e[a],f=s[e[a]-1]++<<d,p=f|(1<<d)-1;f<=p;++f)c[g[f]>>l]=u}else for(c=new i(r),a=0;a<r;++a)e[a]&&(c[a]=g[s[e[a]-1]++]>>15-e[a]);return c}),b=new r(288),_=0;_<144;++_)b[_]=8;for(var _=144;_<256;++_)b[_]=9;for(var _=256;_<280;++_)b[_]=7;for(var _=280;_<288;++_)b[_]=8;for(var x=new r(32),_=0;_<32;++_)x[_]=5;var S=y(b,9,0),C=y(b,9,1),w=y(x,5,0),ee=y(x,5,1),te=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},T=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},E=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},ne=function(e){return(e+7)/8|0},D=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new r(e.subarray(t,n))},O=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],k=function(e,t,n){var r=Error(t||O[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,k),!n)throw r;return r},A=function(e,t,n,i){var a=e.length,l=i?i.length:0;if(!a||t.f&&!t.l)return n||new r(0);var u=!n,f=u||t.i!=2,p=t.i;u&&(n=new r(a*3));var h=function(e){var t=n.length;if(e>t){var i=new r(Math.max(t*2,e));i.set(n),n=i}},g=t.f||0,_=t.p||0,v=t.b||0,b=t.l,x=t.d,S=t.m,w=t.n,O=a*8;do{if(!b){g=T(e,_,1);var A=T(e,_+1,3);if(_+=3,!A){var j=ne(_)+4,M=e[j-4]|e[j-3]<<8,N=j+M;if(N>a){p&&k(0);break}f&&h(v+M),n.set(e.subarray(j,N),v),t.b=v+=M,t.p=_=N*8,t.f=g;continue}if(A==1)b=C,x=ee,S=9,w=5;else if(A==2){var P=T(e,_,31)+257,re=T(e,_+10,15)+4,F=P+T(e,_+5,31)+1;_+=14;for(var ie=new r(F),I=new r(19),L=0;L<re;++L)I[c[L]]=T(e,_+L*3,7);_+=re*3;for(var R=te(I),ae=(1<<R)-1,z=y(I,R,1),L=0;L<F;){var B=z[T(e,_,ae)];_+=B&15;var j=B>>4;if(j<16)ie[L++]=j;else{var V=0,H=0;for(j==16?(H=3+T(e,_,3),_+=2,V=ie[L-1]):j==17?(H=3+T(e,_,7),_+=3):j==18&&(H=11+T(e,_,127),_+=7);H--;)ie[L++]=V}}var U=ie.subarray(0,P),W=ie.subarray(P);S=te(U),w=te(W),b=y(U,S,1),x=y(W,w,1)}else k(1);if(_>O){p&&k(0);break}}f&&h(v+131072);for(var oe=(1<<S)-1,se=(1<<w)-1,G=_;;G=_){var V=b[E(e,_)&oe],K=V>>4;if(_+=V&15,_>O){p&&k(0);break}if(V||k(2),K<256)n[v++]=K;else if(K==256){G=_,b=null;break}else{var q=K-254;if(K>264){var L=K-257,J=o[L];q=T(e,_,(1<<J)-1)+d[L],_+=J}var Y=x[E(e,_)&se],X=Y>>4;Y||k(3),_+=Y&15;var W=m[X];if(X>3){var J=s[X];W+=E(e,_)&(1<<J)-1,_+=J}if(_>O){p&&k(0);break}f&&h(v+131072);var Z=v+q;if(v<W){var ce=l-W,Q=Math.min(W,Z);for(ce+v<0&&k(3);v<Q;++v)n[v]=i[ce+v]}for(;v<Z;++v)n[v]=n[v-W]}}t.l=b,t.p=G,t.b=v,t.f=g,b&&(g=1,t.m=S,t.d=x,t.n=w)}while(!g);return v!=n.length&&u?D(n,0,v):n.subarray(0,v)},j=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},M=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},N=function(e,t){for(var n=[],a=0;a<e.length;++a)e[a]&&n.push({s:a,f:e[a]});var o=n.length,s=n.slice();if(!o)return{t:R,l:0};if(o==1){var c=new r(n[0].s+1);return c[n[0].s]=1,{t:c,l:1}}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var l=n[0],u=n[1],d=0,f=1,p=2;for(n[0]={s:-1,f:l.f+u.f,l,r:u};f!=o-1;)l=n[n[d].f<n[p].f?d++:p++],u=n[d!=f&&n[d].f<n[p].f?d++:p++],n[f++]={s:-1,f:l.f+u.f,l,r:u};for(var m=s[0].s,a=1;a<o;++a)s[a].s>m&&(m=s[a].s);var h=new i(m+1),g=P(n[f-1],h,0);if(g>t){var a=0,_=0,v=g-t,y=1<<v;for(s.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});a<o;++a){var b=s[a].s;if(h[b]>t)_+=y-(1<<g-h[b]),h[b]=t;else break}for(_>>=v;_>0;){var x=s[a].s;h[x]<t?_-=1<<t-h[x]++-1:++a}for(;a>=0&&_;--a){var S=s[a].s;h[S]==t&&(--h[S],++_)}g=t}return{t:new r(h),l:g}},P=function(e,t,n){return e.s==-1?Math.max(P(e.l,t,n+1),P(e.r,t,n+1)):t[e.s]=n},re=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new i(++t),r=0,a=e[0],o=1,s=function(e){n[r++]=e},c=1;c<=t;++c)if(e[c]==a&&c!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(a),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(a);o=1,a=e[c]}return{c:n.subarray(0,r),n:t}},F=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},ie=function(e,t,n){var r=n.length,i=ne(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<r;++a)e[i+a+4]=n[a];return(i+4+r)*8},I=function(e,t,n,r,a,l,u,d,f,p,m){j(t,m++,n),++a[256];for(var h=N(a,15),g=h.t,_=h.l,v=N(l,15),C=v.t,ee=v.l,te=re(g),T=te.c,E=te.n,ne=re(C),D=ne.c,O=ne.n,k=new i(19),A=0;A<T.length;++A)++k[T[A]&31];for(var A=0;A<D.length;++A)++k[D[A]&31];for(var P=N(k,7),I=P.t,L=P.l,R=19;R>4&&!I[c[R-1]];--R);var ae=p+5<<3,z=F(a,b)+F(l,x)+u,B=F(a,g)+F(l,C)+u+14+3*R+F(k,I)+2*k[16]+3*k[17]+7*k[18];if(f>=0&&ae<=z&&ae<=B)return ie(t,m,e.subarray(f,f+p));var V,H,U,W;if(j(t,m,1+(B<z)),m+=2,B<z){V=y(g,_,0),H=g,U=y(C,ee,0),W=C;var oe=y(I,L,0);j(t,m,E-257),j(t,m+5,O-1),j(t,m+10,R-4),m+=14;for(var A=0;A<R;++A)j(t,m+3*A,I[c[A]]);m+=3*R;for(var se=[T,D],G=0;G<2;++G)for(var K=se[G],A=0;A<K.length;++A){var q=K[A]&31;j(t,m,oe[q]),m+=I[q],q>15&&(j(t,m,K[A]>>5&127),m+=K[A]>>12)}}else V=S,H=b,U=w,W=x;for(var A=0;A<d;++A){var J=r[A];if(J>255){var q=J>>18&31;M(t,m,V[q+257]),m+=H[q+257],q>7&&(j(t,m,J>>23&31),m+=o[q]);var Y=J&31;M(t,m,U[Y]),m+=W[Y],Y>3&&(M(t,m,J>>5&8191),m+=s[Y])}else M(t,m,V[J]),m+=H[J]}return M(t,m,V[256]),m+H[256]},L=new a([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),R=new r(0),ae=function(e,t,n,c,l,u){var d=u.z||e.length,p=new r(c+d+5*(1+Math.ceil(d/7e3))+l),m=p.subarray(c,p.length-l),g=u.l,_=(u.r||0)&7;if(t){_&&(m[0]=u.r>>3);for(var v=L[t-1],y=v>>13,b=v&8191,x=(1<<n)-1,S=u.p||new i(32768),C=u.h||new i(x+1),w=Math.ceil(n/3),ee=2*w,te=function(t){return(e[t]^e[t+1]<<w^e[t+2]<<ee)&x},T=new a(25e3),E=new i(288),O=new i(32),k=0,A=0,j=u.i||0,M=0,N=u.w||0,P=0;j+2<d;++j){var re=te(j),F=j&32767,R=C[re];if(S[F]=R,C[re]=F,N<=j){var ae=d-j;if((k>7e3||M>24576)&&(ae>423||!g)){_=I(e,m,0,T,E,O,A,M,P,j-P,_),M=k=A=0,P=j;for(var z=0;z<286;++z)E[z]=0;for(var z=0;z<30;++z)O[z]=0}var B=2,V=0,H=b,U=F-R&32767;if(ae>2&&re==te(j-U))for(var W=Math.min(y,ae)-1,oe=Math.min(32767,j),se=Math.min(258,ae);U<=oe&&--H&&F!=R;){if(e[j+B]==e[j+B-U]){for(var G=0;G<se&&e[j+G]==e[j+G-U];++G);if(G>B){if(B=G,V=U,G>W)break;for(var K=Math.min(U,G-2),q=0,z=0;z<K;++z){var J=j-U+z&32767,Y=J-S[J]&32767;Y>q&&(q=Y,R=J)}}}F=R,R=S[F],U+=F-R&32767}if(V){T[M++]=268435456|f[B]<<18|h[V];var X=f[B]&31,Z=h[V]&31;A+=o[X]+s[Z],++E[257+X],++O[Z],N=j+B,++k}else T[M++]=e[j],++E[e[j]]}}for(j=Math.max(j,N);j<d;++j)T[M++]=e[j],++E[e[j]];_=I(e,m,g,T,E,O,A,M,P,j-P,_),g||(u.r=_&7|m[_/8|0]<<3,_-=7,u.h=C,u.p=S,u.i=j,u.w=N)}else{for(var j=u.w||0;j<d+g;j+=65535){var ce=j+65535;ce>=d&&(m[_/8|0]=g,ce=d),_=ie(m,_+1,e.subarray(j,ce))}u.i=d}return D(p,0,c+ne(_)+l)},z=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),B=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=z[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},V=function(e,t,n,i,a){if(!a&&(a={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new r(o.length+e.length);s.set(o),s.set(e,o.length),e=s,a.w=o.length}return ae(e,t.level==null?6:t.level,t.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,i,a)},H=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},U=function(e,t,n){for(var r=e(),i=e.toString(),a=i.slice(i.indexOf(`[`)+1,i.lastIndexOf(`]`)).replace(/\s+/g,``).split(`,`),o=0;o<r.length;++o){var s=r[o],c=a[o];if(typeof s==`function`){t+=`;`+c+`=`;var l=s.toString();if(s.prototype){if(l.indexOf(`[native code]`)!=-1){var u=l.indexOf(` `,8)+1;t+=l.slice(u,l.indexOf(`(`,u))}else for(var d in t+=l,s.prototype)t+=`;`+c+`.prototype.`+d+`=`+s.prototype[d].toString()}else t+=l}else n[c]=s}return t},W=[],oe=function(e){var t=[];for(var n in e)e[n].buffer&&t.push((e[n]=new e[n].constructor(e[n])).buffer);return t},se=function(e,t,r,i){if(!W[r]){for(var a=``,o={},s=e.length-1,c=0;c<s;++c)a=U(e[c],a,o);W[r]={c:U(e[s],a,o),e:o}}var l=H({},W[r].e);return n(W[r].c+`;onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=`+t.toString()+`}`,r,l,oe(l),i)},G=function(){return[r,i,a,o,s,c,d,m,C,ee,g,O,y,te,T,E,ne,D,k,A,fe,q,J]},K=function(){return[r,i,a,o,s,c,f,h,S,b,w,x,g,L,R,y,j,M,N,P,re,F,ie,I,ne,D,ae,V,ue,q]},q=function(e){return postMessage(e,[e.buffer])},J=function(e){return e&&{out:e.size&&new r(e.size),dictionary:e.dictionary}},Y=function(e,t,n,r,i,a){var o=se(n,r,i,function(e,t){o.terminate(),a(e,t)});return o.postMessage([e,t],t.consume?[e.buffer]:[]),function(){o.terminate()}},X=function(e,t){return e[t]|e[t+1]<<8},Z=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},ce=function(e,t){return Z(e,t)+Z(e,t+4)*4294967296},Q=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function le(e,t,n){return n||(n=t,t={}),typeof n!=`function`&&k(7),Y(e,t,[K],function(e){return q(ue(e.data[0],e.data[1]))},0,n)}function ue(e,t){return V(e,t||{},0,0)}function de(e,t,n){return n||(n=t,t={}),typeof n!=`function`&&k(7),Y(e,t,[G],function(e){return q(fe(e.data[0],J(e.data[1])))},1,n)}function fe(e,t){return A(e,{i:2},t&&t.out,t&&t.dictionary)}var pe=function(e,t,n,i){for(var a in e){var o=e[a],s=t+a,c=i;Array.isArray(o)&&(c=H(i,o[1]),o=o[0]),ArrayBuffer.isView(o)?n[s]=[o,c]:(n[s+=`/`]=[new r(0),c],pe(o,s,n,i))}},me=typeof TextEncoder<`u`&&new TextEncoder,he=typeof TextDecoder<`u`&&new TextDecoder;try{he.decode(R,{stream:!0})}catch{}var ge=function(e){for(var t=``,n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:D(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function _e(e,t){if(t){for(var n=new r(e.length),i=0;i<e.length;++i)n[i]=e.charCodeAt(i);return n}if(me)return me.encode(e);for(var a=e.length,o=new r(e.length+(e.length>>1)),s=0,c=function(e){o[s++]=e},i=0;i<a;++i){if(s+5>o.length){var l=new r(s+8+(a-i<<1));l.set(o),o=l}var u=e.charCodeAt(i);u<128||t?c(u):u<2048?(c(192|u>>6),c(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|e.charCodeAt(++i)&1023,c(240|u>>18),c(128|u>>12&63),c(128|u>>6&63),c(128|u&63)):(c(224|u>>12),c(128|u>>6&63),c(128|u&63))}return D(o,0,s)}function ve(e,t){if(t){for(var n=``,r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(he)return he.decode(e);var i=ge(e),a=i.s,n=i.r;return n.length&&k(8),a}var ye=function(e,t){return t+30+X(e,t+26)+X(e,t+28)},be=function(e,t,n){var r=X(e,t+28),i=X(e,t+30),a=ve(e.subarray(t+46,t+46+r),!(X(e,t+8)&2048)),o=t+46+r,s=xe(e,o,i,n,Z(e,t+20),Z(e,t+24),Z(e,t+42)),c=s[0],l=s[1],u=s[2];return[X(e,t+10),c,l,a,o+i+X(e,t+32),u]},xe=function(e,t,n,r,i,a,o){var s=i==4294967295,c=a==4294967295,l=o==4294967295,u=t+n,d=s+c+l;if(r&&d){for(;t+4<u;t+=4+X(e,t+2))if(X(e,t)==1)return[s?ce(e,t+4+8*c):i,c?ce(e,t+4):a,l?ce(e,t+4+8*(c+s)):o,1];r<2&&k(13)}return[i,a,o,0]},Se=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&k(9),t+=r+4}return t},Ce=function(e,t,n,r,i,a,o,s){var c=r.length,l=n.extra,u=s&&s.length,d=Se(l);Q(e,t,o==null?67324752:33639248),t+=4,o!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(a<0&&8),e[t++]=i&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;var f=new Date(n.mtime==null?Date.now():n.mtime),p=f.getFullYear()-1980;if((p<0||p>119)&&k(10),Q(e,t,p<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>1),t+=4,a!=-1&&(Q(e,t,n.crc),Q(e,t+4,a<0?-a-2:a),Q(e,t+8,n.size)),Q(e,t+12,c),Q(e,t+14,d),t+=16,o!=null&&(Q(e,t,u),Q(e,t+6,n.attrs),Q(e,t+10,o),t+=14),e.set(r,t),t+=c,d)for(var m in l){var h=l[m],g=h.length;Q(e,t,+m),Q(e,t+2,g),e.set(h,t+4),t+=4+g}return u&&(e.set(s,t),t+=u),t},we=function(e,t,n,r,i){Q(e,t,101010256),Q(e,t+8,n),Q(e,t+10,n),Q(e,t+12,r),Q(e,t+16,i)};function Te(e,t,n){n||(n=t,t={}),typeof n!=`function`&&k(7);var i={};pe(e,``,i,t);var a=Object.keys(i),o=a.length,s=0,c=0,l=o,u=Array(o),d=[],f=function(){for(var e=0;e<d.length;++e)d[e]()},p=function(e,t){Ee(function(){n(e,t)})};Ee(function(){p=n});var m=function(){var e=new r(c+22),t=s,n=c-s;c=0;for(var i=0;i<l;++i){var a=u[i];try{var o=a.c.length;Ce(e,c,a,a.f,a.u,o);var d=30+a.f.length+Se(a.extra),f=c+d;e.set(a.c,f),Ce(e,s,a,a.f,a.u,o,c,a.m),s+=16+d+(a.m?a.m.length:0),c=f+o}catch(e){return p(e,null)}}we(e,s,u.length,n,t),p(null,e)};o||m();for(var h=function(e){var t=a[e],n=i[t],r=n[0],l=n[1],h=B(),g=r.length;h.p(r);var _=_e(t),v=_.length,y=l.comment,b=y&&_e(y),x=b&&b.length,S=Se(l.extra),C=l.level==0?0:8,w=function(n,r){if(n)f(),p(n,null);else{var i=r.length;u[e]=H(l,{size:g,crc:h.d(),c:r,f:_,m:b,u:v!=t.length||b&&y.length!=x,compression:C}),s+=30+v+S+i,c+=76+2*(v+S)+(x||0)+i,--o||m()}};if(v>65535&&w(k(11,0,1),null),!C)w(null,r);else if(g<16e4)try{w(null,ue(r,l))}catch(e){w(e,null)}else d.push(le(r,l,w))},g=0;g<l;++g)h(g);return f}var Ee=typeof queueMicrotask==`function`?queueMicrotask:typeof setTimeout==`function`?setTimeout:function(e){e()};function De(e,t,n){n||(n=t,t={}),typeof n!=`function`&&k(7);var i=[],a=function(){for(var e=0;e<i.length;++e)i[e]()},o={},s=function(e,t){Ee(function(){n(e,t)})};Ee(function(){s=n});for(var c=e.length-22;Z(e,c)!=101010256;--c)if(!c||e.length-c>65558)return s(k(13,0,1),null),a;var l=X(e,c+8);if(l){var u=l,d=Z(e,c+16),f=Z(e,c-20)==117853008;if(f){var p=Z(e,c-12);f=Z(e,p)==101075792,f&&(u=l=Z(e,p+32),d=Z(e,p+48))}for(var m=t&&t.filter,h=function(t){var n=be(e,d,f),c=n[0],u=n[1],p=n[2],h=n[3],g=n[4],_=n[5],v=ye(e,_);d=g;var y=function(e,t){e?(a(),s(e,null)):(t&&(o[h]=t),--l||s(null,o))};if(!m||m({name:h,size:u,originalSize:p,compression:c})){if(!c)y(null,D(e,v,v+u));else if(c==8){var b=e.subarray(v,v+u);if(p<524288||u>.8*p)try{y(null,fe(b,{out:new r(p)}))}catch(e){y(e,null)}else i.push(de(b,{size:p},y))}else y(k(14,`unknown compression type `+c,1),null)}else y(null,null)},g=0;g<u;++g)h(g)}else s(null,{});return a}var Oe=[`read`,`write`,`auto`,`full`],ke={stoppable:!0,progress:!0},Ae={stoppable:!1,progress:!1},je=`final_remark`,Me={codex_cli:{platform:`Codex`,label:`Codex CLI`,kind:`cli`,location:`executable`,fields:[`project_id`,`project_name`],efforts:[`low`,`medium`,`high`,`xhigh`,`max`,`ultra`],models:!0,access_levels:Oe,per_tool_allow:!1,access_hints:{read:`只读沙箱`,write:`项目可写的沙箱,命令在沙箱内运行、可联网`,auto:`沙箱外的操作由模型申请提权,Codex 自动审核代替人工批准`,full:`无沙箱、无审批(--dangerously-bypass-approvals-and-sandbox)`},client:`codex`,adopt:`session`,host_existing:!0,session_family:`codex`,browse_sessions:!0,lockdown_hint:`沙箱只读档仍可读整个磁盘、运行任意只读命令,无法只放行 codiscuss 命令`,capabilities:{delivery:ke,rewind:`cut`,project:!0,access_env:!0,enforces_read_only:!0,limits_directories:!0,ripgrep:!0,chat:!0,resume:!0,images:!0,capture:je,tool_lockdown:!1,close_grace_ms:1500}},codex:{platform:`Codex`,label:`Codex App`,kind:`app`,location:`executable`,fields:[`source_thread_id`,`project_id`,`project_name`],efforts:null,models:!1,access_levels:null,per_tool_allow:!1,client:`codex`,adopt:`session`,host_existing:!0,session_family:`codex`,browse_sessions:!0,lockdown_hint:`权限由 App 决定,接入程序无法逐次收窄`,capabilities:{delivery:Ae,rewind:`cut`,project:!0,chat:!0,capture:!1,tool_lockdown:!1}},claude:{platform:`Claude`,label:`Claude Code`,kind:`cli`,location:`executable`,fields:[`allowed_tools`],efforts:[`low`,`medium`,`high`,`xhigh`,`max`],models:!0,access_levels:Oe,per_tool_allow:!0,access_hints:{read:`只放行网站命令与草稿,不改项目文件、不跑其他命令`,write:`可改项目文件,Bash / PowerShell 命令全部放行(无沙箱)`,auto:`Claude auto 模式:由分类器判断,实测项目外写入和联网都会放行`,full:`bypassPermissions:跳过全部权限检查`},client:`claude`,adopt:`own_cwd`,host_existing:!0,restore_manual:!0,browse_sessions:!0,resume_command:e=>`claude --resume ${e}`,windows_command:`codiscuss`,capabilities:{delivery:ke,rewind:`cut`,project:!0,access_env:!0,chat:!0,resume:!0,images:!0,capture:je,tool_lockdown:!0}},antigravity_cli:{platform:`Antigravity`,label:`Antigravity CLI`,kind:`cli`,location:`executable`,fields:[`project_id`,`project_name`],efforts:[`low`,`medium`,`high`,`xhigh`,`max`],efforts_per_model:!0,models:!0,defaults_by_query:!0,access_levels:[`read`,`write`,`full`],per_tool_allow:!0,access_hints:{read:`只放行网站命令;碰到未放行的命令会直接结束本轮`,write:`可写项目,命令全部放行(在 agy 沙箱内)`,full:`跳过全部权限确认(--dangerously-skip-permissions),并放开沙箱外命令与 MCP 工具`},unsupported_hints:{auto:`agy 只在交互窗口提供自动模式,后台运行(-p)不支持`},client:`antigravity`,adopt:`session`,host_existing:!1,own_project_when_bound:!0,browse_sessions:!0,lockdown_hint:`文件读取、网页读取与搜索工具是否全部受权限规则约束尚未核实,无法保证只放行 codiscuss 命令`,capabilities:{delivery:ke,rewind:`cut`,project:!0,access_env:!0,chat:!0,capture:je,tool_lockdown:!1},task_rules:(e,{runs_commands:t})=>(t?``:`无人值守下 run_command 只能运行 ${e} 的 subcommands 子命令,其他命令会被自动拒绝并使会话直接结束;列目录、搜索或读取文件用你环境自带的文件工具,不要经 run_command。`)+`多步任务中,在关键转折处用一句话写出进展再继续:agy 不输出思考过程,网页只能靠这些话显示你做到哪一步。`},antigravity:{platform:`Antigravity`,label:`Antigravity App`,kind:`app`,location:`ipc_directory`,fields:[`project_id`,`project_name`],efforts:null,models:!1,access_levels:null,per_tool_allow:!1,client:`antigravity`,adopt:`session`,host_existing:!0,lockdown_hint:`权限由 App 决定,接入程序无法逐次收窄`,capabilities:{delivery:Ae,rewind:`kept`,project:!0,chat:!0,capture:!1,tool_lockdown:!1}},api:{platform:``,label:`模型 API`,kind:`api`,location:``,fields:[`base_url`,`api_protocol`,`api_key_ref`,`image_input`],efforts:[`low`,`medium`,`high`],models:!1,access_levels:[`read`,`write`],per_tool_allow:!1,adopt:``,host_existing:!1,access_hints:{read:`用接入程序的文件工具读取、搜索项目文件,可运行工作流登记的只读命令`,write:`还可新建、覆盖、局部编辑项目文件,可运行工作流登记的全部命令;没有通用命令行`},unsupported_hints:{auto:`API 成员没有通用命令行,没有需要软件审批的操作`,full:`API 成员没有通用命令行,没有需要软件审批的操作`},capabilities:{delivery:ke,rewind:`cut`,project:!0,file_tools:!0,limits_directories:!0,chat:!0,images:`configured`,capture:!1,tool_lockdown:!0}}};Object.keys(Me);function Ne(e){let t=Me[e];return t?{id:e,session_family:e,windows_command:`codiscuss.cmd`,...t}:null}var Pe=6e4,Fe=80,Ie=`AI CoDiscuss 聊天室备份
1
+ var discuss_backup=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t={},n=(function(e,n,r,i,a){var o=new Worker(t[n]||(t[n]=URL.createObjectURL(new Blob([e+`;addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})`],{type:`text/javascript`}))));return o.onmessage=function(e){var t=e.data,n=t.$e$;if(n){var r=Error(n[0]);r.code=n[1],r.stack=n[2],a(r,null)}else a(null,t)},o.postMessage(r,i),o}),r=Uint8Array,i=Uint16Array,a=Int32Array,o=new r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),s=new r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),c=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),l=function(e,t){for(var n=new i(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var o=new a(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)o[s]=s-n[r]<<5|r;return{b:n,r:o}},u=l(o,2),d=u.b,f=u.r;d[28]=258,f[258]=28;for(var p=l(s,0),m=p.b,h=p.r,g=new i(32768),_=0;_<32768;++_){var v=(_&43690)>>1|(_&21845)<<1;v=(v&52428)>>2|(v&13107)<<2,v=(v&61680)>>4|(v&3855)<<4,g[_]=((v&65280)>>8|(v&255)<<8)>>1}for(var y=(function(e,t,n){for(var r=e.length,a=0,o=new i(t);a<r;++a)e[a]&&++o[e[a]-1];var s=new i(t);for(a=1;a<t;++a)s[a]=s[a-1]+o[a-1]<<1;var c;if(n){c=new i(1<<t);var l=15-t;for(a=0;a<r;++a)if(e[a])for(var u=a<<4|e[a],d=t-e[a],f=s[e[a]-1]++<<d,p=f|(1<<d)-1;f<=p;++f)c[g[f]>>l]=u}else for(c=new i(r),a=0;a<r;++a)e[a]&&(c[a]=g[s[e[a]-1]++]>>15-e[a]);return c}),b=new r(288),_=0;_<144;++_)b[_]=8;for(var _=144;_<256;++_)b[_]=9;for(var _=256;_<280;++_)b[_]=7;for(var _=280;_<288;++_)b[_]=8;for(var x=new r(32),_=0;_<32;++_)x[_]=5;var S=y(b,9,0),C=y(b,9,1),w=y(x,5,0),ee=y(x,5,1),te=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},T=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},E=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},ne=function(e){return(e+7)/8|0},D=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new r(e.subarray(t,n))},O=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],k=function(e,t,n){var r=Error(t||O[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,k),!n)throw r;return r},A=function(e,t,n,i){var a=e.length,l=i?i.length:0;if(!a||t.f&&!t.l)return n||new r(0);var u=!n,f=u||t.i!=2,p=t.i;u&&(n=new r(a*3));var h=function(e){var t=n.length;if(e>t){var i=new r(Math.max(t*2,e));i.set(n),n=i}},g=t.f||0,_=t.p||0,v=t.b||0,b=t.l,x=t.d,S=t.m,w=t.n,O=a*8;do{if(!b){g=T(e,_,1);var A=T(e,_+1,3);if(_+=3,!A){var j=ne(_)+4,M=e[j-4]|e[j-3]<<8,N=j+M;if(N>a){p&&k(0);break}f&&h(v+M),n.set(e.subarray(j,N),v),t.b=v+=M,t.p=_=N*8,t.f=g;continue}if(A==1)b=C,x=ee,S=9,w=5;else if(A==2){var P=T(e,_,31)+257,re=T(e,_+10,15)+4,F=P+T(e,_+5,31)+1;_+=14;for(var ie=new r(F),I=new r(19),L=0;L<re;++L)I[c[L]]=T(e,_+L*3,7);_+=re*3;for(var R=te(I),ae=(1<<R)-1,z=y(I,R,1),L=0;L<F;){var B=z[T(e,_,ae)];_+=B&15;var j=B>>4;if(j<16)ie[L++]=j;else{var V=0,H=0;for(j==16?(H=3+T(e,_,3),_+=2,V=ie[L-1]):j==17?(H=3+T(e,_,7),_+=3):j==18&&(H=11+T(e,_,127),_+=7);H--;)ie[L++]=V}}var U=ie.subarray(0,P),W=ie.subarray(P);S=te(U),w=te(W),b=y(U,S,1),x=y(W,w,1)}else k(1);if(_>O){p&&k(0);break}}f&&h(v+131072);for(var oe=(1<<S)-1,se=(1<<w)-1,G=_;;G=_){var V=b[E(e,_)&oe],K=V>>4;if(_+=V&15,_>O){p&&k(0);break}if(V||k(2),K<256)n[v++]=K;else if(K==256){G=_,b=null;break}else{var q=K-254;if(K>264){var L=K-257,J=o[L];q=T(e,_,(1<<J)-1)+d[L],_+=J}var Y=x[E(e,_)&se],X=Y>>4;Y||k(3),_+=Y&15;var W=m[X];if(X>3){var J=s[X];W+=E(e,_)&(1<<J)-1,_+=J}if(_>O){p&&k(0);break}f&&h(v+131072);var Z=v+q;if(v<W){var ce=l-W,Q=Math.min(W,Z);for(ce+v<0&&k(3);v<Q;++v)n[v]=i[ce+v]}for(;v<Z;++v)n[v]=n[v-W]}}t.l=b,t.p=G,t.b=v,t.f=g,b&&(g=1,t.m=S,t.d=x,t.n=w)}while(!g);return v!=n.length&&u?D(n,0,v):n.subarray(0,v)},j=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},M=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},N=function(e,t){for(var n=[],a=0;a<e.length;++a)e[a]&&n.push({s:a,f:e[a]});var o=n.length,s=n.slice();if(!o)return{t:R,l:0};if(o==1){var c=new r(n[0].s+1);return c[n[0].s]=1,{t:c,l:1}}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var l=n[0],u=n[1],d=0,f=1,p=2;for(n[0]={s:-1,f:l.f+u.f,l,r:u};f!=o-1;)l=n[n[d].f<n[p].f?d++:p++],u=n[d!=f&&n[d].f<n[p].f?d++:p++],n[f++]={s:-1,f:l.f+u.f,l,r:u};for(var m=s[0].s,a=1;a<o;++a)s[a].s>m&&(m=s[a].s);var h=new i(m+1),g=P(n[f-1],h,0);if(g>t){var a=0,_=0,v=g-t,y=1<<v;for(s.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});a<o;++a){var b=s[a].s;if(h[b]>t)_+=y-(1<<g-h[b]),h[b]=t;else break}for(_>>=v;_>0;){var x=s[a].s;h[x]<t?_-=1<<t-h[x]++-1:++a}for(;a>=0&&_;--a){var S=s[a].s;h[S]==t&&(--h[S],++_)}g=t}return{t:new r(h),l:g}},P=function(e,t,n){return e.s==-1?Math.max(P(e.l,t,n+1),P(e.r,t,n+1)):t[e.s]=n},re=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new i(++t),r=0,a=e[0],o=1,s=function(e){n[r++]=e},c=1;c<=t;++c)if(e[c]==a&&c!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(a),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(a);o=1,a=e[c]}return{c:n.subarray(0,r),n:t}},F=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},ie=function(e,t,n){var r=n.length,i=ne(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<r;++a)e[i+a+4]=n[a];return(i+4+r)*8},I=function(e,t,n,r,a,l,u,d,f,p,m){j(t,m++,n),++a[256];for(var h=N(a,15),g=h.t,_=h.l,v=N(l,15),C=v.t,ee=v.l,te=re(g),T=te.c,E=te.n,ne=re(C),D=ne.c,O=ne.n,k=new i(19),A=0;A<T.length;++A)++k[T[A]&31];for(var A=0;A<D.length;++A)++k[D[A]&31];for(var P=N(k,7),I=P.t,L=P.l,R=19;R>4&&!I[c[R-1]];--R);var ae=p+5<<3,z=F(a,b)+F(l,x)+u,B=F(a,g)+F(l,C)+u+14+3*R+F(k,I)+2*k[16]+3*k[17]+7*k[18];if(f>=0&&ae<=z&&ae<=B)return ie(t,m,e.subarray(f,f+p));var V,H,U,W;if(j(t,m,1+(B<z)),m+=2,B<z){V=y(g,_,0),H=g,U=y(C,ee,0),W=C;var oe=y(I,L,0);j(t,m,E-257),j(t,m+5,O-1),j(t,m+10,R-4),m+=14;for(var A=0;A<R;++A)j(t,m+3*A,I[c[A]]);m+=3*R;for(var se=[T,D],G=0;G<2;++G)for(var K=se[G],A=0;A<K.length;++A){var q=K[A]&31;j(t,m,oe[q]),m+=I[q],q>15&&(j(t,m,K[A]>>5&127),m+=K[A]>>12)}}else V=S,H=b,U=w,W=x;for(var A=0;A<d;++A){var J=r[A];if(J>255){var q=J>>18&31;M(t,m,V[q+257]),m+=H[q+257],q>7&&(j(t,m,J>>23&31),m+=o[q]);var Y=J&31;M(t,m,U[Y]),m+=W[Y],Y>3&&(M(t,m,J>>5&8191),m+=s[Y])}else M(t,m,V[J]),m+=H[J]}return M(t,m,V[256]),m+H[256]},L=new a([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),R=new r(0),ae=function(e,t,n,c,l,u){var d=u.z||e.length,p=new r(c+d+5*(1+Math.ceil(d/7e3))+l),m=p.subarray(c,p.length-l),g=u.l,_=(u.r||0)&7;if(t){_&&(m[0]=u.r>>3);for(var v=L[t-1],y=v>>13,b=v&8191,x=(1<<n)-1,S=u.p||new i(32768),C=u.h||new i(x+1),w=Math.ceil(n/3),ee=2*w,te=function(t){return(e[t]^e[t+1]<<w^e[t+2]<<ee)&x},T=new a(25e3),E=new i(288),O=new i(32),k=0,A=0,j=u.i||0,M=0,N=u.w||0,P=0;j+2<d;++j){var re=te(j),F=j&32767,R=C[re];if(S[F]=R,C[re]=F,N<=j){var ae=d-j;if((k>7e3||M>24576)&&(ae>423||!g)){_=I(e,m,0,T,E,O,A,M,P,j-P,_),M=k=A=0,P=j;for(var z=0;z<286;++z)E[z]=0;for(var z=0;z<30;++z)O[z]=0}var B=2,V=0,H=b,U=F-R&32767;if(ae>2&&re==te(j-U))for(var W=Math.min(y,ae)-1,oe=Math.min(32767,j),se=Math.min(258,ae);U<=oe&&--H&&F!=R;){if(e[j+B]==e[j+B-U]){for(var G=0;G<se&&e[j+G]==e[j+G-U];++G);if(G>B){if(B=G,V=U,G>W)break;for(var K=Math.min(U,G-2),q=0,z=0;z<K;++z){var J=j-U+z&32767,Y=J-S[J]&32767;Y>q&&(q=Y,R=J)}}}F=R,R=S[F],U+=F-R&32767}if(V){T[M++]=268435456|f[B]<<18|h[V];var X=f[B]&31,Z=h[V]&31;A+=o[X]+s[Z],++E[257+X],++O[Z],N=j+B,++k}else T[M++]=e[j],++E[e[j]]}}for(j=Math.max(j,N);j<d;++j)T[M++]=e[j],++E[e[j]];_=I(e,m,g,T,E,O,A,M,P,j-P,_),g||(u.r=_&7|m[_/8|0]<<3,_-=7,u.h=C,u.p=S,u.i=j,u.w=N)}else{for(var j=u.w||0;j<d+g;j+=65535){var ce=j+65535;ce>=d&&(m[_/8|0]=g,ce=d),_=ie(m,_+1,e.subarray(j,ce))}u.i=d}return D(p,0,c+ne(_)+l)},z=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),B=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=z[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},V=function(e,t,n,i,a){if(!a&&(a={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new r(o.length+e.length);s.set(o),s.set(e,o.length),e=s,a.w=o.length}return ae(e,t.level==null?6:t.level,t.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,i,a)},H=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},U=function(e,t,n){for(var r=e(),i=e.toString(),a=i.slice(i.indexOf(`[`)+1,i.lastIndexOf(`]`)).replace(/\s+/g,``).split(`,`),o=0;o<r.length;++o){var s=r[o],c=a[o];if(typeof s==`function`){t+=`;`+c+`=`;var l=s.toString();if(s.prototype){if(l.indexOf(`[native code]`)!=-1){var u=l.indexOf(` `,8)+1;t+=l.slice(u,l.indexOf(`(`,u))}else for(var d in t+=l,s.prototype)t+=`;`+c+`.prototype.`+d+`=`+s.prototype[d].toString()}else t+=l}else n[c]=s}return t},W=[],oe=function(e){var t=[];for(var n in e)e[n].buffer&&t.push((e[n]=new e[n].constructor(e[n])).buffer);return t},se=function(e,t,r,i){if(!W[r]){for(var a=``,o={},s=e.length-1,c=0;c<s;++c)a=U(e[c],a,o);W[r]={c:U(e[s],a,o),e:o}}var l=H({},W[r].e);return n(W[r].c+`;onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=`+t.toString()+`}`,r,l,oe(l),i)},G=function(){return[r,i,a,o,s,c,d,m,C,ee,g,O,y,te,T,E,ne,D,k,A,fe,q,J]},K=function(){return[r,i,a,o,s,c,f,h,S,b,w,x,g,L,R,y,j,M,N,P,re,F,ie,I,ne,D,ae,V,ue,q]},q=function(e){return postMessage(e,[e.buffer])},J=function(e){return e&&{out:e.size&&new r(e.size),dictionary:e.dictionary}},Y=function(e,t,n,r,i,a){var o=se(n,r,i,function(e,t){o.terminate(),a(e,t)});return o.postMessage([e,t],t.consume?[e.buffer]:[]),function(){o.terminate()}},X=function(e,t){return e[t]|e[t+1]<<8},Z=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},ce=function(e,t){return Z(e,t)+Z(e,t+4)*4294967296},Q=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function le(e,t,n){return n||(n=t,t={}),typeof n!=`function`&&k(7),Y(e,t,[K],function(e){return q(ue(e.data[0],e.data[1]))},0,n)}function ue(e,t){return V(e,t||{},0,0)}function de(e,t,n){return n||(n=t,t={}),typeof n!=`function`&&k(7),Y(e,t,[G],function(e){return q(fe(e.data[0],J(e.data[1])))},1,n)}function fe(e,t){return A(e,{i:2},t&&t.out,t&&t.dictionary)}var pe=function(e,t,n,i){for(var a in e){var o=e[a],s=t+a,c=i;Array.isArray(o)&&(c=H(i,o[1]),o=o[0]),ArrayBuffer.isView(o)?n[s]=[o,c]:(n[s+=`/`]=[new r(0),c],pe(o,s,n,i))}},me=typeof TextEncoder<`u`&&new TextEncoder,he=typeof TextDecoder<`u`&&new TextDecoder;try{he.decode(R,{stream:!0})}catch{}var ge=function(e){for(var t=``,n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:D(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function _e(e,t){if(t){for(var n=new r(e.length),i=0;i<e.length;++i)n[i]=e.charCodeAt(i);return n}if(me)return me.encode(e);for(var a=e.length,o=new r(e.length+(e.length>>1)),s=0,c=function(e){o[s++]=e},i=0;i<a;++i){if(s+5>o.length){var l=new r(s+8+(a-i<<1));l.set(o),o=l}var u=e.charCodeAt(i);u<128||t?c(u):u<2048?(c(192|u>>6),c(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|e.charCodeAt(++i)&1023,c(240|u>>18),c(128|u>>12&63),c(128|u>>6&63),c(128|u&63)):(c(224|u>>12),c(128|u>>6&63),c(128|u&63))}return D(o,0,s)}function ve(e,t){if(t){for(var n=``,r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(he)return he.decode(e);var i=ge(e),a=i.s,n=i.r;return n.length&&k(8),a}var ye=function(e,t){return t+30+X(e,t+26)+X(e,t+28)},be=function(e,t,n){var r=X(e,t+28),i=X(e,t+30),a=ve(e.subarray(t+46,t+46+r),!(X(e,t+8)&2048)),o=t+46+r,s=xe(e,o,i,n,Z(e,t+20),Z(e,t+24),Z(e,t+42)),c=s[0],l=s[1],u=s[2];return[X(e,t+10),c,l,a,o+i+X(e,t+32),u]},xe=function(e,t,n,r,i,a,o){var s=i==4294967295,c=a==4294967295,l=o==4294967295,u=t+n,d=s+c+l;if(r&&d){for(;t+4<u;t+=4+X(e,t+2))if(X(e,t)==1)return[s?ce(e,t+4+8*c):i,c?ce(e,t+4):a,l?ce(e,t+4+8*(c+s)):o,1];r<2&&k(13)}return[i,a,o,0]},Se=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&k(9),t+=r+4}return t},Ce=function(e,t,n,r,i,a,o,s){var c=r.length,l=n.extra,u=s&&s.length,d=Se(l);Q(e,t,o==null?67324752:33639248),t+=4,o!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(a<0&&8),e[t++]=i&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;var f=new Date(n.mtime==null?Date.now():n.mtime),p=f.getFullYear()-1980;if((p<0||p>119)&&k(10),Q(e,t,p<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>1),t+=4,a!=-1&&(Q(e,t,n.crc),Q(e,t+4,a<0?-a-2:a),Q(e,t+8,n.size)),Q(e,t+12,c),Q(e,t+14,d),t+=16,o!=null&&(Q(e,t,u),Q(e,t+6,n.attrs),Q(e,t+10,o),t+=14),e.set(r,t),t+=c,d)for(var m in l){var h=l[m],g=h.length;Q(e,t,+m),Q(e,t+2,g),e.set(h,t+4),t+=4+g}return u&&(e.set(s,t),t+=u),t},we=function(e,t,n,r,i){Q(e,t,101010256),Q(e,t+8,n),Q(e,t+10,n),Q(e,t+12,r),Q(e,t+16,i)};function Te(e,t,n){n||(n=t,t={}),typeof n!=`function`&&k(7);var i={};pe(e,``,i,t);var a=Object.keys(i),o=a.length,s=0,c=0,l=o,u=Array(o),d=[],f=function(){for(var e=0;e<d.length;++e)d[e]()},p=function(e,t){Ee(function(){n(e,t)})};Ee(function(){p=n});var m=function(){var e=new r(c+22),t=s,n=c-s;c=0;for(var i=0;i<l;++i){var a=u[i];try{var o=a.c.length;Ce(e,c,a,a.f,a.u,o);var d=30+a.f.length+Se(a.extra),f=c+d;e.set(a.c,f),Ce(e,s,a,a.f,a.u,o,c,a.m),s+=16+d+(a.m?a.m.length:0),c=f+o}catch(e){return p(e,null)}}we(e,s,u.length,n,t),p(null,e)};o||m();for(var h=function(e){var t=a[e],n=i[t],r=n[0],l=n[1],h=B(),g=r.length;h.p(r);var _=_e(t),v=_.length,y=l.comment,b=y&&_e(y),x=b&&b.length,S=Se(l.extra),C=l.level==0?0:8,w=function(n,r){if(n)f(),p(n,null);else{var i=r.length;u[e]=H(l,{size:g,crc:h.d(),c:r,f:_,m:b,u:v!=t.length||b&&y.length!=x,compression:C}),s+=30+v+S+i,c+=76+2*(v+S)+(x||0)+i,--o||m()}};if(v>65535&&w(k(11,0,1),null),!C)w(null,r);else if(g<16e4)try{w(null,ue(r,l))}catch(e){w(e,null)}else d.push(le(r,l,w))},g=0;g<l;++g)h(g);return f}var Ee=typeof queueMicrotask==`function`?queueMicrotask:typeof setTimeout==`function`?setTimeout:function(e){e()};function De(e,t,n){n||(n=t,t={}),typeof n!=`function`&&k(7);var i=[],a=function(){for(var e=0;e<i.length;++e)i[e]()},o={},s=function(e,t){Ee(function(){n(e,t)})};Ee(function(){s=n});for(var c=e.length-22;Z(e,c)!=101010256;--c)if(!c||e.length-c>65558)return s(k(13,0,1),null),a;var l=X(e,c+8);if(l){var u=l,d=Z(e,c+16),f=Z(e,c-20)==117853008;if(f){var p=Z(e,c-12);f=Z(e,p)==101075792,f&&(u=l=Z(e,p+32),d=Z(e,p+48))}for(var m=t&&t.filter,h=function(t){var n=be(e,d,f),c=n[0],u=n[1],p=n[2],h=n[3],g=n[4],_=n[5],v=ye(e,_);d=g;var y=function(e,t){e?(a(),s(e,null)):(t&&(o[h]=t),--l||s(null,o))};if(!m||m({name:h,size:u,originalSize:p,compression:c})){if(!c)y(null,D(e,v,v+u));else if(c==8){var b=e.subarray(v,v+u);if(p<524288||u>.8*p)try{y(null,fe(b,{out:new r(p)}))}catch(e){y(e,null)}else i.push(de(b,{size:p},y))}else y(k(14,`unknown compression type `+c,1),null)}else y(null,null)},g=0;g<u;++g)h(g)}else s(null,{});return a}var Oe=[`read`,`write`,`auto`,`full`],ke={stoppable:!0,progress:!0},Ae={stoppable:!1,progress:!1},je=`final_remark`,Me={codex_cli:{platform:`Codex`,label:`Codex CLI`,kind:`cli`,location:`executable`,fields:[`project_id`,`project_name`],efforts:[`low`,`medium`,`high`,`xhigh`,`max`,`ultra`],models:!0,access_levels:Oe,per_tool_allow:!1,access_hints:{read:`只读沙箱`,write:`项目可写的沙箱,命令在沙箱内运行、可联网`,auto:`沙箱外的操作由模型申请提权,Codex 自动审核代替人工批准`,full:`无沙箱、无审批(--dangerously-bypass-approvals-and-sandbox)`},client:`codex`,adopt:`session`,host_existing:!0,session_family:`codex`,browse_sessions:!0,lockdown_hint:`沙箱只读档仍可读整个磁盘、运行任意只读命令,无法只放行 codiscuss 命令`,capabilities:{delivery:ke,rewind:`cut`,project:!0,access_env:!0,enforces_read_only:!0,limits_directories:!0,ripgrep:!0,chat:!0,resume:!0,images:!0,capture:je,tool_lockdown:!1,close_grace_ms:1500}},codex:{platform:`Codex`,label:`Codex App`,kind:`app`,location:`executable`,fields:[`source_thread_id`,`project_id`,`project_name`],efforts:null,models:!1,access_levels:null,per_tool_allow:!1,client:`codex`,adopt:`session`,host_existing:!0,session_family:`codex`,browse_sessions:!0,lockdown_hint:`权限由 App 决定,接入程序无法逐次收窄`,capabilities:{delivery:Ae,rewind:`cut`,project:!0,chat:!0,capture:!1,tool_lockdown:!1}},claude:{platform:`Claude`,label:`Claude Code`,kind:`cli`,location:`executable`,fields:[`allowed_tools`],efforts:[`low`,`medium`,`high`,`xhigh`,`max`],models:!0,access_levels:Oe,per_tool_allow:!0,access_hints:{read:`只放行网站命令与草稿,不改项目文件、不跑其他命令`,write:`可改项目文件,Bash / PowerShell 命令全部放行(无沙箱)`,auto:`Claude auto 模式:由分类器判断,实测项目外写入和联网都会放行`,full:`bypassPermissions:跳过全部权限检查`},client:`claude`,adopt:`own_cwd`,host_existing:!0,restore_manual:!0,browse_sessions:!0,resume_command:e=>`claude --resume ${e}`,windows_command:`codiscuss`,capabilities:{delivery:ke,rewind:`cut`,project:!0,access_env:!0,chat:!0,resume:!0,images:!0,capture:je,tool_lockdown:!0}},antigravity_cli:{platform:`Antigravity`,label:`Antigravity CLI`,kind:`cli`,location:`executable`,fields:[`project_id`,`project_name`],efforts:[`low`,`medium`,`high`,`xhigh`,`max`],efforts_per_model:!0,models:!0,defaults_by_query:!0,access_levels:[`read`,`write`,`full`],per_tool_allow:!0,access_hints:{read:`只放行网站命令;碰到未放行的命令会直接结束本轮`,write:`可写项目,命令全部放行(在 agy 沙箱内)`,full:`跳过全部权限确认(--dangerously-skip-permissions),并放开沙箱外命令与 MCP 工具`},unsupported_hints:{auto:`agy 只在交互窗口提供自动模式,后台运行(-p)不支持`},client:`antigravity`,adopt:`session`,host_existing:!1,own_project_when_bound:!0,browse_sessions:!0,lockdown_hint:`文件读取、网页读取与搜索工具是否全部受权限规则约束尚未核实,无法保证只放行 codiscuss 命令`,capabilities:{delivery:ke,rewind:`cut`,project:!0,access_env:!0,chat:!0,capture:je,tool_lockdown:!1},task_rules:(e,{runs_commands:t})=>(t?``:`无人值守下 run_command 只能运行 ${e} 的 subcommands 子命令,其他命令会被自动拒绝并使会话直接结束;列目录、搜索或读取文件用你环境自带的文件工具,不要经 run_command。`)+`多步任务中,在关键转折处用一句话写出进展再继续:agy 不输出思考过程,网页只能靠这些话显示你做到哪一步。`},antigravity:{platform:`Antigravity`,label:`Antigravity App`,kind:`app`,location:`ipc_directory`,fields:[`project_id`,`project_name`],efforts:null,models:!1,access_levels:null,per_tool_allow:!1,client:`antigravity`,adopt:`session`,host_existing:!0,lockdown_hint:`权限由 App 决定,接入程序无法逐次收窄`,capabilities:{delivery:Ae,rewind:`kept`,project:!0,chat:!0,capture:!1,tool_lockdown:!1}},api:{platform:``,label:`模型 API`,kind:`api`,location:``,fields:[`base_url`,`api_protocol`,`api_key_ref`,`image_input`],efforts:[`low`,`medium`,`high`],models:!1,access_levels:[`read`,`write`],per_tool_allow:!1,adopt:``,host_existing:!1,access_hints:{read:`用接入程序的文件工具读取、搜索项目文件,可运行工作流登记的只读命令`,write:`用 Pi 自带的读写、编辑与命令行在项目里工作,和本地 CLI 可写一致;Pi 没有审批,可写即可直接运行命令`},unsupported_hints:{auto:`Pi 没有需要软件审批的操作,可写即可直接运行命令`,full:`Pi 没有需要软件审批的操作,可写即可直接运行命令`},capabilities:{delivery:ke,rewind:`cut`,project:!0,file_tools:!0,limits_directories:!0,chat:!0,images:`configured`,capture:!1,tool_lockdown:!0}}};Object.keys(Me);function Ne(e){let t=Me[e];return t?{id:e,session_family:e,windows_command:`codiscuss.cmd`,...t}:null}var Pe=6e4,Fe=80,Ie=`AI CoDiscuss 聊天室备份
2
2
 
3
3
  完整数据.json:指定聊天室在导出时的数据库快照,保留全部原始字段、编号和关联。
4
4
  讨论记录.md:便于离线阅读的资料、消息原文与发言安排,正文以文本块原样保留。