@@ -198,6 +198,171 @@ export type HypercertCollection = OrgHypercertsClaimCollection.Main;
198198export type HypercertCollectionItem = OrgHypercertsClaimCollection . Item ;
199199/** Work scope tag for creating reusable scope atoms */
200200export type HypercertWorkScopeTag = OrgHypercertsHelperWorkScopeTag . Main ;
201+
202+ // ============================================================================
203+ // Work Scope Expression Types (beta.8+)
204+ // Boolean logic for expressing complex work scope conditions
205+ // ============================================================================
206+
207+ /**
208+ * Logical AND operation for work scope.
209+ *
210+ * Requires ALL nested scope expressions to be satisfied.
211+ * Used to express that an activity must match multiple scope conditions.
212+ *
213+ * @remarks
214+ * - `op` is always `"all"`
215+ * - `args` contains 1+ nested work scope expressions
216+ *
217+ * @example Match both "climate" AND "technology" scopes
218+ * ```typescript
219+ * const workScope: HypercertWorkScopeAll = {
220+ * $type: "org.hypercerts.defs#workScopeAll",
221+ * op: "all",
222+ * args: [
223+ * { $type: "org.hypercerts.defs#workScopeAtom", atom: climateRef },
224+ * { $type: "org.hypercerts.defs#workScopeAtom", atom: technologyRef }
225+ * ]
226+ * };
227+ * ```
228+ */
229+ export type HypercertWorkScopeAll = OrgHypercertsDefs . WorkScopeAll ;
230+
231+ /**
232+ * Logical OR operation for work scope.
233+ *
234+ * Requires AT LEAST ONE nested scope expression to be satisfied.
235+ * Used to express that an activity can match any of several scope conditions.
236+ *
237+ * @remarks
238+ * - `op` is always `"any"`
239+ * - `args` contains 1+ nested work scope expressions
240+ *
241+ * @example Match either "climate" OR "environment" scopes
242+ * ```typescript
243+ * const workScope: HypercertWorkScopeAny = {
244+ * $type: "org.hypercerts.defs#workScopeAny",
245+ * op: "any",
246+ * args: [
247+ * { $type: "org.hypercerts.defs#workScopeAtom", atom: climateRef },
248+ * { $type: "org.hypercerts.defs#workScopeAtom", atom: environmentRef }
249+ * ]
250+ * };
251+ * ```
252+ */
253+ export type HypercertWorkScopeAny = OrgHypercertsDefs . WorkScopeAny ;
254+
255+ /**
256+ * Logical NOT operation for work scope.
257+ *
258+ * Negates the nested scope expression - the work must NOT match the inner condition.
259+ * Used to exclude specific scope conditions.
260+ *
261+ * @remarks
262+ * - `op` is always `"not"`
263+ * - `arg` contains a single nested work scope expression to negate
264+ *
265+ * @example Exclude "fossil-fuels" scope
266+ * ```typescript
267+ * const workScope: HypercertWorkScopeNot = {
268+ * $type: "org.hypercerts.defs#workScopeNot",
269+ * op: "not",
270+ * arg: { $type: "org.hypercerts.defs#workScopeAtom", atom: fossilFuelsRef }
271+ * };
272+ * ```
273+ *
274+ * @example Combined: Climate work but NOT fossil fuels
275+ * ```typescript
276+ * const workScope: HypercertWorkScopeAll = {
277+ * $type: "org.hypercerts.defs#workScopeAll",
278+ * op: "all",
279+ * args: [
280+ * { $type: "org.hypercerts.defs#workScopeAtom", atom: climateRef },
281+ * {
282+ * $type: "org.hypercerts.defs#workScopeNot",
283+ * op: "not",
284+ * arg: { $type: "org.hypercerts.defs#workScopeAtom", atom: fossilFuelsRef }
285+ * }
286+ * ]
287+ * };
288+ * ```
289+ */
290+ export type HypercertWorkScopeNot = OrgHypercertsDefs . WorkScopeNot ;
291+
292+ /**
293+ * Atomic work scope reference.
294+ *
295+ * A leaf node in the work scope expression tree that references a specific
296+ * work scope tag via a StrongRef. This is the basic building block for
297+ * constructing complex scope expressions.
298+ *
299+ * @remarks
300+ * - `atom` is a StrongRef (uri + cid) pointing to a work scope tag record
301+ * - Work scope tags are stored at `org.hypercerts.helper.workScopeTag`
302+ *
303+ * @example Reference a specific scope tag
304+ * ```typescript
305+ * const workScope: HypercertWorkScopeAtom = {
306+ * $type: "org.hypercerts.defs#workScopeAtom",
307+ * atom: {
308+ * uri: "at://did:plc:abc123/org.hypercerts.helper.workScopeTag/climate",
309+ * cid: "bafyrei..."
310+ * }
311+ * };
312+ * ```
313+ */
314+ export type HypercertWorkScopeAtom = OrgHypercertsDefs . WorkScopeAtom ;
315+
316+ /**
317+ * Union type for all work scope expressions.
318+ *
319+ * Represents any valid work scope expression that can be used in the
320+ * `workScope` field of an activity claim. This type enables building
321+ * complex boolean logic trees to express sophisticated scope conditions.
322+ *
323+ * @remarks
324+ * Work scope expressions form an Abstract Syntax Tree (AST) for boolean logic:
325+ * - **HypercertWorkScopeAll**: AND - all children must match
326+ * - **HypercertWorkScopeAny**: OR - at least one child must match
327+ * - **HypercertWorkScopeNot**: NOT - child must not match
328+ * - **HypercertWorkScopeAtom**: Leaf node - reference to a scope tag
329+ *
330+ * @example Complex scope expression
331+ * ```typescript
332+ * // (Climate AND Technology) OR (Environment AND NOT FossilFuels)
333+ * const workScope: HypercertWorkScopeExpression = {
334+ * $type: "org.hypercerts.defs#workScopeAny",
335+ * op: "any",
336+ * args: [
337+ * {
338+ * $type: "org.hypercerts.defs#workScopeAll",
339+ * op: "all",
340+ * args: [
341+ * { $type: "org.hypercerts.defs#workScopeAtom", atom: climateRef },
342+ * { $type: "org.hypercerts.defs#workScopeAtom", atom: technologyRef }
343+ * ]
344+ * },
345+ * {
346+ * $type: "org.hypercerts.defs#workScopeAll",
347+ * op: "all",
348+ * args: [
349+ * { $type: "org.hypercerts.defs#workScopeAtom", atom: environmentRef },
350+ * {
351+ * $type: "org.hypercerts.defs#workScopeNot",
352+ * op: "not",
353+ * arg: { $type: "org.hypercerts.defs#workScopeAtom", atom: fossilFuelsRef }
354+ * }
355+ * ]
356+ * }
357+ * ]
358+ * };
359+ * ```
360+ */
361+ export type HypercertWorkScopeExpression =
362+ | HypercertWorkScopeAll
363+ | HypercertWorkScopeAny
364+ | HypercertWorkScopeNot
365+ | HypercertWorkScopeAtom ;
201366export type HypercertLocation = AppCertifiedLocation . Main ;
202367export type BadgeAward = AppCertifiedBadgeAward . Main ;
203368export type BadgeDefinition = AppCertifiedBadgeDefinition . Main ;
@@ -367,3 +532,78 @@ export type CreateProjectParams = CreateCollectionParams;
367532export type UpdateProjectParams = UpdateCollectionParams ;
368533
369534export type CreateProjectResult = CreateCollectionResult ;
535+
536+ // ============================================================================
537+ // Work Scope Tag Input Helper Types
538+ // ============================================================================
539+
540+ /**
541+ * Parameters for creating a new work scope tag.
542+ *
543+ * Work scope tags are reusable labels that can be referenced in work scope
544+ * expressions. They form a vocabulary of scope atoms that can be combined
545+ * using boolean logic (AND/OR/NOT) in activity claims.
546+ *
547+ * @remarks
548+ * Required fields:
549+ * - `key`: Lowercase, hyphenated machine-readable identifier (e.g., "climate-action", "open-source")
550+ * - `label`: Human-readable display name
551+ *
552+ * Optional fields:
553+ * - `kind`: Category type (recommended: "topic", "language", "domain", "method", "tag")
554+ * - `description`: Longer explanation of the scope
555+ * - `parent`: StrongRef to parent tag for hierarchical organization
556+ * - `aliases`: Alternative names or identifiers
557+ * - `externalReference`: Link to external definition (URI or blob)
558+ *
559+ * @example Create a simple scope tag
560+ * ```typescript
561+ * const params: CreateWorkScopeTagParams = {
562+ * key: "climate-action",
563+ * label: "Climate Action",
564+ * kind: "topic",
565+ * description: "Work related to climate change mitigation and adaptation"
566+ * };
567+ * ```
568+ *
569+ * @example Create a hierarchical scope tag
570+ * ```typescript
571+ * const params: CreateWorkScopeTagParams = {
572+ * key: "solar-energy",
573+ * label: "Solar Energy",
574+ * kind: "domain",
575+ * description: "Solar power generation and technology",
576+ * parent: { uri: "at://did:plc:xxx/org.hypercerts.helper.workScopeTag/renewable-energy", cid: "bafyrei..." }
577+ * };
578+ * ```
579+ */
580+ export type CreateWorkScopeTagParams = SetOptional < HypercertWorkScopeTag , "$type" | "createdAt" > ;
581+
582+ /**
583+ * Parameters for updating an existing work scope tag.
584+ *
585+ * All fields are optional. Only provided fields will be updated;
586+ * omitted fields retain their current values.
587+ *
588+ * @example Update a tag's description
589+ * ```typescript
590+ * const params: UpdateWorkScopeTagParams = {
591+ * description: "Updated description for climate action scope"
592+ * };
593+ * ```
594+ *
595+ * @example Add aliases to an existing tag
596+ * ```typescript
597+ * const params: UpdateWorkScopeTagParams = {
598+ * aliases: ["climate", "environmental-action", "green-initiatives"]
599+ * };
600+ * ```
601+ */
602+ export type UpdateWorkScopeTagParams = Partial < CreateWorkScopeTagParams > ;
603+
604+ /**
605+ * Union type for work scope tag parameters (create or update).
606+ *
607+ * Can be used in contexts where either create or update parameters are accepted.
608+ */
609+ export type WorkScopeTagParams = CreateWorkScopeTagParams | UpdateWorkScopeTagParams ;
0 commit comments