ai_co_discuss 0.5.9 → 0.5.10

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 (26) hide show
  1. package/docs/en/guide/workflows.md +1 -1
  2. package/docs/guide/workflows.md +1 -1
  3. package/frontend/locales/en/backend.json +2 -1
  4. package/frontend/locales/en/settings.json +8 -1
  5. package/package.json +1 -1
  6. package/runner/adapters/profiles.mjs +3 -1
  7. package/runner/discussion_launch.mjs +44 -4
  8. package/web/app.js +5 -1
  9. package/web/backup.js +1 -1
  10. package/web/i18n.js +1 -1
  11. package/web/modern.css +1 -1
  12. package/web/modern.js +43 -43
  13. package/workflows/story-serial/workflows/jack-sparrow/SKILL.md +2 -2
  14. package/workflows/story-serial/workflows/jack-sparrow/agents/{jack_sparrow.md → jack_sparrow/jack_sparrow.md} +2 -2
  15. package/workflows/story-serial/workflows/luke-nichols/SKILL.md +2 -2
  16. package/workflows/story-serial/workflows/luke-nichols/agents/{luke_nichols.md → luke_nichols/luke_nichols.md} +2 -2
  17. /package/workflows/story-serial/workflows/jack-sparrow/{knowledge → agents}/jack_sparrow/skills/coastal-sailing/SKILL.md +0 -0
  18. /package/workflows/story-serial/workflows/jack-sparrow/{knowledge → agents}/jack_sparrow/skills/coastal-sailing/references/catamaran-and-crew.md +0 -0
  19. /package/workflows/story-serial/workflows/jack-sparrow/{knowledge → agents}/jack_sparrow/skills/coastal-sailing/references/emergency-and-navigation.md +0 -0
  20. /package/workflows/story-serial/workflows/jack-sparrow/{knowledge → agents}/jack_sparrow/skills/coastal-sailing/references/resources-and-systems.md +0 -0
  21. /package/workflows/story-serial/workflows/jack-sparrow/{knowledge → agents}/jack_sparrow/skills/coastal-sailing/references/weather-and-anchoring.md +0 -0
  22. /package/workflows/story-serial/workflows/luke-nichols/{knowledge → agents}/luke_nichols/skills/cold-survival/SKILL.md +0 -0
  23. /package/workflows/story-serial/workflows/luke-nichols/{knowledge → agents}/luke_nichols/skills/cold-survival/references/fire-and-fuel.md +0 -0
  24. /package/workflows/story-serial/workflows/luke-nichols/{knowledge → agents}/luke_nichols/skills/cold-survival/references/luke-videos.md +0 -0
  25. /package/workflows/story-serial/workflows/luke-nichols/{knowledge → agents}/luke_nichols/skills/cold-survival/references/shelter-and-warmth.md +0 -0
  26. /package/workflows/story-serial/workflows/luke-nichols/{knowledge → agents}/luke_nichols/skills/cold-survival/references/travel-and-ice.md +0 -0
@@ -44,7 +44,7 @@ Select a workflow on the Workflows page. The canvas opens in the center, and its
44
44
  - **The host follows SKILL.md:** The skill file defines order, parallel work, when to return to the host, and when to revise. The host follows those written instructions. When workflow-creator creates or edits a workflow, it updates the canvas to reflect the skill file.
45
45
  - **Steps and attached sub-workflows:** The canvas can group nodes into steps, shown as named dashed frames that list the sub-workflows attached to each step. Steps and attachments live in flow.json and in each sub-workflow's SKILL.md (workflow-creator maintains them). Like the canvas they are only a diagram; the host still decides from SKILL.md whether to use a sub-workflow at that step.
46
46
  - **Several members for one card:** The host can bring in several members for the same card under different display names, for example one member per character. A display name applies to this room only, and asking for the same name again brings back the same member with its own session.
