ai_co_discuss 0.2.13 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/discuss-host/SKILL.md +3 -2
- package/.agents/skills/discuss-participant/SKILL.md +1 -1
- package/README.md +13 -9
- package/backend/free_room.py +64 -0
- package/backend/identity.py +31 -31
- package/backend/runtime.py +364 -364
- package/backend/schema.sql +599 -580
- package/backend/server.py +1782 -1760
- package/docs/architecture.md +8 -4
- package/docs/cli.md +2 -0
- package/docs/runner.md +37 -4
- package/docs/workflow.md +148 -148
- package/package.json +2 -2
- package/runner/api_participant.mjs +186 -0
- package/runner/discuss.py +946 -946
- package/runner/discussion_adapters.mjs +6 -0
- package/runner/discussion_api.mjs +146 -0
- package/runner/discussion_launch.mjs +728 -664
- package/runner/discussion_runner.mjs +36 -7
- package/runner/discussion_service.mjs +395 -394
- package/runner/free_runner.mjs +6 -2
- package/web/app.js +2913 -2859
- package/web/backup.js +1 -1
- package/web/index.html +1 -1
- package/web/markdown.js +1 -1
- package/web/modern.css +1 -1
- package/web/modern.js +7362 -5077
package/runner/free_runner.mjs
CHANGED
|
@@ -149,7 +149,8 @@ export class FreeRoomRunner {
|
|
|
149
149
|
/** A retried client id returns the original execution; a finished or refused one just goes idle. */
|
|
150
150
|
async reserve(member, record) {
|
|
151
151
|
let execution;
|
|
152
|
-
const
|
|
152
|
+
const profile = this.config.participants[member.name];
|
|
153
|
+
const cwd = profile?.adapter === 'api' ? '' : cwd_key(profile?.cwd || this.config.cwd);
|
|
153
154
|
try { execution = await api(this.config, '/executions', { member_id: member.id, client_id: record.client_id, cwd }); }
|
|
154
155
|
catch (error) {
|
|
155
156
|
if (/HTTP (404|409)/.test(error.message)) return this.save(member.name, { status: 'idle', error: '' });
|
|
@@ -164,7 +165,7 @@ export class FreeRoomRunner {
|
|
|
164
165
|
const adapter = this.config.participants[member.name];
|
|
165
166
|
if (!adapter) return this.fail(member.name, execution.id, `未配置 ${member.name} 的本机接入`);
|
|
166
167
|
if (this.context_errors.has(member.name)) return this.fail(member.name, execution.id, this.context_errors.get(member.name));
|
|
167
|
-
const directory = adapter.cwd || this.config.cwd;
|
|
168
|
+
const directory = adapter.adapter === 'api' ? undefined : adapter.cwd || this.config.cwd;
|
|
168
169
|
const before = workspace_snapshot(directory);
|
|
169
170
|
if (before) this.snapshots.set(execution.id, { member: member.name, directory, before });
|
|
170
171
|
const binding = this.store.binding(member.name);
|
|
@@ -174,6 +175,9 @@ export class FreeRoomRunner {
|
|
|
174
175
|
const task = free_task_files(this.config, member, execution, binding);
|
|
175
176
|
invoked = true;
|
|
176
177
|
const result = await this.deliver(adapter, binding, { ...task, room_title: this.room_title,
|
|
178
|
+
api_context: { site: this.config.site, room: this.config.room, token: this.config.members[member.name].token,
|
|
179
|
+
home: this.config.api_home, mode: 'free', role: member.role || 'member', execution_id: execution.id,
|
|
180
|
+
requests: execution.requests, read_after: execution.read_until },
|
|
177
181
|
on_binding: session => this.store.bind(member.name, session),
|
|
178
182
|
on_process: child => this.track(member.name, child),
|
|
179
183
|
on_output: (path, chunk) => appendFileSync(path, chunk, { mode: 0o600 }),
|