From 5a2dff36c58fc3d516d3285bf74f266f6c4d0766 Mon Sep 17 00:00:00 2001 From: murashit Date: Fri, 10 Jul 2026 02:24:27 +0900 Subject: [PATCH] Update app-server bindings for Codex 0.144.0 Regenerate experimental app-server TypeScript bindings with Codex CLI 0.144.0 and bump the recorded tested CLI version. Add coverage for hook prompt turn-item mapping so the canonical turn-item display path is covered without requiring live Obsidian smoke validation. --- README.md | 2 +- src/generated/app-server/AuthMode.ts | 2 +- .../app-server/ImageGenerationItem.ts | 6 +++++ src/generated/app-server/WebSearchItem.ts | 6 +++++ src/generated/app-server/index.ts | 2 ++ .../app-server/v2/AppToolApproval.ts | 2 +- .../app-server/v2/LoginAccountParams.ts | 3 ++- src/generated/app-server/v2/LoginAppBrand.ts | 5 ++++ src/generated/app-server/v2/ThreadItem.ts | 6 ++--- src/generated/app-server/v2/index.ts | 1 + .../app-server/mappers/thread-stream.test.ts | 26 +++++++++++++++++++ 11 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 src/generated/app-server/ImageGenerationItem.ts create mode 100644 src/generated/app-server/WebSearchItem.ts create mode 100644 src/generated/app-server/v2/LoginAppBrand.ts diff --git a/README.md b/README.md index 640d6d45..e167faa3 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ Threads can be archived as Markdown notes with a configurable folder, filename t | ------------------------ | --------- | --------------------------------------------------------------------------------------------------- | | `manifest.minAppVersion` | `1.12.0` | Minimum Obsidian desktop version declared for plugin loading. | | `obsidian` API types | `1.12.3` | TypeScript API package used for compile-time checks; kept in the same minor as `manifest` baseline. | -| `codex.testedCliVersion` | `0.143.0` | Track app-server compatibility by Codex CLI minor version. | +| `codex.testedCliVersion` | `0.144.0` | Track app-server compatibility by Codex CLI minor version. | Codex Panel depends on the experimental `codex app-server` API. diff --git a/src/generated/app-server/AuthMode.ts b/src/generated/app-server/AuthMode.ts index 77bc037e..b2488761 100644 --- a/src/generated/app-server/AuthMode.ts +++ b/src/generated/app-server/AuthMode.ts @@ -5,4 +5,4 @@ /** * Authentication mode for OpenAI-backed providers. */ -export type AuthMode = "apikey" | "chatgpt" | "chatgptAuthTokens" | "agentIdentity" | "personalAccessToken" | "bedrockApiKey"; +export type AuthMode = "apikey" | "chatgpt" | "chatgptAuthTokens" | "headers" | "agentIdentity" | "personalAccessToken" | "bedrockApiKey"; diff --git a/src/generated/app-server/ImageGenerationItem.ts b/src/generated/app-server/ImageGenerationItem.ts new file mode 100644 index 00000000..26cd6285 --- /dev/null +++ b/src/generated/app-server/ImageGenerationItem.ts @@ -0,0 +1,6 @@ +// 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 { AbsolutePathBuf } from "./AbsolutePathBuf"; + +export type ImageGenerationItem = { id: string, status: string, revisedPrompt: string | null, result: string, savedPath?: AbsolutePathBuf, }; diff --git a/src/generated/app-server/WebSearchItem.ts b/src/generated/app-server/WebSearchItem.ts new file mode 100644 index 00000000..bc1e6d54 --- /dev/null +++ b/src/generated/app-server/WebSearchItem.ts @@ -0,0 +1,6 @@ +// 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 { WebSearchAction } from "./v2/WebSearchAction"; + +export type WebSearchItem = { id: string, query: string, action: WebSearchAction | null, }; diff --git a/src/generated/app-server/index.ts b/src/generated/app-server/index.ts index fb2f195f..e9695c17 100644 --- a/src/generated/app-server/index.ts +++ b/src/generated/app-server/index.ts @@ -43,6 +43,7 @@ export type { GitDiffToRemoteParams } from "./GitDiffToRemoteParams"; export type { GitDiffToRemoteResponse } from "./GitDiffToRemoteResponse"; export type { GitSha } from "./GitSha"; export type { ImageDetail } from "./ImageDetail"; +export type { ImageGenerationItem } from "./ImageGenerationItem"; export type { InitializeCapabilities } from "./InitializeCapabilities"; export type { InitializeParams } from "./InitializeParams"; export type { InitializeResponse } from "./InitializeResponse"; @@ -88,6 +89,7 @@ export type { Tool } from "./Tool"; export type { Verbosity } from "./Verbosity"; export type { WebSearchAction } from "./WebSearchAction"; export type { WebSearchContextSize } from "./WebSearchContextSize"; +export type { WebSearchItem } from "./WebSearchItem"; export type { WebSearchLocation } from "./WebSearchLocation"; export type { WebSearchMode } from "./WebSearchMode"; export type { WebSearchToolConfig } from "./WebSearchToolConfig"; diff --git a/src/generated/app-server/v2/AppToolApproval.ts b/src/generated/app-server/v2/AppToolApproval.ts index e92cd8e2..6704ef0f 100644 --- a/src/generated/app-server/v2/AppToolApproval.ts +++ b/src/generated/app-server/v2/AppToolApproval.ts @@ -2,4 +2,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type AppToolApproval = "auto" | "prompt" | "approve"; +export type AppToolApproval = "auto" | "prompt" | "writes" | "approve"; diff --git a/src/generated/app-server/v2/LoginAccountParams.ts b/src/generated/app-server/v2/LoginAccountParams.ts index e6f1e2ed..1606f167 100644 --- a/src/generated/app-server/v2/LoginAccountParams.ts +++ b/src/generated/app-server/v2/LoginAccountParams.ts @@ -1,8 +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 { LoginAppBrand } from "./LoginAppBrand"; -export type LoginAccountParams = { "type": "apiKey", apiKey: string, } | { "type": "chatgpt", codexStreamlinedLogin?: boolean, } | { "type": "chatgptDeviceCode" } | { "type": "chatgptAuthTokens", +export type LoginAccountParams = { "type": "apiKey", apiKey: string, } | { "type": "chatgpt", codexStreamlinedLogin?: boolean, useHostedLoginSuccessPage?: boolean, appBrand?: LoginAppBrand | null, } | { "type": "chatgptDeviceCode" } | { "type": "chatgptAuthTokens", /** * Access token (JWT) supplied by the client. * This token is used for backend API requests and email extraction. diff --git a/src/generated/app-server/v2/LoginAppBrand.ts b/src/generated/app-server/v2/LoginAppBrand.ts new file mode 100644 index 00000000..c06d12ff --- /dev/null +++ b/src/generated/app-server/v2/LoginAppBrand.ts @@ -0,0 +1,5 @@ +// 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. + +export type LoginAppBrand = "codex" | "chatgpt"; diff --git a/src/generated/app-server/v2/ThreadItem.ts b/src/generated/app-server/v2/ThreadItem.ts index c611ab07..a4453855 100644 --- a/src/generated/app-server/v2/ThreadItem.ts +++ b/src/generated/app-server/v2/ThreadItem.ts @@ -1,10 +1,11 @@ // 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 { AbsolutePathBuf } from "../AbsolutePathBuf"; +import type { ImageGenerationItem } from "../ImageGenerationItem"; import type { LegacyAppPathString } from "../LegacyAppPathString"; import type { MessagePhase } from "../MessagePhase"; import type { ReasoningEffort } from "../ReasoningEffort"; +import type { WebSearchItem } from "../WebSearchItem"; import type { JsonValue } from "../serde_json/JsonValue"; import type { CollabAgentState } from "./CollabAgentState"; import type { CollabAgentTool } from "./CollabAgentTool"; @@ -24,7 +25,6 @@ import type { MemoryCitation } from "./MemoryCitation"; import type { PatchApplyStatus } from "./PatchApplyStatus"; import type { SubAgentActivityKind } from "./SubAgentActivityKind"; import type { UserInput } from "./UserInput"; -import type { WebSearchAction } from "./WebSearchAction"; export type ThreadItem = { "type": "userMessage", id: string, clientId: string | null, content: Array, } | { "type": "hookPrompt", id: string, fragments: Array, } | { "type": "agentMessage", id: string, text: string, phase: MessagePhase | null, memoryCitation: MemoryCitation | null, } | { "type": "plan", id: string, text: string, } | { "type": "reasoning", id: string, summary: Array, content: Array, } | { "type": "commandExecution", id: string, /** @@ -105,4 +105,4 @@ reasoningEffort: ReasoningEffort | null, /** * Last known status of the target agents, when available. */ -agentsStates: { [key in string]?: CollabAgentState }, } | { "type": "subAgentActivity", id: string, kind: SubAgentActivityKind, agentThreadId: string, agentPath: string, } | { "type": "webSearch", id: string, query: string, action: WebSearchAction | null, } | { "type": "imageView", id: string, path: LegacyAppPathString, } | { "type": "sleep", id: string, durationMs: number, } | { "type": "imageGeneration", id: string, status: string, revisedPrompt: string | null, result: string, savedPath?: AbsolutePathBuf, } | { "type": "enteredReviewMode", id: string, review: string, } | { "type": "exitedReviewMode", id: string, review: string, } | { "type": "contextCompaction", id: string, }; +agentsStates: { [key in string]?: CollabAgentState }, } | { "type": "subAgentActivity", id: string, kind: SubAgentActivityKind, agentThreadId: string, agentPath: string, } | { "type": "webSearch" } & WebSearchItem | { "type": "imageView", id: string, path: LegacyAppPathString, } | { "type": "sleep", id: string, durationMs: number, } | { "type": "imageGeneration" } & ImageGenerationItem | { "type": "enteredReviewMode", id: string, review: string, } | { "type": "exitedReviewMode", id: string, review: string, } | { "type": "contextCompaction", id: string, }; diff --git a/src/generated/app-server/v2/index.ts b/src/generated/app-server/v2/index.ts index 2d46ae9a..f9c24fec 100644 --- a/src/generated/app-server/v2/index.ts +++ b/src/generated/app-server/v2/index.ts @@ -203,6 +203,7 @@ export type { ListMcpServerStatusParams } from "./ListMcpServerStatusParams"; export type { ListMcpServerStatusResponse } from "./ListMcpServerStatusResponse"; export type { LoginAccountParams } from "./LoginAccountParams"; export type { LoginAccountResponse } from "./LoginAccountResponse"; +export type { LoginAppBrand } from "./LoginAppBrand"; export type { LogoutAccountResponse } from "./LogoutAccountResponse"; export type { ManagedHooksRequirements } from "./ManagedHooksRequirements"; export type { MarketplaceAddParams } from "./MarketplaceAddParams"; diff --git a/tests/features/chat/app-server/mappers/thread-stream.test.ts b/tests/features/chat/app-server/mappers/thread-stream.test.ts index 83d8ea77..fee0a35b 100644 --- a/tests/features/chat/app-server/mappers/thread-stream.test.ts +++ b/tests/features/chat/app-server/mappers/thread-stream.test.ts @@ -233,6 +233,32 @@ describe("turn item conversion preserves app-server semantics", () => { }); }); + it("preserves hook prompt fragments as hook stream text", () => { + const item: TurnItem = { + type: "hookPrompt", + id: "hook-prompt-1", + fragments: [ + { text: "First hook prompt", hookRunId: "hook-run-1" }, + { text: "Second hook prompt", hookRunId: "hook-run-2" }, + ], + }; + + expect(threadStreamItemFromTurnItem(item, "t1")).toMatchObject({ + id: "hook-prompt-1", + kind: "hook", + role: "tool", + text: "First hook prompt\n\nSecond hook prompt", + turnId: "t1", + sourceItemId: "hook-prompt-1", + provenance: { + source: "appServer", + channel: "turnItem", + itemType: "hookPrompt", + itemId: "hook-prompt-1", + }, + }); + }); + it("formats structured plan progress as task progress", () => { expect( taskProgressThreadStreamItem("t1", "Working plan", [