···11+import "@tylex/emitter";
22+33+namespace sh.tangled.knot.version {
44+ @doc("Get the version of a knot")
55+ @query
66+ op main(): {
77+ @required version: string;
88+ };
99+}
···11+import "@tylex/emitter";
22+33+namespace sh.tangled.label.`op` {
44+ @rec("tid")
55+ model Main {
66+ @doc("The subject (task, pull or discussion) of this label. Appviews may apply a `scope` check and refuse this op.")
77+ @required
88+ subject: atUri;
99+1010+ @required performedAt: datetime;
1111+ @required add: Operand[];
1212+ @required delete: Operand[];
1313+ }
1414+1515+ model Operand {
1616+ @doc("ATURI to the label definition")
1717+ @required
1818+ key: atUri;
1919+2020+ @doc("Stringified value of the label. This is first unstringed by appviews and then interpreted as a concrete value.")
2121+ @required
2222+ value: string;
2323+ }
2424+}
···11+import "@tylex/emitter";
22+33+namespace sh.tangled.label.definition {
44+ @rec("any")
55+ model Main {
66+ @doc("The display name of this label.")
77+ @minGraphemes(1)
88+ @maxGraphemes(40)
99+ @required
1010+ name: string;
1111+1212+ @doc("The type definition of this label. Appviews may allow sorting for certain types.")
1313+ @required
1414+ valueType: ValueType;
1515+1616+ @doc("The areas of the repo this label may apply to, eg.: sh.tangled.repo.issue. Appviews may choose to respect this.")
1717+ @required
1818+ scope: nsid[];
1919+2020+ @doc("The hex value for the background color for the label. Appviews may choose to respect this.")
2121+ color?: string;
2222+2323+ @required createdAt: datetime;
2424+2525+ @doc("Whether this label can be repeated for a given entity, eg.: [reviewer:foo, reviewer:bar]")
2626+ multiple?: boolean;
2727+ }
2828+2929+ @closed
3030+ @inline
3131+ union ConcreteType {
3232+ "null",
3333+ "boolean",
3434+ "integer",
3535+ "string",
3636+ }
3737+3838+ @closed
3939+ @inline
4040+ union FormatType {
4141+ "any",
4242+ "did",
4343+ "nsid",
4444+ }
4545+4646+ model ValueType {
4747+ @doc("The concrete type of this label's value.")
4848+ @required
4949+ type: ConcreteType;
5050+5151+ @doc("An optional constraint that can be applied on string concrete types.")
5252+ @required
5353+ format: FormatType;
5454+5555+ @doc("Closed set of values that this label can take.")
5656+ `enum`?: string[];
5757+ }
5858+}
···11+import "@tylex/emitter";
22+33+namespace sh.tangled.owner {
44+ @doc("Get the owner of a service")
55+ @query
66+ @errors(OwnerNotFound)
77+ op main(): {
88+ @required owner: did;
99+ };
1010+1111+ @doc("Owner is not set for this service")
1212+ model OwnerNotFound {}
1313+}