diff --git a/.agents/repo.md b/.agents/repo.md index d7fdba969a..ca7cf72bd5 100644 --- a/.agents/repo.md +++ b/.agents/repo.md @@ -129,7 +129,9 @@ Tale is a monorepo on Bun workspaces; every workspace script runs through `` (`NAV-F3`, `CHAT-B1`, `A11Y-A2`) — the prefix is the suite, the letter is what kind of check it is (F functional, B boundary, A accessibility, P performance). **Append, never renumber.** Ship new behaviour with its box, or with a row in `reference/automation.md` - when a spec owns it end to end. The platform's `tests/manual/scripts/check-guide.ts` is the + when a spec owns it end to end — a box a spec takes over moves to + `reference/automation/.md`, one file per suite so parallel PRs do not append to the same + lines. The platform's `tests/manual/scripts/check-guide.ts` is the content half of the gate: it resolves the i18n keys, routes and spec names a suite cites, and is an authoring aid rather than a CI job — run it on every suite you touch. - **Judge the platform against its user docs** — the pages under `docs/en/platform/` are the @@ -156,7 +158,14 @@ Tale is a monorepo on Bun workspaces; every workspace script runs through - **Pencil**: `design/docs/comments.md` is strictly designer↔developer UI communication. Put code-level bug analysis in a GitHub issue, never there. - **Git**: branch off `main`, never commit to it; PRs squash-merge (linear history), so the PR - title must itself be commitlint-shaped. + title must itself be commitlint-shaped. **Land through the merge queue**: `gh pr merge --auto` + (the queue sets squash) queues a PR once its checks and review pass, and the queue re-runs CI on the PR stacked + on `main` plus the PRs ahead of it. A branch does not have to be up to date with `main` — never + rebase, merge `main` in or `gh pr update-branch` just because a PR reads *behind*; rebase only for + a real conflict (`git merge-tree --write-tree --name-only origin/main HEAD`), and never bypass + the queue with an admin merge. A PR's own CI is the fast tier (format, lint, types, knip, unit, + commitlint, SAST); E2E, Build, CLI, UI, Browser and backend integration run only in the queue — + run the ones your change touches locally before queueing ([CI guide](../.github/CI.md#merge-queue)). - **A release tags one validated candidate** — a version tag goes only on the full `main` SHA whose `build.yml` candidate run and release gate (`tools/cli/scripts/release-candidate-gate.ts`) passed, and merging never freezes for it: @@ -535,14 +544,6 @@ default means deleting the override and fixing what surfaces: project, then `assertTaskWorkable` — an archived task stays deletable) so its `TASK_FORBIDDEN` never leaks, `deleteTask`'s owner/admin rule surfaced as 403 `ROLE_FORBIDDEN`, and a contract bump. -- **A webhook bind does not say whether the deployed `inputs` schema admits a delivery** — a - `PUT …/triggers` of kind `webhook` answers `deployed`, and every delivery then dies on 400 - `AUTOMATION_INPUT_INVALID` when the version's `inputs` schema does not take - `{trigger: "webhook", payload}` at the top level (2026-09, round g). Paying it down means an - additive `inputsAcceptDelivery` on the bind: compile the deployed version's `inputs` with the - stepper's own `compileSchemaCached` key, check `{trigger: 'webhook', payload: {}}`, and - judge only issues at `trigger`/`payload` or a top-level `is required` (requirements inside - `payload.*` are not judged); absent without a schema or a deployment. - **An exhausted `repeatUntil` is only a trace note** — a `repeat` node that spends its `maxRepeats` budget without its condition becoming true finishes the run `success` with the last pass's output and a free-text `trace[].note`; nothing structured says the loop gave up @@ -760,6 +761,9 @@ xlsx,odt}.ts`) still reach the catch-all as `failed` + `indexer_error` and are r that the old execution is retired, an authorized decision about unknown external effects, and a guarded release contract. Never clear the hold or manufacture node-attempt evidence merely because a stop was requested, a lease expired, or the old containers disappeared. + Erasure deletes other eligible subject runs and records the held runs separately on a partial + receipt; organization deletion returns an explicit conflict. These are containment, not a + retirement contract or a release of the holds. - **A run lease compares the clocks of the hosts it spans** — the stepper stamps and checks the 30 s lease with its own host's clock (`claimRun`, `heartbeatRun`, `sweepOverdueRuns`), and the read model's `stalled` compares it with the database's. Workers on hosts whose clocks differ by diff --git a/.commitlintrc.json b/.commitlintrc.json index a984573e11..df8be8a01a 100644 --- a/.commitlintrc.json +++ b/.commitlintrc.json @@ -14,6 +14,7 @@ "designs", "docs", "e2e", + "load", "manual", "marketing-ui", "opengrep", diff --git a/.env.example b/.env.example index 09a321aec0..54dc360928 100644 --- a/.env.example +++ b/.env.example @@ -121,6 +121,12 @@ DB_PASSWORD=tale_password_change_me # against a managed Postgres's max_connections. # DATABASE_POOL_MAX=10 # +# Connections ONE backend-api process opens for sign-in session lookups — +# every authenticated request reads through this pool. Raise it for replicas +# serving thousands of requests a second; it counts per replica against +# max_connections beside DATABASE_POOL_MAX. +# AUTH_DATABASE_POOL_MAX=5 +# # Jobs ONE backend-worker process runs at once per job queue — indexing, # crawls, automations and agent turns each get this many (1-64); agent turn # starts get at least 8 and the drive windows of live agent turns at least 16 @@ -138,6 +144,11 @@ DB_PASSWORD=tale_password_change_me # worker at the default WORKER_CONCURRENCY never reaches it; a deployment # serving one organization with more step slots than this raises it or sets 0. # AUTOMATION_ORG_CONCURRENCY=8 +# How many processes a backend process evaluates automation code in (1-16). +# Unset: 2 for backend-api; for backend-worker one per CPU core but one, at +# most 4. One starts at first; another only while all are busy; one beyond +# the first stops after five idle minutes. About 75 MB each while running. +# AUTOMATION_RUNNER_PROCESSES= # How long a stopping backend process waits for its jobs, in milliseconds # (1000-600000). Unset: 15000 for backend-api, 90000 for backend-worker. A # stopping worker hands its automation runs to another one first; a step still @@ -299,7 +310,9 @@ TALE_AUDIT_PEPPER=9c1e5b7d3a2f8064e1c7a9d5b3f2e8c604a7d1b9e5c3f8a2d6b0e4c7a1f9d3 # Codex) may sit with nobody draining its output before the sandbox daemon # reaps it. A SLIDING window, re-armed on every drain attach — not an absolute # cap on the turn. Raise it when long agent turns on a slow host are reaped as -# orphans; defaults to 30 minutes. +# orphans; defaults to 30 minutes. A running agent turn also waits out an +# unreachable sandbox service for a third of this, at most 10 minutes (exactly +# 10 minutes at the default), before it fails; lowering it shortens that wait. # TALE_EXTERNAL_TURN_DEADLINE_MS=1800000 # Optional inner Docker address pool on Docker or Kubernetes (DinD agents only). @@ -365,6 +378,53 @@ TALE_AUDIT_PEPPER=9c1e5b7d3a2f8064e1c7a9d5b3f2e8c604a7d1b9e5c3f8a2d6b0e4c7a1f9d3 # Recreate the backend services after changing it. # SANDBOX_LLM_GATEWAY_STREAM_IDLE_TIMEOUT_SECONDS=600 +# ============================================================================ +# OPTIONAL: Sandbox LLM gateway request workers per provider +# ============================================================================ +# How many requests the LLM gateway sends at once to one provider. The gateway +# keeps that many request workers for every provider it holds, from the moment +# it loads the provider and whether or not anything calls it, so the gateway's +# memory grows with these values. A request that finds every worker busy waits +# in a queue 16 times as long. A whole number from 1 to 5000: a larger one is +# held to 5000 and any other value falls back to the default, each with a +# warning in the backend log. +# +# PROVIDER_CONCURRENCY sizes a built-in provider (OpenAI, Anthropic, +# OpenRouter, ...), one shared by every organization. CUSTOM_PROVIDER_CONCURRENCY +# sizes a custom provider, which the backend sets up once per organization and +# model, so their number grows with organizations times custom models. A +# built-in provider's Anthropic lane for agent runtimes (Claude Code through +# OpenRouter's Anthropic endpoint) gets an organization-and-model provider of +# its own and is sized by CUSTOM_PROVIDER_CONCURRENCY too. Raise +# the custom value when an organization's API keys send more simultaneous +# requests to one custom model. The backend reads both and configures the +# gateway; a changed value reaches each provider at the next sandbox session +# or model-endpoint request of an organization that uses it, and a lowered one +# reaches every other provider the gateway holds two to five minutes after the +# backend's first sandbox session or model-endpoint request, except one whose +# upstream host no longer resolves (a removed connector's, say): the gateway +# refuses to rewrite it and the backend logs a warning naming it. Delete such +# a provider from the gateway (DELETE /api/providers/, see the +# environment reference); one still in use is set up again at its next +# session or request. Recreate the backend services after changing them. +# SANDBOX_LLM_GATEWAY_PROVIDER_CONCURRENCY=512 +# SANDBOX_LLM_GATEWAY_CUSTOM_PROVIDER_CONCURRENCY=64 + +# ============================================================================ +# OPTIONAL: Sandbox LLM gateway request log retention +# ============================================================================ +# How many days the LLM gateway keeps its request log; defaults to 3. The log +# holds one row per model call (model, tokens, cost, timing) and never a +# prompt or an answer. Tale does not read it: budgets, spend and usage come +# from the gateway's per-key budget counters, so a shorter log changes none of +# them. The backend pushes the value to the gateway, which applies it at its +# first restart after that push: it then deletes older rows, and again about +# once a day. A `tale deploy` restarts the gateway before the new backend +# pushes the value, so a change takes effect from the following deploy, or +# sooner when the sandbox-llm-gateway service is restarted once. A whole +# number of days, at least 1; any other value is ignored with a warning. +# SANDBOX_LLM_GATEWAY_LOG_RETENTION_DAYS=3 + # ============================================================================ # OPTIONAL: Sandbox spawner URL # ============================================================================ @@ -408,9 +468,10 @@ TALE_AUDIT_PEPPER=9c1e5b7d3a2f8064e1c7a9d5b3f2e8c604a7d1b9e5c3f8a2d6b0e4c7a1f9d3 # service's environment and recreate it to apply. Counts include running idle # containers; the cap does not reserve CPU/RAM. An organization's three workload # limits add up automatically and cannot be saved above this capacity. -# Unset on a Docker host, the spawner sizes it from the host's memory (8 to 256: -# 19 on 16 GiB, 9 where agent sessions run Docker inside) and starts a new -# session only while the host keeps SANDBOX_MIN_FREE_MEMORY free. Set it on +# Unset on a Docker host, the spawner sizes it from the host's memory and CPUs +# (8 to 256, at most two per CPU: 16 on 16 GiB with 8 CPUs, 9 where agent +# sessions run Docker inside) and starts a new session only while the host +# keeps SANDBOX_MIN_FREE_MEMORY free. Set it on # Kubernetes, with a remote Docker daemon or beside other heavy workloads, # starting from measured task peaks and leaving CPU/RAM for platform services # and the host. See docs/en/self-hosted/configuration/environment-reference.md @@ -419,14 +480,27 @@ TALE_AUDIT_PEPPER=9c1e5b7d3a2f8064e1c7a9d5b3f2e8c604a7d1b9e5c3f8a2d6b0e4c7a1f9d3 # Memory a new session must leave free on the Docker host (default: a tenth of # it, at least 1g). # SANDBOX_MIN_FREE_MEMORY=2g +# CPU pressure on the Docker host (the kernel's PSI "some avg10", in percent) +# from which new sessions start one at a time, one every ten seconds in the +# order they asked (0 turns the check off; a kernel without PSI ignores it). +# SANDBOX_CPU_PRESSURE_PERCENT=60 # Free space a new session must leave on the disk the session workspaces live # on (default: a twentieth of it, at least 2g, at most 20g; 0 turns the check # off). Below it, new sessions wait and the build caches of organizations that # are not building go first. # SANDBOX_MIN_FREE_DISK=10g +# Free space below which that disk is critical: running sessions' writes are +# about to fail, so released idle sessions with Docker inside are stopped at +# once (their inner image stores go with them) and the largest workspaces are +# logged (default: a quarter of the floor, at least 1g; never above the floor, +# and 0 or a floor of 0 turns it off). +# SANDBOX_CRITICAL_FREE_DISK=2g # How long a session that no turn or run holds stays up once idle, in ms (agent # sessions with Docker inside keep the full idle window). # SANDBOX_SESSION_RELEASED_IDLE_MS=300000 +# Minutes a session command may print nothing while using under 1% of one CPU +# before the sandbox ends it as stalled (a hung agent); 0 turns the check off. +# SANDBOX_EXEC_STALL_MINUTES=45 # Workloads allowed to start inner Docker when DinD is enabled. Unset keeps # project,workflow; project allows Docker only for project agents; none disables # it for both. Applies to newly created sessions; existing compute is retained. @@ -435,6 +509,10 @@ TALE_AUDIT_PEPPER=9c1e5b7d3a2f8064e1c7a9d5b3f2e8c604a7d1b9e5c3f8a2d6b0e4c7a1f9d3 # Leave memory unset for 4g per session without inner Docker, or 8g with it. # SANDBOX_AGENT_CPUS=2 # SANDBOX_AGENT_MEMORY=4g +# CPU weight of agent sessions and their build-cache helpers when the host is +# saturated (Docker's default, which the platform services keep, is 1024; +# default-profile sessions use 128). An idle host still grants the full quota. +# SANDBOX_AGENT_CPU_SHARES=256 # Backend API + worker: profile for NEW agent/workflow workspaces. agent-light # keeps coding tools and persistent files without Docker/BuildKit. Existing # workspace rows retain their profile. Recreate backend services after changing. @@ -465,13 +543,43 @@ TALE_AUDIT_PEPPER=9c1e5b7d3a2f8064e1c7a9d5b3f2e8c604a7d1b9e5c3f8a2d6b0e4c7a1f9d3 # keeps when it stops for want of agent sessions: pruned to this size, least # recently used first, right before the stop. # SANDBOX_BUILDKITD_IDLE_CACHE=5g +# How long an organization's build-cache helpers keep running once no agent +# session that builds may use them (ms, at least 60000). A helper launched with +# the current image and settings starts again by id on the next build. +# SANDBOX_BUILDKITD_IDLE_MS=600000 +# The most build cache each organization's build-cache helper keeps (at least +# 1g). Unset: a tenth of the session disk, from 1g up to 20g. +# SANDBOX_BUILDKITD_MAX_CACHE=20g # How long an organization's stopped build-cache helpers keep their caches # before the spawner removes them (whole days or hours; off keeps them). # SANDBOX_BUILDKITD_CACHE_RETENTION=14d +# How long an organization's pip, npm and bun package caches outlive their +# last use before the spawner removes them (whole days or hours; off keeps +# them until the organization is deleted). +# SANDBOX_PACKAGE_CACHE_RETENTION=14d # Connections the sandbox egress proxy serves at once for all sessions together # (read by sandbox-egress; recreate it to apply). A higher value needs the # egress container's pids and open-file limits raised with it. # SANDBOX_EGRESS_MAX_CLIENTS=2000 +# Connections one session (one client address) may hold open to the sandbox +# egress proxy at once, so no session takes that whole pool (read by +# sandbox-egress; recreate it to apply). 0 turns the cap off. +# SANDBOX_EGRESS_MAX_CONNECTIONS_PER_SESSION=256 +# Kubernetes only: a session Pod's node disk. The runner requests REQUEST and +# may write LIMIT outside its sized volumes (root filesystem, logs); the Pod's +# limit adds a crawler render's workspace and a Docker-inside agent's inner +# Docker store (DOCKER_STORAGE_SIZE_LIMIT), so a session past it is evicted +# on its own instead of filling the node. +# SANDBOX_K8S_EPHEMERAL_STORAGE_REQUEST=256Mi +# SANDBOX_K8S_EPHEMERAL_STORAGE_LIMIT=2Gi +# SANDBOX_K8S_DOCKER_STORAGE_SIZE_LIMIT=20Gi +# Kubernetes only: where session Pods run. Node labels as a JSON object, Pod +# tolerations as a JSON array and a PriorityClass name, applied to every +# session Pod, crawler renders included; unset, the scheduler places them on +# any node. A malformed value stops the spawner at start. +# SANDBOX_K8S_NODE_SELECTOR='{"tale.dev/sandbox":"true"}' +# SANDBOX_K8S_TOLERATIONS='[{"key":"tale.dev/sandbox","operator":"Exists","effect":"NoSchedule"}]' +# SANDBOX_K8S_PRIORITY_CLASS=tale-sandbox-session # ============================================================================ # Object store — the deployment's blob backend @@ -597,6 +705,19 @@ TALE_AUDIT_PEPPER=9c1e5b7d3a2f8064e1c7a9d5b3f2e8c604a7d1b9e5c3f8a2d6b0e4c7a1f9d3 SOPS_AGE_KEY= # SOPS_AGE_KEY_FILE= +# --------------------------------------------------------------------------- +# MCP endpoint — browser origins (backend-api) +# --------------------------------------------------------------------------- +# Coding agents and server clients send no Origin header and are never +# judged. A request that carries one must come from SITE_URL, +# ADDITIONAL_SITE_URLS or an origin listed here (comma- or space-separated, +# scheme://host[:port], no path — e.g. a desktop editor's vscode-file://vscode-app). +# A request from any other origin is logged as `[mcp] origin-mismatch`, and +# refused with 403 ORIGIN_FORBIDDEN once TALE_MCP_ORIGIN_ENFORCE=true. +# See docs/self-hosted/configuration/environment-reference. +# TALE_MCP_ALLOWED_ORIGINS= +# TALE_MCP_ORIGIN_ENFORCE=false + # --------------------------------------------------------------------------- # Provider API keys from environment variables (issue #1711) # --------------------------------------------------------------------------- @@ -777,6 +898,18 @@ SOPS_AGE_KEY= # allowed. Set but empty closes creation to everyone. A managed deployment # writes this from `organizations.creators` in its specification. # TALE_ORGANIZATION_CREATORS=ops@example.org,lead@example.org +# --- Session cookie cache --- +# Off by default: every authenticated request resolves its session in the +# database. Set it to let a request reuse its session from a signed cookie for +# up to this many seconds (1-300), which saves most auth reads on a busy +# deployment. The price: changes to the session or the account (sign-out +# elsewhere, or the sessions ended when a password changes or an admin revokes +# a member's passkey or resets their two-factor authentication) reach ordinary +# requests only when the cached copy expires, and an +# organization's idle timeout can take effect up to that much later. +# Organization membership is still read on every request, and open +# live-update streams re-check the session within 15 seconds. +# SESSION_COOKIE_CACHE_SECONDS=30 # ============================================================================ # Application backend — always part of the stack diff --git a/.gitattributes b/.gitattributes index 601a1a2e7e..5cdc742982 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,3 +12,13 @@ services/platform/convex/migrations/*.snapshot.json linguist-vendored # The release source contract hashes these helpers' raw checkout bytes. .github/workflows/release-candidate-receipt.yml text eol=lf .github/workflows/release-candidate-source.yml text eol=lf + +# CI retirement admits these historical workflow fixtures by raw source hash. +tools/cli/scripts/fixtures/ci-orphan-checks-6ad49e4/*.txt text eol=lf +tools/cli/scripts/fixtures/ci-orphan-seven/*.txt text eol=lf + +# These source bytes are hashed into merge-group retirement profiles. Keep +# their checkout representation stable on Windows as well as POSIX hosts. +.github/workflows/*.yml text eol=lf +.github/actions/ci-ready/action.yml text eol=lf +tools/cli/scripts/ci-ready.ts text eol=lf diff --git a/.github/CI.md b/.github/CI.md index 89fece0eb1..a5ede2914b 100644 --- a/.github/CI.md +++ b/.github/CI.md @@ -10,6 +10,140 @@ combining both. Each entry records before/after behavior, changed paths, source and proof. Repeated patterns across workflows count once; suggestions and retained baseline behavior do not count. +## Recovering a canceled workflow tail + +A required `CI ready` job uses `always()` so it can explicitly reject canceled or +missing evidence. Under runner pressure, a canceled workflow can keep that final job +queued while a newer duplicate waits on the workflow concurrency lock. Keep the final +check enforced: a skipped required job can count as passing. + +The CLI workspace owns a bounded recovery command for one explicitly selected pair: + +```sh +bun tools/cli/scripts/ci-retire-tail.ts --pr 123 --older-run 1000 --replacement-run 1001 +``` + +Its default is a read-only manifest. Both runs must belong to the same open, non-draft +Tale PR, current head and base, branch, event and native workflow. The replacement +must be newer and pending with no jobs. The predecessor must have exactly one +unallocated, queued final check; every other job must be terminal with at least one +cancellation and no failure. GitHub reports an unassigned runner as either `0` or +`null`; a missing runner field or a positive runner ID is refused. Complete, +attempt-bound job inventories are paged with +fixed limits. A changed, stale, incomplete, foreign or unreadable observation preserves +both runs. Actual work that is still queued or running is never eligible. + +After reviewing an eligible manifest, add `--apply --receipt /absolute/private/path.jsonl` +to cancel that predecessor. The command repeats the complete observation, refuses a +changed graph, exclusively creates an owner-only receipt, flushes its file and parent directory, and +sends at most one +cancellation request using existing `gh` authentication. It creates no credential or +permission grant. Without existing Actions write access, keep the read-only manifest +for an authorized operator. Metadata reads and writes share a 60-second, 40-request +budget; each read includes at most five pages of 100 jobs. + +The receipt distinguishes confirmed cancellation, accepted but still pending readback, +and an unknown outcome after dispatch. A lost response is never retried automatically: +inspect the exact run before another decision and retain the receipt. Reusing its path +is refused. GitHub does not offer a compare-and-cancel operation, so re-observation +bounds the race but cannot make the read and cancellation atomic. A later run attempt, +new head, a different PR containing the same code, workflow aggregates still queued, +or all-success predecessors need separate source review; this command does not infer +that they are disposable. It changes no required check or merge rule and is not an +org-wide cancellation scheduler. Applying requires a POSIX filesystem that supports +file and directory synchronization; Windows retains read-only operation. Any receipt +or directory-flush failure preserves the runs before dispatch. + +The caller owns credential selection. A managed worker supplies its existing, +authorized credential as `GH_TOKEN` for this command's process, following its +provisioned instructions; an operator may use their existing `gh` authentication. +The shared command does not look up agent secrets or change global authentication. + +## Retiring a deleted merge-group revision + +Rebuilding the merge queue gives its temporary branches new names. Workflow +concurrency is keyed by the complete ref, so an old revision can keep running +after GitHub deletes its branch. A run marked `queued` can still contain allocated +jobs: use the organization's **Settings → Actions → Runners → Standard +GitHub-hosted runners** view or complete native job inventories to measure occupancy. + +Inspect one exact run with the maintained CLI workspace command: + +```sh +bun tools/cli/scripts/ci-retire-merge-group.ts --run 1000 +``` + +The default prints a read-only decision. Eligibility requires a Tale `merge_group` +run from one of the seven validation workflows, older than one minute, on the +recognized temporary `main` queue ref. Its exact ref must return HTTP 404 and its +head must be absent from a complete native merge-queue inventory. The current +default-branch head and queued PR source heads are also protected. Authentication +errors, unreadable queue/default-branch data, more than 100 queue entries, current +refs, incomplete responses and unknown workflows preserve the run. PR validation, +main pushes, release candidates and publication workflows are never eligible. + +After reviewing the decision, add `--apply --receipt /absolute/private/run-attempt.jsonl`. +The command repeats its run, queue and deleted-ref observations, creates and flushes +the same exclusive owner-only journal used by tail recovery, then sends at most one +ordinary cancellation. This can stop live validation jobs for that obsolete revision; +it does not escalate to force cancellation. Cancellation does not establish a passed +check. The receipt distinguishes confirmed cancellation, an accepted request still pending readback and +unknown outcomes. Never replay an uncertain request or replace its receipt. Ordinary +cancellation may leave an `always()` aggregate queued; the explicit finishing mode +below is a separate decision. + +To inspect an orphan that still has queued verdict jobs at least five minutes after an +accepted ordinary cancellation, supply that command's retained journal: + +```sh +bun tools/cli/scripts/ci-retire-merge-group.ts --run 1000 --finish \ + --ordinary-receipt /absolute/private/ordinary-run-attempt.jsonl +``` + +This remains read-only. Finishing recognizes the reviewed source profiles for all seven +validation workflows, including the retained older Checks profile. Each profile pins the +whole workflow and its verdict action/script. Every substantive job must have a terminal +native row. Only the reviewed `CI ready` jobs, plus Checks' `Unit` and `UI` aggregates, +may remain queued and unassigned; event-inapplicable jobs cannot start in a merge group. + +A matrix normally requires every exact child. GitHub can instead record one cancelled or +skipped literal matrix placeholder before expansion. That representation is accepted only +when the pinned node requires a named predecessor to succeed, that predecessor is terminal +without success, and no expanded child exists. Missing or mixed children, an unknown matrix +value or a successful predecessor preserve the run. This is a fixed source-reviewed rule, +not a general interpretation of workflow expressions. + +Different source, a missing real job, an assigned verdict, incomplete pagination or changed +run identity preserves the workflow. The five-minute interval permits normal cancellation +to settle; elapsed time alone does not prove work has stopped. The current-source guard in +`ci-merge-group-finish.test.ts` requires each workflow and its verdict closure to match a +profile. When these files change, review the complete future graph and add its profile; +retain historical profiles for obsolete runs. Never update a digest merely to silence the +guard or add an arbitrary job-name override. + +After reviewing that manifest, add `--apply --receipt /absolute/private/finish-run-attempt.jsonl` +with a **new** receipt path. This repeats the complete source, queue, deleted-ref and +job observations before one force-cancel request. The separate journal records the +ordinary receipt's hash, reviewed source profile and actual job conclusions, including +failures. Confirmation requires both a cancelled run and every returned job terminal; +otherwise the result stays pending or unknown. Never replay a force intent, replace +its receipt, or treat cancelled checks as passed. GitHub provides no atomic comparison: +a verdict can allocate between the final observation and the request, but the exact +closed graph excludes any remaining test, build or deployment work from that race. + +Ordinary reads and writes share a 60-second, 20-request budget; explicit finishing uses +at most 40 requests within the same deadline. HTTP Date/Age and the local observations +must be fresh within 30 seconds. The command requests uncached metadata, and refuses +missing, ambiguous or stale response dates. Caller-selected `GH_TOKEN` or existing +`gh` authentication remains responsible for authorization; no secret is acquired. +Actual Actions response rate-limit headers govern its available REST budget: a +contradictory `/rate_limit` overview does not authorize spending a reserved balance. + +A later run attempt or changed source is refused. The existing CI manager owns +scheduling, exact-run selection and receipt retention; this command +does not start a second scheduler or change queue settings. Use the existing +authorized credential as described above. + ## Current execution graph - **Checks / Unit** is the stable required aggregate. Two platform Vitest shards run @@ -808,12 +942,44 @@ scope policy and passed, failed and incomplete readiness evidence. Source alone does not activate branch protection. Before requiring these contexts, observe their exact live names and GitHub Actions application identity (15368), positive and negative -PR cases, and failed/latest rerun behavior. If a merge queue is configured, also observe -positive and negative `merge_group` runs. Otherwise record live queue proof as not applicable, -retain the source guards for that event and its full scope, and require live queue proof before -enabling a queue. Bind the seven contexts to that app; generic candidate or skipped execution +PR cases, and failed/latest rerun behavior. The merge queue is configured (see +[Merge queue](#merge-queue)); observe positive and negative `merge_group` runs and record them +here. Retain the source guards for that event and its full scope. Bind the seven contexts to that app; generic candidate or skipped execution jobs cannot substitute for them. Keep the coordinator's exact-head checks and independent review until enforcement is active and observed. Independent review remains a separate obligation; a CI readiness result does not certify it. +### Merge queue + +`main` lands through a GitHub merge queue (ruleset **Tale required CI**, since 2026-10-09): +squash merges, groups of up to five PRs, up to five PRs building at once, all-green grouping +(a group merges only when every PR in it passes) and a 360-minute check timeout. The build cap +and timeout follow from the runner budget: the public repository's free plan runs about 20 jobs at +once across every PR and queue run, a full merge-group run needs dozens, so speculative builds +beyond one group only starve PR runs, and a queued run can wait hours for a runner. Build's full +merge-group run takes up to about 90 minutes. The ruleset no longer requires a branch to be up to +date before merging; the queue checks the result that will actually land. With about 75 merges a +day, "up to date" forced every other open PR to rebase and re-run CI after each merge. +Each queued PR still gets its own squash commit on `main`, so the release gate's +one-PR-per-merge-commit rule holds. + +**Most validation runs only in the queue.** A pull request's run is the fast tier: Commitlint, +SAST, Security (path-scoped) and the Checks lanes Format, Lint, Type check, Knip and Unit. E2E, +Build, CLI and Backend integration pass `queue-only: 'true'` to the scope action, so on a pull +request their scope reports not applicable and every job skips; the Checks suites in +`CHECKS_MERGE_QUEUE_ONLY` (`tools/cli/scripts/ci-ready.ts`: Build, UI and its shards, Performance, +Browser) carry `github.event_name != 'pull_request'` and readiness requires them skipped there. +Each workflow still reports its `CI ready (…)` context on the PR, so the PR can enter the queue, +and the merge group runs everything at full scope before it lands. Run the heavy suites a change +touches locally before queueing it; a red there ejects the PR from the queue. To bring a suite +back to pull requests, drop the scope's `queue-only` input or the job from +`CHECKS_MERGE_QUEUE_ONLY`; `ci-ready-workflows.test.ts` pins both lists to the YAML. + +The seven `CI ready (…)` contexts are what the queue waits for. Every workflow listens for +`merge_group` and runs full scope there, and each concurrency group keys on the ref; a +merge-group ref (`gh-readonly-queue/main/pr--`) is unique, so queued runs never cancel +each other or a PR run. A PR that fails in its group leaves the queue, and the PRs behind it are +rebuilt without it. Live proof is recorded under +[Activation and observation](#activation-and-observation) as it is observed. + The complete [release-candidate gate](RELEASING.md) remains required before tagging a release. diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index e7e88b5236..947667d6f8 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -69,7 +69,9 @@ result. For performance or memory work, run `bun run test:performance` and read the [measurement and coverage guide](../scripts/performance/README.md). It reports representative hot paths and explicit gaps; it does not replace integration or -browser tests, and timing results are never cached or used as CI thresholds. +browser tests, and timing results are never cached or used as CI thresholds. For +how a deployment holds a crowd, run the [load harness](../tools/load/README.md) +against a throwaway stack (locally, or with the dispatch-only **Load** workflow). Browser changes also need the relevant Playwright or manual flow. Database changes need the real-Postgres integration check described by the diff --git a/.github/actions/ci-scope/action.yml b/.github/actions/ci-scope/action.yml index 144e108073..95de725026 100644 --- a/.github/actions/ci-scope/action.yml +++ b/.github/actions/ci-scope/action.yml @@ -4,6 +4,12 @@ inputs: filter: description: Named path policy in .github/ci-scope.yml required: true + queue-only: + description: >- + 'true' when this validation runs only in the merge queue: a pull + request's scope then reports it not applicable without discovery + required: false + default: 'false' outputs: run: description: Explicit true or false applicability @@ -60,6 +66,7 @@ runs: uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0; Node 24 env: SCOPE_FILTER: ${{ inputs.filter }} + SCOPE_QUEUE_ONLY: ${{ inputs.queue-only }} SCOPE_BEFORE: ${{ steps.before.outputs.identity }} SCOPE_FULL: ${{ steps.before.outputs.full }} SCOPE_TOUCHED: ${{ steps.filter.outputs[inputs.filter] }} @@ -88,8 +95,14 @@ runs: BUILD_ci_tests: ${{ steps.filter.outputs.build_ci_tests }} with: script: | - const { BUILD_FILTERS, E2E_SERVICES, buildScope, e2eScope, requiresFullScope, scopeBoolean, validateScope } = await import(require('node:url').pathToFileURL(`${process.env.GITHUB_WORKSPACE}/tools/cli/scripts/ci-ready.ts`).href); + const { BUILD_FILTERS, E2E_SERVICES, buildScope, e2eScope, mergeQueueOnly, requiresFullScope, scopeBoolean, validateScope } = await import(require('node:url').pathToFileURL(`${process.env.GITHUB_WORKSPACE}/tools/cli/scripts/ci-ready.ts`).href); if (!['integration', 'build', 'e2e', 'cli', 'security'].includes(process.env.SCOPE_FILTER)) throw new Error('Unknown scope filter'); + if (mergeQueueOnly(process.env.SCOPE_QUEUE_ONLY ?? 'false', context.eventName)) { + core.setOutput('run', 'false'); + core.setOutput('full', 'false'); + core.info(`${process.env.SCOPE_FILTER} runs only in the merge queue; this pull request skips it`); + return; + } let decision = { run: true, full: true }; const full = scopeBoolean(process.env.SCOPE_FULL); if (context.eventName === 'pull_request') { diff --git a/.github/ci-scope.yml b/.github/ci-scope.yml index 6439b749b4..c03185aa75 100644 --- a/.github/ci-scope.yml +++ b/.github/ci-scope.yml @@ -10,9 +10,15 @@ integration: - 'services/db/**' - 'services/sandbox-runtime/daemon/src/file-ops.ts' - 'services/sandbox-runtime/daemon/src/protocol.ts' + - 'services/sandbox-runtime/daemon/src/staged-manifest.ts' - 'packages/shared/**' - 'packages/ui/package.json' + - 'packages/ui/src/data/**' - 'packages/ui/src/i18n/**' + - 'packages/ui/src/markdown/plugins/micromark-cjk-attention.ts' + - 'packages/ui/src/markdown/remark-plugin-lists.ts' + - 'packages/ui/src/markdown/streaming/normalize-html-blocks.ts' + - 'packages/ui/src/mentions/**' - 'packages/ui/src/server/serving-identity.ts' - 'configs/platform/**' - 'tools/cli/src/lib/compose/types.ts' @@ -20,6 +26,7 @@ integration: - 'tools/cli/src/lib/deployment/acceptance-migrations.ts' - 'tools/cli/src/lib/deployment/migration-model.ts' - 'tools/cli/src/lib/deployment/automation-floor.ts' + - 'tools/cli/src/lib/deployment/automation-cutover-sql.ts' - 'tools/cli/src/lib/deployment/automation-model.ts' - 'tools/cli/src/lib/deployment/source-migrations.ts' - 'tools/cli/src/lib/deployment/runtime-command.ts' @@ -59,12 +66,16 @@ cli: - 'services/platform/backend/auth/oidc.ts' - 'services/platform/backend/db/sql.ts' - 'services/platform/backend/db/ssl.ts' + - 'services/platform/backend/domains/api_keys/owners.ts' + - 'services/platform/backend/domains/api_keys/retire.ts' - 'services/platform/backend/domains/audit_logs/**' - 'services/platform/backend/domains/sandbox/retirement-schedule.ts' - 'services/platform/backend/domains/two_factor/service.ts' - 'services/platform/backend/jobs/enqueue.ts' - 'services/platform/backend/jobs/tasks.ts' - 'services/platform/backend/lib/org-config.ts' + - 'services/platform/backend/lib/request-channel.ts' + - 'services/platform/backend/realtime/outbox.ts' - 'services/platform/lib/**' - 'configs/platform/**' - 'packages/shared/**' diff --git a/.github/release-candidate-contract.json b/.github/release-candidate-contract.json index 4c1e81f2fc..52a64f453c 100644 --- a/.github/release-candidate-contract.json +++ b/.github/release-candidate-contract.json @@ -616,7 +616,7 @@ { "path": ["jobs", "build", "if"], "kind": "value", - "expected": "!cancelled() && (((github.event_name == 'repository_dispatch') && needs.candidate-source.result == 'success') || ((github.event_name != 'repository_dispatch') && needs.candidate-source.result == 'skipped'))" + "expected": "github.event_name != 'pull_request' && !cancelled() && (((github.event_name == 'repository_dispatch') && needs.candidate-source.result == 'success') || ((github.event_name != 'repository_dispatch') && needs.candidate-source.result == 'skipped'))" }, { "path": ["jobs", "build", "name"], @@ -1162,7 +1162,8 @@ "path": ["jobs", "integration-scope", "steps", 2, "with"], "kind": "value", "expected": { - "filter": "integration" + "filter": "integration", + "queue-only": "true" } }, { @@ -1395,7 +1396,7 @@ { "path": ["jobs", "performance", "if"], "kind": "value", - "expected": "!cancelled() && (((github.event_name == 'repository_dispatch') && needs.candidate-source.result == 'success') || ((github.event_name != 'repository_dispatch') && needs.candidate-source.result == 'skipped'))" + "expected": "github.event_name != 'pull_request' && !cancelled() && (((github.event_name == 'repository_dispatch') && needs.candidate-source.result == 'success') || ((github.event_name != 'repository_dispatch') && needs.candidate-source.result == 'skipped'))" }, { "path": ["jobs", "performance", "name"], @@ -1625,7 +1626,7 @@ { "path": ["jobs", "test-browser", "if"], "kind": "value", - "expected": "!cancelled() && (((github.event_name == 'repository_dispatch') && needs.candidate-source.result == 'success') || ((github.event_name != 'repository_dispatch') && needs.candidate-source.result == 'skipped')) && (github.event.pull_request.draft != true)" + "expected": "github.event_name != 'pull_request' && !cancelled() && (((github.event_name == 'repository_dispatch') && needs.candidate-source.result == 'success') || ((github.event_name != 'repository_dispatch') && needs.candidate-source.result == 'skipped')) && (github.event.pull_request.draft != true)" }, { "path": ["jobs", "test-browser", "name"], @@ -1908,7 +1909,7 @@ "kind": "value", "expected": { "bgutil": { - "image": "brainicism/bgutil-ytdlp-pot-provider:1.3.1", + "image": "mirror.gcr.io/brainicism/bgutil-ytdlp-pot-provider:1.3.1", "ports": ["4416:4416"] } } @@ -2026,7 +2027,7 @@ { "path": ["jobs", "test-ui", "if"], "kind": "value", - "expected": "always() && (((github.event_name == 'repository_dispatch') && needs.candidate-source.result == 'success') || ((github.event_name != 'repository_dispatch') && needs.candidate-source.result == 'skipped')) && (github.event.pull_request.draft != true)" + "expected": "github.event_name != 'pull_request' && always() && (((github.event_name == 'repository_dispatch') && needs.candidate-source.result == 'success') || ((github.event_name != 'repository_dispatch') && needs.candidate-source.result == 'skipped')) && (github.event.pull_request.draft != true)" }, { "path": ["jobs", "test-ui", "name"], @@ -2087,7 +2088,7 @@ { "path": ["jobs", "test-ui-shards", "if"], "kind": "value", - "expected": "!cancelled() && (((github.event_name == 'repository_dispatch') && needs.candidate-source.result == 'success') || ((github.event_name != 'repository_dispatch') && needs.candidate-source.result == 'skipped')) && (github.event.pull_request.draft != true)" + "expected": "github.event_name != 'pull_request' && !cancelled() && (((github.event_name == 'repository_dispatch') && needs.candidate-source.result == 'success') || ((github.event_name != 'repository_dispatch') && needs.candidate-source.result == 'skipped')) && (github.event.pull_request.draft != true)" }, { "path": ["jobs", "test-ui-shards", "name"], @@ -4072,7 +4073,8 @@ "path": ["jobs", "pr-scope", "steps", 1, "with"], "kind": "value", "expected": { - "filter": "e2e" + "filter": "e2e", + "queue-only": "true" } }, { @@ -4504,12 +4506,16 @@ "services/platform/backend/auth/oidc.ts", "services/platform/backend/db/sql.ts", "services/platform/backend/db/ssl.ts", + "services/platform/backend/domains/api_keys/owners.ts", + "services/platform/backend/domains/api_keys/retire.ts", "services/platform/backend/domains/audit_logs/**", "services/platform/backend/domains/sandbox/retirement-schedule.ts", "services/platform/backend/domains/two_factor/service.ts", "services/platform/backend/jobs/enqueue.ts", "services/platform/backend/jobs/tasks.ts", "services/platform/backend/lib/org-config.ts", + "services/platform/backend/lib/request-channel.ts", + "services/platform/backend/realtime/outbox.ts", "services/platform/lib/**", "configs/platform/**", "packages/shared/**", @@ -5223,7 +5229,8 @@ "path": ["jobs", "pr-scope", "steps", 1, "with"], "kind": "value", "expected": { - "filter": "cli" + "filter": "cli", + "queue-only": "true" } }, { diff --git a/.github/release-notes/v0.5.79.md b/.github/release-notes/v0.5.79.md new file mode 100644 index 0000000000..4b4c724d90 --- /dev/null +++ b/.github/release-notes/v0.5.79.md @@ -0,0 +1,177 @@ +## Highlights + +- API-key creation offers a custom expiry option and previews the resulting expiry date. + The keys table now includes an **Expires** column. + [#4495](https://github.com/tale-project/tale/pull/4495) +- Owners and Admins can create an organization-bound API key for another eligible member, + a team, a project or the organization itself. A member's key follows that member's live + permissions; team, project and organization keys act with their own assigned role and keep + working when their creator leaves. + [#4501](https://github.com/tale-project/tale/pull/4501) +- A project's API key cannot read organization-wide knowledge entries through chat search, + listing or the user-keyed sandbox entry finder. Its scoped project document access remains + available. + [#4565](https://github.com/tale-project/tale/pull/4565) +- Project budget rules cap the project's chats, agent turns, automation model calls, voice + output and calls made with its own API keys, in addition to other applicable limits. Pending + work reserves its admitted usage, and moving a chat or changing an automation's project + installations does not move an existing reservation or its booking. Uncertain voice and + direct automation model outcomes retain a conservative usage estimate before retrying. + The refusal identifies a reached project limit; see the upgrade notes for accounting limits. + [#4505](https://github.com/tale-project/tale/pull/4505), + [#4507](https://github.com/tale-project/tale/pull/4507), + [#4565](https://github.com/tale-project/tale/pull/4565) +- Chat consistently checks attachment access across deferred sends, retries and regenerated + replies. Existing message history is not rewritten. +- Agent connector calls keep credentials in the platform process and avoid launching a + sandbox process for every call. Within each backend process, the bridge limits concurrent + calls for each session; a deadline signal stops further service requests after a short grace + period. + [#4544](https://github.com/tale-project/tale/pull/4544) +- Erasure requests can delete eligible automation runs while preserving runs held after an + upgrade. The receipt stays **Partial**, explains the execution hold, and counts deleted and + preserved runs separately. Its summary and detailed breakdown now agree for both stored + count formats. Deleting an organization with these holds returns an explanatory conflict. + [#4565](https://github.com/tale-project/tale/pull/4565) +- Automation template analysis reuses its whitespace scan when recovering from repeated + malformed expressions. Long shared whitespace suffixes no longer cause the same text to be + scanned and trimmed for each failed expression. Existing expression limits and quoted + delimiters keep their behavior. + [#4564](https://github.com/tale-project/tale/pull/4564), + [#4565](https://github.com/tale-project/tale/pull/4565) +- The public proxy refuses private deployment-control paths, including deployments under a URL + prefix. The CLI continues to use its local control connection for deployment operations. + [#4563](https://github.com/tale-project/tale/pull/4563), + [#4565](https://github.com/tale-project/tale/pull/4565) +- Project agents can request a compact `task_get` occupancy view that returns the newest run + beside an explicitly requested historical run. It omits large discussions and review files + when the caller only needs a run observation. The default full response remains available; + a read does not reserve capacity or authorize a start or review decision. + [#4569](https://github.com/tale-project/tale/pull/4569) +- Idle sandbox spawners avoid loading unused Kubernetes and error-reporting integrations. + Capacity checks and cleanup reuse bounded Docker inventory reads, reducing repeated process + launches while retaining resource and ownership checks. + [#4542](https://github.com/tale-project/tale/pull/4542) +- Sandbox cache permission repairs use a digest-pinned BusyBox helper image. First use still + needs registry access if the image is not cached. + [#4565](https://github.com/tale-project/tale/pull/4565) +- Sandbox cleanup briefly rereads an empty process environment so it can find owned processes + caught while starting another executable. The existing scan deadline and process-ownership + checks remain in force. + [#4531](https://github.com/tale-project/tale/pull/4531) +- Knowledge databases store embeddings in separate tables for each supported vector width. + Organizations sharing a database can choose different widths. Saving a different width in + Data residency queues already indexed documents that lack vectors at that width. + [#4445](https://github.com/tale-project/tale/pull/4445) +- Failed Git commands during CLI source acquisition identify the source type, Git stage and + validated exit status when available, with bounded hints for disk, DNS, timeout and + output-limit failures. Private Git output and credentials remain hidden. These hints help + investigate a failure; they do not establish its cause or trigger an automatic retry. + [#4573](https://github.com/tale-project/tale/pull/4573) + +## Upgrade notes + +- v0.5.78 publication was stopped after source defects were confirmed. Its existing tag and + package publications remain immutable. Use this release's CLI and matching runtime images + for the complete forward upgrade. Do not rebuild or retag v0.5.78. Its retained + [authored notes](https://github.com/tale-project/tale/blob/4d60debc9263784f98bd74b36d3a4e8576125126/.github/release-notes/v0.5.78.md) + describe the preceding feature changes and remaining known limitations when upgrading from + v0.5.77; they are not evidence that v0.5.78 finished publishing or deploying. +- Back up the application and knowledge databases, configuration, keys and external stores + before deployment. The first upgrade from v0.5.77 applies application migrations + `0154` (API-key ownership), `0155` (project usage) and `0160`–`0163` (automation leases, + recovery history, per-step call records and the protocol-2 writer fence), plus `0164` + (captured budget projects and pending voice estimates). A configuration-only + update does not install these runtime changes. +- Existing personal API keys retain their behavior. Older images refuse the new + organization-bound keys, so finish the runtime rollout before moving an integration to one. + Agents and automations started by a project's key retain their own permissions and tool + access, which may reach beyond the project. Revoking a key blocks future calls but + does not stop work already admitted. See [API keys](https://docs.tale.dev/platform/admin/api-keys). +- Project usage starts with bookings made by the new runtime; migration `0155` does not backfill + earlier spend, and older images do not write the new project buckets during a mixed-version + rollout. Budget periods spanning the upgrade can therefore undercount project usage. Finish + retiring older admission processes before relying on the new reservations for every request. + Legacy pending rows without project stamps retain their prior lookup behavior; an unknown + historical voice price is not reconstructed. Project budgets exclude transcription and do + not send advance warnings. See + [Policies and limits](https://docs.tale.dev/platform/admin/governance/policies-and-limits). +- Direct automation `llm` calls require catalog pricing before admission. They reserve the + estimated prompt and permitted output, plus one request; these are estimates, not a + provider-enforced monetary ceiling. Unknown outcomes book that saved estimate once. A + reserved voice attempt that fails, times out or is replaced also books its saved estimate + and one request, including failures before dispatch. This may conservatively count an + attempt the provider did not charge. Retries must fit the remaining budget after that + booking. Authorized history retention and privacy erasure still delete their covered data; + the repair neither reconstructs erased usage nor guarantees caps across that deletion. +- Knowledge migrations `private_knowledge/15` and `public_web/16` copy existing vectors and build + indexes while retaining the legacy vector column for compatibility. Allow disk space for both + copies and time for the corpus-sized migration. Supported widths are 256, 384, 512, 768, 1024, + 1536, 2048, 3072 and 4096; widths above 2000 use sequential vector scans. An unsupported + existing width requires selecting a supported model and indexing again. Changing width + re-embeds documents through the configured provider and can incur provider usage. Keep the + existing width during a mixed-version rollout: the older image can search newly indexed data + only at its legacy column's declared width. Same-width model changes do not automatically + re-embed the corpus. See [Data residency](https://docs.tale.dev/self-hosted/configuration/data-residency). +- The managed upgrade first requires zero unfinished automation runs across every organization. + For the supported legacy runtime `b4931db4`, the CLI verifies the complete migration inventory, + holds a database lock against new admissions and claims, and gracefully stops the recorded + backend API and worker containers before migration `0163`. The initial census and compatibility + checks run before any backend stop. A failed stop or changed identity leaves cutover pending. + Existing protocol-1 tag deployments must use this managed upgrade first. Keep the bundle and + cutover receipt if a stop or readback fails; the + CLI starts no replacements until its recovery checks pass. This barrier does not establish + the outcome of historical external effects or cancel independent project agents. + [#4579](https://github.com/tale-project/tale/pull/4579), + [#4565](https://github.com/tale-project/tale/pull/4565) +- Migration `0163` retains a fallback for older queued, running and waiting automation runs + still present at cutover: they become **On hold**. Their + earlier progress and unknown external outcomes remain protected, and they do not resume + automatically. Already-admitted external work may still finish. Check the external service + before taking further action. **Request stop** records an acknowledgement and requests owned + session cancellation; it does not prove termination, undo effects or release the hold. + There is currently no supported retirement action that releases these legacy holds. Their + tasks remain excluded from replacement runs, erasure stays partial, and organization deletion + is refused while a hold remains. Plan the cutover around this limitation. +- After migration, repair forward with a compatible runtime and this release's CLI. The CLI + checks the installed database floor and target image before deployment or rollback. An + already-created protocol-2 backend also requires a compatible target, even while stopped or + before its migration commits. Older CLIs and manual Docker commands do not implement this + guard, and a snapshot cannot undo external effects. The guard currently supports the bundled + application database: an explicit + `DATABASE_URL`, custom `APP_DB_NAME` or installed backend pointing elsewhere is refused. + It does not start a stopped database to inspect it. Keep the existing runtime and repair the + readback when compatibility cannot be established. A successful cutover is only one part of + release acceptance: verify the completed rollout, serving identities, migration inventories + and native configuration readback for every deployment. See + [Upgrades](https://docs.tale.dev/self-hosted/operate/upgrades). +- Custom Compose configurations need at least `30s` stop grace for `backend-api` and `120s` for + `backend-worker`. `SHUTDOWN_DRAIN_MS` defaults to `15000` for the API and `90000` for a worker; + keep stop grace at least 15 seconds above a longer drain setting. The matching CLI generates + these values. `AUTOMATION_ORG_CONCURRENCY` defaults to `8` steps per organization across + workers; `0` disables that limit. Synchronize clocks across worker hosts. +- Update clients that exhaustively handle automation states and failure codes for REST/OpenAPI + contract `3.22.0`, including held runs, stop requests, resumption fields, `waitingFor: in_doubt`, + `engine_incompatible` and `effect_in_doubt`. An uncertain individual write is decided in the + app, separately from a legacy run's stop request. No notification is sent for an in-doubt wait. + Clients must also accept `GET /api/v1/me`'s `key.owner`, an empty `user.email` for a key that + is not a person, and `data.scope: project` on a `429 BUDGET_EXCEEDED` response. A project's + key receives `403 API_KEY_SCOPE_FORBIDDEN` outside its permitted routes. +- The inherited MCP authoring changes include issue locations, analysis and inferred types in + validation results, save warnings, and capability output schemas. Revalidate custom + automations: agent `files` contribute dependencies and `ITEM_WITHOUT_FOREACH` is an error. + Expressions and `transform` bodies have analysis limits of 8192 UTF-16 code units, 512 + JavaScript tokens and 64 nesting levels. Whitespace around a template expression is excluded + from its size; whitespace inside a `transform` body counts. Shorten or split oversized code. + See [Automation concepts](https://docs.tale.dev/platform/automations/concepts). +- Before using compact occupancy reads, require `output.view` to equal `occupancy`. Older + runtimes can return the full view without binding `requestedRunId`; do not treat that as a + supported compact result. Missing or failed reads leave occupancy unknown. Workflow holds + still block replacement even when their run is not live, and normal start/retry limits apply. +- When upgrading from v0.5.76 or earlier, also follow the + [v0.5.77 upgrade notes](https://github.com/tale-project/tale/releases/tag/v0.5.77), including + the Bun 1.4.2 runtime, serving-identity proxy header, pinned contract-digest review and + `task_delegate_review` runtime prerequisite. The built-in **Triage GitHub issues** and + **Review GitHub pull requests** schedules still require their missing repository inputs + (`owner` and `repo`); editor validation reports `TRIGGER_INPUT_MISMATCH` but does not repair + those schedules. diff --git a/.github/release-notes/v0.5.80.md b/.github/release-notes/v0.5.80.md new file mode 100644 index 0000000000..2961fd0a8c --- /dev/null +++ b/.github/release-notes/v0.5.80.md @@ -0,0 +1,94 @@ +## Highlights + +- Project agents run each task in a separate worker. A busy agent can take another + eligible task without another agent definition; organization and host capacity + still limit concurrent work. Agent workspaces survive sandbox replacement, and + active turns can recover from a temporary spawner restart. + [#4603](https://github.com/tale-project/tale/pull/4603), + [#4560](https://github.com/tale-project/tale/pull/4560), + [#4585](https://github.com/tale-project/tale/pull/4585) +- Managed schedules can wake a project's standing coordinator when an agent frees + its slot. Concurrent completions coalesce into one pending wake, with normal + admission checks and retry backoff. This reduces the wait for the next scheduled + dispatch without bypassing provider or host limits. + [#4608](https://github.com/tale-project/tale/pull/4608) +- Operational review contexts can handle a declared batch of up to twenty captured + reviews. Each target still needs its independent review decision and matching + evidence. A review context does not create another review of its own report; + requesting changes completes the review action while leaving the implementation + unfinished. + [#4616](https://github.com/tale-project/tale/pull/4616) +- Coding agents can read and edit automation versions through MCP with version + conflict checks, retained settings, project installation controls, saved-version + tests and deployment history. Definition changes record their source and client + in the audit trail. Discovery tools, resources and prompts help clients find + available models, skills and automation inputs. + [#4592](https://github.com/tale-project/tale/pull/4592) +- Usage limits now cover transcriptions, knowledge embeddings, chat titles and + later model rounds. Indexing that reaches a usage limit can wait and resume. + Subscription-backed managed agent turns count as requests at no model cost; + connector calls are counted separately from model requests. Agent runs started + with an API key also count toward that key. + [#4525](https://github.com/tale-project/tale/pull/4525), + [#4541](https://github.com/tale-project/tale/pull/4541), + [#4520](https://github.com/tale-project/tale/pull/4520), + [#4555](https://github.com/tale-project/tale/pull/4555), + [#4550](https://github.com/tale-project/tale/pull/4550), + [#4558](https://github.com/tale-project/tale/pull/4558) +- Sandbox maintenance reduces repeated Docker and BuildKit work and adds a critical + disk-pressure tier for reclaiming released idle sessions. Busy sessions use + graceful shutdown, and Kubernetes placement and startup checks retain resource + bounds. + [#4604](https://github.com/tale-project/tale/pull/4604), + [#4602](https://github.com/tale-project/tale/pull/4602), + [#4597](https://github.com/tale-project/tale/pull/4597) +- Private deployment acceptance can use a captured gateway container while keeping + the canonical HTTPS hostname, certificate validation and serving-process checks. + Its receipt records the gateway and network used. + [#4617](https://github.com/tale-project/tale/pull/4617) +- Maintainers can retire obsolete merge-group validation runs with source and queue + checks. A separate finishing mode handles only an exact reviewed workflow whose + real jobs have ended and whose remaining summary jobs are unallocated. Requests + and uncertain outcomes are retained; cancellation never counts as passing CI. + [#4613](https://github.com/tale-project/tale/pull/4613) + +## Upgrade notes + +- Use this release's reviewed CLI and matching runtime images. Back up the + application and knowledge databases, configuration, keys and external stores. + When upgrading from v0.5.77 or earlier, also follow the inherited + [v0.5.79 upgrade requirements](https://github.com/tale-project/tale/blob/0ee5fd9656dc12f08976155d956ee76fe39f4ea3/.github/release-notes/v0.5.79.md#upgrade-notes): + the supported legacy runtime bridge, zero unfinished automation census, managed + protocol-2 cutover, vector-copy disk headroom and forward-repair restrictions + still apply. Those retained notes are source history, not proof of a completed + deployment. Do not clear execution holds or retag earlier versions. +- Apply the complete ordered application migration inventory. This release adds + direct-call holds, chat project stamps, agent-run key attribution, knowledge + author attribution, agent handles and worker records, pending project wakes, + operational review contexts, MCP activity and automation version attribution. + Existing migration filenames remain immutable, including the two distinct + `0164` files. The new runtime and its CLI must agree on the installed database + floor; do not roll back by manually starting an older image. +- Enable early coordinator wakes explicitly with `wakeOnSlotFreed: true` in the + schedule's managed configuration and apply it through the Tale CLI. Only one + schedule may claim a project's wake, and existing schedules retain their current + behavior until configured. Enroll a pristine operational task before using review + batches; an implementation task with retained work cannot be repurposed as a + review context. Neither feature grants credentials or guarantees a particular + number of concurrent workers. +- Update integrations for REST/OpenAPI contract `3.27.0` and the published MCP + schemas. MCP argument validation now returns structured tool errors, and reads + offer structured content. Clients using the newer protocol revision must send + its matching request metadata and headers; earlier supported protocol revisions + remain available. Automations installed only in projects the caller cannot read + are hidden on both MCP and REST reads. +- Review request and token caps for subscription-backed agents, and allow for the + newly counted transcription and embedding work. Earlier usage is not backfilled, + and older processes do not write every new usage dimension during a mixed-version + rollout. Finish retiring those processes before relying on uniform accounting. + See [Policies and limits](https://docs.tale.dev/platform/admin/governance/policies-and-limits). +- A deployment adapter using `--origin-container` must supply the full running + gateway ID and consume the optional `serving.originRoute` receipt. A gateway + restart, identity change or ambiguous network makes acceptance fail. This proves + the captured private route; it does not prove public DNS or off-host reachability. + Keep ordinary monitoring for those paths. diff --git a/.github/release-notes/v0.5.81.md b/.github/release-notes/v0.5.81.md new file mode 100644 index 0000000000..452ea00425 --- /dev/null +++ b/.github/release-notes/v0.5.81.md @@ -0,0 +1,62 @@ +## Highlights + +- Projects can run separate task workers for the same agent, wake a standing + coordinator when capacity becomes available, and review a declared batch of up + to twenty captured targets. Each review still requires independent evidence. + The Tale CLI can provision pristine operational review contexts and manage agent + model selections alongside the project's other configuration. + [#4603](https://github.com/tale-project/tale/pull/4603), + [#4608](https://github.com/tale-project/tale/pull/4608), + [#4616](https://github.com/tale-project/tale/pull/4616), + [#4632](https://github.com/tale-project/tale/pull/4632) +- Automation transforms have their own analysis budget, allowing bodies of up to + 16,384 UTF-16 code units and 4,096 tokens. Ordinary expressions keep their + smaller limits. The CLI compiler and runtime validator enforce the same bounds. + [#4639](https://github.com/tale-project/tale/pull/4639) +- A delayed failure while reading an organization's default provider credentials + no longer removes a newer cached read. Changing the defaults still invalidates + that organization's cache; credentials remain scoped to the organization. + [#4641](https://github.com/tale-project/tale/pull/4641) +- Maintainers can finish cancelled validation graphs across all seven supported + CI workflows when their substantive jobs have ended and only unallocated + summary jobs remain. Source, queue and job checks still refuse active work; + cancellation never counts as successful validation. + [#4638](https://github.com/tale-project/tale/pull/4638) +- Sandbox commands no longer inherit the runtime daemon's token. The daemon + retains it for its authenticated API. + [#4635](https://github.com/tale-project/tale/pull/4635) + +- `tale deploy observe` reports retained deployment identity, configuration and + runtime diagnostics without applying changes. Its evidence is read-only + observation; it does not certify deployment acceptance or readiness. + +## Upgrade notes + +- v0.5.78, v0.5.79 and v0.5.80 were stopped before complete release publication. + Preserve their existing tags, package snapshots and any architecture images; + do not rebuild or retag them. This forward release includes their source changes. + The retained [v0.5.80 notes](https://github.com/tale-project/tale/blob/63c7499137c84f7828f30472dc908a993622e48b/.github/release-notes/v0.5.80.md) + describe those features and their inherited upgrade requirements; they are not + evidence that those versions finished deploying. +- Back up the application and knowledge databases, configuration, keys and + external stores. Follow the supported legacy runtime bridge and confirm zero + unfinished legacy automation runs before managed protocol-2 cutover. Apply the + complete ordered migration inventory, retain execution holds and reserve the + vector-copy disk headroom described in the + [v0.5.79 upgrade requirements](https://github.com/tale-project/tale/blob/0ee5fd9656dc12f08976155d956ee76fe39f4ea3/.github/release-notes/v0.5.79.md#upgrade-notes). + Do not roll back by manually starting an older image. +- Upgrade the CLI and runtime together before applying configurations containing + larger transform bodies or managed review contexts. A configuration-only update + cannot install the parser, worker or migration changes. A deployment that must + cross the legacy bridge can preserve its installed packs with an explicitly + empty configuration selection; verify the retained identities before and after + that bridge, then apply the new packs with the compatible runtime. +- Enable coordinator wakes explicitly with `wakeOnSlotFreed: true` through the + Tale CLI. Only one schedule may claim a project's wake. Review contexts must be + pristine operational tasks, and each captured target still requires a matching + independent decision. Agent definitions, model selections and review contexts + grant no credentials and do not guarantee twenty concurrent workers; provider, + organization and host limits still govern admission. +- Retain the v0.5.80 guidance for API contract `3.27.0`, MCP clients, newly counted + usage dimensions and private-route deployment acceptance. Finish the runtime + rollout before relying on uniform behavior across processes. diff --git a/.github/release-notes/v0.5.82.md b/.github/release-notes/v0.5.82.md new file mode 100644 index 0000000000..f6a3ba7c48 --- /dev/null +++ b/.github/release-notes/v0.5.82.md @@ -0,0 +1,30 @@ +## Highlights + +- OpenAI gateway accounts now recover from revoked access-token generations without + reusing rejected credentials. A late usage response cannot overwrite a terminal + refresh refusal, so an affected account stays out of the shared pool until a + new generation is available. Generic usage failures keep their existing retry + behavior. [#4664](https://github.com/tale-project/tale/pull/4664), + [#4667](https://github.com/tale-project/tale/pull/4667) +- `tale deploy observe` now keeps its retained-state checks and refusal phases + bounded to read-only evidence, including portable lock and native-artifact + validation. Observation never applies deployment changes or certifies readiness. + [#4648](https://github.com/tale-project/tale/pull/4648), + [#4655](https://github.com/tale-project/tale/pull/4655), + [#4657](https://github.com/tale-project/tale/pull/4657), + [#4660](https://github.com/tale-project/tale/pull/4660), + [#4662](https://github.com/tale-project/tale/pull/4662) +- CLI release checks now include every command suite, keep hashed workflow sources + byte-stable on Windows, and reject receipt symlinks on platforms without + `O_NOFOLLOW`. This prevents a platform-specific release from silently skipping + a CLI suite or accepting a redirected receipt. [#4668](https://github.com/tale-project/tale/pull/4668) + +## Upgrade notes + +- Deploy the Tale platform and CLI together before adopting these fixes. The + managed-deployments repository now pins its shared Tale CLI source to + `13a41556bd017e4fade3165d988974e7a3bea184` in + [ops commit 1d932920](https://github.com/tale-project/ops/commit/1d932920e600d8ddce32054b8bc678522cc10e7e). +- No database migration is included in this release. Keep the existing backup, + retained-release and configuration readback procedure, and verify the gateway + account state after rollout before sending new task turns. diff --git a/.github/renovate.json b/.github/renovate.json index 9049c1dfd5..99959762b0 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -21,6 +21,21 @@ "labels": ["dependencies", "security"] }, "osvVulnerabilityAlerts": true, + "customManagers": [ + { + "customType": "regex", + "description": "The buildkitd pull-through registry mirror the spawner pulls at runtime, pinned by version and digest as an environment default rather than an image key, so no built-in manager sees it", + "managerFilePatterns": [ + "/(^|/)compose\\.yml$/", + "/^services/sandbox/src/config(\\.test)?\\.ts$/", + "/^tools/cli/src/lib/compose/types\\.ts$/" + ], + "matchStrings": [ + "(?registry):(?\\d+\\.\\d+\\.\\d+)@(?sha256:[a-f0-9]{64})" + ], + "datasourceTemplate": "docker" + } + ], "packageRules": [ { "description": "Patch updates: 30 day stabilization, grouped", @@ -59,6 +74,11 @@ ], "minimumReleaseAge": null, "groupName": "better-auth" + }, + { + "description": "CodeMirror and Lezer move together: @tale/ui's code editor and Milkdown share one copy of each, and two copies of @codemirror/state or @codemirror/view break the editor (packages/ui/src/components/forms/code-editor/deps.test.ts)", + "matchPackageNames": ["/^@codemirror\\//", "/^@lezer\\//"], + "groupName": "codemirror" } ] } diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3330717c6c..4c236c1789 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,6 +103,7 @@ jobs: uses: ./.github/actions/ci-scope with: filter: build + queue-only: 'true' # Only candidates need remote source validation; ordinary jobs keep their event SHA. candidate-source: @@ -406,11 +407,23 @@ jobs: file: services/${{ matrix.service }}/Dockerfile platforms: linux/amd64 push: true + # New layers are zstd-compressed, as a release's (release.yml), so CI + # pulls, tests and scans that format, and a layer reused from the + # release's zstd cache keeps a media type that names it. Not forced: + # the GHA cache exporter takes no compression option, so the layers + # it holds as gzip stay gzip, and re-encoding them would cost every + # build that time again. + outputs: type=image,compression=zstd,compression-level=3,oci-mediatypes=true tags: ${{ env.REGISTRY }}/${{ github.repository }}/tale-${{ matrix.service }}:${{ needs.changes.outputs.image_tag }} build-args: | VERSION=${{ needs.changes.outputs.image_tag }} ${{ matrix.service == 'platform' && format('AUTOMATION_WRITER_PROTOCOL={0}', steps.meta.outputs.automation-protocol) || '' }} - cache-from: type=gha,scope=${{ matrix.service }} + # The release's own amd64 cache is read here and never written: a + # build whose GHA cache was evicted reuses the layers the last release + # shipped instead of rebuilding every one of them. + cache-from: | + type=gha,scope=${{ matrix.service }} + type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}/tale-${{ matrix.service }}-buildcache:amd64 # Publish the large shared stack cache only from main. PR-local # exports took 148s and cannot seed other PRs; old candidates must # not overwrite the current main cache. diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 791fe8e88e..4082ca30fe 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -207,6 +207,7 @@ jobs: build: if: >- + github.event_name != 'pull_request' && !cancelled() && (((github.event_name == 'repository_dispatch') && needs.candidate-source.result == 'success') || @@ -310,7 +311,7 @@ jobs: # `bgutil-provider` compose sidecar in production. services: bgutil: - image: brainicism/bgutil-ytdlp-pot-provider:1.3.1 + image: mirror.gcr.io/brainicism/bgutil-ytdlp-pot-provider:1.3.1 ports: - 4416:4416 @@ -417,6 +418,7 @@ jobs: needs: [candidate-source, test-ui-shards] name: UI if: >- + github.event_name != 'pull_request' && always() && (((github.event_name == 'repository_dispatch') && needs.candidate-source.result == 'success') || @@ -451,6 +453,7 @@ jobs: needs: candidate-source name: UI (platform ${{ matrix.shard }}/4) if: >- + github.event_name != 'pull_request' && !cancelled() && (((github.event_name == 'repository_dispatch') && needs.candidate-source.result == 'success') || @@ -513,6 +516,7 @@ jobs: # was exceeded. The report records representative coverage and remaining gaps. performance: if: >- + github.event_name != 'pull_request' && !cancelled() && (((github.event_name == 'repository_dispatch') && needs.candidate-source.result == 'success') || @@ -615,6 +619,7 @@ jobs: needs: candidate-source name: Browser if: >- + github.event_name != 'pull_request' && !cancelled() && (((github.event_name == 'repository_dispatch') && needs.candidate-source.result == 'success') || @@ -771,6 +776,7 @@ jobs: uses: ./.github/actions/ci-scope with: filter: integration + queue-only: 'true' # The real-Postgres proof: `backend:integration` (services/platform/backend/ # integration-check.ts) against the database image Tale ships — built here diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index ab59fefa1f..60e0829a6f 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -25,12 +25,16 @@ on: - 'services/platform/backend/auth/oidc.ts' - 'services/platform/backend/db/sql.ts' - 'services/platform/backend/db/ssl.ts' + - 'services/platform/backend/domains/api_keys/owners.ts' + - 'services/platform/backend/domains/api_keys/retire.ts' - 'services/platform/backend/domains/audit_logs/**' - 'services/platform/backend/domains/sandbox/retirement-schedule.ts' - 'services/platform/backend/domains/two_factor/service.ts' - 'services/platform/backend/jobs/enqueue.ts' - 'services/platform/backend/jobs/tasks.ts' - 'services/platform/backend/lib/org-config.ts' + - 'services/platform/backend/lib/request-channel.ts' + - 'services/platform/backend/realtime/outbox.ts' - 'services/platform/lib/**' - 'configs/platform/**' - 'packages/shared/**' @@ -79,6 +83,7 @@ jobs: uses: ./.github/actions/ci-scope with: filter: cli + queue-only: 'true' # Only candidates need remote source validation; ordinary jobs keep their event SHA. candidate-source: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index fd29d501b4..02e8dd9553 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -60,6 +60,7 @@ jobs: uses: ./.github/actions/ci-scope with: filter: e2e + queue-only: 'true' # Only candidates need remote source validation; ordinary jobs keep their event SHA. candidate-source: diff --git a/.github/workflows/load.yml b/.github/workflows/load.yml new file mode 100644 index 0000000000..e49415e654 --- /dev/null +++ b/.github/workflows/load.yml @@ -0,0 +1,265 @@ +name: Load + +# Manually triggered and never part of the merge gate: one profile of the +# load harness (tools/load) against a self-contained stack on the runner — +# tale-db and the object store as containers, N api and M worker processes of +# the platform from this checkout, and the realistic mock model provider. +# +# A hosted runner has four cores shared by the generator, the platform and +# the database, so its numbers say whether a change moved the platform's +# cost per user, not what a production host holds. A distributed run against +# a real deployment (many generators, one shard each, `merge` at the end) is +# described in tools/load/README.md. + +on: + workflow_dispatch: + inputs: + profile: + description: Load profile + type: choice + options: + - smoke + - load + - stress + - spike + - soak + - connections + - signin-storm + default: smoke + users: + description: Peak concurrent virtual users + type: string + default: '200' + ramp_seconds: + description: Seconds to reach the peak + type: string + default: '60' + hold_seconds: + description: Seconds to hold the peak (each stress step) + type: string + default: '180' + api_processes: + description: Platform api processes + type: string + default: '2' + worker_processes: + description: Platform worker processes + type: string + default: '1' + think_scale: + description: Multiply every think time (1 = human pace) + type: string + default: '1' + +permissions: + contents: read + +concurrency: + group: load-${{ github.ref }} + cancel-in-progress: false + +jobs: + load: + name: Load (${{ inputs.profile }}) + runs-on: ubuntu-latest + timeout-minutes: 180 + permissions: + contents: read + env: + LOAD_DB_PASSWORD: tale_load_ci + LOAD_S3_ACCESS_KEY: tale-load + LOAD_S3_SECRET_KEY: tale_load_object_store + PROFILE: ${{ inputs.profile }} + USERS: ${{ inputs.users }} + RAMP_SECONDS: ${{ inputs.ramp_seconds }} + HOLD_SECONDS: ${{ inputs.hold_seconds }} + API_PROCESSES: ${{ inputs.api_processes }} + WORKER_PROCESSES: ${{ inputs.worker_processes }} + THINK_SCALE: ${{ inputs.think_scale }} + + steps: + - name: Validate inputs + run: | + set -euo pipefail + for pair in "users:$USERS" "ramp_seconds:$RAMP_SECONDS" "hold_seconds:$HOLD_SECONDS" \ + "api_processes:$API_PROCESSES" "worker_processes:$WORKER_PROCESSES"; do + value="${pair#*:}" + if [[ ! "$value" =~ ^[0-9]+$ ]]; then + echo "::error::${pair%%:*} must be a whole number, got '${value}'"; exit 1 + fi + done + if [[ ! "$THINK_SCALE" =~ ^[0-9]+(\.[0-9]+)?$ ]]; then + echo "::error::think_scale must be a number, got '${THINK_SCALE}'"; exit 1 + fi + if [ "$API_PROCESSES" -lt 1 ] || [ "$API_PROCESSES" -gt 8 ]; then + echo '::error::api_processes must be 1-8 on a hosted runner'; exit 1 + fi + + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false + + - name: Setup toolchain + id: toolchain + uses: ./.github/actions/setup-turbo + with: + start-turbo-cache: 'false' + github-token: ${{ secrets.GITHUB_TOKEN }} + turbo-cache: 'false' + + # Thousands of open streams need descriptors, a listen backlog that + # absorbs a ramp's connect bursts, and ephemeral ports beyond the + # default 28k. + - name: Raise network limits + run: | + set -euo pipefail + sudo sysctl -w net.core.somaxconn=8192 net.ipv4.tcp_max_syn_backlog=8192 \ + net.ipv4.ip_local_port_range='10000 65000' net.ipv4.tcp_tw_reuse=1 + echo "nofile: $(ulimit -n) -> $(ulimit -Hn)" + + - name: Setup Docker builder + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 + with: + cleanup: false + + # Build's own layer cache (scope `db`) is read, never written. + - name: Build tale-db from services/db + uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0 + with: + context: . + file: services/db/Dockerfile + platforms: linux/amd64 + push: false + load: true + tags: tale-db:load + cache-from: type=gha,scope=db + provenance: false + + - name: Resolve the object-store pin + id: object-store + run: | + set -euo pipefail + image=$(bun -e "import { THIRD_PARTY_IMAGES } from './tools/cli/src/lib/compose/types.ts'; console.log(THIRD_PARTY_IMAGES['object-store'])") + if [ -z "$image" ]; then + echo '::error::THIRD_PARTY_IMAGES names no object-store image'; exit 1 + fi + echo "image=${image}" >> "$GITHUB_OUTPUT" + + - name: Start tale-db and the object store + env: + OBJECT_STORE_IMAGE: ${{ steps.object-store.outputs.image }} + run: | + set -euo pipefail + docker run -d --name tale-load-db --shm-size 1g -p 127.0.0.1:5432:5432 \ + -e DB_PASSWORD="$LOAD_DB_PASSWORD" -e DB_MAX_CONNECTIONS=400 \ + -e DB_SHARED_BUFFERS=1GB -e DB_EFFECTIVE_CACHE_SIZE=4GB tale-db:load + docker run -d --name tale-load-object-store -p 127.0.0.1:9000:9000 \ + -e MINIO_ROOT_USER="$LOAD_S3_ACCESS_KEY" -e MINIO_ROOT_PASSWORD="$LOAD_S3_SECRET_KEY" \ + -e MINIO_BROWSER=off "$OBJECT_STORE_IMAGE" server /data --address ':9000' + for _ in $(seq 1 90); do + if docker exec tale-load-db test -f /tmp/.db_ready; then break; fi + sleep 2 + done + docker exec tale-load-db test -f /tmp/.db_ready || { echo '::error::tale-db never became ready'; exit 1; } + for _ in $(seq 1 60); do + if curl --connect-timeout 2 --max-time 5 -sf -o /dev/null http://127.0.0.1:9000/minio/health/ready; then break; fi + sleep 1 + done + + # Secrets are minted per run; the stack and the database are discarded + # with the runner. + - name: Write the stack environment + run: | + set -euo pipefail + LOAD_DIR="$RUNNER_TEMP/load" + mkdir -p "$LOAD_DIR/config" "$LOAD_DIR/report" + auth_secret="$(openssl rand -hex 24)" + echo "::add-mask::$auth_secret" + { + echo "LOAD_DIR=$LOAD_DIR" + echo "TALE_LOAD_AUTH_SECRET=$auth_secret" + echo "TALE_LOAD_DB_URL=postgres://tale:${LOAD_DB_PASSWORD}@127.0.0.1:5432/tale_app" + echo "TALE_LOAD_STATS_DB_URL=postgres://tale:${LOAD_DB_PASSWORD}@127.0.0.1:5432/tale" + } >> "$GITHUB_ENV" + cat > "$LOAD_DIR/stack.env" <> "$GITHUB_STEP_SUMMARY" + else + echo 'No report was written; see the stack logs artifact.' >> "$GITHUB_STEP_SUMMARY" + fi + + - name: Upload the report and logs + if: always() + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + with: + name: load-${{ inputs.profile }}-${{ github.run_id }}-${{ github.run_attempt }} + path: | + ${{ env.LOAD_DIR }}/report + ${{ env.LOAD_DIR }}/logs + ${{ env.LOAD_DIR }}/plan.json + retention-days: 14 + if-no-files-found: warn diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f78fcdbaaa..8b0c188cdf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -171,6 +171,14 @@ jobs: uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 with: cleanup: false + # Hosted runners can be temporarily throttled by Docker Hub. Keep + # the builder bootstrap and anonymous base-image resolution on the + # public Google mirror so a registry incident does not strand a + # release before buildx starts. + driver-opts: image=mirror.gcr.io/moby/buildkit:buildx-stable-1 + buildkitd-config-inline: | + [registry."docker.io"] + mirrors = ["mirror.gcr.io"] - name: Login to GHCR uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4 @@ -191,12 +199,26 @@ jobs: - name: Build and push id: image + # A Docker Hub 429/5xx while resolving a public base can fail an + # otherwise valid build. Keep the first attempt's failure visible in + # the step outcome, then make one complete retry. The retry remains a + # blocking step, so real build/configuration failures still fail this + # job after the retry. + continue-on-error: true uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0 with: context: . file: services/${{ matrix.service.name }}/Dockerfile platforms: ${{ matrix.arch.platform }} push: true + # zstd layers unpack several times faster than gzip ones, at a + # slightly better ratio. Docker pulls them from Engine 23.0 on (the + # CLI refuses engines older than 24) and Kubernetes nodes from + # containerd 1.5; only OCI media types name them. force-compression + # re-encodes a layer the cache still holds as gzip. Level 3 is + # zstd's default and the level AWS measured faster Fargate starts + # with. + outputs: type=image,compression=zstd,compression-level=3,force-compression=true,oci-mediatypes=true tags: | ${{ env.REGISTRY }}/${{ github.repository }}/tale-${{ matrix.service.name }}:${{ needs.prepare.outputs.version_number }}-${{ matrix.arch.name }} build-args: | @@ -204,12 +226,21 @@ jobs: ${{ matrix.service.name == 'platform' && format('AUTOMATION_WRITER_PROTOCOL={0}', steps.meta.outputs.automation-protocol) || '' }} # Only trusted releases write these separate per-service cache images. # Architecture tags keep the native builders from replacing each other. - # amd64 also imports the GHA cache CI warms on main. - cache-from: | - type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}/tale-${{ matrix.service.name }}-buildcache:${{ matrix.arch.name }} - ${{ matrix.arch.name == 'amd64' && format('type=gha,scope={0}', matrix.service.name) || '' }} + # A release reads no other cache, so a layer it reuses keeps the bytes + # the previous release shipped and a host's upgrade downloads only the + # layers whose inputs changed. Reading main's GHA cache as well handed + # a release the bytes of a main build that had rebuilt from an evicted + # cache: v0.5.76's amd64 runtime image changed 1.98 of its 2.03 GB + # while arm64, built from the same source without that cache, changed + # none. + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}/tale-${{ matrix.service.name }}-buildcache:${{ matrix.arch.name }} # A cache outage must not invalidate a successfully pushed image. - cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}/tale-${{ matrix.service.name }}-buildcache:${{ matrix.arch.name }},mode=max,ignore-error=true + # The cache keeps the zstd blobs the image shipped, so the next + # release reuses an unchanged layer's exact bytes. A gzip cache would + # be re-encoded on every release, and a zstd encoder only promises + # the same output from the same code version: a BuildKit update could + # change every layer's digest and re-ship each image in full. + cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}/tale-${{ matrix.service.name }}-buildcache:${{ matrix.arch.name }},mode=max,ignore-error=true,compression=zstd,compression-level=3,force-compression=true # `labels:` replaces Dockerfile LABEL (not merges). The CLI reads # org.opencontainers.image.version to detect the running instance; # omitting it made every in-place 0.4.x deploy look like an unknown @@ -222,6 +253,35 @@ jobs: ${{ matrix.service.name == 'platform' && format('io.tale.automation-writer-protocol={0}', steps.meta.outputs.automation-protocol) || '' }} provenance: false + - name: Back off before retrying the registry + if: steps.image.outcome == 'failure' + run: sleep 15 + + - name: Retry build and push after a transient registry failure + id: image_retry + if: steps.image.outcome == 'failure' + uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0 + with: + context: . + file: services/${{ matrix.service.name }}/Dockerfile + platforms: ${{ matrix.arch.platform }} + push: true + outputs: type=image,compression=zstd,compression-level=3,force-compression=true,oci-mediatypes=true + tags: | + ${{ env.REGISTRY }}/${{ github.repository }}/tale-${{ matrix.service.name }}:${{ needs.prepare.outputs.version_number }}-${{ matrix.arch.name }} + build-args: | + VERSION=${{ needs.prepare.outputs.version_number }} + ${{ matrix.service.name == 'platform' && format('AUTOMATION_WRITER_PROTOCOL={0}', steps.meta.outputs.automation-protocol) || '' }} + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}/tale-${{ matrix.service.name }}-buildcache:${{ matrix.arch.name }} + cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}/tale-${{ matrix.service.name }}-buildcache:${{ matrix.arch.name }},mode=max,ignore-error=true,compression=zstd,compression-level=3,force-compression=true + labels: | + org.opencontainers.image.created=${{ steps.meta.outputs.created }} + org.opencontainers.image.revision=${{ steps.meta.outputs.revision }} + org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} + org.opencontainers.image.version=${{ needs.prepare.outputs.version_number }} + ${{ matrix.service.name == 'platform' && format('io.tale.automation-writer-protocol={0}', steps.meta.outputs.automation-protocol) || '' }} + provenance: false + - name: Setup Bun for document checks if: matrix.service.name == 'sandbox-runtime' uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 @@ -231,7 +291,7 @@ jobs: - name: Verify native document tools if: matrix.service.name == 'sandbox-runtime' env: - DOCUMENT_IMAGE: ${{ env.REGISTRY }}/${{ github.repository }}/tale-sandbox-runtime:${{ needs.prepare.outputs.version_number }}-${{ matrix.arch.name }}@${{ steps.image.outputs.digest }} + DOCUMENT_IMAGE: ${{ env.REGISTRY }}/${{ github.repository }}/tale-sandbox-runtime:${{ needs.prepare.outputs.version_number }}-${{ matrix.arch.name }}@${{ steps.image_retry.outputs.digest || steps.image.outputs.digest }} DOCUMENT_PLATFORM: ${{ matrix.arch.platform }} DOCUMENT_REVISION: ${{ steps.meta.outputs.revision }} DOCUMENT_VERSION: ${{ needs.prepare.outputs.version_number }} @@ -317,6 +377,23 @@ jobs: with: bun-version: '1.4.2' + - name: Preload external smoke-test image from mirror + env: + MIRROR_IMAGE: mirror.gcr.io/brainicism/bgutil-ytdlp-pot-provider:1.3.1 + COMPOSE_IMAGE: brainicism/bgutil-ytdlp-pot-provider:1.3.1 + run: | + set -euo pipefail + for attempt in 1 2 3; do + if docker pull "$MIRROR_IMAGE"; then + docker tag "$MIRROR_IMAGE" "$COMPOSE_IMAGE" + exit 0 + fi + echo "Mirror pull attempt ${attempt} failed; retrying" >&2 + sleep $((attempt * 5)) + done + echo '::error::Could not preload the smoke-test provider image from the registry mirror' + exit 1 + # Image probes use disposable offline containers; the smoke test owns # the tale-test Compose project. Reuse the same accepted image set. - name: Run stack validation @@ -567,7 +644,10 @@ jobs: trigger-cli: if: needs.prepare.outputs.sites_only != 'true' name: Trigger CLI build - needs: [prepare, manifest] + # The CLI workflow resolves its source from the release tag. A dispatched + # release creates that tag in create-release, so do not dispatch it in + # parallel with the publication job. + needs: [prepare, manifest, create-release] runs-on: ubuntu-latest timeout-minutes: 3 permissions: diff --git a/.trivyignore.yaml b/.trivyignore.yaml index 1e8ff62519..f2911fa09e 100644 --- a/.trivyignore.yaml +++ b/.trivyignore.yaml @@ -33,9 +33,10 @@ misconfigurations: paths: - 'services/sandbox-egress/Dockerfile' statement: | - Egress proxy entrypoint runs as root only long enough to chown the log - file; tinyproxy itself drops privileges to `nobody` at bind time via - tinyproxy.conf. Documented in services/sandbox-egress/Dockerfile. + Egress proxy entrypoint runs as root to install the iptables SSRF + firewall and bind dnsmasq to :53; tinyproxy itself drops privileges to + `nobody` at bind time via tinyproxy.conf. Documented in + services/sandbox-egress/Dockerfile. - id: AVD-DS-0002 paths: - 'services/sandbox-buildkitd/Dockerfile' diff --git a/bun.lock b/bun.lock index a2243d00a1..c90f1811ba 100644 --- a/bun.lock +++ b/bun.lock @@ -131,10 +131,22 @@ "tale-seo-compile": "./bin/seo-compile.ts", }, "dependencies": { + "@codemirror/autocomplete": "6.20.3", + "@codemirror/commands": "6.10.4", + "@codemirror/lang-javascript": "6.2.5", + "@codemirror/lang-json": "6.0.2", + "@codemirror/lang-yaml": "6.1.3", + "@codemirror/language": "6.12.4", + "@codemirror/search": "6.7.1", + "@codemirror/state": "6.7.1", + "@codemirror/view": "6.43.8", "@fontsource/inter": "5.2.8", "@hookform/resolvers": "5.2.2", "@iconify-json/lucide": "1.2.122", "@iconify/react": "6.0.2", + "@lezer/common": "1.5.2", + "@lezer/highlight": "1.2.3", + "@lezer/markdown": "1.7.2", "@microlink/react-json-view": "1.31.18", "@radix-ui/react-checkbox": "1.3.3", "@radix-ui/react-dialog": "1.1.15", @@ -310,14 +322,12 @@ "@tanstack/react-router": "1.168.10", "@tanstack/react-table": "8.21.3", "@xmldom/xmldom": "0.8.15", - "@xyflow/react": "12.10.2", "acorn": "8.18.0", "ajv": "8.20.0", "aws4fetch": "^1.0.20", "better-auth": "1.7.5", "chokidar": "5.0.0", "class-variance-authority": "0.7.1", - "cron-parser": "5.5.0", "dayjs": "1.11.20", "dompurify": "3.4.16", "eventsource-parser": "4.1.1", @@ -511,6 +521,7 @@ "ajv": "8.20.0", "commander": "14.0.3", "crc-32": "1.2.2", + "eventsource-parser": "4.1.1", "is-reference": "3.0.3", "jszip": "3.10.1", "periscopic": "4.0.3", @@ -546,6 +557,28 @@ "name": "@tale/lint-manual", "version": "0.1.0", }, + "tools/load": { + "name": "@tale/load", + "version": "0.1.0", + "bin": { + "tale-load": "./src/cli.ts", + }, + "devDependencies": { + "@anthropic-ai/sdk": "0.111.0", + "@faker-js/faker": "10.5.0", + "@tale/shared": "workspace:*", + "@types/bun": "1.3.11", + "better-auth": "1.7.5", + "commander": "14.0.3", + "eventsource-parser": "4.1.1", + "hdr-histogram-js": "3.0.1", + "openai": "6.42.0", + "postgres": "3.4.7", + "typescript": "6.0.2", + "undici": "7.29.1", + "zod": "4.3.6", + }, + }, "tools/opengrep": { "name": "@tale/opengrep", "version": "0.1.0", @@ -622,6 +655,8 @@ "@antfu/install-pkg": ["@antfu/install-pkg@1.1.0", "", { "dependencies": { "package-manager-detector": "^1.3.0", "tinyexec": "^1.0.1" } }, "sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ=="], + "@anthropic-ai/sdk": ["@anthropic-ai/sdk@0.111.0", "", { "dependencies": { "json-schema-to-ts": "^3.1.1", "standardwebhooks": "^1.0.0" }, "peerDependencies": { "zod": "^3.25.0 || ^4.0.0" }, "optionalPeers": ["zod"], "bin": { "anthropic-ai-sdk": "bin/cli" } }, "sha512-1hUqKi+uJQoS5X90+InwHbFAXMvgq0DnsC5hVLEeSRaODiU5WvmqDAcVCmGS2wC0pN9Z8jtWCbWw7JLzeDdm/Q=="], + "@apideck/better-ajv-errors": ["@apideck/better-ajv-errors@0.3.7", "", { "dependencies": { "jsonpointer": "^5.0.1", "leven": "^3.1.0" }, "peerDependencies": { "ajv": ">=8" } }, "sha512-TajUJwGWbDwkCx/CZi7tRE8PVB7simCvKJfHUsSdvps+aTM/PDPP4gkLmKnc+x3CE//y9i/nj74GqdL/hwk7Iw=="], "@asamuzakjp/css-color": ["@asamuzakjp/css-color@5.1.11", "", { "dependencies": { "@asamuzakjp/generational-cache": "^1.0.1", "@csstools/css-calc": "^3.2.0", "@csstools/css-color-parser": "^4.1.0", "@csstools/css-parser-algorithms": "^4.0.0", "@csstools/css-tokenizer": "^4.0.0" } }, "sha512-KVw6qIiCTUQhByfTd78h2yD1/00waTmm9uy/R7Ck/ctUyAPj+AEDLkQIdJW0T8+qGgj3j5bpNKK7Q3G+LedJWg=="], @@ -632,6 +667,8 @@ "@asamuzakjp/nwsapi": ["@asamuzakjp/nwsapi@2.3.9", "", {}, "sha512-n8GuYSrI9bF7FFZ/SjhwevlHc8xaVlb/7HmHelnc/PZXBD2ZR49NnN9sMMuDdEGPeeRQ5d0hqlSlEpgCX3Wl0Q=="], + "@assemblyscript/loader": ["@assemblyscript/loader@0.19.23", "", {}, "sha512-ulkCYfFbYj01ie1MDOyxv2F6SpRN1TOj7fQxbP07D6HmeR+gr2JLSmINKjga2emB+b1L2KGrFKBTc+e00p54nw=="], + "@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], "@babel/compat-data": ["@babel/compat-data@7.29.7", "", {}, "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg=="], @@ -1804,6 +1841,8 @@ "@simplewebauthn/server": ["@simplewebauthn/server@13.3.2", "", { "dependencies": { "@hexagon/base64": "^1.1.27", "@levischuck/tiny-cbor": "^0.2.2", "@peculiar/asn1-android": "^2.6.0", "@peculiar/asn1-ecc": "^2.6.1", "@peculiar/asn1-rsa": "^2.6.1", "@peculiar/asn1-schema": "^2.6.0", "@peculiar/asn1-x509": "^2.6.1", "@peculiar/x509": "^1.14.3" } }, "sha512-KEDhfcGP1PAKRVSDjA3npTQFqS2b/srm+ipoNBNHdkzrHAlaRQUTE+a5f4ywsx6thxAw1NU2rYcLEY1949RGbQ=="], + "@stablelib/base64": ["@stablelib/base64@1.0.1", "", {}, "sha512-1bnPQqSxSuc3Ii6MhBysoWCg58j97aUjuCSZrGSmDxNqtytIi0k8utUenAwTZN4V5mXXYGsVUI9zeBqy+jBOSQ=="], + "@standard-schema/spec": ["@standard-schema/spec@1.1.0", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="], "@standard-schema/utils": ["@standard-schema/utils@0.3.0", "", {}, "sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g=="], @@ -1988,6 +2027,8 @@ "@tale/lint-manual": ["@tale/lint-manual@workspace:tools/lint-manual"], + "@tale/load": ["@tale/load@workspace:tools/load"], + "@tale/marketing-ui": ["@tale/marketing-ui@workspace:packages/marketing-ui"], "@tale/opengrep": ["@tale/opengrep@workspace:tools/opengrep"], @@ -2580,7 +2621,7 @@ "crelt": ["crelt@1.0.7", "", {}, "sha512-aK6BbWfhf4U/wCcLHKPJl/xa6VkVstRaPywWtMKGwuOLc/wZTyQYuoxgvZnNsBvv7Kg3YTBQYYBCggcviQczuA=="], - "cron-parser": ["cron-parser@5.5.0", "", { "dependencies": { "luxon": "^3.7.1" } }, "sha512-oML4lKUXxizYswqmxuOCpgFS8BNUJpIu6k/2HVHyaL8Ynnf3wdf9tkns0yRdJLSIjkJ+b0DXHMZEHGpMwjnPww=="], + "cron-parser": ["cron-parser@5.10.0", "", { "dependencies": { "luxon": "^3.7.2" } }, "sha512-izNAxJyRWUP8ljBoDSub5WyrVOUlT4SLGShswE7eoRBpp6QUsSycYxLBMJlbshgPBMcPT/nrfgjNY2918ayv2A=="], "cross-fetch": ["cross-fetch@3.2.0", "", { "dependencies": { "node-fetch": "^2.7.0" } }, "sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q=="], @@ -2850,6 +2891,8 @@ "fast-safe-stringify": ["fast-safe-stringify@2.1.1", "", {}, "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA=="], + "fast-sha256": ["fast-sha256@1.3.0", "", {}, "sha512-n11RGP/lrWEFI/bWdygLxhI+pVeo1ZYIVwvvPkW7azl/rOy+F3HYRZ2K5zeE9mmkhQppyv9sQFx0JM9UabnpPQ=="], + "fast-string-truncated-width": ["fast-string-truncated-width@3.0.3", "", {}, "sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g=="], "fast-string-width": ["fast-string-width@3.0.2", "", { "dependencies": { "fast-string-truncated-width": "^3.0.2" } }, "sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg=="], @@ -3018,6 +3061,8 @@ "hastscript": ["hastscript@9.0.1", "", { "dependencies": { "@types/hast": "^3.0.0", "comma-separated-tokens": "^2.0.0", "hast-util-parse-selector": "^4.0.0", "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0" } }, "sha512-g7df9rMFX/SPi34tyGCyUBREQoKkapwdY/T04Qn9TDWfHhAYt4/I0gMVirzK5wEzeUqIjEB+LXC/ypb7Aqno5w=="], + "hdr-histogram-js": ["hdr-histogram-js@3.0.1", "", { "dependencies": { "@assemblyscript/loader": "^0.19.21", "base64-js": "^1.2.0", "pako": "^1.0.3" } }, "sha512-l3GSdZL1Jr1C0kyb461tUjEdrRPZr8Qry7jByltf5JGrA0xvqOSrxRBfcrJqqV/AMEtqqhHhC6w8HW0gn76tRQ=="], + "he": ["he@1.2.0", "", { "bin": { "he": "bin/he" } }, "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw=="], "highlight.js": ["highlight.js@10.7.3", "", {}, "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A=="], @@ -3260,6 +3305,8 @@ "json-schema-ref-parser": ["json-schema-ref-parser@6.1.0", "", { "dependencies": { "call-me-maybe": "^1.0.1", "js-yaml": "^3.12.1", "ono": "^4.0.11" } }, "sha512-pXe9H1m6IgIpXmE5JSb8epilNTGsmTb2iPohAXpOdhqGFbQjNeHHsZxU+C8w6T81GZxSPFLeUoqDJmzxx5IGuw=="], + "json-schema-to-ts": ["json-schema-to-ts@3.1.1", "", { "dependencies": { "@babel/runtime": "^7.18.3", "ts-algebra": "^2.0.0" } }, "sha512-+DWg8jCJG2TEnpy7kOm/7/AxaYoaRbjVB4LFZLySZlWn8exGs3A4OLJR966cVvU26N7X9TWxl+Jsw7dzAqKT6g=="], + "json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="], "json5": ["json5@2.2.3", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="], @@ -4104,6 +4151,8 @@ "stackback": ["stackback@0.0.2", "", {}, "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw=="], + "standardwebhooks": ["standardwebhooks@1.1.1", "", { "dependencies": { "@stablelib/base64": "^1.0.0", "fast-sha256": "^1.3.0" } }, "sha512-bCbX9ZEyFkWPsRz7Bl3NuQUJohmwGSev/yhr7vhaGPlc4AfIrspIRa6cPTBuI1ItmrTDJ4d/S2hCsfe4+vQGnQ=="], + "std-env": ["std-env@4.2.0", "", {}, "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw=="], "stdin-discarder": ["stdin-discarder@0.2.2", "", {}, "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ=="], @@ -4248,6 +4297,8 @@ "trough": ["trough@2.2.0", "", {}, "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw=="], + "ts-algebra": ["ts-algebra@2.0.0", "", {}, "sha512-FPAhNPFMrkwz76P7cdjdmiShwMynZYN6SgOujD1urY4oNm80Ou9oMdmbR45LotcKOXoy7wSmHkRFE6Mxbrhefw=="], + "ts-dedent": ["ts-dedent@2.3.0", "", {}, "sha512-JfJeIHke7y2egdGGgRAvpCwYFUsHlM2gPcrVOxFkznt/4uzQ7HFmvE63iFHVLBJNDuyDOQgijDK/tXH/f6Msjg=="], "ts-mixer": ["ts-mixer@6.0.4", "", {}, "sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA=="], @@ -4862,8 +4913,6 @@ "parse5/entities": ["entities@6.0.1", "", {}, "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g=="], - "pg-boss/cron-parser": ["cron-parser@5.10.0", "", { "dependencies": { "luxon": "^3.7.2" } }, "sha512-izNAxJyRWUP8ljBoDSub5WyrVOUlT4SLGShswE7eoRBpp6QUsSycYxLBMJlbshgPBMcPT/nrfgjNY2918ayv2A=="], - "pg-boss/pg": ["pg@8.23.0", "", { "dependencies": { "pg-connection-string": "^2.14.0", "pg-pool": "^3.14.0", "pg-protocol": "^1.16.0", "pg-types": "2.2.0", "pgpass": "1.0.5" }, "optionalDependencies": { "pg-cloudflare": "^1.4.0" }, "peerDependencies": { "pg-native": ">=3.0.1" }, "optionalPeers": ["pg-native"] }, "sha512-Ip2EQCngowJLGOfCwkFhPXU7/ljlhn6Rxlmy4XYfL2Y+vyRM59+8uR2xqRWKdYmbXmxCFOAmKxBuSUCdF34qLg=="], "playwright/fsevents": ["fsevents@2.3.2", "", { "os": "darwin" }, "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="], diff --git a/compose.yml b/compose.yml index cec65d12cc..9f68fb3b6e 100644 --- a/compose.yml +++ b/compose.yml @@ -704,6 +704,10 @@ services: # Connections the proxy serves at once for the whole fleet (tinyproxy # MaxClients). Mirrors the CLI compose generator. SANDBOX_EGRESS_MAX_CLIENTS: ${SANDBOX_EGRESS_MAX_CLIENTS:-2000} + # Connections one session (one client address) may hold open to the + # proxy at once, so no session takes the whole pool above; 0 turns the + # cap off. Mirrors the CLI compose generator. + SANDBOX_EGRESS_MAX_CONNECTIONS_PER_SESSION: ${SANDBOX_EGRESS_MAX_CONNECTIONS_PER_SESSION:-256} # Mirrors the CLI compose generator (create-sandbox-egress-service.ts): # tinyproxy runs a thread and holds two descriptors per connection # (SANDBOX_EGRESS_MAX_CLIENTS, 2000 by default), and threads count @@ -726,10 +730,9 @@ services: # NET_ADMIN — install the iptables OUTPUT REJECT rules for IMDS # (169.254.169.254) + RFC1918 (the only hostname- # independent egress fence; fail-closed without it). - # DAC_OVERRIDE — entrypoint.sh (root) touches/creates the tinyproxy log - # inside /var/log/tinyproxy, which the image owns by - # `nobody`; without it the touch fails Permission denied. - # CHOWN — chown that log file to nobody. + # DAC_OVERRIDE / CHOWN — part of the live-verified set. tinyproxy logs + # to stdout, so no entrypoint step is known to need them; + # drop them only once a live boot without them passes. # SETUID/SETGID — tinyproxy drops privileges to nobody after bind. # NET_BIND_SERVICE — dnsmasq binds privileged port 53 to serve external # DNS to the internal-only sandbox network (dnsmasq checks @@ -754,7 +757,10 @@ services: # `-f`. NOT `nc -z`: tinyproxy logs every connect-and-close at ERROR # ("read_request_line: Client … closed socket before read."), which # wrote one error line per interval into the log an operator reads to - # find real failures. + # find real failures. Then one DNS query to dnsmasq on 127.0.0.1 for the + # name it answers from its own `--host-record`: nested containers and + # BuildKit RUN steps resolve only through it, and busybox `nslookup` + # exits non-zero when it does not answer within a second. # We intentionally do NOT CONNECT-probe an external host (pypi/npm) # — flapping that probe against a transient upstream outage flips # the spawner's `depends_on: service_healthy` gate to false and @@ -765,7 +771,7 @@ services: test: [ 'CMD-SHELL', - "curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/ || exit 1", + "curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/ && nslookup -type=a -timeout=1 sandbox-egress-health.invalid 127.0.0.1 || exit 1", ] interval: 10s timeout: 5s @@ -849,7 +855,7 @@ services: # generator (create-sandbox-service.ts) — R2-B11 lockstep. SANDBOX_DOCKER_BUILD_CACHE: ${SANDBOX_DOCKER_BUILD_CACHE:-} SANDBOX_BUILDKITD_IMAGE: ${SANDBOX_BUILDKITD_IMAGE:-tale-sandbox-buildkitd:latest} - SANDBOX_BUILDKITD_MIRROR_IMAGE: ${SANDBOX_BUILDKITD_MIRROR_IMAGE:-registry:2} + SANDBOX_BUILDKITD_MIRROR_IMAGE: ${SANDBOX_BUILDKITD_MIRROR_IMAGE:-registry:3.1.2@sha256:ddf754342cfc8acc51a56d5d0ab6af06826461864460636d8bd5c546dab2a7b8} SANDBOX_EGRESS_NETWORK: tale-sandbox-net SANDBOX_EGRESS_PROXY: http://sandbox-egress:3128 volumes: @@ -882,12 +888,16 @@ services: nofile: soft: 4096 hard: 8192 + # Each probe is a runc exec of curl, every 30 s, so a booting spawner + # reads healthy up to 30 s after it starts. No `start_interval`: Docker + # Compose refuses it on Engine 24, the oldest engine Tale supports. + # Mirrors the CLI generator and the image's HEALTHCHECK. healthcheck: test: ['CMD', 'curl', '-fsS', 'http://127.0.0.1:8003/health'] - interval: 10s + interval: 30s timeout: 5s retries: 3 - start_period: 15s + start_period: 30s depends_on: sandbox-egress: condition: service_healthy @@ -956,6 +966,14 @@ services: # `llm-gateway`); kept as-is to avoid a data migration. - llm-gateway-data:/app/data restart: unless-stopped + # Graceful shutdown: on SIGTERM the gateway stops taking new calls and + # waits for the ones in flight (streamed answers included) to finish. It + # writes its in-memory budget counters (the spend the platform books) to + # its store only when that drain ends within 30s of the signal, its own + # cleanup window. Docker's 10s default would cut every model stream still + # running 10s into a deploy's stop. + # Mirrors the CLI generator (create-sandbox-llm-gateway-service.ts: 90s). + stop_grace_period: 90s mem_limit: 512m healthcheck: # The gateway image ships busybox wget but no curl. diff --git a/configs/platform/custom/automations/github/review-pull-requests/automation.yml b/configs/platform/custom/automations/github/review-pull-requests/automation.yml index 4f9033b22e..c4fcc36aec 100644 --- a/configs/platform/custom/automations/github/review-pull-requests/automation.yml +++ b/configs/platform/custom/automations/github/review-pull-requests/automation.yml @@ -12,8 +12,14 @@ requires: connectors: - github triggers: + # Off until a person names the repository: the workflow requires `owner` + # and `repo`, which a schedule never sends, so they go in the trigger's + # fixed input before it is turned on. - kind: schedule - cron: '*/30 * * * *' + enabled: false + repeat: + frequency: minutely + interval: 30 timezone: UTC i18n: de: diff --git a/configs/platform/custom/automations/github/triage-issues/automation.yml b/configs/platform/custom/automations/github/triage-issues/automation.yml index a7d17af1e0..a82915bd76 100644 --- a/configs/platform/custom/automations/github/triage-issues/automation.yml +++ b/configs/platform/custom/automations/github/triage-issues/automation.yml @@ -12,8 +12,16 @@ requires: connectors: - github triggers: + # Off until a person names the repository: the workflow requires `owner` + # and `repo`, which a schedule never sends, so they go in the trigger's + # fixed input before it is turned on. - kind: schedule - cron: 0 7 * * * + enabled: false + repeat: + frequency: daily + interval: 1 + times: + - '07:00' timezone: UTC i18n: de: diff --git a/configs/platform/custom/automations/gmail/sync-emails/automation.yml b/configs/platform/custom/automations/gmail/sync-emails/automation.yml index 09b0d18ab1..a88bbbbf2c 100644 --- a/configs/platform/custom/automations/gmail/sync-emails/automation.yml +++ b/configs/platform/custom/automations/gmail/sync-emails/automation.yml @@ -18,7 +18,9 @@ requires: - conversation triggers: - kind: schedule - cron: '*/5 * * * *' + repeat: + frequency: minutely + interval: 5 timezone: UTC i18n: de: diff --git a/configs/platform/custom/automations/gmail/triage-inbox/automation.yml b/configs/platform/custom/automations/gmail/triage-inbox/automation.yml index bf84ce3ff9..9350a312cf 100644 --- a/configs/platform/custom/automations/gmail/triage-inbox/automation.yml +++ b/configs/platform/custom/automations/gmail/triage-inbox/automation.yml @@ -15,7 +15,10 @@ requires: - conversation triggers: - kind: schedule - cron: 0 */6 * * * + repeat: + frequency: hourly + interval: 6 + minute: 0 timezone: UTC i18n: de: diff --git a/configs/platform/custom/automations/imap-smtp/sync-emails/automation.yml b/configs/platform/custom/automations/imap-smtp/sync-emails/automation.yml index 585d2e646c..4d8f281d5d 100644 --- a/configs/platform/custom/automations/imap-smtp/sync-emails/automation.yml +++ b/configs/platform/custom/automations/imap-smtp/sync-emails/automation.yml @@ -18,7 +18,9 @@ requires: - conversation triggers: - kind: schedule - cron: '*/5 * * * *' + repeat: + frequency: minutely + interval: 5 timezone: UTC i18n: de: diff --git a/configs/platform/custom/automations/imap-smtp/triage-inbox/automation.yml b/configs/platform/custom/automations/imap-smtp/triage-inbox/automation.yml index 7fc85f5327..1d90016cfd 100644 --- a/configs/platform/custom/automations/imap-smtp/triage-inbox/automation.yml +++ b/configs/platform/custom/automations/imap-smtp/triage-inbox/automation.yml @@ -15,7 +15,10 @@ requires: - conversation triggers: - kind: schedule - cron: 0 */6 * * * + repeat: + frequency: hourly + interval: 6 + minute: 0 timezone: UTC i18n: de: diff --git a/configs/platform/custom/automations/outlook/sync-emails/automation.yml b/configs/platform/custom/automations/outlook/sync-emails/automation.yml index 8a6b665c41..a1e852a9f6 100644 --- a/configs/platform/custom/automations/outlook/sync-emails/automation.yml +++ b/configs/platform/custom/automations/outlook/sync-emails/automation.yml @@ -18,7 +18,9 @@ requires: - conversation triggers: - kind: schedule - cron: '*/5 * * * *' + repeat: + frequency: minutely + interval: 5 timezone: UTC i18n: de: diff --git a/configs/platform/custom/automations/outlook/triage-inbox/automation.yml b/configs/platform/custom/automations/outlook/triage-inbox/automation.yml index 3f52bca390..ebf419177c 100644 --- a/configs/platform/custom/automations/outlook/triage-inbox/automation.yml +++ b/configs/platform/custom/automations/outlook/triage-inbox/automation.yml @@ -15,7 +15,10 @@ requires: - conversation triggers: - kind: schedule - cron: 0 */6 * * * + repeat: + frequency: hourly + interval: 6 + minute: 0 timezone: UTC i18n: de: diff --git a/configs/platform/system/connectors/confluence/connector.yml b/configs/platform/system/connectors/confluence/connector.yml index 9993b3961e..411ffca78d 100644 --- a/configs/platform/system/connectors/confluence/connector.yml +++ b/configs/platform/system/connectors/confluence/connector.yml @@ -16,6 +16,12 @@ auth: - method: basic actions: - name: list_pages + title: List pages + i18n: + de: + title: Seiten auflisten + fr: + title: Lister les pages description: >- List a Confluence space's pages. Cursor pagination is handled internally (soft-capped; `truncated: true` beyond the cap). Archived pages are @@ -141,6 +147,12 @@ actions: }; exampleInput: { spaceKey: 'ENG' } - name: get_page + title: Get page + i18n: + de: + title: Seite abrufen + fr: + title: Récupérer une page description: >- Fetch a single page's rendered content by pageId, convert it to plain text, and store it as a text/plain file. diff --git a/configs/platform/system/connectors/conversation/connector.yml b/configs/platform/system/connectors/conversation/connector.yml index f3e3c47559..ffe894df7a 100644 --- a/configs/platform/system/connectors/conversation/connector.yml +++ b/configs/platform/system/connectors/conversation/connector.yml @@ -4,6 +4,11 @@ # in one place. `platform` auth — nothing to connect. name: conversation displayName: Conversations +i18n: + de: + displayName: Konversationen + fr: + displayName: Conversations description: >- Pull mailbox traffic into the org Inbox and expose a one-shot sync and a multi-credential inbox list for scheduled mail packs. @@ -14,6 +19,12 @@ auth: - method: platform actions: - name: sync_mailbox + title: Sync mailboxes + i18n: + de: + title: Postfächer synchronisieren + fr: + title: Synchroniser les boîtes mail description: >- List new messages from every active credential on the named mail connector, fetch each body, and ingest them into conversations (inbound @@ -50,6 +61,12 @@ actions: impl: conversation.sync_mailbox exampleInput: { connectorSlug: 'imap-smtp', limit: 25 } - name: list_mailbox_messages + title: List mailbox messages + i18n: + de: + title: Nachrichten der Postfächer auflisten + fr: + title: Lister les messages des boîtes mail description: >- List the newest inbox messages from every active credential on the named mail connector — what triage digests over. IMAP UIDs are scoped per @@ -87,6 +104,12 @@ actions: impl: conversation.list_mailbox_messages exampleInput: { connectorSlug: 'imap-smtp', limit: 25 } - name: list_untriaged + title: List untriaged conversations + i18n: + de: + title: Nicht triagierte Konversationen auflisten + fr: + title: Lister les conversations à trier description: >- List the open Inbox conversations of one mail connector that are waiting on the team — the newest message is the customer's — and that no triage @@ -128,6 +151,12 @@ actions: impl: conversation.list_untriaged exampleInput: { connectorSlug: 'gmail', limit: 25 } - name: record_triage + title: Record triage + i18n: + de: + title: Triage festhalten + fr: + title: Enregistrer le triage description: >- Record a triage pass on Inbox conversations: the verdict is stamped on each conversation, and its priority is set where no person has set one. @@ -180,6 +209,12 @@ actions: ], } - name: ingest_emails + title: Import received emails + i18n: + de: + title: Empfangene E-Mails importieren + fr: + title: Importer les e-mails reçus description: Ingest already-fetched inbound emails into conversations. effects: write input: @@ -222,6 +257,12 @@ actions: ], } - name: ingest_sent_emails + title: Import sent emails + i18n: + de: + title: Gesendete E-Mails importieren + fr: + title: Importer les e-mails envoyés description: Ingest already-fetched Sent-folder emails into conversations. effects: write input: @@ -265,6 +306,12 @@ actions: ], } - name: draft_reply + title: Draft reply + i18n: + de: + title: Antwortentwurf erstellen + fr: + title: Rédiger un brouillon de réponse description: >- Propose a reply on a conversation and leave it for a person. The draft appears in the Inbox as a pending message; sending it is a human act, and @@ -301,6 +348,12 @@ actions: body: 'Yes, we still have it in stock. Would you like us to hold one?', } - name: query_sync_cursor + title: Get last sync time + i18n: + de: + title: Zeitpunkt der letzten Synchronisierung abrufen + fr: + title: Récupérer l’heure de la dernière synchronisation description: The latest synced message timestamp for a mailbox direction. effects: read input: diff --git a/configs/platform/system/connectors/discord/connector.yml b/configs/platform/system/connectors/discord/connector.yml index cdddb65e56..a7a40741b4 100644 --- a/configs/platform/system/connectors/discord/connector.yml +++ b/configs/platform/system/connectors/discord/connector.yml @@ -19,6 +19,12 @@ auth: scheme: Bot actions: - name: list_guilds + title: List servers + i18n: + de: + title: Server auflisten + fr: + title: Lister les serveurs description: List the guilds (servers) the bot is a member of. effects: read input: @@ -46,6 +52,12 @@ actions: return { guilds: r.json() }; exampleInput: { limit: 50 } - name: get_guild + title: Get server + i18n: + de: + title: Server abrufen + fr: + title: Récupérer un serveur description: Get a single guild (server) by ID. effects: read input: @@ -66,6 +78,12 @@ actions: return { guild: r.json() }; exampleInput: { guild_id: '100000000000000001' } - name: list_channels + title: List channels + i18n: + de: + title: Kanäle auflisten + fr: + title: Lister les salons description: List all channels in a guild. effects: read input: @@ -86,6 +104,12 @@ actions: return { channels: r.json() }; exampleInput: { guild_id: '100000000000000001' } - name: list_messages + title: List messages + i18n: + de: + title: Nachrichten auflisten + fr: + title: Lister les messages description: Fetch recent messages from a channel. effects: read input: @@ -120,6 +144,12 @@ actions: return { messages: r.json() }; exampleInput: { channel_id: '300000000000000001', limit: 20 } - name: send_message + title: Send message + i18n: + de: + title: Nachricht senden + fr: + title: Envoyer un message description: Send a message to a channel. effects: write input: @@ -154,6 +184,12 @@ actions: exampleInput: { channel_id: '300000000000000001', content: 'Deploy finished ✅' } - name: get_user + title: Get user + i18n: + de: + title: Benutzer abrufen + fr: + title: Récupérer un utilisateur description: Get a Discord user by ID. effects: read input: @@ -174,6 +210,12 @@ actions: return { user: r.json() }; exampleInput: { user_id: '200000000000000001' } - name: list_members + title: List members + i18n: + de: + title: Mitglieder auflisten + fr: + title: Lister les membres description: List the members of a guild. effects: read input: @@ -202,6 +244,12 @@ actions: return { members: r.json() }; exampleInput: { guild_id: '100000000000000001', limit: 100 } - name: create_channel + title: Create channel + i18n: + de: + title: Kanal erstellen + fr: + title: Créer un salon description: Create a new channel in a guild. effects: write input: diff --git a/configs/platform/system/connectors/document/connector.yml b/configs/platform/system/connectors/document/connector.yml index bcc557f5c3..67fc7649ea 100644 --- a/configs/platform/system/connectors/document/connector.yml +++ b/configs/platform/system/connectors/document/connector.yml @@ -3,6 +3,11 @@ # text) into a folder as a visible document. Native-backed; `platform` auth. name: document displayName: Documents +i18n: + de: + displayName: Dokumente + fr: + displayName: Documents description: >- List a folder's stored files and file produced artifacts into folders — the platform's own document tree as automation steps. @@ -12,6 +17,12 @@ auth: - method: platform actions: - name: list + title: List files in folder + i18n: + de: + title: Dateien im Ordner auflisten + fr: + title: Lister les fichiers d’un dossier description: >- The files stored inside one folder — direct children by default; recursive walks the subfolder tree and prefixes each file name with its @@ -49,6 +60,12 @@ actions: impl: document.list exampleInput: { folderId: 'fld_1' } - name: create + title: Save document to folder + i18n: + de: + title: Dokument im Ordner ablegen + fr: + title: Enregistrer un document dans un dossier description: >- File a document into a folder: claim a harvested blob by storageId, or store inline text. Idempotent per (folder, name) — re-running refreshes diff --git a/configs/platform/system/connectors/github/connector.yml b/configs/platform/system/connectors/github/connector.yml index 165d563aa2..f560c99683 100644 --- a/configs/platform/system/connectors/github/connector.yml +++ b/configs/platform/system/connectors/github/connector.yml @@ -14,6 +14,12 @@ auth: - method: bearer actions: - name: list_repos + title: List repositories + i18n: + de: + title: Repositories auflisten + fr: + title: Lister les dépôts description: List repositories for the authenticated user. effects: read input: @@ -46,6 +52,12 @@ actions: return { repos: r.json() }; exampleInput: { visibility: 'all', per_page: 20 } - name: get_repo + title: Get repository + i18n: + de: + title: Repository abrufen + fr: + title: Récupérer un dépôt description: Get a single repository by owner and name. effects: read input: @@ -70,6 +82,12 @@ actions: return { repo: r.json() }; exampleInput: { owner: 'octocat', repo: 'hello-world' } - name: list_issues + title: List issues + i18n: + de: + title: Issues auflisten + fr: + title: Lister les issues description: List issues for a repository. effects: read input: @@ -115,6 +133,12 @@ actions: return { issues: r.json() }; exampleInput: { owner: 'octocat', repo: 'hello-world', state: 'open' } - name: get_issue + title: Get issue + i18n: + de: + title: Issue abrufen + fr: + title: Récupérer une issue description: Get a single issue by number. effects: read input: @@ -140,6 +164,12 @@ actions: return { issue: r.json() }; exampleInput: { owner: 'octocat', repo: 'hello-world', issue_number: 1 } - name: create_issue + title: Create issue + i18n: + de: + title: Issue erstellen + fr: + title: Créer une issue description: Create a new issue in a repository. effects: write input: @@ -179,6 +209,12 @@ actions: exampleInput: { owner: 'octocat', repo: 'hello-world', title: 'Something is broken' } - name: list_pull_requests + title: List pull requests + i18n: + de: + title: Pull Requests auflisten + fr: + title: Lister les pull requests description: List pull requests for a repository. effects: read input: @@ -229,6 +265,12 @@ actions: return { pull_requests: r.json() }; exampleInput: { owner: 'octocat', repo: 'hello-world', state: 'open' } - name: get_pull_request + title: Get pull request + i18n: + de: + title: Pull Request abrufen + fr: + title: Récupérer une pull request description: Get a single pull request by number. effects: read input: @@ -254,6 +296,12 @@ actions: return { pull_request: r.json() }; exampleInput: { owner: 'octocat', repo: 'hello-world', pull_number: 1 } - name: create_pull_request + title: Create pull request + i18n: + de: + title: Pull Request erstellen + fr: + title: Créer une pull request description: Create a new pull request in a repository. effects: write input: @@ -301,6 +349,12 @@ actions: base: 'main', } - name: merge_pull_request + title: Merge pull request + i18n: + de: + title: Pull Request mergen + fr: + title: Fusionner une pull request description: Merge a pull request into its base branch. effects: write input: @@ -348,6 +402,12 @@ actions: merge_method: 'squash', } - name: get_pull_request_files + title: List pull request files + i18n: + de: + title: Dateien eines Pull Requests auflisten + fr: + title: Lister les fichiers d’une pull request description: List the files changed in a pull request (filename, status, additions, deletions, patch). effects: read input: @@ -374,6 +434,12 @@ actions: return { files: r.json() }; exampleInput: { owner: 'octocat', repo: 'hello-world', pull_number: 1 } - name: get_pull_request_diff + title: Get pull request diff + i18n: + de: + title: Diff eines Pull Requests abrufen + fr: + title: Récupérer le diff d’une pull request description: Get the raw unified diff for a pull request. effects: read input: @@ -395,6 +461,12 @@ actions: return { diff: r.text() }; exampleInput: { owner: 'octocat', repo: 'hello-world', pull_number: 1 } - name: create_pull_request_review + title: Submit pull request review + i18n: + de: + title: Review für einen Pull Request abgeben + fr: + title: Envoyer une revue de pull request description: Submit a review on a pull request (APPROVE, REQUEST_CHANGES, or COMMENT) with an optional body and inline comments. effects: write input: @@ -444,6 +516,12 @@ actions: event: 'APPROVE', } - name: create_pull_request_review_comment + title: Add review comment + i18n: + de: + title: Review-Kommentar hinzufügen + fr: + title: Ajouter un commentaire de revue description: Add a single inline comment on a line of a pull request diff. effects: write input: @@ -485,6 +563,12 @@ actions: path: 'src/index.ts', } - name: list_issue_comments + title: List issue comments + i18n: + de: + title: Kommentare eines Issues auflisten + fr: + title: Lister les commentaires d’une issue description: List comments on an issue or pull request conversation. effects: read input: @@ -512,6 +596,12 @@ actions: return { comments: r.json() }; exampleInput: { owner: 'octocat', repo: 'hello-world', issue_number: 1 } - name: create_issue_comment + title: Comment on issue + i18n: + de: + title: Issue kommentieren + fr: + title: Commenter une issue description: Add a comment to an issue or pull request conversation. effects: write input: @@ -543,6 +633,12 @@ actions: body: 'Thanks for the report!', } - name: update_issue + title: Update issue + i18n: + de: + title: Issue aktualisieren + fr: + title: Mettre à jour une issue description: Update an issue's title, body, state, labels, assignees, or milestone. effects: write input: @@ -584,6 +680,12 @@ actions: state: 'closed', } - name: add_labels_to_issue + title: Add labels to issue + i18n: + de: + title: Labels zu einem Issue hinzufügen + fr: + title: Ajouter des étiquettes à une issue description: Add labels to an issue or pull request (additive, does not remove existing labels). effects: write input: @@ -614,6 +716,12 @@ actions: labels: ['bug', 'triage'], } - name: list_commits + title: List commits + i18n: + de: + title: Commits auflisten + fr: + title: Lister les commits description: List commits for a repository. effects: read input: @@ -648,6 +756,12 @@ actions: return { commits: r.json() }; exampleInput: { owner: 'octocat', repo: 'hello-world' } - name: search_code + title: Search code + i18n: + de: + title: Code durchsuchen + fr: + title: Rechercher du code description: Search for code across GitHub repositories. effects: read input: @@ -676,6 +790,12 @@ actions: return { total_count: j.total_count, items: j.items }; exampleInput: { q: 'addEventListener repo:octocat/hello-world' } - name: list_import_issues + title: List issues to import + i18n: + de: + title: Issues für den Import auflisten + fr: + title: Lister les issues à importer description: Read matching issues for task intake. Follows up to 20 pages per run, returning an opaque nextCursor for continuation without skipping a partially consumed page. effects: read input: @@ -699,6 +819,12 @@ actions: impl: github.list_import_issues exampleInput: { owner: example, repo: web, limit: 100 } - name: get_import_issue + title: Refresh imported issue + i18n: + de: + title: Importiertes Issue aktualisieren + fr: + title: Actualiser une issue importée description: Refresh a previously imported issue by immutable source identity, including closed or resolved issues outside the discovery filter. Marks a missing source unavailable without changing its Tale task. effects: read input: @@ -723,6 +849,12 @@ actions: externalId: example/web#1 externalIssue: { id: '1', title: Example, description: Details, url: 'https://example.com/issues/1', state: open, syncedAt: 0 } - name: refresh_import_issues + title: Refresh imported issues + i18n: + de: + title: Importierte Issues aktualisieren + fr: + title: Actualiser les issues importées description: Refresh up to 500 linked source snapshots with bounded request concurrency. Closed and unavailable issues remain linked to their existing Tale tasks. effects: read input: diff --git a/configs/platform/system/connectors/glitchtip/connector.yml b/configs/platform/system/connectors/glitchtip/connector.yml index 61f403273e..662e6fbd62 100644 --- a/configs/platform/system/connectors/glitchtip/connector.yml +++ b/configs/platform/system/connectors/glitchtip/connector.yml @@ -12,6 +12,12 @@ auth: - method: bearer actions: - name: list_import_issues + title: List issues to import + i18n: + de: + title: Issues für den Import auflisten + fr: + title: Lister les issues à importer description: Read matching issues for task intake. Follows up to 20 pages per run, returning an opaque nextCursor for continuation without skipping a partially consumed page. effects: read input: @@ -35,6 +41,12 @@ actions: impl: glitchtip.list_import_issues exampleInput: { organization: example, project: web, limit: 100 } - name: get_import_issue + title: Refresh imported issue + i18n: + de: + title: Importiertes Issue aktualisieren + fr: + title: Actualiser une issue importée description: Refresh a previously imported issue by immutable source identity, including closed or resolved issues outside the discovery filter. Marks a missing source unavailable without changing its Tale task. effects: read input: @@ -59,6 +71,12 @@ actions: externalId: example/web#1 externalIssue: { id: '1', title: Example, description: Details, url: 'https://example.com/issues/1', state: open, syncedAt: 0 } - name: refresh_import_issues + title: Refresh imported issues + i18n: + de: + title: Importierte Issues aktualisieren + fr: + title: Actualiser les issues importées description: Refresh up to 500 linked source snapshots with bounded request concurrency. Closed and unavailable issues remain linked to their existing Tale tasks. effects: read input: diff --git a/configs/platform/system/connectors/gmail/connector.yml b/configs/platform/system/connectors/gmail/connector.yml index 997e16232e..727503be39 100644 --- a/configs/platform/system/connectors/gmail/connector.yml +++ b/configs/platform/system/connectors/gmail/connector.yml @@ -23,6 +23,12 @@ auth: - https://www.googleapis.com/auth/gmail.modify actions: - name: list_messages + title: List messages + i18n: + de: + title: Nachrichten auflisten + fr: + title: Lister les messages description: List message and thread IDs from the mailbox, optionally filtered by a Gmail search query or labels. Draft messages are excluded. effects: read input: @@ -58,6 +64,12 @@ actions: return { messages: j.messages || [], nextPageToken: j.nextPageToken || '' }; exampleInput: { q: 'is:unread', maxResults: 25 } - name: get_message + title: Get message + i18n: + de: + title: Nachricht abrufen + fr: + title: Récupérer un message description: Fetch a single email message by ID with full headers, body, and attachment metadata. Optionally download and store all attachments. effects: read input: @@ -108,6 +120,12 @@ actions: return { message, attachments }; exampleInput: { messageId: '18c1a2b3c4d5e6f7', format: 'full' } - name: get_attachments + title: Download attachments + i18n: + de: + title: Anhänge herunterladen + fr: + title: Télécharger les pièces jointes description: Download every file attachment on a message and store each one. Returns a fileId and URL per attachment. effects: read input: @@ -149,6 +167,12 @@ actions: return { attachments }; exampleInput: { messageId: '18c1a2b3c4d5e6f7' } - name: search_messages + title: Search messages + i18n: + de: + title: Nachrichten durchsuchen + fr: + title: Rechercher des messages description: Search messages using Gmail query syntax and return the matching message and thread IDs. effects: read input: @@ -179,6 +203,12 @@ actions: return { messages: j.messages || [], nextPageToken: j.nextPageToken || '' }; exampleInput: { query: 'subject:invoice has:attachment', maxResults: 25 } - name: send_message + title: Send email + i18n: + de: + title: E-Mail senden + fr: + title: Envoyer un e-mail description: Compose and send an email message via Gmail. Supports replying into a thread and sending with file attachments. effects: write input: @@ -275,6 +305,12 @@ actions: body: 'This is a test message.', } - name: get_profile + title: Get mailbox address + i18n: + de: + title: Adresse des Postfachs abrufen + fr: + title: Récupérer l’adresse de la boîte mail description: The address of the connected mailbox (the account the credential authorizes), as the mail sync reads it to tell the mailbox's own mail from a customer's. effects: read input: @@ -292,6 +328,12 @@ actions: return { emailAddress: String(j.emailAddress || '') }; exampleInput: {} - name: list_labels + title: List labels + i18n: + de: + title: Labels auflisten + fr: + title: Lister les libellés description: List all labels in the mailbox, including system labels (INBOX, SENT, etc.) and user-created labels. effects: read input: @@ -309,6 +351,12 @@ actions: return { labels: j.labels || [] }; exampleInput: {} - name: get_thread + title: Get thread + i18n: + de: + title: E-Mail-Verlauf abrufen + fr: + title: Récupérer un fil de discussion description: Fetch a complete email thread (conversation) with all of its messages. effects: read input: @@ -333,6 +381,12 @@ actions: return { thread: r.json() }; exampleInput: { threadId: '18c1a2b3c4d5e6f7' } - name: list_drafts + title: List drafts + i18n: + de: + title: Entwürfe auflisten + fr: + title: Lister les brouillons description: List draft messages in the mailbox. effects: read input: @@ -359,6 +413,12 @@ actions: return { drafts: j.drafts || [], nextPageToken: j.nextPageToken || '' }; exampleInput: { maxResults: 25 } - name: get_attachment + title: Download attachment + i18n: + de: + title: Anhang herunterladen + fr: + title: Télécharger une pièce jointe description: Download a single email attachment by message ID and attachment ID, storing it through file storage. effects: read input: diff --git a/configs/platform/system/connectors/google-drive/connector.yml b/configs/platform/system/connectors/google-drive/connector.yml index ecc2de5f8b..64365d5cac 100644 --- a/configs/platform/system/connectors/google-drive/connector.yml +++ b/configs/platform/system/connectors/google-drive/connector.yml @@ -19,6 +19,12 @@ auth: - https://www.googleapis.com/auth/drive.readonly actions: - name: list_files + title: List files + i18n: + de: + title: Dateien auflisten + fr: + title: Lister les fichiers description: List files in a Google Drive folder. Pagination is handled internally — the operation returns the complete file list in one call. When recursive is true, subfolders are traversed breadth-first and each file's relative path is reported as subfolderPath. effects: read input: @@ -113,6 +119,12 @@ actions: return { files, truncated }; exampleInput: { folderId: '1AbCdEfGhIjKlMnOpQrStUvWxYz', recursive: false } - name: download_file + title: Download file + i18n: + de: + title: Datei herunterladen + fr: + title: Télécharger un fichier description: Download a single binary file by Drive fileId and store it in file storage. Native Google Workspace formats (Docs/Sheets/Slides) are not supported by this operation. effects: read input: diff --git a/configs/platform/system/connectors/imap-smtp/connector.yml b/configs/platform/system/connectors/imap-smtp/connector.yml index 7b35b1433d..5632e43f99 100644 --- a/configs/platform/system/connectors/imap-smtp/connector.yml +++ b/configs/platform/system/connectors/imap-smtp/connector.yml @@ -6,6 +6,11 @@ # server/port config the native module reads. name: imap-smtp displayName: IMAP / SMTP Mailbox +i18n: + de: + displayName: IMAP-/SMTP-Postfach + fr: + displayName: Boîte mail IMAP / SMTP description: >- Connect a private IMAP + SMTP mail server to Conversations — no Gmail or Outlook account required. Optional separate SMTP login for a relay @@ -21,6 +26,9 @@ configFields: - key: imapPort label: IMAP port type: number + integer: true + min: 1 + max: 65535 default: 993 description: IMAP port (993 for implicit TLS). - key: smtpHost @@ -31,6 +39,9 @@ configFields: - key: smtpPort label: SMTP port type: number + integer: true + min: 1 + max: 65535 default: 465 description: SMTP port (465 for implicit TLS, 587 for STARTTLS). - key: security @@ -58,6 +69,12 @@ auth: - method: basic actions: - name: list_messages + title: List messages + i18n: + de: + title: Nachrichten auflisten + fr: + title: Lister les messages description: >- Fetch messages from an IMAP mailbox as standard email objects (from, to, subject, body, attachments). Omit mailbox for INBOX; pass `sent` to read @@ -99,6 +116,12 @@ actions: impl: imap-smtp.list_messages exampleInput: { mailbox: 'INBOX', limit: 25 } - name: get_message + title: Get message + i18n: + de: + title: Nachricht abrufen + fr: + title: Récupérer un message description: >- Fetch one message by IMAP UID with plain/HTML body, file attachments (metadata plus base64 content when under 100 MiB; a larger part is @@ -142,6 +165,12 @@ actions: impl: imap-smtp.get_message exampleInput: { uid: '42', mailbox: 'INBOX' } - name: send + title: Send email + i18n: + de: + title: E-Mail senden + fr: + title: Envoyer un e-mail description: Send an email through the configured SMTP server. effects: write input: diff --git a/configs/platform/system/connectors/jev/connector.yml b/configs/platform/system/connectors/jev/connector.yml index 502070aaa4..2a09a51556 100644 --- a/configs/platform/system/connectors/jev/connector.yml +++ b/configs/platform/system/connectors/jev/connector.yml @@ -11,6 +11,11 @@ # tokens are free, so a decision costs a fraction of the chat call it replaces. name: jev displayName: Jev decisions +i18n: + de: + displayName: Jev-Entscheidungen + fr: + displayName: Décisions Jev description: >- Ask typed questions about a piece of state and get back calibrated answers — a choice from a fixed set, a score against ordered levels, or the probability @@ -25,6 +30,12 @@ auth: - method: api-key actions: - name: decide + title: Make a decision + i18n: + de: + title: Entscheidung treffen + fr: + title: Prendre une décision description: >- Judge one piece of state against named questions, all answered in a single pass. Use it to gate an action — whether to send, escalate, or diff --git a/configs/platform/system/connectors/outlook/connector.yml b/configs/platform/system/connectors/outlook/connector.yml index 4d0dfb82ec..f7a22f75ff 100644 --- a/configs/platform/system/connectors/outlook/connector.yml +++ b/configs/platform/system/connectors/outlook/connector.yml @@ -26,6 +26,12 @@ auth: - User.Read actions: - name: list_messages + title: List messages + i18n: + de: + title: Nachrichten auflisten + fr: + title: Lister les messages description: List messages from the mailbox, newest first. Draft messages are excluded. effects: read input: @@ -164,6 +170,12 @@ actions: return { messages, nextLink: j['@odata.nextLink'] || '' }; exampleInput: { top: 25 } - name: get_message + title: Get message + i18n: + de: + title: Nachricht abrufen + fr: + title: Récupérer un message description: Fetch a single email message by ID, optionally downloading and storing its file attachments. effects: read input: @@ -228,6 +240,12 @@ actions: return { message, attachments }; exampleInput: { messageId: 'AAMkAGI2THk...', includeAttachments: true } - name: get_attachments + title: Download attachments + i18n: + de: + title: Anhänge herunterladen + fr: + title: Télécharger les pièces jointes description: Download every file attachment on a message and store each one. Returns a fileId and URL per attachment. effects: read input: @@ -277,6 +295,12 @@ actions: return { attachments }; exampleInput: { messageId: 'AAMkAGI2THk...' } - name: search_messages + title: Search messages + i18n: + de: + title: Nachrichten durchsuchen + fr: + title: Rechercher des messages description: Search the mailbox by keyword across subject, body, and sender. effects: read input: @@ -323,6 +347,12 @@ actions: return { messages: j.value || [], nextLink: j['@odata.nextLink'] || '' }; exampleInput: { query: 'invoice', top: 25 } - name: send_message + title: Send email + i18n: + de: + title: E-Mail senden + fr: + title: Envoyer un e-mail description: Send an email message, optionally with file attachments. The message is composed as a draft so its internet message ID can be returned, then sent. effects: write input: @@ -394,6 +424,12 @@ actions: body: 'This is a test message.', } - name: get_profile + title: Get mailbox address + i18n: + de: + title: Adresse des Postfachs abrufen + fr: + title: Récupérer l’adresse de la boîte mail description: The address of the connected mailbox (the signed-in account's mail address, else its principal name), as the mail sync reads it to tell the mailbox's own mail from a customer's. effects: read input: @@ -412,6 +448,12 @@ actions: return { emailAddress: String(j.mail || j.userPrincipalName || '') }; exampleInput: {} - name: list_events + title: List events + i18n: + de: + title: Termine auflisten + fr: + title: Lister les événements description: List calendar events, earliest start first, optionally within a date range. effects: read input: @@ -468,6 +510,12 @@ actions: endDateTime: '2025-06-30T23:59:59', } - name: get_event + title: Get event + i18n: + de: + title: Termin abrufen + fr: + title: Récupérer un événement description: Fetch a single calendar event by ID. effects: read input: @@ -503,6 +551,12 @@ actions: return { event: r.json() }; exampleInput: { eventId: 'AAMkAGI2TG93...' } - name: create_event + title: Create event + i18n: + de: + title: Termin erstellen + fr: + title: Créer un événement description: Create a calendar event, optionally with a location and attendees. effects: write input: @@ -580,6 +634,12 @@ actions: timeZone: 'Europe/Berlin', } - name: list_contacts + title: List contacts + i18n: + de: + title: Kontakte auflisten + fr: + title: Lister les contacts description: List contacts from the default contacts folder, ordered by display name. effects: read input: @@ -634,6 +694,12 @@ actions: return { contacts: j.value || [], nextLink: j['@odata.nextLink'] || '' }; exampleInput: { top: 25, search: 'Ada' } - name: get_contact + title: Get contact + i18n: + de: + title: Kontakt abrufen + fr: + title: Récupérer un contact description: Fetch a single contact by ID. effects: read input: diff --git a/configs/platform/system/connectors/sandbox/connector.yml b/configs/platform/system/connectors/sandbox/connector.yml index f1749ad3c4..62e5cd513f 100644 --- a/configs/platform/system/connectors/sandbox/connector.yml +++ b/configs/platform/system/connectors/sandbox/connector.yml @@ -6,6 +6,11 @@ # so there is no credential and nothing to connect. name: sandbox displayName: Sandbox scripts +i18n: + de: + displayName: Sandbox-Skripte + fr: + displayName: Scripts de sandbox description: >- Run a deterministic script from a skill bundle in the organization's sandbox: staged input folders in, harvested output files and a parsed @@ -16,6 +21,12 @@ auth: - method: platform actions: - name: run_script + title: Run script + i18n: + de: + title: Skript ausführen + fr: + title: Exécuter un script description: >- Run one script that ships inside an org skill bundle, inside the automation run's sandbox session. The bundle is staged at diff --git a/configs/platform/system/connectors/shopify/connector.yml b/configs/platform/system/connectors/shopify/connector.yml index 89f0af053a..3fa892919a 100644 --- a/configs/platform/system/connectors/shopify/connector.yml +++ b/configs/platform/system/connectors/shopify/connector.yml @@ -17,6 +17,12 @@ auth: - method: api-key actions: - name: list_products + title: List products + i18n: + de: + title: Produkte auflisten + fr: + title: Lister les produits description: List products in the store, newest first, with cursor pagination. effects: read input: @@ -80,6 +86,12 @@ actions: return { products: r.json().products || [], nextPageInfo: m ? m[1] : '' }; exampleInput: { limit: 50, status: 'active' } - name: get_product + title: Get product + i18n: + de: + title: Produkt abrufen + fr: + title: Récupérer un produit description: Get a single product by ID, including its variants and images. effects: read input: @@ -114,6 +126,12 @@ actions: return { product: r.json().product }; exampleInput: { resourceId: '8123456789012' } - name: list_customers + title: List customers + i18n: + de: + title: Kunden auflisten + fr: + title: Lister les clients description: List customers of the store with cursor pagination. effects: read input: @@ -172,6 +190,12 @@ actions: return { customers: r.json().customers || [], nextPageInfo: m ? m[1] : '' }; exampleInput: { limit: 50 } - name: get_customer + title: Get customer + i18n: + de: + title: Kunden abrufen + fr: + title: Récupérer un client description: Get a single customer by ID, including contact details and order totals. effects: read input: @@ -207,6 +231,12 @@ actions: return { customer: r.json().customer }; exampleInput: { resourceId: '7123456789012' } - name: list_orders + title: List orders + i18n: + de: + title: Bestellungen auflisten + fr: + title: Lister les commandes description: List orders in the store with cursor pagination. effects: read input: @@ -270,6 +300,12 @@ actions: return { orders: r.json().orders || [], nextPageInfo: m ? m[1] : '' }; exampleInput: { limit: 50, status: 'any' } - name: get_order + title: Get order + i18n: + de: + title: Bestellung abrufen + fr: + title: Récupérer une commande description: Get a single order by ID, including its line items and totals. effects: read input: @@ -305,6 +341,12 @@ actions: return { order: r.json().order }; exampleInput: { resourceId: '5123456789012' } - name: count_products + title: Count products + i18n: + de: + title: Produkte zählen + fr: + title: Compter les produits description: Get the total number of products in the store. effects: read input: @@ -324,6 +366,12 @@ actions: if (!r.status || r.status >= 400) throw new Error(`Shopify count_products failed (${r.status}): ${r.text()}`); return { count: r.json().count || 0 }; - name: count_customers + title: Count customers + i18n: + de: + title: Kunden zählen + fr: + title: Compter les clients description: Get the total number of customers in the store. effects: read input: @@ -343,6 +391,12 @@ actions: if (!r.status || r.status >= 400) throw new Error(`Shopify count_customers failed (${r.status}): ${r.text()}`); return { count: r.json().count || 0 }; - name: count_orders + title: Count orders + i18n: + de: + title: Bestellungen zählen + fr: + title: Compter les commandes description: Get the total number of orders in the store. effects: read input: diff --git a/configs/platform/system/connectors/slack/connector.yml b/configs/platform/system/connectors/slack/connector.yml index 30fc7016ee..2ccda5d871 100644 --- a/configs/platform/system/connectors/slack/connector.yml +++ b/configs/platform/system/connectors/slack/connector.yml @@ -33,6 +33,12 @@ auth: - files:write actions: - name: list_channels + title: List channels + i18n: + de: + title: Channels auflisten + fr: + title: Lister les canaux description: List the conversations (channels, DMs, group messages) the bot can see. effects: read input: @@ -62,6 +68,12 @@ actions: return { channels: j.channels || [], next_cursor: (j.response_metadata && j.response_metadata.next_cursor) || null }; exampleInput: { types: 'public_channel', limit: 100 } - name: get_channel + title: Get channel + i18n: + de: + title: Channel abrufen + fr: + title: Récupérer un canal description: Get the details of one channel. effects: read input: @@ -84,6 +96,12 @@ actions: return { channel: j.channel }; exampleInput: { channel: 'C01234ABCDE' } - name: list_messages + title: List messages + i18n: + de: + title: Nachrichten auflisten + fr: + title: Lister les messages description: Fetch the message history of a channel. effects: read input: @@ -122,6 +140,12 @@ actions: return { messages: j.messages || [], has_more: !!j.has_more, next_cursor: (j.response_metadata && j.response_metadata.next_cursor) || null }; exampleInput: { channel: 'C01234ABCDE', limit: 50 } - name: send_message + title: Send message + i18n: + de: + title: Nachricht senden + fr: + title: Envoyer un message description: Send a message to a Slack channel or thread. effects: write input: @@ -160,6 +184,12 @@ actions: return { channel: j.channel, ts: j.ts }; exampleInput: { channel: 'C01234ABCDE', text: 'Deploy finished.' } - name: list_users + title: List workspace members + i18n: + de: + title: Workspace-Mitglieder auflisten + fr: + title: Lister les membres de l’espace de travail description: List the members of the Slack workspace. effects: read input: @@ -186,6 +216,12 @@ actions: return { users: j.members || [], next_cursor: (j.response_metadata && j.response_metadata.next_cursor) || null }; exampleInput: { limit: 100 } - name: get_user + title: Get user + i18n: + de: + title: Benutzer abrufen + fr: + title: Récupérer un utilisateur description: Get the profile of one workspace user. effects: read input: @@ -208,6 +244,12 @@ actions: return { user: j.user }; exampleInput: { user: 'U01234ABCDE' } - name: upload_file + title: Upload file + i18n: + de: + title: Datei hochladen + fr: + title: Téléverser un fichier description: Upload a text file and share it to a Slack channel. effects: write input: diff --git a/configs/platform/system/connectors/task/connector.yml b/configs/platform/system/connectors/task/connector.yml index 62f96e76a1..61a02604cf 100644 --- a/configs/platform/system/connectors/task/connector.yml +++ b/configs/platform/system/connectors/task/connector.yml @@ -5,6 +5,11 @@ # connect. name: task displayName: Tasks +i18n: + de: + displayName: Aufgaben + fr: + displayName: Tâches description: >- Read a task, move its status, write or read its discussion comments, put its project agent to work, and keep a scheduled issue import's position @@ -15,7 +20,17 @@ auth: - method: platform actions: - name: get - description: Read one task's title, status, project, and external linkage. + title: Get task + i18n: + de: + title: Aufgabe abrufen + fr: + title: Récupérer une tâche + description: >- + Read one task's title, status, project, external linkage, and + description. description is the text as stored, each mention a link + `[@Name](mention:/)`; descriptionText is the same text with + each mention as `@` and the current name of whoever it names. effects: read input: type: object @@ -23,7 +38,7 @@ actions: additionalProperties: false properties: taskId: { type: string, description: The task id. } - output: '{ taskId: string, title: string, status: string, projectId: string, externalSystem?: string, externalId?: string, externalUrl?: string }' + output: '{ taskId: string, title: string, status: string, projectId: string, externalSystem?: string, externalId?: string, externalUrl?: string, description?: string, descriptionText?: string }' mock: | return { taskId: String(input.taskId), @@ -39,6 +54,12 @@ actions: impl: task.get exampleInput: { taskId: 'tsk_1' } - name: update_status + title: Change task status + i18n: + de: + title: Aufgabenstatus ändern + fr: + title: Changer le statut de la tâche description: >- Move a task to a new status. The automation acts as the workflow actor. Completing is not on offer — done stays reserved for the human review @@ -63,6 +84,12 @@ actions: impl: task.update_status exampleInput: { taskId: 'tsk_1', status: 'in_progress' } - name: comment + title: Comment on task + i18n: + de: + title: Aufgabe kommentieren + fr: + title: Commenter la tâche description: Post a comment on the task's discussion timeline. effects: write input: @@ -91,10 +118,18 @@ actions: impl: task.comment exampleInput: { taskId: 'tsk_1', body: 'Prepared the return.' } - name: list_comments + title: List task comments + i18n: + de: + title: Kommentare der Aufgabe auflisten + fr: + title: Lister les commentaires de la tâche description: >- Read the task's discussion comments, optionally only those newer than the last comment containing a marker (a delivery anchor) and only from - certain author kinds. + certain author kinds. body is each comment as stored, each mention a + link `[@Name](mention:/)`; bodyText is the same text with each + mention as `@` and the current name of whoever it names. effects: read input: type: object @@ -108,15 +143,15 @@ actions: description: Keep only these author kinds. afterMarker: type: string - description: Only comments newer than the last one containing this text. + description: Only comments newer than the last one whose body or bodyText contains this text. limit: { type: number, description: 'Newest N comments (max 100).' } - output: '{ count: number, truncated: boolean, comments: Array<{ authorType: string, authorId: string, body: string, bodyByLocale?: Record, createdAt: number }> }' + output: '{ count: number, truncated: boolean, comments: Array<{ authorType: string, authorId: string, body: string, bodyText: string, bodyByLocale?: Record, createdAt: number }> }' mock: | return { count: 1, truncated: false, comments: [ - { authorType: 'user', authorId: 'usr_mock', body: 'Please re-check page 3.', createdAt: 1_750_000_000_000 }, + { authorType: 'user', authorId: 'usr_mock', body: 'Please re-check page 3.', bodyText: 'Please re-check page 3.', createdAt: 1_750_000_000_000 }, ], }; backend: @@ -124,6 +159,12 @@ actions: impl: task.list_comments exampleInput: { taskId: 'tsk_1', authorTypes: [user], limit: 20 } - name: start_agent + title: Start project agent + i18n: + de: + title: Projektagenten starten + fr: + title: Lancer l’agent de projet description: >- Put the task's project agent to work, or first assign it to the agent named by agentId (an agent of the same project), and answer the run it @@ -139,13 +180,18 @@ actions: Starts nothing, without failing, when the task's live run already carries the work (already_running), an in-place start meets a card waiting for a person's review (in_review) or one already Done or - Cancelled (closed), the agent is working another task (agent_busy), an - open task blocks this one (blocked), or the task took three starts by - automations and agents, ordinary automatic retries included, in the last - hour (paused). One broker cooldown immediately after the same agent's - HTTP 429 adds no start; consecutive cooldowns still count. Honor the - returned retryAfter and every other admission check. A step delivered - again answers the run its first delivery started. + Cancelled (closed), an open task blocks this one (blocked), or the task + took three starts by automations and agents, ordinary automatic retries + included, in the last hour (paused). One broker cooldown immediately + after the same agent's HTTP 429 adds no start; consecutive cooldowns + still count. Honor the returned retryAfter and every other admission + check. An agent working other tasks is started all the same, in a + worker of its own; a run that finds no room waits and starts by itself, + and waitingReason says why: org_limit (every agent worker of the + organization is in use), host (the sandbox host is full), + destroy_pending (its workspace is being deleted) or exec_limit (its + sandbox is still ending an earlier process). A step delivered again + answers the run its first delivery started. effects: write input: type: object @@ -163,7 +209,7 @@ actions: moveToInProgress: type: boolean description: Move the card to In progress and park the result at In review (default), or leave it where it is — only under open work (Backlog, To do, In progress). - output: '{ started: boolean, runId: string | null, taskId: string, agentId: string, reason?: "already_running" | "in_review" | "closed" | "agent_busy" | "blocked" | "paused", replayed?: boolean, taskStatus?: string, busyTaskId?: string, blockedBy?: string[], retryAfter?: number }' + output: '{ started: boolean, runId: string | null, taskId: string, agentId: string, reason?: "already_running" | "in_review" | "closed" | "blocked" | "paused", replayed?: boolean, waitingReason?: "org_limit" | "host" | "destroy_pending" | "exec_limit", taskStatus?: string, blockedBy?: string[], retryAfter?: number }' mock: | return { started: true, @@ -176,6 +222,12 @@ actions: impl: task.start_agent exampleInput: { taskId: 'tsk_1', feedback: 'Scheduled occurrence 2026-09-30 09:00 Europe/Zurich.' } - name: upsert + title: Import issue as task + i18n: + de: + title: Issue als Aufgabe importieren + fr: + title: Importer une issue comme tâche description: Import an external issue into a project's backlog, reusing its existing task on repeat imports. Keeps local status, assignee, and non-empty description. A title over 200 or a description over 20,000 UTF-16 code units is cut to that length, ending in "…"; a blank title is refused. Returns the title the task carries. Does not start an agent. effects: write input: @@ -208,6 +260,12 @@ actions: impl: task.upsert exampleInput: { projectId: 'proj_mock', externalSystem: github, externalId: 'octocat/demo#1', title: Example issue } - name: list_external_issues + title: List imported issues + i18n: + de: + title: Importierte Issues auflisten + fr: + title: Lister les issues importées description: List previously imported issue sources for this project and immutable upstream repository/project. Oldest snapshots come first so repeated runs make progress through large boards. effects: read input: @@ -230,6 +288,12 @@ actions: impl: task.list_external_issues exampleInput: { projectId: proj_mock, externalSystem: github, repositoryId: 1 } - name: get_import_cursor + title: Get import position + i18n: + de: + title: Importposition abrufen + fr: + title: Récupérer la position de l’import description: >- Where a scheduled issue import of this project's source resumes: the cursor its last saved batch left, so each occurrence imports one bounded @@ -262,6 +326,12 @@ actions: impl: task.get_import_cursor exampleInput: { projectId: proj_mock, externalSystem: github, source: example/web } - name: save_import_cursor + title: Save import position + i18n: + de: + title: Importposition speichern + fr: + title: Enregistrer la position de l’import description: >- Record how far a scheduled issue import got: revision is the one get_import_cursor answered for this batch, and next the importer's @@ -290,6 +360,12 @@ actions: impl: task.save_import_cursor exampleInput: { projectId: proj_mock, externalSystem: github, source: example/web, revision: '1', next: '' } - name: upsert_issues + title: Import issues as tasks + i18n: + de: + title: Issues als Aufgaben importieren + fr: + title: Importer des issues comme tâches description: Atomically import or refresh a batch of issue snapshots. New tasks require an open source; repeat sync keeps Tale edits and status. Titles and descriptions are cut to 200 and 20,000 UTF-16 code units, ending in "…"; a blank title refuses the batch, naming the item. Returns one result per source with the title its task carries, and taskId null when a closed source has no task. effects: write input: diff --git a/configs/platform/system/connectors/tavily/connector.yml b/configs/platform/system/connectors/tavily/connector.yml index f9de82434b..500a6e77f5 100644 --- a/configs/platform/system/connectors/tavily/connector.yml +++ b/configs/platform/system/connectors/tavily/connector.yml @@ -13,6 +13,12 @@ auth: - method: api-key actions: - name: search + title: Search the web + i18n: + de: + title: Im Web suchen + fr: + title: Rechercher sur le web description: >- Search the open web via Tavily. Returns top results with title, URL, content snippet, and score. Use 'basic' depth for quick facts, @@ -84,6 +90,12 @@ actions: search_depth: 'advanced', } - name: extract + title: Extract page text + i18n: + de: + title: Seitentext extrahieren + fr: + title: Extraire le texte des pages description: >- Fetch cleaned main-article text for one or more URLs. Use for deep reads of the most promising search results. diff --git a/configs/platform/system/connectors/teams/connector.yml b/configs/platform/system/connectors/teams/connector.yml index 09db565d3f..cb294753ae 100644 --- a/configs/platform/system/connectors/teams/connector.yml +++ b/configs/platform/system/connectors/teams/connector.yml @@ -26,6 +26,12 @@ auth: - Chat.ReadWrite actions: - name: list_teams + title: List teams + i18n: + de: + title: Teams auflisten + fr: + title: Lister les équipes description: List the teams the authenticated user has joined. effects: read input: @@ -43,6 +49,12 @@ actions: return { teams: j.value || [], nextLink: j['@odata.nextLink'] || null }; exampleInput: {} - name: get_team + title: Get team + i18n: + de: + title: Team abrufen + fr: + title: Récupérer une équipe description: Get a single team by ID. effects: read input: @@ -63,6 +75,12 @@ actions: return { team: r.json() }; exampleInput: { teamId: '19:team-demo@thread.tacv2' } - name: list_channels + title: List channels + i18n: + de: + title: Kanäle auflisten + fr: + title: Lister les canaux description: List all channels in a team. effects: read input: @@ -84,6 +102,12 @@ actions: return { channels: j.value || [], nextLink: j['@odata.nextLink'] || null }; exampleInput: { teamId: '19:team-demo@thread.tacv2' } - name: get_channel + title: Get channel + i18n: + de: + title: Kanal abrufen + fr: + title: Récupérer un canal description: Get a single channel by ID. effects: read input: @@ -111,6 +135,12 @@ actions: channelId: '19:channel-general@thread.tacv2', } - name: list_messages + title: List channel messages + i18n: + de: + title: Kanalnachrichten auflisten + fr: + title: Lister les messages d’un canal description: Fetch messages from a channel. effects: read input: @@ -147,6 +177,12 @@ actions: top: 20, } - name: send_message + title: Send channel message + i18n: + de: + title: Nachricht im Kanal senden + fr: + title: Envoyer un message dans un canal description: Send a message to a channel. effects: write input: @@ -183,6 +219,12 @@ actions: content: 'Deploy finished.', } - name: list_members + title: List team members + i18n: + de: + title: Teammitglieder auflisten + fr: + title: Lister les membres de l’équipe description: List the members of a team. effects: read input: @@ -212,6 +254,12 @@ actions: return { members: j.value || [], nextLink: j['@odata.nextLink'] || null }; exampleInput: { teamId: '19:team-demo@thread.tacv2', top: 100 } - name: list_chats + title: List chats + i18n: + de: + title: Chats auflisten + fr: + title: Lister les conversations description: List the chats the authenticated user is part of. effects: read input: @@ -233,6 +281,12 @@ actions: return { chats: j.value || [], nextLink: j['@odata.nextLink'] || null }; exampleInput: { top: 20 } - name: send_chat_message + title: Send chat message + i18n: + de: + title: Chatnachricht senden + fr: + title: Envoyer un message dans une conversation description: Send a message to a chat. effects: write input: diff --git a/configs/platform/system/connectors/twilio/connector.yml b/configs/platform/system/connectors/twilio/connector.yml index b33a1b5b72..9ac5f02deb 100644 --- a/configs/platform/system/connectors/twilio/connector.yml +++ b/configs/platform/system/connectors/twilio/connector.yml @@ -16,6 +16,12 @@ auth: - method: basic actions: - name: send_sms + title: Send SMS + i18n: + de: + title: SMS senden + fr: + title: Envoyer un SMS description: Send an SMS message via Twilio. effects: write input: @@ -52,6 +58,12 @@ actions: body: 'Your order has shipped.', } - name: list_messages + title: List SMS messages + i18n: + de: + title: SMS auflisten + fr: + title: Lister les SMS description: List SMS messages, optionally filtered by number or send date. effects: read input: @@ -96,6 +108,12 @@ actions: return { messages: j.messages || [], next_page_uri: j.next_page_uri || null }; exampleInput: { to: '+15551234567', pageSize: 20 } - name: get_message + title: Get SMS message + i18n: + de: + title: SMS abrufen + fr: + title: Récupérer un SMS description: Get one SMS message by its SID. effects: read input: @@ -118,6 +136,12 @@ actions: return { message: r.json() }; exampleInput: { messageSid: 'SM1234567890abcdef1234567890abcdef' } - name: list_calls + title: List calls + i18n: + de: + title: Anrufe auflisten + fr: + title: Lister les appels description: List voice calls, optionally filtered by number or status. effects: read input: @@ -161,6 +185,12 @@ actions: return { calls: j.calls || [], next_page_uri: j.next_page_uri || null }; exampleInput: { status: 'completed', pageSize: 20 } - name: make_call + title: Start call + i18n: + de: + title: Anruf starten + fr: + title: Lancer un appel description: Start an outbound voice call via Twilio. effects: write input: @@ -201,6 +231,12 @@ actions: url: 'https://example.com/twiml/greeting.xml', } - name: get_account + title: Get account + i18n: + de: + title: Konto abrufen + fr: + title: Récupérer le compte description: Get the Twilio account the credential belongs to. effects: read input: @@ -219,6 +255,12 @@ actions: return { account: r.json() }; exampleInput: {} - name: list_phone_numbers + title: List phone numbers + i18n: + de: + title: Telefonnummern auflisten + fr: + title: Lister les numéros de téléphone description: List the incoming phone numbers the Twilio account owns. effects: read input: diff --git a/configs/platform/system/connectors/webdav/connector.yml b/configs/platform/system/connectors/webdav/connector.yml index 8155f5cefa..0aa1c32fbd 100644 --- a/configs/platform/system/connectors/webdav/connector.yml +++ b/configs/platform/system/connectors/webdav/connector.yml @@ -5,6 +5,11 @@ # Basic auth carries a WebDAV app password. name: webdav displayName: WebDAV Files +i18n: + de: + displayName: WebDAV-Dateien + fr: + displayName: Fichiers WebDAV description: >- Read, write, and list files in the organization's WebDAV store — the same files the /dav endpoint serves. @@ -14,6 +19,12 @@ auth: - method: basic actions: - name: list + title: List folder contents + i18n: + de: + title: Ordnerinhalt auflisten + fr: + title: Lister le contenu d’un dossier description: List the entries directly under a folder path. effects: read input: @@ -36,6 +47,12 @@ actions: impl: webdav.list exampleInput: { path: '/reports' } - name: read + title: Read file + i18n: + de: + title: Datei lesen + fr: + title: Lire un fichier description: Read a file's contents. effects: read input: @@ -51,6 +68,12 @@ actions: impl: webdav.read exampleInput: { path: '/reports/q3.md' } - name: write + title: Write file + i18n: + de: + title: Datei schreiben + fr: + title: Écrire un fichier description: Create or overwrite a file with the given contents. effects: write input: @@ -69,6 +92,12 @@ actions: impl: webdav.write exampleInput: { path: '/reports/summary.md', content: '# Summary' } - name: delete + title: Delete file or folder + i18n: + de: + title: Datei oder Ordner löschen + fr: + title: Supprimer un fichier ou un dossier description: Delete a file or folder. effects: write input: diff --git a/configs/platform/system/harnesses/gemini/harness.yml b/configs/platform/system/harnesses/gemini/harness.yml index c59f02e4af..5673d7b10a 100644 --- a/configs/platform/system/harnesses/gemini/harness.yml +++ b/configs/platform/system/harnesses/gemini/harness.yml @@ -139,7 +139,9 @@ exec: TALE_GATEWAY_TOKEN: '${gateway.token}' # A subscription-key credential (the Gemini CLI's Google-account sign-in / # Code Assist license) is the CLI's OAuth credentials blob, staged verbatim -# as its credentials file under the session HOME (/agent/.runtime/home). +# as its credentials file under the session HOME (/agent/.runtime/home). The +# platform removes the file when the turn settles, and before a turn that +# runs without the subscription, so no later exec in the session reads it. subscription: kind: staged-file path: .runtime/home/.gemini/oauth_creds.json diff --git a/configs/platform/system/models/openai/models.yml b/configs/platform/system/models/openai/models.yml index 7a63715078..e61d0e7c58 100644 --- a/configs/platform/system/models/openai/models.yml +++ b/configs/platform/system/models/openai/models.yml @@ -225,9 +225,10 @@ # whisper-1 rather than the gpt-4o-transcribe family: the request asks for # `response_format=verbose_json` and the paragraphizer needs the per-segment # timestamps it returns, which the newer transcribe models do not serve. -# Pricing is per audio MINUTE, which this catalog's per-token schema cannot -# express — so it is omitted and the ledger records minutes at a zero cost -# estimate. The context window is nominal: transcription takes a file. +# Pricing is per audio MINUTE ($0.006, openrouter.ai/openai/whisper-1/pricing +# on 2026-10-08), declared under `transcription`; the per-token `pricing` +# block cannot express it. The context window is nominal: transcription takes +# a file. - id: whisper-1 provider: openai tags: @@ -235,6 +236,8 @@ supportsTools: false supportsVision: false contextWindow: 2000 + transcription: + centsPerAudioMinute: 0.6 # Image generation: the models agents call through the generate_image tool, # over /v1/images/generations (and /v1/images/edits when the agent passes # reference images). They write images, never text, so they carry no chat diff --git a/design/docs/app.md b/design/docs/app.md index cb8e1421a6..dbc4f7ddc1 100644 --- a/design/docs/app.md +++ b/design/docs/app.md @@ -63,9 +63,10 @@ what is there, and the page shows the one thing you opened. - **Conversation pages** — a chat, a task and a customer conversation open in one frame: `ThreadHeader` (the Home panel toggle, a 32px identity mark, the title, one quiet line of context, then the actions), a centred reading column, and the composer pinned at the foot in the same frame - for all three (`CHAT_COMPOSER_FRAME_CLASS`). A task is a structured chat: its brief (description, + for all three (`THREAD_COMPOSER_FRAME_CLASS`, `@tale/ui/thread/layout`). A task is a structured chat: its brief (description, files, subtasks) opens the thread as a card, comments and history follow oldest first under day - pills, and its structure (status, owner, dates…) lives in a details panel that folds away. The + pills (one `ThreadDayDivider`, pinned while its day scrolls by, shared by chats, tasks and the + inbox), and its structure (status, owner, dates…) lives in a details panel that folds away. The actions a teammate needs lead: **Copy link** on a task and a conversation, and a task's key copies itself from the header. On a phone the page keeps its own header row only — no shell bar above it. The board's task dialog carries the same identity in its own header — the status glyph tile, the @@ -75,6 +76,28 @@ what is there, and the page shows the one thing you opened. Creating a task reads like the open task: the status tile and a borderless title in the header, the property panel beside the description (Medium priority and today's start preselected), and a footer with **Create another** at the left and the `⌘ Enter` hint beside Cancel and Create. + On the board, **Done** and **Cancelled** fold to a 44px rail (glyph, count, the name standing on + end) that opens on a click and still takes a drop; each board remembers its folded lanes. +- **Avatars** — one `@tale/ui/avatar` everywhere: a person's initials in the tint their name hashes to (the + same colour on a board card, in a task's conversation and in a contact list; filled primary for "you"), an + agent's bot on the soft primary tint, an automation's workflow glyph, a dashed outline for nobody. + `AssigneeAvatar` and `ContactInitials` are thin wrappers over it. +- **A task reads the same everywhere** — the board's dialog and the task's page render one reading + column (`TaskThreadColumn`): the brief as a card, the conversation (comments and history merged, oldest + first, opening on the discussion's newest page and anchored at the newest end) and the chat composer + pinned under it; the dialog adds only its header and the details panel beside it. There is no separate + comment list or Activity list. +- **Conversation entries** — one anatomy for chats and task discussions, built from `@tale/ui/thread/*`: + the viewer's own words as a right-aligned muted bubble (`ThreadMessage variant="own"` — a chat's turns + and a task's comments alike, with the time and actions revealed under it and a chat's ‹ 2/3 › branch + navigator always in view beside them as its `trailing` control); every other + voice — a teammate, an agent, the assistant — as flat prose under an identity row (24px avatar, name, + an **Agent** badge for an agent, clock time; the chat's assistant hides the row), with a message by the + same author minutes later joining the one before it; actions as icon buttons that show on hover, + keyboard focus, an open menu and always on a touch screen. Events are one quiet `text-xs` line in the + avatar gutter with a glyph per kind of change, the change in its own words and casing; three or more + in a row fold into one line ("5 updates") that opens in place. A long body is clamped behind + **Read more** (`ReadMore`), never truncated in the DOM. - **Detail pages** — the header is a breadcrumb trail (`HeaderBreadcrumbs`: semantic `nav > ol`, the leaf is the page's only `h1`). When the entity has siblings, the leaf is the shared `HeaderBreadcrumbSwitcher` (name + chevron opening a titled, searchable list) — projects and @@ -104,6 +127,16 @@ what is there, and the page shows the one thing you opened. "improve with AI" rewrite. Specs: `design-system.md` → _Conversations_. - **Knowledge** — its pages (Documents/Knowledge entries/Websites/Products/Contacts) as a tab strip under the header, each a `DataTable`. Specs: `design-system.md` → _Knowledge_. +- **Automation canvas** — the layout engine places every box, nobody does: **Start** on top (what + starts a run, what it receives), **End** at the bottom (what it returns, how a run ends), each node + below the nodes it reads. A condition is a pill in words above its node, splitting into **Yes** + (left) and **No** (right) when the node has an alternative; a frame means for-each or repeat; a + solid line reads output, a dashed one only orders, a dotted one ends the run; a dashed box may not + run. One Tab stop with arrow keys, a List view as the text alternative, the Paths list to light up + a path. Build it from data with `@tale/ui/flow/workflow-canvas`; never draw a node by hand. Guides: + [`workflow-canvas.md`](../../services/ui-docs/content/components/workflow-canvas.md), + [`workflow-paths.md`](../../services/ui-docs/content/components/workflow-paths.md), + [`workflow-playback.md`](../../services/ui-docs/content/components/workflow-playback.md). - **Auth, settings, automations, agents, onboarding** — each has a `.pen` under `design/sources/platform/`. ## Interaction conventions (hold these everywhere) diff --git a/design/sources/platform/design-system.md b/design/sources/platform/design-system.md index fbc0159217..efbf18a3c3 100644 --- a/design/sources/platform/design-system.md +++ b/design/sources/platform/design-system.md @@ -700,7 +700,11 @@ Used in AI chat responses for section hierarchy within rich text output. **Code body** (`ny4z0`): - Vertical layout, `padding: 16`, `gap: 2`, fill `#F9FAFB` -- Code lines: JetBrains Mono 13px, `#111827`, `lineHeight: 1.6` +- Code lines: JetBrains Mono 13px, `lineHeight: 1.6`, coloured by the `--code-*` palette in + `packages/ui/src/globals.css`: `--code-foreground` for plain text and one `--code-token-*` per + syntax role (keyword, string, template expression, constant, function, parameter, comment, + punctuation). The palette is AA on the code-block surface in both themes, and every read-only + code block and the code editor share it — never colour code with hex values. **Dark mode overrides:** @@ -708,7 +712,7 @@ Used in AI chat responses for section hierarchy within rich text output. - Header bottom border: `#374151` - Language label + copy button: `#9CA3AF` - Code body fill: `#111827` -- Code lines: `#E5E7EB` +- Code lines: the dark values of the same `--code-*` variables **Behavior:** diff --git a/docs/de/develop/api-reference.md b/docs/de/develop/api-reference.md index 67b9a09399..c42beb32a5 100644 --- a/docs/de/develop/api-reference.md +++ b/docs/de/develop/api-reference.md @@ -384,7 +384,7 @@ Eine Projektdatei gehört nicht zu dieser Schnittstelle — sie ergibt **404**, Für durchsuchbaren Text verwendest du `POST /api/v1/knowledge-entries`. Tale erstellt ein dateigestütztes Dokument mit `sourceProvider: knowledge` und startet die Indexierung. Erlaubt sind höchstens 8.000 Zeichen und ein aktiver Eintrag pro Thema. Die Antwort **201** `{id, documentId}` enthält bereits die Dokument-ID; frage damit `GET /api/v1/documents/{documentId}` ab, bis die Indexierung abgeschlossen ist. -Ein `PATCH` ersetzt den aktiven Eintrag durch eine neue Version und indexiert unter derselben `documentId` erneut. Sind `topic` und `content` nach dem Trimmen unverändert, entsteht keine Version; die Antwort nennt die vorhandene Eintrags-ID. Ein `PATCH` auf eine abgelöste Zeile ergibt **409**, `KNOWLEDGE_ENTRY_SUPERSEDED`, und nennt in `data.activeId` die aktive Zeile des Themas (in `data.supersededBy` ihre direkte Nachfolgerin) — ändere diese Zeile, ohne die Kette entlangzuhangeln. Ein Eintrag, der über diese Tür angelegt oder abgelöst wird, trägt `source: "api"` (das Formular der App schreibt `manual`, das Festhalten durch den Assistenten `chat`), sodass die Tabelle der Wissenseinträge die drei auseinanderhält. Ein Löschen verschiebt das zugehörige Dokument in den Papierkorb. +Ein `PATCH` ersetzt den aktiven Eintrag durch eine neue Version und indexiert unter derselben `documentId` erneut. Sind `topic` und `content` nach dem Trimmen unverändert, entsteht keine Version; die Antwort nennt die vorhandene Eintrags-ID. Ein `PATCH` auf eine abgelöste Zeile ergibt **409**, `KNOWLEDGE_ENTRY_SUPERSEDED`, und nennt in `data.activeId` die aktive Zeile des Themas (in `data.supersededBy` ihre direkte Nachfolgerin) — ändere diese Zeile, ohne die Kette entlangzuhangeln. Ein Eintrag, der über diese Tür angelegt oder abgelöst wird, trägt `source: "api"` (das Formular der App schreibt `manual`, das Festhalten durch den Assistenten `chat` und seit Vertrag 3.23.0 ein Agent mit `knowledge_entry_write` `agent`), sodass die Tabelle der Wissenseinträge sie auseinanderhält. Ein Löschen verschiebt das zugehörige Dokument in den Papierkorb. Die Endpunkte für Wissenseinträge benötigen das Schreibrecht für Wissen — ein Mitglied mit Leserechten ergibt **403**, `KNOWLEDGE_ENTRY_FORBIDDEN` —, und ein Objektspeicher, der den Inhalt nicht binnen 30 Sekunden annimmt, ergibt **503**, `KNOWLEDGE_ENTRY_STORE_TIMEOUT`, ohne dass etwas geschrieben wird. Dieses Dokument verweigert ein direktes `DELETE /api/v1/documents/{id}` und ein `PATCH` seines Titels oder Inhalts mit **409**, `DOCUMENT_HAS_KNOWLEDGE_ENTRY` und `data.entryId` — der Eintrag ist der Weg, es zu ändern. `GET /api/v1/knowledge-entries?topic=&status=superseded` listet die abgelösten Versionen eines Themas, jede mit `supersededAt` gestempelt, und `GET /api/v1/knowledge-entries/{id}/versions` antwortet mit der ganzen Kette von jeder ihrer Zeilen aus, die neueste zuerst. @@ -412,6 +412,7 @@ Verzweige nach `indexing.errorCode`, nicht nach dem Wortlaut von `error`. Das Op | --- | --- | | `unsupported`: `unsupported_type`, `image_no_vision`, `empty`, `not_text`, `malformed` | Ersetze die Quelle oder exportiere sie in einem unterstützten Format. Bei `not_text` brauchst du tatsächlichen UTF-8-Text. `malformed` bezeichnet derzeit ein unlesbares PDF; beschädigte Office-Dateien können stattdessen `indexer_error` liefern. Die Retry-Route überspringt dauerhafte Codes auch bei älteren Zeilen mit Status `failed`. | | `failed`: `embedding_upstream`, `indexer_error`, `index_rebuilding` | Der Hintergrundauftrag wiederholt diese Fehler. Prüfe den Status, bevor du selbst erneut anstößt. | +| `failed`: `usage_limit` | Eine Budgetgrenze, die für die Person gilt, für die die Datei indexiert wird — wer sie hochgeladen hat, wem ein synchronisiertes Laufwerk gehört, die Organisation bei einem E-Mail-Anhang —, ist erreicht. Die Indexierung läuft von selbst weiter, spätestens eine Stunde nachdem die Grenze zurückgesetzt oder erhöht wurde, und zwar nach dem bereits Gespeicherten; ein `retry-indexing` vorher wartet erneut. | | `failed`: `embedding_not_configured`, `embedding_provider_refused`, `index_repair_failed` | Lass Anbieter-Konfiguration, Berechtigungen oder Indexzustand vom Betreiber korrigieren und versuche es danach erneut. `embedding_provider_refused` deckt auch ein Modell ab, das Vektoren mit einer anderen Breite liefert, als die Einstellungen angeben, sowie Embedding-Zugangsdaten, die die Plattform nicht verwenden kann (keine konfiguriert, gelöscht, deaktiviert oder nicht lesbar); das Speichern korrigierter Embedding-Einstellungen oder das Anlegen beziehungsweise Reparieren der Zugangsdaten, die das Embedding-Modell verwendet, stellt jedes Dokument, das am Embedding-Modell gescheitert ist, erneut in die Warteschlange. | | `failed`: `secret_detected`, `pii_blocked` | Korrigiere die Quelle oder die freigegebene Inhaltsrichtlinie der Organisation vor dem nächsten Versuch. | | `failed` ohne `errorCode` | Die Plattform hat den Fehler abgeschlossen, ohne ihn einzuordnen, meist weil die Indexierung vor dem Ende abbrach (ein verlorener Auftrag oder ein angehaltener Worker). Warte nicht auf einen automatischen neuen Versuch: Stoße `retry-indexing` an. | @@ -531,12 +532,13 @@ AGENT_ID=$(curl -fsS "$AGENT_URL" \ curl -fsS "$AGENT_URL/$AGENT_ID" \ -H "Authorization: Bearer $TALE_API_KEY" \ -H "X-Organization-Slug: $ORG_SLUG" \ - | jq '.agent | {name, harness, skills, connectors}' + | jq '.agent | {name, handle, harness, skills, connectors}' ``` ```json { "name": "Reviewer", + "handle": "reviewer", "harness": "claude-code", "skills": [], "connectors": [] @@ -553,16 +555,22 @@ Ein Agent mit `managed` gleich `true` ist der [Standard-Agent](/de/platform/proj Ein Projekt fasst höchstens 50 Agenten. Namen müssen innerhalb des Projekts unabhängig von Groß- und Kleinschreibung eindeutig sein und dürfen bis zu 120 Zeichen lang sein; jede Ausstattungsliste erlaubt 25 Einträge, Anweisungen 20.000 Zeichen. Ungültige Konfiguration oder eine überschrittene Grenze ergibt **400**; ein Name, den ein anderer Agent des Projekts schon trägt, ergibt **409**, `PROJECT_AGENT_NAME_TAKEN` — die Klasse, mit der jedes andere Duplikat an dieser Schnittstelle antwortet —, verwende also den bestehenden Agenten, statt es erneut zu versuchen. +Jeder Agent hat außerdem ein `handle`: das, was du nach `@` tippst, um ihn zu erwähnen. Es ist sein aktueller Name in Kleinbuchstaben, Ziffern und einzelnen Bindestrichen, „My Opus Agent #3“ hört also auf `my-opus-agent-3`. Ein Handle ist in seinem Projekt eindeutig: Hat es schon ein anderer Agent, oder hört bereits ein Mitglied oder eine Automatisierung der Organisation darauf, bekommt der Agent das nächste freie, `-02`, dann `-03` und so weiter. Dasselbe geschieht, wenn später ein Mitglied oder eine Automatisierung auf das Handle eines Agenten hört. Benennst du einen Agenten um, bekommt er das Handle seines neuen Namens, außer wenn sich nur Groß- und Kleinschreibung oder Satzzeichen ändern. Willst du einen Agenten später ansprechen, merk dir seine `id`; das Handle folgt dem Namen (Vertrag 3.24.0). + `model` muss ein Modell aus dem Katalog der Organisation sein (nenne `modelProvider`, wenn mehrere Anbieter es bedienen), und `tools` darf nur bekannte Tool-Freigaben nennen — ein falscher Wert ergibt **400** mit `PROJECT_AGENT_MODEL_INVALID`, `PROJECT_AGENT_PROVIDER_UNKNOWN` oder `PROJECT_AGENT_TOOL_UNKNOWN`, das sagt, was zu korrigieren ist, statt eines Agenten, der an seiner ersten Aufgabe scheitert. Mit `task_start_agent` kann der Agent einen anderen Agenten desselben Projekts an einer Aufgabe arbeiten lassen (Vertrag 3.8.0). `secrets` enthält Namen von Organisationsgeheimnissen, niemals deren Werte; ein Name, den die Organisation nicht gespeichert hat, wird mit **400**, `PROJECT_AGENT_SECRET_UNKNOWN`, abgewiesen und in `data.secrets` genannt (der Dialog der App entfernt solche Namen, die API nicht — ein Tippfehler ergibt also nie einen Agenten, der ohne seine Zugangsdaten läuft). `task_update_metadata` ist eine optionale Freigabe für Projekt-Agenten (Vertrag 3.10.0), mit der sie Priorität und Agentenzuweisung bestehender Aufgaben ändern, ohne eine Ausführung zu starten. Die Anfrage nennt `taskId`, `priority` und/oder `agentId` sowie in `expected` den aktuellen Wert jedes betroffenen Felds. `null` hebt einen Wert auf, ausgelassene Felder bleiben unverändert. Bilde `expected.assignee` als `{type, id}` aus `assigneeType` und `assigneeId` der Antwort von `task_get`; ohne Zuweisung verwendest du `null`, ebenso bei fehlender Priorität. Ein veralteter Wert führt zur Ablehnung der gesamten Anfrage. Die [Anleitung zu Projekt-Agenten](/de/platform/projects/project-agents) beschreibt den Schutz laufender Arbeit und ausstehender Prüfungen. `task_upsert_by_external_ref` verwendet `priority` weiterhin nur beim Anlegen einer Aufgabe. `task_delegate_review` ist eine separate, ausdrücklich erteilte Projektagenten-Berechtigung für die Übergabe eines gespeicherten offenen Agentenreviews an einen anderen Agenten. Übergib `{taskId, reviewerAgentId, expected: {approvalId, runId, evidenceRevision, reviewer: {kind: "agent", agentId}}, reason}` mit vollständigen nativen UUIDs und einer nicht leeren Begründung von höchstens 2.000 Zeichen. Unbekannte Felder werden abgelehnt. Erforderlich sind ein aktiver Managerlauf mit projektweiter Befugnis und aktueller Berechtigung, ein geeigneter unabhängiger Empfänger sowie unveränderte Quelle und Belege. Der ausführende Agent der gespeicherten Quelle wird als Manager abgelehnt. Implementierungsverantwortung, Status, künftige Zuordnung und Berechtigungen bleiben gleich; es startet kein Lauf. `task_get.reviewDelegation` liefert den gültigen historischen Übergabebeleg zur neuesten Prüfung; die aktuelle Zuordnung steht in `pendingReview`. Eine identische Wiederholung verlangt denselben weiterhin berechtigten auslösenden Lauf sowie unveränderte offene Folgeprüfung und Belege. Menschliche und Workflow-Prüfungen bleiben geschützt. Siehe [Review-Übergabe](/de/platform/projects/task-automation#delegate-review). +`knowledge_entry_write` ist eine optionale Berechtigung für Projektagenten und Agentenschritte von Automationen (Vertrag 3.23.0). Damit speichert ein Agent einen Fakt als Wissenseintrag der ganzen Organisation, zugeordnet über sein Thema: Übergib `{topic, content, expectedVersionId?}`, mit einem Thema von höchstens 120 Zeichen und einem Inhalt von höchstens 8.000 Zeichen. Ein Thema ohne Eintrag erhält einen neuen. Um einen bestehenden Eintrag zu ändern, braucht es `expectedVersionId`, die Version, die der Agent gelesen hat: die `id`, die `knowledge_entry_find` seit Vertrag 3.23.0 liefert, oder die `versionId` seines letzten Speicherns. Fehlt sie oder wurde diese Version inzwischen ersetzt, wird nichts gespeichert; die Antwort enthält dann die aktuelle Version mit ihrem Text, in den der Agent seine Änderung einarbeitet. Wer den aktuellen Text noch einmal speichert, schreibt nichts. Was ein Agent speichert, trägt `source: "agent"`, nennt den Agenten in `createdBy` und landet als `knowledge_entry.created` oder `knowledge_entry.updated` im Audit-Log. Ein Lauf, den ein Mitglied gestartet hat, das nur an seiner eigenen Aufgabe arbeiten darf, wird abgelehnt (`member_run`). Für das Speichern durch Agenten gilt ein eigenes Limit pro Organisation, getrennt von den Änderungen durch Personen. Die Indexierung läuft asynchron: `knowledge_entry_find` listet einen gespeicherten Eintrag sofort, `rag_search` erst, sobald er indexiert ist. + `task_review` ergänzt mit Vertrag 3.11.0 eine optionale Freigabe für Projektagenten. Sie entscheidet nur ein ausstehendes natives Review, das dem aktiven Reviewer-Agenten zugewiesen ist, über einen abgeschlossenen Lauf eines anderen Agenten desselben Projekts. Übergib `taskId`, `expected: {approvalId, runId, evidenceRevision}` aus dem aktuellen `task_get.pendingReview`, `decision: "approve" | "request_changes"`, eine nicht leere `feedback`-Rückmeldung und `evidence: {checks, pullRequests}`. Jede Prüfung nennt ihr Ergebnis (`passed` oder `failed`) und Details; ein mitgegebener Pull Request auf GitHub nennt URL, exakten `headSha` und Prüfstatus. Für eine Freigabe müssen alle angegebenen Prüfungen bestanden sein. Die GitHub-Belege stammen vom Agenten; Tale verifiziert sie nicht beim externen Dienst. Das Tool prüft die aktuelle Freigabe, die Rechte des aktiven aufrufenden Laufs, den gespeicherten Reviewer, den Umsetzungslauf und die lokale Belegrevision erneut. Ein veraltetes Ergebnis muss neu gelesen werden; eine andere aktuelle Aufgabenzuweisung macht den Reviewer nicht unabhängig. Die Freigabe verschiebt die Aufgabe nach `done`, `request_changes` mit Rückmeldung nach `todo`, ohne einen Lauf zu starten, auch bei einer Erwähnung in der Rückmeldung. Menschliche Kompetenzanforderungen und Workflow-Genehmigungen bleiben außerhalb dieses Tools. Für eine Agentenentscheidung gibt es keinen öffentlichen REST-Endpunkt. +Seit Vertrag 3.25.0 wird ein Agent, der an anderen Aufgaben arbeitet, trotzdem gestartet: Jeder seiner Läufe arbeitet in einem eigenen Agenten-Worker. Das native `task_start_agent` und der Automatisierungsschritt `task.start_agent` antworten nicht mehr mit `agent_busy` oder `busyTaskId`. Ein Start antwortet mit `started: true`, und ein Lauf, der auf einen freien Worker wartet, trägt `waitingReason`: `org_limit` (alle Agenten-Worker der Organisation sind belegt), `host` (der Sandbox-Host ist voll), `destroy_pending` (der Workspace, den er nutzen würde, wird gerade gelöscht) oder `exec_limit` (seine Sandbox beendet noch einen früheren Prozess). Ein solcher Lauf startet von selbst; starte ihn nicht noch einmal. Ein Agent, der sich selbst für eine andere Aufgabe nennt, wird mit `self_start` abgelehnt. Das native `task_get.agentRuns` trägt `waitingReason`, solange ein Lauf wartet. Keine REST-Operation ändert sich. + Seit Vertrag 3.15.0 enthält das native `task_get.agentRuns` einen expliziten booleschen Wert `retryPending`. Nur beim neuesten fehlgeschlagenen Lauf eines noch vorhandenen Agenten kann er `true` sein. Dabei gelten dieselben Prüfungen auf vorgemerkte oder endgültig abgelehnte Wiederholungen und das verbleibende Versuchskontingent wie auf der Aufgabenkarte. Lass diese Wiederholung bestehen. `false` erlaubt keinen Neustart und nennt keinen Rücksetzzeitpunkt des Anbieters; fehlt das Feld auf einer älteren Plattform, ist der Zustand unbekannt. Gleiche vor jeder Aktion Aufgabe, Zuständigkeit, Läufe und Prüfung neu ab und beachte Wartezeiten des Anbieters sowie `retryAfter` einer Startablehnung. Es kommen weder ein öffentlicher REST-Endpunkt noch rohe Fehlertexte hinzu. Vertrag 3.13.0 ergänzt die bestehende native Berechtigung `task_start_agent` um einen abgesicherten Überarbeitungsstart: Übergib `{taskId, resumeFrom: {kind: "review_repair", approvalId, runId}, feedback?}` für eine gespeicherte native Entscheidung `request_changes`. Der Server ermittelt Umsetzungsagent, Rückmeldung und Kommentar-ID. Er prüft atomar denselben neuesten abgeschlossenen Umsetzungslauf, die unveränderte Zuständigkeit, `todo`, das Fehlen neuerer Prüfungen oder zwischenzeitlicher Status-, Zuständigkeits- oder Archivierungsentscheidungen sowie die bestehenden Startgrenzen. Eine explizite `agentId` muss dem Umsetzungslauf entsprechen; `moveToInProgress: false` wird abgelehnt. Die Form `{approvalId, runId}` ohne `kind` behält ihre getrennte Bedeutung für offene Fragen. `stale_repair` startet nichts; versuche es nicht ohne diese Absicherung erneut. @@ -593,7 +601,9 @@ Antworten tragen immer den echten Namen (`"name": "billing/dunning"`); die `__`- ### Die tatsächlich ausgeführte Version lesen -`GET /api/v1/automations` listet jede Automatisierung mit `latestVersion`, `deployedVersion` und `projectIds` — den Projekten, in denen sie installiert ist und die die Lauf-Routen unten verlangen — plus dem, was ein Starter ohne zweiten Aufruf braucht: ihre `description`, das `inputs`-Schema, zu dem ein Lauf passen muss (das der deployten Version, sonst das der neuesten gespeicherten), und ihren `trigger` — Art, Schalter und Gesundheit: `lastFiredAt`, `lastSkippedAt` und `lastSkipReason`, dieselben Stempel, die `GET .../triggers` liest, ein einziger Listenaufruf findet also jede Bindung, die eingeschaltet ist und nicht feuert — oder `null`, wenn keine gebunden ist. +`GET /api/v1/automations` listet jede Automatisierung mit `latestVersion`, `deployedVersion` und `projectIds` — den Projekten, in denen sie installiert ist und die die Lauf-Routen unten verlangen — plus dem, was ein Starter ohne zweiten Aufruf braucht: ihre `description`, das `inputs`-Schema, zu dem ein Lauf passen muss (das der deployten Version, sonst das der neuesten gespeicherten), und ihren `trigger` — Art, Schalter, `nextRunAt` und Gesundheit: `lastFiredAt`, `lastSkippedAt` und `lastSkipReason`, dieselben Stempel, die `GET .../triggers` liest, ein einziger Listenaufruf findet also jede Bindung, die eingeschaltet ist und nicht feuert — oder `null`, wenn keine gebunden ist. + +Eine Automatisierung, die nur in Projekten installiert ist, die der Schlüsselinhaber nicht lesen darf, fehlt in der Liste, und `GET /api/v1/automations/{name}`, ihre Versionen und ihre Trigger antworten für sie mit **404** `AUTOMATION_NOT_FOUND` wie bei einer, die es nicht gibt; eine Automatisierung ohne Installation gehört der ganzen Organisation. `GET /api/v1/automations/{name}` antwortet standardmäßig mit der neuesten gespeicherten Version (`?version=latest` schreibt den Standard aus), und die kann ein Entwurf sein; ein Live-Lauf führt die deployte aus, lies den Vertrag des Codes, der wirklich läuft, also mit `?version=deployed` (eine Zahl benennt jede gespeicherte Version). Eine Version, die die Automatisierung nicht hat, ergibt **404** `AUTOMATION_VERSION_UNKNOWN` — `?version=deployed` ohne deployte Version ebenso —, während eine unbekannte Automatisierung `AUTOMATION_NOT_FOUND` ergibt. @@ -616,9 +626,33 @@ curl -sS --compressed -X PUT "https://your-host.example.com/api/v1/automations/b ### Triggertyp auswählen -`kind` ist `schedule` (mit einem fünfteiligen `cron` und einer optionalen IANA-`timezone`), `webhook` (die Antwort trägt das `token` der URL genau einmal — die [Webhooks-Seite](/de/develop/webhooks) behandelt diesen Zugang) oder `event`. Einen Trigger, der nie feuern könnte, weist Tale mit **400** `AUTOMATION_TRIGGER_INVALID` und einem Satz ab, der die Korrektur nennt: ein Cron-Ausdruck, der auf nichts passt (auch ein Tag, den kein benannter Monat hat, `0 0 30 2 *`), eine Zeitzone, die keine IANA-Zone ist, ein Event, das die Plattform nicht auslöst. +`kind` ist `schedule`, `webhook` (die Antwort trägt das `token` der URL genau einmal — die [Webhooks-Seite](/de/develop/webhooks) behandelt diesen Zugang) oder `event`. Ein Zeitplan läuft nach einer Wiederholungsregel oder nach einem Cron-Ausdruck, nie nach beiden (Vertrag 3.24.0): + +- `repeat` ist eine `ScheduleRule`, die Regel, die auch die Zeitplan-Auswahl der App schreibt. Eine Regel mit `daily`, `weekly`, `monthly` oder `yearly` läuft zu ein bis zwölf Ortszeiten in `times`, geschrieben als `HH:MM`; eine Regel mit `minutely` oder `hourly` startet alle paar Minuten oder Stunden, bei `hourly` zur Minute `minute` nach der vollen Stunde, auf Wunsch nur an bestimmten Wochentagen und zwischen zwei Uhrzeiten (`window`). Sie braucht eine `timezone`. `startDate`, ein Tag `YYYY-MM-DD` in dieser Zone, ist der erste Tag, an dem sie laufen darf, und der Tag, ab dem „alle 2 Wochen“ zählt; fehlt es, gilt heute — sende also das `startDate` zurück, das `GET .../triggers` liest, damit eine Regel im Takt bleibt. +- `cron` ist ein fünfteiliger Ausdruck, gelesen in `timezone`, ohne Zone in UTC. -Jede Art nimmt ihre eigenen Schlüssel — `cron` und `timezone` nur mit `schedule`, `event` nur mit `event`, `rotateToken` nur mit `webhook` —, und ein Schlüssel, der zu einer anderen Art gehört, wird als unbekannter Schlüssel abgewiesen (**400** `INVALID_BODY`, unter `data.issues` beim Namen genannt), ein Webhook-Trigger kann sich also nie als einer zurücklesen, der auch nach Zeitplan läuft. Ein Event-Trigger bindet eines der Events, die die Plattform heute auslöst, und die Eingabe des Laufs ist `{ "trigger": "event", "event": "", "payload": }`: +```json +{ + "kind": "schedule", + "repeat": { + "frequency": "weekly", + "interval": 1, + "weekdays": [1, 2, 3, 4, 5], + "times": ["09:00", "17:30"] + }, + "timezone": "Europe/Zurich", + "catchUp": "latest", + "input": { "region": "emea" } +} +``` + +Wochentage zählen ab 0 für Sonntag. Eine Ortszeit, die die Uhr überspringt, startet einmal, um die Lücke verschoben, und eine, die sie wiederholt, einmal, beim ersten Vorkommen; eine Regel mit `minutely` oder `hourly` behält dagegen ihren echten Abstand, ebenso ein Cron-Ausdruck, dessen Minute oder Stunde mit `*` beginnt. `catchUp` bestimmt, was ein Zeitplan mit Terminen macht, die er verpasst hat, während die Plattform nicht lief: `latest`, der Standard, startet den letzten einmal, egal wie spät; `skip` startet ihn nur, wenn er höchstens zehn Minuten zu spät ist. In beiden Fällen werden die übrigen gezählt, nicht nachgeholt. + +Jede Art nimmt außerdem `enabled` (fehlt es, gilt `true`) und `input`, eine feste Eingabe: ein JSON-Objekt mit höchstens 16 KiB, das jeder Lauf des Triggers erhält, wobei die eigenen Felder `trigger`, `firedAt`, `event` und `payload` darüber gesetzt werden — es darf sie nicht nennen. Es sind reine Daten; eine Vorlage darin kommt als Text an. Der `PUT` ersetzt den ganzen Trigger, ein weggelassenes Feld wird also zurückgesetzt. + +Einen Trigger, der eine Regel verletzt oder nie feuern könnte, weist Tale mit **400** `AUTOMATION_TRIGGER_INVALID` ab, jedes Problem unter `data.issues` als `{ "path", "code", "message" }`: weder `repeat` noch `cron` oder beide (`schedule.cron_or_repeat`); ein Cron-Ausdruck, der auf nichts passt, auch ein Tag, den kein benannter Monat hat (`0 0 30 2 *`); eine Uhrzeit, die nicht `HH:MM` lautet, mehr als zwölf Uhrzeiten, ein Intervall, das die Regel nicht anbietet, ein Tag, den der Monat nie hat, oder ein Zeitfenster, in das nie ein Start fällt; eine leere Zeitzone oder eine, die keine IANA-Zone ist; eine feste Eingabe, die kein Objekt ist, eines der eigenen Felder des Triggers nennt oder größer als 16 KiB ist; ein Event, das die Plattform nicht auslöst. + +Jede Art nimmt ihre eigenen Schlüssel — `cron`, `repeat`, `startDate`, `timezone` und `catchUp` nur mit `schedule`, `event` nur mit `event`, `rotateToken` nur mit `webhook`, `enabled` und `input` mit jeder —, und ein Schlüssel, der zu einer anderen Art gehört, wird als unbekannter Schlüssel abgewiesen (**400** `INVALID_BODY`, unter `data.issues` beim Namen genannt), ein Webhook-Trigger kann sich also nie als einer zurücklesen, der auch nach Zeitplan läuft. Ein Event-Trigger bindet eines der Events, die die Plattform heute auslöst, und die Eingabe des Laufs ist `{ "trigger": "event", "event": "", "payload": }` neben einer etwaigen festen Eingabe: | Event | Ausgelöst, wenn | | ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -631,15 +665,17 @@ Jede Art nimmt ihre eigenen Schlüssel — `cron` und `timezone` nur mit `schedu | `comment.created` | ein Kommentar auf einer Aufgabe landet | | `comment.mentioned` | ein Aufgabenkommentar jemanden mit `@` erwähnt | +Das `comment` eines Kommentar-Events enthält `body` so, wie es gespeichert ist, mit jeder Erwähnung als Erwähnungslink, und `bodyText`, denselben Text mit jeder Erwähnung als `@` und dem aktuellen Namen. Vergleiche Wörter wie einen Namen mit `bodyText` (Vertrag 3.24.0). + ### Triggerzustand prüfen und gezielt pausieren -`GET .../triggers` liest die Bindung zurück — als `triggers`, eine Liste mit höchstens einem Eintrag, der eine Plural in dieser Familie — samt ihrer Gesundheit: `lastFiredAt` ist der letzte Zeitpunkt, zu dem diese Bindung **einen Lauf gestartet** hat — `lastRunId` nennt ihn, und beide bleiben `null`, bis es so weit war —, während `lastSkippedAt` und `lastSkipReason` das letzte Mal festhalten, dass sie fällig war und nichts gestartet hat: `not_deployed` (nichts ist live — deploy eine Version), `unusable_cron` (der Ausdruck oder die Zone ließ sich nicht lesen; der Scheduler lässt die Bindung in Ruhe, bis sie bearbeitet wird), `start_refused` (das `inputs`-Schema der Live-Version hat die Eingabe des Laufs abgelehnt) oder `paused_after_failures` (ein Zeitplan, der sich nach wiederholten Fehlern selbst ausgeschaltet hat — siehe unten). Eine Webhook-Zustellung, die das `inputs`-Schema der Live-Version ablehnt, ist ein anderer Fall: Der Absender erhält **400** `AUTOMATION_INPUT_INVALID`, nichts startet, und keiner dieser Stempel bewegt sich — die Bindung war nicht fällig, ein Webhook, dessen jede Zustellung abgelehnt wird, liest sich also wie einer, der nie aufgerufen wurde. Prüfe Zustellungen auf der Absenderseite. +`GET .../triggers` liest die Bindung zurück — als `triggers`, eine Liste mit höchstens einem Eintrag, der eine Plural in dieser Familie — samt dem, womit sie gespeichert wurde (`repeat` und `startDate` oder `cron`, `timezone`, `catchUp`, `input`), ihrem nächsten Start (`nextRunAt`, `null`, solange sie ausgeschaltet ist, und bei einem Webhook oder Event) und ihrer Gesundheit: `lastFiredAt` ist der letzte Zeitpunkt, zu dem diese Bindung **einen Lauf gestartet** hat — `lastRunId` nennt ihn, und beide bleiben `null`, bis es so weit war —, während `lastSkippedAt` und `lastSkipReason` das letzte Mal festhalten, dass sie fällig war oder ein Event eintraf und nichts gestartet hat: `not_deployed` (nichts ist live — deploy eine Version), `unusable_cron` (der Zeitplan oder seine Zone ließ sich nicht lesen; der Scheduler lässt die Bindung in Ruhe, bis sie bearbeitet wird), `start_refused` (der Start wurde abgelehnt — das `inputs`-Schema der Live-Version hat die Eingabe des Laufs abgelehnt, oder das Projekt des Laufs konnte ihn nicht annehmen, etwa ein archiviertes Projekt bei einem Event; `lastSkipDetail.code` sagt, was davon), `missed_occurrences` (Termine waren fällig, während die Plattform nicht lief, wie `catchUp` es beschreibt) oder `paused_after_failures` (ein Zeitplan, der sich nach wiederholten Fehlern selbst ausgeschaltet hat — siehe unten). `lastSkipDetail` hält die Fakten hinter dem Grund fest: den betroffenen Termin (`occurrence`), den `code` einer Ablehnung, die `version`, die abgelehnt hat, ihre `message` und `issues`, und `missed` — `count` (bis 1.000, darüber `capped`), `firstAt`, `lastAt` und die `policy` —, wenn Termine verpasst wurden. Eine Pause nach Fehlern hat kein Detail; ihre Fakten sind die Fehlerfelder unten. Eine Webhook-Zustellung, die das `inputs`-Schema der Live-Version ablehnt, ist ein anderer Fall: Der Absender erhält **400** `AUTOMATION_INPUT_INVALID`, nichts startet, und keiner dieser Stempel bewegt sich — die Bindung war nicht fällig, ein Webhook, dessen jede Zustellung abgelehnt wird, liest sich also wie einer, der nie aufgerufen wurde. Prüfe Zustellungen auf der Absenderseite. Eine Bindung lebt, wenn `lastFiredAt` mit ihrem Takt Schritt hält; eine, deren `lastSkippedAt` der neuere Stempel ist, wird fällig und läuft nicht, und der Grund sagt, was zu korrigieren ist. Ein Umbinden auf eine andere Art setzt jeden Stempel neu. `enabled: false` pausiert einen Trigger, ohne ihn zu verlieren; `DELETE .../triggers` entfernt ihn — und bei einem Webhook widerruft es die URL. Dasselbe tut das Binden einer anderen Art über einen lebenden Webhook: Der `PUT` antwortet weiterhin **200**, mit `"revoked": "webhook"` neben dem Namen, und die alte URL ist endgültig weg — ein späteres Webhook-Binden erzeugt ein anderes Token. Ein Zeitplan, dessen Läufe immer wieder scheitern, pausiert sich selbst. `consecutiveFailures` zählt die Läufe dieser Bindung, die nacheinander mit einem `failureCode` gescheitert sind, den auch der nächste Termin wiederholen würde — `node_error`, `connector_error`, `llm_output_invalid`, `auth_error`, `missing_api_key`, `credit_exhausted` oder `model_not_found` —, und `lastFailedAt`, `lastFailureCode` und `lastFailedRunId` nennen den letzten davon. Ein Erfolg setzt die Zählung auf `0` zurück; jeder andere Fehler zählt nicht und setzt auch nichts zurück. Hat sich ein Zeitplan selbst pausiert (`enabled: false` mit `lastSkipReason: "paused_after_failures"`), behält er die Zählung, die zur Pause geführt hat, auch wenn ein Lauf, der bei der Pause noch lief, danach erfolgreich endet; nur ein `PUT` setzt die Zählung zurück. Erreicht die Zählung eines Zeitplans fünf, setzt die Plattform `enabled: false` und `lastSkipReason: "paused_after_failures"`, schreibt eine Audit-Zeile `automation.trigger.paused` und benachrichtigt die Inhaber und Admins der Organisation. Behebe den Fehler in der Automatisierung und sende dann einen `PUT` des Triggers mit `enabled: true`. Jeder `PUT` setzt die Zählung zurück und löscht diesen Grund; ein `PUT` ohne `enabled` schaltet den Trigger wieder ein, weil `enabled` standardmäßig `true` ist. Webhook- und Ereignis-Bindungen zählen weiter, werden aber nie pausiert (Vertrag 3.1.0). -Der `PUT` antwortet außerdem mit `deployed`: Binden vor dem Deployen ist erlaubt, und ein Trigger, der an eine Automatisierung ohne deployte Version gebunden ist, startet nichts — jeder Termin wird als `not_deployed` übersprungen, was der `trigger` der Zeile in `GET /api/v1/automations` zeigt —, bis eine Version deployt ist. +Der `PUT` antwortet außerdem mit `deployed`: Binden vor dem Deployen ist erlaubt, und ein Trigger, der an eine Automatisierung ohne deployte Version gebunden ist, startet nichts — jeder Termin wird als `not_deployed` übersprungen, was der `trigger` der Zeile in `GET /api/v1/automations` zeigt —, bis eine Version deployt ist. Bei einem Zeitplan enthält die Antwort zusätzlich `nextRunAt`. Ist eine Version deployt, enthält sie `warnings` dazu, was diese Version mit der Eingabe des Triggers anfangen würde; gespeichert wird der Trigger in jedem Fall. `TRIGGER_INPUT_MISMATCH` heißt, dass ihr `inputs`-Schema ablehnt, was der Trigger einem Lauf übergibt, und nennt die fehlenden Pflichtfelder unter `params.missing` (der Inhalt eines Webhooks wird nicht beurteilt); `TRIGGER_INPUT_NOT_TEMPLATED` heißt, dass die feste Eingabe eine Vorlage enthält, die als Text ankommt. ## Einen Lauf starten, dann pollen @@ -699,6 +735,42 @@ Listen antworten mit Zusammenfassungen — Identität, Geltungsbereich, Status u `GET /api/v1/runs` ist die Sicht quer über alles: jeder Lauf, den der Schlüsselbesitzer sehen darf, Organisationsläufe wie Läufe sichtbarer Projekte, jede Zeile mit ihrer `projectId`. Eine Automatisierung ohne Bindungen kannst du mit `POST /api/v1/automations/{name}/runs` ohne Projekt starten; eine gebundene Automatisierung ergibt dort **409**. `GET /api/v1/automations/{name}/runs` und `/api/v1/runs/{runId}` zeigen ausschließlich Läufe ohne Projekt. Zum Lesen, Abbrechen und Löschen eines Projektlaufs brauchst du dessen Projekt-URL. `DELETE /api/v1/projects/{id}/runs/{runId}` (oder `/api/v1/runs/{runId}`) entfernt einen beendeten Lauf — samt gespeicherter Eingabe und Ausgabe — unter der Entwickler-Fähigkeit; ein Lauf, der noch in Arbeit ist, ergibt **409** `RUN_ACTIVE`, brich ihn also zuerst ab. +### Einen Lauf Schritt für Schritt lesen + +`GET /api/v1/runs/{runId}/record` (oder die Projektform) liefert die Aufzeichnung des Laufs: jeden Schritt in der Reihenfolge, in der er läuft – die Eingabe des Laufs als `__start`, die Schritte der Version, die Dokumentausgabe als `__end` – mit Status, Zeiten und Versuchen, den Entscheidungen, die ihn laufen ließen oder übersprangen (jede Bedingung erklärt mit den Werten, die sie gelesen hat), warum er keine Ausgabe lieferte, bis zur Ursache zurückverfolgt, warum er fehlschlug (ein `reason` aus einer festen Liste, mit den `params`, mit denen er formuliert ist), und Einblicken in das, was er erhielt und zurückgab. Die Werte selbst bleiben außerhalb der Aufzeichnung: Lies einen Schritt ganz unter `…/record/node?node=` und füge `item` oder `pass` für eines seiner Elemente oder einen seiner Durchläufe hinzu. `…/record/items?node=` blättert durch die Elemente und Durchläufe eines Schritts; `status=failed` behält die fehlgeschlagenen. `…/compare/{otherRunId}` vergleicht zwei Läufe derselben Automatisierung Schritt für Schritt und nennt den ersten Schritt, an dem sie auseinandergingen; Läufe verschiedener Automatisierungen liefern **400** `RUN_COMPARE_MISMATCH`. Jedes Lesen braucht denselben Zugriff wie das Lesen des Laufs, und Geheimnisse bleiben überall zurückgehalten. + +Um einen Lauf zu verfolgen, während er arbeitet, gib den `cursor` der Aufzeichnung als `since` zurück: Die Antwort enthält dann nur die seither geschriebenen Schritte und die seitherigen Ereignisse – führe Schritte nach `path` und Ereignisse nach `id` zusammen. Eine Aufzeichnung bleibt unter 512 KiB und ein Schritt unter 256 KiB; `truncated` sagt, was weggelassen wurde, damit sie passt. Diese Lesezugriffe brauchen API-Vertrag 3.29.0. + +```bash +curl -sS --compressed "https://your-host.example.com/api/v1/runs//record" \ + -H "Authorization: Bearer $TALE_API_KEY" \ + -H "X-Organization-Slug: " +# → 200 { "format": 1, "nodes": [{ "path": "__start", "status": "succeeded", … }, +# { "path": "triage", "status": "skipped", "skip": { "reason": "when", … }, +# "decisions": [{ "kind": "when", "result": false, "explanation": [ … ] }] }, …], +# "cursor": 1758210000000 } +``` + +### Einen Lauf erneut ausführen + +`POST /api/v1/runs/{runId}/replay` (oder die Projektform) startet einen neuen Lauf derselben Automatisierung im eigenen Geltungsbereich des Laufs: mit der Eingabe des Laufs (`"kind": "again"`), mit einer `input`, die du sendest (`"edited"`), oder ab einem Schritt (`"from"` mit `from`). Ein erneuter Lauf ab einem Schritt verwendet die Schritte wieder, die der Lauf außerhalb dieses Schritts und dessen, was er speist, beendet hat – ihre Ergebnisse und ihre Aufzeichnung, nie ihre Wirkungen – und führt den Rest aus; `replayOf` des neuen Laufs nennt den Lauf, den er wiederholt. `version` wählt die Version (standardmäßig `same`, oder `deployed`, `latest`, eine Nummer) und `mode` den Modus (standardmäßig der des Laufs). Ein Live-Lauf braucht die Entwicklerberechtigung und die bereitgestellte Version, und ein erneuter Lauf ab einem Schritt eines Mock-Laufs bleibt Mock (**409** `REPLAY_MODE_MISMATCH`). + +Ein Schritt, der schreibt, läuft erneut und schreibt erneut, unter einem neuen Anfrageschlüssel – Dienste, die wiederholte Anfragen ignorieren, sehen darin also keine Wiederholung. Plane zuerst: `GET …/replay` mit derselben Anfrage in der Query liefert, was wiederverwendet wird, was erneut läuft, was jeder Schritt außerhalb von Tale tut, und `writesAgain`, die Schreibvorgänge, die ein zweites Mal hinausgehen – oder die `refusal`, auf die er treffen würde: Der Lauf ist nicht beendet (`REPLAY_RUN_NOT_FINISHED`), die auszuführende Version hat geändert, was ein wiederverwendeter Schritt berechnet (`REPLAY_GRAPH_CHANGED`, mit den Schritten), es gibt keinen solchen Schritt (`REPLAY_NODE_UNKNOWN`), oder der Lauf hat keine Eingabe behalten (`REPLAY_INPUT_UNAVAILABLE`). Sende `Idempotency-Key`, damit ein erneuter Versuch sicher ist. Diese Endpunkte brauchen API-Vertrag 3.29.0. + +```bash +curl -sS --compressed "https://your-host.example.com/api/v1/runs//replay?kind=from&from=send" \ + -H "Authorization: Bearer $TALE_API_KEY" \ + -H "X-Organization-Slug: " +# → 200 { "reuse": [{ "nodeId": "fetch", "status": "ok" }], "rerun": [{ "nodeId": "send", "effect": "write", … }], +# "writesAgain": 1, … } +curl -sS --compressed -X POST "https://your-host.example.com/api/v1/runs//replay" \ + -H "Authorization: Bearer $TALE_API_KEY" \ + -H "X-Organization-Slug: " \ + -H "Content-Type: application/json" -H "Idempotency-Key: fix-4711" \ + -d '{ "kind": "from", "from": "send" }' +# → 202 { "runId": "...", "version": 3, "mode": "live", "kind": "from", "reused": 1 } +``` + ## Für ein Mitglied handeln: Frage eines Laufs beantworten, Prüfung einer Aufgabe entscheiden Ein Lauf mit `waitingFor: "ask"` wartet auf eine Person; eine Aufgabe in `in_review` kann auf eine Person oder einen benannten Agenten warten. Diese beiden REST-Endpunkte reichen die Handlung einer Person aus einer anderen Anwendung weiter und nennen sie als `actor`. Tale hält die Person fest, nicht den Schlüssel. Beide Endpunkte brauchen API-Vertrag 1.16.0; Vertrag 3.11.0 ergänzt die ausdrückliche Ablehnung einer menschlichen Freigabe, solange das Review einem Agenten gehört. @@ -994,6 +1066,7 @@ Jeder Treffer enthält die Passage und ihre `source`. `diagnostics.cached` und ` | **409** `EMBEDDING_CREDIT_EXHAUSTED` | Guthaben, Ausgabenlimit und Tarif des Anbieterkontos prüfen. | | **409** `EMBEDDING_CREDENTIAL_REJECTED` | Zugangsdaten und Berechtigung für das Modell korrigieren. Denselben Code liefert die Suche, wenn die Plattform gar keine nutzbaren Zugangsdaten senden kann: Der Anbieter hat keinen Standard, oder die in den Embedding-Einstellungen genannten wurden gelöscht, deaktiviert oder sind nicht lesbar; `error` nennt den Grund. | | **503** `EMBEDDING_UPSTREAM_ERROR` | `Retry-After` beachten und mit wachsender Wartezeit erneut versuchen. | +| **429** `BUDGET_EXCEEDED` | Das Embedding der Suchanfrage ist eine Modellanfrage, die die Schlüsselinhaberin oder der Schlüsselinhaber bezahlt. Eine Budgetgrenze der Person, eines ihrer Teams, des durchsuchten Projekts, der Organisation oder des Schlüssels ist erreicht; es wird nichts gesucht. `data` nennt die Grenze, `Retry-After` die Wartezeit, bis ihr Zeitraum zurückgesetzt wird. | Die beiden Kontofehler sind keine Rate-Limits; Warten allein behebt sie nicht. Für sichtbare Dokumente der Wissensdatenbank und von Teams ohne Projektzuordnung sowie registrierte Websites verwendest du `POST /api/v1/knowledge/search`. Dort erlaubt `corpus` `"documents"`, `"web"` und den Standard `"all"`. Projektdateien und E-Mail-Anhänge sind ausgeschlossen. Beide Suchen finden nur dateigestützte Dokumente; Inline-`content` wird nicht indexiert. @@ -1348,6 +1421,8 @@ Eine gelesene Aufgabe enthält auch ihre Termine; über diese API lassen sie sic Beim Schreiben eines Kommentars wird `body` außen von Leerraum bereinigt und muss danach 1 bis 10.000 UTF-16-Codeeinheiten enthalten; die meisten Emojis zählen doppelt. Neben diesem ursprünglichen `body` kannst du optional `bodyByLocale` mitsenden. Beim Lesen wird es zurückgegeben, sofern vorhanden. Liefere inhaltlich gleichwertige, nicht leere Übersetzungen für `en`, `de` und `fr`; weitere Sprach- oder Sprachregionsschlüssel wie `nl`, `it` und `de-CH` sind erlaubt. Jeder Wert wird ebenso bereinigt und begrenzt; pro Kommentar sind bis zu 16 Sprachvarianten erlaubt. Zeige zuerst die genaue Spracheinstellung des Lesers, danach die Grundsprache, dann `en` und zuletzt `body` an. Als Autor bleibt der Schlüsselinhaber eingetragen. Eine reine Textbearbeitung in Tale entfernt die alten Übersetzungen, damit sie die Änderung nicht verdecken. +Eine Erwähnung wird als Markdown-Link gespeichert, der nennt, wen sie erwähnt: `[@Ada Lovelace](mention:user/)`, oder `agent/` mit der ID eines Projektagenten, oder `automation/` mit dem Speichernamen einer Automatisierung. Schickst du `@` mit dem `handle` eines Agenten, dem E-Mail-Namen eines Mitglieds, dem Speichernamen einer Automatisierung oder einer ID, speichert Tale diesen Link, und die Erwähnung bleibt auch nach einer Umbenennung gültig. Text von vor Vertrag 3.24.0 nennt weiterhin die Agenten, die er genannt hat: Ein Agent hört weiter auf seinen damaligen Namen in Kleinbuchstaben, mit Punkten statt Leerzeichen oder ohne Leerzeichen. In eckigen Klammern steht der Name beim Speichern des Kommentars; `bodyText` liefert den Kommentar mit jeder Erwähnung als `@` und dem aktuellen Namen. Vergleiche Wörter also mit `bodyText` und zeige `body` an. Erwähnst du jemanden, der die Aufgabe nicht öffnen kann, einen Agenten aus einem anderen Projekt oder jemanden außerhalb der Organisation, wird die Erwähnung als reiner Text gespeichert und benachrichtigt niemanden; in Code ist eine Erwähnung reiner Text. Aufgaben liefern `description` in derselben gespeicherten Form und daneben `descriptionText`. Der Intake speichert die Erwähnungen einer Beschreibung genauso und benachrichtigt niemanden; eine Aufgabe mit `externalSystem` `github` oder `glitchtip` behält die `@`-Namen dieses Trackers so, wie sie geschrieben sind (Vertrag 3.24.0). + Aufgaben- und Workflow-Agenten erhalten die Anweisung, die Sprache aus Titel und Beschreibung der Aufgabe beizubehalten. Ist keine erkennbar, gilt die Standardsprache der Organisation für Agenten. Vorgegebene Wörter einer Titelvorlage, Quartalskennungen, die Sprache der Quelldokumente und die Oberflächensprache der startenden Person legen die Aufgabensprache nicht fest. Das gilt auch für Rückfragen, fortgesetzte Läufe und neue zugehörige Aufgaben. Dies sind Anweisungen an das Modell; gespeicherte Übersetzungen von Fortschrittsmeldungen erlauben Clients, die angezeigte Sprache unabhängig davon zu wählen. Lies die Lauf-Ausgabe und die Kommentare, um die Ergebnisse der Automatisierung abzurufen. Ob sie zusätzlich Dateien erstellt und in welchem Ordner diese liegen, bestimmt der Workflow; aus dem Aufgabenstart allein folgt keine Ablage im Beispielordner. @@ -1422,7 +1497,7 @@ Die Prüfung weist fehlende Pflichtwerte, falsche Typen, unbekannte Schlüssel, | **408** | die Anfrage ist nicht binnen 15 Minuten vollständig angekommen, Kopfzeilen und Body zusammen (`REQUEST_TIMEOUT`); der Umschlag trägt eine frische `requestId` (die abgebrochene Anfrage hat nie eine eigene bekommen), und die Verbindung wird geschlossen — wiederhole über eine schnellere Leitung oder in kleineren Stücken. | | **431** | die Anfrage-Kopfzeilen insgesamt übersteigen das 64-KiB-Budget des Edge; unter HTTP/1.1 kommt die Antwort ohne Umschlag und ohne `X-Request-Id`, weil der Parser des Edge sie schreibt, bevor irgendeine Route läuft (und erst nach ein paar KiB Spielraum — eine URL oder Kopfzeile knapp über dem Budget erreicht die Plattform noch und wird nach deren Regeln beurteilt, eine 66-KiB-URL antwortet **414**), unter HTTP/2, wo das Budget exakt gilt, wird die Verbindung geschlossen. | | **500** | interner Fehler (`INTERNAL_ERROR`); der Umschlag trägt eine `requestId`, die du beim Melden nennst. | -| **503** | eine Abhängigkeit, die die Anfrage brauchte, ist nicht erreichbar: die Datenbank der Plattform, etwa während eines Neustarts (`DATABASE_UNAVAILABLE`, mit `Retry-After` und einer `requestId` — bei jeder Operation und beim Webhook-Trigger, auch bei der Schlüsselprüfung, sodass ein gültiger Schlüssel in dieser Zeit nie mit **401** abgelehnt wird), der Embedding-Anbieter (`EMBEDDING_UPSTREAM_ERROR`, mit `Retry-After`), der Objektspeicher hinter einem Datei-Download (`OBJECT_STORE_UNAVAILABLE`, mit `Retry-After`) oder ein Deployment ohne Objektspeicher (`OBJECT_STORE_UNCONFIGURED`), eine Dokumentbereinigung, die nicht abschließen konnte (`PURGE_INCOMPLETE`), oder ein Objektspeicher, der das Schreiben eines Wissenseintrags angenommen und binnen 30 Sekunden nie beantwortet hat (`KNOWLEDGE_ENTRY_STORE_TIMEOUT` — nichts wird geschrieben) — wiederhole mit Backoff. | +| **503** | eine Abhängigkeit, die die Anfrage brauchte, ist nicht erreichbar: die Datenbank der Plattform, etwa während eines Neustarts (`DATABASE_UNAVAILABLE`, mit `Retry-After` und einer `requestId` — bei jeder Operation und beim Webhook-Trigger, auch bei der Schlüsselprüfung, sodass ein gültiger Schlüssel in dieser Zeit nie mit **401** abgelehnt wird), der Embedding-Anbieter (`EMBEDDING_UPSTREAM_ERROR`, mit `Retry-After`), der Objektspeicher hinter einem Datei-Download (`OBJECT_STORE_UNAVAILABLE`, mit `Retry-After`) oder ein Deployment ohne Objektspeicher (`OBJECT_STORE_UNCONFIGURED`), eine Dokumentbereinigung, die nicht abschließen konnte (`PURGE_INCOMPLETE`), die Personen, Agenten und Automatisierungen, die ein Kommentar oder die Beschreibung einer neuen Aufgabe erwähnt (`MENTION_DIRECTORY_UNAVAILABLE` — nichts wird gepostet oder angelegt), oder ein Objektspeicher, der das Schreiben eines Wissenseintrags angenommen und binnen 30 Sekunden nie beantwortet hat (`KNOWLEDGE_ENTRY_STORE_TIMEOUT` — nichts wird geschrieben) — wiederhole mit Backoff. | | **502**, **503**, **504** | am Edge beantwortet, während die Plattform neu startet oder nicht erreichbar ist (`UPSTREAM_UNAVAILABLE`, mit `Retry-After`, einer frischen `requestId` und ohne `X-Tale-Api-Version`), an jedem Maschinenzugang — `/api/*`, `/events`, `/status.json`, `/openapi.json`, `/.well-known/*`; eine Browser-Navigation bekommt stattdessen die Wartungsseite — wiederhole mit Backoff. | Auch ein Dokument-`If-Match`, das nicht mehr zur gelesenen Darstellung passt, ergibt `412 PRECONDITION_FAILED`. `data.etag` nennt den aktuellen Tag; nichts wurde geschrieben. diff --git a/docs/de/develop/connectors.md b/docs/de/develop/connectors.md index cd3c789ef9..498af61aeb 100644 --- a/docs/de/develop/connectors.md +++ b/docs/de/develop/connectors.md @@ -25,6 +25,8 @@ auth: - method: api-key ``` +Ein Connector, dessen Name aus gewöhnlichen Wörtern besteht, etwa `task` (Tasks), deklariert zusätzlich `i18n.de.displayName` und `i18n.fr.displayName`. Ein Connector, der nach einem Produkt heißt, etwa Tavily, behält seinen Namen in jeder Sprache. + ### Erlaubte Ziele festlegen | Feld | Bedeutung | @@ -47,6 +49,7 @@ Ein neuer Connector ist ein Quellcodebeitrag. Die Laufzeit liest den Plattformka | Feld | Vertrag für Autor und Aufrufer | | --- | --- | | `name`, `description` | Stabiler Aktionsname in snake_case und eine Erklärung zum Einsatzzweck | +| `title`, `i18n` | Die Aktion in Worten für Menschen: ein kurzer englischer `title`, nur am Anfang großgeschrieben und ohne den Namen des Connectors („List issues“), dazu `i18n.de.title` und `i18n.fr.title` (und `de-CH`, wo die Schweizer Schreibung abweicht, etwa beim ß). Der Automatisierungs-Canvas zeigt eine Node als „GitHub · Issues auflisten“ in der Sprache der Lesenden; fehlt einer mitgelieferten Aktion einer der drei, schlagen die Tests des Katalogs fehl | | `input` | Objekt-JSON-Schema, vor der Ausführung validiert; Felder beschreiben und Pflichtfelder markieren | | `output` | Ergebnissignatur im TypeScript-Stil; Dokumentation, keine Laufzeitvalidierung der Ausgabe | | `effects` | `read` oder `write`; Schreibaktionen durchlaufen die Genehmigungsrichtlinie | diff --git a/docs/de/develop/mcp-endpoint.md b/docs/de/develop/mcp-endpoint.md index 6260d8d9f9..2225312538 100644 --- a/docs/de/develop/mcp-endpoint.md +++ b/docs/de/develop/mcp-endpoint.md @@ -21,7 +21,7 @@ Erstelle einen [API-Schlüssel](/de/platform/admin/api-keys) und hinterlege ihn | Transport | HTTPS-POST mit JSON-RPC und normalen JSON-Antworten | | Authentifizierung | `Authorization: Bearer ` | | Organisation | `X-Organization-Slug: ` | -| Protokollrevisionen | `2025-06-18` oder `2025-03-26`, wenn der Client diese vorschlägt | +| Protokollrevisionen | `2026-07-28`, von jeder Anfrage selbst mitgebracht; oder `2025-11-25`, `2025-06-18` bzw. `2025-03-26`, mit `initialize` eröffnet ([Protokollrevisionen](#protocol-revisions)) | Der Client muss entfernte HTTP-Endpunkte mit eigenen Headern unterstützen. Es gibt keinen SSE-Ereignisstrom, keine Sitzung zum Löschen und keinen OAuth-Anmeldeablauf. OAuth-Discovery-URLs antworten mit JSON und `404`; ein Client, der diesen Ablauf voraussetzt, braucht eine andere Authentifizierungskonfiguration. Ein reiner stdio-Client kann diese URL nicht direkt nutzen. Fertige Konfigurationen für opencode und Claude Code findest du unter [Tale aus deinem Editor oder einem Skript nutzen](/de/develop/use-tale-from-your-editor). @@ -36,43 +36,70 @@ curl --fail-with-body "$TALE_URL/api/v1/mcp" \ --header "Authorization: Bearer $TALE_API_KEY" \ --header "X-Organization-Slug: $TALE_ORG_SLUG" \ --header 'Content-Type: application/json' \ - --data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"docs-client","version":"1.0.0"}}}' + --data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"docs-client","version":"1.0.0"}}}' ``` -Der Server meldet sich als `tale-platform`. Lies `result.protocolVersion` und sende den ausgehandelten Wert bei späteren Aufrufen als `MCP-Protocol-Version`. Das nächste Beispiel verwendet `2025-06-18`; passe ihn an, falls die ältere Revision ausgehandelt wurde. Ein nicht unterstützter Headerwert führt zu `400`. +Der Server meldet sich als `tale-platform` und nennt die Version des API-Vertrags als `serverInfo.version`. Seine `instructions` sind eine kurze Anleitung für die Arbeit mit Tale, die dein Client an sein Modell weitergeben kann. Lies `result.protocolVersion` und sende den ausgehandelten Wert bei späteren Aufrufen als `MCP-Protocol-Version`. Das nächste Beispiel verwendet `2025-11-25`; passe ihn an, falls eine ältere Revision ausgehandelt wurde. Eine Revision, die der Endpunkt nicht spricht, führt zu `400` mit JSON-RPC `-32022`, und `data.supported` nennt die Revisionen, die er spricht. ```bash curl --fail-with-body "$TALE_URL/api/v1/mcp" \ --header "Authorization: Bearer $TALE_API_KEY" \ --header "X-Organization-Slug: $TALE_ORG_SLUG" \ - --header 'MCP-Protocol-Version: 2025-06-18' \ + --header 'MCP-Protocol-Version: 2025-11-25' \ --header 'Content-Type: application/json' \ --data '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_docs","arguments":{}}}' ``` -Bei Erfolg enthält `get_docs` die Automatisierungsreferenz als Text, ohne gesetztes Fehlerkennzeichen. Mit `method: "tools/list"` erhältst du stattdessen die Tool-Schemas. Der aktuelle Katalog umfasst 22 Tools. Bewahre die JSON-RPC-`id`, damit dein Client Antwort und Anfrage zuordnen kann. +Bei Erfolg enthält `get_docs` die Automatisierungsreferenz als Text, ohne gesetztes Fehlerkennzeichen. Mit `"arguments":{"topic":"triggers"}` erhältst du die Trigger-Referenz (die Felder jeder Trigger-Art, die Eingabe, mit der ihre Läufe starten, und die Ereignisse), mit `"validation"` die Anleitung zum Lesen eines Validierungsergebnisses samt jedem Fehlercode, mit `"settings"` jede Art von Einstellung mit ihren Feldern ([Einstellungen über MCP](/de/develop/mcp-settings)) und mit `"skill"` den [Tale-Skill](/de/develop/use-tale-from-your-editor#tale-skill). Mit `method: "tools/list"` erhältst du stattdessen die Tool-Schemas. Bewahre die JSON-RPC-`id`, damit dein Client Antwort und Anfrage zuordnen kann. ### Transport und Sammelanfragen | Anfrage | Antwort | | --- | --- | | Einzelne JSON-RPC-Nachricht | Ein JSON-RPC-Ergebnis oder -Fehler | -| Bis zu 20 Nachrichten im Batch | Array mit Antworten; Benachrichtigungen erhalten keinen eigenen Eintrag | +| Bis zu 20 Nachrichten im Batch (nur Revisionen von 2025) | Array mit Antworten; Benachrichtigungen erhalten keinen eigenen Eintrag | | Nur Benachrichtigungen | HTTP `202` | | `OPTIONS` | HTTP `204`, `Allow: POST, OPTIONS`; kein Schlüssel nötig | | Andere HTTP-Methode | HTTP `405`, `Allow: POST, OPTIONS` | -Jeder zusätzliche Tool-Aufruf im Batch verbraucht dasselbe Anfragebudget wie ein eigener Aufruf. Ist das Budget erschöpft, enthält der betroffene Eintrag JSON-RPC `-32000` mit `data.retryAfterMs`. Die HTTP-Antwort bleibt `200` ohne `Retry-After`. Eine einzelne Anfrage, die bereits am HTTP-Eingang abgelehnt wird, erhält REST `429`. Behandle beide Fälle nach der [Referenz zu Ratenlimits](/de/develop/rate-limits). +Jeder zusätzliche Tool-Aufruf, jede weitere Ressourcen-Abfrage oder -Liste und jeder weitere Prompt im Batch verbraucht dasselbe Anfragebudget wie ein eigener Aufruf. Ist das Budget erschöpft, enthält der betroffene Eintrag JSON-RPC `-32000` mit `data.retryAfterMs`. Die HTTP-Antwort bleibt `200` ohne `Retry-After`. Eine einzelne Anfrage, die bereits am HTTP-Eingang abgelehnt wird, erhält REST `429`. Behandle beide Fälle nach der [Referenz zu Ratenlimits](/de/develop/rate-limits). -Der Endpunkt liefert keine CORS-Header für API-Schlüssel in Webseiten. Bewahre den Schlüssel auf einem vertrauenswürdigen Server oder im Zugangsdaten-Speicher des MCP-Clients auf. +Der Endpunkt liefert keine CORS-Header für API-Schlüssel in Webseiten. Bewahre den Schlüssel auf einem vertrauenswürdigen Server oder im Zugangsdaten-Speicher des MCP-Clients auf. Eine Anfrage, deren `Origin`-Kopfzeile eine Website nennt, die das Deployment nicht annimmt, wird protokolliert und mit `403` `ORIGIN_FORBIDDEN` abgelehnt, wo der Betreiber diese Prüfung durchsetzt ([Umgebungsreferenz](/de/self-hosted/configuration/environment-reference#mcp-endpoint)). Coding-Agents im Terminal senden keinen `Origin`. + +### Protokollrevisionen {#protocol-revisions} + +Der Endpunkt bedient zwei Generationen des Protokolls unter derselben URL und mit demselben Schlüssel und entscheidet bei jeder Anfrage, welche vorliegt. Ein Client, der `2026-07-28` spricht, sendet kein `initialize`: Jede Anfrage bringt ihre Revision und die Fähigkeiten des Clients selbst mit, deshalb bleibt zwischen zwei Anfragen nichts gespeichert. + +| | `2025-11-25`, `2025-06-18`, `2025-03-26` | `2026-07-28` | +| --- | --- | --- | +| Start | `initialize`, danach die ausgehandelte Revision in `MCP-Protocol-Version` | Kein Handshake; `server/discover` nennt, was der Server spricht | +| Jede Anfrage | Die JSON-RPC-Nachricht | `params._meta` mit `io.modelcontextprotocol/protocolVersion` und `io.modelcontextprotocol/clientCapabilities`; die Header `MCP-Protocol-Version` und `Mcp-Method`, bei `tools/call`, `resources/read` und `prompts/get` zusätzlich `Mcp-Name` | +| Batches | Bis zu 20 Nachrichten | Eine Nachricht pro Anfrage | +| Ergebnisse | Wie auf dieser Seite beschrieben | Zusätzlich `resultType: "complete"` und der Server unter `_meta["io.modelcontextprotocol/serverInfo"]`; `server/discover`, die Listen und `resources/read` ergänzen `ttlMs` und `cacheScope: "private"` | +| `initialize`, `ping` | Werden beantwortet | HTTP `404` mit JSON-RPC `-32601` | +| Eine Adresse, die nichts findet | `-32002` | `-32602` | + +Nach den Regeln von `2026-07-28` bedient der Endpunkt eine Anfrage, wenn ihr `_meta` eine Revision nennt oder ihr Header `MCP-Protocol-Version` `2026-07-28` lautet. Ihre Header müssen wiederholen, was im Body steht. Fehlt ein Header oder nennt er eine andere Revision, eine andere Methode, ein anderes Tool, einen anderen Prompt oder eine andere Adresse, lehnt der Endpunkt die Anfrage mit HTTP `400` und JSON-RPC `-32020` ab, bevor etwas ausgeführt wird. Einen Wert für `Mcp-Name`, der kein reines ASCII ist, sendest du als `=?base64??=`. Fehlt `_meta` oder ist es fehlerhaft, antwortet der Endpunkt mit `-32602` und HTTP `400` und nennt die betroffenen Einträge unter `data.missing` oder `data.malformed`. + +```bash +curl --fail-with-body "$TALE_URL/api/v1/mcp" \ + --header "Authorization: Bearer $TALE_API_KEY" \ + --header "X-Organization-Slug: $TALE_ORG_SLUG" \ + --header 'MCP-Protocol-Version: 2026-07-28' \ + --header 'Mcp-Method: server/discover' \ + --header 'Content-Type: application/json' \ + --data '{"jsonrpc":"2.0","id":1,"method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"docs-client","version":"1.0.0"}}}}' +``` + +Die Antwort nennt unter `supportedVersions` alle Revisionen und enthält dieselben Fähigkeiten und `instructions` wie `initialize`, dazu den Server unter `_meta`. `ttlMs` gibt an, wie lange dein Client eine Antwort wiederverwenden darf: eine Stunde für `server/discover`, die Listen der Tools, Prompts und Adressmuster sowie die Referenzen; eine Minute für `resources/list` und den Connector-Katalog; `0` für eine Automatisierung oder einen Lauf, weil sie sich mit dem nächsten Speichern deines Agents ändern können. Jede Antwort gehört zu dem Schlüssel, der gefragt hat; ein Cache darf sie deshalb nie mit einem anderen Schlüssel teilen. Der Name aus `io.modelcontextprotocol/clientInfo` wird mit jedem Aufruf und mit den Änderungen des Aufrufs gespeichert, sodass eine Version, die ein Agent speichert, den Client nennt, der sie gespeichert hat. ## Die Tools -`tools/list` liefert das Eingabeschema jedes Tools. Fehlende, falsch typisierte, leere oder unerwartete Argumente führen vor der Ausführung zu JSON-RPC `-32602`. Das Dokument in `validate_automation`, `run_automation`, `test_automation` oder `save_automation` hat bewusst eine offene Hülle: `get_docs` erklärt die Grammatik, die Engine validiert den Inhalt. +`tools/list` liefert das Eingabeschema jedes Tools, und ein lesendes Tool beschreibt seine Antwort zusätzlich in `outputSchema`. Die Argumente werden vor der Ausführung geprüft: Fehlende, falsch typisierte, leere oder unerwartete Argumente lehnt der Endpunkt mit einem einzigen Tool-Ergebnis mit `isError` ab, dessen `code` `INVALID_ARGUMENTS` lautet und dessen `data.issues` jedes Problem mit `path`, `code` und `message` aufführt. Den Wert eines Arguments wiederholt die Ablehnung nie. Jedes Ergebnis trägt seine Antwort als kompakten JSON-Text, und die erfolgreiche Antwort eines lesenden Tools kommt zusätzlich als `structuredContent`, dasselbe Objekt. Das Dokument in `validate_automation`, `run_automation`, `test_automation` oder `save_automation` hat bewusst eine offene Hülle: `get_docs` erklärt die Grammatik, die Engine validiert den Inhalt. -Tools liefern außerdem `readOnlyHint`, `destructiveHint`, `idempotentHint` und `openWorldHint`. Ein Host kann damit einen Aufruf erklären; die Hinweise erteilen aber weder Rechte noch Sicherheitsgarantien. Lesezugriffe sind als solche markiert, Speichern schreibt eine Version, Bereitstellung und Triggeränderungen können Bestehendes ersetzen. Live-Ausführungen können echte Dienste ansprechen. +Tools liefern außerdem `readOnlyHint`, `destructiveHint`, `idempotentHint` und `openWorldHint`. Ein Host kann damit einen Aufruf erklären; die Hinweise erteilen aber weder Rechte noch Sicherheitsgarantien. Lesezugriffe sind als solche markiert, Speichern schreibt eine Version, Live-Schalten, Löschen, Installieren, Triggeränderungen und Einstellungsänderungen können Bestehendes ersetzen. Live-Ausführungen und manche Einstellungsänderungen können echte Dienste ansprechen. Live-Schalten, Löschen, einen Trigger setzen, eine Automatisierung in Projekten installieren, die Frage eines Laufs beantworten und Einstellungen ändern tragen zusätzlich `_meta["anthropic/requiresUserInteraction"]`: Ein Client, der das beachtet, fragt die Person vor jedem solchen Aufruf. -### Automatisierungen entwickeln {#autorieren} +### Automatisierungen entwickeln {#authoring} | Tool | Was es tut | | --------------------- | ------------------------------------------------------------------------ | @@ -81,14 +108,21 @@ Tools liefern außerdem `readOnlyHint`, `destructiveHint`, `idempotentHint` und | `search_catalog` | Knotenkatalog nach Stichwörtern durchsuchen. | | `validate_automation` | Ein Automatisierungsdokument validieren, ohne es zu speichern: Fehler und Warnungen mit ihrer Stelle, dazu die Ablaufanalyse und die abgeleiteten Typen. | | `run_automation` | Ein Automatisierungsdokument direkt gegen die deterministischen Mocks ausführen. | -| `test_automation` | Die eigenen Abnahmetests einer Automatisierung ausführen. | -| `save_automation` | Ein Automatisierungsdokument als neue unveränderliche Version speichern; die Antwort nennt seine Warnungen. | -| `get_automation` | Eine gespeicherte Version lesen — ohne Angabe die neueste, `version: "deployed"` die live geschaltete (`AUTOMATION_VERSION_UNKNOWN`, solange nichts deployt ist). | +| `test_automation` | Die eigenen Abnahmetests einer Automatisierung ausführen — eines Entwurfs (`automation`) oder einer gespeicherten Version (`name`, `version`), deren Ergebnis dann an der Version festgehalten wird. | +| `save_automation` | Ein Automatisierungsdokument als neue unveränderliche Version speichern; die Antwort nennt seine Warnungen. Siehe [Speichern, ohne Arbeit zu verlieren](#save). | +| `get_automation` | Eine gespeicherte Version lesen — ohne Angabe die neueste, `version: "deployed"` die live geschaltete (`AUTOMATION_VERSION_UNKNOWN`, solange nichts live geschaltet ist): das Dokument unter `automation`, dazu `settings`, `taskContract` und `presentation`, `latestVersion`, `deployedVersion`, wer sie gespeichert hat (`createdBy`), über welchen Weg (`createdVia`: `app`, `upload`, `mcp`, `managed` oder `system`; `null` bei einer Version, die vor dieser Erfassung gespeichert wurde) und mit welchem Client (`clientName`), ihre `projectIds` und ihr `trigger`. | | `list_automations` | Automatisierungen mit neuester und bereitgestellter Version sowie Installationsprojekten (`projectIds`) auflisten. | -| `deploy_automation` | Eine gespeicherte Version für Live-Ausführungen bereitstellen. | +| `deploy_automation` | Eine gespeicherte Version live schalten; eine ältere schaltet zurück. `expectedDeployedVersion` (die Version, die du als live gelesen hast, `null` für keine) lehnt das Live-Schalten mit `AUTOMATION_DEPLOYMENT_STALE` ab, wenn inzwischen eine andere live gegangen ist; die Antwort nennt die `previousVersion`. | +| `delete_automation` | Eine Automatisierung löschen — alle Versionen, ihren Trigger und ihre Installationen; ihre Läufe bleiben. `expectedLatestVersion` muss die neueste Version sein, die du gelesen hast (sonst `AUTOMATION_VERSION_STALE`); ein noch laufender Lauf verhindert das Löschen (`AUTOMATION_HAS_ACTIVE_RUNS`). | Arbeite in dieser Reihenfolge: Grammatik und Katalog lesen, Dokument validieren, mit Mocks ausführen, Akzeptanztests ausführen, Version speichern und dann bereitstellen. Ein erfolgreicher Mock-Test bestätigt den simulierten Ablauf. Er bestätigt keine echten Zugangsdaten, Netzwerkverbindungen oder Auswirkungen beim Anbieter. +#### Speichern, ohne Arbeit zu verlieren {#save} + +Eine Version trägt neben dem Dokument das Einstellungsformular `settings`, das eine Aufgabe zeigt, den `taskContract` und die `presentation` in der Automatisierungsliste. Lässt ein Speichern eines davon weg, bleibt das der neuesten Version erhalten; `null` speichert keines (bei `presentation` zeigt die Liste dann weiter die neueste frühere); ein Wert wird gegen das Schema geprüft, mit dem die App ihn liest, und mit jedem Problem als `INVALID_ARGUMENTS` abgelehnt, wenn er nicht passt. `carried` in der Antwort nennt, was erhalten blieb. + +Gib `baseVersion` mit, die Version, von der deine Änderung ausging. Hat inzwischen jemand eine neuere gespeichert, wird das Speichern mit `AUTOMATION_VERSION_STALE` und `data.latestVersion` abgelehnt; lies diese Version, übernimm deine Änderung und speichere erneut. Ohne `baseVersion` wird angehängt, und `baseVersionChecked: false` sagt, dass die Prüfung entfiel. Speichere eine neue Automatisierung mit `create: true`: Ein schon vorhandener Name wird abgelehnt (`AUTOMATION_NAME_TAKEN`), damit eine neue Automatisierung nie zur Version einer anderen wird. Ebenso abgelehnt wird ein Speichern, mit oder ohne `create`, wenn der Name zu einer Automatisierung gehört, die du nicht sehen kannst. `projectId` installiert eine neue Automatisierung mit ihrer ersten Version in einem Projekt, das du bearbeiten darfst; beim Speichern einer bestehenden Automatisierung wird es ignoriert. + #### Ein Validierungsergebnis lesen {#validation-result} `validate_automation` antwortet mit `valid`, `errors`, `warnings`, `analysis` und `types`. Fehler verhindern Speichern und Bereitstellen, Warnungen nie. `save_automation` gibt die `warnings` der gespeicherten Version zurück, und ein abgelehntes Speichern nennt seine `warnings` neben den `errors`. So erfährst du beides schon während der Arbeit. @@ -106,46 +140,120 @@ Arbeite in dieser Reihenfolge: Grammatik und Katalog lesen, Dokument validieren, `analysis.nodes.` sagt, ob eine Node erreichbar ist (`reachable`), ob sie immer läuft (`alwaysRuns`), wie sie übersprungen werden kann (`maySkip`) und ob ihr Fehler den Lauf anhält (`failureHandling: "halts"`) oder weiterlaufen lässt (`"continues"`). `analysis.paths` listet die Wege, die ein erfolgreicher Lauf nehmen kann — bis zu 32, mit `count` für alle — und nennt die Nodes, deren Fehler einen Lauf beendet. `types` liefert das JSON-Schema der Eingabe des Laufs, der Ausgabe jeder Node und des Ergebnisses der Automatisierung; `get_catalog` liefert das `outputSchema` jeder Capability auf dieselbe Weise. [Was Tale vor einem Lauf prüft](/de/platform/automations/concepts#checks) erklärt jede Gruppe von Prüfungen. -### Läufe und Trigger verwalten +`detail` wählt, was neben den Problemen zurückkommt: `["analysis"]`, `["types"]` oder `[]` für die Probleme allein; ohne `detail` bekommst du beides. Manche Warnungen prüfen das Dokument nicht, sondern vergleichen es mit deiner Organisation: ein Skill, den kein Lauf der Automatisierung erreicht (`SKILL_UNKNOWN`), ein Connector, den niemand verbunden hat (`CONNECTOR_NOT_CONNECTED`), ein Secret, das niemand gespeichert hat (`SECRET_UNKNOWN`, nur für Inhaber, Admins und Entwickler), eine Agent-Laufzeit, die dieses Deployment nicht ausführen kann (`HARNESS_UNKNOWN`), und ein Event-Trigger, der auf ein Ereignis wartet, das Tale nicht auslöst (`EVENT_UNKNOWN`). Sie verhindern nie das Speichern; die [Tools zum Nachschlagen](#discovery) zeigen, was es gibt. + +### Läufe und Trigger verwalten {#management} | Tool | Was es tut | | ---------------- | ----------------------------------------------------------------------------------------------------------------------- | | `run_deployed` | Die bereitgestellte Version live ausführen und bis zu 30 Sekunden auf Ausgabe, Trace und Effekte warten. Läuft sie weiter, die zurückgegebene `runId` abfragen. Nimmt denselben optionalen `idempotencyKey` wie `start_run`, im selben Register wie die REST-Tür: eine Wiederholung antwortet mit dem ersten Lauf und `duplicate: true` und startet nichts — egal, welche Tür ihn gestartet hat. | -| `start_run` | Die bereitgestellte Version im Hintergrund starten; die zurückgegebene Lauf-ID mit `get_run` abfragen. Nimmt optional einen `idempotencyKey` — den `Idempotency-Key` der REST-Tür, dasselbe Register: derselbe Schlüssel mit denselben Argumenten antwortet mit dem Handle des ersten Laufs und `duplicate: true` und startet nichts, derselbe Schlüssel mit anderen Argumenten wird abgelehnt (`IDEMPOTENCY_KEY_REUSED`). Die HTTP-Kopfzeile `Idempotency-Key` weist dieser Endpoint ab (**400**, `INVALID_HEADER`) — ein Batch trägt bis zu 20 Aufrufe, der Schlüssel reist also in den Tool-Argumenten. | -| `list_runs` | Sichtbare Läufe einer Automatisierung oder über Projekte hinweg auflisten, neueste zuerst und jeweils mit `projectId`. | -| `get_run` | Status, Ausgabe, Trace, Effekte und `projectId` eines Laufs lesen. Die ID eines Projektlaufs passt zu `GET /api/v1/projects/{id}/runs/{runId}`. | +| `start_run` | Einen Lauf im Hintergrund starten; die zurückgegebene Lauf-ID mit `get_run` abfragen. `mode: "live"` (Standard) führt die live geschaltete Version echt aus; `mode: "mock"` führt eine beliebige gespeicherte Version — ohne `version` die neueste — gegen die deterministischen Mocks aus, und der Lauf steht wie ein in der App gestarteter in der Laufhistorie. Nimmt optional einen `idempotencyKey` — den `Idempotency-Key` der REST-Tür, dasselbe Register: derselbe Schlüssel mit denselben Argumenten antwortet mit dem Handle des ersten Laufs und `duplicate: true` und startet nichts, derselbe Schlüssel mit anderen Argumenten wird abgelehnt (`IDEMPOTENCY_KEY_REUSED`). Die HTTP-Kopfzeile `Idempotency-Key` weist dieser Endpoint ab (**400**, `INVALID_HEADER`) — ein Batch trägt bis zu 20 Aufrufe, der Schlüssel reist also in den Tool-Argumenten. | +| `list_runs` | Sichtbare Läufe einer Automatisierung oder über Projekte hinweg auflisten, neueste zuerst und jeweils mit `projectId`. `mode` und `statuses` filtern, und `nextCursor` (`null` auf der letzten Seite) ist der `cursor` der nächstälteren Seite; gib ihn unverändert mit denselben Filtern mit. | +| `get_run` | Status, Ausgabe, Trace, Effekte und `projectId` eines Laufs lesen. Die ID eines Projektlaufs passt zu `GET /api/v1/projects/{id}/runs/{runId}`. Wartet der Lauf auf die Antwort einer Person (`waitingFor: "ask"`), steht die Frage unter `ask`: ihre `askId` und die Frage selbst. `detail` wählt, was neben dem Status kommt; `detail: []` liefert nur den Status, zum Abfragen eines langen Laufs. `include: ["record"]` fügt den Lauf Schritt für Schritt unter `record` an: den Status jedes Schritts, warum er lief oder übersprungen wurde – jede Bedingung erklärt mit den Werten, die sie gelesen hat –, warum er fehlschlug (`failure.reason` und seine Erklärung) und Einblicke in seine Werte; `include: ["travels"]` fügt die Daten an, die zwischen den Schritten flossen. | +| `get_run_node` | Einen Schritt eines Laufs ganz lesen – oder eines seiner Elemente oder Durchläufe (`item`, `pass`): was er erhielt und zurückgab, Geheimnisse zurückgehalten; wo der Text jeder `{{ }}`-Einheit landete; was er aus früheren Schritten las; wie sich seine Ausgabe von seiner Eingabe unterscheidet; und sein Aufruf eines Konnektors oder Modells. Einen Schritt, den die Aufzeichnung nicht enthält, lehnt das Tool ab (`NODE_RUN_NOT_FOUND`). | +| `compare_runs` | Zwei Läufe einer Automatisierung nebeneinander (`a`, der frühere, und `b`): was sich an der Version änderte, wie sich Ein- und Ausgabe unterscheiden, Status und Entscheidungen jedes Schritts und der erste Schritt, an dem die Läufe auseinandergingen, mit den Werten, die seine Bedingung kippten. Läufe verschiedener Automatisierungen lehnt das Tool ab (`RUN_COMPARE_MISMATCH`). | +| `replay_run` | Einen Lauf erneut ausführen, in seinem eigenen Projekt: mit seiner eigenen Eingabe (`kind: "again"`), mit einer bearbeiteten `input` (`"edited"`) oder ab einem Schritt (`"from"` mit `from`) – die Schritte, die er außerhalb dieses Schritts und dessen, was er speist, beendet hat, werden wiederverwendet, der Rest läuft neu. `version` wählt die Version (standardmäßig die des Laufs), `mode` den Modus (der des Laufs; ein Fork eines Mock-Laufs bleibt Mock). `dryRun: true` liefert stattdessen den Plan – was wiederverwendet wird, was erneut läuft und wie viele Schreibvorgänge ein zweites Mal hinausgehen. Ein Live-Lauf braucht die Entwicklerrolle und die bereitgestellte Version; Ablehnungen: `REPLAY_RUN_NOT_FINISHED`, `REPLAY_NODE_UNKNOWN`, `REPLAY_GRAPH_CHANGED` (mit `data.nodes`), `REPLAY_MODE_MISMATCH`, `REPLAY_PROGRESS_UNREADABLE`, `REPLAY_INPUT_UNAVAILABLE`. Nimmt `idempotencyKey` wie `start_run`. | | `cancel_run` | Einen Lauf beim nächsten Übergang zwischen Knoten stoppen. | -| `list_versions` | Die unveränderliche Versionshistorie einer Automatisierung; jede Zeile sagt, ob sie die `deployed` ist, und `deployedVersion` nennt sie neben der Liste (`null`, solange nichts deployt ist). | +| `answer_run_ask` | Die Frage beantworten, die ein wartender Lauf einer Person gestellt hat (`get_run` liefert sie unter `ask`, mit der `askId`, die du übergibst); der Lauf geht mit der Antwort weiter, die als die des Schlüsselinhabers festgehalten wird. | +| `list_versions` | Die unveränderliche Versionshistorie einer Automatisierung; jede Zeile sagt, ob sie die `deployed` ist, wer sie über welchen Weg gespeichert hat (`createdVia`, `clientName`), und `deployedVersion` nennt die live geschaltete neben der Liste (`null`, solange nichts live geschaltet ist). `deployments` listet, wann Versionen live gingen, neueste zuerst, mit der Version, die vorher live war. | +| `set_automation_projects` | Eine Automatisierung in einem Schritt in Projekten installieren (`add`) und aus anderen entfernen (`remove`); die Antwort nennt, was `added`, `removed` und `unchanged` ist. Das Entfernen aus einem Projekt, in dem sie nicht installiert ist, wird abgelehnt (`AUTOMATION_NOT_INSTALLED`). | +| `get_automation_metrics` | Die Laufzahlen der Organisation für 7, 30 oder 90 Tage (`periodDays`), standardmäßig Live-Läufe oder Mock-Läufe: Läufe nach Ergebnis, Erfolgsquote, durchschnittliche Dauer, eine Reihe pro Tag und die meistgenutzten Automatisierungen, jeweils im Vergleich zum Zeitraum davor. | | `list_triggers` | Triggerbindungen lesen, ohne das Webhook-Geheimnis auszugeben. | | `delete_trigger` | Einen Trigger entfernen; Versionen und Laufhistorie bleiben erhalten. | -| `set_trigger` | Einen Zeitplan-, Webhook- oder Event-Trigger einrichten. Das `token` eines Webhooks wird einmal beantwortet, hier, und nie wieder — bewahr es auf; `deployed` sagt, ob Zustellungen laufen werden: Ein Trigger an einer Automatisierung ohne deployte Version wird gespeichert und löst nichts aus, bis eine deployt ist. | +| `set_trigger` | Festlegen, was die Automatisierung startet: einen Zeitplan (eine Wiederholungsregel oder einen Cron-Ausdruck, in einer Zeitzone), einen Webhook oder ein Plattform-Ereignis, jeweils mit optionaler fester Eingabe `input`. Der Aufruf ersetzt den ganzen Trigger; sende also `startDate` und `input` zurück, die `list_triggers` liest, um sie zu behalten. Das `token` eines Webhooks wird einmal beantwortet, hier, und nie wieder — bewahr es auf; `deployed` sagt, ob Zustellungen laufen werden: Ein Trigger an einer Automatisierung ohne deployte Version wird gespeichert und löst nichts aus, bis eine deployt ist. `warnings` sagt, was die deployte Version mit der Eingabe des Triggers anfangen würde. | | Tool | Geeignet für | | --- | --- | | `run_automation` | Ungespeichertes Dokument mit deterministischen Mocks ausprobieren; `mode: "live"` wird abgelehnt | | `run_deployed` | Bereitgestellte Version live ausführen und bis zu 30 Sekunden warten; danach gegebenenfalls die `runId` abfragen | | `start_run` | Bereitgestellte Version im Hintergrund starten und mit `get_run` verfolgen; mit `idempotencyKey` wird eine Wiederholung sicher | +| `start_run` mit `mode: "mock"` | Eine gespeicherte Version — live geschaltet oder nicht — gegen die Mocks ausführen, mit einem Eintrag, den jede Person in der Laufhistorie öffnen kann | + +Um einen fehlgeschlagenen Lauf zu beheben, lies ihn mit `get_run {runId, include: ["record"]}`: Der `failure.reason` des fehlgeschlagenen Schritts nennt, was schiefging, und seine Erklärung zeigt die Werte, die der Ausdruck gelesen hat. `get_run_node` liest diesen Schritt ganz. Korrigiere das Dokument, probiere es mit `run_automation` auf der Eingabe des Laufs aus, und sobald ein neuer Lauf fertig ist, zeigt `compare_runs`, wo er einen anderen Weg nahm. Beide Tools für bereitgestellte Versionen verwenden denselben dauerhaften Runner mit denselben Berechtigungsprüfungen und Ausführungsdaten. `start_run` akzeptiert optional `projectId`. Eine projektgebundene Automatisierung darf nur in einem ihrer Installationsprojekte laufen; bei genau einer Bindung kann dieses automatisch gewählt werden. Ohne Bindungen bedeutet eine fehlende Angabe Organisationskontext. Lies `projectIds` aus `list_automations` und die tatsächliche `projectId` aus dem zurückgegebenen Handle, statt die REST-URL zum Abfragen zu erraten. -### Capabilities und Wissen +### Nachschlagen {#discovery} + +| Tool | Was es tut | +| --- | --- | +| `list_models` | Die Modelle, die du verwenden darfst, gefiltert nach deinem Modellzugriff: jeweils mit `providerSlug` (eine `agent`-Node speichert ihn als `modelProvider`), `lane` (`direct`, wenn ein Anbieter es bereitstellt, `subscription` oder `broker`, wenn das Abo eines Mitglieds es bereitstellt), den passenden `nodeTypes` (eine `llm`-Node nimmt nur ein direkt bereitgestelltes Modell) und den Agent-Laufzeiten, denen es angeboten wird (`harnesses`). `nodeType` und `harness` filtern die Liste. | +| `list_harnesses` | Die Agent-Laufzeiten, die eine `agent`-Node als `harness` nennen kann, die Standard-Laufzeit (`default`), die läuft, wenn sie keine nennt, und ob ein Abo sie jeweils bedienen kann. | +| `list_skills` | Die Skills der Organisation; mit `projectId` auch die Team-Skills dieses Projekts, also die, die ein Lauf darin verwenden kann. Ein Projekt, das du nicht lesen darfst, antwortet `PROJECT_NOT_FOUND`. | +| `list_connectors` | Die Connectors, die dieses Deployment anbietet, ob deine Organisation sie jeweils verbunden hat (`connected`) und wie viele Aktionen sie haben; `query` filtert. `search_catalog` listet die Aktionen. | +| `list_agent_secrets` | Die Namen der Agent-Secrets der Organisation mit einer maskierten Vorschau (`preview`), nie ein Wert. Inhaber, Admins und Entwickler sehen sie; alle anderen bekommen eine leere Liste mit einem Hinweis (`note`). | +| `list_projects` | Die Projekte, die du lesen darfst: ob sie jeweils bearbeitbar (`writable`) oder archiviert (`archived`) sind und welche der darin installierten Automatisierungen du sehen darfst (`automations`). `query` filtert nach Name; `includeArchived` nimmt archivierte Projekte dazu. | +| `list_events` | Die Ereignisse, die Tale auslöst, jeweils mit dem Zeitpunkt, zu dem es eintritt: worauf ein Event-Trigger warten kann. | + +Jede Antwort trägt einen `hint`, der das Tool oder die Einstellung nennt, mit der sie sich ändert. + +### Einstellungen {#settings} + +| Tool | Was es tut | +| --- | --- | +| `get_settings` | Ohne `kinds` der Katalog: jede Art von Einstellung mit dem, was sie ist, ihren Operationen (`ops`) und Aktionen (`acts`), ihrem `baseRisk`, den Einstellungsseiten, auf denen eine Person dieselbe Änderung vornimmt (`areas`), ob dieses Deployment sie über MCP bedient (`available`) und ob deine Rolle sie lesen (`read`) und ändern (`write`) darf. Mit `kinds` — für eine einzelne Art auch mit `ids` oder dem `cursor` ihrer nächsten Seite — jede Ressource, die du lesen darfst, mit ihrem `key`, ihrer `config` und ihrem `hash`. Eine Art, die du nicht lesen darfst, steht mit dem Grund unter `refused`. | +| `plan_settings` | Plant bis zu 32 Änderungen, ohne eine davon vorzunehmen. Jede nennt ihre `action` (`create`, `update`, `delete`, `act` oder `unchanged`), den `currentHash`, einen `diff` Feld für Feld, ihre `effects` und ihr `risk` (`low`, `high` oder `critical`) oder die Ablehnung (`refusal`), an der sie scheitert. | +| `apply_settings` | Nimmt die Änderungen vor. `expected` ordnet dem `key` jeder geänderten Ressource den Hash zu, den du gelesen hast, oder `null` für eine, die du anlegst. Wird eine Änderung abgelehnt oder hat sich eine Ressource seit dem Lesen geändert, wird nichts übernommen. Sonst laufen die Änderungen in einer festen Reihenfolge über die Arten hinweg, und die erste, die scheitert, hält die übrigen an: Die Antwort listet, was übernommen wurde (`applied`), was gescheitert ist (`failed`) und was übersprungen wurde (`skipped`). | + +Eine Änderung nennt ihre Art (`kind`), die `id` der Ressource (entfällt bei einer Art mit nur einer Ressource) und ihre Operation (`op`): `set` ersetzt die Ressource durch die ganze `config` und legt sie an, wenn es sie noch nicht gibt; `delete` entfernt sie; `act` führt eine der Aktionen der Art mit ihren `args` aus. Plane zuerst, zeig der Person den Plan und nimm dann dieselben Änderungen vor: `apply_settings` fragt die Person vor jedem Aufruf und hat ein eigenes [Budget](/de/develop/rate-limits). + +[Einstellungen über MCP](/de/develop/mcp-settings) listet jede Art von Einstellung, wer sie ändern darf und was in Tale bleibt. + +Kein Secret geht durch diese Tools. Ein gespeichertes Secret erscheint als `{"masked": true, "preview": "…"}`; schick diesen Wert unverändert zurück, um es zu behalten. Eine Änderung mit einem anderen Wert an der Stelle eines Secrets oder mit Zugangsdaten irgendwo in ihrer Konfiguration wird mit `SECRET_ARGUMENT_REFUSED` abgelehnt; ein neues Secret gibt eine Person in Tale ein. + +### Capabilities und Wissen {#capabilities} | Tool | Was es tut | | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `search_capabilities` | Bereitgestellte Automatisierungen dieser Organisation nach Name und Beschreibung durchsuchen. | -| `invoke_capability` | Eine Capability über ihre `id` aufrufen. Ist eine Genehmigung erforderlich, liefert das Tool einen wartenden Genehmigungszustand, statt die Aktion auszuführen. | +| `invoke_capability` | Eine Capability über ihre `id` aufrufen: eine bereitgestellte Automatisierung, live ausgeführt wie mit `run_deployed`. Verlangt die Organisation für einen Schritt eine Genehmigung, wartet der Lauf, bis eine Person in Tale entscheidet. | | `get_knowledge` | Passagen aus Dokumenten und gecrawlten Websites der Organisation abrufen. `corpus` ist `private` (Dokumente), `public-web` (gecrawlte Seiten) oder `all`; die REST-Schreibweisen `documents` und `web` gehen auch. `query` ist auf 2000 Zeichen begrenzt. Jede Passage trägt `text`, `source` (einen Titel), `ref`, `corpus`, `chunkIndex`, `score`, `similarity`, wenn der dichte Zweig sie gefunden hat, `url` bei einer Webseite und — bei einem Dokument — die `documentId`, die `GET /api/v1/documents/{id}` nimmt (bei einem Projekttreffer die Datei-ID), sowie seine `projectId`: dieselbe Quellenangabe, die die REST-Suche liefert. | -Das Capability-Verzeichnis enthält derzeit bereitgestellte Automatisierungen. Integrierte Tools, Connector-Aktionen, Skills und externe MCP-Server gehören nicht dazu. Eine bereitgestellte Automatisierung aufzurufen entspricht derselben Live-Operation wie `run_deployed`. Wenn eine Genehmigung nötig ist, kann der Client anhand von `pending` erklären, dass zuerst ein Mensch entscheiden muss. +Das Capability-Verzeichnis enthält derzeit bereitgestellte Automatisierungen. Integrierte Tools, Connector-Aktionen, Skills und externe MCP-Server gehören nicht dazu. Eine bereitgestellte Automatisierung aufzurufen entspricht derselben Live-Operation wie `run_deployed` und wartet ebenso bis zu 30 Sekunden auf das Ende des Laufs. Braucht ein Schritt eine [Genehmigung](/de/platform/approvals/concepts), wartet der Lauf, bis eine Person in Tale entscheidet: `output` in der Antwort ist der Lauf mit `status: "waiting"`, und `get_run` zeigt `waitingFor: "approval"`. Kein Tool genehmigt oder lehnt sie ab, also sollte dein Client der Person Bescheid geben, statt es erneut zu versuchen. Brichst du den Lauf mit `cancel_run` ab, wird die Genehmigung zurückgezogen. + +## Ressourcen und Prompts {#resources-and-prompts} + +Neben Tools liefert der Endpunkt Ressourcen, die ein Client über ihre Adresse liest, und Prompts: vorbereitete Anfragen, mit denen eine Person eine Arbeit beginnt. Beide lesen, was ein Tool ohnehin beantwortet, für dieselbe Person und mit denselben Prüfungen. + +### Über eine Adresse lesen {#resources} + +`resources/list` nennt zuerst die festen Ressourcen und danach jede Automatisierung, die der Schlüsselinhaber sehen darf, 100 pro Seite; mit `nextCursor` holst du die nächste Seite. `resources/templates/list` liefert die Adressmuster, `resources/read` den Inhalt einer Ressource. + +| Adresse | Inhalt | Liest sich wie | +| --- | --- | --- | +| `tale://docs/authoring`, `tale://docs/triggers`, `tale://docs/validation`, `tale://docs/settings`, `tale://docs/skill` | Die Referenzen als Markdown | `get_docs` mit diesem `topic` | +| `tale://catalog/{kind}` (`transform`, `llm`, `agent`, `subautomation`, `connector`) | Den Abschnitt der Referenz zu einer Kern-Knotenart oder die Connector-Aktionen | `get_catalog` mit diesem `kind` | +| `tale://automations/{name}` | Die zuletzt gespeicherte Version als JSON | `get_automation` | +| `tale://automations/{name}/versions/{version}` | Eine gespeicherte Version; `{version}` ist eine Nummer oder `deployed` | `get_automation` mit `version` | +| `tale://runs/{runId}` | Einen Lauf mit Ausgabe, Trace und Effekten | `get_run` | + +Schreibe jeden `/` in einem Automatisierungsnamen als `%2F`: `tale://automations/billing%2Fdunning`. Eine Adresse, die nichts findet, liefert JSON-RPC `-32002` (unter `2026-07-28` `-32602`) mit dem Code der Ablehnung in `data.code`, etwa `AUTOMATION_NOT_FOUND`. Eine Automatisierung, die der Schlüsselinhaber nicht sehen darf, liefert denselben Fehler wie eine, die es nicht gibt. Eine fehlerhafte Adresse, etwa eine Version, die keine Zahl ist, liefert `-32602`. + +### Mit einem Prompt beginnen {#prompts} + +`prompts/list` nennt drei Prompts, und `prompts/get` liefert die Nachricht samt dem, worum es geht, als angehängte Ressource. Claude Code zeigt sie als `/tale:edit_automation` und so weiter. + +| Prompt | Argumente | Was er den Agent tun lässt | +| --- | --- | --- | +| `edit_automation` | `name` (optional) | Die Automatisierung ändern oder neu anlegen, validieren, mit Mocks testen und mit `baseVersion` speichern; er schaltet nichts live | +| `debug_failed_run` | `runId` | Erklären, warum der Lauf fehlgeschlagen ist, den Fehler mit Mocks nachstellen und die kleinste Korrektur vorschlagen | +| `add_trigger` | `name`, `kind` (optional: `schedule`, `webhook` oder `event`) | Festlegen, was die Automatisierung startet, und vor `set_trigger` nachfragen | + +Jedes Argument ist ein einzelnes Wort, weil Clients wie Claude Code die Argumente an Leerzeichen trennen. Ein leer gesendetes Argument gilt als weggelassen. Ein Prompt, dessen Lauf oder Automatisierung der Schlüsselinhaber nicht lesen darf, liefert `-32602` mit dem Code dieses Lesezugriffs. ## Was der Schlüssel darf | Vorgang | Erforderlicher Zugriff | | --- | --- | -| Lesen, Validierung, Mock-Ausführungen und Akzeptanztests, Capability-Suche, Wissensabruf | Mitgliedschaft plus normale Zugriffsregeln der Ressource | -| Speichern, Bereitstellen, Trigger setzen/löschen, Lauf abbrechen oder live ausführen | Entwicklerberechtigung plus normale Zugriffsregeln der Ressource | +| Lesen, Validierung, Mock-Ausführungen (auch `start_run` mit `mode: "mock"`) und Akzeptanztests, Capability-Suche, Wissensabruf | Mitgliedschaft plus normale Zugriffsregeln der Ressource | +| Die Frage eines Laufs beantworten | Mitgliedschaft; bei einem Lauf in einem Projekt Bearbeitungszugriff auf dieses Projekt | +| Namen der Agent-Secrets (`list_agent_secrets`) | Rolle Inhaber, Admin oder Entwickler; alle anderen bekommen eine leere Liste | +| Einstellungen lesen, planen und ändern (`get_settings`, `plan_settings`, `apply_settings`) | Was deine Rolle auf derselben Einstellungsseite darf; der Katalog sagt, was deine Rolle mit jeder Art tun darf | +| Speichern, live schalten, löschen, in Projekten installieren, Trigger setzen/löschen, Lauf abbrechen oder live ausführen | Entwicklerberechtigung plus normale Zugriffsregeln der Ressource | + +Der Schlüssel identifiziert seinen Inhaber. Er erweitert weder dessen Rolle noch dessen Projektzugriff. Eine Automatisierung, die nur in Projekten installiert ist, die der Schlüsselinhaber nicht lesen darf, fehlt in `list_automations`, und jeder Lesezugriff auf sie antwortet `AUTOMATION_NOT_FOUND` wie bei einer, die es nicht gibt. Auch eine Live-Ausführung über `invoke_capability` durchläuft die Ausführungsprüfungen. -Der Schlüssel identifiziert seinen Inhaber. Er erweitert weder dessen Rolle noch dessen Projektzugriff. Auch eine Live-Ausführung über `invoke_capability` durchläuft die Ausführungsprüfungen. +Jede Änderung, die ein MCP-Aufruf an einer Automatisierung vornimmt — eine gespeicherte Version, ein Live-Schalten, ein Löschen, ein gesetzter oder entfernter Trigger, eine hinzugefügte oder entfernte Installation —, steht im Audit-Log der Organisation, gekennzeichnet als über MCP gekommen, mit dem Tool und dem API-Schlüssel. In den Details des Ereignisses zeigt **Quelle** Coding-Agent, und **Client** nennt die App des Agents, wenn sie sich bei jedem Aufruf nennt, wie mit der Revision 2026-07-28; eine App mit einer 2025er-Revision nennt sich nur bei `initialize`, deshalb zeigen ihre Ereignisse keinen **Client** ([Audit-Logs](/de/platform/admin/governance/audit-logs)). Lies vor dem Einrichten privilegierter Tools `GET /api/v1/me`: `capabilities.developer` nennt die aktuelle Rollenberechtigung. `deploymentEditor` gehört dagegen zu einer separaten Freigabeliste des Betreibers und erteilt keine MCP-Bearbeitungsrechte. Tool-Fehler verwenden weiterhin das unten beschriebene MCP-Format; die REST-Berechtigungsabfrage ändert die JSON-RPC-Fehlerbehandlung nicht. @@ -153,16 +261,19 @@ Lies vor dem Einrichten privilegierter Tools `GET /api/v1/me`: `capabilities.dev | Ergebnis | Umgang damit | | --- | --- | -| JSON-RPC `-32601` | Unbekannte Methode korrigieren | -| JSON-RPC `-32602` | Tool-Name oder Argumente anhand von `tools/list` korrigieren; ein Wert außerhalb einer aufgezählten Menge wird abgelehnt, und die Meldung nennt die Menge | +| JSON-RPC `-32601` | Unbekannte Methode korrigieren; unter `2026-07-28` kommt der Fehler mit HTTP `404`, auch für `initialize` und `ping` | +| JSON-RPC `-32602` | Tool-Name anhand von `tools/list`, Name oder Argumente eines Prompts anhand von `prompts/list` oder eine Ressourcenadresse korrigieren. Mit HTTP `400` das `_meta` unter `2026-07-28` um die Einträge aus `data.missing` oder `data.malformed` ergänzen | +| JSON-RPC `-32002` | Die Ressourcenadresse findet nichts; `data.code` nennt die Ablehnung, etwa `AUTOMATION_NOT_FOUND`. Unter `2026-07-28` trägt dieselbe Antwort den Code `-32602` | +| JSON-RPC `-32020` (HTTP `400`) | Die Header einer Anfrage unter `2026-07-28` wiederholen ihren Body nicht; `MCP-Protocol-Version`, `Mcp-Method` und `Mcp-Name` wie unter [Protokollrevisionen](#protocol-revisions) beschrieben senden | +| JSON-RPC `-32022` (HTTP `400`) | Eine der Revisionen aus `data.supported` senden: in `MCP-Protocol-Version` und unter `2026-07-28` auch in `_meta`. Eine Revision von 2025 wird mit `initialize` eröffnet | | Tool-Ergebnis mit `isError: true` | Stabilen `code`, erklärenden `error` und Handlungshinweis `hint` im Textinhalt lesen; `data` kann Feldprobleme enthalten | | `validate_automation` mit `valid: false` | Normales Validierungsergebnis; `errors` und ihre Stellen auswerten ([Ein Validierungsergebnis lesen](#validation-result)), obwohl `isError` false bleibt. Warnungen machen ein Dokument nie ungültig | -| Capability mit `pending` | Normales Genehmigungsergebnis; weder als fertig noch als erneut zu versuchenden Fehler behandeln | +| Capability mit `status: "waiting"` in `output` | Der Lauf wartet, etwa auf eine Genehmigung, die eine Person in Tale erteilt; er ist weder fertig noch fehlgeschlagen. `get_run` abfragen und nicht erneut versuchen | | Capability mit `refused` | Fehlerergebnis; die genannte Ursache beheben | -Zu den Tool-Codes gehören `AUTOMATION_NOT_FOUND`, `AUTOMATION_VERSION_UNKNOWN`, `AUTOMATION_NOT_DEPLOYED`, `RUN_NOT_FOUND`, `AUTOMATION_INVALID`, `AUTOMATION_TESTS_FAILING`, `LIVE_MODE_UNAVAILABLE` und `NOT_SUPPORTED`. Letzterer bedeutet, dass der Host den Vorgang für Läufe, Versionen oder Trigger nicht unterstützt. `start_run` lehnt einen wiederverwendeten `idempotencyKey` mit anderen Argumenten als `IDEMPOTENCY_KEY_REUSED` ab; `invoke_capability` lehnt eine ID, die das Register nicht führt — eine nur gespeicherte Automatisierung steht nicht darin —, als `CAPABILITY_NOT_FOUND` ab und Eingaben, die ihr Schema zurückweist, als `CAPABILITY_INPUT_INVALID`; `get_knowledge` reicht die eigenen Codes der Wissens-Tür durch (`KNOWLEDGE_UNAVAILABLE`, wenn die Suche selbst fehlgeschlagen ist). Plattformfehler behalten ihren eigenen Code, Hinweis und gegebenenfalls Daten; fehlender Entwicklerzugriff liefert etwa `FORBIDDEN_DEVELOPER_SETTINGS`. +Zu den Tool-Codes gehören `AUTOMATION_NOT_FOUND`, `AUTOMATION_VERSION_UNKNOWN`, `AUTOMATION_NOT_DEPLOYED`, `RUN_NOT_FOUND`, `AUTOMATION_INVALID`, `AUTOMATION_TESTS_FAILING`, `AUTOMATION_VERSION_STALE`, `AUTOMATION_DEPLOYMENT_STALE`, `AUTOMATION_NAME_TAKEN`, `AUTOMATION_HAS_ACTIVE_RUNS`, `AUTOMATION_NOT_INSTALLED`, `HUMAN_ASK_NOT_FOUND`, `HUMAN_ASK_NOT_PENDING`, `HUMAN_ASK_EXPIRED`, `EMPTY_ANSWER`, `INVALID_CURSOR`, `LIVE_MODE_UNAVAILABLE` und `NOT_SUPPORTED`. Letzterer bedeutet, dass der Host den Vorgang für Läufe, Versionen oder Trigger nicht unterstützt. `start_run` lehnt einen wiederverwendeten `idempotencyKey` mit anderen Argumenten als `IDEMPOTENCY_KEY_REUSED` ab; `invoke_capability` lehnt eine ID, die das Register nicht führt — eine nur gespeicherte Automatisierung steht nicht darin —, als `CAPABILITY_NOT_FOUND` ab und Eingaben, die ihr Schema zurückweist, als `CAPABILITY_INPUT_INVALID`; `get_knowledge` reicht die eigenen Codes der Wissens-Tür durch (`KNOWLEDGE_UNAVAILABLE`, wenn die Suche selbst fehlgeschlagen ist). Plattformfehler behalten ihren eigenen Code, Hinweis und gegebenenfalls Daten; fehlender Entwicklerzugriff liefert etwa `FORBIDDEN_DEVELOPER_SETTINGS`. `INVALID_ARGUMENTS` führt jedes Argumentproblem auf; ein Wert außerhalb einer aufgezählten Menge wird abgelehnt, und die Meldung nennt die Menge. `RATE_LIMITED` bedeutet, dass das Tool eine Ausführung oder eine Einstellungsänderung gebraucht hätte und das [Budget](/de/develop/rate-limits) des Schlüsselinhabers dafür aufgebraucht ist: Warte `data.retryAfterMs` ab. `INTERNAL_ERROR` bedeutet, dass der Aufruf unerwartet fehlgeschlagen ist; nenne dem Betreiber des Deployments die `data.requestId`. Die Einstellungs-Tools ergänzen `SETTINGS_STALE` (eine Ressource hat sich seit dem Lesen geändert; `data.currentHash` ist ihr aktueller Hash), `SECRET_ARGUMENT_REFUSED` (eine Änderung enthielt ein Secret; `data.places` sagt, wo, nie, was), `SETTINGS_KIND_UNAVAILABLE` (dieses Deployment bedient diese Art nicht über MCP), `SETTINGS_NOT_FOUND` (eine Aktion auf einer Ressource, die es nicht gibt) und `SETTINGS_DUPLICATE` (eine Ressource wurde in einem Aufruf zweimal geändert). -Ein unbekannter Automatisierungsname ist auch bei `list_versions`, `list_runs` und `list_triggers` ein Fehler. Eine leere Liste bedeutet, dass eine vorhandene Automatisierung keine passenden Einträge hat. Die eine Ausnahme ist die Laufhistorie: Eine gelöschte Automatisierung behält ihre Läufe, `list_runs {name}` antwortet sie also, solange es sie gibt, und nur ein Name, der nie gelaufen ist, ergibt `AUTOMATION_NOT_FOUND`. `get_catalog`, auf eine Kern-Knotenart eingegrenzt (`transform`, `llm`, `agent`, `subautomation`), antwortet mit einer leeren Liste und einem `hint` auf `get_docs`, wie `search_catalog` auch. Ungültige Dokumente für Tools, die ein gültiges Dokument benötigen, fehlgeschlagene Suchen und fehlende Bereitstellungen setzen `isError: true`. Nur das Validierungstool meldet ein ungültiges Dokument als normales Prüfergebnis. +Ein unbekannter Automatisierungsname ist auch bei `list_versions`, `list_runs` und `list_triggers` ein Fehler. Eine leere Liste bedeutet, dass eine vorhandene Automatisierung keine passenden Einträge hat. Die eine Ausnahme ist die Laufhistorie: Eine gelöschte Automatisierung behält ihre Läufe, `list_runs {name}` antwortet sie also, solange es sie gibt, und nur ein Name, der nie gelaufen ist, ergibt `AUTOMATION_NOT_FOUND`. `get_catalog`, auf eine Kern-Knotenart eingegrenzt (`transform`, `llm`, `agent`, `subautomation`), antwortet mit einer leeren Liste und einem `hint` auf `get_docs`, wie `search_catalog` auch, und liefert unter `reference` den Abschnitt der Referenz zu dieser Knotenart. Ungültige Dokumente für Tools, die ein gültiges Dokument benötigen, fehlgeschlagene Suchen und fehlende Bereitstellungen setzen `isError: true`. Nur das Validierungstool meldet ein ungültiges Dokument als normales Prüfergebnis. ## Wo das hingehört diff --git a/docs/de/develop/mcp-settings.md b/docs/de/develop/mcp-settings.md new file mode 100644 index 0000000000..df034143d6 --- /dev/null +++ b/docs/de/develop/mcp-settings.md @@ -0,0 +1,129 @@ +--- +title: Einstellungen über MCP +description: Lass einen Coding-Agenten die Einstellungen von Tale über den MCP-Endpunkt lesen und ändern — im Rahmen der Rolle der Person, deren API-Schlüssel er nutzt. +--- + +Ein Coding-Agent, der mit dem [MCP-Endpunkt](/de/develop/mcp-endpoint) verbunden ist, liest die Einstellungen deiner Organisation, plant eine Änderung und nimmt sie vor — mit drei Tools: `get_settings`, `plan_settings` und `apply_settings`. Er handelt mit der Rolle der Person, deren API-Schlüssel er nutzt. Er darf ändern, was diese Person in der App ändern dürfte, und durchläuft dieselben Prüfungen. Die [Audit-Logs](/de/platform/admin/governance/audit-logs) halten jede Änderung als Änderung dieser Person fest, vorgenommen über MCP. + +## Was ein Agent ändern kann {#kinds} + +Tale liest und schreibt jede Art von Einstellung mit seinem eigenen Code und den Prüfungen, die auch die App vornimmt. Deshalb gelten dieselben Rollenregeln wie in der App. + +| Art | Was sie enthält | Änderungen | Wer sie ändern darf | +| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `provider` | Ein KI-Anbieter, den deine Organisation selbst angelegt hat: sein Endpunkt, sein API-Format und sein Modellkatalog. Die Anbieter, die Tale mitbringt, sind keine Einstellungen. | Setzen, löschen; den Modellkatalog neu einlesen (`refresh-catalogs`) | Inhaber, Admins und Entwickler | +| `provider-credential` | Zugangsdaten, die ihren Schlüssel aus einer Umgebungsvariable des Deployments lesen. Zugangsdaten mit Schlüssel oder Abonnement erscheinen ohne ihr Secret und lassen sich entfernen. | Setzen, löschen | Inhaber, Admins und Entwickler | +| `governance` | Eine Richtlinie der Organisation, benannt nach ihrem Schlüssel: Modelle und Modellzugriff, Budgets und Limits, Anmelde- und Sitzungssicherheit, Guardrails, Sandbox-Kontingente. | Setzen | Inhaber und Admins | +| `knowledge-embedding` | Das Embedding-Modell des Wissens deiner Organisation, mit seiner Ähnlichkeitsschwelle und seinen Nutzungsgrenzen. | Setzen | Inhaber und Admins | +| `branding` | Die Akzentfarbe und die Dateinamen von Logo und Favicons. | Setzen | Inhaber und Admins | +| `project-instructions` | Die festen Anweisungen eines Projekts. | Setzen | Wer das Projekt bearbeiten darf | +| `agent-instructions` | Die Anweisungen eines Projekt-Agenten. | Setzen | Wer das Projekt bearbeiten darf | +| `agent-tools` | Die Tools, die ein Projekt-Agent nutzen darf. | Setzen | Wer das Projekt bearbeiten darf | +| `agent-model` | Die Agent-Laufzeit (Harness), das Modell und der Anbieter, mit denen ein Projekt-Agent läuft. Eine Änderung gilt für die Läufe, die er danach startet. | Setzen | Wer das Projekt bearbeiten darf | +| `task-instructions` | Die Beschreibung einer Aufgabe. | Setzen | Wer die Aufgabe ändern darf | +| `task-review-context` | Ob die Arbeit an einer Aufgabe ein unabhängiges Review durch einen anderen Projekt-Agenten erhält, und durch welchen. Einmal gesetzt, bleibt der Reviewer-Agent derselbe. | Setzen | Wer das Projekt bearbeiten darf | +| `deployment` | Die eigenen Einstellungen des Deployments, die für jede Organisation darauf gelten, etwa die Sandbox-Laufzeit. | Setzen | Lesen darf sie jeder Inhaber und Admin einer Organisation auf dem Deployment; ändern dürfen sie nur die Adressen auf der Editor-Freigabeliste des Deployments | + +Eine Ressource hat innerhalb ihrer Art eine ID: ein Anbieter seinen Namen, Zugangsdaten `/` mit URI-kodiertem Namen, eine Richtlinie ihren Schlüssel wie `password_policy`, ein Projekt seine ID, ein Agent `/` und eine Aufgabe `/`. Embedding-Modell, Branding und Deployment-Einstellungen haben keine ID. `get_settings` listet Projekt- und Agenteneinstellungen seitenweise über die Projekte, die du lesen darfst; die Beschreibung einer Aufgabe und ihren Review-Kontext liest es nur über die ID der Aufgabe. + +Manche Änderungen bleiben in Tale: + +- Jedes Secret, etwa der API-Schlüssel eines Anbieters, ein Abonnement oder der Schlüssel des Moderationsanbieters, gibt eine Person in Tale ein. +- Die Aufbewahrungsrichtlinie und die Richtlinie für Anfragen betroffener Personen ändern sich nur über ihre eigenen, gestuften Abläufe. +- Branding-Bilder werden in Tale hochgeladen. Ein Dateiname, den ein Agent setzt, muss ein bereits hochgeladenes Bild nennen. +- Über MCP ändert sich das Embedding-Modell selbst nur, solange das Wissen der Organisation kein Dokument und keine Website enthält. So treffen Vektoren zweier Modelle nie in einer Suche aufeinander. Ähnlichkeitsschwelle und Nutzungsgrenzen ändern sich jederzeit; sind Dokumente indexiert, ändert eine Person das Modell in Tale. +- Der Standard-Agent eines Projekts folgt der Richtlinie `standard_agent`, die die Art `governance` ändert; seine eigenen Anweisungen, Tools und sein Modell sind keine Einstellungen. +- Mitglieder, Teams, Connectors, Skills, Kompetenzen, Legal Holds, die Audit-Logs, Metriken und persönliche Einstellungen deckt keine Art ab. `get_settings` ohne Argumente zeigt, was jede Art abdeckt. + +## Eine Änderung vornehmen {#make-a-change} + +1. Ruf `get_settings` ohne Argumente auf. Die Antwort listet jede Art, ob dieses Deployment sie bedient und ob deine Rolle sie lesen und ändern darf. +2. Lies mit `get_settings` und `kinds` (und `ids`), was du ändern willst. Jede Ressource kommt mit ihrem `key`, ihrer `config` und ihrem `hash`. +3. Plane die Änderung mit `plan_settings`. Ein `set` ersetzt die ganze Ressource durch ihre `config`. Schick deshalb jedes Feld mit, das erhalten bleiben soll, so wie du es gelesen hast. Der Plan nennt für jede Änderung ihre Aktion, ihren Diff, ihre Auswirkungen und ihr Risiko oder die Ablehnung, an der sie scheitert. Geschrieben wird dabei nichts. +4. Zeig der Person den Plan und warte auf ihre Entscheidung. Stell die Auswirkungen und das Risiko an den Anfang. +5. Nimm dieselben Änderungen mit `apply_settings` vor. `expected` ordnet dem `key` jeder geänderten Ressource den Hash zu, den du gelesen hast, oder `null` für eine, die du anlegst. + +So sehen die Argumente eines Plans aus, der die Passwort-Rotation einschaltet: + +```json +{ + "changes": [ + { + "kind": "governance", + "id": "password_policy", + "op": "set", + "config": { + "minLength": 12, + "requireUpper": true, + "requireLower": true, + "requireDigit": true, + "requireSpecial": true, + "rotationDays": 90 + } + } + ] +} +``` + +Der Plan nennt die Auswirkung auf die Mitglieder, denn die Rotation lässt bereits gesetzte Passwörter ablaufen. Der Hash ist hier gekürzt: + +```json +{ + "ok": true, + "changes": [ + { + "kind": "governance", + "id": "password_policy", + "key": "governance/password_policy", + "op": "set", + "action": "update", + "currentHash": "5c1f…", + "diff": [{ "path": "/rotationDays", "before": 0, "after": 90 }], + "effects": ["may-lock-out-members"], + "risk": "critical" + } + ] +} +``` + +Zum Übernehmen schickst du dieselben `changes` mit `"expected": { "governance/password_policy": "5c1f…" }`, mit dem vollständigen Hash. Bevor etwas geschrieben wird, plant Tale jede Änderung noch einmal gegen das, was jetzt gespeichert ist. Wird eine abgelehnt oder hat sich eine Ressource seit dem Lesen geändert, wird nichts übernommen. Sonst laufen die Änderungen in einer festen Reihenfolge über die Arten hinweg, damit das, worauf eine Ressource verweist, zuerst existiert. Die erste Änderung, die scheitert, hält die übrigen an, und die Antwort listet, was übernommen wurde (`applied`), was gescheitert ist (`failed`) und was übersprungen wurde (`skipped`). Was bereits übernommen wurde, wird nicht rückgängig gemacht. + +`apply_settings` fragt die Person vor jedem Aufruf und hat ein eigenes [Budget](/de/develop/rate-limits). + +## Die Auswirkungen eines Plans lesen {#effects} + +Das Risiko eines Plans ist das höchste aus dem Grundrisiko seiner Art und dem Risiko seiner Auswirkungen. Diese Auswirkungen können die heute bedienten Arten nennen: + +| Auswirkung | Risiko | Wann ein Plan sie nennt | +| ------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `may-lock-out-members` | critical | Die Anmeldesperre ist nach der Änderung aktiv, die Passwort-Rotation beginnt oder wird kürzer, oder die Zwei-Faktor-Authentifizierung wird strenger | +| `signs-out-members` | critical | Das Inaktivitätslimit wird eingeschaltet oder kürzer | +| `removes-human-approval` | critical | Eine Freigaberegel oder eine Prüfpflicht fragt keine Person mehr | +| `changes-serving-account` | high | Der Endpunkt eines Anbieters ändert sich, oder andere Zugangsdaten bedienen seine Anfragen | +| `breaks-dependents` | high | Die aktiven Standard-Zugangsdaten des Anbieters werden entfernt, und nichts ersetzt sie | +| `requires-empty-corpus` | critical | Das Embedding-Modell ändert sich; das setzt voraus, dass das Wissen der Organisation leer ist | +| `restart-required` | critical | Die Sandbox-Laufzeit des Deployments ändert sich | +| `reaches-vendor` | high | Der Modellkatalog eines Anbieters wird mit dem Schlüssel deiner Organisation neu eingelesen | + +Die Einstellungsreferenz, die `get_docs` für das Thema `settings` liefert (auch `tale://docs/settings`), listet das ganze Vokabular, die Felder jeder Art und jede Richtlinie. + +## Secrets {#secrets} + +Kein Secret geht in einen Einstellungsaufruf hinein oder kommt aus ihm heraus. Ein gespeichertes Secret erscheint als `{"masked": true, "preview": "…"}`, ebenso alle Zugangsdaten, die irgendwo sonst in einer gespeicherten Einstellung stehen — etwa ein Schlüssel, den jemand in Tale in eine Richtlinie eingefügt hat. Schick diesen Wert unverändert zurück, um zu behalten, was dort gespeichert ist. Eine Änderung, die ein Secret enthält, wird mit `SECRET_ARGUMENT_REFUSED` abgelehnt; die Ablehnung nennt die Stelle, nie den Wert. Ein neues Secret gibt eine Person in Tale ein. + +## Wenn eine Änderung abgelehnt wird {#refusals} + +Eine Ablehnung kommt als Daten zurück, mit `error`, `code`, `hint` und manchmal `data`, nie als abgebrochene Verbindung. Diese Codes begegnen einem Agenten am häufigsten: + +| Code | Was er bedeutet | +| ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `SETTINGS_STALE` | Die Ressource hat sich seit dem Lesen geändert. Lies sie erneut, plane gegen den aktuellen Stand und übernimm mit `data.currentHash`. | +| `SETTINGS_INVALID` | Die Konfiguration passt nicht zur Art. `data.issues` nennt jedes Problem mit seiner Stelle in der Konfiguration, auch ein Feld, das die Einstellung nicht kennt. | +| `SECRET_ARGUMENT_REFUSED` | Die Änderung enthält ein Secret. `data.places` nennt die Stelle. | +| `SETTINGS_TALE_ONLY` | Diese Änderung geht nur in Tale, zum Beispiel bei Zugangsdaten mit Schlüssel. | +| `FORBIDDEN`, `ORG_FORBIDDEN`, `FORBIDDEN_DEVELOPER_SETTINGS` | Die Rolle der Person erlaubt diese Änderung auch in Tale nicht. Ein neuer Versuch hilft nicht. | +| `EMBEDDING_CORPUS_NOT_EMPTY` | Das Embedding-Modell ändert sich nur, solange das Wissen der Organisation leer ist. `data` nennt, wie viele Dokumente und Websites es enthält. | +| `BRANDING_IMAGE_UNKNOWN` | Ein Branding-Dateiname nennt kein Bild, das in die Organisation hochgeladen wurde. | +| `PROVIDER_IN_USE`, `CREDENTIAL_IN_USE` | Zugangsdaten nennen den Anbieter noch, oder das Embedding-Modell nutzt die Zugangsdaten. Ändere zuerst diese. | + +Die Einstellungsreferenz listet jeden Code. Die Seite zum [MCP-Endpunkt](/de/develop/mcp-endpoint#settings) beschreibt die Argumente und Antworten der Tools. diff --git a/docs/de/develop/rate-limits.md b/docs/de/develop/rate-limits.md index 1d95c458c2..4383373263 100644 --- a/docs/de/develop/rate-limits.md +++ b/docs/de/develop/rate-limits.md @@ -14,7 +14,8 @@ Ein Token-Bucket füllt sich kontinuierlich bis zu seiner Burst-Kapazität auf. | Verkehr | Dauerhafte Rate | Burst | Budget gilt für | | --- | --- | --- | --- | | Allgemeine `/api/v1`-Aufrufe einschließlich MCP und Modell-Endpunkten | 120/Minute | 200 | Schlüsselinhaber | -| Laufstarts, Modellnachrichten und Aufgabenstarts | 20/Minute | 40 | Schlüsselinhaber | +| Laufstarts, Modellnachrichten, Aufgabenstarts und MCP-Ausführungen | 20/Minute | 40 | Schlüsselinhaber | +| Einstellungsänderungen über MCP (`apply_settings`) | 30/Minute | 60 | Schlüsselinhaber | | Upload-Freigabe und Dateizuordnung im Projekt | 240/Minute | 300 | Schlüsselinhaber | | Fehlgeschlagene API-Schlüsselprüfung | 20/Minute | 40 | Quell-IP | | Webhook-Zustellungen vor der Tokenprüfung | 120/Minute | 240 | Absenderadresse | @@ -24,7 +25,7 @@ REST-Ausführungen und Uploads verbrauchen zusätzlich das allgemeine Budget. Ei Zur Ausführung gehören projektgebundene und globale Automatisierungsstarts, Thread-Nachrichten und ausdrückliche Aufgabenstarts. Die Aufgabenübernahme verbraucht ebenfalls Ausführungsbudget, wenn `runWorkflowSlug` gesetzt ist. Eine Arbeit-startende Anfrage wird belastet, sobald Body und Kopfzeilen die eigenen Prüfungen der Tür bestanden haben — eine `400 INVALID_BODY` oder `INVALID_HEADER` kostet nichts — und bevor irgendetwas nachgeschlagen wird, eine `404` für einen Thread, eine Aufgabe oder eine Automatisierung, die du nicht sehen kannst, kostet also ein Token, so wie eine `409`, die der Zustand antwortet. Manche Änderungen, etwa Aufgabenkommentare und Ordneränderungen, unterliegen weiteren Fachbereichslimits, die auch für die App gelten. -MCP-Batches rechnen zusätzliche Werkzeugaufrufe als zusätzliche Anfragen ab. Der [MCP-Endpunkt](/de/develop/mcp-endpoint) erklärt den Unterschied zwischen HTTP `429` und einer einzelnen abgelehnten Batch-Nachricht. Webhooks haben getrennte Budgets; sowohl Absender- als auch Auslöserlimit müssen die Zustellung zulassen. +MCP-Batches rechnen zusätzliche Tool-Aufrufe als zusätzliche Anfragen ab. Der [MCP-Endpunkt](/de/develop/mcp-endpoint) erklärt den Unterschied zwischen HTTP `429` und einer einzelnen abgelehnten Batch-Nachricht. Ein MCP-Tool, das eine Automatisierung ausführt (`run_automation`, `test_automation`, `deploy_automation`, `run_deployed`, `start_run` und `invoke_capability`), verbraucht zusätzlich eine Ausführung, sobald die Rolle des Schlüsselinhabers den Aufruf erlaubt; ebenso `answer_run_ask`, dessen Antwort einen wartenden Lauf fortsetzt wie die Antwort über REST. Ist dieses Budget aufgebraucht, antwortet der Aufruf mit einem Tool-Ergebnis mit `code` `RATE_LIMITED`, dessen `data.retryAfterMs` die Wartezeit nennt, nicht mit HTTP `429`. Lesen, Prüfen und Speichern verbrauchen keine Ausführung. Eine Einstellungsänderung (`apply_settings`) verbraucht auf dieselbe Weise eine Einheit ihres eigenen Einstellungsbudgets und wird mit `RATE_LIMITED` beantwortet, sobald es aufgebraucht ist; Einstellungen lesen und planen verbraucht nichts davon. Webhooks haben getrennte Budgets; sowohl Absender- als auch Auslöserlimit müssen die Zustellung zulassen. Aufrufe der [Modell-Endpunkte](/de/develop/api-reference#model-endpoints) unter `/api/v1/openai` und `/api/v1/anthropic` zählen nur gegen das allgemeine Budget, jeweils als eine Anfrage, ob gestreamt oder nicht; was ein Aufruf ausgeben darf, begrenzen die Budgetregeln gesondert. Außerdem dürfen eine Person und jeder API-Schlüssel acht dieser Aufrufe gleichzeitig laufen haben: Ein neunter erhält `429` mit `code` `MODEL_API_CONCURRENCY_EXCEEDED` und `Retry-After: 2`. diff --git a/docs/de/develop/use-tale-from-your-editor.md b/docs/de/develop/use-tale-from-your-editor.md index 1ff6366be7..540bcc9faa 100644 --- a/docs/de/develop/use-tale-from-your-editor.md +++ b/docs/de/develop/use-tale-from-your-editor.md @@ -349,6 +349,36 @@ Willst du den Server über eine eingecheckte `.mcp.json` mit dem Team teilen, ve `claude mcp list` zeigt, ob Claude Code den Server erreicht. +### Prompts und Ressourcen in Claude Code {#prompts-and-resources} + +Ist der Server als `tale` eingetragen, findest du die Prompts von Tale, wenn du in Claude Code `/` tippst: `/tale:edit_automation`, `/tale:debug_failed_run` und `/tale:add_trigger`. Die Argumente folgen dem Befehl, durch Leerzeichen getrennt, etwa `/tale:debug_failed_run `. Jeder Prompt hängt an, worum es geht, und weist den Agent an, dich zu fragen, bevor etwas live geschaltet wird. + +Mit `@` erwähnst du eine Ressource von Tale, etwa `@tale:tale://runs/` für einen Lauf oder `@tale:tale://docs/triggers` für die Trigger-Referenz. Claude Code liest sie mit deinem Schlüssel und hängt sie an deine Nachricht an. [Ressourcen und Prompts](/de/develop/mcp-endpoint#resources-and-prompts) nennt jede Adresse und jeden Prompt. + +### Den Tale-Skill installieren {#tale-skill} + +Der Tale-Skill ist eine Datei `SKILL.md` im Format Agent Skills. Er bringt deinem Agent bei, wie er in Tale arbeitet: den Bearbeitungsablauf, Tests mit Mocks, Trigger, die Fehlersuche bei einem fehlgeschlagenen Lauf, das Lesen einer Ablehnung und die Regeln, an die er sich hält, etwa dich zu fragen, bevor etwas live geschaltet wird. Er gehört nicht zu den Skills deiner Organisation und nennt weder Host noch Organisation noch Schlüssel; eine Kopie genügt also für alle Projekte. Lege ihn dort ab, wo dein Agent Skills liest: + +| Agent | Dieses Projekt | Alle deine Projekte | +| --- | --- | --- | +| Claude Code | `.claude/skills/tale/SKILL.md` | `~/.claude/skills/tale/SKILL.md` | +| Codex | `.agents/skills/tale/SKILL.md` | `~/.agents/skills/tale/SKILL.md` | + +Lies ihn mit deinem Schlüssel über den MCP-Endpunkt. Das Beispiel speichert ihn für Claude Code im aktuellen Projekt; für einen anderen Agent änderst du den Ordner: + +```bash +mkdir -p .claude/skills/tale +curl --fail-with-body "$TALE_URL/api/v1/mcp" \ + --header "Authorization: Bearer $TALE_API_KEY" \ + --header "X-Organization-Slug: $TALE_ORG_SLUG" \ + --header 'MCP-Protocol-Version: 2025-11-25' \ + --header 'Content-Type: application/json' \ + --data '{"jsonrpc":"2.0","id":1,"method":"resources/read","params":{"uri":"tale://docs/skill"}}' \ + | jq -r '.result.contents[0].text' > .claude/skills/tale/SKILL.md +``` + +Ein verbundener Agent kann `tale://docs/skill` auch selbst lesen und die Datei ablegen. Der Skill passt zu der Tale-Version, aus der er stammt; hol ihn nach einem Update neu. Die Referenzen, auf die er verweist, kommen jedes Mal frisch aus deinem Deployment. + ## Skripte von einem Projektagenten bearbeiten lassen Soll die Bearbeitung in Tale geschehen, in einer Sandbox und mit Prüfung durch eine Person, übergib das Skript einem [Projektagenten](/de/platform/projects/project-agents). Tale führt dann eine Coding-Laufzeit wie OpenCode in einer Sandbox aus, mit dem Modell, das für den Agenten eingerichtet ist. Der Lauf zählt gegen die Budgets des Mitglieds, das ihn gestartet hat, und wird dieser Person zugeordnet. Einen Lauf, den du per REST startest, verbucht Tale bei dir, nicht beim API-Schlüssel. Die bearbeiteten Dateien kommen als Ergebnisse der Aufgabe zurück, und die Aufgabe wartet auf die Prüfung durch eine Person. [Eine Agent-Laufzeit wählen](/de/platform/agents/harnesses) vergleicht die Laufzeiten. OpenCode läuft nur über das Modell-Gateway von Tale und erhält daher nie einen Anbieterschlüssel. @@ -389,14 +419,14 @@ tale_api -X POST "$TALE_URL/api/v1/projects/$PROJECT_ID/tasks/$TASK_ID/comments" echo "TASK_ID=$TASK_ID" ``` -`externalSystem` und `externalId` machen die Aufgabe idempotent: Dasselbe Paar liefert beim nächsten Senden die bestehende Aufgabe. Eine Beschreibung fasst bis zu 20.000 Zeichen. Ein längeres Skript lädst du ins Projekt hoch, wie in [Eine Datei in zwei Schritten hochladen](/de/develop/api-reference#eine-datei-in-zwei-schritten-hochladen) beschrieben. Ein Agent reagiert auf seine ID und auf seinen Namen in Kleinbuchstaben, bei dem Leerzeichen durch Punkte ersetzt oder entfernt sind. `@skript-editor` funktioniert daher ebenfalls. +`externalSystem` und `externalId` machen die Aufgabe idempotent: Dasselbe Paar liefert beim nächsten Senden die bestehende Aufgabe. Eine Beschreibung fasst bis zu 20.000 Zeichen. Ein längeres Skript lädst du ins Projekt hoch, wie in [Eine Datei in zwei Schritten hochladen](/de/develop/api-reference#eine-datei-in-zwei-schritten-hochladen) beschrieben. Der Kommentar nennt den Agenten über seine ID; sein `handle` funktioniert ebenso, hier `@skript-editor`, und steht in den Angaben, die du über den Agenten liest. Tale speichert beides als Erwähnung des Agenten selbst, der Kommentar nennt ihn also auch nach einer Umbenennung. Liest du den Kommentar zurück, lautet sein `body` `[@Skript-Editor](mention:agent/) bitte übernimm diese Aufgabe.` und sein `bodyText` `@Skript-Editor bitte übernimm diese Aufgabe.` Die Erwähnung weist dem Agenten die Aufgabe zu und startet einen Lauf; die Aufgabe wechselt auf `in_progress`. Kann eine Erwähnung keinen Lauf starten, bleibt sie ein gewöhnlicher Kommentar ohne Fehlermeldung, etwa wenn du die Aufgabe nicht ändern darfst, die Aufgaben-Automatisierung ausgeschaltet ist oder ein anderer Lauf die Aufgabe bereits belegt. Setze `TASK_ID` auf den Wert, den das Skript ausgegeben hat, prüfe die Aufgabe und lies den Bericht des Agenten, sobald sie `in_review` erreicht: ```bash tale_api "$TALE_URL/api/v1/projects/$PROJECT_ID/tasks/$TASK_ID" | jq -r '.task.status' tale_api "$TALE_URL/api/v1/projects/$PROJECT_ID/tasks/$TASK_ID/comments?limit=20" \ - | jq -r '.comments[] | select(.authorType == "agent") | .body' + | jq -r '.comments[] | select(.authorType == "agent") | .bodyText' ``` Prüfe die bearbeiteten Dateien in den Ergebnissen der Aufgabe in der App, bevor du die Aufgabe freigibst. Sollen noch Änderungen folgen, schreib einen weiteren Kommentar, der den Agenten erwähnt. diff --git a/docs/de/develop/webhooks.md b/docs/de/develop/webhooks.md index cc6761077b..8ca4589df2 100644 --- a/docs/de/develop/webhooks.md +++ b/docs/de/develop/webhooks.md @@ -42,7 +42,7 @@ Die Annahme liefert HTTP `202` mit der Form `{"runId":"..."}`. Speichere die Lau } ``` -Lies die Bestellung über `input.payload.orderId`. Ein deklariertes `inputs`-Schema muss diese Hülle beschreiben. Ein Body ohne gültiges JSON wird als Text in `payload` übergeben. Die Grenze beträgt 256 KiB (262.144 Bytes), während des Empfangs gezählt; größere Anfragen erhalten `413`. +Lies die Bestellung über `input.payload.orderId`. Ein deklariertes `inputs`-Schema muss diese Hülle beschreiben. Hat der Trigger eine feste Eingabe, stehen ihre Felder in der Eingabe jeder Zustellung neben `trigger` und `payload`; du legst sie in den [Trigger-Einstellungen](/de/platform/automations/triggers#feste-eingabe) der App fest, die API nimmt sie als `input`. Ein Body ohne gültiges JSON wird als Text in `payload` übergeben. Die Grenze beträgt 256 KiB (262.144 Bytes), während des Empfangs gezählt; größere Anfragen erhalten `413`. ### Das Ergebnis verfolgen @@ -53,6 +53,8 @@ Lies die Bestellung über `input.payload.orderId`. Ein deklariertes `inputs`-Sch Frage mit einem API-Schlüssel ab, dessen Inhaber den Bereich lesen darf, oder öffne den Lauf in Tale. Das Webhook-Token erlaubt Zustellungen, aber keine REST-Ergebnisabfragen. Melde den Vorgang erst als erfolgreich, wenn der Lauf einen entsprechenden Endstatus erreicht hat. +In der App listet **Letzte Zustellungen** unter dem Trigger im Tab **Allgemein** der Automatisierung die letzten zehn Läufe, die der Webhook gestartet hat, die neuesten zuerst, mit ihrem Status. Solange sich Tale an eine Zustellung erinnert, nennt jede Zeile den Header, aus dem die Zustell-ID stammt, oder sagt, dass es keine gibt. Abgelehnte Anfragen starten keinen Lauf und stehen dort nicht; ihre Antwort ist der Beleg. + ### Antworten auf Zustellungen auswerten | Status | Code/Ergebnis | Nächster Schritt | diff --git a/docs/de/platform/admin/connectors.md b/docs/de/platform/admin/connectors.md index 4123b085a9..f214312f6c 100644 --- a/docs/de/platform/admin/connectors.md +++ b/docs/de/platform/admin/connectors.md @@ -47,7 +47,7 @@ Das Löschen von Zugangsdaten entzieht abhängigen Automatisierungen und Agenten ## Eine OAuth-App vorbereiten -Unter **OAuth-Apps** am Seitenende konfigurieren Inhaber und Admins die Anbieter-Apps, über die Mitglieder den Zugriff freigeben. Eine organisationsspezifische App hat Vorrang vor der Bereitstellungs-App. Fehlen beide, kann der Connector keine Anmeldung starten. Die Seite zeigt den fehlenden Einrichtungsstand an. +Unter **OAuth-Apps** am Seitenende konfigurieren Inhaber und Admins die Anbieter-Apps, über die Mitglieder den Zugriff freigeben. Eine organisationsspezifische App hat Vorrang vor der Bereitstellungs-App. Fehlen beide, kann der Connector keine Anmeldung starten. Die Seite zeigt den fehlenden Einrichtungsstand an. Kann Tale nicht prüfen, ob eine App für den Wissens-Import eingerichtet ist, zeigt ihre Zeile **Status nicht verfügbar** ohne **Einrichten**, und **Erneut versuchen** startet die Prüfung neu. Du kannst die App einrichten, sobald die Prüfung klappt. Wähle **Einrichten**, gib Client-ID und Geheimnis des Anbieters ein und registriere dort exakt die im Dialog gezeigten Weiterleitungsadressen. Microsoft-Apps benötigen gegebenenfalls auch die Verzeichnis- oder Mandanten-ID. Bei späteren Änderungen lässt du ein gespeichertes Geheimnis leer, um es beizubehalten. diff --git a/docs/de/platform/admin/governance/audit-logs.md b/docs/de/platform/admin/governance/audit-logs.md index 28afe787e5..b62c3c1785 100644 --- a/docs/de/platform/admin/governance/audit-logs.md +++ b/docs/de/platform/admin/governance/audit-logs.md @@ -26,7 +26,8 @@ Aktiver Tab und Kategorie stehen in der URL. Du kannst die Ansicht deshalb als L | --- | --- | | Zeitstempel | Wann Tale die Aktion protokolliert hat. | | Aktion | Welcher Vorgang versucht oder abgeschlossen wurde. Manche neueren Aktionen erscheinen mit ihrem technischen Namen. | -| Benutzer | Welche Person oder welcher Systemakteur verantwortlich war. | +| Benutzer | Die verantwortliche Person oder der Systemakteur. Bei einem Schreibzugriff mit einem API-Schlüssel nennt Benutzer die Person, die den Schlüssel erstellt hat; der Akteurtyp ist API. Handelt der Schlüssel für ein Mitglied, enthalten die Metadaten dessen ID unter `keyAttribution.subjectUserId`. JSON-Exporte behalten auch die Schlüssel-ID (`apiKeyId`); CSV enthält weder Schlüssel- noch Subjektmetadaten. | +| Quelle und Client | Nur bei einer Aktion, die ein Coding-Agent über den [MCP-Endpoint](/de/develop/mcp-endpoint) ausgeführt hat. **Quelle** zeigt Coding-Agent, und **Client** nennt die App des Agents, wenn sie sich bei jedem Aufruf nennt, wie es Apps mit der MCP-Revision 2026-07-28 tun; eine App mit einer früheren Revision nennt sich nur beim Verbinden, deshalb zeigen ihre Ereignisse keinen **Client**. **Benutzer** nennt die Person, die den Schlüssel erstellt hat; das Mitglied, für das er handelt, steht in den Metadaten. | | Ressource und Ziel | Um welche Art von Eintrag und welchen konkreten Datensatz es geht. | | Kategorie | Welche Gruppe der Filter verwendet. | | Status | Erfolg, Fehler oder abgelehnt. | diff --git a/docs/de/platform/admin/governance/data-subject-requests.md b/docs/de/platform/admin/governance/data-subject-requests.md index d9ffbb4e9a..cc72fcc91a 100644 --- a/docs/de/platform/admin/governance/data-subject-requests.md +++ b/docs/de/platform/admin/governance/data-subject-requests.md @@ -20,6 +20,8 @@ Als Admin oder Inhaber bearbeitest du unter **Einstellungen > Richtlinien > Anfr Die Löschung entfernt betroffene Daten endgültig; sie verschiebt sie nicht in den Papierkorb. Der Beleg erfasst Kategorien und Anzahlen, darunter Chats, Dokumente und Uploads, Einstellungen, Feedback, Benachrichtigungen, Nutzung und das Bereinigen von Personenkennungen im Audit-Protokoll. Die Löschung entfernt außerdem die getrennten Sandbox-Arbeitsbereiche der [Agentenläufe, die die Person gestartet hat](/de/platform/projects/tasks#agentenlaeufe-die-ein-mitglied-startet), auch wenn darin noch Arbeit läuft; der Beleg zählt sie unter **Sandbox-Arbeitsbereiche**. Ein Arbeitsbereich zählt erst, wenn der Sandbox-Dienst seine Dateien gelöscht hat, was bei einem großen eine Weile dauern kann. Bis dahin, oder solange das Löschen wiederholt fehlschlägt, lautet der Beleg **Teilweise** und nennt `sandboxWorkspaces` unter den fehlgeschlagenen Durchläufen; wähle später **Erneut versuchen**, und die Löschung wird abgeschlossen, sobald die Dateien entfernt sind. Unter Kubernetes zählt ein Arbeitsbereich, sobald sein Volume an den Storage-Provisioner des Clusters übergeben ist; mit einer StorageClass, deren `reclaimPolicy` `Retain` ist, bleiben die Dateien des Volumes, bis ein Operator das Volume entfernt, obwohl der Beleg den Arbeitsbereich zählt. Ein Sandbox-Dienst oder Gerät, das noch nicht auf diese Version aktualisiert ist, kann die Löschung nicht bestätigen; der Beleg bleibt dann **Teilweise**, bis es aktualisiert ist. +Die Kategorie **Modellanfragen** umfasst Anfragen an die Modell-API und direkte Modellaufrufe in Automationen. Abgerechnete Anfragen werden entfernt. Eine noch laufende Anfrage behält die Daten, die für ihre Abrechnung nötig sind; die Identität der Person wird durch ein Pseudonym ersetzt. Spätere Nutzung wird unter diesem Pseudonym verbucht. Schlägt das Entfernen des Automationslaufs oder der Identität fehl, bleibt der Beleg **Teilweise** und die davon abhängige Bereinigung der Nutzungsdaten wartet auf einen neuen Versuch. + Aufgaben, die die Person als **Reviewer** nennen, verlieren diese Zuweisung. Eine Prüfanfrage, die noch auf sie wartet, geht an die erste berechtigte Person der Ersatzfolge: den Ersteller der Aufgabe oder des Projekts. Diese Person wird benachrichtigt. Bei einer archivierten Aufgabe geht die Prüfanfrage ohne Benachrichtigung weiter. Prüfentscheidungen, die die Person bereits getroffen hat, bleiben ohne ihren Namen erhalten. ## Vorher die Richtlinie prüfen @@ -46,6 +48,8 @@ Nur der Inhaber kann diese Richtlinie ändern. Strengere Schutzmaßnahmen gelten Ein offener Beleg kann eine zweite Anfrage für dieselbe Person verhindern. Arbeite mit diesem Beleg weiter. War die Anfrage schon bei der Einreichung blockiert, muss ein neuer Versuch erneut die aktuelle Freigabe- und Wartezeitregel erfüllen. Ein Beleg, der auf Freigabe wartet, behält die bei der Einreichung festgehaltene Freigabepflicht: Schaltest du das Vier-Augen-Prinzip später aus, gibt ihn das nicht frei. +Automationsläufe, die bei einem Upgrade zurückgehalten wurden, bleiben erhalten, solange ihre früheren externen Aktionen nicht überprüft sind. Die Löschung entfernt weiterhin die anderen geeigneten Automationsläufe der Person und weist gelöschte und aufbewahrte Läufe getrennt aus. Der Beleg bleibt teilweise abgeschlossen. Diese Ausführungssperren sind von Legal Holds unabhängig und können derzeit nicht aufgehoben werden. Eine Stopp-Anfrage oder ein erneuter Löschversuch hebt sie nicht auf. Eine Organisation mit solchen Sperren kann ebenfalls nicht gelöscht werden. + ## Die Frist verwalten Die Liste zeigt die erfasste Frist und mögliche Überschreitungen. Nutze **Frist verlängern** für eine begründete Verlängerung, solange die Aktion verfügbar ist. Die Anwendung erlaubt eine Verlängerung vor Ablauf der ursprünglichen Frist und protokolliert Grund und Admin. diff --git a/docs/de/platform/admin/governance/policies-and-limits.md b/docs/de/platform/admin/governance/policies-and-limits.md index 04096e4d02..91ebb7c3e3 100644 --- a/docs/de/platform/admin/governance/policies-and-limits.md +++ b/docs/de/platform/admin/governance/policies-and-limits.md @@ -16,24 +16,30 @@ Als Admin oder Inhaber steuerst du unter **Einstellungen > Richtlinien > Richtli 1. Wähle unter **Budgetregeln** die Aktion **Regel hinzufügen**. 2. Wähle Bereich und Ziel. Nutze eine Rolle für eine Gruppe wie Redakteure, ein Team für gemeinsame Arbeit, ein Projekt für alles, was in einem Projekt ausgegeben wird, eine Person für ein individuelles Limit, einen API-Schlüssel für einzelne Zugangsdaten oder die Organisation für eine gemeinsame Obergrenze. Die Liste der API-Schlüssel enthält jeden aktiven Schlüssel, der in der Organisation gilt, mit dem Namen dessen, dem er gehört: den eigenen Schlüssel eines Mitglieds, einen Schlüssel, den ein Admin für ein Mitglied erstellt hat, und die Schlüssel eines Teams, eines Projekts oder der Organisation selbst. So begrenzt du das Skript oder Coding-Tool einer einzelnen Person oder die Integration eines Teams. 3. Wähle einen täglichen, wöchentlichen oder monatlichen Zeitraum. Setze mindestens ein positives Token-, Kosten- oder Anfragelimit. Kosten gibst du in USD an; ein leeres Feld begrenzt diese Größe durch die Regel nicht. -4. Setze bei Bedarf **Warnschwelle (%)** zwischen 0 und 100, um vor Erreichen des Limits zu warnen. Ein Projektbudget hat keine Warnschwelle. +4. Setze bei Bedarf **Warnschwelle (%)** zwischen 0 und 100, um vor Erreichen des Limits zu warnen. Die Warnung eines Projektbudgets sehen alle, die im Projekt chatten. 5. Wähle **Bestätigen**, speichere die ausstehenden Seitenänderungen und prüfe Bereich, Ziel, Zeitraum und Limits der gespeicherten Regel. Eine monatliche Rollenregel könnte Redakteuren beispielsweise ein persönliches Ausgabenlimit von 50 USD geben, während eine Organisationsregel die gemeinsamen Ausgaben auf 500 USD begrenzt. Das sind Beispielbeträge, keine empfohlenen Standardwerte. Eine Regel bleibt in der Tabelle, auch wenn ihr API-Schlüssel nicht mehr funktioniert. **Ziel** nennt weiterhin den Schlüssel und seine Inhaberin oder seinen Inhaber. Der Status lautet **Abgelaufen**, solange der abgelaufene Schlüssel noch gespeichert ist, **Deaktiviert**, **Widerrufen**, wenn diese Organisation den Widerruf protokolliert hat, oder **Ehemaliges Mitglied**, wenn die Person die Organisation verlassen hat. **Nicht verfügbar** bedeutet, dass der Schlüssel bekannt ist, aber ohne protokollierten Grund nicht mehr gespeichert ist; das kann nach der Bereinigung abgelaufener Schlüssel passieren. **Unbekannter Schlüssel** kennzeichnet einen Schlüssel, zu dem diese Organisation keine Angaben hat. Entferne eine solche Regel, oder bearbeite sie und wähle einen aktiven Schlüssel. -Budgets gelten für neue kostenpflichtige Arbeit, einschließlich Chat, Sprachausgabe, verwalteter Agentenläufe, der `llm`-Schritte von Automatisierungen, der Bilder, die Agenten erstellen, und der Aufrufe der Modell-Endpunkte. Tale prüft jede Chat-Anfrage, bevor sie läuft — eine gesendete Nachricht, eine neu erzeugte oder bearbeitete Antwort, beide Seiten eines Modellvergleichs, eine Nachricht, die auf einen Anhang wartet, und ein Senden über die REST-API — und lehnt sie ab, sobald eine zutreffende Grenze erreicht ist. Die Ablehnung nennt die Grenze und wann sie zurückgesetzt wird. Antworten, die noch geschrieben werden, halten fest, was sie verbrauchen können, damit gleichzeitig gesendete Anfragen eine fast erreichte Grenze nicht gemeinsam überschreiten. Die Bildanfrage eines Agenten wird ebenso geprüft, bevor das Bildmodell aufgerufen wird: Solange ihre Bilder entstehen, hält sie geschätzte Kosten fest, und die Prüfung zählt auch mit, was der eigene Lauf des Agenten noch für sein Modell ausgeben kann. Jedes Bild zählt als eine Anfrage. Die Bildgenerierung braucht Kosten- oder Anfragelimits, weil ihre Nutzung nicht in Text-Tokens gemessen wird. Ein Tokenlimit zählt Eingabe- und Ausgabetokens, und zur Eingabe gehört auch der Teil eines Prompts, den ein Anbieter aus seinem Cache gelesen oder dort abgelegt hat. Dieser Teil wird anders berechnet als die übrige Eingabe, deshalb kann ein Agent, der einen langen Prompt wiederverwendet, ein Tokenlimit erreichen, während seine Kosten niedrig bleiben. Untersuche Warnungen in der [Nutzungsanalyse](/de/platform/admin/governance/usage-analytics). +Budgets gelten für neue kostenpflichtige Arbeit, einschließlich Chat, Sprachausgabe, Transkriptionen und Diktat, Indexierung und Suche im Wissen, verwalteter Agentenläufe, der `llm`-Schritte von Automatisierungen, von **Mit KI verbessern** im Posteingang, der Bilder, die Agenten erstellen, und der Aufrufe der Modell-Endpunkte. Tale prüft jede Chat-Anfrage, bevor sie läuft — eine gesendete Nachricht, eine neu erzeugte oder bearbeitete Antwort, beide Seiten eines Modellvergleichs, eine Nachricht, die auf einen Anhang wartet, und ein Senden über die REST-API — und lehnt sie ab, sobald eine zutreffende Grenze erreicht ist. Die Ablehnung nennt die Grenze und wann sie zurückgesetzt wird. Antworten, die noch geschrieben werden, halten Runde für Runde fest, was sie verbrauchen können, ebenso entstehende Sprachausgabe, der `llm`-Schritt einer Automatisierung, der Titel eines Chats, **Mit KI verbessern**, eine Transkription und jede Embedding-Anfrage der Indexierung und Suche im Wissen, damit gleichzeitig gesendete Anfragen eine fast erreichte Grenze nicht gemeinsam überschreiten. Die Bildanfrage eines Agenten wird ebenso geprüft, bevor das Bildmodell aufgerufen wird: Solange ihre Bilder entstehen, hält sie geschätzte Kosten fest, und die Prüfung zählt auch mit, was der eigene Lauf des Agenten noch für sein Modell ausgeben kann. Jedes Bild zählt als eine Anfrage. Die Bildgenerierung braucht Kosten- oder Anfragelimits, weil ihre Nutzung nicht in Text-Tokens gemessen wird. Ein Connector-Aufruf — ein Such- oder Web-Werkzeug des Assistenten, der Connector-Schritt eines Agenten oder einer Automatisierung, eine aus dem Posteingang gesendete E-Mail — wird für sich gezählt und nie auf ein Anfragelimit angerechnet. Ein Zug eines verwalteten Agenten auf einem Anbieter-Abonnement zählt als eine Anfrage ohne Kosten: Anfrage- und Tokenlimits gelten für ihn, Kostenlimits nicht. Ein Tokenlimit zählt Eingabe- und Ausgabetokens, und zur Eingabe gehört auch der Teil eines Prompts, den ein Anbieter aus seinem Cache gelesen oder dort abgelegt hat. Dieser Teil wird anders berechnet als die übrige Eingabe, deshalb kann ein Agent, der einen langen Prompt wiederverwendet, ein Tokenlimit erreichen, während seine Kosten niedrig bleiben. Untersuche Warnungen in der [Nutzungsanalyse](/de/platform/admin/governance/usage-analytics). + +Sprachausgabe reserviert während eines laufenden Versuchs die geschätzten Kosten und eine Anfrage. Der `llm`-Schritt einer Automatisierung reserviert die geschätzte Eingabe und die erlaubte Ausgabe zum Katalogpreis sowie eine Anfrage. Diese Reservierungen zählen zusammen mit Chats und verwalteten Agenten gegen die jeweils geltenden Limits. Es sind Schätzwerte, keine Garantie für die endgültige Abrechnung des Anbieters. + +Scheitert ein bereits reservierter Sprachversuch oder bleibt sein Ergebnis unbekannt, erfasst Tale den gespeicherten Schätzwert und eine Anfrage genau einmal, auch wenn der Fehler vor dem Anbieteraufruf auftrat. Für einen direkten Modellaufruf einer Automatisierung mit unbekanntem Ergebnis bucht Tale ebenfalls den reservierten Schätzwert. Diese vorsichtige Abrechnung bestätigt keine tatsächliche Belastung durch den Anbieter. Ein erneuter Versuch braucht eine neue Reservierung und muss einschließlich des vorherigen Schätzwerts ins Budget passen. ## Verstehen, welche Grenzen gelten Persönliche Limits werden für jede Größe aus der spezifischsten Regel ermittelt, die sie festlegt: zuerst Person, dann Team, Rolle und Standard. Gehört jemand mehreren Teams mit einer Regel an, gilt für die Person die strengste dieser Grenzen. Organisationslimits gelten zusätzlich. Ein Teambudget begrenzt auch die gemeinsame Nutzung der aktuellen Teammitglieder, selbst wenn ein Mitglied eine spezifischere persönliche Regel hat: Die Nutzung eines neuen Mitglieds im laufenden Zeitraum zählt sofort, die eines ausgetretenen Mitglieds nicht mehr. API-Schlüssellimits begrenzen unabhängig die mit diesem Schlüssel authentifizierten Anfragen, deren Nutzung dem Schlüssel angerechnet wird, nicht andere Arbeit in der Oberfläche. Der eigene Schlüssel eines Teams, eines Projekts oder der Organisation ist keine Person: Für ihn gilt keine Personen-, Rollen- oder Standardregel. Die Limits der Organisation und ihre API-Schlüsselregeln gelten, der Schlüssel eines Teams zählt für das Budget seines Teams und wird von ihm begrenzt, und der Schlüssel eines Projekts ebenso für das Budget seines Projekts. -Ein Projektbudget begrenzt alles, was in einem Projekt ausgegeben wird, egal von wem: die Chats des Projekts mit ihren Titeln, den vorgelesenen Antworten und den Tool-Aufrufen des Assistenten; die Läufe seiner Agenten und die Agenten- und `llm`-Schritte der Automatisierungen, die darin laufen, mit den Bildern, die sie erstellen; und die Aufrufe mit den eigenen API-Schlüsseln des Projekts. Es gilt zusätzlich zu den Limits dessen, der die Arbeit angestoßen hat, auch für Läufe, die ein Zeitplan gestartet hat, und nie für Arbeit außerhalb des Projekts. Chatantworten und Agentenzüge, die im Projekt noch laufen, halten auch im Projektbudget fest, was sie verbrauchen können, damit gleichzeitig gesendete Anfragen ein fast erreichtes Projektbudget nicht gemeinsam überschreiten. Lehnt es eine Chatnachricht ab, sagt Tale, dass das Limit des Projekts erreicht ist. Transkribierte Aufnahmen zählen nicht für ein Projekt, und ein Projektbudget warnt niemanden, bevor es erreicht ist. Eine Automatisierung zählt für das Projekt, in dem sie läuft. Ein Lauf ohne eigenes Projekt, von einer Automatisierung, die in mehreren Projekten installiert ist, zählt für jedes davon und muss in jedes Projektbudget passen, so wie die Nutzung eines Mitglieds für jedes seiner Teams zählt; eine Automatisierung, die in keinem Projekt installiert ist, zählt nur für die Organisation. +Ein Projektbudget begrenzt alles, was in einem Projekt ausgegeben wird, egal von wem: die Chats des Projekts mit ihren Titeln, den vorgelesenen Antworten, den darin transkribierten Aufnahmen und den Tool-Aufrufen und Suchen des Assistenten; die dafür indexierten Dateien; die Läufe seiner Agenten und die Agenten- und `llm`-Schritte der Automatisierungen, die darin laufen, mit den Bildern, die sie erstellen; und die Aufrufe mit den eigenen API-Schlüsseln des Projekts. Es gilt zusätzlich zu den Limits dessen, der die Arbeit angestoßen hat, auch für Läufe, die ein Zeitplan gestartet hat, und nie für Arbeit außerhalb des Projekts. Laufende Chatantworten und ihre Titel, Agentenzüge, Sprachversuche, Transkriptionen und Modellaufrufe von Automatisierungen reservieren ihre zugelassene Nutzung auch im Projektbudget, sodass gleichzeitige Anfragen diese Reservierungen berücksichtigen. Lehnt es eine Chatnachricht ab, sagt Tale, dass das Limit des Projekts erreicht ist. Mit einer Warnschwelle sehen alle, die im Projekt chatten, wie viel vom Budget noch übrig ist, sobald die Nutzung die Schwelle überschreitet, in einem Banner, das das Projekt nennt. Eine Automatisierung zählt für das Projekt, in dem sie läuft. Ein Lauf ohne eigenes Projekt, von einer Automatisierung, die in mehreren Projekten installiert ist, zählt für jedes davon und muss in jedes Projektbudget passen, so wie die Nutzung eines Mitglieds für jedes seiner Teams zählt; eine Automatisierung, die in keinem Projekt installiert ist, zählt nur für die Organisation. + +Chatantworten, Sprachversuche und Modellaufrufe von Automatisierungen behalten die Projekte, die bei ihrer Zulassung erfasst wurden. Verschiebst du den Chat oder änderst du während der Ausführung die Projektinstallationen einer Automatisierung, bleiben Reservierung und spätere Buchung den ursprünglichen Projekten zugeordnet. Ein Versuch, der ohne Projekt zugelassen wurde, bleibt außerhalb der Projektbudgets. -![Der Dialog Budgetregel hinzufügen mit dem Bereich Projekt, dem Projekt Website relaunch, einem monatlichen Zeitraum und maximalen Kosten von 200 USD; Token- und Anfragelimit bleiben leer, und für ein Projekt wird keine Warnschwelle angeboten.](/images/platform/governance-budget-project-rule.webp) +![Der Dialog Budgetregel hinzufügen mit dem Bereich Projekt, dem Projekt Website relaunch, einem monatlichen Zeitraum und maximalen Kosten von 200 USD; Token- und Anfragelimit bleiben leer, ebenso die Warnschwelle, deren Hinweis sagt, dass alle, die im Projekt chatten, ihre Warnung sehen.](/images/platform/governance-budget-project-rule.webp) diff --git a/docs/de/platform/admin/governance/usage-attribution.md b/docs/de/platform/admin/governance/usage-attribution.md index 0b09cb3a44..c9886e87c8 100644 --- a/docs/de/platform/admin/governance/usage-attribution.md +++ b/docs/de/platform/admin/governance/usage-attribution.md @@ -7,7 +7,9 @@ Jede KI-Anfrage, die Tale für deine Organisation stellt, wird einmal erfasst, e ## Was als Nutzung zählt -Tale erfasst eine Anfrage, sobald ein Modell oder ein gemessener Dienst für deine Organisation läuft: eine Chatantwort, auch eine neu erzeugte oder bearbeitete und beide Seiten eines Modellvergleichs; der kurze Modellaufruf, der einem neuen Chat seinen Titel gibt; der Modellaufruf eines `llm`-Schritts einer Automatisierung; ein Zug eines verwalteten Agenten, der an einer Aufgabe oder in einer Automatisierung arbeitet; ein Bild, das ein solcher Agent erstellt; Sprachausgabe; die Transkription einer hochgeladenen Aufnahme; ein gemessener Connector-Aufruf; und ein Aufruf der Modell-Endpunkte mit einem API-Schlüssel. Jeder Eintrag enthält die verbrauchten Tokens oder Einheiten und die Kosten, die zu diesem Zeitpunkt aus dem Listenpreis des Anbieters geschätzt wurden; bei einem Aufruf der Modell-Endpunkte sind es die Kosten, die das Modell-Gateway gemessen hat. +Tale erfasst eine Anfrage, sobald ein Modell oder ein gemessener Dienst für deine Organisation läuft: eine Chatantwort, auch eine neu erzeugte oder bearbeitete und beide Seiten eines Modellvergleichs; der kurze Modellaufruf, der einem neuen Chat seinen Titel gibt; eine Umformulierung mit **Mit KI verbessern** im Posteingang; der Modellaufruf eines `llm`-Schritts einer Automatisierung; ein Zug eines verwalteten Agenten, der an einer Aufgabe oder in einer Automatisierung arbeitet; ein Bild, das ein solcher Agent erstellt; Sprachausgabe; die Transkription einer hochgeladenen Aufnahme oder eines Diktats; die Embeddings, mit denen Wissen indexiert wird und die jede Wissenssuche anfragt; und ein Aufruf der Modell-Endpunkte mit einem API-Schlüssel. Jeder Eintrag enthält die verbrauchten Tokens oder Einheiten — bei einer Transkription die Minuten Audio — und die Kosten, die zu diesem Zeitpunkt aus dem Listenpreis des Anbieters geschätzt wurden; bei einem Aufruf der Modell-Endpunkte sind es die Kosten, die das Modell-Gateway gemessen hat. + +Tale zählt außerdem jeden Aufruf, den es über einen Connector macht — die Such- und Web-Werkzeuge des Assistenten, den Connector-Schritt eines Agenten oder einer Automatisierung, eine aus dem Posteingang gesendete E-Mail — als Connector-Aufruf, ohne Kosten. Ein Connector-Aufruf ist nie eine Anfrage: Anfragelimits zählen nur Modellanfragen. ## Wem eine Anfrage angerechnet wird @@ -16,18 +18,22 @@ Die Regel ist überall dieselbe: Eine Anfrage zählt für die Person, die die Ar | Arbeit | Zählt für | Zählt zusätzlich für | Erscheint in der Nutzungsanalyse als | | --- | --- | --- | --- | | Eine Chatantwort oder der Titel eines neuen Chats | Das Mitglied, das die Nachricht gesendet hat | Den API-Schlüssel, wenn die Nachricht über die REST-API kam | Der verwendete Assistent; ein Titel unter `thread-title` | -| Ein Agentenlauf zu einer Aufgabe | Das Mitglied, das den Lauf aus der Aufgabe gestartet hat oder mit einem Kommentar oder einer Aufgabenbeschreibung, die den Agenten erwähnt; bei einem Lauf, den ein anderer Agent oder ein Automatisierungsschritt gestartet hat, das Mitglied, für das der Lauf dieses Agenten oder dieser Automatisierung zählt | — | Der Name des Agenten unter **Top-Assistenten** | +| Eine Umformulierung mit **Mit KI verbessern** im Posteingang | Das Mitglied, das sie angefordert hat | — | `inbox-improve` unter **Top-Assistenten** | +| Ein Agentenlauf zu einer Aufgabe | Das Mitglied, das den Lauf aus der Aufgabe gestartet hat oder mit einem Kommentar oder einer Aufgabenbeschreibung, die den Agenten erwähnt; bei einem Lauf, den ein anderer Agent oder ein Automatisierungsschritt gestartet hat, das Mitglied, für das der Lauf dieses Agenten oder dieser Automatisierung zählt | Der API-Schlüssel, wenn der Lauf mit einem gestartet wurde: über die REST-API oder durch einen Schritt eines Automatisierungslaufs, der mit einem gestartet wurde | Der Name des Agenten unter **Top-Assistenten** | | Ein Automatisierungslauf, den jemand gestartet hat | Das Mitglied, das ihn aus der Laufliste, dem Builder, einem Chat, einer Aufgabe, über die REST-API oder den MCP-Endpoint gestartet hat | Den API-Schlüssel, wenn der Lauf mit einem gestartet wurde | Der Name der Automatisierung unter **Top-Assistenten** | | Ein Automatisierungslauf, den ein Trigger gestartet hat | Niemanden: Hinter einem Zeitplan, einem Webhook oder einem Ereignis steht keine Person | — | Die Zeile **Automatisierungen (Trigger)** unter **Nutzung pro Benutzer** | | Ein Lauf eines Projektagenten, den ein Zeitplan begonnen hat, oder einer, den ein anderer Agent aus einem solchen Lauf heraus gestartet hat | Niemanden, wie beim Lauf, den der Zeitplan selbst gestartet hat | — | Die Zeile **Automatisierungen (Trigger)** unter **Nutzung pro Benutzer** und der Name des Agenten unter **Top-Assistenten** | | Ein Bild, das ein Agent erstellt | Die Person, für die der Lauf des Agenten zählt: wer ihn gestartet hat, bei einem Trigger-Lauf niemand | Den API-Schlüssel, wenn der Lauf mit einem gestartet wurde | Der Name des Agenten oder der Automatisierung unter **Top-Assistenten** und das Bildmodell unter **Top-Modelle** | -| Sprachausgabe oder eine Transkription | Das Mitglied, das sie angefordert hat | — | **Sprachausgabe** oder **Transkription** unter **Top-Assistenten**; Sprachausgabe zusätzlich unter **Top-Sprachmodelle** | -| Ein gemessener Connector-Aufruf | Das Mitglied, dessen Anfrage den Aufruf ausgelöst hat | — | Der Assistent, der ihn gemacht hat, oder **Connector** | +| Sprachausgabe oder eine Transkription | Das Mitglied, das sie angefordert hat; bei der Transkription einer Aufnahme, wer die Aufnahme hinzugefügt hat, auch bei einem erneuten Versuch | — | **Sprachausgabe** oder **Transkription** unter **Top-Assistenten**; Sprachausgabe zusätzlich unter **Top-Sprachmodelle** | +| Indexierung und Suche im Wissen (Embeddings) | Indexierung: das Mitglied, das die Datei hinzugefügt hat — wem ein synchronisiertes Laufwerk gehört —, oder die Organisation bei einem E-Mail-Anhang, einer eingehenden E-Mail und einem Website-Scan, den ein Zeitplan gestartet hat. Eine Suche: das suchende Mitglied | Der API-Schlüssel, mit dem eine Suche oder eine über die API hinzugefügte Website kam | **Wissensindexierung und -suche** unter **Top-Assistenten** | +| Ein Connector-Aufruf: ein Such- oder Web-Werkzeug des Assistenten, der Connector-Schritt eines Agenten oder einer Automatisierung, eine aus dem Posteingang gesendete E-Mail | Das Mitglied, das ihn gemacht hat; beim Schritt eines Agenten oder einer Automatisierung, wem dessen Lauf angerechnet wird; bei einer E-Mail das Mitglied, das sie gesendet hat | Der API-Schlüssel, mit dem er kam | Nicht als Anfrage: Connector-Aufrufe werden getrennt gezählt und erhöhen keine Anfragezahl | | Ein Aufruf der [Modell-Endpunkte](/de/develop/use-tale-from-your-editor#model-endpoints) | Das Mitglied, dessen API-Schlüssel ihn gesendet hat | Den API-Schlüssel | **Direkter API-Aufruf** unter **Top-Assistenten** | -Ein erneuter Versuch eines Agentenlaufs führt den Lauf fort, den sein Starter angestoßen hat; seine Nutzung bleibt deshalb bei dieser Person. Handelt eine Integration mit einem API-Schlüssel für ein anderes Mitglied, zählt der Lauf für dieses Mitglied, und das Limit des Schlüssels zählt ihn ebenfalls. +Ein erneuter Versuch eines Agentenlaufs führt den Lauf fort, den sein Starter angestoßen hat; seine Nutzung bleibt deshalb bei dieser Person und bei dem API-Schlüssel, mit dem der Lauf gestartet wurde. Startet ein Kommentar, der einen arbeitenden Agenten erwähnt, dessen Durchgang neu, zählt der Rest dieses Durchgangs für die Person, die den Kommentar geschrieben hat, und für den API-Schlüssel, mit dem er geschrieben wurde. Handelt eine Integration mit einem API-Schlüssel für ein anderes Mitglied, zählt der Lauf für dieses Mitglied, und das Limit des Schlüssels zählt ihn ebenfalls. + +Arbeit in einem Projekt zählt zusätzlich für dieses Projekt, egal wer sie angestoßen hat: die Chats des Projekts mit ihren Titeln, den vorgelesenen Antworten, den darin transkribierten Aufnahmen und den Tool-Aufrufen und Suchen des Assistenten; die dafür indexierten Dateien; die Läufe seiner Agenten und die Agenten- und `llm`-Schritte der Automatisierungen, die darin laufen, mit den Bildern, die sie erstellen; und die Aufrufe mit den eigenen API-Schlüsseln des Projekts. Ein Lauf ohne eigenes Projekt, von einer Automatisierung, die in mehreren Projekten installiert ist, zählt für jedes davon; eine Automatisierung, die in keinem Projekt installiert ist, zählt nur für die Organisation. -Arbeit in einem Projekt zählt zusätzlich für dieses Projekt, egal wer sie angestoßen hat: die Chats des Projekts mit ihren Titeln, den vorgelesenen Antworten und den Tool-Aufrufen des Assistenten; die Läufe seiner Agenten und die Agenten- und `llm`-Schritte der Automatisierungen, die darin laufen, mit den Bildern, die sie erstellen; und die Aufrufe mit den eigenen API-Schlüsseln des Projekts. Ein Lauf ohne eigenes Projekt, von einer Automatisierung, die in mehreren Projekten installiert ist, zählt für jedes davon; eine Automatisierung, die in keinem Projekt installiert ist, zählt nur für die Organisation. Eine Transkription zählt nicht für ein Projekt. +Chatantworten, Sprachversuche und Modellaufrufe von Automatisierungen behalten die Projekte, die bei ihrer Zulassung erfasst wurden. Verschiebst du den Chat oder änderst du während der Ausführung die Projektinstallationen einer Automatisierung, bleiben Reservierung und spätere Buchung den ursprünglichen Projekten zugeordnet. Ein Versuch, der ohne Projekt zugelassen wurde, bleibt außerhalb der Projektbudgets. Ein API-Schlüssel, den ein Admin für ein Mitglied erstellt hat, zählt für dieses Mitglied, wie dessen eigener Schlüssel. Ein Schlüssel, der einem Team, einem Projekt oder der Organisation gehört ([API-Schlüssel](/de/platform/admin/api-keys#create-a-key-for-someone-else)), ist keine Person: Was er anstößt, zählt für den Schlüssel selbst. Die Nutzungsanalyse zeigt ihn als eigene Zeile unter **Nutzung pro Benutzer**, unter dem Namen des Schlüssels mit seinem Team, seinem Projekt oder der Organisation darunter, und zählt ihn nie als aktive Person. Der Schlüssel eines Teams zählt zusätzlich für die Nutzung seines Teams. @@ -38,7 +44,9 @@ Ein API-Schlüssel, den ein Admin für ein Mitglied erstellt hat, zählt für di - **API-Schlüssellimits** binden die Anfragen, die mit diesem Schlüssel authentifiziert wurden: die damit gesendeten Chatnachrichten, die damit gestellten Aufrufe der Modell-Endpunkte und die damit gestarteten Läufe. - **Projektlimits** binden die Arbeit in diesem Projekt, egal wer sie angestoßen hat, auch die Läufe eines Triggers. -Ist ein Limit erreicht, lehnt Tale die nächste Anfrage vor der Ausführung ab und nennt das Limit. Ein Zug eines verwalteten Agenten wird beim Start abgelehnt; ein bereits laufender Zug behält den Rahmen, den er bekommen hat. Ein Bild, das der Agent während seines Zugs anfordert, wird eigens geprüft, bevor das Bildmodell aufgerufen wird: Ist ein Limit erreicht, lehnt Tale das Bild ab, und der Zug läuft weiter. Das Bild zehrt außerdem vom Rahmen des Zugs, der es angefordert hat. Der `llm`-Schritt einer Automatisierung wird vor jedem Modellaufruf geprüft: Lehnt ein Limit den Aufruf ab, schlägt der Schritt mit `budget_exceeded` fehl, und sein Fehler nennt das Limit; der Lauf schlägt mit ihm fehl, außer das `onError` des Schritts ist `continue`. Der Schritt hält nichts fest, während sein Aufruf läuft; gleichzeitig gestartete Läufe können ein fast erreichtes Limit deshalb gemeinsam überschreiten. [So werden Regeln kombiniert](/de/platform/admin/governance/policies-and-limits#how-rules-combine) beschreibt den Fall, dass mehrere Regeln für eine Person gelten. +Ist ein Limit erreicht, lehnt Tale die nächste Anfrage vor der Ausführung ab und nennt das Limit. Ein Zug eines verwalteten Agenten wird beim Start abgelehnt; ein bereits laufender Zug behält den Rahmen, den er bekommen hat. Ein Zug, den ein Anbieter-Abonnement bedient, das die Organisation getrennt von Tale bezahlt, kostet pro Aufruf nichts: Er zählt als eine Anfrage, mit den Tokens, die sein Agent meldet. Ein Anfrage- oder Tokenlimit lehnt ihn deshalb beim Start ab, ein Kostenlimit nicht. Ein Bild, das der Agent während seines Zugs anfordert, wird eigens geprüft, bevor das Bildmodell aufgerufen wird: Ist ein Limit erreicht, lehnt Tale das Bild ab, und der Zug läuft weiter. Das Bild zehrt außerdem vom Rahmen des Zugs, der es angefordert hat. Der `llm`-Schritt einer Automatisierung wird vor jedem Modellaufruf geprüft: Lehnt ein Limit den Aufruf ab, schlägt der Schritt mit `budget_exceeded` fehl, und sein Fehler nennt das Limit; der Lauf schlägt mit ihm fehl, außer das `onError` des Schritts ist `continue`. Der Schritt reserviert die geschätzte Eingabe und die erlaubte Ausgabe zum Katalogpreis sowie eine Anfrage bis zur Abrechnung. Gleichzeitig laufende Aufrufe berücksichtigen dadurch die Reservierungen der anderen. Bleibt das Ergebnis des Anbieters unbekannt, bucht Tale den gespeicherten Schätzwert einmal, statt ihn stillschweigend freizugeben; ein erneuter Versuch wird neu geprüft. Der Titel eines Chats, eine Umformulierung mit **Mit KI verbessern** und eine Transkription werden ebenso geprüft, bevor Tale das Modell aufruft, und zwar gegen eine Schätzung des Höchsten, was der Aufruf kosten kann — bei einer geschriebenen Antwort der Prompt und die längste Antwort, die der Aufruf zulässt, bei einer Transkription die Länge der Aufnahme ohne ihre langen Pausen, zum Minutenpreis des Modells. Diesen Betrag halten sie fest, solange der Aufruf läuft. Ein abgelehnter Titel ist kein Fehler: Der Chat bekommt seinen Namen dann aus der ersten Nachricht, ohne Modellaufruf. Ein Transkriptionsmodell, für das der Katalog keinen Minutenpreis kennt — eines, das nach Tokens abrechnet, oder ein Endpunkt ohne veröffentlichten Preis —, zählt nur für Anfragelimits, ohne Kosten. Eine abgelehnte Transkription zeigt **Nutzungslimit erreicht**; wähle **Erneut versuchen**, sobald das Limit es zulässt. Ein abgelehntes Diktat meldet, dass das Limit erreicht ist, und ein Videolink wird vor seinem Download abgelehnt. Jede Embedding-Anfrage wird ebenso geprüft. Eine Wissenssuche, die ein Limit ablehnt, sagt das und meldet nie „nichts gefunden“; die Indexierung wartet dagegen: Ein Dokument zeigt **Wartet auf ein Nutzungslimit**, eine Website behält ihre Seiten ohne Suche nach Bedeutung, und beide laufen von selbst weiter, spätestens eine Stunde nachdem das Limit zurückgesetzt oder erhöht wurde. Eine Chatantwort hält außerdem jede weitere Runde ihrer Tool-Nutzung fest, sobald die Runde beginnt. [So werden Regeln kombiniert](/de/platform/admin/governance/policies-and-limits#how-rules-combine) beschreibt den Fall, dass mehrere Regeln für eine Person gelten. + +Sprachausgabe reserviert während eines laufenden Versuchs die geschätzten Kosten und eine Anfrage. Scheitert ein bereits reservierter Versuch oder bleibt sein Ergebnis unbekannt, wird dieser Schätzwert einmal erfasst, auch bei Fehlern vor dem Anbieteraufruf. Diese vorsichtige Abrechnung bestätigt keine tatsächliche Belastung. Bei einem erneuten Versuch zählt der vorherige Schätzwert bei der Prüfung des verbleibenden Budgets mit. ## Drei Situationen, die du kennen solltest @@ -50,4 +58,4 @@ Ist ein Limit erreicht, lehnt Tale die nächste Anfrage vor der Ausführung ab u ## Was Mitglieder sehen -**Einstellungen > Nutzung** zeigt jedes Limit, das für das angemeldete Mitglied gilt, mit dem aktuellen Verbrauch: die gesendeten Chats, die angeforderten Sprachausgaben, die Aufrufe der Modell-Endpunkte und die gestarteten Agenten- und Automatisierungsläufe, egal auf welchem Weg sie gestartet wurden. Geteilte Team- und Organisationslimits stehen ebenfalls dort, weil sie vor einem persönlichen Limit erreicht sein können. Das Limit eines Projekts steht nicht dort; eine Anfrage, die es ablehnt, nennt es. +**Einstellungen > Nutzung** zeigt jedes Limit, das für das angemeldete Mitglied gilt, mit dem aktuellen Verbrauch: die gesendeten Chats, die angeforderten Sprachausgaben, die Aufrufe der Modell-Endpunkte und die gestarteten Agenten- und Automatisierungsläufe, egal auf welchem Weg sie gestartet wurden. Geteilte Team- und Organisationslimits stehen ebenfalls dort, weil sie vor einem persönlichen Limit erreicht sein können. Das Limit eines Projekts steht nicht dort: Ein Banner in den Chats des Projekts warnt davor, sobald seine Schwelle überschritten ist, und eine Anfrage, die es ablehnt, nennt es. diff --git a/docs/de/platform/admin/overview.md b/docs/de/platform/admin/overview.md index d7ed2e5490..04b9ce41a4 100644 --- a/docs/de/platform/admin/overview.md +++ b/docs/de/platform/admin/overview.md @@ -32,7 +32,7 @@ Inhaber und Admins verwalten die Organisationseinstellungen. Entwickler erreiche ## Anmeldung, Integrationen und Darstellung -Richte [Enterprise SSO](/de/platform/admin/enterprise-sso) für deinen Identitätsanbieter und [Zwei-Faktor-Authentifizierung](/de/platform/admin/two-factor-authentication) zum Schutz der Konten ein. [API-Schlüssel](/de/platform/admin/api-keys) ermöglichen Software den Zugriff auf Tale. +Richte [Enterprise SSO](/de/platform/admin/enterprise-sso) für deinen Identitätsanbieter und [Zwei-Faktor-Authentifizierung](/de/platform/admin/two-factor-authentication) zum Schutz der Konten ein. [API-Schlüssel](/de/platform/admin/api-keys) ermöglichen Software den Zugriff auf Tale. Ein Coding-Agent, der damit verbunden ist, kann viele dieser Einstellungen selbst ändern, im Rahmen der Rolle der Person, deren Schlüssel er nutzt; welche, steht unter [Einstellungen über MCP](/de/develop/mcp-settings). Unter [Branding](/de/platform/admin/branding) änderst du Logo und Farben der Organisation. [Sandboxes](/de/platform/admin/sandboxes) zeigt Ausführungskapazität und Limits für die einzelnen Aufgabenarten; mit [Sandbox-Geräten](/de/platform/admin/sandbox-devices) laufen die Sandboxes deiner Organisation auf eigenen Rechnern. Wie ein Projekt-Agent diese Ressourcen nutzen darf, erklärt [Agenten aus Administrationssicht](/de/platform/admin/agents). diff --git a/docs/de/platform/admin/sandboxes.md b/docs/de/platform/admin/sandboxes.md index 14b2224643..2f383ac1d4 100644 --- a/docs/de/platform/admin/sandboxes.md +++ b/docs/de/platform/admin/sandboxes.md @@ -9,11 +9,11 @@ description: Passe Grenzen für gleichzeitige Arbeit an, lies Infrastrukturwerte | Arbeitsart | Standard | Was einen Platz belegt | | --- | --- | --- | -| Projektagenten-Sitzungen | 2 | Ein startender oder arbeitender Agenten-Workspace, den der Agent für seine Aufgaben wiederverwendet. | +| **Agenten-Worker** | 2 | Ein startender oder arbeitender Worker: einer für jede Aufgabe, an der ein Agent gleichzeitig arbeitet. Jeder Worker ist eine Sandbox mit eigenem Arbeitsbereich, die der Agent für spätere Aufgaben wiederverwendet. | | Workflow-Sitzungen | 2 | Die Sandbox eines Workflow-Laufs. Gleichzeitige Läufe belegen getrennte Plätze. | | Render-Sitzungen | 2 | Eine vorübergehende Sandbox zum Rendern von Seiten bei Website-Scans. | -Die Werte begrenzen gleichzeitige Arbeit, nicht die Anzahl der Aufgaben oder die Ausgaben. Ein Agent kann mehrere Aufgaben in seinem einen Workspace bearbeiten. Die Limits reservieren keine Infrastruktur: Alle Organisationen teilen sich die Deployment-Kapazität. +Die Werte begrenzen gleichzeitige Arbeit, nicht die Anzahl der Aufgaben oder die Ausgaben. Ein Agent, der an drei Aufgaben gleichzeitig arbeitet, belegt drei Agenten-Worker; ein Lauf, der alle belegt vorfindet, [wartet auf einen](#einen-blockierten-start-klaeren) und startet von selbst, sobald einer frei ist. Unter **Agenten-Worker** sehen Inhaber und Admins, wie viele Agentenläufe auf einen freien Worker warten: die Läufe, die ein höheres Limit sofort starten würde. Die Limits reservieren keine Infrastruktur: Alle Organisationen teilen sich die Deployment-Kapazität. @@ -51,7 +51,7 @@ Die Werte aktualisieren sich alle 15 Sekunden. Mit **Aktualisieren** forderst du ## Belegte und inaktive Workspaces unterscheiden -Inhaber und Admins können **Arbeitsbereiche** prüfen. Jede Zeile nennt den zugehörigen Agenten oder Workflow-Lauf, Laufzeitstatus, Belegungsstatus und laufende Aufgaben. Die Zustände beantworten unterschiedliche Fragen: Ein Container kann für die Wiederverwendung weiterlaufen, obwohl er seinen Organisationsplatz bereits freigegeben hat. Der Arbeitsbereich eines Projekt-Agenten bleibt auch im Leerlauf aufgeführt, als **Gestoppt** mit **Kontingent freigegeben**, bis du ihn löschst oder Tale ihn löscht: wenn ihn niemand [während der von deiner Organisation festgelegten Anzahl Tage](#delete-unused-workspaces-automatically) genutzt hat oder wenn [sein Agent, sein Projekt oder das zugehörige Mitglied entfernt wird](#explain-why-a-workspace-disappeared). Wurde der Agent selbst gelöscht, steht in der Zeile **Gelöschter Agent**, bis Tale den Arbeitsbereich gelöscht hat. Der Arbeitsbereich eines Workflow-Laufs wird kurz nach dem Ende des Laufs zurückgefordert. +Inhaber und Admins können **Arbeitsbereiche** prüfen. Jede Zeile nennt den zugehörigen Agenten oder Workflow-Lauf, Laufzeitstatus, Belegungsstatus und laufende Aufgaben. Ein Agent hat eine Zeile pro Worker: Unter seinem Namen sagt **Worker 2**, welcher seiner Worker die Zeile ist, und **Mitglieder-Worker 2** kennzeichnet einen, der den Agenten für ein Mitglied ausführt, das [seine Läufe gestartet hat](/de/platform/projects/tasks#agentenlaeufe-die-ein-mitglied-startet). **Aktuelle Aufgaben** nennt jede Aufgabe mit Schlüssel und Titel und öffnet sie. Die Zustände beantworten unterschiedliche Fragen: Ein Container kann für die Wiederverwendung weiterlaufen, obwohl er seinen Organisationsplatz bereits freigegeben hat. Der Arbeitsbereich eines Workers bleibt auch im Leerlauf aufgeführt, als **Gestoppt** mit **Kontingent freigegeben**, bis du ihn löschst oder Tale ihn löscht: wenn ihn niemand [während der von deiner Organisation festgelegten Anzahl Tage](#delete-unused-workspaces-automatically) genutzt hat oder wenn [sein Agent, sein Projekt oder das zugehörige Mitglied entfernt wird](#explain-why-a-workspace-disappeared). Wurde der Agent selbst gelöscht, steht in der Zeile **Gelöschter Agent**, bis Tale den Arbeitsbereich gelöscht hat. Der Arbeitsbereich eines Workflow-Laufs wird kurz nach dem Ende des Laufs zurückgefordert. Verschwindet eine Umgebung auf dem Tale-Server von selbst, etwa nach einem Neustart des Hosts oder weil ihr der Speicher ausgegangen ist, behält ihr Arbeitsbereich seine Dateien und steht auf **Gestoppt**; der nächste Lauf arbeitet darin weiter. Für eine Umgebung auf einem verbundenen [Gerät](/de/platform/admin/sandbox-devices) gilt das nicht. Die Ausgaben enthalten die gemessenen Kosten abgeschlossener Durchläufe. Ein noch laufender Durchlauf wird nach seinem Ende eingerechnet. Vorübergehende Crawler-Umgebungen zählen zur Kapazität, auch ohne eigene dauerhafte Workspace-Zeile. @@ -63,17 +63,17 @@ Inhaber und Admins finden im Zeilenmenü diese Aktionen: | Aktion | Wirkung | | --- | --- | -| **Aufgabe stoppen** | Bricht alle laufenden Vorgänge dieses Arbeitsbereichs ab. Prüfe zuerst die Aufgabenliste; ein Agent kann mehrere Aufgaben bearbeiten. | +| **Aufgabe stoppen** | Bricht alle laufenden Vorgänge dieses Arbeitsbereichs ab. Ein Worker bearbeitet jeweils eine Aufgabe, also stoppt das nur diese; die anderen Worker des Agenten arbeiten weiter. | | **Anpinnen** / **Lösen** | Nimmt den Arbeitsbereich von der automatischen Inaktivitäts- und Ablaufbereinigung und vom Löschen wegen Nichtnutzung aus oder stellt die normale Bereinigung wieder her. Eine angeheftete Belegung kann weiter Kapazität beanspruchen. Verschwindet die Umgebung eines angehefteten Arbeitsbereichs, etwa nach einem Neustart des Hosts, startet Tale sie mit den Workspace-Dateien neu; der Arbeitsbereich bleibt angeheftet. | -| **Löschen** | Fragt nach Bestätigung und entfernt dann Sandbox und Workspace-Dateien im Hintergrund: Zuerst wird die Anheftung gelöst und laufende Arbeit abgebrochen. Bis der Arbeitsbereich entfernt ist, steht in seiner Zeile **Wird gelöscht**, und du kannst die Seite währenddessen weiter nutzen. Kann Tale ihn auch nach mehreren Versuchen nicht entfernen, bleibt der Arbeitsbereich ohne Anheftung in der Liste und zeigt **Nicht gelöscht**; wähle dann erneut **Löschen**, um ihn vollständig zu entfernen. Solange die Zeile **Wird gelöscht** zeigt, startet in diesem Arbeitsbereich nichts Neues: Der Lauf eines Agenten wartet und zeigt **Wartet auf einen Sandbox-Platz**, und ein Schritt eines Workflow-Laufs, der den Arbeitsbereich braucht, schlägt sofort mit dem Grund fehl, ohne zu warten oder es erneut zu versuchen, denn die Dateien seiner früheren Schritte werden gelöscht. Ist die Zeile verschwunden, erzeugt der nächste Start eine neue Umgebung; zeigt sie stattdessen **Nicht gelöscht**, geht die wartende Arbeit mit den alten Dateien weiter. | +| **Löschen** | Fragt nach Bestätigung und entfernt dann Sandbox und Workspace-Dateien im Hintergrund: Zuerst wird die Anheftung gelöst und laufende Arbeit abgebrochen. Bis der Arbeitsbereich entfernt ist, steht in seiner Zeile **Wird gelöscht**, und du kannst die Seite währenddessen weiter nutzen. Kann Tale ihn auch nach mehreren Versuchen nicht entfernen, bleibt der Arbeitsbereich ohne Anheftung in der Liste und zeigt **Nicht gelöscht**; wähle dann erneut **Löschen**, um ihn vollständig zu entfernen. Solange die Zeile **Wird gelöscht** zeigt, startet in diesem Arbeitsbereich nichts Neues. Der Lauf eines Agenten, der ihn nutzen würde, nimmt einen anderen freien Worker des Agenten; ist keiner frei, wartet er und zeigt **Wartet auf einen Arbeitsbereich**. Ein Schritt eines Workflow-Laufs, der den Arbeitsbereich braucht, schlägt sofort mit dem Grund fehl, ohne zu warten oder es erneut zu versuchen, denn die Dateien seiner früheren Schritte werden gelöscht. Ist die Zeile verschwunden, erzeugt der nächste Start eine neue Umgebung; zeigt sie stattdessen **Nicht gelöscht**, geht die wartende Arbeit mit den alten Dateien weiter. | -Tale speichert Änderungen am Anheftstatus dauerhaft und wiederholt die Übertragung, wenn die Laufzeit sie nicht bestätigt, auch nach einem Worker-Neustart oder Geräteausfall. Jeder Versuch überträgt den zuletzt gewünschten Wert an dieselbe Session-Instanz. Wiederholtes Lösen verlängert deren Ablaufzeit nicht. +Tale speichert Änderungen am Anheftstatus dauerhaft und wiederholt die Übertragung, wenn die Laufzeit sie nicht bestätigt, auch nach einem Neustart eines Backend-Workers oder einem Geräteausfall. Jeder Versuch überträgt den zuletzt gewünschten Wert an dieselbe Session-Instanz. Wiederholtes Lösen verlängert deren Ablaufzeit nicht. Stoppe die Aufgabe, wenn die Arbeit enden, ihre Dateien aber bleiben sollen. Sichere vor dem Löschen benötigte Ergebnisse und lies die Bestätigung. Automatische Rückgewinnung inaktiver Kapazität bewahrt Workspace-Dateien; ausdrückliches und automatisches Löschen entfernen sie. ## Ungenutzte Arbeitsbereiche automatisch löschen {#delete-unused-workspaces-automatically} -Ein Projekt-Agent bewahrt seine Dateien zwischen den Läufen in Arbeitsbereichen auf: in einem, den er für alle seine Aufgaben wiederverwendet, und in einem getrennten für jedes Mitglied, das [seine Läufe startet](/de/platform/projects/tasks#agentenlaeufe-die-ein-mitglied-startet). Tale löscht einen Arbeitsbereich, den niemand während der von deiner Organisation festgelegten Anzahl Tage genutzt hat; **Löschen** entfernt einen Arbeitsbereich weiterhin sofort. Inhaber und Admins legen diese Regel unter **Bereinigung der Arbeitsbereiche** fest, direkt über der Liste **Arbeitsbereiche**. Entwickler sehen diesen Abschnitt nicht. +Ein Projekt-Agent bewahrt seine Dateien zwischen den Läufen in den Arbeitsbereichen seiner Worker auf: einem für jede Aufgabe, an der er gleichzeitig gearbeitet hat, den seine späteren Aufgaben wiederverwenden, und getrennten für jedes Mitglied, das [seine Läufe startet](/de/platform/projects/tasks#agentenlaeufe-die-ein-mitglied-startet). Der Arbeitsbereich jedes Workers zählt seine Tage ohne Nutzung für sich. Tale löscht einen Arbeitsbereich, den niemand während der von deiner Organisation festgelegten Anzahl Tage genutzt hat; **Löschen** entfernt einen Arbeitsbereich weiterhin sofort. Inhaber und Admins legen diese Regel unter **Bereinigung der Arbeitsbereiche** fest, direkt über der Liste **Arbeitsbereiche**. Entwickler sehen diesen Abschnitt nicht. @@ -93,10 +93,10 @@ In der Liste **Arbeitsbereiche** zeigt ein gestoppter Agenten-Arbeitsbereich unt Neben ungenutzten Arbeitsbereichen löscht Tale einen Arbeitsbereich auch, sobald entfernt wird, wozu er gehört, unabhängig von der Bereinigungseinstellung: -- Das Löschen eines Projekt-Agenten löscht alle seine Arbeitsbereiche, auch die der Mitglieder. Das Löschen eines Projekts tut dasselbe für jeden Agenten darin. +- Das Löschen eines Projekt-Agenten löscht die Arbeitsbereiche aller seiner Worker, auch die der Mitglieder. Das Löschen eines Projekts tut dasselbe für jeden Agenten darin. - [Entfernst du ein Mitglied](/de/platform/admin/members-and-roles#zugriff-entziehen-oder-wiederherstellen) aus der Organisation, werden seine eigenen Arbeitsbereiche mit allen Agenten gelöscht. Setzt du es stattdessen auf **Deaktiviert**, bleiben sie erhalten. - [Die Löschung der Daten einer Person](/de/platform/admin/governance/data-subject-requests) entfernt ihre eigenen Arbeitsbereiche, ohne auf laufende Arbeit darin zu warten. -- Das Löschen der Organisation entfernt alle ihre Sandboxes samt Dateien, widerruft die dafür ausgegebenen Gateway-Schlüssel, trennt ihre [Geräte](/de/platform/admin/sandbox-devices) und löscht die für sie angelegten Build- und Paket-Caches. +- Das Löschen der Organisation entfernt alle ihre Sandboxes samt Dateien, widerruft die dafür ausgegebenen Gateway-Schlüssel, entfernt ihre Modell-Provider-Schlüssel aus dem Modell-Gateway, trennt ihre [Geräte](/de/platform/admin/sandbox-devices) und löscht die für sie angelegten Build- und Paket-Caches. Das geschieht innerhalb von etwa einer Minute oder, falls im Arbeitsbereich noch eine Aufgabe läuft, nach deren Ende. Auch ein angepinnter Arbeitsbereich wird dann gelöscht, doch ein [Legal Hold](/de/platform/admin/governance/legal-hold) bewahrt jeden Arbeitsbereich, den er abdeckt: Eine Sperre der Organisation bewahrt alle, eine Sperre für eine Person deren eigene Arbeitsbereiche. Eine stündliche Bereinigung löscht außerdem Überreste, die niemandem mehr gehören, etwa den Arbeitsbereich eines Workflow-Laufs, der nie zurückgefordert wurde. @@ -104,9 +104,9 @@ Jeden Arbeitsbereich, den Tale von selbst löscht, aus einem dieser Gründe oder ## Einen blockierten Start klären -Ein Start ohne freien Platz wartet. Sind die Limits deiner Organisation belegt oder ist das Deployment voll oder knapp an Arbeitsspeicher, startet die Arbeit von selbst, sobald Platz frei wird, und du musst nichts tun. Bei Speicherplatz ist das anders: Wird ungenutzte Arbeit angehalten, wird keiner frei, denn ein angehaltener Arbeitsbereich behält seine Dateien. Tale entfernt Build-Caches, die keine Sitzung nutzt, sofern es welche gibt; reicht das nicht, wartet der Start, bis Arbeitsbereiche gelöscht werden, etwa solche, die du löschst, weil du sie nicht mehr brauchst, oder bis der Betreiber Speicherplatz freigibt. Ist das Deployment selbst voll, geht sein Platz an die Arbeit, die am längsten wartet, egal aus welcher Organisation, und jeder wartende Start erfährt, wann er an der Reihe ist: +Ein Start ohne freien Platz wartet, und seine Aufgabe zeigt unter **Lauf**, warum: **Wartet auf einen Worker**, wenn alle Agenten-Worker deiner Organisation belegt sind, **Wartet auf freien Platz**, wenn das Deployment voll ist oder zu wenig Arbeitsspeicher oder Speicherplatz hat, **Wartet auf einen Arbeitsbereich**, solange ein Administrator den Arbeitsbereich löscht, den der Lauf nutzen würde, und **Wartet auf seine Sandbox**, solange seine Sandbox einen früheren Prozess beendet. Inhaber und Admins bekommen außerdem einen Link auf diese Seite, wenn alle Agenten-Worker belegt sind. Sind die Limits deiner Organisation belegt oder ist das Deployment voll oder knapp an Arbeitsspeicher, startet die Arbeit von selbst, sobald Platz frei wird, und du musst nichts tun. Bei Speicherplatz ist das anders: Wird ungenutzte Arbeit angehalten, wird keiner frei, denn ein angehaltener Arbeitsbereich behält seine Dateien. Tale entfernt Build-Caches, die keine Sitzung nutzt, sofern es welche gibt; reicht das nicht, wartet der Start, bis Arbeitsbereiche gelöscht werden, etwa solche, die du löschst, weil du sie nicht mehr brauchst, oder bis der Betreiber Speicherplatz freigibt. Ist das Deployment selbst voll, geht sein Platz an die Arbeit, die am längsten wartet, egal aus welcher Organisation, und jeder wartende Start erfährt, wann er an der Reihe ist: -- Ein Aufgabenlauf wartet in der Warteschlange. Er wird erneut versucht, sobald eine Sitzung endet, in deiner Organisation oder in einer anderen auf demselben Deployment. Ist das Deployment voll, wird er auch versucht, wenn er an der Reihe ist. Zusätzlich versucht Tale alle zwei Minuten einige wartende Läufe jeder Organisation, die am längsten wartenden zuerst. +- Ein Aufgabenlauf wartet in der Warteschlange. Er wird erneut versucht, sobald eine Sitzung endet, in deiner Organisation oder in einer anderen auf demselben Deployment. Ist das Deployment voll, wird er auch versucht, wenn er an der Reihe ist. Zusätzlich versucht Tale alle zwei Minuten einige wartende Läufe jeder Organisation. Ein frei gewordener Worker geht zuerst an den Agenten mit den wenigsten laufenden Läufen und dann an den Lauf, der am längsten wartet. Findet ein Lauf innerhalb von 12 Stunden nach seinem Start keinen Platz, schlägt er fehl und meldet, dass er zu lange auf einen freien Worker gewartet hat. - Der Agent-Schritt einer Automatisierung versucht es erneut, ohne seine Wiederholungen zu verbrauchen: wenn er an der Reihe ist, falls das Deployment voll ist, sonst nach einer Pause, die länger wird, solange der Schritt weiter wartet, bis zu etwa zwei Minuten. Der Lauf zeigt währenddessen **Wartet auf einen Sandbox-Platz**. Findet er zwei Stunden lang keinen Platz, schlägt der Lauf mit diesem Grund fehl. Ein Arbeitsbereich, den ein Administrator löscht, ist kein fehlender Platz: Der Schritt schlägt dann sofort fehl, wie oben bei **Löschen** beschrieben. - Das Crawling wartet, bis es an der Reihe ist, und setzt dann mit dem nächsten Stapel fort. diff --git a/docs/de/platform/agents/concepts.md b/docs/de/platform/agents/concepts.md index 46f503a1cc..b9a0700e66 100644 --- a/docs/de/platform/agents/concepts.md +++ b/docs/de/platform/agents/concepts.md @@ -3,14 +3,14 @@ title: Projektagenten verstehen description: Lege den Aufgabenbereich eines Agenten fest und verstehe das Zusammenspiel von Laufzeit, Modell, Anweisungen und Ausstattung. --- -Ein Projektagent bearbeitet Aufgaben in einem bestimmten Projekt. Du legst fest, wie er arbeitet und worauf er zugreifen darf, und gibst ihm eine Aufgabe mit einem prüfbaren Ergebnis. In seiner Sandbox kann er Dateien bearbeiten und Befehle ausführen. Der [festgelegte Prüfer](/de/platform/projects/tasks#review-default), eine Person oder ein unabhängiger Projektagent, prüft das Ergebnis vor dem Abschluss der Aufgabe. Neue Prüfungen, die menschliche Unabhängigkeit oder Kompetenznachweise voraussetzen, gehen in die menschliche Prüferkette; eine bereits einem Agenten zugewiesene Prüfung muss ausdrücklich an eine berechtigte Person übertragen werden. +Ein Projektagent ist eine benannte Konfiguration für Aufgaben in einem bestimmten Projekt. Du legst fest, wie er arbeitet und worauf er zugreifen darf, und gibst ihm eine Aufgabe mit einem prüfbaren Ergebnis. Jede Aufgabe, an der er arbeitet, läuft in einem Worker, einer laufenden Kopie des Agenten, die in einer eigenen Sandbox Dateien bearbeitet und Befehle ausführt. So kann ein Agent an mehreren Aufgaben gleichzeitig arbeiten. Der [festgelegte Prüfer](/de/platform/projects/tasks#review-default), eine Person oder ein unabhängiger Projektagent, prüft das Ergebnis vor dem Abschluss der Aufgabe. Neue Prüfungen, die menschliche Unabhängigkeit oder Kompetenznachweise voraussetzen, gehen in die menschliche Prüferkette; eine bereits einem Agenten zugewiesene Prüfung muss ausdrücklich an eine berechtigte Person übertragen werden. ## Die passende Arbeitsform wählen | Arbeitsform | Geeignete Arbeit | Was du festlegst | | --- | --- | --- | | Chat | Fragen stellen, Wissen abrufen oder einen Text entwerfen. | Nachricht, Modell und gegebenenfalls Projektkontext. | -| Projektagent | Ein Repository prüfen, Dateien erstellen oder eine Aufgabe über mehrere Durchläufe bearbeiten. | Einen wiederverwendbaren Agenten im Projekt. | +| Projektagent | Ein Repository prüfen, Dateien erstellen oder eine Aufgabe über mehrere Durchläufe bearbeiten. | Eine wiederverwendbare Agentenkonfiguration im Projekt. | | Automatisierung | Festgelegte Schritte ausführen, auf Ereignisse reagieren oder zwischen Aktionen eine Freigabe einholen. | Einen versionierten Workflow und seine Eingaben. | Auch ein Projektchat verwendet den eingebauten Chat-Assistenten. Die Wahl eines Projekts im Chat aktiviert keinen Projektagenten. Eine Agent-Node in einer Automatisierung hat wiederum ihre eigene Konfiguration. @@ -32,7 +32,7 @@ Ein Agent gehört genau einem Projekt. Wer das Projekt lesen darf, sieht seine A | Connectors und Tools | Verbundene Dienste und erlaubte Plattformoperationen. | Vergib Repository-Zugriff und nur die benötigten Aufgaben-Tools. | | Secrets | Benannte Zugangsdaten der Organisation für die laufende Sitzung. | Nutze ein eng begrenztes Token für einen Dienst ohne Connector. | -Die Listen für Skills, Connectors, Tools und Secret-Namen erlauben jeweils bis zu 25 Einträge. Ein freigegebenes Schreib-Tool darf im Rahmen seiner Zugriffsregeln Daten ändern. Eine Anweisung zu vorsichtigem Vorgehen entzieht diese Berechtigung nicht. Nur Inhaber oder Admins dürfen Secret-Zuordnungen ändern. +Die Listen für Skills, Connectors, Tools und Secret-Namen erlauben jeweils bis zu 25 Einträge. Ein freigegebenes Schreib-Tool darf im Rahmen seiner Zugriffsregeln Daten ändern. Eine Anweisung zu vorsichtigem Vorgehen entzieht diese Berechtigung nicht. Nur Inhaber oder Admins dürfen Secret-Zuordnungen ändern. Das Wissen des Projekts zu durchsuchen braucht keine Freigabe: Das kann jeder Agent. ```mermaid flowchart LR @@ -45,6 +45,6 @@ flowchart LR ## Vor der Zuweisung die Voraussetzungen prüfen -Die Provider-Zugangsdaten müssen zur gewählten Laufzeit und zum Modell passen. Außerdem muss Sandbox-Kapazität verfügbar sein. Eine erfolgreiche Chat-Antwort belegt diese Voraussetzungen nicht. Beschreibe in der Aufgabe das erwartete Ergebnis und füge das zu prüfende Material hinzu. +Die Provider-Zugangsdaten müssen zur gewählten Laufzeit und zum Modell passen. Außerdem muss Sandbox-Kapazität verfügbar sein: Ein Lauf wartet, bis einer der [Agenten-Worker](/de/platform/projects/project-agents#run-one-agent-on-several-tasks) deiner Organisation frei ist. Eine erfolgreiche Chat-Antwort belegt diese Voraussetzungen nicht. Beschreibe in der Aufgabe das erwartete Ergebnis und füge das zu prüfende Material hinzu. Sind diese Entscheidungen getroffen, [erstelle einen Projektagenten](/de/platform/projects/project-agents). Die [Aufgaben-Automatisierung](/de/platform/projects/task-automation) erklärt Start, Steuerung und Prüfung seiner Arbeit. diff --git a/docs/de/platform/agents/harnesses.md b/docs/de/platform/agents/harnesses.md index 16df95f1a5..a86224a6ed 100644 --- a/docs/de/platform/agents/harnesses.md +++ b/docs/de/platform/agents/harnesses.md @@ -37,13 +37,13 @@ Gemini CLI ist die Ausnahme: Tale setzt eine seiner Unterhaltungen nie fort. Ein Bei einem gespeicherten API-Schlüssel oder einer Deployment-Umgebungsvariable stellt Tale einen sitzungsgebundenen Gateway-Schlüssel bereit. Der ursprüngliche Modell-Provider-Schlüssel bleibt bei der Plattform. Gateway-Aufrufe werden gemessen und unterliegen den geltenden Ausgabenregeln. Bereits an andere laufende Durchläufe vergebene Beträge werden berücksichtigt. -Provider-Abonnements verwenden ihre unterstützte Agent-Laufzeit und erhalten den Abonnement-Zugang in der Sitzungsumgebung. Sie dienen weder als normale Chat-Zugangsdaten noch für inkompatible Agent-Laufzeiten, weil die Anbieter Abo-Tokens nur in ihrer eigenen Laufzeit erlauben; mehr dazu unter [KI-Anbieter](/de/platform/admin/providers#abos-in-aufgaben-nutzen-nicht-im-chat). Ihre direkten Aufrufe umgehen die Kostenmessung und Ausgabengrenzen des Tale-Gateways. Prüfe die Nutzung beim Abonnement-Provider. +Provider-Abonnements verwenden ihre unterstützte Agent-Laufzeit und erhalten den Abonnement-Zugang in der Sitzungsumgebung. Gemini ist die Ausnahme: Seine Google-Anmeldung wird für den Durchlauf als Datei im Home-Ordner der Sitzung abgelegt und am Ende des Durchlaufs wieder entfernt. Sie dienen weder als normale Chat-Zugangsdaten noch für inkompatible Agent-Laufzeiten, weil die Anbieter Abo-Tokens nur in ihrer eigenen Laufzeit erlauben; mehr dazu unter [KI-Anbieter](/de/platform/admin/providers#abos-in-aufgaben-nutzen-nicht-im-chat). Ihre direkten Aufrufe umgehen die Kostenmessung und Ausgabengrenzen des Tale-Gateways. Prüfe die Nutzung beim Abonnement-Provider. Diese Regeln für Modellzugänge bedeuten nicht, dass die Sandbox keinerlei Geheimnisse enthält. Ausdrücklich vergebene **Secrets** sowie ein Token für einen zugeordneten GitHub-Zugang können darin verfügbar sein. Vergib nur den für die Aufgabe nötigen Zugriff. ## Dateien und verbundene Werkzeuge verstehen -Ein Projektagent verwendet seinen dauerhaften Workspace über mehrere Aufgaben hinweg. Aufgabenanhänge liegen schreibgeschützt unter `/agent/inputs//attachments/`. Dateien aus `/agent/output//` werden am Ende des Durchlaufs als **Ergebnisdateien** an die Aufgabe angehängt. Agent-Nodes sammeln ihre Ausgabe aus `/agent/output/`. +Ein Projektagent verwendet seinen dauerhaften Workspace über mehrere Aufgaben hinweg. Aufgabenanhänge liegen schreibgeschützt unter `/agent/inputs//attachments/`. Der Workspace behält diese Kopie nur, solange die Aufgabe sie noch brauchen kann: Tale entfernt sie, sobald die Aufgabe auf **Erledigt** oder **Abgebrochen** steht, archiviert oder gelöscht ist oder 30 Tage lang nicht geändert wurde, und der nächste Durchlauf der Aufgabe legt die Dateien wieder ab. Dateien aus `/agent/output//` werden am Ende des Durchlaufs als **Ergebnisdateien** an die Aufgabe angehängt. Agent-Nodes sammeln ihre Ausgabe aus `/agent/output/`. Zugeordnete Skill-Bundles liegen als Dateien vor und werden in den Laufanweisungen genannt. Prüfe ihre Anweisungen und Skripte vor der Freigabe. [Skills für Agenten](/de/platform/agents/skills) erklärt Bereitstellung und Sichtbarkeit. diff --git a/docs/de/platform/automations/approvals-in-workflows.md b/docs/de/platform/automations/approvals-in-workflows.md index 390fb8f46c..a9927e2560 100644 --- a/docs/de/platform/automations/approvals-in-workflows.md +++ b/docs/de/platform/automations/approvals-in-workflows.md @@ -3,7 +3,7 @@ title: Auf einen wartenden Workflow reagieren description: Finde einen pausierten Automationslauf, prüfe einen geplanten Schreibzugriff oder beantworte eine Rückfrage des Agenten. --- -Ein Lauf kann auf eine Entscheidung vor einem Connector-Schreibzugriff warten oder auf Informationen, die ein Agent zum Fortfahren braucht. In den Laufdetails siehst du, welche Antwort nötig ist. Ein wartender Lauf ist noch nicht abgeschlossen, auch wenn vorherige Knoten erfolgreich waren. +Ein Lauf kann auf eine Entscheidung vor einem Connector-Schreibzugriff warten oder auf Informationen, die ein Agent zum Fortfahren braucht. In den Laufdetails siehst du, welche Antwort nötig ist. Ein wartender Lauf ist noch nicht abgeschlossen, auch wenn vorherige Nodes erfolgreich waren. ## Den wartenden Lauf finden @@ -15,19 +15,19 @@ Eine Freigabekarte nennt eine Connector-Aktion und zeigt ihre geplanten Eingaben Lies die Aktion und die Angaben unter **Der Schritt würde aufrufen mit** genau. Prüfe Empfänger oder Ziel, den Inhalt und alle Kennungen, die bestimmen, was geändert wird. -Wähle **Freigeben**, um die Aktion zu erlauben. Der Lauf wird fortgesetzt und versucht den Schreibzugriff; kontrolliere danach Knotenergebnis und Auswirkungen. Wähle **Ablehnen**, wenn die Anfrage falsch ist oder nicht ausgeführt werden soll. Die Ablehnung verhindert diese Aktion und lässt den Lauf fehlschlagen. +Wähle **Freigeben**, um die Aktion zu erlauben. Der Lauf wird fortgesetzt und versucht den Schreibzugriff; kontrolliere danach das Ergebnis der Node und die Auswirkungen. Wähle **Ablehnen**, wenn die Anfrage falsch ist oder nicht ausgeführt werden soll. Die Ablehnung verhindert diese Aktion und lässt den Lauf fehlschlagen. Auch wenn etwas schiefgeht, zeigt die Karte, wo der Lauf steht. Lässt sich die Freigabe nicht laden, sagt die Karte das und bietet **Erneut versuchen** an; der Lauf wartet weiter, bis jemand entscheidet. Wurde deine Entscheidung nicht gespeichert, meldet die Karte das und behält **Freigeben** und **Ablehnen**, damit du noch einmal wählen kannst. Hat jemand anderes zuerst entschieden, zeigt die Karte die gespeicherte Entscheidung. -Ein Live-Lauf prüft vor der Freigabeanfrage, ob der Connector ein nutzbares Credential hat: Ist keines konfiguriert, schlägt der Knoten mit diesem Grund fehl, statt auf eine Entscheidung zu warten. +Ein Live-Lauf prüft vor der Freigabeanfrage, ob der Connector ein nutzbares Credential hat: Ist keines konfiguriert, schlägt die Node mit diesem Grund fehl, statt auf eine Entscheidung zu warten. Auf der Freigabekarte kannst du keine Parameter ändern. Lehne eine falsche Anfrage ab, korrigiere den Workflow oder seine Eingaben und teste die Änderung vor einem neuen Live-Lauf. Änderungen an der Freigaberichtlinie geben eine bereits offene Karte nicht frei. [Freigabekonzepte](/de/platform/approvals/concepts) erklärt den Ablauf; die [Konfiguration der Freigaberichtlinie](/de/self-hosted/configuration/approvals) beschreibt die Regeln für den Betrieb. ## Eine Rückfrage des Agenten beantworten -Nutzt ein Agent-Knoten `ask_human`, zeigen die Laufdetails **Der Agent braucht deine Antwort, um weiterzumachen**. Beantworte vorgegebene Auswahlfragen direkt auf der Karte. Bei einer offenen Frage schreibst du unter **Deine Antwort** einen Text und klickst auf **Antwort senden & fortsetzen**. +Nutzt eine Agent-Node `ask_human`, zeigen die Laufdetails **Der Agent braucht deine Antwort, um weiterzumachen**. Beantworte vorgegebene Auswahlfragen direkt auf der Karte. Bei einer offenen Frage schreibst du unter **Deine Antwort** einen Text und klickst auf **Antwort senden & fortsetzen**. -Gib die fehlende Information möglichst konkret an. Fragt der Agent nach einem Dokument, nenne das Dokument oder seine Kennung, statt ihn nur zum Fortfahren aufzufordern. Der wartende Knoten wird mit deiner Antwort fortgesetzt. Später kann der Lauf eine weitere Antwort oder eine Freigabe benötigen. Inhaber, Admins und Entwickler antworten in den Laufdetails. Bearbeitet der Lauf eine Aufgabe, erscheint die Rückfrage auch in der Aufgabe, und dort antwortet jede Person, die die Aufgabe öffnen kann. +Gib die fehlende Information möglichst konkret an. Fragt der Agent nach einem Dokument, nenne das Dokument oder seine Kennung, statt ihn nur zum Fortfahren aufzufordern. Die wartende Node wird mit deiner Antwort fortgesetzt. Später kann der Lauf eine weitere Antwort oder eine Freigabe benötigen. Inhaber, Admins und Entwickler antworten in den Laufdetails. Bearbeitet der Lauf eine Aufgabe, erscheint die Rückfrage auch in der Aufgabe, und dort antwortet jede Person, die die Aufgabe öffnen kann. ## Den Workflow korrigieren und testen @@ -35,7 +35,7 @@ Eine Workflow-Definition zu ändern ist ein anderer Vorgang als auf ihren laufen -![Der Workflow-Editor zeigt den Automationsgraphen und einen Bereich zum Konfigurieren des ausgewählten Knotens.](/images/platform/automation-editor-canvas.webp) +![Der Workflow-Editor zeigt den Graphen der Automatisierung und einen Bereich zum Konfigurieren der ausgewählten Node.](/images/platform/automation-editor-canvas.webp) diff --git a/docs/de/platform/automations/assistant.md b/docs/de/platform/automations/assistant.md index 22efabdd4a..1427d49f56 100644 --- a/docs/de/platform/automations/assistant.md +++ b/docs/de/platform/automations/assistant.md @@ -1,30 +1,32 @@ --- -title: Den Weg zur Automation wählen -description: Bearbeite Workflows direkt im visuellen Editor oder verbinde einen externen Assistenten über MCP mit Tale. +title: Den Weg zur Automatisierung wählen +description: Ändere Workflows direkt im visuellen Editor oder lass deinen Coding-Agent Automatisierungen über den MCP-Endpoint von Tale bearbeiten. --- -Bearbeite eine Automation direkt auf ihrer Arbeitsfläche oder verbinde einen externen Assistenten über MCP mit den Werkzeugen von Tale. Beide Wege speichern Versionen desselben Workflows und nutzen dieselben Prüf- und Bereitstellungsregeln. Zum Erstellen und Bereitstellen brauchst du Entwicklerrechte. +Ändere die Felder einer Automatisierung direkt im Editor oder lass deinen Coding-Agent sie über den MCP-Endpoint von Tale erstellen und ändern. Einen KI-Assistenten im Editor gibt es nicht: Mit KI arbeitest du an Automatisierungen über einen Coding-Agent wie Claude Code oder Codex, den du mit deinem API-Schlüssel verbindest. Beide Wege speichern Versionen desselben Workflows und nutzen dieselben Prüf- und Bereitstellungsregeln. Automatisierungen erstellen und live schalten dürfen Inhaber, Admins und Entwickler. -## Eine Änderung im visuellen Editor vornehmen +## Eine Änderung im Editor vornehmen -Öffne **Automatisierungen** und wähle den Workflow. Klicke auf einen Knoten, um Eingaben, Modell, Code oder andere Einstellungen zu prüfen. Speichere die Änderung mit einer Versionsnachricht, führe einen Test aus und stelle nach bestandenen Prüfungen die gewünschte Version bereit. +Öffne **Automatisierungen** und wähle den Workflow. Wähle eine Node, um Eingabe, Modell, Code oder andere Einstellungen zu prüfen, und ändere das Feld, das du brauchst. Speichere die Änderung mit einer Versionsnachricht, führe einen Test aus und stelle nach bestandenen Prüfungen die gewünschte Version bereit. Der Canvas ordnet sich anhand der Referenzen zwischen den Nodes selbst an; du fügst darin keine Nodes hinzu und zeichnest keine Verbindungen. - + -![Der Automation-Editor zeigt den Workflow-Graphen und die Eingabefelder des ausgewählten Knotens in einer Seitenleiste.](/images/platform/automation-editor-canvas.webp) +![Der Automatisierungs-Editor zeigt den Workflow zwischen Start und Ende und die Felder der ausgewählten Node in einer Seitenleiste.](/images/platform/automation-editor-canvas.webp) -[Der Workflow-Editor](/de/platform/automations/editor) erklärt diese Schritte, die Prüfung eines Laufs und die Rückkehr zu einer früheren Version. Die Arbeitsfläche enthält keinen Chat-Assistenten. +[Der Workflow-Editor](/de/platform/automations/editor) erklärt diese Schritte, das Lesen des Canvas, die Prüfung eines Laufs und die Rückkehr zu einer früheren Version. Der Canvas enthält keinen Chat-Assistenten. -## Einen externen Assistenten über MCP nutzen +## Mit deinem Coding-Agent ändern -Richte deinen Client mit dem Endpunkt unter **Einstellungen > API > MCP** und einem passenden Organisations-API-Schlüssel ein. Beschreibe Eingaben, gewünschte Ausgabe und die Systeme, die der Workflow verändern darf. Lass den Client vorhandene Automationen und Funktionen prüfen, bevor er eine weitere erstellt. +Der Weg dorthin ist **Mit deinem Coding-Agent bearbeiten**, die letzte Schaltfläche oben rechts im Canvas des Editors. Ihr Dialog zeigt den Namen der Automatisierung, den du dem Agent gibst, **MCP einrichten**, das **Einstellungen > API > MCP** öffnet, und einen Link zur Anleitung, mit der du einen Coding-Agent verbindest. Verbinde deinen Coding-Agent mit dem Endpoint unter **Einstellungen > API > MCP** und deinem persönlichen API-Schlüssel; fertige Konfigurationen findest du unter [Tale aus deinem Editor oder einem Skript nutzen](/de/develop/use-tale-from-your-editor). Sag ihm, was die Automatisierung entgegennehmen und liefern soll und welche Systeme sie verändern darf. Lass ihn die vorhandenen Automatisierungen und das, was deine Organisation hat, ansehen, bevor er eine weitere erstellt. -Der [MCP-Endpunkt](/de/develop/mcp-endpoint) bietet Tools für Dokumentation, Validierung, Speichern, Testen und Bereitstellen. Prüfe den entstandenen Workflow und die Testergebnisse vor der Bereitstellung. Ein Speichervorgang erstellt eine Version, schaltet sie aber nicht live. +Dein Agent arbeitet an einer Automatisierung so, wie du es im Editor tust. Er liest die Referenz und die aktuelle Version, validiert seine Änderung, führt sie mit den Mocks aus und lässt die Tests der Automatisierung laufen. Dann speichert er eine neue Version und nennt dabei die Version, von der er ausgegangen ist. Hat inzwischen jemand eine neuere Version gespeichert, lehnt Tale das Speichern ab; der Agent liest dann diese Version und führt seine Änderung zuerst zusammen. Startet er eine gespeicherte Version mit den Mocks, erscheint der Lauf im Tab **Läufe** der Automatisierung als **Test**-Lauf mit **Von dir gestartet (API)**, sodass du öffnen kannst, was er ausgeführt hat. Eine Version, die der Agent speichert, erscheint im Canvas, während du die Automatisierung ansiehst. + +Speichern erstellt eine Version, schaltet sie aber nicht live. Bevor dein Agent live schaltet, löscht, einen Trigger setzt oder eine Automatisierung in Projekten installiert, fragt dich ein Client wie Claude Code, der Tales Kennzeichnung dieser Tools beachtet, um dein Ja – selbst wenn du den Agent andere Tools ohne Rückfrage ausführen lässt. Prüfe die Version und ihre Testergebnisse, bevor du zustimmst. Jede Änderung deines Agents steht im [Audit-Log](/de/platform/admin/governance/audit-logs) mit **Quelle** Coding-Agent, und der [MCP-Endpoint](/de/develop/mcp-endpoint) listet jedes Tool, das er nutzen kann. ## Entscheidungen während eines Laufs unterscheiden -Ein Agentenknoten arbeitet während eines Automation-Laufs. Er ist nicht der Client, mit dem du den Workflow schreibst. Ebenso genehmigt eine [Freigabe](/de/platform/approvals/concepts) eine ausstehende Operation während der Ausführung und keine vorgeschlagene Änderung an der Workflow-Definition. +Ein Agentenknoten arbeitet während eines Laufs einer Automatisierung. Er ist nicht der Coding-Agent, mit dem du den Workflow schreibst. Ebenso erlaubt eine [Genehmigung](/de/platform/approvals/concepts) eine ausstehende Operation während der Ausführung und keine vorgeschlagene Änderung an der Workflow-Definition. Dein Coding-Agent entscheidet nie über eine Genehmigung: Braucht ein Lauf, den er gestartet hat, eine Genehmigung, wartet er, bis eine Person in Tale entscheidet. -Nutze [den Editor](/de/platform/automations/editor) für direkte Änderungen oder [MCP](/de/develop/mcp-endpoint) für deinen eigenen Client. Beginne mit [einer vorhandenen Automation](/de/platform/automations/catalog), wenn bereits eine passende verfügbar ist. +Nutze [den Editor](/de/platform/automations/editor) für direkte Änderungen oder [MCP](/de/develop/mcp-endpoint) für deinen eigenen Client. Beginne mit [einer vorhandenen Automatisierung](/de/platform/automations/catalog), wenn bereits eine passende verfügbar ist. diff --git a/docs/de/platform/automations/builtin.md b/docs/de/platform/automations/builtin.md index 50aa36fbd7..a96212b600 100644 --- a/docs/de/platform/automations/builtin.md +++ b/docs/de/platform/automations/builtin.md @@ -3,7 +3,7 @@ title: Mitgelieferte Automatisierungen description: Wähle einen mitgelieferten Mail-, GitHub- oder GlitchTip-Workflow, prüfe Eingaben und Verbindungen und erfahre vor dem Deployment, was er liest oder schreibt. --- -Tale enthält zehn Automatisierungspakete: drei für die Postfach-Synchronisierung, drei für Zusammenfassungen, zwei für die GitHub-Prüfung sowie Issue-Importe für GitHub und GlitchTip. Jedes beginnt mit Version 1 und **Nicht live**. Die Issue-Importer laufen manuell; die anderen Pakete enthalten Zeitpläne. Prüfe Eingaben, Modell, Verbindungen und Schreibvorgänge, bevor ein Inhaber, Admin oder Entwickler eine Version live schaltet. +Tale enthält zehn Automatisierungspakete: drei für die Postfach-Synchronisierung, drei für Zusammenfassungen, zwei für die GitHub-Prüfung sowie Issue-Importe für GitHub und GlitchTip. Jedes beginnt mit Version 1 und **Nicht live**. Die Issue-Importer laufen manuell; die anderen Pakete enthalten Zeitpläne, die anfangs ausgeschaltet sind: Nachdem du eine Version live geschaltet hast, bietet der Editor **Trigger einschalten** an. Prüfe Eingaben, Modell, Verbindungen und Schreibvorgänge, bevor ein Inhaber, Admin oder Entwickler eine Version live schaltet. @@ -87,7 +87,7 @@ Beide Workflows benötigen `owner` und `repo`. Gib beim **Testlauf** unter **Ein -Die mitgelieferten GitHub-Zeitpläne liefern weder `owner` noch `repo`. Das Live-Schalten allein macht diese geplanten Läufe deshalb nicht ausführbar. Ein Zeitplan sendet nur `trigger` und `firedAt`; die erforderliche Repository-Eingabe fehlt damit, und der Start wird abgelehnt. Starte manuell mit den benötigten Eingaben oder passe Schema und Repository-Konfiguration an, bevor du geplante Läufe aktivierst. Ein abgelehnter geplanter Start erscheint am [Trigger](/de/platform/automations/triggers) als `start_refused`. +Die mitgelieferten GitHub-Zeitpläne brauchen `owner` und `repo`, ein Zeitplan sendet aber nur `trigger` und `firedAt`. Nachdem du eine Version live geschaltet hast, bietet der Editor deshalb **Trigger prüfen** an, statt den Zeitplan einzuschalten. Öffne im Tab **Allgemein** den Bereich **Feste Eingabe hinzufügen**, wähle **Die 2 fehlenden Felder ergänzen**, ersetze die Platzhalter durch Inhaber und Namen deines Repositorys, schalte **Aktiv** ein und speichere. Jeder geplante Lauf erhält dann diese Werte. Lehnt der Workflow einen Start trotzdem ab, erscheint das am [Trigger](/de/platform/automations/triggers#einen-ausgebliebenen-start-untersuchen) als **Ausgelassen: Die Eingabe des Laufs wurde abgelehnt**. diff --git a/docs/de/platform/automations/catalog.md b/docs/de/platform/automations/catalog.md index 15efb3cd54..8b6ca3edbc 100644 --- a/docs/de/platform/automations/catalog.md +++ b/docs/de/platform/automations/catalog.md @@ -21,7 +21,7 @@ Das Menü **Automatisierung erstellen** bietet zwei Wege: | Auswahl | Geeignet, wenn … | Danach | | --- | --- | --- | -| **Leer (Trigger + Agent)** | du den Ablauf selbst konfigurieren möchtest. | Lege Name, Modell, Anweisungen und Ausstattung fest und wähle dann, wann der Agent läuft. Nach dem Erstellen öffnet sich der Editor für weitere Änderungen. | +| **Leer (Trigger + Agent)** | du den Ablauf selbst konfigurieren möchtest. | Lege Name, Modell, Anweisungen und Ausstattung fest und wähle dann, wann der Agent läuft. **v1 jetzt live schalten** (standardmäßig an) schaltet die erste Version sofort live; sonst bleibt sie ein Entwurf, den du im Editor live schaltest. Was der Trigger sendet, erhält der Agent als seine Eingabe. Nach dem Erstellen öffnet sich der Editor für weitere Änderungen. | | **Paket hochladen** | eine Workflow-Datei oder ein wiederverwendbares Pack vorliegt. | Tale prüft die Dateien und speichert eine Entwurfsversion. | Mitgelieferte Automatisierungen werden beim Erstellen der Organisation eingerichtet. Für den automatischen Einsatz brauchen sie dennoch ihre Konfiguration und eine Live-Version. Der [Workflow-Editor](/de/platform/automations/editor) führt durch Eingaben, Test, Ergebnisprüfung und Live-Schaltung. @@ -114,7 +114,7 @@ settings: label: Strict checklist ``` -Ist das Projekt noch nicht eingerichtet, erscheinen Pflichtformulare vor den Aufgabenfeldern. **Speichern und weiter** schreibt die Formulare und setzt die Aufgabenerstellung fort. Später öffnet **Einstellungen** sie als Tabs. Ein Punkt markiert ungespeicherte Änderungen; **Speichern** schreibt alle geänderten Formulare. Beim Schließen mit offenen Änderungen fragt Tale nach. +Ist das Projekt noch nicht eingerichtet, erscheinen Pflichtformulare vor den Aufgabenfeldern. **Speichern und weiter** schreibt die Formulare und setzt die Aufgabenerstellung fort. Später öffnet **Einstellungen** sie als Tabs. Ein Punkt markiert ungespeicherte Änderungen; **Speichern** schreibt alle geänderten Formulare. Beim Schließen mit offenen Änderungen fragt Tale nach. Die `description` eines Formulars steht über seinen Feldern; ist sie länger als drei Zeilen, siehst du ihren Anfang, und **Weiterlesen** öffnet den Rest. Speichern ersetzt die flache YAML-Datei des Formulars, etwa `Setup/validation-policy.yaml`. Vorhandene Werte werden übernommen, auch aus einer manuell hochgeladenen Datei. Feldtypen sind `text`, `number`, `boolean` und `select`; gespeichert werden Zeichenketten. Textfelder können ein `pattern` vorgeben. Eintragsbezogene `i18n`-Blöcke übersetzen Titel, Beschriftungen, Hilfe und Optionen. Verschachtelte Daten und Listen gehören in separate Dateien, die der Workflow zusätzlich liest. diff --git a/docs/de/platform/automations/concepts.md b/docs/de/platform/automations/concepts.md index bcd721d5c7..6b854709f6 100644 --- a/docs/de/platform/automations/concepts.md +++ b/docs/de/platform/automations/concepts.md @@ -42,17 +42,17 @@ tests: input: { invoiceId: 'inv-1' } ``` -Der `ui`-Block speichert die Positionen auf dem Canvas. Verschieben ändert die Anordnung, nicht die Ausführung einer Node. +Tale ordnet den Canvas anhand der Verweise zwischen den Nodes an, niemand platziert eine Node von Hand. Ein `ui`-Block ist freie Metadaten: Tale behält ihn unverändert und ignoriert ihn. ### Kanten entstehen, sie werden nicht deklariert -Es gibt keine Kantenliste. Eine Node liest eine andere, indem sie sie referenziert — `{{ nodes.invoice.output.id }}` —, und genau diese Referenz _ist_ die Kante, die der Canvas zeichnet. Die Reihenfolge ergibt sich aus einer topologischen Sortierung über diese abgeleiteten Kanten. Deshalb verschwindet mit einer gelöschten Referenz auch ein Pfeil, und deshalb weist die Plattform zwei Nodes zurück, die einander lesen. +Es gibt keine Kantenliste. Eine Node liest eine andere, indem sie sie referenziert — `{{ nodes.invoice.output.id }}` —, und genau diese Referenz _ist_ die Kante, die der Canvas zeichnet. Die Reihenfolge ergibt sich aus einer topologischen Sortierung über diese abgeleiteten Kanten. Deshalb verschwindet mit einer gelöschten Referenz auch eine Linie, und deshalb weist die Plattform zwei Nodes zurück, die einander lesen. Templates nutzen eine einzige `{{ }}`-Grammatik aus JavaScript-Ausdrücken über `input`, `nodes..output` und, innerhalb einer iterierenden Node, `item` und `index`. ### Die Ablaufsteuerung sitzt an der Node -Verzweigen und Wiederholen sind Felder an einer Node statt eigener Schritttypen. Der Canvas zeigt sie deshalb als Badges an genau der Box, die sie betreffen. +Verzweigen und Wiederholen sind Felder an einer Node statt eigener Schritttypen. Der Canvas zeichnet jedes davon dort, wo es wirkt: Aus `when` wird eine Bedingung über ihrer Node, eine Alternative per `elseOf` hängt als Zweig **Nein** an dieser Bedingung, `forEach` und `repeatUntil` setzen die Node in einen Rahmen, und `onError: continue` gibt ihr einen Chip. | Feld | Wirkung | | ---------------------------- | --------------------------------------------------------------------------------------- | @@ -68,9 +68,9 @@ Vier Typen sind eingebaut, und jede Connector-Aktion sowie jede Plattformfunktio **`transform`** führt reines JavaScript aus, um Daten umzuformen. Ohne Netzwerk und ohne Imports: Der Rumpf liest die aufgelöste `input` der Node und muss einen Wert zurückgeben. -**`llm`** ruft ein Sprachmodell mit einem Prompt-Template auf. `model` ist Pflicht und immer ausdrücklich — eine Automatisierung wählt nie eines für dich (das Auto der Chat-Eingabezeile ist eine reine Chat-Sache). Die Ausgabe ist `{text}` oder das Objekt in Form des Schemas, wenn die Node ein `outputSchema` deklariert. Jeder Aufruf in einem Live-Lauf ist Nutzung des Laufs: Er wird vorher gegen die [Budgetlimits](/de/platform/admin/governance/policies-and-limits) geprüft, und ein Aufruf, den ein Limit ablehnt, lässt die Node mit `budget_exceeded` fehlschlagen, was den Lauf abbricht, außer ihr `onError` ist `continue`. +**`llm`** ruft ein Sprachmodell mit einem Prompt-Template auf. `model` ist Pflicht und immer ausdrücklich — eine Automatisierung wählt nie eines für dich (das Auto der Chat-Eingabezeile ist eine reine Chat-Sache). Die Ausgabe ist `{text}` oder das Objekt in Form des Schemas, wenn die Node ein `outputSchema` deklariert. Jeder Aufruf in einem Live-Lauf ist Nutzung des Laufs: Er wird vorher gegen die [Budgetlimits](/de/platform/admin/governance/policies-and-limits) geprüft, und ein Aufruf, den ein Limit ablehnt, lässt die Node mit `budget_exceeded` fehlschlagen, was den Lauf abbricht, außer ihr `onError` ist `continue`. Vor dem Anbieteraufruf reserviert jeder Versuch die geschätzten Prompt-Kosten und das maximale Antwortbudget in allen für diesen Versuch berücksichtigten Projekten. Dafür braucht das Modell Katalogpreise. Sobald der Aufruf endet, ersetzt die gemeldete Nutzung die Reservierung. Bleiben die Kosten wegen einer Zeitüberschreitung, einer unterbrochenen Verbindung oder fehlender Nutzungsdaten unbekannt, bleibt die Reservierung bis zur Anfragefrist bestehen und wird danach als reservierter Schätzwert verbucht; das ist eine Schätzung, keine Anbieterrechnung. Änderungen an Projektzuordnungen während des Aufrufs verschieben dessen Verbrauch nicht. -**`agent`** führt einen Agent-Turn eines Coding-Agents (Claude Code, Codex und die übrigen Agent-Laufzeiten) in der Sandbox aus. Er liest bereitgestellte `files`, nutzt `skills`, vermittelte `connectors`, gewährte Plattform-`tools` und eingespielte `secrets` und gibt `{text, files, status}` zurück; `model` ist Pflicht. Hat ein Admin die [Bildgenerierung](/de/platform/admin/governance/content-models#let-agents-generate-images) eingeschaltet, kann er auch Bilder erstellen, die unter seinen `files` zurückkommen. Greif zu `llm`, wenn eine einmalige Completion reicht, und zu `agent` nur, wenn der Schritt Werkzeuge, Dateien oder mehrere Turns braucht — eine live geschaltete Agent-Node läuft als asynchroner Turn, sitzt daher auf der obersten Ebene statt in einer `subautomation` und iteriert nicht mit `forEach`. +**`agent`** führt einen Agent-Turn eines Coding-Agents (Claude Code, Codex und die übrigen Agent-Laufzeiten) in der Sandbox aus. Er liest bereitgestellte `files`, nutzt `skills`, vermittelte `connectors`, gewährte Plattform-`tools` und eingespielte `secrets` und gibt `{text, files, status}` zurück; `model` ist Pflicht. Die aufgelöste `input` der Node erreicht den Agenten als JSON in `/agent/workspace/input.json`, und seine Anweisungen nennen diese Datei. In einem Live-Lauf schlägt die Node fehl, bevor der Agent startet, wenn dieses JSON größer als 1 MiB ist oder ihre `files` zusätzlich einen Eintrag namens `input.json` enthalten. Hat ein Admin die [Bildgenerierung](/de/platform/admin/governance/content-models#let-agents-generate-images) eingeschaltet, kann er auch Bilder erstellen, die unter seinen `files` zurückkommen. Greif zu `llm`, wenn eine einmalige Completion reicht, und zu `agent` nur, wenn der Schritt Werkzeuge, Dateien oder mehrere Turns braucht — eine live geschaltete Agent-Node läuft als asynchroner Turn, sitzt daher auf der obersten Ebene statt in einer `subautomation` und iteriert nicht mit `forEach`. **`subautomation`** führt eine andere gespeicherte Automatisierung als einzelne Node aus; ihr Feld `automation` benennt `"name"` oder `"name@version"`. Ohne Version läuft die live geschaltete, und die Verschachtelung endet bei drei Ebenen. @@ -80,11 +80,17 @@ Eine **strukturierte** Ausgabe hat benannte Felder, die du über `nodes..out Ein Werkzeug ohne Ausgabeschema liefert unstrukturierte Ausgabe. Soll daraus strukturierte Eingabe für weitere Schritte entstehen, nutze eine `llm`-Node mit `outputSchema`. Die Validierung nennt bei einem Fehler die ungültige Referenz und die zulässigen Felder oder Kontexte. Korrigiere die Referenz, bevor du erneut speicherst. +## Pfade, die ein Lauf nehmen kann {#paths} + +Jede Bedingung und jede Node, die fehlschlagen darf, während der Lauf weitergeht, eröffnet einem Lauf zwei Möglichkeiten. Tale probiert jede Kombination davon aus und behält die unterschiedlichen Wege, die ein erfolgreicher Lauf nehmen kann; jeder davon ist ein Pfad. Ein Pfad nennt die Bedingungen, die über ihn entscheiden, etwa welche Nodes laufen, welche übersprungen werden und welche fehlschlagen, während der Lauf weitergeht, und die Nodes, die auf ihm laufen. Eine Node, die auf jedem Pfad läuft, läuft immer; eine Node, die auf keinem läuft, kann nie laufen, und Tale warnt davor. + +Tale führt bis zu 32 Pfade auf und zählt die übrigen. Bei mehr als 12 Bedingungen und hingenommenen Fehlern sind die Kombinationen zu viele zum Durchgehen, deshalb führt Tale dann keinen Pfad auf; es sagt aber weiterhin bei jeder Node, wann sie läuft. Außerdem nennt Tale die Nodes, deren Fehler den Lauf beendet, und was jede von ihnen fehlschlagen lassen kann. Der Editor zeigt die Pfade im Canvas, wie [Den möglichen Pfaden folgen](/de/platform/automations/editor#paths) beschreibt; ein Client des [MCP-Endpoints](/de/develop/mcp-endpoint) liest dieselben Pfade aus `analysis.paths`. + ## Was Tale vor einem Lauf prüft {#checks} Tale prüft das ganze Dokument, wenn du es speicherst, wenn du eine Version bereitstellst und wann immer ein Client `validate_automation` aufruft. Ein **Fehler** beschreibt etwas, das sicher scheitert, oder Code, der die Analysegrenzen überschreitet. Er verhindert Speichern wie Bereitstellen. Eine **Warnung** zeigt auf etwas, das scheitern kann oder nichts Nützliches tut. Sie verhindert weder Speichern noch Bereitstellen; du entscheidest selbst, ob du etwas änderst. Jedes Problem nennt seine Node und sein Feld und, in einem Template, einer Bedingung oder in Code, den genauen Ausdruck. -Damit die Prüfung zügig bleibt, gelten für jeden Ausdruck und jeden `transform`-Code Grenzen von 8192 UTF-16-Codeeinheiten, 512 JavaScript-Tokens und 64 Verschachtelungsebenen in der Syntax oder im Syntaxbaum. Leerraum um einen Template-Ausdruck zählt nicht zu seiner Größe; Leerraum im Transform-Code zählt mit. Reiner Text außerhalb von Templates ist kein Code. Diese Grenzen können zuvor gültigen Code ablehnen. Kürze ihn oder verteile die Arbeit auf mehrere Nodes, bevor du erneut speicherst oder bereitstellst. +Damit die Prüfung zügig bleibt, ist jeder Ausdruck auf 8192 UTF-16-Codeeinheiten und 512 JavaScript-Tokens begrenzt. Für `transform`-Code gelten 16384 Codeeinheiten und 4096 Tokens. Beide dürfen höchstens 64 Verschachtelungsebenen in der Syntax oder im Syntaxbaum enthalten. Leerraum um einen Template-Ausdruck zählt nicht zu seiner Größe; Leerraum im Transform-Code zählt mit. Reiner Text außerhalb von Templates ist kein Code. Diese Grenzen können zuvor gültigen Code ablehnen. Kürze ihn oder verteile die Arbeit auf mehrere Nodes, bevor du erneut speicherst oder bereitstellst. ### Referenzen und Namen {#checks-references} @@ -121,6 +127,12 @@ Eine Bedingung, die immer dieselbe Antwort liefert, entscheidet nichts. Text um Eine `subautomation`-Node wird gegen die Version geprüft, die ein Lauf aufrufen würde: die genannte Version, sonst die bereitgestellte, sonst die neueste. Diese Version muss existieren und darf keine `agent`-Node enthalten. Tale warnt, wenn die Eingabe nicht zu ihren `inputs` passt und wenn sie einen Schreibzugriff ausführt, den eine Freigabe aufhalten könnte, denn eine aufgerufene Automatisierung kann nicht warten. Auch ein Zeitplan-Trigger, dessen Starteingabe die `inputs` der Automatisierung ablehnen, wird gemeldet. +### Was die Organisation hat {#checks-organization} + +Tale vergleicht eine `agent`-Node außerdem mit deiner Organisation. Es warnt, wenn die Node einen Skill verlangt, den kein Lauf der Automatisierung verwenden kann, einen Connector, den niemand verbunden hat, ein Secret, das niemand gespeichert hat, oder eine Agent-Laufzeit, die dieses Deployment nicht ausführen kann. Dieselbe Warnung bekommt eine Node, die eine Connector-Aktion ausführt, deren Connector niemand verbunden hat, und ein Ereignis-Trigger, der auf ein Ereignis wartet, das Tale nicht auslöst. Im Lauf schlägt die Node fehl, wenn ihr Skill oder ihre Agent-Laufzeit fehlt; ohne ihren Connector erreicht sie die App nicht, und ein fehlendes Secret ist einfach nicht vorhanden. + +Es bleiben Warnungen, weil sich deine Organisation bis zum Lauf ändern kann: Verbinde den Connector oder füge den Skill hinzu, dann meldet die nächste Prüfung nichts mehr. Über Secrets erfahren nur Inhaber, Admins und Entwickler etwas, denn nur sie sehen, welche Secrets es gibt. + ### Tests {#checks-tests} Die Eingabe eines Tests muss zu `inputs` passen, jeder erwartete Effekt muss von einer Node stammen, die ihn ausführt, und ein erwarteter Ausgabewert muss einen Typ haben, den die Automatisierung zurückgeben kann. Ein Test, der gegen eine dieser Regeln verstößt, kann nie bestehen, deshalb warnt Tale, bevor du ihn ausführst. @@ -145,7 +157,7 @@ Ein Live-Lauf braucht eine bereitgestellte Version. Einen gespeicherten Entwurf ## Was einen Lauf startet -Eine gespeicherte Version kannst du manuell testen; die bereitgestellte Version lässt sich live ausführen. Für automatische Starts richtest du eine von drei Trigger-Arten ein: einen Zeitplan mit Cron-Ausdruck und IANA-Zeitzone, eine durch ein Token geschützte Webhook-URL oder ein benanntes Plattformereignis. +Eine gespeicherte Version kannst du manuell testen; die bereitgestellte Version lässt sich live ausführen. Für automatische Starts richtest du eine von drei Trigger-Arten ein: einen Zeitplan, der sich zu festen Uhrzeiten oder in einem Intervall in seiner Zeitzone wiederholt, eine durch ein Token geschützte Webhook-URL oder ein benanntes Plattformereignis. Jeder davon kann eine feste Eingabe mitgeben, die jeder Lauf erhält. Der Trigger gehört zum Namen der Automatisierung. Bei einer neuen Bereitstellung bleiben Konfiguration und Webhook-URL erhalten; nachfolgende Starts verwenden die neu bereitgestellte Version. Deaktiviere den Trigger, um automatische Starts zu pausieren. [Workflow-Trigger](/de/platform/automations/triggers) erklärt Zeitsteuerung, Anmeldung und die Eingabe jeder Trigger-Art. diff --git a/docs/de/platform/automations/editor.md b/docs/de/platform/automations/editor.md index 4d35471157..68f8c8efa8 100644 --- a/docs/de/platform/automations/editor.md +++ b/docs/de/platform/automations/editor.md @@ -1,25 +1,25 @@ --- title: Der Workflow-Editor -description: Prüfe und ändere Knoten, gib Testdaten ein, speichere eine Version und schalte sie live oder kehre zu einer früheren zurück. +description: Lies eine Automatisierung im Canvas, folge ihren möglichen Pfaden, ändere Felder einer Node, speichere eine Version und schalte sie live oder kehre zu einer früheren zurück. --- -Im Workflow-Editor änderst du den Ablauf einer Automatisierung und wählst die gespeicherte Version für Live-Läufe. Änderungen brauchen Entwickler-, Admin- oder Inhaberrechte. Speichern, Testen und Bereitstellen sind getrennte Schritte: Die Arbeit an einem Entwurf lässt die bereitgestellte Version bestehen. +Im Workflow-Editor liest du, was eine Automatisierung tut, änderst ihre Felder und wählst die gespeicherte Version für Live-Läufe. Größere Änderungen, etwa neue Nodes, kommen von einem Coding-Agent über MCP. Änderungen brauchen Entwickler-, Admin- oder Inhaberrechte. Speichern, Testen und Bereitstellen sind getrennte Schritte: Die Arbeit an einem Entwurf lässt die bereitgestellte Version bestehen. Öffne **Automatisierungen** und wähle einen Eintrag. Er öffnet sich im Tab **Editor**. Öffnest du eine Automatisierung im Tab **Automatisierungen** eines Projekts, beginnt der Navigationspfad mit diesem Projekt: Wähle den Projektnamen, um zum Projekt zurückzukehren, oder **Automatisierungen**, um zu seinen Automatisierungen zurückzukehren. Ob du eine Automatisierung in einem Projekt oder in der Liste öffnest, die Navigationsleiste markiert **Automatisierungen**. Für einen neuen Ablauf beginne mit [Automatisierungen erstellen oder importieren](/de/platform/automations/catalog). | Tab | Wofür du ihn nutzt | | --- | --- | -| **Editor** | Den Workflow ändern, eine gespeicherte Version testen und die Live-Version wählen. | +| **Editor** | Den Workflow lesen und ändern, eine gespeicherte Version testen und die Live-Version wählen. | | **Allgemein** | Festlegen, was die Automatisierung startet und welche Projekte sie nutzen können. | | **Läufe** | Die letzten Ausführungen prüfen und den vollständigen Datensatz eines Laufs öffnen. | Die Auswahl **Version** bleibt auf Desktop und Smartphone rechts neben den Tabs Editor, Allgemein und Läufe. Sie zeigt Versionsnachrichten, Datum, Testergebnisse und die Live-Markierung. Wähle eine Zeile, um diese Version zu öffnen. Am Desktop stehen die Laufaktionen neben den Tabs, zusammen mit **Speichern** und **Verwerfen**; unter **Allgemein** stehen dort nur **Speichern** und **Verwerfen**. Ein Punkt an einem Tab kennzeichnet dessen ungespeicherte Änderungen. Beim Verlassen des Tabs oder einem Versionswechsel fragt Tale, wie du damit fortfahren möchtest. -Auf dem Smartphone startet eine geöffnete Automatisierung mit kompakter Navigation. Die Arbeitsfläche des Editors nutzt die verfügbare Höhe. Lauf- und Bereitstellungsaktionen befinden sich innerhalb der Arbeitsfläche neben den Zoom-Steuerelementen. Wenn du einen Knoten auswählst, öffnen sich seine Felder — mit Speichern und Verwerfen — in einem Bereich am unteren Bildschirmrand. +Auf dem Smartphone startet eine geöffnete Automatisierung mit kompakter Navigation. Der Canvas des Editors nutzt die verfügbare Höhe, und Lauf- und Bereitstellungsaktionen stehen in einer Leiste am unteren Rand des Canvas. Wenn du eine Node auswählst, öffnen sich ihre Felder — mit Speichern und Verwerfen — in einem Bereich am unteren Bildschirmrand. - + -![Der Workflow-Editor zeigt verbundene Knoten und die Felder des ausgewählten Knotens neben dem Canvas.](/images/platform/automation-editor-canvas.webp) +![Der Workflow-Editor zeigt die Nodes von Gmail triage inbox zwischen Start und Ende, eine in Worten formulierte Bedingung über einer Node und die Felder der ausgewählten Node neben dem Canvas.](/images/platform/automation-editor-canvas.webp) @@ -27,25 +27,113 @@ Zum Wechseln musst du nicht zur Liste zurück: Klick im Navigationspfad auf den ## Den Canvas lesen -Jeder Kasten ist ein Knoten. Seine Beschriftung nennt Schritt und Typ; **Liest** zeigt verwendete Ausgaben anderer Knoten. Pfeile entstehen aus Referenzen wie `{{ nodes.draft.output.text }}`. Ändere die Referenz, um eine Abhängigkeit zu ändern. Das Zeichnen eines Pfeils erstellt keine Abhängigkeit. +Tale zeichnet den Canvas aus dem Dokument der Automatisierung und ordnet ihn selbst an: **Start** steht oben, **Ende** unten, und jede Node steht unter den Nodes, die sie liest. So liest sich der Canvas von oben nach unten in der Reihenfolge, in der ein Lauf vorgeht. Niemand platziert einen Kasten, und Zeichnen verbindet nichts. Eine Linie entsteht aus einer Referenz wie `{{ nodes.draft.output.text }}`; um zu ändern, was eine Node liest, änderst du die Referenz. -Kennzeichnungen zeigen Bedingungen und Schleifen wie `when`, `else of`, `for each`, `repeat until` und `continue on error`. Eine Zykluswarnung bedeutet, dass mehrere Knoten voneinander abhängen. Entferne die kreisförmige Referenz, bevor du eine ausführbare Version speicherst. +### Start und Ende -## Einen Knoten bearbeiten +**Start** zeigt, was einen Lauf startet und was er erhält. Unter **Startet** steht der Trigger in Worten, etwa ein Zeitplan mit Zeitzone und nächstem Lauf, und ob der Trigger aus ist oder auf eine Live-Version wartet. Danach folgt **Von Hand, über die API oder MCP**, denn diese Starts sind immer möglich. Unter **Eingabe** stehen die Felder der Laufeingabe mit ihrem Typ und der Angabe, ob sie Pflicht sind. Würde der Trigger Läufe mit einer Eingabe starten, die die Automatisierung ablehnt, sagt Start das. -Wähle einen Kasten, um seine Felder zu öffnen. Auf einem breiten Bildschirm erscheint der Bereich neben dem Canvas; ohne ausgewählten Knoten nutzt der Canvas die ganze Breite. Auf schmaleren Bildschirmen öffnen sich die Felder in einem Dialog über dem Canvas. Ein `transform` hat **Code**, ein `llm` Felder für Prompt, Modell und Ausgabeschema. Ein `agent` ergänzt Agent-Laufzeit und Ausstattung. Die **Modell**-Auswahl einer `llm`- oder `agent`-Node listet die Modelle, die die verbundenen Anbieter deiner Organisation bedienen; ein nicht aufgeführtes Modell lässt sich eingeben, doch **Probleme** warnt dann, dass ein Live-Lauf an dieser Node fehlschlägt, bis sein Anbieter verbunden ist. **Eingabe** enthält JSON-Werte und Referenzen für diesen Knoten. Unvollständiges JSON wird gemeldet und ändert den Knoten nicht. +**Ende** zeigt, was ein erfolgreicher Lauf zurückgibt und wie ein Lauf enden kann. Unter **Gibt zurück** steht die Ausgabe, etwa **Die Ausgabe von Report**, oder ihre Felder mit den Nodes, aus denen sie stammen; ein Feld, das bei manchen Läufen leer bleibt, trägt **kann leer sein**. Unter **Endet** stehen die drei Ausgänge: **Erfolgreich** gibt die Ausgabe zurück, **Fehlgeschlagen** tritt ein, wenn eine der Nodes fehlschlägt, die den Lauf stoppen, und **Gestoppt**, wenn jemand den Lauf stoppt. -Öffne **Ablaufsteuerung** für Bedingungen und Wiederholungen. Hat der Knoten welche, ist der Abschnitt schon offen. Mit **Schließen** kehrst du zum Canvas zurück. Auf einem breiten Bildschirm schließt sich der Bereich auch, wenn du auf den leeren Canvas klickst oder Escape außerhalb eines Textfelds drückst. Trigger und Projekteinstellungen der Automatisierung findest du im Tab **Allgemein**. [Automatisierungsgrundlagen](/de/platform/automations/concepts) erklärt Knotentypen und Ausdrücke. +### Nodes + +Jede Node ist ein Kasten. Die erste Zeile zeigt ihr Symbol und ihren Titel, der aus ihrer ID entsteht: Aus `open_issues` wird **Open issues**. Die nächste Zeile nennt die Art der Node: Connector und Aktion, etwa **GitHub · Issues auflisten**, **Transformation**, **Sprachmodell** oder **Agent** mit ihrem Modell oder die Automatisierung, die sie aufruft. Weiß Tale, was die Node zurückgibt, zeigt eine Zeile die Struktur, etwa `{ issues: object[] }`. Die unterste Zeile sagt, was die Node liest, etwa **Liest Issues und die Laufeingabe (owner, repo)**, oder **Liest keine andere Node**. + +Chips und kleine Symbole ergänzen, was die Anordnung nicht zeigen kann. **Läuft bei Fehler weiter** markiert eine Node, deren Fehler der Lauf hinnimmt, und **Läuft nie** eine Node, die keine Kombination von Bedingungen erreicht. Ein Schild markiert eine Node, die Daten in einem verbundenen Dienst ändert; dort kann ein Live-Lauf auf eine Freigabe warten. Eine Sprechblase markiert einen Agent, der eine Frage stellen kann, und eine durchgestrichene Nadel ein Modell ohne festen Anbieter. Zeig auf ein Symbol, um seinen Satz zu lesen; ein Screenreader hört ihn mit dem Kasten. Ein Kasten mit Problemen zeigt ihre Anzahl in seiner ersten Zeile. + +### Bedingungen und Zweige + +Die Bedingung einer Node (`when`) steht als Pille über ihr und sagt die Bedingung in Worten, etwa „total von Score größer als 1.000 ist“. Die Node darunter läuft nur, wenn die Bedingung zutrifft. Ist eine andere Node ihre Alternative (`elseOf`), teilt sich die Bedingung in zwei Linien: **Ja** führt zur Node links, die läuft, wenn die Bedingung zutrifft, und **Nein** zu ihrer Alternative rechts. Eine Bedingung, die Tale nicht in Worte fassen kann, zeigt den Ausdruck selbst in Codeschrift. + +```yaml +nodes: + - id: escalate + type: transform + when: '{{ nodes.score.output.total > 1000 }}' + input: { total: '{{ nodes.score.output.total }}' } + code: 'return { text: "Escalate " + input.total };' + - id: file + type: transform + elseOf: escalate + input: { total: '{{ nodes.score.output.total }}' } + code: 'return { text: "File " + input.total };' +``` + +In diesem Ausschnitt lautet die Bedingung über Escalate „total von Score größer als 1.000 ist“, **Ja** führt zu Escalate und **Nein** zu File. Zeig auf eine Bedingung oder auf ihr **Ja** oder **Nein**, um die Pfade hervorzuheben, die durch sie führen. + +### Linien, Rahmen und gestrichelte Kästen + +Eine durchgezogene Linie bedeutet, dass die untere Node die Ausgabe der oberen liest. Eine gestrichelte Linie bedeutet, dass die untere Node nach der oberen läuft, ohne ihre Ausgabe zu lesen, etwa weil ihre Bedingung sie liest. Eine gepunktete Linie zu Ende verlässt die letzte Node eines Laufs, deren Ausgabe Ende nicht zurückgibt. Die Linien **Ja** und **Nein** haben eigene Farben. + +Ein Rahmen um eine Node zeigt, dass sie mehrmals läuft: einmal für jedes Element einer Liste (**Für jedes Element von …**) oder erneut, bis eine Bedingung zutrifft (**Wiederholt sich, bis …, höchstens 5×**). Ein gestrichelter Kasten ist eine Node, die vielleicht nicht läuft; nach einem Lauf ist es eine Node, die nicht gelaufen ist. **Legende** neben den Zoom-Steuerelementen erklärt jede Art von Linie und Kasten. + +### Tastatur und Listenansicht + +Das Diagramm ist ein einziger Halt in der Tab-Reihenfolge. Springst du mit Tab hinein, landet der Fokus auf Start; die Pfeiltasten folgen den Linien von Kasten zu Kasten und entlang einer Reihe, Pos1 und Ende springen zu Start und Ende, und die Eingabetaste öffnet den Kasten im Fokus. Ein Screenreader liest zu jedem Kasten Titel, Art und was er liest; bei einer Bedingung hört er, über welche Node sie entscheidet. + +Mit dem Ansichtsschalter oben links im Canvas wechselst du zwischen **Canvas**, **Liste** und **Quelltext**. **Liste** zeigt dieselben Nodes in der Reihenfolge des Laufs, jede mit dem, was sie liest, und mit ihrer Bedingung in Worten; auch dort öffnet die Eingabetaste eine Node. Ist der Canvas sehr schmal, beginnt er mit **Liste**. Die Adresse behält die Ansicht und die geöffnete Node, sodass ein geteilter Link beides wieder öffnet. + +### Wenn eine neue Version eintrifft {#new-versions} + +Während du die Automatisierung ansiehst, kann jemand eine neue Version speichern, etwa ein Coding-Agent über MCP. Siehst du die neueste Version an und hast keine ungespeicherten Änderungen, wechselt der Canvas zur neuen: Die Kästen gleiten an ihre neuen Plätze, neue Kästen blenden sich ein, geänderte erhalten einmal einen Ring, und ein Screenreader hört „Jetzt wird v6 angezeigt.“. Die geöffnete Node bleibt offen, solange es sie noch gibt. Hast du ungespeicherte Änderungen, bewegt sich nichts. Ein Hinweis über dem Canvas meldet **Eine neuere Version wurde gespeichert**, und **v6 zeigen und Entwurf verwerfen** wechselt zu ihr. + +## Den möglichen Pfaden folgen {#paths} + +Die Bedingungen eines Laufs entscheiden, welche Nodes laufen. Die Pfad-Schaltfläche oben rechts im Canvas zählt die Wege, die ein erfolgreicher Lauf nehmen kann, etwa **3 Pfade**, und öffnet **Mögliche Pfade**. Jeder Pfad nennt die Bedingungen, die über ihn entscheiden, etwa „Triage läuft“ oder „Propose schlägt fehl, der Lauf geht weiter“, und wie viele Nodes auf ihm laufen. + +Zeig auf einen Pfad oder wechsle mit den Pfeiltasten zu ihm, um ihn im Canvas als Vorschau zu sehen. Klick ihn an oder drück die Eingabetaste, damit er angezeigt bleibt: Nodes abseits des Pfads werden gestrichelt und sagen, warum sie nicht laufen, Ende markiert die Ausgaben, die auf diesem Pfad leer bleiben, und ein Screenreader hört, welcher Pfad angezeigt wird. **Alle zeigen** oder Esc zeigt wieder jede Node. Die Liste bleibt offen, während du Nodes auswählst, damit du einen Pfad mit den Feldern einer Node vergleichen kannst. + +Unter **Beendet den Lauf, wenn sie fehlschlägt** nennt die Liste die Nodes, deren Fehler den Lauf stoppt, und was jede von ihnen fehlschlagen lassen kann. Zeig auf eine davon, um alle rot einzukreisen; wähle eine aus, um sie zu öffnen. + +Auf dem Smartphone öffnet sich die Liste in einem Bereich am unteren Bildschirmrand. Wählst du einen Pfad, schließt sich der Bereich, und oben im Canvas bleibt eine Pille mit dem Namen des Pfads und **Alle zeigen**. Nimmt jeder Lauf denselben Pfad, sagt die Liste das. Bei mehr als 12 Bedingungen und hingenommenen Fehlern gibt es zu viele Pfade für eine Liste; **Wann sie läuft** sagt trotzdem bei jeder Node, wann sie läuft. Ein Canvas mit einem Zyklus hat keine Pfad-Schaltfläche. [Pfade, die ein Lauf nehmen kann](/de/platform/automations/concepts#paths) erklärt, wie Tale die Pfade ermittelt. + +## Eine Node bearbeiten + +Wähle einen Kasten, um ihn zu öffnen. Auf einem breiten Bildschirm öffnet sich der Inspektor neben dem Canvas; ohne ausgewählte Node nutzt der Canvas die ganze Breite. Auf schmaleren Bildschirmen öffnet er sich in einem Bereich über dem Canvas. Sein Kopf zeigt den Titel der Node, ihre Art und ihre ID mit **Node-ID kopieren**; darunter stehen die Probleme, die zu ihr gehören. **Wann sie läuft** fasst zusammen, welchen Platz die Node im Ablauf hat: bei jedem Lauf, auf einigen Pfaden oder nie, warum sie übersprungen werden kann und was passiert, wenn sie fehlschlägt, etwa „Schlägt sie fehl, stoppt der Lauf mit ihrem Fehler.“ + +Danach folgen drei Tabs: + +- **Felder** enthält, was du ändern kannst. Ein `transform` hat **Code**, ein `llm` **Prompt**, **System-Prompt**, **Modell** und **Ausgabeschema**, ein `agent` zusätzlich Agent-Laufzeit und Ausstattung. **Eingabe** enthält die JSON-Werte und Referenzen, die die Node erhält. +- **Struktur** zeigt, was die Node erhält und zurückgibt, woher Tale diese Struktur kennt und welche Nodes ihre Ausgabe lesen. Wähle eine lesende Node, um sie zu öffnen. **Als TypeScript zeigen** zeigt dieselbe Struktur als Typ. +- **Letzter Lauf** zeigt **Aufgelöste Eingabe**, **Ausgabe** und Effekte der Node in dem Lauf, den der Canvas zeigt. Der Tab erscheint, solange der Canvas einen Lauf zeigt. + +Die **Modell**-Auswahl einer `llm`- oder `agent`-Node listet die Modelle, die die verbundenen Anbieter deiner Organisation bedienen; ein nicht aufgeführtes Modell lässt sich eingeben, doch **Probleme** warnt dann, dass ein Live-Lauf an dieser Node fehlschlägt, bis sein Anbieter verbunden ist. + +Öffne **Ablaufsteuerung** für Bedingung, Wiederholung und Fehlerbehandlung der Node; nutzt die Node eines davon, ist der Abschnitt schon offen. **Wenn**, **Für jedes** und **Wiederholen bis** nehmen Ausdrücke auf. **Sonst zu** bietet nur Nodes mit einer Bedingung an, und **Keine** entfernt die Alternative. **Maximale Wiederholungen** erscheint mit **Wiederholen bis** und nimmt eine ganze Zahl von 1 bis 20. **Bei Fehler** wählt zwischen **Lauf stoppen** und **Ohne sie weiterlaufen**; geht der Lauf weiter, wird jede Node übersprungen, die die Ausgabe der fehlgeschlagenen Node liest. Unter einer Bedingung, einer Liste oder einer Alternative sagt ein Satz in Worten, was die Einstellung bewirkt. + +Mit **Schließen** kehrst du zum Canvas zurück. Auf einem breiten Bildschirm schließt sich der Bereich auch, wenn du auf den leeren Canvas klickst oder außerhalb eines Textfelds Esc drückst. Trigger und Projekteinstellungen der Automatisierung findest du im Tab **Allgemein**. [Automatisierungsgrundlagen](/de/platform/automations/concepts) erklärt Node-Typen und Ausdrücke. + +### Code, Prompts und JSON + +Code, Prompts, Bedingungen und JSON-Felder sind Code-Editoren. Sie färben die Syntax und jedes `{{ }}`-Template ein und kennen die Automatisierung. Tippst du `{{` in einen Prompt, erscheinen die schließenden Klammern mit dem Cursor dazwischen; nach `nodes.` siehst du nur die Nodes, die vorher laufen, und nach `.output.` die Felder dieser Node mit ihren Typen. Strg+Leertaste öffnet die Vorschläge überall. Zeig auf eine Referenz, um ihren Typ zu sehen, oder drück ⌘K ⌘I (Strg+K Strg+I), damit der Typ an der Cursorposition angezeigt und vorgelesen wird. + +Kurz nachdem du aufhörst zu tippen, ist ein Problem genau dort unterstrichen, wo es steht. F8 und Umschalt+F8 springen zum nächsten und vorherigen Problem und lesen es vor; ⌘. (Strg+.) wendet eine vorgeschlagene Korrektur an, etwa den ähnlichsten Node-Namen. In einem mehrzeiligen Feld rückt Tab ein; um es mit der Tastatur zu verlassen, drück Esc und dann Tab. **Editor vergrößern** öffnet ein langes Feld in einem größeren Editor, und **Zurück zum Feld** kehrt mit deiner Änderung und deinem Cursor an derselben Stelle zurück. + +Ein JSON-Feld wie **Eingabe** ändert die Node erst, wenn sein Text gültiges JSON der richtigen Art ist. Während du tippst, behält die Node ihren letzten gültigen Wert, und das Feld sagt, was fehlt, etwa „Das muss ein JSON-Objekt in geschweiften Klammern sein.“ + +### Eingaben bei Start, Ausgabe bei Ende + +Wähle **Start**, um zu sehen, was die Automatisierung startet. **Trigger** nennt es in Worten; **In Allgemein ändern** öffnet den Tab **Allgemein**, in dem du den Trigger einstellst. Unter **Felder** zeigt **Eingaben** die Felder der Laufeingabe als Baum, und **Eingabeschema** enthält das JSON-Schema dahinter, das du bearbeiten kannst. **Struktur** zeigt die Eingabe so, wie Tale sie liest, und **Letzter Lauf** die Eingabe des angezeigten Laufs. + +Wähle **Ende**, um zu sehen, was ein Lauf zurückgibt. **Wie ein Lauf endet** nennt die drei Ausgänge; unter **Fehlgeschlagen** ist jede Node, deren Fehler den Lauf stoppt, eine Schaltfläche, die sie öffnet. Unter **Felder** enthält **Ausgabe** den JSON-Wert, den ein erfolgreicher Lauf zurückgibt, mit Templates wie `{{ nodes.report.output }}`. **Struktur** zeigt die Struktur der Ausgabe und **Letzter Lauf** die Ausgabe des angezeigten Laufs. + +## Den Quelltext lesen + +Wähle im Ansichtsschalter **Quelltext**, um das ganze Dokument als YAML zu lesen: eingefärbt, mit Zeilennummern, Einklappen und Suche (⌘F oder Strg+F). Jedes Problem, das die Prüfung gefunden hat, ist in der Zeile unterstrichen, die es betrifft. So hat auch ein Problem in einem Teil ohne eigenes Feld, etwa in einem Test oder im Namen, einen Ort, an dem du es liest. Der Quelltext ist schreibgeschützt: **YAML kopieren** kopiert ihn, und **YAML herunterladen** speichert ihn als Datei, die nach Automatisierung und Version benannt ist, etwa `gmail-triage-inbox-v3.yml`; solange du ungespeicherte Änderungen hast, kommt `-draft` dazu. Um das Dokument zu ändern, nutze die Felder oder deinen Coding-Agent. + +## Mit deinem Coding-Agent bearbeiten + +Größere Änderungen, etwa neue Nodes oder ein umgebauter Ablauf, kommen von einem Coding-Agent wie Claude Code, Codex oder Cursor, der mit dem MCP-Server von Tale verbunden ist. **Mit deinem Coding-Agent bearbeiten** ist in jeder Ansicht die letzte Schaltfläche oben rechts im Canvas und die Hauptaktion einer Automatisierung, die noch keine Nodes hat. Ihr Dialog zeigt den Namen der Automatisierung, den du dem Agent gibst, **MCP einrichten**, das **Einstellungen > API > MCP** öffnet, und **So verbindest du einen Coding-Agent**, das die Anleitung zum [MCP-Endpoint](/de/develop/mcp-endpoint) öffnet. Der Agent liest die Automatisierung, ändert und prüft sie und speichert eine neue Version, die dann im Canvas erscheint, wie [Wenn eine neue Version eintrifft](#new-versions) beschreibt. ## Probleme finden und beheben -Während du bearbeitest, prüft Tale den Entwurf so, wie es auch jedes Speichern prüft. Kurz nachdem du aufhörst zu tippen, zeigt die Schaltfläche **Probleme** neben **Speichern**, was die Prüfung gefunden hat: ein rotes Fehlersymbol und ein gelbes Warnsymbol, jeweils mit ihrer Anzahl, oder **Keine Probleme**. Auf dem Smartphone sitzt die Schaltfläche in der Leiste über dem Canvas. Ein Fehler ist etwas, woran ein Lauf scheitern würde, etwa eine Referenz auf einen Knoten, den es nicht gibt. Eine Warnung ist etwas, das schiefgehen kann, etwa das Lesen der Ausgabe eines Knotens, der manchmal übersprungen wird. Ein Knoten mit Problemen zeigt dieselben Zahlen auf seinem Kasten, und ein Feld mit einem Problem erklärt es direkt darunter. +Während du bearbeitest, prüft Tale den Entwurf so, wie es auch jedes Speichern prüft. Kurz nachdem du aufhörst zu tippen, zeigt die Schaltfläche **Probleme** neben **Speichern**, was die Prüfung gefunden hat: ein rotes Fehlersymbol und ein gelbes Warnsymbol, jeweils mit ihrer Anzahl, oder **Keine Probleme**. Auf dem Smartphone sitzt die Schaltfläche in der Leiste über dem Canvas. Ein Fehler ist etwas, woran ein Lauf scheitern würde, etwa eine Referenz auf eine Node, die es nicht gibt. Eine Warnung ist etwas, das schiefgehen kann, etwa das Lesen der Ausgabe einer Node, die manchmal übersprungen wird. Eine Node, eine Bedingung, Start oder Ende mit Problemen zeigt dieselben Zahlen auf ihrem Kasten, und ein Feld mit einem Problem erklärt es direkt darunter. -Klicke auf **Probleme**, um sie aufzulisten. Auf einem breiten Bildschirm öffnet sich die Liste unter dem Canvas, auf schmaleren Bildschirmen in einem eigenen Bereich. Jeder Eintrag sagt, was falsch ist, wo, warum und wie du es behebst. **Technische Details** zeigt die Meldung der Engine selbst, und der Code neben dem Titel hilft dir bei der Suche oder im Support. **Alle**, **Fehler** und **Warnungen** filtern die Liste, Escape schließt sie. +Klicke auf **Probleme**, um sie aufzulisten. Auf einem breiten Bildschirm öffnet sich die Liste unter dem Canvas, auf schmaleren Bildschirmen in einem eigenen Bereich. Jeder Eintrag sagt, was falsch ist, wo, warum und wie du es behebst. **Technische Details** zeigt die Meldung der Engine selbst, und der Code neben dem Titel hilft dir bei der Suche oder im Support. **Alle**, **Fehler** und **Warnungen** filtern die Liste, Esc schließt sie. -Wähle einen Eintrag oder drücke darauf die Eingabetaste, um dorthin zu gelangen: Der Knoten öffnet sich, sein Feld erhält den Fokus, und wo das Feld den Text so zeigt, wie er gespeichert ist, ist die Stelle markiert, die das Problem verursacht. Ein Problem ohne eigenes Feld, etwa ein Modell, das deine Organisation nicht bereitstellt, steht unter **Probleme in dieser Node** oben in den Feldern des Knotens. Ein Problem in einem Teil der Automatisierung, den der Editor nicht zeigt, etwa in ihrer Ausgabe oder ihren Tests, sagt, dass es sich hier nicht bearbeiten lässt; ändere diesen Teil über MCP, die API oder ein hochgeladenes Paket. +Wähle einen Eintrag oder drücke darauf die Eingabetaste, um dorthin zu gelangen: Die Node öffnet sich, ihr Feld erhält den Fokus, und die Stelle, die das Problem verursacht, ist markiert. Ein Problem ohne eigenes Feld, etwa ein Modell, das deine Organisation nicht bereitstellt, steht unter **Probleme in dieser Node** oben in den Feldern der Node. Ein Problem in den Eingaben öffnet **Start**, eines in der Ausgabe öffnet **Ende**, und eines in einem anderen Teil des Dokuments, etwa in einem Test oder im Namen, öffnet **Quelltext** an dieser Zeile. Ein Problem in einer Node, die dein Entwurf nicht mehr hat, sagt „Ändere das mit deinem Coding-Agent.“ -Solange Fehler bestehen, ist **Speichern** deaktiviert und nennt den Grund, zum Beispiel „Behebe 1 Fehler, um zu speichern“. Auf dem Smartphone steht **Speichern** unter den Feldern eines Knotens; dort öffnet **Probleme anzeigen** neben diesem Grund die Liste. Warnungen verhindern weder das Speichern noch das Bereitstellen. Kann Tale den Entwurf nicht prüfen, etwa weil die Verbindung abgebrochen ist, zeigt die Schaltfläche **Prüfung fehlgeschlagen**, und du kannst trotzdem speichern: Jedes Speichern wird auf dem Server erneut geprüft. Wird ein Speichern oder Bereitstellen wegen Fehlern abgelehnt, öffnet sich die Liste mit den Problemen des Servers und beginnt beim ersten Fehler. +Solange Fehler bestehen, ist **Speichern** deaktiviert und nennt den Grund, zum Beispiel „Behebe 1 Fehler, um zu speichern“. Auf dem Smartphone steht **Speichern** unter den Feldern einer Node; dort öffnet **Probleme anzeigen** neben diesem Grund die Liste. Warnungen verhindern weder das Speichern noch das Bereitstellen. Kann Tale den Entwurf nicht prüfen, etwa weil die Verbindung abgebrochen ist, zeigt die Schaltfläche **Prüfung fehlgeschlagen**, und du kannst trotzdem speichern: Jedes Speichern wird auf dem Server erneut geprüft. Wird ein Speichern oder Bereitstellen wegen Fehlern abgelehnt, öffnet sich die Liste mit den Problemen des Servers und beginnt beim ersten Fehler. Die Prüfung läuft nur für Entwickler, Admins und Inhaber, also die Rollen, die speichern dürfen. [Was Tale vor einem Lauf prüft](/de/platform/automations/concepts#checks) erklärt jede Art von Problem. @@ -53,7 +141,7 @@ Die Prüfung läuft nur für Entwickler, Admins und Inhaber, also die Rollen, di 1. Ändere die nötigen Felder und klicke auf **Speichern**. 2. Erkläre die Änderung in der **Notiz zur Version** und wähle **Version speichern**. Eine neue Version entsteht; frühere Fassungen bleiben erhalten. Hat jemand während deiner Bearbeitung eine andere Version gespeichert, lehnt Tale das Speichern ab und fragt nach: **Meine Änderungen verwerfen und neu laden** zeigt die neuere Version, **Trotzdem speichern** legt deine Version darüber an — die neuere bleibt im Versionsverlauf, die aktuelle Version ist dann aber deine. -3. Klicke auf **Testlauf**. Hat der Workflow ein Eingabeschema, fülle im Dialog **Eingabe für den Lauf (JSON)** aus. Öffne **Eingabeschema**, um Pflichtfelder und Typen zu prüfen. Ungültiges JSON oder unpassende Werte verhindern den Start. +3. Klicke auf **Testlauf**. Hat der Workflow ein Eingabeschema, tippe die Eingabe als JSON in **Eingabe für den Lauf (JSON)**; beim Tippen eines Schlüssels schlägt das Feld die Feldnamen des Schemas vor, und ⌘Enter (Strg+Enter) startet den Lauf. Öffne **Eingabeschema**, um Pflichtfelder und Typen zu sehen. Ungültiges JSON oder unpassende Werte verhindern den Start. 4. Starte den Test, wechsle zum Tab **Läufe** und öffne seinen Eintrag. Vergleiche aufgelöste Eingabe, Ausgabe und geplante Aktionen mit dem erwarteten Ergebnis. Braucht ein Workflow `owner` und `repo`, könnte seine Eingabe so aussehen: @@ -71,7 +159,7 @@ Maßgeblich ist das tatsächliche Schema des Workflows. Ein Zahlenfeld braucht e -![Der Testlauf-Dialog zeigt JSON-Werte für owner und repo und das aufgeklappte Eingabeschema.](/images/platform/automation-run-input.webp) +![Der Testlauf-Dialog zeigt JSON-Werte für owner und repo im Code-Editor und das aufgeklappte Eingabeschema als Liste von Feldern.](/images/platform/automation-run-input.webp) @@ -85,7 +173,7 @@ Ein Trigger nutzt ebenfalls die bereitgestellte Version. Richte ihn ein, wenn wi ## Ein Ergebnis untersuchen -**Letzten Lauf einblenden** legt Laufzustände über den Canvas. Wähle einen Knoten für die Angaben zu diesem Lauf: aufgelöste Eingabe, Ausgabe und Effekte. Häufig findest du so eine falsche Referenz. Vergleiche die Eingabe des fehlgeschlagenen Knotens mit der Ausgabe seiner Quelle. +Sobald die Automatisierung gelaufen ist, zeigt der Canvas ihren letzten Lauf: Die unterste Zeile jeder Node sagt, wie sie endete, etwa **Erfolgreich** oder **Übersprungen**, und jede Bedingung zeigt, wie sie entschieden hat, **Ja** oder **Nein**. Die Augen-Schaltfläche oben rechts im Canvas, **Letzten Lauf ausblenden**, nimmt den Lauf vom Canvas, und **Letzten Lauf einblenden** zeigt ihn wieder. Wähle eine Node und öffne **Letzter Lauf**, um ihre **Aufgelöste Eingabe**, **Ausgabe** und Effekte zu sehen. Häufig findest du so eine falsche Referenz: Vergleiche die Eingabe der fehlgeschlagenen Node mit der Ausgabe der Node, die sie liest. Wechsle zu **Läufe** und öffne den vollständigen Datensatz. Die Tabs bleiben sichtbar; **Läufe** ist aktiv. Mit **Editor** kehrst du zum Workflow zurück. Prüfe Test- oder Live-Modus und bereits ausgeführte Aktionen, bevor du erneut startest. [Ausführungsprotokolle](/de/platform/automations/execution-logs) erklärt Wartezustände, Fehler, automatische Wiederholungen und Abbruch. diff --git a/docs/de/platform/automations/execution-logs.md b/docs/de/platform/automations/execution-logs.md index 54fdceb852..841092b9ac 100644 --- a/docs/de/platform/automations/execution-logs.md +++ b/docs/de/platform/automations/execution-logs.md @@ -1,19 +1,19 @@ --- title: Automatisierungsläufe prüfen und Fehler beheben -description: Verfolge einen Lauf bis zur betroffenen Node, prüfe protokollierte Schreibvorgänge und entscheide über Stopp, Korrektur oder Neustart. +description: Erfahre, warum ein Lauf fehlschlug oder ein Schritt übersprungen wurde, was jeder Schritt gelesen und zurückgegeben hat, spiel den Lauf ab und führe ihn erneut, ab einem Schritt oder im Vergleich mit einem anderen Lauf aus. --- Öffne eine Automatisierung, wechsle zum Tab **Läufe** und wähle einen Eintrag. Prüfe zuerst Status, Version und Modus, dann die betroffene Node. Ein erfolgreicher Testlauf belegt den simulierten Ablauf. Er beweist nicht, dass ein echtes externes Konto dieselbe Aktion akzeptiert. -![Die Seite eines Testlaufs von Triage GitHub issues, markiert mit Succeeded, Test und v1 und von dir gestartet, mit Start- und Endzeit über dem Workflow-Graphen, in dem die Nodes issues, open issues, score und report jeweils Ran zeigen; unter dem Graphen beginnt die Liste der Auswirkungen des Laufs.](/images/platform/automation-run-detail.webp) +![Die Seite eines Testlaufs von Triage GitHub issues, markiert mit Succeeded, Test und v1 und von dir gestartet, mit Start- und Endzeit über dem Workflow-Graphen, in dem die Nodes issues, open issues, score und report jeweils Succeeded zeigen; unter dem Graphen beginnt die Liste der Auswirkungen des Laufs.](/images/platform/automation-run-detail.webp) ## Den Laufstatus lesen -Der Tab **Läufe** zeigt die letzten 50 Läufe, die du sehen kannst, neueste zuerst. Läufe der Organisation selbst sehen Inhaber, Admins und Entwickler. Einen Lauf in einem Projekt und die Frage, auf die er wartet, sehen nur diejenigen von ihnen, die dieses Projekt öffnen können. Jede Zeile nennt Version, Zeitpunkt, Modus und Auslöser oder eine Fehler- beziehungsweise Wartebegründung. Im Detail siehst du Workflow, Node-Ergebnisse und Laufzeiten. Ein nicht abgeschlossener Lauf hat keinen Endzeitpunkt. Die Tabs bleiben beim Prüfen eines Laufs sichtbar. Mit **Läufe** kehrst du zur Liste zurück, mit **Editor** zum Bearbeiten des Workflows. +Der Tab **Läufe** zeigt die Läufe, die du sehen kannst, neueste zuerst, und lädt ältere beim Scrollen nach; **Filter** grenzt sie nach Status und Modus ein. Läufe der Organisation selbst sehen Inhaber, Admins und Entwickler. Einen Lauf in einem Projekt und die Frage, auf die er wartet, sehen nur diejenigen von ihnen, die dieses Projekt öffnen können. Jede Zeile nennt Version, Zeitpunkt, Modus und Auslöser oder sagt, warum der Lauf fehlschlug oder worauf er wartet. Im Detail siehst du Workflow, Node-Ergebnisse und Laufzeiten. Ein nicht abgeschlossener Lauf hat keinen Endzeitpunkt. Die Tabs bleiben beim Prüfen eines Laufs sichtbar. Mit **Läufe** kehrst du zur Liste zurück, mit **Editor** zum Bearbeiten des Workflows. | Status | Bedeutung | Nächster Schritt | | --- | --- | --- | @@ -34,16 +34,63 @@ Eine ausstehende Freigabe, eine Frage oder ein Schritt, der vielleicht schon gel Lass den Lauf während der Prüfung zurückgehalten. **Stopp anfordern** bittet Tale, die zuordenbaren Sitzungen zu stoppen, und erklärt die Unsicherheit vor deiner Bestätigung. **Stopp angefordert** bestätigt nicht, dass die Arbeit gestoppt wurde: Die Sperre bleibt, bis der Stopp der bisherigen Arbeit bestätigt ist. Frühere externe Aktionen werden nicht rückgängig gemacht. Ändert sich die Sperre bei offenem Bestätigungsdialog, schließ ihn und prüfe die aktuellen Angaben. -## Die betroffene Node untersuchen +## Verstehen, warum ein Lauf fehlschlug {#failures} -Wähle eine Node auf dem Canvas des Laufs. **Aufgelöste Eingabe** zeigt die Werte nach der Vorlagenauswertung, **Ausgabe** das Ergebnis des Schritts. So unterscheidest du einen falschen Verweis von einem Dienstausfall. +Ein fehlgeschlagener Lauf öffnet sich mit einer Karte, die sagt, wo und warum er fehlschlug: **Der Lauf ist bei Greet fehlgeschlagen**, ein kurzer Titel für das Problem, etwa **Ein gelesener Wert fehlt**, was das bedeutet, die konkrete Ursache und **So behebst du es**. Bei einem fehlenden Wert nennt die Ursache den Ausdruck, das gelesene Feld und den Schritt, dessen Ausgabe nichts enthielt; die Behebung schlägt einen Zugriff vor, der nicht fehlschlagen kann, etwa `nodes.fetch_customer.output.customer?.email`. Die eigene Meldung der Engine steht unter **Technische Details**. -Node-Zustände sind unter anderem **Gelaufen**, **Übersprungen**, **Fehlgeschlagen**, **Nie erreicht**, **Noch nicht erreicht** und bei einem gestoppten Lauf **Hier gestoppt** für die Node, an der der Lauf beim Stoppen stand. Eine Node kann wegen einer falschen Bedingung, einer Abhängigkeit, eines anderen Zweigs oder einer Weiterlaufregel übersprungen werden. Das ist nicht immer ein Fehler. +Unter der Karte stehen der Schritt und sein Feld, etwa **Greet › input.email**, neben **Im Editor zeigen**: Das öffnet den Editor mit der Version, die der Lauf ausführte, und wählt den Schritt aus. **Schritt zeigen** wählt ihn im Canvas des Laufs aus, und **Ab diesem Schritt wiederholen** bereitet die Wiederholung vor, die [Ab einem Schritt wiederholen](#retry-from-step) beschreibt. -Beispielsweise kann eine Erinnerungs-Node den Kundennamen, aber eine leere Rechnungs-ID erhalten. Prüfe die Ausgabe davor. Verwendet der Datensatz inzwischen ein anderes Feld, korrigiere den Verweis statt der Mail-Zugangsdaten. Prüfe danach die aufgelöste Eingabe in einem neuen Testlauf. +Im Canvas ist die fehlgeschlagene Node rot umrahmt, und ihre unterste Zeile wiederholt den Titel des Fehlers; die Nodes, über die der Lauf zu ihr kam, treten hervor, während die übrigen zurücktreten; und Ende sagt, wo der Lauf fehlschlug, etwa **Fehlgeschlagen bei Propose**. Die Liste **Läufe** nennt die Ursache eines fehlgeschlagenen Laufs mit demselben Titel. Anwendungen erhalten über die [Lauf-API](/de/develop/api-reference) zusätzlich `failureCode`, wenn die Ursache eines fehlgeschlagenen Laufs klassifiziert wurde. `approval_rejected` bedeutet etwa, dass eine Person die Aktion abgelehnt hat; bei `llm_output_invalid` entsprach die Modellantwort nicht der geforderten Struktur. Ältere Fehler können ohne Code vorliegen. Der Code hilft bei der Untersuchung, belegt aber weder die Unbedenklichkeit noch den Erfolg eines neuen Versuchs. +## Herausfinden, warum ein Schritt lief oder übersprungen wurde {#conditions} + +Wähle eine Node im Canvas des Laufs, um ihren Tab **Letzter Lauf** zu öffnen. Ein Schritt, der wegen einer Bedingung lief oder übersprungen wurde, sagt das in einem Satz, etwa **Big order wurde übersprungen, weil seine Bedingung nicht zutraf**. Darunter zeigt **Nur wenn** die Bedingung in Worten, mit dem Wert, den jeder Verweis las, und wie sie ausging, etwa „amount der Laufeingabe (250) nicht größer als 1.000 ist“ und **Nein**. Eine mit `&&` oder `||` verknüpfte Bedingung zeigt jeden Teil mit **Ja** oder **Nein**; ein Teil, den der Lauf nicht prüfen musste, heißt **Nicht geprüft**. Eine als Code geschriebene Bedingung zeigt ihren Code. + +Eine Node kann wegen einer nicht erfüllten Bedingung, einer gelaufenen Alternative, eines übersprungenen Schritts, den sie liest, oder einer Weiterlaufregel übersprungen werden; der Satz nennt den Grund und den beteiligten Schritt. Das ist nicht immer ein Fehler. + +Im Canvas sagt die unterste Zeile jeder Node, wie sie endete: **Erfolgreich**, **Fehlgeschlagen**, **Übersprungen**, **Nicht ausgeführt**, **Noch nicht erreicht**, **Wiederverwendet** für einen Schritt, den eine Wiederholung aus einem früheren Lauf übernahm, oder bei einem gestoppten Lauf **Hier gestoppt** für die Node, an der der Lauf beim Stoppen stand. Jede Bedingung zeigt, wie sie entschieden hat, **Ja** oder **Nein**. + +## Sehen, was ein Schritt gelesen, erhalten und zurückgegeben hat {#step-data} + +**Was gelesen wurde** listet jeden Wert, den der Schritt aus der Laufeingabe oder aus anderen Schritten las, in Worten und mit dem gelesenen Wert, etwa „items von Inbox: 3 Elemente“. **Erhalten** zeigt die Eingabe des Schritts nach dem Auswerten seiner Vorlagen, **Zurückgegeben** sein Ergebnis. Zusammen unterscheiden sie einen falschen Verweis von einem Dienstausfall. Ein Wert mit einem Geheimnis ist ausgeblendet und sagt das, und ein zu umfangreicher Wert sagt, dass nur ein Teil davon gespeichert wurde. + +Ein Wert erscheint als Baum, den du mit den Pfeiltasten aufklappst. **Werte** und **Struktur** wechseln zwischen den Werten und den Feldern mit ihren Arten, und die Schaltflächen kopieren einen Wert, laden einen grossen herunter oder öffnen ihn im Vollbild. Sind Eingabe und Ausgabe eines Schritts beide Objekte oder beide Listen, listet **Was er geändert hat** die Felder, die der Schritt hinzugefügt, entfernt und geändert hat. + +Ein Schritt, der einmal pro Element läuft, listet seine Elemente, jedes mit seinem Ergebnis und bei einem fehlgeschlagenen mit dem Grund. **Nur fehlgeschlagene** grenzt die Liste ein, und ein gewähltes Element zeigt, was es gelesen, erhalten und zurückgegeben hat. Tale speichert die ersten 200 Elemente und jedes fehlgeschlagene. Ein Schritt, der mehr als einen Versuch brauchte oder dessen Versuch ein Neustart unterbrach, listet seine **Versuche**. Ein Schritt, der einen Dienst aufrief, sagt, ob der Aufruf erledigt, fehlgeschlagen oder vielleicht schon gelaufen ist, und was eine Person dazu entschieden hat. + +Beispielsweise kann eine Erinnerungs-Node den Kundennamen, aber eine leere Rechnungs-ID erhalten. Prüfe, was sie aus dem Schritt davor gelesen hat. Verwendet der Datensatz inzwischen ein anderes Feld, korrigiere den Verweis statt der Mail-Zugangsdaten. Prüfe die korrigierte Eingabe danach in einem neuen Testlauf. + +## Den Lauf abspielen {#play} + +Die Leiste unter dem Canvas des Laufs spielt den Lauf ab: Jeder Schritt leuchtet, während er arbeitet, Werte wandern entlang der Linien zu den Schritten, die sie lesen, und jede Bedingung zeigt ihre Entscheidung. Sie öffnet sich am Ende des Laufs, damit du zuerst den ganzen Ablauf siehst. **Abspielen** startet von vorn, **Vorheriges Ereignis** und **Nächstes Ereignis** springen schrittweise, und der Regler geht zu jedem Zeitpunkt; die Uhr zeigt, wie lange der Lauf tatsächlich schon lief, und die Geschwindigkeit ändert das Abspieltempo. Lange Wartezeiten werden verkürzt, damit sie die Wiedergabe nicht aufhalten. Solange ein Lauf noch läuft, folgt ihm die Leiste; springst du zurück, bringt dich **Live folgen** an sein Ende. + +**Schritte** neben **Diagramm** zeigt denselben Lauf als seine Schritte in zeitlicher Reihenfolge: wie lange jeder arbeitete, einen Balken dafür, wann er arbeitete, jede Bedingung mit ihrer Entscheidung sowie Wartezeiten und Neustarts. Die Ansicht läuft mit derselben Uhr. Wählst du einen Schritt, öffnet er sich und die Uhr springt an seinen Beginn, und **Diagramm** zeigt den Canvas zu diesem Zeitpunkt. Ein Schritt, der einmal pro Element lief oder sich wiederholte, klappt zu seinen Elementen oder Durchgängen auf, jedes mit seinem Ergebnis und seiner Dauer; wählst du eines, öffnet es sich im Tab **Letzter Lauf** des Schritts. Die Adresse der Seite behält die Ansicht (`?view=steps`), den Schritt, das gewählte Element und den Zeitpunkt, an dem die Wiedergabe steht, sodass ein Link oder ein Neuladen den Lauf dort öffnet, wo du ihn verlassen hast. + +## Erneut ausführen {#run-again} + +**Erneut ausführen** startet einen neuen Lauf derselben Version mit derselben Eingabe und demselben Modus. Ein Testlauf startet sofort; ein Live-Lauf mit Schreibvorgängen fragt zuerst und nennt die Dienste, an die er erneut senden würde. Das Menü daneben bietet: + +- **Eingabe bearbeiten und ausführen…** öffnet den Ausführen-Dialog mit der Eingabe dieses Laufs zum Ändern; bestätigst du sie unverändert, wird der Lauf erneut ausgeführt. +- **Erneut mit v6 als Test ausführen**, wenn es eine neuere Version gibt, und **Erneut als Test ausführen** bei einem Live-Lauf. +- **Live mit v5 ausführen**, wenn eine andere Version live ist und deine Rolle Live-Läufe starten darf. +- **Mit dem vorherigen Lauf vergleichen**, **Lauf-ID kopieren** und **Link kopieren**. + +Kann ein Live-Lauf nicht erneut live laufen, weil seine Version nicht mehr live ist oder deine Rolle keine Live-Läufe starten darf, sagt **Erneut ausführen** den Grund. + +Die Kopfzeile des neuen Laufs nennt seine Herkunft, etwa **Wiederholung von Lauf 1db433 · geänderte Eingabe**, mit **Lauf 1db433 öffnen** und **Damit vergleichen**. Eine Wiederholung ist ein neuer Lauf: Sie sendet ihre Schreibvorgänge erneut und verbraucht, was ein Lauf verbraucht. + +## Ab einem Schritt wiederholen {#retry-from-step} + +**Ab diesem Schritt wiederholen** zeigt vor dem Start, was die Wiederholung tun wird. **Wiederverwendet** listet die Schritte, deren Ergebnisse der neue Lauf aus diesem übernimmt, und **Läuft erneut** den gewählten Schritt und jeden folgenden Schritt, der von ihm abhängt. Schreiben diese Schritte an einen Dienst und läuft die Wiederholung live, warnt der Dialog, dass die Schreibvorgänge erneut gesendet werden. Die Wiederholung eines Testlaufs bleibt ein Test, weil die Ergebnisse, die sie wiederverwenden würde, erfunden waren. + +Tale lehnt eine Wiederholung ab, die es nicht getreu ausführen kann, und sagt warum: Die auszuführende Version hat einen wiederverwendeten Schritt geändert, der Lauf ist noch nicht beendet, oder der Lauf hat keine Eingabe gespeichert. Im Canvas des neuen Laufs sind die übernommenen Schritte als **Wiederverwendet** markiert. + +## Zwei Läufe vergleichen {#compare} + +**Damit vergleichen** bei einer Wiederholung, **Mit dem vorherigen Lauf vergleichen** im Menü von **Erneut ausführen** oder zwei im Tab **Läufe** ausgewählte Läufe und **Vergleichen** zeigen zwei Läufe nebeneinander. **Was sich unterscheidet** nennt, das Aufschlussreichste zuerst, die ausgeführten Versionen, wie viele Felder ihrer Eingabe sich unterscheiden, den Schritt, an dem sie sich trennten, und warum, etwa eine Bedingung, die anders ausging, wie jeder endete sowie Ausgabe und Schreibvorgänge. Die Tabelle darunter zeigt jeden Schritt, wie jeder Lauf ihn hinterließ und ob seine Daten gleich sind. **A und B tauschen** vertauscht die beiden Läufe. Unterscheiden sich ihre Eingabe oder Ausgabe, zeigen **Eingabe: A → B** und **Ausgabe: A → B** beide nebeneinander, jedes geänderte Feld markiert. **Beide Läufe im Diagramm** zeichnet beide in das Diagramm der Version von B: Jeder Schritt sagt, wie A und wie B ihn hinterließen, der Schritt, an dem sie sich trennen, ist umrandet, und ein Schritt, den die Version von A nicht hat, ist gestrichelt. + ## Bereits erfolgte Änderungen prüfen Die Auswirkungen protokollieren Connector-Schreibvorgänge mit Node, Connector und Eingabe. Tests verwenden festgelegte Ersatzantworten; Live-Aktionen können externe Systeme ändern. Fehlen protokollierte Auswirkungen, zeigt der Lauf das ausdrücklich an. @@ -52,7 +99,7 @@ Lies diese Liste vor einer Wiederholung. Ein späterer Fehler macht eine früher ## Fortsetzung und automatische Wiederholungen verstehen -Der Ablauf speichert abgeschlossene Nodes als Checkpoints und setzt danach fort. Ein separater neuer Lauf besitzt eigene Checkpoints und kann Schreibvorgänge wiederholen. Neu starten ist deshalb etwas anderes als den bestehenden Lauf fortzusetzen. +Der Ablauf speichert abgeschlossene Nodes als Checkpoints und setzt danach fort. Ein separater neuer Lauf, etwa einer, den **Erneut ausführen** startet, besitzt eigene Checkpoints und kann Schreibvorgänge wiederholen. Neu starten ist deshalb etwas anderes als den bestehenden Lauf fortzusetzen; eine [Wiederholung ab einem Schritt](#retry-from-step) übernimmt nur die Ergebnisse der Schritte vor diesem Schritt. Ein Lauf kann während der Ausführung auf einen anderen Server wechseln. Ein Server, der aktualisiert oder neu gestartet wird, gibt seine Läufe beim nächsten Schritt weiter: Der laufende Schritt wird noch fertig, und der nächste Server macht mit dem folgenden Schritt weiter oder, wenn der Schritt einmal pro Element läuft, mit dem nächsten Element. Arbeitet ein Schritt 20 Sekunden nach Beginn des Neustarts noch, wird er unterbrochen und läuft auf dem nächsten Server noch einmal. Hält ein Server ohne Vorwarnung an, übernimmt ein anderer seine Läufe innerhalb von etwa anderthalb Minuten. Abgeschlossene Schritte laufen nicht noch einmal. Im Kopfbereich des Laufs steht dann **Nach einem Neustart fortgesetzt** oder die Zahl der Neustarts, mit dem Zeitpunkt des letzten Wechsels und seinem Grund: Der Server wurde aktualisiert oder neu gestartet, oder er hat nicht mehr geantwortet. Bis ein anderer Server den Lauf übernommen hat, zeigt sein Status **Unterbrochen — wird fortgesetzt**. @@ -74,6 +121,6 @@ Ein ausgeschöpftes Ausführungszeitfenster, eine abgelaufene Frage oder eine Ab Wähle bei einem nicht abgeschlossenen Lauf **Lauf stoppen**, wenn du ihn abbrechen möchtest, und bestätige. Der Abbruch verhindert weitere Arbeit an den Ausführungsgrenzen des Ablaufs. Bereits erfolgte Änderungen werden nicht zurückgesetzt. Endet der Lauf, bevor der Abbruch ihn erreicht, bleibt sein abgeschlossenes Ergebnis erhalten. -Korrigiere einen Dokumentfehler im Editor an der betroffenen Eingabe oder Node und speichere eine Version mit aussagekräftiger Nachricht. Teste mit typischen Eingaben und prüfe Werte und Ausgabe, nicht nur den Erfolgsstatus. Schalte die geprüfte Version live. Zeitpläne und Webhooks verwenden danach diese Version; der ältere fehlgeschlagene Lauf dokumentiert weiterhin die alte. +Korrigiere einen Dokumentfehler im Editor, den du über **Im Editor zeigen** auf der Fehlerkarte oder direkt öffnest, an der betroffenen Eingabe oder Node und speichere eine Version mit aussagekräftiger Nachricht. Teste mit typischen Eingaben und prüfe Werte und Ausgabe, nicht nur den Erfolgsstatus. Schalte die geprüfte Version live. Zeitpläne und Webhooks verwenden danach diese Version; der ältere fehlgeschlagene Lauf dokumentiert weiterhin die alte. Ist gar kein Lauf entstanden, prüfe den [Trigger](/de/platform/automations/triggers). Ein deaktivierter Trigger, eine fehlende Live-Version oder abgelehnte Eingaben können den Start verhindert haben. diff --git a/docs/de/platform/automations/triggers.md b/docs/de/platform/automations/triggers.md index d213d533a7..2653600d56 100644 --- a/docs/de/platform/automations/triggers.md +++ b/docs/de/platform/automations/triggers.md @@ -1,13 +1,13 @@ --- title: Automatisierungen automatisch starten -description: Richte Zeitpläne, Webhooks und Plattform-Ereignisse ein, prüfe die Eingaben und finde die Ursache ausbleibender Starts. +description: Starte eine Automatisierung nach Zeitplan, per Webhook oder bei einem Plattform-Ereignis, prüfe, was jeder Lauf erhält, und finde heraus, warum ein Start ausgelassen wurde. --- -Im Abschnitt **Trigger** im Tab **Allgemein** einer Automatisierung legst du fest, wann sie selbstständig startet. Jeder Trigger führt die Live-Version im Live-Modus aus. Teste den Workflow vorher mit der tatsächlich gelieferten Eingabestruktur und prüfe seine externen Aktionen. +Im Abschnitt **Trigger** im Tab **Allgemein** einer Automatisierung legst du fest, wann sie selbstständig startet: nach Zeitplan, wenn ein anderes System eine Anfrage sendet, oder wenn in Tale etwas passiert. Jeder Trigger führt die Live-Version im Live-Modus aus. Bevor du einen Trigger einschaltest, prüfe, was seine Läufe erhalten und ob die externen Aktionen des Workflows bereit sind. - + -![Der Tab Allgemein von Triage the Gmail inbox mit einem eingeschalteten Trigger vom Typ Schedule, dem Cron-Ausdruck 0 */6 * * *, beschrieben als alle sechs Stunden und ohne Start, bevor eine Version bereitgestellt ist, der Zeitzone UTC und darunter einer leeren Projektauswahl.](/images/platform/automation-general-trigger.webp) +![Der Tab Allgemein von Triage the Gmail inbox mit ausgeschaltetem Schalter Enabled, Schedule als Trigger-Typ, dem Format Repeat mit einem Zeitplan alle 6 Stunden, der Zeitzone UTC, Start the latest one when Tale is back unter Missed runs und den nächsten Läufen unter Would run at.](/images/platform/automation-general-trigger.webp) @@ -15,9 +15,11 @@ Im Abschnitt **Trigger** im Tab **Allgemein** einer Automatisierung legst du fes | Trigger-Typ | Geeignet für | Eingabe des Laufs | | --- | --- | --- | -| **Zeitplan** | Wiederkehrende Arbeit zu einer Ortszeit oder in festen Abständen. | `{ trigger: "schedule", firedAt: }` | +| **Zeitplan** | Wiederkehrende Arbeit zu festen Uhrzeiten oder in regelmäßigen Abständen. | `{ trigger: "schedule", firedAt: }` | | **Webhook** | Zustellungen eines anderen Systems. | `{ trigger: "webhook", payload: … }` | -| **Plattform-Ereignis** | Ein benanntes Ereignis innerhalb der Organisation. | `{ trigger: "event", event: "…", payload: … }` | +| **Plattform-Ereignis** | Etwas, das in der Organisation passiert, etwa eine neue Aufgabe. | `{ trigger: "event", event: "…", payload: … }` | + +Jeder Typ kann außerdem eine [feste Eingabe](#feste-eingabe) mitgeben: Werte, die jeder Lauf zusätzlich zu diesen Feldern erhält, etwa das Repository, das eine geplante Triage liest. Eine Automatisierung hat jeweils einen konfigurierten Trigger. Ein anderer Typ ersetzt die bisherige Bindung. Ersetzt du einen Webhook, wird seine URL sofort ungültig. Ein später angelegter Webhook stellt diese Zugangsdaten nicht wieder her. @@ -29,24 +31,73 @@ API- und MCP-Clients können auch ohne Trigger starten. API-Schlüssel und Proje -Öffne die Automatisierung und darin den Tab **Allgemein**. Ohne Bindung steht im Abschnitt **Trigger**, dass die Automatisierung nur von Hand oder über die API läuft; wähle **Trigger hinzufügen** und dann unter **Trigger-Typ** den **Zeitplan**. Ein neuer Trigger ist zunächst nicht **Aktiv** — lass ihn ausgeschaltet, solange der Workflow noch nicht selbstständig starten soll. +Öffne die Automatisierung und darin den Tab **Allgemein**. Ohne Bindung steht im Abschnitt **Trigger**, dass die Automatisierung nur von Hand oder über die API läuft. Wähle **Trigger hinzufügen**. Ein neuer Trigger ist ein **Zeitplan**, der täglich um 9:00 Uhr in deiner Zeitzone läuft, und **Aktiv** ist ausgeschaltet. Lass ihn aus, solange der Workflow noch nicht selbstständig starten soll. + + + + + +Lass **Format des Zeitplans** auf **Wiederholung** und öffne **Zeitplan**. Die Schnellauswahl bietet **Alle 15 Minuten**, **Stündlich** sowie tägliche, werktägliche, wöchentliche und monatliche Läufe zu einer Uhrzeit. Die wöchentliche und die monatliche Vorlage richten sich nach dem heutigen Wochentag und Monatstag, und jede Vorlage mit Uhrzeit übernimmt die früheste Uhrzeit des Zeitplans. Ein Klick auf eine Vorlage schließt das Popover und übernimmt sie ins Formular. Unter der Schnellauswahl und den benutzerdefinierten Ansichten zeigt das Popover die nächsten drei Läufe des Zeitplans, den du gerade zusammenstellst. + + + + + +Wähle **Benutzerdefinierte Uhrzeiten**, um zu festen Uhrzeiten zu starten: Wähle **Tag**, **Woche**, **Monat** oder **Jahr**, das Intervall (etwa alle 2 Wochen), die Wochentage oder den Tag und unter **Um** bis zu 12 Uhrzeiten. **Uhrzeit hinzufügen** ergänzt eine Uhrzeit eine Stunde nach der letzten. Eine Uhrzeit, die schon in der Liste steht, läuft nur einmal, und beim Speichern werden die Uhrzeiten sortiert. + +Wähle **Benutzerdefiniertes Intervall**, um alle paar Minuten oder Stunden zu starten: bis zu alle 30 Minuten in Schritten, die eine Stunde teilen, oder bis zu alle 12 Stunden in Schritten, die einen Tag teilen, jeweils eine bestimmte Anzahl Minuten nach der vollen Stunde. Lass die Wochentage eingeschaltet, an denen es laufen soll, und beschränke es mit **Nur zwischen** auf die Stunden zwischen zwei Uhrzeiten. Unter den Uhrzeiten nennt die Auswahl den ersten und den letzten Lauf des Tages. + +**Speichern**, Enter oder Strg+Enter (auf dem Mac Cmd+Enter) übernimmt den benutzerdefinierten Zeitplan; **Abbrechen** oder Escape verwirft ihn. + + + + + +Die Uhrzeiten des Zeitplans gelten in der Zone, die unter **Zeitzone** steht. Voreingestellt ist deine eigene; suche eine andere IANA-Zeitzone wie `Europe/Zurich`, wenn sich die Arbeit nach den Bürozeiten eines anderen Standorts richtet. - + -Fülle **Cron** aus und wähle die **Zeitzone**. Die fünf Cron-Felder bedeuten Minute, Stunde, Tag des Monats, Monat und Wochentag. Nutze eine IANA-Zeitzone wie `Europe/Zurich`, wenn die örtliche Geschäftszeit zählt. Ohne Angabe gilt UTC. +**Nächste Läufe** listet die nächsten fünf Starts in der Zeitzone des Zeitplans und, wenn deine eigene Zeitzone abweicht, denselben Zeitpunkt in deiner Zeitzone. Solange Änderungen nicht gespeichert sind, lautet die Überschrift **Nächste Läufe (nicht gespeichert)**. Ist der Trigger aus oder keine Version live, lautet sie **Würde laufen um**, und die Zeile darunter sagt, was fehlt. - + -Prüfe den nächsten angezeigten Zeitpunkt: Es ist die Minute, in der der Zeitplan tatsächlich startet, auch über eine Zeitumstellung hinweg. Klick dann neben den Tabs auf **Speichern**. Kontrolliere, ob die Live-Version die oben gezeigte Zeitplan-Eingabe akzeptiert. Schalte den fertigen Trigger mit **Aktiv** ein und speichere erneut. Den nächsten gestarteten Lauf findest du unter **Läufe**. +Klick neben den Tabs auf **Speichern**. Prüfe unter [Dieser Lauf erhält](#pruefen-was-ein-lauf-erhaelt), ob die Live-Version die Eingabe akzeptiert. Wenn alles bereit ist, schalte **Aktiv** ein und speichere erneut. Der nächste gestartete Lauf erscheint unter **Läufe**, und der Abschnitt **Trigger** zeigt ihn als letzten Lauf. +**Benutzerdefiniertes Intervall** zählt ab Mitternacht Ortszeit: Alle 2 Stunden, 15 Minuten nach der vollen Stunde, startet also um 00:15, 02:15 und so weiter. **Nur zwischen** schließt den Beginn ein und hört vor dem Ende auf: Von 8:00 bis 18:00 läuft ein 15-Minuten-Intervall zuletzt um 17:45. Liegt das Ende vor dem Beginn, läuft es über Nacht, und die Stunden nach Mitternacht gehören zum Tag, an dem das Zeitfenster begann. Freitag von 22:00 bis 06:00 läuft also bis Samstagmorgen, aber nicht am Samstagabend. Ein Ende um 00:00 läuft bis Mitternacht, und gleicher Beginn und gleiches Ende bedeuten den ganzen Tag. Fällt zwischen die beiden Uhrzeiten kein einziger Lauf, etwa alle 6 Stunden von 8:00 bis 11:00, sagt die Auswahl das, und **Speichern** wartet, bis du den Zeitraum erweiterst oder das Intervall verkürzt. + +### Bei der Zeitumstellung + +Ein Zeitplan behält seine Ortszeiten über die Zeitumstellungen hinweg: + +- Eine Uhrzeit, die an diesem Tag übersprungen wird, startet einmal, um die Dauer der Lücke später. In `Europe/Zurich` startet ein Lauf für 02:30 am 29. März 2026 um 03:30. +- Eine Uhrzeit, die zweimal vorkommt, startet einmal, beim ersten Mal. +- **Alle N Minuten** und **Alle N Stunden** behalten dagegen ihren echten Abstand: In der Stunde, die sich wiederholt, laufen sie doppelt, in der übersprungenen gar nicht. + +**Nächste Läufe** markiert einen Start, der auf eine Umstellung trifft, mit **Zeitumstellung** und erklärt, was passiert. + +### Bei verpassten Läufen + +**Verpasste Läufe** bestimmt, was ein Zeitplan mit den Zeitpunkten macht, zu denen er fällig war, während Tale nicht verfügbar war, etwa während eines Updates: + +| Auswahl | Was passiert, sobald Tale wieder läuft | +| --- | --- | +| **Den letzten nachholen, sobald Tale wieder läuft** (Standard) | Der letzte verpasste Zeitpunkt läuft einmal, egal wie spät. Frühere verpasste Zeitpunkte werden gezählt, nicht nachgeholt. | +| **Auslassen** | Ein Lauf, der mehr als 10 Minuten zu spät ist, startet nicht und wird als verpasst gezählt. | + +Ein Beispiel: Ein Zeitplan läuft täglich um 09:00, und Tale ist von 08:30 bis 10:15 nicht erreichbar. Mit dem Standard startet um 10:15 ein Lauf für 09:00; mit **Auslassen** startet nichts, und der Abschnitt **Trigger** zeigt, dass 1 Lauf verpasst wurde. Sobald Läufe als verpasst zählen, zeigt der Abschnitt, wie viele es waren und zwischen welchen Zeitpunkten, gezählt bis 1.000. Mit dem Standard sind das die Zeitpunkte vor dem gestarteten Lauf, etwa die früheren Starts eines Zeitplans alle 15 Minuten während desselben Ausfalls. Die Zeit, in der der Zeitplan ausgeschaltet oder pausiert war, und die Zeit vor dem Speichern zählen nie als verpasst. + +## Einen Cron-Ausdruck verwenden + +Wechsle unter **Format des Zeitplans** zu **Cron (erweitert)**, wenn du schon einen Cron-Ausdruck hast oder ein Muster brauchst, das **Wiederholung** nicht anbietet. Die fünf Cron-Felder bedeuten Minute, Stunde, Tag des Monats, Monat und Wochentag. + ```text */15 * * * * alle fünfzehn Minuten 0 9 * * 1-5 werktags um 09:00 Uhr @@ -54,15 +105,17 @@ Prüfe den nächsten angezeigten Zeitpunkt: Es ist die Minute, in der der Zeitpl 30 8 1 * 1 am Monatsersten und jeden Montag um 08:30 Uhr ``` -Die Felder erlauben `*`, Zahlen, Bereiche, Schrittweiten und kommagetrennte Listen. 0 und 7 stehen beide für Sonntag. Sind Monatstag und Wochentag eingeschränkt, genügt eine Übereinstimmung. Das letzte Beispiel läuft daher montags und am ersten Tag jedes Monats. +Die Felder erlauben `*`, Zahlen, Bereiche, Schrittweiten und kommagetrennte Listen. 0 und 7 stehen beide für Sonntag. Sind Monatstag und Wochentag eingeschränkt, genügt eine Übereinstimmung; das letzte Beispiel läuft daher montags und am ersten Tag jedes Monats. Kann **Wiederholung** dasselbe ausdrücken, gibt die Zeile unter dem Feld es wieder, etwa „Bedeutet: Jeden Werktag um 09:00 Uhr“. Ist ein Ausdruck nicht lesbar oder nennt er ein Datum, das nie eintritt, etwa `0 0 30 2 *`, steht der Grund unter dem Feld; **Nächste Läufe** bleibt leer, und **Speichern** wartet, bis du ihn korrigierst. + +Ein Cron-Ausdruck folgt denselben Regeln zur Zeitumstellung: Stehen Minute und Stunde als Zahlen da, nennt er Uhrzeiten; beginnt Minute oder Stunde mit `*`, behält er seinen echten Abstand. -Die Ortszeit folgt den Sommerzeitregeln der Zeitzone. Ein Zürcher Zeitplan für 09:00 Uhr bleibt örtlich bei 09:00 Uhr. Die Auflösung beträgt eine Minute. Während eines Ausfalls verpasste Termine werden nicht nachgeholt; der nächste reguläre Termin setzt den Betrieb fort. Unmögliche Kalenderdaten werden beim Speichern abgelehnt. +Der Wechsel zwischen **Wiederholung** und **Cron (erweitert)** rechnet den Zeitplan um, wenn beide genau dasselbe sagen. Geht das nicht, etwa bei einem Zeitplan um 9:00 und 17:30 Uhr, sagt das Feld es, und beide Eingaben bleiben bis zum Speichern im Formular. Ein früher als Cron-Ausdruck gespeicherter Zeitplan öffnet unter **Wiederholung**, wenn eine Wiederholung genau dasselbe sagt, mit einem Hinweis auf den gespeicherten Ausdruck. Speicherst du ihn unverändert, bleibt der Cron-Ausdruck erhalten; ein geänderter Zeitplan wird als Wiederholung gespeichert. Einen Cron-Ausdruck, den **Wiederholung** nicht ausdrücken kann, öffnet Tale unter **Cron (erweitert)**. ## Einen Webhook empfangen -Wähle **Webhook** und speichere, um die Zugangsdaten zu erzeugen. Kopiere die vollständige URL, sobald sie erscheint. Der Token wird einmal gezeigt und nur als Hash gespeichert. Der Abschnitt bietet eine Organisations-URL und ein Muster für Projekt-URLs. Nutze für ein aktives Projekt mit installierter Automatisierung die Projekt-URL. Eine Automatisierung mit Projektzuordnung kann nicht über die reine Organisations-URL starten. +Wähle **Webhook** und speichere, um die URL zu erzeugen. **Webhook-URL — kopiere sie jetzt** zeigt sie genau einmal: eine URL für jedes Projekt, in dem die Automatisierung installiert ist, oder eine für die Organisation, wenn sie in keinem installiert ist. Kopiere jede URL, die du brauchst; der Token an ihrem Ende wird nur als Hash gespeichert. Danach listet der Abschnitt die Adressen mit verborgenem Token, unter **Projekt-URLs** oder, für die Organisation, unter **Webhook-Endpunkt**. **Token rotieren** erzeugt eine neue URL. Eine Automatisierung, die in Projekten installiert ist, läuft nur über eine Projekt-URL. -Sende eine kleine Nutzlast an die URL. JSON landet als `payload` innerhalb der Eingabe, nicht unmittelbar auf deren oberster Ebene. Andere Anfrageinhalte werden als Text weitergereicht. Die Grenze liegt bei 256 KiB; große Dokumente lädst du separat hoch. Eine angenommene Anfrage liefert die Lauf-ID, ohne auf das Ende zu warten. +Unter **Testanfrage senden** steht ein fertiger `curl`-Befehl. Direkt nach dem Erzeugen enthält er die URL selbst; später liest er sie aus `TALE_WEBHOOK_URL`, der Variable, in der das sendende System sie aufbewahren sollte. Er sendet einen kleinen JSON-Inhalt mit einem `Idempotency-Key`. JSON landet als `payload` innerhalb der Eingabe, nicht unmittelbar auf deren oberster Ebene; andere Anfrageinhalte werden als Text weitergereicht. Die Grenze liegt bei 256 KiB; große Dokumente lädst du separat hoch. Eine angenommene Anfrage liefert die Lauf-ID, ohne auf das Ende des Laufs zu warten. Die gesendete Nutzlast `{ "invoiceId": "inv-1" }` erreicht den Workflow beispielsweise so: @@ -73,19 +126,82 @@ Die gesendete Nutzlast `{ "invoiceId": "inv-1" }` erreicht den Workflow beispiel } ``` -Verwende eine Zustellungs-ID, etwa `Idempotency-Key` oder einen unterstützten Header des Absenders. Dieselbe ID liefert innerhalb von 24 Stunden den ursprünglichen Lauf zurück. Ohne ID gilt ein identischer Inhalt an derselben URL innerhalb von zwei Minuten als Duplikat. Vergib unterschiedliche IDs, wenn identische Inhalte getrennte Arbeit bedeuten. [Webhooks](/de/develop/webhooks) beschreibt Header, Projektpfade, Fehler und Antwortformate. +Sende eine Zustellungs-ID, etwa `Idempotency-Key` oder einen unterstützten Header des Absenders. Dieselbe ID liefert innerhalb von 24 Stunden den ursprünglichen Lauf zurück. Ohne ID gilt ein identischer Inhalt an derselben URL innerhalb von zwei Minuten als Duplikat. Vergib unterschiedliche IDs, wenn identische Inhalte getrennte Arbeit bedeuten. [Webhooks](/de/develop/webhooks) beschreibt Header, Projektpfade, Fehler und Antwortformate. + +**Letzte Zustellungen** listet die letzten zehn Läufe, die der Webhook gestartet hat, die neuesten zuerst, jeweils mit Status und **Lauf ansehen**. Solange sich Tale an eine Zustellung erinnert, sagt die Zeile auch, woran Tale eine Wiederholung erkennt: **ID aus** dem gelesenen Header oder **Ohne Zustell-ID**. Eine Anfrage, die Tale abgelehnt hat, hat keinen Lauf gestartet und steht nicht in der Liste; die Antwort an den Absender nennt den Grund. -Die URL berechtigt zum Start. Bewahre sie wie Zugangsdaten auf und gib sie nur dem sendenden System. **Token rotieren** erzeugt einen Ersatz und macht die alte URL ungültig. Entfernen oder Ersetzen des Triggers widerruft sie ebenfalls. Aktualisiere den Absender nach einer Rotation. +Die URL berechtigt zum Start. Bewahre sie wie Zugangsdaten auf und gib sie nur dem sendenden System. **Token rotieren** fragt nach einer Bestätigung, erzeugt dann einen Ersatz und macht die alte URL ungültig. Entfernen oder Ersetzen des Triggers widerruft sie ebenfalls. Aktualisiere den Absender nach einer Rotation. ## Auf ein Plattform-Ereignis reagieren -Wähle **Plattform-Ereignis** und unter **Ereignisname** das Ereignis. Speichere und aktiviere den fertigen Trigger. Das Eingabeschema muss die Struktur mit `trigger`, `event` und `payload` aus der Tabelle akzeptieren. Von Automatisierungsläufen ausgelöste Ereignisse starten keine Trigger. So erzeugt ein Workflow durch seine eigenen Änderungen keine endlose Startschleife. +Wähle **Plattform-Ereignis** und dann unter **Ereignisname** das Ereignis. Die Liste gruppiert die Ereignisse nach ihrem Gegenstand und zeigt zu jedem Namen, ID und Anlass; tippe einen Teil davon, um zu suchen. Speichere und schalte **Aktiv** ein, wenn alles bereit ist. + +| Ereignis | ID | Ausgelöst, wenn | `payload` enthält | +| --- | --- | --- | --- | +| **Aufgabe erstellt** | `task.created` | Eine Aufgabe wird auf einem Board, über die API oder durch einen Import erstellt. | `taskId`, `projectId`, `actorType`, `actorId` | +| **Aufgabenstatus geändert** | `task.status_changed` | Eine Person verschiebt eine Aufgabe in einen anderen Status. Eigene Verschiebungen eines Agenten zählen nicht. | `taskId`, `projectId`, `fromStatus`, `toStatus`, `actorType`, `actorId` | +| **Kommentar hinzugefügt** | `comment.created` | Zu einer Aufgabe wird ein Kommentar geschrieben. | `comment` mit `body`, `taskId`, `projectId` und `mentions` | +| **In einem Kommentar erwähnt** | `comment.mentioned` | Ein Aufgabenkommentar erwähnt jemanden mit @. | `comment`, `taskId`, `mentions`, `actorType`, `actorId` | +| **Konversation gestartet** | `conversation.created` | Eine Konversation öffnet sich in der Inbox: Eine E-Mail trifft ein oder eine externe Konversation wird gespiegelt. | `conversationId`, `channel` | +| **Nachricht erhalten** | `conversation.message_received` | Eine Nachricht kommt in einer bestehenden Konversation an. | `conversationId`, `messageId`, `direction` | +| **Kontakt erstellt** | `contact.created` | Ein Kontakt wird über die API, die App oder einen Import angelegt. | `contactId` | +| **Kontakt geändert** | `contact.updated` | Die Angaben eines Kontakts ändern sich. | `contactId` | +| **Kontakt gelöscht** | `contact.deleted` | Ein Kontakt wird gelöscht. | `contactId` | +| **Projekt erstellt** | `project.created` | Ein Projekt wird erstellt. | `projectId`, `name`, `actorId` | -Erwartet ein Workflow Pflichtfelder wie `owner` und `repo` auf oberster Ebene, passen Zeitplan-Metadaten oder eine eingepackte Webhook-Nutzlast nicht unverändert dazu. Passe Schema und Verweise an oder starte per API mit diesen Feldern. Die Trigger-Einstellungen bieten keine frei definierbaren gespeicherten Eingabefelder. +Die Nutzlast enthält IDs, keine vollständigen Datensätze: Braucht der Workflow mehr, liest er Aufgabe, Kommentar oder Kontakt mit einem Schritt. Eine neue Aufgabe erreicht den Workflow zum Beispiel so: + +```json +{ + "trigger": "event", + "event": "task.created", + "payload": { + "taskId": "5e2f9d34-8a71-4c6b-b0d2-91a7e3c4f815", + "projectId": "0b9c6a52-5d1e-4f0a-9c3e-2f6d8a1b7e40", + "actorType": "user", + "actorId": "c41d7e88-2b3a-4f95-8e60-7d5a9b1c0f23" + } +} +``` + +Ereignisse zu Aufgaben, Kommentaren und Projekten gehören zu einem Projekt, Ereignisse zu Kontakten und Konversationen nicht. Ein Ereignis eines Projekts startet die Automatisierungen, die in diesem Projekt oder in keinem Projekt installiert sind, und ihre Läufe gehören zu diesem Projekt. Eine Automatisierung, die nur in anderen Projekten installiert ist, reagiert nicht darauf. Ein Ereignis ohne Projekt startet eine Automatisierung, die in genau einem Projekt installiert ist, in diesem Projekt. Ist dieses Projekt archiviert oder lehnen die Eingaben der Automatisierung das Ereignis ab, startet kein Lauf, und der Trigger zeigt den Grund. Die anderen Automatisierungen, die auf das Ereignis warten, starten trotzdem. Unter **Ereignisname** sagt das Feld, welche Ereignisse diese Automatisierung starten. + +Ein Ereignis, das ein Lauf einer Automatisierung auslöst, startet nie dieselbe Automatisierung, und ein Lauf, den ein Ereignis gestartet hat, startet keine weiteren Automatisierungen. So erzeugt ein Workflow durch seine eigenen Änderungen keine endlose Startschleife, weder allein noch mit einem anderen. Das gilt für alles, was der Lauf selbst tut: seine Schritte, seine Connector-Aufrufe und die Werkzeuge seines eigenen Agenten. Arbeit, die ein Schritt an einen Projektagenten übergibt, gehört diesem Agenten; ein Ereignis, das er auslöst, kann die Automatisierung also erneut starten. Achte darauf, dass solche Arbeit nicht das Ereignis auslöst, auf das die Automatisierung wartet. + +## Prüfen, was ein Lauf erhält + +**Dieser Lauf erhält** zeigt die Eingabe des nächsten Laufs genau so, wie der Trigger sie zusammensetzt: die eigenen Felder des Triggers, seine feste Eingabe und bei einem Webhook oder Ereignis eine Beispiel-`payload`. Bei einem Zeitplan ist `firedAt` der Fälligkeitszeitpunkt in Millisekunden seit 1970 (UTC). Mit **Eingabe kopieren** übernimmst du sie in einen Testlauf. + +Darunter vergleicht der Abschnitt die Eingabe mit den Eingaben der Live-Version. Er meldet etwa **Version 3 akzeptiert diese Eingabe** oder warnt **Version 3 akzeptiert diese Eingabe nicht** und nennt einen Weg zur Lösung: die fehlenden Felder in der festen Eingabe ergänzen oder die Eingaben im Editor anpassen. Den Inhalt eines Webhooks kennt Tale erst, wenn eine Anfrage eintrifft; er zählt deshalb nie gegen die Version. Dieselbe Prüfung läuft beim Speichern eines Triggers und beim Live-Schalten einer Version; gespeichert wird trotzdem, und das Problem wird genannt. + +### Feste Eingabe + +Eine feste Eingabe gibt jedem Lauf, den der Trigger startet, dieselben Werte mit, etwa `owner` und `repo`, die eine geplante GitHub-Triage braucht. Öffne **Feste Eingabe hinzufügen** und gib ein JSON-Objekt mit höchstens 16 KiB ein. Die eigenen Felder des Triggers (`trigger`, `firedAt`, `event` und `payload`) überschreiben es, darum darf es sie nicht enthalten. Es sind reine Daten: Eine Vorlage wie `{{ input.owner }}` kommt als Text an, und beim Speichern warnt Tale davor. + +Verlangt die Live-Version Felder, die der Trigger nicht sendet, ist der Abschnitt bereits geöffnet, und **Die 2 fehlenden Felder ergänzen** (oder entsprechend viele) schreibt für jedes Feld einen Platzhalter mit passendem Typ und setzt den Cursor in den ersten. Ersetze die Platzhalter und speichere. Ein geplanter Lauf erhält dann: + +```json +{ + "owner": "acme", + "repo": "website", + "trigger": "schedule", + "firedAt": 1791529200000 +} +``` + +### Jetzt ausführen + +**Jetzt ausführen** startet die Live-Version einmal im Live-Modus, mit der Eingabe, die der gespeicherte Trigger sendet, so wie der Trigger es täte. Bei einem Zeitplan siehst du zuerst diese Eingabe und bestätigst mit **Lauf starten**. Bei einem Webhook oder Ereignis öffnet sich der Lauf-Dialog mit dem Beispiel zum Bearbeiten. Die Schaltfläche wartet, bis eine Version live ist und deine Änderungen am Trigger gespeichert sind. Das Ergebnis erscheint unter der Schaltfläche: **Lauf gestartet.** mit **Lauf ansehen** oder der Grund, warum kein Lauf startete. Der Zeitplan und der letzte Lauf des Triggers bleiben, wie sie sind. + +## Den Trigger nach dem Live-Schalten einschalten + +Ein neuer Trigger ist zunächst ausgeschaltet, ebenso der Trigger eines mitgelieferten Pakets. Schaltest du eine Version live, im Editor oder durch das Hochladen eines Pakets, und ihr Trigger ist aus, meldet ein Hinweis **Ihr Trigger ist ausgeschaltet**. **Trigger einschalten** schaltet den gespeicherten Trigger unverändert ein, und der Hinweis lautet dann **Der Trigger ist eingeschaltet.** + +Würde die Live-Version ablehnen, was der Trigger sendet, oder hat ein Webhook noch keine URL, bietet der Hinweis stattdessen **Trigger prüfen** an. Das öffnet den Abschnitt **Trigger** im Tab **Allgemein**, wo du zuerst die feste Eingabe ergänzt oder die URL erzeugst. Die mitgelieferten GitHub-Pakete sind ein Beispiel: Ihre Zeitpläne brauchen ein Repository, wie [Mitgelieferte Automatisierungen](/de/platform/automations/builtin) erklärt. ## Einen Projektagenten nach Zeitplan starten @@ -101,15 +217,15 @@ nodes: feedback: 'Scheduled occurrence {{ input.firedAt }}.' ``` -Der Schritt liefert den gestarteten Lauf zurück, und die Zeitleiste der Aufgabe führt diesen Lauf als **Automatisierung** mit einem Link zum Automatisierungslauf. Startet der Schritt nichts, ist er trotzdem erfolgreich und nennt den Grund. So bleibt der Termin festgehalten, statt für später eingereiht zu werden: +Der Schritt liefert den gestarteten Lauf zurück, und die Zeitleiste der Aufgabe führt diesen Lauf als **Automatisierung** mit einem Link zum Automatisierungslauf. Ein Agent, der gerade an anderen Aufgaben arbeitet, wird trotzdem gestartet: Sein Lauf arbeitet in einem eigenen [Worker](/de/platform/projects/project-agents#run-one-agent-on-several-tasks), und sind alle Agenten-Worker deiner Organisation belegt, wartet er auf einen und startet von selbst. Startet der Schritt nichts, ist er trotzdem erfolgreich und nennt den Grund. So bleibt der Termin festgehalten, statt für später eingereiht zu werden: | Antwort | Bedeutung | | --- | --- | -| `started: true` | Der Lauf des Agenten wurde gestartet; `runId` nennt ihn. | +| `started: true` | Der Lauf des Agenten wurde gestartet; `runId` nennt ihn. Mit `waitingReason` wartet der Lauf auf Platz, bevor er arbeitet: `org_limit`, wenn alle Agenten-Worker deiner Organisation belegt sind, `host`, wenn der Sandbox-Host voll ist, `destroy_pending`, wenn der Arbeitsbereich, den er nutzen würde, gerade gelöscht wird, `exec_limit`, wenn seine Sandbox noch einen früheren Prozess beendet. Er startet von selbst, sobald Platz frei wird. | | `already_running` | Der vorherige Lauf der Aufgabe arbeitet noch und trägt die Arbeit weiter. Es startet nichts Neues, und der Termin wartet nicht darauf, dass dieser Lauf endet. | | `in_review` | Mit `moveToInProgress: false` wartet die Karte auf ihren erfassten Prüfer, eine Person oder einen Agenten. Es wird nichts zugewiesen oder gestartet, und die Prüfung behält diesen Empfänger. | | `closed` | Mit `moveToInProgress: false` steht die Karte auf **Erledigt** oder **Abgebrochen** (`taskStatus`). Es wird nichts zugewiesen oder gestartet. | -| `agent_busy` | Der Agent arbeitet an einer anderen Aufgabe (`busyTaskId`). Ein Agent bearbeitet in seinem Arbeitsbereich jeweils nur eine Aufgabe. | +| `agent_busy` | Kommt nicht mehr vor: Ein Agent, der an einer anderen Aufgabe arbeitet, wird in einem eigenen Worker gestartet oder wartet auf einen. Ältere Läufe einer Automatisierung können die Antwort noch zeigen. | | `blocked` | Eine Aufgabe, von der diese abhängt, ist noch offen (`blockedBy`). | | `paused` | Die Aufgabe hat in der letzten Stunde schon drei Starts durch Automatisierungen und Agenten erhalten, gewöhnliche automatische Wiederholungen eingerechnet. Eine Broker-Wartezeit unmittelbar nach einem HTTP-429-Fehler desselben Agenten erhöht die Zahl nicht; aufeinanderfolgende Wartezeiten zählen weiterhin. `retryAfter` gibt an, wann die Stundengrenze einen weiteren Start zulässt; die übrigen Startprüfungen gelten weiterhin. | @@ -119,6 +235,10 @@ Ein Lauf, den ein Zeitplan startet, arbeitet in niemandes Auftrag. Er nutzt die Bei dafür geeigneten Fehlern kann der Lauf automatisch wiederholt werden, solange Status und Zuweisung der Aufgabe unverändert bleiben und seit dem Start keine neue Status-, Zuweisungs-, Archivierungs- oder Prüfentscheidung getroffen wurde. Auch wenn du einen Wert änderst und danach zurücksetzt, endet diese Wiederholung; Kommentare beenden sie nicht. Die Grenzen für Wiederholungen, die Berechtigungen des Zeitplans und die Prüfungen des Arbeitsbereichs gelten weiterhin. Ein späterer Termin kann neue Arbeit starten, sobald die Voraussetzungen erfüllt sind. +### Den Zeitplan wecken, wenn ein Agent seinen Platz freigibt + +Ein Zeitplan, der die Dauerrolle eines Projekts ausführt, etwa einen Manager, der Arbeit verteilt, kann zusätzlich auslösen, sobald ein Agent seines Projekts fertig ist und einer seiner regulären Worker frei wird, statt auf die nächste Cron-Minute zu warten. Du schaltest das mit `wakeOnSlotFreed: true` in der verwalteten Konfiguration des Zeitplans ein, die du mit der Tale CLI anwendest; nur ein aktivierter Zeitplan pro Projekt kann es haben – ein zweiter wird abgelehnt, ebenso die Installation seiner Automatisierung in einem Projekt, das bereits ein anderer Zeitplan weckt –, und die App hat dafür keinen Schalter. Jedes Wecken ist ein gewöhnlicher Termin mit der üblichen Eingabe `{ trigger: "schedule", firedAt }`, daher gelten die Antworten oben weiterhin. Mehrere Agenten, die fertig werden, während ein Wecken aussteht, ergeben zusammen ein Wecken. Ein Wecken wartet, solange auf der eigenen Karte des Managers noch ein Lauf aktiv ist oder automatisch wiederholt werden soll, die Karte den Start ablehnen würde oder nicht mehr dem Agenten zugewiesen ist, bis `retryAfter`, wenn die Aufgabe innerhalb der Stunde drei Starts hatte, und nach einem Termin, der nichts bewirkt hat, eine Minute, die sich bis zu einer Stunde verdoppelt, ohne Grenze für die Versuche. Andere Aufgaben desselben Agenten halten das Wecken nicht auf; der neue Lauf des Managers bekommt einen eigenen Worker oder wartet wie üblich auf Kapazität. Es gilt erst als erledigt, wenn der dadurch gestartete Lauf des Agenten begonnen und abgeschlossen hat. Solange der Zeitplan nach Fehlern pausiert, ausgeschaltet oder ohne `wakeOnSlotFreed` ist, wartet das Wecken und löst einmal aus, sobald der Zeitplan erneut gespeichert wird. + ### Jedes Issue nach Zeitplan importieren Ein Issue-Import liest pro Lauf höchstens einen Stapel mit bis zu 500 Issues und meldet, wo der nächste Stapel beginnt. Eine Person setzt ihn mit **Import fortsetzen** fort; ein Zeitplan merkt sich die Position stattdessen zwischen seinen Terminen. So importiert jeder Termin einen Stapel ab der Stelle, an der der vorherige aufgehört hat, bis alle offenen Issues gelesen sind, und der Termin danach beginnt den nächsten Durchgang. Lies die Position mit `task.get_import_cursor`, gib sie an den Import weiter und speichere dessen `nextCursor` mit `task.save_import_cursor`: @@ -154,18 +274,26 @@ nodes: ## Einen ausgebliebenen Start untersuchen -Prüfe zuerst **Aktiv**, die Live-Version und den letzten Auslösezeitpunkt. Lies anschließend einen gegebenenfalls protokollierten Grund: +Oben im Abschnitt **Trigger** siehst du, wie es um den Trigger steht: wann er zuletzt einen Lauf gestartet hat, mit dessen Status und **Lauf ansehen**, oder **Hat noch keinen Lauf gestartet.** War der Trigger zuletzt fällig oder traf zuletzt ein Ereignis ein, ohne dass etwas startete, nennt ein Hinweis darunter den Grund, die Lösung und den Weg dorthin: -| Grund oder Symptom | Was du prüfst | -| --- | --- | -| `not_deployed` | Schalte eine getestete Version live. Ein gespeicherter Entwurf reicht nicht. | -| `start_refused` | Vergleiche das Eingabeschema der Live-Version mit der Trigger-Struktur und behebe den gemeldeten Start- oder Validierungsfehler. | -| `unusable_cron` | Korrigiere Ausdruck oder Zeitzone und speichere erneut. Andere Zeitpläne laufen währenddessen weiter. | -| `paused_after_failures` | Der Zeitplan hat sich nach wiederholten Fehlern selbst ausgeschaltet. Siehe [Wenn sich ein Zeitplan selbst pausiert](#wenn-sich-ein-zeitplan-selbst-pausiert). | -| Webhook-Zugang abgelehnt | Prüfe aktuelle URL und Aktivierung. Unbekannte und deaktivierte Tokens liefern absichtlich dieselbe Ablehnung. | -| Lauf vorhanden, aber nicht beendet | Öffne die [Ausführungsprotokolle](/de/platform/automations/execution-logs). Der Start gelang; das Problem liegt im Lauf. | - -Der letzte Auslösezeitpunkt ändert sich erst bei einem tatsächlichen Start. Ein fälliger Trigger, der nicht starten kann, protokolliert stattdessen den ausgelassenen Start. So erkennst du den Unterschied zu einem gestarteten Workflow, der später scheitert. +| Hinweis | Was passiert ist | Was du tust | +| --- | --- | --- | +| **Ausgelassen: keine Version bereitgestellt** | Der Trigger war fällig, aber es gibt nur Entwürfe. | **Editor öffnen** und eine getestete Version live schalten. | +| **Ausgelassen: Die Eingabe des Laufs wurde abgelehnt** | Die Live-Version hat abgelehnt, was der Trigger sendet. | Die fehlenden Felder in der [festen Eingabe](#feste-eingabe) ergänzen oder die Eingaben im Editor anpassen. | +| **Ausgelassen: Das Projekt kann keine Läufe starten** | Das Projekt ist archiviert, fehlt oder erlaubt die Automatisierung nicht mehr. | Mit **Projekte bearbeiten** die **Projekte** weiter unten anpassen. | +| **Ausgelassen: Der Lauf konnte nicht starten** | Der Start wurde aus einem anderen Grund abgelehnt. | **Technische Details** öffnen und Code und Meldung lesen. | +| **Ausgelassen: Der Zeitplan ist nicht lesbar** | Zeitplan oder Zeitzone waren nicht lesbar. Bis zur Korrektur startet nichts. | **Zeitplan bearbeiten** und speichern. | +| **3 Läufe wurden verpasst**, zum Beispiel | Läufe waren fällig, während Tale nicht verfügbar war. | Nichts; [Verpasste Läufe](#bei-verpassten-laeufen) hat entschieden, was startete. | +| **Nach wiederholten Fehlern pausiert** | Der Zeitplan hat sich selbst ausgeschaltet. | Siehe [Wenn sich ein Zeitplan selbst pausiert](#wenn-sich-ein-zeitplan-selbst-pausiert). | + +**Technische Details** ist anfangs zugeklappt und enthält die rohen Fakten auf Englisch: den Code, die Version, die den Start abgelehnt hat, ihre Meldung und jedes Problem mit seinem Feld. Wurden auch frühere Läufe verpasst, nennt der Hinweis ihre Zahl. Über die API liest du dieselben Fakten als `lastSkipReason` und `lastSkipDetail`; siehe die [API-Referenz](/de/develop/api-reference#triggerzustand-pruefen-und-gezielt-pausieren). + +Manche ausgebliebenen Starts zeigen keinen Hinweis: + +- Eine Webhook-Anfrage, die Tale abgelehnt hat, hat keinen Lauf gestartet und am Trigger nichts verändert. Prüfe die Antwort an den Absender; [Webhooks](/de/develop/webhooks) listet die möglichen Antworten. Eine unbekannte oder ausgeschaltete URL erhält absichtlich dieselbe Ablehnung. +- Ein Lauf, der existiert, aber nicht fertig wurde, ist korrekt gestartet. Öffne ihn unter **Läufe**; die [Ausführungsprotokolle](/de/platform/automations/execution-logs) erklären, was darin passiert ist. + +Der letzte Lauf ändert sich erst, wenn tatsächlich ein Lauf startet. Ein fälliger Trigger, der keinen starten kann, hält stattdessen den ausgelassenen Start fest. So unterscheidest du einen defekten Trigger von einem Workflow, der gestartet ist und später scheitert. ## Wenn sich ein Zeitplan selbst pausiert diff --git a/docs/de/platform/chat/basics.md b/docs/de/platform/chat/basics.md index 065fe8c2cc..e46f7ac4cf 100644 --- a/docs/de/platform/chat/basics.md +++ b/docs/de/platform/chat/basics.md @@ -80,7 +80,7 @@ Der Aufgabendialog öffnet sich mit deiner letzten Anfrage als Beschreibung, ein -Danach steht die Aufgabe über dem Nachrichtenfeld des Chats, mit dem, was sie gerade tut: **Der Agent arbeitet**, **Wartet auf einen Sandbox-Platz**, **Wird erneut versucht…**, **Bereit zur Prüfung** mit der Zahl der gelieferten Dateien oder **Der Agent konnte sie nicht fertigstellen**. **Öffnen** führt dich zur Aufgabe. Du wirst außerdem benachrichtigt, wenn sie zur Prüfung bereit ist und wenn der Agent nicht fertig wird; [Wenn der Agent nicht fertig wird](/de/platform/projects/task-automation#wenn-der-agent-nicht-fertig-wird) erklärt, wie es weitergeht. +Danach steht die Aufgabe über dem Nachrichtenfeld des Chats, mit dem, was sie gerade tut: **Der Agent arbeitet**, **Wartet auf einen Worker** (oder ein anderer Zustand, der sagt, worauf der Lauf wartet), **Wird erneut versucht…**, **Bereit zur Prüfung** mit der Zahl der gelieferten Dateien oder **Der Agent konnte sie nicht fertigstellen**. **Öffnen** führt dich zur Aufgabe. Du wirst außerdem benachrichtigt, wenn sie zur Prüfung bereit ist und wenn der Agent nicht fertig wird; [Wenn der Agent nicht fertig wird](/de/platform/projects/task-automation#wenn-der-agent-nicht-fertig-wird) erklärt, wie es weitergeht. @@ -98,6 +98,8 @@ Dateien kommen nur aus deinem eigenen Gespräch mit. Eine Aufgabe nimmt nur die Über die Antwortleiste kopierst du Text, gibst Feedback, öffnest Details oder zweigst das Gespräch an dieser Stelle ab. Mit einer Abzweigung probierst du eine andere Richtung aus und behältst den bisherigen Austausch. +Deine eigenen Nachrichten stehen rechts. Von einer langen siehst du den Anfang; **Weiterlesen** öffnet den Rest an Ort und Stelle, **Weniger anzeigen** klappt ihn wieder zu. Zeige auf eine deiner Nachrichten oder setze den Tastaturfokus hinein, dann siehst du, wann du sie gesendet hast, und findest **Nachricht bearbeiten**: Damit änderst du den Text in einer neuen Version des Gesprächs. Auf einem Touchscreen ist beides immer zu sehen. Unter einer Nachricht, die du bearbeitet hast oder deren Antwort du mit **Erneut versuchen** neu angefordert hast, wechselst du mit **Vorheriger Zweig** und **Nächster Zweig** zwischen den Versionen; die Zahl dazwischen, etwa 2/3, zeigt, welche gerade zu sehen ist. + Frühere Chats findest du im Bereich [Start](/de/platform#home); die Ansicht **Chats** über der Liste zeigt nur deine Chats. Pinne häufig benötigte Chats, gib ihnen erkennbare Titel oder verschiebe sie in ein Projekt, wenn das Thema längerfristig wird: Zieh sie auf das Projekt oder wähle **In Projekt verschieben…** in ihrem Menü. [Geteilte Chats](/de/platform/chat/shared-threads) erklärt die schreibgeschützte Freigabe für Kollegen. Sehr lange Gespräche können das Kontextfenster des Modells überschreiten. Tale zeigt einen Hinweis, wenn ältere Nachrichten nicht mehr mitgegeben werden. Wiederhole wichtige Anforderungen oder beginne einen neuen Chat mit den benötigten Quellen, statt die vollständige Historie vorauszusetzen. diff --git a/docs/de/platform/knowledge/crawling.md b/docs/de/platform/knowledge/crawling.md index f2860aace2..f782a686af 100644 --- a/docs/de/platform/knowledge/crawling.md +++ b/docs/de/platform/knowledge/crawling.md @@ -94,6 +94,7 @@ Prüfe zuerst Adresse, Quelltyp und letzte Scan-Zeit. Öffne danach die Quelle, | Darstellung oder Textextraktion fehlgeschlagen | Prüfe, ob die öffentliche Seite lädt und sich das Originaldokument öffnen lässt. Repariere oder exportiere eine beschädigte Quelle erneut. | | Der Assistent meldet, die Suche in Webseiten sei nicht eingerichtet | Die Organisation hat kein funktionierendes Embedding-Modell. Ein Administrator legt es unter **Einstellungen > Datenresidenz** fest; danach scannt Tale die betroffenen Quellen erneut. | | **Fehler** mit „Das Embedding-Modell konnte die Seiten nicht verarbeiten.“ | Der Embedding-Anbieter hat die Anfrage abgelehnt oder konnte sie nicht bedienen: abgelehnte Zugangsdaten, aufgebrauchtes Guthaben, ein Ratenlimit, das über alle Wiederholungen anhielt, oder ein Ausfall. Die Details der Quelle sagen, was davon zutrifft, mit der Antwort des Anbieters darunter. Ein Administrator repariert das Modell unter **Einstellungen > Datenresidenz** oder die Zugangsdaten unter **Einstellungen > KI-Anbieter**; beim Speichern werden die betroffenen Quellen erneut gescannt. Nach einem Ausfall beim Anbieter wählst du **Jetzt scannen**, sobald er wieder erreichbar ist. | +| Die Details der Quelle sagen, dass ein Nutzungslimit den letzten Scan gestoppt hat | Das Embedding der Seiten zählt für die Limits der Person, die den Scan angestoßen hat: wer die Quelle hinzugefügt oder **Jetzt scannen** gewählt hat, bei einem geplanten Scan die Organisation. Die Seiten sind gespeichert, und die Suche der Quelle selbst findet sie; die Suche nach Bedeutung übergeht die Seiten nach Erreichen des Limits, bis der Scan von selbst weiterläuft, spätestens eine Stunde nachdem das Limit zurückgesetzt wurde oder ein Administrator es erhöht hat. | | **Fehler** mit „Der Scan ist nicht gelaufen.“ | Der Browser des Crawlers konnte nicht starten, deshalb wurde keine Seite dargestellt; sein Bericht steht in den Details der Quelle unter **Technische Details**. An der Adresse liegt es nicht: Lass deinen Betreiber den Sandbox-Dienst prüfen und wähle danach **Jetzt scannen**. | Ein späterer erfolgreicher Abruf entfernt den vorherigen Fehler. Nach einer fehlgeschlagenen Aktualisierung kann die früher indexierte Fassung weiterhin verfügbar sein: **Aktiv** und die Anzahl indexierter Seiten belegen nicht, dass jede Seite aktuell ist. Vergleiche gespeicherte Textabschnitte und Abrufdatum mit dem Original, bevor du dich auf eine kürzliche Änderung verlässt. diff --git a/docs/de/platform/knowledge/documents.md b/docs/de/platform/knowledge/documents.md index af49094f7d..e13d2640bf 100644 --- a/docs/de/platform/knowledge/documents.md +++ b/docs/de/platform/knowledge/documents.md @@ -42,6 +42,7 @@ Wiederholtes Indexieren macht ein nicht unterstütztes Format nicht durchsuchbar | **Wird indexiert** | Der Text wird für die Suche vorbereitet. Warte mit der Prüfung der Quelle. | | **Indexiert** | Die Indexierung ist abgeschlossen. Stelle eine konkrete Frage und öffne den Quellenbeleg. | | **Neuindexierung nötig** | Der Index ist veraltet. Nutze **Indexierung erneut versuchen** neben der Statusanzeige. | +| **Wartet auf ein Nutzungslimit** | Ein Nutzungslimit, das für die Person gilt, für die das Dokument indexiert wird, ist erreicht. Die Indexierung läuft von selbst weiter, spätestens eine Stunde nachdem das Limit zurückgesetzt oder erhöht wurde; an der Datei ist nichts zu beheben. | | **Fehlgeschlagen** | Lies den Fehler, behebe die Ursache und versuche es erneut. | | **Nicht unterstützt** | Dieser Dateiinhalt lässt sich nicht indexieren: etwa bei einem ungeeigneten Format, leerem oder unlesbarem Text oder einer beschädigten PDF-Datei. Öffne die Statusanzeige für die Ursache. | | **Nicht indexiert** | Es liegt kein abgeschlossener Index vor. Prüfe die Datei und starte die Indexierung, wenn angeboten. | @@ -62,6 +63,7 @@ Klicke auf **Fehlgeschlagen** oder **Nicht unterstützt**, um die Erklärung zu | Embedding-Modell fehlt oder der Anbieter lehnt das Konto ab | Ein Administrator muss das Modell unter **Einstellungen > Datenresidenz** konfigurieren oder Schlüssel, Modellzugriff, Tarif beziehungsweise Guthaben beim Anbieter korrigieren. Versuche es danach erneut. | | Zugangsdaten für das Embedding fehlen oder sind unbrauchbar | Die Zugangsdaten, die das Embedding-Modell verwendet, wurden gelöscht oder deaktiviert, der Anbieter hat keinen Standard mehr (**Einstellungen > Datenresidenz** zeigt **Zugangsdaten fehlen**), oder ihr Geheimnis lässt sich nicht lesen: Es wurde mit einem früheren Verschlüsselungsschlüssel gespeichert, oder die Zugangsdaten verweisen auf eine Umgebungsvariable, die der Server nicht setzt. Ein Administrator legt die Zugangsdaten unter **Einstellungen > KI-Anbieter** an oder repariert sie oder wählt andere für das Embedding-Modell. Jede dieser Speicherungen stellt die betroffenen Dokumente wieder in die Warteschlange. Wurde der Fehler auf dem Server selbst behoben, etwa durch das Setzen der Umgebungsvariable, nutze **Indexierung erneut versuchen**. | | Vorübergehender Fehler beim Anbieter oder Indexierungsdienst | Hintergrundaufträge wiederholen vorübergehende Fehler. Bleibt der Fehler bestehen, gib einem Administrator Dokumentname und Meldung. Nach der Reparatur nutze **Indexierung erneut versuchen**. | +| Ein Nutzungslimit ist erreicht | Beim Indexieren wird Text über das Embedding-Modell in Vektoren umgewandelt. Das zählt für die Limits der Person, für die das Dokument indexiert wird: wer es hochgeladen hat, wem ein synchronisiertes Laufwerk gehört, oder die Organisation bei einem E-Mail-Anhang. Das Dokument zeigt **Wartet auf ein Nutzungslimit** und läuft von selbst weiter, spätestens eine Stunde nachdem das Limit zurückgesetzt wurde oder ein Administrator es unter **Einstellungen > Richtlinien > Richtlinien & Limits** erhöht hat. | | Suchindex wird neu aufgebaut oder Reparatur fehlgeschlagen | Der Neuaufbau kann automatisch abschließen. Scheitert die Reparatur, muss der Betreiber die Wissensdatenbank reparieren oder wiederherstellen, bevor ein neuer Versuch hilft. | Bei **Nicht unterstützt** gibt es keine Wiederholungsaktion: Dieselben Dateiinhalte würden wieder scheitern. Auch bei **Fehlgeschlagen** kann zuerst eine Änderung an Quelle oder Konfiguration nötig sein. Anwendungen unterscheiden die Fälle anhand von `indexing.errorCode`; die [API-Referenz](/de/develop/api-reference) führt die stabilen Codes auf. diff --git a/docs/de/platform/knowledge/knowledge-entries.md b/docs/de/platform/knowledge/knowledge-entries.md index 67ecd3de68..554868577d 100644 --- a/docs/de/platform/knowledge/knowledge-entries.md +++ b/docs/de/platform/knowledge/knowledge-entries.md @@ -39,7 +39,7 @@ Vermeide relative Zeitangaben wie „nächsten Freitag“ und Verweise wie „di -Klicke auf **Speichern**. Der Eintrag erscheint mit Thema, Inhalt, Quelle (**Manuell** für das Formular, **Chat** für eine Information, die der Assistent festgehalten hat, **API** für eine, die eine Integration über REST geschrieben hat), Indexierungsstatus und Änderungszeit in der Tabelle. Öffne ihn, um den gesamten Inhalt zu lesen. Die Indexierung läuft im Hintergrund: Ein gespeicherter Eintrag ist nicht sofort für die Suche bereit. +Klicke auf **Speichern**. Der Eintrag erscheint mit Thema, Inhalt, Quelle (**Manuell** für das Formular, **Chat** für eine Information, die der Assistent festgehalten hat, **API** für eine, die eine Integration über REST geschrieben hat, **Agent** für eine, die ein Agent gespeichert hat), Indexierungsstatus und Änderungszeit in der Tabelle. Öffne ihn, um den gesamten Inhalt zu lesen. Die Indexierung läuft im Hintergrund: Ein gespeicherter Eintrag ist nicht sofort für die Suche bereit. @@ -63,6 +63,16 @@ Wenn ein Chat eine nützliche Information liefert, prüfe sie anhand der Quelle. +## Einen Agenten Informationen aktuell halten lassen + +Auch ein Projektagent oder der Agentenschritt einer Automatisierung kann Informationen speichern. Gib ihm dazu unter **Skills, Connectors & Tools** in der [Ausstattung des Agenten](/de/platform/projects/project-agents) das Tool **Wissenseinträge hinzufügen und bearbeiten**. Der Agent speichert eine Information pro Thema; ein Thema ohne Eintrag erhält einen neuen, mit **Agent** als Quelle. + +Um einen vorhandenen Eintrag zu ändern, muss der Agent die Version nennen, die er gelesen hat. Hat eine Person oder ein anderer Agent den Eintrag inzwischen geändert, wird nichts gespeichert: Der Agent erhält den aktuellen Text und führt seine Änderung darin zusammen. Der **Versionsverlauf** bewahrt jeden früheren Text auf, wie bei deinen eigenen Änderungen. + +Einträge gehören der ganzen Organisation. Ein Lauf, den ein Mitglied gestartet hat, kann deshalb keine speichern, und kein Agent kann einen Eintrag löschen. Für Agenten gilt ein eigenes Limit, wie viele Einträge sie pro Minute speichern, sodass ein beschäftigter Agent niemanden beim Bearbeiten aufhält. Jede Speicherung durch einen Agenten wird im Audit-Log festgehalten. + +Durchsuchen können Agenten das Wissen immer, ohne Freigabe: Das Ausstattungsmenü zeigt das als **Wissen durchsuchen**, immer aktiv. + ## Einen veralteten Eintrag entfernen Wähle **Löschen** im Zeilenmenü und lies die Bestätigung. Dadurch verschwinden der Eintrag und seine früheren Fassungen aus dieser Ansicht; das zugehörige Dokument steht der Wissenssuche nicht mehr zur Verfügung. Sichere den Text vorher, falls du ihn noch brauchst. Für eine Korrektur ist **Bearbeiten** der passende Weg. diff --git a/docs/de/platform/knowledge/overview.md b/docs/de/platform/knowledge/overview.md index 1875521929..a0e5a27227 100644 --- a/docs/de/platform/knowledge/overview.md +++ b/docs/de/platform/knowledge/overview.md @@ -42,7 +42,7 @@ Prüfe eine neue Quelle mit einer Frage, deren Antwort du kennst: „Wann ist un ## Zugriff und Suche verstehen -Im Organisationschat kann der Assistent die gemeinsame Bibliothek innerhalb deiner Berechtigungen durchsuchen. Im Projektchat kommen die Dateien und gespeicherten Anweisungen dieses Projekts hinzu. Dateien anderer Projekte gehören nicht dazu. Projektagenten brauchen die passenden Plattform-Tools in ihrer Ausstattung. +Im Organisationschat kann der Assistent die gemeinsame Bibliothek innerhalb deiner Berechtigungen durchsuchen. Im Projektchat kommen die Dateien und gespeicherten Anweisungen dieses Projekts hinzu. Dateien anderer Projekte gehören nicht dazu. Projektagenten und Agentenschritte von Automatisierungen durchsuchen dieses Wissen im Bereich ihres Projekts immer, ohne Freigabe; um [Wissenseinträge](/de/platform/knowledge/knowledge-entries) direkt zu lesen oder zu ändern, brauchen sie das passende Tool in ihrer Ausstattung. Team-Beschränkungen gelten auch bei der Suche. Eine Datei, die du in einem Arbeitsbereich siehst, kann deshalb im Kontext eines anderen Projekts fehlen. Nutze [Projektdateien](/de/platform/projects/manage-files) für projektspezifische Inhalte und die Team-Zuordnung von Dokumenten für die gemeinsame Bibliothek. diff --git a/docs/de/platform/member/preferences.md b/docs/de/platform/member/preferences.md index 3eec558aea..fea773b60e 100644 --- a/docs/de/platform/member/preferences.md +++ b/docs/de/platform/member/preferences.md @@ -57,7 +57,7 @@ Deine Anweisungen überschreiben weder die verbindlichen Anweisungen der Organis ## Nutzungslimits prüfen {#usage-limits} -Unter **Einstellungen > Nutzung** siehst du, wie viel du von den Limits verbraucht hast, die deine Organisation für dich festlegt. Gilt kein Limit für dich, zeigt die Seite das an. Das Limit eines Projekts, das alles begrenzt, was in diesem Projekt ausgegeben wird, steht nicht hier; eine Anfrage, die es ablehnt, nennt es. +Unter **Einstellungen > Nutzung** siehst du, wie viel du von den Limits verbraucht hast, die deine Organisation für dich festlegt. Gilt kein Limit für dich, zeigt die Seite das an. Das Limit eines Projekts, das alles begrenzt, was in diesem Projekt ausgegeben wird, steht nicht hier: In den Chats des Projekts warnt das Banner über dem Eingabefeld davor, und eine Anfrage, die es ablehnt, nennt es. @@ -69,7 +69,7 @@ Unter **Einstellungen > Nutzung** siehst du, wie viel du von den Limits verbrauc - **Geteilte Limits** zählen die Nutzung aller, für die sie gelten, etwa eines Teams, zu dem du gehörst, oder der gesamten Organisation. Sie können deshalb vor deinen eigenen Limits erreicht sein. - **Speicherplatz** vergleicht die Dateien, die du hochgeladen hast, mit deinem Speicherlimit. Ist es erreicht, werden neue Dokument-Uploads abgelehnt. -Jedes Nutzungslimit zeigt den Verbrauch, das Limit und den Zeitpunkt des Zurücksetzens in deiner Ortszeit. Die Zeiträume richten sich nach UTC: Tageslimits beginnen um Mitternacht neu, Wochenlimits am Montag und Monatslimits am Ersten des Monats. Hat ein Admin eine Warnschwelle festgelegt, färbt sich der Balken orange, sobald deine Nutzung sie erreicht. Warnt ein Banner über dem Eingabefeld vor einem Limit, öffnet **Nutzung anzeigen** diese Seite. Admins sehen zusätzlich **Limits verwalten**, das **Richtlinien > Richtlinien & Limits** öffnet. +Jedes Nutzungslimit zeigt den Verbrauch, das Limit und den Zeitpunkt des Zurücksetzens in deiner Ortszeit. Die Zeiträume richten sich nach UTC: Tageslimits beginnen um Mitternacht neu, Wochenlimits am Montag und Monatslimits am Ersten des Monats. Hat ein Admin eine Warnschwelle festgelegt, färbt sich der Balken orange, sobald deine Nutzung sie erreicht. Warnt ein Banner über dem Eingabefeld vor einem Limit, öffnet **Nutzung anzeigen** diese Seite; ein Banner zum Limit eines Projekts nennt stattdessen das Projekt. Admins sehen zusätzlich **Limits verwalten**, das **Richtlinien > Richtlinien & Limits** öffnet. ## Alte Chats archivieren oder abmelden diff --git a/docs/de/platform/projects/project-agents.md b/docs/de/platform/projects/project-agents.md index aea644779f..704d9bc827 100644 --- a/docs/de/platform/projects/project-agents.md +++ b/docs/de/platform/projects/project-agents.md @@ -1,9 +1,9 @@ --- title: Projektagenten erstellen und verwalten -description: Konfiguriere einen wiederverwendbaren Agenten, vergib seine Ausstattung und starte eine Aufgabe mit prüfbarem Ergebnis. +description: Konfiguriere einen Agenten für die Aufgaben eines Projekts, vergib seine Ausstattung und starte eine Aufgabe mit prüfbarem Ergebnis. --- -Erstelle einen Projektagenten, wenn ein wiederverwendbarer Agent die Aufgaben dieses Projekts bearbeiten soll. Er verbindet Coding-Laufzeit, Modell, Anweisungen und erlaubte Ausstattung. Du brauchst Bearbeitungszugriff auf das aktive Projekt. Mitglieder sehen die Agenten des Projekts im Tab **Agenten**, der ihnen sagt, dass sie einen Redakteur oder Admin um einen neuen bitten können. Bis ein Projekt eigene Agenten hat, können seine Aufgaben an den [Standard-Agenten](#standard-agent) der Organisation gehen. Secret-Zuordnungen dürfen nur Inhaber und Admins ändern. +Erstelle einen Projektagenten, wenn eine wiederverwendbare Konfiguration die Aufgaben dieses Projekts bearbeiten soll. Er verbindet Coding-Laufzeit, Modell, Anweisungen und erlaubte Ausstattung. Jede Aufgabe, an der er arbeitet, läuft in einem [Worker](#run-one-agent-on-several-tasks), einer laufenden Kopie des Agenten in einer eigenen Sandbox. Du brauchst Bearbeitungszugriff auf das aktive Projekt. Mitglieder sehen die Agenten des Projekts im Tab **Agenten**, der ihnen sagt, dass sie einen Redakteur oder Admin um einen neuen bitten können. Bis ein Projekt eigene Agenten hat, können seine Aufgaben an den [Standard-Agenten](#standard-agent) der Organisation gehen. Secret-Zuordnungen dürfen nur Inhaber und Admins ändern. ## Die erste Aufgabe vorbereiten @@ -25,6 +25,8 @@ Trenne dauerhafte Anweisungen von der jeweiligen Aufgabe. „Erkenne fehlende Be Öffne den Tab **Agenten** des Projekts und wähle **Neuer Agent**. Gib unter **Name** einen erkennbaren Namen ein und wähle die **Agent-Laufzeit**, also das [Programm für seine Ausführung](/de/platform/agents/harnesses). Namen sind innerhalb des Projekts eindeutig; bis zu 50 Agenten sind möglich. +Aus dem Namen macht Tale ein Handle; tippst du es nach `@`, findest du den Agenten: Aus „My Opus Agent #3“ wird `@my-opus-agent-3`. Ist das Handle schon vergeben, an einen anderen Agenten des Projekts oder an ein Mitglied oder eine Automatisierung, die man damit bereits erwähnt, bekommt der Agent das nächste freie: `-02`, dann `-03`. Hört später ein Mitglied oder eine Automatisierung auf das Handle des Agenten, wechselt der Agent ebenso zum nächsten freien. Das Handle steht im Tab **Agenten** und unter **Name**, wenn du den Agenten bearbeitest. Benennst du den Agenten um, ändert sich sein Handle; frühere Erwähnungen nennen weiter diesen Agenten und zeigen seinen neuen Namen. + Du kannst auch bei einer Aufgabe beginnen: Solange das Projekt keinen Agenten hat, öffnet **Agent erstellen …** unter **Zuständig** den Dialog **Neuer Agent** über der Aufgabe und weist ihr den Agenten zu, den du erstellst. @@ -47,13 +49,17 @@ Füge unter **Skills, Connectors & Tools** die benötigten Bundles, Dienste und +Das Suchfeld des Menüs grenzt Skills, Connectors und Tools beim Tippen ein. **Wissen durchsuchen** steht unter **Wissen** als immer aktiv: Jeder Agent durchsucht das Wissen des Projekts, ohne Freigabe. + Beachte **Schreibt Daten**, bevor du ein Plattform-Schreib-Tool vergibst. Es erlaubt echte Operationen innerhalb seiner Zugriffsregeln. Der Connector-Broker bietet Agenten nur Leseaktionen; direkte GitHub-Werkzeuge und ausdrücklich vergebene Secrets haben eigene Zugangswege. Mit **Aufgabenpriorität und Agentenzuweisung ändern** darf ein Projekt-Agent bestehende Aufgaben priorisieren, einem Agenten desselben Projekts zuweisen oder die Zuweisung aufheben, ohne Arbeit zu starten. Diese Freigabe ist zunächst ausgeschaltet und steht Agent-Nodes in Automatisierungen nicht zur Verfügung. Der Agent muss die Aufgabe zuerst lesen und bei einer Änderung die gelesenen Werte mitgeben. Hat jemand diese Werte inzwischen geändert, wird die gesamte Anfrage abgelehnt; der Agent muss erneut lesen. Ein Wechsel der Zuständigkeit ist nur bei offenen Aufgaben ohne laufende Ausführung, ausstehende Prüfung oder offene Frage möglich. Eine reine Prioritätsänderung lässt diese Übergaben bestehen. Das Tool ändert weder Status noch Prüfer, beantwortet keine Frage an einen Menschen und startet keinen Lauf. Es steht nur einem aktiven Lauf mit projektweiten Rechten zur Verfügung, nicht einem Lauf, den ein Mitglied gestartet hat. **Aufgabenergebnisse anderer Agenten prüfen** erlaubt einem benannten Reviewer, über ein abgeschlossenes Ergebnis eines anderen Projektagenten zu entscheiden. Die Berechtigung ist anfangs ausgeschaltet und steht Agent-Nodes in Automatisierungen nicht zur Verfügung. Einen Agenten als Reviewer auszuwählen, erteilt weder diese Berechtigung noch startet es einen Lauf. Er prüft von seiner eigenen Aufgabe aus, mit aktuellen projektweiten Rechten und weiterhin erteilter Review-Berechtigung. Die Entscheidung hält Rückmeldung und Belege fest: Eine Freigabe schließt die geprüfte Aufgabe ab, eine Änderungsanforderung stellt sie ohne neuen Lauf auf **Zu erledigen**. Erforderliche menschliche Kompetenzen und Workflow-Genehmigungen bleiben geschützt. [Einen unabhängigen Reviewer einrichten](/de/platform/projects/task-automation#agent-review) beschreibt den Ablauf. -Mit **Andere Agenten auf Aufgaben starten** kann der Agent einen anderen Agenten dieses Projekts an die Arbeit schicken, etwa als Manager-Agent, der startbereite Arbeit verteilt und einen Agenten weiterarbeiten lässt, nachdem er dessen Frage beantwortet hat. Er nennt dazu eine Aufgabe, optional den Agenten, dem sie zugewiesen werden soll, und eine Nachricht, auf die der gestartete Lauf als Erstes eingeht. Der gestartete Lauf arbeitet im selben Auftrag wie der Lauf des Managers und nennt den Manager als den Agenten, der ihn gestartet hat. Ein so gestarteter Agent kann keine weiteren Agenten starten, ein Lauf, den ein Mitglied gestartet hat, kann gar keine starten, und weder ein Agent, der schon an einer anderen Aufgabe arbeitet, noch eine Aufgabe, die von einer offenen Aufgabe blockiert wird, wird gestartet. Vergib dieses Tool nur an einen Agenten, dessen Anweisungen festlegen, welche Arbeit er verteilen darf. Was ein solcher Lauf darf, beschreibt die [Aufgaben-Automatisierung](/de/platform/projects/task-automation#arbeit-die-eine-automatisierung-oder-ein-anderer-agent-startet). +Mit **Andere Agenten auf Aufgaben starten** kann der Agent einen anderen Agenten dieses Projekts an die Arbeit schicken, etwa als Manager-Agent, der startbereite Arbeit verteilt und einen Agenten weiterarbeiten lässt, nachdem er dessen Frage beantwortet hat. Er nennt dazu eine Aufgabe, optional den Agenten, dem sie zugewiesen werden soll, und eine Nachricht, auf die der gestartete Lauf als Erstes eingeht. Der gestartete Lauf arbeitet im selben Auftrag wie der Lauf des Managers und nennt den Manager als den Agenten, der ihn gestartet hat. Ein so gestarteter Agent kann keine weiteren Agenten starten, ein Lauf, den ein Mitglied gestartet hat, kann gar keine starten, ein Manager kann sich nicht selbst auf einer anderen Aufgabe starten, und eine Aufgabe, die von einer offenen Aufgabe blockiert wird, startet nicht. Ein Agent, der schon an anderen Aufgaben arbeitet, wird trotzdem gestartet: Sein Lauf bekommt einen eigenen [Worker](#run-one-agent-on-several-tasks) oder wartet auf einen, und die Antwort sagt, warum er wartet. Vergib dieses Tool nur an einen Agenten, dessen Anweisungen festlegen, welche Arbeit er verteilen darf. Was ein solcher Lauf darf, beschreibt die [Aufgaben-Automatisierung](/de/platform/projects/task-automation#arbeit-die-eine-automatisierung-oder-ein-anderer-agent-startet). + +Mit **Wissenseinträge hinzufügen und bearbeiten** kann der Agent Informationen als [Wissenseinträge](/de/platform/knowledge/knowledge-entries#einen-agenten-informationen-aktuell-halten-lassen) der ganzen Organisation speichern, einen pro Thema. Um einen Eintrag zu ändern, muss er die Version nennen, die er gelesen hat; hat sich der Eintrag inzwischen geändert, wird nichts gespeichert und der Agent führt seine Änderung im aktuellen Text zusammen. Einträge löschen kann er nicht, und ein Lauf, den ein Mitglied gestartet hat, kann keine speichern. Vergib das Tool an einen Agenten, dessen Anweisungen festlegen, welche Informationen sich zu behalten lohnen. Die Connector-Aufrufe eines Laufs erfolgen im Namen des Mitglieds, das ihn gestartet hat, ob mit **Agent starten**, mit **Erneut ausführen**, durch Verschieben nach **In Bearbeitung** oder durch eine Erwähnung des Agenten mit @. Sie nutzen die [Connector-Zugangsdaten](/de/platform/admin/connectors) der Organisation und werden diesem Mitglied zugeordnet. Verlässt es die Organisation oder wird es deaktiviert, lehnt Tale die Aufrufe ab. Beende den Lauf dann mit **Lauf abbrechen** (oder lass ihn zu Ende laufen) und starte ihn selbst neu, damit er in deinem Namen arbeitet. Startet ein Kommentar den Lauf neu, um ihn zu lenken, wie bei allen Laufzeiten außer Claude Code, erfolgen die Aufrufe ab dann im Namen der Person, die den Kommentar geschrieben hat. @@ -81,6 +87,14 @@ Der Bericht erscheint als Aufgabenkommentar; gesammelte Dateien werden als Ergeb Die [Aufgaben-Automatisierung](/de/platform/projects/task-automation) erklärt Fortschritt, Stoppen und Prüfung. Der gewöhnliche Chat-Assistent bleibt davon getrennt, auch mit Projektkontext. +## Einen Agenten an mehreren Aufgaben arbeiten lassen {#run-one-agent-on-several-tasks} + +Ein Agent ist eine Konfiguration, ein Worker eine laufende Kopie davon. Jede Aufgabe, an der der Agent gleichzeitig arbeitet, läuft in einem eigenen Worker: einer Sandbox mit eigenem Arbeitsbereich, Arbeitsspeicher und eigenen Prozessen. Zwei Aufgaben teilen sich also nie Dateien und bremsen sich nicht gegenseitig aus. Startest du den Agenten Scribe für „Versionshinweise“ und für „Änderungsprotokoll“, arbeiten beide gleichzeitig, jede in ihrem Worker. + +Worker werden auf das Limit **Agenten-Worker** deiner Organisation unter [Sandboxes](/de/platform/admin/sandboxes#das-relevante-limit-erkennen) angerechnet, das sich alle Agenten der Organisation teilen. Sind alle belegt, wartet ein neuer Lauf, statt zu scheitern, und die Aufgabe zeigt unter **Lauf**, warum: **Wartet auf einen Worker**. Er startet von selbst, sobald ein Worker frei ist, ohne eine automatische Wiederholung zu verbrauchen, und hat ab dann seine volle Arbeitszeit. Inhaber und Admins sehen dort einen Link, um das Limit zu erhöhen. Warten mehrere Läufe, geht ein frei gewordener Worker zuerst an den Agenten mit den wenigsten laufenden Läufen und dann an den Lauf, der am längsten wartet. Einen wartenden Lauf nimmst du mit **Lauf abbrechen** zurück oder indem du die Aufgabe jemand anderem zuweist: Ein Lauf, der noch nicht begonnen hat, wird mit der Neuzuweisung abgebrochen. + +Der nächste Lauf einer Aufgabe kehrt zu dem Worker zurück, in dem sie zuletzt bearbeitet wurde, wenn dieser frei ist. Der Agent setzt dort das Gespräch fort und findet seine Dateien. Ist der Worker belegt, nimmt der Lauf einen anderen und beginnt neu, mit Beschreibung, Diskussion, Anhängen und Ergebnissen der Aufgabe. Schlägt ein Lauf fehl oder wird er abgebrochen, bleibt sein Worker 15 Minuten lang für diese Aufgabe reserviert, damit eine Wiederholung findet, was der Lauf hinterlassen hat; der Lauf einer anderen Aufgabe nimmt ihn nur, wenn kein anderer Worker frei ist. + ## Der Standard-Agent {#standard-agent} Auch ein Projekt ohne eigene Agenten kann Arbeit an einen Agenten übergeben. Sofern ein Admin ihn unter [Richtlinien > Modelle](/de/platform/admin/governance/content-models#standard-agent) nicht ausgeschaltet hat, bietet **Zuständig** dort die Option **Standard-Agent** an, und zwar allen, die die Aufgabe zuweisen können, auch Mitgliedern. Wählt jemand sie zum ersten Mal, richtet Tale den Agenten im Projekt ein und weist ihm die Aufgabe zu. Danach startest du ihn wie jeden anderen Agenten oder erwähnst ihn in einem Kommentar. Kann er für dich nicht starten, sagt das Kommentarfeld es dir, und dein Kommentar wird als einfache Erwähnung gespeichert. @@ -97,6 +111,6 @@ Um dem Projekt einen eigenen Agenten zu geben, wähle **Neuer Agent**. Ab dann b ## Einen Agenten ändern oder entfernen -Bearbeite oder lösche den Agenten über sein Zeilenmenü. Der Standard-Agent hat nur **Agent löschen**. Änderungen gelten für spätere Läufe; ein aktiver Lauf behält seine Startkonfiguration. Die Löschung entfernt Agentenzuweisungen von Aufgaben, erhält aber deren Verlauf. Sie löscht außerdem die [Sandbox-Arbeitsbereiche](/de/platform/admin/sandboxes#explain-why-a-workspace-disappeared) des Agenten samt Dateien, auch die der Mitglieder. Prüfe laufende Arbeit und sichere benötigte Ergebnisse, bevor du den zugehörigen Agenten entfernst. +Bearbeite oder lösche den Agenten über sein Zeilenmenü. Der Standard-Agent hat nur **Agent löschen**. Änderungen gelten für spätere Läufe; ein aktiver Lauf behält seine Startkonfiguration. Die Löschung entfernt Agentenzuweisungen von Aufgaben, erhält aber deren Verlauf. Sie löscht außerdem die [Arbeitsbereiche aller seiner Worker](/de/platform/admin/sandboxes#explain-why-a-workspace-disappeared) samt Dateien, auch die der Mitglieder. Prüfe laufende Arbeit und sichere benötigte Ergebnisse, bevor du den Agenten entfernst. Scheitert das Erstellen, lies die Begründung: Ein doppelter Name, fehlender Projektzugriff, ein nicht verfügbares Modell und unsichtbare Skills sind unterschiedliche Ursachen. Ein Lauf, der endgültig scheitert, sagt oben in seiner Aufgabe, was schiefging und wer es beheben kann; [Wenn der Agent nicht fertig wird](/de/platform/projects/task-automation#wenn-der-agent-nicht-fertig-wird) zählt die Fälle auf. Neue Anweisungen beheben diese Voraussetzungen nicht. diff --git a/docs/de/platform/projects/task-automation.md b/docs/de/platform/projects/task-automation.md index 3a55e543dd..5e60ab77d8 100644 --- a/docs/de/platform/projects/task-automation.md +++ b/docs/de/platform/projects/task-automation.md @@ -53,7 +53,7 @@ Für eine gespeicherte Änderungsanforderung ruft der Manager `task_start_agent` Die Überarbeitung startet nur, solange die Aufgabe **Zu erledigen** ist, demselben Agenten gehört und derselbe abgeschlossene Umsetzungslauf der neueste ist. Eine neuere Prüfung oder eine zwischenzeitliche Änderung an Status, Zuständigkeit oder Archivierung verhindert den Start. Das gilt auch, wenn jemand anschließend den alten Wert wiederherstellt. Bei `stale_repair` ändert sich nichts: Der Manager liest die Aufgabe erneut und verwirft den überholten Auftrag. Er versucht es nie ohne die gekennzeichnete Absicherung. Die Überarbeitung durchläuft den normalen Ablauf und legt nach Abschluss eine neue Prüfung an; `moveToInProgress: false` wird abgelehnt. -Geht die Antwort verloren, darf derselbe Manager-Agent den abgesicherten Aufruf aus einem aktuell berechtigten aktiven Lauf wiederholen, auch bei einer späteren Ausführung. `replayed: true` liefert die ursprüngliche `runId` und `repairReceipt`, behält den ersten auslösenden Lauf bei und startet keine weitere Arbeit. Der Beleg bestätigt einen früheren Start, nicht einen weiterhin aktiven Lauf. Delegationsberechtigung und Projektzugriff werden bei jedem Aufruf erneut geprüft. Für neue Starts gelten weiterhin die Grenzen für gleichzeitig aktive Läufe, beschäftigte Agenten und drei automatisierte Starts je Aufgabe innerhalb einer Stunde. Wiederholte unveränderte Fehler brauchen eine eigene Untersuchungsaufgabe statt unbegrenzter Wiederholungen. +Geht die Antwort verloren, darf derselbe Manager-Agent den abgesicherten Aufruf aus einem aktuell berechtigten aktiven Lauf wiederholen, auch bei einer späteren Ausführung. `replayed: true` liefert die ursprüngliche `runId` und `repairReceipt`, behält den ersten auslösenden Lauf bei und startet keine weitere Arbeit. Der Beleg bestätigt einen früheren Start, nicht einen weiterhin aktiven Lauf. Delegationsberechtigung und Projektzugriff werden bei jedem Aufruf erneut geprüft. Für neue Starts gelten weiterhin die Grenzen für gleichzeitig aktive Läufe und drei automatisierte Starts je Aufgabe innerhalb einer Stunde. Wiederholte unveränderte Fehler brauchen eine eigene Untersuchungsaufgabe statt unbegrenzter Wiederholungen. Um eine verlorene Entscheidungsantwort in einer späteren Prüferausführung abzugleichen, liest der Agent `task_get.reviewDecision`. Das Feld enthält den neuesten gültigen nativen Entscheidungsbeleg. Bei einer neueren offenen, menschlichen oder Workflow-Prüfung sowie bei einem nicht verfügbaren Beleg ist es `null`. Vergleiche die Prüfungs- und Lauf-IDs mit dem gespeicherten Auftrag und lies den aktuellen Aufgabenstatus separat. Ein früherer Beleg beschreibt nicht die heutige Spalte; `null` beweist nicht, dass eine Entscheidung ungespeichert blieb. Ein sofortiger identischer `task_review`-Aufruf zur Wiederholung braucht weiterhin denselben aktiven auslösenden Lauf. @@ -122,18 +122,20 @@ Fragen einer Automatisierung und Workflow-Genehmigungen bleiben Sache von Person | Zustand oder Problem | Maßnahme | | --- | --- | -| Warten auf einen Sandbox-Platz | Die Kapazität der Organisation oder der gemeinsam genutzten Infrastruktur kann ausgeschöpft sein, oder im Arbeitsbereich des Agenten laufen bereits vier seiner Läufe gleichzeitig; der Lauf startet dann, sobald einer davon endet. Das Warten verbraucht keine automatische Wiederholung. Warte auf einen Platz oder bitte einen Admin, [Sandboxes](/de/platform/admin/sandboxes) zu prüfen. | +| **Wartet auf einen Worker**, **Wartet auf freien Platz**, **Wartet auf einen Arbeitsbereich**, **Wartet auf seine Sandbox** | Der Lauf wartet auf Platz und zeigt unter **Lauf**, warum: Alle [Agenten-Worker](/de/platform/projects/project-agents#run-one-agent-on-several-tasks) deiner Organisation sind belegt, die Bereitstellung ist voll oder hat zu wenig Arbeitsspeicher oder Speicherplatz, ein Admin löscht den Arbeitsbereich, den der Lauf nutzen würde, oder seine Sandbox beendet noch einen früheren Prozess. Er startet von selbst, sobald Platz frei wird, und das Warten verbraucht keine automatische Wiederholung. Sind alle Agenten-Worker belegt, können Inhaber und Admins das Limit unter [Sandboxes](/de/platform/admin/sandboxes#das-relevante-limit-erkennen) erhöhen. Mit **Lauf abbrechen** nimmst du einen wartenden Lauf zurück. | | Automatischer Wiederholungsversuch | Tale wiederholt einen behebbaren Fehler. Beobachte die Versuchszahl und starte keinen zusätzlichen Lauf. | | **Der Agent konnte diese Aufgabe nicht fertigstellen** | Es folgt keine automatische Wiederholung. Der Hinweis sagt, was schiefging und wer es beheben kann, und **Details** neben dem Lauf zeigt, was der Lauf selbst gemeldet hat; [Wenn der Agent nicht fertig wird](#wenn-der-agent-nicht-fertig-wird) zählt die Fälle auf. Behebe die Ursache und nutze dann **Erneut ausführen**, um das Gespräch fortzusetzen. | -| Neuzuweisung wird verweigert | Brich den aktiven Lauf ab, bevor du neu zuweist. | +| Neuzuweisung wird verweigert | Brich den aktiven Lauf ab, bevor du neu zuweist. Ein Lauf, der noch auf Platz wartet, verhindert keine Neuzuweisung: Er wird mit ihr abgebrochen. | | Agenten oder Automatisierungen starten eine Aufgabe immer wieder neu | Eine Aufgabe nimmt innerhalb einer Stunde höchstens drei Starts ihres Agenten durch Automatisierungen und andere Agenten an, gewöhnliche automatische Wiederholungen eingerechnet; die unten beschriebene Ausnahme für die Broker-Wartezeit gilt auch hier. Der nächste Start wird abgelehnt, eine Wiederholung über die Grenze hinaus startet nicht, und die Zeitleiste zeigt **Ausführung abgelehnt: Agenten-Läufe sind auf dieser Aufgabe pausiert**. Starts durch Personen und deren Wiederholungen zählen nie mit. Für Automatisierungsläufe gibt es keine solche Obergrenze: Erwähnen zwei Automatisierungen einander immer wieder, stoppt allein die Ein-Engine-Regel die Schleife. Brich den aktiven Lauf ab und lies die Zeitleiste, bevor eine von beiden wieder starten darf. | -| **Ausführung abgelehnt: Agent arbeitet an einer anderen Aufgabe** | Eine automatische Wiederholung hat zwei Stunden auf ihren Agenten gewartet, der noch an einer anderen Aufgabe arbeitet. Hinter der Ablehnung wartet nichts: Starte die Aufgabe erneut, sobald der Agent frei ist, oder überlass das dem Manager-Agenten oder der Automatisierung, die die Arbeit verteilt. | +| **Ausführung abgelehnt: Agent arbeitet an einer anderen Aufgabe** | Erscheint nur bei Läufen aus der Zeit, bevor Agenten eigene Worker hatten: Eine automatische Wiederholung hat zwei Stunden auf ihren Agenten gewartet und dann aufgegeben. Starte die Aufgabe erneut; ihr Lauf bekommt jetzt einen eigenen Worker. | | Die Aufgabe lässt sich nicht abschließen | Schließe zuerst ihre offenen Teilaufgaben ab. | Bei behebbaren Fehlern folgen bis zu drei automatische Wiederholungsversuche, die bis auf die unten beschriebenen Fälle sofort starten. Ein Lauf, der mindestens fünfzehn Minuten Fortschritt macht, erhält ein neues Versuchskontingent. So kann lange Arbeit Unterbrechungen überstehen. Die Richtigkeit des Ergebnisses musst du trotzdem prüfen. Beendet Codex einen Lauf, weil das gewählte Modell ausgelastet ist, plant Tale die automatische Wiederholung eine Minute später. Der fehlgeschlagene Versuch zählt weiterhin für die normale Wiederholungsgrenze und bei automatisierten Starts für die stündliche Grenze. Tale lässt das bisherige Konto weiter zur Auswahl zu, wechselt kein Modell und pausiert keine anderen Agenten. Die Wartezeit garantiert nicht, dass das Modell danach verfügbar ist. Verweigert eine dieser Grenzen weitere Arbeit, kann die Aufgabe mit einem fehlgeschlagenen Lauf unter **In Bearbeitung** bleiben. Die Spalte allein bedeutet nicht, dass noch ein Agent arbeitet. +Reagiert ein Agent nicht mehr, gibt er also standardmäßig 45 Minuten lang nichts aus und arbeitet kaum, stoppt seine Sandbox ihn. Der Lauf schlägt dann ohne automatische Wiederholung fehl, weil eine Wiederholung höchstwahrscheinlich genauso stehen bliebe. Der Hinweis sagt, dass der Agent nicht mehr reagiert hat, und **Details** zeigt, was er zuletzt ausgegeben hat. + Eine automatische Wiederholung setzt die Arbeit der Person fort, die den Lauf gestartet hat. Sie startet deshalb nur dort, wo diese Person den Lauf jetzt selbst starten könnte: Das Projekt muss noch aktiv sein, und sie muss die Aufgabe weiterhin ändern dürfen. Archiviert ein Admin das Projekt, verlässt die Person die Organisation oder darf sie die Aufgabe nicht mehr ändern, startet keine weitere Wiederholung, und der Lauf bleibt fehlgeschlagen. Das gilt auch für eine Erwähnung, die den Agenten erst nach dem Ende seines Laufs erreicht. Sobald das Projekt wiederhergestellt ist, kann jeder, der die Aufgabe ändern darf, **Erneut ausführen** nutzen. Bevor ein neuer Lauf mit der Arbeit beginnt, kann sich eine kurze Verbindungsstörung zum Abo-Broker innerhalb desselben Laufs beheben. Hat der Lauf die vollen Berechtigungen des Agenten, sendet Tale höchstens drei GET-Anfragen mit mindestens fünf und danach zehn Sekunden Abstand. Für die Anfragen und die Annahme des Ergebnisses gilt ein gemeinsames Budget von 60 Sekunden. Innerhalb dieses Abrufs hält Tale die vom Broker verlangte Wartezeit ein oder bricht ab, wenn sie nicht mehr ins Budget passt. Diese Wartezeit wird nicht auf einen späteren Lauf übertragen; die Regeln für Wiederholungen und stündliche Starts gelten weiterhin. Datenbank- und DNS-Prüfungen sowie das Schließen der Verbindung können die abschließende Ablehnung verzögern. Diese Anfragen zählen weder als zusätzlicher Aufgabenstart noch als automatische Wiederholung. Vor einer weiteren Anfrage und vor der Rückgabe eines Tokens prüft Tale den Lauf und den Zugang erneut. Für eingeschränkte Läufe von Mitgliedern, POST-Broker, abgelehnte Zugänge und pausierende Broker-Konten ändert sich nichts. @@ -152,8 +154,9 @@ Scheitert ein Lauf und wiederholt ihn nichts mehr, weil die automatischen Wieder | Dem Agenten fehlt etwas, das er braucht: sein Modell, einer seiner Skills oder der Agent selbst | Ein Redakteur oder Admin behebt das im Tab **Agenten** des Projekts. | | Ein Anhang dieser Aufgabe ist nicht mehr im Speicher | Wer die Aufgabe ändern darf, entfernt den Anhang oder lädt ihn erneut hoch; **Details** neben dem Lauf nennt die Datei. Starte den Agenten danach erneut. | | Der Lauf hat sein Zeitlimit erreicht | Starte den Agenten erneut oder teile die Aufgabe in kleinere auf. | -| Der Lauf hat zu lange auf eine freie Sandbox gewartet | Starte den Agenten erneut, wenn weniger Agenten beschäftigt sind. | +| Der Lauf hat zu lange auf einen freien Worker gewartet | Starte den Agenten erneut, wenn weniger Agenten beschäftigt sind, oder bitte einen Inhaber oder Admin, **Agenten-Worker** zu erhöhen. | | Das KI-Modell ist ausgefallen, oder der Lauf konnte nicht starten oder wurde unterbrochen | Starte den Agenten erneut. Scheitert er wieder, zeig einem Admin, was der Lauf unter **Details** gemeldet hat. | +| Der Agent hat nicht mehr reagiert | Starte den Agenten erneut. Bleibt er wieder stehen, zeig einem Admin, was der Lauf unter **Details** gemeldet hat: Dort steht, was der Agent zuletzt ausgegeben hat. | Tale benachrichtigt außerdem die Person, die den Lauf gestartet hat, und alle, die die Aufgabe verfolgen: mit der Benachrichtigung **Agenten-Lauf fehlgeschlagen** und, wenn die Organisation ein verbundenes Postfach hat, per E-Mail. Benachrichtigt wird nur, wer das Projekt noch öffnen kann. Startet ein neuer Lauf auf der Aufgabe, gilt die ungelesene Benachrichtigung als gelesen. Unter **Einstellungen > Benachrichtigungen** schaltest du diese Hinweise mit **Agenten-Eskalationen** ab. @@ -161,7 +164,7 @@ Tale benachrichtigt außerdem die Person, die den Lauf gestartet hat, und alle, Ein Projektagent kann auch an die Arbeit gehen, ohne dass jemand auf **Agent starten** klickt: durch eine [geplante Automatisierung](/de/platform/automations/triggers#einen-projektagenten-nach-zeitplan-starten) oder durch einen anderen Agenten des Projekts, der das Tool **Andere Agenten auf Aufgaben starten** hat, etwa einen Manager-Agenten, der startbereite Arbeit verteilt und Fragen beantwortet. Die Zeitleiste führt einen solchen Lauf als **Automatisierung**, für Inhaber, Admins und Entwickler mit einem Link zum Automatisierungslauf, oder als **delegiert**, gestartet von dem Agenten, der ihn angefordert hat. Der Agent erfährt, wer ihn gestartet hat. Eine mitgegebene Nachricht liest er als Nachricht dieser Automatisierung oder dieses Agenten, nie als Prüfung durch eine Person: Widerspricht sie der Beschreibung oder dem Kommentar einer Person, haben diese Vorrang. -Der Lauf arbeitet im selben Auftrag wie der Lauf, der ihn angefordert hat: im Auftrag der Person, die jenen gestartet hat, oder bei einer Kette, die ein Zeitplan begonnen hat, in niemandes Auftrag; ihre Kosten zählen dann als Automatisierungskosten. Diese Person oder der Zeitplan muss beim Start des Laufs im Projekt handeln dürfen: Verliert die Person die Rolle Redakteur, wird der Zeitplan pausiert oder die Automatisierung aus dem Projekt entfernt, unterbleibt der nächste Start. Ein Agent, den ein anderer Agent gestartet hat, kann keine weiteren Agenten starten, und ein Lauf, den ein Mitglied gestartet hat, kann gar keine starten. Ein solcher Start prüft außerdem, was eine Person übersehen könnte: Eine Aufgabe, die von einer offenen Aufgabe blockiert wird, startet nicht, und ein Agent, der schon an einer anderen Aufgabe arbeitet, wird nicht ein zweites Mal gestartet. Eine automatische Wiederholung eines solchen Laufs hält sich an dieselbe Regel: Solange ihr Agent im selben Arbeitsbereich an einer anderen Aufgabe arbeitet, wartet sie, prüft alle fünf Minuten erneut und startet, sobald der Agent frei ist, ohne einen Versuch zu verbrauchen. Jede Prüfung liest die Aufgabe neu: Wird sie aus **In Bearbeitung** verschoben oder neu zugewiesen, werden sie oder ihr Projekt archiviert oder verliert die Person ihre Rolle, endet das Warten. Ist der Agent zwei Stunden nach dem Fehler noch immer beschäftigt, startet die Wiederholung nicht, und die Zeitleiste zeigt **Ausführung abgelehnt: Agent arbeitet an einer anderen Aufgabe**. +Der Lauf arbeitet im selben Auftrag wie der Lauf, der ihn angefordert hat: im Auftrag der Person, die jenen gestartet hat, oder bei einer Kette, die ein Zeitplan begonnen hat, in niemandes Auftrag; ihre Kosten zählen dann als Automatisierungskosten. Diese Person oder der Zeitplan muss beim Start des Laufs im Projekt handeln dürfen: Verliert die Person die Rolle Redakteur, wird der Zeitplan pausiert oder die Automatisierung aus dem Projekt entfernt, unterbleibt der nächste Start. Ein Agent, den ein anderer Agent gestartet hat, kann keine weiteren Agenten starten, und ein Lauf, den ein Mitglied gestartet hat, kann gar keine starten. Ein solcher Start prüft außerdem, was eine Person übersehen könnte: Eine Aufgabe, die von einer offenen Aufgabe blockiert wird, startet nicht, und ein Agent kann sich nicht selbst auf einer anderen Aufgabe starten (`self_start`). Ein Agent, der schon an anderen Aufgaben arbeitet, wird trotzdem gestartet, in einem eigenen [Worker](/de/platform/projects/project-agents#run-one-agent-on-several-tasks). Sind alle Agenten-Worker deiner Organisation belegt, wartet der Lauf, startet von selbst, sobald einer frei wird, und der Start antwortet `started` mit dem Grund, warum er wartet (`waitingReason`); **Aufgabe lesen** zeigt dasselbe, solange der Lauf wartet. Eine automatische Wiederholung eines solchen Laufs startet sofort, egal was ihr Agent sonst gerade tut. Ein delegierter Lauf legt sein Ergebnis unter **In Prüfung** für den gespeicherten Reviewer ab. Wird die Arbeit an einer dort wartenden Aufgabe wieder aufgenommen, zieht das ihre offene Prüfanfrage zurück, ohne das Ergebnis anzunehmen. Ein Start, der die Karte stehen lässt (`moveToInProgress: false`), wird unter einer Karte, die auf ihre Prüfung wartet, und unter einer erledigten oder abgebrochenen Karte abgelehnt, damit frühere Arbeit nie zur Beurteilung steht, während darunter neue Arbeit läuft. Ein Manager, der die Frage eines Agenten beantwortet, setzt ihn fort und nennt dabei den fragenden Lauf und die Prüfung, auf die er wartet. Die Fortsetzung geschieht nur, solange das noch die offene Frage der Aufgabe ist. Wurde inzwischen entschieden (**Erledigt**, **Abgebrochen** oder eine andere Verschiebung), gibt es einen neueren Lauf oder eine neuere Prüfung oder wurde die Zuständigkeit geändert, antwortet der Agent mit `stale_question`; nichts wird zugewiesen, zurückgezogen, verschoben oder gestartet. Verlangt deine Organisation ein unabhängiges menschliches Review, darf die Person, in deren Auftrag der Lauf arbeitet, sein Ergebnis nicht annehmen. diff --git a/docs/de/platform/projects/tasks.md b/docs/de/platform/projects/tasks.md index eca339681e..69dbe44785 100644 --- a/docs/de/platform/projects/tasks.md +++ b/docs/de/platform/projects/tasks.md @@ -70,9 +70,9 @@ Für Automatisierungen gilt eine engere Regel, denn eine Automatisierung handelt Ein Lauf, den jemand ohne Bearbeitungsrecht für das Projekt startet, etwa ein Mitglied, bleibt bei seiner Aufgabe: - Seine Plattform-Tools ändern nur diese Aufgabe und die Teilaufgaben darunter: Der Agent legt neue Aufgaben nur als Teilaufgaben dieser Aufgabe an, verwendet nur Labels, die das Projekt schon hat, und kann keine Einträge aus anderen Systemen ins Projekt synchronisieren. -- Er kann keine Dokumente im Projekt speichern. Die Dateien, die er erzeugt, landen trotzdem unter **Ergebnisdateien** an der Aufgabe. +- Er kann keine Dokumente im Projekt speichern und keine Wissenseinträge schreiben. Die Dateien, die er erzeugt, landen trotzdem unter **Ergebnisdateien** an der Aufgabe. - Der Lauf erhält weder die **Secrets** des Agenten noch das Token eines zugeordneten GitHub-Zugangs. Der Agent erfährt, welche Zugangsdaten zurückgehalten wurden, und soll in seinem Bericht darauf hinweisen, wenn die Arbeit sie braucht; dann muss ein Redakteur oder eine höhere Rolle ihn starten. Die Connectors des Agenten funktionieren weiter und handeln im Namen der Person, die den Lauf gestartet hat. -- Er arbeitet in einem eigenen Arbeitsbereich, der für die Läufe dieser Person mit diesem Agenten bestehen bleibt: Dateien aus Läufen, die Redakteure gestartet haben, liegen dort nicht, und was dieser Lauf hinterlässt, erreicht jene Läufe nie. Spätere Läufe derselben Person mit dem Agenten finden ihn wieder, bis Tale ihn löscht: wenn die Person die Organisation verlässt, wenn der Agent gelöscht wird oder sobald ihn so viele Tage kein Lauf genutzt hat, wie die Organisation unter [**Tage ohne Nutzung**](/de/platform/admin/sandboxes#delete-unused-workspaces-automatically) festlegt. +- Er arbeitet in einem Worker, der für die Läufe dieser Person mit diesem Agenten bestehen bleibt, mit einem eigenen Arbeitsbereich: Dateien aus Läufen, die Redakteure gestartet haben, liegen dort nicht, und was dieser Lauf hinterlässt, erreicht jene Läufe nie. Die Person bekommt einen solchen Worker für jeden ihrer Läufe mit dem Agenten, die gleichzeitig arbeiten. Ihre späteren Läufe mit dem Agenten finden den Arbeitsbereich wieder, bis Tale ihn löscht: wenn die Person die Organisation verlässt, wenn der Agent gelöscht wird oder sobald ihn so viele Tage kein Lauf genutzt hat, wie die Organisation unter [**Tage ohne Nutzung**](/de/platform/admin/sandboxes#delete-unused-workspaces-automatically) festlegt. Der Lauf kann weiterhin die Aufgaben und das Wissen des Projekts lesen und behält diese Grenzen auch, wenn ein Redakteur ihn später lenkt. Ein Lauf, den ein Redakteur oder eine höhere Rolle startet, hat auf jeder Aufgabe die volle Ausstattung des Agenten. Der Kommentar eines Mitglieds kann das ändern: Startet die Laufzeit des Agenten neu, um den Kommentar aufzunehmen, wie es [alle Laufzeiten außer Claude Code](/de/platform/agents/harnesses) tun, zählt der Rest des Laufs als Lauf des Mitglieds, mit denselben Grenzen für seine Tools und Zugangsdaten. @@ -114,7 +114,7 @@ Das aktuelle Review erklärt auch eine unzulässige Selbstprüfung, eine geände ## Fortschritt mit dem Status zeigen -Ändere den **Status** in den Aufgabendetails oder ziehe die Karte auf dem **Board** in eine andere Spalte. Die Statusauswahl lässt sich auch mit der Tastatur bedienen. +Ändere den **Status** in den Aufgabendetails oder ziehe die Karte auf dem **Board** in eine andere Spalte. Die Statusauswahl lässt sich auch mit der Tastatur bedienen. **Erledigt** und **Abgebrochen** klappst du mit dem Symbol neben ihrem Namen zu einer schmalen Leiste ein, damit abgeschlossene Arbeit nicht im Weg ist: Die Leiste zeigt weiter die Anzahl der Spalte, klappt wieder auf, wenn du sie auswählst, und nimmt eine Karte an, die du darauf ziehst. Jedes Board merkt sich in diesem Browser, welche Spalten eingeklappt sind. | Status | Bedeutung | | --- | --- | @@ -135,15 +135,17 @@ Während die Quelle eine Anfrage prüft, zeigt die Aufgabe den ausstehenden Zust ## Entscheidungen an der Aufgabe festhalten -Öffne die Aufgabe, um Beschreibung, Anhänge, Termine, Labels, Teilaufgaben oder Kommentare zu ergänzen. Halte Fragen, Entscheidungen und Rückmeldungen in Kommentaren fest, die spätere Prüfer nachvollziehen können. +Öffne die Aufgabe, um Beschreibung, Anhänge, Termine, Labels, Teilaufgaben oder Kommentare zu ergänzen. Halte Fragen, Entscheidungen und Rückmeldungen in Kommentaren fest, die spätere Prüfer nachvollziehen können. Im Dialog des Boards und auf ihrer eigenen Seite liest sich eine Aufgabe gleich: zuerst der Auftrag, dann die Diskussion als ein Gespräch mit dem Verlauf der Aufgabe zwischen den Kommentaren und unten das Kommentarfeld. Auf einem größeren Bildschirm öffnet sie sich bei der neuesten Nachricht; scrolle nach oben, um den Auftrag zu sehen. Auf dem Smartphone scrollt der Dialog als eine Spalte vom Auftrag aus: das Gespräch, dann das Kommentarfeld, dann die Details. [Deine Aufgaben aus Start öffnen](#deine-aufgaben-aus-start-oeffnen) beschreibt jeden Teil. Mit `@` im Kommentarfeld öffnest du die Erwähnungsauswahl. Eine Erwähnung des zuständigen Agenten ist eine Anweisung: Sie kann einen laufenden Agenten steuern oder einen neuen Lauf auslösen, wenn er gerade nicht arbeitet. Ein Kommentar ohne Erwähnung hält die Diskussion fest, ohne diese Agentenaktion anzufordern. +Die Auswahl findet Personen und Agenten über ihren Namen oder ihr Handle; bei einem Agenten steht das Handle daneben, etwa `@my-opus-agent-3` für „My Opus Agent #3“. Das Feld und der gesendete Kommentar zeigen den Namen der Person oder des Agenten, den du erwähnst. Tale speichert, wen eine Erwähnung nennt, nicht die getippten Wörter: Nach einer Umbenennung zeigt sie den neuen Namen. Die **Rücktaste** direkt nach einem Namen entfernt die ganze Erwähnung; tippst du mitten in einen Namen, wird er zu normalem Text. Eine Erwähnung in Code bleibt Text und benachrichtigt niemanden. + Erwähnungen in der Beschreibung der Aufgabe wirken beim Speichern genauso: Die genannten Personen werden benachrichtigt, und ein genannter Agent wird gesteuert oder startet einen Lauf, wie oben beschrieben. Startet er einen Lauf, wechselt die Aufgabe nach **In Bearbeitung**, egal in welcher Spalte du sie angelegt hast. Bearbeitest du die Beschreibung später, zählen nur die Erwähnungen, die du hinzufügst. Formulierst du den Text um eine bestehende Erwähnung herum um, wird niemand erneut benachrichtigt. Der Agent liest die Beschreibung so, wie sie beim Start seines Laufs lautet. Änderst du sie, solange der Lauf noch wartet, arbeitet er also mit deiner neuen Fassung. Nutze **Teilaufgaben** für Ergebnisse, die sich einzeln prüfen lassen. Eine Teilaufgabe nennt oben in ihren Details die übergeordnete Aufgabe (**Teil von …**); klicke darauf, um zu ihr zurückzukehren. Solange noch eine Teilaufgabe offen ist, lässt sich die übergeordnete Aufgabe nicht nach **Erledigt** oder **Abgebrochen** verschieben. Alle anderen Status bleiben verfügbar, auch **Zu erledigen**. Unter **Abhängigkeiten** siehst du, welche Aufgaben diese Aufgabe blockieren und welche sie selbst blockiert. Kreisförmige Abhängigkeiten sind nicht zulässig. -Änderst du ein Feld, zeigt die **Aktivität** der Aufgabe seinen Wert davor und danach. Leerst du ein Feld, steht dort, was übrig bleibt, etwa **Kein Fälligkeitsdatum** oder **Nicht zugewiesen**, und nicht bloß der alte Wert. Titel, Beschreibungen, Labels und Dateinamen erscheinen genau so, wie sie geschrieben wurden, auch wenn der Text einem Statusnamen wie `done` entspricht. Status, Prioritäten, Datumsangaben und die Angaben für ein leeres Feld erscheinen in deiner Sprache. +Änderst du ein Feld, zeigt die Zeile, die das im Gespräch der Aufgabe hinterlässt, seinen Wert davor und danach. Leerst du ein Feld, steht dort, was übrig bleibt, etwa **Kein Fälligkeitsdatum** oder **Nicht zugewiesen**, und nicht bloß der alte Wert. Titel, Beschreibungen, Labels und Dateinamen erscheinen genau so, wie sie geschrieben wurden, auch wenn der Text einem Statusnamen wie `done` entspricht. Status, Prioritäten, Datumsangaben und die Angaben für ein leeres Feld erscheinen in deiner Sprache. ## Wiederkehrende Aufgaben einrichten @@ -210,12 +212,13 @@ Setze die Aufgabe auf **Erledigt**, sobald sie die Anforderung erfüllt. Soll ei ## Deine Aufgaben aus Start öffnen -[Start](/de/platform#home) listet die offenen Aufgaben, die dir zugewiesen sind oder auf dein Review warten, aus allen Projekten, die du lesen darfst; **Aufgaben** über der Liste zeigt nur sie. Öffnest du dort eine Aufgabe, erscheint sie als eigene Seite neben der Seitenleiste von **Start** und nicht im Dialog des Boards: +[Start](/de/platform#home) listet die offenen Aufgaben, die dir zugewiesen sind oder auf dein Review warten, aus allen Projekten, die du lesen darfst; **Aufgaben** über der Liste zeigt nur sie. Öffnest du dort eine Aufgabe, erscheint sie als eigene Seite neben der Seitenleiste von **Start**, aufgebaut wie der Dialog des Boards: - Oben steht der Auftrag als Karte: Beschreibung, Anhänge und Teilaufgaben. -- Darunter folgt die Diskussion wie ein Gespräch, mit den ältesten Einträgen zuerst und nach Tagen gegliedert. Sie verbindet die Kommentare mit dem Verlauf der Aufgabe, etwa Statuswechseln, Zuweisungen und Agentenläufen. +- Darunter folgt die Diskussion wie ein Gespräch, mit den ältesten Einträgen zuerst und nach Tagen gegliedert; das Datum bleibt oben stehen, während du durch seinen Tag scrollst. Deine eigenen Kommentare stehen rechts, wie in einem Chat. Die der anderen, Personen und Agenten, stehen links unter ihrem Namen, bei einem Agenten mit dem Hinweis **Agent**, und mit der Uhrzeit. Von einem langen Kommentar, etwa dem Bericht eines Agenten, siehst du den Anfang; **Weiterlesen** öffnet den Rest an Ort und Stelle, **Weniger anzeigen** klappt ihn wieder zu. +- Der Verlauf der Aufgabe steht als kurze Zeilen zwischen den Kommentaren, etwa Statuswechsel, Zuweisungen und Agentenläufe. Drei oder mehr hintereinander werden zu einer Zeile zusammengefasst, etwa **5 Änderungen**, mit den Namen derer, die sie gemacht haben; wähle sie aus, um jede einzeln zu sehen. - Das Kommentarfeld steht ganz unten. Zum Senden drückst du **⌘+Enter** oder **Ctrl+Enter** oder klickst auf die runde Senden-Schaltfläche; **Enter** allein beginnt eine neue Zeile. Mit `@` erwähnst du einen Agenten oder eine Person, mit derselben Wirkung wie im Dialog des Boards. Was du noch nicht gesendet hast, bleibt für diese Aufgabe im Feld stehen, hier wie im Dialog des Boards. Solange du woanders arbeitest, zeigt die Zeile der Aufgabe in **Start** den Hinweis **Entwurf**. -- **Details** neben der Diskussion enthält Status, Priorität, Zuständigkeit, Reviewer, Termine, Wiederholung, Labels und Abhängigkeiten, dazu **Verfolgen** und **Archivieren**. Inhaber und Administratoren der Organisation finden dort zusätzlich **Löschen**: Es entfernt die Aufgabe samt Teilaufgaben, Kommentaren und Dateien endgültig und stoppt ihre laufenden Agentenläufe. **Details ausblenden** am Ende der Kopfzeile blendet diesen Bereich aus, **Details einblenden** holt ihn zurück. Ist das Fenster zu schmal für beides nebeneinander, öffnet **Details einblenden** die Details stattdessen in einem Fenster über der Diskussion — von der Seite oder, auf dem Smartphone, vom unteren Bildschirmrand. +- **Details** neben der Diskussion enthält Status, Priorität, Zuständigkeit, Reviewer, Termine, Wiederholung, Labels und Abhängigkeiten, dazu **Verfolgen** und **Archivieren**. Haben die Agentenläufe der Aufgabe etwas gekostet, zeigt **Agentenkosten** dort ihre Summe. Inhaber und Administratoren der Organisation finden dort zusätzlich **Löschen**: Es entfernt die Aufgabe samt Teilaufgaben, Kommentaren und Dateien endgültig und stoppt ihre laufenden Agentenläufe. **Details ausblenden** am Ende der Kopfzeile blendet diesen Bereich aus, **Details einblenden** holt ihn zurück. Ist das Fenster zu schmal für beides nebeneinander, öffnet **Details einblenden** die Details stattdessen in einem Fenster über der Diskussion — von der Seite oder, auf dem Smartphone, vom unteren Bildschirmrand. **Board** in der Kopfzeile öffnet das Aufgaben-Board des Projekts. Öffnest du eine Aufgabe dort, erscheint sie weiterhin im Dialog des Boards, mit derselben Titelzeile; beide Ansichten bearbeiten dieselbe Aufgabe. **Als Seite öffnen**, das Vergrößern-Symbol neben **Schließen** im Dialog, öffnet die Aufgabe hier auf ihrer eigenen Seite, und **Zurück** im Browser führt zum Board mit offenem Dialog. Eine Beschreibung, die du gerade bearbeitest, wird nicht übernommen; speichere sie vorher. **Link kopieren** im Dialog kopiert denselben Seitenlink. **Link kopieren**, das Link-Symbol neben **Board**, kopiert den Link zu dieser Aufgabenseite. Die Kennung der Aufgabe, etwa `WEB-2`, kopierst du mit einem Klick darauf in der Zeile unter dem Titel. Eine kurze Meldung bestätigt jede Kopie. diff --git a/docs/de/self-hosted/configuration/environment-reference.md b/docs/de/self-hosted/configuration/environment-reference.md index e34a77d281..bc0187c942 100644 --- a/docs/de/self-hosted/configuration/environment-reference.md +++ b/docs/de/self-hosted/configuration/environment-reference.md @@ -66,6 +66,7 @@ Tale verwendet `tale_app` für Anwendungsdaten und `tale_knowledge` für Textabs | `DB_PASSWORD` | `tale_password_change_me` | **Für das mitgelieferte Postgres erforderlich.** Gemeinsames Passwort der Anwendungs- und Wissensdatenbank im Standardaufbau. Ersetze den Beispielwert vor dem Produktivbetrieb. | | `DATABASE_URL` | aus `DB_PASSWORD` konstruiert | **Optional.** Verbindungs-URL der operativen Datenbank. Setz sie, um das Backend auf einen Postgres zu richten, den du selbst betreibst: er braucht keine Extensions und keinen Superuser, nur eine Datenbank und eine Rolle, die Schemata anlegen darf. Wird bei jedem Start gelesen. | | `DATABASE_POOL_MAX` | `10` | **Optional.** Maximale Verbindungen je Pool der operativen Datenbank. Jede Replik von `backend-api` oder `backend-worker` benötigt normalerweise bis zum Doppelten dieses Werts (App-Pool plus Job-Queue). Sandbox-Aktionen können vorübergehend je belegtem App-Pool-Platz eine weitere Verbindung öffnen: In der Spitze ist es das Dreifache je Replik. Rechne diese Spitze gegen `max_connections` der Datenbank. | +| `AUTH_DATABASE_POOL_MAX` | `5` | **Optional.** Verbindungen im Pool, über den jede Replik von `backend-api` Anmeldesitzungen auflöst; jede authentifizierte Anfrage liest darüber. Erhöhe den Wert für Repliken, die Tausende Anfragen pro Sekunde bedienen, und rechne ihn je Replik neben `DATABASE_POOL_MAX` gegen `max_connections` der Datenbank. | | `POSTGRES_CA_FILE` | nicht gesetzt | **Optional.** Pfad zu einem PEM-Bundle, dem **jede** Postgres-Verbindung vertraut: operative Datenbank, Wissens-Korpus und die Datenbanken, die Organisationen selbst mitbringen. Nötig, sobald eine URL `sslmode=verify-ca` oder `verify-full` gegen einen Anbieter verlangt, dessen Root Node nicht mitliefert — Amazon RDS ist der übliche Fall. Nutzen mehrere Datenbanken verschiedene Anbieter, häng ihre Roots in einer Datei aneinander. | | `KNOWLEDGE_DATABASE_URL` | `postgresql://tale:${DB_PASSWORD}@knowledge-db:5432/tale_knowledge` | Verbindungs-URL des Standard-Wissenskorpus. Eine andere URL wählt eine andere Datenbank; vorhandene Textabschnitte und Vektoren werden nicht übertragen. | | `KNOWLEDGE_DB_POOL_MAX` | `10` | **Optional.** Verbindungen, die ein Backend-Prozess zum Wissenskorpus öffnet. Jeder Indexierungsjob belegt eine, während er einen Block Textabschnitte festschreibt — erlaubt `WORKER_CONCURRENCY` mehr gleichzeitige Jobs als das, warten sie auf den Pool; erhöhe beide zusammen. Wie `DATABASE_POOL_MAX` zählt der Wert je Replik gegen `max_connections` der Korpus-Datenbank. | @@ -225,6 +226,7 @@ Diese Werte prägen die Anwendungsrollen eines Workspace-Deployments: die Replik | `AGENT_START_SLOTS` | `WORKER_CONCURRENCY`, mindestens `8` | Agent-Turn-Starts, die ein `backend-worker`-Replikat gleichzeitig ausführt, jeweils für Aufgabenläufe und für Automations-Schritte. Ein Start belegt seinen Platz während der Sandbox-Erstellung und des ersten 90-Sekunden-Fensters des Turns. Bereich `1`–`256`. | | `AGENT_DRIVE_SLOTS` | `WORKER_CONCURRENCY`, mindestens `16` | Abarbeitungsfenster laufender Agent-Turns, die ein `backend-worker`-Replikat je Bereich gleichzeitig ausführt. Ein Replikat hält etwa das 2,5-Fache an laufenden Turns je Bereich abgearbeitet; darüber warten Fenster so lange, dass die Wiederherstellung eingreift. Erhöhe den Wert (oder füge Replikate hinzu) für mehr gleichzeitige Turns. Bereich `1`–`256`. | | `AUTOMATION_ORG_CONCURRENCY` | `8` | Automations-Schritte einer Organisation, die über alle `backend-worker`-Replikate hinweg gleichzeitig laufen. So belegt eine Organisation mit vielen Läufen auf einmal nicht alle Plätze der Worker, während die Läufe anderer Organisationen warten. `0` hebt die Grenze auf. Replikate, die im selben Moment Arbeit abholen, können je einen Schritt starten, daher laufen bei einem Ansturm kurz ein oder zwei mehr. Ein einzelnes Replikat mit dem Default von `WORKER_CONCURRENCY` erreicht sie nie. Bedient dein Deployment nur eine Organisation und bietet es mehr Plätze für Schritte, als dieser Wert zulässt, erhöhe ihn oder setze `0`. Bereich `0`–`256`. | +| `AUTOMATION_RUNNER_PROCESSES` | `2` bei `backend-api`; bei `backend-worker` einer pro CPU-Kern minus einer, höchstens `4` | In wie vielen Prozessen ein `backend`-Replikat Automations-Code auswertet: Templates, die der Runner liest, und Transform-Code. Ein Replikat startet einen und fügt nur dann einen weiteren hinzu, wenn alle vorhandenen beschäftigt sind; ein Prozess über den ersten hinaus endet nach fünf Minuten ohne Arbeit. Jeder belegt im Betrieb etwa 75 MB. Senke den Wert auf einem Replikat mit wenig Speicher; erhöhe ihn auf einem Worker, dessen Automatisierungen viel Transform-Code ausführen. Bereich `1`–`16`. | | `SHUTDOWN_DRAIN_MS` | `15000` bei `backend-api`, `90000` bei `backend-worker` | Wie lange ein `backend`-Replikat beim Anhalten in Millisekunden auf seine Jobs wartet, bevor es sich beendet. Ein Worker gibt dabei zuerst seine Automations-Läufe an einen anderen weiter: Jeder Lauf geht beim nächsten Schritt weiter, und ein Schritt, der nach 20 Sekunden noch arbeitet, wird unterbrochen und läuft auf dem nächsten Replikat noch einmal, außer er hat gerade etwas an einen externen Dienst gesendet — dann wartet der Lauf, bis eine Person entscheidet. Setze `stop_grace_period` des Containers mindestens 15 Sekunden höher als diesen Wert; die mitgelieferten Compose-Dateien geben `backend-api` 30 Sekunden und `backend-worker` 120, und `tale deploy` hebt beide auf 15 Sekunden über einen höheren Wert an. Bereich `1000`–`600000`. | | `TALE_BACKEND_URL` | `http://backend-api:3005` | Wo der Web-Tier das Anwendungs-Backend erreicht: Die öffentliche `/status`-Seite prüft es darüber, und der Webserver holt sich dort die Antworten, die nur eine Datenbank geben kann. Das mitgelieferte Compose und der Container-Entrypoint setzen den In-Compose-Alias als Default; setze die Variable nur, wenn dein Backend-Service anders heißt. Liest nur der `platform`-Service. | @@ -235,6 +237,7 @@ Bei einem Workspace-Deployment laufen vorübergehend beide Farben. Plane Kapazit | Name | Default | Beschreibung | | ------------------------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `SESSION_IDLE_TIMEOUT_MINUTES` | unset | **Optional.** Meldet eine Sitzung nach so vielen Minuten Inaktivität ab (`1`–`1440`). Das Fenster verschiebt sich bei Aktivität und wird serverseitig durchgesetzt — über E-Mail-/Passwort-, SSO- und Trusted-Headers-Sitzungen. | +| `SESSION_COOKIE_CACHE_SECONDS` | unset | **Optional.** Eine Anfrage darf ihre aufgelöste Sitzung bis zu so viele Sekunden (`1`–`300`) aus einem signierten Cookie übernehmen, statt die Datenbank zu lesen. Auf einer stark genutzten Instanz spart das die meisten Lesezugriffe der Authentifizierung. Der Preis: Änderungen an der Sitzung oder am Konto erreichen gewöhnliche Anfragen erst, wenn die zwischengespeicherte Kopie abläuft (etwa eine Abmeldung auf einem anderen Gerät oder die Sitzungen, die enden, wenn sich ein Passwort ändert oder ein Admin den Passkey eines Mitglieds widerruft oder dessen Zwei-Faktor-Authentifizierung zurücksetzt). Die Mitgliedschaft in Organisationen wird weiterhin bei jeder Anfrage gelesen, und offene Live-Update-Streams prüfen die Sitzung innerhalb von 15 Sekunden. Ist `SESSION_IDLE_TIMEOUT_MINUTES` gesetzt, bleibt der Cache auf ein Viertel dieses Fensters begrenzt; der Widerruf wegen Inaktivität berücksichtigt den Cache, sodass das Inaktivitätslimit einer Organisation bis zu so viele Sekunden später greifen kann. | Ohne Wert gilt die normale Sitzungsdauer. Mit gesetztem Limit läuft eine inaktive Sitzung serverseitig ab; Aktivität verschiebt das Fenster. Organisationsadmins können es über die [Richtlinie zur Sitzungsinaktivität](/de/platform/admin/governance/policies-and-limits) weiter verkürzen. Die zugehörige Bereinigung läuft ungefähr alle fünf Minuten. @@ -246,17 +249,29 @@ Ohne Wert gilt die normale Sitzungsdauer. Mit gesetztem Limit läuft eine inakti Trag hier deinen eigenen Helpdesk ein, damit Personen nach einem Fehler das Team erreichen, das dein Deployment betreibt. Kennt die Fehlerseite die Organisation, hängt der Link `organizationId=` an den Query-String an, hinter eine bereits vorhandene Query, und ersetzt einen `organizationId`-Parameter, den die URL schon trägt. Jeder andere Wert, etwa `mailto:` oder eine URL ohne Schema, wird mit einer Warnung im Log des Dienstes `platform` ignoriert, und der Link behält den Standardwert. +## MCP-Endpunkt {#mcp-endpoint} + +| Name | Default | Beschreibung | +| --- | --- | --- | +| `TALE_MCP_ALLOWED_ORIGINS` | nicht gesetzt | **Optional, gelesen von `backend-api` und der Rolle `all`.** Browser-Origins, von denen der [MCP-Endpunkt](/de/develop/mcp-endpoint) neben `SITE_URL` und `ADDITIONAL_SITE_URLS` eine Anfrage mit `Origin`-Kopfzeile annimmt. Durch Kommas oder Leerzeichen getrennt, jeweils `scheme://host[:port]` ohne Pfad, etwa der eigene Origin eines Desktop-Editors wie `vscode-file://vscode-app`. Ein fehlerhafter Eintrag verhindert den Backend-Start. | +| `TALE_MCP_ORIGIN_ENFORCE` | `false` | **Optional, gelesen von `backend-api` und der Rolle `all`.** Mit `true` lehnt der Endpunkt eine Anfrage von jedem anderen Origin mit `403` und `ORIGIN_FORBIDDEN` ab; mit `false` protokolliert er sie nur. | + +Coding-Agents im Terminal und serverseitige Clients senden keinen `Origin`, für sie greift die Prüfung nie. Eine Browserseite einer anderen Website sendet einen, und über einen API-Schlüssel in einer solchen Seite würde diese Website den Endpunkt erreichen. Solange die Durchsetzung aus ist, protokolliert der Endpunkt jede Anfrage von einem Origin außerhalb der Liste als `[mcp] origin-mismatch` mit dem Origin, der Organisation und der Person. Lies diese Zeilen, um zu sehen, welche deiner Clients einen Origin senden, bevor du `TALE_MCP_ORIGIN_ENFORCE=true` setzt, und trag ihre Origins in `TALE_MCP_ALLOWED_ORIGINS` ein. + ## Sandbox-Infrastruktur {#sandbox-infrastructure} Der Sandbox-Spawner liest die folgenden Einstellungen. Übergib sie seiner Umgebung und erstelle den Dienst nach einer Änderung neu. `SANDBOX_MAX_SESSIONS` legt die gemeinsame Kapazität aller Organisationen fest. Die drei Arbeitslimits einer Organisation ergeben automatisch ihre Gesamtsumme; liegt sie über dieser Kapazität, kannst du die Limits nicht speichern. Unter [Sandboxes](/de/platform/admin/sandboxes) verwaltest du die Limits und siehst tatsächliche Laufzeitzahlen und Host-Messwerte getrennt von der Kontingentbelegung. | Name | Default | Beschreibung | | --- | --- | --- | -| `SANDBOX_MAX_SESSIONS` | auf einem lokalen Docker-Host nach dem Host-Speicher bemessen (mindestens `8`, höchstens `256`); sonst `8` | Höchstzahl laufender und startender Sessions aller Organisationen auf dem Docker-Host oder im Kubernetes-Namespace, einschließlich weiterlaufender Container im Leerlauf. Die Kapazität reserviert weder CPU noch Arbeitsspeicher. Fehlt die Variable auf einem Docker-Host, dessen Speicher der Spawner lesen kann, bemisst er sie nach diesem Speicher: eine Session je 768 MiB, die nach `SANDBOX_MIN_FREE_MEMORY` übrig bleiben, oder je 1,5 GiB, wenn Agent-Sessions Docker in der Sandbox betreiben. Lässt sich der Speicher beim Start nicht lesen, bleibt die Kapazität bei `8`, bis er lesbar ist. Ein expliziter Wert legt sie fest. Gleichzeitige Kubernetes-Replikate setzen sie nach bestem Bemühen durch; harte Ressourcengrenzen im Namespace setzt du mit ResourceQuota. | +| `SANDBOX_MAX_SESSIONS` | auf einem lokalen Docker-Host nach Host-Speicher und CPUs bemessen (mindestens `8`, höchstens `256`); sonst `8` | Höchstzahl laufender und startender Sessions aller Organisationen auf dem Docker-Host oder im Kubernetes-Namespace, einschließlich weiterlaufender Container im Leerlauf. Die Kapazität reserviert weder CPU noch Arbeitsspeicher. Fehlt die Variable auf einem Docker-Host, dessen Speicher der Spawner lesen kann, bemisst er sie nach diesem Speicher: eine Session je 768 MiB, die nach `SANDBOX_MIN_FREE_MEMORY` übrig bleiben, oder je 1,5 GiB, wenn Agent-Sessions Docker in der Sandbox betreiben, und höchstens zwei Sessions je CPU, die der Docker-Daemon meldet. Lässt sich der Speicher beim Start nicht lesen, bleibt die Kapazität bei `8`, bis er lesbar ist. Ein expliziter Wert legt sie fest. Gleichzeitige Kubernetes-Replikate setzen sie nach bestem Bemühen durch; harte Ressourcengrenzen im Namespace setzt du mit ResourceQuota. | | `SANDBOX_MIN_FREE_MEMORY` | ein Zehntel des Host-Speichers, mindestens `1g` | Speicher, den eine neue Session oder eine freigegebene, noch laufende Session bei der Wiederaufnahme auf einem lokalen Docker-Host frei lassen muss, neben dem, was noch startende und eben gestartete Sessions gleich belegen werden. Würde ein Start weniger übrig lassen, stoppt der Spawner zuerst eine freigegebene Session im Leerlauf; reicht der Speicher dann immer noch nicht, antwortet er mit „beschäftigt“, und die Arbeit wartet, bis laufende Sessions Speicher freigeben. Akzeptiert Größen wie `2g` oder `1536m`. Wirkt nicht unter Kubernetes oder mit einem entfernten Docker-Daemon. | +| `SANDBOX_CPU_PRESSURE_PERCENT` | `60` | CPU-Druck auf einem lokalen Docker-Host in Prozent, ab dem neue Sessions und freigegebene Sessions, die wieder Arbeit aufnehmen, nur noch einzeln starten: der Anteil der letzten zehn Sekunden, in dem ein Prozess auf eine CPU gewartet hat, wie ihn die Pressure Stall Information des Kernels meldet (`some avg10` in `/proc/pressure/cpu`). Darüber lässt der Spawner alle zehn Sekunden einen Start zu, in der Reihenfolge der Anfragen; die übrigen warten mit der Antwort „beschäftigt“. Laufende Arbeit wird nicht gebremst. `0` schaltet die Prüfung ab. Ein Kernel ohne Pressure Stall Information (ohne sie gebaut oder mit `psi=0` gestartet) lässt die CPU bei der Zulassung außen vor; der Spawner protokolliert das einmal. Wirkt nicht unter Kubernetes oder mit einem entfernten Docker-Daemon. | | `SANDBOX_MIN_FREE_DISK` | ein Zwanzigstel jedes Datenträgers, mindestens `2g`, höchstens `20g` | Freier Speicher für neue und reaktivierte Sitzungen im Dateisystem der Arbeitsbereiche und im verifizierten Docker-Daten-Dateisystem. Unterhalb der Grenze wartet die Arbeit; gestoppte, ungenutzte Build-Caches werden zuerst entfernt. Akzeptiert `10g` oder `4096m`; `0` deaktiviert die Prüfung. Kubernetes stützt sich auf Storage-Klasse und Volume-Bereitstellung. | +| `SANDBOX_CRITICAL_FREE_DISK` | ein Viertel der Grenze aus `SANDBOX_MIN_FREE_DISK`, mindestens `1g` und nie darüber | Freier Speicher, unterhalb dessen der Datenträger der Sessions kritisch ist: Was laufende Sessions dort schreiben, schlägt bald fehl. Darunter werden freigegebene Sessions mit Docker in der Sandbox im Leerlauf sofort gestoppt, was ihre inneren Image-Speicher entfernt, und der Spawner protokolliert höchstens alle zehn Minuten die drei größten Arbeitsbereiche. Akzeptiert `2g` oder `2048m`; ein Wert über der Grenze zählt als die Grenze; `0` deaktiviert die Stufe, ebenso eine Grenze von `0`. Nur mit dem Docker-Backend. | | `SANDBOX_DOCKER_WORKLOADS` | `project,workflow` | Workloads, die Docker in ihrer Sandbox nutzen dürfen, wenn es für das Deployment aktiviert ist. Mit `project` starten Workflow-Agenten ohne Docker, mit `workflow` gilt das für Projektagenten und mit `none` für beide. Die Einstellung gilt für neu erstellte Sessions; bestehende behalten ihre Fähigkeiten. Eine Session-Anfrage kann Docker mit `docker: false` abwählen, aber weder diese Liste noch die Deployment-Einstellung erweitern. | | `SANDBOX_AGENT_CPUS` | `2` | CPU-Grenze je Agent-Session. Berücksichtige bei der Session-Anzahl gleichzeitig laufende Builds und andere Aufgaben auf dem Host. | +| `SANDBOX_AGENT_CPU_SHARES` | `256` | CPU-Gewichtung einer Agent-Session und der Build-Cache-Hilfscontainer ihrer Organisation, solange die CPUs des Hosts ausgelastet sind, gegenüber Dockers Standardwert `1024`, den die eigenen Dienste der Plattform behalten; Sessions mit dem Profil `default` (Codeausführungen, Seiten-Renderings) nutzen `128`. Ausgelastete Sessions überlassen die CPU dann der Datenbank und dem Backend, statt sie auszubremsen; auf einem Host mit freier CPU nutzt eine Session weiterhin bis zu `SANDBOX_AGENT_CPUS`. Eine ganze Zahl von `2` bis `262144`. Gilt für neu erstellte Sessions; ein laufender Hilfscontainer übernimmt einen neuen Wert sofort. | | `SANDBOX_AGENT_MEMORY` | `4g`; `8g` mit Docker in der Sandbox | Speichergrenze je Agent-Session, die auch für ihren inneren Docker-Daemon und dessen Container gilt. Ein expliziter Wert ersetzt beide Standardwerte und gilt für neu erstellte Sessions. | | `SANDBOX_AGENT_PROFILE` | `agent` | Wird von Backend-API und Worker gelesen. Profil für neue Agenten- und Workflow-Arbeitsbereiche: `agent` unterstützt inneres Docker; `agent-light` behält Coding-Werkzeuge und den persistenten Arbeitsbereich, ohne Docker oder Build-Cache-Helfer zu starten. Bestehende Arbeitsbereiche behalten ihr gespeichertes Profil. | | `TALE_SANDBOX_CLAUDE_EFFORT` | nicht gesetzt (übernimmt den Agent-Laufzeit-Standard) | Wird von Backend-API und Worker gelesen. Denktiefe von Claude Code: `low`, `medium`, `high` oder `max`. Niedrigere Werte lassen die automatische Ultrathink-Anweisung weg und setzen den Wert pro Ausführung; adaptives Denken bleibt aktiv. Andere Agent-Laufzeiten und fremde Modelle bleiben unverändert. Vergleiche repräsentative Aufgaben, bevor du den Wert senkst; kürzere Läufe sind nicht garantiert. | @@ -266,13 +281,22 @@ Der Sandbox-Spawner liest die folgenden Einstellungen. Übergib sie seiner Umgeb | `SANDBOX_BUILDKITD_CPUS` | `SANDBOX_AGENT_CPUS` | CPU-Grenze des Build-Cache-Hilfscontainers einer Organisation, der die Image-Builds all ihrer Agent-Sessions ausführt, wenn Docker in der Sandbox läuft. Laufende Hilfscontainer übernehmen einen neuen Wert sofort. Die Anzahl paralleler BuildKit-Solver-Schritte entspricht diesem abgerundeten CPU-Limit, mindestens jedoch eins; diese Grenze gilt nach dem Neuerstellen eines inaktiven Hilfscontainers. | | `SANDBOX_BUILDKITD_MEMORY` | das Doppelte von `SANDBOX_AGENT_MEMORY` | Speichergrenze des Build-Cache-Hilfscontainers einer Organisation, die sich die gleichzeitigen Builds ihrer Agent-Sessions teilen. Akzeptiert Größen wie `16g` oder `12288m`. Ein laufender Hilfscontainer übernimmt einen neuen Wert, wenn er neu erstellt wird, sobald kein Build läuft. | | `SANDBOX_BUILDKITD_IDLE_CACHE` | `5g` | Build-Cache, den der Build-Cache-Hilfscontainer einer Organisation behält, wenn er mangels Agent-Sessions stoppt. Unmittelbar vor diesem Stopp kürzt der Spawner den Cache auf diese Größe, die am längsten ungenutzten Einträge zuerst: Die eigene Speicherbereinigung des Caches läuft nur, solange der Hilfscontainer läuft. Akzeptiert Größen wie `5g` oder `2048m`; `0` behält nichts. | +| `SANDBOX_BUILDKITD_MAX_CACHE` | ein Zehntel des Session-Datenträgers, mindestens `1g`, höchstens `20g` | Größter Build-Cache, den der Build-Cache-Hilfscontainer einer Organisation behält; darüber werden die am längsten ungenutzten Einträge zuerst entfernt. Ohne Wert richtet sich die Grenze nach der Größe des Datenträgers, auf dem die Arbeitsbereiche der Sessions liegen, damit viele bauende Organisationen zusammen nicht mehr als einen Anteil davon belegen. Die Untergrenze, unter die knapper Speicherplatz den Cache nie kürzt, beträgt ein Zehntel dieser Grenze, höchstens 2 GiB. Akzeptiert Größen wie `8g` oder `40960m`, mindestens `1g`. Ein laufender Hilfscontainer übernimmt einen neuen Wert, wenn er neu erstellt wird, sobald kein Build läuft. | | `SANDBOX_BUILDKITD_PROVISION_TIMEOUT_MS` | `5000` | Gesamtes Zeitbudget in Millisekunden für den optionalen gemeinsamen Build-Cache beim Erstellen einer Sitzung, einschließlich wartender Docker-Aufrufe und Registry-Spiegel. Bereich `100`–`60000`. Läuft das gemeinsame Zeitbudget ab, werden wartende Hilfscontainer-Aufrufe abgebrochen und später nicht mehr gestartet; die Session nutzt ihren lokalen Builder. | | `SANDBOX_BUILDKITD_CACHE_RETENTION` | `14d` | Wie lange die gestoppten Build-Cache-Hilfscontainer einer Organisation ihre Caches behalten. Ist der Builder länger gestoppt und kann keine Session der Organisation ihn nutzen, entfernt der Spawner ihre Hilfscontainer, ihr Netzwerk und ihre Cache-Volumes, wie beim Löschen einer Organisation; ihr nächster Build startet ohne Cache. Akzeptiert ganze Tage oder Stunden wie `14d` oder `336h`; `off` (oder `0`) behält die Caches, bis die Organisation gelöscht wird. | -| `SANDBOX_SESSION_MAX_IDLE_MS` | `1800000` (30 Min.) | Leerlauffenster, nach dem nicht angepinnte Sessions stoppen. Die Build-Cache-Hilfscontainer einer Organisation stoppen ebenfalls nach diesem Fenster ohne möglicherweise aktive Session; Netzwerke und Cache-Volumes bleiben erhalten. | -| `SANDBOX_SESSION_RELEASED_IDLE_MS` | `300000` (5 Min.) | Leerlauffenster für eine freigegebene Session, also eine, deren Aufgabe oder Lauf beendet ist und die keine andere Arbeit mehr belegt. Eine nicht angepinnte, freigegebene Session stoppt nach dieser Leerlaufzeit, statt `SANDBOX_SESSION_MAX_IDLE_MS` abzuwarten; die nächste Runde setzt sie auf ihrem erhaltenen Arbeitsverzeichnis fort. Agent-Sessions mit Docker in der Sandbox behalten das volle Leerlauffenster, weil ihr innerer Docker-Daemon bei jeder Fortsetzung mit einem leeren Image-Speicher startet. | +| `SANDBOX_BUILDKITD_IDLE_MS` | `600000` (10 Min.) | Wie lange die Build-Cache-Hilfscontainer einer Organisation weiterlaufen, sobald keine Agent-Session der Organisation, die Images baut, sie mehr nutzen kann. Danach stoppen sie; Netzwerk und Cache-Volume des Builders bleiben erhalten, die Registry-Mirrors werden mit ihren Caches entfernt. Der nächste Build startet sie wieder: Ein Hilfscontainer mit aktuellem Image und aktuellen Einstellungen wird als gestoppter Container neu gestartet, jeder andere neu erstellt. Mindestens `60000`. | +| `SANDBOX_PACKAGE_CACHE_RETENTION` | `14d` | Wie lange die Paket-Caches einer Organisation nach ihrer letzten Nutzung bestehen bleiben: die Download-Caches von pip, uv, npm und bun, die ihre Sandboxes auf Docker teilen (Sandboxes mit Docker im Inneren nutzen sie nicht). Hat keine Sandbox der Organisation sie so lange genutzt, entfernt der Spawner sie bei seiner nächsten stündlichen Prüfung; die nächste Sandbox der Organisation startet mit leeren Caches, und Installationen dauern länger, bis sie wieder gefüllt sind. Caches, die es schon vor dieser Einstellung gab, zählen ab der ersten Prüfung nach dem Update. Akzeptiert ganze Tage oder Stunden wie `14d` oder `336h`; `off` (oder `0`) behält die Caches, bis die Organisation gelöscht wird. | +| `SANDBOX_SESSION_MAX_IDLE_MS` | `1800000` (30 Min.) | Leerlauffenster, nach dem nicht angepinnte Sessions stoppen. Die Build-Cache-Hilfscontainer einer Organisation folgen stattdessen `SANDBOX_BUILDKITD_IDLE_MS`. | +| `SANDBOX_SESSION_RELEASED_IDLE_MS` | `300000` (5 Min.) | Leerlauffenster für eine freigegebene Session, also eine, deren Aufgabe oder Lauf beendet ist und die keine andere Arbeit mehr belegt. Eine nicht angepinnte, freigegebene Session stoppt nach dieser Leerlaufzeit, statt `SANDBOX_SESSION_MAX_IDLE_MS` abzuwarten; die nächste Runde setzt sie auf ihrem erhaltenen Arbeitsverzeichnis fort. Agent-Sessions mit Docker in der Sandbox behalten das volle Leerlauffenster, sobald ihr innerer Docker-Daemon gelaufen ist, weil er bei jeder Fortsetzung mit einem leeren Image-Speicher startet; eine Session, deren Daemon nie gestartet ist, erhält ebenfalls dieses kürzere Fenster. | +| `SANDBOX_EXEC_STALL_MINUTES` | `45` | Wie lange ein Befehl in einer Session nichts ausgeben darf, während seine Prozesse weniger als 1 % einer CPU nutzen, bevor die Sandbox ihn als hängend beendet. Ein Agent, der hängt, weil er auf eine Verbindung wartet, die nie antwortet, oder auf eine Eingabe, die niemand sendet, belegt seine Session sonst bis zum Zeitlimit seines Laufs. Arbeit, die der Befehl an Container übergibt, die er in der Sandbox gestartet hat, zählt als CPU-Nutzung. Ganze Minuten bis `1440`; `0` deaktiviert die Prüfung. Gilt für neu erstellte Sessions. | | `SANDBOX_RUNTIME_IMAGE` | `tale-sandbox-runtime:latest` | **Optional, vom Spawner gelesen.** Das Image, aus dem jeder Session-Container entsteht. Der Default ist der Tag, den der Entwicklungs-Stack lokal baut; ein Host, der seine Images zieht, setzt deshalb den Registry-Namen: `ghcr.io/tale-project/tale/tale-sandbox-runtime:`, passend zum Rest des Stacks. `tale deploy` setzt ihn für dich. | | `SANDBOX_DIND_INNER_POOL` | nicht gesetzt (automatisch) | Optionaler Adresspool für den inneren Docker-Daemon in Agent-Sessions auf Docker oder Kubernetes. Verwende ein kanonisches privates IPv4-`/16` nach RFC1918 außerhalb deiner Pod-, Service- und VPC-Netze. Die Runtime lehnt Überschneidungen mit erkannten Netzen und Adressen ab. | +| `SANDBOX_K8S_DOCKER_STORAGE_SIZE_LIMIT` | `20Gi` | **Nur Kubernetes.** Die Größe des Speichers für das innere Docker einer Agent-Session, die Docker in ihrer Sandbox ausführt. Wächst eine Session darüber hinaus, räumt Kubernetes ihren Pod (Eviction); bemiss den Wert deshalb nach den größten Images, die deine Agents laden und bauen. Die übrigen Kubernetes-Einstellungen findest du unter [Auf Kubernetes bereitstellen](/de/self-hosted/install/kubernetes). | +| `SANDBOX_K8S_EPHEMERAL_STORAGE_REQUEST` / `SANDBOX_K8S_EPHEMERAL_STORAGE_LIMIT` | `256Mi` / `2Gi` | **Nur Kubernetes.** Wie viel Platz auf der Festplatte des Nodes ein Session-Pod anfordert und wie viel er dort außerhalb seines temporären Workspaces und des Speichers für das innere Docker schreiben darf. Die Grenze des Pods rechnet diese Speicher hinzu; überschreitet eine Session sie, räumt Kubernetes nur ihren Pod, statt dass sie den Node füllt. | +| `SANDBOX_K8S_NODE_SELECTOR` / `SANDBOX_K8S_TOLERATIONS` | nicht gesetzt | **Nur Kubernetes.** Die Node-Labels, die jeder Session-Pod erfüllen muss, als JSON-Objekt wie `{"tale.dev/sandbox":"true"}`, und die Taints, die er toleriert, als JSON-Array von Pod-Tolerations. So laufen Sessions auf eigenen Nodes statt neben der Datenbank und der Plattform. Ein fehlerhafter Wert verhindert den Start des Spawners. | +| `SANDBOX_K8S_PRIORITY_CLASS` | nicht gesetzt | **Nur Kubernetes.** Die PriorityClass jedes Session-Pods. Liegt sie unter der Klasse der Plattform, darf der Scheduler Sessions verdrängen, um Pods der Plattform unterzubringen. | | `SANDBOX_EGRESS_MAX_CLIENTS` | `2000` | **Vom Dienst `sandbox-egress` gelesen**, nicht vom Spawner: Erstelle diesen Dienst nach einer Änderung neu. Verbindungen, die der Egress-Proxy für alle Sessions zusammen gleichzeitig bedient; mit transparentem Egress läuft jede ausgehende Verbindung einer Session, ihrer Builds und ihrer Paketinstallationen über ihn. Jenseits der Grenze lehnt der Proxy neue Verbindungen ab, und Installationen und Seitenaufrufe brechen mit zurückgesetzten Verbindungen ab. Jede Verbindung belegt einen Thread und zwei offene Dateien, deshalb bemessen die mitgelieferten Compose-Dateien die Prozess- und Dateigrenzen des Proxys für den Default; ein höherer Wert braucht auch höhere Grenzen, und der Proxy warnt beim Start, wenn seine Grenze für offene Dateien zu niedrig ist. Beim Start hebt der Proxy seine Grenze für offene Dateien auf das an, was die Verbindungen brauchen, so weit die harte Grenze des Containers es erlaubt. Unter Kubernetes setzt du ihn am Egress-Deployment; eine Pod-Spezifikation setzt keine Prozessgrenze, daher muss das `podPidsLimit` des Nodes Platz für einen Thread je Verbindung lassen. | +| `SANDBOX_EGRESS_MAX_CONNECTIONS_PER_SESSION` | `256` | **Vom Dienst `sandbox-egress` gelesen**, nicht vom Spawner: Erstelle diesen Dienst nach einer Änderung neu. Verbindungen, die eine Session gleichzeitig zum Egress-Proxy offen halten darf, gezählt nach ihrer Adresse, damit eine einzelne Session den anderen nicht den ganzen Vorrat von `SANDBOX_EGRESS_MAX_CLIENTS` nimmt; die Build-Cache-Hilfscontainer jeder Organisation haben eigene Adressen. Eine Verbindung über der Grenze lehnt der Proxy sofort mit einem Reset ab, die übrigen Verbindungen der Session laufen weiter. `0` schaltet die Grenze ab, und ein Wert, der keine ganze Zahl ist, verhindert den Start des Proxys. Der Proxy setzt die Grenze beim Start als Firewall-Regel; auf einem Kernel ohne den `connlimit`-Match startet er ohne sie und protokolliert eine Warnung. Unter Kubernetes setzt du ihn am Egress-Deployment; wo das Cluster-Netz die Quelladressen der Sessions umschreibt, sodass sie den Proxy von einer gemeinsamen Adresse aus erreichen, teilen sie sich eine Grenze, setze dort also `0`. | Die Backend-Einstellungen oben müssen API und Worker erreichen. Erstelle beide Dienste nach einer Änderung neu. Der Spawner prüft freien Arbeitsspeicher und Plattenplatz auch beim erneuten Belegen einer freigegebenen Sitzung; daher kann auch ein warmer Arbeitsbereich auf Kapazität warten. @@ -300,7 +324,7 @@ Kubernetes-Sitzungen verwenden `/readyz` für die Startprüfung und `/livez` fü Eine bereits aktive Generation wird nicht erneut angerechnet. Ein Workflow ohne inneres Docker behält die Identität und Werkzeuge seines Agenten, startet aber keinen Docker-Daemon und hält keine Build-Cache-Hilfscontainer aktiv. Ohne expliziten Wert für `SANDBOX_AGENT_MEMORY` gilt pro Session standardmäßig `4g` ohne inneres Docker oder `8g` mit Docker, auch wenn andere Sessions im Deployment Docker nutzen. Ein expliziter Wert gilt für beide Varianten. Die Grenzen sind Obergrenzen, kein reservierter Arbeitsspeicher. -Bei voller Kapazität kann der Spawner eine freigegebene, nicht angepinnte Session im Leerlauf schon vor Ablauf des Leerlauffensters stoppen, um neue Arbeit zuzulassen, zuerst die am längsten untätige. Der Daemon muss bestätigen, dass keine Arbeit läuft; beschäftigte Sessions und Sessions mit unbekanntem Zustand bleiben geschützt. Das dauerhafte Arbeitsverzeichnis oder Volume bleibt beim Stoppen erhalten. Lässt sich keine Session sicher freigeben, blockiert die Kapazitätsgrenze weiterhin neue Starts. Dasselbe gilt, wenn der freie Speicher des Hosts unter `SANDBOX_MIN_FREE_MEMORY` fallen würde. Solange der Datenträger mit den Arbeitsverzeichnissen der Sessions unter `SANDBOX_MIN_FREE_DISK` liegt, wartet neue Arbeit, ohne dass Sessions im Leerlauf gestoppt werden: Eine gestoppte Session behält ihr Arbeitsverzeichnis. +Bei voller Kapazität kann der Spawner eine freigegebene, nicht angepinnte Session im Leerlauf schon vor Ablauf des Leerlauffensters stoppen, um neue Arbeit zuzulassen, zuerst die am längsten untätige. Der Daemon muss bestätigen, dass keine Arbeit läuft; beschäftigte Sessions und Sessions mit unbekanntem Zustand bleiben geschützt. Das dauerhafte Arbeitsverzeichnis oder Volume bleibt beim Stoppen erhalten. Lässt sich keine Session sicher freigeben, blockiert die Kapazitätsgrenze weiterhin neue Starts. Dasselbe gilt, wenn der freie Speicher des Hosts unter `SANDBOX_MIN_FREE_MEMORY` fallen würde. Solange der Datenträger mit den Arbeitsverzeichnissen der Sessions unter `SANDBOX_MIN_FREE_DISK` liegt, wartet neue Arbeit, ohne dass Sessions im Leerlauf gestoppt werden: Eine gestoppte Session behält ihr Arbeitsverzeichnis. Erst unterhalb von `SANDBOX_CRITICAL_FREE_DISK` stoppt der Spawner freigegebene Sessions mit Docker in der Sandbox im Leerlauf sofort, weil ihr Stopp ihre inneren Image-Speicher entfernt. Datensätze im Agent-Laufzeit-Protokoll, einschließlich unvollständiger Zeilen, sind auf 8 MiB begrenzt. Zu große oder unvollständige Ausgaben führen zu einem ausdrücklichen Fehler; eine begrenzte Fortschrittsvorschau gilt nie als vollständiges strukturiertes Ergebnis. Vollständige Endantworten bleiben getrennt von dieser Vorschau erhalten. @@ -310,7 +334,7 @@ Ist Docker in Agent-Sandboxes aktiviert, startet der Daemon automatisch beim ers ### Session-Kapazität bemessen -Fehlt `SANDBOX_MAX_SESSIONS` auf einem Docker-Host, bemisst der Spawner die Kapazität nach dem Speicher des Hosts (ein Host mit 16 GiB erhält 19 Sessions, einer mit 64 GiB 76; 9 und 38, wenn Agent-Sessions einen eigenen Docker-Daemon betreiben) und lässt eine neue Session nur zu, solange der Host `SANDBOX_MIN_FREE_MEMORY` frei behält, wobei er mitzählt, was noch startende und eben gestartete Sessions gleich belegen werden. Eine Lastspitze neuer Sessions, die den Host überbuchen würde, wartet deshalb, statt zu starten; Sessions, die bereits laufen, hindert diese Prüfung nicht daran, weiter zu wachsen. Lege die Kapazität selbst fest unter Kubernetes, mit einem entfernten Docker-Daemon oder wenn auf dem Host auch andere speicherhungrige Dienste laufen: Teste dann die Aufgaben, die deine Bereitstellung gleichzeitig ausführen soll. Browser-Rendering und Docker-Builds haben unterschiedliche Lastspitzen; berücksichtige Agents, Workflows und Crawling aller Organisationen. Ein freier Session-Platz garantiert keine ausreichenden Ressourcen. +Fehlt `SANDBOX_MAX_SESSIONS` auf einem Docker-Host, bemisst der Spawner die Kapazität nach Speicher und CPUs des Hosts (eine Session je 768 MiB über der Reserve, höchstens zwei je CPU: Ein Host mit 16 GiB und 8 CPUs erhält 16 Sessions, einer mit 64 GiB und 16 CPUs 32; ein Host mit 16 GiB erhält 9, wenn Agent-Sessions einen eigenen Docker-Daemon betreiben) und lässt eine neue Session nur zu, solange der Host `SANDBOX_MIN_FREE_MEMORY` frei behält, wobei er mitzählt, was noch startende und eben gestartete Sessions gleich belegen werden. Eine Lastspitze neuer Sessions, die den Host überbuchen würde, wartet deshalb, statt zu starten; Sessions, die bereits laufen, hindert diese Prüfung nicht daran, weiter zu wachsen. Steht die CPU des Hosts unter Druck (`SANDBOX_CPU_PRESSURE_PERCENT`), starten neue Sessions ebenso einzeln, statt die Last weiter zu erhöhen. Jeder Lauf eines Projektagenten, der gleichzeitig mit einem anderen arbeitet, bekommt eine eigene Session, einen Agenten-Worker: Ein Agent, der an drei Aufgaben gleichzeitig arbeitet, betreibt drei Sessions, jede mit ihrem eigenen Limit `SANDBOX_AGENT_MEMORY`. Diese beiden Einstellungen begrenzen also, wie viel Agentenarbeit parallel läuft. Lege die Kapazität selbst fest unter Kubernetes, mit einem entfernten Docker-Daemon oder wenn auf dem Host auch andere speicherhungrige Dienste laufen: Teste dann die Aufgaben, die deine Bereitstellung gleichzeitig ausführen soll. Browser-Rendering und Docker-Builds haben unterschiedliche Lastspitzen; berücksichtige Agents, Workflows und Crawling aller Organisationen. Ein freier Session-Platz garantiert keine ausreichenden Ressourcen. Miss unter Docker den Ressourcenbedarf, während typische Aufgaben gleichzeitig laufen. Wiederhole diesen Befehl während des Durchlaufs; eine Messung im Leerlauf zeigt keine Lastspitzen: @@ -346,17 +370,23 @@ Die Standardkapazität lag bisher bei 16, und Organisationen aus früheren Versi Ab dieser Version erhält eine Docker-Bereitstellung, die `SANDBOX_MAX_SESSIONS` nie gesetzt hat, eine nach dem Host-Speicher bemessene Kapazität statt 8, nie weniger als 8. Sie kann mehr Sessions gleichzeitig zulassen als zuvor, und das nur, solange der Host Speicher übrig hat. Setze einen expliziten Wert, um eine feste Kapazität zu behalten. +Diese bemessene Kapazität beträgt jetzt außerdem höchstens zwei Sessions je CPU; ein Host mit viel Speicher und wenigen CPUs erhält daher weniger Sessions als zuvor (ein Host mit 16 GiB und 4 CPUs: 8 statt 19). Steht die CPU des Hosts unter Druck, starten neue Sessions zudem einzeln (`SANDBOX_CPU_PRESSURE_PERCENT`, `0` schaltet das ab). Ein expliziter Wert für `SANDBOX_MAX_SESSIONS` bleibt unverändert. + ### Docker-Build-Caches Die Vorbereitung des gemeinsamen Build-Caches verwendet `SANDBOX_BUILDKITD_PROVISION_TIMEOUT_MS` (standardmäßig 5 Sekunden). Eine Session wartet höchstens so lange oder ein Viertel ihres gesamten Startbudgets, falls das kürzer ist. Danach nutzt sie ihren lokalen Builder. Die gemeinsame Vorbereitung hat ein eigenes begrenztes Zeitbudget: Wird die Wartezeit einer Session abgebrochen, läuft die Vorbereitung für andere Sessions weiter. Eine Session, die bereits ihren lokalen Builder nutzt, wechselt bei einem verspäteten Ergebnis nicht nachträglich zum gemeinsamen Builder. Registry-Mirrors werden parallel vorbereitet. Die Zahl gleichzeitiger Schritte des gemeinsamen Builders ergibt sich aus seiner abgerundeten CPU-Grenze und beträgt mindestens eins; seine Speichergrenze gilt weiterhin. Die Vorbereitungszeit wird vom verbleibenden Startbudget der Session abgezogen. -Docker-Build-Caches sind nach Organisation getrennt. Jede Organisation nutzt einen privilegierten Builder und drei Registry-Mirrors ohne erhöhte Rechte. Sobald keine Session mehr auf sie zugreifen könnte, beginnt das Leerlauffenster; danach stoppen die Hilfscontainer. Der nächste Build startet sie mit ihren erhaltenen Cache-Volumes neu. Unmittelbar bevor der Builder stoppt, kürzt der Spawner seinen Cache auf `SANDBOX_BUILDKITD_IDLE_CACHE`, denn seine Speicherbereinigung läuft nur, solange er läuft. Der Cache einer gestoppten Organisation wird danach nicht weiter gekürzt; nach `SANDBOX_BUILDKITD_CACHE_RETENTION` (14 Tage) ohne Build werden ihre Hilfscontainer und Caches entfernt, sonst gehen sie mit der Organisation. Solange der Datenträger der Sessions unter `SANDBOX_MIN_FREE_DISK` liegt, gehen die Caches gestoppter Organisationen früher, die am längsten gestoppten zuerst. Netzwerke und Volumes bleiben für die Wiederverwendung bestehen. Kubernetes-Sessions nutzen ihren eigenen inneren Docker-Builder; der Kubernetes-Abgleich ruft für diese Hilfscontainer keine Docker-CLI auf. +Docker-Build-Caches sind nach Organisation getrennt. Jede Organisation nutzt einen privilegierten Builder und drei Registry-Mirrors ohne erhöhte Rechte. Sobald keine Session mehr auf sie zugreifen könnte, stoppen die Hilfscontainer nach `SANDBOX_BUILDKITD_IDLE_MS` (10 Minuten), und die Registry-Mirrors werden mit ihren Caches entfernt, denn der eigene Cache des Builders behält die Basis-Layer, die seine Builds genutzt haben. Der nächste Build startet den Builder mit seinem erhaltenen Cache-Volume neu und erstellt die Mirrors neu. Unmittelbar bevor der Builder stoppt, kürzt der Spawner seinen Cache auf `SANDBOX_BUILDKITD_IDLE_CACHE`, denn seine Speicherbereinigung läuft nur, solange er läuft. Der Cache einer gestoppten Organisation wird danach nicht weiter gekürzt; nach `SANDBOX_BUILDKITD_CACHE_RETENTION` (14 Tage) ohne Build werden ihre Hilfscontainer und Caches entfernt, sonst gehen sie mit der Organisation. Solange der Datenträger der Sessions unter `SANDBOX_MIN_FREE_DISK` liegt, gehen die Caches gestoppter Organisationen früher, die am längsten gestoppten zuerst. Das Netzwerk und das Cache-Volume des Builders bleiben für die Wiederverwendung bestehen. Kubernetes-Sessions nutzen ihren eigenen inneren Docker-Builder; der Kubernetes-Abgleich ruft für diese Hilfscontainer keine Docker-CLI auf. Der Spawner füllt den ersten verfügbaren Docker-Adresspool mit Organisationsnetzwerken, bevor er zum nächsten wechselt. Standardmäßig erhält jedes Netzwerk ein `/23` mit 512 Adressen; ein ansonsten freies `/16` bietet damit Platz für 128 Organisationsnetzwerke. Kleinere in Docker konfigurierte Subnetze bleiben kleiner. Der Spawner schließt vorhandene Docker-Netzwerke, Routen und DNS-Serveradressen auf dem Host des Docker-Daemons sowie `172.31.0.0/16` für ältere Runtime-Images aus und prüft anschließend das angelegte Netzwerk. Auch bei einem entfernten Docker-Daemon erfasst der Spawner dessen Host über einen kurzlebigen Container aus dem konfigurierten BuildKit-Image. Dieser läuft im Host-Netzwerk-Namespace mit schreibgeschütztem Dateisystem, ohne Capabilities und ohne Mounts. Scheitert diese Abfrage oder bleibt kein sicheres Subnetz frei, bauen Sessions lokal ohne gemeinsamen Cache. Ein ungenutztes eigenes Netzwerk mit ungültigem Subnetz legt der Spawner neu an; belegte und fremde Netzwerke bleiben erhalten. -Beim Upgrade entstehen leere Organisationscaches; die alten globalen Cachedaten bleiben erhalten. Alte Hilfscontainer stoppen automatisch, sobald keine laufende Session mehr auf sie angewiesen ist. Lass alte angepinnte Sessions auslaufen oder stoppe sie, um den Übergang abzuschließen; bis dahin bleibt der alte gemeinsame Cachedienst erreichbar. Browserautomatisierung nutzt Chromium ohne grafische Oberfläche. Die Live-Ansicht und manuelle Browserübernahme sind entfernt. +Beim Upgrade entstehen leere Organisationscaches; die alten globalen Cachedaten bleiben vorerst erhalten. Alte Hilfscontainer stoppen automatisch, sobald keine laufende Session mehr auf sie angewiesen ist. Sind sie länger als `SANDBOX_BUILDKITD_CACHE_RETENTION` (14 Tage) gestoppt und ist weiterhin keine Session auf sie angewiesen, entfernt der Spawner diese Hilfscontainer und die vier alten Cache-Volumes (`tale-buildkitd-cache` sowie `tale-buildkitd-mirror-cache-docker-io`, `-ghcr-io`, `-quay-io`), jeweils nur, solange sie die alte Build-Cache-Markierung ohne Organisation tragen, und protokolliert jede Entfernung; `off` behält sie. Lass alte angepinnte Sessions auslaufen oder stoppe sie, um den Übergang abzuschließen; bis dahin bleibt der alte gemeinsame Cachedienst erreichbar. Browserautomatisierung nutzt Chromium ohne grafische Oberfläche. Die Live-Ansicht und manuelle Browserübernahme sind entfernt. + +### Images der inneren Docker-Engine + +Ist der gemeinsame Build-Cache aktiv, lädt die innere Docker-Engine einer Session Docker-Hub-Images über den docker.io-Registry-Mirror ihrer Organisation, also denselben Cache, den ihre Builds nutzen. Läuft dieser Mirror nicht, lädt sie direkt von Docker Hub. Images aus anderen Registries lädt sie direkt. Geht eine innere Engine mit mehr als 10 GiB an Images und Build-Cache in den Leerlauf, entfernt sie vorher ihre unbenannten, unbenutzten Images und kürzt ihren Build-Cache auf die zuletzt genutzten 5 GiB; benannte Images, Container und Volumes bleiben. Unter Kubernetes begrenzt stattdessen die Größenbeschränkung des Volumes den inneren Speicher, wenn sie unter 10 GiB liegt. ### Innere Docker-Netzwerke @@ -423,11 +453,26 @@ Setzt du statt des mitgelieferten Proxys einen eigenen ein, leite `/sandbox/tunn | Name | Default | Beschreibung | | -------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `TALE_EXTERNAL_TURN_DEADLINE_MS` | `1800000` (30 Min.) | **Optional.** Wie lange ein Coding-Agent-Turn in der Sandbox (Claude Code, OpenCode, Codex) ohne Abnehmer seiner Ausgabe liegen darf, bevor der Sandbox-Daemon ihn abräumt. Ein gleitendes Fenster, das bei jedem Wiederanbinden der Plattform neu startet — keine absolute Obergrenze für den Turn. Millisekunden. | +| `TALE_EXTERNAL_TURN_DEADLINE_MS` | `1800000` (30 Min.) | **Optional.** Wie lange ein Coding-Agent-Turn in der Sandbox (Claude Code, OpenCode, Codex) ohne Abnehmer seiner Ausgabe liegen darf, bevor der Sandbox-Daemon ihn abräumt. Ein gleitendes Fenster, das bei jedem Wiederanbinden der Plattform neu startet — keine absolute Obergrenze für den Turn. Ein laufender Agent-Turn wartet außerdem einen nicht erreichbaren Sandbox-Dienst ab, bevor er fehlschlägt: ein Drittel dieses Werts, höchstens 10 Minuten (beim Standardwert genau 10 Minuten). Senkst du den Wert, verkürzt sich diese Wartezeit. Millisekunden. | | `SANDBOX_LLM_GATEWAY_STREAM_IDLE_TIMEOUT_SECONDS` | `600` (10 Min.) | **Optional.** Wie lange das Modell-Gateway der Sandbox auf das nächste Byte eines stillen Upstream-Modells wartet, bevor es den Stream abbricht — auch während ein langsames lokales Modell noch einen langen Prompt verarbeitet. Das Backend liest den Wert und konfiguriert damit das Gateway. Claude-Code-Turns warten mindestens genauso lange, bevor sie einen stillen Stream aufgeben und die Anfrage erneut senden. Du kannst den Wert für ein langsames lokales Modell also erhöhen, ohne dass Claude Code oder Codex einen Turn doppelt sendet. Ein hängendes Upstream-Modell hält einen Turn dann aber auch länger auf, bevor das Gateway den Stream abbricht. Ein Wert über 600 hebt auch das Anfrage-Timeout des Gateways entsprechend an: Es begrenzt eine ganze nicht gestreamte Antwort, auf die ein Agent ausweicht, wenn ein Stream abbricht, und wie lange ein Upstream-Modell brauchen darf, um eine gestreamte Antwort zu beginnen. Sekunden. | +| `SANDBOX_LLM_GATEWAY_PROVIDER_CONCURRENCY` | `512` | **Optional.** Wie viele Anfragen das Modell-Gateway der Sandbox gleichzeitig an einen eingebauten Anbieter schickt (OpenAI, Anthropic, OpenRouter und die anderen Anbieter, die das Gateway selbst umsetzt), den sich alle Organisationen teilen. Das Backend liest den Wert und konfiguriert damit das Gateway. Das Gateway hält für jeden Anbieter so viele Worker bereit, ob ihn etwas aufruft oder nicht; ein höherer Wert kostet also Gateway-Speicher. Eine Anfrage, die alle Worker beschäftigt vorfindet, wartet in einer Warteschlange, die 16-mal so lang ist. Eine ganze Zahl von 1 bis 5.000. | +| `SANDBOX_LLM_GATEWAY_CUSTOM_PROVIDER_CONCURRENCY` | `64` | **Optional.** Dasselbe für einen eigenen Anbieter. Das Backend richtet ihn im Gateway für jede Organisation und jedes Modell einmal ein, die Zahl dieser Anbieter wächst also mit Organisationen und Modellen, und jeder hält seine Worker wie ein eingebauter. Der Anthropic-Weg eines eingebauten Anbieters für Agent-Laufzeiten (Claude Code über den Anthropic-Endpunkt von OpenRouter) erhält einen eigenen Anbieter je Organisation und Modell und richtet sich nach diesem Wert. Die Sandbox-Sitzungen einer Organisation haben selten mehr als ein paar Modellaufrufe gleichzeitig auf einem Modell offen. Erhöhe den Wert, wenn die API-Schlüssel einer Organisation mehr Anfragen gleichzeitig an ein eigenes Modell schicken. Eine ganze Zahl von 1 bis 5.000. | +| `SANDBOX_LLM_GATEWAY_LOG_RETENTION_DAYS` | `3` | **Optional.** Wie viele Tage das Modell-Gateway der Sandbox sein Anfrageprotokoll aufbewahrt: eine Zeile pro Modellaufruf mit Modell, Tokens, Kosten und Dauer, nie ein Prompt oder eine Antwort. Tale liest dieses Protokoll nicht. Budgets, Ausgaben und Nutzung stammen aus den Budgetzählern der Gateway-Schlüssel, ein kürzeres Protokoll ändert also keinen dieser Werte. Das Backend übergibt den Wert an das Gateway, das ihn bei seinem ersten Neustart anwendet, nachdem das Backend ihn übergeben hat: Dann löscht es ältere Zeilen und danach etwa einmal täglich. Ein `tale deploy` startet das Gateway neu, bevor das neue Backend den Wert übergibt; ein geänderter Wert gilt deshalb ab der folgenden Bereitstellung. Soll er früher gelten, starte den Dienst `sandbox-llm-gateway` einmal neu, nachdem die erste Sandbox-Sitzung gestartet ist. Der Speicher verwendet ihren Platz wieder, statt weiter zu wachsen. Eine ganze Zahl von Tagen, mindestens 1; jeden anderen Wert ignoriert das Backend mit einer Warnung im Log. | Untersuche zuerst, warum die Ausgabe nicht mehr gelesen wird. Die Frist begrenzt verwaiste Ausgabeströme, nicht die gesamte Aufgabendauer. Erstelle die betroffenen Backend-Rollen nach einer Umgebungsänderung neu. +Eine geänderte Worker-Zahl des Gateways erreicht einen Anbieter, sobald eine Organisation, die ihn nutzt, die nächste Sandbox-Sitzung startet oder die Modell-Endpunkte aufruft. Eine niedrigere Zahl erreicht auch alle anderen Anbieter, die das Gateway hält: Nach einem Neustart passt das Backend sie zwei bis fünf Minuten nach seiner ersten Sandbox-Sitzung oder Anfrage an die Modell-Endpunkte an. + +Eine Ausnahme ist ein Anbieter, dessen Upstream-Host sich nicht mehr auflösen lässt, etwa der eines entfernten Connectors oder eines Hosts, den du aus deinem Netzwerk genommen hast: Das Gateway lehnt es ab, ihn neu zu schreiben, er behält also seine Worker, und das Backend protokolliert nach jedem Neustart eine Warnung, die ihn nennt. Lösche einen solchen Anbieter aus dem Gateway. Ein Anbieter, der noch genutzt wird, wird bei seiner nächsten Sandbox-Sitzung oder Anfrage an die Modell-Endpunkte neu eingerichtet. Schicke die Anfrage aus einem Backend-Container, der das Gateway erreicht und sein Admin-Passwort kennt; auf einem Host mit `tale deploy` enthält sein Name `-backend-api`: + +```bash +docker exec sh -c 'curl -fsS -X DELETE -u "${SANDBOX_LLM_GATEWAY_ADMIN_USERNAME:-admin}:$SANDBOX_LLM_GATEWAY_ADMIN_PASSWORD" "${SANDBOX_LLM_GATEWAY_URL:-http://sandbox-llm-gateway:8080}/api/providers/"' +``` + +Unter Kubernetes verwendest du `kubectl exec -n tale deploy/backend-api --` statt `docker exec `. + +Das Gateway startet die Worker aller Anbieter beim Hochfahren, bevor das Backend es erreicht. Anbieter, die mit mehr Workern gespeichert sind, als diese Werte vorgeben (der eigene Default des Gateways ist 1.000), können mehr Speicher brauchen als das Limit des Gateways, 512 MiB mit `tale deploy` und im Kubernetes-Manifest. Das Gateway wird dann bei jedem Start beendet. Lösche sein Volume nicht: Es enthält das Admin-Konto des Gateways und die Schlüssel, die es ausgegeben hat. Erhöhe stattdessen das Limit, bis das Gateway startet: auf einem Host mit `tale deploy` mit `docker update --memory 2g --memory-swap 2g ` für den Container, dessen Name auf `-sandbox-llm-gateway` endet; unter Kubernetes über `resources.limits.memory` seines Deployments. Starte dann eine Sandbox-Sitzung oder rufe die Modell-Endpunkte auf und warte auf die Logzeile `[llm-gateway] provider worker resize finished` des Backends, die zwei bis fünf Minuten später erscheint. Sie zählt die Anbieter, die das Backend angepasst hat, die das Gateway abgelehnt hat und die das Backend nicht bestätigen konnte. Ein abgelehnter oder unbestätigter Anbieter behält seine Worker, und eine Warnung vor der Zeile nennt ihn; ein neu gestartetes Backend versucht einen unbestätigten Anbieter erneut. Lösche einen abgelehnten Anbieter, dessen Upstream-Host sich nicht mehr auflösen lässt, wie oben beschrieben, bevor du das Limit zurücksetzt. Setze das Limit danach mit `docker update --memory 512m --memory-swap 1g ` und `docker restart ` zurück, unter Kubernetes auf den ursprünglichen Wert des Deployments. + ## Video-Link-Ingestion (yt-dlp) Der Worker verwendet diese Werte zum Abrufen von Videotranskripten. Sein Image enthält yt-dlp und ein PO-Token-Plugin. [Video-Import](/de/self-hosted/configuration/video-ingestion) hilft bei Quellenbeschränkungen, Egress-Problemen und berechtigten Sitzungen. Erstelle den Worker nach Änderungen seiner Umgebung neu. Erneutes Lesen einer Prozessvariablen lädt `.env` nicht nach. diff --git a/docs/de/self-hosted/install/cli-install.md b/docs/de/self-hosted/install/cli-install.md index 3fa548ce3a..4d35709de5 100644 --- a/docs/de/self-hosted/install/cli-install.md +++ b/docs/de/self-hosted/install/cli-install.md @@ -14,8 +14,8 @@ Für deine erste Instanz nutze den [Schnellstart](/de/self-hosted/install/quicks Du brauchst: - Einen Rechner mit macOS, Linux oder Windows mit PowerShell. -- Für lokale Container: Docker mit Compose und einen laufenden Docker-Daemon. -- Für einen entfernten Workspace: Zugriff auf dessen Docker-Daemon, üblicherweise über einen SSH-Docker-Kontext. Der Benutzer auf dem Zielhost muss Docker ausführen dürfen. +- Für lokale Container: Docker Engine 24.0 oder neuer mit Compose und einen laufenden Docker-Daemon. Die Schichten der Tale-Images sind mit zstd komprimiert, und Docker lädt solche Schichten ab Engine 23.0. `tale doctor` meldet eine ältere Engine; `tale dev` und `tale deploy` brechen dann ab, bevor sie Images herunterladen. +- Für einen entfernten Workspace: Zugriff auf dessen Docker-Daemon mit Docker Engine 24.0 oder neuer, üblicherweise über einen SSH-Docker-Kontext. Der Benutzer auf dem Zielhost muss Docker ausführen dürfen. Den mitgelieferten Objektspeicher gibt es derzeit nur als `linux/amd64`-Image. Auf ARM64-Hosts brauchen lokale Entwicklung und Workspace-Deployments deshalb eine funktionierende amd64-Emulation: Docker Desktop bringt sie mit; auf einem eigenständigen Linux-Docker-Host muss [QEMU auf dem Host registriert sein](https://docs.docker.com/build/building/multi-platform/#install-qemu-manually). Tale wählt das amd64-Image aus, installiert aber keine Emulation. Verwaltete Bundles benötigen weiterhin native Images für ihre deklarierte Architektur. Ein verwaltetes ARM64-Deployment ist daher erst mit einem nativen Objektspeicher-Image möglich. @@ -99,12 +99,12 @@ Befehle beenden mit `0` bei Erfolg, `2` bei einem Nutzungsfehler, `3` bei einer ### Einrichtung -`tale doctor` — prüft die Voraussetzungen für einen lokalen Start, ohne ein Projekt anzulegen, Software zu installieren oder Konfiguration zu ändern. Der Befehl prüft Docker-Daemon, Compose-Unterstützung und Linux-Container-Modus, meldet die Daemon-Architektur und untersucht lokale Ports. Bei einem entfernten Docker-Kontext entfällt die lokale Portprüfung. Prüfe Warnungen zu ARM64 oder belegten Ports; eine bestehende Instanz kann den Port bereits verwenden. +`tale doctor` — prüft die Voraussetzungen für einen lokalen Start, ohne ein Projekt anzulegen, Software zu installieren oder Konfiguration zu ändern. Der Befehl prüft Docker-Daemon, die Version der Docker Engine, Compose-Unterstützung und Linux-Container-Modus, meldet die Daemon-Architektur und untersucht lokale Ports. Bei einem entfernten Docker-Kontext entfällt die lokale Portprüfung. Prüfe Warnungen zu ARM64 oder belegten Ports; eine bestehende Instanz kann den Port bereits verwenden. - `-p, --port ` — zu prüfender HTTPS-Port (Standard `443`); Sandbox-Port `8003` wird ebenfalls geprüft. - `--json` — gibt die Prüfergebnisse als maschinenlesbares JSON aus. -Fehler bei Docker, Compose, einem nicht unterstützten Container-Modus oder die Wahl von HTTPS-Port `8003` führen zum Exit-Code `3`. Warnungen allein ergeben `0`; Image-Downloads, Speicherkapazität und Modellanbieter sind damit nicht geprüft. Prüfe einen anderen Port mit `tale doctor --port 8443` und verwende denselben Port bei `tale dev`. +Fehler bei Docker, Compose, einer Docker Engine älter als 24.0, einem nicht unterstützten Container-Modus oder die Wahl von HTTPS-Port `8003` führen zum Exit-Code `3`. Warnungen allein ergeben `0`; Image-Downloads, Speicherkapazität und Modellanbieter sind damit nicht geprüft. Prüfe einen anderen Port mit `tale doctor --port 8443` und verwende denselben Port bei `tale dev`. `tale init [directory]` — ein Projekt anlegen: erzeugt die Beispiel-Configs, `AGENTS.md` + einen `CLAUDE.md`-Verweis sowie eine lokale Standard-`.env` (localhost, selbstsigniertes Zertifikat, generierte Secrets). Docker braucht es nicht; Produktiv-Domain und TLS werden später bei `tale deploy` gewählt. Im Terminal fragt es nach einem Projektnamen, wenn `directory` fehlt, bestätigt vor dem Überschreiben eines bestehenden Projekts und fragt einmal, ob Agents in Sandboxes `docker` ausführen dürfen (Standard: nein — die Freigabe startet einen privilegierten inneren Docker); nicht-interaktive Läufe überspringen alle Rückfragen. `directory` ist optional (Standard: das aktuelle Verzeichnis). @@ -300,6 +300,14 @@ Docker- und HTTPS-Beobachtungen haben eigene Abbruchfristen und teilen sich ein Ältere Bundles bleiben einsetzbar. Für diese Prüfung brauchen sie jedoch ein Migrationsinventar aus dem Quellstand und kompatible Server, die Prozessidentitäten ausgeben. Bereite ein geprüftes Bundle vor und wende es über den normalen Deployment-Ablauf vollständig an, bevor du seinen Prüfnachweis erstellst. Der Nachweis belegt den beobachteten Zustand zu seinem Zeitstempel; er garantiert keinen späteren Routing- oder Serverzustand. Wiederhole die Prüfung, wenn du aktuelle Belege brauchst. +#### Gespeicherten Zustand vor einem Rollout prüfen + +`tale --json deploy observe --spec --cli-ref --deployment-ref --machine-id-sha256 ` erfasst die Identitäten der laufenden Images, Migrationsverzeichnisse, Metadaten zu Korpus und Speicherplatz sowie Nachweise zur gespeicherten nativen Konfiguration. Führe die festgelegte kompilierte CLI auf dem geprüften Linux-Host mit dessen lokalem Docker-Socket aus. Übergib private JSON-Daten über stdin als `{"environment":{"UPPERCASE_ENV_NAME":"value"}}`, mit ausschließlich den Variablen, die die geprüfte Spezifikation benötigt. Umgebungsvariablen dienen nicht als Ersatz. Die Eingabe ist auf 64 KiB, 128 Schlüssel und 8192 Byte pro Wert begrenzt. + +Der Befehl verwendet vorhandene Zugangsdaten sowie die exakt gespeicherten Konto- und Organisations-IDs. Er liest erhaltene Pack-Dateien ohne erneute Kompilierung, prüft aktuelle native Versionen, Dateien und die Eigentümer der enthaltenen Skills und kontrolliert anschließend Dateizustand und Containeridentitäten erneut. Er erstellt nur temporäre Hilfsdateien und Anmeldesitzungen, entfernt die Hilfsdateien danach und meldet sich ab. Er legt keine Identitäten an, bereitet keine Konfiguration vor, wendet keine an, migriert nicht, startet nichts neu, bereinigt keine Ressourcen und hält keine Cutover-Sperre. Docker- und native Lesezugriffe sind begrenzt; überwache den Prozess extern, um auch Wartezeiten auf das Dateisystem zu begrenzen. + +Eine vollständige Beobachtung liefert `ok:true` und `data.complete:true`. Fehlen ältere Zustands- oder Eigentumsnachweise, enthält der Bericht die verfügbaren Host- und Datenbankdaten mit `ok:false`, `data.complete:false`, einem festgelegten Ursachencode und Exit-Code `3`. Bewahre ihn für die Untersuchung auf. Ungültige Eingaben, abweichende Identitäten oder ein geänderter Zustand führen zur Ablehnung. Kein Ergebnis bestätigt den Ready-Zustand, erlaubt einen Cutover oder beweist, dass Packs ein späteres Deployment überstehen. Dafür gilt weiterhin der normale geprüfte Deployment- und Abnahmeablauf. + #### Native Identität bereitstellen `deploy provision [--bundle ]` ist die lokale Backend-Phase des Bundle-Deployments. Sie liest höchstens 64 KiB privates JSON von stdin, weist das lokale Konto und die ausgewählte Organisation nach und meldet die Sitzung vor der Erfolgsmeldung ab. Die Felder umfassen `origin`, `email`, `password`, `slug`, `name`, `ssoEnabled`, optionale Entra-Zugangsdaten und `nativeClients`. Standardmäßig bleibt das bestehende Konto erforderlich. Explizites `identity.bootstrap: "fresh"` erlaubt die Anlage des ersten lokalen Kontos und der Organisation. Ein Bundle bindet diese Wahl und die vorbereiteten Konfigurationen vor nativen Änderungen. `deploy provision` verweigert Workspace-Flags und `--dry-run`; nutze lesende Bundle- und Konfigurationsprüfungen. Die optionalen Erwartungen `--cli-ref` und `--deployment-ref` erfordern `--bundle` und greifen vor der Anmeldung. @@ -414,6 +422,10 @@ Mit `agent-tools` verwaltest du ausschließlich die Tool-Berechtigungen eines vo Zum Anwenden brauchst du Bearbeitungsrechte für das aktive Projekt. Der Agent darf nicht von der Plattform verwaltet werden. Mitglieder können die begrenzte Konfiguration lesen. Alle anderen Agentenfelder bleiben unverändert, einschließlich Anweisungen, Modell und der exakten Zugriffsrechte auf Secrets. Der native Hash schützt vor konkurrierenden Tool-Änderungen; eine geänderte Auswahl macht auch veraltete vollständige Agentenspeicherungen ungültig. Eine gleichwertige Auswahl ändert weder Zeitstempel noch Audit-Einträge. Fehlt der Runtime die angeforderte Fähigkeit, lehnt sie den Vorgang ab. Lies die Tools nach dem Anwenden zurück und bewahre den ausstehenden Beleg auf, um einen unterbrochenen Vorgang fortzusetzen. +Mit `agent-model` legst du die Ausführungskonfiguration für künftige Starts eines vorhandenen Agenten fest. `config` benötigt die exakten Werte für `projectId` und `agentId` sowie `harness`, `model` und einen ausdrücklich gewählten `modelProvider` aus dem nativen Katalog. Die Plattform prüft diese Kombination und die verfügbaren Zugangsdaten; sie weicht nicht auf einen anderen Anbieter aus. Es gelten dieselben Bearbeitungsrechte für das Projekt und dieselbe Einschränkung für plattformverwaltete Agenten. Anweisungen, Tools, Skills, Konnektoren und Secret-Berechtigungen bleiben unverändert. Bereits eingereihte und laufende Arbeit behält die vollständige Konfiguration, die bei ihrer Zulassung gespeichert wurde. Eine identische Auswahl ändert nichts; eine geänderte Auswahl macht veraltete vollständige Agentenspeicherungen ungültig. Ein bisher nicht festgelegter Anbieter erscheint beim Zurücklesen als `null`, in einer Deklaration musst du jedoch einen auswählen. Nutze die vorhandenen Befehle zum Planen, Anwenden und Zurücklesen und bewahre bei einer Unterbrechung den Beleg auf. + +Mit `task-review-context` registrierst du eine unbenutzte operative Aufgabe für genau einen Prüfer. `config` enthält `projectId`, `taskId`, `reviewerAgentId` und `enabled`. Standardmäßig muss die Aufgabe bereits existieren und darf keinen Ausführungs- oder Prüfverlauf und keine Umsetzungsarbeit enthalten. Zum Erstellen ergänzt du `createIfMissing: true` neben `kind` und `config` und wählst eine feste UUID für `taskId`. Mit Bearbeitungsrechten für das Projekt kannst du die Backlog-Aufgabe dann in einer Transaktion erstellen und registrieren. Scheitert die Registrierung, bleiben weder Aufgabe noch Änderungen an Zählern oder Audit-Protokoll zurück. Der Prüfer benötigt bereits `task_review`; die Registrierung vergibt keine Tools und startet keine Arbeit. Bestehende Aufgaben müssen weiterhin die Prüfungen für unbenutzte Aufgaben bestehen; belegte Identitäten werden nie überschrieben. Behalte bei einer Unterbrechung dieselbe ID und den ausstehenden Beleg. Beim Deaktivieren bleiben Prüfer und Zweck erhalten. + Aufbewahrungs- und DSAR-Richtlinien brauchen ihre eigenen nativen Workflows. Pausiere Uploads, Synchronisation und Crawls, bevor du das Embedding-Modell wechselst. Die CLI prüft die Anzahl der Dokumente und Websites der gesamten Organisation; sie sperrt den Import nicht und migriert keine bestehenden Vektoren. Hat die Organisation Dokumente oder registrierte Websites, braucht ein Modellwechsel eine separate native Indexmigration. Eine Änderung, die nur `minSimilarity`, `maxConcurrentRequests`, `minTokensPerSecond`, `maxTokensPerMinute` oder `maxRequestsPerMinute` betrifft, lässt die vorhandenen Vektoren gültig; für sie entfällt diese Prüfung. Instanz-Einstellungen erfordern zusätzlich die native Freigabeliste für Deployment-Editoren. Bei Boot-Einstellungen meldet der einzelne Konfigurationsaufruf `restartRequired`; Speichern allein aktiviert diese Einstellungen noch nicht. Prüfe die Folgen im Plan vor dem Anwenden. Verwaltete Deployments nutzen denselben Ablauf über `configuration`. Ergänze die Deployment-Deklaration um dieses Beispiel, wenn ein externer Betreiber den Anbieter bereits bereitstellt. Ersetze den synthetischen Endpunkt und Katalog durch geprüfte Werte und übergib `EXTERNAL_PROVIDER_SECRET` aus deinem Secret Manager: @@ -534,6 +546,15 @@ Der öffentliche Nachweis `native.configuration` enthält pro Ressource den beab `tale status` — den aktuellen Deployment-Status anzeigen. Keine Argumente. +`tale deploy smoke --url ` — prüft ein laufendes Deployment über seine öffentliche URL, so wie ein Browser es erreicht. Ohne `--full` sendet der Befehl keine Zugangsdaten und schreibt nichts, du kannst ihn also gegen jedes Deployment laufen lassen, auch gegen die Produktion. Er prüft `/api/health` (mit `--expected-version ` auch die Version), die Bereitschaft der API, die App-Shell und ihr Skript, eine anonyme Sitzungsabfrage und ob `/events` und `/api/app` Besucher ohne Sitzung abweisen. Unverschlüsseltes `http://` ist nur für `localhost` erlaubt; bei einer eigenen Zertifizierungsstelle setzt du `NODE_EXTRA_CA_CERTS` auf deren Stammzertifikat. + +- `--full` — meldet sich zusätzlich mit einem eigens dafür angelegten Konto an und durchläuft einen Nutzerablauf: Er öffnet den Live-Update-Stream der Organisation, erstellt eine Aufgabe, wartet auf deren Live-Update, liest sie zurück und löscht sie (ein Konto, das keine Aufgaben löschen darf, archiviert sie stattdessen). Hinterlege das Konto in `TALE_SMOKE_EMAIL` und `TALE_SMOKE_PASSWORD`; es darf keinen zweiten Faktor verlangen. Sieht das Konto kein Projekt, legt der erste Lauf eines namens „Tale deployment smoke“ an, das spätere Läufe wiederverwenden. +- `--chat` — führt mit `--full` zusätzlich eine Chat-Runde mit dem ersten Modell aus, das dem Konto zur Verfügung steht. Die Runde verbraucht Modell-Tokens; die Unterhaltung landet danach im Papierkorb, eine noch laufende Runde wird vorher gestoppt. +- `--organization `, `--project ` — wo der Ablauf läuft; standardmäßig in der ersten Organisation und dem ersten Projekt des Kontos. +- `--timeout ` — Obergrenze für jede Anfrage und jede Wartezeit (Standard `15`); `--turn-timeout ` begrenzt die Chat-Runde (Standard `120`). + +Mit `--json` führt der Bericht jede Prüfung mit Status (`pass`, `fail` oder `skip`), Dauer und Grund auf. Exit-Code `0` heißt, dass alle Prüfungen bestanden wurden, `5`, dass mindestens eine fehlgeschlagen ist, und `2`, dass eine Option ungültig ist. Der vollständige Ablauf entfernt seine Aufgabe (gelöscht oder archiviert) und meldet sich ab, auch wenn eine Prüfung fehlschlägt. + `tale logs ` — Logs eines Dienstes streamen (`service` ist einer der laufenden Dienste; auf einem reinen Dev-Stack ohne Deployment fällt der Befehl auf den Dev-Container zurück). - `-f, --follow` — der Log-Ausgabe folgen, während sie geschrieben wird. diff --git a/docs/de/self-hosted/install/kubernetes.md b/docs/de/self-hosted/install/kubernetes.md index 23ab7c01ab..31d157e9fd 100644 --- a/docs/de/self-hosted/install/kubernetes.md +++ b/docs/de/self-hosted/install/kubernetes.md @@ -15,6 +15,7 @@ Tale läuft auf Kubernetes, wenn du den [Dienstvertrag](/de/self-hosted/install/ | Nodes, die `NET_ADMIN` gewähren und ip6tables bereitstellen oder die IPv6-Sysctls erlauben | Der Egress-Proxy installiert beim Start seine Firewall und verweigert den Start ohne sie. | | Ports 80 und 443 unter der öffentlichen Adresse erreichbar | Caddy besorgt sich im Modus `selfsigned` und `letsencrypt` die Zertifikate selbst. Hinter einem Ingress, der TLS terminiert, setzt du `TLS_MODE=external`. | | Pull-Zugriff auf `ghcr.io/tale-project/tale/*` auf jedem Node, einschließlich des Sandbox-Runtime-Images | Sitzungs-Pods starten aus `SANDBOX_RUNTIME_IMAGE`. Ein Node, der es nicht laden kann, lässt die erste dort eingeplante Sitzung scheitern. | +| Eine Container-Runtime, die zstd-komprimierte Schichten entpackt, etwa containerd 1.5 oder neuer | Die Schichten der Tale-Images sind mit zstd komprimiert. Ein Node, dessen Runtime sie nicht entpacken kann, lädt die Images nicht, und dort startet kein Pod aus ihnen. | | Eine sysbox- oder kata-RuntimeClass, wenn Agenten Docker in ihrer Sandbox brauchen | Ohne sie bleibt `SANDBOX_DOCKER_IN_CONTAINER=false`. Die Stufe `runc` bräuchte privilegierte Pods. | | `kubectl` und `envsubst` auf dem Rechner, der die Manifeste anwendet | Die Manifeste enthalten eine Variable `${VERSION}`, die kubectl nicht expandiert. | @@ -40,7 +41,7 @@ Jeder Pod unten setzt `enableServiceLinks: false`. Andernfalls injiziert Kuberne | `proxy` | Deployment mit Strategie `Recreate`; `hostPort` 80 und 443; PVC für `/data` | Der Zertifikatspeicher überlebt Neustarts auf dem PVC. | | `sandbox` | ServiceAccount, Role, RoleBinding, Deployment; Service auf 8003 | `SANDBOX_BACKEND=kubernetes`; `config-data` nur lesend unter `/app/platform-config`. Kein Docker-Socket. | | `sandbox-egress` | Deployment; Service auf 3128 | Der ausgelieferte Capability-Satz, keine Sysctls. | -| `sandbox-llm-gateway` | Deployment mit Strategie `Recreate`, PVC unter `/app/data`; Services `sandbox-llm-gateway` und `llm-gateway` auf 8080 | Das Image läuft als uid 1000; `fsGroup: 1000` lässt es seinen Zustand schreiben. Das Gateway liest `SANDBOX_LLM_GATEWAY_ADMIN_PASSWORD` aus `tale-env`: Solange es kein Admin-Konto hat, legt es eines nur für einen Aufrufer an, der dieses Geheimnis vorweist. | +| `sandbox-llm-gateway` | Deployment mit Strategie `Recreate`, PVC unter `/app/data`; Services `sandbox-llm-gateway` und `llm-gateway` auf 8080 | Das Image läuft als uid 1000; `fsGroup: 1000` lässt es seinen Zustand schreiben. Das Gateway liest `SANDBOX_LLM_GATEWAY_ADMIN_PASSWORD` aus `tale-env`: Solange es kein Admin-Konto hat, legt es eines nur für einen Aufrufer an, der dieses Geheimnis vorweist. Mit `terminationGracePeriodSeconds: 90` gibt ein Rollout dem alten Pod bis zu 90 Sekunden, um laufende Modellaufrufe samt gestreamter Antworten zu beenden; seine Ausgabenzähler speichert er am Ende nur, wenn sie innerhalb von 30 Sekunden nach dem Stopp enden. Neue Aufrufe nimmt er in dieser Zeit nicht an, und der neue Pod startet, sobald er beendet ist. | | `bgutil-provider` | Deployment; Service auf 4416 | Optionaler Token-Anbieter für Videos. | Die Prüfungen übertragen die Compose-Healthchecks: @@ -53,7 +54,7 @@ Die Prüfungen übertragen die Compose-Healthchecks: | `object-store` | keine | `mc ready local` | keine | | `proxy` | keine | `GET /health` auf 2020 | keine | | `sandbox` | `GET /health` auf 8003 | `GET /health` auf 8003 | keine | -| `sandbox-egress` | keine | `curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/` | keine | +| `sandbox-egress` | keine | `curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/ && nslookup -type=a -timeout=1 sandbox-egress-health.invalid 127.0.0.1` | keine | | `sandbox-llm-gateway` | keine | `GET /health` auf 8080 | keine | Kubernetes kennt kein `depends_on`. Eine Backend-Rolle, die startet, bevor Postgres antwortet, beendet sich einmal mit `ECONNREFUSED`; die Neustartrichtlinie heilt das. @@ -505,8 +506,9 @@ spec: add: ['NET_ADMIN', 'DAC_OVERRIDE', 'CHOWN', 'SETUID', 'SETGID', 'NET_BIND_SERVICE', 'KILL'] ports: [{ name: proxy, containerPort: 3128 }] readinessProbe: - exec: { command: [sh, -c, "curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/"] } + exec: { command: [sh, -c, "curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/ && nslookup -type=a -timeout=1 sandbox-egress-health.invalid 127.0.0.1"] } periodSeconds: 10 + timeoutSeconds: 5 resources: requests: { cpu: 50m, memory: 64Mi } limits: { memory: 512Mi } @@ -544,6 +546,7 @@ spec: spec: enableServiceLinks: false automountServiceAccountToken: false + terminationGracePeriodSeconds: 90 securityContext: { fsGroup: 1000 } containers: - name: gateway @@ -642,14 +645,113 @@ spec: | `SANDBOX_K8S_NAMESPACE` | Der Namespace, in dem Sitzungs-Pods, Secrets und Workspace-Claims entstehen; in dieser Aufteilung der Namespace des Spawners selbst. Standard `tale-sandbox`. | | `SANDBOX_RUNTIME_IMAGE` | Das passende Tale-Sandbox-Runtime-Image, für jeden Node verfügbar. | | `NODE_EXTRA_CA_CERTS` | Die CA-Datei des Clusters, im Spawner normalerweise `/var/run/secrets/kubernetes.io/serviceaccount/ca.crt`. Sie ist der einzige CA-Vertrauensweg, den der Spawner beachtet; lass die TLS-Prüfung eingeschaltet. | -| `SANDBOX_K8S_WORKSPACE_SIZE_LIMIT` | Die Größe des `/agent`-Workspace-Claims jeder Agent-Session, Standard `4Gi`; begrenzt auch den temporären Workspace eines Crawler-Renders, der ohne Claim auskommt, weil er nie fortgesetzt wird, und bei aktiviertem innerem Docker dessen temporären Speicher. | +| `SANDBOX_K8S_WORKSPACE_SIZE_LIMIT` | Die Größe des `/agent`-Workspace-Claims jeder Agent-Session, Standard `4Gi`; begrenzt auch den temporären Workspace eines Crawler-Renders, der ohne Claim auskommt, weil er nie fortgesetzt wird. | +| `SANDBOX_K8S_DOCKER_STORAGE_SIZE_LIMIT` | Die Größe des temporären Speichers für das innere Docker einer Agent-Session, die Docker in ihrer Sandbox ausführt, Standard `20Gi`. Wächst eine Session darüber hinaus, räumt Kubernetes ihren Pod (Eviction); bemiss den Wert deshalb nach den größten Images, die deine Agents laden und bauen. Releases vor dieser Einstellung haben den Speicher mit `SANDBOX_K8S_WORKSPACE_SIZE_LIMIT` bemessen: Hast du diesen Wert gesenkt, um den Speicher klein zu halten, setze beim Upgrade auch diese Variable, sonst wächst der Speicher auf `20Gi`. Der Spawner warnt beim Start, wenn `SANDBOX_K8S_WORKSPACE_SIZE_LIMIT` ohne sie gesetzt ist. | +| `SANDBOX_K8S_EPHEMERAL_STORAGE_REQUEST` / `SANDBOX_K8S_EPHEMERAL_STORAGE_LIMIT` | Wie viel Platz auf der Festplatte des Nodes ein Session-Pod anfordert, Standard `256Mi`, und wie viel er dort außerhalb seines temporären Workspaces und Docker-Speichers schreiben darf, Standard `2Gi`. Die Grenze eines Pods rechnet diese Speicher hinzu: `2Gi` für einen Agent, `6Gi` für einen Crawler-Render, `22Gi` mit Docker in der Sandbox. Überschreitet eine Agent-Session ihre Grenze, räumt Kubernetes nur ihren Pod, und die nächste Aufgabe setzt sie mit unversehrtem Workspace fort, statt dass sie den Node füllt, bis Kubernetes die Pods der Plattform räumt. Melden deine Nodes keine Kapazität für Ephemeral Storage, etwa in manchen Rootless-Clustern, setze die Anforderung auf `0`. | | `SANDBOX_K8S_CPU_REQUEST` / `SANDBOX_K8S_MEMORY_REQUEST` | Was jeder Session-Pod beim Scheduler anfordert, als Kubernetes-Mengenangaben. Ohne Angabe fordert ein Agent-Pod `250m` und `512Mi` an (`1Gi` mit Docker in der Sandbox), ein Crawler-Render `250m` und `512Mi`; eine Anforderung liegt nie über der Grenze des Pods. Erhöhe die Werte, wenn Agents auf deinen Nodes schwerere Builds ausführen, damit der Scheduler nicht mehr Sessions auf einen Node legt, als er tragen kann. | +| `SANDBOX_K8S_NODE_SELECTOR` / `SANDBOX_K8S_TOLERATIONS` | Optional. Die Node-Labels, die jeder Session-Pod erfüllen muss, als JSON-Objekt, und die Taints, die er toleriert, als JSON-Array von Pod-Tolerations. Ohne Angabe kann eine Session auf jedem Node laufen; siehe unten. | +| `SANDBOX_K8S_PRIORITY_CLASS` | Optional. Die PriorityClass jedes Session-Pods. | | `SANDBOX_K8S_CACHE_STORAGECLASS` | Die StorageClass der Workspace-Claims; ohne Wert gilt der Cluster-Standard. | | `SANDBOX_RUNTIME` / `SANDBOX_RUNTIME_CLASS` | Eine unterstützte Laufzeitstufe und bei Bedarf der Name der installierten RuntimeClass. | | `SANDBOX_EGRESS_PROXY` | Der Egress-Service, den die Sitzungen nutzen, Standard `http://sandbox-egress:3128`. | Der Spawner skaliert horizontal. Jedes Replikat findet eine Sitzung, die es nicht selbst angelegt hat, über den deterministischen Pod-Namen und übernimmt sie; exec, Stopp und Zerstören funktionieren daher über jedes Replikat, das der Service auswählt. `SANDBOX_MAX_SESSIONS` zählt den Namespace, gleichzeitige Aufnahmen auf mehreren Replikaten können den Wert aber kurz überschreiten; eine ResourceQuota liefert die harte Grenze. Der [Kubernetes-Vertrag der Sandbox](https://github.com/tale-project/tale/blob/main/services/sandbox/docs/kubernetes.md) dokumentiert die Pod-Form und die Laufzeitdetails. +### Sessions von den Nodes der Plattform fernhalten + +Session-Pods führen den Code aus, den deine Agents schreiben, und mit Docker in der Sandbox laufen sie auf der Stufe `runc` privilegiert. Ohne Platzierungseinstellungen legt der Scheduler sie auf einen beliebigen Node, neben Postgres und die Anwendungsrollen, wo eine ausgelastete Session um dieselbe CPU, denselben Arbeitsspeicher und dieselbe Festplatte konkurriert. Damit Sessions eigene Nodes bekommen, versiehst du diese Nodes mit einem Label und einem Taint: + +```bash +kubectl label node tale.dev/sandbox=true +kubectl taint node tale.dev/sandbox=true:NoSchedule +``` + +Ergänze dann die passenden Einstellungen in der `env` des Spawners in `40-sandbox.yaml`: + +```yaml + - { name: SANDBOX_K8S_NODE_SELECTOR, value: '{"tale.dev/sandbox":"true"}' } + - { name: SANDBOX_K8S_TOLERATIONS, value: '[{"key":"tale.dev/sandbox","operator":"Exists","effect":"NoSchedule"}]' } + - { name: SANDBOX_K8S_PRIORITY_CLASS, value: tale-sandbox-session } +``` + +Der Taint hält andere Pods von diesen Nodes fern, der Selektor hält die Sessions dort. Die PriorityClass stuft Sessions unter der Plattform ein: Der Scheduler darf eine Session verdrängen, um einen Pod der Plattform unterzubringen, und wenn einem Node Arbeitsspeicher oder Festplatte ausgehen, berücksichtigt das Kubelet die Priorität und räumt Sessions früher. Mit `preemptionPolicy: Never` verdrängt eine Session selbst nie einen anderen Pod. Ein Cluster-Administrator legt die Klasse einmal an; der Spawner braucht dafür keine zusätzliche Berechtigung: + +```yaml +apiVersion: scheduling.k8s.io/v1 +kind: PriorityClass +metadata: { name: tale-sandbox-session } +value: -10 +preemptionPolicy: Never +globalDefault: false +description: Tale sandbox sessions yield to the platform. +``` + +Die Einstellungen gelten für jeden Session-Pod, auch für Crawler-Renders, und zwar für die Sessions, die der Spawner nach seinem Neustart anlegt; laufende Sessions behalten ihre Platzierung. Ein fehlerhafter Wert verhindert den Start des Spawners. Passt ein gültiger Selektor auf keinen Node oder fehlt die Toleration für einen Taint, bleibt ein Session-Pod ausstehend: Der Spawner protokolliert den Grund des Schedulers, und das Anlegen schlägt mit diesem Grund fehl, sobald sein Startbudget abgelaufen ist. Bei Node-lokalem Speicher bleibt der Workspace-Claim einer gestoppten Session auf ihrem Node; behalte diesen Node im Selektor, sonst lässt sich die Session nicht fortsetzen. + +### Sandbox-Images vorab laden + +Auf Kubernetes lädt nicht der Spawner die Images, sondern das Kubelet für jeden Pod. Die erste Session auf einem Node lädt deshalb das Runtime-Image, einen Download von etwa 2 GB, innerhalb ihres Startbudgets (`SANDBOX_SESSION_CREATE_TIMEOUT_MS`, standardmäßig 180 Sekunden), und die Image-Garbage-Collection des Kubelets kann das Image wieder entfernen, sobald kein Pod es nutzt. Dieses optionale DaemonSet lädt die Sandbox-Images vor der ersten Session auf jeden Node und hält sie dort: Jeder Init-Container startet ein Image und beendet sich sofort, der Pause-Container hält den Pod am Leben, und solange der Pod besteht, gelten diese Images für das Kubelet als in Gebrauch. Jeder Container fordert 1m CPU und 4 MiB Arbeitsspeicher an. + +```yaml +# 45-sandbox-prepull.yaml +apiVersion: apps/v1 +kind: DaemonSet +metadata: { name: sandbox-image-prepull, namespace: tale } +spec: + selector: { matchLabels: { app: sandbox-image-prepull } } + updateStrategy: { rollingUpdate: { maxUnavailable: 25% } } + template: + metadata: { labels: { app: sandbox-image-prepull } } + spec: + enableServiceLinks: false + automountServiceAccountToken: false + terminationGracePeriodSeconds: 0 + # Setzt du SANDBOX_K8S_NODE_SELECTOR und SANDBOX_K8S_TOLERATIONS, übernimm hier dieselben Werte: + # nodeSelector: { tale.dev/sandbox: 'true' } + # tolerations: [{ key: tale.dev/sandbox, operator: Exists, effect: NoSchedule }] + securityContext: + runAsNonRoot: true + runAsUser: 65534 + runAsGroup: 65534 + seccompProfile: { type: RuntimeDefault } + initContainers: + - name: runtime + image: ghcr.io/tale-project/tale/tale-sandbox-runtime:${VERSION} + command: [sh, -c, 'exit 0'] + resources: { requests: { cpu: 1m, memory: 4Mi }, limits: { memory: 32Mi } } + securityContext: { allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities: { drop: [ALL] } } + - name: egress + image: ghcr.io/tale-project/tale/tale-sandbox-egress:${VERSION} + command: [sh, -c, 'exit 0'] + resources: { requests: { cpu: 1m, memory: 4Mi }, limits: { memory: 32Mi } } + securityContext: { allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities: { drop: [ALL] } } + - name: gateway + image: ghcr.io/tale-project/tale/tale-sandbox-llm-gateway:${VERSION} + command: [sh, -c, 'exit 0'] + resources: { requests: { cpu: 1m, memory: 4Mi }, limits: { memory: 32Mi } } + securityContext: { allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities: { drop: [ALL] } } + containers: + - name: pause + image: registry.k8s.io/pause:3.10 + resources: { requests: { cpu: 1m, memory: 4Mi }, limits: { memory: 16Mi } } + securityContext: { allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities: { drop: [ALL] } } +``` + +Entscheidend ist das Runtime-Image: Jeder Session-Pod und sein Egress-Sidecar starten daraus. Die Images von Egress und Gateway ersparen einen Download, wenn diese Deployments auf einen anderen Node wechseln; entferne ihre Init-Container, wenn Sessions auf eigenen Nodes laufen, die diese Deployments nie nutzen. Setzt du `SANDBOX_K8S_NODE_SELECTOR` und `SANDBOX_K8S_TOLERATIONS`, gib dem DaemonSet dieselben Werte, damit es genau auf den Session-Nodes läuft. + +Die Image-Tags folgen wie in jeder anderen Datei `${VERSION}`. Wende diese Datei separat vor der Schleife an und warte, bis jeder Node die Images geladen hat; bei einem Upgrade liegt das neue Runtime-Image dann bereit, bevor der Spawner darauf umstellt und Sessions daraus anlegt. Der erste Befehl legt bei einer Erstinstallation den Namespace an und ändert bei einem Upgrade nichts: + +```bash +envsubst '${VERSION}' < 00-namespace.yaml | kubectl apply -f - +envsubst '${VERSION}' < 45-sandbox-prepull.yaml | kubectl apply -f - +kubectl -n tale rollout status ds/sandbox-image-prepull --timeout=15m +for f in 00-namespace.yaml 10-stores.yaml 20-application.yaml 30-proxy.yaml 40-sandbox.yaml; do + envsubst '${VERSION}' < "$f" | kubectl apply -f - +done +``` + +Führe bei jedem Upgrade dieselben Befehle mit der neuen, exportierten `VERSION` aus. Eine Kopie, die du ohne `envsubst` anwendest oder bei einem Upgrade auslässt, behält ihre alten Tags: Sie hält alte Images auf den Nodes, und die erste Session auf jedem Node lädt das neue Image wieder selbst. + ### Was der Spawner durchsetzt Beim Start legt der Spawner die NetworkPolicy `tale-sandbox-session-egress` an: Sitzungs-Pods erreichen DNS und die Pods ihres eigenen Namespace und sonst nichts. Der Cloud-Metadatendienst, die Nodes und andere Namespaces bleiben damit auch für einen Prozess unerreichbar, der `HTTP_PROXY` ignoriert. Öffentliche Ziele laufen über `sandbox-egress`. Eine fehlende Berechtigung für `networkpolicies` wird protokolliert und stoppt den Spawner nicht; prüfe, dass die Richtlinie existiert, bevor du Arbeit zulässt. @@ -702,4 +804,4 @@ Snapshots, Blue-Green-Wechsel und Rollback-Prüfungen der CLI laufen auf Kuberne ## Geprüfter Umfang -Diese fünf Dateien wurden bis auf die Secret-Werte unverändert auf einem frischen kind-Cluster mit einem Node, Kubernetes 1.36, kube-network-policies, der StorageClass local-path und Tale 0.5.31 angewendet: Start und Migrationen, der öffentliche Zugang, die Einrichtung des ersten Inhabers samt Sandboxes-Karte, eine Agentenaufgabe mit Ergebnis, der Sitzungslebenszyklus einschließlich Leerlaufstopp, Fortsetzung und replikatübergreifendem Zugriff, die Sperrprüfungen oben und ein Rolling Restart der API mit zwei Replikaten. Mehrere Nodes mit `ReadWriteMany`-Konfigurationsspeicher, Docker in Sitzungen auf einer sysbox- oder kata-RuntimeClass, ein Ingress mit `TLS_MODE=external` und hochverfügbare Speicher waren nicht Teil dieses Laufs. +Diese fünf Dateien wurden bis auf die Secret-Werte unverändert auf einem frischen kind-Cluster mit einem Node, Kubernetes 1.36, kube-network-policies, der StorageClass local-path und Tale 0.5.31 angewendet: Start und Migrationen, der öffentliche Zugang, die Einrichtung des ersten Inhabers samt Sandboxes-Karte, eine Agentenaufgabe mit Ergebnis, der Sitzungslebenszyklus einschließlich Leerlaufstopp, Fortsetzung und replikatübergreifendem Zugriff, die Sperrprüfungen oben und ein Rolling Restart der API mit zwei Replikaten. Mehrere Nodes mit `ReadWriteMany`-Konfigurationsspeicher, Docker in Sitzungen auf einer sysbox- oder kata-RuntimeClass, ein Ingress mit `TLS_MODE=external` und hochverfügbare Speicher waren nicht Teil dieses Laufs. Die Festplattengrenzen und Platzierungseinstellungen der Session-Pods sowie das optionale Pre-Pull-DaemonSet kamen später hinzu und waren ebenfalls nicht Teil davon. diff --git a/docs/de/self-hosted/install/own-compose.md b/docs/de/self-hosted/install/own-compose.md index 3d9dca956e..44064c83b1 100644 --- a/docs/de/self-hosted/install/own-compose.md +++ b/docs/de/self-hosted/install/own-compose.md @@ -20,7 +20,7 @@ Im mitgelieferten Aufbau liegen `tale_app` und `tale_knowledge` in einem Postgre ## Kompatible Images festlegen -Setze `VERSION` in der Compose-`.env` auf das geprüfte und getestete Tale-Release. Exportiere denselben Wert in deiner Shell für den separaten Image-Download weiter unten. Verwende für Tale-Images eine gemeinsame Version. Die beiden Dienste mit Upstream-Images haben eigene feste Versionen. +Setze `VERSION` in der Compose-`.env` auf das geprüfte und getestete Tale-Release. Exportiere denselben Wert in deiner Shell für den separaten Image-Download weiter unten. Verwende für Tale-Images eine gemeinsame Version. Die beiden Dienste mit Upstream-Images haben eigene feste Versionen. Die Schichten der Tale-Images sind mit zstd komprimiert; der Docker-Host braucht deshalb Docker Engine 24.0 oder neuer. | Dienst | Image | | --- | --- | @@ -167,6 +167,7 @@ Setze am Proxy `BACKEND_UPSTREAM=backend-api:3005`. Für den mitgelieferten Date | Egress-IPv6 | `sysctls` mit `net.ipv6.conf.all.disable_ipv6: '1'` und `net.ipv6.conf.default.disable_ipv6: '1'`, wie im mitgelieferten Stack. Die Egress-Firewall arbeitet fail-closed: Sie braucht eine funktionierende IPv6-Firewall oder deaktiviertes IPv6 für den Standardwert und jede Schnittstelle, und ein Container kann diese Sysctls über ein schreibgeschütztes `/proc/sys` nicht selbst setzen. Ohne sie startet der Proxy auf einem Kernel ohne das Modul `ip6_tables` nicht; siehe [Sandbox-Infrastruktur](/de/self-hosted/configuration/environment-reference#sandbox-infrastructure). | | Postgres-Stopp | `stop_signal: SIGINT`, `stop_grace_period: 60s`, `shm_size: 256mb` im Referenzaufbau. | | Web-, Backend- und Spawner-Stopp | Stop-Wartezeit von 45 Sekunden für Web, 30 für `backend-api`, 120 für `backend-worker` und 30 für den Spawner. Ein Worker gibt seine Automations-Läufe in dieser Zeit weiter (`SHUTDOWN_DRAIN_MS`); übrige laufende Arbeit vor dem Stopp koordinieren. | +| Gateway-Stopp | `stop_grace_period: 90s`. Ein stoppendes Gateway nimmt keine neuen Modellaufrufe mehr an, lässt laufende Aufrufe samt gestreamter Antworten fertig werden und speichert seine Ausgabenzähler am Ende nur, wenn das innerhalb von 30 Sekunden nach dem Stopp geschieht. Die Docker-Vorgabe von 10 Sekunden bricht längere Antworten ab. | Behalte `db-backup`, wenn deine Datenbankwerkzeuge nach `/var/lib/postgresql/backup` schreiben. Ein Mount allein plant keine Sicherungen. Ältere Konfigurationsvolumes `convex-data` brauchen eine kontrollierte Übertragung nach `config-data`, keine Löschung. Bewahre die alte Kopie bis zur Prüfung auf. @@ -182,7 +183,7 @@ Behalte `db-backup`, wenn deine Datenbankwerkzeuge nach `/var/lib/postgresql/bac | `db` | `pg_isready -U tale && [ -f /tmp/.db_ready ]` | Postgres und Initialisierung bereit; Benutzer anpassen. | | `object-store` | `mc ready local` | Bereitschaft des mitgelieferten MinIO. | | `sandbox` | `curl -fsS http://127.0.0.1:8003/health` | Spawner nach Vorbereitung des Laufzeit-Images bereit. | -| `sandbox-egress` | `curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/` | Der Proxy beantwortet eine Nicht-Proxy-Anfrage selbst (400-Seite); das belegt, dass er ausliefert, ohne externe Webseiten zu erreichen. Den Port nicht mit einer reinen TCP-Verbindung prüfen: tinyproxy protokolliert jedes Verbinden-und-Schließen als Fehler, eine Zeile pro Intervall. | +| `sandbox-egress` | `curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/ && nslookup -type=a -timeout=1 sandbox-egress-health.invalid 127.0.0.1` | Der Proxy beantwortet eine Nicht-Proxy-Anfrage selbst (400-Seite); das belegt, dass er ausliefert, ohne externe Webseiten zu erreichen. Danach beantwortet dnsmasq einen Namen aus seiner eigenen Konfiguration; das belegt, dass der DNS-Forwarder für verschachtelte Container und Builds antwortet, ohne einen vorgelagerten Resolver zu fragen. Den Port nicht mit einer reinen TCP-Verbindung prüfen: tinyproxy protokolliert jedes Verbinden-und-Schließen als Fehler, eine Zeile pro Intervall. | | `sandbox-llm-gateway` | `wget -q -O /dev/null http://127.0.0.1:8080/health` | Verwendet den vorhandenen Client; das Image enthält kein `curl`. | Plane genug Zeit für Kaltstarts. Der Download der Sandbox-Laufzeit kann ein für warme Hosts passendes Zeitlimit überschreiten. Eine erfolgreiche Bereitschaftsprüfung belegt weder Dateizugriff noch Modellzugangsdaten oder einen vollständigen Nutzerablauf. Prüfe diese separat. diff --git a/docs/de/self-hosted/install/quickstart.md b/docs/de/self-hosted/install/quickstart.md index 1226bf61c2..8acc04fc34 100644 --- a/docs/de/self-hosted/install/quickstart.md +++ b/docs/de/self-hosted/install/quickstart.md @@ -8,7 +8,7 @@ Starte Tale lokal mit der veröffentlichten CLI, richte deinen Arbeitsbereich ei Du brauchst: -- macOS, Linux oder Windows mit PowerShell sowie Docker mit Linux-Containern und Compose. Docker Desktop enthält Compose unter macOS und Windows. Fehlt Docker, bietet `tale dev` Hilfe bei der Installation an. +- macOS, Linux oder Windows mit PowerShell sowie Docker Engine 24.0 oder neuer mit Linux-Containern und Compose. Docker Desktop enthält Compose unter macOS und Windows. Fehlt Docker, bietet `tale dev` Hilfe bei der Installation an; bei einer älteren Engine bricht der Befehl ab, bevor er Images herunterlädt. - Netzwerkzugriff auf GitHub für die CLI und auf Container-Registries für die Images. Beim ersten Start werden mehrere GB heruntergeladen; plane Platz für Images und deine Daten ein. - Zugangsdaten für einen unterstützten Modellanbieter, damit du die erste Antwort testen kannst. Dein Konto kannst du schon vorher erstellen und die Anwendung erkunden. @@ -42,7 +42,7 @@ irm https://raw.githubusercontent.com/tale-project/tale/main/scripts/install-cli Prüfe die Installation im selben Terminal mit `tale --version`. Fehlt der Befehl, folge den `PATH`-Hinweisen des Installers und öffne bereits laufende Terminals neu. Die [CLI-Installation](/de/self-hosted/install/cli-install) beschreibt feste Versionen und eigene Installationsverzeichnisse. -Prüfe mit `tale --help`, ob `doctor` verfügbar ist. Fehlt der Befehl, prüfe Docker und Compose mit `docker info` und `docker compose version`. Falls verfügbar, untersucht `tale doctor` zusätzlich die Container-Architektur und lokale Ports, ohne Software zu installieren oder Dateien zu ändern. Folge den angezeigten Hinweisen; ein erfolgreicher Check bestätigt weder Image-Downloads noch den Modellzugriff. +Prüfe mit `tale --help`, ob `doctor` verfügbar ist. Fehlt der Befehl, prüfe Docker und Compose mit `docker info` und `docker compose version`. Falls verfügbar, untersucht `tale doctor` zusätzlich die Version der Docker Engine, die Container-Architektur und lokale Ports, ohne Software zu installieren oder Dateien zu ändern. Folge den angezeigten Hinweisen; ein erfolgreicher Check bestätigt weder Image-Downloads noch den Modellzugriff. ## Initialisieren und starten diff --git a/docs/de/self-hosted/operate/container-architecture.md b/docs/de/self-hosted/operate/container-architecture.md index 1df50276f2..936a947b20 100644 --- a/docs/de/self-hosted/operate/container-architecture.md +++ b/docs/de/self-hosted/operate/container-architecture.md @@ -39,6 +39,20 @@ Die Laufzeit stellt auch Chromium und Playwright für Seitenrendering und Dokume Der Egress-Dienst blockiert private Adressen und Metadatenziele und kann eine Hostnamen-Freigabeliste erzwingen. Ein ausgefallener Ausgang kann Verweigerungen oder Netzwerkfehler verursachen; die genaue Meldung hängt von der Operation ab. [Härtung](/de/self-hosted/operate/security/hardening) beschreibt die Regeln, [Compose selbst betreiben](/de/self-hosted/install/own-compose) die nötigen Rechte und Mounts. +## Sitzungen über einen Docker-Neustart erhalten + +Sandbox-Sitzungen und der Spawner laufen als Container des Docker-Daemons auf dem Host. Ohne Live Restore des Daemons stoppt ein Neustart, etwa für ein Paket-Upgrade oder eine Änderung an `/etc/docker/daemon.json`, alle diese Container: Laufende Agent-Turns, Builds und Seitenrenderings brechen ab, ihre Arbeitsverzeichnisse bleiben erhalten. Tale ändert die Daemon-Konfiguration des Hosts nicht; der Spawner protokolliert beim Start eine Warnung, solange Live Restore ausgeschaltet ist. + +Zum Einschalten ergänzt du die Einstellung in `/etc/docker/daemon.json` und behältst die übrigen Einträge der Datei: + +```json +{ + "live-restore": true +} +``` + +Lade den Daemon danach mit `sudo systemctl reload docker` neu, oder sende auf einem Host ohne systemd `SIGHUP` an `dockerd`. Das Neuladen übernimmt die Einstellung, ohne Container zu stoppen. Live Restore hält Container über einen Daemon-Neustart und ein Patch-Release-Upgrade hinweg am Laufen; ein Upgrade auf eine neue Docker-Release-Linie kann sie trotzdem stoppen, plane es deshalb wie ein Wartungsfenster. Live Restore ist mit dem Swarm-Modus nicht vereinbar: Plane Daemon-Neustarts auf einem Swarm-Knoten stattdessen als Wartung ein. [Dockers Anleitung zu Live Restore](https://docs.docker.com/engine/daemon/live-restore/) nennt die übrigen Grenzen. + ## Reparaturen des Wissensindex erkennen Ein beschädigter BM25-Index kann Importe scheitern lassen, obwohl die Dokumenttabellen noch lesbar sind. Das Backend prüft Wissensindizes mit `pdb.verify_index`. Ein Advisory Lock koordiniert Reparaturversuche pro Datenbank. Organisationsspezifische Datenbanken werden bei ihrer ersten Verwendung geprüft. diff --git a/docs/de/self-hosted/operate/observability/troubleshooting.md b/docs/de/self-hosted/operate/observability/troubleshooting.md index 2643781e25..bb14d0a385 100644 --- a/docs/de/self-hosted/operate/observability/troubleshooting.md +++ b/docs/de/self-hosted/operate/observability/troubleshooting.md @@ -85,6 +85,10 @@ Ein gesunder Egress-Prozess belegt nicht die Verfügbarkeit von Gegenstelle, DNS Wenn viele Sessions gleichzeitig Pakete installieren oder Seiten laden und Verbindungen mit Resets abbrechen, während der Proxy gesund bleibt, hat er womöglich `SANDBOX_EGRESS_MAX_CLIENTS` erreicht, die Verbindungen, die er für alle Sessions zusammen gleichzeitig bedient. Sein Log meldet dann, dass die Höchstzahl an Verbindungen erreicht ist. Erhöhe den Wert zusammen mit den Prozess- und Dateigrenzen des Egress-Containers und erstelle den Egress-Dienst neu. +Wenn die Verbindungen einer einzelnen Session mit Resets abbrechen, während andere Sessions dieselben Hosts weiterhin erreichen, hält diese Session womöglich schon `SANDBOX_EGRESS_MAX_CONNECTIONS_PER_SESSION` Verbindungen (Default 256), und der Proxy lehnt ihre nächsten ab, bis einige geschlossen sind. Erhöhe den Wert oder setze `0`, um die Grenze abzuschalten, und erstelle den Egress-Dienst neu. + +Ein neu erstellter Dienst `sandbox-egress` (nach einem Deploy oder einem Neustart des Stacks) kann unter einer anderen Adresse zurückkommen, während Sessions, die schon liefen, ihren Verkehr weiter an die alte Adresse schicken und keinen Netzzugriff mehr haben. Der Dienst `sandbox` startet jede solche Session neu, sobald sie freigegeben und untätig ist, und protokolliert `recycling `; die nächste Nutzung startet sie mit unverändertem Workspace. Eine Session, die noch in Gebrauch ist, scheitert weiter, bis ihre Arbeit endet, und eine angepinnte Session läuft weiter, bis du sie stoppst oder nicht mehr anpinnst. + ## Schreibzugriffe scheitern oder Speicher läuft voll Prüfe Datenbankverbindung, freien Platz, Verbindungsbelegung und Sperren. Stoppe vermeidbares Wachstum und stelle Kapazität nach deinem Datenbankverfahren wieder her. Lösche keine Volume-Inhalte, setze keine Verschlüsselungsschlüssel zurück und erwarte keine automatische Wiederholung fehlgeschlagener Schreibzugriffe. Prüfe vor einem erneuten Versuch, ob die ursprüngliche Operation bereits gespeichert wurde. diff --git a/docs/de/self-hosted/operate/upgrades.md b/docs/de/self-hosted/operate/upgrades.md index 5db8d84f53..c3d1dab53c 100644 --- a/docs/de/self-hosted/operate/upgrades.md +++ b/docs/de/self-hosted/operate/upgrades.md @@ -59,12 +59,12 @@ Vor dem Entfernen wird die alte API geleert: Neue Chat-Turns können eine Drain- Das Leeren umfasst auch Automations. Worker der alten Farbe starten keinen neuen Job und geben jeden Automations-Lauf beim nächsten Schritt weiter, sodass er auf der neuen Farbe weiterläuft; die CLI wartet innerhalb derselben drei Minuten auch auf diese Schritte. Wenn die alten Container anhalten, hat jeder Worker 120 Sekunden, um weiterzugeben, was er noch hält (mehr, wenn du `SHUTDOWN_DRAIN_MS` erhöhst: Die CLI hält diese Frist 15 Sekunden darüber), und ein Schritt, der 20 Sekunden nach Beginn des Anhaltens noch arbeitet, wird unterbrochen und läuft auf der neuen Farbe noch einmal. Ausgenommen ist ein Schritt, der gerade etwas an einen externen Dienst gesendet hat, denn der Dienst hat es vielleicht schon erhalten: Dieser Lauf wartet, bis eine Person entscheidet, wie es weitergeht, wie [Automatisierungsläufe prüfen und Fehler beheben](/de/platform/automations/execution-logs) es beschreibt. Das erste Update auf Automations-Schreibprotokoll 2 läuft anders ab: Die Migration hält alle älteren Läufe in der Warteschlange, in Ausführung oder im Wartezustand an und bewahrt ihren vorherigen Zustand sowie ungeklärte externe Auswirkungen. Sie laufen nicht automatisch weiter. Bereits zugelassene oder gesendete Arbeit eines alten Workers kann noch abgeschlossen werden. Eine ausdrückliche Stoppanforderung hält fest, wer sie gestellt hat, und fordert den Abbruch der zugehörigen Sitzung an; sie belegt weder deren Ende noch das Ergebnis eines externen Schreibvorgangs. Sie gibt die gehaltene Aufgabe und ihre Nachweise nicht frei. Prüfe das tatsächliche Ergebnis, bevor du Ersatzarbeit planst. +Das Modell-Gateway wird an Ort und Stelle ersetzt, bevor die neue Farbe startet. Wenn sein Container stoppt, nimmt das Gateway keine neuen Modellaufrufe mehr an und gibt laufenden Aufrufen, gestreamte Antworten eingeschlossen, bis zu 90 Sekunden, um fertig zu werden. Seine Ausgabenzähler speichert es am Ende nur, wenn das innerhalb von 30 Sekunden nach dem Stopp geschieht, denn das eigene Aufräumfenster des Gateways zählt ab dem Stoppsignal. Ein Aufruf, der danach noch streamt, wird vollständig beantwortet, aber seine Kosten und die der Sekunden davor werden womöglich nicht gebucht. Bis das neue Gateway antwortet, schlägt ein neuer Modellaufruf fehl, und eine Antwort, die nach 90 Sekunden noch gestreamt wird, bricht ab. Eine Bereitstellung kann deshalb bis zu 90 Sekunden auf das Gateway warten. + Beide Farben verwenden das Volume `static-assets` der Bereitstellung. Bevor eine Web-Replik bereit ist, legt sie dort die unveränderlichen Skripte, Stylesheets, Schriftarten und Bilder ihres Builds ab. So kann jede Farbe die Dateien liefern, auf die das HTML der anderen Farbe verweist. Laufende Repliken frischen ihre Dateien stündlich auf; ausgemusterte Dateien bleiben danach noch sieben Tage verfügbar. Binde dieses gemeinsame Volume auch in deinem eigenen Compose-Aufbau auf jeder Web-Replik ein. Beim ersten Upgrade von einer Version ohne diese Unterstützung fehlt den alten Repliken diese gemeinsame Rückfallmöglichkeit noch. Ein offener Tab arbeitet bei der Übergabe normalerweise weiter. Ist ein benötigter Teil nicht mehr verfügbar, wartet Tale, bis API und Datenbank antworten, und lädt dann einmal neu. Lässt sich der Teil weiterhin nicht laden, zeigt Tale **Eine neue Version ist verfügbar** mit der Aktion **Neu laden**, statt erneut automatisch zu laden. Während eines Ausfalls bleibt der Verbindungshinweis sichtbar. Fehlgeschlagene Leseanfragen werden nach der Wiederverbindung aktualisiert; fehlgeschlagene Schreibanfragen werden nicht automatisch erneut gesendet. -Sobald die Dienste aktualisiert sind, entfernt die CLI die Tale-Images aller Versionen, die älter sind als die neue Version und das gespeicherte Rollback-Ziel. Der Host behält so die Images von zwei Releases statt von jedem Release, das je lief. Erzwungen wird nichts: Ein Image, das ein Container noch nutzt, etwa ein Dienst, der auf einer älteren Version weiterläuft, oder eine Sandbox-Sitzung, die vor dem Deployment startete, bleibt, bis ein späteres Deployment es frei vorfindet. Images, die du für eine spätere Version vorab geladen hast, bleiben ebenfalls. - Wird die neue Gruppe nicht innerhalb von `HEALTH_CHECK_TIMEOUT` gesund, schließt die CLI den Wechsel nicht ab. Prüfe gespeicherten Bereitstellungszustand und Protokolle vor einem erneuten Versuch. Ein unterbrochener Rollout kann beide Gruppen oder eine ausstehende Übergabe hinterlassen. Folge den Wiederherstellungshinweisen der CLI, statt Container oder Zustandsdateien von Hand zu löschen. ## Migrationen und Nutzerergebnis prüfen diff --git a/docs/de/self-hosted/overview.md b/docs/de/self-hosted/overview.md index 3d8499df61..ea5aea7d01 100644 --- a/docs/de/self-hosted/overview.md +++ b/docs/de/self-hosted/overview.md @@ -31,7 +31,7 @@ Die Anwendungsrollen verwenden dasselbe Tale-Platform-Image. `TALE_ROLE=api` sta | `config-data` | Konfigurationsdateien der Organisationen, darunter Agenten, Skills, Anbieterdefinitionen, Richtlinien, SSO-Einstellungen und Branding. | | `object-store-data` | Hochgeladene Dokumente, Anhänge, Audio und erzeugte Dateien. | | `caddy-data`, `caddy-config` | Zertifikate und Proxy-Zustand. | -| `llm-gateway-data` | Gateway-Konfiguration, Zugangsdaten für Sitzungen und das Anfrageprotokoll des Gateways mit Modell, Tokens und Dauer, ohne Prompts oder Antworten. | +| `llm-gateway-data` | Gateway-Konfiguration, Zugangsdaten für Sitzungen und das Anfrageprotokoll des Gateways mit Modell, Tokens und Dauer, ohne Prompts oder Antworten, standardmäßig drei Tage lang aufbewahrt. | Im mitgelieferten Stack liegen beide Datenbanken in einem Postgres-Dienst. Der Netzwerkalias `knowledge-db` führt zur Wissensverbindung. Es bleiben zwei getrennte Datenbanken. Eine Bereitstellung aus dem Quellcode mit eigenem Wissensdienst besitzt zusätzlich `knowledge-db-data`. diff --git a/docs/de/tutorials/editor/workflow-with-approvals.md b/docs/de/tutorials/editor/workflow-with-approvals.md index 0e8a1f9fb1..c6db6c3d26 100644 --- a/docs/de/tutorials/editor/workflow-with-approvals.md +++ b/docs/de/tutorials/editor/workflow-with-approvals.md @@ -13,7 +13,7 @@ Der Mock-Test braucht keine Postfach-Zugangsdaten. Für einen tatsächlich freig ## Das Beispiel importieren -Speichere den folgenden Inhalt als `workflow.yml`. Der Knoten `draft` liefert festen Text, damit das Ergebnis leicht prüfbar ist. `send` liest ihn; diese Referenzen erzeugen die Verbindung auf dem Canvas. +Speichere den folgenden Inhalt als `workflow.yml`. Die Node `draft` liefert festen Text, damit das Ergebnis leicht prüfbar ist. `send` liest ihn; diese Referenzen erzeugen die Verbindung auf dem Canvas. ```yaml version: 1 @@ -60,7 +60,7 @@ Existiert der Name bereits, fügt der Upload eine weitere Version hinzu. Wähle Klicke im **Editor** auf **Testlauf**. Dieses Beispiel braucht keine Laufzeiteingabe und kann mit einem leeren Objekt laufen. Wechsle zu **Läufe**. Dort sollte ein **Erfolgreich** abgeschlossener Test erscheinen. -Öffne den Lauf und prüfe auf dem Canvas, ob beide Knoten den Status **Gelaufen** zeigen. Wähle `send` und prüfe die aufgelöste Eingabe. Der Empfänger muss `reviewer@example.com` sein, der Betreff `Approval practice` und der Text der Satz aus `draft`. In diesem Modus antwortet ein deterministischer Mock des Connectors. Es wird keine E-Mail gesendet und keine Freigabekarte angezeigt. +Öffne den Lauf und prüfe auf dem Canvas, ob beide Nodes **Erfolgreich** zeigen. Wähle `send` und prüfe die aufgelöste Eingabe. Der Empfänger muss `reviewer@example.com` sein, der Betreff `Approval practice` und der Text der Satz aus `draft`. In diesem Modus antwortet ein deterministischer Mock des Connectors. Es wird keine E-Mail gesendet und keine Freigabekarte angezeigt. Der Workflow enthält einen Test, der den Effekt `imap-smtp.send` erwartet. Ein erfolgreicher Mock prüft Ablauf und vorgesehenen Aufruf. Er belegt weder gültige Postfach-Zugangsdaten noch die Zustellung. @@ -68,7 +68,7 @@ Der Workflow enthält einen Test, der den Effekt `imap-smtp.send` erwartet. Ein Kehre zum **Editor** zurück und klicke auf **v1 live schalten**, um die getestete Version live zu schalten. Lass den Trigger unkonfiguriert; diese Übung startet einmal von Hand. -Wähle **Live ausführen**, lies Bestätigung und Organisationsumfang und bestätige. Wechsle zu **Läufe** und öffne den neuen Lauf mit dem Status **Wartet**. Die Freigabekarte sollte den Titel **Wartet auf deine Freigabe: imap-smtp.send**, den Knoten `send` sowie dessen geplante Eingabe unter **Der Schritt würde aufrufen mit** zeigen. Empfänger, Betreff und Text müssen dem Mock-Test entsprechen. +Wähle **Live ausführen**, lies Bestätigung und Organisationsumfang und bestätige. Wechsle zu **Läufe** und öffne den neuen Lauf mit dem Status **Wartet**. Die Freigabekarte sollte den Titel **Wartet auf deine Freigabe: imap-smtp.send**, die Node `send` sowie deren geplante Eingabe unter **Der Schritt würde aufrufen mit** zeigen. Empfänger, Betreff und Text müssen dem Mock-Test entsprechen. Wartet der Lauf nicht, prüfe Status und Richtlinie, bevor du fortfährst. Ein fehlgeschlagener Connector-Aufruf beweist nicht, dass eine Freigabe angefordert wurde. diff --git a/docs/en/develop/api-reference.md b/docs/en/develop/api-reference.md index 07ee7fe5b3..6258c9bd00 100644 --- a/docs/en/develop/api-reference.md +++ b/docs/en/develop/api-reference.md @@ -359,7 +359,7 @@ A project file is not this endpoint's — it returns **404**, `DOCUMENT_NOT_FOUN Use `POST /api/v1/knowledge-entries` to create searchable text. It creates a file-backed Hub document with `sourceProvider: knowledge` and starts indexing. An entry allows at most 8,000 characters, with one active entry per topic. The **201** response `{id, documentId}` already contains the document ID: poll `GET /api/v1/documents/{documentId}` to follow indexing. -A `PATCH` supersedes the active entry and re-indexes under the same `documentId`. If `topic` and `content` are unchanged after trimming, it creates no version and returns the existing entry ID. A `PATCH` of a superseded row returns **409**, `KNOWLEDGE_ENTRY_SUPERSEDED`, naming the topic's active row in `data.activeId` (and its direct successor in `data.supersededBy`) — update that row, no chase down the chain. An entry created or superseded over this door reads `source: "api"` (the app's form writes `manual`, the assistant's capture `chat`), so the Knowledge entries table tells the three apart. Deleting the entry trashes its backing document. +A `PATCH` supersedes the active entry and re-indexes under the same `documentId`. If `topic` and `content` are unchanged after trimming, it creates no version and returns the existing entry ID. A `PATCH` of a superseded row returns **409**, `KNOWLEDGE_ENTRY_SUPERSEDED`, naming the topic's active row in `data.activeId` (and its direct successor in `data.supersededBy`) — update that row, no chase down the chain. An entry created or superseded over this door reads `source: "api"` (the app's form writes `manual`, the assistant's capture `chat`, and an agent granted `knowledge_entry_write` `agent` since contract 3.23.0), so the Knowledge entries table tells them apart. Deleting the entry trashes its backing document. The entry endpoints need the knowledge write grant — a read-only member returns **403**, `KNOWLEDGE_ENTRY_FORBIDDEN` — and an object store that does not accept the content within 30 seconds returns **503**, `KNOWLEDGE_ENTRY_STORE_TIMEOUT`, with nothing written. That document refuses a direct `DELETE /api/v1/documents/{id}`, or a `PATCH` of its title or content, with **409**, `DOCUMENT_HAS_KNOWLEDGE_ENTRY` and `data.entryId` — the entry is the way to change it. `GET /api/v1/knowledge-entries?topic=&status=superseded` lists one topic's replaced versions, each stamped with `supersededAt`, and `GET /api/v1/knowledge-entries/{id}/versions` returns the whole chain from any of its rows, newest first. @@ -383,6 +383,7 @@ Branch on `indexing.errorCode`, not the wording of `error`. The OpenAPI schema e | --- | --- | | `unsupported`: `unsupported_type`, `image_no_vision`, `empty`, `not_text`, `malformed` | Replace or re-export the source in a supported format. For `not_text`, export actual UTF-8 text. `malformed` currently identifies an unreadable PDF; corrupt Office files can instead report `indexer_error`. The retry route skips terminal codes, including older rows still marked `failed`. | | `failed`: `embedding_upstream`, `indexer_error`, `index_rebuilding` | The background job retries these failures. Poll before requesting another attempt. | +| `failed`: `usage_limit` | A budget cap that binds whoever the file is indexed for — its uploader, a synced drive's owner, the organization for an emailed attachment — is reached. Indexing resumes by itself within the hour after the cap resets or is raised, after what it already stored; a `retry-indexing` before that waits again. | | `failed`: `embedding_not_configured`, `embedding_provider_refused`, `index_repair_failed` | Ask the operator to correct provider configuration, permissions, or index health, then retry. `embedding_provider_refused` also covers a model that answers vectors of another width than the settings state, and an embedding credential the platform cannot use (none configured, deleted, disabled, or unreadable); saving corrected embedding settings, or adding or repairing the credential the embedding model uses, re-queues every document that failed on the embedding model. | | `failed`: `secret_detected`, `pii_blocked` | Correct the source or the organization’s approved content policy before retrying. | | `failed` with no `errorCode` | The platform settled the failure without classifying it, usually because the indexing run stopped before it finished (a lost job or a stopped worker). Don't wait for an automatic retry: request `retry-indexing`. | @@ -504,12 +505,13 @@ AGENT_ID=$(curl -fsS "$AGENT_URL" \ curl -fsS "$AGENT_URL/$AGENT_ID" \ -H "Authorization: Bearer $TALE_API_KEY" \ -H "X-Organization-Slug: $ORG_SLUG" \ - | jq '.agent | {name, harness, skills, connectors}' + | jq '.agent | {name, handle, harness, skills, connectors}' ``` ```json { "name": "Reviewer", + "handle": "reviewer", "harness": "claude-code", "skills": [], "connectors": [] @@ -526,16 +528,22 @@ An agent whose `managed` is `true` is the organization's [standard agent](/platf A project holds at most 50 agents. Names are unique within the project without regard to case, up to 120 characters; each equipment list allows 25 entries and instructions allow 20,000 characters. An invalid configuration or an exceeded limit returns **400**; a name another agent of the project already carries returns **409**, `PROJECT_AGENT_NAME_TAKEN` — the class every other duplicate on this endpoint returns, so reuse the existing agent rather than retrying. +Every agent also has a `handle`, what you type after `@` to mention it. It is the agent's current name in lowercase letters, digits and single hyphens, so "My Opus Agent #3" answers to `my-opus-agent-3`. A handle is unique in its project: when another agent already holds it, or a member or an automation of the organization already answers to it, the agent gets the next free one, `-02`, then `-03` and on. The same happens when a member or an automation comes to answer to an agent's handle later. Renaming an agent gives it the handle of its new name, unless only upper and lower case or punctuation changed. Keep the agent's `id` when you need to address it later; the handle follows the name (contract 3.24.0). + `model` must be a model the organization's catalog lists (name `modelProvider` when several providers serve it) and `tools` must name known tool grants — a wrong value returns **400** with `PROJECT_AGENT_MODEL_INVALID`, `PROJECT_AGENT_PROVIDER_UNKNOWN` or `PROJECT_AGENT_TOOL_UNKNOWN` naming what to fix, instead of an agent that fails at its first task. `task_start_agent` lets the agent put another agent of the same project to work on a task (contract 3.8.0). `secrets` contains organization secret names, never values; a name the organization has not stored is refused with **400**, `PROJECT_AGENT_SECRET_UNKNOWN`, naming it in `data.secrets` (the app's dialog prunes such names; the API does not, so a typo never yields an agent that runs without its credential). `task_update_metadata` is an optional project-agent grant (contract 3.10.0) for changing an existing task’s priority and agent assignment without execution. Its request names `taskId`, `priority` and/or `agentId`, plus the current value of each touched field in `expected`; `null` clears a value and omitted fields stay untouched. Build `expected.assignee` as `{type, id}` from `task_get`’s `assigneeType` and `assigneeId`, or use `null` when unassigned; an absent priority is `null`. A stale value refuses the whole request. The [project-agent guide](/platform/projects/project-agents) explains the protected review and live-run states. `task_upsert_by_external_ref` still uses `priority` only when creating a task. `task_delegate_review` is a separate, explicit project-agent grant for one captured pending agent-to-agent handoff. Pass `{taskId, reviewerAgentId, expected: {approvalId, runId, evidenceRevision, reviewer: {kind: "agent", agentId}}, reason}` with full native UUIDs and a nonempty reason of at most 2,000 characters. Unknown fields are refused. It requires a live project-wide manager run, its current grant, a current eligible independent recipient and unchanged captured source and evidence. The implementation agent of the captured source is refused as the manager. It preserves implementation ownership, status, future routing and permissions, and starts no run. `task_get.reviewDelegation` exposes the validated historical handoff into the latest review gate; read `pendingReview` for current ownership. Identical replay requires the same still-authorized issuer and unchanged pending successor and evidence. Human and workflow reviews remain protected. See [review delegation](/platform/projects/task-automation#delegate-review). +`knowledge_entry_write` is an optional grant for project agents and automation agent steps (contract 3.23.0). It saves one fact as a knowledge entry of the whole organization, keyed by its topic: pass `{topic, content, expectedVersionId?}`, with a topic of up to 120 characters and content of up to 8,000. A topic without an entry gets a new one. Changing an existing entry requires `expectedVersionId`, the version the agent read: the `id` that `knowledge_entry_find` returns since contract 3.23.0, or the `versionId` of the agent's last save. Without it, or when that version has been replaced since, nothing is saved, and the answer carries the current version and its text for the agent to merge its change into. Saving the current text again writes nothing. What an agent saves reads `source: "agent"`, names the agent in `createdBy` and is recorded in the audit log as `knowledge_entry.created` or `knowledge_entry.updated`. A run started by a member, who may only work on their own task, is refused (`member_run`). Saves by agents count against a rate limit per organization of their own, separate from edits by people. Indexing is asynchronous: `knowledge_entry_find` lists a saved entry at once, `rag_search` only once it has been indexed. + `task_review` adds an optional project-agent grant in contract 3.11.0. It decides only a pending native review assigned to the live reviewer agent, for a completed run by a different agent in the same project. Pass `taskId`, `expected: {approvalId, runId, evidenceRevision}` from the current `task_get.pendingReview`, `decision: "approve" | "request_changes"`, nonempty `feedback`, and `evidence: {checks, pullRequests}`. Each check names its outcome (`passed` or `failed`) and details; a supplied GitHub pull request names its URL, exact `headSha`, and check state. Approval requires every supplied check to have passed. GitHub evidence is the agent's attestation, not a remote verification by Tale. The tool rechecks the current grant, live issuer authority, recorded reviewer, implementation run, and local evidence revision. A stale result requires another read; changing the current assignee does not establish independence. Approval moves the task to `done`; `request_changes` moves it to `todo` with feedback and no execution, even if the feedback contains a mention. Human competence requirements and workflow approval gates remain outside this tool. There is no public REST endpoint for an agent verdict. +Since contract 3.25.0, an agent that is working other tasks is started all the same: each of its runs works in an agent worker of its own. Native `task_start_agent` and the automation step `task.start_agent` no longer answer `agent_busy` or `busyTaskId`. A start answers `started: true`, and a run that waits for a free worker carries `waitingReason`: `org_limit` (every agent worker of the organization is in use), `host` (the sandbox host is full), `destroy_pending` (the workspace it would use is being deleted) or `exec_limit` (its sandbox is still ending an earlier process). Such a run starts by itself; do not start it again. An agent that names itself for another task is refused with `self_start`. Native `task_get.agentRuns` carries `waitingReason` while a run waits. No REST operation changes. + Since contract 3.15.0, native `task_get.agentRuns` includes an explicit `retryPending` boolean. Only the newest failed run of an existing agent can have `true`, using the same armed-retry, retirement and retry-budget checks as the task card. Preserve that retry. `false` does not authorize a restart or supply a provider reset time; an absent field on an older platform is unknown. Reconcile the current task, assignee, runs and review before acting, and honor provider waits and admission `retryAfter`. This adds no public REST endpoint or raw error text. Contract 3.13.0 adds guarded repair admission to the existing native `task_start_agent` grant: pass `{taskId, resumeFrom: {kind: "review_repair", approvalId, runId}, feedback?}` for a recorded native `request_changes` decision. The server derives the implementation agent, feedback and feedback comment ID. It atomically requires the same latest settled source, unchanged implementation assignment, `todo`, no newer review or intervening status/assignment/archive decision, and the existing admission limits. An explicit `agentId` must match that source; `moveToInProgress: false` is refused. Untagged `{approvalId, runId}` retains its separate pending-question meaning. `stale_repair` starts nothing; do not fall back to an unguarded start. @@ -566,7 +574,9 @@ Responses always carry the real name (`"name": "billing/dunning"`); the `__` for ### Read the version that will run -`GET /api/v1/automations` lists each automation with its `latestVersion`, `deployedVersion` and `projectIds` — the projects it is installed in, which the run routes below require — plus what a launcher needs without a second call: its `description`, the `inputs` schema a run must match (the deployed version's, else the newest saved one's) and its `trigger` — kind, switch and health: `lastFiredAt`, `lastSkippedAt` and `lastSkipReason`, the same stamps `GET .../triggers` reads, so one listing call finds every binding that is enabled and not firing — or `null` when none is bound. +`GET /api/v1/automations` lists each automation with its `latestVersion`, `deployedVersion` and `projectIds` — the projects it is installed in, which the run routes below require — plus what a launcher needs without a second call: its `description`, the `inputs` schema a run must match (the deployed version's, else the newest saved one's) and its `trigger` — kind, switch, `nextRunAt` and health: `lastFiredAt`, `lastSkippedAt` and `lastSkipReason`, the same stamps `GET .../triggers` reads, so one listing call finds every binding that is enabled and not firing — or `null` when none is bound. + +An automation installed only in projects the key holder cannot read is left out of the list, and `GET /api/v1/automations/{name}`, its versions and its triggers answer **404** `AUTOMATION_NOT_FOUND` for it, as for one that does not exist; an automation installed nowhere is the whole organization's. `GET /api/v1/automations/{name}` returns the newest saved version by default (`?version=latest` spells the default out), which may be a draft; a live run executes the deployed one, so read the contract of the code that actually runs with `?version=deployed` (a number names any saved version). A version the automation does not have returns **404** `AUTOMATION_VERSION_UNKNOWN` — `?version=deployed` while nothing is deployed too — where an unknown automation returns `AUTOMATION_NOT_FOUND`. @@ -589,9 +599,33 @@ curl -sS --compressed -X PUT "https://your-host.example.com/api/v1/automations/b ### Choose the trigger kind -`kind` is `schedule` (with a five-field `cron` and an optional IANA `timezone`), `webhook` (the response carries the URL's `token` once — the [Webhooks page](/develop/webhooks) covers that endpoint) or `event`. A trigger that could never fire is refused with **400** `AUTOMATION_TRIGGER_INVALID` and a sentence naming the fix: a cron that matches nothing (including a day no named month has, `0 0 30 2 *`), a time zone that is not an IANA zone, an event the platform does not raise. +`kind` is `schedule`, `webhook` (the response carries the URL's `token` once — the [Webhooks page](/develop/webhooks) covers that endpoint) or `event`. A schedule runs on a repeat rule or on a cron expression, never both (contract 3.24.0): + +- `repeat` is a `ScheduleRule`, the rule the app's schedule picker writes. A `daily`, `weekly`, `monthly` or `yearly` rule runs at one to twelve local `times`, written `HH:MM`; a `minutely` or `hourly` rule starts every few minutes or hours, at `minute` past the hour for `hourly`, optionally only on some weekdays and between two times (`window`). It needs a `timezone`. `startDate`, a `YYYY-MM-DD` day in that zone, is the first day it may run and the day "every 2 weeks" counts from; left out, it is today, so send back the one `GET .../triggers` reads to keep a rule in step. +- `cron` is a five-field expression, read in `timezone`, or in UTC without one. -Each kind takes its own keys — `cron` and `timezone` only with `schedule`, `event` only with `event`, `rotateToken` only with `webhook` — and a key that belongs to another kind is refused as an unknown key (**400** `INVALID_BODY`, naming it under `data.issues`), so a webhook trigger can never read back as one that also runs on a schedule. An event trigger binds one of the events the platform raises today, and the run's input is `{ "trigger": "event", "event": "", "payload": }`: +```json +{ + "kind": "schedule", + "repeat": { + "frequency": "weekly", + "interval": 1, + "weekdays": [1, 2, 3, 4, 5], + "times": ["09:00", "17:30"] + }, + "timezone": "Europe/Zurich", + "catchUp": "latest", + "input": { "region": "emea" } +} +``` + +Weekdays count from 0 for Sunday. A local time the clock skips starts once, moved forward by the gap, and one it repeats starts once, at its first occurrence; a `minutely` or `hourly` rule, like a cron whose minute or hour starts with `*`, keeps its real-time spacing instead. `catchUp` decides what a schedule does with occurrences it missed while the platform was not running: `latest`, the default, starts the most recent one once, however late; `skip` starts it only when it is at most ten minutes late. Either way the others are counted, not run. + +Every kind also takes `enabled` (left out, it is `true`) and `input`, a fixed input: a JSON object of at most 16 KiB that every run the trigger starts receives, with the trigger's own `trigger`, `firedAt`, `event` and `payload` set over it — it cannot name them. It is plain data; a template in it arrives as text. The `PUT` replaces the whole trigger, so a field it leaves out is reset. + +A trigger that breaks a rule or could never fire is refused with **400** `AUTOMATION_TRIGGER_INVALID`, each problem under `data.issues` as `{ "path", "code", "message" }`: neither `repeat` nor `cron`, or both (`schedule.cron_or_repeat`); a cron that matches nothing, including a day no named month has (`0 0 30 2 *`); a time not written `HH:MM`, more than twelve times, an interval the rule does not offer, a day the month never has, or a window in which no start ever falls; a blank time zone or one that is not an IANA zone; a fixed input that is not an object, names one of the trigger's own fields or is larger than 16 KiB; an event the platform does not raise. + +Each kind takes its own keys — `cron`, `repeat`, `startDate`, `timezone` and `catchUp` only with `schedule`, `event` only with `event`, `rotateToken` only with `webhook`, `enabled` and `input` with any — and a key that belongs to another kind is refused as an unknown key (**400** `INVALID_BODY`, naming it under `data.issues`), so a webhook trigger can never read back as one that also runs on a schedule. An event trigger binds one of the events the platform raises today, and the run's input is `{ "trigger": "event", "event": "", "payload": }` beside any fixed input: | Event | Raised when | | ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | @@ -604,15 +638,17 @@ Each kind takes its own keys — `cron` and `timezone` only with `schedule`, `ev | `comment.created` | a comment lands on a task | | `comment.mentioned` | a task comment mentions someone with `@` | +A comment event's `comment` carries `body` as stored, with each mention as a mention link, and `bodyText`, the same text with each mention as `@` and the current name. Match words such as a name against `bodyText` (contract 3.24.0). + ### Check trigger health and pause safely -`GET .../triggers` reads the binding back — as `triggers`, a list of at most one, the one plural in the family — with its health: `lastFiredAt` is the last time this binding **started a run** — `lastRunId` names it, and both stay `null` until it has — while `lastSkippedAt` and `lastSkipReason` record the last time it came due and started nothing: `not_deployed` (nothing is deployed — deploy a version), `unusable_cron` (the expression or zone could not be read; the scheduler leaves the binding alone until it is edited), `start_refused` (the deployed version's `inputs` schema refused the run's input) or `paused_after_failures` (a schedule that turned itself off after repeated failures — see below). A webhook delivery the deployed `inputs` schema refuses is a different case: it is answered **400** `AUTOMATION_INPUT_INVALID` to the sender and starts nothing, and it moves none of these stamps — the binding did not come due, so a webhook whose every delivery is refused reads the same as one that has never been called. Verify deliveries from the sender's side. +`GET .../triggers` reads the binding back — as `triggers`, a list of at most one, the one plural in the family — with what it was saved with (`repeat` and `startDate` or `cron`, `timezone`, `catchUp`, `input`), its next start (`nextRunAt`, `null` while it is switched off or for a webhook or an event) and its health: `lastFiredAt` is the last time this binding **started a run** — `lastRunId` names it, and both stay `null` until it has — while `lastSkippedAt` and `lastSkipReason` record the last time it came due, or an event arrived, and started nothing: `not_deployed` (nothing is deployed — deploy a version), `unusable_cron` (the schedule or its zone could not be read; the scheduler leaves the binding alone until it is edited), `start_refused` (the start was refused — the deployed version's `inputs` schema refused the run's input, or the run's project could not take it, such as an archived project for an event; `lastSkipDetail.code` says which), `missed_occurrences` (occurrences came due while the platform was not running, as `catchUp` describes) or `paused_after_failures` (a schedule that turned itself off after repeated failures — see below). `lastSkipDetail` holds the facts behind the reason: the `occurrence` it was about, a refusal's `code`, the `version` that refused it, its `message` and `issues`, and `missed` — `count` (up to 1,000, `capped` past it), `firstAt`, `lastAt` and the `policy` — when occurrences were missed. A pause after failures has no detail; its facts are the failure fields below. A webhook delivery the deployed `inputs` schema refuses is a different case: it is answered **400** `AUTOMATION_INPUT_INVALID` to the sender and starts nothing, and it moves none of these stamps — the binding did not come due, so a webhook whose every delivery is refused reads the same as one that has never been called. Verify deliveries from the sender's side. A binding is alive when `lastFiredAt` keeps pace with its cadence; one whose `lastSkippedAt` is the newer stamp is coming due and not running, and the reason says what to fix. A rebind to another kind starts every stamp afresh. `enabled: false` pauses a trigger without losing it; `DELETE .../triggers` removes it — and, for a webhook, revokes the URL. So does binding another kind over a live webhook: the `PUT` still returns **200**, with `"revoked": "webhook"` beside the name, and the old URL is gone for good — a later webhook bind mints a different token. A schedule whose runs keep failing pauses itself. `consecutiveFailures` counts the runs this binding started that failed in a row with a `failureCode` the next occurrence would repeat — `node_error`, `connector_error`, `llm_output_invalid`, `auth_error`, `missing_api_key`, `credit_exhausted` or `model_not_found` — and `lastFailedAt`, `lastFailureCode` and `lastFailedRunId` name the last of them. A success sets the count back to `0`, and any other failure neither counts nor resets it. A schedule that has paused itself (`enabled: false` with `lastSkipReason: "paused_after_failures"`) is the exception: it keeps the count that paused it, even when a run still in flight at the pause succeeds afterwards, and only a `PUT` clears it. When a schedule's count reaches five, the platform sets `enabled: false` and `lastSkipReason: "paused_after_failures"`, writes an `automation.trigger.paused` audit row, and notifies the organization's Owners and Admins. Fix the automation, then `PUT` the trigger with `enabled: true`. Every `PUT` resets the count and clears that reason, and one that omits `enabled` turns the trigger back on, since `enabled` defaults to `true`. Webhook and event bindings keep the count but are never paused (contract 3.1.0). -The `PUT` also returns `deployed`: binding before deploying is accepted, and a trigger bound to an automation with no deployed version starts nothing — every occurrence is skipped as `not_deployed`, which the row's `trigger` on `GET /api/v1/automations` shows — until a version is deployed. +The `PUT` also returns `deployed`: binding before deploying is accepted, and a trigger bound to an automation with no deployed version starts nothing — every occurrence is skipped as `not_deployed`, which the row's `trigger` on `GET /api/v1/automations` shows — until a version is deployed. A schedule's answer adds `nextRunAt`. When a version is deployed, the answer adds `warnings` for what that version would make of the trigger's input; the trigger is saved either way. `TRIGGER_INPUT_MISMATCH` means its `inputs` schema refuses what the trigger hands a run, naming the required fields it lacks under `params.missing` (a webhook's body is not judged), and `TRIGGER_INPUT_NOT_TEMPLATED` means the fixed input holds a template, which arrives as text. ## Start a run, then poll it @@ -672,6 +708,42 @@ Listings answer summaries — identity, scope, status and timing, each row namin `GET /api/v1/runs` is the cross-cutting view: every run the key holder can see, organization runs and the runs of visible projects alike, each row naming its `projectId`. For an automation with no bindings, `POST /api/v1/automations/{name}/runs` starts a non-project run; a bound automation returns **409** there. `GET /api/v1/automations/{name}/runs` and `/api/v1/runs/{runId}` expose only non-project runs. A project run requires its project URL for reading, cancellation and deletion. `DELETE /api/v1/projects/{id}/runs/{runId}` (or `/api/v1/runs/{runId}`) removes a finished run — stored input and output included — under the developer capability; a run still in flight returns **409** `RUN_ACTIVE`, so cancel it first. +### Read a run step by step + +`GET /api/v1/runs/{runId}/record` (or the project form) answers the run's record: every step in the order it runs — the run input as `__start`, the version's steps, the document output as `__end` — with its status, times and attempts, the decisions that ran or skipped it (each condition explained with the values it read), why it produced no output, followed back to the cause, why it failed (a `reason` from a fixed list, with the `params` it is worded with), and glimpses of what it received and returned. The values themselves stay out of the record: read one step whole at `…/record/node?node=`, and add `item` or `pass` for one of its items or passes. `…/record/items?node=` pages a step's items and passes; `status=failed` keeps the ones that failed. `…/compare/{otherRunId}` compares two runs of the same automation step by step and names the first step where they went different ways; runs of different automations return **400** `RUN_COMPARE_MISMATCH`. Each read takes the same access as reading the run, and secrets are withheld everywhere. + +To follow a run while it works, pass the record's `cursor` back as `since`: the answer then carries only the steps written since and the events since — merge steps by `path` and events by `id`. A record stays under 512 KiB and one step under 256 KiB; `truncated` says what was left out to fit. These reads need API contract 3.29.0. + +```bash +curl -sS --compressed "https://your-host.example.com/api/v1/runs//record" \ + -H "Authorization: Bearer $TALE_API_KEY" \ + -H "X-Organization-Slug: " +# → 200 { "format": 1, "nodes": [{ "path": "__start", "status": "succeeded", … }, +# { "path": "triage", "status": "skipped", "skip": { "reason": "when", … }, +# "decisions": [{ "kind": "when", "result": false, "explanation": [ … ] }] }, …], +# "cursor": 1758210000000 } +``` + +### Run a run again + +`POST /api/v1/runs/{runId}/replay` (or the project form) starts a new run of the same automation, in the run's own scope: with the run's input (`"kind": "again"`), with an `input` you send (`"edited"`), or from one step (`"from"` with `from`). A replay from a step reuses the steps the run finished outside that step and what it feeds — their results and their record, never their effects — and runs the rest; the new run's `replayOf` names the run it replays. `version` picks the version (`same` by default, or `deployed`, `latest`, a number) and `mode` the mode (the run's own by default). A live replay needs the developer capability and the deployed version, and a replay from a step of a mock run stays mock (**409** `REPLAY_MODE_MISMATCH`). + +A step that writes runs again and writes again, under a new request key, so services that ignore repeated requests won't treat it as a repeat. Plan first: `GET …/replay` with the same request in the query answers what it reuses, what runs again, what each step does outside Tale, and `writesAgain`, the writes that go out a second time — or the `refusal` it would meet: the run has not finished (`REPLAY_RUN_NOT_FINISHED`), the version to run changed what a reused step computes (`REPLAY_GRAPH_CHANGED`, with the steps), no such step (`REPLAY_NODE_UNKNOWN`), or the run kept no input (`REPLAY_INPUT_UNAVAILABLE`). Send `Idempotency-Key` to make the replay safe to retry. These doors need API contract 3.29.0. + +```bash +curl -sS --compressed "https://your-host.example.com/api/v1/runs//replay?kind=from&from=send" \ + -H "Authorization: Bearer $TALE_API_KEY" \ + -H "X-Organization-Slug: " +# → 200 { "reuse": [{ "nodeId": "fetch", "status": "ok" }], "rerun": [{ "nodeId": "send", "effect": "write", … }], +# "writesAgain": 1, … } +curl -sS --compressed -X POST "https://your-host.example.com/api/v1/runs//replay" \ + -H "Authorization: Bearer $TALE_API_KEY" \ + -H "X-Organization-Slug: " \ + -H "Content-Type: application/json" -H "Idempotency-Key: fix-4711" \ + -d '{ "kind": "from", "from": "send" }' +# → 202 { "runId": "...", "version": 3, "mode": "live", "kind": "from", "reused": 1 } +``` + ## Act for a member: answer a run’s question, decide a task’s review A run parked on `waitingFor: "ask"` waits on a person; a task in `in_review` can wait on a person or a designated agent. These two REST doors relay a person's gesture from another application and name that person as `actor`, so Tale records the person rather than the key. Both doors need API contract 1.16.0; contract 3.11.0 adds the explicit refusal of human approval while a task review belongs to an agent. @@ -951,7 +1023,7 @@ What you can threshold on is `similarity` — the dense leg's cosine on the embe Each hit carries its passage, its leg `score` (the first matched leg's own number) and its `source`; `diagnostics.cached` and `diagnostics.reranked` are always `false` — Tale ships no semantic cache and no reranker, and both flags stay for compatibility; `diagnostics.legs` names every leg that ran with the admitted candidates it contributed, `0` when it ran and nothing survived (`documents:dense: 0` is a vector leg that found nothing in scope, never a missing one), and `diagnostics.dense` is `false` only when the corpus could not serve the vector leg at all, as `diagnostics.bm25` is for the keyword index; passages carry no control characters other than tab, line feed and carriage return; a passage repeated inside one document — an export of one line, a templated report — is indexed once, through its first occurrence, so a duplicate-heavy file neither crowds the vector leg nor ranks its copies one by one; a documents hit also carries `source.documentId` beside the blob `ref` the index keys it by: for a Hub hit (`source.projectId` null) it is the id `GET /api/v1/documents/{id}` takes, for a project hit the file id the project routes take (`GET /api/v1/projects/{projectId}/files/{documentId}/content`, `DELETE .../files/{documentId}`) — `/api/v1/documents/{id}` returns **404** for a project file. -A missing embedding model returns **409**, `EMBEDDING_NOT_CONFIGURED`; so does an embedding provider that refuses for account reasons — a spent balance, a spend limit, or a plan that excludes the model — as **409**, `EMBEDDING_CREDIT_EXHAUSTED`; a credential the provider rejects, or one it refuses the model, is **409**, `EMBEDDING_CREDENTIAL_REJECTED` — fix the provider settings. The same **409**, `EMBEDDING_CREDENTIAL_REJECTED`, answers when the platform has no usable credential to send at all: the provider has no default credential, or the one the embedding settings name was deleted, disabled or cannot be read; `error` names which. None of these is a rate limit: no wait lifts them, an admin has to act. Any other provider failure returns **503**, `EMBEDDING_UPSTREAM_ERROR`, with `Retry-After` — retry that one with backoff. +A missing embedding model returns **409**, `EMBEDDING_NOT_CONFIGURED`; so does an embedding provider that refuses for account reasons — a spent balance, a spend limit, or a plan that excludes the model — as **409**, `EMBEDDING_CREDIT_EXHAUSTED`; a credential the provider rejects, or one it refuses the model, is **409**, `EMBEDDING_CREDENTIAL_REJECTED` — fix the provider settings. The same **409**, `EMBEDDING_CREDENTIAL_REJECTED`, answers when the platform has no usable credential to send at all: the provider has no default credential, or the one the embedding settings name was deleted, disabled or cannot be read; `error` names which. None of these is a rate limit: no wait lifts them, an admin has to act. Any other provider failure returns **503**, `EMBEDDING_UPSTREAM_ERROR`, with `Retry-After` — retry that one with backoff. Embedding the query is a model request the key holder pays for: a budget cap that binds the key holder, one of their teams, the searched project, the organization or the key returns **429**, `BUDGET_EXCEEDED`, before anything is searched — `data` names the cap and `Retry-After` the wait until its period resets. To search visible non-project Hub and team documents or registered websites instead, use `POST /api/v1/knowledge/search` with `corpus` set to `"documents"`, `"web"` or `"all"` (the default). That URL excludes project files and email attachments. Both URLs find file-backed documents only — a document created with inline `content` never indexes. @@ -1285,6 +1357,8 @@ A task read also carries its schedule, which is read-only on this API. `startDat A comment's canonical `body` is trimmed and takes 1 to 10,000 UTF-16 code units (most emoji count as 2). Comment writes also accept an optional `bodyByLocale`, which comment reads return when present. Supply equivalent nonblank translations for `en`, `de` and `fr`; additional language or language-region keys such as `nl`, `it` and `de-CH` are allowed. Each value is trimmed and held to the same limit, with at most 16 locales per comment. Render the reader's exact locale, then its base language, then `en`, then `body`. Attribution remains the key holder's. A plain-text edit in Tale clears the old translations so they cannot hide the edit. +A mention is stored as a Markdown link that names whom it mentions: `[@Ada Lovelace](mention:user/)`, or `agent/` with a project agent's ID, or `automation/` with an automation's store name. When you post `@` followed by an agent's `handle`, a member's email name, an automation's store name or an ID, Tale stores that link, and the mention keeps working after a rename. Text written before contract 3.24.0 keeps naming the agents it named: an agent still answers to its name as it was then, in lowercase with dots for spaces or without spaces. The text in brackets is the name when the comment was saved; `bodyText` returns the comment with each mention as `@` and the current name, so match words against `bodyText` and show `body`. A mention of someone who cannot open the task, of an agent of another project or of anyone outside the organization is stored as plain text and notifies nobody, and inside code a mention is plain text. Task reads return `description` in the same stored form, with `descriptionText` beside it. The task intake stores its description's mentions the same way and notifies nobody; a task whose `externalSystem` is `github` or `glitchtip` keeps that tracker's `@names` as written (contract 3.24.0). + Task and workflow agents receive instructions to preserve the language established by the task title and description, falling back to the organization's default agent language. Generated title-template words, quarter identifiers, source-document languages and the run starter's UI locale do not establish the task language. The same policy applies to operator questions, resumed turns and related task creation. This is model guidance; localized progress snapshots let clients select a translation independently of the canonical task language. Read the run output and task comments to collect the automation's results. Whether it also creates files, and where it stores them, depends on the workflow; starting a task does not by itself put files in the example quarter folder. @@ -1364,7 +1438,7 @@ Body validation rejects missing required values, incorrect types, unknown keys, | **408** | the request did not finish arriving within 15 minutes, headers and body together (`REQUEST_TIMEOUT`); the envelope carries a fresh `requestId` (the timed-out request never got one of its own) and the connection is closed — retry on a faster link or in smaller pieces. | | **431** | the request headers as a whole exceed the edge's 64 KiB budget; answered without the envelope and with no `X-Request-Id` (the edge's parser writes it before any route runs) on HTTP/1.1 (which lets a few KiB of slack through first — a URL or header just past the budget still reaches the platform and is judged by its rules, a 66 KiB URL answering **414**), and on HTTP/2, where the budget is exact, by closing the connection. | | **500** | internal error (`INTERNAL_ERROR`); the envelope carries a `requestId` to quote when you report it. | -| **503** | a dependency the request needed is down: the platform's database, while it restarts or cannot be reached (`DATABASE_UNAVAILABLE`, with `Retry-After` and a `requestId` — on any operation and the webhook trigger, the key check included, so a working key is never refused with **401** meanwhile), the embedding provider (`EMBEDDING_UPSTREAM_ERROR`, with `Retry-After`), the object store behind a file download (`OBJECT_STORE_UNAVAILABLE`, with `Retry-After`) or a deployment without one (`OBJECT_STORE_UNCONFIGURED`), a document purge that could not finish (`PURGE_INCOMPLETE`), or an object store that accepted a knowledge-entry write and never answered it within 30 seconds (`KNOWLEDGE_ENTRY_STORE_TIMEOUT` — nothing is written) — retry with backoff. | +| **503** | a dependency the request needed is down: the platform's database, while it restarts or cannot be reached (`DATABASE_UNAVAILABLE`, with `Retry-After` and a `requestId` — on any operation and the webhook trigger, the key check included, so a working key is never refused with **401** meanwhile), the embedding provider (`EMBEDDING_UPSTREAM_ERROR`, with `Retry-After`), the object store behind a file download (`OBJECT_STORE_UNAVAILABLE`, with `Retry-After`) or a deployment without one (`OBJECT_STORE_UNCONFIGURED`), a document purge that could not finish (`PURGE_INCOMPLETE`), the people, agents and automations a comment or a new task's description mentions (`MENTION_DIRECTORY_UNAVAILABLE` — nothing is posted or created), or an object store that accepted a knowledge-entry write and never answered it within 30 seconds (`KNOWLEDGE_ENTRY_STORE_TIMEOUT` — nothing is written) — retry with backoff. | | **502**, **503**, **504** | answered at the edge while the platform restarts or cannot be reached (`UPSTREAM_UNAVAILABLE`, with `Retry-After`, a fresh `requestId` and no `X-Tale-Api-Version`), on every machine endpoint — `/api/*`, `/events`, `/status.json`, `/openapi.json`, `/.well-known/*`; a browser navigation gets the maintenance page instead — retry with backoff. | Unbinding a trigger from an existing automation (`DELETE .../triggers`) returns **204** whether or not a trigger was bound; an unknown automation returns **404**. Deleting a resource returns **404** when it is absent, including a contact already moved to trash, a product already deleted or a knowledge entry already deleted. A contact's `DELETE` is a move to the trash (`POST /api/v1/contacts/{id}/restore` brings it back); a product's `DELETE` is permanent — products have no trash and no restore, and the name and `externalId` are free for a new product at once, which is a new row with a new id. It takes the product's uploaded image with it (as does a `PATCH` that replaces or removes `imageUrl`) unless another product still shows the same upload; under an active legal hold — the organization's, or a custodian hold on the image's uploader — the delete is refused with **409**, `LEGAL_HOLD_ACTIVE`, and a patch keeps the superseded image. Deleting an active knowledge entry retires every version of its topic and moves the Hub document behind it to the trash — and drops that document's passages from the search corpus at once; deleting that document directly is refused. diff --git a/docs/en/develop/connectors.md b/docs/en/develop/connectors.md index 2d4cc00851..d7f5a628b6 100644 --- a/docs/en/develop/connectors.md +++ b/docs/en/develop/connectors.md @@ -25,6 +25,8 @@ auth: - method: api-key ``` +A connector named with ordinary words, such as `task` (Tasks), also declares `i18n.de.displayName` and `i18n.fr.displayName`. A connector named after a product, such as Tavily, keeps its name in every language. + ### Set the destination boundary | Field | Meaning | @@ -47,6 +49,7 @@ Adding a connector is a source contribution. The runtime reads the platform cata | Field | Contract for the author and caller | | --- | --- | | `name`, `description` | Stable snake_case action name and an explanation of when to use it | +| `title`, `i18n` | The action in words for people: a short English `title` in sentence case, without the connector's name ("List issues"), plus `i18n.de.title` and `i18n.fr.title` (and `de-CH` where the Swiss spelling differs). The automation canvas shows a node as "GitHub · List issues" in the reader's language; a shipped action without all three fails the catalog's tests | | `input` | Object JSON Schema, validated before execution; describe fields and mark required ones | | `output` | TypeScript-style signature describing the result; this is documentation, not a runtime output validator | | `effects` | `read` or `write`; writes pass through approval policy | diff --git a/docs/en/develop/mcp-endpoint.md b/docs/en/develop/mcp-endpoint.md index 46cc945103..c3b4510f28 100644 --- a/docs/en/develop/mcp-endpoint.md +++ b/docs/en/develop/mcp-endpoint.md @@ -21,7 +21,7 @@ Create an [API key](/platform/admin/api-keys) and keep it in your client's secre | Transport | HTTPS POST with JSON-RPC; plain JSON responses | | Authorization | `Authorization: Bearer ` | | Organization | `X-Organization-Slug: ` | -| Protocol revisions | `2025-06-18`, or `2025-03-26` when proposed by the client | +| Protocol revisions | `2026-07-28`, carried by every request; or `2025-11-25`, `2025-06-18` or `2025-03-26`, opened with `initialize` ([Protocol revisions](#protocol-revisions)) | Use a client that supports a remote HTTP endpoint with custom headers. There is no SSE event stream, session deletion, or OAuth authorization flow. OAuth discovery URLs return JSON `404`; a client requiring that flow needs a different authentication configuration. A client that only launches local stdio servers cannot use this URL directly. [Use Tale from your editor or a script](/develop/use-tale-from-your-editor) has ready configurations for opencode and Claude Code. @@ -36,43 +36,70 @@ curl --fail-with-body "$TALE_URL/api/v1/mcp" \ --header "Authorization: Bearer $TALE_API_KEY" \ --header "X-Organization-Slug: $TALE_ORG_SLUG" \ --header 'Content-Type: application/json' \ - --data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"docs-client","version":"1.0.0"}}}' + --data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"docs-client","version":"1.0.0"}}}' ``` -The response identifies the server as `tale-platform`. Read `result.protocolVersion` and send that negotiated value as `MCP-Protocol-Version` on later calls. The next example uses `2025-06-18`; replace it if your initialization negotiated the older revision. An unsupported header value returns `400`. +The response identifies the server as `tale-platform` and reports the API contract version as `serverInfo.version`. Its `instructions` are a short guide to working with Tale that your client can hand to its model. Read `result.protocolVersion` and send that negotiated value as `MCP-Protocol-Version` on later calls. The next example uses `2025-11-25`; replace it if your initialization negotiated an older revision. A revision the endpoint does not speak returns `400` with JSON-RPC `-32022`, and `data.supported` lists the ones it does. ```bash curl --fail-with-body "$TALE_URL/api/v1/mcp" \ --header "Authorization: Bearer $TALE_API_KEY" \ --header "X-Organization-Slug: $TALE_ORG_SLUG" \ - --header 'MCP-Protocol-Version: 2025-06-18' \ + --header 'MCP-Protocol-Version: 2025-11-25' \ --header 'Content-Type: application/json' \ --data '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_docs","arguments":{}}}' ``` -A successful `get_docs` result contains the automation reference as text and has no error flag set. To inspect tool schemas instead, send `method: "tools/list"`. The current inventory has 22 tools. Keep the JSON-RPC `id` so a client can match a result to its request. +A successful `get_docs` result contains the automation reference as text and has no error flag set. Add `"arguments":{"topic":"triggers"}` for the triggers reference (each trigger kind's fields, the input its runs start with, and the events), `"validation"` for how to read a validation result and every issue code, `"settings"` for every kind of setting with its fields ([Settings over MCP](/develop/mcp-settings)), or `"skill"` for the [Tale skill](/develop/use-tale-from-your-editor#tale-skill). To inspect tool schemas instead, send `method: "tools/list"`. Keep the JSON-RPC `id` so a client can match a result to its request. ### Transport and batches | Request | Response behavior | | --- | --- | | One JSON-RPC message | One JSON-RPC result or error | -| Batch of up to 20 messages | An array of responses; notifications have no response entry | +| Batch of up to 20 messages (2025 revisions only) | An array of responses; notifications have no response entry | | Notifications only | HTTP `202` | | `OPTIONS` | HTTP `204`, `Allow: POST, OPTIONS`; no key required | | Any other HTTP method | HTTP `405`, `Allow: POST, OPTIONS` | -Every additional tool call in a batch consumes the same request budget as a separate call. If a batch exhausts its budget, the refused entry is JSON-RPC `-32000` with `data.retryAfterMs`; the enclosing HTTP response remains `200` and has no `Retry-After`. A single request rejected at the HTTP boundary gets REST `429`. Handle both cases using the [rate-limit guidance](/develop/rate-limits). +Every additional tool call, resource read or listing, or prompt in a batch consumes the same request budget as a separate call. If a batch exhausts its budget, the refused entry is JSON-RPC `-32000` with `data.retryAfterMs`; the enclosing HTTP response remains `200` and has no `Retry-After`. A single request rejected at the HTTP boundary gets REST `429`. Handle both cases using the [rate-limit guidance](/develop/rate-limits). -The endpoint supplies no CORS headers for browser key use. Keep the API key on a trusted server or in the MCP client's credential store. +The endpoint supplies no CORS headers for browser key use. Keep the API key on a trusted server or in the MCP client's credential store. A request whose `Origin` header names a site the deployment does not accept is logged, and refused with `403` `ORIGIN_FORBIDDEN` where the operator enforces that check ([environment reference](/self-hosted/configuration/environment-reference#mcp-endpoint)). Coding agents in a terminal send no `Origin`. + +### Protocol revisions {#protocol-revisions} + +The endpoint serves two generations of the protocol on the same URL and key, and decides for each request which one it is. A client that speaks `2026-07-28` sends no `initialize`: every request carries its revision and the client's capabilities, so nothing is kept between requests. + +| | `2025-11-25`, `2025-06-18`, `2025-03-26` | `2026-07-28` | +| --- | --- | --- | +| Start | `initialize`, then the negotiated revision in `MCP-Protocol-Version` | No handshake; `server/discover` returns what the server speaks | +| Every request | The JSON-RPC message | `params._meta` with `io.modelcontextprotocol/protocolVersion` and `io.modelcontextprotocol/clientCapabilities`; the headers `MCP-Protocol-Version` and `Mcp-Method`, plus `Mcp-Name` for `tools/call`, `resources/read` and `prompts/get` | +| Batches | Up to 20 messages | One message per request | +| Results | As described on this page | Also `resultType: "complete"` and the server under `_meta["io.modelcontextprotocol/serverInfo"]`; `server/discover`, the lists and `resources/read` add `ttlMs` and `cacheScope: "private"` | +| `initialize`, `ping` | Answered | HTTP `404` with JSON-RPC `-32601` | +| An address that reads nothing | `-32002` | `-32602` | + +A request is served as `2026-07-28` when its `_meta` names a revision or its `MCP-Protocol-Version` header names `2026-07-28`. Its headers must repeat what the body says. A missing header, or one that names another revision, method, tool, prompt or address, is refused with HTTP `400` and JSON-RPC `-32020` before anything runs. Send an `Mcp-Name` value that is not plain ASCII as `=?base64??=`. A missing or malformed `_meta` returns `-32602` with HTTP `400` and names the keys under `data.missing` or `data.malformed`. + +```bash +curl --fail-with-body "$TALE_URL/api/v1/mcp" \ + --header "Authorization: Bearer $TALE_API_KEY" \ + --header "X-Organization-Slug: $TALE_ORG_SLUG" \ + --header 'MCP-Protocol-Version: 2026-07-28' \ + --header 'Mcp-Method: server/discover' \ + --header 'Content-Type: application/json' \ + --data '{"jsonrpc":"2.0","id":1,"method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"docs-client","version":"1.0.0"}}}}' +``` + +The answer lists every revision under `supportedVersions` and carries the same capabilities and `instructions` as `initialize`, with the server under `_meta`. `ttlMs` says how long your client may reuse an answer: an hour for `server/discover`, the tool, prompt and template lists and the references; a minute for `resources/list` and the connector catalog; `0` for an automation or a run, because it can change with your agent's next save. Every answer belongs to the key that asked, so a cache must never share it with another key. The name in `io.modelcontextprotocol/clientInfo` is recorded with each call and with the changes the call makes, so a version an agent saves names the client that saved it. ## The tools -`tools/list` is the source for each tool's input schema. Missing, mistyped, blank, or unexpected arguments receive JSON-RPC `-32602` before execution. The document passed to `validate_automation`, `run_automation`, `test_automation`, or `save_automation` is intentionally an open envelope: `get_docs` explains its grammar, and the engine validates its contents. +`tools/list` is the source for each tool's input schema, and a read tool also states its answer in `outputSchema`. Arguments are checked before execution: missing, mistyped, blank, or unexpected ones are refused with one tool result marked `isError`, whose `code` is `INVALID_ARGUMENTS` and whose `data.issues` lists every problem with its `path`, `code`, and `message`. The refusal never repeats an argument's value. Every result carries its answer as compact JSON text, and a read tool's successful answer also comes as `structuredContent`, the same object. The document passed to `validate_automation`, `run_automation`, `test_automation`, or `save_automation` is intentionally an open envelope: `get_docs` explains its grammar, and the engine validates its contents. -Tools also expose `readOnlyHint`, `destructiveHint`, `idempotentHint`, and `openWorldHint`. Hosts can use these annotations to explain a call, but they do not grant permission or guarantee safety. Reads are marked read-only; saving writes a version; deployment and trigger changes can replace existing state; live runs can contact real services. +Tools also expose `readOnlyHint`, `destructiveHint`, `idempotentHint`, and `openWorldHint`. Hosts can use these annotations to explain a call, but they do not grant permission or guarantee safety. Reads are marked read-only; saving writes a version; deployment, deletion, installation, trigger and settings changes can replace existing state; live runs and some settings changes can contact real services. Deploying, deleting, setting a trigger, installing an automation in projects, answering a run's question, and changing settings also carry `_meta["anthropic/requiresUserInteraction"]`, so a client that honors it asks the person before every such call. -### Authoring +### Authoring {#authoring} | Tool | What it does | | --------------------- | ---------------------------------------------------------- | @@ -81,14 +108,21 @@ Tools also expose `readOnlyHint`, `destructiveHint`, `idempotentHint`, and `open | `search_catalog` | Search the node-type catalog by keyword. | | `validate_automation` | Validate an automation document without saving it: its errors and warnings, each with its location, plus the flow analysis and the inferred types. | | `run_automation` | Run an automation document directly against the deterministic mocks. | -| `test_automation` | Run an automation's own acceptance tests. | -| `save_automation` | Save an automation document as a new immutable version; the answer lists its warnings. | -| `get_automation` | Read one saved version — the latest when unversioned, `version: "deployed"` for the live one (`AUTOMATION_VERSION_UNKNOWN` while nothing is deployed). | +| `test_automation` | Run an automation's own acceptance tests — of a draft (`automation`), or of a saved version (`name`, `version`), whose verdict is then recorded on the version. | +| `save_automation` | Save an automation document as a new immutable version; the answer lists its warnings. See [Save without losing work](#save). | +| `get_automation` | Read one saved version — the latest when unversioned, `version: "deployed"` for the live one (`AUTOMATION_VERSION_UNKNOWN` while nothing is deployed): the document under `automation`, its `settings`, `taskContract` and `presentation`, `latestVersion`, `deployedVersion`, who saved it (`createdBy`) through which door (`createdVia`: `app`, `upload`, `mcp`, `managed` or `system`; `null` for a version saved before it was recorded) and with which client (`clientName`), its `projectIds` and its `trigger`. | | `list_automations` | The organization's automations with their latest and deployed versions and the projects each is installed in (`projectIds`). | -| `deploy_automation` | Promote one saved version to be the live version. | +| `deploy_automation` | Promote one saved version to be the live version; an older one rolls back. `expectedDeployedVersion` (the version you read as live, `null` for none) refuses the deploy with `AUTOMATION_DEPLOYMENT_STALE` when another went live meanwhile; the answer names the `previousVersion`. | +| `delete_automation` | Delete an automation — every version, its trigger and its installations; its runs stay. `expectedLatestVersion` must be the latest version you read (`AUTOMATION_VERSION_STALE` otherwise); a run still going refuses the delete (`AUTOMATION_HAS_ACTIVE_RUNS`). | Use the authoring loop in this order: read the grammar and catalog, validate the document, run it against mocks, run its acceptance tests, save a version, then deploy that version. A successful mock run verifies the simulated path; it does not prove vendor credentials, network access, or real effects. +#### Save without losing work {#save} + +A version carries, beside the document, the `settings` form a task shows, the `taskContract`, and the `presentation` on the automations list. A save that leaves one of them out keeps the latest version's; `null` stores none (for `presentation`, the list then keeps showing the newest earlier one); a value is checked against the schema the app reads it with, and refused as `INVALID_ARGUMENTS` with every problem when it does not fit. The answer's `carried` names what was kept. + +Pass `baseVersion`, the version your edit started from. When someone saved a newer version meanwhile, the save is refused with `AUTOMATION_VERSION_STALE` and `data.latestVersion`; read that version, merge your change and save again. Without `baseVersion` the save appends, and `baseVersionChecked: false` says the check was skipped. Save a new automation with `create: true`: a name that already exists is refused (`AUTOMATION_NAME_TAKEN`), so a new automation never becomes a version of another one. A save is refused the same way, `create` or not, when the name belongs to an automation you cannot see. `projectId` installs a new automation in a project you can edit with its first version; a save of an automation that exists ignores it. + #### Read a validation result {#validation-result} `validate_automation` answers `valid`, `errors`, `warnings`, `analysis`, and `types`. Errors stop a save and a deployment; warnings never do. `save_automation` returns the `warnings` of the version it saved, and a refused save returns its `warnings` beside its `errors`, so you hear about both while you work. @@ -106,46 +140,120 @@ Use the authoring loop in this order: read the grammar and catalog, validate the `analysis.nodes.` says whether a node is `reachable`, whether it `alwaysRuns`, how it can be skipped (`maySkip`), and whether its failure stops the run (`failureHandling: "halts"`) or lets the run go on (`"continues"`). `analysis.paths` lists the ways a successful run can go, up to 32 of them with `count` for all, and names the nodes whose failure ends a run. `types` gives the JSON Schema of the run input, of each node's output, and of the automation's result; `get_catalog` gives each capability's `outputSchema` the same way. [What Tale checks before a run](/platform/automations/concepts#checks) explains each family of checks. -### Run & trigger management +`detail` chooses what comes beside the issues: `["analysis"]`, `["types"]`, or `[]` for the issues alone; left out, you get both. Some warnings compare the document with your organization instead of checking it: a skill no run of the automation can reach (`SKILL_UNKNOWN`), a connector nobody has connected (`CONNECTOR_NOT_CONNECTED`), a secret nobody has stored (`SECRET_UNKNOWN`, reported only to Owners, Admins and Developers), an agent runtime this deployment can't run (`HARNESS_UNKNOWN`), and an event trigger that waits for an event Tale doesn't raise (`EVENT_UNKNOWN`). They never stop a save; the [discovery tools](#discovery) list what exists. + +### Run & trigger management {#management} | Tool | What it does | | ---------------- | -------------------------------------------------------------------------------------------------------------- | | `run_deployed` | Run the deployed version live and WAIT for the finished result — output, trace and effects in one answer; a run that outlives the wait answers with its `runId` to poll. Takes the same optional `idempotencyKey` as `start_run`, on the same ledger the REST endpoint keeps: a repeat answers the first run with `duplicate: true` and starts nothing, whichever door started it. | -| `start_run` | Start the deployed version in the background and return a run handle immediately; poll get_run for the result. Takes an optional `idempotencyKey` — the REST endpoint's `Idempotency-Key`, the same ledger: the same key with the same arguments answers the first run's handle with `duplicate: true` and starts nothing, the same key with different arguments is refused (`IDEMPOTENCY_KEY_REUSED`). The `Idempotency-Key` HTTP header is refused on this endpoint (**400**, `INVALID_HEADER`) — a batch carries up to 20 calls, so the key rides in the tool arguments. | -| `list_runs` | Recent runs the key may read, newest first — of one automation or across the organization's projects; each names its `projectId`. | -| `get_run` | One run in full: status, output, trace, effects and `projectId` — a project run's id is the one `GET /api/v1/projects/{id}/runs/{runId}` takes. | +| `start_run` | Start a run in the background and return a run handle immediately; poll get_run for the result. `mode: "live"` (the default) runs the deployed version for real; `mode: "mock"` runs any saved version — the latest when `version` is omitted — against the deterministic mocks, and the run is recorded in the run history like one started in the app. Takes an optional `idempotencyKey` — the REST endpoint's `Idempotency-Key`, the same ledger: the same key with the same arguments answers the first run's handle with `duplicate: true` and starts nothing, the same key with different arguments is refused (`IDEMPOTENCY_KEY_REUSED`). The `Idempotency-Key` HTTP header is refused on this endpoint (**400**, `INVALID_HEADER`) — a batch carries up to 20 calls, so the key rides in the tool arguments. | +| `list_runs` | Recent runs the key may read, newest first — of one automation or across the organization's projects; each names its `projectId`. `mode` and `statuses` filter, and `nextCursor` (null on the last page) is the `cursor` of the next older page; pass it unchanged with the same filters. | +| `get_run` | One run in full: status, output, trace, effects and `projectId` — a project run's id is the one `GET /api/v1/projects/{id}/runs/{runId}` takes. A run waiting on a person's answer (`waitingFor: "ask"`) names the question under `ask`: its `askId` and the question. `detail` picks what to answer beside the status; `detail: []` answers the status alone, for polling a long run. `include: ["record"]` adds the run step by step under `record`: each step's status, why it ran or was skipped — each condition explained with the values it read — why it failed (`failure.reason` and its explanation), and glimpses of its values; `include: ["travels"]` adds the data that travelled between steps. | +| `get_run_node` | One step of a run read whole — or one of its items or passes (`item`, `pass`): what it received and returned, secrets withheld; where each `{{ }}` unit's text landed; what it read from earlier steps; how its output differs from its input; and its call to a connector or a model. A step the record doesn't hold is refused (`NODE_RUN_NOT_FOUND`). | +| `compare_runs` | Two runs of one automation side by side (`a`, the earlier, and `b`): what changed in the version, how input and output differ, each step's status and decisions, and the first step where the runs went different ways, with the values that flipped its condition. Runs of different automations are refused (`RUN_COMPARE_MISMATCH`). | +| `replay_run` | Run a run again, in its own project: with its own input (`kind: "again"`), with an edited `input` (`"edited"`), or from one step (`"from"` with `from`) — the steps it finished outside that step and what it feeds are reused, the rest run anew. `version` picks the version (the run's own by default), `mode` the mode (the run's own; a fork of a mock run stays mock). `dryRun: true` answers the plan instead — what is reused, what runs again, and how many writes go out a second time. A live replay needs the developer role and the deployed version; refusals: `REPLAY_RUN_NOT_FINISHED`, `REPLAY_NODE_UNKNOWN`, `REPLAY_GRAPH_CHANGED` (with `data.nodes`), `REPLAY_MODE_MISMATCH`, `REPLAY_PROGRESS_UNREADABLE`, `REPLAY_INPUT_UNAVAILABLE`. Takes `idempotencyKey` like `start_run`. | | `cancel_run` | Stop a run at its next node boundary. | -| `list_versions` | One automation's immutable version history; each row says whether it is the `deployed` one, and `deployedVersion` names it beside the list (`null` while nothing is deployed). | +| `answer_run_ask` | Answer the question a waiting run asked a person (`get_run` answers it as `ask`, with the `askId` to pass); the run resumes on the answer, which is recorded as the key holder's. | +| `list_versions` | One automation's immutable version history; each row says whether it is the `deployed` one, who saved it through which door (`createdVia`, `clientName`), and `deployedVersion` names the live one beside the list (`null` while nothing is deployed). `deployments` lists when versions went live, newest first, with what was live before. | +| `set_automation_projects` | Install an automation in projects (`add`) and remove it from others (`remove`) in one change; the answer names what was `added`, `removed` and `unchanged`. Removing it from a project it is not in is refused (`AUTOMATION_NOT_INSTALLED`). | +| `get_automation_metrics` | The organization's run figures for 7, 30 or 90 days (`periodDays`), live runs by default or mock ones: runs by outcome, success rate, average duration, a per-day series and the busiest automations, each against the window before. | | `list_triggers` | What starts the automations (never the webhook secret). | | `delete_trigger` | Unbind an automation's trigger; its versions and run history stay. | -| `set_trigger` | Bind what starts the automation (schedule/webhook/event). A webhook's `token` is answered once, here, and never again — store it; `deployed` says whether deliveries will run: a trigger bound to an automation with no deployed version is stored and fires nothing until one is deployed. | +| `set_trigger` | Bind what starts the automation: a schedule (a repeat rule or a cron expression, in a time zone), a webhook or a platform event, each with an optional fixed `input`. The call replaces the whole trigger, so send back the `startDate` and `input` that `list_triggers` reads to keep them. A webhook's `token` is answered once, here, and never again — store it; `deployed` says whether deliveries will run: a trigger bound to an automation with no deployed version is stored and fires nothing until one is deployed. `warnings` say what the deployed version would make of the trigger's input. | | Choose | When | | --- | --- | | `run_automation` | Try an unsaved document against deterministic mocks; `mode: "live"` is refused | | `run_deployed` | Run the saved deployment live and wait up to 30 seconds; poll the returned `runId` if it continues | | `start_run` | Start the saved deployment in the background and poll `get_run`; pass `idempotencyKey` to make a retry safe | +| `start_run` with `mode: "mock"` | Run a saved version — deployed or not — against the mocks, with a record anyone can open in the run history | + +To fix a failed run, read it with `get_run {runId, include: ["record"]}`: the failed step's `failure.reason` names what went wrong and its explanation shows the values the expression read. `get_run_node` reads that step whole. Fix the document, try it with `run_automation` on the run's input, and once a new run finished, `compare_runs` shows where it went another way. Both deployed-run tools use the durable runner with the same authorization and execution records. `start_run` accepts an optional `projectId`. A project-bound automation must run in a project where it is installed; a sole binding can be selected automatically. With no bindings, omission means organization scope. Read `projectIds` from `list_automations` and the actual `projectId` from the returned handle rather than guessing a REST polling URL. -### Capabilities & knowledge +### Discovery {#discovery} + +| Tool | What it does | +| --- | --- | +| `list_models` | The models you may use, filtered by your model access: each with `providerSlug` (an `agent` node saves it as `modelProvider`), `lane` (`direct` when a provider serves it, `subscription` or `broker` when a member's subscription does), the `nodeTypes` it suits (an `llm` node takes only a directly served model) and the agent runtimes it is offered to (`harnesses`). `nodeType` and `harness` filter the list. | +| `list_harnesses` | The agent runtimes an `agent` node can name as `harness`, the `default` one that runs when it names none, and whether a subscription can serve each. | +| `list_skills` | The organization's skills; with `projectId`, also the team skills of that project, the ones a run in it can use. A project you can't read answers `PROJECT_NOT_FOUND`. | +| `list_connectors` | The connectors this deployment offers, whether your organization connected each (`connected`) and how many actions it has; `query` filters. `search_catalog` lists the actions. | +| `list_agent_secrets` | The names of the organization's agent secrets with a masked `preview`, never a value. Owners, Admins and Developers see them; anyone else gets an empty list with a `note`. | +| `list_projects` | The projects you can read: whether each is `writable` or `archived`, and the `automations` installed in it that you may see. `query` filters by name; `includeArchived` adds archived projects. | +| `list_events` | The events Tale raises, each with when it fires: what an event trigger can wait for. | + +Each answer carries a `hint` that names the tool or the setting that changes it. + +### Settings {#settings} + +| Tool | What it does | +| --- | --- | +| `get_settings` | Without `kinds`, the catalog: every kind of setting with what it is, its operations (`ops`) and actions (`acts`), its `baseRisk`, the Settings pages where a person makes the same change (`areas`), whether this deployment serves it over MCP (`available`), and whether your role may `read` and `write` it. With `kinds` — for one kind, also `ids` or the `cursor` of its next page — every resource you may read, with its `key`, its `config` and its `hash`. A kind you may not read is listed under `refused` with the reason. | +| `plan_settings` | Plan up to 32 changes without making any. Each answers its `action` (`create`, `update`, `delete`, `act` or `unchanged`), the `currentHash`, a `diff` member by member, its `effects` and its `risk` (`low`, `high` or `critical`), or the `refusal` that stops it. | +| `apply_settings` | Make the changes. `expected` maps each changed resource's `key` to the hash you read, or `null` for one you create. If a change is refused or a resource changed since you read it, nothing is applied. Otherwise the changes run in a fixed order across kinds, and the first one that fails stops the rest: the answer lists what was `applied`, what `failed` and what was `skipped`. | + +A change names its `kind`, the resource's `id` (left out for a kind with one resource) and its `op`: `set` replaces the resource with the whole `config`, creating it when it does not exist; `delete` removes it; `act` runs one of the kind's actions, with its `args`. Plan first, show the plan to the person, then apply the same changes: `apply_settings` asks the person before every call and uses a [budget](/develop/rate-limits) of its own. + +[Settings over MCP](/develop/mcp-settings) lists every kind of setting, who may change it and what stays in Tale. + +No secret travels through these tools. A stored secret reads as `{"masked": true, "preview": "…"}`; send that value back unchanged to keep it. A change that carries any other value in a secret's place, or a credential anywhere in its config, is refused with `SECRET_ARGUMENT_REFUSED`; a person enters a new secret in Tale. + +### Capabilities & knowledge {#capabilities} | Tool | What it does | | --------------------- | ------------------------------------------------------------------------------------------------------------------- | | `search_capabilities` | Search everything this organization can do — its deployed automations, by name and description. | -| `invoke_capability` | Invoke one capability by id. An action the organization gates returns a pending-approval result instead of running. | +| `invoke_capability` | Invoke one capability by id: a deployed automation, run live as `run_deployed` runs it. A step the organization gates for approval leaves the run waiting for a person to decide in Tale. | | `get_knowledge` | Retrieve passages from the organization's knowledge — its documents and its crawled web pages. `corpus` is `private` (documents), `public-web` (crawled pages) or `all`; the REST spellings `documents` and `web` are taken too. `query` is capped at 2000 characters. Each passage carries `text`, `source` (a title), `ref`, `corpus`, `chunkIndex`, `score`, `similarity` when the dense leg ranked it, `url` for a web page, and — for a document — the `documentId` that `GET /api/v1/documents/{id}` takes (a project file's id for a project hit) and its `projectId`, the same citation the REST search answers. | -The capability registry currently contains deployed automations. It does not include builtin tools, connector actions, skills, or external MCP servers. Invoking a deployed automation is the same live operation as `run_deployed`. If approval is needed, a `pending` result lets the client explain that a person must decide before execution continues. +The capability registry currently contains deployed automations. It does not include builtin tools, connector actions, skills, or external MCP servers. Invoking a deployed automation is the same live operation as `run_deployed`, and it waits up to 30 seconds for the run to finish the same way. When a step needs an [approval](/platform/approvals/concepts), the run waits for a person to decide in Tale: the answer's `output` is the run with `status: "waiting"`, and `get_run` shows `waitingFor: "approval"`. No tool approves or rejects it, so your client should tell the person rather than retry. Stopping the run with `cancel_run` withdraws the approval. + +## Resources and prompts {#resources-and-prompts} + +Besides tools, the endpoint serves resources, which a client reads by address, and prompts: ready-made requests a person starts work from. Both read what a tool already answers, for the same person and through the same checks. + +### Read by address {#resources} + +`resources/list` names the fixed resources, then every automation the key holder can see, 100 per page; follow `nextCursor` for the next page. `resources/templates/list` returns the address patterns, and `resources/read` returns a resource's contents. + +| Address | Contents | Read like | +| --- | --- | --- | +| `tale://docs/authoring`, `tale://docs/triggers`, `tale://docs/validation`, `tale://docs/settings`, `tale://docs/skill` | The references, as Markdown | `get_docs` with that `topic` | +| `tale://catalog/{kind}` (`transform`, `llm`, `agent`, `subautomation`, `connector`) | A core node kind's section of the reference, or the connector actions | `get_catalog` with that `kind` | +| `tale://automations/{name}` | The latest saved version, as JSON | `get_automation` | +| `tale://automations/{name}/versions/{version}` | One saved version; `{version}` is a number or `deployed` | `get_automation` with `version` | +| `tale://runs/{runId}` | One run with its output, trace and effects | `get_run` | + +Write each `/` in an automation name as `%2F`: `tale://automations/billing%2Fdunning`. An address that reads nothing returns JSON-RPC `-32002` (`-32602` on `2026-07-28`) with the refusal's code in `data.code`, such as `AUTOMATION_NOT_FOUND`; an automation the key holder cannot see returns the same error as one that does not exist. A malformed address, such as a version that is not a number, returns `-32602`. + +### Start from a prompt {#prompts} + +`prompts/list` names three prompts, and `prompts/get` returns the message with what it is about attached as a resource. Claude Code lists them as `/tale:edit_automation` and so on. + +| Prompt | Arguments | What it asks the agent to do | +| --- | --- | --- | +| `edit_automation` | `name` (optional) | Change the automation or create one, validate it, test it on the mocks and save it with `baseVersion`; it deploys nothing | +| `debug_failed_run` | `runId` | Explain why the run failed, reproduce the failure on the mocks and propose the smallest fix | +| `add_trigger` | `name`, `kind` (optional: `schedule`, `webhook` or `event`) | Decide what starts the automation, and ask before calling `set_trigger` | + +Each argument is a single word, because clients such as Claude Code split arguments at spaces. An argument sent empty counts as left out. A prompt whose run or automation the key holder cannot read returns `-32602` with that read's code. ## What the key may do | Operation | Required access | | --- | --- | -| Reads, validation, mock runs and acceptance tests, capability search, knowledge retrieval | Organization membership, plus the resource's normal access rules | -| Save, deploy, set/delete a trigger, cancel a run, or execute live | Developer capability, plus the resource's normal access rules | +| Reads, validation, mock runs (`start_run` with `mode: "mock"` included) and acceptance tests, capability search, knowledge retrieval | Organization membership, plus the resource's normal access rules | +| Answer a run's question | Organization membership; for a run in a project, edit access to that project | +| Agent secret names (`list_agent_secrets`) | Owner, Admin or Developer role; anyone else gets an empty list | +| Read, plan and change settings (`get_settings`, `plan_settings`, `apply_settings`) | What your role allows on the same Settings page; the catalog says what your role may do with each kind | +| Save, deploy, delete, install in projects, set/delete a trigger, cancel a run, or execute live | Developer capability, plus the resource's normal access rules | + +The key identifies its holder; it does not expand that person's role or project access. An automation installed only in projects the key holder cannot read is left out of `list_automations`, and every read of it answers `AUTOMATION_NOT_FOUND`, as for one that does not exist. Live `invoke_capability` calls also pass through the execution checks. -The key identifies its holder; it does not expand that person's role or project access. Live `invoke_capability` calls also pass through the execution checks. +Every change an MCP call makes to an automation — a version saved, a deploy, a delete, a trigger set or removed, an installation added or removed — is in the organization's audit log, marked as coming through MCP with the tool and the API key. In the event's details, **Source** reads Coding agent, and **Client** names the agent's app when it names itself on every call, as on revision 2026-07-28; an app on a 2025 revision names itself only on `initialize`, so its events show no **Client** ([Audit logs](/platform/admin/governance/audit-logs)). Read `GET /api/v1/me` before configuring privileged tools: `capabilities.developer` reports the current role gate, while `deploymentEditor` is a separate operator allowlist and does not authorize MCP authoring. The MCP tool-error envelope below still applies; a REST capability check does not change JSON-RPC error handling. @@ -153,16 +261,19 @@ Read `GET /api/v1/me` before configuring privileged tools: `capabilities.develop | Result | How to handle it | | --- | --- | -| JSON-RPC `-32601` | Correct the unknown method | -| JSON-RPC `-32602` | Correct the tool name or arguments using `tools/list`; a value outside an enumerated set is refused with the set named | +| JSON-RPC `-32601` | Correct the unknown method; on `2026-07-28` it comes with HTTP `404`, also for `initialize` and `ping` | +| JSON-RPC `-32602` | Correct the tool name using `tools/list`, a prompt's name or arguments using `prompts/list`, or a resource address. With HTTP `400`, complete the `2026-07-28` `_meta` named in `data.missing` or `data.malformed` | +| JSON-RPC `-32002` | The resource address reads nothing; `data.code` names the refusal, such as `AUTOMATION_NOT_FOUND`. On `2026-07-28` the same answer has the code `-32602` | +| JSON-RPC `-32020` (HTTP `400`) | A `2026-07-28` request's headers do not repeat its body; send `MCP-Protocol-Version`, `Mcp-Method` and `Mcp-Name` as described in [Protocol revisions](#protocol-revisions) | +| JSON-RPC `-32022` (HTTP `400`) | Send one of the revisions in `data.supported`: in `MCP-Protocol-Version`, and on `2026-07-28` also in `_meta`. A 2025 revision is opened with `initialize` | | Tool result with `isError: true` | Read its text payload's stable `code`, explanatory `error`, and actionable `hint`; `data` may contain field problems | | `validate_automation` with `valid: false` | Normal validation result; inspect `errors` and where each one is ([Read a validation result](#validation-result)), even though `isError` remains false. Warnings never make a document invalid | -| Capability result `pending` | Normal approval outcome; do not treat it as completion or retry it as a failure | +| Capability `output` with `status: "waiting"` | The run waits, for example for an approval a person gives in Tale; it has neither finished nor failed. Poll `get_run` and do not retry it | | Capability result `refused` | Error result; correct the stated cause | -Tool refusal codes include `AUTOMATION_NOT_FOUND`, `AUTOMATION_VERSION_UNKNOWN`, `AUTOMATION_NOT_DEPLOYED`, `RUN_NOT_FOUND`, `AUTOMATION_INVALID`, `AUTOMATION_TESTS_FAILING`, `LIVE_MODE_UNAVAILABLE`, and `NOT_SUPPORTED`. The latter means the host does not support that run/version/trigger operation. `start_run` refuses a reused `idempotencyKey` with different arguments as `IDEMPOTENCY_KEY_REUSED`; `invoke_capability` refuses an id the registry does not hold — a saved-only automation is not in it — as `CAPABILITY_NOT_FOUND` and input its schema rejects as `CAPABILITY_INPUT_INVALID`; `get_knowledge` lifts the knowledge endpoint's own codes through (`KNOWLEDGE_UNAVAILABLE` when the search itself failed). Platform errors retain their own code, hint, and optional data; for example, missing developer access returns `FORBIDDEN_DEVELOPER_SETTINGS`. +Tool refusal codes include `AUTOMATION_NOT_FOUND`, `AUTOMATION_VERSION_UNKNOWN`, `AUTOMATION_NOT_DEPLOYED`, `RUN_NOT_FOUND`, `AUTOMATION_INVALID`, `AUTOMATION_TESTS_FAILING`, `AUTOMATION_VERSION_STALE`, `AUTOMATION_DEPLOYMENT_STALE`, `AUTOMATION_NAME_TAKEN`, `AUTOMATION_HAS_ACTIVE_RUNS`, `AUTOMATION_NOT_INSTALLED`, `HUMAN_ASK_NOT_FOUND`, `HUMAN_ASK_NOT_PENDING`, `HUMAN_ASK_EXPIRED`, `EMPTY_ANSWER`, `INVALID_CURSOR`, `LIVE_MODE_UNAVAILABLE`, and `NOT_SUPPORTED`. The latter means the host does not support that run/version/trigger operation. `start_run` refuses a reused `idempotencyKey` with different arguments as `IDEMPOTENCY_KEY_REUSED`; `invoke_capability` refuses an id the registry does not hold — a saved-only automation is not in it — as `CAPABILITY_NOT_FOUND` and input its schema rejects as `CAPABILITY_INPUT_INVALID`; `get_knowledge` lifts the knowledge endpoint's own codes through (`KNOWLEDGE_UNAVAILABLE` when the search itself failed). Platform errors retain their own code, hint, and optional data; for example, missing developer access returns `FORBIDDEN_DEVELOPER_SETTINGS`. `INVALID_ARGUMENTS` lists every argument problem; a value outside an enumerated set is refused with the set named. `RATE_LIMITED` means the tool needed an execution, or a settings change, and the key holder's [budget](/develop/rate-limits) for it is spent: wait `data.retryAfterMs`. `INTERNAL_ERROR` means the call failed unexpectedly; its `data.requestId` is the id to quote to whoever runs the deployment. The settings tools add `SETTINGS_STALE` (a resource changed since you read it; `data.currentHash` is its hash now), `SECRET_ARGUMENT_REFUSED` (a change carried a secret; `data.places` says where, never what), `SETTINGS_KIND_UNAVAILABLE` (this deployment does not serve that kind over MCP), `SETTINGS_NOT_FOUND` (an action on a resource that does not exist) and `SETTINGS_DUPLICATE` (one resource changed twice in one call). -An unknown automation name is an error even for `list_versions`, `list_runs`, and `list_triggers`; an empty list means an existing automation has no matching items. The one exception is run history: a deleted automation keeps its runs, so `list_runs {name}` answers them for as long as they exist, and only a name that never ran is `AUTOMATION_NOT_FOUND`. `get_catalog` narrowed to a core node kind (`transform`, `llm`, `agent`, `subautomation`) answers an empty list with a `hint` pointing at `get_docs`, as `search_catalog` does. Invalid documents passed to tools that need a valid one, search failures, and missing deployments set `isError: true`. Only the validation tool reports an invalid document as its ordinary verdict. +An unknown automation name is an error even for `list_versions`, `list_runs`, and `list_triggers`; an empty list means an existing automation has no matching items. The one exception is run history: a deleted automation keeps its runs, so `list_runs {name}` answers them for as long as they exist, and only a name that never ran is `AUTOMATION_NOT_FOUND`. `get_catalog` narrowed to a core node kind (`transform`, `llm`, `agent`, `subautomation`) answers an empty list with a `hint` pointing at `get_docs`, as `search_catalog` does, and the kind's own section of the reference as `reference`. Invalid documents passed to tools that need a valid one, search failures, and missing deployments set `isError: true`. Only the validation tool reports an invalid document as its ordinary verdict. ## Where this fits diff --git a/docs/en/develop/mcp-settings.md b/docs/en/develop/mcp-settings.md new file mode 100644 index 0000000000..e9f49d0581 --- /dev/null +++ b/docs/en/develop/mcp-settings.md @@ -0,0 +1,129 @@ +--- +title: Settings over MCP +description: Let a coding agent read and change Tale settings through the MCP endpoint, within the role of the person whose API key it uses. +--- + +A coding agent connected to the [MCP endpoint](/develop/mcp-endpoint) can read your organization's settings, plan a change and make it with three tools: `get_settings`, `plan_settings` and `apply_settings`. It acts with the role of the person whose API key it uses. It can change what that person could change in the app, through the same checks, and the [audit log](/platform/admin/governance/audit-logs) records every change as that person's, made through MCP. + +## What an agent can change {#kinds} + +Tale reads and writes each kind of setting with its own code and the checks the app applies, so the role rules are the same as in the app. + +| Kind | What it holds | Changes | Who can change it | +| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `provider` | An AI provider your organization defined: its endpoint, API format and model catalog. The providers Tale ships are not settings. | Set, delete; read its model catalog again (`refresh-catalogs`) | Owners, admins and developers | +| `provider-credential` | A credential that reads its key from an environment variable of the deployment. Credentials with a key or a subscription are listed without their secret and can be removed. | Set, delete | Owners, admins and developers | +| `governance` | One organization policy, named by its key: models and model access, budgets and limits, sign-in and session security, guardrails, sandbox quotas. | Set | Owners and admins | +| `knowledge-embedding` | The embedding model of the organization's knowledge base, with its similarity floor and serving limits. | Set | Owners and admins | +| `branding` | The accent color and the file names of the logo and the favicons. | Set | Owners and admins | +| `project-instructions` | A project's standing instructions. | Set | Whoever can edit the project | +| `agent-instructions` | A project agent's instructions. | Set | Whoever can edit the project | +| `agent-tools` | The tools a project agent may use. | Set | Whoever can edit the project | +| `agent-model` | The agent runtime (harness), model and provider a project agent runs on. A change applies to the runs it starts next. | Set | Whoever can edit the project | +| `task-instructions` | A task's description. | Set | Whoever can change the task | +| `task-review-context` | Whether a task's work goes to an independent review by another project agent, and which agent reviews it. Once set, the reviewer stays the same. | Set | Whoever can edit the project | +| `deployment` | The deployment's own settings, shared by every organization on it, such as the sandbox runtime. | Set | An owner or admin of any organization on the deployment reads them; only the addresses on the deployment's editor allowlist change them | + +A resource has an id within its kind: a provider by its name, a credential as `/` with the name URI-encoded, a policy by its key such as `password_policy`, a project by its id, an agent as `/` and a task as `/`. The embedding model, the branding and the deployment settings have no id. `get_settings` lists project and agent settings page by page over the projects you can read; it reads a task's description and its review context only by the task's id. + +Some changes stay in Tale: + +- Every secret, such as a provider's API key, a subscription or the moderation provider's key, is entered by a person in Tale. +- The retention policy and the data subject request policy change through their own staged workflows. +- Branding images are uploaded in Tale. A file name an agent sets must name an image already uploaded. +- Over MCP, the embedding model itself changes only while the knowledge base holds no document and no website, so that vectors from two models never meet in one search. Its similarity floor and serving limits change at any time; with documents indexed, a person changes the model in Tale. +- A project's standard agent follows the `standard_agent` policy, which the `governance` kind changes; its own instructions, tools and model are not settings. +- No kind covers members, teams, connectors, skills, competences, legal holds, the audit log, metrics or personal settings. `get_settings` without arguments shows what each kind covers. + +## Make a change {#make-a-change} + +1. Call `get_settings` without arguments. It lists every kind, whether this deployment serves it, and whether your role may read and change it. +2. Read what you want to change with `get_settings` and `kinds` (and `ids`). Each resource comes with its `key`, its `config` and its `hash`. +3. Plan the change with `plan_settings`. A `set` replaces the whole resource with its `config`, so send every field it should keep, as you read it. The plan names each change's action, its diff, its effects and its risk, or the refusal that stops it. Nothing is written. +4. Show the plan to the person and wait for their decision. Put the effects and the risk first. +5. Apply the same changes with `apply_settings`. `expected` maps each changed resource's `key` to the hash you read, or to `null` for one you create. + +These are the arguments of a plan that turns on password rotation: + +```json +{ + "changes": [ + { + "kind": "governance", + "id": "password_policy", + "op": "set", + "config": { + "minLength": 12, + "requireUpper": true, + "requireLower": true, + "requireDigit": true, + "requireSpecial": true, + "rotationDays": 90 + } + } + ] +} +``` + +The plan answers the change with its effect on members, because rotation expires passwords that are already set. The hash is shortened here: + +```json +{ + "ok": true, + "changes": [ + { + "kind": "governance", + "id": "password_policy", + "key": "governance/password_policy", + "op": "set", + "action": "update", + "currentHash": "5c1f…", + "diff": [{ "path": "/rotationDays", "before": 0, "after": 90 }], + "effects": ["may-lock-out-members"], + "risk": "critical" + } + ] +} +``` + +To apply it, send the same `changes` with `"expected": { "governance/password_policy": "5c1f…" }`, using the full hash. Before anything is written, every change is planned again against what is stored now. If one is refused, or a resource changed since you read it, nothing is applied. Otherwise the changes run in a fixed order across kinds, so that what a resource refers to exists first. The first failure stops the rest, and the answer lists what was `applied`, what `failed` and what was `skipped`. A change that already landed is not undone. + +`apply_settings` asks the person before every call and uses a [budget](/develop/rate-limits) of its own. + +## Read a plan's effects {#effects} + +A plan's risk is the highest of its kind's base risk and its effects' risk. These are the effects the kinds served today can name: + +| Effect | Risk | When a plan names it | +| ------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------- | +| `may-lock-out-members` | critical | The sign-in lockout is on after the change, password rotation starts or gets shorter, or two-factor authentication becomes stricter | +| `signs-out-members` | critical | The idle timeout is turned on or gets shorter | +| `removes-human-approval` | critical | An approval rule or a review requirement no longer asks a person | +| `changes-serving-account` | high | A provider's endpoint changes, or another credential serves its requests | +| `breaks-dependents` | high | The provider's active default credential is removed and nothing replaces it | +| `requires-empty-corpus` | critical | The embedding model changes, which needs an empty knowledge base | +| `restart-required` | critical | The deployment's sandbox runtime changes | +| `reaches-vendor` | high | A provider's model catalog is read again with your organization's key | + +The settings reference that `get_docs` returns for the topic `settings` (also `tale://docs/settings`) lists the whole vocabulary, every kind's fields and every governance policy. + +## Secrets {#secrets} + +No secret goes into or comes out of a settings call. A stored secret reads as `{"masked": true, "preview": "…"}`, and so does any credential found elsewhere in a stored setting, such as a key someone pasted into a policy in Tale. Send that value back unchanged to keep what is stored there. A change that carries a secret is refused with `SECRET_ARGUMENT_REFUSED`, which names where the secret was found and never its value. A person enters a new secret in Tale. + +## When a change is refused {#refusals} + +A refusal is data with an `error`, a `code`, a `hint` and sometimes `data`, never a failed connection. These are the codes an agent meets most often: + +| Code | What it means | +| ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `SETTINGS_STALE` | The resource changed since it was read. Read it again, plan against what is stored now, and apply with `data.currentHash`. | +| `SETTINGS_INVALID` | The config is not the kind's. `data.issues` names every problem by its place in the config, including a field the setting does not have. | +| `SECRET_ARGUMENT_REFUSED` | The change carries a secret. `data.places` says where. | +| `SETTINGS_TALE_ONLY` | The change is made in Tale alone, for example a credential with a key. | +| `FORBIDDEN`, `ORG_FORBIDDEN`, `FORBIDDEN_DEVELOPER_SETTINGS` | The person's role cannot make this change in Tale either. Retrying does not help. | +| `EMBEDDING_CORPUS_NOT_EMPTY` | The embedding model changes only while the knowledge base is empty. `data` names how many documents and websites it holds. | +| `BRANDING_IMAGE_UNKNOWN` | A branding file name names no image uploaded to the organization. | +| `PROVIDER_IN_USE`, `CREDENTIAL_IN_USE` | Credentials still name the provider, or the embedding model uses the credential. Change those first. | + +The settings reference lists every code. The [MCP endpoint](/develop/mcp-endpoint#settings) page describes the tools' arguments and answers. diff --git a/docs/en/develop/rate-limits.md b/docs/en/develop/rate-limits.md index 4f0c749f4e..7ca0cff2e3 100644 --- a/docs/en/develop/rate-limits.md +++ b/docs/en/develop/rate-limits.md @@ -14,7 +14,8 @@ A token bucket refills continuously up to its burst capacity. A short batch can | Traffic | Sustained rate | Burst | Budget owner | | --- | --- | --- | --- | | General `/api/v1` traffic, including MCP and the model endpoints | 120/minute | 200 | Key holder | -| Run starts, model-message sends and task starts | 20/minute | 40 | Key holder | +| Run starts, model-message sends, task starts and MCP executions | 20/minute | 40 | Key holder | +| Settings changes over MCP (`apply_settings`) | 30/minute | 60 | Key holder | | Project upload handoff and file binding | 240/minute | 300 | Key holder | | Failed API-key authentication | 20/minute | 40 | Source IP | | Webhook deliveries before token validation | 120/minute | 240 | Sender address | @@ -24,7 +25,7 @@ REST execution and upload requests also consume the general budget. For example, Execution includes project and non-project automation starts, thread-message sends and explicit task starts. Task intake also consumes the execution budget when `runWorkflowSlug` is supplied. A starting-work request is charged once its body and headers have passed the endpoint's own checks — a `400 INVALID_BODY` or `INVALID_HEADER` spends nothing — and before anything is looked up, so a `404` for a thread, task or automation you cannot see costs a token, as does a `409` the state answers. Some mutations, such as task comments and folder changes, have additional domain budgets shared with the app. -MCP batches have their own accounting: additional tool calls consume additional request budget. See [MCP endpoint](/develop/mcp-endpoint) for the difference between an HTTP `429` and a refused message inside a batch. Webhook budgets are separate from API-key traffic; both sender and trigger limits must allow a delivery. +MCP batches have their own accounting: additional tool calls consume additional request budget. See [MCP endpoint](/develop/mcp-endpoint) for the difference between an HTTP `429` and a refused message inside a batch. An MCP tool that executes an automation (`run_automation`, `test_automation`, `deploy_automation`, `run_deployed`, `start_run` and `invoke_capability`) also uses one execution once the key holder's role allows the call, and so does `answer_run_ask`, whose answer resumes a waiting run as the REST answer does. When that budget is spent, the call is answered with a tool result whose `code` is `RATE_LIMITED` and whose `data.retryAfterMs` names the wait, not with an HTTP `429`. Reads, validation and saving use no execution. A settings change (`apply_settings`) uses one unit of its own settings budget the same way and is answered with `RATE_LIMITED` once that budget is spent; reading and planning settings use none. Webhook budgets are separate from API-key traffic; both sender and trigger limits must allow a delivery. Calls to the [model endpoints](/develop/api-reference#model-endpoints) under `/api/v1/openai` and `/api/v1/anthropic` count against the general budget only, one request each, streamed or not; what a call may spend is capped separately by budget rules. A person, and each API key, may also have eight of these calls running at once: a ninth answers `429` with `code` `MODEL_API_CONCURRENCY_EXCEEDED` and `Retry-After: 2`. diff --git a/docs/en/develop/use-tale-from-your-editor.md b/docs/en/develop/use-tale-from-your-editor.md index 2e4b9cf8ab..fe1fbbb71c 100644 --- a/docs/en/develop/use-tale-from-your-editor.md +++ b/docs/en/develop/use-tale-from-your-editor.md @@ -349,6 +349,36 @@ To share the server with a team through a committed `.mcp.json`, reference the k `claude mcp list` reports whether Claude Code can reach the server. +### Prompts and resources in Claude Code {#prompts-and-resources} + +With the server registered as `tale`, type `/` in Claude Code to find Tale's prompts: `/tale:edit_automation`, `/tale:debug_failed_run` and `/tale:add_trigger`. Put the arguments after the command, separated by spaces, for example `/tale:debug_failed_run `. Each prompt attaches what it is about and tells the agent to ask you before anything is deployed. + +Type `@` to mention a Tale resource, for example `@tale:tale://runs/` for a run or `@tale:tale://docs/triggers` for the triggers reference. Claude Code reads it with your key and attaches it to your message. [Resources and prompts](/develop/mcp-endpoint#resources-and-prompts) lists every address and prompt. + +### Install the Tale skill {#tale-skill} + +The Tale skill is a `SKILL.md` file in the Agent Skills format. It teaches your agent how to work in Tale: the editing loop, testing on the mocks, triggers, debugging a failed run, reading a refusal, and the rules it keeps, such as asking you before anything is deployed. It is not one of your organization's skills, and it names no host, organization or key, so one copy serves every project. Save it where your agent reads skills: + +| Agent | This project | All your projects | +| --- | --- | --- | +| Claude Code | `.claude/skills/tale/SKILL.md` | `~/.claude/skills/tale/SKILL.md` | +| Codex | `.agents/skills/tale/SKILL.md` | `~/.agents/skills/tale/SKILL.md` | + +Read it from the MCP endpoint with your key. The example saves it for Claude Code in the current project; change the folder for another agent: + +```bash +mkdir -p .claude/skills/tale +curl --fail-with-body "$TALE_URL/api/v1/mcp" \ + --header "Authorization: Bearer $TALE_API_KEY" \ + --header "X-Organization-Slug: $TALE_ORG_SLUG" \ + --header 'MCP-Protocol-Version: 2025-11-25' \ + --header 'Content-Type: application/json' \ + --data '{"jsonrpc":"2.0","id":1,"method":"resources/read","params":{"uri":"tale://docs/skill"}}' \ + | jq -r '.result.contents[0].text' > .claude/skills/tale/SKILL.md +``` + +A connected agent can also read `tale://docs/skill` and save the file itself. The skill matches the Tale release it came from, so fetch it again after an update; the references it points to are read from your deployment every time. + ## Let a project agent edit scripts To have the edit made inside Tale, in a sandbox and with a person's review, hand the script to a [project agent](/platform/projects/project-agents). Tale runs an agent runtime such as OpenCode in a sandbox, on the model the agent is configured with. The run counts against the budgets of the member who started it and is recorded under that person; a run you start over REST is booked to you, not to the API key. The edited files come back as the task's deliverables, and the task waits in review for a person. [Choose an agent runtime](/platform/agents/harnesses) compares the agent runtimes; OpenCode runs only through Tale's model gateway, so it never receives a provider key. @@ -389,14 +419,14 @@ tale_api -X POST "$TALE_URL/api/v1/projects/$PROJECT_ID/tasks/$TASK_ID/comments" echo "TASK_ID=$TASK_ID" ``` -`externalSystem` and `externalId` make the task idempotent: sending the same pair again returns the existing task. A description holds up to 20,000 characters; for a longer script, upload it to the project as described in [Upload a file in two steps](/develop/api-reference#upload-a-file-in-two-steps). An agent answers to its ID and to its name in lower case with spaces replaced by dots or removed, so `@script.editor` also works. +`externalSystem` and `externalId` make the task idempotent: sending the same pair again returns the existing task. A description holds up to 20,000 characters; for a longer script, upload it to the project as described in [Upload a file in two steps](/develop/api-reference#upload-a-file-in-two-steps). The comment names the agent by its ID; its `handle` works as well, here `@script-editor`, and the agent's read carries it. Tale stores either as a mention of the agent itself, so the comment keeps naming it after a rename: read back, its `body` is `[@Script editor](mention:agent/) please take this task.` and its `bodyText` is `@Script editor please take this task.` The mention assigns the task to the agent and starts a run, and the task moves to `in_progress`. A mention that cannot start a run is saved as an ordinary comment without an error, for example when the task is not yours to change, task automation is turned off, or another run already holds the task. Set `TASK_ID` to the value the script printed, check the task, and read the agent's report once the task reaches `in_review`: ```bash tale_api "$TALE_URL/api/v1/projects/$PROJECT_ID/tasks/$TASK_ID" | jq -r '.task.status' tale_api "$TALE_URL/api/v1/projects/$PROJECT_ID/tasks/$TASK_ID/comments?limit=20" \ - | jq -r '.comments[] | select(.authorType == "agent") | .body' + | jq -r '.comments[] | select(.authorType == "agent") | .bodyText' ``` Review the edited files under the task's deliverables in the app before you approve the task. To send the agent back with changes, post another comment that mentions it. diff --git a/docs/en/develop/webhooks.md b/docs/en/develop/webhooks.md index fd9d6e7689..8db13ab537 100644 --- a/docs/en/develop/webhooks.md +++ b/docs/en/develop/webhooks.md @@ -42,7 +42,7 @@ The accepted response has the shape `{"runId":"..."}` with HTTP `202`. Save that } ``` -Read the order as `input.payload.orderId`. If the automation declares an `inputs` schema, it must describe this wrapper. A body that is not JSON becomes text in `payload`. The body limit is 256 KiB (262,144 bytes), measured as bytes arrive; larger requests receive `413`. +Read the order as `input.payload.orderId`. If the automation declares an `inputs` schema, it must describe this wrapper. A trigger with a fixed input adds its fields beside `trigger` and `payload` in every delivery's input; the app's [trigger settings](/platform/automations/triggers#fixed-input) set it, and the API takes it as `input`. A body that is not JSON becomes text in `payload`. The body limit is 256 KiB (262,144 bytes), measured as bytes arrive; larger requests receive `413`. ### Follow the result @@ -53,6 +53,8 @@ Read the order as `input.payload.orderId`. If the automation declares an `inputs Poll with an API key whose holder can read that scope, or open the run in Tale. The webhook token starts deliveries; it is not a credential for reading REST results. Wait for a terminal run status before reporting that the work succeeded. +In the app, **Recent deliveries** under the trigger on the automation's **General** tab lists the last ten runs the webhook started, newest first, with their status. While Tale still remembers a delivery, each row names the header it took the delivery ID from, or says it has none. Refused requests start no run and are not listed there; their response is the record. + ### Interpret delivery responses | Status | Code/result | Recovery | diff --git a/docs/en/platform/admin/connectors.md b/docs/en/platform/admin/connectors.md index 3872dadb73..9c041fb1f2 100644 --- a/docs/en/platform/admin/connectors.md +++ b/docs/en/platform/admin/connectors.md @@ -47,7 +47,7 @@ Deleting credentials removes access for automations and agents that depend on th ## Prepare an OAuth app -Owners and Admins use **OAuth apps** at the bottom of the page to configure the vendor app registrations used during consent. An organization app overrides the deployment-wide app. If neither exists, the connector cannot start authorization and the page shows that it is not configured. +Owners and Admins use **OAuth apps** at the bottom of the page to configure the vendor app registrations used during consent. An organization app overrides the deployment-wide app. If neither exists, the connector cannot start authorization and the page shows that it is not configured. If Tale cannot check whether a Knowledge import app is set up, its row shows **Status unavailable** without **Configure**, and **Try again** runs the check again. You can configure the app once the check works. Select **Configure**, enter the vendor's client ID and secret, and register the exact redirect URIs shown in the dialog with the vendor. Microsoft apps may also require a directory/tenant ID. On a later edit, leave a stored secret blank to keep it. diff --git a/docs/en/platform/admin/governance/audit-logs.md b/docs/en/platform/admin/governance/audit-logs.md index e33b9ff1ba..427c316fc3 100644 --- a/docs/en/platform/admin/governance/audit-logs.md +++ b/docs/en/platform/admin/governance/audit-logs.md @@ -26,7 +26,8 @@ The active tab and category are reflected in the URL, so you can bookmark the vi | --- | --- | | Timestamp | When Tale recorded the action. | | Action | The operation that was attempted or completed. Some newer actions appear by their technical name. | -| User | The person or system actor responsible for the action. | +| User | The person or system actor responsible. For a write made with an API key, User names the key’s maker and Actor type is API. If the key acts for a member, Metadata keeps that member’s ID in `keyAttribution.subjectUserId`. JSON exports also retain the key ID (`apiKeyId`); CSV omits key and subject metadata. | +| Source and client | Only on an action a coding agent took through the [MCP endpoint](/develop/mcp-endpoint). **Source** shows Coding agent, and **Client** names the agent's app when the app names itself on every call, as apps on MCP revision 2026-07-28 do; an app on an earlier revision names itself only when it connects, so its events show no **Client**. **User** names the key’s maker; the member it acts for is recorded in Metadata. | | Resource and target | The kind of item and the particular record affected. | | Category | The grouping used by the filter. | | Status | Success, failure, or denied. | diff --git a/docs/en/platform/admin/governance/data-subject-requests.md b/docs/en/platform/admin/governance/data-subject-requests.md index 029a302cd6..ed11bfed66 100644 --- a/docs/en/platform/admin/governance/data-subject-requests.md +++ b/docs/en/platform/admin/governance/data-subject-requests.md @@ -20,6 +20,8 @@ Use **Settings > Governance > Data subject requests** as an Admin or Owner to pr Erasure permanently removes covered data; it is not a move to Trash. The receipt records the affected categories and counts, including chats, documents and uploads, preferences, feedback, notifications, usage, and audit-identifier scrubbing. The erasure also deletes the separate sandbox workspaces of the [agent runs the person started](/platform/projects/tasks#agent-runs-a-member-starts), even while work still runs in them, and the receipt counts them under **Sandbox workspaces**. A workspace counts only once the sandbox service has deleted its files, which can take a while for a large one. Until then, or while deleting them keeps failing, the receipt reads **Partial** with `sandboxWorkspaces` among its failed passes; choose **Retry** later, and the erasure completes once the files are gone. On Kubernetes, a workspace counts once its volume is handed to the cluster's storage provisioner; with a StorageClass whose `reclaimPolicy` is `Retain`, the volume's files stay until an operator removes the volume, although the receipt counts the workspace. A sandbox service or device that is not yet updated to this version cannot confirm the deletion, so the receipt stays **Partial** until it is updated. +The **Model requests** category covers requests to the model API and direct model calls in automations. Settled requests are removed; a request still in progress keeps the information needed to finish accounting, with the person’s identity replaced by a pseudonym. Later usage is recorded under that pseudonym. If retiring the automation run or removing the identity fails, the receipt stays **Partial** and the dependent usage cleanup waits for a retry. + Tasks that name the person as **Reviewer** lose that designation. A task review still waiting on them moves to the first eligible human fallback, the task creator or project creator, and that person is notified. On an archived task the review moves without a notification. Review decisions the person already made stay on record without their name. ## Check the policy before filing @@ -46,6 +48,8 @@ Only the Owner can change this policy. Stronger safeguards apply immediately; we An open receipt for a subject can prevent a duplicate filing. Work from that receipt rather than creating repeated requests. A retry blocked at initial filing must satisfy the current approval and waiting-period policy again. A receipt awaiting approval keeps the approval requirement captured when it was filed: turning dual approval off later does not release it. +Automation runs held during an upgrade are preserved while their earlier external actions remain unverified. An erasure still deletes the person's other eligible automation runs and reports erased and preserved counts separately. The receipt stays partial. These execution holds are separate from legal holds, and currently have no release action. Requesting a stop or retrying erasure does not clear them. An organization containing these holds also cannot be deleted. + ## Manage the deadline The list shows the tracked deadline and whether it is overdue. Use **Extend deadline** for a justified extension while it is still available: the application permits one extension before the original deadline expires and records the reason and admin. diff --git a/docs/en/platform/admin/governance/policies-and-limits.md b/docs/en/platform/admin/governance/policies-and-limits.md index 6ffba3fd39..e67f31e836 100644 --- a/docs/en/platform/admin/governance/policies-and-limits.md +++ b/docs/en/platform/admin/governance/policies-and-limits.md @@ -16,24 +16,30 @@ Use **Settings > Governance > Policies & Limits** as an Admin or Owner to contro 1. Under **Budget rules**, select **Add rule**. 2. Choose the scope and its target. Use a role for a group such as Editors, a team for a shared workload, a project for everything spent in one project, a user for an individual, an API key for one credential, or the organization for a shared ceiling. The API key list offers every active key that works in the organization, named with whom it belongs to: a member's own key, a key an Admin made for a member, and the keys of a team, a project, or the organization itself. You can cap one person's script or coding tool, or one team's integration. 3. Select a daily, weekly, or monthly period. Enter at least one positive token, cost, or request limit. Cost is entered in USD; an empty field leaves that dimension uncapped by this rule. -4. Optionally set **Warning threshold (%)** between 0 and 100 to warn before the cap is reached. A project budget has no warning threshold. +4. Optionally set **Warning threshold (%)** between 0 and 100 to warn before the cap is reached. A project budget's warning is shown to everyone chatting in the project. 5. Select **Confirm**, save the pending page changes, and check the saved rule's scope, target, period, and limits. For example, a monthly role rule can give Editors a USD 50 personal spending limit, while an organization rule caps everyone's combined spend at USD 500. These are example amounts, not recommended defaults. A rule stays in the table after its API key stops working. **Target** still names the key and its owner, with a status: **Expired** while the expired key is still stored, **Disabled**, **Revoked** when this organization recorded its revocation, or **Former member** when the owner has left the organization. **Unavailable** means the key is known but no longer stored, without a recorded cause; expiry cleanup can produce this state. **Unknown key** marks a key this organization has no record of. Remove such a rule, or edit it and choose an active key. -Budgets apply to new billable work, including chat, voice output, managed agent runs, the `llm` steps of automations, the images agents generate, and calls to the model endpoints. Tale checks every chat request before it runs — a sent message, a regenerated or edited reply, both sides of a model comparison, a message waiting for an attachment, and a send through the REST API — and refuses it once a cap that applies is reached, naming the cap and when it resets. Replies still being written hold what they may spend, so requests sent at the same moment cannot pass a nearly reached cap together. An agent's image request is checked the same way before the image model is called: while its images are being made it holds an estimated cost, and the check also counts what the agent's own run may still spend on its model. Each image counts as one request. Image generation needs cost or request limits because its usage is not measured as text tokens. A token limit counts input and output tokens, and input includes the part of a prompt that a provider read from or wrote to its cache. That part is priced differently from other input, so an agent that reuses a long prompt can reach a token limit while its cost stays low. Investigate warnings in [Usage analytics](/platform/admin/governance/usage-analytics). +Budgets apply to new billable work, including chat, voice output, transcriptions and dictation, knowledge indexing and search, managed agent runs, the `llm` steps of automations, **Improve with AI** in the inbox, the images agents generate, and calls to the model endpoints. Tale checks every chat request before it runs — a sent message, a regenerated or edited reply, both sides of a model comparison, a message waiting for an attachment, and a send through the REST API — and refuses it once a cap that applies is reached, naming the cap and when it resets. Replies still being written hold what they may spend, round by round, and so do voice output being made, an automation's `llm` step, a chat's title, **Improve with AI**, a transcription and each embedding request of knowledge indexing and search, so requests sent at the same moment cannot pass a nearly reached cap together. An agent's image request is checked the same way before the image model is called: while its images are being made it holds an estimated cost, and the check also counts what the agent's own run may still spend on its model. Each image counts as one request. Image generation needs cost or request limits because its usage is not measured as text tokens. A connector call — the assistant's search or web tool, an agent's or an automation's connector step, an email sent from the inbox — is counted on its own and never toward a request limit. A managed agent turn on a provider subscription counts as one request at no cost: request and token limits bind it, cost limits do not. A token limit counts input and output tokens, and input includes the part of a prompt that a provider read from or wrote to its cache. That part is priced differently from other input, so an agent that reuses a long prompt can reach a token limit while its cost stays low. Investigate warnings in [Usage analytics](/platform/admin/governance/usage-analytics). + +Voice output reserves its estimated cost and one request while the attempt is pending. An automation’s `llm` step reserves the estimated prompt and permitted output at the catalog price, plus one request. These reservations share the applicable caps with chat and managed agent work. They are estimates, not a guarantee of the provider’s final charge. + +If a reserved voice attempt fails or its outcome is unknown, Tale records its saved estimate and one request once, even when the failure happened before the provider call. A direct automation model call with an unknown outcome similarly records its reserved estimate. This conservative accounting does not confirm a provider charge. A retry needs a new reservation and must fit the budget including the earlier estimate. ## Understand which caps apply Personal limits resolve each dimension from the most specific rule that defines it: user, then team, role, and default. When someone belongs to several teams with a rule, the strictest of those caps applies to them personally. Organization limits apply in addition. A team budget also caps the combined usage of the team's current members, even when a member has a more specific personal rule: a new member's usage in the current period counts at once, and someone who leaves no longer counts. API-key limits independently cap requests authenticated with that key, and those requests' usage counts toward the key; they do not cap unrelated in-app work. A team's, a project's, or the organization's own key is not a person: no user, role, or default rule applies to it. The organization's limits and its API-key rules do, a team's key counts toward, and is held to, its team's budget, and a project's key its project's. -A project budget caps everything spent in one project, whoever spends it: the project's chats, with their titles, the answers read aloud, and the assistant's tool calls; the runs of its agents and the agent and `llm` steps of the automations run in it, with the images they generate; and the calls made with the project's own API keys. It applies on top of the limits of whoever asked for the work, including runs a schedule started, and never to work outside the project. Chat replies and agent turns still running in the project hold what they may spend against its budget too, so two sent at the same moment cannot pass a nearly reached project budget together. A chat message it refuses says the project's limit was reached. Transcribed recordings are not counted toward a project, and a project budget warns no one before it is reached. An automation counts toward the project it runs in. A run that names no project, of an automation installed in several projects, counts toward each of them and must fit each one's budget, as a member's spend counts toward each of their teams; an automation installed in no project counts toward the organization alone. +A project budget caps everything spent in one project, whoever spends it: the project's chats, with their titles, the answers read aloud, the recordings transcribed in them, and the assistant's tool calls and searches; the files indexed for it; the runs of its agents and the agent and `llm` steps of the automations run in it, with the images they generate; and the calls made with the project's own API keys. It applies on top of the limits of whoever asked for the work, including runs a schedule started, and never to work outside the project. Pending chat replies and their titles, agent turns, voice attempts, transcriptions and automation model calls also hold their admitted usage against the project budget, so concurrent requests see those reservations. A chat message it refuses says the project's limit was reached. With a warning threshold, everyone chatting in the project sees how much of its budget is left once usage passes the threshold, in a banner that names the project. An automation counts toward the project it runs in. A run that names no project, of an automation installed in several projects, counts toward each of them and must fit each one's budget, as a member's spend counts toward each of their teams; an automation installed in no project counts toward the organization alone. + +Chat turns, voice attempts and automation model calls keep the projects recorded when admitted. Moving the chat or changing an automation’s project installations while work is running does not move its reservation or eventual booking. An attempt admitted without a project stays outside project budgets. -![The Add budget rule dialog with the scope set to Project, Website relaunch chosen as the project, a monthly period, and a maximum cost of 200 USD; the token and request limits are left empty, and no warning threshold is offered for a project.](/images/platform/governance-budget-project-rule.webp) +![The Add budget rule dialog with the scope set to Project, Website relaunch chosen as the project, a monthly period, and a maximum cost of 200 USD; the token and request limits are left empty, as is the warning threshold, whose note says everyone chatting in the project sees its warning.](/images/platform/governance-budget-project-rule.webp) diff --git a/docs/en/platform/admin/governance/usage-attribution.md b/docs/en/platform/admin/governance/usage-attribution.md index a226bcab94..dedb2d6aaf 100644 --- a/docs/en/platform/admin/governance/usage-attribution.md +++ b/docs/en/platform/admin/governance/usage-attribution.md @@ -7,7 +7,9 @@ Every AI request Tale makes for your organization is recorded once, against one ## What counts as usage -Tale records a request whenever a model or a metered service runs for your organization: a chat reply, including a regenerated or edited one and both sides of a model comparison; the short model call that names a new chat; the model call of an automation's `llm` step; a turn of a managed agent working on a task or inside an automation; an image such an agent generates; voice output; the transcription of an uploaded recording; a metered connector call; and a call to the model endpoints with an API key. Each record carries the tokens or units used and the cost estimated from the provider's list price at that moment; for a model endpoint call, it is the cost the model gateway measured. +Tale records a request whenever a model or a metered service runs for your organization: a chat reply, including a regenerated or edited one and both sides of a model comparison; the short model call that names a new chat; a rewrite with **Improve with AI** in the inbox; the model call of an automation's `llm` step; a turn of a managed agent working on a task or inside an automation; an image such an agent generates; voice output; the transcription of an uploaded recording or of a dictation; the embeddings that index knowledge and those every knowledge search asks for; and a call to the model endpoints with an API key. Each record carries the tokens or units used — for a transcription, the minutes of audio — and the cost estimated from the provider's list price at that moment; for a model endpoint call, it is the cost the model gateway measured. + +Tale also counts every call it makes through a connector — the assistant's search and web tools, an agent's or an automation's connector step, an email sent from the inbox — as a connector call, at no cost. A connector call is never a request: request limits count model requests alone. ## Who a request counts against @@ -16,18 +18,22 @@ The rule is the same everywhere: a request counts against the person who asked f | Work | Counts against | Also counts toward | Appears in Usage analytics as | | --- | --- | --- | --- | | A chat reply, or the title of a new chat | The member who sent the message | The API key, when the message was sent through the REST API | The assistant used; a title under `thread-title` | -| An agent run on a task | The member who started the run from the task, or with a comment or a task description that mentions the agent; for a run another agent or an automation step started, the member that agent's or automation's run counts against | — | The agent's name under **Top assistants** | +| A rewrite with **Improve with AI** in the inbox | The member who asked for it | — | `inbox-improve` under **Top assistants** | +| An agent run on a task | The member who started the run from the task, or with a comment or a task description that mentions the agent; for a run another agent or an automation step started, the member that agent's or automation's run counts against | The API key, when the run was started with one: through the REST API, or by a step of an automation run started with one | The agent's name under **Top assistants** | | An automation run someone started | The member who started it from the run list, the builder, a chat, a task, the REST API, or the MCP endpoint | The API key, when the run was started with one | The automation's name under **Top assistants** | | An automation run a trigger started | Nobody: a schedule, a webhook, or an event has no person behind it | — | The **Automations (triggers)** row under **Per-user usage** | | A project agent's run a schedule began, or one another agent started for such a run | Nobody, as for the schedule's own run | — | The **Automations (triggers)** row under **Per-user usage**, and the agent's name under **Top assistants** | | An image an agent generates | The person the agent's run counts against: its starter, or nobody for a run a trigger started | The API key, when the run was started with one | The agent's or automation's name under **Top assistants**, and the image model under **Top models** | -| Voice output or a transcription | The member who requested it | — | **Voice output** or **Transcription** under **Top assistants**; voice output also under **Top voice models** | -| A metered connector call | The member whose request made the call | — | The assistant that made it, or **Connector** | +| Voice output or a transcription | The member who requested it; for a recording's transcription, whoever added the recording, a retry included | — | **Voice output** or **Transcription** under **Top assistants**; voice output also under **Top voice models** | +| Knowledge indexing and search (embeddings) | Indexing: the member who added the file — the owner of a synced drive — or the organization for an emailed attachment, an inbound email and a website scan a schedule started. A search: the member searching | The API key a search, or a website added through the API, came with | **Knowledge indexing and search** under **Top assistants** | +| A connector call: an assistant's search or web tool, an agent's or an automation's connector step, an email sent from the inbox | The member who made it; for an agent's or an automation's step, whoever its run counts against; for an email, the member who sent it | The API key it came with | Not as a request: connector calls are counted apart and add nothing to the request figures | | A call to the [model endpoints](/develop/use-tale-from-your-editor#model-endpoints) | The member whose API key sent it | The API key | **Direct API** under **Top assistants** | -A retry of an agent run continues the run its starter kicked off, so its usage stays with that person. When an integration uses an API key to act for another member, the run counts against the member acted for, and the key's own limit counts it too. +A retry of an agent run continues the run its starter kicked off, so its usage stays with that person and with the API key the run was started with. When a comment that mentions a working agent restarts its turn, the rest of that turn counts against the comment's writer, and against the API key the comment was written with. When an integration uses an API key to act for another member, the run counts against the member acted for, and the key's own limit counts it too. + +Work in a project also counts toward that project, whoever asked for it: the project's chats, with their titles, the answers read aloud, the recordings transcribed in them, and the assistant's tool calls and searches; the files indexed for it; the runs of its agents and the agent and `llm` steps of automations run in it, with the images they generate; and the calls made with the project's own API keys. A run that names no project, of an automation installed in several projects, counts toward each of them; an automation installed in no project counts toward the organization alone. -Work in a project also counts toward that project, whoever asked for it: the project's chats, with their titles, the answers read aloud, and the assistant's tool calls; the runs of its agents and the agent and `llm` steps of automations run in it, with the images they generate; and the calls made with the project's own API keys. A run that names no project, of an automation installed in several projects, counts toward each of them; an automation installed in no project counts toward the organization alone. A transcription is not counted toward a project. +Chat turns, voice attempts and automation model calls keep the projects recorded when admitted. Moving the chat or changing an automation’s project installations while work is running does not move its reservation or eventual booking. An attempt admitted without a project stays outside project budgets. An API key an Admin made for a member counts against that member, like the member's own key. A key that belongs to a team, a project, or the organization ([API keys](/platform/admin/api-keys#create-a-key-for-someone-else)) is not a person: what it asks for counts against the key itself. Usage analytics shows it as a row of its own under **Per-user usage**, under the key's name with its team, project, or organization beneath, and never counts it as an active user. A team's key also counts toward its team's usage. @@ -38,7 +44,9 @@ An API key an Admin made for a member counts against that member, like the membe - **API-key limits** bind the requests authenticated with that key: the chat messages it sent, its model endpoint calls, and the runs it started. - **Project limits** bind the work in that project, whoever asked for it, including runs a trigger started. -When a limit is reached, Tale refuses the next request before it runs and names the limit. A managed agent turn is refused at its start; a turn already running keeps the allowance it was given. An image the agent asks for during its turn is checked on its own before the image model is called, so a reached limit refuses the image while the turn continues. The image also draws on the allowance of the turn that asked for it. An automation's `llm` step is checked before each model call: a call a limit refuses fails the step with `budget_exceeded`, and its error names the limit; the run fails with it unless the step's `onError` is `continue`. The step holds nothing while its call runs, so runs started at the same moment can pass a nearly reached limit together. [How rules combine](/platform/admin/governance/policies-and-limits#how-rules-combine) covers the case of several rules applying to one person. +When a limit is reached, Tale refuses the next request before it runs and names the limit. A managed agent turn is refused at its start; a turn already running keeps the allowance it was given. A turn served by a provider subscription the organization pays for apart from Tale costs nothing per call: it counts as one request, with the tokens its agent reports, so a request or token limit refuses it at its start and a cost limit does not. An image the agent asks for during its turn is checked on its own before the image model is called, so a reached limit refuses the image while the turn continues. The image also draws on the allowance of the turn that asked for it. An automation's `llm` step is checked before each model call: a call a limit refuses fails the step with `budget_exceeded`, and its error names the limit; the run fails with it unless the step's `onError` is `continue`. The step reserves its estimated prompt and permitted output at the catalog price, plus one request, until settlement. Concurrent calls therefore see each other’s reservations. If the provider’s outcome is unknown, Tale books the saved estimate once instead of silently freeing it; a retry is a new admission. A chat's title, a rewrite with **Improve with AI** and a transcription are checked the same way before Tale calls the model, against an estimate of the most the call may cost — for a written reply, its prompt and the longest answer the call allows; for a transcription, the recording's length, its long silences cut, at the model's price per minute — and hold that amount while the call runs. A refused title is no error: the chat is named from its first message instead, without a model call. A transcription model the catalog has no per-minute price for — one billed by tokens, or an endpoint that publishes no price — counts toward request limits only, at no cost. A refused transcription reads **Usage limit reached**; choose **Try again** once the limit allows it. A refused dictation says the limit was reached, and a video link is refused before its download. Each embedding request is checked the same way. A knowledge search a limit refuses says so, and never answers "nothing found"; indexing waits instead: a document shows **Waiting for a usage limit**, a website keeps its pages without search by meaning, and both resume by themselves within the hour after the limit resets or is raised. A chat reply also holds each further round of its tool use as the round starts. [How rules combine](/platform/admin/governance/policies-and-limits#how-rules-combine) covers the case of several rules applying to one person. + +Voice output holds its estimated cost and one request while pending. A reserved attempt that fails or has an unknown outcome records that estimate once, including failures before the provider call; this is conservative accounting, not confirmation of a charge. A retry includes the earlier estimate when checking the remaining budget. ## Three situations worth knowing @@ -50,4 +58,4 @@ When a limit is reached, Tale refuses the next request before it runs and names ## What members see -**Settings > Usage** lists every limit that applies to the signed-in member with its current usage: the chats they sent, the voice output they requested, the model endpoint calls they made, and the agent and automation runs they started, whichever way they started them. Shared team and organization limits appear there too, because they can be reached before a personal one. A project's limit does not appear there; a request it refuses names it. +**Settings > Usage** lists every limit that applies to the signed-in member with its current usage: the chats they sent, the voice output they requested, the model endpoint calls they made, and the agent and automation runs they started, whichever way they started them. Shared team and organization limits appear there too, because they can be reached before a personal one. A project's limit does not appear there: a banner in the project's chats warns about it once its threshold is passed, and a request it refuses names it. diff --git a/docs/en/platform/admin/overview.md b/docs/en/platform/admin/overview.md index 55d607f8b2..551f030bf8 100644 --- a/docs/en/platform/admin/overview.md +++ b/docs/en/platform/admin/overview.md @@ -32,7 +32,7 @@ Owners and Admins manage organization settings. Developers can reach the technic ## Sign-in, integrations, and appearance -Configure [enterprise SSO](/platform/admin/enterprise-sso) for your identity provider and [two-factor authentication](/platform/admin/two-factor-authentication) for account protection. Use [API keys](/platform/admin/api-keys) when software needs to call Tale. +Configure [enterprise SSO](/platform/admin/enterprise-sso) for your identity provider and [two-factor authentication](/platform/admin/two-factor-authentication) for account protection. Use [API keys](/platform/admin/api-keys) when software needs to call Tale. A coding agent connected with one can change many of these settings itself, within the role of the key's owner; [Settings over MCP](/develop/mcp-settings) lists which. [Branding](/platform/admin/branding) changes the organization's logo and colors. [Sandboxes](/platform/admin/sandboxes) shows execution capacity and workload limits; with [sandbox devices](/platform/admin/sandbox-devices), your organization's sandboxes run on machines of your own. For a project agent's access to these resources, read [Agents (admin view)](/platform/admin/agents). diff --git a/docs/en/platform/admin/sandboxes.md b/docs/en/platform/admin/sandboxes.md index 88b6ac18f8..e8fa427cf9 100644 --- a/docs/en/platform/admin/sandboxes.md +++ b/docs/en/platform/admin/sandboxes.md @@ -9,11 +9,11 @@ Open **Settings > Sandboxes** when agent work or crawling cannot obtain an execu | Workload | Default | What uses a slot | | --- | --- | --- | -| **Project agent sessions** | 2 | An agent workspace starting or doing work. The agent reuses its workspace across tasks. | +| **Agent workers** | 2 | A worker starting or doing work: one for each task an agent works on at the same time. Each worker is a sandbox with its own workspace, reused for the agent’s later tasks. | | **Workflow sessions** | 2 | A workflow run’s sandbox, shared by its sandbox work. Concurrent runs use separate slots. | | **Render sessions** | 2 | A temporary sandbox rendering pages during website crawling. | -These are concurrency limits, not a count of tasks or a spending budget. An agent can work on several tasks in its one workspace. Limits do not reserve infrastructure for the organization; all organizations share the deployment capacity. +These are concurrency limits, not a count of tasks or a spending budget. An agent working three tasks at once holds three agent workers; a run that finds them all busy [waits for one](#resolve-a-blocked-start) and starts on its own when one is free. Under **Agent workers**, Owners and Admins see how many agent runs are waiting for a free worker: the runs a higher limit would start now. Limits do not reserve infrastructure for the organization; all organizations share the deployment capacity. @@ -51,7 +51,7 @@ Measurements refresh every 15 seconds; **Refresh** requests a new observation. C ## Explain an allocated or idle workspace -Owners and Admins can inspect **Workspaces**. A row identifies its agent or workflow run, runtime state, allocation state and running tasks. These states answer different questions: a container may remain running for reuse after it has released its organization slot. A project agent’s workspace stays listed while the agent is idle, as **Stopped** with **Quota released**, until you destroy it or Tale deletes it: when nobody has used it for [the number of days your organization sets](#delete-unused-workspaces-automatically), or when [its agent, project or member is removed](#explain-why-a-workspace-disappeared). Once the agent itself is deleted, the row reads **Deleted agent** until Tale has deleted the workspace. A workflow run’s workspace is reclaimed shortly after the run ends. +Owners and Admins can inspect **Workspaces**. A row identifies its agent or workflow run, runtime state, allocation state and running tasks. An agent has one row per worker: under its name, **Worker 2** says which of its workers the row is, and **Member worker 2** marks one that runs the agent for a Member who [started its runs](/platform/projects/tasks#agent-runs-a-member-starts). **Current tasks** names each task by its key and title and opens it. These states answer different questions: a container may remain running for reuse after it has released its organization slot. A worker’s workspace stays listed while it is idle, as **Stopped** with **Quota released**, until you destroy it or Tale deletes it: when nobody has used it for [the number of days your organization sets](#delete-unused-workspaces-automatically), or when [its agent, project or member is removed](#explain-why-a-workspace-disappeared). Once the agent itself is deleted, the row reads **Deleted agent** until Tale has deleted the workspace. A workflow run’s workspace is reclaimed shortly after the run ends. If an environment on the Tale server disappears on its own, for example after a host restart or because it ran out of memory, its workspace keeps its files and reads **Stopped**, and the next run continues in it. This does not apply to an environment on a connected [device](/platform/admin/sandbox-devices). **Spend** adds the metered cost of finished turns. A turn still running is included when it ends. Temporary crawler environments appear in capacity counts even without a standing workspace row. @@ -63,17 +63,17 @@ Owners and Admins can use a workspace’s row menu: | Action | Effect | | --- | --- | -| **Stop task** | Cancels all currently running operations in that workspace. Check the listed tasks first; one agent may have several. | +| **Stop task** | Cancels all currently running operations in that workspace. A worker works one task at a time, so this stops that task only; the agent’s other workers keep working. | | **Pin** / **Unpin** | Keeps the workspace exempt from automatic idle and expiry cleanup and from deletion for being unused, or restores normal cleanup. A pinned allocation can continue holding capacity. If a pinned workspace’s environment disappears, for example after a host restart, Tale starts it again with its workspace files, and the workspace stays pinned. | -| **Destroy** | Asks for confirmation, then removes the sandbox and its workspace files in the background: it unpins the workspace first and cancels running work. Until the workspace is gone, its row reads **Destroying** and you can go on using the page. If Tale still cannot remove it after several attempts, the workspace remains listed, unpinned, and reads **Destroy failed**; choose **Destroy** again to finish removing it. While the row reads **Destroying**, nothing new starts in that workspace: an agent's run waits and reads **Waiting for a sandbox slot**, and a workflow run's step that needs the workspace fails at once with the reason, without waiting or trying again, because the files its earlier steps left are being deleted. Once the row is gone, the next start creates a fresh environment; if it reads **Destroy failed** instead, the waiting work continues in the old files. | +| **Destroy** | Asks for confirmation, then removes the sandbox and its workspace files in the background: it unpins the workspace first and cancels running work. Until the workspace is gone, its row reads **Destroying** and you can go on using the page. If Tale still cannot remove it after several attempts, the workspace remains listed, unpinned, and reads **Destroy failed**; choose **Destroy** again to finish removing it. While the row reads **Destroying**, nothing new starts in that workspace. An agent's run that would use it takes another free worker of the agent; when none is free, it waits and reads **Waiting for a workspace**. A workflow run's step that needs the workspace fails at once with the reason, without waiting or trying again, because the files its earlier steps left are being deleted. Once the row is gone, the next start creates a fresh environment; if it reads **Destroy failed** instead, the waiting work continues in the old files. | -A pin change is saved durably and retried if its runtime acknowledgement fails, including after a worker restart or device outage. Retries apply the latest desired value to the same session incarnation; repeated unpin delivery does not extend its expiry. +A pin change is saved durably and retried if its runtime acknowledgement fails, including after a backend worker restart or device outage. Retries apply the latest desired value to the same session incarnation; repeated unpin delivery does not extend its expiry. Use stop when the current work should end but its files should remain. Before destruction, preserve outputs you still need and read the confirmation. Idle capacity reclamation preserves workspace files; explicit destruction and automatic deletion do not. ## Delete unused workspaces automatically -A project agent keeps its files between runs in workspaces: the one it reuses across tasks, and a separate one for each Member who [starts its runs](/platform/projects/tasks#agent-runs-a-member-starts). Tale deletes a workspace that nobody has used for the number of days your organization sets; **Destroy** still deletes one at once. Owners and Admins set this rule under **Workspace cleanup**, above **Workspaces**. Developers don't see that section. +A project agent keeps its files between runs in the workspaces of its workers: one for each task it has worked on at the same time, reused by its later tasks, and separate ones for each Member who [starts its runs](/platform/projects/tasks#agent-runs-a-member-starts). Each worker’s workspace counts its days without use on its own. Tale deletes a workspace that nobody has used for the number of days your organization sets; **Destroy** still deletes one at once. Owners and Admins set this rule under **Workspace cleanup**, above **Workspaces**. Developers don't see that section. @@ -93,10 +93,10 @@ In **Workspaces**, a stopped agent workspace shows the day it will be deleted un Besides deleting unused workspaces, Tale deletes a workspace when what it belongs to is removed, whatever the cleanup setting says: -- Deleting a project agent deletes all its workspaces, including each Member's. Deleting a project does the same for every agent in it. +- Deleting a project agent deletes the workspaces of all its workers, including each Member's. Deleting a project does the same for every agent in it. - [Removing a member](/platform/admin/members-and-roles#remove-or-recover-access) from the organization deletes their own workspaces with every agent. Setting the member to **Disabled** instead keeps them. - [Erasing a person's data](/platform/admin/governance/data-subject-requests) deletes their own workspaces without waiting for work running in them. -- Deleting the organization deletes all its sandboxes and their files, revokes the gateway keys issued to them, disconnects its [devices](/platform/admin/sandbox-devices) and removes the build and package caches kept for it. +- Deleting the organization deletes all its sandboxes and their files, revokes the gateway keys issued to them, removes its model-provider keys from the model gateway, disconnects its [devices](/platform/admin/sandbox-devices) and removes the build and package caches kept for it. This happens within about a minute, or after the task ends if one is still running in the workspace. A pinned workspace goes too, but a [legal hold](/platform/admin/governance/legal-hold) keeps every workspace it covers: a hold on the organization keeps all of them, and a hold on a person keeps that person's own workspaces. An hourly cleanup also deletes leftovers that nothing owns any more, such as a workflow run's workspace that was never reclaimed. @@ -104,9 +104,9 @@ Every workspace Tale deletes on its own, for one of these reasons or for being u ## Resolve a blocked start -A start that finds no room waits. When your organization's limits are in use, or the deployment is full or short of memory, the work starts on its own once room frees, and needs nothing from you. Disk space is different: stopping idle work frees none, because a stopped workspace keeps its files. Tale removes build caches that no session uses, if there are any; when that frees too little, the start waits until workspaces are deleted, for example ones you destroy because you no longer need them, or until the operator frees disk space. When the deployment itself is full, its room goes to the work that has waited longest, whichever organization it belongs to, and each waiting start is told when its turn comes: +A start that finds no room waits, and its task says why under **Run**: **Waiting for a worker** when every agent worker of your organization is busy, **Waiting for room** when the deployment is full or short of memory or disk, **Waiting for a workspace** while an administrator destroys the workspace it would use, and **Waiting for its sandbox** while its sandbox finishes an earlier process. Owners and Admins also get a link to this page when the agent workers are all busy. When your organization's limits are in use, or the deployment is full or short of memory, the work starts on its own once room frees, and needs nothing from you. Disk space is different: stopping idle work frees none, because a stopped workspace keeps its files. Tale removes build caches that no session uses, if there are any; when that frees too little, the start waits until workspaces are deleted, for example ones you destroy because you no longer need them, or until the operator frees disk space. When the deployment itself is full, its room goes to the work that has waited longest, whichever organization it belongs to, and each waiting start is told when its turn comes: -- A task run waits in the queue. It is tried again as soon as a session ends, in your organization or in another one on the same deployment. When the deployment is full, it is also tried when its turn comes. Every two minutes, Tale also tries a few of each organization's waiting runs, the longest-waiting first. +- A task run waits in the queue. It is tried again as soon as a session ends, in your organization or in another one on the same deployment. When the deployment is full, it is also tried when its turn comes. Every two minutes, Tale also tries a few of each organization's waiting runs. A freed worker goes first to the agent with the fewest runs working, then to the run that has waited longest. A run that finds no room within 12 hours of its start fails, saying it waited too long for a free worker. - An automation's agent step tries again without using up its retries: when its turn comes if the deployment is full, otherwise after a pause that grows while the step keeps waiting, up to about two minutes. The run shows **Waiting for a sandbox slot** meanwhile. After two hours without room, the run fails with that reason. A workspace an administrator is destroying is no lack of room: the step fails at once instead, as described for **Destroy** above. - Crawling waits for its turn, then continues with its next batch. diff --git a/docs/en/platform/agents/concepts.md b/docs/en/platform/agents/concepts.md index 6114285b6d..e300978a36 100644 --- a/docs/en/platform/agents/concepts.md +++ b/docs/en/platform/agents/concepts.md @@ -3,14 +3,14 @@ title: Understand project agents description: Decide what an agent should own and how its runtime, model, instructions and equipment fit together. --- -A project agent is a named worker for tasks in one project. You configure how it runs and what it may use, then give it a task with a reviewable outcome. It can work on files and commands in a sandbox. The [configured reviewer](/platform/projects/tasks#review-default), a person or an independent project agent, checks the result before completing the task. New reviews that require human independence or competence records go to the human review chain; a captured agent review needs explicit transfer to an eligible person. +A project agent is a named configuration for tasks in one project. You configure how it runs and what it may use, then give it a task with a reviewable outcome. Each task it works on runs in a worker, a running copy of the agent that works on files and commands in a sandbox of its own, so one agent can work several tasks at once. The [configured reviewer](/platform/projects/tasks#review-default), a person or an independent project agent, checks the result before completing the task. New reviews that require human independence or competence records go to the human review chain; a captured agent review needs explicit transfer to an eligible person. ## Choose the right working mode | Use | Suitable work | What you configure | | --- | --- | --- | | Chat | Ask a question, retrieve knowledge or draft text in a conversation. | The message, model and optional project context. | -| Project agent | Review a repository, prepare files or carry out a task over several turns. | A reusable worker in the project. | +| Project agent | Review a repository, prepare files or carry out a task over several turns. | A reusable agent configuration in the project. | | Automation | Run defined steps, react to events or wait for an approval between actions. | A versioned workflow and its inputs. | A project chat still uses the built-in chat assistant. Adding a project to a chat does not select one of the project’s agents. An automation’s agent node has its own configuration. @@ -32,7 +32,7 @@ An agent belongs to exactly one project. People who can read the project can see | Connectors and tools | Connected services and allowed platform operations. | Grant repository access and only the task tools needed. | | Secrets | Named organization credentials supplied to the running session. | Use a narrowly scoped token for a service without a connector. | -The skills, connectors, tools and secret-name lists each allow up to 25 entries. A grant to a write tool authorizes its supported writes within its access rules; an instruction asking the agent to be careful does not remove that permission. Only an Owner or Admin may change secret grants. +The skills, connectors, tools and secret-name lists each allow up to 25 entries. A grant to a write tool authorizes its supported writes within its access rules; an instruction asking the agent to be careful does not remove that permission. Only an Owner or Admin may change secret grants. Searching the project's knowledge needs no grant: every agent has it. ```mermaid flowchart LR @@ -45,6 +45,6 @@ flowchart LR ## Check readiness before assigning work -The provider credential must support the selected agent runtime and model, and sandbox capacity must be available. Success in ordinary Chat proves neither condition. A task should explain what success looks like and include the material the agent needs to inspect. +The provider credential must support the selected agent runtime and model, and sandbox capacity must be available: a run waits until one of your organization’s [agent workers](/platform/projects/project-agents#run-one-agent-on-several-tasks) is free. Success in ordinary Chat proves neither condition. A task should explain what success looks like and include the material the agent needs to inspect. [Create a project agent](/platform/projects/project-agents) once those choices are clear. [Task automation](/platform/projects/task-automation) explains starting, steering and reviewing its work. diff --git a/docs/en/platform/agents/harnesses.md b/docs/en/platform/agents/harnesses.md index 7a23a9aa6b..0aa1c1d3b1 100644 --- a/docs/en/platform/agents/harnesses.md +++ b/docs/en/platform/agents/harnesses.md @@ -37,13 +37,13 @@ Gemini CLI is the exception: Tale never continues one of its conversations. A la With a stored API key or deployment-environment credential, Tale supplies a session-scoped gateway key. The original model-provider key stays at the platform. Calls through this gateway are metered and subject to the applicable spending rules, including allowance already assigned to other running turns. -Vendor subscriptions use their supported agent runtime and receive the subscription credential in the session environment. They cannot be used as ordinary chat credentials or with an incompatible agent runtime, because the vendors permit subscription tokens only in their own runtime; [AI providers](/platform/admin/providers#use-subscriptions-in-tasks-not-in-chat) explains this. Their direct provider calls bypass Tale’s gateway metering and spending caps; review usage with the subscription provider. +Vendor subscriptions use their supported agent runtime and receive the subscription credential in the session environment. Gemini is the exception: its Google sign-in is written to a file in the session’s home folder for the turn, and removed when the turn ends. They cannot be used as ordinary chat credentials or with an incompatible agent runtime, because the vendors permit subscription tokens only in their own runtime; [AI providers](/platform/admin/providers#use-subscriptions-in-tasks-not-in-chat) explains this. Their direct provider calls bypass Tale’s gateway metering and spending caps; review usage with the subscription provider. These model-credential rules do not mean the sandbox contains no secrets. Explicitly granted **Secrets**, and the token supplied for an equipped GitHub connection, can be available inside it. Grant only the access the task needs. ## Understand files and connected tools -A project agent reuses a persistent workspace across its tasks. Task attachments are available read-only under `/agent/inputs//attachments/`. Files written to `/agent/output//` are collected as task **Deliverables** when the turn ends. Automation agent output is collected from `/agent/output/`. +A project agent reuses a persistent workspace across its tasks. Task attachments are available read-only under `/agent/inputs//attachments/`. The workspace keeps this copy only while the task can still use it: Tale removes it once the task is **Done** or **Cancelled**, archived or deleted, or hasn’t changed for 30 days, and the task’s next run copies the files in again. Files written to `/agent/output//` are collected as task **Deliverables** when the turn ends. Automation agent output is collected from `/agent/output/`. Equipped skill bundles are staged as files and named in the run’s instructions. Review their instructions and scripts before granting them; [Skills on agents](/platform/agents/skills) explains staging and visibility. diff --git a/docs/en/platform/automations/assistant.md b/docs/en/platform/automations/assistant.md index 4ca6ee4345..c13f3762e4 100644 --- a/docs/en/platform/automations/assistant.md +++ b/docs/en/platform/automations/assistant.md @@ -1,30 +1,32 @@ --- title: Choose how to author an automation -description: Use the visual editor for direct changes or connect an external assistant to Tale through MCP. +description: Use the visual editor for direct changes, or have your coding agent edit automations through Tale’s MCP endpoint. --- -Edit an automation directly on its canvas, or connect an external assistant through MCP to author it with Tale’s tools. Both routes save versions of the same workflow and use the same validation and deployment rules. You need Developer-level permission to author and deploy automations. +Change an automation's fields directly in the editor, or let your coding agent build and change it through Tale’s MCP endpoint. Tale has no AI assistant inside the editor: a coding agent such as Claude Code or Codex, connected with your API key, is how you work on automations with AI. Both routes save versions of the same workflow and use the same validation and deployment rules. Authoring and deploying automations take the Owner, Admin or Developer role. -## Make a change in the visual editor +## Make a change in the editor -Open **Automations** and select the workflow. Select a node to inspect its input, model, code, or other configuration. Save the change with a version message, run a test, and deploy the intended version when its checks pass. +Open **Automations** and select the workflow. Select a node to inspect its input, model, code, or other configuration, and change the field you need. Save the change with a version message, run a test, and deploy the intended version when its checks pass. The canvas arranges itself from the references between nodes; you don't add nodes or draw connections on it. -![The automation editor shows a workflow graph and the selected node’s input fields in a side panel.](/images/platform/automation-editor-canvas.webp) +![The automation editor shows the workflow between Start and End and the selected node’s fields in a side panel.](/images/platform/automation-editor-canvas.webp) -[The workflow editor](/platform/automations/editor) covers these steps in detail, including inspecting a run and returning to an earlier version. The canvas does not include a conversational assistant panel. +[The workflow editor](/platform/automations/editor) covers these steps in detail, including reading the canvas, inspecting a run and returning to an earlier version. The canvas does not include a conversational assistant panel. -## Use an external assistant through MCP +## Change it with your coding agent -Configure your client with the endpoint under **Settings > API > MCP** and an appropriate organization API key. Give it the desired inputs, output, and the systems the workflow may change. Ask it to inspect existing automations and available capabilities before creating another one. +**Edit with your coding agent**, the last button at the top right of the editor's canvas, is the way in. Its dialog shows the automation's name to give the agent, **Set up MCP**, which opens **Settings > API > MCP**, and a link to the guide for connecting a coding agent. Connect your coding agent with the endpoint under **Settings > API > MCP** and your personal API key; [Use Tale from your editor or a script](/develop/use-tale-from-your-editor) has ready configurations. Tell it what the automation should take in, what it should produce, and which systems it may change. Ask it to look at the existing automations and at what your organization has before it creates another one. -The [MCP endpoint](/develop/mcp-endpoint) provides documentation, validation, save, test, and deploy tools. Review the resulting workflow and its test output before deployment. A successful save creates a version; it does not make that version live. +Your agent works on an automation the way you do in the editor. It reads the reference and the current version, validates its change, runs it on the mocks and runs the automation’s tests, then saves a new version that names the version it started from. If someone saved a newer version in the meantime, Tale refuses the save, and the agent reads that version and merges its change first. When it starts a saved version on the mocks, the run appears in the automation’s **Runs** tab as a **Test** run, **Started by you (API)**, so you can open what it ran. A version the agent saves appears on the canvas while you look at the automation. + +Saving creates a version; it does not make it live. Before your agent deploys, deletes, sets a trigger or installs an automation in projects, a client that honors Tale’s marking for these tools, such as Claude Code, asks for your yes, even when you let the agent run other tools without asking. Review the version and its test results before you agree. Every change your agent makes is in the [audit log](/platform/admin/governance/audit-logs) with **Source** Coding agent, and the [MCP endpoint](/develop/mcp-endpoint) lists every tool it can use. ## Keep runtime decisions separate -An agent node inside an automation performs work during a run. It is separate from the client you use to write the workflow. Similarly, an [approval](/platform/approvals/concepts) authorizes one pending operation during execution; it does not approve a proposed edit to the workflow definition. +An agent node inside an automation performs work during a run. It is separate from the coding agent you use to write the workflow. Similarly, an [approval](/platform/approvals/concepts) authorizes one pending operation during execution; it does not approve a proposed edit to the workflow definition. Your coding agent never decides an approval: a run it starts that needs one waits until a person decides in Tale. -Choose [the editor](/platform/automations/editor) for a change you want to make directly, or [MCP](/develop/mcp-endpoint) for authoring from your own client. Start from [an existing automation](/platform/automations/catalog) when a suitable one is already available. +Choose [the editor](/platform/automations/editor) for a change you want to make directly, or [MCP](/develop/mcp-endpoint) for authoring with your coding agent. Start from [an existing automation](/platform/automations/catalog) when a suitable one is already available. diff --git a/docs/en/platform/automations/builtin.md b/docs/en/platform/automations/builtin.md index c1cdc2a54f..6b691d379f 100644 --- a/docs/en/platform/automations/builtin.md +++ b/docs/en/platform/automations/builtin.md @@ -3,7 +3,7 @@ title: Built-in automations description: Choose a shipped mail, GitHub or GlitchTip workflow, check its inputs and connections, and understand what it reads or writes before deployment. --- -Tale includes ten automation packages: three mailbox syncs, three inbox digests, two GitHub review workflows, and GitHub and GlitchTip issue imports. Each starts as version 1 and **Not deployed**. The issue importers run manually; the other packages include schedules. Inspect their inputs, model, connections, and writes before an Owner, Admin, or Developer deploys a version. +Tale includes ten automation packages: three mailbox syncs, three inbox digests, two GitHub review workflows, and GitHub and GlitchTip issue imports. Each starts as version 1 and **Not deployed**. The issue importers run manually; the other packages include schedules, which start switched off: after you deploy a version, the editor offers **Turn on the trigger**. Inspect their inputs, model, connections, and writes before an Owner, Admin, or Developer deploys a version. @@ -87,7 +87,7 @@ Both workflows require `owner` and `repo`. In **Test run**, supply **Run input ( -The shipped GitHub schedules do not supply `owner` and `repo`; deploying alone does not make those scheduled runs valid. A schedule sends only `trigger` and `firedAt`, so the required repository input is missing and the start is refused. Run manually with the required input, or adapt the workflow’s schema and repository configuration before enabling scheduled execution. A refused scheduled start appears as `start_refused` on the [trigger](/platform/automations/triggers). +The shipped GitHub schedules need `owner` and `repo`, but a schedule sends only `trigger` and `firedAt`. After you deploy a version, the editor therefore offers **Review the trigger** instead of turning the schedule on. On the **General** tab, open **Add fixed input**, choose **Add the 2 missing fields**, replace the placeholders with your repository’s owner and name, turn on **Enabled** and save. Every scheduled run then receives those values. A start the workflow still refuses appears on the [trigger](/platform/automations/triggers#diagnose-a-missing-start) as **Skipped: the run’s input was refused**. diff --git a/docs/en/platform/automations/catalog.md b/docs/en/platform/automations/catalog.md index 5b58dc31b1..290cacf392 100644 --- a/docs/en/platform/automations/catalog.md +++ b/docs/en/platform/automations/catalog.md @@ -21,7 +21,7 @@ The **Create automation** menu offers two routes: | Choice | Use it when | What happens next | | --- | --- | --- | -| **Blank (trigger + agent)** | You want to configure the workflow yourself. | Set the name, model, instructions and equipment, then choose when it runs. Creation opens the editor for further changes. | +| **Blank (trigger + agent)** | You want to configure the workflow yourself. | Set the name, model, instructions and equipment, then choose when it runs. **Deploy v1 now** (on by default) puts the first version live at once; otherwise it stays a draft you deploy from the editor. The agent receives what the trigger sends as its input. Creation opens the editor for further changes. | | **Upload package** | You already have a workflow file or a reusable pack. | Tale validates the files and saves a draft version. | Shipped automations are already installed when the organization is created. They still need configuration and a deployed version before automatic use. Follow [the workflow editor](/platform/automations/editor) to test inputs, inspect results and deploy deliberately. @@ -114,7 +114,7 @@ settings: label: Strict checklist ``` -A required form appears before the task’s own fields if that project has not been configured. **Save and continue** writes the forms and proceeds to task creation. Later, **Settings** reopens them as tabs; a dot marks unsaved changes, and **Save** writes every changed form. Closing with unsaved edits asks for confirmation. +A required form appears before the task’s own fields if that project has not been configured. **Save and continue** writes the forms and proceeds to task creation. Later, **Settings** reopens them as tabs; a dot marks unsaved changes, and **Save** writes every changed form. Closing with unsaved edits asks for confirmation. A form’s `description` stands above its fields; when it runs past three lines, its beginning shows with **Read more** to open the rest. Saving replaces the form’s flat YAML file, such as `Setup/validation-policy.yaml`. Existing values prefill the form, including values uploaded by hand. Supported field types are `text`, `number`, `boolean` and `select`; stored values are strings. Text fields can specify a `pattern`, and per-entry `i18n` blocks localize titles, labels, help and options. Keep nested structures and lists in separate files the workflow reads. diff --git a/docs/en/platform/automations/concepts.md b/docs/en/platform/automations/concepts.md index c139c1df64..28e1a26d20 100644 --- a/docs/en/platform/automations/concepts.md +++ b/docs/en/platform/automations/concepts.md @@ -42,17 +42,17 @@ tests: input: { invoiceId: 'inv-1' } ``` -The `ui` block stores canvas positions. Moving a node changes the layout, without changing its execution. +Tale lays out the canvas from the references between nodes, so nobody places a node. A `ui` block is free metadata: Tale keeps it as written and ignores it. ### Edges are derived, not declared -There is no edge list. One node reads another by referencing it — `{{ nodes.invoice.output.id }}` — and that reference _is_ the edge the canvas draws. Execution order is a topological sort over those derived edges, which is why deleting a reference also removes an arrow, and why two nodes that read each other are refused as a cycle. +There is no edge list. One node reads another by referencing it — `{{ nodes.invoice.output.id }}` — and that reference _is_ the edge the canvas draws. Execution order is a topological sort over those derived edges, which is why deleting a reference also removes a line, and why two nodes that read each other are refused as a cycle. Templates use a single `{{ }}` JavaScript-expression grammar over `input`, `nodes..output`, and, inside an iterating node, `item` and `index`. ### Control flow rides on the node -Branching and looping are fields on a node rather than separate step types, so the canvas shows them as badges on the box they affect. +Branching and looping are fields on a node rather than separate step types. The canvas draws each one where it acts: a `when` becomes a condition above its node, an `elseOf` alternative hangs from that condition as its **No** branch, `forEach` and `repeatUntil` put the node in a frame, and `onError: continue` adds a chip to the node. | Field | What it does | | ---------------------------- | ------------------------------------------------------------------------ | @@ -68,9 +68,9 @@ Four types are built in, and every connector action and platform native — know **`transform`** runs pure JavaScript to reshape data. It has no network and no imports: the body reads the node's resolved `input` and must return a value. -**`llm`** calls a language model with a templated prompt. `model` is required and always explicit — an automation never picks one on your behalf (the chat composer's Auto is a chat-only affordance). The output is `{text}`, or the schema-shaped object when the node declares an `outputSchema`. Each live call is usage of the run: it is checked against the [budget limits](/platform/admin/governance/policies-and-limits) before it is made, and a call a limit refuses fails the node with `budget_exceeded`, which halts the run unless its `onError` is `continue`. +**`llm`** calls a language model with a templated prompt. `model` is required and always explicit — an automation never picks one on your behalf (the chat composer's Auto is a chat-only affordance). The output is `{text}`, or the schema-shaped object when the node declares an `outputSchema`. Each live call is usage of the run: it is checked against the [budget limits](/platform/admin/governance/policies-and-limits) before it is made, and a call a limit refuses fails the node with `budget_exceeded`, which halts the run unless its `onError` is `continue`. Before calling the provider, each attempt reserves the estimated prompt cost and the maximum reply allowance in every project admitted for that attempt. The model needs catalog pricing. Reported usage replaces the hold when the call finishes. If a timeout, lost connection or missing usage leaves the cost unknown, the hold remains until the request deadline and is then booked as the reserved estimate; this is an estimate, not a provider bill. Changing project bindings during the call does not move its spend. -**`agent`** runs one turn of a coding agent (Claude Code, Codex, and the other agent runtimes) in the sandbox. It reads staged `files`, uses `skills`, brokered `connectors`, granted platform `tools`, and injected `secrets`, and returns `{text, files, status}`; `model` is required. When an admin has turned on [image generation](/platform/admin/governance/content-models#let-agents-generate-images), it can also create images, which come back among its `files`. Reach for `llm` when a one-shot completion is enough, and for `agent` only when the step needs tools, files, or several turns — a live agent node runs as an asynchronous turn, so it sits at the top level rather than inside a `subautomation` and does not iterate with `forEach`. +**`agent`** runs one turn of a coding agent (Claude Code, Codex, and the other agent runtimes) in the sandbox. It reads staged `files`, uses `skills`, brokered `connectors`, granted platform `tools`, and injected `secrets`, and returns `{text, files, status}`; `model` is required. Its `input` is resolved like any other node's and reaches the agent as JSON in `/agent/workspace/input.json`; the agent's instructions name that file. In a live run, the node fails before the agent starts when that JSON is larger than 1 MiB, or when its `files` also has an entry named `input.json`. When an admin has turned on [image generation](/platform/admin/governance/content-models#let-agents-generate-images), it can also create images, which come back among its `files`. Reach for `llm` when a one-shot completion is enough, and for `agent` only when the step needs tools, files, or several turns — a live agent node runs as an asynchronous turn, so it sits at the top level rather than inside a `subautomation` and does not iterate with `forEach`. **`subautomation`** runs another saved automation as a single node, its `automation` field naming `"name"` or `"name@version"`. Without a version it uses the deployed one, and nesting is capped at three levels. @@ -80,11 +80,17 @@ A **structured** output has named fields that you can reference with `nodes. A tool without an output schema is unstructured. To turn its text into structured data for later steps, use an `llm` node with an `outputSchema`. Validation errors identify the invalid reference and the fields or context that are allowed. Correct that reference before saving again. +## Paths a run can take {#paths} + +Each condition, and each node that may fail while the run goes on, gives a run two ways to continue. Tale tries every combination of them and keeps the distinct ways a successful run can go; each one is a path. A path names the conditions that decide it, such as which nodes run, which are skipped and which fail while the run goes on, and the nodes that run on it. A node that runs on every path always runs; a node that runs on none can never run, and Tale warns about it. + +Tale lists up to 32 paths and counts the rest. With more than 12 conditions and tolerated failures, the combinations are too many to go through, so Tale lists no path; it still says for each node when it runs. Separately, Tale names the nodes whose failure ends the run and what can make each one fail. The editor shows the paths on the canvas, as [Follow the possible paths](/platform/automations/editor#paths) describes; a client of the [MCP endpoint](/develop/mcp-endpoint) reads the same paths from `analysis.paths`. + ## What Tale checks before a run {#checks} Tale checks the whole document when you save it, when you deploy a version, and whenever a client calls `validate_automation`. An **error** describes a definite failure or code that exceeds the analysis limits, and it stops both saving and deploying. A **warning** points at something that can fail or does no useful work; it never stops a save or a deployment, so you decide whether to act on it. Each problem names its node and field and, inside a template, a condition, or code, the exact expression. -To keep checks responsive, each expression and each `transform` body is limited to 8192 UTF-16 code units, 512 JavaScript tokens and 64 levels of syntax or syntax-tree nesting. Whitespace around a template expression does not count toward its size; whitespace in a transform body does. Plain text outside templates is not code. These limits can reject previously valid code: shorten it or split the work across nodes before saving or deploying again. +To keep checks responsive, each expression is limited to 8192 UTF-16 code units and 512 JavaScript tokens. A `transform` body may contain up to 16384 code units and 4096 tokens. Both retain a limit of 64 levels of syntax or syntax-tree nesting. Whitespace around a template expression does not count toward its size; whitespace in a transform body does. Plain text outside templates is not code. These limits can reject previously valid code: shorten it or split the work across nodes before saving or deploying again. ### References and names {#checks-references} @@ -121,6 +127,12 @@ A condition that always gives the same answer decides nothing. Text around a tem A `subautomation` node is checked against the version a run would call: the version it names, otherwise the deployed one, otherwise the latest. That version must exist and contain no `agent` node. Tale warns when the input does not fit its `inputs`, and when it performs a write that an approval could hold, because a called automation cannot wait. A schedule trigger whose start input the automation's `inputs` refuses is reported as well. +### What the organization has {#checks-organization} + +Tale also compares an `agent` node with your organization. It warns when the node asks for a skill that no run of the automation can use, a connector nobody has connected, a secret nobody has stored, or an agent runtime this deployment can't run. A node that runs a connector action nobody has connected gets the same warning, and so does an event trigger that waits for an event Tale doesn't raise. When the automation runs, a missing skill or agent runtime fails the node, a node without its connector can't reach that app, and a missing secret is simply not there. + +These stay warnings because your organization can change before the run: connect the connector or add the skill, and the next check no longer reports it. Only Owners, Admins and Developers are told about secrets, because only they can see which secrets exist. + ### Tests {#checks-tests} A test's input must fit `inputs`, each expected effect must come from a node that performs it, and an expected output value must have a type the automation can return. A test that breaks one of these rules can never pass, so Tale warns before you run it. @@ -145,7 +157,7 @@ A live run needs a deployed version. You can still test a saved draft with **Tes ## What starts a run -Start a saved version manually in test mode, or run the deployed version live. For automatic starts, configure one of three trigger kinds: a schedule with a cron expression and IANA timezone, a webhook URL protected by a token, or a named platform event. +Start a saved version manually in test mode, or run the deployed version live. For automatic starts, configure one of three trigger kinds: a schedule that repeats at times of day or at an interval in its time zone, a webhook URL protected by a token, or a named platform event. Any of them can add a fixed input that every run receives. The trigger belongs to the automation’s name. Deploying another version keeps its trigger configuration and webhook URL while changing the version used by subsequent starts. Disable the trigger when you need to pause automatic runs. [Workflow triggers](/platform/automations/triggers) explains timing, authentication, and the input each kind supplies. diff --git a/docs/en/platform/automations/editor.md b/docs/en/platform/automations/editor.md index 8cf204ccf2..7ec4585e16 100644 --- a/docs/en/platform/automations/editor.md +++ b/docs/en/platform/automations/editor.md @@ -1,25 +1,25 @@ --- title: The workflow editor -description: Inspect and edit nodes, supply test input, save a version, and deploy or roll back an automation. +description: Read an automation on its canvas, follow its possible paths, edit node fields, save a version, and deploy or roll back. --- -Use the workflow editor to change what an automation does and decide which saved version runs live. You need Developer, Admin, or Owner permissions to make changes. Saving, testing, and deployment are separate steps: editing a draft leaves the deployed version in place. +Use the workflow editor to read what an automation does, change its fields, and decide which saved version runs live. Larger changes, such as new nodes, come from a coding agent through MCP. You need Developer, Admin, or Owner permissions to make changes. Saving, testing, and deployment are separate steps: editing a draft leaves the deployed version in place. Open **Automations**, then select an automation. It opens on **Editor**. An automation you open from a project's **Automations** tab shows that project at the start of the breadcrumb trail: choose the project's name to return to the project, or **Automations** to return to its automations. Whether you open an automation from a project or from the automation list, the rail marks **Automations**. To create one first, use [Create or import an automation](/platform/automations/catalog). | Tab | Use it to | | --- | --- | -| **Editor** | Change the workflow, test a saved version and choose what runs live. | +| **Editor** | Read and change the workflow, test a saved version and choose what runs live. | | **General** | Choose what starts the automation and which projects can use it. | | **Runs** | Inspect recent executions and open a run’s full record. | The **Version** selector stays at the right of the Editor, General and Runs tabs on desktop and mobile. Open it to read version messages, dates, test results and the live marker, then select a row to open that version. On desktop, run actions sit beside the tabs together with **Save** and **Discard**; on **General**, only **Save** and **Discard** sit there. A dot on a tab marks its unsaved changes. Leaving the tab or switching versions asks you to resolve those changes first. -On a phone, opening an automation starts with compact navigation. The editor canvas fills the available height, and its run and deploy controls sit inside the canvas beside the zoom controls. Selecting a node opens its fields — and Save and Discard — in a panel at the bottom of the screen. +On a phone, opening an automation starts with compact navigation. The editor canvas fills the available height, and its run and deploy controls sit in a toolbar at the bottom of the canvas. Selecting a node opens its fields — and Save and Discard — in a panel at the bottom of the screen. -![The workflow editor shows connected nodes and the selected node’s fields beside the canvas.](/images/platform/automation-editor-canvas.webp) +![The workflow editor shows the nodes of Gmail triage inbox between Start and End, a condition in words above one node, and the selected node’s fields beside the canvas.](/images/platform/automation-editor-canvas.webp) @@ -27,23 +27,111 @@ To switch without returning to the list, click the current automation's name in ## Read the canvas -Each box is a node. Its label identifies the step and type; **Reads** lists the nodes whose outputs it uses. Arrows come from references such as `{{ nodes.draft.output.text }}`. Edit the reference to change the dependency. The canvas does not create dependencies by drawing an arrow. +Tale draws the canvas from the automation's document and arranges it for you: **Start** sits at the top, **End** at the bottom, and every node sits below the nodes it reads, so the canvas reads from top to bottom in the order a run goes. Nobody places a box, and drawing does not connect anything. A line comes from a reference such as `{{ nodes.draft.output.text }}`; to change what a node reads, change the reference. -Badges show conditions and loops: `when`, `else of`, `for each`, `repeat until`, and `continue on error`. A cycle warning means two or more nodes depend on one another; remove the circular reference before saving a runnable version. +### Start and End + +**Start** says what starts a run and what it receives. Under **Starts**, it lists the trigger in words, such as a schedule with its time zone and next run, and says when the trigger is off or waits for a live version. **By hand, the API or MCP** follows, because those starts are always possible. Under **Input**, it lists the fields of the run input with their type and whether they are required. When the trigger would start runs whose input the automation refuses, Start says so. + +**End** says what a successful run returns and how a run can end. Under **Returns**, it names the output, such as **The output of Report**, or lists its fields and the nodes they come from; a field that is empty on some runs says **may be empty**. Under **Ends**, it lists the three outcomes: **Succeeded** returns the output, **Failed** happens when one of the nodes that stop the run fails, and **Stopped** happens when someone stops the run. + +### Nodes + +Each node is a box. Its first line shows the node's icon and its title, made from its ID: `open_issues` reads **Open issues**. The next line says what kind of node it is: the connector and action, such as **GitHub · List issues**, **Transform**, **Language model** or **Agent** with its model, or the automation it calls. When Tale knows what the node returns, a line shows the shape, such as `{ issues: object[] }`. The bottom line says what the node reads, such as **Reads Issues and run input (owner, repo)**, or **Reads no other node**. + +Chips and small icons add what the layout cannot show. **Continues on error** marks a node whose failure the run tolerates, and **Never runs** a node that no combination of conditions reaches. A shield marks a node that changes data in a connected service, where a live run may wait for an approval; a speech bubble marks an agent that may ask a question; a crossed-out pin marks a model with no pinned provider. Point at an icon to read its sentence; a screen reader hears it with the box. A box with problems shows their counts in its first line. + +### Conditions and branches + +A node's condition (`when`) stands above it as a pill that says the condition in words, such as "total of Score is greater than 1,000". The node below runs only if the condition holds. When another node is its alternative (`elseOf`), the condition splits into two lines: **Yes** leads to the node on the left, which runs when the condition holds, and **No** leads to its alternative on the right. A condition that Tale cannot put into words shows the expression itself, in code type. + +```yaml +nodes: + - id: escalate + type: transform + when: '{{ nodes.score.output.total > 1000 }}' + input: { total: '{{ nodes.score.output.total }}' } + code: 'return { text: "Escalate " + input.total };' + - id: file + type: transform + elseOf: escalate + input: { total: '{{ nodes.score.output.total }}' } + code: 'return { text: "File " + input.total };' +``` + +In this excerpt, the condition above Escalate reads "total of Score is greater than 1,000", **Yes** leads to Escalate and **No** to File. Point at a condition, or at its **Yes** or **No**, to light up the paths through it. + +### Lines, frames and dashed boxes + +A solid line means the lower node reads the output of the upper one. A dashed line means the lower node runs after the upper one without reading its output, as when its condition reads it. A dotted line into End leaves the last node of a run whose output End does not return. The **Yes** and **No** lines have their own colours. + +A frame around a node says it runs more than once: once per item of a list (**For each item of …**) or again until a condition holds (**Repeats until …, at most 5×**). A dashed box is a node that may not run; after a run, it is a node that didn't run. **Legend**, beside the zoom controls, explains each kind of line and box. + +### Keyboard and the List view + +The chart is one stop in the Tab order. Tab to it and the focus lands on Start; the arrow keys follow the lines from box to box and move along a row, Home and End jump to Start and End, and Enter opens the box in focus. A screen reader hears each box's title, its kind and what it reads; for a condition, it hears which node the condition decides on. + +The view switch at the top left of the canvas changes between **Canvas**, **List** and **Source**. **List** shows the same nodes in run order, each with what it reads and its condition in words, and Enter opens a node from there too. When the canvas is very narrow, it starts in **List**. The address keeps the view and the open node, so a link you share opens both. + +### When a new version arrives {#new-versions} + +Someone can save a new version while you look at the automation, for example a coding agent through MCP. If you are looking at the latest version and have no unsaved changes, the canvas switches to the new one: boxes glide to their new places, new boxes fade in, changed ones are ringed once, and a screen reader hears "Now showing v6.". The node you had open stays open if it still exists. If you have unsaved changes, nothing moves. A notice above the canvas says **A newer version was saved**, and **Show v6 and discard my draft** switches to it. + +## Follow the possible paths {#paths} + +A run's conditions decide which nodes run. The paths button at the top right of the canvas counts the ways a successful run can go, such as **3 paths**, and opens **Possible paths**. Each path names the conditions that decide it, such as "Triage runs" or "Propose fails, the run goes on", and how many nodes run on it. + +Point at a path, or move to it with the arrow keys, to preview it on the canvas. Click it or press Enter to keep it shown: nodes off the path turn dashed and say why they don't run, End marks the outputs that stay empty on that path, and a screen reader hears which path is shown. **Show all**, or Escape, shows every node again. The list stays open while you select nodes, so you can compare a path with a node's fields. + +Under **Ends the run when it fails**, the list names the nodes whose failure stops the run, with what can make each one fail. Point at one to ring all of them in red; select one to open it. + +On a phone, the list opens in a panel at the bottom of the screen. Choosing a path closes the panel and leaves a pill at the top of the canvas that names the path, with **Show all**. When every run takes the same path, the list says so. An automation with more than 12 conditions and tolerated failures has too many paths to list; each node's **When it runs** still says when it runs. A canvas with a cycle has no paths button. [Paths a run can take](/platform/automations/concepts#paths) explains how Tale works the paths out. ## Edit a node -Select a box to open its fields. On a wide screen, the panel opens beside the canvas; until you select a node, the canvas takes the full width. On narrower screens, the fields open in a dialog over the canvas. A `transform` has **Code**; an `llm` has prompt, model, and output-schema fields; an `agent` also has agent runtime and equipment. The **Model** picker of an `llm` or `agent` node lists the models your organization’s connected providers serve; a model that is not listed can still be typed, but **Problems** then warns that a live run would fail at that node until its provider is connected. **Input** contains JSON values and references passed to the node. Incomplete JSON is reported and does not update the node. +Select a box to open it. On a wide screen, the inspector opens beside the canvas; until you select a node, the canvas takes the full width. On narrower screens, it opens in a panel over the canvas. Its header shows the node's title, its kind, and its ID with **Copy node ID**; problems that belong to the node are listed under it. **When it runs** sums up the node's place in the flow: on every run, on some of the paths or never, why it can be skipped, and what happens when it fails, such as "If it fails, the run stops with its error." + +Three tabs follow: + +- **Fields** holds what you can change. A `transform` has **Code**; an `llm` has **Prompt**, **System prompt**, **Model** and **Output schema**; an `agent` also has its agent runtime and equipment. **Input** contains the JSON values and references passed to the node. +- **Shape** shows what the node receives and returns, where Tale got that shape from, and which nodes read its output. Select a reader to open it. **Show as TypeScript** shows the same shape as a type. +- **Last run** shows the node's **Resolved input**, **Output** and effects in the run shown on the canvas. It appears while the canvas shows a run. + +The **Model** picker of an `llm` or `agent` node lists the models your organization’s connected providers serve; a model that is not listed can still be typed, but **Problems** then warns that a live run would fail at that node until its provider is connected. + +Open **Control flow** for the node's condition, iteration and failure handling; it is already open on a node that uses one of them. **When**, **For each** and **Repeat until** take expressions. **Else of** offers only nodes that have a condition, and **None** removes the alternative. **Maximum repeats** appears with **Repeat until** and takes a whole number from 1 to 20. **On error** chooses between **Stop the run** and **Continue without it**; continuing skips every node that reads the failed node's output. Under a condition, a list or an alternative, a sentence says in words what the setting does. + +Use **Close** to return to the canvas. On a wide screen, clicking the empty canvas or pressing Escape outside a text field also closes the panel. The automation's trigger and project settings are on the **General** tab. [Automation concepts](/platform/automations/concepts) explains the node types and expression rules. + +### Code, prompts and JSON + +Code, prompts, conditions and JSON fields are code editors. They colour the syntax and every `{{ }}` template, and they know the automation. Type `{{` in a prompt and the closing braces appear with the cursor between them; type `nodes.` to see only the nodes that run earlier, and `.output.` to see that node's fields with their types. Ctrl+Space opens the suggestions anywhere. Point at a reference to see its type, or press ⌘K ⌘I (Ctrl+K Ctrl+I) to have the type at the cursor shown and read out. + +A moment after you stop typing, a problem is underlined exactly where it is. F8 and Shift+F8 move to the next and previous problem and read it out; ⌘. (Ctrl+.) applies a suggested fix, such as the closest node name. In a field with several lines, Tab indents; to leave it with the keyboard, press Escape, then Tab. **Expand editor** opens a long field in a larger editor, and **Back to the field** returns to it with your edit and your cursor in place. + +A JSON field such as **Input** changes the node only when its text is valid JSON of the right kind. While you type, the node keeps its last valid value and the field says what is missing, such as "This must be a JSON object, in curly braces." + +### Start inputs and End output + +Select **Start** to see what starts the automation. **Trigger** lists it in words; **Change in General** opens the **General** tab, where you set the trigger. Under **Fields**, **Inputs** shows the fields of the run input as a tree, and **Input schema** holds the JSON Schema behind them, which you can edit. **Shape** shows the input as Tale reads it, and **Last run** the input of the run shown. + +Select **End** to see what a run returns. **How a run ends** lists the three outcomes; under **Failed**, each node whose failure stops the run is a button that opens it. Under **Fields**, **Output** holds the JSON value a successful run returns, with templates such as `{{ nodes.report.output }}`. **Shape** shows the output's shape, and **Last run** the output of the run shown. + +## Read the source + +Choose **Source** in the view switch to read the whole document as YAML, highlighted, with line numbers, folding and search (⌘F or Ctrl+F). Every problem the check found is underlined at the line it concerns, so a problem in a part without a field of its own, such as a test or the name, has a place to be read. The source is read-only: **Copy YAML** copies it, and **Download YAML** saves it as a file named after the automation and version, such as `gmail-triage-inbox-v3.yml`, with `-draft` added while you have unsaved changes. To change the document, use the fields or your coding agent. + +## Edit with your coding agent -Open **Control flow** for conditions and iteration; it is already open on a node that has one. Use **Close** to return to the canvas. On a wide screen, clicking the empty canvas or pressing Escape outside a text field also closes the panel. The automation's trigger and project settings are on the **General** tab. [Automation concepts](/platform/automations/concepts) explains the node types and expression rules. +Larger changes, such as adding nodes or reworking the flow, come from a coding agent such as Claude Code, Codex or Cursor, connected to Tale's MCP server. **Edit with your coding agent** is the last button at the top right of the canvas in every view, and the main action of an automation that has no nodes yet. Its dialog shows the automation's name to give the agent, **Set up MCP**, which opens **Settings > API > MCP**, and **How to connect a coding agent**, which opens the [MCP endpoint](/develop/mcp-endpoint) guide. The agent reads the automation, changes and checks it, and saves a new version, which then appears on the canvas as [When a new version arrives](#new-versions) describes. ## Find and fix problems -While you edit, Tale checks the draft the same way it checks a save. A moment after you stop typing, the **Problems** button beside **Save** shows what the check found: a red error icon and an amber warning icon, each with its count, or **No problems**. On a phone, the button sits in the toolbar over the canvas. An error is something a run would fail on, such as a reference to a node that does not exist. A warning is something that might go wrong, such as reading the output of a node that is sometimes skipped. A node with problems shows the same counts on its box, and a field with a problem explains it under the field. +While you edit, Tale checks the draft the same way it checks a save. A moment after you stop typing, the **Problems** button beside **Save** shows what the check found: a red error icon and an amber warning icon, each with its count, or **No problems**. On a phone, the button sits in the toolbar over the canvas. An error is something a run would fail on, such as a reference to a node that does not exist. A warning is something that might go wrong, such as reading the output of a node that is sometimes skipped. A node, a condition, Start or End with problems shows the same counts on its box, and a field with a problem explains it under the field. Click **Problems** to list them. On a wide screen the list opens under the canvas; on narrower screens it opens in a panel. Each entry says what is wrong, where it is, why, and how to fix it. **Technical details** shows the engine's own message, and the code beside the title helps when you search or ask for support. **All**, **Errors** and **Warnings** filter the list, and Escape closes it. -Select an entry, or press Enter on it, to go there: the node opens, its field takes focus, and where the field shows the text as written, the part that causes the problem is selected. A problem with no field of its own, such as a model the organization does not serve, is listed under **Problems in this node** at the top of the node's fields. A problem in a part of the automation the editor does not show, such as its output or its tests, says that it can't be edited here; change that part through MCP, the API or an uploaded package. +Select an entry, or press Enter on it, to go there: the node opens, its field takes focus, and the part that causes the problem is selected. A problem with no field of its own, such as a model the organization does not serve, is listed under **Problems in this node** at the top of the node's fields. A problem in the inputs opens **Start**, one in the output opens **End**, and one in any other part of the document, such as a test or the name, opens **Source** at that line. A problem in a node that your draft no longer has says "Change this with your coding agent." While errors remain, **Save** is disabled and says why, for example "Fix 1 error to save". On a phone, where **Save** sits under a node's fields, **Show problems** beside that reason opens the list. Warnings never block saving or deploying. If Tale can't check the draft, for example because the connection dropped, the button shows **Couldn't check** and you can still save: every save is checked again on the server. When a save or a deploy is refused because of errors, the list opens with the server's problems, starting at the first error. @@ -53,7 +141,7 @@ The check runs only for Developers, Admins and Owners, the roles that can save. 1. Edit the required fields and click **Save**. 2. Enter a **Version message** that explains the change, then **Save version**. This appends a version and preserves earlier ones. If someone saved another version while you were editing, Tale refuses the save and asks: **Discard my changes and reload** shows the newer version, **Save anyway** appends your version on top of it — the newer one stays in the version history, but the latest version is then yours. -3. Click **Test run**. If the workflow declares an input schema, fill **Run input (JSON)** in the dialog. Expand **Input schema** to inspect required fields and types. Invalid JSON or a schema mismatch prevents the start. +3. Click **Test run**. If the workflow declares an input schema, type the input as JSON in **Run input (JSON)**; the field suggests the schema's field names as you type a key, and ⌘Enter (Ctrl+Enter) starts the run. Expand **Input schema** to see the required fields and their types. Invalid JSON or a schema mismatch prevents the start. 4. Start the test, switch to the **Runs** tab and inspect its row. Open it to compare the resolved input, output, and proposed operations with your expected result. For a workflow requiring `owner` and `repo`, an input might be: @@ -71,7 +159,7 @@ Use the workflow's actual schema. A field typed as a number must receive a JSON -![The Test run dialog shows owner and repo JSON values and the expanded input schema.](/images/platform/automation-run-input.webp) +![The Test run dialog shows owner and repo JSON values in the code editor and the expanded input schema as a list of fields.](/images/platform/automation-run-input.webp) @@ -85,7 +173,7 @@ A trigger also runs the deployed version. Set it up only when you are ready for ## Diagnose a result -**Show last run** overlays run states on the canvas. Select a node to see **In this run**, its **Resolved input**, **Output**, and effects. This is often enough to find a wrong reference: compare the input received by the failed node with the output of the node it reads. +Once the automation has run, the canvas shows its latest run: each node's bottom line says how it ended, such as **Succeeded** or **Skipped**, and each condition shows how it decided, **Yes** or **No**. The eye button at the top right of the canvas, **Hide last run**, removes the run from the canvas, and **Show last run** brings it back. Select a node and open **Last run** to see its **Resolved input**, **Output**, and effects. This is often enough to find a wrong reference: compare the input received by the failed node with the output of the node it reads. Switch to **Runs** and open a row for the full record. The tabs remain visible with **Runs** active; **Editor** returns to the workflow. Check whether it was a test or live run and inspect already completed operations before starting another run. [Execution logs](/platform/automations/execution-logs) explains waiting, failures, automatic retries, and stopping. diff --git a/docs/en/platform/automations/execution-logs.md b/docs/en/platform/automations/execution-logs.md index 0528024cb8..d4211763d7 100644 --- a/docs/en/platform/automations/execution-logs.md +++ b/docs/en/platform/automations/execution-logs.md @@ -1,19 +1,19 @@ --- title: Read automation runs and recover from failures -description: Trace a run from its status to the failing node, inspect recorded writes and decide whether to stop, fix or retry. +description: See why a run failed or a step was skipped, what each step read and returned, play the run back, and run it again, from a step, or side by side with another run. --- Open an automation, switch to its **Runs** tab and select a row to understand what happened. Start with its status, version and mode, then inspect the relevant node. A successful test run proves the workflow’s mocked execution; it does not prove that a real external account will accept the same action. -![The run page of a test run of Triage GitHub issues, marked Succeeded, Test, and v1 and started by you, with its start and finish times above the workflow graph, where the issues, open issues, score, and report nodes each show Ran; the run's effects list begins below the graph.](/images/platform/automation-run-detail.webp) +![The run page of a test run of Triage GitHub issues, marked Succeeded, Test, and v1 and started by you, with its start and finish times above the workflow graph, where the issues, open issues, score, and report nodes each show Succeeded; the run's effects list begins below the graph.](/images/platform/automation-run-detail.webp) ## Read the run’s state -The **Runs** tab lists the latest 50 runs you can see, newest first. Owners, Admins, and Developers see the organization’s own runs; a run in a project, and any question it waits on, appears only to those of them who can open that project. Each row identifies its version, time, mode and starter, or gives a failure or waiting reason. The detail shows the workflow with node results and run timing; an unfinished run has no completion time. The tabs stay visible while you inspect a run. Choose **Runs** to return to the list or **Editor** to change the workflow. +The **Runs** tab lists the runs you can see, newest first, and loads older ones as you scroll; **Filter** narrows them by status and mode. Owners, Admins, and Developers see the organization’s own runs; a run in a project, and any question it waits on, appears only to those of them who can open that project. Each row identifies its version, time, mode and starter, or says why the run failed or what it waits for. The detail shows the workflow with node results and run timing; an unfinished run has no completion time. The tabs stay visible while you inspect a run. Choose **Runs** to return to the list or **Editor** to change the workflow. | Status | Meaning | What to do | | --- | --- | --- | @@ -34,16 +34,63 @@ A waiting approval, a question or a step that may already have run requires a pe Leave the run on hold while you investigate. **Request stop** asks Tale to stop the sessions it can identify and explains the uncertainty before you confirm. **Stop requested** is not confirmation that the work stopped: the hold remains until its earlier work is confirmed to have stopped. The request does not undo earlier external actions. If the hold changes while the confirmation is open, close the dialog and review the updated details. -## Inspect the node that matters +## Understand why a run failed {#failures} -Select a node on the run’s canvas. **Resolved input** shows the actual values after template evaluation; **Output** shows what the step returned. These fields distinguish a bad reference from a service failure. +A failed run opens with a card that says where it failed and why: **The run failed at Greet**, a short title for what went wrong, such as **A value it reads is missing**, what that means, the concrete cause, and **How to fix**. For a missing value, the cause names the expression, the field it read, and the step whose output held nothing; the fix suggests a read that cannot fail, such as `nodes.fetch_customer.output.customer?.email`. The engine’s own message stays under **Technical details**. -Node states include **Ran**, **Skipped**, **Failed**, **Never reached**, **Not reached yet** and, on a stopped run, **Stopped here** for the node the run was on when it was stopped. A skipped node may have a false condition, an unmet dependency, an alternate branch or a failure rule that permits continuation. Do not assume every skipped node is an error. +Below the card, the step and its field, such as **Greet › input.email**, sit beside **Show in editor**, which opens the editor on the version the run ran with that step selected. **Show step** selects the step on the run’s canvas, and **Retry from this step** prepares the retry described in [Retry from a step](#retry-from-step). -For example, a reminder node may receive a customer name but an empty invoice ID. Inspect its upstream output: if the record now uses another field, correct the reference there rather than replacing the mail credential. Verify the corrected resolved input in a new test run. +On the canvas, the failed node is framed in red and its bottom line repeats the failure’s title; the nodes the run went through to reach it stand out while the others step back; and End says where the run failed, such as **Failed at Propose**. The **Runs** list names a failed run’s cause with the same title. Applications reading the [run API](/develop/api-reference) also receive `failureCode` when a failed run has a classified cause. For example, `approval_rejected` means a person refused the operation, while `llm_output_invalid` means a model response did not match the required structure. Historical failures can lack a code. Use it to route an investigation; it does not establish that retrying is safe or will succeed. +## Find out why a step ran or was skipped {#conditions} + +Select a node on the run’s canvas to open its **Last run** tab. A step that ran or was skipped because of a condition says so in a sentence, such as **Big order was skipped because its condition was false**. Below it, **Only if** shows the condition in words, with the value each reference read and the way it came out: “amount of the run input (250) is not greater than 1,000”, **No**. A condition joined with `&&` or `||` lists each part with **Yes** or **No**; a part the run never had to check reads **Not checked**. A condition written as code shows its code instead. + +A skipped node may have a false condition, an alternative that ran, a skipped step it reads, or a failure rule that let the run continue; the sentence names which, and the step involved. Do not assume every skipped node is an error. + +On the canvas, each node’s bottom line says how it ended: **Succeeded**, **Failed**, **Skipped**, **Not run**, **Not reached yet**, **Reused** for a step a retry took over from an earlier run, or, on a stopped run, **Stopped here** for the node the run was on when it was stopped. Each condition shows how it decided, **Yes** or **No**. + +## See what a step read, received and returned {#step-data} + +**What was read** lists each value the step took from the run input or from other steps, in words and with the value it read, such as “items of Inbox: 3 items”. **Received** shows the step’s input after its templates were filled in, and **Returned** what it produced. Together they tell a bad reference from a service failure. A value that held a secret is hidden and says so, and a value too large to keep in full says that only part of it was kept. + +A value reads as a tree you open with the arrow keys. **Values** and **Shape** switch between the values and the fields and kinds they hold, and the buttons copy a value, download a large one or open it full screen. When a step’s input and output are both objects or both lists, **What it changed** lists the fields the step added, removed and changed. + +A step that runs once per item lists its items, each with how it ended and, for a failed one, why. **Failed only** narrows the list, and selecting an item shows what that item read, received and returned. Tale keeps the first 200 items and every failed one. A step that needed more than one try, or whose try a restart cut short, lists its **Attempts**. A step that called a service says whether the call was done, failed or may already have run, and what a person chose about it. + +For example, a reminder node may receive a customer name but an empty invoice ID. Inspect what it read from the step before it: if the record now uses another field, correct the reference there rather than replacing the mail credential. Verify the corrected input in a new test run. + +## Play the run {#play} + +The bar under the run’s canvas plays the run back: each step lights up while it works, values travel along the lines to the steps that read them, and each condition shows its decision. It opens on the run’s end, so you see the whole story first. **Play** runs it from the start, **Previous event** and **Next event** step through it, and the slider moves to any moment; the clock shows how long the run had really been going, and the speed changes how fast it plays. Long waits are shortened so they do not stall the replay. While a run is still going, the bar follows it; after you move back, **Follow live** returns to its end. + +**Steps**, beside **Chart**, lists the same run as its steps in time order: how long each worked, a bar for when it worked, each condition with its decision, and waits and restarts. It plays on the same clock. Choosing a step opens it and moves the clock to where it started, and **Chart** shows the canvas at that moment. A step that ran once per item or repeated opens to its items or passes, each with how it ended and how long it worked, and choosing one opens it in the step’s **Last run** tab. The page’s address keeps the view (`?view=steps`), the step and the item you chose, and the moment the replay rests on, so a link or a reload opens the run where you left it. + +## Run it again {#run-again} + +**Run again** starts a new run of the same version with the same input and mode. A test run starts at once; a live run that sent writes asks first and names the services it would send to again. The menu beside it offers: + +- **Edit input and run…** opens the run dialog with this run’s input to change; confirming an unchanged input runs the run again. +- **Run again on v6 as a test** when a newer version exists, and **Run again as a test** for a live run. +- **Run live on v5** when another version is live and your role may start live runs. +- **Compare with the previous run**, **Copy run ID** and **Copy link**. + +When a live run cannot run again live, because its version is no longer live or your role may not start live runs, **Run again** says why. + +The new run’s header names where it came from, such as **Replay of run 1db433 · edited input**, with **Open run** and **Compare with it**. A replay is a new run: it sends its writes again, and it uses what a run uses. + +## Retry from a step {#retry-from-step} + +**Retry from this step** shows what the retry will do before it starts. **Reused** lists the steps whose results the new run takes from this one, and **Runs again** the step you chose and every step after it that depends on it. When those steps write to a service and the retry runs live, the dialog warns that the writes go out again. A retry of a test run stays a test, because the results it would reuse were made up. + +Tale refuses a retry it cannot do faithfully and says why: the version to run changed a step the retry would reuse, the run has not finished, or the run kept no input. On the new run’s canvas, the steps it took over are marked **Reused**. + +## Compare two runs {#compare} + +**Compare with it** on a replay, **Compare with the previous run** in the **Run again** menu, or two runs selected in the **Runs** tab and **Compare** opens two runs side by side. **What differs** names, most telling first, the versions they ran, how many fields of their input differ, the step where they split and why, such as a condition that went the other way, how each ended, and their output and writes. The table below lists each step with how each run left it and whether its data is the same. **Swap A and B** swaps the two runs. When their input or output differs, **Input: A → B** and **Output: A → B** show the two side by side, each changed field marked. **Both runs on the chart** draws the two on the chart of B’s version: each step says how A and how B left it, the step where they part is ringed, and a step A’s version lacks is dashed. + ## Check what the run changed The effects list records connector writes, with the node, connector and input. A test uses deterministic stand-ins; live actions can change external systems. The run explicitly reports when it has no recorded effects. @@ -52,7 +99,7 @@ Read effects before retrying. A failure later in the graph does not undo an earl ## Understand continuation and automatic retries -The engine checkpoints completed nodes and resumes after those checkpoints when execution continues. A separate run starts with separate checkpoints and can repeat writes, so “run again” is different from resuming the existing run. +The engine checkpoints completed nodes and resumes after those checkpoints when execution continues. A separate run, such as one started with **Run again**, starts with separate checkpoints and can repeat writes, so it is different from resuming the existing run; a [retry from a step](#retry-from-step) reuses only the results of the steps before that step. A run can move to another server while it runs. A server that is being updated or restarted hands its runs on at their next step: the step under way finishes, and the next server continues with the step after it, or with the next item when the step runs once per item. A step still working 20 seconds into the restart is interrupted and runs again on the next server. When a server stops without warning, another one takes its runs over within about a minute and a half. Steps that had finished do not run again. The run’s header then reads **Resumed after a restart**, or how many restarts, with the time of the last move and its reason: the server running it was being updated or restarted, or it stopped responding. Until another server has taken the run over, its status reads **Interrupted — resuming**. @@ -74,6 +121,6 @@ An exhausted budget, full execution-window timeout, or expired question does not Select **Stop the run** for an unfinished run you want to cancel, and confirm. Cancellation stops further work at the engine’s execution boundaries; it does not roll back completed effects. If the run finishes before the cancellation reaches it, its completed outcome is retained. -To repair a document problem, return to the editor, change the relevant input or node, and save a version with a useful message. Run a test with representative input and inspect the values and output, not only the success badge. Deploy that version when the result is ready. Scheduled and webhook starts then use the deployed version; an older failed run remains a record of the old version. +To repair a document problem, use **Show in editor** on the failure card or return to the editor, change the relevant input or node, and save a version with a useful message. Run a test with representative input and inspect the values and output, not only the success badge. Deploy that version when the result is ready. Scheduled and webhook starts then use the deployed version; an older failed run remains a record of the old version. If the run never started, inspect its [trigger](/platform/automations/triggers). A disabled trigger, missing deployment or rejected input can explain the absence of a run altogether. diff --git a/docs/en/platform/automations/triggers.md b/docs/en/platform/automations/triggers.md index 2733af3902..6415d5d42b 100644 --- a/docs/en/platform/automations/triggers.md +++ b/docs/en/platform/automations/triggers.md @@ -1,13 +1,13 @@ --- title: Start automations automatically -description: Configure schedules, webhooks and platform events, match their input shape and diagnose missed starts. +description: Run an automation on a schedule, from a webhook or on a platform event, check what each run receives, and find out why a start was skipped. --- -Use the **Trigger** section on the automation’s **General** tab when work should start on a schedule or in response to an event. Every trigger starts the deployed version in live mode. Before enabling one, test the workflow with the input shape it will receive and check that its external actions are ready. +Use the **Trigger** section on the automation’s **General** tab when work should start on a schedule, when another system sends a request, or when something happens in Tale. Every trigger starts the deployed version in live mode. Before you turn one on, check what its runs will receive and that the workflow’s external actions are ready. - + -![The General tab of Triage the Gmail inbox with a Schedule trigger switched on, the cron expression 0 */6 * * * described as every six hours and not starting until a version is deployed, the UTC timezone, and an empty Projects selector below.](/images/platform/automation-general-trigger.webp) +![The General tab of Triage the Gmail inbox with Enabled switched off, Schedule as the trigger type, the Repeat format with a schedule of every 6 hours, the UTC timezone, Start the latest one when Tale is back under Missed runs, and the next runs listed under Would run at.](/images/platform/automation-general-trigger.webp) @@ -15,9 +15,11 @@ Use the **Trigger** section on the automation’s **General** tab when work shou | Trigger type | Use it for | Input passed to the run | | --- | --- | --- | -| **Schedule** | Periodic work at a local time or regular interval. | `{ trigger: "schedule", firedAt: }` | +| **Schedule** | Periodic work at local times of day or at a regular interval. | `{ trigger: "schedule", firedAt: }` | | **Webhook** | A delivery from another system. | `{ trigger: "webhook", payload: … }` | -| **Platform event** | A named event inside the organization. | `{ trigger: "event", event: "…", payload: … }` | +| **Platform event** | Something that happens in the organization, such as a new task. | `{ trigger: "event", event: "…", payload: … }` | + +Every type can also add a [fixed input](#fixed-input): values each run receives beside these fields, such as the repository a scheduled triage reads. An automation has one configured trigger at a time. Changing its type replaces the previous binding. Replacing a webhook revokes its URL immediately; configuring another webhook later does not recover that credential. @@ -29,24 +31,73 @@ An API or MCP client can also start work without a configured trigger. Its API k -Open the automation, then its **General** tab. Without a binding, the **Trigger** section says that the automation runs only when started by hand or through the API; choose **Add trigger**, then **Schedule** under **Trigger type**. A new trigger starts with **Enabled** off — keep it off while preparing a workflow that should not start yet. +Open the automation, then its **General** tab. Without a binding, the **Trigger** section says that the automation runs only when started by hand or through the API. Choose **Add trigger**. A new trigger is a **Schedule** that runs daily at 9:00 in your time zone, with **Enabled** switched off. Keep it off while you prepare a workflow that should not start yet. + + + + + +Leave **Schedule format** on **Repeat** and open **Schedule**. The presets are **Every 15 minutes**, **Every hour**, and daily, weekday, weekly and monthly runs at a time of day. The weekly and monthly presets use today’s weekday and day of the month, and every preset with a time keeps the schedule’s earliest time. Choosing a preset closes the popover and puts it in the form. Under the presets and the custom views, the popover lists the next three runs of the schedule you are building. + + + + + +Choose **Custom times** to run at times of day: pick **Day**, **Week**, **Month** or **Year**, the interval (for example every 2 weeks), the weekdays or the day, and up to 12 times under **At**. **Add time** adds a time one hour after the last one. A time that is already in the list runs once, and saving sorts the times. + +Choose **Custom interval** to start every few minutes or hours: up to every 30 minutes in steps that divide an hour, or up to every 12 hours in steps that divide a day, at a number of minutes past the hour. Keep the weekdays it should run on and, with **Only between**, limit it to the hours between two times. Under the hours, the picker names the day’s first and last run. + +**Save**, Enter or Ctrl+Enter (Cmd+Enter on a Mac) applies the custom schedule; **Cancel** or Escape discards it. + + + + + +**Timezone** is the zone the schedule’s times are read in. It starts as your own; search for another IANA zone such as `Europe/Zurich` when the work follows another office’s hours. - + -Fill **Cron** and choose **Timezone**. A cron expression has five fields: minute, hour, day of month, month and day of week. Use an IANA timezone such as `Europe/Zurich` when local business hours matter; an unspecified timezone means UTC. +**Next runs** lists the next five starts in the schedule’s zone and, when your own zone is different, the same moment in your time zone. While you have unsaved changes the heading reads **Next runs (unsaved)**. While the trigger is off or no version is deployed, it reads **Would run at**, and the line below says what is missing. - + -Review the next occurrence shown for a valid expression: it is the minute the schedule will actually start, daylight-saving changes included. Then click **Save** beside the tabs. Confirm that the workflow’s deployed version accepts the schedule input above. When ready, turn on **Enabled** and save again. Check the next started run under **Runs**. +Click **Save** beside the tabs. Under [This run receives](#check-what-a-run-receives), check that the deployed version accepts the input. When you are ready, turn on **Enabled** and save again. The next started run appears under **Runs**, and the **Trigger** section shows it as the last run. +**Custom interval** counts from local midnight, so every 2 hours at 15 minutes past the hour starts at 00:15, 02:15 and so on. **Only between** includes the start and stops before the end: from 8:00 until 18:00, every 15 minutes runs last at 17:45. An end earlier than the start runs overnight, and the hours after midnight belong to the day the window started, so Friday from 22:00 until 06:00 runs into Saturday morning but not on Saturday evening. An end of 00:00 runs until midnight, and the same start and end means all day. When no run would fall between the two times, for example every 6 hours from 8:00 until 11:00, the picker says so and **Save** waits until you widen the hours or shorten the interval. + +### When the clocks change + +A schedule keeps its local times through daylight-saving changes: + +- A time the clock skips that day starts once, moved forward by the gap. In `Europe/Zurich`, a 02:30 run starts at 03:30 on 29 March 2026. +- A time the clock repeats starts once, the first time it occurs. +- **Every N minutes** and **Every N hours** keep their real-time spacing instead: they run twice in the hour the clock repeats, and not at all in the hour it skips. + +**Next runs** marks a start that meets a change with **Clock change** and explains what happens. + +### When runs are missed + +**Missed runs** decides what a schedule does with the times it was due while Tale was unavailable, for example during an update: + +| Choice | What happens when Tale is back | +| --- | --- | +| **Start the latest one when Tale is back** (default) | The most recent missed time runs once, however late. Earlier missed times are counted, not run. | +| **Skip them** | A run more than 10 minutes late does not start; it is counted as missed. | + +For example, a schedule that runs daily at 09:00 misses its start while Tale is down from 08:30 to 10:15. With the default, a run starts at 10:15 for 09:00; with **Skip them**, nothing starts, and the **Trigger** section says that 1 run was missed. Whenever runs are counted as missed, the section says how many and between which times, counting up to 1,000. With the default, those are the times before the one that started, such as the earlier starts of an every-15-minutes schedule during the same outage. Time the schedule spent switched off or paused, and time before it was saved, is never counted as missed. + +## Use a cron expression + +Switch **Schedule format** to **Cron (advanced)** when you already have a cron expression or need a pattern that **Repeat** does not offer. A cron expression has five fields: minute, hour, day of month, month and day of week. + ```text */15 * * * * every fifteen minutes 0 9 * * 1-5 09:00 on weekdays @@ -54,15 +105,17 @@ Review the next occurrence shown for a valid expression: it is the minute the sc 30 8 1 * 1 08:30 on the 1st and on every Monday ``` -Fields support `*`, numbers, ranges, steps and comma-separated lists. Both 0 and 7 mean Sunday. If both day-of-month and weekday are restricted, either match is enough; the last example runs on Mondays as well as the first day of each month. +Fields support `*`, numbers, ranges, steps and comma-separated lists. Both 0 and 7 mean Sunday. If both day-of-month and weekday are restricted, either match is enough; the last example runs on Mondays as well as the first day of each month. When **Repeat** can say the same thing, the line under the field reads it back, such as “Reads as: Every weekday at 9:00 AM”. An expression that cannot be read, or one that names a date that never comes, such as `0 0 30 2 *`, shows why under the field; **Next runs** stays empty and **Save** waits until you correct it. + +A cron expression follows the same daylight-saving rules: one whose minute and hour are numbers names times of day, and one whose minute or hour starts with `*` keeps its real-time spacing. -Local time follows the timezone’s daylight-saving rules. A 09:00 Zurich schedule stays at 09:00 locally. Timing has one-minute resolution. Missed occurrences during an outage are not replayed; work resumes at the next occurrence. Impossible calendar dates are rejected when saving. +Switching between **Repeat** and **Cron (advanced)** converts the schedule when one says exactly what the other does. When it can’t, for example for a schedule at 9:00 and 17:30, the field says so, and both entries stay in the form until you save. A schedule saved earlier as a cron expression opens in **Repeat** when a repeat says exactly the same, with a note naming the stored expression. Saving it unchanged keeps the cron expression; saving a changed schedule stores it as a repeat. A cron expression that **Repeat** cannot express opens in **Cron (advanced)**. ## Receive a webhook -Choose **Webhook**, then save to generate the credential. Copy the full URL when it appears: the token is shown once and only its hash is stored. The section supplies an organization URL and a project URL pattern. Use the project URL for an active project in which the automation is installed; an automation with project bindings cannot run through the organization-only URL. +Choose **Webhook**, then save to create the URL. **Webhook URL — copy it now** shows it once: one URL for each project the automation is installed in, or one for the organization when it is installed in none. Copy each URL you need; the token at its end is stored only as a hash. After that, the section lists the addresses with the token hidden, under **Project URLs** or, for the organization, **Webhook endpoint**. **Rotate token** creates a new URL. An automation installed in projects runs only through a project URL. -Post a small payload to the URL. JSON becomes `payload` inside the input wrapper, not the workflow’s top-level input. Other request bodies pass through as text. The limit is 256 KiB; upload large documents separately. An accepted request returns a run ID without waiting for completion. +**Send a test request** holds a ready `curl` command. Right after the URL is created, the command contains it; later, it reads the URL from `TALE_WEBHOOK_URL`, the variable to keep it in on the sending system. It sends a small JSON body with an `Idempotency-Key`. JSON arrives as `payload` inside the input wrapper, not as the workflow’s top-level input; other request bodies arrive as text. The limit is 256 KiB; upload large documents separately. An accepted request returns a run ID without waiting for the run to finish. For example, a posted `{ "invoiceId": "inv-1" }` reaches the workflow as: @@ -73,19 +126,82 @@ For example, a posted `{ "invoiceId": "inv-1" }` reaches the workflow as: } ``` -Use a delivery ID, such as `Idempotency-Key` or the sender’s supported delivery header. Repeating that ID within 24 hours returns the original run. Without an ID, an identical body on the same URL within two minutes is treated as a duplicate. Send distinct IDs if identical payloads represent separate work. [Webhooks](/develop/webhooks) lists supported headers, project routes, errors and response formats. +Send a delivery ID, such as `Idempotency-Key` or the sender’s supported delivery header. Repeating that ID within 24 hours returns the original run. Without an ID, an identical body on the same URL within two minutes is treated as a duplicate. Send distinct IDs if identical payloads represent separate work. [Webhooks](/develop/webhooks) lists supported headers, project routes, errors and response formats. + +**Recent deliveries** lists the last ten runs the webhook started, newest first, with each run’s status and **View run**. While Tale still remembers a delivery, the row also says how it recognizes a repeat: **ID from** the header it read, or **No delivery ID**. A request Tale refused started no run and is not listed; the sender’s response says why. -The URL authorizes a run. Store it as a credential and share it only with the sending system. **Rotate token** generates a replacement and invalidates the old URL; removing or replacing the trigger also revokes it. Update the sender after a rotation. +The URL authorizes a run. Store it as a credential and share it only with the sending system. **Rotate token** asks for confirmation, then creates a replacement and invalidates the old URL; removing or replacing the trigger also revokes it. Update the sender after a rotation. ## React to a platform event -Choose **Platform event**, select **Event name**, then save and enable when ready. Match the workflow’s schema to the `trigger`, `event` and `payload` wrapper in the table. Events raised by automation runs do not fire triggers, preventing a workflow from repeatedly starting itself through its own changes. +Choose **Platform event**, then pick the event under **Event name**. The list groups the events by what they concern and shows each one’s name, ID and when it is raised; type part of any of them to search. Save, and turn on **Enabled** when ready. + +| Event | ID | Raised when | `payload` holds | +| --- | --- | --- | --- | +| **Task created** | `task.created` | A task is created on a board, through the API or by an import. | `taskId`, `projectId`, `actorType`, `actorId` | +| **Task status changed** | `task.status_changed` | A person moves a task to another status. An agent’s own moves don’t count. | `taskId`, `projectId`, `fromStatus`, `toStatus`, `actorType`, `actorId` | +| **Comment added** | `comment.created` | A comment is posted on a task. | `comment` with its `body`, `taskId`, `projectId` and `mentions` | +| **Mentioned in a comment** | `comment.mentioned` | A task comment mentions someone with @. | `comment`, `taskId`, `mentions`, `actorType`, `actorId` | +| **Conversation started** | `conversation.created` | A conversation opens in Inbox: an email arrives, or an external conversation is mirrored in. | `conversationId`, `channel` | +| **Message received** | `conversation.message_received` | A message lands on an existing conversation. | `conversationId`, `messageId`, `direction` | +| **Contact created** | `contact.created` | A contact is added through the API, the app or an import. | `contactId` | +| **Contact updated** | `contact.updated` | A contact’s details change. | `contactId` | +| **Contact deleted** | `contact.deleted` | A contact is deleted. | `contactId` | +| **Project created** | `project.created` | A project is created. | `projectId`, `name`, `actorId` | -A workflow expecting required top-level fields such as `owner` and `repo` cannot accept schedule metadata or a wrapped webhook unchanged. Adapt its input schema and references, or use an API-started run that supplies those fields. The trigger settings do not provide arbitrary saved input fields. +The payload carries IDs, not whole records: read the task, comment or contact with a step when the workflow needs more. A new task, for example, reaches the workflow as: + +```json +{ + "trigger": "event", + "event": "task.created", + "payload": { + "taskId": "5e2f9d34-8a71-4c6b-b0d2-91a7e3c4f815", + "projectId": "0b9c6a52-5d1e-4f0a-9c3e-2f6d8a1b7e40", + "actorType": "user", + "actorId": "c41d7e88-2b3a-4f95-8e60-7d5a9b1c0f23" + } +} +``` + +Task, comment and project events belong to a project; contact and conversation events don’t. An event of a project starts the automations installed in that project and those installed in none, and their runs belong to that project. An automation installed only in other projects doesn’t react to it. An event without a project starts an automation installed in exactly one project in that project. When that project is archived, or the automation’s inputs refuse the event, no run starts and the trigger shows why. The other automations listening for the event still start. Under **Event name**, the field says which events start this automation. + +An event that an automation’s run raises never starts that same automation, and a run that an event started doesn’t start other automations, so a workflow cannot keep starting itself, or another one, through its own changes. This covers what the run itself does: its steps, its connector calls and its own agent’s tools. Work a step hands to a project agent belongs to that agent, so an event the agent raises can start the automation again: make sure such work doesn’t raise the event the automation listens for. + +## Check what a run receives + +**This run receives** shows the input the next run gets, exactly as the trigger builds it: the trigger’s own fields, its fixed input and, for a webhook or an event, a sample `payload`. For a schedule, `firedAt` is the due time in milliseconds since 1970 (UTC). Use **Copy the input** to paste it into a test run. + +Below it, the section compares the input with the deployed version’s inputs. It says **Version 3 accepts this input**, for example, or warns **Version 3 doesn’t accept this input** with a way to fix it: add the missing fields to the fixed input, or change the inputs in the editor. A webhook’s body is unknown until a request arrives, so it never counts against the version. Saving a trigger, and deploying a version, run the same check; the save goes through and names the problem. + +### Fixed input + +A fixed input adds the same values to every run the trigger starts, such as the `owner` and `repo` a scheduled GitHub triage needs. Open **Add fixed input** and enter a JSON object of up to 16 KiB. The trigger’s own fields (`trigger`, `firedAt`, `event` and `payload`) are set over it, so it cannot contain them. It is plain data: a template such as `{{ input.owner }}` arrives as text, and the save warns about it. + +When the deployed version requires fields the trigger doesn’t send, the section is already open, and **Add the 2 missing fields** (or as many as are missing) writes a placeholder of the right type for each one and puts the cursor in the first. Replace the placeholders and save. A scheduled run then receives: + +```json +{ + "owner": "acme", + "repo": "website", + "trigger": "schedule", + "firedAt": 1791529200000 +} +``` + +### Run now + +**Run now** starts the deployed version once, for real, with the input the saved trigger sends, as the trigger would. For a schedule, it shows that input and asks you to confirm with **Start run**. For a webhook or an event, it opens the run dialog with the sample to edit. It waits for a deployed version and for your trigger changes to be saved. The result appears under the button: **Run started.** with **View run**, or the reason no run started. The schedule, and the trigger’s own last run, don’t change. + +## Turn on the trigger after deploy + +A new trigger starts switched off, and so does the trigger of a shipped package. When you deploy a version, in the editor or by uploading a package, and its trigger is off, a notice says **Its trigger is off**. **Turn on the trigger** switches on the saved trigger exactly as it is, and the notice then reads **The trigger is on.** + +When the deployed version would refuse what the trigger sends, or a webhook has no URL yet, the notice offers **Review the trigger** instead. It opens the **Trigger** section on the **General** tab, where you can add the fixed input or create the URL first. The shipped GitHub packages are an example: their schedules need a repository, as [Built-in automations](/platform/automations/builtin) explains. ## Start a project agent on a schedule @@ -101,15 +217,15 @@ nodes: feedback: 'Scheduled occurrence {{ input.firedAt }}.' ``` -The step answers the run it started, and the task's timeline lists that run as **automation** with a link to the automation run. When it starts nothing, the step still succeeds and says why, so the occurrence is recorded rather than queued: +The step answers the run it started, and the task's timeline lists that run as **automation** with a link to the automation run. An agent that is working other tasks is started all the same: its run works in a [worker](/platform/projects/project-agents#run-one-agent-on-several-tasks) of its own, and when every agent worker of your organization is busy it waits for one and starts on its own. When the step starts nothing, it still succeeds and says why, so the occurrence is recorded rather than queued: | Answer | Meaning | | --- | --- | -| `started: true` | The agent's run started; `runId` names it. | +| `started: true` | The agent's run started; `runId` names it. With `waitingReason`, the run waits for room before it works: `org_limit` when every agent worker of your organization is busy, `host` when the sandbox host is full, `destroy_pending` when the workspace it would use is being deleted, `exec_limit` when its sandbox is still ending an earlier process. It starts on its own once room frees. | | `already_running` | The task's previous run is still working and carries the work. Nothing new starts, and the occurrence does not wait behind it. | | `in_review` | With `moveToInProgress: false`, the card waits for its captured reviewer, a person or an agent. Nothing is assigned or started, and the review keeps that recipient. | | `closed` | With `moveToInProgress: false`, the card is **Done** or **Cancelled** (`taskStatus`). Nothing is assigned or started. | -| `agent_busy` | The agent is working another task (`busyTaskId`). An agent works one task at a time in its workspace. | +| `agent_busy` | No longer answered: an agent working another task is started in a worker of its own, or waits for one. Older runs of an automation may still show it. | | `blocked` | A task this one depends on is still open (`blockedBy`). | | `paused` | The task took three starts by automations and agents within the last hour, ordinary automatic retries included. One broker cooldown immediately after the same agent’s HTTP 429 adds no start; consecutive cooldowns still count. `retryAfter` says when the hourly count permits another start; other admission checks still apply. | @@ -119,6 +235,10 @@ A run a schedule starts answers to no person. It works with the agent's configur A retryable failure can be retried automatically while the task keeps its original status and assignee, with no later status, assignment, archive or review decision. Changing a value and then changing it back still ends that retry; comments do not. The attempt limits, schedule permissions and workspace checks still apply. A later scheduled occurrence can start fresh work when eligible. +### Wake the schedule when an agent frees its slot + +A schedule that runs a project's standing role, such as a manager that hands out work, can also fire as soon as an agent of its project finishes and one of its standing workers is free, instead of waiting for its next cron minute. Turn this on with `wakeOnSlotFreed: true` in the schedule's managed configuration, applied with the Tale CLI; only one enabled schedule per project can have it — a second one is refused, and so is installing its automation in a project another schedule already wakes — and the app has no switch for it. Each wake is one ordinary occurrence with the usual input `{ trigger: "schedule", firedAt }`, so the answers above still apply. Agents that finish while a wake is pending add up to one wake. A wake waits while the manager's own card has a live run or an armed retry, the card would refuse the start or is no longer assigned to the agent, until `retryAfter` when the task took three starts within the hour, and, after an occurrence that did not serve, for one minute, doubling up to an hour, with no limit on attempts. Other tasks of the same agent do not hold the wake; the manager's new run takes its own worker or waits for capacity as usual. It counts as served only once the agent's run it started has launched and settled. While the schedule is paused after failures, switched off or no longer opted in, the wake waits and fires once the schedule is saved again. + ### Import every issue on a schedule An issue import reads at most one batch per run, up to 500 issues, and answers where the next batch starts. A person continues it with **Continue import**; a schedule keeps the position between its occurrences instead, so each occurrence imports one batch from where the last one stopped until every open issue has been read, and the occurrence after that starts the next pass. Read the position with `task.get_import_cursor`, pass it to the importer, and save the importer's `nextCursor` with `task.save_import_cursor`: @@ -154,18 +274,26 @@ nodes: ## Diagnose a missing start -First check **Enabled**, the deployed version and the last-fired information. Then inspect any recorded skip reason: +The top of the **Trigger** section says how the trigger is doing: the time of the last run it started, with that run’s status and **View run**, or **Hasn’t started a run yet.** When the trigger last came due, or an event last arrived, and nothing started, a notice below it says why, with the fix and a way to get there: -| Reason or symptom | What to check | -| --- | --- | -| `not_deployed` | Deploy a tested version. A saved draft is insufficient. | -| `start_refused` | Compare the deployed input schema with the trigger’s actual wrapper and resolve the reported validation or start error. | -| `unusable_cron` | Correct the expression or timezone and save it again. Other schedules continue while this one is skipped. | -| `paused_after_failures` | The schedule turned itself off after repeated failures. See [When a schedule pauses itself](#when-a-schedule-pauses-itself). | -| Webhook credential refused | Check the current URL and enabled state. Unknown and disabled tokens intentionally receive the same refusal. | -| Run exists but did not finish | Open [execution logs](/platform/automations/execution-logs); the start succeeded and the issue is inside the run. | - -The last-fired timestamp advances when a run actually starts. A due trigger that cannot start work records a skip instead. This separates a broken schedule from a workflow that started and later failed. +| Notice | What happened | What to do | +| --- | --- | --- | +| **Skipped: no version is deployed** | The trigger came due, but only drafts exist. | **Open the editor** and deploy a tested version. | +| **Skipped: the run’s input was refused** | The deployed version refused what the trigger sends. | Add the missing fields to the [fixed input](#fixed-input), or change the inputs in the editor. | +| **Skipped: its project can’t start runs** | Its project is archived, missing, or no longer allows the automation. | **Edit the projects** under **Projects** below. | +| **Skipped: the run couldn’t start** | The start was refused for another reason. | Open **Technical details** to read the code and the message. | +| **Skipped: the schedule can’t be read** | The schedule or its time zone could not be read. Nothing starts until it is corrected. | **Edit the schedule** and save. | +| **3 runs were missed**, for example | Runs came due while Tale was unavailable. | Nothing; [Missed runs](#when-runs-are-missed) decided what started. | +| **Paused after repeated failures** | The schedule turned itself off. | See [When a schedule pauses itself](#when-a-schedule-pauses-itself). | + +**Technical details**, closed at first, holds the raw facts in English: the code, the version that refused the start, its message and each problem with its field. When earlier runs were missed too, the notice says how many. The API reads the same facts as `lastSkipReason` and `lastSkipDetail`; see the [API reference](/develop/api-reference#check-trigger-health-and-pause-safely). + +Some missing starts show no notice: + +- A webhook request Tale refused started no run and moved nothing on the trigger. Check the sender’s response; [Webhooks](/develop/webhooks) lists the answers. An unknown or switched-off URL gets the same refusal on purpose. +- A run that exists but did not finish started fine. Open it from **Runs**; [execution logs](/platform/automations/execution-logs) explain what happened inside it. + +The last run moves only when a run actually starts. A trigger that comes due and cannot start one records the skip instead, which separates a broken trigger from a workflow that started and later failed. ## When a schedule pauses itself diff --git a/docs/en/platform/chat/basics.md b/docs/en/platform/chat/basics.md index 4cb631c79d..1dd90917d1 100644 --- a/docs/en/platform/chat/basics.md +++ b/docs/en/platform/chat/basics.md @@ -80,7 +80,7 @@ The task dialog opens with your last request as the description, a link back to -The task then shows above the chat's message box with what it's doing: **The agent is working**, **Waiting for a sandbox slot**, **Trying again…**, **Ready for review** with the number of files it delivered, or **The agent couldn't finish**. **Open** takes you to the task. You're also notified when it's ready for review and when the agent can't finish; [When the agent can't finish](/platform/projects/task-automation#when-the-agent-cant-finish) explains what to do next. +The task then shows above the chat's message box with what it's doing: **The agent is working**, **Waiting for a worker** (or another state that says what the run waits for), **Trying again…**, **Ready for review** with the number of files it delivered, or **The agent couldn't finish**. **Open** takes you to the task. You're also notified when it's ready for review and when the agent can't finish; [When the agent can't finish](/platform/projects/task-automation#when-the-agent-cant-finish) explains what to do next. @@ -98,6 +98,8 @@ Files come along only from your own conversation. A task takes only its creator' Use the reply toolbar to copy an answer, give feedback, inspect its details, or fork a conversation at that point. A fork lets you try another direction while preserving the earlier exchange. +Your own messages sit on the right. A long one shows its beginning, with **Read more** to open the rest in place and **Show less** to fold it again. Point at one of your messages, or move the keyboard focus into it, to see when you sent it and to use **Edit message**, which changes the text in a new version of the conversation; on a touch screen, both are always shown. Under a message you edited, or one whose reply you asked for again with **Try again**, **Previous branch** and **Next branch** switch between the versions, and the number between them, such as 2/3, says which one is on screen. + Find earlier chats in [Home](/platform#home); **Chats** above the list hides your tasks and inbox conversations. Pin frequently used chats, give a chat a recognizable title, or move it into a project when the topic becomes ongoing work: drag it onto the project or choose **Move to project…** in its menu. [Shared chats](/platform/chat/shared-threads) explains how to publish a read-only snapshot for colleagues. Very long conversations may exceed the model’s context window. Tale displays a notice when older messages are omitted. Restate an important requirement or start a new chat with the relevant sources instead of assuming the assistant still sees the entire history. diff --git a/docs/en/platform/knowledge/crawling.md b/docs/en/platform/knowledge/crawling.md index ef453b421c..789f971cb8 100644 --- a/docs/en/platform/knowledge/crawling.md +++ b/docs/en/platform/knowledge/crawling.md @@ -94,6 +94,7 @@ First check the address, source type, and latest scan time. Then open the source | Rendering or document extraction failed | Check that the public page loads and the original document opens. Repair or re-export the source if it is damaged. | | The assistant says web-page search is not set up | The organization has no working embedding model. An administrator sets one under **Settings > Data residency**; Tale then scans the affected sources again. | | **Error** with "The embedding model couldn't process the pages." | The embedding provider refused or failed the request: a rejected credential, an exhausted balance, a rate limit that held through every retry, or an outage. The source's details say which, with the provider's own reply beneath. An administrator repairs the model under **Settings > Data residency** or its credential under **Settings > AI providers**; saving either one scans the affected sources again. After an outage on the provider's side, choose **Scan now** once it is back. | +| The source's details say a usage limit stopped the last scan | Embedding pages counts against the limits of whoever asked for the scan: the member who added the source or chose **Scan now**, or the organization for a scheduled scan. The pages are stored, and the source's own search reads them; search by meaning skips the pages stored after the limit was reached until the scan resumes by itself, within the hour after the limit resets or an administrator raises it. | | **Error** with "Scanning didn't run." | The crawler's browser could not start, so no page was rendered; its report is under **Technical details** in the source's details. The address is not the cause: ask your operator to check the sandbox service, then choose **Scan now**. | A successful later fetch clears the previous error. A failed refresh can leave an earlier indexed copy available: **Active** and an indexed count do not prove every page is up to date. Compare the stored chunks and last-crawled information with the original before relying on a recent change. diff --git a/docs/en/platform/knowledge/documents.md b/docs/en/platform/knowledge/documents.md index a3a74a8f71..54fc9679a2 100644 --- a/docs/en/platform/knowledge/documents.md +++ b/docs/en/platform/knowledge/documents.md @@ -42,6 +42,7 @@ Unsupported formats are not made searchable by repeatedly reindexing. For a ques | **Indexing** | Text is being prepared for search. Wait before testing the source. | | **Indexed** | Indexing completed. Test a specific question and open its citation. | | **Needs reindex** | The index is stale. Use **Retry indexing** beside the status. | +| **Waiting for a usage limit** | A usage limit that applies to whoever the document is indexed for has been reached. Indexing resumes by itself within the hour after the limit resets or is raised; nothing to fix in the file. | | **Failed** | Inspect the error, resolve its cause, then retry. | | **Not supported** | These file contents cannot be indexed: the format may be unsupported, the text empty or unreadable, or the PDF damaged. Open the badge for the cause. | | **Not indexed** | No completed index is available. Check the file and start indexing where offered. | @@ -62,6 +63,7 @@ Click **Failed** or **Not supported** to read the explanation. The next action d | Embedding model missing or provider account refused | An administrator must configure the model under **Settings > Data residency**, or repair the provider key, model access, plan, or balance. Then retry. | | Embedding credential missing or unusable | The credential the embedding model uses was deleted or disabled, its provider has no default credential left (**Settings > Data residency** shows **Credential missing**), or its secret cannot be read: it was stored under an earlier encryption key, or it names an environment variable the server does not set. An administrator adds or repairs the credential under **Settings > AI providers**, or chooses another one for the embedding model. Either save puts the affected documents back in the queue. After a fix on the server itself, such as setting the environment variable, use **Retry indexing**. | | Temporary provider or indexing-service failure | Background jobs retry transient failures. If the error persists, give an administrator the document name and error; after repair, use **Retry indexing**. | +| A usage limit was reached | Indexing turns text into vectors through the embedding model, which counts against the limits of whoever the document is indexed for: the person who uploaded it, the owner of a synced drive, or the organization for an emailed attachment. The document shows **Waiting for a usage limit** and resumes by itself within the hour after the limit resets or an administrator raises it under **Settings > Governance > Policies & Limits**. | | Search index rebuilding or repair failed | Rebuilding can recover automatically. A failed repair needs the operator to repair or restore the knowledge database before retrying. | **Not supported** has no retry action: another attempt with the same bytes cannot fix the cause. Failed files can also require a source or configuration change before a retry helps. Applications can distinguish these cases using `indexing.errorCode`; the [API reference](/develop/api-reference) lists the stable codes. diff --git a/docs/en/platform/knowledge/knowledge-entries.md b/docs/en/platform/knowledge/knowledge-entries.md index 8e62e2d016..d5203c0596 100644 --- a/docs/en/platform/knowledge/knowledge-entries.md +++ b/docs/en/platform/knowledge/knowledge-entries.md @@ -39,7 +39,7 @@ Avoid relative dates such as “next Friday” or references such as “the poli -Click **Save**. The entry appears in the table with its topic, content, source (**Manual** for the form, **Chat** for a fact the assistant captured, **API** for one an integration wrote over REST), indexing status, and update time. Open it to read the full content. Indexing happens in the background; saving the row does not mean search is already using it. +Click **Save**. The entry appears in the table with its topic, content, source (**Manual** for the form, **Chat** for a fact the assistant captured, **API** for one an integration wrote over REST, **Agent** for one an agent saved), indexing status, and update time. Open it to read the full content. Indexing happens in the background; saving the row does not mean search is already using it. @@ -63,6 +63,16 @@ When a chat uncovers a useful fact, verify it against the source, then add or ed +## Let an agent keep facts current + +A project agent or an automation's agent step can save facts too. Give it **Add and edit knowledge entries** under **Skills, connectors & tools** in the [agent's equipment](/platform/projects/project-agents). The agent saves one fact per topic; a topic without an entry gets a new one, with **Agent** as its source. + +To change an existing entry, the agent must name the version it read. If a person or another agent changed the entry in the meantime, nothing is saved: the agent receives the current text and merges its change into it. **Version history** keeps every earlier text, as it does for your own edits. + +Entries belong to the whole organization, so a run a Member started can't save any, and no agent can delete an entry. Agents have their own limit on how many entries they save per minute, so a busy agent never holds up people editing entries. Every save by an agent is recorded in the audit log. + +Agents always search the knowledge base, with no grant needed: the equipment menu lists this as **Search the knowledge base**, always on. + ## Remove an obsolete entry Use **Delete** in its row menu and read the confirmation. Deletion removes the entry and its version chain from this view and makes its backing document unavailable to knowledge retrieval. Keep a copy before deleting if you still need the text; use **Edit** for a correction instead. diff --git a/docs/en/platform/knowledge/overview.md b/docs/en/platform/knowledge/overview.md index ba1d731901..efa803ee1d 100644 --- a/docs/en/platform/knowledge/overview.md +++ b/docs/en/platform/knowledge/overview.md @@ -42,7 +42,7 @@ Test a new source with a question whose answer you already know: “What are our ## Understand access and search -Organization chat can search the shared library within your permissions. Project chat can also search that project's files and uses its saved instructions; it does not search another project's files. Project agents need the corresponding platform tools in their equipment. +Organization chat can search the shared library within your permissions. Project chat can also search that project's files and uses its saved instructions; it does not search another project's files. Project agents and automation agent steps always search this knowledge in their project's scope, with no grant needed; reading or changing [knowledge entries](/platform/knowledge/knowledge-entries) directly needs the matching tool in their equipment. Team restrictions continue to apply during retrieval. A file you can see in one workspace may therefore be absent from a different project's context. Use [project files](/platform/projects/manage-files) for project-specific material and document team access for shared library files. diff --git a/docs/en/platform/member/preferences.md b/docs/en/platform/member/preferences.md index a9e4370ed4..a57ade6618 100644 --- a/docs/en/platform/member/preferences.md +++ b/docs/en/platform/member/preferences.md @@ -57,7 +57,7 @@ Your instructions never override the organization’s mandatory instructions or ## Check your usage limits {#usage-limits} -Open **Settings > Usage** to see how much you have used of each limit your organization applies to you. The page says so when no limit covers you. A project's limit, which caps everything spent in that project, is not listed here; a request it refuses says so. +Open **Settings > Usage** to see how much you have used of each limit your organization applies to you. The page says so when no limit covers you. A project's limit, which caps everything spent in that project, is not listed here: in the project's chats, the banner above the composer warns about it, and a request it refuses says so. @@ -69,7 +69,7 @@ Open **Settings > Usage** to see how much you have used of each limit your organ - **Shared limits** count the usage of everyone they cover, such as a team you belong to or the entire organization, so they can be reached before your own limits. - **Storage** compares the files you have uploaded with your storage limit. New document uploads are refused once it is reached. -Each usage limit shows the amount used, the limit, and when it resets in your local time. Periods follow UTC: daily limits reset at midnight, weekly limits on Monday, and monthly limits on the first of the month. If an administrator set a warning threshold, the bar turns amber once your usage reaches it. When a banner above the composer warns about a limit, **View usage** opens this page. Administrators also see **Manage limits**, which opens **Governance > Policies & Limits**. +Each usage limit shows the amount used, the limit, and when it resets in your local time. Periods follow UTC: daily limits reset at midnight, weekly limits on Monday, and monthly limits on the first of the month. If an administrator set a warning threshold, the bar turns amber once your usage reaches it. When a banner above the composer warns about a limit, **View usage** opens this page; a banner about a project's limit names the project instead. Administrators also see **Manage limits**, which opens **Governance > Policies & Limits**. ## Archive old chats or sign out diff --git a/docs/en/platform/projects/project-agents.md b/docs/en/platform/projects/project-agents.md index 6ec3ab8bfc..9bc19bf24e 100644 --- a/docs/en/platform/projects/project-agents.md +++ b/docs/en/platform/projects/project-agents.md @@ -1,9 +1,9 @@ --- title: Create and manage project agents -description: Configure a reusable worker, grant its equipment and start a task whose result you can review. +description: Configure an agent for a project's tasks, grant its equipment and start a task whose result you can review. --- -Create a project agent when you want a reusable worker for that project’s tasks. It combines a coding runtime, a model, instructions and allowed equipment. You need project edit access; the project must be active. Members see the project's agents on its **Agents** tab, which tells them to ask an Editor or Admin for a new one. Until a project has agents of its own, its tasks can go to the organization's [standard agent](#standard-agent). Only Owners and Admins can change secret grants. +Create a project agent when you want a reusable configuration for that project’s tasks. It combines a coding runtime, a model, instructions and allowed equipment. Each task it works on runs in a [worker](#run-one-agent-on-several-tasks), a running copy of the agent in a sandbox of its own. You need project edit access; the project must be active. Members see the project's agents on its **Agents** tab, which tells them to ask an Editor or Admin for a new one. Until a project has agents of its own, its tasks can go to the organization's [standard agent](#standard-agent). Only Owners and Admins can change secret grants. ## Prepare the first task @@ -25,6 +25,8 @@ Separate reusable instructions from the task. “Identify missing evidence and r Open the project’s **Agents** tab and select **New agent**. Give it a recognizable **Name**, then choose **Agent runtime**, the [program that runs its session](/platform/agents/harnesses). Names are unique within the project; a project supports up to 50 agents. +Tale makes a mention handle from the name, which people type after `@` to find the agent: “My Opus Agent #3” becomes `@my-opus-agent-3`. If the handle is taken, by another agent of the project or by a member or an automation people already mention with it, the agent gets the next free one: `-02`, then `-03`. If a member or an automation comes to answer to the agent's handle later, the agent moves on to the next free one too. The handle appears on the **Agents** tab and under **Name** when you edit the agent. Renaming the agent changes its handle; mentions written earlier keep naming the agent and show its new name. + You can also start from a task: while the project has no agent, **Create an agent…** under **Assignee** opens **New agent** over the task and assigns the agent you create to it. @@ -47,13 +49,17 @@ Under **Skills, connectors & tools**, add the bundles, services and platform ope +The menu's search field narrows skills, connectors and tools as you type. **Search the knowledge base** is listed under **Knowledge** as always on: every agent searches the project's knowledge with no grant needed. + Read the **Writes data** label before granting a platform write tool: it authorizes real operations within that tool’s access rules. Connector broker actions available to agents are read-only; direct GitHub tooling or explicit secrets use separate access paths. **Change task priority and agent assignment** lets a project agent prioritize existing tasks, assign them to an agent of the same project or leave them unassigned, without starting work. It is off until you grant it and is unavailable to automation agent nodes. The agent must read each task first and submit the current values with its changes; if someone changed those values meanwhile, the whole request is refused and the agent must read again. Ownership changes require an open task with no live run, pending review, or open question. A priority change alone preserves those handoffs. The tool never changes the status or reviewer, answers a human question, or starts a run. Only a live run with project-wide authority can use it; a run a Member started cannot. **Review other agents’ task results** lets a designated reviewer decide a completed result from a different project agent. It is off until you grant it and is unavailable to automation agent nodes. Selecting an agent as reviewer does not enable this tool or start a run. The reviewer works from its own task, with current project-wide authority and the review permission still enabled. A decision records feedback and evidence; approval completes the reviewed task, while a request for changes returns it to **To do** without starting more work. Required human competences and workflow approvals remain protected. [Set up an independent reviewer](/platform/projects/task-automation#agent-review) explains the full flow. -**Start other agents on tasks** lets the agent put another agent of this project to work, for example a manager agent that hands out ready work and resumes an agent whose question it answered. It names a task, optionally the agent to assign it to, and a message the started run addresses first. The started run answers to whoever the manager's run answers to and names the manager as the agent that started it. An agent started this way cannot start further agents, a run a Member started cannot start any, and an agent already working another task, or a task an open task blocks, is not started. Grant this tool only to an agent whose instructions say which work it may hand out; [Task automation](/platform/projects/task-automation#work-an-automation-or-another-agent-starts) describes what such a run may do. +**Start other agents on tasks** lets the agent put another agent of this project to work, for example a manager agent that hands out ready work and resumes an agent whose question it answered. It names a task, optionally the agent to assign it to, and a message the started run addresses first. The started run answers to whoever the manager's run answers to and names the manager as the agent that started it. An agent started this way cannot start further agents, a run a Member started cannot start any, a manager cannot start itself on another task, and a task an open task blocks is not started. An agent already working other tasks is started all the same: its run takes a [worker](#run-one-agent-on-several-tasks) of its own, or waits for one, and the answer says why it waits. Grant this tool only to an agent whose instructions say which work it may hand out; [Task automation](/platform/projects/task-automation#work-an-automation-or-another-agent-starts) describes what such a run may do. + +**Add and edit knowledge entries** lets the agent save facts as [knowledge entries](/platform/knowledge/knowledge-entries#let-an-agent-keep-facts-current) of the whole organization, one per topic. To change an entry, it must name the version it read; if the entry changed since, nothing is saved and the agent merges its change into the current text. It cannot delete entries, and a run a Member started cannot save any. Grant it to an agent whose instructions say which facts are worth keeping. A run’s connector calls act for the member who started it, whether with **Start agent**, **Retry**, a move to **In progress** or an @mention of the agent. They use the organization’s [connector credentials](/platform/admin/connectors) and are recorded under that member. If that member leaves the organization or is disabled, the calls are refused: use **Cancel run** (or let the run finish), then start it again so it acts for you. When a comment restarts the run to guide it, as every runtime except Claude Code does, the calls act for the comment's author from then on. @@ -81,6 +87,14 @@ The agent's report appears in task comments and collected files appear as delive [Task automation](/platform/projects/task-automation) explains progress, stopping and review. The ordinary Chat assistant remains separate, even when a chat has project context. +## Run one agent on several tasks + +An agent is a configuration; a worker is one running copy of it. Each task the agent works on at the same time runs in a worker of its own: a sandbox with its own workspace, memory and processes, so two tasks never share files or slow each other down. Start the agent Scribe on “Release notes” and on “Changelog”, and both work at once, one per worker. + +Workers count against your organization’s **Agent workers** limit in [Sandboxes](/platform/admin/sandboxes#identify-the-limit-that-matters), which every agent of the organization shares. When all of them are busy, a new run waits instead of failing, and the task says why under **Run**: **Waiting for a worker**. It starts on its own as soon as a worker is free, without using an automatic retry, and gets its full working time from then on. Owners and Admins see a link there to raise the limit. When several runs wait, a freed worker goes first to the agent with the fewest runs working, then to the run that has waited longest. To take a waiting run back, use **Cancel run**, or assign the task to someone else: a run that has not started yet is cancelled with the reassignment. + +A task’s next run goes back to the worker it last worked in when that worker is free, so the agent continues the conversation and finds its files there. If that worker is busy, the run takes another one and starts fresh from the task’s description, discussion, attachments and deliverables. After a run fails or is cancelled, its worker stays reserved for that task for 15 minutes, so a retry finds what the run left; another task’s run takes it only when no other worker is free. + ## The standard agent {#standard-agent} A project without agents of its own can still take on agent work. Unless an admin has turned it off under [Governance > Models](/platform/admin/governance/content-models#standard-agent), **Assignee** offers **Standard agent** there, to everyone who can assign the task, Members included. The first time someone chooses it, Tale sets the agent up in the project and assigns it the task. You then start it like any other agent, or mention it in a comment. When it can't start for you, the comment box says so, and your comment is saved as a plain mention. @@ -97,6 +111,6 @@ To give the project an agent of its own, select **New agent**. From then on, the ## Update or remove an agent -Use the agent’s row actions to edit or delete it. The standard agent has only **Delete agent**. Changes apply to later runs; an active run keeps its starting configuration. Deleting the agent clears task assignment references while preserving task history. It also deletes the agent's [sandbox workspaces](/platform/admin/sandboxes#explain-why-a-workspace-disappeared) and their files, including each Member's. Review current work and preserve outputs you still need before removing the worker it belongs to. +Use the agent’s row actions to edit or delete it. The standard agent has only **Delete agent**. Changes apply to later runs; an active run keeps its starting configuration. Deleting the agent clears task assignment references while preserving task history. It also deletes the [workspaces of all its workers](/platform/admin/sandboxes#explain-why-a-workspace-disappeared) and their files, including each Member's. Review current work and preserve outputs you still need before removing the agent. If creation fails, use the displayed reason to distinguish a duplicate name, missing project access, an unavailable provider/model or a skill visibility issue. A run that fails for good says at the top of its task what went wrong and who can fix it; [When the agent can't finish](/platform/projects/task-automation#when-the-agent-cant-finish) lists the cases. Changing instructions does not fix those dependencies. diff --git a/docs/en/platform/projects/task-automation.md b/docs/en/platform/projects/task-automation.md index 8955b8dad5..11b5e0a2e7 100644 --- a/docs/en/platform/projects/task-automation.md +++ b/docs/en/platform/projects/task-automation.md @@ -53,7 +53,7 @@ For one recorded request for changes, the manager calls `task_start_agent` with The repair starts only while the task is still **To do**, assigned to that same agent, with the same latest completed implementation and no newer review or intervening status, assignment or archive decision. Changing a value and then changing it back still invalidates the old intent. A `stale_repair` answer changes nothing: the manager reads the current task and retires the outdated intent. It never retries without the tagged guard. The repair uses the ordinary lifecycle and submits a new review when it finishes; `moveToInProgress: false` is refused. -If the response is lost, the same manager agent can repeat the guarded call from a currently authorized live run, including a later occurrence. `replayed: true` returns the original `runId` and `repairReceipt`, preserving the first issuing run and creating no further work. It reports a previous admission, not that the run is still active. Current delegation permission and project authority are checked again on every call. The existing single-live-run, busy-agent and three-automated-starts-per-task-per-hour limits still apply to new admissions. Repeated unchanged failures need a separate investigation task rather than an unbounded retry instruction. +If the response is lost, the same manager agent can repeat the guarded call from a currently authorized live run, including a later occurrence. `replayed: true` returns the original `runId` and `repairReceipt`, preserving the first issuing run and creating no further work. It reports a previous admission, not that the run is still active. Current delegation permission and project authority are checked again on every call. The existing single-live-run and three-automated-starts-per-task-per-hour limits still apply to new admissions. Repeated unchanged failures need a separate investigation task rather than an unbounded retry instruction. To reconcile a lost verdict response across reviewer occurrences, read `task_get.reviewDecision`. It contains the latest validated native decision receipt, or `null` behind a newer pending, human or workflow review or when the receipt is unavailable. Compare its approval and run IDs with the recorded intent, and read the task’s current state separately. A historical receipt does not describe the current column, and `null` does not prove that a verdict failed to commit. An immediate identical `task_review` replay still requires the same live issuer. @@ -122,18 +122,20 @@ Answering an automation's question and deciding a workflow approval stay with pe | State or symptom | What to do | | --- | --- | -| Waiting for a sandbox slot | Available capacity may be exhausted for the organization or shared infrastructure, or the agent's workspace may already be running four of its runs at once; the run then starts as soon as one of them ends. Waiting uses up no automatic retry. Wait for a slot, or ask an admin to inspect [Sandboxes](/platform/admin/sandboxes). | +| **Waiting for a worker**, **Waiting for room**, **Waiting for a workspace**, **Waiting for its sandbox** | The run waits for room and says why under **Run**: every [agent worker](/platform/projects/project-agents#run-one-agent-on-several-tasks) of your organization is busy, the deployment is full or short of memory or disk, an administrator is deleting the workspace the run would use, or its sandbox is still finishing an earlier process. It starts on its own once room frees, and waiting uses up no automatic retry. When the agent workers are all busy, Owners and Admins can raise the limit in [Sandboxes](/platform/admin/sandboxes#identify-the-limit-that-matters). **Cancel run** takes back a run that waits. | | Automatic retry is shown | Tale is retrying a recoverable failure. Read the attempt count and avoid starting another run. | | **The agent couldn't finish this task** | No automatic retry follows. The notice says what went wrong and who can fix it, and **Details** beside the run shows what the run itself reported; [When the agent can't finish](#when-the-agent-cant-finish) lists the cases. Resolve the cause, then use **Retry** to continue the conversation. | -| Reassignment is refused | Cancel the live run before choosing another assignee. | +| Reassignment is refused | Cancel the live run before choosing another assignee. A run that is still waiting for room never blocks a reassignment: it is cancelled with it. | | Agents or automations keep restarting one task | A task takes at most three starts of its agent by automations and other agents in any hour, ordinary automatic retries included; the cooldown exception below applies. The next start is refused, a retry past the limit is not started, and the timeline says **Run refused: agent runs are paused on this task**. Starts by people, and their retries, are never counted. Automation runs have no such cap: between two automations that keep mentioning each other, the one-engine rule is what stops a loop. Cancel the live run, then read the timeline before letting either start again. | -| **Run refused: agent is working on another task** | An automatic retry waited two hours for its agent, which is still working on another task. Nothing waits behind the refusal: start the task again once the agent is free, or leave it to the manager agent or automation that hands out the work. | +| **Run refused: agent is working on another task** | Appears only on runs from before agents had workers of their own: an automatic retry waited two hours for its agent, then gave up. Start the task again; its run now takes a worker of its own. | | The task cannot close | Finish its open subtasks first. | Recoverable failures get up to three automatic retries, which start right away except in the cases below. A run that makes sustained progress for at least fifteen minutes receives a fresh retry allowance. This helps long work recover from interruptions; it does not prove the resulting work is correct. If Codex ends a run because the selected model is at capacity, Tale schedules its automatic retry one minute later. The failed attempt still counts toward the normal retry limit and, for automated starts, the hourly limit. Tale keeps the previous account eligible and does not switch models or pause other agents. The wait does not guarantee that the model will be available. After the retry limit or hourly limit refuses further work, the task can remain **In progress** with a failed run; that column alone does not mean an agent is still working. +When an agent stops responding — it prints nothing and does almost no work for 45 minutes by default — its sandbox stops it, and the run fails without an automatic retry: a retry would most likely stop the same way. The notice says the agent stopped responding, and **Details** shows what it printed last. + An automatic retry continues the work of the person who started the run, so it starts only where that person could start the run now: the project must still be active, and they must still be allowed to change the task. If an admin archives the project, or that person leaves the organization or loses the right to change the task, no further retry starts and the run stays failed. The same applies to a mention that reaches the agent only after its run has ended. Once the project is restored, anyone who can change the task can use **Retry**. Before a new run starts working, a short connection failure to its subscription broker can recover within that same run. For a run with the agent’s full permissions, Tale makes at most three GET requests, waiting at least five seconds and then ten seconds between them, within a shared 60-second request-and-result budget. Within that resolution, Tale waits at least as long as the broker requests or stops if the wait cannot fit. That transport wait is not carried into a later run; normal retry and hourly-start rules still apply. Database and DNS checks, as well as connection cleanup, can delay the final refusal. These requests add no task start or automatic retry. Tale checks the run and credential again before retrying or returning a token. Member-confined runs, POST brokers, rejected credentials and account cooldowns keep their existing behavior. @@ -152,8 +154,9 @@ When a run fails and nothing retries it, because its automatic retries are used | Something the agent needs is missing: its model, one of its skills, or the agent itself | An Editor or Admin fixes the agent on the project's **Agents** tab. | | An attachment on this task is no longer in storage | Whoever can change the task removes the attachment or uploads it again; **Details** beside the run names the file. Then start the agent again. | | The run reached its time limit | Start the agent again, or split the task into smaller ones. | -| The run waited too long for a free sandbox | Start the agent again when fewer agents are busy. | +| The run waited too long for a free worker | Start the agent again when fewer agents are busy, or ask an Owner or Admin to raise **Agent workers**. | | The AI model failed, or the run couldn't start or was interrupted | Start the agent again. If it fails again, show an Admin what the run reported under **Details**. | +| The agent stopped responding | Start the agent again. If it stops again, show an Admin what the run reported under **Details**: it shows what the agent printed last. | Tale also tells the person who started the run and everyone watching the task: with the notification **Agent run failed** and, when the organization has a connected mailbox, by email. Only people who can still open the project are told. Starting a new run on the task marks the unread notification as read. Switch these notices off with **Agent escalations** under **Settings > Notifications**. @@ -161,7 +164,7 @@ Tale also tells the person who started the run and everyone watching the task: w A project agent can also be put to work without anyone pressing **Start agent**: by a [scheduled automation](/platform/automations/triggers#start-a-project-agent-on-a-schedule), or by another agent of the project that holds the **Start other agents on tasks** tool, such as a manager agent that hands out ready work and answers questions. The timeline lists such a run as **automation**, with a link to the automation run for Owners, Admins, and Developers, or as **delegated**, started by the agent that asked. The agent is told who started it, and a message that automation or agent passed reads as theirs, never as a person's review: where it contradicts the description or a person's comment, those win. -The run answers to whoever the requesting run answers to: the person who started it, or nobody for a schedule's chain, whose spend counts as automation spend. That person, or the schedule, has to be able to act in the project when the run starts; a lost Editor role, a paused schedule, or an automation removed from the project stops the next start. An agent another agent started cannot start further agents, and a run a Member started cannot start any. Such a start also checks what a person might forget: a task an open task blocks does not start, and an agent already working another task is not started twice. An automatic retry of such a run keeps to that rule: while its agent works on another task in the same workspace, the retry waits, checks again every five minutes and starts once the agent is free, without using an attempt. Each check reads the task afresh, so a move out of **In progress**, a reassignment, an archived task or project, or a lost role ends the wait. If the agent is still busy two hours after the failure, the retry does not start, and the timeline says **Run refused: agent is working on another task**. +The run answers to whoever the requesting run answers to: the person who started it, or nobody for a schedule's chain, whose spend counts as automation spend. That person, or the schedule, has to be able to act in the project when the run starts; a lost Editor role, a paused schedule, or an automation removed from the project stops the next start. An agent another agent started cannot start further agents, and a run a Member started cannot start any. Such a start also checks what a person might forget: a task an open task blocks does not start, and an agent cannot start itself on another task (`self_start`). An agent already working other tasks is started all the same, in a [worker](/platform/projects/project-agents#run-one-agent-on-several-tasks) of its own. When every agent worker of your organization is busy, the run waits, starts on its own once one frees, and the start answers `started` with the reason it waits (`waitingReason`); **Read a task** shows the same while the run waits. An automatic retry of such a run starts at once, whatever else its agent is doing. A delegated run parks its result at **In review** for its recorded reviewer. Resuming a task that waits there withdraws its pending review without approving it. A start that leaves the card where it is (`moveToInProgress: false`) is refused under a card waiting for review, or a **Done** or **Cancelled** one, so earlier work is never presented for judgment while new work runs under it. A manager that answers an agent's question resumes it naming the run that asked and the review it waits at. The resumption happens only while that is still the task's open question. If a decision was made in the meantime (Done, Cancelled or another move), a newer run or review exists, or the assignee changed, the agent answers `stale_question` and nothing is assigned, withdrawn, moved or started. When your organization requires an independent human reviewer, the person the run answers to cannot accept its result. diff --git a/docs/en/platform/projects/tasks.md b/docs/en/platform/projects/tasks.md index 09c4dfeec1..2baacd88ab 100644 --- a/docs/en/platform/projects/tasks.md +++ b/docs/en/platform/projects/tasks.md @@ -70,9 +70,9 @@ Automations follow a narrower rule, because an automation acts as itself, with t A run started by someone who can't edit the project, such as a Member, keeps to its task: - Its platform tools change only that task and the subtasks under it: the agent creates new tasks only as subtasks of that task, uses only labels the project already has, and can't sync items from other systems into the project. -- It can't save documents to the project. The files it produces still arrive on the task under **Deliverables**. +- It can't save documents to the project or write knowledge entries. The files it produces still arrive on the task under **Deliverables**. - The run gets neither the agent's **Secrets** nor the token of an equipped GitHub connection. The agent learns which credentials were held back and is asked to say so in its report when the work needs them; an Editor or higher then has to start it. Connectors equipped on the agent keep working and act for the person who started the run. -- It works in a workspace of its own, kept for that person's runs with this agent: files from runs that Editors started aren't there, and what this run leaves behind never reaches those runs. The same person's later runs with the agent find it again, until Tale deletes it: when the person leaves the organization or the agent is deleted, or once no run has used it for the number of days the organization sets under [**Days without use**](/platform/admin/sandboxes#delete-unused-workspaces-automatically). +- It works in a worker kept for that person's runs with this agent, with a workspace of its own: files from runs that Editors started aren't there, and what this run leaves behind never reaches those runs. The person gets one such worker for each of their runs with the agent that work at the same time. Their later runs with the agent find the workspace again, until Tale deletes it: when the person leaves the organization or the agent is deleted, or once no run has used it for the number of days the organization sets under [**Days without use**](/platform/admin/sandboxes#delete-unused-workspaces-automatically). The run can still read the project's tasks and knowledge, and it keeps these limits when an Editor guides it later. A run that an Editor or higher starts has the agent's full equipment, on any task. A Member's comment can change that: when the agent's runtime restarts to take in the comment, as [every runtime except Claude Code](/platform/agents/harnesses) does, the rest of the run counts as the Member's, with the same limits on its tools and credentials. @@ -114,7 +114,7 @@ The current review also explains self-review, changed implementation ownership, ## Use statuses to communicate progress -Change **Status** in the task details, or drag a card to another column on **Board**. The status picker is the keyboard-accessible alternative to dragging. +Change **Status** in the task details, or drag a card to another column on **Board**. The status picker is the keyboard-accessible alternative to dragging. **Done** and **Cancelled** fold to a narrow rail with the fold icon beside their name, so finished work stays out of the way: the rail keeps the column's count, opens again when you select it, and still takes a card you drag onto it. Each board remembers its folded columns in this browser. | Status | Meaning | | --- | --- | @@ -135,15 +135,17 @@ While the source validates a request, the task shows its pending state and preve ## Keep decisions with the work -Open the task to add a description, attachments, dates, labels, subtasks, or comments. Use comments for questions, decisions, and feedback that future reviewers need to understand. +Open the task to add a description, attachments, dates, labels, subtasks, or comments. Use comments for questions, decisions, and feedback that future reviewers need to understand. A task reads the same in the board's dialog and on its own page: the brief first, then the discussion as one conversation with the task's history between the comments, and the comment box at the bottom. On a larger screen it opens at the latest message; scroll up for the brief. On a phone the dialog scrolls as one column from the brief: the conversation, then the comment box, then the details. [Open your tasks from Home](#open-your-tasks-from-home) describes each part. Typing `@` in a comment opens the mention picker. A mention of an assigned agent is an instruction: it can steer a running agent or start another run when the agent is idle. A plain comment records the discussion without requesting that agent action. +The picker finds people and agents by name or by handle; an agent's handle, such as `@my-opus-agent-3` for “My Opus Agent #3”, appears beside it. The field and the posted comment show the name of whoever you mention. Tale saves whom a mention names rather than the words you typed, so after a rename the mention shows the new name. **Backspace** right after a name removes the whole mention, and typing inside a name turns it into plain text. A mention inside code stays text and notifies no one. + Mentions in the task description work the same way when you save the task: the people you name are notified, and a named agent is steered or starts a run as described above. A run it starts moves the task to **In progress**, whichever column you created it in. When you edit the description later, only the mentions you add take effect. Rewording the text around an existing mention notifies no one again. The agent reads the description as it is when its run starts, so an edit you make while the run is still waiting is the version it works from. Use **Subtasks** to split work that has separately checkable results. A subtask names its parent at the top of its details (**Part of …**); click it to go back up. While any of its subtasks is still open, a parent task cannot move to **Done** or **Cancelled**; every other status stays available, **To do** included. **Dependencies** shows which tasks block this task and which it blocks; circular dependencies are refused. -When you change a field, the task's **Activity** shows its value before and after. A field you clear shows what is left, such as **No due date** or **Unassigned**, rather than its old value alone. Titles, descriptions, labels, and file names appear exactly as they were written, even when the text is a status name such as `done`. Statuses, priorities, dates, and the words for an empty field appear in your language. +When you change a field, the line it adds to the task's conversation shows its value before and after. A field you clear shows what is left, such as **No due date** or **Unassigned**, rather than its old value alone. Titles, descriptions, labels, and file names appear exactly as they were written, even when the text is a status name such as `done`. Statuses, priorities, dates, and the words for an empty field appear in your language. ## Repeat a task @@ -210,12 +212,13 @@ Move the task to **Done** when the result meets the requirement. If an agent nee ## Open your tasks from Home -[Home](/platform#home) lists the open tasks assigned to you and those waiting for your review, from every project you can read; **Tasks** above the list shows only them. A task you open there appears as a page of its own beside the Home panel, not in the board's dialog: +[Home](/platform#home) lists the open tasks assigned to you and those waiting for your review, from every project you can read; **Tasks** above the list shows only them. A task you open there appears as a page of its own beside the Home panel, laid out like the board's dialog: - The brief comes first as a card: the description, attachments, and subtasks. -- The discussion follows like a conversation, oldest first under day labels. It combines the comments with the task's history, such as status changes, assignments, and agent runs. +- The discussion follows like a conversation, oldest first under day labels that stay at the top while you scroll through their day. Your own comments sit on the right, as in a chat; everyone else's, people and agents, read on the left under their name, with an **Agent** label for an agent and the time. A long comment, such as an agent's report, shows its beginning with **Read more** to open the rest in place and **Show less** to fold it again. +- The task's history sits between the comments as short lines, such as status changes, assignments, and agent runs. Three or more in a row fold into one line, such as **5 updates**, with who made them; select it to see each one. - The comment box sits at the bottom. Send with **⌘+Enter** or **Ctrl+Enter**, or with the round send button; **Enter** alone starts a new line. Type `@` to mention an agent or a person, with the same effect as in the board's dialog. Text you have not sent stays in the box for that task, here and in the board's dialog, and the task's row in Home shows **Draft** while you work elsewhere. -- **Details** beside the discussion holds the status, priority, assignee, reviewer, dates, repeat, labels, and dependencies, together with **Watch** and **Archive**. Organization owners and admins also find **Delete** there: it removes the task with its subtasks, their comments, and their files for good, and stops their running agent runs. **Hide details** at the end of the header folds it away, and **Show details** brings it back. In a window too narrow to keep both side by side, **Show details** opens it as a sheet over the discussion instead — from the side, or from the bottom on a phone. +- **Details** beside the discussion holds the status, priority, assignee, reviewer, dates, repeat, labels, and dependencies, together with **Watch** and **Archive**. When the task's agent runs have cost anything, **Agent cost** there shows their total. Organization owners and admins also find **Delete** there: it removes the task with its subtasks, their comments, and their files for good, and stops their running agent runs. **Hide details** at the end of the header folds it away, and **Show details** brings it back. In a window too narrow to keep both side by side, **Show details** opens it as a sheet over the discussion instead — from the side, or from the bottom on a phone. **Board** in the header opens the project's task board. A task you open from the board still appears in its dialog, which shows the same title line; both views edit the same task. **Open as page**, the expand icon beside **Close** in the dialog, opens the task here on its own page, and the browser's Back returns to the board with the dialog open. A description you are still editing is not carried over, so save it first. **Copy link** in the dialog copies the same page link. **Copy link**, the link icon beside **Board**, copies a link to this task page. To copy the task's identifier, such as `WEB-2`, click it in the line under the title; a message confirms each copy. diff --git a/docs/en/self-hosted/configuration/environment-reference.md b/docs/en/self-hosted/configuration/environment-reference.md index 79150977ee..74f71692c4 100644 --- a/docs/en/self-hosted/configuration/environment-reference.md +++ b/docs/en/self-hosted/configuration/environment-reference.md @@ -66,6 +66,7 @@ Tale keeps two databases: the operational store (`tale_app` — agents, runs, th | `DB_PASSWORD` | `tale_password_change_me` | **Required for bundled Postgres.** Password shared by the application and knowledge databases in the packaged layout. Replace the example value before production. | | `DATABASE_URL` | constructed from `DB_PASSWORD` | **Optional.** Connection URL for the operational database. Set it to point the backend at a Postgres of your own; it needs no extensions and no superuser, only a database and a role that may create schemas. Read on every start. | | `DATABASE_POOL_MAX` | `10` | **Optional.** Maximum connections in each operational database pool. Each `backend-api` or `backend-worker` replica normally needs up to twice this value (app pool plus job queue). Sandbox lifecycle operations can temporarily add one connection per occupied app-pool slot, for a peak of three times this value per replica. Count that peak against the database’s `max_connections`. | +| `AUTH_DATABASE_POOL_MAX` | `5` | **Optional.** Connections in the pool each `backend-api` replica resolves sign-in sessions through; every authenticated request reads through it. Raise it on replicas that serve thousands of requests a second, and count it per replica against the database’s `max_connections` beside `DATABASE_POOL_MAX`. | | `POSTGRES_CA_FILE` | unset | **Optional.** Path to a PEM bundle trusted for **every** Postgres connection: the operational database, the knowledge corpus, and the databases organizations bring themselves. Needed whenever a URL asks for `sslmode=verify-ca` or `verify-full` against a provider whose root is not one Node ships (Amazon RDS is the common one). Concatenate several roots into one file if your databases use different providers. | | `KNOWLEDGE_DATABASE_URL` | `postgresql://tale:${DB_PASSWORD}@knowledge-db:5432/tale_knowledge` | Connection URL for the default knowledge corpus. Pointing it elsewhere selects another database; it does not migrate existing chunks or vectors. | | `KNOWLEDGE_DB_POOL_MAX` | `10` | **Optional.** Connections one backend process opens to the knowledge corpus. Every indexing job holds one while it commits a slice of chunks, so a worker allowed more concurrent jobs than this (`WORKER_CONCURRENCY`) queues on the pool — raise the two together. Like `DATABASE_POOL_MAX`, it counts per replica against the corpus database's `max_connections`. | @@ -225,6 +226,7 @@ These values shape the application roles of a workspace deployment: the replica | `AGENT_START_SLOTS` | `WORKER_CONCURRENCY`, at least `8` | Agent turn starts one `backend-worker` replica runs at once, for task runs and for automation steps each. A start holds its slot through the sandbox create and the turn's first 90-second window. Range `1`–`256`. | | `AGENT_DRIVE_SLOTS` | `WORKER_CONCURRENCY`, at least `16` | Drive windows of live agent turns one `backend-worker` replica runs at once, per lane. A replica keeps about 2.5 times this many live turns per lane drained; past that, windows wait long enough for recovery to step in, so raise it (or add replicas) for more turns at once. Range `1`–`256`. | | `AUTOMATION_ORG_CONCURRENCY` | `8` | Automation steps of one organization that run at once across all `backend-worker` replicas, so one organization's burst of runs cannot take every worker's slots while other organizations' runs wait. `0` turns the limit off. Replicas that fetch work at the same moment can each start a step, so a burst may briefly run one or two more. A single replica at the default `WORKER_CONCURRENCY` never reaches it; a deployment that serves one organization with more step slots than this raises it or sets `0`. Range `0`–`256`. | +| `AUTOMATION_RUNNER_PROCESSES` | `2` on `backend-api`; on `backend-worker`, one per CPU core but one, at most `4` | How many processes a backend replica evaluates automation code in: templates the runner reads and transform bodies. A replica starts one and adds another only while the ones it has are all busy; one beyond the first stops after five idle minutes. Each costs about 75 MB while it runs. Lower it on a replica short of memory; raise it on a worker whose automations run many transform bodies. Range `1`–`16`. | | `SHUTDOWN_DRAIN_MS` | `15000` on `backend-api`, `90000` on `backend-worker` | How long, in milliseconds, a stopping backend replica waits for its jobs before it exits. A stopping worker first hands its automation runs to another one: each run continues at its next step, and a step still working 20 seconds in is interrupted and runs again on the next replica, unless it was sending something to an outside service — that run then waits for a person to decide. Keep the container's `stop_grace_period` at least 15 seconds above this value; the shipped compose files give `backend-api` 30 seconds and `backend-worker` 120, and `tale deploy` raises both to 15 seconds above a longer value. Range `1000`–`600000`. | | `TALE_BACKEND_URL` | `http://backend-api:3005` | Where the web tier reaches the application backend: the public `/status` page probes it and the web server asks it for the answers only a database can give. The shipped compose and the container entrypoint default it to the in-compose alias; set it only when your backend service has another name. Read by the `platform` service only. | @@ -235,6 +237,7 @@ A workspace rollout temporarily runs both colors. Plan capacity for that overlap | Name | Default | Description | | ------------------------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `SESSION_IDLE_TIMEOUT_MINUTES` | unset | **Optional.** Sign a session out after this many minutes of inactivity (`1`–`1440`). The window slides on activity and is enforced server-side across email/password, SSO, and trusted-headers sessions. | +| `SESSION_COOKIE_CACHE_SECONDS` | unset | **Optional.** Lets a request reuse its resolved session from a signed cookie for up to this many seconds (`1`–`300`) instead of reading the database. On a busy deployment this saves most authentication reads. The trade-off: changes to the session or the account reach ordinary requests only when the cached copy expires (a sign-out on another device, or the sessions ended when a password changes or an admin revokes a member's passkey or resets their two-factor authentication). Organization membership is still read on every request, and open live-update streams re-check the session within 15 seconds. With `SESSION_IDLE_TIMEOUT_MINUTES` set, the cache is held to a quarter of that window; idle revocation allows for the cache, so an organization's idle timeout can take effect up to this many seconds late. | Leave it unset to keep the default session lifetime. When set, an idle session expires server-side once the window elapses, while an active one keeps sliding forward on each request. Org admins can tighten the effective window per organisation — never loosen it past this cap — via the [session idle timeout governance policy](/platform/admin/governance/policies-and-limits); idle sessions under that policy are revoked by a sweep that runs about every five minutes. @@ -246,17 +249,29 @@ Leave it unset to keep the default session lifetime. When set, an idle session e Set it to your own help desk so people who hit an error reach the team that runs your deployment. Where the error screen knows the organization, the link adds `organizationId=` to the query string, after any query the URL already carries, and replaces an `organizationId` the URL already has. Any other value, such as `mailto:` or a URL without a scheme, is ignored with a warning in the `platform` service's log, and the link keeps the default. +## MCP endpoint + +| Name | Default | Description | +| --- | --- | --- | +| `TALE_MCP_ALLOWED_ORIGINS` | unset | **Optional, read by `backend-api` and the `all` role.** Browser origins, besides `SITE_URL` and `ADDITIONAL_SITE_URLS`, from which the [MCP endpoint](/develop/mcp-endpoint) accepts a request that carries an `Origin` header. Comma- or space-separated, each `scheme://host[:port]` without a path, such as a desktop editor's own `vscode-file://vscode-app`. A malformed entry prevents backend startup. | +| `TALE_MCP_ORIGIN_ENFORCE` | `false` | **Optional, read by `backend-api` and the `all` role.** `true` refuses a request from any other origin with `403` and `ORIGIN_FORBIDDEN`; `false` only logs it. | + +Coding agents in a terminal and server-side clients send no `Origin`, so the check never applies to them. A browser page on another site does send one, and an API key in such a page is how that site would reach the endpoint. While enforcement is off, each request from an origin outside the list is logged as `[mcp] origin-mismatch` with the origin, the organization and the person. Read those lines to see which of your clients send an origin before you set `TALE_MCP_ORIGIN_ENFORCE=true`, and add their origins to `TALE_MCP_ALLOWED_ORIGINS`. + ## Sandbox infrastructure The sandbox spawner reads the settings below. Pass them into its environment and recreate that service after a change. `SANDBOX_MAX_SESSIONS` sets the capacity shared by all organizations; an organization's three workload limits add up automatically and cannot be saved above that capacity. Manage those limits in [Sandboxes](/platform/admin/sandboxes), where actual runtime counts and host measurements appear separately from workload allocations. | Name | Default | Description | | --- | --- | --- | -| `SANDBOX_MAX_SESSIONS` | sized from host memory on a local Docker host (at least `8`, at most `256`); `8` elsewhere | Maximum running and starting sessions across all organizations on the Docker host or in the Kubernetes namespace, including idle containers kept for reuse. This capacity does not reserve CPU or memory. Unset on a Docker host whose memory the spawner can read, it is sized from that memory: one session per 768 MiB left after `SANDBOX_MIN_FREE_MEMORY`, or per 1.5 GiB where agent sessions run Docker inside the sandbox. If the memory cannot be read at start, the capacity stays `8` until it can. An explicit value fixes it. Concurrent Kubernetes replicas enforce it on a best-effort basis; use ResourceQuota for hard namespace resource bounds. | +| `SANDBOX_MAX_SESSIONS` | sized from host memory and CPUs on a local Docker host (at least `8`, at most `256`); `8` elsewhere | Maximum running and starting sessions across all organizations on the Docker host or in the Kubernetes namespace, including idle containers kept for reuse. This capacity does not reserve CPU or memory. Unset on a Docker host whose memory the spawner can read, it is sized from that memory: one session per 768 MiB left after `SANDBOX_MIN_FREE_MEMORY`, or per 1.5 GiB where agent sessions run Docker inside the sandbox, and at most two sessions per CPU the Docker daemon reports. If the memory cannot be read at start, the capacity stays `8` until it can. An explicit value fixes it. Concurrent Kubernetes replicas enforce it on a best-effort basis; use ResourceQuota for hard namespace resource bounds. | | `SANDBOX_MIN_FREE_MEMORY` | a tenth of host memory, at least `1g` | Memory a new session or a released warm session resuming work must leave free on a local Docker host, beside what the sessions still starting or just started are about to use. A create that would leave less first stops a released idle session; if memory is still short, the spawner answers busy and the work waits until running sessions free some. Accepts sizes such as `2g` or `1536m`. Has no effect on Kubernetes or with a remote Docker daemon. | +| `SANDBOX_CPU_PRESSURE_PERCENT` | `60` | CPU pressure on a local Docker host, in percent, from which new sessions and released sessions resuming work start one at a time: the share of the last ten seconds in which some task waited for a CPU, as the kernel's pressure stall information reports it (`some avg10` of `/proc/pressure/cpu`). Above it, one start is admitted every ten seconds in the order work asked, and the rest wait with a busy answer; running work is not slowed. `0` turns the check off. A kernel without pressure stall information (built without it, or booted with `psi=0`) leaves CPU out of admission, which the spawner logs once. Has no effect on Kubernetes or with a remote Docker daemon. | | `SANDBOX_MIN_FREE_DISK` | a twentieth of each disk, at least `2g`, at most `20g` | Free space required for new and reactivated sessions on the workspace filesystem and the verified Docker data filesystem. Below the floor work waits; stopped unused build caches are reclaimed first. Accepts `10g` or `4096m`; `0` disables the check. Kubernetes relies on its storage class and volume provisioning. | +| `SANDBOX_CRITICAL_FREE_DISK` | a quarter of the `SANDBOX_MIN_FREE_DISK` floor, at least `1g` and never above it | Free space below which the session disk is critical: what running sessions write there is about to fail. Below it, released idle sessions with Docker inside are stopped at once, which removes their inner image stores, and the spawner logs the three largest workspaces at most every ten minutes. Accepts `2g` or `2048m`; a value above the floor counts as the floor; `0` turns it off, as does a floor of `0`. Docker backend only. | | `SANDBOX_DOCKER_WORKLOADS` | `project,workflow` | Workloads allowed to use inner Docker when it is enabled for the deployment. Set `project` to allow Docker only for project agents, `workflow` only for workflow agents, or `none` to disable both. Applies to newly created sessions; existing sessions keep their capabilities. A session request can opt out with `docker: false`, but cannot enable Docker beyond this allowlist or the deployment setting. | | `SANDBOX_AGENT_CPUS` | `2` | CPU limit per agent session. Account for overlapping builds and other host workloads when choosing the session count. | +| `SANDBOX_AGENT_CPU_SHARES` | `256` | CPU weight of an agent session and of its organization's build-cache helpers while the host's CPUs are saturated, against Docker's default of `1024` that the platform's own services keep; sessions of the `default` profile (code runs, page renders) use `128`. Busy sessions then yield the CPU to the database and backend instead of stalling them; on a host with spare CPU a session still uses up to `SANDBOX_AGENT_CPUS`. A whole number from `2` to `262144`. Applies to newly created sessions; a running helper takes a new value at once. | | `SANDBOX_AGENT_MEMORY` | `4g`; `8g` with Docker inside the sandbox | Memory limit per agent session, shared with its inner Docker daemon and nested containers. An explicit value overrides either default and applies to newly created sessions. | | `SANDBOX_AGENT_PROFILE` | `agent` | Read by the backend API and worker. Profile for new agent and workflow workspaces: `agent` supports inner Docker; `agent-light` keeps coding tools and the persistent workspace without starting Docker or build-cache helpers. Existing workspaces retain their recorded profile. | | `TALE_SANDBOX_CLAUDE_EFFORT` | unset (inherits the agent runtime default) | Read by the backend API and worker. Claude Code reasoning effort: `low`, `medium`, `high` or `max`. Lower settings omit the automatic Ultrathink instruction and set the per-exec effort, while keeping adaptive thinking enabled. Other agent runtimes and foreign models are unaffected. Compare representative tasks before lowering it; shorter runs are not guaranteed. | @@ -266,13 +281,22 @@ The sandbox spawner reads the settings below. Pass them into its environment and | `SANDBOX_BUILDKITD_CPUS` | `SANDBOX_AGENT_CPUS` | CPU limit of an organization's build-cache helper, which runs the image builds of all its agent sessions when Docker runs inside the sandbox. A running helper takes a new value at once. The number of concurrent BuildKit solver steps is this CPU limit rounded down, with a minimum of one; this bound takes effect when an idle helper is recreated. | | `SANDBOX_BUILDKITD_MEMORY` | twice `SANDBOX_AGENT_MEMORY` | Memory limit of an organization's build-cache helper, shared by the builds its agent sessions run at the same time. Accepts sizes such as `16g` or `12288m`. A running helper takes a new value when it is recreated, once no build is running. | | `SANDBOX_BUILDKITD_IDLE_CACHE` | `5g` | Build cache an organization's build-cache helper keeps when it stops for want of agent sessions. Right before that stop, the spawner prunes the cache down to this size, least recently used first: the cache's own garbage collection runs only while the helper runs. Accepts sizes such as `5g` or `2048m`; `0` keeps nothing. | +| `SANDBOX_BUILDKITD_MAX_CACHE` | a tenth of the session disk, at least `1g`, at most `20g` | The most build cache each organization's build-cache helper keeps; past it, the least recently used records go first. Unset, it follows the size of the disk the session workspaces live on, so many building organizations together cannot claim more than a share of it. The floor that low disk space never prunes below is a tenth of this cap, at most 2 GiB. Accepts sizes such as `8g` or `40960m`, at least `1g`. A running helper adopts a new value when it is recreated, once no build is running. | | `SANDBOX_BUILDKITD_PROVISION_TIMEOUT_MS` | `5000` | Total time in milliseconds for optional shared build-cache setup during session creation, including queued Docker calls and registry mirrors. Range `100`–`60000`. When the shared setup budget expires, queued helper work is cancelled and cannot launch later; the session falls back to its local builder. | | `SANDBOX_BUILDKITD_CACHE_RETENTION` | `14d` | How long an organization's stopped build-cache helpers keep their caches. Once the builder has been stopped longer than this and no session of the organization may use it, the spawner removes its helpers, network and cache volumes, as an organization's deletion does; its next build starts cold. Accepts whole days or hours such as `14d` or `336h`; `off` (or `0`) keeps the caches until the organization is deleted. | -| `SANDBOX_SESSION_MAX_IDLE_MS` | `1800000` (30 min) | Idle window for stopping unpinned sessions. Organization build-cache helpers also stop after this window with no potentially active organization session; their networks and cache volumes are retained. | -| `SANDBOX_SESSION_RELEASED_IDLE_MS` | `300000` (5 min) | Idle window for a released session: one whose task or run has finished and that no other work holds. An unpinned released session idle this long is stopped instead of waiting out `SANDBOX_SESSION_MAX_IDLE_MS`; the next turn resumes it on its preserved workspace. Agent sessions with Docker inside the sandbox keep the full idle window, because each resume starts their inner Docker daemon with an empty image store. | +| `SANDBOX_BUILDKITD_IDLE_MS` | `600000` (10 min) | How long an organization's build-cache helpers keep running once no agent session of the organization that builds may use them. They then stop, keeping the network and the builder's cache volume, while the registry mirrors are removed with their caches; the next build starts them again, a helper launched with the current image and settings by starting the stopped container, any other by recreating it. Minimum `60000`. | +| `SANDBOX_PACKAGE_CACHE_RETENTION` | `14d` | How long an organization's package caches outlive their last use: the pip, uv, npm and bun download caches its sandboxes share on Docker (sandboxes with Docker inside don't use them). Once no sandbox of the organization has used them for this long, the spawner removes them at its next hourly check; the organization's next sandbox starts with empty caches, and installs take longer until they fill again. Caches from before this setting existed count from the first check after the update. Accepts whole days or hours such as `14d` or `336h`; `off` (or `0`) keeps the caches until the organization is deleted. | +| `SANDBOX_SESSION_MAX_IDLE_MS` | `1800000` (30 min) | Idle window for stopping unpinned sessions. Organization build-cache helpers follow `SANDBOX_BUILDKITD_IDLE_MS` instead. | +| `SANDBOX_SESSION_RELEASED_IDLE_MS` | `300000` (5 min) | Idle window for a released session: one whose task or run has finished and that no other work holds. An unpinned released session idle this long is stopped instead of waiting out `SANDBOX_SESSION_MAX_IDLE_MS`; the next turn resumes it on its preserved workspace. Agent sessions with Docker inside the sandbox keep the full idle window once their inner Docker daemon has run, because each resume starts it with an empty image store; a session whose daemon never started gets this shorter window too. | +| `SANDBOX_EXEC_STALL_MINUTES` | `45` | How long a command in a session may print nothing while its processes use under 1% of one CPU before the sandbox ends it as stalled. An agent that hangs, waiting on a connection that never answers or on input nobody sends, would otherwise hold its session until its run's time limit. Work the command hands to containers it started inside the sandbox counts as CPU use. Whole minutes up to `1440`; `0` turns the check off. Applies to newly created sessions. | | `SANDBOX_RUNTIME_IMAGE` | `tale-sandbox-runtime:latest` | **Optional, read by the spawner.** The image every session container is created from. The default is the tag the development stack builds locally, so a host that pulls its images sets the registry one: `ghcr.io/tale-project/tale/tale-sandbox-runtime:`, matching the rest of the stack. `tale deploy` sets it for you. | | `SANDBOX_DIND_INNER_POOL` | unset (automatic) | Optional inner Docker address pool for agent sessions on Docker or Kubernetes. Use a canonical RFC1918 IPv4 `/16` outside your Pod, Service and VPC networks. The runtime rejects overlaps with networks and addresses it discovers. | +| `SANDBOX_K8S_DOCKER_STORAGE_SIZE_LIMIT` | `20Gi` | **Kubernetes only.** Size of the inner Docker store of an agent session that runs Docker inside its sandbox. A session that outgrows it is evicted, so size it for the largest images your agents pull and build. The other Kubernetes settings are listed in [Deploy on Kubernetes](/self-hosted/install/kubernetes). | +| `SANDBOX_K8S_EPHEMERAL_STORAGE_REQUEST` / `SANDBOX_K8S_EPHEMERAL_STORAGE_LIMIT` | `256Mi` / `2Gi` | **Kubernetes only.** How much of the node's disk a session Pod requests, and how much it may write there outside its temporary workspace and inner Docker store. The Pod's limit adds those stores, so a session past it is evicted on its own instead of filling the node. | +| `SANDBOX_K8S_NODE_SELECTOR` / `SANDBOX_K8S_TOLERATIONS` | unset | **Kubernetes only.** The node labels every session Pod must match, as a JSON object such as `{"tale.dev/sandbox":"true"}`, and the taints it tolerates, as a JSON array of Pod tolerations, so sessions run on nodes of their own instead of beside the database and the platform. A malformed value stops the spawner at start. | +| `SANDBOX_K8S_PRIORITY_CLASS` | unset | **Kubernetes only.** The PriorityClass of every session Pod. A class below the platform's lets the scheduler preempt sessions to place platform Pods. | | `SANDBOX_EGRESS_MAX_CLIENTS` | `2000` | **Read by the `sandbox-egress` service**, not the spawner: recreate that service after a change. Connections the egress proxy serves at once for all sessions together; with transparent egress, every outbound connection of a session, its builds and its package installs goes through it. Past the limit the proxy refuses new connections, and installs and page loads fail with connection resets. Each connection takes a thread and two open files, so the shipped compose files size the proxy's process and open-file limits for the default; a higher value needs them raised too, and the proxy warns at start when its open-file limit is too low. At start the proxy raises its open-file limit to what the connections need, as far as the container's hard limit allows. On Kubernetes, set it on the egress Deployment; a Pod spec sets no process limit, so the node's `podPidsLimit` must leave room for one thread per connection. | +| `SANDBOX_EGRESS_MAX_CONNECTIONS_PER_SESSION` | `256` | **Read by the `sandbox-egress` service**, not the spawner: recreate that service after a change. Connections one session may hold open to the egress proxy at once, counted by its address, so one session cannot take the whole `SANDBOX_EGRESS_MAX_CLIENTS` pool from the others; each organization's build-cache helpers have addresses of their own. A connection past the cap is refused at once with a reset, while the session's other connections keep working. `0` turns the cap off, and a value that is not a whole number stops the proxy from starting. The proxy installs the cap as a firewall rule at start; on a kernel without the `connlimit` match it starts without the cap and logs a warning. On Kubernetes, set it on the egress Deployment; where the cluster network rewrites session source addresses so that sessions reach the proxy from one shared address, they share one cap, so set `0` there. | The backend settings above must reach both API and worker services. Recreate them after a change. The spawner checks memory and disk headroom when a released session is acquired again, so a warm workspace can wait for capacity too. @@ -300,7 +324,7 @@ Kubernetes sessions use `/readyz` for startup and `/livez` for daemon liveness. An already active generation is not charged again. A workflow without inner Docker keeps its agent identity and tools, but starts no Docker daemon and does not keep build-cache helpers alive. Without an explicit `SANDBOX_AGENT_MEMORY`, each session defaults to `4g` without inner Docker or `8g` with it, even when other sessions in the deployment use Docker. An explicit value applies to both modes. These limits are ceilings, not reserved RAM. -At full capacity, the spawner can stop a released, unpinned idle session before the idle timeout to admit new work, starting with the one idle longest. The daemon must confirm that no work is in progress; busy sessions and sessions with unknown state are protected. Stopping compute preserves the persistent workspace directory or volume. If no safe session can be reclaimed, admission remains blocked by the deployment capacity. The same applies when the host's free memory would drop below `SANDBOX_MIN_FREE_MEMORY`. While the disk that holds the session workspaces is below `SANDBOX_MIN_FREE_DISK`, new work waits without stopping idle sessions: a stopped session keeps its workspace. +At full capacity, the spawner can stop a released, unpinned idle session before the idle timeout to admit new work, starting with the one idle longest. The daemon must confirm that no work is in progress; busy sessions and sessions with unknown state are protected. Stopping compute preserves the persistent workspace directory or volume. If no safe session can be reclaimed, admission remains blocked by the deployment capacity. The same applies when the host's free memory would drop below `SANDBOX_MIN_FREE_MEMORY`. While the disk that holds the session workspaces is below `SANDBOX_MIN_FREE_DISK`, new work waits without stopping idle sessions: a stopped session keeps its workspace. Only below `SANDBOX_CRITICAL_FREE_DISK` does the spawner stop released idle sessions with Docker inside at once, since their stop removes their inner image stores. Agent runtime protocol records, including unfinished lines, are limited to 8 MiB. Oversized or incomplete output fails explicitly; a bounded progress preview is never treated as a complete structured result. Complete final answers are retained separately from that preview. @@ -310,7 +334,7 @@ When Docker is enabled inside agent sandboxes, the engine starts automatically o ### Size session capacity -On a Docker host with `SANDBOX_MAX_SESSIONS` unset, the spawner sizes the capacity from the host's memory (a 16 GiB host gets 19 sessions, a 64 GiB host 76; 9 and 38 where agent sessions run their own Docker daemon) and admits a new session only while the host keeps `SANDBOX_MIN_FREE_MEMORY` free, counting what the sessions still starting or just started are about to use. A burst of new sessions that would overcommit the host therefore waits instead of starting; the check does not stop sessions already running from growing. Set the capacity yourself on Kubernetes, with a remote Docker daemon, or when the host also runs other heavy workloads: test the tasks your deployment will run together. Browser rendering and Docker builds have different peaks; include agents, workflows and crawling across all organizations. A free session slot does not guarantee enough resources. +On a Docker host with `SANDBOX_MAX_SESSIONS` unset, the spawner sizes the capacity from the host's memory and CPUs (one session per 768 MiB beyond the reserve, at most two per CPU: a 16 GiB host with 8 CPUs gets 16 sessions, a 64 GiB host with 16 CPUs 32; a 16 GiB host gets 9 where agent sessions run their own Docker daemon) and admits a new session only while the host keeps `SANDBOX_MIN_FREE_MEMORY` free, counting what the sessions still starting or just started are about to use. A burst of new sessions that would overcommit the host therefore waits instead of starting; the check does not stop sessions already running from growing. While the host's CPU is under pressure (`SANDBOX_CPU_PRESSURE_PERCENT`), new sessions likewise start one at a time instead of adding to the load. Every project agent run that works at the same time as another takes a session of its own, an agent worker: one agent working three tasks at once runs three sessions, each with its own `SANDBOX_AGENT_MEMORY` limit. These two settings therefore bound how much agent work runs in parallel. Set the capacity yourself on Kubernetes, with a remote Docker daemon, or when the host also runs other heavy workloads: test the tasks your deployment will run together. Browser rendering and Docker builds have different peaks; include agents, workflows and crawling across all organizations. A free session slot does not guarantee enough resources. On Docker, sample resource use while representative tasks overlap. Repeat this command during the run; an idle snapshot does not show task peaks: @@ -346,17 +370,23 @@ The default capacity used to be 16, and organizations created before this releas From this release, a Docker deployment that never set `SANDBOX_MAX_SESSIONS` gets a capacity sized from its host's memory instead of 8, never less than 8. It can admit more sessions at once than before, and only while the host has memory to spare. Set an explicit value to keep a fixed capacity. +That sized capacity is now also at most two sessions per CPU, so a host with much memory and few CPUs gets fewer sessions than before (a 16 GiB host with 4 CPUs: 8 instead of 19). While the host's CPU is under pressure, new sessions also start one at a time (`SANDBOX_CPU_PRESSURE_PERCENT`, `0` turns this off). An explicit `SANDBOX_MAX_SESSIONS` is not changed. + ### Docker build caches Shared build-cache preparation uses `SANDBOX_BUILDKITD_PROVISION_TIMEOUT_MS` (5 seconds by default). Each session waits at most that long or one quarter of its total startup budget, whichever is shorter, then uses its local builder. Shared preparation has its own bounded lifetime; cancelling one session’s wait does not cancel setup for other sessions, and a late result does not attach to a session that already fell back. Registry mirrors are prepared concurrently. The shared builder’s parallel steps follow its configured CPU limit, rounded down with a minimum of one; its memory limit still applies. Preparation time counts against the remaining session startup budget. -Docker build caches are isolated by organization. Each organization uses one privileged builder and three unprivileged registry mirrors. Once no session may still use them, the helpers stop after the session idle window; the next build restarts them with their cache volumes intact. Right before the builder stops, the spawner prunes its cache to `SANDBOX_BUILDKITD_IDLE_CACHE`, because its garbage collection runs only while it runs. A stopped organization's cache is not pruned further; after `SANDBOX_BUILDKITD_CACHE_RETENTION` (14 days) with no build, its helpers and caches are removed, and otherwise they go with the organization. While the session disk is below `SANDBOX_MIN_FREE_DISK`, stopped organizations' caches go sooner, the longest-stopped first. Networks and volumes remain available for reuse. Kubernetes sessions use their own inner Docker builder; Kubernetes reconciliation does not invoke the Docker CLI for these helpers. +Docker build caches are isolated by organization. Each organization uses one privileged builder and three unprivileged registry mirrors. Once no session may still use them, the helpers stop after `SANDBOX_BUILDKITD_IDLE_MS` (10 minutes) and the registry mirrors are removed with their caches, since the builder's own cache keeps the base layers its builds used; the next build starts the builder again with its cache volume intact and recreates the mirrors. Right before the builder stops, the spawner prunes its cache to `SANDBOX_BUILDKITD_IDLE_CACHE`, because its garbage collection runs only while it runs. A stopped organization's cache is not pruned further; after `SANDBOX_BUILDKITD_CACHE_RETENTION` (14 days) with no build, its helpers and caches are removed, and otherwise they go with the organization. While the session disk is below `SANDBOX_MIN_FREE_DISK`, stopped organizations' caches go sooner, the longest-stopped first. The network and the builder's cache volume remain available for reuse. Kubernetes sessions use their own inner Docker builder; Kubernetes reconciliation does not invoke the Docker CLI for these helpers. The spawner packs organization bridges into the first available Docker address pool before moving to the next. Its default `/23` gives each bridge 512 addresses; an otherwise unused `/16` holds 128 such organization networks. Smaller subnets configured in Docker’s pools remain smaller. It excludes existing Docker networks, routes and DNS server addresses on the Docker daemon’s host, and `172.31.0.0/16` for older runtime images, then validates the created network. To observe the daemon’s host even with remote Docker, the spawner briefly runs the configured BuildKit image in the host network namespace with a read-only filesystem, all capabilities dropped and no mounts. If that observation fails or no safe subnet remains, sessions build locally without the shared cache. An unused owned network left with an invalid subnet is rebuilt; in-use and foreign networks are preserved. -Upgrades create cold organization caches and retain the old global cache data. Old helper containers stop automatically after no running session depends on them. Drain or stop old pinned sessions to complete that transition; until then the old shared cache service remains reachable. Browser automation uses headless Chromium; live browser viewing and manual browser takeover are retired. +Upgrades create cold organization caches and retain the old global cache data for now. Old helper containers stop automatically after no running session depends on them. Once they have been stopped longer than `SANDBOX_BUILDKITD_CACHE_RETENTION` (14 days) and still no session depends on them, the spawner removes those helper containers and the four old cache volumes (`tale-buildkitd-cache` and `tale-buildkitd-mirror-cache-docker-io`, `-ghcr-io`, `-quay-io`), each only while it carries the old build-cache label without an organization, and logs every removal; `off` keeps them. Drain or stop old pinned sessions to complete that transition; until then the old shared cache service remains reachable. Browser automation uses headless Chromium; live browser viewing and manual browser takeover are retired. + +### Inner Docker images + +With the shared build cache on, a session's inner Docker engine pulls Docker Hub images through its organization's docker.io registry mirror, the same cache its builds use, and falls back to Docker Hub when that mirror is not running. Images from other registries are pulled directly. An inner engine that goes idle with more than 10 GiB of images and build cache first removes its dangling images and prunes its build cache to the 5 GiB used most recently; tagged images, containers and volumes stay. On Kubernetes, the size limit of the inner store's volume bounds it instead when that limit is below 10 GiB. ### Inner Docker networks @@ -423,11 +453,26 @@ With a proxy of your own instead of the bundled one, forward `/sandbox/tunnel` t | Name | Default | Description | | -------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `TALE_EXTERNAL_TURN_DEADLINE_MS` | `1800000` (30 min) | **Optional.** How long an in-sandbox coding-agent turn (Claude Code, OpenCode, Codex) may sit with nobody draining its output before the sandbox daemon reaps it. A sliding window, re-armed every time the platform re-attaches to the output — not an absolute cap on the turn. Milliseconds. | +| `TALE_EXTERNAL_TURN_DEADLINE_MS` | `1800000` (30 min) | **Optional.** How long an in-sandbox coding-agent turn (Claude Code, OpenCode, Codex) may sit with nobody draining its output before the sandbox daemon reaps it. A sliding window, re-armed every time the platform re-attaches to the output — not an absolute cap on the turn. A running agent turn also waits out an unreachable sandbox service before it fails: for a third of this value, at most 10 minutes (exactly 10 minutes at the default), so lowering it shortens that wait. Milliseconds. | | `SANDBOX_LLM_GATEWAY_STREAM_IDLE_TIMEOUT_SECONDS` | `600` (10 min) | **Optional.** How long the sandbox model gateway waits for the next byte from a silent upstream model before it aborts the stream, including while a slow local model is still processing a long prompt. The backend reads it and configures the gateway. Claude Code and Codex turns wait at least as long before they give up on a silent stream and send the request again, so you can raise it for a slow local model without either of them sending a turn twice. A stalled upstream model then also holds a turn longer before the gateway aborts it. A value above 600 also raises the gateway's per-request timeout to match: it bounds a whole non-streaming answer, which an agent falls back to when a stream breaks, and how long an upstream may take to begin a streamed answer. Seconds. | +| `SANDBOX_LLM_GATEWAY_PROVIDER_CONCURRENCY` | `512` | **Optional.** How many requests the sandbox model gateway sends at once to one built-in provider (OpenAI, Anthropic, OpenRouter and the other providers the gateway implements itself), which every organization shares. The backend reads it and configures the gateway. The gateway keeps that many request workers for each provider whether or not anything calls it, so a higher value costs gateway memory. A request that finds every worker busy waits in a queue 16 times as long. A whole number from 1 to 5,000. | +| `SANDBOX_LLM_GATEWAY_CUSTOM_PROVIDER_CONCURRENCY` | `64` | **Optional.** The same for a custom provider. The backend sets one up in the gateway for each organization and model, so the number of custom providers grows with organizations and models, and each keeps its workers like a built-in one. A built-in provider's Anthropic lane for agent runtimes (Claude Code through OpenRouter's Anthropic endpoint) gets an organization-and-model provider of its own and is sized by this value. One organization's sandbox sessions rarely have more than a few model calls in flight on one model; raise it when an organization's API keys send more requests than that to one custom model at once. A whole number from 1 to 5,000. | +| `SANDBOX_LLM_GATEWAY_LOG_RETENTION_DAYS` | `3` | **Optional.** How many days the sandbox model gateway keeps its request log: one row per model call with the model, tokens, cost and timing, never a prompt or an answer. Tale does not read this log. Budgets, spend and usage come from the gateway's per-key budget counters, so a shorter log changes none of them. The backend passes the value to the gateway, which applies it at its first restart after the backend has passed it: it then deletes older rows, and again about once a day. A `tale deploy` restarts the gateway before the new backend passes the value, so a changed value takes effect from the following deploy. To apply it sooner, restart the `sandbox-llm-gateway` service once after the first sandbox session has started. The store reuses their space instead of growing. A whole number of days, at least 1; the backend ignores any other value and logs a warning. | Investigate why output consumption stopped before increasing this deadline. It limits orphaned output streams, not total task duration. Recreate the consuming backend roles after changing the environment. +A changed gateway worker count reaches each provider the next time an organization that uses it starts a sandbox session or calls the model endpoints. A lower count also reaches every other provider the gateway holds: the backend resizes them two to five minutes after its first sandbox session or model-endpoint request following a restart. + +A provider whose upstream host no longer resolves, such as one of a removed connector or of a host you took off your network, is the exception: the gateway refuses to rewrite it, so it keeps its workers, and the backend logs a warning that names it after every restart. Delete such a provider from the gateway. A provider still in use is set up again at its next sandbox session or model-endpoint request. Send the request from a backend container, which reaches the gateway and holds its admin password; on a `tale deploy` host, its name contains `-backend-api`: + +```bash +docker exec sh -c 'curl -fsS -X DELETE -u "${SANDBOX_LLM_GATEWAY_ADMIN_USERNAME:-admin}:$SANDBOX_LLM_GATEWAY_ADMIN_PASSWORD" "${SANDBOX_LLM_GATEWAY_URL:-http://sandbox-llm-gateway:8080}/api/providers/"' +``` + +On Kubernetes, use `kubectl exec -n tale deploy/backend-api --` in place of `docker exec `. + +The gateway starts every provider's workers while it boots, before the backend can reach it. Providers stored with more workers than these values (the gateway's own default is 1,000) can need more memory than the gateway's limit, 512 MiB with `tale deploy` and in the Kubernetes manifest, and the gateway is then killed during every start. Do not delete its volume, which holds its admin account and the keys it issued. Raise the limit until the gateway starts instead: on a `tale deploy` host, run `docker update --memory 2g --memory-swap 2g ` for the container whose name ends in `-sandbox-llm-gateway`; on Kubernetes, raise `resources.limits.memory` of its Deployment. Then start a sandbox session or call the model endpoints, and wait for the backend's log line `[llm-gateway] provider worker resize finished`, which comes two to five minutes later. It counts the providers the backend resized, the ones the gateway refused and the ones the backend could not confirm. A refused or unconfirmed provider keeps its workers, and a warning before the line names it; a restarted backend tries an unconfirmed provider again. Delete a refused provider whose upstream host no longer resolves, as described above, before you restore the limit. Afterwards, restore the limit with `docker update --memory 512m --memory-swap 1g ` and `docker restart `, or on Kubernetes the Deployment's original value. + ## Video-link ingestion (yt-dlp) The worker uses these values for video transcript retrieval. Its image includes yt-dlp and a PO-token plugin. Use [Video ingestion](/self-hosted/configuration/video-ingestion) to distinguish source restrictions, egress problems, and authorized session handling. Recreate the worker after changing deployment environment values; rereading a variable inside a process does not reload `.env`. diff --git a/docs/en/self-hosted/install/cli-install.md b/docs/en/self-hosted/install/cli-install.md index 04227a8d51..535c90823e 100644 --- a/docs/en/self-hosted/install/cli-install.md +++ b/docs/en/self-hosted/install/cli-install.md @@ -14,8 +14,8 @@ For your first instance, use the [quickstart](/self-hosted/install/quickstart). You need: - A workstation running macOS, Linux, or Windows with PowerShell. -- For local container operations: Docker with Compose and a running Docker daemon. -- For a remote workspace: access to its Docker daemon, usually through an SSH Docker context. The remote operator must be able to run Docker. +- For local container operations: Docker Engine 24.0 or later with Compose and a running Docker daemon. Tale’s images have zstd-compressed layers, which Docker pulls from Engine 23.0 on; `tale doctor` reports an older engine, and `tale dev` and `tale deploy` refuse it before downloading images. +- For a remote workspace: access to its Docker daemon, running Docker Engine 24.0 or later, usually through an SSH Docker context. The remote operator must be able to run Docker. The bundled object store currently ships only a `linux/amd64` image. On an ARM64 host, local development and workspace deployment need working amd64 emulation: Docker Desktop includes it; a standalone Linux Docker host needs [QEMU registered on the host](https://docs.docker.com/build/building/multi-platform/#install-qemu-manually). Tale selects the amd64 image but does not install emulation. Managed bundles still require native images for their declared architecture, so an ARM64 managed deployment must wait for a native object-store image. @@ -99,12 +99,12 @@ Commands exit `0` on success, `2` on a usage error, `3` on an unmet precondition ### Setup -`tale doctor` — inspect local startup prerequisites without creating a project, installing software or changing configuration. It checks the Docker daemon, Compose support and Linux-container mode, reports the daemon architecture and checks local ports. A remote Docker context skips local port checks. ARM64 and occupied-port warnings require review; an existing instance may already own a port. +`tale doctor` — inspect local startup prerequisites without creating a project, installing software or changing configuration. It checks the Docker daemon, its Docker Engine version, Compose support and Linux-container mode, reports the daemon architecture and checks local ports. A remote Docker context skips local port checks. ARM64 and occupied-port warnings require review; an existing instance may already own a port. - `-p, --port ` — HTTPS port to check (default `443`); the sandbox port `8003` is also checked. - `--json` — emit the checks as machine-readable JSON. -Docker, Compose, unsupported container-mode failures or selecting HTTPS port `8003` exit `3`. Warnings alone exit `0`; this does not verify image downloads, storage capacity or a model provider. Check a different port with `tale doctor --port 8443`, then use the same port with `tale dev`. +Docker, Compose, Docker Engine version or unsupported container-mode failures or selecting HTTPS port `8003` exit `3`. Warnings alone exit `0`; this does not verify image downloads, storage capacity or a model provider. Check a different port with `tale doctor --port 8443`, then use the same port with `tale dev`. `tale init [directory]` — create a project: it scaffolds the example configs, `AGENTS.md` + a `CLAUDE.md` pointer, and a local-default `.env` (localhost, self-signed certificate, generated secrets). No Docker is needed, and the production domain and TLS are chosen later, at `tale deploy`. In a terminal it asks for a project name when `directory` is omitted, confirms before overwriting an existing project, and asks once whether agents may run `docker` inside sandboxes (default: no — enabling it runs a privileged inner Docker); non-interactive runs skip all prompts. `directory` is optional (default: the current directory). @@ -300,6 +300,14 @@ Docker and HTTPS observations have individual cancellation limits and share a 12 Older bundles remain deployable, but acceptance requires both a source-derived migration inventory and compatible servers that publish process identities. Prepare and complete a reviewed bundle through the normal deployment flow before collecting its acceptance receipt. A receipt proves the observed state at its timestamp; it does not guarantee later routing or server state. Repeat acceptance when fresh evidence is needed. +#### Observe retained state before a rollout + +`tale --json deploy observe --spec --cli-ref --deployment-ref --machine-id-sha256 ` collects runtime image identities, migration inventories, corpus and disk metadata, and retained native configuration proof. Run the pinned compiled CLI on the admitted Linux host with its local Docker socket. Supply private JSON on stdin as `{"environment":{"UPPERCASE_ENV_NAME":"value"}}`, containing only the variables the reviewed specification needs; ambient variables are not a fallback. Input is limited to 64 KiB, 128 keys and 8192 bytes per value. + +The observer reuses existing credentials and exact retained account and organization IDs. It reads preserved pack bytes without compiling them again, verifies current native versions, assets and owned-skill owners, and rechecks custody and container identities. It creates only temporary tooling and authentication sessions, then removes the tooling and signs out. It does not provision identities, prepare or apply configuration, migrate, restart, prune or acquire the cutover lock. Docker and native reads are bounded; supervise the command externally to bound filesystem waits too. + +A complete observation returns `ok:true` and `data.complete:true`. Missing legacy custody or ownership returns available host/database facts with `ok:false`, `data.complete:false`, an authored reason code and exit `3`; retain that report for investigation. Malformed input, mismatched identities or changed state refuse the observation. Neither result is Ready acceptance, permission to cut over, nor proof that packs will survive a future deployment. Use the normal reviewed deployment and acceptance flow for those decisions. + #### Provision the native identity `deploy provision [--bundle ]` is the backend-local phase normally invoked by bundle deployment. It reads at most 64 KiB of private JSON from stdin, proves the local account and selected organization, and always signs out before reporting success. Its fields include `origin`, `email`, `password`, `slug`, `name`, `ssoEnabled`, optional Entra credentials, and `nativeClients`. Existing-account behavior remains the default. An explicit `identity.bootstrap: "fresh"` permits creation of the initial local account and organization. A bundle binds this choice and the staged configurations before native changes. `deploy provision` refuses workspace flags and `--dry-run`; use read-only bundle/config verification for review. Its optional `--cli-ref` and `--deployment-ref` expectations require `--bundle` and are checked before login. @@ -414,6 +422,10 @@ Use `agent-tools` to manage only the tool grants of an existing agent. Its `conf Applying this resource requires editor access to the active project and an agent that the platform does not manage. Members can read the narrow configuration. Changes preserve every other agent field, including instructions, model and exact secret grants. The native hash refuses concurrent tool edits; a changed set also invalidates stale full-agent saves. An equivalent set changes no timestamp or audit row. A runtime without the requested capability refuses the operation. Read back the tools after applying, and retain the pending receipt to recover an interrupted apply. +Use `agent-model` to select the serving configuration for future starts of an existing agent. Its `config` requires exact `projectId` and `agentId` values plus `harness`, `model` and an explicit `modelProvider` from the native catalog. The platform validates that combination and its available credentials; it never chooses a different provider. The same project editing permissions and platform-managed-agent restriction apply. Instructions, tools, skills, connectors and secret grants stay unchanged. Queued and running work keeps the complete serving configuration recorded when it was admitted. An equal selection is a no-op; a changed selection invalidates stale full-agent saves. A legacy unset provider appears as `null` in readback, but a declaration must choose one. Use the existing plan, apply and read commands, and retain the receipt if application is interrupted. + +Use `task-review-context` to enroll a pristine operational task for one reviewer. Its `config` contains `projectId`, `taskId`, `reviewerAgentId` and `enabled`. By default the task must already exist, with no execution, review or source-work history. To create it, add `createIfMissing: true` beside `kind` and `config`, and choose a stable UUID for `taskId`. A project editor can then create and enroll the backlog task in one transaction; failed enrollment leaves no task or counter/audit changes. The reviewer must already have `task_review`; enrollment grants no tools and starts no work. Existing tasks still pass the pristine checks, and occupied identities are never overwritten. Keep the same ID and pending receipt after an interruption. Disabling the context preserves its reviewer and purpose. + Retention and DSAR policies require their dedicated native workflows. Pause uploads, synchronization and crawls before changing the embedding model. The CLI checks organization-wide document and website counts; it does not lock ingestion or migrate existing vectors. For an organization with documents or registered websites, a model change requires a separate native indexing migration. A change limited to `minSimilarity`, `maxConcurrentRequests`, `minTokensPerSecond`, `maxTokensPerMinute` or `maxRequestsPerMinute` keeps existing vectors valid, so it skips this check. Instance settings also require the native deployment editor allowlist. Standalone application reports `restartRequired` for boot settings; saving those settings alone does not activate them. Review the plan’s effects before applying. Managed deployments use the same engine through `configuration`. Merge this example into the deployment declaration when an external operator already serves the provider. Replace the synthetic endpoint and catalog with verified values, and inject `EXTERNAL_PROVIDER_SECRET` from your secret manager: @@ -534,6 +546,15 @@ The public `native.configuration` proof records each resource’s intended hash `tale status` — show the current deployment status. No arguments. +`tale deploy smoke --url ` — check a running deployment through its public URL, the way a browser reaches it. Without `--full` it sends no credentials and writes nothing, so you can run it against any deployment, production included. It checks `/api/health` (and the version, with `--expected-version `), the API's readiness, the app shell and its script, an anonymous session read, and that `/events` and `/api/app` refuse a visitor without a session. Plain `http://` is accepted only for `localhost`; for a private certificate authority, set `NODE_EXTRA_CA_CERTS` to its root certificate. + +- `--full` — also sign in as a dedicated account and walk one user journey: open the organization's live-update stream, create a task, wait for its live update, read it back and delete it (an account that may not delete tasks archives it instead). Put the account in `TALE_SMOKE_EMAIL` and `TALE_SMOKE_PASSWORD`; it must not need a second factor. If the account sees no project, the first run creates one named "Tale deployment smoke" and later runs reuse it. +- `--chat` — with `--full`, also run one chat turn on the first model available to the account. The turn spends model tokens; the conversation goes to the trash afterwards, stopped first if the turn is still running. +- `--organization `, `--project ` — where the journey runs; by default, the account's first organization and project. +- `--timeout ` — bound on each request and wait (default `15`); `--turn-timeout ` bounds the chat turn (default `120`). + +With `--json`, the report lists each check with its status (`pass`, `fail` or `skip`), duration and reason. Exit `0` means every check passed, `5` that at least one failed and `2` that an option is invalid. The full journey removes its task (deleted or archived) and signs out even after a failed check. + `tale logs ` — stream a service's logs (`service` is one of the running services; on a dev-only stack with no deployment, it falls back to the dev container). - `-f, --follow` — follow log output as it is written. diff --git a/docs/en/self-hosted/install/kubernetes.md b/docs/en/self-hosted/install/kubernetes.md index bf23763664..b0d671a8b4 100644 --- a/docs/en/self-hosted/install/kubernetes.md +++ b/docs/en/self-hosted/install/kubernetes.md @@ -15,6 +15,7 @@ Tale runs on Kubernetes when you translate the [service contract](/self-hosted/i | Nodes that grant `NET_ADMIN` and provide ip6tables, or allow the IPv6 sysctls | The egress proxy installs its firewall at start and refuses to start without it. | | Ports 80 and 443 reachable at the public address | Caddy obtains certificates itself in `selfsigned` and `letsencrypt` mode. Behind an Ingress that terminates TLS, set `TLS_MODE=external`. | | Pull access to `ghcr.io/tale-project/tale/*` on every node, including the sandbox runtime image | Session Pods start from `SANDBOX_RUNTIME_IMAGE`. A node that cannot pull it fails the first session scheduled there. | +| A container runtime that unpacks zstd-compressed layers, such as containerd 1.5 or later | Tale's images have zstd-compressed layers. A node whose runtime cannot unpack them fails to pull the images, and no Pod starts from them there. | | A sysbox or kata RuntimeClass if agents need Docker inside their sandbox | Without one, keep `SANDBOX_DOCKER_IN_CONTAINER=false`. The `runc` tier would need privileged Pods. | | `kubectl` and `envsubst` on the machine that applies the manifests | The manifests carry one `${VERSION}` variable that kubectl does not expand. | @@ -40,7 +41,7 @@ Every Pod below sets `enableServiceLinks: false`. Kubernetes otherwise injects D | `proxy` | Deployment with strategy `Recreate`; `hostPort` 80 and 443; PVC for `/data` | The certificate store survives restarts on the PVC. | | `sandbox` | ServiceAccount, Role, RoleBinding, Deployment; Service on 8003 | `SANDBOX_BACKEND=kubernetes`; `config-data` read-only at `/app/platform-config`. No Docker socket. | | `sandbox-egress` | Deployment; Service on 3128 | The shipped capability set, no sysctls. | -| `sandbox-llm-gateway` | Deployment with strategy `Recreate`, PVC at `/app/data`; Services `sandbox-llm-gateway` and `llm-gateway` on 8080 | The image runs as uid 1000; `fsGroup: 1000` lets it write its state. It reads `SANDBOX_LLM_GATEWAY_ADMIN_PASSWORD` from `tale-env`: until it has an admin account, it creates one only for a caller that presents that secret. | +| `sandbox-llm-gateway` | Deployment with strategy `Recreate`, PVC at `/app/data`; Services `sandbox-llm-gateway` and `llm-gateway` on 8080 | The image runs as uid 1000; `fsGroup: 1000` lets it write its state. It reads `SANDBOX_LLM_GATEWAY_ADMIN_PASSWORD` from `tale-env`: until it has an admin account, it creates one only for a caller that presents that secret. With `terminationGracePeriodSeconds: 90`, a rollout gives the old Pod up to 90 seconds to finish the model calls in flight, streamed answers included; it saves its spend counters at the end only when they finish within 30 seconds of the stop. It takes no new call meanwhile, and the new Pod starts once it has exited. | | `bgutil-provider` | Deployment; Service on 4416 | Optional video-token provider. | The probes translate the Compose health checks: @@ -53,7 +54,7 @@ The probes translate the Compose health checks: | `object-store` | none | `mc ready local` | none | | `proxy` | none | `GET /health` on 2020 | none | | `sandbox` | `GET /health` on 8003 | `GET /health` on 8003 | none | -| `sandbox-egress` | none | `curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/` | none | +| `sandbox-egress` | none | `curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/ && nslookup -type=a -timeout=1 sandbox-egress-health.invalid 127.0.0.1` | none | | `sandbox-llm-gateway` | none | `GET /health` on 8080 | none | Kubernetes has no `depends_on`. A backend role that starts before Postgres answers exits once with `ECONNREFUSED`, and the restart policy heals it. @@ -505,8 +506,9 @@ spec: add: ['NET_ADMIN', 'DAC_OVERRIDE', 'CHOWN', 'SETUID', 'SETGID', 'NET_BIND_SERVICE', 'KILL'] ports: [{ name: proxy, containerPort: 3128 }] readinessProbe: - exec: { command: [sh, -c, "curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/"] } + exec: { command: [sh, -c, "curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/ && nslookup -type=a -timeout=1 sandbox-egress-health.invalid 127.0.0.1"] } periodSeconds: 10 + timeoutSeconds: 5 resources: requests: { cpu: 50m, memory: 64Mi } limits: { memory: 512Mi } @@ -544,6 +546,7 @@ spec: spec: enableServiceLinks: false automountServiceAccountToken: false + terminationGracePeriodSeconds: 90 securityContext: { fsGroup: 1000 } containers: - name: gateway @@ -642,14 +645,113 @@ spec: | `SANDBOX_K8S_NAMESPACE` | The namespace the session Pods, Secrets, and workspace claims are created in; the spawner's own namespace in this layout. Defaults to `tale-sandbox`. | | `SANDBOX_RUNTIME_IMAGE` | The matching Tale sandbox runtime image, available to every node. | | `NODE_EXTRA_CA_CERTS` | The cluster CA file, normally `/var/run/secrets/kubernetes.io/serviceaccount/ca.crt` inside the spawner. It is the only CA-trust mechanism the spawner honors; keep TLS verification on. | -| `SANDBOX_K8S_WORKSPACE_SIZE_LIMIT` | The size of each agent session's `/agent` workspace claim, default `4Gi`; also bounds a crawler render's temporary workspace, which needs no claim because it is never resumed, and the inner Docker temporary store when that is enabled. | +| `SANDBOX_K8S_WORKSPACE_SIZE_LIMIT` | The size of each agent session's `/agent` workspace claim, default `4Gi`; also bounds a crawler render's temporary workspace, which needs no claim because it is never resumed. | +| `SANDBOX_K8S_DOCKER_STORAGE_SIZE_LIMIT` | The size of the inner Docker temporary store of an agent session that runs Docker inside its sandbox, default `20Gi`. A session that outgrows it is evicted, so size it for the largest images your agents pull and build. Releases before this setting sized the store with `SANDBOX_K8S_WORKSPACE_SIZE_LIMIT`: if you lowered that to keep the store small, set this variable as well when you upgrade, or the store grows to `20Gi`. The spawner warns at start when `SANDBOX_K8S_WORKSPACE_SIZE_LIMIT` is set without it. | +| `SANDBOX_K8S_EPHEMERAL_STORAGE_REQUEST` / `SANDBOX_K8S_EPHEMERAL_STORAGE_LIMIT` | How much of the node's disk a session Pod requests, default `256Mi`, and how much it may write there outside its temporary workspace and Docker store, default `2Gi`. A Pod's limit adds those stores: `2Gi` for an agent, `6Gi` for a crawler render, `22Gi` with Docker inside the sandbox. An agent session past its limit is evicted on its own and the next task resumes it with its workspace intact, instead of filling the node until Kubernetes evicts the platform's Pods. On nodes that report no ephemeral-storage capacity, as on some rootless clusters, set the request to `0`. | | `SANDBOX_K8S_CPU_REQUEST` / `SANDBOX_K8S_MEMORY_REQUEST` | What every session Pod requests from the scheduler, as Kubernetes quantities. Unset, an agent Pod requests `250m` and `512Mi` (`1Gi` with Docker inside the sandbox) and a crawler render `250m` and `512Mi`; a request never exceeds the Pod's limit. Raise them when agents on your nodes run heavier builds than this, so the scheduler does not place more sessions than a node can hold. | +| `SANDBOX_K8S_NODE_SELECTOR` / `SANDBOX_K8S_TOLERATIONS` | Optional. The node labels every session Pod must match, as a JSON object, and the taints it tolerates, as a JSON array of Pod tolerations. Unset, sessions can run on any node; see below. | +| `SANDBOX_K8S_PRIORITY_CLASS` | Optional. The PriorityClass of every session Pod. | | `SANDBOX_K8S_CACHE_STORAGECLASS` | The StorageClass for workspace claims; unset uses the cluster default. | | `SANDBOX_RUNTIME` / `SANDBOX_RUNTIME_CLASS` | A supported runtime tier and, when needed, the installed RuntimeClass name. | | `SANDBOX_EGRESS_PROXY` | The egress Service the sessions use, default `http://sandbox-egress:3128`. | The spawner scales horizontally. Any replica resolves a session it did not create by its deterministic Pod name and adopts it, so exec, stop, and destroy work through whichever replica the Service picks. `SANDBOX_MAX_SESSIONS` counts the namespace, but simultaneous admissions on several replicas can exceed it briefly; use a ResourceQuota for a hard bound. The [sandbox Kubernetes contract](https://github.com/tale-project/tale/blob/main/services/sandbox/docs/kubernetes.md) documents the Pod shape and runtime details. +### Keep sessions off the platform's nodes + +Session Pods run the code your agents write, and with Docker inside the sandbox on the `runc` tier they run privileged. Without placement settings, the scheduler puts them on any node, next to Postgres and the application roles, where a busy session competes for the same CPU, memory, and disk. To give sessions nodes of their own, label and taint those nodes: + +```bash +kubectl label node tale.dev/sandbox=true +kubectl taint node tale.dev/sandbox=true:NoSchedule +``` + +Then add the matching settings to the spawner's `env` in `40-sandbox.yaml`: + +```yaml + - { name: SANDBOX_K8S_NODE_SELECTOR, value: '{"tale.dev/sandbox":"true"}' } + - { name: SANDBOX_K8S_TOLERATIONS, value: '[{"key":"tale.dev/sandbox","operator":"Exists","effect":"NoSchedule"}]' } + - { name: SANDBOX_K8S_PRIORITY_CLASS, value: tale-sandbox-session } +``` + +The taint keeps other Pods off those nodes, and the selector keeps sessions on them. The PriorityClass ranks sessions below the platform: the scheduler may preempt a session to place a platform Pod, and when a node runs short of memory or disk, the kubelet takes priority into account and evicts sessions sooner. With `preemptionPolicy: Never`, a session never preempts another Pod itself. A cluster administrator creates the class once; the spawner needs no extra permission: + +```yaml +apiVersion: scheduling.k8s.io/v1 +kind: PriorityClass +metadata: { name: tale-sandbox-session } +value: -10 +preemptionPolicy: Never +globalDefault: false +description: Tale sandbox sessions yield to the platform. +``` + +The settings apply to every session Pod, crawler renders included, for the sessions the spawner creates after its restart; running sessions keep their placement. A malformed value stops the spawner at start. A valid selector that no node matches, or a taint the tolerations miss, leaves a session Pod pending: the spawner logs the scheduler's reason, and the create fails with that reason once its startup budget runs out. With node-local storage, a stopped session's workspace claim stays on its node, so keep that node inside the selector or the session cannot resume. + +### Pre-pull the sandbox images + +The spawner does not pull images on Kubernetes; the kubelet does, per Pod. The first session on a node therefore pulls the runtime image, a download of about 2 GB, inside its startup budget (`SANDBOX_SESSION_CREATE_TIMEOUT_MS`, 180 seconds by default), and the kubelet's image garbage collection can remove the image again once no Pod uses it. This optional DaemonSet pulls the sandbox images onto every node before the first session and keeps them there: each init container starts one image and exits at once, the pause container keeps the Pod alive, and while the Pod exists the kubelet counts those images as in use. Each container requests 1m of CPU and 4 MiB of memory. + +```yaml +# 45-sandbox-prepull.yaml +apiVersion: apps/v1 +kind: DaemonSet +metadata: { name: sandbox-image-prepull, namespace: tale } +spec: + selector: { matchLabels: { app: sandbox-image-prepull } } + updateStrategy: { rollingUpdate: { maxUnavailable: 25% } } + template: + metadata: { labels: { app: sandbox-image-prepull } } + spec: + enableServiceLinks: false + automountServiceAccountToken: false + terminationGracePeriodSeconds: 0 + # Match SANDBOX_K8S_NODE_SELECTOR and SANDBOX_K8S_TOLERATIONS when you set them: + # nodeSelector: { tale.dev/sandbox: 'true' } + # tolerations: [{ key: tale.dev/sandbox, operator: Exists, effect: NoSchedule }] + securityContext: + runAsNonRoot: true + runAsUser: 65534 + runAsGroup: 65534 + seccompProfile: { type: RuntimeDefault } + initContainers: + - name: runtime + image: ghcr.io/tale-project/tale/tale-sandbox-runtime:${VERSION} + command: [sh, -c, 'exit 0'] + resources: { requests: { cpu: 1m, memory: 4Mi }, limits: { memory: 32Mi } } + securityContext: { allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities: { drop: [ALL] } } + - name: egress + image: ghcr.io/tale-project/tale/tale-sandbox-egress:${VERSION} + command: [sh, -c, 'exit 0'] + resources: { requests: { cpu: 1m, memory: 4Mi }, limits: { memory: 32Mi } } + securityContext: { allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities: { drop: [ALL] } } + - name: gateway + image: ghcr.io/tale-project/tale/tale-sandbox-llm-gateway:${VERSION} + command: [sh, -c, 'exit 0'] + resources: { requests: { cpu: 1m, memory: 4Mi }, limits: { memory: 32Mi } } + securityContext: { allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities: { drop: [ALL] } } + containers: + - name: pause + image: registry.k8s.io/pause:3.10 + resources: { requests: { cpu: 1m, memory: 4Mi }, limits: { memory: 16Mi } } + securityContext: { allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities: { drop: [ALL] } } +``` + +The runtime image is the one that matters: every session Pod and its egress sidecar start from it. The egress and gateway images spare a pull when those Deployments move to another node; remove their init containers when sessions run on dedicated nodes those Deployments never use. If you set `SANDBOX_K8S_NODE_SELECTOR` and `SANDBOX_K8S_TOLERATIONS`, give the DaemonSet the same values so it runs on exactly the session nodes. + +The image tags follow `${VERSION}` like every other file. Apply this file on its own, before the loop, and wait until every node has pulled the images; on an upgrade, the new runtime image is then in place before the spawner rolls to it and creates sessions from it. The first command creates the namespace on a first install and changes nothing on an upgrade: + +```bash +envsubst '${VERSION}' < 00-namespace.yaml | kubectl apply -f - +envsubst '${VERSION}' < 45-sandbox-prepull.yaml | kubectl apply -f - +kubectl -n tale rollout status ds/sandbox-image-prepull --timeout=15m +for f in 00-namespace.yaml 10-stores.yaml 20-application.yaml 30-proxy.yaml 40-sandbox.yaml; do + envsubst '${VERSION}' < "$f" | kubectl apply -f - +done +``` + +Run the same commands for every upgrade, with the new `VERSION` exported. A copy applied without `envsubst`, or left out of an upgrade, keeps its old tags: it holds old images on the nodes, and the first session on each node pulls the new one again. + ### What the spawner enforces At start the spawner applies the NetworkPolicy `tale-sandbox-session-egress`: session Pods may reach DNS and the Pods of their own namespace and nothing else, so the cloud metadata service, the nodes, and other namespaces stay unreachable even for a process that ignores `HTTP_PROXY`. Public destinations pass through `sandbox-egress`. A missing `networkpolicies` permission is logged and does not stop the spawner; verify that the policy exists before you admit workloads. @@ -702,4 +804,4 @@ The CLI's snapshots, blue-green flips, and rollback checks do not run on Kuberne ## Verified scope -These five files were applied unchanged, apart from the Secret values, to a fresh single-node kind cluster with Kubernetes 1.36, kube-network-policies, the local-path StorageClass, and Tale 0.5.31: boot and migrations, the public edge, the first-owner setup and the Sandboxes card, an agent task with a deliverable, the session lifecycle including idle stop, resume, and cross-replica access, the fence probes above, and a rolling restart of the API with two replicas. Multi-node scheduling with `ReadWriteMany` configuration storage, Docker inside sessions on a sysbox or kata RuntimeClass, an Ingress with `TLS_MODE=external`, and highly available stores were not part of that run. +These five files were applied unchanged, apart from the Secret values, to a fresh single-node kind cluster with Kubernetes 1.36, kube-network-policies, the local-path StorageClass, and Tale 0.5.31: boot and migrations, the public edge, the first-owner setup and the Sandboxes card, an agent task with a deliverable, the session lifecycle including idle stop, resume, and cross-replica access, the fence probes above, and a rolling restart of the API with two replicas. Multi-node scheduling with `ReadWriteMany` configuration storage, Docker inside sessions on a sysbox or kata RuntimeClass, an Ingress with `TLS_MODE=external`, and highly available stores were not part of that run. The node-disk limits and placement settings of session Pods and the optional pre-pull DaemonSet came later and were not part of it either. diff --git a/docs/en/self-hosted/install/own-compose.md b/docs/en/self-hosted/install/own-compose.md index 8ec8b0374a..4939c0f27a 100644 --- a/docs/en/self-hosted/install/own-compose.md +++ b/docs/en/self-hosted/install/own-compose.md @@ -20,7 +20,7 @@ The packaged layout keeps `tale_app` and `tale_knowledge` in one Postgres servic ## Pin compatible images -Set `VERSION` in Compose's `.env` to the Tale release you have reviewed and tested. Export that same value in your shell when running the separate runtime-image pull below. Keep Tale images on one release; the two upstream services have their own pinned versions. +Set `VERSION` in Compose's `.env` to the Tale release you have reviewed and tested. Export that same value in your shell when running the separate runtime-image pull below. Keep Tale images on one release; the two upstream services have their own pinned versions. Tale's images have zstd-compressed layers, so the Docker host needs Docker Engine 24.0 or later. | Service | Image | | --- | --- | @@ -167,6 +167,7 @@ Configure `BACKEND_UPSTREAM=backend-api:3005` on the proxy. For bundled file sto | Egress IPv6 | `sysctls` with `net.ipv6.conf.all.disable_ipv6: '1'` and `net.ipv6.conf.default.disable_ipv6: '1'`, as in the shipped stack. The egress firewall fails closed: it needs working IPv6 firewall support or IPv6 disabled for the default and every interface, and a container cannot write those sysctls itself through a read-only `/proc/sys`. Without them the proxy refuses to start on a kernel without the `ip6_tables` module; see [Sandbox infrastructure](/self-hosted/configuration/environment-reference#sandbox-infrastructure). | | Postgres shutdown | `stop_signal: SIGINT`, `stop_grace_period: 60s`, `shm_size: 256mb` in the reference stack. | | Web, backend and spawner shutdown | Allow the stop grace: 45 seconds for the web tier, 30 for `backend-api`, 120 for `backend-worker` and 30 for the spawner. A stopping worker hands its automation runs on within it (`SHUTDOWN_DRAIN_MS`); coordinate other active work before stopping. | +| Gateway shutdown | `stop_grace_period: 90s`. A stopping gateway takes no new model call, lets the calls in flight finish, streamed answers included, and saves its spend counters at the end only when that drain ends within 30 seconds of the stop. Docker's 10-second default cuts longer answers. | Keep `db-backup` if your database tooling writes to `/var/lib/postgresql/backup`; mounting it alone does not create a backup schedule. Older `convex-data` configuration volumes need a deliberate transfer into `config-data`, not deletion. Preserve the old copy until verified. @@ -182,7 +183,7 @@ Keep `db-backup` if your database tooling writes to `/var/lib/postgresql/backup` | `db` | `pg_isready -U tale && [ -f /tmp/.db_ready ]` | Postgres and initialization are ready; adapt the user to your configuration. | | `object-store` | `mc ready local` | Bundled MinIO readiness. | | `sandbox` | `curl -fsS http://127.0.0.1:8003/health` | Spawner readiness after runtime-image preparation. | -| `sandbox-egress` | `curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/` | The proxy answers a non-proxy request itself (400 page), so this proves it serves without reaching a third-party website. Do not probe the port with a bare TCP connect: tinyproxy logs every connect-and-close at error level, one line per interval. | +| `sandbox-egress` | `curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/ && nslookup -type=a -timeout=1 sandbox-egress-health.invalid 127.0.0.1` | The proxy answers a non-proxy request itself (400 page), so this proves it serves without reaching a third-party website. dnsmasq then answers a name from its own configuration, which proves the DNS forwarder for nested containers and builds answers, without an upstream lookup. Do not probe the port with a bare TCP connect: tinyproxy logs every connect-and-close at error level, one line per interval. | | `sandbox-llm-gateway` | `wget -q -O /dev/null http://127.0.0.1:8080/health` | Use the image's available client; it does not ship `curl`. | Give cold starts enough time: downloading the sandbox runtime can take longer than a warm-host probe budget. A successful readiness probe does not prove file access, model credentials, or an entire user task. Check those separately. diff --git a/docs/en/self-hosted/install/quickstart.md b/docs/en/self-hosted/install/quickstart.md index 59a2fc6793..547e92e2f7 100644 --- a/docs/en/self-hosted/install/quickstart.md +++ b/docs/en/self-hosted/install/quickstart.md @@ -8,7 +8,7 @@ Run Tale locally with the published CLI, then create your workspace and send a m You need: -- macOS, Linux or Windows with PowerShell, and Docker running Linux containers with Compose. Docker Desktop includes Compose on macOS and Windows. If Docker is missing, `tale dev` offers to help install it. +- macOS, Linux or Windows with PowerShell, and Docker Engine 24.0 or later running Linux containers with Compose. Docker Desktop includes Compose on macOS and Windows. If Docker is missing, `tale dev` offers to help install it; with an older engine, it stops before downloading any image. - Network access to GitHub for the CLI and container registries for the images. The first start downloads several GB; leave room for the images and your data. - A supported model provider credential for the first reply. You can create the account and explore the application before connecting a provider. @@ -42,7 +42,7 @@ irm https://raw.githubusercontent.com/tale-project/tale/main/scripts/install-cli Run `tale --version` in the same terminal to confirm installation. If the command is missing, follow the installer’s `PATH` guidance and reopen any terminals that were already open. The [CLI installation guide](/self-hosted/install/cli-install) covers pinned versions and custom installation directories. -Check `tale --help` before using `tale doctor`. If `doctor` is not listed, run `docker info` and `docker compose version` to check Docker and Compose. When available, `tale doctor` also checks container architecture and local ports without installing software or changing files. Follow any reported recovery steps; a passing check does not verify image downloads or model access. +Check `tale --help` before using `tale doctor`. If `doctor` is not listed, run `docker info` and `docker compose version` to check Docker and Compose. When available, `tale doctor` also checks the Docker Engine version, container architecture and local ports without installing software or changing files. Follow any reported recovery steps; a passing check does not verify image downloads or model access. ## Initialize and start diff --git a/docs/en/self-hosted/operate/container-architecture.md b/docs/en/self-hosted/operate/container-architecture.md index 1fb9e53bc5..e21aad63c9 100644 --- a/docs/en/self-hosted/operate/container-architecture.md +++ b/docs/en/self-hosted/operate/container-architecture.md @@ -39,6 +39,20 @@ The runtime also supplies Chromium and Playwright for page rendering and documen The egress service blocks private and metadata destinations and can enforce a hostname allowlist. An unavailable egress path can cause refusals or network failures; the precise error depends on the operation. [Hardening](/self-hosted/operate/security/hardening) describes the policy, and [Run Compose yourself](/self-hosted/install/own-compose) lists required capabilities and mounts. +## Keep sessions running through a Docker restart + +Sandbox sessions and the spawner run as containers of the host's Docker daemon. Unless the daemon's live restore is on, restarting it, for a package upgrade or a change to `/etc/docker/daemon.json`, stops them all: running agent turns, builds and page renders end, while their workspaces are kept. Tale leaves the host's daemon configuration to you; the spawner logs a warning at start while live restore is off. + +To turn it on, add the setting to `/etc/docker/daemon.json`, keeping the file's other entries: + +```json +{ + "live-restore": true +} +``` + +Then reload the daemon with `sudo systemctl reload docker`, or send `SIGHUP` to `dockerd` on a host without systemd. A reload applies the setting without stopping containers. Live restore keeps containers running across a daemon restart and a patch-release upgrade; an upgrade to a new Docker release line can still stop them, so plan it like a maintenance window. Live restore is incompatible with Swarm mode: on a Swarm node, schedule daemon restarts as maintenance instead. [Docker's live restore guide](https://docs.docker.com/engine/daemon/live-restore/) lists the remaining limits. + ## Recognize knowledge-index repair A damaged BM25 index can cause ingestion failures even when the underlying document tables remain readable. The backend checks knowledge indexes with `pdb.verify_index`; an advisory lock coordinates repair attempts for a database. Organization-specific databases are checked when they are first used. diff --git a/docs/en/self-hosted/operate/observability/troubleshooting.md b/docs/en/self-hosted/operate/observability/troubleshooting.md index bc95f49265..37e187a0de 100644 --- a/docs/en/self-hosted/operate/observability/troubleshooting.md +++ b/docs/en/self-hosted/operate/observability/troubleshooting.md @@ -85,6 +85,10 @@ A healthy egress process does not prove that the remote host, DNS, certificate, When many sessions install packages or load pages at once and connections fail with resets while the proxy stays healthy, the proxy may have reached `SANDBOX_EGRESS_MAX_CLIENTS`, the connections it serves at once for all sessions together. Its log then reports that the maximum number of connections was reached. Raise the value, together with the egress container's process and open-file limits, and recreate the egress service. +When one session's connections fail with resets while other sessions still reach the same hosts, that session may already hold `SANDBOX_EGRESS_MAX_CONNECTIONS_PER_SESSION` connections (256 by default), and the proxy refuses its next ones until some close. Raise the value, or set `0` to turn the cap off, and recreate the egress service. + +A recreated `sandbox-egress` service (after a deploy or a stack restart) can come back at another address, while sessions that were already running keep sending their traffic to the old one and lose network access. The sandbox service recycles each such session as soon as it is released and idle, and logs `recycling `; the next use starts it again with its workspace intact. A session still in use keeps failing until its work ends, and a pinned session keeps running until you unpin or stop it. + ## Writes fail or storage fills up Check application-database connectivity, free space, connection usage, and locks. Stop avoidable growth and follow your database procedure to recover capacity. Do not delete volume contents, reset encryption keys, or assume failed writes will replay after a restart. Retry the original operation only after checking whether it persisted. diff --git a/docs/en/self-hosted/operate/upgrades.md b/docs/en/self-hosted/operate/upgrades.md index b84c632782..fe2c873a30 100644 --- a/docs/en/self-hosted/operate/upgrades.md +++ b/docs/en/self-hosted/operate/upgrades.md @@ -59,12 +59,12 @@ The old API is drained before removal: new chat turns can receive a drain refusa The drain covers automations too. Workers of the old colour start no new job and hand each automation run on at its next step, so the run continues on the new colour; the CLI waits for those steps within the same three minutes. When the old containers stop, each worker gets 120 seconds to hand on what it still holds (more when you raise `SHUTDOWN_DRAIN_MS`: the CLI keeps this grace 15 seconds above it), and a step still working 20 seconds into its stop is interrupted and runs again on the new colour. A step that was sending something to an outside service is the exception, because the service may already have received it: that run waits for a person to choose how it continues, as [Read automation runs and recover from failures](/platform/automations/execution-logs) describes. The first upgrade to automation writer protocol 2 is different: the migration holds all older queued, running and waiting runs, preserving their previous state and unknown external outcomes. They do not resume automatically. Work already admitted or sent by an old worker may still finish; an explicit stop request records the operator and requests cancellation of the owned session, but proves neither termination nor the outcome of an external write. It does not release the held task or its evidence. Review the actual outcome before planning any replacement work. +The model gateway is replaced in place before the new colour starts. When its container stops, the gateway takes no new model call and gives the calls in flight, streamed answers included, up to 90 seconds to finish. It saves its spend counters at the end only when that drain ends within 30 seconds of the stop, since the gateway's own cleanup window counts from the stop signal. A call still streaming after that is answered in full, but its spend, and that of the seconds before it, may not be booked. Until the new gateway answers, a new model call fails, and an answer still streaming after 90 seconds is cut. A deployment can therefore wait up to 90 seconds for the gateway. + Both colours mount the deployment's `static-assets` volume. Before a web replica becomes ready, it publishes the build's immutable scripts, styles, fonts and images there. Either colour can then serve assets referenced by the other colour's HTML. Running replicas refresh their artifacts hourly; retired artifacts remain available for seven days after their last refresh. Mount this shared volume on every web replica in your own Compose setup too. During the first upgrade from a release without this support, the old replicas still lack the shared fallback. An open tab normally keeps working across the handover. If a required part is no longer available, Tale waits until its API and database answer, then reloads once. If the part still cannot load, it shows **A new version is available** with a **Reload** action instead of repeating the reload. During an outage, the connection notice stays visible. Failed reads refresh when connectivity returns; failed writes are not submitted again automatically. -Once the services are updated, the CLI removes Tale's images of versions older than both the new version and the recorded rollback target, so the host keeps two releases of images rather than every release it ever ran. It never forces a removal: an image a container still uses, such as a service left running on an older version or a sandbox session that started before the deploy, stays until a later deploy finds it free. Images loaded ahead for a later version stay as well. - If the new group does not become healthy within `HEALTH_CHECK_TIMEOUT`, the deploy does not complete the flip. Inspect the recorded deployment state and logs before retrying. An interrupted rollout can leave both groups or pending handover state; use the CLI's recovery output rather than deleting containers or state files by hand. ## Check migrations and the user outcome diff --git a/docs/en/self-hosted/overview.md b/docs/en/self-hosted/overview.md index b2952aef05..f3d7afe825 100644 --- a/docs/en/self-hosted/overview.md +++ b/docs/en/self-hosted/overview.md @@ -31,7 +31,7 @@ The application roles use the same Tale platform image. `TALE_ROLE=api` starts t | `config-data` | Organization configuration files, including agents, skills, provider definitions, governance settings, SSO configuration, and branding. | | `object-store-data` | Uploaded documents, attachments, audio, and generated files. | | `caddy-data`, `caddy-config` | Certificates and proxy state. | -| `llm-gateway-data` | Gateway configuration, session access state, and the gateway's request log of model, tokens and timing, without prompts or answers. | +| `llm-gateway-data` | Gateway configuration, session access state, and the gateway's request log of model, tokens and timing, without prompts or answers, kept for three days by default. | The packaged stack puts the two databases in one Postgres service and exposes its knowledge connection through the `knowledge-db` network alias. They remain separate databases. A source Compose deployment with a separate knowledge service also has `knowledge-db-data`. diff --git a/docs/en/tutorials/editor/workflow-with-approvals.md b/docs/en/tutorials/editor/workflow-with-approvals.md index a2f2891a03..4d26d2e603 100644 --- a/docs/en/tutorials/editor/workflow-with-approvals.md +++ b/docs/en/tutorials/editor/workflow-with-approvals.md @@ -60,7 +60,7 @@ If that name already exists, uploading adds another version. Use a different wor On **Editor**, click **Test run**. This example has no runtime input, so it can run with an empty object. Switch to **Runs**. The list should show a **Succeeded** test run. -Open the run and check that the canvas shows both nodes as **Ran**. Select `send` and inspect its resolved input. The recipient should be `reviewer@example.com`, the subject `Approval practice`, and the text the sentence from `draft`. The connector uses a deterministic mock in this mode. No email is sent and no approval card appears. +Open the run and check that the canvas marks both nodes **Succeeded**. Select `send` and inspect its resolved input. The recipient should be `reviewer@example.com`, the subject `Approval practice`, and the text the sentence from `draft`. The connector uses a deterministic mock in this mode. No email is sent and no approval card appears. The workflow includes a test expecting the `imap-smtp.send` effect. A passing mock confirms the graph and proposed call; it does not prove mailbox credentials or message delivery. diff --git a/docs/fr/develop/api-reference.md b/docs/fr/develop/api-reference.md index 71a878d2ad..489d21e083 100644 --- a/docs/fr/develop/api-reference.md +++ b/docs/fr/develop/api-reference.md @@ -403,7 +403,7 @@ Un instantané de contenu plus récent destiné au contact supprimé donne `409 Pour envoyer du texte dans le corpus de recherche depuis REST, utilise plutôt `POST /api/v1/knowledge-entries`. Cette opération crée une entrée active par sujet et son document associé à un fichier (`sourceProvider: knowledge`, contenu limité à 8 000 caractères). La réponse **201** contient `{ "id", "documentId" }`. Interroge ensuite `GET /api/v1/documents/{documentId}` pour suivre `indexing` ; aucune lecture intermédiaire de l’entrée n’est nécessaire. -Un `PATCH` d’entrée crée une nouvelle version, renvoie ses IDs et relance l’indexation sous le même `documentId`. Si `topic` et `content` sont identiques après suppression des espaces en début et fin de chaîne, aucune version n’est créée et l’ID actif est conservé. Un `PATCH` sur une ligne remplacée donne **409**, `KNOWLEDGE_ENTRY_SUPERSEDED`, avec la ligne active du sujet dans `data.activeId` (et sa remplaçante directe dans `data.supersededBy`) : modifie cette ligne-là, sans remonter la chaîne. Une entrée créée ou remplacée par cette porte porte `source: "api"` (le formulaire de l’application écrit `manual`, la capture de l’assistant `chat`), ce qui permet au tableau des entrées de connaissances de distinguer les trois. Supprimer l’entrée met son document à la corbeille. +Un `PATCH` d’entrée crée une nouvelle version, renvoie ses IDs et relance l’indexation sous le même `documentId`. Si `topic` et `content` sont identiques après suppression des espaces en début et fin de chaîne, aucune version n’est créée et l’ID actif est conservé. Un `PATCH` sur une ligne remplacée donne **409**, `KNOWLEDGE_ENTRY_SUPERSEDED`, avec la ligne active du sujet dans `data.activeId` (et sa remplaçante directe dans `data.supersededBy`) : modifie cette ligne-là, sans remonter la chaîne. Une entrée créée ou remplacée par cette porte porte `source: "api"` (le formulaire de l’application écrit `manual`, la capture de l’assistant `chat` et, depuis le contrat 3.23.0, un agent doté de `knowledge_entry_write` `agent`), ce qui permet au tableau des entrées de connaissances de les distinguer. Supprimer l’entrée met son document à la corbeille. Ces écritures nécessitent le droit de modifier les connaissances. Un Membre en lecture seule reçoit **403**, `KNOWLEDGE_ENTRY_FORBIDDEN`. Si le stockage objet n’accepte pas le contenu en 30 secondes, la réponse est **503**, `KNOWLEDGE_ENTRY_STORE_TIMEOUT`, sans écriture. @@ -451,6 +451,7 @@ Branche ton client sur `indexing.errorCode`, pas sur le texte d’`error`. Le sc | --- | --- | | `unsupported` : `unsupported_type`, `image_no_vision`, `empty`, `not_text`, `malformed` | Remplace ou réexporte la source dans un format pris en charge. Pour `not_text`, fournis du véritable texte UTF-8. `malformed` désigne actuellement un PDF illisible ; un fichier Office corrompu peut plutôt donner `indexer_error`. La route de relance ignore ces codes définitifs, y compris sur une ancienne ligne encore marquée `failed`. | | `failed` : `embedding_upstream`, `indexer_error`, `index_rebuilding` | Le traitement de fond réessaie. Consulte le statut avant de demander un nouvel essai. | +| `failed` : `usage_limit` | Un plafond de budget qui s’applique à la personne pour qui le fichier est indexé — qui l’a téléversé, le propriétaire d’un lecteur synchronisé, l’organisation pour une pièce jointe d’e-mail — est atteint. L’indexation reprend d’elle-même dans l’heure qui suit la réinitialisation ou le relèvement du plafond, après ce qu’elle avait déjà enregistré ; un `retry-indexing` avant cela attend à nouveau. | | `failed` : `embedding_not_configured`, `embedding_provider_refused`, `index_repair_failed` | Fais corriger la configuration du fournisseur, les autorisations ou l’état de l’index par l’opérateur, puis réessaie. `embedding_provider_refused` couvre aussi un modèle qui renvoie des vecteurs d’une autre largeur que celle indiquée dans les réglages, ainsi que des identifiants d’embedding que la plateforme ne peut pas utiliser (aucun configuré, supprimés, désactivés ou illisibles) ; enregistrer des réglages d’embedding corrigés, ou ajouter ou réparer les identifiants qu’utilise le modèle d’embedding, remet en file d’attente chaque document qui a échoué sur le modèle d’embedding. | | `failed` : `secret_detected`, `pii_blocked` | Corrige la source ou la politique de contenu approuvée de l’organisation avant de réessayer. | | `failed` sans `errorCode` | La plateforme a clôturé l’échec sans le classer, le plus souvent parce que l’indexation s’est arrêtée avant la fin (une tâche perdue ou un worker arrêté). N’attends pas de nouvel essai automatique : demande un `retry-indexing`. | @@ -570,12 +571,13 @@ AGENT_ID=$(curl -fsS "$AGENT_URL" \ curl -fsS "$AGENT_URL/$AGENT_ID" \ -H "Authorization: Bearer $TALE_API_KEY" \ -H "X-Organization-Slug: $ORG_SLUG" \ - | jq '.agent | {name, harness, skills, connectors}' + | jq '.agent | {name, handle, harness, skills, connectors}' ``` ```json { "name": "Reviewer", + "handle": "reviewer", "harness": "claude-code", "skills": [], "connectors": [] @@ -598,16 +600,22 @@ Un projet peut contenir au maximum 50 agents. Les noms sont limités à 120 cara Une configuration invalide ou un dépassement de limite donne **400**. Un nom déjà utilisé donne **409**, `PROJECT_AGENT_NAME_TAKEN`, comme les autres conflits de doublon sur cette interface. Retrouve l’agent existant ou choisis un autre nom avant de réessayer. +Chaque agent a aussi un `handle` : ce que tu saisis après `@` pour le mentionner. C’est son nom actuel en lettres minuscules, chiffres et tirets simples : « My Opus Agent #3 » répond donc à `my-opus-agent-3`. Un handle est unique dans son projet : si un autre agent le porte déjà, ou si un membre ou une automatisation de l’organisation y répond déjà, l’agent reçoit le suivant disponible, `-02`, puis `-03` et ainsi de suite. Il en va de même quand un membre ou une automatisation se met plus tard à répondre au handle d’un agent. Renommer un agent lui donne le handle de son nouveau nom, sauf si seules la casse ou la ponctuation changent. Pour t’adresser plus tard à un agent, garde son `id` ; le handle suit le nom (contrat 3.24.0). + Choisis `model` dans le catalogue de l’organisation et précise `modelProvider` si plusieurs fournisseurs servent ce modèle. `tools` doit contenir uniquement des autorisations connues. Une valeur invalide donne **400** avec `PROJECT_AGENT_MODEL_INVALID`, `PROJECT_AGENT_PROVIDER_UNKNOWN` ou `PROJECT_AGENT_TOOL_UNKNOWN`. `task_start_agent` permet à l’agent de mettre au travail un autre agent du même projet sur une tâche (contrat 3.8.0). `task_update_metadata` est une autorisation facultative pour les agents de projet (contrat 3.10.0). Elle permet de modifier la priorité et l’agent assigné à une tâche existante sans lancer d’exécution. La demande indique `taskId`, `priority` et/ou `agentId`, avec la valeur actuelle de chaque champ concerné dans `expected` ; `null` efface une valeur et les champs omis restent inchangés. Construis `expected.assignee` sous la forme `{type, id}` à partir de `assigneeType` et `assigneeId` renvoyés par `task_get`, ou utilise `null` sans assignation ; une priorité absente vaut également `null`. Une valeur périmée entraîne le refus de toute la demande. Le [guide des agents de projet](/fr/platform/projects/project-agents) explique la protection des exécutions actives et des revues en attente. `task_upsert_by_external_ref` continue d’utiliser `priority` uniquement lors de la création d’une tâche. `task_delegate_review` est une permission distincte, explicitement accordée à un agent de projet, pour transférer une relecture enregistrée en attente d’un agent à un autre. Transmets `{taskId, reviewerAgentId, expected: {approvalId, runId, evidenceRevision, reviewer: {kind: "agent", agentId}}, reason}` avec des UUID natifs complets et un motif non vide de 2 000 caractères au plus. Les champs inconnus sont refusés. L’appel exige une exécution active du manager avec une autorité sur tout le projet, sa permission actuelle, un destinataire admissible et indépendant, ainsi qu’une source et des éléments inchangés. L’agent qui a réalisé la source enregistrée est refusé comme manager. Il préserve le responsable de l’implémentation, l’état, les attributions futures et les permissions, sans lancer d’exécution. `task_get.reviewDelegation` expose le reçu historique validé du transfert vers la dernière relecture ; lis `pendingReview` pour connaître l’attribution actuelle. Une répétition identique exige la même exécution émettrice encore autorisée ainsi qu’une approbation suivante toujours en attente et des éléments inchangés. Les relectures humaines et liées à un workflow restent protégées. Voir [la réattribution des relectures](/fr/platform/projects/task-automation#delegate-review). +`knowledge_entry_write` est une permission facultative pour les agents de projet et les étapes d’agent des automatisations (contrat 3.23.0). Elle enregistre un fait comme entrée de connaissances de toute l’organisation, identifiée par son sujet : transmets `{topic, content, expectedVersionId?}`, avec un sujet de 120 caractères au plus et un contenu de 8 000 caractères au plus. Un sujet sans entrée en reçoit une nouvelle. Modifier une entrée existante exige `expectedVersionId`, la version que l’agent a lue : l’`id` que `knowledge_entry_find` renvoie depuis le contrat 3.23.0, ou la `versionId` de son dernier enregistrement. Sans elle, ou si cette version a été remplacée entre-temps, rien n’est enregistré ; la réponse contient alors la version actuelle et son texte, dans lequel l’agent intègre sa modification. Enregistrer à nouveau le texte actuel n’écrit rien. Ce qu’un agent enregistre porte `source: "agent"`, nomme l’agent dans `createdBy` et est consigné dans le journal d’audit sous `knowledge_entry.created` ou `knowledge_entry.updated`. Une exécution lancée par un membre, qui ne peut travailler que sur sa propre tâche, est refusée (`member_run`). Les enregistrements des agents relèvent d’une limite de débit propre à chaque organisation, distincte de celle des modifications faites par des personnes. L’indexation est asynchrone : `knowledge_entry_find` liste une entrée enregistrée immédiatement, `rag_search` seulement une fois qu’elle est indexée. + `task_review` ajoute une permission facultative pour les agents de projet dans le contrat 3.11.0. Elle décide uniquement d’une relecture native en attente attribuée à l’agent relecteur actif, pour une exécution terminée d’un autre agent du même projet. Transmets `taskId`, `expected: {approvalId, runId, evidenceRevision}` depuis le `task_get.pendingReview` actuel, `decision: "approve" | "request_changes"`, un `feedback` non vide et `evidence: {checks, pullRequests}`. Chaque vérification indique son résultat (`passed` ou `failed`) et des précisions ; une Pull Request GitHub fournie indique son URL, le `headSha` exact et l’état de ses contrôles. L’approbation exige la réussite de toutes les vérifications fournies. Les éléments GitHub sont attestés par l’agent ; Tale ne les vérifie pas auprès du service distant. L’outil vérifie à nouveau la permission actuelle, les droits de l’exécution active qui l’appelle, le relecteur enregistré, l’exécution de réalisation et la révision des éléments locaux. Un résultat périmé exige une nouvelle lecture ; changer l’assignation actuelle ne rend pas le relecteur indépendant. L’approbation passe la tâche à `done` ; `request_changes` la passe à `todo` avec un retour, sans démarrer d’exécution, même si ce retour contient une mention. Les compétences humaines requises et les approbations de workflows restent hors de cet outil. Il n’existe aucun point d’entrée REST public pour une décision d’agent. +Depuis le contrat 3.25.0, un agent qui travaille sur d’autres tâches est lancé quand même : chacune de ses exécutions travaille dans un worker d’agent distinct. Le `task_start_agent` natif et l’étape d’automatisation `task.start_agent` ne répondent plus `agent_busy` ni `busyTaskId`. Un lancement répond `started: true`, et une exécution qui attend un worker libre porte `waitingReason` : `org_limit` (tous les workers d’agent de l’organisation sont occupés), `host` (l’hôte des sandboxes est plein), `destroy_pending` (l’espace de travail qu’elle utiliserait est en cours de suppression) ou `exec_limit` (sa sandbox termine encore un processus précédent). Une telle exécution démarre d’elle-même ; ne la relance pas. Un agent qui se désigne lui-même pour une autre tâche est refusé avec `self_start`. Le `task_get.agentRuns` natif porte `waitingReason` tant qu’une exécution attend. Aucune opération REST ne change. + Depuis le contrat 3.15.0, le `task_get.agentRuns` natif contient un booléen explicite `retryPending`. Seule la dernière exécution en échec d’un agent encore présent peut avoir la valeur `true`, selon les mêmes vérifications de tentative prévue, de refus définitif et de quota restant que la carte de tâche. Laisse cette tentative se poursuivre. `false` n’autorise pas une relance et ne donne pas l’heure de réinitialisation du fournisseur ; si le champ manque sur une ancienne plateforme, cet état est inconnu. Avant toute action, relis la tâche, son responsable, ses exécutions et sa revue, puis respecte les délais du fournisseur et tout `retryAfter` renvoyé lors d’un refus de démarrage. Aucun point d’accès REST public ni texte d’erreur brut n’est ajouté. Le contrat 3.13.0 ajoute un démarrage protégé de correction au droit natif `task_start_agent` existant : passe `{taskId, resumeFrom: {kind: "review_repair", approvalId, runId}, feedback?}` pour une décision native `request_changes` enregistrée. Le serveur détermine l’agent de réalisation, les commentaires et leur identifiant. Il vérifie atomiquement que la même réalisation terminée est toujours la dernière, que l’assignation est inchangée, que le statut est `todo`, qu’aucune revue plus récente ni décision intermédiaire de statut, d’assignation ou d’archivage n’existe et que les limites de démarrage restent respectées. Une `agentId` explicite doit correspondre à cette réalisation ; `moveToInProgress: false` est refusé. La forme `{approvalId, runId}` sans `kind` conserve son sens distinct pour une question en attente. `stale_repair` ne lance rien ; ne réessaie pas sans cette vérification. @@ -648,7 +656,9 @@ Les réponses portent toujours le vrai nom (`"name": "billing/dunning"`) ; la f - `projectIds` indique les projets où l’automatisation est installée. - `description` décrit son rôle. - `inputs` contient le schéma d’entrée de la version déployée ou, à défaut, de la dernière version enregistrée. -- `trigger` contient le type de déclencheur, son activation et `lastFiredAt`, `lastSkippedAt`, `lastSkipReason`. Il vaut `null` si aucun déclencheur n’est configuré. Ces données sont également disponibles dans `GET .../triggers`. +- `trigger` contient le type de déclencheur, son activation, `nextRunAt` et `lastFiredAt`, `lastSkippedAt`, `lastSkipReason`. Il vaut `null` si aucun déclencheur n’est configuré. Ces données sont également disponibles dans `GET .../triggers`. + +Une automatisation installée uniquement dans des projets que le titulaire de la clé ne peut pas lire n’apparaît pas dans la liste, et `GET /api/v1/automations/{name}`, ses versions et ses déclencheurs répondent **404** `AUTOMATION_NOT_FOUND` pour elle, comme pour une automatisation qui n’existe pas ; une automatisation installée nulle part appartient à toute l’organisation. `GET /api/v1/automations/{name}` lit par défaut la dernière version enregistrée (`?version=latest` explicite ce défaut), qui peut être un brouillon. Utilise `?version=deployed` pour lire celle qu’une exécution réelle utilisera, ou un numéro pour lire une version précise. Une version absente, y compris `deployed` si rien n’est déployé, donne **404**, `AUTOMATION_VERSION_UNKNOWN`. Une automatisation inconnue donne `AUTOMATION_NOT_FOUND`. @@ -681,15 +691,36 @@ curl -sS --compressed -X PUT "https://your-host.example.com/api/v1/automations/b Choisis `kind` selon le mode de démarrage : -- `schedule` exige un `cron` à cinq champs et accepte un `timezone` IANA facultatif. +- `schedule` s’exécute selon une règle de répétition (`repeat`) ou une expression cron (`cron`), jamais les deux (contrat 3.24.0). - `webhook` renvoie une seule fois le `token` utilisé dans l’URL. Voir [Webhooks](/fr/develop/webhooks). - `event` exige le nom d’un événement émis par la plateforme. -Une configuration impossible à déclencher donne **400**, `AUTOMATION_TRIGGER_INVALID`, avec une explication : expression cron sans occurrence, comme `0 0 30 2 *`, fuseau non IANA ou événement non pris en charge. +`repeat` est une `ScheduleRule`, la règle qu’écrit aussi le sélecteur de planification de l’application. Une règle `daily`, `weekly`, `monthly` ou `yearly` s’exécute à une à douze heures locales dans `times`, écrites `HH:MM` ; une règle `minutely` ou `hourly` démarre toutes les quelques minutes ou heures, à la minute `minute` après l’heure pile pour `hourly`, éventuellement certains jours de la semaine seulement et entre deux heures (`window`). Elle exige un `timezone`. `startDate`, un jour `YYYY-MM-DD` dans ce fuseau, est le premier jour où elle peut s’exécuter et le jour à partir duquel « toutes les 2 semaines » se compte ; s’il manque, c’est aujourd’hui : renvoie donc celui que lit `GET .../triggers` pour garder une règle en phase. `cron` est une expression à cinq champs, lue dans `timezone`, ou en UTC sans fuseau. + +```json +{ + "kind": "schedule", + "repeat": { + "frequency": "weekly", + "interval": 1, + "weekdays": [1, 2, 3, 4, 5], + "times": ["09:00", "17:30"] + }, + "timezone": "Europe/Zurich", + "catchUp": "latest", + "input": { "region": "emea" } +} +``` + +Les jours de la semaine comptent à partir de 0 pour dimanche. Une heure locale que l’horloge saute démarre une fois, décalée de la durée du saut, et une heure qu’elle répète démarre une fois, à sa première occurrence ; une règle `minutely` ou `hourly`, comme une expression cron dont la minute ou l’heure commence par `*`, garde en revanche son intervalle réel. `catchUp` décide de ce que fait une planification des occurrences manquées pendant que la plateforme ne tournait pas : `latest`, la valeur par défaut, lance la plus récente une fois, quel que soit le retard ; `skip` ne la lance que si elle a au plus dix minutes de retard. Dans les deux cas, les autres sont comptées, pas rattrapées. + +Chaque type accepte aussi `enabled` (absent, il vaut `true`) et `input`, une entrée fixe : un objet JSON d’au plus 16 KiB que reçoit chaque exécution lancée par le déclencheur, ses propres champs `trigger`, `firedAt`, `event` et `payload` étant placés par-dessus — elle ne peut pas les nommer. Ce sont de simples données ; un modèle qu’elle contient arrive sous forme de texte. Le `PUT` remplace tout le déclencheur : un champ omis est réinitialisé. + +Un déclencheur qui enfreint une règle ou ne pourrait jamais se déclencher donne **400**, `AUTOMATION_TRIGGER_INVALID`, chaque problème figurant dans `data.issues` sous la forme `{ "path", "code", "message" }` : ni `repeat` ni `cron`, ou les deux (`schedule.cron_or_repeat`) ; une expression cron sans occurrence, y compris un jour qu’aucun mois nommé n’a (`0 0 30 2 *`) ; une heure qui n’est pas écrite `HH:MM`, plus de douze heures, un intervalle que la règle ne propose pas, un jour que le mois n’a jamais, ou une plage où aucun démarrage ne tombe ; un fuseau vide ou non IANA ; une entrée fixe qui n’est pas un objet, nomme l’un des champs propres au déclencheur ou dépasse 16 KiB ; un événement que la plateforme n’émet pas. -Chaque type accepte uniquement ses propres champs : `cron` et `timezone` pour `schedule`, `event` pour `event`, `rotateToken` pour `webhook`. Un champ d’un autre type donne **400**, `INVALID_BODY`, et figure dans `data.issues`. Un webhook ne peut donc pas conserver implicitement une planification. +Chaque type accepte uniquement ses propres champs : `cron`, `repeat`, `startDate`, `timezone` et `catchUp` pour `schedule`, `event` pour `event`, `rotateToken` pour `webhook`, ainsi que `enabled` et `input` pour tous. Un champ d’un autre type donne **400**, `INVALID_BODY`, et figure dans `data.issues`. Un webhook ne peut donc pas conserver implicitement une planification. -Pour un déclencheur d’événement, l’entrée de l’exécution est `{ "trigger": "event", "event": "", "payload": }`. Les événements disponibles sont : +Pour un déclencheur d’événement, l’entrée de l’exécution est `{ "trigger": "event", "event": "", "payload": }`, à côté d’une éventuelle entrée fixe. Les événements disponibles sont : | Événement | Émis quand | | ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -702,14 +733,16 @@ Pour un déclencheur d’événement, l’entrée de l’exécution est `{ "trig | `comment.created` | un commentaire arrive sur une tâche | | `comment.mentioned` | un commentaire de tâche mentionne quelqu’un avec `@` | +Le `comment` d’un événement de commentaire contient `body` tel qu’il est enregistré, chaque mention sous forme de lien de mention, et `bodyText`, le même texte avec chaque mention sous la forme `@` suivi du nom actuel. Compare les mots, comme un nom, avec `bodyText` (contrat 3.24.0). + ### Vérifier le déclencheur et le suspendre -`GET .../triggers` renvoie `triggers`, une liste contenant au maximum un élément. Les horodatages distinguent les exécutions réellement lancées des occurrences ignorées : +`GET .../triggers` renvoie `triggers`, une liste contenant au maximum un élément, avec ce qui a été enregistré (`repeat` et `startDate` ou `cron`, `timezone`, `catchUp`, `input`) et le prochain démarrage (`nextRunAt`, `null` tant que le déclencheur est désactivé, ainsi que pour un webhook ou un événement). Les horodatages distinguent les exécutions réellement lancées des occurrences ignorées : - `lastFiredAt` et `lastRunId` correspondent à la dernière exécution lancée. Ils restent `null` tant qu’aucune exécution n’a démarré. - `lastSkippedAt` et `lastSkipReason` décrivent la dernière occurrence qui n’a rien lancé. Une livraison de webhook que le schéma `inputs` de la version déployée refuse est un autre cas : l’expéditeur reçoit **400** `AUTOMATION_INPUT_INVALID`, rien ne démarre et aucun de ces horodatages ne bouge — la liaison n’était pas due, un webhook dont chaque livraison est refusée se lit donc comme un webhook jamais appelé. Vérifie les livraisons côté expéditeur. -Les motifs d’occurrence ignorée sont `not_deployed` si aucune version n’est déployée, `unusable_cron` si l’expression ou le fuseau ne peut pas être interprété, `start_refused` si le schéma `inputs` déployé refuse l’entrée, et `paused_after_failures` si une planification s’est mise en pause d’elle-même après des échecs répétés (voir ci-dessous). Dans le cas `unusable_cron`, le planificateur cesse de traiter ce déclencheur jusqu’à sa modification. +Les motifs d’occurrence ignorée sont `not_deployed` si aucune version n’est déployée, `unusable_cron` si la planification ou son fuseau ne peut pas être interprété, `start_refused` si le démarrage a été refusé — le schéma `inputs` déployé refuse l’entrée, ou le projet de l’exécution ne peut pas la recevoir, comme un projet archivé pour un événement ; `lastSkipDetail.code` précise lequel —, `missed_occurrences` si des occurrences étaient dues pendant que la plateforme ne tournait pas, comme le décrit `catchUp`, et `paused_after_failures` si une planification s’est mise en pause d’elle-même après des échecs répétés (voir ci-dessous). Dans le cas `unusable_cron`, le planificateur cesse de traiter ce déclencheur jusqu’à sa modification. `lastSkipDetail` contient les faits derrière le motif : l’occurrence concernée (`occurrence`), le `code` d’un refus, la `version` qui a refusé, son `message` et ses `issues`, et `missed` — `count` (jusqu’à 1 000, `capped` au-delà), `firstAt`, `lastAt` et la `policy` — quand des occurrences ont été manquées. Une pause après des échecs n’a pas de détail ; ses faits sont les champs d’échec ci-dessous. Compare `lastFiredAt` à la cadence attendue. Si `lastSkippedAt` est plus récent, consulte la raison avant de relancer. Changer le type de déclencheur réinitialise ces horodatages. @@ -721,7 +754,7 @@ Une planification dont les exécutions échouent sans cesse se met en pause d’ Quand le compteur d’une planification atteint cinq, la plateforme passe `enabled: false` et `lastSkipReason: "paused_after_failures"`, écrit une ligne d’audit `automation.trigger.paused` et prévient les Propriétaires et Admins de l’organisation. Corrige l’automatisation, puis envoie un `PUT` du déclencheur avec `enabled: true`. Chaque `PUT` remet le compteur à zéro et efface ce motif ; un `PUT` sans `enabled` réactive le déclencheur, car `enabled` vaut `true` par défaut. Les liaisons webhook et événement continuent de compter, mais ne sont jamais mises en pause (contrat 3.1.0). -La réponse `PUT` indique aussi `deployed`. Il est possible de configurer le déclencheur avant le déploiement, mais ses occurrences sont ignorées avec `not_deployed` jusqu’à ce qu’une version soit déployée. Le champ `trigger` de `GET /api/v1/automations` permet de constater cet état. +La réponse `PUT` indique aussi `deployed`. Il est possible de configurer le déclencheur avant le déploiement, mais ses occurrences sont ignorées avec `not_deployed` jusqu’à ce qu’une version soit déployée. Le champ `trigger` de `GET /api/v1/automations` permet de constater cet état. Pour une planification, la réponse ajoute `nextRunAt`. Quand une version est déployée, elle ajoute `warnings`, ce que cette version ferait de l’entrée du déclencheur ; le déclencheur est enregistré dans tous les cas. `TRIGGER_INPUT_MISMATCH` signifie que son schéma `inputs` refuse ce que le déclencheur transmet à une exécution et nomme les champs obligatoires manquants dans `params.missing` (le corps d’un webhook n’est pas jugé) ; `TRIGGER_INPUT_NOT_TEMPLATED` signifie que l’entrée fixe contient un modèle, qui arrive sous forme de texte. ## Démarrer une exécution, puis la suivre @@ -812,6 +845,42 @@ Une automatisation sans association à un projet peut démarrer sans projet via `DELETE /api/v1/projects/{id}/runs/{runId}`, ou `/api/v1/runs/{runId}`, exige la capacité développeur et supprime une exécution terminée, entrée et sortie comprises. Une exécution active donne **409**, `RUN_ACTIVE` : annule-la d’abord. +### Lire une exécution étape par étape + +`GET /api/v1/runs/{runId}/record` (ou la forme projet) renvoie l’enregistrement de l’exécution : chaque étape dans l’ordre où elle s’exécute – l’entrée de l’exécution comme `__start`, les étapes de la version, la sortie du document comme `__end` – avec son statut, ses durées et ses tentatives, les décisions qui l’ont exécutée ou ignorée (chaque condition expliquée avec les valeurs qu’elle a lues), pourquoi elle n’a produit aucune sortie, remonté jusqu’à la cause, pourquoi elle a échoué (une `reason` tirée d’une liste fixe, avec les `params` qui la formulent), et un aperçu de ce qu’elle a reçu et renvoyé. Les valeurs elles-mêmes restent hors de l’enregistrement : lis une étape en entier sur `…/record/node?node=` et ajoute `item` ou `pass` pour l’un de ses éléments ou passages. `…/record/items?node=` parcourt les éléments et passages d’une étape page par page ; `status=failed` ne garde que ceux qui ont échoué. `…/compare/{otherRunId}` compare deux exécutions de la même automatisation étape par étape et nomme la première étape où elles ont divergé ; des exécutions d’automatisations différentes renvoient **400** `RUN_COMPARE_MISMATCH`. Chaque lecture demande le même accès que la lecture de l’exécution, et les secrets restent partout retenus. + +Pour suivre une exécution pendant qu’elle travaille, renvoie le `cursor` de l’enregistrement comme `since` : la réponse ne contient alors que les étapes écrites depuis et les événements depuis – fusionne les étapes par `path` et les événements par `id`. Un enregistrement reste sous 512 KiB et une étape sous 256 KiB ; `truncated` dit ce qui a été laissé de côté pour tenir. Ces lectures nécessitent le contrat d’API 3.29.0. + +```bash +curl -sS --compressed "https://your-host.example.com/api/v1/runs//record" \ + -H "Authorization: Bearer $TALE_API_KEY" \ + -H "X-Organization-Slug: " +# → 200 { "format": 1, "nodes": [{ "path": "__start", "status": "succeeded", … }, +# { "path": "triage", "status": "skipped", "skip": { "reason": "when", … }, +# "decisions": [{ "kind": "when", "result": false, "explanation": [ … ] }] }, …], +# "cursor": 1758210000000 } +``` + +### Relancer une exécution + +`POST /api/v1/runs/{runId}/replay` (ou la forme projet) démarre une nouvelle exécution de la même automatisation, dans le périmètre de l’exécution : avec son entrée (`"kind": "again"`), avec une `input` que tu envoies (`"edited"`), ou à partir d’une étape (`"from"` avec `from`). Une relance à partir d’une étape réutilise les étapes que l’exécution a terminées hors de cette étape et de ce qu’elle alimente – leurs résultats et leur enregistrement, jamais leurs effets – et exécute le reste ; le `replayOf` de la nouvelle exécution nomme celle qu’elle relance. `version` choisit la version (`same` par défaut, ou `deployed`, `latest`, un numéro) et `mode` le mode (celui de l’exécution par défaut). Une relance réelle demande la capacité de développeur et la version déployée, et une relance à partir d’une étape d’une exécution simulée reste simulée (**409** `REPLAY_MODE_MISMATCH`). + +Une étape qui écrit s’exécute à nouveau et écrit à nouveau, sous une nouvelle clé de requête : les services qui ignorent les requêtes répétées n’y verront donc pas une répétition. Planifie d’abord : `GET …/replay` avec la même requête dans la query renvoie ce qui est réutilisé, ce qui s’exécute à nouveau, ce que chaque étape fait hors de Tale, et `writesAgain`, les écritures qui repartent une seconde fois – ou le `refusal` qu’elle rencontrerait : l’exécution n’est pas terminée (`REPLAY_RUN_NOT_FINISHED`), la version à exécuter a changé ce que calcule une étape réutilisée (`REPLAY_GRAPH_CHANGED`, avec les étapes), aucune étape de ce nom (`REPLAY_NODE_UNKNOWN`), ou l’exécution n’a gardé aucune entrée (`REPLAY_INPUT_UNAVAILABLE`). Envoie `Idempotency-Key` pour pouvoir réessayer sans risque. Ces points d’accès nécessitent le contrat d’API 3.29.0. + +```bash +curl -sS --compressed "https://your-host.example.com/api/v1/runs//replay?kind=from&from=send" \ + -H "Authorization: Bearer $TALE_API_KEY" \ + -H "X-Organization-Slug: " +# → 200 { "reuse": [{ "nodeId": "fetch", "status": "ok" }], "rerun": [{ "nodeId": "send", "effect": "write", … }], +# "writesAgain": 1, … } +curl -sS --compressed -X POST "https://your-host.example.com/api/v1/runs//replay" \ + -H "Authorization: Bearer $TALE_API_KEY" \ + -H "X-Organization-Slug: " \ + -H "Content-Type: application/json" -H "Idempotency-Key: fix-4711" \ + -d '{ "kind": "from", "from": "send" }' +# → 202 { "runId": "...", "version": 3, "mode": "live", "kind": "from", "reused": 1 } +``` + ## Agir pour un membre : répondre à la question d’une exécution, décider la relecture d’une tâche Une exécution en pause sur `waitingFor: "ask"` attend une personne ; une tâche en `in_review` peut attendre une personne ou un agent désigné. Ces deux points d’entrée REST relaient le geste d’une personne depuis une autre application en la nommant comme `actor` : Tale enregistre cette personne, pas la clé. Ils demandent le contrat API 1.16.0 ; le contrat 3.11.0 ajoute le refus explicite d’une approbation humaine tant que la relecture appartient à un agent. @@ -1148,6 +1217,7 @@ Les erreurs d’embedding demandent des traitements distincts : - **409**, `EMBEDDING_CREDIT_EXHAUSTED` : le fournisseur refuse pour une raison de compte, comme un solde épuisé, un plafond de dépenses ou un forfait sans accès au modèle. - **409**, `EMBEDDING_CREDENTIAL_REJECTED` : le fournisseur rejette la clé ou son accès au modèle. Le même code répond quand la plateforme n’a aucun identifiant utilisable à envoyer : le fournisseur n’a pas d’identifiants par défaut, ou ceux que nomment les réglages d’embedding ont été supprimés, désactivés ou sont illisibles ; `error` en donne la raison. - **503**, `EMBEDDING_UPSTREAM_ERROR` : autre panne du fournisseur, avec `Retry-After`. Réessaie en espaçant progressivement les tentatives. +- **429**, `BUDGET_EXCEEDED` : l’embedding de la requête est une requête de modèle que paie la personne titulaire de la clé. Un plafond de budget qui s’applique à elle, à l’une de ses équipes, au projet recherché, à l’organisation ou à la clé est atteint ; rien n’est recherché. `data` nomme le plafond et `Retry-After` le délai jusqu’à la réinitialisation de sa période. Les refus liés au compte ou aux identifiants ne sont pas des limites de débit. Ils nécessitent une correction par un administrateur, pas une simple attente. @@ -1599,6 +1669,8 @@ La lecture d’une tâche renvoie aussi son calendrier, en lecture seule sur cet Lors de l’écriture d’un commentaire, le texte d’origine `body`, sans ses espaces de début et de fin, doit compter de 1 à 10 000 unités de code UTF-16 (la plupart des emojis en comptent 2). Tu peux lui ajouter `bodyByLocale`. La lecture le renvoie lorsqu’il existe. Fournis des traductions équivalentes et non vides pour `en`, `de` et `fr` ; d’autres clés de langue ou de région, comme `nl`, `it` et `de-CH`, sont acceptées. Chaque valeur est nettoyée et limitée de la même façon, avec au plus 16 langues par commentaire. Affiche la variante exacte choisie par le lecteur, puis la langue de base, puis `en`, puis `body`. L’auteur reste le titulaire de la clé. Une modification du texte seul dans Tale efface les anciennes traductions pour qu’elles ne masquent pas la modification. +Une mention est enregistrée comme un lien Markdown qui désigne la personne mentionnée : `[@Ada Lovelace](mention:user/)`, ou `agent/` suivi de l’ID d’un agent du projet, ou `automation/` suivi du nom d’enregistrement d’une automatisation. Quand tu envoies `@` suivi du `handle` d’un agent, du nom d’e-mail d’un membre, du nom d’enregistrement d’une automatisation ou d’un ID, Tale enregistre ce lien, et la mention reste valable après un renommage. Un texte écrit avant le contrat 3.24.0 continue de désigner les agents qu’il désignait : un agent répond toujours à son nom d’alors, en minuscules, avec des points à la place des espaces ou sans espaces. Le texte entre crochets est le nom au moment de l’enregistrement du commentaire ; `bodyText` renvoie le commentaire avec chaque mention sous la forme `@` suivi du nom actuel. Compare donc les mots avec `bodyText` et affiche `body`. Si tu mentionnes quelqu’un qui ne peut pas ouvrir la tâche, un agent d’un autre projet ou une personne extérieure à l’organisation, la mention est enregistrée en texte brut et ne notifie personne ; dans du code, une mention reste du texte. Les lectures de tâche renvoient `description` sous la même forme enregistrée, avec `descriptionText` à côté. La collecte de tâches enregistre de la même façon les mentions de la description, sans notifier personne ; une tâche dont `externalSystem` vaut `github` ou `glitchtip` garde les `@noms` de ce suivi tels qu’ils sont écrits (contrat 3.24.0). + Les agents de tâche et de workflow reçoivent la consigne de conserver la langue du titre et de la description de la tâche. Si aucune langue ne s’en dégage, ils utilisent celle définie par défaut pour les agents de l’organisation. Les mots fixes d’un modèle de titre, les identifiants de trimestre, la langue des documents sources et celle de l’interface de la personne qui démarre l’exécution ne déterminent pas la langue de la tâche. Cette règle couvre aussi les questions, les reprises et la création de tâches associées. Il s’agit de consignes au modèle ; les traductions enregistrées des commentaires de progression permettent aux clients de choisir la langue affichée indépendamment de celle de la tâche. Consulte la sortie de l’exécution et les commentaires de la tâche pour connaître le résultat. Certaines automatisations créent aussi des fichiers ; leur présence et leur dossier de destination dépendent du workflow. Ne suppose pas que chaque exécution dépose un livrable dans le dossier de préparation ou du trimestre. @@ -1684,7 +1756,7 @@ Un instantané de contenu plus récent lié à un contact dans la corbeille donn | **408** | la réception complète des en-têtes et du corps a dépassé 15 minutes : `REQUEST_TIMEOUT`. La réponse contient un nouveau `requestId`, car la requête expirée n’en avait pas encore reçu. La connexion est fermée ; utilise une connexion plus rapide ou des transferts plus petits pour réessayer. | | **431** | les en-têtes dépassent ensemble le plafond de 64 Kio du serveur frontal. En HTTP/1.1, la réponse n’a ni enveloppe JSON ni `X-Request-Id` — l’analyseur du frontal l’écrit avant qu’une route tourne. Le frontal tolère quelques Kio de marge : une URL ou un en-tête légèrement trop long peut encore atteindre la plateforme et y être refusé selon ses règles. Une URL de 66 Kio reçoit ainsi **414**. En HTTP/2, le plafond de 64 Kio est strict et son dépassement entraîne la fermeture de la connexion. | | **500** | une erreur interne est survenue : `INTERNAL_ERROR`. Fournis le `requestId` de l’enveloppe lorsque tu la signales. | -| **503** | une dépendance nécessaire est indisponible. La base de données de la plateforme peut elle-même redémarrer ou être injoignable (`DATABASE_UNAVAILABLE`, avec `Retry-After` et un `requestId`) : toute opération peut alors répondre ainsi, y compris le déclencheur webhook et la vérification de la clé, si bien qu’une clé valide n’est jamais refusée avec **401** pendant ce temps. Cela comprend aussi le fournisseur d’embedding (`EMBEDDING_UPSTREAM_ERROR`, avec `Retry-After`), le stockage d’un téléchargement (`OBJECT_STORE_UNAVAILABLE`, avec `Retry-After`), un stockage non configuré (`OBJECT_STORE_UNCONFIGURED`) ou une purge inachevée (`PURGE_INCOMPLETE`). `KNOWLEDGE_ENTRY_STORE_TIMEOUT` signifie que le stockage a accepté l’écriture d’une entrée de connaissances sans répondre dans les 30 secondes ; aucun enregistrement n’est créé. Réessaie avec un délai croissant. | +| **503** | une dépendance nécessaire est indisponible. La base de données de la plateforme peut elle-même redémarrer ou être injoignable (`DATABASE_UNAVAILABLE`, avec `Retry-After` et un `requestId`) : toute opération peut alors répondre ainsi, y compris le déclencheur webhook et la vérification de la clé, si bien qu’une clé valide n’est jamais refusée avec **401** pendant ce temps. Cela comprend aussi le fournisseur d’embedding (`EMBEDDING_UPSTREAM_ERROR`, avec `Retry-After`), le stockage d’un téléchargement (`OBJECT_STORE_UNAVAILABLE`, avec `Retry-After`), un stockage non configuré (`OBJECT_STORE_UNCONFIGURED`), une purge inachevée (`PURGE_INCOMPLETE`) ou la liste des personnes, agents et automatisations qu’un commentaire ou la description d’une nouvelle tâche mentionne (`MENTION_DIRECTORY_UNAVAILABLE`, rien n’est publié ni créé). `KNOWLEDGE_ENTRY_STORE_TIMEOUT` signifie que le stockage a accepté l’écriture d’une entrée de connaissances sans répondre dans les 30 secondes ; aucun enregistrement n’est créé. Réessaie avec un délai croissant. | | **502**, **503**, **504** | le serveur frontal ne peut pas joindre la plateforme, par exemple pendant son redémarrage : `UPSTREAM_UNAVAILABLE`. Il fournit `Retry-After` et un nouveau `requestId`, sans `X-Tale-Api-Version`. Ce comportement concerne les routes destinées aux programmes : `/api/*`, `/events`, `/status.json`, `/openapi.json` et `/.well-known/*`. Une navigation dans le navigateur reçoit la page de maintenance. Réessaie avec un délai croissant. | Un `If-Match` de document qui ne correspond plus à sa représentation lue donne aussi `412 PRECONDITION_FAILED`, avec le tag courant dans `data.etag` et aucune écriture. diff --git a/docs/fr/develop/connectors.md b/docs/fr/develop/connectors.md index 4766be4305..e8f74f6437 100644 --- a/docs/fr/develop/connectors.md +++ b/docs/fr/develop/connectors.md @@ -25,6 +25,8 @@ auth: - method: api-key ``` +Un connector dont le nom est fait de mots courants, comme `task` (Tasks), déclare aussi `i18n.de.displayName` et `i18n.fr.displayName`. Un connector qui porte le nom d’un produit, comme Tavily, garde ce nom dans toutes les langues. + ### Définir les destinations autorisées | Champ | Signification | @@ -47,6 +49,7 @@ Ajouter un connector demande une contribution au code source. L'exécution lit l | Champ | Contrat pour l'auteur et l'appelant | | --- | --- | | `name`, `description` | Nom stable en snake_case et explication de l'usage de l'action | +| `title`, `i18n` | L’action en mots pour les personnes : un `title` anglais court, avec une seule majuscule initiale et sans le nom du connector (« List issues »), plus `i18n.de.title` et `i18n.fr.title` (et `de-CH` quand l’orthographe suisse diffère). Le canevas d’automatisation affiche un nœud sous la forme « GitHub · Lister les issues » dans la langue du lecteur ; une action fournie à laquelle il en manque un fait échouer les tests du catalogue | | `input` | Schéma JSON objet, validé avant exécution ; décrire les champs et signaler ceux requis | | `output` | Signature du résultat au style TypeScript ; documentation, pas validation des sorties à l'exécution | | `effects` | `read` ou `write` ; les écritures passent par la politique d'approbation | diff --git a/docs/fr/develop/mcp-endpoint.md b/docs/fr/develop/mcp-endpoint.md index b82c200f00..cbb26004b7 100644 --- a/docs/fr/develop/mcp-endpoint.md +++ b/docs/fr/develop/mcp-endpoint.md @@ -21,7 +21,7 @@ Crée une [clé API](/fr/platform/admin/api-keys) et conserve-la dans la configu | Transport | HTTPS POST avec JSON-RPC ; réponses JSON simples | | Autorisation | `Authorization: Bearer ` | | Organisation | `X-Organization-Slug: ` | -| Révisions du protocole | `2025-06-18`, ou `2025-03-26` si le client la propose | +| Révisions du protocole | `2026-07-28`, portée par chaque requête ; ou `2025-11-25`, `2025-06-18` ou `2025-03-26`, ouvertes par `initialize` ([Révisions du protocole](#protocol-revisions)) | Le client doit accepter un point d'accès HTTP distant avec des en-têtes personnalisés. Il n'y a ni flux SSE, ni session à supprimer, ni parcours d'autorisation OAuth. Les URL de découverte OAuth renvoient du JSON avec `404` ; un client qui exige ce parcours doit être configuré autrement. Un client limité aux serveurs stdio locaux ne peut pas utiliser directement cette URL. [Utiliser Tale depuis ton éditeur ou un script](/fr/develop/use-tale-from-your-editor) fournit des configurations prêtes pour opencode et Claude Code. @@ -36,43 +36,70 @@ curl --fail-with-body "$TALE_URL/api/v1/mcp" \ --header "Authorization: Bearer $TALE_API_KEY" \ --header "X-Organization-Slug: $TALE_ORG_SLUG" \ --header 'Content-Type: application/json' \ - --data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"docs-client","version":"1.0.0"}}}' + --data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"docs-client","version":"1.0.0"}}}' ``` -Le serveur s'identifie comme `tale-platform`. Lis `result.protocolVersion` puis envoie la valeur négociée dans `MCP-Protocol-Version` lors des appels suivants. L'exemple ci-dessous utilise `2025-06-18` ; remplace-la si l'initialisation a négocié l'ancienne révision. Une valeur d'en-tête non prise en charge renvoie `400`. +Le serveur s'identifie comme `tale-platform` et indique la version du contrat d’API dans `serverInfo.version`. Ses `instructions` sont un court guide pour travailler avec Tale, que ton client peut transmettre à son modèle. Lis `result.protocolVersion` puis envoie la valeur négociée dans `MCP-Protocol-Version` lors des appels suivants. L'exemple ci-dessous utilise `2025-11-25` ; remplace-la si l'initialisation a négocié une révision plus ancienne. Une révision que le point d’accès ne parle pas renvoie `400` avec JSON-RPC `-32022`, et `data.supported` liste celles qu’il parle. ```bash curl --fail-with-body "$TALE_URL/api/v1/mcp" \ --header "Authorization: Bearer $TALE_API_KEY" \ --header "X-Organization-Slug: $TALE_ORG_SLUG" \ - --header 'MCP-Protocol-Version: 2025-06-18' \ + --header 'MCP-Protocol-Version: 2025-11-25' \ --header 'Content-Type: application/json' \ --data '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_docs","arguments":{}}}' ``` -Un résultat `get_docs` réussi contient la référence des automatisations en texte et ne porte pas d'indicateur d'erreur. Pour consulter les schémas des outils, envoie plutôt `method: "tools/list"`. L'inventaire actuel compte 22 outils. Conserve l'`id` JSON-RPC pour associer chaque résultat à sa requête. +Un résultat `get_docs` réussi contient la référence des automatisations en texte et ne porte pas d'indicateur d'erreur. Ajoute `"arguments":{"topic":"triggers"}` pour la référence des déclencheurs (les champs de chaque type de déclencheur, l’entrée avec laquelle ses exécutions démarrent et les événements), `"validation"` pour lire un résultat de validation et connaître chaque code d’erreur, `"settings"` pour chaque type de paramètre avec ses champs ([Paramètres par MCP](/fr/develop/mcp-settings)), ou `"skill"` pour le [skill Tale](/fr/develop/use-tale-from-your-editor#tale-skill). Pour consulter les schémas des outils, envoie plutôt `method: "tools/list"`. Conserve l'`id` JSON-RPC pour associer chaque résultat à sa requête. ### Transport et lots | Requête | Réponse | | --- | --- | | Un message JSON-RPC | Un résultat ou une erreur JSON-RPC | -| Lot de 20 messages au maximum | Tableau de réponses ; les notifications n'ont pas d'entrée de réponse | +| Lot de 20 messages au maximum (révisions de 2025 uniquement) | Tableau de réponses ; les notifications n'ont pas d'entrée de réponse | | Notifications uniquement | HTTP `202` | | `OPTIONS` | HTTP `204`, `Allow: POST, OPTIONS` ; aucune clé requise | | Autre méthode HTTP | HTTP `405`, `Allow: POST, OPTIONS` | -Chaque appel d'outil supplémentaire d'un lot consomme le même budget qu'un appel séparé. Si le lot épuise son budget, l'entrée refusée contient JSON-RPC `-32000` avec `data.retryAfterMs`. La réponse HTTP reste `200`, sans `Retry-After`. Une requête unique refusée à l'entrée HTTP reçoit le `429` REST. Gère les deux cas selon les [limites de débit](/fr/develop/rate-limits). +Chaque appel d'outil, lecture ou liste de ressources ou prompt supplémentaire d'un lot consomme le même budget qu'un appel séparé. Si le lot épuise son budget, l'entrée refusée contient JSON-RPC `-32000` avec `data.retryAfterMs`. La réponse HTTP reste `200`, sans `Retry-After`. Une requête unique refusée à l'entrée HTTP reçoit le `429` REST. Gère les deux cas selon les [limites de débit](/fr/develop/rate-limits). -Le point d'accès ne fournit pas d'en-têtes CORS pour utiliser une clé dans une page web. Conserve la clé sur un serveur de confiance ou dans le stockage d'identifiants du client MCP. +Le point d'accès ne fournit pas d'en-têtes CORS pour utiliser une clé dans une page web. Conserve la clé sur un serveur de confiance ou dans le stockage d'identifiants du client MCP. Une requête dont l’en-tête `Origin` nomme un site que le déploiement n’accepte pas est journalisée, et refusée avec `403` `ORIGIN_FORBIDDEN` là où l’opérateur impose cette vérification ([référence de l’environnement](/fr/self-hosted/configuration/environment-reference#mcp-endpoint)). Les agents de code lancés dans un terminal n’envoient pas d’`Origin`. + +### Révisions du protocole {#protocol-revisions} + +Le point d’accès sert deux générations du protocole sur la même URL avec la même clé, et décide pour chaque requête de laquelle il s’agit. Un client qui parle `2026-07-28` n’envoie pas d’`initialize` : chaque requête porte sa révision et les capacités du client, si bien que rien n’est conservé d’une requête à l’autre. + +| | `2025-11-25`, `2025-06-18`, `2025-03-26` | `2026-07-28` | +| --- | --- | --- | +| Démarrage | `initialize`, puis la révision négociée dans `MCP-Protocol-Version` | Aucune poignée de main ; `server/discover` indique ce que le serveur parle | +| Chaque requête | Le message JSON-RPC | `params._meta` avec `io.modelcontextprotocol/protocolVersion` et `io.modelcontextprotocol/clientCapabilities` ; les en-têtes `MCP-Protocol-Version` et `Mcp-Method`, plus `Mcp-Name` pour `tools/call`, `resources/read` et `prompts/get` | +| Lots | 20 messages au maximum | Un message par requête | +| Résultats | Comme décrit sur cette page | En plus, `resultType: "complete"` et le serveur sous `_meta["io.modelcontextprotocol/serverInfo"]` ; `server/discover`, les listes et `resources/read` ajoutent `ttlMs` et `cacheScope: "private"` | +| `initialize`, `ping` | Traités | HTTP `404` avec JSON-RPC `-32601` | +| Une adresse qui ne trouve rien | `-32002` | `-32602` | + +Une requête est servie selon `2026-07-28` quand son `_meta` nomme une révision ou que son en-tête `MCP-Protocol-Version` vaut `2026-07-28`. Ses en-têtes doivent reprendre ce que dit le corps. Si un en-tête manque, ou s’il nomme une autre révision, une autre méthode, un autre outil, un autre prompt ou une autre adresse, la requête est refusée avec HTTP `400` et JSON-RPC `-32020` avant que quoi que ce soit ne s’exécute. Envoie une valeur de `Mcp-Name` qui n’est pas en ASCII simple sous la forme `=?base64??=`. Si `_meta` manque ou est mal formé, le point d’accès répond `-32602` avec HTTP `400` et nomme les entrées concernées dans `data.missing` ou `data.malformed`. + +```bash +curl --fail-with-body "$TALE_URL/api/v1/mcp" \ + --header "Authorization: Bearer $TALE_API_KEY" \ + --header "X-Organization-Slug: $TALE_ORG_SLUG" \ + --header 'MCP-Protocol-Version: 2026-07-28' \ + --header 'Mcp-Method: server/discover' \ + --header 'Content-Type: application/json' \ + --data '{"jsonrpc":"2.0","id":1,"method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"docs-client","version":"1.0.0"}}}}' +``` + +La réponse liste toutes les révisions dans `supportedVersions` et contient les mêmes capacités et `instructions` qu’`initialize`, avec le serveur sous `_meta`. `ttlMs` indique combien de temps ton client peut réutiliser une réponse : une heure pour `server/discover`, les listes d’outils, de prompts et de modèles d’adresse, et les références ; une minute pour `resources/list` et le catalogue des connecteurs ; `0` pour une automatisation ou une exécution, car elles peuvent changer dès le prochain enregistrement de ton agent. Chaque réponse appartient à la clé qui l’a demandée ; un cache ne doit donc jamais la partager avec une autre clé. Le nom indiqué dans `io.modelcontextprotocol/clientInfo` est enregistré avec chaque appel et avec les modifications qu’il apporte, si bien qu’une version enregistrée par un agent nomme le client qui l’a enregistrée. ## Les outils -`tools/list` fournit le schéma d'entrée de chaque outil. Un argument manquant, vide, mal typé ou inattendu reçoit JSON-RPC `-32602` avant exécution. Le document passé à `validate_automation`, `run_automation`, `test_automation` ou `save_automation` garde volontairement une enveloppe ouverte : `get_docs` en explique la grammaire et le moteur valide son contenu. +`tools/list` fournit le schéma d'entrée de chaque outil, et un outil de lecture décrit aussi sa réponse dans `outputSchema`. Les arguments sont vérifiés avant exécution : un argument manquant, vide, mal typé ou inattendu est refusé par un seul résultat d’outil marqué `isError`, dont le `code` est `INVALID_ARGUMENTS` et dont `data.issues` liste chaque problème avec son `path`, son `code` et son `message`. Le refus ne répète jamais la valeur d’un argument. Chaque résultat porte sa réponse sous forme de texte JSON compact, et la réponse réussie d’un outil de lecture arrive aussi comme `structuredContent`, le même objet. Le document passé à `validate_automation`, `run_automation`, `test_automation` ou `save_automation` garde volontairement une enveloppe ouverte : `get_docs` en explique la grammaire et le moteur valide son contenu. -Les outils exposent aussi `readOnlyHint`, `destructiveHint`, `idempotentHint` et `openWorldHint`. Un hôte peut s'en servir pour expliquer un appel, mais ces indications n'accordent aucun droit et ne garantissent pas sa sûreté. Les lectures sont marquées comme telles ; enregistrer écrit une version ; déployer ou modifier un déclencheur peut remplacer un état existant. Les exécutions réelles peuvent joindre de vrais services. +Les outils exposent aussi `readOnlyHint`, `destructiveHint`, `idempotentHint` et `openWorldHint`. Un hôte peut s'en servir pour expliquer un appel, mais ces indications n'accordent aucun droit et ne garantissent pas sa sûreté. Les lectures sont marquées comme telles ; enregistrer écrit une version ; déployer, supprimer, installer, modifier un déclencheur ou modifier les paramètres peut remplacer un état existant. Les exécutions réelles et certaines modifications de paramètres peuvent joindre de vrais services. Mettre en service, supprimer, définir un déclencheur, installer une automatisation dans des projets, répondre à la question d’une exécution et modifier les paramètres portent aussi `_meta["anthropic/requiresUserInteraction"]` : un client qui en tient compte demande à la personne avant chacun de ces appels. -### Écriture +### Écriture {#authoring} | Outil | Ce qu'il fait | | --------------------- | -------------------------------------------------------------------- | @@ -81,14 +108,21 @@ Les outils exposent aussi `readOnlyHint`, `destructiveHint`, `idempotentHint` et | `search_catalog` | Chercher dans le catalogue de types de nœuds par mot-clé. | | `validate_automation` | Valider un document d’automatisation sans l’enregistrer : ses erreurs et avertissements avec leur emplacement, plus l’analyse du flux et les types déduits. | | `run_automation` | Exécuter un document avec les mocks déterministes. | -| `test_automation` | Lancer les tests d'acceptation propres à une automatisation. | -| `save_automation` | Enregistrer un document comme nouvelle version immuable ; la réponse liste ses avertissements. | -| `get_automation` | Lire une version enregistrée — la dernière sans précision, `version: "deployed"` pour celle qui est en ligne (`AUTOMATION_VERSION_UNKNOWN` tant que rien n’est déployé). | +| `test_automation` | Lancer les tests d'acceptation propres à une automatisation — d’un brouillon (`automation`) ou d’une version enregistrée (`name`, `version`), dont le verdict est alors noté sur la version. | +| `save_automation` | Enregistrer un document comme nouvelle version immuable ; la réponse liste ses avertissements. Voir [Enregistrer sans perdre de travail](#save). | +| `get_automation` | Lire une version enregistrée — la dernière sans précision, `version: "deployed"` pour celle qui est en ligne (`AUTOMATION_VERSION_UNKNOWN` tant que rien n’est déployé) : le document sous `automation`, ses `settings`, `taskContract` et `presentation`, `latestVersion`, `deployedVersion`, qui l’a enregistrée (`createdBy`), par quel accès (`createdVia` : `app`, `upload`, `mcp`, `managed` ou `system` ; `null` pour une version enregistrée avant que ce soit noté) et avec quel client (`clientName`), ses `projectIds` et son `trigger`. | | `list_automations` | Les automatisations de l'organisation avec leur dernière version, leur version déployée et les projets où chacune est installée (`projectIds`). | -| `deploy_automation` | Déployer une version enregistrée pour les exécutions réelles. | +| `deploy_automation` | Déployer une version enregistrée pour les exécutions réelles ; une version plus ancienne revient en arrière. `expectedDeployedVersion` (la version que tu as lue comme en service, `null` pour aucune) refuse la mise en service avec `AUTOMATION_DEPLOYMENT_STALE` quand une autre est passée en service entre-temps ; la réponse nomme la `previousVersion`. | +| `delete_automation` | Supprimer une automatisation — toutes ses versions, son déclencheur et ses installations ; ses exécutions restent. `expectedLatestVersion` doit être la dernière version que tu as lue (sinon `AUTOMATION_VERSION_STALE`) ; une exécution encore en cours empêche la suppression (`AUTOMATION_HAS_ACTIVE_RUNS`). | Suis cet ordre : lire la grammaire et le catalogue, valider le document, l'exécuter avec les mocks, lancer ses tests d'acceptation, enregistrer une version, puis la déployer. Un test simulé réussi vérifie le chemin simulé. Il ne valide ni les identifiants du fournisseur, ni le réseau, ni les effets réels. +#### Enregistrer sans perdre de travail {#save} + +Une version porte, à côté du document, le formulaire `settings` qu’affiche une tâche, le `taskContract` et la `presentation` dans la liste des automatisations. Un enregistrement qui en omet un garde celui de la dernière version ; `null` n’en enregistre aucun (pour `presentation`, la liste continue alors d’afficher la plus récente des précédentes) ; une valeur est vérifiée avec le schéma par lequel l’application la lit, et refusée comme `INVALID_ARGUMENTS` avec chaque problème quand elle ne convient pas. `carried` dans la réponse nomme ce qui a été gardé. + +Passe `baseVersion`, la version dont ta modification est partie. Si quelqu’un a enregistré une version plus récente entre-temps, l’enregistrement est refusé avec `AUTOMATION_VERSION_STALE` et `data.latestVersion` ; lis cette version, reporte ta modification et enregistre à nouveau. Sans `baseVersion`, la version s’ajoute, et `baseVersionChecked: false` indique que la vérification a été sautée. Enregistre une nouvelle automatisation avec `create: true` : un nom qui existe déjà est refusé (`AUTOMATION_NAME_TAKEN`), pour qu’une nouvelle automatisation ne devienne jamais une version d’une autre. Un enregistrement est refusé de la même façon, avec ou sans `create`, quand le nom appartient à une automatisation que tu ne peux pas voir. `projectId` installe une nouvelle automatisation, avec sa première version, dans un projet que tu peux modifier ; l’enregistrement d’une automatisation existante l’ignore. + #### Lire un résultat de validation {#validation-result} `validate_automation` répond avec `valid`, `errors`, `warnings`, `analysis` et `types`. Les erreurs empêchent d’enregistrer et de déployer, les avertissements jamais. `save_automation` renvoie les `warnings` de la version enregistrée, et un enregistrement refusé indique ses `warnings` à côté de ses `errors` : tu découvres ainsi les deux pendant ton travail. @@ -106,46 +140,120 @@ Suis cet ordre : lire la grammaire et le catalogue, valider le document, l'exéc `analysis.nodes.` indique si un nœud est atteignable (`reachable`), s’il s’exécute toujours (`alwaysRuns`), comment il peut être ignoré (`maySkip`) et si son échec arrête l’exécution (`failureHandling: "halts"`) ou la laisse continuer (`"continues"`). `analysis.paths` liste les chemins que peut prendre une exécution réussie — jusqu’à 32, avec `count` pour le total — et nomme les nœuds dont l’échec termine une exécution. `types` donne le JSON Schema de l’entrée de l’exécution, de la sortie de chaque nœud et du résultat de l’automatisation ; `get_catalog` donne de la même façon l’`outputSchema` de chaque capacité. [Ce que Tale vérifie avant une exécution](/fr/platform/automations/concepts#checks) explique chaque famille de vérifications. -### Gestion des exécutions & déclencheurs +`detail` choisit ce qui accompagne les problèmes : `["analysis"]`, `["types"]` ou `[]` pour les problèmes seuls ; sans `detail`, tu reçois les deux. Certains avertissements ne vérifient pas le document, ils le comparent à ton organisation : un skill qu’aucune exécution de l’automatisation ne peut atteindre (`SKILL_UNKNOWN`), un connector que personne n’a connecté (`CONNECTOR_NOT_CONNECTED`), un secret que personne n’a enregistré (`SECRET_UNKNOWN`, signalé seulement aux rôles Propriétaire, Admin et Développeur), un environnement d’agent que ce déploiement ne peut pas exécuter (`HARNESS_UNKNOWN`) et un déclencheur d’événement qui attend un événement que Tale n’émet pas (`EVENT_UNKNOWN`). Ils n’empêchent jamais d’enregistrer ; les [outils de découverte](#discovery) listent ce qui existe. + +### Gestion des exécutions & déclencheurs {#management} | Outil | Ce qu'il fait | | ---------------- | -------------------------------------------------------------------------------------------------------------- | | `run_deployed` | Exécuter la version déployée et attendre jusqu'à 30 secondes sa sortie, sa trace et ses effets. Si elle continue, suivre le `runId` renvoyé. Prend le même `idempotencyKey` facultatif que `start_run`, dans le même registre que la porte REST : une répétition renvoie la première exécution avec `duplicate: true` et ne démarre rien, quelle que soit la porte qui l'a lancée. | -| `start_run` | Démarrer la version déployée en arrière-plan, puis suivre l'identifiant renvoyé avec `get_run`. Prend un `idempotencyKey` facultatif — l’`Idempotency-Key` de la porte REST, le même registre : la même clé avec les mêmes arguments répond la poignée de la première exécution avec `duplicate: true` et ne démarre rien, la même clé avec d’autres arguments est refusée (`IDEMPOTENCY_KEY_REUSED`). L’en-tête HTTP `Idempotency-Key` est refusé sur cet endpoint (**400**, `INVALID_HEADER`) : un lot porte jusqu’à 20 appels, la clé voyage donc dans les arguments de l’outil. | -| `list_runs` | Lister les exécutions accessibles d'une automatisation ou de plusieurs projets, les plus récentes d'abord, avec leur `projectId`. | -| `get_run` | Lire le statut, la sortie, la trace, les effets et le `projectId`. L'identifiant d'une exécution de projet s'utilise aussi dans `GET /api/v1/projects/{id}/runs/{runId}`. | +| `start_run` | Démarrer une exécution en arrière-plan, puis suivre l'identifiant renvoyé avec `get_run`. `mode: "live"` (par défaut) exécute pour de vrai la version en service ; `mode: "mock"` exécute n’importe quelle version enregistrée — la dernière sans `version` — avec les mocks déterministes, et l’exécution figure dans l’historique comme une exécution lancée dans l’application. Prend un `idempotencyKey` facultatif — l’`Idempotency-Key` de la porte REST, le même registre : la même clé avec les mêmes arguments répond la poignée de la première exécution avec `duplicate: true` et ne démarre rien, la même clé avec d’autres arguments est refusée (`IDEMPOTENCY_KEY_REUSED`). L’en-tête HTTP `Idempotency-Key` est refusé sur cet endpoint (**400**, `INVALID_HEADER`) : un lot porte jusqu’à 20 appels, la clé voyage donc dans les arguments de l’outil. | +| `list_runs` | Lister les exécutions accessibles d'une automatisation ou de plusieurs projets, les plus récentes d'abord, avec leur `projectId`. `mode` et `statuses` filtrent, et `nextCursor` (`null` sur la dernière page) est le `cursor` de la page plus ancienne suivante ; passe-le tel quel avec les mêmes filtres. | +| `get_run` | Lire le statut, la sortie, la trace, les effets et le `projectId`. L'identifiant d'une exécution de projet s'utilise aussi dans `GET /api/v1/projects/{id}/runs/{runId}`. Une exécution qui attend la réponse d’une personne (`waitingFor: "ask"`) donne la question sous `ask` : son `askId` et la question. `detail` choisit ce qui accompagne le statut ; `detail: []` ne renvoie que le statut, pour suivre une longue exécution. `include: ["record"]` ajoute l’exécution étape par étape sous `record` : le statut de chaque étape, pourquoi elle s’est exécutée ou a été ignorée – chaque condition expliquée avec les valeurs qu’elle a lues –, pourquoi elle a échoué (`failure.reason` et son explication) et un aperçu de ses valeurs ; `include: ["travels"]` ajoute les données qui ont circulé entre les étapes. | +| `get_run_node` | Lire une étape d’une exécution en entier – ou l’un de ses éléments ou passages (`item`, `pass`) : ce qu’elle a reçu et renvoyé, secrets retenus ; où le texte de chaque unité `{{ }}` a atterri ; ce qu’elle a lu des étapes précédentes ; en quoi sa sortie diffère de son entrée ; et son appel à un connecteur ou à un modèle. Une étape absente de l’enregistrement est refusée (`NODE_RUN_NOT_FOUND`). | +| `compare_runs` | Deux exécutions d’une automatisation côte à côte (`a`, la plus ancienne, et `b`) : ce qui a changé dans la version, en quoi l’entrée et la sortie diffèrent, le statut et les décisions de chaque étape, et la première étape où les exécutions ont divergé, avec les valeurs qui ont fait basculer sa condition. Les exécutions d’automatisations différentes sont refusées (`RUN_COMPARE_MISMATCH`). | +| `replay_run` | Relancer une exécution, dans son propre projet : avec sa propre entrée (`kind: "again"`), avec une `input` modifiée (`"edited"`) ou à partir d’une étape (`"from"` avec `from`) – les étapes qu’elle a terminées hors de cette étape et de ce qu’elle alimente sont réutilisées, le reste s’exécute à nouveau. `version` choisit la version (par défaut celle de l’exécution), `mode` le mode (celui de l’exécution ; une bifurcation d’une exécution simulée reste simulée). `dryRun: true` renvoie le plan à la place – ce qui est réutilisé, ce qui s’exécute à nouveau et combien d’écritures repartent une seconde fois. Une relance réelle demande le rôle de développeur et la version déployée ; refus : `REPLAY_RUN_NOT_FINISHED`, `REPLAY_NODE_UNKNOWN`, `REPLAY_GRAPH_CHANGED` (avec `data.nodes`), `REPLAY_MODE_MISMATCH`, `REPLAY_PROGRESS_UNREADABLE`, `REPLAY_INPUT_UNAVAILABLE`. Accepte `idempotencyKey` comme `start_run`. | | `cancel_run` | Arrêter une exécution lors du prochain passage d'un nœud à l'autre. | -| `list_versions` | L'historique de versions immuable d'une automatisation ; chaque ligne dit si elle est la version `deployed`, et `deployedVersion` la nomme à côté de la liste (`null` tant que rien n’est déployé). | +| `answer_run_ask` | Répondre à la question qu’une exécution en attente a posée à une personne (`get_run` la donne sous `ask`, avec l’`askId` à passer) ; l’exécution reprend avec la réponse, notée comme celle du titulaire de la clé. | +| `list_versions` | L'historique de versions immuable d'une automatisation ; chaque ligne dit si elle est la version `deployed`, qui l’a enregistrée par quel accès (`createdVia`, `clientName`), et `deployedVersion` nomme celle en service à côté de la liste (`null` tant que rien n’est déployé). `deployments` liste quand des versions sont passées en service, les plus récentes d’abord, avec la version en service avant. | +| `set_automation_projects` | Installer une automatisation dans des projets (`add`) et la retirer d’autres (`remove`) en une seule modification ; la réponse nomme ce qui est `added`, `removed` et `unchanged`. La retirer d’un projet où elle n’est pas installée est refusé (`AUTOMATION_NOT_INSTALLED`). | +| `get_automation_metrics` | Les chiffres d’exécution de l’organisation sur 7, 30 ou 90 jours (`periodDays`), exécutions réelles par défaut ou simulées : exécutions par résultat, taux de réussite, durée moyenne, une série par jour et les automatisations les plus utilisées, chacun comparé à la période précédente. | | `list_triggers` | Lire les déclencheurs sans révéler le secret du webhook. | | `delete_trigger` | Supprimer le déclencheur ; conserver les versions et l'historique des exécutions. | -| `set_trigger` | Configurer un déclencheur planifié, webhook ou événement. Le `token` d’un webhook est répondu une fois, ici, et plus jamais — conserve-le ; `deployed` dit si les livraisons tourneront : un déclencheur lié à une automatisation sans version déployée est enregistré et ne déclenche rien tant qu’une version n’est pas déployée. | +| `set_trigger` | Définir ce qui démarre l’automatisation : une planification (une règle de répétition ou une expression cron, dans un fuseau horaire), un webhook ou un événement de la plateforme, chacun avec une entrée fixe `input` facultative. L’appel remplace tout le déclencheur : renvoie donc le `startDate` et l’`input` que lit `list_triggers` pour les conserver. Le `token` d’un webhook est répondu une fois, ici, et plus jamais — conserve-le ; `deployed` dit si les livraisons tourneront : un déclencheur lié à une automatisation sans version déployée est enregistré et ne déclenche rien tant qu’une version n’est pas déployée. `warnings` indique ce que la version déployée ferait de l’entrée du déclencheur. | | Outil | Quand le choisir | | --- | --- | | `run_automation` | Essayer un document non enregistré avec les mocks déterministes ; `mode: "live"` est refusé | | `run_deployed` | Exécuter réellement la version déployée et attendre jusqu'à 30 secondes ; suivre ensuite le `runId` si elle continue | | `start_run` | Démarrer la version déployée en arrière-plan puis suivre `get_run` ; passe `idempotencyKey` pour qu’une répétition soit sûre | +| `start_run` avec `mode: "mock"` | Exécuter une version enregistrée — en service ou non — avec les mocks, avec une trace que chacun peut ouvrir dans l’historique des exécutions | + +Pour corriger une exécution échouée, lis-la avec `get_run {runId, include: ["record"]}` : le `failure.reason` de l’étape échouée nomme ce qui n’a pas fonctionné et son explication montre les valeurs que l’expression a lues. `get_run_node` lit cette étape en entier. Corrige le document, essaie-le avec `run_automation` sur l’entrée de l’exécution et, une fois une nouvelle exécution terminée, `compare_runs` montre où elle a pris un autre chemin. Les deux outils de version déployée utilisent le même moteur durable, avec les mêmes contrôles d'accès et traces d'exécution. `start_run` accepte un `projectId` facultatif. Une automatisation liée à des projets doit s'exécuter dans un projet où elle est installée ; une liaison unique peut être choisie automatiquement. Sans liaison, omettre le champ sélectionne le périmètre de l'organisation. Lis `projectIds` dans `list_automations` et le véritable `projectId` du résultat au lieu de deviner l'URL REST de suivi. -### Capacités & connaissances +### Découverte {#discovery} + +| Outil | Ce qu’il fait | +| --- | --- | +| `list_models` | Les modèles que tu peux utiliser, filtrés selon ton accès aux modèles : chacun avec `providerSlug` (un nœud `agent` l’enregistre comme `modelProvider`), `lane` (`direct` quand un fournisseur le sert, `subscription` ou `broker` quand c’est l’abonnement d’un membre), les `nodeTypes` qui lui conviennent (un nœud `llm` n’accepte qu’un modèle servi directement) et les environnements d’agent auxquels il est proposé (`harnesses`). `nodeType` et `harness` filtrent la liste. | +| `list_harnesses` | Les environnements d’agent qu’un nœud `agent` peut indiquer comme `harness`, celui par défaut (`default`) qui s’exécute quand il n’en indique aucun, et si un abonnement peut servir chacun. | +| `list_skills` | Les skills de l’organisation ; avec `projectId`, aussi les skills d’équipe de ce projet, ceux qu’une exécution dans ce projet peut utiliser. Un projet que tu ne peux pas lire répond `PROJECT_NOT_FOUND`. | +| `list_connectors` | Les connectors que ce déploiement propose, si ton organisation a connecté chacun (`connected`) et combien d’actions il compte ; `query` filtre. `search_catalog` liste les actions. | +| `list_agent_secrets` | Les noms des secrets d’agent de l’organisation avec un aperçu masqué (`preview`), jamais une valeur. Les rôles Propriétaire, Admin et Développeur les voient ; les autres reçoivent une liste vide avec une explication (`note`). | +| `list_projects` | Les projets que tu peux lire : si chacun est modifiable (`writable`) ou archivé (`archived`), et les automatisations installées que tu peux voir (`automations`). `query` filtre par nom ; `includeArchived` ajoute les projets archivés. | +| `list_events` | Les événements que Tale émet, chacun avec le moment où il se produit : ce qu’un déclencheur d’événement peut attendre. | + +Chaque réponse porte un `hint` qui nomme l’outil ou le paramètre qui la fait changer. + +### Paramètres {#settings} + +| Outil | Ce qu’il fait | +| --- | --- | +| `get_settings` | Sans `kinds`, le catalogue : chaque type de paramètre avec ce qu’il est, ses opérations (`ops`) et ses actions (`acts`), son `baseRisk`, les pages des paramètres où une personne fait la même modification (`areas`), si ce déploiement le sert par MCP (`available`) et si ton rôle peut le lire (`read`) et le modifier (`write`). Avec `kinds` — pour un seul type, aussi `ids` ou le `cursor` de sa page suivante —, chaque ressource que tu peux lire, avec sa `key`, sa `config` et son `hash`. Un type que tu ne peux pas lire figure sous `refused` avec la raison. | +| `plan_settings` | Planifie jusqu’à 32 modifications sans en faire aucune. Chacune indique son `action` (`create`, `update`, `delete`, `act` ou `unchanged`), le `currentHash`, un `diff` membre par membre, ses `effects` et son `risk` (`low`, `high` ou `critical`), ou le refus (`refusal`) qui l’arrête. | +| `apply_settings` | Applique les modifications. `expected` associe la `key` de chaque ressource modifiée au hash que tu as lu, ou `null` pour une ressource que tu crées. Si une modification est refusée ou si une ressource a changé depuis ta lecture, rien n’est appliqué. Sinon, les modifications s’exécutent dans un ordre fixe d’un type à l’autre, et la première qui échoue arrête les suivantes : la réponse indique ce qui a été appliqué (`applied`), ce qui a échoué (`failed`) et ce qui a été ignoré (`skipped`). | + +Une modification indique son type (`kind`), l’`id` de la ressource (absent pour un type qui n’a qu’une ressource) et son opération (`op`) : `set` remplace la ressource par toute la `config` et la crée si elle n’existe pas ; `delete` la supprime ; `act` lance une des actions du type, avec ses `args`. Planifie d’abord, montre le plan à la personne, puis applique les mêmes modifications : `apply_settings` demande à la personne avant chaque appel et dispose de son propre [budget](/fr/develop/rate-limits). + +[Paramètres par MCP](/fr/develop/mcp-settings) liste chaque type de paramètre, qui peut le modifier et ce qui reste dans Tale. + +Aucun secret ne passe par ces outils. Un secret enregistré se lit `{"masked": true, "preview": "…"}` ; renvoie cette valeur telle quelle pour le garder. Une modification qui porte une autre valeur à la place d’un secret, ou des identifiants n’importe où dans sa configuration, est refusée avec `SECRET_ARGUMENT_REFUSED` ; une personne saisit un nouveau secret dans Tale. + +### Capacités & connaissances {#capabilities} | Outil | Ce qu'il fait | | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | | `search_capabilities` | Rechercher les automatisations déployées de l'organisation par nom et description. | -| `invoke_capability` | Appeler une capacité par son `id`. Si une approbation est nécessaire, renvoyer son état en attente au lieu d'exécuter l'action. | +| `invoke_capability` | Appeler une capacité par son `id` : une automatisation déployée, exécutée en réel comme avec `run_deployed`. Si l’organisation soumet une étape à approbation, l’exécution attend qu’une personne décide dans Tale. | | `get_knowledge` | Récupérer des passages des documents et sites web explorés de l'organisation. `corpus` vaut `private` (documents), `public-web` (pages explorées) ou `all` ; les orthographes REST `documents` et `web` sont acceptées aussi. `query` est plafonné à 2000 caractères. Chaque passage porte `text`, `source` (un titre), `ref`, `corpus`, `chunkIndex`, `score`, `similarity` quand la recherche dense l’a classé, `url` pour une page web et — pour un document — le `documentId` qu’attend `GET /api/v1/documents/{id}` (l’id du fichier pour un résultat de projet) ainsi que son `projectId` : la même citation que renvoie la recherche REST. | -Le registre de capacités contient actuellement les automatisations déployées. Il n'inclut ni outils intégrés, ni actions de connectors, ni skills, ni serveurs MCP externes. Appeler une automatisation déployée correspond à la même opération réelle que `run_deployed`. Si une approbation est nécessaire, le résultat `pending` permet au client d'expliquer qu'une personne doit décider avant la poursuite. +Le registre de capacités contient actuellement les automatisations déployées. Il n'inclut ni outils intégrés, ni actions de connectors, ni skills, ni serveurs MCP externes. Appeler une automatisation déployée correspond à la même opération réelle que `run_deployed` et attend de la même façon jusqu’à 30 secondes la fin de l’exécution. Si une étape demande une [approbation](/fr/platform/approvals/concepts), l’exécution attend qu’une personne décide dans Tale : l’`output` de la réponse est l’exécution avec `status: "waiting"`, et `get_run` indique `waitingFor: "approval"`. Aucun outil ne l’approuve ni ne la rejette ; ton client doit donc prévenir la personne plutôt que réessayer. Arrêter l’exécution avec `cancel_run` retire l’approbation. + +## Ressources et prompts {#resources-and-prompts} + +En plus des outils, le point d’accès sert des ressources, qu’un client lit par leur adresse, et des prompts : des requêtes prêtes à l’emploi par lesquelles une personne commence un travail. Les deux lisent ce qu’un outil renvoie déjà, pour la même personne et avec les mêmes contrôles. + +### Lire par adresse {#resources} + +`resources/list` nomme d’abord les ressources fixes, puis chaque automatisation que le titulaire de la clé peut voir, 100 par page ; suis `nextCursor` pour la page suivante. `resources/templates/list` renvoie les modèles d’adresse, et `resources/read` le contenu d’une ressource. + +| Adresse | Contenu | Se lit comme | +| --- | --- | --- | +| `tale://docs/authoring`, `tale://docs/triggers`, `tale://docs/validation`, `tale://docs/settings`, `tale://docs/skill` | Les références, en Markdown | `get_docs` avec ce `topic` | +| `tale://catalog/{kind}` (`transform`, `llm`, `agent`, `subautomation`, `connector`) | La section de la référence consacrée à un type de nœud de base, ou les actions des connectors | `get_catalog` avec ce `kind` | +| `tale://automations/{name}` | La dernière version enregistrée, en JSON | `get_automation` | +| `tale://automations/{name}/versions/{version}` | Une version enregistrée ; `{version}` est un numéro ou `deployed` | `get_automation` avec `version` | +| `tale://runs/{runId}` | Une exécution avec sa sortie, sa trace et ses effets | `get_run` | + +Écris chaque `/` d’un nom d’automatisation sous la forme `%2F` : `tale://automations/billing%2Fdunning`. Une adresse qui ne trouve rien renvoie JSON-RPC `-32002` (`-32602` en `2026-07-28`) avec le code du refus dans `data.code`, par exemple `AUTOMATION_NOT_FOUND`. Une automatisation que le titulaire de la clé ne peut pas voir renvoie la même erreur qu’une automatisation qui n’existe pas. Une adresse mal formée, par exemple une version qui n’est pas un nombre, renvoie `-32602`. + +### Partir d’un prompt {#prompts} + +`prompts/list` nomme trois prompts, et `prompts/get` renvoie le message avec, en pièce jointe sous forme de ressource, ce dont il traite. Claude Code les affiche sous la forme `/tale:edit_automation`, et ainsi de suite. + +| Prompt | Arguments | Ce qu’il demande à l’agent | +| --- | --- | --- | +| `edit_automation` | `name` (facultatif) | Modifier l’automatisation ou en créer une, la valider, la tester sur les simulations et l’enregistrer avec `baseVersion` ; il ne met rien en service | +| `debug_failed_run` | `runId` | Expliquer pourquoi l’exécution a échoué, reproduire l’échec sur les simulations et proposer la plus petite correction | +| `add_trigger` | `name`, `kind` (facultatif : `schedule`, `webhook` ou `event`) | Choisir ce qui lance l’automatisation, et demander avant d’appeler `set_trigger` | + +Chaque argument est un seul mot, car des clients comme Claude Code séparent les arguments aux espaces. Un argument envoyé vide compte comme omis. Un prompt dont l’exécution ou l’automatisation n’est pas lisible par le titulaire de la clé renvoie `-32602` avec le code de cette lecture. ## Ce que la clé peut faire | Opération | Accès nécessaire | | --- | --- | -| Lectures, validation, simulations et tests d'acceptation, recherche de capacités, récupération de connaissances | Appartenance à l'organisation, puis règles habituelles de la ressource | -| Enregistrer, déployer, définir/supprimer un déclencheur, annuler ou exécuter réellement | Capacité développeur, puis règles habituelles de la ressource | +| Lectures, validation, simulations (y compris `start_run` avec `mode: "mock"`) et tests d'acceptation, recherche de capacités, récupération de connaissances | Appartenance à l'organisation, puis règles habituelles de la ressource | +| Répondre à la question d’une exécution | Appartenance à l’organisation ; pour une exécution dans un projet, droit de modifier ce projet | +| Noms des secrets d’agent (`list_agent_secrets`) | Rôle Propriétaire, Admin ou Développeur ; les autres reçoivent une liste vide | +| Lire, planifier et modifier les paramètres (`get_settings`, `plan_settings`, `apply_settings`) | Ce que ton rôle permet sur la même page des paramètres ; le catalogue indique ce que ton rôle peut faire de chaque type | +| Enregistrer, déployer, supprimer, installer dans des projets, définir/supprimer un déclencheur, annuler ou exécuter réellement | Capacité développeur, puis règles habituelles de la ressource | + +La clé identifie son titulaire ; elle n'élargit ni son rôle ni son accès aux projets. Une automatisation installée uniquement dans des projets que le titulaire de la clé ne peut pas lire n’apparaît pas dans `list_automations`, et toute lecture de celle-ci répond `AUTOMATION_NOT_FOUND`, comme pour une automatisation qui n’existe pas. Les appels réels via `invoke_capability` passent aussi par les contrôles d'exécution. -La clé identifie son titulaire ; elle n'élargit ni son rôle ni son accès aux projets. Les appels réels via `invoke_capability` passent aussi par les contrôles d'exécution. +Chaque modification qu’un appel MCP apporte à une automatisation — une version enregistrée, une mise en service, une suppression, un déclencheur défini ou retiré, une installation ajoutée ou retirée — figure dans le journal d’audit de l’organisation, marquée comme venue par MCP, avec l’outil et la clé API. Dans le détail de l’événement, **Source** affiche Agent de code, et **Client** nomme l’application de l’agent quand elle se nomme à chaque appel, comme en révision 2026-07-28 ; une application en révision 2025 ne se nomme qu’à `initialize`, et ses événements n’affichent donc pas de **Client** ([Journaux d’audit](/fr/platform/admin/governance/audit-logs)). Avant de configurer des outils privilégiés, lis `GET /api/v1/me` : `capabilities.developer` indique le droit lié au rôle actuel. `deploymentEditor` correspond à une liste opérateur distincte et n’autorise pas la création par MCP. Les erreurs d’outils gardent le format MCP décrit ci-dessous ; la lecture d’une capacité REST ne change pas leur traitement JSON-RPC. @@ -153,16 +261,19 @@ Avant de configurer des outils privilégiés, lis `GET /api/v1/me` : `capabiliti | Résultat | Traitement | | --- | --- | -| JSON-RPC `-32601` | Corriger la méthode inconnue | -| JSON-RPC `-32602` | Corriger le nom de l'outil ou ses arguments à partir de `tools/list` ; une valeur hors d’un ensemble énuméré est refusée et le message nomme l’ensemble | +| JSON-RPC `-32601` | Corriger la méthode inconnue ; en `2026-07-28`, l’erreur arrive avec HTTP `404`, y compris pour `initialize` et `ping` | +| JSON-RPC `-32602` | Corriger le nom de l'outil à partir de `tools/list`, le nom ou les arguments d’un prompt à partir de `prompts/list`, ou une adresse de ressource. Avec HTTP `400`, compléter le `_meta` de `2026-07-28` avec les entrées de `data.missing` ou `data.malformed` | +| JSON-RPC `-32002` | L’adresse de ressource ne trouve rien ; `data.code` nomme le refus, par exemple `AUTOMATION_NOT_FOUND`. En `2026-07-28`, la même réponse porte le code `-32602` | +| JSON-RPC `-32020` (HTTP `400`) | Les en-têtes d’une requête `2026-07-28` ne reprennent pas son corps ; envoyer `MCP-Protocol-Version`, `Mcp-Method` et `Mcp-Name` comme décrit dans [Révisions du protocole](#protocol-revisions) | +| JSON-RPC `-32022` (HTTP `400`) | Envoyer une des révisions de `data.supported` : dans `MCP-Protocol-Version` et, en `2026-07-28`, aussi dans `_meta`. Une révision de 2025 s’ouvre avec `initialize` | | Résultat avec `isError: true` | Lire le `code` stable, l'`error` explicative et le `hint` dans le texte ; `data` peut détailler les champs invalides | | `validate_automation` avec `valid: false` | Verdict normal de validation ; examiner `errors` et leurs emplacements ([Lire un résultat de validation](#validation-result)), même si `isError` reste false. Les avertissements ne rendent jamais un document invalide | -| Capacité avec `pending` | Résultat normal d'approbation ; ni une fin d'exécution, ni un échec à relancer | +| Capacité dont l’`output` porte `status: "waiting"` | L’exécution attend, par exemple une approbation qu’une personne donne dans Tale ; elle n’est ni terminée ni en échec. Interroger `get_run`, sans relancer | | Capacité avec `refused` | Résultat d'erreur ; corriger la cause indiquée | -Les codes de refus comprennent `AUTOMATION_NOT_FOUND`, `AUTOMATION_VERSION_UNKNOWN`, `AUTOMATION_NOT_DEPLOYED`, `RUN_NOT_FOUND`, `AUTOMATION_INVALID`, `AUTOMATION_TESTS_FAILING`, `LIVE_MODE_UNAVAILABLE` et `NOT_SUPPORTED`. Ce dernier indique que l'hôte ne prend pas en charge l'opération sur les exécutions, versions ou déclencheurs. `start_run` refuse un `idempotencyKey` réutilisé avec d’autres arguments par `IDEMPOTENCY_KEY_REUSED` ; `invoke_capability` refuse un id que le registre ne tient pas — une automatisation seulement enregistrée n’y est pas — par `CAPABILITY_NOT_FOUND` et une entrée que son schéma rejette par `CAPABILITY_INPUT_INVALID` ; `get_knowledge` transmet les codes propres de la porte des connaissances (`KNOWLEDGE_UNAVAILABLE` quand la recherche elle-même a échoué). Les erreurs de plateforme conservent leur code, leur conseil et leurs données éventuelles ; par exemple, l'absence d'accès développeur renvoie `FORBIDDEN_DEVELOPER_SETTINGS`. +Les codes de refus comprennent `AUTOMATION_NOT_FOUND`, `AUTOMATION_VERSION_UNKNOWN`, `AUTOMATION_NOT_DEPLOYED`, `RUN_NOT_FOUND`, `AUTOMATION_INVALID`, `AUTOMATION_TESTS_FAILING`, `AUTOMATION_VERSION_STALE`, `AUTOMATION_DEPLOYMENT_STALE`, `AUTOMATION_NAME_TAKEN`, `AUTOMATION_HAS_ACTIVE_RUNS`, `AUTOMATION_NOT_INSTALLED`, `HUMAN_ASK_NOT_FOUND`, `HUMAN_ASK_NOT_PENDING`, `HUMAN_ASK_EXPIRED`, `EMPTY_ANSWER`, `INVALID_CURSOR`, `LIVE_MODE_UNAVAILABLE` et `NOT_SUPPORTED`. Ce dernier indique que l'hôte ne prend pas en charge l'opération sur les exécutions, versions ou déclencheurs. `start_run` refuse un `idempotencyKey` réutilisé avec d’autres arguments par `IDEMPOTENCY_KEY_REUSED` ; `invoke_capability` refuse un id que le registre ne tient pas — une automatisation seulement enregistrée n’y est pas — par `CAPABILITY_NOT_FOUND` et une entrée que son schéma rejette par `CAPABILITY_INPUT_INVALID` ; `get_knowledge` transmet les codes propres de la porte des connaissances (`KNOWLEDGE_UNAVAILABLE` quand la recherche elle-même a échoué). Les erreurs de plateforme conservent leur code, leur conseil et leurs données éventuelles ; par exemple, l'absence d'accès développeur renvoie `FORBIDDEN_DEVELOPER_SETTINGS`. `INVALID_ARGUMENTS` liste chaque problème d’argument ; une valeur hors d’un ensemble énuméré est refusée et le message nomme l’ensemble. `RATE_LIMITED` signifie que l’outil avait besoin d’une exécution, ou d’une modification de paramètres, et que le [budget](/fr/develop/rate-limits) du détenteur de la clé pour celle-ci est épuisé : attends `data.retryAfterMs`. `INTERNAL_ERROR` signifie que l’appel a échoué de façon inattendue ; communique son `data.requestId` à l’équipe qui exploite le déploiement. Les outils de paramètres ajoutent `SETTINGS_STALE` (une ressource a changé depuis ta lecture ; `data.currentHash` est son hash actuel), `SECRET_ARGUMENT_REFUSED` (une modification portait un secret ; `data.places` dit où, jamais quoi), `SETTINGS_KIND_UNAVAILABLE` (ce déploiement ne sert pas ce type par MCP), `SETTINGS_NOT_FOUND` (une action sur une ressource qui n’existe pas) et `SETTINGS_DUPLICATE` (une ressource modifiée deux fois dans un même appel). -Un nom d'automatisation inconnu est aussi une erreur pour `list_versions`, `list_runs` et `list_triggers`. Une liste vide signifie qu'une automatisation existante n'a pas d'éléments correspondants. La seule exception est l’historique des exécutions : une automatisation supprimée conserve ses exécutions, `list_runs {name}` les renvoie donc tant qu’elles existent, et seul un nom qui n’a jamais tourné donne `AUTOMATION_NOT_FOUND`. `get_catalog` restreint à un type de nœud de base (`transform`, `llm`, `agent`, `subautomation`) répond une liste vide accompagnée d’un `hint` renvoyant à `get_docs`, comme le fait `search_catalog`. Un document invalide soumis à un outil qui exige un document valide, une recherche échouée ou un déploiement absent produisent `isError: true`. Seul l'outil de validation présente un document invalide comme son verdict normal. +Un nom d'automatisation inconnu est aussi une erreur pour `list_versions`, `list_runs` et `list_triggers`. Une liste vide signifie qu'une automatisation existante n'a pas d'éléments correspondants. La seule exception est l’historique des exécutions : une automatisation supprimée conserve ses exécutions, `list_runs {name}` les renvoie donc tant qu’elles existent, et seul un nom qui n’a jamais tourné donne `AUTOMATION_NOT_FOUND`. `get_catalog` restreint à un type de nœud de base (`transform`, `llm`, `agent`, `subautomation`) répond une liste vide accompagnée d’un `hint` renvoyant à `get_docs`, comme le fait `search_catalog`, et de la section de la référence consacrée à ce type de nœud sous `reference`. Un document invalide soumis à un outil qui exige un document valide, une recherche échouée ou un déploiement absent produisent `isError: true`. Seul l'outil de validation présente un document invalide comme son verdict normal. ## Où ça se place diff --git a/docs/fr/develop/mcp-settings.md b/docs/fr/develop/mcp-settings.md new file mode 100644 index 0000000000..127b2c87cb --- /dev/null +++ b/docs/fr/develop/mcp-settings.md @@ -0,0 +1,129 @@ +--- +title: Paramètres par MCP +description: Laisse un agent de code lire et modifier les paramètres de Tale par le point d’accès MCP, dans les limites du rôle de la personne dont il utilise la clé API. +--- + +Un agent de code connecté au [point d’accès MCP](/fr/develop/mcp-endpoint) lit les paramètres de ton organisation, planifie une modification et l’applique avec trois outils : `get_settings`, `plan_settings` et `apply_settings`. Il agit avec le rôle de la personne dont il utilise la clé API. Il peut modifier ce que cette personne pourrait modifier dans l’application, avec les mêmes contrôles, et les [journaux d’audit](/fr/platform/admin/governance/audit-logs) enregistrent chaque modification comme faite par cette personne, par MCP. + +## Ce qu’un agent peut modifier {#kinds} + +Tale lit et écrit chaque type de paramètre avec son propre code et les contrôles qu’applique l’application : les règles de rôle sont donc les mêmes que dans l’application. + +| Type | Ce qu’il contient | Modifications | Qui peut le modifier | +| --- | --- | --- | --- | +| `provider` | Un fournisseur IA que ton organisation a défini : son point d’accès, son format d’API et son catalogue de modèles. Les fournisseurs livrés avec Tale ne sont pas des paramètres. | Définir, supprimer ; relire son catalogue de modèles (`refresh-catalogs`) | Propriétaires, admins et développeurs | +| `provider-credential` | Des identifiants qui lisent leur clé dans une variable d’environnement du déploiement. Les identifiants avec une clé ou un abonnement sont listés sans leur secret et peuvent être supprimés. | Définir, supprimer | Propriétaires, admins et développeurs | +| `governance` | Une politique de l’organisation, désignée par sa clé : modèles et accès aux modèles, budgets et limites, sécurité de connexion et de session, garde-fous, quotas de sandbox. | Définir | Propriétaires et admins | +| `knowledge-embedding` | Le modèle d’embedding des connaissances de l’organisation, avec son seuil de similarité et ses limites d’utilisation. | Définir | Propriétaires et admins | +| `branding` | La couleur d’accentuation et les noms de fichier du logo et des favicons. | Définir | Propriétaires et admins | +| `project-instructions` | Les instructions permanentes d’un projet. | Définir | Qui peut modifier le projet | +| `agent-instructions` | Les instructions d’un agent de projet. | Définir | Qui peut modifier le projet | +| `agent-tools` | Les outils qu’un agent de projet peut utiliser. | Définir | Qui peut modifier le projet | +| `agent-model` | L’environnement d’agent (harness), le modèle et le fournisseur avec lesquels travaille un agent de projet. Un changement s’applique aux exécutions qu’il lance ensuite. | Définir | Qui peut modifier le projet | +| `task-instructions` | La description d’une tâche. | Définir | Qui peut modifier la tâche | +| `task-review-context` | Si le travail d’une tâche passe par une relecture indépendante d’un autre agent de projet, et lequel. Une fois défini, l’agent relecteur reste le même. | Définir | Qui peut modifier le projet | +| `deployment` | Les paramètres propres au déploiement, communs à toutes les organisations qu’il héberge, comme l’environnement d’exécution des sandboxes. | Définir | Tout propriétaire ou admin d’une organisation du déploiement peut les lire ; seules les adresses de la liste d’autorisation des éditeurs du déploiement peuvent les modifier | + +Une ressource a un identifiant au sein de son type : un fournisseur, son nom ; des identifiants, `/` avec le nom encodé en URI ; une politique, sa clé, comme `password_policy` ; un projet, son identifiant ; un agent, `/` ; une tâche, `/`. Le modèle d’embedding, le branding et les paramètres du déploiement n’ont pas d’identifiant. `get_settings` liste les paramètres des projets et des agents page par page, sur les projets que tu peux lire ; il ne lit la description d’une tâche et son contexte de relecture que par l’identifiant de la tâche. + +Certaines modifications restent dans Tale : + +- Chaque secret, comme la clé API d’un fournisseur, un abonnement ou la clé du fournisseur de modération, est saisi par une personne dans Tale. +- La politique de conservation et la politique des demandes des personnes concernées changent uniquement par leurs propres procédures échelonnées. +- Les images du branding sont téléversées dans Tale. Un nom de fichier qu’un agent définit doit désigner une image déjà téléversée. +- Par MCP, le modèle d’embedding lui-même ne change que tant que les connaissances de l’organisation ne contiennent aucun document et aucun site web : ainsi, les vecteurs de deux modèles ne se rencontrent jamais dans une même recherche. Son seuil de similarité et ses limites d’utilisation changent à tout moment ; si des documents sont indexés, une personne change le modèle dans Tale. +- L’agent standard d’un projet suit la politique `standard_agent`, que modifie le type `governance` ; ses propres instructions, outils et modèle ne sont pas des paramètres. +- Aucun type ne couvre les membres, les équipes, les connectors, les skills, les compétences, les conservations légales, les journaux d’audit, les métriques ni les paramètres personnels. `get_settings` sans arguments indique ce que couvre chaque type. + +## Faire une modification {#make-a-change} + +1. Appelle `get_settings` sans arguments. La réponse liste chaque type, indique si ce déploiement le sert et si ton rôle peut le lire et le modifier. +2. Lis ce que tu veux modifier avec `get_settings` et `kinds` (et `ids`). Chaque ressource arrive avec sa `key`, sa `config` et son `hash`. +3. Planifie la modification avec `plan_settings`. Un `set` remplace toute la ressource par sa `config` : envoie donc chaque champ qui doit rester, tel que tu l’as lu. Le plan indique pour chaque modification son action, son diff, ses effets et son risque, ou le refus qui l’arrête. Rien n’est écrit. +4. Montre le plan à la personne et attends sa décision. Commence par les effets et le risque. +5. Applique les mêmes modifications avec `apply_settings`. `expected` associe la `key` de chaque ressource modifiée au hash que tu as lu, ou `null` pour une ressource que tu crées. + +Voici les arguments d’un plan qui active la rotation des mots de passe : + +```json +{ + "changes": [ + { + "kind": "governance", + "id": "password_policy", + "op": "set", + "config": { + "minLength": 12, + "requireUpper": true, + "requireLower": true, + "requireDigit": true, + "requireSpecial": true, + "rotationDays": 90 + } + } + ] +} +``` + +Le plan indique l’effet sur les membres, car la rotation fait expirer les mots de passe déjà définis. Le hash est raccourci ici : + +```json +{ + "ok": true, + "changes": [ + { + "kind": "governance", + "id": "password_policy", + "key": "governance/password_policy", + "op": "set", + "action": "update", + "currentHash": "5c1f…", + "diff": [{ "path": "/rotationDays", "before": 0, "after": 90 }], + "effects": ["may-lock-out-members"], + "risk": "critical" + } + ] +} +``` + +Pour l’appliquer, envoie les mêmes `changes` avec `"expected": { "governance/password_policy": "5c1f…" }`, en utilisant le hash complet. Avant toute écriture, chaque modification est de nouveau planifiée par rapport à ce qui est enregistré maintenant. Si l’une est refusée, ou si une ressource a changé depuis ta lecture, rien n’est appliqué. Sinon, les modifications s’exécutent dans un ordre fixe d’un type à l’autre, pour que ce à quoi une ressource fait référence existe d’abord. La première modification qui échoue arrête les suivantes, et la réponse indique ce qui a été appliqué (`applied`), ce qui a échoué (`failed`) et ce qui a été ignoré (`skipped`). Une modification déjà appliquée n’est pas annulée. + +`apply_settings` demande à la personne avant chaque appel et dispose de son propre [budget](/fr/develop/rate-limits). + +## Lire les effets d’un plan {#effects} + +Le risque d’un plan est le plus élevé entre le risque de base de son type et celui de ses effets. Voici les effets que peuvent nommer les types servis aujourd’hui : + +| Effet | Risque | Quand un plan le nomme | +| --- | --- | --- | +| `may-lock-out-members` | critical | Le verrouillage de connexion est actif après la modification, la rotation des mots de passe commence ou se raccourcit, ou l’authentification à deux facteurs devient plus stricte | +| `signs-out-members` | critical | Le délai d’inactivité est activé ou raccourci | +| `removes-human-approval` | critical | Une règle d’approbation ou une exigence de relecture ne demande plus l’avis d’une personne | +| `changes-serving-account` | high | Le point d’accès d’un fournisseur change, ou d’autres identifiants servent ses requêtes | +| `breaks-dependents` | high | Les identifiants actifs par défaut du fournisseur sont supprimés et rien ne les remplace | +| `requires-empty-corpus` | critical | Le modèle d’embedding change, ce qui exige que les connaissances de l’organisation soient vides | +| `restart-required` | critical | L’environnement d’exécution des sandboxes du déploiement change | +| `reaches-vendor` | high | Le catalogue de modèles d’un fournisseur est relu avec la clé de ton organisation | + +La référence des paramètres que `get_docs` renvoie pour le sujet `settings` (aussi `tale://docs/settings`) liste tout le vocabulaire, les champs de chaque type et chaque politique. + +## Secrets {#secrets} + +Aucun secret n’entre dans un appel de paramètres ni n’en sort. Un secret enregistré se lit `{"masked": true, "preview": "…"}`, de même que tout identifiant trouvé ailleurs dans un paramètre enregistré, par exemple une clé que quelqu’un a collée dans une politique dans Tale. Renvoie cette valeur telle quelle pour garder ce qui y est enregistré. Une modification qui contient un secret est refusée avec `SECRET_ARGUMENT_REFUSED`, qui indique où le secret a été trouvé, jamais sa valeur. Une personne saisit un nouveau secret dans Tale. + +## Quand une modification est refusée {#refusals} + +Un refus arrive sous forme de données, avec un `error`, un `code`, un `hint` et parfois `data`, jamais comme une connexion interrompue. Voici les codes qu’un agent rencontre le plus souvent : + +| Code | Ce qu’il signifie | +| --- | --- | +| `SETTINGS_STALE` | La ressource a changé depuis sa lecture. Relis-la, planifie par rapport à ce qui est enregistré maintenant et applique avec `data.currentHash`. | +| `SETTINGS_INVALID` | La configuration ne correspond pas au type. `data.issues` indique chaque problème avec son emplacement dans la configuration, y compris un champ que le paramètre ne connaît pas. | +| `SECRET_ARGUMENT_REFUSED` | La modification contient un secret. `data.places` indique où. | +| `SETTINGS_TALE_ONLY` | Cette modification se fait uniquement dans Tale, par exemple pour des identifiants avec une clé. | +| `FORBIDDEN`, `ORG_FORBIDDEN`, `FORBIDDEN_DEVELOPER_SETTINGS` | Le rôle de la personne ne permet pas non plus cette modification dans Tale. Réessayer ne sert à rien. | +| `EMBEDDING_CORPUS_NOT_EMPTY` | Le modèle d’embedding ne change que tant que les connaissances de l’organisation sont vides. `data` indique combien de documents et de sites web elles contiennent. | +| `BRANDING_IMAGE_UNKNOWN` | Un nom de fichier du branding ne désigne aucune image téléversée dans l’organisation. | +| `PROVIDER_IN_USE`, `CREDENTIAL_IN_USE` | Des identifiants désignent encore le fournisseur, ou le modèle d’embedding utilise ces identifiants. Modifie-les d’abord. | + +La référence des paramètres liste chaque code. La page du [point d’accès MCP](/fr/develop/mcp-endpoint#settings) décrit les arguments et les réponses des outils. diff --git a/docs/fr/develop/rate-limits.md b/docs/fr/develop/rate-limits.md index e3e8fae544..c1d42b0916 100644 --- a/docs/fr/develop/rate-limits.md +++ b/docs/fr/develop/rate-limits.md @@ -14,7 +14,8 @@ Un seau de jetons se remplit en continu jusqu’à sa capacité de rafale. Une c | Trafic | Débit soutenu | Rafale | Budget attribué à | | --- | --- | --- | --- | | Appels généraux `/api/v1`, MCP et endpoints de modèles compris | 120/minute | 200 | Détenteur de la clé | -| Démarrages d’exécution, messages au modèle et démarrages de tâche | 20/minute | 40 | Détenteur de la clé | +| Démarrages d’exécution, messages au modèle, démarrages de tâche et exécutions MCP | 20/minute | 40 | Détenteur de la clé | +| Modifications de paramètres par MCP (`apply_settings`) | 30/minute | 60 | Détenteur de la clé | | Autorisation de téléversement et rattachement de fichier au projet | 240/minute | 300 | Détenteur de la clé | | Authentification par clé API échouée | 20/minute | 40 | IP source | | Livraisons webhook avant validation du jeton | 120/minute | 240 | Adresse de l’expéditeur | @@ -24,7 +25,7 @@ Les appels REST d’exécution et de téléversement consomment aussi le budget L’exécution comprend les démarrages d’automatisation avec ou sans projet, les messages de fil et les démarrages explicites de tâche. La création ou mise à jour d’une tâche consomme aussi ce budget si `runWorkflowSlug` est fourni. Une requête qui démarre du travail est facturée une fois que son corps et ses en-têtes ont passé les vérifications propres de la porte — un `400 INVALID_BODY` ou `INVALID_HEADER` ne coûte rien — et avant que quoi que ce soit soit cherché, si bien qu’un `404` pour un fil, une tâche ou une automatisation que tu ne peux pas voir coûte un jeton, comme un `409` que l’état répond. Certaines mutations, comme les commentaires de tâche ou les changements de dossier, ont des limites supplémentaires partagées avec l’application. -Dans un lot MCP, les appels d’outil supplémentaires consomment du budget supplémentaire. Le [point d’accès MCP](/fr/develop/mcp-endpoint) distingue une réponse HTTP `429` d’un message refusé à l’intérieur du lot. Les webhooks ont des budgets séparés ; les limites de l’expéditeur et du déclencheur doivent toutes deux permettre la livraison. +Dans un lot MCP, les appels d’outil supplémentaires consomment du budget supplémentaire. Le [point d’accès MCP](/fr/develop/mcp-endpoint) distingue une réponse HTTP `429` d’un message refusé à l’intérieur du lot. Un outil MCP qui exécute une automatisation (`run_automation`, `test_automation`, `deploy_automation`, `run_deployed`, `start_run` et `invoke_capability`) consomme en plus une exécution, une fois que le rôle du détenteur de la clé autorise l’appel ; de même pour `answer_run_ask`, dont la réponse relance une exécution en attente, comme la réponse REST. Quand ce budget est épuisé, l’appel reçoit un résultat d’outil dont le `code` est `RATE_LIMITED` et dont `data.retryAfterMs` indique l’attente, et non une réponse HTTP `429`. Les lectures, la validation et l’enregistrement ne consomment aucune exécution. Une modification de paramètres (`apply_settings`) consomme de la même façon une unité de son propre budget de paramètres et reçoit `RATE_LIMITED` dès qu’il est épuisé ; lire et planifier des paramètres n’en consomme pas. Les webhooks ont des budgets séparés ; les limites de l’expéditeur et du déclencheur doivent toutes deux permettre la livraison. Les appels aux [endpoints de modèles](/fr/develop/api-reference#model-endpoints) sous `/api/v1/openai` et `/api/v1/anthropic` ne comptent que dans le budget général, pour une requête chacun, en flux ou non ; ce qu’un appel peut dépenser est plafonné à part par les règles de budget. Une personne, et chaque clé API, peuvent en outre avoir huit de ces appels en cours en même temps : un neuvième reçoit `429` avec le `code` `MODEL_API_CONCURRENCY_EXCEEDED` et `Retry-After: 2`. diff --git a/docs/fr/develop/use-tale-from-your-editor.md b/docs/fr/develop/use-tale-from-your-editor.md index 1c0047c6d0..ca3be85971 100644 --- a/docs/fr/develop/use-tale-from-your-editor.md +++ b/docs/fr/develop/use-tale-from-your-editor.md @@ -349,6 +349,36 @@ Pour partager le serveur avec une équipe dans un `.mcp.json` versionné, fais r `claude mcp list` indique si Claude Code joint le serveur. +### Prompts et ressources dans Claude Code {#prompts-and-resources} + +Une fois le serveur enregistré sous le nom `tale`, tape `/` dans Claude Code pour trouver les prompts de Tale : `/tale:edit_automation`, `/tale:debug_failed_run` et `/tale:add_trigger`. Les arguments suivent la commande, séparés par des espaces, par exemple `/tale:debug_failed_run `. Chaque prompt joint ce dont il traite et demande à l’agent de te consulter avant toute mise en service. + +Tape `@` pour mentionner une ressource de Tale, par exemple `@tale:tale://runs/` pour une exécution ou `@tale:tale://docs/triggers` pour la référence des déclencheurs. Claude Code la lit avec ta clé et la joint à ton message. [Ressources et prompts](/fr/develop/mcp-endpoint#resources-and-prompts) liste chaque adresse et chaque prompt. + +### Installer le skill Tale {#tale-skill} + +Le skill Tale est un fichier `SKILL.md` au format Agent Skills. Il apprend à ton agent comment travailler dans Tale : la boucle de modification, les tests sur les simulations, les déclencheurs, l’analyse d’une exécution échouée, la lecture d’un refus et les règles qu’il respecte, comme te consulter avant toute mise en service. Ce n’est pas l’un des skills de ton organisation, et il ne nomme ni hôte, ni organisation, ni clé : une seule copie sert à tous tes projets. Place-le là où ton agent lit ses skills : + +| Agent | Ce projet | Tous tes projets | +| --- | --- | --- | +| Claude Code | `.claude/skills/tale/SKILL.md` | `~/.claude/skills/tale/SKILL.md` | +| Codex | `.agents/skills/tale/SKILL.md` | `~/.agents/skills/tale/SKILL.md` | + +Lis-le par le point d’accès MCP avec ta clé. L’exemple l’enregistre pour Claude Code dans le projet courant ; pour un autre agent, change le dossier : + +```bash +mkdir -p .claude/skills/tale +curl --fail-with-body "$TALE_URL/api/v1/mcp" \ + --header "Authorization: Bearer $TALE_API_KEY" \ + --header "X-Organization-Slug: $TALE_ORG_SLUG" \ + --header 'MCP-Protocol-Version: 2025-11-25' \ + --header 'Content-Type: application/json' \ + --data '{"jsonrpc":"2.0","id":1,"method":"resources/read","params":{"uri":"tale://docs/skill"}}' \ + | jq -r '.result.contents[0].text' > .claude/skills/tale/SKILL.md +``` + +Un agent connecté peut aussi lire `tale://docs/skill` et enregistrer le fichier lui-même. Le skill correspond à la version de Tale dont il provient : récupère-le de nouveau après une mise à jour. Les références vers lesquelles il renvoie sont lues à chaque fois depuis ton déploiement. + ## Confier tes scripts à un agent de projet Pour que la modification se fasse dans Tale, dans une sandbox et avec la revue d’une personne, confie le script à un [agent de projet](/fr/platform/projects/project-agents). Tale exécute alors un environnement de code comme OpenCode dans une sandbox, avec le modèle configuré sur l’agent. L’exécution compte dans les budgets du membre qui l’a démarrée et lui est attribuée ; une exécution que tu lances en REST t’est imputée, pas à la clé API. Les fichiers modifiés reviennent comme résultats de la tâche, qui attend ensuite la revue d’une personne. [Choisir un environnement d’agent](/fr/platform/agents/harnesses) compare les environnements ; OpenCode passe uniquement par la passerelle de modèles de Tale et ne reçoit donc jamais de clé de fournisseur. @@ -389,14 +419,14 @@ tale_api -X POST "$TALE_URL/api/v1/projects/$PROJECT_ID/tasks/$TASK_ID/comments" echo "TASK_ID=$TASK_ID" ``` -`externalSystem` et `externalId` rendent la tâche idempotente : un nouvel envoi de la même paire renvoie la tâche existante. Une description contient jusqu’à 20 000 caractères ; pour un script plus long, charge-le dans le projet comme l’explique [Charger un fichier en deux étapes](/fr/develop/api-reference#charger-un-fichier-en-deux-etapes). Un agent répond à son identifiant et à son nom en minuscules, les espaces remplacés par des points ou supprimés ; `@assistant.scripts` fonctionne donc aussi. +`externalSystem` et `externalId` rendent la tâche idempotente : un nouvel envoi de la même paire renvoie la tâche existante. Une description contient jusqu’à 20 000 caractères ; pour un script plus long, charge-le dans le projet comme l’explique [Charger un fichier en deux étapes](/fr/develop/api-reference#charger-un-fichier-en-deux-etapes). Le commentaire désigne l’agent par son identifiant ; son `handle` fonctionne aussi, ici `@assistant-scripts`, et figure dans ce que tu lis de l’agent. Tale enregistre l’un comme l’autre comme une mention de l’agent lui-même : le commentaire continue de le désigner après un renommage. Relu, son `body` est `[@Assistant scripts](mention:agent/) prends cette tâche, s’il te plaît.` et son `bodyText` est `@Assistant scripts prends cette tâche, s’il te plaît.` La mention affecte la tâche à l’agent et démarre une exécution ; la tâche passe à `in_progress`. Une mention qui ne peut pas démarrer d’exécution reste un simple commentaire, sans message d’erreur, par exemple quand tu ne peux pas modifier la tâche, que l’automatisation des tâches est désactivée ou qu’une autre exécution occupe déjà la tâche. Définis `TASK_ID` sur la valeur affichée par le script, vérifie la tâche, puis lis le compte rendu de l’agent une fois la tâche arrivée à `in_review` : ```bash tale_api "$TALE_URL/api/v1/projects/$PROJECT_ID/tasks/$TASK_ID" | jq -r '.task.status' tale_api "$TALE_URL/api/v1/projects/$PROJECT_ID/tasks/$TASK_ID/comments?limit=20" \ - | jq -r '.comments[] | select(.authorType == "agent") | .body' + | jq -r '.comments[] | select(.authorType == "agent") | .bodyText' ``` Examine les fichiers modifiés dans les résultats de la tâche, dans l’application, avant de valider la tâche. Pour renvoyer l’agent au travail avec des corrections, publie un nouveau commentaire qui le mentionne. diff --git a/docs/fr/develop/webhooks.md b/docs/fr/develop/webhooks.md index 57e55540f0..22eae12ddc 100644 --- a/docs/fr/develop/webhooks.md +++ b/docs/fr/develop/webhooks.md @@ -42,7 +42,7 @@ L'acceptation renvoie HTTP `202` et une réponse de forme `{"runId":"..."}`. Con } ``` -Lis la commande via `input.payload.orderId`. Si l'automatisation déclare un schéma `inputs`, il doit décrire cette enveloppe. Un corps qui n'est pas du JSON devient du texte dans `payload`. La limite est de 256 Kio (262 144 octets), comptés pendant la réception ; une requête plus grande reçoit `413`. +Lis la commande via `input.payload.orderId`. Si l'automatisation déclare un schéma `inputs`, il doit décrire cette enveloppe. Un déclencheur avec une entrée fixe ajoute ses champs à côté de `trigger` et `payload` dans l’entrée de chaque livraison ; les [paramètres du déclencheur](/fr/platform/automations/triggers#entree-fixe) de l’application la définissent, et l’API la prend sous `input`. Un corps qui n'est pas du JSON devient du texte dans `payload`. La limite est de 256 Kio (262 144 octets), comptés pendant la réception ; une requête plus grande reçoit `413`. ### Suivre le résultat @@ -53,6 +53,8 @@ Lis la commande via `input.payload.orderId`. Si l'automatisation déclare un sch Interroge la route avec une clé API dont le titulaire peut lire ce périmètre, ou ouvre l'exécution dans Tale. Le jeton webhook autorise les livraisons, pas la lecture des résultats REST. Attends un état terminal avant d'annoncer que le travail a réussi. +Dans l’application, **Livraisons récentes**, sous le déclencheur de l’onglet **Général** de l’automatisation, liste les dix dernières exécutions lancées par le webhook, les plus récentes d’abord, avec leur statut. Tant que Tale se souvient d’une livraison, chaque ligne nomme l’en-tête d’où vient son identifiant, ou indique qu’elle n’en a pas. Les requêtes refusées ne lancent aucune exécution et n’y figurent pas ; leur réponse fait foi. + ### Interpréter les réponses | Statut | Code/résultat | Action | diff --git a/docs/fr/platform/admin/connectors.md b/docs/fr/platform/admin/connectors.md index 5950617d41..39b3993e38 100644 --- a/docs/fr/platform/admin/connectors.md +++ b/docs/fr/platform/admin/connectors.md @@ -47,7 +47,7 @@ Supprimer des identifiants retire l’accès aux automatisations et agents qui e ## Préparer une application OAuth -Les propriétaires et les admins utilisent **Apps OAuth**, en bas de page, pour configurer les applications fournisseur utilisées pendant le consentement. Une application propre à l’organisation remplace celle du déploiement. Si aucune n’existe, le connector ne peut pas commencer l’autorisation et la page indique qu’il n’est pas configuré. +Les propriétaires et les admins utilisent **Apps OAuth**, en bas de page, pour configurer les applications fournisseur utilisées pendant le consentement. Une application propre à l’organisation remplace celle du déploiement. Si aucune n’existe, le connector ne peut pas commencer l’autorisation et la page indique qu’il n’est pas configuré. Si Tale ne peut pas vérifier si une application d’import de connaissances est configurée, sa ligne affiche **Statut indisponible** sans **Configurer**, et **Réessayer** relance la vérification. Tu pourras configurer l’application dès que la vérification aboutira. Sélectionne **Configurer**, renseigne l’identifiant client et le secret du fournisseur, puis enregistre chez celui-ci les URI de redirection exactes affichées dans le dialogue. Une application Microsoft peut aussi demander l’identifiant du répertoire ou du locataire. Lors d’une modification ultérieure, laisse le champ du secret enregistré vide pour le conserver. diff --git a/docs/fr/platform/admin/governance/audit-logs.md b/docs/fr/platform/admin/governance/audit-logs.md index b202748768..0dd8ef43d7 100644 --- a/docs/fr/platform/admin/governance/audit-logs.md +++ b/docs/fr/platform/admin/governance/audit-logs.md @@ -26,7 +26,8 @@ L’onglet actif et la catégorie figurent dans l’URL : tu peux enregistrer la | --- | --- | | Horodatage | Quand Tale a enregistré l’action. | | Action | L’opération tentée ou terminée. Certaines actions récentes apparaissent sous leur nom technique. | -| Utilisateur | La personne ou l’acteur système responsable. | +| Utilisateur | La personne ou l’acteur système responsable. Pour une écriture faite avec une clé API, Utilisateur désigne la personne qui a créé la clé et le type d’acteur est API. Si la clé agit pour un membre, les Métadonnées conservent son identifiant dans `keyAttribution.subjectUserId`. Les exports JSON gardent aussi l’identifiant de la clé (`apiKeyId`) ; le CSV ne contient ni la clé ni les métadonnées du membre. | +| Source et client | Uniquement pour une action qu’un agent de code a effectuée par l’[endpoint MCP](/fr/develop/mcp-endpoint). **Source** affiche Agent de code, et **Client** nomme l’application de l’agent quand elle se nomme à chaque appel, comme le font les applications en révision MCP 2026-07-28 ; une application en révision antérieure ne se nomme qu’à la connexion, et ses événements n’affichent donc pas de **Client**. **Utilisateur** désigne la personne qui a créé la clé ; le membre pour lequel elle agit figure dans les Métadonnées. | | Ressource et cible | Le type d’élément et l’enregistrement concerné. | | Catégorie | Le groupe utilisé par le filtre. | | Statut | Réussite, échec ou refus. | diff --git a/docs/fr/platform/admin/governance/data-subject-requests.md b/docs/fr/platform/admin/governance/data-subject-requests.md index 062af1cc6c..abadeb5e41 100644 --- a/docs/fr/platform/admin/governance/data-subject-requests.md +++ b/docs/fr/platform/admin/governance/data-subject-requests.md @@ -20,6 +20,8 @@ En tant qu’admin ou propriétaire, utilise **Paramètres > Gouvernance > Perso L’effacement supprime définitivement les données couvertes ; il ne les déplace pas vers la corbeille. Le reçu indique les catégories et les nombres concernés : chats, documents et imports, préférences, retours, notifications, usage et nettoyage des identifiants personnels dans l’audit. L’effacement supprime aussi les espaces de travail de sandbox propres aux [exécutions d’agent que la personne a démarrées](/fr/platform/projects/tasks#executions-demarrees-par-un-membre), même si du travail s’y exécute encore ; le reçu les compte sous **Espaces de travail de sandbox**. Un espace de travail n’est compté qu’une fois ses fichiers supprimés par le service de sandbox, ce qui peut prendre un moment pour un grand espace. D’ici là, ou tant que leur suppression échoue, le reçu indique **Partiel** et cite `sandboxWorkspaces` parmi les passes échouées ; choisis plus tard **Réessayer**, et l’effacement se termine dès que les fichiers ont disparu. Sous Kubernetes, un espace est compté une fois son volume remis au provisionneur de stockage du cluster ; avec une StorageClass dont la `reclaimPolicy` est `Retain`, les fichiers du volume restent jusqu’à ce qu’un opérateur supprime le volume, même si le reçu compte l’espace. Un service de sandbox ou un appareil qui n’est pas encore passé à cette version ne peut pas confirmer la suppression ; le reçu reste alors **Partiel** jusqu’à sa mise à jour. +La catégorie **Requêtes aux modèles** couvre les requêtes à l’API des modèles et les appels directs aux modèles dans les automatisations. Les requêtes déjà comptabilisées sont supprimées. Une requête encore en cours conserve les données nécessaires à sa comptabilisation, avec un pseudonyme à la place de l’identité de la personne. L’usage reçu plus tard est enregistré sous ce pseudonyme. Si la suppression de l’exécution d’automatisation ou de l’identité échoue, le reçu reste **Partiel** et le nettoyage des données d’usage qui en dépend attend une nouvelle tentative. + Les tâches qui désignent la personne comme **Relecteur** perdent cette désignation. Une demande de revue qui l’attend encore passe à la première personne autorisée parmi celle qui a créé la tâche, puis celle qui a créé le projet. Cette personne reçoit une notification. Pour une tâche archivée, la demande passe sans notification. Les décisions de revue que la personne a déjà prises restent enregistrées sans son nom. ## Vérifier la règle avant le dépôt @@ -46,6 +48,8 @@ Seul le propriétaire peut modifier cette règle. Les protections renforcées s Un reçu ouvert peut empêcher un second dépôt pour la même personne. Reprends ce reçu au lieu de multiplier les demandes. Une demande bloquée dès le dépôt doit à nouveau respecter la règle actuelle d’approbation et d’attente lors d’un nouvel essai. Un reçu en attente d’approbation conserve l’exigence d’approbation fixée à son dépôt : désactiver la double approbation ensuite ne le libère pas. +Les exécutions d’automatisation suspendues lors d’une mise à niveau sont conservées tant que leurs actions externes antérieures restent non vérifiées. L’effacement supprime les autres exécutions admissibles de la personne et compte séparément celles qui ont été effacées et celles qui ont été conservées. Le reçu reste partiel. Ces blocages d’exécution sont distincts des conservations légales et aucune action ne permet actuellement de les lever. Une demande d’arrêt ou une nouvelle tentative d’effacement ne les lève pas. Une organisation contenant ces blocages ne peut pas non plus être supprimée. + ## Gérer l’échéance La liste montre le délai suivi et les éventuels retards. Utilise **Prolonger le délai** pour une prolongation justifiée tant que l’action est disponible. L’application autorise une prolongation avant l’expiration du délai initial et enregistre le motif ainsi que l’admin. diff --git a/docs/fr/platform/admin/governance/policies-and-limits.md b/docs/fr/platform/admin/governance/policies-and-limits.md index 9a2477f3c0..6c7310aed0 100644 --- a/docs/fr/platform/admin/governance/policies-and-limits.md +++ b/docs/fr/platform/admin/governance/policies-and-limits.md @@ -16,24 +16,30 @@ En tant qu’admin ou propriétaire, utilise **Paramètres > Gouvernance > Polit 1. Dans les règles de budget, choisis **Ajouter une règle**. 2. Choisis la portée et sa cible : un rôle pour un groupe comme les rédacteurs, une équipe pour un travail commun, un projet pour tout ce qui est dépensé dans un projet, une personne pour une limite individuelle, une clé API pour un identifiant, ou l’organisation pour un plafond partagé. La liste des clés API propose chaque clé active qui fonctionne dans l’organisation, avec le nom de ce à quoi elle appartient : la clé personnelle d’un membre, une clé qu’un admin a créée pour un membre, et les clés d’une équipe, d’un projet ou de l’organisation elle-même. Tu peux ainsi plafonner le script ou l’outil de code d’une seule personne, ou l’intégration d’une équipe. 3. Sélectionne une période quotidienne, hebdomadaire ou mensuelle. Renseigne au moins une limite positive de tokens, de coût ou de requêtes. Le coût est en USD ; un champ vide ne plafonne pas cette dimension par cette règle. -4. Définis si besoin le seuil d’alerte entre 0 et 100 pour avertir avant d’atteindre le plafond. Un budget de projet n’a pas de seuil d’alerte. +4. Définis si besoin le seuil d’alerte entre 0 et 100 pour avertir avant d’atteindre le plafond. L’alerte d’un budget de projet s’affiche pour toutes les personnes qui discutent dans le projet. 5. Choisis **Confirmer**, enregistre les changements de la page et vérifie la portée, la cible, la période et les limites enregistrées. Par exemple, une règle mensuelle de rôle peut donner aux rédacteurs un budget personnel de 50 USD, tandis qu’une règle d’organisation plafonne les dépenses cumulées à 500 USD. Ce sont des exemples, pas des valeurs recommandées. Une règle reste dans le tableau même quand sa clé API ne fonctionne plus. **Cible** indique toujours la clé et la personne qui la détient, avec un statut : **Expirée** tant que la clé expirée est encore conservée, **Désactivée**, **Révoquée** si cette organisation a enregistré sa révocation, ou **Ancien membre** lorsque cette personne a quitté l’organisation. **Indisponible** signifie que la clé est connue mais n’est plus conservée, sans motif enregistré ; le nettoyage des clés expirées peut produire cet état. **Clé inconnue** signale une clé sur laquelle cette organisation n’a aucune information. Supprime une telle règle, ou modifie-la pour choisir une clé active. -Les budgets concernent les nouveaux travaux facturables, dont le chat, la sortie vocale, les exécutions d’agents gérés, les étapes `llm` des automatisations, les images que créent les agents et les appels aux endpoints de modèles. Tale vérifie chaque requête de chat avant son exécution — un message envoyé, une réponse régénérée ou modifiée, les deux côtés d’une comparaison de modèles, un message en attente d’une pièce jointe et un envoi par l’API REST — et la refuse dès qu’un plafond applicable est atteint, en indiquant ce plafond et le moment de sa réinitialisation. Les réponses en cours de rédaction réservent ce qu’elles peuvent dépenser, afin que des requêtes envoyées au même moment ne franchissent pas ensemble un plafond presque atteint. La demande d’image d’un agent est vérifiée de la même façon avant l’appel au modèle d’images : pendant que ses images sont créées, elle réserve un coût estimé, et la vérification compte aussi ce que l’exécution de l’agent peut encore dépenser pour son modèle. Chaque image compte pour une requête. La génération d’images a besoin de limites de coût ou de requêtes, car son usage ne se mesure pas en tokens de texte. Une limite de tokens compte les tokens d’entrée et de sortie, et l’entrée comprend la partie d’un prompt qu’un fournisseur a lue dans son cache ou y a écrite. Cette partie est facturée autrement que le reste de l’entrée : un agent qui réutilise un long prompt peut donc atteindre une limite de tokens alors que son coût reste faible. Examine les alertes dans l’[analyse de l’usage](/fr/platform/admin/governance/usage-analytics). +Les budgets concernent les nouveaux travaux facturables, dont le chat, la sortie vocale, les transcriptions et la dictée, l’indexation et la recherche de connaissances, les exécutions d’agents gérés, les étapes `llm` des automatisations, **Améliorer avec l'IA** dans la boîte de réception, les images que créent les agents et les appels aux endpoints de modèles. Tale vérifie chaque requête de chat avant son exécution — un message envoyé, une réponse régénérée ou modifiée, les deux côtés d’une comparaison de modèles, un message en attente d’une pièce jointe et un envoi par l’API REST — et la refuse dès qu’un plafond applicable est atteint, en indiquant ce plafond et le moment de sa réinitialisation. Les réponses en cours de rédaction réservent ce qu’elles peuvent dépenser, tour après tour, tout comme la sortie vocale en cours, l’étape `llm` d’une automatisation, le titre d’un chat, **Améliorer avec l'IA**, une transcription et chaque requête d’embedding de l’indexation et de la recherche de connaissances, afin que des requêtes envoyées au même moment ne franchissent pas ensemble un plafond presque atteint. La demande d’image d’un agent est vérifiée de la même façon avant l’appel au modèle d’images : pendant que ses images sont créées, elle réserve un coût estimé, et la vérification compte aussi ce que l’exécution de l’agent peut encore dépenser pour son modèle. Chaque image compte pour une requête. La génération d’images a besoin de limites de coût ou de requêtes, car son usage ne se mesure pas en tokens de texte. Un appel de connector — un outil de recherche ou web de l’assistant, l’étape de connector d’un agent ou d’une automatisation, un e-mail envoyé depuis la boîte de réception — est compté à part et jamais imputé à une limite de requêtes. Un tour d’agent géré sur un abonnement de fournisseur compte pour une requête sans coût : les limites de requêtes et de tokens s’appliquent à lui, les limites de coût non. Une limite de tokens compte les tokens d’entrée et de sortie, et l’entrée comprend la partie d’un prompt qu’un fournisseur a lue dans son cache ou y a écrite. Cette partie est facturée autrement que le reste de l’entrée : un agent qui réutilise un long prompt peut donc atteindre une limite de tokens alors que son coût reste faible. Examine les alertes dans l’[analyse de l’usage](/fr/platform/admin/governance/usage-analytics). + +La sortie vocale réserve son coût estimé et une requête tant que la tentative est en cours. L’étape `llm` d’une automatisation réserve l’entrée estimée et la sortie autorisée au tarif du catalogue, ainsi qu’une requête. Ces réservations partagent les plafonds applicables avec le chat et les agents gérés. Ce sont des estimations, pas une garantie du montant finalement facturé par le fournisseur. + +Si une tentative vocale déjà réservée échoue ou si son résultat reste inconnu, Tale comptabilise une seule fois l’estimation enregistrée et une requête, même si l’échec précède l’appel au fournisseur. Un appel direct de modèle d’automatisation dont le résultat est inconnu est lui aussi comptabilisé selon l’estimation réservée. Cette comptabilisation prudente ne confirme pas une facturation par le fournisseur. Une nouvelle tentative nécessite une nouvelle réservation et doit tenir dans le budget en comptant l’estimation précédente. ## Comprendre les plafonds applicables Pour chaque dimension, la limite personnelle vient de la règle la plus précise qui la définit : personne, équipe, rôle, puis valeur par défaut. Si une personne appartient à plusieurs équipes dotées d’une règle, le plafond le plus strict s’applique à elle. Les plafonds de l’organisation s’ajoutent. Un budget d’équipe plafonne aussi l’usage cumulé des membres actuels de l’équipe, même si un membre a une règle personnelle plus précise : l’usage d’un nouveau membre sur la période en cours compte aussitôt, et celui d’un membre parti ne compte plus. Les limites de clé API plafonnent séparément les requêtes authentifiées par cette clé, dont l’usage est imputé à la clé, pas les autres actions dans l’interface. La clé propre d’une équipe, d’un projet ou de l’organisation n’est pas une personne : aucune règle de personne, de rôle ou par défaut ne s’applique à elle. Les limites de l’organisation et ses règles de clé API s’appliquent, la clé d’une équipe compte pour le budget de son équipe, qui la plafonne, et la clé d’un projet de même pour le budget de son projet. -Un budget de projet plafonne tout ce qui est dépensé dans un projet, quelle que soit la personne qui dépense : les chats du projet, avec leurs titres, les réponses lues à voix haute et les appels d’outils de l’assistant ; les exécutions de ses agents et les étapes d’agent et `llm` des automatisations qui y tournent, avec les images qu’elles créent ; et les appels faits avec les propres clés API du projet. Il s’ajoute aux limites de la personne qui a demandé le travail, y compris pour les exécutions lancées par une planification, et ne s’applique jamais au travail hors du projet. Les réponses de chat et les tours d’agent encore en cours dans le projet réservent aussi sur son budget ce qu’ils peuvent encore dépenser, pour que des requêtes envoyées en même temps ne franchissent pas ensemble un budget de projet presque atteint. Quand il refuse un message de chat, Tale indique que la limite du projet est atteinte. Les enregistrements transcrits ne comptent pas pour un projet, et un budget de projet n’avertit personne avant d’être atteint. Une automatisation compte pour le projet dans lequel elle tourne. Une exécution qui ne nomme aucun projet, d’une automatisation installée dans plusieurs projets, compte pour chacun d’eux et doit tenir dans le budget de chacun, comme l’usage d’un membre compte pour chacune de ses équipes ; une automatisation installée dans aucun projet ne compte que pour l’organisation. +Un budget de projet plafonne tout ce qui est dépensé dans un projet, quelle que soit la personne qui dépense : les chats du projet, avec leurs titres, les réponses lues à voix haute, les enregistrements qui y sont transcrits et les appels d’outils et recherches de l’assistant ; les fichiers indexés pour lui ; les exécutions de ses agents et les étapes d’agent et `llm` des automatisations qui y tournent, avec les images qu’elles créent ; et les appels faits avec les propres clés API du projet. Il s’ajoute aux limites de la personne qui a demandé le travail, y compris pour les exécutions lancées par une planification, et ne s’applique jamais au travail hors du projet. Les réponses de chat et leurs titres, les tours d’agent, les tentatives vocales, les transcriptions et les appels de modèles d’automatisation en cours réservent aussi leur usage admis sur le budget du projet, afin que les requêtes simultanées tiennent compte de ces réservations. Quand il refuse un message de chat, Tale indique que la limite du projet est atteinte. Avec un seuil d’alerte, toutes les personnes qui discutent dans le projet voient ce qui reste de son budget dès que l’usage dépasse le seuil, dans une bannière qui nomme le projet. Une automatisation compte pour le projet dans lequel elle tourne. Une exécution qui ne nomme aucun projet, d’une automatisation installée dans plusieurs projets, compte pour chacun d’eux et doit tenir dans le budget de chacun, comme l’usage d’un membre compte pour chacune de ses équipes ; une automatisation installée dans aucun projet ne compte que pour l’organisation. + +Les tours de chat, les tentatives vocales et les appels de modèles d’automatisation conservent les projets enregistrés lors de leur admission. Déplacer le chat ou modifier les installations d’une automatisation dans des projets pendant son exécution ne déplace ni sa réservation ni son usage comptabilisé ensuite. Une tentative admise sans projet reste hors des budgets de projet. -![La fenêtre Ajouter une règle de budget avec la portée Projet, le projet Website relaunch, une période mensuelle et un coût maximal de 200 USD ; les limites de tokens et de requêtes restent vides, et aucun seuil d’alerte n’est proposé pour un projet.](/images/platform/governance-budget-project-rule.webp) +![La fenêtre Ajouter une règle de budget avec la portée Projet, le projet Website relaunch, une période mensuelle et un coût maximal de 200 USD ; les limites de tokens et de requêtes restent vides, tout comme le seuil d’alerte, dont la note précise que toutes les personnes qui discutent dans le projet voient son alerte.](/images/platform/governance-budget-project-rule.webp) diff --git a/docs/fr/platform/admin/governance/usage-attribution.md b/docs/fr/platform/admin/governance/usage-attribution.md index 8412b08eb9..d54a4293de 100644 --- a/docs/fr/platform/admin/governance/usage-attribution.md +++ b/docs/fr/platform/admin/governance/usage-attribution.md @@ -7,7 +7,9 @@ Chaque requête d’IA que Tale émet pour ton organisation est enregistrée une ## Ce qui compte comme usage -Tale enregistre une requête chaque fois qu’un modèle ou un service mesuré tourne pour ton organisation : une réponse de chat, y compris une réponse régénérée ou modifiée et les deux côtés d’une comparaison de modèles ; le court appel de modèle qui donne son titre à un nouveau chat ; l’appel de modèle d’une étape `llm` d’automatisation ; un tour d’un agent géré qui travaille sur une tâche ou dans une automatisation ; une image que crée un tel agent ; une sortie vocale ; la transcription d’un enregistrement téléversé ; un appel de connector mesuré ; et un appel aux endpoints de modèles avec une clé API. Chaque enregistrement porte les tokens ou unités consommés et le coût estimé d’après le tarif public du fournisseur à ce moment-là ; pour un appel aux endpoints de modèles, c’est le coût mesuré par la passerelle de modèles. +Tale enregistre une requête chaque fois qu’un modèle ou un service mesuré tourne pour ton organisation : une réponse de chat, y compris une réponse régénérée ou modifiée et les deux côtés d’une comparaison de modèles ; le court appel de modèle qui donne son titre à un nouveau chat ; une réécriture avec **Améliorer avec l'IA** dans la boîte de réception ; l’appel de modèle d’une étape `llm` d’automatisation ; un tour d’un agent géré qui travaille sur une tâche ou dans une automatisation ; une image que crée un tel agent ; une sortie vocale ; la transcription d’un enregistrement téléversé ou d’une dictée ; les embeddings qui indexent les connaissances et ceux que demande chaque recherche de connaissances ; et un appel aux endpoints de modèles avec une clé API. Chaque enregistrement porte les tokens ou unités consommés — pour une transcription, les minutes d’audio — et le coût estimé d’après le tarif public du fournisseur à ce moment-là ; pour un appel aux endpoints de modèles, c’est le coût mesuré par la passerelle de modèles. + +Tale compte aussi chaque appel qu’il fait par un connector — les outils de recherche et web de l’assistant, l’étape de connector d’un agent ou d’une automatisation, un e-mail envoyé depuis la boîte de réception — comme un appel de connector, sans coût. Un appel de connector n’est jamais une requête : les limites de requêtes ne comptent que les requêtes de modèle. ## À qui une requête est imputée @@ -16,18 +18,22 @@ La règle est la même partout : une requête compte pour la personne qui a dem | Travail | Compte pour | Compte aussi pour | Apparaît dans l’analyse de l’usage comme | | --- | --- | --- | --- | | Une réponse de chat, ou le titre d’un nouveau chat | Le membre qui a envoyé le message | La clé API, quand le message est passé par l’API REST | L’assistant utilisé ; un titre sous `thread-title` | -| Une exécution d’agent sur une tâche | Le membre qui a lancé l’exécution depuis la tâche, ou avec un commentaire ou une description de tâche qui mentionne l’agent ; pour une exécution lancée par un autre agent ou par une étape d’automatisation, le membre pour qui compte l’exécution de cet agent ou de cette automatisation | — | Le nom de l’agent sous **Principaux assistants** | +| Une réécriture avec **Améliorer avec l'IA** dans la boîte de réception | Le membre qui l’a demandée | — | `inbox-improve` sous **Principaux assistants** | +| Une exécution d’agent sur une tâche | Le membre qui a lancé l’exécution depuis la tâche, ou avec un commentaire ou une description de tâche qui mentionne l’agent ; pour une exécution lancée par un autre agent ou par une étape d’automatisation, le membre pour qui compte l’exécution de cet agent ou de cette automatisation | La clé API, quand l’exécution a été lancée avec une clé : par l’API REST, ou par une étape d’une exécution d’automatisation lancée avec une clé | Le nom de l’agent sous **Principaux assistants** | | Une exécution d’automatisation lancée par quelqu’un | Le membre qui l’a lancée depuis la liste des exécutions, le builder, un chat, une tâche, l’API REST ou le point d’accès MCP | La clé API, quand l’exécution a été lancée avec une clé | Le nom de l’automatisation sous **Principaux assistants** | | Une exécution d’automatisation lancée par un déclencheur | Personne : une planification, un webhook ou un événement n’a personne derrière lui | — | La ligne **Automatisations (déclencheurs)** sous **Utilisation par utilisateur** | | Une exécution d’agent de projet lancée par une planification, ou une exécution qu’un autre agent a lancée depuis une telle exécution | Personne, comme pour l’exécution lancée par la planification elle-même | — | La ligne **Automatisations (déclencheurs)** sous **Utilisation par utilisateur**, et le nom de l’agent sous **Principaux assistants** | | Une image que crée un agent | La personne pour qui l’exécution de l’agent compte : celle qui l’a lancée, ou personne pour une exécution lancée par un déclencheur | La clé API, quand l’exécution a été lancée avec une clé | Le nom de l’agent ou de l’automatisation sous **Principaux assistants**, et le modèle d’images sous **Principaux modèles** | -| Une sortie vocale ou une transcription | Le membre qui l’a demandée | — | **Sortie vocale** ou **Transcription** sous **Principaux assistants** ; la sortie vocale aussi sous **Principaux modèles vocaux** | -| Un appel de connector mesuré | Le membre dont la requête a provoqué l’appel | — | L’assistant qui l’a fait, ou **Connector** | +| Une sortie vocale ou une transcription | Le membre qui l’a demandée ; pour la transcription d’un enregistrement, la personne qui l’a ajouté, y compris lors d’une nouvelle tentative | — | **Sortie vocale** ou **Transcription** sous **Principaux assistants** ; la sortie vocale aussi sous **Principaux modèles vocaux** | +| Indexation et recherche de connaissances (embeddings) | L’indexation : le membre qui a ajouté le fichier — le propriétaire d’un lecteur synchronisé —, ou l’organisation pour une pièce jointe d’e-mail, un e-mail entrant et une analyse de site lancée par une planification. Une recherche : le membre qui recherche | La clé API avec laquelle est venue une recherche, ou un site ajouté par l’API | **Indexation et recherche des connaissances** sous **Principaux assistants** | +| Un appel de connector : un outil de recherche ou web de l’assistant, l’étape de connector d’un agent ou d’une automatisation, un e-mail envoyé depuis la boîte de réception | Le membre qui l’a fait ; pour l’étape d’un agent ou d’une automatisation, la personne à qui son exécution est imputée ; pour un e-mail, le membre qui l’a envoyé | La clé API avec laquelle il est venu | Pas comme requête : les appels de connector sont comptés à part et n’augmentent aucun nombre de requêtes | | Un appel aux [endpoints de modèles](/fr/develop/use-tale-from-your-editor#model-endpoints) | Le membre dont la clé API l’a envoyé | La clé API | **Appel API direct** sous **Principaux assistants** | -Une nouvelle tentative d’une exécution d’agent poursuit l’exécution lancée par son initiateur ; son usage reste donc imputé à cette personne. Quand une intégration agit avec une clé API pour un autre membre, l’exécution compte pour ce membre, et la limite de la clé la compte aussi. +Une nouvelle tentative d’une exécution d’agent poursuit l’exécution lancée par son initiateur ; son usage reste donc imputé à cette personne et à la clé API avec laquelle l’exécution a été lancée. Quand un commentaire qui mentionne un agent au travail relance son tour, le reste de ce tour est imputé à l’auteur du commentaire, et à la clé API avec laquelle il a été écrit. Quand une intégration agit avec une clé API pour un autre membre, l’exécution compte pour ce membre, et la limite de la clé la compte aussi. + +Le travail dans un projet compte aussi pour ce projet, quelle que soit la personne qui l’a demandé : les chats du projet, avec leurs titres, les réponses lues à voix haute, les enregistrements qui y sont transcrits et les appels d’outils et recherches de l’assistant ; les fichiers indexés pour lui ; les exécutions de ses agents et les étapes d’agent et `llm` des automatisations qui y tournent, avec les images qu’elles créent ; et les appels faits avec les propres clés API du projet. Une exécution qui ne nomme aucun projet, d’une automatisation installée dans plusieurs projets, compte pour chacun d’eux ; une automatisation installée dans aucun projet ne compte que pour l’organisation. -Le travail dans un projet compte aussi pour ce projet, quelle que soit la personne qui l’a demandé : les chats du projet, avec leurs titres, les réponses lues à voix haute et les appels d’outils de l’assistant ; les exécutions de ses agents et les étapes d’agent et `llm` des automatisations qui y tournent, avec les images qu’elles créent ; et les appels faits avec les propres clés API du projet. Une exécution qui ne nomme aucun projet, d’une automatisation installée dans plusieurs projets, compte pour chacun d’eux ; une automatisation installée dans aucun projet ne compte que pour l’organisation. Une transcription ne compte pas pour un projet. +Les tours de chat, les tentatives vocales et les appels de modèles d’automatisation conservent les projets enregistrés lors de leur admission. Déplacer le chat ou modifier les installations d’une automatisation dans des projets pendant son exécution ne déplace ni sa réservation ni son usage comptabilisé ensuite. Une tentative admise sans projet reste hors des budgets de projet. Une clé API qu’un admin a créée pour un membre compte pour ce membre, comme sa propre clé. Une clé qui appartient à une équipe, à un projet ou à l’organisation ([Clés API](/fr/platform/admin/api-keys#create-a-key-for-someone-else)) n’est pas une personne : ce qu’elle demande compte pour la clé elle-même. L’analyse de l’usage la présente sur sa propre ligne sous **Utilisation par utilisateur**, sous le nom de la clé avec son équipe, son projet ou l’organisation en dessous, et ne la compte jamais comme utilisateur actif. La clé d’une équipe compte aussi dans l’usage de son équipe. @@ -38,7 +44,9 @@ Une clé API qu’un admin a créée pour un membre compte pour ce membre, comme - **Les limites de clé API** s’appliquent aux requêtes authentifiées par cette clé : les messages de chat qu’elle a envoyés, ses appels aux endpoints de modèles et les exécutions qu’elle a lancées. - **Les limites de projet** s’appliquent au travail dans ce projet, quelle que soit la personne qui l’a demandé, y compris aux exécutions lancées par un déclencheur. -Quand une limite est atteinte, Tale refuse la requête suivante avant de l’exécuter et nomme la limite. Un tour d’agent géré est refusé à son démarrage ; un tour déjà en cours conserve l’enveloppe qui lui a été accordée. Une image que l’agent demande pendant son tour est vérifiée à part, avant l’appel au modèle d’images : si une limite est atteinte, Tale refuse l’image et le tour continue. L’image puise aussi dans l’enveloppe du tour qui l’a demandée. L’étape `llm` d’une automatisation est vérifiée avant chaque appel de modèle : si une limite refuse l’appel, l’étape échoue avec `budget_exceeded` et son erreur nomme la limite ; l’exécution échoue avec elle, sauf si le `onError` de l’étape vaut `continue`. L’étape ne réserve rien pendant son appel ; des exécutions lancées au même moment peuvent donc franchir ensemble une limite presque atteinte. [Comment les règles se combinent](/fr/platform/admin/governance/policies-and-limits#how-rules-combine) traite le cas où plusieurs règles visent la même personne. +Quand une limite est atteinte, Tale refuse la requête suivante avant de l’exécuter et nomme la limite. Un tour d’agent géré est refusé à son démarrage ; un tour déjà en cours conserve l’enveloppe qui lui a été accordée. Un tour servi par un abonnement de fournisseur que l’organisation paie en dehors de Tale ne coûte rien par appel : il compte pour une requête, avec les tokens que son agent indique. Une limite de requêtes ou de tokens le refuse donc à son démarrage, une limite de coût non. Une image que l’agent demande pendant son tour est vérifiée à part, avant l’appel au modèle d’images : si une limite est atteinte, Tale refuse l’image et le tour continue. L’image puise aussi dans l’enveloppe du tour qui l’a demandée. L’étape `llm` d’une automatisation est vérifiée avant chaque appel de modèle : si une limite refuse l’appel, l’étape échoue avec `budget_exceeded` et son erreur nomme la limite ; l’exécution échoue avec elle, sauf si le `onError` de l’étape vaut `continue`. L’étape réserve l’entrée estimée et la sortie autorisée au tarif du catalogue, ainsi qu’une requête, jusqu’à la comptabilisation. Les appels simultanés tiennent donc compte de leurs réservations respectives. Si le résultat du fournisseur reste inconnu, Tale comptabilise une seule fois l’estimation enregistrée au lieu de la libérer silencieusement ; une nouvelle tentative passe par une nouvelle admission. Le titre d’un chat, une réécriture avec **Améliorer avec l'IA** et une transcription sont vérifiés de la même façon avant que Tale appelle le modèle, par rapport à une estimation du coût le plus élevé que l’appel peut atteindre — pour une réponse écrite, le prompt et la plus longue réponse que l’appel permet ; pour une transcription, la durée de l’enregistrement sans ses longs silences, au prix par minute du modèle — et réservent ce montant pendant l’appel. Un titre refusé n’est pas une erreur : le chat est alors nommé d’après son premier message, sans appel de modèle. Un modèle de transcription dont le catalogue ne connaît pas le prix par minute — facturé aux tokens, ou servi par un endpoint qui ne publie aucun prix — ne compte que pour les limites de requêtes, sans coût. Une transcription refusée affiche **Limite d'utilisation atteinte** ; choisis **Réessayer** dès que la limite le permet. Une dictée refusée indique que la limite est atteinte, et un lien vidéo est refusé avant son téléchargement. Chaque requête d’embedding est vérifiée de la même façon. Une recherche de connaissances refusée par une limite le dit et ne répond jamais « rien trouvé » ; l’indexation attend en revanche : un document affiche **En attente d'une limite d'utilisation**, un site garde ses pages sans recherche par le sens, et tous deux reprennent d’eux-mêmes dans l’heure qui suit la réinitialisation ou le relèvement de la limite. Une réponse de chat réserve aussi chaque tour supplémentaire de son utilisation d’outils, dès que ce tour commence. [Comment les règles se combinent](/fr/platform/admin/governance/policies-and-limits#how-rules-combine) traite le cas où plusieurs règles visent la même personne. + +La sortie vocale réserve son coût estimé et une requête tant que la tentative est en cours. Une tentative déjà réservée qui échoue ou dont le résultat reste inconnu est comptabilisée une seule fois selon cette estimation, y compris si l’échec précède l’appel au fournisseur. Cette comptabilisation prudente ne confirme pas une facturation. Une nouvelle tentative tient compte de l’estimation précédente lors de la vérification du budget restant. ## Trois situations à connaître @@ -50,4 +58,4 @@ Quand une limite est atteinte, Tale refuse la requête suivante avant de l’ex ## Ce que voient les membres -**Paramètres > Utilisation** liste chaque limite qui s’applique au membre connecté avec son utilisation actuelle : les chats envoyés, les sorties vocales demandées, les appels aux endpoints de modèles et les exécutions d’agents et d’automatisations lancées, quelle que soit la façon de les lancer. Les limites partagées d’équipe et d’organisation y figurent aussi, parce qu’elles peuvent être atteintes avant une limite personnelle. La limite d’un projet n’y figure pas ; une requête qu’elle refuse la nomme. +**Paramètres > Utilisation** liste chaque limite qui s’applique au membre connecté avec son utilisation actuelle : les chats envoyés, les sorties vocales demandées, les appels aux endpoints de modèles et les exécutions d’agents et d’automatisations lancées, quelle que soit la façon de les lancer. Les limites partagées d’équipe et d’organisation y figurent aussi, parce qu’elles peuvent être atteintes avant une limite personnelle. La limite d’un projet n’y figure pas : un bandeau dans les chats du projet la signale dès que son seuil est dépassé, et une requête qu’elle refuse la nomme. diff --git a/docs/fr/platform/admin/overview.md b/docs/fr/platform/admin/overview.md index 3985ec1409..82819d0626 100644 --- a/docs/fr/platform/admin/overview.md +++ b/docs/fr/platform/admin/overview.md @@ -32,7 +32,7 @@ Les propriétaires et les admins gèrent les paramètres de l’organisation. Le ## Connexion, intégrations et apparence -Configure [le SSO d’entreprise](/fr/platform/admin/enterprise-sso) pour ton fournisseur d’identité et [l’authentification à deux facteurs](/fr/platform/admin/two-factor-authentication) pour protéger les comptes. Les [clés API](/fr/platform/admin/api-keys) permettent à un logiciel d’appeler Tale. +Configure [le SSO d’entreprise](/fr/platform/admin/enterprise-sso) pour ton fournisseur d’identité et [l’authentification à deux facteurs](/fr/platform/admin/two-factor-authentication) pour protéger les comptes. Les [clés API](/fr/platform/admin/api-keys) permettent à un logiciel d’appeler Tale. Un agent de code connecté avec l’une d’elles peut modifier lui-même bon nombre de ces paramètres, dans les limites du rôle de la personne à qui appartient la clé ; [Paramètres par MCP](/fr/develop/mcp-settings) indique lesquels. La page [Personnalisation visuelle](/fr/platform/admin/branding) sert à modifier le logo et les couleurs. [Sandboxes](/fr/platform/admin/sandboxes) présente la capacité d’exécution et les limites par type de tâche ; avec les [appareils de sandbox](/fr/platform/admin/sandbox-devices), les sandboxes de ton organisation tournent sur tes propres machines. Pour les accès d’un agent de projet à ces ressources, consulte [Agents côté administration](/fr/platform/admin/agents). diff --git a/docs/fr/platform/admin/sandboxes.md b/docs/fr/platform/admin/sandboxes.md index 865928ed98..2508f12986 100644 --- a/docs/fr/platform/admin/sandboxes.md +++ b/docs/fr/platform/admin/sandboxes.md @@ -9,11 +9,11 @@ Ouvre **Paramètres > Sandboxes** lorsqu’un agent ou une analyse de site ne pe | Activité | Valeur par défaut | Ce qui occupe une place | | --- | --- | --- | -| Sessions d’agent de projet | 2 | Un espace de travail d’agent en démarrage ou au travail, réutilisé entre ses tâches. | +| **Workers d’agent** | 2 | Un worker en démarrage ou au travail : un pour chaque tâche sur laquelle un agent travaille en même temps. Chaque worker est une sandbox avec son propre espace de travail, que l’agent réutilise pour ses tâches suivantes. | | Sessions de workflow | 2 | La sandbox d’une exécution. Des exécutions simultanées occupent des places distinctes. | | Sessions de rendu | 2 | Une sandbox temporaire qui rend les pages pendant l’analyse des sites. | -Ces valeurs limitent le travail simultané, pas le nombre de tâches ni les dépenses. Un agent peut travailler sur plusieurs tâches dans son unique espace. Les limites ne réservent pas d’infrastructure : toutes les organisations partagent la capacité du déploiement. +Ces valeurs limitent le travail simultané, pas le nombre de tâches ni les dépenses. Un agent qui travaille sur trois tâches à la fois occupe trois workers d’agent ; une exécution qui les trouve tous occupés [en attend un](#resoudre-un-demarrage-bloque) et démarre d’elle-même dès qu’un worker se libère. Sous **Workers d’agent**, les Propriétaires et les Admins voient combien d’exécutions d’agent attendent un worker libre : celles qu’une limite plus haute démarrerait tout de suite. Les limites ne réservent pas d’infrastructure : toutes les organisations partagent la capacité du déploiement. @@ -51,7 +51,7 @@ Les mesures s’actualisent toutes les 15 secondes. **Actualiser** demande une n ## Distinguer allocation et environnement inactif -Les Propriétaires et Admins peuvent examiner les espaces de travail. Chaque ligne identifie l’agent ou l’exécution, l’état de l’environnement, celui de l’allocation et les tâches en cours. Ces états répondent à des questions différentes : un conteneur peut rester actif pour être réutilisé après avoir libéré sa place dans l’organisation. L’espace de travail d’un agent de projet reste affiché tant que l’agent est inactif, avec l’état **Arrêtée** et **Quota libéré**, jusqu’à ce que tu le supprimes ou que Tale le supprime : quand personne ne l’a utilisé pendant [le nombre de jours fixé par ton organisation](#delete-unused-workspaces-automatically), ou quand [son agent, son projet ou le membre concerné est retiré](#explain-why-a-workspace-disappeared). Si l’agent lui-même a été supprimé, la ligne indique **Agent supprimé** jusqu’à ce que Tale ait supprimé l’espace. L’espace d’une exécution de workflow est récupéré peu après la fin de l’exécution. +Les Propriétaires et Admins peuvent examiner les espaces de travail. Chaque ligne identifie l’agent ou l’exécution, l’état de l’environnement, celui de l’allocation et les tâches en cours. Un agent a une ligne par worker : sous son nom, **Worker 2** indique de quel worker il s’agit, et **Worker de membre 2** désigne un worker qui exécute l’agent pour un Membre qui [a démarré ses exécutions](/fr/platform/projects/tasks#executions-demarrees-par-un-membre). **Tâches en cours** nomme chaque tâche par sa clé et son titre, et l’ouvre. Ces états répondent à des questions différentes : un conteneur peut rester actif pour être réutilisé après avoir libéré sa place dans l’organisation. L’espace de travail d’un worker reste affiché tant qu’il est inactif, avec l’état **Arrêtée** et **Quota libéré**, jusqu’à ce que tu le supprimes ou que Tale le supprime : quand personne ne l’a utilisé pendant [le nombre de jours fixé par ton organisation](#delete-unused-workspaces-automatically), ou quand [son agent, son projet ou le membre concerné est retiré](#explain-why-a-workspace-disappeared). Si l’agent lui-même a été supprimé, la ligne indique **Agent supprimé** jusqu’à ce que Tale ait supprimé l’espace. L’espace d’une exécution de workflow est récupéré peu après la fin de l’exécution. Si un environnement sur le serveur Tale disparaît de lui-même, par exemple après un redémarrage de l’hôte ou faute de mémoire, son espace de travail garde ses fichiers et passe à l’état **Arrêtée**, et l’exécution suivante s’y poursuit. Cela ne vaut pas pour un environnement sur un [appareil](/fr/platform/admin/sandbox-devices) connecté. Les dépenses additionnent le coût mesuré des échanges terminés. Un échange en cours est ajouté lorsqu’il se termine. Les environnements temporaires du crawler comptent dans la capacité même sans ligne d’espace de travail permanent. @@ -63,17 +63,17 @@ Les Propriétaires et Admins disposent du menu de chaque ligne : | Action | Effet | | --- | --- | -| **Arrêter la tâche** | Annule toutes les opérations en cours dans cet espace. Vérifie les tâches affichées : un agent peut en traiter plusieurs. | +| **Arrêter la tâche** | Annule toutes les opérations en cours dans cet espace. Un worker traite une tâche à la fois : seule cette tâche s’arrête, les autres workers de l’agent continuent. | | **Épingler** / **Détacher** | Exempte l’espace du nettoyage automatique pour inactivité ou expiration et de la suppression pour cause d’inutilisation, ou rétablit ce nettoyage. Une allocation épinglée peut continuer à occuper de la capacité. Si l’environnement d’un espace épinglé disparaît, par exemple après un redémarrage de l’hôte, Tale le relance avec ses fichiers, et l’espace reste épinglé. | -| **Supprimer** | Demande confirmation, puis retire la sandbox avec ses fichiers en arrière-plan : l’espace est d’abord détaché et le travail en cours annulé. Tant que l’espace n’a pas disparu, sa ligne indique **Suppression…** et tu peux continuer à utiliser la page. Si Tale ne parvient toujours pas à le retirer après plusieurs tentatives, il reste dans la liste, détaché, et indique **Non supprimée** ; choisis alors de nouveau **Supprimer** pour le retirer complètement. Tant que la ligne indique **Suppression…**, rien de nouveau ne démarre dans cet espace : l’exécution d’un agent attend et indique **En attente d’une place de sandbox**, et une étape d’exécution de workflow qui a besoin de l’espace échoue aussitôt en indiquant la raison, sans attendre ni réessayer, car les fichiers laissés par ses étapes précédentes sont en cours de suppression. Une fois la ligne disparue, le démarrage suivant crée un environnement neuf ; si elle indique **Non supprimée** à la place, le travail en attente reprend dans les anciens fichiers. | +| **Supprimer** | Demande confirmation, puis retire la sandbox avec ses fichiers en arrière-plan : l’espace est d’abord détaché et le travail en cours annulé. Tant que l’espace n’a pas disparu, sa ligne indique **Suppression…** et tu peux continuer à utiliser la page. Si Tale ne parvient toujours pas à le retirer après plusieurs tentatives, il reste dans la liste, détaché, et indique **Non supprimée** ; choisis alors de nouveau **Supprimer** pour le retirer complètement. Tant que la ligne indique **Suppression…**, rien de nouveau ne démarre dans cet espace. L’exécution d’un agent qui l’utiliserait prend un autre worker libre de l’agent ; si aucun n’est libre, elle attend et indique **En attente d’un espace de travail**. Une étape d’exécution de workflow qui a besoin de l’espace échoue aussitôt en indiquant la raison, sans attendre ni réessayer, car les fichiers laissés par ses étapes précédentes sont en cours de suppression. Une fois la ligne disparue, le démarrage suivant crée un environnement neuf ; si elle indique **Non supprimée** à la place, le travail en attente reprend dans les anciens fichiers. | -Tale enregistre durablement les changements d’épinglage et réessaie de les transmettre si le runtime ne les confirme pas, même après un redémarrage du worker ou une panne de l’appareil. Chaque tentative applique la dernière valeur souhaitée à la même instance de session. Répéter le détachement ne repousse pas son expiration. +Tale enregistre durablement les changements d’épinglage et réessaie de les transmettre si le runtime ne les confirme pas, même après un redémarrage d’un worker backend ou une panne de l’appareil. Chaque tentative applique la dernière valeur souhaitée à la même instance de session. Répéter le détachement ne repousse pas son expiration. Arrête la tâche si le travail doit cesser mais que ses fichiers doivent rester. Avant une suppression, conserve les résultats nécessaires et lis la confirmation. La récupération automatique de capacité inactive préserve les fichiers ; la suppression explicite ou automatique les retire. ## Supprimer automatiquement les espaces de travail inutilisés {#delete-unused-workspaces-automatically} -Un agent de projet garde ses fichiers d’une exécution à l’autre dans des espaces de travail : celui qu’il réutilise pour toutes ses tâches, et un espace distinct pour chaque Membre qui [démarre ses exécutions](/fr/platform/projects/tasks#executions-demarrees-par-un-membre). Tale supprime un espace de travail que personne n’a utilisé pendant le nombre de jours fixé par ton organisation ; **Supprimer** retire toujours un espace immédiatement. Les Propriétaires et Admins définissent cette règle dans **Nettoyage des espaces de travail**, juste au-dessus de la liste **Espaces de travail**. Les Développeurs ne voient pas cette section. +Un agent de projet garde ses fichiers d’une exécution à l’autre dans les espaces de travail de ses workers : un pour chaque tâche sur laquelle il a travaillé en même temps, que ses tâches suivantes réutilisent, et des espaces distincts pour chaque Membre qui [démarre ses exécutions](/fr/platform/projects/tasks#executions-demarrees-par-un-membre). L’espace de chaque worker compte ses jours sans utilisation séparément. Tale supprime un espace de travail que personne n’a utilisé pendant le nombre de jours fixé par ton organisation ; **Supprimer** retire toujours un espace immédiatement. Les Propriétaires et Admins définissent cette règle dans **Nettoyage des espaces de travail**, juste au-dessus de la liste **Espaces de travail**. Les Développeurs ne voient pas cette section. @@ -93,10 +93,10 @@ Dans la liste **Espaces de travail**, un espace d’agent arrêté affiche sous En plus des espaces inutilisés, Tale supprime un espace de travail dès que ce à quoi il appartient est retiré, quel que soit le réglage de nettoyage : -- La suppression d’un agent de projet efface tous ses espaces de travail, y compris ceux des Membres. La suppression d’un projet fait de même pour chacun de ses agents. +- La suppression d’un agent de projet efface les espaces de travail de tous ses workers, y compris ceux des Membres. La suppression d’un projet fait de même pour chacun de ses agents. - [Retirer un membre](/fr/platform/admin/members-and-roles#retirer-ou-retablir-lacces) de l’organisation supprime ses propres espaces de travail avec tous les agents. Si tu le passes plutôt en **Désactivé**, ils sont conservés. - [Effacer les données d’une personne](/fr/platform/admin/governance/data-subject-requests) supprime ses propres espaces de travail sans attendre la fin du travail qui s’y exécute. -- La suppression de l’organisation efface toutes ses sandboxes et leurs fichiers, révoque les clés de passerelle qui leur ont été remises, déconnecte ses [appareils](/fr/platform/admin/sandbox-devices) et retire les caches de compilation et de paquets conservés pour elle. +- La suppression de l’organisation efface toutes ses sandboxes et leurs fichiers, révoque les clés de passerelle qui leur ont été remises, supprime ses clés de fournisseur de modèle de la passerelle, déconnecte ses [appareils](/fr/platform/admin/sandbox-devices) et retire les caches de compilation et de paquets conservés pour elle. Cela se produit en une minute environ ou, si une tâche s’exécute encore dans l’espace, après la fin de celle-ci. Un espace épinglé est supprimé lui aussi, mais une [conservation légale](/fr/platform/admin/governance/legal-hold) garde tous les espaces de travail qu’elle couvre : celle de l’organisation les garde tous, celle qui vise une personne garde les espaces de travail propres à cette personne. Un nettoyage exécuté toutes les heures supprime aussi les restes que plus rien ne possède, comme l’espace d’une exécution de workflow jamais récupéré. @@ -104,9 +104,9 @@ Chaque espace de travail que Tale supprime de lui-même, pour l’une de ces rai ## Résoudre un démarrage bloqué -Un démarrage qui ne trouve pas de place attend. Quand les limites de ton organisation sont occupées, ou que le déploiement est plein ou manque de mémoire, le travail démarre de lui-même dès qu’une place se libère, sans rien te demander. L’espace disque fait exception : arrêter un travail inactif n’en libère pas, car un espace de travail arrêté garde ses fichiers. Tale supprime les caches de build qu’aucune session n’utilise, s’il y en a ; si cela ne suffit pas, le démarrage attend que des espaces de travail soient supprimés, par exemple ceux que tu supprimes parce que tu n’en as plus besoin, ou que l’opérateur libère de l’espace disque. Quand le déploiement lui-même est plein, sa place va au travail qui attend depuis le plus longtemps, quelle que soit son organisation, et chaque démarrage en attente sait quand vient son tour : +Un démarrage qui ne trouve pas de place attend, et sa tâche indique pourquoi sous **Exécution** : **En attente d’un worker** quand tous les workers d’agent de ton organisation sont occupés, **En attente de place** quand le déploiement est plein ou manque de mémoire ou d’espace disque, **En attente d’un espace de travail** pendant qu’un administrateur supprime l’espace que l’exécution utiliserait, et **En attente de sa sandbox** pendant que sa sandbox termine un processus précédent. Les Propriétaires et les Admins reçoivent aussi un lien vers cette page quand tous les workers d’agent sont occupés. Quand les limites de ton organisation sont occupées, ou que le déploiement est plein ou manque de mémoire, le travail démarre de lui-même dès qu’une place se libère, sans rien te demander. L’espace disque fait exception : arrêter un travail inactif n’en libère pas, car un espace de travail arrêté garde ses fichiers. Tale supprime les caches de build qu’aucune session n’utilise, s’il y en a ; si cela ne suffit pas, le démarrage attend que des espaces de travail soient supprimés, par exemple ceux que tu supprimes parce que tu n’en as plus besoin, ou que l’opérateur libère de l’espace disque. Quand le déploiement lui-même est plein, sa place va au travail qui attend depuis le plus longtemps, quelle que soit son organisation, et chaque démarrage en attente sait quand vient son tour : -- Une exécution de tâche attend dans la file. Elle est relancée dès qu’une session se termine, dans ton organisation ou dans une autre du même déploiement. Quand le déploiement est plein, elle est aussi relancée quand vient son tour. Toutes les deux minutes, Tale relance aussi quelques exécutions en attente de chaque organisation, en commençant par celles qui attendent depuis le plus longtemps. +- Une exécution de tâche attend dans la file. Elle est relancée dès qu’une session se termine, dans ton organisation ou dans une autre du même déploiement. Quand le déploiement est plein, elle est aussi relancée quand vient son tour. Toutes les deux minutes, Tale relance aussi quelques exécutions en attente de chaque organisation. Un worker libéré va d’abord à l’agent qui a le moins d’exécutions en cours, puis à l’exécution qui attend depuis le plus longtemps. Une exécution qui ne trouve pas de place dans les 12 heures suivant son démarrage échoue en indiquant qu’elle a attendu trop longtemps un worker libre. - L’étape d’agent d’une automatisation réessaie sans consommer ses nouvelles tentatives : quand vient son tour si le déploiement est plein, sinon après une pause qui s’allonge tant que l’étape attend, jusqu’à environ deux minutes. L’exécution affiche entre-temps **En attente d’une place de sandbox**. Après deux heures sans place, l’exécution échoue avec cette raison. Un espace de travail qu’un administrateur supprime n’est pas un manque de place : l’étape échoue alors aussitôt, comme décrit plus haut pour **Supprimer**. - L’exploration attend son tour, puis reprend avec son lot suivant. diff --git a/docs/fr/platform/agents/concepts.md b/docs/fr/platform/agents/concepts.md index f2676ff89e..2674d0db5e 100644 --- a/docs/fr/platform/agents/concepts.md +++ b/docs/fr/platform/agents/concepts.md @@ -3,14 +3,14 @@ title: Comprendre les agents de projet description: Définis la responsabilité d’un agent et le rôle de son environnement, de son modèle, de ses instructions et de son équipement. --- -Un agent de projet travaille sur les tâches d’un projet précis. Tu définis son mode d’exécution et ses accès, puis tu lui confies une tâche dont le résultat peut être vérifié. Il peut modifier des fichiers et lancer des commandes dans une sandbox. Le [relecteur configuré](/fr/platform/projects/tasks#review-default), une personne ou un agent de projet indépendant, examine le résultat avant de terminer la tâche. Les nouvelles relectures qui exigent une indépendance humaine ou des justificatifs de compétences suivent la chaîne humaine ; une relecture déjà attribuée à un agent doit être explicitement transférée à une personne autorisée. +Un agent de projet est une configuration nommée pour les tâches d’un projet précis. Tu définis son mode d’exécution et ses accès, puis tu lui confies une tâche dont le résultat peut être vérifié. Chaque tâche sur laquelle il travaille s’exécute dans un worker, une copie de l’agent qui modifie des fichiers et lance des commandes dans sa propre sandbox. Un agent peut ainsi travailler sur plusieurs tâches à la fois. Le [relecteur configuré](/fr/platform/projects/tasks#review-default), une personne ou un agent de projet indépendant, examine le résultat avant de terminer la tâche. Les nouvelles relectures qui exigent une indépendance humaine ou des justificatifs de compétences suivent la chaîne humaine ; une relecture déjà attribuée à un agent doit être explicitement transférée à une personne autorisée. ## Choisir la forme de travail | Forme | Travail adapté | Ce que tu définis | | --- | --- | --- | | Chat | Poser une question, rechercher des connaissances ou rédiger un texte. | Le message, le modèle et, si nécessaire, le contexte du projet. | -| Agent de projet | Examiner un dépôt, préparer des fichiers ou poursuivre une tâche sur plusieurs échanges. | Un agent réutilisable dans le projet. | +| Agent de projet | Examiner un dépôt, préparer des fichiers ou poursuivre une tâche sur plusieurs échanges. | Une configuration d’agent réutilisable dans le projet. | | Automatisation | Exécuter des étapes définies, réagir à un événement ou demander une approbation entre deux actions. | Un workflow versionné et ses données d’entrée. | Un chat de projet utilise toujours l’assistant de chat intégré. Choisir un projet dans Chat ne sélectionne pas un agent du projet. Le nœud agent d’une automatisation possède sa propre configuration. @@ -32,7 +32,7 @@ Un agent appartient à un seul projet. Les personnes qui peuvent lire le projet | Connectors et outils | Les services connectés et les opérations autorisées dans Tale. | Accorder l’accès au dépôt et les seuls outils de tâches nécessaires. | | Secrets | Des identifiants de l’organisation, référencés par nom et fournis à la session. | Utiliser un jeton limité pour un service sans connector. | -Les listes de skills, connectors, outils et noms de secrets acceptent chacune jusqu’à 25 entrées. Accorder un outil d’écriture autorise ses opérations dans les limites de ses règles d’accès. Une instruction demandant de la prudence ne retire pas cette permission. Seuls un Propriétaire ou un Admin peuvent modifier les secrets accordés. +Les listes de skills, connectors, outils et noms de secrets acceptent chacune jusqu’à 25 entrées. Accorder un outil d’écriture autorise ses opérations dans les limites de ses règles d’accès. Une instruction demandant de la prudence ne retire pas cette permission. Seuls un Propriétaire ou un Admin peuvent modifier les secrets accordés. Rechercher dans les connaissances du projet ne demande aucune autorisation : chaque agent le peut. ```mermaid flowchart LR @@ -45,6 +45,6 @@ flowchart LR ## Vérifier les prérequis avant l’affectation -Les identifiants du fournisseur doivent être compatibles avec l’environnement d’agent et le modèle choisis. Une sandbox doit aussi être disponible. Une réponse réussie dans Chat ne prouve aucune de ces conditions. La tâche doit préciser le résultat attendu et fournir les éléments à examiner. +Les identifiants du fournisseur doivent être compatibles avec l’environnement d’agent et le modèle choisis. Une sandbox doit aussi être disponible : une exécution attend qu’un des [workers d’agent](/fr/platform/projects/project-agents#run-one-agent-on-several-tasks) de ton organisation se libère. Une réponse réussie dans Chat ne prouve aucune de ces conditions. La tâche doit préciser le résultat attendu et fournir les éléments à examiner. Une fois ces choix établis, [crée un agent de projet](/fr/platform/projects/project-agents). Le guide d’[automatisation des tâches](/fr/platform/projects/task-automation) explique comment démarrer, guider et examiner son travail. diff --git a/docs/fr/platform/agents/harnesses.md b/docs/fr/platform/agents/harnesses.md index dfe2ef7458..a00a30fa3d 100644 --- a/docs/fr/platform/agents/harnesses.md +++ b/docs/fr/platform/agents/harnesses.md @@ -37,13 +37,13 @@ Gemini CLI fait exception : Tale ne poursuit jamais une de ses conversations. Un Avec une clé API stockée ou fournie par l’environnement du déploiement, Tale remet une clé de passerelle limitée à la session. La clé d’origine du fournisseur de modèle reste dans la plateforme. Les appels de passerelle sont mesurés et soumis aux règles de dépense applicables, en tenant compte des montants déjà attribués aux autres échanges en cours. -Les abonnements fournisseurs utilisent leur environnement d’agent compatible et reçoivent les identifiants d’abonnement dans l’environnement de la session. Ils ne servent pas d’identifiants de chat ordinaire et ne fonctionnent pas avec un environnement d’agent incompatible, car les fournisseurs n’autorisent les jetons d’abonnement que dans leur propre environnement ; la page [Fournisseurs IA](/fr/platform/admin/providers#utiliser-les-abonnements-dans-les-taches-pas-dans-le-chat) l’explique. Leurs appels directs échappent à la mesure et aux plafonds de la passerelle Tale. Examine la consommation auprès du fournisseur d’abonnement. +Les abonnements fournisseurs utilisent leur environnement d’agent compatible et reçoivent les identifiants d’abonnement dans l’environnement de la session. Gemini fait exception : sa connexion Google est écrite dans un fichier du dossier personnel de la session pour l’échange, puis supprimée à la fin de l’échange. Ils ne servent pas d’identifiants de chat ordinaire et ne fonctionnent pas avec un environnement d’agent incompatible, car les fournisseurs n’autorisent les jetons d’abonnement que dans leur propre environnement ; la page [Fournisseurs IA](/fr/platform/admin/providers#utiliser-les-abonnements-dans-les-taches-pas-dans-le-chat) l’explique. Leurs appels directs échappent à la mesure et aux plafonds de la passerelle Tale. Examine la consommation auprès du fournisseur d’abonnement. Ces règles sur les identifiants de modèle ne signifient pas que la sandbox ne contient aucun secret. Les **Secrets** explicitement accordés et le jeton d’un accès GitHub équipé peuvent y être disponibles. Limite ces accès aux besoins de la tâche. ## Comprendre les fichiers et les outils connectés -Un agent de projet réutilise son espace de travail persistant entre ses tâches. Les pièces jointes sont accessibles en lecture seule sous `/agent/inputs//attachments/`. Les fichiers écrits dans `/agent/output//` sont collectés comme **Fichiers produits** à la fin de l’échange. Un nœud agent collecte sa sortie sous `/agent/output/`. +Un agent de projet réutilise son espace de travail persistant entre ses tâches. Les pièces jointes sont accessibles en lecture seule sous `/agent/inputs//attachments/`. L’espace de travail ne garde cette copie que tant que la tâche peut encore en avoir besoin : Tale la retire dès que la tâche passe à **Terminé** ou **Annulé**, est archivée ou supprimée, ou n’a pas changé depuis 30 jours, et la prochaine exécution de la tâche y recopie les fichiers. Les fichiers écrits dans `/agent/output//` sont collectés comme **Fichiers produits** à la fin de l’échange. Un nœud agent collecte sa sortie sous `/agent/output/`. Les bundles de skills sont préparés sous forme de fichiers et cités dans les instructions de l’exécution. Examine leurs consignes et scripts avant de les accorder. [Skills des agents](/fr/platform/agents/skills) explique cette préparation et la visibilité. diff --git a/docs/fr/platform/automations/assistant.md b/docs/fr/platform/automations/assistant.md index 42c2a7bc9b..36c795c9b9 100644 --- a/docs/fr/platform/automations/assistant.md +++ b/docs/fr/platform/automations/assistant.md @@ -1,30 +1,32 @@ --- title: Choisir comment créer une automatisation -description: Modifie directement le workflow dans l’éditeur visuel ou connecte un assistant externe à Tale avec MCP. +description: Modifie directement le workflow dans l’éditeur visuel ou laisse ton agent de code modifier les automatisations par l’endpoint MCP de Tale. --- -Modifie une automatisation sur son canevas ou connecte un assistant externe avec MCP pour utiliser les outils de Tale. Les deux chemins enregistrent des versions du même workflow et suivent les mêmes règles de validation et de déploiement. Il te faut les droits Développeur pour créer et déployer des automatisations. +Modifie les champs d’une automatisation directement dans l’éditeur, ou laisse ton agent de code la créer et la modifier par l’endpoint MCP de Tale. L’éditeur n’a pas d’assistant IA intégré : pour travailler sur tes automatisations avec l’IA, tu passes par un agent de code comme Claude Code ou Codex, connecté avec ta clé API. Les deux chemins enregistrent des versions du même workflow et suivent les mêmes règles de validation et de déploiement. Créer des automatisations et les mettre en service demande le rôle Propriétaire, Admin ou Développeur. -## Modifier le workflow dans l’éditeur visuel +## Modifier le workflow dans l’éditeur -Ouvre **Automatisations** et sélectionne le workflow. Choisis un nœud pour examiner ses entrées, son modèle, son code ou ses autres réglages. Enregistre la modification avec un message de version, lance un test, puis déploie la version souhaitée lorsque ses vérifications passent. +Ouvre **Automatisations** et sélectionne le workflow. Choisis un nœud pour examiner son entrée, son modèle, son code ou ses autres réglages, et modifie le champ voulu. Enregistre la modification avec un message de version, lance un test, puis déploie la version souhaitée lorsque ses vérifications passent. Le canevas se dispose lui-même à partir des références entre les nœuds ; tu n’y ajoutes pas de nœuds et n’y traces pas de liaisons. -![L’éditeur d’automatisation montre le graphe du workflow et les champs d’entrée du nœud sélectionné dans un panneau latéral.](/images/platform/automation-editor-canvas.webp) +![L’éditeur d’automatisation montre le workflow entre Début et Fin et les champs du nœud sélectionné dans un panneau latéral.](/images/platform/automation-editor-canvas.webp) -[L’éditeur de workflow](/fr/platform/automations/editor) détaille ces étapes, l’examen d’une exécution et le retour à une version antérieure. Le canevas n’inclut pas de panneau d’assistant conversationnel. +[L’éditeur de workflow](/fr/platform/automations/editor) détaille ces étapes, la lecture du canevas, l’examen d’une exécution et le retour à une version antérieure. Le canevas n’inclut pas de panneau d’assistant conversationnel. -## Utiliser un assistant externe avec MCP +## Modifier avec ton agent de code -Configure ton client avec le point d’accès indiqué sous **Paramètres > API > MCP** et une clé API adaptée. Décris les entrées, la sortie attendue et les systèmes que le workflow peut modifier. Demande au client d’examiner les automatisations et capacités existantes avant d’en créer une autre. +Le point de départ est **Modifier avec ton agent de code**, le dernier bouton en haut à droite du canevas de l’éditeur. Son dialogue montre le nom de l’automatisation à donner à l’agent, **Configurer MCP**, qui ouvre **Paramètres > API > MCP**, et un lien vers le guide pour connecter un agent de code. Connecte ton agent de code avec l’endpoint indiqué sous **Paramètres > API > MCP** et ta clé API personnelle ; [Utiliser Tale depuis ton éditeur ou un script](/fr/develop/use-tale-from-your-editor) propose des configurations prêtes à l’emploi. Dis-lui ce que l’automatisation doit recevoir, ce qu’elle doit produire et quels systèmes elle peut modifier. Demande-lui d’examiner les automatisations existantes et ce dont ton organisation dispose avant d’en créer une autre. -Le [point d’accès MCP](/fr/develop/mcp-endpoint) propose des outils de documentation, validation, enregistrement, test et déploiement. Examine le workflow obtenu et ses résultats de test avant de le déployer. L’enregistrement crée une version, sans la rendre active. +Ton agent travaille sur une automatisation comme toi dans l’éditeur. Il lit la référence et la version actuelle, valide sa modification, l’exécute avec les simulations et lance les tests de l’automatisation, puis enregistre une nouvelle version en indiquant celle dont il est parti. Si quelqu’un a enregistré une version plus récente entre-temps, Tale refuse l’enregistrement ; l’agent lit alors cette version et y intègre d’abord sa modification. Quand il lance une version enregistrée avec les simulations, l’exécution apparaît dans l’onglet **Exécutions** de l’automatisation comme exécution **Essai**, **Lancée par toi (API)**, pour que tu puisses ouvrir ce qu’il a exécuté. Une version enregistrée par l’agent apparaît sur le canevas pendant que tu consultes l’automatisation. + +Enregistrer crée une version sans la mettre en service. Avant que ton agent mette en service, supprime, définisse un déclencheur ou installe une automatisation dans des projets, un client qui respecte le marquage de Tale pour ces outils, comme Claude Code, te demande ton accord, même si tu laisses l’agent lancer d’autres outils sans demander. Examine la version et ses résultats de test avant d’accepter. Chaque modification de ton agent figure dans le [journal d’audit](/fr/platform/admin/governance/audit-logs) avec **Source** Agent de code, et l’[endpoint MCP](/fr/develop/mcp-endpoint) liste chaque outil qu’il peut utiliser. ## Distinguer les décisions pendant l’exécution -Un nœud agent accomplit du travail pendant une exécution. Il est distinct du client qui t’aide à écrire le workflow. De même, une [approbation](/fr/platform/approvals/concepts) autorise une opération en attente pendant l’exécution ; elle ne valide pas une modification proposée de la définition. +Un nœud agent accomplit du travail pendant une exécution. Il est distinct de l’agent de code qui t’aide à écrire le workflow. De même, une [approbation](/fr/platform/approvals/concepts) autorise une opération en attente pendant l’exécution ; elle ne valide pas une modification proposée de la définition. Ton agent de code ne décide jamais d’une approbation : si une exécution qu’il lance en demande une, elle attend qu’une personne décide dans Tale. -Choisis [l’éditeur](/fr/platform/automations/editor) pour une modification directe ou [MCP](/fr/develop/mcp-endpoint) pour travailler depuis ton client. Pars d’[une automatisation existante](/fr/platform/automations/catalog) lorsqu’une solution adaptée est déjà disponible. +Choisis [l’éditeur](/fr/platform/automations/editor) pour une modification directe ou [MCP](/fr/develop/mcp-endpoint) pour travailler avec ton agent de code. Pars d’[une automatisation existante](/fr/platform/automations/catalog) lorsqu’une solution adaptée est déjà disponible. diff --git a/docs/fr/platform/automations/builtin.md b/docs/fr/platform/automations/builtin.md index 7d23da420f..83aa20fc4c 100644 --- a/docs/fr/platform/automations/builtin.md +++ b/docs/fr/platform/automations/builtin.md @@ -3,7 +3,7 @@ title: Automatisations livrées description: Choisis un workflow fourni pour les e-mails, GitHub ou GlitchTip, vérifie ses entrées et connexions et découvre ce qu’il lit ou écrit avant le déploiement. --- -Tale fournit dix paquets d’automatisation : trois synchronisations de courrier, trois résumés de boîte de réception, deux workflows de revue GitHub et des imports d’issues GitHub et GlitchTip. Chacun commence en version 1 avec le statut **Pas en service**. Les imports d’issues s’exécutent manuellement ; les autres paquets incluent une planification. Examine les données attendues, le modèle, les connexions et les écritures avant qu’un Propriétaire, Admin ou Développeur mette une version en service. +Tale fournit dix paquets d’automatisation : trois synchronisations de courrier, trois résumés de boîte de réception, deux workflows de revue GitHub et des imports d’issues GitHub et GlitchTip. Chacun commence en version 1 avec le statut **Pas en service**. Les imports d’issues s’exécutent manuellement ; les autres paquets incluent une planification, désactivée au départ : après la mise en service d’une version, l’éditeur propose **Activer le déclencheur**. Examine les données attendues, le modèle, les connexions et les écritures avant qu’un Propriétaire, Admin ou Développeur mette une version en service. @@ -87,7 +87,7 @@ Les deux workflows exigent `owner` et `repo`. Dans **Essai**, renseigne **Donné -Les planifications GitHub fournies ne transmettent ni `owner` ni `repo` : la mise en service seule ne suffit donc pas à rendre ces exécutions planifiées valides. Une planification n’envoie que `trigger` et `firedAt` : l’entrée de dépôt requise est donc absente et le démarrage est refusé. Lance le workflow manuellement avec les données requises, ou adapte le schéma et la configuration du dépôt avant d’activer les exécutions planifiées. Un démarrage planifié refusé apparaît comme `start_refused` sur le [déclencheur](/fr/platform/automations/triggers). +Les planifications GitHub fournies ont besoin de `owner` et `repo`, alors qu’une planification n’envoie que `trigger` et `firedAt`. Après la mise en service d’une version, l’éditeur propose donc **Vérifier le déclencheur** au lieu d’activer la planification. Dans l’onglet **Général**, ouvre **Ajouter une entrée fixe**, choisis **Ajouter les 2 champs manquants**, remplace les valeurs provisoires par le propriétaire et le nom de ton dépôt, active **Actif** et enregistre. Chaque exécution planifiée reçoit alors ces valeurs. Un démarrage que le workflow refuse encore apparaît sur le [déclencheur](/fr/platform/automations/triggers#comprendre-labsence-de-demarrage) comme **Ignorée : l’entrée de l’exécution a été refusée**. diff --git a/docs/fr/platform/automations/catalog.md b/docs/fr/platform/automations/catalog.md index 2ee4c4af38..fb66a4c69d 100644 --- a/docs/fr/platform/automations/catalog.md +++ b/docs/fr/platform/automations/catalog.md @@ -21,7 +21,7 @@ Le menu **Créer une automatisation** propose deux parcours : | Choix | À utiliser si… | Suite du parcours | | --- | --- | --- | -| **Vierge (trigger + agent)** | tu souhaites configurer le workflow toi-même. | Définis le nom, le modèle, les instructions et les équipements, puis choisis quand l’agent s’exécute. La création ouvre l’éditeur pour la suite des modifications. | +| **Vierge (trigger + agent)** | tu souhaites configurer le workflow toi-même. | Définis le nom, le modèle, les instructions et les équipements, puis choisis quand l’agent s’exécute. **Mettre v1 en service maintenant** (coché par défaut) met la première version en service tout de suite ; sinon elle reste un brouillon que tu mets en service depuis l’éditeur. L’agent reçoit ce qu’envoie le déclencheur comme son entrée. La création ouvre l’éditeur pour la suite des modifications. | | **Téléverser un paquet** | tu disposes d’un fichier de workflow ou d’un pack réutilisable. | Tale valide les fichiers et enregistre une version brouillon. | Les automatisations fournies sont installées à la création de l’organisation. Elles demandent encore leur configuration et une version en service avant un usage automatique. [L’éditeur de workflows](/fr/platform/automations/editor) explique comment tester les données, examiner les résultats et mettre la version choisie en service. @@ -114,7 +114,7 @@ settings: label: Strict checklist ``` -Si le projet n’est pas encore configuré, les formulaires obligatoires précèdent les champs de la tâche. **Enregistrer et continuer** les écrit puis reprend la création. **Paramètres** les rouvre ensuite sous forme d’onglets. Un point signale les modifications non enregistrées ; **Enregistrer** écrit tous les formulaires modifiés. Fermer avec des changements en attente demande confirmation. +Si le projet n’est pas encore configuré, les formulaires obligatoires précèdent les champs de la tâche. **Enregistrer et continuer** les écrit puis reprend la création. **Paramètres** les rouvre ensuite sous forme d’onglets. Un point signale les modifications non enregistrées ; **Enregistrer** écrit tous les formulaires modifiés. Fermer avec des changements en attente demande confirmation. La `description` d’un formulaire s’affiche au-dessus de ses champs ; au-delà de trois lignes, tu en vois le début et **Lire la suite** ouvre le reste. L’enregistrement remplace le fichier YAML plat du formulaire, par exemple `Setup/validation-policy.yaml`. Les valeurs existantes préremplissent le formulaire, y compris celles d’un fichier téléversé manuellement. Les types admis sont `text`, `number`, `boolean` et `select` ; les valeurs sont stockées comme chaînes. Un champ texte peut imposer un `pattern`. Des blocs `i18n` par entrée traduisent titres, libellés, aide et options. Place les listes et structures imbriquées dans des fichiers séparés que le workflow lira en complément. diff --git a/docs/fr/platform/automations/concepts.md b/docs/fr/platform/automations/concepts.md index 3a6a224564..04cf710e80 100644 --- a/docs/fr/platform/automations/concepts.md +++ b/docs/fr/platform/automations/concepts.md @@ -42,17 +42,17 @@ tests: input: { invoiceId: 'inv-1' } ``` -Le bloc `ui` conserve la disposition du canvas. Déplacer un nœud modifie sa position, sans changer son exécution. +Tale dispose le canevas à partir des références entre les nœuds : personne ne place un nœud à la main. Un bloc `ui` contient des métadonnées libres que Tale conserve telles quelles et ignore. ### Les liaisons se déduisent, elles ne se déclarent pas -Il n’y a pas de liste de liaisons. Un nœud en lit un autre en le référençant — `{{ nodes.invoice.output.id }}` — et cette référence _est_ la liaison que trace le canvas. L’ordre d’exécution est un tri topologique sur ces liaisons déduites : supprimer une référence retire donc aussi une flèche, et deux nœuds qui se lisent l’un l’autre sont refusés comme une boucle. +Il n’y a pas de liste de liaisons. Un nœud en lit un autre en le référençant — `{{ nodes.invoice.output.id }}` — et cette référence _est_ la liaison que trace le canevas. L’ordre d’exécution est un tri topologique sur ces liaisons déduites : supprimer une référence retire donc aussi un trait, et deux nœuds qui se lisent l’un l’autre sont refusés comme une boucle. Les templates utilisent une seule grammaire `{{ }}` d’expressions JavaScript sur `input`, `nodes..output` et, à l’intérieur d’un nœud qui itère, `item` et `index`. ### Le contrôle du flux vit sur le nœud -Brancher et répéter sont des champs du nœud plutôt que des types d’étape à part. Le canvas les montre donc comme des badges sur la boîte qu’ils concernent. +Brancher et répéter sont des champs du nœud plutôt que des types d’étape à part. Le canevas dessine chacun d’eux là où il agit : un `when` devient une condition au-dessus de son nœud, une alternative `elseOf` part de cette condition comme sa branche **Non**, `forEach` et `repeatUntil` placent le nœud dans un cadre, et `onError: continue` lui ajoute une puce. | Champ | Ce qu’il fait | | ---------------------------- | --------------------------------------------------------------------------------------------- | @@ -68,9 +68,9 @@ Quatre types sont intégrés, et chaque action de connector comme chaque capacit **`transform`** exécute du JavaScript pur pour remettre des données en forme. Sans réseau ni imports : le corps lit l’`input` résolue du nœud et doit retourner une valeur. -**`llm`** appelle un modèle de langage avec un prompt en template. `model` est obligatoire et toujours explicite — une automatisation n’en choisit jamais un à ta place (l’Auto du composer est une affaire de chat, et de chat seulement). La sortie est `{text}`, ou l’objet à la forme du schéma quand le nœud déclare un `outputSchema`. Chaque appel d’une exécution réelle est un usage de l’exécution : il est vérifié par rapport aux [limites de budget](/fr/platform/admin/governance/policies-and-limits) avant d’être fait, et un appel refusé par une limite fait échouer le nœud avec `budget_exceeded`, ce qui arrête l’exécution, sauf si son `onError` vaut `continue`. +**`llm`** appelle un modèle de langage avec un prompt en template. `model` est obligatoire et toujours explicite — une automatisation n’en choisit jamais un à ta place (l’Auto du composer est une affaire de chat, et de chat seulement). La sortie est `{text}`, ou l’objet à la forme du schéma quand le nœud déclare un `outputSchema`. Chaque appel d’une exécution réelle est un usage de l’exécution : il est vérifié par rapport aux [limites de budget](/fr/platform/admin/governance/policies-and-limits) avant d’être fait, et un appel refusé par une limite fait échouer le nœud avec `budget_exceeded`, ce qui arrête l’exécution, sauf si son `onError` vaut `continue`. Avant l’appel au fournisseur, chaque tentative réserve le coût estimé du prompt et le budget maximal de réponse dans tous les projets retenus pour cette tentative. Le modèle doit disposer de tarifs dans le catalogue. L’usage déclaré remplace la réservation à la fin de l’appel. Si un délai dépassé, une connexion interrompue ou l’absence de données d’usage laisse le coût inconnu, la réservation reste en place jusqu’à l’échéance de la requête, puis son montant estimé est comptabilisé ; il s’agit d’une estimation, pas d’une facture du fournisseur. Modifier les associations aux projets pendant l’appel ne déplace pas sa consommation. -**`agent`** exécute un tour d’un agent de code (Claude Code, Codex et les autres environnements d’agent) dans la sandbox. Il lit les `files` mis en place, utilise des `skills`, des `connectors` relayés, des `tools` de plateforme accordés et des `secrets` injectés, et renvoie `{text, files, status}` ; `model` est obligatoire. Si un admin a activé la [génération d’images](/fr/platform/admin/governance/content-models#let-agents-generate-images), il peut aussi créer des images, qui reviennent parmi ses `files`. Prends `llm` quand une complétion unique suffit, et `agent` seulement quand l’étape a besoin d’outils, de fichiers ou de plusieurs tours — un nœud agent en service s’exécute comme un tour asynchrone, il siège donc au niveau supérieur plutôt que dans une `subautomation` et n’itère pas avec `forEach`. +**`agent`** exécute un tour d’un agent de code (Claude Code, Codex et les autres environnements d’agent) dans la sandbox. Il lit les `files` mis en place, utilise des `skills`, des `connectors` relayés, des `tools` de plateforme accordés et des `secrets` injectés, et renvoie `{text, files, status}` ; `model` est obligatoire. L’`input` résolue du nœud parvient à l’agent en JSON dans `/agent/workspace/input.json`, un fichier que ses instructions désignent. Lors d’une exécution réelle, le nœud échoue avant le démarrage de l’agent si ce JSON dépasse 1 Mio, ou si ses `files` contiennent aussi une entrée nommée `input.json`. Si un admin a activé la [génération d’images](/fr/platform/admin/governance/content-models#let-agents-generate-images), il peut aussi créer des images, qui reviennent parmi ses `files`. Prends `llm` quand une complétion unique suffit, et `agent` seulement quand l’étape a besoin d’outils, de fichiers ou de plusieurs tours — un nœud agent en service s’exécute comme un tour asynchrone, il siège donc au niveau supérieur plutôt que dans une `subautomation` et n’itère pas avec `forEach`. **`subautomation`** exécute une autre automatisation enregistrée comme un seul nœud ; son champ `automation` nomme `"name"` ou `"name@version"`. Sans version, c’est celle en service, et l’imbrication s’arrête à trois niveaux. @@ -80,11 +80,17 @@ Une sortie **structurée** possède des champs nommés, accessibles avec `nodes. Un outil sans schéma de sortie produit une sortie non structurée. Pour transformer son texte en données structurées utilisables par les étapes suivantes, ajoute un nœud `llm` avec un `outputSchema`. En cas d’erreur, la validation indique la référence incorrecte et les champs ou contextes autorisés. Corrige-la avant d’enregistrer à nouveau. +## Les chemins qu’une exécution peut prendre {#paths} + +Chaque condition, et chaque nœud qui peut échouer pendant que l’exécution continue, ouvre deux possibilités à une exécution. Tale essaie chaque combinaison et garde les différentes façons dont une exécution réussie peut se dérouler ; chacune est un chemin. Un chemin nomme les conditions qui le décident, comme les nœuds qui s’exécutent, ceux qui sont ignorés et ceux qui échouent pendant que l’exécution continue, ainsi que les nœuds qui s’exécutent sur ce chemin. Un nœud qui s’exécute sur chaque chemin s’exécute toujours ; un nœud qui ne s’exécute sur aucun ne peut jamais s’exécuter, et Tale le signale par un avertissement. + +Tale liste jusqu’à 32 chemins et compte les autres. Au-delà de 12 conditions et échecs tolérés, les combinaisons sont trop nombreuses pour être parcourues : Tale ne liste alors aucun chemin, mais indique toujours, pour chaque nœud, quand il s’exécute. Tale nomme aussi les nœuds dont l’échec termine l’exécution et ce qui peut faire échouer chacun d’eux. L’éditeur montre les chemins sur le canevas, comme le décrit [Suivre les chemins possibles](/fr/platform/automations/editor#paths) ; un client du [point d’accès MCP](/fr/develop/mcp-endpoint) lit les mêmes chemins dans `analysis.paths`. + ## Ce que Tale vérifie avant une exécution {#checks} Tale vérifie le document entier quand tu l’enregistres, quand tu déploies une version et chaque fois qu’un client appelle `validate_automation`. Une **erreur** décrit un échec certain ou du code qui dépasse les limites d’analyse : elle empêche d’enregistrer comme de déployer. Un **avertissement** signale ce qui peut échouer ou ne sert à rien. Il n’empêche jamais d’enregistrer ni de déployer, c’est donc toi qui décides d’agir. Chaque problème nomme son nœud et son champ et, dans un template, une condition ou du code, l’expression exacte. -Pour que les vérifications restent réactives, chaque expression et chaque corps `transform` sont limités à 8192 unités de code UTF-16, 512 tokens JavaScript et 64 niveaux d’imbrication dans la syntaxe ou l’arbre syntaxique. Les espaces autour d’une expression de template ne comptent pas dans sa taille ; ceux du corps `transform` comptent. Le texte ordinaire hors des templates n’est pas du code. Ces limites peuvent refuser du code auparavant valide. Raccourcis-le ou répartis le travail entre plusieurs nœuds avant d’enregistrer ou de déployer à nouveau. +Pour que les vérifications restent réactives, chaque expression est limitée à 8192 unités de code UTF-16 et 512 tokens JavaScript. Un corps `transform` peut contenir jusqu’à 16384 unités de code et 4096 tokens. Dans les deux cas, la limite reste de 64 niveaux d’imbrication dans la syntaxe ou l’arbre syntaxique. Les espaces autour d’une expression de template ne comptent pas dans sa taille ; ceux du corps `transform` comptent. Le texte ordinaire hors des templates n’est pas du code. Ces limites peuvent refuser du code auparavant valide. Raccourcis-le ou répartis le travail entre plusieurs nœuds avant d’enregistrer ou de déployer à nouveau. ### Références et noms {#checks-references} @@ -121,6 +127,12 @@ Une condition qui donne toujours la même réponse ne décide rien. Du texte aut Un nœud `subautomation` est vérifié par rapport à la version qu’une exécution appellerait : la version qu’il indique, sinon celle qui est déployée, sinon la plus récente. Cette version doit exister et ne contenir aucun nœud `agent`. Tale avertit quand l’entrée ne correspond pas à ses `inputs`, et quand elle effectue une écriture qu’une approbation pourrait retenir, car une automatisation appelée ne peut pas attendre. Un déclencheur planifié dont l’entrée de départ est refusée par les `inputs` de l’automatisation est signalé aussi. +### Ce que l’organisation possède {#checks-organization} + +Tale compare aussi un nœud `agent` avec ton organisation. Il avertit quand le nœud demande un skill qu’aucune exécution de l’automatisation ne peut utiliser, un connector que personne n’a connecté, un secret que personne n’a enregistré, ou un environnement d’agent que ce déploiement ne peut pas exécuter. Un nœud qui exécute une action d’un connector que personne n’a connecté reçoit le même avertissement, tout comme un déclencheur d’événement qui attend un événement que Tale n’émet pas. À l’exécution, un skill ou un environnement d’agent manquant fait échouer le nœud, un nœud privé de son connector ne peut pas atteindre l’application, et un secret manquant est simplement absent. + +Ces vérifications restent des avertissements, car ton organisation peut changer d’ici l’exécution : connecte le connector ou ajoute le skill, et la vérification suivante ne le signale plus. Seuls les rôles Propriétaire, Admin et Développeur sont informés des secrets, car eux seuls voient quels secrets existent. + ### Tests {#checks-tests} L’entrée d’un test doit correspondre à `inputs`, chaque effet attendu doit venir d’un nœud qui l’effectue, et une valeur de sortie attendue doit avoir un type que l’automatisation peut renvoyer. Un test qui enfreint l’une de ces règles ne peut jamais réussir : Tale avertit donc avant que tu ne le lances. @@ -145,7 +157,7 @@ Une exécution réelle nécessite une version en service. Tu peux tester un brou ## Ce qui lance une exécution -Tu peux tester manuellement une version enregistrée ou exécuter en réel la version en service. Pour un démarrage automatique, configure l’un des trois déclencheurs : une planification avec expression cron et fuseau IANA, une URL de webhook protégée par un jeton, ou un événement nommé de la plateforme. +Tu peux tester manuellement une version enregistrée ou exécuter en réel la version en service. Pour un démarrage automatique, configure l’un des trois déclencheurs : une planification qui se répète à des heures précises ou à intervalles dans son fuseau horaire, une URL de webhook protégée par un jeton, ou un événement nommé de la plateforme. Chacun peut ajouter une entrée fixe que reçoit chaque exécution. Le déclencheur appartient au nom de l’automatisation. Mettre une autre version en service conserve sa configuration et l’URL du webhook, mais les démarrages suivants utilisent la nouvelle version. Désactive le déclencheur pour suspendre les démarrages automatiques. [Déclencheurs de workflow](/fr/platform/automations/triggers) explique les horaires, l’authentification et les données fournies par chaque type. diff --git a/docs/fr/platform/automations/editor.md b/docs/fr/platform/automations/editor.md index 1cbcd5e0bd..ade7d8eb7e 100644 --- a/docs/fr/platform/automations/editor.md +++ b/docs/fr/platform/automations/editor.md @@ -1,49 +1,137 @@ --- title: L’éditeur de workflow -description: Examine et modifie les nœuds, fournis les données de test, puis enregistre, déploie ou rétablis une version. +description: Lis une automatisation sur son canevas, suis ses chemins possibles, modifie les champs d’un nœud, enregistre une version, puis déploie-la ou rétablis-en une autre. --- -L’éditeur de workflow permet de modifier le comportement d’une automatisation et de choisir sa version active. Il faut les droits Développeur, Admin ou Propriétaire pour apporter des changements. Enregistrer, tester et mettre en service sont des étapes distinctes : modifier un brouillon laisse la version déployée en place. +L’éditeur de workflow permet de lire ce que fait une automatisation, de modifier ses champs et de choisir la version enregistrée qui s’exécute en service. Les changements plus importants, comme de nouveaux nœuds, passent par un agent de code via MCP. Il faut les droits Développeur, Admin ou Propriétaire pour apporter des changements. Enregistrer, tester et mettre en service sont des étapes distinctes : modifier un brouillon laisse la version déployée en place. Ouvre **Automatisations**, puis sélectionne une automatisation. Elle s’ouvre dans l’onglet **Éditeur**. Une automatisation ouverte depuis l’onglet **Automatisations** d’un projet affiche ce projet au début du fil d’Ariane : choisis le nom du projet pour revenir au projet, ou **Automatisations** pour revenir à ses automatisations. Que tu ouvres une automatisation depuis un projet ou depuis la liste, la barre de navigation met **Automatisations** en évidence. Pour en créer une, consulte [Créer ou importer une automatisation](/fr/platform/automations/catalog). | Onglet | Utilisation | | --- | --- | -| **Éditeur** | Modifier le workflow, tester une version enregistrée et choisir celle à mettre en service. | +| **Éditeur** | Lire et modifier le workflow, tester une version enregistrée et choisir celle à mettre en service. | | **Général** | Choisir ce qui démarre l’automatisation et les projets qui peuvent l’utiliser. | | **Exécutions** | Examiner les derniers lancements et ouvrir le détail d’une exécution. | Le sélecteur **Version** reste à droite des onglets Éditeur, Général et Exécutions, sur ordinateur comme sur téléphone. Il affiche les messages de version, les dates, les résultats des tests et la version en service. Sélectionne une ligne pour ouvrir cette version. Sur ordinateur, les commandes d’exécution se trouvent à côté des onglets, avec **Enregistrer** et **Abandonner** ; dans **Général**, seuls **Enregistrer** et **Abandonner** y figurent. Un point sur un onglet signale ses modifications non enregistrées. Avant de quitter cet onglet ou de changer de version, Tale te demande quoi en faire. -Sur téléphone, la navigation est compacte à l’ouverture d’une automatisation. Le canevas de l’éditeur occupe la hauteur disponible. Les commandes d’exécution et de mise en service se trouvent dans le canevas, à côté du zoom. Sélectionne un nœud pour ouvrir ses champs — avec Enregistrer et Abandonner — dans un panneau au bas de l’écran. +Sur téléphone, la navigation est compacte à l’ouverture d’une automatisation. Le canevas de l’éditeur occupe la hauteur disponible, et les commandes d’exécution et de mise en service se trouvent dans une barre au bas du canevas. Sélectionne un nœud pour ouvrir ses champs — avec Enregistrer et Abandonner — dans un panneau au bas de l’écran. - + -![L’éditeur montre les nœuds connectés et les champs du nœud sélectionné à côté du canvas.](/images/platform/automation-editor-canvas.webp) +![L’éditeur montre les nœuds de Gmail triage inbox entre Début et Fin, une condition formulée en mots au-dessus d’un nœud et les champs du nœud sélectionné à côté du canevas.](/images/platform/automation-editor-canvas.webp) Pour passer à une autre automatisation sans revenir à la liste, clique sur le nom de celle qui est ouverte dans le fil d’Ariane. Le menu garde toutes les automatisations de l’organisation, même après un changement de projet, sauf celles associées uniquement à des projets que tu ne peux pas ouvrir. Celles qui ne sont rattachées à aucun projet apparaissent en premier, puis viennent celles liées à des projets. Une ligne horizontale sépare les deux groupes. Cherche par nom ou par slug, puis sélectionne une entrée. Tu conserves l’onglet ouvert. Depuis le détail d’une exécution, tu arrives sur la liste **Exécutions** de l’autre automatisation. Le numéro de version sélectionné n’est pas repris : **Éditeur** affiche la dernière version enregistrée de cette autre automatisation. -## Lire le canvas +## Lire le canevas -Chaque bloc est un nœud. Son libellé indique l’étape et le type ; **Lit** désigne les nœuds dont il utilise la sortie. Les flèches viennent des références, comme `{{ nodes.draft.output.text }}`. Modifie la référence pour changer la dépendance ; dessiner une flèche ne crée pas de dépendance. +Tale dessine le canevas à partir du document de l’automatisation et le dispose lui-même : **Début** se trouve en haut, **Fin** en bas, et chaque nœud se place sous les nœuds qu’il lit. Le canevas se lit donc de haut en bas, dans l’ordre que suit une exécution. Personne ne place un bloc, et dessiner ne relie rien. Un trait vient d’une référence comme `{{ nodes.draft.output.text }}` ; pour changer ce qu’un nœud lit, modifie la référence. -Les badges indiquent les conditions et boucles : `when`, `else of`, `for each`, `repeat until` et `continue on error`. Un avertissement de cycle signifie que plusieurs nœuds dépendent les uns des autres. Supprime la référence circulaire avant d’enregistrer une version exécutable. +### Début et Fin + +**Début** indique ce qui démarre une exécution et ce qu’elle reçoit. Sous **Démarre**, il décrit le déclencheur en mots, par exemple une planification avec son fuseau horaire et sa prochaine exécution, et précise si le déclencheur est désactivé ou attend une version en service. Vient ensuite **À la main, via l’API ou MCP**, car ces démarrages sont toujours possibles. Sous **Entrée**, il liste les champs de l’entrée de l’exécution, avec leur type et leur caractère obligatoire. Quand le déclencheur lancerait des exécutions dont l’automatisation refuse l’entrée, Début le signale. + +**Fin** indique ce que renvoie une exécution réussie et comment une exécution peut se terminer. Sous **Renvoie**, elle nomme la sortie, par exemple **La sortie de Report**, ou liste ses champs et les nœuds dont ils viennent ; un champ vide lors de certaines exécutions porte **peut être vide**. Sous **Se termine**, elle liste les trois issues : **Réussie** renvoie la sortie, **En échec** survient quand l’un des nœuds qui arrêtent l’exécution échoue, et **Arrêtée** quand quelqu’un arrête l’exécution. + +### Nœuds + +Chaque nœud est un bloc. Sa première ligne montre son icône et son titre, tiré de son ID : `open_issues` devient **Open issues**. La ligne suivante indique de quel type de nœud il s’agit : le connecteur et l’action, comme **GitHub · Lister les issues**, **Transformation**, **Modèle de langage** ou **Agent** avec son modèle, ou l’automatisation qu’il appelle. Quand Tale sait ce que le nœud renvoie, une ligne en montre la structure, par exemple `{ issues: object[] }`. La ligne du bas indique ce que le nœud lit, par exemple **Lit Issues et l’entrée (owner, repo)**, ou **Ne lit aucun autre nœud**. + +Des puces et de petites icônes ajoutent ce que la disposition ne montre pas. **Continue en cas d’erreur** marque un nœud dont l’exécution tolère l’échec, et **Ne s'exécute jamais** un nœud qu’aucune combinaison de conditions n’atteint. Un bouclier marque un nœud qui modifie des données dans un service connecté, où une exécution réelle peut attendre une approbation ; une bulle marque un agent qui peut poser une question ; une épingle barrée marque un modèle sans fournisseur fixé. Pointe sur une icône pour lire sa phrase ; un lecteur d’écran l’entend avec le bloc. Un bloc qui a des problèmes en affiche le nombre sur sa première ligne. + +### Conditions et branches + +La condition d’un nœud (`when`) se place au-dessus de lui, dans une pastille qui la formule en mots, par exemple « total de Score est supérieur à 1 000 ». Le nœud du dessous ne s’exécute que si la condition est remplie. Quand un autre nœud est son alternative (`elseOf`), la condition se divise en deux traits : **Oui** mène au nœud de gauche, qui s’exécute quand la condition est remplie, et **Non** à son alternative, à droite. Une condition que Tale ne peut pas formuler en mots affiche l’expression elle-même, en police de code. + +```yaml +nodes: + - id: escalate + type: transform + when: '{{ nodes.score.output.total > 1000 }}' + input: { total: '{{ nodes.score.output.total }}' } + code: 'return { text: "Escalate " + input.total };' + - id: file + type: transform + elseOf: escalate + input: { total: '{{ nodes.score.output.total }}' } + code: 'return { text: "File " + input.total };' +``` + +Dans cet extrait, la condition au-dessus d’Escalate indique « total de Score est supérieur à 1 000 », **Oui** mène à Escalate et **Non** à File. Pointe sur une condition, ou sur son **Oui** ou son **Non**, pour mettre en évidence les chemins qui passent par elle. + +### Traits, cadres et blocs tiretés + +Un trait plein signifie que le nœud du dessous lit la sortie de celui du dessus. Un trait tireté signifie que le nœud du dessous s’exécute après celui du dessus sans lire sa sortie, par exemple parce que sa condition la lit. Un trait pointillé vers Fin part du dernier nœud d’une exécution dont Fin ne renvoie pas la sortie. Les traits **Oui** et **Non** ont leurs propres couleurs. + +Un cadre autour d’un nœud indique qu’il s’exécute plusieurs fois : une fois par élément d’une liste (**Pour chaque élément de …**) ou à nouveau jusqu’à ce qu’une condition soit remplie (**Se répète jusqu’à : …, 5 fois au plus**). Un bloc tireté est un nœud qui peut ne pas s’exécuter ; après une exécution, c’est un nœud qui ne s’est pas exécuté. **Légende**, à côté du zoom, explique chaque type de trait et de bloc. + +### Clavier et vue Liste + +Le diagramme est un seul arrêt dans l’ordre de tabulation. Atteins-le avec Tab et le focus se pose sur Début ; les flèches suivent les traits de bloc en bloc et le long d’une rangée, Origine et Fin sautent à Début et à Fin, et Entrée ouvre le bloc qui a le focus. Un lecteur d’écran annonce pour chaque bloc son titre, son type et ce qu’il lit ; pour une condition, il annonce le nœud sur lequel elle décide. + +Le sélecteur de vue en haut à gauche du canevas passe de **Canevas** à **Liste** et à **Source**. **Liste** montre les mêmes nœuds dans l’ordre de l’exécution, chacun avec ce qu’il lit et sa condition en mots ; Entrée y ouvre aussi un nœud. Quand le canevas est très étroit, il s’ouvre sur **Liste**. L’adresse garde la vue et le nœud ouvert, si bien qu’un lien partagé les rouvre tous les deux. + +### Quand une nouvelle version arrive {#new-versions} + +Quelqu’un peut enregistrer une nouvelle version pendant que tu consultes l’automatisation, par exemple un agent de code via MCP. Si tu consultes la dernière version sans modifications non enregistrées, le canevas passe à la nouvelle : les blocs glissent vers leur nouvelle place, les nouveaux apparaissent en fondu, ceux qui ont changé s’entourent une fois d’un anneau, et un lecteur d’écran annonce « Affichage de la v6. ». Le nœud ouvert le reste s’il existe encore. Si tu as des modifications non enregistrées, rien ne bouge. Un avis au-dessus du canevas indique **Une version plus récente a été enregistrée**, et **Afficher la v6 et abandonner mon brouillon** y passe. + +## Suivre les chemins possibles {#paths} + +Les conditions d’une exécution décident des nœuds qui s’exécutent. Le bouton des chemins, en haut à droite du canevas, compte les chemins qu’une exécution réussie peut prendre, par exemple **3 chemins**, et ouvre **Chemins possibles**. Chaque chemin nomme les conditions qui le décident, comme « Triage s’exécute » ou « Propose échoue, l’exécution continue », et le nombre de nœuds qui s’y exécutent. + +Pointe sur un chemin, ou atteins-le avec les flèches, pour le prévisualiser sur le canevas. Clique dessus ou appuie sur Entrée pour le garder affiché : les nœuds hors du chemin deviennent tiretés et disent pourquoi ils ne s’exécutent pas, Fin marque les sorties qui restent vides sur ce chemin, et un lecteur d’écran annonce le chemin affiché. **Tout afficher**, ou Échap, affiche de nouveau chaque nœud. La liste reste ouverte pendant que tu sélectionnes des nœuds, pour comparer un chemin avec les champs d’un nœud. + +Sous **Arrête l’exécution en cas d’échec**, la liste nomme les nœuds dont l’échec arrête l’exécution, avec ce qui peut faire échouer chacun d’eux. Pointe sur l’un d’eux pour les entourer tous de rouge ; sélectionne-en un pour l’ouvrir. + +Sur téléphone, la liste s’ouvre dans un panneau au bas de l’écran. Choisir un chemin ferme le panneau et laisse en haut du canevas une pastille qui nomme le chemin, avec **Tout afficher**. Quand chaque exécution suit le même chemin, la liste le dit. Au-delà de 12 conditions et échecs tolérés, les chemins sont trop nombreux pour être listés ; **Quand il s’exécute** indique toujours, pour chaque nœud, quand il s’exécute. Un canevas qui contient un cycle n’a pas de bouton des chemins. [Les chemins qu’une exécution peut prendre](/fr/platform/automations/concepts#paths) explique comment Tale les détermine. ## Modifier un nœud -Sélectionne un bloc pour ouvrir ses champs. Sur un écran large, le panneau apparaît à côté du canvas ; sans nœud sélectionné, le canvas occupe toute la largeur. Sur un écran plus étroit, les champs s’ouvrent dans un dialogue au-dessus du canvas. Un `transform` possède du **Code** ; un `llm`, des champs de prompt, modèle et schéma de sortie ; un `agent` ajoute l’environnement d’agent et l’équipement. Le sélecteur **Modèle** d’un nœud `llm` ou `agent` liste les modèles servis par les fournisseurs connectés de ton organisation ; un modèle absent de la liste peut être saisi, mais **Problèmes** avertit alors qu’une exécution en direct échouerait à ce nœud tant que son fournisseur n’est pas connecté. **Entrée** contient les valeurs JSON et références transmises au nœud. Un JSON incomplet est signalé et ne met pas le nœud à jour. +Sélectionne un bloc pour l’ouvrir. Sur un écran large, l’inspecteur s’ouvre à côté du canevas ; sans nœud sélectionné, le canevas occupe toute la largeur. Sur un écran plus étroit, il s’ouvre dans un panneau au-dessus du canevas. Son en-tête montre le titre du nœud, son type et son ID avec **Copier l’ID du nœud** ; les problèmes propres au nœud sont listés dessous. **Quand il s’exécute** résume la place du nœud dans le flux : à chaque exécution, sur certains chemins ou jamais, pourquoi il peut être ignoré et ce qui se passe s’il échoue, par exemple « S’il échoue, l’exécution s’arrête avec son erreur. » + +Trois onglets suivent : + +- **Champs** contient ce que tu peux modifier. Un `transform` possède du **Code** ; un `llm`, **Prompt**, **Prompt système**, **Modèle** et **Schéma de sortie** ; un `agent` y ajoute l’environnement d’agent et l’équipement. **Entrée** contient les valeurs JSON et références transmises au nœud. +- **Structure** montre ce que le nœud reçoit et renvoie, d’où Tale tient cette structure et quels nœuds lisent sa sortie. Sélectionne un lecteur pour l’ouvrir. **Afficher en TypeScript** montre la même structure sous forme de type. +- **Dernière exécution** montre l’**Entrée résolue**, la **Sortie** et les effets du nœud dans l’exécution affichée sur le canevas. L’onglet apparaît tant que le canevas montre une exécution. + +Le sélecteur **Modèle** d’un nœud `llm` ou `agent` liste les modèles servis par les fournisseurs connectés de ton organisation ; un modèle absent de la liste peut être saisi, mais **Problèmes** avertit alors qu’une exécution réelle échouerait à ce nœud tant que son fournisseur n’est pas connecté. + +Ouvre **Contrôle du flux** pour la condition, l’itération et la gestion des échecs du nœud ; si le nœud en utilise une, la section est déjà ouverte. **Si**, **Pour chaque** et **Répéter jusqu’à** prennent des expressions. **Sinon de** ne propose que des nœuds qui ont une condition, et **Aucun** retire l’alternative. **Répétitions maximales** apparaît avec **Répéter jusqu’à** et prend un nombre entier de 1 à 20. **En cas d’erreur** choisit entre **Arrêter l’exécution** et **Continuer sans lui** ; continuer ignore chaque nœud qui lit la sortie du nœud en échec. Sous une condition, une liste ou une alternative, une phrase dit en mots ce que fait le réglage. + +Utilise **Fermer** pour revenir au canevas. Sur un écran large, tu peux aussi fermer le panneau en cliquant sur le fond du canevas ou en appuyant sur Échap hors d’un champ de texte. Les réglages du déclencheur et des projets se trouvent dans l’onglet **Général**. [Concepts d’automatisation](/fr/platform/automations/concepts) explique les types de nœuds et les expressions. + +### Code, prompts et JSON + +Le code, les prompts, les conditions et les champs JSON sont des éditeurs de code. Ils colorent la syntaxe et chaque template `{{ }}`, et connaissent l’automatisation. Tape `{{` dans un prompt et les accolades fermantes apparaissent, avec le curseur entre les deux ; tape `nodes.` pour ne voir que les nœuds qui s’exécutent avant, et `.output.` pour voir les champs de ce nœud avec leurs types. Ctrl+Espace ouvre les suggestions partout. Pointe sur une référence pour voir son type, ou appuie sur ⌘K ⌘I (Ctrl+K Ctrl+I) pour afficher et faire lire le type à la position du curseur. + +Un instant après ta dernière frappe, un problème est souligné exactement là où il se trouve. F8 et Maj+F8 passent au problème suivant et précédent et le lisent ; ⌘. (Ctrl+.) applique une correction proposée, comme le nom de nœud le plus proche. Dans un champ de plusieurs lignes, Tab indente ; pour le quitter au clavier, appuie sur Échap, puis sur Tab. **Agrandir l'éditeur** ouvre un long champ dans un éditeur plus grand, et **Revenir au champ** t’y ramène avec ta modification et ton curseur au même endroit. + +Un champ JSON comme **Entrée** ne modifie le nœud que si son texte est du JSON valide du bon type. Pendant la saisie, le nœud garde sa dernière valeur valide, et le champ indique ce qui manque, par exemple « Ce doit être un objet JSON, entre accolades. » + +### Entrées de Début et sortie de Fin + +Sélectionne **Début** pour voir ce qui démarre l’automatisation. **Déclencheur** le décrit en mots ; **Modifier dans Général** ouvre l’onglet **Général**, où tu règles le déclencheur. Sous **Champs**, **Entrées** montre les champs de l’entrée de l’exécution sous forme d’arbre, et **Schéma des données** contient le schéma JSON qui les définit, que tu peux modifier. **Structure** montre l’entrée telle que Tale la lit, et **Dernière exécution** l’entrée de l’exécution affichée. + +Sélectionne **Fin** pour voir ce que renvoie une exécution. **Comment une exécution se termine** liste les trois issues ; sous **En échec**, chaque nœud dont l’échec arrête l’exécution est un bouton qui l’ouvre. Sous **Champs**, **Sortie** contient la valeur JSON que renvoie une exécution réussie, avec des templates comme `{{ nodes.report.output }}`. **Structure** montre la structure de la sortie, et **Dernière exécution** la sortie de l’exécution affichée. + +## Lire la source + +Choisis **Source** dans le sélecteur de vue pour lire tout le document en YAML, coloré, avec numéros de ligne, repli et recherche (⌘F ou Ctrl+F). Chaque problème trouvé par la vérification est souligné sur la ligne qu’il concerne : un problème dans une partie sans champ propre, comme un test ou le nom, a ainsi un endroit où le lire. La source est en lecture seule : **Copier le YAML** la copie, et **Télécharger le YAML** l’enregistre dans un fichier nommé d’après l’automatisation et la version, par exemple `gmail-triage-inbox-v3.yml`, avec `-draft` en plus tant que tu as des modifications non enregistrées. Pour modifier le document, utilise les champs ou ton agent de code. + +## Modifier avec ton agent de code -Ouvre **Contrôle du flux** pour les conditions et répétitions. Si le nœud en a, la section est déjà ouverte. Utilise **Fermer** pour revenir au canvas. Sur un écran large, tu peux aussi fermer le panneau en cliquant sur le fond du canvas ou en appuyant sur Échap hors d’un champ de texte. Les réglages du déclencheur et des projets se trouvent dans l’onglet **Général**. [Concepts d’automatisation](/fr/platform/automations/concepts) explique les types de nœuds et les expressions. +Les changements plus importants, comme ajouter des nœuds ou remanier le flux, passent par un agent de code comme Claude Code, Codex ou Cursor, connecté au serveur MCP de Tale. **Modifier avec ton agent de code** est le dernier bouton en haut à droite du canevas, dans chaque vue, et l’action principale d’une automatisation qui n’a pas encore de nœud. Son dialogue montre le nom de l’automatisation à donner à l’agent, **Configurer MCP**, qui ouvre **Paramètres > API > MCP**, et **Connecter un agent de code**, qui ouvre le guide du [point d’accès MCP](/fr/develop/mcp-endpoint). L’agent lit l’automatisation, la modifie, la vérifie et enregistre une nouvelle version, qui apparaît ensuite sur le canevas comme le décrit [Quand une nouvelle version arrive](#new-versions). ## Trouver et corriger les problèmes -Pendant que tu modifies, Tale vérifie le brouillon comme il vérifie chaque enregistrement. Un instant après ta dernière frappe, le bouton **Problèmes** à côté d’**Enregistrer** montre ce que la vérification a trouvé : une icône d’erreur rouge et une icône d’avertissement orange, chacune avec son nombre, ou **Aucun problème**. Sur un téléphone, le bouton se trouve dans la barre au-dessus du canevas. Une erreur fait échouer une exécution, par exemple une référence à un nœud qui n’existe pas. Un avertissement signale un risque, par exemple la lecture de la sortie d’un nœud parfois ignoré. Un nœud qui a des problèmes affiche les mêmes nombres sur son bloc, et un champ concerné explique le problème juste en dessous. +Pendant que tu modifies, Tale vérifie le brouillon comme il vérifie chaque enregistrement. Un instant après ta dernière frappe, le bouton **Problèmes** à côté d’**Enregistrer** montre ce que la vérification a trouvé : une icône d’erreur rouge et une icône d’avertissement orange, chacune avec son nombre, ou **Aucun problème**. Sur un téléphone, le bouton se trouve dans la barre au-dessus du canevas. Une erreur fait échouer une exécution, par exemple une référence à un nœud qui n’existe pas. Un avertissement signale un risque, par exemple la lecture de la sortie d’un nœud parfois ignoré. Un nœud, une condition, Début ou Fin qui a des problèmes affiche les mêmes nombres sur son bloc, et un champ concerné explique le problème juste en dessous. -Clique sur **Problèmes** pour les lister. Sur un écran large, la liste s’ouvre sous le canvas ; sur un écran plus étroit, dans un panneau. Chaque entrée indique ce qui ne va pas, où, pourquoi et comment le corriger. **Détails techniques** affiche le message du moteur lui-même, et le code à côté du titre t’aide pour une recherche ou une demande d’assistance. **Tous**, **Erreurs** et **Avertissements** filtrent la liste ; Échap la ferme. +Clique sur **Problèmes** pour les lister. Sur un écran large, la liste s’ouvre sous le canevas ; sur un écran plus étroit, dans un panneau. Chaque entrée indique ce qui ne va pas, où, pourquoi et comment le corriger. **Détails techniques** affiche le message du moteur lui-même, et le code à côté du titre t’aide pour une recherche ou une demande d’assistance. **Tous**, **Erreurs** et **Avertissements** filtrent la liste ; Échap la ferme. -Sélectionne une entrée, ou appuie sur Entrée dessus, pour t’y rendre : le nœud s’ouvre, son champ reçoit le focus et, si le champ affiche le texte tel qu’il est enregistré, la partie en cause est sélectionnée. Un problème sans champ à lui, par exemple un modèle que ton organisation ne sert pas, figure sous **Problèmes de ce nœud** en haut des champs du nœud. Un problème dans une partie de l’automatisation que l’éditeur n’affiche pas, comme sa sortie ou ses tests, indique qu’elle ne se modifie pas ici ; modifie cette partie via MCP, l’API ou un paquet téléversé. +Sélectionne une entrée, ou appuie sur Entrée dessus, pour t’y rendre : le nœud s’ouvre, son champ reçoit le focus et la partie en cause est sélectionnée. Un problème sans champ à lui, par exemple un modèle que ton organisation ne sert pas, figure sous **Problèmes de ce nœud** en haut des champs du nœud. Un problème dans les entrées ouvre **Début**, un problème dans la sortie ouvre **Fin**, et un problème dans une autre partie du document, comme un test ou le nom, ouvre **Source** sur cette ligne. Un problème dans un nœud que ton brouillon n’a plus indique « Modifie-le avec ton agent de code. » Tant qu’il reste des erreurs, **Enregistrer** est désactivé et en donne la raison, par exemple « Corrige 1 erreur pour enregistrer ». Sur un téléphone, où **Enregistrer** se trouve sous les champs d’un nœud, **Afficher les problèmes** à côté de cette raison ouvre la liste. Les avertissements ne bloquent jamais l’enregistrement ni la mise en service. Si Tale ne peut pas vérifier le brouillon, par exemple parce que la connexion a été coupée, le bouton affiche **Vérification impossible** et tu peux quand même enregistrer : chaque enregistrement est vérifié à nouveau sur le serveur. Quand un enregistrement ou une mise en service est refusé à cause d’erreurs, la liste s’ouvre avec les problèmes renvoyés par le serveur, en commençant par la première erreur. @@ -52,8 +140,8 @@ La vérification ne s’exécute que pour les rôles Développeur, Admin et Prop ## Enregistrer et tester une version 1. Modifie les champs nécessaires et clique sur **Enregistrer**. -2. Explique le changement dans la **Note de version**, puis choisis **Enregistrer une version**. Cela ajoute une version et conserve les précédentes. Si quelqu’un a enregistré une autre version pendant ta modification, Tale refuse l’enregistrement et te demande : **Abandonner mes modifications et recharger** affiche la version plus récente, **Enregistrer quand même** ajoute ta version par-dessus — la plus récente reste dans l’historique des versions, mais la dernière version est alors la tienne. -3. Clique sur **Essai**. Si le workflow déclare un schéma d’entrée, remplis **Données de l’exécution (JSON)** dans le dialogue. Déplie **Schéma des données** pour vérifier les champs obligatoires et leurs types. Un JSON invalide ou non conforme au schéma empêche le démarrage. +2. Explique le changement dans la **Note de version**, puis choisis **Enregistrer une version**. Cela ajoute une version et conserve les précédentes. Si quelqu’un a enregistré une autre version pendant ta modification, Tale refuse l’enregistrement et te demande : **Abandonner mes modifications et recharger** affiche la version plus récente, **Enregistrer quand même** ajoute ta version par-dessus — la plus récente reste dans l’historique des versions, mais la dernière version est alors la tienne. +3. Clique sur **Essai**. Si le workflow déclare un schéma d’entrée, saisis l’entrée en JSON dans **Données de l’exécution (JSON)** ; quand tu tapes une clé, le champ propose les noms de champs du schéma, et ⌘Entrée (Ctrl+Entrée) lance l’exécution. Déplie **Schéma des données** pour voir les champs obligatoires et leurs types. Un JSON invalide ou non conforme au schéma empêche le démarrage. 4. Lance le test, passe à l’onglet **Exécutions** et ouvre sa ligne. Compare les données résolues, la sortie et les opérations prévues au résultat attendu. Pour un workflow qui exige `owner` et `repo`, les données pourraient être : @@ -71,7 +159,7 @@ Utilise le schéma réel du workflow. Un champ numérique attend un nombre JSON, -![Le dialogue de test montre les valeurs JSON owner et repo et le schéma des données déplié.](/images/platform/automation-run-input.webp) +![Le dialogue de test montre les valeurs JSON owner et repo dans l’éditeur de code et le schéma des données déplié sous forme de liste de champs.](/images/platform/automation-run-input.webp) @@ -85,7 +173,7 @@ Un déclencheur utilise aussi la version déployée. Configure-le lorsque tu es ## Examiner un résultat -**Afficher la dernière exécution** superpose les états au canvas. Sélectionne un nœud pour consulter les données de cette exécution : entrée résolue, sortie et effets. Cela suffit souvent à trouver une référence incorrecte. Compare l’entrée du nœud échoué à la sortie de sa source. +Dès que l’automatisation s’est exécutée, le canevas montre sa dernière exécution : la ligne du bas de chaque nœud indique comment il s’est terminé, par exemple **Réussi** ou **Ignoré**, et chaque condition montre comment elle a décidé, **Oui** ou **Non**. Le bouton en forme d’œil, en haut à droite du canevas, **Masquer la dernière exécution**, retire l’exécution du canevas, et **Afficher la dernière exécution** la fait revenir. Sélectionne un nœud et ouvre **Dernière exécution** pour voir son **Entrée résolue**, sa **Sortie** et ses effets. Cela suffit souvent à trouver une référence incorrecte : compare l’entrée du nœud en échec à la sortie du nœud qu’il lit. Passe à **Exécutions** et ouvre une ligne pour le détail complet. Les onglets restent visibles, avec **Exécutions** actif. **Éditeur** te ramène au workflow. Vérifie s’il s’agissait d’un test ou d’une exécution réelle et examine les opérations déjà réalisées avant de relancer. [Journaux d’exécution](/fr/platform/automations/execution-logs) explique les attentes, échecs, relances automatiques et arrêts. diff --git a/docs/fr/platform/automations/execution-logs.md b/docs/fr/platform/automations/execution-logs.md index 62cda9cfa1..b19a430db9 100644 --- a/docs/fr/platform/automations/execution-logs.md +++ b/docs/fr/platform/automations/execution-logs.md @@ -1,19 +1,19 @@ --- title: Examiner les exécutions et corriger les échecs -description: Repère le nœud concerné, vérifie les écritures enregistrées et décide s’il faut arrêter, corriger ou relancer. +description: Comprends pourquoi une exécution a échoué ou une étape a été ignorée, ce que chaque étape a lu et renvoyé, rejoue l’exécution et relance-la, à partir d’une étape ou à côté d’une autre exécution. --- Ouvre une automatisation, passe à son onglet **Exécutions** et choisis une ligne pour comprendre ce qui s’est passé. Commence par le statut, la version et le mode, puis examine le nœud concerné. Un essai réussi prouve le déroulement simulé, pas l’acceptation de la même action par un compte externe réel. -![La page d’une exécution de test de Triage GitHub issues, marquée Succeeded, Test et v1 et lancée par toi, avec ses heures de début et de fin au-dessus du graphe du workflow, où les nœuds issues, open issues, score et report affichent chacun Ran ; la liste des effets de l’exécution commence sous le graphe.](/images/platform/automation-run-detail.webp) +![La page d’une exécution de test de Triage GitHub issues, marquée Succeeded, Test et v1 et lancée par toi, avec ses heures de début et de fin au-dessus du graphe du workflow, où les nœuds issues, open issues, score et report affichent chacun Succeeded ; la liste des effets de l’exécution commence sous le graphe.](/images/platform/automation-run-detail.webp) ## Lire l’état de l’exécution -L’onglet **Exécutions** présente les 50 dernières exécutions que tu peux voir, de la plus récente à la plus ancienne. Les propriétaires, les admins et les développeurs voient les exécutions de l’organisation elle-même ; une exécution dans un projet, et la question qu’elle attend, n’apparaissent qu’à ceux d’entre eux qui peuvent ouvrir ce projet. Chaque ligne précise version, date, mode et déclencheur, ou donne la cause d’un échec ou d’une attente. Le détail affiche le workflow, les résultats des nœuds et les horaires. Une exécution inachevée n’a pas de date de fin. Les onglets restent visibles pendant la consultation. Choisis **Exécutions** pour revenir à la liste, ou **Éditeur** pour modifier le workflow. +L’onglet **Exécutions** présente les exécutions que tu peux voir, de la plus récente à la plus ancienne, et charge les plus anciennes au défilement ; **Filtre** les restreint par statut et par mode. Les propriétaires, les admins et les développeurs voient les exécutions de l’organisation elle-même ; une exécution dans un projet, et la question qu’elle attend, n’apparaissent qu’à ceux d’entre eux qui peuvent ouvrir ce projet. Chaque ligne précise version, date, mode et déclencheur, ou donne la cause d’un échec ou d’une attente. Le détail affiche le workflow, les résultats des nœuds et les horaires. Une exécution inachevée n’a pas de date de fin. Les onglets restent visibles pendant la consultation. Choisis **Exécutions** pour revenir à la liste, ou **Éditeur** pour modifier le workflow. | Statut | Signification | Suite à donner | | --- | --- | --- | @@ -34,16 +34,63 @@ Une approbation, une question ou une étape peut-être déjà exécutée attend Laisse l’exécution suspendue pendant tes vérifications. **Demander l’arrêt** demande à Tale d’arrêter les sessions qu’il peut identifier et explique l’incertitude avant ta confirmation. **Arrêt demandé** ne confirme pas l’arrêt du travail : la suspension reste en place jusqu’à confirmation de l’arrêt du travail précédent. La demande n’annule aucune action externe antérieure. Si la suspension change pendant que la fenêtre de confirmation est ouverte, ferme-la et consulte les détails actualisés. -## Examiner le nœud concerné +## Comprendre pourquoi une exécution a échoué {#failures} -Sélectionne un nœud sur le canvas de l’exécution. **Entrée résolue** montre les valeurs après évaluation des expressions, et **Sortie** le résultat de l’étape. Ces champs distinguent une mauvaise référence d’une défaillance du service. +Une exécution en échec s’ouvre sur une carte qui dit où et pourquoi elle a échoué : **L’exécution a échoué à l’étape Greet**, un titre court pour le problème, par exemple **Une valeur lue est absente**, ce que cela signifie, la cause concrète et **Pour corriger :**. Pour une valeur absente, la cause nomme l’expression, le champ lu et l’étape dont la sortie ne contenait rien ; la correction propose une lecture qui ne peut pas échouer, par exemple `nodes.fetch_customer.output.customer?.email`. Le message du moteur reste sous **Détails techniques**. -Les états comprennent **Exécuté**, **Ignoré**, **En échec**, **Jamais atteint**, **Pas encore atteint** et, pour une exécution arrêtée, **Arrêté ici** pour le nœud sur lequel elle se trouvait au moment de l’arrêt. Une condition fausse, une dépendance, une branche alternative ou une règle de poursuite après erreur peut expliquer un nœud ignoré. Ce n’est pas toujours un problème. +Sous la carte, l’étape et son champ, par exemple **Greet › input.email**, côtoient **Afficher dans l’éditeur**, qui ouvre l’éditeur sur la version exécutée avec cette étape sélectionnée. **Afficher l’étape** la sélectionne sur le canevas de l’exécution, et **Relancer à partir de cette étape** prépare la relance décrite dans [Relancer à partir d’une étape](#retry-from-step). -Par exemple, un rappel peut recevoir le nom du client mais un identifiant de facture vide. Examine la sortie précédente. Si le champ a été renommé, corrige la référence plutôt que les identifiants de messagerie. Vérifie ensuite l’entrée résolue dans un nouvel essai. +Sur le canevas, le nœud en échec est encadré de rouge et sa ligne du bas reprend le titre de l’échec ; les nœuds par lesquels l’exécution est passée pour l’atteindre ressortent, tandis que les autres passent au second plan ; et Fin indique où l’exécution a échoué, par exemple **Échec à Propose**. La liste **Exécutions** nomme la cause d’une exécution en échec avec le même titre. Une application qui lit l’[API des exécutions](/fr/develop/api-reference) reçoit aussi `failureCode` lorsqu’une cause a été attribuée à l’échec. Par exemple, `approval_rejected` indique qu’une personne a refusé l’opération, tandis que `llm_output_invalid` signale une réponse du modèle qui ne respecte pas la structure attendue. Les anciens échecs peuvent ne pas avoir de code. Celui-ci aide à orienter le diagnostic ; il ne garantit ni qu’une relance est sans risque, ni qu’elle réussira. +## Savoir pourquoi une étape s’est exécutée ou a été ignorée {#conditions} + +Sélectionne un nœud sur le canevas de l’exécution pour ouvrir son onglet **Dernière exécution**. Une étape exécutée ou ignorée à cause d’une condition le dit en une phrase, par exemple **L’étape Big order a été ignorée, car sa condition n’était pas remplie**. En dessous, **Seulement si** montre la condition en mots, avec la valeur lue par chaque référence et son résultat, par exemple « amount de l’entrée (250) n’est pas supérieur à 1 000 » et **Non**. Une condition reliée par `&&` ou `||` affiche chaque partie avec **Oui** ou **Non** ; une partie que l’exécution n’a pas eu à vérifier indique **Non vérifié**. Une condition écrite en code affiche son code. + +Une condition non remplie, une alternative exécutée, une étape lue qui a été ignorée ou une règle de poursuite après erreur peut expliquer un nœud ignoré ; la phrase nomme la raison et l’étape concernée. Ce n’est pas toujours un problème. + +Sur le canevas, la ligne du bas de chaque nœud indique comment il s’est terminé : **Réussi**, **Échoué**, **Ignoré**, **Non exécuté**, **Pas encore atteint**, **Réutilisé** pour une étape qu’une relance a reprise d’une exécution précédente ou, pour une exécution arrêtée, **Arrêté ici** pour le nœud sur lequel elle se trouvait au moment de l’arrêt. Chaque condition montre comment elle a décidé, **Oui** ou **Non**. + +## Voir ce qu’une étape a lu, reçu et renvoyé {#step-data} + +**Ce qui a été lu** liste chaque valeur que l’étape a prise dans l’entrée ou dans d’autres étapes, en mots et avec la valeur lue, par exemple « items de Inbox : 3 éléments ». **Reçu** montre l’entrée de l’étape après évaluation de ses expressions, et **Renvoyé** ce qu’elle a produit. Ensemble, ils distinguent une mauvaise référence d’une défaillance du service. Une valeur qui contenait un secret est masquée et le signale, et une valeur trop volumineuse indique qu’une partie seulement a été conservée. + +Une valeur se lit comme un arbre que tu ouvres avec les flèches. **Valeurs** et **Structure** passent des valeurs aux champs et à leurs types, et les boutons copient une valeur, en téléchargent une volumineuse ou l’ouvrent en plein écran. Quand l’entrée et la sortie d’une étape sont toutes deux des objets ou toutes deux des listes, **Ce qu’elle a changé** liste les champs que l’étape a ajoutés, retirés et modifiés. + +Une étape exécutée une fois par élément liste ses éléments, chacun avec son issue et, en cas d’échec, sa raison. **Seulement en échec** restreint la liste, et sélectionner un élément montre ce qu’il a lu, reçu et renvoyé. Tale conserve les 200 premiers éléments et chaque élément en échec. Une étape qui a demandé plus d’une tentative, ou dont une tentative a été interrompue par un redémarrage, liste ses **Tentatives**. Une étape qui a appelé un service indique si l’appel est terminé, en échec ou a peut-être déjà été exécuté, et ce qu’une personne a choisi à son sujet. + +Par exemple, un rappel peut recevoir le nom du client mais un identifiant de facture vide. Examine ce qu’il a lu dans l’étape précédente. Si le champ a été renommé, corrige la référence plutôt que les identifiants de messagerie. Vérifie ensuite l’entrée corrigée dans un nouvel essai. + +## Rejouer l’exécution {#play} + +La barre sous le canevas rejoue l’exécution : chaque étape s’allume pendant qu’elle travaille, les valeurs circulent le long des liaisons vers les étapes qui les lisent, et chaque condition montre sa décision. Elle s’ouvre sur la fin de l’exécution, pour que tu voies d’abord l’ensemble. **Lire** repart du début, **Événement précédent** et **Événement suivant** avancent pas à pas, et le curseur mène à n’importe quel moment ; l’horloge indique depuis combien de temps l’exécution tournait réellement, et la vitesse change le rythme de lecture. Les longues attentes sont raccourcies pour ne pas bloquer la lecture. Tant qu’une exécution est en cours, la barre la suit ; si tu reviens en arrière, **Suivre en direct** ramène à sa fin. + +**Étapes**, à côté de **Graphique**, présente la même exécution comme ses étapes dans l’ordre du temps : combien de temps chacune a travaillé, une barre pour le moment où elle a travaillé, chaque condition avec sa décision, ainsi que les attentes et les redémarrages. La vue suit la même horloge. Choisir une étape l’ouvre et place l’horloge à son début, et **Graphique** montre le canevas à ce moment. Une étape exécutée une fois par élément ou répétée se déplie sur ses éléments ou ses passages, chacun avec son issue et sa durée ; en choisir un l’ouvre dans l’onglet **Dernière exécution** de l’étape. L’adresse de la page garde la vue (`?view=steps`), l’étape et l’élément choisis, ainsi que le moment où la lecture s’est arrêtée, si bien qu’un lien ou un rechargement rouvre l’exécution là où tu l’avais laissée. + +## Relancer l’exécution {#run-again} + +**Relancer** démarre une nouvelle exécution de la même version, avec la même entrée et le même mode. Un essai démarre aussitôt ; une exécution réelle qui a écrit demande d’abord confirmation et nomme les services auxquels elle enverrait à nouveau. Le menu à côté propose : + +- **Modifier l’entrée et exécuter…** ouvre la boîte d’exécution avec l’entrée de cette exécution à modifier ; confirmer une entrée inchangée relance simplement l’exécution. +- **Relancer sur la v6 en essai** lorsqu’une version plus récente existe, et **Relancer en essai** pour une exécution réelle. +- **Exécuter en réel sur la v5** lorsqu’une autre version est en service et que ton rôle peut lancer des exécutions réelles. +- **Comparer avec l’exécution précédente**, **Copier l’ID de l’exécution** et **Copier le lien**. + +Lorsqu’une exécution réelle ne peut pas être relancée en réel, parce que sa version n’est plus en service ou que ton rôle ne le permet pas, **Relancer** en donne la raison. + +L’en-tête de la nouvelle exécution indique d’où elle vient, par exemple **Relance de l’exécution 1db433 · entrée modifiée**, avec **Ouvrir l’exécution 1db433** et **Comparer avec elle**. Une relance est une nouvelle exécution : elle renvoie ses écritures et consomme ce que consomme une exécution. + +## Relancer à partir d’une étape {#retry-from-step} + +**Relancer à partir de cette étape** montre ce que fera la relance avant qu’elle démarre. **Réutilisées** liste les étapes dont la nouvelle exécution reprend les résultats, et **Exécutées à nouveau** l’étape choisie et chaque étape suivante qui en dépend. Si ces étapes écrivent vers un service et que la relance est réelle, la boîte prévient que ces écritures repartent. La relance d’un essai reste un essai, car les résultats qu’elle réutiliserait étaient inventés. + +Tale refuse une relance qu’il ne peut pas exécuter fidèlement et dit pourquoi : la version à exécuter a modifié une étape réutilisée, l’exécution n’est pas terminée, ou elle n’a conservé aucune entrée. Sur le canevas de la nouvelle exécution, les étapes reprises sont marquées **Réutilisé**. + +## Comparer deux exécutions {#compare} + +**Comparer avec elle** sur une relance, **Comparer avec l’exécution précédente** dans le menu de **Relancer**, ou deux exécutions sélectionnées dans l’onglet **Exécutions** puis **Comparer** affichent deux exécutions côte à côte. **Ce qui diffère** nomme, le plus parlant d’abord, les versions exécutées, le nombre de champs d’entrée qui diffèrent, l’étape où elles divergent et pourquoi, par exemple une condition qui n’a pas donné le même résultat, comment chacune s’est terminée, ainsi que leur sortie et leurs écritures. Le tableau liste chaque étape, comment chaque exécution l’a laissée et si ses données sont identiques. **Échanger A et B** inverse les deux exécutions. Quand leur entrée ou leur sortie diffère, **Entrée : A → B** et **Sortie : A → B** les montrent côte à côte, chaque champ modifié marqué. **Les deux exécutions sur le graphique** les dessine sur le graphique de la version de B : chaque étape dit comment A et B l’ont laissée, l’étape où elles divergent est entourée, et une étape absente de la version de A est en pointillés. + ## Vérifier les changements déjà effectués La liste des effets enregistre les écritures des connectors avec leur nœud, leur connector et leurs données. Les essais utilisent des réponses simulées ; les actions réelles peuvent modifier des systèmes externes. L’exécution indique explicitement l’absence d’effets enregistrés. @@ -52,7 +99,7 @@ Lis cette liste avant de recommencer. Un échec ultérieur n’annule ni un mess ## Comprendre les reprises et nouvelles tentatives -Le moteur enregistre les nœuds terminés comme points de reprise et continue après eux. Une nouvelle exécution distincte possède ses propres points de reprise et peut répéter des écritures. Relancer n’est donc pas reprendre l’exécution existante. +Le moteur enregistre les nœuds terminés comme points de reprise et continue après eux. Une nouvelle exécution distincte, par exemple lancée avec **Relancer**, possède ses propres points de reprise et peut répéter des écritures. Relancer n’est donc pas reprendre l’exécution existante ; une [relance à partir d’une étape](#retry-from-step) ne reprend que les résultats des étapes qui la précèdent. Une exécution peut changer de serveur en cours de route. Un serveur mis à jour ou redémarré transmet ses exécutions à leur prochaine étape : l’étape en cours se termine, puis le serveur suivant continue avec l’étape d’après, ou avec l’élément suivant quand l’étape s’exécute une fois par élément. Une étape qui travaille encore 20 secondes après le début du redémarrage est interrompue et s’exécute à nouveau sur le serveur suivant. Quand un serveur s’arrête sans prévenir, un autre reprend ses exécutions en une minute et demie environ. Les étapes terminées ne s’exécutent pas une seconde fois. L’en-tête de l’exécution indique alors **Reprise après un redémarrage**, ou le nombre de redémarrages, avec l’heure du dernier changement et sa raison : le serveur était mis à jour ou redémarré, ou il ne répondait plus. Tant qu’aucun autre serveur n’a repris l’exécution, son statut indique **Interrompue — reprise en cours**. @@ -74,6 +121,6 @@ L’épuisement de la fenêtre totale d’exécution, l’expiration d’une que Choisis **Arrêter l’exécution** pour annuler une exécution inachevée, puis confirme. Le moteur empêche la poursuite aux limites de ses étapes ; il n’annule pas les effets déjà produits. Si l’exécution se termine avant de recevoir l’annulation, elle conserve son résultat final. -Pour corriger le document, reviens à l’éditeur, modifie l’entrée ou le nœud concerné et enregistre une version avec un message utile. Fais un essai avec des données représentatives et lis les valeurs et la sortie, au-delà du statut de réussite. Mets la version vérifiée en service. Les prochains démarrages planifiés ou par webhook l’utiliseront ; l’ancien échec reste le journal de l’ancienne version. +Pour corriger le document, utilise **Afficher dans l’éditeur** sur la carte d’échec ou reviens à l’éditeur, modifie l’entrée ou le nœud concerné et enregistre une version avec un message utile. Fais un essai avec des données représentatives et lis les valeurs et la sortie, au-delà du statut de réussite. Mets la version vérifiée en service. Les prochains démarrages planifiés ou par webhook l’utiliseront ; l’ancien échec reste le journal de l’ancienne version. Si aucune exécution n’a démarré, examine le [déclencheur](/fr/platform/automations/triggers). Sa désactivation, une mise en service manquante ou des données refusées peuvent expliquer l’absence totale d’exécution. diff --git a/docs/fr/platform/automations/triggers.md b/docs/fr/platform/automations/triggers.md index 393cb071ea..b0e2d0648e 100644 --- a/docs/fr/platform/automations/triggers.md +++ b/docs/fr/platform/automations/triggers.md @@ -1,13 +1,13 @@ --- title: Démarrer les automatisations automatiquement -description: Configure horaires, webhooks et événements, adapte les données d’entrée et identifie les démarrages manqués. +description: Lance une automatisation selon une planification, depuis un webhook ou sur un événement de la plateforme, vérifie ce que reçoit chaque exécution et comprends pourquoi un démarrage a été ignoré. --- -La section **Déclencheur** de l’onglet **Général** d’une automatisation définit quand elle démarre seule. Chaque déclencheur utilise la version en service en mode réel. Avant de l’activer, teste le workflow avec les données qu’il recevra et vérifie que ses actions externes sont prêtes. +La section **Déclencheur** de l’onglet **Général** d’une automatisation définit quand elle démarre seule : selon une planification, quand un autre système envoie une requête, ou quand quelque chose se passe dans Tale. Chaque déclencheur utilise la version en service en mode réel. Avant d’en activer un, vérifie ce que recevront ses exécutions et que les actions externes du workflow sont prêtes. - + -![L’onglet Général de Triage the Gmail inbox avec un déclencheur Schedule activé, l’expression cron 0 */6 * * * décrite comme toutes les six heures et sans démarrage tant qu’aucune version n’est déployée, le fuseau horaire UTC et, en dessous, un sélecteur de projets vide.](/images/platform/automation-general-trigger.webp) +![L’onglet Général de Triage the Gmail inbox avec l’interrupteur Enabled désactivé, Schedule comme type de déclencheur, le format Repeat avec une planification toutes les 6 heures, le fuseau horaire UTC, Start the latest one when Tale is back sous Missed runs et les prochaines exécutions listées sous Would run at.](/images/platform/automation-general-trigger.webp) @@ -15,38 +15,89 @@ La section **Déclencheur** de l’onglet **Général** d’une automatisation d | Type de déclencheur | Usage | Données transmises à l’exécution | | --- | --- | --- | -| **Planification** | Travail périodique à une heure locale ou à intervalles réguliers. | `{ trigger: "schedule", firedAt: }` | +| **Planification** | Travail périodique à des heures locales ou à intervalles réguliers. | `{ trigger: "schedule", firedAt: }` | | **Webhook** | Réception d’une livraison d’un autre système. | `{ trigger: "webhook", payload: … }` | -| **Événement de la plateforme** | Un événement nommé dans l’organisation. | `{ trigger: "event", event: "…", payload: … }` | +| **Événement de la plateforme** | Quelque chose qui se passe dans l’organisation, comme une nouvelle tâche. | `{ trigger: "event", event: "…", payload: … }` | + +Chaque type peut aussi ajouter une [entrée fixe](#entree-fixe) : des valeurs que chaque exécution reçoit en plus de ces champs, par exemple le dépôt que lit un tri planifié. Une automatisation possède un seul déclencheur configuré à la fois. Changer son type remplace la liaison précédente. Remplacer un webhook révoque immédiatement son URL ; en recréer un plus tard ne restitue pas ces identifiants. Un client API ou MCP peut aussi démarrer sans déclencheur configuré. Sa clé API et ses droits sur le projet autorisent l’appel, et il fournit directement les données du workflow. Consulte la [référence API](/fr/develop/api-reference). -## Définir un horaire +## Définir une planification -Ouvre l’automatisation, puis son onglet **Général**. Sans liaison, la section **Déclencheur** indique que l’automatisation ne s’exécute que lancée à la main ou via l’API ; choisis **Ajouter un déclencheur**, puis **Planification** sous **Type de déclencheur**. Un nouveau déclencheur n’est pas **Actif** au départ — laisse-le désactivé tant que le workflow ne doit pas démarrer seul. +Ouvre l’automatisation, puis son onglet **Général**. Sans liaison, la section **Déclencheur** indique que l’automatisation ne s’exécute que lancée à la main ou via l’API. Choisis **Ajouter un déclencheur**. Un nouveau déclencheur est une **Planification** qui s’exécute chaque jour à 09:00 dans ton fuseau horaire, avec **Actif** désactivé. Laisse-le ainsi tant que le workflow ne doit pas encore démarrer seul. + + + + + +Laisse **Format de la planification** sur **Répétition** et ouvre **Planification**. Les choix rapides sont **Toutes les 15 minutes**, **Toutes les heures**, ainsi que des exécutions quotidiennes, en semaine, hebdomadaires et mensuelles à une heure donnée. Les choix hebdomadaire et mensuel reprennent le jour de la semaine et le jour du mois d’aujourd’hui, et chaque choix avec une heure garde l’heure la plus tôt de la planification. Choisir une option ferme la fenêtre et la reporte dans le formulaire. Sous les choix rapides et les vues personnalisées, la fenêtre liste les trois prochaines exécutions de la planification que tu composes. + + + + + +Choisis **Horaires personnalisés** pour démarrer à des heures précises : sélectionne **Jour**, **Semaine**, **Mois** ou **Année**, l’intervalle (par exemple toutes les 2 semaines), les jours de la semaine ou le jour, puis jusqu’à 12 horaires sous **À**. **Ajouter un horaire** ajoute un horaire une heure après le dernier. Un horaire déjà présent dans la liste ne s’exécute qu’une fois, et l’enregistrement trie les horaires. + +Choisis **Intervalle personnalisé** pour démarrer toutes les quelques minutes ou heures : jusqu’à toutes les 30 minutes, par pas qui divisent une heure, ou jusqu’à toutes les 12 heures, par pas qui divisent une journée, à un nombre donné de minutes après l’heure pile. Garde les jours de la semaine où elle doit s’exécuter et, avec **Seulement entre**, limite-la aux heures comprises entre deux horaires. Sous les heures, le sélecteur indique la première et la dernière exécution de la journée. + +**Enregistrer**, Entrée ou Ctrl+Entrée (Cmd+Entrée sur Mac) applique la planification personnalisée ; **Annuler** ou Échap l’abandonne. + + + + + +Les heures de la planification s’entendent dans le fuseau choisi sous **Fuseau horaire**. Par défaut, c’est le tien ; cherche un autre fuseau IANA comme `Europe/Zurich` quand le travail suit les horaires d’un autre bureau. - + -Renseigne **Cron** et le **Fuseau horaire**. Les cinq champs représentent minute, heure, jour du mois, mois et jour de la semaine. Choisis un fuseau IANA comme `Europe/Zurich` pour suivre les heures locales. Sans indication, UTC s’applique. +**Prochaines exécutions** liste les cinq prochains démarrages dans le fuseau de la planification et, si ton propre fuseau est différent, le même moment dans ton fuseau horaire. Tant que des modifications ne sont pas enregistrées, le titre devient **Prochaines exécutions (non enregistrées)**. Tant que le déclencheur est désactivé ou qu’aucune version n’est en service, il devient **S’exécuterait à**, et la ligne en dessous indique ce qui manque. - + -Examine la prochaine occurrence affichée pour l’expression valide : c’est la minute à laquelle la planification démarrera vraiment, changement d’heure compris. Clique ensuite sur **Enregistrer** à côté des onglets. Vérifie que la version en service accepte les données de planification du tableau. Active le déclencheur prêt à fonctionner avec **Actif** et enregistre à nouveau. Retrouve le prochain démarrage sous **Exécutions**. +Clique sur **Enregistrer** à côté des onglets. Sous [Cette exécution reçoit](#verifier-ce-que-recoit-une-execution), vérifie que la version en service accepte l’entrée. Quand tout est prêt, active **Actif** et enregistre à nouveau. La prochaine exécution lancée apparaît sous **Exécutions**, et la section **Déclencheur** l’affiche comme dernière exécution. +**Intervalle personnalisé** compte à partir de minuit, heure locale : toutes les 2 heures, 15 minutes après l’heure pile, démarre donc à 00:15, 02:15 et ainsi de suite. **Seulement entre** inclut le début et s’arrête avant la fin : de 08:00 à 18:00, toutes les 15 minutes, la dernière exécution part à 17:45. Une fin antérieure au début s’exécute de nuit, et les heures après minuit appartiennent au jour où la plage a commencé : le vendredi de 22:00 à 06:00 se prolonge jusqu’au samedi matin, mais ne s’exécute pas le samedi soir. Une fin à 00:00 s’exécute jusqu’à minuit, et un début égal à la fin couvre toute la journée. Si aucune exécution ne tombe entre les deux horaires, par exemple toutes les 6 heures de 08:00 à 11:00, le sélecteur le signale et **Enregistrer** attend que tu élargisses la plage ou raccourcisses l’intervalle. + +### Lors d’un changement d’heure + +Une planification garde ses heures locales lors des passages à l’heure d’été et à l’heure d’hiver : + +- Une heure sautée ce jour-là démarre une fois, décalée de la durée du saut. Dans `Europe/Zurich`, une exécution prévue à 02:30 démarre à 03:30 le 29 mars 2026. +- Une heure qui revient deux fois démarre une fois, à sa première occurrence. +- **Toutes les N minutes** et **Toutes les N heures** gardent en revanche leur intervalle réel : elles s’exécutent deux fois pendant l’heure qui se répète et pas du tout pendant l’heure sautée. + +**Prochaines exécutions** marque d’un **Changement d’heure** le démarrage concerné et explique ce qui se passe. + +### Quand des exécutions sont manquées + +**Exécutions manquées** décide de ce que fait une planification des horaires prévus pendant que Tale était indisponible, par exemple pendant une mise à jour : + +| Choix | Ce qui se passe au retour de Tale | +| --- | --- | +| **Lancer la dernière au retour de Tale** (par défaut) | Le dernier horaire manqué s’exécute une fois, quel que soit le retard. Les horaires manqués plus anciens sont comptés, pas rattrapés. | +| **Les ignorer** | Une exécution en retard de plus de 10 minutes ne démarre pas ; elle est comptée comme manquée. | + +Par exemple, une planification quotidienne à 09:00 manque son démarrage pendant que Tale est arrêté de 08:30 à 10:15. Avec le réglage par défaut, une exécution démarre à 10:15 pour 09:00 ; avec **Les ignorer**, rien ne démarre, et la section **Déclencheur** indique 1 exécution manquée. Dès que des exécutions comptent comme manquées, la section indique combien et entre quels horaires, en comptant jusqu’à 1 000. Avec le réglage par défaut, ce sont les horaires antérieurs à celle qui a démarré, comme les démarrages précédents d’une planification toutes les 15 minutes pendant la même interruption. Le temps pendant lequel la planification était désactivée ou en pause, et le temps avant son enregistrement, ne comptent jamais comme manqués. + +## Utiliser une expression cron + +Passe **Format de la planification** sur **Cron (avancé)** si tu as déjà une expression cron ou s’il te faut un motif que **Répétition** ne propose pas. Les cinq champs représentent minute, heure, jour du mois, mois et jour de la semaine. + ```text */15 * * * * toutes les quinze minutes 0 9 * * 1-5 à 09:00 du lundi au vendredi @@ -54,15 +105,17 @@ Examine la prochaine occurrence affichée pour l’expression valide : c’est 30 8 1 * 1 à 08:30 le premier du mois et chaque lundi ``` -Les champs acceptent `*`, nombres, plages, pas et listes séparées par des virgules. 0 et 7 désignent le dimanche. Si le jour du mois et celui de la semaine sont tous deux limités, l’un ou l’autre suffit. Le dernier exemple tourne donc chaque lundi ainsi que le premier de chaque mois. +Les champs acceptent `*`, nombres, plages, pas et listes séparées par des virgules. 0 et 7 désignent le dimanche. Si le jour du mois et celui de la semaine sont tous deux limités, l’un ou l’autre suffit ; le dernier exemple tourne donc chaque lundi ainsi que le premier de chaque mois. Quand **Répétition** peut dire la même chose, la ligne sous le champ la reformule, par exemple « Signifie : Tous les jours ouvrés à 09:00 ». Une expression illisible, ou qui désigne une date qui n’arrive jamais comme `0 0 30 2 *`, affiche la raison sous le champ ; **Prochaines exécutions** reste vide et **Enregistrer** attend que tu la corriges. -L’heure locale suit les changements saisonniers du fuseau. Un horaire zurichois à 09:00 reste à 09:00 sur place. La résolution est d’une minute. Les occurrences manquées pendant une panne ne sont pas rejouées ; le travail reprend à la suivante. Une date de calendrier impossible est refusée à l’enregistrement. +Une expression cron suit les mêmes règles de changement d’heure : si sa minute et son heure sont des nombres, elle désigne des heures précises ; si sa minute ou son heure commence par `*`, elle garde son intervalle réel. + +Passer de **Répétition** à **Cron (avancé)**, et inversement, convertit la planification quand l’une dit exactement la même chose que l’autre. Sinon, par exemple pour une planification à 09:00 et 17:30, le champ le signale, et les deux saisies restent dans le formulaire jusqu’à l’enregistrement. Une planification enregistrée auparavant comme expression cron s’ouvre en **Répétition** quand une répétition dit exactement la même chose, avec une note qui rappelle l’expression enregistrée. L’enregistrer sans modification conserve l’expression cron ; une planification modifiée est enregistrée comme répétition. Une expression cron que **Répétition** ne peut pas exprimer s’ouvre en **Cron (avancé)**. ## Recevoir un webhook -Choisis **Webhook**, puis enregistre pour générer les identifiants. Copie l’URL complète dès son apparition : le jeton n’est montré qu’une fois et seul son hash est conservé. La section fournit une URL d’organisation et un modèle d’URL de projet. Utilise cette dernière pour un projet actif auquel l’automatisation est liée. Une automatisation liée à des projets ne peut pas utiliser l’URL réservée aux exécutions sans projet. +Choisis **Webhook**, puis enregistre pour créer l’URL. **URL du webhook — copie-la maintenant** ne l’affiche qu’une fois : une URL par projet dans lequel l’automatisation est installée, ou une pour l’organisation si elle n’est installée dans aucun. Copie chaque URL dont tu as besoin ; le token à la fin n’est conservé que sous forme de hash. Ensuite, la section liste les adresses avec le token masqué, sous **URL des projets** ou, pour l’organisation, sous **Point de terminaison du webhook**. **Renouveler le token** crée une nouvelle URL. Une automatisation installée dans des projets ne s’exécute que via une URL de projet. -Envoie une petite charge utile à l’URL. Le JSON devient `payload` à l’intérieur de l’entrée, et non directement ses champs de premier niveau. Les autres contenus passent comme texte. La limite est de 256 KiB ; téléverse les grands documents séparément. Une requête acceptée renvoie l’identifiant de l’exécution sans attendre sa fin. +**Envoyer une requête de test** contient une commande `curl` prête à l’emploi. Juste après la création de l’URL, la commande la contient ; ensuite, elle la lit dans `TALE_WEBHOOK_URL`, la variable où le système émetteur doit la garder. Elle envoie un petit corps JSON avec un `Idempotency-Key`. Le JSON devient `payload` à l’intérieur de l’entrée, et non directement ses champs de premier niveau ; les autres contenus passent comme texte. La limite est de 256 KiB ; téléverse les grands documents séparément. Une requête acceptée renvoie l’identifiant de l’exécution sans attendre sa fin. Ainsi, le corps `{ "invoiceId": "inv-1" }` parvient au workflow sous cette forme : @@ -75,17 +128,80 @@ Ainsi, le corps `{ "invoiceId": "inv-1" }` parvient au workflow sous cette forme Fournis un identifiant de livraison, par exemple `Idempotency-Key` ou un en-tête pris en charge de l’expéditeur. Le même identifiant renvoie l’exécution initiale pendant 24 heures. Sans identifiant, un corps identique envoyé à la même URL dans les deux minutes est considéré comme un doublon. Utilise des identifiants distincts si des contenus identiques correspondent à des travaux séparés. [Webhooks](/fr/develop/webhooks) détaille en-têtes, chemins de projet, erreurs et réponses. +**Livraisons récentes** liste les dix dernières exécutions lancées par le webhook, les plus récentes d’abord, chacune avec son statut et **Voir l’exécution**. Tant que Tale se souvient d’une livraison, la ligne indique aussi comment il reconnaît une répétition : **ID issu de** l’en-tête lu, ou **Sans ID de livraison**. Une requête refusée par Tale n’a lancé aucune exécution et n’apparaît pas ; la réponse reçue par l’expéditeur en donne la raison. + -L’URL autorise le démarrage. Protège-la comme un identifiant et ne la transmets qu’au système expéditeur. **Renouveler le token** produit un remplacement et invalide l’ancienne URL. Retirer ou remplacer le déclencheur la révoque également. Mets l’expéditeur à jour après un renouvellement. +L’URL autorise le démarrage. Protège-la comme un identifiant et ne la transmets qu’au système expéditeur. **Renouveler le token** demande une confirmation, produit ensuite un remplacement et invalide l’ancienne URL. Retirer ou remplacer le déclencheur la révoque également. Mets l’expéditeur à jour après un renouvellement. ## Réagir à un événement de la plateforme -Choisis **Événement de la plateforme**, puis le **Nom de l’événement**. Enregistre et active le déclencheur quand il est prêt. Le schéma du workflow doit accepter l’enveloppe `trigger`, `event` et `payload` du tableau. Les événements produits par une exécution d’automatisation ne déclenchent pas d’autres départs : le workflow ne peut ainsi se relancer sans fin par ses propres changements. +Choisis **Événement de la plateforme**, puis l’événement sous **Nom de l’événement**. La liste regroupe les événements par sujet et affiche pour chacun son nom, son ID et le moment où il se produit ; tape une partie de l’un d’eux pour chercher. Enregistre, puis active **Actif** quand tout est prêt. + +| Événement | ID | Déclenché quand | `payload` contient | +| --- | --- | --- | --- | +| **Tâche créée** | `task.created` | Une tâche est créée sur un tableau, via l’API ou par un import. | `taskId`, `projectId`, `actorType`, `actorId` | +| **Statut de tâche modifié** | `task.status_changed` | Une personne déplace une tâche vers un autre statut. Les déplacements faits par un agent ne comptent pas. | `taskId`, `projectId`, `fromStatus`, `toStatus`, `actorType`, `actorId` | +| **Commentaire ajouté** | `comment.created` | Un commentaire est publié sur une tâche. | `comment` avec `body`, `taskId`, `projectId` et `mentions` | +| **Mention dans un commentaire** | `comment.mentioned` | Un commentaire de tâche mentionne quelqu’un avec @. | `comment`, `taskId`, `mentions`, `actorType`, `actorId` | +| **Conversation ouverte** | `conversation.created` | Une conversation s’ouvre dans la boîte de réception : un e-mail arrive ou une conversation externe est reflétée. | `conversationId`, `channel` | +| **Message reçu** | `conversation.message_received` | Un message arrive dans une conversation existante. | `conversationId`, `messageId`, `direction` | +| **Contact créé** | `contact.created` | Un contact est ajouté via l’API, l’application ou un import. | `contactId` | +| **Contact modifié** | `contact.updated` | Les informations d’un contact changent. | `contactId` | +| **Contact supprimé** | `contact.deleted` | Un contact est supprimé. | `contactId` | +| **Projet créé** | `project.created` | Un projet est créé. | `projectId`, `name`, `actorId` | -Un workflow qui exige des champs de premier niveau comme `owner` et `repo` n’accepte pas automatiquement les métadonnées d’un horaire ou le corps enveloppé d’un webhook. Adapte son schéma et ses références, ou utilise un démarrage API qui fournit ces champs. Les réglages du déclencheur ne permettent pas de définir des données d’entrée arbitraires enregistrées. +La charge utile contient des identifiants, pas des enregistrements complets : si le workflow a besoin de plus, il lit la tâche, le commentaire ou le contact avec une étape. Une nouvelle tâche parvient par exemple au workflow sous cette forme : + +```json +{ + "trigger": "event", + "event": "task.created", + "payload": { + "taskId": "5e2f9d34-8a71-4c6b-b0d2-91a7e3c4f815", + "projectId": "0b9c6a52-5d1e-4f0a-9c3e-2f6d8a1b7e40", + "actorType": "user", + "actorId": "c41d7e88-2b3a-4f95-8e60-7d5a9b1c0f23" + } +} +``` + +Les événements des tâches, des commentaires et des projets appartiennent à un projet ; ceux des contacts et des conversations, non. Un événement d’un projet lance les automatisations installées dans ce projet et celles qui ne sont installées dans aucun projet, et leurs exécutions appartiennent à ce projet. Une automatisation installée uniquement dans d’autres projets n’y réagit pas. Un événement sans projet lance une automatisation installée dans un seul projet, dans ce projet. Si ce projet est archivé, ou si les entrées de l’automatisation refusent l’événement, aucune exécution ne démarre et le déclencheur en indique la raison. Les autres automatisations qui écoutent cet événement démarrent quand même. Sous **Nom de l’événement**, le champ indique quels événements lancent cette automatisation. + +Un événement produit par l’exécution d’une automatisation ne relance jamais cette même automatisation, et une exécution lancée par un événement ne lance pas d’autres automatisations : un workflow ne peut ainsi se relancer sans fin par ses propres changements, ni seul ni avec un autre. Cela vaut pour tout ce que fait l’exécution elle-même : ses étapes, ses appels de connecteurs et les outils de son propre agent. Le travail qu’une étape confie à un agent de projet appartient à cet agent : un événement qu’il produit peut donc relancer l’automatisation. Veille à ce que ce travail ne produise pas l’événement qu’attend l’automatisation. + +## Vérifier ce que reçoit une exécution + +**Cette exécution reçoit** montre l’entrée de la prochaine exécution telle que le déclencheur la construit : ses propres champs, son entrée fixe et, pour un webhook ou un événement, un exemple de `payload`. Pour une planification, `firedAt` est l’heure prévue, en millisecondes depuis 1970 (UTC). **Copier l’entrée** te permet de la reprendre dans un essai. + +En dessous, la section compare l’entrée avec les entrées de la version en service. Elle indique par exemple **La version 3 accepte cette entrée**, ou avertit **La version 3 n’accepte pas cette entrée** et propose une correction : ajouter les champs manquants à l’entrée fixe, ou modifier les entrées dans l’éditeur. Le corps d’un webhook n’est connu qu’à l’arrivée d’une requête ; il ne compte donc jamais contre la version. La même vérification a lieu quand tu enregistres un déclencheur et quand tu mets une version en service ; l’enregistrement passe quand même et nomme le problème. + +### Entrée fixe + +Une entrée fixe ajoute les mêmes valeurs à chaque exécution lancée par le déclencheur, comme le `owner` et le `repo` dont a besoin un tri GitHub planifié. Ouvre **Ajouter une entrée fixe** et saisis un objet JSON d’au plus 16 KiB. Les champs propres au déclencheur (`trigger`, `firedAt`, `event` et `payload`) priment sur elle ; elle ne peut donc pas les contenir. Ce sont de simples données : un modèle comme `{{ input.owner }}` arrive sous forme de texte, et l’enregistrement le signale. + +Quand la version en service exige des champs que le déclencheur n’envoie pas, la section est déjà ouverte, et **Ajouter les 2 champs manquants** (ou autant qu’il en manque) écrit pour chacun un espace réservé du bon type et place le curseur dans le premier. Remplace les espaces réservés et enregistre. Une exécution planifiée reçoit alors : + +```json +{ + "owner": "acme", + "repo": "website", + "trigger": "schedule", + "firedAt": 1791529200000 +} +``` + +### Exécuter maintenant + +**Exécuter maintenant** lance une fois la version en service, en réel, avec l’entrée qu’envoie le déclencheur enregistré, comme le ferait le déclencheur. Pour une planification, il affiche cette entrée et demande de confirmer avec **Lancer l’exécution**. Pour un webhook ou un événement, il ouvre la boîte de dialogue d’exécution avec l’exemple à modifier. Il attend qu’une version soit en service et que tes modifications du déclencheur soient enregistrées. Le résultat s’affiche sous le bouton : **Exécution lancée.** avec **Voir l’exécution**, ou la raison pour laquelle rien n’a démarré. La planification et la dernière exécution du déclencheur ne changent pas. + +## Activer le déclencheur après la mise en service + +Un nouveau déclencheur démarre désactivé, tout comme celui d’un paquet fourni. Quand tu mets une version en service, dans l’éditeur ou en téléversant un paquet, et que son déclencheur est désactivé, un avis indique **Son déclencheur est désactivé**. **Activer le déclencheur** active le déclencheur enregistré tel quel, et l’avis indique alors **Le déclencheur est activé.** + +Quand la version en service refuserait ce qu’envoie le déclencheur, ou qu’un webhook n’a pas encore d’URL, l’avis propose plutôt **Vérifier le déclencheur**. Cela ouvre la section **Déclencheur** de l’onglet **Général**, où tu ajoutes d’abord l’entrée fixe ou crées l’URL. Les paquets GitHub fournis en sont un exemple : leurs planifications ont besoin d’un dépôt, comme l’explique [Automatisations livrées](/fr/platform/automations/builtin). ## Démarrer un agent de projet selon une planification @@ -101,15 +217,15 @@ nodes: feedback: 'Scheduled occurrence {{ input.firedAt }}.' ``` -L’étape renvoie l’exécution qu’elle a démarrée, et la chronologie de la tâche affiche cette exécution comme **automatisation**, avec un lien vers l’exécution de l’automatisation. Quand elle ne démarre rien, l’étape réussit tout de même et en donne la raison, si bien que l’occurrence est consignée au lieu d’être mise en file d’attente : +L’étape renvoie l’exécution qu’elle a démarrée, et la chronologie de la tâche affiche cette exécution comme **automatisation**, avec un lien vers l’exécution de l’automatisation. Un agent qui travaille sur d’autres tâches est tout de même lancé : son exécution travaille dans un [worker](/fr/platform/projects/project-agents#run-one-agent-on-several-tasks) distinct, et quand tous les workers d’agent de ton organisation sont occupés, elle en attend un et démarre d’elle-même. Quand elle ne démarre rien, l’étape réussit tout de même et en donne la raison, si bien que l’occurrence est consignée au lieu d’être mise en file d’attente : | Réponse | Signification | | --- | --- | -| `started: true` | L’exécution de l’agent a démarré ; `runId` l’identifie. | +| `started: true` | L’exécution de l’agent a démarré ; `runId` l’identifie. Avec `waitingReason`, l’exécution attend de la place avant de travailler : `org_limit` quand tous les workers d’agent de ton organisation sont occupés, `host` quand l’hôte des sandboxes est plein, `destroy_pending` quand l’espace de travail qu’elle utiliserait est en cours de suppression, `exec_limit` quand sa sandbox termine encore un processus précédent. Elle démarre d’elle-même dès que la place se libère. | | `already_running` | L’exécution précédente de la tâche travaille encore et prend le travail en charge. Rien de nouveau ne démarre, et l’occurrence n’attend pas derrière elle. | | `in_review` | Avec `moveToInProgress: false`, la carte attend son relecteur enregistré, une personne ou un agent. Rien n’est assigné ni démarré, et la revue conserve ce destinataire. | | `closed` | Avec `moveToInProgress: false`, la carte est **Terminé** ou **Annulé** (`taskStatus`). Rien n’est assigné ni démarré. | -| `agent_busy` | L’agent travaille sur une autre tâche (`busyTaskId`). Un agent ne traite qu’une tâche à la fois dans son espace de travail. | +| `agent_busy` | N’est plus renvoyé : un agent qui travaille sur une autre tâche est lancé dans un worker distinct, ou en attend un. D’anciennes exécutions d’une automatisation peuvent encore l’afficher. | | `blocked` | Une tâche dont celle-ci dépend est encore ouverte (`blockedBy`). | | `paused` | La tâche a déjà reçu trois démarrages par des automatisations et des agents au cours de la dernière heure, les relances automatiques ordinaires comprises. Une attente du courtier immédiatement après un échec HTTP 429 du même agent n’ajoute aucun démarrage ; les attentes consécutives restent comptées. `retryAfter` indique quand le compteur horaire autorise un autre démarrage ; les autres vérifications restent applicables. | @@ -119,6 +235,10 @@ Une exécution lancée par une planification n’agit pour le compte de personne Une nouvelle tentative automatique est possible si le type d’échec le permet, tant que la tâche garde son statut et son responsable d’origine et qu’aucune nouvelle décision de statut, d’affectation, d’archivage ou de revue n’est intervenue. Modifier une valeur puis la rétablir met aussi fin à cette tentative ; les commentaires ne l’arrêtent pas. Les limites de tentatives, les autorisations de la planification et les vérifications de l’espace de travail restent applicables. Une occurrence ultérieure peut lancer un nouveau travail lorsque les conditions sont réunies. +### Réveiller la planification quand un agent libère sa place + +Une planification qui exécute le rôle permanent d’un projet, comme un responsable qui distribue le travail, peut aussi se déclencher dès qu’un agent de son projet termine et que l’un de ses workers habituels se libère, au lieu d’attendre sa prochaine minute cron. Active-le avec `wakeOnSlotFreed: true` dans la configuration gérée de la planification, appliquée avec la CLI Tale ; une seule planification activée par projet peut l’avoir — une deuxième est refusée, tout comme l’installation de son automatisation dans un projet qu’une autre planification réveille déjà — et l’application n’offre aucun interrupteur pour cela. Chaque réveil est une occurrence ordinaire avec l’entrée habituelle `{ trigger: "schedule", firedAt }`, donc les réponses ci-dessus s’appliquent toujours. Plusieurs agents qui terminent pendant qu’un réveil est en attente n’en déclenchent qu’un seul. Un réveil attend tant que la propre carte du responsable a une exécution active ou une nouvelle tentative automatique prévue, que la carte refuserait le démarrage ou qu’elle n’est plus assignée à l’agent, jusqu’à `retryAfter` quand la tâche a pris trois démarrages dans l’heure, et, après une occurrence qui n’a rien servi, une minute qui double jusqu’à une heure, sans limite de tentatives. Les autres tâches du même agent ne bloquent pas le réveil ; la nouvelle exécution du responsable reçoit son propre worker ou attend la capacité nécessaire, comme d’habitude. Il ne compte comme servi qu’une fois que l’exécution de l’agent qu’il a démarrée s’est lancée et terminée. Tant que la planification est en pause après des échecs, désactivée ou sans `wakeOnSlotFreed`, le réveil attend et se déclenche une fois quand la planification est de nouveau enregistrée. + ### Importer chaque issue selon une planification Un import d’issues lit au plus un lot par exécution, jusqu’à 500 issues, et indique où commence le lot suivant. Une personne le poursuit avec **Poursuivre l'import** ; une planification conserve plutôt la position entre ses occurrences, si bien que chaque occurrence importe un lot à partir de l’endroit où la précédente s’est arrêtée, jusqu’à ce que toutes les issues ouvertes aient été lues, et l’occurrence suivante commence la passe d’après. Lis la position avec `task.get_import_cursor`, transmets-la à l’import et enregistre son `nextCursor` avec `task.save_import_cursor` : @@ -154,24 +274,32 @@ nodes: ## Comprendre l’absence de démarrage -Vérifie d’abord **Actif**, la version en service et le dernier déclenchement. Lis ensuite le motif éventuellement enregistré : +Le haut de la section **Déclencheur** indique où en est le déclencheur : l’heure de la dernière exécution qu’il a lancée, avec son statut et **Voir l’exécution**, ou **N’a encore lancé aucune exécution.** Quand le déclencheur est arrivé à échéance, ou qu’un événement est arrivé, sans que rien ne démarre, un avis en dessous en donne la raison, la correction et le chemin pour y arriver : -| Motif ou symptôme | Vérification | -| --- | --- | -| `not_deployed` | Mets une version testée en service. Un brouillon enregistré ne suffit pas. | -| `start_refused` | Compare le schéma de la version active à l’enveloppe du déclencheur et corrige l’erreur de validation ou de démarrage indiquée. | -| `unusable_cron` | Corrige l’expression ou le fuseau, puis enregistre. Les autres horaires continuent pendant que celui-ci est ignoré. | -| `paused_after_failures` | La planification s’est désactivée d’elle-même après des échecs répétés. Voir [Quand une planification se met en pause](#quand-une-planification-se-met-en-pause). | -| Identifiant du webhook refusé | Vérifie l’URL actuelle et l’activation. Les jetons inconnus et désactivés reçoivent volontairement le même refus. | -| Exécution présente, mais inachevée | Ouvre les [journaux d’exécution](/fr/platform/automations/execution-logs). Le démarrage a réussi ; le problème se trouve dans le workflow. | +| Avis | Ce qui s’est passé | Que faire | +| --- | --- | --- | +| **Ignorée : aucune version déployée** | Le déclencheur est arrivé à échéance, mais il n’existe que des brouillons. | **Ouvrir l’éditeur** et mettre en service une version testée. | +| **Ignorée : l’entrée de l’exécution a été refusée** | La version en service a refusé ce qu’envoie le déclencheur. | Ajouter les champs manquants à l’[entrée fixe](#entree-fixe), ou modifier les entrées dans l’éditeur. | +| **Ignorée : le projet ne peut pas lancer d’exécutions** | Son projet est archivé, n’existe plus ou n’autorise plus l’automatisation. | **Modifier les projets** sous **Projets**, plus bas. | +| **Ignorée : l’exécution n’a pas pu démarrer** | Le démarrage a été refusé pour une autre raison. | Ouvrir **Détails techniques** pour lire le code et le message. | +| **Ignorée : la planification est illisible** | La planification ou son fuseau horaire était illisible. Rien ne démarre avant la correction. | **Modifier la planification** et enregistrer. | +| **3 exécutions manquées**, par exemple | Des exécutions étaient prévues pendant que Tale était indisponible. | Rien ; [Exécutions manquées](#quand-des-executions-sont-manquees) a décidé de ce qui a démarré. | +| **En pause après des échecs répétés** | La planification s’est désactivée d’elle-même. | Voir [Quand une planification se met en pause](#quand-une-planification-se-met-en-pause). | + +**Détails techniques**, replié au départ, contient les faits bruts, en anglais : le code, la version qui a refusé le démarrage, son message et chaque problème avec son champ. Quand des exécutions précédentes ont aussi été manquées, l’avis indique combien. L’API expose les mêmes faits dans `lastSkipReason` et `lastSkipDetail` ; consulte la [référence API](/fr/develop/api-reference#verifier-le-declencheur-et-le-suspendre). + +Certains démarrages manqués n’affichent aucun avis : + +- Une requête de webhook refusée par Tale n’a lancé aucune exécution et n’a rien changé sur le déclencheur. Vérifie la réponse reçue par l’expéditeur ; [Webhooks](/fr/develop/webhooks) liste les réponses possibles. Une URL inconnue ou désactivée reçoit volontairement le même refus. +- Une exécution présente mais inachevée a bien démarré. Ouvre-la depuis **Exécutions** ; les [journaux d’exécution](/fr/platform/automations/execution-logs) expliquent ce qui s’y est passé. -La date du dernier déclenchement avance lorsqu’une exécution démarre réellement. Un déclencheur arrivé à échéance mais incapable de démarrer enregistre plutôt un départ ignoré. Tu peux ainsi le distinguer d’un workflow démarré puis tombé en échec. +La dernière exécution n’avance que lorsqu’une exécution démarre réellement. Un déclencheur arrivé à échéance mais incapable d’en lancer une enregistre plutôt un démarrage ignoré. Tu peux ainsi distinguer un déclencheur défaillant d’un workflow démarré puis tombé en échec. ## Quand une planification se met en pause Une planification dont les exécutions échouent de la même façon à chaque occurrence continuerait sinon d’échouer indéfiniment. Tale compte donc les exécutions lancées par un déclencheur qui échouent sur une erreur qu’une nouvelle tentative ne corrigera pas : le code de l’automatisation elle-même (`node_error`), un connector (`connector_error`), une réponse du modèle qui ne respecte pas son schéma (`llm_output_invalid`) ou le fournisseur de modèles de l’organisation (`auth_error`, `missing_api_key`, `credit_exhausted`, `model_not_found`). Une exécution réussie remet le compteur à zéro. Les autres échecs, comme une limite de débit ou un fournisseur injoignable, ne comptent pas et ne remettent pas non plus le compteur à zéro. Une planification qui s’est déjà mise en pause d’elle-même fait exception : elle garde le compteur qui a provoqué la pause, même si une exécution encore en cours à ce moment-là réussit ensuite, et seul l’enregistrement du déclencheur le remet à zéro. -Après cinq échecs de ce type d’affilée, la planification désactive **Actif** et enregistre `paused_after_failures`. La section **Déclencheur** affiche alors la pause, le code et l’heure du dernier échec, ainsi que **Voir l’exécution**, qui ouvre cette exécution. Tant que des exécutions échouent alors que la planification est encore active, la section indique combien ont échoué d’affilée. Les Propriétaires et Admins reçoivent une notification par la cloche, et aussi par e-mail si l’organisation dispose d’une boîte mail connectée ; le journal d’audit enregistre la pause. Ils peuvent désactiver ces avis avec **Alertes d'automatisation** dans **Paramètres > Notifications**. +Après cinq échecs de ce type d’affilée, la planification désactive **Actif** et enregistre `paused_after_failures`. La section **Déclencheur** affiche alors la pause, le code et l’heure du dernier échec, ainsi que **Voir l’exécution**, qui ouvre cette exécution. Tant que des exécutions échouent alors que la planification est encore active, la section indique combien ont échoué d’affilée. Les Propriétaires et Admins reçoivent une notification par la cloche, et aussi par e-mail si l’organisation dispose d’une boîte mail connectée ; le journal d’audit enregistre la pause. Ils peuvent désactiver ces avis avec **Alertes d'automatisation** dans **Paramètres > Notifications**. Ouvre l’exécution en échec pour lire l’erreur, puis corrige l’automatisation ou sa connexion. Active ensuite **Actif** et enregistre. Chaque enregistrement du déclencheur repart d’un compteur à zéro, qu’il réactive la planification ou la laisse désactivée, et marque les avis comme lus. diff --git a/docs/fr/platform/chat/basics.md b/docs/fr/platform/chat/basics.md index c987f9e661..60a957d00d 100644 --- a/docs/fr/platform/chat/basics.md +++ b/docs/fr/platform/chat/basics.md @@ -80,7 +80,7 @@ La boîte de dialogue de la tâche s’ouvre avec ta dernière demande comme des -La tâche apparaît ensuite au-dessus du champ de message du chat, avec ce qu’elle fait en ce moment : **L’agent travaille**, **En attente d’une place de sandbox**, **Nouvelle tentative…**, **Prête pour la revue** avec le nombre de fichiers livrés, ou **L’agent n’a pas pu la terminer**. **Ouvrir** te mène à la tâche. Tu reçois aussi une notification quand elle est prête pour la revue et quand l’agent ne peut pas terminer ; [Quand l’agent ne peut pas terminer](/fr/platform/projects/task-automation#quand-lagent-ne-peut-pas-terminer) explique la suite. +La tâche apparaît ensuite au-dessus du champ de message du chat, avec ce qu’elle fait en ce moment : **L’agent travaille**, **En attente d’un worker** (ou un autre état qui dit ce que l’exécution attend), **Nouvelle tentative…**, **Prête pour la revue** avec le nombre de fichiers livrés, ou **L’agent n’a pas pu la terminer**. **Ouvrir** te mène à la tâche. Tu reçois aussi une notification quand elle est prête pour la revue et quand l’agent ne peut pas terminer ; [Quand l’agent ne peut pas terminer](/fr/platform/projects/task-automation#quand-lagent-ne-peut-pas-terminer) explique la suite. @@ -98,6 +98,8 @@ Seuls les fichiers de ta propre conversation suivent. Une tâche n’accepte que La barre sous la réponse permet de copier le texte, donner un avis, consulter les détails ou créer une branche à cet endroit. Une branche permet d’explorer une autre direction tout en conservant l’échange précédent. +Tes propres messages sont à droite. D’un long message, tu vois le début ; **Lire la suite** ouvre le reste sur place et **Afficher moins** le replie. Survole un de tes messages ou place le focus clavier dedans pour voir quand tu l’as envoyé et utiliser **Modifier le message**, qui change le texte dans une nouvelle version de la conversation ; sur un écran tactile, l’heure et ce bouton restent toujours affichés. Sous un message que tu as modifié, ou dont tu as redemandé la réponse avec **Réessayer**, **Branche précédente** et **Branche suivante** passent d’une version à l’autre, et le nombre entre les deux, par exemple 2/3, indique celle qui est affichée. + Retrouve les anciens chats dans [Accueil](/fr/platform#home) ; la vue **Chats**, au-dessus de la liste, n’affiche que les chats. Épingle ceux qui servent souvent, donne-leur un titre reconnaissable ou déplace-les dans un projet lorsque le sujet devient récurrent : fais-les glisser sur le projet ou choisis **Déplacer vers un projet…** dans leur menu. [Chats partagés](/fr/platform/chat/shared-threads) explique comment publier un instantané en lecture seule pour des collègues. Une conversation très longue peut dépasser la fenêtre de contexte du modèle. Tale affiche un avis lorsque des messages anciens sont omis. Répète une contrainte importante ou démarre un nouveau chat avec les sources utiles, plutôt que de supposer que l’assistant voit encore tout l’historique. diff --git a/docs/fr/platform/knowledge/crawling.md b/docs/fr/platform/knowledge/crawling.md index 08b4130c5d..b09ebdf07b 100644 --- a/docs/fr/platform/knowledge/crawling.md +++ b/docs/fr/platform/knowledge/crawling.md @@ -94,6 +94,7 @@ Vérifie d’abord l’adresse, le type de source et la date du dernier scan. Ou | Échec du rendu ou de l’extraction | Vérifie que la page publique se charge et que le document d’origine s’ouvre. Répare ou exporte à nouveau une source endommagée. | | L’assistant répond que la recherche dans les pages web n’est pas configurée | L’organisation n’a pas de modèle d’embedding qui fonctionne. Un administrateur le définit dans **Paramètres > Résidence des données** ; Tale relance ensuite un scan des sources concernées. | | **Erreur** avec « Le modèle d'embedding n'a pas pu traiter les pages. » | Le fournisseur d’embedding a refusé la requête ou n’a pas pu y répondre : identifiants rejetés, solde épuisé, limite de débit maintenue malgré toutes les tentatives, ou panne. Les détails de la source précisent lequel, avec la réponse du fournisseur en dessous. Un administrateur corrige le modèle dans **Paramètres > Résidence des données** ou ses identifiants dans **Paramètres > Fournisseurs IA** ; l’enregistrement relance le scan des sources concernées. Après une panne chez le fournisseur, choisis **Analyser maintenant** dès qu’il est de nouveau disponible. | +| Les détails de la source indiquent qu’une limite d’utilisation a arrêté la dernière analyse | L’embedding des pages compte dans les limites de la personne qui a demandé l’analyse : qui a ajouté la source ou choisi **Analyser maintenant**, ou l’organisation pour une analyse planifiée. Les pages sont enregistrées, et la recherche propre à la source les lit ; la recherche par le sens ignore les pages traitées après l’atteinte de la limite jusqu’à ce que l’analyse reprenne d’elle-même, dans l’heure qui suit la réinitialisation de la limite ou son relèvement par un administrateur. | | **Erreur** avec « L'analyse n'a pas eu lieu. » | Le navigateur du crawler n’a pas pu démarrer, aucune page n’a donc été rendue ; son rapport se trouve sous **Détails techniques** dans les détails de la source. L’adresse n’est pas en cause : demande à ton exploitant de vérifier le service de sandbox, puis choisis **Analyser maintenant**. | Une récupération réussie efface l’erreur précédente. Si une actualisation échoue, la copie déjà indexée peut rester disponible : **Actif** et le nombre de pages indexées ne prouvent pas que chaque page est à jour. Compare les fragments enregistrés et la date du passage avec l’original avant de t’appuyer sur une modification récente. diff --git a/docs/fr/platform/knowledge/documents.md b/docs/fr/platform/knowledge/documents.md index 8468cfda7e..122835a19b 100644 --- a/docs/fr/platform/knowledge/documents.md +++ b/docs/fr/platform/knowledge/documents.md @@ -42,6 +42,7 @@ Réindexer plusieurs fois un format non pris en charge ne le rend pas interrogea | **Indexation** | Le texte est préparé pour la recherche. Attends avant de tester la source. | | **Indexé** | L’indexation est terminée. Pose une question précise et ouvre sa citation. | | **Réindexation nécessaire** | L’index est périmé. Utilise **Relancer l'indexation** à côté du statut. | +| **En attente d'une limite d'utilisation** | Une limite d’utilisation qui s’applique à la personne pour qui le document est indexé a été atteinte. L’indexation reprend d’elle-même dans l’heure qui suit la réinitialisation ou le relèvement de la limite ; rien n’est à corriger dans le fichier. | | **Échoué** | Lis l’erreur, résous sa cause, puis réessaie. | | **Non pris en charge** | Ce contenu ne peut pas être indexé : format incompatible, texte vide ou illisible, ou PDF endommagé, par exemple. Ouvre le badge pour connaître la cause. | | **Non indexé** | Aucun index terminé n’est disponible. Vérifie le fichier et lance l’indexation lorsque l’action est proposée. | @@ -62,6 +63,7 @@ Clique sur **Échoué** ou **Non pris en charge** pour lire l’explication. La | Modèle d’embedding absent ou compte refusé par le fournisseur | Un administrateur doit configurer le modèle dans **Paramètres > Résidence des données**, ou corriger la clé, l’accès au modèle, l’offre ou le solde du compte. Relance ensuite. | | Identifiants d’embedding manquants ou inutilisables | Les identifiants qu’utilise le modèle d’embedding ont été supprimés ou désactivés, le fournisseur n’a plus d’identifiants par défaut (**Paramètres > Résidence des données** affiche **Identifiants manquants**), ou leur secret est illisible : il a été enregistré avec une ancienne clé de chiffrement, ou les identifiants renvoient à une variable d’environnement que le serveur ne définit pas. Un administrateur ajoute ou répare les identifiants sous **Paramètres > Fournisseurs IA**, ou en choisit d’autres pour le modèle d’embedding. Chacun de ces enregistrements remet les documents concernés en file d’attente. Si la correction a eu lieu sur le serveur lui-même, par exemple en définissant la variable d’environnement, utilise **Relancer l'indexation**. | | Panne temporaire du fournisseur ou du service d’indexation | Les traitements en arrière-plan retentent les échecs temporaires. Si l’erreur persiste, transmets le nom du document et le message à un administrateur. Après réparation, utilise **Relancer l'indexation**. | +| Une limite d’utilisation est atteinte | L’indexation transforme le texte en vecteurs avec le modèle d’embedding, ce qui compte dans les limites de la personne pour qui le document est indexé : qui l’a téléversé, le propriétaire d’un lecteur synchronisé, ou l’organisation pour une pièce jointe d’e-mail. Le document affiche **En attente d'une limite d'utilisation** et reprend de lui-même dans l’heure qui suit la réinitialisation de la limite ou son relèvement par un administrateur sous **Paramètres > Gouvernance > Politiques et limites**. | | Reconstruction ou réparation du moteur de recherche | La reconstruction peut se terminer automatiquement. Si la réparation échoue, l’exploitant doit réparer ou restaurer la base de connaissances avant une nouvelle tentative. | **Non pris en charge** ne propose pas de relance : traiter les mêmes octets ne corrigerait pas la cause. Un statut **Échoué** peut lui aussi nécessiter une modification de la source ou de la configuration. Une application distingue ces cas avec `indexing.errorCode` ; la [référence API](/fr/develop/api-reference) donne les codes stables. diff --git a/docs/fr/platform/knowledge/knowledge-entries.md b/docs/fr/platform/knowledge/knowledge-entries.md index fba6db8186..de8faaa11d 100644 --- a/docs/fr/platform/knowledge/knowledge-entries.md +++ b/docs/fr/platform/knowledge/knowledge-entries.md @@ -39,7 +39,7 @@ de réponse, pas d’un délai de résolution. Responsable : Support Operations. -Clique sur **Enregistrer**. La ligne affiche le sujet, le contenu, la source (**Manuel** pour le formulaire, **Chat** pour une information captée par l’assistant, **API** pour une information écrite par une intégration via REST), le statut d’indexation et la date de mise à jour. Ouvre-la pour lire le texte intégral. L’indexation s’effectue en arrière-plan : une entrée enregistrée n’est pas immédiatement disponible dans la recherche. +Clique sur **Enregistrer**. La ligne affiche le sujet, le contenu, la source (**Manuel** pour le formulaire, **Chat** pour une information captée par l’assistant, **API** pour une information écrite par une intégration via REST, **Agent** pour une information enregistrée par un agent), le statut d’indexation et la date de mise à jour. Ouvre-la pour lire le texte intégral. L’indexation s’effectue en arrière-plan : une entrée enregistrée n’est pas immédiatement disponible dans la recherche. @@ -63,6 +63,16 @@ Lorsqu’un chat fait ressortir une information utile, vérifie-la à la source, +## Laisser un agent tenir les informations à jour + +Un agent de projet ou l’étape agent d’une automatisation peut aussi enregistrer des informations. Accorde-lui **Ajouter et modifier des entrées de connaissances** sous **Skills, connectors & outils**, dans l’[équipement de l’agent](/fr/platform/projects/project-agents). L’agent enregistre une information par sujet ; un sujet sans entrée en reçoit une nouvelle, avec **Agent** comme source. + +Pour modifier une entrée existante, l’agent doit indiquer la version qu’il a lue. Si une personne ou un autre agent a modifié l’entrée entre-temps, rien n’est enregistré : l’agent reçoit le texte actuel et y intègre sa modification. L’**Historique des versions** conserve chaque texte précédent, comme pour tes propres modifications. + +Les entrées appartiennent à toute l’organisation : une exécution lancée par un Membre ne peut donc pas en enregistrer, et aucun agent ne peut supprimer une entrée. Les agents ont leur propre limite d’entrées enregistrées par minute, si bien qu’un agent très actif ne gêne jamais les personnes qui modifient des entrées. Chaque enregistrement par un agent est consigné dans le journal d’audit. + +Les agents peuvent toujours rechercher dans les connaissances, sans autorisation : le menu d’équipement l’affiche comme **Rechercher dans les connaissances**, toujours actif. + ## Retirer une entrée obsolète Choisis **Supprimer** dans le menu de la ligne et lis la confirmation. L’entrée et ses versions disparaissent de cette vue ; le document associé n’est plus disponible pour la recherche dans les connaissances. Garde une copie du texte avant la suppression si tu en as encore besoin. Pour une correction, utilise **Modifier**. diff --git a/docs/fr/platform/knowledge/overview.md b/docs/fr/platform/knowledge/overview.md index 2e73a7554c..58affd5fa7 100644 --- a/docs/fr/platform/knowledge/overview.md +++ b/docs/fr/platform/knowledge/overview.md @@ -42,7 +42,7 @@ Teste une nouvelle source avec une question dont tu connais la réponse : « Q ## Comprendre l’accès et la recherche -Le chat de l’organisation peut rechercher dans la bibliothèque commune selon tes droits. Le chat d’un projet peut aussi consulter les fichiers de ce projet et utilise ses instructions enregistrées. Il ne recherche pas dans les fichiers d’un autre projet. Les agents de projet doivent être équipés des outils de plateforme correspondants. +Le chat de l’organisation peut rechercher dans la bibliothèque commune selon tes droits. Le chat d’un projet peut aussi consulter les fichiers de ce projet et utilise ses instructions enregistrées. Il ne recherche pas dans les fichiers d’un autre projet. Les agents de projet et les étapes agent des automatisations recherchent toujours dans ces connaissances, dans le périmètre de leur projet, sans autorisation particulière ; pour lire ou modifier directement des [entrées de connaissances](/fr/platform/knowledge/knowledge-entries), ils doivent être équipés de l’outil correspondant. Les restrictions par équipe s’appliquent aussi à la recherche. Un fichier visible dans un espace peut donc manquer dans le contexte d’un autre projet. Utilise les [fichiers de projet](/fr/platform/projects/manage-files) pour les contenus propres à un projet et l’affectation aux équipes pour les documents de la bibliothèque commune. diff --git a/docs/fr/platform/member/preferences.md b/docs/fr/platform/member/preferences.md index 9934cacbd2..88ec70d730 100644 --- a/docs/fr/platform/member/preferences.md +++ b/docs/fr/platform/member/preferences.md @@ -57,7 +57,7 @@ Tes instructions ne remplacent jamais les instructions obligatoires de l’organ ## Consulter tes limites d’utilisation {#usage-limits} -Ouvre **Paramètres > Utilisation** pour voir ce que tu as déjà utilisé des limites que ton organisation t’applique. Si aucune limite ne te concerne, la page l’indique. La limite d’un projet, qui plafonne tout ce qui est dépensé dans ce projet, n’y figure pas ; une requête qu’elle refuse le dit. +Ouvre **Paramètres > Utilisation** pour voir ce que tu as déjà utilisé des limites que ton organisation t’applique. Si aucune limite ne te concerne, la page l’indique. La limite d’un projet, qui plafonne tout ce qui est dépensé dans ce projet, n’y figure pas : dans les chats du projet, le bandeau au-dessus de la zone de saisie la signale, et une requête qu’elle refuse le dit. @@ -69,7 +69,7 @@ Ouvre **Paramètres > Utilisation** pour voir ce que tu as déjà utilisé des l - **Limites partagées** comptent l’utilisation de toutes les personnes qu’elles couvrent, par exemple une équipe dont tu fais partie ou l’organisation entière. Elles peuvent donc être atteintes avant tes propres limites. - **Stockage** compare les fichiers que tu as téléversés avec ta limite de stockage. Une fois celle-ci atteinte, les nouveaux téléversements de documents sont refusés. -Chaque limite d’utilisation indique la quantité utilisée, la limite et le moment de sa réinitialisation, dans ton fuseau horaire. Les périodes suivent l’heure UTC : les limites quotidiennes repartent à minuit, les limites hebdomadaires le lundi et les limites mensuelles le premier du mois. Si un admin a défini un seuil d’alerte, la barre passe à l’orange dès que ton utilisation l’atteint. Quand un bandeau au-dessus de la zone de saisie signale une limite, **Voir l'utilisation** ouvre cette page. Les admins voient aussi **Gérer les limites**, qui ouvre **Gouvernance > Politiques et limites**. +Chaque limite d’utilisation indique la quantité utilisée, la limite et le moment de sa réinitialisation, dans ton fuseau horaire. Les périodes suivent l’heure UTC : les limites quotidiennes repartent à minuit, les limites hebdomadaires le lundi et les limites mensuelles le premier du mois. Si un admin a défini un seuil d’alerte, la barre passe à l’orange dès que ton utilisation l’atteint. Quand un bandeau au-dessus de la zone de saisie signale une limite, **Voir l'utilisation** ouvre cette page ; un bandeau sur la limite d’un projet nomme plutôt le projet. Les admins voient aussi **Gérer les limites**, qui ouvre **Gouvernance > Politiques et limites**. ## Archiver des chats ou se déconnecter diff --git a/docs/fr/platform/projects/project-agents.md b/docs/fr/platform/projects/project-agents.md index dd301c6951..237af1bcae 100644 --- a/docs/fr/platform/projects/project-agents.md +++ b/docs/fr/platform/projects/project-agents.md @@ -1,9 +1,9 @@ --- title: Créer et gérer des agents de projet -description: Configure un agent réutilisable, accorde son équipement et démarre une tâche dont tu peux vérifier le résultat. +description: Configure un agent pour les tâches d’un projet, accorde son équipement et démarre une tâche dont tu peux vérifier le résultat. --- -Crée un agent de projet pour disposer d’un agent réutilisable sur les tâches du projet. Il associe un environnement d’agent, un modèle, des instructions et un équipement autorisé. Tu dois pouvoir modifier le projet actif. Les Membres voient les agents du projet dans son onglet **Agents**, qui leur indique de demander un nouvel agent à un Éditeur ou à un Admin. Tant qu’un projet n’a pas d’agents propres, ses tâches peuvent aller à l’[agent standard](#standard-agent) de l’organisation. Seuls un Propriétaire ou un Admin peuvent changer les secrets accordés. +Crée un agent de projet pour disposer d’une configuration réutilisable sur les tâches du projet. Il associe un environnement d’agent, un modèle, des instructions et un équipement autorisé. Chaque tâche sur laquelle il travaille s’exécute dans un [worker](#run-one-agent-on-several-tasks), une copie de l’agent en cours d’exécution dans sa propre sandbox. Tu dois pouvoir modifier le projet actif. Les Membres voient les agents du projet dans son onglet **Agents**, qui leur indique de demander un nouvel agent à un Éditeur ou à un Admin. Tant qu’un projet n’a pas d’agents propres, ses tâches peuvent aller à l’[agent standard](#standard-agent) de l’organisation. Seuls un Propriétaire ou un Admin peuvent changer les secrets accordés. ## Préparer la première tâche @@ -25,6 +25,8 @@ Sépare les instructions réutilisables de la tâche. « Repère les preuves ma Ouvre l’onglet **Agents** du projet et choisis **Nouvel agent**. Donne-lui un **Nom** reconnaissable, puis choisis l’**Environnement d'agent**, son [programme d’exécution](/fr/platform/agents/harnesses). Les noms sont uniques dans le projet, qui accepte jusqu’à 50 agents. +Tale tire du nom un handle de mention, que tu saisis après `@` pour trouver l’agent : « My Opus Agent #3 » devient `@my-opus-agent-3`. Si ce handle est déjà pris, par un autre agent du projet ou par un membre ou une automatisation qu’on mentionne déjà ainsi, l’agent reçoit le suivant libre : `-02`, puis `-03`. Si un membre ou une automatisation se met plus tard à répondre au handle de l’agent, l’agent passe lui aussi au suivant libre. Le handle figure dans l’onglet **Agents** et sous **Nom** quand tu modifies l’agent. Renommer l’agent change son handle ; les mentions écrites avant continuent de désigner l’agent et affichent son nouveau nom. + Tu peux aussi partir d’une tâche : tant que le projet n’a pas d’agent, **Créer un agent…** sous **Assigné à** ouvre **Nouvel agent** par-dessus la tâche et lui assigne l’agent que tu crées. @@ -47,13 +49,17 @@ Sous **Skills, connectors & outils**, ajoute les bundles, services et opération +Le champ de recherche du menu filtre les skills, connectors et outils au fil de la saisie. **Rechercher dans les connaissances** figure sous **Connaissances** comme toujours actif : chaque agent recherche dans les connaissances du projet, sans autorisation. + Lis **Écrit des données** avant d’accorder un outil d’écriture : il autorise des opérations réelles selon ses règles d’accès. Le broker de connectors ne propose que des lectures aux agents. Les outils GitHub directs et les secrets explicitement accordés suivent d’autres voies. **Modifier la priorité et l'agent assigné aux tâches** permet à un agent de projet de prioriser les tâches existantes, de les assigner à un agent du même projet ou de retirer leur assignation, sans démarrer de travail. Cette autorisation reste désactivée tant que tu ne l’accordes pas et n’est pas proposée aux nœuds agent des automatisations. L’agent doit d’abord lire la tâche et joindre les valeurs lues à sa demande de modification. Si ces valeurs ont changé entre-temps, toute la demande est refusée et il doit relire la tâche. Un changement d’assignation exige une tâche ouverte, sans exécution active, revue en attente ou question ouverte. Modifier uniquement la priorité conserve ces passages de relais. Le Tool ne change ni le statut ni le réviseur, ne répond à aucune question destinée à une personne et ne lance aucune exécution. Seule une exécution active disposant de droits sur tout le projet peut l’utiliser, pas une exécution démarrée par un Membre. **Revoir les résultats des tâches d’autres agents** autorise un relecteur désigné à décider d’un résultat terminé produit par un autre agent de projet. Cette permission est désactivée au départ et n’est pas proposée aux nœuds agent des automatisations. Choisir un agent comme relecteur ne lui accorde pas cet outil et ne démarre aucune exécution. Il relit depuis sa propre tâche, avec des droits actuels sur tout le projet et la permission de relecture toujours accordée. Sa décision enregistre un retour et des éléments de vérification : une approbation termine la tâche examinée, tandis qu’une demande de modifications la remet à **À faire** sans démarrer de travail. Les compétences humaines requises et les approbations de workflows restent protégées. [Configurer un relecteur indépendant](/fr/platform/projects/task-automation#agent-review) décrit le parcours complet. -**Lancer d'autres agents sur des tâches** permet à l’agent de mettre au travail un autre agent de ce projet, par exemple un agent coordinateur qui distribue le travail prêt et relance un agent après avoir répondu à sa question. Il désigne une tâche, éventuellement l’agent à qui l’assigner, et un message que l’exécution lancée traite en premier. L’exécution lancée agit pour le compte de la même personne que l’exécution du coordinateur, et elle désigne le coordinateur comme l’agent qui l’a lancée. Un agent lancé de cette façon ne peut pas lancer d’autres agents, une exécution démarrée par un Membre ne peut en lancer aucun, et ni un agent qui travaille déjà sur une autre tâche ni une tâche bloquée par une tâche ouverte ne sont lancés. N’accorde cet outil qu’à un agent dont les instructions précisent quel travail il peut distribuer ; l’[automatisation des tâches](/fr/platform/projects/task-automation#travail-lance-par-une-automatisation-ou-un-autre-agent) décrit ce qu’une telle exécution peut faire. +**Lancer d'autres agents sur des tâches** permet à l’agent de mettre au travail un autre agent de ce projet, par exemple un agent coordinateur qui distribue le travail prêt et relance un agent après avoir répondu à sa question. Il désigne une tâche, éventuellement l’agent à qui l’assigner, et un message que l’exécution lancée traite en premier. L’exécution lancée agit pour le compte de la même personne que l’exécution du coordinateur, et elle désigne le coordinateur comme l’agent qui l’a lancée. Un agent lancé de cette façon ne peut pas lancer d’autres agents, une exécution démarrée par un Membre ne peut en lancer aucun, un coordinateur ne peut pas se lancer lui-même sur une autre tâche, et une tâche bloquée par une tâche ouverte n’est pas lancée. Un agent qui travaille déjà sur d’autres tâches est tout de même lancé : son exécution prend un [worker](#run-one-agent-on-several-tasks) distinct ou en attend un, et la réponse dit pourquoi elle attend. N’accorde cet outil qu’à un agent dont les instructions précisent quel travail il peut distribuer ; l’[automatisation des tâches](/fr/platform/projects/task-automation#travail-lance-par-une-automatisation-ou-un-autre-agent) décrit ce qu’une telle exécution peut faire. + +**Ajouter et modifier des entrées de connaissances** permet à l’agent d’enregistrer des informations comme [entrées de connaissances](/fr/platform/knowledge/knowledge-entries#laisser-un-agent-tenir-les-informations-a-jour) de toute l’organisation, une par sujet. Pour modifier une entrée, il doit indiquer la version qu’il a lue ; si l’entrée a changé entre-temps, rien n’est enregistré et l’agent intègre sa modification au texte actuel. Il ne peut pas supprimer d’entrées, et une exécution lancée par un Membre ne peut pas en enregistrer. Accorde-le à un agent dont les instructions précisent quelles informations méritent d’être conservées. Les appels de connectors d’une exécution se font au nom du membre qui l’a démarrée, que ce soit avec **Démarrer l'agent**, **Relancer**, un passage à **En cours** ou une mention de l’agent avec @. Ils utilisent les [identifiants des connectors](/fr/platform/admin/connectors) de l’organisation et sont enregistrés au nom de ce membre. Si ce membre quitte l’organisation ou est désactivé, les appels sont refusés : utilise **Annuler l'exécution** (ou laisse l’exécution se terminer), puis redémarre-la pour qu’elle se fasse en ton nom. Quand un commentaire relance l’exécution pour la guider, comme le font tous les environnements sauf Claude Code, les appels se font ensuite au nom de l’auteur du commentaire. @@ -81,6 +87,14 @@ Le compte rendu apparaît dans les commentaires et les fichiers collectés sont L’[automatisation des tâches](/fr/platform/projects/task-automation) explique le suivi, l’arrêt et la revue. L’assistant de chat ordinaire reste distinct, même avec un contexte de projet. +## Faire travailler un agent sur plusieurs tâches {#run-one-agent-on-several-tasks} + +Un agent est une configuration ; un worker en est une copie en cours d’exécution. Chaque tâche sur laquelle l’agent travaille en même temps s’exécute dans un worker distinct : une sandbox avec son propre espace de travail, sa mémoire et ses processus. Deux tâches ne partagent donc jamais de fichiers et ne se ralentissent pas l’une l’autre. Lance l’agent Scribe sur « Notes de version » et sur « Journal des modifications » : les deux avancent en même temps, chacune dans son worker. + +Les workers comptent dans la limite **Workers d’agent** de ton organisation, dans [Sandboxes](/fr/platform/admin/sandboxes#identifier-la-limite-concernee), que partagent tous les agents de l’organisation. Quand tous sont occupés, une nouvelle exécution attend au lieu d’échouer, et la tâche indique pourquoi sous **Exécution** : **En attente d’un worker**. Elle démarre d’elle-même dès qu’un worker se libère, sans consommer de nouvelle tentative automatique, et dispose alors de tout son temps de travail. Les Propriétaires et les Admins y voient un lien pour relever la limite. Quand plusieurs exécutions attendent, un worker libéré va d’abord à l’agent qui a le moins d’exécutions en cours, puis à l’exécution qui attend depuis le plus longtemps. Pour retirer une exécution en attente, utilise **Annuler l'exécution** ou affecte la tâche à quelqu’un d’autre : une exécution qui n’a pas encore démarré est annulée avec la réaffectation. + +L’exécution suivante d’une tâche retourne dans le worker où elle a travaillé en dernier quand celui-ci est libre : l’agent y poursuit la conversation et retrouve ses fichiers. Si ce worker est occupé, l’exécution en prend un autre et repart de zéro avec la description, la discussion, les pièces jointes et les résultats de la tâche. Après l’échec ou l’annulation d’une exécution, son worker reste réservé à cette tâche pendant 15 minutes, pour qu’une relance retrouve ce que l’exécution a laissé ; l’exécution d’une autre tâche ne le prend que si aucun autre worker n’est libre. + ## L’agent standard {#standard-agent} Un projet sans agents propres peut quand même confier du travail à un agent. Sauf si un Admin l’a désactivé dans [Gouvernance > Modèles](/fr/platform/admin/governance/content-models#standard-agent), **Assigné à** y propose l’option **Agent standard**, à toutes les personnes qui peuvent assigner la tâche, Membres compris. La première fois que quelqu’un la choisit, Tale met l’agent en place dans le projet et lui assigne la tâche. Tu le démarres ensuite comme n’importe quel autre agent, ou tu le mentionnes dans un commentaire. S’il ne peut pas démarrer pour toi, le champ de commentaire te le signale, et ton commentaire est enregistré comme une simple mention. @@ -97,6 +111,6 @@ Pour donner au projet un agent propre, choisis **Nouvel agent**. Dès lors, le p ## Modifier ou retirer un agent -Utilise le menu de sa ligne pour le modifier ou le supprimer. L’agent standard n’a que **Supprimer l'agent**. Les changements concernent les prochaines exécutions ; une exécution active conserve sa configuration initiale. La suppression retire les affectations à l’agent mais conserve l’historique des tâches. Elle efface aussi les [espaces de travail de sandbox](/fr/platform/admin/sandboxes#explain-why-a-workspace-disappeared) de l’agent avec leurs fichiers, y compris ceux des Membres. Examine le travail en cours et conserve les résultats nécessaires avant de retirer l’agent concerné. +Utilise le menu de sa ligne pour le modifier ou le supprimer. L’agent standard n’a que **Supprimer l'agent**. Les changements concernent les prochaines exécutions ; une exécution active conserve sa configuration initiale. La suppression retire les affectations à l’agent mais conserve l’historique des tâches. Elle efface aussi les [espaces de travail de tous ses workers](/fr/platform/admin/sandboxes#explain-why-a-workspace-disappeared) avec leurs fichiers, y compris ceux des Membres. Examine le travail en cours et conserve les résultats nécessaires avant de retirer l’agent. Si la création échoue, lis la cause affichée : un nom déjà utilisé, un accès au projet manquant, un modèle indisponible et un skill invisible sont des problèmes distincts. Une exécution qui échoue définitivement indique en haut de sa tâche ce qui s’est passé et qui peut y remédier ; [Quand l’agent ne peut pas terminer](/fr/platform/projects/task-automation#quand-lagent-ne-peut-pas-terminer) détaille les cas. Modifier les instructions ne résout pas ces prérequis. diff --git a/docs/fr/platform/projects/task-automation.md b/docs/fr/platform/projects/task-automation.md index 849d3b10f2..a074c24ca8 100644 --- a/docs/fr/platform/projects/task-automation.md +++ b/docs/fr/platform/projects/task-automation.md @@ -53,7 +53,7 @@ Pour une demande de modifications enregistrée, le coordinateur appelle `task_st La correction ne démarre que si la tâche est encore **À faire**, confiée au même agent, avec la même réalisation terminée comme dernière exécution. Une revue plus récente ou une modification intermédiaire du statut, de l’assignation ou de l’archivage empêche le démarrage, même si la valeur précédente a ensuite été rétablie. La réponse `stale_repair` ne change rien : le coordinateur relit la tâche et abandonne l’intention dépassée. Il ne réessaie jamais sans cette vérification explicite. La correction suit le cycle normal et soumet une nouvelle revue à la fin ; `moveToInProgress: false` est refusé. -Si la réponse se perd, le même agent coordinateur peut répéter l’appel protégé depuis une exécution active et actuellement autorisée, y compris une occurrence ultérieure. `replayed: true` renvoie le `runId` et le `repairReceipt` d’origine, conserve la première exécution à l’origine de la demande et ne lance aucun nouveau travail. Le reçu confirme un démarrage passé, pas que l’exécution est toujours active. Le droit de déléguer et l’accès au projet sont revérifiés à chaque appel. Les limites de simultanéité, d’occupation de l’agent et de trois démarrages automatisés par tâche sur une heure restent applicables aux nouveaux démarrages. Des échecs répétés sans changement doivent mener à une tâche d’investigation distincte plutôt qu’à des réessais sans limite. +Si la réponse se perd, le même agent coordinateur peut répéter l’appel protégé depuis une exécution active et actuellement autorisée, y compris une occurrence ultérieure. `replayed: true` renvoie le `runId` et le `repairReceipt` d’origine, conserve la première exécution à l’origine de la demande et ne lance aucun nouveau travail. Le reçu confirme un démarrage passé, pas que l’exécution est toujours active. Le droit de déléguer et l’accès au projet sont revérifiés à chaque appel. Les limites de simultanéité et de trois démarrages automatisés par tâche sur une heure restent applicables aux nouveaux démarrages. Des échecs répétés sans changement doivent mener à une tâche d’investigation distincte plutôt qu’à des réessais sans limite. Pour retrouver une décision après une réponse perdue lors d’une occurrence précédente du relecteur, lis `task_get.reviewDecision`. Ce champ contient le dernier reçu natif validé, ou `null` si une revue en attente, humaine ou liée à un workflow plus récente existe, ou si le reçu est indisponible. Compare les identifiants de revue et d’exécution à l’intention enregistrée, puis lis séparément l’état actuel de la tâche. Un reçu historique ne décrit pas sa colonne actuelle et `null` ne prouve pas qu’aucune décision n’a été enregistrée. La répétition immédiate et identique de `task_review` exige toujours la même exécution émettrice active. @@ -122,18 +122,20 @@ Les questions d’une automatisation et les approbations de workflows restent l | État ou symptôme | Action | | --- | --- | -| Attente d’une place de sandbox | La capacité de l’organisation ou de l’infrastructure partagée peut être épuisée, ou l’espace de travail de l’agent exécute peut-être déjà quatre de ses exécutions à la fois ; l’exécution démarre alors dès que l’une d’elles se termine. L’attente ne consomme aucune nouvelle tentative automatique. Attends une place ou demande à un admin d’examiner [Sandboxes](/fr/platform/admin/sandboxes). | +| **En attente d’un worker**, **En attente de place**, **En attente d’un espace de travail**, **En attente de sa sandbox** | L’exécution attend de la place et indique pourquoi sous **Exécution** : tous les [workers d’agent](/fr/platform/projects/project-agents#run-one-agent-on-several-tasks) de ton organisation sont occupés, le déploiement est plein ou manque de mémoire ou d’espace disque, un administrateur supprime l’espace de travail que l’exécution utiliserait, ou sa sandbox termine encore un processus précédent. Elle démarre d’elle-même dès que la place se libère, et l’attente ne consomme aucune nouvelle tentative automatique. Quand tous les workers d’agent sont occupés, les Propriétaires et les Admins peuvent relever la limite dans [Sandboxes](/fr/platform/admin/sandboxes#identifier-la-limite-concernee). **Annuler l'exécution** retire une exécution en attente. | | Nouvelle tentative automatique affichée | Tale reprend après un échec récupérable. Surveille le compteur sans lancer une autre exécution. | | **L’agent n’a pas pu terminer cette tâche** | Aucune nouvelle tentative automatique ne suit. L’avis indique ce qui s’est passé et qui peut y remédier, et **Détails**, à côté de l’exécution, montre ce que l’exécution elle-même a signalé ; [Quand l’agent ne peut pas terminer](#quand-lagent-ne-peut-pas-terminer) détaille les cas. Corrige la cause, puis utilise **Relancer** pour continuer la conversation. | -| Réassignation refusée | Annule l’exécution active avant de choisir un autre responsable. | +| Réassignation refusée | Annule l’exécution active avant de choisir un autre responsable. Une exécution qui attend encore de la place ne bloque jamais une réaffectation : elle est annulée avec elle. | | Des agents ou des automatisations relancent sans cesse une même tâche | Une tâche accepte au plus trois démarrages de son agent par des automatisations et d’autres agents en une heure, les relances automatiques ordinaires comprises ; l’exception pour l’attente du courtier décrite ci-dessous s’applique aussi. Le démarrage suivant est refusé, une relance au-delà de la limite ne démarre pas, et la chronologie indique **Exécution refusée: les exécutions d'agents sont en pause sur cette tâche**. Les démarrages par des personnes, et leurs relances, ne sont jamais comptés. Les exécutions d’automatisations n’ont pas ce plafond : entre deux automatisations qui se mentionnent sans fin, c’est la règle d’un seul moteur qui arrête la boucle. Annule l’exécution active, puis lis la chronologie avant de laisser l’une ou l’autre redémarrer. | -| **Exécution refusée: l'agent travaille sur une autre tâche** | Une nouvelle tentative automatique a attendu son agent pendant deux heures, et il travaille encore sur une autre tâche. Rien n’attend derrière ce refus : relance la tâche dès que l’agent est libre, ou laisse faire l’agent coordinateur ou l’automatisation qui distribue le travail. | +| **Exécution refusée: l'agent travaille sur une autre tâche** | N’apparaît que sur des exécutions antérieures aux workers d’agent : une nouvelle tentative automatique a attendu son agent pendant deux heures, puis a abandonné. Relance la tâche ; son exécution prend désormais un worker distinct. | | Clôture impossible | Termine d’abord les sous-tâches ouvertes. | Un échec récupérable donne lieu à jusqu’à trois nouvelles tentatives après la tentative initiale, qui démarrent aussitôt sauf dans les cas décrits plus bas. Une exécution qui progresse pendant au moins quinze minutes reçoit une nouvelle réserve de tentatives. Cela aide le travail long à reprendre après une interruption, sans prouver que le résultat est correct. Si Codex termine une exécution parce que le modèle choisi est saturé, Tale programme la nouvelle tentative automatique une minute plus tard. La tentative échouée compte toujours pour la limite habituelle des relances et, pour les démarrages automatisés, pour la limite horaire. Tale garde le compte précédent parmi les comptes admissibles, sans changer de modèle ni mettre les autres agents en pause. Cette attente ne garantit pas que le modèle sera disponible. Si l’une de ces limites refuse la suite, la tâche peut rester **En cours** avec une exécution en échec : cette colonne seule ne signifie pas qu’un agent travaille encore. +Quand un agent ne répond plus, c’est-à-dire qu’il n’affiche rien et ne fait presque rien pendant 45 minutes par défaut, sa sandbox l’arrête et l’exécution échoue sans nouvelle tentative automatique : une relance s’arrêterait très probablement de la même façon. L’avis indique que l’agent ne répondait plus, et **Détails** montre ce qu’il a affiché en dernier. + Une nouvelle tentative automatique poursuit le travail de la personne qui a démarré l’exécution : elle ne démarre donc que là où cette personne pourrait la lancer maintenant. Le projet doit encore être actif, et cette personne doit toujours avoir le droit de modifier la tâche. Si un administrateur archive le projet, ou si cette personne quitte l’organisation ou perd le droit de modifier la tâche, aucune nouvelle tentative ne démarre et l’exécution reste en échec. Il en va de même pour une mention qui n’atteint l’agent qu’après la fin de son exécution. Une fois le projet restauré, toute personne qui peut modifier la tâche peut utiliser **Relancer**. Avant qu’une nouvelle exécution commence à travailler, une brève panne de connexion au courtier d’abonnement peut être surmontée au sein de cette même exécution. Si celle-ci dispose de tous les droits de l’agent, Tale effectue au plus trois requêtes GET, espacées d’au moins cinq puis dix secondes, avec un budget commun de 60 secondes pour les requêtes et l’acceptation du résultat. Pour cet accès au courtier, Tale respecte au moins l’attente demandée ou s’arrête si elle dépasse le budget restant. Cette attente n’est pas reportée sur une exécution ultérieure ; les règles de relance et la limite horaire des démarrages continuent de s’appliquer. Les vérifications en base de données et DNS, ainsi que la fermeture des connexions, peuvent retarder le refus final. Ces requêtes n’ajoutent ni démarrage de tâche ni tentative automatique. Tale vérifie à nouveau l’exécution et l’identifiant avant chaque nouvelle requête et avant de renvoyer un jeton. Les exécutions limitées des Membres, les courtiers POST, les identifiants refusés et les comptes en période d’attente conservent leur fonctionnement actuel. @@ -152,8 +154,9 @@ Quand une exécution échoue et que plus rien ne la relance, parce que ses nouve | Il manque quelque chose à l’agent : son modèle, l’un de ses skills ou l’agent lui-même | Un Éditeur ou un Admin corrige l’agent dans l’onglet **Agents** du projet. | | Une pièce jointe de cette tâche n’est plus dans le stockage | Toute personne qui peut modifier la tâche retire la pièce jointe ou la téléverse à nouveau ; **Détails**, à côté de l’exécution, nomme le fichier. Relance ensuite l’agent. | | L’exécution a atteint sa limite de temps | Relance l’agent, ou découpe la tâche en tâches plus petites. | -| L’exécution a attendu trop longtemps une sandbox libre | Relance l’agent quand moins d’agents sont occupés. | +| L’exécution a attendu trop longtemps un worker libre | Relance l’agent quand moins d’agents sont occupés, ou demande à un Propriétaire ou à un Admin de relever **Workers d’agent**. | | Le modèle d’IA a échoué, ou l’exécution n’a pas pu démarrer ou a été interrompue | Relance l’agent. S’il échoue encore, montre à un Admin ce que l’exécution a signalé dans **Détails**. | +| L’agent ne répondait plus | Relance l’agent. S’il s’arrête encore, montre à un Admin ce que l’exécution a signalé dans **Détails** : on y voit ce que l’agent a affiché en dernier. | Tale prévient aussi la personne qui a démarré l’exécution et toutes celles qui suivent la tâche : par la notification **Échec de l’exécution de l’agent** et, si l’organisation dispose d’une boîte mail connectée, par e-mail. Seules les personnes qui peuvent encore ouvrir le projet sont prévenues. Une nouvelle exécution démarrée sur la tâche marque la notification non lue comme lue. Tu peux désactiver ces avis avec **Escalades d'agent** dans **Paramètres > Notifications**. @@ -161,7 +164,7 @@ Tale prévient aussi la personne qui a démarré l’exécution et toutes celles Un agent de projet peut aussi être mis au travail sans que personne ait à cliquer sur **Démarrer l'agent** : par une [automatisation planifiée](/fr/platform/automations/triggers#demarrer-un-agent-de-projet-selon-une-planification), ou par un autre agent du projet qui dispose de l’outil **Lancer d'autres agents sur des tâches**, comme un agent coordinateur qui distribue le travail prêt et répond aux questions. La chronologie affiche une telle exécution comme **automatisation**, avec, pour les propriétaires, les admins et les développeurs, un lien vers l’exécution de l’automatisation, ou comme **délégué**, lancée par l’agent qui l’a demandée. L’agent apprend qui l’a démarré, et il lit un message transmis par cette automatisation ou cet agent comme venant d’eux, jamais comme la revue d’une personne : là où ce message contredit la description ou le commentaire d’une personne, ce sont ces derniers qui l’emportent. -L’exécution agit pour le compte de la même personne que l’exécution qui l’a demandée : la personne qui a démarré cette exécution, ou personne si la chaîne a commencé par une planification, auquel cas ses dépenses comptent comme des dépenses d’automatisation. Cette personne, ou la planification, doit pouvoir agir dans le projet au moment où l’exécution démarre : si la personne perd le rôle Éditeur, si la planification est suspendue ou si l’automatisation est retirée du projet, le démarrage suivant n’a pas lieu. Un agent lancé par un autre agent ne peut pas lancer d’autres agents, et une exécution démarrée par un Membre ne peut en lancer aucun. Un tel démarrage vérifie aussi ce qu’une personne pourrait oublier : une tâche bloquée par une tâche ouverte ne démarre pas, et un agent qui travaille déjà sur une autre tâche n’est pas lancé une seconde fois. Une nouvelle tentative automatique d’une telle exécution suit la même règle : tant que son agent travaille sur une autre tâche dans le même espace de travail, elle attend, vérifie à nouveau toutes les cinq minutes et démarre dès que l’agent est libre, sans consommer de tentative. Chaque vérification relit la tâche : si elle quitte **En cours** ou change de responsable, si elle ou son projet est archivé, ou si la personne perd son rôle, l’attente prend fin. Si l’agent est encore occupé deux heures après l’échec, la nouvelle tentative ne démarre pas et la chronologie indique **Exécution refusée: l'agent travaille sur une autre tâche**. +L’exécution agit pour le compte de la même personne que l’exécution qui l’a demandée : la personne qui a démarré cette exécution, ou personne si la chaîne a commencé par une planification, auquel cas ses dépenses comptent comme des dépenses d’automatisation. Cette personne, ou la planification, doit pouvoir agir dans le projet au moment où l’exécution démarre : si la personne perd le rôle Éditeur, si la planification est suspendue ou si l’automatisation est retirée du projet, le démarrage suivant n’a pas lieu. Un agent lancé par un autre agent ne peut pas lancer d’autres agents, et une exécution démarrée par un Membre ne peut en lancer aucun. Un tel démarrage vérifie aussi ce qu’une personne pourrait oublier : une tâche bloquée par une tâche ouverte ne démarre pas, et un agent ne peut pas se lancer lui-même sur une autre tâche (`self_start`). Un agent qui travaille déjà sur d’autres tâches est tout de même lancé, dans un [worker](/fr/platform/projects/project-agents#run-one-agent-on-several-tasks) distinct. Quand tous les workers d’agent de ton organisation sont occupés, l’exécution attend, démarre d’elle-même dès qu’un worker se libère, et le démarrage répond `started` avec la raison de l’attente (`waitingReason`) ; **Lire une tâche** montre la même chose tant que l’exécution attend. Une nouvelle tentative automatique d’une telle exécution démarre aussitôt, quoi que fasse son agent par ailleurs. Une exécution déléguée dépose son résultat à **En revue** pour le relecteur enregistré. Reprendre une tâche qui y attend retire sa demande de revue en cours, sans valider le résultat. Un démarrage qui laisse la carte en place (`moveToInProgress: false`) est refusé sous une carte en attente de revue, ou sous une carte **Terminé** ou **Annulé**, afin qu’un travail antérieur ne soit jamais présenté au jugement pendant qu’un nouveau travail s’exécute dessous. Un coordinateur qui répond à la question d’un agent le relance en nommant l’exécution qui a posé la question et la revue qu’elle attend. La reprise n’a lieu que tant que c’est encore la question ouverte de la tâche. Si une décision a été prise entre-temps (**Terminé**, **Annulé** ou un autre déplacement), s’il existe une exécution ou une revue plus récente, ou si l’assignation a changé, l’agent répond `stale_question` et rien n’est assigné, retiré, déplacé ni démarré. Si ton organisation exige une relecture humaine indépendante, la personne pour le compte de laquelle l’exécution agit ne peut pas en accepter le résultat. diff --git a/docs/fr/platform/projects/tasks.md b/docs/fr/platform/projects/tasks.md index 157c08ff47..de1bf4dfaf 100644 --- a/docs/fr/platform/projects/tasks.md +++ b/docs/fr/platform/projects/tasks.md @@ -70,9 +70,9 @@ Les automatisations suivent une règle plus stricte, car une automatisation agit Une exécution démarrée par une personne qui ne peut pas modifier le projet, par exemple un Membre, s’en tient à sa tâche : - Ses outils de plateforme ne modifient que cette tâche et ses sous-tâches : l’agent ne crée de nouvelles tâches que comme sous-tâches de celle-ci, n’utilise que des étiquettes que le projet possède déjà et ne peut pas synchroniser dans le projet des éléments venant d’autres systèmes. -- Elle ne peut pas enregistrer de documents dans le projet. Les fichiers produits arrivent quand même sur la tâche, sous **Fichiers produits**. +- Elle ne peut pas enregistrer de documents dans le projet ni écrire d’entrées de connaissances. Les fichiers produits arrivent quand même sur la tâche, sous **Fichiers produits**. - L’exécution ne reçoit ni les **Secrets** de l’agent ni le jeton d’un accès GitHub équipé. L’agent apprend quels identifiants ont été retenus et doit le signaler dans son compte rendu si le travail en a besoin ; un Éditeur ou un rôle supérieur doit alors le démarrer. Les connectors équipés sur l’agent continuent de fonctionner, au nom de la personne qui a démarré l’exécution. -- Elle travaille dans son propre espace de travail, conservé pour les exécutions de cette personne avec cet agent : les fichiers des exécutions que des Éditeurs ont démarrées n’y sont pas, et ce que cette exécution laisse ne parvient jamais à celles-ci. Les exécutions suivantes de la même personne avec cet agent le retrouvent, jusqu’à ce que Tale le supprime : quand la personne quitte l’organisation ou que l’agent est supprimé, ou dès qu’aucune exécution ne l’a utilisé pendant le nombre de jours fixé par l’organisation sous [**Jours sans utilisation**](/fr/platform/admin/sandboxes#delete-unused-workspaces-automatically). +- Elle travaille dans un worker conservé pour les exécutions de cette personne avec cet agent, avec son propre espace de travail : les fichiers des exécutions que des Éditeurs ont démarrées n’y sont pas, et ce que cette exécution laisse ne parvient jamais à celles-ci. La personne obtient un tel worker pour chacune de ses exécutions avec l’agent qui travaillent en même temps. Ses exécutions suivantes avec l’agent retrouvent l’espace de travail, jusqu’à ce que Tale le supprime : quand la personne quitte l’organisation ou que l’agent est supprimé, ou dès qu’aucune exécution ne l’a utilisé pendant le nombre de jours fixé par l’organisation sous [**Jours sans utilisation**](/fr/platform/admin/sandboxes#delete-unused-workspaces-automatically). L’exécution peut toujours lire les tâches et les connaissances du projet, et elle garde ces limites même si un Éditeur la guide ensuite. Une exécution qu’un Éditeur ou un rôle supérieur démarre dispose, sur toute tâche, de l’équipement complet de l’agent. Le commentaire d’un Membre peut changer cela : si l’environnement de l’agent redémarre pour prendre en compte le commentaire, comme le font [tous les environnements sauf Claude Code](/fr/platform/agents/harnesses), la suite de l’exécution compte comme celle du Membre, avec les mêmes limites pour ses outils et ses identifiants. @@ -114,7 +114,7 @@ La relecture en cours explique aussi les blocages liés à l’auto-relecture, ## Montrer la progression avec les statuts -Modifie **Statut** dans les détails de la tâche ou déplace sa carte vers une autre colonne du tableau. Le sélecteur de statut offre une alternative au glisser-déposer utilisable au clavier. +Modifie **Statut** dans les détails de la tâche ou déplace sa carte vers une autre colonne du tableau. Le sélecteur de statut offre une alternative au glisser-déposer utilisable au clavier. **Terminé** et **Annulé** se replient en une barre étroite avec l’icône à côté de leur nom, pour que le travail fini ne gêne pas : la barre garde le nombre de tâches de la colonne, se déplie quand tu la sélectionnes et accepte encore une carte que tu y glisses. Chaque tableau retient dans ce navigateur les colonnes repliées. | Statut | Signification | | --- | --- | @@ -135,15 +135,17 @@ Pendant la validation, la tâche affiche l'état en attente et empêche une seco ## Garder les décisions avec le travail -Ouvre la tâche pour ajouter une description, des pièces jointes, des dates, des étiquettes, des sous-tâches ou des commentaires. Consigne dans les commentaires les questions, décisions et retours qu’un futur relecteur devra comprendre. +Ouvre la tâche pour ajouter une description, des pièces jointes, des dates, des étiquettes, des sous-tâches ou des commentaires. Consigne dans les commentaires les questions, décisions et retours qu’un futur relecteur devra comprendre. Une tâche se lit de la même façon dans la boîte de dialogue du tableau et sur sa propre page : d’abord la demande, puis la discussion comme une seule conversation, avec l’historique de la tâche entre les commentaires, et la zone de commentaire en bas. Sur un grand écran, elle s’ouvre sur le message le plus récent ; fais défiler vers le haut pour retrouver la demande. Sur un téléphone, la boîte de dialogue défile en une seule colonne depuis la demande : la conversation, puis la zone de commentaire, puis les détails. [Ouvrir tes tâches depuis Accueil](#ouvrir-tes-taches-depuis-accueil) décrit chaque partie. Saisis `@` dans un commentaire pour ouvrir le sélecteur de mentions. Mentionner l’agent assigné constitue une instruction : cela peut guider une exécution en cours ou en démarrer une autre si l’agent est inactif. Un commentaire sans mention conserve l’échange sans demander cette action à l’agent. +Le sélecteur trouve les personnes et les agents par leur nom ou leur handle ; le handle d’un agent figure à côté, par exemple `@my-opus-agent-3` pour « My Opus Agent #3 ». Le champ et le commentaire envoyé affichent le nom de la personne ou de l’agent que tu mentionnes. Tale enregistre qui la mention désigne, pas les mots saisis : après un renommage, elle affiche le nouveau nom. **Retour arrière** juste après un nom retire toute la mention, et saisir au milieu d’un nom le transforme en texte simple. Une mention dans du code reste du texte et ne notifie personne. + Les mentions dans la description de la tâche agissent de la même façon quand tu enregistres la tâche : les personnes citées sont notifiées, et un agent cité est guidé ou démarre une exécution comme décrit ci-dessus. S’il démarre une exécution, la tâche passe à **En cours**, quelle que soit la colonne où tu l’as créée. Quand tu modifies la description plus tard, seules les mentions que tu ajoutes comptent. Reformuler le texte autour d’une mention existante ne notifie personne à nouveau. L’agent lit la description telle qu’elle est au démarrage de son exécution : si tu la modifies pendant que l’exécution attend encore, c’est ta nouvelle version qu’il suit. Utilise **Sous-tâches** pour séparer des résultats vérifiables indépendamment. Une sous-tâche nomme sa tâche parente en haut de ses détails (**Partie de …**) ; clique dessus pour y remonter. Tant qu’une de ses sous-tâches reste ouverte, une tâche parente ne peut passer ni à **Terminé** ni à **Annulé** ; les autres statuts restent disponibles, **À faire** compris. **Dépendances** indique ce qui bloque la tâche et ce qu’elle bloque. Les dépendances circulaires sont refusées. -Quand tu modifies un champ, l’**Activité** de la tâche affiche sa valeur d’avant et celle d’après. Un champ que tu vides indique ce qui reste, par exemple **Aucune échéance** ou **Non assigné**, au lieu de répéter seulement l’ancienne valeur. Les titres, descriptions, étiquettes et noms de fichiers apparaissent exactement tels qu’ils ont été saisis, même quand le texte correspond à un nom de statut comme `done`. Les statuts, les priorités, les dates et les mentions d’un champ vide s’affichent dans ta langue. +Quand tu modifies un champ, la ligne que la modification ajoute à la conversation de la tâche affiche sa valeur d’avant et celle d’après. Un champ que tu vides indique ce qui reste, par exemple **Aucune échéance** ou **Non assigné**, au lieu de répéter seulement l’ancienne valeur. Les titres, descriptions, étiquettes et noms de fichiers apparaissent exactement tels qu’ils ont été saisis, même quand le texte correspond à un nom de statut comme `done`. Les statuts, les priorités, les dates et les mentions d’un champ vide s’affichent dans ta langue. ## Rendre une tâche récurrente @@ -210,12 +212,13 @@ Passe la tâche à **Terminé** lorsqu’elle répond au besoin. Si l’agent do ## Ouvrir tes tâches depuis Accueil -[Accueil](/fr/platform#home) liste les tâches ouvertes qui te sont attribuées ou qui attendent ta relecture, dans tous les projets que tu peux consulter ; **Tâches**, au-dessus de la liste, n’affiche qu’elles. Une tâche ouverte depuis **Accueil** s’affiche sur une page à part, à côté du panneau latéral, et non dans la boîte de dialogue du tableau : +[Accueil](/fr/platform#home) liste les tâches ouvertes qui te sont attribuées ou qui attendent ta relecture, dans tous les projets que tu peux consulter ; **Tâches**, au-dessus de la liste, n’affiche qu’elles. Une tâche ouverte depuis **Accueil** s’affiche sur une page à part, à côté du panneau latéral, organisée comme la boîte de dialogue du tableau : - La demande vient en premier, sous forme de carte : la description, les pièces jointes et les sous-tâches. -- La discussion suit comme une conversation, des éléments les plus anciens aux plus récents, regroupés par jour. Elle réunit les commentaires et l’historique de la tâche, par exemple les changements de statut, les attributions et les exécutions d’agents. +- La discussion suit comme une conversation, des éléments les plus anciens aux plus récents, regroupés par jour ; la date reste en haut pendant que tu fais défiler sa journée. Tes propres commentaires sont à droite, comme dans un chat. Ceux des autres, personnes et agents, sont à gauche sous leur nom, avec la mention **Agent** pour un agent, et l’heure. D’un long commentaire, comme le rapport d’un agent, tu vois le début ; **Lire la suite** ouvre le reste sur place et **Afficher moins** le replie. +- L’historique de la tâche s’affiche entre les commentaires en lignes courtes, par exemple les changements de statut, les attributions et les exécutions d’agents. Trois lignes ou plus à la suite se regroupent en une seule, par exemple **5 modifications**, avec les noms de leurs auteurs ; sélectionne-la pour voir chacune. - Le champ de commentaire se trouve en bas. Envoie avec **⌘+Entrée** ou **Ctrl+Entrée**, ou avec le bouton d’envoi rond ; **Entrée** seule passe à la ligne. Saisis `@` pour mentionner un agent ou une personne, avec le même effet que dans la boîte de dialogue du tableau. Le texte que tu n’as pas encore envoyé reste dans le champ pour cette tâche, ici comme dans la boîte de dialogue du tableau, et la ligne de la tâche dans **Accueil** affiche **Brouillon** tant que tu travailles ailleurs. -- **Détails**, à côté de la discussion, regroupe le statut, la priorité, la personne assignée, le relecteur, les dates, la répétition, les étiquettes et les dépendances, ainsi que **Suivre** et **Archiver**. Les propriétaires et administrateurs de l’organisation y trouvent aussi **Supprimer** : la tâche disparaît définitivement avec ses sous-tâches, leurs commentaires et leurs fichiers, et leurs exécutions d’agent en cours s’arrêtent. **Masquer les détails**, au bout de l’en-tête, replie ce panneau et **Afficher les détails** le rouvre. Dans une fenêtre trop étroite pour afficher les deux côte à côte, **Afficher les détails** ouvre plutôt les détails dans un volet au-dessus de la discussion — sur le côté, ou en bas de l’écran sur téléphone. +- **Détails**, à côté de la discussion, regroupe le statut, la priorité, la personne assignée, le relecteur, les dates, la répétition, les étiquettes et les dépendances, ainsi que **Suivre** et **Archiver**. Si les exécutions d’agent de la tâche ont coûté quelque chose, **Coût des agents** y affiche leur total. Les propriétaires et administrateurs de l’organisation y trouvent aussi **Supprimer** : la tâche disparaît définitivement avec ses sous-tâches, leurs commentaires et leurs fichiers, et leurs exécutions d’agent en cours s’arrêtent. **Masquer les détails**, au bout de l’en-tête, replie ce panneau et **Afficher les détails** le rouvre. Dans une fenêtre trop étroite pour afficher les deux côte à côte, **Afficher les détails** ouvre plutôt les détails dans un volet au-dessus de la discussion — sur le côté, ou en bas de l’écran sur téléphone. **Tableau**, dans l’en-tête, ouvre le tableau des tâches du projet. Une tâche ouverte depuis le tableau s’affiche toujours dans sa boîte de dialogue, avec la même ligne de titre ; les deux vues modifient la même tâche. **Ouvrir en pleine page**, l’icône d’agrandissement à côté de **Fermer** dans la boîte de dialogue, ouvre la tâche ici sur sa propre page, et le bouton Précédent du navigateur ramène au tableau avec la boîte de dialogue ouverte. Une description en cours de modification n’est pas reprise : enregistre-la d’abord. **Copier le lien** dans la boîte de dialogue copie le même lien de page. **Copier le lien**, l’icône de lien à côté de **Tableau**, copie le lien de cette page de tâche. Pour copier l’identifiant de la tâche, par exemple `WEB-2`, clique dessus dans la ligne sous le titre ; un message confirme chaque copie. diff --git a/docs/fr/self-hosted/configuration/environment-reference.md b/docs/fr/self-hosted/configuration/environment-reference.md index 1249879705..bd71bd7726 100644 --- a/docs/fr/self-hosted/configuration/environment-reference.md +++ b/docs/fr/self-hosted/configuration/environment-reference.md @@ -66,6 +66,7 @@ Tale utilise `tale_app` pour les données applicatives et `tale_knowledge` pour | `DB_PASSWORD` | `tale_password_change_me` | **Requis pour Postgres fourni.** Mot de passe commun aux bases applicative et documentaire dans le déploiement standard. Remplace l’exemple avant la production. | | `DATABASE_URL` | construit depuis `DB_PASSWORD` | **Optionnel.** URL de connexion de la base opérationnelle. Pose-la pour diriger le backend vers un Postgres que tu exploites toi-même : il n’a besoin d’aucune extension ni d’un superutilisateur, seulement d’une base et d’un rôle qui peut créer des schémas. Relue à chaque démarrage. | | `DATABASE_POOL_MAX` | `10` | **Optionnel.** Nombre maximal de connexions par pool de la base opérationnelle. Chaque réplique de `backend-api` ou `backend-worker` utilise normalement jusqu’au double de cette valeur (pool applicatif et file de jobs). Les opérations sur les sandboxes peuvent temporairement ouvrir une connexion supplémentaire par place occupée du pool applicatif, soit un pic égal au triple de cette valeur par réplique. Compare ce pic au `max_connections` de la base. | +| `AUTH_DATABASE_POOL_MAX` | `5` | **Optionnel.** Connexions du pool par lequel chaque réplique de `backend-api` résout les sessions de connexion ; chaque requête authentifiée lit par ce pool. Augmente-le sur les répliques qui servent des milliers de requêtes par seconde, et compte-le par réplique dans le `max_connections` de la base, à côté de `DATABASE_POOL_MAX`. | | `POSTGRES_CA_FILE` | non défini | **Optionnel.** Chemin d’un bundle PEM auquel **toutes** les connexions Postgres font confiance : la base opérationnelle, le corpus de connaissances et les bases que les organisations apportent elles-mêmes. Nécessaire dès qu’une URL demande `sslmode=verify-ca` ou `verify-full` face à un fournisseur dont la racine n’est pas livrée avec Node — Amazon RDS est le cas courant. Si tes bases utilisent des fournisseurs différents, concatène leurs racines dans un seul fichier. | | `KNOWLEDGE_DATABASE_URL` | `postgresql://tale:${DB_PASSWORD}@knowledge-db:5432/tale_knowledge` | URL de connexion du corpus documentaire par défaut. La modifier sélectionne une autre base, sans migrer les fragments ni les vecteurs existants. | | `KNOWLEDGE_DB_POOL_MAX` | `10` | **Optionnel.** Connexions qu’un processus backend ouvre vers le corpus documentaire. Chaque job d’indexation en occupe une pendant qu’il écrit une tranche de fragments ; si `WORKER_CONCURRENCY` autorise plus de jobs simultanés que cela, ils attendent le pool : augmente les deux ensemble. Comme `DATABASE_POOL_MAX`, cette valeur compte par réplique dans le `max_connections` de la base du corpus. | @@ -225,6 +226,7 @@ Ces valeurs façonnent les rôles applicatifs d’un déploiement de workspace  | `AGENT_START_SLOTS` | `WORKER_CONCURRENCY`, au moins `8` | Démarrages de tours d’agent qu’un réplica `backend-worker` exécute en même temps, pour les exécutions de tâches et pour les étapes d’automatisation chacun. Un démarrage occupe sa place pendant la création de la sandbox et la première fenêtre de 90 secondes du tour. Plage `1`–`256`. | | `AGENT_DRIVE_SLOTS` | `WORKER_CONCURRENCY`, au moins `16` | Fenêtres de traitement des tours d’agent en cours qu’un réplica `backend-worker` exécute en même temps, par voie. Un réplica garde environ 2,5 fois ce nombre de tours en cours traités par voie ; au-delà, les fenêtres attendent assez longtemps pour que la reprise intervienne. Augmente-le (ou ajoute des réplicas) pour plus de tours à la fois. Plage `1`–`256`. | | `AUTOMATION_ORG_CONCURRENCY` | `8` | Étapes d’automatisation d’une même organisation qui s’exécutent en même temps sur l’ensemble des réplicas `backend-worker`. Ainsi, une organisation qui lance beaucoup d’exécutions d’un coup n’occupe pas toutes les places des workers pendant que les exécutions des autres organisations attendent. `0` supprime la limite. Des réplicas qui récupèrent du travail au même instant peuvent chacun démarrer une étape : lors d’un afflux, une ou deux de plus peuvent brièvement s’exécuter. Un réplica seul avec la valeur par défaut de `WORKER_CONCURRENCY` ne l’atteint jamais ; si ton déploiement ne sert qu’une organisation et offre plus de places pour les étapes que cette valeur, augmente-la ou mets `0`. Plage `0`–`256`. | +| `AUTOMATION_RUNNER_PROCESSES` | `2` pour `backend-api` ; pour `backend-worker`, un par cœur de CPU moins un, au plus `4` | Nombre de processus dans lesquels un réplica backend évalue le code des automatisations : les templates que lit le runner et le code des étapes transform. Un réplica en démarre un et n’en ajoute un autre que lorsque tous les siens sont occupés ; un processus au-delà du premier s’arrête après cinq minutes sans travail. Chacun occupe environ 75 Mo lorsqu’il tourne. Baisse la valeur sur un réplica à court de mémoire ; augmente-la sur un worker dont les automatisations exécutent beaucoup de code transform. Plage `1`–`16`. | | `SHUTDOWN_DRAIN_MS` | `15000` pour `backend-api`, `90000` pour `backend-worker` | Durée, en millisecondes, pendant laquelle un réplica backend qui s’arrête attend ses jobs avant de quitter. Un worker transmet d’abord ses exécutions d’automatisation à un autre : chaque exécution continue à sa prochaine étape, et une étape qui travaille encore au bout de 20 secondes est interrompue et s’exécute à nouveau sur le réplica suivant, sauf si elle envoyait quelque chose à un service externe — l’exécution attend alors qu’une personne décide. Garde le `stop_grace_period` du conteneur au moins 15 secondes au-dessus de cette valeur ; les fichiers compose fournis donnent 30 secondes à `backend-api` et 120 à `backend-worker`, et `tale deploy` les porte tous deux à 15 secondes au-dessus d’une valeur plus longue. Plage `1000`–`600000`. | | `TALE_BACKEND_URL` | `http://backend-api:3005` | Où l'étage web atteint le backend applicatif : la page publique `/status` le sonde et le serveur web lui demande les réponses que seule une base de données peut donner. Le Compose livré et l'entrypoint du conteneur prennent l'alias in-compose par défaut ; définis la variable seulement si ton service backend porte un autre nom. Lue uniquement par le service `platform`. | @@ -235,6 +237,7 @@ Un déploiement de workspace fait temporairement tourner les deux couleurs. Pré | Nom | Défaut | Description | | ------------------------------ | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `SESSION_IDLE_TIMEOUT_MINUTES` | non défini | **Optionnel.** Déconnecte une session après ce nombre de minutes d'inactivité (`1`–`1440`). La fenêtre glisse à chaque activité et est appliquée côté serveur — sessions e-mail/mot de passe, SSO et trusted headers. | +| `SESSION_COOKIE_CACHE_SECONDS` | non défini | **Optionnel.** Permet à une requête de réutiliser sa session résolue depuis un cookie signé pendant au plus ce nombre de secondes (`1`–`300`), au lieu de lire la base. Sur une instance très sollicitée, cela économise la plupart des lectures d’authentification. En contrepartie, les changements de la session ou du compte n’atteignent les requêtes ordinaires qu’à l’expiration de la copie en cache (déconnexion sur un autre appareil, ou sessions fermées quand un mot de passe change ou qu’un admin révoque le passkey d’un membre ou réinitialise son authentification à double facteur). L’appartenance aux organisations est toujours lue à chaque requête, et les flux de mise à jour en direct ouverts revérifient la session en 15 secondes. Si `SESSION_IDLE_TIMEOUT_MINUTES` est défini, le cache est limité au quart de cette fenêtre ; la révocation pour inactivité en tient compte, si bien que le délai d’inactivité d’une organisation peut s’appliquer jusqu’à ce nombre de secondes plus tard. | Laisse-le non défini pour conserver la durée de session par défaut. Si défini, une session inactive expire côté serveur une fois la fenêtre écoulée, tandis qu'une session active continue de glisser à chaque requête. Les Administrateurs d'organisation peuvent raccourcir la fenêtre effective par organisation — jamais l'allonger au-delà de ce plafond — via la [politique de gouvernance du délai d'inactivité de session](/fr/platform/admin/governance/policies-and-limits) ; les sessions inactives sous cette politique sont révoquées par une passe qui tourne environ toutes les cinq minutes. @@ -246,17 +249,29 @@ Laisse-le non défini pour conserver la durée de session par défaut. Si défin Indique ici ton propre service d’assistance pour que les personnes confrontées à une erreur joignent l’équipe qui exploite ton déploiement. Quand l’écran d’erreur connaît l’organisation, le lien ajoute `organizationId=` à la chaîne de requête, après les paramètres que l’URL contient déjà, et remplace un paramètre `organizationId` qu’elle porte déjà. Toute autre valeur, par exemple `mailto:` ou une URL sans schéma, est ignorée avec un avertissement dans le journal du service `platform`, et le lien garde sa valeur par défaut. +## Point d’accès MCP {#mcp-endpoint} + +| Nom | Défaut | Description | +| --- | --- | --- | +| `TALE_MCP_ALLOWED_ORIGINS` | non défini | **Optionnel, lu par `backend-api` et le rôle `all`.** Les origines de navigateur depuis lesquelles le [point d’accès MCP](/fr/develop/mcp-endpoint) accepte, en plus de `SITE_URL` et `ADDITIONAL_SITE_URLS`, une requête qui porte un en-tête `Origin`. Séparées par des virgules ou des espaces, chacune au format `scheme://host[:port]` sans chemin, comme l’origine propre d’un éditeur de bureau, `vscode-file://vscode-app`. Une entrée mal formée empêche le démarrage du backend. | +| `TALE_MCP_ORIGIN_ENFORCE` | `false` | **Optionnel, lu par `backend-api` et le rôle `all`.** Avec `true`, le point d’accès refuse une requête de toute autre origine avec `403` et `ORIGIN_FORBIDDEN` ; avec `false`, il se contente de la journaliser. | + +Les agents de code lancés dans un terminal et les clients côté serveur n’envoient pas d’`Origin` : la vérification ne s’applique jamais à eux. Une page web d’un autre site en envoie une, et c’est avec une clé API placée dans une telle page que ce site atteindrait le point d’accès. Tant que la vérification n’est pas imposée, chaque requête venant d’une origine hors de la liste est journalisée comme `[mcp] origin-mismatch`, avec l’origine, l’organisation et la personne. Lis ces lignes pour savoir lesquels de tes clients envoient une origine avant de définir `TALE_MCP_ORIGIN_ENFORCE=true`, et ajoute leurs origines à `TALE_MCP_ALLOWED_ORIGINS`. + ## Infrastructure sandbox {#sandbox-infrastructure} Le spawner sandbox lit les paramètres ci-dessous. Transmets-les dans son environnement et recrée ce service après une modification. `SANDBOX_MAX_SESSIONS` fixe la capacité partagée par toutes les organisations. Le total des trois limites de travail d’une organisation se recalcule automatiquement ; tu ne peux pas enregistrer ces limites s’il dépasse cette capacité. Gère les limites dans [Sandboxes](/fr/platform/admin/sandboxes), où les environnements réellement actifs et les mesures de l’hôte apparaissent séparément des allocations. | Nom | Défaut | Description | | --- | --- | --- | -| `SANDBOX_MAX_SESSIONS` | dimensionnée selon la mémoire de l’hôte sur un hôte Docker local (au moins `8`, au plus `256`) ; `8` ailleurs | Nombre maximal de sessions actives ou au démarrage de toutes les organisations sur l’hôte Docker ou dans le namespace Kubernetes, y compris les conteneurs inactifs conservés pour être réutilisés. Cette capacité ne réserve ni CPU ni mémoire. Sans valeur, sur un hôte Docker dont le spawner peut lire la mémoire, elle est dimensionnée selon cette mémoire : une session par tranche de 768 MiB restant après `SANDBOX_MIN_FREE_MEMORY`, ou de 1,5 GiB quand les sessions d’agent font tourner Docker dans la sandbox. Si la mémoire ne peut pas être lue au démarrage, la capacité reste à `8` jusqu’à ce qu’elle le soit. Une valeur explicite la fixe. Des réplicas Kubernetes concurrents l’appliquent au mieux ; utilise ResourceQuota pour imposer des limites strictes aux ressources du namespace. | +| `SANDBOX_MAX_SESSIONS` | dimensionnée selon la mémoire et les CPU de l’hôte sur un hôte Docker local (au moins `8`, au plus `256`) ; `8` ailleurs | Nombre maximal de sessions actives ou au démarrage de toutes les organisations sur l’hôte Docker ou dans le namespace Kubernetes, y compris les conteneurs inactifs conservés pour être réutilisés. Cette capacité ne réserve ni CPU ni mémoire. Sans valeur, sur un hôte Docker dont le spawner peut lire la mémoire, elle est dimensionnée selon cette mémoire : une session par tranche de 768 MiB restant après `SANDBOX_MIN_FREE_MEMORY`, ou de 1,5 GiB quand les sessions d’agent font tourner Docker dans la sandbox, et au plus deux sessions par CPU que le daemon Docker annonce. Si la mémoire ne peut pas être lue au démarrage, la capacité reste à `8` jusqu’à ce qu’elle le soit. Une valeur explicite la fixe. Des réplicas Kubernetes concurrents l’appliquent au mieux ; utilise ResourceQuota pour imposer des limites strictes aux ressources du namespace. | | `SANDBOX_MIN_FREE_MEMORY` | un dixième de la mémoire de l’hôte, au moins `1g` | Mémoire qu’une nouvelle session ou une session libérée qui reprend du travail doit laisser libre sur un hôte Docker local, en plus de ce que les sessions encore au démarrage ou tout juste démarrées vont bientôt occuper. Si un démarrage en laissait moins, le spawner arrête d’abord une session libérée inactive ; si la mémoire manque encore, il répond « occupé » et le travail attend que des sessions en cours en libèrent. Accepte des tailles comme `2g` ou `1536m`. Sans effet sous Kubernetes ou avec un daemon Docker distant. | +| `SANDBOX_CPU_PRESSURE_PERCENT` | `60` | Pression CPU sur un hôte Docker local, en pourcentage, à partir de laquelle les nouvelles sessions et les sessions libérées qui reprennent du travail démarrent une à une : la part des dix dernières secondes pendant laquelle une tâche a attendu un CPU, telle que la rapporte l’information de blocage par pression (PSI) du noyau (`some avg10` de `/proc/pressure/cpu`). Au-delà, le spawner admet un démarrage toutes les dix secondes, dans l’ordre des demandes, et les autres attendent avec une réponse « occupé » ; le travail en cours n’est pas ralenti. `0` désactive ce contrôle. Un noyau sans PSI (compilé sans, ou démarré avec `psi=0`) laisse le CPU hors de l’admission, ce que le spawner journalise une fois. Sans effet sous Kubernetes ou avec un daemon Docker distant. | | `SANDBOX_MIN_FREE_DISK` | un vingtième de chaque disque, au moins `2g`, au plus `20g` | Espace libre requis pour les sessions nouvelles et réactivées sur le système de fichiers des espaces de travail et celui, vérifié, des données Docker. Sous ce seuil, le travail attend ; les caches de build arrêtés et inutilisés sont supprimés en premier. Accepte `10g` ou `4096m` ; `0` désactive le contrôle. Kubernetes dépend de sa classe de stockage et du provisionnement des volumes. | +| `SANDBOX_CRITICAL_FREE_DISK` | un quart du seuil `SANDBOX_MIN_FREE_DISK`, au moins `1g` et jamais au-dessus | Espace libre sous lequel le disque des sessions devient critique : ce que les sessions en cours y écrivent est sur le point d’échouer. En dessous, les sessions libérées et inactives avec Docker dans la sandbox sont arrêtées aussitôt, ce qui supprime leur stockage d’images interne, et le spawner journalise les trois plus grands espaces de travail au plus toutes les dix minutes. Accepte `2g` ou `2048m` ; une valeur au-dessus du seuil compte comme le seuil ; `0` désactive ce palier, tout comme un seuil de `0`. Backend Docker uniquement. | | `SANDBOX_DOCKER_WORKLOADS` | `project,workflow` | Types de travail autorisés à utiliser Docker dans leur sandbox, lorsque le déploiement le permet. Avec `project`, les agents de workflow démarrent sans Docker ; avec `workflow`, ce sont les agents de projet ; avec `none`, les deux. Le réglage s’applique aux nouvelles sessions ; les sessions existantes conservent leurs capacités. Une demande de session peut renoncer à Docker avec `docker: false`, mais ne peut pas dépasser cette liste ni le réglage du déploiement. | | `SANDBOX_AGENT_CPUS` | `2` | Limite de CPU par session d’agent. Tiens compte des builds simultanés et des autres tâches de l’hôte pour choisir le nombre de sessions. | +| `SANDBOX_AGENT_CPU_SHARES` | `256` | Poids CPU d’une session d’agent et des conteneurs auxiliaires du cache de build de son organisation tant que les CPU de l’hôte sont saturés, face à la valeur Docker par défaut de `1024` que gardent les services de la plateforme ; les sessions du profil `default` (exécutions de code, rendus de pages) utilisent `128`. Les sessions chargées laissent alors le CPU à la base de données et au backend au lieu de les bloquer ; sur un hôte où il reste du CPU, une session utilise toujours jusqu’à `SANDBOX_AGENT_CPUS`. Un nombre entier de `2` à `262144`. S’applique aux nouvelles sessions ; un conteneur auxiliaire en cours prend une nouvelle valeur aussitôt. | | `SANDBOX_AGENT_MEMORY` | `4g` ; `8g` avec Docker dans la sandbox | Limite de mémoire par session d’agent, partagée avec son daemon Docker interne et les conteneurs qu’il lance. Une valeur explicite remplace ces deux valeurs par défaut et s’applique aux nouvelles sessions. | | `SANDBOX_AGENT_PROFILE` | `agent` | Lu par l’API backend et le worker. Profil des nouveaux espaces d’agents et de workflows : `agent` prend en charge Docker interne ; `agent-light` conserve les outils de développement et l’espace persistant sans démarrer Docker ni les services de cache de build. Les espaces existants conservent leur profil enregistré. | | `TALE_SANDBOX_CLAUDE_EFFORT` | non défini (hérite de la valeur de l’environnement d’agent) | Lu par l’API backend et le worker. Effort de raisonnement de Claude Code : `low`, `medium`, `high` ou `max`. Les valeurs inférieures retirent l’instruction Ultrathink automatique et définissent l’effort par exécution, tout en gardant la réflexion adaptative. Les autres environnements d’agent et les modèles tiers restent inchangés. Compare des tâches représentatives avant de réduire l’effort ; des exécutions plus courtes ne sont pas garanties. | @@ -266,13 +281,22 @@ Le spawner sandbox lit les paramètres ci-dessous. Transmets-les dans son enviro | `SANDBOX_BUILDKITD_CPUS` | `SANDBOX_AGENT_CPUS` | Limite de CPU du conteneur auxiliaire du cache de build d’une organisation, qui exécute les builds d’images de toutes ses sessions d’agent quand Docker tourne dans la sandbox. Les conteneurs auxiliaires en cours prennent une nouvelle valeur aussitôt. Le nombre d’étapes parallèles du solveur BuildKit correspond à cette limite CPU arrondie à l’entier inférieur, avec un minimum de un ; cette limite s’applique à la recréation d’un conteneur auxiliaire inactif. | | `SANDBOX_BUILDKITD_MEMORY` | le double de `SANDBOX_AGENT_MEMORY` | Limite de mémoire du conteneur auxiliaire du cache de build d’une organisation, partagée par les builds que ses sessions d’agent lancent en même temps. Accepte des tailles comme `16g` ou `12288m`. Un conteneur auxiliaire en cours prend une nouvelle valeur quand il est recréé, dès qu’aucun build ne tourne. | | `SANDBOX_BUILDKITD_IDLE_CACHE` | `5g` | Cache de build que garde le conteneur auxiliaire du cache de build d’une organisation quand il s’arrête faute de sessions d’agent. Juste avant cet arrêt, le spawner réduit le cache à cette taille, en commençant par les entrées inutilisées depuis le plus longtemps : le nettoyage propre au cache ne tourne que tant que le conteneur auxiliaire tourne. Accepte des tailles comme `5g` ou `2048m` ; `0` ne garde rien. | +| `SANDBOX_BUILDKITD_MAX_CACHE` | un dixième du disque des sessions, au moins `1g`, au plus `20g` | Cache de build maximal que garde le conteneur auxiliaire du cache de build d’une organisation ; au-delà, les entrées inutilisées depuis le plus longtemps partent en premier. Sans valeur, la limite suit la taille du disque où se trouvent les espaces de travail des sessions, afin que de nombreuses organisations qui construisent des images n’en occupent pas ensemble plus qu’une part. Le plancher sous lequel le manque d’espace disque ne réduit jamais le cache vaut un dixième de cette limite, au plus 2 GiB. Accepte des tailles comme `8g` ou `40960m`, au moins `1g`. Un conteneur auxiliaire en cours prend une nouvelle valeur quand il est recréé, dès qu’aucun build ne tourne. | | `SANDBOX_BUILDKITD_PROVISION_TIMEOUT_MS` | `5000` | Budget total en millisecondes pour préparer le cache de build partagé facultatif lors de la création d’une session, y compris les appels Docker en attente et les miroirs de registres. Plage `100`–`60000`. À expiration du budget de préparation partagé, les appels en attente sont annulés et ne peuvent plus lancer de conteneurs auxiliaires ; la session utilise son builder local. | | `SANDBOX_BUILDKITD_CACHE_RETENTION` | `14d` | Durée pendant laquelle les conteneurs auxiliaires arrêtés du cache de build d’une organisation gardent leurs caches. Une fois le builder arrêté depuis plus longtemps, et si aucune session de l’organisation ne peut l’utiliser, le spawner supprime ses conteneurs auxiliaires, son réseau et ses volumes de cache, comme le fait la suppression d’une organisation ; son prochain build repart sans cache. Accepte des jours ou des heures entiers comme `14d` ou `336h` ; `off` (ou `0`) garde les caches jusqu’à la suppression de l’organisation. | -| `SANDBOX_SESSION_MAX_IDLE_MS` | `1800000` (30 min) | Délai d’inactivité avant l’arrêt des sessions non épinglées. Les conteneurs auxiliaires du cache de build d’une organisation s’arrêtent aussi après ce délai sans session potentiellement active ; leurs réseaux et volumes de cache sont conservés. | -| `SANDBOX_SESSION_RELEASED_IDLE_MS` | `300000` (5 min) | Délai d’inactivité d’une session libérée, c’est-à-dire dont la tâche ou l’exécution est terminée et qu’aucun autre travail n’occupe plus. Une session libérée et non épinglée, inactive pendant ce délai, est arrêtée sans attendre `SANDBOX_SESSION_MAX_IDLE_MS` ; le tour suivant la reprend sur son espace de travail conservé. Les sessions d’agent avec Docker dans la sandbox gardent le délai complet, car à chaque reprise leur daemon Docker interne repart d’un stockage d’images vide. | +| `SANDBOX_BUILDKITD_IDLE_MS` | `600000` (10 min) | Durée pendant laquelle les conteneurs auxiliaires du cache de build d’une organisation continuent de tourner une fois qu’aucune session d’agent de l’organisation qui construit des images ne peut plus les utiliser. Ils s’arrêtent ensuite et gardent le réseau et le volume de cache du builder, tandis que les miroirs de registre sont supprimés avec leurs caches ; le prochain build les relance, en redémarrant le conteneur arrêté s’il a été lancé avec l’image et les réglages actuels, et en le recréant sinon. Minimum `60000`. | +| `SANDBOX_PACKAGE_CACHE_RETENTION` | `14d` | Durée pendant laquelle les caches de paquets d’une organisation survivent à leur dernière utilisation : les caches de téléchargement de pip, uv, npm et bun que ses sandboxes partagent sur Docker (les sandboxes avec Docker à l’intérieur ne les utilisent pas). Une fois qu’aucune sandbox de l’organisation ne les a utilisés depuis ce délai, le spawner les supprime lors de sa prochaine vérification horaire ; la prochaine sandbox de l’organisation démarre avec des caches vides, et les installations prennent plus de temps jusqu’à ce qu’ils se remplissent à nouveau. Les caches antérieurs à ce réglage comptent à partir de la première vérification après la mise à jour. Accepte des jours ou des heures entiers comme `14d` ou `336h` ; `off` (ou `0`) garde les caches jusqu’à la suppression de l’organisation. | +| `SANDBOX_SESSION_MAX_IDLE_MS` | `1800000` (30 min) | Délai d’inactivité avant l’arrêt des sessions non épinglées. Les conteneurs auxiliaires du cache de build d’une organisation suivent plutôt `SANDBOX_BUILDKITD_IDLE_MS`. | +| `SANDBOX_SESSION_RELEASED_IDLE_MS` | `300000` (5 min) | Délai d’inactivité d’une session libérée, c’est-à-dire dont la tâche ou l’exécution est terminée et qu’aucun autre travail n’occupe plus. Une session libérée et non épinglée, inactive pendant ce délai, est arrêtée sans attendre `SANDBOX_SESSION_MAX_IDLE_MS` ; le tour suivant la reprend sur son espace de travail conservé. Les sessions d’agent avec Docker dans la sandbox gardent le délai complet dès que leur daemon Docker interne a tourné, car à chaque reprise il repart d’un stockage d’images vide ; une session dont le daemon n’a jamais démarré reçoit aussi ce délai plus court. | +| `SANDBOX_EXEC_STALL_MINUTES` | `45` | Durée pendant laquelle une commande d’une session peut ne rien afficher alors que ses processus utilisent moins de 1 % d’un CPU, avant que la sandbox ne l’arrête comme bloquée. Un agent bloqué, qui attend une connexion qui ne répond jamais ou une saisie que personne n’envoie, occuperait sinon sa session jusqu’à la limite de temps de son exécution. Le travail que la commande confie à des conteneurs qu’elle a démarrés dans la sandbox compte comme utilisation du CPU. Minutes entières jusqu’à `1440` ; `0` désactive la vérification. S’applique aux nouvelles sessions. | | `SANDBOX_RUNTIME_IMAGE` | `tale-sandbox-runtime:latest` | **Optionnel, lu par le spawner.** L'image dont sort chaque conteneur de session. Le défaut est le tag que la stack de développement construit localement ; un hôte qui tire ses images pose donc le nom de la registry : `ghcr.io/tale-project/tale/tale-sandbox-runtime:`, aligné sur le reste de la stack. `tale deploy` le pose pour toi. | | `SANDBOX_DIND_INNER_POOL` | non défini (automatique) | Pool d’adresses optionnel du daemon Docker interne des sessions d’agent, sur Docker ou Kubernetes. Choisis un `/16` IPv4 privé RFC1918 sous forme canonique, hors de tes réseaux de Pods, de Services et de VPC. Le runtime refuse tout chevauchement avec les réseaux et adresses qu’elle détecte. | +| `SANDBOX_K8S_DOCKER_STORAGE_SIZE_LIMIT` | `20Gi` | **Kubernetes uniquement.** La taille du stockage du Docker interne d’une session d’agent qui exécute Docker dans sa sandbox. Une session qui le dépasse est évincée ; dimensionne-le donc pour les plus grosses images que tes agents téléchargent et construisent. Les autres paramètres Kubernetes figurent dans [Déployer sur Kubernetes](/fr/self-hosted/install/kubernetes). | +| `SANDBOX_K8S_EPHEMERAL_STORAGE_REQUEST` / `SANDBOX_K8S_EPHEMERAL_STORAGE_LIMIT` | `256Mi` / `2Gi` | **Kubernetes uniquement.** L’espace disque du nœud qu’un Pod de session demande, et ce qu’il peut y écrire en dehors de son workspace temporaire et du stockage du Docker interne. La limite du Pod y ajoute ces stockages : une session qui la dépasse est évincée seule au lieu de remplir le nœud. | +| `SANDBOX_K8S_NODE_SELECTOR` / `SANDBOX_K8S_TOLERATIONS` | non défini | **Kubernetes uniquement.** Les labels de nœud auxquels chaque Pod de session doit correspondre, sous forme d’objet JSON comme `{"tale.dev/sandbox":"true"}`, et les taints qu’il tolère, sous forme de tableau JSON de tolérances de Pod : les sessions tournent ainsi sur leurs propres nœuds plutôt qu’à côté de la base de données et de la plateforme. Une valeur mal formée empêche le spawner de démarrer. | +| `SANDBOX_K8S_PRIORITY_CLASS` | non défini | **Kubernetes uniquement.** La PriorityClass de chaque Pod de session. Une classe inférieure à celle de la plateforme permet au planificateur de préempter des sessions pour placer les Pods de la plateforme. | | `SANDBOX_EGRESS_MAX_CLIENTS` | `2000` | **Lu par le service `sandbox-egress`**, pas par le spawner : recrée ce service après un changement. Connexions que le proxy egress sert en même temps pour toutes les sessions réunies ; avec la sortie transparente, chaque connexion sortante d’une session, de ses builds et de ses installations de paquets passe par lui. Au-delà de la limite, le proxy refuse les nouvelles connexions, et les installations et chargements de pages échouent sur des connexions réinitialisées. Chaque connexion occupe un thread et deux fichiers ouverts, donc les fichiers Compose fournis dimensionnent les limites de processus et de fichiers ouverts du proxy pour la valeur par défaut ; une valeur plus haute demande aussi des limites plus hautes, et le proxy avertit au démarrage quand sa limite de fichiers ouverts est trop basse. Au démarrage, le proxy relève sa limite de fichiers ouverts à ce dont les connexions ont besoin, dans la mesure où la limite stricte du conteneur le permet. Sous Kubernetes, pose-la sur le Deployment egress ; une spécification de Pod ne fixe aucune limite de processus, donc le `podPidsLimit` du nœud doit laisser la place d’un thread par connexion. | +| `SANDBOX_EGRESS_MAX_CONNECTIONS_PER_SESSION` | `256` | **Lu par le service `sandbox-egress`**, pas par le spawner : recrée ce service après un changement. Connexions qu’une session peut garder ouvertes en même temps vers le proxy egress, comptées par son adresse, pour qu’une seule session ne prenne pas aux autres toute la réserve de `SANDBOX_EGRESS_MAX_CLIENTS` ; les conteneurs auxiliaires du cache de build de chaque organisation ont leurs propres adresses. Une connexion au-delà de la limite est refusée aussitôt par une réinitialisation, et les autres connexions de la session continuent. `0` désactive la limite, et une valeur qui n’est pas un nombre entier empêche le proxy de démarrer. Le proxy installe la limite comme règle de pare-feu au démarrage ; sur un noyau sans la correspondance `connlimit`, il démarre sans elle et consigne un avertissement. Sous Kubernetes, pose-la sur le Deployment egress ; là où le réseau du cluster réécrit les adresses source des sessions, de sorte qu’elles atteignent le proxy depuis une même adresse, elles partagent une seule limite, alors mets `0` dans ce cas. | Les réglages backend ci-dessus doivent parvenir à l’API et au worker. Recrée ces services après une modification. Le spawner vérifie aussi la mémoire et le disque lors de la reprise d’une session libérée : un espace déjà démarré peut donc attendre de la capacité. @@ -300,7 +324,7 @@ Les sessions Kubernetes utilisent `/readyz` pour le démarrage et `/livez` pour Une génération déjà active n’est pas comptée une seconde fois. Un workflow sans Docker interne garde l’identité et les outils de son agent, mais ne démarre aucun daemon Docker et ne maintient pas les conteneurs auxiliaires du cache de build en activité. Sans valeur explicite pour `SANDBOX_AGENT_MEMORY`, chaque session a une limite par défaut de `4g` sans Docker interne ou de `8g` avec Docker, même si d’autres sessions du déploiement utilisent Docker. Une valeur explicite s’applique aux deux modes. Ces limites sont des plafonds, pas de la mémoire réservée. -À pleine capacité, le spawner peut arrêter une session inactive, libérée et non épinglée avant le délai d’inactivité pour accepter un nouveau travail, en commençant par celle qui est inactive depuis le plus longtemps. Le daemon doit confirmer qu’aucun travail n’est en cours ; les sessions occupées ou dont l’état est inconnu restent protégées. L’arrêt conserve le répertoire ou le volume persistant de l’espace de travail. Sans session à récupérer en toute sécurité, la capacité du déploiement continue de bloquer les nouveaux démarrages. Il en va de même lorsque la mémoire libre de l’hôte passerait sous `SANDBOX_MIN_FREE_MEMORY`. Tant que le disque qui contient les espaces de travail des sessions reste sous `SANDBOX_MIN_FREE_DISK`, le nouveau travail attend sans que des sessions inactives soient arrêtées : une session arrêtée garde son espace de travail. +À pleine capacité, le spawner peut arrêter une session inactive, libérée et non épinglée avant le délai d’inactivité pour accepter un nouveau travail, en commençant par celle qui est inactive depuis le plus longtemps. Le daemon doit confirmer qu’aucun travail n’est en cours ; les sessions occupées ou dont l’état est inconnu restent protégées. L’arrêt conserve le répertoire ou le volume persistant de l’espace de travail. Sans session à récupérer en toute sécurité, la capacité du déploiement continue de bloquer les nouveaux démarrages. Il en va de même lorsque la mémoire libre de l’hôte passerait sous `SANDBOX_MIN_FREE_MEMORY`. Tant que le disque qui contient les espaces de travail des sessions reste sous `SANDBOX_MIN_FREE_DISK`, le nouveau travail attend sans que des sessions inactives soient arrêtées : une session arrêtée garde son espace de travail. Ce n’est que sous `SANDBOX_CRITICAL_FREE_DISK` que le spawner arrête aussitôt les sessions libérées et inactives avec Docker dans la sandbox, car leur arrêt supprime leur stockage d’images interne. Les enregistrements du protocole des environnements d’agent, y compris les lignes inachevées, sont limités à 8 Mio. Une sortie trop volumineuse ou incomplète provoque un échec explicite ; l’aperçu de progression borné n’est jamais considéré comme un résultat structuré complet. Les réponses finales complètes sont conservées séparément de cet aperçu. @@ -310,7 +334,7 @@ Lorsque Docker est activé dans les sandboxes d’agent, le daemon démarre auto ### Dimensionner la capacité des sessions -Sans `SANDBOX_MAX_SESSIONS` sur un hôte Docker, le spawner dimensionne la capacité selon la mémoire de l’hôte (un hôte de 16 GiB obtient 19 sessions, un hôte de 64 GiB en obtient 76 ; 9 et 38 quand les sessions d’agent font tourner leur propre daemon Docker) et n’admet une nouvelle session que si l’hôte garde `SANDBOX_MIN_FREE_MEMORY` de libre, en comptant ce que les sessions encore au démarrage ou tout juste démarrées vont bientôt occuper. Un pic de nouvelles sessions qui surchargerait l’hôte attend donc au lieu de démarrer ; ce contrôle n’empêche pas les sessions déjà lancées de continuer à grandir. Fixe toi-même la capacité sous Kubernetes, avec un daemon Docker distant ou si l’hôte fait aussi tourner d’autres charges gourmandes : teste alors les tâches que ton déploiement exécutera en même temps. Le rendu dans le navigateur et les builds Docker n’ont pas les mêmes pics de charge ; inclus les agents, les workflows et l’exploration de toutes les organisations. Une place libre ne garantit pas des ressources suffisantes. +Sans `SANDBOX_MAX_SESSIONS` sur un hôte Docker, le spawner dimensionne la capacité selon la mémoire et les CPU de l’hôte (une session par tranche de 768 MiB au-delà de la réserve, au plus deux par CPU : un hôte de 16 GiB avec 8 CPU obtient 16 sessions, un hôte de 64 GiB avec 16 CPU en obtient 32 ; un hôte de 16 GiB en obtient 9 quand les sessions d’agent font tourner leur propre daemon Docker) et n’admet une nouvelle session que si l’hôte garde `SANDBOX_MIN_FREE_MEMORY` de libre, en comptant ce que les sessions encore au démarrage ou tout juste démarrées vont bientôt occuper. Un pic de nouvelles sessions qui surchargerait l’hôte attend donc au lieu de démarrer ; ce contrôle n’empêche pas les sessions déjà lancées de continuer à grandir. Quand le CPU de l’hôte est sous pression (`SANDBOX_CPU_PRESSURE_PERCENT`), les nouvelles sessions démarrent de même une à une au lieu d’alourdir la charge. Chaque exécution d’agent de projet qui travaille en même temps qu’une autre prend sa propre session, un worker d’agent : un agent qui travaille sur trois tâches à la fois fait tourner trois sessions, chacune avec sa propre limite `SANDBOX_AGENT_MEMORY`. Ces deux réglages bornent donc la quantité de travail d’agent menée en parallèle. Fixe toi-même la capacité sous Kubernetes, avec un daemon Docker distant ou si l’hôte fait aussi tourner d’autres charges gourmandes : teste alors les tâches que ton déploiement exécutera en même temps. Le rendu dans le navigateur et les builds Docker n’ont pas les mêmes pics de charge ; inclus les agents, les workflows et l’exploration de toutes les organisations. Une place libre ne garantit pas des ressources suffisantes. Sous Docker, relève la consommation pendant que des tâches représentatives s’exécutent en parallèle. Répète cette commande pendant l’exécution ; une mesure au repos ne montre pas les pics des tâches : @@ -346,17 +370,23 @@ La capacité par défaut était de 16, et les organisations créées avant cette À partir de cette version, un déploiement Docker qui n’a jamais défini `SANDBOX_MAX_SESSIONS` obtient une capacité dimensionnée selon la mémoire de son hôte au lieu de 8, jamais moins de 8. Il peut admettre plus de sessions à la fois qu’avant, et seulement tant que l’hôte a de la mémoire disponible. Définis une valeur explicite pour garder une capacité fixe. +Cette capacité dimensionnée compte désormais aussi au plus deux sessions par CPU : un hôte avec beaucoup de mémoire et peu de CPU obtient donc moins de sessions qu’avant (un hôte de 16 GiB avec 4 CPU : 8 au lieu de 19). Quand le CPU de l’hôte est sous pression, les nouvelles sessions démarrent en outre une à une (`SANDBOX_CPU_PRESSURE_PERCENT`, `0` désactive ce comportement). Une valeur explicite de `SANDBOX_MAX_SESSIONS` reste inchangée. + ### Caches de build Docker La préparation du cache de build partagé utilise `SANDBOX_BUILDKITD_PROVISION_TIMEOUT_MS` (5 secondes par défaut). Chaque session attend au plus cette durée ou un quart de son budget total de démarrage si ce délai est plus court, puis utilise son builder local. La préparation partagée a son propre budget borné : annuler l’attente d’une session n’annule pas la préparation destinée aux autres sessions, et un résultat tardif ne se rattache pas à une session déjà passée au builder local. Les miroirs de registry sont préparés en parallèle. Le nombre d’étapes simultanées du builder partagé correspond à sa limite CPU arrondie à l’entier inférieur, avec un minimum de un ; sa limite de mémoire reste applicable. Le temps de préparation est déduit du budget de démarrage restant de la session. -Les caches de build Docker sont isolés par organisation. Chaque organisation utilise un builder privilégié et trois miroirs de registre sans privilèges élevés. Dès qu’aucune session ne peut encore les utiliser, le délai d’inactivité commence ; les conteneurs auxiliaires s’arrêtent ensuite. Le prochain build les redémarre avec leurs volumes de cache conservés. Juste avant l’arrêt du builder, le spawner réduit son cache à `SANDBOX_BUILDKITD_IDLE_CACHE`, car son nettoyage ne tourne que tant qu’il tourne. Le cache d’une organisation arrêtée n’est plus réduit ensuite ; après `SANDBOX_BUILDKITD_CACHE_RETENTION` (14 jours) sans build, ses conteneurs auxiliaires et ses caches sont supprimés, et sinon ils partent avec l’organisation. Tant que le disque des sessions reste sous `SANDBOX_MIN_FREE_DISK`, les caches des organisations arrêtées partent plus tôt, en commençant par celles arrêtées depuis le plus longtemps. Les réseaux et les volumes restent disponibles pour être réutilisés. Les sessions Kubernetes utilisent leur propre builder Docker interne ; la réconciliation Kubernetes n’appelle pas la CLI Docker pour ces conteneurs auxiliaires. +Les caches de build Docker sont isolés par organisation. Chaque organisation utilise un builder privilégié et trois miroirs de registre sans privilèges élevés. Dès qu’aucune session ne peut encore les utiliser, les conteneurs auxiliaires s’arrêtent après `SANDBOX_BUILDKITD_IDLE_MS` (10 minutes), et les miroirs de registre sont supprimés avec leurs caches, car le cache du builder garde les couches de base que ses builds ont utilisées. Le prochain build redémarre le builder avec son volume de cache conservé et recrée les miroirs. Juste avant l’arrêt du builder, le spawner réduit son cache à `SANDBOX_BUILDKITD_IDLE_CACHE`, car son nettoyage ne tourne que tant qu’il tourne. Le cache d’une organisation arrêtée n’est plus réduit ensuite ; après `SANDBOX_BUILDKITD_CACHE_RETENTION` (14 jours) sans build, ses conteneurs auxiliaires et ses caches sont supprimés, et sinon ils partent avec l’organisation. Tant que le disque des sessions reste sous `SANDBOX_MIN_FREE_DISK`, les caches des organisations arrêtées partent plus tôt, en commençant par celles arrêtées depuis le plus longtemps. Le réseau et le volume de cache du builder restent disponibles pour être réutilisés. Les sessions Kubernetes utilisent leur propre builder Docker interne ; la réconciliation Kubernetes n’appelle pas la CLI Docker pour ces conteneurs auxiliaires. Le spawner remplit le premier pool d’adresses Docker disponible avec les réseaux d’organisation avant de passer au suivant. Par défaut, chaque réseau reçoit un `/23` de 512 adresses ; un `/16` entièrement libre peut donc accueillir 128 réseaux d’organisation. Les sous-réseaux plus petits configurés dans Docker gardent leur taille. Le spawner exclut les réseaux Docker existants, les routes et les adresses des serveurs DNS de l’hôte du daemon Docker, ainsi que `172.31.0.0/16` pour les anciennes images de runtime, puis vérifie le réseau créé. Pour observer l’hôte du daemon même avec Docker à distance, le spawner lance brièvement l’image BuildKit configurée dans le namespace réseau de l’hôte. Ce conteneur utilise un système de fichiers en lecture seule, sans capacités Linux ni montages. Si cette observation échoue ou qu’aucun sous-réseau sûr ne reste disponible, les sessions construisent localement sans cache partagé. Le spawner recrée un réseau inutilisé qui lui appartient si son sous-réseau est invalide ; il conserve les réseaux utilisés ou appartenant à un autre propriétaire. -Une mise à niveau crée des caches d’organisation vides et conserve les anciennes données globales. Les anciens conteneurs auxiliaires s’arrêtent automatiquement dès qu’aucune session active n’en dépend. Laisse se terminer les anciennes sessions épinglées ou arrête-les pour achever la transition ; jusque-là, l’ancien service de cache partagé reste accessible. L’automatisation du navigateur utilise Chromium sans interface graphique. La vue en direct et la prise de contrôle manuelle ont été retirées. +Une mise à niveau crée des caches d’organisation vides et conserve pour l’instant les anciennes données globales. Les anciens conteneurs auxiliaires s’arrêtent automatiquement dès qu’aucune session active n’en dépend. Une fois qu’ils sont arrêtés depuis plus de `SANDBOX_BUILDKITD_CACHE_RETENTION` (14 jours) et qu’aucune session n’en dépend toujours, le spawner supprime ces conteneurs auxiliaires et les quatre anciens volumes de cache (`tale-buildkitd-cache` ainsi que `tale-buildkitd-mirror-cache-docker-io`, `-ghcr-io`, `-quay-io`), chacun seulement tant qu’il porte l’ancienne étiquette du cache de build sans organisation, et journalise chaque suppression ; `off` les garde. Laisse se terminer les anciennes sessions épinglées ou arrête-les pour achever la transition ; jusque-là, l’ancien service de cache partagé reste accessible. L’automatisation du navigateur utilise Chromium sans interface graphique. La vue en direct et la prise de contrôle manuelle ont été retirées. + +### Images du moteur Docker interne + +Quand le cache de build partagé est actif, le moteur Docker interne d’une session télécharge les images Docker Hub via le miroir de registre docker.io de son organisation, le même cache que ses builds, et revient à Docker Hub quand ce miroir ne tourne pas. Les images des autres registres sont téléchargées directement. Un moteur interne qui devient inactif avec plus de 10 GiB d’images et de cache de build supprime d’abord ses images orphelines et réduit son cache de build aux 5 GiB utilisés le plus récemment ; les images nommées, les conteneurs et les volumes restent. Sur Kubernetes, c’est la limite de taille du volume du stockage interne qui le borne quand elle est inférieure à 10 GiB. ### Réseaux Docker internes @@ -423,11 +453,26 @@ Si tu utilises ton propre proxy au lieu du proxy fourni, transmets `/sandbox/tun | Nom | Défaut | Description | | -------------------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `TALE_EXTERNAL_TURN_DEADLINE_MS` | `1800000` (30 min) | **Optionnel.** Combien de temps un tour d’agent de code en sandbox (Claude Code, OpenCode, Codex) peut rester sans que personne ne lise sa sortie avant que le daemon de la sandbox ne le récupère. Une fenêtre glissante, relancée chaque fois que la plateforme se rattache à la sortie — pas un plafond absolu sur le tour. En millisecondes. | +| `TALE_EXTERNAL_TURN_DEADLINE_MS` | `1800000` (30 min) | **Optionnel.** Combien de temps un tour d’agent de code en sandbox (Claude Code, OpenCode, Codex) peut rester sans que personne ne lise sa sortie avant que le daemon de la sandbox ne le récupère. Une fenêtre glissante, relancée chaque fois que la plateforme se rattache à la sortie — pas un plafond absolu sur le tour. Un tour d’agent en cours attend aussi un service sandbox injoignable avant d’échouer : un tiers de cette valeur, 10 minutes au plus (exactement 10 minutes avec la valeur par défaut). Si tu baisses cette valeur, cette attente raccourcit. En millisecondes. | | `SANDBOX_LLM_GATEWAY_STREAM_IDLE_TIMEOUT_SECONDS` | `600` (10 min) | **Optionnel.** Combien de temps la passerelle de modèles de la sandbox attend l’octet suivant d’un modèle en amont resté silencieux avant d’interrompre le flux, y compris pendant qu’un modèle local lent traite encore un long prompt. Le backend lit cette valeur et s’en sert pour configurer la passerelle. Les tours Claude Code et Codex attendent au moins aussi longtemps avant d’abandonner un flux silencieux et de renvoyer la requête. Tu peux donc l’augmenter pour un modèle local lent sans que l’un d’eux envoie un tour en double. En contrepartie, un modèle en amont bloqué retient aussi un tour plus longtemps avant que la passerelle n’interrompe le flux. Une valeur supérieure à 600 relève aussi d’autant le délai de requête de la passerelle : il borne une réponse entière non diffusée en flux, sur laquelle un agent se replie quand un flux s’interrompt, ainsi que le temps qu’un modèle en amont peut mettre à commencer une réponse en flux. En secondes. | +| `SANDBOX_LLM_GATEWAY_PROVIDER_CONCURRENCY` | `512` | **Optionnel.** Combien de requêtes la passerelle de modèles de la sandbox envoie à la fois à un fournisseur intégré (OpenAI, Anthropic, OpenRouter et les autres fournisseurs que la passerelle implémente elle-même), que toutes les organisations partagent. Le backend lit cette valeur et s’en sert pour configurer la passerelle. La passerelle garde autant de workers pour chaque fournisseur, qu’il soit appelé ou non : une valeur plus élevée coûte donc de la mémoire à la passerelle. Une requête qui trouve tous les workers occupés attend dans une file 16 fois plus longue. Un nombre entier de 1 à 5 000. | +| `SANDBOX_LLM_GATEWAY_CUSTOM_PROVIDER_CONCURRENCY` | `64` | **Optionnel.** La même chose pour un fournisseur personnalisé. Le backend en crée un dans la passerelle pour chaque organisation et chaque modèle, le nombre de ces fournisseurs croît donc avec les organisations et les modèles, et chacun garde ses workers comme un fournisseur intégré. La voie Anthropic d’un fournisseur intégré pour les environnements d’agent (Claude Code via l’endpoint Anthropic d’OpenRouter) reçoit son propre fournisseur par organisation et par modèle, dimensionné par cette valeur. Les sessions sandbox d’une organisation ont rarement plus de quelques appels de modèle en cours à la fois sur un même modèle. Augmente cette valeur quand les clés API d’une organisation envoient plus de requêtes à la fois à un même modèle personnalisé. Un nombre entier de 1 à 5 000. | +| `SANDBOX_LLM_GATEWAY_LOG_RETENTION_DAYS` | `3` | **Optionnel.** Combien de jours la passerelle de modèles de la sandbox conserve son journal des requêtes : une ligne par appel de modèle avec le modèle, les jetons, le coût et la durée, jamais un prompt ni une réponse. Tale ne lit pas ce journal. Les budgets, les dépenses et l’utilisation viennent des compteurs de budget des clés de la passerelle, donc un journal plus court n’en change aucun. Le backend transmet la valeur à la passerelle, qui l’applique à son premier redémarrage après que le backend la lui a transmise : elle supprime alors les lignes plus anciennes, puis environ une fois par jour. Un `tale deploy` redémarre la passerelle avant que le nouveau backend ne transmette la valeur ; une valeur modifiée s’applique donc à partir du déploiement suivant. Pour l’appliquer plus tôt, redémarre une fois le service `sandbox-llm-gateway` après le démarrage de la première session sandbox. Le stockage réutilise leur place au lieu de continuer à grossir. Un nombre entier de jours, au moins 1 ; le backend ignore toute autre valeur et l’indique par un avertissement dans son journal. | Cherche pourquoi la sortie n’est plus lue avant d’augmenter ce délai. Il limite les flux de sortie abandonnés, pas la durée totale d’une tâche. Recrée les rôles backend concernés après avoir changé l’environnement. +Un nombre de workers modifié atteint chaque fournisseur la prochaine fois qu’une organisation qui l’utilise démarre une session sandbox ou appelle les endpoints de modèles. Un nombre plus bas atteint aussi tous les autres fournisseurs que la passerelle garde : après un redémarrage, le backend les redimensionne deux à cinq minutes après sa première session sandbox ou sa première requête aux endpoints de modèles. + +Un fournisseur dont l’hôte en amont ne se résout plus, comme celui d’un connecteur supprimé ou d’un hôte que tu as retiré de ton réseau, fait exception : la passerelle refuse de le réécrire, il garde donc ses workers, et le backend journalise après chaque redémarrage un avertissement qui le nomme. Supprime un tel fournisseur de la passerelle. Un fournisseur encore utilisé est recréé à sa prochaine session sandbox ou à sa prochaine requête aux endpoints de modèles. Envoie la requête depuis un conteneur backend, qui joint la passerelle et connaît son mot de passe administrateur ; sur un hôte `tale deploy`, son nom contient `-backend-api` : + +```bash +docker exec sh -c 'curl -fsS -X DELETE -u "${SANDBOX_LLM_GATEWAY_ADMIN_USERNAME:-admin}:$SANDBOX_LLM_GATEWAY_ADMIN_PASSWORD" "${SANDBOX_LLM_GATEWAY_URL:-http://sandbox-llm-gateway:8080}/api/providers/"' +``` + +Sur Kubernetes, utilise `kubectl exec -n tale deploy/backend-api --` à la place de `docker exec `. + +La passerelle démarre les workers de tous ses fournisseurs pendant son démarrage, avant que le backend puisse la joindre. Des fournisseurs enregistrés avec plus de workers que ces valeurs (la valeur par défaut de la passerelle elle-même est de 1 000) peuvent demander plus de mémoire que sa limite, 512 Mio avec `tale deploy` et dans le manifeste Kubernetes, et la passerelle est alors arrêtée à chaque démarrage. Ne supprime pas son volume, qui contient son compte administrateur et les clés qu’elle a émises. Augmente plutôt la limite jusqu’à ce que la passerelle démarre : sur un hôte `tale deploy`, lance `docker update --memory 2g --memory-swap 2g ` pour le conteneur dont le nom se termine par `-sandbox-llm-gateway` ; sur Kubernetes, augmente `resources.limits.memory` de son Deployment. Démarre ensuite une session sandbox ou appelle les endpoints de modèles, puis attends la ligne `[llm-gateway] provider worker resize finished` dans le journal du backend, qui arrive deux à cinq minutes plus tard. Elle compte les fournisseurs que le backend a redimensionnés, ceux que la passerelle a refusés et ceux que le backend n’a pas pu confirmer. Un fournisseur refusé ou non confirmé garde ses workers, et un avertissement avant cette ligne le nomme ; un backend redémarré réessaie un fournisseur non confirmé. Avant de rétablir la limite, supprime comme décrit plus haut un fournisseur refusé dont l’hôte en amont ne se résout plus. Rétablis ensuite la limite avec `docker update --memory 512m --memory-swap 1g ` puis `docker restart `, ou, sur Kubernetes, la valeur d’origine du Deployment. + ## Ingestion de liens vidéo (yt-dlp) Le worker utilise ces valeurs pour récupérer les transcriptions vidéo. Son image comprend yt-dlp et un plugin de jetons PO. [Importation vidéo](/fr/self-hosted/configuration/video-ingestion) distingue les restrictions de source, les problèmes de sortie réseau et les sessions autorisées. Recrée le worker après une modification de son environnement ; relire une variable dans un processus ne recharge pas `.env`. diff --git a/docs/fr/self-hosted/install/cli-install.md b/docs/fr/self-hosted/install/cli-install.md index d9a5650c8f..9cb7357614 100644 --- a/docs/fr/self-hosted/install/cli-install.md +++ b/docs/fr/self-hosted/install/cli-install.md @@ -14,8 +14,8 @@ Pour ta première instance, suis le [démarrage rapide](/fr/self-hosted/install/ Il te faut : - Un ordinateur sous macOS, Linux ou Windows avec PowerShell. -- Pour les conteneurs en local : Docker avec Compose et un daemon Docker en cours d’exécution. -- Pour un workspace distant : l’accès à son daemon Docker, généralement par un contexte Docker SSH. Le compte utilisé sur l’hôte distant doit pouvoir exécuter Docker. +- Pour les conteneurs en local : Docker Engine 24.0 ou une version ultérieure avec Compose et un daemon Docker en cours d’exécution. Les couches des images Tale sont compressées en zstd, ce que Docker sait récupérer à partir d’Engine 23.0 ; `tale doctor` signale un moteur plus ancien, et `tale dev` comme `tale deploy` le refusent avant de télécharger les images. +- Pour un workspace distant : l’accès à son daemon Docker, avec Docker Engine 24.0 ou une version ultérieure, généralement par un contexte Docker SSH. Le compte utilisé sur l’hôte distant doit pouvoir exécuter Docker. Le stockage objet fourni n’existe actuellement qu’en image `linux/amd64`. Sur un hôte ARM64, le développement local et les déploiements de workspace nécessitent donc une émulation amd64 fonctionnelle : Docker Desktop l’inclut ; sur un hôte Linux avec Docker autonome, [QEMU doit être enregistré sur l’hôte](https://docs.docker.com/build/building/multi-platform/#install-qemu-manually). Tale sélectionne l’image amd64, mais n’installe pas l’émulation. Les bundles de déploiement géré exigent toujours des images natives pour l’architecture déclarée. Un déploiement géré ARM64 doit donc attendre une image native du stockage objet. @@ -99,12 +99,12 @@ Les commandes se terminent avec `0` en cas de succès, `2` pour une erreur d'uti ### Installation -`tale doctor` — examine les prérequis d’un démarrage local sans créer de projet, installer de logiciel ni modifier la configuration. La commande vérifie le daemon Docker, la prise en charge de Compose et le mode de conteneurs Linux, indique l’architecture du daemon et examine les ports locaux. Avec un contexte Docker distant, elle ignore les ports locaux. Examine les avertissements sur ARM64 et les ports occupés ; une instance existante peut déjà utiliser le port. +`tale doctor` — examine les prérequis d’un démarrage local sans créer de projet, installer de logiciel ni modifier la configuration. La commande vérifie le daemon Docker, la version de Docker Engine, la prise en charge de Compose et le mode de conteneurs Linux, indique l’architecture du daemon et examine les ports locaux. Avec un contexte Docker distant, elle ignore les ports locaux. Examine les avertissements sur ARM64 et les ports occupés ; une instance existante peut déjà utiliser le port. - `-p, --port ` — port HTTPS à vérifier (par défaut `443`) ; le port sandbox `8003` est aussi vérifié. - `--json` — produit les résultats en JSON lisible par machine. -Un échec lié à Docker, Compose, à un mode de conteneurs non pris en charge ou au choix du port HTTPS `8003` renvoie le code `3`. Les avertissements seuls renvoient `0` ; cela ne vérifie ni les téléchargements d’images, ni la capacité de stockage, ni le fournisseur de modèles. Vérifie un autre port avec `tale doctor --port 8443`, puis utilise le même port avec `tale dev`. +Un échec lié à Docker, Compose, à un Docker Engine antérieur à la version 24.0, à un mode de conteneurs non pris en charge ou au choix du port HTTPS `8003` renvoie le code `3`. Les avertissements seuls renvoient `0` ; cela ne vérifie ni les téléchargements d’images, ni la capacité de stockage, ni le fournisseur de modèles. Vérifie un autre port avec `tale doctor --port 8443`, puis utilise le même port avec `tale dev`. `tale init [directory]` — créer un projet : crée les configs d'exemple, `AGENTS.md` + un pointeur `CLAUDE.md` et un `.env` local par défaut (localhost, certificat auto-signé, secrets générés). Aucun Docker requis ; le domaine de production et le TLS sont choisis plus tard, lors de `tale deploy`. Dans un terminal, il demande un nom de projet quand `directory` est omis, confirme avant d'écraser un projet existant, et demande une fois si les agents peuvent lancer `docker` dans les sandboxes (par défaut : non — l'activer fait tourner un Docker interne privilégié) ; les exécutions non interactives sautent toutes les questions. `directory` est optionnel (par défaut : le répertoire courant). @@ -300,6 +300,14 @@ Les observations Docker et HTTPS ont chacune une limite d’annulation et partag Les anciens bundles restent déployables, mais cette vérification exige un inventaire des migrations issu du source et des serveurs compatibles qui publient leur identité de processus. Prépare un bundle vérifié et termine son déploiement par le parcours habituel avant de recueillir son reçu d’acceptation. Le reçu atteste l’état observé à son horodatage ; il ne garantit pas le routage ni l’état ultérieur des serveurs. Relance la vérification quand il te faut des preuves actuelles. +#### Observer l’état conservé avant un déploiement + +`tale --json deploy observe --spec --cli-ref --deployment-ref --machine-id-sha256 ` recueille les identités des images en service, les inventaires de migrations, les métadonnées du corpus et de l’espace disque, ainsi que les preuves de configuration native conservées. Exécute la CLI compilée à la révision fixée sur l’hôte Linux vérifié, avec son socket Docker local. Fournis le JSON privé sur stdin sous la forme `{"environment":{"UPPERCASE_ENV_NAME":"value"}}`, avec uniquement les variables nécessaires à la spécification examinée. Les variables ambiantes ne servent pas de recours. L’entrée est limitée à 64 KiB, 128 clés et 8192 octets par valeur. + +La commande réutilise les identifiants existants et les IDs exacts du compte et de l’organisation conservés. Elle lit les fichiers des packs sans les recompiler, vérifie les versions natives actuelles, les fichiers et les propriétaires des skills inclus, puis contrôle à nouveau l’état des fichiers et l’identité des conteneurs. Elle crée uniquement des fichiers temporaires et des sessions d’authentification, puis supprime ces fichiers et ferme les sessions. Elle ne crée aucune identité, ne prépare ni n’applique de configuration, ne migre rien, ne redémarre rien, ne purge aucune ressource et ne prend pas le verrou de bascule. Les lectures Docker et natives sont limitées ; supervise le processus extérieurement pour borner aussi les attentes du système de fichiers. + +Une observation complète renvoie `ok:true` et `data.complete:true`. Si les preuves anciennes d’état ou de propriété manquent, le rapport conserve les faits disponibles sur l’hôte et les bases avec `ok:false`, `data.complete:false`, un code de motif prédéfini et le code de sortie `3`. Garde ce rapport pour l’enquête. Une entrée invalide, des identités différentes ou un état modifié font refuser l’observation. Aucun résultat ne constitue une acceptation Ready, une autorisation de bascule ou une preuve que les packs survivront à un futur déploiement. Utilise le processus normal de déploiement examiné et d’acceptation pour ces décisions. + #### Configurer l’identité native `deploy provision [--bundle ]` est la phase locale au backend du déploiement du bundle. Elle lit au maximum 64 KiB de JSON privé sur stdin, vérifie le compte local et l’organisation sélectionnée, puis ferme la session avant d’annoncer le succès. Ses champs comprennent `origin`, `email`, `password`, `slug`, `name`, `ssoEnabled`, les identifiants Entra optionnels et `nativeClients`. Par défaut, le compte existant reste requis. Un `identity.bootstrap: "fresh"` explicite autorise la création du premier compte local et de l’organisation. Un bundle lie ce choix et les configurations préparées avant toute modification native. `deploy provision` refuse les options de workspace et `--dry-run` ; utilise les vérifications en lecture seule. Les attentes optionnelles `--cli-ref` et `--deployment-ref` exigent `--bundle` et sont contrôlées avant connexion. @@ -414,6 +422,10 @@ Utilise `agent-tools` pour gérer uniquement les autorisations d’outils d’un Pour appliquer cette ressource, tu dois pouvoir modifier le projet actif, et l’agent ne doit pas être géré par la plateforme. Les membres peuvent lire cette configuration limitée. Tous les autres champs restent inchangés, y compris les instructions, le modèle et les autorisations exactes d’accès aux secrets. Le hash natif refuse les modifications concurrentes des outils ; une sélection modifiée invalide aussi les enregistrements complets d’agent fondés sur un état périmé. Une sélection équivalente ne change ni horodatage ni entrée d’audit. Si le runtime ne prend pas en charge la capacité demandée, il refuse l’opération. Relis les outils après l’application et conserve le reçu en attente pour reprendre une application interrompue. +Utilise `agent-model` pour choisir la configuration d’exécution des prochains démarrages d’un agent existant. Son objet `config` exige les valeurs exactes de `projectId` et `agentId`, ainsi que `harness`, `model` et un `modelProvider` explicitement choisi dans le catalogue natif. La plateforme vérifie cette combinaison et les identifiants disponibles ; elle ne choisit jamais un autre fournisseur. Les mêmes droits de modification du projet et la même restriction concernant les agents gérés par la plateforme s’appliquent. Les instructions, outils, compétences, connecteurs et autorisations d’accès aux secrets restent inchangés. Le travail déjà en attente ou en cours conserve la configuration complète enregistrée lors de son admission. Une sélection identique ne change rien ; une sélection modifiée invalide les enregistrements complets d’agent fondés sur un état périmé. Un fournisseur qui n’était pas défini apparaît comme `null` à la relecture, mais une déclaration doit en choisir un. Utilise les commandes existantes de planification, d’application et de lecture, et conserve le reçu si l’application est interrompue. + +Utilise `task-review-context` pour inscrire une tâche opérationnelle vierge pour un seul réviseur. Son `config` contient `projectId`, `taskId`, `reviewerAgentId` et `enabled`. Par défaut, la tâche doit déjà exister, sans historique d’exécution, de révision ou de travail de mise en œuvre. Pour la créer, ajoute `createIfMissing: true` à côté de `kind` et de `config`, et choisis un UUID stable pour `taskId`. Avec les droits de modification du projet, tu peux alors créer la tâche dans le backlog et l’inscrire dans une seule transaction. Si l’inscription échoue, aucune tâche ni modification des compteurs ou du journal d’audit ne subsiste. Le réviseur doit déjà disposer de `task_review` ; l’inscription n’accorde aucun outil et ne lance aucun travail. Les tâches existantes restent soumises aux contrôles de tâche vierge ; une identité occupée n’est jamais écrasée. Après une interruption, conserve le même ID et le reçu en attente. La désactivation conserve le réviseur et la finalité du contexte. + Les politiques de conservation et DSAR exigent leurs workflows natifs dédiés. Interromps les envois, la synchronisation et les crawls avant de changer de modèle d’embedding. La CLI vérifie le nombre de documents et de sites web dans toute l’organisation ; elle ne verrouille pas l’import et ne migre pas les vecteurs existants. Pour une organisation avec des documents ou des sites web enregistrés, un changement de modèle exige une migration native distincte de l’index. Une modification limitée à `minSimilarity`, `maxConcurrentRequests`, `minTokensPerSecond`, `maxTokensPerMinute` ou `maxRequestsPerMinute` laisse les vecteurs existants valables et échappe donc à cette vérification. Les paramètres d’instance exigent aussi la liste native des éditeurs autorisés. L’application autonome signale `restartRequired` pour les paramètres de démarrage ; les enregistrer ne les active pas encore. Examine les effets du plan avant de l’appliquer. Les déploiements gérés utilisent le même moteur via `configuration`. Ajoute cet exemple à la déclaration de déploiement quand un opérateur externe sert déjà le fournisseur. Remplace l’endpoint et le catalogue synthétiques par des valeurs vérifiées, puis injecte `EXTERNAL_PROVIDER_SECRET` depuis ton gestionnaire de secrets : @@ -534,6 +546,15 @@ Pour chaque ressource, la preuve publique `native.configuration` donne le hash p `tale status` — afficher l'état actuel du déploiement. Aucun argument. +`tale deploy smoke --url ` — vérifie un déploiement en service par son URL publique, comme un navigateur y accède. Sans `--full`, la commande n'envoie aucun identifiant et n'écrit rien : tu peux donc la lancer contre n'importe quel déploiement, y compris la production. Elle vérifie `/api/health` (et la version, avec `--expected-version `), la disponibilité de l'API, le shell de l'application et son script, une lecture de session anonyme, et que `/events` et `/api/app` refusent un visiteur sans session. Le `http://` non chiffré n'est accepté que pour `localhost` ; avec ta propre autorité de certification, définis `NODE_EXTRA_CA_CERTS` sur son certificat racine. + +- `--full` — se connecte en plus avec un compte dédié et parcourt un scénario utilisateur : ouvrir le flux de mises à jour en direct de l'organisation, créer une tâche, attendre sa mise à jour en direct, la relire puis la supprimer (un compte qui ne peut pas supprimer de tâches l'archive à la place). Renseigne le compte dans `TALE_SMOKE_EMAIL` et `TALE_SMOKE_PASSWORD` ; il ne doit pas exiger de second facteur. Si le compte ne voit aucun projet, la première exécution en crée un nommé « Tale deployment smoke », que les exécutions suivantes réutilisent. +- `--chat` — avec `--full`, lance aussi un tour de chat sur le premier modèle disponible pour le compte. Ce tour consomme des tokens de modèle ; la conversation part ensuite à la corbeille, après l'arrêt du tour s'il est encore en cours. +- `--organization `, `--project ` — où se déroule le scénario ; par défaut, la première organisation et le premier projet du compte. +- `--timeout ` — limite de chaque requête et de chaque attente (par défaut `15`) ; `--turn-timeout ` limite le tour de chat (par défaut `120`). + +Avec `--json`, le rapport liste chaque vérification avec son statut (`pass`, `fail` ou `skip`), sa durée et sa raison. Le code de sortie `0` signifie que toutes les vérifications ont réussi, `5` qu'au moins une a échoué et `2` qu'une option est invalide. Le scénario complet retire sa tâche (supprimée ou archivée) et se déconnecte même après une vérification en échec. + `tale logs ` — diffuser les logs d'un service (`service` est l'un des services en cours d'exécution ; sur une stack de dev sans déploiement, la commande retombe sur le conteneur de dev). - `-f, --follow` — suivre la sortie des logs au fil de l'écriture. diff --git a/docs/fr/self-hosted/install/kubernetes.md b/docs/fr/self-hosted/install/kubernetes.md index ce72751c10..ed0c589f10 100644 --- a/docs/fr/self-hosted/install/kubernetes.md +++ b/docs/fr/self-hosted/install/kubernetes.md @@ -15,6 +15,7 @@ Tale fonctionne sur Kubernetes lorsque tu transposes le [contrat de services](/f | Des nœuds qui accordent `NET_ADMIN` et fournissent ip6tables, ou autorisent les sysctls IPv6 | Le proxy de sortie installe son pare-feu au démarrage et refuse de démarrer sans lui. | | Les ports 80 et 443 joignables à l’adresse publique | Caddy obtient lui-même les certificats en mode `selfsigned` et `letsencrypt`. Derrière un Ingress qui termine TLS, définis `TLS_MODE=external`. | | Un accès en lecture à `ghcr.io/tale-project/tale/*` sur chaque nœud, y compris pour l’image du runtime sandbox | Les Pods de session démarrent depuis `SANDBOX_RUNTIME_IMAGE`. Un nœud qui ne peut pas la récupérer fait échouer la première session qui y est planifiée. | +| Un runtime de conteneurs qui décompresse les couches zstd, comme containerd 1.5 ou une version ultérieure | Les couches des images Tale sont compressées en zstd. Un nœud dont le runtime ne sait pas les décompresser ne peut pas récupérer les images, et aucun Pod n’y démarre à partir d’elles. | | Une RuntimeClass sysbox ou kata si les agents ont besoin de Docker dans leur sandbox | Sans elle, garde `SANDBOX_DOCKER_IN_CONTAINER=false`. Le niveau `runc` exigerait des Pods privilégiés. | | `kubectl` et `envsubst` sur la machine qui applique les manifestes | Les manifestes contiennent une variable `${VERSION}` que kubectl ne développe pas. | @@ -40,7 +41,7 @@ Chaque Pod ci-dessous définit `enableServiceLinks: false`. Sinon, Kubernetes in | `proxy` | Deployment avec la stratégie `Recreate` ; `hostPort` 80 et 443 ; PVC pour `/data` | Le magasin de certificats survit aux redémarrages sur le PVC. | | `sandbox` | ServiceAccount, Role, RoleBinding, Deployment ; Service sur 8003 | `SANDBOX_BACKEND=kubernetes` ; `config-data` en lecture seule sur `/app/platform-config`. Aucun socket Docker. | | `sandbox-egress` | Deployment ; Service sur 3128 | Le jeu de capabilities livré, sans sysctls. | -| `sandbox-llm-gateway` | Deployment avec la stratégie `Recreate`, PVC sur `/app/data` ; Services `sandbox-llm-gateway` et `llm-gateway` sur 8080 | L’image s’exécute avec l’uid 1000 ; `fsGroup: 1000` lui permet d’écrire son état. La passerelle lit `SANDBOX_LLM_GATEWAY_ADMIN_PASSWORD` dans `tale-env` : tant qu’elle n’a pas de compte d’administration, elle n’en crée un que pour un appelant qui présente ce secret. | +| `sandbox-llm-gateway` | Deployment avec la stratégie `Recreate`, PVC sur `/app/data` ; Services `sandbox-llm-gateway` et `llm-gateway` sur 8080 | L’image s’exécute avec l’uid 1000 ; `fsGroup: 1000` lui permet d’écrire son état. La passerelle lit `SANDBOX_LLM_GATEWAY_ADMIN_PASSWORD` dans `tale-env` : tant qu’elle n’a pas de compte d’administration, elle n’en crée un que pour un appelant qui présente ce secret. Avec `terminationGracePeriodSeconds: 90`, un déploiement laisse à l’ancien Pod jusqu’à 90 secondes pour terminer les appels de modèle en cours, réponses en flux comprises ; il n’enregistre ses compteurs de dépenses à la fin que s’ils se terminent dans les 30 secondes qui suivent l’arrêt ; il n’accepte aucun nouvel appel entre-temps, et le nouveau Pod démarre une fois qu’il s’est arrêté. | | `bgutil-provider` | Deployment ; Service sur 4416 | Fournisseur de jetons vidéo, facultatif. | Les sondes transposent les contrôles de santé Compose : @@ -53,7 +54,7 @@ Les sondes transposent les contrôles de santé Compose : | `object-store` | aucune | `mc ready local` | aucune | | `proxy` | aucune | `GET /health` sur 2020 | aucune | | `sandbox` | `GET /health` sur 8003 | `GET /health` sur 8003 | aucune | -| `sandbox-egress` | aucune | `curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/` | aucune | +| `sandbox-egress` | aucune | `curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/ && nslookup -type=a -timeout=1 sandbox-egress-health.invalid 127.0.0.1` | aucune | | `sandbox-llm-gateway` | aucune | `GET /health` sur 8080 | aucune | Kubernetes n’a pas de `depends_on`. Un rôle backend qui démarre avant que Postgres réponde se termine une fois avec `ECONNREFUSED`, et la politique de redémarrage corrige la situation. @@ -505,8 +506,9 @@ spec: add: ['NET_ADMIN', 'DAC_OVERRIDE', 'CHOWN', 'SETUID', 'SETGID', 'NET_BIND_SERVICE', 'KILL'] ports: [{ name: proxy, containerPort: 3128 }] readinessProbe: - exec: { command: [sh, -c, "curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/"] } + exec: { command: [sh, -c, "curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/ && nslookup -type=a -timeout=1 sandbox-egress-health.invalid 127.0.0.1"] } periodSeconds: 10 + timeoutSeconds: 5 resources: requests: { cpu: 50m, memory: 64Mi } limits: { memory: 512Mi } @@ -544,6 +546,7 @@ spec: spec: enableServiceLinks: false automountServiceAccountToken: false + terminationGracePeriodSeconds: 90 securityContext: { fsGroup: 1000 } containers: - name: gateway @@ -642,14 +645,113 @@ spec: | `SANDBOX_K8S_NAMESPACE` | Le namespace où sont créés les Pods de session, les Secrets et les claims de workspace ; dans cette organisation, celui du spawner lui-même. `tale-sandbox` par défaut. | | `SANDBOX_RUNTIME_IMAGE` | L’image du runtime sandbox Tale correspondante, accessible à chaque nœud. | | `NODE_EXTRA_CA_CERTS` | Le fichier CA du cluster, généralement `/var/run/secrets/kubernetes.io/serviceaccount/ca.crt` dans le spawner. C’est le seul mécanisme de confiance CA que le spawner respecte ; garde la vérification TLS active. | -| `SANDBOX_K8S_WORKSPACE_SIZE_LIMIT` | La taille du claim de workspace `/agent` de chaque session d’agent, `4Gi` par défaut ; limite aussi le workspace temporaire d’un rendu du crawler, qui se passe de claim puisqu’il n’est jamais repris, et le stockage temporaire du Docker interne lorsqu’il est activé. | +| `SANDBOX_K8S_WORKSPACE_SIZE_LIMIT` | La taille du claim de workspace `/agent` de chaque session d’agent, `4Gi` par défaut ; limite aussi le workspace temporaire d’un rendu du crawler, qui se passe de claim puisqu’il n’est jamais repris. | +| `SANDBOX_K8S_DOCKER_STORAGE_SIZE_LIMIT` | La taille du stockage temporaire du Docker interne d’une session d’agent qui exécute Docker dans sa sandbox, `20Gi` par défaut. Une session qui le dépasse est évincée par Kubernetes ; dimensionne-le donc pour les plus grosses images que tes agents téléchargent et construisent. Les versions antérieures à ce paramètre dimensionnaient ce stockage avec `SANDBOX_K8S_WORKSPACE_SIZE_LIMIT` : si tu l’avais réduit pour garder ce stockage petit, définis aussi cette variable lors de la mise à niveau, sinon le stockage passe à `20Gi`. Le spawner émet un avertissement au démarrage quand `SANDBOX_K8S_WORKSPACE_SIZE_LIMIT` est défini sans elle. | +| `SANDBOX_K8S_EPHEMERAL_STORAGE_REQUEST` / `SANDBOX_K8S_EPHEMERAL_STORAGE_LIMIT` | L’espace disque du nœud qu’un Pod de session demande, `256Mi` par défaut, et ce qu’il peut y écrire en dehors de son workspace temporaire et de son stockage Docker, `2Gi` par défaut. La limite d’un Pod y ajoute ces stockages : `2Gi` pour un agent, `6Gi` pour un rendu du crawler, `22Gi` avec Docker dans la sandbox. Une session d’agent qui dépasse sa limite est évincée seule, et la tâche suivante la reprend avec son workspace intact, au lieu de remplir le nœud jusqu’à ce que Kubernetes évince les Pods de la plateforme. Si tes nœuds ne déclarent aucune capacité de stockage éphémère, comme sur certains clusters rootless, mets la demande à `0`. | | `SANDBOX_K8S_CPU_REQUEST` / `SANDBOX_K8S_MEMORY_REQUEST` | Ce que chaque Pod de session demande au planificateur, en quantités Kubernetes. Sans valeur, un Pod d’agent demande `250m` et `512Mi` (`1Gi` avec Docker dans la sandbox) et un rendu du crawler `250m` et `512Mi` ; une demande ne dépasse jamais la limite du Pod. Augmente-les quand les agents de tes nodes lancent des builds plus lourds, pour que le planificateur ne place pas plus de sessions qu’un node ne peut en porter. | +| `SANDBOX_K8S_NODE_SELECTOR` / `SANDBOX_K8S_TOLERATIONS` | Facultatif. Les labels de nœud auxquels chaque Pod de session doit correspondre, sous forme d’objet JSON, et les taints qu’il tolère, sous forme de tableau JSON de tolérances de Pod. Sans valeur, une session peut tourner sur n’importe quel nœud ; voir plus bas. | +| `SANDBOX_K8S_PRIORITY_CLASS` | Facultatif. La PriorityClass de chaque Pod de session. | | `SANDBOX_K8S_CACHE_STORAGECLASS` | La StorageClass des claims de workspace ; sans valeur, celle du cluster s’applique. | | `SANDBOX_RUNTIME` / `SANDBOX_RUNTIME_CLASS` | Un niveau de runtime pris en charge et, si nécessaire, le nom de la RuntimeClass installée. | | `SANDBOX_EGRESS_PROXY` | Le Service de sortie utilisé par les sessions, `http://sandbox-egress:3128` par défaut. | Le spawner se met à l’échelle horizontalement. Chaque réplica retrouve une session qu’il n’a pas créée grâce au nom déterministe de son Pod et l’adopte ; exec, arrêt et destruction fonctionnent donc via le réplica que le Service choisit. `SANDBOX_MAX_SESSIONS` compte le namespace, mais des admissions simultanées sur plusieurs réplicas peuvent le dépasser brièvement ; une ResourceQuota fournit la limite stricte. Le [contrat Kubernetes des sandboxes](https://github.com/tale-project/tale/blob/main/services/sandbox/docs/kubernetes.md) documente la forme du Pod et les détails du runtime. +### Tenir les sessions à l’écart des nœuds de la plateforme + +Les Pods de session exécutent le code qu’écrivent tes agents, et avec Docker dans la sandbox au niveau `runc`, ils tournent en mode privilégié. Sans réglage de placement, le planificateur les place sur n’importe quel nœud, à côté de Postgres et des rôles applicatifs, où une session chargée se dispute le même processeur, la même mémoire et le même disque. Pour réserver des nœuds aux sessions, ajoute-leur un label et un taint : + +```bash +kubectl label node tale.dev/sandbox=true +kubectl taint node tale.dev/sandbox=true:NoSchedule +``` + +Ajoute ensuite les paramètres correspondants à l’`env` du spawner dans `40-sandbox.yaml` : + +```yaml + - { name: SANDBOX_K8S_NODE_SELECTOR, value: '{"tale.dev/sandbox":"true"}' } + - { name: SANDBOX_K8S_TOLERATIONS, value: '[{"key":"tale.dev/sandbox","operator":"Exists","effect":"NoSchedule"}]' } + - { name: SANDBOX_K8S_PRIORITY_CLASS, value: tale-sandbox-session } +``` + +Le taint écarte les autres Pods de ces nœuds, et le sélecteur y maintient les sessions. La PriorityClass classe les sessions sous la plateforme : le planificateur peut préempter une session pour placer un Pod de la plateforme, et quand un nœud manque de mémoire ou de disque, le kubelet tient compte de la priorité et évince les sessions plus tôt. Avec `preemptionPolicy: Never`, une session ne préempte jamais elle-même un autre Pod. Un administrateur du cluster crée la classe une fois ; le spawner n’a besoin d’aucune permission supplémentaire : + +```yaml +apiVersion: scheduling.k8s.io/v1 +kind: PriorityClass +metadata: { name: tale-sandbox-session } +value: -10 +preemptionPolicy: Never +globalDefault: false +description: Tale sandbox sessions yield to the platform. +``` + +Ces paramètres s’appliquent à chaque Pod de session, rendus du crawler compris, pour les sessions que le spawner crée après son redémarrage ; les sessions en cours gardent leur placement. Une valeur mal formée empêche le spawner de démarrer. Un sélecteur valide qu’aucun nœud ne satisfait, ou un taint que les tolérances ne couvrent pas, laisse un Pod de session en attente : le spawner journalise la raison donnée par le scheduler, et la création échoue avec cette raison une fois son budget de démarrage épuisé. Avec un stockage local au nœud, le claim de workspace d’une session arrêtée reste sur son nœud : garde ce nœud dans le sélecteur, sinon la session ne peut pas reprendre. + +### Précharger les images de la sandbox + +Sur Kubernetes, ce n’est pas le spawner qui télécharge les images, mais le kubelet, Pod par Pod. La première session sur un nœud télécharge donc l’image du runtime, environ 2 Go, dans son budget de démarrage (`SANDBOX_SESSION_CREATE_TIMEOUT_MS`, 180 secondes par défaut), et le ramasse-miettes d’images du kubelet peut la supprimer de nouveau dès qu’aucun Pod ne l’utilise. Ce DaemonSet facultatif télécharge les images de la sandbox sur chaque nœud avant la première session et les y garde : chaque conteneur d’initialisation démarre une image et se termine aussitôt, le conteneur pause maintient le Pod en vie, et tant que le Pod existe, le kubelet considère ces images comme utilisées. Chaque conteneur demande 1m de CPU et 4 Mio de mémoire. + +```yaml +# 45-sandbox-prepull.yaml +apiVersion: apps/v1 +kind: DaemonSet +metadata: { name: sandbox-image-prepull, namespace: tale } +spec: + selector: { matchLabels: { app: sandbox-image-prepull } } + updateStrategy: { rollingUpdate: { maxUnavailable: 25% } } + template: + metadata: { labels: { app: sandbox-image-prepull } } + spec: + enableServiceLinks: false + automountServiceAccountToken: false + terminationGracePeriodSeconds: 0 + # Si tu définis SANDBOX_K8S_NODE_SELECTOR et SANDBOX_K8S_TOLERATIONS, reprends ici les mêmes valeurs : + # nodeSelector: { tale.dev/sandbox: 'true' } + # tolerations: [{ key: tale.dev/sandbox, operator: Exists, effect: NoSchedule }] + securityContext: + runAsNonRoot: true + runAsUser: 65534 + runAsGroup: 65534 + seccompProfile: { type: RuntimeDefault } + initContainers: + - name: runtime + image: ghcr.io/tale-project/tale/tale-sandbox-runtime:${VERSION} + command: [sh, -c, 'exit 0'] + resources: { requests: { cpu: 1m, memory: 4Mi }, limits: { memory: 32Mi } } + securityContext: { allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities: { drop: [ALL] } } + - name: egress + image: ghcr.io/tale-project/tale/tale-sandbox-egress:${VERSION} + command: [sh, -c, 'exit 0'] + resources: { requests: { cpu: 1m, memory: 4Mi }, limits: { memory: 32Mi } } + securityContext: { allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities: { drop: [ALL] } } + - name: gateway + image: ghcr.io/tale-project/tale/tale-sandbox-llm-gateway:${VERSION} + command: [sh, -c, 'exit 0'] + resources: { requests: { cpu: 1m, memory: 4Mi }, limits: { memory: 32Mi } } + securityContext: { allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities: { drop: [ALL] } } + containers: + - name: pause + image: registry.k8s.io/pause:3.10 + resources: { requests: { cpu: 1m, memory: 4Mi }, limits: { memory: 16Mi } } + securityContext: { allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities: { drop: [ALL] } } +``` + +C’est l’image du runtime qui compte : chaque Pod de session et son sidecar de sortie démarrent à partir d’elle. Les images du proxy de sortie et de la passerelle évitent un téléchargement quand ces Deployments changent de nœud ; retire leurs conteneurs d’initialisation si les sessions tournent sur des nœuds dédiés que ces Deployments n’utilisent jamais. Si tu définis `SANDBOX_K8S_NODE_SELECTOR` et `SANDBOX_K8S_TOLERATIONS`, donne les mêmes valeurs au DaemonSet pour qu’il tourne exactement sur les nœuds des sessions. + +Les tags des images suivent `${VERSION}` comme dans tous les autres fichiers. Applique ce fichier à part, avant la boucle, et attends que chaque nœud ait téléchargé les images ; lors d’une mise à niveau, la nouvelle image du runtime est alors en place avant que le spawner bascule dessus et crée des sessions à partir d’elle. La première commande crée le namespace lors d’une première installation et ne change rien lors d’une mise à niveau : + +```bash +envsubst '${VERSION}' < 00-namespace.yaml | kubectl apply -f - +envsubst '${VERSION}' < 45-sandbox-prepull.yaml | kubectl apply -f - +kubectl -n tale rollout status ds/sandbox-image-prepull --timeout=15m +for f in 00-namespace.yaml 10-stores.yaml 20-application.yaml 30-proxy.yaml 40-sandbox.yaml; do + envsubst '${VERSION}' < "$f" | kubectl apply -f - +done +``` + +Exécute les mêmes commandes à chaque mise à niveau, avec la nouvelle `VERSION` exportée. Une copie appliquée sans `envsubst`, ou oubliée lors d’une mise à niveau, garde ses anciens tags : elle maintient les anciennes images sur les nœuds, et la première session sur chaque nœud retélécharge la nouvelle. + ### Ce que le spawner impose Au démarrage, le spawner applique la NetworkPolicy `tale-sandbox-session-egress` : les Pods de session peuvent joindre le DNS et les Pods de leur propre namespace, rien d’autre. Le service de métadonnées du cloud, les nœuds et les autres namespaces restent ainsi inaccessibles, même pour un processus qui ignore `HTTP_PROXY`. Les destinations publiques passent par `sandbox-egress`. Une permission `networkpolicies` absente est journalisée sans arrêter le spawner ; vérifie que la politique existe avant d’admettre des traitements. @@ -702,4 +804,4 @@ Les snapshots, bascules bleu-vert et contrôles de rollback de la CLI ne s’ex ## Périmètre vérifié -Ces cinq fichiers ont été appliqués tels quels, à l’exception des valeurs du Secret, sur un cluster kind neuf à un seul nœud, avec Kubernetes 1.36, kube-network-policies, la StorageClass local-path et Tale 0.5.31 : démarrage et migrations, point d’entrée public, création du premier propriétaire et carte Sandboxes, tâche d’agent avec livrable, cycle de vie des sessions avec arrêt sur inactivité, reprise et accès entre réplicas, les sondes de barrière ci-dessus et un redémarrage progressif de l’API à deux réplicas. La planification sur plusieurs nœuds avec un stockage de configuration `ReadWriteMany`, Docker dans les sessions sur une RuntimeClass sysbox ou kata, un Ingress avec `TLS_MODE=external` et des stockages hautement disponibles ne faisaient pas partie de cet essai. +Ces cinq fichiers ont été appliqués tels quels, à l’exception des valeurs du Secret, sur un cluster kind neuf à un seul nœud, avec Kubernetes 1.36, kube-network-policies, la StorageClass local-path et Tale 0.5.31 : démarrage et migrations, point d’entrée public, création du premier propriétaire et carte Sandboxes, tâche d’agent avec livrable, cycle de vie des sessions avec arrêt sur inactivité, reprise et accès entre réplicas, les sondes de barrière ci-dessus et un redémarrage progressif de l’API à deux réplicas. La planification sur plusieurs nœuds avec un stockage de configuration `ReadWriteMany`, Docker dans les sessions sur une RuntimeClass sysbox ou kata, un Ingress avec `TLS_MODE=external` et des stockages hautement disponibles ne faisaient pas partie de cet essai. Les limites de disque et les réglages de placement des Pods de session, ainsi que le DaemonSet facultatif de préchargement, sont venus plus tard et n’en faisaient pas partie non plus. diff --git a/docs/fr/self-hosted/install/own-compose.md b/docs/fr/self-hosted/install/own-compose.md index a6b798014b..685055a43c 100644 --- a/docs/fr/self-hosted/install/own-compose.md +++ b/docs/fr/self-hosted/install/own-compose.md @@ -20,7 +20,7 @@ Le montage fourni conserve `tale_app` et `tale_knowledge` dans un service Postgr ## Fixer des images compatibles -Définis `VERSION` dans le `.env` de Compose avec la release Tale examinée et testée. Exporte la même valeur dans le shell pour le téléchargement séparé de l’image d’exécution plus bas. Garde les images Tale sur une release commune ; les deux services utilisant des images amont ont leurs propres versions. +Définis `VERSION` dans le `.env` de Compose avec la release Tale examinée et testée. Exporte la même valeur dans le shell pour le téléchargement séparé de l’image d’exécution plus bas. Garde les images Tale sur une release commune ; les deux services utilisant des images amont ont leurs propres versions. Les couches des images Tale sont compressées en zstd : l’hôte Docker doit donc exécuter Docker Engine 24.0 ou une version ultérieure. | Service | Image | | --- | --- | @@ -167,6 +167,7 @@ Configure `BACKEND_UPSTREAM=backend-api:3005` sur le proxy. Pour le stockage fou | IPv6 de sortie | `sysctls` avec `net.ipv6.conf.all.disable_ipv6: '1'` et `net.ipv6.conf.default.disable_ipv6: '1'`, comme dans le stack fourni. Le pare-feu egress fonctionne en fail-closed : il exige un pare-feu IPv6 fonctionnel ou IPv6 désactivé pour la valeur par défaut et chaque interface, et un conteneur ne peut pas écrire ces sysctls lui-même à travers un `/proc/sys` en lecture seule. Sans elles, le proxy refuse de démarrer sur un noyau sans le module `ip6_tables` ; voir [Infrastructure sandbox](/fr/self-hosted/configuration/environment-reference#sandbox-infrastructure). | | Arrêt Postgres | `stop_signal: SIGINT`, `stop_grace_period: 60s`, `shm_size: 256mb` dans la référence. | | Arrêt web, backend et spawner | Délais de grâce de 45 secondes pour le web, 30 pour `backend-api`, 120 pour `backend-worker` et 30 pour le spawner. Un worker transmet ses exécutions d’automatisation pendant ce délai (`SHUTDOWN_DRAIN_MS`) ; coordonner le reste du travail actif avant l’arrêt. | +| Arrêt de la passerelle | `stop_grace_period: 90s`. Une passerelle qui s’arrête n’accepte plus de nouvel appel de modèle, laisse se terminer les appels en cours, réponses en flux comprises, et n’enregistre ses compteurs de dépenses à la fin que si cela se termine dans les 30 secondes qui suivent l’arrêt. Le délai par défaut de Docker, 10 secondes, coupe les réponses plus longues. | Conserve `db-backup` si tes outils écrivent dans `/var/lib/postgresql/backup` ; un montage seul ne programme aucune sauvegarde. Les anciens volumes de configuration `convex-data` demandent un transfert délibéré vers `config-data`, pas leur suppression. Garde l’ancienne copie jusqu’à vérification. @@ -182,7 +183,7 @@ Conserve `db-backup` si tes outils écrivent dans `/var/lib/postgresql/backup`  | `db` | `pg_isready -U tale && [ -f /tmp/.db_ready ]` | Postgres et initialisation prêts ; adapter l’utilisateur. | | `object-store` | `mc ready local` | Disponibilité du MinIO fourni. | | `sandbox` | `curl -fsS http://127.0.0.1:8003/health` | Spawner prêt après préparation de l’image d’exécution. | -| `sandbox-egress` | `curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/` | Le proxy répond lui-même à une requête non proxy (page 400) : cela prouve qu’il sert, sans dépendance à un site tiers. Ne sonde pas le port par une simple connexion TCP : tinyproxy journalise chaque connexion-fermeture comme une erreur, une ligne par intervalle. | +| `sandbox-egress` | `curl -sS -o /dev/null --max-time 3 --noproxy '*' http://127.0.0.1:3128/ && nslookup -type=a -timeout=1 sandbox-egress-health.invalid 127.0.0.1` | Le proxy répond lui-même à une requête non proxy (page 400) : cela prouve qu’il sert, sans dépendance à un site tiers. Puis dnsmasq répond à un nom tiré de sa propre configuration : cela prouve que le relais DNS des conteneurs imbriqués et des builds répond, sans interroger de résolveur en amont. Ne sonde pas le port par une simple connexion TCP : tinyproxy journalise chaque connexion-fermeture comme une erreur, une ligne par intervalle. | | `sandbox-llm-gateway` | `wget -q -O /dev/null http://127.0.0.1:8080/health` | Utiliser le client présent dans l’image ; elle ne contient pas `curl`. | Prévois assez de temps pour un démarrage à froid : le téléchargement de l’environnement sandbox peut dépasser un délai adapté à un hôte déjà préparé. Une sonde réussie ne prouve ni accès aux fichiers, ni identifiants de modèle, ni parcours utilisateur complet. Vérifie-les séparément. diff --git a/docs/fr/self-hosted/install/quickstart.md b/docs/fr/self-hosted/install/quickstart.md index 16fec3a3de..b4670058ad 100644 --- a/docs/fr/self-hosted/install/quickstart.md +++ b/docs/fr/self-hosted/install/quickstart.md @@ -8,7 +8,7 @@ Démarre Tale localement avec la CLI publiée, puis crée ton espace de travail Il te faut : -- macOS, Linux ou Windows avec PowerShell, ainsi que Docker exécutant des conteneurs Linux avec Compose. Docker Desktop inclut Compose sur macOS et Windows. Si Docker manque, `tale dev` propose de t’aider à l’installer. +- macOS, Linux ou Windows avec PowerShell, ainsi que Docker Engine 24.0 ou une version ultérieure exécutant des conteneurs Linux avec Compose. Docker Desktop inclut Compose sur macOS et Windows. Si Docker manque, `tale dev` propose de t’aider à l’installer ; avec un moteur plus ancien, la commande s’arrête avant de télécharger la moindre image. - Un accès réseau à GitHub pour la CLI et aux registres de conteneurs pour les images. Le premier démarrage télécharge plusieurs Go ; prévois de la place pour les images et tes données. - Les identifiants d’un fournisseur de modèles compatible pour tester la première réponse. Tu peux créer ton compte et explorer l’application avant de connecter un fournisseur. @@ -42,7 +42,7 @@ irm https://raw.githubusercontent.com/tale-project/tale/main/scripts/install-cli Vérifie l’installation avec `tale --version` dans le même terminal. Si la commande est introuvable, suis les indications de l’installateur pour le `PATH` et rouvre les terminaux déjà ouverts. Le [guide CLI](/fr/self-hosted/install/cli-install) couvre les versions fixées et le choix du répertoire d’installation. -Consulte `tale --help` avant d’utiliser `tale doctor`. Si `doctor` n’y figure pas, lance `docker info` et `docker compose version` pour vérifier Docker et Compose. Lorsqu’elle est disponible, la commande `tale doctor` examine aussi l’architecture des conteneurs et les ports locaux sans installer de logiciel ni modifier de fichiers. Suis les solutions proposées ; un résultat positif ne vérifie ni les téléchargements d’images ni l’accès aux modèles. +Consulte `tale --help` avant d’utiliser `tale doctor`. Si `doctor` n’y figure pas, lance `docker info` et `docker compose version` pour vérifier Docker et Compose. Lorsqu’elle est disponible, la commande `tale doctor` examine aussi la version de Docker Engine, l’architecture des conteneurs et les ports locaux sans installer de logiciel ni modifier de fichiers. Suis les solutions proposées ; un résultat positif ne vérifie ni les téléchargements d’images ni l’accès aux modèles. ## Initialiser et démarrer diff --git a/docs/fr/self-hosted/operate/container-architecture.md b/docs/fr/self-hosted/operate/container-architecture.md index 5f8fcc4b6b..3a544ae704 100644 --- a/docs/fr/self-hosted/operate/container-architecture.md +++ b/docs/fr/self-hosted/operate/container-architecture.md @@ -39,6 +39,20 @@ L’environnement fournit aussi Chromium et Playwright pour le rendu de pages et Le service de sortie bloque les destinations privées et de métadonnées et peut imposer une liste d’hôtes autorisés. Une sortie indisponible peut provoquer un refus ou une erreur réseau ; le message dépend de l’opération. [Durcissement](/fr/self-hosted/operate/security/hardening) décrit la politique et [Gérer Compose toi-même](/fr/self-hosted/install/own-compose) les capacités et montages requis. +## Garder les sessions actives pendant un redémarrage de Docker + +Les sessions sandbox et le spawner tournent comme conteneurs du daemon Docker de l’hôte. Sans le live restore du daemon, le redémarrer, pour une mise à jour de paquet ou une modification de `/etc/docker/daemon.json`, les arrête tous : les tours d’agent, builds et rendus de pages en cours s’interrompent, mais leurs espaces de travail sont conservés. Tale ne modifie pas la configuration du daemon de l’hôte ; le spawner journalise un avertissement au démarrage tant que le live restore est désactivé. + +Pour l’activer, ajoute le réglage dans `/etc/docker/daemon.json` en gardant les autres entrées du fichier : + +```json +{ + "live-restore": true +} +``` + +Recharge ensuite le daemon avec `sudo systemctl reload docker`, ou envoie `SIGHUP` à `dockerd` sur un hôte sans systemd. Le rechargement applique le réglage sans arrêter de conteneur. Le live restore garde les conteneurs actifs pendant un redémarrage du daemon et une mise à jour de correctif ; une mise à jour vers une nouvelle version majeure de Docker peut quand même les arrêter, planifie-la donc comme une fenêtre de maintenance. Le live restore est incompatible avec le mode Swarm : sur un nœud Swarm, planifie plutôt les redémarrages du daemon comme une maintenance. [Le guide live restore de Docker](https://docs.docker.com/engine/daemon/live-restore/) détaille les autres limites. + ## Reconnaître une réparation d’index de connaissances Un index BM25 endommagé peut faire échouer l’ingestion alors que les tables de documents restent lisibles. Le backend vérifie les index avec `pdb.verify_index` ; un verrou consultatif coordonne les tentatives de réparation par base. Les bases propres aux organisations sont vérifiées à leur première utilisation. diff --git a/docs/fr/self-hosted/operate/observability/troubleshooting.md b/docs/fr/self-hosted/operate/observability/troubleshooting.md index 12f243bc76..7795db6d2e 100644 --- a/docs/fr/self-hosted/operate/observability/troubleshooting.md +++ b/docs/fr/self-hosted/operate/observability/troubleshooting.md @@ -85,6 +85,10 @@ Un processus de sortie sain ne prouve pas la disponibilité de l’hôte distant Quand de nombreuses sessions installent des paquets ou chargent des pages en même temps et que des connexions échouent sur des réinitialisations alors que le proxy reste sain, il a peut-être atteint `SANDBOX_EGRESS_MAX_CLIENTS`, les connexions qu’il sert en même temps pour toutes les sessions réunies. Son journal indique alors que le nombre maximal de connexions est atteint. Augmente la valeur, avec les limites de processus et de fichiers ouverts du conteneur de sortie, puis recrée le service de sortie. +Quand les connexions d’une seule session échouent sur des réinitialisations alors que d’autres sessions atteignent encore les mêmes hôtes, cette session détient peut-être déjà `SANDBOX_EGRESS_MAX_CONNECTIONS_PER_SESSION` connexions (256 par défaut), et le proxy refuse les suivantes jusqu’à ce que certaines se ferment. Augmente la valeur, ou mets `0` pour désactiver la limite, puis recrée le service de sortie. + +Un service `sandbox-egress` recréé (après un déploiement ou un redémarrage de la pile) peut revenir à une autre adresse, alors que les sessions qui tournaient déjà continuent d’envoyer leur trafic à l’ancienne et perdent l’accès réseau. Le service `sandbox` recycle chacune de ces sessions dès qu’elle est libérée et inactive, et consigne `recycling ` ; la prochaine utilisation la redémarre avec son espace de travail intact. Une session encore utilisée continue d’échouer jusqu’à la fin de son travail, et une session épinglée continue de tourner jusqu’à ce que tu l’arrêtes ou ne l’épingles plus. + ## Les écritures échouent ou le stockage se remplit Vérifie connexion à la base applicative, espace libre, usage des connexions et verrous. Arrête la croissance évitable et récupère de la capacité selon ta procédure de base. Ne supprime pas le contenu des volumes, ne remplace pas les clés de chiffrement et ne suppose pas que les écritures échouées seront rejouées après redémarrage. Vérifie si l’opération a persisté avant de la relancer. diff --git a/docs/fr/self-hosted/operate/upgrades.md b/docs/fr/self-hosted/operate/upgrades.md index 959d5e78ec..5bb0ecde5b 100644 --- a/docs/fr/self-hosted/operate/upgrades.md +++ b/docs/fr/self-hosted/operate/upgrades.md @@ -59,12 +59,12 @@ L’ancienne API est drainée avant son retrait : de nouveaux tours de chat peu Le drainage couvre aussi les automatisations. Les workers de l’ancienne couleur ne démarrent plus de nouveau job et transmettent chaque exécution d’automatisation à sa prochaine étape, si bien qu’elle continue sur la nouvelle couleur ; la CLI attend aussi ces étapes, dans les mêmes trois minutes. Quand les anciens conteneurs s’arrêtent, chaque worker dispose de 120 secondes pour transmettre ce qu’il détient encore (davantage si tu augmentes `SHUTDOWN_DRAIN_MS` : la CLI garde ce délai 15 secondes au-dessus), et une étape qui travaille encore 20 secondes après le début de l’arrêt est interrompue et s’exécute à nouveau sur la nouvelle couleur. Une étape qui envoyait quelque chose à un service externe fait exception, car le service l’a peut-être déjà reçu : l’exécution attend alors qu’une personne choisisse comment continuer, comme l’explique [Examiner les exécutions et corriger les échecs](/fr/platform/automations/execution-logs). La première mise à jour vers le protocole d’écriture des automatisations 2 est différente : la migration met en attente toutes les anciennes exécutions en file, en cours ou déjà en attente, en conservant leur état précédent et leurs effets externes non déterminés. Elles ne reprennent pas automatiquement. Un travail déjà admis ou envoyé par un ancien worker peut encore se terminer. Une demande d’arrêt explicite enregistre son auteur et demande l’annulation de la session concernée, sans prouver son arrêt ni le résultat d’une écriture externe. Elle ne libère ni la tâche retenue ni ses preuves. Vérifie le résultat réel avant de prévoir un travail de remplacement. +La passerelle de modèles est remplacée sur place avant le démarrage de la nouvelle couleur. Quand son conteneur s’arrête, la passerelle n’accepte plus de nouvel appel de modèle et laisse aux appels en cours, réponses en flux comprises, jusqu’à 90 secondes pour se terminer. Elle n’enregistre ses compteurs de dépenses à la fin que si cela se termine dans les 30 secondes qui suivent l’arrêt, car la fenêtre de nettoyage de la passerelle compte à partir du signal d’arrêt. Un appel encore en flux après cela reçoit sa réponse complète, mais son coût, et celui des secondes précédentes, peut ne pas être comptabilisé. Jusqu’à ce que la nouvelle passerelle réponde, un nouvel appel de modèle échoue, et une réponse encore en flux après 90 secondes est coupée. Un déploiement peut donc attendre la passerelle jusqu’à 90 secondes. + Les deux couleurs montent le volume `static-assets` du déploiement. Avant qu’une réplique web soit prête, elle y publie les scripts, feuilles de style, polices et images immuables de sa compilation. Chaque couleur peut ainsi servir les fichiers référencés par le HTML de l’autre. Les répliques actives actualisent leurs fichiers chaque heure ; les fichiers retirés restent disponibles pendant sept jours après leur dernière actualisation. Monte aussi ce volume partagé sur chaque réplique web dans ta propre configuration Compose. Lors de la première mise à niveau depuis une version qui ne prend pas en charge ce mécanisme, les anciennes répliques n’ont pas encore accès à ce recours partagé. Un onglet ouvert continue normalement à fonctionner pendant la bascule. Si une partie nécessaire n’est plus disponible, Tale attend que son API et sa base de données répondent, puis recharge la page une fois. Si cette partie ne se charge toujours pas, Tale affiche **Une nouvelle version est disponible** avec l’action **Recharger**, sans répéter le rechargement automatique. Pendant une panne, l’avis de connexion reste visible. Les lectures ayant échoué sont actualisées quand la connexion revient ; les écritures ayant échoué ne sont pas renvoyées automatiquement. -Une fois les services mis à jour, la CLI supprime les images Tale des versions antérieures à la fois à la nouvelle version et à la cible de retour arrière enregistrée. L’hôte garde ainsi les images de deux versions plutôt que de chaque version qu’il a exécutée. Elle ne force jamais une suppression : une image qu’un conteneur utilise encore, comme un service laissé en marche sur une version antérieure ou une session sandbox démarrée avant le déploiement, reste jusqu’à ce qu’un déploiement ultérieur la trouve libre. Les images chargées à l’avance pour une version ultérieure restent aussi. - Si le nouveau groupe ne devient pas sain avant `HEALTH_CHECK_TIMEOUT`, la CLI ne termine pas la bascule. Examine l’état enregistré et les journaux avant de réessayer. Un déploiement interrompu peut laisser les deux groupes ou un transfert en attente. Suis les indications de reprise de la CLI plutôt que de supprimer manuellement conteneurs ou fichiers d’état. ## Vérifier les migrations et le résultat utilisateur diff --git a/docs/fr/self-hosted/overview.md b/docs/fr/self-hosted/overview.md index 63329aea17..71c39f00de 100644 --- a/docs/fr/self-hosted/overview.md +++ b/docs/fr/self-hosted/overview.md @@ -31,7 +31,7 @@ Les rôles applicatifs utilisent la même image Tale Platform. `TALE_ROLE=api` d | `config-data` | Fichiers de configuration des organisations : agents, skills, définitions de fournisseurs, règles de gouvernance, SSO et identité visuelle. | | `object-store-data` | Documents importés, pièces jointes, audio et fichiers générés. | | `caddy-data`, `caddy-config` | Certificats et état du proxy. | -| `llm-gateway-data` | Configuration de la passerelle, état des accès de session et journal des requêtes de la passerelle (modèle, jetons, durée), sans prompts ni réponses. | +| `llm-gateway-data` | Configuration de la passerelle, état des accès de session et journal des requêtes de la passerelle (modèle, jetons, durée), sans prompts ni réponses, conservé trois jours par défaut. | Le stack fourni place les deux bases dans un seul service Postgres et expose la connexion aux connaissances sous l’alias réseau `knowledge-db`. Les bases restent distinctes. Un déploiement Compose depuis les sources avec un service de connaissances séparé possède aussi `knowledge-db-data`. diff --git a/docs/fr/tutorials/editor/workflow-with-approvals.md b/docs/fr/tutorials/editor/workflow-with-approvals.md index 00e2024b49..e21c9d3580 100644 --- a/docs/fr/tutorials/editor/workflow-with-approvals.md +++ b/docs/fr/tutorials/editor/workflow-with-approvals.md @@ -60,7 +60,7 @@ Si ce nom existe déjà, l’import ajoute une version. Choisis une autre valeur Dans **Éditeur**, clique sur **Essai**. Cet exemple ne demande aucune donnée d’exécution ; un objet vide suffit. Passe à **Exécutions** : la liste doit afficher une exécution de test au statut **Réussie**. -Ouvre l’exécution et vérifie sur le canvas que les deux nœuds affichent le statut **Exécuté**. Sélectionne `send` et examine ses données résolues. Le destinataire doit être `reviewer@example.com`, l’objet `Approval practice` et le texte la phrase de `draft`. Le connector utilise une simulation déterministe dans ce mode. Aucun e-mail n’est envoyé et aucune carte d’approbation n’apparaît. +Ouvre l’exécution et vérifie sur le canevas que les deux nœuds affichent **Réussi**. Sélectionne `send` et examine ses données résolues. Le destinataire doit être `reviewer@example.com`, l’objet `Approval practice` et le texte la phrase de `draft`. Le connector utilise une simulation déterministe dans ce mode. Aucun e-mail n’est envoyé et aucune carte d’approbation n’apparaît. Le workflow comprend un test qui attend l’effet `imap-smtp.send`. Une simulation réussie vérifie le graphe et l’appel prévu. Elle ne prouve ni la validité des identifiants de messagerie ni la livraison du message. diff --git a/docs/nav.json b/docs/nav.json index 72ac22cd83..cc525198e2 100644 --- a/docs/nav.json +++ b/docs/nav.json @@ -276,6 +276,7 @@ "develop/contributing-docker", "develop/api-reference", "develop/mcp-endpoint", + "develop/mcp-settings", "develop/use-tale-from-your-editor", "develop/webhooks", "develop/webdav-api", diff --git a/docs/published.json b/docs/published.json index d2e385b98a..f59f93baa8 100644 --- a/docs/published.json +++ b/docs/published.json @@ -45,6 +45,7 @@ "develop/contributor-setup", "develop/integrations", "develop/mcp-endpoint", + "develop/mcp-settings", "develop/overview", "develop/rate-limits", "develop/status-page", diff --git a/knip.config.ts b/knip.config.ts index 52f045db24..5418fa7879 100644 --- a/knip.config.ts +++ b/knip.config.ts @@ -300,6 +300,21 @@ export default { 'zimmerframe', ], }, + 'tools/load': { + // Started by path, never imported: the runner forks its worker, the + // mock forks its cluster workers, each worker imports the scenario + // module it was told to drive, and the interrupt test drives a + // fixture scenario the same way. + entry: [ + 'src/cli.ts', + 'src/runner/worker.ts', + 'src/mock/cluster-worker.ts', + 'src/scenario/index.ts', + 'tests/runner/fixtures/*.ts', + 'tests/**/*.test.ts', + ], + project: ['src/**/*.ts', 'tests/**/*.ts'], + }, 'tools/plop': { entry: ['generators/**/*.ts', 'helpers/**/*.ts'], project: ['**/*.ts', '!templates/**'], diff --git a/packages/shared/README.md b/packages/shared/README.md index fd5f255b15..b3955ee5fb 100644 --- a/packages/shared/README.md +++ b/packages/shared/README.md @@ -26,6 +26,19 @@ Every subpath below is declared in `package.json` `exports`. projects. Platform forms/APIs and CLI validation import these same objects. - **`@tale/shared/schemas/configuration`** — opaque native configuration hash preconditions. A null hash means an absent resource. +- **`@tale/shared/config/platform-resources`** — the native platform resource + model that `tale config platform`, managed deployments and the MCP settings + tools share: `platformResourceSchema` (one entry per declarable kind), each + resource's identity (`resourceId`), a declaration's cross-resource rules + (`platformConfigurationSchema`) and when stored state already is what was + asked for (`resourceConverged`). Server-only: it compares + `configurationHash` digests, so it sits outside the browser-safe `schemas/`. +- **`@tale/shared/schemas/settings-kinds`** — the settings a coding agent reads + and changes through the MCP settings tools: one descriptor per kind + (`SETTINGS_KINDS`: scope, the Settings pages it covers, operations, secret + paths, risk, apply order, description), the declarable kinds those tools + leave to the automation tools, every page of Settings (`SETTINGS_AREAS`) and + the effects a planned change can carry (`SETTINGS_EFFECTS`). - **`@tale/shared/schemas/{automation-pack,automation-settings,task-contract}`** — automation package declarations and limits, operator settings forms and task bindings. Catalog reads, ZIP decoding and engine validation stay in the platform. @@ -81,6 +94,12 @@ process and terminal dependencies out of frontend bundles. - **`@tale/shared/utils/hashing`** — `computeContentHash(string | Uint8Array)`, the SHA-256 hex digest the knowledge index dedups content by. +- **`@tale/shared/utils/stable-stringify`** — `stableStringify(value)`, JSON with every + object's keys sorted (a value JSON cannot hold reads as `null`). Pure: the automation + engine and the browser compare values with it. +- **`@tale/shared/utils/configuration-hash`** — `configurationHash(value)`, the SHA-256 of + that key-sorted JSON: a native configuration resource's `hash`, and the `expectedHash` + a write takes back. Server-only (Node's crypto); a golden corpus pins every digest. ## Development diff --git a/packages/shared/package.json b/packages/shared/package.json index 32e4b70c19..7eae4730b4 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -6,7 +6,9 @@ "exports": { "./agent-tool-grants": "./src/agent-tool-grants.ts", "./automation-name": "./src/automation-name.ts", + "./automation-replay": "./src/automation-replay.ts", "./task-limits": "./src/task-limits.ts", + "./time-zone": "./src/time-zone.ts", "./db/retry": "./src/db/retry.ts", "./db/migration-files": "./src/db/migration-files.ts", "./db/serializable": "./src/db/serializable.ts", @@ -17,6 +19,8 @@ "./tux": "./src/tux/index.ts", "./process": "./src/process/index.ts", "./utils/hashing": "./src/utils/hashing.ts", + "./utils/configuration-hash": "./src/utils/configuration-hash.ts", + "./utils/stable-stringify": "./src/utils/stable-stringify.ts", "./utils/site-urls": "./src/utils/site-urls.ts", "./schemas/branding": "./src/schemas/branding.ts", "./schemas/deployment": "./src/schemas/deployment.ts", @@ -24,6 +28,8 @@ "./schemas/knowledge": "./src/schemas/knowledge.ts", "./schemas/providers": "./src/schemas/providers.ts", "./schemas/configuration": "./src/schemas/configuration.ts", + "./config/platform-resources": "./src/config/platform-resources.ts", + "./schemas/settings-kinds": "./src/schemas/settings-kinds.ts", "./schemas/managed-configuration": "./src/schemas/managed-configuration.ts", "./schemas/connectors": "./src/schemas/connectors.ts", "./schemas/epoch-ms": "./src/schemas/epoch-ms.ts", @@ -42,7 +48,10 @@ "./schemas/task-external-issue": "./src/schemas/task-external-issue.ts", "./schemas/task-external-status": "./src/schemas/task-external-status.ts", "./schemas/task-review": "./src/schemas/task-review.ts", + "./schemas/task-review-batch": "./src/schemas/task-review-batch.ts", "./schemas/schedule-rule": "./src/schemas/schedule-rule.ts", + "./schemas/automation-replay": "./src/schemas/automation-replay.ts", + "./schemas/automation-trigger": "./src/schemas/automation-trigger.ts", "./monitoring/privacy": "./src/monitoring/privacy.ts" }, "scripts": { diff --git a/packages/shared/src/agent-tool-grants.test.ts b/packages/shared/src/agent-tool-grants.test.ts index 4acb481724..2254881be8 100644 --- a/packages/shared/src/agent-tool-grants.test.ts +++ b/packages/shared/src/agent-tool-grants.test.ts @@ -1,6 +1,10 @@ import { describe, expect, it } from 'vitest'; -import { normalizeToolGrants, WRITE_EFFECT_TOOLS } from './agent-tool-grants'; +import { + AGENT_TOOL_CATALOG, + normalizeToolGrants, + WRITE_EFFECT_TOOLS, +} from './agent-tool-grants'; describe('captured review delegation grants', () => { it('requires an explicit project-agent write grant and never grants it to automation', () => { @@ -19,3 +23,22 @@ describe('captured review delegation grants', () => { ).toEqual(['task_get']); }); }); + +describe('the knowledge-entry write grant', () => { + it('is a write of the knowledge module, ordered after its find, on both lanes', () => { + const knowledge = AGENT_TOOL_CATALOG.filter( + (tool) => tool.module === 'knowledge', + ).map((tool) => [tool.name, tool.effect]); + expect(knowledge).toEqual([ + ['knowledge_entry_find', 'read'], + ['knowledge_entry_write', 'write'], + ]); + expect(WRITE_EFFECT_TOOLS).toContain('knowledge_entry_write'); + expect( + normalizeToolGrants(['knowledge_entry_write', 'knowledge_entry_find']), + ).toEqual(['knowledge_entry_find', 'knowledge_entry_write']); + expect( + normalizeToolGrants(['knowledge_entry_write'], 'automation'), + ).toEqual(['knowledge_entry_write']); + }); +}); diff --git a/packages/shared/src/agent-tool-grants.ts b/packages/shared/src/agent-tool-grants.ts index 9f1797f46d..370e2a04ca 100644 --- a/packages/shared/src/agent-tool-grants.ts +++ b/packages/shared/src/agent-tool-grants.ts @@ -29,6 +29,7 @@ export const AGENT_TOOL_CATALOG = [ { name: 'document_find', effect: 'read', module: 'documents' }, { name: 'document_create', effect: 'write', module: 'documents' }, { name: 'knowledge_entry_find', effect: 'read', module: 'knowledge' }, + { name: 'knowledge_entry_write', effect: 'write', module: 'knowledge' }, { name: 'contact_find', effect: 'read', module: 'contacts' }, { name: 'product_find', effect: 'read', module: 'products' }, { name: 'website_find', effect: 'read', module: 'websites' }, diff --git a/packages/shared/src/automation-replay.ts b/packages/shared/src/automation-replay.ts new file mode 100644 index 0000000000..e3bb37e63f --- /dev/null +++ b/packages/shared/src/automation-replay.ts @@ -0,0 +1,9 @@ +/** + * How a run is run again: with its own input (`again`), with an input a + * person edited (`edited`), or from one of its steps (`from`). A leaf with no + * imports, so the engine's planner and the doors' request schema share one + * list. + */ +export const REPLAY_KINDS = ['again', 'edited', 'from'] as const; + +export type ReplayKind = (typeof REPLAY_KINDS)[number]; diff --git a/tools/cli/src/lib/config/platform-fixture.ts b/packages/shared/src/config/platform-resources.fixture.ts similarity index 91% rename from tools/cli/src/lib/config/platform-fixture.ts rename to packages/shared/src/config/platform-resources.fixture.ts index f11beb8985..7ab3b3df05 100644 --- a/tools/cli/src/lib/config/platform-fixture.ts +++ b/packages/shared/src/config/platform-resources.fixture.ts @@ -1,7 +1,8 @@ -import { parsePlatformConfiguration } from './platform-model'; +import { platformConfigurationSchema } from './platform-resources'; /** Synthetic settings span ordinary policies and external providers. No model - * hardware, source checkout, organization or endpoint is shared by clients. */ + * hardware, source checkout, organization or endpoint is shared by clients. + * Test support for the shared model's suite and the CLI's plan/apply suites. */ export function platformConfigurationFixture() { const providers = ['reasoning', 'vision', 'embedding'].map((role) => ({ kind: 'provider' as const, @@ -30,7 +31,7 @@ export function platformConfigurationFixture() { }, ], })); - return parsePlatformConfiguration({ + return platformConfigurationSchema.parse({ schemaVersion: 1, resources: [ { kind: 'branding', config: { accentColor: '#336699' } }, diff --git a/packages/shared/src/config/platform-resources.test.ts b/packages/shared/src/config/platform-resources.test.ts new file mode 100644 index 0000000000..2274790d76 --- /dev/null +++ b/packages/shared/src/config/platform-resources.test.ts @@ -0,0 +1,448 @@ +import { describe, expect, test } from 'vitest'; + +import { POLICY_SCHEMAS } from '../schemas/governance'; +import { configurationHash } from '../utils/configuration-hash'; +import { + platformConfigurationSchema, + resourceConverged, + resourceId, +} from './platform-resources'; +import { platformConfigurationFixture } from './platform-resources.fixture'; + +describe('native configuration declaration', () => { + test('uses the same ordinary policy defaults as the platform without requiring providers', () => { + const configuration = platformConfigurationSchema.parse({ + schemaVersion: 1, + resources: [ + { kind: 'governance', key: 'password_policy', config: {} }, + { kind: 'branding', config: { accentColor: '#336699' } }, + ], + }); + expect(configuration.resources[0].config).toEqual( + POLICY_SCHEMAS.password_policy.parse({}), + ); + expect(configuration.resources.map(resourceId)).toEqual([ + 'governance/password_policy', + 'branding', + ]); + }); + + test.each([ + { schemaVersion: 2, resources: [] }, + { + schemaVersion: 1, + resources: [{ kind: 'file', path: '/etc/passwd', config: {} }], + }, + { + schemaVersion: 1, + resources: [{ kind: 'governance', key: 'retention_policy', config: {} }], + }, + { + schemaVersion: 1, + resources: [{ kind: 'governance', key: 'dsar_governance', config: {} }], + }, + { + schemaVersion: 1, + resources: [{ kind: 'governance', key: '../foreign', config: {} }], + }, + { + schemaVersion: 1, + resources: [ + { kind: 'governance', key: 'password_policy', config: { typo: true } }, + ], + }, + { + schemaVersion: 1, + resources: [{ kind: 'branding', config: { accentColour: '#336699' } }], + }, + { + schemaVersion: 1, + resources: [ + { kind: 'deployment', config: { version: 1, dataStores: {} } }, + ], + }, + ])('rejects unsupported native fields and special workflows: %j', (input) => { + expect(platformConfigurationSchema.safeParse(input).success).toBe(false); + }); + + test('rejects duplicate resources, foreign catalog models and inconsistent model policies', () => { + for (const change of [ + 'duplicate', + 'foreign-model', + 'vision-model', + 'embedding-endpoint', + ]) { + const config = platformConfigurationFixture(); + if (change === 'duplicate') config.resources.push(config.resources[0]); + if (change === 'foreign-model') { + const provider = config.resources.find( + (entry) => entry.kind === 'provider', + )!; + provider.expectedModels![0].provider = 'another-provider'; + } + if (change === 'vision-model') { + const vision = config.resources.find( + (entry) => + entry.kind === 'governance' && entry.key === 'vision_model', + )!; + vision.config = { providerSlug: 'private-vision', modelId: 'unlisted' }; + } + if (change === 'embedding-endpoint') { + const embedding = config.resources.find( + (entry) => entry.kind === 'knowledge-embedding', + )!; + embedding.config.baseUrl = 'https://other.example.invalid/v1'; + } + expect( + platformConfigurationSchema.safeParse(config).success, + change, + ).toBe(false); + } + }); + + test('accepts automatic transcription and validates pinned provider capabilities', () => { + const declaration = ( + apiFormat = 'openai', + tags = ['transcription'], + modelId = 'example-asr', + ) => ({ + schemaVersion: 1, + resources: [ + { + kind: 'provider', + config: { + name: 'example-audio', + displayName: 'Example audio', + apiFormat, + baseUrl: 'https://audio.example.invalid/v1', + catalog: { source: 'models-endpoint' }, + auth: [{ method: 'api-key' }], + }, + expectedModels: [ + { + id: 'example-asr', + provider: 'example-audio', + tags, + supportsTools: false, + supportsVision: false, + contextWindow: 448, + }, + ], + }, + { + kind: 'governance', + key: 'transcription_model', + config: { providerSlug: 'example-audio', modelId }, + }, + ], + }); + expect( + platformConfigurationSchema.safeParse({ + schemaVersion: 1, + resources: [ + { kind: 'governance', key: 'transcription_model', config: {} }, + ], + }).success, + ).toBe(true); + expect(platformConfigurationSchema.safeParse(declaration()).success).toBe( + true, + ); + expect( + platformConfigurationSchema.safeParse(declaration('anthropic')).success, + ).toBe(false); + expect( + platformConfigurationSchema.safeParse(declaration('openai', ['chat'])) + .success, + ).toBe(false); + expect( + platformConfigurationSchema.safeParse( + declaration('openai', ['transcription'], 'missing'), + ).success, + ).toBe(false); + }); + + test('accepts image generation off or automatic and validates a pinned image model', () => { + const declaration = ( + apiFormat = 'openai', + tags = ['image-generation'], + modelId = 'example-image', + ) => ({ + schemaVersion: 1, + resources: [ + { + kind: 'provider', + config: { + name: 'example-images', + displayName: 'Example images', + apiFormat, + baseUrl: 'https://images.example.invalid/v1', + catalog: { source: 'models-endpoint' }, + auth: [{ method: 'api-key' }], + }, + expectedModels: [ + { + id: 'example-image', + provider: 'example-images', + tags, + supportsTools: false, + supportsVision: true, + outputsMedia: true, + contextWindow: 32_000, + }, + ], + }, + { + kind: 'governance', + key: 'image_generation', + config: { enabled: true, providerSlug: 'example-images', modelId }, + }, + ], + }); + for (const config of [{ enabled: false }, { enabled: true }]) { + expect( + platformConfigurationSchema.safeParse({ + schemaVersion: 1, + resources: [{ kind: 'governance', key: 'image_generation', config }], + }).success, + ).toBe(true); + } + expect(platformConfigurationSchema.safeParse(declaration()).success).toBe( + true, + ); + expect( + platformConfigurationSchema.safeParse(declaration('anthropic')).success, + ).toBe(false); + expect( + platformConfigurationSchema.safeParse(declaration('openai', ['chat'])) + .success, + ).toBe(false); + expect( + platformConfigurationSchema.safeParse( + declaration('openai', ['image-generation'], 'missing'), + ).success, + ).toBe(false); + }); + + test('rejects raw credential secrets and unrelated environment variables', () => { + for (const changes of [ + { secret: 'must-never-appear' }, + { envName: 'BETTER_AUTH_SECRET' }, + { authMethod: 'api-key' }, + { status: 'disabled', isDefault: true }, + ]) { + const config = platformConfigurationFixture(); + const credential = config.resources.find( + (entry) => entry.kind === 'provider-credential', + )!; + Object.assign(credential.config, changes); + expect(platformConfigurationSchema.safeParse(config).success).toBe(false); + } + }); +}); + +describe('the embedding floor in a declaration', () => { + const embedding = () => + platformConfigurationFixture().resources.find( + (entry) => entry.kind === 'knowledge-embedding', + )!; + const declare = (config: object) => + platformConfigurationSchema.safeParse({ + schemaVersion: 1, + resources: [{ kind: 'knowledge-embedding', config }], + }); + + test('accepts a number, null (clear) and absence (keep); refuses anything else', () => { + expect( + declare({ ...embedding().config, minSimilarity: 0.55 }).success, + ).toBe(true); + expect( + declare({ ...embedding().config, minSimilarity: null }).success, + ).toBe(true); + expect(declare(embedding().config).success).toBe(true); + expect( + declare({ ...embedding().config, minSimilarity: '0.5' }).success, + ).toBe(false); + expect(declare({ ...embedding().config, minSimilarity: 1.5 }).success).toBe( + false, + ); + }); + + test('accepts the serving limits the same three ways, within the platform’s bounds', () => { + for (const fields of [ + { maxConcurrentRequests: 2, minTokensPerSecond: 750 }, + { maxConcurrentRequests: null, minTokensPerSecond: null }, + { minTokensPerSecond: 1349.5 }, + {}, + ]) + expect( + declare({ ...embedding().config, ...fields }).success, + JSON.stringify(fields), + ).toBe(true); + for (const fields of [ + { maxConcurrentRequests: 0 }, + { maxConcurrentRequests: 65 }, + { maxConcurrentRequests: 1.5 }, + { minTokensPerSecond: 0 }, + { minTokensPerSecond: '750' }, + { maxConcurrentRequest: 2 }, + ]) + expect( + declare({ ...embedding().config, ...fields }).success, + JSON.stringify(fields), + ).toBe(false); + }); + + test('converges on a schedule declared out of order, in its own zone spelling', () => { + // A schedule is declared beside the definition and deployment it runs. + const definition = { + name: 'reports/weekly', + projectId: 'project-a', + document: { + name: 'reports/weekly', + nodes: [], + tests: [{ name: 'guard', input: {}, expect: {} }], + }, + settings: null, + presentation: null, + taskContract: null, + }; + const declared = platformConfigurationSchema.parse({ + schemaVersion: 1, + resources: [ + { kind: 'automation-definition', config: definition }, + { + kind: 'automation-deployment', + config: { + name: definition.name, + projectId: definition.projectId, + definitionSha256: configurationHash(definition), + }, + }, + { + kind: 'automation-schedule', + config: { + projectId: 'project-a', + name: 'reports/weekly', + repeat: { + frequency: 'weekly', + interval: 1, + weekdays: [5, 1], + times: ['17:00', '09:00'], + }, + startDate: '2026-10-01', + timezone: 'utc', + enabled: true, + }, + }, + ], + }).resources[2]; + // The readback: the rule in the normal form the platform stores, the + // zone as the declaration spells it. + const stored = { + projectId: 'project-a', + name: 'reports/weekly', + repeat: { + frequency: 'weekly', + interval: 1, + weekdays: [1, 5], + times: ['09:00', '17:00'], + }, + startDate: '2026-10-01', + timezone: 'utc', + enabled: true, + }; + expect(resourceConverged(declared, stored)).toBe(true); + expect(resourceConverged(declared, { ...stored, timezone: 'UTC' })).toBe( + false, + ); + }); + + test('converges per kept setting when a declaration states several', () => { + const resource = (fields: object) => + platformConfigurationSchema.parse({ + schemaVersion: 1, + resources: [ + { + kind: 'knowledge-embedding', + config: { ...embedding().config, ...fields }, + }, + ], + }).resources[0]; + const stored = (fields: object) => ({ ...embedding().config, ...fields }); + const limits = { maxConcurrentRequests: 2, minTokensPerSecond: 750 }; + + // Omitted settings accept whatever is stored; stated ones must match. + expect( + resourceConverged( + resource({ maxConcurrentRequests: 2 }), + stored({ ...limits, minSimilarity: 0.5 }), + ), + ).toBe(true); + expect( + resourceConverged( + resource(limits), + stored({ ...limits, minSimilarity: 0.5 }), + ), + ).toBe(true); + expect( + resourceConverged( + resource(limits), + stored({ maxConcurrentRequests: 2, minTokensPerSecond: 500 }), + ), + ).toBe(false); + expect( + resourceConverged(resource(limits), stored({ maxConcurrentRequests: 2 })), + ).toBe(false); + // Null converges only once that setting is gone, whatever else is kept. + expect( + resourceConverged( + resource({ minTokensPerSecond: null, minSimilarity: null }), + stored({ maxConcurrentRequests: 2 }), + ), + ).toBe(true); + expect( + resourceConverged(resource({ minTokensPerSecond: null }), stored(limits)), + ).toBe(false); + expect( + resourceConverged( + resource({ ...limits, minSimilarity: null }), + stored(limits), + ), + ).toBe(true); + }); + + test('converges on the platform’s own terms — omitted keeps, null clears, a number matches exactly', () => { + const resource = (minSimilarity?: number | null) => + platformConfigurationSchema.parse({ + schemaVersion: 1, + resources: [ + { + kind: 'knowledge-embedding', + config: { + ...embedding().config, + ...(minSimilarity === undefined ? {} : { minSimilarity }), + }, + }, + ], + }).resources[0]; + const stored = (minSimilarity?: number) => ({ + ...embedding().config, + ...(minSimilarity === undefined ? {} : { minSimilarity }), + }); + // Omitted: whatever is stored is fine. + expect(resourceConverged(resource(), stored())).toBe(true); + expect(resourceConverged(resource(), stored(0.55))).toBe(true); + // Null: converged only once nothing is stored. + expect(resourceConverged(resource(null), stored())).toBe(true); + expect(resourceConverged(resource(null), stored(0.55))).toBe(false); + // A number: exact. + expect(resourceConverged(resource(0.6), stored(0.6))).toBe(true); + expect(resourceConverged(resource(0.6), stored(0.55))).toBe(false); + expect(resourceConverged(resource(0.6), stored())).toBe(false); + // Nothing stored at all, and a different model: never converged. + expect(resourceConverged(resource(), null)).toBe(false); + expect( + resourceConverged(resource(), { ...stored(), model: 'Other-model' }), + ).toBe(false); + }); +}); diff --git a/packages/shared/src/config/platform-resources.ts b/packages/shared/src/config/platform-resources.ts new file mode 100644 index 0000000000..ae2ef4f376 --- /dev/null +++ b/packages/shared/src/config/platform-resources.ts @@ -0,0 +1,394 @@ +import { z } from 'zod'; + +import { brandingFormSchema } from '../schemas/branding'; +import { deploymentConfigSchema } from '../schemas/deployment'; +import { FILE_POLICY_TYPES, POLICY_SCHEMAS } from '../schemas/governance'; +import { + KNOWLEDGE_EMBEDDING_KEPT_KEYS, + knowledgeEmbeddingWriteSchema, +} from '../schemas/knowledge'; +import { managedPlatformResourceSchema } from '../schemas/managed-configuration'; +import { + modelCatalogFileSchema, + providerDefinitionSchema, + providerEnvironmentCredentialSchema, +} from '../schemas/providers'; +import { configurationHash } from '../utils/configuration-hash'; + +/** + * The native platform resource model: the configuration resources one + * declaration (`tale config platform`, a managed deployment) or one MCP + * settings change names, how each is identified, which cross-resource rules a + * declaration obeys, and when the stored state already IS what was asked for. + * The platform owns every field, default, permission, lock and side effect; + * this envelope only selects a native resource. + * + * Server-only: identity and convergence compare `configurationHash` digests + * (Node's crypto), which is why it lives outside the browser-safe `schemas/`. + */ + +// Adding a policy to the platform does not require a copy here: the key +// selects the platform's own schema. +const governance = z + .strictObject({ + kind: z.literal('governance'), + key: z + .enum(FILE_POLICY_TYPES) + .refine( + (key) => !['retention_policy', 'dsar_governance'].includes(key), + 'This policy requires its dedicated native workflow', + ), + config: z.unknown(), + }) + .transform((resource, context) => { + const parsed = POLICY_SCHEMAS[resource.key].safeParse(resource.config); + if (!parsed.success) { + context.addIssue({ + code: 'custom', + message: 'Invalid native policy configuration', + }); + return z.NEVER; + } + return { ...resource, config: parsed.data }; + }); + +export const platformResourceSchema = z.union([ + managedPlatformResourceSchema, + governance, + z.strictObject({ + kind: z.literal('branding'), + config: brandingFormSchema.strict(), + }), + z.strictObject({ + kind: z.literal('deployment'), + config: deploymentConfigSchema, + }), + z.strictObject({ + kind: z.literal('knowledge-embedding'), + // The platform keeps a stored similarity floor or serving limit + // (`minSimilarity`, `maxConcurrentRequests`, `minTokensPerSecond`, + // `maxTokensPerMinute`, `maxRequestsPerMinute`) when + // a save omits it and clears it only on an explicit null (the Settings + // form never carries them) — so the declaration speaks the same three + // ways: a value sets it, `null` clears it, omitted leaves what is stored. + config: knowledgeEmbeddingWriteSchema.strict(), + }), + z.strictObject({ + kind: z.literal('provider'), + config: providerDefinitionSchema, + expectedModels: modelCatalogFileSchema + .refine((models) => models.length <= 200) + .optional(), + }), + z.strictObject({ + kind: z.literal('provider-credential'), + config: providerEnvironmentCredentialSchema, + }), +]); +export type PlatformResource = z.infer; + +export function resourceId(resource: PlatformResource): string { + switch (resource.kind) { + case 'project-instructions': + return `project-instructions/${resource.config.projectId}`; + case 'agent-instructions': + case 'agent-tools': + case 'agent-model': + return `${resource.kind}/${resource.config.projectId}/${resource.config.agentId}`; + case 'task-instructions': + return `task-instructions/${resource.config.projectId}/${resource.config.taskId}`; + case 'task-review-context': + return `task-review-context/${resource.config.projectId}/${resource.config.taskId}`; + case 'automation-definition': + case 'automation-deployment': + case 'automation-schedule': + return `${resource.kind}/${resource.config.projectId}/${resource.config.name}`; + case 'governance': + return `governance/${resource.key}`; + case 'provider': + return `provider/${resource.config.name}`; + case 'provider-credential': + return `provider-credential/${resource.config.providerSlug}/${encodeURIComponent(resource.config.name)}`; + default: + return resource.kind; + } +} + +const declarationSchema = z + .strictObject({ + schemaVersion: z.literal(1), + resources: z.array(platformResourceSchema).min(1).max(128), + }) + .superRefine((configuration, context) => { + const ids = configuration.resources.map(resourceId); + const fail = (message: string) => + context.addIssue({ code: 'custom', message }); + if (new Set(ids).size !== ids.length) + fail('Duplicate native configuration resource'); + for (const resource of configuration.resources) { + if ( + resource.kind !== 'automation-deployment' && + resource.kind !== 'automation-schedule' + ) + continue; + const definition = configuration.resources.find( + (candidate) => + candidate.kind === 'automation-definition' && + candidate.config.name === resource.config.name && + candidate.config.projectId === resource.config.projectId, + ); + if ( + !definition || + (resource.kind === 'automation-deployment' && + configurationHash(definition.config) !== + resource.config.definitionSha256) + ) + fail( + 'Managed automation deployment requires its exact declared definition', + ); + if ( + resource.kind === 'automation-schedule' && + !configuration.resources.some( + (candidate) => + candidate.kind === 'automation-deployment' && + candidate.config.name === resource.config.name && + candidate.config.projectId === resource.config.projectId, + ) + ) + fail('Managed schedule requires its declared automation deployment'); + } + const managedNames = configuration.resources + .filter((resource) => resource.kind === 'automation-definition') + .map((resource) => resource.config.name); + if (new Set(managedNames).size !== managedNames.length) + fail( + 'An organization-wide automation cannot have two managed project owners', + ); + const providers = configuration.resources.filter( + (resource) => resource.kind === 'provider', + ); + const defaults = configuration.resources + .filter((resource) => resource.kind === 'provider-credential') + .filter( + (resource) => + resource.config.isDefault && resource.config.status === 'active', + ); + if ( + configuration.resources.some( + (resource) => + resource.kind === 'provider-credential' && + resource.config.isDefault && + resource.config.status !== 'active', + ) + ) + fail('A default credential must be active'); + if ( + new Set(defaults.map((resource) => resource.config.providerSlug)).size !== + defaults.length + ) + fail('A provider cannot have two declared default credentials'); + for (const provider of providers) + if ( + provider.expectedModels?.some( + (model) => model.provider !== provider.config.name, + ) + ) + fail('Expected catalog belongs to another provider'); + for (const resource of configuration.resources) { + if (resource.kind === 'knowledge-embedding') { + const provider = providers.find( + (entry) => entry.config.name === resource.config.providerSlug, + ); + if ( + provider && + (provider.config.embedding !== 'supported' || + (provider.config.baseUrl && + resource.config.baseUrl !== provider.config.baseUrl) || + (provider.expectedModels && + !provider.expectedModels.some( + (model) => + model.id === resource.config.model && + model.tags.includes('embedding'), + ))) + ) + fail( + 'Embedding selection differs from its declared provider and catalog', + ); + } + if (resource.kind === 'governance' && resource.key === 'vision_model') { + const vision = POLICY_SCHEMAS.vision_model.parse(resource.config); + const provider = providers.find( + (entry) => entry.config.name === vision.providerSlug, + ); + if ( + provider?.expectedModels && + !provider.expectedModels.some( + (model) => model.id === vision.modelId && model.supportsVision, + ) + ) + fail('Vision selection differs from its declared catalog'); + } + if ( + resource.kind === 'governance' && + resource.key === 'transcription_model' + ) { + const transcription = POLICY_SCHEMAS.transcription_model.parse( + resource.config, + ); + const provider = providers.find( + (entry) => entry.config.name === transcription.providerSlug, + ); + if ( + provider && + (provider.config.apiFormat !== 'openai' || + (provider.expectedModels && + !provider.expectedModels.some( + (model) => + model.id === transcription.modelId && + model.tags.includes('transcription'), + ))) + ) + fail( + 'Transcription selection differs from its declared provider and catalog', + ); + } + if ( + resource.kind === 'governance' && + resource.key === 'image_generation' + ) { + const image = POLICY_SCHEMAS.image_generation.parse(resource.config); + const provider = providers.find( + (entry) => entry.config.name === image.providerSlug, + ); + // The same admission a turn applies: an OpenAI-format provider, and + // a pinned model its declared catalog lists as an image generator. + if ( + provider && + (provider.config.apiFormat !== 'openai' || + (provider.expectedModels && + !provider.expectedModels.some( + (model) => + model.id === image.modelId && + model.tags.includes('image-generation'), + ))) + ) + fail( + 'Image generation selection differs from its declared provider and catalog', + ); + } + } + }); +export type PlatformConfiguration = z.infer; + +/** Normalization may add native defaults, but must not hide misspelled fields. */ +function discardedKeys(input: unknown, parsed: unknown): boolean { + if (Array.isArray(input)) + return ( + !Array.isArray(parsed) || + input.some((entry, i) => discardedKeys(entry, parsed[i])) + ); + if (input && typeof input === 'object') { + if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) + return true; + return Object.entries(input).some( + ([key, value]) => + !Object.hasOwn(parsed, key) || + discardedKeys(value, Reflect.get(parsed, key)), + ); + } + return false; +} + +export const platformConfigurationSchema = z + .unknown() + .transform((input, context) => { + const parsed = declarationSchema.safeParse(input); + if (!parsed.success || discardedKeys(input, parsed.data)) { + context.addIssue({ + code: 'custom', + message: 'Unsupported resources or invalid native configuration fields', + }); + return z.NEVER; + } + return parsed.data; + }); + +export const sameConfiguration = (left: unknown, right: unknown) => + configurationHash(left) === configurationHash(right); + +function isObject(value: unknown): value is object { + return value !== null && typeof value === 'object' && !Array.isArray(value); +} + +const keptSettings: readonly string[] = KNOWLEDGE_EMBEDDING_KEPT_KEYS; + +/** An embedding config without the settings a write keeps when it omits + * them: what remains names the model — provider, credential, tag, width and + * endpoint. */ +function embeddingModelOf(value: object): Record { + return Object.fromEntries( + Object.entries(value).filter(([key]) => !keptSettings.includes(key)), + ); +} + +/** Whether a declared embedding names the model already stored, so that it + * changes at most the kept settings — the similarity floor and the serving + * limits, none of which touches the vector space. */ +export function sameEmbeddingModel(declared: object, current: unknown) { + return ( + isObject(current) && + configurationHash(embeddingModelOf(declared)) === + configurationHash(embeddingModelOf(current)) + ); +} + +/** + * Whether the native state already IS what the declaration asks for — the + * one comparison plan, apply and readback all use, so a resource whose + * write semantics are not "replace the whole object" converges on the + * platform's own terms rather than never at all. + * + * Every resource compares whole, except the embedding's kept settings + * (`minSimilarity`, `maxConcurrentRequests`, `minTokensPerSecond`, + * `maxTokensPerMinute`, `maxRequestsPerMinute`): the + * platform keeps a stored one when the write omits it and clears it on an + * explicit null, so a declaration that omits one converges with ANY stored + * value, one that declares `null` converges only once none is stored, and a + * declared value must match exactly — each setting on its own. + */ +export function resourceConverged( + resource: PlatformResource, + current: unknown, +): boolean { + return resourceConvergedWithHash( + resource, + current, + configurationHash(resource.config), + ); +} + +/** A retained plan holds the declaration hash, not its original secret-free + * object. Compare that hash with precisely the declarations native readback + * satisfies, including the kept settings' preserve/clear semantics. */ +export function resourceConvergedWithHash( + resource: PlatformResource, + current: unknown, + desiredSha256: string, +): boolean { + if (resource.kind !== 'knowledge-embedding' || !isObject(current)) + return configurationHash(current) === desiredSha256; + // Every declaration this state satisfies: each kept setting either + // omitted (whatever is stored stays) or stated as what is stored — `null` + // when nothing is. + let readings = [embeddingModelOf(current)]; + for (const key of keptSettings) { + const stored: unknown = Reflect.get(current, key); + readings = readings.flatMap((reading) => [ + reading, + { ...reading, [key]: stored ?? null }, + ]); + } + return readings.some( + (reading) => configurationHash(reading) === desiredSha256, + ); +} diff --git a/packages/shared/src/db/serializable.test.ts b/packages/shared/src/db/serializable.test.ts index cab1ac5157..ad8f8d77be 100644 --- a/packages/shared/src/db/serializable.test.ts +++ b/packages/shared/src/db/serializable.test.ts @@ -3,6 +3,7 @@ import { describe, expect, it } from 'vitest'; import { isSerializationFailure, + localQueueDepth, markRetryQueueKey, RETRY_QUEUE_LOCK_CLASS, retryQueueKeyOf, @@ -521,3 +522,106 @@ describe('transactSerializable — nested retry queues, failure paths', () => { expect(locks).toEqual(['task-comment:t_1', 'audit-chain:org_1']); }); }); + +describe('transactSerializable — the process-local queue', () => { + /** A body whose first, unqueued attempt loses at `queueKey`, so its retry + * runs queued — the way a write reaches the queue. */ + function queuedAfterLoss( + body: (tx: TransactionSql) => Promise, + ): (tx: TransactionSql) => Promise { + let calls = 0; + return (tx) => { + calls += 1; + return calls === 1 + ? Promise.reject(markRetryQueueKey(sqlstateError('40001'), queueKey)) + : body(tx); + }; + } + + it('holds one connection per hot key: the next queued attempt reserves only once the first is done', async () => { + const { runner, reservations } = createQueueRunner([]); + let releaseFirst: () => void = () => undefined; + const firstHeld = new Promise((resolve) => { + releaseFirst = resolve; + }); + const first = transactSerializable( + runner, + queuedAfterLoss(async () => { + await firstHeld; + return 'first'; + }), + { sleep: noSleep }, + ); + const second = transactSerializable( + runner, + queuedAfterLoss(() => Promise.resolve('second')), + { sleep: noSleep }, + ); + await new Promise((resolve) => setTimeout(resolve, 10)); + // The second waits in memory: no connection reserved, none parked on + // the database lock. + expect(reservations).toHaveLength(1); + expect(localQueueDepth(queueKey)).toBe(2); + releaseFirst(); + expect(await first).toBe('first'); + expect(await second).toBe('second'); + expect(reservations).toHaveLength(2); + expect(reservations.every((r) => r.released() === 1)).toBe(true); + expect(localQueueDepth(queueKey)).toBe(0); + }); + + it('two attempts marked with the same keys in opposite orders both finish', async () => { + const { runner } = createQueueRunner([]); + const other = 'task-comment:t_9'; + const lostAt = (keys: string[]) => { + let calls = 0; + return () => { + calls += 1; + if (calls > 1) return Promise.resolve('done'); + let error = sqlstateError('40001'); + for (const key of [...keys].reverse()) + error = markRetryQueueKey(error, key); + return Promise.reject(error); + }; + }; + const results = await Promise.race([ + Promise.all([ + transactSerializable(runner, lostAt([queueKey, other]), { + sleep: noSleep, + }), + transactSerializable(runner, lostAt([other, queueKey]), { + sleep: noSleep, + }), + ]), + new Promise((resolve) => setTimeout(() => resolve('hung'), 2_000)), + ]); + expect(results).toEqual(['done', 'done']); + expect(localQueueDepth(queueKey)).toBe(0); + expect(localQueueDepth(other)).toBe(0); + }); + + it('lets the queue go on after an attempt that failed for good', async () => { + const { runner } = createQueueRunner([], { + failOn: (text) => + text.startsWith('SELECT boom') ? sqlstateError('23505') : undefined, + }); + await expect( + transactSerializable( + runner, + queuedAfterLoss(async (tx) => { + await tx`SELECT boom`; + return 'never'; + }), + { sleep: noSleep }, + ), + ).rejects.toMatchObject({ code: '23505' }); + expect(localQueueDepth(queueKey)).toBe(0); + await expect( + transactSerializable( + runner, + queuedAfterLoss(() => Promise.resolve('next')), + { sleep: noSleep }, + ), + ).resolves.toBe('next'); + }); +}); diff --git a/packages/shared/src/db/serializable.ts b/packages/shared/src/db/serializable.ts index 487c424a92..7ef7d350ad 100644 --- a/packages/shared/src/db/serializable.ts +++ b/packages/shared/src/db/serializable.ts @@ -179,6 +179,51 @@ function transactionOver(reserved: ReservedSql): TransactionSql { return tx; } +/** + * The queued attempts of THIS process, per key: a promise chain each queued + * attempt joins before it reserves a connection. + * + * The database lock alone orders queued attempts across processes, but each + * one waits for it on a connection it has already reserved. A burst of + * writes to one hot key (an organization's audit chain) used to park one + * pooled connection per waiting retry on `pg_advisory_lock`, until the pool + * was empty and every other request of the process — reads included — + * queued behind them for its whole deadline. Waiting here first costs no + * connection: per process, one attempt per key holds a connection at a + * time, and the rest wait in memory. + */ +const localQueues = new Map; waiting: number }>(); + +/** Join the process-local queue of `key`; resolves with its release. */ +async function acquireLocal(key: string): Promise<() => void> { + let entry = localQueues.get(key); + if (entry === undefined) { + entry = { tail: Promise.resolve(), waiting: 0 }; + localQueues.set(key, entry); + } + const queue = entry; + queue.waiting += 1; + let release: () => void = () => undefined; + const done = new Promise((resolve) => { + release = resolve; + }); + const previous = queue.tail; + queue.tail = previous.then(() => done); + await previous; + return () => { + release(); + queue.waiting -= 1; + if (queue.waiting === 0 && localQueues.get(key) === queue) { + localQueues.delete(key); + } + }; +} + +/** Queued attempts of this process waiting on, or holding, `key` (tests). */ +export function localQueueDepth(key: string): number { + return localQueues.get(key)?.waiting ?? 0; +} + /** * One serializable attempt queued on `keys`: session advisory locks in that * order → BEGIN → callback → COMMIT → unlocks in reverse, all on one @@ -191,6 +236,26 @@ async function beginQueued( reserve: () => Promise, keys: readonly string[], callback: (tx: TransactionSql) => Promise, +): Promise { + // In one fixed order, whatever order the keys were marked in: two queued + // attempts of this process that took the same keys in opposite orders + // would wait on each other for good — nothing detects a cycle of promise + // chains the way the database detects one of locks. Every key is held + // locally before any database lock is taken, so this order cannot meet a + // database wait in a cycle either. + const releases: (() => void)[] = []; + try { + for (const key of [...keys].sort()) releases.push(await acquireLocal(key)); + return await beginQueuedOnConnection(reserve, keys, callback); + } finally { + for (const release of releases.reverse()) release(); + } +} + +async function beginQueuedOnConnection( + reserve: () => Promise, + keys: readonly string[], + callback: (tx: TransactionSql) => Promise, ): Promise { const reserved = await reserve(); try { diff --git a/packages/shared/src/schemas/automation-pack.test.ts b/packages/shared/src/schemas/automation-pack.test.ts index 3820114de7..6ee2bf7863 100644 --- a/packages/shared/src/schemas/automation-pack.test.ts +++ b/packages/shared/src/schemas/automation-pack.test.ts @@ -48,8 +48,8 @@ describe('the shared manifest contract', () => { ).toBe(false); }); - it('keeps trigger declarations strict without adding trigger-store rules', () => { - for (const kind of ['schedule', 'event', 'webhook']) { + it('declares triggers with the shared trigger contract, strictly', () => { + for (const kind of ['event', 'webhook']) { expect(automationTriggerSchema.parse({ kind })).toEqual({ kind }); } const schedule = { @@ -58,10 +58,22 @@ describe('the shared manifest contract', () => { timezone: 'Europe/Zurich', }; expect(automationTriggerSchema.parse(schedule)).toEqual(schedule); + const rule = { + kind: 'schedule', + repeat: { frequency: 'minutely', interval: 5 }, + timezone: 'UTC', + input: { owner: 'tale' }, + }; + expect(automationTriggerSchema.parse(rule)).toEqual(rule); for (const value of [ { kind: 'api-key' }, { kind: 'webhook', unknown: true }, { kind: 'event', event: '' }, + // A schedule names a repeat rule or a cron expression. + { kind: 'schedule' }, + // The anchor is the install day; a pack mints no token to rotate. + { ...rule, startDate: '2026-10-08' }, + { kind: 'webhook', rotateToken: true }, ]) { expect(automationTriggerSchema.safeParse(value).success).toBe(false); } diff --git a/packages/shared/src/schemas/automation-pack.ts b/packages/shared/src/schemas/automation-pack.ts index 4c4dafbdaf..0cb22332cf 100644 --- a/packages/shared/src/schemas/automation-pack.ts +++ b/packages/shared/src/schemas/automation-pack.ts @@ -3,6 +3,7 @@ import { z } from 'zod/v4'; import { automationSettingsSchema } from './automation-settings'; +import { triggerWriteSchema } from './automation-trigger'; import { isValidSkillSlug } from './skills'; import { taskSubjectContractSchema } from './task-contract'; @@ -30,24 +31,36 @@ export const MAX_AUTOMATION_BUNDLE_ENTRIES = 500; const MAX_PACK_SKILLS = 20; /** - * What starts a pack's automation. The kinds mirror the trigger store: a pack - * DECLARES what it wants and the host creates the binding once per - * organization, so an organization's own edits always win afterwards. There is - * no `api-key` kind — a programmatic start is what the REST and MCP surfaces - * are for, and the store refuses the kind, so a pack that declared it would ask - * for a binding that cannot be created. + * What starts a pack's automation — the shared trigger contract + * (`triggerWriteSchema`), so a pack declares a trigger exactly as the editor, + * REST and MCP write one: a schedule's repeat rule or cron in a zone, a + * webhook, an event, and any fixed input. A pack DECLARES what it wants and + * the host creates the binding once per organization, so an organization's + * own edits always win afterwards. Two keys are not a pack's to declare: a + * schedule's `startDate` (the anchor is the day the pack is installed) and a + * webhook's `rotateToken` (a pack mints nothing to rotate). There is no + * `api-key` kind — a programmatic start is what the REST and MCP surfaces + * are for. + * + * A pack's `enabled` reads as **false** when omitted, unlike a write, where + * it reads as true: a seeded automation has nothing deployed, so its trigger + * waits for the person who deploys it to turn it on. The default is applied + * where the trigger is bound (the provisioning), not here — the schema hands + * the manifest back as written, which a native release compares against. */ -export const automationTriggerSchema = z - .object({ - kind: z.enum(['schedule', 'webhook', 'event']), - /** Cron expression, for `schedule`. */ - cron: z.string().min(1).optional(), - /** IANA timezone the cron is read in, for `schedule`. */ - timezone: z.string().min(1).optional(), - /** Platform event name, for `event`. */ - event: z.string().min(1).optional(), - }) - .strict(); +export const automationTriggerSchema = triggerWriteSchema.superRefine( + (trigger, ctx) => { + for (const key of ['startDate', 'rotateToken'] as const) { + if (key in trigger) { + ctx.addIssue({ + code: 'custom', + message: `a pack does not declare "${key}"`, + path: [key], + }); + } + } + }, +); /** Per-locale overrides for the manifest's display text; absent locales fall * back to the top-level fields, which are authored in English. */ diff --git a/packages/shared/src/schemas/automation-replay.test.ts b/packages/shared/src/schemas/automation-replay.test.ts new file mode 100644 index 0000000000..3f2e611c47 --- /dev/null +++ b/packages/shared/src/schemas/automation-replay.test.ts @@ -0,0 +1,52 @@ +import { describe, expect, it } from 'vitest'; + +import { + appReplayRequestSchema, + replayRequestSchema, +} from './automation-replay'; + +describe('replayRequestSchema', () => { + it('takes each kind with what it needs', () => { + expect(replayRequestSchema.safeParse({ kind: 'again' }).success).toBe(true); + expect( + replayRequestSchema.safeParse({ + kind: 'from', + from: 'send', + version: 'deployed', + mode: 'live', + }).success, + ).toBe(true); + expect( + replayRequestSchema.safeParse({ kind: 'edited', input: null }).success, + ).toBe(true); + expect( + replayRequestSchema.safeParse({ kind: 'again', version: 4 }).success, + ).toBe(true); + }); + + it.each([ + [{ kind: 'from' }, 'from'], + [{ kind: 'again', from: 'send' }, 'from'], + [{ kind: 'edited' }, 'input'], + [{ kind: 'again', input: { a: 1 } }, 'input'], + [{ kind: 'again', version: 0 }, 'version'], + [{ kind: 'again', mode: 'preview' }, 'mode'], + [{ kind: 'again', extra: true }, ''], + ])('refuses %j at %s', (body, path) => { + const parsed = replayRequestSchema.safeParse(body); + expect(parsed.success).toBe(false); + expect(parsed.error?.issues.map((issue) => issue.path.join('.'))).toContain( + path, + ); + }); + + it('lets the app send a nonce, and nobody else', () => { + expect( + appReplayRequestSchema.safeParse({ kind: 'again', requestId: 'r1' }) + .success, + ).toBe(true); + expect( + replayRequestSchema.safeParse({ kind: 'again', requestId: 'r1' }).success, + ).toBe(false); + }); +}); diff --git a/packages/shared/src/schemas/automation-replay.ts b/packages/shared/src/schemas/automation-replay.ts new file mode 100644 index 0000000000..5117697a86 --- /dev/null +++ b/packages/shared/src/schemas/automation-replay.ts @@ -0,0 +1,82 @@ +import { z } from 'zod'; + +import { REPLAY_KINDS } from '../automation-replay'; + +/** + * What running an automation run again asks for, as every door takes it — + * the app, REST and the agent tools: how (`again` with the run's own input, + * `edited` with an input the person changed, `from` one of its steps, a + * fork that keeps what the run finished outside that step and what it + * feeds), which version (the run's own by default), in which mode (the + * run's own by default), and, for `edited`, the input. + */ + +/** The request's fields, for a door that adds its own beside them. */ +export const replayRequestFields = { + kind: z.enum(REPLAY_KINDS), + from: z.string().trim().min(1).max(200).optional(), + version: z + .union([ + z.enum(['same', 'deployed', 'latest']), + z.number().int().min(1).max(1_000_000), + ]) + .optional(), + mode: z.enum(['mock', 'live']).optional(), + input: z.unknown().optional(), +}; + +export type ReplayRequestShape = z.infer< + z.ZodObject +>; + +/** The rules between the fields: a fork names its step and only a fork + * does; an edited replay carries its input and only it does. */ +export function checkReplayRequest( + value: ReplayRequestShape, + ctx: z.RefinementCtx, +): void { + if (value.kind === 'from' && value.from === undefined) { + ctx.addIssue({ + code: 'custom', + path: ['from'], + message: 'names the step to run again from', + }); + } + if (value.kind !== 'from' && value.from !== undefined) { + ctx.addIssue({ + code: 'custom', + path: ['from'], + message: 'is taken only by a replay from a step (kind "from")', + }); + } + if (value.kind === 'edited' && !('input' in value)) { + ctx.addIssue({ + code: 'custom', + path: ['input'], + message: 'is the input an edited replay runs with', + }); + } + if (value.kind !== 'edited' && value.input !== undefined) { + ctx.addIssue({ + code: 'custom', + path: ['input'], + message: + 'is taken only by an edited replay (kind "edited"); the others run with the run’s own input', + }); + } +} + +export const replayRequestSchema = z + .strictObject(replayRequestFields) + .superRefine(checkReplayRequest); + +export type ReplayRequestBody = z.infer; + +/** The app's request: the same, with a nonce so a double click starts one + * replay. */ +export const appReplayRequestSchema = z + .strictObject({ + ...replayRequestFields, + requestId: z.string().trim().min(1).max(128).optional(), + }) + .superRefine(checkReplayRequest); diff --git a/packages/shared/src/schemas/automation-trigger.test.ts b/packages/shared/src/schemas/automation-trigger.test.ts new file mode 100644 index 0000000000..8c6b761a42 --- /dev/null +++ b/packages/shared/src/schemas/automation-trigger.test.ts @@ -0,0 +1,430 @@ +import { describe, expect, it } from 'vitest'; + +import { canonicalTimeZone } from '../time-zone'; +import { + isoDateSchema, + TRIGGER_ISSUE_CODES, + triggerIssues, + type TriggerIssue, + triggerSkipDetailSchema, + triggerViewSchema, + triggerWriteJsonSchema, + triggerWriteSchema, + timeZoneSchema, +} from './automation-trigger'; +import { SCHEDULE_ISSUE_CODES } from './schedule-rule'; + +/** The coded problems a write of `value` is refused with; none when it + * parses. */ +function issuesOf(value: unknown): Pick[] { + const parsed = triggerWriteSchema.safeParse(value); + if (parsed.success) return []; + return triggerIssues(parsed.error, value).map(({ path, code }) => ({ + path, + code, + })); +} + +const daily = { frequency: 'daily', interval: 1, times: ['09:00'] }; + +describe('TRIGGER_ISSUE_CODES', () => { + it('lists the twenty codes the doors answer, the schedule rule’s among them', () => { + expect(TRIGGER_ISSUE_CODES).toHaveLength(21); + expect(new Set(TRIGGER_ISSUE_CODES).size).toBe(21); + for (const code of SCHEDULE_ISSUE_CODES) { + expect(TRIGGER_ISSUE_CODES).toContain(code); + } + for (const code of TRIGGER_ISSUE_CODES) { + expect(code).toMatch(/^[a-z]+\.[a-z_]+$/); + } + }); +}); + +describe('triggerWriteSchema', () => { + it.each([ + ['a cron schedule', { kind: 'schedule', cron: '0 9 * * 1' }], + [ + 'a repeat rule in a zone, with a start day and a catch-up policy', + { + kind: 'schedule', + repeat: daily, + timezone: 'Europe/Zurich', + startDate: '2026-10-08', + catchUp: 'skip', + enabled: false, + }, + ], + [ + 'a webhook that rotates its address', + { kind: 'webhook', rotateToken: true }, + ], + ['an event', { kind: 'event', event: 'task.created' }], + ])('accepts %s', (_case, value) => { + expect(issuesOf(value)).toEqual([]); + }); + + it.each([ + [ + 'neither a rule nor a cron', + { kind: 'schedule' }, + [{ path: 'repeat', code: 'schedule.cron_or_repeat' }], + ], + [ + 'a blank cron and no rule', + { kind: 'schedule', cron: ' ' }, + [{ path: 'repeat', code: 'schedule.cron_or_repeat' }], + ], + [ + 'both a rule and a cron', + { kind: 'schedule', cron: '0 9 * * *', repeat: daily, timezone: 'UTC' }, + [{ path: 'repeat', code: 'schedule.cron_or_repeat' }], + ], + [ + 'a start day beside a cron', + { kind: 'schedule', cron: '0 9 * * *', startDate: '2026-10-08' }, + [{ path: 'startDate', code: 'schedule.start_date' }], + ], + [ + 'a rule without a zone', + { kind: 'schedule', repeat: daily }, + [{ path: 'timezone', code: 'timezone.required' }], + ], + [ + 'a blank zone', + { kind: 'schedule', cron: '0 9 * * *', timezone: '' }, + [{ path: 'timezone', code: 'timezone.blank' }], + ], + [ + 'a zone nobody can resolve', + { kind: 'schedule', cron: '0 9 * * *', timezone: 'Mars/Olympus_Mons' }, + [{ path: 'timezone', code: 'timezone.unknown' }], + ], + [ + 'a start day no calendar has', + { + kind: 'schedule', + repeat: daily, + timezone: 'UTC', + startDate: '2026-02-29', + }, + [{ path: 'startDate', code: 'schedule.start_date' }], + ], + [ + 'a start day past 2999', + { + kind: 'schedule', + repeat: daily, + timezone: 'UTC', + startDate: '3000-01-01', + }, + [{ path: 'startDate', code: 'schedule.start_date' }], + ], + [ + 'a rule the schedule schema refuses', + { + kind: 'schedule', + repeat: { ...daily, times: ['25:00'] }, + timezone: 'UTC', + }, + [{ path: 'repeat.times.0', code: 'schedule.time_format' }], + ], + [ + 'a catch-up policy it does not know', + { kind: 'schedule', cron: '0 9 * * *', catchUp: 'all' }, + [{ path: 'catchUp', code: 'invalid_value' }], + ], + [ + 'a key of another kind, and a key of none', + { kind: 'webhook', cron: '0 9 * * *', every: 'day' }, + [ + { path: 'cron', code: 'trigger.key_other_kind' }, + { path: 'every', code: 'unrecognized_keys' }, + ], + ], + [ + 'a blank event', + { kind: 'event', event: ' ' }, + [{ path: 'event', code: 'event.required' }], + ], + [ + 'a schedule key on an event', + { kind: 'event', event: 'task.created', catchUp: 'skip' }, + [{ path: 'catchUp', code: 'trigger.key_other_kind' }], + ], + ])('refuses %s', (_case, value, expected) => { + expect(issuesOf(value)).toEqual(expected); + }); + + it('names a key of another kind in a sentence a caller can act on', () => { + const value = { kind: 'webhook', repeat: daily }; + const parsed = triggerWriteSchema.safeParse(value); + expect(parsed.success).toBe(false); + if (parsed.success) return; + expect(triggerIssues(parsed.error, value)[0]?.message).toBe( + '"repeat" belongs to schedule triggers — a webhook trigger does not take it.', + ); + }); + + it('stores the zone in one spelling', () => { + expect( + triggerWriteSchema.parse({ + kind: 'schedule', + cron: '0 9 * * *', + timezone: ' europe/zurich ', + }), + ).toEqual({ + kind: 'schedule', + cron: '0 9 * * *', + timezone: 'Europe/Zurich', + }); + }); +}); + +describe('timeZoneSchema', () => { + it.each([ + ['UTC', 'UTC'], + ['utc', 'UTC'], + [' Europe/Zurich ', 'Europe/Zurich'], + ['+05:30', '+05:30'], + ])('reads %j as %j', (value, expected) => { + expect(timeZoneSchema.parse(value)).toBe(expected); + expect(canonicalTimeZone(value)).toBe(expected); + }); + + it.each(['', ' ', 'Nowhere/City'])('refuses %j', (value) => { + expect(timeZoneSchema.safeParse(value).success).toBe(false); + expect(canonicalTimeZone(value)).toBeNull(); + }); +}); + +describe('isoDateSchema', () => { + it.each(['2000-01-01', '2028-02-29', '2999-12-31'])('accepts %s', (value) => { + expect(isoDateSchema.safeParse(value).success).toBe(true); + }); + + it.each(['1999-12-31', '2026-13-01', '2026-04-31', '2026-1-1', 'today'])( + 'refuses %s', + (value) => { + expect(isoDateSchema.safeParse(value).success).toBe(false); + }, + ); +}); + +describe('triggerSkipDetailSchema', () => { + const missed = { + count: 2, + capped: false, + firstAt: 1, + lastAt: 2, + policy: 'latest', + }; + + it.each([ + { reason: 'missed_occurrences', missed, firedLatest: true }, + { reason: 'not_deployed', occurrence: 3 }, + { reason: 'not_deployed', occurrence: 3, missed }, + { + reason: 'start_refused', + occurrence: 3, + code: 'AUTOMATION_INPUT_INVALID', + version: 4, + message: 'Run input does not match the automation inputs schema', + issues: [{ path: 'owner', message: 'is required' }], + }, + { + reason: 'start_refused', + occurrence: 3, + code: 'PROJECT_ARCHIVED', + version: null, + message: 'The project is archived.', + }, + { reason: 'unusable_cron', message: 'unknown time zone "Mars"' }, + ])('reads a $reason detail', (detail) => { + expect(triggerSkipDetailSchema.safeParse(detail).success).toBe(true); + }); + + it('refuses more than ten problems, a long sentence, and a pause (which has no detail)', () => { + const refused = { + reason: 'start_refused', + occurrence: 3, + code: 'AUTOMATION_INPUT_INVALID', + version: 1, + message: 'x', + }; + expect( + triggerSkipDetailSchema.safeParse({ + ...refused, + issues: Array.from({ length: 11 }, () => ({ path: 'a', message: 'b' })), + }).success, + ).toBe(false); + expect( + triggerSkipDetailSchema.safeParse({ + ...refused, + message: 'x'.repeat(501), + }).success, + ).toBe(false); + expect( + triggerSkipDetailSchema.safeParse({ reason: 'paused_after_failures' }) + .success, + ).toBe(false); + }); +}); + +describe('staticInputSchema, through the write schema', () => { + it('takes a JSON object of values on every kind', () => { + for (const kind of ['schedule', 'webhook', 'event'] as const) { + const base = + kind === 'schedule' + ? { kind, cron: '0 9 * * *' } + : kind === 'event' + ? { kind, event: 'task.created' } + : { kind }; + expect( + issuesOf({ ...base, input: { owner: 'tale', tags: ['a'], n: 1 } }), + ).toEqual([]); + } + }); + + it.each([ + ['an array', [1, 2], 'input.not_object', 'input'], + ['text', 'owner=tale', 'input.not_object', 'input'], + [ + 'a field the trigger sets itself', + { owner: 'tale', payload: {} }, + 'input.reserved_key', + 'input', + ], + [ + 'more than 16 KiB', + { note: 'x'.repeat(16 * 1024) }, + 'input.too_large', + 'input', + ], + [ + 'a NUL character, which the database cannot store', + { note: 'before\u0000after' }, + 'input.unstorable_text', + 'input', + ], + [ + 'a NUL character in a key', + { ['no\u0000te']: 1 }, + 'input.unstorable_text', + 'input', + ], + [ + 'half of an emoji, deep in a list', + { notes: [{ text: 'cut \ud83d here' }] }, + 'input.unstorable_text', + 'input', + ], + ])('refuses %s', (_case, input, code, path) => { + expect(issuesOf({ kind: 'webhook', input })).toEqual([{ path, code }]); + }); + + it('keeps a whole emoji', () => { + expect(issuesOf({ kind: 'webhook', input: { note: 'done 😀' } })).toEqual( + [], + ); + }); +}); + +describe('triggerViewSchema', () => { + const view = { + id: 'trg_1', + name: 'ops/nightly', + kind: 'schedule', + cron: null, + repeat: daily, + startDate: '2026-10-08', + timezone: 'Europe/Zurich', + catchUp: 'latest', + input: { owner: 'tale' }, + event: null, + hasToken: false, + enabled: true, + nextRunAt: 1_791_536_400_000, + lastFiredAt: null, + lastRunId: null, + lastSkippedAt: null, + lastSkipReason: null, + lastSkipDetail: null, + consecutiveFailures: 0, + lastFailedAt: null, + lastFailureCode: null, + lastFailedRunId: null, + }; + + it('reads a schedule on a repeat rule, its zone, its next start and its fixed input', () => { + expect(triggerViewSchema.parse(view)).toEqual(view); + }); + + it('names the webhook secret only as hasToken: a token key is refused', () => { + expect(triggerViewSchema.safeParse({ ...view, token: 'x' }).success).toBe( + false, + ); + }); + + it('takes the reason a schedule missed occurrences', () => { + expect( + triggerViewSchema.parse({ + ...view, + lastSkippedAt: 9_000, + lastSkipReason: 'missed_occurrences', + lastSkipDetail: { + reason: 'missed_occurrences', + missed: { + count: 2, + capped: false, + firstAt: 1_000, + lastAt: 2_000, + policy: 'latest', + }, + firedLatest: true, + }, + }).lastSkipReason, + ).toBe('missed_occurrences'); + }); +}); + +/** + * The JSON Schema the doors publish (MCP's tool list, the OpenAPI + * document) is the write schema itself: one strict branch per kind, the + * descriptions from its `.meta`, and nothing a host would have to resolve + * against a root it does not carry. + */ +describe('triggerWriteJsonSchema', () => { + it.each(['draft-2020-12', 'openapi-3.0'] as const)( + 'renders one strict branch per kind with no reference to resolve (%s)', + (target) => { + const schema = triggerWriteJsonSchema(target); + const text = JSON.stringify(schema); + expect(text).not.toContain('$ref'); + expect(text).not.toContain('$defs'); + expect(schema).not.toHaveProperty('$schema'); + expect(schema.oneOf).toHaveLength(3); + expect(schema).toMatchObject({ + oneOf: [ + { additionalProperties: false, properties: { repeat: {} } }, + { additionalProperties: false, properties: { rotateToken: {} } }, + { additionalProperties: false, properties: { event: {} } }, + ], + }); + }, + ); + + it('publishes the fixed input as a free-form object with its own words', () => { + const input = { + type: 'object', + additionalProperties: true, + description: expect.stringContaining('16 KiB'), + }; + expect(triggerWriteJsonSchema('draft-2020-12')).toMatchObject({ + oneOf: [ + { properties: { input } }, + { properties: { input } }, + { properties: { input } }, + ], + }); + }); +}); diff --git a/packages/shared/src/schemas/automation-trigger.ts b/packages/shared/src/schemas/automation-trigger.ts new file mode 100644 index 0000000000..4df7f0fd44 --- /dev/null +++ b/packages/shared/src/schemas/automation-trigger.ts @@ -0,0 +1,564 @@ +import { z } from 'zod'; + +import { canonicalTimeZone } from '../time-zone'; +import { epochMsSchema } from './epoch-ms'; +import { + SCHEDULE_ISSUE_CODES, + scheduleIssueCode, + scheduleRuleSchema, +} from './schedule-rule'; + +/** + * What starts an automation — the one zod source of a trigger's shape. The + * app's trigger editor, REST, MCP, automation packs and managed + * configuration all write it, and the store parses it again for the callers + * that reach it without a schema. + * + * The schema is structural. What needs the platform — reading a cron + * expression, the events the platform raises, whether a rule ever comes due + * — the store checks, and both answer `AUTOMATION_TRIGGER_INVALID` with the + * same coded issues (`TRIGGER_ISSUE_CODES`), which the editor turns into one + * sentence per field. + * + * Imports only `zod` and its siblings: the browser and the server both load + * it. + */ + +export type TriggerKind = 'schedule' | 'webhook' | 'event'; + +/** The refusals a trigger can earn, in the dotted form the doors answer + * under `data.issues[].code`. A problem of shape the editor never sends (a + * wrong type, an unknown key) keeps zod's own code. */ +export const TRIGGER_ISSUE_CODES = [ + 'trigger.key_other_kind', + 'schedule.cron_or_repeat', + 'schedule.cron_unreadable', + 'schedule.cron_impossible_date', + ...SCHEDULE_ISSUE_CODES, + 'schedule.start_date', + 'timezone.blank', + 'timezone.unknown', + 'timezone.required', + 'input.not_object', + 'input.reserved_key', + 'input.too_large', + 'input.unstorable_text', + 'event.required', + 'event.unknown', +] as const; + +export type TriggerIssueCode = (typeof TRIGGER_ISSUE_CODES)[number]; + +/** One refusal of a trigger: the dotted field path (`repeat.times`), its + * code, and a sentence for a reader without the editor. */ +export interface TriggerIssue { + path: string; + code: TriggerIssueCode | (string & {}); + message: string; +} + +function isTriggerIssueCode(value: unknown): value is TriggerIssueCode { + return (TRIGGER_ISSUE_CODES as readonly unknown[]).includes(value); +} + +function addIssue( + ctx: z.RefinementCtx, + code: TriggerIssueCode, + message: string, + path: (string | number)[], +): void { + ctx.addIssue({ code: 'custom', message, path, params: { code } }); +} + +/** Which kind each optional key belongs to. A key of another kind is + * refused by name: a webhook trigger used to store a `cron` and read back as + * one that also ran on a schedule. */ +const KEY_KINDS: Readonly> = { + cron: 'schedule', + repeat: 'schedule', + startDate: 'schedule', + timezone: 'schedule', + catchUp: 'schedule', + event: 'event', + rotateToken: 'webhook', +}; + +/** The kind `key` belongs to, or null when it is no kind's own key. */ +export function triggerKeyKind(key: string): TriggerKind | null { + return Object.hasOwn(KEY_KINDS, key) ? (KEY_KINDS[key] ?? null) : null; +} + +/** + * A time zone: an IANA name, in any case, or a fixed offset such as + * `+05:30`, trimmed and stored in `Intl`'s spelling (`europe/zurich` → + * `Europe/Zurich`). A blank zone is refused: it used to save, read as + * enabled and never fire. + */ +export const timeZoneSchema = z + .string() + .max(100) + .transform((value, ctx) => { + if (value.trim() === '') { + addIssue( + ctx, + 'timezone.blank', + 'A time zone cannot be blank; name one, such as "Europe/Zurich" or "UTC".', + [], + ); + return z.NEVER; + } + const zone = canonicalTimeZone(value); + if (zone === null) { + addIssue( + ctx, + 'timezone.unknown', + `"${value.trim()}" is not a valid IANA time zone (e.g. "Europe/Zurich" or "UTC").`, + [], + ); + return z.NEVER; + } + return zone; + }) + .meta({ + description: + 'An IANA time zone such as "Europe/Zurich", or a fixed offset such as "+05:30". Stored in its canonical spelling.', + }); + +const ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/; + +/** Whether `text` is a `YYYY-MM-DD` day a calendar has, from 2000 to 2999. */ +function isRealDate(text: string): boolean { + const match = ISO_DATE.exec(text); + if (match === null) return false; + const year = Number(match[1]); + const month = Number(match[2]); + const day = Number(match[3]); + if (year < 2000 || year > 2999) return false; + const date = new Date(Date.UTC(year, month - 1, day)); + return ( + date.getUTCFullYear() === year && + date.getUTCMonth() === month - 1 && + date.getUTCDate() === day + ); +} + +/** A calendar day, `YYYY-MM-DD`, from 2000-01-01 to 2999-12-31. */ +export const isoDateSchema = z + .string() + .superRefine((value, ctx) => { + if (!isRealDate(value)) { + addIssue( + ctx, + 'schedule.start_date', + 'The start date must be a calendar day written YYYY-MM-DD, between 2000 and 2999.', + [], + ); + } + }) + .meta({ + description: 'A calendar day, "YYYY-MM-DD", in the trigger\'s time zone.', + }); + +/** What a schedule does with occurrences it missed while the platform was + * not running: `latest` starts the most recent one once, however late; + * `skip` starts it only when it is at most ten minutes late. */ +export const catchUpSchema = z.enum(['latest', 'skip']).meta({ + description: + 'Missed occurrences: "latest" (the default) starts the most recent one once, however late; "skip" starts it only when it is at most 10 minutes late. Either way the others are counted, not run.', +}); + +export type CatchUp = z.infer; + +/** The fields a trigger sets on every run's input itself; a fixed input + * may not name them. */ +export const TRIGGER_WRAPPER_KEYS = [ + 'trigger', + 'firedAt', + 'event', + 'payload', +] as const; + +/** The most a fixed input may weigh, as JSON. */ +export const STATIC_INPUT_MAX_BYTES = 16 * 1024; + +const encoder = new TextEncoder(); + +/** Whether a value holds text the database cannot store as JSON: a NUL + * character, or one half of a character written as a surrogate pair (half + * an emoji). */ +function holdsUnstorableText(value: unknown): boolean { + if (typeof value === 'string') { + return value.includes('\u0000') || !value.isWellFormed(); + } + if (Array.isArray(value)) return value.some(holdsUnstorableText); + if (value !== null && typeof value === 'object') { + return Object.entries(value).some( + ([key, entry]) => holdsUnstorableText(key) || holdsUnstorableText(entry), + ); + } + return false; +} + +/** + * Values a trigger adds to every run's input: a JSON object, at most 16 KiB. + * The trigger's own fields are set over it, so it may not name them. Plain + * data: a template in it is never evaluated. + */ +export const staticInputSchema = z + .record(z.string(), z.json(), { + error: 'The fixed input must be a JSON object.', + }) + .superRefine((input, ctx) => { + const reserved = TRIGGER_WRAPPER_KEYS.filter((key) => + Object.hasOwn(input, key), + ); + if (reserved.length > 0) { + addIssue( + ctx, + 'input.reserved_key', + `Remove ${reserved.map((key) => `"${key}"`).join(', ')}: the trigger sets these fields itself.`, + [], + ); + } + if (encoder.encode(JSON.stringify(input)).length > STATIC_INPUT_MAX_BYTES) { + addIssue( + ctx, + 'input.too_large', + 'The fixed input is larger than 16 KiB.', + [], + ); + } + if (holdsUnstorableText(input)) { + addIssue( + ctx, + 'input.unstorable_text', + "The fixed input contains a character that can't be stored: a NUL character or half of an emoji.", + [], + ); + } + }) + .meta({ + description: + "Values the trigger adds to every run's input, as a JSON object of at most 16 KiB. The trigger's own fields (trigger, firedAt, event, payload) are set over it, so it cannot name them; a template in it is plain text, never evaluated. Omit it to clear it: saving a trigger replaces it whole.", + }); + +const enabledSchema = z.boolean().meta({ + description: 'Whether it starts runs. Omitted reads as true.', +}); + +const scheduleWriteSchema = z + .strictObject({ + kind: z.literal('schedule'), + enabled: enabledSchema.optional(), + input: staticInputSchema.optional(), + cron: z.string().max(200).optional().meta({ + description: + 'A five-field cron expression — the advanced form; give it or `repeat`, not both.', + }), + repeat: scheduleRuleSchema.optional(), + startDate: isoDateSchema.optional().meta({ + description: + 'The day a repeat rule starts on, in its time zone: no start comes before it, and "every 2 weeks" counts from it. Omitted means today. Send back the one you read to keep the rule in step.', + }), + timezone: timeZoneSchema.optional().meta({ + description: + 'The time zone the schedule reads in. Required with `repeat`; a cron expression without one reads in UTC.', + }), + catchUp: catchUpSchema.optional(), + }) + .superRefine((trigger, ctx) => { + const hasCron = (trigger.cron ?? '').trim() !== ''; + const hasRepeat = trigger.repeat !== undefined; + if (!hasCron && !hasRepeat) { + addIssue( + ctx, + 'schedule.cron_or_repeat', + 'A schedule trigger needs a repeat rule or a cron expression (e.g. "0 9 * * 1" for 09:00 every Monday).', + ['repeat'], + ); + } + if (hasCron && hasRepeat) { + addIssue( + ctx, + 'schedule.cron_or_repeat', + 'Give the schedule either a repeat rule or a cron expression, not both.', + ['repeat'], + ); + } + if (trigger.startDate !== undefined && hasCron && !hasRepeat) { + addIssue( + ctx, + 'schedule.start_date', + 'A start date goes with a repeat rule; a cron expression has none.', + ['startDate'], + ); + } + if (hasRepeat && trigger.timezone === undefined) { + addIssue( + ctx, + 'timezone.required', + 'A repeat rule needs a time zone, such as "Europe/Zurich" or "UTC".', + ['timezone'], + ); + } + }); + +const webhookWriteSchema = z.strictObject({ + kind: z.literal('webhook'), + enabled: enabledSchema.optional(), + input: staticInputSchema.optional(), + rotateToken: z.boolean().optional().meta({ + description: + 'Mint a new address; the one it replaces stops working at once.', + }), +}); + +const eventWriteSchema = z + .strictObject({ + kind: z.literal('event'), + enabled: enabledSchema.optional(), + input: staticInputSchema.optional(), + event: z.string().max(200).optional().meta({ + description: 'The platform event that starts a run.', + }), + }) + .superRefine((trigger, ctx) => { + // An absent event is the store's to refuse, with the events it can + // name; a blank one is no event at all. + if (trigger.event !== undefined && trigger.event.trim() === '') { + addIssue(ctx, 'event.required', 'Pick the event that starts a run.', [ + 'event', + ]); + } + }); + +/** + * A trigger as a caller writes it — one strict shape per kind. Saving is a + * full replace: what is left out is reset (an omitted `catchUp` reads as + * `latest`, an omitted `startDate` as today). + */ +export const triggerWriteSchema = z + .discriminatedUnion('kind', [ + scheduleWriteSchema, + webhookWriteSchema, + eventWriteSchema, + ]) + .meta({ + description: + 'What starts the automation: a schedule (a repeat rule or a cron expression in a time zone), a webhook, or a platform event.', + }); + +export type TriggerWrite = z.input; +export type ParsedTriggerWrite = z.output; + +/** + * The refusals of a failed {@link triggerWriteSchema} parse of `value`, one + * per field and per unknown key. A key of another kind is named as such + * (`trigger.key_other_kind`); a key no kind takes keeps zod's code. + */ +export function triggerIssues( + error: z.ZodError, + value: unknown, +): TriggerIssue[] { + const kind = + typeof value === 'object' && + value !== null && + 'kind' in value && + typeof value.kind === 'string' + ? value.kind + : 'this'; + return error.issues.flatMap((issue): TriggerIssue[] => { + const path = issue.path.map(String).join('.'); + if (issue.code === 'unrecognized_keys') { + return issue.keys.map((key) => { + const owner = triggerKeyKind(key); + const at = path === '' ? key : `${path}.${key}`; + return owner !== null && owner !== kind + ? { + path: at, + code: 'trigger.key_other_kind', + message: `"${key}" belongs to ${owner} triggers — a ${kind} trigger does not take it.`, + } + : { + path: at, + code: 'unrecognized_keys', + message: `is not a field a ${kind} trigger takes`, + }; + }); + } + const coded = + issue.code === 'custom' && isTriggerIssueCode(issue.params?.code) + ? issue.params.code + : path === 'input' && issue.code === 'invalid_type' + ? 'input.not_object' + : scheduleIssueCode(issue); + return [{ path, code: coded ?? issue.code, message: issue.message }]; + }); +} + +/** Missed occurrences, as a skip's detail counts them. */ +export const missedSummarySchema = z + .strictObject({ + count: z + .number() + .int() + .min(1) + .meta({ description: 'How many occurrences were missed, up to 1,000.' }), + capped: z + .boolean() + .meta({ description: 'The count stopped at 1,000; more were missed.' }), + firstAt: epochMsSchema.meta({ + description: 'Epoch milliseconds of the first missed occurrence', + }), + lastAt: epochMsSchema.meta({ + description: 'Epoch milliseconds of the last missed occurrence', + }), + policy: catchUpSchema, + }) + .meta({ description: 'The occurrences a schedule missed and did not run.' }); + +export type MissedSummary = z.infer; + +/** The most problems a refused start keeps in its skip detail. */ +export const SKIP_DETAIL_MAX_ISSUES = 10; +/** The longest sentence a skip detail keeps. */ +export const SKIP_DETAIL_MAX_MESSAGE = 500; + +/** + * Why a trigger last started nothing, in the words a reader needs to act: + * the occurrence or event it was about, a refusal's code and the version + * that refused it, and the occurrences missed alongside. Its `reason` is the + * trigger's `lastSkipReason`; a pause after failures has no detail (its + * facts are the failure fields). + */ +export const triggerSkipDetailSchema = z.discriminatedUnion('reason', [ + z.strictObject({ + reason: z.literal('missed_occurrences'), + missed: missedSummarySchema, + /** The latest of them started a run; the rest are the missed. */ + firedLatest: z.boolean(), + }), + z.strictObject({ + reason: z.literal('not_deployed'), + occurrence: epochMsSchema.meta({ + description: 'Epoch milliseconds of the occurrence or event it skipped', + }), + missed: missedSummarySchema.optional(), + }), + z.strictObject({ + reason: z.literal('start_refused'), + occurrence: epochMsSchema.meta({ + description: 'Epoch milliseconds of the occurrence or event it skipped', + }), + code: z.string().max(100), + version: z.number().int().nullable(), + message: z.string().max(SKIP_DETAIL_MAX_MESSAGE), + issues: z + .array(z.strictObject({ path: z.string(), message: z.string() })) + .max(SKIP_DETAIL_MAX_ISSUES) + .optional(), + missed: missedSummarySchema.optional(), + }), + z.strictObject({ + reason: z.literal('unusable_cron'), + message: z.string().max(SKIP_DETAIL_MAX_MESSAGE), + }), +]); + +export type TriggerSkipDetail = z.infer; + +/** Why a trigger last started nothing — the skip ledger's closed set. */ +export const TRIGGER_SKIP_REASONS = [ + 'not_deployed', + 'unusable_cron', + 'start_refused', + 'paused_after_failures', + 'missed_occurrences', +] as const; + +const nullableEpochMs = epochMsSchema.nullable(); + +/** + * A trigger as a reader sees it — never the secret that verifies a webhook. + * A schedule says what it runs on (`repeat` with its `startDate`, or + * `cron`), in which zone, what it does with missed occurrences and when it + * next runs; every kind says what fixed input it adds, and its health: the + * last run it started, the last time it came due and started nothing and + * why, and its failures in a row. + */ +export const triggerViewSchema = z.strictObject({ + id: z.string(), + name: z.string(), + kind: z.enum(['schedule', 'webhook', 'event']), + cron: z.string().nullable(), + repeat: scheduleRuleSchema.nullable(), + startDate: z.string().nullable(), + timezone: z.string().nullable(), + catchUp: catchUpSchema.nullable(), + input: z.record(z.string(), z.unknown()).nullable(), + event: z.string().nullable(), + hasToken: z.boolean(), + enabled: z.boolean(), + nextRunAt: nullableEpochMs, + lastFiredAt: nullableEpochMs, + lastRunId: z.string().nullable(), + lastSkippedAt: nullableEpochMs, + lastSkipReason: z.enum(TRIGGER_SKIP_REASONS).nullable(), + lastSkipDetail: triggerSkipDetailSchema.nullable(), + consecutiveFailures: z.number().int().min(0), + lastFailedAt: nullableEpochMs, + lastFailureCode: z.string().nullable(), + lastFailedRunId: z.string().nullable(), +}); + +export type TriggerView = z.output; + +type JsonSchema = Record; + +function isJsonSchema(value: unknown): value is JsonSchema { + return typeof value === 'object' && value !== null && !Array.isArray(value); +} + +/** + * {@link triggerWriteSchema} as JSON Schema, for a door that publishes it — + * MCP's tool list (`draft-2020-12`) and the OpenAPI document + * (`openapi-3.0`). Its descriptions are the schema's own. The fixed input is + * a free-form object here: "any JSON value" needs a recursive definition + * the host embedding this schema would have to carry, and the doors check + * the values themselves. + */ +export function triggerWriteJsonSchema( + target: 'draft-2020-12' | 'openapi-3.0', +): JsonSchema { + const rendered: JsonSchema = z.toJSONSchema(triggerWriteSchema, { + target, + io: 'input', + }); + const { + $schema: _schema, + $defs: _defs, + definitions: _definitions, + ...rest + } = rendered; + const branches: unknown[] = Array.isArray(rest.oneOf) ? rest.oneOf : []; + return { ...rest, oneOf: branches.map(withFreeFormInput) }; +} + +/** One kind's branch with its fixed input published as a free-form object + * under its own description. */ +function withFreeFormInput(branch: unknown): unknown { + if (!isJsonSchema(branch) || !isJsonSchema(branch.properties)) return branch; + const input = branch.properties.input; + if (!isJsonSchema(input)) return branch; + return { + ...branch, + properties: { + ...branch.properties, + input: { + type: 'object', + additionalProperties: true, + description: input.description, + }, + }, + }; +} diff --git a/packages/shared/src/schemas/connectors.test.ts b/packages/shared/src/schemas/connectors.test.ts index c919321257..dce944f3fe 100644 --- a/packages/shared/src/schemas/connectors.test.ts +++ b/packages/shared/src/schemas/connectors.test.ts @@ -207,6 +207,62 @@ describe('connectorSchema', () => { ).toBe(false); }); + it('accepts an action title with per-locale overrides', () => { + const github = connectorSchema.parse(GITHUB); + const [create] = github.actions; + const titled = connectorSchema.parse({ + ...github, + actions: [ + { + ...create, + title: 'Create issue', + i18n: { + de: { title: 'Issue erstellen' }, + fr: { title: 'Créer une issue' }, + 'de-CH': { title: 'Issue erstellen' }, + }, + }, + ], + }); + expect(titled.actions[0]?.title).toBe('Create issue'); + expect(titled.actions[0]?.i18n?.fr?.title).toBe('Créer une issue'); + // Untitled stays valid: a surface falls back to the action name. + expect(github.actions[0]?.title).toBeUndefined(); + }); + + it.each([ + ['a blank title', { title: '' }], + [ + 'a locale key outside the tag grammar', + { i18n: { german: { title: 'x' } } }, + ], + ['an unknown key inside a locale', { i18n: { de: { label: 'x' } } }], + ['a title past 80 characters', { title: 'x'.repeat(81) }], + ])('refuses %s on an action', (_case, extra) => { + const github = connectorSchema.parse(GITHUB); + expect( + connectorSchema.safeParse({ + ...github, + actions: [{ ...github.actions[0], ...extra }], + }).success, + ).toBe(false); + }); + + it('accepts per-locale display names on the connector, and only those', () => { + const mailbox = connectorSchema.parse(MAILBOX); + const named = connectorSchema.parse({ + ...mailbox, + i18n: { de: { displayName: 'Postfach' }, fr: { displayName: 'Boîte' } }, + }); + expect(named.i18n?.de?.displayName).toBe('Postfach'); + expect( + connectorSchema.safeParse({ + ...mailbox, + i18n: { de: { description: 'Ein Postfach' } }, + }).success, + ).toBe(false); + }); + it('requires a mock on every action', () => { const github = connectorSchema.parse(GITHUB); const noMock = { diff --git a/packages/shared/src/schemas/connectors.ts b/packages/shared/src/schemas/connectors.ts index afe7cc3638..8c24371baf 100644 --- a/packages/shared/src/schemas/connectors.ts +++ b/packages/shared/src/schemas/connectors.ts @@ -49,6 +49,16 @@ const actionNameSchema = z const displayNameSchema = z.string().min(1).max(200); +/** Locale keys of the per-entry `i18n` channels (`de`, `fr`, `de-CH`) — the + * grammar every declared text uses, as in the automation settings forms and + * the pack manifest. */ +const LOCALE_RE = /^[a-z]{2}(-[A-Z]{2})?$/; + +/** An action named for a person: a short verb phrase in sentence case + * ("List issues"), without the connector's name — a surface shows it beside + * the connector's display name ("GitHub · List issues"). */ +const actionTitleSchema = z.string().min(1).max(80); + /** * The auth methods a connector accepts — discriminated on `method`, MULTIPLE * per connector, decoupled from the actions. A credential row references one @@ -146,6 +156,10 @@ const configFieldSchema = z required: z.boolean().default(false), /** Closed set of accepted values, for a `string` field rendered as a select. */ enum: z.array(z.string().min(1)).min(1).optional(), + /** Numeric constraints for number fields. */ + integer: z.boolean().optional(), + min: z.number().finite().optional(), + max: z.number().finite().optional(), /** Applied when the field is absent; must match `type`. */ default: z.union([z.string(), z.number(), z.boolean()]).optional(), }) @@ -183,6 +197,18 @@ const jsonSchemaObjectSchema = z export const connectorActionSchema = z .object({ name: actionNameSchema, + /** The action in words, in English. A surface without one shows the + * humanized action name instead. */ + title: actionTitleSchema.optional(), + /** Per-locale overrides of `title`. The chain every declared text + * follows: the exact tag (`de-CH`), then its base language (`de`), then + * the English `title`. */ + i18n: z + .record( + z.string().regex(LOCALE_RE), + z.object({ title: actionTitleSchema.optional() }).strict(), + ) + .optional(), description: z.string().min(1).max(2000), /** JSON Schema for the action's `input` — machine-validated. */ input: jsonSchemaObjectSchema, @@ -211,6 +237,15 @@ export const connectorSchema = z .object({ name: slugSchema, displayName: displayNameSchema, + /** Per-locale overrides of `displayName`, for a connector named with + * ordinary words ("Tasks") rather than a brand ("GitHub"), which keeps its + * name in every language. Same locale chain as an action's `title`. */ + i18n: z + .record( + z.string().regex(LOCALE_RE), + z.object({ displayName: displayNameSchema.optional() }).strict(), + ) + .optional(), description: z.string().min(1).max(2000), /** Grouping labels for the catalog (open vocabulary). */ tags: z.array(z.string().min(1).max(64)).default([]), diff --git a/packages/shared/src/schemas/governance-budgets.test.ts b/packages/shared/src/schemas/governance-budgets.test.ts index 9ca80d6045..7b77be5fd5 100644 --- a/packages/shared/src/schemas/governance-budgets.test.ts +++ b/packages/shared/src/schemas/governance-budgets.test.ts @@ -1,9 +1,11 @@ /** * The budgets file is read by every image in a rolling deploy, including - * one from before project caps existed. That reader must still parse a file - * that holds them and keep enforcing every other cap: a file it cannot - * parse reads as no policy at all, so a project cap must never sit where it - * would fail the parse. + * one from before project caps existed. That reader must still parse the + * file and keep enforcing every other cap: a file it cannot parse reads as + * no policy at all, so a project cap must never sit where it would fail the + * parse. Project caps live in a file of their own, which such an image + * never writes; the copy an earlier release kept in the budgets file is + * read only until that file exists. */ import { describe, expect, it } from 'vitest'; @@ -11,9 +13,11 @@ import { z } from 'zod/v4'; import { allBudgetRules, - budgetConfigOf, budgetConfigSchema, + budgetFilesOf, type BudgetRule, + effectiveBudgetConfig, + projectBudgetsConfigSchema, } from './governance'; /** The schema as it stood before project caps — a verbatim copy. */ @@ -45,46 +49,67 @@ const RULES: BudgetRule[] = [ { scope: 'apiKey', apiKeyId: 'key-1', period: 'daily', maxRequests: 100 }, ]; -describe('the budgets file with project caps', () => { - it('keeps a project’s cap out of `rules`, where an older reader would fail the file', () => { - const file = budgetConfigOf(true, RULES); - expect(file).toEqual({ - enabled: true, - rules: [RULES[0], RULES[2]], - projectRules: [RULES[1]], +describe('the budget files with project caps', () => { + it('saves a project’s cap in its own file, never in the budgets file an older reader parses', () => { + const files = budgetFilesOf(true, RULES); + expect(files).toEqual({ + budgets: { enabled: true, rules: [RULES[0], RULES[2]] }, + projectBudgets: { rules: [RULES[1]] }, }); - const parsed = previousSchema.safeParse(file); + const parsed = previousSchema.safeParse(files.budgets); expect(parsed.success).toBe(true); expect(parsed.data?.rules).toEqual([RULES[0], RULES[2]]); - expect(parsed.data).not.toHaveProperty('projectRules'); + expect(projectBudgetsConfigSchema.parse(files.projectBudgets)).toEqual({ + rules: [RULES[1]], + }); }); - it('refuses a project scope inside `rules`', () => { + it('refuses a project scope inside the budgets file’s `rules`', () => { expect( budgetConfigSchema.safeParse({ enabled: true, rules: [RULES[1]] }) .success, ).toBe(false); }); - it('reads both kinds of rule back as one list', () => { - const parsed = budgetConfigSchema.parse(budgetConfigOf(true, RULES)); - expect(allBudgetRules(parsed)).toEqual([RULES[0], RULES[2], RULES[1]]); + it('reads both files back as one policy, every rule in one list', () => { + const files = budgetFilesOf(true, RULES); + const policy = effectiveBudgetConfig( + budgetConfigSchema.parse(files.budgets), + projectBudgetsConfigSchema.parse(files.projectBudgets), + ); + expect(policy.enabled).toBe(true); + expect(allBudgetRules(policy)).toEqual([RULES[0], RULES[2], RULES[1]]); }); - it('writes no `projectRules` when no rule caps a project', () => { - expect(budgetConfigOf(false, [RULES[0]])).toEqual({ - enabled: false, + it('reads the project caps an earlier release kept in the budgets file while their own file has never been written', () => { + const legacy = budgetConfigSchema.parse({ + enabled: true, rules: [RULES[0]], + projectRules: [RULES[1]], }); + expect(allBudgetRules(effectiveBudgetConfig(legacy, null))).toEqual([ + RULES[0], + RULES[1], + ]); + // Once the file exists it is the whole truth, an emptied one included. + expect( + allBudgetRules(effectiveBudgetConfig(legacy, { rules: [] })), + ).toEqual([RULES[0]]); + }); + + it('follows the budgets file’s switch', () => { + const { budgets, projectBudgets } = budgetFilesOf(false, RULES); + expect(effectiveBudgetConfig(budgets, projectBudgets).enabled).toBe(false); }); - it('refuses a project cap that names no project', () => { + it('refuses a project cap that names no project, or one of another scope', () => { expect( - budgetConfigSchema.safeParse({ - enabled: true, - rules: [], - projectRules: [{ scope: 'project', scopeId: '', period: 'daily' }], + projectBudgetsConfigSchema.safeParse({ + rules: [{ scope: 'project', scopeId: '', period: 'daily' }], }).success, ).toBe(false); + expect( + projectBudgetsConfigSchema.safeParse({ rules: [RULES[0]] }).success, + ).toBe(false); }); }); diff --git a/packages/shared/src/schemas/governance.ts b/packages/shared/src/schemas/governance.ts index 0c174f7d87..10313365dd 100644 --- a/packages/shared/src/schemas/governance.ts +++ b/packages/shared/src/schemas/governance.ts @@ -15,6 +15,11 @@ import { piiConfigSchema } from './pii'; export const POLICY_TYPES = [ 'system_prompt', 'budgets', + // Every project's budget rules, in a file of their own beside `budgets` — + // so an image that predates them, or a rollback to one, saves the budgets + // file without dropping them. They follow the budgets file's switch. See + // `projectBudgetsConfigSchema`. + 'project_budgets', 'default_models', 'upload_policy', 'retention_policy', @@ -333,11 +338,12 @@ export const budgetRuleSchema = z.object({ * the chats in its threads, its agents' turns, its automations' agent and * `llm` steps, and its own API keys — as one shared bucket, like a team's. * - * Saved in the file's `projectRules`, never in `rules`: an image that - * predates project caps still parses the file — `z.object` drops the - * unknown key — and keeps enforcing every other cap, where a `project` - * scope inside `rules` would make the whole file unreadable to it, and so - * no cap at all. + * Saved in the project caps file (`project_budgets`), never in the budgets + * file's `rules`: an image that predates project caps would refuse the whole + * budgets file over a `project` scope there, and so enforce no cap at all. + * The budgets file's `projectRules` is where an earlier release kept them; + * it is read only while the project caps file has never been written + * (`effectiveBudgetConfig`). */ export const projectBudgetRuleSchema = z.object({ scope: z.literal('project'), @@ -352,32 +358,64 @@ export type BudgetRule = Omit, 'scope'> & { export const budgetConfigSchema = z.object({ rules: z.array(budgetRuleSchema), + /** Project caps as an earlier release saved them: read only while the + * project caps file has never been written. */ projectRules: z.array(projectBudgetRuleSchema).optional(), enabled: z.boolean(), }); export type BudgetConfig = z.infer; -/** Every rule a budgets file holds, project caps included. */ +/** + * The project caps file: every project's budget rules. It has no switch of + * its own — with budget rules switched off in the budgets file, no project + * cap binds either. + */ +export const projectBudgetsConfigSchema = z.object({ + rules: z.array(projectBudgetRuleSchema), +}); +export type ProjectBudgetsConfig = z.infer; + +/** Every rule a budget policy holds, project caps included. */ export function allBudgetRules(config: BudgetConfig): BudgetRule[] { return [...config.rules, ...(config.projectRules ?? [])]; } -/** The budgets file holding these rules, each kind in its own array. */ -export function budgetConfigOf( +/** + * The budget policy as every reader takes it: the budgets file's switch and + * rules, with the project caps of their own file — or, while that file has + * never been written, the ones an earlier release kept in the budgets file. + */ +export function effectiveBudgetConfig( + budgets: BudgetConfig, + projectBudgets: ProjectBudgetsConfig | null, +): BudgetConfig { + const { projectRules: legacy, ...rest } = budgets; + const projectRules = projectBudgets?.rules ?? legacy ?? []; + return { ...rest, ...(projectRules.length > 0 ? { projectRules } : {}) }; +} + +/** The two files these rules are saved in: the project caps in their own, + * every other rule in the budgets file. */ +export function budgetFilesOf( enabled: boolean, rules: readonly BudgetRule[], -): BudgetConfig { - const projectRules = rules.flatMap((rule) => { - if (rule.scope !== 'project') return []; - const { scope: _scope, apiKeyId: _apiKeyId, scopeId, ...limits } = rule; - return [{ scope: 'project' as const, scopeId: scopeId ?? '', ...limits }]; - }); +): { budgets: BudgetConfig; projectBudgets: ProjectBudgetsConfig } { return { - enabled, - rules: rules.flatMap((rule) => - rule.scope === 'project' ? [] : [{ ...rule, scope: rule.scope }], - ), - ...(projectRules.length > 0 ? { projectRules } : {}), + budgets: { + enabled, + rules: rules.flatMap((rule) => + rule.scope === 'project' ? [] : [{ ...rule, scope: rule.scope }], + ), + }, + projectBudgets: { + rules: rules.flatMap((rule) => { + if (rule.scope !== 'project') return []; + const { scope: _scope, apiKeyId: _apiKeyId, scopeId, ...limits } = rule; + return [ + { scope: 'project' as const, scopeId: scopeId ?? '', ...limits }, + ]; + }), + }, }; } @@ -1286,6 +1324,7 @@ export function skillOrgWideModeOf( export const POLICY_SCHEMAS = { system_prompt: systemPromptConfigSchema, budgets: budgetConfigSchema, + project_budgets: projectBudgetsConfigSchema, default_models: defaultModelsConfigSchema, upload_policy: uploadPolicyConfigSchema, retention_policy: retentionPolicyConfigSchema, diff --git a/packages/shared/src/schemas/managed-configuration.test.ts b/packages/shared/src/schemas/managed-configuration.test.ts index 8885243708..c7ecd1daf6 100644 --- a/packages/shared/src/schemas/managed-configuration.test.ts +++ b/packages/shared/src/schemas/managed-configuration.test.ts @@ -3,10 +3,69 @@ import { describe, expect, it } from 'vitest'; import { AGENT_TOOL_CATALOG } from '../agent-tool-grants'; import { managedAgentToolsSchema, + managedAutomationScheduleSchema, + managedAgentModelSchema, + managedAgentModelObservationSchema, managedPlatformResourceSchema, } from './managed-configuration'; import { PROJECT_AGENT_BINDINGS_MAX } from './projects'; +describe('explicit managed review-context creation', () => { + const resource = { + kind: 'task-review-context', + config: { + projectId: 'project-a', + taskId: '2045dc63-4934-40fc-89f8-f66b82a30152', + reviewerAgentId: 'reviewer-a', + enabled: true, + }, + }; + it('keeps creation separate from the stored config and preserves adoption-only IDs', () => { + expect( + managedPlatformResourceSchema.parse({ + ...resource, + createIfMissing: true, + }), + ).toEqual({ ...resource, createIfMissing: true }); + const adoption = { + ...resource, + config: { ...resource.config, taskId: 'existing-context' }, + }; + expect(managedPlatformResourceSchema.parse(adoption)).toEqual(adoption); + expect( + managedPlatformResourceSchema.safeParse({ + ...adoption, + createIfMissing: true, + }).success, + ).toBe(false); + }); + it.each([false, null, 'true', 1])( + 'refuses implicit or malformed creation policy %j', + (createIfMissing) => { + expect( + managedPlatformResourceSchema.safeParse({ + ...resource, + createIfMissing, + }).success, + ).toBe(false); + }, + ); + it('does not accept task titles, caller IDs, permissions or creation policy inside config', () => { + for (const extra of [ + { createIfMissing: true }, + { title: 'Caller title' }, + { createdBy: 'another-user' }, + { tools: ['task_start_agent'] }, + ]) + expect( + managedPlatformResourceSchema.safeParse({ + ...resource, + config: { ...resource.config, ...extra }, + }).success, + ).toBe(false); + }); +}); + describe('managed agent tool declarations', () => { const identity = { projectId: 'project-a', agentId: 'agent-a' }; @@ -55,3 +114,129 @@ describe('managed agent tool declarations', () => { expect(managedAgentToolsSchema.safeParse(config).success).toBe(false); }); }); + +describe('managed schedule slot-wake opt-in (#4540)', () => { + const schedule = { + projectId: 'project-a', + name: 'fleet/dispatch', + cron: '*/30 * * * *', + timezone: 'Europe/Zurich', + enabled: true, + }; + + it('declares the opt-in as true, and the opt-out by leaving it out', () => { + expect( + managedAutomationScheduleSchema.parse({ + ...schedule, + wakeOnSlotFreed: true, + }), + ).toEqual({ ...schedule, wakeOnSlotFreed: true }); + expect(managedAutomationScheduleSchema.parse(schedule)).toEqual(schedule); + }); + + it.each([false, 'true', 1, null])( + 'refuses %j, so a readback and its declaration always hash alike', + (wakeOnSlotFreed) => { + expect( + managedAutomationScheduleSchema.safeParse({ + ...schedule, + wakeOnSlotFreed, + }).success, + ).toBe(false); + }, + ); +}); + +describe('managed schedule declarations read as the platform stores them', () => { + const rule = { + projectId: 'project-a', + name: 'reports/weekly', + repeat: { + frequency: 'weekly', + interval: 1, + weekdays: [5, 1, 5], + times: ['17:00', '09:00'], + }, + startDate: '2026-10-01', + timezone: 'utc', + enabled: true, + }; + + it('reads a repeat rule in its normal form, whatever order the file uses', () => { + expect(managedAutomationScheduleSchema.parse(rule)).toEqual({ + ...rule, + repeat: { + frequency: 'weekly', + interval: 1, + weekdays: [1, 5], + times: ['09:00', '17:00'], + }, + }); + }); + + it('keeps the zone the way the declaration spells it', () => { + expect(managedAutomationScheduleSchema.parse(rule).timezone).toBe('utc'); + }); + + it.each([' UTC', 'UTC ', '\tEurope/Zurich'])( + 'refuses the zone %j, which no stored zone would ever equal', + (timezone) => { + expect( + managedAutomationScheduleSchema.safeParse({ ...rule, timezone }) + .success, + ).toBe(false); + }, + ); +}); + +describe('managed agent model declarations', () => { + const config = { + projectId: 'project-a', + agentId: 'agent-a', + harness: 'codex', + model: 'model-a', + modelProvider: 'provider-a', + }; + it('requires an explicit provider and preserves nullable legacy observations', () => { + expect( + managedPlatformResourceSchema.parse({ kind: 'agent-model', config }), + ).toEqual({ kind: 'agent-model', config }); + expect( + managedAgentModelSchema.parse({ + ...config, + model: ' model-a ', + modelProvider: ' provider-a ', + }), + ).toEqual(config); + expect( + managedAgentModelObservationSchema.parse({ + ...config, + modelProvider: null, + }).modelProvider, + ).toBeNull(); + expect( + managedAgentModelObservationSchema.parse({ + ...config, + model: ' legacy ', + modelProvider: ' legacy-provider ', + }).model, + ).toBe(' legacy '); + }); + it.each([ + { modelProvider: undefined }, + { modelProvider: null }, + { modelProvider: '' }, + { modelProvider: ' ' }, + { model: ' ' }, + { harness: '' }, + { agentId: '' }, + { secrets: [] }, + { tools: [] }, + { instructions: 'overwrite' }, + { name: 'overwrite' }, + ])('rejects incomplete or unrelated fields %j', (fields) => { + expect( + managedAgentModelSchema.safeParse({ ...config, ...fields }).success, + ).toBe(false); + }); +}); diff --git a/packages/shared/src/schemas/managed-configuration.ts b/packages/shared/src/schemas/managed-configuration.ts index c2446abf14..8186f86a04 100644 --- a/packages/shared/src/schemas/managed-configuration.ts +++ b/packages/shared/src/schemas/managed-configuration.ts @@ -3,15 +3,18 @@ import { z } from 'zod'; import { AGENT_TOOL_CATALOG, normalizeToolGrants } from '../agent-tool-grants'; import { isValidAutomationName } from '../automation-name'; import { TASK_DESCRIPTION_MAX } from '../task-limits'; +import { isoDateSchema, staticInputSchema } from './automation-trigger'; import { configurationHashSchema } from './configuration'; import { PROJECT_AGENT_INSTRUCTIONS_MAX, PROJECT_AGENT_BINDINGS_MAX, + projectAgentInputSchema, PROJECT_INSTRUCTIONS_MAX_CHARS, } from './projects'; +import { normalizeScheduleRule, scheduleRuleSchema } from './schedule-rule'; -/** Explicit adoption: these resources never find a target by display name or - * create a second project, agent or standing task. Native writers retain the +/** Explicit identities: these resources never find a target by display name. + * Review contexts alone may explicitly create their declared UUID. Native writers retain the * authority, occupancy, audit and validation rules of those resources. */ const identity = z .string() @@ -42,12 +45,62 @@ export const managedAgentToolsSchema = z.strictObject({ .max(PROJECT_AGENT_BINDINGS_MAX) .transform((tools) => normalizeToolGrants(tools)), }); +/** Model adoption selects one explicit provider; native observations may retain + * an older unpinned provider without silently choosing one during the read. */ +export const managedAgentModelSchema = projectAgentInputSchema + .pick({ harness: true, model: true, modelProvider: true }) + .extend({ + ...project, + agentId: identity, + model: projectAgentInputSchema.shape.model.trim().min(1), + modelProvider: projectAgentInputSchema.shape.modelProvider + .unwrap() + .trim() + .min(1), + }) + .strict(); +export const managedAgentModelObservationSchema = + managedAgentModelSchema.extend({ + model: projectAgentInputSchema.shape.model, + modelProvider: projectAgentInputSchema.shape.modelProvider + .unwrap() + .nullable(), + }); export const managedTaskInstructionsSchema = z.strictObject({ ...project, taskId: identity, description: z.string().max(TASK_DESCRIPTION_MAX), }); +/** Explicit enrollment of a pristine operational task. The reviewer identity + * is permanent; disabling the context does not turn it into source work. */ +export const managedTaskReviewContextSchema = z.strictObject({ + ...project, + taskId: identity, + reviewerAgentId: identity, + enabled: z.boolean(), +}); +export type ManagedTaskReviewContext = z.infer< + typeof managedTaskReviewContextSchema +>; + +/** Creation is an explicit apply policy, not part of the stored config/hash. + * Existing adoption-only identities remain compatible. */ +export const managedTaskReviewContextProvisionSchema = z + .strictObject({ + config: managedTaskReviewContextSchema, + createIfMissing: z.literal(true).optional(), + }) + .refine( + (value) => + value.createIfMissing !== true || + z.uuid().safeParse(value.config.taskId).success, + { + path: ['config', 'taskId'], + message: 'Creation requires a stable UUID task ID', + }, + ); + /** The native authoring dispatcher validates documents and runs their tests. * Metadata is explicit: null clears it; an omitted field must never silently * erase a value that an existing automation owns. */ @@ -64,13 +117,56 @@ export const managedAutomationDeploymentSchema = z.strictObject({ name, definitionSha256: configurationHashSchema, }); -export const managedAutomationScheduleSchema = z.strictObject({ - ...project, - name, - cron: z.string().min(1).max(200), - timezone: z.string().min(1).max(100), - enabled: z.boolean(), -}); +/** What a managed schedule may add beside its definition: `catchUp` only + * when it is `skip` (the default `latest` is left out), a fixed input only + * when it has one, and the slot-wake opt-in only when it is on, so a + * schedule that sets none of them hashes as before. */ +const scheduleExtras = { + catchUp: z.literal('skip').optional(), + input: staticInputSchema.optional(), + // Fire this schedule early when an agent of its project frees its slot + // (#4540). Only `true` is declared: an absent key is the opt-out, so a + // readback and an equivalent declaration always hash alike. + wakeOnSlotFreed: z.literal(true).optional(), +}; + +/** A managed schedule's zone, stored the way the declaration spells it (any + * spelling `Intl` resolves): spaces around it are refused, since a stored + * zone with them never compared equal to its declaration. */ +const managedZone = z + .string() + .min(1) + .max(100) + .refine( + (zone) => zone.trim() === zone, + 'A time zone cannot start or end with a space.', + ); + +/** A managed schedule runs on a cron expression or a repeat rule. The cron + * shape keeps exactly the keys it always had, so an existing schedule's hash + * does not move and nothing reads as drifted. A repeat rule reads in its + * normal form (times and weekdays sorted and once each, a window that spans + * the whole week dropped) — the form the platform stores — so a declaration + * and its readback hash alike whatever order the file lists them in. */ +export const managedAutomationScheduleSchema = z.union([ + z.strictObject({ + ...project, + name, + cron: z.string().min(1).max(200), + timezone: managedZone, + enabled: z.boolean(), + ...scheduleExtras, + }), + z.strictObject({ + ...project, + name, + repeat: scheduleRuleSchema.transform(normalizeScheduleRule), + startDate: isoDateSchema, + timezone: managedZone, + enabled: z.boolean(), + ...scheduleExtras, + }), +]); export const managedPlatformResourceSchema = z.discriminatedUnion('kind', [ z.strictObject({ @@ -85,10 +181,17 @@ export const managedPlatformResourceSchema = z.discriminatedUnion('kind', [ kind: z.literal('agent-tools'), config: managedAgentToolsSchema, }), + z.strictObject({ + kind: z.literal('agent-model'), + config: managedAgentModelSchema, + }), z.strictObject({ kind: z.literal('task-instructions'), config: managedTaskInstructionsSchema, }), + managedTaskReviewContextProvisionSchema.safeExtend({ + kind: z.literal('task-review-context'), + }), z.strictObject({ kind: z.literal('automation-definition'), config: managedAutomationDefinitionSchema, diff --git a/packages/shared/src/schemas/providers.ts b/packages/shared/src/schemas/providers.ts index 21f9377a08..c43318f705 100644 --- a/packages/shared/src/schemas/providers.ts +++ b/packages/shared/src/schemas/providers.ts @@ -563,6 +563,17 @@ export const modelCatalogEntrySchema = z .optional(), /** Text-to-speech facts; static-catalog sources only. */ tts: modelCatalogTtsSchema.optional(), + /** Transcription facts; static-catalog sources only. A transcription + * model bills by the minute of audio, which `pricing`'s per-token + * figures cannot express. */ + transcription: z + .object({ + /** What a minute of audio costs: the usage ledger's estimate, and + * the hold a transcription takes while it runs. */ + centsPerAudioMinute: z.number().nonnegative().finite().optional(), + }) + .strict() + .optional(), /** Embedding facts for an embedding-tagged entry; static-catalog sources * only (live listings publish no vector width — this is exactly the * fact an operator otherwise has to look up by hand). `recommended` diff --git a/packages/shared/src/schemas/settings-kinds.test.ts b/packages/shared/src/schemas/settings-kinds.test.ts new file mode 100644 index 0000000000..61bbc92899 --- /dev/null +++ b/packages/shared/src/schemas/settings-kinds.test.ts @@ -0,0 +1,158 @@ +import { describe, expect, test } from 'vitest'; +import { z } from 'zod'; + +import { + platformResourceSchema, + type PlatformResource, +} from '../config/platform-resources'; +import { + isSettingsKind, + isSettingsPointer, + SETTINGS_AREAS, + SETTINGS_EFFECTS, + SETTINGS_KINDS, + SETTINGS_KINDS_NOT_OVER_MCP, + settingsKindDescriptor, + type SettingsKindDescriptor, +} from './settings-kinds'; + +/** The descriptors as any reader sees them, not as their literal types. */ +const DESCRIPTORS: readonly SettingsKindDescriptor[] = SETTINGS_KINDS; + +/** Every kind the CLI's resource union takes, as a compile-time list: a kind + * added to the union without a line here fails the type check. */ +const DECLARABLE: Record = { + 'project-instructions': true, + 'agent-instructions': true, + 'agent-tools': true, + 'agent-model': true, + 'task-instructions': true, + 'task-review-context': true, + 'automation-definition': true, + 'automation-deployment': true, + 'automation-schedule': true, + governance: true, + branding: true, + deployment: true, + 'knowledge-embedding': true, + provider: true, + 'provider-credential': true, +}; + +/** The same set read from the schema at run time: every `kind` constant of + * the union, however deep its members nest. */ +function parsedKinds(): string[] { + const kinds: string[] = []; + const visit = (node: unknown): void => { + if (typeof node !== 'object' || node === null) return; + const kind: unknown = Reflect.get( + Reflect.get(Reflect.get(node, 'properties') ?? {}, 'kind') ?? {}, + 'const', + ); + if (typeof kind === 'string') kinds.push(kind); + for (const key of ['anyOf', 'oneOf']) { + const members: unknown = Reflect.get(node, key); + if (Array.isArray(members)) members.forEach(visit); + } + }; + visit( + z.toJSONSchema(platformResourceSchema, { + io: 'input', + unrepresentable: 'any', + }), + ); + return kinds; +} + +describe('the settings kinds', () => { + test('the CLI declares exactly the kinds marked cli, taken over MCP or not', () => { + const marked = [ + ...SETTINGS_KINDS.filter((descriptor) => descriptor.cli), + ...SETTINGS_KINDS_NOT_OVER_MCP.filter((entry) => entry.cli), + ] + .map((entry) => entry.kind) + .sort(); + expect(parsedKinds().sort()).toEqual(marked); + expect(Object.keys(DECLARABLE).sort()).toEqual(marked); + }); + + test('a kind the MCP tools do not take says why, and is not also taken', () => { + const taken = new Set(SETTINGS_KINDS.map((entry) => entry.kind)); + for (const entry of SETTINGS_KINDS_NOT_OVER_MCP) { + expect(taken.has(entry.kind), entry.kind).toBe(false); + expect(entry.reason, entry.kind).toMatch(/^\S.*\.$/); + } + }); + + test('each kind is described once, with an order of its own', () => { + const kinds = SETTINGS_KINDS.map((entry) => entry.kind); + expect(new Set(kinds).size).toBe(kinds.length); + const orders = SETTINGS_KINDS.map((entry) => entry.order); + expect(new Set(orders).size).toBe(orders.length); + // The list reads in the order changes apply. + expect([...orders].sort((a, b) => a - b)).toEqual(orders); + }); + + test('what a resource refers to applies before it', () => { + const order = (kind: Parameters[0]) => + settingsKindDescriptor(kind).order; + // A credential names its provider; a model policy and the embedding + // name a provider and are served through its credential. + expect(order('provider')).toBeLessThan(order('provider-credential')); + expect(order('provider-credential')).toBeLessThan(order('governance')); + expect(order('provider-credential')).toBeLessThan( + order('knowledge-embedding'), + ); + }); + + test('each kind names pages of Settings, real operations and pointers below its config', () => { + const areas = new Set(SETTINGS_AREAS); + expect(areas.size).toBe(SETTINGS_AREAS.length); + for (const descriptor of DESCRIPTORS) { + for (const area of descriptor.areas) { + expect(areas.has(area), `${descriptor.kind}: ${area}`).toBe(true); + } + expect(descriptor.ops.length, descriptor.kind).toBeGreaterThan(0); + for (const act of descriptor.acts) { + expect(act, descriptor.kind).toMatch(/^[a-z]+(?:-[a-z]+)*$/); + } + for (const pointer of descriptor.secretPaths) { + expect( + isSettingsPointer(pointer), + `${descriptor.kind}: ${pointer}`, + ).toBe(true); + } + expect(descriptor.description, descriptor.kind).toMatch(/^\S.*\.$/); + } + }); + + test('a secret path is an RFC 6901 pointer below the config, * for any member', () => { + // `/` names the member whose key is the empty string, as RFC 6901 reads it. + for (const pointer of [ + '/secret', + '/endpoint/headers/*', + '/a~1b', + '/a~0', + '/0', + '/', + ]) + expect(isSettingsPointer(pointer), pointer).toBe(true); + // The whole config, a bare name and a broken escape are not. + for (const pointer of ['', 'secret', 'a/b', '/a~2', '/a~']) + expect(isSettingsPointer(pointer), pointer).toBe(false); + }); + + test('every effect raises a change to high or critical', () => { + for (const [effect, risk] of Object.entries(SETTINGS_EFFECTS)) { + expect(['high', 'critical'], effect).toContain(risk); + expect(effect).toMatch(/^[a-z]+(?:-[a-z]+)*$/); + } + }); + + test('names a kind only when the MCP tools take it', () => { + expect(isSettingsKind('governance')).toBe(true); + expect(isSettingsKind('automation-definition')).toBe(false); + expect(isSettingsKind('file')).toBe(false); + expect(settingsKindDescriptor('branding').scope).toBe('organization'); + }); +}); diff --git a/packages/shared/src/schemas/settings-kinds.ts b/packages/shared/src/schemas/settings-kinds.ts new file mode 100644 index 0000000000..1e47ae690b --- /dev/null +++ b/packages/shared/src/schemas/settings-kinds.ts @@ -0,0 +1,363 @@ +/** + * The settings a coding agent reads and changes through Tale's MCP settings + * tools, described once for every reader: the platform's settings registry + * routes a change by its kind and applies changes in each kind's `order`, + * the endpoint's reference teaches each kind from its `description`, and the + * coverage guard joins every page of Settings to the kinds that cover it + * through `areas`. The CLI declares the kinds marked `cli`; the guard in + * `settings-kinds.test.ts` holds them to the native resource model the CLI + * parses, so the CLI never accepts a kind the platform does not describe. + * + * Pure data: the browser reads it as well as the server. + */ + +/** + * Every page of Settings, by its path under + * `/dashboard//settings/`; a section with tabs is named by each + * of its tabs. The platform's coverage guard holds this list equal to the + * settings rail, so a page cannot be added without its story here. + */ +export const SETTINGS_AREAS = [ + 'account', + 'personalization', + 'notifications', + 'usage', + 'organization', + 'teams', + 'members', + 'providers', + 'connectors', + 'skills', + 'branding', + 'sandboxes', + 'governance/content-models', + 'governance/policies-limits', + 'governance/security-monitoring', + 'governance/competences', + 'governance/guardrails', + 'governance/logs', + 'governance/legal-hold', + 'governance/data-subject-requests', + 'governance/trash', + 'metrics/usage', + 'metrics/feedback', + 'metrics/chat-health', + 'metrics/external-turns', + 'metrics/automations', + 'metrics/projects', + 'api/rest', + 'api/models', + 'api/mcp', + 'api/webdav', + 'enterprise-sso', + 'data-residency', +] as const; +export type SettingsArea = (typeof SETTINGS_AREAS)[number]; + +/** Whose setting it is: the organization's, one person's, the deployment's + * (every organization on it), or one project's. */ +export type SettingsScope = 'organization' | 'user' | 'instance' | 'project'; + +/** What a change does to one resource: `set` replaces it whole (creating it + * when absent), `delete` removes it. One-shot actions are the kind's `acts`. */ +export type SettingsOp = 'set' | 'delete'; + +export type SettingsRisk = 'low' | 'high' | 'critical'; + +/** + * What a planned change does beyond replacing a value, each with the risk it + * carries. A change's risk is the highest of its kind's `baseRisk` and its + * effects'. The codes are a stable vocabulary: the agent reads them in a + * plan, and Tale shows them, translated, to the person who finishes a + * change. + */ +export const SETTINGS_EFFECTS = { + 'signs-out-members': 'critical', + 'may-lock-out-members': 'critical', + 'removes-human-approval': 'critical', + 'changes-serving-account': 'high', + 'breaks-dependents': 'high', + 'requires-empty-corpus': 'critical', + 're-embeds-documents': 'critical', + 'restart-required': 'critical', + 'sends-email': 'high', + 'revokes-access': 'high', + irreversible: 'critical', + 'erases-personal-data': 'critical', + 'staged-cooldown': 'critical', + 'reaches-vendor': 'high', + 'ends-running-work': 'high', +} as const satisfies Record>; +export type SettingsEffect = keyof typeof SETTINGS_EFFECTS; + +export interface SettingsKindDescriptor { + readonly kind: string; + readonly scope: SettingsScope; + /** The pages of Settings where a person makes the same change — the + * coverage guard's join key, and where Tale sends a person to finish one. + * Empty for a kind no Settings page edits (a project's own pages do). */ + readonly areas: readonly SettingsArea[]; + /** Whether `tale config platform` and managed deployments declare it. */ + readonly cli: boolean; + readonly ops: readonly SettingsOp[]; + /** One-shot actions on an existing resource, each named in kebab case. */ + readonly acts: readonly string[]; + /** RFC 6901 pointers into the resource's config whose value is a secret: + * masked on every read, refused on every write. A `*` token stands for + * any member or index. */ + readonly secretPaths: readonly string[]; + readonly baseRisk: SettingsRisk; + /** Where its changes run among a batch's: a lower order applies first, + * so what a resource refers to exists before it. Unique per kind. */ + readonly order: number; + /** What it is, in agent-facing English: the settings reference + * (`tale://docs/settings`) is built from it. */ + readonly description: string; +} + +/** + * The kinds the MCP settings tools take, in apply order. A resource's `id` + * is its identity within its kind, as a declaration names it; a kind with + * one resource per organization or deployment has none. + */ +export const SETTINGS_KINDS = [ + { + kind: 'provider', + scope: 'organization', + areas: ['providers'], + cli: true, + ops: ['set', 'delete'], + acts: ['refresh-catalogs'], + secretPaths: [], + baseRisk: 'high', + order: 10, + description: + 'An AI provider: its endpoint, API format, model catalog source and the ways its credentials may authenticate. id is the provider name.', + }, + { + kind: 'provider-credential', + scope: 'organization', + areas: ['providers'], + cli: true, + ops: ['set', 'delete'], + acts: [], + secretPaths: [], + baseRisk: 'high', + order: 20, + description: + "A credential a provider's requests authenticate with, read from an environment variable of the deployment (authMethod env): its models, its status and whether it is the provider's default. id is /, the name URI-encoded. An API key or a subscription is entered in Tale, never here.", + }, + { + kind: 'governance', + scope: 'organization', + areas: [ + 'governance/content-models', + 'governance/policies-limits', + 'governance/security-monitoring', + 'governance/guardrails', + 'sandboxes', + 'api/models', + 'enterprise-sso', + ], + cli: true, + ops: ['set'], + acts: [], + secretPaths: [], + baseRisk: 'high', + order: 30, + description: + 'One organization policy, named by its key (the id), e.g. password_policy, budgets or default_models: models and model access, budgets and limits, sign-in and session security, guardrails, sandbox quotas. The retention policy and the data subject request policy change only through their own staged workflows in Tale.', + }, + { + kind: 'knowledge-embedding', + scope: 'organization', + areas: ['data-residency'], + cli: true, + ops: ['set'], + acts: [], + secretPaths: [], + baseRisk: 'critical', + order: 40, + description: + "The model that turns the organization's documents and crawled pages into vectors. Changing the model needs an empty knowledge base; its similarity floor and serving limits change at any time. One per organization.", + }, + { + kind: 'branding', + scope: 'organization', + areas: ['branding'], + cli: true, + ops: ['set'], + acts: [], + secretPaths: [], + baseRisk: 'low', + order: 50, + description: + "The organization's accent colour and the file names of its logo and favicons; the images themselves are uploaded in Tale. One per organization.", + }, + { + kind: 'project-instructions', + scope: 'project', + areas: [], + cli: true, + ops: ['set'], + acts: [], + secretPaths: [], + baseRisk: 'high', + order: 60, + description: + "A project's standing instructions, which every agent working in it follows. id is the project id.", + }, + { + kind: 'agent-instructions', + scope: 'project', + areas: [], + cli: true, + ops: ['set'], + acts: [], + secretPaths: [], + baseRisk: 'high', + order: 61, + description: "A project agent's instructions. id is /.", + }, + { + kind: 'agent-tools', + scope: 'project', + areas: [], + cli: true, + ops: ['set'], + acts: [], + secretPaths: [], + baseRisk: 'high', + order: 62, + description: + 'The tools a project agent may use. id is /.', + }, + { + kind: 'agent-model', + scope: 'project', + areas: [], + cli: true, + ops: ['set'], + acts: [], + secretPaths: [], + baseRisk: 'high', + order: 63, + description: + 'The harness, model and provider a project agent runs on; a change applies to the runs it starts next. id is /.', + }, + { + kind: 'task-instructions', + scope: 'project', + areas: [], + cli: true, + ops: ['set'], + acts: [], + secretPaths: [], + baseRisk: 'high', + order: 64, + description: + "A standing task's description, which its agent works from. id is /.", + }, + { + kind: 'task-review-context', + scope: 'project', + areas: [], + cli: true, + ops: ['set'], + acts: [], + secretPaths: [], + baseRisk: 'high', + order: 65, + description: + "Whether a task's work goes to an independent review by another project agent, and which one (reviewerAgentId); the reviewer stays the same once set. A task without one reads as null. id is /.", + }, + { + kind: 'deployment', + scope: 'instance', + areas: [], + cli: true, + ops: ['set'], + acts: [], + secretPaths: [], + baseRisk: 'critical', + order: 70, + description: + "This Tale deployment's own settings, shared by every organization on it, such as the sandbox runtime. Only the people its operator allows may change them, and some take effect after a restart. One per deployment.", + }, +] as const satisfies readonly SettingsKindDescriptor[]; + +export type SettingsKind = (typeof SETTINGS_KINDS)[number]['kind']; + +/** + * Kinds a declaration names that the MCP settings tools do not take, each + * with the reason: the automation tools make the same change with richer + * feedback, and one concept has one way in. + */ +export const SETTINGS_KINDS_NOT_OVER_MCP = [ + { + kind: 'automation-definition', + cli: true, + reason: + 'save_automation saves the document as a new version, with its validation, tests and warnings.', + }, + { + kind: 'automation-deployment', + cli: true, + reason: + 'deploy_automation puts a saved version live, behind its tests and the version it expects to replace.', + }, + { + kind: 'automation-schedule', + cli: true, + reason: + 'set_trigger binds what starts an automation, a schedule among them.', + }, +] as const satisfies ReadonlyArray<{ + kind: string; + cli: boolean; + reason: string; +}>; + +/** + * Organization policies the `governance` kind does not take, each with + * the reason an agent is told: two change through staged workflows of + * their own in Tale, and one is retired. + */ +export const GOVERNANCE_KEYS_NOT_OVER_MCP = { + retention_policy: + 'changes through its staged workflow in Tale, under Settings > Governance > Policies & limits', + dsar_governance: + 'changes through its staged workflow in Tale, under Settings > Governance > Data subject requests', + conversation_access: + 'is retired: conversation privacy is always on, and nothing reads it', +} as const satisfies Readonly>; + +const BY_KIND: ReadonlyMap = new Map( + SETTINGS_KINDS.map((descriptor) => [descriptor.kind, descriptor]), +); + +/** Whether the MCP settings tools take this kind. */ +export function isSettingsKind(name: string): name is SettingsKind { + return BY_KIND.has(name); +} + +/** The descriptor of a kind the MCP settings tools take. */ +export function settingsKindDescriptor( + kind: SettingsKind, +): SettingsKindDescriptor { + const descriptor = BY_KIND.get(kind); + if (descriptor === undefined) { + throw new Error(`No settings kind "${kind}"`); + } + return descriptor; +} + +/** One reference token of a pointer: any character but `~` and `/`, or + * those two escaped (`~0`, `~1`). */ +const POINTER = /^(?:\/(?:[^~/]|~[01])*)+$/; + +/** Whether a `secretPaths` entry is a well-formed RFC 6901 pointer below the + * config (never the whole config, which would leave nothing to read). */ +export function isSettingsPointer(pointer: string): boolean { + return POINTER.test(pointer); +} diff --git a/packages/shared/src/schemas/task-review-batch.ts b/packages/shared/src/schemas/task-review-batch.ts new file mode 100644 index 0000000000..618376d782 --- /dev/null +++ b/packages/shared/src/schemas/task-review-batch.ts @@ -0,0 +1,48 @@ +import { z } from 'zod/v4'; + +import { taskReviewExpectedSchema } from './task-review'; + +/** A review occurrence declares its whole bounded envelope before it starts. + * The native decision remains the only authority for each target's outcome. */ +export const taskReviewBatchTargetSchema = z.strictObject({ + taskId: z.uuid(), + expected: taskReviewExpectedSchema, +}); +export type TaskReviewBatchTarget = z.infer; + +export const taskReviewBatchTargetsSchema = z + .array(taskReviewBatchTargetSchema) + .min(1) + .max(20) + .refine( + (targets) => + new Set(targets.map((target) => target.taskId)).size === targets.length, + 'Declare each task once', + ); + +export const taskReviewBatchStartSchema = z.strictObject({ + operation: z.literal('start_batch'), + requestId: z.uuid(), + contextTaskId: z.uuid(), + targets: taskReviewBatchTargetsSchema, +}); +export type TaskReviewBatchStart = z.infer; + +export const taskReviewBatchReadSchema = z.strictObject({ + operation: z.literal('read_batch'), + batchId: z.uuid(), +}); + +export interface TaskReviewBatchResult { + batchId: string; + contextTaskId: string; + reviewerAgentId: string; + requestId: string; + /** Complete means all review actions are attested, not all work approved. */ + outcome: 'complete' | 'incomplete'; + runs: { runId: string; status: string }[]; + targets: (TaskReviewBatchTarget & { + decision: 'approve' | 'request_changes' | null; + issuerRunId: string | null; + })[]; +} diff --git a/packages/shared/src/schemas/task-review.ts b/packages/shared/src/schemas/task-review.ts index ff04ff69e3..212462dac3 100644 --- a/packages/shared/src/schemas/task-review.ts +++ b/packages/shared/src/schemas/task-review.ts @@ -67,7 +67,7 @@ export type SetProjectTaskReviewerInput = z.infer< >; const evidenceRevisionSchema = z.string().regex(/^[a-f0-9]{64}$/); -const taskReviewExpectedSchema = z +export const taskReviewExpectedSchema = z .object({ approvalId: reviewerIdSchema, runId: reviewerIdSchema, diff --git a/packages/shared/src/time-zone.ts b/packages/shared/src/time-zone.ts new file mode 100644 index 0000000000..7c882132e4 --- /dev/null +++ b/packages/shared/src/time-zone.ts @@ -0,0 +1,28 @@ +/** + * Time zone names as every surface reads them: the trigger schema that + * refuses a zone nobody can resolve, the platform's zoned clock and the + * scan that fires a schedule in it. One spelling per zone, so a stored zone + * compares equal however it was typed. + * + * Imports nothing: the browser and the server both load it. + */ + +/** + * The zone `value` names, trimmed and spelled the way `Intl` spells it + * (`utc` → `UTC`, `europe/zurich` → `Europe/Zurich`), or null when it names + * none — a blank value included. Fixed offsets such as `+05:30` are zones + * too. Runtimes differ on links: Bun keeps `US/Eastern` where Node answers + * `America/New_York`; both are valid everywhere. + */ +export function canonicalTimeZone(value: string): string | null { + const trimmed = value.trim(); + if (trimmed === '') return null; + try { + return new Intl.DateTimeFormat('en-US', { + timeZone: trimmed, + }).resolvedOptions().timeZone; + } catch (error) { + if (error instanceof RangeError) return null; + throw error; + } +} diff --git a/packages/shared/src/utils/configuration-hash.golden.ts b/packages/shared/src/utils/configuration-hash.golden.ts new file mode 100644 index 0000000000..e9e80bf3dc --- /dev/null +++ b/packages/shared/src/utils/configuration-hash.golden.ts @@ -0,0 +1,128 @@ +/** + * The golden corpus of `configurationHash`: one value, one digest each. + * The digests were recorded from the two functions the hash replaced — the + * CLI's `valueHash` and the platform's `managedConfigurationHash` — which + * agreed on every one of them, and CLI plans, receipts and the platform's + * native preconditions (`hash` / `expectedHash`) were recorded with them. So + * every digest here is a promise: no refactor may move one. + * + * Test support only: `configuration-hash.test.ts` holds the shared function to + * it, and the CLI's parity suite holds its own `valueHash` and the platform's + * `managedConfigurationHash` to it. + */ +export const CONFIGURATION_HASH_GOLDEN: readonly (readonly [ + string, + unknown, + string, +])[] = [ + [ + 'true', + true, + 'b5bea41b6c623f7c09f1bf24dcae58ebab3c0cdd90ad966bc43a45b44867e12b', + ], + [ + 'false', + false, + 'fcbcf165908dd18a9e49f7ff27810176db8e9f63b4352213741664245224f8aa', + ], + [ + 'zero', + 0, + '5feceb66ffc86f38d952786c6d696c79c2dbc239dd4e91b46729d73a27fb57e9', + ], + [ + 'negative zero', + -0, + '5feceb66ffc86f38d952786c6d696c79c2dbc239dd4e91b46729d73a27fb57e9', + ], + [ + 'integer', + 42, + '73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049', + ], + [ + 'negative', + -7, + 'a770d3270c9dcdedf12ed9fd70444f7c8a95c26cae3cae9bd867499090a2f14b', + ], + [ + 'fraction', + 1.5, + '9f29a130438b81170b92a42650f9a94291ecad60bd47af2a3886e75f7f728725', + ], + [ + 'exponent', + 1e21, + '241c4643fa70b1dcde1205b71be4e3bebb17e9f880c8e1a33d0ead6c27271d3c', + ], + [ + 'tiny', + 1e-7, + '5b33e02f2c5103a05d32f6ba9cb058294452bfbf393967f68bb30c1bdcbbab22', + ], + [ + 'beyond the safe integers', + 2 ** 53 + 2, + '25aa68783313802627958889943e895749ac4c0c7469b2a305cd450a12120768', + ], + [ + 'not a number (serialized as null)', + Number.NaN, + '74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b', + ], + [ + 'empty string', + '', + '12ae32cb1ec02d01eda3581b127c1fee3b0dc53572ed6baf239721a03d82e126', + ], + [ + 'unicode string', + ' café 😺 ', + '9bfcef4d1b3e38e1ce77febf76a0c69402483d4887dff28b8dd217c333bf4e36', + ], + [ + 'escapes', + 'line\nbreak "quoted" \\ 
 \u0000', + '76da2c85724e3ff3927a2d4a02792a2324cc8c77c240f9645b711f3dd851eb3e', + ], + [ + 'empty array', + [], + '4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945', + ], + [ + 'empty object', + {}, + '44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a', + ], + [ + 'numeric keys and nested arrays', + { '10': 1, '2': ['x', { z: true, a: null }], '1': { '20': 2, '3': 3 } }, + '2edb082bd557ed6017442ce17de049016bc7697d1226f0e581be4673545c8953', + ], + [ + 'unsorted keys', + { b: 1, a: [3, { d: null, c: 'x' }] }, + 'b4a92c330fc01410911e683d5d03404eb28981a6e1d67f9cb1ae63ddc3d19947', + ], + [ + 'unicode and empty keys', + { é: 1, e: 2, Z: 3, '': 0 }, + '528bf91433a18ef395f2c7932427e6f6afa6cf4dd40e24af56640e70005d8fd9', + ], + [ + 'a policy', + { + enabled: true, + idleTimeoutMinutes: 45, + rules: [{ scope: 'org', maxTokens: 1000 }], + }, + '5c1093799a52bfe0671e5e3d7f3b204e7700ad17cd888115d4c2f075b00df2a1', + ], +]; + +/** The digest of `null`. `configurationHash` and the CLI's `valueHash` answer + * it; the platform's `managedConfigurationHash(null)` answers null instead, + * because a null precondition means "the resource is absent". */ +export const NULL_DIGEST = + '74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b'; diff --git a/packages/shared/src/utils/configuration-hash.test.ts b/packages/shared/src/utils/configuration-hash.test.ts new file mode 100644 index 0000000000..faffcf9d8b --- /dev/null +++ b/packages/shared/src/utils/configuration-hash.test.ts @@ -0,0 +1,50 @@ +import { describe, expect, it } from 'vitest'; + +import { configurationHash } from './configuration-hash'; +import { + CONFIGURATION_HASH_GOLDEN, + NULL_DIGEST, +} from './configuration-hash.golden'; +import { computeContentHash } from './hashing'; +import { stableStringify } from './stable-stringify'; + +describe('configurationHash', () => { + it.each(CONFIGURATION_HASH_GOLDEN)( + '%s keeps its golden digest', + (_name, value, digest) => { + expect(configurationHash(value)).toBe(digest); + }, + ); + + it('is the SHA-256 of the key-sorted JSON', () => { + const value = { b: [true, null], a: { d: 1, c: 'x' } }; + expect(stableStringify(value)).toBe( + '{"a":{"c":"x","d":1},"b":[true,null]}', + ); + expect(configurationHash(value)).toBe( + computeContentHash('{"a":{"c":"x","d":1},"b":[true,null]}'), + ); + }); + + it('never depends on key order', () => { + expect(configurationHash({ a: 1, b: { c: 2, d: [3] } })).toBe( + configurationHash({ b: { d: [3], c: 2 }, a: 1 }), + ); + }); + + it('hashes null like any other value; absence is the caller’s convention', () => { + expect(configurationHash(null)).toBe(NULL_DIGEST); + }); + + it('writes what JSON cannot hold as null, the way the platform always has', () => { + expect(configurationHash(undefined)).toBe(NULL_DIGEST); + expect(configurationHash({ a: undefined })).toBe( + configurationHash({ a: null }), + ); + expect(configurationHash([1, undefined, () => 1])).toBe( + configurationHash([1, null, null]), + ); + // An undefined member is kept as null, so it is not the same as absent. + expect(configurationHash({ a: undefined })).not.toBe(configurationHash({})); + }); +}); diff --git a/packages/shared/src/utils/configuration-hash.ts b/packages/shared/src/utils/configuration-hash.ts new file mode 100644 index 0000000000..a501558bcb --- /dev/null +++ b/packages/shared/src/utils/configuration-hash.ts @@ -0,0 +1,16 @@ +import { computeContentHash } from './hashing'; +import { stableStringify } from './stable-stringify'; + +/** + * The identity of a native configuration value: the SHA-256 (hex) of its + * key-sorted JSON ({@link stableStringify}). The platform answers it as a + * resource's `hash` and takes it back as `expectedHash`, the compare-and-set + * precondition of every configuration write; the CLI's plans and the MCP + * settings tools compare against the same digest. + * + * Server-only (Node's crypto). A digest, once recorded, must never move: + * `configuration-hash.test.ts` pins a golden corpus. + */ +export function configurationHash(value: unknown): string { + return computeContentHash(stableStringify(value)); +} diff --git a/packages/shared/src/utils/stable-stringify.ts b/packages/shared/src/utils/stable-stringify.ts new file mode 100644 index 0000000000..01540aceae --- /dev/null +++ b/packages/shared/src/utils/stable-stringify.ts @@ -0,0 +1,16 @@ +/** Deep-equality serialization independent of key order: JSON with every + * object's keys sorted. A value JSON cannot hold (`undefined`, a function) + * serializes as `null`, wherever it sits. Pure — the automation engine and + * the browser use it too. */ +export function stableStringify(v: unknown): string { + if (Array.isArray(v)) return `[${v.map(stableStringify).join(',')}]`; + if (v && typeof v === 'object') { + // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- narrowed by the object check above + const record = v as Record; + return `{${Object.keys(record) + .sort() + .map((k) => `${JSON.stringify(k)}:${stableStringify(record[k])}`) + .join(',')}}`; + } + return JSON.stringify(v) ?? 'null'; +} diff --git a/packages/ui/README.md b/packages/ui/README.md index 6b2a61354e..e7e2de89fc 100644 --- a/packages/ui/README.md +++ b/packages/ui/README.md @@ -14,12 +14,12 @@ and stories live together under `src/components//`. | Need | Example imports | | --- | --- | -| Controls and forms | `button`, `icon-button`, `input`, `select`, `checkbox`, `use-form`, `field-shell` | -| Tables and values | `data-table/data-table`, `data-table/column-builders`, `copyable-field`, `json-viewer` | +| Controls and forms | `button`, `icon-button`, `input`, `select`, `checkbox`, `use-form`, `field-shell`, `code-editor` | +| Tables and values | `data-table/data-table`, `data-table/column-builders`, `copyable-field`, `json-viewer`, `schema-tree`, `vendor-icon` | | Layout and navigation | `page-layout`, `adaptive-header`, `sub-panel`, `header-breadcrumbs`, `tab-navigation` | | Dialogs and feedback | `dialog/form-dialog`, `dialog/delete-dialog`, `toaster`, `use-toast`, `use-retry-focus` | | Problems a check found | `issue-list`, `issue-summary`, `issue-severity`, `field-issue-messages`, `issue-focus`, `flow/node-issue-marker` | -| Editing and diagrams | `editor`, `wizard/*`, `catalog/*`, `filters/*`, `flow/*` | +| Editing and diagrams | `editor`, `wizard/*`, `catalog/*`, `filters/*`, `flow/workflow-canvas`, `flow/flow-step-list`, `flow/flow-path-list`, `flow/paths`, `flow/playback`, `flow/playback-bar`, `flow/layout`, `flow/*` | | Documentation sites | `docs/docs-layout`, `docs/docs-header`, `docs/docs-article`, `docs/docs-not-found`, `docs/page-actions`, `search/static-index/*` | | Shared infrastructure | `i18n/*`, `markdown/*`, `seo/*`, `server`, `monitoring/*`, `theme`, `testing/*` | | Large custom collections | `use-virtual-list`; [windowing and focus guidance](https://ui.tale.dev/docs/patterns/list-page#bound-a-custom-collections-rendering) | diff --git a/packages/ui/package.json b/packages/ui/package.json index 8e8d9e0b6a..6dc483ea03 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -20,13 +20,14 @@ "exports": { ".": "./src/index.ts", "./accent-color": "./src/theme/accent-color.tsx", - "./analytics/browser": "./src/analytics/browser.ts", - "./analytics/server": "./src/analytics/server.ts", "./accordion": "./src/components/feedback/accordion.tsx", "./action-row": "./src/components/layout/action-row.tsx", "./adaptive-header": "./src/components/layout/adaptive-header.tsx", "./alert": "./src/components/feedback/alert.tsx", + "./analytics/browser": "./src/analytics/browser.ts", + "./analytics/server": "./src/analytics/server.ts", "./app-shell": "./src/app-shell.tsx", + "./avatar": "./src/components/data-display/avatar.tsx", "./badge": "./src/components/feedback/badge.tsx", "./bordered-section": "./src/components/layout/bordered-section.tsx", "./bottom-tab-bar": "./src/components/navigation/bottom-tab-bar.tsx", @@ -48,6 +49,10 @@ "./checkbox-group": "./src/components/forms/checkbox-group.tsx", "./cn": "./src/lib/cn.ts", "./code-block": "./src/components/data-display/code-block.tsx", + "./code-editor": "./src/components/forms/code-editor/code-editor.tsx", + "./code-editor/locate": "./src/components/forms/code-editor/locate.ts", + "./code-editor/providers": "./src/components/forms/code-editor/providers.ts", + "./code-editor/template-scan": "./src/components/forms/code-editor/template-scan.ts", "./collapsible-details": "./src/components/navigation/collapsible-details.tsx", "./container": "./src/components/layout/container.tsx", "./content-area": "./src/components/layout/content-area.tsx", @@ -55,6 +60,7 @@ "./copyable-field": "./src/components/data-display/copyable-field.tsx", "./copyable-timestamp": "./src/components/data-display/copyable-timestamp.tsx", "./count-badge": "./src/components/feedback/count-badge.tsx", + "./data-diff": "./src/components/data-display/data-diff/data-diff.tsx", "./data-table/column-builders": "./src/components/data-table/column-builders.tsx", "./data-table/data-table": "./src/components/data-table/data-table.tsx", "./data-table/data-table-action-menu": "./src/components/data-table/data-table-action-menu.tsx", @@ -65,6 +71,14 @@ "./data-table/data-table-skeleton-cell": "./src/components/data-table/data-table-skeleton-cell.tsx", "./data-table/data-table-types": "./src/components/data-table/data-table-types.ts", "./data-table/table-icon-cell": "./src/components/data-table/table-icon-cell.tsx", + "./data-view": "./src/components/data-display/data-view/data-view.tsx", + "./data/hash": "./src/data/hash.ts", + "./data/infer-schema": "./src/data/infer-schema.ts", + "./data/json-pointer": "./src/data/json-pointer.ts", + "./data/random-json": "./src/data/random-json.ts", + "./data/stable-stringify": "./src/data/stable-stringify.ts", + "./data/value-diff": "./src/data/value-diff.ts", + "./data/value-summary": "./src/data/value-summary.ts", "./date": "./src/lib/date/format.ts", "./date-picker": "./src/components/forms/date-picker.tsx", "./date-picker-popper": "./src/components/forms/date-picker-popper.tsx", @@ -88,7 +102,6 @@ "./docs/docs-prev-next": "./src/components/docs/docs-prev-next.tsx", "./docs/docs-search-dialog": "./src/components/docs/docs-search-dialog.tsx", "./docs/docs-search-trigger": "./src/components/docs/docs-search-trigger.tsx", - "./docs/use-docs-search": "./src/components/docs/use-docs-search.ts", "./docs/docs-toc": "./src/components/docs/docs-toc.tsx", "./docs/edit-on-github": "./src/components/docs/edit-on-github.tsx", "./docs/links": "./src/components/docs/links.ts", @@ -98,6 +111,7 @@ "./docs/redirects": "./src/components/docs/redirects.ts", "./docs/scroll-to-top": "./src/components/docs/scroll-to-top.tsx", "./docs/suggest-pages": "./src/components/docs/suggest-pages.ts", + "./docs/use-docs-search": "./src/components/docs/use-docs-search.ts", "./document-icon": "./src/components/data-display/document-icon.tsx", "./dropdown-menu": "./src/components/overlays/dropdown-menu.tsx", "./editor": "./src/components/editor/index.ts", @@ -141,14 +155,25 @@ "./filters/filter-button": "./src/components/filters/filter-button.tsx", "./filters/filter-panel": "./src/components/filters/filter-panel.tsx", "./filters/filter-section": "./src/components/filters/filter-section.tsx", + "./flow/compare": "./src/components/flow/compare/compare.ts", "./flow/edge-palette": "./src/components/flow/edge-palette.ts", - "./flow/elk-layout": "./src/components/flow/layout/elk-layout.ts", "./flow/flow-canvas": "./src/components/flow/flow-canvas.tsx", + "./flow/flow-legend": "./src/components/flow/flow-legend.tsx", + "./flow/flow-path-list": "./src/components/flow/flow-path-list.tsx", + "./flow/flow-step-list": "./src/components/flow/flow-step-list.tsx", + "./flow/layout": "./src/components/flow/layout/index.ts", "./flow/node-issue-marker": "./src/components/flow/node-issue-marker.tsx", - "./flow/use-elk-layout": "./src/components/flow/layout/use-elk-layout.ts", + "./flow/node-status": "./src/components/flow/node-status.tsx", + "./flow/paths": "./src/components/flow/paths/highlight.ts", + "./flow/playback": "./src/components/flow/playback/index.ts", + "./flow/playback-bar": "./src/components/flow/playback/flow-playback-bar.tsx", + "./flow/run-timeline": "./src/components/flow/run-timeline/index.ts", + "./flow/types": "./src/components/flow/types.ts", + "./flow/workflow-canvas": "./src/components/flow/workflow-canvas.tsx", "./form": "./src/components/forms/form.tsx", "./form-section": "./src/components/forms/form-section.tsx", "./format": "./src/lib/format.ts", + "./format-duration": "./src/components/data-display/duration.tsx", "./full-page-center": "./src/components/layout/full-page-center.tsx", "./globals.css": "./src/globals.css", "./header-breadcrumb-switcher": "./src/components/layout/header-breadcrumb-switcher.tsx", @@ -185,8 +210,8 @@ "./icons/google-icon": "./src/icons/google-icon.tsx", "./icons/locale-icon": "./src/icons/locale-icon.tsx", "./icons/microsoft-icon": "./src/icons/microsoft-icon.tsx", - "./icons/openai-icon": "./src/icons/openai-icon.tsx", "./icons/onedrive-icon": "./src/icons/onedrive-icon.tsx", + "./icons/openai-icon": "./src/icons/openai-icon.tsx", "./icons/outlook-icon": "./src/icons/outlook-icon.tsx", "./icons/sharepoint-icon": "./src/icons/sharepoint-icon.tsx", "./icons/shopify-icon": "./src/icons/shopify-icon.tsx", @@ -227,6 +252,7 @@ "./markdown/globals.css": "./src/markdown/globals.css", "./markdown/plugins/micromark-cjk-attention": "./src/markdown/plugins/micromark-cjk-attention.ts", "./markdown/reading-time": "./src/markdown/reading-time.ts", + "./markdown/remark-plugin-lists": "./src/markdown/remark-plugin-lists.ts", "./markdown/routed-markdown": "./src/markdown/routed-markdown.tsx", "./markdown/shiki": "./src/markdown/shiki.ts", "./markdown/streaming/clause-boundaries": "./src/markdown/streaming/clause-boundaries.ts", @@ -235,6 +261,12 @@ "./markdown/streaming/normalize-html-blocks": "./src/markdown/streaming/normalize-html-blocks.ts", "./markdown/streaming/remend-markdown": "./src/markdown/streaming/remend-markdown.ts", "./markdown/types": "./src/markdown/types.ts", + "./mentions/mention-chip": "./src/mentions/mention-chip.tsx", + "./mentions/mention-options": "./src/mentions/mention-options.ts", + "./mentions/mention-textarea": "./src/mentions/mention-textarea.tsx", + "./mentions/mention-token": "./src/mentions/mention-token.ts", + "./mentions/remark-mentions": "./src/mentions/remark-mentions.ts", + "./mentions/scan-mentions": "./src/mentions/scan-mentions.ts", "./metrics/charts": "./src/components/metrics/charts/index.ts", "./metrics/charts/donut-chart": "./src/components/metrics/charts/donut-chart.tsx", "./metrics/charts/trend-area-chart": "./src/components/metrics/charts/trend-area-chart.tsx", @@ -271,6 +303,7 @@ "./pwa/use-install-prompt": "./src/pwa/use-install-prompt.ts", "./pwa/vite-plugin": "./src/pwa/vite-plugin.ts", "./radio-group": "./src/components/forms/radio-group.tsx", + "./read-more": "./src/components/data-display/read-more.tsx", "./recurrence": "./src/lib/recurrence/rule.ts", "./recurrence-editor": "./src/components/forms/recurrence-editor.tsx", "./recurrence-format": "./src/lib/recurrence/format.ts", @@ -280,6 +313,7 @@ "./responsive-dialog": "./src/components/overlays/responsive-dialog.tsx", "./route-progress-bar": "./src/components/layout/route-progress-bar.tsx", "./schedule-occurrence-list": "./src/components/data-display/schedule-occurrence-list.tsx", + "./schema-tree": "./src/components/data-display/schema-tree.tsx", "./scroll-wheel-chain": "./src/lib/scroll-wheel-chain.ts", "./search": "./src/components/search/index.ts", "./search-input": "./src/components/forms/search-input.tsx", @@ -299,6 +333,7 @@ "./searchable-select": "./src/components/forms/searchable-select.tsx", "./section": "./src/components/layout/section.tsx", "./section-header": "./src/components/layout/section-header.tsx", + "./section-nav": "./src/components/layout/section-nav.tsx", "./segmented-control": "./src/components/forms/segmented-control.tsx", "./select": "./src/components/forms/select.tsx", "./selectable-row": "./src/components/data-display/selectable-row.tsx", @@ -353,9 +388,7 @@ "./string": "./src/lib/string.ts", "./structural-equal": "./src/lib/structural-equal.ts", "./sub-panel": "./src/components/layout/sub-panel.tsx", - "./section-nav": "./src/components/layout/section-nav.tsx", "./sub-panel-list": "./src/components/layout/sub-panel-list.tsx", - "./thread-header": "./src/components/layout/thread-header.tsx", "./switch": "./src/components/forms/switch.tsx", "./tab-navigation": "./src/components/navigation/tab-navigation.tsx", "./table": "./src/components/data-display/table.tsx", @@ -369,6 +402,15 @@ "./theme": "./src/theme/index.ts", "./theme-switcher": "./src/components/site/theme-switcher.tsx", "./theme/assets": "./src/theme/theme-assets.tsx", + "./thread-header": "./src/components/layout/thread-header.tsx", + "./thread/group-by-day": "./src/components/thread/group-by-day.ts", + "./thread/layout": "./src/components/thread/layout.ts", + "./thread/thinking-dots": "./src/components/thread/thinking-dots.tsx", + "./thread/thread-day-divider": "./src/components/thread/thread-day-divider.tsx", + "./thread/thread-event": "./src/components/thread/thread-event.tsx", + "./thread/thread-message": "./src/components/thread/thread-message.tsx", + "./thread/thread-time": "./src/components/thread/thread-time.tsx", + "./thread/timeline-row": "./src/components/thread/timeline-row.tsx", "./time-field": "./src/components/forms/time-field.tsx", "./time-of-day": "./src/lib/time-of-day.ts", "./toast": "./src/components/feedback/toast.tsx", @@ -380,32 +422,37 @@ "./use-date-fns-locale": "./src/hooks/use-date-fns-locale.ts", "./use-debounce": "./src/hooks/use-debounce.ts", "./use-dropdown-placement": "./src/hooks/use-dropdown-placement.ts", + "./use-focus-handoff": "./src/hooks/use-focus-handoff.ts", "./use-form": "./src/components/forms/use-form.ts", "./use-format-date": "./src/hooks/use-format-date.ts", + "./use-ime-composition": "./src/hooks/use-ime-composition.ts", "./use-infinite-scroll": "./src/hooks/use-infinite-scroll.ts", - "./use-virtual-list": "./src/hooks/use-virtual-list.ts", "./use-is-mac": "./src/hooks/use-is-mac.ts", - "./use-site-copyright": "./src/hooks/use-site-copyright.ts", - "./use-recurrence-format": "./src/hooks/use-recurrence-format.ts", - "./use-scroll-compact": "./src/hooks/use-scroll-compact.ts", - "./use-mobile-keyboard": "./src/hooks/use-mobile-keyboard.ts", "./use-is-mobile": "./src/hooks/use-is-mobile.ts", "./use-is-short-viewport": "./src/hooks/use-is-short-viewport.ts", "./use-list-page": "./src/hooks/use-list-page.ts", - "./use-focus-handoff": "./src/hooks/use-focus-handoff.ts", "./use-media-query": "./src/hooks/use-media-query.ts", - "./use-sliding-indicator": "./src/hooks/use-sliding-indicator.ts", - "./use-swap-fade": "./src/hooks/use-swap-fade.ts", + "./use-mobile-keyboard": "./src/hooks/use-mobile-keyboard.ts", + "./use-now": "./src/hooks/use-now.ts", + "./use-prefers-reduced-motion": "./src/hooks/use-prefers-reduced-motion.ts", + "./use-recurrence-format": "./src/hooks/use-recurrence-format.ts", "./use-resizable": "./src/hooks/use-resizable.ts", "./use-resize-observer": "./src/hooks/use-resize-observer.ts", - "./use-retry-focus": "./src/hooks/use-retry-focus.ts", "./use-restore-focus": "./src/hooks/use-restore-focus.ts", + "./use-retry-focus": "./src/hooks/use-retry-focus.ts", + "./use-scroll-compact": "./src/hooks/use-scroll-compact.ts", "./use-search-shortcut": "./src/hooks/use-search-shortcut.ts", + "./use-site-copyright": "./src/hooks/use-site-copyright.ts", + "./use-sliding-indicator": "./src/hooks/use-sliding-indicator.ts", + "./use-swap-fade": "./src/hooks/use-swap-fade.ts", "./use-toast": "./src/hooks/use-toast.ts", "./use-trigger-tooltip-guard": "./src/hooks/use-trigger-tooltip-guard.ts", "./use-viewport-visibility": "./src/hooks/use-viewport-visibility.ts", + "./use-virtual-list": "./src/hooks/use-virtual-list.ts", "./use-zoom-pan": "./src/hooks/use-zoom-pan.ts", "./validation-check-item": "./src/components/feedback/validation-check-item.tsx", + "./value-tree": "./src/components/data-display/value-tree/value-tree.tsx", + "./vendor-icon": "./src/components/data-display/vendor-icon.tsx", "./vite/message-topics": "./src/vite/message-topics.ts", "./vite/yaml": "./src/vite/yaml.ts", "./wizard/use-wizard": "./src/components/wizard/use-wizard.ts", @@ -426,10 +473,22 @@ "test:browser": "bunx vitest --run --project browser" }, "dependencies": { + "@codemirror/autocomplete": "6.20.3", + "@codemirror/commands": "6.10.4", + "@codemirror/lang-javascript": "6.2.5", + "@codemirror/lang-json": "6.0.2", + "@codemirror/lang-yaml": "6.1.3", + "@codemirror/language": "6.12.4", + "@codemirror/search": "6.7.1", + "@codemirror/state": "6.7.1", + "@codemirror/view": "6.43.8", "@fontsource/inter": "5.2.8", "@hookform/resolvers": "5.2.2", "@iconify-json/lucide": "1.2.122", "@iconify/react": "6.0.2", + "@lezer/common": "1.5.2", + "@lezer/highlight": "1.2.3", + "@lezer/markdown": "1.7.2", "@microlink/react-json-view": "1.31.18", "@radix-ui/react-checkbox": "1.3.3", "@radix-ui/react-dialog": "1.1.15", diff --git a/packages/ui/src/assets.d.ts b/packages/ui/src/assets.d.ts index ed683fc990..4c5f5ee832 100644 --- a/packages/ui/src/assets.d.ts +++ b/packages/ui/src/assets.d.ts @@ -18,3 +18,10 @@ declare module '@fontsource/inter/files/inter-latin-500-normal.woff2?url' { const src: string; export default src; } + +// The ELK layout worker: elkjs's own worker script, emitted as a +// same-origin file the flow layout starts a `Worker` from. +declare module 'elkjs/lib/elk-worker.min.js?url' { + const src: string; + export default src; +} diff --git a/packages/ui/src/components/data-display/avatar.stories.tsx b/packages/ui/src/components/data-display/avatar.stories.tsx new file mode 100644 index 0000000000..e3f1e0c6b5 --- /dev/null +++ b/packages/ui/src/components/data-display/avatar.stories.tsx @@ -0,0 +1,77 @@ +import type { Meta, StoryObj } from '@storybook/react-vite'; + +import { Avatar } from './avatar'; + +const meta: Meta = { + title: 'Data Display/Avatar', + component: Avatar, + tags: ['autodocs'], + parameters: { + layout: 'centered', + docs: { + description: { + component: ` +The picture of who said or did something: a person's initials on a tint +hashed from their name, an agent's bot, an automation's workflow glyph, +the system, or an empty (unassigned) slot. Four sizes: 20, 24, 28, 32px. + +## Usage +\`\`\`tsx +import { Avatar, getInitials } from '@tale/ui/avatar'; + + + + + // decorative: the name is written beside it +\`\`\` + +## Accessibility +- With \`label\`: \`role="img"\`, \`aria-label\` and a \`title\` tooltip +- Without \`label\`: decorative (\`aria-hidden\`); write the name beside it +- Initials are at least 10px; each tint has a dark-mode pair + `, + }, + }, + }, + args: { name: 'Anna Meier', label: 'Anna Meier', size: 'sm' }, + argTypes: { + kind: { + control: 'select', + options: ['person', 'agent', 'automation', 'system', 'unassigned'], + }, + size: { control: 'select', options: ['xs', 'sm', 'md', 'lg'] }, + tone: { + control: 'select', + options: [undefined, 'auto', 'neutral', 'primary', 'strong'], + }, + }, +}; + +export default meta; +type Story = StoryObj; + +export const Person: Story = {}; + +export const Kinds: Story = { + render: () => ( +
+ + + + + + + +
+ ), +}; + +export const Sizes: Story = { + render: () => ( +
+ {(['xs', 'sm', 'md', 'lg'] as const).map((size) => ( + + ))} +
+ ), +}; diff --git a/packages/ui/src/components/data-display/avatar.test.tsx b/packages/ui/src/components/data-display/avatar.test.tsx new file mode 100644 index 0000000000..0ca46590c4 --- /dev/null +++ b/packages/ui/src/components/data-display/avatar.test.tsx @@ -0,0 +1,139 @@ +import { fireEvent } from '@testing-library/react'; +import { describe, expect, it } from 'vitest'; + +import { checkAccessibility } from '@/tests/utils/a11y'; +import { render, screen } from '@/tests/utils/render'; + +import { Avatar, getInitials } from './avatar'; + +describe('getInitials', () => { + it.each([ + ['Anna Meier', 'AM'], + ['Anna Maria Meier', 'AM'], + ['jordan', 'J'], + ['anna.meier@example.com', 'AM'], + ['yara_polish', 'YP'], + [' élodie durand ', 'ÉD'], + ['', ''], + [' ', ''], + ])('reads %j as %j', (name, initials) => { + expect(getInitials(name)).toBe(initials); + }); +}); + +describe('Avatar', () => { + it('is a named image with a tooltip when labelled', () => { + render(); + const avatar = screen.getByRole('img', { name: 'Anna Meier' }); + expect(avatar).toHaveAttribute('title', 'Anna Meier'); + expect(avatar).toHaveTextContent('AM'); + }); + + it('is decorative without a label', () => { + const { container } = render(); + expect(screen.queryByRole('img')).not.toBeInTheDocument(); + expect(container.firstElementChild).toHaveAttribute('aria-hidden', 'true'); + }); + + it('gives the same person the same tint every time', () => { + const { container, rerender } = render(); + const first = container.firstElementChild?.className; + rerender(); + expect(container.firstElementChild?.className).toBe(first); + expect(first).toMatch(/bg-\w+-500\/15/); + }); + + it.each([ + ['agent', 'bg-primary/10'], + ['automation', 'bg-muted'], + ['system', 'bg-muted'], + ] as const)('draws a %s as a glyph on its tone', (kind, tone) => { + render(); + const avatar = screen.getByRole('img', { name: 'Actor' }); + expect(avatar).toHaveClass(tone); + expect(avatar).not.toHaveTextContent('IN'); + expect(avatar.querySelector('svg')).toBeInTheDocument(); + }); + + it('draws an empty slot with a dashed border', () => { + render(); + expect(screen.getByRole('img', { name: 'Unassigned' })).toHaveClass( + 'border-dashed', + ); + }); + + it('keeps the widest initial pairs inside the smallest circle', () => { + const { rerender } = render( + , + ); + const avatar = screen.getByRole('img', { name: 'Walter White' }); + expect(avatar).toHaveTextContent(/^W$/); + + rerender(); + expect(avatar).toHaveTextContent(/^WW$/); + rerender(); + expect(avatar).toHaveTextContent(/^AL$/); + }); + + it('falls back to a glyph for a person with no name', () => { + render(); + const avatar = screen.getByRole('img', { name: 'Someone' }); + expect(avatar.querySelector('svg')).toBeInTheDocument(); + expect(avatar).toHaveClass('bg-muted'); + }); + + it('lets the host override the tone', () => { + render(); + expect(screen.getByRole('img', { name: 'Alex' })).toHaveClass( + 'bg-primary', + 'text-primary-foreground', + ); + }); + + it.each([ + ['xs', 'size-5'], + ['sm', 'size-6'], + ['md', 'size-7'], + ['lg', 'size-8'], + ] as const)('sizes %s as %s', (size, cls) => { + render(); + expect(screen.getByRole('img', { name: 'Anna' })).toHaveClass(cls); + }); + + it('shows a picture and falls back to initials when it fails', () => { + const { container } = render( + , + ); + const image = container.querySelector('img'); + expect(image).toHaveAttribute('alt', ''); + fireEvent.error(image as HTMLImageElement); + expect(container.querySelector('img')).not.toBeInTheDocument(); + expect(screen.getByRole('img', { name: 'Anna Meier' })).toHaveTextContent( + 'AM', + ); + }); + + it('forwards attributes and classes', () => { + render( + , + ); + expect(screen.getByTestId('who')).toHaveClass('ring-2'); + }); + + it('passes an axe audit, named and decorative', async () => { + const { container } = render( +
+ + + + +
, + ); + await checkAccessibility(container); + }); +}); diff --git a/packages/ui/src/components/data-display/avatar.tsx b/packages/ui/src/components/data-display/avatar.tsx new file mode 100644 index 0000000000..5da5cfdd53 --- /dev/null +++ b/packages/ui/src/components/data-display/avatar.tsx @@ -0,0 +1,204 @@ +'use client'; + +/** + * The picture of who said or did something: a person's initials, an agent's + * bot, an automation's workflow glyph, the system, or an empty slot. + * + * Named (`label`), the avatar is an image (`role="img"` + `aria-label` + + * `title`) — a bare `` names nothing. Without a label it is + * decorative and hidden from assistive technology, for the common case where + * the name is already written beside it. + * + * A person's tint is hashed from the name over a fixed set of token-paired + * tints, so the same person reads in the same colour in every list. + */ + +import { cva } from 'class-variance-authority'; +import { Bot, Sparkles, User, Workflow, type LucideIcon } from 'lucide-react'; +import { useCallback, useState, type HTMLAttributes, type Ref } from 'react'; + +import { cn } from '../../lib/cn'; + +export type AvatarKind = + | 'person' + | 'agent' + | 'automation' + | 'system' + | 'unassigned'; + +export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg'; + +/** + * `auto` hashes a person's name to a tint; `neutral` is the muted chip; + * `primary` the soft accent tint agents use; `strong` the filled accent + * that marks "you". + */ +export type AvatarTone = 'auto' | 'neutral' | 'primary' | 'strong'; + +/** Theme-safe tints, each with its dark-mode pair. The light text is the 800 + * step: at 10px initials the 700 step fell under 4.5:1 over its own tint. */ +const PERSON_TONES = [ + 'bg-blue-500/15 text-blue-800 dark:text-blue-300', + 'bg-violet-500/15 text-violet-800 dark:text-violet-300', + 'bg-emerald-500/15 text-emerald-800 dark:text-emerald-300', + 'bg-amber-500/15 text-amber-800 dark:text-amber-300', + 'bg-rose-500/15 text-rose-800 dark:text-rose-300', + 'bg-cyan-500/15 text-cyan-800 dark:text-cyan-300', +] as const; + +const TONES: Record, string> = { + neutral: 'bg-muted text-foreground', + primary: 'bg-primary/10 text-primary', + strong: 'bg-primary text-primary-foreground', +}; + +const DEFAULT_TONE: Record = { + person: 'auto', + agent: 'primary', + automation: 'neutral', + system: 'neutral', + unassigned: 'neutral', +}; + +const KIND_ICONS: Record = { + person: User, + agent: Bot, + automation: Workflow, + system: Sparkles, + unassigned: User, +}; + +const avatarVariants = cva( + 'relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full leading-none font-semibold select-none', + { + variants: { + size: { + // Initials never drop below 10px. + xs: 'size-5 text-[10px]', + sm: 'size-6 text-[10px]', + md: 'size-7 text-[11px]', + lg: 'size-8 text-xs', + }, + }, + defaultVariants: { size: 'sm' }, + }, +); + +const ICON_SIZES: Record = { + xs: 'size-3', + sm: 'size-3.5', + md: 'size-4', + lg: 'size-4', +}; + +/** + * One or two letters for a name: the first letters of its first and last + * words, or the first letter of a single word. An email reads by its local + * part ("anna.meier@…" → "AM"). + */ +export function getInitials(name: string): string { + const words = name + .trim() + .replace(/@.*$/, '') + .split(/[\s._-]+/) + .filter((word) => word.length > 0); + const first = words[0]; + if (first === undefined) return ''; + const last = words.length > 1 ? words[words.length - 1] : undefined; + const letter = (word: string) => Array.from(word)[0] ?? ''; + return `${letter(first)}${last === undefined ? '' : letter(last)}`.toUpperCase(); +} + +/** Initial pairs too wide for a 20px circle at 10px semibold (Inter). */ +const XS_WIDE_PAIRS: ReadonlySet = new Set(['WW', 'MW', 'WM']); + +function hashTone(name: string): string { + let hash = 0; + for (const char of name) hash = (hash * 31 + char.charCodeAt(0)) | 0; + return PERSON_TONES[Math.abs(hash) % PERSON_TONES.length] ?? PERSON_TONES[0]; +} + +export interface AvatarProps extends Omit< + HTMLAttributes, + 'children' | 'role' +> { + /** What the avatar stands for. @default 'person' */ + kind?: AvatarKind; + /** A person's name: the source of the initials and of the hashed tint. */ + name?: string; + /** + * The accessible name. Given, the avatar is a named image with the label + * as its tooltip; absent, it is decorative. + */ + label?: string; + /** 20, 24, 28 or 32px. @default 'sm' */ + size?: AvatarSize; + /** Override the kind's colour. */ + tone?: AvatarTone; + /** A picture to show instead of initials; initials remain the fallback. */ + src?: string; + /** Override the kind's glyph. */ + icon?: LucideIcon; + ref?: Ref; +} + +export function Avatar({ + kind = 'person', + name, + label, + size = 'sm', + tone, + src, + icon, + title, + className, + ref, + ...props +}: AvatarProps) { + const [failedSrc, setFailedSrc] = useState(null); + const onImageError = useCallback(() => setFailedSrc(src ?? null), [src]); + const initials = + kind === 'person' && name !== undefined ? getInitials(name) : ''; + // At 20px two 10px capitals overflow the circle only for the widest pairs; + // those show their first letter. + const shownInitials = + size === 'xs' && XS_WIDE_PAIRS.has(initials) + ? initials.slice(0, 1) + : initials; + const resolvedTone = tone ?? DEFAULT_TONE[kind]; + const surface = + kind === 'unassigned' + ? 'border-border text-muted-foreground border border-dashed' + : resolvedTone === 'auto' + ? initials.length > 0 && name !== undefined + ? hashTone(name) + : TONES.neutral + : TONES[resolvedTone]; + const Icon = icon ?? KIND_ICONS[kind]; + const showImage = src !== undefined && failedSrc !== src; + + return ( + + {showImage ? ( + + ) : initials.length > 0 ? ( + + ) : ( + + ); +} diff --git a/packages/ui/src/components/data-display/data-diff/data-diff.browser.test.tsx b/packages/ui/src/components/data-display/data-diff/data-diff.browser.test.tsx new file mode 100644 index 0000000000..8f2035419f --- /dev/null +++ b/packages/ui/src/components/data-display/data-diff/data-diff.browser.test.tsx @@ -0,0 +1,159 @@ +import '@testing-library/jest-dom/vitest'; +import { cleanup } from '@testing-library/react'; +import axe from 'axe-core'; +import { useState } from 'react'; +import { afterEach, describe, expect, it } from 'vitest'; +import { page, userEvent } from 'vitest/browser'; + +import { render, screen, waitFor, within } from '@/tests/utils/render'; + +import { DataDiff, type DataDiffLayout } from './data-diff'; + +import '../../../globals.css'; + +// Real-Chromium coverage for what jsdom cannot lay out: the side-by-side +// layout only from a 48rem container, its two trees scrolling together by +// pointer, the list at a phone's width, and the change tints at AA. + +afterEach(() => { + cleanup(); + document.documentElement.classList.remove('dark'); +}); + +const BEFORE = { + title: 'Fix login', + amount: 250, + draft: 'old', + labels: 'bug', + owner: { name: 'Ada', team: 'core' }, +}; +const AFTER = { + title: 'Fix login bug', + amount: 250, + labels: ['bug', 'ui', 'docs'], + owner: { name: 'Ada', team: 'web' }, + score: 7, +}; + +function LayoutHost({ width }: { width: string }) { + const [layout, setLayout] = useState('split'); + return ( +
+ +
+ ); +} + +describe('DataDiff layouts', () => { + it('sets the two values side by side from 48rem, with their changes marked', async () => { + await page.viewport(1280, 900); + render(); + const before = await screen.findByRole('tree', { name: 'Changes: Run A' }); + const after = screen.getByRole('tree', { name: 'Changes: Run B' }); + expect(before.getBoundingClientRect().right).toBeLessThanOrEqual( + after.getBoundingClientRect().left, + ); + expect( + within(after).getByRole('treeitem', { + name: 'Changed from "Fix login": title, "Fix login bug"', + }), + ).toBeInTheDocument(); + expect( + within(after).getByRole('treeitem', { name: 'Added: score, 7' }), + ).toBeInTheDocument(); + expect( + within(before).getByRole('treeitem', { name: 'Removed: draft, "old"' }), + ).toBeInTheDocument(); + // The switch goes back to the sentences. + await userEvent.click(screen.getByRole('radio', { name: 'List' })); + expect(screen.queryByRole('tree')).toBeNull(); + expect( + screen.getByText('owner.team', { selector: 'code' }), + ).toBeInTheDocument(); + }); + + it('shows the list below 48rem, without the layout switch', async () => { + await page.viewport(375, 800); + render(); + await waitFor(() => + expect(screen.getByRole('list', { name: 'Changes' })).toBeInTheDocument(), + ); + expect(screen.queryByRole('radio', { name: 'List' })).toBeNull(); + const group = screen.getByRole('group', { name: 'Changes' }); + expect(group.scrollWidth).toBeLessThanOrEqual(group.clientWidth); + }); + + it('scrolls the two trees together, by the place they show', async () => { + await page.viewport(1280, 900); + const list = (offset: number) => + Object.fromEntries( + Array.from({ length: 120 }, (_, index) => [ + `field${String(index).padStart(3, '0')}`, + index + offset * (index % 7 === 0 ? 1 : 0), + ]), + ); + render( +
+ +
, + ); + const before = await screen.findByRole('tree', { name: 'Changes: Before' }); + const after = screen.getByRole('tree', { name: 'Changes: After' }); + // "head" only stands in Before, so the same field sits lower there. + before.scrollTop = 1000; + before.dispatchEvent(new Event('scroll')); + await waitFor(() => expect(after.scrollTop).toBeGreaterThan(0)); + const topRow = (tree: HTMLElement) => + [...tree.querySelectorAll('[data-pointer]')].find( + (row) => row.offsetTop + row.offsetHeight > tree.scrollTop, + )?.dataset.pointer; + expect(topRow(after)).toBe(topRow(before)); + }); +}); + +describe.each(['light', 'dark'])('DataDiff colours (%s)', (theme) => { + it.each(['bg-background', 'bg-card'])( + 'reads at AA on %s, as a list and side by side', + async (surface) => { + await page.viewport(1280, 900); + document.documentElement.classList.toggle('dark', theme === 'dark'); + const { container } = render( +
+ + +
, + ); + await screen.findByRole('tree', { name: 'Side by side: After' }); + await userEvent.click( + screen.getByRole('button', { name: '2 unchanged fields' }), + ); + const result = await axe.run(container, { + runOnly: [ + 'color-contrast', + 'list', + 'listitem', + 'aria-required-children', + 'button-name', + ], + }); + expect(result.violations).toEqual([]); + }, + ); +}); diff --git a/packages/ui/src/components/data-display/data-diff/data-diff.stories.tsx b/packages/ui/src/components/data-display/data-diff/data-diff.stories.tsx new file mode 100644 index 0000000000..97f9fbe01c --- /dev/null +++ b/packages/ui/src/components/data-display/data-diff/data-diff.stories.tsx @@ -0,0 +1,73 @@ +import type { Meta, StoryObj } from '@storybook/react'; + +import { DataDiff } from './data-diff'; + +const meta: Meta = { + title: 'Data Display/DataDiff', + component: DataDiff, + tags: ['autodocs'], + parameters: { + layout: 'centered', + docs: { + description: { + component: ` +What changed between two values, one sentence per change, the counts on +top and the unchanged fields folded away; side by side from a 48rem +container. \`mode="shape"\` compares the values' shapes. + +\`\`\`tsx +import { DataDiff } from '@tale/ui/data-diff'; + + +\`\`\` + `, + }, + }, + }, + decorators: [ + (Story) => ( +
+ +
+ ), + ], +}; + +export default meta; +type Story = StoryObj; + +const BEFORE = { + title: 'Fix login', + amount: 250, + draft: 'old', + labels: 'bug', +}; +const AFTER = { + title: 'Fix login bug', + amount: 250, + labels: ['bug', 'ui'], + score: 7, +}; + +export const List: Story = { + args: { before: BEFORE, after: AFTER, 'aria-label': 'Changes' }, +}; + +export const SideBySide: Story = { + args: { + before: BEFORE, + after: AFTER, + layout: 'split', + labels: { before: 'Run A', after: 'Run B' }, + 'aria-label': 'Changes', + }, +}; + +export const Shape: Story = { + args: { + before: BEFORE, + after: AFTER, + mode: 'shape', + 'aria-label': 'Changes', + }, +}; diff --git a/packages/ui/src/components/data-display/data-diff/data-diff.test.tsx b/packages/ui/src/components/data-display/data-diff/data-diff.test.tsx new file mode 100644 index 0000000000..11c04c32a1 --- /dev/null +++ b/packages/ui/src/components/data-display/data-diff/data-diff.test.tsx @@ -0,0 +1,213 @@ +import { describe, expect, it, vi } from 'vitest'; + +import { checkAccessibility } from '@/tests/utils/a11y'; +import { render, screen, within } from '@/tests/utils/render'; + +import { diffValues } from '../../../data/value-diff'; +import { DataDiff, DataDiffSummary } from './data-diff'; + +const BEFORE = { + title: 'Fix login', + amount: 250, + draft: 'old', + labels: 'bug', + owner: { name: 'Ada', team: 'core' }, +}; +const AFTER = { + title: 'Fix login bug', + amount: 250, + labels: ['bug', 'ui', 'docs'], + owner: { name: 'Ada', team: 'web' }, + score: 7, +}; + +function sentences() { + const list = screen.getByRole('list', { name: 'Changes' }); + return within(list) + .getAllByRole('listitem') + .map((item) => item.querySelector('p')?.textContent ?? item.textContent); +} + +describe('DataDiff', () => { + it('says each change as a sentence, in the order the value is written', () => { + render(); + expect(sentences()).toEqual([ + 'title changed from "Fix login" to "Fix login bug"', + 'labels changed from text to list of texts: a list of 3 items', + 'owner.team changed from "core" to "web"', + 'Added score: 7', + 'Removed draft (was "old")', + '2 unchanged fields', + ]); + expect( + screen.getByText('1 added, 1 removed, 2 changed, 1 changed type'), + ).toBeInTheDocument(); + }); + + it('folds the unchanged fields into one row that opens', async () => { + const onShowUnchangedChange = vi.fn(); + const { user } = render( + , + ); + const toggle = screen.getByRole('button', { name: '2 unchanged fields' }); + expect(toggle).toHaveAttribute('aria-expanded', 'false'); + await user.click(toggle); + expect(toggle).toHaveAttribute('aria-expanded', 'true'); + expect(onShowUnchangedChange).toHaveBeenCalledWith(true); + expect(screen.getByText('amount')).toBeInTheDocument(); + expect(screen.getByText('owner.name')).toBeInTheDocument(); + }); + + it('opens a wholly added list to its values', async () => { + const { user } = render( + , + ); + expect(sentences()[0]).toBe('Added tags: a list of 2 items'); + await user.click(screen.getByRole('button', { name: 'Show value' })); + expect(screen.getByRole('tree', { name: 'tags' })).toBeInTheDocument(); + expect(screen.getByRole('button', { name: 'Hide value' })).toHaveAttribute( + 'aria-expanded', + 'true', + ); + }); + + it('says "No changes" for equal values and a host sentence when given', () => { + const { rerender } = render( + , + ); + expect(screen.getByText('No changes')).toBeInTheDocument(); + rerender( + , + ); + expect(screen.getByText('Same as the previous pass')).toBeInTheDocument(); + }); + + it('says when two values share nothing to compare', () => { + render(); + expect( + screen.getByText( + "They don't share a structure, so there's nothing to compare field by field.", + ), + ).toBeInTheDocument(); + expect(screen.queryByRole('list')).toBeNull(); + }); + + it('names a change to the whole value in words, capitalised at the start', () => { + render(); + expect(sentences()).toEqual(['The whole value changed from 250 to 300']); + }); + + it('says a withheld place was not compared, never that it changed', () => { + render( + , + ); + expect(sentences()).toContain( + "token: not compared, part of it wasn't kept", + ); + }); + + it('compares shapes: fields that appeared, disappeared and changed kind', () => { + render( + , + ); + expect(sentences()).toEqual([ + 'items[].id: a whole number became text', + 'items[].size appeared (a whole number)', + 'items[].name disappeared', + 'total appeared (a whole number)', + 'count disappeared', + ]); + }); + + it('shows how many changes a long diff left out', () => { + const before = Object.fromEntries( + Array.from({ length: 12 }, (_, index) => [`k${index}`, index]), + ); + const after = Object.fromEntries( + Array.from({ length: 12 }, (_, index) => [`k${index}`, index + 1]), + ); + render( + , + ); + expect(screen.getByText('2 more changes')).toBeInTheDocument(); + }); + + it('uses a diff computed elsewhere', () => { + const result = diffValues({ a: 1 }, { a: 2 }); + render( + , + ); + expect(sentences()).toEqual(['a changed from 1 to 2']); + }); + + it('passes an axe audit', async () => { + const { container } = render( + , + ); + await checkAccessibility(container); + }); +}); + +describe('DataDiffSummary', () => { + it('lists only the kinds that occurred, and "No changes" without any', () => { + const { rerender } = render( + , + ); + expect( + screen.getByText('3 added, 1 changed, 1 reordered'), + ).toBeInTheDocument(); + rerender( + , + ); + expect(screen.getByText('No changes')).toBeInTheDocument(); + }); +}); diff --git a/packages/ui/src/components/data-display/data-diff/data-diff.tsx b/packages/ui/src/components/data-display/data-diff/data-diff.tsx new file mode 100644 index 0000000000..7a22f39bb2 --- /dev/null +++ b/packages/ui/src/components/data-display/data-diff/data-diff.tsx @@ -0,0 +1,643 @@ +'use client'; + +import type { TFunction } from 'i18next'; +import { + ArrowDownUp, + ArrowLeftRight, + CircleHelp, + Dot, + Equal, + Minus, + Plus, + type LucideIcon, +} from 'lucide-react'; +import { + Fragment, + useId, + useMemo, + useRef, + useState, + type ReactNode, + type UIEvent, +} from 'react'; +import { useTranslation } from 'react-i18next'; + +import { inferSchema, type SchemaTreeSchema } from '../../../data/infer-schema'; +import { pointerOf } from '../../../data/json-pointer'; +import { jsonNormalize } from '../../../data/stable-stringify'; +import { + diffShapes, + diffValues, + type DiffChange, + type DiffKind, + type DiffOptions, + type DiffResult, +} from '../../../data/value-diff'; +import { useResizeObserver } from '../../../hooks/use-resize-observer'; +import { useT } from '../../../i18n/client'; +import { cn } from '../../../lib/cn'; +import { SegmentedControl } from '../../forms/segmented-control'; +import { + SchemaTree, + schemaKindLabel, + type SchemaTreeMark, +} from '../schema-tree'; +import { isOpenable } from '../value-tree/model'; +import { formatValueInline, pathText } from '../value-tree/summarize'; +import { ValueTree, type ValueMark } from '../value-tree/value-tree'; +import { + orderChanges, + shapeKeysAt, + sharesStructure, + unchangedFields, + valueKeysAt, +} from './rows'; +import { DataDiffSummary } from './summary'; + +export { + diffShapes, + diffValues, + suggestDiffRoot, + type DiffChange, + type DiffKind, + type DiffOptions, + type DiffResult, +} from '../../../data/value-diff'; +export { + DataDiffSummary, + diffSummaryText, + type DataDiffSummaryProps, +} from './summary'; + +export type DataDiffLayout = 'list' | 'split'; + +export interface DataDiffProps { + before: unknown; + after: unknown; + /** A diff computed elsewhere (the compare page shares one); in Values + * mode it replaces the one this view would compute. */ + result?: DiffResult; + /** How the Values diff pairs list items and which places it leaves + * unjudged (`unknownAt`: pointers withheld on either side). */ + options?: DiffOptions; + /** `values` compares the values, `shape` their inferred shapes. */ + mode?: 'values' | 'shape'; + /** `list`: one sentence per change. `split`: the two values side by side + * with their changes marked, from a 48rem wide container (narrower, the + * list shows). */ + layout?: DataDiffLayout; + /** Shows a List / Side by side switch when there is room for both. */ + onLayoutChange?: (layout: DataDiffLayout) => void; + /** The two sides' names: "Before"/"After", "A"/"B", "Pass 2"/"Pass 3". */ + labels?: { before: string; after: string }; + /** Controlled disclosure of the unchanged fields. */ + showUnchanged?: boolean; + onShowUnchangedChange?: (show: boolean) => void; + 'aria-label': string; + /** Instead of "No changes". */ + emptyMessage?: ReactNode; + /** Instead of the sentence that says the two share no structure. */ + unrelatedMessage?: ReactNode; + className?: string; +} + +const SPLIT_MIN_WIDTH = 768; + +const KIND_STYLE: Readonly< + Record +> = { + added: { icon: Plus, className: 'text-success' }, + removed: { icon: Minus, className: 'text-destructive' }, + changed: { + icon: Dot, + className: 'text-info-foreground fill-current [stroke-width:5]', + }, + 'type-changed': { + icon: ArrowLeftRight, + className: 'text-amber-700 dark:text-amber-500', + }, + reordered: { icon: ArrowDownUp, className: 'text-muted-foreground' }, + unknown: { icon: CircleHelp, className: 'text-muted-foreground' }, +}; + +/** A slot the sentence keeps for a rich part: the path, set in mono. */ +const SLOT = '\u0002path\u0003'; + +function normalize(value: unknown): unknown { + try { + return jsonNormalize(value); + } catch (error) { + console.warn('A diff was given a value JSON cannot write', error); + return value; + } +} + +const IDENTIFIER = /^[A-Za-z_$][\w$]*$/; + +/** A shape path in words, list items as `[]`: `issues[].title`. */ +function shapePathText(path: readonly (string | number)[]): string { + let text = ''; + for (const segment of path) { + if (typeof segment === 'number') text += '[]'; + else if (IDENTIFIER.test(segment)) { + text += text === '' ? segment : `.${segment}`; + } else text += `[${JSON.stringify(segment)}]`; + } + return text; +} + +/** A shape's type text (`integer|null`) in words ("a whole number or + * empty"). */ +function typeWords(tSchema: TFunction, type: unknown, locale: string): string { + const types = typeof type === 'string' && type !== '' ? type.split('|') : []; + // One type reads the same as a list of one. + const schema: SchemaTreeSchema = types.length === 0 ? {} : { type: types }; + return schemaKindLabel(tSchema, schema, locale); +} + +/** Marks for the two trees of the split layout. `forward` names places in + * `after`; `reverse` (after → before) names them in `before`, where a list + * paired by key may hold an item at another position. */ +function splitMarks(forward: DiffResult, reverse: DiffResult) { + const after = new Map(); + for (const change of forward.changes) { + if (change.kind === 'added') after.set(change.pointer, { kind: 'added' }); + else if (change.kind === 'changed' || change.kind === 'type-changed') { + after.set(change.pointer, { kind: change.kind, before: change.before }); + } else if (change.kind === 'reordered') { + after.set(change.pointer, { kind: 'focus' }); + } + } + const before = new Map(); + for (const change of reverse.changes) { + if (change.kind === 'added') + before.set(change.pointer, { kind: 'removed' }); + else if (change.kind === 'changed' || change.kind === 'type-changed') { + before.set(change.pointer, { kind: change.kind }); + } else if (change.kind === 'reordered') { + before.set(change.pointer, { kind: 'focus' }); + } + } + return { before, after }; +} + +/** Shape marks keyed the way `SchemaTree` names a field: property names + * from the top, list items transparent. */ +function shapeMarks(result: DiffResult) { + const key = (path: readonly (string | number)[]) => + JSON.stringify(path.filter((segment) => typeof segment === 'string')); + const before = new Map(); + const after = new Map(); + for (const change of result.changes) { + const at = key(change.path); + if (change.kind === 'added') after.set(at, 'added'); + else if (change.kind === 'removed') before.set(at, 'removed'); + else if (change.kind === 'type-changed') { + before.set(at, 'type-changed'); + after.set(at, 'type-changed'); + } else if (change.kind === 'changed' && change.after === 'optional') { + after.set(at, 'optional'); + } + } + return { + before: (path: readonly string[]) => before.get(JSON.stringify(path)), + after: (path: readonly string[]) => after.get(JSON.stringify(path)), + }; +} + +/** `text` with its path slot set as code, the first letter raised when the + * sentence opens with the whole value's name. */ +function withPath(text: string, path: string, wholeValue: string): ReactNode[] { + const at = text.indexOf(SLOT); + if (at < 0) return [text]; + const label = + path === '' + ? at === 0 + ? wholeValue.charAt(0).toLocaleUpperCase() + wholeValue.slice(1) + : wholeValue + : null; + return [ + text.slice(0, at), + label === null ? ( + + {path} + + ) : ( + {label} + ), + text.slice(at + SLOT.length), + ]; +} + +/** + * What changed between two values, in words a person reads: one sentence + * per change in the order the value is written ("title changed from + * “Fix login” to “Fix login bug”"), the counts on top, the fields that did + * not change folded into one row. Side by side (`layout="split"`), the two + * values show as trees with every change marked, scrolling together. + * `mode="shape"` compares the values' shapes instead: fields that + * appeared, disappeared, changed kind or are no longer always there. + */ +export function DataDiff({ + before: rawBefore, + after: rawAfter, + result: given, + options, + mode = 'values', + layout = 'list', + onLayoutChange, + labels, + showUnchanged: controlledShowUnchanged, + onShowUnchangedChange, + 'aria-label': ariaLabel, + emptyMessage, + unrelatedMessage, + className, +}: DataDiffProps) { + const { t } = useT('dataDiff'); + const { t: tValues } = useT('valueTree'); + const { t: tSchema } = useT('schemaTree'); + const { i18n } = useTranslation(); + const locale = i18n?.resolvedLanguage ?? i18n?.language ?? 'en'; + const listId = useId(); + const [root, setRoot] = useState(null); + const [wide, setWide] = useState(false); + useResizeObserver(root, (entry) => { + setWide(entry.contentRect.width >= SPLIT_MIN_WIDTH); + }); + const [ownShowUnchanged, setOwnShowUnchanged] = useState(false); + const showUnchanged = controlledShowUnchanged ?? ownShowUnchanged; + const [open, setOpen] = useState>(() => new Set()); + + const before = useMemo(() => normalize(rawBefore), [rawBefore]); + const after = useMemo(() => normalize(rawAfter), [rawAfter]); + const related = useMemo( + () => sharesStructure(before, after), + [before, after], + ); + const shapes = useMemo( + () => + mode === 'shape' + ? { before: inferSchema(before), after: inferSchema(after) } + : null, + [mode, before, after], + ); + const result = useMemo(() => { + if (shapes !== null) return diffShapes(shapes.before, shapes.after); + return given ?? diffValues(before, after, options); + }, [shapes, given, before, after, options]); + const ordered = useMemo( + () => + orderChanges( + result.changes, + shapes === null + ? valueKeysAt(before, after) + : shapeKeysAt(shapes.before, shapes.after), + ), + [result, shapes, before, after], + ); + const unchanged = useMemo( + () => + mode === 'values' && !result.identical + ? unchangedFields(after, result.changes) + : { fields: [], total: 0 }, + [mode, result, after], + ); + const split = layout === 'split' && wide; + const marks = useMemo(() => { + if (!split) return null; + if (shapes !== null) return { shape: shapeMarks(result), values: null }; + return { + shape: null, + values: splitMarks(result, diffValues(after, before, options)), + }; + }, [split, shapes, result, before, after, options]); + + const sync = useRef<{ from: 'before' | 'after' | null }>({ from: null }); + const panes = useRef>({ + before: null, + after: null, + }); + + const inline = (value: unknown) => + formatValueInline(tValues, value, { locale, maxChars: 60 }); + const kindWords = (value: unknown) => + schemaKindLabel( + tSchema, + inferSchema(value, { maxDepth: 2, sampleItems: 20 }), + locale, + ); + + const sentence = (change: DiffChange): string => { + if (mode === 'shape') { + switch (change.kind) { + case 'added': + return t('shape.added', { + path: SLOT, + kind: typeWords(tSchema, change.after, locale), + }); + case 'removed': + return t('shape.removed', { path: SLOT }); + case 'type-changed': + return t('shape.typeChanged', { + path: SLOT, + beforeKind: typeWords(tSchema, change.before, locale), + afterKind: typeWords(tSchema, change.after, locale), + }); + default: + return change.after === 'optional' + ? t('shape.optional', { path: SLOT }) + : t('shape.required', { path: SLOT }); + } + } + switch (change.kind) { + case 'added': + return t('row.added', { path: SLOT, after: inline(change.after) }); + case 'removed': + return t('row.removed', { path: SLOT, before: inline(change.before) }); + case 'changed': + return t('row.changed', { + path: SLOT, + before: inline(change.before), + after: inline(change.after), + }); + case 'type-changed': + return t('row.typeChanged', { + path: SLOT, + beforeKind: kindWords(change.before), + afterKind: kindWords(change.after), + after: inline(change.after), + }); + case 'reordered': + return t('row.reordered', { path: SLOT }); + default: + return t('row.unknown', { path: SLOT }); + } + }; + + const toggleOpen = (key: string) => { + setOpen((previous) => { + const next = new Set(previous); + if (next.has(key)) next.delete(key); + else next.add(key); + return next; + }); + }; + + const setShowUnchanged = (show: boolean) => { + setOwnShowUnchanged(show); + onShowUnchangedChange?.(show); + }; + + const onPaneScroll = + (side: 'before' | 'after') => (event: UIEvent) => { + const source = event.target; + if ( + !(source instanceof HTMLElement) || + source.getAttribute('role') !== 'tree' + ) { + return; + } + if (sync.current.from !== null && sync.current.from !== side) { + // The echo of a scroll this view set: let it pass once. + sync.current.from = null; + return; + } + const other = side === 'before' ? 'after' : 'before'; + const target = + panes.current[other]?.querySelector('[role="tree"]'); + if (!target) return; + // The first row in view, and the same place in the other tree (or + // its nearest shown ancestor) at the same offset. + let anchor: HTMLElement | null = null; + for (const row of source.querySelectorAll( + '[data-pointer]', + )) { + if (row.offsetTop + row.offsetHeight > source.scrollTop) { + anchor = row; + break; + } + } + const pointer = anchor?.dataset.pointer; + if (anchor === null || pointer === undefined) return; + const rows = new Map(); + for (const row of target.querySelectorAll( + '[data-pointer]', + )) { + const at = row.dataset.pointer; + if (at !== undefined && !rows.has(at)) rows.set(at, row); + } + let match: HTMLElement | undefined; + for ( + let at: string | null = pointer; + at !== null && match === undefined; + at = at === '' ? null : at.slice(0, Math.max(0, at.lastIndexOf('/'))) + ) { + match = rows.get(at); + } + if (match === undefined) return; + sync.current.from = side; + target.scrollTop = + match.offsetTop + (source.scrollTop - anchor.offsetTop); + }; + + const header = + onLayoutChange !== undefined && wide && mode === 'values' ? ( + + onLayoutChange(next === 'split' ? 'split' : 'list') + } + options={[ + { value: 'list', label: t('layout.list') }, + { value: 'split', label: t('layout.split') }, + ]} + /> + ) : null; + + const beforeLabel = labels?.before ?? t('before'); + const afterLabel = labels?.after ?? t('after'); + const listed = ordered.length; + const counted = Object.entries(result.counts).reduce( + (sum, [kind, count]) => (kind === 'unchanged' ? sum : sum + count), + 0, + ); + + let body: ReactNode; + if (!related && mode === 'values') { + body = ( +

+ {unrelatedMessage ?? t('unrelated')} +

+ ); + } else if (result.identical) { + body = ( +

+ {emptyMessage ?? t('none')} +

+ ); + } else if (split && marks?.values) { + body = ( +
+ {(['before', 'after'] as const).map((side) => ( +
{ + panes.current[side] = element; + }} + onScrollCapture={onPaneScroll(side)} + className="flex min-w-0 flex-col gap-1" + > +

+ {side === 'before' ? beforeLabel : afterLabel} +

+ +
+ ))} +
+ ); + } else if (split && marks?.shape && shapes !== null) { + body = ( +
+ {(['before', 'after'] as const).map((side) => ( +
+

+ {side === 'before' ? beforeLabel : afterLabel} +

+ +
+ ))} +
+ ); + } else { + body = ( + <> +
    + {ordered.map((change, index) => { + const style = KIND_STYLE[change.kind]; + const Icon = style.icon; + const key = `${index}:${change.kind}:${change.pointer}`; + const subtree = + mode === 'values' && + (change.kind === 'added' || change.kind === 'removed') + ? change.kind === 'added' + ? change.after + : change.before + : undefined; + const openable = subtree !== undefined && isOpenable(subtree); + const isOpen = open.has(key); + const path = + mode === 'shape' + ? shapePathText(change.path) + : pathText(change.path); + const sentenceId = `${listId}-${index}`; + return ( +
  • +
  • + ); + })} + {unchanged.total > 0 ? ( +
  • +
  • + ) : null} +
+ {result.truncated && counted > listed ? ( +

+ {t('more', { count: counted - listed })} +

+ ) : null} + + ); + } + + return ( +
+ {related || mode === 'shape' ? ( +
+ {result.identical ? null : } + {header} +
+ ) : null} + {body} +
+ ); +} diff --git a/packages/ui/src/components/data-display/data-diff/rows.test.ts b/packages/ui/src/components/data-display/data-diff/rows.test.ts new file mode 100644 index 0000000000..8cd71151e9 --- /dev/null +++ b/packages/ui/src/components/data-display/data-diff/rows.test.ts @@ -0,0 +1,112 @@ +import { describe, expect, it } from 'vitest'; + +import { diffValues } from '../../../data/value-diff'; +import { + orderChanges, + shapeKeysAt, + sharesStructure, + unchangedFields, + valueKeysAt, +} from './rows'; + +describe('orderChanges', () => { + it('lists changes in the order the value is written, not by key name', () => { + const before = { zeta: 1, alpha: 'a', mid: [1, 2, 3], gone: true }; + const after = { zeta: 2, alpha: 'b', mid: [1, 9, 3, 4] }; + const { changes } = diffValues(before, after); + expect( + orderChanges(changes, valueKeysAt(before, after)).map( + (change) => change.pointer, + ), + ).toEqual(['/zeta', '/alpha', '/mid/1', '/mid/3', '/gone']); + }); + + it('puts a container before the changes inside it', () => { + const before = { items: [{ id: 1 }, { id: 2 }] }; + const after = { items: [{ id: 2, x: 1 }, { id: 1 }] }; + const { changes } = diffValues(before, after); + const ordered = orderChanges(changes, valueKeysAt(before, after)); + expect(ordered.map((change) => [change.kind, change.pointer])).toEqual([ + ['reordered', '/items'], + ['added', '/items/0/x'], + ]); + }); + + it("orders a shape diff by the shapes' fields, list items stepped into", () => { + const keysAt = shapeKeysAt( + { + properties: { + count: {}, + items: { items: { properties: { name: {}, id: {} } } }, + }, + }, + { + properties: { + items: { items: { properties: { id: {}, size: {} } } }, + total: {}, + }, + }, + ); + expect(keysAt([])).toEqual(['items', 'total', 'count', 'items']); + expect(keysAt(['items', 0])).toEqual(['id', 'size', 'name', 'id']); + expect(keysAt(['nothing'])).toEqual([]); + }); +}); + +describe('unchangedFields', () => { + it('folds an unchanged subtree into one entry and walks only into changes', () => { + const before = { a: 1, b: { c: 1, d: 2 }, e: { f: [1, 2] } }; + const after = { a: 1, b: { c: 1, d: 3 }, e: { f: [1, 2] } }; + const { changes } = diffValues(before, after); + const { fields, total } = unchangedFields(after, changes); + expect(fields.map((field) => field.path)).toEqual([ + ['a'], + ['b', 'c'], + ['e'], + ]); + expect(total).toBe(3); + }); + + it('lists the items of a list whose only change is their order', () => { + const before = { items: [{ id: 1 }, { id: 2 }] }; + const after = { items: [{ id: 2 }, { id: 1 }] }; + const { changes } = diffValues(before, after); + expect( + unchangedFields(after, changes).fields.map((field) => field.path), + ).toEqual([ + ['items', 0], + ['items', 1], + ]); + }); + + it('keeps at most `limit` entries and counts them all', () => { + const after = Object.fromEntries( + Array.from({ length: 20 }, (_, index) => [`k${index}`, index]), + ); + const before = { ...after, k0: -1 }; + const { changes } = diffValues(before, after); + const result = unchangedFields(after, changes, 5); + expect(result.fields).toHaveLength(5); + expect(result.total).toBe(19); + }); + + it('lists nothing for a value with no change', () => { + expect(unchangedFields({ a: 1 }, [])).toEqual({ fields: [], total: 0 }); + }); +}); + +describe('sharesStructure', () => { + it.each([ + [{ a: 1, b: 2 }, { b: 3, c: 4 }, true], + [{ a: 1 }, { b: 2 }, false], + [[1], [2, 3], true], + [{ a: 1 }, [1], false], + [{ a: 1 }, 'text', false], + ['250', 250, true], + [null, { a: 1 }, true], + [undefined, [1], true], + [{}, { a: 1 }, true], + ])('%j and %j: %s', (before, after, expected) => { + expect(sharesStructure(before, after)).toBe(expected); + }); +}); diff --git a/packages/ui/src/components/data-display/data-diff/rows.ts b/packages/ui/src/components/data-display/data-diff/rows.ts new file mode 100644 index 0000000000..0497fc36f2 --- /dev/null +++ b/packages/ui/src/components/data-display/data-diff/rows.ts @@ -0,0 +1,171 @@ +import type { SchemaTreeSchema } from '../../../data/infer-schema'; +import { isWithin, pointerOf } from '../../../data/json-pointer'; +import type { DiffChange } from '../../../data/value-diff'; +import { kindOf } from '../../../data/value-summary'; +import { childKeys, valueAt } from '../value-tree/model'; + +/** + * How a diff reads as a list: its changes in the order the value is + * written, the fields that did not change (folded into one row), and + * whether two values share enough structure to compare field by field. + */ + +function isRecord(value: unknown): value is Record { + return typeof value === 'object' && value !== null && !Array.isArray(value); +} + +/** The keys under a place, in the order a reader meets them. */ +export type KeysAt = ( + prefix: readonly (string | number)[], +) => readonly (string | number)[]; + +/** Keys of two values: `after`'s in its order, then those only `before` + * had, in `before`'s order. */ +export function valueKeysAt(before: unknown, after: unknown): KeysAt { + return (prefix) => [ + ...childKeys(valueAt(after, prefix)), + ...childKeys(valueAt(before, prefix)), + ]; +} + +/** The fields of two shapes, the same way: a number in a path steps into a + * list's items. */ +export function shapeKeysAt( + before: SchemaTreeSchema, + after: SchemaTreeSchema, +): KeysAt { + const at = ( + schema: SchemaTreeSchema, + prefix: readonly (string | number)[], + ) => { + let node: SchemaTreeSchema | undefined = schema; + for (const segment of prefix) { + if (node === undefined) return undefined; + node = + typeof segment === 'number' + ? node.items + : node.properties !== undefined && + Object.hasOwn(node.properties, segment) + ? node.properties[segment] + : undefined; + } + return node; + }; + return (prefix) => [ + ...Object.keys(at(after, prefix)?.properties ?? {}), + ...Object.keys(at(before, prefix)?.properties ?? {}), + ]; +} + +/** + * The changes in reading order: by position for list items, and for object + * keys by where `keysAt` puts them (for values, `after`'s order, then the + * keys only `before` had). A container comes before the changes inside it. + */ +export function orderChanges( + changes: readonly DiffChange[], + keysAt: KeysAt, +): DiffChange[] { + const ranks = new Map>(); + const rankOf = (prefix: readonly (string | number)[], key: string) => { + const pointer = pointerOf(prefix); + let order = ranks.get(pointer); + if (order === undefined) { + order = new Map(); + for (const each of keysAt(prefix)) { + if (!order.has(String(each))) order.set(String(each), order.size); + } + ranks.set(pointer, order); + } + return order.get(key) ?? Number.MAX_SAFE_INTEGER; + }; + const compare = (a: DiffChange, b: DiffChange): number => { + const length = Math.min(a.path.length, b.path.length); + for (let index = 0; index < length; index++) { + const left = a.path[index]; + const right = b.path[index]; + if (left === right) continue; + if (typeof left === 'number' && typeof right === 'number') { + return left - right; + } + if (typeof left === 'number') return -1; + if (typeof right === 'number') return 1; + const prefix = a.path.slice(0, index); + return rankOf(prefix, left) - rankOf(prefix, right); + } + return a.path.length - b.path.length; + }; + return changes.toSorted(compare); +} + +export interface UnchangedField { + path: readonly (string | number)[]; + value: unknown; +} + +/** + * The places in `after` no change touches, as large as they come: an + * unchanged object is one entry, not one per field. Walks only into what + * changed; at most `limit` entries, `total` counts them all. + */ +export function unchangedFields( + after: unknown, + changes: readonly DiffChange[], + limit = 500, +): { fields: UnchangedField[]; total: number } { + const pointers = changes.map((change) => change.pointer); + const fields: UnchangedField[] = []; + let total = 0; + const walk = (node: unknown, path: (string | number)[]) => { + const pointer = pointerOf(path); + const touched = pointers.some((each) => isWithin(each, pointer)); + if (!touched) { + if (path.length === 0) return; + total += 1; + if (fields.length < limit) fields.push({ path, value: node }); + return; + } + // A change on the place itself, other than a new order of its items, + // says all there is to say about it. + const own = changes.find((change) => change.pointer === pointer); + if (own !== undefined && own.kind !== 'reordered') return; + for (const key of childKeys(node)) { + walk( + Array.isArray(node) && typeof key === 'number' + ? node[key] + : isRecord(node) + ? node[String(key)] + : undefined, + [...path, key], + ); + } + }; + walk(after, []); + return { fields, total }; +} + +/** + * Whether two values can be compared field by field: two lists, two + * objects that share a key, two plain values, or a side that is empty or + * missing. An object against a list, or a container against plain text, + * shares nothing to compare. + */ +export function sharesStructure(before: unknown, after: unknown): boolean { + if ( + before === undefined || + after === undefined || + before === null || + after === null + ) { + return true; + } + const beforeKind = kindOf(before); + const afterKind = kindOf(after); + const container = (kind: string) => kind === 'object' || kind === 'array'; + if (!container(beforeKind) && !container(afterKind)) return true; + if (beforeKind !== afterKind) return false; + if (!isRecord(before) || !isRecord(after)) return true; + const keys = Object.keys(after); + if (keys.length === 0 || Object.keys(before).length === 0) return true; + return keys.some((key) => Object.hasOwn(before, key)); +} diff --git a/packages/ui/src/components/data-display/data-diff/summary.tsx b/packages/ui/src/components/data-display/data-diff/summary.tsx new file mode 100644 index 0000000000..e0d911a24a --- /dev/null +++ b/packages/ui/src/components/data-display/data-diff/summary.tsx @@ -0,0 +1,53 @@ +'use client'; + +import type { TFunction } from 'i18next'; +import { useTranslation } from 'react-i18next'; + +import type { DiffResult } from '../../../data/value-diff'; +import { useT } from '../../../i18n/client'; +import { cn } from '../../../lib/cn'; + +/** + * A diff's counts in words, the kinds that occurred only: "3 added, + * 1 removed, 2 changed"; "No changes" when there are none. + */ +export function diffSummaryText( + t: TFunction, + counts: DiffResult['counts'], + locale = 'en', +): string { + const parts = [ + counts.added > 0 ? t('count.added', { count: counts.added }) : null, + counts.removed > 0 ? t('count.removed', { count: counts.removed }) : null, + counts.changed > 0 ? t('count.changed', { count: counts.changed }) : null, + counts['type-changed'] > 0 + ? t('count.typeChanged', { count: counts['type-changed'] }) + : null, + counts.reordered > 0 + ? t('count.reordered', { count: counts.reordered }) + : null, + counts.unknown > 0 ? t('count.unknown', { count: counts.unknown }) : null, + ].filter((part): part is string => part !== null); + if (parts.length === 0) return t('none'); + return new Intl.ListFormat(locale, { type: 'unit', style: 'short' }).format( + parts, + ); +} + +export interface DataDiffSummaryProps { + counts: DiffResult['counts']; + className?: string; +} + +/** The one-line account of a diff that heads a list of changes or names a + * section: "3 added, 1 removed, 2 changed, 1 changed type". */ +export function DataDiffSummary({ counts, className }: DataDiffSummaryProps) { + const { t } = useT('dataDiff'); + const { i18n } = useTranslation(); + const locale = i18n?.resolvedLanguage ?? i18n?.language ?? 'en'; + return ( +

+ {diffSummaryText(t, counts, locale)} +

+ ); +} diff --git a/packages/ui/src/components/data-display/data-view/data-view.browser.test.tsx b/packages/ui/src/components/data-display/data-view/data-view.browser.test.tsx new file mode 100644 index 0000000000..ba99622904 --- /dev/null +++ b/packages/ui/src/components/data-display/data-view/data-view.browser.test.tsx @@ -0,0 +1,160 @@ +import '@testing-library/jest-dom/vitest'; +import { cleanup } from '@testing-library/react'; +import axe from 'axe-core'; +import { afterEach, describe, expect, it } from 'vitest'; +import { page, userEvent } from 'vitest/browser'; + +import { render, screen, waitFor, within } from '@/tests/utils/render'; + +import type { SchemaTreeSchema } from '../../../data/infer-schema'; +import { DataView } from './data-view'; + +import '../../../globals.css'; + +// Real-Chromium coverage: the Values / Shape switch from the keyboard, the +// expected-shape verdict and its marks, full screen returning focus to its +// trigger, the toolbar on one row at a narrow inspector width, and AA in +// both themes. + +afterEach(() => { + cleanup(); + document.documentElement.classList.remove('dark'); +}); + +const OUTPUT = { + summary: 'Login fails on Safari', + score: 7, + labels: [{ name: 'bug' }, { name: 'ui', color: 'red' }], + extra: true, +}; + +const EXPECTED: SchemaTreeSchema = { + type: 'object', + required: ['summary', 'score', 'priority'], + properties: { + summary: { type: 'string' }, + score: { type: 'number' }, + priority: { enum: ['low', 'high'] }, + labels: { + type: 'array', + items: { + type: 'object', + properties: { name: { type: 'string' }, color: { type: 'string' } }, + }, + }, + }, +}; + +describe('DataView', () => { + it('switches Values and Shape from the keyboard', async () => { + render(); + await userEvent.click(screen.getByRole('radio', { name: 'Values' })); + await userEvent.keyboard('{ArrowRight}'); + expect(screen.getByRole('radio', { name: 'Shape' })).toHaveAttribute( + 'aria-checked', + 'true', + ); + expect(screen.queryByRole('tree')).toBeNull(); + expect(screen.getByRole('list', { name: 'Returned' })).toBeInTheDocument(); + }); + + it('marks how the value differs from its expected shape', async () => { + render( + , + ); + expect( + screen.getByText('Differs from the expected shape in 2 fields'), + ).toBeInTheDocument(); + await userEvent.click(screen.getByRole('button', { name: 'Compare' })); + const fields = screen.getByRole('list', { name: 'Returned' }); + expect( + within(fields).getByText('priority').nextElementSibling, + ).toHaveTextContent('expected, but not there'); + expect( + within(fields).getByText('extra').nextElementSibling, + ).toHaveTextContent('not in the expected shape'); + }); + + it('opens full screen and gives focus back to its button on close', async () => { + await page.viewport(1280, 800); + render( + , + ); + const open = screen.getByRole('button', { name: 'Open full screen' }); + await userEvent.click(open); + const dialog = await screen.findByRole('dialog', { name: 'Returned' }); + expect(within(dialog).getByRole('tree')).toBeInTheDocument(); + expect( + within(dialog).queryByRole('button', { name: 'Open full screen' }), + ).toBeNull(); + await userEvent.keyboard('{Escape}'); + await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull()); + await waitFor(() => expect(open).toHaveFocus()); + }); + + it('keeps the switch and the toolbar on one row at 22rem', async () => { + await page.viewport(1280, 800); + render( +
+ +
, + ); + const values = screen.getByRole('radio', { name: 'Values' }); + const fullScreen = screen.getByRole('button', { name: 'Open full screen' }); + expect( + Math.abs( + values.getBoundingClientRect().top - + fullScreen.getBoundingClientRect().top, + ), + ).toBeLessThan(8); + }); +}); + +describe.each(['light', 'dark'])('DataView colours (%s)', (theme) => { + it.each(['bg-background', 'bg-card', 'bg-bg-elevated'])( + 'reads at AA on %s in both modes', + async (surface) => { + document.documentElement.classList.toggle('dark', theme === 'dark'); + const { container } = render( +
+ +
, + ); + const rules = { + runOnly: [ + 'color-contrast', + 'button-name', + 'aria-required-children', + 'list', + ], + }; + let result = await axe.run(container, rules); + expect(result.violations).toEqual([]); + await userEvent.click(screen.getByRole('radio', { name: 'Shape' })); + // Judge the settled view, not the swap fade on its way in. + await Promise.all( + document.getAnimations().map((animation) => animation.finished), + ); + result = await axe.run(container, rules); + expect(result.violations).toEqual([]); + }, + ); +}); diff --git a/packages/ui/src/components/data-display/data-view/data-view.stories.tsx b/packages/ui/src/components/data-display/data-view/data-view.stories.tsx new file mode 100644 index 0000000000..ee228b7e8e --- /dev/null +++ b/packages/ui/src/components/data-display/data-view/data-view.stories.tsx @@ -0,0 +1,68 @@ +import type { Meta, StoryObj } from '@storybook/react'; + +import { DataView } from './data-view'; + +const meta: Meta = { + title: 'Data Display/DataView', + component: DataView, + tags: ['autodocs'], + parameters: { + layout: 'centered', + docs: { + description: { + component: ` +One recorded value, read as **Values** (a value tree) or as its **Shape** +(the fields it has). Against an expected shape it says whether the value +matches and marks what differs. + +\`\`\`tsx +import { DataView } from '@tale/ui/data-view'; + + +\`\`\` + `, + }, + }, + }, + decorators: [ + (Story) => ( +
+ +
+ ), + ], +}; + +export default meta; +type Story = StoryObj; + +const OUTPUT = { + summary: 'Login fails on Safari', + score: 7, + labels: [{ name: 'bug' }, { name: 'ui', color: 'red' }], +}; + +export const Default: Story = { + args: { + value: OUTPUT, + 'aria-label': 'Returned', + toolbar: { fullScreen: true, download: { fileName: 'returned.json' } }, + }, +}; + +export const AgainstExpectedShape: Story = { + args: { + value: { summary: 3, labels: [] }, + 'aria-label': 'Returned', + expected: { + type: 'object', + required: ['summary', 'score'], + properties: { summary: { type: 'string' }, score: { type: 'number' } }, + }, + expectedLabel: 'From the analysis of v4', + }, +}; + +export const NothingRecorded: Story = { + args: { value: undefined, 'aria-label': 'Received' }, +}; diff --git a/packages/ui/src/components/data-display/data-view/data-view.test.tsx b/packages/ui/src/components/data-display/data-view/data-view.test.tsx new file mode 100644 index 0000000000..ce98245e5d --- /dev/null +++ b/packages/ui/src/components/data-display/data-view/data-view.test.tsx @@ -0,0 +1,184 @@ +import { describe, expect, it, vi } from 'vitest'; + +import { checkAccessibility } from '@/tests/utils/a11y'; +import { render, screen, within } from '@/tests/utils/render'; + +import type { SchemaTreeSchema } from '../../../data/infer-schema'; +import { DataView, ShapeView } from './data-view'; + +const OUTPUT = { + summary: 'Login fails on Safari', + score: 7, + labels: [{ name: 'bug' }, { name: 'ui', color: 'red' }], +}; + +const EXPECTED: SchemaTreeSchema = { + type: 'object', + required: ['summary', 'score'], + properties: { + summary: { type: 'string' }, + score: { type: 'number' }, + labels: { + type: 'array', + items: { + type: 'object', + properties: { name: { type: 'string' }, color: { type: 'string' } }, + }, + }, + }, +}; + +describe('DataView', () => { + it('shows the values, then the shape, from one switch', async () => { + const { user } = render(); + expect(screen.getByRole('group', { name: 'Returned' })).toBeInTheDocument(); + expect(screen.getByRole('tree', { name: 'Returned' })).toBeInTheDocument(); + await user.click(screen.getByRole('radio', { name: 'Shape' })); + expect(screen.queryByRole('tree')).toBeNull(); + const fields = screen.getByRole('list', { name: 'Returned' }); + expect(within(fields).getByText('labels')).toBeInTheDocument(); + expect(within(fields).getByText('color')).toBeInTheDocument(); + expect( + within(fields).getByText(/optional · in 1 of 2 items/), + ).toBeInTheDocument(); + }); + + it('follows a host that controls the mode', async () => { + const onModeChange = vi.fn(); + const { user } = render( + , + ); + expect(screen.queryByRole('tree')).toBeNull(); + await user.click(screen.getByRole('radio', { name: 'Values' })); + expect(onModeChange).toHaveBeenCalledWith('values'); + }); + + it('says "Nothing recorded" without a value, or the host’s words', () => { + const { rerender } = render( + , + ); + expect(screen.getByText('Nothing recorded')).toBeInTheDocument(); + rerender( + , + ); + expect( + screen.getByText('Its input appears when it finishes'), + ).toBeInTheDocument(); + }); + + it('says whether the value matches the expected shape', async () => { + const { user, rerender } = render( + , + ); + expect(screen.getByText('Matches the expected shape')).toBeInTheDocument(); + expect(screen.getByText(/From the analysis of v4/)).toBeInTheDocument(); + rerender( + , + ); + expect( + screen.getByText('Differs from the expected shape in 3 fields'), + ).toBeInTheDocument(); + await user.click(screen.getByRole('button', { name: 'Compare' })); + const fields = screen.getByRole('list', { name: 'Returned' }); + expect( + within(fields).getByText(/not the expected kind/), + ).toBeInTheDocument(); + expect( + within(fields).getByText(/not in the expected shape/), + ).toBeInTheDocument(); + expect( + within(fields).getByText(/expected, but not there/), + ).toBeInTheDocument(); + }); + + it('copies the value as JSON and says so', async () => { + const { user } = render(); + const writeText = vi.spyOn(navigator.clipboard, 'writeText'); + await user.click(screen.getByRole('button', { name: 'Copy JSON' })); + expect(writeText).toHaveBeenCalledWith(JSON.stringify(OUTPUT, null, 2)); + const statuses = within( + screen.getByRole('group', { name: 'Returned' }), + ).getAllByRole('status'); + expect(statuses.map((status) => status.textContent)).toContain('Copied'); + }); + + it('hides the switch and toolbar when the host asks', () => { + render( + , + ); + expect(screen.queryByRole('radio')).toBeNull(); + expect(screen.queryByRole('button', { name: 'Copy JSON' })).toBeNull(); + }); + + it('shows what was cut and its recorded size', () => { + render( + , + ); + expect(screen.getByText('+40 characters not kept')).toBeInTheDocument(); + expect(screen.getByText('2 KB recorded')).toBeInTheDocument(); + }); + + it('opens the same view full screen', async () => { + const { user } = render( + , + ); + await user.click(screen.getByRole('button', { name: 'Open full screen' })); + const dialog = await screen.findByRole('dialog', { + name: 'Score returned', + }); + expect(within(dialog).getByRole('tree')).toBeInTheDocument(); + expect( + within(dialog).getByRole('button', { name: 'Close full screen' }), + ).toBeInTheDocument(); + }); + + it('passes an axe audit', async () => { + const { container } = render( + , + ); + await checkAccessibility(container); + }); +}); + +describe('ShapeView', () => { + it('lists the fields of the value, how often items hold them', () => { + render(); + const fields = screen.getByRole('list', { name: 'Shape' }); + expect(within(fields).getByText('summary')).toBeInTheDocument(); + expect(within(fields).getByText(/in 1 of 2 items/)).toBeInTheDocument(); + }); +}); diff --git a/packages/ui/src/components/data-display/data-view/data-view.tsx b/packages/ui/src/components/data-display/data-view/data-view.tsx new file mode 100644 index 0000000000..6d8379daf7 --- /dev/null +++ b/packages/ui/src/components/data-display/data-view/data-view.tsx @@ -0,0 +1,353 @@ +'use client'; + +import { Check, CircleCheck, Copy, Download, Maximize2 } from 'lucide-react'; +import { + useCallback, + useEffect, + useMemo, + useRef, + useState, + type ReactNode, +} from 'react'; +import { useTranslation } from 'react-i18next'; + +import { inferSchema, type SchemaTreeSchema } from '../../../data/infer-schema'; +import { useSwapFade } from '../../../hooks/use-swap-fade'; +import { useT } from '../../../i18n/client'; +import { cn } from '../../../lib/cn'; +import { formatBytes } from '../../../lib/format'; +import { IssueSeverityIcon } from '../../feedback/issue-severity'; +import { SegmentedControl } from '../../forms/segmented-control'; +import { + ResponsiveDialog, + ResponsiveDialogContent, + ResponsiveDialogTitle, +} from '../../overlays/responsive-dialog'; +import { Button } from '../../primitives/button'; +import { + ValueTree, + type ValueElision, + type ValueMarks, +} from '../value-tree/value-tree'; +import { compareShape } from './shape-compare'; +import { ShapeView } from './shape-view'; + +export { ShapeView, type ShapeViewProps } from './shape-view'; +export { + compareShape, + shapePathKey, + type ShapeComparison, + type ShapeMark, +} from './shape-compare'; + +export type DataViewMode = 'values' | 'shape'; + +export interface DataViewProps { + /** `undefined` shows `empty`: nothing was recorded. */ + value: unknown; + /** What the recorder left out (`RecordedValue`), and the value's size. */ + recorded?: { + elided?: readonly ValueElision[]; + redacted?: readonly string[]; + bytes?: number; + }; + 'aria-label': string; + /** Controlled mode, when several views share one switch. */ + mode?: DataViewMode; + onModeChange?: (mode: DataViewMode) => void; + /** The Values / Shape switch: shown. */ + showModeSwitch?: boolean; + /** The shape the value should have: a verdict line in Values, marks in + * Shape. */ + expected?: SchemaTreeSchema | null; + /** Where the expected shape comes from: "From the analysis of v4". */ + expectedLabel?: string; + /** Copy JSON (on), Download JSON (off) and Open full screen (off). */ + toolbar?: { + copy?: boolean; + download?: { fileName: string } | false; + fullScreen?: boolean | { title: string }; + }; + /** Instead of "Nothing recorded". */ + empty?: ReactNode; + marks?: ValueMarks; + density?: 'compact' | 'comfortable'; + className?: string; +} + +/** The value as the JSON a reader copies or downloads: what was recorded, + * hidden secrets still hidden. */ +function jsonOf(value: unknown): string { + try { + return JSON.stringify(value, null, 2) ?? ''; + } catch (error) { + console.warn('A data view could not write its value as JSON', error); + return ''; + } +} + +function downloadJson(fileName: string, json: string): void { + const url = URL.createObjectURL( + new Blob([json], { type: 'application/json' }), + ); + const anchor = document.createElement('a'); + anchor.href = url; + anchor.download = fileName; + anchor.rel = 'noopener'; + document.body.append(anchor); + anchor.click(); + anchor.remove(); + window.setTimeout(() => URL.revokeObjectURL(url), 0); +} + +/** + * One recorded value, read two ways: **Values**, a `ValueTree` of the value + * with what the recorder left out shown as chips, and **Shape**, the fields + * it has (`ShapeView`). Against an `expected` shape it says whether the + * value matches, and Shape marks what differs. A toolbar copies the value as + * JSON, downloads it, and opens it full screen. + */ +export function DataView(props: DataViewProps) { + const { + mode: controlledMode, + onModeChange, + toolbar, + 'aria-label': ariaLabel, + } = props; + const { t } = useT('dataView'); + const [ownMode, setOwnMode] = useState('values'); + const mode = controlledMode ?? ownMode; + const setMode = useCallback( + (next: DataViewMode) => { + setOwnMode(next); + onModeChange?.(next); + }, + [onModeChange], + ); + const [fullScreen, setFullScreen] = useState(false); + const fullScreenTitle = + typeof toolbar?.fullScreen === 'object' + ? toolbar.fullScreen.title + : ariaLabel; + return ( + <> + setFullScreen(true) : undefined + } + /> + {toolbar?.fullScreen ? ( + + + + {fullScreenTitle} + + + + + ) : null} + + ); +} + +function DataViewBody({ + value, + recorded, + 'aria-label': ariaLabel, + mode, + onModeChange, + showModeSwitch = true, + expected, + expectedLabel, + toolbar, + empty, + marks, + density = 'comfortable', + className, + onOpenFullScreen, +}: DataViewProps & { + mode: DataViewMode; + onModeChange: (mode: DataViewMode) => void; + onOpenFullScreen?: () => void; +}) { + const { t } = useT('dataView'); + const { t: tCommon } = useT('common'); + const { i18n } = useTranslation(); + const locale = i18n?.resolvedLanguage ?? i18n?.language ?? 'en'; + const swapRef = useSwapFade(mode); + const [copied, setCopied] = useState(false); + const [announcement, setAnnouncement] = useState({ text: '', count: 0 }); + const copyTimer = useRef(0); + useEffect(() => () => window.clearTimeout(copyTimer.current), []); + + const verdict = useMemo(() => { + if (expected === undefined || expected === null || value === undefined) { + return null; + } + return compareShape(expected, inferSchema(value)).differing; + }, [expected, value]); + + if (value === undefined) { + return ( +

+ {empty ?? t('empty')} +

+ ); + } + + const copy = async () => { + try { + await navigator.clipboard.writeText(jsonOf(value)); + setCopied(true); + setAnnouncement((previous) => ({ + text: tCommon('actions.copied'), + count: previous.count + 1, + })); + window.clearTimeout(copyTimer.current); + copyTimer.current = window.setTimeout(() => setCopied(false), 2000); + } catch (error) { + console.warn('A data view could not copy to the clipboard', error); + } + }; + + const showCopy = toolbar?.copy ?? true; + const download = toolbar?.download; + const hasToolbar = + showCopy || + (download !== undefined && download !== false) || + onOpenFullScreen !== undefined; + + return ( +
+ {showModeSwitch || hasToolbar ? ( +
+ {showModeSwitch ? ( + + onModeChange(next === 'shape' ? 'shape' : 'values') + } + options={[ + { value: 'values', label: t('values') }, + { value: 'shape', label: t('shape') }, + ]} + /> + ) : null} + {hasToolbar ? ( +
+ {showCopy ? ( + + ) : null} + {download !== undefined && download !== false ? ( + + ) : null} + {onOpenFullScreen !== undefined ? ( + + ) : null} +
+ ) : null} +
+ ) : null} + {verdict !== null ? ( +

+ {verdict === 0 ? ( + <> +

+ ) : null} +
+ {mode === 'values' ? ( + + ) : ( + + )} +
+ {recorded?.bytes !== undefined ? ( +

+ {t('size', { size: formatBytes(recorded.bytes, locale) })} +

+ ) : null} +

+ {announcement.text} +

+
+ ); +} diff --git a/packages/ui/src/components/data-display/data-view/shape-compare.test.ts b/packages/ui/src/components/data-display/data-view/shape-compare.test.ts new file mode 100644 index 0000000000..6029024867 --- /dev/null +++ b/packages/ui/src/components/data-display/data-view/shape-compare.test.ts @@ -0,0 +1,113 @@ +import { describe, expect, it } from 'vitest'; + +import { inferSchema, type SchemaTreeSchema } from '../../../data/infer-schema'; +import { compareShape, shapePathKey } from './shape-compare'; + +const EXPECTED: SchemaTreeSchema = { + type: 'object', + required: ['summary', 'score', 'labels'], + properties: { + summary: { type: 'string' }, + score: { type: 'number' }, + labels: { + type: 'array', + items: { + type: 'object', + required: ['name'], + properties: { name: { type: 'string' }, color: { type: 'string' } }, + }, + }, + note: { type: 'string' }, + }, +}; + +function marks(expected: SchemaTreeSchema, value: unknown) { + const comparison = compareShape(expected, inferSchema(value)); + return Object.fromEntries( + [...comparison.marks].map(([key, mark]) => [ + (JSON.parse(key) as string[]).join('.'), + mark, + ]), + ); +} + +describe('compareShape', () => { + it('reads a value that fits as matching, whole numbers as numbers', () => { + const comparison = compareShape( + EXPECTED, + inferSchema({ + summary: 'ok', + score: 7, + labels: [{ name: 'bug' }, { name: 'ui', color: 'red' }], + }), + ); + expect(comparison.differing).toBe(0); + expect(comparison.marks.size).toBe(0); + }); + + it('marks extra fields, missing required ones and the wrong kinds', () => { + expect( + marks(EXPECTED, { + summary: 42, + labels: [{ name: 'bug', size: 3 }], + extra: true, + }), + ).toEqual({ + summary: 'type-changed', + 'labels.size': 'added', + extra: 'added', + score: 'removed', + }); + }); + + it('lists a missing required field in the shape it draws, as required', () => { + const comparison = compareShape(EXPECTED, inferSchema({ summary: 'ok' })); + expect(Object.keys(comparison.schema.properties ?? {})).toEqual([ + 'summary', + 'score', + 'labels', + ]); + expect(comparison.schema.required).toEqual(['summary', 'score', 'labels']); + expect(comparison.differing).toBe(2); + }); + + it('marks a required field only some items hold as not always there', () => { + expect( + marks(EXPECTED, { + summary: 'ok', + score: 1, + labels: [{ name: 'bug' }, { color: 'red' }], + }), + ).toEqual({ 'labels.name': 'optional' }); + }); + + it('leaves what the expected shape does not declare unjudged', () => { + expect( + compareShape({}, inferSchema({ anything: [1, 'a'] })).differing, + ).toBe(0); + expect( + compareShape({ type: 'object' }, inferSchema({ a: 1 })).differing, + ).toBe(0); + }); + + it('counts a value of another kind at the top as one difference', () => { + const comparison = compareShape(EXPECTED, inferSchema(['a'])); + expect(comparison.differing).toBe(1); + expect(comparison.marks.get(shapePathKey([]))).toBe('type-changed'); + }); + + it('accepts values an enum or a union allows', () => { + expect( + compareShape({ enum: ['draft', 'sent'] }, inferSchema('draft')).differing, + ).toBe(0); + expect( + compareShape( + { anyOf: [{ type: 'string' }, { type: 'null' }] }, + inferSchema(null), + ).differing, + ).toBe(0); + expect(compareShape({ enum: [1, 2] }, inferSchema('one')).differing).toBe( + 1, + ); + }); +}); diff --git a/packages/ui/src/components/data-display/data-view/shape-compare.ts b/packages/ui/src/components/data-display/data-view/shape-compare.ts new file mode 100644 index 0000000000..175de95e52 --- /dev/null +++ b/packages/ui/src/components/data-display/data-view/shape-compare.ts @@ -0,0 +1,169 @@ +import type { SchemaTreeSchema } from '../../../data/infer-schema'; + +/** + * A value's shape held against the shape it should have — a step's output + * against the type the analysis expects, a run's input against its inputs + * schema: which fields the expected shape does not name, which required + * ones are not there, which hold another kind of value, which are not + * always there. Fields the expected shape leaves undeclared are not judged: + * a shape of "anything" never reads as a difference. + */ + +export type ShapeMark = 'added' | 'removed' | 'type-changed' | 'optional'; + +export interface ShapeComparison { + /** The shape to draw: the actual one, with the required fields it lacks + * added from the expected shape (marked `removed`). */ + schema: SchemaTreeSchema; + /** Marks by field path (property names from the top; a list's items are + * transparent, as `SchemaTree` lists them), keyed by `shapePathKey`. */ + marks: ReadonlyMap; + /** How many fields differ from the expected shape. */ + differing: number; +} + +/** The key of a field path in `ShapeComparison.marks`. */ +export function shapePathKey(path: readonly string[]): string { + return JSON.stringify(path); +} + +function typesOf(schema: SchemaTreeSchema): string[] { + if (schema.type === undefined) { + if (schema.properties !== undefined) return ['object']; + if (schema.items !== undefined) return ['array']; + return []; + } + return typeof schema.type === 'string' ? [schema.type] : [...schema.type]; +} + +function enumType(value: unknown): string { + if (value === null) return 'null'; + if (Array.isArray(value)) return 'array'; + if (typeof value === 'number') { + return Number.isInteger(value) ? 'integer' : 'number'; + } + return typeof value; +} + +/** Whether a value of JSON type `type` fits `expected`. */ +function accepts(expected: SchemaTreeSchema, type: string): boolean { + if (expected.anyOf !== undefined && expected.anyOf.length > 0) { + return expected.anyOf.some((option) => accepts(option, type)); + } + if (expected.enum !== undefined && expected.enum.length > 0) { + return expected.enum.some((value) => { + const kind = enumType(value); + return kind === type || (kind === 'integer' && type === 'number'); + }); + } + const types = typesOf(expected); + if (types.length === 0) return true; + return ( + types.includes(type) || (type === 'integer' && types.includes('number')) + ); +} + +/** Whether every kind `actual` was seen holding fits `expected`. */ +function fits(expected: SchemaTreeSchema, actual: SchemaTreeSchema): boolean { + return typesOf(actual).every((type) => accepts(expected, type)); +} + +/** The fields under a shape: its own, or those of its items. */ +function fieldsOf(schema: SchemaTreeSchema): { + properties: Readonly>; + required: readonly string[]; + inItems: boolean; +} | null { + if (schema.properties !== undefined) { + return { + properties: schema.properties, + required: schema.required ?? [], + inItems: false, + }; + } + if (schema.items?.properties !== undefined) { + return { + properties: schema.items.properties, + required: schema.items.required ?? [], + inItems: true, + }; + } + return null; +} + +/** Set `key` on `target` as its own field, `__proto__` included. */ +function setOwn( + target: Record, + key: string, + value: SchemaTreeSchema, +): void { + Object.defineProperty(target, key, { + value, + enumerable: true, + writable: true, + configurable: true, + }); +} + +export function compareShape( + expected: SchemaTreeSchema, + actual: SchemaTreeSchema, +): ShapeComparison { + const marks = new Map(); + const mark = (path: readonly string[], kind: ShapeMark) => { + marks.set(shapePathKey(path), kind); + }; + + const walk = ( + want: SchemaTreeSchema, + have: SchemaTreeSchema, + path: readonly string[], + ): SchemaTreeSchema => { + if (!fits(want, have)) { + mark(path, 'type-changed'); + return have; + } + const wanted = fieldsOf(want); + const held = fieldsOf(have); + if ( + wanted === null || + held === null || + Object.keys(wanted.properties).length === 0 + ) { + return have; + } + const properties: Record = {}; + const required = [...held.required]; + for (const [name, field] of Object.entries(held.properties)) { + const fieldPath = [...path, name]; + const wantedField = Object.hasOwn(wanted.properties, name) + ? wanted.properties[name] + : undefined; + if (wantedField === undefined) { + mark(fieldPath, 'added'); + setOwn(properties, name, field); + continue; + } + if (wanted.required.includes(name) && field['x-count'] !== undefined) { + mark(fieldPath, 'optional'); + } + setOwn(properties, name, walk(wantedField, field, fieldPath)); + } + for (const [name, wantedField] of Object.entries(wanted.properties)) { + if ( + Object.hasOwn(held.properties, name) || + !wanted.required.includes(name) + ) { + continue; + } + mark([...path, name], 'removed'); + setOwn(properties, name, wantedField); + required.push(name); + } + if (!held.inItems) return { ...have, properties, required }; + return { ...have, items: { ...have.items, properties, required } }; + }; + + const schema = walk(expected, actual, []); + return { schema, marks, differing: marks.size }; +} diff --git a/packages/ui/src/components/data-display/data-view/shape-view.tsx b/packages/ui/src/components/data-display/data-view/shape-view.tsx new file mode 100644 index 0000000000..bc039fec17 --- /dev/null +++ b/packages/ui/src/components/data-display/data-view/shape-view.tsx @@ -0,0 +1,65 @@ +'use client'; + +import { useMemo } from 'react'; + +import { inferSchema, type SchemaTreeSchema } from '../../../data/infer-schema'; +import { SchemaTree } from '../schema-tree'; +import { compareShape, shapePathKey } from './shape-compare'; + +/** How a value's shape is read for the view: lists by their first hundred + * items, eight levels deep, two hundred fields per object. */ +const SHAPE_LIMITS = { + sampleItems: 100, + maxDepth: 8, + maxProperties: 200, + maxNodes: 2000, +} as const; + +export interface ShapeViewProps { + value: unknown; + /** The shape the value should have: fields that differ are marked, in + * words and with a glyph, and required fields it lacks are listed. */ + expected?: SchemaTreeSchema | null; + /** "in 9 of 12 items" for a field only some items hold: on. */ + counts?: boolean; + 'aria-label': string; + density?: 'compact' | 'comfortable'; + className?: string; +} + +/** + * The fields a value has, read from the value itself — a `SchemaTree` of + * its inferred shape: each field's kind in words, how often the items of a + * list hold it, and, against an `expected` shape, what differs. + */ +export function ShapeView({ + value, + expected, + counts = true, + 'aria-label': ariaLabel, + density = 'comfortable', + className, +}: ShapeViewProps) { + const actual = useMemo(() => inferSchema(value, SHAPE_LIMITS), [value]); + const comparison = useMemo( + () => + expected === undefined || expected === null + ? null + : compareShape(expected, actual), + [expected, actual], + ); + return ( + comparison.marks.get(shapePathKey(path)) + } + aria-label={ariaLabel} + className={className} + /> + ); +} diff --git a/packages/ui/src/components/data-display/duration.browser.test.tsx b/packages/ui/src/components/data-display/duration.browser.test.tsx new file mode 100644 index 0000000000..0c0153bbf9 --- /dev/null +++ b/packages/ui/src/components/data-display/duration.browser.test.tsx @@ -0,0 +1,78 @@ +import '@testing-library/jest-dom/vitest'; +import { cleanup } from '@testing-library/react'; +import { afterEach, describe, expect, it, vi } from 'vitest'; + +import { render, screen } from '@/tests/utils/render'; + +import { Duration, formatDuration } from './duration'; + +import '../../globals.css'; + +// Real-Chromium coverage: live durations tick on one shared timer, and the +// words match what the browser's own Intl.DurationFormat says. + +afterEach(() => { + cleanup(); + vi.restoreAllMocks(); +}); + +describe('Duration', () => { + it('ticks every live duration once a second on one timer', async () => { + const setInterval = vi.spyOn(window, 'setInterval'); + const since = Date.now() - 4000; + render( + <> + + + + , + ); + const times = [...document.querySelectorAll('time')]; + expect(times).toHaveLength(3); + expect( + setInterval.mock.calls.filter(([, delay]) => delay === 1000), + ).toHaveLength(1); + const before = times[0].textContent; + await new Promise((resolve) => setTimeout(resolve, 1100)); + expect(times[0].textContent).not.toBe(before); + expect(times[0]).toHaveAttribute('aria-live', 'off'); + expect(times[0].getAttribute('dateTime')).toMatch(/^PT\d+(\.\d+)?S$/); + }); + + it('writes a finished span once, without a timer', () => { + const setInterval = vi.spyOn(window, 'setInterval'); + render(); + expect(screen.getByText('3m 12s')).toBeInTheDocument(); + expect(setInterval).not.toHaveBeenCalled(); + }); +}); + +describe('formatDuration in a browser with Intl.DurationFormat', () => { + it('says what Intl.DurationFormat says, in every style and language', () => { + const DurationFormat = ( + Intl as unknown as { + DurationFormat?: new ( + locale: string, + options: { style: string }, + ) => { format: (duration: Record) => string }; + } + ).DurationFormat; + if (DurationFormat === undefined) return; + const cases: Array<[number, Record]> = [ + [320, { milliseconds: 320 }], + [42_000, { seconds: 42 }], + [192_000, { minutes: 3, seconds: 12 }], + [7_500_000, { hours: 2, minutes: 5 }], + [97_200_000, { days: 1, hours: 3 }], + ]; + for (const locale of ['en', 'de', 'fr', 'de-CH']) { + for (const style of ['narrow', 'short', 'long'] as const) { + for (const [ms, duration] of cases) { + expect(formatDuration(ms, locale, { style })).toBe( + new DurationFormat(locale, { style }).format(duration), + ); + } + } + } + }); +}); diff --git a/packages/ui/src/components/data-display/duration.stories.tsx b/packages/ui/src/components/data-display/duration.stories.tsx new file mode 100644 index 0000000000..4b785e11a4 --- /dev/null +++ b/packages/ui/src/components/data-display/duration.stories.tsx @@ -0,0 +1,39 @@ +import type { Meta, StoryObj } from '@storybook/react'; + +import { Duration } from './duration'; + +const meta: Meta = { + title: 'Data Display/Duration', + component: Duration, + tags: ['autodocs'], + parameters: { + layout: 'centered', + docs: { + description: { + component: ` +A duration in the reader's language, as a \`