@madarco/agentbox 0.14.0 → 0.16.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 (66) hide show
  1. package/CHANGELOG.md +108 -0
  2. package/dist/{_cloud-attach-GUBB5RH2.js → _cloud-attach-5KJWOASL.js} +4 -4
  3. package/dist/{chunk-RSKG7AFU.js → chunk-3WCEB6RE.js} +2 -2
  4. package/dist/{chunk-XKH7NTT7.js → chunk-DBBUDKKB.js} +248 -5
  5. package/dist/chunk-DBBUDKKB.js.map +1 -0
  6. package/dist/{chunk-TCS5HXJX.js → chunk-GXJNJUEV.js} +1090 -527
  7. package/dist/chunk-GXJNJUEV.js.map +1 -0
  8. package/dist/{chunk-LDMYHWUS.js → chunk-NW2UZQV6.js} +10 -6
  9. package/dist/chunk-NW2UZQV6.js.map +1 -0
  10. package/dist/{chunk-TBSIJVSN.js → chunk-PIK47622.js} +37 -17
  11. package/dist/chunk-PIK47622.js.map +1 -0
  12. package/dist/{chunk-BKU34KYY.js → chunk-QXFNLKJJ.js} +9 -3
  13. package/dist/{chunk-BKU34KYY.js.map → chunk-QXFNLKJJ.js.map} +1 -1
  14. package/dist/{chunk-BYCLD6D6.js → chunk-SB4QTF2T.js} +98 -54
  15. package/dist/chunk-SB4QTF2T.js.map +1 -0
  16. package/dist/{chunk-VATTS2MR.js → chunk-SENASAU4.js} +10 -6
  17. package/dist/{chunk-VATTS2MR.js.map → chunk-SENASAU4.js.map} +1 -1
  18. package/dist/{dist-34RKQ74M.js → dist-4IQFJJQI.js} +5 -5
  19. package/dist/{dist-4DPOL5A7.js → dist-7YB7BMNG.js} +5 -5
  20. package/dist/{dist-3IMQNTTV.js → dist-SL2QSMBE.js} +5 -5
  21. package/dist/{dist-J2IHD5T7.js → dist-VHI5QOSQ.js} +6 -6
  22. package/dist/{dist-57M6ZA7H.js → dist-XC47DSCR.js} +5 -5
  23. package/dist/index.js +1043 -333
  24. package/dist/index.js.map +1 -1
  25. package/dist/{prepared-state-MQHD3M5F-Q27AZU53.js → prepared-state-MQHD3M5F-2LANTRL7.js} +2 -2
  26. package/package.json +6 -5
  27. package/runtime/docker/Dockerfile.box +21 -2
  28. package/runtime/docker/apps/cli/share/agentbox-setup/SKILL.md +112 -29
  29. package/runtime/docker/packages/ctl/dist/bin.cjs +10353 -8575
  30. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup +5 -2
  31. package/runtime/docker/packages/sandbox-docker/scripts/linear-shim +181 -0
  32. package/runtime/docker/packages/sandbox-docker/scripts/ntn-shim +95 -0
  33. package/runtime/e2b/agentbox-checkpoint-cleanup +5 -2
  34. package/runtime/e2b/agentbox-setup-skill.md +112 -29
  35. package/runtime/e2b/ctl.cjs +10353 -8575
  36. package/runtime/e2b/linear-shim +181 -0
  37. package/runtime/e2b/ntn-shim +95 -0
  38. package/runtime/e2b/scripts/build-template.sh +13 -7
  39. package/runtime/hetzner/agentbox-checkpoint-cleanup +5 -2
  40. package/runtime/hetzner/agentbox-setup-skill.md +112 -29
  41. package/runtime/hetzner/ctl.cjs +10353 -8575
  42. package/runtime/hetzner/linear-shim +181 -0
  43. package/runtime/hetzner/ntn-shim +95 -0
  44. package/runtime/hetzner/scripts/install-box.sh +19 -9
  45. package/runtime/relay/bin.cjs +3707 -2828
  46. package/runtime/vercel/agentbox-checkpoint-cleanup +5 -2
  47. package/runtime/vercel/agentbox-setup-skill.md +112 -29
  48. package/runtime/vercel/ctl.cjs +10353 -8575
  49. package/runtime/vercel/linear-shim +181 -0
  50. package/runtime/vercel/ntn-shim +95 -0
  51. package/runtime/vercel/scripts/provision.sh +13 -7
  52. package/share/agentbox-setup/SKILL.md +112 -29
  53. package/share/host-skills/agentbox-info/SKILL.md +22 -2
  54. package/dist/chunk-BYCLD6D6.js.map +0 -1
  55. package/dist/chunk-LDMYHWUS.js.map +0 -1
  56. package/dist/chunk-TBSIJVSN.js.map +0 -1
  57. package/dist/chunk-TCS5HXJX.js.map +0 -1
  58. package/dist/chunk-XKH7NTT7.js.map +0 -1
  59. /package/dist/{_cloud-attach-GUBB5RH2.js.map → _cloud-attach-5KJWOASL.js.map} +0 -0
  60. /package/dist/{chunk-RSKG7AFU.js.map → chunk-3WCEB6RE.js.map} +0 -0
  61. /package/dist/{dist-34RKQ74M.js.map → dist-4IQFJJQI.js.map} +0 -0
  62. /package/dist/{dist-4DPOL5A7.js.map → dist-7YB7BMNG.js.map} +0 -0
  63. /package/dist/{dist-3IMQNTTV.js.map → dist-SL2QSMBE.js.map} +0 -0
  64. /package/dist/{dist-J2IHD5T7.js.map → dist-VHI5QOSQ.js.map} +0 -0
  65. /package/dist/{dist-57M6ZA7H.js.map → dist-XC47DSCR.js.map} +0 -0
  66. /package/dist/{prepared-state-MQHD3M5F-Q27AZU53.js.map → prepared-state-MQHD3M5F-2LANTRL7.js.map} +0 -0
