thepopebot 1.2.75-beta.2 → 1.2.75-beta.21

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 (120) hide show
  1. package/README.md +1 -1
  2. package/api/CLAUDE.md +1 -1
  3. package/api/index.js +5 -12
  4. package/bin/CLAUDE.md +1 -1
  5. package/bin/cli.js +329 -14
  6. package/bin/docker-build.js +5 -0
  7. package/bin/managed-paths.js +0 -7
  8. package/bin/sync.js +84 -0
  9. package/config/CLAUDE.md +1 -29
  10. package/config/instrumentation.js +1 -1
  11. package/lib/CLAUDE.md +3 -3
  12. package/lib/ai/CLAUDE.md +24 -3
  13. package/lib/ai/agent.js +8 -5
  14. package/lib/ai/async-channel.js +51 -0
  15. package/lib/ai/headless-stream.js +3 -0
  16. package/lib/ai/index.js +149 -173
  17. package/lib/ai/line-mappers.js +72 -9
  18. package/lib/ai/tools.js +40 -28
  19. package/lib/chat/actions.js +34 -6
  20. package/lib/chat/api.js +17 -1
  21. package/lib/chat/components/chat-header.js +4 -0
  22. package/lib/chat/components/chat-header.jsx +4 -0
  23. package/lib/chat/components/chat-input.js +1 -0
  24. package/lib/chat/components/chat-input.jsx +1 -0
  25. package/lib/chat/components/chat.js +9 -1
  26. package/lib/chat/components/chat.jsx +15 -2
  27. package/lib/chat/components/chats-page.js +3 -3
  28. package/lib/chat/components/chats-page.jsx +4 -6
  29. package/lib/chat/components/crons-page.js +1 -1
  30. package/lib/chat/components/crons-page.jsx +1 -1
  31. package/lib/chat/components/message.js +12 -4
  32. package/lib/chat/components/message.jsx +17 -4
  33. package/lib/chat/components/settings-chat-page.js +2 -1
  34. package/lib/chat/components/settings-chat-page.jsx +4 -1
  35. package/lib/chat/components/settings-coding-agents-page.js +139 -1
  36. package/lib/chat/components/settings-coding-agents-page.jsx +160 -0
  37. package/lib/chat/components/settings-jobs-page.js +13 -2
  38. package/lib/chat/components/settings-jobs-page.jsx +15 -1
  39. package/lib/chat/components/settings-secrets-layout.js +1 -1
  40. package/lib/chat/components/settings-secrets-layout.jsx +1 -1
  41. package/lib/chat/components/sidebar-history-item.js +3 -3
  42. package/lib/chat/components/sidebar-history-item.jsx +4 -6
  43. package/lib/chat/components/triggers-page.js +1 -1
  44. package/lib/chat/components/triggers-page.jsx +1 -1
  45. package/lib/cluster/actions.js +4 -4
  46. package/lib/cluster/execute.js +3 -1
  47. package/lib/code/actions.js +34 -11
  48. package/lib/code/code-page.js +40 -40
  49. package/lib/code/code-page.jsx +36 -36
  50. package/lib/code/port-forwards.js +17 -3
  51. package/lib/code/terminal-view.js +16 -0
  52. package/lib/code/terminal-view.jsx +18 -0
  53. package/lib/config.js +4 -0
  54. package/lib/cron.js +3 -3
  55. package/lib/db/api-keys.js +22 -61
  56. package/lib/db/config.js +23 -0
  57. package/lib/db/index.js +3 -1
  58. package/lib/maintenance.js +34 -11
  59. package/lib/paths.js +1 -38
  60. package/lib/tools/create-agent-job.js +0 -4
  61. package/lib/tools/docker.js +23 -16
  62. package/lib/triggers.js +4 -3
  63. package/lib/utils/render-md.js +3 -1
  64. package/package.json +2 -1
  65. package/setup/setup-ssl.mjs +414 -0
  66. package/templates/.github/workflows/rebuild-event-handler.yml +3 -0
  67. package/templates/.github/workflows/upgrade-event-handler.yml +1 -1
  68. package/templates/.gitignore.template +7 -3
  69. package/templates/.tmp/CLAUDE.md.template +5 -0
  70. package/templates/CLAUDE.md +3 -2
  71. package/templates/CLAUDE.md.template +24 -357
  72. package/templates/agent-job/CLAUDE.md.template +57 -0
  73. package/templates/agent-job/CRONS.json +16 -0
  74. package/templates/{config/agent-job → agent-job}/SOUL.md +3 -3
  75. package/templates/agent-job/SYSTEM.md +60 -0
  76. package/templates/agents/CLAUDE.md.template +54 -0
  77. package/templates/data/CLAUDE.md.template +5 -0
  78. package/templates/docker-compose.custom.yml +41 -62
  79. package/templates/docker-compose.yml +14 -21
  80. package/templates/event-handler/CLAUDE.md.template +0 -0
  81. package/templates/logs/CLAUDE.md.template +5 -0
  82. package/templates/skills/CLAUDE.md.template +57 -32
  83. package/templates/skills/active/.gitkeep +0 -0
  84. package/templates/skills/library/agent-job-secrets/SKILL.md +23 -0
  85. package/templates/skills/library/agent-job-secrets/agent-job-secrets.js +62 -0
  86. package/templates/.pi/extensions/env-sanitizer/index.ts +0 -48
  87. package/templates/.pi/extensions/env-sanitizer/package.json +0 -5
  88. package/templates/README.md +0 -75
  89. package/templates/config/CLAUDE.md.template +0 -40
  90. package/templates/config/CRONS.json +0 -56
  91. package/templates/config/agent-job/AGENT_JOB.md +0 -30
  92. package/templates/cron/CLAUDE.md.template +0 -24
  93. package/templates/docker-compose.litellm.yml +0 -82
  94. package/templates/docs/CLAUDE.md.template +0 -12
  95. package/templates/docs/CLI.md +0 -59
  96. package/templates/docs/CLUSTERS.md +0 -151
  97. package/templates/docs/CONFIGURATION.md +0 -181
  98. package/templates/docs/CRONS_AND_TRIGGERS.md +0 -132
  99. package/templates/docs/GETTING_STARTED.md +0 -64
  100. package/templates/docs/SECURITY.md +0 -61
  101. package/templates/docs/SKILLS.md +0 -113
  102. package/templates/docs/UPGRADING.md +0 -92
  103. package/templates/skills/LICENSE +0 -21
  104. package/templates/skills/README.md +0 -117
  105. package/templates/skills/agent-job-secrets/SKILL.md +0 -25
  106. package/templates/skills/agent-job-secrets/agent-job-secrets.js +0 -66
  107. package/templates/traefik-dynamic.yml.example +0 -7
  108. package/templates/triggers/CLAUDE.md.template +0 -41
  109. /package/templates/{config → agent-job}/HEARTBEAT.md +0 -0
  110. /package/templates/{cron → data}/.gitkeep +0 -0
  111. /package/templates/{logs → data/clusters}/.gitkeep +0 -0
  112. /package/templates/{triggers → data/db}/.gitkeep +0 -0
  113. /package/templates/{config/agent-job → event-handler}/SUMMARY.md +0 -0
  114. /package/templates/{config → event-handler}/TRIGGERS.json +0 -0
  115. /package/templates/{config → event-handler}/agent-chat/SYSTEM.md +0 -0
  116. /package/templates/{config/cluster → event-handler/clusters}/ROLE.md +0 -0
  117. /package/templates/{config/cluster → event-handler/clusters}/SYSTEM.md +0 -0
  118. /package/templates/{config → event-handler}/code-chat/SYSTEM.md +0 -0
  119. /package/templates/{config → event-handler}/litellm/main.yaml +0 -0
  120. /package/templates/skills/{playwright-cli → library/playwright-cli}/SKILL.md +0 -0
