mirror of
https://github.com/openai/codex.git
synced 2026-11-08 20:40:33 +00:00
app-server: add app/installed runtime snapshot API
This commit is contained in:
@@ -87,6 +87,26 @@
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"AppsInstalledParams": {
|
||||
"description": "Read the committed installed connector runtime snapshot.",
|
||||
"properties": {
|
||||
"reload": {
|
||||
"description": "When true, refresh workspace policy and, when Apps are permitted, atomically refresh and publish the hosted connector runtime snapshot first.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"threadId": {
|
||||
"description": "Optional loaded thread id used to evaluate effective app configuration.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"reload"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"AppsListParams": {
|
||||
"description": "EXPERIMENTAL - list available apps/connectors.",
|
||||
"properties": {
|
||||
@@ -5704,6 +5724,30 @@
|
||||
"title": "App/listRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"app/installed"
|
||||
],
|
||||
"title": "App/installedRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/AppsInstalledParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "App/installedRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
|
||||
+85
@@ -1093,6 +1093,30 @@
|
||||
"title": "App/listRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/v2/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"app/installed"
|
||||
],
|
||||
"title": "App/installedRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/v2/AppsInstalledParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "App/installedRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
@@ -6819,6 +6843,45 @@
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"AppsInstalledParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "Read the committed installed connector runtime snapshot.",
|
||||
"properties": {
|
||||
"reload": {
|
||||
"description": "When true, refresh workspace policy and, when Apps are permitted, atomically refresh and publish the hosted connector runtime snapshot first.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"threadId": {
|
||||
"description": "Optional loaded thread id used to evaluate effective app configuration.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"reload"
|
||||
],
|
||||
"title": "AppsInstalledParams",
|
||||
"type": "object"
|
||||
},
|
||||
"AppsInstalledResponse": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "The installed connectors in one committed runtime snapshot.",
|
||||
"properties": {
|
||||
"apps": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/v2/InstalledApp"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"apps"
|
||||
],
|
||||
"title": "AppsInstalledResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"AppsListParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "EXPERIMENTAL - list available apps/connectors.",
|
||||
@@ -11185,6 +11248,28 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"InstalledApp": {
|
||||
"description": "Installed connector runtime state.",
|
||||
"properties": {
|
||||
"callable": {
|
||||
"description": "Whether the connector is enabled and has a non-synthetic, model-visible tool allowed by effective MCP and app/tool policy in the committed runtime snapshot.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enabled": {
|
||||
"description": "Effective enabled state after applying global, workspace, local, and managed configuration at read time.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"callable",
|
||||
"enabled",
|
||||
"id"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"InternalChatMessageMetadataPassthrough": {
|
||||
"description": "Internal Responses API passthrough metadata copied into underlying chat messages.\n\nResponses API strongly types this payload. Do not modify it without first getting API approval and making the corresponding Responses API change.",
|
||||
"properties": {
|
||||
|
||||
+85
@@ -945,6 +945,45 @@
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"AppsInstalledParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "Read the committed installed connector runtime snapshot.",
|
||||
"properties": {
|
||||
"reload": {
|
||||
"description": "When true, refresh workspace policy and, when Apps are permitted, atomically refresh and publish the hosted connector runtime snapshot first.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"threadId": {
|
||||
"description": "Optional loaded thread id used to evaluate effective app configuration.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"reload"
|
||||
],
|
||||
"title": "AppsInstalledParams",
|
||||
"type": "object"
|
||||
},
|
||||
"AppsInstalledResponse": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "The installed connectors in one committed runtime snapshot.",
|
||||
"properties": {
|
||||
"apps": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/InstalledApp"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"apps"
|
||||
],
|
||||
"title": "AppsInstalledResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"AppsListParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "EXPERIMENTAL - list available apps/connectors.",
|
||||
@@ -2124,6 +2163,30 @@
|
||||
"title": "App/listRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"app/installed"
|
||||
],
|
||||
"title": "App/installedRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/AppsInstalledParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "App/installedRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
@@ -7589,6 +7652,28 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"InstalledApp": {
|
||||
"description": "Installed connector runtime state.",
|
||||
"properties": {
|
||||
"callable": {
|
||||
"description": "Whether the connector is enabled and has a non-synthetic, model-visible tool allowed by effective MCP and app/tool policy in the committed runtime snapshot.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enabled": {
|
||||
"description": "Effective enabled state after applying global, workspace, local, and managed configuration at read time.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"callable",
|
||||
"enabled",
|
||||
"id"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"InternalChatMessageMetadataPassthrough": {
|
||||
"description": "Internal Responses API passthrough metadata copied into underlying chat messages.\n\nResponses API strongly types this payload. Do not modify it without first getting API approval and making the corresponding Responses API change.",
|
||||
"properties": {
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "Read the committed installed connector runtime snapshot.",
|
||||
"properties": {
|
||||
"reload": {
|
||||
"description": "When true, refresh workspace policy and, when Apps are permitted, atomically refresh and publish the hosted connector runtime snapshot first.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"threadId": {
|
||||
"description": "Optional loaded thread id used to evaluate effective app configuration.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"reload"
|
||||
],
|
||||
"title": "AppsInstalledParams",
|
||||
"type": "object"
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"definitions": {
|
||||
"InstalledApp": {
|
||||
"description": "Installed connector runtime state.",
|
||||
"properties": {
|
||||
"callable": {
|
||||
"description": "Whether the connector is enabled and has a non-synthetic, model-visible tool allowed by effective MCP and app/tool policy in the committed runtime snapshot.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enabled": {
|
||||
"description": "Effective enabled state after applying global, workspace, local, and managed configuration at read time.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"callable",
|
||||
"enabled",
|
||||
"id"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"description": "The installed connectors in one committed runtime snapshot.",
|
||||
"properties": {
|
||||
"apps": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/InstalledApp"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"apps"
|
||||
],
|
||||
"title": "AppsInstalledResponse",
|
||||
"type": "object"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,17 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
/**
|
||||
* Read the committed installed connector runtime snapshot.
|
||||
*/
|
||||
export type AppsInstalledParams = {
|
||||
/**
|
||||
* Optional loaded thread id used to evaluate effective app configuration.
|
||||
*/
|
||||
threadId?: string | null,
|
||||
/**
|
||||
* When true, refresh workspace policy and, when Apps are permitted, atomically refresh and
|
||||
* publish the hosted connector runtime snapshot first.
|
||||
*/
|
||||
reload: boolean, };
|
||||
@@ -0,0 +1,9 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { InstalledApp } from "./InstalledApp";
|
||||
|
||||
/**
|
||||
* The installed connectors in one committed runtime snapshot.
|
||||
*/
|
||||
export type AppsInstalledResponse = { apps: Array<InstalledApp>, };
|
||||
@@ -0,0 +1,18 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
/**
|
||||
* Installed connector runtime state.
|
||||
*/
|
||||
export type InstalledApp = { id: string,
|
||||
/**
|
||||
* Effective enabled state after applying global, workspace, local, and managed configuration
|
||||
* at read time.
|
||||
*/
|
||||
enabled: boolean,
|
||||
/**
|
||||
* Whether the connector is enabled and has a non-synthetic, model-visible tool allowed by
|
||||
* effective MCP and app/tool policy in the committed runtime snapshot.
|
||||
*/
|
||||
callable: boolean, };
|
||||
@@ -30,6 +30,8 @@ export type { AppToolsConfig } from "./AppToolsConfig";
|
||||
export type { ApprovalsReviewer } from "./ApprovalsReviewer";
|
||||
export type { AppsConfig } from "./AppsConfig";
|
||||
export type { AppsDefaultConfig } from "./AppsDefaultConfig";
|
||||
export type { AppsInstalledParams } from "./AppsInstalledParams";
|
||||
export type { AppsInstalledResponse } from "./AppsInstalledResponse";
|
||||
export type { AppsListParams } from "./AppsListParams";
|
||||
export type { AppsListResponse } from "./AppsListResponse";
|
||||
export type { AskForApproval } from "./AskForApproval";
|
||||
@@ -186,6 +188,7 @@ export type { HookTrustStatus } from "./HookTrustStatus";
|
||||
export type { HooksListEntry } from "./HooksListEntry";
|
||||
export type { HooksListParams } from "./HooksListParams";
|
||||
export type { HooksListResponse } from "./HooksListResponse";
|
||||
export type { InstalledApp } from "./InstalledApp";
|
||||
export type { ItemCompletedNotification } from "./ItemCompletedNotification";
|
||||
export type { ItemGuardianApprovalReviewCompletedNotification } from "./ItemGuardianApprovalReviewCompletedNotification";
|
||||
export type { ItemGuardianApprovalReviewStartedNotification } from "./ItemGuardianApprovalReviewStartedNotification";
|
||||
|
||||
@@ -734,6 +734,11 @@ client_request_definitions! {
|
||||
serialization: None,
|
||||
response: v2::AppsListResponse,
|
||||
},
|
||||
AppsInstalled => "app/installed" {
|
||||
params: v2::AppsInstalledParams,
|
||||
serialization: None,
|
||||
response: v2::AppsInstalledResponse,
|
||||
},
|
||||
// File system requests are intentionally concurrent. Desktop already treats local
|
||||
// file system operations as concurrent, and app-server remote fs mirrors that model.
|
||||
FsReadFile => "fs/readFile" {
|
||||
@@ -3005,6 +3010,68 @@ mod tests {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn serialize_installed_apps() -> Result<()> {
|
||||
let request = ClientRequest::AppsInstalled {
|
||||
request_id: RequestId::Integer(9),
|
||||
params: v2::AppsInstalledParams::default(),
|
||||
};
|
||||
assert_eq!(
|
||||
json!({
|
||||
"method": "app/installed",
|
||||
"id": 9,
|
||||
"params": {
|
||||
"threadId": null,
|
||||
"reload": false
|
||||
}
|
||||
}),
|
||||
serde_json::to_value(&request)?,
|
||||
);
|
||||
|
||||
let reload_request = ClientRequest::AppsInstalled {
|
||||
request_id: RequestId::Integer(10),
|
||||
params: v2::AppsInstalledParams {
|
||||
thread_id: Some("thread-1".to_string()),
|
||||
reload: true,
|
||||
},
|
||||
};
|
||||
assert_eq!(
|
||||
json!({
|
||||
"method": "app/installed",
|
||||
"id": 10,
|
||||
"params": {
|
||||
"threadId": "thread-1",
|
||||
"reload": true
|
||||
}
|
||||
}),
|
||||
serde_json::to_value(&reload_request)?,
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn serialize_installed_apps_response() -> Result<()> {
|
||||
let response = v2::AppsInstalledResponse {
|
||||
apps: vec![v2::InstalledApp {
|
||||
id: "demo-app".to_string(),
|
||||
enabled: false,
|
||||
callable: false,
|
||||
}],
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
json!({
|
||||
"apps": [{
|
||||
"id": "demo-app",
|
||||
"enabled": false,
|
||||
"callable": false
|
||||
}]
|
||||
}),
|
||||
serde_json::to_value(response)?,
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn serialize_environment_add() -> Result<()> {
|
||||
let request = ClientRequest::EnvironmentAdd {
|
||||
|
||||
@@ -24,6 +24,41 @@ pub struct AppsListParams {
|
||||
pub force_refetch: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
/// Read the committed installed connector runtime snapshot.
|
||||
pub struct AppsInstalledParams {
|
||||
/// Optional loaded thread id used to evaluate effective app configuration.
|
||||
#[ts(optional = nullable)]
|
||||
pub thread_id: Option<String>,
|
||||
/// When true, refresh workspace policy and, when Apps are permitted, atomically refresh and
|
||||
/// publish the hosted connector runtime snapshot first.
|
||||
pub reload: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
/// Installed connector runtime state.
|
||||
pub struct InstalledApp {
|
||||
pub id: String,
|
||||
/// Effective enabled state after applying global, workspace, local, and managed configuration
|
||||
/// at read time.
|
||||
pub enabled: bool,
|
||||
/// Whether the connector is enabled and has a non-synthetic, model-visible tool allowed by
|
||||
/// effective MCP and app/tool policy in the committed runtime snapshot.
|
||||
pub callable: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
/// The installed connectors in one committed runtime snapshot.
|
||||
pub struct AppsInstalledResponse {
|
||||
pub apps: Vec<InstalledApp>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
|
||||
Reference in New Issue
Block a user