@@ -0,0 +1,181 @@
1
+ #!/usr/bin/env bash
2
+ # agentbox `linear` shim — translates a strict subset of `linear`
3
+ # (@schpet/linear-cli, v2) subcommands into `agentbox-ctl integration
4
+ # linear <op>` so the host's authenticated `linear` runs the operation and
5
+ # only the result crosses back into the box. The in-box agent never sees a
6
+ # Linear API token.
7
+ #
8
+ # Installed at /usr/local/bin/linear (real `linear` is not in the box).
9
+ #
10
+ # This shim ships only what documented agent flows need; anything outside
11
+ # the subset below is rejected with a clear error. Add ops deliberately —
12
+ # the relay is gated by `integrations.linear.enabled` and an explicit op
13
+ # allowlist in @agentbox/integrations.
14
+ #
15
+ # Three classes of upstream subcommand are EXPLICITLY rejected even though
16
+ # they exist on the host CLI, because proxying them would defeat the
17
+ # security model:
18
+ # - `auth token` PRINTS the raw API token to stdout — proxying it would
19
+ # hand the box the host's Linear credential. The only auth-family op
20
+ # we proxy is `auth whoami` (identity only), via `linear whoami`.
21
+ # - `auth login/logout/migrate/default` would mutate host auth state.
22
+ # - `issue delete` / `team delete` / `team create` are destructive and
23
+ # off-list (widen deliberately, as gated writes, only if needed).
24
+
25
+ set -euo pipefail
26
+
27
+ # Path is a constant in production; the env override exists purely to let
28
+ # unit tests substitute a stub `agentbox-ctl` on PATH without rewriting the
29
+ # shim. Mirrors gh-shim / git-shim / ntn-shim.
30
+ CTL="${AGENTBOX_CTL_PATH:-/usr/local/bin/agentbox-ctl}"
31
+
32
+ die() {
33
+ printf 'agentbox linear shim: %s\n' "$*" >&2
34
+ exit 2
35
+ }
36
+
37
+ handle_auth() {
38
+ local sub="${1-}"; shift || true
39
+ case "$sub" in
40
+ whoami)
41
+ exec "$CTL" integration linear whoami -- "$@"
42
+ ;;
43
+ token)
44
+ die "'auth token' leaks the raw API key — refused. Use 'linear whoami' for identity."
45
+ ;;
46
+ login|logout|migrate|default)
47
+ die "'auth $sub' is not proxied (the host owns auth; run it on the host)."
48
+ ;;
49
+ '')
50
+ die "missing subcommand for 'auth'. Supported: whoami"
51
+ ;;
52
+ *)
53
+ die "unsupported 'auth $sub' (allowed: whoami)"
54
+ ;;
55
+ esac
56
+ }
57
+
58
+ handle_issue_comment() {
59
+ local sub="${1-}"; shift || true
60
+ case "$sub" in
61
+ add)
62
+ exec "$CTL" integration linear issue.comment -- "$@"
63
+ ;;
64
+ '')
65
+ die "missing subcommand for 'issue comment'. Supported: add"
66
+ ;;
67
+ *)
68
+ die "unsupported 'issue comment $sub' (allowed: add)"
69
+ ;;
70
+ esac
71
+ }
72
+
73
+ handle_issue() {
74
+ local sub="${1-}"; shift || true
75
+ case "$sub" in
76
+ list)
77
+ exec "$CTL" integration linear issue.list -- "$@"
78
+ ;;
79
+ mine)
80
+ exec "$CTL" integration linear issue.mine -- "$@"
81
+ ;;
82
+ view)
83
+ exec "$CTL" integration linear issue.view -- "$@"
84
+ ;;
85
+ query)
86
+ exec "$CTL" integration linear issue.query -- "$@"
87
+ ;;
88
+ create)
89
+ exec "$CTL" integration linear issue.create -- "$@"
90
+ ;;
91
+ update)
92
+ exec "$CTL" integration linear issue.update -- "$@"
93
+ ;;
94
+ comment)
95
+ handle_issue_comment "$@"
96
+ ;;
97
+ delete)
98
+ die "'issue delete' is not proxied (destructive; off-list by default)."
99
+ ;;
100
+ '')
101
+ die "missing subcommand for 'issue'. Supported: list, mine, view, query, create, update, comment add"
102
+ ;;
103
+ *)
104
+ die "unsupported 'issue $sub' (allowed: list, mine, view, query, create, update, comment add)"
105
+ ;;
106
+ esac
107
+ }
108
+
109
+ handle_team() {
110
+ local sub="${1-}"; shift || true
111
+ case "$sub" in
112
+ list)
113
+ exec "$CTL" integration linear team.list -- "$@"
114
+ ;;
115
+ create|delete)
116
+ die "'team $sub' is not proxied (destructive; off-list by default)."
117
+ ;;
118
+ '')
119
+ die "missing subcommand for 'team'. Supported: list"
120
+ ;;
121
+ *)
122
+ die "unsupported 'team $sub' (allowed: list)"
123
+ ;;
124
+ esac
125
+ }
126
+
127
+ # Top-level dispatch. `linear`'s real subcommands are
128
+ # `auth issue team project cycle milestone initiative label document api schema`;
129
+ # we expose only the read-safe ones plus a few gated writes (no destructive
130
+ # ops, no auth token).
131
+ if [ $# -eq 0 ]; then
132
+ die "no subcommand. Supported: whoami, auth whoami, issue {list,mine,view,query,create,update,comment add}, team list, api <query>, --version"
133
+ fi
134
+
135
+ case "$1" in
136
+ --version|-v)
137
+ # Tools that sniff "linear --version" succeed with our shim line. The
138
+ # real version lives host-side and is reported by the relay's
139
+ # readiness probe (`assertIntegrationReady`).
140
+ printf 'linear version 0.0.0 (agentbox-shim)\n'
141
+ ;;
142
+ --help|-h)
143
+ printf 'agentbox linear shim — strict subset.\n' >&2
144
+ printf 'Supported: whoami, auth whoami, issue {list,mine,view,query,create,update,comment add}, team list, api <query>, --version\n' >&2
145
+ printf 'Anything else is rejected. Run host `linear --help` for full upstream docs.\n' >&2
146
+ ;;
147
+ whoami)
148
+ shift
149
+ exec "$CTL" integration linear whoami -- "$@"
150
+ ;;
151
+ auth)
152
+ shift
153
+ handle_auth "$@"
154
+ ;;
155
+ issue)
156
+ shift
157
+ handle_issue "$@"
158
+ ;;
159
+ team)
160
+ shift
161
+ handle_team "$@"
162
+ ;;
163
+ api)
164
+ shift
165
+ # `linear api` accepts pre-positional flags (`--variable`,
166
+ # `--variables-json`, `--paginate`, `--silent`) before the GraphQL
167
+ # query, so we don't require the FIRST arg to be a non-flag — only
168
+ # that some arg is present. The relay's refuseGraphqlNonQuery
169
+ # enforces query-only by rejecting any positional whose first
170
+ # keyword is `mutation`/`subscription` (and any `--variable
171
+ # key=@<path>` host-file load), so we don't duplicate that check
172
+ # here. Writes go through the dedicated issue.* ops.
173
+ if [ $# -eq 0 ]; then
174
+ die "'api' requires a positional <query> (e.g. '{ teams { id } }')"
175
+ fi
176
+ exec "$CTL" integration linear api -- "$@"
177
+ ;;
178
+ *)
179
+ die "'$1' is not proxied (supported: whoami, issue {list,mine,view,query,create,update,comment add}, team list, api <query>, --version)"
180
+ ;;
181
+ esac
@@ -0,0 +1,95 @@
1
+ #!/usr/bin/env bash
2
+ # agentbox `ntn` shim — translates a strict subset of `ntn` (the official
3
+ # Notion CLI) subcommands into `agentbox-ctl integration notion <op>` so the
4
+ # host's authenticated `ntn` runs the operation and only the result crosses
5
+ # back into the box. The in-box agent never sees a Notion token.
6
+ #
7
+ # Installed at /usr/local/bin/ntn (real `ntn` is not in the box). The same
8
+ # shim is symlinked as /usr/local/bin/notion — the per-service surface name
9
+ # from docs/integrations_backlog.md — both invocations behave identically.
10
+ #
11
+ # This shim ships only what documented agent flows need; anything outside
12
+ # the subset below is rejected with a clear error. Add ops deliberately —
13
+ # the relay is gated by `integrations.notion.enabled` and an explicit op
14
+ # allowlist in @agentbox/integrations.
15
+
16
+ set -euo pipefail
17
+
18
+ # Path is a constant in production; the env override exists purely to let
19
+ # unit tests substitute a stub `agentbox-ctl` on PATH without rewriting the
20
+ # shim. Mirrors gh-shim / git-shim.
21
+ CTL="${AGENTBOX_CTL_PATH:-/usr/local/bin/agentbox-ctl}"
22
+
23
+ die() {
24
+ printf 'agentbox notion shim: %s\n' "$*" >&2
25
+ exit 2
26
+ }
27
+
28
+ handle_pages() {
29
+ local op="${1-}"; shift || true
30
+ case "$op" in
31
+ create)
32
+ exec "$CTL" integration notion page.create -- "$@"
33
+ ;;
34
+ update)
35
+ exec "$CTL" integration notion page.update -- "$@"
36
+ ;;
37
+ '')
38
+ die "missing subcommand for 'pages'. Supported: create, update"
39
+ ;;
40
+ *)
41
+ die "unsupported 'pages $op' (allowed: create, update)"
42
+ ;;
43
+ esac
44
+ }
45
+
46
+ # Top-level dispatch. `ntn`'s real subcommands are
47
+ # `api datasources files pages login logout whoami workers`; we expose only
48
+ # the read-safe ones plus `pages {create,update}`.
49
+ if [ $# -eq 0 ]; then
50
+ die "no subcommand. Supported: whoami, api <endpoint>, pages {create,update}, --version"
51
+ fi
52
+
53
+ case "$1" in
54
+ --version|-v)
55
+ # Tools that sniff "ntn version" succeed with our shim line. The real
56
+ # version lives host-side and is reported by the relay's readiness probe
57
+ # (`assertIntegrationReady`).
58
+ printf 'ntn version 0.0.0 (agentbox-shim)\n'
59
+ ;;
60
+ --help|-h)
61
+ printf 'agentbox notion shim — strict subset.\n' >&2
62
+ printf 'Supported: whoami, api <path> [inputs] [-d JSON], pages {create, update}, --version\n' >&2
63
+ printf 'api is read-only: GET to any endpoint; POST only to v1/search and\n' >&2
64
+ printf 'v1/{databases,data_sources}/{id}/query. Writes go through `pages`.\n' >&2
65
+ printf 'Anything else is rejected. Run host `ntn --help` for full upstream docs.\n' >&2
66
+ ;;
67
+ whoami)
68
+ shift
69
+ exec "$CTL" integration notion whoami -- "$@"
70
+ ;;
71
+ api)
72
+ shift
73
+ # Forward verbatim to mirror real `ntn api` (options may precede the path;
74
+ # `ls`/`help`/`--spec`/`--docs` and `-d <JSON>` bodies are all valid). The
75
+ # relay's refuseUnsafeApiCall is the security boundary: GET to any endpoint,
76
+ # POST only to read endpoints (v1/search, v1/databases/{id}/query,
77
+ # v1/data_sources/{id}/query); every other method/endpoint is refused.
78
+ # Writes go through the dedicated `pages create/update` ops.
79
+ exec "$CTL" integration notion api -- "$@"
80
+ ;;
81
+ pages)
82
+ shift
83
+ handle_pages "$@"
84
+ ;;
85
+ comment|comments)
86
+ # The T1 connector intentionally has no comment op — `ntn` exposes no
87
+ # top-level `comment` subcommand and Notion's REST POST /v1/comments
88
+ # takes a structured JSON body that doesn't trivially map from CLI
89
+ # flags. Tracked as a focused follow-up in docs/notion_backlog.md.
90
+ die "comment ops not supported yet (deferred from T2; see docs/notion_backlog.md)"
91
+ ;;
92
+ *)
93
+ die "'$1' is not proxied (supported: whoami, api <endpoint>, pages {create,update}, --version)"
94
+ ;;
95
+ esac
@@ -15,6 +15,8 @@
15
15
  # /tmp/agentbox-open -- in-box xdg-open shim
