Skip to content

approvalRecordPath()

PromptScript API


approvalRecordPath(record): string

Defined in: core/src/types/approval.ts:240

Path of an approval record relative to the project root, with / separators: .promptscript/approvals/<role>/<prompt id>/<contentHash>.<approver slug>.json. The slug is the approver handle without its @, lowercased, so one approver has one file per role and hash on every file system. It holds no / and always follows <contentHash>., so a . in a handle never makes a . or .. segment.

Parameters

record

ApprovalRecordV1

Returns

string

Throws

PSError when the record fails isApprovalRecordV1, since its fields would not make a safe path.