neoctl 0.2.30 → 0.2.31

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.
Files changed (97) hide show
  1. package/README.md +37 -3
  2. package/dist/context/compaction.d.ts +20 -4
  3. package/dist/context/compaction.js +377 -186
  4. package/dist/context/compaction.js.map +1 -1
  5. package/dist/context/context-manager.d.ts +7 -1
  6. package/dist/context/context-manager.js +15 -11
  7. package/dist/context/context-manager.js.map +1 -1
  8. package/dist/context/prompts.js +2 -0
  9. package/dist/context/prompts.js.map +1 -1
  10. package/dist/context/smoke-context.js +266 -17
  11. package/dist/context/smoke-context.js.map +1 -1
  12. package/dist/core/assistant-output-filter.d.ts +1 -0
  13. package/dist/core/assistant-output-filter.js +54 -2
  14. package/dist/core/assistant-output-filter.js.map +1 -1
  15. package/dist/core/context-metrics.d.ts +1 -0
  16. package/dist/core/context-metrics.js +18 -12
  17. package/dist/core/context-metrics.js.map +1 -1
  18. package/dist/core/image-registry.d.ts +16 -3
  19. package/dist/core/image-registry.js +65 -30
  20. package/dist/core/image-registry.js.map +1 -1
  21. package/dist/core/image-storage.d.ts +15 -1
  22. package/dist/core/image-storage.js +140 -17
  23. package/dist/core/image-storage.js.map +1 -1
  24. package/dist/core/message-pipeline.js +18 -4
  25. package/dist/core/message-pipeline.js.map +1 -1
  26. package/dist/core/query-engine.d.ts +12 -2
  27. package/dist/core/query-engine.js +57 -8
  28. package/dist/core/query-engine.js.map +1 -1
  29. package/dist/core/query.d.ts +13 -2
  30. package/dist/core/query.js +56 -21
  31. package/dist/core/query.js.map +1 -1
  32. package/dist/core/smoke-core-loop.js +68 -3
  33. package/dist/core/smoke-core-loop.js.map +1 -1
  34. package/dist/core/smoke-image-integrity.d.ts +1 -0
  35. package/dist/core/smoke-image-integrity.js +67 -0
  36. package/dist/core/smoke-image-integrity.js.map +1 -0
  37. package/dist/core/state.d.ts +1 -1
  38. package/dist/core/state.js.map +1 -1
  39. package/dist/index.d.ts +1 -0
  40. package/dist/index.js +1 -0
  41. package/dist/index.js.map +1 -1
  42. package/dist/model/model-metadata.json +4 -4
  43. package/dist/plugins/plugin-system.d.ts +61 -0
  44. package/dist/plugins/plugin-system.js +189 -0
  45. package/dist/plugins/plugin-system.js.map +1 -0
  46. package/dist/plugins/smoke-plugin-system.d.ts +1 -0
  47. package/dist/plugins/smoke-plugin-system.js +63 -0
  48. package/dist/plugins/smoke-plugin-system.js.map +1 -0
  49. package/dist/repl/index.js +8 -3
  50. package/dist/repl/index.js.map +1 -1
  51. package/dist/session/session-export.d.ts +2 -0
  52. package/dist/session/session-export.js +10 -0
  53. package/dist/session/session-export.js.map +1 -1
  54. package/dist/session/session-store.d.ts +41 -0
  55. package/dist/session/session-store.js +292 -59
  56. package/dist/session/session-store.js.map +1 -1
  57. package/dist/session/smoke-session.js +127 -7
  58. package/dist/session/smoke-session.js.map +1 -1
  59. package/dist/tools/builtins/exec-process-manager.d.ts +9 -0
  60. package/dist/tools/builtins/exec-process-manager.js +45 -4
  61. package/dist/tools/builtins/exec-process-manager.js.map +1 -1
  62. package/dist/tools/builtins/exec-tool.js +10 -2
  63. package/dist/tools/builtins/exec-tool.js.map +1 -1
  64. package/dist/tools/builtins/image-generation-tool.js +32 -42
  65. package/dist/tools/builtins/image-generation-tool.js.map +1 -1
  66. package/dist/tools/builtins/image-loader-tool.js +10 -4
  67. package/dist/tools/builtins/image-loader-tool.js.map +1 -1
  68. package/dist/tools/builtins/image-note-tool.js +8 -3
  69. package/dist/tools/builtins/image-note-tool.js.map +1 -1
  70. package/dist/tools/registry.d.ts +8 -1
  71. package/dist/tools/registry.js +37 -13
  72. package/dist/tools/registry.js.map +1 -1
  73. package/dist/tools/smoke-exec-process.js +12 -0
  74. package/dist/tools/smoke-exec-process.js.map +1 -1
  75. package/dist/tools/smoke-tool-system.js +24 -6
  76. package/dist/tools/smoke-tool-system.js.map +1 -1
  77. package/dist/types/events.d.ts +5 -1
  78. package/dist/types/messages.d.ts +13 -5
  79. package/dist/types/messages.js +4 -0
  80. package/dist/types/messages.js.map +1 -1
  81. package/dist/ui/display-message.d.ts +10 -2
  82. package/dist/ui/display-message.js +18 -9
  83. package/dist/ui/display-message.js.map +1 -1
  84. package/dist/web/index.d.ts +159 -9
  85. package/dist/web/index.js +967 -106
  86. package/dist/web/index.js.map +1 -1
  87. package/dist/web/runtime-context-protocol.d.ts +12 -1
  88. package/dist/web/runtime-context-protocol.js +16 -1
  89. package/dist/web/runtime-context-protocol.js.map +1 -1
  90. package/dist/web/smoke-runtime-context-protocol.js +3 -0
  91. package/dist/web/smoke-runtime-context-protocol.js.map +1 -1
  92. package/dist/web/smoke-web-history.d.ts +1 -0
  93. package/dist/web/smoke-web-history.js +121 -0
  94. package/dist/web/smoke-web-history.js.map +1 -0
  95. package/dist/web/smoke-web-terminal-tasks.js +34 -3
  96. package/dist/web/smoke-web-terminal-tasks.js.map +1 -1
  97. package/package.json +4 -1