16
16
  # /tmp/agentbox-gh-shim -- in-box `gh` shim (routes to host gh via relay)
17
17
  # /tmp/agentbox-git-shim -- in-box `git` shim (routes push/pull/fetch/clone via relay)
18
+ # /tmp/agentbox-ntn-shim -- in-box `ntn`/`notion` shim (routes Notion CLI to host ntn via relay)
19
+ # /tmp/agentbox-linear-shim -- in-box `linear` shim (routes @schpet/linear-cli to host linear via relay; rejects `auth token`)
18
20
  # /tmp/agentbox-custom-CLAUDE.md -- /etc/claude-code/CLAUDE.md content
19
21
  # /tmp/agentbox-managed-settings.json -- /etc/claude-code/managed-settings.json
20
22
  # /tmp/agentbox-codex-hooks.json -- /usr/local/share/agentbox/codex-hooks.json
@@ -108,10 +110,10 @@ chmod 0440 /etc/sudoers.d/90-agentbox-vscode
108
110
  done_ "vscode user (UID 1000) + sudoers"
109
111
 
110
112
  step "agentbox base dirs + /workspace ownership"
111
- mkdir -p /workspace /run/agentbox /var/log/agentbox /etc/agentbox /etc/claude-code \
113
+ mkdir -p /workspace /run/agentbox /var/log/agentbox /var/lib/agentbox /etc/agentbox /etc/claude-code \
112
114
  /usr/local/share/agentbox
