hci-atrium 0.6.0 → 0.6.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/GUIDE.md +47 -5
- package/package.json +1 -1
package/GUIDE.md
CHANGED
|
@@ -90,10 +90,11 @@ client = Atrium() # defaults to the deployed instance (or ATRIUM_BASE_URL)
|
|
|
90
90
|
same instance).
|
|
91
91
|
|
|
92
92
|
**API keys (CI / headless / a fixed identity).** A key looks like `atr_...` and is minted in the
|
|
93
|
-
Atrium web app under a project's *
|
|
93
|
+
Atrium web app under a project's *Capabilities → API keys*. Two shapes:
|
|
94
94
|
|
|
95
|
-
- **Project-scoped key** — acts as that project;
|
|
96
|
-
`project=` needed
|
|
95
|
+
- **Project-scoped key** — acts as that project; library and session calls are scoped to it
|
|
96
|
+
automatically, no `project=` needed (the surveys namespace is the exception — see below). The
|
|
97
|
+
right shape for a study app that only ever writes to one project.
|
|
97
98
|
- **Account-wide key** — acts as your user across every project you can see.
|
|
98
99
|
|
|
99
100
|
Pass it as `Atrium(api_key="atr_...")` or set `ATRIUM_API_KEY` — either skips the browser flow
|
|
@@ -106,6 +107,45 @@ me.key_project_id # set when a project-scoped key is in us
|
|
|
106
107
|
me.effective_project_id # the project data ops target (scoped key, else your Personal project)
|
|
107
108
|
```
|
|
108
109
|
|
|
110
|
+
### Set up your project for coding agents
|
|
111
|
+
|
|
112
|
+
If you build with a coding agent, give it a standing pointer to this guide instead of letting it
|
|
113
|
+
guess the API. Create an `AGENTS.md` at your project root:
|
|
114
|
+
|
|
115
|
+
```markdown
|
|
116
|
+
This project uses the hci-atrium SDK. Before writing Atrium code, run
|
|
117
|
+
`atrium guide` and follow it — it is the authoritative API reference
|
|
118
|
+
(`uv run atrium guide` in Python projects, `pnpm exec atrium guide` in
|
|
119
|
+
TypeScript projects).
|
|
120
|
+
|
|
121
|
+
Instance: https://atrium.example.edu — the SDK reads `ATRIUM_BASE_URL` from the
|
|
122
|
+
process environment; no `.env` file is loaded for you, so export it or run via
|
|
123
|
+
`uv run --env-file .env`.
|
|
124
|
+
Credential: a project-scoped key as `ATRIUM_API_KEY`, set the same way. It
|
|
125
|
+
confines every call to this project — library and session calls need no
|
|
126
|
+
`project=` — but the surveys namespace still takes `project=` / `--project`.
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The instance and credential lines carry their weight: this guide documents the API, not *your*
|
|
130
|
+
deployment — without them an agent doesn't know which instance to point at or which credential you
|
|
131
|
+
set up.
|
|
132
|
+
|
|
133
|
+
Then add a `CLAUDE.md` beside it, for tools that read that name instead:
|
|
134
|
+
|
|
135
|
+
```markdown
|
|
136
|
+
This project's coding-agent context lives in [`AGENTS.md`](AGENTS.md). Read it
|
|
137
|
+
before writing code. `AGENTS.md` is the canonical source — keep this file in sync.
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Agent that can't run commands?** Materialize the guide into the repo and point at the file:
|
|
141
|
+
|
|
142
|
+
```sh
|
|
143
|
+
uv run atrium guide > atrium-guide.md # or: pnpm exec atrium guide > atrium-guide.md
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
The `AGENTS.md` line then becomes "read `atrium-guide.md` before writing Atrium code". Re-run it
|
|
147
|
+
after upgrading the SDK — the printed guide ships with the installed version.
|
|
148
|
+
|
|
109
149
|
### Projects & scope
|
|
110
150
|
|
|
111
151
|
A **project** is identified by a `p_...` short id (e.g. `p_4mD2qX`) — a base58, URL-safe id that
|
|
@@ -120,8 +160,10 @@ photos.library.search("rain") # every call on `p
|
|
|
120
160
|
```
|
|
121
161
|
|
|
122
162
|
`client.project(id)` / `client.collection(id)` return a scoped view that shares the same
|
|
123
|
-
authenticated session (cheap — no re-auth). A project-scoped API key
|
|
124
|
-
automatically
|
|
163
|
+
authenticated session (cheap — no re-auth). A project-scoped API key confines access to its
|
|
164
|
+
project automatically, so library and session calls need no `project=`. Namespaces that address a
|
|
165
|
+
project *by reference* are the exception: `client.surveys.*` (and `atrium survey pull/push`) still
|
|
166
|
+
want an explicit `project=` / `--project`, or a client scoped with `Atrium(project="p_…")`.
|
|
125
167
|
|
|
126
168
|
### The CLI
|
|
127
169
|
|
package/package.json
CHANGED