diff --git a/.gitignore b/.gitignore index 9012af483..c8059bfec 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,8 @@ __pycache__/ /.agents/ /.issue-agent/ /ISSUE_AGENT.md + +# Documentation site build output. +/apps/docs/.next/ +/apps/docs/.source/ +/apps/docs/tsconfig.tsbuildinfo diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bf56154e7..b32f49e9c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3665,3 +3665,12 @@ unchanged. Persisted credential encryption domains and native-session resume key also remain stable so existing data can be decrypted and Sessions can resume. Conversion inputs, retirement diagnostics and historical evidence must still name the identifiers they reject or migrate; current examples use the new names. + + +Core administration error details are scoped by the `/core/v1` router writer mark, +not a request path test. Use `writeCoreError` with typed `CoreErrorDetails` values +and document fixed keys in `contracts/agents-api/core-errors.md` when adding a +code. Include only safe Core-owned facts; never pass submitted values, secrets, +native text or provider bodies. Invalid/empty details are omitted. Preserve the +public and machine error serializers, observer callbacks and streaming interfaces. +The Core client ignores malformed optional details and never retries a mutation. diff --git a/Makefile b/Makefile index 6d6b7e414..b1e3112bf 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ SWAG_VERSION ?= v1.16.4 help: @printf '%s\n' 'make build-agents-api Build standalone Core commands' 'make build-daemon Build the execution daemon' 'make check Run Core, persistence and runtime checks' 'See README.md for runtime prerequisites and deployment.' -check: check-names check-distribution check-database check-sqlc check-go check-microsandbox-provider check-agents-api check-claude-sdk check-web check-mcode-harness check-agents-executor +check: check-docs check-names check-distribution check-database check-sqlc check-go check-microsandbox-provider check-agents-api check-claude-sdk check-web check-mcode-harness check-agents-executor @printf 'OpenAgentCore checks passed.\n' .PHONY: check-names @@ -145,3 +145,7 @@ build-e2b-provider: check-e2b-provider: PYTHONDONTWRITEBYTECODE=1 $${OAC_TEST_E2B_SDK_PYTHON:-python3} -m unittest discover -s services/agents-api/deploy/e2b -p '*_test.py' PYTHONDONTWRITEBYTECODE=1 $${OAC_TEST_E2B_SDK_PYTHON:-python3} -m unittest discover -s services/agents-api/tools/e2b-provider -p '*_test.py' + +.PHONY: check-docs +check-docs: node-deps + pnpm check:docs diff --git a/apps/docs/FOLLOW-UP.md b/apps/docs/FOLLOW-UP.md new file mode 100644 index 000000000..232f913c1 --- /dev/null +++ b/apps/docs/FOLLOW-UP.md @@ -0,0 +1,24 @@ +# Feature integration follow-up + +This candidate documents the actual maintenance and drain model at source +`75bf4484ba957344ae374354858bbdfe104f5c4f`. It is not final documentation for design 50. +The Core error-envelope foundation is included; the later configuration validators and +diagnostic endpoints are not. Do not replace current procedures with the planned +behavior before the features land. + +| Feature dependency | Site pages to reconcile | Source and verification work | +| --- | --- | --- | +| Reset replaces maintenance (design 50 PR-R) | configure, hosted-providers, troubleshooting, admin-api, observability, API reference/core | Regenerate the canonical guides and management contract; describe reset admission, cleanup, failures, archive preconditions and offline-node limits from merged code. Remove retired maintenance instructions only after their replacement exists. | +| Online generations and E2B changes (design 50 PR-G) | configure, hosted-providers, troubleshooting, execution-model, API reference/core | Document actual generation/rollout states, the supported change matrix and existing-sandbox behavior. Verify PUT examples against the final contract. | +| Node update protocol (design 50 PR-N) | hosted-providers, troubleshooting, API reference/machine | Explain the implemented update command, old-node handling and ownership preservation. Do not claim an update command now. | +| Later configuration/error changes (design 40 and remaining installer work) | install, configure, troubleshooting, quickstart | Regenerate current configuration fields and revise diagnostics against merged code; keep secrets out of examples. | +| Final feature assembly | every Chinese reading note, execution-model diagram, all generated references | Review translations against regenerated English, verify source provenance and links, run contract/route/copy/fact checks, typecheck/build, local browser review and the repository gate. | + +English guides are rendered from repository sources. Chinese pages are explicitly +labelled reading notes, not complete translations; expand them only against the final +source procedures. API tag pages use the default-language fallback. Release publication, +remote deployment and preview replacement are outside this reconciliation task. + +The source Web guide still carries a pre-rename screenshot. This site copies the +approved current Web onboarding Monitor image instead, with its own source hash; +refresh that mapping when the canonical guide image is updated. diff --git a/apps/docs/README.md b/apps/docs/README.md new file mode 100644 index 000000000..a526c4fa0 --- /dev/null +++ b/apps/docs/README.md @@ -0,0 +1,48 @@ +# OpenAgentCore documentation site + +A separate Next.js/Fumadocs documentation app. It starts no Core, database or Runtime. +English is served at `/`; Chinese reading notes at `/zh`, with English fallback for +API tag pages. The existing preview is not part of this checkout. + +The application reference reads the upstream-constrained public schema. Administration +and machine references read their own local generated contracts. All three repository +files currently declare Swagger 2.0; rendering supports Swagger 2 and OpenAPI 3. +The documentation projection uses OpenAPI 3.1 null unions (including nullable references +and compositions). Normalization changes documentation servers and bearer presentation, preserving operation +prose, parameters, response schemas and credential boundaries. Examples use a reserved +domain. The reference is read-only and must not collect keys or send execution requests. + +English guides are generated from the canonical repository docs, not maintained as a +second installation manual. Edit those sources first, update the Chinese reading notes +in [guides.json](scripts/guides.json), then regenerate. Source/output hashes fail when +copies drift; operation and route checks detect missing or mixed API surfaces. + +From the repository root: + +```sh +pnpm install --frozen-lockfile +pnpm --dir apps/docs generate +pnpm --dir apps/docs verify +pnpm --dir apps/docs test +pnpm --dir apps/docs typecheck +pnpm --dir apps/docs build +pnpm --dir apps/docs start --port 4275 +``` + +The route verifier uses the declared `js-yaml` dependency and Python standard library +only; no ambient PyYAML installation is required. Python checks honor +`OAC_TEST_OFFICIAL_SDK_PYTHON` when set, otherwise `python3`, and run with `-S` +to keep site packages out of the gate. + +`make check-docs` runs the focused gate and is included in `make check`. After starting +the built site, run `pnpm --dir apps/docs check:site http://127.0.0.1:4275` and inspect +both locales in a browser with `pnpm --dir apps/docs check:browser http://127.0.0.1:4275`. +The check uses installed Playwright Chromium (or `DOCS_BROWSER_EXECUTABLE`), checks +for credential/request controls and external traffic, and accepts only a local origin. +Set `DOCS_SITE_ORIGIN` only when preparing actual publication. +Generation links to the recorded source revision; update that revision after rebasing +onto later canonical guide changes. Never point samples at an actual deployment by default. + +[Feature follow-up inventory](FOLLOW-UP.md) lists the reset and online-generation +paragraphs that must be reconciled after those implementations land. This candidate +cannot establish final documentation acceptance for those unfinished features. diff --git a/apps/docs/app/[lang]/[[...slug]]/page.tsx b/apps/docs/app/[lang]/[[...slug]]/page.tsx new file mode 100644 index 000000000..941dd8097 --- /dev/null +++ b/apps/docs/app/[lang]/[[...slug]]/page.tsx @@ -0,0 +1,78 @@ +import type { Metadata } from "next" +import { notFound } from "next/navigation" +import { ImageZoom } from "fumadocs-ui/components/image-zoom" +import defaultMdxComponents from "fumadocs-ui/mdx" +import { DocsBody, DocsDescription, DocsPage, DocsTitle } from "fumadocs-ui/page" +import { APIPage } from "@/components/api-page" +import { LocaleLink } from "@/components/locale-link" +import { i18n, type Lang } from "@/lib/i18n" +import { docsAlternates } from "@/lib/site" +import { source } from "@/lib/source" + +function asLang(value: string): Lang { + if (!(i18n.languages as readonly string[]).includes(value)) notFound() + return value as Lang +} + +function pageSlug(slug?: string[]) { + return slug ?? [] +} + +export default async function DocsPageRoute({ + params, +}: { + params: Promise<{ lang: string; slug?: string[] }> +}) { + const { lang: rawLang, slug } = await params + const lang = asLang(rawLang) + const page = source.getPage(pageSlug(slug), lang) + if (!page) notFound() + + const MDX = page.data.body + return ( + + {page.data.title} + {page.data.description} + + , + }} + /> + + + ) +} + +export function generateStaticParams() { + return source.generateParams() +} + +export async function generateMetadata({ + params, +}: { + params: Promise<{ lang: string; slug?: string[] }> +}): Promise { + const { lang: rawLang, slug } = await params + const slugs = pageSlug(slug) + const page = source.getPage(slugs, asLang(rawLang)) + if (!page) return {} + return { + title: page.data.title, + description: page.data.description, + // Declare the translations as alternates of one article, and name the + // canonical URL, so search engines do not index the English and Chinese + // pages as duplicates of each other. + alternates: docsAlternates(slugs), + } +} diff --git a/apps/docs/app/[lang]/docs-providers.tsx b/apps/docs/app/[lang]/docs-providers.tsx new file mode 100644 index 000000000..f7b40a7e4 --- /dev/null +++ b/apps/docs/app/[lang]/docs-providers.tsx @@ -0,0 +1,77 @@ +"use client" + +import Image from "next/image" +import Link from "next/link" +import { useParams, usePathname, useRouter } from "next/navigation" +import { FrameworkProvider, type Framework } from "fumadocs-core/framework" +import { RootProvider } from "fumadocs-ui/provider/base" +import { useCallback, type ReactNode } from "react" +import { i18n, type Lang } from "@/lib/i18n" + +const locales = [ + { name: "English", locale: "en" }, + { name: "中文", locale: "zh" }, +] + +const translations = { + en: { + toc: "On this page", + chooseLanguage: "Choose language", + nextPage: "Next page", + previousPage: "Previous page", + }, + zh: { + toc: "本页目录", + chooseLanguage: "选择语言", + nextPage: "下一页", + previousPage: "上一页", + }, +} as const + +function isLocale(segment: string | undefined): boolean { + return Boolean(segment) && (i18n.languages as readonly string[]).includes(segment as string) +} + +function pathForLocale(pathname: string, locale: string) { + const segments = pathname.split("/").filter(Boolean) + // Drop a leading locale segment, whichever language it names — matching on a + // literal "en"/"zh" pair here would silently break when a language is added. + if (isLocale(segments[0])) segments.shift() + const rest = segments.join("/") + if (locale === i18n.defaultLanguage) return rest ? `/${rest}` : "/" + return rest ? `/${locale}/${rest}` : `/${locale}` +} + +export function DocsProviders({ lang, children }: { lang: Lang; children: ReactNode }) { + const router = useRouter() + const pathname = pathForLocale(usePathname(), lang) + // Navigation must use the public path during both SSR and hydration. + const usePublicPathname = useCallback(() => pathname, [pathname]) + + return ( + + router.push(pathForLocale(pathname, locale)), + }} + > + {children} + + + ) +} diff --git a/apps/docs/app/[lang]/layout.tsx b/apps/docs/app/[lang]/layout.tsx new file mode 100644 index 000000000..91e648c52 --- /dev/null +++ b/apps/docs/app/[lang]/layout.tsx @@ -0,0 +1,54 @@ +import "../global.css" +import type { Metadata } from "next" +import { notFound } from "next/navigation" +import type { ReactNode } from "react" +import { DocsLayout } from "fumadocs-ui/layouts/docs" +import { baseOptions } from "../layout.config" +import { source } from "@/lib/source" +import { i18n, type Lang } from "@/lib/i18n" +import { DocsProviders } from "./docs-providers" + +export const metadata: Metadata = { + title: { + template: "%s | OpenAgentCore Docs", + default: "OpenAgentCore Docs", + }, + description: "Documentation for OpenAgentCore.", +} + +export function generateStaticParams() { + return i18n.languages.map((lang) => ({ lang })) +} + +export default async function LangLayout({ + params, + children, +}: { + params: Promise<{ lang: string }> + children: ReactNode +}) { + const { lang: rawLang } = await params + if (!(i18n.languages as readonly string[]).includes(rawLang)) notFound() + const lang = rawLang as Lang + + return ( + + {/* Browser extensions may add attributes before React hydrates the body. */} + + + + {children} + + + + + ) +} diff --git a/apps/docs/app/global.css b/apps/docs/app/global.css new file mode 100644 index 000000000..40503ed92 --- /dev/null +++ b/apps/docs/app/global.css @@ -0,0 +1,103 @@ +@import "tailwindcss"; +@import "fumadocs-ui/css/neutral.css"; +@import "fumadocs-ui/css/preset.css"; +@import "fumadocs-openapi/css/preset.css"; + +:root { + --color-fd-primary: hsl(240 5.9% 10%); +} + +/* Keep the active navigation item readable in dark mode. The neutral theme + defines a light primary color for dark surfaces; this override must be more + specific than the root token declared above. */ +.dark { + --color-fd-primary: hsl(0 0% 98%); + --color-fd-primary-foreground: hsl(240 5.9% 10%); +} + +body { + font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", + "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; +} + +/* Medium weight maps to regular in common CJK fonts. */ +.prose :where(strong):not(:where(.not-prose, .not-prose *)) { + font-weight: 700; +} + +.prose pre { + min-width: 0; + width: 100%; +} + +/* Code blocks wrap instead of scrolling sideways. */ +.prose pre, +.prose pre code { + white-space: pre-wrap; + overflow-wrap: anywhere; +} + +/* Inline code wraps only when a token cannot fit on a line of its own. + `overflow-wrap: anywhere` also reduces the element's min-content width to + roughly one character, and the automatic table layout then treats a column + as shrinkable to that width: a five-column table collapsed the first column + to 49px and split `environment.type` across five lines. `break-word` breaks + a long token as a last resort without affecting intrinsic sizing, so a + column keeps at least its longest parameter. */ +.prose :not(pre) > code { + white-space: pre-wrap; + overflow-wrap: break-word; +} + +/* Give every table column a readable floor. The minimum content width of a + column that holds only Chinese text is about one character, while a column + holding a parameter such as `OAC_DATABASE_URL` cannot shrink below + that parameter. The automatic layout satisfies the wider columns first and + can crush the Chinese one to about four characters per line. Five columns of + 7rem still fit the narrowest content area the layout produces. */ +.prose table :is(th, td) { + min-width: 7rem; +} + +/* Make the page-tree separators read as navigation groups, not page links. */ +#nd-sidebar [data-radix-scroll-area-viewport] p { + width: 100%; + margin-top: 1.25rem; + margin-bottom: 0.5rem; + padding: 0.35rem 0.5rem; + border-bottom: 1px solid var(--color-fd-border); + color: var(--color-fd-muted-foreground); + font-size: 0.7rem; + font-weight: 700; + letter-spacing: 0; + line-height: 1.25rem; +} + +#nd-sidebar [data-radix-scroll-area-viewport] p:first-of-type { + margin-top: 0; +} + +#nd-sidebar [data-radix-scroll-area-viewport] a[href^="/"] { + min-height: 2.25rem; + font-size: 0.875rem; +} + +/* Keep the language menu compact inside the sidebar and on narrow screens. */ +[role="dialog"][data-side] { + width: min(11rem, calc(100vw - 2rem)); + min-width: 0 !important; + /* Radix anchors this bottom-left menu at x=0; keep it off the viewport edge. */ + margin-left: 0.75rem; +} + +[role="dialog"][data-side] button { + width: 100%; +} + +/* Text selection: tint the background with the theme's primary color and keep + the original text color, so contrast is inherited from body text in both + themes. Forcing --color-fd-primary-foreground here previously produced white + text on a mid-gray highlight in light mode. */ +::selection { + background: color-mix(in srgb, var(--color-fd-primary) 22%, transparent); +} diff --git a/apps/docs/app/icon.png b/apps/docs/app/icon.png new file mode 100644 index 000000000..83ad57715 Binary files /dev/null and b/apps/docs/app/icon.png differ diff --git a/apps/docs/app/layout.config.tsx b/apps/docs/app/layout.config.tsx new file mode 100644 index 000000000..68f3bf2c9 --- /dev/null +++ b/apps/docs/app/layout.config.tsx @@ -0,0 +1,11 @@ +import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared" + +export const baseOptions: BaseLayoutProps = { + i18n: true, + nav: { + title: "OpenAgentCore Docs", + }, + searchToggle: { + enabled: false, + }, +} diff --git a/apps/docs/app/not-found.tsx b/apps/docs/app/not-found.tsx new file mode 100644 index 000000000..fa0686507 --- /dev/null +++ b/apps/docs/app/not-found.tsx @@ -0,0 +1,69 @@ +"use client" + +import Link from "next/link" +import { usePathname } from "next/navigation" +import { i18n } from "@/lib/i18n" + +const COPY = { + en: { + title: "Page not found", + body: "The page you are looking for does not exist, or it moved when the manual was reorganised.", + back: "Back to the manual", + }, + zh: { + title: "页面不存在", + body: "你访问的页面不存在,或已随手册改版移动到别处。", + back: "返回手册首页", + }, +} as const + +/** + * 404 for the whole site. Two things about its placement are deliberate. + * + * It lives at the app root, not at `app/[lang]/`. A `not-found` boundary inside + * the segment that also holds the root layout is never compiled as a boundary, + * so the version that used to sit there was dead code: every 404 got Next's + * built-in notice instead. + * + * It is a client component that reads the language from the URL. Taking the + * language from the request on the server — `headers()`, or any other + * request-scoped API — opts *every sibling route* out of static generation, + * because the boundary belongs to the `[lang]/[[...slug]]` render tree. That is + * not a small regression: it made all 102 docs pages re-render per request, and + * the generated API reference pages carry whole OpenAPI surfaces, so a single + * navigation took two to three seconds instead of thirty milliseconds. + * + * The cost of the trade is that this notice arrives with hydration rather than + * in the first response, and outside the docs chrome: without a root layout + * Next renders a root `not-found` in its own shell. A 404 is `noindex` and a + * dead end, so paying there to keep every real page prerendered is the right + * way round. + * + * If this moves back to the server, `pnpm build` must still write prerendered + * `.html` files under `.next/server/app/en/` — the build log reporting + * `● (SSG)` is not sufficient, it says that either way. + */ +export default function NotFound() { + const pathname = usePathname() + const first = pathname.split("/").filter(Boolean)[0] + const locale = + first && (i18n.languages as readonly string[]).includes(first) + ? first + : i18n.defaultLanguage + + const text = COPY[locale as keyof typeof COPY] ?? COPY.en + const home = locale === i18n.defaultLanguage ? "/" : `/${locale}` + + return ( +
+

