/** * V2ProjectSyncStrategy - Handles synchronization in newo_v2 format * * Uses the SAME V1 API endpoints as ProjectSyncStrategy but writes/reads * files in the newo_v2 directory layout: * {CustomerIdn}/ * import_version.txt * {ProjectIdn}/ * {project_idn}.yaml * agents/{AgentIdn}/ * agent.yaml * flows/{FlowIdn}/ * {FlowIdn}.yaml (inline skill defs, events, state_fields) * skills/{SkillIdn}.nsl|.nslg */ import type { ISyncStrategy, PullOptions, PullResult, PushResult, ChangeItem, ValidationResult, StatusSummary } from './ISyncStrategy.js'; import type { CustomerConfig, ILogger } from '../../resources/common/types.js'; import type { ProjectMeta } from '../../../types.js'; import type { LocalProjectData, ApiClientFactory } from './ProjectSyncStrategy.js'; /** * V2ProjectSyncStrategy - same API, newo_v2 file layout */ export declare class V2ProjectSyncStrategy implements ISyncStrategy { private apiClientFactory; private logger; readonly resourceType = "projects"; readonly displayName = "Projects (newo_v2)"; constructor(apiClientFactory: ApiClientFactory, logger: ILogger); pull(customer: CustomerConfig, options?: PullOptions): Promise>; /** * Pull a single agent in V2 format */ private pullAgent; /** * Pull a single flow in V2 format * * In V2, the flow YAML contains inline skill definitions, events, and state_fields. * Skills are written to flows/{FlowIdn}/skills/{SkillIdn}.nsl|.nslg */ private pullFlow; /** * Pull a single skill script in V2 format * * Script goes to: flows/{FlowIdn}/skills/{SkillIdn}.nsl|.nslg * No separate metadata.yaml - metadata is inline in the flow YAML */ private pullSkill; /** * Pull a library and its skills in V2 format * * Writes: * {project}/libraries/{lib}/{lib}.yaml (with inline skill list) * {project}/libraries/{lib}/skills/{skill}.nsl|.nslg */ private pullLibrary; push(customer: CustomerConfig, changes?: ChangeItem[]): Promise; /** * Recognize the V2 flow YAML location: .../agents/{agent}/flows/{flow}/{flow}.yaml * Distinguishes it from skill scripts, library YAMLs, and attribute files. */ private isV2FlowYamlPath; /** * Push V2 flow YAML changes. Closes GH issue #3 for newo_v2 layout. * Parses the V2 YAML, converts to V1-shaped FlowMetadata, and reuses the * shared syncFlowMetadata routine that calls PATCH/POST/DELETE per child. */ private pushV2FlowYamlUpdate; /** * Reconcile inline skill definitions from V2 flow YAML before pushing scripts. * * V2 keeps skill metadata (model, runner_type, parameters) in the flow YAML, * not in a separate skill metadata file. The map only contains the remote IDs * from a previous pull, so new local skills must be created before their * callers can be published. */ private syncV2FlowYamlDefinitions; private createMissingSkillParameters; /** * Detect "resource already exists" API errors. * * Matches only on the precise phrases the platform actually returns * ("already exists", "duplicate key"). Loose substrings like "exist" * would otherwise sweep up unrelated "does not exist" / "doesn't exist" * errors and trigger an incorrect reuse fallback. */ private isAlreadyExistsApiError; private normalizeRunnerType; private normalizeParameters; /** * Fail fast if no model could be resolved for a V2 skill. * * `buildV2SkillMetadataFromYaml` falls back to empty strings when neither * the skill nor the flow declare a model. The platform rejects empty * model_idn/provider_idn at creation/update time, but the error it returns * is generic — we surface a clearer message before issuing the request. */ private assertSkillModelResolved; private buildV2SkillMetadataFromYaml; private skillMetadataDiffers; private resolveV2FlowSkillScriptPath; /** * Push a V2 skill update * * V2 path: newo_customers/{cust}/{proj}/agents/{agent}/flows/{flow}/skills/{skill}.nsl */ private pushV2SkillUpdate; private normalizePathForComparison; private resolveV2SkillTargetForScriptPath; private resolveV2SkillTargetFromCanonicalPath; /** * Push a V2 library skill update * Path: .../newo_customers/{cust}/{proj}/libraries/{lib}/skills/{skillFile} */ private pushV2LibrarySkillUpdate; /** * Publish all flows */ private publishAllFlows; getChanges(customer: CustomerConfig): Promise[]>; private loadLocalV2FlowSkills; validate(customer: CustomerConfig, _items: LocalProjectData[]): Promise; getStatus(customer: CustomerConfig): Promise; } /** * Factory function for creating V2ProjectSyncStrategy */ export declare function createV2ProjectSyncStrategy(apiClientFactory: ApiClientFactory, logger: ILogger): V2ProjectSyncStrategy; //# sourceMappingURL=V2ProjectSyncStrategy.d.ts.map