@agentprojectcontext/apx 1.65.3 → 1.67.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.
Files changed (55) hide show
  1. package/package.json +3 -2
  2. package/skills/apx/SKILL.md +3 -0
  3. package/src/core/agent/index.js +2 -0
  4. package/src/core/agent/judge.js +174 -0
  5. package/src/core/agent/model-router.js +107 -5
  6. package/src/core/agent/prompts/modes/code-build.md +1 -1
  7. package/src/core/agent/run-agent.js +149 -12
  8. package/src/core/agent/security.js +97 -0
  9. package/src/core/agent/stuck-detector.js +89 -0
  10. package/src/core/agent/super-agent.js +58 -17
  11. package/src/core/agent/tools/handlers/run-subagent.js +117 -0
  12. package/src/core/agent/tools/helpers.js +11 -1
  13. package/src/core/agent/tools/names.js +2 -0
  14. package/src/core/agent/tools/registry.js +10 -0
  15. package/src/core/artifacts/preview.js +392 -0
  16. package/src/core/artifacts/tunnel.js +169 -0
  17. package/src/core/config/index.js +62 -1
  18. package/src/core/config/secret-values.js +132 -0
  19. package/src/core/engines/mock.js +15 -1
  20. package/src/core/engines/presets.js +102 -0
  21. package/src/core/logging.js +10 -3
  22. package/src/core/memory/compactor.js +65 -56
  23. package/src/core/memory/summarizer.js +125 -0
  24. package/src/core/stores/conversations-compactor.js +24 -31
  25. package/src/host/daemon/api/admin-config.js +5 -0
  26. package/src/host/daemon/api/artifact-preview.js +82 -0
  27. package/src/host/daemon/api/engines.js +6 -0
  28. package/src/host/daemon/api/web.js +1 -1
  29. package/src/host/daemon/api.js +2 -0
  30. package/src/host/daemon/index.js +16 -1
  31. package/src/interfaces/acp/index.js +363 -0
  32. package/src/interfaces/acp/jsonrpc.js +180 -0
  33. package/src/interfaces/acp/session.js +205 -0
  34. package/src/interfaces/cli/commands/acp.js +10 -0
  35. package/src/interfaces/cli/commands/artifact.js +115 -0
  36. package/src/interfaces/cli/commands/setup.js +6 -3
  37. package/src/interfaces/cli/index.js +74 -0
  38. package/src/interfaces/web/dist/assets/index-B3pEwe1m.js +803 -0
  39. package/src/interfaces/web/dist/assets/index-B3pEwe1m.js.map +1 -0
  40. package/src/interfaces/web/dist/assets/index-BPGECxzm.css +1 -0
  41. package/src/interfaces/web/dist/index.html +2 -2
  42. package/src/interfaces/web/package-lock.json +6 -6
  43. package/src/interfaces/web/src/components/code/CodeArtifactsTab.tsx +145 -2
  44. package/src/interfaces/web/src/components/settings/RoutingPanel.tsx +236 -0
  45. package/src/interfaces/web/src/components/settings/providers/typeStyles.ts +44 -25
  46. package/src/interfaces/web/src/i18n/en.ts +47 -0
  47. package/src/interfaces/web/src/i18n/es.ts +47 -0
  48. package/src/interfaces/web/src/lib/api/artifacts.ts +38 -0
  49. package/src/interfaces/web/src/lib/api/engines.ts +14 -0
  50. package/src/interfaces/web/src/main.tsx +5 -0
  51. package/src/interfaces/web/src/screens/base/ModelsTab.tsx +4 -2
  52. package/src/interfaces/web/src/types/daemon.ts +16 -0
  53. package/src/interfaces/web/dist/assets/index-BuII-tAi.css +0 -1
  54. package/src/interfaces/web/dist/assets/index-CFcs16SV.js +0 -778
  55. package/src/interfaces/web/dist/assets/index-CFcs16SV.js.map +0 -1
@@ -91,6 +91,7 @@ import {
91
91
  cmdConversationsGet,
92
92
  } from "./commands/chat.js";
93
93
  import { cmdCode } from "./commands/code.js";
