@duckmind/dm-darwin-arm64 0.36.5 → 0.36.8

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 (110) hide show
  1. package/dm +0 -0
  2. package/extensions/.dm-extensions.json +1 -1
  3. package/extensions/dm-9router-ext/package.json +1 -1
  4. package/extensions/dm-9router-ext/src/index.ts +1 -1
  5. package/extensions/dm-ask-user/README.md +3 -3
  6. package/extensions/dm-ask-user/index.ts +2 -2
  7. package/extensions/dm-ask-user/package.json +4 -4
  8. package/extensions/dm-cli-anything/package.json +1 -1
  9. package/extensions/dm-context/package.json +1 -1
  10. package/extensions/dm-context/src/context.ts +2 -2
  11. package/extensions/dm-context/src/index.ts +3 -3
  12. package/extensions/dm-cua/package.json +2 -2
  13. package/extensions/dm-goal/package.json +6 -6
  14. package/extensions/dm-goal/src/commands.ts +1 -1
  15. package/extensions/dm-goal/src/index.ts +1 -1
  16. package/extensions/dm-goal/src/tools.ts +2 -2
  17. package/extensions/dm-goal/test/index.test.ts +1 -1
  18. package/extensions/dm-image2/index.js +1 -1
  19. package/extensions/dm-image2/package.json +2 -2
  20. package/extensions/dm-image2/src/image-lib.mjs +1 -1
  21. package/extensions/dm-last30days/package.json +1 -1
  22. package/extensions/dm-subagents/CHANGELOG.md +2 -2
  23. package/extensions/dm-subagents/node_modules/.package-lock.json +9 -0
  24. package/extensions/dm-subagents/package-lock.json +136 -2935
  25. package/extensions/dm-subagents/package.json +6 -6
  26. package/extensions/dm-subagents/src/agent-manager.ts +2 -2
  27. package/extensions/dm-subagents/src/agent-record.ts +1 -1
  28. package/extensions/dm-subagents/src/agent-runner.ts +2 -2
  29. package/extensions/dm-subagents/src/context.ts +1 -1
  30. package/extensions/dm-subagents/src/custom-agents.ts +1 -1
  31. package/extensions/dm-subagents/src/execution-state.ts +1 -1
  32. package/extensions/dm-subagents/src/index.ts +2 -2
  33. package/extensions/dm-subagents/src/parent-snapshot.ts +1 -1
  34. package/extensions/dm-subagents/src/renderer.ts +1 -1
  35. package/extensions/dm-subagents/src/service-adapter.ts +1 -1
  36. package/extensions/dm-subagents/src/settings.ts +1 -1
  37. package/extensions/dm-subagents/src/skill-loader.ts +1 -1
  38. package/extensions/dm-subagents/src/tools/agent-tool.ts +2 -2
  39. package/extensions/dm-subagents/src/tools/foreground-runner.ts +1 -1
  40. package/extensions/dm-subagents/src/tools/get-result-tool.ts +1 -1
  41. package/extensions/dm-subagents/src/tools/spawn-config.ts +1 -1
  42. package/extensions/dm-subagents/src/tools/steer-tool.ts +1 -1
  43. package/extensions/dm-subagents/src/types.ts +1 -1
  44. package/extensions/dm-subagents/src/ui/agent-config-editor.ts +1 -1
  45. package/extensions/dm-subagents/src/ui/agent-creation-wizard.ts +1 -1
  46. package/extensions/dm-subagents/src/ui/agent-menu.ts +1 -1
  47. package/extensions/dm-subagents/src/ui/conversation-viewer.ts +2 -2
  48. package/extensions/dm-subagents/src/ui/widget-renderer.ts +1 -1
  49. package/extensions/dm-subagents/test/agent-runner.test.ts +1 -1
  50. package/extensions/dm-subagents/test/conversation-viewer.test.ts +6 -6
  51. package/extensions/dm-subagents/test/custom-agents.test.ts +6 -6
  52. package/extensions/dm-subagents/test/helpers/mock-session.ts +1 -1
  53. package/extensions/dm-subagents/test/helpers/stub-ctx.ts +1 -1
  54. package/extensions/dm-subagents/test/parent-snapshot.test.ts +1 -1
  55. package/extensions/dm-subagents/test/settings.test.ts +5 -5
  56. package/extensions/dm-subagents/test/skill-loader.test.ts +5 -5
  57. package/extensions/dm-subagents/test/unit/subagent-contract.test.ts +5 -3
  58. package/extensions/dm-tasks/node_modules/.package-lock.json +3 -3
  59. package/extensions/dm-tasks/node_modules/typebox/build/type/action/conditional.d.mts +2 -3
  60. package/extensions/dm-tasks/node_modules/typebox/build/type/action/conditional.mjs +2 -1
  61. package/extensions/dm-tasks/node_modules/typebox/build/type/action/mapped.d.mts +2 -3
  62. package/extensions/dm-tasks/node_modules/typebox/build/type/action/mapped.mjs +2 -1
  63. package/extensions/dm-tasks/node_modules/typebox/build/type/engine/call/instantiate.d.mts +1 -3
  64. package/extensions/dm-tasks/node_modules/typebox/build/type/engine/call/instantiate.mjs +3 -2
  65. package/extensions/dm-tasks/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +3 -4
  66. package/extensions/dm-tasks/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +2 -1
  67. package/extensions/dm-tasks/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +2 -5
  68. package/extensions/dm-tasks/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +3 -2
  69. package/extensions/dm-tasks/node_modules/typebox/build/type/engine/instantiate.d.mts +5 -5
  70. package/extensions/dm-tasks/node_modules/typebox/build/type/engine/instantiate.mjs +4 -1
  71. package/extensions/dm-tasks/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +3 -6
  72. package/extensions/dm-tasks/node_modules/typebox/build/type/engine/module/instantiate.d.mts +1 -3
  73. package/extensions/dm-tasks/node_modules/typebox/build/type/engine/module/instantiate.mjs +2 -1
  74. package/extensions/dm-tasks/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +3 -4
  75. package/extensions/dm-tasks/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +2 -1
  76. package/extensions/dm-tasks/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +3 -3
  77. package/extensions/dm-tasks/node_modules/typebox/build/type/engine/ref/instantiate.mjs +6 -6
  78. package/extensions/dm-tasks/node_modules/typebox/build/type/extends/tuple.d.mts +3 -6
  79. package/extensions/dm-tasks/node_modules/typebox/build/type/extends/tuple.mjs +3 -2
  80. package/extensions/dm-tasks/node_modules/typebox/build/type/script/script.d.mts +3 -4
  81. package/extensions/dm-tasks/node_modules/typebox/build/type/script/script.mjs +3 -2
  82. package/extensions/dm-tasks/node_modules/typebox/build/type/types/call.d.mts +3 -3
  83. package/extensions/dm-tasks/node_modules/typebox/build/type/types/call.mjs +3 -2
  84. package/extensions/dm-tasks/node_modules/typebox/package.json +1 -1
  85. package/extensions/dm-tasks/package-lock.json +3 -3
  86. package/extensions/dm-tasks/src/index.ts +1 -1
  87. package/extensions/dm-tasks/src/ui/settings-menu.ts +2 -2
  88. package/extensions/dm-tasks/src/ui/task-widget.ts +1 -1
  89. package/extensions/dm-ultradex/AGENTS.md +2 -2
  90. package/extensions/dm-ultradex/account-manager.test.ts +1 -1
  91. package/extensions/dm-ultradex/account-manager.ts +1 -1
  92. package/extensions/dm-ultradex/auth.ts +1 -1
  93. package/extensions/dm-ultradex/browser.ts +1 -1
  94. package/extensions/dm-ultradex/commands.ts +4 -4
  95. package/extensions/dm-ultradex/extension.ts +2 -2
  96. package/extensions/dm-ultradex/index.test.ts +5 -3
  97. package/extensions/dm-ultradex/node_modules/.package-lock.json +9 -0
  98. package/extensions/dm-ultradex/package-lock.json +124 -2520
  99. package/extensions/dm-ultradex/package.json +7 -7
  100. package/extensions/dm-ultradex/provider.ts +2 -2
  101. package/extensions/dm-ultradex/refresh-race.test.ts +2 -2
  102. package/extensions/dm-ultradex/status.ts +4 -4
  103. package/extensions/dm-ultradex/stream-wrapper.ts +1 -1
  104. package/extensions/dm-usage/index.ts +3 -3
  105. package/extensions/dm-usage/package.json +4 -4
  106. package/extensions/greedysearch-dm/index.ts +1 -1
  107. package/extensions/greedysearch-dm/package-lock.json +2 -2
  108. package/extensions/greedysearch-dm/package.json +2 -2
  109. package/extensions/greedysearch-dm/src/tools/greedy-search-handler.ts +2 -2
  110. package/package.json +1 -1
