@antiphony/shared 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api-codecs.cjs +130 -21
- package/dist/cjs/api-codecs.d.cts +67 -23
- package/dist/cjs/index.cjs +168 -21
- package/dist/cjs/index.d.cts +3 -86
- package/dist/cjs/nsid.cjs +10 -0
- package/dist/cjs/nsid.d.cts +25 -1
- package/dist/cjs/types/audio.cjs +125 -18
- package/dist/cjs/types/audio.d.cts +157 -47
- package/dist/cjs/types/processing.cjs +174 -0
- package/dist/cjs/types/processing.d.cts +336 -0
- package/dist/esm/api-codecs.d.ts +101 -57
- package/dist/esm/api-codecs.js +3 -2
- package/dist/esm/chunk-AKIWUNNK.js +129 -0
- package/dist/esm/{chunk-SBYNIQRZ.js → chunk-F5RKN3GY.js} +10 -1
- package/dist/esm/{chunk-WL2GSPGC.js → chunk-J2HE6PE2.js} +31 -29
- package/dist/esm/{chunk-RUUHUNZ6.js → chunk-UYCXRNTK.js} +7 -4
- package/dist/esm/index.d.ts +3 -86
- package/dist/esm/index.js +4 -3
- package/dist/esm/nsid.d.ts +25 -1
- package/dist/esm/nsid.js +1 -1
- package/dist/esm/types/audio.d.ts +268 -158
- package/dist/esm/types/audio.js +2 -1
- package/dist/esm/types/processing.d.ts +336 -0
- package/dist/esm/types/processing.js +3 -0
- package/package.json +6 -2
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { FirestoreTimestampSchema } from './chunk-D655OH2I.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
var ProcessingStageStatusSchema = z.enum(["pending", "ready", "failed", "skipped"]);
|
|
5
|
+
var PROCESSING_STAGES = ["denoise", "trim", "transcribe", "waveform"];
|
|
6
|
+
var ProcessingStageSchema = z.enum(PROCESSING_STAGES);
|
|
7
|
+
var BYTE_MUTATING_STAGES = ["denoise", "trim"];
|
|
8
|
+
var DERIVED_STAGES = ["transcribe", "waveform"];
|
|
9
|
+
var ProcessingRequestSchema = z.object({
|
|
10
|
+
transcribe: z.boolean().optional(),
|
|
11
|
+
denoise: z.boolean().optional(),
|
|
12
|
+
trim: z.boolean().optional(),
|
|
13
|
+
waveform: z.boolean().optional(),
|
|
14
|
+
/**
|
|
15
|
+
* Whether a completed byte-mutating stage should invalidate and recompute
|
|
16
|
+
* the derived artifacts that describe the old audio. Defaults to **true**
|
|
17
|
+
* — a transcript of superseded audio is wrong, not merely stale.
|
|
18
|
+
*
|
|
19
|
+
* `false` opts out, for an app that would rather keep the existing
|
|
20
|
+
* transcript than pay to regenerate it. It does NOT name a stage, so a
|
|
21
|
+
* request carrying only `reprocess` requests no work.
|
|
22
|
+
*/
|
|
23
|
+
reprocess: z.boolean().optional()
|
|
24
|
+
});
|
|
25
|
+
var ProcessingStageMapSchema = z.object({
|
|
26
|
+
transcribe: ProcessingStageStatusSchema.optional(),
|
|
27
|
+
denoise: ProcessingStageStatusSchema.optional(),
|
|
28
|
+
trim: ProcessingStageStatusSchema.optional(),
|
|
29
|
+
waveform: ProcessingStageStatusSchema.optional()
|
|
30
|
+
});
|
|
31
|
+
var ResolvedProcessingSchema = ProcessingStageMapSchema.extend({
|
|
32
|
+
reprocess: z.boolean().optional()
|
|
33
|
+
});
|
|
34
|
+
var ProcessingStateSchema = ResolvedProcessingSchema.extend({
|
|
35
|
+
/**
|
|
36
|
+
* Content CID of the processed audio variant — the composed output of every
|
|
37
|
+
* byte-mutating stage that has completed. The record's own
|
|
38
|
+
* `embed.audio.ref.$link` stays the ORIGINAL CID (immutable content
|
|
39
|
+
* address); only the read-time view swaps playback to this variant.
|
|
40
|
+
*/
|
|
41
|
+
processedBlobCid: z.string().optional(),
|
|
42
|
+
/**
|
|
43
|
+
* MIME type of the processed variant. Present because providers may
|
|
44
|
+
* TRANSCODE — the ElevenLabs Voice Isolator returns MP3 regardless of what
|
|
45
|
+
* it is given — so the variant's type cannot be assumed to match
|
|
46
|
+
* `embed.audio.mimeType`. Anything reading the variant's bytes must use
|
|
47
|
+
* this, not the embed's.
|
|
48
|
+
*/
|
|
49
|
+
processedMimeType: z.string().optional(),
|
|
50
|
+
/**
|
|
51
|
+
* Duration of the processed variant, when a byte-mutating stage changed it
|
|
52
|
+
* (i.e. trim). Absent when the variant's duration matches the original.
|
|
53
|
+
*/
|
|
54
|
+
processedDurationMs: z.number().int().min(0).optional(),
|
|
55
|
+
/**
|
|
56
|
+
* Which denoiser produced the variant's denoise contribution — provenance,
|
|
57
|
+
* the counterpart to a transcript record's `model`.
|
|
58
|
+
*
|
|
59
|
+
* Lives here because a cleaned variant, unlike a transcript, has no record
|
|
60
|
+
* of its own to carry it: it is a blob CID on this state. Without it,
|
|
61
|
+
* changing denoisers leaves no way to tell which variants predate the
|
|
62
|
+
* switch, so nothing can identify what to re-run.
|
|
63
|
+
*
|
|
64
|
+
* Named for the STAGE, not the variant (`processedModel`), because it
|
|
65
|
+
* describes one link of the byte-mutating chain rather than the composed
|
|
66
|
+
* artifact. Trim contributes to the same variant and has no model, and a
|
|
67
|
+
* later external link would want its own field rather than to overwrite
|
|
68
|
+
* this one.
|
|
69
|
+
*
|
|
70
|
+
* Written on every successful denoise, never cleared — it moves with
|
|
71
|
+
* `processedBlobCid`, which is only ever set, never reset. A denoise that
|
|
72
|
+
* FAILS leaves both alone, which is correct: the variant still holds the
|
|
73
|
+
* previous denoiser's output, so the previous model still describes it.
|
|
74
|
+
*
|
|
75
|
+
* Internal, like the other variant fields — `toProcessingView` projects
|
|
76
|
+
* stages only, so this never reaches a client.
|
|
77
|
+
*/
|
|
78
|
+
denoiseModel: z.string().optional(),
|
|
79
|
+
/**
|
|
80
|
+
* Peaks for the processed variant, once the `waveform` stage completes.
|
|
81
|
+
* Same normalization and bounds as `embed.waveform` (0–100, max 1000), so
|
|
82
|
+
* a view can never carry a larger payload than the record allows.
|
|
83
|
+
*/
|
|
84
|
+
waveformPeaks: z.array(z.number().int().min(0).max(100)).max(1e3).optional(),
|
|
85
|
+
/**
|
|
86
|
+
* When the current runner's exclusive claim on this post expires.
|
|
87
|
+
*
|
|
88
|
+
* Queue delivery is at-least-once, so the same job can arrive twice and
|
|
89
|
+
* run CONCURRENTLY. `process()` is idempotent under sequential retry — it
|
|
90
|
+
* acts on `pending` and re-does nothing already settled — but two passes
|
|
91
|
+
* interleaved is a different failure: both read the same `pending` state,
|
|
92
|
+
* both bill the provider for the same stage, and both write
|
|
93
|
+
* `processedBlobCid`, so the surviving variant is whichever finished last
|
|
94
|
+
* and the other's blob is orphaned.
|
|
95
|
+
*
|
|
96
|
+
* A runner claims this field transactionally before doing any work and
|
|
97
|
+
* clears it when finished; a second runner finding it unexpired declines
|
|
98
|
+
* and returns. It is an EXPIRY, not a boolean lock, because the holder can
|
|
99
|
+
* die mid-run (instance recycled, process killed) with no chance to
|
|
100
|
+
* release — a plain flag would strand the post permanently, where a lapsed
|
|
101
|
+
* lease lets the next delivery pick it up.
|
|
102
|
+
*
|
|
103
|
+
* Internal, like the variant fields above: `toProcessingView` projects
|
|
104
|
+
* stages only, so this never reaches a client.
|
|
105
|
+
*/
|
|
106
|
+
leaseUntil: FirestoreTimestampSchema.optional(),
|
|
107
|
+
updatedAt: FirestoreTimestampSchema
|
|
108
|
+
});
|
|
109
|
+
var ProcessingViewSchema = ProcessingStageMapSchema;
|
|
110
|
+
function toProcessingView(state) {
|
|
111
|
+
const view = {};
|
|
112
|
+
for (const stage of PROCESSING_STAGES) {
|
|
113
|
+
if (state[stage] !== void 0) view[stage] = state[stage];
|
|
114
|
+
}
|
|
115
|
+
return view;
|
|
116
|
+
}
|
|
117
|
+
function resolveAudioVariant(canonical, state) {
|
|
118
|
+
var _a;
|
|
119
|
+
if (!state) return canonical;
|
|
120
|
+
const hasVariant = state.processedBlobCid !== void 0;
|
|
121
|
+
const peaksAreCurrent = state.waveform === "ready" && state.waveformPeaks !== void 0;
|
|
122
|
+
return {
|
|
123
|
+
blobCid: hasVariant ? state.processedBlobCid : canonical.blobCid,
|
|
124
|
+
durationMs: hasVariant ? (_a = state.processedDurationMs) != null ? _a : canonical.durationMs : canonical.durationMs,
|
|
125
|
+
waveform: peaksAreCurrent ? state.waveformPeaks : canonical.waveform
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export { BYTE_MUTATING_STAGES, DERIVED_STAGES, PROCESSING_STAGES, ProcessingRequestSchema, ProcessingStageMapSchema, ProcessingStageSchema, ProcessingStageStatusSchema, ProcessingStateSchema, ProcessingViewSchema, ResolvedProcessingSchema, resolveAudioVariant, toProcessingView };
|
|
@@ -14,10 +14,19 @@ var EMBED_NSID = {
|
|
|
14
14
|
Audio: "dev.antiphony.embed.audio",
|
|
15
15
|
RecordWithAudio: "dev.antiphony.embed.recordWithAudio"
|
|
16
16
|
};
|
|
17
|
+
var XRPC_NSID = {
|
|
18
|
+
// Queries (GET).
|
|
19
|
+
GetPost: "dev.antiphony.audio.getPost",
|
|
20
|
+
GetThread: "dev.antiphony.audio.getThread",
|
|
21
|
+
GetPlaybackUrl: "dev.antiphony.audio.getPlaybackUrl",
|
|
22
|
+
// Procedures (POST).
|
|
23
|
+
CreatePost: "dev.antiphony.audio.createPost",
|
|
24
|
+
ReprocessPost: "dev.antiphony.audio.reprocessPost"
|
|
25
|
+
};
|
|
17
26
|
var COLLECTIONS = {
|
|
18
27
|
// One post collection + the transcript enrichment namespace.
|
|
19
28
|
[NSID.AudioPost]: "posts",
|
|
20
29
|
[NSID.AudioTranscript]: "audio_transcripts"
|
|
21
30
|
};
|
|
22
31
|
|
|
23
|
-
export { COLLECTIONS, EMBED_NSID, NSID };
|
|
32
|
+
export { COLLECTIONS, EMBED_NSID, NSID, XRPC_NSID };
|
|
@@ -1,25 +1,8 @@
|
|
|
1
|
+
import { ProcessingViewSchema, ProcessingStateSchema } from './chunk-AKIWUNNK.js';
|
|
1
2
|
import { FirestoreTimestampSchema } from './chunk-D655OH2I.js';
|
|
2
3
|
import { BlobRefSchema } from './chunk-SMK4OZNU.js';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
|
|
5
|
-
var ProcessingStageStatusSchema = z.enum(["pending", "ready", "failed", "skipped"]);
|
|
6
|
-
var ProcessingRequestSchema = z.object({
|
|
7
|
-
transcribe: z.boolean().optional(),
|
|
8
|
-
denoise: z.boolean().optional()
|
|
9
|
-
});
|
|
10
|
-
var ProcessingStateSchema = z.object({
|
|
11
|
-
transcribe: ProcessingStageStatusSchema.optional(),
|
|
12
|
-
denoise: ProcessingStageStatusSchema.optional(),
|
|
13
|
-
/** Content CID of the denoised audio variant, once `denoise === 'ready'`. */
|
|
14
|
-
denoisedBlobCid: z.string().optional(),
|
|
15
|
-
updatedAt: FirestoreTimestampSchema
|
|
16
|
-
});
|
|
17
|
-
var ProcessingViewSchema = z.object({
|
|
18
|
-
transcribe: ProcessingStageStatusSchema.optional(),
|
|
19
|
-
denoise: ProcessingStageStatusSchema.optional()
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
// types/audio.ts
|
|
23
6
|
var StrongRefSchema = z.object({
|
|
24
7
|
uri: z.string().regex(/^at:\/\/.+/, "Must be an at:// URI"),
|
|
25
8
|
cid: z.string()
|
|
@@ -53,20 +36,34 @@ var TimedTranscriptSchema = z.object({
|
|
|
53
36
|
});
|
|
54
37
|
var AudioEmbedViewSchema = z.object({
|
|
55
38
|
$type: z.literal("dev.antiphony.embed.audio#view"),
|
|
39
|
+
/**
|
|
40
|
+
* `url`, `durationMs` and `waveform` are RESOLVED, not copied: once
|
|
41
|
+
* processing has produced an audio variant they describe that variant
|
|
42
|
+
* rather than the bytes the client uploaded. They always agree with one
|
|
43
|
+
* another — a duration and a set of peaks are only meaningful against the
|
|
44
|
+
* audio `url` actually points at.
|
|
45
|
+
*
|
|
46
|
+
* A client that stored `durationMs` at upload time should therefore expect
|
|
47
|
+
* it to change (trim removes leading/trailing silence), and should render
|
|
48
|
+
* these three as a set rather than caching them independently. The record's
|
|
49
|
+
* originals are immutable and unaffected; this is a read-time resolution.
|
|
50
|
+
*/
|
|
56
51
|
url: z.string().url(),
|
|
57
52
|
durationMs: z.number().int().min(0).optional(),
|
|
58
|
-
// `alt
|
|
59
|
-
//
|
|
53
|
+
// `alt` is copied from the stored embed; keep the same bounds so a view can
|
|
54
|
+
// never carry a larger payload than the record allows.
|
|
60
55
|
alt: z.string().max(1e4).optional(),
|
|
61
56
|
waveform: z.array(z.number().int().min(0).max(100)).max(1e3).optional(),
|
|
62
57
|
/** Lifted from the transcript enrichment record; absent until transcription completes. */
|
|
63
58
|
transcript: TimedTranscriptSchema.optional(),
|
|
64
59
|
/**
|
|
65
|
-
* Per-stage audio-processing status (
|
|
66
|
-
* opted into processing
|
|
67
|
-
* means the client should poll (or re-render) for the
|
|
68
|
-
*
|
|
69
|
-
*
|
|
60
|
+
* Per-stage audio-processing status (denoise / trim / transcribe /
|
|
61
|
+
* waveform), when the app opted into processing. Absent otherwise. A
|
|
62
|
+
* `pending` stage means the client should poll (or re-render) for the
|
|
63
|
+
* result — including a stage that returns to `pending` after having been
|
|
64
|
+
* `ready`, which is how a recompute surfaces. Once a byte-mutating stage
|
|
65
|
+
* completes, `url`/`durationMs`/`waveform` above already resolve to the
|
|
66
|
+
* processed audio variant. See `types/processing.ts`.
|
|
70
67
|
*/
|
|
71
68
|
processing: ProcessingViewSchema.optional()
|
|
72
69
|
});
|
|
@@ -170,10 +167,15 @@ var ViewerStateSchema = z.object({
|
|
|
170
167
|
replyDisabledReason: z.enum(["unauthenticated", "not_a_participant"]).optional()
|
|
171
168
|
});
|
|
172
169
|
var PostRecordPublicSchema = z.object({
|
|
173
|
-
text
|
|
174
|
-
|
|
170
|
+
// `text`, `title` and `langs` keep the record's bounds, for the same reason
|
|
171
|
+
// `AudioEmbedViewSchema.alt` does: a view must never be able to carry a
|
|
172
|
+
// larger payload than the record it projects. The write path already
|
|
173
|
+
// enforces these, so no stored post can exceed them — stating them here
|
|
174
|
+
// keeps the published contract honest rather than adding a new constraint.
|
|
175
|
+
text: z.string().max(3e3),
|
|
176
|
+
title: z.string().max(3e3).optional(),
|
|
175
177
|
reply: ReplyRefSchema.optional(),
|
|
176
|
-
langs: z.array(z.string()).optional(),
|
|
178
|
+
langs: z.array(z.string()).max(3).optional(),
|
|
177
179
|
selfLabels: z.array(z.string()).optional(),
|
|
178
180
|
createdAt: FirestoreTimestampSchema
|
|
179
181
|
});
|
|
@@ -193,4 +195,4 @@ var AudioPostViewSchema = z.object({
|
|
|
193
195
|
viewer: ViewerStateSchema
|
|
194
196
|
});
|
|
195
197
|
|
|
196
|
-
export { ActorProfileRecordSchema, AudioEmbedSchema, AudioEmbedViewSchema, AudioPostRecordSchema, AudioPostViewSchema, PostRecordPublicSchema,
|
|
198
|
+
export { ActorProfileRecordSchema, AudioEmbedSchema, AudioEmbedViewSchema, AudioPostRecordSchema, AudioPostViewSchema, PostRecordPublicSchema, ReplyRefSchema, StrongRefSchema, TimedTranscriptSchema, TranscriptEnrichmentRecordSchema, TranscriptSegmentSchema, ViewerStateSchema };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReplyRefSchema, AudioEmbedSchema } from './chunk-J2HE6PE2.js';
|
|
2
|
+
import { ProcessingRequestSchema } from './chunk-AKIWUNNK.js';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
|
|
4
5
|
var CreateAudioPostRequestSchema = z.object({
|
|
@@ -15,9 +16,11 @@ var CreateAudioPostRequestSchema = z.object({
|
|
|
15
16
|
/** Author self-label values (content warnings). */
|
|
16
17
|
selfLabels: z.array(z.string()).optional(),
|
|
17
18
|
/**
|
|
18
|
-
* Opt-in audio processing for this post's audio (
|
|
19
|
-
*
|
|
20
|
-
* `skipped` on the view rather than failing the
|
|
19
|
+
* Opt-in audio processing for this post's audio (denoise / trim /
|
|
20
|
+
* transcribe / waveform). All default off. Stages the deployment can't
|
|
21
|
+
* provide come back marked `skipped` on the view rather than failing the
|
|
22
|
+
* create. A multi-stage request runs denoise → trim → (transcribe,
|
|
23
|
+
* waveform); request stages individually to override that order. See
|
|
21
24
|
* `types/processing.ts`.
|
|
22
25
|
*/
|
|
23
26
|
processing: ProcessingRequestSchema.optional()
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,93 +1,10 @@
|
|
|
1
1
|
export { CreateAudioPostRequest, CreateAudioPostRequestSchema, PatchAudioPostRequest, PatchAudioPostRequestSchema } from './api-codecs.js';
|
|
2
2
|
export { FirestoreTimestamp, FirestoreTimestampSchema } from './types/records.js';
|
|
3
3
|
export { ActorProfileRecord, ActorProfileRecordSchema, AudioEmbed, AudioEmbedSchema, AudioEmbedView, AudioEmbedViewSchema, AudioPostRecord, AudioPostRecordSchema, AudioPostView, AudioPostViewSchema, PostRecordPublic, PostRecordPublicSchema, ReplyRef, ReplyRefSchema, StrongRef, StrongRefSchema, TimedTranscript, TimedTranscriptSchema, TranscriptEnrichmentRecord, TranscriptEnrichmentRecordSchema, TranscriptSegment, TranscriptSegmentSchema, ViewerState, ViewerStateSchema } from './types/audio.js';
|
|
4
|
-
|
|
4
|
+
export { BYTE_MUTATING_STAGES, CanonicalAudioFields, DERIVED_STAGES, PROCESSING_STAGES, ProcessingRequest, ProcessingRequestSchema, ProcessingStage, ProcessingStageMap, ProcessingStageMapSchema, ProcessingStageSchema, ProcessingStageStatus, ProcessingStageStatusSchema, ProcessingState, ProcessingStateSchema, ProcessingView, ProcessingViewSchema, ResolvedProcessing, ResolvedProcessingSchema, resolveAudioVariant, toProcessingView } from './types/processing.js';
|
|
5
5
|
export { BlobRef, BlobRefSchema } from './types/blob.js';
|
|
6
|
-
export { COLLECTIONS, EMBED_NSID, NSID, NsidValue, StoredNsidValue } from './nsid.js';
|
|
6
|
+
export { COLLECTIONS, EMBED_NSID, NSID, NsidValue, StoredNsidValue, XRPC_NSID, XrpcNsidValue } from './nsid.js';
|
|
7
7
|
export { ConflictError, ForbiddenError, NotFoundError, RateLimitError, ServiceError, UnauthorizedError, ValidationError } from './errors/index.js';
|
|
8
8
|
export { isFirestoreTimestamp } from './utils/index.js';
|
|
9
9
|
export { ReportedErrorEvent, buildReportedErrorEvent, reportError } from './observability/report-error.js';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Audio hygiene / enrichment processing (B5).
|
|
13
|
-
*
|
|
14
|
-
* Antiphony can, when the calling app opts in, run two pieces of audio
|
|
15
|
-
* processing on a post's audio: **transcription** (machine transcript, the
|
|
16
|
-
* `dev.antiphony.audio.transcript` enrichment) and **denoise** (a cleaned
|
|
17
|
-
* audio variant for playback). Both are OFF by default — the app asks for
|
|
18
|
-
* them per post via `CreateAudioPostRequest.processing`.
|
|
19
|
-
*
|
|
20
|
-
* The work runs asynchronously (outside the create request), so a post
|
|
21
|
-
* carries a mutable `processing` state that starts `pending` and settles to
|
|
22
|
-
* `ready`/`failed`/`skipped` per stage. That state is a storage-layer field —
|
|
23
|
-
* it is NOT part of the canonical lexicon record and never enters the record
|
|
24
|
-
* CID (like `kind` and `threadParticipants`), so processing can update it
|
|
25
|
-
* without changing the post's content address.
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* Per-stage status.
|
|
29
|
-
* - `pending` — requested, not yet done (the worker acts on these).
|
|
30
|
-
* - `ready` — completed.
|
|
31
|
-
* - `failed` — attempted and errored.
|
|
32
|
-
* - `skipped` — requested but this deployment has no provider for it.
|
|
33
|
-
*/
|
|
34
|
-
declare const ProcessingStageStatusSchema: z.ZodEnum<["pending", "ready", "failed", "skipped"]>;
|
|
35
|
-
type ProcessingStageStatus = z.infer<typeof ProcessingStageStatusSchema>;
|
|
36
|
-
/**
|
|
37
|
-
* What the calling app opts into, on `CreateAudioPostRequest`. Both default
|
|
38
|
-
* off; only `true` values request a stage.
|
|
39
|
-
*/
|
|
40
|
-
declare const ProcessingRequestSchema: z.ZodObject<{
|
|
41
|
-
transcribe: z.ZodOptional<z.ZodBoolean>;
|
|
42
|
-
denoise: z.ZodOptional<z.ZodBoolean>;
|
|
43
|
-
}, "strip", z.ZodTypeAny, {
|
|
44
|
-
transcribe?: boolean | undefined;
|
|
45
|
-
denoise?: boolean | undefined;
|
|
46
|
-
}, {
|
|
47
|
-
transcribe?: boolean | undefined;
|
|
48
|
-
denoise?: boolean | undefined;
|
|
49
|
-
}>;
|
|
50
|
-
type ProcessingRequest = z.infer<typeof ProcessingRequestSchema>;
|
|
51
|
-
/**
|
|
52
|
-
* Stored processing state on the post record (storage-layer; not in the CID).
|
|
53
|
-
* A stage key is present iff that stage was requested. `denoisedBlobCid`
|
|
54
|
-
* points at the cleaned audio variant once denoise completes — the record's
|
|
55
|
-
* own `embed.audio.ref.$link` stays the ORIGINAL CID (immutable content
|
|
56
|
-
* address); only the read-time view swaps playback to the cleaned variant.
|
|
57
|
-
*/
|
|
58
|
-
declare const ProcessingStateSchema: z.ZodObject<{
|
|
59
|
-
transcribe: z.ZodOptional<z.ZodEnum<["pending", "ready", "failed", "skipped"]>>;
|
|
60
|
-
denoise: z.ZodOptional<z.ZodEnum<["pending", "ready", "failed", "skipped"]>>;
|
|
61
|
-
/** Content CID of the denoised audio variant, once `denoise === 'ready'`. */
|
|
62
|
-
denoisedBlobCid: z.ZodOptional<z.ZodString>;
|
|
63
|
-
updatedAt: z.ZodEffects<z.ZodUnion<[z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodString, z.ZodNumber, z.ZodDate]>, Date, unknown>;
|
|
64
|
-
}, "strip", z.ZodTypeAny, {
|
|
65
|
-
updatedAt: Date;
|
|
66
|
-
transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
|
|
67
|
-
denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
|
|
68
|
-
denoisedBlobCid?: string | undefined;
|
|
69
|
-
}, {
|
|
70
|
-
transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
|
|
71
|
-
denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
|
|
72
|
-
denoisedBlobCid?: string | undefined;
|
|
73
|
-
updatedAt?: unknown;
|
|
74
|
-
}>;
|
|
75
|
-
type ProcessingState = z.infer<typeof ProcessingStateSchema>;
|
|
76
|
-
/**
|
|
77
|
-
* The processing status surfaced on the hydrated view — the per-stage status
|
|
78
|
-
* only (no internal storage fields). Absent when no processing was requested.
|
|
79
|
-
* Clients treat any `pending` stage as "still working".
|
|
80
|
-
*/
|
|
81
|
-
declare const ProcessingViewSchema: z.ZodObject<{
|
|
82
|
-
transcribe: z.ZodOptional<z.ZodEnum<["pending", "ready", "failed", "skipped"]>>;
|
|
83
|
-
denoise: z.ZodOptional<z.ZodEnum<["pending", "ready", "failed", "skipped"]>>;
|
|
84
|
-
}, "strip", z.ZodTypeAny, {
|
|
85
|
-
transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
|
|
86
|
-
denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
|
|
87
|
-
}, {
|
|
88
|
-
transcribe?: "pending" | "ready" | "failed" | "skipped" | undefined;
|
|
89
|
-
denoise?: "pending" | "ready" | "failed" | "skipped" | undefined;
|
|
90
|
-
}>;
|
|
91
|
-
type ProcessingView = z.infer<typeof ProcessingViewSchema>;
|
|
92
|
-
|
|
93
|
-
export { type ProcessingRequest, ProcessingRequestSchema, type ProcessingStageStatus, ProcessingStageStatusSchema, type ProcessingState, ProcessingStateSchema, type ProcessingView, ProcessingViewSchema };
|
|
10
|
+
import 'zod';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export { isFirestoreTimestamp } from './chunk-24KIXQZK.js';
|
|
2
|
-
export { CreateAudioPostRequestSchema, PatchAudioPostRequestSchema } from './chunk-
|
|
3
|
-
export { COLLECTIONS, EMBED_NSID, NSID } from './chunk-
|
|
2
|
+
export { CreateAudioPostRequestSchema, PatchAudioPostRequestSchema } from './chunk-UYCXRNTK.js';
|
|
3
|
+
export { COLLECTIONS, EMBED_NSID, NSID, XRPC_NSID } from './chunk-F5RKN3GY.js';
|
|
4
4
|
export { ConflictError, ForbiddenError, NotFoundError, RateLimitError, ServiceError, UnauthorizedError, ValidationError } from './chunk-7LW2FHLD.js';
|
|
5
5
|
import './chunk-72G3LBUQ.js';
|
|
6
6
|
export { buildReportedErrorEvent, reportError } from './chunk-BNNLHRH7.js';
|
|
7
|
-
export { ActorProfileRecordSchema, AudioEmbedSchema, AudioEmbedViewSchema, AudioPostRecordSchema, AudioPostViewSchema, PostRecordPublicSchema,
|
|
7
|
+
export { ActorProfileRecordSchema, AudioEmbedSchema, AudioEmbedViewSchema, AudioPostRecordSchema, AudioPostViewSchema, PostRecordPublicSchema, ReplyRefSchema, StrongRefSchema, TimedTranscriptSchema, TranscriptEnrichmentRecordSchema, TranscriptSegmentSchema, ViewerStateSchema } from './chunk-J2HE6PE2.js';
|
|
8
|
+
export { BYTE_MUTATING_STAGES, DERIVED_STAGES, PROCESSING_STAGES, ProcessingRequestSchema, ProcessingStageMapSchema, ProcessingStageSchema, ProcessingStageStatusSchema, ProcessingStateSchema, ProcessingViewSchema, ResolvedProcessingSchema, resolveAudioVariant, toProcessingView } from './chunk-AKIWUNNK.js';
|
|
8
9
|
export { FirestoreTimestampSchema } from './chunk-D655OH2I.js';
|
|
9
10
|
export { BlobRefSchema } from './chunk-SMK4OZNU.js';
|
|
10
11
|
import './chunk-5JBD5THX.js';
|
package/dist/esm/nsid.d.ts
CHANGED
|
@@ -23,6 +23,30 @@ declare const EMBED_NSID: {
|
|
|
23
23
|
readonly Audio: "dev.antiphony.embed.audio";
|
|
24
24
|
readonly RecordWithAudio: "dev.antiphony.embed.recordWithAudio";
|
|
25
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* XRPC method NSIDs — the `/xrpc/<nsid>` surface (see
|
|
28
|
+
* specs/xrpc-and-atproto-lex-strategy.md).
|
|
29
|
+
*
|
|
30
|
+
* These are **siblings** of the record NSIDs in `NSID`, not children of them.
|
|
31
|
+
* A method shares the authority segment (`dev.antiphony.audio`) with the record
|
|
32
|
+
* but never nests under the record's own name: the record is
|
|
33
|
+
* `dev.antiphony.audio.post` and the query that fetches it is
|
|
34
|
+
* `dev.antiphony.audio.getPost`. Deriving one by appending to the other
|
|
35
|
+
* produces `dev.antiphony.audio.post.getPost`, a different and undefined
|
|
36
|
+
* namespace — hence a separate map rather than a helper over `NSID`.
|
|
37
|
+
*
|
|
38
|
+
* Queries are `GET`, procedures are `POST`; the grouping below follows that
|
|
39
|
+
* split because it is also the auth split (procedures always require an acting
|
|
40
|
+
* actor, queries may be viewer-less).
|
|
41
|
+
*/
|
|
42
|
+
declare const XRPC_NSID: {
|
|
43
|
+
readonly GetPost: "dev.antiphony.audio.getPost";
|
|
44
|
+
readonly GetThread: "dev.antiphony.audio.getThread";
|
|
45
|
+
readonly GetPlaybackUrl: "dev.antiphony.audio.getPlaybackUrl";
|
|
46
|
+
readonly CreatePost: "dev.antiphony.audio.createPost";
|
|
47
|
+
readonly ReprocessPost: "dev.antiphony.audio.reprocessPost";
|
|
48
|
+
};
|
|
49
|
+
type XrpcNsidValue = typeof XRPC_NSID[keyof typeof XRPC_NSID];
|
|
26
50
|
/**
|
|
27
51
|
* Maps the STORED AT Protocol record-type NSIDs to Firestore collection
|
|
28
52
|
* names. When migrating to a PDS, this mapping becomes the adapter layer.
|
|
@@ -30,4 +54,4 @@ declare const EMBED_NSID: {
|
|
|
30
54
|
*/
|
|
31
55
|
declare const COLLECTIONS: Record<StoredNsidValue, string>;
|
|
32
56
|
|
|
33
|
-
export { COLLECTIONS, EMBED_NSID, NSID, type NsidValue, type StoredNsidValue };
|
|
57
|
+
export { COLLECTIONS, EMBED_NSID, NSID, type NsidValue, type StoredNsidValue, XRPC_NSID, type XrpcNsidValue };
|
package/dist/esm/nsid.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { COLLECTIONS, EMBED_NSID, NSID } from './chunk-
|
|
1
|
+
export { COLLECTIONS, EMBED_NSID, NSID, XRPC_NSID } from './chunk-F5RKN3GY.js';
|
|
2
2
|
import './chunk-5JBD5THX.js';
|