Merge pull request #272 from getcompanion-ai/grind

Add durable grind mode and non-mutating Companion OS checks
This commit is contained in:
Hari 2026-03-09 12:26:52 -04:00 committed by GitHub
commit f58ff785ce
19 changed files with 1252 additions and 9 deletions

View file

@ -995,12 +995,15 @@ export interface RegisteredCommand {
// Extension API
// ============================================================================
type ExtensionHandlerResult<R> = [R] extends [undefined]
? Promise<void> | void
: Promise<R | undefined> | R | undefined;
/** Handler function type for events */
// biome-ignore lint/suspicious/noConfusingVoidType: void allows bare return statements
export type ExtensionHandler<E, R = undefined> = (
event: E,
ctx: ExtensionContext,
) => Promise<R | void> | R | void;
) => ExtensionHandlerResult<R>;
/**
* ExtensionAPI passed to extension factory functions.

View file

@ -8,10 +8,10 @@ import { rm } from "node:fs/promises";
import { join } from "node:path";
import { URL } from "node:url";
import type { AgentSession, AgentSessionEvent } from "../agent-session.js";
import type { Settings } from "../settings-manager.js";
import { extractMessageText, getLastAssistantText } from "./helpers.js";
import {
type GatewayEvent,
type GatewayQueuedMessage,
HttpError,
type ManagedGatewaySession,
} from "./internal-types.js";
@ -29,7 +29,6 @@ import type {
HistoryPart,
ModelInfo,
} from "./types.js";
import type { Settings } from "../settings-manager.js";
import {
createVercelStreamListener,
errorVercelStream,