@utdk/posthog 1.0.0-20260712.5-dev.e2949a6
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/LICENSE +373 -0
- package/README.md +172 -0
- package/docs/account_relationship_definitions.md +194 -0
- package/docs/accounts.md +380 -0
- package/docs/actions.md +274 -0
- package/docs/activity_logs.md +144 -0
- package/docs/advanced_activity_logs.md +101 -0
- package/docs/agent_platform.md +2525 -0
- package/docs/ai-observability.md +514 -0
- package/docs/alerts.md +444 -0
- package/docs/annotations.md +200 -0
- package/docs/batch_exports.md +2118 -0
- package/docs/business_knowledge.md +468 -0
- package/docs/code-invites.md +72 -0
- package/docs/cohorts.md +412 -0
- package/docs/comments.md +321 -0
- package/docs/conversations.md +695 -0
- package/docs/custom_property_definitions.md +442 -0
- package/docs/custom_property_sources.md +194 -0
- package/docs/customer_analytics.md +442 -0
- package/docs/customer_journeys.md +380 -0
- package/docs/customer_profile_configs.md +380 -0
- package/docs/dashboard_templates.md +258 -0
- package/docs/dashboards.md +1896 -0
- package/docs/data_color_themes.md +380 -0
- package/docs/data_modeling_jobs.md +264 -0
- package/docs/data_warehouse.md +928 -0
- package/docs/dataset_items.md +382 -0
- package/docs/datasets.md +382 -0
- package/docs/desktop_file_system.md +753 -0
- package/docs/desktop_file_system_shortcut.md +244 -0
- package/docs/docs.md +72 -0
- package/docs/early_access_feature.md +194 -0
- package/docs/elements.md +510 -0
- package/docs/endpoints.md +1030 -0
- package/docs/engineering_analytics.md +712 -0
- package/docs/environments.md +881 -0
- package/docs/error_tracking.md +5108 -0
- package/docs/evaluation_runs.md +78 -0
- package/docs/evaluations.md +446 -0
- package/docs/event_definitions.md +425 -0
- package/docs/event_filter.md +280 -0
- package/docs/event_schemas.md +163 -0
- package/docs/events.md +208 -0
- package/docs/experiment_holdouts.md +194 -0
- package/docs/experiment_saved_metrics.md +194 -0
- package/docs/experiments.md +1088 -0
- package/docs/exports.md +256 -0
- package/docs/external_data_schemas.md +752 -0
- package/docs/external_data_sources.md +2296 -0
- package/docs/feature_flags.md +808 -0
- package/docs/field_notes.md +206 -0
- package/docs/file_system.md +880 -0
- package/docs/file_system_shortcut.md +444 -0
- package/docs/flag_value.md +46 -0
- package/docs/groups.md +514 -0
- package/docs/groups_types.md +349 -0
- package/docs/health_issues.md +386 -0
- package/docs/heatmap_screenshots.md +72 -0
- package/docs/heatmaps.md +136 -0
- package/docs/hog_flows.md +1576 -0
- package/docs/hog_function_templates.md +101 -0
- package/docs/hog_functions.md +974 -0
- package/docs/ingestion_warnings_v2.md +40 -0
- package/docs/insight_variables.md +380 -0
- package/docs/insights.md +1722 -0
- package/docs/integrations.md +1954 -0
- package/docs/js-snippet.md +104 -0
- package/docs/live_debugger_breakpoints.md +264 -0
- package/docs/llm_analytics.md +3373 -0
- package/docs/llm_prompts.md +442 -0
- package/docs/llm_skills.md +952 -0
- package/docs/logs.md +2446 -0
- package/docs/managed_viewsets.md +140 -0
- package/docs/marketing_analytics.md +518 -0
- package/docs/max.md +772 -0
- package/docs/max_tools.md +70 -0
- package/docs/mcp_analytics.md +712 -0
- package/docs/mcp_server_installations.md +970 -0
- package/docs/mcp_servers.md +78 -0
- package/docs/mcp_tools.md +82 -0
- package/docs/messaging_templates.md +444 -0
- package/docs/metrics.md +462 -0
- package/docs/notebooks.md +838 -0
- package/docs/object_media_previews.md +228 -0
- package/docs/organizations.md +2958 -0
- package/docs/persons.md +1514 -0
- package/docs/platform_features.md +700 -0
- package/docs/plugin_configs.md +70 -0
- package/docs/product_enablement.md +39 -0
- package/docs/product_tours.md +357 -0
- package/docs/project_secret_api_keys.md +444 -0
- package/docs/property_access_controls.md +200 -0
- package/docs/property_definitions.md +244 -0
- package/docs/query.md +560 -0
- package/docs/quota_limits.md +40 -0
- package/docs/reminders.md +194 -0
- package/docs/replay.md +1020 -0
- package/docs/reverse_proxy.md +200 -0
- package/docs/sandbox-custom-images.md +209 -0
- package/docs/sandbox-environments.md +168 -0
- package/docs/saved.md +392 -0
- package/docs/saved_query_column_annotations.md +224 -0
- package/docs/scheduled_changes.md +200 -0
- package/docs/schema_property_groups.md +194 -0
- package/docs/sdk_health.md +40 -0
- package/docs/session_group_summaries.md +200 -0
- package/docs/session_recordings.md +260 -0
- package/docs/session_summaries.md +200 -0
- package/docs/sessions.md +132 -0
- package/docs/signals.md +1428 -0
- package/docs/single_session_summaries.md +72 -0
- package/docs/streamlit_apps.md +456 -0
- package/docs/subscriptions.md +634 -0
- package/docs/surveys.md +731 -0
- package/docs/taggers.md +446 -0
- package/docs/task-automations.md +200 -0
- package/docs/task-runs.md +654 -0
- package/docs/task_channels.md +136 -0
- package/docs/task_mentions.md +40 -0
- package/docs/tasks.md +776 -0
- package/docs/tracing.md +1186 -0
- package/docs/uploaded_media.md +44 -0
- package/docs/user_home_settings.md +72 -0
- package/docs/user_interview_topics.md +1288 -0
- package/docs/user_interviews.md +444 -0
- package/docs/users.md +1267 -0
- package/docs/vision.md +2022 -0
- package/docs/visual_review.md +816 -0
- package/docs/warehouse_column_annotations.md +224 -0
- package/docs/warehouse_column_statistics.md +80 -0
- package/docs/warehouse_dag.md +40 -0
- package/docs/warehouse_model_paths.md +70 -0
- package/docs/warehouse_saved_queries.md +1056 -0
- package/docs/warehouse_saved_query_folders.md +318 -0
- package/docs/warehouse_tables.md +584 -0
- package/docs/warehouse_view_link.md +456 -0
- package/docs/warehouse_view_links.md +456 -0
- package/docs/web_analytics.md +136 -0
- package/docs/web_analytics_achievements.md +200 -0
- package/docs/web_experiments.md +194 -0
- package/docs/web_vitals.md +74 -0
- package/docs/wizard.md +170 -0
- package/index.ts +22 -0
- package/metadata.ts +41419 -0
- package/openapi.json +297382 -0
- package/overlay.yaml +23 -0
- package/package.json +34 -0
- package/provenance.json +24 -0
- package/research.json +80 -0
- package/types/index.ts +17547 -0
|
@@ -0,0 +1,2525 @@
|
|
|
1
|
+
# Agent Platform
|
|
2
|
+
|
|
3
|
+
## Operations
|
|
4
|
+
|
|
5
|
+
### `posthog.agentApplicationsList`
|
|
6
|
+
|
|
7
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/`
|
|
8
|
+
- **What it does**: Agent applications — the deployable unit of the platform.
|
|
9
|
+
|
|
10
|
+
URLs:
|
|
11
|
+
GET /api/projects/<team>/agent_applications/ list
|
|
12
|
+
POST /api/projects/<team>/agent_applications/ create
|
|
13
|
+
GET /api/projects/<team>/agent_applications/<id|slug>/ retrieve
|
|
14
|
+
PATCH /api/projects/<team>/agent_applications/<id|slug>/ update
|
|
15
|
+
DELETE /api/projects/<team>/agent_applications/<id|slug>/ archive
|
|
16
|
+
POST /api/projects/<team>/agent_applications/<id|slug>/set_env/ bulk replace env
|
|
17
|
+
GET /api/projects/<team>/agent_applications/<id|slug>/env_keys/ list set keys
|
|
18
|
+
GET /api/projects/<team>/agent_applications/<id|slug>/env_keys/<KEY>/ is one key set?
|
|
19
|
+
PUT /api/projects/<team>/agent_applications/<id|slug>/env_keys/<KEY>/ set one key
|
|
20
|
+
DELETE /api/projects/<team>/agent_applications/<id|slug>/env_keys/<KEY>/ clear one key
|
|
21
|
+
- **OpenAPI operationId**: `agent_applications_list`
|
|
22
|
+
- **Path params**: None
|
|
23
|
+
- **Query params**: `limit`, `offset`
|
|
24
|
+
- **Response codes**: `200`
|
|
25
|
+
- **Transport options**: None
|
|
26
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
27
|
+
|
|
28
|
+
**Inputs**
|
|
29
|
+
|
|
30
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
31
|
+
- Client transport options: None
|
|
32
|
+
|
|
33
|
+
**Outputs**
|
|
34
|
+
|
|
35
|
+
- Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: string; team_id: number; name: string; slug?: string; description?: string; live_revision: string | null; archived?: boolean; archived_at:...`
|
|
36
|
+
- OpenAPI response codes: `200`
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import posthog from "@utdk/posthog";
|
|
40
|
+
|
|
41
|
+
type AgentApplicationsListInput = Parameters<typeof posthog.agentApplicationsList> extends [infer T, ...unknown[]] ? T : undefined;
|
|
42
|
+
type AgentApplicationsListOutput = Awaited<ReturnType<typeof posthog.agentApplicationsList>>;
|
|
43
|
+
|
|
44
|
+
const result: AgentApplicationsListOutput = await posthog.agentApplicationsList();
|
|
45
|
+
|
|
46
|
+
// Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: string; team_id: number; name: string; slug?: string; description?: string; live_revision: string | null; archived?: boolean; archived_at:...
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### `posthog.agentApplicationsCreate`
|
|
50
|
+
|
|
51
|
+
- **HTTP**: `POST /api/projects/{project_id}/agent_applications/`
|
|
52
|
+
- **What it does**: Agent applications — the deployable unit of the platform.
|
|
53
|
+
|
|
54
|
+
URLs:
|
|
55
|
+
GET /api/projects/<team>/agent_applications/ list
|
|
56
|
+
POST /api/projects/<team>/agent_applications/ create
|
|
57
|
+
GET /api/projects/<team>/agent_applications/<id|slug>/ retrieve
|
|
58
|
+
PATCH /api/projects/<team>/agent_applications/<id|slug>/ update
|
|
59
|
+
DELETE /api/projects/<team>/agent_applications/<id|slug>/ archive
|
|
60
|
+
POST /api/projects/<team>/agent_applications/<id|slug>/set_env/ bulk replace env
|
|
61
|
+
GET /api/projects/<team>/agent_applications/<id|slug>/env_keys/ list set keys
|
|
62
|
+
GET /api/projects/<team>/agent_applications/<id|slug>/env_keys/<KEY>/ is one key set?
|
|
63
|
+
PUT /api/projects/<team>/agent_applications/<id|slug>/env_keys/<KEY>/ set one key
|
|
64
|
+
DELETE /api/projects/<team>/agent_applications/<id|slug>/env_keys/<KEY>/ clear one key
|
|
65
|
+
- **OpenAPI operationId**: `agent_applications_create`
|
|
66
|
+
- **Path params**: None
|
|
67
|
+
- **Query params**: None
|
|
68
|
+
- **Response codes**: `201`
|
|
69
|
+
- **Transport options**: None
|
|
70
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
71
|
+
|
|
72
|
+
**Inputs**
|
|
73
|
+
|
|
74
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
75
|
+
- Client transport options: None
|
|
76
|
+
|
|
77
|
+
**Outputs**
|
|
78
|
+
|
|
79
|
+
- Client return type: `{ id: string; team_id: number; name: string; slug?: string; description?: string; live_revision: string | null; archived?: boolean; archived_at: string | null; created_by_id: number | null; created_by: { [key: string]: ...`
|
|
80
|
+
- OpenAPI response codes: `201`
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
import posthog from "@utdk/posthog";
|
|
84
|
+
|
|
85
|
+
type AgentApplicationsCreateInput = Parameters<typeof posthog.agentApplicationsCreate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
86
|
+
type AgentApplicationsCreateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsCreate>>;
|
|
87
|
+
|
|
88
|
+
const result: AgentApplicationsCreateOutput = await posthog.agentApplicationsCreate();
|
|
89
|
+
|
|
90
|
+
// Result shape (from schema): { id: string; team_id: number; name: string; slug?: string; description?: string; live_revision: string | null; archived?: boolean; archived_at: string | null; created_by_id: number | null; created_by: { [key: string]: ...
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### `posthog.agentMemoryListFiles`
|
|
94
|
+
|
|
95
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{application_id}/memory/files/`
|
|
96
|
+
- **What it does**: List memory file headers under the agent's prefix. Headers only — no bodies.
|
|
97
|
+
- **OpenAPI operationId**: `agent_memory_list_files`
|
|
98
|
+
- **Path params**: `application_id`
|
|
99
|
+
- **Query params**: `prefix`
|
|
100
|
+
- **Response codes**: `200`
|
|
101
|
+
- **Transport options**: None
|
|
102
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
103
|
+
|
|
104
|
+
**Inputs**
|
|
105
|
+
|
|
106
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
107
|
+
- Client transport options: None
|
|
108
|
+
|
|
109
|
+
**Outputs**
|
|
110
|
+
|
|
111
|
+
- Client return type: `{ count: number; entries: ({ path: string; description: string; tags: (string)[]; created_at: string | null; updated_at: string | null })[] }`
|
|
112
|
+
- OpenAPI response codes: `200`
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
import posthog from "@utdk/posthog";
|
|
116
|
+
|
|
117
|
+
type AgentMemoryListFilesInput = Parameters<typeof posthog.agentMemoryListFiles> extends [infer T, ...unknown[]] ? T : undefined;
|
|
118
|
+
type AgentMemoryListFilesOutput = Awaited<ReturnType<typeof posthog.agentMemoryListFiles>>;
|
|
119
|
+
|
|
120
|
+
const result: AgentMemoryListFilesOutput = await posthog.agentMemoryListFiles();
|
|
121
|
+
|
|
122
|
+
// Result shape (from schema): { count: number; entries: ({ path: string; description: string; tags: (string)[]; created_at: string | null; updated_at: string | null })[] }
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### `posthog.agentMemoryCreateFile`
|
|
126
|
+
|
|
127
|
+
- **HTTP**: `POST /api/projects/{project_id}/agent_applications/{application_id}/memory/files/`
|
|
128
|
+
- **What it does**: Create a memory file. Fails if the path already exists — use the update endpoint to overwrite.
|
|
129
|
+
- **OpenAPI operationId**: `agent_memory_create_file`
|
|
130
|
+
- **Path params**: `application_id`
|
|
131
|
+
- **Query params**: None
|
|
132
|
+
- **Response codes**: `200`
|
|
133
|
+
- **Transport options**: None
|
|
134
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
135
|
+
|
|
136
|
+
**Inputs**
|
|
137
|
+
|
|
138
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
139
|
+
- Client transport options: None
|
|
140
|
+
|
|
141
|
+
**Outputs**
|
|
142
|
+
|
|
143
|
+
- Client return type: `{ content: string }`
|
|
144
|
+
- OpenAPI response codes: `200`
|
|
145
|
+
|
|
146
|
+
```ts
|
|
147
|
+
import posthog from "@utdk/posthog";
|
|
148
|
+
|
|
149
|
+
type AgentMemoryCreateFileInput = Parameters<typeof posthog.agentMemoryCreateFile> extends [infer T, ...unknown[]] ? T : undefined;
|
|
150
|
+
type AgentMemoryCreateFileOutput = Awaited<ReturnType<typeof posthog.agentMemoryCreateFile>>;
|
|
151
|
+
|
|
152
|
+
const result: AgentMemoryCreateFileOutput = await posthog.agentMemoryCreateFile();
|
|
153
|
+
|
|
154
|
+
// Result shape (from schema): { content: string }
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### `posthog.agentMemoryDeleteFile`
|
|
158
|
+
|
|
159
|
+
- **HTTP**: `DELETE /api/projects/{project_id}/agent_applications/{application_id}/memory/files/by_path/`
|
|
160
|
+
- **What it does**: Hard-delete a memory file. Activity log captures the action against the agent.
|
|
161
|
+
- **OpenAPI operationId**: `agent_memory_delete_file`
|
|
162
|
+
- **Path params**: `application_id`
|
|
163
|
+
- **Query params**: `path`
|
|
164
|
+
- **Response codes**: `204`
|
|
165
|
+
- **Transport options**: None
|
|
166
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
167
|
+
|
|
168
|
+
**Inputs**
|
|
169
|
+
|
|
170
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
171
|
+
- Client transport options: None
|
|
172
|
+
|
|
173
|
+
**Outputs**
|
|
174
|
+
|
|
175
|
+
- Client return type: `unknown`
|
|
176
|
+
- OpenAPI response codes: `204`
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
import posthog from "@utdk/posthog";
|
|
180
|
+
|
|
181
|
+
type AgentMemoryDeleteFileInput = Parameters<typeof posthog.agentMemoryDeleteFile> extends [infer T, ...unknown[]] ? T : undefined;
|
|
182
|
+
type AgentMemoryDeleteFileOutput = Awaited<ReturnType<typeof posthog.agentMemoryDeleteFile>>;
|
|
183
|
+
|
|
184
|
+
const result: AgentMemoryDeleteFileOutput = await posthog.agentMemoryDeleteFile();
|
|
185
|
+
|
|
186
|
+
// Result shape (from schema): unknown
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### `posthog.agentMemoryGetFile`
|
|
190
|
+
|
|
191
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{application_id}/memory/files/by_path/`
|
|
192
|
+
- **What it does**: Read one memory file in full (frontmatter + markdown body).
|
|
193
|
+
- **OpenAPI operationId**: `agent_memory_get_file`
|
|
194
|
+
- **Path params**: `application_id`
|
|
195
|
+
- **Query params**: `path`
|
|
196
|
+
- **Response codes**: `200`
|
|
197
|
+
- **Transport options**: None
|
|
198
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
199
|
+
|
|
200
|
+
**Inputs**
|
|
201
|
+
|
|
202
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
203
|
+
- Client transport options: None
|
|
204
|
+
|
|
205
|
+
**Outputs**
|
|
206
|
+
|
|
207
|
+
- Client return type: `{ content: string }`
|
|
208
|
+
- OpenAPI response codes: `200`
|
|
209
|
+
|
|
210
|
+
```ts
|
|
211
|
+
import posthog from "@utdk/posthog";
|
|
212
|
+
|
|
213
|
+
type AgentMemoryGetFileInput = Parameters<typeof posthog.agentMemoryGetFile> extends [infer T, ...unknown[]] ? T : undefined;
|
|
214
|
+
type AgentMemoryGetFileOutput = Awaited<ReturnType<typeof posthog.agentMemoryGetFile>>;
|
|
215
|
+
|
|
216
|
+
const result: AgentMemoryGetFileOutput = await posthog.agentMemoryGetFile();
|
|
217
|
+
|
|
218
|
+
// Result shape (from schema): { content: string }
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### `posthog.agentMemoryUpdateFile`
|
|
222
|
+
|
|
223
|
+
- **HTTP**: `PATCH /api/projects/{project_id}/agent_applications/{application_id}/memory/files/by_path/`
|
|
224
|
+
- **What it does**: Update a memory file. Any field omitted is preserved from the existing file.
|
|
225
|
+
- **OpenAPI operationId**: `agent_memory_update_file`
|
|
226
|
+
- **Path params**: `application_id`
|
|
227
|
+
- **Query params**: `path`
|
|
228
|
+
- **Response codes**: `200`
|
|
229
|
+
- **Transport options**: None
|
|
230
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
231
|
+
|
|
232
|
+
**Inputs**
|
|
233
|
+
|
|
234
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
235
|
+
- Client transport options: None
|
|
236
|
+
|
|
237
|
+
**Outputs**
|
|
238
|
+
|
|
239
|
+
- Client return type: `{ content: string }`
|
|
240
|
+
- OpenAPI response codes: `200`
|
|
241
|
+
|
|
242
|
+
```ts
|
|
243
|
+
import posthog from "@utdk/posthog";
|
|
244
|
+
|
|
245
|
+
type AgentMemoryUpdateFileInput = Parameters<typeof posthog.agentMemoryUpdateFile> extends [infer T, ...unknown[]] ? T : undefined;
|
|
246
|
+
type AgentMemoryUpdateFileOutput = Awaited<ReturnType<typeof posthog.agentMemoryUpdateFile>>;
|
|
247
|
+
|
|
248
|
+
const result: AgentMemoryUpdateFileOutput = await posthog.agentMemoryUpdateFile();
|
|
249
|
+
|
|
250
|
+
// Result shape (from schema): { content: string }
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### `posthog.agentMemorySearch`
|
|
254
|
+
|
|
255
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{application_id}/memory/search/`
|
|
256
|
+
- **What it does**: BM25 search across the agent's memory files. Ranks by description+tags+path+body with field weighting.
|
|
257
|
+
- **OpenAPI operationId**: `agent_memory_search`
|
|
258
|
+
- **Path params**: `application_id`
|
|
259
|
+
- **Query params**: `limit`, `prefix`, `q`
|
|
260
|
+
- **Response codes**: `200`
|
|
261
|
+
- **Transport options**: None
|
|
262
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
263
|
+
|
|
264
|
+
**Inputs**
|
|
265
|
+
|
|
266
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
267
|
+
- Client transport options: None
|
|
268
|
+
|
|
269
|
+
**Outputs**
|
|
270
|
+
|
|
271
|
+
- Client return type: `{ cue: string; count: number; results: ({ path: string; description: string; tags: (string)[]; score: number; snippet: string | null })[] }`
|
|
272
|
+
- OpenAPI response codes: `200`
|
|
273
|
+
|
|
274
|
+
```ts
|
|
275
|
+
import posthog from "@utdk/posthog";
|
|
276
|
+
|
|
277
|
+
type AgentMemorySearchInput = Parameters<typeof posthog.agentMemorySearch> extends [infer T, ...unknown[]] ? T : undefined;
|
|
278
|
+
type AgentMemorySearchOutput = Awaited<ReturnType<typeof posthog.agentMemorySearch>>;
|
|
279
|
+
|
|
280
|
+
const result: AgentMemorySearchOutput = await posthog.agentMemorySearch();
|
|
281
|
+
|
|
282
|
+
// Result shape (from schema): { cue: string; count: number; results: ({ path: string; description: string; tags: (string)[]; score: number; snippet: string | null })[] }
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### `posthog.agentMemoryListTables`
|
|
286
|
+
|
|
287
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{application_id}/memory/tables/`
|
|
288
|
+
- **What it does**: List the agent's tabular-reference tables (the @posthog/table-* JSONL tables): name + byte size.
|
|
289
|
+
- **OpenAPI operationId**: `agent_memory_list_tables`
|
|
290
|
+
- **Path params**: `application_id`
|
|
291
|
+
- **Query params**: None
|
|
292
|
+
- **Response codes**: `200`
|
|
293
|
+
- **Transport options**: None
|
|
294
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
295
|
+
|
|
296
|
+
**Inputs**
|
|
297
|
+
|
|
298
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
299
|
+
- Client transport options: None
|
|
300
|
+
|
|
301
|
+
**Outputs**
|
|
302
|
+
|
|
303
|
+
- Client return type: `{ count: number; tables: ({ name: string; size: number })[] }`
|
|
304
|
+
- OpenAPI response codes: `200`
|
|
305
|
+
|
|
306
|
+
```ts
|
|
307
|
+
import posthog from "@utdk/posthog";
|
|
308
|
+
|
|
309
|
+
type AgentMemoryListTablesInput = Parameters<typeof posthog.agentMemoryListTables> extends [infer T, ...unknown[]] ? T : undefined;
|
|
310
|
+
type AgentMemoryListTablesOutput = Awaited<ReturnType<typeof posthog.agentMemoryListTables>>;
|
|
311
|
+
|
|
312
|
+
const result: AgentMemoryListTablesOutput = await posthog.agentMemoryListTables();
|
|
313
|
+
|
|
314
|
+
// Result shape (from schema): { count: number; tables: ({ name: string; size: number })[] }
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### `posthog.agentMemoryReadTable`
|
|
318
|
+
|
|
319
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{application_id}/memory/tables/{name}/`
|
|
320
|
+
- **What it does**: Read rows from one tabular-reference table (capped via ?limit).
|
|
321
|
+
- **OpenAPI operationId**: `agent_memory_read_table`
|
|
322
|
+
- **Path params**: `application_id`, `name`
|
|
323
|
+
- **Query params**: `limit`
|
|
324
|
+
- **Response codes**: `200`
|
|
325
|
+
- **Transport options**: None
|
|
326
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
327
|
+
|
|
328
|
+
**Inputs**
|
|
329
|
+
|
|
330
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
331
|
+
- Client transport options: None
|
|
332
|
+
|
|
333
|
+
**Outputs**
|
|
334
|
+
|
|
335
|
+
- Client return type: `{ name: string; total: number; returned: number; limit: number; rows: ({ [key: string]: unknown })[] }`
|
|
336
|
+
- OpenAPI response codes: `200`
|
|
337
|
+
|
|
338
|
+
```ts
|
|
339
|
+
import posthog from "@utdk/posthog";
|
|
340
|
+
|
|
341
|
+
type AgentMemoryReadTableInput = Parameters<typeof posthog.agentMemoryReadTable> extends [infer T, ...unknown[]] ? T : undefined;
|
|
342
|
+
type AgentMemoryReadTableOutput = Awaited<ReturnType<typeof posthog.agentMemoryReadTable>>;
|
|
343
|
+
|
|
344
|
+
const result: AgentMemoryReadTableOutput = await posthog.agentMemoryReadTable();
|
|
345
|
+
|
|
346
|
+
// Result shape (from schema): { name: string; total: number; returned: number; limit: number; rows: ({ [key: string]: unknown })[] }
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### `posthog.agentMemoryTree`
|
|
350
|
+
|
|
351
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{application_id}/memory/tree/`
|
|
352
|
+
- **What it does**: Pre-aggregated folder tree of memory files. Saves the frontend re-derivation work.
|
|
353
|
+
- **OpenAPI operationId**: `agent_memory_tree`
|
|
354
|
+
- **Path params**: `application_id`
|
|
355
|
+
- **Query params**: None
|
|
356
|
+
- **Response codes**: `200`
|
|
357
|
+
- **Transport options**: None
|
|
358
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
359
|
+
|
|
360
|
+
**Inputs**
|
|
361
|
+
|
|
362
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
363
|
+
- Client transport options: None
|
|
364
|
+
|
|
365
|
+
**Outputs**
|
|
366
|
+
|
|
367
|
+
- Client return type: `{ root: { [key: string]: unknown } }`
|
|
368
|
+
- OpenAPI response codes: `200`
|
|
369
|
+
|
|
370
|
+
```ts
|
|
371
|
+
import posthog from "@utdk/posthog";
|
|
372
|
+
|
|
373
|
+
type AgentMemoryTreeInput = Parameters<typeof posthog.agentMemoryTree> extends [infer T, ...unknown[]] ? T : undefined;
|
|
374
|
+
type AgentMemoryTreeOutput = Awaited<ReturnType<typeof posthog.agentMemoryTree>>;
|
|
375
|
+
|
|
376
|
+
const result: AgentMemoryTreeOutput = await posthog.agentMemoryTree();
|
|
377
|
+
|
|
378
|
+
// Result shape (from schema): { root: { [key: string]: unknown } }
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
### `posthog.agentApplicationsRevisionsList`
|
|
382
|
+
|
|
383
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{application_id}/revisions/`
|
|
384
|
+
- **What it does**: Revisions of an agent. Created in `draft`, promoted through
|
|
385
|
+
`ready → live` once the bundle has been uploaded + frozen.
|
|
386
|
+
|
|
387
|
+
URLs (nested under an application):
|
|
388
|
+
|
|
389
|
+
Model CRUD:
|
|
390
|
+
GET .../revisions/ list
|
|
391
|
+
POST .../revisions/ create draft
|
|
392
|
+
GET .../revisions/<id>/ retrieve
|
|
393
|
+
PATCH .../revisions/<id>/ update spec (draft only)
|
|
394
|
+
|
|
395
|
+
Lifecycle:
|
|
396
|
+
POST .../revisions/<id>/promote/ ready → live
|
|
397
|
+
POST .../revisions/<id>/archive/ → archived
|
|
398
|
+
POST .../revisions/<id>/freeze/ draft → ready (stamps sha256)
|
|
399
|
+
POST .../revisions/<id>/clone_from/ copy bundle from another rev
|
|
400
|
+
POST .../revisions/new_draft/ create draft + clone_from atomically
|
|
401
|
+
|
|
402
|
+
Bundle authoring (proxied to the janitor):
|
|
403
|
+
GET .../revisions/<id>/manifest/ list paths + sha256
|
|
404
|
+
GET .../revisions/<id>/file/?path=… read one file
|
|
405
|
+
PUT .../revisions/<id>/file/?path=… write one file (draft)
|
|
406
|
+
DELETE .../revisions/<id>/file/?path=… delete one file (draft)
|
|
407
|
+
GET .../revisions/<id>/bundle/ bulk pull all files
|
|
408
|
+
PUT .../revisions/<id>/bundle/ bulk push (replace|merge)
|
|
409
|
+
- **OpenAPI operationId**: `agent_applications_revisions_list`
|
|
410
|
+
- **Path params**: `application_id`
|
|
411
|
+
- **Query params**: `limit`, `offset`
|
|
412
|
+
- **Response codes**: `200`
|
|
413
|
+
- **Transport options**: None
|
|
414
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
415
|
+
|
|
416
|
+
**Inputs**
|
|
417
|
+
|
|
418
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
419
|
+
- Client transport options: None
|
|
420
|
+
|
|
421
|
+
**Outputs**
|
|
422
|
+
|
|
423
|
+
- Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_...`
|
|
424
|
+
- OpenAPI response codes: `200`
|
|
425
|
+
|
|
426
|
+
```ts
|
|
427
|
+
import posthog from "@utdk/posthog";
|
|
428
|
+
|
|
429
|
+
type AgentApplicationsRevisionsListInput = Parameters<typeof posthog.agentApplicationsRevisionsList> extends [infer T, ...unknown[]] ? T : undefined;
|
|
430
|
+
type AgentApplicationsRevisionsListOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsList>>;
|
|
431
|
+
|
|
432
|
+
const result: AgentApplicationsRevisionsListOutput = await posthog.agentApplicationsRevisionsList();
|
|
433
|
+
|
|
434
|
+
// Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_...
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
### `posthog.agentApplicationsRevisionsCreate`
|
|
438
|
+
|
|
439
|
+
- **HTTP**: `POST /api/projects/{project_id}/agent_applications/{application_id}/revisions/`
|
|
440
|
+
- **What it does**: Revisions of an agent. Created in `draft`, promoted through
|
|
441
|
+
`ready → live` once the bundle has been uploaded + frozen.
|
|
442
|
+
|
|
443
|
+
URLs (nested under an application):
|
|
444
|
+
|
|
445
|
+
Model CRUD:
|
|
446
|
+
GET .../revisions/ list
|
|
447
|
+
POST .../revisions/ create draft
|
|
448
|
+
GET .../revisions/<id>/ retrieve
|
|
449
|
+
PATCH .../revisions/<id>/ update spec (draft only)
|
|
450
|
+
|
|
451
|
+
Lifecycle:
|
|
452
|
+
POST .../revisions/<id>/promote/ ready → live
|
|
453
|
+
POST .../revisions/<id>/archive/ → archived
|
|
454
|
+
POST .../revisions/<id>/freeze/ draft → ready (stamps sha256)
|
|
455
|
+
POST .../revisions/<id>/clone_from/ copy bundle from another rev
|
|
456
|
+
POST .../revisions/new_draft/ create draft + clone_from atomically
|
|
457
|
+
|
|
458
|
+
Bundle authoring (proxied to the janitor):
|
|
459
|
+
GET .../revisions/<id>/manifest/ list paths + sha256
|
|
460
|
+
GET .../revisions/<id>/file/?path=… read one file
|
|
461
|
+
PUT .../revisions/<id>/file/?path=… write one file (draft)
|
|
462
|
+
DELETE .../revisions/<id>/file/?path=… delete one file (draft)
|
|
463
|
+
GET .../revisions/<id>/bundle/ bulk pull all files
|
|
464
|
+
PUT .../revisions/<id>/bundle/ bulk push (replace|merge)
|
|
465
|
+
- **OpenAPI operationId**: `agent_applications_revisions_create`
|
|
466
|
+
- **Path params**: `application_id`
|
|
467
|
+
- **Query params**: None
|
|
468
|
+
- **Response codes**: `201`
|
|
469
|
+
- **Transport options**: None
|
|
470
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
471
|
+
|
|
472
|
+
**Inputs**
|
|
473
|
+
|
|
474
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
475
|
+
- Client transport options: None
|
|
476
|
+
|
|
477
|
+
**Outputs**
|
|
478
|
+
|
|
479
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
480
|
+
- OpenAPI response codes: `201`
|
|
481
|
+
|
|
482
|
+
```ts
|
|
483
|
+
import posthog from "@utdk/posthog";
|
|
484
|
+
|
|
485
|
+
type AgentApplicationsRevisionsCreateInput = Parameters<typeof posthog.agentApplicationsRevisionsCreate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
486
|
+
type AgentApplicationsRevisionsCreateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsCreate>>;
|
|
487
|
+
|
|
488
|
+
const result: AgentApplicationsRevisionsCreateOutput = await posthog.agentApplicationsRevisionsCreate();
|
|
489
|
+
|
|
490
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
### `posthog.agentApplicationsRevisionsDestroy`
|
|
494
|
+
|
|
495
|
+
- **HTTP**: `DELETE /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/`
|
|
496
|
+
- **What it does**: Revisions of an agent. Created in `draft`, promoted through
|
|
497
|
+
`ready → live` once the bundle has been uploaded + frozen.
|
|
498
|
+
|
|
499
|
+
URLs (nested under an application):
|
|
500
|
+
|
|
501
|
+
Model CRUD:
|
|
502
|
+
GET .../revisions/ list
|
|
503
|
+
POST .../revisions/ create draft
|
|
504
|
+
GET .../revisions/<id>/ retrieve
|
|
505
|
+
PATCH .../revisions/<id>/ update spec (draft only)
|
|
506
|
+
|
|
507
|
+
Lifecycle:
|
|
508
|
+
POST .../revisions/<id>/promote/ ready → live
|
|
509
|
+
POST .../revisions/<id>/archive/ → archived
|
|
510
|
+
POST .../revisions/<id>/freeze/ draft → ready (stamps sha256)
|
|
511
|
+
POST .../revisions/<id>/clone_from/ copy bundle from another rev
|
|
512
|
+
POST .../revisions/new_draft/ create draft + clone_from atomically
|
|
513
|
+
|
|
514
|
+
Bundle authoring (proxied to the janitor):
|
|
515
|
+
GET .../revisions/<id>/manifest/ list paths + sha256
|
|
516
|
+
GET .../revisions/<id>/file/?path=… read one file
|
|
517
|
+
PUT .../revisions/<id>/file/?path=… write one file (draft)
|
|
518
|
+
DELETE .../revisions/<id>/file/?path=… delete one file (draft)
|
|
519
|
+
GET .../revisions/<id>/bundle/ bulk pull all files
|
|
520
|
+
PUT .../revisions/<id>/bundle/ bulk push (replace|merge)
|
|
521
|
+
- **OpenAPI operationId**: `agent_applications_revisions_destroy`
|
|
522
|
+
- **Path params**: `application_id`, `id`
|
|
523
|
+
- **Query params**: None
|
|
524
|
+
- **Response codes**: `204`
|
|
525
|
+
- **Transport options**: None
|
|
526
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
527
|
+
|
|
528
|
+
**Inputs**
|
|
529
|
+
|
|
530
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
531
|
+
- Client transport options: None
|
|
532
|
+
|
|
533
|
+
**Outputs**
|
|
534
|
+
|
|
535
|
+
- Client return type: `unknown`
|
|
536
|
+
- OpenAPI response codes: `204`
|
|
537
|
+
|
|
538
|
+
```ts
|
|
539
|
+
import posthog from "@utdk/posthog";
|
|
540
|
+
|
|
541
|
+
type AgentApplicationsRevisionsDestroyInput = Parameters<typeof posthog.agentApplicationsRevisionsDestroy> extends [infer T, ...unknown[]] ? T : undefined;
|
|
542
|
+
type AgentApplicationsRevisionsDestroyOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsDestroy>>;
|
|
543
|
+
|
|
544
|
+
const result: AgentApplicationsRevisionsDestroyOutput = await posthog.agentApplicationsRevisionsDestroy();
|
|
545
|
+
|
|
546
|
+
// Result shape (from schema): unknown
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
### `posthog.agentApplicationsRevisionsRetrieve`
|
|
550
|
+
|
|
551
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/`
|
|
552
|
+
- **What it does**: Revisions of an agent. Created in `draft`, promoted through
|
|
553
|
+
`ready → live` once the bundle has been uploaded + frozen.
|
|
554
|
+
|
|
555
|
+
URLs (nested under an application):
|
|
556
|
+
|
|
557
|
+
Model CRUD:
|
|
558
|
+
GET .../revisions/ list
|
|
559
|
+
POST .../revisions/ create draft
|
|
560
|
+
GET .../revisions/<id>/ retrieve
|
|
561
|
+
PATCH .../revisions/<id>/ update spec (draft only)
|
|
562
|
+
|
|
563
|
+
Lifecycle:
|
|
564
|
+
POST .../revisions/<id>/promote/ ready → live
|
|
565
|
+
POST .../revisions/<id>/archive/ → archived
|
|
566
|
+
POST .../revisions/<id>/freeze/ draft → ready (stamps sha256)
|
|
567
|
+
POST .../revisions/<id>/clone_from/ copy bundle from another rev
|
|
568
|
+
POST .../revisions/new_draft/ create draft + clone_from atomically
|
|
569
|
+
|
|
570
|
+
Bundle authoring (proxied to the janitor):
|
|
571
|
+
GET .../revisions/<id>/manifest/ list paths + sha256
|
|
572
|
+
GET .../revisions/<id>/file/?path=… read one file
|
|
573
|
+
PUT .../revisions/<id>/file/?path=… write one file (draft)
|
|
574
|
+
DELETE .../revisions/<id>/file/?path=… delete one file (draft)
|
|
575
|
+
GET .../revisions/<id>/bundle/ bulk pull all files
|
|
576
|
+
PUT .../revisions/<id>/bundle/ bulk push (replace|merge)
|
|
577
|
+
- **OpenAPI operationId**: `agent_applications_revisions_retrieve`
|
|
578
|
+
- **Path params**: `application_id`, `id`
|
|
579
|
+
- **Query params**: None
|
|
580
|
+
- **Response codes**: `200`
|
|
581
|
+
- **Transport options**: None
|
|
582
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
583
|
+
|
|
584
|
+
**Inputs**
|
|
585
|
+
|
|
586
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
587
|
+
- Client transport options: None
|
|
588
|
+
|
|
589
|
+
**Outputs**
|
|
590
|
+
|
|
591
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
592
|
+
- OpenAPI response codes: `200`
|
|
593
|
+
|
|
594
|
+
```ts
|
|
595
|
+
import posthog from "@utdk/posthog";
|
|
596
|
+
|
|
597
|
+
type AgentApplicationsRevisionsRetrieveInput = Parameters<typeof posthog.agentApplicationsRevisionsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
|
|
598
|
+
type AgentApplicationsRevisionsRetrieveOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsRetrieve>>;
|
|
599
|
+
|
|
600
|
+
const result: AgentApplicationsRevisionsRetrieveOutput = await posthog.agentApplicationsRevisionsRetrieve();
|
|
601
|
+
|
|
602
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
### `posthog.agentApplicationsRevisionsPartialUpdate`
|
|
606
|
+
|
|
607
|
+
- **HTTP**: `PATCH /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/`
|
|
608
|
+
- **What it does**: Revisions of an agent. Created in `draft`, promoted through
|
|
609
|
+
`ready → live` once the bundle has been uploaded + frozen.
|
|
610
|
+
|
|
611
|
+
URLs (nested under an application):
|
|
612
|
+
|
|
613
|
+
Model CRUD:
|
|
614
|
+
GET .../revisions/ list
|
|
615
|
+
POST .../revisions/ create draft
|
|
616
|
+
GET .../revisions/<id>/ retrieve
|
|
617
|
+
PATCH .../revisions/<id>/ update spec (draft only)
|
|
618
|
+
|
|
619
|
+
Lifecycle:
|
|
620
|
+
POST .../revisions/<id>/promote/ ready → live
|
|
621
|
+
POST .../revisions/<id>/archive/ → archived
|
|
622
|
+
POST .../revisions/<id>/freeze/ draft → ready (stamps sha256)
|
|
623
|
+
POST .../revisions/<id>/clone_from/ copy bundle from another rev
|
|
624
|
+
POST .../revisions/new_draft/ create draft + clone_from atomically
|
|
625
|
+
|
|
626
|
+
Bundle authoring (proxied to the janitor):
|
|
627
|
+
GET .../revisions/<id>/manifest/ list paths + sha256
|
|
628
|
+
GET .../revisions/<id>/file/?path=… read one file
|
|
629
|
+
PUT .../revisions/<id>/file/?path=… write one file (draft)
|
|
630
|
+
DELETE .../revisions/<id>/file/?path=… delete one file (draft)
|
|
631
|
+
GET .../revisions/<id>/bundle/ bulk pull all files
|
|
632
|
+
PUT .../revisions/<id>/bundle/ bulk push (replace|merge)
|
|
633
|
+
- **OpenAPI operationId**: `agent_applications_revisions_partial_update`
|
|
634
|
+
- **Path params**: `application_id`, `id`
|
|
635
|
+
- **Query params**: None
|
|
636
|
+
- **Response codes**: `200`
|
|
637
|
+
- **Transport options**: None
|
|
638
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
639
|
+
|
|
640
|
+
**Inputs**
|
|
641
|
+
|
|
642
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
643
|
+
- Client transport options: None
|
|
644
|
+
|
|
645
|
+
**Outputs**
|
|
646
|
+
|
|
647
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
648
|
+
- OpenAPI response codes: `200`
|
|
649
|
+
|
|
650
|
+
```ts
|
|
651
|
+
import posthog from "@utdk/posthog";
|
|
652
|
+
|
|
653
|
+
type AgentApplicationsRevisionsPartialUpdateInput = Parameters<typeof posthog.agentApplicationsRevisionsPartialUpdate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
654
|
+
type AgentApplicationsRevisionsPartialUpdateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsPartialUpdate>>;
|
|
655
|
+
|
|
656
|
+
const result: AgentApplicationsRevisionsPartialUpdateOutput = await posthog.agentApplicationsRevisionsPartialUpdate();
|
|
657
|
+
|
|
658
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
### `posthog.agentApplicationsRevisionsUpdate`
|
|
662
|
+
|
|
663
|
+
- **HTTP**: `PUT /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/`
|
|
664
|
+
- **What it does**: Spec edits are only allowed while state='draft'. Once promoted to
|
|
665
|
+
ready/live the spec is frozen — change requires a new revision.
|
|
666
|
+
- **OpenAPI operationId**: `agent_applications_revisions_update`
|
|
667
|
+
- **Path params**: `application_id`, `id`
|
|
668
|
+
- **Query params**: None
|
|
669
|
+
- **Response codes**: `200`
|
|
670
|
+
- **Transport options**: None
|
|
671
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
672
|
+
|
|
673
|
+
**Inputs**
|
|
674
|
+
|
|
675
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
676
|
+
- Client transport options: None
|
|
677
|
+
|
|
678
|
+
**Outputs**
|
|
679
|
+
|
|
680
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
681
|
+
- OpenAPI response codes: `200`
|
|
682
|
+
|
|
683
|
+
```ts
|
|
684
|
+
import posthog from "@utdk/posthog";
|
|
685
|
+
|
|
686
|
+
type AgentApplicationsRevisionsUpdateInput = Parameters<typeof posthog.agentApplicationsRevisionsUpdate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
687
|
+
type AgentApplicationsRevisionsUpdateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsUpdate>>;
|
|
688
|
+
|
|
689
|
+
const result: AgentApplicationsRevisionsUpdateOutput = await posthog.agentApplicationsRevisionsUpdate();
|
|
690
|
+
|
|
691
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
692
|
+
```
|
|
693
|
+
|
|
694
|
+
### `posthog.agentApplicationsRevisionsAgentMdUpdate`
|
|
695
|
+
|
|
696
|
+
- **HTTP**: `PUT /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/agent_md/`
|
|
697
|
+
- **What it does**: Revisions of an agent. Created in `draft`, promoted through
|
|
698
|
+
`ready → live` once the bundle has been uploaded + frozen.
|
|
699
|
+
|
|
700
|
+
URLs (nested under an application):
|
|
701
|
+
|
|
702
|
+
Model CRUD:
|
|
703
|
+
GET .../revisions/ list
|
|
704
|
+
POST .../revisions/ create draft
|
|
705
|
+
GET .../revisions/<id>/ retrieve
|
|
706
|
+
PATCH .../revisions/<id>/ update spec (draft only)
|
|
707
|
+
|
|
708
|
+
Lifecycle:
|
|
709
|
+
POST .../revisions/<id>/promote/ ready → live
|
|
710
|
+
POST .../revisions/<id>/archive/ → archived
|
|
711
|
+
POST .../revisions/<id>/freeze/ draft → ready (stamps sha256)
|
|
712
|
+
POST .../revisions/<id>/clone_from/ copy bundle from another rev
|
|
713
|
+
POST .../revisions/new_draft/ create draft + clone_from atomically
|
|
714
|
+
|
|
715
|
+
Bundle authoring (proxied to the janitor):
|
|
716
|
+
GET .../revisions/<id>/manifest/ list paths + sha256
|
|
717
|
+
GET .../revisions/<id>/file/?path=… read one file
|
|
718
|
+
PUT .../revisions/<id>/file/?path=… write one file (draft)
|
|
719
|
+
DELETE .../revisions/<id>/file/?path=… delete one file (draft)
|
|
720
|
+
GET .../revisions/<id>/bundle/ bulk pull all files
|
|
721
|
+
PUT .../revisions/<id>/bundle/ bulk push (replace|merge)
|
|
722
|
+
- **OpenAPI operationId**: `agent_applications_revisions_agent_md_update`
|
|
723
|
+
- **Path params**: `application_id`, `id`
|
|
724
|
+
- **Query params**: None
|
|
725
|
+
- **Response codes**: `200`
|
|
726
|
+
- **Transport options**: None
|
|
727
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
728
|
+
|
|
729
|
+
**Inputs**
|
|
730
|
+
|
|
731
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
732
|
+
- Client transport options: None
|
|
733
|
+
|
|
734
|
+
**Outputs**
|
|
735
|
+
|
|
736
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
737
|
+
- OpenAPI response codes: `200`
|
|
738
|
+
|
|
739
|
+
```ts
|
|
740
|
+
import posthog from "@utdk/posthog";
|
|
741
|
+
|
|
742
|
+
type AgentApplicationsRevisionsAgentMdUpdateInput = Parameters<typeof posthog.agentApplicationsRevisionsAgentMdUpdate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
743
|
+
type AgentApplicationsRevisionsAgentMdUpdateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsAgentMdUpdate>>;
|
|
744
|
+
|
|
745
|
+
const result: AgentApplicationsRevisionsAgentMdUpdateOutput = await posthog.agentApplicationsRevisionsAgentMdUpdate();
|
|
746
|
+
|
|
747
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
748
|
+
```
|
|
749
|
+
|
|
750
|
+
### `posthog.agentApplicationsRevisionsArchiveCreate`
|
|
751
|
+
|
|
752
|
+
- **HTTP**: `POST /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/archive/`
|
|
753
|
+
- **What it does**: Mark a revision archived. If it was the live one, clear the
|
|
754
|
+
application's live_revision pointer (the app effectively has no
|
|
755
|
+
deployable version until another revision is promoted).
|
|
756
|
+
- **OpenAPI operationId**: `agent_applications_revisions_archive_create`
|
|
757
|
+
- **Path params**: `application_id`, `id`
|
|
758
|
+
- **Query params**: None
|
|
759
|
+
- **Response codes**: `200`
|
|
760
|
+
- **Transport options**: None
|
|
761
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
762
|
+
|
|
763
|
+
**Inputs**
|
|
764
|
+
|
|
765
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
766
|
+
- Client transport options: None
|
|
767
|
+
|
|
768
|
+
**Outputs**
|
|
769
|
+
|
|
770
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
771
|
+
- OpenAPI response codes: `200`
|
|
772
|
+
|
|
773
|
+
```ts
|
|
774
|
+
import posthog from "@utdk/posthog";
|
|
775
|
+
|
|
776
|
+
type AgentApplicationsRevisionsArchiveCreateInput = Parameters<typeof posthog.agentApplicationsRevisionsArchiveCreate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
777
|
+
type AgentApplicationsRevisionsArchiveCreateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsArchiveCreate>>;
|
|
778
|
+
|
|
779
|
+
const result: AgentApplicationsRevisionsArchiveCreateOutput = await posthog.agentApplicationsRevisionsArchiveCreate();
|
|
780
|
+
|
|
781
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
782
|
+
```
|
|
783
|
+
|
|
784
|
+
### `posthog.agentApplicationsRevisionsBundleRetrieve`
|
|
785
|
+
|
|
786
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/bundle/`
|
|
787
|
+
- **What it does**: Read the full typed bundle: `{ agent_md, skills, tools, spec }`.
|
|
788
|
+
- **OpenAPI operationId**: `agent_applications_revisions_bundle_retrieve`
|
|
789
|
+
- **Path params**: `application_id`, `id`
|
|
790
|
+
- **Query params**: None
|
|
791
|
+
- **Response codes**: `200`
|
|
792
|
+
- **Transport options**: None
|
|
793
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
794
|
+
|
|
795
|
+
**Inputs**
|
|
796
|
+
|
|
797
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
798
|
+
- Client transport options: None
|
|
799
|
+
|
|
800
|
+
**Outputs**
|
|
801
|
+
|
|
802
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
803
|
+
- OpenAPI response codes: `200`
|
|
804
|
+
|
|
805
|
+
```ts
|
|
806
|
+
import posthog from "@utdk/posthog";
|
|
807
|
+
|
|
808
|
+
type AgentApplicationsRevisionsBundleRetrieveInput = Parameters<typeof posthog.agentApplicationsRevisionsBundleRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
|
|
809
|
+
type AgentApplicationsRevisionsBundleRetrieveOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsBundleRetrieve>>;
|
|
810
|
+
|
|
811
|
+
const result: AgentApplicationsRevisionsBundleRetrieveOutput = await posthog.agentApplicationsRevisionsBundleRetrieve();
|
|
812
|
+
|
|
813
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
814
|
+
```
|
|
815
|
+
|
|
816
|
+
### `posthog.agentApplicationsRevisionsBundleUpdate`
|
|
817
|
+
|
|
818
|
+
- **HTTP**: `PUT /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/bundle/`
|
|
819
|
+
- **What it does**: Full-replace the typed bundle. Anything not in the payload is
|
|
820
|
+
deleted. Tool sources are AST-checked + esbuild-compiled by the
|
|
821
|
+
janitor before any S3 writes.
|
|
822
|
+
- **OpenAPI operationId**: `agent_applications_revisions_bundle_update`
|
|
823
|
+
- **Path params**: `application_id`, `id`
|
|
824
|
+
- **Query params**: None
|
|
825
|
+
- **Response codes**: `200`
|
|
826
|
+
- **Transport options**: None
|
|
827
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
828
|
+
|
|
829
|
+
**Inputs**
|
|
830
|
+
|
|
831
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
832
|
+
- Client transport options: None
|
|
833
|
+
|
|
834
|
+
**Outputs**
|
|
835
|
+
|
|
836
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
837
|
+
- OpenAPI response codes: `200`
|
|
838
|
+
|
|
839
|
+
```ts
|
|
840
|
+
import posthog from "@utdk/posthog";
|
|
841
|
+
|
|
842
|
+
type AgentApplicationsRevisionsBundleUpdateInput = Parameters<typeof posthog.agentApplicationsRevisionsBundleUpdate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
843
|
+
type AgentApplicationsRevisionsBundleUpdateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsBundleUpdate>>;
|
|
844
|
+
|
|
845
|
+
const result: AgentApplicationsRevisionsBundleUpdateOutput = await posthog.agentApplicationsRevisionsBundleUpdate();
|
|
846
|
+
|
|
847
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
848
|
+
```
|
|
849
|
+
|
|
850
|
+
### `posthog.agentApplicationsRevisionsBundleFileUpdate`
|
|
851
|
+
|
|
852
|
+
- **HTTP**: `PUT /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/bundle/file/`
|
|
853
|
+
- **What it does**: Update one `.md` file on a draft revision.
|
|
854
|
+
|
|
855
|
+
`agent.md` writes go to the draft bundle. `skills/<id>/SKILL.md`
|
|
856
|
+
writes are store-backed — skills are materialized from the skill
|
|
857
|
+
store at freeze, so the edit publishes a new version of the
|
|
858
|
+
referenced store skill and re-pins the draft's `skill_refs` entry
|
|
859
|
+
to it. `<id>` must be a ref alias on this revision; add new skills
|
|
860
|
+
via `bundle/import/` or `skill_refs`. Tool source / schema editing
|
|
861
|
+
is out of scope here — use the per-tool endpoints. Returns the
|
|
862
|
+
updated revision so the caller can refresh in one round-trip.
|
|
863
|
+
- **OpenAPI operationId**: `agent_applications_revisions_bundle_file_update`
|
|
864
|
+
- **Path params**: `application_id`, `id`
|
|
865
|
+
- **Query params**: None
|
|
866
|
+
- **Response codes**: `200`, `409`
|
|
867
|
+
- **Transport options**: None
|
|
868
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
869
|
+
|
|
870
|
+
**Inputs**
|
|
871
|
+
|
|
872
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
873
|
+
- Client transport options: None
|
|
874
|
+
|
|
875
|
+
**Outputs**
|
|
876
|
+
|
|
877
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
878
|
+
- OpenAPI response codes: `200`, `409`
|
|
879
|
+
|
|
880
|
+
```ts
|
|
881
|
+
import posthog from "@utdk/posthog";
|
|
882
|
+
|
|
883
|
+
type AgentApplicationsRevisionsBundleFileUpdateInput = Parameters<typeof posthog.agentApplicationsRevisionsBundleFileUpdate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
884
|
+
type AgentApplicationsRevisionsBundleFileUpdateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsBundleFileUpdate>>;
|
|
885
|
+
|
|
886
|
+
const result: AgentApplicationsRevisionsBundleFileUpdateOutput = await posthog.agentApplicationsRevisionsBundleFileUpdate();
|
|
887
|
+
|
|
888
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
889
|
+
```
|
|
890
|
+
|
|
891
|
+
### `posthog.agentApplicationsRevisionsBundleImportCreate`
|
|
892
|
+
|
|
893
|
+
- **HTTP**: `POST /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/bundle/import/`
|
|
894
|
+
- **What it does**: Bulk-merge a set of `.md` files into a draft revision.
|
|
895
|
+
|
|
896
|
+
Sets `agent_md` on the draft bundle if present. `skills[]` are
|
|
897
|
+
store-backed and merge by `id`: an id already referenced by the
|
|
898
|
+
draft publishes a new version of its store skill; an unreferenced
|
|
899
|
+
id attaches the store skill of that name (publishing the payload's
|
|
900
|
+
body to it), or creates it when no such skill exists — and each
|
|
901
|
+
ref is (re-)pinned to the published version. Skills not mentioned
|
|
902
|
+
are left alone, so the import is safe to retry. Draft-only;
|
|
903
|
+
non-draft revisions return 409 untouched.
|
|
904
|
+
- **OpenAPI operationId**: `agent_applications_revisions_bundle_import_create`
|
|
905
|
+
- **Path params**: `application_id`, `id`
|
|
906
|
+
- **Query params**: None
|
|
907
|
+
- **Response codes**: `200`, `409`
|
|
908
|
+
- **Transport options**: None
|
|
909
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
910
|
+
|
|
911
|
+
**Inputs**
|
|
912
|
+
|
|
913
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
914
|
+
- Client transport options: None
|
|
915
|
+
|
|
916
|
+
**Outputs**
|
|
917
|
+
|
|
918
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
919
|
+
- OpenAPI response codes: `200`, `409`
|
|
920
|
+
|
|
921
|
+
```ts
|
|
922
|
+
import posthog from "@utdk/posthog";
|
|
923
|
+
|
|
924
|
+
type AgentApplicationsRevisionsBundleImportCreateInput = Parameters<typeof posthog.agentApplicationsRevisionsBundleImportCreate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
925
|
+
type AgentApplicationsRevisionsBundleImportCreateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsBundleImportCreate>>;
|
|
926
|
+
|
|
927
|
+
const result: AgentApplicationsRevisionsBundleImportCreateOutput = await posthog.agentApplicationsRevisionsBundleImportCreate();
|
|
928
|
+
|
|
929
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
930
|
+
```
|
|
931
|
+
|
|
932
|
+
### `posthog.agentApplicationsRevisionsCloneFromCreate`
|
|
933
|
+
|
|
934
|
+
- **HTTP**: `POST /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/clone_from/`
|
|
935
|
+
- **What it does**: Copy every file from `source_revision_id` into this revision.
|
|
936
|
+
- **OpenAPI operationId**: `agent_applications_revisions_clone_from_create`
|
|
937
|
+
- **Path params**: `application_id`, `id`
|
|
938
|
+
- **Query params**: None
|
|
939
|
+
- **Response codes**: `200`
|
|
940
|
+
- **Transport options**: None
|
|
941
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
942
|
+
|
|
943
|
+
**Inputs**
|
|
944
|
+
|
|
945
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
946
|
+
- Client transport options: None
|
|
947
|
+
|
|
948
|
+
**Outputs**
|
|
949
|
+
|
|
950
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
951
|
+
- OpenAPI response codes: `200`
|
|
952
|
+
|
|
953
|
+
```ts
|
|
954
|
+
import posthog from "@utdk/posthog";
|
|
955
|
+
|
|
956
|
+
type AgentApplicationsRevisionsCloneFromCreateInput = Parameters<typeof posthog.agentApplicationsRevisionsCloneFromCreate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
957
|
+
type AgentApplicationsRevisionsCloneFromCreateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsCloneFromCreate>>;
|
|
958
|
+
|
|
959
|
+
const result: AgentApplicationsRevisionsCloneFromCreateOutput = await posthog.agentApplicationsRevisionsCloneFromCreate();
|
|
960
|
+
|
|
961
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
962
|
+
```
|
|
963
|
+
|
|
964
|
+
### `posthog.agentApplicationsRevisionsCronFireCreate`
|
|
965
|
+
|
|
966
|
+
- **HTTP**: `POST /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/cron/fire/`
|
|
967
|
+
- **What it does**: Fire one cron job out-of-band — the same execution path the
|
|
968
|
+
scheduler walks, but on demand. Authoring UX: the user iterates on
|
|
969
|
+
a cron prompt by clicking 'Fire now' rather than waiting for the
|
|
970
|
+
next scheduled firing. Without this, 'did my prompt do the right
|
|
971
|
+
thing?' is unanswerable until the cron actually fires.
|
|
972
|
+
|
|
973
|
+
Idempotent via `request_id`: repeat clicks with the same id resolve
|
|
974
|
+
to the same session id rather than firing N times.
|
|
975
|
+
- **OpenAPI operationId**: `agent_applications_revisions_cron_fire_create`
|
|
976
|
+
- **Path params**: `application_id`, `id`
|
|
977
|
+
- **Query params**: None
|
|
978
|
+
- **Response codes**: `200`
|
|
979
|
+
- **Transport options**: None
|
|
980
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
981
|
+
|
|
982
|
+
**Inputs**
|
|
983
|
+
|
|
984
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
985
|
+
- Client transport options: None
|
|
986
|
+
|
|
987
|
+
**Outputs**
|
|
988
|
+
|
|
989
|
+
- Client return type: `{ ok: boolean; session_id: string; fired_at: string; idempotency_key: string; request_id: string }`
|
|
990
|
+
- OpenAPI response codes: `200`
|
|
991
|
+
|
|
992
|
+
```ts
|
|
993
|
+
import posthog from "@utdk/posthog";
|
|
994
|
+
|
|
995
|
+
type AgentApplicationsRevisionsCronFireCreateInput = Parameters<typeof posthog.agentApplicationsRevisionsCronFireCreate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
996
|
+
type AgentApplicationsRevisionsCronFireCreateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsCronFireCreate>>;
|
|
997
|
+
|
|
998
|
+
const result: AgentApplicationsRevisionsCronFireCreateOutput = await posthog.agentApplicationsRevisionsCronFireCreate();
|
|
999
|
+
|
|
1000
|
+
// Result shape (from schema): { ok: boolean; session_id: string; fired_at: string; idempotency_key: string; request_id: string }
|
|
1001
|
+
```
|
|
1002
|
+
|
|
1003
|
+
### `posthog.agentRevisionsEnvKeysList`
|
|
1004
|
+
|
|
1005
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/env_keys/`
|
|
1006
|
+
- **What it does**: List the names of secrets currently set on this revision.
|
|
1007
|
+
|
|
1008
|
+
Returns names only — values stay server-side under
|
|
1009
|
+
`EncryptedTextField`. Use this to drive the "set / unset" badge next to
|
|
1010
|
+
a declared secret in the editor UI.
|
|
1011
|
+
- **OpenAPI operationId**: `agent_revisions_env_keys_list`
|
|
1012
|
+
- **Path params**: `application_id`, `id`
|
|
1013
|
+
- **Query params**: None
|
|
1014
|
+
- **Response codes**: `200`
|
|
1015
|
+
- **Transport options**: None
|
|
1016
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1017
|
+
|
|
1018
|
+
**Inputs**
|
|
1019
|
+
|
|
1020
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1021
|
+
- Client transport options: None
|
|
1022
|
+
|
|
1023
|
+
**Outputs**
|
|
1024
|
+
|
|
1025
|
+
- Client return type: `{ keys: (string)[] }`
|
|
1026
|
+
- OpenAPI response codes: `200`
|
|
1027
|
+
|
|
1028
|
+
```ts
|
|
1029
|
+
import posthog from "@utdk/posthog";
|
|
1030
|
+
|
|
1031
|
+
type AgentRevisionsEnvKeysListInput = Parameters<typeof posthog.agentRevisionsEnvKeysList> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1032
|
+
type AgentRevisionsEnvKeysListOutput = Awaited<ReturnType<typeof posthog.agentRevisionsEnvKeysList>>;
|
|
1033
|
+
|
|
1034
|
+
const result: AgentRevisionsEnvKeysListOutput = await posthog.agentRevisionsEnvKeysList();
|
|
1035
|
+
|
|
1036
|
+
// Result shape (from schema): { keys: (string)[] }
|
|
1037
|
+
```
|
|
1038
|
+
|
|
1039
|
+
### `posthog.agentRevisionsEnvKeysClear`
|
|
1040
|
+
|
|
1041
|
+
- **HTTP**: `DELETE /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/env_keys/{key}/`
|
|
1042
|
+
- **What it does**: GET / PUT / DELETE one secret by name on this revision.
|
|
1043
|
+
|
|
1044
|
+
- `GET` → `{ key, is_set }` (never returns the value).
|
|
1045
|
+
- `PUT` → upserts `{ value }` into the env block.
|
|
1046
|
+
- `DELETE` → removes the key. No-op when it wasn't set.
|
|
1047
|
+
|
|
1048
|
+
Per-method scope: GET is treated as a write action so the single action
|
|
1049
|
+
name maps to one consistent scope; reading whether a secret is set is
|
|
1050
|
+
restricted to writers in any case.
|
|
1051
|
+
- **OpenAPI operationId**: `agent_revisions_env_keys_clear`
|
|
1052
|
+
- **Path params**: `application_id`, `id`, `key`
|
|
1053
|
+
- **Query params**: None
|
|
1054
|
+
- **Response codes**: `204`
|
|
1055
|
+
- **Transport options**: None
|
|
1056
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1057
|
+
|
|
1058
|
+
**Inputs**
|
|
1059
|
+
|
|
1060
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1061
|
+
- Client transport options: None
|
|
1062
|
+
|
|
1063
|
+
**Outputs**
|
|
1064
|
+
|
|
1065
|
+
- Client return type: `unknown`
|
|
1066
|
+
- OpenAPI response codes: `204`
|
|
1067
|
+
|
|
1068
|
+
```ts
|
|
1069
|
+
import posthog from "@utdk/posthog";
|
|
1070
|
+
|
|
1071
|
+
type AgentRevisionsEnvKeysClearInput = Parameters<typeof posthog.agentRevisionsEnvKeysClear> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1072
|
+
type AgentRevisionsEnvKeysClearOutput = Awaited<ReturnType<typeof posthog.agentRevisionsEnvKeysClear>>;
|
|
1073
|
+
|
|
1074
|
+
const result: AgentRevisionsEnvKeysClearOutput = await posthog.agentRevisionsEnvKeysClear();
|
|
1075
|
+
|
|
1076
|
+
// Result shape (from schema): unknown
|
|
1077
|
+
```
|
|
1078
|
+
|
|
1079
|
+
### `posthog.agentRevisionsEnvKeysGet`
|
|
1080
|
+
|
|
1081
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/env_keys/{key}/`
|
|
1082
|
+
- **What it does**: GET / PUT / DELETE one secret by name on this revision.
|
|
1083
|
+
|
|
1084
|
+
- `GET` → `{ key, is_set }` (never returns the value).
|
|
1085
|
+
- `PUT` → upserts `{ value }` into the env block.
|
|
1086
|
+
- `DELETE` → removes the key. No-op when it wasn't set.
|
|
1087
|
+
|
|
1088
|
+
Per-method scope: GET is treated as a write action so the single action
|
|
1089
|
+
name maps to one consistent scope; reading whether a secret is set is
|
|
1090
|
+
restricted to writers in any case.
|
|
1091
|
+
- **OpenAPI operationId**: `agent_revisions_env_keys_get`
|
|
1092
|
+
- **Path params**: `application_id`, `id`, `key`
|
|
1093
|
+
- **Query params**: None
|
|
1094
|
+
- **Response codes**: `200`
|
|
1095
|
+
- **Transport options**: None
|
|
1096
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1097
|
+
|
|
1098
|
+
**Inputs**
|
|
1099
|
+
|
|
1100
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1101
|
+
- Client transport options: None
|
|
1102
|
+
|
|
1103
|
+
**Outputs**
|
|
1104
|
+
|
|
1105
|
+
- Client return type: `{ key: string; is_set: boolean }`
|
|
1106
|
+
- OpenAPI response codes: `200`
|
|
1107
|
+
|
|
1108
|
+
```ts
|
|
1109
|
+
import posthog from "@utdk/posthog";
|
|
1110
|
+
|
|
1111
|
+
type AgentRevisionsEnvKeysGetInput = Parameters<typeof posthog.agentRevisionsEnvKeysGet> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1112
|
+
type AgentRevisionsEnvKeysGetOutput = Awaited<ReturnType<typeof posthog.agentRevisionsEnvKeysGet>>;
|
|
1113
|
+
|
|
1114
|
+
const result: AgentRevisionsEnvKeysGetOutput = await posthog.agentRevisionsEnvKeysGet();
|
|
1115
|
+
|
|
1116
|
+
// Result shape (from schema): { key: string; is_set: boolean }
|
|
1117
|
+
```
|
|
1118
|
+
|
|
1119
|
+
### `posthog.agentRevisionsEnvKeysSet`
|
|
1120
|
+
|
|
1121
|
+
- **HTTP**: `PUT /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/env_keys/{key}/`
|
|
1122
|
+
- **What it does**: GET / PUT / DELETE one secret by name on this revision.
|
|
1123
|
+
|
|
1124
|
+
- `GET` → `{ key, is_set }` (never returns the value).
|
|
1125
|
+
- `PUT` → upserts `{ value }` into the env block.
|
|
1126
|
+
- `DELETE` → removes the key. No-op when it wasn't set.
|
|
1127
|
+
|
|
1128
|
+
Per-method scope: GET is treated as a write action so the single action
|
|
1129
|
+
name maps to one consistent scope; reading whether a secret is set is
|
|
1130
|
+
restricted to writers in any case.
|
|
1131
|
+
- **OpenAPI operationId**: `agent_revisions_env_keys_set`
|
|
1132
|
+
- **Path params**: `application_id`, `id`, `key`
|
|
1133
|
+
- **Query params**: None
|
|
1134
|
+
- **Response codes**: `200`
|
|
1135
|
+
- **Transport options**: None
|
|
1136
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1137
|
+
|
|
1138
|
+
**Inputs**
|
|
1139
|
+
|
|
1140
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1141
|
+
- Client transport options: None
|
|
1142
|
+
|
|
1143
|
+
**Outputs**
|
|
1144
|
+
|
|
1145
|
+
- Client return type: `{ key: string; is_set: boolean }`
|
|
1146
|
+
- OpenAPI response codes: `200`
|
|
1147
|
+
|
|
1148
|
+
```ts
|
|
1149
|
+
import posthog from "@utdk/posthog";
|
|
1150
|
+
|
|
1151
|
+
type AgentRevisionsEnvKeysSetInput = Parameters<typeof posthog.agentRevisionsEnvKeysSet> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1152
|
+
type AgentRevisionsEnvKeysSetOutput = Awaited<ReturnType<typeof posthog.agentRevisionsEnvKeysSet>>;
|
|
1153
|
+
|
|
1154
|
+
const result: AgentRevisionsEnvKeysSetOutput = await posthog.agentRevisionsEnvKeysSet();
|
|
1155
|
+
|
|
1156
|
+
// Result shape (from schema): { key: string; is_set: boolean }
|
|
1157
|
+
```
|
|
1158
|
+
|
|
1159
|
+
### `posthog.agentApplicationsRevisionsFreezeCreate`
|
|
1160
|
+
|
|
1161
|
+
- **HTTP**: `POST /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/freeze/`
|
|
1162
|
+
- **What it does**: Freeze the bundle: draft → ready, stamps sha256 on the row.
|
|
1163
|
+
|
|
1164
|
+
Django is a thin proxy here: resolve template refs into the
|
|
1165
|
+
bundle, ask the janitor to seal it (the janitor returns the sha
|
|
1166
|
+
+ the spec it derived from the typed resources), then stamp the
|
|
1167
|
+
row. No `transaction.atomic()` — the janitor's freeze is idempotent
|
|
1168
|
+
(on retry it re-reads the existing `.frozen` marker + re-derives
|
|
1169
|
+
spec), so a partial failure here is recoverable by re-calling
|
|
1170
|
+
freeze, not by transactional rollback. Holding an atomic block
|
|
1171
|
+
across the janitor HTTP call previously deadlocked the
|
|
1172
|
+
agent_revision row against the janitor's spec write — that's
|
|
1173
|
+
moved off the janitor side as part of the same fix.
|
|
1174
|
+
- **OpenAPI operationId**: `agent_applications_revisions_freeze_create`
|
|
1175
|
+
- **Path params**: `application_id`, `id`
|
|
1176
|
+
- **Query params**: None
|
|
1177
|
+
- **Response codes**: `200`
|
|
1178
|
+
- **Transport options**: None
|
|
1179
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1180
|
+
|
|
1181
|
+
**Inputs**
|
|
1182
|
+
|
|
1183
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1184
|
+
- Client transport options: None
|
|
1185
|
+
|
|
1186
|
+
**Outputs**
|
|
1187
|
+
|
|
1188
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
1189
|
+
- OpenAPI response codes: `200`
|
|
1190
|
+
|
|
1191
|
+
```ts
|
|
1192
|
+
import posthog from "@utdk/posthog";
|
|
1193
|
+
|
|
1194
|
+
type AgentApplicationsRevisionsFreezeCreateInput = Parameters<typeof posthog.agentApplicationsRevisionsFreezeCreate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1195
|
+
type AgentApplicationsRevisionsFreezeCreateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsFreezeCreate>>;
|
|
1196
|
+
|
|
1197
|
+
const result: AgentApplicationsRevisionsFreezeCreateOutput = await posthog.agentApplicationsRevisionsFreezeCreate();
|
|
1198
|
+
|
|
1199
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
1200
|
+
```
|
|
1201
|
+
|
|
1202
|
+
### `posthog.agentApplicationsRevisionsManifestRetrieve`
|
|
1203
|
+
|
|
1204
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/manifest/`
|
|
1205
|
+
- **What it does**: List every file in this revision's bundle (path, size, sha256).
|
|
1206
|
+
- **OpenAPI operationId**: `agent_applications_revisions_manifest_retrieve`
|
|
1207
|
+
- **Path params**: `application_id`, `id`
|
|
1208
|
+
- **Query params**: None
|
|
1209
|
+
- **Response codes**: `200`
|
|
1210
|
+
- **Transport options**: None
|
|
1211
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1212
|
+
|
|
1213
|
+
**Inputs**
|
|
1214
|
+
|
|
1215
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1216
|
+
- Client transport options: None
|
|
1217
|
+
|
|
1218
|
+
**Outputs**
|
|
1219
|
+
|
|
1220
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
1221
|
+
- OpenAPI response codes: `200`
|
|
1222
|
+
|
|
1223
|
+
```ts
|
|
1224
|
+
import posthog from "@utdk/posthog";
|
|
1225
|
+
|
|
1226
|
+
type AgentApplicationsRevisionsManifestRetrieveInput = Parameters<typeof posthog.agentApplicationsRevisionsManifestRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1227
|
+
type AgentApplicationsRevisionsManifestRetrieveOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsManifestRetrieve>>;
|
|
1228
|
+
|
|
1229
|
+
const result: AgentApplicationsRevisionsManifestRetrieveOutput = await posthog.agentApplicationsRevisionsManifestRetrieve();
|
|
1230
|
+
|
|
1231
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
1232
|
+
```
|
|
1233
|
+
|
|
1234
|
+
### `posthog.agentApplicationsRevisionsPromoteCreate`
|
|
1235
|
+
|
|
1236
|
+
- **HTTP**: `POST /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/promote/`
|
|
1237
|
+
- **What it does**: ready → live. Sets the parent application's live_revision.
|
|
1238
|
+
- **OpenAPI operationId**: `agent_applications_revisions_promote_create`
|
|
1239
|
+
- **Path params**: `application_id`, `id`
|
|
1240
|
+
- **Query params**: None
|
|
1241
|
+
- **Response codes**: `200`
|
|
1242
|
+
- **Transport options**: None
|
|
1243
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1244
|
+
|
|
1245
|
+
**Inputs**
|
|
1246
|
+
|
|
1247
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1248
|
+
- Client transport options: None
|
|
1249
|
+
|
|
1250
|
+
**Outputs**
|
|
1251
|
+
|
|
1252
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
1253
|
+
- OpenAPI response codes: `200`
|
|
1254
|
+
|
|
1255
|
+
```ts
|
|
1256
|
+
import posthog from "@utdk/posthog";
|
|
1257
|
+
|
|
1258
|
+
type AgentApplicationsRevisionsPromoteCreateInput = Parameters<typeof posthog.agentApplicationsRevisionsPromoteCreate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1259
|
+
type AgentApplicationsRevisionsPromoteCreateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsPromoteCreate>>;
|
|
1260
|
+
|
|
1261
|
+
const result: AgentApplicationsRevisionsPromoteCreateOutput = await posthog.agentApplicationsRevisionsPromoteCreate();
|
|
1262
|
+
|
|
1263
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
1264
|
+
```
|
|
1265
|
+
|
|
1266
|
+
### `posthog.agentApplicationsRevisionsSetEnvCreate`
|
|
1267
|
+
|
|
1268
|
+
- **HTTP**: `POST /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/set_env/`
|
|
1269
|
+
- **What it does**: Replace this revision's encrypted env block.
|
|
1270
|
+
|
|
1271
|
+
The body is `{ "env": { "<KEY>": "<value>", ... } }`. The encrypted
|
|
1272
|
+
text is stored on `AgentRevision.encrypted_env`; the worker decrypts it
|
|
1273
|
+
at session start via the same Fernet schedule (see
|
|
1274
|
+
agent-shared/src/runtime/encryption.ts).
|
|
1275
|
+
- **OpenAPI operationId**: `agent_applications_revisions_set_env_create`
|
|
1276
|
+
- **Path params**: `application_id`, `id`
|
|
1277
|
+
- **Query params**: None
|
|
1278
|
+
- **Response codes**: `200`
|
|
1279
|
+
- **Transport options**: None
|
|
1280
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1281
|
+
|
|
1282
|
+
**Inputs**
|
|
1283
|
+
|
|
1284
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1285
|
+
- Client transport options: None
|
|
1286
|
+
|
|
1287
|
+
**Outputs**
|
|
1288
|
+
|
|
1289
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
1290
|
+
- OpenAPI response codes: `200`
|
|
1291
|
+
|
|
1292
|
+
```ts
|
|
1293
|
+
import posthog from "@utdk/posthog";
|
|
1294
|
+
|
|
1295
|
+
type AgentApplicationsRevisionsSetEnvCreateInput = Parameters<typeof posthog.agentApplicationsRevisionsSetEnvCreate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1296
|
+
type AgentApplicationsRevisionsSetEnvCreateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsSetEnvCreate>>;
|
|
1297
|
+
|
|
1298
|
+
const result: AgentApplicationsRevisionsSetEnvCreateOutput = await posthog.agentApplicationsRevisionsSetEnvCreate();
|
|
1299
|
+
|
|
1300
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
1301
|
+
```
|
|
1302
|
+
|
|
1303
|
+
### `posthog.agentApplicationsRevisionsSkillRefsUpdate`
|
|
1304
|
+
|
|
1305
|
+
- **HTTP**: `PUT /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/skill_refs/`
|
|
1306
|
+
- **What it does**: Full-replace the draft's store-skill references. They are resolved
|
|
1307
|
+
and materialized into the bundle at freeze, not here — this only records
|
|
1308
|
+
which skills (and pinned versions) the freeze should pull in.
|
|
1309
|
+
- **OpenAPI operationId**: `agent_applications_revisions_skill_refs_update`
|
|
1310
|
+
- **Path params**: `application_id`, `id`
|
|
1311
|
+
- **Query params**: None
|
|
1312
|
+
- **Response codes**: `200`
|
|
1313
|
+
- **Transport options**: None
|
|
1314
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1315
|
+
|
|
1316
|
+
**Inputs**
|
|
1317
|
+
|
|
1318
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1319
|
+
- Client transport options: None
|
|
1320
|
+
|
|
1321
|
+
**Outputs**
|
|
1322
|
+
|
|
1323
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
1324
|
+
- OpenAPI response codes: `200`
|
|
1325
|
+
|
|
1326
|
+
```ts
|
|
1327
|
+
import posthog from "@utdk/posthog";
|
|
1328
|
+
|
|
1329
|
+
type AgentApplicationsRevisionsSkillRefsUpdateInput = Parameters<typeof posthog.agentApplicationsRevisionsSkillRefsUpdate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1330
|
+
type AgentApplicationsRevisionsSkillRefsUpdateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsSkillRefsUpdate>>;
|
|
1331
|
+
|
|
1332
|
+
const result: AgentApplicationsRevisionsSkillRefsUpdateOutput = await posthog.agentApplicationsRevisionsSkillRefsUpdate();
|
|
1333
|
+
|
|
1334
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
1335
|
+
```
|
|
1336
|
+
|
|
1337
|
+
### `posthog.agentApplicationsRevisionsSlackManifest`
|
|
1338
|
+
|
|
1339
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/slack_manifest/`
|
|
1340
|
+
- **What it does**: Build a Slack app manifest for this revision's slack trigger.
|
|
1341
|
+
|
|
1342
|
+
Deterministic: the OAuth scopes and bot event subscriptions are derived
|
|
1343
|
+
from the slack trigger config (`mention_only` / `auto_resume_threads` /
|
|
1344
|
+
`ack_reaction`) and the agent's Slack tools, so the manifest already
|
|
1345
|
+
subscribes to exactly the events the config needs. 400 if the revision
|
|
1346
|
+
has no slack trigger.
|
|
1347
|
+
- **OpenAPI operationId**: `agent_applications_revisions_slack_manifest`
|
|
1348
|
+
- **Path params**: `application_id`, `id`
|
|
1349
|
+
- **Query params**: None
|
|
1350
|
+
- **Response codes**: `200`
|
|
1351
|
+
- **Transport options**: None
|
|
1352
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1353
|
+
|
|
1354
|
+
**Inputs**
|
|
1355
|
+
|
|
1356
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1357
|
+
- Client transport options: None
|
|
1358
|
+
|
|
1359
|
+
**Outputs**
|
|
1360
|
+
|
|
1361
|
+
- Client return type: `{ revision_id: string; manifest: unknown; notes: (string)[]; events_url: string | null; interactivity_url: string | null }`
|
|
1362
|
+
- OpenAPI response codes: `200`
|
|
1363
|
+
|
|
1364
|
+
```ts
|
|
1365
|
+
import posthog from "@utdk/posthog";
|
|
1366
|
+
|
|
1367
|
+
type AgentApplicationsRevisionsSlackManifestInput = Parameters<typeof posthog.agentApplicationsRevisionsSlackManifest> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1368
|
+
type AgentApplicationsRevisionsSlackManifestOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsSlackManifest>>;
|
|
1369
|
+
|
|
1370
|
+
const result: AgentApplicationsRevisionsSlackManifestOutput = await posthog.agentApplicationsRevisionsSlackManifest();
|
|
1371
|
+
|
|
1372
|
+
// Result shape (from schema): { revision_id: string; manifest: unknown; notes: (string)[]; events_url: string | null; interactivity_url: string | null }
|
|
1373
|
+
```
|
|
1374
|
+
|
|
1375
|
+
### `posthog.agentApplicationsRevisionsSpecUpdate`
|
|
1376
|
+
|
|
1377
|
+
- **HTTP**: `PUT /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/spec/`
|
|
1378
|
+
- **What it does**: Revisions of an agent. Created in `draft`, promoted through
|
|
1379
|
+
`ready → live` once the bundle has been uploaded + frozen.
|
|
1380
|
+
|
|
1381
|
+
URLs (nested under an application):
|
|
1382
|
+
|
|
1383
|
+
Model CRUD:
|
|
1384
|
+
GET .../revisions/ list
|
|
1385
|
+
POST .../revisions/ create draft
|
|
1386
|
+
GET .../revisions/<id>/ retrieve
|
|
1387
|
+
PATCH .../revisions/<id>/ update spec (draft only)
|
|
1388
|
+
|
|
1389
|
+
Lifecycle:
|
|
1390
|
+
POST .../revisions/<id>/promote/ ready → live
|
|
1391
|
+
POST .../revisions/<id>/archive/ → archived
|
|
1392
|
+
POST .../revisions/<id>/freeze/ draft → ready (stamps sha256)
|
|
1393
|
+
POST .../revisions/<id>/clone_from/ copy bundle from another rev
|
|
1394
|
+
POST .../revisions/new_draft/ create draft + clone_from atomically
|
|
1395
|
+
|
|
1396
|
+
Bundle authoring (proxied to the janitor):
|
|
1397
|
+
GET .../revisions/<id>/manifest/ list paths + sha256
|
|
1398
|
+
GET .../revisions/<id>/file/?path=… read one file
|
|
1399
|
+
PUT .../revisions/<id>/file/?path=… write one file (draft)
|
|
1400
|
+
DELETE .../revisions/<id>/file/?path=… delete one file (draft)
|
|
1401
|
+
GET .../revisions/<id>/bundle/ bulk pull all files
|
|
1402
|
+
PUT .../revisions/<id>/bundle/ bulk push (replace|merge)
|
|
1403
|
+
- **OpenAPI operationId**: `agent_applications_revisions_spec_update`
|
|
1404
|
+
- **Path params**: `application_id`, `id`
|
|
1405
|
+
- **Query params**: None
|
|
1406
|
+
- **Response codes**: `200`
|
|
1407
|
+
- **Transport options**: None
|
|
1408
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1409
|
+
|
|
1410
|
+
**Inputs**
|
|
1411
|
+
|
|
1412
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1413
|
+
- Client transport options: None
|
|
1414
|
+
|
|
1415
|
+
**Outputs**
|
|
1416
|
+
|
|
1417
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
1418
|
+
- OpenAPI response codes: `200`
|
|
1419
|
+
|
|
1420
|
+
```ts
|
|
1421
|
+
import posthog from "@utdk/posthog";
|
|
1422
|
+
|
|
1423
|
+
type AgentApplicationsRevisionsSpecUpdateInput = Parameters<typeof posthog.agentApplicationsRevisionsSpecUpdate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1424
|
+
type AgentApplicationsRevisionsSpecUpdateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsSpecUpdate>>;
|
|
1425
|
+
|
|
1426
|
+
const result: AgentApplicationsRevisionsSpecUpdateOutput = await posthog.agentApplicationsRevisionsSpecUpdate();
|
|
1427
|
+
|
|
1428
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
1429
|
+
```
|
|
1430
|
+
|
|
1431
|
+
### `posthog.agentApplicationsRevisionsSystemPrompt`
|
|
1432
|
+
|
|
1433
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/system_prompt/`
|
|
1434
|
+
- **What it does**: Return the fully-assembled system prompt for this revision.
|
|
1435
|
+
|
|
1436
|
+
Authoring tools call this to preview what the model will actually
|
|
1437
|
+
see at session start — the platform framework preamble plus the
|
|
1438
|
+
bundle's `agent.md` plus the skills index. Useful for debugging
|
|
1439
|
+
author-vs-framework precedence conflicts and verifying
|
|
1440
|
+
`spec.framework_prompt.omit` overrides took effect.
|
|
1441
|
+
- **OpenAPI operationId**: `agent_applications_revisions_system_prompt`
|
|
1442
|
+
- **Path params**: `application_id`, `id`
|
|
1443
|
+
- **Query params**: None
|
|
1444
|
+
- **Response codes**: `200`
|
|
1445
|
+
- **Transport options**: None
|
|
1446
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1447
|
+
|
|
1448
|
+
**Inputs**
|
|
1449
|
+
|
|
1450
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1451
|
+
- Client transport options: None
|
|
1452
|
+
|
|
1453
|
+
**Outputs**
|
|
1454
|
+
|
|
1455
|
+
- Client return type: `{ revision_id: string; framework_prompt_version: number; system_prompt: string }`
|
|
1456
|
+
- OpenAPI response codes: `200`
|
|
1457
|
+
|
|
1458
|
+
```ts
|
|
1459
|
+
import posthog from "@utdk/posthog";
|
|
1460
|
+
|
|
1461
|
+
type AgentApplicationsRevisionsSystemPromptInput = Parameters<typeof posthog.agentApplicationsRevisionsSystemPrompt> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1462
|
+
type AgentApplicationsRevisionsSystemPromptOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsSystemPrompt>>;
|
|
1463
|
+
|
|
1464
|
+
const result: AgentApplicationsRevisionsSystemPromptOutput = await posthog.agentApplicationsRevisionsSystemPrompt();
|
|
1465
|
+
|
|
1466
|
+
// Result shape (from schema): { revision_id: string; framework_prompt_version: number; system_prompt: string }
|
|
1467
|
+
```
|
|
1468
|
+
|
|
1469
|
+
### `posthog.agentApplicationsRevisionsToolsDestroy`
|
|
1470
|
+
|
|
1471
|
+
- **HTTP**: `DELETE /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/tools/{tool_id}/`
|
|
1472
|
+
- **What it does**: Revisions of an agent. Created in `draft`, promoted through
|
|
1473
|
+
`ready → live` once the bundle has been uploaded + frozen.
|
|
1474
|
+
|
|
1475
|
+
URLs (nested under an application):
|
|
1476
|
+
|
|
1477
|
+
Model CRUD:
|
|
1478
|
+
GET .../revisions/ list
|
|
1479
|
+
POST .../revisions/ create draft
|
|
1480
|
+
GET .../revisions/<id>/ retrieve
|
|
1481
|
+
PATCH .../revisions/<id>/ update spec (draft only)
|
|
1482
|
+
|
|
1483
|
+
Lifecycle:
|
|
1484
|
+
POST .../revisions/<id>/promote/ ready → live
|
|
1485
|
+
POST .../revisions/<id>/archive/ → archived
|
|
1486
|
+
POST .../revisions/<id>/freeze/ draft → ready (stamps sha256)
|
|
1487
|
+
POST .../revisions/<id>/clone_from/ copy bundle from another rev
|
|
1488
|
+
POST .../revisions/new_draft/ create draft + clone_from atomically
|
|
1489
|
+
|
|
1490
|
+
Bundle authoring (proxied to the janitor):
|
|
1491
|
+
GET .../revisions/<id>/manifest/ list paths + sha256
|
|
1492
|
+
GET .../revisions/<id>/file/?path=… read one file
|
|
1493
|
+
PUT .../revisions/<id>/file/?path=… write one file (draft)
|
|
1494
|
+
DELETE .../revisions/<id>/file/?path=… delete one file (draft)
|
|
1495
|
+
GET .../revisions/<id>/bundle/ bulk pull all files
|
|
1496
|
+
PUT .../revisions/<id>/bundle/ bulk push (replace|merge)
|
|
1497
|
+
- **OpenAPI operationId**: `agent_applications_revisions_tools_destroy`
|
|
1498
|
+
- **Path params**: `application_id`, `id`, `tool_id`
|
|
1499
|
+
- **Query params**: None
|
|
1500
|
+
- **Response codes**: `204`
|
|
1501
|
+
- **Transport options**: None
|
|
1502
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1503
|
+
|
|
1504
|
+
**Inputs**
|
|
1505
|
+
|
|
1506
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1507
|
+
- Client transport options: None
|
|
1508
|
+
|
|
1509
|
+
**Outputs**
|
|
1510
|
+
|
|
1511
|
+
- Client return type: `unknown`
|
|
1512
|
+
- OpenAPI response codes: `204`
|
|
1513
|
+
|
|
1514
|
+
```ts
|
|
1515
|
+
import posthog from "@utdk/posthog";
|
|
1516
|
+
|
|
1517
|
+
type AgentApplicationsRevisionsToolsDestroyInput = Parameters<typeof posthog.agentApplicationsRevisionsToolsDestroy> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1518
|
+
type AgentApplicationsRevisionsToolsDestroyOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsToolsDestroy>>;
|
|
1519
|
+
|
|
1520
|
+
const result: AgentApplicationsRevisionsToolsDestroyOutput = await posthog.agentApplicationsRevisionsToolsDestroy();
|
|
1521
|
+
|
|
1522
|
+
// Result shape (from schema): unknown
|
|
1523
|
+
```
|
|
1524
|
+
|
|
1525
|
+
### `posthog.agentApplicationsRevisionsToolsUpdate`
|
|
1526
|
+
|
|
1527
|
+
- **HTTP**: `PUT /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/tools/{tool_id}/`
|
|
1528
|
+
- **What it does**: Revisions of an agent. Created in `draft`, promoted through
|
|
1529
|
+
`ready → live` once the bundle has been uploaded + frozen.
|
|
1530
|
+
|
|
1531
|
+
URLs (nested under an application):
|
|
1532
|
+
|
|
1533
|
+
Model CRUD:
|
|
1534
|
+
GET .../revisions/ list
|
|
1535
|
+
POST .../revisions/ create draft
|
|
1536
|
+
GET .../revisions/<id>/ retrieve
|
|
1537
|
+
PATCH .../revisions/<id>/ update spec (draft only)
|
|
1538
|
+
|
|
1539
|
+
Lifecycle:
|
|
1540
|
+
POST .../revisions/<id>/promote/ ready → live
|
|
1541
|
+
POST .../revisions/<id>/archive/ → archived
|
|
1542
|
+
POST .../revisions/<id>/freeze/ draft → ready (stamps sha256)
|
|
1543
|
+
POST .../revisions/<id>/clone_from/ copy bundle from another rev
|
|
1544
|
+
POST .../revisions/new_draft/ create draft + clone_from atomically
|
|
1545
|
+
|
|
1546
|
+
Bundle authoring (proxied to the janitor):
|
|
1547
|
+
GET .../revisions/<id>/manifest/ list paths + sha256
|
|
1548
|
+
GET .../revisions/<id>/file/?path=… read one file
|
|
1549
|
+
PUT .../revisions/<id>/file/?path=… write one file (draft)
|
|
1550
|
+
DELETE .../revisions/<id>/file/?path=… delete one file (draft)
|
|
1551
|
+
GET .../revisions/<id>/bundle/ bulk pull all files
|
|
1552
|
+
PUT .../revisions/<id>/bundle/ bulk push (replace|merge)
|
|
1553
|
+
- **OpenAPI operationId**: `agent_applications_revisions_tools_update`
|
|
1554
|
+
- **Path params**: `application_id`, `id`, `tool_id`
|
|
1555
|
+
- **Query params**: None
|
|
1556
|
+
- **Response codes**: `200`
|
|
1557
|
+
- **Transport options**: None
|
|
1558
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1559
|
+
|
|
1560
|
+
**Inputs**
|
|
1561
|
+
|
|
1562
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1563
|
+
- Client transport options: None
|
|
1564
|
+
|
|
1565
|
+
**Outputs**
|
|
1566
|
+
|
|
1567
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
1568
|
+
- OpenAPI response codes: `200`
|
|
1569
|
+
|
|
1570
|
+
```ts
|
|
1571
|
+
import posthog from "@utdk/posthog";
|
|
1572
|
+
|
|
1573
|
+
type AgentApplicationsRevisionsToolsUpdateInput = Parameters<typeof posthog.agentApplicationsRevisionsToolsUpdate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1574
|
+
type AgentApplicationsRevisionsToolsUpdateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsToolsUpdate>>;
|
|
1575
|
+
|
|
1576
|
+
const result: AgentApplicationsRevisionsToolsUpdateOutput = await posthog.agentApplicationsRevisionsToolsUpdate();
|
|
1577
|
+
|
|
1578
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
1579
|
+
```
|
|
1580
|
+
|
|
1581
|
+
### `posthog.agentApplicationsRevisionsToolsDryRunCreate`
|
|
1582
|
+
|
|
1583
|
+
- **HTTP**: `POST /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/tools/{tool_id}/dry_run/`
|
|
1584
|
+
- **What it does**: Execute one persisted custom tool in a single-shot sandbox.
|
|
1585
|
+
|
|
1586
|
+
Authoring loop's "test this tool" button. The tool's source must
|
|
1587
|
+
already be PUT (compiled.js is what runs); this just invokes it
|
|
1588
|
+
with the caller-supplied args and a stubbed ctx. No real secrets
|
|
1589
|
+
leave Django — `mock_secrets` is a `{name → placeholder}` map.
|
|
1590
|
+
- **OpenAPI operationId**: `agent_applications_revisions_tools_dry_run_create`
|
|
1591
|
+
- **Path params**: `application_id`, `id`, `tool_id`
|
|
1592
|
+
- **Query params**: None
|
|
1593
|
+
- **Response codes**: `200`
|
|
1594
|
+
- **Transport options**: None
|
|
1595
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1596
|
+
|
|
1597
|
+
**Inputs**
|
|
1598
|
+
|
|
1599
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1600
|
+
- Client transport options: None
|
|
1601
|
+
|
|
1602
|
+
**Outputs**
|
|
1603
|
+
|
|
1604
|
+
- Client return type: `{ ok: boolean; tool_id: string; result?: unknown; error?: { code: string; message: string }; duration_ms: number }`
|
|
1605
|
+
- OpenAPI response codes: `200`
|
|
1606
|
+
|
|
1607
|
+
```ts
|
|
1608
|
+
import posthog from "@utdk/posthog";
|
|
1609
|
+
|
|
1610
|
+
type AgentApplicationsRevisionsToolsDryRunCreateInput = Parameters<typeof posthog.agentApplicationsRevisionsToolsDryRunCreate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1611
|
+
type AgentApplicationsRevisionsToolsDryRunCreateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsToolsDryRunCreate>>;
|
|
1612
|
+
|
|
1613
|
+
const result: AgentApplicationsRevisionsToolsDryRunCreateOutput = await posthog.agentApplicationsRevisionsToolsDryRunCreate();
|
|
1614
|
+
|
|
1615
|
+
// Result shape (from schema): { ok: boolean; tool_id: string; result?: unknown; error?: { code: string; message: string }; duration_ms: number }
|
|
1616
|
+
```
|
|
1617
|
+
|
|
1618
|
+
### `posthog.agentApplicationsRevisionsValidateCreate`
|
|
1619
|
+
|
|
1620
|
+
- **HTTP**: `POST /api/projects/{project_id}/agent_applications/{application_id}/revisions/{id}/validate/`
|
|
1621
|
+
- **What it does**: Pre-flight checks before freeze + promote: agent.md exists,
|
|
1622
|
+
every native tool id is registered, every custom tool has its
|
|
1623
|
+
compiled.js + schema.json, every skill path exists, every declared
|
|
1624
|
+
secret has a value set in this revision's env block. Returns
|
|
1625
|
+
`{ ok, errors: [...] }`. Works on any revision state.
|
|
1626
|
+
- **OpenAPI operationId**: `agent_applications_revisions_validate_create`
|
|
1627
|
+
- **Path params**: `application_id`, `id`
|
|
1628
|
+
- **Query params**: None
|
|
1629
|
+
- **Response codes**: `200`
|
|
1630
|
+
- **Transport options**: None
|
|
1631
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1632
|
+
|
|
1633
|
+
**Inputs**
|
|
1634
|
+
|
|
1635
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1636
|
+
- Client transport options: None
|
|
1637
|
+
|
|
1638
|
+
**Outputs**
|
|
1639
|
+
|
|
1640
|
+
- Client return type: `{ ok: boolean; revision_id: string; revision_state: string; errors: ({ code: string; message: string; pointer: string })[]; resolved_natives: (string)[] }`
|
|
1641
|
+
- OpenAPI response codes: `200`
|
|
1642
|
+
|
|
1643
|
+
```ts
|
|
1644
|
+
import posthog from "@utdk/posthog";
|
|
1645
|
+
|
|
1646
|
+
type AgentApplicationsRevisionsValidateCreateInput = Parameters<typeof posthog.agentApplicationsRevisionsValidateCreate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1647
|
+
type AgentApplicationsRevisionsValidateCreateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsValidateCreate>>;
|
|
1648
|
+
|
|
1649
|
+
const result: AgentApplicationsRevisionsValidateCreateOutput = await posthog.agentApplicationsRevisionsValidateCreate();
|
|
1650
|
+
|
|
1651
|
+
// Result shape (from schema): { ok: boolean; revision_id: string; revision_state: string; errors: ({ code: string; message: string; pointer: string })[]; resolved_natives: (string)[] }
|
|
1652
|
+
```
|
|
1653
|
+
|
|
1654
|
+
### `posthog.agentApplicationsRevisionsNewDraftCreate`
|
|
1655
|
+
|
|
1656
|
+
- **HTTP**: `POST /api/projects/{project_id}/agent_applications/{application_id}/revisions/new_draft/`
|
|
1657
|
+
- **What it does**: Create a fresh draft revision under `application_id` and seed it
|
|
1658
|
+
from `source_revision_id`. Saves the MCP one round-trip vs the
|
|
1659
|
+
explicit create + clone_from sequence.
|
|
1660
|
+
- **OpenAPI operationId**: `agent_applications_revisions_new_draft_create`
|
|
1661
|
+
- **Path params**: `application_id`
|
|
1662
|
+
- **Query params**: None
|
|
1663
|
+
- **Response codes**: `200`
|
|
1664
|
+
- **Transport options**: None
|
|
1665
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1666
|
+
|
|
1667
|
+
**Inputs**
|
|
1668
|
+
|
|
1669
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1670
|
+
- Client transport options: None
|
|
1671
|
+
|
|
1672
|
+
**Outputs**
|
|
1673
|
+
|
|
1674
|
+
- Client return type: `{ id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...`
|
|
1675
|
+
- OpenAPI response codes: `200`
|
|
1676
|
+
|
|
1677
|
+
```ts
|
|
1678
|
+
import posthog from "@utdk/posthog";
|
|
1679
|
+
|
|
1680
|
+
type AgentApplicationsRevisionsNewDraftCreateInput = Parameters<typeof posthog.agentApplicationsRevisionsNewDraftCreate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1681
|
+
type AgentApplicationsRevisionsNewDraftCreateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRevisionsNewDraftCreate>>;
|
|
1682
|
+
|
|
1683
|
+
const result: AgentApplicationsRevisionsNewDraftCreateOutput = await posthog.agentApplicationsRevisionsNewDraftCreate();
|
|
1684
|
+
|
|
1685
|
+
// Result shape (from schema): { id: string; application: string; parent_revision?: string | null; state: "draft" | "ready" | "live" | "archived"; bundle_uri?: string; bundle_sha256: string | null; spec?: unknown; skill_refs: ({ from_template: string...
|
|
1686
|
+
```
|
|
1687
|
+
|
|
1688
|
+
### `posthog.agentApplicationsDestroy`
|
|
1689
|
+
|
|
1690
|
+
- **HTTP**: `DELETE /api/projects/{project_id}/agent_applications/{id}/`
|
|
1691
|
+
- **What it does**: Agent applications — the deployable unit of the platform.
|
|
1692
|
+
|
|
1693
|
+
URLs:
|
|
1694
|
+
GET /api/projects/<team>/agent_applications/ list
|
|
1695
|
+
POST /api/projects/<team>/agent_applications/ create
|
|
1696
|
+
GET /api/projects/<team>/agent_applications/<id|slug>/ retrieve
|
|
1697
|
+
PATCH /api/projects/<team>/agent_applications/<id|slug>/ update
|
|
1698
|
+
DELETE /api/projects/<team>/agent_applications/<id|slug>/ archive
|
|
1699
|
+
POST /api/projects/<team>/agent_applications/<id|slug>/set_env/ bulk replace env
|
|
1700
|
+
GET /api/projects/<team>/agent_applications/<id|slug>/env_keys/ list set keys
|
|
1701
|
+
GET /api/projects/<team>/agent_applications/<id|slug>/env_keys/<KEY>/ is one key set?
|
|
1702
|
+
PUT /api/projects/<team>/agent_applications/<id|slug>/env_keys/<KEY>/ set one key
|
|
1703
|
+
DELETE /api/projects/<team>/agent_applications/<id|slug>/env_keys/<KEY>/ clear one key
|
|
1704
|
+
- **OpenAPI operationId**: `agent_applications_destroy`
|
|
1705
|
+
- **Path params**: `id`
|
|
1706
|
+
- **Query params**: None
|
|
1707
|
+
- **Response codes**: `204`
|
|
1708
|
+
- **Transport options**: None
|
|
1709
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1710
|
+
|
|
1711
|
+
**Inputs**
|
|
1712
|
+
|
|
1713
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1714
|
+
- Client transport options: None
|
|
1715
|
+
|
|
1716
|
+
**Outputs**
|
|
1717
|
+
|
|
1718
|
+
- Client return type: `unknown`
|
|
1719
|
+
- OpenAPI response codes: `204`
|
|
1720
|
+
|
|
1721
|
+
```ts
|
|
1722
|
+
import posthog from "@utdk/posthog";
|
|
1723
|
+
|
|
1724
|
+
type AgentApplicationsDestroyInput = Parameters<typeof posthog.agentApplicationsDestroy> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1725
|
+
type AgentApplicationsDestroyOutput = Awaited<ReturnType<typeof posthog.agentApplicationsDestroy>>;
|
|
1726
|
+
|
|
1727
|
+
const result: AgentApplicationsDestroyOutput = await posthog.agentApplicationsDestroy();
|
|
1728
|
+
|
|
1729
|
+
// Result shape (from schema): unknown
|
|
1730
|
+
```
|
|
1731
|
+
|
|
1732
|
+
### `posthog.agentApplicationsRetrieve`
|
|
1733
|
+
|
|
1734
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{id}/`
|
|
1735
|
+
- **What it does**: Agent applications — the deployable unit of the platform.
|
|
1736
|
+
|
|
1737
|
+
URLs:
|
|
1738
|
+
GET /api/projects/<team>/agent_applications/ list
|
|
1739
|
+
POST /api/projects/<team>/agent_applications/ create
|
|
1740
|
+
GET /api/projects/<team>/agent_applications/<id|slug>/ retrieve
|
|
1741
|
+
PATCH /api/projects/<team>/agent_applications/<id|slug>/ update
|
|
1742
|
+
DELETE /api/projects/<team>/agent_applications/<id|slug>/ archive
|
|
1743
|
+
POST /api/projects/<team>/agent_applications/<id|slug>/set_env/ bulk replace env
|
|
1744
|
+
GET /api/projects/<team>/agent_applications/<id|slug>/env_keys/ list set keys
|
|
1745
|
+
GET /api/projects/<team>/agent_applications/<id|slug>/env_keys/<KEY>/ is one key set?
|
|
1746
|
+
PUT /api/projects/<team>/agent_applications/<id|slug>/env_keys/<KEY>/ set one key
|
|
1747
|
+
DELETE /api/projects/<team>/agent_applications/<id|slug>/env_keys/<KEY>/ clear one key
|
|
1748
|
+
- **OpenAPI operationId**: `agent_applications_retrieve`
|
|
1749
|
+
- **Path params**: `id`
|
|
1750
|
+
- **Query params**: None
|
|
1751
|
+
- **Response codes**: `200`
|
|
1752
|
+
- **Transport options**: None
|
|
1753
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1754
|
+
|
|
1755
|
+
**Inputs**
|
|
1756
|
+
|
|
1757
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1758
|
+
- Client transport options: None
|
|
1759
|
+
|
|
1760
|
+
**Outputs**
|
|
1761
|
+
|
|
1762
|
+
- Client return type: `{ id: string; team_id: number; name: string; slug?: string; description?: string; live_revision: string | null; archived?: boolean; archived_at: string | null; created_by_id: number | null; created_by: { [key: string]: ...`
|
|
1763
|
+
- OpenAPI response codes: `200`
|
|
1764
|
+
|
|
1765
|
+
```ts
|
|
1766
|
+
import posthog from "@utdk/posthog";
|
|
1767
|
+
|
|
1768
|
+
type AgentApplicationsRetrieveInput = Parameters<typeof posthog.agentApplicationsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1769
|
+
type AgentApplicationsRetrieveOutput = Awaited<ReturnType<typeof posthog.agentApplicationsRetrieve>>;
|
|
1770
|
+
|
|
1771
|
+
const result: AgentApplicationsRetrieveOutput = await posthog.agentApplicationsRetrieve();
|
|
1772
|
+
|
|
1773
|
+
// Result shape (from schema): { id: string; team_id: number; name: string; slug?: string; description?: string; live_revision: string | null; archived?: boolean; archived_at: string | null; created_by_id: number | null; created_by: { [key: string]: ...
|
|
1774
|
+
```
|
|
1775
|
+
|
|
1776
|
+
### `posthog.agentApplicationsPartialUpdate`
|
|
1777
|
+
|
|
1778
|
+
- **HTTP**: `PATCH /api/projects/{project_id}/agent_applications/{id}/`
|
|
1779
|
+
- **What it does**: Agent applications — the deployable unit of the platform.
|
|
1780
|
+
|
|
1781
|
+
URLs:
|
|
1782
|
+
GET /api/projects/<team>/agent_applications/ list
|
|
1783
|
+
POST /api/projects/<team>/agent_applications/ create
|
|
1784
|
+
GET /api/projects/<team>/agent_applications/<id|slug>/ retrieve
|
|
1785
|
+
PATCH /api/projects/<team>/agent_applications/<id|slug>/ update
|
|
1786
|
+
DELETE /api/projects/<team>/agent_applications/<id|slug>/ archive
|
|
1787
|
+
POST /api/projects/<team>/agent_applications/<id|slug>/set_env/ bulk replace env
|
|
1788
|
+
GET /api/projects/<team>/agent_applications/<id|slug>/env_keys/ list set keys
|
|
1789
|
+
GET /api/projects/<team>/agent_applications/<id|slug>/env_keys/<KEY>/ is one key set?
|
|
1790
|
+
PUT /api/projects/<team>/agent_applications/<id|slug>/env_keys/<KEY>/ set one key
|
|
1791
|
+
DELETE /api/projects/<team>/agent_applications/<id|slug>/env_keys/<KEY>/ clear one key
|
|
1792
|
+
- **OpenAPI operationId**: `agent_applications_partial_update`
|
|
1793
|
+
- **Path params**: `id`
|
|
1794
|
+
- **Query params**: None
|
|
1795
|
+
- **Response codes**: `200`
|
|
1796
|
+
- **Transport options**: None
|
|
1797
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1798
|
+
|
|
1799
|
+
**Inputs**
|
|
1800
|
+
|
|
1801
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1802
|
+
- Client transport options: None
|
|
1803
|
+
|
|
1804
|
+
**Outputs**
|
|
1805
|
+
|
|
1806
|
+
- Client return type: `{ id: string; team_id: number; name: string; slug?: string; description?: string; live_revision: string | null; archived?: boolean; archived_at: string | null; created_by_id: number | null; created_by: { [key: string]: ...`
|
|
1807
|
+
- OpenAPI response codes: `200`
|
|
1808
|
+
|
|
1809
|
+
```ts
|
|
1810
|
+
import posthog from "@utdk/posthog";
|
|
1811
|
+
|
|
1812
|
+
type AgentApplicationsPartialUpdateInput = Parameters<typeof posthog.agentApplicationsPartialUpdate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1813
|
+
type AgentApplicationsPartialUpdateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsPartialUpdate>>;
|
|
1814
|
+
|
|
1815
|
+
const result: AgentApplicationsPartialUpdateOutput = await posthog.agentApplicationsPartialUpdate();
|
|
1816
|
+
|
|
1817
|
+
// Result shape (from schema): { id: string; team_id: number; name: string; slug?: string; description?: string; live_revision: string | null; archived?: boolean; archived_at: string | null; created_by_id: number | null; created_by: { [key: string]: ...
|
|
1818
|
+
```
|
|
1819
|
+
|
|
1820
|
+
### `posthog.agentApplicationsUpdate`
|
|
1821
|
+
|
|
1822
|
+
- **HTTP**: `PUT /api/projects/{project_id}/agent_applications/{id}/`
|
|
1823
|
+
- **What it does**: Agent applications — the deployable unit of the platform.
|
|
1824
|
+
|
|
1825
|
+
URLs:
|
|
1826
|
+
GET /api/projects/<team>/agent_applications/ list
|
|
1827
|
+
POST /api/projects/<team>/agent_applications/ create
|
|
1828
|
+
GET /api/projects/<team>/agent_applications/<id|slug>/ retrieve
|
|
1829
|
+
PATCH /api/projects/<team>/agent_applications/<id|slug>/ update
|
|
1830
|
+
DELETE /api/projects/<team>/agent_applications/<id|slug>/ archive
|
|
1831
|
+
POST /api/projects/<team>/agent_applications/<id|slug>/set_env/ bulk replace env
|
|
1832
|
+
GET /api/projects/<team>/agent_applications/<id|slug>/env_keys/ list set keys
|
|
1833
|
+
GET /api/projects/<team>/agent_applications/<id|slug>/env_keys/<KEY>/ is one key set?
|
|
1834
|
+
PUT /api/projects/<team>/agent_applications/<id|slug>/env_keys/<KEY>/ set one key
|
|
1835
|
+
DELETE /api/projects/<team>/agent_applications/<id|slug>/env_keys/<KEY>/ clear one key
|
|
1836
|
+
- **OpenAPI operationId**: `agent_applications_update`
|
|
1837
|
+
- **Path params**: `id`
|
|
1838
|
+
- **Query params**: None
|
|
1839
|
+
- **Response codes**: `200`
|
|
1840
|
+
- **Transport options**: None
|
|
1841
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1842
|
+
|
|
1843
|
+
**Inputs**
|
|
1844
|
+
|
|
1845
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1846
|
+
- Client transport options: None
|
|
1847
|
+
|
|
1848
|
+
**Outputs**
|
|
1849
|
+
|
|
1850
|
+
- Client return type: `{ id: string; team_id: number; name: string; slug?: string; description?: string; live_revision: string | null; archived?: boolean; archived_at: string | null; created_by_id: number | null; created_by: { [key: string]: ...`
|
|
1851
|
+
- OpenAPI response codes: `200`
|
|
1852
|
+
|
|
1853
|
+
```ts
|
|
1854
|
+
import posthog from "@utdk/posthog";
|
|
1855
|
+
|
|
1856
|
+
type AgentApplicationsUpdateInput = Parameters<typeof posthog.agentApplicationsUpdate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1857
|
+
type AgentApplicationsUpdateOutput = Awaited<ReturnType<typeof posthog.agentApplicationsUpdate>>;
|
|
1858
|
+
|
|
1859
|
+
const result: AgentApplicationsUpdateOutput = await posthog.agentApplicationsUpdate();
|
|
1860
|
+
|
|
1861
|
+
// Result shape (from schema): { id: string; team_id: number; name: string; slug?: string; description?: string; live_revision: string | null; archived?: boolean; archived_at: string | null; created_by_id: number | null; created_by: { [key: string]: ...
|
|
1862
|
+
```
|
|
1863
|
+
|
|
1864
|
+
### `posthog.agentApplicationsApprovalsList`
|
|
1865
|
+
|
|
1866
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{id}/approvals/`
|
|
1867
|
+
- **What it does**: List approval-gated tool requests for this application. Team-admin
|
|
1868
|
+
only (per plan §6.1). Default returns all states — pass `?state=queued`
|
|
1869
|
+
for the inbox view.
|
|
1870
|
+
- **OpenAPI operationId**: `agent_applications_approvals_list`
|
|
1871
|
+
- **Path params**: `id`
|
|
1872
|
+
- **Query params**: `limit`, `offset`, `state`
|
|
1873
|
+
- **Response codes**: `200`
|
|
1874
|
+
- **Transport options**: None
|
|
1875
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1876
|
+
|
|
1877
|
+
**Inputs**
|
|
1878
|
+
|
|
1879
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1880
|
+
- Client transport options: None
|
|
1881
|
+
|
|
1882
|
+
**Outputs**
|
|
1883
|
+
|
|
1884
|
+
- Client return type: `{ results: ({ id: string; session_id: string; application_id: string; team_id: number; revision_id: string; turn: number; tool_call_id: string; tool_name: string; proposed_args: { [key: string]: unknown }; decided_args:...`
|
|
1885
|
+
- OpenAPI response codes: `200`
|
|
1886
|
+
|
|
1887
|
+
```ts
|
|
1888
|
+
import posthog from "@utdk/posthog";
|
|
1889
|
+
|
|
1890
|
+
type AgentApplicationsApprovalsListInput = Parameters<typeof posthog.agentApplicationsApprovalsList> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1891
|
+
type AgentApplicationsApprovalsListOutput = Awaited<ReturnType<typeof posthog.agentApplicationsApprovalsList>>;
|
|
1892
|
+
|
|
1893
|
+
const result: AgentApplicationsApprovalsListOutput = await posthog.agentApplicationsApprovalsList();
|
|
1894
|
+
|
|
1895
|
+
// Result shape (from schema): { results: ({ id: string; session_id: string; application_id: string; team_id: number; revision_id: string; turn: number; tool_call_id: string; tool_name: string; proposed_args: { [key: string]: unknown }; decided_args:...
|
|
1896
|
+
```
|
|
1897
|
+
|
|
1898
|
+
### `posthog.agentApplicationsApprovalsRetrieve`
|
|
1899
|
+
|
|
1900
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{id}/approvals/{approval_id}/`
|
|
1901
|
+
- **What it does**: Single approval request — full proposed args, assistant snapshot,
|
|
1902
|
+
decision metadata, dispatch outcome. Team-admin only (plan §6.1).
|
|
1903
|
+
- **OpenAPI operationId**: `agent_applications_approvals_retrieve`
|
|
1904
|
+
- **Path params**: `approval_id`, `id`
|
|
1905
|
+
- **Query params**: None
|
|
1906
|
+
- **Response codes**: `200`
|
|
1907
|
+
- **Transport options**: None
|
|
1908
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1909
|
+
|
|
1910
|
+
**Inputs**
|
|
1911
|
+
|
|
1912
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1913
|
+
- Client transport options: None
|
|
1914
|
+
|
|
1915
|
+
**Outputs**
|
|
1916
|
+
|
|
1917
|
+
- Client return type: `unknown`
|
|
1918
|
+
- OpenAPI response codes: `200`
|
|
1919
|
+
|
|
1920
|
+
```ts
|
|
1921
|
+
import posthog from "@utdk/posthog";
|
|
1922
|
+
|
|
1923
|
+
type AgentApplicationsApprovalsRetrieveInput = Parameters<typeof posthog.agentApplicationsApprovalsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1924
|
+
type AgentApplicationsApprovalsRetrieveOutput = Awaited<ReturnType<typeof posthog.agentApplicationsApprovalsRetrieve>>;
|
|
1925
|
+
|
|
1926
|
+
const result: AgentApplicationsApprovalsRetrieveOutput = await posthog.agentApplicationsApprovalsRetrieve();
|
|
1927
|
+
|
|
1928
|
+
// Result shape (from schema): unknown
|
|
1929
|
+
```
|
|
1930
|
+
|
|
1931
|
+
### `posthog.agentApplicationsApprovalsDecide`
|
|
1932
|
+
|
|
1933
|
+
- **HTTP**: `POST /api/projects/{project_id}/agent_applications/{id}/approvals/{approval_id}/decide/`
|
|
1934
|
+
- **What it does**: Approve or reject a queued `agent`-type tool-approval request.
|
|
1935
|
+
|
|
1936
|
+
This is the OWNER decision surface — the only PostHog-authoritative one:
|
|
1937
|
+
team admins decide here, in the console. `principal`-type approvals are
|
|
1938
|
+
decided by the session principal at the ingress decision API, not here.
|
|
1939
|
+
The runtime side runs the tool platform-side on approve and wakes the
|
|
1940
|
+
session with a synthetic tool_result either way.
|
|
1941
|
+
- **OpenAPI operationId**: `agent_applications_approvals_decide`
|
|
1942
|
+
- **Path params**: `approval_id`, `id`
|
|
1943
|
+
- **Query params**: None
|
|
1944
|
+
- **Response codes**: `200`
|
|
1945
|
+
- **Transport options**: None
|
|
1946
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1947
|
+
|
|
1948
|
+
**Inputs**
|
|
1949
|
+
|
|
1950
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1951
|
+
- Client transport options: None
|
|
1952
|
+
|
|
1953
|
+
**Outputs**
|
|
1954
|
+
|
|
1955
|
+
- Client return type: `{ ok: boolean; state: string }`
|
|
1956
|
+
- OpenAPI response codes: `200`
|
|
1957
|
+
|
|
1958
|
+
```ts
|
|
1959
|
+
import posthog from "@utdk/posthog";
|
|
1960
|
+
|
|
1961
|
+
type AgentApplicationsApprovalsDecideInput = Parameters<typeof posthog.agentApplicationsApprovalsDecide> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1962
|
+
type AgentApplicationsApprovalsDecideOutput = Awaited<ReturnType<typeof posthog.agentApplicationsApprovalsDecide>>;
|
|
1963
|
+
|
|
1964
|
+
const result: AgentApplicationsApprovalsDecideOutput = await posthog.agentApplicationsApprovalsDecide();
|
|
1965
|
+
|
|
1966
|
+
// Result shape (from schema): { ok: boolean; state: string }
|
|
1967
|
+
```
|
|
1968
|
+
|
|
1969
|
+
### `posthog.agentApplicationsPreviewProxyGet`
|
|
1970
|
+
|
|
1971
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{id}/preview-proxy/{rest}/`
|
|
1972
|
+
- **What it does**: GET passthrough for the preview-proxy — used for `/listen` SSE.
|
|
1973
|
+
- **OpenAPI operationId**: `agent_applications_preview_proxy_get`
|
|
1974
|
+
- **Path params**: `id`, `rest`
|
|
1975
|
+
- **Query params**: `format`, `revision_id`
|
|
1976
|
+
- **Response codes**: `200`
|
|
1977
|
+
- **Transport options**: None
|
|
1978
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
1979
|
+
|
|
1980
|
+
**Inputs**
|
|
1981
|
+
|
|
1982
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
1983
|
+
- Client transport options: None
|
|
1984
|
+
|
|
1985
|
+
**Outputs**
|
|
1986
|
+
|
|
1987
|
+
- Client return type: `{ id: string; team_id: number; name: string; slug?: string; description?: string; live_revision: string | null; archived?: boolean; archived_at: string | null; created_by_id: number | null; created_by: { [key: string]: ...`
|
|
1988
|
+
- OpenAPI response codes: `200`
|
|
1989
|
+
|
|
1990
|
+
```ts
|
|
1991
|
+
import posthog from "@utdk/posthog";
|
|
1992
|
+
|
|
1993
|
+
type AgentApplicationsPreviewProxyGetInput = Parameters<typeof posthog.agentApplicationsPreviewProxyGet> extends [infer T, ...unknown[]] ? T : undefined;
|
|
1994
|
+
type AgentApplicationsPreviewProxyGetOutput = Awaited<ReturnType<typeof posthog.agentApplicationsPreviewProxyGet>>;
|
|
1995
|
+
|
|
1996
|
+
const result: AgentApplicationsPreviewProxyGetOutput = await posthog.agentApplicationsPreviewProxyGet();
|
|
1997
|
+
|
|
1998
|
+
// Result shape (from schema): { id: string; team_id: number; name: string; slug?: string; description?: string; live_revision: string | null; archived?: boolean; archived_at: string | null; created_by_id: number | null; created_by: { [key: string]: ...
|
|
1999
|
+
```
|
|
2000
|
+
|
|
2001
|
+
### `posthog.agentApplicationsPreviewProxy`
|
|
2002
|
+
|
|
2003
|
+
- **HTTP**: `POST /api/projects/{project_id}/agent_applications/{id}/preview-proxy/{rest}/`
|
|
2004
|
+
- **What it does**: Authoring-side proxy for invoking a *draft* (or any non-live) revision.
|
|
2005
|
+
|
|
2006
|
+
Closes the anonymous-draft-invoke gap: the public ingress URL refuses
|
|
2007
|
+
non-live invokes that don't carry the `x-agent-preview-secret` header;
|
|
2008
|
+
this proxy attaches it after authenticating the Django caller.
|
|
2009
|
+
|
|
2010
|
+
URL: `/api/projects/<team>/agent_applications/<app>/preview-proxy/<rest>`
|
|
2011
|
+
Auth: standard PAT / session — `agents:write` scope (POST run/send/cancel
|
|
2012
|
+
is a mutating invoke; the read-only `listen` GET is `agents:read`).
|
|
2013
|
+
- **OpenAPI operationId**: `agent_applications_preview_proxy`
|
|
2014
|
+
- **Path params**: `id`, `rest`
|
|
2015
|
+
- **Query params**: `format`, `revision_id`
|
|
2016
|
+
- **Response codes**: `200`
|
|
2017
|
+
- **Transport options**: None
|
|
2018
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
2019
|
+
|
|
2020
|
+
**Inputs**
|
|
2021
|
+
|
|
2022
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
2023
|
+
- Client transport options: None
|
|
2024
|
+
|
|
2025
|
+
**Outputs**
|
|
2026
|
+
|
|
2027
|
+
- Client return type: `string`
|
|
2028
|
+
- OpenAPI response codes: `200`
|
|
2029
|
+
|
|
2030
|
+
```ts
|
|
2031
|
+
import posthog from "@utdk/posthog";
|
|
2032
|
+
|
|
2033
|
+
type AgentApplicationsPreviewProxyInput = Parameters<typeof posthog.agentApplicationsPreviewProxy> extends [infer T, ...unknown[]] ? T : undefined;
|
|
2034
|
+
type AgentApplicationsPreviewProxyOutput = Awaited<ReturnType<typeof posthog.agentApplicationsPreviewProxy>>;
|
|
2035
|
+
|
|
2036
|
+
const result: AgentApplicationsPreviewProxyOutput = await posthog.agentApplicationsPreviewProxy();
|
|
2037
|
+
|
|
2038
|
+
// Result shape (from schema): string
|
|
2039
|
+
```
|
|
2040
|
+
|
|
2041
|
+
### `posthog.agentApplicationsPreviewToken`
|
|
2042
|
+
|
|
2043
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{id}/preview-token/`
|
|
2044
|
+
- **What it does**: GET sibling of `preview_token_mint`. Same body and response
|
|
2045
|
+
shape — exists because `EventSource` can't set headers, so SSE
|
|
2046
|
+
callers fetch the token via GET and then attach `?preview_token=`
|
|
2047
|
+
to the ingress URL. Behind the same URL (`url_path="preview-token"`)
|
|
2048
|
+
thanks to DRF's `@<action>.mapping.get`; DRF resolves it to a
|
|
2049
|
+
distinct `view.action`, but it is in `scope_object_write_actions`
|
|
2050
|
+
alongside the POST sibling — both return a usable credential, so
|
|
2051
|
+
both require `agents:write`.
|
|
2052
|
+
- **OpenAPI operationId**: `agent_applications_preview_token`
|
|
2053
|
+
- **Path params**: `id`
|
|
2054
|
+
- **Query params**: `revision_id`
|
|
2055
|
+
- **Response codes**: `200`
|
|
2056
|
+
- **Transport options**: None
|
|
2057
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
2058
|
+
|
|
2059
|
+
**Inputs**
|
|
2060
|
+
|
|
2061
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
2062
|
+
- Client transport options: None
|
|
2063
|
+
|
|
2064
|
+
**Outputs**
|
|
2065
|
+
|
|
2066
|
+
- Client return type: `{ token: string; expires_in: number; ingress_slug: string; endpoints: unknown; auth: unknown; preview_proxy: unknown }`
|
|
2067
|
+
- OpenAPI response codes: `200`
|
|
2068
|
+
|
|
2069
|
+
```ts
|
|
2070
|
+
import posthog from "@utdk/posthog";
|
|
2071
|
+
|
|
2072
|
+
type AgentApplicationsPreviewTokenInput = Parameters<typeof posthog.agentApplicationsPreviewToken> extends [infer T, ...unknown[]] ? T : undefined;
|
|
2073
|
+
type AgentApplicationsPreviewTokenOutput = Awaited<ReturnType<typeof posthog.agentApplicationsPreviewToken>>;
|
|
2074
|
+
|
|
2075
|
+
const result: AgentApplicationsPreviewTokenOutput = await posthog.agentApplicationsPreviewToken();
|
|
2076
|
+
|
|
2077
|
+
// Result shape (from schema): { token: string; expires_in: number; ingress_slug: string; endpoints: unknown; auth: unknown; preview_proxy: unknown }
|
|
2078
|
+
```
|
|
2079
|
+
|
|
2080
|
+
### `posthog.agentApplicationsPreviewTokenMint`
|
|
2081
|
+
|
|
2082
|
+
- **HTTP**: `POST /api/projects/{project_id}/agent_applications/{id}/preview-token/`
|
|
2083
|
+
- **What it does**: Mint a short-lived JWT for talking to a non-live revision
|
|
2084
|
+
directly via the public ingress URL. The caller attaches it as
|
|
2085
|
+
the `x-agent-preview-token` header (or `?preview_token=` query
|
|
2086
|
+
param for `EventSource`). See `_mint_preview_jwt` for the
|
|
2087
|
+
payload + claim binding.
|
|
2088
|
+
|
|
2089
|
+
The response also includes `endpoints`, `auth`, and
|
|
2090
|
+
`preview_proxy` blocks so the caller can wire a preview
|
|
2091
|
+
invocation without grepping the agent-ingress source for which
|
|
2092
|
+
path each trigger exposes or which header name carries the
|
|
2093
|
+
token. This is the "self-describing" half of preview-mode —
|
|
2094
|
+
every piece of info you need to hit ingress is in one response.
|
|
2095
|
+
|
|
2096
|
+
POST is the canonical verb — minting credentials for downstream
|
|
2097
|
+
`run`/`send`/`cancel` is a write-class capability. A GET sibling
|
|
2098
|
+
exists at the same URL for `EventSource` callers (which can't set
|
|
2099
|
+
headers); it is also write-scoped, since it returns the same token.
|
|
2100
|
+
- **OpenAPI operationId**: `agent_applications_preview_token_mint`
|
|
2101
|
+
- **Path params**: `id`
|
|
2102
|
+
- **Query params**: `revision_id`
|
|
2103
|
+
- **Response codes**: `200`
|
|
2104
|
+
- **Transport options**: None
|
|
2105
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
2106
|
+
|
|
2107
|
+
**Inputs**
|
|
2108
|
+
|
|
2109
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
2110
|
+
- Client transport options: None
|
|
2111
|
+
|
|
2112
|
+
**Outputs**
|
|
2113
|
+
|
|
2114
|
+
- Client return type: `{ token: string; expires_in: number; ingress_slug: string; endpoints: unknown; auth: unknown; preview_proxy: unknown }`
|
|
2115
|
+
- OpenAPI response codes: `200`
|
|
2116
|
+
|
|
2117
|
+
```ts
|
|
2118
|
+
import posthog from "@utdk/posthog";
|
|
2119
|
+
|
|
2120
|
+
type AgentApplicationsPreviewTokenMintInput = Parameters<typeof posthog.agentApplicationsPreviewTokenMint> extends [infer T, ...unknown[]] ? T : undefined;
|
|
2121
|
+
type AgentApplicationsPreviewTokenMintOutput = Awaited<ReturnType<typeof posthog.agentApplicationsPreviewTokenMint>>;
|
|
2122
|
+
|
|
2123
|
+
const result: AgentApplicationsPreviewTokenMintOutput = await posthog.agentApplicationsPreviewTokenMint();
|
|
2124
|
+
|
|
2125
|
+
// Result shape (from schema): { token: string; expires_in: number; ingress_slug: string; endpoints: unknown; auth: unknown; preview_proxy: unknown }
|
|
2126
|
+
```
|
|
2127
|
+
|
|
2128
|
+
### `posthog.agentApplicationsSessionsList`
|
|
2129
|
+
|
|
2130
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{id}/sessions/`
|
|
2131
|
+
- **What it does**: List sessions for this application, most recently active first. Strips the
|
|
2132
|
+
conversation transcript from each summary, but includes a `preview`
|
|
2133
|
+
(last assistant text, ~120 chars) and `usage_total` (token + cost
|
|
2134
|
+
aggregate). Use `agent-applications-sessions-retrieve` for the full
|
|
2135
|
+
transcript of a single session.
|
|
2136
|
+
- **OpenAPI operationId**: `agent_applications_sessions_list`
|
|
2137
|
+
- **Path params**: `id`
|
|
2138
|
+
- **Query params**: `created_after`, `created_before`, `limit`, `offset`, `revision_id`, `state`
|
|
2139
|
+
- **Response codes**: `200`
|
|
2140
|
+
- **Transport options**: None
|
|
2141
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
2142
|
+
|
|
2143
|
+
**Inputs**
|
|
2144
|
+
|
|
2145
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
2146
|
+
- Client transport options: None
|
|
2147
|
+
|
|
2148
|
+
**Outputs**
|
|
2149
|
+
|
|
2150
|
+
- Client return type: `{ results: ({ usage_total: { tokens_in: number; tokens_out: number; cache_read: number; cache_write: number; cost_input: number; cost_output: number; cost_cache_read: number; cost_cache_write: number; cost_total: number...`
|
|
2151
|
+
- OpenAPI response codes: `200`
|
|
2152
|
+
|
|
2153
|
+
```ts
|
|
2154
|
+
import posthog from "@utdk/posthog";
|
|
2155
|
+
|
|
2156
|
+
type AgentApplicationsSessionsListInput = Parameters<typeof posthog.agentApplicationsSessionsList> extends [infer T, ...unknown[]] ? T : undefined;
|
|
2157
|
+
type AgentApplicationsSessionsListOutput = Awaited<ReturnType<typeof posthog.agentApplicationsSessionsList>>;
|
|
2158
|
+
|
|
2159
|
+
const result: AgentApplicationsSessionsListOutput = await posthog.agentApplicationsSessionsList();
|
|
2160
|
+
|
|
2161
|
+
// Result shape (from schema): { results: ({ usage_total: { tokens_in: number; tokens_out: number; cache_read: number; cache_write: number; cost_input: number; cost_output: number; cost_cache_read: number; cost_cache_write: number; cost_total: number...
|
|
2162
|
+
```
|
|
2163
|
+
|
|
2164
|
+
### `posthog.agentApplicationsSessionsRetrieve`
|
|
2165
|
+
|
|
2166
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{id}/sessions/{session_id}/`
|
|
2167
|
+
- **What it does**: Fetch one session's state — full conversation by default, or just
|
|
2168
|
+
the trailing N messages with `?last_n=`. Always returns a
|
|
2169
|
+
`usage_total` block aggregated over the entire session, regardless of
|
|
2170
|
+
trim. The runner-side queue DB is the source of truth.
|
|
2171
|
+
- **OpenAPI operationId**: `agent_applications_sessions_retrieve`
|
|
2172
|
+
- **Path params**: `id`, `session_id`
|
|
2173
|
+
- **Query params**: `last_n`
|
|
2174
|
+
- **Response codes**: `200`
|
|
2175
|
+
- **Transport options**: None
|
|
2176
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
2177
|
+
|
|
2178
|
+
**Inputs**
|
|
2179
|
+
|
|
2180
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
2181
|
+
- Client transport options: None
|
|
2182
|
+
|
|
2183
|
+
**Outputs**
|
|
2184
|
+
|
|
2185
|
+
- Client return type: `{ usage_total: { tokens_in: number; tokens_out: number; cache_read: number; cache_write: number; cost_input: number; cost_output: number; cost_cache_read: number; cost_cache_write: number; cost_total: number }; principa...`
|
|
2186
|
+
- OpenAPI response codes: `200`
|
|
2187
|
+
|
|
2188
|
+
```ts
|
|
2189
|
+
import posthog from "@utdk/posthog";
|
|
2190
|
+
|
|
2191
|
+
type AgentApplicationsSessionsRetrieveInput = Parameters<typeof posthog.agentApplicationsSessionsRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
|
|
2192
|
+
type AgentApplicationsSessionsRetrieveOutput = Awaited<ReturnType<typeof posthog.agentApplicationsSessionsRetrieve>>;
|
|
2193
|
+
|
|
2194
|
+
const result: AgentApplicationsSessionsRetrieveOutput = await posthog.agentApplicationsSessionsRetrieve();
|
|
2195
|
+
|
|
2196
|
+
// Result shape (from schema): { usage_total: { tokens_in: number; tokens_out: number; cache_read: number; cache_write: number; cost_input: number; cost_output: number; cost_cache_read: number; cost_cache_write: number; cost_total: number }; principa...
|
|
2197
|
+
```
|
|
2198
|
+
|
|
2199
|
+
### `posthog.agentApplicationsSessionLogs`
|
|
2200
|
+
|
|
2201
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{id}/sessions/{session_id}/logs/`
|
|
2202
|
+
- **What it does**: Read the runner's structured event log for one session from
|
|
2203
|
+
ClickHouse. Filters (limit / after / before / level / search)
|
|
2204
|
+
match the shared `LogEntryMixin` helper used by hog_function +
|
|
2205
|
+
hog_flow.
|
|
2206
|
+
- **OpenAPI operationId**: `agent_applications_session_logs`
|
|
2207
|
+
- **Path params**: `id`, `session_id`
|
|
2208
|
+
- **Query params**: `after`, `before`, `instance_id`, `level`, `limit`, `search`
|
|
2209
|
+
- **Response codes**: `200`
|
|
2210
|
+
- **Transport options**: None
|
|
2211
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
2212
|
+
|
|
2213
|
+
**Inputs**
|
|
2214
|
+
|
|
2215
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
2216
|
+
- Client transport options: None
|
|
2217
|
+
|
|
2218
|
+
**Outputs**
|
|
2219
|
+
|
|
2220
|
+
- Client return type: `{ results: ({ log_source_id: string; instance_id: string; timestamp: string; level: string; message: string })[] }`
|
|
2221
|
+
- OpenAPI response codes: `200`
|
|
2222
|
+
|
|
2223
|
+
```ts
|
|
2224
|
+
import posthog from "@utdk/posthog";
|
|
2225
|
+
|
|
2226
|
+
type AgentApplicationsSessionLogsInput = Parameters<typeof posthog.agentApplicationsSessionLogs> extends [infer T, ...unknown[]] ? T : undefined;
|
|
2227
|
+
type AgentApplicationsSessionLogsOutput = Awaited<ReturnType<typeof posthog.agentApplicationsSessionLogs>>;
|
|
2228
|
+
|
|
2229
|
+
const result: AgentApplicationsSessionLogsOutput = await posthog.agentApplicationsSessionLogs();
|
|
2230
|
+
|
|
2231
|
+
// Result shape (from schema): { results: ({ log_source_id: string; instance_id: string; timestamp: string; level: string; message: string })[] }
|
|
2232
|
+
```
|
|
2233
|
+
|
|
2234
|
+
### `posthog.agentApplicationsStats`
|
|
2235
|
+
|
|
2236
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{id}/stats/`
|
|
2237
|
+
- **What it does**: Roll-up stats for the agent — drives the agent-detail overview tiles.
|
|
2238
|
+
- **OpenAPI operationId**: `agent_applications_stats`
|
|
2239
|
+
- **Path params**: `id`
|
|
2240
|
+
- **Query params**: `since`
|
|
2241
|
+
- **Response codes**: `200`
|
|
2242
|
+
- **Transport options**: None
|
|
2243
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
2244
|
+
|
|
2245
|
+
**Inputs**
|
|
2246
|
+
|
|
2247
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
2248
|
+
- Client transport options: None
|
|
2249
|
+
|
|
2250
|
+
**Outputs**
|
|
2251
|
+
|
|
2252
|
+
- Client return type: `{ liveCount: number; sessionsInWindowCount: number; spendInWindowUsd: number; lastActivityAt: string | null; failedInWindowCount: number; pendingApprovalsCount: number }`
|
|
2253
|
+
- OpenAPI response codes: `200`
|
|
2254
|
+
|
|
2255
|
+
```ts
|
|
2256
|
+
import posthog from "@utdk/posthog";
|
|
2257
|
+
|
|
2258
|
+
type AgentApplicationsStatsInput = Parameters<typeof posthog.agentApplicationsStats> extends [infer T, ...unknown[]] ? T : undefined;
|
|
2259
|
+
type AgentApplicationsStatsOutput = Awaited<ReturnType<typeof posthog.agentApplicationsStats>>;
|
|
2260
|
+
|
|
2261
|
+
const result: AgentApplicationsStatsOutput = await posthog.agentApplicationsStats();
|
|
2262
|
+
|
|
2263
|
+
// Result shape (from schema): { liveCount: number; sessionsInWindowCount: number; spendInWindowUsd: number; lastActivityAt: string | null; failedInWindowCount: number; pendingApprovalsCount: number }
|
|
2264
|
+
```
|
|
2265
|
+
|
|
2266
|
+
### `posthog.agentApplicationsUsersList`
|
|
2267
|
+
|
|
2268
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/{id}/users/`
|
|
2269
|
+
- **What it does**: List this agent's end-users (the stable identities behind inbound principals) and each user's linked external connections. Connection metadata only — credential material is never returned.
|
|
2270
|
+
- **OpenAPI operationId**: `agent_applications_users_list`
|
|
2271
|
+
- **Path params**: `id`
|
|
2272
|
+
- **Query params**: None
|
|
2273
|
+
- **Response codes**: `200`
|
|
2274
|
+
- **Transport options**: None
|
|
2275
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
2276
|
+
|
|
2277
|
+
**Inputs**
|
|
2278
|
+
|
|
2279
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
2280
|
+
- Client transport options: None
|
|
2281
|
+
|
|
2282
|
+
**Outputs**
|
|
2283
|
+
|
|
2284
|
+
- Client return type: `{ count: number; results: ({ id: string; principal_kind: string; principal_id: string; metadata?: unknown; created_at: string; connections: ({ id: string; provider: string; scopes: (string)[]; state: string; subject?: s...`
|
|
2285
|
+
- OpenAPI response codes: `200`
|
|
2286
|
+
|
|
2287
|
+
```ts
|
|
2288
|
+
import posthog from "@utdk/posthog";
|
|
2289
|
+
|
|
2290
|
+
type AgentApplicationsUsersListInput = Parameters<typeof posthog.agentApplicationsUsersList> extends [infer T, ...unknown[]] ? T : undefined;
|
|
2291
|
+
type AgentApplicationsUsersListOutput = Awaited<ReturnType<typeof posthog.agentApplicationsUsersList>>;
|
|
2292
|
+
|
|
2293
|
+
const result: AgentApplicationsUsersListOutput = await posthog.agentApplicationsUsersList();
|
|
2294
|
+
|
|
2295
|
+
// Result shape (from schema): { count: number; results: ({ id: string; principal_kind: string; principal_id: string; metadata?: unknown; created_at: string; connections: ({ id: string; provider: string; scopes: (string)[]; state: string; subject?: s...
|
|
2296
|
+
```
|
|
2297
|
+
|
|
2298
|
+
### `posthog.agentApplicationsUsersConnectionDelete`
|
|
2299
|
+
|
|
2300
|
+
- **HTTP**: `DELETE /api/projects/{project_id}/agent_applications/{id}/users/{agent_user_id}/connections/{provider}/`
|
|
2301
|
+
- **What it does**: Revoke one of an end-user's linked connections. The credential is marked revoked (kept for audit), so the agent can no longer act as that user on the provider.
|
|
2302
|
+
- **OpenAPI operationId**: `agent_applications_users_connection_delete`
|
|
2303
|
+
- **Path params**: `agent_user_id`, `id`, `provider`
|
|
2304
|
+
- **Query params**: None
|
|
2305
|
+
- **Response codes**: `204`
|
|
2306
|
+
- **Transport options**: None
|
|
2307
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
2308
|
+
|
|
2309
|
+
**Inputs**
|
|
2310
|
+
|
|
2311
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
2312
|
+
- Client transport options: None
|
|
2313
|
+
|
|
2314
|
+
**Outputs**
|
|
2315
|
+
|
|
2316
|
+
- Client return type: `unknown`
|
|
2317
|
+
- OpenAPI response codes: `204`
|
|
2318
|
+
|
|
2319
|
+
```ts
|
|
2320
|
+
import posthog from "@utdk/posthog";
|
|
2321
|
+
|
|
2322
|
+
type AgentApplicationsUsersConnectionDeleteInput = Parameters<typeof posthog.agentApplicationsUsersConnectionDelete> extends [infer T, ...unknown[]] ? T : undefined;
|
|
2323
|
+
type AgentApplicationsUsersConnectionDeleteOutput = Awaited<ReturnType<typeof posthog.agentApplicationsUsersConnectionDelete>>;
|
|
2324
|
+
|
|
2325
|
+
const result: AgentApplicationsUsersConnectionDeleteOutput = await posthog.agentApplicationsUsersConnectionDelete();
|
|
2326
|
+
|
|
2327
|
+
// Result shape (from schema): unknown
|
|
2328
|
+
```
|
|
2329
|
+
|
|
2330
|
+
### `posthog.agentApplicationsModels`
|
|
2331
|
+
|
|
2332
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/models/`
|
|
2333
|
+
- **What it does**: Served-model catalog — each model's id, provider, context window, and USD-per-million-token pricing — plus the curated auto-level → model map. Project-agnostic; sourced from the AI gateway catalog. Powers the config UI model browser and the agent builder's model-choosing skill.
|
|
2334
|
+
- **OpenAPI operationId**: `agent_applications_models`
|
|
2335
|
+
- **Path params**: None
|
|
2336
|
+
- **Query params**: None
|
|
2337
|
+
- **Response codes**: `200`
|
|
2338
|
+
- **Transport options**: None
|
|
2339
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
2340
|
+
|
|
2341
|
+
**Inputs**
|
|
2342
|
+
|
|
2343
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
2344
|
+
- Client transport options: None
|
|
2345
|
+
|
|
2346
|
+
**Outputs**
|
|
2347
|
+
|
|
2348
|
+
- Client return type: `{ id: string; team_id: number; name: string; slug?: string; description?: string; live_revision: string | null; archived?: boolean; archived_at: string | null; created_by_id: number | null; created_by: { [key: string]: ...`
|
|
2349
|
+
- OpenAPI response codes: `200`
|
|
2350
|
+
|
|
2351
|
+
```ts
|
|
2352
|
+
import posthog from "@utdk/posthog";
|
|
2353
|
+
|
|
2354
|
+
type AgentApplicationsModelsInput = Parameters<typeof posthog.agentApplicationsModels> extends [infer T, ...unknown[]] ? T : undefined;
|
|
2355
|
+
type AgentApplicationsModelsOutput = Awaited<ReturnType<typeof posthog.agentApplicationsModels>>;
|
|
2356
|
+
|
|
2357
|
+
const result: AgentApplicationsModelsOutput = await posthog.agentApplicationsModels();
|
|
2358
|
+
|
|
2359
|
+
// Result shape (from schema): { id: string; team_id: number; name: string; slug?: string; description?: string; live_revision: string | null; archived?: boolean; archived_at: string | null; created_by_id: number | null; created_by: { [key: string]: ...
|
|
2360
|
+
```
|
|
2361
|
+
|
|
2362
|
+
### `posthog.agentApplicationsSpecSchema`
|
|
2363
|
+
|
|
2364
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_applications/spec_schema/`
|
|
2365
|
+
- **What it does**: The canonical JSON Schema for an agent `spec` — every field, type, enum, default, and the discriminated unions for `models` / `triggers[]` / `tools[]`, each with an inline description. Emitted from the same source the runner validates against (fields with a default are optional on write), so read it BEFORE composing a spec for create / revisions-spec-update instead of guessing the shape. Pass `section` to fetch just one part.
|
|
2366
|
+
- **OpenAPI operationId**: `agent_applications_spec_schema`
|
|
2367
|
+
- **Path params**: None
|
|
2368
|
+
- **Query params**: `section`
|
|
2369
|
+
- **Response codes**: `200`
|
|
2370
|
+
- **Transport options**: None
|
|
2371
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
2372
|
+
|
|
2373
|
+
**Inputs**
|
|
2374
|
+
|
|
2375
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
2376
|
+
- Client transport options: None
|
|
2377
|
+
|
|
2378
|
+
**Outputs**
|
|
2379
|
+
|
|
2380
|
+
- Client return type: `{ id: string; team_id: number; name: string; slug?: string; description?: string; live_revision: string | null; archived?: boolean; archived_at: string | null; created_by_id: number | null; created_by: { [key: string]: ...`
|
|
2381
|
+
- OpenAPI response codes: `200`
|
|
2382
|
+
|
|
2383
|
+
```ts
|
|
2384
|
+
import posthog from "@utdk/posthog";
|
|
2385
|
+
|
|
2386
|
+
type AgentApplicationsSpecSchemaInput = Parameters<typeof posthog.agentApplicationsSpecSchema> extends [infer T, ...unknown[]] ? T : undefined;
|
|
2387
|
+
type AgentApplicationsSpecSchemaOutput = Awaited<ReturnType<typeof posthog.agentApplicationsSpecSchema>>;
|
|
2388
|
+
|
|
2389
|
+
const result: AgentApplicationsSpecSchemaOutput = await posthog.agentApplicationsSpecSchema();
|
|
2390
|
+
|
|
2391
|
+
// Result shape (from schema): { id: string; team_id: number; name: string; slug?: string; description?: string; live_revision: string | null; archived?: boolean; archived_at: string | null; created_by_id: number | null; created_by: { [key: string]: ...
|
|
2392
|
+
```
|
|
2393
|
+
|
|
2394
|
+
### `posthog.agentFleetApprovalsList`
|
|
2395
|
+
|
|
2396
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_fleet/approvals/`
|
|
2397
|
+
- **What it does**: Approval-gated tool requests across every agent in this team. Team-admin only.
|
|
2398
|
+
- **OpenAPI operationId**: `agent_fleet_approvals_list`
|
|
2399
|
+
- **Path params**: None
|
|
2400
|
+
- **Query params**: `agent_id`, `limit`, `offset`, `state`
|
|
2401
|
+
- **Response codes**: `200`
|
|
2402
|
+
- **Transport options**: None
|
|
2403
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
2404
|
+
|
|
2405
|
+
**Inputs**
|
|
2406
|
+
|
|
2407
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
2408
|
+
- Client transport options: None
|
|
2409
|
+
|
|
2410
|
+
**Outputs**
|
|
2411
|
+
|
|
2412
|
+
- Client return type: `unknown`
|
|
2413
|
+
- OpenAPI response codes: `200`
|
|
2414
|
+
|
|
2415
|
+
```ts
|
|
2416
|
+
import posthog from "@utdk/posthog";
|
|
2417
|
+
|
|
2418
|
+
type AgentFleetApprovalsListInput = Parameters<typeof posthog.agentFleetApprovalsList> extends [infer T, ...unknown[]] ? T : undefined;
|
|
2419
|
+
type AgentFleetApprovalsListOutput = Awaited<ReturnType<typeof posthog.agentFleetApprovalsList>>;
|
|
2420
|
+
|
|
2421
|
+
const result: AgentFleetApprovalsListOutput = await posthog.agentFleetApprovalsList();
|
|
2422
|
+
|
|
2423
|
+
// Result shape (from schema): unknown
|
|
2424
|
+
```
|
|
2425
|
+
|
|
2426
|
+
### `posthog.agentFleetLiveSessions`
|
|
2427
|
+
|
|
2428
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_fleet/live_sessions/`
|
|
2429
|
+
- **What it does**: Live (non-terminal) sessions across every agent owned by this team, newest activity first.
|
|
2430
|
+
- **OpenAPI operationId**: `agent_fleet_live_sessions`
|
|
2431
|
+
- **Path params**: None
|
|
2432
|
+
- **Query params**: `limit`
|
|
2433
|
+
- **Response codes**: `200`
|
|
2434
|
+
- **Transport options**: None
|
|
2435
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
2436
|
+
|
|
2437
|
+
**Inputs**
|
|
2438
|
+
|
|
2439
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
2440
|
+
- Client transport options: None
|
|
2441
|
+
|
|
2442
|
+
**Outputs**
|
|
2443
|
+
|
|
2444
|
+
- Client return type: `{ results: ({ usage_total: { tokens_in: number; tokens_out: number; cache_read: number; cache_write: number; cost_input: number; cost_output: number; cost_cache_read: number; cost_cache_write: number; cost_total: number...`
|
|
2445
|
+
- OpenAPI response codes: `200`
|
|
2446
|
+
|
|
2447
|
+
```ts
|
|
2448
|
+
import posthog from "@utdk/posthog";
|
|
2449
|
+
|
|
2450
|
+
type AgentFleetLiveSessionsInput = Parameters<typeof posthog.agentFleetLiveSessions> extends [infer T, ...unknown[]] ? T : undefined;
|
|
2451
|
+
type AgentFleetLiveSessionsOutput = Awaited<ReturnType<typeof posthog.agentFleetLiveSessions>>;
|
|
2452
|
+
|
|
2453
|
+
const result: AgentFleetLiveSessionsOutput = await posthog.agentFleetLiveSessions();
|
|
2454
|
+
|
|
2455
|
+
// Result shape (from schema): { results: ({ usage_total: { tokens_in: number; tokens_out: number; cache_read: number; cache_write: number; cost_input: number; cost_output: number; cost_cache_read: number; cost_cache_write: number; cost_total: number...
|
|
2456
|
+
```
|
|
2457
|
+
|
|
2458
|
+
### `posthog.agentFleetStats`
|
|
2459
|
+
|
|
2460
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_fleet/stats/`
|
|
2461
|
+
- **What it does**: Roll-up stats across every agent owned by this team.
|
|
2462
|
+
- **OpenAPI operationId**: `agent_fleet_stats`
|
|
2463
|
+
- **Path params**: None
|
|
2464
|
+
- **Query params**: `since`
|
|
2465
|
+
- **Response codes**: `200`
|
|
2466
|
+
- **Transport options**: None
|
|
2467
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
2468
|
+
|
|
2469
|
+
**Inputs**
|
|
2470
|
+
|
|
2471
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
2472
|
+
- Client transport options: None
|
|
2473
|
+
|
|
2474
|
+
**Outputs**
|
|
2475
|
+
|
|
2476
|
+
- Client return type: `{ liveCount: number; sessionsInWindowCount: number; spendInWindowUsd: number; lastActivityAt: string | null; failedInWindowCount: number; pendingApprovalsCount: number }`
|
|
2477
|
+
- OpenAPI response codes: `200`
|
|
2478
|
+
|
|
2479
|
+
```ts
|
|
2480
|
+
import posthog from "@utdk/posthog";
|
|
2481
|
+
|
|
2482
|
+
type AgentFleetStatsInput = Parameters<typeof posthog.agentFleetStats> extends [infer T, ...unknown[]] ? T : undefined;
|
|
2483
|
+
type AgentFleetStatsOutput = Awaited<ReturnType<typeof posthog.agentFleetStats>>;
|
|
2484
|
+
|
|
2485
|
+
const result: AgentFleetStatsOutput = await posthog.agentFleetStats();
|
|
2486
|
+
|
|
2487
|
+
// Result shape (from schema): { liveCount: number; sessionsInWindowCount: number; spendInWindowUsd: number; lastActivityAt: string | null; failedInWindowCount: number; pendingApprovalsCount: number }
|
|
2488
|
+
```
|
|
2489
|
+
|
|
2490
|
+
### `posthog.agentNativeToolsList`
|
|
2491
|
+
|
|
2492
|
+
- **HTTP**: `GET /api/projects/{project_id}/agent_native_tools/`
|
|
2493
|
+
- **What it does**: Read-only catalog of every @posthog/* native tool the runner knows.
|
|
2494
|
+
- **OpenAPI operationId**: `agent_native_tools_list`
|
|
2495
|
+
- **Path params**: None
|
|
2496
|
+
- **Query params**: None
|
|
2497
|
+
- **Response codes**: `200`
|
|
2498
|
+
- **Transport options**: None
|
|
2499
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
2500
|
+
|
|
2501
|
+
**Inputs**
|
|
2502
|
+
|
|
2503
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
2504
|
+
- Client transport options: None
|
|
2505
|
+
|
|
2506
|
+
**Outputs**
|
|
2507
|
+
|
|
2508
|
+
- Client return type: `({ tools: ({ id: string; schema: { [key: string]: unknown } })[] })[]`
|
|
2509
|
+
- OpenAPI response codes: `200`
|
|
2510
|
+
|
|
2511
|
+
```ts
|
|
2512
|
+
import posthog from "@utdk/posthog";
|
|
2513
|
+
|
|
2514
|
+
type AgentNativeToolsListInput = Parameters<typeof posthog.agentNativeToolsList> extends [infer T, ...unknown[]] ? T : undefined;
|
|
2515
|
+
type AgentNativeToolsListOutput = Awaited<ReturnType<typeof posthog.agentNativeToolsList>>;
|
|
2516
|
+
|
|
2517
|
+
const result: AgentNativeToolsListOutput = await posthog.agentNativeToolsList();
|
|
2518
|
+
|
|
2519
|
+
// Result shape (from schema): ({ tools: ({ id: string; schema: { [key: string]: unknown } })[] })[]
|
|
2520
|
+
```
|
|
2521
|
+
|
|
2522
|
+
|
|
2523
|
+
<!-- prompt-hash:
|
|
2524
|
+
8c3694991a4c289225f05a4e8f1e098cc74d085a088d7dffd82f00d93797b7f8
|
|
2525
|
+
-->
|