@ai-workbench/remote-agent 0.9.0-toolbridge.37 → 0.9.0-toolbridge.38-rc.2

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/README.md CHANGED
@@ -1,12 +1,12 @@
1
- # AI Workbench 远程助手 · @ai-workbench/remote-agent@0.9.0-toolbridge.37 · 插件 → 添加插件
1
+ # AI Workbench 远程助手 · @ai-workbench/remote-agent@0.9.0-toolbridge.38-rc.2 · 插件 → 添加插件
2
2
 
3
- 本版配套总包 0.3.8,固定 N0.4.11 / L0.7.46。零自写提示词、原生技能/子代理及三版 DSH registry 升级门已通过;完整证据与真实模型边界见 TESTS.md。owner 11-16 决定以首调用固定开销为 token 门:同插件清单的 Codex 比直接 CLI 多 517 token(约 3.3%);整题因模型主动技能/依赖/重算步骤及产物不同仍有差异,按原生 DSH 工作流如实披露,不宣称整题 token 持平。历史 P1 原生 DSH 主任务约 34.7 万 token,样本条件不同。
3
+ 本版配套总包 0.3.9,固定 N0.4.11 / L0.7.46,主机仍使用 aw.17 / Codex 0.162.0。修复 0.3.8 回复仅显示文件名或代码路径、无法点击打开的问题。
4
4
 
5
- 本版撤除插件自行拼写的系统规则、位置说明和技能目录说明。模型接收员工输入、原工具描述、CLI 原生上下文,以及员工显式配置的自定义指令原文。DSH 系统规则不转送;同一 DSH 会话切换品牌时仍补带可见对话及角色结构。插件控制诊断留在技术详情,不混入模型回复或下一轮历史。I3 规则重注入、摘要回执与 v2 协商已整体删除。
5
+ 只逐字转送当前生效的 DSH 原生 `ui:deliverable-file-references` Shared guidance;不硬编码或改写原文,不附加插件自写文字,不恢复其他已撤除的 DSH 系统规则。原文作为独立 ACP 文本上下文块,每个新 prompt 发送一次;适用于新会话及既有原生线程接回,不改变员工输入、插话回执或工具桥等待步骤。它在 ACP 中是用户级上下文,不冒称已恢复 system 角色。生效作用域与完整提示词覆盖均按 DSH 原生组装结果处理。
6
6
 
7
- DSH 已公布目录的技能与资源同步到两端同一受控绝对路径,SKILL 正文使用同一作用域的官方 skills.get() 原文,原 frontmatter、资源文件字节与可执行位保留;项目 AGENTS.md/CLAUDE.md 原文镜像后由 CLI 原生读取。Claude 使用原生插件技能入口,Codex 使用原生 skills/extraRoots/set;新轮次与冷恢复均更新原生目录。实际文件和命令仍由员工执行器执行。纯正文虚拟技能保留官方正文;未提供可镜像出口的 URL/opaque 资源明确报既有上下文不可用;主机原有技能中写死的任意主机脚本路径尚未证明可在员工端使用。
7
+ DSH 已提供的 `present` 工具恢复首轮可见:Claude 使用原生 alwaysLoad 元数据,Codex 使用既有 employee 直接工具分组;其余 DSH 扩展工具仍按需发现。工具说明、参数与结果保持 DSH 原文;执行、权限和交付卡片均由 DSH 负责,不伪造文件卡片,不把实际文件改由 DSH 工具写入。
8
8
 
9
- Claude 原生 Agent/TaskStop 与 Codex 原生子代理首轮可用。Codex 只把技能、办公依赖必需桥工具置于 employee 首轮分组,DSH 子代理及其余工具在 dsh 分组按需发现。保留 B6 原生插话、冷恢复、防重放、U1 每次 prompt 用量和原生型号、推理档、权限设置。含桥主机需 2.2.2-aw.17(Codex 0.162.0);不含桥通道不变。没有新增设置项或自定义错误码。
9
+ 零插件自写提示词、原生技能镜像、原生子代理、B6 插话与冷恢复、U1 本轮用量、型号/推理/权限设置全部保留。技能原文、资源及项目说明仍由原生目录读取,文件和命令仍在员工所选目录执行。没有新增设置、限制或错误码。真实模型、三版 DSH 与 token 增量证据见 TESTS.md。
10
10
 
