Add 5 pi extensions: pi-subagents, pi-crew, rpiv-pi, pi-interactive-shell, pi-intercom

This commit is contained in:
2026-05-08 15:59:25 +10:00
parent d0d1d9b045
commit 31b4110c87
457 changed files with 85157 additions and 0 deletions

View File

@@ -0,0 +1,150 @@
import { Type } from "typebox";
export const PiTeamsAutonomyProfileSchema = Type.Union([
Type.Literal("manual"),
Type.Literal("suggested"),
Type.Literal("assisted"),
Type.Literal("aggressive"),
]);
export const PiTeamsAutonomousConfigSchema = Type.Object({
profile: Type.Optional(PiTeamsAutonomyProfileSchema),
enabled: Type.Optional(Type.Boolean()),
injectPolicy: Type.Optional(Type.Boolean()),
preferAsyncForLongTasks: Type.Optional(Type.Boolean()),
allowWorktreeSuggestion: Type.Optional(Type.Boolean()),
magicKeywords: Type.Optional(Type.Record(Type.String({ minLength: 1 }), Type.Array(Type.String({ minLength: 1 })))),
}, { additionalProperties: false });
export const PiTeamsLimitsConfigSchema = Type.Object({
maxConcurrentWorkers: Type.Optional(Type.Integer({ minimum: 1 })),
allowUnboundedConcurrency: Type.Optional(Type.Boolean()),
maxTaskDepth: Type.Optional(Type.Integer({ minimum: 1 })),
maxChildrenPerTask: Type.Optional(Type.Integer({ minimum: 1 })),
maxRunMinutes: Type.Optional(Type.Integer({ minimum: 1 })),
maxRetriesPerTask: Type.Optional(Type.Integer({ minimum: 1 })),
maxTasksPerRun: Type.Optional(Type.Integer({ minimum: 1 })),
heartbeatStaleMs: Type.Optional(Type.Integer({ minimum: 1 })),
}, { additionalProperties: false });
export const PiTeamsRuntimeConfigSchema = Type.Object({
mode: Type.Optional(Type.Union([Type.Literal("auto"), Type.Literal("scaffold"), Type.Literal("child-process"), Type.Literal("live-session")])),
preferLiveSession: Type.Optional(Type.Boolean()),
allowChildProcessFallback: Type.Optional(Type.Boolean()),
maxTurns: Type.Optional(Type.Integer({ minimum: 1 })),
graceTurns: Type.Optional(Type.Integer({ minimum: 1 })),
inheritContext: Type.Optional(Type.Boolean()),
promptMode: Type.Optional(Type.Union([Type.Literal("replace"), Type.Literal("append")])),
groupJoin: Type.Optional(Type.Union([Type.Literal("off"), Type.Literal("group"), Type.Literal("smart")])),
groupJoinAckTimeoutMs: Type.Optional(Type.Integer({ minimum: 1 })),
requirePlanApproval: Type.Optional(Type.Boolean()),
completionMutationGuard: Type.Optional(Type.Union([Type.Literal("off"), Type.Literal("warn"), Type.Literal("fail")])),
effectivenessGuard: Type.Optional(Type.Union([Type.Literal("off"), Type.Literal("warn"), Type.Literal("block"), Type.Literal("fail")])),
}, { additionalProperties: false });
export const PiTeamsControlConfigSchema = Type.Object({
enabled: Type.Optional(Type.Boolean()),
needsAttentionAfterMs: Type.Optional(Type.Integer({ minimum: 1 })),
}, { additionalProperties: false });
export const PiTeamsWorktreeConfigSchema = Type.Object({
setupHook: Type.Optional(Type.String({ minLength: 1 })),
setupHookTimeoutMs: Type.Optional(Type.Integer({ minimum: 1 })),
linkNodeModules: Type.Optional(Type.Boolean()),
}, { additionalProperties: false });
export const AgentOverrideSchema = Type.Object({
disabled: Type.Optional(Type.Boolean()),
model: Type.Optional(Type.Union([Type.String({ minLength: 1 }), Type.Literal(false)])),
fallbackModels: Type.Optional(Type.Union([Type.Array(Type.String({ minLength: 1 })), Type.Literal(false)])),
thinking: Type.Optional(Type.Union([Type.String({ minLength: 1 }), Type.Literal(false)])),
tools: Type.Optional(Type.Union([Type.Array(Type.String({ minLength: 1 })), Type.Literal(false)])),
skills: Type.Optional(Type.Union([Type.Array(Type.String({ minLength: 1 })), Type.Literal(false)])),
}, { additionalProperties: false });
export const PiTeamsAgentsConfigSchema = Type.Object({
disableBuiltins: Type.Optional(Type.Boolean()),
overrides: Type.Optional(Type.Record(Type.String({ minLength: 1 }), AgentOverrideSchema)),
}, { additionalProperties: false });
export const PiTeamsToolsConfigSchema = Type.Object({
enableClaudeStyleAliases: Type.Optional(Type.Boolean()),
enableSteer: Type.Optional(Type.Boolean()),
terminateOnForeground: Type.Optional(Type.Boolean()),
}, { additionalProperties: false });
export const PiTeamsTelemetryConfigSchema = Type.Object({
enabled: Type.Optional(Type.Boolean()),
}, { additionalProperties: false });
export const PiTeamsNotificationsConfigSchema = Type.Object({
enabled: Type.Optional(Type.Boolean()),
severityFilter: Type.Optional(Type.Array(Type.Union([Type.Literal("info"), Type.Literal("warning"), Type.Literal("error"), Type.Literal("critical")]))),
dedupWindowMs: Type.Optional(Type.Integer({ minimum: 1000 })),
batchWindowMs: Type.Optional(Type.Integer({ minimum: 0 })),
quietHours: Type.Optional(Type.String({ pattern: "^\\d{2}:\\d{2}-\\d{2}:\\d{2}$" })),
sinkRetentionDays: Type.Optional(Type.Integer({ minimum: 1, maximum: 90 })),
}, { additionalProperties: false });
export const PiTeamsObservabilityConfigSchema = Type.Object({
enabled: Type.Optional(Type.Boolean()),
pollIntervalMs: Type.Optional(Type.Integer({ minimum: 1000, maximum: 60000 })),
metricRetentionDays: Type.Optional(Type.Integer({ minimum: 1, maximum: 365 })),
}, { additionalProperties: false });
export const PiTeamsReliabilityConfigSchema = Type.Object({
autoRetry: Type.Optional(Type.Boolean()),
retryPolicy: Type.Optional(Type.Object({
maxAttempts: Type.Optional(Type.Integer({ minimum: 1, maximum: 10 })),
backoffMs: Type.Optional(Type.Integer({ minimum: 100, maximum: 60000 })),
jitterRatio: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })),
exponentialFactor: Type.Optional(Type.Number({ minimum: 1, maximum: 5 })),
retryableErrors: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),
}, { additionalProperties: false })),
autoRecover: Type.Optional(Type.Boolean()),
deadletterThreshold: Type.Optional(Type.Integer({ minimum: 1 })),
}, { additionalProperties: false });
export const PiTeamsOtlpConfigSchema = Type.Object({
enabled: Type.Optional(Type.Boolean()),
endpoint: Type.Optional(Type.String({ minLength: 1 })),
headers: Type.Optional(Type.Record(Type.String({ minLength: 1 }), Type.String())),
intervalMs: Type.Optional(Type.Integer({ minimum: 5000 })),
}, { additionalProperties: false });
export const PiTeamsUiConfigSchema = Type.Object({
widgetPlacement: Type.Optional(Type.Union([Type.Literal("aboveEditor"), Type.Literal("belowEditor")])),
widgetMaxLines: Type.Optional(Type.Integer({ minimum: 1, maximum: 50 })),
powerbar: Type.Optional(Type.Boolean()),
dashboardPlacement: Type.Optional(Type.Union([Type.Literal("center"), Type.Literal("right")])),
dashboardWidth: Type.Optional(Type.Integer({ minimum: 32, maximum: 120 })),
dashboardLiveRefreshMs: Type.Optional(Type.Integer({ minimum: 250, maximum: 60000 })),
autoOpenDashboard: Type.Optional(Type.Boolean()),
autoOpenDashboardForForegroundRuns: Type.Optional(Type.Boolean()),
showModel: Type.Optional(Type.Boolean()),
showTokens: Type.Optional(Type.Boolean()),
showTools: Type.Optional(Type.Boolean()),
transcriptTailBytes: Type.Optional(Type.Integer({ minimum: 1024, maximum: 50 * 1024 * 1024 })),
mascotStyle: Type.Optional(Type.Union([Type.Literal("cat"), Type.Literal("armin")])),
mascotEffect: Type.Optional(Type.Union([Type.Literal("random"), Type.Literal("none"), Type.Literal("typewriter"), Type.Literal("scanline"), Type.Literal("rain"), Type.Literal("fade"), Type.Literal("crt"), Type.Literal("glitch"), Type.Literal("dissolve")])),
}, { additionalProperties: false });
export const PiTeamsConfigSchema = Type.Object({
asyncByDefault: Type.Optional(Type.Boolean()),
executeWorkers: Type.Optional(Type.Boolean()),
notifierIntervalMs: Type.Optional(Type.Number({ minimum: 1000 })),
requireCleanWorktreeLeader: Type.Optional(Type.Boolean()),
autonomous: Type.Optional(PiTeamsAutonomousConfigSchema),
limits: Type.Optional(PiTeamsLimitsConfigSchema),
runtime: Type.Optional(PiTeamsRuntimeConfigSchema),
control: Type.Optional(PiTeamsControlConfigSchema),
worktree: Type.Optional(PiTeamsWorktreeConfigSchema),
agents: Type.Optional(PiTeamsAgentsConfigSchema),
tools: Type.Optional(PiTeamsToolsConfigSchema),
telemetry: Type.Optional(PiTeamsTelemetryConfigSchema),
notifications: Type.Optional(PiTeamsNotificationsConfigSchema),
observability: Type.Optional(PiTeamsObservabilityConfigSchema),
reliability: Type.Optional(PiTeamsReliabilityConfigSchema),
otlp: Type.Optional(PiTeamsOtlpConfigSchema),
ui: Type.Optional(PiTeamsUiConfigSchema),
}, { additionalProperties: false });