@@ -10,7 +10,9 @@ import type { Tool } from "../tools/tool.js";
10
10
  import { ExecProcessManager } from "../tools/builtins/exec-process-manager.js";
11
11
  import { type AgentToolRuntime } from "../agents/agent-tool.js";
12
12
  import { TaskStore } from "../tasks/task-store.js";
13
+ import type { CompactionReport } from "../context/compaction.js";
13
14
  import type { PromptSection } from "../context/prompts.js";
15
+ import type { NeoPluginResource } from "../plugins/plugin-system.js";
14
16
  import type { ContextMetrics } from "../types/events.js";
15
17
  import { type WebRuntimeContextPayload } from "./runtime-context-protocol.js";
16
18
  export interface WebRuntime {
@@ -28,14 +30,12 @@ export interface WebRuntime {
28
30
  envPath: string;
29
31
  envNotice?: string;
30
32
  pluginSupport?: WebRuntimePluginSupport;
33
+ toolSupport?: WebRuntimeToolSupport;
31
34
  }
32
- export interface WebRuntimePluginDefinition {
33
- id: string;
34
- name: string;
35
- version: string;
35
+ export interface WebRuntimePluginDefinition extends Pick<NeoPluginResource, "id" | "name" | "version" | "tools"> {
36
36
  globallyEnabled: boolean;
37
- tools: readonly Tool[];
38
37
  promptSections?: readonly PromptSection[];
38
+ presentToolResult?: NeoPluginResource["presentToolResult"];
39
39
  }
40
40
  interface WebRuntimePluginSupport {
41
41
  catalog: WebRuntimePluginDefinition[];
@@ -45,6 +45,20 @@ interface WebRuntimePluginSupport {
45
45
  persist?: (sessionId: string, overrides: Record<string, boolean>) => Promise<void>;
46
46
  resolve?: (sessionId: string) => Promise<Record<string, boolean>> | Record<string, boolean>;
47
47
  }
48
+ interface WebRuntimeToolCatalogItem {
49
+ name: string;
50
+ source: "builtin" | "external" | "plugin";
51
+ pluginId?: string;
52
+ pluginName?: string;
53
+ }
54
+ interface WebRuntimeToolSupport {
55
+ catalog: WebRuntimeToolCatalogItem[];
56
+ globalOverrides: Record<string, boolean>;
57
+ sessionOverrides: Record<string, boolean>;
58
+ persistGlobal?: (overrides: Record<string, boolean>) => Promise<void>;
59
+ persistSession?: (sessionId: string, overrides: Record<string, boolean>) => Promise<void>;
60
+ resolveSession?: (sessionId: string) => Promise<Record<string, boolean>> | Record<string, boolean>;
61
+ }
48
62
  export interface UsageTotals {
49
63
  inputTokens: number;
50
64
  outputTokens: number;
@@ -62,9 +76,45 @@ export declare class SessionUsageTracker {
62
76
  snapshot(): UsageTotals;
63
77
  }
64
78
  interface UiLineImage {
65
- src: string;
79
+ src?: string;
80
+ imageId?: string;
66
81
  label?: string;
67
82
  mimeType: string;
83
+ available: boolean;
84
+ error?: string;
85
+ blockIndex: number;
86
+ }
87
+ interface UiCompactionReport extends CompactionReport {
88
+ createdAt?: string;
89
+ current?: boolean;
90
+ }
91
+ interface UiResource {
92
+ kind: string;
93
+ url: string;
94
+ reference?: string;
95
+ label?: string;
96
+ downloadName?: string;
97
+ sizeBytes?: number;
98
+ expiresAt?: number;
99
+ mimeType?: string;
100
+ height?: number;
101
+ }
102
+ interface UiToolFact {
103
+ label: string;
104
+ value: string;
105
+ code?: boolean;
106
+ tone?: "neutral" | "success" | "warning" | "danger";
107
+ }
108
+ interface UiToolPreview {
109
+ label?: string;
110
+ kind: "text" | "code" | "diff" | "list";
111
+ content: string;
112
+ }
113
+ interface UiToolDisplay {
114
+ subject?: string;
115
+ purpose?: string;
116
+ facts: UiToolFact[];
117
+ previews: UiToolPreview[];
68
118
  }
69
119
  interface UiLine {
70
120
  id: number;
@@ -78,12 +128,16 @@ interface UiLine {
78
128
  title?: string;
79
129
  bodyTitle?: string;
80
130
  titleStatus?: "success" | "failure";
131
+ toolDisplay?: UiToolDisplay;
81
132
  format?: "markdown" | "ansi" | "plain" | "diff";
82
133
  previewStyle?: "summary";
83
134
  summaryMaxLines?: number;
135
+ presentationLevel?: "primary" | "process";
136
+ resources?: UiResource[];
84
137
  live?: boolean;
85
138
  collapsible?: boolean;
86
139
  image?: UiLineImage;
140
+ compaction?: UiCompactionReport;
87
141
  }
88
142
  type WebActionFailure = {
89
143
  ok: false;
@@ -127,6 +181,9 @@ export interface CreateWebRuntimeOptions {
127
181
  agentId?: string;
128
182
  /** Workspace root used by context, tools, and session storage. */
129
183
  cwd?: string;
184
+ /** Persisted CWD transition chain shown to the model on the next request only. */
185
+ cwdTransitionPaths?: readonly string[];
186
+ onCwdTransitionConsumed?: () => void | Promise<void>;
130
187
  /** Additional tools to register in the web runtime. */
131
188
  externalTools?: readonly Tool[];
132
189
  /** Stable or dynamic prompt sections supplied by the embedding application. */
@@ -139,6 +196,13 @@ export interface CreateWebRuntimeOptions {
139
196
  sessionPluginOverrides?: Readonly<Record<string, boolean>>;
140
197
  persistSessionPluginOverrides?: WebRuntimePluginSupport["persist"];
141
198
  resolveSessionPluginOverrides?: WebRuntimePluginSupport["resolve"];
199
+ /** Global tool defaults. Missing names default to enabled. */
200
+ globalToolOverrides?: Readonly<Record<string, boolean>>;
201
+ /** Per-session tool overrides. Missing names inherit their global default. */
202
+ sessionToolOverrides?: Readonly<Record<string, boolean>>;
203
+ persistGlobalToolOverrides?: WebRuntimeToolSupport["persistGlobal"];
204
+ persistSessionToolOverrides?: WebRuntimeToolSupport["persistSession"];
205
+ resolveSessionToolOverrides?: WebRuntimeToolSupport["resolveSession"];
142
206
  }
143
207
  export interface WebRuntimeScope {
144
208
  /** Browser-tab or client-instance identifier. Omit for the legacy singleton runtime. */
@@ -170,6 +234,7 @@ interface LoginFormPayload {
170
234
  }
171
235
  interface WebImageAttachmentPayload {
172
236
  kind: "image";
237
+ imageId: string;
173
238
  label: string;
174
239
  mimeType: string;
175
240
  data: string;
@@ -208,10 +273,29 @@ export declare class WebRuntimeRouter {
208
273
  private readonly repls;
209
274
  private readonly createRuntime;
210
275
  private readonly createRepl;
276
+ private readonly clientRevision;
277
+ private readonly coreVersion;
211
278
  constructor(options?: WebRuntimeRouterOptions);
212
279
  get(scope?: WebRuntimeScope): Promise<WebRepl>;
213
280
  snapshot(scope?: WebRuntimeScope, includeCatalog?: boolean): Promise<ReturnType<WebRepl["snapshot"]>>;
214
281
  activeScopes(): string[];
282
+ clientInfo(): WebClientInfoPayload;
283
+ requestClientReload(options?: {
284
+ clearCache?: boolean;
285
+ reason?: string;
286
+ }): Promise<WebClientReloadPayload & {
287
+ clients: number;
288
+ }>;
289
+ }
290
+ interface WebClientInfoPayload {
291
+ protocolVersion: 1;
292
+ revision: string;
293
+ coreVersion: string;
294
+ }
295
+ interface WebClientReloadPayload extends WebClientInfoPayload {
296
+ requestId: string;
297
+ clearCache: boolean;
298
+ reason: string;
215
299
  }
216
300
  export declare function createWebRuntimeRouter(options?: WebRuntimeRouterOptions): Promise<WebRuntimeRouter>;
217
301
  export declare class WebRepl {
@@ -221,6 +305,8 @@ export declare class WebRepl {
221
305
  private pendingDeltaOperations;
222
306
  private pendingDeltaStatus;
223
307
  private pendingDeltaTimer;
308
+ private readonly pendingTerminalOutput;
309
+ private terminalOutputTimer;
224
310
  private lineId;
225
311
  private assistantLineId;
226
312
  private thinkingLineId;
@@ -235,15 +321,16 @@ export declare class WebRepl {
235
321
  private queuedAttachments;
236
322
  private foregroundRun;
237
323
  private foregroundRunToken;
238
- private pendingUserImageEchoLabels;
324
+ private pendingUserImageEchoIds;
239
325
  private pendingUserImageEchoMessageId;
240
326
  private runtimeContextRevision;
241
327
  private runtimeContextPublishQueue;
242
328
  private readonly backgroundSessionRuns;
243
329
  private readonly suppressReattachedStreaming;
244
- private backgroundTaskCount;
245
330
  constructor(runtime: WebRuntime);
246
- subscribe(res: ServerResponse): void;
331
+ subscribe(res: ServerResponse, clientInfo?: WebClientInfoPayload): void;
332
+ get backgroundTaskCount(): number;
333
+ requestClientReload(payload: WebClientReloadPayload): number;
247
334
  snapshot(includeCatalog?: boolean): {
248
335
  lines: UiLine[];
249
336
  status: UiStatus;
@@ -254,10 +341,15 @@ export declare class WebRepl {
254
341
  kind: "agent";
255
342
  taskId: string;
256
343
  agentId: string;
344
+ agentType: string | undefined;
257
345
  type: import("../index.js").LocalAgentTaskType;
258
346
  status: import("../index.js").LocalAgentTaskStatus;
259
347
  description: string;
348
+ prompt: string;
349
+ progress: import("../index.js").AgentProgressSnapshot;
350
+ outputFile: string;
260
351
  createdAt: string;
352
+ updatedAt: string;
261
353
  } | {
262
354
  kind: "terminal";
263
355
  taskId: string;
@@ -272,6 +364,16 @@ export declare class WebRepl {
272
364
  shell: string;
273
365
  tty: boolean;
274
366
  durationMs: number;
367
+ output: string;
368
+ outputEnd: number;
369
+ } | {
370
+ kind: "session";
371
+ taskId: string;
372
+ type: string;
373
+ status: "running";
374
+ description: string;
375
+ createdAt: number;
376
+ sessionId: string;
275
377
  })[];
276
378
  backgroundSessionRunCount: number;
277
379
  runningSessionIds: string[];
@@ -304,10 +406,45 @@ export declare class WebRepl {
304
406
  promptSections: number;
305
407
  }[];
306
408
  };
409
+ globalTools(): {
410
+ items: {
411
+ configuredEnabled: boolean;
412
+ name: string;
413
+ source: "builtin" | "external" | "plugin";
414
+ pluginId?: string;
415
+ pluginName?: string;
416
+ }[];
417
+ };
418
+ sessionTools(): {
419
+ sessionId: string | undefined;
420
+ busy: boolean;
421
+ items: {
422
+ available: boolean;
423
+ globallyEnabled: boolean;
424
+ mode: string;
425
+ effectiveEnabled: boolean;
426
+ name: string;
427
+ source: "builtin" | "external" | "plugin";
428
+ pluginId?: string;
429
+ pluginName?: string;
430
+ }[];
431
+ };
432
+ setGlobalTools(value: unknown): Promise<WebActionResult<{
433
+ state: ReturnType<WebRepl["globalTools"]>;
434
+ }>>;
435
+ setSessionTools(value: unknown): Promise<WebActionResult<{
436
+ state: ReturnType<WebRepl["sessionTools"]>;
437
+ }>>;
438
+ loadSessionTools(sessionId: string): Promise<void>;
307
439
  setSessionPlugins(value: unknown): Promise<WebActionResult<{
308
440
  state: ReturnType<WebRepl["sessionPlugins"]>;
309
441
  }>>;
310
442
  loadSessionPlugins(sessionId: string): Promise<void>;
443
+ private parseToolOverrides;
444
+ private parseToolModes;
445
+ private applySessionToolOverrides;
446
+ private syncPluginToolRegistration;
447
+ private refreshToolConfiguration;
311
448
  private applySessionPluginOverrides;
312
449
  submit(text: string, attachments?: WebAttachmentPayload[]): Promise<{
313
450
  ok: true;
@@ -341,9 +478,17 @@ export declare class WebRepl {
341
478
  body: Buffer;
342
479
  mimeType: string;
343
480
  } | undefined;
481
+ imagePayloadById(imageId: string): {
482
+ body: Buffer;
483
+ mimeType: string;
484
+ } | undefined;
344
485
  setFastMode(enabled: boolean): Promise<WebActionResult<{
345
486
  fastMode: boolean;
346
487
  }>>;
488
+ setContextWindowK(value: unknown): Promise<WebActionResult<{
489
+ contextWindowK: number;
490
+ contextWindowTokens: number;
491
+ }>>;
347
492
  loginForm(providerValue?: string): LoginFormPayload;
348
493
  saveLogin(providerValue: string, values: Record<string, string>): Promise<WebActionResult>;
349
494
  interrupt(): {
@@ -355,6 +500,7 @@ export declare class WebRepl {
355
500
  cancelled: boolean;
356
501
  };
357
502
  private append;
503
+ private appendCompaction;
358
504
  private appendLineText;
359
505
  private replaceLineText;
360
506
  private replaceLine;
@@ -382,8 +528,12 @@ export declare class WebRepl {
382
528
  private scheduleDeltaFlush;
383
529
  private flushDeltaOperations;
384
530
  private discardPendingDeltaOperations;
531
+ private dropInactiveTerminalOutput;
532
+ private queueTerminalOutput;
533
+ private flushTerminalOutput;
385
534
  private broadcastSync;
386
535
  }
387
536
  export declare function compactLineOperations(operations: WebLineOperation[]): WebLineOperation[];
537
+ export declare function restoreWebHistoryLines(runtime: Pick<WebRuntime, "engine">): Array<Record<string, unknown>>;
388
538
  export declare function mergeWebQueuedInput(current: string | undefined, next: string): string;
389
539
  export {};