Skip to content

Glirastes 0.24.0

Choose a tag to compare

@Piwo96 Piwo96 released this 25 Nov 09:06
· 43 commits to main since this release
4703901

Added

  • AssistantShell / AssistantWorkspace slots, all opt-in (an app that sets none of them gets the same DOM, behaviour and styles): showModeMenu={false} drops the layout menu and its key handling while 'fullscreen' stays a mode; renderModeMenu({ modes, current, setMode, label, title, entries }) draws an own layout control in its place. historyPane also takes a function, rendered as a component of its own (hooks inside belong to it; pass a stable function and switch panes inside it, it is not remounted when its identity changes), that gets { open, drawer, close } (AssistantHistoryPaneProps), so an own column can close the drawer below 900 px (close() moves focus to the first editor or textarea outside the column, else to an element marked data-glirastes-composer or a text input inside it, else to the chats toggle; close('toggle') to the chats toggle; a stale close() does nothing). historyTitle (node, function or false) replaces [data-element="history-title"]; classNames.history styles the column. icons.newChat, icons.rename, icons.delete reach the shell's own session switchers. New types AssistantModeMenuRenderProps, AssistantModeMenuEntry.
  • SessionSwitcher takes icons (SessionSwitcherIcons: newChat, rename, delete; DEFAULT_SESSION_SWITCHER_ICONS); the default "+" stays the text character, newChat: false drops it, other empty values keep it. useSessionLock() returns { visible, sessionChangeBlocked, locked } (SessionLockState), the rule the built-in switcher follows, for an app's own session controls (instead of isSessionChangeBlocked ?? isLoading); when the lock applies is unchanged.
  • CLI: glirastes stt worklet [--out <dir>] [--root <path>] [--json] copies the audio worklet voice input needs into public/ (or --out), served at /audio-worklet-processor.js; an identical copy is left alone, the source map comment is dropped. The file is also a package export, glirastes/react/audio-worklet-processor.js.
  • glirastes init chains glirastes stt worklet && in front of predev and prebuild for Next.js, Vite and Create React App apps (new or existing scripts; existing commands stay) and lists /public/audio-worklet-processor.js in an existing .gitignore (it creates none). A React app without one of them gets a note on how to serve the file.
  • glirastes doctor: new check voice-worklet for apps that use voice input (voice: { enabled: true }, VoiceInputAddon, VoiceInputButton, RecordedSttAdapter, DeepgramSttAdapter, useDeepgramTranscription). It passes only when the file exists under public/ at each literal workletUrl path, or at /audio-worklet-processor.js when none is set. Without the file or a copy script it fails (E-SETUP-034, provide-audio-worklet) and names the fix; a package.json script that copies it but has not run yet is a warning (run-audio-worklet-copy), as are a copy into another --out folder and an absolute worklet URL (verify-audio-worklet-url). Apps without voice input get no check. Known limit: voice use is detected from the glirastes voice symbols and a literal voice: { enabled: true } only.
  • STT: AudioWorkletLoadError (url, cause), isAudioWorkletLoadError and AUDIO_WORKLET_UNAVAILABLE in glirastes/react and glirastes/stt; SttSessionSnapshot.errorCode ('audio-worklet-unavailable'), also on useStt and useDeepgramTranscription. VoiceInputButtonProps.adapter.
  • Locale keys voiceStartAriaLabel, voiceStopAriaLabel, voiceConnectingAriaLabel, voiceTranscribingAriaLabel, voiceCancelAriaLabel, voiceFailedText, voiceUnavailableText (German ships).
  • Chat handler: the stop notice after a limit now says what was done (activity labels of the turn's successful app tool calls, never arguments or results) and what is open (the open update_plan items, else that the question is not answered yet), with the new budgetStopTexts keys done, open, openUnanswered, continueHint, continueTypedHint (English and German ship). The stream writes a data-budget-stop part ({ v: 1, continuable }) before the notice.
  • Chat: a "Continue" button (<button data-action="continue-after-stop">, locale key continueButton, German now "Weitermachen") under the latest answer that ended at a continuable stop. It resends the history with glirastesContinuation: 'budget'; the handler continues the same turn with a fresh budget, tells the model which tool calls already ran, and answers a repeated call of a non-read-only tool attempted before the stop (same tool and normalized arguments, successful or failed) with a tool error instead of running it or asking for approval (fail closed). The guard also covers the approval and UI outcome requests after the continuation; in a managed turn a refusal counts as a tool error. Each continuation gets a fresh per-request budget (up to 4x per question; no policy switch yet); a typed follow-up is a new turn without the guard. At most 3 continuations per turn; an invalid one gets 400. ChatTransport.continueAfterBudgetStop, ChatContextValue.continueAfterBudgetStop, MessagePartNodes.continuation; onFinish reports continuation: 'budget', metrics a normal turn.finished.
  • preloadMarkdown() in glirastes/react starts loading the default Markdown renderer (react-markdown). Every call returns the same promise; it never rejects (without react-markdown the chat shows plain text, as before) and is safe on the server; once it has resolved (also through the provider's preload), even the first render in a page that shows a message, including its hydration, shows Markdown right away (before, the module-wide renderer was loaded by that first render, which showed the raw text once; later renders already showed Markdown). AiChatProvider now calls it when it mounts, unless components.Markdown or components.MessageBubble is set (an own bubble built on useMessageParts still renders the default Markdown: call preloadMarkdown() yourself) or markdown={{ preload: false }} (new ChatMarkdownOptions.preload, default true): react-markdown is downloaded right at mount, also while a floating chat is still closed and in apps that use the provider headless (before, when the first message rendered). Without react-markdown installed, its console.warn now appears at provider mount. Locale key markdownLoadingLabel (optional; English "Loading message…", German ships).

Changed

  • Server approval subjects cover arguments that hold a list of ids (memberIds: ['u1', 'u2']): each distinct id is its own looked-up subject with the semantics of a single id (named when found, the call refused with approval_subject_not_found when one does not exist, not checkable with its reason on a timeout or error). All of them keep the argument's path, so the card shows one line "User: Ann, Bob" and the browser no longer warns about the same ids from its history. A list is declared like a single id ({ type: 'user', args: 'memberIds', role: 'reference' }, named in approvalSubject.refs for a reference). Each id counts against maxSubjectsPerCall (more are limit) and maxLookupsPerTurn; cache, recheck, PII shield rehydration and the v2 subject digest index the list in input order, duplicates dropped. An empty list names no record. A list with an entry that is no id, more than 100 ids, or a list inside a composite key gets no server subject and is never a passed check (block and recheck refuse). MAX_PART_SUBJECTS is 100 (was 20). Without a server part the browser types each id of a declared list too. glirastes tools refresh reports a composite key with a list argument as approval-subject-invalid.
  • Voice button (VoiceInputAddon, VoiceInputButton) and retry button show icons (inline SVG) with localized aria-label and title per state (idle, connecting, recording, transcribing, failed) instead of the words mic, stop and retry; the recording bar's cancel and stop buttons use the chat locale instead of fixed German labels. Tests that found the button by its text use the aria-label or [data-component="voice-input-addon"].
  • voice.workletUrl now reaches an own adapter passed as voice.adapter (SttProviderAdapter.acceptsWorkletUrl, connect({ workletUrl })): RecordedSttAdapter and DeepgramSttAdapter use it when their constructor sets none (the constructor option wins). For an adapter that does not declare acceptsWorkletUrl the chat warns once in the console that the URL is ignored and how to pass it to the constructor. useStt takes workletUrl.
  • The fixed system note sent while the browser reports UI action outcomes (UI_OUTCOME_SYSTEM_NOTE, glirastes/contracts) gains one sentence: Do not announce a UI action in text before you call it; say what happened once its outcome is reported. Before, a model often wrote an interim sentence such as "Ich hebe den Auftrag hervor." before the UI tool call, and when the browser then refused the action that sentence stayed above the failure text. It is an instruction to the model, not a guarantee. Only requests that use the outcome protocol (the default for glirastes/react and glirastes/embed) get the note; the system prompt of those requests changes once, so a cached prompt prefix is rebuilt.
  • Runtime: the default local budget allows 10 model steps per turn (was 6) and 60,000 input tokens (was 40,000), also in the runtime container. Typical read-plus-planning tasks need 7 steps and stopped one step short of the answer; every step resends the turn, so 10 steps need about 50,000 input tokens. Tool calls (8), time and cost limits are unchanged. Apps that rely on the old values set localLimits: { maxModelSteps: 6, maxInputTokens: 40_000 } (container: limits.*).

Fixed

  • Voice input no longer fails silently when the audio worklet cannot be loaded (404): the chat shows a localized alert (span[role="alert"][data-element="voice-error"], voiceUnavailableText) next to the mic button and console.error names the URL (path only, without query or hash), the cause and the fix. A loaded file that does not register audio-processor takes the same path. Any other failed recording shows voiceFailedText. The audio context of a failed pipeline is closed.

Documentation

  • session.load and createLocalSessionStore: to make mention chips appear in a loaded chat, set entityDeclarations; the declarations the chat handler streams are transient and not stored.
  • Upgrade notes for 0.15.0 to 0.17.3: glirastes upgrade report listed these versions as "Unclassified (no upgrade notes, read the changelog)". They now carry classified notes, among them the required ChatLocale keys and new ActivityStepStatus members of 0.17.x, ToolSearchIndex.rank, the 0.17.0 stop notice (English unless locale: 'de-DE'), the tool result bound with read_result, per-tool-call onError and the authorized tool set of managed turns. A test keeps every released version since 0.14.0 classified.
  • Counting turns in onFinish: it fires once per request, so a UI tool turn with the outcome protocol calls it at least twice: once more for every request that continues the turn after reported outcomes (continuation: 'ui-outcome', at most MAX_UI_OUTCOME_CONTINUATIONS, 3) or answered approvals ('approval'). The onFinish type, docs/ui-action-outcomes.md ("Counting turns"), docs/managed-runtime-sync.md and the integrating-glirastes-nextjs handler reference now show how to count one logical turn and add up its tokens.