atomix-cli 1.4.0 → 1.5.1
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 +11 -0
- package/dist/cli.js +44501 -48387
- package/dist/session.d.ts +29 -0
- package/dist/session.js +4776 -9012
- package/dist/session.mjs +4776 -9012
- package/dist/tui.mjs +133480 -137468
- package/package.json +11 -6
package/dist/session.d.ts
CHANGED
|
@@ -111,8 +111,30 @@ export interface FormAnswer {
|
|
|
111
111
|
}
|
|
112
112
|
/** 无人值守表单策略:抛错 / 非对象一律按跳过 */
|
|
113
113
|
export type FormPolicy = (req: FormRequestInfo) => FormAnswer | Promise<FormAnswer>;
|
|
114
|
+
/** 界面语言(docs/i18n-v1.md);与 core 的 Locale 同值,公开 d.ts 不能引 atomix-core 所以在此重声明 */
|
|
115
|
+
export type SessionLocale = "zh-CN" | "en-US";
|
|
116
|
+
/** 可嵌套的消息参数:值本身可以是另一条 {code, params}(与 core NestedMessage 同形),消费方可按自己的语言重译 */
|
|
117
|
+
export interface NoteMessage {
|
|
118
|
+
code: string;
|
|
119
|
+
params?: NoteParams;
|
|
120
|
+
}
|
|
121
|
+
export type NoteParamValue = string | number | boolean | null | undefined | NoteMessage;
|
|
122
|
+
export type NoteParams = Record<string, NoteParamValue>;
|
|
123
|
+
/**
|
|
124
|
+
* 启动 / 切换备注(i18n-v1 §5):`notes: string[]` 保留不动,noteItems 是并行的结构化版本——
|
|
125
|
+
* code + params 稳定,message 已按本会话语言渲染,tone 给渲染层定色(不再靠文本前缀判警告)
|
|
126
|
+
*/
|
|
127
|
+
export interface NoteItem extends NoteMessage {
|
|
128
|
+
message: string;
|
|
129
|
+
tone: "info" | "warn";
|
|
130
|
+
}
|
|
114
131
|
export interface SessionCoreOptions {
|
|
115
132
|
cwd: string;
|
|
133
|
+
/**
|
|
134
|
+
* 本会话的用户可见文案语言(i18n-v1 §2.2):只保存到实例,不改进程默认;
|
|
135
|
+
* 缺省 = 进程默认(宿主 setLocale,或 ATOMIX_LANG / 系统 locale 惰性初始化)
|
|
136
|
+
*/
|
|
137
|
+
locale?: SessionLocale;
|
|
116
138
|
/** 缺省:interactive → step-by-step;headless → free-style(与现行 -p 一致,决策 1) */
|
|
117
139
|
permissionMode?: PermissionMode;
|
|
118
140
|
/** true = 有人值守(权限/提问/表单由宿主 UI 应答);false(默认)= 无人值守,自动应答器 fail-closed 接管(决策 1) */
|
|
@@ -152,8 +174,12 @@ export interface SessionCoreHandle {
|
|
|
152
174
|
readonly cwd: string;
|
|
153
175
|
readonly interactive: boolean;
|
|
154
176
|
readonly permissionMode: PermissionMode;
|
|
177
|
+
/** 本会话固定的文案语言(open 时解析,之后不变) */
|
|
178
|
+
readonly locale: SessionLocale;
|
|
155
179
|
/** 构造阶段的备注(如 marketplace 项目域与首个 session 不一致) */
|
|
156
180
|
readonly notes: string[];
|
|
181
|
+
/** notes 的结构化版本(同序) */
|
|
182
|
+
readonly noteItems: readonly NoteItem[];
|
|
157
183
|
}
|
|
158
184
|
export interface BlockedItem {
|
|
159
185
|
kind: "permission" | "question" | "form";
|
|
@@ -207,6 +233,8 @@ export interface AtomixSession<C extends SessionCoreApi = SessionCoreApi> {
|
|
|
207
233
|
readonly ready: SessionReadyInfo;
|
|
208
234
|
/** harness 加载告警、agent 名单应用失败、MCP override 备注、构造期备注 */
|
|
209
235
|
readonly notes: string[];
|
|
236
|
+
/** notes 的结构化版本(同序):code + params 稳定,message 已按会话语言渲染 */
|
|
237
|
+
readonly noteItems: readonly NoteItem[];
|
|
210
238
|
/** 发送一条用户输入,等到本轮 idle 后返回。多次调用按序排队 */
|
|
211
239
|
send(input: string, opts?: SendOptions): Promise<SendResult>;
|
|
212
240
|
/**
|
|
@@ -471,6 +499,7 @@ export interface ServeSessionInfo {
|
|
|
471
499
|
}
|
|
472
500
|
export interface ServeOpenResult extends ServeSessionInfo {
|
|
473
501
|
notes: string[];
|
|
502
|
+
noteItems: NoteItem[];
|
|
474
503
|
historyLoaded: boolean;
|
|
475
504
|
usage: Usage;
|
|
476
505
|
}
|