113
115
  chmod 755 /workspace
114
- chown vscode:vscode /workspace /run/agentbox /var/log/agentbox
116
+ chown vscode:vscode /workspace /run/agentbox /var/log/agentbox /var/lib/agentbox
115
117
  done_ "agentbox base dirs + /workspace ownership"
116
118
 
117
119
  step "node setcap (port <1024 bind without root)"
@@ -161,19 +163,26 @@ done_ "agentbox-ctl install"
161
163
  # *before* Chromium sidesteps the issue and keeps the snapshot complete.
162
164
  # Tracked as Phase-7 follow-up in docs/hertzner_backlog.md.
163
165
 
164
- step "baked helper scripts (vnc / dockerd / cleanup / xdg-open / gh + git shims)"
166
+ step "baked helper scripts (vnc / dockerd / cleanup / xdg-open / gh + git + ntn + linear shims)"
165
167
  install -m 0755 /tmp/agentbox-vnc-start /usr/local/bin/agentbox-vnc-start
166
168
  install -m 0755 /tmp/agentbox-dockerd-start /usr/local/bin/agentbox-dockerd-start
167
169
  install -m 0755 /tmp/agentbox-checkpoint-cleanup /usr/local/bin/agentbox-checkpoint-cleanup
168
170
  install -m 0755 /tmp/agentbox-open /usr/local/bin/agentbox-open
