@autobe/agent
Version:
AI backend server code generator
53 lines • 3.1 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.orchestrateRealizeOperation = orchestrateRealizeOperation;
const orchestrateRealizeCorrectWithRetry_1 = require("./correct/orchestrateRealizeCorrectWithRetry");
const orchestrateRealizeOperationCorrectCasting_1 = require("./orchestrateRealizeOperationCorrectCasting");
const orchestrateRealizeOperationCorrectOverall_1 = require("./orchestrateRealizeOperationCorrectOverall");
const orchestrateRealizeOperationWrite_1 = require("./orchestrateRealizeOperationWrite");
function orchestrateRealizeOperation(ctx, props) {
return __awaiter(this, void 0, void 0, function* () {
return (0, orchestrateRealizeCorrectWithRetry_1.orchestrateRealizeCorrectWithRetry)({
write: () => (0, orchestrateRealizeOperationWrite_1.orchestrateRealizeOperationWrite)(ctx, {
authorizations: props.authorizations,
collectors: props.collectors,
transformers: props.transformers,
progress: props.writeProgress,
}),
rewrite: (failed) => (0, orchestrateRealizeOperationWrite_1.orchestrateRealizeOperationWrite)(ctx, {
authorizations: props.authorizations,
collectors: props.collectors,
transformers: props.transformers,
progress: props.writeProgress,
targetEndpoints: failed.map((f) => f.endpoint),
}),
correctCasting: (functions) => (0, orchestrateRealizeOperationCorrectCasting_1.orchestrateRealizeOperationCorrectCasting)(ctx, {
authorizations: props.authorizations,
collectors: props.collectors,
transformers: props.transformers,
functions,
progress: props.validateProgress,
}),
correctOverall: (functions) => (0, orchestrateRealizeOperationCorrectOverall_1.orchestrateRealizeOperationCorrectOverall)(ctx, {
functions,
authorizations: props.authorizations,
collectors: props.collectors,
transformers: props.transformers,
progress: props.validateProgress,
}),
addProgress: (count) => {
props.validateProgress.total += 2 * count;
},
});
});
}
//# sourceMappingURL=orchestrateRealizeOperation.js.map