@@ -51,9 +51,9 @@
51
51
  "@sinclair/typebox": "^0.34.49"
52
52
  },
53
53
  "peerDependencies": {
54
- "@mariozechner/pi-ai": ">=0.72.1",
55
- "@mariozechner/pi-coding-agent": ">=0.72.1",
56
- "@mariozechner/pi-tui": ">=0.72.1"
54
+ "@earendil-works/pi-ai": ">=0.72.1",
55
+ "@earendil-works/pi-coding-agent": ">=0.72.1",
56
+ "@earendil-works/pi-tui": ">=0.72.1"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@biomejs/biome": "^2.4.14",
@@ -61,8 +61,8 @@
61
61
  "rumdl": "^0.1.93",
62
62
  "typescript": "^6.0.0",
63
63
  "vitest": "^4.0.18",
64
- "@mariozechner/pi-ai": "0.73.1",
65
- "@mariozechner/pi-coding-agent": "0.73.1",
66
- "@mariozechner/pi-tui": "0.73.1"
64
+ "@earendil-works/pi-ai": "file:../../pi-mono/packages/ai",
65
+ "@earendil-works/pi-coding-agent": "file:../../pi-mono/packages/coding-agent",
66
+ "@earendil-works/pi-tui": "file:../../pi-mono/packages/tui"
67
67
  }
68
68
  }
@@ -7,8 +7,8 @@
7
7
  */
8
8
 
9
9
  import { randomUUID } from "node:crypto";
10
- import type { Model } from "@mariozechner/pi-ai";
11
- import type { AgentSession } from "@mariozechner/pi-coding-agent";
10
+ import type { Model } from "@earendil-works/pi-ai";
11
+ import type { AgentSession } from "@earendil-works/pi-coding-agent";
12
12
  import { AgentRecord } from "./agent-record.js";
13
13
  import type { AgentRunner } from "./agent-runner.js";
14
14
  import { AgentTypeRegistry } from "./agent-types.js";
@@ -12,7 +12,7 @@
12
12
  * after construction as lifecycle information becomes available.
13
13
  */
14
14
 
15
- import type { AgentSession } from "@mariozechner/pi-coding-agent";
15
+ import type { AgentSession } from "@earendil-works/pi-coding-agent";
16
16
  import type { ExecutionState } from "./execution-state.js";