47
- - **Experts with skills:** A workflow expert can be a folder instead of a file: agents/<card-id>/ holds its definition <card-id>.md (the same format as a card file) and skills/<skill>/, each skill a SKILL.md plus references/. The member playing that card may read and write its own skills while the rest of the workflow stays read-only; its writing does not change the workflow’s revision, and ordinary saves from the page or the command line keep the skills as they are; only an explicit overwrite or an import replaces them with the folder’s. Exporting the expert gives exactly that folder. In “Experts”, every expert with skills, in the main flow or a sub-workflow, is listed under Advisors, marked with where it sits; its “Skills” section below the definition shows each skill’s SKILL.md and references to view and edit, and lets you create or delete skills and reference files. These edits are written to the expert’s folder at once, without saving the workflow or changing its revision; a file the expert changed meanwhile is refused with a reload offered, never overwritten. “Add skill” on another expert writes its first skill’s name and description; after you save the workflow it becomes a folder with skills. “Import expert package” below the list puts an md, zip or folder into the main flow or the sub-workflow open on the canvas. Removing an expert with skills, replacing its skills by an overwrite, or deleting the workflow first backs its folder up into backups in the service folder. codiscuss launch expert-import --from <path> --workflow <id> [--sub <sub-workflow-id>] puts an expert package into a workflow and refuses a card ID that exists. A panel expert has skills of its own in experts/<id>/skills/ in the service folder, never shared with a workflow’s; “Save as preset” in “Experts” copies them there; skills already on this computer are kept, and the notice offers to replace them with the workflow’s. On the new-room panel, a card added from a preset has a “Skills” button on its back for its own skills in the service folder. If a preset of that name exists, choose “Replace the preset of this name” to replace it; skills already there are kept. In the page, “Import / export experts” under “添加 AI” on the new-room panel imports an .md, a zip or a folder and exports any preset; “Export” in a workflow’s “Experts” exports the current card as saved. Without skills you get one md, otherwise a zip. On import, a preset of the same name asks you to “Replace” or cancel; skills already on this computer are kept unless you choose “Use the imported one (the current one is backed up)”; ignored files and access lowered to read-only are listed. On the command line, codiscuss launch expert-export exports an expert and codiscuss launch expert-import imports one as a preset; an existing preset or skills are never replaced silently.
47
+ - **Experts with skills:** A workflow expert can be a folder instead of a file: agents/<card-id>/ holds its definition <card-id>.md (the same format as a card file) and skills/<skill>/, each skill a SKILL.md plus references/. The member playing that card may read and write its own skills while the rest of the workflow stays read-only; its writing does not change the workflow’s revision, and ordinary saves from the page or the command line keep the skills as they are; only an explicit overwrite or an import replaces them with the folder’s. Exporting the expert gives exactly that folder. In “Experts”, every expert with skills, in the main flow or a sub-workflow, is listed under Advisors, marked with where it sits; its “Skills” section below the definition shows each skill’s SKILL.md and references to view and edit, and lets you create or delete skills and reference files. These edits are written to the expert’s folder at once, without saving the workflow or changing its revision; a file the expert changed meanwhile is refused with a reload offered, never overwritten. “Add skill” on another expert writes its first skill’s name and description; after you save the workflow it becomes a folder with skills. “Import expert package” below the list puts an md, zip or folder into the main flow or the sub-workflow open on the canvas. Removing an expert with skills, replacing its skills by an overwrite, or deleting the workflow first backs its folder up into backups in the service folder. codiscuss launch expert-import --from <path> --workflow <id> [--sub <sub-workflow-id>] puts an expert package into a workflow and refuses a card ID that exists. A panel expert has skills of its own in experts/<id>/skills/ in the service folder, never shared with a workflow’s; “Save as preset” in “Experts” copies them there; skills already on this computer are kept, and the notice offers to replace them with the workflow’s. On the new-room panel, a card added from a preset has a “Skills” button on its back for its own skills in the service folder. If a preset of that name exists, choose “Replace the preset of this name” to replace it; skills already there are kept. In the page, “Import / export experts” under “添加 AI” on the new-room panel imports an .md, a zip or a folder and exports any preset; “Export” in a workflow’s “Experts” exports the current card as saved. Without skills you get one md, otherwise a zip. On import, a preset of the same name asks you to “Replace” or cancel; skills already on this computer are kept unless you choose “Use the imported one (the current one is backed up)”; ignored files and access lowered to read-only are listed. On the command line, codiscuss launch expert-export exports an expert and codiscuss launch expert-import imports one as a preset; an existing preset or skills are never replaced silently. When an expert names software this computer has not set up, or a model missing from this computer’s list for that software, the import still succeeds and its notice says so; the panel button is then greyed (software) or the card is marked “… is not available here and cannot run” (model), and starting a room or inviting it is refused until the software is set up or the model changed to a listed one (empty means the software default). Only a model list already read here counts: no list yet, a failed read or no model at all is never flagged, and Claude’s list, being only its model picker, never blocks.
48
48
 
