atom-agent 1.2.0 → 1.3.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 (54) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/README.md +13 -4
  3. package/atom.example.json +11 -0
  4. package/dist/App.js +923 -200
  5. package/dist/adapters.js +82 -13
  6. package/dist/agent/goal-evaluator.js +69 -0
  7. package/dist/agent/loop.js +517 -76
  8. package/dist/cli.js +11 -3
  9. package/dist/compact.js +41 -15
  10. package/dist/config.js +43 -7
  11. package/dist/context-manager.js +16 -198
  12. package/dist/context-windows.js +4 -2
  13. package/dist/env-block.js +5 -5
  14. package/dist/extension-commands.js +196 -0
  15. package/dist/extension-ui.js +153 -0
  16. package/dist/extensions.js +1571 -0
  17. package/dist/goal.js +583 -0
  18. package/dist/project-trust.js +96 -0
  19. package/dist/providers.js +6 -6
  20. package/dist/scheduler.js +74 -36
  21. package/dist/session.js +23 -5
  22. package/dist/sessions.js +25 -6
  23. package/dist/telemetry-dashboard.js +28 -0
  24. package/dist/telemetry.js +39 -0
  25. package/dist/tools/compaction-hooks.js +165 -0
  26. package/dist/tools/custom.js +189 -0
  27. package/dist/tools/intercept.js +145 -0
  28. package/dist/tools/overrides.js +105 -0
  29. package/dist/tools/provider-hooks.js +224 -0
  30. package/dist/tools/registry.js +246 -17
  31. package/dist/tools.js +44 -0
  32. package/dist/ui/palette.js +1 -1
  33. package/dist/ui/status-bar.js +80 -5
  34. package/dist/zen.js +305 -75
  35. package/documentation/architecture.md +114 -0
  36. package/documentation/cli.md +82 -0
  37. package/documentation/compaction.md +50 -0
  38. package/documentation/configuration.md +111 -0
  39. package/documentation/development.md +62 -0
  40. package/documentation/extensions.md +160 -0
  41. package/documentation/getting-started.md +63 -0
  42. package/documentation/goals.md +41 -0
  43. package/documentation/index.md +41 -0
  44. package/documentation/observability.md +70 -0
  45. package/documentation/permissions.md +66 -0
  46. package/documentation/providers.md +78 -0
  47. package/documentation/sessions.md +92 -0
  48. package/documentation/skills.md +57 -0
  49. package/documentation/tools.md +94 -0
  50. package/documentation/troubleshooting.md +54 -0
  51. package/examples/extensions/01-audit-gate.js +24 -0
  52. package/examples/extensions/02-notes-tool.js +32 -0
  53. package/examples/extensions/03-custom-command.js +32 -0
  54. package/package.json +6 -2
