chore: include pre-built dist for github install
This commit is contained in:
+45
@@ -0,0 +1,45 @@
|
||||
import type { BackgroundManager } from "../../features/background-agent";
|
||||
export type BackgroundOutputMessage = {
|
||||
id?: string;
|
||||
info?: {
|
||||
role?: string;
|
||||
time?: string | {
|
||||
created?: number;
|
||||
};
|
||||
agent?: string;
|
||||
};
|
||||
parts?: Array<{
|
||||
type?: string;
|
||||
text?: string;
|
||||
thinking?: string;
|
||||
content?: string | Array<{
|
||||
type: string;
|
||||
text?: string;
|
||||
}>;
|
||||
output?: string;
|
||||
name?: string;
|
||||
}>;
|
||||
};
|
||||
export type BackgroundOutputMessagesResult = {
|
||||
data?: BackgroundOutputMessage[];
|
||||
error?: unknown;
|
||||
} | BackgroundOutputMessage[];
|
||||
export type BackgroundOutputClient = {
|
||||
session: {
|
||||
messages: (args: {
|
||||
path: {
|
||||
id: string;
|
||||
};
|
||||
}) => Promise<BackgroundOutputMessagesResult>;
|
||||
};
|
||||
};
|
||||
export type BackgroundCancelClient = {
|
||||
session: {
|
||||
abort: (args: {
|
||||
path: {
|
||||
id: string;
|
||||
};
|
||||
}) => Promise<unknown>;
|
||||
};
|
||||
};
|
||||
export type BackgroundOutputManager = Pick<BackgroundManager, "getTask">;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
export declare const BACKGROUND_TASK_DESCRIPTION = "Run agent task in background. Returns task_id immediately; notifies on completion.\n\nUse `background_output` to get results. Prompts MUST be in English.";
|
||||
export declare const BACKGROUND_OUTPUT_DESCRIPTION = "Get output from background task. Use full_session=true to fetch session messages with filters. System notifies on completion, so block=true rarely needed. - Timeout values are in milliseconds (ms), NOT seconds.";
|
||||
export declare const BACKGROUND_CANCEL_DESCRIPTION = "Cancel running background task(s). Use all=true to cancel ALL before final answer.";
|
||||
@@ -0,0 +1,4 @@
|
||||
import { type ToolDefinition } from "@opencode-ai/plugin";
|
||||
import type { BackgroundManager } from "../../features/background-agent";
|
||||
import type { BackgroundCancelClient } from "./clients";
|
||||
export declare function createBackgroundCancel(manager: BackgroundManager, _client: BackgroundCancelClient): ToolDefinition;
|
||||
@@ -0,0 +1,3 @@
|
||||
import { type ToolDefinition } from "@opencode-ai/plugin";
|
||||
import type { BackgroundOutputClient, BackgroundOutputManager } from "./clients";
|
||||
export declare function createBackgroundOutput(manager: BackgroundOutputManager, client: BackgroundOutputClient): ToolDefinition;
|
||||
@@ -0,0 +1,3 @@
|
||||
import { type PluginInput, type ToolDefinition } from "@opencode-ai/plugin";
|
||||
import type { BackgroundManager } from "../../features/background-agent";
|
||||
export declare function createBackgroundTask(manager: BackgroundManager, client: PluginInput["client"]): ToolDefinition;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export declare function delay(ms: number): Promise<void>;
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { BackgroundTask } from "../../features/background-agent";
|
||||
import type { BackgroundOutputClient } from "./clients";
|
||||
export declare function formatFullSession(task: BackgroundTask, client: BackgroundOutputClient, options: {
|
||||
includeThinking: boolean;
|
||||
messageLimit?: number;
|
||||
sinceMessageId?: string;
|
||||
includeToolResults: boolean;
|
||||
thinkingMaxChars?: number;
|
||||
}): Promise<string>;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
export { createBackgroundTask, createBackgroundOutput, createBackgroundCancel, } from "./tools";
|
||||
export type * from "./types";
|
||||
export * from "./constants";
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { getMessageDir } from "../../shared/opencode-message-dir";
|
||||
@@ -0,0 +1,3 @@
|
||||
import type { BackgroundOutputMessage, BackgroundOutputMessagesResult } from "./clients";
|
||||
export declare function getErrorMessage(value: BackgroundOutputMessagesResult): string | null;
|
||||
export declare function extractMessages(value: BackgroundOutputMessagesResult): BackgroundOutputMessage[];
|
||||
@@ -0,0 +1,3 @@
|
||||
import type { BackgroundTask } from "../../features/background-agent";
|
||||
import type { BackgroundOutputClient } from "./clients";
|
||||
export declare function formatTaskResult(task: BackgroundTask, client: BackgroundOutputClient): Promise<string>;
|
||||
@@ -0,0 +1,2 @@
|
||||
import type { BackgroundTask } from "../../features/background-agent";
|
||||
export declare function formatTaskStatus(task: BackgroundTask): string;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export declare function formatDuration(start: Date, end?: Date): string;
|
||||
export declare function formatMessageTime(value: unknown): string;
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
export type { BackgroundCancelClient, BackgroundOutputClient, BackgroundOutputManager, BackgroundOutputMessage, BackgroundOutputMessagesResult, } from "./clients";
|
||||
export { createBackgroundTask } from "./create-background-task";
|
||||
export { createBackgroundOutput } from "./create-background-output";
|
||||
export { createBackgroundCancel } from "./create-background-cancel";
|
||||
@@ -0,0 +1 @@
|
||||
export declare function truncateText(text: string, maxLength: number): string;
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
export interface BackgroundTaskArgs {
|
||||
description: string;
|
||||
prompt: string;
|
||||
agent: string;
|
||||
}
|
||||
export interface BackgroundOutputArgs {
|
||||
task_id: string;
|
||||
block?: boolean;
|
||||
timeout?: number;
|
||||
full_session?: boolean;
|
||||
include_thinking?: boolean;
|
||||
message_limit?: number;
|
||||
since_message_id?: string;
|
||||
include_tool_results?: boolean;
|
||||
thinking_max_chars?: number;
|
||||
}
|
||||
export interface BackgroundCancelArgs {
|
||||
taskId?: string;
|
||||
all?: boolean;
|
||||
}
|
||||
export type BackgroundOutputMessage = {
|
||||
info?: {
|
||||
role?: string;
|
||||
time?: string | {
|
||||
created?: number;
|
||||
};
|
||||
agent?: string;
|
||||
};
|
||||
parts?: Array<{
|
||||
type?: string;
|
||||
text?: string;
|
||||
content?: string | Array<{
|
||||
type: string;
|
||||
text?: string;
|
||||
}>;
|
||||
name?: string;
|
||||
}>;
|
||||
};
|
||||
export type BackgroundOutputMessagesResult = {
|
||||
data?: BackgroundOutputMessage[];
|
||||
error?: unknown;
|
||||
} | BackgroundOutputMessage[];
|
||||
export type BackgroundOutputClient = {
|
||||
session: {
|
||||
messages: (args: {
|
||||
path: {
|
||||
id: string;
|
||||
};
|
||||
}) => Promise<BackgroundOutputMessagesResult>;
|
||||
};
|
||||
};
|
||||
export type BackgroundCancelClient = {
|
||||
session: {
|
||||
abort: (args: {
|
||||
path: {
|
||||
id: string;
|
||||
};
|
||||
}) => Promise<unknown>;
|
||||
};
|
||||
};
|
||||
export type BackgroundOutputManager = Pick<import("../../features/background-agent").BackgroundManager, "getTask">;
|
||||
export type FullSessionMessagePart = {
|
||||
type?: string;
|
||||
text?: string;
|
||||
thinking?: string;
|
||||
content?: string | Array<{
|
||||
type?: string;
|
||||
text?: string;
|
||||
}>;
|
||||
output?: string;
|
||||
};
|
||||
export type FullSessionMessage = {
|
||||
id?: string;
|
||||
info?: {
|
||||
role?: string;
|
||||
time?: string;
|
||||
agent?: string;
|
||||
};
|
||||
parts?: FullSessionMessagePart[];
|
||||
};
|
||||
export type ToolContextWithMetadata = {
|
||||
sessionID: string;
|
||||
messageID: string;
|
||||
agent: string;
|
||||
abort: AbortSignal;
|
||||
metadata?: (input: {
|
||||
title?: string;
|
||||
metadata?: Record<string, unknown>;
|
||||
}) => void;
|
||||
};
|
||||
Reference in New Issue
Block a user