@moskala/oneagent-core 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,20 @@
1
+ import type { AgentTarget } from "./types.ts";
2
+ export interface AgentDefinition {
3
+ target: AgentTarget;
4
+ displayName: string;
5
+ hint: string;
6
+ /** Paths (relative to root) checked to detect agent presence. Any match = present. */
7
+ detectIndicators: string[];
8
+ /** Symlink path for main instructions file (relative to root). */
9
+ mainFile: string;
10
+ /** Whole-dir symlink for rules (relative to root). Omit if not applicable. */
11
+ rulesDir?: string;
12
+ /** Whole-dir symlink for skills (relative to root). Omit if not applicable. */
13
+ skillsDir?: string;
14
+ /** Whole-dir symlink for commands (relative to root). Omit if agent does not support custom commands. */
15
+ commandsDir?: string;
16
+ /** Legacy files to remove during init (superseded by current format). */
17
+ deprecatedFiles?: string[];
18
+ }
19
+ export declare const AGENT_DEFINITIONS: AgentDefinition[];
20
+ export declare function getAgentDef(target: AgentTarget): AgentDefinition;
@@ -0,0 +1,48 @@
1
+ import type { AgentTarget } from "./types.ts";
2
+ export interface TemplatePlugin {
3
+ target: AgentTarget;
4
+ id: string;
5
+ }
6
+ export interface SkillEntry {
7
+ repo: string;
8
+ skill: string;
9
+ }
10
+ export interface TemplateDefinition {
11
+ name: string;
12
+ description: string;
13
+ skills: SkillEntry[];
14
+ plugins: TemplatePlugin[];
15
+ instructions: string;
16
+ rules: Array<{
17
+ name: string;
18
+ content: string;
19
+ }>;
20
+ }
21
+ export declare function parseTemplateYaml(yamlText: string, fallbackName?: string): Pick<TemplateDefinition, "name" | "description" | "skills" | "plugins"> & {
22
+ extends?: string;
23
+ };
24
+ export declare function parseSkillsFromYaml(yamlText: string): SkillEntry[];
25
+ export declare function parsePluginsFromYaml(yamlText: string): TemplatePlugin[];
26
+ export declare function resolveExtends(child: TemplateDefinition & {
27
+ extends?: string;
28
+ }, resolveBuiltin?: (name: string) => Promise<TemplateDefinition | null>): Promise<TemplateDefinition>;
29
+ export declare function applyTemplateFiles(root: string, template: TemplateDefinition): Promise<void>;
30
+ export interface SkillInstallResult {
31
+ installed: SkillEntry[];
32
+ failed: Array<{
33
+ entry: SkillEntry;
34
+ reason: string;
35
+ }>;
36
+ }
37
+ export declare function installTemplateSkills(root: string, template: TemplateDefinition): Promise<SkillInstallResult>;
38
+ export declare function installBuiltinSkill(root: string): Promise<boolean>;
39
+ export interface PluginInstallResult {
40
+ installed: TemplatePlugin[];
41
+ manual: TemplatePlugin[];
42
+ failed: Array<{
43
+ plugin: TemplatePlugin;
44
+ reason: string;
45
+ }>;
46
+ }
47
+ export declare function installTemplatePlugins(root: string, template: TemplateDefinition, activeTargets: AgentTarget[]): Promise<PluginInstallResult>;
48
+ export declare function fetchTemplateFromGitHub(url: string): Promise<TemplateDefinition>;
@@ -0,0 +1,2 @@
1
+ import type { CommandFile } from "./types.ts";
2
+ export declare function readCommands(root: string): Promise<CommandFile[]>;
@@ -0,0 +1,7 @@
1
+ import type { AgentTarget, Config } from "./types.ts";
2
+ export declare const ALL_AGENT_TARGETS: AgentTarget[];
3
+ export declare function activeTargets(config: Config): AgentTarget[];
4
+ export declare function makeTargets(...enabled: AgentTarget[]): Record<AgentTarget, boolean>;
5
+ export declare function configExists(root: string): Promise<boolean>;
6
+ export declare function readConfig(root: string): Promise<Config>;
7
+ export declare function writeConfig(root: string, config: Config): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const ONEAGENT_DIR = ".oneagent";
@@ -0,0 +1,8 @@
1
+ import type { RuleFile, SkillFile } from "./types.ts";
2
+ export declare function copilotFilePath(root: string, ruleName: string): string;
3
+ export declare function generateCopilotRule(root: string, rule: RuleFile): Promise<void>;
4
+ export declare function generateCopilotRules(root: string, rules: RuleFile[]): Promise<void>;
5
+ export declare function buildCopilotPromptContent(skill: SkillFile): string;
6
+ export declare function copilotPromptFilePath(root: string, skillName: string): string;
7
+ export declare function generateCopilotSkill(root: string, skill: SkillFile): Promise<void>;
8
+ export declare function generateCopilotSkills(root: string, skills: SkillFile[]): Promise<void>;
@@ -0,0 +1,6 @@
1
+ import type { DetectedFile } from "./types.ts";
2
+ export declare const AGENT_FILES: string[];
3
+ export declare function readDetectedFile(root: string, rel: string): Promise<DetectedFile | null>;
4
+ export declare function detectExistingFiles(root: string): Promise<DetectedFile[]>;
5
+ export declare function filesHaveSameContent(files: DetectedFile[]): boolean;
6
+ export declare function removeDeprecatedFiles(root: string): Promise<void>;
@@ -0,0 +1,7 @@
1
+ import type { Config, DetectedFile } from "./types.ts";
2
+ export interface GenerateCollisions {
3
+ mainFiles: DetectedFile[];
4
+ ruleSkillFiles: DetectedFile[];
5
+ }
6
+ export declare function detectGenerateCollisions(root: string, config: Config): Promise<GenerateCollisions>;
7
+ export declare function generate(root: string, config: Config): Promise<void>;