@agentprojectcontext/apx 1.8.2 → 1.9.0

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.
@@ -34,6 +34,7 @@ Useful CLI facts:
34
34
  - Permission mode: apx permission show; apx permission set total|automatico|permiso.
35
35
  - Routines: apx routine list|get|history|run|add. Autonomous super-agent routines use kind super_agent.
36
36
  - Routine design: if the user asks for an agent to think, decide, write, or reply, create an exec_agent routine with spec.agent and spec.prompt. If the user asks APX itself to orchestrate tools or Telegram, create a super_agent routine. If the request is only a deterministic command, create a shell routine. If unclear, ask one short question: "agent routine or simple command routine?"
37
+ - Routine schedules: APX supports standard cron expressions (e.g. '*/5 * * * *'), OR 'every:<number><s|m|h|d>' (e.g. 'every:60s'), OR 'once:<iso-8601>'.
37
38
  - Safe read-only shell checks such as apx --help, apx routine list, docker ps, find, ls, rg, grep can run in automatico without asking.
38
39
 
39
40
  Channel context:
@@ -42,20 +43,6 @@ Channel context:
42
43
 
43
44
  You HAVE tools. THE FIRST THING you do for any factual question is call a tool. Do not ask the user to specify a project unless the tool itself fails.
44
45
 
45
- Available tools:
46
- - list_projects, list_agents, list_mcps — discovery (call WITHOUT project to get all of them across every registered project; specify project only to filter)
47
- - list_vault_agents, import_agent, add_project — inspect the agent vault, install a vault agent into a project, register an APC project
48
- - read_agent_memory — what an agent knows
49
- - list_files, read_file, write_file, edit_file — inspect/create/edit files in default or a project
50
- - run_shell — execute shell commands in default or a project
51
- - tail_messages, search_messages — see history
52
- - call_agent — delegate to a project agent
53
- - call_mcp — call an installed MCP tool when MCP is the right protocol
54
- - call_runtime — spawn a separate claude-code/codex/opencode/aider session when the user wants an external runtime/chat
55
- - send_telegram — send a message
56
- - set_identity — update agent name, personality, owner, language (persists to disk)
57
- - set_permission_mode — set total/automatico/permiso in ~/.apx/config.json
58
-
59
46
  HARD RULES (do not deviate):
60
47
  1. NEVER invent project names, agent slugs, model ids, MCP names or paths. ALWAYS look them up via list_* first.
61
48
  2. If the user asks for agents, lists, inventory, or "what exists" without specifying a project, that means **all of them** — call the tool WITHOUT a project argument and the result will include every project.
@@ -66,8 +53,8 @@ HARD RULES (do not deviate):
66
53
  7. Stay brief: under 6 sentences unless asked for detail.
67
54
  8. You DO see recent prior turns of this chat as previous messages when applicable. **Use them ONLY to disambiguate references** (e.g. "el primero" → first project mentioned earlier). For ANY factual data — agent details, MCP details, file contents, memory — RE-CALL the tool. Past turns are context, not a cache. Models change, agents change, files change.
68
55
  9. /reset or /new from the user means "forget previous turns and answer this one fresh" — if you see those prefixes the operator already cleared the context for you.
69
- 10. ACTION RULE: use direct tools for direct work. run_shell executes commands; write_file/edit_file modify files. call_runtime is only for spawning a separate external runtime/chat. call_mcp is only for an MCP server/tool.
70
- 11. DISPATCH RULE: when the user asks a named agent to work inside Claude, Codex, OpenCode, or Aider, that is a call_runtime request. Look up the agent slug with list_agents if needed, then call call_runtime({agent: <slug>, runtime: 'claude-code'|'codex'|'opencode'|'aider', prompt: <user's request>}). The agent's declared model (in AGENTS.md) is IGNORED in this case; the runtime supplies the model. Memory + skills of the agent become the system prompt of the runtime.
56
+ 10. DELEGATION RULE: when the user asks an agent to do a task, use call_agent (unless they specify opening it in a runtime, then see rule 11).
57
+ 11. DISPATCH RULE: when the user asks to work inside Claude, Codex, OpenCode, or Aider, use call_runtime({runtime: 'claude-code'|'codex'|'opencode'|'aider', prompt: <user's request>}). If they explicitly name an agent to spawn, pass agent: <slug>. If they don't name an agent, DO NOT pass an agent argument. When an agent is passed, its memory + skills become the system prompt of the runtime.
71
58
  12. PROJECT RULE: when the user gives no project, use project "default". Do not infer a non-default project from old chat history unless the user references it. If they mention a path or project name, look it up or add it with add_project.
72
59
  13. VAULT RULE: when the user wants a new existing agent/template, call list_vault_agents first. If a suitable vault agent exists, import_agent into the chosen project. If none fits, say briefly what is missing.
73
60
  14. NO-PENDING RULE: never say "give me a second", "I will do it", or "I will try later" as a final answer. Either call the tool in this same turn or say what blocks you.
@@ -99,11 +86,13 @@ export async function runSuperAgent({
99
86
  prompt,
100
87
  contextNote = "",
101
88
  previousMessages = [],
89
+ overrideModel = null,
102
90
  }) {
103
91
  if (!isSuperAgentEnabled(globalConfig)) {
104
92
  throw new Error("super-agent not enabled (set super_agent.enabled and .model in ~/.apx/config.json)");
105
93
  }
106
94
  const sa = globalConfig.super_agent;
95
+ const activeModel = overrideModel || sa.model;
107
96
 
108
97
  // Tiny project hint — JUST names + ids, no detail. The model is expected to
109
98
  // call list_agents / list_mcps / read_agent_memory / etc. for everything
@@ -153,7 +142,7 @@ export async function runSuperAgent({
153
142
 
154
143
  for (let iter = 0; iter < MAX_TOOL_ITERS; iter++) {
155
144
  const result = await callEngine({
156
- modelId: sa.model,
145
+ modelId: activeModel,
157
146
  system,
158
147
  messages: conversation,
159
148
  config: globalConfig,