@@ -1,66 +0,0 @@
1
- #!/usr/bin/env node
2
- import { readFileSync } from 'fs';
3
-
4
- const [cmd, key, inlineValue] = process.argv.slice(2);
5
-
6
- // Default to list
7
- if (!cmd || cmd === 'list') {
8
- const secretsJson = process.env.AGENT_JOB_SECRETS;
9
- if (!secretsJson) {
10
- console.log('No agent secrets configured.');
11
- process.exit(0);
12
- }
13
- const secrets = JSON.parse(secretsJson);
14
- const keys = Object.keys(secrets);
15
- if (keys.length === 0) {
16
- console.log('No agent secrets configured.');
17
- } else {
18
- console.log('Available secrets:');
19
- keys.forEach(k => {
20
- const fetchRequired = secrets[k] === null;
21
- console.log(` - ${k}${fetchRequired ? ' (fetch required: use get)' : ''}`);
22
- });
23
- console.log('\nTo get a value: agent-job-secrets.js get KEY_NAME');
24
- }
25
- process.exit(0);
26
- }
27
-
28
- const apiKey = process.env.AGENT_JOB_TOKEN;
29
- const appUrl = process.env.APP_URL;
30
- if (!apiKey) { console.error('AGENT_JOB_TOKEN not available'); process.exit(1); }
31
- if (!appUrl) { console.error('APP_URL not available'); process.exit(1); }
32
-
33
- if (cmd === 'get') {
34
- if (!key) { console.error('Usage: agent-job-secrets.js get KEY_NAME'); process.exit(1); }
35
- const res = await fetch(`${appUrl}/api/get-agent-job-secret?key=${encodeURIComponent(key)}`, {
36
- headers: { 'x-api-key': apiKey },
37
- });
38
- const json = await res.json();
39
- if (!res.ok || json.error) { console.error('Failed:', json.error || res.status); process.exit(1); }
40
- console.log(json.value);
41
- process.exit(0);
42
- }
43
-
44
- if (cmd === 'set') {
45
- if (!key) {
46
- console.error('Usage: agent-job-secrets.js set KEY_NAME [value]');
47
- console.error(' echo "value" | agent-job-secrets.js set KEY_NAME');
48
- process.exit(1);
49
- }
50
- let value = inlineValue;
51
- if (value === undefined) {
52
- value = readFileSync('/dev/stdin', 'utf8').trim();
53
- }
54
- const res = await fetch(`${appUrl}/api/set-agent-job-secret`, {
55
- method: 'POST',
56
- headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey },
57
- body: JSON.stringify({ key, value }),
58
- });
59
- const json = await res.json();
60
- if (!res.ok || json.error) { console.error('Failed:', json.error || res.status); process.exit(1); }
61
- console.log(`Secret "${key}" updated.`);
62
- process.exit(0);
63
- }
64
-
65
- console.error(`Unknown command: ${cmd}`);
66
- process.exit(1);
@@ -1,7 +0,0 @@
1
- # Traefik dynamic config for Tailscale TLS
2
- # Copy this file to traefik-dynamic.yml and replace YOUR_HOSTNAME
3
- # with your full Tailscale machine name (e.g. mybot.taila1b2c3.ts.net)
4
- tls:
5
- certificates:
6
- - certFile: /certs/YOUR_HOSTNAME.crt
7
- keyFile: /certs/YOUR_HOSTNAME.key
@@ -1,41 +0,0 @@
1
- # triggers/ — Trigger Action Scripts
2
-
3
- This directory holds scripts referenced by `command`-type entries in `config/TRIGGERS.json`.
4
-
5
- When a `command`-type trigger fires, the working directory is `triggers/`.
6
-
7
- ## Example
8
-
9
- In `config/TRIGGERS.json`:
10
- ```json
11
- {
12
- "name": "Deploy Hook",
13
- "watch_path": "/webhook/deploy",
14
- "enabled": true,
15
- "actions": [
16
- {
17
- "type": "command",
18
- "command": "node on-deploy.js {{body.environment}}"
19
- }
20
- ]
21
- }
22
- ```
23
-
24
- This runs `triggers/on-deploy.js` when a POST hits `/webhook/deploy`.
25
-
26
- ## Template Tokens
27
-
28
- `command` (and `job`) strings support template tokens resolved from the incoming request:
29
-
30
- | Token | Resolves to |
31
- |-------|-------------|
32
- | `{{body}}` | Entire request body as JSON |
33
- | `{{body.field}}` | Nested field from request body |
34
- | `{{query}}` | All query parameters as JSON |
35
- | `{{query.field}}` | Specific query parameter |
36
- | `{{headers}}` | All request headers as JSON |
37
- | `{{headers.field}}` | Specific request header |
38
-
39
- ## Action Types
40
-
41
- Most trigger entries use `type: "agent"` (the default) which spins up a Docker agent. Only `command`-type entries reference scripts in this directory. See `config/TRIGGERS.json` for the full trigger configuration and the root `CLAUDE.md` for all action type details.
File without changes
File without changes
File without changes
File without changes