49
49
  ### 5. “Full host control” and workflows
50
50
 
@@ -44,7 +44,7 @@
44
44
  - **主持人按 `SKILL.md` 派活**:谁先谁后、哪些成员并行、什么时候交回主持人把关、什么条件返工,都由 `SKILL.md` 写明并由主持人照做。用 `workflow-creator` 生成或修改工作流时,AI 会按 `SKILL.md` 同步更新画布。
45
45
  - **步骤分组与挂靠**:画布可以把节点分成几个步骤,显示为带名字的虚线框,框上标出挂在这一步的子工作流。步骤和挂靠写在 `flow.json` 与子工作流的 `SKILL.md` 里(由 `workflow-creator` 维护),和画布一样只是示意,主持人仍按 `SKILL.md` 判断这一步用不用。
46
46
  - **一张卡片请多位成员**:同一张卡片可以由主持人按不同显示名请进多位成员,例如每位人物一位成员;显示名只在本房间有效,同一个名字请回的是原来那位成员和它的会话。
47
- - **带技能的专家**:工作流里的专家可以是一个文件夹而不是一个文件:`agents/<卡片ID>/` 里放定义 `<卡片ID>.md`(和普通卡片文件同一格式)和 `skills/<技能名>/`,每条技能一份 `SKILL.md` 加 `references/`。担任这张卡片的成员可以读写自己的 skills,工作流的其他部分照旧只读;他写技能不改变工作流的修订号,网页和命令行的普通保存都原样保留这些技能,只有整份覆盖和导入会用文件夹里带的替换。导出这位专家得到的就是这个文件夹。在“专家配置”里,带技能的专家不论在主线还是子工作流,都归在“顾问”一组,条目上标着他属于哪里;选中后在定义下面的“技能”里可以查看和修改每条技能的 SKILL.md 和资料,新建、删除技能和资料文件。这些修改直接写进专家的文件夹,不用保存工作流,也不改工作流的修订号;专家同时改过的文件会拒绝保存并提示重新载入,不会被覆盖。普通专家上点“添加技能”写下第一条技能的名字和描述,保存工作流后它就变成带技能的文件夹。列表下方的“导入专家包”把一个 md、压缩包或文件夹放进主线或画布当前所在的子工作流。删掉一位带技能的专家、整份覆盖替换了技能、删除整个工作流时,原来的文件夹会先备份到服务目录的 backups 下。命令行 `codiscuss launch expert-import --from <路径> --workflow <ID> [--sub <子工作流ID>]` 把专家包放进工作流,卡片 ID 已存在时拒绝。面板上的专家各有一份技能,在本机服务目录 `experts/<ID>/skills/`,和工作流里的不共用;在“专家配置”里把卡片“存为面板预设”时会复制过去,同名预设已存在时要点“覆盖同名预设”才会替换;本机已有这位专家的技能时默认保留,提示后可点“用工作流里的技能替换本机的”。新建房间面板上,来自预设的专家卡片背面有“技能”按钮,查看和修改的是本机服务目录里的那份。网页上,新建房间面板“添加 AI”下方的“导入导出专家”可以导入 .md、压缩包或文件夹,也可以导出任一预设;工作流“专家配置”里的“导出”导出当前卡片(已保存的版本)。没有技能下载一个 md,有技能下载一个压缩包。导入时同名预设会让你选“覆盖”或“取消”;本机已有这位专家的技能时默认保留本机的,可选“用导入的替换(原来的会备份)”;被忽略的文件和被降为只读的权限会在提示里列出。命令行同样可以:`codiscuss launch expert-export` 导出,`codiscuss launch expert-import` 导入成面板预设;同名预设和已有的技能都不会被静默替换。
47
+ - **带技能的专家**:工作流里的专家可以是一个文件夹而不是一个文件:`agents/<卡片ID>/` 里放定义 `<卡片ID>.md`(和普通卡片文件同一格式)和 `skills/<技能名>/`,每条技能一份 `SKILL.md` 加 `references/`。担任这张卡片的成员可以读写自己的 skills,工作流的其他部分照旧只读;他写技能不改变工作流的修订号,网页和命令行的普通保存都原样保留这些技能,只有整份覆盖和导入会用文件夹里带的替换。导出这位专家得到的就是这个文件夹。在“专家配置”里,带技能的专家不论在主线还是子工作流,都归在“顾问”一组,条目上标着他属于哪里;选中后在定义下面的“技能”里可以查看和修改每条技能的 SKILL.md 和资料,新建、删除技能和资料文件。这些修改直接写进专家的文件夹,不用保存工作流,也不改工作流的修订号;专家同时改过的文件会拒绝保存并提示重新载入,不会被覆盖。普通专家上点“添加技能”写下第一条技能的名字和描述,保存工作流后它就变成带技能的文件夹。列表下方的“导入专家包”把一个 md、压缩包或文件夹放进主线或画布当前所在的子工作流。删掉一位带技能的专家、整份覆盖替换了技能、删除整个工作流时,原来的文件夹会先备份到服务目录的 backups 下。命令行 `codiscuss launch expert-import --from <路径> --workflow <ID> [--sub <子工作流ID>]` 把专家包放进工作流,卡片 ID 已存在时拒绝。面板上的专家各有一份技能,在本机服务目录 `experts/<ID>/skills/`,和工作流里的不共用;在“专家配置”里把卡片“存为面板预设”时会复制过去,同名预设已存在时要点“覆盖同名预设”才会替换;本机已有这位专家的技能时默认保留,提示后可点“用工作流里的技能替换本机的”。新建房间面板上,来自预设的专家卡片背面有“技能”按钮,查看和修改的是本机服务目录里的那份。网页上,新建房间面板“添加 AI”下方的“导入导出专家”可以导入 .md、压缩包或文件夹,也可以导出任一预设;工作流“专家配置”里的“导出”导出当前卡片(已保存的版本)。没有技能下载一个 md,有技能下载一个压缩包。导入时同名预设会让你选“覆盖”或“取消”;本机已有这位专家的技能时默认保留本机的,可选“用导入的替换(原来的会备份)”;被忽略的文件和被降为只读的权限会在提示里列出。命令行同样可以:`codiscuss launch expert-export` 导出,`codiscuss launch expert-import` 导入成面板预设;同名预设和已有的技能都不会被静默替换。专家带着的软件本机没有配置,或者本机这个软件的模型列表里没有他写的模型时,导入照样成功,提示里会说明;这时面板上的按钮变灰(软件)或卡片上标出“本机没有……,不能调用”(模型),建房和请进都会被拒,配好软件、或把模型改成列表里的(留空即用软件默认)之后恢复。是否“没有”只看本机已经读到的模型列表:还没读过列表、读取失败或没写模型都不算;Claude 的列表只是它的模型选单,不据此拦。
48
48
 
