@codions/portta 0.1.0 → 0.3.1
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.
- package/README.md +41 -88
- package/dist/assets/agents/hook.sh.tmpl +21 -0
- package/dist/assets/agents/instruction.md +8 -0
- package/dist/assets/agents/portta-context.ts.tmpl +24 -0
- package/dist/assets/skills/portta-adopt-compose/SKILL.md +220 -0
- package/dist/assets/skills/portta-dockerize/SKILL.md +118 -0
- package/dist/assets/skills/portta-host-context/SKILL.md +142 -0
- package/dist/cli.js +1568 -1017
- package/dist/documentation.json.gz +0 -0
- package/dist/runtime/.env.example +6 -42
- package/dist/runtime/VERSION +1 -1
- package/dist/runtime/docker/compose/features/web-dev.yaml +0 -2
- package/dist/runtime/docker/compose/features/web.yaml +0 -8
- package/dist/runtime/docker/images/apply/Dockerfile +1 -1
- package/dist/runtime/docker/images/toolbox/Dockerfile +1 -1
- package/dist/runtime/templates/README.md +3 -3
- package/dist/runtime/templates/overlays/06-monorepo.yaml +0 -7
- package/dist/runtime/templates/overlays/07-worktree.env +0 -1
- package/dist/runtime/templates/project/PORTTA.md +8 -7
- package/package.json +5 -16
- package/dist/acp-providers-M3DUUBYJ.js +0 -3
- package/dist/arktype-aI7TBD0R-SOJGD3SZ.js +0 -3
- package/dist/assets/skills/portta-workflows/SKILL.md +0 -285
- package/dist/assets/workflows/bake-off.workflow.js +0 -172
- package/dist/assets/workflows/code-review.workflow.js +0 -179
- package/dist/assets/workflows/deep-research.workflow.js +0 -223
- package/dist/assets/workflows/multi-provider-review.workflow.js +0 -169
- package/dist/assets/workflows/provider-debate.workflow.js +0 -141
- package/dist/assets/workflows/second-opinion.workflow.js +0 -176
- package/dist/chunk-3EZNE4MC.js +0 -6
- package/dist/chunk-4TGTGGMK.js +0 -4
- package/dist/chunk-4YGEG6YX.js +0 -1878
- package/dist/chunk-5SBYE3YH.js +0 -26
- package/dist/chunk-6J5HN4ZN.js +0 -3
- package/dist/chunk-6TV2V7RR.js +0 -3
- package/dist/chunk-CFWGQ7VJ.js +0 -19
- package/dist/chunk-EFZZFIRZ.js +0 -3
- package/dist/chunk-EH7H7D7J.js +0 -15
- package/dist/chunk-EYT7VTYA.js +0 -4
- package/dist/chunk-FRQCKCCK.js +0 -332
- package/dist/chunk-GI2EUNAK.js +0 -16
- package/dist/chunk-HB5T7XDN.js +0 -5
- package/dist/chunk-IILMQFWO.js +0 -14
- package/dist/chunk-LAYNTFDR.js +0 -70
- package/dist/chunk-MH5YJA5O.js +0 -2
- package/dist/chunk-O6U47HHQ.js +0 -341
- package/dist/chunk-OPVZAG2C.js +0 -10
- package/dist/chunk-PTKKSRMI.js +0 -223
- package/dist/chunk-Q3VNQ3LU.js +0 -3
- package/dist/chunk-QBKADN76.js +0 -4
- package/dist/chunk-QS5PHDYT.js +0 -240
- package/dist/chunk-SBVO6RXF.js +0 -87
- package/dist/chunk-T3TSZO4I.js +0 -7
- package/dist/chunk-TA2XHP5D.js +0 -4
- package/dist/chunk-UUSUJUAD.js +0 -7
- package/dist/chunk-UX7P3YHF.js +0 -3
- package/dist/chunk-VDSWNWUY.js +0 -168
- package/dist/chunk-WNZR7VOO.js +0 -145
- package/dist/chunk-YYSFNLBX.js +0 -5
- package/dist/cli-O2MMC25H.js +0 -98
- package/dist/completions-F4476JAU.js +0 -12
- package/dist/config-E5XLLPKE.js +0 -3
- package/dist/core-FSKGFGJO.js +0 -18
- package/dist/default-u_dwuiYb-OWTONHM6.js +0 -3
- package/dist/dispatch-ZCNGHCNP.js +0 -8
- package/dist/doctor-7F6ZXPZE.js +0 -5
- package/dist/effect-QlVUlMFu-4UNP2EGS.js +0 -3
- package/dist/esm-575VQW4T.js +0 -4
- package/dist/host.js +0 -8
- package/dist/init-HGEXUJP3.js +0 -245
- package/dist/linear-commands-XGHGICI7.js +0 -5
- package/dist/oneshot-DL57ZA55.js +0 -36
- package/dist/opencode-YDUTVKTG.js +0 -3
- package/dist/pi-L73UX3S5.js +0 -3
- package/dist/project-commands-2N44CRGM.js +0 -7
- package/dist/project-env-NWBVITHM.js +0 -4
- package/dist/run-commands-TCBNFJOT.js +0 -13
- package/dist/runtime/docker/compose/features/panel-host.yaml +0 -42
- package/dist/shell-ZWXPCUMD.js +0 -3
- package/dist/subprocess-jsonl-FQKDRENI.js +0 -3
- package/dist/supervisor.js +0 -179
- package/dist/sury-CWZTCd75-XQOYZHNU.js +0 -3
- package/dist/typebox-Dei93FPO-RCGWIHUQ.js +0 -3
- package/dist/valibot--1zFm7rT-DKLMYF44.js +0 -3
- package/dist/valibot-D_HTw1Gn-QTR63R64.js +0 -4
- package/dist/worktree-commands-F7REOKFJ.js +0 -50
- package/dist/zod-Bwrt9trS-6RSVELLV.js +0 -3
- package/dist/zod-DSgpEGAE-5JBFOUHY.js +0 -3
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: portta-host-context
|
|
3
|
+
description: Explains how to work on a server running Portta. Use at the start of any session on a shared development host, when a project needs a URL, when a port seems taken, when starting or exposing containers, or when deciding whether a project needs Portta at all.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires the portta CLI on the host. Works read-only without a running panel.
|
|
6
|
+
metadata:
|
|
7
|
+
author: codions-labs
|
|
8
|
+
version: "1"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Work on a Portta host
|
|
12
|
+
|
|
13
|
+
A Portta host runs many Docker projects side by side, for many people and many
|
|
14
|
+
agents. A gateway routes each web service at `<project>-<service>.<domain>`, so
|
|
15
|
+
no project publishes a host port and none needs to. Other environments are
|
|
16
|
+
running right now, and you cannot see who owns them.
|
|
17
|
+
|
|
18
|
+
This skill tells you where you are, what applies, and what you may do alone.
|
|
19
|
+
|
|
20
|
+
## 1. Read the preflight
|
|
21
|
+
|
|
22
|
+
At the start of a session run:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
portta agent context
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Skip it only when its output is already in your context, as it is when a
|
|
29
|
+
session hook ran it. The command is read-only, offline, finishes in under a
|
|
30
|
+
second and always succeeds. For a machine-readable answer add `--json`: the
|
|
31
|
+
envelope is `{ "schema": "agent.context", "version": 1, "data": ... }`.
|
|
32
|
+
|
|
33
|
+
If `portta` is not installed, or the command prints nothing, this is not a
|
|
34
|
+
Portta host. None of this applies. Do not install anything to make it apply.
|
|
35
|
+
|
|
36
|
+
`data.project.scope` decides what you do:
|
|
37
|
+
|
|
38
|
+
| `scope` | Meaning | What you do |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| `no-portta` | The CLI exists, the host has no installation | Nothing. Work normally |
|
|
41
|
+
| `excluded` | The person listed this directory in `~/.config/portta/agents/scope.yaml` | Nothing. Do not suggest Portta here |
|
|
42
|
+
| `out-of-scope` | Home directory, a folder without Git or Compose, or nothing that serves HTTP | Nothing. If you start containers, publish no ports |
|
|
43
|
+
| `needs-adoption` | A Compose file and no Runtime Plan | Use the `portta-adopt-compose` skill |
|
|
44
|
+
| `needs-dockerizing` | A Dockerfile or a web service, and no Compose file | Use the `portta-dockerize` skill. It writes nothing before the person approves |
|
|
45
|
+
| `compliant` | A Runtime Plan, no violations | `portta runtime up`, then report the URLs |
|
|
46
|
+
| `non-compliant` | A Runtime Plan with a published port, a stale plan, or (public host) a service nobody decided about | Read `data.project.violations`, then use `portta-adopt-compose` |
|
|
47
|
+
|
|
48
|
+
When the scope is unclear the answer is `out-of-scope` with a `note`. Believe
|
|
49
|
+
it. Never adopt a project the preflight did not point at.
|
|
50
|
+
|
|
51
|
+
A Git worktree (`data.project.worktree: true`) must have its own namespace so
|
|
52
|
+
it gets its own URL and its own volumes:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
portta envs namespace
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Put the result in the worktree's `.env` as `COMPOSE_PROJECT_NAME`.
|
|
59
|
+
|
|
60
|
+
## 2. What you may do
|
|
61
|
+
|
|
62
|
+
| Do alone | Ask first | Never |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| The preflight, `portta envs analyze`, any `--dry-run` | Any decision that is `pending`, including whether to protect a service or leave it public | `docker * prune`, or stopping a container of another project |
|
|
65
|
+
| `portta adopt` when nothing is pending | Creating or editing a Compose file or a Dockerfile | Publishing a port, a database included |
|
|
66
|
+
| `portta runtime up` in your own namespace | Replacing an environment that already runs with data: a different namespace means new volumes | Taking the gateway down, or changing the exposure profile |
|
|
67
|
+
| Reporting `portta urls` | Removing protection, creating a temporary link, committing and pushing | Reusing another environment's volume or namespace |
|
|
68
|
+
|
|
69
|
+
When a row says ask, state the question in the project's terms, name the
|
|
70
|
+
option, and wait for the answer. Do not choose for the person.
|
|
71
|
+
|
|
72
|
+
## 3. The rules of a shared host
|
|
73
|
+
|
|
74
|
+
Never:
|
|
75
|
+
|
|
76
|
+
- stop or remove a container, volume or network you did not create. A
|
|
77
|
+
container holding port 5432 is somebody's working environment.
|
|
78
|
+
- run `docker system prune`, `docker volume prune`, `docker network prune` or
|
|
79
|
+
any other `docker * prune`. They delete other people's data.
|
|
80
|
+
- publish a host port. Not a web port, and above all not a database or a cache:
|
|
81
|
+
no `5432:5432`, not on `0.0.0.0`, not even temporarily.
|
|
82
|
+
- change an internal port to get around a conflict. A port that looks taken
|
|
83
|
+
means something publishes a port it does not need. Remove that `ports:`
|
|
84
|
+
entry, which fixes it for everyone.
|
|
85
|
+
- reuse another environment's volume, network or namespace. Two environments
|
|
86
|
+
writing to one database corrupt each other silently.
|
|
87
|
+
- take the gateway down to fix your own project. It serves every environment.
|
|
88
|
+
- run `rm -rf` against another checkout. Removing a project from the host never
|
|
89
|
+
deletes its code.
|
|
90
|
+
|
|
91
|
+
Always:
|
|
92
|
+
|
|
93
|
+
- check ownership before you touch a container:
|
|
94
|
+
`docker inspect <container> --format '{{ index .Config.Labels "com.docker.compose.project" }}'`.
|
|
95
|
+
If the answer is not your namespace, it is not yours.
|
|
96
|
+
- run `portta doctor` before improvising infrastructure. It changes nothing and
|
|
97
|
+
names a fix for each problem.
|
|
98
|
+
- stop only what you started, from its own directory: `portta runtime down <path>`.
|
|
99
|
+
|
|
100
|
+
## 4. Reach a database without publishing it
|
|
101
|
+
|
|
102
|
+
In this order, and stop at the first that works:
|
|
103
|
+
|
|
104
|
+
1. `docker compose exec <service> ...` inside the project.
|
|
105
|
+
2. `portta db psql --project <name> --service postgres`, or `portta redis cli`.
|
|
106
|
+
A client runs inside the project's network: nothing is published and nothing
|
|
107
|
+
is left behind.
|
|
108
|
+
3. `portta access open --project <name> --service postgres`, only when a person
|
|
109
|
+
needs a GUI. It binds loopback. Close it with `portta access close --project <name>`.
|
|
110
|
+
|
|
111
|
+
## 5. Report URLs
|
|
112
|
+
|
|
113
|
+
After you start an environment:
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
portta urls --project <name>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Report those hostnames, never `localhost:3000`, which means nothing on a shared
|
|
120
|
+
host. On a public host a service may answer only after a login. Say which
|
|
121
|
+
services are protected and which are open, using `data.project.exposure` from
|
|
122
|
+
the preflight, and never print or store a password. Temporary share links are
|
|
123
|
+
created in the panel, not by you.
|
|
124
|
+
|
|
125
|
+
## 6. When a route does not work
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
portta urls # is the hostname listed?
|
|
129
|
+
portta doctor # collisions, labels, exposure
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
The usual causes: a wrong backend port, the service missing from the gateway
|
|
133
|
+
network, a Traefik service name that collides with another project's, or labels
|
|
134
|
+
written in map form so `${COMPOSE_PROJECT_NAME}` was never interpolated. The
|
|
135
|
+
fix is in the project, or in `portta adopt`, never in the gateway.
|
|
136
|
+
|
|
137
|
+
## Skill and CLI
|
|
138
|
+
|
|
139
|
+
The CLI enforces what matters; this skill orders it. Installing the whole layer
|
|
140
|
+
on a machine, instruction and hook included, is `portta agents install`.
|
|
141
|
+
The full rules are in the
|
|
142
|
+
[agent guidelines](https://github.com/codions-labs/portta/blob/main/docs/agent-guidelines.md).
|