mirror of
https://github.com/stablyai/orca.git
synced 2026-10-09 00:02:39 +00:00
* Add native chat skill and command picker with host-aware discovery Adds a unified, keyboard-first skill and command picker to native chat that: - Uses agent-native invocation syntax (slash for Claude/OpenClaude/Grok, dollar for Codex) - Discovers skills only on the pane's execution host (local, WSL, SSH-unavailable, or runtime) - Groups or separates commands and skills per agent configuration - Deduplicates by canonical path but preserves visibility through all contributing roots - Handles IME composition, loading states, and errors without claiming PTY-level control - Records picker telemetry (open, item accepted, send classification, discovery outcomes) - Extends shared agent profiles to define per-agent skill grammars and source ownership * Remove obsolete reference and design documentation Clean up stale design specs, implementation plans, and investigation notes from docs/reference/. These documents predate the current implementation and are no longer actively maintained or referenced by the codebase. * Extract shared skill discovery utilities and add skill invocation envelo - Move skill comparison and source classification to shared module for native/WSL reuse - Extract display text sanitization to prevent control/zero-width character spoofing - Add native-chat command envelope parser and surfacer for skill invocations - Extend discovery timeout backstop to account for WSL metadata read sequence * Localize skill picker UI for Spanish, Japanese, Korean, Chinese Translate skill picker UI strings including commands, skills, loading states, error messages, and scope labels for the new skill picker feature across four language locales. * Fix skill picker bugs and improve code robustness - Fix i18n plural handling: rename `count` to `sourceCount` to prevent unintended plural-key resolution in localized strings - Fix skill discovery array mutations: copy `root.providers` to prevent bugs during dedup merge - Fix image attachments being silently dropped when message text starts with /skill or agent prefix - Extract `quoteBashString` utility for WSL command code reuse across builders - Add line-separator safety characters (0x2028/0x2029) to skill display filter - Remove stale doc reference links and clarify inline comments * Add reference docs for git compatibility and headless Linux server setup Track previously untracked operational guides in `docs/reference/` that explain Git binary compatibility requirements across host types and how to run `orca serve` on headless Linux. Update AGENTS.md and README.md to link to these references.
110 lines
3.4 KiB
TypeScript
110 lines
3.4 KiB
TypeScript
import { z } from 'zod'
|
|
import type { AgentType } from './agent-status-types'
|
|
import type { ProjectExecutionRuntimeResolution } from './project-execution-runtime'
|
|
|
|
export type SkillProvider = 'codex' | 'claude' | 'agent-skills'
|
|
|
|
export type SkillSourceKind = 'home' | 'repo' | 'bundled' | 'plugin'
|
|
|
|
export type DiscoveredSkill = {
|
|
id: string
|
|
name: string
|
|
description: string | null
|
|
providers: SkillProvider[]
|
|
sourceKind: SkillSourceKind
|
|
sourceLabel: string
|
|
rootPath: string
|
|
/** Every root that reached this file. Canonical-path dedup keeps one row but
|
|
* must not erase co-owning roots, or shared symlinked skills lose agents. */
|
|
rootPaths?: string[]
|
|
directoryPath: string
|
|
skillFilePath: string
|
|
installed: boolean
|
|
fileCount: number
|
|
updatedAt: number | null
|
|
}
|
|
|
|
export type SkillDiscoverySource = {
|
|
id: string
|
|
label: string
|
|
path: string
|
|
sourceKind: SkillSourceKind
|
|
providers: SkillProvider[]
|
|
/** Agent that owns this root; null is the explicit shared-skills scope. */
|
|
owner: AgentType | null
|
|
exists: boolean
|
|
skippedReason?: 'missing' | 'remote-repo'
|
|
}
|
|
|
|
export type SkillDiscoveryResult = {
|
|
skills: DiscoveredSkill[]
|
|
sources: SkillDiscoverySource[]
|
|
scannedAt: number
|
|
}
|
|
|
|
export type SkillDiscoveryTarget = {
|
|
runtime?: 'host' | 'wsl'
|
|
wslDistro?: string | null
|
|
/** Workspace path whose local .agents/.claude skill roots should be scanned. */
|
|
cwd?: string | null
|
|
/** Lets the owning runtime resolve the project runtime from its own store
|
|
* when the caller (e.g. a remote client) cannot supply `projectRuntime`. */
|
|
worktreeId?: string | null
|
|
projectRuntime?: ProjectExecutionRuntimeResolution
|
|
}
|
|
|
|
const ResolvedProjectRuntimeSchema = z.object({
|
|
status: z.literal('resolved'),
|
|
runtime: z.discriminatedUnion('kind', [
|
|
z.object({
|
|
kind: z.literal('local-host'),
|
|
hostPlatform: z.string(),
|
|
projectId: z.string(),
|
|
reason: z.literal('non-windows'),
|
|
cacheKey: z.string()
|
|
}),
|
|
z.object({
|
|
kind: z.literal('windows-host'),
|
|
hostPlatform: z.literal('win32'),
|
|
projectId: z.string(),
|
|
reason: z.enum(['project-override', 'global-default', 'migration-fallback']),
|
|
cacheKey: z.string()
|
|
}),
|
|
z.object({
|
|
kind: z.literal('wsl'),
|
|
hostPlatform: z.literal('wsl'),
|
|
projectId: z.string(),
|
|
distro: z.string(),
|
|
reason: z.enum(['project-override', 'global-default']),
|
|
cacheKey: z.string()
|
|
})
|
|
])
|
|
})
|
|
|
|
const RepairProjectRuntimeSchema = z.object({
|
|
status: z.literal('repair-required'),
|
|
repair: z.object({
|
|
projectId: z.string(),
|
|
preferredRuntime: z.object({ kind: z.literal('wsl'), distro: z.string().nullable() }),
|
|
reason: z.enum(['wsl-unavailable', 'wsl-distro-required', 'wsl-distro-missing']),
|
|
source: z.enum(['project-override', 'global-default']),
|
|
cacheKey: z.string()
|
|
})
|
|
})
|
|
|
|
/** Both desktop IPC and runtime RPC parse the complete discovery target here. */
|
|
export const SkillDiscoveryTargetSchema: z.ZodType<SkillDiscoveryTarget> = z.object({
|
|
runtime: z.enum(['host', 'wsl']).optional(),
|
|
wslDistro: z.string().nullable().optional(),
|
|
cwd: z.string().nullable().optional(),
|
|
worktreeId: z.string().nullable().optional(),
|
|
projectRuntime: z
|
|
.discriminatedUnion('status', [ResolvedProjectRuntimeSchema, RepairProjectRuntimeSchema])
|
|
.optional()
|
|
})
|
|
|
|
export type SkillFrontmatterSummary = {
|
|
name: string | null
|
|
description: string | null
|
|
}
|