17
17
  import type { NotificationState } from "./notification-state.js";
18
18
  import type { AgentInvocation, SubagentType } from "./types.js";
@@ -2,12 +2,12 @@
2
2
  * agent-runner.ts — Core execution engine: creates sessions, runs agents, collects results.
3
3
  */
4
4
 
5
- import type { Model } from "@mariozechner/pi-ai";
5
+ import type { Model } from "@earendil-works/pi-ai";
6
6
  import {
7
7
  type AgentSession,
8
8
  type AgentSessionEvent,
9
9
  type SettingsManager,
10
- } from "@mariozechner/pi-coding-agent";
10
+ } from "@earendil-works/pi-coding-agent";
11
11
  import type { AgentConfigLookup } from "./agent-types.js";
12
12
  import { extractText } from "./context.js";
13
13
  import type { EnvInfo } from "./env.js";
@@ -2,7 +2,7 @@
2
2
  * context.ts — Extract parent conversation context for subagent inheritance.
3
3
  */
4
4
 
5
- import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
5
+ import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
6
6
 
7
7
  /** Extract text from a message content block array. */
8
8
  export function extractText(content: unknown[]): string {
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { existsSync, readdirSync, readFileSync } from "node:fs";
6
6
  import { basename, join } from "node:path";
7
- import { getAgentDir, parseFrontmatter } from "@mariozechner/pi-coding-agent";
7
+ import { getAgentDir, parseFrontmatter } from "@earendil-works/pi-coding-agent";
8
8
  import { BUILTIN_TOOL_NAMES } from "./agent-types.js";
9
9
  import { debugLog } from "./debug.js";
10
10
  import type { AgentConfig, MemoryScope, ThinkingLevel } from "./types.js";
@@ -7,7 +7,7 @@
7
7
  * it is set at a different moment (after runner.run() returns).
8
8
  */
9
9
 
10
- import type { AgentSession } from "@mariozechner/pi-coding-agent";
10
+ import type { AgentSession } from "@earendil-works/pi-coding-agent";
11
11
 
12
12
  export interface ExecutionState {
13
13
  /** The active agent session — available from the moment the session is created. */
@@ -19,7 +19,7 @@ import {
19
19
  getAgentDir,
20
20
  SettingsManager as SdkSettingsManager,
21
21
  SessionManager,
22
- } from "@mariozechner/pi-coding-agent";
22
+ } from "@earendil-works/pi-coding-agent";
23
23
  import { AgentManager, type AgentManagerObserver } from "./agent-manager.js";
24
24
  import { createAgentRunner, getAgentConversation, type RunnerIO, steerAgent } from "./agent-runner.js";
25
25
  import { AgentTypeRegistry } from "./agent-types.js";
@@ -212,7 +212,7 @@ export default function (pi: ExtensionAPI) {
212
212
  settings,
213
213
  buildSnapshot: (inheritContext) =>
214
214
  buildParentSnapshot(
215
- runtime.currentCtx?.ctx as import("@mariozechner/pi-coding-agent").ExtensionContext,
215
+ runtime.currentCtx?.ctx as import("@earendil-works/pi-coding-agent").ExtensionContext,
216
216
  inheritContext,
217
217
  ),
218
218
  getModelInfo: () => ({
@@ -2,7 +2,7 @@
2
2
  * parent-snapshot.ts — Capture parent session state as a plain data snapshot.
3
3
  */
4
4
 
5
- import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
5
+ import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
6
6
  import { buildParentContext } from "./context.js";
7
7
 
8
8
  /**
@@ -1,4 +1,4 @@
1
- import { Text } from "@mariozechner/pi-tui";
1
+ import { Text } from "@earendil-works/pi-tui";
2
2
  import type { NotificationDetails } from "./notification.js";
3
3
  import { formatMs, formatTokens, formatTurns } from "./ui/display.js";
4
4
 
@@ -5,7 +5,7 @@
5
5
  * (stripping non-serializable fields), and session gating.
6
6
  */
7
7
 
8
- import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
8
+ import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
9
9
  import type { ModelRegistry } from "./model-resolver.js";
10
10
  import type { ParentSnapshot } from "./parent-snapshot.js";
11
11
  import { buildParentSnapshot } from "./parent-snapshot.js";
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
6
6
  import { dirname, join } from "node:path";
7
- import { getAgentDir } from "@mariozechner/pi-coding-agent";
7
+ import { getAgentDir } from "@earendil-works/pi-coding-agent";
8
8
  export interface SubagentsSettings {
9
9
  maxConcurrent?: number;
10
10
  /**
@@ -22,7 +22,7 @@ import type { Dirent } from "node:fs";
22
22
  import { existsSync, readdirSync } from "node:fs";
23
23
  import { homedir } from "node:os";
24
24
  import { join } from "node:path";
25
- import { getAgentDir } from "@mariozechner/pi-coding-agent";
25
+ import { getAgentDir } from "@earendil-works/pi-coding-agent";
26
26
  import { debugLog } from "./debug.js";
27
27
  import { isSymlink, isUnsafeName, safeReadFile } from "./memory.js";
28
28
 
@@ -1,5 +1,5 @@
1
- import type { AgentToolResult } from "@mariozechner/pi-coding-agent";
2
- import { Text } from "@mariozechner/pi-tui";
1
+ import type { AgentToolResult } from "@earendil-works/pi-coding-agent";
2
+ import { Text } from "@earendil-works/pi-tui";
3
3
  import { Type } from "@sinclair/typebox";
4
4
  import type { AgentSpawnConfig } from "../agent-manager.js";
5
5
  import { AgentTypeRegistry } from "../agent-types.js";
@@ -1,4 +1,4 @@
1
- import type { AgentToolResult } from "@mariozechner/pi-coding-agent";
1
+ import type { AgentToolResult } from "@earendil-works/pi-coding-agent";
2
2
  import type { AgentSpawnConfig } from "../agent-manager.js";
3
3
  import type { ParentSnapshot } from "../parent-snapshot.js";
4
4
  import type { AgentRecord } from "../types.js";
@@ -1,4 +1,4 @@
1
- import type { AgentSession } from "@mariozechner/pi-coding-agent";
1
+ import type { AgentSession } from "@earendil-works/pi-coding-agent";
2
2
  import { Type } from "@sinclair/typebox";
3
3
  import type { AgentConfigLookup } from "../agent-types.js";
4
4
  import type { AgentRecord } from "../types.js";
@@ -6,7 +6,7 @@
6
6
  * tag building, and detail-base construction.
7
7
  */
8
8
 
9
- import type { Model } from "@mariozechner/pi-ai";
9
+ import type { Model } from "@earendil-works/pi-ai";
10
10
  import { normalizeMaxTurns } from "../agent-runner.js";
11
11
  import type { AgentTypeRegistry } from "../agent-types.js";
12
12
  import { resolveAgentInvocationConfig } from "../invocation-config.js";
@@ -1,4 +1,4 @@
1
- import type { AgentSession } from "@mariozechner/pi-coding-agent";
1
+ import type { AgentSession } from "@earendil-works/pi-coding-agent";
2
2
  import { Type } from "@sinclair/typebox";
3
3
  import type { AgentRecord } from "../types.js";
4
4
  import { getSessionContextPercent } from "../usage.js";
@@ -2,7 +2,7 @@
2
2
  * types.ts — Type definitions for the subagent system.
3
3
  */
4
4
 
5
- import type { ThinkingLevel } from "@mariozechner/pi-ai";
5
+ import type { ThinkingLevel } from "@earendil-works/pi-ai";
6
6
 
7
7
 
8
8
  export { AgentRecord } from "./agent-record.js";
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { join } from "node:path";
9
9
 
10
- import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
10
+ import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
11
11
  import type { AgentTypeRegistry } from "../agent-types.js";
12
12
  import type { AgentConfig } from "../types.js";
13
13
  import type { AgentFileOps } from "./agent-file-ops.js";
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { join } from "node:path";
9
9
 
10
- import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
10
+ import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
11
11
  import { BUILTIN_TOOL_NAMES } from "../agent-types.js";
12
12
  import type { AgentRecord } from "../types.js";
13
13
  import type { AgentFileOps } from "./agent-file-ops.js";
@@ -1,4 +1,4 @@
1
- import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
1
+ import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
2
2
  import type { AgentSpawnConfig } from "../agent-manager.js";
3
3
  import { AgentTypeRegistry } from "../agent-types.js";
4
4
  import type { ModelRegistry } from "../model-resolver.js";
@@ -5,8 +5,8 @@
5
5
  * Subscribes to session events for real-time streaming updates.
6
6
  */
7
7
 
8
- import type { AgentSession } from "@mariozechner/pi-coding-agent";
9
- import { type Component, matchesKey, type TUI, truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@mariozechner/pi-tui";
8
+ import type { AgentSession } from "@earendil-works/pi-coding-agent";
9
+ import { type Component, matchesKey, type TUI, truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
10
10
  import type { AgentConfigLookup } from "../agent-types.js";
11
11
  import { extractText } from "../context.js";
12
12
  import type { AgentRecord } from "../types.js";
@@ -5,7 +5,7 @@
5
5
  * No timers, no SDK types, no side effects. Consumed by AgentWidget.
6
6
  */
7
7
 
8
- import { truncateToWidth } from "@mariozechner/pi-tui";
8
+ import { truncateToWidth } from "@earendil-works/pi-tui";
9
9
  import type { AgentConfigLookup } from "../agent-types.js";
10
10
  import type { SubagentType } from "../types.js";
11
11
  import type { LifetimeUsage, SessionLike } from "../usage.js";
@@ -17,7 +17,7 @@ const mockAgentLookup = {
17
17
  getToolNamesForType: vi.fn((): string[] => ["read"]),
18
18
  };
19
19
 
20
- import type { AgentSession } from "@mariozechner/pi-coding-agent";
20
+ import type { AgentSession } from "@earendil-works/pi-coding-agent";
21
21
  import { resumeAgent, runAgent } from "../src/agent-runner.js";
22
22
 
23
23
  // ── RunnerIO stub factory ──────────────────────────────────────────────────────
@@ -1,5 +1,5 @@
1
- import type { AgentSession } from "@mariozechner/pi-coding-agent";
2
- import type { TUI } from "@mariozechner/pi-tui";
1
+ import type { AgentSession } from "@earendil-works/pi-coding-agent";
2
+ import type { TUI } from "@earendil-works/pi-tui";
3
3
  import { beforeEach, describe, expect, it, vi } from "vitest";
4
4
  import { AgentTypeRegistry } from "../src/agent-types.js";
5
5
  import type { AgentActivityTracker } from "../src/ui/agent-activity-tracker.js";
@@ -16,8 +16,8 @@ const testRegistry = new AgentTypeRegistry(() => new Map());
16
16
 
17
17
  let wrapOverride: ((text: string, width: number) => string[]) | null = null;
18
18
 
19
- vi.mock("@mariozechner/pi-tui", async (importOriginal) => {
20
- const original = await importOriginal<typeof import("@mariozechner/pi-tui")>();
19
+ vi.mock("@earendil-works/pi-tui", async (importOriginal) => {
20
+ const original = await importOriginal<typeof import("@earendil-works/pi-tui")>();
21
21
  return {
22
22
  ...original,
23
23
  wrapTextWithAnsi: (...args: [string, number]) => {
@@ -29,7 +29,7 @@ vi.mock("@mariozechner/pi-tui", async (importOriginal) => {
29
29
 
30
30
  // Must import AFTER vi.mock declaration (vitest hoists vi.mock but the
31
31
  // dynamic import of the test subject must happen after)
32
- const { visibleWidth } = await import("@mariozechner/pi-tui");
32
+ const { visibleWidth } = await import("@earendil-works/pi-tui");
33
33
  const { ConversationViewer } = await import("../src/ui/conversation-viewer.js");
34
34
 
35
35
  // ── Helpers ────────────────────────────────────────────────────────────
@@ -254,7 +254,7 @@ describe("ConversationViewer", () => {
254
254
  }
255
255
 
256
256
  it("mock is intercepting wrapTextWithAnsi", async () => {
257
- const { wrapTextWithAnsi } = await import("@mariozechner/pi-tui");
257
+ const { wrapTextWithAnsi } = await import("@earendil-works/pi-tui");
258
258
  wrapOverride = () => ["MOCK_SENTINEL"];
259
259
  expect(wrapTextWithAnsi("anything", 10)).toEqual(["MOCK_SENTINEL"]);
260
260
  wrapOverride = null;
@@ -437,10 +437,10 @@ Bad isolation.`);
437
437
  expect(result.get("bad-isolation")!.isolation).toBeUndefined();
438
438
  });
439
439
 
440
- it("honors PI_CODING_AGENT_DIR for global custom agent discovery", () => {
440
+ it("honors DM_CODING_AGENT_DIR for global custom agent discovery", () => {
441
441
  const altAgentDir = mkdtempSync(join(tmpdir(), "pi-alt-agent-"));
442
- const originalEnv = process.env.PI_CODING_AGENT_DIR;
443
- process.env.PI_CODING_AGENT_DIR = altAgentDir;
442
+ const originalEnv = process.env.DM_CODING_AGENT_DIR;
443
+ process.env.DM_CODING_AGENT_DIR = altAgentDir;
444
444
  try {
445
445
  const globalAgentsDir = join(altAgentDir, "agents");
446
446
  mkdirSync(globalAgentsDir, { recursive: true });
@@ -451,12 +451,12 @@ Bad isolation.`);
451
451
 
452
452
  const result = loadCustomAgents(tmpDir);
453
453
 
454
- // Agent is found at $PI_CODING_AGENT_DIR/agents, not at $HOME/.dm/agent/agents
454
+ // Agent is found at $DM_CODING_AGENT_DIR/agents, not at $HOME/.dm/agent/agents
455
455
  expect(result.has("via-env")).toBe(true);
456
456
  expect(result.get("via-env")!.description).toBe("Discovered via env var");
457
457
  } finally {
458
- if (originalEnv == null) delete process.env.PI_CODING_AGENT_DIR;
459
- else process.env.PI_CODING_AGENT_DIR = originalEnv;
458
+ if (originalEnv == null) delete process.env.DM_CODING_AGENT_DIR;
459
+ else process.env.DM_CODING_AGENT_DIR = originalEnv;
460
460
  rmSync(altAgentDir, { recursive: true, force: true });
461
461
  }
462
462
  });
@@ -1,4 +1,4 @@
1
- import type { AgentSession } from "@mariozechner/pi-coding-agent";
1
+ import type { AgentSession } from "@earendil-works/pi-coding-agent";
2
2
  import type { Mock } from "vitest";
3
3
  import { vi } from "vitest";
4
4
 
@@ -5,7 +5,7 @@
5
5
  * injected deps instead — ctx is never inspected. This typed stub avoids
6
6
  * 'as any' while documenting the intent.
7
7
  */
8
- import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
8
+ import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
9
9
  import type { ParentSnapshot } from "../../src/parent-snapshot.js";
10
10
 
11
11
  export const STUB_CTX = {} as unknown as ExtensionContext;
@@ -8,7 +8,7 @@ vi.mock("../src/context.js", () => ({
8
8
  buildParentContext: buildParentContextMock,
9
9
  }));
10
10
 
11
- import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
11
+ import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
12
12
  import { buildParentSnapshot } from "../src/parent-snapshot.js";
13
13
 
14
14
  function makeCtx(overrides: Record<string, unknown> = {}) {
@@ -11,7 +11,7 @@ import {
11
11
 
12
12
  /**
13
13
  * Tests for persistent settings. Uses two tmp directories:
14
- * - `globalDir`: redirected via PI_CODING_AGENT_DIR so getAgentDir() returns it.
14
+ * - `globalDir`: redirected via DM_CODING_AGENT_DIR so getAgentDir() returns it.
15
15
  * Simulates `~/.dm/agent/` — the global scope.
16
16
  * - `projectDir`: passed explicitly as cwd to load/save.
17
17
  * Simulates the user's project root. Settings live at `<projectDir>/.dm/subagents.json`.
@@ -27,13 +27,13 @@ describe("settings persistence", () => {
27
27
  beforeEach(() => {
28
28
  globalDir = mkdtempSync(join(tmpdir(), "pi-settings-global-"));
29
29
  projectDir = mkdtempSync(join(tmpdir(), "pi-settings-project-"));
30
- originalAgentDirEnv = process.env.PI_CODING_AGENT_DIR;
31
- process.env.PI_CODING_AGENT_DIR = globalDir;
30
+ originalAgentDirEnv = process.env.DM_CODING_AGENT_DIR;
31
+ process.env.DM_CODING_AGENT_DIR = globalDir;
32
32
  });
33
33
 
34
34
  afterEach(() => {
35
- if (originalAgentDirEnv == null) delete process.env.PI_CODING_AGENT_DIR;
36
- else process.env.PI_CODING_AGENT_DIR = originalAgentDirEnv;
35
+ if (originalAgentDirEnv == null) delete process.env.DM_CODING_AGENT_DIR;
36
+ else process.env.DM_CODING_AGENT_DIR = originalAgentDirEnv;
37
37
  rmSync(globalDir, { recursive: true, force: true });
38
38
  rmSync(projectDir, { recursive: true, force: true });
39
39
  });
@@ -10,21 +10,21 @@ describe("preloadSkills", () => {
10
10
 
11
11
  beforeEach(() => {
12
12
  tmpDir = mkdtempSync(join(tmpdir(), "pi-skill-test-"));
13
- originalAgentDir = process.env.PI_CODING_AGENT_DIR;
14
- process.env.PI_CODING_AGENT_DIR = join(tmpDir, "user-agent-dir");
13
+ originalAgentDir = process.env.DM_CODING_AGENT_DIR;
14
+ process.env.DM_CODING_AGENT_DIR = join(tmpDir, "user-agent-dir");
15
15
  });
16
16
 
17
17
  afterEach(() => {
18
18
  if (originalAgentDir === undefined) {
19
- delete process.env.PI_CODING_AGENT_DIR;
19
+ delete process.env.DM_CODING_AGENT_DIR;
20
20
  } else {
21
- process.env.PI_CODING_AGENT_DIR = originalAgentDir;
21
+ process.env.DM_CODING_AGENT_DIR = originalAgentDir;
22
22
  }
23
23
  rmSync(tmpDir, { recursive: true, force: true });
24
24
  });
25
25
 
26
26
  const projectRoot = () => join(tmpDir, ".dm", "skills");
27
- const globalRoot = () => join(process.env.PI_CODING_AGENT_DIR!, "skills");
27
+ const globalRoot = () => join(process.env.DM_CODING_AGENT_DIR!, "skills");
28
28
 
29
29
  function writeFlat(root: string, name: string, content: string, ext = ".md") {
30
30
  mkdirSync(root, { recursive: true });
@@ -26,8 +26,10 @@ describe("dm-subagents source-layout contract", () => {
26
26
  expect(pkg.name).toBe("dm-subagents");
27
27
  expect(pkg.version).toBe("6.16.1");
28
28
  expect(pkg.pi.extensions).toEqual(["./src/index.ts"]);
29
- expect(pkg.peerDependencies["@mariozechner/pi-coding-agent"]).toBe(">=0.72.1");
30
- expect(pkg.devDependencies["@mariozechner/pi-coding-agent"]).toBe("0.73.1");
29
+ expect(pkg.peerDependencies["@earendil-works/pi-coding-agent"]).toBe(">=0.72.1");
30
+ expect(pkg.devDependencies["@earendil-works/pi-coding-agent"]).toBe(
31
+ "file:../../pi-mono/packages/coding-agent",
32
+ );
31
33
  });
32
34
 
33
35
  it("keeps source-layout tools and /agents command visible", () => {
@@ -52,7 +54,7 @@ describe("dm-subagents source-layout contract", () => {
52
54
  const checked = ["README.md", "AGENTS.md", ...walk("src"), ...walk("test")]
53
55
  .filter((file) => file !== "test/unit/subagent-contract.test.ts")
54
56
  .filter((file) => [".ts", ".md", ".json"].includes(extname(file)));
55
- const banned = ["@gotgenes/pi-subagents", "@earendil-works/pi", "pi-subagents", "~/.pi", ".pi/", "Pi "];
57
+ const banned = ["@gotgenes/pi-subagents", "@mariozechner/pi", "pi-subagents", "~/.pi", ".pi/", "Pi "];
56
58
  const hits: string[] = [];
57
59
  for (const file of checked) {
58
60
  const text = read(file);
@@ -5,9 +5,9 @@
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "node_modules/typebox": {
8
- "version": "1.2.2",
9
- "resolved": "https://registry.npmjs.org/typebox/-/typebox-1.2.2.tgz",
10
- "integrity": "sha512-0nqIJFL+baWoAEtwa0l/vfbfXg0+3gEhiWGnHuoIiivXjlk/TpxDddG0WER34CojKNpHi4ZXku8XGEz9H55b5Q==",
8
+ "version": "1.2.3",
9
+ "resolved": "https://registry.npmjs.org/typebox/-/typebox-1.2.3.tgz",
10
+ "integrity": "sha512-EdFz/9FGvhQK2NmjZjSLri+nd5oMH+t/46/6lueEPbeHmS9WbWOz5IayPyLw0HHIyOWfo+wPrQGcAEQ+GsXc/w==",
11
11
  "license": "MIT"
12
12
  }
13
13
  }
@@ -1,13 +1,12 @@
1
1
  import { type TSchema, type TSchemaOptions } from '../types/schema.mjs';
2
2
  import { type TDeferred } from '../types/deferred.mjs';
3
3
  import { type TConditionalAction } from '../engine/conditional/instantiate.mjs';
4
+ import { type TState } from '../engine/instantiate.mjs';
4
5
  /** Creates a deferred Conditional action. */
5
6
  export type TConditionalDeferred<Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema> = (TDeferred<'Conditional', [Left, Right, True, False]>);
6
7
  /** Creates a deferred Conditional action. */
7
8
  export declare function ConditionalDeferred<Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema>(left: Left, right: Right, true_: True, false_: False, options?: TSchemaOptions): TConditionalDeferred<Left, Right, True, False>;
8
9
  /** Applies a Conditional action to the given types. */
9
- export type TConditional<Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema> = (TConditionalAction<{}, {
10
- callstack: [];
11
- }, Left, Right, True, False>);
10
+ export type TConditional<Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema> = (TConditionalAction<{}, TState<[], []>, Left, Right, True, False>);
12
11
  /** Applies a Conditional action to the given types. */
13
12
  export declare function Conditional<Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema>(left: Left, right: Right, true_: True, false_: False, options?: TSchemaOptions): TConditional<Left, Right, True, False>;
@@ -2,11 +2,12 @@
2
2
  // deno-fmt-ignore-file
3
3
  import { Deferred } from '../types/deferred.mjs';
4
4
  import { ConditionalAction } from '../engine/conditional/instantiate.mjs';
5
+ import { State } from '../engine/instantiate.mjs';
5
6
  /** Creates a deferred Conditional action. */
6
7
  export function ConditionalDeferred(left, right, true_, false_, options = {}) {
7
8
  return Deferred('Conditional', [left, right, true_, false_], options);
8
9
  }
9
10
  /** Applies a Conditional action to the given types. */
10
11
  export function Conditional(left, right, true_, false_, options = {}) {
11
- return ConditionalAction({}, { callstack: [] }, left, right, true_, false_, options);
12
+ return ConditionalAction({}, State([], []), left, right, true_, false_, options);
12
13
  }
@@ -2,13 +2,12 @@ import { type TSchema, type TSchemaOptions } from '../types/schema.mjs';
2
2
  import { type TIdentifier } from '../types/identifier.mjs';
3
3
  import { type TDeferred } from '../types/deferred.mjs';
4
4
  import { type TMappedAction } from '../engine/mapped/instantiate.mjs';
5
+ import { type TState } from '../engine/instantiate.mjs';
5
6
  /** Creates a deferred Mapped action. */
6
7
  export type TMappedDeferred<Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema> = (TDeferred<'Mapped', [Identifier, Type, As, Property]>);
7
8
  /** Creates a deferred Mapped action. */
8
9
  export declare function MappedDeferred<Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema>(identifier: Identifier, type: Type, as: As, property: Property, options?: TSchemaOptions): TMappedDeferred<Identifier, Type, As, Property>;
9
10
  /** Applies a Mapped action using the given types. */
10
- export type TMapped<Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema> = (TMappedAction<{}, {
11
- callstack: [];
12
- }, Identifier, Type, As, Property>);
11
+ export type TMapped<Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema> = (TMappedAction<{}, TState<[], []>, Identifier, Type, As, Property>);
13
12
  /** Applies a Mapped action using the given types. */
14
13
  export declare function Mapped<Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema>(identifier: Identifier, type: Type, as: As, property: Property, options?: TSchemaOptions): TMapped<Identifier, Type, As, Property>;
@@ -2,11 +2,12 @@
2
2
  // deno-fmt-ignore-file
3
3
  import { Deferred } from '../types/deferred.mjs';
4
4
  import { MappedAction } from '../engine/mapped/instantiate.mjs';
5
+ import { State } from '../engine/instantiate.mjs';
5
6
  /** Creates a deferred Mapped action. */
6
7
  export function MappedDeferred(identifier, type, as, property, options = {}) {
7
8
  return Deferred('Mapped', [identifier, type, as, property], options);
8
9
  }
9
10
  /** Applies a Mapped action using the given types. */
10
11
  export function Mapped(identifier, type, as, property, options = {}) {
11
- return MappedAction({}, { callstack: [] }, identifier, type, as, property, options);
12
+ return MappedAction({}, State([], []), identifier, type, as, property, options);
12
13
  }
@@ -13,9 +13,7 @@ import { type TResolveTarget } from './resolve_target.mjs';
13
13
  import { type TResolveArgumentsContext } from './resolve_arguments.mjs';
14
14
  type TPeek<State extends TState, Result extends string = State['callstack'] extends [...infer _ extends string[], infer Top extends string] ? Top : ''> = Result;
15
15
  type TIsTailCall<State extends TState, Name extends string, Result extends boolean = TPeek<State> extends Name ? true : false> = Result;
16
- type TCallDispatch<Context extends TProperties, State extends TState, Target extends TRef, Parameters extends TParameter[], Expression extends TSchema, Arguments extends TSchema[], ArgumentsContext extends TProperties = TResolveArgumentsContext<Context, State, Parameters, Arguments>, ReturnType extends TSchema = TInstantiateType<ArgumentsContext, {
17
- callstack: [...State['callstack'], Target['$ref']];
18
- }, Expression>> = TInstantiateType<Context, State, ReturnType>;
16
+ type TCallDispatch<Context extends TProperties, State extends TState, Target extends TRef, Parameters extends TParameter[], Expression extends TSchema, Arguments extends TSchema[], ArgumentsContext extends TProperties = TResolveArgumentsContext<Context, State, Parameters, Arguments>, ReturnType extends TSchema = TInstantiateType<ArgumentsContext, TState<[...State['callstack'], Target['$ref']], State['visited']>, Expression>> = TInstantiateType<ArgumentsContext, TState<[], []>, ReturnType>;
19
17
  type TCallDistributed<Context extends TProperties, State extends TState, Target extends TRef, Parameters extends TParameter[], Expression extends TSchema, DistributedArguments extends TSchema[][], Result extends TSchema[] = []> = (DistributedArguments extends [infer Arguments extends TSchema[], ...infer DistributedArguments extends TSchema[][]] ? TCallDispatch<Context, State, Target, Parameters, Expression, Arguments> extends infer ReturnType extends TSchema ? TCallDistributed<Context, State, Target, Parameters, Expression, DistributedArguments, [...Result, ReturnType]> : never : Result);
20
18
  type TCallImmediate<Context extends TProperties, State extends TState, Target extends TRef, Parameters extends TParameter[], Expression extends TSchema, InstantiatedArguments extends TSchema[], DistributedArguments extends TSchema[][] = TDistributeArguments<Parameters, InstantiatedArguments, Expression>, ReturnTypes extends TSchema[] = TCallDistributed<Context, State, Target, Parameters, Expression, DistributedArguments>, Result extends TSchema = ReturnTypes['length'] extends 1 ? ReturnTypes[0] : TEvaluateUnion<ReturnTypes>> = Result;
21
19
  export type TCallInstantiate<Context extends TProperties, State extends TState, Target extends TSchema, Arguments extends TSchema[], InstantiatedArguments extends TSchema[] = TInstantiateTypes<Context, State, Arguments>, Resolved extends [string, TSchema] = TResolveTarget<Context, Target, Arguments>, Name extends string = Resolved[0], Type extends TSchema = Resolved[1], Result extends TSchema = (Type extends TGeneric<infer Parameters extends TParameter[], infer Expression extends TSchema> ? TIsTailCall<State, Name> extends true ? TCallConstruct<TRef<Name>, InstantiatedArguments> : TCallImmediate<Context, State, TRef<Name>, Parameters, Expression, InstantiatedArguments> : TCallConstruct<Target, InstantiatedArguments>)> = Result;
@@ -6,6 +6,7 @@ import { IsGeneric } from '../../types/generic.mjs';
6
6
  import { EvaluateUnion } from '../evaluate/index.mjs';
7
7
  import { InstantiateType } from '../instantiate.mjs';
8
8
  import { InstantiateTypes } from '../instantiate.mjs';
9
+ import { State } from '../instantiate.mjs';
9
10
  // ------------------------------------------------------------------
10
11
  // Infrastructure
11
12
  // ------------------------------------------------------------------
@@ -22,8 +23,8 @@ function IsTailCall(state, name) {
22
23
  }
23
24
  function CallDispatch(context, state, target, parameters, expression, arguments_) {
24
25
  const argumentsContext = ResolveArgumentsContext(context, state, parameters, arguments_);
25
- const returnType = InstantiateType(argumentsContext, { callstack: [...state.callstack, target.$ref] }, expression);
26
- return InstantiateType(context, state, returnType);
26
+ const returnType = InstantiateType(argumentsContext, State([...state['callstack'], target['$ref']], state['visited']), expression);
27
+ return InstantiateType(argumentsContext, State([], []), returnType);
27
28
  }
28
29
  function CallDistributed(context, state, target, parameters, expression, distributedArguments) {
29
30
  return distributedArguments.reduce((result, arguments_) => [...result, CallDispatch(context, state, target, parameters, expression, arguments_)], []);
@@ -3,11 +3,10 @@ import { type TProperties } from '../../types/properties.mjs';
3
3
  import { type TConstructor } from '../../types/constructor.mjs';
4
4
  import { type TTuple } from '../../types/tuple.mjs';
5
5
  import { type TConstructorParametersDeferred } from '../../action/constructor_parameters.mjs';
6
- import { type TState, type TInstantiateType, type TCanInstantiate } from '../instantiate.mjs';
6
+ import { type TInstantiateType, type TCanInstantiate } from '../instantiate.mjs';
7
7
  import { type TInstantiateElements } from '../instantiate.mjs';
8
- type TConstructorParametersOperation<Type extends TSchema, Parameters extends TSchema[] = Type extends TConstructor ? Type['parameters'] : [], InstantiatedParameters extends TSchema[] = TInstantiateElements<{}, {
9
- callstack: [];
10
- }, Parameters>, Result extends TSchema = TTuple<InstantiatedParameters>> = Result;
8
+ import { type TState } from '../instantiate.mjs';
9
+ type TConstructorParametersOperation<Type extends TSchema, Parameters extends TSchema[] = Type extends TConstructor ? Type['parameters'] : [], InstantiatedParameters extends TSchema[] = TInstantiateElements<{}, TState<[], []>, Parameters>, Result extends TSchema = TTuple<InstantiatedParameters>> = Result;
11
10
  export type TConstructorParametersAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TConstructorParametersOperation<Type> : TConstructorParametersDeferred<Type>> = Result;
12
11
  export declare function ConstructorParametersAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TConstructorParametersAction<Type>;
13
12
  export type TConstructorParametersInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TConstructorParametersAction<InstantiatedType>;
@@ -6,9 +6,10 @@ import { Tuple } from '../../types/tuple.mjs';
6
6
  import { ConstructorParametersDeferred } from '../../action/constructor_parameters.mjs';
7
7
  import { InstantiateType, CanInstantiate } from '../instantiate.mjs';
8
8
  import { InstantiateElements } from '../instantiate.mjs';
9
+ import { State } from '../instantiate.mjs';
9
10
  function ConstructorParametersOperation(type) {
10
11
  const parameters = IsConstructor(type) ? type['parameters'] : [];
11
- const instantiatedParameters = InstantiateElements({}, { callstack: [] }, parameters);
12
+ const instantiatedParameters = InstantiateElements({}, State([], []), parameters);
12
13
  const result = Tuple(instantiatedParameters);
13
14
  return result;
14
15
  }