11
11
  上一轮正常结束仍异步清理,不延迟已完成回复。下一次同一可信主机、DSH会话、品牌、原生线程及连接代次打开前,只等待本插件已经发出的那一次释放操作;取消等待不取消释放,失败仍走原有归属校验,不增加模型重试或重复发送任务。
12
12
 
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { syncNativeSessionContent } from "./native-content-transport.js";
2
2
  import { readCustomInstructions } from "./custom-instructions.js";
3
+ import { readSharedFileGuidance } from "./shared-file-guidance.js";
3
4
  import { StartupTiming } from "./startup-timing.js";
4
5
  import { ColdRecovery } from "./cold-recovery.js";
5
6
  import { createSteeringReceipts, installLiveSteering, steeringMessageDigest } from "./live-steering.js";
@@ -439,8 +440,13 @@ export class CodexRemoteAdapter extends LlmAdapter {
439
440
  }
440
441
  if (previous && !runtime.hostSource && (previous.identity !== runtime.identity || previous.cwd !== runtime.cwd || previous.bindingId && previous.bindingId !== runtime.binding?.bindingId || previous.workspaceId && previous.workspaceId !== runtime.binding?.workspaceId))
441
442
  throw new NeedError('SESSION_CONTEXT_MISMATCH', '原会话的员工主机或工作区已改变,请新建会话', '原会话的可信目标和工作区');
443
+ // The source is DSH's effective Shared guidance. Keep its exact bytes in a
444
+ // separate context block so existing native threads receive it as well.
445
+ // Do not change user delivery receipts, steering, or parked bridge steps.
446
+ if (runtime.sharedFileGuidance)
447
+ input = { ...input, prompt: [...input.prompt, { type: 'text', text: runtime.sharedFileGuidance }] };
442
448
  input = await prepareContinuation({ ...options, messages: projected.messages.slice(checkpointIndex + 1) }, input, this.readImage, { maxBytes: config.acpMaxMessageBytes, host: runtime.hostWorkspace });
443
- if (runtime.hostWorkspace && Buffer.byteLength(JSON.stringify({ prompt: input.prompt }), 'utf8') > config.acpMaxMessageBytes)
449
+ if (Buffer.byteLength(JSON.stringify({ prompt: input.prompt }), 'utf8') > config.acpMaxMessageBytes)
444
450
  throw new NeedError('ACP_MESSAGE_TOO_LARGE', '本轮输入超过已设置的会话消息容量,未截断或发送', '管理员调整acpMaxMessageBytes');
445
451
  const details = runtime.details ?? await createRemoteDetails({ warn: line => console.warn(line) }).open({ sessionId: options.sessionId ?? 'unscoped', provider: this.agent.loginProvider, identity: runtime.identity, connection: runtime.connection });
446
452
  startupTiming.bind(event => details.record(event));
