@mu-agent/mu 0.0.2 → 0.0.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.
@@ -18,7 +18,7 @@ export type { PermissionAction, PermissionPreview, PermissionRequest, Permission
18
18
  export { evaluate } from "./permission.js";
19
19
  export type { ManagedProcessHandle, ProcessEvents, Spawner, SpawnRequest, TaskInfo, TaskStatus, } from "./process.js";
20
20
  export { exitNotification, OutputBuffer, ProcessManager } from "./process.js";
21
- export type { PermissionMode, Profile, ProfileFactory, ProfileRuntime, ProfileRuntimeHost, } from "./profile.js";
21
+ export type { PermissionMode, PermissionModeTone, Profile, ProfileFactory, ProfileRuntime, ProfileRuntimeHost, } from "./profile.js";
22
22
  export type { RecoveryAttempt } from "./recovery.js";
23
23
  export { isContextTooLongError, isContextTooLongResult, withContextRecovery, } from "./recovery.js";
24
24
  export type { NewTreeEntry, SessionEntry, SessionStore, TreeEntry } from "./session.js";
@@ -6,10 +6,12 @@ import type { ToolRenderer } from "./extensions.js";
6
6
  import type { AgentMessage } from "./messages.js";
7
7
  import type { PermissionRule } from "./permission.js";
8
8
  import type { AnyTool } from "./tools.js";
9
+ export type PermissionModeTone = "restrictive" | "permissive" | "unrestricted";
9
10
  export interface PermissionMode {
10
11
  id: string;
11
12
  label: string;
12
13
  description: string;
14
+ tone?: PermissionModeTone;
13
15
  rules: PermissionRule[];
14
16
  }
15
17
  export interface ProfileRuntimeHost {
@@ -1,4 +1,4 @@
1
- import type { AgentMessage } from "./messages.js";
1
+ import type { AgentMessage, Usage } from "./messages.js";
2
2
  export declare const SESSION_VERSION = 1;
3
3
  export type SessionEntry = {
4
4
  type: "session";
@@ -30,6 +30,7 @@ export type SessionEntry = {
30
30
  strategy?: "summary-tail";
31
31
  keptTokens?: number;
32
32
  toolResultsCleared?: number;
33
+ usage?: Usage;
33
34
  } | {
34
35
  type: "microcompaction";
35
36
  id: string;
@@ -21,11 +21,14 @@ export declare function writeTool(deps: ToolDeps): import("../../sdk/index.js").
21
21
  path: string;
22
22
  content: string;
23
23
  }>;
24
+ export declare function coerceEditInput(raw: unknown): unknown;
24
25
  export declare function editTool(deps: ToolDeps): import("../../sdk/index.js").Tool<{
25
26
  path: string;
26
- oldString: string;
27
- newString: string;
28
- replaceAll?: boolean | undefined;
27
+ edits: {
28
+ oldString: string;
29
+ newString: string;
30
+ replaceAll?: boolean | undefined;
31
+ }[];
29
32
  }>;
30
33
  export declare function lsTool(deps: ToolDeps): import("../../sdk/index.js").Tool<{
31
34
  path?: string | undefined;
@@ -78,6 +78,7 @@ export declare class Agent {
78
78
  private compacting;
79
79
  private compactorOverride;
80
80
  private lastContextPercent;
81
+ private lastContextTokens;
81
82
  private lastContextUsage;
82
83
  private readonly checkpoints;
83
84
  private recoveryAttempted;
@@ -138,6 +139,7 @@ export declare class Agent {
138
139
  message: string;
139
140
  }>;
140
141
  get contextPercent(): number;
142
+ get contextTokens(): number;
141
143
  run<T>(prompt: string | UserContent[], opts: AgentRunOptions<T> & {
142
144
  output: z.ZodType<T>;
143
145
  }): Promise<RunResult & {
@@ -156,6 +158,8 @@ export declare class Agent {
156
158
  private execute;
157
159
  private executeRun;
158
160
  private providerFor;
161
+ private publishEvent;
162
+ private refreshContextAccounting;
159
163
  private publishToSubscribers;
160
164
  private scheduleAutonomousRun;
161
165
  private scheduleManualCompaction;
@@ -1,6 +1,6 @@
1
1
  export type { Credential, ModelDiscoveryOptions, ModelInfo, Provider, ProviderModelDiscoveryOptions, ThinkingLevel, Usage, } from "../ai/index.js";
2
2
  export { builtinProviderConfigs, defaultModelRef, defaultThinkingLevel, discoverModels, findModel, listModels, providerHasCredentials, refreshModels, registerModels, registerProvider, supportedThinkingLevels, thinkingLevelForModel, } from "../ai/index.js";
3
- export type { AgentEvent, AgentMessage, AnyTool, Command, CommandContext, CommandResult, CustomMessage, Extension, ExtensionAPI, ExtensionEvent, ExtensionEventFor, ExtensionEventType, LifecycleEvent, LifecycleNotification, PermissionMode, PermissionRequest, PermissionRule, ProfileRuntime, ProfileRuntimeHost, SessionStore, StreamDelta, Tool, ToolRenderer, UserContent, } from "../core/index.js";
3
+ export type { AgentEvent, AgentMessage, AnyTool, Command, CommandContext, CommandResult, CustomMessage, Extension, ExtensionAPI, ExtensionEvent, ExtensionEventFor, ExtensionEventType, LifecycleEvent, LifecycleNotification, PermissionMode, PermissionModeTone, PermissionRequest, PermissionRule, ProfileRuntime, ProfileRuntimeHost, SessionStore, StreamDelta, Tool, ToolRenderer, UserContent, } from "../core/index.js";
4
4
  export { CommandRegistry, customMessage, ExtensionHost, errorResult, MemorySessionStore, SessionTree, textResult, userMessage, } from "../core/index.js";
5
5
  export type { AgentOptions, AgentRunOptions, CheckpointActionData, CheckpointActionResult, HaltReason, ManualCompactionResult, RunResult, } from "./agent.js";
6
6
  export { Agent } from "./agent.js";
@@ -5,6 +5,7 @@ export interface ToolDefinition<Schema extends z.ZodType> {
5
5
  name: string;
6
6
  description: string;
7
7
  inputSchema: Schema;
8
+ coerceInput?: (raw: unknown) => unknown;
8
9
  isConcurrencySafe?: (args: z.infer<Schema>) => boolean;
9
10
  executionMode?: "sequential";
10
11
  changesState?: boolean | ((args: z.infer<Schema>) => boolean);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mu-agent/mu",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Mu, a general-purpose extensible AI agent platform for the terminal and TypeScript",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",