/** * @module agent-helpers * * Helper functions designed to simplify common ibGib operations for agentic usage. * These abstract away the low-level Factory_V1 details and provide clear, semantic * actions for creating and modifying data. */ import { IbGib_V1, IbGibRel8ns_V1, IbGibData_V1 } from '@ibgib/ts-gib/dist/V1/types.mjs'; import { IbGibSpaceAny } from './witness/space/space-base-v1.mjs'; import { MetaspaceService } from './witness/space/metaspace/metaspace-types.mjs'; import { TestStepInfo, TestRound } from './test-types.mjs'; /** * Creates a "Stone" ibGib - an immutable, primitive-like data record with no history/timeline. * Useful for static data, configurations, or standalone records. */ export declare function createStoneTestHelper({ ib, data, rel8ns, uuid, noTimestamp, }: { ib: string; data?: TData; rel8ns?: IbGibRel8ns_V1; uuid?: boolean; noTimestamp?: boolean; }): Promise>; /** * Creates a new "Living" Timeline Root. * This is the starting point for any mutable data structure (a file, a user profile, a post). */ export declare function createTimelineRootTestHelper({ ib, data, space, }: { ib: string; data?: TData; space: IbGibSpaceAny; }): Promise>; export interface TestIbGibIb { /** * @example alpha, beta, gamma, etc. */ atom: string; /** * concatenated r0 mut8 history * @example r0, r0r1, r0r1r2 */ rounds: string; /** * @example 0 for r0, 1 for r0r1, 2 for r0r1r2, etc. */ roundNumber: number; /** * concatenated v0 mut8 history * @example v0, v0v1, v0v1v2 */ versions: string; /** * @example 0 for v0, 1 for v0v1, 2 for v0v1v2, etc. */ versionNumber: number; /** * optional comments sans spaces, e.g., "thisIsAComment_thisIsAnother_heckWhyNotAThird" */ comments_snake_plus_CamelCase: string | undefined; } /** * Parses ib to extract base, rounds, and version. * Schema: [base] [r1r2...] [v0v1...] (space-delimited) * Example: "alpha r0r1 v0v1v2" → { base: "alpha", rounds: "r1", version: 2 } */ export declare function parseTestIb(ib: string): TestIbGibIb; /** * Stateful transformer for test operations. * Manages counters, rounds, and execution history. * * Usage: * ```typescript * const transformer = new TestTransformer(); * const r1 = transformer.newRound({ name: 'r1_common_history' }); * * const step = await transformer.mut8({ * Test transformer class that provides fluent method chaining for timeline testing. * Automatically tracks rounds, steps, provides test data snapshots, and auto-versions ibs. * * Ib versioning schema: `[base] [r1r2...] [v0v1v2]` (space-delimited) * Example: `alpha r1 v0` → `alpha r1 v1` → `alpha r1r2 v0` */ export declare class TestTransformer { private lc; private metaspace; private sourceSpace; private destSpace; private mut8Counter; private rel8Counter; private rounds; private get currentRound(); constructor(metaspace: MetaspaceService, sourceSpace: IbGibSpaceAny, destSpace: IbGibSpaceAny); /** * Start a new round of testing operations. */ newRound({ name, description }: { name: string; description?: string; }): TestRound; /** * Get all steps across all rounds. */ getAllSteps(): TestStepInfo[]; /** * Find a round by name. */ getRound(name: string): TestRound | undefined; /** * Reset all state (counters and rounds). */ reset(): void; /** * Get space by location. */ private getSpace; /** * Generates next ib based on current ib and round context. * Increments version and appends round if needed. */ private generateNextIb; /** * Create a timeline root with auto-tracking to current round. * * @example * const transformer = new TestTransformer(metaspace, sourceSpace, destSpace); * transformer.newRound({ name: 'r1_setup' }); * const step = await transformer.create({ * ib: 'alpha', * data: { type: 'alpha' }, * in: 'source', * }); */ create({ atom, data, in: location, name, comments_snake_plus_CamelCase, }: { atom: string; data?: TData; in: 'source' | 'dest'; name?: string; comments_snake_plus_CamelCase?: string; }): Promise; /** * Perform a mutation with optional field mutation and auto-versioning. * * @example * // With field and auto value * const step = await transformer.mut8({ * stepInfo: prevStep, * strField: 'commonField', * }); * // Creates: alpha r1 v0, sets commonField: 'value_1' * * @example * // With field and custom value * const step = await transformer.mut8({ * stepInfo: prevStep, * strField: { name: 'count', value: '42' }, * }); * * @example * // Ib-only mutation (no field) * const step = await transformer.mut8({ stepInfo: prevStep }); */ mut8({ ibGib, stepInfo, in: location, strField, name, comments_snake_plus_CamelCase, }: { ibGib?: IbGib_V1; stepInfo?: TestStepInfo; in?: 'source' | 'dest'; strField?: string | { name: string; value: string; }; name?: string; comments_snake_plus_CamelCase?: string; }): Promise; /** * Perform a relation with auto-generated rel8n name and auto-versioning. * * @example * const step = await transformer.rel8({ * stepInfo: prevStep, * targetIbGibs: [beta, gamma], * rel8nName: 'depends_on', * }); */ rel8({ stepInfo, ibGib, in: location, targetIbGibs, rel8nName, name, }: { stepInfo?: TestStepInfo; ibGib?: IbGib_V1; in: 'source' | 'dest'; targetIbGibs: IbGib_V1[]; rel8nName: string; name?: string; }): Promise; } //# sourceMappingURL=test-helpers.d.mts.map