@agentprojectcontext/apx 1.7.0 → 1.8.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.
- package/README.md +4 -0
- package/package.json +1 -1
- package/src/cli/commands/config.js +23 -0
- package/src/cli/commands/messages.js +45 -0
- package/src/cli/commands/routine.js +27 -2
- package/src/cli/commands/setup.js +2 -2
- package/src/cli/index.js +969 -3
- package/src/core/apc-context-skill.md +3 -0
- package/src/core/apx-skill.md +30 -0
- package/src/core/messages-store.js +94 -20
- package/src/core/routines-store.js +3 -1
- package/src/daemon/api.js +3 -3
- package/src/daemon/index.js +1 -0
- package/src/daemon/plugins/telegram.js +32 -2
- package/src/daemon/routines.js +64 -2
- package/src/daemon/super-agent-tools/helpers.js +4 -3
- package/src/daemon/super-agent-tools/index.js +5 -1
- package/src/daemon/super-agent-tools/tools/run-shell.js +23 -1
- package/src/daemon/super-agent-tools/tools/search-messages.js +2 -0
- package/src/daemon/super-agent-tools/tools/set-permission-mode.js +32 -0
- package/src/daemon/super-agent-tools/tools/tail-messages.js +2 -0
- package/src/daemon/super-agent.js +24 -2
|
@@ -30,6 +30,11 @@ APX is a local daemon + CLI for APC projects. User-level runtime state lives und
|
|
|
30
30
|
|
|
31
31
|
APC projects are filesystem projects anywhere on disk with AGENTS.md and .apc/project.json. They contain agents, memories, skills, MCP hints, commands, and routines. The default workspace is not a user project; it is your APX home workspace. Registered projects are listed below as a tiny index; call tools for details.
|
|
32
32
|
|
|
33
|
+
Useful CLI facts:
|
|
34
|
+
- Permission mode: apx permission show; apx permission set total|automatico|permiso.
|
|
35
|
+
- Routines: apx routine list|get|history|run|add. Autonomous super-agent routines use kind super_agent.
|
|
36
|
+
- Safe read-only shell checks such as apx --help, apx routine list, docker ps, find, ls, rg, grep can run in automatico without asking.
|
|
37
|
+
|
|
33
38
|
Channel context:
|
|
34
39
|
- If the context note says Telegram, you are replying through Telegram. Use plain text, brief replies, no markdown tables, no code fences unless needed, no long dumps.
|
|
35
40
|
- If not Telegram, answer normally for the caller, still concise.
|
|
@@ -48,13 +53,14 @@ Available tools:
|
|
|
48
53
|
- call_runtime — spawn a separate claude-code/codex/opencode/aider session when the user wants an external runtime/chat
|
|
49
54
|
- send_telegram — send a message
|
|
50
55
|
- set_identity — update agent name, personality, owner, language (persists to disk)
|
|
56
|
+
- set_permission_mode — set total/automatico/permiso in ~/.apx/config.json
|
|
51
57
|
|
|
52
58
|
HARD RULES (do not deviate):
|
|
53
59
|
1. NEVER invent project names, agent slugs, model ids, MCP names or paths. ALWAYS look them up via list_* first.
|
|
54
60
|
2. If the user says "los agentes" / "lista" / "qué hay" without specifying a project, that means **all of them** — call the tool WITHOUT a project argument and the result will include every project.
|
|
55
61
|
3. NEVER answer "specify a project" — instead, just call the tool with no argument and you'll get the full picture.
|
|
56
62
|
4. If a tool result has an error, retry with different arguments before falling back to asking the user.
|
|
57
|
-
5. Respect permission mode. total = execute requested actions without confirmation. automatico = read/list/safe actions run directly; destructive, external,
|
|
63
|
+
5. Respect permission mode. total = execute requested actions without confirmation. automatico = read/list/safe shell actions run directly; destructive, external, runtime, MCP calls, outbound messages, config, and filesystem mutations need explicit user confirmation. permiso = only allowed tools run directly; everything else needs confirmation.
|
|
58
64
|
6. Default language: es-AR. Plain text, no markdown formatting (Telegram doesn't render it).
|
|
59
65
|
7. Stay brief: under 6 sentences unless asked for detail.
|
|
60
66
|
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.
|
|
@@ -63,7 +69,21 @@ HARD RULES (do not deviate):
|
|
|
63
69
|
11. DISPATCH RULE: when the user says things like "que <agente> haga X", "iniciá una sesión con Claude/Codex", "que <agente> arranque <runtime>", "andá a <runtime> y hacé X" — 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.
|
|
64
70
|
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.
|
|
65
71
|
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.
|
|
66
|
-
14.
|
|
72
|
+
14. NO-PENDING RULE: never say "dame un segundo", "voy a hacerlo", or "lo intento luego" as a final answer. Either call the tool in this same turn or say what blocks you.
|
|
73
|
+
15. IDENTITY RULE: when the user asks you to change your name ("llamame X", "call yourself X", "tu nombre es X"), or update your personality/language, call set_identity and persist the change. Then confirm with your new name.`;
|
|
74
|
+
|
|
75
|
+
function isShortConfirmation(text) {
|
|
76
|
+
return /^(s[ií]|si dale|sí dale|dale|ok|oka|okey|confirmo|confirmado|mandale|hacelo|proced[eé]|vamos)\b/i
|
|
77
|
+
.test(String(text || "").trim());
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function lastAssistantAskedForConfirmation(messages) {
|
|
81
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
82
|
+
if (messages[i]?.role !== "assistant") continue;
|
|
83
|
+
return /\b(confirm[aá]s?|confirmame|ok|permiso|puedo|dale|proced[ao])\b/i.test(messages[i].content || "");
|
|
84
|
+
}
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
67
87
|
|
|
68
88
|
export function isSuperAgentEnabled(cfg) {
|
|
69
89
|
return !!(cfg && cfg.super_agent && cfg.super_agent.enabled && cfg.super_agent.model);
|
|
@@ -117,6 +137,8 @@ export async function runSuperAgent({
|
|
|
117
137
|
plugins,
|
|
118
138
|
registries,
|
|
119
139
|
globalConfig,
|
|
140
|
+
implicitConfirmation:
|
|
141
|
+
isShortConfirmation(prompt) && lastAssistantAskedForConfirmation(previousMessages),
|
|
120
142
|
});
|
|
121
143
|
|
|
122
144
|
// Agent loop: call model → if tool_calls, execute and feed back; repeat.
|