@zaly/agent 0.0.3 → 0.0.5

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 (50) hide show
  1. package/dist/{agent-GDLdDc2w.mjs → agent-EkPynZRJ.mjs} +7 -9
  2. package/dist/agent-EkPynZRJ.mjs.map +1 -0
  3. package/dist/{bash-QNMTQ1PD.mjs → bash-COgq4W7U.mjs} +2 -2
  4. package/dist/{bash-QNMTQ1PD.mjs.map → bash-COgq4W7U.mjs.map} +1 -1
  5. package/dist/compactions-3AjPqjeZ.mjs.map +1 -1
  6. package/dist/{fetch-D8cmmA3E.mjs → fetch-DknuSrSX.mjs} +2 -2
  7. package/dist/{fetch-D8cmmA3E.mjs.map → fetch-DknuSrSX.mjs.map} +1 -1
  8. package/dist/{grep-B2Ax7ewy.mjs → grep-B4GF0svc.mjs} +2 -2
  9. package/dist/{grep-B2Ax7ewy.mjs.map → grep-B4GF0svc.mjs.map} +1 -1
  10. package/dist/index-node-esm-D6YQRKEz.mjs.map +1 -1
  11. package/dist/index.d.mts +42 -42
  12. package/dist/index.d.mts.map +1 -1
  13. package/dist/index.mjs +28 -22
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/{jsonl-Dw_VBp46.mjs → jsonl-CvgEOakL.mjs} +2 -2
  16. package/dist/jsonl-CvgEOakL.mjs.map +1 -0
  17. package/dist/{manager-D-lWBTHG.mjs → manager-f-WjFTMX.mjs} +2 -2
  18. package/dist/manager-f-WjFTMX.mjs.map +1 -0
  19. package/dist/masker-Bv9KjkDF.mjs.map +1 -1
  20. package/dist/notify-DpG_m9iP.mjs.map +1 -1
  21. package/dist/{registry-CFmR5G3J.mjs → registry-BVf0aZEA.mjs} +328 -48
  22. package/dist/registry-BVf0aZEA.mjs.map +1 -0
  23. package/dist/session/claude.d.mts +2 -3
  24. package/dist/session/claude.d.mts.map +1 -1
  25. package/dist/session/claude.mjs +1 -1
  26. package/dist/{session-CUUdWFC5.mjs → session-Bv8JiT8P.mjs} +4 -4
  27. package/dist/session-Bv8JiT8P.mjs.map +1 -0
  28. package/dist/session.d.mts +8 -8
  29. package/dist/session.d.mts.map +1 -1
  30. package/dist/session.mjs +3 -3
  31. package/dist/{subagent-baqzjRMc.mjs → subagent-CX7Zjcws.mjs} +3 -3
  32. package/dist/{subagent-baqzjRMc.mjs.map → subagent-CX7Zjcws.mjs.map} +1 -1
  33. package/dist/swarm-BJ3gQA1Z.mjs.map +1 -1
  34. package/dist/{tasks-D8rARHZ1.mjs → tasks-BA-PCeGa.mjs} +4 -3
  35. package/dist/{tasks-D8rARHZ1.mjs.map → tasks-BA-PCeGa.mjs.map} +1 -1
  36. package/dist/{tasks-WmC270X2.mjs → tasks-WdRAHsOL.mjs} +5 -4
  37. package/dist/tasks-WdRAHsOL.mjs.map +1 -0
  38. package/dist/{tools-DW1dbcCz.mjs → tools-Bl-YI890.mjs} +75 -25
  39. package/dist/tools-Bl-YI890.mjs.map +1 -0
  40. package/dist/truncate-BSMXgiXj.mjs.map +1 -1
  41. package/dist/{uuid-ByXP5SO5.mjs → uuid-CAdJg4l8.mjs} +2 -2
  42. package/dist/{uuid-ByXP5SO5.mjs.map → uuid-CAdJg4l8.mjs.map} +1 -1
  43. package/package.json +9 -9
  44. package/dist/agent-GDLdDc2w.mjs.map +0 -1
  45. package/dist/jsonl-Dw_VBp46.mjs.map +0 -1
  46. package/dist/manager-D-lWBTHG.mjs.map +0 -1
  47. package/dist/registry-CFmR5G3J.mjs.map +0 -1
  48. package/dist/session-CUUdWFC5.mjs.map +0 -1
  49. package/dist/tasks-WmC270X2.mjs.map +0 -1
  50. package/dist/tools-DW1dbcCz.mjs.map +0 -1
