@iinm/plain-agent 1.0.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 (79) hide show
  1. package/.config/agents.library/code-simplifier.md +5 -0
  2. package/.config/agents.library/qa-engineer.md +74 -0
  3. package/.config/agents.library/software-architect.md +278 -0
  4. package/.config/agents.predefined/worker.md +3 -0
  5. package/.config/config.predefined.json +825 -0
  6. package/.config/prompts.library/code-review.md +8 -0
  7. package/.config/prompts.library/feature-dev.md +6 -0
  8. package/.config/prompts.predefined/shortcuts/commit-by-user.md +9 -0
  9. package/.config/prompts.predefined/shortcuts/commit.md +10 -0
  10. package/.config/prompts.predefined/shortcuts/general-question.md +6 -0
  11. package/LICENSE +21 -0
  12. package/README.md +624 -0
  13. package/bin/plain +3 -0
  14. package/bin/plain-interrupt +6 -0
  15. package/bin/plain-notify-desktop +19 -0
  16. package/bin/plain-notify-terminal-bell +3 -0
  17. package/package.json +57 -0
  18. package/sandbox/bin/plain-sandbox +972 -0
  19. package/src/agent.d.ts +48 -0
  20. package/src/agent.mjs +159 -0
  21. package/src/agentLoop.mjs +369 -0
  22. package/src/agentState.mjs +41 -0
  23. package/src/cliArgs.mjs +45 -0
  24. package/src/cliFormatter.mjs +217 -0
  25. package/src/cliInteractive.mjs +739 -0
  26. package/src/config.d.ts +48 -0
  27. package/src/config.mjs +168 -0
  28. package/src/context/consumeInterruptMessage.mjs +30 -0
  29. package/src/context/loadAgentRoles.mjs +272 -0
  30. package/src/context/loadPrompts.mjs +312 -0
  31. package/src/context/loadUserMessageContext.mjs +147 -0
  32. package/src/env.mjs +46 -0
  33. package/src/main.mjs +202 -0
  34. package/src/mcp.mjs +202 -0
  35. package/src/model.d.ts +109 -0
  36. package/src/modelCaller.mjs +29 -0
  37. package/src/modelDefinition.d.ts +73 -0
  38. package/src/prompt.mjs +128 -0
  39. package/src/providers/anthropic.d.ts +248 -0
  40. package/src/providers/anthropic.mjs +596 -0
  41. package/src/providers/gemini.d.ts +208 -0
  42. package/src/providers/gemini.mjs +752 -0
  43. package/src/providers/openai.d.ts +281 -0
  44. package/src/providers/openai.mjs +551 -0
  45. package/src/providers/openaiCompatible.d.ts +147 -0
  46. package/src/providers/openaiCompatible.mjs +658 -0
  47. package/src/providers/platform/azure.mjs +42 -0
  48. package/src/providers/platform/bedrock.mjs +74 -0
  49. package/src/providers/platform/googleCloud.mjs +34 -0
  50. package/src/subagent.mjs +247 -0
  51. package/src/tmpfile.mjs +27 -0
  52. package/src/tool.d.ts +74 -0
  53. package/src/toolExecutor.mjs +236 -0
  54. package/src/toolInputValidator.mjs +183 -0
  55. package/src/toolUseApprover.mjs +98 -0
  56. package/src/tools/askGoogle.mjs +135 -0
  57. package/src/tools/delegateToSubagent.d.ts +4 -0
  58. package/src/tools/delegateToSubagent.mjs +48 -0
  59. package/src/tools/execCommand.d.ts +22 -0
  60. package/src/tools/execCommand.mjs +200 -0
  61. package/src/tools/fetchWebPage.mjs +96 -0
  62. package/src/tools/patchFile.d.ts +4 -0
  63. package/src/tools/patchFile.mjs +96 -0
  64. package/src/tools/reportAsSubagent.d.ts +3 -0
  65. package/src/tools/reportAsSubagent.mjs +44 -0
  66. package/src/tools/tavilySearch.d.ts +6 -0
  67. package/src/tools/tavilySearch.mjs +57 -0
  68. package/src/tools/tmuxCommand.d.ts +14 -0
  69. package/src/tools/tmuxCommand.mjs +194 -0
  70. package/src/tools/writeFile.d.ts +4 -0
  71. package/src/tools/writeFile.mjs +56 -0
  72. package/src/utils/evalJSONConfig.mjs +48 -0
  73. package/src/utils/matchValue.d.ts +6 -0
  74. package/src/utils/matchValue.mjs +40 -0
  75. package/src/utils/noThrow.mjs +31 -0
  76. package/src/utils/notify.mjs +28 -0
  77. package/src/utils/parseFileRange.mjs +18 -0
  78. package/src/utils/readFileRange.mjs +33 -0
  79. package/src/utils/retryOnError.mjs +41 -0
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -eu -o pipefail
4
+
5
+ mkdir -p .plain-agent
6
+ echo -e "$@" >> .plain-agent/interrupt-message.txt
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -eu -o pipefail
4
+
5
+ title="$(basename "$(pwd)")"
6
+ content="Agent is waiting for you 👋"
7
+
8
+ if command -v osascript > /dev/null 2>&1; then
9
+ # macOS - use osascript
10
+ escaped_title=$(printf '%s' "$title" | sed -e 's,",\\\\",g')
11
+ escaped_content=$(printf '%s' "$content" | sed -e 's,",\\\\",g')
12
+ osascript -e "display notification \"$escaped_content\" with title \"$escaped_title\""
13
+ elif command -v notify-send > /dev/null 2>&1; then
14
+ # Linux - use notify-send
15
+ notify-send "$title" "$content"
16
+ else
17
+ # Fallback - Terminal bell
18
+ printf "\a"
19
+ fi
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bash
2
+
3
+ printf "\a"
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@iinm/plain-agent",
3
+ "version": "1.0.0",
4
+ "description": "A lightweight CLI-based coding agent",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/iinm/plain-agent.git"
10
+ },
11
+ "bin": {
12
+ "plain": "./bin/plain",
13
+ "plain-interrupt": "./bin/plain-interrupt",
14
+ "plain-notify-desktop": "./bin/plain-notify-desktop",
15
+ "plain-notify-terminal-bell": "./bin/plain-notify-terminal-bell",
16
+ "plain-sandbox": "./sandbox/bin/plain-sandbox"
17
+ },
18
+ "files": [
19
+ "bin",
20
+ "sandbox/bin",
21
+ ".config",
22
+ "src/**/*.mjs",
23
+ "src/**/*.d.ts",
24
+ "!src/**/*.test.mjs",
25
+ "!src/**/*.playground.mjs",
26
+ "!src/utils/test/"
27
+ ],
28
+ "engines": {
29
+ "node": ">=22"
30
+ },
31
+ "scripts": {
32
+ "check": "npm run lint && tsc && npm run test",
33
+ "test": "node --test",
34
+ "lint": "npx @biomejs/biome check",
35
+ "fix": "npx @biomejs/biome check --fix"
36
+ },
37
+ "dependencies": {
38
+ "@aws-crypto/sha256-js": "^5.2.0",
39
+ "@aws-sdk/credential-providers": "^3.1001.0",
40
+ "@modelcontextprotocol/sdk": "^1.27.1",
41
+ "@mozilla/readability": "^0.6.0",
42
+ "@smithy/protocol-http": "^5.3.10",
43
+ "@smithy/signature-v4": "^5.3.10",
44
+ "diff": "^8.0.3",
45
+ "js-yaml": "^4.1.1",
46
+ "jsdom": "^28.1.0",
47
+ "turndown": "^7.2.2"
48
+ },
49
+ "devDependencies": {
50
+ "@biomejs/biome": "^2.4.5",
51
+ "@types/js-yaml": "^4.0.9",
52
+ "@types/jsdom": "^28.0.0",
53
+ "@types/node": "^22.19.13",
54
+ "@types/turndown": "^5.0.6",
55
+ "typescript": "^5.9.3"
56
+ }
57
+ }