/** * ProjectSyncStrategy - Handles synchronization of Projects, Agents, Flows, and Skills * * This strategy implements ISyncStrategy for the Project resource hierarchy: * Project → Agent → Flow → Skill * * Key responsibilities: * - Pull complete project structure from NEWO platform * - Push changed skills and new entities to platform * - Detect changes using SHA256 hashes * - Validate project structure before push */ import type { ISyncStrategy, PullOptions, PullResult, PushResult, ChangeItem, ValidationResult, StatusSummary } from './ISyncStrategy.js'; import type { CustomerConfig, ILogger } from '../../resources/common/types.js'; import type { AxiosInstance } from 'axios'; import type { ProjectMeta, SkillMetadata, FlowMetadata, AgentMetadata, ProjectMetadata } from '../../../types.js'; /** * Project data for local storage */ export interface LocalProjectData { projectId: string; projectIdn: string; metadata: ProjectMetadata; agents: LocalAgentData[]; } export interface LocalAgentData { id: string; idn: string; metadata: AgentMetadata; flows: LocalFlowData[]; } export interface LocalFlowData { id: string; idn: string; metadata: FlowMetadata; skills: LocalSkillData[]; } export interface LocalSkillData { id: string; idn: string; metadata: SkillMetadata; scriptPath: string; scriptContent: string; } /** * API client factory type */ export type ApiClientFactory = (customer: CustomerConfig, verbose: boolean) => Promise; /** * ProjectSyncStrategy - Handles project synchronization */ export declare class ProjectSyncStrategy implements ISyncStrategy { private apiClientFactory; private logger; readonly resourceType = "projects"; readonly displayName = "Projects"; constructor(apiClientFactory: ApiClientFactory, logger: ILogger); /** * Pull all projects from NEWO platform */ pull(customer: CustomerConfig, options?: PullOptions): Promise>; /** * Pull a single agent and its flows/skills */ private pullAgent; /** * Pull a single flow and its skills */ private pullFlow; /** * Pull a single skill */ private pullSkill; /** * Push changed projects to NEWO platform */ push(customer: CustomerConfig, changes?: ChangeItem[]): Promise; /** * Push a flow metadata.yaml change — syncs title, events, and state_fields * to the platform. Closes GH issue #3 (events/title silently un-synced). * * Path shape: newo_customers/{customer}/projects/{project}/{agent}/{flow}/metadata.yaml */ private pushFlowMetadataUpdate; /** * Push a skill update */ private pushSkillUpdate; /** * Push a library skill update * Path: newo_customers/{customer}/projects/{project}/libraries/{lib}/{skill}/{skill}.jinja */ private pushLibrarySkillUpdate; /** * Push a new entity */ private pushNewEntity; /** * Publish all flows */ private publishAllFlows; /** * Detect changes in project files */ getChanges(customer: CustomerConfig): Promise[]>; /** * Validate project structure */ validate(customer: CustomerConfig, _items: LocalProjectData[]): Promise; /** * Get status summary */ getStatus(customer: CustomerConfig): Promise; /** * Clean up deleted entities */ private cleanupDeletedEntities; } /** * Factory function for creating ProjectSyncStrategy */ export declare function createProjectSyncStrategy(apiClientFactory: ApiClientFactory, logger: ILogger): ProjectSyncStrategy; //# sourceMappingURL=ProjectSyncStrategy.d.ts.map