@mossbear/protocol 0.1.0-alpha.115 → 0.1.0-alpha.116
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/bundles.d.ts +662 -0
- package/dist/bundles.d.ts.map +1 -0
- package/dist/bundles.js +454 -0
- package/dist/bundles.js.map +1 -0
- package/dist/bundles.test.d.ts +2 -0
- package/dist/bundles.test.d.ts.map +1 -0
- package/dist/bundles.test.js +61 -0
- package/dist/bundles.test.js.map +1 -0
- package/dist/guideHistory.d.ts +643 -0
- package/dist/guideHistory.d.ts.map +1 -0
- package/dist/guideHistory.js +343 -0
- package/dist/guideHistory.js.map +1 -0
- package/dist/guideHistory.test.d.ts +2 -0
- package/dist/guideHistory.test.d.ts.map +1 -0
- package/dist/guideHistory.test.js +35 -0
- package/dist/guideHistory.test.js.map +1 -0
- package/dist/guideImport.d.ts +398 -0
- package/dist/guideImport.d.ts.map +1 -0
- package/dist/guideImport.js +350 -0
- package/dist/guideImport.js.map +1 -0
- package/dist/guideImport.test.d.ts +2 -0
- package/dist/guideImport.test.d.ts.map +1 -0
- package/dist/guideImport.test.js +62 -0
- package/dist/guideImport.test.js.map +1 -0
- package/dist/guideSnapshot.d.ts +105 -0
- package/dist/guideSnapshot.d.ts.map +1 -0
- package/dist/guideSnapshot.js +101 -0
- package/dist/guideSnapshot.js.map +1 -0
- package/dist/guideSnapshot.test.d.ts +2 -0
- package/dist/guideSnapshot.test.d.ts.map +1 -0
- package/dist/guideSnapshot.test.js +49 -0
- package/dist/guideSnapshot.test.js.map +1 -0
- package/dist/pairing.d.ts +1 -1
- package/dist/schemas.d.ts +14 -2042
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +13 -1358
- package/dist/schemas.js.map +1 -1
- package/dist/types.d.ts +4 -27
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/wirePrimitives.d.ts +87 -0
- package/dist/wirePrimitives.d.ts.map +1 -1
- package/dist/wirePrimitives.js +121 -0
- package/dist/wirePrimitives.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundles.d.ts","sourceRoot":"","sources":["../src/bundles.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAM5B,iFAAiF;AACjF,eAAO,MAAM,sBAAsB,MAAM,CAAA;AAQzC,eAAO,MAAM,gBAAgB,0JAM5B,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,QAA8B,CAAA;AAEnE,eAAO,MAAM,qBAAqB,qIAGjC,CAAA;AAED,oDAAoD;AACpD,eAAO,MAAM,yBAAyB,MAAM,CAAA;AAE5C;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;aAGhC,CAAA;AAEF,uDAAuD;AACvD,eAAO,MAAM,4BAA4B,8KAWxC,CAAA;AAcD,eAAO,MAAM,YAAY;IAOvB;;;;;;;;;;OAUG;;;;;;;;;;;;aAEH,CAAA;AAEF,eAAO,MAAM,wBAAwB;;QAdnC;;;;;;;;;;WAUG;;;;;;;;;;;;;aAMH,CAAA;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,uBAAuB,+CAA+B,CAAA;AAEnE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,iDAAiC,CAAA;AAEjE,eAAO,MAAM,0BAA0B;IA0DrC;;;;OAIG;;;;;;;;;;IA1DH,sEAAsE;;IAEtE;;;;;;;;;;;;;;;OAeG;;IAEH;;;;;OAKG;;IAEH;;;;;;;;;;;;;OAaG;;IAEH;;;;;;;;;;OAUG;;aASH,CAAA;AAEF;;;;;GAKG;AACH;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,MAAM,CAAA;AAEtC,yDAAyD;AACzD,eAAO,MAAM,yBAAyB,KAAK,CAAA;AAE3C,eAAO,MAAM,iCAAiC;;IAE5C;;;;OAIG;;IAIH;;;;OAI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 @@
|
|
|
1
|
+
/** Bundle identity, subscriptions, membership, and authoring wire contracts. */
|
|
2
|
+
import * as v from 'valibot';
|
|
3
|
+
import { isBundleSlug } from './bundleSlug.js';
|
|
4
|
+
import { MachineIdSchema } from './pairing.js';
|
|
5
|
+
import { ArtifactDescriptionSchema, displayNameSchema } from './wirePrimitives.js';
|
|
6
|
+
/** A bundle's display name. Bundles are addressed by slug; this is the label. */
|
|
7
|
+
export const BUNDLE_NAME_MAX_LENGTH = 200;
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
// Context bundle schemas
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
// url-safe slug, unique per user. Lowercase alphanumerics + hyphens, must start
|
|
12
|
+
// with an alphanumeric so it reads cleanly in a URL/path.
|
|
13
|
+
export const BundleSlugSchema = v.pipe(v.string(), v.check(isBundleSlug, 'slug must be lowercase alphanumeric with hyphens, at most 64 characters'));
|
|
14
|
+
/**
|
|
15
|
+
* A publisher's lowercase handle: the prefix of a published bundle's address,
|
|
16
|
+
* `<handle>/<slug>` (`mossbear/guides`). Slugs are unique per workspace, so a
|
|
17
|
+
* bare slug names one of the caller's own bundles and a published bundle is
|
|
18
|
+
* named through its publisher.
|
|
19
|
+
*/
|
|
20
|
+
export const PUBLISHER_HANDLE_PATTERN = /^[a-z0-9][a-z0-9-]{0,38}$/;
|
|
21
|
+
export const PublisherHandleSchema = v.pipe(v.string(), v.regex(PUBLISHER_HANDLE_PATTERN, 'handle must be lowercase alphanumeric with hyphens'));
|
|
22
|
+
/** The longest publisher name a reader is shown. */
|
|
23
|
+
export const PUBLISHER_NAME_MAX_LENGTH = 100;
|
|
24
|
+
/**
|
|
25
|
+
* Who publishes a bundle, as a reader sees it. Present only on a bundle that is
|
|
26
|
+
* published; absent is the ordinary case, a bundle of the caller's own.
|
|
27
|
+
*/
|
|
28
|
+
export const BundlePublisherSchema = v.object({
|
|
29
|
+
name: v.pipe(v.string(), v.maxLength(PUBLISHER_NAME_MAX_LENGTH)),
|
|
30
|
+
handle: PublisherHandleSchema,
|
|
31
|
+
});
|
|
32
|
+
/** A published bundle's address, `<handle>/<slug>`. */
|
|
33
|
+
export const PublishedBundleAddressSchema = v.pipe(v.string(), v.maxLength(104), v.check((value) => {
|
|
34
|
+
const at = value.indexOf('/');
|
|
35
|
+
if (at <= 0)
|
|
36
|
+
return false;
|
|
37
|
+
return (PUBLISHER_HANDLE_PATTERN.test(value.slice(0, at)) &&
|
|
38
|
+
isBundleSlug(value.slice(at + 1)));
|
|
39
|
+
}, 'address must be <publisher handle>/<bundle slug>'));
|
|
40
|
+
/**
|
|
41
|
+
* The two marks a subscribed bundle carries wherever it is listed: who
|
|
42
|
+
* publishes it, and that the caller may read it but not write it. `readOnly`
|
|
43
|
+
* is sent only as `true`, for a caller that reaches the bundle by publication
|
|
44
|
+
* rather than membership; the publisher's own members edit it as any bundle.
|
|
45
|
+
* Both optional, so a CLI built before them parses a new server unchanged.
|
|
46
|
+
*/
|
|
47
|
+
const publishedBundleMarks = {
|
|
48
|
+
publisher: v.optional(BundlePublisherSchema),
|
|
49
|
+
readOnly: v.optional(v.literal(true)),
|
|
50
|
+
};
|
|
51
|
+
export const BundleSchema = v.object({
|
|
52
|
+
id: v.string(),
|
|
53
|
+
slug: BundleSlugSchema,
|
|
54
|
+
name: v.string(),
|
|
55
|
+
createdAt: v.string(),
|
|
56
|
+
description: v.optional(v.nullable(v.string())),
|
|
57
|
+
...publishedBundleMarks,
|
|
58
|
+
/**
|
|
59
|
+
* The project id of the repo that owns this bundle's items, when one claims it
|
|
60
|
+
* (`subscription-delivery-target-plan.md` → slice 3). Absent is the ordinary
|
|
61
|
+
* case: a bundle with no home is edited wherever its owner likes.
|
|
62
|
+
*
|
|
63
|
+
* A home makes the named checkout the only writer — a PR there is the review
|
|
64
|
+
* — and every other writer, the dashboard included, is refused by name.
|
|
65
|
+
*
|
|
66
|
+
* Optional rather than nullable so a CLI built before this field parses a new
|
|
67
|
+
* server's listing unchanged.
|
|
68
|
+
*/
|
|
69
|
+
home: v.optional(v.string()),
|
|
70
|
+
});
|
|
71
|
+
export const BundleListResponseSchema = v.object({
|
|
72
|
+
bundles: v.array(BundleSchema),
|
|
73
|
+
});
|
|
74
|
+
/**
|
|
75
|
+
* How a bundle reaches a repo. Two scopes and no third:
|
|
76
|
+
*
|
|
77
|
+
* - `repo` — named by the committed `.mossbear/config.json`, shared with
|
|
78
|
+
* teammates by `git clone`.
|
|
79
|
+
* - `user` — recorded against the account, private, and on every machine.
|
|
80
|
+
*
|
|
81
|
+
* A bundle both scopes name carries **both** labels. An earlier shape reported a
|
|
82
|
+
* single winning `scope`, which made `status` and `doctor` — both of which count
|
|
83
|
+
* the account's subscriptions by filtering for `user` — report zero for a bundle
|
|
84
|
+
* that is genuinely subscribed at the account level and will keep delivering to
|
|
85
|
+
* every other repo. The scopes are not mutually exclusive, so the wire shape
|
|
86
|
+
* must not say they are. Raised by Codex on #735.
|
|
87
|
+
*/
|
|
88
|
+
export const SubscriptionScopeSchema = v.picklist(['repo', 'user']);
|
|
89
|
+
/**
|
|
90
|
+
* Where a subscription's items are delivered, independent of where their source
|
|
91
|
+
* lives (`subscription-delivery-target-plan.md` → slice 2).
|
|
92
|
+
*
|
|
93
|
+
* - `repo` — land at the item's path in the checkout doing the sync, under the
|
|
94
|
+
* same git-owned write rule every project item obeys.
|
|
95
|
+
* - `global` — land in the machine-global namespace, unattended.
|
|
96
|
+
*
|
|
97
|
+
* **Absent is not a third value.** A subscription that names no target routes on
|
|
98
|
+
* the item's own `root`, which is what every subscription meant before this
|
|
99
|
+
* field existed — so the column and the config key are both nullable and the
|
|
100
|
+
* default bundle keeps behaving exactly as it does today.
|
|
101
|
+
*/
|
|
102
|
+
export const DeliverTargetSchema = v.picklist(['repo', 'global']);
|
|
103
|
+
export const ResolvedSubscriptionSchema = v.object({
|
|
104
|
+
id: v.string(),
|
|
105
|
+
slug: BundleSlugSchema,
|
|
106
|
+
name: v.string(),
|
|
107
|
+
/** Every scope that names this bundle. Never empty; may hold both. */
|
|
108
|
+
scopes: v.pipe(v.array(SubscriptionScopeSchema), v.minLength(1)),
|
|
109
|
+
/**
|
|
110
|
+
* The **account** subscription's delivery target, when there is an account
|
|
111
|
+
* subscription and it names one.
|
|
112
|
+
*
|
|
113
|
+
* Only the account side, and deliberately so: the repo side's target lives in
|
|
114
|
+
* the committed `.mossbear/config.json` on the caller's own disk, which the
|
|
115
|
+
* server cannot read — the same asymmetry that makes this endpoint a round
|
|
116
|
+
* trip at all. Echoing a value the caller just sent would make the server look
|
|
117
|
+
* like the authority on a fact it does not hold. The caller pairs this with
|
|
118
|
+
* its own committed `deliver` to build the per-scope target set
|
|
119
|
+
* (`packages/cli/src/artifacts/delivery.ts` → `deliveryBundles`).
|
|
120
|
+
*
|
|
121
|
+
* Optional rather than nullable so a CLI built before this field parses a new
|
|
122
|
+
* server's response unchanged, and a new CLI reads an old server's response as
|
|
123
|
+
* "names no target" — which is the absent-field default either way.
|
|
124
|
+
*/
|
|
125
|
+
deliver: v.optional(DeliverTargetSchema),
|
|
126
|
+
/**
|
|
127
|
+
* The bundle's home repo, when one claims it. Sent on every resolved
|
|
128
|
+
* subscription regardless of scope, because it is a property of the *bundle*
|
|
129
|
+
* rather than of either subscription — unlike `deliver`, which each scope
|
|
130
|
+
* answers for itself.
|
|
131
|
+
*/
|
|
132
|
+
home: v.optional(v.string()),
|
|
133
|
+
/**
|
|
134
|
+
* Ids this account has switched off for the asking machine, on a bundle that
|
|
135
|
+
* reaches it through the account subscription alone. An item whose own id or
|
|
136
|
+
* `guideId` is listed is not delivered.
|
|
137
|
+
*
|
|
138
|
+
* The server computes it per machine: artifacts switched off everywhere or
|
|
139
|
+
* on this machine that this bundle can deliver, plus every member when the
|
|
140
|
+
* bundle itself is switched off. Account-scoped and nowhere else: a repo
|
|
141
|
+
* subscription is a committed file shared by everyone who clones it, so a
|
|
142
|
+
* mute there would be one member deciding for the team. A muted guide leaves
|
|
143
|
+
* the desired delivery list, and the global namespace prunes it once no repo
|
|
144
|
+
* still refers to it — repo by repo, as each syncs, because the referrer
|
|
145
|
+
* record is machine-local repo ids.
|
|
146
|
+
*/
|
|
147
|
+
muted: v.optional(v.array(v.string())),
|
|
148
|
+
/**
|
|
149
|
+
* The same set as `muted`, sent instead of it when the calling repo's
|
|
150
|
+
* committed config also subscribes this bundle. It applies to the account
|
|
151
|
+
* target only: the repo's own subscription still delivers into the checkout,
|
|
152
|
+
* because an off removes only what reaches the machine through the account.
|
|
153
|
+
*
|
|
154
|
+
* A separate key rather than `muted`, because a CLI that predates it applies
|
|
155
|
+
* `muted` before either target is planned and would drop the repo delivery
|
|
156
|
+
* too. That CLI ignores this key and delivers to both targets, which fails
|
|
157
|
+
* toward the agent having the content.
|
|
158
|
+
*/
|
|
159
|
+
accountMuted: v.optional(v.array(v.string())),
|
|
160
|
+
...publishedBundleMarks,
|
|
161
|
+
/**
|
|
162
|
+
* The address this bundle was resolved from, when the caller named it as
|
|
163
|
+
* `<handle>/<slug>` in `repoBundleAddresses` rather than by id. Lets the
|
|
164
|
+
* caller pair each committed address with the id it stands for.
|
|
165
|
+
*/
|
|
166
|
+
address: v.optional(PublishedBundleAddressSchema),
|
|
167
|
+
});
|
|
168
|
+
/**
|
|
169
|
+
* The ids a repo's committed config names. Sent rather than looked up, because
|
|
170
|
+
* the committed file is on the caller's disk and the server has no way to read
|
|
171
|
+
* it — that asymmetry is the whole reason delivery used to be written back into
|
|
172
|
+
* the repo.
|
|
173
|
+
*/
|
|
174
|
+
/**
|
|
175
|
+
* Capped, like the other batch endpoints. The route expands this into
|
|
176
|
+
* `inArray(bundles.id, …)`, one Postgres bind parameter per id, and the wire
|
|
177
|
+
* protocol tops out at 65,535 of them — so an uncapped array lets a body well
|
|
178
|
+
* under the request-size limit reach the database and fail as a 500 rather than
|
|
179
|
+
* being refused as bad input. Raised by Codex on #735.
|
|
180
|
+
*/
|
|
181
|
+
export const MAX_REPO_BUNDLE_IDS = 500;
|
|
182
|
+
/** Capped for the reason `MAX_REPO_BUNDLE_IDS` gives. */
|
|
183
|
+
export const MAX_REPO_BUNDLE_ADDRESSES = 64;
|
|
184
|
+
export const ResolveSubscriptionsRequestSchema = v.object({
|
|
185
|
+
repoBundleIds: v.pipe(v.array(v.string()), v.maxLength(MAX_REPO_BUNDLE_IDS)),
|
|
186
|
+
/**
|
|
187
|
+
* Published bundles the committed config names by address,
|
|
188
|
+
* `<handle>/<slug>`, rather than by id. Optional, so a CLI that sends only
|
|
189
|
+
* ids is answered as before.
|
|
190
|
+
*/
|
|
191
|
+
repoBundleAddresses: v.optional(v.pipe(v.array(PublishedBundleAddressSchema), v.maxLength(MAX_REPO_BUNDLE_ADDRESSES))),
|
|
192
|
+
/**
|
|
193
|
+
* The calling machine's stable id (`MachineIdSchema`). Optional, so an older
|
|
194
|
+
* CLI is answered as before; the server records it for the calling key only
|
|
195
|
+
* when that key has none yet.
|
|
196
|
+
*/
|
|
197
|
+
machineId: v.optional(MachineIdSchema),
|
|
198
|
+
});
|
|
199
|
+
export const ResolveSubscriptionsResponseSchema = v.object({
|
|
200
|
+
/** The effective delivery set, de-duplicated by bundle id. */
|
|
201
|
+
bundles: v.array(ResolvedSubscriptionSchema),
|
|
202
|
+
/**
|
|
203
|
+
* Committed ids the caller cannot see. **Reported, never dropped** — the line
|
|
204
|
+
* was put in the config deliberately by whoever owns the repo, so a non-member
|
|
205
|
+
* gets a named failure rather than deletion advice.
|
|
206
|
+
*
|
|
207
|
+
* It also names the caller's **account** subscriptions whose bundle they can
|
|
208
|
+
* no longer read: one unpublished, or in a workspace they left. The row is
|
|
209
|
+
* still theirs, so a sync must hold retirement for it as for a repo id it
|
|
210
|
+
* cannot see, rather than read its absence as an empty bundle.
|
|
211
|
+
*/
|
|
212
|
+
unresolved: v.array(v.object({ id: v.string() })),
|
|
213
|
+
/**
|
|
214
|
+
* Committed addresses (`repoBundleAddresses`) that name no published bundle.
|
|
215
|
+
* Kept apart from `unresolved`, whose entries are ids, so a CLI that reads
|
|
216
|
+
* `id` off every entry is never handed one without it. Absent when the
|
|
217
|
+
* request named no address.
|
|
218
|
+
*/
|
|
219
|
+
unresolvedAddresses: v.optional(v.array(v.object({ address: PublishedBundleAddressSchema }))),
|
|
220
|
+
/**
|
|
221
|
+
* Account-level settings the sync needs, carried on the response every sync
|
|
222
|
+
* already fetches rather than on a request of their own.
|
|
223
|
+
*
|
|
224
|
+
* `deliverGlobalSkills` is the account's "Deliver my global skills" switch:
|
|
225
|
+
* whether guides scoped to every repo may be written to the global skills
|
|
226
|
+
* directories of every machine and cloud session this account syncs. Only a
|
|
227
|
+
* signed-in browser session can change it; it is reported here, never
|
|
228
|
+
* accepted. **Optional**, so a response from a server that predates it parses,
|
|
229
|
+
* and the CLI reads its absence as "the server did not say", which delivers
|
|
230
|
+
* nothing and removes nothing.
|
|
231
|
+
*/
|
|
232
|
+
account: v.optional(v.object({
|
|
233
|
+
deliverGlobalSkills: v.boolean(),
|
|
234
|
+
})),
|
|
235
|
+
/**
|
|
236
|
+
* True when the caller's token is limited to certain bundles. Such a token
|
|
237
|
+
* resolves only what it was granted, so an id in `unresolved` may be a bundle
|
|
238
|
+
* the account can reach and the token cannot. Said once for the response,
|
|
239
|
+
* never per id, so it confirms nothing about any one bundle. Optional: absent
|
|
240
|
+
* means an ordinary token, and a server that predates it never sends it.
|
|
241
|
+
*/
|
|
242
|
+
limitedToken: v.optional(v.boolean()),
|
|
243
|
+
});
|
|
244
|
+
/**
|
|
245
|
+
* Subscribe the calling account to a bundle it can see, or change the delivery
|
|
246
|
+
* target of a subscription it already has.
|
|
247
|
+
*
|
|
248
|
+
* **The product path to a non-default bundle** (`subscription-delivery-target-plan.md`
|
|
249
|
+
* → slice 2). Before this, the only insert into `user_bundle_subscriptions` was
|
|
250
|
+
* the one that mints an account's own capture bundle, so an account could not
|
|
251
|
+
* subscribe to anything else without a hand-written row.
|
|
252
|
+
*
|
|
253
|
+
* Idempotent by the table's composite key: subscribing twice is one
|
|
254
|
+
* subscription, and a second call carrying a different `deliver` updates it
|
|
255
|
+
* rather than failing.
|
|
256
|
+
*/
|
|
257
|
+
/** No account should be able to make one sync unboundedly expensive. */
|
|
258
|
+
export const MAX_MUTED_GUIDE_IDS = 1000;
|
|
259
|
+
export const SubscribeBundleRequestSchema = v.object({
|
|
260
|
+
bundleId: v.string(),
|
|
261
|
+
/**
|
|
262
|
+
* Where this account's subscription delivers. **Three states, and all three
|
|
263
|
+
* are reachable**: a value sets the target, an explicit `null` clears it back
|
|
264
|
+
* to "route on the item's root", and omitting the field leaves whatever is
|
|
265
|
+
* stored.
|
|
266
|
+
*
|
|
267
|
+
* The first shipped version made omission clear the target, so that "route on
|
|
268
|
+
* the item's root" would stay reachable. It made a bare re-subscribe — the
|
|
269
|
+
* commonest call there is — silently reset routing the caller never mentioned:
|
|
270
|
+
* `mossbear pull <bundle> --account` a second time would wipe a target set the
|
|
271
|
+
* first time, and print a success line saying nothing about it. Found by the
|
|
272
|
+
* automated reviewer on #1246. A nullable field reaches the same state without
|
|
273
|
+
* making silence mean a write.
|
|
274
|
+
*/
|
|
275
|
+
deliver: v.optional(v.nullable(DeliverTargetSchema)),
|
|
276
|
+
/**
|
|
277
|
+
* The ids to have switched off on every machine, as far as this bundle can
|
|
278
|
+
* deliver them — the whole set, replacing what is stored. `[]` switches them
|
|
279
|
+
* all back on, and omitting the field leaves the stored set alone.
|
|
280
|
+
*
|
|
281
|
+
* An id switched off here is off for the account, through every bundle that
|
|
282
|
+
* carries it. Switching one back on (an id this bundle delivers that is off
|
|
283
|
+
* now and absent here) needs a dashboard session: a CLI key is refused with
|
|
284
|
+
* 403, because an agent may narrow what it receives but never widen it.
|
|
285
|
+
*
|
|
286
|
+
* The same three states as `deliver` above, reached the same way: an explicit
|
|
287
|
+
* empty clears, and silence never means a write. So changing a delivery target
|
|
288
|
+
* cannot unmute anything, and muting cannot move a target.
|
|
289
|
+
*/
|
|
290
|
+
muted: v.optional(v.pipe(v.array(v.string()), v.maxLength(MAX_MUTED_GUIDE_IDS))),
|
|
291
|
+
});
|
|
292
|
+
export const SubscribeBundleResponseSchema = v.object({
|
|
293
|
+
bundleId: v.string(),
|
|
294
|
+
/** False when the subscription was already there and only its target moved. */
|
|
295
|
+
created: v.boolean(),
|
|
296
|
+
deliver: v.optional(DeliverTargetSchema),
|
|
297
|
+
/** The stored mute set after this write. Omitted when nothing is muted. */
|
|
298
|
+
muted: v.optional(v.array(v.string())),
|
|
299
|
+
});
|
|
300
|
+
export const CreateBundleRequestSchema = v.object({
|
|
301
|
+
description: v.optional(v.nullable(ArtifactDescriptionSchema)),
|
|
302
|
+
slug: BundleSlugSchema,
|
|
303
|
+
name: displayNameSchema(BUNDLE_NAME_MAX_LENGTH),
|
|
304
|
+
// The workspace to create the bundle in. Omitted means the caller's default
|
|
305
|
+
// workspace; a workspace the caller is not a member of is refused.
|
|
306
|
+
workspaceId: v.optional(v.pipe(v.string(), v.minLength(1))),
|
|
307
|
+
});
|
|
308
|
+
export const CreateBundleResponseSchema = v.object({
|
|
309
|
+
bundle: BundleSchema,
|
|
310
|
+
});
|
|
311
|
+
// A membership is addressed by the artifact id alone: a guide and its body are
|
|
312
|
+
// one id, so no membership kind travels the wire. An older client may still send
|
|
313
|
+
// `itemType` on attach (or `?itemType=` on detach); this schema is not strict, so
|
|
314
|
+
// the field is dropped on parse rather than refused.
|
|
315
|
+
/**
|
|
316
|
+
* The member to attach, by its artifact id. `itemId` is the name a CLI from before
|
|
317
|
+
* release step 2 sends; both are read, and the parsed value is always `artifactId`.
|
|
318
|
+
* Drop `itemId` once no such CLI is left to send it.
|
|
319
|
+
*/
|
|
320
|
+
/** The most artifacts one attach request may name. */
|
|
321
|
+
export const MAX_BUNDLE_MEMBERS_PER_ATTACH = 200;
|
|
322
|
+
export const AttachBundleMemberRequestSchema = v.pipe(v.object({
|
|
323
|
+
artifactId: v.optional(v.pipe(v.string(), v.minLength(1))),
|
|
324
|
+
itemId: v.optional(v.pipe(v.string(), v.minLength(1))),
|
|
325
|
+
// A list files them in one request and is answered per id, once for a
|
|
326
|
+
// repeated id (match results by `artifactId`, not by position)
|
|
327
|
+
// (`AttachBundleMembersResponseSchema`). The single-id forms keep their
|
|
328
|
+
// body and their `{ attached }` answer for CLIs that predate the list.
|
|
329
|
+
artifactIds: v.optional(v.pipe(v.array(v.pipe(v.string(), v.minLength(1))),
|
|
330
|
+
// Before the cap, so the cap counts distinct artifacts.
|
|
331
|
+
v.transform((ids) => [...new Set(ids)]), v.minLength(1), v.maxLength(MAX_BUNDLE_MEMBERS_PER_ATTACH))),
|
|
332
|
+
}), v.check((request) => request.artifactIds === undefined
|
|
333
|
+
? request.artifactId !== undefined || request.itemId !== undefined
|
|
334
|
+
: request.artifactId === undefined && request.itemId === undefined, 'A member needs an artifactId, or a list of artifactIds on its own.'), v.transform((request) => request.artifactIds
|
|
335
|
+
? { artifactIds: request.artifactIds }
|
|
336
|
+
: { artifactId: (request.artifactId ?? request.itemId) }));
|
|
337
|
+
export const AttachBundleMemberResponseSchema = v.object({
|
|
338
|
+
// False when the item was already a member — attach is idempotent, and the
|
|
339
|
+
// caller (multi-select menu applying a diff) treats both as success.
|
|
340
|
+
attached: v.boolean(),
|
|
341
|
+
});
|
|
342
|
+
/**
|
|
343
|
+
* One id's outcome in a list attach. `unavailable` is every refusal that is not
|
|
344
|
+
* a path collision, and reads the same whether the artifact is missing, not the
|
|
345
|
+
* caller's to file or in another workspace, so a list cannot probe which ids
|
|
346
|
+
* exist.
|
|
347
|
+
*/
|
|
348
|
+
export const AttachBundleMembersResultSchema = v.object({
|
|
349
|
+
artifactId: v.string(),
|
|
350
|
+
status: v.picklist(['added', 'already_there', 'unavailable', 'path_taken']),
|
|
351
|
+
});
|
|
352
|
+
export const AttachBundleMembersResponseSchema = v.object({
|
|
353
|
+
results: v.array(AttachBundleMembersResultSchema),
|
|
354
|
+
});
|
|
355
|
+
export const DetachBundleMemberResponseSchema = v.object({
|
|
356
|
+
detached: v.boolean(),
|
|
357
|
+
});
|
|
358
|
+
/**
|
|
359
|
+
* The most field keys a bundle's shared column list may hold, and the longest
|
|
360
|
+
* one. A key is a frontmatter key as written, so the bound is on what a
|
|
361
|
+
* dashboard could ever show as a column rather than on any real key's length;
|
|
362
|
+
* both are generous enough that a refusal means a client bug.
|
|
363
|
+
*/
|
|
364
|
+
export const BUNDLE_COLUMNS_MAX_COUNT = 100;
|
|
365
|
+
export const BUNDLE_COLUMN_KEY_MAX_LENGTH = 200;
|
|
366
|
+
/**
|
|
367
|
+
* A bundle's shared column list: field keys in display order, no key twice.
|
|
368
|
+
* An array that repeats a key is refused rather than deduplicated, since the
|
|
369
|
+
* order is the content and a client that sent one has lost track of its own
|
|
370
|
+
* list.
|
|
371
|
+
*/
|
|
372
|
+
export const BundleColumnsSchema = v.pipe(v.array(v.pipe(v.string(), v.minLength(1), v.maxLength(BUNDLE_COLUMN_KEY_MAX_LENGTH))), v.maxLength(BUNDLE_COLUMNS_MAX_COUNT), v.check((keys) => new Set(keys).size === keys.length, 'columns must not repeat a key'));
|
|
373
|
+
// Rename changes the display name only. The slug is the bundle's identity —
|
|
374
|
+
// repos subscribe by slug in `.mossbear/config.json` → `bundles`, and
|
|
375
|
+
// `mossbear pull <slug>` addresses it — so a slug change would silently break
|
|
376
|
+
// every subscribed repo (context-bundle-authoring-plan.md → D14).
|
|
377
|
+
/**
|
|
378
|
+
* What `PATCH /api/v1/context/bundles/:id` may change: the display name, the
|
|
379
|
+
* home repo, the shared column list, or any of them. The slug stays immutable
|
|
380
|
+
* — repos address a bundle by id and name it by slug, so a slug change would
|
|
381
|
+
* rename a folder in every subscriber's checkout.
|
|
382
|
+
*
|
|
383
|
+
* Every field optional, with a check that at least one is present: a body that
|
|
384
|
+
* changes nothing is a request the caller did not mean to send, and answering it
|
|
385
|
+
* 200 would hide a client bug. `home: null` clears the claim, which is how a
|
|
386
|
+
* repo hands a bundle back — distinct from omitting the field, which leaves it.
|
|
387
|
+
* `columns: null` is the same for the column list: it returns the bundle to
|
|
388
|
+
* "not chosen", where every shared field shows.
|
|
389
|
+
*/
|
|
390
|
+
export const UpdateBundleRequestSchema = v.pipe(v.object({
|
|
391
|
+
name: v.optional(displayNameSchema(BUNDLE_NAME_MAX_LENGTH)),
|
|
392
|
+
home: v.optional(v.nullable(v.pipe(v.string(), v.minLength(1), v.maxLength(200)))),
|
|
393
|
+
columns: v.optional(v.nullable(BundleColumnsSchema)),
|
|
394
|
+
description: v.optional(v.nullable(ArtifactDescriptionSchema)),
|
|
395
|
+
}), v.check((value) => value.name !== undefined ||
|
|
396
|
+
value.home !== undefined ||
|
|
397
|
+
value.columns !== undefined ||
|
|
398
|
+
value.description !== undefined, 'name, home, columns or description is required'));
|
|
399
|
+
export const UpdateBundleResponseSchema = v.object({
|
|
400
|
+
bundle: BundleSchema,
|
|
401
|
+
});
|
|
402
|
+
export const DeleteBundleResponseSchema = v.object({
|
|
403
|
+
deleted: v.boolean(),
|
|
404
|
+
// `movedToInbox` was removed in `inbox-as-view` slice 2. Deleting a bundle no
|
|
405
|
+
// longer re-parents anything: an item that loses its last membership is
|
|
406
|
+
// unfiled, which is what the inbox view shows, rather than stranded. The
|
|
407
|
+
// field could only ever have reported 0 afterwards, and a number that can
|
|
408
|
+
// never be non-zero is a discriminator carrying no decision. Nothing on the
|
|
409
|
+
// CLI wire parsed it — `parseDeleteBundleResponse` has one caller, the
|
|
410
|
+
// dashboard's own bundles client.
|
|
411
|
+
});
|
|
412
|
+
export function parseBundleListResponse(data) {
|
|
413
|
+
return v.parse(BundleListResponseSchema, data);
|
|
414
|
+
}
|
|
415
|
+
export function parseCreateBundleRequest(data) {
|
|
416
|
+
return v.parse(CreateBundleRequestSchema, data);
|
|
417
|
+
}
|
|
418
|
+
export function parseCreateBundleResponse(data) {
|
|
419
|
+
return v.parse(CreateBundleResponseSchema, data);
|
|
420
|
+
}
|
|
421
|
+
export function parseAttachBundleMemberRequest(data) {
|
|
422
|
+
return v.parse(AttachBundleMemberRequestSchema, data);
|
|
423
|
+
}
|
|
424
|
+
export function parseAttachBundleMemberResponse(data) {
|
|
425
|
+
return v.parse(AttachBundleMemberResponseSchema, data);
|
|
426
|
+
}
|
|
427
|
+
export function parseAttachBundleMembersResponse(data) {
|
|
428
|
+
return v.parse(AttachBundleMembersResponseSchema, data);
|
|
429
|
+
}
|
|
430
|
+
export function parseDetachBundleMemberResponse(data) {
|
|
431
|
+
return v.parse(DetachBundleMemberResponseSchema, data);
|
|
432
|
+
}
|
|
433
|
+
export function parseSubscribeBundleRequest(data) {
|
|
434
|
+
return v.parse(SubscribeBundleRequestSchema, data);
|
|
435
|
+
}
|
|
436
|
+
export function parseSubscribeBundleResponse(data) {
|
|
437
|
+
return v.parse(SubscribeBundleResponseSchema, data);
|
|
438
|
+
}
|
|
439
|
+
export function parseResolveSubscriptionsRequest(data) {
|
|
440
|
+
return v.parse(ResolveSubscriptionsRequestSchema, data);
|
|
441
|
+
}
|
|
442
|
+
export function parseResolveSubscriptionsResponse(data) {
|
|
443
|
+
return v.parse(ResolveSubscriptionsResponseSchema, data);
|
|
444
|
+
}
|
|
445
|
+
export function parseUpdateBundleRequest(data) {
|
|
446
|
+
return v.parse(UpdateBundleRequestSchema, data);
|
|
447
|
+
}
|
|
448
|
+
export function parseUpdateBundleResponse(data) {
|
|
449
|
+
return v.parse(UpdateBundleResponseSchema, data);
|
|
450
|
+
}
|
|
451
|
+
export function parseDeleteBundleResponse(data) {
|
|
452
|
+
return v.parse(DeleteBundleResponseSchema, data);
|
|
453
|
+
}
|
|
454
|
+
//# sourceMappingURL=bundles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundles.js","sourceRoot":"","sources":["../src/bundles.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAA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A6B,EAAE,IAAI,CAAC,CAAA;AACrD,CAAC;AAED,MAAM,UAAU,gCAAgC,CAAC,IAAa;IAC5D,OAAO,CAAC,CAAC,KAAK,CAAC,iCAAiC,EAAE,IAAI,CAAC,CAAA;AACzD,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,IAAa;IAC7D,OAAO,CAAC,CAAC,KAAK,CAAC,kCAAkC,EAAE,IAAI,CAAC,CAAA;AAC1D,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,IAAa;IACpD,OAAO,CAAC,CAAC,KAAK,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAA;AACjD,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,IAAa;IACrD,OAAO,CAAC,CAAC,KAAK,CAAC,0BAA0B,EAAE,IAAI,CAAC,CAAA;AAClD,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,IAAa;IACrD,OAAO,CAAC,CAAC,KAAK,CAAC,0BAA0B,EAAE,IAAI,CAAC,CAAA;AAClD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundles.test.d.ts","sourceRoot":"","sources":["../src/bundles.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { describe, expect, expectTypeOf, it } from 'vitest';
|
|
3
|
+
import * as bundles from './bundles.js';
|
|
4
|
+
import * as protocol from './index.js';
|
|
5
|
+
import * as schemas from './schemas.js';
|
|
6
|
+
import * as primitives from './wirePrimitives.js';
|
|
7
|
+
describe('bundle contract compatibility', () => {
|
|
8
|
+
it('keeps existing aggregate imports bound to the domain contracts', () => {
|
|
9
|
+
for (const [name, value] of Object.entries(bundles)) {
|
|
10
|
+
expect(Reflect.get(schemas, name), name).toBe(value);
|
|
11
|
+
expect(Reflect.get(protocol, name), name).toBe(value);
|
|
12
|
+
}
|
|
13
|
+
expect(schemas.ArtifactDescriptionSchema).toBe(primitives.ArtifactDescriptionSchema);
|
|
14
|
+
expect(schemas.displayNameSchema).toBe(primitives.displayNameSchema);
|
|
15
|
+
expect(bundles.CreateBundleRequestSchema.entries.description.wrapped.wrapped).toBe(primitives.ArtifactDescriptionSchema);
|
|
16
|
+
expectTypeOf().toEqualTypeOf();
|
|
17
|
+
expectTypeOf().toEqualTypeOf();
|
|
18
|
+
expectTypeOf().toEqualTypeOf();
|
|
19
|
+
expectTypeOf(bundles.parseSubscribeBundleRequest).returns.toEqualTypeOf();
|
|
20
|
+
});
|
|
21
|
+
it('preserves legacy member ids, precedence, and distinct-id batch limits', () => {
|
|
22
|
+
expect(bundles.parseAttachBundleMemberRequest({ itemId: 'old', itemType: 'guide' })).toEqual({ artifactId: 'old' });
|
|
23
|
+
expect(bundles.parseAttachBundleMemberRequest({ artifactId: 'new', itemId: 'old' })).toEqual({ artifactId: 'new' });
|
|
24
|
+
expect(bundles.parseAttachBundleMemberRequest({ artifactIds: Array(201).fill('same') })).toEqual({ artifactIds: ['same'] });
|
|
25
|
+
for (const input of [
|
|
26
|
+
{},
|
|
27
|
+
{ artifactIds: [] },
|
|
28
|
+
{ artifactId: 'x', artifactIds: ['y'] },
|
|
29
|
+
{ artifactIds: Array.from({ length: 201 }, (_, i) => `${i}`) },
|
|
30
|
+
]) {
|
|
31
|
+
expect(() => bundles.parseAttachBundleMemberRequest(input)).toThrow(v.ValiError);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
it('keeps omission distinct from clearing subscription and bundle fields', () => {
|
|
35
|
+
expect(bundles.parseSubscribeBundleRequest({ bundleId: 'b' })).toEqual({
|
|
36
|
+
bundleId: 'b',
|
|
37
|
+
});
|
|
38
|
+
expect(bundles.parseSubscribeBundleRequest({ bundleId: 'b', deliver: null, muted: [] })).toEqual({ bundleId: 'b', deliver: null, muted: [] });
|
|
39
|
+
expect(bundles.parseUpdateBundleRequest({ home: null, columns: null, description: null })).toEqual({ home: null, columns: null, description: null });
|
|
40
|
+
expect(() => bundles.parseUpdateBundleRequest({ slug: 'ignored' })).toThrow('name, home, columns or description is required');
|
|
41
|
+
expect(() => bundles.parseUpdateBundleRequest({ columns: ['a', 'a'] })).toThrow('columns must not repeat a key');
|
|
42
|
+
expect(bundles.parseCreateBundleRequest({ name: ' Name ', slug: 'valid' })).toEqual({ name: 'Name', slug: 'valid' });
|
|
43
|
+
expect(() => bundles.parseCreateBundleRequest({ name: '\u200d', slug: 'valid' })).toThrow(primitives.DISPLAY_NAME_CONTROL_CHARACTER_MESSAGE);
|
|
44
|
+
});
|
|
45
|
+
it('reads old listings without introducing delivery or publication defaults', () => {
|
|
46
|
+
expect(bundles.parseResolveSubscriptionsResponse({
|
|
47
|
+
bundles: [{ id: 'b', slug: 'b', name: 'B', scopes: ['repo', 'user'] }],
|
|
48
|
+
unresolved: [],
|
|
49
|
+
})).toEqual({
|
|
50
|
+
bundles: [{ id: 'b', slug: 'b', name: 'B', scopes: ['repo', 'user'] }],
|
|
51
|
+
unresolved: [],
|
|
52
|
+
});
|
|
53
|
+
expect(() => bundles.parseResolveSubscriptionsResponse({
|
|
54
|
+
bundles: [{ id: 'b', slug: 'b', name: 'B', scopes: [] }],
|
|
55
|
+
unresolved: [],
|
|
56
|
+
})).toThrow(v.ValiError);
|
|
57
|
+
expect(v.safeParse(bundles.PublishedBundleAddressSchema, 'publisher/a-b').success).toBe(true);
|
|
58
|
+
expect(v.safeParse(bundles.PublishedBundleAddressSchema, 'publisher/a/b').success).toBe(false);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=bundles.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundles.test.js","sourceRoot":"","sources":["../src/bundles.test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE3D,OAAO,KAAK,OAAO,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