@oyasmi/pipiclaw 0.5.3 → 0.5.4

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 (35) hide show
  1. package/dist/agent/channel-runner.d.ts +1 -1
  2. package/dist/agent/channel-runner.js +7 -6
  3. package/dist/{command-extension.js → agent/command-extension.js} +1 -1
  4. package/dist/{prompt-builder.d.ts → agent/prompt-builder.d.ts} +1 -1
  5. package/dist/agent/type-guards.js +1 -1
  6. package/dist/agent/types.d.ts +1 -1
  7. package/dist/{config-loader.d.ts → agent/workspace-resources.d.ts} +3 -9
  8. package/dist/{config-loader.js → agent/workspace-resources.js} +3 -18
  9. package/dist/index.d.ts +9 -8
  10. package/dist/index.js +9 -8
  11. package/dist/memory/consolidation.js +1 -1
  12. package/dist/memory/lifecycle.d.ts +1 -1
  13. package/dist/memory/recall.js +1 -1
  14. package/dist/memory/session.js +1 -1
  15. package/dist/{sidecar-worker.js → memory/sidecar-worker.js} +1 -1
  16. package/dist/models/api-keys.d.ts +7 -0
  17. package/dist/models/api-keys.js +16 -0
  18. package/dist/{model-utils.d.ts → models/utils.d.ts} +1 -1
  19. package/dist/runtime/bootstrap.js +2 -2
  20. package/dist/runtime/dingtalk.js +1 -1
  21. package/dist/{context.d.ts → settings.d.ts} +1 -1
  22. package/dist/{context.js → settings.js} +1 -1
  23. package/dist/subagents/discovery.js +1 -1
  24. package/dist/subagents/tool.d.ts +1 -1
  25. package/dist/subagents/tool.js +1 -1
  26. package/dist/tools/index.d.ts +1 -1
  27. package/package.json +1 -1
  28. package/dist/agent.d.ts +0 -2
  29. package/dist/agent.js +0 -1
  30. /package/dist/{command-extension.d.ts → agent/command-extension.d.ts} +0 -0
  31. /package/dist/{commands.d.ts → agent/commands.d.ts} +0 -0
  32. /package/dist/{commands.js → agent/commands.js} +0 -0
  33. /package/dist/{prompt-builder.js → agent/prompt-builder.js} +0 -0
  34. /package/dist/{sidecar-worker.d.ts → memory/sidecar-worker.d.ts} +0 -0
  35. /package/dist/{model-utils.js → models/utils.js} +0 -0
@@ -1,7 +1,7 @@
1
- import { type BuiltInCommand } from "../commands.js";
2
1
  import type { DingTalkContext } from "../runtime/dingtalk.js";
3
2
  import type { ChannelStore } from "../runtime/store.js";
4
3
  import { type SandboxConfig } from "../sandbox.js";
4
+ import { type BuiltInCommand } from "./commands.js";
5
5
  import { type AgentRunner } from "./types.js";