package/dist/index.d.mts CHANGED
@@ -284,14 +284,14 @@ declare class PermissionManager {
284
284
  }
285
285
  //#endregion
286
286
  //#region src/skills.d.ts
287
- type SkillMeta = {
287
+ export type SkillMeta = {
288
288
  name: string;
289
289
  mtime: number;
290
290
  desc: string;
291
291
  path: string;
292
292
  unchanged?: boolean;
293
293
  };
294
- type SkillTool = Tool<{
294
+ export type SkillTool = Tool<{
295
295
  name: string;
296
296
  }, unknown, SkillMeta>;
297
297
  /**
@@ -318,7 +318,7 @@ type SkillTool = Tool<{
318
318
  * - `skills.tool` returns the current activation tool, or undefined
319
319
  * when the catalog is empty. Lazily built; invalidated on reload.
320
320
  */
321
- interface SkillEntry {
321
+ export interface SkillEntry {
322
322
  name: string;
323
323
  desc: string;
324
324
  mtime: number;
@@ -330,11 +330,11 @@ interface SkillEntry {
330
330
  * resolving references. */
331
331
  dir: string;
332
332
  }
333
- interface SkillsOptions {
333
+ export interface SkillsOptions {
334
334
  /** SKILL.md paths, sorted from highest to lowest precedence. */
335
335
  paths?: string[];
336
336
  }
337
- declare class Skills {
337
+ export declare class Skills {
338
338
  #private;
339
339
  readonly catalog: Map<string, SkillEntry>;
340
340
  protected constructor(opts?: SkillsOptions);
@@ -533,7 +533,7 @@ declare class AgentContext extends Emitter<AgentContextEvents> {
533
533
  permissions(): Promise<PermissionManager>;
534
534
  }
535
535
  declare function createAgentContext(opts: AgentOptions): Promise<AgentContext>;
536
- declare function createAgent(opts: AgentOptions): Promise<Agent>;
536
+ export declare function createAgent(opts: AgentOptions): Promise<Agent>;
537
537
  //#endregion
538
538
  //#region src/tasks.d.ts
539
539
  /** Status of a task. `pending` = queued behind a dependency, not yet
@@ -883,7 +883,7 @@ declare class Agent extends Emitter<AgentEvents> {
883
883
  }
884
884
  //#endregion
885
885
  //#region src/compaction/utils.d.ts
886
- type ToolStat = {
886
+ export type ToolStat = {
887
887
  count: number;
888
888
  score: number;
889
889
  /** Turns ago at the most recent occurrence (0 = current/last turn).
@@ -900,7 +900,7 @@ type ToolStat = {
900
900
  * more than reads. Sort the top-N by `score` to surface the active
901
901
  * working set; `reads` / `writes` / `edits` give the per-kind detail
902
902
  * for display. */
903
- type FileUsage = ToolStat & {
903
+ export type FileUsage = ToolStat & {
904
904
  path: string;
905
905
  reads: number;
906
906
  writes: number;
@@ -910,10 +910,10 @@ type FileUsage = ToolStat & {
910
910
  * is raw invocations; `score` is the same number but exp-decay-weighted
911
911
  * by turn distance from the end of the conversation, so recently-used
912
912
  * commands rank above old hot ones. */
913
- type BashUsage = ToolStat & {
913
+ export type BashUsage = ToolStat & {
914
914
  command: string;
915
915
  };
916
- type ToolStatOptions = {
916
+ export type ToolStatOptions = {
917
917
  minCount?: number;
918
918
  minScore?: number;
919
919
  limit?: number;
@@ -929,22 +929,22 @@ type ToolStatOptions = {
929
929
  * node — relative paths are resolved against the cwd that was active
930
930
  * when the call ran, and `~` is expanded. Calls under different cwds
931
931
  * that target the same file thus collapse into one bucket. */
932
- declare function extractFileUsage(messages: readonly Message[], opts?: ToolStatOptions): FileUsage[];
932
+ export declare function extractFileUsage(messages: readonly Message[], opts?: ToolStatOptions): FileUsage[];
933
933
  /** Walk assistant tool-calls for `bash`, parse each command line, and
934
934
  * tally per-command frecency. Plumbing commands (cat, head, grep, awk,
935
935
  * sed, …) are filtered out — they dominate raw counts but carry no
936
936
  * operational signal a summarizer would describe. Returns the top-N
937
937
  * by frecency `score`. */
938
- declare function extractBashUsage(messages: readonly Message[], opts?: ToolStatOptions): BashUsage[];
938
+ export declare function extractBashUsage(messages: readonly Message[], opts?: ToolStatOptions): BashUsage[];
939
939
  /** Flatten a list of messages into a single tagged transcript. */
940
- declare function extractConversation(messages: readonly Message[], opts?: {
940
+ export declare function extractConversation(messages: readonly Message[], opts?: {
941
941
  maxToolResultLen?: number;
942
942
  }): string;
943
- declare function messageTail(messages: readonly Message[], opts: {
943
+ export declare function messageTail(messages: readonly Message[], opts: {
944
944
  keepTokens?: number;
945
945
  }): Message[];
946
- declare function formatBashUsage(commands: BashUsage[]): string;
947
- declare function formatFileUsage(files: FileUsage[]): string;
946
+ export declare function formatBashUsage(commands: BashUsage[]): string;
947
+ export declare function formatFileUsage(files: FileUsage[]): string;
948
948
  //#endregion
949
949
  //#region src/compaction/compactions.d.ts
950
950
  type CompactionOptions = {
@@ -1010,7 +1010,7 @@ interface PermissionScopes {
1010
1010
  type BuiltinScope = keyof typeof builtin$2;
1011
1011
  type PermissionScope = keyof PermissionScopes;
1012
1012
  type AnyScope = PermissionScope | (string & {});
1013
- declare const handlerRegistry: import("@zaly/shared/registry").Registry<HandlerLoader, {
1013
+ export declare const handlerRegistry: import("@zaly/shared/registry").Registry<HandlerLoader, {
1014
1014
  readonly bash: () => PermissionHandler<"bash">;
1015
1015
  readonly read: () => PermissionHandler<"read" | "write">;
1016
1016
  readonly tool: () => PermissionHandler<"tool">;
@@ -1297,12 +1297,12 @@ interface AgentOptions extends CollectOptions {
1297
1297
  }
1298
1298
  //#endregion
1299
1299
  //#region src/prompt/registry.d.ts
1300
- interface PromptCtx {
1300
+ export interface PromptCtx {
1301
1301
  model: Model;
1302
1302
  cwd: string;
1303
1303
  }
1304
- type PromptLoader = (ctx: PromptCtx) => Promise<string>;
1305
- type Prompt<T extends string | PromptLoader = string | PromptLoader> = {
1304
+ export type PromptLoader = (ctx: PromptCtx) => Promise<string>;
1305
+ export type Prompt<T extends string | PromptLoader = string | PromptLoader> = {
1306
1306
  name: string;
1307
1307
  text: T;
1308
1308
  };
@@ -1313,9 +1313,9 @@ declare const builtin$1: {
1313
1313
  readonly env: (ctx: PromptCtx) => Promise<string>;
1314
1314
  readonly model: (ctx: PromptCtx) => Promise<string>;
1315
1315
  };
1316
- type BuiltinPrompt = keyof typeof builtin$1;
1317
- type AnyPrompt = BuiltinPrompt | (string & {});
1318
- declare const promptRegistry: import("@zaly/shared/registry").Registry<PromptLoader, {
1316
+ export type BuiltinPrompt = keyof typeof builtin$1;
1317
+ export type AnyPrompt = BuiltinPrompt | (string & {});
1318
+ export declare const promptRegistry: import("@zaly/shared/registry").Registry<PromptLoader, {
1319
1319
  readonly "AGENTS.md": (ctx: PromptCtx) => Promise<string>;
1320
1320
  readonly "MEMORY.md": (ctx: PromptCtx) => Promise<string>;
1321
1321
  readonly agent: () => Promise<string>;
@@ -1328,20 +1328,20 @@ declare class PromptCollection extends BaseCollection<AnyPrompt[], Prompt[], Pro
1328
1328
  prompts?: string[];
1329
1329
  }): Promise<Prompt<string>[]>;
1330
1330
  }
1331
- declare function promptCollection(): Promise<PromptCollection>;
1331
+ export declare function promptCollection(): Promise<PromptCollection>;
1332
1332
  //#endregion
1333
1333
  //#region src/tools/registry.d.ts
1334
1334
  /** Per-load context handed to every tool factory. Lets factories
1335
1335
  * customise the tool — typically schema descriptions — based on the
1336
1336
  * agent's model and working directory. Tools that don't care about
1337
1337
  * init just ignore the arg. */
1338
- interface ToolInit {
1338
+ export interface ToolInit {
1339
1339
  model: Model;
1340
1340
  cwd: string;
1341
1341
  }
1342
- type ToolLoader = () => Promise<Tool>;
1343
- type BuiltinTool = keyof typeof builtin;
1344
- type AnyTool = AnyKey<BuiltinTool>;
1342
+ export type ToolLoader = () => Promise<Tool>;
1343
+ export type BuiltinTool = keyof typeof builtin;
1344
+ export type AnyTool = AnyKey<BuiltinTool>;
1345
1345
  declare const builtin: {
1346
1346
  readonly agent_send: () => Promise<Tool<unknown, unknown, object>>;
1347
1347
  readonly agent_spawn: () => Promise<Tool<unknown, unknown, object>>;
@@ -1359,7 +1359,7 @@ declare const builtin: {
1359
1359
  readonly wakeup: () => Promise<Tool<unknown, unknown, object>>;
1360
1360
  readonly write: () => Promise<Tool<unknown, unknown, object>>;
1361
1361
  };
1362
- declare const toolRegistry: import("@zaly/shared/registry").Registry<ToolLoader, {
1362
+ export declare const toolRegistry: import("@zaly/shared/registry").Registry<ToolLoader, {
1363
1363
  readonly agent_send: () => Promise<Tool<unknown, unknown, object>>;
1364
1364
  readonly agent_spawn: () => Promise<Tool<unknown, unknown, object>>;
1365
1365
  readonly bash: () => Promise<Tool<unknown, unknown, object>>;
@@ -1380,7 +1380,7 @@ declare class ToolCollection extends BaseCollection<AnyTool[], AnyTool[], Tool>
1380
1380
  list(): AnyTool[];
1381
1381
  load(tools?: AnyTool[]): Promise<Tool[]>;
1382
1382
  }
1383
- declare function toolCollection(): Promise<ToolCollection>;
1383
+ export declare function toolCollection(): Promise<ToolCollection>;
1384
1384
  //#endregion
1385
1385
  //#region src/tools/bash.d.ts
1386
1386
  type BashTool = typeof bashTool;
@@ -1546,19 +1546,19 @@ declare const writeTool: import("@zaly/ai").Tool<{
1546
1546
  * `uuid` package's v7 implementation, just without the buffer/offset
1547
1547
  * ceremony — we only ever want the canonical string form.
1548
1548
  */
1549
- declare function uuidv7(): string;
1550
- declare function isUuidv7(s: string): boolean;
1551
- declare function isUuidv7Like(s: string): boolean;
1549
+ export declare function uuidv7(): string;
1550
+ export declare function isUuidv7(s: string): boolean;
1551
+ export declare function isUuidv7Like(s: string): boolean;
1552
1552
  //#endregion
1553
1553
  //#region src/commands.d.ts
1554
- type Command = {
1554
+ export type Command = {
1555
1555
  name: string;
1556
1556
  body: string;
1557
1557
  path: string;
1558
1558
  description?: string;
1559
1559
  args: ArgsOpts;
1560
1560
  };
1561
- interface CommandsOptions {
1561
+ export interface CommandsOptions {
1562
1562
  /** cmd.md paths, sorted from highest to lowest precedence. */
1563
1563
  paths?: string[];
1564
1564
  logger?: Logger;
@@ -1570,7 +1570,7 @@ interface CommandsOptions {
1570
1570
  /** When `false`, template expressions are disabled and only simple variable interpolation is allowed. */
1571
1571
  expr?: boolean;
1572
1572
  }
1573
- declare class Commands {
1573
+ export declare class Commands {
1574
1574
  #private;
1575
1575
  readonly catalog: Map<string, Command>;
1576
1576
  constructor(opts?: CommandsOptions);
@@ -1581,25 +1581,25 @@ declare class Commands {
1581
1581
  }
1582
1582
  //#endregion
1583
1583
  //#region src/context/tokens.d.ts
1584
- type TokenCount = {
1584
+ export type TokenCount = {
1585
1585
  type: AnyType | Message["role"] | "prompt" | "tool-schema" | "system-prompt";
1586
1586
  kind?: string;
1587
1587
  tokens: number;
1588
1588
  children?: TokenCount[];
1589
1589
  };
1590
- type TokenStats = {
1590
+ export type TokenStats = {
1591
1591
  key: string;
1592
1592
  tokens: number;
1593
1593
  count: number;
1594
1594
  children?: Map<string, TokenStats>;
1595
1595
  };
1596
- declare function estimatePart(p: AnyPart): TokenCount;
1597
- declare function tokenStats(msgs: readonly Message[], opts?: {
1596
+ export declare function estimatePart(p: AnyPart): TokenCount;
1597
+ export declare function tokenStats(msgs: readonly Message[], opts?: {
1598
1598
  prompt?: (string | Prompt<string>)[];
1599
1599
  tools?: Tool[];
1600
1600
  expand?: (c: TokenCount) => boolean;
1601
1601
  }): TokenStats;
1602
- declare function formatTokenStats(s: TokenStats, indent?: number): string;
1602
+ export declare function formatTokenStats(s: TokenStats, indent?: number): string;
1603
1603
  //#endregion
1604
- export { type Agent, type AgentContext, type AgentContextEvents, type AgentEvents, type AgentInit, type AgentOptions, type AgentStatus, type AgentStop, type AgentStopKind, AnyPrompt, type AnyScope, AnyTool, type BashTool, BashUsage, BuiltinPrompt, type BuiltinScope, BuiltinTool, type CheckResult, Command, Commands, CommandsOptions, type ContextPressure, type DoneTaskInfo, type EditTool, type EditToolMeta, FileUsage, type FindTool, type FindToolMeta, type GrepTool, type GrepToolMeta, type PermissionContext, type PermissionHandler, type PermissionManager, type PermissionOptions, type PermissionPreset, type PermissionPresetName, type PermissionRequest, type PermissionScope, type PermissionScopes, Prompt, type PromptCollection, PromptCtx, PromptLoader, type ReadTool, type ReadToolMeta, type Rule, type SendMode, SkillEntry, SkillMeta, SkillTool, Skills, SkillsOptions, type StepKind, type StepResult, type StopOptions, type StopPolicy, type Suggestion, type TaskInfo, type TaskMeta, type TaskStatus, type Tasks, type TasksEvents, TokenCount, TokenStats, type TokenUsage, type ToolCollection, ToolInit, ToolLoader, ToolStat, ToolStatOptions, type TurnResult, type Verdict, type WriteTool, type WriteToolMeta, type addUsage, createAgent, type createAgentContext, estimatePart, extractBashUsage, extractConversation, extractFileUsage, formatBashUsage, formatFileUsage, formatTokenStats, handlerRegistry, isUuidv7, isUuidv7Like, messageTail, promptCollection, promptRegistry, type taskCompletionMessage, type taskInfoPart, tokenStats, toolCollection, toolRegistry, uuidv7 };
1604
+ export type { Agent, AgentContext, AgentContextEvents, AgentEvents, AgentInit, AgentOptions, AgentStatus, AgentStop, AgentStopKind, AnyScope, BashTool, BuiltinScope, CheckResult, ContextPressure, DoneTaskInfo, EditTool, EditToolMeta, FindTool, FindToolMeta, GrepTool, GrepToolMeta, PermissionContext, PermissionHandler, PermissionManager, PermissionOptions, PermissionPreset, PermissionPresetName, PermissionRequest, PermissionScope, PermissionScopes, PromptCollection, ReadTool, ReadToolMeta, Rule, SendMode, StepKind, StepResult, StopOptions, StopPolicy, Suggestion, TaskInfo, TaskMeta, TaskStatus, Tasks, TasksEvents, TokenUsage, ToolCollection, TurnResult, Verdict, WriteTool, WriteToolMeta, addUsage, createAgentContext, taskCompletionMessage, taskInfoPart };
1605
1605
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/events.ts","../src/masker.ts","../src/permissions/types.ts","../src/permissions/presets.ts","../src/permissions/manager.ts","../src/skills.ts","../src/swarm.ts","../src/ctx.ts","../src/tasks.ts","../src/utils/usage.ts","../src/agent.ts","../src/compaction/utils.ts","../src/compaction/compactions.ts","../src/notify.ts","../src/permissions/handlers/registry.ts","../src/stop.ts","../src/types.ts","../src/prompt/registry.ts","../src/tools/registry.ts","../src/tools/bash.ts","../src/tools/read.ts","../src/tools/edit.ts","../src/tools/find.ts","../src/tools/grep.ts","../src/tools/write.ts","../src/utils/uuid.ts","../src/commands.ts","../src/context/tokens.ts"],"mappings":";;;;;;;;;;;KAOY;;;KAIA;;;;KAcA;KAEA;EACV,MAAM;EACN;EACA,QAAQ;;;;;;;;KASE;EACV;IAAU,QAAQ;;EAClB;EACA;IAAkB,OAAO;;EACzB;IAAe,MAAM;;EACrB;IAAgB,OAAO;;EACvB;IAAiB,MAAM;IAAc,QAAQ;;EAC7C;IAAgB;;EAChB;IAAc;IAAc,SAAS;;EACrC;IAAgB;;EAChB;IAAc;IAAc,SAAS;IAAe;;EACpD,MAAM;I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O,gBAAgB,YAAY,KAAK,UAAU;;;;KC3F9C;EACV,MAAM,UAAU;EAChB;EACA;EACA,WAAW;;KAGD;EACV;EACA;EACA;EACA,WAAW,YAAY;;iBAsBT,aAAa,GAAG,UAAU;iBAgH1B,WACd,eAAe,WACf;EACE,mBAAmB;EACnB,QAAQ;EACR,UAAU,GAAG;IAEd;iBAoBa,iBAAiB,GAAG,YAAY"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/events.ts","../src/masker.ts","../src/permissions/types.ts","../src/permissions/presets.ts","../src/permissions/manager.ts","../src/skills.ts","../src/swarm.ts","../src/ctx.ts","../src/tasks.ts","../src/utils/usage.ts","../src/agent.ts","../src/compaction/utils.ts","../src/compaction/compactions.ts","../src/notify.ts","../src/permissions/handlers/registry.ts","../src/stop.ts","../src/types.ts","../src/prompt/registry.ts","../src/tools/registry.ts","../src/tools/bash.ts","../src/tools/read.ts","../src/tools/edit.ts","../src/tools/find.ts","../src/tools/grep.ts","../src/tools/write.ts","../src/utils/uuid.ts","../src/commands.ts","../src/context/tokens.ts"],"mappings":";;;;;;;;;;;KAOY;;;KAIA;;;;KAcA;KAEA;EACV,MAAM;EACN;EACA,QAAQ;;;;;;;;KASE;EACV;IAAU,QAAQ;;EAClB;EACA;IAAkB,OAAO;;EACzB;IAAe,MAAM;;EACrB;IAAgB,OAAO;;EACvB;IAAiB,MAAM;IAAc,QAAQ;;EAC7C;IAAgB;;EAChB;IAAc;IAAc,SAAS;;EACrC;IAAgB;;EAChB;IAAc;IAAc,SAAS;IAAe;;EACpD,MAAM;IACJ,OAAO;IACP,QAAQ;;EAEV;IAAW;IAAkB,OAAO;IAAQ,UAAU;;EACtD;IAAW,UAAU;;;;;;KC5CX;EACV;;;;;EAKA;;;EAGA;;;EAGA;;EAEA;;KAGU;EACV;EACA;EACA;EACA,QAAQ;EACR;;;;;;;;;;;;;;;;;cA0BW;;EAOX,YAAY,OAAO,OAAO,OAAM,YAAY;MAWxC;EAoBJ;MAMI,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,iBAAiB,GAAG,YAAY"}
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { i as __exportAll, n as parseBash, t as TOOLS } from "./tools-DW1dbcCz.mjs";
2
- import { t as handlerRegistry } from "./registry-CFmR5G3J.mjs";
3
- import { n as isUuidv7Like, r as uuidv7, t as isUuidv7 } from "./uuid-ByXP5SO5.mjs";
1
+ import { i as __exportAll, n as parseBash, t as TOOLS } from "./tools-Bl-YI890.mjs";
2
+ import { t as handlerRegistry } from "./registry-BVf0aZEA.mjs";
3
+ import { n as isUuidv7Like, r as uuidv7, t as isUuidv7 } from "./uuid-CAdJg4l8.mjs";
4
4
  import { Emitter, formatDuration, isInstance, normPath, prettyPath, safeReadFile, safeStatAsync, safeStringify, toError } from "@zaly/shared";
5
5
  import { LazyCache } from "@zaly/shared/cache";
6
6
  import { BaseCollection } from "@zaly/shared/collection";
@@ -116,10 +116,12 @@ var AgentContext = class extends Emitter {
116
116
  const prev = this.#session;
117
117
  this.#session = s;
118
118
  const modelId = s.settings.modelId;
119
- if (modelId && modelId !== this.model?.id) if (this.#opts.loadModel) this.model = await this.#opts.loadModel(modelId);
120
- else {
121
- const { loadModel } = await import("@zaly/ai");
122
- this.model = await loadModel(modelId);
119
+ if (modelId && modelId !== this.model?.id) {
120
+ if (this.#opts.loadModel) this.model = await this.#opts.loadModel(modelId);
121
+ else {
122
+ const { loadModel } = await import("@zaly/ai");
123
+ this.model = await loadModel(modelId);
124
+ }
123
125
  }
124
126
  this.cwd = s.settings.cwd ?? this.cwd;
125
127
  this.reasoning = s.settings.reasoning ?? this.reasoning;
@@ -185,7 +187,7 @@ var AgentContext = class extends Emitter {
185
187
  }
186
188
  async permissions() {
187
189
  return this.#cache.need("permissions", async (opts) => {
188
- const { PermissionManager } = await import("./manager-D-lWBTHG.mjs");
190
+ const { PermissionManager } = await import("./manager-f-WjFTMX.mjs");
189
191
  return new PermissionManager({
190
192
  ...opts,
191
193
  cwd: this.cwd
@@ -196,7 +198,7 @@ var AgentContext = class extends Emitter {
196
198
  async function loadSession(spec) {
197
199
  if (isInstance(spec)) return spec;
198
200
  else {
199
- const { Session } = await import("./session-CUUdWFC5.mjs").then((n) => n.n);
201
+ const { Session } = await import("./session-Bv8JiT8P.mjs").then((n) => n.n);
200
202
  return await Session.load({ ...spec });
201
203
  }
202
204
  }
@@ -208,7 +210,7 @@ async function createAgentContext(opts) {
208
210
  });
209
211
  }
210
212
  async function createAgent(opts) {
211
- const [{ Agent }, ctx] = await Promise.all([import("./agent-GDLdDc2w.mjs"), createAgentContext(opts)]);
213
+ const [{ Agent }, ctx] = await Promise.all([import("./agent-EkPynZRJ.mjs"), createAgentContext(opts)]);
212
214
  return new Agent(ctx);
213
215
  }
214
216
  const promptRegistry = createRegistry("prompt").from({
@@ -255,17 +257,17 @@ async function promptCollection() {
255
257
  const toolRegistry = createRegistry("tool").from({
256
258
  agent_send: () => import("./swarm-BuFx_xeY.mjs").then((m) => m.agentSendTool),
257
259
  agent_spawn: () => import("./swarm-BuFx_xeY.mjs").then((m) => m.agentSpawnTool),
258
- bash: () => import("./bash-QNMTQ1PD.mjs").then((m) => m.bashTool),
260
+ bash: () => import("./bash-COgq4W7U.mjs").then((m) => m.bashTool),
259
261
  edit: () => import("./edit-Qxl4w1C2.mjs").then((m) => m.editTool),
260
- fetch: () => import("./fetch-D8cmmA3E.mjs").then((m) => m.fetchTool),
262
+ fetch: () => import("./fetch-DknuSrSX.mjs").then((m) => m.fetchTool),
261
263
  find: () => import("./find-Bah9SKWX.mjs").then((m) => m.findTool),
262
- grep: () => import("./grep-B2Ax7ewy.mjs").then((m) => m.grepTool),
264
+ grep: () => import("./grep-B4GF0svc.mjs").then((m) => m.grepTool),
263
265
  read: () => import("./read-Djsx2NZl.mjs").then((m) => m.readTool),
264
266
  search: () => import("./search-CRw247ES.mjs").then((m) => m.searchTool),
265
- subagent: () => import("./subagent-baqzjRMc.mjs").then((m) => m.subagentTool),
266
- task_list: () => import("./tasks-D8rARHZ1.mjs").then((m) => m.taskListTool),
267
- task_poll: () => import("./tasks-D8rARHZ1.mjs").then((m) => m.taskPollTool),
268
- task_stop: () => import("./tasks-D8rARHZ1.mjs").then((m) => m.taskStopTool),
267
+ subagent: () => import("./subagent-CX7Zjcws.mjs").then((m) => m.subagentTool),
268
+ task_list: () => import("./tasks-BA-PCeGa.mjs").then((m) => m.taskListTool),
269
+ task_poll: () => import("./tasks-BA-PCeGa.mjs").then((m) => m.taskPollTool),
270
+ task_stop: () => import("./tasks-BA-PCeGa.mjs").then((m) => m.taskStopTool),
269
271
  wakeup: () => import("./wakeup-BYqTnfSp.mjs").then((m) => m.wakeupTool),
270
272
  write: () => import("./write-D3L-92vj.mjs").then((m) => m.writeTool)
271
273
  });
@@ -614,7 +616,7 @@ function turnInfo(messages) {
614
616
  function toolStats(map, opts = {}) {
615
617
  const limit = opts.limit ?? 50;
616
618
  const sorter = sorters[opts.sort ?? "score"];
617
- return [...map.entries()].toSorted(sorter).map(([_, stat]) => stat).filter((stat) => stat.count >= (opts.minCount ?? 1)).filter((stat) => stat.score >= (opts.minScore ?? 0)).slice(0, limit);
619
+ return [...map.entries()].toSorted(sorter).map(([, stat]) => stat).filter((stat) => stat.count >= (opts.minCount ?? 1)).filter((stat) => stat.score >= (opts.minScore ?? 0)).slice(0, limit);
618
620
  }
619
621
  /** Walk assistant tool-calls for `read` / `write` / `edit` and tally
620
622
  * per-path activity with frecency-weighted scoring. Returns the top-N
@@ -735,14 +737,16 @@ function extractConversation(messages, opts = {}) {
735
737
  text: m.content,
736
738
  type: "text"
737
739
  }] : m.content;
738
- const text = stringifyContent(transform.runSync(parts)).trim();
740
+ const transformed = transform.runSync(parts);
741
+ const text = stringifyContent(transformed).trim();
739
742
  if (!text) continue;
740
743
  let currentRole = m.role.charAt(0).toUpperCase() + m.role.slice(1);
741
744
  currentRole = currentRole === "Tool" ? "Assistant" : currentRole;
742
745
  blocks.push(role === currentRole ? text : `\n[${currentRole}]: ${text}`);
743
746
  role = currentRole;
744
747
  }
745
- return toXml(blocks.join("\n").replace(/^\s+$/gm, "").trim(), "conversation", { indent: false });
748
+ const text = blocks.join("\n").replace(/^\s+$/gm, "").trim();
749
+ return toXml(text, "conversation", { indent: false });
746
750
  }
747
751
  function messageTail(messages, opts) {
748
752
  const maxTokens = opts.keepTokens ?? 2e4;
@@ -773,7 +777,8 @@ function formatBashUsage(commands) {
773
777
  lines.push("=== Top bash commands (sorted by frecency) ===");
774
778
  lines.push(` ${"score".padStart(7)} ${"count".padStart(5)} ${"last".padEnd(14)} command`);
775
779
  for (const c of commands) lines.push(` ${c.score.toFixed(2).padStart(7)} ${String(c.count).padStart(5)} ${lastCol(c.lastTurn, c.lastTs).padEnd(14)} ${c.command}`);
776
- return toXml(lines.join("\n"), "bash-commands", { indent: false });
780
+ const text = lines.join("\n");
781
+ return toXml(text, "bash-commands", { indent: false });
777
782
  }
778
783
  function formatFileUsage(files) {
779
784
  if (files.length === 0) return "(no file ops found)";
@@ -784,7 +789,8 @@ function formatFileUsage(files) {
784
789
  const rwe = `${f.reads}/${f.writes}/${f.edits}`.padEnd(12);
785
790
  lines.push(` ${f.score.toFixed(2).padStart(7)} ${String(f.count).padStart(5)} ${rwe} ${lastCol(f.lastTurn, f.lastTs).padEnd(14)} ${f.path}`);
786
791
  }
787
- return toXml(lines.join("\n"), "files", { indent: false });
792
+ const text = lines.join("\n");
793
+ return toXml(text, "files", { indent: false });
788
794
  }
789
795
  //#endregion
790
796
  //#region src/context/tokens.ts