@ganglion/xacpx 0.9.1 → 0.9.3

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.
@@ -8,4 +8,4 @@ export interface CommandHint {
8
8
  * 从 HELP_TOPICS 派生输入框命令提示(单一真源,与 /help 同源不漂移)。
9
9
  * 额外置顶 /help。
10
10
  */
11
- export declare function listWeacpxCommandHints(): CommandHint[];
11
+ export declare function listXacpxCommandHints(): CommandHint[];
@@ -1,3 +1,3 @@
1
- export declare const WEACPX_KNOWN_COMMAND_PREFIXES: readonly ["/help", "/agents", "/workspaces", "/sessions", "/tasks", "/status", "/cancel", "/stop", "/clear", "/mode", "/replymode", "/config", "/permission", "/pm", "/session", "/ss", "/ssn", "/workspace", "/ws", "/use", "/agent", "/delegate", "/dg", "/group", "/groups", "/task", "/later", "/lt"];
2
- export declare function isKnownWeacpxCommandPrefix(prefix: string): boolean;
3
- export declare function isKnownWeacpxCommandText(text: string): boolean;
1
+ export declare const XACPX_KNOWN_COMMAND_PREFIXES: readonly ["/help", "/agents", "/workspaces", "/sessions", "/tasks", "/status", "/cancel", "/stop", "/clear", "/mode", "/replymode", "/config", "/permission", "/pm", "/session", "/ss", "/ssn", "/workspace", "/ws", "/use", "/agent", "/delegate", "/dg", "/group", "/groups", "/task", "/later", "/lt"];
2
+ export declare function isKnownXacpxCommandPrefix(prefix: string): boolean;
3
+ export declare function isKnownXacpxCommandText(text: string): boolean;
@@ -0,0 +1,13 @@
1
+ import type { AppConfig, ReplyMode } from "../../config/types";
2
+ /**
3
+ * The per-channel default reply mode declared on `channels[].replyMode`, or
4
+ * `undefined` when the channel does not set one (so callers fall through to the
5
+ * global default). The channel is derived from the chatKey the same way the rest
6
+ * of the system scopes sessions.
7
+ */
8
+ export declare function resolveChannelDefaultReplyMode(config: AppConfig | undefined, chatKey: string): ReplyMode | undefined;
9
+ /**
10
+ * Effective reply mode precedence:
11
+ * session override → per-channel default → global channel.replyMode → "verbose".
12
+ */
13
+ export declare function resolveEffectiveReplyMode(config: AppConfig | undefined, chatKey: string, sessionOverride: ReplyMode | undefined): ReplyMode;
@@ -66,6 +66,7 @@ export interface ChannelRuntimeConfig {
66
66
  id: string;
67
67
  type: string;
68
68
  enabled: boolean;
69
+ replyMode?: ReplyMode;
69
70
  options?: Record<string, unknown>;
70
71
  }
71
72
  export interface PluginConfig {
@@ -27,10 +27,11 @@ export interface SessionMessages {
27
27
  replyModeHeader: string;
28
28
  replyModeSessionLabel: (alias: string) => string;
29
29
  replyModeGlobalDefault: (value: string) => string;
30
+ replyModeChannelDefault: (value: string) => string;
30
31
  replyModeSessionOverride: (value: string) => string;
31
32
  replyModeEffective: (value: string) => string;
32
33
  replyModeSet: (replyMode: string) => string;
33
- replyModeReset: (globalDefault: string) => string;
34
+ replyModeReset: (effective: string) => string;
34
35
  statusHeader: string;
35
36
  statusNameLabel: (alias: string) => string;
36
37
  statusAgentLabel: (agent: string) => string;
@@ -503,6 +504,8 @@ export interface ConfigMessages {
503
504
  mustBePositiveNumber: (path: string) => string;
504
505
  channelTypeDisabled: string;
505
506
  channelReplyModeInvalid: string;
507
+ channelRuntimeNotFound: (id: string) => string;
508
+ channelRuntimeReplyModeInvalid: (id: string) => string;
506
509
  wechatReplyModeInvalid: string;
507
510
  wechatReplyModeMapped: (value: string) => string;
508
511
  agentNotFound: (name: string) => string;
@@ -632,7 +635,6 @@ export interface CliUpdateMessages {
632
635
  updateFailed: (name: string, error: string) => string;
633
636
  targetNotFound: (name: string) => string;
634
637
  targetVersionUnknown: (name: string) => string;
635
- targetNotPinned: (name: string) => string;
636
638
  multiTargetNonInteractive: string;
637
639
  selectionPrompt: string;
638
640
  selectionInvalid: (part: string) => string;
@@ -658,6 +660,8 @@ export interface ChannelCliMessages {
658
660
  channelRemoved: (id: string) => string;
659
661
  cannotDisableLastEnabled: string;
660
662
  channelEnabledToggled: (id: string, enabled: boolean) => string;
663
+ channelReplyModeSet: (id: string, mode: string) => string;
664
+ channelReplyModeInvalid: (mode: string) => string;
661
665
  channelAccountAlreadyExists: (type: string, accountId: string) => string;
662
666
  channelAccountAdded: (type: string, accountId: string) => string;
663
667
  channelReEnabled: (type: string) => string;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The orchestration coordinator identity is derived from a session's transport
3
+ * name. `/clear` rotates that name from `workspace:alias` to
4
+ * `workspace:alias:reset-<timestamp>` (see session-reset-handler), which would
5
+ * otherwise orphan every task delegated before the reset. Stripping the
6
+ * volatile `:reset-<digits>` suffix yields the stable `workspace:alias` identity
7
+ * so ownership survives `/clear`.
8
+ *
9
+ * Pure leaf module: do not add imports, so it can be used from sessions/,
10
+ * commands/, and orchestration/ without risking an import cycle.
11
+ *
12
+ * No-op on any value lacking a trailing `:reset-<digits>` segment, so external
13
+ * coordinators (`external_*`) and normal sessions pass through unchanged.
14
+ */
15
+ export declare function stableCoordinatorSession(transportSession: string): string;
16
+ /**
17
+ * The single chokepoint for asking "do these two transport names refer to the
18
+ * same coordinator?". Both sides are reduced to their stable identity before
19
+ * comparison, so it is robust to either side carrying a volatile
20
+ * `:reset-<digits>` suffix (a live post-`/clear` session, or a legacy
21
+ * state.json record persisted before the identity was normalized at write).
22
+ *
23
+ * Every coordinator-ownership comparison must go through this rather than a raw
24
+ * `===`, so the normalization rule lives in one place instead of being
25
+ * re-derived (and inconsistently forgotten) at each call site.
26
+ */
27
+ export declare function sameCoordinatorSession(a: string, b: string): boolean;
@@ -206,23 +206,6 @@ export interface CleanTasksResult {
206
206
  removedTasks: number;
207
207
  removedBindings: number;
208
208
  }
209
- export type ResetGcTrigger = "startup" | "interval";
210
- export interface PurgeExpiredResetCoordinatorsInput {
211
- cutoffDays: number;
212
- trigger: ResetGcTrigger;
213
- }
214
- export interface PurgeExpiredResetCoordinatorsResult {
215
- candidates: number;
216
- purgedCoordinators: number;
217
- removed: {
218
- tasks: number;
219
- workerBindings: number;
220
- groups: number;
221
- coordinatorRoutes: number;
222
- humanQuestionPackages: number;
223
- coordinatorQuestionState: number;
224
- };
225
- }
226
209
  export interface OrchestrationTaskFilter {
227
210
  sourceHandle?: string;
228
211
  coordinatorSession?: string;
@@ -361,7 +344,6 @@ export declare class OrchestrationService {
361
344
  cleanTasks(coordinatorSession: string): Promise<CleanTasksResult>;
362
345
  listSessionBlockingTasks(transportSession: string): Promise<OrchestrationTaskRecord[]>;
363
346
  purgeSessionReferences(transportSession: string): Promise<CleanTasksResult>;
364
- purgeExpiredResetCoordinators(input: PurgeExpiredResetCoordinatorsInput): Promise<PurgeExpiredResetCoordinatorsResult>;
365
347
  listPendingCoordinatorResults(coordinatorSession: string): Promise<OrchestrationTaskRecord[]>;
366
348
  listPendingCoordinatorBlockers(coordinatorSession: string): Promise<OrchestrationTaskRecord[]>;
367
349
  listContestedCoordinatorResults(coordinatorSession: string): Promise<OrchestrationTaskRecord[]>;
@@ -439,11 +421,6 @@ export declare class OrchestrationService {
439
421
  private ensureGroups;
440
422
  private removeEmptyGroupsForCoordinator;
441
423
  private removeCoordinatorMetadataIfUnused;
442
- private isResetCoordinatorSession;
443
- private collectResetCoordinatorCandidates;
444
- private parseDateMs;
445
- private resolveResetCoordinatorActivityAtMs;
446
- private cascadeRemoveCoordinatorRecords;
447
424
  private bumpGroupUpdated;
448
425
  private getLatestDeliveredPackageMessage;
449
426
  private snapshotCoordinatorDeliveryRoute;
@@ -6,7 +6,7 @@ export type { ChannelRuntimeConfig } from "./config/types.js";
6
6
  export type { CommandHint } from "./commands/command-hints.js";
7
7
  export type { AppLogger } from "./logging/app-logger.js";
8
8
  export type { WeacpxPlugin, XacpxPlugin } from "./plugins/types.js";
9
- export { WEACPX_PLUGIN_API_VERSION, WEACPX_PLUGIN_API_SUPPORTED_VERSIONS, WEACPX_PLUGIN_MIN_CORE_VERSION, } from "./plugins/types.js";
9
+ export { XACPX_PLUGIN_API_VERSION, XACPX_PLUGIN_API_SUPPORTED_VERSIONS, XACPX_PLUGIN_MIN_CORE_VERSION, WEACPX_PLUGIN_API_VERSION, WEACPX_PLUGIN_API_SUPPORTED_VERSIONS, WEACPX_PLUGIN_MIN_CORE_VERSION, } from "./plugins/types.js";
10
10
  export { createConversationExecutor } from "./runtime/conversation-executor.js";
11
11
  export type { ConversationExecutor, ConversationExecutorLane } from "./runtime/conversation-executor.js";
12
12
  export { resolveTurnLane } from "./runtime/turn-lane.js";
@@ -88,10 +88,11 @@ var init_session = __esm(() => {
88
88
  replyModeHeader: "Current reply mode:",
89
89
  replyModeSessionLabel: (alias) => `- Session: ${alias}`,
90
90
  replyModeGlobalDefault: (value) => `- Global default: ${value}`,
91
+ replyModeChannelDefault: (value) => `- Channel default: ${value}`,
91
92
  replyModeSessionOverride: (value) => `- Session override: ${value}`,
92
93
  replyModeEffective: (value) => `- Effective: ${value}`,
93
94
  replyModeSet: (replyMode) => `Current session reply mode set to: ${replyMode}`,
94
- replyModeReset: (globalDefault) => `Session reply mode reset. Falling back to global default: ${globalDefault}`,
95
+ replyModeReset: (effective) => `Session reply mode reset. Now effective: ${effective}`,
95
96
  statusHeader: "Current session:",
96
97
  statusNameLabel: (alias) => `- Name: ${alias}`,
97
98
  statusAgentLabel: (agent) => `- Agent: ${agent}`,
@@ -634,6 +635,8 @@ var init_config = __esm(() => {
634
635
  mustBePositiveNumber: (path) => `${path} must be a positive number.`,
635
636
  channelTypeDisabled: "channel.type is a legacy single-channel field; /config set writes are disabled. Use `xacpx channel ...` to manage channels[], then restart xacpx.",
636
637
  channelReplyModeInvalid: "channel.replyMode only supports: stream, final, verbose",
638
+ channelRuntimeNotFound: (id) => `Channel "${id}" does not exist; add it first with \`xacpx channel add ${id}\`.`,
639
+ channelRuntimeReplyModeInvalid: (id) => `channels.${id}.replyMode only supports: stream, final, verbose`,
637
640
  wechatReplyModeInvalid: "wechat.replyMode only supports: stream, final, verbose",
638
641
  wechatReplyModeMapped: (value) => `${value} (mapped to channel.replyMode)`,
639
642
  agentNotFound: (name) => `Agent "${name}" does not exist. Create it first.`,
@@ -823,7 +826,6 @@ var init_cli_update = __esm(() => {
823
826
  updateFailed: (name, error) => `${name} update failed: ${error}`,
824
827
  targetNotFound: (name) => `Update target not found: ${name}`,
825
828
  targetVersionUnknown: (name) => `${name}: cannot check latest version; skipped.`,
826
- targetNotPinned: (name) => `${name} has no recorded version; use \`xacpx plugin update ${name}\` or specify a version explicitly.`,
827
829
  multiTargetNonInteractive: "Installed plugins detected; in non-interactive mode use `xacpx update --all` or `xacpx update <name>`.",
828
830
  selectionPrompt: "Select items to update (numbers, comma-separated; a=all; Enter to cancel): ",
829
831
  selectionInvalid: (part) => `Invalid selection: ${part}`,
@@ -854,6 +856,8 @@ var init_channel_cli = __esm(() => {
854
856
  channelRemoved: (id) => `Channel ${id} removed`,
855
857
  cannotDisableLastEnabled: "Cannot disable the last enabled channel.",
856
858
  channelEnabledToggled: (id, enabled) => `Channel ${id} ${enabled ? "enabled" : "disabled"}`,
859
+ channelReplyModeSet: (id, mode) => `Channel ${id} default reply mode set to: ${mode}`,
860
+ channelReplyModeInvalid: (mode) => `reply mode must be stream / final / verbose, got: ${mode}`,
857
861
  channelAccountAlreadyExists: (type, accountId) => `Account ${accountId} already exists on channel ${type}; run xacpx channel rm ${type} --account ${accountId} first`,
858
862
  channelAccountAdded: (type, accountId) => `Channel ${type} account ${accountId} added`,
859
863
  channelReEnabled: (type) => `Channel ${type} was disabled; it has been automatically re-enabled.`,
@@ -1154,10 +1158,11 @@ var init_session2 = __esm(() => {
1154
1158
  replyModeHeader: "当前 reply mode:",
1155
1159
  replyModeSessionLabel: (alias) => `- 会话:${alias}`,
1156
1160
  replyModeGlobalDefault: (value) => `- 全局默认:${value}`,
1161
+ replyModeChannelDefault: (value) => `- 频道默认:${value}`,
1157
1162
  replyModeSessionOverride: (value) => `- 当前会话覆盖:${value}`,
1158
1163
  replyModeEffective: (value) => `- 当前生效:${value}`,
1159
1164
  replyModeSet: (replyMode) => `已设置当前会话 reply mode:${replyMode}`,
1160
- replyModeReset: (globalDefault) => `已重置当前会话 reply mode,当前回退到全局默认:${globalDefault}`,
1165
+ replyModeReset: (effective) => `已重置当前会话 reply mode,当前生效:${effective}`,
1161
1166
  statusHeader: "当前会话:",
1162
1167
  statusNameLabel: (alias) => `- 名称:${alias}`,
1163
1168
  statusAgentLabel: (agent2) => `- Agent:${agent2}`,
@@ -1700,6 +1705,8 @@ var init_config2 = __esm(() => {
1700
1705
  mustBePositiveNumber: (path) => `${path} 必须是正数。`,
1701
1706
  channelTypeDisabled: "channel.type 是旧单频道字段,/config set 已禁用写入;请使用 `xacpx channel ...` 管理 channels[],然后重启 xacpx。",
1702
1707
  channelReplyModeInvalid: "channel.replyMode 只支持:stream、final、verbose",
1708
+ channelRuntimeNotFound: (id) => `频道「${id}」不存在;请先用 \`xacpx channel add ${id}\` 添加。`,
1709
+ channelRuntimeReplyModeInvalid: (id) => `channels.${id}.replyMode 只支持:stream、final、verbose`,
1703
1710
  wechatReplyModeInvalid: "wechat.replyMode 只支持:stream、final、verbose",
1704
1711
  wechatReplyModeMapped: (value) => `${value}(已映射到 channel.replyMode)`,
1705
1712
  agentNotFound: (name) => `Agent「${name}」不存在,请先创建。`,
@@ -1889,7 +1896,6 @@ var init_cli_update2 = __esm(() => {
1889
1896
  updateFailed: (name, error) => `${name} 更新失败:${error}`,
1890
1897
  targetNotFound: (name) => `没有找到更新项:${name}`,
1891
1898
  targetVersionUnknown: (name) => `${name} 无法检查最新版本,已跳过。`,
1892
- targetNotPinned: (name) => `${name} 未记录当前版本;请先使用 \`xacpx plugin update ${name}\` 或显式选择版本。`,
1893
1899
  multiTargetNonInteractive: "检测到已安装插件;非交互模式请使用 `xacpx update --all` 或 `xacpx update <name>`。",
1894
1900
  selectionPrompt: "请选择要更新的项目(数字,逗号分隔,a=全部,回车取消):",
1895
1901
  selectionInvalid: (part) => `无效选择:${part}`,
@@ -1920,6 +1926,8 @@ var init_channel_cli2 = __esm(() => {
1920
1926
  channelRemoved: (id) => `频道 ${id} 已删除`,
1921
1927
  cannotDisableLastEnabled: "不能禁用最后一个启用的频道。",
1922
1928
  channelEnabledToggled: (id, enabled) => `频道 ${id} 已${enabled ? "启用" : "禁用"}`,
1929
+ channelReplyModeSet: (id, mode) => `频道 ${id} 的默认 reply mode 已设置为:${mode}`,
1930
+ channelReplyModeInvalid: (mode) => `reply mode 只支持 stream / final / verbose,收到:${mode}`,
1923
1931
  channelAccountAlreadyExists: (type, accountId) => `频道 ${type} 的账号 ${accountId} 已存在;先 xacpx channel rm ${type} --account ${accountId}`,
1924
1932
  channelAccountAdded: (type, accountId) => `频道 ${type} 账号 ${accountId} 已添加`,
1925
1933
  channelReEnabled: (type) => `频道 ${type} 此前是 disabled 状态,已自动启用。`,
@@ -2295,19 +2303,19 @@ function cmpTuple(a, b) {
2295
2303
  return 0;
2296
2304
  }
2297
2305
  function validatePluginCompatibility(metadata, context) {
2298
- const { packageName, currentWeacpxVersion } = context;
2306
+ const { packageName, currentXacpxVersion } = context;
2299
2307
  const apiVersion = metadata.apiVersion;
2300
2308
  if (typeof apiVersion !== "number") {
2301
2309
  throw new Error(t().pluginCli.compatMissingApiVersion(packageName));
2302
2310
  }
2303
- if (!WEACPX_PLUGIN_API_SUPPORTED_VERSIONS.includes(apiVersion)) {
2304
- const supported = WEACPX_PLUGIN_API_SUPPORTED_VERSIONS.join(", ");
2311
+ if (!XACPX_PLUGIN_API_SUPPORTED_VERSIONS.includes(apiVersion)) {
2312
+ const supported = XACPX_PLUGIN_API_SUPPORTED_VERSIONS.join(", ");
2305
2313
  throw new Error(t().pluginCli.compatUnsupportedApiVersion(packageName, apiVersion, supported));
2306
2314
  }
2307
- if (!currentWeacpxVersion || currentWeacpxVersion === "unknown") {
2315
+ if (!currentXacpxVersion || currentXacpxVersion === "unknown") {
2308
2316
  return;
2309
2317
  }
2310
- const normalizedCurrent = normalizeCoreVersionForCompat(currentWeacpxVersion);
2318
+ const normalizedCurrent = normalizeCoreVersionForCompat(currentXacpxVersion);
2311
2319
  const minVersion = metadata.minXacpxVersion ?? metadata.minWeacpxVersion;
2312
2320
  const minVersionField = metadata.minXacpxVersion !== undefined ? "minXacpxVersion" : "minWeacpxVersion";
2313
2321
  if (minVersion !== undefined) {
@@ -2322,7 +2330,7 @@ function validatePluginCompatibility(metadata, context) {
2322
2330
  throw new Error(t().pluginCli.compatInvalidMinVersionDetail(packageName, minVersionField, detail));
2323
2331
  }
2324
2332
  if (!satisfied) {
2325
- throw new Error(t().pluginCli.compatMinVersionNotSatisfied(packageName, minVersion, currentWeacpxVersion));
2333
+ throw new Error(t().pluginCli.compatMinVersionNotSatisfied(packageName, minVersion, currentXacpxVersion));
2326
2334
  }
2327
2335
  }
2328
2336
  const compatibleVersions = metadata.compatibleXacpxVersions ?? metadata.compatibleWeacpxVersions;
@@ -2339,14 +2347,17 @@ function validatePluginCompatibility(metadata, context) {
2339
2347
  throw new Error(t().pluginCli.compatInvalidCompatibleVersionsDetail(packageName, compatibleField, detail));
2340
2348
  }
2341
2349
  if (!satisfied) {
2342
- throw new Error(t().pluginCli.compatCompatibleVersionsNotSatisfied(packageName, compatibleVersions, currentWeacpxVersion));
2350
+ throw new Error(t().pluginCli.compatCompatibleVersionsNotSatisfied(packageName, compatibleVersions, currentXacpxVersion));
2343
2351
  }
2344
2352
  }
2345
2353
  }
2346
- var WEACPX_PLUGIN_API_VERSION = 1, WEACPX_PLUGIN_API_SUPPORTED_VERSIONS, WEACPX_PLUGIN_MIN_CORE_VERSION = "0.5.0", SEMVER_RE;
2354
+ var XACPX_PLUGIN_API_VERSION = 1, XACPX_PLUGIN_API_SUPPORTED_VERSIONS, XACPX_PLUGIN_MIN_CORE_VERSION = "0.5.0", WEACPX_PLUGIN_API_VERSION, WEACPX_PLUGIN_API_SUPPORTED_VERSIONS, WEACPX_PLUGIN_MIN_CORE_VERSION, SEMVER_RE;
2347
2355
  var init_compatibility = __esm(() => {
2348
2356
  init_i18n();
2349
- WEACPX_PLUGIN_API_SUPPORTED_VERSIONS = [1];
2357
+ XACPX_PLUGIN_API_SUPPORTED_VERSIONS = [1];
2358
+ WEACPX_PLUGIN_API_VERSION = XACPX_PLUGIN_API_VERSION;
2359
+ WEACPX_PLUGIN_API_SUPPORTED_VERSIONS = XACPX_PLUGIN_API_SUPPORTED_VERSIONS;
2360
+ WEACPX_PLUGIN_MIN_CORE_VERSION = XACPX_PLUGIN_MIN_CORE_VERSION;
2350
2361
  SEMVER_RE = /^(\d+)\.(\d+)\.(\d+)$/;
2351
2362
  });
2352
2363
 
@@ -2517,6 +2528,9 @@ export {
2517
2528
  getLocale,
2518
2529
  createConversationExecutor,
2519
2530
  createActiveTurnRegistry,
2531
+ XACPX_PLUGIN_MIN_CORE_VERSION,
2532
+ XACPX_PLUGIN_API_VERSION,
2533
+ XACPX_PLUGIN_API_SUPPORTED_VERSIONS,
2520
2534
  WEACPX_PLUGIN_MIN_CORE_VERSION,
2521
2535
  WEACPX_PLUGIN_API_VERSION,
2522
2536
  WEACPX_PLUGIN_API_SUPPORTED_VERSIONS
@@ -1,3 +1,6 @@
1
+ export declare const XACPX_PLUGIN_API_VERSION: 1;
2
+ export declare const XACPX_PLUGIN_API_SUPPORTED_VERSIONS: readonly number[];
3
+ export declare const XACPX_PLUGIN_MIN_CORE_VERSION: "0.5.0";
1
4
  export declare const WEACPX_PLUGIN_API_VERSION: 1;
2
5
  export declare const WEACPX_PLUGIN_API_SUPPORTED_VERSIONS: readonly number[];
3
6
  export declare const WEACPX_PLUGIN_MIN_CORE_VERSION: "0.5.0";
@@ -13,6 +16,6 @@ export interface PluginCompatibilityMetadata {
13
16
  }
14
17
  export interface PluginCompatibilityContext {
15
18
  packageName: string;
16
- currentWeacpxVersion: string;
19
+ currentXacpxVersion: string;
17
20
  }
18
21
  export declare function validatePluginCompatibility(metadata: PluginCompatibilityMetadata, context: PluginCompatibilityContext): void;
@@ -1,6 +1,6 @@
1
1
  import type { ChannelPluginDefinition } from "../channels/plugin.js";
2
- import { WEACPX_PLUGIN_API_VERSION, WEACPX_PLUGIN_API_SUPPORTED_VERSIONS, WEACPX_PLUGIN_MIN_CORE_VERSION } from "./compatibility.js";
3
- export { WEACPX_PLUGIN_API_VERSION, WEACPX_PLUGIN_API_SUPPORTED_VERSIONS, WEACPX_PLUGIN_MIN_CORE_VERSION, };
2
+ import { XACPX_PLUGIN_API_VERSION, XACPX_PLUGIN_API_SUPPORTED_VERSIONS, XACPX_PLUGIN_MIN_CORE_VERSION, WEACPX_PLUGIN_API_VERSION, WEACPX_PLUGIN_API_SUPPORTED_VERSIONS, WEACPX_PLUGIN_MIN_CORE_VERSION } from "./compatibility.js";
3
+ export { XACPX_PLUGIN_API_VERSION, XACPX_PLUGIN_API_SUPPORTED_VERSIONS, XACPX_PLUGIN_MIN_CORE_VERSION, WEACPX_PLUGIN_API_VERSION, WEACPX_PLUGIN_API_SUPPORTED_VERSIONS, WEACPX_PLUGIN_MIN_CORE_VERSION, };
4
4
  export interface WeacpxPlugin {
5
5
  apiVersion: 1;
6
6
  name?: string;
@@ -1,6 +1,6 @@
1
1
  import { type OrchestrationState } from "../orchestration/orchestration-types";
2
2
  import type { ScheduledTaskRecord } from "../scheduled/scheduled-types";
3
- export type LogicalSessionSource = "weacpx" | "agent-side";
3
+ export type LogicalSessionSource = "xacpx" | "agent-side";
4
4
  export interface NativeSessionCacheEntry {
5
5
  session_id: string;
6
6
  cwd?: string;
@@ -24,7 +24,7 @@ export interface ResolvedSession {
24
24
  agentCommand?: string;
25
25
  workspace: string;
26
26
  transportSession: string;
27
- source?: "weacpx" | "agent-side";
27
+ source?: "xacpx" | "agent-side";
28
28
  agentSessionId?: string;
29
29
  agentSessionTitle?: string;
30
30
  agentSessionUpdatedAt?: string;
@@ -124,6 +124,14 @@ export interface SessionTransport {
124
124
  listAgentSessions?(query: AgentSessionListQuery): Promise<AgentSessionListResult | undefined>;
125
125
  resumeAgentSession?(session: ResolvedSession, agentSessionId: string): Promise<void>;
126
126
  removeSession?(session: ResolvedSession): Promise<void>;
127
+ /**
128
+ * Read the underlying agent-native session id for an existing transport
129
+ * session. Used by `/clear` to keep a native session native: the fresh
130
+ * post-clear session is itself backed by a new agent rollout, and this
131
+ * returns that rollout's resumable id. Returns undefined when the agent did
132
+ * not advertise one. Optional: transports that can't resolve it omit it.
133
+ */
134
+ getAgentSessionId?(session: ResolvedSession): Promise<string | undefined>;
127
135
  updatePermissionPolicy?(policy: PermissionPolicy): Promise<void>;
128
136
  dispose?(): Promise<void>;
129
137
  }
package/dist/version.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export declare function readVersion(moduleUrl?: string): string;
2
- /** weacpx 核心版本,派生自 package.json(经 readVersion 动态读取,无硬编码漂移)。 */
3
- export declare const WEACPX_CORE_VERSION: string;
2
+ /** xacpx 核心版本,派生自 package.json(经 readVersion 动态读取,无硬编码漂移)。 */
3
+ export declare const XACPX_CORE_VERSION: string;
@@ -62,7 +62,7 @@ export interface ChatRequestMetadata {
62
62
  senderName?: string;
63
63
  groupId?: string;
64
64
  isOwner?: boolean;
65
- /** Internal weacpx session alias to use for non-interactive scheduled prompts. */
65
+ /** Internal xacpx session alias to use for non-interactive scheduled prompts. */
66
66
  scheduledSessionAlias?: string;
67
67
  /** Transient session descriptor for temp-mode scheduled prompts (no persisted alias). */
68
68
  scheduledSessionDescriptor?: ScheduledSessionDescriptor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ganglion/xacpx",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "description": "随时随地通过聊天频道(微信 / 飞书 / 元宝等)远程控制 `acpx` 上的 Claude Code、Codex 等 Agents。",
5
5
  "keywords": [
6
6
  "acpx",