49
49
  ### 5. “主持人完整权限”与工作流的关系
50
50
 
@@ -850,5 +850,6 @@
850
850
  "这个房间发布过分享链接,请先撤销分享链接再销毁": "This room has a published share link; revoke it before destroying the room",
851
851
  "技能文件 {path} 在你读取之后变了(专家可能刚写过),请重新载入后再改": "The skill file {path} changed after you read it (the expert may have just written it); reload before changing it",
852
852
  "工作流「{id}」里已有卡片 {card};不会替换它,要换请先删掉原卡片": "The workflow “{id}” already has the card {card}; it is not replaced: delete that card first to change it",
853
- "导入的内容须正好有一个专家定义 .md,现有 {count} 个": "The import must hold exactly one expert definition .md; it has {count}"
853
+ "导入的内容须正好有一个专家定义 .md,现有 {count} 个": "The import must hold exactly one expert definition .md; it has {count}",
854
+ "{name} 的模型 {model} 不在本机这个软件的模型列表里,不能调用:请在专家配置或卡片背面把模型改成列表里的(或留空用软件默认),或在模型下拉旁刷新列表后再试": "The model {model} of {name} is not in this computer’s list for its software, so it cannot run: pick a listed model (or leave it empty for the software default) in Experts or on the card’s back, or refresh the list beside the model menu and try again"
854
855
  }