94
+ import { cmdAcp } from "./commands/acp.js";
94
95
  import { cmdRun, cmdEnvDetect } from "./commands/runtime.js";
95
96
  import { cmdSend, cmdConnections } from "./commands/a2a.js";
96
97
  import {
@@ -130,6 +131,10 @@ import {
130
131
  cmdArtifactShow,
131
132
  cmdArtifactRemove,
132
133
  cmdArtifactRun,
134
+ cmdArtifactPreview,
135
+ cmdArtifactShare,
136
+ cmdArtifactPreviews,
137
+ cmdArtifactStop,
133
138
  } from "./commands/artifact.js";
134
139
  import {
135
140
  cmdTaskAdd,
@@ -1133,6 +1138,17 @@ const HELP_TOPICS = new Map(Object.entries({
1133
1138
  ],
1134
1139
  examples: ["apx chat reviewer", "apx chat reviewer --conversation abc123"],
1135
1140
  }),
1141
+ acp: topic({
1142
+ title: "apx acp",
1143
+ summary: "Serve the APX super-agent over the Agent Client Protocol (ACP) on stdio.",
1144
+ usage: ["apx acp"],
1145
+ notes: [
1146
+ "For ACP clients (Zed, JetBrains, marimo, …) that spawn agents as subprocesses.",
1147
+ "stdout carries the protocol — logs go to stderr and ~/.apx/logs/apx.log.",
1148
+ "Sessions resolve the APC project from the client's workspace cwd.",
1149
+ ],
1150
+ examples: ["apx acp"],
1151
+ }),
1136
1152
  code: topic({
1137
1153
  title: "apx code",
1138
1154
  summary: "Start the APX terminal coding assistant with system and workspace context.",
@@ -1315,6 +1331,10 @@ const HELP_TOPICS = new Map(Object.entries({
1315
1331
  ["list | ls", "List artifacts in the project."],
1316
1332
  ["show <name>", "Print artifact content."],
1317
1333
  ["run <name> [args...]", "Execute a runnable artifact (shebang or +x). Stdio is inherited."],
1334
+ ["preview <name> [--open] [--share]", "Serve HTML/React/static artifacts on an ephemeral local server with live-reload."],
1335
+ ["share <name> [--open]", "Preview + open a public tunnel URL (cloudflared/localtunnel)."],
1336
+ ["previews", "List running preview servers."],
1337
+ ["stop <id> | --all", "Stop a preview server."],
1318
1338
  ["remove | rm <name>", "Delete an artifact."],
1319
1339
  ],
1320
1340
  examples: [
@@ -1322,8 +1342,49 @@ const HELP_TOPICS = new Map(Object.entries({
1322
1342
  "apx artifact list",
1323
1343
  "apx artifact show check_asana.sh",
1324
1344
  "apx artifact run check_asana.sh",
1345
+ "apx artifact preview dashboard.html --open",
1346
+ "apx artifact share report.jsx",
1347
+ ],
1348
+ }),
1349
+ "artifact preview": topic({
1350
+ title: "apx artifact preview",
1351
+ summary: "Serve an artifact on an ephemeral local web server and print an interactive link. HTML, single-file React (.jsx/.tsx), static dirs, and text are all rendered; the page auto-reloads when the file changes.",
1352
+ usage: ["apx artifact preview <name> [--open] [--share] [--no-watch] [--project <name|id|path>]"],
1353
+ options: [
1354
+ ["--open", "Open the local URL in your default browser."],
1355
+ ["--share", "Also create a public tunnel URL for quick sharing."],
1356
+ ["--no-watch", "Disable live-reload on file change."],
1357
+ ["--project <name|id|path>", "Pin command to a specific project."],
1358
+ ],
1359
+ examples: [
1360
+ "apx artifact preview dashboard.html --open",
1361
+ "apx artifact preview app.jsx --share",
1325
1362
  ],
1326
1363
  }),
1364
+ "artifact share": topic({
1365
+ title: "apx artifact share",
1366
+ summary: "Preview an artifact and expose it through a secure public tunnel (cloudflared, falling back to localtunnel). Prints a temporary public URL anyone can open.",
1367
+ usage: ["apx artifact share <name> [--open] [--no-watch] [--project <name|id|path>]"],
1368
+ options: [
1369
+ ["--open", "Open the public URL in your default browser."],
1370
+ ["--no-watch", "Disable live-reload on file change."],
1371
+ ["--project <name|id|path>", "Pin command to a specific project."],
1372
+ ],
1373
+ examples: ["apx artifact share report.jsx --open"],
1374
+ }),
1375
+ "artifact previews": topic({
1376
+ title: "apx artifact previews",
1377
+ summary: "List running artifact preview servers (id, name, kind, local + public URLs).",
1378
+ usage: ["apx artifact previews"],
1379
+ examples: ["apx artifact previews"],
1380
+ }),
1381
+ "artifact stop": topic({
1382
+ title: "apx artifact stop",
1383
+ summary: "Stop a running preview server (and its tunnel).",
1384
+ usage: ["apx artifact stop <id>", "apx artifact stop --all"],
1385
+ options: [["--all", "Stop every running preview."]],
1386
+ examples: ["apx artifact stop 3f9a1c2b", "apx artifact stop --all"],
1387
+ }),
1327
1388
  "artifact create": topic({
1328
1389
  title: "apx artifact create",
1329
1390
  summary: "Create a new managed artifact file.",
@@ -2099,6 +2160,7 @@ function buildHelp(version) {
2099
2160
  hCmd("apx search \"query\"", 36, "web search (ddg | brave | browser) --mode <m> -n N"),
2100
2161
  hCmd("apx conversations list", 36, "stored exec/chat conversations for <agent>"),
2101
2162
  hCmd("apx conversations get", 36, "<agent> <id>"),
2163
+ hCmd("apx acp", 36, "serve the super-agent over the Agent Client Protocol (stdio, for IDEs)"),
2102
2164
 
2103
2165
  hSec("Runtimes"),
2104
2166
  hCmd("apx run <agent>", 36, "--runtime <id> \"prompt\" --timeout <s>"),
@@ -2137,6 +2199,9 @@ function buildHelp(version) {
2137
2199
  hCmd("apx artifact create <name>", 36, "create managed file in project storage [--content '...'] [--project 0]"),
2138
2200
  hCmd("apx artifact list", 36, "list artifacts"),
2139
2201
  hCmd("apx artifact show <name>", 36, "print artifact content"),
2202
+ hCmd("apx artifact preview <name>",36, "serve HTML/React on a local URL w/ live-reload [--open] [--share]"),
2203
+ hCmd("apx artifact share <name>", 36, "preview + public tunnel URL"),
2204
+ hCmd("apx artifact previews", 36, "list running previews (stop with: apx artifact stop <id>)"),
2140
2205
  hCmd("apx artifact remove <name>", 36, ""),
2141
2206
 
2142
2207
  hSec("Commands & Skills"),
@@ -2516,6 +2581,11 @@ async function dispatch(cmd, rest) {
2516
2581
  await cmdExec(parseArgs(rest));
2517
2582
  break;
2518
2583
 
2584
+ case "acp":
2585
+ // ACP server owns stdio until the client closes the pipe.
2586
+ await cmdAcp(parseArgs(rest));
2587
+ return;
2588
+
2519
2589
  case "search":
2520
2590
  await cmdSearch(parseArgs(rest));
2521
2591
  break;
@@ -2613,6 +2683,10 @@ async function dispatch(cmd, rest) {
2613
2683
  else if (sub === "show" || sub === "get") await cmdArtifactShow(a);
2614
2684
  else if (sub === "remove" || sub === "rm") await cmdArtifactRemove(a);
2615
2685
  else if (sub === "run") await cmdArtifactRun(a);
2686
+ else if (sub === "preview" || sub === "serve") await cmdArtifactPreview(a);
2687
+ else if (sub === "share") await cmdArtifactShare(a);
2688
+ else if (sub === "previews") await cmdArtifactPreviews(a);
2689
+ else if (sub === "stop") await cmdArtifactStop(a);
2616
2690
  else die(`unknown artifact subcommand: ${sub}`);
2617
2691
  break;
2618
2692
  }