@ai-workbench/remote-agent 0.9.0-toolbridge.24 → 0.9.0-toolbridge.26

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,4 +1,4 @@
1
- # AI Workbench 远程助手 · @ai-workbench/remote-agent@0.9.0-toolbridge.24 · 插件 → 添加插件
1
+ # AI Workbench 远程助手 · @ai-workbench/remote-agent@0.9.0-toolbridge.26 · 插件 → 添加插件
2
2
 
3
3
  ## 办公依赖与开工计时(O1,2026-11-15)
4
4
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  ## 含工具桥预发布线
12
12
 
13
- 本包为 `0.9.0-toolbridge.24`,从 `v0.9.0-toolbridge.14` 派生,使用 `host-toolbridge` 发布渠道。员工安装由连接组件提供的「AI 写作工作台(含工具桥)」总包 `@ai-workbench/workbench-toolbridge@0.1.24`,与不含工具桥的版本二选一。
13
+ 本包为 `0.9.0-toolbridge.26`,从 `v0.9.0-toolbridge.14` 派生,使用 `host-toolbridge` 发布渠道。员工安装由连接组件提供的「AI 写作工作台(含工具桥)」总包 `@ai-workbench/workbench-toolbridge@0.1.26`,与不含工具桥的版本二选一。
14
14
 
15
15
  本轮增加两家运行中插话(DSH 原生 nextStep),保留官方队列和原话;明确 followup 仍排下一轮。Codex 含桥组件需 `2.2.2-aw.12`,Claude 仍为官方 `0.94.0`。插件确定消息未发出时保留排队资格;送达未确认时明确报错且不重放。已注入旧正文不能撤回,编辑版下一步骤交付。
16
16
 
@@ -86,3 +86,5 @@ Codex 员工端只使用随包提供的原生组件,通道等待本次组件
86
86
  远程助手参数页只显示官方 ConfigForms 当前值,不提供保存、放弃或恢复继承值;修改请使用 DSH 官方 Config“打开配置文件”入口。
87
87
 
88
88
  模型目录在官方启动读取时获取,并在连接变为 connected 时经官方注册刷新;官方菜单打开或重试读取缓存是 DSH 官方限制,本插件不改官方菜单或核心。真正不支持的推理档位由 DSH 预检,其英文提示保留为观察项。