@@ -824,10 +830,12 @@ export function apply(ctx, live) {
824
830
  const services = ctx;
825
831
  const scope = request.sessionId ? ctx.get('agents')?.get(SessionId(request.sessionId)) : undefined;
826
832
  const nativeContent = await syncNativeSessionContent({ target, request, employeeCwd: request.nativeEmployeeCwd, scope, skills: services.get('skills') });
833
+ const sharedFileGuidance = await readSharedFileGuidance(services, scope, request.signal);
827
834
  const actualProject = agent.loginProvider === 'claude' && request.nativeEmployeeCwd && nativeContent ? { ...project, path: nativeContent.hostCwd } : project;
828
835
  const runtime = await openByAgent.get(agent.id)(target, actualProject, request);
829
836
  runtime.nativeContent = nativeContent;
830
837
  runtime.customInstructions = readCustomInstructions(services, scope);
838
+ runtime.sharedFileGuidance = sharedFileGuidance;
831
839
  runtime.detailContext = () => {
832
840
  const events = args[2].sessionId ? ctx.get('agents')?.get(SessionId(args[2].sessionId))?.session.snapshotEvents() : undefined;
833
841
  let turn = null, step = null;
@@ -32,6 +32,7 @@ export interface EmployeeExecution {
32
32
  export interface Runtime {
33
33
  nativeContent?: NativeSessionContent;
34
34
  customInstructions?: string;
35
+ sharedFileGuidance?: string;
35
36
  localDirectory?: {
36
37
  path: string;
37
38
  device: number;
@@ -0,0 +1,5 @@
1
+ import { type Agent } from '@deepseek-ai/dsh-agent';
2
+ /** Read the effective official section, including scoped suppression; never reconstruct its prose. */
3
+ export declare function readSharedFileGuidance(services: {
4
+ get(name: string): unknown;
5
+ }, agent?: Agent, signal?: AbortSignal): Promise<string | undefined>;
@@ -0,0 +1,12 @@
1
+ import { assembleContextFor } from '@deepseek-ai/dsh-agent';
2
+ /** Read the effective official section, including scoped suppression; never reconstruct its prose. */
3
+ export async function readSharedFileGuidance(services, agent, signal) {
4
+ const prompt = services.get('systemPrompt');
5
+ if (typeof prompt?.assemble !== 'function')
6
+ return;
7
+ signal?.throwIfAborted();
8
+ const assembly = await prompt.assemble(agent ? assembleContextFor(agent, signal) : { ...(signal ? { signal } : {}) });
9
+ signal?.throwIfAborted();
10
+ const section = assembly.sections.find(row => row.name === 'ui:deliverable-file-references');
11
+ return section?.text || undefined;
12
+ }
@@ -9,5 +9,5 @@ export interface BridgeTool {
9
9
  }
10
10
  export declare function bridgeTable(tools?: readonly ToolSchema[]): ReadonlyMap<string, BridgeTool>;
11
11
  /** Essential bridge entry points have a separate native namespace from deferred tools. */
12
- export declare const TOOLBRIDGE_ESSENTIAL: readonly ["skill", "load_workspace_dependencies"];
12
+ export declare const TOOLBRIDGE_ESSENTIAL: readonly ["skill", "load_workspace_dependencies", "present"];
13
13
  export declare function essentialBridgeTool(name: string): boolean;
@@ -18,10 +18,10 @@ export function bridgeTable(tools = []) {
18
18
  if (table.has(alias))
19
19
  throw new NeedError('TOOLBRIDGE_NAME_COLLISION', '工具桥名称冲突,未执行。', '唯一工具桥名称');
20
20
  const schema = structuredClone(tool);
21
- table.set(alias, { alias, schema, wire: { name: alias, description: schema.description, inputSchema: structuredClone(schema.parameters) } });
21
+ table.set(alias, { alias, schema, wire: { name: alias, description: schema.description, inputSchema: structuredClone(schema.parameters), ...(schema.name === 'present' ? { _meta: { 'anthropic/alwaysLoad': true } } : {}) } });
22
22
  }
23
23
  return table;
24
24
  }
25
25
  /** Essential bridge entry points have a separate native namespace from deferred tools. */
26
- export const TOOLBRIDGE_ESSENTIAL = Object.freeze(['skill', 'load_workspace_dependencies']);
26
+ export const TOOLBRIDGE_ESSENTIAL = Object.freeze(['skill', 'load_workspace_dependencies', 'present']);
27
27
  export function essentialBridgeTool(name) { return TOOLBRIDGE_ESSENTIAL.includes(name.replace(/^dsh__/, '')); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-workbench/remote-agent",
3
- "version": "0.9.0-toolbridge.37",
3
+ "version": "0.9.0-toolbridge.38-rc.2",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",