|
26 | 26 | "Agent": { |
27 | 27 | "additionalProperties": false, |
28 | 28 | "properties": { |
| 29 | + "created_by_subject": { |
| 30 | + "$ref": "#/components/schemas/CreatedBySubject" |
| 31 | + }, |
29 | 32 | "id": { |
30 | 33 | "description": "Immutable server-generated agent identifier.", |
31 | 34 | "minLength": 1, |
|
41 | 44 | "required": [ |
42 | 45 | "id", |
43 | 46 | "name", |
44 | | - "manifest" |
| 47 | + "manifest", |
| 48 | + "created_by_subject" |
45 | 49 | ], |
46 | 50 | "type": "object" |
47 | 51 | }, |
|
1102 | 1106 | }, |
1103 | 1107 | "type": "object" |
1104 | 1108 | }, |
| 1109 | + "CreatedBySubject": { |
| 1110 | + "additionalProperties": false, |
| 1111 | + "description": "Who created this resource.", |
| 1112 | + "properties": { |
| 1113 | + "subject_display_name": { |
| 1114 | + "description": "Display name.", |
| 1115 | + "minLength": 1, |
| 1116 | + "type": "string" |
| 1117 | + }, |
| 1118 | + "subject_id": { |
| 1119 | + "description": "Subject id.", |
| 1120 | + "minLength": 1, |
| 1121 | + "type": "string" |
| 1122 | + }, |
| 1123 | + "subject_type": { |
| 1124 | + "description": "Subject type.", |
| 1125 | + "minLength": 1, |
| 1126 | + "type": "string" |
| 1127 | + } |
| 1128 | + }, |
| 1129 | + "required": [ |
| 1130 | + "subject_id", |
| 1131 | + "subject_type", |
| 1132 | + "subject_display_name" |
| 1133 | + ], |
| 1134 | + "type": "object" |
| 1135 | + }, |
1105 | 1136 | "CronExpression": { |
1106 | 1137 | "description": "Standard 5-field cron expression, evaluated in `timezone`.", |
1107 | 1138 | "pattern": "^[\\d*,\\-/]+(?:\\s+[\\d*,\\-/]+){4}$", |
|
3114 | 3145 | "format": "date-time", |
3115 | 3146 | "type": "string" |
3116 | 3147 | }, |
3117 | | - "created_by": { |
3118 | | - "type": "string" |
| 3148 | + "created_by_subject": { |
| 3149 | + "$ref": "#/components/schemas/CreatedBySubject" |
3119 | 3150 | }, |
3120 | 3151 | "id": { |
3121 | 3152 | "type": "string" |
|
3136 | 3167 | "agent_name", |
3137 | 3168 | "name", |
3138 | 3169 | "manifest", |
3139 | | - "created_by", |
| 3170 | + "created_by_subject", |
3140 | 3171 | "created_at", |
3141 | 3172 | "updated_at" |
3142 | 3173 | ], |
|
3173 | 3204 | "format": "date-time", |
3174 | 3205 | "type": "string" |
3175 | 3206 | }, |
| 3207 | + "created_by_subject": { |
| 3208 | + "$ref": "#/components/schemas/CreatedBySubject" |
| 3209 | + }, |
3176 | 3210 | "id": { |
3177 | 3211 | "type": "string" |
3178 | 3212 | }, |
|
3196 | 3230 | "null" |
3197 | 3231 | ] |
3198 | 3232 | }, |
3199 | | - "triggered_by": { |
3200 | | - "type": "string" |
3201 | | - }, |
3202 | 3233 | "updated_at": { |
3203 | 3234 | "format": "date-time", |
3204 | 3235 | "type": "string" |
|
3210 | 3241 | "name", |
3211 | 3242 | "scheduled_for", |
3212 | 3243 | "status", |
3213 | | - "triggered_by", |
| 3244 | + "created_by_subject", |
3214 | 3245 | "triggered_at", |
3215 | 3246 | "created_at", |
3216 | 3247 | "updated_at" |
|
3242 | 3273 | "description": "ISO 8601 creation timestamp.", |
3243 | 3274 | "type": "string" |
3244 | 3275 | }, |
3245 | | - "created_by": { |
3246 | | - "description": "Caller identity that created the session (immutable).", |
3247 | | - "type": "string" |
| 3276 | + "created_by_subject": { |
| 3277 | + "$ref": "#/components/schemas/CreatedBySubject" |
3248 | 3278 | }, |
3249 | 3279 | "id": { |
3250 | 3280 | "description": "Unique session id.", |
|
3272 | 3302 | "id", |
3273 | 3303 | "agent", |
3274 | 3304 | "title", |
3275 | | - "created_by", |
| 3305 | + "created_by_subject", |
3276 | 3306 | "created_at", |
3277 | 3307 | "updated_at", |
3278 | 3308 | "metrics", |
|
6713 | 6743 | }, |
6714 | 6744 | "/api/v1/sessions": { |
6715 | 6745 | "get": { |
6716 | | - "description": "List the caller's sessions (newest first by default), token-paginated. Results are scoped to the authenticated identity via the session store's `created_by` filter (not a client query param). Optional `agent_id` filters to sessions bound to that named agent. Pass `page_token` to fetch the next page, keeping the other query params constant.", |
| 6746 | + "description": "List the caller's sessions (newest first by default), token-paginated. Results are scoped to the authenticated identity via the session store's `created_by_subject.subject_id` filter (not a client query param). Optional `agent_id` filters to sessions bound to that named agent. Pass `page_token` to fetch the next page, keeping the other query params constant.", |
6717 | 6747 | "parameters": [ |
6718 | 6748 | { |
6719 | 6749 | "description": "Page size. Defaults to 25, max 25.", |
|
6884 | 6914 | }, |
6885 | 6915 | "/api/v1/sessions/{session_id}": { |
6886 | 6916 | "delete": { |
6887 | | - "description": "Delete a session and all related turns, events, and internal state. Only the session creator (`created_by`) may delete it. Idempotent if already gone.", |
| 6917 | + "description": "Delete a session and all related turns, events, and internal state. Only the session creator may delete it. Idempotent if already gone.", |
6888 | 6918 | "parameters": [ |
6889 | 6919 | { |
6890 | 6920 | "description": "Session identifier.", |
|
6924 | 6954 | "x-fern-sdk-method-name": "delete" |
6925 | 6955 | }, |
6926 | 6956 | "get": { |
6927 | | - "description": "Fetch a session by ID. Only the session creator (`created_by`) may fetch it.", |
| 6957 | + "description": "Fetch a session by ID. Only the session creator may fetch it.", |
6928 | 6958 | "parameters": [ |
6929 | 6959 | { |
6930 | 6960 | "description": "Session identifier.", |
|
6981 | 7011 | "x-fern-sdk-method-name": "get" |
6982 | 7012 | }, |
6983 | 7013 | "patch": { |
6984 | | - "description": "Update a session by replacing `agent` with `{ spec: AgentSpec }`. Named (reference) sessions reject agent updates. An empty body is a valid no-op that refreshes `updated_at`. Only the session creator (`created_by`) may update it.", |
| 7014 | + "description": "Update a session by replacing `agent` with `{ spec: AgentSpec }`. Named (reference) sessions reject agent updates. An empty body is a valid no-op that refreshes `updated_at`. Only the session creator may update it.", |
6985 | 7015 | "parameters": [ |
6986 | 7016 | { |
6987 | 7017 | "description": "Session identifier.", |
|
7070 | 7100 | }, |
7071 | 7101 | "/api/v1/sessions/{session_id}/cancel": { |
7072 | 7102 | "post": { |
7073 | | - "description": "Cancel the running last turn for a session. Only the session creator (`created_by`) may cancel.", |
| 7103 | + "description": "Cancel the running last turn for a session. Only the session creator may cancel.", |
7074 | 7104 | "parameters": [ |
7075 | 7105 | { |
7076 | 7106 | "description": "Session identifier.", |
|
7149 | 7179 | }, |
7150 | 7180 | "/api/v1/sessions/{session_id}/events": { |
7151 | 7181 | "get": { |
7152 | | - "description": "List session events as `{ turn_id, event }` across the active turn branch (newest first), including persisted events from a running tip. Each turn contributes turn.created, content events (model.message, tool.call, …), and turn.done when terminal; streaming deltas are not included. Use `page_token` to paginate backward toward older events while retaining the original branch anchor. Only the session creator (`created_by`) may list events.", |
| 7182 | + "description": "List session events as `{ turn_id, event }` across the active turn branch (newest first), including persisted events from a running tip. Each turn contributes turn.created, content events (model.message, tool.call, …), and turn.done when terminal; streaming deltas are not included. Use `page_token` to paginate backward toward older events while retaining the original branch anchor. Only the session creator may list events.", |
7153 | 7183 | "parameters": [ |
7154 | 7184 | { |
7155 | 7185 | "description": "Session identifier.", |
|
7256 | 7286 | }, |
7257 | 7287 | "/api/v1/sessions/{session_id}/turns": { |
7258 | 7288 | "get": { |
7259 | | - "description": "List turns for a session (newest first by default), token-paginated. Only the session creator (`created_by`) may list turns.", |
| 7289 | + "description": "List turns for a session (newest first by default), token-paginated. Only the session creator may list turns.", |
7260 | 7290 | "parameters": [ |
7261 | 7291 | { |
7262 | 7292 | "description": "Session identifier.", |
|
7351 | 7381 | "x-fern-sdk-method-name": "list_turns" |
7352 | 7382 | }, |
7353 | 7383 | "post": { |
7354 | | - "description": "Create a turn within a session and execute it.\nOnly the session creator (`created_by`) may create turns.\nWhen `stream` is true (default), respond with a Server-Sent Events stream of turn events.\nWhen `stream` is false, return the turn immediately with `state.status: \"running\"` while execution continues in the background; use get turn or subscribe to observe completion.\nUse `previous_turn_id` to chain to the session's last turn (defaults to `auto`); use `none` for a new root.", |
| 7384 | + "description": "Create a turn within a session and execute it.\nOnly the session creator may create turns.\nWhen `stream` is true (default), respond with a Server-Sent Events stream of turn events.\nWhen `stream` is false, return the turn immediately with `state.status: \"running\"` while execution continues in the background; use get turn or subscribe to observe completion.\nUse `previous_turn_id` to chain to the session's last turn (defaults to `auto`); use `none` for a new root.", |
7355 | 7385 | "parameters": [ |
7356 | 7386 | { |
7357 | 7387 | "description": "Session identifier.", |
|
7486 | 7516 | }, |
7487 | 7517 | "/api/v1/sessions/{session_id}/turns/{turn_id}": { |
7488 | 7518 | "get": { |
7489 | | - "description": "Fetch a single turn by ID. Only the session creator (`created_by`) may fetch it.", |
| 7519 | + "description": "Fetch a single turn by ID. Only the session creator may fetch it.", |
7490 | 7520 | "parameters": [ |
7491 | 7521 | { |
7492 | 7522 | "description": "Session identifier.", |
|
7556 | 7586 | }, |
7557 | 7587 | "/api/v1/sessions/{session_id}/turns/{turn_id}/download-sandbox-file": { |
7558 | 7588 | "get": { |
7559 | | - "description": "Download a file from the sandbox this turn ran in. Paths come from the assistant's `sandbox_artifacts` block. Only the session creator (`created_by`) may download.", |
| 7589 | + "description": "Download a file from the sandbox this turn ran in. Paths come from the assistant's `sandbox_artifacts` block. Only the session creator may download.", |
7560 | 7590 | "parameters": [ |
7561 | 7591 | { |
7562 | 7592 | "description": "Session identifier.", |
|
7688 | 7718 | }, |
7689 | 7719 | "/api/v1/sessions/{session_id}/turns/{turn_id}/events": { |
7690 | 7720 | "get": { |
7691 | | - "description": "Paginated persisted events for a turn (insertion order by default). Only the session creator (`created_by`) may list events.", |
| 7721 | + "description": "Paginated persisted events for a turn (insertion order by default). Only the session creator may list events.", |
7692 | 7722 | "parameters": [ |
7693 | 7723 | { |
7694 | 7724 | "description": "Session identifier.", |
|
7805 | 7835 | }, |
7806 | 7836 | "/api/v1/sessions/{session_id}/turns/{turn_id}/subscribe": { |
7807 | 7837 | "get": { |
7808 | | - "description": "Subscribe to the live SSE stream for a turn. Only the session creator (`created_by`) may subscribe. Pass `after_sequence_number` to resume after a disconnect (exclusive — events after this sequence number are replayed).", |
| 7838 | + "description": "Subscribe to the live SSE stream for a turn. Only the session creator may subscribe. Pass `after_sequence_number` to resume after a disconnect (exclusive — events after this sequence number are replayed).", |
7809 | 7839 | "parameters": [ |
7810 | 7840 | { |
7811 | 7841 | "description": "Session identifier.", |
|
0 commit comments