89
+
90
+ I3(0.9.0-toolbridge.26):同一 DSH 对话的系统规则更新后,续接原 Codex native 线程并在实际模型请求应用新版规则;需要主机含桥 Codex ACP aw.14。规则未变不重复追加历史;每次恢复仍带当前配置以支持压缩重建。同 native ID 的可信累计用量基线持续保留,输入、缓存、输出仅结算增量。Claude 的规则传递及累计差额路径保持。无新增设置、限制或错误码。
package/dist/acp.d.ts CHANGED
@@ -43,6 +43,7 @@ export interface AcpStartContext {
43
43
  initialModel?: string;
44
44
  toolBridgeServers?: EmployeeRouting['mcpServers'];
45
45
  systemPrompt?: string;
46
+ systemPromptChanged?: boolean;
46
47
  codexNewSessionOnly?: true;
47
48
  employeeExecution?: EmployeeExecutionMeta;
48
49
  employeeRouting?: EmployeeRouting;
@@ -78,7 +79,6 @@ export declare class AcpSession {
78
79
  private closeRequested;
79
80
  private updating;
80
81
  private cwd?;
81
- private systemPrompt;
82
82
  private codexNewSessionOnly;
83
83
  private creatingReplacement;
84
84
  private employeeMeta?;
@@ -134,7 +134,7 @@ export declare class AcpSession {
134
134
  setHooks(hooks: AcpHooks): void;
135
135
  get closed(): Promise<void>;
136
136
  start(cwd: string, resumeId?: string, signal?: AbortSignal, context?: AcpStartContext, prompt?: acp.ContentBlock[]): Promise<string>;
137
- /** Codex context is immutable after creation; keep the old remote session intact. */
137
+ /** 续接保留原生线程;规则变化由 session/resume 或 session/load 的原生 developer 指令覆盖。 */
138
138
  prompt(input: string | acp.ContentBlock[], signal?: AbortSignal): Promise<acp.StopReason>;
139
139
  steer(prompt: acp.ContentBlock[], signal?: AbortSignal, isCurrent?: () => boolean, maxBytes?: number): Promise<'injected' | 'promptRequired'>;
140
140
  close(cause?: CloseCause, error?: Error): void;
package/dist/acp.js CHANGED
@@ -56,7 +56,6 @@ export class AcpSession {
56
56
  closeRequested = false;
57
57
  updating = false;
58
58
  cwd;
59
- systemPrompt = '';
60
59
  codexNewSessionOnly = false;
61
60
  creatingReplacement = false;
62
61
  employeeMeta;
@@ -576,6 +575,8 @@ export class AcpSession {
576
575
  this.detail({ kind: 'session', severity: 'info', code: 'EMPLOYEE_EXECUTION_SELECTED', summary: '文件和命令在员工电脑的选定目录执行;订阅凭据留在主机,本机扩展的忽略详情单独记录。', payload: { bindingId: this.employeeMeta.bindingId, workspaceId: this.employeeMeta.workspaceId, cwd: this.employeeMeta.cwd, nativeCliVersion: '0.160.1', noHostFallback: true, agentConfigSource: 'host CODEX_HOME', unsupportedLocalFeatures: ['http-mcp-execution', 'hooks', 'plugins', 'cold-resume', 'slash-commands', 'host-file-reports'] } });
577
576
  }
578
577
  const systemPrompt = context?.systemPrompt;
578
+ const resumePolicy = record(this.negotiated._meta?.aiWorkbenchSystemPrompt);
579
+ const nativeContext = !!resumeId && !!context?.codexNewSessionOnly && resumePolicy?.version === 2;
579
580
  const initialPolicy = record(this.negotiated._meta?.aiWorkbenchInitialModel);
580
581
  const initialModel = !resumeId && context?.codexNewSessionOnly && initialPolicy?.version === 1 && initialPolicy?.scope === 'new-session' ? context.initialModel : undefined;
581
582
  this.codexNewSessionOnly = !!context?.codexNewSessionOnly;
@@ -584,7 +585,7 @@ export class AcpSession {
584
585
  const routing = context?.employeeRouting ? structuredClone(context.employeeRouting) : undefined;
585
586
  this.employeeRouting = routing;
586
587
  const claudeCode = routing ? { options: employeeClaudeOptions(routing) } : this.codexNewSessionOnly ? undefined : { options: { settings: claudeSettings() } };
587
- const params = { cwd, mcpServers: context?.toolBridgeServers ? structuredClone(context.toolBridgeServers) : routing ? structuredClone(routing.mcpServers) : [], ...((claudeCode || this.employeeMeta || initialModel) ? { _meta: { ...(initialModel ? { awInitialModel: { version: 1, model: initialModel } } : {}), ...(this.employeeMeta ? { awEmployeeExecution: this.employeeMeta } : {}), ...(claudeCode ? { claudeCode } : {}) } } : {}), ...(systemPrompt && !(resumeId && this.codexNewSessionOnly) ? { systemPrompt: { mode: 'append', content: [{ type: 'text', text: systemPrompt }] } } : {}) };
588
+ const params = { cwd, mcpServers: context?.toolBridgeServers ? structuredClone(context.toolBridgeServers) : routing ? structuredClone(routing.mcpServers) : [], ...((claudeCode || this.employeeMeta || initialModel || nativeContext) ? { _meta: { ...(nativeContext ? { awSystemPrompt: { version: 2, changed: context?.systemPromptChanged === true } } : {}), ...(initialModel ? { awInitialModel: { version: 1, model: initialModel } } : {}), ...(this.employeeMeta ? { awEmployeeExecution: this.employeeMeta } : {}), ...(claudeCode ? { claudeCode } : {}) } } : {}), ...((systemPrompt !== undefined || context?.systemPromptChanged) && !(resumeId && this.codexNewSessionOnly && !context?.systemPromptChanged && !nativeContext) ? { systemPrompt: { mode: 'append', content: [{ type: 'text', text: systemPrompt ?? '' }] } } : {}) };
588
589
  const configRevision = this.resetConfiguration();
589
590
  const restore = async (operation) => {
590
591
  try {
@@ -637,7 +638,6 @@ export class AcpSession {
637
638
  await this.hooks.sessionOwnership?.bind(this.sessionId, signal);
638
639
  this.ready = true;
639
640
  this.cwd = cwd;
640
- this.systemPrompt = systemPrompt ?? '';
641
641
  return this.sessionId;
642
642
  }
643
643
  catch (error) {
@@ -652,7 +652,7 @@ export class AcpSession {
652
652
  signal?.removeEventListener('abort', abort);
653
653
  }
654
654
  }
655
- /** Codex context is immutable after creation; keep the old remote session intact. */
655
+ /** 续接保留原生线程;规则变化由 session/resume 或 session/load 的原生 developer 指令覆盖。 */
656
656
  async prompt(input, signal) {
657
657
  if (!this.ready || !this.sessionId)
658
658
  throw new NeedError('SESSION_REQUIRED', '我需要先建立远端会话', 'ACP 会话');
package/dist/index.js CHANGED
@@ -481,7 +481,7 @@ export class CodexRemoteAdapter extends LlmAdapter {
481
481
  details.record({ kind: 'session', severity: input.historyTransfer.omittedRounds ? 'warning' : 'info', code: input.historyTransfer.omittedRounds ? 'HISTORY_TRANSFER_TRIMMED' : 'HISTORY_TRANSFER', summary: input.historyTransfer.omittedRounds ? `可见历史超过既有会话消息容量,保留最近${input.historyTransfer.retainedRounds}轮,省略较早${input.historyTransfer.omittedRounds}轮;当前输入完整保留。` : '已补充当前远端会话尚未见过的可见对话,未重放工具或审批。', payload: input.historyTransfer });
482
482
  if (runtime.hostWorkspace)
483
483
  details.record({ kind: 'session', severity: 'info', code: 'HOST_WORKSPACE_CONTEXT', summary: '本轮模型工作区上下文及审批会话目录使用已确认的主机目录。', payload: { source: 'host', cwd: runtime.hostWorkspace.cwd } });
484
- const mapper = new StreamMapper(mode === 'session' && !contextChanged ? (previous ? (previous.usageSnapshot ?? null) : undefined) : undefined, observation => details.record(observation));
484
+ const mapper = new StreamMapper(mode === 'session' ? (previous ? (previous.usageSnapshot ?? null) : undefined) : undefined, observation => details.record(observation));
485
485
  activeMapper = mapper;
486
486
  let id;
487
487
  let stop;
@@ -616,7 +616,7 @@ export class CodexRemoteAdapter extends LlmAdapter {
616
616
  const task = (async () => {
617
617
  remoteAttempted = true;
618
618
  try {
619
- await session.start(runtime.execution?.hostCwd ?? runtime.cwd, previous?.sessionId, modelSignal, { systemPrompt: input.systemPrompt, ...(bridgeMcp ? { toolBridgeServers: bridgeMcp.mcpServers } : {}), ...(runtime.execution ? { employeeRouting: runtime.execution.routing } : {}), ...(codex ? { codexNewSessionOnly: true, initialModel: selected.value } : {}), ...(runtime.employeeExecutionMeta ? { employeeExecution: runtime.employeeExecutionMeta } : {}) }, input.prompt);
619
+ await session.start(runtime.execution?.hostCwd ?? runtime.cwd, previous?.sessionId, modelSignal, { systemPrompt: input.systemPrompt, systemPromptChanged: contextChanged, ...(bridgeMcp ? { toolBridgeServers: bridgeMcp.mcpServers } : {}), ...(runtime.execution ? { employeeRouting: runtime.execution.routing } : {}), ...(codex ? { codexNewSessionOnly: true, initialModel: selected.value } : {}), ...(runtime.employeeExecutionMeta ? { employeeExecution: runtime.employeeExecutionMeta } : {}) }, input.prompt);
620
620
  }
621
621
  catch (error) {
622
622
  details.record({ kind: 'session', severity: 'action-required', code: 'SESSION_START_FAILED', summary: '远端会话建立或恢复失败,本轮用户输入未发送。', payload: { operation: previous ? 'resume-or-load' : 'new', reason: closeCode(error, 'ACP_FAILED'), promptDispatched: false } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-workbench/remote-agent",
3
- "version": "0.9.0-toolbridge.24",
3
+ "version": "0.9.0-toolbridge.26",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",