Gratias tibi agimus, domine, sanctae pater, omnipotens aeternae deus, qui nos transacto noctis spatio ad matutinis horas perducere dignatus es; quaesumus, ut dones nobis diem hunc sine peccato transire, quatenus ad uesperum gratias referamus: per.
Late 8th- or early 9th-century Gregorian sacramentary (no. 1491):
Gratias tibi agimus domine sanctę pater omnipotens aeternę
deus . qui nos de transacto noctis spatio ad matutinas horas perducere dignatus
es . quaesumus ut dones nobis diem hunc sine peccato transire . quatenus ad
uesperum et semper tibi deo gratias referamus . per dominum.
The 9th- or 10th-century Durham ritual, no. 241 (Rituale Ecclesiæ Dunelmensis or Durham Collectar, Durham Cathedral Library MS A.IV.19, fol. 18r). The Durham collectar, ed. Alicia Corrêa, Henry Bradshaw Society 105 (London: Boydell Press, 1992), 165 (no. 241), with abbreviations spelled out:
Gratias agamus Domine sancte pater omnipotens aeterne Deus qui nos de transacto noctis spatio ad matutinas horas perducere dignatus es, quaesumus ut dones nobis diem hunc sine peccato transire, quatenus ad uesperum tibi Deo gratias referamus. Per dominum.
The above three (but especially the second), i.e. "the prayer from which this collect [(the one below, the Anglican "Collect for grace")] developed", as translated by Hatchett (p. 126):The 9th- or 10th-century Durham ritual, no. 241 (Rituale Ecclesiæ Dunelmensis or Durham Collectar, Durham Cathedral Library MS A.IV.19, fol. 18r). The Durham collectar, ed. Alicia Corrêa, Henry Bradshaw Society 105 (London: Boydell Press, 1992), 165 (no. 241), with abbreviations spelled out:
Gratias agamus Domine sancte pater omnipotens aeterne Deus qui nos de transacto noctis spatio ad matutinas horas perducere dignatus es, quaesumus ut dones nobis diem hunc sine peccato transire, quatenus ad uesperum tibi Deo gratias referamus. Per dominum.
We give you thanks, Lord, holy Father, almighty everlasting God, who have brought us through the period of night to the morning hours. We beseech you that you grant that we pass through this day without sin, so that at vespers we may return thanks to you.
After this point it loses, somewhere along the way, the intra-horal anticipation of evening prayer. Or is the following, contra Hatchett, not at all the same prayer? The vocabulary is quite different. Yet it is this vocabulary, rather than that above, that I find in the Roman Breviary and what Hatchett flags as "the Sarum little office of Prime" (col. 54 of Procter and Wordsworth):
Roman Breviary: Domine Deus omnipotens, qui ad principium huius diei nos pervenire fecisti: tua nos hodie salva virtute; ut in hac die ad nullum declinemus peccatum, sed semper ad tuam iustitiam faciendam nostra procedant eloquia, dirigantur cogitationes et opera. Per.
Sarum "Preces ad Primum" (column 54 of Procter and Wordsworth): Domine Sancte Pater omnipotens æterne Deus : qui nos ad principium hujus diei pervenire fecisti : tua nos hodie salva virtute, et concede : ut in hac die ad nullum declinemus peccatum nec ullum incurramus periculum : sed semper ad tuam justitiam faciendam omnis nostra actio tuo moderamine dirigatur. Per.
I've struck out in both Bruylants and Corpus orationum. But there is lots of relevance on this prayer in Google. This specimen of 19th-century scholarship takes the line taken later by Hatchett. In any case, the BCP:
1549 BCP (ed. Cummings):
O Lorde oure heavenly father, almightye and everlivyng God, whiche haste safelye brought us to the beginning of this day: Defend us in the same with thy mighty power, and graunt that this daye wee fall into no synne, neyther runne into any kinde of daunger, but that al our doinges may be ordred by thy governaunce, to do alwaies that is righteous in thy sight: through Jesus Christe our lorde. Amen.
1662 BCP (ed. Cummings):
O Lord our heavenly Father, Almighty and everlasting God, who hast safely brought us to the beginning of this day; defend us in the same with thy mighty power, and grant that this day we fall into no sin, neither run into any kind of danger; but that all our doings may be ordered by thy governance, to do always that is righteous in thy sight; through Jesus Christ our Lord. Amen.
1928 BCP:
O Lord, our heavenly Father, Almighty and everlasting God, who hast safely brought us to the beginning of this day: Defend us in the same with thy mighty power; and grant that this day we fall into no sin, neither run into any kind of danger; but that all our doings, being ordered by thy governance, may be righteous in thy sight; through Jesus Christ our Lord. Amen.
1979 BCP, Morning Prayer I:
O Lord, our heavenly Father, almighty and everlasting God, who hast safely brought us to the beginning of this day: Defend us in the same with thy mighty power; and grant that this day we fall into no sin, neither run into any kind of danger; but that we, being ordered by thy governance, may do always what is righteous in thy sight; through Jesus Christ our Lord. Amen.
1979 BCP, Morning Prayer II:
Lord God, almighty and everlasting Father you have brought us in safety to this new day: Preserve us with your mighty power, that we may not fall into sin, nor be overcome by adversity; and in all we do, direct us to the fulfilling of your purpose; through Jesus Christ our Lord. Amen.