oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1# Read-only agent access
2
3This interface uses Oficina Connect delegated credentials. It exposes no
4conversation posting, task changes, merge, or other write operation.
5Model-written text is never treated as the person's words.
6
7## Configuration
8
9Set `EQUIPO_AGENT_ISSUER` (normally `https://connect.oficina.works`) and
10`EQUIPO_AGENT_TEAM` together. The team is the existing Home directory team's
11canonical SQID, encoded from one positive team ID with Home's default Sqids
12codec. It is not a team label, hostname, or Equipo's local database ID.
13Both absent leaves the existing API authentication unchanged. Partial or
14malformed values refuse startup. Equipo currently has no separate Home team
15mode; this setting binds its one existing local team to the directory team.
16
17Agent access requires valid `EQUIPO_HOME_ISSUER`,
18`EQUIPO_HOME_CONSUMER_ID`, `EQUIPO_HOME_KEYS_BASE64`, and
19`EQUIPO_HOME_DEK_BASE64`, plus the normal instance configuration. Preserve
20existing identity keys and local account links. Configuration does not
21create accounts, link people, or add roster members.
22
23`GET /auth/start` is an alias for the existing Home sign-in entry point,
24`GET /auth/home`. Both directly redirect to the configured Home issuer's
25`/authorize` URL. Health and version endpoints are unchanged.
26
27## Authentication and discovery
28
29`GET /api/v1/operations` takes no arguments. Send
30`Authorization: Bearer <delegated credential>`. Device credentials and
31browser cookies do not grant agent access. These routes run ahead of the
32device and session middleware.
33
34Every call uses `agent-access` revision `8ed8ba826000` and its
35`NewRemoteVerifier(agentIssuer, equipoOrigin+"/api/v1", homeIssuer)`.
36The verifier calls the issuer's `POST /api/v1/credential`, forwarding the
37bearer and `{"resource":"<equipoOrigin>/api/v1"}`. It checks the returned
38resource and identity issuer and requires a subject and grant. There is no
39local credential cache or offline fallback.
40
41Equipo resolves that Home subject through its existing authenticated local
42identity binding and checks the current roster. An absent, removed, or
43unlinked person is refused. Invocation resolves the link again inside the
44application read transaction and checks the current roster/session epoch.
45Lookup failures deny access. A role change takes effect through these
46existing read paths; all active roster roles can read shared team work.
47
48Missing or invalid credentials return 401, `Cache-Control: no-store`,
49`Content-Type: application/json`, exactly one `WWW-Authenticate: Bearer`,
50and only this envelope (the nonempty message may vary):
51
52```json
53{"error":{"code":"unauthenticated","message":"Send a valid delegated bearer."}}
54```
55
56A valid linked person gets `{"operations":[...]}`. Each descriptor includes
57its name, description, scope, read-only/idempotent flags, and JSON input and
58output schemas. Only operations allowed for this exact team and
59`equipo:read` scope appear. Other teams or scopes get an empty list.
60
61## Invocation
62
63`POST /api/v1/operations/{name}` accepts `Content-Type: application/json`
64and the same delegated bearer. The body is the operation's arguments,
65including the exact `team` SQID. Unknown fields, duplicate JSON field names,
66invalid JSON, missing required arguments, and out-of-range limits are
67rejected by the shared registry. Input is capped at 2 MiB.
68
69| Operation | Arguments besides `team` | Output |
70| --- | --- | --- |
71| `equipo_projects_list` | Optional `limit`, integer 1 to 100, default 100 | `{"items":[Project],"truncated":boolean}` |
72| `equipo_tasks_list` | Optional `limit`, integer 1 to 100, default 100 | `{"items":[Task],"truncated":boolean}` |
73| `equipo_task_get` | Required `id`, nonempty string, at most 128 characters | `{"task":Task}` |
74| `equipo_needs_you` | Optional `limit`, integer 1 to 100, default 100 | `{"items":[Task],"truncated":boolean}` |
75
76All four descriptors set `read_only` and `idempotent` to true and
77`destructive` to false. The returned Project and Task objects are the
78current thin device API's data, documented in [Equipo v1](equipo-v1.md).
79Projects include ID, title, repository, state, revision, and current
80metadata. Tasks include ID, project, title, brief, stage, revision,
81creator, steps, findings, thread, questions, and current decision fields.
82The output schemas guarantee IDs, titles, revisions, and the enclosing
83shape; additional device fields are preserved. No prose is generated.
84
85Projects use the existing `Chat.Projects` read and omit the device API's
86repository-add allowlist and home namespace. Task listing uses `Chat.Tasks`,
87including its test-person visibility filter. Task get uses `Chat.Task`.
88Needs you uses `Chat.NeedsYou`, which selects the calling person's recent
89nonterminal tasks whose decision field is nonempty.
90
91Lists preserve the existing device ordering. Each response contains at
92most 100 items, and invocation output is capped at 1 MiB. Oversized output
93returns `too_large` with no partial data. `truncated` is conservative:
94it is true when the requested limit cuts a list or completeness cannot be
95established. Task listing reads at most the latest 100 tasks and preserves
96that source cap before hiding other test people's tasks. If the source hits
97100, `truncated` stays true even when fewer visible items are returned.
98Needs you already scans at most 100 recent nonterminal tasks before
99filtering, so its `truncated` is always true, including an empty result.
100An empty result is not proof that there is no older work waiting. There is
101no cursor or all-history promise in this first interface.
102
103Example arguments:
104
105```json
106{"team":"<Home team SQID>","limit":20}
107```
108
109Errors use the same `error.code` / `error.message` envelope: 403 for denied
110local access or a different submitted team, 404 for an unavailable
111operation or task, 413 for size limits, 415 for other media types, 422 for
112invalid arguments, and 503 when verification or reading is unavailable.
113All responses from the agent handler have `Cache-Control: no-store`.
114