@@ -810,5 +810,12 @@
810
810
  "用工作流里的技能替换本机的(原来的会备份)": "Replace this computer’s skills with the workflow’s (the current ones are backed up)",
811
811
  "导出这位专家:没有技能是一个 md,有技能是一个压缩包(取工作流里的技能)": "Export this expert: one md without skills, otherwise a zip (with the workflow’s skills)",
812
812
  "添加技能": "Add skill",
813
- "给这位专家一组自己读写的技能;保存工作流后它变成带技能的文件夹,归到“顾问”": "Give this expert skills it reads and writes itself; after saving the workflow it becomes a folder with skills, listed under Advisors"
813
+ "给这位专家一组自己读写的技能;保存工作流后它变成带技能的文件夹,归到“顾问”": "Give this expert skills it reads and writes itself; after saving the workflow it becomes a folder with skills, listed under Advisors",
814
+ "本机未配置它的软件,点它的按钮去配置后才能加入": "Its software is not set up on this computer; click its button to set it up before adding it",
815
+ "本机这个软件没有模型 {value1},加入后在卡片背面改成列表里的模型并“更新预设”": "This computer’s software has no model {value1}; after adding it, pick a listed model on the card’s back and “Update preset”",
816
+ "本机没有 {value1},不能调用;在背面改模型": "{value1} is not available here and cannot run; change the model on the back",
817
+ "本机未配置它的软件,配置好或在这里换成本机已配置的软件之前不能调用": "Its software is not set up on this computer; it cannot run until you set it up or switch it here to software that is",
818
+ "本机这个软件没有模型 {value1},改成列表里的模型之前不能调用": "This computer’s software has no model {value1}; it cannot run until you pick a listed model",
819
+ "本机没有模型 {value1}": "Model {value1} is not available here",
820
+ "本机的 {value1} 没有模型 {value2},不能调用:在下面“模型”里改成列表里的(或用软件默认),改完保存": "{value1} on this computer has no model {value2}, so it cannot run: pick a listed model (or the software default) under “Model” below, then save"
814
821
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai_co_discuss",
3
- "version": "0.5.9",
3
+ "version": "0.5.10",
4
4
  "bin": {
5
5
  "codiscuss": "runner/codiscuss.mjs"
6
6
  },
@@ -110,7 +110,9 @@ export const ADAPTER_PROFILES = {
110
110
  },
