@ganglion/xacpx 0.10.0 → 0.11.0
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 +22 -0
- package/dist/bridge/bridge-main.js +126 -9
- package/dist/channels/types.d.ts +16 -0
- package/dist/cli.js +2480 -542
- package/dist/commands/handlers/agent-handler.d.ts +1 -1
- package/dist/commands/handlers/session-handler.d.ts +7 -4
- package/dist/commands/parse-command.d.ts +7 -0
- package/dist/commands/router-types.d.ts +7 -2
- package/dist/config/agent-catalog.d.ts +14 -0
- package/dist/config/local-agent-bin.d.ts +17 -0
- package/dist/config/resolve-agent-command.d.ts +11 -0
- package/dist/config/types.d.ts +10 -0
- package/dist/control/control-event-bus.d.ts +59 -0
- package/dist/control/control-service.d.ts +147 -0
- package/dist/control/workspace-fs.d.ts +52 -0
- package/dist/i18n/types.d.ts +12 -0
- package/dist/plugin-api.d.ts +3 -0
- package/dist/plugin-api.js +53 -0
- package/dist/scheduled/scheduled-service.d.ts +3 -0
- package/dist/sessions/active-turn-registry.d.ts +2 -0
- package/dist/sessions/session-service.d.ts +4 -0
- package/dist/state/types.d.ts +2 -0
- package/dist/transport/native-session-history.d.ts +34 -0
- package/dist/transport/types.d.ts +27 -1
- package/dist/weixin/agent/interface.d.ts +3 -1
- package/package.json +17 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NonInteractivePermissions, PermissionMode } from "../config/types";
|
|
2
2
|
import type { QuotaManager } from "../weixin/messaging/quota-manager.js";
|
|
3
|
-
import type { ToolUseEvent } from "../channels/types.js";
|
|
3
|
+
import type { PlanEntry, ToolUseEvent } from "../channels/types.js";
|
|
4
4
|
import type { ToolEventMode } from "./tool-event-mode.js";
|
|
5
5
|
export type { ToolEventMode } from "./tool-event-mode.js";
|
|
6
6
|
export interface ReplyQuotaContext {
|
|
@@ -22,6 +22,12 @@ export interface ResolvedSession {
|
|
|
22
22
|
alias: string;
|
|
23
23
|
agent: string;
|
|
24
24
|
agentCommand?: string;
|
|
25
|
+
/**
|
|
26
|
+
* LLM model id to run this session under (e.g. `gpt-5.2[high]`). Resolved from
|
|
27
|
+
* the session's own override first, then the agent config default. When unset,
|
|
28
|
+
* no `--model` is passed and acpx uses the agent adapter's default.
|
|
29
|
+
*/
|
|
30
|
+
model?: string;
|
|
25
31
|
workspace: string;
|
|
26
32
|
transportSession: string;
|
|
27
33
|
source?: "xacpx" | "agent-side";
|
|
@@ -33,6 +39,14 @@ export interface ResolvedSession {
|
|
|
33
39
|
mcpSourceHandle?: string;
|
|
34
40
|
modeId?: string;
|
|
35
41
|
replyMode?: "stream" | "final" | "verbose";
|
|
42
|
+
/**
|
|
43
|
+
* Channel-resolved effective reply mode. The relay/control channel defaults to
|
|
44
|
+
* "stream" (its dashboard is a streaming UI) so multi-line markdown isn't shredded
|
|
45
|
+
* by batched paragraph reconstruction. Consumers prefer this over `replyMode`;
|
|
46
|
+
* it's undefined for channels with no channel-level default (preserving their
|
|
47
|
+
* existing `replyMode ?? "verbose"` behavior).
|
|
48
|
+
*/
|
|
49
|
+
effectiveReplyMode?: "stream" | "final" | "verbose";
|
|
36
50
|
cwd: string;
|
|
37
51
|
/**
|
|
38
52
|
* True for a non-persisted, single-use session (e.g. a `/later` temp-mode
|
|
@@ -95,6 +109,11 @@ export interface PromptOptions {
|
|
|
95
109
|
* error observed rejects the prompt.
|
|
96
110
|
*/
|
|
97
111
|
onThought?: (chunk: string) => void | Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Structured plan/todo side-channel: the agent's full ACP `plan` entry list,
|
|
114
|
+
* re-sent on every update (REPLACE, not append). Optional — text channels omit it.
|
|
115
|
+
*/
|
|
116
|
+
onPlan?: (entries: PlanEntry[]) => void | Promise<void>;
|
|
98
117
|
/**
|
|
99
118
|
* How tool_call / tool_call_update events are surfaced for this prompt.
|
|
100
119
|
*
|
|
@@ -116,6 +135,13 @@ export interface SessionTransport {
|
|
|
116
135
|
text: string;
|
|
117
136
|
}>;
|
|
118
137
|
setMode(session: ResolvedSession, modeId: string): Promise<void>;
|
|
138
|
+
/** Switch the running session's model. Optional: transports that can't omit it. */
|
|
139
|
+
setModel?(session: ResolvedSession, modelId: string): Promise<void>;
|
|
140
|
+
/** Read the current model and the agent-advertised available model ids. Optional. */
|
|
141
|
+
getSessionModel?(session: ResolvedSession): Promise<{
|
|
142
|
+
current?: string;
|
|
143
|
+
available: string[];
|
|
144
|
+
}>;
|
|
119
145
|
cancel(session: ResolvedSession): Promise<{
|
|
120
146
|
cancelled: boolean;
|
|
121
147
|
message: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ChannelMediaAttachment, OutboundChannelMedia } from "../../channels/media-types.js";
|
|
2
|
-
import type { ScheduledSessionDescriptor, ToolUseEvent } from "../../channels/types.js";
|
|
2
|
+
import type { PlanEntry, ScheduledSessionDescriptor, ToolUseEvent } from "../../channels/types.js";
|
|
3
3
|
import type { PerfSpan } from "../../perf/perf-tracer.js";
|
|
4
4
|
/**
|
|
5
5
|
* Agent interface — any AI backend that can handle a chat message.
|
|
@@ -48,6 +48,8 @@ export interface ChatRequest {
|
|
|
48
48
|
onToolEvent?: (event: ToolUseEvent) => void | Promise<void>;
|
|
49
49
|
/** Structured thinking side-channel; see PromptOptions.onThought. */
|
|
50
50
|
onThought?: (chunk: string) => void | Promise<void>;
|
|
51
|
+
/** Structured plan/todo side-channel; see PromptOptions.onPlan. */
|
|
52
|
+
onPlan?: (entries: PlanEntry[]) => void | Promise<void>;
|
|
51
53
|
/**
|
|
52
54
|
* Optional per-turn performance tracing span. When `logging.perf.enabled` is
|
|
53
55
|
* true, the channel handler attaches a `PerfSpan` so downstream layers can
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ganglion/xacpx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "随时随地通过聊天频道(微信 / 飞书 / 元宝等)远程控制 `acpx` 上的 Claude Code、Codex 等 Agents。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"acpx",
|
|
@@ -46,13 +46,28 @@
|
|
|
46
46
|
"build:plugin-api": "tsc -p tsconfig.plugin-api.json",
|
|
47
47
|
"build:channel-yuanbao": "bun run build:plugin-api && bun run clean:channel-yuanbao && bun build ./packages/channel-yuanbao/src/index.ts --outdir ./packages/channel-yuanbao/dist --target node --external xacpx && tsc -p packages/channel-yuanbao/tsconfig.json",
|
|
48
48
|
"build:channel-feishu": "bun run build:plugin-api && bun run clean:channel-feishu && bun build ./packages/channel-feishu/src/index.ts --outdir ./packages/channel-feishu/dist --target node --external xacpx && tsc -p packages/channel-feishu/tsconfig.json",
|
|
49
|
-
"
|
|
49
|
+
"clean:relay-protocol": "node -e \"require('node:fs').rmSync('packages/relay-protocol/dist',{recursive:true,force:true})\"",
|
|
50
|
+
"assert:relay-protocol": "node -e \"const m=require('./packages/relay-protocol/dist/index.js');if(!m.MSG||!m.MSG.sessionsCreate||typeof m.encodeEnvelope!=='function'){console.error('FATAL: relay-protocol dist is missing runtime exports — the barrel (export *) was likely tree-shaken to empty. Do NOT ship this build.');process.exit(1)}console.log('relay-protocol dist exports OK')\"",
|
|
51
|
+
"build:relay-protocol": "bun run clean:relay-protocol && bun build ./packages/relay-protocol/src/index.ts --outdir ./packages/relay-protocol/dist --target node && tsc -p packages/relay-protocol/tsconfig.json && bun run assert:relay-protocol",
|
|
52
|
+
"clean:relay": "node -e \"require('node:fs').rmSync('packages/relay/dist',{recursive:true,force:true})\"",
|
|
53
|
+
"bundle:relay-web": "node -e \"const f=require('node:fs');const s='packages/relay-web/dist',d='packages/relay/dist/relay-web';if(!f.existsSync(s+'/index.html')){console.error('FATAL: '+s+'/index.html missing — build:relay-web must run before bundling');process.exit(1)}f.rmSync(d,{recursive:true,force:true});f.cpSync(s,d,{recursive:true});console.log('bundled relay-web dashboard -> '+d)\"",
|
|
54
|
+
"build:relay": "bun run build:relay-web && bun run clean:relay && bun build ./packages/relay/src/cli.ts --outdir ./packages/relay/dist --target node --external ws --external hono --external @hono/node-server --external @ganglion/xacpx-relay-protocol && tsc -p packages/relay/tsconfig.json && bun run bundle:relay-web",
|
|
55
|
+
"clean:channel-relay": "node -e \"require('node:fs').rmSync('packages/channel-relay/dist', { recursive: true, force: true })\"",
|
|
56
|
+
"build:channel-relay": "bun run build:plugin-api && bun run build:relay-protocol && bun run clean:channel-relay && bun build ./packages/channel-relay/src/index.ts --outdir ./packages/channel-relay/dist --target node --external xacpx --external ws --external @ganglion/xacpx-relay-protocol && tsc -p packages/channel-relay/tsconfig.json",
|
|
57
|
+
"clean:relay-web": "node -e \"require('node:fs').rmSync('packages/relay-web/dist',{recursive:true,force:true})\"",
|
|
58
|
+
"build:relay-web": "bun run build:relay-protocol && bun run clean:relay-web && bun run --cwd packages/relay-web build",
|
|
59
|
+
"test:web": "bun run --cwd packages/relay-web test",
|
|
60
|
+
"build:packages": "bun run build && bun run build:channel-yuanbao && bun run build:channel-feishu && bun run build:relay-protocol && bun run build:relay && bun run build:channel-relay",
|
|
50
61
|
"verify:publish": "bun run build:packages && node ./scripts/verify-publish.mjs",
|
|
51
62
|
"publish:xacpx": "bun publish --cwd .",
|
|
52
63
|
"publish:weacpx-compat": "bun publish --cwd weacpx-compat --access public",
|
|
53
64
|
"publish:channel-feishu": "bun publish --cwd packages/channel-feishu --access public",
|
|
54
65
|
"publish:channel-yuanbao": "bun publish --cwd packages/channel-yuanbao --access public",
|
|
55
66
|
"publish:plugins": "bun run publish:channel-yuanbao && bun run publish:channel-feishu",
|
|
67
|
+
"publish:relay-protocol": "bun publish --cwd packages/relay-protocol --access public",
|
|
68
|
+
"publish:relay": "bun publish --cwd packages/relay --access public",
|
|
69
|
+
"publish:channel-relay": "bun publish --cwd packages/channel-relay --access public",
|
|
70
|
+
"publish:relay-stack": "bun run publish:relay-protocol && bun run publish:relay && bun run publish:channel-relay",
|
|
56
71
|
"docs:dev": "bun run --cwd packages/docs dev",
|
|
57
72
|
"docs:build": "bun run --cwd packages/docs build",
|
|
58
73
|
"docs:preview": "bun run --cwd packages/docs preview",
|