View File

@@ -0,0 +1,115 @@
import { Type } from "typebox";
const SkillOverride = Type.Unsafe({
description: "Skill name(s) to add to role/default skills, an array of skill names, or false to disable all injected skills for this run.",
anyOf: [
{ type: "string", maxLength: 2048 },
{ type: "array", maxItems: 32, items: { type: "string", maxLength: 80 } },
{ type: "boolean" },
],
});
const FreeformConfig = Type.Unsafe({
description: "Resource config for management actions.",
type: "object",
additionalProperties: true,
});
export const TeamToolParams = Type.Object({
action: Type.Optional(Type.Union([
Type.Literal("run"),
Type.Literal("plan"),
Type.Literal("status"),
Type.Literal("list"),
Type.Literal("get"),
Type.Literal("cancel"),
Type.Literal("resume"),
Type.Literal("respond"),
Type.Literal("create"),
Type.Literal("update"),
Type.Literal("delete"),
Type.Literal("doctor"),
Type.Literal("cleanup"),
Type.Literal("events"),
Type.Literal("artifacts"),
Type.Literal("worktrees"),
Type.Literal("forget"),
Type.Literal("summary"),
Type.Literal("prune"),
Type.Literal("export"),
Type.Literal("import"),
Type.Literal("imports"),
Type.Literal("help"),
Type.Literal("validate"),
Type.Literal("config"),
Type.Literal("init"),
Type.Literal("recommend"),
Type.Literal("autonomy"),
Type.Literal("api"),
Type.Literal("settings"),
], { description: "Team action. Defaults to 'list' when omitted." })),
resource: Type.Optional(Type.Union([
Type.Literal("agent"),
Type.Literal("team"),
Type.Literal("workflow"),
], { description: "Resource kind for get/create/update/delete/list. Defaults to all for list." })),
team: Type.Optional(Type.String({ description: "Team name, e.g. default or implementation." })),
workflow: Type.Optional(Type.String({ description: "Workflow name, e.g. default or review." })),
role: Type.Optional(Type.String({ description: "Role name to run directly within a team." })),
agent: Type.Optional(Type.String({ description: "Agent name to inspect or run directly." })),
goal: Type.Optional(Type.String({ description: "High-level objective for a team run." })),
task: Type.Optional(Type.String({ description: "Concrete task text for direct role/agent execution." })),
runId: Type.Optional(Type.String({ description: "Run ID for status, cancel, or resume." })),
taskId: Type.Optional(Type.String({ description: "Task ID for respond action." })),
message: Type.Optional(Type.String({ description: "Message for respond action." })),
async: Type.Optional(Type.Boolean({ description: "Run in background when execution support is enabled." })),
workspaceMode: Type.Optional(Type.Union([
Type.Literal("single"),
Type.Literal("worktree"),
], { description: "Workspace isolation mode. Worktree mode is planned after MVP." })),
context: Type.Optional(Type.Union([
Type.Literal("fresh"),
Type.Literal("fork"),
], { description: "Child context mode for workers." })),
cwd: Type.Optional(Type.String({ description: "Working directory override." })),
model: Type.Optional(Type.String({ description: "Model override for direct runs." })),
skill: Type.Optional(SkillOverride),
scope: Type.Optional(Type.Union([
Type.Literal("user"),
Type.Literal("project"),
Type.Literal("both"),
], { description: "Resource scope for discovery or management." })),
config: Type.Optional(FreeformConfig),
dryRun: Type.Optional(Type.Boolean({ description: "Preview a management mutation without writing files." })),
confirm: Type.Optional(Type.Boolean({ description: "Required for destructive management actions." })),
force: Type.Optional(Type.Boolean({ description: "Override reference checks for destructive management actions." })),
keep: Type.Optional(Type.Integer({ minimum: 0, description: "Number of finished runs to keep for prune." })),
updateReferences: Type.Optional(Type.Boolean({ description: "When renaming agents or workflows, update team references in the same project/user scope." })),
});
export interface TeamToolParamsValue {
action?: "run" | "plan" | "status" | "list" | "get" | "cancel" | "resume" | "respond" | "create" | "update" | "delete" | "doctor" | "cleanup" | "events" | "artifacts" | "worktrees" | "forget" | "summary" | "prune" | "export" | "import" | "imports" | "help" | "validate" | "config" | "init" | "recommend" | "autonomy" | "api" | "settings";
resource?: "agent" | "team" | "workflow";
team?: string;
workflow?: string;
role?: string;
agent?: string;
goal?: string;
task?: string;
runId?: string;
taskId?: string;
message?: string;
async?: boolean;
workspaceMode?: "single" | "worktree";
context?: "fresh" | "fork";
cwd?: string;
model?: string;
skill?: string | string[] | boolean;
scope?: "user" | "project" | "both";
config?: Record<string, unknown>;
dryRun?: boolean;
confirm?: boolean;
force?: boolean;
keep?: number;
updateReferences?: boolean;
}