@@ -0,0 +1,24 @@
1
+ // 01-audit-gate — destructive-command audit gate.
2
+ //
3
+ // Blocks risky shell commands BEFORE they run. The returned reason commits
4
+ // as the normal model-visible result (approval is skipped, the turn
5
+ // continues); anything this hook does not block runs untouched.
6
+ //
7
+ // Gallery sample for documentation/extensions.md — that guide references
8
+ // this file by name and never duplicates it. Covered by
9
+ // tests/extension-gallery.test.ts, which loads this exact file through the
10
+ // real loadExtensions path.
11
+ module.exports = function auditGate(api) {
12
+ api.onBeforeToolCall(({ name, args }) => {
13
+ if (name !== "bash") return;
14
+ const command = String(args?.command ?? "");
15
+ const DESTRUCTIVE = ["rm -rf /", "rm -rf ~", "rm -rf .", "mkfs", ":(){:|:&};:"];
16
+ if (DESTRUCTIVE.some((sig) => command.includes(sig))) {
17
+ return {
18
+ block:
19
+ "destructive shell commands need explicit confirmation — " +
20
+ "narrow the command or confirm it with the user first",
21
+ };
22
+ }
23
+ });
24
+ };
@@ -0,0 +1,32 @@
1
+ // 02-notes-tool — model-callable notes tool.
2
+ //
3
+ // Registers a brand-new tool the model can call exactly like a builtin: it
4
+ // appears in the tool definitions, validates args inline (bad args are an
5
+ // `Error: invalid call: ...` result and the implementation never runs), and
6
+ // dispatches through the shared loop.
7
+ //
8
+ // Gallery sample for documentation/extensions.md — that guide references
9
+ // this file by name and never duplicates it. Covered by
10
+ // tests/extension-gallery.test.ts, which loads this exact file through the
11
+ // real loadExtensions path.
12
+ const notes = [];
13
+
14
+ module.exports = function notesTool(api) {
15
+ api.registerTool({
16
+ name: "gallery_notes",
17
+ description: "Save a short note and read it back. Use it to remember user preferences across the turn.",
18
+ parameters: {
19
+ type: "object",
20
+ properties: { text: { type: "string" } },
21
+ required: ["text"],
22
+ additionalProperties: false,
23
+ },
24
+ execute: async (args) => {
25
+ notes.push(String(args.text));
26
+ return `saved note #${notes.length}: ${notes[notes.length - 1]}`;
27
+ },
28
+ // Pure, side-effect-free helper (in-memory only): safe to run without an
29
+ // approval prompt. Anything with a real footprint keeps the default.
30
+ requireApproval: false,
31
+ });
32
+ };
@@ -0,0 +1,32 @@
1
+ // 03-custom-command — custom slash command with a dialog.
2
+ //
3
+ // Registers a real `/gallery-plan` command: it asks the user to pick a
4
+ // target in a modal dialog, then posts the plan to the transcript. The
5
+ // workflow logic lives in the pure summarizeChoice helper (no modal, no
6
+ // transcript) so the dialog flow is testable headless — tests drive the
7
+ // command with a stub askUser and unit-test the helper directly.
8
+ //
9
+ // Gallery sample for documentation/extensions.md — that guide references
10
+ // this file by name and never duplicates it. Covered by
11
+ // tests/extension-gallery.test.ts, which loads this exact file through the
12
+ // real loadExtensions path.
13
+ function summarizeChoice(choice, extra) {
14
+ const scope = String(extra ?? "").trim();
15
+ return scope.length > 0 ? `deploying to ${choice} (${scope})` : `deploying to ${choice}`;
16
+ }
17
+
18
+ function galleryCommand(api) {
19
+ api.registerCommand({
20
+ name: "gallery-plan",
21
+ description: "Pick a deploy target and post the plan.",
22
+ handler: async (ctx) => {
23
+ const choice = await ctx.askUser("Which environment?", ["staging", "prod"]);
24
+ const plan = summarizeChoice(choice, ctx.args);
25
+ ctx.say(plan);
26
+ return `plan posted for ${choice}`;
27
+ },
28
+ });
29
+ }
30
+
31
+ module.exports = galleryCommand;
32
+ module.exports.summarizeChoice = summarizeChoice;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atom-agent",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Agentic terminal coding assistant: multi-provider LLM loop with local file/shell/web tools in an Ink (React) TUI.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -23,7 +23,10 @@
23
23
  "dist",
24
24
  "README.md",
25
25
  "LICENSE",
26
- "CHANGELOG.md"
26
+ "CHANGELOG.md",
27
+ "documentation",
28
+ "examples",
29
+ "atom.example.json"
27
30
  ],
28
31
  "keywords": [
29
32
  "ai-agent",
@@ -41,6 +44,7 @@
41
44
  },
42
45
  "dependencies": {
43
46
  "ink": "7.1.1",
47
+ "jiti": "^2.7.0",
44
48
  "react": "19.2.8"
45
49
  },
46
50
  "devDependencies": {