169
171
  ln -sf /usr/local/bin/agentbox-open /usr/local/bin/xdg-open
170
- # gh + git shims — same files baked by Dockerfile.box for the docker provider.
171
- # The shim wins on PATH (default /usr/local/bin precedes /usr/bin) so any agent
172
- # call to `gh ...` / `git push|pull|fetch|clone` routes through the relay; the
173
- # git shim execs /usr/bin/git for everything else, no overhead.
172
+ # gh + git + ntn + linear shims — same files baked by Dockerfile.box for the
173
+ # docker provider. The shim wins on PATH (default /usr/local/bin precedes
174
+ # /usr/bin) so any agent call to `gh ...` / `git push|pull|fetch|clone` /
175
+ # `ntn ...` / `notion ...` / `linear ...` routes through the relay; the git
176
+ # shim execs /usr/bin/git for everything else, no overhead. `notion` is a
177
+ # symlink to `ntn` — same shim, per-service surface naming from
178
+ # docs/integrations_backlog.md. The linear shim explicitly rejects
179
+ # `linear auth token` (which would print the raw API key).
174
180
  install -m 0755 /tmp/agentbox-gh-shim /usr/local/bin/gh
175
181
  install -m 0755 /tmp/agentbox-git-shim /usr/local/bin/git
176
- done_ "baked helper scripts (vnc / dockerd / cleanup / xdg-open / gh + git shims)"
182
+ install -m 0755 /tmp/agentbox-ntn-shim /usr/local/bin/ntn
183
+ ln -sf /usr/local/bin/ntn /usr/local/bin/notion
184
+ install -m 0755 /tmp/agentbox-linear-shim /usr/local/bin/linear
185
+ done_ "baked helper scripts (vnc / dockerd / cleanup / xdg-open / gh + git + ntn + linear shims)"
177
186
 
178
187
  step "baked config files (claude / codex / setup guide / tmux.conf)"
179
188
  install -m 0644 /tmp/agentbox-custom-CLAUDE.md /etc/claude-code/CLAUDE.md
@@ -364,7 +373,8 @@ step "trim /tmp/agentbox-*"
364
373
  # re-read which lines actually executed against which source.
365
374
  rm -f /tmp/agentbox-ctl /tmp/agentbox-vnc-start /tmp/agentbox-dockerd-start \
366
375
  /tmp/agentbox-checkpoint-cleanup /tmp/agentbox-open \
367
- /tmp/agentbox-gh-shim /tmp/agentbox-git-shim \
376
+ /tmp/agentbox-gh-shim /tmp/agentbox-git-shim /tmp/agentbox-ntn-shim \
377
+ /tmp/agentbox-linear-shim \
368
378
  /tmp/agentbox-custom-CLAUDE.md /tmp/agentbox-managed-settings.json \
369
379
  /tmp/agentbox-codex-hooks.json /tmp/agentbox-setup-skill.md
370
380
  # Move install-box.sh into the persistent location for diagnostics.