{text.title}

+

{text.body}

+ + {text.back} + +
+ ) +} diff --git a/apps/docs/app/sitemap.ts b/apps/docs/app/sitemap.ts new file mode 100644 index 000000000..0600f3c8f --- /dev/null +++ b/apps/docs/app/sitemap.ts @@ -0,0 +1,48 @@ +import type { MetadataRoute } from "next" +import { i18n } from "@/lib/i18n" +import { absoluteDocsUrl } from "@/lib/site" +import { source } from "@/lib/source" + +/** + * Sitemap for the manual, built from Fumadocs' page list at build time. + * + * One entry per logical page: every language variant of a page is declared as + * an hreflang alternate of the same entry, so a search engine reads the English + * and Chinese pages as one article in two languages rather than as duplicates. + */ +export default function sitemap(): MetadataRoute.Sitemap { + // Collapse the language variants into one group per slug. + const bySlug = new Map>() + + for (const { language, pages } of source.getLanguages()) { + for (const page of pages) { + const slugKey = page.slugs.join("/") + const languages = bySlug.get(slugKey) ?? new Map() + languages.set(language, page.url) + bySlug.set(slugKey, languages) + } + } + + const entries: MetadataRoute.Sitemap = [] + + for (const languages of bySlug.values()) { + // Canonical is the default language when it exists, otherwise the first + // translation available. + const canonicalRelative = + languages.get(i18n.defaultLanguage) ?? languages.values().next().value + if (!canonicalRelative) continue + + const alternates: Record = {} + for (const [lang, relative] of languages) { + alternates[lang] = absoluteDocsUrl(relative) + } + alternates["x-default"] = absoluteDocsUrl(canonicalRelative) + + entries.push({ + url: absoluteDocsUrl(canonicalRelative), + alternates: { languages: alternates }, + }) + } + + return entries +} \ No newline at end of file diff --git a/apps/docs/components/api-page.tsx b/apps/docs/components/api-page.tsx new file mode 100644 index 000000000..3976f2a65 --- /dev/null +++ b/apps/docs/components/api-page.tsx @@ -0,0 +1,13 @@ +import { APIPage as OpenAPIPage, type ApiPageProps } from "fumadocs-openapi/ui" +import { loadSurface } from "@/lib/openapi" + +// Registered as `APIPage` for the MDX components map. The generated pages name +// their API surface by id; the contract itself is loaded through the server +// instance so the rendered schema and the generated prose stay in step. +export async function APIPage({ + document, + ...props +}: Omit & { document: string }) { + // References never collect credentials or dispatch requests from the browser. + return +} diff --git a/apps/docs/components/locale-link.tsx b/apps/docs/components/locale-link.tsx new file mode 100644 index 000000000..136081f81 --- /dev/null +++ b/apps/docs/components/locale-link.tsx @@ -0,0 +1,24 @@ +import type { AnchorHTMLAttributes, ReactNode } from "react" +import { i18n } from "@/lib/i18n" +import { prefixLocale } from "@/lib/locale-link" + +type LocaleLinkProps = AnchorHTMLAttributes & { + lang: string + children?: ReactNode +} + +/** + * MDX anchor override for the docs routes. + * + * The active language is passed in by the route, which knows it from the URL, + * so no client-side context is required and this stays a server component. It + * renders the same plain anchor Fumadocs uses by default, after adding the + * locale prefix — see `prefixLocale`. + */ +export function LocaleLink({ lang, href, children, ...rest }: LocaleLinkProps) { + return ( + + {children} + + ) +} diff --git a/apps/docs/content/docs/admin-api.mdx b/apps/docs/content/docs/admin-api.mdx new file mode 100644 index 000000000..1e9b830cc --- /dev/null +++ b/apps/docs/content/docs/admin-api.mdx @@ -0,0 +1,160 @@ +--- +title: "Core administration API" +description: "Management operations and their server-side credential boundary." +--- + +Core Web is an administrator console over `/core/v1`, authorized by the Core key: +resource inspection, Project and key management, credential issuance, audit, usage +and sandbox operations. It never calls `/v1` or `/api/v1`, and has no Agent +execution, copy or arbitrary asset editing operation. + +Core request failures use the [Core administration error envelope](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/core-errors.md), +including optional typed safe details. Console sign-in endpoints retain their +separate error shape described below. + +## Browser to console + +The browser uses the console's own origin and signs in with the +[Core key](/troubleshooting#core-key): + +| Method and route | Request | Result | +| --- | --- | --- | +| `GET /console/auth` | No body | `200 {"mode":"login"}` or `200 {"mode":"authenticated"}` | +| `POST /console/auth/login` | `Content-Type: application/json`, body `{"core_key":"…"}`; other members are rejected | `200 {"mode":"authenticated"}` and an HttpOnly, SameSite=Strict session cookie (Secure over HTTPS) | +| `POST /console/auth/logout` | No credential payload | `200 {"mode":"login"}`; clears the cookie and the server-side session | +| `GET /console/config` | Signed-in session | `node_installer`, `node_installer_sha256`, `self_hosted_installer`, `self_hosted_installer_sha256`, and `node_artifacts`: the providers (`docker`, `microsandbox`) whose node assets this console holds | + +Sign-in errors use the console's `{"error": "…"}` envelope: 400 for a malformed +body, 401 for a wrong key, 415 for a non-JSON body, 429 with `Retry-After` when +failed attempts are limited or sign-in is busy, and 503 when the console cannot +start a session. The console compares the submitted key with its configured Core +key in constant time and never logs or returns it. Only failed attempts count +toward the limit; the correct key signs in even while failures are limited. The +console refuses to start with a Core key shorter than 32 characters. Sessions live only in the console's memory; a console restart +or Core key rotation requires signing in again. There are no console accounts, +usernames, passwords, account setup or Basic authentication. + +Use same-origin browser requests and cookies. Mutations require the same-origin +request checks; never put the Core key in JavaScript or browser storage. + +## Console to Core + +After sign-in and the same-origin checks, the console server forwards every +`/core/v1/*` request with its private Core key as the Bearer credential; Core +alone decides whether the route exists. It removes browser Authorization and +forwarding-sensitive headers, and sets `X-Core-Console-Actor: console`. Core +records the header as the audit `actor_label`. The label is caller-asserted and +display-only: direct Core key scripts normally send none, which records an empty +label, but could set any value. Never use it for authorization or as proof of +origin. + +Web calls Core only through the typed Core clients in `packages/agents-client`: +[AdminClient](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/packages/agents-client/src/admin-client.ts) (`/core/v1`), +`SandboxAdminClient` (`/core/v1/sandbox`) and `CoreMetricsClient` +(`/core/v1/metrics`). See [the complete administrator reference](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/admin-api.md) +for methods, fields, filters, pagination and response shapes. +Routes below are relative to `/core/v1`: + +| Workflow | Routes | +| --- | --- | +| Projects | `GET/POST /projects`, `POST /projects/{id}`, `POST /projects/{id}/archive` | +| Project keys | `GET/POST /projects/{id}/keys`, `DELETE /projects/{id}/keys/{key_id}` | +| Resource lists/details/deletion | `/projects/{id}/agents`, `/sessions`, `/environment-templates`, `/skills`, `/files`, `/vaults`, including the documented nested reads | +| Asset ownership | `GET /projects/{id}/resource-owners` with batched resource IDs | +| Key operation history | `GET /projects/{id}/write-operations` with key/resource/time filters | +| Executor credentials | `GET/POST /projects/{id}/environments/{environment_id}/executor-credentials`, `DELETE …/executor-credentials/{key_id}` ([contract](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/environment-executor-credentials.md)) | +| Deployment model providers | `GET /harnesses`, `GET/PUT/DELETE /harnesses/{harness}/model-provider`; the key is write-only ([contract](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/model-execution.md#deployment-defaults)) | +| Usage and health | `GET /summary`, `/sandbox/runtime-observations`, `/metrics` | +| Administrator audit | `GET /audit-log`; deployment-wide entries have `project_id: null` | + +A Project UUID in a management path selects the target; it is not a credential. +API-key plaintext is returned only by successful issuance, so display it once and +never cache it. Reconcile uncertain issuance before explicitly issuing another key. +Deleted/revoked resources retain their audit records. Historical unknown ownership +stays null. Session usage grouped by key belongs to the Session's creation key; +it is operational attribution, not per-key billing. + +## Sandbox administration + +The [deployment configuration contract](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/sandbox-deployment.md), +[nodes and sandbox backends reference](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/HOSTED-SANDBOX-MANAGER.md) +and [generated OpenAPI](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/core.openapi.yaml) +define deployment and node operations: + +- `GET/POST/PUT /core/v1/sandbox/deployment` and + `PATCH /core/v1/sandbox/deployment/maintenance`. +- `GET /core/v1/sandbox/nodes`, `PATCH/DELETE /core/v1/sandbox/nodes/{node_id}`, + and `GET /core/v1/sandbox/nodes/{node_id}/allocations`. +- `POST /core/v1/sandbox/enrollment-tokens` for a one-time node installation command. + Its non-secret `enrollment_id` reappears on the node that command registers. + +PostgreSQL owns one provider, per-sandbox resource specification and immutable +Runtime selection. POST initializes it; PUT replaces the complete selection using +`expected_generation`. Requests carry `resources` and, for Docker/microsandbox, +`runtime`; safe responses return `specification` and `specification_digest`. +Response `resources.allocations` and `resources.pending` are cleanup counts, not +CPU, memory or disk settings. E2B accepts a write-only key and exact template build +instead of a node Runtime release, and provisions without a node installation. E2B +may omit `resources` to adopt the validated build's CPU and memory; responses show +the build as read at selection time in `e2b.template_build`. Microsandbox responses +return its idle `suspension` policy; other providers return null. + +Provider, resource and Runtime changes all require global maintenance and verified +cleanup of retained/pending resources. Core validates the candidate before commit; +a rejection preserves the previous configuration. A changed commit advances the +generation and retires old nodes and enrollment tokens atomically. Explicitly resume +after success. Neither switching nor editing configuration deletes resources or +migrates existing Sessions. During maintenance, administrators can explicitly +[archive each retained hosted Session](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/admin-api.md#administrative-session-archive) +through the Core administrator API at the current generation, then read its +resource disposition and recheck deployment counts. Archive preserves history +and persisted Files/Artifacts; unpersisted workspace contents are lost and the +original Session cannot resume. This API does not add a console archive control. +Public Environment Templates, the `/v1` contract and +caller-owned `self_hosted` provisioning remain unchanged. + +`GET /api/v1/sandbox-node/configuration` uses an enrollment Bearer token, or a +retained node Bearer credential with `X-OAC-Node-ID`. This read does not consume +enrollment. Retained matching nodes can read their configuration during maintenance. +Installers must verify the returned generation, specification digest and Runtime +before registration; local files cannot override the saved limits. A mismatch +returns `sandbox_specification_mismatch` without replacing node state. + +Node configuration, enrollment, identity and connection routes live under +`/api/v1/sandbox-node`, beside the daemon's `/api/v1/agent-daemon`. The reverse +proxy sends `/api/v1` directly to Core; the console returns 404 for it and never +forwards machine traffic. These routes use their own credentials, do not inherit a +browser login and gain no management authority. E2B credentials are absent +from node configuration and safe deployment views. + +## Frontend handoff and errors + +Frontend screen implementation is owned by the separate frontend task. The +backend provides the `/core/v1` contract, the typed Core clients and the console +proxy; backend tests do not qualify the screens. + +The console returns 404 for `/v1`, `/api/v1` and old `/console/api-keys` routes, +even with an explicit application or machine Bearer credential. Invalid +Origin/Host requests are rejected; unavailable Core or rejected upstream redirects +return 502. Console authentication uses its own error envelope. Management resource +errors and deletion constraints are documented in the administrator reference and +generated schema; do not interpret every empty or failed read as an absent resource. + +## Core metrics + +`GET /core/v1/metrics?range=1h|6h|24h|7d` returns Core process, execution +queue/slots, PostgreSQL and background-job measurements. It requires the Core key, +rejects arbitrary query filters and never grants +Agent execution access. See the [exact measurement contract](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/core-metrics.md) +for complete buckets, null values, units and process-local retention. Frontend +implementation is maintained separately; this backend change does not modify +Agent metrics or the public Agent API. + +## Node host history + +The Core key reads a node and its host history through +`GET /core/v1/sandbox/nodes/{node_id}?range=1h|6h|24h`. See the +[node host history contract](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/node-host-history.md) +for nullable observations, freshness and aggregation. The node list is unchanged. + +[Repository source](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/docs/api/web-management.md) diff --git a/apps/docs/content/docs/admin-api.zh.mdx b/apps/docs/content/docs/admin-api.zh.mdx new file mode 100644 index 000000000..a35483936 --- /dev/null +++ b/apps/docs/content/docs/admin-api.zh.mdx @@ -0,0 +1,10 @@ +--- +title: "Core administration API · 中文导读" +description: "当前版本的中文导读;完整操作步骤见英文正文。" +--- + +管理员脚本通过 Core 的回环端口调用 /core/v1,并使用 Core key。公网入口的 /core/v1 由 Web 管理会话处理;不能把它当成应用 API 或机器连接的代理。 + +此页为中文导读,完整且与当前源码同步的步骤请阅读[英文正文](/en/admin-api)。 + +[安装](/install) · [配置](/configure) · [API 与凭据](/public-api) · [节点](/hosted-providers) · [应用示例](/quickstart) diff --git a/apps/docs/content/docs/agents-and-tools.mdx b/apps/docs/content/docs/agents-and-tools.mdx new file mode 100644 index 000000000..ed238409b --- /dev/null +++ b/apps/docs/content/docs/agents-and-tools.mdx @@ -0,0 +1,124 @@ +--- +title: "Agents, tools and harnesses" +description: "Native harness tools, shared declarations and the limits of execution support." +--- + +Assessed against Core `206474a4c10901442b1faa094281bfb5559082b5` on 2026-09-22. +The contract remains [OpenAI Python 3.13.0 at `d7c41ef`](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/upstream.json), Beta +`agents=v1`. This matrix records the bounded execution/tools milestone. It does not +establish complete protocol compatibility; the remaining limits below stay open. + +**Implemented** means current source and controlled checks support the operation. +**Qualified** additionally identifies a real public Core/PostgreSQL/daemon/native +model workflow in the evidence register below. **Unsupported** describes a current +admission/native limitation, not a restriction in the official contract. +**Unverified** means evidence does not establish the stated semantics or profile. +Qualification never extends automatically to another model, placement or combination. + +## Operation matrix + +All function rows refer to application-defined functions. Native workspace tools +and Environment Plugin MCP have separate inventories and qualification. + +| Operation | Implemented behavior and real qualification | Unsupported or unverified boundary | +| --- | --- | --- | +| Initial message input, `sessions.create` | String input and ordered user-message arrays share atomic admission. Codex/Claude text and inline image execution: M1/M2; ordinary MiniMax text: M1/P1. [Input contract](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/message-input.md), [initial parser](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/internal/api/session_initial_input.go). | Whitespace-only text is admitted verbatim for Codex and rejected at admission for Claude SDK and MiniMax Code ([text content](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/message-input.md#text-content)). Empty parts beside text (SES-08) and local size-limit parity need upstream evidence. Images are only qualified for inline PNG/JPEG on `none` and Core-managed Docker `openai_hosted`; MiniMax, self-hosted images and remote URLs remain gaps. | +| Prepared and active messages, `sessions.events.create` | Ordered `input_text`/`input_image` arrays retain original content and distinct public user Items. HTTP 202 confirms persistence; native receipts establish application. Initial/prepared/active Docker PNG/JPEG: M2; active PNG on `none`: M1. [Shared admission](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/internal/api/inputs.go). | Codex flattens native messages with blank-line separators. Claude can fold or queue native turns; it does not promise Codex's same-native-turn behavior. Public durability does not prove native consumption. Claude SDK and MiniMax Code reject messages without an image or non-whitespace text at admission (`unsupported_or_invalid_configuration`); Codex delivers them unchanged. | +| Structured output, `agent.text.format` | Save/inherit/freeze `{type:json_schema,schema:...}`. Claude SDK object-root, single Agent, medium verbosity, ordinary functions returning text: S1 (`none`) and S2 (Docker, including prepared/active input and Files/Artifacts). Native final text is retained unchanged; its stream follows the official message sequence with the whole text in one `output_text.delta` ([item serialization](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/history-events-usage.md#item-serialization-2026-09-23)). [Contract](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/structured-output.md), [profile](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/internal/engine/claude.go). | An explicit non-object root type is a protocol error for every harness ([validation](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/official-semantics-alignment.md#agent-configuration-validation--september-23)). Codex/MiniMax, schemas without an object root, schema numbers changed by binary64, self-hosted, Skills/Plugins, MCP, Subagent and discovery combinations reject execution. No output repair, coercion or extra model loop. Arbitrary schema dialects are unverified. | +| Function configuration, saved/inline Agents | Required name/description/schema; `defer_loading` defaults false. Protocol errors, repeated names and explicit non-object root types reject with the official fields ([validation](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/official-semantics-alignment.md#agent-configuration-validation--september-23)). Saved references resolve into an immutable Session snapshot. Codex/Claude real calls: F1/F2/M2/S1/S2. [Parser](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/internal/api/function_configuration.go), [saved tools](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/internal/api/saved_tools.go). | MiniMax public functions reject. Claude requires an explicit object root. Local nonblank/512-byte name and 64-definition Session bounds are compatibility gaps. Saving configuration alone does not qualify execution. | +| Function-result admission, `events.create` | Required `turn_id`, `call_id`, `success`; optional nullable `error` and `output`. Output is string or ordered text/image content. Scoped atomic batches retain field presence, original content and retry identity in storage; public result Items and events always carry `output` and `error`, null when not submitted ([item serialization](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/history-events-usage.md#item-serialization-2026-09-23)). Same result retries are accepted; changed results and results after cancellation return 409 `conflict_error`, including after terminal state. In the caller's Session, an unknown call or a call of another Turn returns 400 `invalid_request_error` without changing the pending action; missing and foreign Sessions stay 404 ([error rows](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/official-semantics-alignment.md#session-input-conflicts-and-result-targets--september-23)). F1/F2/M2 plus [controlled SDK/raw checks](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/tests/official_function_inputs.py). [Parser](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/internal/api/function_inputs.go), [Store](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/internal/store/function_inputs.go). | Admission is separate from application and public Item publication. Invalid or unqualified content cannot consume a pending call. Core messages omit the call and executor IDs that official messages name; hosted defaults and publication timing remain unverified. | +| Function text results and native application | Codex waits for a matching live root dynamic-tool completion; Claude waits for a matching live root native tool result. Text/error results, retry/conflict, cancellation and cold continuation: F1/F2. [Receipt contract](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/function-result-images.md). | Transport writes alone do not confirm application. Confirmation is not provider consumption, crash recovery or exactly-once external effects. No automatic result replay. | +| Function image results | Successful ordered inline PNG/JPEG with text, large PNG and image-only JPEG: Codex/Claude `none` F1/F2; Docker M2. Public Items retain submitted bytes. Codex receipt regression: F2. | Claude rejects failed images and remote references before persistence; native resizing may change its image bytes. MiniMax functions and self-hosted image workflows are unqualified. Other Codex image/error/reference combinations cannot be inferred from successful-inline evidence. | +| Deferred function discovery | Type-only `tool_search` plus mixed eager/deferred functions: Claude SDK 0.3.269/native 2.1.269, Kimi K3, single Agent, medium, `none`, text results; text and PNG input D1. Native provider observations establish lazy schema loading. [Contract](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/tool-search.md). | A repeated `tool_search` is a protocol error. Codex/MiniMax discovery, search-only/missing-search, workspace, MCP, structured-output and Subagent combinations remain gaps. Opaque native policy changes lack a reliable pre-input deferral signal. Saved tools include `tool_search`; the pinned Session response union excludes it. Exact hosted projection is unverified. | +| Explicit disabled search/PTC | Saved and inline `web_search.mode=disabled` and `programmatic_tool_calling.enabled=false`; shared native controls on initial and cold execution. All three harnesses on `none`: P1, including native inventory/control evidence. [Contract](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/tool-policy.md), [parser](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/internal/api/disabled_tools.go). | Unsupported explicit enablement rejects at Session admission; saved Agents keep every pinned search mode as resource data (TV-05), and Sessions from such Agents reject unless they replace the tools. A repeated `web_search` is a protocol error. Omission retains approved native behavior, which does not establish official default-on PTC parity. Enabled search and default/error parity remain gaps; unrelated native utilities are not implicitly removed. | +| Agent service-origin MCP | Implemented Codex/Claude HTTP `none` profiles, anonymous/static bearer, scoped Vault selection and native `mcp_call` Items. [Configuration and qualification limits](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/README.md#http-mcp-execution), [profiles](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/internal/engine/profile.go). | This closure batch does not requalify MCP/provider combinations. MiniMax, self-hosted/hosted service-origin MCP, OAuth, nonempty inline headers/metadata and other transports/origins reject. Claude requires a static connected inventory; original MCP-envelope fidelity and continuing server health are unverified. | +| Environment Plugin MCP/native tools | Separate [Docker Plugin transport matrix](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/environment-templates.md#environment-origin-mcp-plugins) and [V1 deployment evidence](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/user-managed-runtime-v1.md). Native tools stay within the existing colocated Runtime. | Plugin MCP is not Agent service-origin MCP or a public function action. No new optional cross-product is qualified here. Native utility inventories need not be identical. | +| Required action: `function_call` | Session GET/list and Session SSE expose persisted `{arguments,call_id,name,turn_id,type}`. Actions remain pending until native application or cancellation/terminal settlement. [Projection](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/internal/store/function_state.go), [confirmation](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/internal/store/function_results.go); real handling F1/F2/M2/S1/S2/D1; explicit client disconnect/query/reconnect: F3. | Function-call history is not pending-state authority. Client reconnect does not replay events or redo external application effects. | +| Required action: `environment_connection` | Offline waiting input exposes `{environment_id,type}` before Turn creation. Connect the exact Session Environment through our scoped daemon enrollment. Three-harness Docker/E2B execution: E1; explicit initial pending-input/query/connection/native completion: E2; expiry: [controlled initial-input test](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/tests/official_self_hosted_initial.py). | Idle offline Sessions without pending input request nothing. Registration alone is not connectivity or native readiness. Stock `exec-server`/Noise transport is outside the approved V1 route. Exact upstream registration/action-removal timing remains unverified. | +| Stream disconnect and execution loss | SSE is live-only. Reconnect, buffer events, retrieve Session/Turn/Items and deduplicate Item IDs. Worker recovery fails previously claimed work without replay; queued work can remain. [Recovery contract](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/README.md#public-execution-admission), [connection reconciliation](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/internal/store/environment_connection_recovery.go). | Client disconnect and daemon/Core loss are different cases. F3 qualifies client-stream loss and continued pending function handling; F2 qualifies native process loss with an unapplied saved result. Neither promises replay or recovery of unknown external effects. | + +## Required-action recovery contract + +The fixed [Session union](https://github.com/openai/openai-python/blob/d7c41efee1b0802b79f3f88a678ef2052b06e9ce/src/openai/types/beta/agent_session.py) +defines both variants. The official [Functions](https://developers.openai.com/api/docs/guides/agents-api/tools/functions) +and [Manage sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage) +guides, checked on 2026-09-22, direct clients to retrieve `required_actions` after +restart or stream loss. A historical `function_call` Item alone cannot establish +that a result is still pending. The fixed SDK governs field/type compatibility; +current prose does not silently change that pin. + +For a pending function, use the returned Session, Turn and call identity. If the +application already performed the function, keep and submit that saved result; +do not run an external effect again merely because an action remains visible. +Core's acknowledgement boundary is native application. For an environment action, +connect its exact Environment using the existing enrollment authorization. +[Connection observations](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/internal/store/environment_connections.go) +fence stale generations; transport connection can clear pre-Turn activity before +native preparation. Neither registration nor an action disappearing proves that +a model ran successfully. Query the matching Turn and Items for its outcome. + +Two timing questions remain open. Repeated `requires_action` notification order +and acknowledgement timing are local implementation choices, not proven upstream +semantics. Also, an admitted result that is cancelled before native observation +can remain internally saved without a public output Item or `item.added`. +[Item publication](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/internal/store/item_projection.go) and +[the existing coverage record](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/README.md#public-function-configuration) preserve +this gap. Successful retry cannot manufacture the missing observation or establish +that the model consumed the result. + +## Evidence register + +Real records below use fixed SDK 3.13.0 and raw HTTP through Core, dedicated +PostgreSQL, daemon and native harness. Evidence is private under `~/.parsar/remediation/` on `zju_a100_2` and the +development host. Paths containing `validated/` or `server-evidence/` identify +downloaded local mirrors; summary files may also live only on the development +host. Locators identify retained evidence without publishing credentials or +private launch configuration. Revisions identify the accepted change, +not a claim that every historical workflow was rerun at the current baseline. + +| ID | Exact evidence and accepted scope | +| --- | --- | +| M1 | `20260922/message-image-input/public-codex-reviewed.log` (59.41s), `public-claude-reviewed.log` (79.52s), `public-mcode-network-fixed.log` (48.95s); [PR #12](https://github.com/MiniMax-AI/parsar-core/pull/12), merge `37a2923`. Codex/Claude Kimi K3 PNG initial/active inputs, receipts, retries, cancellation, cold continuation and isolation; MiniMax M2.7 ordinary text regression. | +| M2 | `20260922/workspace-images/validation-summary.json`; Codex `public-run-_lr5uiy_`, Claude `public-run-sb65p9e9`; candidate `2c295116d66ed9aafc808ec49a8cb6dcb5c674c2`, merge `1adb2489bc3415039440224e9a7905c53e68a557` ([#17](https://github.com/MiniMax-AI/parsar-core/pull/17)). Kimi K3, Codex 0.153.4, Claude SDK 0.3.269/native 2.1.269; Docker seven-Turn image/workspace workflow. Codex's receipt conclusion is superseded by F2. | +| F1 | `20260922/function-result-images/validation-summary.json`, `validated/function-image-public-2567456666/public.json`; candidate `d3cdb225bc7628b968b76c7e1b400101894ce8cd`, merge `fd23f169e1ede1b2f1c39a1d9dcce71886e3c006` ([#16](https://github.com/MiniMax-AI/parsar-core/pull/16)). Claude SDK 0.3.269/native 2.1.269 with Kimi K3 on `none`; success PNG/JPEG, failed text, retries, cancellation, history continuation. Earlier Codex transport-only evidence does not qualify current receipts. | +| F2 | `20260922/function-result-receipts/validation-summary.json`, `candidate-public-owner-sdk.log`; hosted `public-run-4fn70foy` (104.13s), `none` `function-image-public-945075091` (83.918s). Candidate `6dceb98e1c56469fcc70cd82025ce77fc870ed3d`, merge `206474a4c10901442b1faa094281bfb5559082b5` ([#20](https://github.com/MiniMax-AI/parsar-core/pull/20)); real Kimi, Codex 0.153.4. Qualifies native receipts, not completed provider consumption. | +| F3 | `20260922/execution-tools-closure/pending-actions/validation-summary.json`; Codex `codex/public-run-8gexf5a8` (65.58s), Claude `claude_sdk/public-run-5f2tr7e_` (74.33s), production source `206474a`. The same [public verifier](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/services/agents-api/tests/official_pending_actions_native.py) checks disconnected-client pending queries, success/error/cancel, original results, target isolation, retry/conflict and no implicit call replay with real Kimi on Docker. No Core restart or native-loss injection is claimed by these runs. | +| S1 | `20260922/structured-output/acceptance-summary.json`, `structured-public-1905281777/public.json`; real candidate `7f533d46c472f3cdf7c16ce9471c225a2ba7eded`, merge `8716e699dbc34904499c94b6b0b03857bbebfaad` ([#11](https://github.com/MiniMax-AI/parsar-core/pull/11)). Claude/Kimi `none` schema/function execution and cold continuation. Schema-specific active steering was not separately qualified here. | +| S2 | `20260922/hosted-structured-output/validation-summary.json`, `validated/public-inline.log`, `public-run-qvq3csf1` (186.09s); candidate `f6d2c3f2a1dc2ff5f177213bd2b20d78496011d0`, merge `aa85d8ecc60e0a8b7f2494b73caa81216ee197e2` ([#18](https://github.com/MiniMax-AI/parsar-core/pull/18)). Claude SDK 0.3.269/native 2.1.269, real Kimi; Docker saved/inline schema, prepared/active input, native files and four completed structured answers. | +| D1 | `20260922/deferred-tools/tool-search-public-2039155387/public.json`, `public-image-isolated-tests.log` (86.71s); merge `178507ae7a63d4068e1e82bef9cd256ba398ae00` ([#13](https://github.com/MiniMax-AI/parsar-core/pull/13)). Claude SDK 0.3.269/native 2.1.269/Kimi K3 `none`; text results with initial/active PNGs, cancellation and cold continuation. `claude-native-1790052750` separately records provider schema inventories and native feasibility. | +| P1 | `20260922/tool-policy/acceptance.json`, `server-evidence/tool-policy-{codex-2495445746,claude_sdk-2539346823,mcode-3747575401}/public.json`; candidate `eeb432c7495265ae3a9309e32f5b4323611c3245`, merge `4b8754a6eda6696d9b18eb8d583953ac16c6800f` ([#14](https://github.com/MiniMax-AI/parsar-core/pull/14)). Codex/Claude Kimi K3, MiniMax M2.7; four `none` Sessions per harness, native disable controls and cold continuation. | +| E1 | `20260921/self-hosted-onboarding/{source-candidate.json,source-verified.json,live,live-e2b}`; candidate `8f0cd2530d7b58cb7fb3ea124a1fc43dacecca36`. [Exact Docker/E2B run paths and limits](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/user-managed-runtime-v1.md#evidence-and-verification-boundaries): Codex Kimi K3 Responses, Claude Kimi K3 Anthropic-compatible API, MiniMax M2.7, immutable Linux amd64 Runtime builds. Native execution, restart/history, cancellation, Files/Artifacts and isolation; shared credential lifecycle evidence is not a separate live rotation run for every E2B profile. | +| E2 | `20260922/execution-tools-closure/environment-actions/result.json` contains Codex/Claude Kimi passes (13 checks each) and the retained MiniMax direct-network failure; `mcode-relay-retry/result.json` separately passes MiniMax M2.7 (13 checks) after correcting provider routing. Source `206474a`; same shared SDK/raw workflow, isolated Core/PostgreSQL and user-managed Docker. Covers initial creation SSE, client disconnect, exact pending Environment/no Turn or Items, scoped enrollment, one actual completed model Turn and creation retries preserving history. This is connection-action qualification, not another full lifecycle or E2B regression. | + +Controlled tests establish parser, projection, atomicity and race behavior; native +feasibility probes establish only feasibility. Neither replaces the real records. +Failed setup, provider and assertion runs remain failures with their original +scope. The unchanged gate requirements and independent review apply to this batch. + +## Milestone closure and remaining limits + +1. **Principal function recovery:** F3 directly verifies live client-stream loss + while a function is pending on Codex and Claude, authoritative queries, exact + targeting, rejection without mutation, original results, retry/conflict, + application, cancellation and isolation. F2 separately establishes truthful + native-loss settlement without replay. No active execution recovery is promised. +2. **Principal environment recovery:** E2 explicitly verifies pending + `environment_connection` recovery and single initial execution on all three + harnesses. E1 retains broader deployment/history/isolation qualification. + Registration, connection and preparation remain distinct; no exact upstream + timing or arbitrary-provider qualification is inferred. +3. **Recorded nonblocking timing:** an accepted result cancelled before native + application may lack a public result Item. The submitted data remains durable; + F2 confirms that native loss does not turn unknown delivery into Applied. The + fixed sources do not establish the publication point for this interleaving. + Keep it queued rather than inventing a public state or rewriting safe receipt + ownership. This limited timing question is not accepted protocol parity and + does not invalidate F3's principal pending-result workflow. + +Approved native capability differences (including default PTC), unsupported optional +combinations, arbitrary provider parity and low-frequency error/default edge cases +remain separate limitations. They do not authorize silently relabeling an unproved +principal workflow as deferred. OAuth, full Usage, release publication, new tool +kinds and new execution loops are outside this closure batch. + +[Repository source](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/execution-tools.md) diff --git a/apps/docs/content/docs/agents-and-tools.zh.mdx b/apps/docs/content/docs/agents-and-tools.zh.mdx new file mode 100644 index 000000000..5ed1f6f95 --- /dev/null +++ b/apps/docs/content/docs/agents-and-tools.zh.mdx @@ -0,0 +1,10 @@ +--- +title: "Agents, tools and harnesses · 中文导读" +description: "当前版本的中文导读;完整操作步骤见英文正文。" +--- + +保存 Agent 只保存配置,不启动执行。工具声明由所选原生 harness 执行;Codex、Claude Code 与 MiniMax Code 的能力和限制不同。x_agents_core 保留原有扩展字段名称。 + +此页为中文导读,完整且与当前源码同步的步骤请阅读[英文正文](/en/agents-and-tools)。 + +[安装](/install) · [配置](/configure) · [API 与凭据](/public-api) · [节点](/hosted-providers) · [应用示例](/quickstart) diff --git a/apps/docs/content/docs/api-reference/agents.mdx b/apps/docs/content/docs/api-reference/agents.mdx new file mode 100644 index 000000000..25bd137d4 --- /dev/null +++ b/apps/docs/content/docs/api-reference/agents.mdx @@ -0,0 +1,75 @@ +--- +title: Agents +description: >- + Agents. Application API: Project API key. Public schema constrained by the + pinned OpenAI Agents API baseline; documented x_agents_core fields remain Core + extensions. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Lists only the authenticated tenant's saved Agents, independently of + Sessions. Limit 0 is treated as 1 and larger limits as 100, as + observed on the hosted service. The local default is 20; exact + upstream default/cap and empty cursor fields remain unverified. An + unknown, malformed or foreign after cursor returns not found. + - content: >- + Persists configuration independently of execution. Names over 128 + characters and metadata outside 16 string pairs with 64-character keys + and 512-character values return invalid_request_error with the + official param; U+0000 in stored strings is rejected as a local + storage limit. As on every Agents API JSON route, a non-JSON + Content-Type, invalid UTF-8, malformed JSON, a repeated key at any + depth or a non-object root returns invalid_request_error with a null + param and the official message before other checks; an empty or null + body is {}. Missing, unknown, wrongly typed or unsupported enum + members of the pinned configuration shapes (tools, text, reasoning, + service_tier, multi_agent) return invalid_request_error with the JSON + path as param; duplicate function names, repeated web_search or + tool_search and non-object schema root types return it with a null + param. Supports model/name/instructions/metadata, explicit reasoning + and service tiers, multi_agent, text/json_schema, + function/tool_search/programmatic_tool_calling/web_search and HTTP MCP + with nullable credential_id, service origin (omitted or null on HTTP + transport is saved as service) and boolean required defaulting to + false. Saving credential_id grants no access: Session admission checks + attached Vault ownership and destination. MCP allowed_tools preserves + null versus empty; saved HTTP transport includes empty headers. + Model-derived reasoning defaults, other MCP variants and public retry + conformance remain incomplete. web_search saves every pinned mode: + omitted or null mode is saved as live and omitted or null context_size + as medium; allowed_domains preserves null versus empty and a present + location, including {}, includes all four keys with null for omitted + ones, as observed officially (req_db41d2f6261b4abfb69465eafe719ab5, + req_165d53b88445490b9146d8272c54134d). Session execution accepts only + explicit disabled web_search and disabled programmatic_tool_calling + through qualified Runtime controls; saved enabled forms reject at + Session admission. Session execution admits only its supported + configuration subset. + - content: >- + Reads the saved resource owned by the authenticated tenant, + independently of execution Sessions. + - content: >- + Preserves omitted fields and replaces supplied fields using shared + saved-configuration validation. Null name/instructions clear; null or + empty metadata clears all pairs. Name, metadata and configuration + validation errors return invalid_request_error with the official + param, using the Agent create rules before the Agent lookup. Existing + Session snapshots are unchanged. Empty updates advance updated_at + without changing saved fields. Nested replacement/null defaults, + model-derived reasoning and exact hosted error behavior remain + incompletely verified. + - content: >- + Deletes only the authenticated tenant's saved configuration. Existing + Session snapshots, history and recorded creation retry identities + remain independent. Missing and repeated deletion locally return404; + exact hosted error and in-flight creation/deletion semantics remain + unverified. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/artifacts.mdx b/apps/docs/content/docs/api-reference/artifacts.mdx new file mode 100644 index 000000000..012154e5f --- /dev/null +++ b/apps/docs/content/docs/api-reference/artifacts.mdx @@ -0,0 +1,33 @@ +--- +title: Artifacts +description: >- + Artifacts. Application API: Project API key. Public schema constrained by the + pinned OpenAI Agents API baseline; documented x_agents_core fields remain Core + extensions. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Lists published outputs independently of Environment availability. + Sorting uses publication time and ID. A later Turn publishes a path + again only when it is new, its bytes changed, or no Artifact remains + for it. A malformed environment_id matches nothing. An after value + that is not an Artifact of this Session, including a malformed one, + returns 400 invalid_request_error with the message "after is not a + valid artifact ID". The local default page size is 20; exact upstream + defaults remain unverified. + - content: >- + Deletes the published copy without modifying its original workspace + file. Already admitted content reads may finish; later reads reject. + - content: >- + Streams stored bytes after tenant and Session authorization, including + after Environment expiration. Exact upstream headers and Range + behavior remain unverified. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/administrator-projects.mdx b/apps/docs/content/docs/api-reference/core/administrator-projects.mdx new file mode 100644 index 000000000..81b0dd3ca --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/administrator-projects.mdx @@ -0,0 +1,17 @@ +--- +title: Administrator Projects +description: >- + Administrator Projects. Core administration API: Core key held by Web’s server + or an operator script. Generated local management contract. This is not part + of the public OpenAI API. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: [] +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/agents.mdx b/apps/docs/content/docs/api-reference/core/agents.mdx new file mode 100644 index 000000000..3efbe8afb --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/agents.mdx @@ -0,0 +1,29 @@ +--- +title: Agents +description: >- + Agents. Core administration API: Core key held by Web’s server or an operator + script. Generated local management contract. This is not part of the public + OpenAI API. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/artifacts.mdx b/apps/docs/content/docs/api-reference/core/artifacts.mdx new file mode 100644 index 000000000..94f4020b7 --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/artifacts.mdx @@ -0,0 +1,33 @@ +--- +title: Artifacts +description: >- + Artifacts. Core administration API: Core key held by Web’s server or an + operator script. Generated local management contract. This is not part of the + public OpenAI API. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/core-administration.mdx b/apps/docs/content/docs/api-reference/core/core-administration.mdx new file mode 100644 index 000000000..af6d73f49 --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/core-administration.mdx @@ -0,0 +1,56 @@ +--- +title: Core Administration +description: >- + Core Administration. Core administration API: Core key held by Web’s server or + an operator script. Generated local management contract. This is not part of + the public OpenAI API. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Core key only. Newest-first cursor pagination of safe metadata. Actor + labels are unverified console labels, not authorization identities. + Request bodies and secrets are never recorded. + - content: >- + Core key only; available before any sandbox deployment exists. Reports + the public URL that applications, nodes, sandboxes and self-hosted + executors use, the API base URL, Core's source commit and installation + ID, the installer's settings snapshot with where to change it, and + what is bound to the current public URL. Sensitive settings report + only whether they are configured. + - content: >- + Core key only. Complete UTC buckets; unknown measurements are null. + Samples are process-local and are not backfilled after a restart. + - content: >- + Core key only. Reports actual resource disposition, including expiry + and failure cleanup. This is not archive provenance and does not + assert active Turn settlement. Read this after an uncertain archive + response; never infer released from a missing sandbox alone. + - content: >- + Core key only. Requires maintenance and the current deployment + generation. Permanently closes execution, requests cancellation and + releases sandbox/snapshots through existing cleanup. Session history + and persisted files/artifacts remain; unpersisted workspace contents + are lost. A cleanup_pending response is not proof of resource release. + Does not affect caller-managed Runtime. + - content: >- + Core key only. Each observation is labelled with its owning Project + ID. Uses the existing read-only Runtime sampler, with bounded + concurrency and no execution or provisioning. A provider with a batch + metrics read, such as E2B, samples the page's running sandboxes in one + bounded request. + - content: >- + Core key only. after/limit/order paginate Projects. Agent grouping + returns groups within those spaces. Date bounds filter Session + creation, not current asset counts. Usage sums only non-null public + Session usage; coverage includes every selected Session. Each Project + is read in a consistent database snapshot. Totals are not billing + records. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/credentials.mdx b/apps/docs/content/docs/api-reference/core/credentials.mdx new file mode 100644 index 000000000..f28389c4e --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/credentials.mdx @@ -0,0 +1,29 @@ +--- +title: Credentials +description: >- + Credentials. Core administration API: Core key held by Web’s server or an + operator script. Generated local management contract. This is not part of the + public OpenAI API. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/deployment-model-providers.mdx b/apps/docs/content/docs/api-reference/core/deployment-model-providers.mdx new file mode 100644 index 000000000..5f8f685ff --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/deployment-model-providers.mdx @@ -0,0 +1,43 @@ +--- +title: Deployment Model Providers +description: >- + Deployment Model Providers. Core administration API: Core key held by Web’s + server or an operator script. Generated local management contract. This is not + part of the public OpenAI API. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Core key only. Returns every harness this build supports, in name + order. enabled and default are read-only views of the process + configuration (OAC_DEFAULT_HARNESS and OAC_HARNESSES). model_provider + is the harness's deployment default, stored in Core, or null. Keys are + never returned; api_key_configured reports that one is set. + - content: >- + Core key only. Returns the safe view; the key is never returned. 404 + when the harness does not exist or has no deployment default. + - content: >- + Core key only. Idempotent; each successful request is audited. + Sessions that already froze the default keep it. Afterwards new + openai_hosted Sessions for this harness need a Session or Agent + bundle. + - content: >- + Core key only. The body is the complete x_agents_core.model_provider + bundle, including the write-only api_key; there is no partial update + and bundles are never merged. The provider is validated for this + harness: an HTTPS base_url without credentials, query or fragment, the + harness's protocol (responses for codex, anthropic for claude_sdk and + mcode) and, for mcode, positive context_window and max_output_tokens. + New openai_hosted and none Sessions that resolve no Session or Agent + bundle freeze this default into their encrypted snapshot; existing + Sessions never change. self_hosted Sessions never use it. The key is + encrypted and never returned. Each write records an administrator + audit entry without the key. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/environment-templates.mdx b/apps/docs/content/docs/api-reference/core/environment-templates.mdx new file mode 100644 index 000000000..1f2754d5f --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/environment-templates.mdx @@ -0,0 +1,29 @@ +--- +title: Environment Templates +description: >- + Environment Templates. Core administration API: Core key held by Web’s server + or an operator script. Generated local management contract. This is not part + of the public OpenAI API. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/execution-configuration.mdx b/apps/docs/content/docs/api-reference/core/execution-configuration.mdx new file mode 100644 index 000000000..207d504b0 --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/execution-configuration.mdx @@ -0,0 +1,27 @@ +--- +title: Execution configuration +description: >- + Execution configuration. Core administration API: Core key held by Web’s + server or an operator script. Generated local management contract. This is not + part of the public OpenAI API. +full: true +_openapi: + method: GET + route: /core/v1/projects/{project_id}/sessions/{session_id}/execution-configuration + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Core key only; the Project ID selects the target space and does not + authenticate. Returns the committed model, harness and safe provider + selection with recorded sources. This read never decrypts credentials, + resolves current defaults or probes execution health. Deployment + defaults frozen after they moved into Core show their safe view; older + deployment selections remain redacted. Historical provenance and + missing provider projections are explicitly unknown/unavailable. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/executor-credentials.mdx b/apps/docs/content/docs/api-reference/core/executor-credentials.mdx new file mode 100644 index 000000000..326c5bed2 --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/executor-credentials.mdx @@ -0,0 +1,40 @@ +--- +title: Executor Credentials +description: >- + Executor Credentials. Core administration API: Core key held by Web’s server + or an operator script. Generated local management contract. This is not part + of the public OpenAI API. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Core key only. Returns metadata of the credentials restricted to this + Environment, oldest first; secrets are never listed. The Environment + must be a self_hosted Environment of the Project whose Session exists; + otherwise 404. + - content: >- + Core key only. Returns a connect-only secret once, restricted to + daemon enrollment and connection for this Environment, with the + Project's principal as its execution principal. Repeating an issuance + key_id returns 409 executor_credential_exists; after an uncertain + response, list the credentials and rotate that key_id explicitly. + Rotation keeps the key's Environment, invalidates the old secret and + restores a revoked key; rotating an unknown key_id returns 404. In an + archived Project, issuance and rotation return 409 project_archived. + The Environment must be a self_hosted Environment of the Project whose + Session exists; otherwise 404. Each write records an administrator + audit entry without the secret. + - content: >- + Core key only. Revokes one credential restricted to this Environment; + repeated revocation is safe and it also works in an archived Project. + Revocation denies future enrollment and connection but does not stop + executor-owned compute. The Environment must be a self_hosted + Environment of the Project whose Session exists; otherwise 404. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/files.mdx b/apps/docs/content/docs/api-reference/core/files.mdx new file mode 100644 index 000000000..186f103bb --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/files.mdx @@ -0,0 +1,29 @@ +--- +title: Files +description: >- + Files. Core administration API: Core key held by Web’s server or an operator + script. Generated local management contract. This is not part of the public + OpenAI API. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/index.mdx b/apps/docs/content/docs/api-reference/core/index.mdx new file mode 100644 index 000000000..a80a06dbc --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/index.mdx @@ -0,0 +1,32 @@ +--- +title: Core administration API +description: /core/v1 — Core key held by Web’s server or an operator script. +--- + +Generated local management contract. This is not part of the public OpenAI API. + +**Credential:** Core key held by Web’s server or an operator script. Examples use reserved `example.com` origins. This reference does not send requests or collect credentials. + +Operator scripts use Core’s loopback port. The public entry routes management through Web, which requires its signed-in session and supplies the Core key on the server. + +[API namespaces and credentials](/public-api) · [Application reference](/api-reference) · [Administration reference](/api-reference/core) · [Machine reference](/api-reference/machine) + +- [core-administration](/api-reference/core/core-administration) +- [deployment-model-providers](/api-reference/core/deployment-model-providers) +- [administrator-projects](/api-reference/core/administrator-projects) +- [agents](/api-reference/core/agents) +- [environment-templates](/api-reference/core/environment-templates) +- [executor-credentials](/api-reference/core/executor-credentials) +- [files](/api-reference/core/files) +- [write-audit](/api-reference/core/write-audit) +- [sessions](/api-reference/core/sessions) +- [artifacts](/api-reference/core/artifacts) +- [execution-configuration](/api-reference/core/execution-configuration) +- [items](/api-reference/core/items) +- [runtime-history](/api-reference/core/runtime-history) +- [runtime-observations](/api-reference/core/runtime-observations) +- [turns](/api-reference/core/turns) +- [skills](/api-reference/core/skills) +- [vaults](/api-reference/core/vaults) +- [credentials](/api-reference/core/credentials) +- [sandbox-manager](/api-reference/core/sandbox-manager) diff --git a/apps/docs/content/docs/api-reference/core/items.mdx b/apps/docs/content/docs/api-reference/core/items.mdx new file mode 100644 index 000000000..7589bc49b --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/items.mdx @@ -0,0 +1,23 @@ +--- +title: Items +description: >- + Items. Core administration API: Core key held by Web’s server or an operator + script. Generated local management contract. This is not part of the public + OpenAI API. +full: true +_openapi: + method: GET + route: /core/v1/projects/{project_id}/sessions/{session_id}/items + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/meta.json b/apps/docs/content/docs/api-reference/core/meta.json new file mode 100644 index 000000000..87f295cfb --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/meta.json @@ -0,0 +1,25 @@ +{ + "title": "Core administration API", + "pages": [ + "index", + "core-administration", + "deployment-model-providers", + "administrator-projects", + "agents", + "environment-templates", + "executor-credentials", + "files", + "write-audit", + "sessions", + "artifacts", + "execution-configuration", + "items", + "runtime-history", + "runtime-observations", + "turns", + "skills", + "vaults", + "credentials", + "sandbox-manager" + ] +} diff --git a/apps/docs/content/docs/api-reference/core/runtime-history.mdx b/apps/docs/content/docs/api-reference/core/runtime-history.mdx new file mode 100644 index 000000000..5b7e2da6f --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/runtime-history.mdx @@ -0,0 +1,26 @@ +--- +title: Runtime history +description: >- + Runtime history. Core administration API: Core key held by Web’s server or an + operator script. Generated local management contract. This is not part of the + public OpenAI API. +full: true +_openapi: + method: GET + route: /core/v1/projects/{project_id}/sessions/{session_id}/runtime-history + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Core key only; the Project ID selects the target space and does not + authenticate. Returns stored Runtime observations for one Session. End + is exclusive; the server selects a bounded resolution. Responses + contain at most 1,000 series, 10,000 points per coverage/series array, + and 100,000 total coverage plus series points. It never reads or + changes live compute. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/runtime-observations.mdx b/apps/docs/content/docs/api-reference/core/runtime-observations.mdx new file mode 100644 index 000000000..b9a2917ae --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/runtime-observations.mdx @@ -0,0 +1,23 @@ +--- +title: Runtime observations +description: >- + Runtime observations. Core administration API: Core key held by Web’s server + or an operator script. Generated local management contract. This is not part + of the public OpenAI API. +full: true +_openapi: + method: GET + route: /core/v1/projects/{project_id}/sessions/{session_id}/runtime-observation + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Core key only; the Project ID selects the target space and does not + authenticate. Returns one read-only current Runtime observation. It + never provisions, renews, restarts, pauses or stops compute. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/sandbox-manager.mdx b/apps/docs/content/docs/api-reference/core/sandbox-manager.mdx new file mode 100644 index 000000000..f05ee6363 --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/sandbox-manager.mdx @@ -0,0 +1,61 @@ +--- +title: Sandbox Manager +description: >- + Sandbox Manager. Core administration API: Core key held by Web’s server or an + operator script. Generated local management contract. This is not part of the + public OpenAI API. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Core key only. Does not grant project resource access. Responses + contain only explicit safe fields. E2B template_build values are those + Core read when the selection was saved; this read does not call E2B. + - content: >- + Selects a provider, enforced resource limits and pinned Runtime + release. Core derives the deployment's core_url from the installation + public URL and rejects a core_url member with 400. E2B returns 409 + sandbox_configuration_error while the public URL is loopback. E2B + credentials are write-only. E2B may omit resources to adopt the + validated template build's CPU and memory, returned in + specification.resources. Exact retries return the existing selection; + differing selections and file-managed deployments reject. This does + not create compute or execute work. + - content: >- + Requires maintenance, the current generation and verified cleanup of + all old resources. Credentials are write-only. E2B may omit resources + to adopt the validated template build's CPU and memory. A core_url + member is rejected with 400; the address comes from the installation + public URL. Historical records are retained; old node credentials and + enrollments are retired. Explicitly resume after success. Never + automatically retry an uncertain write. + - content: >- + Requires the current generation. Maintenance preserves execution, + cleanup and history. Resume requires successfully activated provider + configuration. + - content: >- + Core key only. Does not grant project resource access. Responses + contain only explicit safe fields. + - content: >- + Core key only. Does not grant project resource access. Responses + contain only explicit safe fields. + - content: >- + Core key only. Complete UTC buckets. Missing host measurements and + offline history are null; reads never sample or backfill. + - content: >- + Core key only. Does not grant project resource access. Responses + contain only explicit safe fields. + - content: >- + Core key only. Does not grant project resource access. Responses + contain only explicit safe fields. + - content: >- + Core key only. Does not grant project resource access. Responses + contain only explicit safe fields. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/sessions.mdx b/apps/docs/content/docs/api-reference/core/sessions.mdx new file mode 100644 index 000000000..174d997f9 --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/sessions.mdx @@ -0,0 +1,29 @@ +--- +title: Sessions +description: >- + Sessions. Core administration API: Core key held by Web’s server or an + operator script. Generated local management contract. This is not part of the + public OpenAI API. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/skills.mdx b/apps/docs/content/docs/api-reference/core/skills.mdx new file mode 100644 index 000000000..1521c7fb9 --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/skills.mdx @@ -0,0 +1,49 @@ +--- +title: Skills +description: >- + Skills. Core administration API: Core key held by Web’s server or an operator + script. Generated local management contract. This is not part of the public + OpenAI API. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/turns.mdx b/apps/docs/content/docs/api-reference/core/turns.mdx new file mode 100644 index 000000000..d29b6ce94 --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/turns.mdx @@ -0,0 +1,25 @@ +--- +title: Turns +description: >- + Turns. Core administration API: Core key held by Web’s server or an operator + script. Generated local management contract. This is not part of the public + OpenAI API. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/vaults.mdx b/apps/docs/content/docs/api-reference/core/vaults.mdx new file mode 100644 index 000000000..552e8e9de --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/vaults.mdx @@ -0,0 +1,29 @@ +--- +title: Vaults +description: >- + Vaults. Core administration API: Core key held by Web’s server or an operator + script. Generated local management contract. This is not part of the public + OpenAI API. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. + - content: >- + Core key only. Reuses the public resource projection and operation + rules; the Project ID selects the target space and does not + authenticate. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/core/write-audit.mdx b/apps/docs/content/docs/api-reference/core/write-audit.mdx new file mode 100644 index 000000000..70eed9da8 --- /dev/null +++ b/apps/docs/content/docs/api-reference/core/write-audit.mdx @@ -0,0 +1,26 @@ +--- +title: Write Audit +description: >- + Write Audit. Core administration API: Core key held by Web’s server or an + operator script. Generated local management contract. This is not part of the + public OpenAI API. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Core key only. The Project ID path selects its space. Returns null for + resources without recorded creation provenance, including historical + and foreign resources. No key secret is returned. + - content: >- + Core key only. Reverse chronological keyset pagination over committed + writes. Creation records remain; other records follow configured + retention. The key path selects its independent space, never a + caller-supplied tenant. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/credentials.mdx b/apps/docs/content/docs/api-reference/credentials.mdx new file mode 100644 index 000000000..b75f46360 --- /dev/null +++ b/apps/docs/content/docs/api-reference/credentials.mdx @@ -0,0 +1,74 @@ +--- +title: Credentials +description: >- + Credentials. Application API: Project API key. Public schema constrained by + the pinned OpenAI Agents API baseline; documented x_agents_core fields remain + Core extensions. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Lists only metadata from the authenticated project's requested Vault, + without decryption or execution. An unknown, malformed or foreign + after cursor, including another Vault's Credential, returns not found. + Includes active and archived Credentials by default, independently of + Vault status. Status accepts a scalar, the SDK status[] array or both, + filtering by their union; a repeated scalar is rejected. Limits + default to 20 and clamp to 1–100. Equal creation times use ID + ordering. Hosted errors, concurrent-page behavior and archive/delete + lifecycle remain unverified or unimplemented. + - content: >- + Stores static_bearer or mcp_oauth secrets as execution-owned + authenticated ciphertext without contacting any endpoint. Static + bearer and OAuth access tokens must be nonempty strings; their bytes + are preserved. OAuth accepts a required access token, nullable RFC3339 + expiry and optional refresh configuration with none, + client_secret_basic or client_secret_post authentication. Required + name is trimmed to 1–256 UTF-8 bytes. Credential and token endpoints + require HTTPS without userinfo or fragments. Responses contain safe + metadata only, including explicit nullable OAuth expiry, refresh, + resource and scope. Missing encryption configuration returns local + 503. External authorization and provider revocation remain caller + responsibilities; exact hosted error/default semantics remain + unverified. + - content: >- + Reads only non-secret metadata scoped to the authenticated project and + owning Vault. No token decryption, network request or execution is + performed. Unknown, foreign, wrong-Vault and malformed IDs use the + same local not-found response; hosted error parity remains unverified. + - content: >- + Explicitly empty static bearer or OAuth access tokens and OAuth + patches without a mutable field are rejected before storage. Omitted + OAuth access tokens preserve the existing grant when expiry or refresh + fields change. Updates the existing static_bearer or mcp_oauth + authentication method without network requests. OAuth access_token + omission/null retains the token; a new token clears omitted expiry, + explicit null clears expiry, and other omitted fields remain + unchanged. OAuth refresh patches cannot add configuration or change + client, endpoint, resource or authentication method; nullable + token/client-secret values retain stored secrets while explicit null + scope clears scope. Whole-null refresh and token_endpoint_auth retain + existing configuration under local policy. Identity, destination, + creation time and Session bindings remain unchanged. Responses expose + safe metadata only. Already-dispatched work is not revoked; provider + revocation, storage-key rotation and exact hosted + concurrent-update/error semantics remain separate. + - content: >- + Removes one Credential and its encrypted token within the + authenticated project and owning Vault, without an encryption key or + secret decryption. Subsequent metadata reads, updates and dispatch + lookups cannot use it. Existing Session snapshots and history retain + their frozen identities; already-resolved tokens and running Sessions + are not revoked or cancelled. This local policy removes the row rather + than defining archived lifecycle; missing/repeated deletion returns + 404. Exact hosted archive, post-delete visibility and retry/error + semantics remain unverified. Provider revocation and physical erasure + from native history, WAL or backups are separate concerns. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/environment-templates.mdx b/apps/docs/content/docs/api-reference/environment-templates.mdx new file mode 100644 index 000000000..5e68bd5c2 --- /dev/null +++ b/apps/docs/content/docs/api-reference/environment-templates.mdx @@ -0,0 +1,56 @@ +--- +title: Environment Templates +description: >- + Environment Templates. Application API: Project API key. Public schema + constrained by the pinned OpenAI Agents API baseline; documented x_agents_core + fields remain Core extensions. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Lists tenant-owned safe template metadata in creation order with ID + tie-breaking. Defaults to limit 20 and descending order; limit 0 is + treated as 1 and larger limits as 100. Foreign, missing and malformed + cursors return the same not found error. Concurrent-page and exact + hosted error behavior remain unverified. + - content: >- + Saves tenant-owned hosted configuration. Supports nullable name, + enabled/disabled or exact-domain restricted network, initial + inline/file_id files, confidential env, ordered setup_commands, + system/npm/Python packages inline/referenced Skill ZIPs, Plugin ZIPs + and workspace-contained capability directories. Omitted/null network + defaults to enabled. Restricted network requires 1–100 exact ASCII + hostnames; other host forms and populated unsupported installations + are rejected before persistence without echoing input. Network policy + rejections return invalid_request_error with a null param. No compute + is allocated. Exact hosted error/retry semantics remain unverified. + - content: >- + Returns safe tenant-owned configuration metadata without allocating + compute. Missing and foreign resources return the same not-found + response. + - content: >- + Supplied fields replace atomically; omitted fields remain unchanged. + Null name clears and null network resets to the pinned enabled + default. Existing Session snapshots and creation retries remain + unchanged. Initial files replace as a list; null/empty clears. File + data is encrypted separately and excluded from response metadata. + Skills replace as a list; null/empty clears. Skill archives are + encrypted separately and omitted from responses. Plugins and + capability directories replace as lists; null/empty clears. Plugin + archives are encrypted and omitted from responses. Capability + directories are snapshotted after setup. Environment MCP execution + requires a qualified native transport and runtime network policy. + Empty updates advance updated_at without changing saved fields or + confidential contents. Network policy rejections return + invalid_request_error with a null param. + - content: >- + Deletes the tenant-owned reusable configuration without changing or + deleting existing Sessions and their frozen configuration. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/environments.mdx b/apps/docs/content/docs/api-reference/environments.mdx new file mode 100644 index 000000000..287d4db3f --- /dev/null +++ b/apps/docs/content/docs/api-reference/environments.mdx @@ -0,0 +1,63 @@ +--- +title: Environments +description: >- + Environments. Application API: Project API key. Public schema constrained by + the pinned OpenAI Agents API baseline; documented x_agents_core fields remain + Core extensions. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Returns durable connection status and safe installed metadata for + supported self_hosted and basic openai_hosted profiles. Initial files + expose frozen safe metadata without content; Plugin/Skill entries + expose only safe configured installation metadata. + Capability-directory discoveries are not added to those arrays. + Unsupported installation configurations remain implementation gaps. + This read does not prepare execution, start compute or require an + enabled execution worker. Session deletion removes the associated + Environment from public reads; project-shared read authorization is + unchanged. Connection status does not prove native readiness or + process quiescence. + - content: >- + Lists direct regular files in one authorized self_hosted or qualified + local workspace directory. Local paths use the public /workspace root + and must be in cleaned form. This partial implementation defaults to + the workspace root and limit 20; recursive scope and these defaults + are not verified upstream semantics. A missing path, a regular file or + a symbolic link returns an empty page; links are never followed. + Daemons without a local workspace binding use the Claude SDK adapter + reader, which keeps 404 for a missing path and 503 for a regular file + or symbolic link. Well-formed unknown query keys are ignored; + malformed query encoding and a repeated supported key are rejected. + Sorts by case-sensitive path components, descending by default. Keep + the same path, order and limit when using page. Each page rereads the + complete bounded directory; changed file paths/sizes invalidate + continuation locally with 400. There is no snapshot guarantee. An + openai_hosted Environment that has not connected yet returns 400. + Truncated or uncertain native results fail with 503 without returning + a partial page. This read never starts a Turn or admits model input. + Actual transport disconnect/reconnect events remain observable. + - content: >- + Uploads standard Base64 bytes to a file beneath /workspace in a + qualified local Environment and returns 201. Accepts inline bytes or a + project-owned source file_id through the same write path. Unknown body + fields are rejected with their name as param. Basic public hosted + creation requires explicit managed Runtime configuration; an + openai_hosted Environment that has not connected yet returns 400. + Inline data is limited to 5 MiB decoded and a file_id copy to 50 MiB. + Missing parent directories are created with mode 0700 and the file + with mode 0600. An existing destination is never replaced; a + directory, an existing file or a path through a symlink or + non-directory returns 400. Idle writes exclude execution. Missing + receipts return unavailable and retain a durable mutation gate without + automatic replay. Error/timing parity with upstream remains + unverified. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/events.mdx b/apps/docs/content/docs/api-reference/events.mdx new file mode 100644 index 000000000..227e260ff --- /dev/null +++ b/apps/docs/content/docs/api-reference/events.mdx @@ -0,0 +1,33 @@ +--- +title: Events +description: >- + Events. Application API: Project API key. Public schema constrained by the + pinned OpenAI Agents API baseline; documented x_agents_core fields remain Core + extensions. +full: true +_openapi: + method: GET + route: /agents/sessions/{session_id}/events + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Live-only events, including command output fragments from capable + Codex peers as agent.output.command_execution_output.delta with stable + Item/output indexes. Native text conversion and output quotas apply; + completion snapshots remain authoritative. Reconnect through Session, + Turn and Items reads; missed events are not replayed. A lagging stream + closes with an error when its bounded buffer is exceeded. When a + hosted Environment fails to provision, the stream sends + agent.session.environment.failed, an error event + (environment_error/sandbox_error with the safe step and exit-status + reason, never command output) and agent.session.failed, then ends. + Session activity includes immutable pending-input connection actions + before Turn creation; self_hosted environments use the same safe + output as Session retrieval. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/files.mdx b/apps/docs/content/docs/api-reference/files.mdx new file mode 100644 index 000000000..21b1c0709 --- /dev/null +++ b/apps/docs/content/docs/api-reference/files.mdx @@ -0,0 +1,48 @@ +--- +title: Files +description: >- + Files. Application API: Project API key. Public schema constrained by the + pinned OpenAI Agents API baseline; documented x_agents_core fields remain Core + extensions. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Lists project-owned Files without reading their bodies. The limit + defaults to 10000 and must be 1–10000. Equal creation times use ID + ordering. Purpose validation precedes cursor lookup; current storage + contains only user_data. An explicit empty purpose is treated as + omitted. Repeated purpose values remain rejected. Hosted positive + filtering, default order and concurrent-page behavior remain + unverified. No Beta header is required. + - content: >- + Accepts one multipart file and purpose=user_data in either order, with + a private 512 MiB content limit and 64 KiB envelope allowance. Commits + only after the entire request validates. The source is project-owned, + independent of Sessions and workspace copies. No Beta header is + required. Other purposes, expires_after, listing, resumable Uploads, + quotas/rate-limit and complete hosted error/status parity remain + unsupported or unverified. + - content: >- + Returns immutable project-owned user_data file metadata. No Beta + header is required. Other purposes, expiration and full hosted + status/error semantics remain unimplemented or unverified. + - content: >- + Atomically deletes project-owned metadata and stored bytes. + Already-admitted reads or copies may finish. Workspace copies remain + independent. Historical WAL/backups are not erased. No Beta header is + required; exact hosted concurrent deletion/error semantics remain + unverified. + - content: >- + Resolves project-owned File metadata before enforcing download policy. + Public download of user_data Files returns 400; missing and foreign + Files return the same 404. Internal initial-file and workspace copies + remain available. No Beta header is required. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/index.mdx b/apps/docs/content/docs/api-reference/index.mdx new file mode 100644 index 000000000..e2bee0bf0 --- /dev/null +++ b/apps/docs/content/docs/api-reference/index.mdx @@ -0,0 +1,24 @@ +--- +title: Application API +description: /v1 — Project API key. +--- + +Public schema constrained by the pinned OpenAI Agents API baseline; documented x_agents_core fields remain Core extensions. + +**Credential:** Project API key. Examples use reserved `example.com` origins. This reference does not send requests or collect credentials. + +[API namespaces and credentials](/public-api) · [Application reference](/api-reference) · [Administration reference](/api-reference/core) · [Machine reference](/api-reference/machine) + +- [agents](/api-reference/agents) +- [environments](/api-reference/environments) +- [environment-templates](/api-reference/environment-templates) +- [sessions](/api-reference/sessions) +- [artifacts](/api-reference/artifacts) +- [events](/api-reference/events) +- [items](/api-reference/items) +- [subagents](/api-reference/subagents) +- [turns](/api-reference/turns) +- [files](/api-reference/files) +- [skills](/api-reference/skills) +- [vaults](/api-reference/vaults) +- [credentials](/api-reference/credentials) diff --git a/apps/docs/content/docs/api-reference/items.mdx b/apps/docs/content/docs/api-reference/items.mdx new file mode 100644 index 000000000..1c010f4b0 --- /dev/null +++ b/apps/docs/content/docs/api-reference/items.mdx @@ -0,0 +1,26 @@ +--- +title: Items +description: >- + Items. Application API: Project API key. Public schema constrained by the + pinned OpenAI Agents API baseline; documented x_agents_core fields remain Core + extensions. +full: true +_openapi: + method: GET + route: /agents/sessions/{session_id}/items + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Returns supported message and tool Items in first-observation order. + Native engine fields are projected explicitly; unfinished Items on + terminal Turns are incomplete. Cursors are Items of the same tenant + and Session. Any other after value, including a malformed one, returns + 400 invalid_request_error with the message "Invalid session item ID in + `after`". +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/machine/index.mdx b/apps/docs/content/docs/api-reference/machine/index.mdx new file mode 100644 index 000000000..db719d415 --- /dev/null +++ b/apps/docs/content/docs/api-reference/machine/index.mdx @@ -0,0 +1,14 @@ +--- +title: Machine connection API +description: /api/v1 — Route-specific node enrollment, node, daemon, or executor credential. +--- + +Generated local machine contract. These connections reach Core directly, never through Web. + +**Credential:** Route-specific node enrollment, node, daemon, or executor credential. Examples use reserved `example.com` origins. This reference does not send requests or collect credentials. + +This schema covers node configuration, enrollment and identity. Daemon WebSockets and executor connection details are described in the [machine overview](/public-api#machine-connection-api). + +[API namespaces and credentials](/public-api) · [Application reference](/api-reference) · [Administration reference](/api-reference/core) · [Machine reference](/api-reference/machine) + +- [sandbox-node](/api-reference/machine/sandbox-node) diff --git a/apps/docs/content/docs/api-reference/machine/meta.json b/apps/docs/content/docs/api-reference/machine/meta.json new file mode 100644 index 000000000..717a2b47d --- /dev/null +++ b/apps/docs/content/docs/api-reference/machine/meta.json @@ -0,0 +1,7 @@ +{ + "title": "Machine connection API", + "pages": [ + "index", + "sandbox-node" + ] +} diff --git a/apps/docs/content/docs/api-reference/machine/sandbox-node.mdx b/apps/docs/content/docs/api-reference/machine/sandbox-node.mdx new file mode 100644 index 000000000..7ab0fde2a --- /dev/null +++ b/apps/docs/content/docs/api-reference/machine/sandbox-node.mdx @@ -0,0 +1,31 @@ +--- +title: Sandbox Node +description: >- + Sandbox Node. Machine connection API: Route-specific node enrollment, node, + daemon, or executor credential. Generated local machine contract. These + connections reach Core directly, never through Web. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Authenticates with an unconsumed enrollment token, or a retained node + credential with X-OAC-Node-ID. Does not consume the token or expose + E2B credentials. Node files cannot override this specification. + - content: >- + Node machine connection. Consumes a one-use enrollment token; grants + no project or administrator access. Responses contain only explicit + safe fields. core_url is required and must equal the installation + public URL; a different address gets 409 sandbox_node_address_mismatch + and leaves the token unused. + - content: >- + Node machine connection. Authenticates with the retained node + credential; grants no project or administrator access. Responses + contain only explicit safe fields. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/meta.json b/apps/docs/content/docs/api-reference/meta.json new file mode 100644 index 000000000..f96a25397 --- /dev/null +++ b/apps/docs/content/docs/api-reference/meta.json @@ -0,0 +1,21 @@ +{ + "title": "Application API", + "pages": [ + "index", + "agents", + "environments", + "environment-templates", + "sessions", + "artifacts", + "events", + "items", + "subagents", + "turns", + "files", + "skills", + "vaults", + "credentials", + "core", + "machine" + ] +} diff --git a/apps/docs/content/docs/api-reference/sessions.mdx b/apps/docs/content/docs/api-reference/sessions.mdx new file mode 100644 index 000000000..2aa51289f --- /dev/null +++ b/apps/docs/content/docs/api-reference/sessions.mdx @@ -0,0 +1,239 @@ +--- +title: Sessions +description: >- + Sessions. Application API: Project API key. Public schema constrained by the + pinned OpenAI Agents API baseline; documented x_agents_core fields remain Core + extensions. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Cursor and results are scoped to the authenticated execution tenant; + an unknown, malformed or foreign after cursor returns not found. + Optional agent_id matches the immutable root Agent ID, including + inline Agents and historical Sessions whose saved source was updated + or deleted. Omission lists all Agents. Returns the same Environment + and pending-input activity projection as Session retrieval, including + self_hosted Sessions. + - content: >- + The optional Core model_provider bundle resolves from the Session + override, saved Agent defaults, then, for openai_hosted and none, the + deployment default of the resolved harness; self_hosted never uses the + deployment default and none accepts only it. openai_hosted and + self_hosted Sessions that resolve no bundle return 400 + model_provider_required with param x_agents_core.model_provider before + any write. Core encrypts and freezes the resolved bundle; later Agent + or deployment default edits and same-key retries cannot change it. + Keys are never returned. Supports inline configuration or a + tenant-owned saved agent_id with per-Session field replacements. + Execution supports model/instructions, text verbosity, non-deferred + function tools, adapter-qualified multi_agent with persisted Subagent + reads, implicit reasoning, service tier auto and environment type + none, subject to the configured engine. Codex additionally supports + HTTP MCP with service origin (omitted or null on HTTP transport is + saved as service), native allowed_tools and boolean required + defaulting to false. Session vault_ids attach only project-owned + Vaults; credential_id selects an attached static bearer or OAuth + credential for the exact HTTPS URL, while null/omission selects a + unique match or remains anonymous. Session reads, lists and event + snapshots show that implicitly selected credential ID in a null or + omitted credential_id, also after the credential is deleted; anonymous + selections stay null and the stored caller intent is unchanged. After + the input requirement and before any write, a credential_id without + vault_ids, one outside the attached Vaults (one message for missing, + foreign and unattached IDs) or one for another server_url returns 400 + invalid_request_error, and several implicit matches return 409 + conflict_error. Missing decryption configuration fails dispatch + without anonymous fallback. Required initialization uses native + startup before the first native Turn, including cold resume, and + requires a separately advertised capability; exact hosted creation + timing and error parity remain unverified. Other MCP origins and + native OAuth login remain unsupported. The self_hosted profile + requires Codex, an absolute workspace_directory and empty + capability_directories, with optional non-deferred function tools and + HTTP MCP using service origin, optionally authenticated by the + attached Vault rules. Remote MCP and remote Bearer authentication each + require separately advertised combination support; old peers cannot + receive unsupported work. Omitted/null capability_directories use the + empty-list default; self_hosted requires configured execution plus + executor registry. Claude SDK currently requires medium verbosity and + object-root function schemas. It supports anonymous or attached + static-bearer service-origin HTTP MCP on none with boolean required + and separately advertised MCP/bearer/required runtime support. + Required servers must be connected before the first native input is + released; pending or failed startup rejects execution. The shared + Vault selection and immutable binding rules apply; unsupported native + labels/tool names reject before persistence. An attached Vault with no + matching credential may remain anonymous; missing keys or failed + credential lookup/decryption never fall back to anonymous execution. + Omitted stream defaults to false; stream and agent_id cannot be null. + Metadata may be null; non-string values and limit violations return + invalid_request_error with a metadata or metadata. param. The + inline agent uses the Agent create configuration validation with + agent.-prefixed params, reported before the input requirement and + saved-Agent lookup; saved configurations with conflicting tools or + schema roots reject admission with the same errors, and execution + limits keep unsupported_or_invalid_configuration. Hosted network + policy rejections return invalid_request_error with a null param. + Initial input accepts a string or ordered user-message array. Codex + and Claude SDK on none and qualified openai_hosted also accept inline + PNG/JPEG image content; other image combinations and remote URLs are + unsupported. None initial input atomically starts a Turn; self_hosted + initial input is reserved while returning its Environment connection + target, with execution deferred to native readiness and Session + failure on initial timeout. Initial input is required for none and for + streamed creation outside self_hosted. Omitted/null input remains + valid for non-streaming hosted and self_hosted creation. With + stream=true, returns live Session events starting with the committed + creation snapshot and closes right after the first agent.session.idle + recorded when a Turn ends or an input reservation stops being pending, + or any agent.session.failed, without sending later events. A creation + that admitted nothing closes after the snapshot; a settlement that + records no event closes after events up to the cursor read with a + settled Session projection. Required actions keep it open; disconnect + does not cancel execution. The GET events stream remains live-only. + New Sessions retain their authenticated creator; all creation retries + require the same typed subject, including across key rotation. + Saved-Agent retries and inline requests using Vault attachments or + credential references retain caller intent independently of later + resource changes; new hosted inline requests also freeze caller intent + before deployment defaults resolve; unrelated non-hosted inline + retries preserve resolved/default equivalences, and their resolved + hash leaves out any deployment default. Provider keys enter retry + hashes only as fingerprints keyed by the credential key. Unknown + historical creators reject retries; known creators without recorded + intent retain resolved-snapshot retry rules. These conflict policies + are local and not verified hosted parity. A same-key stream=true retry + of an existing creation returns 201 with no events and closes at once; + retry with stream=false or use the GET events stream to recover. + Claude SDK on none and Core-managed Docker openai_hosted supports + qualified object-root json_schema output with medium verbosity, + single-Agent execution and ordinary functions. Hosted execution reuses + native workspace tools and Files/Artifacts; Skills, Plugins, + capability directories, HTTP MCP, Subagent and tool_search + combinations remain unqualified, including inherited template + contents. Other non-text initial input remains unsupported. Basic + Codex and Claude SDK openai_hosted creation requires an explicitly + configured managed provider. The Claude workspace profile supports + non-deferred function tools with text or successful inline PNG/JPEG + results alongside native workspace tools; HTTP MCP remains + unsupported. Idle Sessions provision automatically; initial + provisioning has no caller connection action. Network defaults to + enabled; disabled and restricted exact ASCII hostnames are supported. + Restricted policy requires 1–100 allowed domains. Unsupported hostname + forms and startup installations are rejected. Confidential env, + system/npm/Python packages and ordered setup commands use the shared + initialization lifecycle; requested network applies after setup. + Initial inline and tenant-owned file_id files freeze encrypted bytes + before provisioning, then install through the common Core lifecycle + before native execution or live Files access. With a template + reference, omitted/null files, env, packages and setup_commands + inherit. Non-null files and command lists replace; env overlays by + key; each package manager inherits on omission/null and otherwise + replaces its list. Empty lists clear their selected field. + Tenant-owned environment_template_id references inherit omitted/null + network and allow only narrowing overrides. Inline hosted network:null + retains the enabled default; updating a Template with network:null + resets its saved policy to enabled. Core freezes effective + configuration; template updates/deletion do not alter Session + snapshots or same-intent creation retries. Inline or tenant-owned + skill_reference Skills share initialization. Templates preserve + default/latest/explicit selectors; Session creation freezes concrete + metadata and encrypted content atomically. Skill, Plugin and + capability-directory list omission/null inherit; a non-null list + replaces, including empty-list clearing. Omitted/null Skill version + selectors resolve the default version. Source deletion/default updates + cannot change committed Session Skill contents. Deferred function + discovery uses type-only tool_search and per-function defer_loading in + the qualified single-agent Claude environment:none function profile, + including qualified inline image messages and text results. Explicit + web_search mode disabled and programmatic_tool_calling enabled false + use frozen common Runtime controls. Enabled forms, including those + saved on an Agent, remain unqualified and reject before any write + unless the Session replaces tools. Omitted programmatic configuration + preserves native behavior, a documented difference from the official + default-on behavior. Other combinations remain unqualified; see the + operation coverage. + - content: >- + Returns supported none, self_hosted and basic openai_hosted Session + environments. Self-hosted pending input can require a caller + connection before a Turn exists. Hosted initial provisioning remains + idle until a Turn starts; connection observations are not native + execution readiness. + - content: >- + The metadata field is required in an update body. Send null or {} to + clear it, or supply an object to replace all pairs. Up to 16 string + pairs, with keys at most 64 characters and values at most 512 + characters; violations and non-string values return + invalid_request_error with a metadata or metadata. param. U+0000 + is rejected as a local storage limit. Malformed, missing and foreign + Session IDs share the not-found response. Execution configuration and + activity are unchanged. Returns the same safe Environment and + pending-input activity projection as Session retrieval. + - content: >- + Removes a durably idle or failed Session and its history from the + public API. A Session whose root Turn is queued, in progress or + waiting (including required actions) or whose input reservation is + pending returns 409 conflict_error and is left unchanged; cancel it + and wait until it is idle before deleting. Subagent child Turns and + pending Environment file writes are not checked and do not block + deletion. Repeating the deletion of the caller's own deleted Session + returns the same confirmation; missing and foreign Sessions return + 404. Internal records and native history are retained pending separate + physical cleanup; overlapping stream timing remains unverified. + - content: >- + An empty events array is a resource-authorized no-op; it creates no + execution retry identity, Turn, Item or input receipt. For environment + none, atomically accepts text messages, cancellation and function + results. Messages steer active work or start a queued Turn. The + supported self_hosted profile accepts text-only messages; qualified + Codex and Claude SDK openai_hosted profiles also accept inline + PNG/JPEG. Under the Session lock, matching retries retain their + original target; new active messages append to the current Turn, while + idle messages reserve work and wait up to the original five-minute + connection/admission deadline. Return 202 only after durable + admission, without claiming native application; active messages create + no Turn or reservation. Cancellation-only prepared-environment batches + use existing durable cancellation admission and return 202 without + waiting for native exit; a new cancellation conflicts while a pre-Turn + reservation is pending. Homogeneous tool_result-only + prepared-environment batches reuse existing scoped result admission + and application receipts without creating a Turn or bypassing a + pending reservation. Mixed prepared-environment batches remain + unsupported. HTTP expiry/cancellation use local 409 + environment_input_expired/environment_input_cancelled errors. New + input on a Session whose hosted Environment failed to provision + returns the observed 409 conflict_error "the hosted environment failed + to provision"; input already waiting when it fails and expired + Environments keep the local 409 environment_unavailable. Input the + Session cannot accept in its current state, such as a result after + cancellation or a batch while earlier input is pending, and a result + that differs from the call's saved result return 409 with type and + code conflict_error; reusing an Idempotency-Key with a different batch + returns the local 409 idempotency_conflict. Inside an owned Session, a + result for an unknown call or for a call of another Turn returns 400 + invalid_request_error and changes nothing; missing and foreign + Sessions return 404. Losing execution ownership returns 503. The + response write deadline accommodates the admission window for either + prepared Environment, independently of new-hosted-admission and + executor URL settings. Disconnecting the waiting HTTP request does not + cancel retained work or restart its deadline. Retry keys identify the + whole ordered batch. Function output accepts text or ordered + text/image parts subject to engine support; Claude SDK accepts text + results and, on none and qualified openai_hosted, successful inline + PNG/JPEG results, preserving ordered content; error images and remote + references reject before admission. Native image resizing may change + bytes. Runtime image-result support is checked only for image-bearing + delivery. Codex and Claude SDK on none and qualified openai_hosted + accept ordered inline PNG/JPEG image messages. Self-hosted profiles + and other engines remain text-only; remote image URLs are unsupported. + Image references are retained unchanged without service-side + downloads. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/skills.mdx b/apps/docs/content/docs/api-reference/skills.mdx new file mode 100644 index 000000000..8757bc526 --- /dev/null +++ b/apps/docs/content/docs/api-reference/skills.mdx @@ -0,0 +1,51 @@ +--- +title: Skills +description: >- + Skills. Application API: Project API key. Public schema constrained by the + pinned OpenAI Agents API baseline; documented x_agents_core fields remain Core + extensions. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Lists tenant-owned metadata in timestamp order. Default page size 20, + maximum 100. Limit 0 returns an empty page whose has_more reports + whether any Skill follows the cursor; exact hosted defaults remain + unverified. + - content: >- + Accepts one ZIP in files or a directory in files[]. Applies the + qualified portable Skill bundle profile. No Beta header is required; + full hosted upload limits and activation extensions are not qualified. + - content: >- + Returns tenant-owned metadata without decrypting contents or starting + Runtime. No Beta header is required. + - content: >- + Changes only the tenant-owned default pointer; immutable versions and + existing Session snapshots remain unchanged. + - content: >- + Deletes tenant-owned source bundles. Existing Session installation + snapshots remain independent. + - content: >- + Downloads an authorized ZIP using the default pointer when no concrete + version is supplied. Exact upstream unversioned selection, content + headers and range semantics remain unverified. + - content: >- + Orders by version number; after identifies a version resource, not a + version number. An after value that does not begin with skillver, or a + version of another Skill, returns 400 invalid_value with param after; + a missing version returns not found. No contents are decrypted. Limit + 0 returns an empty page whose has_more reports whether any version + follows the cursor. + - content: >- + Deleting the only remaining version also deletes the Skill; existing + Session installation snapshots remain independent. The default version + cannot be deleted while other versions remain. Version numbers are + never reused. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/subagents.mdx b/apps/docs/content/docs/api-reference/subagents.mdx new file mode 100644 index 000000000..e2f3346ee --- /dev/null +++ b/apps/docs/content/docs/api-reference/subagents.mdx @@ -0,0 +1,49 @@ +--- +title: Subagents +description: >- + Subagents. Application API: Project API key. Public schema constrained by the + pinned OpenAI Agents API baseline; documented x_agents_core fields remain Core + extensions. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Includes nested and closed Subagents. Cursors are Subagents of the + same tenant and Session. Any other after value, including a malformed + one, returns 400 invalid_request_error with the message "Invalid + resource ID in `after`". A limit outside 1–100 is rejected. + - content: >- + Returns this Session's persisted Subagent. Active includes idle + between Turns. Resuming preserves opened_at and clears closed_at. + Unknown or inaccessible parent scopes return not found. + - content: >- + Returns only this Subagent's own Items across all its Turns, not its + descendants' Items. Cursors are Items of the same tenant, Session and + Subagent. Any other after value, including a malformed one, returns + 400 invalid_request_error with the message "Invalid session item ID in + `after`". + - content: >- + Includes this Subagent's Turns after resume, with the Session's Agent + ID as agent_id. Cursors are Turns of the same tenant, Session and + Subagent. Any other after value, including a malformed one, returns + 400 invalid_request_error with the message "Invalid resource ID in + `after`". Missing recorded usage remains null. A limit outside 1–100 + is rejected. + - content: >- + Returns a Turn owned by this Subagent. Its agent_id is the Session's + Agent ID and its subagent_id identifies the Subagent. Session Turn + routes do not return child Turns. Unknown or inaccessible parent + scopes return not found. + - content: >- + Returns Items owned by this exact Subagent Turn. Cursors are Items of + the same tenant, Session, Subagent and Turn. Any other after value, + including a malformed one, returns 400 invalid_request_error with the + message "Invalid session item ID in `after`". +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/turns.mdx b/apps/docs/content/docs/api-reference/turns.mdx new file mode 100644 index 000000000..e3dac307c --- /dev/null +++ b/apps/docs/content/docs/api-reference/turns.mdx @@ -0,0 +1,28 @@ +--- +title: Turns +description: >- + Turns. Application API: Project API key. Public schema constrained by the + pinned OpenAI Agents API baseline; documented x_agents_core fields remain Core + extensions. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Returns the Session's root Turns in creation order; Subagent Turns are + listed through the Subagent Turn routes. The cursor belongs to the + same Session and tenant; any other after value, including a malformed + one or a Subagent Turn ID, returns not found. Usage contains the + latest recorded complete token breakdown; missing measurements remain + null. + - content: >- + Returns a root Turn of this Session. A Subagent Turn ID returns the + same not found error as a missing Turn; read it through the Subagent + Turn routes. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/api-reference/vaults.mdx b/apps/docs/content/docs/api-reference/vaults.mdx new file mode 100644 index 000000000..3bb1698f4 --- /dev/null +++ b/apps/docs/content/docs/api-reference/vaults.mdx @@ -0,0 +1,50 @@ +--- +title: Vaults +description: >- + Vaults. Application API: Project API key. Public schema constrained by the + pinned OpenAI Agents API baseline; documented x_agents_core fields remain Core + extensions. +full: true +_openapi: + toc: [] + structuredData: + headings: [] + contents: + - content: >- + Lists project-owned Vaults independently of execution. An unknown, + malformed or foreign after cursor returns not found. Includes active + and archived records by default. Status accepts a scalar, the SDK's + status[] array or both, filtering by their union; a repeated scalar is + rejected. Limits default to 20 and clamp to 1–100. Equal creation + times use ID ordering; exact hosted errors and concurrent-page + behavior remain unverified. Archive/delete lifecycle is not + implemented. + - content: >- + Creates a project-owned Vault independently of execution. Omitted name + stays null; a supplied string is trimmed and must contain 1–256 UTF-8 + bytes. Explicit null name is invalid. Omitted/null metadata becomes an + empty object; non-string values return invalid_request_error with a + metadata. param. Metadata has a local 64 KiB encoded storage + bound. U+0000 in stored strings is rejected as a local storage limit. + Credentials, Session binding and hosted error/retry parity remain + incomplete. + - content: >- + Reads a Vault owned by the authenticated project without resolving + credentials, Sessions or execution devices. Missing and foreign IDs + share the same not-found response; exact hosted error semantics remain + unverified. + - content: >- + Atomically removes the authenticated project's Vault and all its + stored Credentials without an encryption key, decryption or external + requests. Existing Session snapshots, history and recorded retries + retain their frozen identities; subsequent credential lookups fail + without reselection or anonymous fallback. Already-resolved tokens and + running Sessions are not revoked or cancelled. Missing/repeated + deletion locally returns 404. Exact hosted archive, post-delete + visibility and concurrent/error semantics remain unverified; physical + erasure from native history, WAL or backups is not established. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + + \ No newline at end of file diff --git a/apps/docs/content/docs/bootstrap-projects-keys.mdx b/apps/docs/content/docs/bootstrap-projects-keys.mdx new file mode 100644 index 000000000..31aef04ce --- /dev/null +++ b/apps/docs/content/docs/bootstrap-projects-keys.mdx @@ -0,0 +1,101 @@ +--- +title: "Sign in and issue application keys" +description: "Keep the Core key on the management side and issue Project API keys through Web." +--- + +`services/core-console` serves built Web assets, signs administrators in with the +Core key and forwards every signed-in, same-origin `/core/v1/*` request to Core. The +backend contract and the React screens that use it are implemented; the console has +no execution controls. + +## Connection model + +The browser calls same-origin `/core/v1` through `AdminClient` and +`CoreMetricsClient`, and the `/core/v1/sandbox` management routes through the +sandbox client. The console server forwards each signed-in `/core/v1/*` request by +prefix to its configured Core upstream, with the Core key (`OAC_WEB_CORE_KEY_FILE`) +as the upstream credential; Core alone decides whether the route exists. Browser +code must never receive that credential. + +Applications call Core's `/v1` directly with their own Project API keys and the +public API's route-specific headers. Nodes and Runtime daemons call Core's `/api/v1` +directly with their own machine credentials. The console returns 404 for `/v1` and +`/api/v1`, even with an explicit Bearer token. Deployment routing must send both to Core. +The console endpoint and the public application endpoint serve different purposes, +even if they share a host. + +Use the [installation guide](/install) for deployment and the +[operations guide](/troubleshooting) for storage, upgrades and node +management. A Core, Web and PostgreSQL installation may have zero execution nodes. +Opening the console neither allocates compute nor invokes a model. Deployment +sandbox management selects E2B, Docker or microsandbox independently of an +application's caller-managed `self_hosted` Runtime, including its own E2B setup. + +## Server configuration and login + +The installer generates these from its `config.json` and `secrets/`; set them +yourself only for a Web you run without the installer. + +| Setting | Purpose | +| --- | --- | +| `OAC_WEB_ADDR` | Console listener address | +| `OAC_WEB_ORIGIN` | Exact browser-facing origin used for host and origin checks | +| `OAC_WEB_UPSTREAM` | Core HTTP(S) origin, without credentials, query or resource path | +| `OAC_WEB_CORE_KEY_FILE` | Absolute path to the private regular file containing the Core key | +| `OAC_WEB_DIST` | Absolute directory containing the built Web assets | + +The console exposes `GET /console/auth` and `POST /console/auth/login` and +`/logout`. The administrator signs in with the deployment's Core key, which the +installer writes to `secrets/core.key` under the installation directory (by default +`~/.oac/core/secrets/core.key`; see [Core key](/troubleshooting#core-key)). +The server compares it in constant time and answers with a same-origin session +cookie held only in its memory; the key is never logged or returned, and the +browser does not store it. A console restart or a Core key rotation requires +signing in again. There are no console accounts, usernames or setup step, and the +Core key cannot call `/v1`. `GET /console/config` provides safe console +configuration to an authenticated browser. + +Use TLS for remote browser access and loopback listeners for local development. +Preserve the host/origin checks and the forwarding rules. The console refuses +requests with an `Upgrade` header, CONNECT and TRACE, and any path that `safePath` +rejects: an encoded `%`, dot segments, empty segments or backslashes. Before +forwarding, it strips the browser's Authorization, Cookie, Origin and Referer headers +and overwrites the actor header (`X-Core-Console-Actor`) with `console`, so a browser +cannot choose the audit actor label the service reports. The label is caller-declared +and display only. Keep deployment, application, node and provider credentials out of +`VITE_*`, browser storage, source files, URLs and logs. + +## Projects and application keys + +Installation creates no Project or application key. An administrator creates a +Project and issues named keys on the console's **Projects and keys** page, which +uses the [administrator API](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/contracts/agents-api/admin-api.md), or with that +API directly. +The Project owns one tenant and one principal; its keys share assets and permissions. +Writes retain each key's provenance. All Projects and application keys live in +PostgreSQL, independently of deployment configuration. + +Issuance returns plaintext once; Core stores its digest. Deliver the new key to the +application privately. Rotate by issuing a replacement in the same Project and +revoking the old key. Archive disables every key while retaining assets and admitted +work. Ordinary metadata reads cannot recover plaintext. + +## Verification and diagnosis + +1. Core `/healthz` proves process liveness only. +2. Console login followed by `GET /core/v1/projects` proves the authenticated + browser-to-console and console-to-Core path. +3. A Project key must work on its public resources and fail on management routes. + The Core key must fail on `/v1`; `/v1` through the console stays 404. +4. Cross-origin management writes must be rejected. Audit actor labels must ignore + a forged browser header. +5. Runtime observations and history report execution state separately from the + sandbox deployment read (`GET /core/v1/sandbox/deployment`). Neither a login nor + a successful deployment read proves model or sandbox readiness. + +A console login failure belongs to console authentication. An upstream 401 on a +management request points to the console's Core key or Core connection. A resource +deletion conflict must remain visible; it does not authorize an execution call. +Node and daemon `/api/v1` routes and native Runtime interfaces retain their own authentication. + +[Repository source](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/docs/web/core-connection.md) diff --git a/apps/docs/content/docs/bootstrap-projects-keys.zh.mdx b/apps/docs/content/docs/bootstrap-projects-keys.zh.mdx new file mode 100644 index 000000000..1c1dd494e --- /dev/null +++ b/apps/docs/content/docs/bootstrap-projects-keys.zh.mdx @@ -0,0 +1,10 @@ +--- +title: "Sign in and issue application keys · 中文导读" +description: "当前版本的中文导读;完整操作步骤见英文正文。" +--- + +使用 Core key 登录 Web。应用开发者在项目中获取 Project API key,设置 OPENAI_BASE_URL 与 OPENAI_API_KEY。Core key 不能用来调用 /v1,应用 key 也不能调用管理或机器接口。 + +此页为中文导读,完整且与当前源码同步的步骤请阅读[英文正文](/en/bootstrap-projects-keys)。 + +[安装](/install) · [配置](/configure) · [API 与凭据](/public-api) · [节点](/hosted-providers) · [应用示例](/quickstart) diff --git a/apps/docs/content/docs/concepts.mdx b/apps/docs/content/docs/concepts.mdx new file mode 100644 index 000000000..cd2b5bd00 --- /dev/null +++ b/apps/docs/content/docs/concepts.mdx @@ -0,0 +1,88 @@ +--- +title: "Concepts and ownership" +description: "Projects, credentials and the boundary between applications, administration and execution." +--- + +OpenAgentCore is an open-source implementation of the OpenAI Agents API. Its public +contract follows the repository's pinned upstream baseline; documented native +harness differences remain explicit. Core extensions must not silently change +upstream resource shapes or execution semantics. + +## Three namespaces, three credentials + +Core serves three namespaces, each with one kind of caller and credential: + +- `/v1`: applications with a Project API key. Exactly the pinned official routes; + Core-only fields live only in `x_agents_core`. +- `/core/v1`: Core Web's server and operator scripts with the Core key. Everything + about operating the deployment, including credential issuance. +- `/api/v1`: nodes, Runtime daemons and self-hosted executors with machine + credentials issued through `/core/v1`; each works only on its own routes. + +Core enforces the separation: the Core key cannot call `/v1`, API keys cannot call +`/core/v1`, and neither works on `/api/v1`. Web calls only `/core/v1` and keeps +the Core key on its server; users sign in to Web with it. + +This is a separation of API authority, not a claim that a deployment administrator +cannot possess application credentials. An administrator can issue an API key and +use it separately. The console itself has no impersonation or execution operation. +API-key plaintext is returned once on issuance, never on reads. + +## Projects own assets + +A Project owns one execution tenant and its assets. Multiple named API keys belong +to the Project and share its principal, permissions and resources. Each write keeps +its actual key identity for provenance. There are no Core users, roles, memberships +or read-only keys. Names are labels; stable IDs identify Projects and keys. + +Projects and application API keys live only in PostgreSQL. The console and +management API use the same records. Configuration contains deployment settings, +not application credentials or Project definitions. Issue a new key in the same +Project and revoke the previous one to rotate credentials. Revocation affects only +that key and preserves assets, provenance and accepted execution. Explicit Project +archive revokes every key and blocks new issuance in that Project. +Administrators can still inspect and delete resources in archived Projects. + +Store only API-key digests and necessary metadata. Return plaintext once, on +issuance, and never replay it after an uncertain response. Project/key mutations +and administrator audit commit together. Database authentication failures fail +closed. The Core key is managed separately, in deployment configuration. + +Parsar product identities, workspaces, business permissions and collaboration +remain outside Core. Parsar is an ordinary API-key holder in a Project. + +## Resource isolation and administrator authority + +Agent API reads, writes and references are scoped to the authenticated key's Project. +A foreign resource remains indistinguishable from an absent resource under the +existing public operation's rules. Deployment nodes, configured model endpoints +and startup settings are deployment infrastructure, not shared business assets. + +Administrators can inspect resources and execution history, delete resources under +the same rules as their public deletion operations, manage Projects and API keys, +issue node enrollment tokens and self-hosted executor credentials, and query +operational counts and usage. They cannot use management endpoints to +create, copy or edit arbitrary assets, start a Session, send an event, cancel +work, or read stored credentials. Project keys share all assets within their +Project; nothing is shared or copied across Projects. + +## Secrets and evidence + +Credential values, model credentials and confidential template initialization are +write-only through resource APIs, including administrator reads. Public metadata +projections are reused by the management API. This does not redact arbitrary +user-authored conversation text, Skill source or Artifact content: administrators +who inspect those records see their recorded contents. + +Public writes retain their actual API-key provenance. Administrator writes retain +a separate audit identity and target Project. The console's fixed actor label is +display-only; Core trusts the Core key, not that forwarded label. Audit failure rolls +back the business transaction. Reads are not audited. Resources from the removed +copy operation keep their `admin_copy` ownership, distinct from historical unknown +ownership. No request bodies, secrets or file contents enter audit records. + +Do not add product users, RBAC, cross-Project shared assets, administrator execution, or old +private-protocol compatibility to this management model. Existing public +execution and Runtime ownership rules remain in [CONTRIBUTING.md](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/CONTRIBUTING.md). + +[Repository source](https://github.com/MiniMax-AI/parsar-core/blob/75bf4484ba957344ae374354858bbdfe104f5c4f/docs/design-principles.md) diff --git a/apps/docs/content/docs/concepts.zh.mdx b/apps/docs/content/docs/concepts.zh.mdx new file mode 100644 index 000000000..c0fc452ec --- /dev/null +++ b/apps/docs/content/docs/concepts.zh.mdx @@ -0,0 +1,10 @@ +--- +title: "Concepts and ownership · 中文导读" +description: "当前版本的中文导读;完整操作步骤见英文正文。" +--- + +Project 拥有应用资源和执行身份。同一项目的 API keys 共享资源;Core key 只用于管理。Core 负责执行事实,Web 不复制执行所有权。 + +此页为中文导读,完整且与当前源码同步的步骤请阅读[英文正文](/en/concepts)。 + +[安装](/install) · [配置](/configure) · [API 与凭据](/public-api) · [节点](/hosted-providers) · [应用示例](/quickstart) diff --git a/apps/docs/content/docs/configure.mdx b/apps/docs/content/docs/configure.mdx new file mode 100644 index 000000000..11653093f --- /dev/null +++ b/apps/docs/content/docs/configure.mdx @@ -0,0 +1,253 @@ +--- +title: "Configuration reference" +description: "The operator config.json, generated files and database-owned runtime settings." +--- + +Every setting of a Core installation has exactly one home. There are two kinds: + +| Kind | Examples | Home | Change it with | Takes effect | +| --- | --- | --- | --- | --- | +| [Process settings](#process-settings-configjson) | Public URL, ports, logging, harnesses, execution concurrency, audit retention, OAuth origins, database pool, Runtime history export | `config.json` in the installation directory (default `~/.oac/core`) | Edit the file, then run `oac apply` | `oac apply` restarts the services that read the changed settings | +| [Runtime settings](#runtime-settings-web) | Sandbox backend and size, nodes, Projects and keys, default models, executor credentials | Core's PostgreSQL database | Web, or the Core API (`/core/v1`) with the Core key | At once, without a restart | + +Web's **System** page shows both: the installation's addresses, the process settings +read-only under **Startup settings** with the path of `config.json` and the apply +command, the default models, and the sandbox configuration. Secrets live in +[`secrets/`](#secrets-and-identity), one copy each. Each setting is set in one place; +the files in `generated/` are only derived from `config.json`. No configuration file +defines Projects or API keys. + +## Process settings: config.json + +The installer writes every setting that applies to the installation's +[mode](/install#modes), so the file shows each value. Installer flags +such as `--public-url`, `--core-port` and `--web-port` only seed it. To change a +setting, edit the file and apply it: + +```sh +~/.oac/core/oac apply --dry-run # show the changed settings, files and restarts +~/.oac/core/oac apply +``` + +### How oac apply works + +1. It validates `config.json` and changes nothing if a value is invalid. `mode` and + `native_core` are fixed after installation; to change them, install into a new + directory. +2. It writes the files Core, Web and Compose read into `generated/`: `compose.json`, + `core.env`, `core-key-digests.json`, `settings.json` and, when used, + `runtime-history.json` and the native Core unit. Don't edit them. A generated file + edited by hand stops `apply` until you move the change into `config.json` and run + `oac apply --discard-edits`, which keeps the edited copy as + `generated/.edited-