6
6
  export declare class ChannelRunner implements AgentRunner {
7
7
  private readonly sandboxConfig;
@@ -2,30 +2,31 @@ import { Agent } from "@mariozechner/pi-agent-core";
2
2
  import { AgentSession, AuthStorage, convertToLlm, DefaultResourceLoader, ModelRegistry, SessionManager, } from "@mariozechner/pi-coding-agent";
3
3
  import { mkdir, readFile, writeFile } from "fs/promises";
4
4
  import { dirname, join, resolve } from "path";
5
- import { createCommandExtension } from "../command-extension.js";
6
- import { renderBuiltInHelp } from "../commands.js";
7
- import { getAgentConfig, getApiKeyForModel, getSoul, loadPipiclawSkills } from "../config-loader.js";
8
- import { PipiclawSettingsManager } from "../context.js";
9
5
  import * as log from "../log.js";
10
6
  import { buildFirstTurnMemoryBootstrap as renderFirstTurnMemoryBootstrap } from "../memory/bootstrap.js";
11
7
  import { createMemoryCandidateCache } from "../memory/candidates.js";
12
8
  import { getChannelMemoryPath } from "../memory/files.js";
13
9
  import { MemoryLifecycle } from "../memory/lifecycle.js";
14
10
  import { recallRelevantMemory } from "../memory/recall.js";
15
- import { resolveInitialModel } from "../model-utils.js";
11
+ import { getApiKeyForModel } from "../models/api-keys.js";
12
+ import { resolveInitialModel } from "../models/utils.js";
16
13
  import { APP_HOME_DIR, AUTH_CONFIG_PATH, MODELS_CONFIG_PATH } from "../paths.js";
17
- import { buildAppendSystemPrompt } from "../prompt-builder.js";
18
14
  import { createExecutor } from "../sandbox.js";
15
+ import { PipiclawSettingsManager } from "../settings.js";
19
16
  import { HAN_REGEX } from "../shared/text-utils.js";
20
17
  import { isRecord } from "../shared/type-guards.js";
21
18
  import { discoverSubAgents, formatSubAgentList } from "../subagents/discovery.js";
22
19
  import { createPipiclawTools } from "../tools/index.js";
20
+ import { createCommandExtension } from "./command-extension.js";
21
+ import { renderBuiltInHelp } from "./commands.js";
23
22
  import { clipUserInput } from "./progress-formatter.js";
23
+ import { buildAppendSystemPrompt } from "./prompt-builder.js";
24
24
  import { createRunQueue } from "./run-queue.js";
25
25
  import { handleSessionEvent } from "./session-events.js";
26
26
  import { SessionResourceGate } from "./session-resource-gate.js";
27
27
  import { getLastAssistantUsage } from "./type-guards.js";
28
28
  import { createEmptyRunState, MAX_USER_MESSAGE_CHARS, } from "./types.js";
29
+ import { getAgentConfig, getSoul, loadPipiclawSkills } from "./workspace-resources.js";
29
30
  function isSilentOutcome(outcome) {
30
31
  return outcome.kind === "silent";
31
32
  }
@@ -1,5 +1,5 @@
1
1
  import { basename } from "path";
2
- import { findExactModelReferenceMatch, formatModelList, formatModelReference } from "./model-utils.js";
2
+ import { findExactModelReferenceMatch, formatModelList, formatModelReference } from "../models/utils.js";
3
3
  export const COMMAND_RESULT_CUSTOM_TYPE = "pipiclaw.command_result";
4
4
  function buildSessionText(stats, currentModel, thinkingLevel) {
5
5
  const modelText = currentModel ? `\`${formatModelReference(currentModel)}\`` : "(none)";
@@ -1,4 +1,4 @@
1
- import type { SandboxConfig } from "./sandbox.js";
1
+ import type { SandboxConfig } from "../sandbox.js";
2
2
  export interface AppendSystemPromptOptions {
3
3
  subAgentList?: string;
4
4
  }
@@ -1,5 +1,5 @@
1
- import { COMMAND_RESULT_CUSTOM_TYPE } from "../command-extension.js";
2
1
  import { isRecord } from "../shared/type-guards.js";
2
+ import { COMMAND_RESULT_CUSTOM_TYPE } from "./command-extension.js";
3
3
  function isMessageWithRole(value) {
4
4
  return isRecord(value) && typeof value.role === "string";
5
5
  }
@@ -1,7 +1,7 @@
1
- import type { BuiltInCommand } from "../commands.js";
2
1
  import type { DingTalkContext } from "../runtime/dingtalk.js";
3
2
  import type { ChannelStore } from "../runtime/store.js";
4
3
  import type { UsageTotals } from "../shared/types.js";
4
+ import type { BuiltInCommand } from "./commands.js";
5
5
  export interface AgentRunner {
6
6
  run(ctx: DingTalkContext, store: ChannelStore): Promise<{
7
7
  stopReason: string;
@@ -1,9 +1,8 @@
1
1
  /**
2
- * Configuration file loaders for pipiclaw workspace files:
3
- * SOUL.md, AGENTS.md, skills/, and API key resolution.
2
+ * Workspace resource loaders for pipiclaw:
3
+ * SOUL.md, AGENTS.md, and workspace/channel skills.
4
4
  */
5
- import type { Api, Model } from "@mariozechner/pi-ai";
6
- import { type ModelRegistry, type Skill } from "@mariozechner/pi-coding-agent";
5
+ import { type Skill } from "@mariozechner/pi-coding-agent";
7
6
  /**
8
7
  * Load SOUL.md — defines the agent's identity, personality, and communication style.
9
8
  * Only loaded from workspace root (global).
@@ -19,8 +18,3 @@ export declare function getAgentConfig(channelDir: string): string;
19
18
  * Channel-level skills override global skills with the same name.
20
19
  */
21
20
  export declare function loadPipiclawSkills(channelDir: string, workspacePath: string): Skill[];
22
- /**
23
- * Resolve an API key for the given model's provider.
24
- * Checks ModelRegistry first, then falls back to ANTHROPIC_API_KEY env var.
25
- */
26
- export declare function getApiKeyForModel(modelRegistry: ModelRegistry, model: Model<Api>): Promise<string>;
@@ -1,11 +1,11 @@
1
1
  /**
2
- * Configuration file loaders for pipiclaw workspace files:
3
- * SOUL.md, AGENTS.md, skills/, and API key resolution.
2
+ * Workspace resource loaders for pipiclaw:
3
+ * SOUL.md, AGENTS.md, and workspace/channel skills.
4
4
  */
5
5
  import { loadSkillsFromDir } from "@mariozechner/pi-coding-agent";
6
6
  import { existsSync, readFileSync } from "fs";
7
7
  import { join } from "path";
8
- import * as log from "./log.js";
8
+ import * as log from "../log.js";
9
9
  /**
10
10
  * Load SOUL.md — defines the agent's identity, personality, and communication style.
11
11
  * Only loaded from workspace root (global).
@@ -72,18 +72,3 @@ export function loadPipiclawSkills(channelDir, workspacePath) {
72
72
  }
73
73
  return Array.from(skillMap.values());
74
74
  }
75
- /**
76
- * Resolve an API key for the given model's provider.
77
- * Checks ModelRegistry first, then falls back to ANTHROPIC_API_KEY env var.
78
- */
79
- export async function getApiKeyForModel(modelRegistry, model) {
80
- const key = await modelRegistry.getApiKeyForProvider(model.provider);
81
- if (key)
82
- return key;
83
- // Fallback: try anthropic env var
84
- const envKey = process.env.ANTHROPIC_API_KEY;
85
- if (envKey)
86
- return envKey;
87
- throw new Error(`No API key found for provider: ${model.provider}.\n\n` +
88
- "Configure credentials in ~/.pi/pipiclaw/auth.json or ~/.pi/pipiclaw/models.json, or set the matching provider environment variable.");
89
- }
package/dist/index.d.ts CHANGED
@@ -1,23 +1,24 @@
1
- export { type AgentRunner, getOrCreateRunner } from "./agent.js";
2
- export { COMMAND_RESULT_CUSTOM_TYPE, createCommandExtension, type PipiclawCommandExtensionOptions, } from "./command-extension.js";
3
- export { type BuiltInCommand, type BuiltInCommandName, parseBuiltInCommand, renderBuiltInHelp } from "./commands.js";
4
- export { getAgentConfig, getApiKeyForModel, getSoul, loadPipiclawSkills, } from "./config-loader.js";
5
- export { type PipiclawMemoryRecallSettings, type PipiclawSessionMemorySettings, type PipiclawSettings, PipiclawSettingsManager, } from "./context.js";
1
+ export { COMMAND_RESULT_CUSTOM_TYPE, createCommandExtension, type PipiclawCommandExtensionOptions, } from "./agent/command-extension.js";
2
+ export { type BuiltInCommand, type BuiltInCommandName, parseBuiltInCommand, renderBuiltInHelp, } from "./agent/commands.js";
3
+ export { type AgentRunner, getOrCreateRunner } from "./agent/index.js";
4
+ export { type AppendSystemPromptOptions, buildAppendSystemPrompt } from "./agent/prompt-builder.js";
5
+ export { getAgentConfig, getSoul, loadPipiclawSkills, } from "./agent/workspace-resources.js";
6
6
  export { type BuildMemoryCandidatesOptions, buildMemoryCandidates, type MemoryCandidate, } from "./memory/candidates.js";
7
7
  export { type BackgroundMaintenanceResult, type ConsolidationRunOptions, type InlineConsolidationResult, runBackgroundMaintenance, runInlineConsolidation, } from "./memory/consolidation.js";
8
8
  export { ensureChannelMemoryFiles, ensureChannelMemoryFilesSync, getChannelSessionPath, readChannelSession, rewriteChannelSession, } from "./memory/files.js";
9
9
  export { type ConsolidationReason, MemoryLifecycle, type MemoryLifecycleOptions } from "./memory/lifecycle.js";
10
10
  export { type RecalledMemory, type RecallRequest, type RecallResult, recallRelevantMemory, } from "./memory/recall.js";
11
11
  export { renderSessionMemory, type SessionMemoryState, type SessionMemoryUpdateOptions, updateChannelSessionMemory, } from "./memory/session.js";
12
- export { findExactModelReferenceMatch, formatModelList, formatModelReference, resolveInitialModel, } from "./model-utils.js";
12
+ export { runSidecarTask, type SidecarResult, type SidecarTask, } from "./memory/sidecar-worker.js";
13
+ export { getApiKeyForModel } from "./models/api-keys.js";
14
+ export { findExactModelReferenceMatch, formatModelList, formatModelReference, resolveInitialModel, } from "./models/utils.js";
13
15
  export { APP_HOME_DIR, APP_NAME, AUTH_CONFIG_PATH, CHANNEL_CONFIG_PATH, MODELS_CONFIG_PATH, SETTINGS_CONFIG_PATH, SUB_AGENTS_DIR, SUB_AGENTS_DIR_NAME, WORKSPACE_DIR, } from "./paths.js";
14
- export { type AppendSystemPromptOptions, buildAppendSystemPrompt } from "./prompt-builder.js";
15
16
  export { createDingTalkContext } from "./runtime/delivery.js";
16
17
  export { type BusyMessageMode, DingTalkBot, type DingTalkConfig, type DingTalkContext, type DingTalkEvent, type DingTalkHandler, } from "./runtime/dingtalk.js";
17
18
  export { createEventsWatcher, EventsWatcher, type ImmediateEvent, type OneShotEvent, type PeriodicEvent, type ScheduledEvent, } from "./runtime/events.js";
18
19
  export { ChannelStore, type LoggedMessage, type LoggedSubAgentRun } from "./runtime/store.js";
19
20
  export { createExecutor, type ExecOptions, type ExecResult, type Executor, parseSandboxArg, type SandboxConfig, validateSandbox, } from "./sandbox.js";
20
- export { runSidecarTask, type SidecarResult, type SidecarTask, } from "./sidecar-worker.js";
21
+ export { type PipiclawMemoryRecallSettings, type PipiclawSessionMemorySettings, type PipiclawSettings, PipiclawSettingsManager, } from "./settings.js";
21
22
  export { discoverSubAgents, formatSubAgentList, getSubAgentsDir, type ResolvedSubAgentConfig, resolveSubAgentConfig, type SubAgentConfig, type SubAgentContextMode, type SubAgentDiscoveryResult, type SubAgentInvocationOverrides, type SubAgentMemoryMode, type SubAgentToolName, } from "./subagents/discovery.js";
22
23
  export { createSubAgentTool, type SubAgentToolDetails, type SubAgentToolOptions, } from "./subagents/tool.js";
23
24
  export { type CreatePipiclawToolsOptions, createPipiclawBaseTools, createPipiclawTools, } from "./tools/index.js";
package/dist/index.js CHANGED
@@ -1,23 +1,24 @@
1
- export { getOrCreateRunner } from "./agent.js";
2
- export { COMMAND_RESULT_CUSTOM_TYPE, createCommandExtension, } from "./command-extension.js";
3
- export { parseBuiltInCommand, renderBuiltInHelp } from "./commands.js";
4
- export { getAgentConfig, getApiKeyForModel, getSoul, loadPipiclawSkills, } from "./config-loader.js";
5
- export { PipiclawSettingsManager, } from "./context.js";
1
+ export { COMMAND_RESULT_CUSTOM_TYPE, createCommandExtension, } from "./agent/command-extension.js";
2
+ export { parseBuiltInCommand, renderBuiltInHelp, } from "./agent/commands.js";
3
+ export { getOrCreateRunner } from "./agent/index.js";
4
+ export { buildAppendSystemPrompt } from "./agent/prompt-builder.js";
5
+ export { getAgentConfig, getSoul, loadPipiclawSkills, } from "./agent/workspace-resources.js";
6
6
  export { buildMemoryCandidates, } from "./memory/candidates.js";
7
7
  export { runBackgroundMaintenance, runInlineConsolidation, } from "./memory/consolidation.js";
8
8
  export { ensureChannelMemoryFiles, ensureChannelMemoryFilesSync, getChannelSessionPath, readChannelSession, rewriteChannelSession, } from "./memory/files.js";
9
9
  export { MemoryLifecycle } from "./memory/lifecycle.js";
10
10
  export { recallRelevantMemory, } from "./memory/recall.js";
11
11
  export { renderSessionMemory, updateChannelSessionMemory, } from "./memory/session.js";
12
- export { findExactModelReferenceMatch, formatModelList, formatModelReference, resolveInitialModel, } from "./model-utils.js";
12
+ export { runSidecarTask, } from "./memory/sidecar-worker.js";
13
+ export { getApiKeyForModel } from "./models/api-keys.js";
14
+ export { findExactModelReferenceMatch, formatModelList, formatModelReference, resolveInitialModel, } from "./models/utils.js";
13
15
  export { APP_HOME_DIR, APP_NAME, AUTH_CONFIG_PATH, CHANNEL_CONFIG_PATH, MODELS_CONFIG_PATH, SETTINGS_CONFIG_PATH, SUB_AGENTS_DIR, SUB_AGENTS_DIR_NAME, WORKSPACE_DIR, } from "./paths.js";
14
- export { buildAppendSystemPrompt } from "./prompt-builder.js";
15
16
  export { createDingTalkContext } from "./runtime/delivery.js";
16
17
  export { DingTalkBot, } from "./runtime/dingtalk.js";
17
18
  export { createEventsWatcher, EventsWatcher, } from "./runtime/events.js";
18
19
  export { ChannelStore } from "./runtime/store.js";
19
20
  export { createExecutor, parseSandboxArg, validateSandbox, } from "./sandbox.js";
20
- export { runSidecarTask, } from "./sidecar-worker.js";
21
+ export { PipiclawSettingsManager, } from "./settings.js";
21
22
  export { discoverSubAgents, formatSubAgentList, getSubAgentsDir, resolveSubAgentConfig, } from "./subagents/discovery.js";
22
23
  export { createSubAgentTool, } from "./subagents/tool.js";
23
24
  export { createPipiclawBaseTools, createPipiclawTools, } from "./tools/index.js";
@@ -3,8 +3,8 @@ import { parseJsonObject } from "../shared/llm-json.js";
3
3
  import { splitH2Sections } from "../shared/markdown-sections.js";
4
4
  import { clipText } from "../shared/text-utils.js";
5
5
  import { buildStandardMessages } from "../shared/type-guards.js";
6
- import { runSidecarTask } from "../sidecar-worker.js";
7
6
  import { appendChannelHistoryBlock, appendChannelMemoryUpdate, readChannelHistory, readChannelMemory, readChannelSession, rewriteChannelHistory, rewriteChannelMemory, } from "./files.js";
7
+ import { runSidecarTask } from "./sidecar-worker.js";
8
8
  const INLINE_TRANSCRIPT_MAX_CHARS = 28_000;
9
9
  const MEMORY_CLEANUP_LENGTH_THRESHOLD = 5_000;
10
10
  const MEMORY_UPDATE_BLOCK_THRESHOLD = 4;
@@ -1,7 +1,7 @@
1
1
  import type { AgentMessage } from "@mariozechner/pi-agent-core";
2
2
  import type { Api, Model } from "@mariozechner/pi-ai";
3
3
  import type { ExtensionFactory, SessionEntry } from "@mariozechner/pi-coding-agent";
4
- import type { PipiclawSessionMemorySettings } from "../context.js";
4
+ import type { PipiclawSessionMemorySettings } from "../settings.js";
5
5
  export type ConsolidationReason = "compaction" | "new-session" | "idle";
6
6
  export interface MemoryLifecycleOptions {
7
7
  channelId: string;
@@ -1,8 +1,8 @@
1
1
  import { parseJsonObject } from "../shared/llm-json.js";
2
2
  import { HAN_REGEX } from "../shared/text-utils.js";
3
- import { runSidecarTask } from "../sidecar-worker.js";
4
3
  import { buildMemoryCandidates } from "./candidates.js";
5
4
  import { COMMON_CHINESE_WORDS } from "./chinese-words.js";
5
+ import { runSidecarTask } from "./sidecar-worker.js";
6
6
  const RERANK_SYSTEM_PROMPT = `You are selecting which memory snippets are most relevant to the current user turn.
7
7
 
8
8
  Return strict JSON only:
@@ -5,8 +5,8 @@ import { parseJsonObject } from "../shared/llm-json.js";
5
5
  import { splitH1Sections } from "../shared/markdown-sections.js";
6
6
  import { clipText } from "../shared/text-utils.js";
7
7
  import { buildStandardMessages, isRecord } from "../shared/type-guards.js";
8
- import { runSidecarTask, SidecarParseError } from "../sidecar-worker.js";
9
8
  import { readChannelMemory, readChannelSession, rewriteChannelSession } from "./files.js";
9
+ import { runSidecarTask, SidecarParseError } from "./sidecar-worker.js";
10
10
  const SESSION_TRANSCRIPT_MAX_CHARS = 20_000;
11
11
  const SESSION_MEMORY_MAX_CHARS = 4_000;
12
12
  const SESSION_ITEM_LIMIT = 12;
@@ -1,6 +1,6 @@
1
1
  import { Agent } from "@mariozechner/pi-agent-core";
2
2
  import { convertToLlm } from "@mariozechner/pi-coding-agent";
3
- import { extractAssistantText } from "./shared/text-utils.js";
3
+ import { extractAssistantText } from "../shared/text-utils.js";
4
4
  export class SidecarTimeoutError extends Error {
5
5
  constructor(taskName, timeoutMs) {
6
6
  super(`Sidecar task "${taskName}" timed out after ${timeoutMs}ms`);
@@ -0,0 +1,7 @@
1
+ import type { Api, Model } from "@mariozechner/pi-ai";
2
+ import type { ModelRegistry } from "@mariozechner/pi-coding-agent";
3
+ /**
4
+ * Resolve an API key for the given model's provider.
5
+ * Checks ModelRegistry first, then falls back to ANTHROPIC_API_KEY.
6
+ */
7
+ export declare function getApiKeyForModel(modelRegistry: ModelRegistry, model: Model<Api>): Promise<string>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Resolve an API key for the given model's provider.
3
+ * Checks ModelRegistry first, then falls back to ANTHROPIC_API_KEY.
4
+ */
5
+ export async function getApiKeyForModel(modelRegistry, model) {
6
+ const key = await modelRegistry.getApiKeyForProvider(model.provider);
7
+ if (key) {
8
+ return key;
9
+ }
10
+ const envKey = process.env.ANTHROPIC_API_KEY;
11
+ if (envKey) {
12
+ return envKey;
13
+ }
14
+ throw new Error(`No API key found for provider: ${model.provider}.\n\n` +
15
+ "Configure credentials in ~/.pi/pipiclaw/auth.json or ~/.pi/pipiclaw/models.json, or set the matching provider environment variable.");
16
+ }
@@ -1,6 +1,6 @@
1
1
  import { type Api, type Model } from "@mariozechner/pi-ai";
2
2
  import type { ModelRegistry } from "@mariozechner/pi-coding-agent";
3
- import type { PipiclawSettingsManager } from "./context.js";
3
+ import type { PipiclawSettingsManager } from "../settings.js";
4
4
  export declare function formatModelReference(model: Model<Api>): string;
5
5
  export declare function findExactModelReferenceMatch(modelReference: string, availableModels: Model<Api>[]): {
6
6
  match?: Model<Api>;
@@ -1,7 +1,7 @@
1
1
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
2
2
  import { join } from "path";
3
- import { getOrCreateRunner } from "../agent.js";
4
- import { parseBuiltInCommand } from "../commands.js";
3
+ import { parseBuiltInCommand } from "../agent/commands.js";
4
+ import { getOrCreateRunner } from "../agent/index.js";
5
5
  import * as log from "../log.js";
6
6
  import { ensureChannelMemoryFilesSync } from "../memory/files.js";
7
7
  import { APP_HOME_DIR, APP_NAME, AUTH_CONFIG_PATH, CHANNEL_CONFIG_PATH, MODELS_CONFIG_PATH, SETTINGS_CONFIG_PATH, WORKSPACE_DIR, } from "../paths.js";
@@ -11,7 +11,7 @@ import axios from "axios";
11
11
  import { DWClient, TOPIC_ROBOT } from "dingtalk-stream";
12
12
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
13
13
  import { dirname, join } from "path";
14
- import { parseBuiltInCommand, renderBuiltInHelp } from "../commands.js";
14
+ import { parseBuiltInCommand, renderBuiltInHelp } from "../agent/commands.js";
15
15
  import * as log from "../log.js";
16
16
  import { isRecord } from "../shared/type-guards.js";
17
17
  class ChannelQueue {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Context management for pipiclaw.
2
+ * Settings management for pipiclaw.
3
3
  *
4
4
  * `log.jsonl` and `context.jsonl` are treated as raw cold storage.
5
5
  * They are not proactively scanned or loaded as part of the memory model.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Context management for pipiclaw.
2
+ * Settings management for pipiclaw.
3
3
  *
4
4
  * `log.jsonl` and `context.jsonl` are treated as raw cold storage.
5
5
  * They are not proactively scanned or loaded as part of the memory model.
@@ -1,7 +1,7 @@
1
1
  import { parseFrontmatter } from "@mariozechner/pi-coding-agent";
2
2
  import { existsSync, readdirSync, readFileSync } from "fs";
3
3
  import { join } from "path";
4
- import { findExactModelReferenceMatch, formatModelReference } from "../model-utils.js";
4
+ import { findExactModelReferenceMatch, formatModelReference } from "../models/utils.js";
5
5
  import { SUB_AGENTS_DIR_NAME } from "../paths.js";
6
6
  const ALLOWED_SUB_AGENT_TOOLS = ["read", "bash", "edit", "write"];
7
7
  const DEFAULT_SUB_AGENT_TOOLS = ["read", "bash"];
@@ -1,7 +1,7 @@
1
1
  import { type AgentEvent, type AgentMessage, type AgentTool } from "@mariozechner/pi-agent-core";
2
2
  import type { Api, Model } from "@mariozechner/pi-ai";
3
- import type { PipiclawMemoryRecallSettings } from "../context.js";
4
3
  import type { Executor } from "../sandbox.js";
4
+ import type { PipiclawMemoryRecallSettings } from "../settings.js";
5
5
  import type { UsageTotals } from "../shared/types.js";
6
6
  import { type ResolvedSubAgentConfig, type SubAgentDiscoveryResult } from "./discovery.js";
7
7
  declare const subagentSchema: import("@sinclair/typebox").TObject<{
@@ -4,7 +4,7 @@ import { Type } from "@sinclair/typebox";
4
4
  import { createMemoryCandidateCache } from "../memory/candidates.js";
5
5
  import { readChannelSession } from "../memory/files.js";
6
6
  import { recallRelevantMemory } from "../memory/recall.js";
7
- import { formatModelReference } from "../model-utils.js";
7
+ import { formatModelReference } from "../models/utils.js";
8
8
  import { splitH1Sections } from "../shared/markdown-sections.js";
9
9
  import { clipText, extractAssistantText, extractLabelFromArgs, HAN_REGEX } from "../shared/text-utils.js";
10
10
  import { createBashTool } from "../tools/bash.js";
@@ -1,7 +1,7 @@
1
1
  import type { AgentTool } from "@mariozechner/pi-agent-core";
2
2
  import type { Api, Model } from "@mariozechner/pi-ai";
3
- import type { PipiclawMemoryRecallSettings } from "../context.js";
4
3
  import type { Executor, SandboxConfig } from "../sandbox.js";
4
+ import type { PipiclawMemoryRecallSettings } from "../settings.js";
5
5
  import type { SubAgentDiscoveryResult } from "../subagents/discovery.js";
6
6
  export interface CreatePipiclawToolsOptions {
7
7
  executor: Executor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oyasmi/pipiclaw",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "An AI assistant runtime for coding and team workflows, with DingTalk AI Cards, sub-agents, memory, and scheduled events.",
5
5
  "type": "module",
6
6
  "bin": {
package/dist/agent.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export type { AgentRunner } from "./agent/index.js";
2
- export { ChannelRunner, getOrCreateRunner } from "./agent/index.js";
package/dist/agent.js DELETED
@@ -1 +0,0 @@
1
- export { ChannelRunner, getOrCreateRunner } from "./agent/index.js";
File without changes
File without changes
File without changes