111
111
  claude: {
112
112
  platform: 'Claude', label: 'Claude Code', kind: 'cli', location: 'executable', fields: ['allowed_tools'],
113
- efforts: ['low', 'medium', 'high', 'xhigh', 'max'], models: true, access_levels: ALL_ACCESS, per_tool_allow: true,
113
+ // `models_open`: the listed models are its picker's aliases and the CLI also takes full model IDs, so a model missing
114
+ // from the list is not known to be unavailable.
115
+ efforts: ['low', 'medium', 'high', 'xhigh', 'max'], models: true, models_open: true, access_levels: ALL_ACCESS, per_tool_allow: true,
114
116
  access_hints: { read: '只放行网站命令与草稿,不改项目文件、不跑其他命令', write: '可改项目文件,Bash / PowerShell 命令全部放行(无沙箱)',
115
117
  auto: 'Claude auto 模式:由分类器判断,实测项目外写入和联网都会放行', full: 'bypassPermissions:跳过全部权限检查' },
116
118
  client: 'claude', adopt: 'own_cwd', host_existing: true, restore_manual: true, browse_sessions: true, copy_bound: true,
@@ -373,6 +373,43 @@ export async function cached_software_models(home, profile, { refresh = false, q
373
373
  return { ...result, defaults, ...(effort ? { efforts: effort.levels, ...(effort.error ? { effort_error: effort.error } : {}) } : {}) };
374
374
  }
375
375
 
376
+ /**
377
+ * The model a card or preset names that this computer's software is known not to offer, or '' (user 2026-11-22: an
378
+ * expert whose model cannot run here shows as unusable and cannot be invited until the model is changed). Known only
379
+ * from the last good model list kept for the software as installed now (same key as cached_software_models, any age);
380
+ * no list yet, an API member, a software that takes models beyond its list (`models_open`) or no model at all (the
381
+ * software's default) is never flagged. The model is compared by its exact ID, as the page's model list does.
382
+ */
383
+ export function unknown_model(home, profile) {
384
+ if (!profile?.model) return '';
385
+ const facts = adapter_profile(profile.adapter);
386
+ if (!facts?.models || facts.kind === 'api' || facts.models_open) return '';
387
+ let cache = {};
388
+ try { cache = JSON.parse(readFileSync(join(home, 'model-catalogs.json'), 'utf8')); } catch { return ''; }
389
+ const models = cache[JSON.stringify([profile.adapter, profile.executable || '', executable_stamp(profile)])]?.result?.models;
390
+ if (!Array.isArray(models) || !models.length) return '';
391
+ return models.some(model => model.id === profile.model) ? '' : profile.model;
392
+ }
393
+
394
+ /** Refuse to start a member whose model this computer's software is known not to offer (see unknown_model). */
395
+ function assert_model_available(home, name, profile) {
396
+ const model = unknown_model(home, profile);
397
+ if (!model) return;
398
+ throw expert_failure('model_unavailable', '{name} 的模型 {model} 不在本机这个软件的模型列表里,不能调用:请在专家配置或卡片背面把模型改成列表里的(或留空用软件默认),或在模型下拉旁刷新列表后再试',
399
+ { name, model });
400
+ }
401
+
402
+ /**
403
+ * Whether an expert a package brings can run here, for the import's notice: `needs_platform` when its software is not
404
+ * set up, `unknown_model` when that software's list lacks its model. The import goes ahead either way.
405
+ */
406
+ function expert_readiness(home, preset) {
407
+ if (!card_platform_ready(home, preset.name)) return { needs_platform: true };
408
+ const saved = launch_settings(home).participants[platform_of(preset.name)];
409
+ const model = saved ? unknown_model(home, { ...saved, model: preset.model || '' }) : '';
410
+ return model ? { unknown_model: model } : {};
411
+ }
412
+
376
413
  /** Read private defaults without selecting a global room or identity. */
377
414
  export function launch_settings(home) {
378
415
  const path = join(home, 'launch-settings.json');
@@ -1011,6 +1048,7 @@ function launch_config(home, input, room, directory, options) {
1011
1048
  for (const name of new Set([room.host, ...Object.keys(room.experts)])) {
1012
1049
  if (!manual.has(name)) participants[name] = participant_profile(name, defaults, input, name === room.host);
1013
1050
  }
1051
+ for (const [name, profile] of Object.entries(participants)) assert_model_available(home, name, profile);
1014
1052
  const members = launch_members(input, Object.keys(participants), options);
1015
1053
  return validate_config({ site: input.site, room: room.id || 'preview', token: options.token, mode: 'free', participants, members, api_home: home,
1016
1054
  scheduler: input.scheduler || undefined,
@@ -1026,6 +1064,7 @@ function free_launch_config(home, input, room, directory, options) {
1026
1064
  const defaults = options.defaults || launch_settings(home).participants;
1027
1065
  const names = room.members.filter(woken_member).map(member => typeof member === 'string' ? member : member.name);
1028
1066
  const participants = Object.fromEntries(names.map(name => [name, participant_profile(name, defaults, input, false)]));
1067
+ for (const [name, profile] of Object.entries(participants)) assert_model_available(home, name, profile);
1029
1068
  const members = launch_members(input, names, options);
1030
1069
  // A workflow chosen at creation is written with the members, so the first wake already carries it.
1031
1070
  const workflow = input.workflow ? bind_room_workflow({}, { ...input.workflow, enabled: true }).workflow : undefined;
@@ -1069,7 +1108,7 @@ export function participant_profile(name, defaults, input, current_host) {
1069
1108
  const profile = { ...saved, ...inherited, ...input.participants?.[name] };
1070
1109
  for (const field of ['cwd', 'model', 'effort', 'project_name', 'project_id', 'project_access']) if (profile[field] === '') delete profile[field];
1071
1110
  validate_profile(name, profile, true);
1072
- if (!clients_of(name)?.includes(profile.adapter)) throw new Error(`请配置 ${name} 的 CLI / App 客户端`);
1111
+ if (!clients_of(name)?.includes(profile.adapter)) throw new Error(`请配置 ${name} 的 CLI / App 客户端,或在专家配置里把这位专家换成本机已配置的软件`);
1073
1112
  const facts = adapter_profile(profile.adapter);
1074
1113
  if (facts?.kind === 'api') {
1075
1114
  if (input.entry === 'conversation' && current_host) throw new Error('API 主持人请从网页启动;当前软件会话主持须选择对应 CLI / App');
@@ -1204,6 +1243,7 @@ export async function room_member(home, raw, locked = false, headers = {}) {
1204
1243
  if (!manual) {
1205
1244
  if (action === 'add') {
1206
1245
  profile = participant_profile(name, launch_settings(home).participants, { ...input, cwd: input.cwd || config.cwd }, false);
1246
+ assert_model_available(home, name, profile);
1207
1247
  if (profile.session_id) profile = borrowed_session(name, profile, input.cwd || config.cwd);
1208
1248
  }
1209
1249
  if (!profile) throw new Error(`${name} 没有本机接入配置;请移除后重新邀请`);
@@ -2218,8 +2258,8 @@ export function import_expert(home, { files = {}, ignored: unread = [], overwrit
2218
2258
  const presets = taken ? current.presets.map(item => item.name === preset.name ? preset : item) : [...current.presets, preset];
2219
2259
  save_expert_presets(home, { presets });
2220
2260
  const { knowledge, backup } = install_knowledge(home, key, skills, replace_knowledge === true);
2221
- return { preset, ...(requested ? { requested_access: requested } : {}), knowledge, skills: Object.keys(skills).sort(), ...(backup ? { backup } : {}),
2222
- ignored: [...new Set(ignored)].sort() };
2261
+ return { preset, ...(requested ? { requested_access: requested } : {}), ...expert_readiness(home, preset), knowledge, skills: Object.keys(skills).sort(),
2262
+ ...(backup ? { backup } : {}), ignored: [...new Set(ignored)].sort() };
2223
2263
  }
2224
2264
 
2225
2265
  /**
@@ -2308,7 +2348,7 @@ export function import_expert_to_workflow(home, { files = {}, ignored: unread =
2308
2348
  } else agents = [...agents, card];
2309
2349
  const saved = save_workflow(home, { ...workflow, agents, sub_workflows: subs }, validate_preset, { base_revision: workflow.revision });
2310
2350
  return { workflow: saved.id, ...(sub ? { sub } : {}), card: key, revision: saved.revision, ...(requested ? { requested_access: requested } : {}),
2311
- skills: Object.keys(skills).sort(), ignored: [...new Set(ignored)].sort() };
2351
+ ...expert_readiness(home, preset), skills: Object.keys(skills).sort(), ignored: [...new Set(ignored)].sort() };
2312
2352
  }
2313
2353
 
2314
2354
  /**
package/web/app.js CHANGED
@@ -5097,10 +5097,14 @@ function launch_model_state(name, launch = state.launch, profile = launch.profil
5097
5097
  // The list shows model IDs as they are; a list kept from last time needs no "reading" note while it is refreshed.
5098
5098
  const items = [{ label: defaults.model ? t('软件默认 · {value1}', { value1: defaults.model }) : t('软件默认模型'), value: "__default__" }, ...models.map(model => ({ label: model.id, value: model.id }))];
5099
5099
  if (profile.model && !selected) items.push({ label: profile.model, value: profile.model, disabled: true });
5100
+ // The model is known not to run here only when this software's list was read and lacks it; a software that also takes
5101
+ // models beyond its list (`models_open`, Claude's aliases) is never flagged. The local service refuses such a member.
5102
+ const open = Boolean(window.discuss_backup?.adapter_profile(profile.adapter)?.models_open);
5103
+ const unknown = Boolean(profile.model && !selected && models.length && !catalog?.error && !open);
5100
5104
  const loading = Boolean(catalog?.loading && !models.length);
5101
5105
  // "Software default" offers the levels of the model the software's own settings name, when the list has it.
5102
5106
  const effective = selected || (!profile.model && models.find(model => model.id === defaults.model));
5103
- return { supported: MODEL_CLIENTS.includes(profile.adapter), items, defaults, loading, refreshing: Boolean(catalog?.loading),
5107
+ return { supported: MODEL_CLIENTS.includes(profile.adapter), items, defaults, loading, refreshing: Boolean(catalog?.loading), unknown,
5104
5108
  efforts: effective?.efforts, source: MODEL_SOURCE_LABELS[catalog?.source] || catalog?.source || "",
5105
5109
  effort_note: !effective
5106
5110
  ? t('选择模型后显示可用思考强度;默认值由软件决定。') : t('所选模型不提供单独思考强度。'),
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,copy_bound:!0,lockdown_hint:`沙箱只读档仍可读整个磁盘、运行任意只读命令,无法只放行 codiscuss 命令`,sandbox_needs_desktop:!0,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,copy_bound:!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},task_rules:()=>`多步任务中,转入新的一段工作时(如读完代码开始修改、改完开始验证)先用一句话说明再继续:用户等待时网页卡片只显示这些话,看不到你的思考。用请求者的语言写,即使代码和工具输出是英文;一句即可,不打断手头的工作。`},antigravity_cli:{platform:`Antigravity`,label:`Antigravity CLI`,kind:`cli`,location:`executable`,fields:[`project_id`,`project_name`],efforts:null,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,copy_bound:!0,capabilities:{delivery:ke,rewind:`cut`,project:!0,access_env:!0,chat:!0,capture:je,tool_lockdown:!0},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:`可读取网页,本机保存了 DeepSeek API Key 时可联网搜索(由 DeepSeek 计费);用接入程序的文件工具读取、搜索项目文件,可运行工作流登记的只读命令`,write:`可读取网页,本机保存了 DeepSeek API Key 时可联网搜索(由 DeepSeek 计费);用 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 聊天室备份
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,copy_bound:!0,lockdown_hint:`沙箱只读档仍可读整个磁盘、运行任意只读命令,无法只放行 codiscuss 命令`,sandbox_needs_desktop:!0,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,models_open:!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,copy_bound:!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},task_rules:()=>`多步任务中,转入新的一段工作时(如读完代码开始修改、改完开始验证)先用一句话说明再继续:用户等待时网页卡片只显示这些话,看不到你的思考。用请求者的语言写,即使代码和工具输出是英文;一句即可,不打断手头的工作。`},antigravity_cli:{platform:`Antigravity`,label:`Antigravity CLI`,kind:`cli`,location:`executable`,fields:[`project_id`,`project_name`],efforts:null,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,copy_bound:!0,capabilities:{delivery:ke,rewind:`cut`,project:!0,access_env:!0,chat:!0,capture:je,tool_lockdown:!0},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:`可读取网页,本机保存了 DeepSeek API Key 时可联网搜索(由 DeepSeek 计费);用接入程序的文件工具读取、搜索项目文件,可运行工作流登记的只读命令`,write:`可读取网页,本机保存了 DeepSeek API Key 时可联网搜索(由 DeepSeek 计费);用 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:便于离线阅读的资料、消息原文与发言安排,正文以文本块原样保留。